From ac7f512247cf3623fe617a95582b843b345e9602 Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Wed, 31 Jul 2024 15:36:02 +0600 Subject: [PATCH 1/5] Add psr-4 autoloader --- .distignore | 1 - composer.json | 7 +- composer.lock | 11038 +++++----------------------------------- src/Plugin.php | 13 + wc-serial-numbers.php | 48 +- 5 files changed, 1158 insertions(+), 9949 deletions(-) diff --git a/.distignore b/.distignore index a6018b27..fd31f11f 100644 --- a/.distignore +++ b/.distignore @@ -82,4 +82,3 @@ Thumbs.db # Build related files /assets/js /assets/css -vendor diff --git a/composer.json b/composer.json index 841e4388..523c2cbc 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,12 @@ "pluginever/framework-plugin": "dev-master", "pluginever/framework-settings": "dev-master" }, + "autoload": { + "psr-4": { + "WooCommerceSerialNumbers\\": ["src/","lib/"] + } + }, + "autoload-dev": {}, "config": { "optimize-autoloader": true, "sort-packages": true, @@ -38,7 +44,6 @@ "dealerdirect/phpcodesniffer-composer-installer": true } }, - "autoload": {}, "scripts": { "post-install-cmd": [ "\"vendor/bin/mozart\" compose", diff --git a/composer.lock b/composer.lock index 2f31ae43..039b9eca 100644 --- a/composer.lock +++ b/composer.lock @@ -4,91 +4,88 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1708bb6e2309c5b3f2b0c1d7ea103daf", + "content-hash": "db0a4e2eed5394cfab48f679b98ec95b", "packages": [], "packages-dev": [ { - "name": "antecedent/patchwork", - "version": "2.1.28", + "name": "byteever/byteever-sniffs", + "version": "v1.0.2", "source": { "type": "git", - "url": "https://github.com/antecedent/patchwork.git", - "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d" + "url": "https://github.com/byteever/byteever-sniffs.git", + "reference": "7a62a7c8aa62fcc67a0d19ed0af2df05b103042d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/6b30aff81ebadf0f2feb9268d3e08385cebcc08d", - "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d", + "url": "https://api.github.com/repos/byteever/byteever-sniffs/zipball/7a62a7c8aa62fcc67a0d19ed0af2df05b103042d", + "reference": "7a62a7c8aa62fcc67a0d19ed0af2df05b103042d", "shasum": "" }, "require": { - "php": ">=5.4.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "phpcompatibility/phpcompatibility-wp": "^2.1", + "wp-coding-standards/wpcs": "^3.1" }, "require-dev": { - "phpunit/phpunit": ">=4" + "roave/security-advisories": "dev-latest" }, - "type": "library", + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "GPL-3.0-only" ], "authors": [ { - "name": "Ignas Rudaitis", - "email": "ignas.rudaitis@gmail.com" + "name": "Sultan Nasir Uddin", + "email": "sultan@byteever.com" } ], - "description": "Method redefinition (monkey-patching) functionality for PHP.", - "homepage": "https://antecedent.github.io/patchwork/", + "description": "ByteEver PHP Coding Standards", "keywords": [ - "aop", - "aspect", - "interception", - "monkeypatching", - "redefinition", - "runkit", - "testing" + "byteever", + "phpcs", + "standards", + "wordpress" ], "support": { - "issues": "https://github.com/antecedent/patchwork/issues", - "source": "https://github.com/antecedent/patchwork/tree/2.1.28" + "issues": "https://github.com/byteever/byteever-sniffs/issues", + "source": "https://github.com/byteever/byteever-sniffs/tree/v1.0.2" }, - "time": "2024-02-06T09:26:11+00:00" + "time": "2024-06-28T06:59:58+00:00" }, { - "name": "behat/gherkin", - "version": "v4.9.0", + "name": "coenjacobs/mozart", + "version": "0.7.1", "source": { "type": "git", - "url": "https://github.com/Behat/Gherkin.git", - "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4" + "url": "https://github.com/coenjacobs/mozart.git", + "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/0bc8d1e30e96183e4f36db9dc79caead300beff4", - "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4", + "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/dbcdeb992d20d9c8914eef090f9a0d684bb1102c", + "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c", "shasum": "" }, "require": { - "php": "~7.2|~8.0" + "league/flysystem": "^1.0", + "php": "^7.3|^8.0", + "symfony/console": "^4|^5", + "symfony/finder": "^4|^5" }, "require-dev": { - "cucumber/cucumber": "dev-gherkin-22.0.0", - "phpunit/phpunit": "~8|~9", - "symfony/yaml": "~3|~4|~5" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files" + "mheap/phpunit-github-actions-printer": "^1.4", + "phpunit/phpunit": "^8.5", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.4" }, + "bin": [ + "bin/mozart" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" + "psr-4": { + "CoenJacobs\\Mozart\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -97,158 +94,219 @@ ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "name": "Coen Jacobs", + "email": "coenjacobs@gmail.com" } ], - "description": "Gherkin DSL parser for PHP", - "homepage": "http://behat.org/", - "keywords": [ - "BDD", - "Behat", - "Cucumber", - "DSL", - "gherkin", - "parser" - ], + "description": "Composes all dependencies as a package inside a WordPress plugin", "support": { - "issues": "https://github.com/Behat/Gherkin/issues", - "source": "https://github.com/Behat/Gherkin/tree/v4.9.0" + "issues": "https://github.com/coenjacobs/mozart/issues", + "source": "https://github.com/coenjacobs/mozart/tree/0.7.1" }, - "time": "2021-10-12T13:05:09+00:00" + "funding": [ + { + "url": "https://github.com/coenjacobs", + "type": "github" + } + ], + "time": "2021-02-02T21:37:03+00:00" }, { - "name": "bordoni/phpass", - "version": "0.3.6", + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.2", "source": { "type": "git", - "url": "https://github.com/bordoni/phpass.git", - "reference": "12f8f5cc03ebb7efd69554f104afe9aa1aa46e1a" + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bordoni/phpass/zipball/12f8f5cc03ebb7efd69554f104afe9aa1aa46e1a", - "reference": "12f8f5cc03ebb7efd69554f104afe9aa1aa46e1a", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { - "php": ">=5.3.3" + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, - "replace": { - "hautelook/phpass": "0.3.*" + "require-dev": { + "composer/composer": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, - "type": "library", "autoload": { - "psr-0": { - "Hautelook": "src/" + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Public Domain" + "MIT" ], "authors": [ { - "name": "Solar Designer", - "email": "solar@openwall.com", - "homepage": "http://openwall.com/phpass/" + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" }, { - "name": "Gustavo Bordoni", - "email": "gustavo@bordoni.me", - "homepage": "https://bordoni.me" + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], - "description": "Portable PHP password hashing framework", - "homepage": "http://github.com/bordoni/phpass/", + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", "keywords": [ - "blowfish", - "crypt", - "password", - "security" + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" ], "support": { - "issues": "https://github.com/bordoni/phpass/issues", - "source": "https://github.com/bordoni/phpass/tree/0.3.6" + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" }, - "time": "2012-08-31T00:00:00+00:00" + "time": "2022-02-04T12:51:07+00:00" }, { - "name": "byteever/byteever-sniffs", - "version": "v1.0.2", + "name": "league/flysystem", + "version": "1.1.10", "source": { "type": "git", - "url": "https://github.com/byteever/byteever-sniffs.git", - "reference": "7a62a7c8aa62fcc67a0d19ed0af2df05b103042d" + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/byteever/byteever-sniffs/zipball/7a62a7c8aa62fcc67a0d19ed0af2df05b103042d", - "reference": "7a62a7c8aa62fcc67a0d19ed0af2df05b103042d", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", - "phpcompatibility/phpcompatibility-wp": "^2.1", - "wp-coding-standards/wpcs": "^3.1" + "ext-fileinfo": "*", + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" }, "require-dev": { - "roave/security-advisories": "dev-latest" + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" + }, + "suggest": { + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-only" + "MIT" ], "authors": [ { - "name": "Sultan Nasir Uddin", - "email": "sultan@byteever.com" + "name": "Frank de Jonge", + "email": "info@frenky.net" } ], - "description": "ByteEver PHP Coding Standards", + "description": "Filesystem abstraction: Many filesystems, one API.", "keywords": [ - "byteever", - "phpcs", - "standards", - "wordpress" + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" ], "support": { - "issues": "https://github.com/byteever/byteever-sniffs/issues", - "source": "https://github.com/byteever/byteever-sniffs/tree/v1.0.2" + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" }, - "time": "2024-06-28T06:59:58+00:00" + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], + "time": "2022-10-04T09:16:37+00:00" }, { - "name": "carbonphp/carbon-doctrine-types", - "version": "2.1.0", + "name": "league/mime-type-detection", + "version": "1.15.0", "source": { "type": "git", - "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb" + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", - "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", "shasum": "" }, "require": { + "ext-fileinfo": "*", "php": "^7.4 || ^8.0" }, - "conflict": { - "doctrine/dbal": "<3.7.0 || >=4.0.0" - }, "require-dev": { - "doctrine/dbal": "^3.7.0", - "nesbot/carbon": "^2.71.0 || ^3.0.0", - "phpunit/phpunit": "^10.3" + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { "psr-4": { - "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + "League\\MimeTypeDetection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -257,9553 +315,577 @@ ], "authors": [ { - "name": "KyleKatarn", - "email": "kylekatarnls@gmail.com" + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" } ], - "description": "Types to use Carbon in Doctrine", - "keywords": [ - "carbon", - "date", - "datetime", - "doctrine", - "time" - ], + "description": "Mime-type detection for Flysystem", "support": { - "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/2.1.0" + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" }, "funding": [ { - "url": "https://github.com/kylekatarnls", + "url": "https://github.com/frankdejonge", "type": "github" }, { - "url": "https://opencollective.com/Carbon", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", "type": "tidelift" } ], - "time": "2023-12-11T17:09:12+00:00" + "time": "2024-01-28T23:22:08+00:00" }, { - "name": "codeception/codeception", - "version": "4.2.2", + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", "source": { "type": "git", - "url": "https://github.com/Codeception/Codeception.git", - "reference": "b88014f3348c93f3df99dc6d0967b0dbfa804474" + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b88014f3348c93f3df99dc6d0967b0dbfa804474", - "reference": "b88014f3348c93f3df99dc6d0967b0dbfa804474", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { - "behat/gherkin": "^4.4.0", - "codeception/lib-asserts": "^1.0 | 2.0.*@dev", - "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.1.1 | ^9.0", - "codeception/stub": "^2.0 | ^3.0 | ^4.0", - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "guzzlehttp/psr7": "^1.4 | ^2.0", - "php": ">=5.6.0 <9.0", - "symfony/console": ">=2.7 <6.0", - "symfony/css-selector": ">=2.7 <6.0", - "symfony/event-dispatcher": ">=2.7 <6.0", - "symfony/finder": ">=2.7 <6.0", - "symfony/yaml": ">=2.7 <6.0" + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" }, "require-dev": { - "codeception/module-asserts": "^1.0 | 2.0.*@dev", - "codeception/module-cli": "^1.0 | 2.0.*@dev", - "codeception/module-db": "^1.0 | 2.0.*@dev", - "codeception/module-filesystem": "^1.0 | 2.0.*@dev", - "codeception/module-phpbrowser": "^1.0 | 2.0.*@dev", - "codeception/specify": "~0.3", - "codeception/util-universalframework": "*@dev", - "monolog/monolog": "~1.8", - "squizlabs/php_codesniffer": "~2.0", - "symfony/process": ">=2.7 <6.0", - "vlucas/phpdotenv": "^2.0 | ^3.0 | ^4.0 | ^5.0" + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { - "codeception/specify": "BDD-style code blocks", - "codeception/verify": "BDD-style assertions", - "hoa/console": "For interactive console functionality", - "stecman/symfony-console-completion": "For BASH autocompletion", - "symfony/phpunit-bridge": "For phpunit-bridge support" - }, - "bin": [ - "codecept" - ], - "type": "library", - "extra": { - "branch-alias": [] - }, - "autoload": { - "files": [ - "functions.php" - ], - "psr-4": { - "Codeception\\": "src/Codeception", - "Codeception\\Extension\\": "ext" - } + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert@mail.ua", - "homepage": "https://codegyre.com" - } - ], - "description": "BDD-style testing framework", - "homepage": "https://codeception.com/", - "keywords": [ - "BDD", - "TDD", - "acceptance testing", - "functional testing", - "unit testing" - ], - "support": { - "issues": "https://github.com/Codeception/Codeception/issues", - "source": "https://github.com/Codeception/Codeception/tree/4.2.2" - }, - "funding": [ - { - "url": "https://opencollective.com/codeception", - "type": "open_collective" - } - ], - "time": "2022-08-13T13:28:25+00:00" - }, - { - "name": "codeception/lib-asserts", - "version": "1.13.2", - "source": { - "type": "git", - "url": "https://github.com/Codeception/lib-asserts.git", - "reference": "184231d5eab66bc69afd6b9429344d80c67a33b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/lib-asserts/zipball/184231d5eab66bc69afd6b9429344d80c67a33b6", - "reference": "184231d5eab66bc69afd6b9429344d80c67a33b6", - "shasum": "" - }, - "require": { - "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.3 | ^9.0", - "ext-dom": "*", - "php": ">=5.6.0 <9.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" + "LGPL-3.0-or-later" ], "authors": [ { - "name": "Michael Bodnarchuk", - "email": "davert@mail.ua", - "homepage": "http://codegyre.com" + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" }, { - "name": "Gintautas Miselis" + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" }, { - "name": "Gustavo Nieves", - "homepage": "https://medium.com/@ganieves" + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" } ], - "description": "Assertion methods used by Codeception core and Asserts module", - "homepage": "https://codeception.com/", + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", "keywords": [ - "codeception" + "compatibility", + "phpcs", + "standards" ], "support": { - "issues": "https://github.com/Codeception/lib-asserts/issues", - "source": "https://github.com/Codeception/lib-asserts/tree/1.13.2" + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2020-10-21T16:26:20+00:00" + "time": "2019-12-27T09:44:58+00:00" }, { - "name": "codeception/lib-innerbrowser", - "version": "1.5.1", + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.3", "source": { "type": "git", - "url": "https://github.com/Codeception/lib-innerbrowser.git", - "reference": "31b4b56ad53c3464fcb2c0a14d55a51a201bd3c2" + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/lib-innerbrowser/zipball/31b4b56ad53c3464fcb2c0a14d55a51a201bd3c2", - "reference": "31b4b56ad53c3464fcb2c0a14d55a51a201bd3c2", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", "shasum": "" }, "require": { - "codeception/codeception": "4.*@dev", - "ext-dom": "*", - "ext-json": "*", - "ext-mbstring": "*", - "php": ">=5.6.0 <9.0", - "symfony/browser-kit": ">=2.7 <6.0", - "symfony/dom-crawler": ">=2.7 <6.0" - }, - "conflict": { - "codeception/codeception": "<4.0" + "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { - "codeception/util-universalframework": "dev-master" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert@mail.ua", - "homepage": "http://codegyre.com" - }, - { - "name": "Gintautas Miselis" - } - ], - "description": "Parent library for all Codeception framework modules and PhpBrowser", - "homepage": "https://codeception.com/", - "keywords": [ - "codeception" - ], - "support": { - "issues": "https://github.com/Codeception/lib-innerbrowser/issues", - "source": "https://github.com/Codeception/lib-innerbrowser/tree/1.5.1" - }, - "time": "2021-08-30T15:21:42+00:00" - }, - { - "name": "codeception/module-asserts", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/Codeception/module-asserts.git", - "reference": "59374f2fef0cabb9e8ddb53277e85cdca74328de" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-asserts/zipball/59374f2fef0cabb9e8ddb53277e85cdca74328de", - "reference": "59374f2fef0cabb9e8ddb53277e85cdca74328de", - "shasum": "" - }, - "require": { - "codeception/codeception": "*@dev", - "codeception/lib-asserts": "^1.13.1", - "php": ">=5.6.0 <9.0" - }, - "conflict": { - "codeception/codeception": "<4.0" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL-3.0-or-later" ], "authors": [ { - "name": "Michael Bodnarchuk" - }, - { - "name": "Gintautas Miselis" + "name": "Wim Godden", + "role": "lead" }, { - "name": "Gustavo Nieves", - "homepage": "https://medium.com/@ganieves" - } - ], - "description": "Codeception module containing various assertions", - "homepage": "https://codeception.com/", - "keywords": [ - "assertions", - "asserts", - "codeception" - ], - "support": { - "issues": "https://github.com/Codeception/module-asserts/issues", - "source": "https://github.com/Codeception/module-asserts/tree/1.3.1" - }, - "time": "2020-10-21T16:48:15+00:00" - }, - { - "name": "codeception/module-cli", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/Codeception/module-cli.git", - "reference": "1f841ad4a1d43e5d9e60a43c4cc9e5af8008024f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-cli/zipball/1f841ad4a1d43e5d9e60a43c4cc9e5af8008024f", - "reference": "1f841ad4a1d43e5d9e60a43c4cc9e5af8008024f", - "shasum": "" - }, - "require": { - "codeception/codeception": "*@dev", - "php": ">=5.6.0 <9.0" - }, - "conflict": { - "codeception/codeception": "<4.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk" + "name": "Juliette Reinders Folmer", + "role": "lead" } ], - "description": "Codeception module for testing basic shell commands and shell output", - "homepage": "http://codeception.com/", + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", "keywords": [ - "codeception" + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards", + "static analysis" ], "support": { - "issues": "https://github.com/Codeception/module-cli/issues", - "source": "https://github.com/Codeception/module-cli/tree/1.1.1" - }, - "time": "2020-12-26T16:56:19+00:00" - }, - { - "name": "codeception/module-db", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/Codeception/module-db.git", - "reference": "04c3e66fbd3a3ced17fcccc49627f6393a97b04b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-db/zipball/04c3e66fbd3a3ced17fcccc49627f6393a97b04b", - "reference": "04c3e66fbd3a3ced17fcccc49627f6393a97b04b", - "shasum": "" - }, - "require": { - "codeception/codeception": "*@dev", - "php": ">=5.6.0 <9.0" - }, - "conflict": { - "codeception/codeception": "<4.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ + "funding": [ { - "name": "Michael Bodnarchuk" + "url": "https://github.com/PHPCompatibility", + "type": "github" }, { - "name": "Gintautas Miselis" - } - ], - "description": "DB module for Codeception", - "homepage": "http://codeception.com/", - "keywords": [ - "codeception", - "database-testing", - "db-testing" - ], - "support": { - "issues": "https://github.com/Codeception/module-db/issues", - "source": "https://github.com/Codeception/module-db/tree/1.2.0" - }, - "time": "2022-03-05T19:38:40+00:00" - }, - { - "name": "codeception/module-filesystem", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/Codeception/module-filesystem.git", - "reference": "781be167fb1557bfc9b61e0a4eac60a32c534ec1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-filesystem/zipball/781be167fb1557bfc9b61e0a4eac60a32c534ec1", - "reference": "781be167fb1557bfc9b61e0a4eac60a32c534ec1", - "shasum": "" - }, - "require": { - "codeception/codeception": "^4.0", - "php": ">=5.6.0 <9.0", - "symfony/finder": ">=2.7 <6.0" - }, - "conflict": { - "codeception/codeception": "<4.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk" + "url": "https://github.com/jrfnl", + "type": "github" }, { - "name": "Gintautas Miselis" + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" } ], - "description": "Codeception module for testing local filesystem", - "homepage": "http://codeception.com/", - "keywords": [ - "codeception", - "filesystem" - ], - "support": { - "issues": "https://github.com/Codeception/module-filesystem/issues", - "source": "https://github.com/Codeception/module-filesystem/tree/1.0.3" - }, - "time": "2020-10-24T14:46:40+00:00" + "time": "2024-04-24T21:30:46+00:00" }, { - "name": "codeception/module-phpbrowser", - "version": "1.0.3", + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.5", "source": { "type": "git", - "url": "https://github.com/Codeception/module-phpbrowser.git", - "reference": "8ba6bede11d0914e74d98691f427fd8f397f192e" + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-phpbrowser/zipball/8ba6bede11d0914e74d98691f427fd8f397f192e", - "reference": "8ba6bede11d0914e74d98691f427fd8f397f192e", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", "shasum": "" }, "require": { - "codeception/codeception": "^4.1", - "codeception/lib-innerbrowser": "^1.3", - "guzzlehttp/guzzle": "^6.3|^7.0", - "php": ">=5.6.0 <9.0" - }, - "conflict": { - "codeception/codeception": "<4.0" + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { - "codeception/module-rest": "^1.0" - }, - "suggest": { - "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk" - }, - { - "name": "Gintautas Miselis" - } - ], - "description": "Codeception module for testing web application over HTTP", - "homepage": "http://codeception.com/", - "keywords": [ - "codeception", - "functional-testing", - "http" - ], - "support": { - "issues": "https://github.com/Codeception/module-phpbrowser/issues", - "source": "https://github.com/Codeception/module-phpbrowser/tree/1.0.3" - }, - "time": "2022-05-21T13:50:41+00:00" - }, - { - "name": "codeception/module-rest", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/Codeception/module-rest.git", - "reference": "9cd7a87fd9343494e7782f7bdb51687c25046917" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-rest/zipball/9cd7a87fd9343494e7782f7bdb51687c25046917", - "reference": "9cd7a87fd9343494e7782f7bdb51687c25046917", - "shasum": "" - }, - "require": { - "codeception/codeception": "^4.0", - "justinrainbow/json-schema": "~5.2.9", - "php": ">=5.6.6 <9.0", - "softcreatr/jsonpath": "^0.5 || ^0.7" - }, - "require-dev": { - "codeception/lib-innerbrowser": "^1.0", - "codeception/util-universalframework": "^1.0" - }, - "suggest": { - "aws/aws-sdk-php": "For using AWS Auth" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gintautas Miselis" - } - ], - "description": "REST module for Codeception", - "homepage": "http://codeception.com/", - "keywords": [ - "codeception", - "rest" - ], - "support": { - "issues": "https://github.com/Codeception/module-rest/issues", - "source": "https://github.com/Codeception/module-rest/tree/1.4.2" - }, - "time": "2021-11-18T18:58:15+00:00" - }, - { - "name": "codeception/module-webdriver", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/Codeception/module-webdriver.git", - "reference": "e22ac7da756df659df6dd4fac2dff9c859e30131" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/e22ac7da756df659df6dd4fac2dff9c859e30131", - "reference": "e22ac7da756df659df6dd4fac2dff9c859e30131", - "shasum": "" - }, - "require": { - "codeception/codeception": "^4.0", - "php": ">=5.6.0 <9.0", - "php-webdriver/webdriver": "^1.8.0" - }, - "suggest": { - "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk" - }, - { - "name": "Gintautas Miselis" - }, - { - "name": "Zaahid Bateson" - } - ], - "description": "WebDriver module for Codeception", - "homepage": "http://codeception.com/", - "keywords": [ - "acceptance-testing", - "browser-testing", - "codeception" - ], - "support": { - "issues": "https://github.com/Codeception/module-webdriver/issues", - "source": "https://github.com/Codeception/module-webdriver/tree/1.4.1" - }, - "time": "2022-09-12T05:09:51+00:00" - }, - { - "name": "codeception/phpunit-wrapper", - "version": "9.0.9", - "source": { - "type": "git", - "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "7439a53ae367986e9c22b2ac00f9d7376bb2f8cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/7439a53ae367986e9c22b2ac00f9d7376bb2f8cf", - "reference": "7439a53ae367986e9c22b2ac00f9d7376bb2f8cf", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "phpunit/phpunit": "^9.0" - }, - "require-dev": { - "codeception/specify": "*", - "consolidation/robo": "^3.0.0-alpha3", - "vlucas/phpdotenv": "^3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codeception\\PHPUnit\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Davert", - "email": "davert.php@resend.cc" - }, - { - "name": "Naktibalda" - } - ], - "description": "PHPUnit classes used by Codeception", - "support": { - "issues": "https://github.com/Codeception/phpunit-wrapper/issues", - "source": "https://github.com/Codeception/phpunit-wrapper/tree/9.0.9" - }, - "time": "2022-05-23T06:24:11+00:00" - }, - { - "name": "codeception/stub", - "version": "4.0.2", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Stub.git", - "reference": "18a148dacd293fc7b044042f5aa63a82b08bff5d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Stub/zipball/18a148dacd293fc7b044042f5aa63a82b08bff5d", - "reference": "18a148dacd293fc7b044042f5aa63a82b08bff5d", - "shasum": "" - }, - "require": { - "php": "^7.4 | ^8.0", - "phpunit/phpunit": "^8.4 | ^9.0 | ^10.0 | 10.0.x-dev" - }, - "require-dev": { - "consolidation/robo": "^3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codeception\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", - "support": { - "issues": "https://github.com/Codeception/Stub/issues", - "source": "https://github.com/Codeception/Stub/tree/4.0.2" - }, - "time": "2022-01-31T19:25:15+00:00" - }, - { - "name": "codeception/util-universalframework", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/Codeception/util-universalframework.git", - "reference": "cc381f364c6d24f9b9c7b70a4c724949725f491a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/util-universalframework/zipball/cc381f364c6d24f9b9c7b70a4c724949725f491a", - "reference": "cc381f364c6d24f9b9c7b70a4c724949725f491a", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gintautas Miselis" - } - ], - "description": "Mock framework module used in internal Codeception tests", - "homepage": "http://codeception.com/", - "support": { - "issues": "https://github.com/Codeception/util-universalframework/issues", - "source": "https://github.com/Codeception/util-universalframework/tree/1.0.0" - }, - "time": "2019-09-22T06:06:49+00:00" - }, - { - "name": "coenjacobs/mozart", - "version": "0.7.1", - "source": { - "type": "git", - "url": "https://github.com/coenjacobs/mozart.git", - "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/dbcdeb992d20d9c8914eef090f9a0d684bb1102c", - "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c", - "shasum": "" - }, - "require": { - "league/flysystem": "^1.0", - "php": "^7.3|^8.0", - "symfony/console": "^4|^5", - "symfony/finder": "^4|^5" - }, - "require-dev": { - "mheap/phpunit-github-actions-printer": "^1.4", - "phpunit/phpunit": "^8.5", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" - }, - "bin": [ - "bin/mozart" - ], - "type": "library", - "autoload": { - "psr-4": { - "CoenJacobs\\Mozart\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Coen Jacobs", - "email": "coenjacobs@gmail.com" - } - ], - "description": "Composes all dependencies as a package inside a WordPress plugin", - "support": { - "issues": "https://github.com/coenjacobs/mozart/issues", - "source": "https://github.com/coenjacobs/mozart/tree/0.7.1" - }, - "funding": [ - { - "url": "https://github.com/coenjacobs", - "type": "github" - } - ], - "time": "2021-02-02T21:37:03+00:00" - }, - { - "name": "composer/ca-bundle", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/063d9aa8696582f5a41dffbbaf3c81024f0a604a", - "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.10", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.1" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-07-08T15:28:20+00:00" - }, - { - "name": "composer/class-map-generator", - "version": "1.3.4", - "source": { - "type": "git", - "url": "https://github.com/composer/class-map-generator.git", - "reference": "b1b3fd0b4eaf3ddf3ee230bc340bf3fff454a1a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/b1b3fd0b4eaf3ddf3ee230bc340bf3fff454a1a3", - "reference": "b1b3fd0b4eaf3ddf3ee230bc340bf3fff454a1a3", - "shasum": "" - }, - "require": { - "composer/pcre": "^2.1 || ^3.1", - "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" - }, - "require-dev": { - "phpstan/phpstan": "^1.6", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/filesystem": "^5.4 || ^6", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\ClassMapGenerator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "Utilities to scan PHP code and generate class maps.", - "keywords": [ - "classmap" - ], - "support": { - "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.3.4" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-06-12T14:13:04+00:00" - }, - { - "name": "composer/composer", - "version": "2.7.7", - "source": { - "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "291942978f39435cf904d33739f98d7d4eca7b23" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/291942978f39435cf904d33739f98d7d4eca7b23", - "reference": "291942978f39435cf904d33739f98d7d4eca7b23", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.0", - "composer/class-map-generator": "^1.3.3", - "composer/metadata-minifier": "^1.0", - "composer/pcre": "^2.1 || ^3.1", - "composer/semver": "^3.3", - "composer/spdx-licenses": "^1.5.7", - "composer/xdebug-handler": "^2.0.2 || ^3.0.3", - "justinrainbow/json-schema": "^5.2.11", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "react/promise": "^2.8 || ^3", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.2", - "seld/signal-handler": "^2.0", - "symfony/console": "^5.4.11 || ^6.0.11 || ^7", - "symfony/filesystem": "^5.4 || ^6.0 || ^7", - "symfony/finder": "^5.4 || ^6.0 || ^7", - "symfony/polyfill-php73": "^1.24", - "symfony/polyfill-php80": "^1.24", - "symfony/polyfill-php81": "^1.24", - "symfony/process": "^5.4 || ^6.0 || ^7" - }, - "require-dev": { - "phpstan/phpstan": "^1.11.0", - "phpstan/phpstan-deprecation-rules": "^1.2.0", - "phpstan/phpstan-phpunit": "^1.4.0", - "phpstan/phpstan-strict-rules": "^1.6.0", - "phpstan/phpstan-symfony": "^1.4.0", - "symfony/phpunit-bridge": "^6.4.1 || ^7.0.1" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" - }, - "bin": [ - "bin/composer" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.7-dev" - }, - "phpstan": { - "includes": [ - "phpstan/rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "Composer\\": "src/Composer/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "https://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", - "keywords": [ - "autoload", - "dependency", - "package" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/composer/issues", - "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.7.7" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-06-10T20:11:12+00:00" - }, - { - "name": "composer/metadata-minifier", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/composer/metadata-minifier.git", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "composer/composer": "^2", - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\MetadataMinifier\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Small utility library that handles metadata minification and expansion.", - "keywords": [ - "composer", - "compression" - ], - "support": { - "issues": "https://github.com/composer/metadata-minifier/issues", - "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-04-07T13:37:33+00:00" - }, - { - "name": "composer/pcre", - "version": "3.2.0", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/ea4ab6f9580a4fd221e0418f2c357cdd39102a90", - "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<1.11.8" - }, - "require-dev": { - "phpstan/phpstan": "^1.11.8", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8 || ^9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.2.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-07-25T09:36:02+00:00" - }, - { - "name": "composer/semver", - "version": "3.4.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-07-12T11:35:52+00:00" - }, - { - "name": "composer/spdx-licenses", - "version": "1.5.8", - "source": { - "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", - "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Spdx\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.8" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-11-20T07:44:33+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.5", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-05-06T16:37:16+00:00" - }, - { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", - "source": { - "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" - }, - "require-dev": { - "composer/composer": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "autoload": { - "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - }, - { - "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "time": "2022-02-04T12:51:07+00:00" - }, - { - "name": "dg/mysql-dump", - "version": "v1.5.1", - "source": { - "type": "git", - "url": "https://github.com/dg/MySQL-dump.git", - "reference": "e0e287b715b43293773a8b0edf8514f606e01780" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dg/MySQL-dump/zipball/e0e287b715b43293773a8b0edf8514f606e01780", - "reference": "e0e287b715b43293773a8b0edf8514f606e01780", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - } - ], - "description": "MySQL database dump.", - "homepage": "https://github.com/dg/MySQL-dump", - "keywords": [ - "mysql" - ], - "support": { - "source": "https://github.com/dg/MySQL-dump/tree/master" - }, - "time": "2019-09-10T21:36:25+00:00" - }, - { - "name": "doctrine/inflector", - "version": "2.0.10", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", - "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^11.0", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25 || ^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", - "homepage": "https://www.doctrine-project.org/projects/inflector.html", - "keywords": [ - "inflection", - "inflector", - "lowercase", - "manipulation", - "php", - "plural", - "singular", - "strings", - "uppercase", - "words" - ], - "support": { - "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.10" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", - "type": "tidelift" - } - ], - "time": "2024-02-18T20:23:39+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:15:36+00:00" - }, - { - "name": "eftec/bladeone", - "version": "3.52", - "source": { - "type": "git", - "url": "https://github.com/EFTEC/BladeOne.git", - "reference": "a19bf66917de0b29836983db87a455a4f6e32148" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EFTEC/BladeOne/zipball/a19bf66917de0b29836983db87a455a4f6e32148", - "reference": "a19bf66917de0b29836983db87a455a4f6e32148", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=5.6" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16.1", - "phpunit/phpunit": "^5.7", - "squizlabs/php_codesniffer": "^3.5.4" - }, - "suggest": { - "eftec/bladeonehtml": "Extension to create forms", - "ext-mbstring": "This extension is used if it's active" - }, - "type": "library", - "autoload": { - "psr-4": { - "eftec\\bladeone\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jorge Patricio Castro Castillo", - "email": "jcastro@eftec.cl" - } - ], - "description": "The standalone version Blade Template Engine from Laravel in a single php file", - "homepage": "https://github.com/EFTEC/BladeOne", - "keywords": [ - "blade", - "php", - "template", - "templating", - "view" - ], - "support": { - "issues": "https://github.com/EFTEC/BladeOne/issues", - "source": "https://github.com/EFTEC/BladeOne/tree/3.52" - }, - "time": "2021-04-17T13:49:01+00:00" - }, - { - "name": "gettext/gettext", - "version": "v4.8.12", - "source": { - "type": "git", - "url": "https://github.com/php-gettext/Gettext.git", - "reference": "11af89ee6c087db3cf09ce2111a150bca5c46e12" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/11af89ee6c087db3cf09ce2111a150bca5c46e12", - "reference": "11af89ee6c087db3cf09ce2111a150bca5c46e12", - "shasum": "" - }, - "require": { - "gettext/languages": "^2.3", - "php": ">=5.4.0" - }, - "require-dev": { - "illuminate/view": "^5.0.x-dev", - "phpunit/phpunit": "^4.8|^5.7|^6.5", - "squizlabs/php_codesniffer": "^3.0", - "symfony/yaml": "~2", - "twig/extensions": "*", - "twig/twig": "^1.31|^2.0" - }, - "suggest": { - "illuminate/view": "Is necessary if you want to use the Blade extractor", - "symfony/yaml": "Is necessary if you want to use the Yaml extractor/generator", - "twig/extensions": "Is necessary if you want to use the Twig extractor", - "twig/twig": "Is necessary if you want to use the Twig extractor" - }, - "type": "library", - "autoload": { - "psr-4": { - "Gettext\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Oscar Otero", - "email": "oom@oscarotero.com", - "homepage": "http://oscarotero.com", - "role": "Developer" - } - ], - "description": "PHP gettext manager", - "homepage": "https://github.com/oscarotero/Gettext", - "keywords": [ - "JS", - "gettext", - "i18n", - "mo", - "po", - "translation" - ], - "support": { - "email": "oom@oscarotero.com", - "issues": "https://github.com/oscarotero/Gettext/issues", - "source": "https://github.com/php-gettext/Gettext/tree/v4.8.12" - }, - "funding": [ - { - "url": "https://paypal.me/oscarotero", - "type": "custom" - }, - { - "url": "https://github.com/oscarotero", - "type": "github" - }, - { - "url": "https://www.patreon.com/misteroom", - "type": "patreon" - } - ], - "time": "2024-05-18T10:25:07+00:00" - }, - { - "name": "gettext/languages", - "version": "2.10.0", - "source": { - "type": "git", - "url": "https://github.com/php-gettext/Languages.git", - "reference": "4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-gettext/Languages/zipball/4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab", - "reference": "4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4" - }, - "bin": [ - "bin/export-plural-rules" - ], - "type": "library", - "autoload": { - "psr-4": { - "Gettext\\Languages\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michele Locati", - "email": "mlocati@gmail.com", - "role": "Developer" - } - ], - "description": "gettext languages with plural rules", - "homepage": "https://github.com/php-gettext/Languages", - "keywords": [ - "cldr", - "i18n", - "internationalization", - "l10n", - "language", - "languages", - "localization", - "php", - "plural", - "plural rules", - "plurals", - "translate", - "translations", - "unicode" - ], - "support": { - "issues": "https://github.com/php-gettext/Languages/issues", - "source": "https://github.com/php-gettext/Languages/tree/2.10.0" - }, - "funding": [ - { - "url": "https://paypal.me/mlocati", - "type": "custom" - }, - { - "url": "https://github.com/mlocati", - "type": "github" - } - ], - "time": "2022-10-18T15:00:10+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "7.9.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "d281ed313b989f213357e3be1a179f02196ac99b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", - "reference": "d281ed313b989f213357e3be1a179f02196ac99b", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.3", - "guzzlehttp/psr7": "^2.7.0", - "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "provide": { - "psr/http-client-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "ext-curl": "*", - "guzzle/client-integration-tests": "3.0.2", - "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.39 || ^9.6.20", - "psr/log": "^1.1 || ^2.0 || ^3.0" - }, - "suggest": { - "ext-curl": "Required for CURL handler support", - "ext-intl": "Required for Internationalized Domain Name (IDN) support", - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "psr-18", - "psr-7", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.9.2" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", - "type": "tidelift" - } - ], - "time": "2024-07-24T11:22:20+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.39 || ^9.6.20" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ], - "time": "2024-07-18T10:29:17+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "2.7.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1 || ^2.0", - "ralouphie/getallheaders": "^3.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "0.9.0", - "phpunit/phpunit": "^8.5.39 || ^9.6.20" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.7.0" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2024-07-18T11:15:46+00:00" - }, - { - "name": "illuminate/collections", - "version": "v9.52.16", - "source": { - "type": "git", - "url": "https://github.com/illuminate/collections.git", - "reference": "d3710b0b244bfc62c288c1a87eaa62dd28352d1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/d3710b0b244bfc62c288c1a87eaa62dd28352d1f", - "reference": "d3710b0b244bfc62c288c1a87eaa62dd28352d1f", - "shasum": "" - }, - "require": { - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "php": "^8.0.2" - }, - "suggest": { - "symfony/var-dumper": "Required to use the dump method (^6.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "autoload": { - "files": [ - "helpers.php" - ], - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Collections package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2023-06-11T21:17:10+00:00" - }, - { - "name": "illuminate/conditionable", - "version": "v9.52.16", - "source": { - "type": "git", - "url": "https://github.com/illuminate/conditionable.git", - "reference": "bea24daa0fa84b7e7b0d5b84f62c71b7e2dc3364" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/conditionable/zipball/bea24daa0fa84b7e7b0d5b84f62c71b7e2dc3364", - "reference": "bea24daa0fa84b7e7b0d5b84f62c71b7e2dc3364", - "shasum": "" - }, - "require": { - "php": "^8.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Conditionable package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2023-02-01T21:42:32+00:00" - }, - { - "name": "illuminate/contracts", - "version": "v9.52.16", - "source": { - "type": "git", - "url": "https://github.com/illuminate/contracts.git", - "reference": "44f65d723b13823baa02ff69751a5948bde60c22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/44f65d723b13823baa02ff69751a5948bde60c22", - "reference": "44f65d723b13823baa02ff69751a5948bde60c22", - "shasum": "" - }, - "require": { - "php": "^8.0.2", - "psr/container": "^1.1.1|^2.0.1", - "psr/simple-cache": "^1.0|^2.0|^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Contracts\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Contracts package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2023-02-08T14:36:30+00:00" - }, - { - "name": "illuminate/macroable", - "version": "v9.52.16", - "source": { - "type": "git", - "url": "https://github.com/illuminate/macroable.git", - "reference": "e3bfaf6401742a9c6abca61b9b10e998e5b6449a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/e3bfaf6401742a9c6abca61b9b10e998e5b6449a", - "reference": "e3bfaf6401742a9c6abca61b9b10e998e5b6449a", - "shasum": "" - }, - "require": { - "php": "^8.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Macroable package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2022-08-09T13:29:29+00:00" - }, - { - "name": "illuminate/support", - "version": "v9.52.16", - "source": { - "type": "git", - "url": "https://github.com/illuminate/support.git", - "reference": "223c608dbca27232df6213f776bfe7bdeec24874" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/223c608dbca27232df6213f776bfe7bdeec24874", - "reference": "223c608dbca27232df6213f776bfe7bdeec24874", - "shasum": "" - }, - "require": { - "doctrine/inflector": "^2.0", - "ext-ctype": "*", - "ext-filter": "*", - "ext-mbstring": "*", - "illuminate/collections": "^9.0", - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "nesbot/carbon": "^2.62.1", - "php": "^8.0.2", - "voku/portable-ascii": "^2.0" - }, - "conflict": { - "tightenco/collect": "<5.5.33" - }, - "suggest": { - "illuminate/filesystem": "Required to use the composer class (^9.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", - "ramsey/uuid": "Required to use Str::uuid() (^4.7).", - "symfony/process": "Required to use the composer class (^6.0).", - "symfony/uid": "Required to use Str::ulid() (^6.0).", - "symfony/var-dumper": "Required to use the dd function (^6.0).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "autoload": { - "files": [ - "helpers.php" - ], - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Support package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2023-06-11T21:11:53+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "v5.2.13", - "source": { - "type": "git", - "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "support": { - "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/v5.2.13" - }, - "time": "2023-09-26T02:20:38+00:00" - }, - { - "name": "league/flysystem", - "version": "1.1.10", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "support": { - "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" - }, - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "time": "2022-10-04T09:16:37+00:00" - }, - { - "name": "league/mime-type-detection", - "version": "1.15.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", - "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.2", - "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "description": "Mime-type detection for Flysystem", - "support": { - "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" - }, - "funding": [ - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], - "time": "2024-01-28T23:22:08+00:00" - }, - { - "name": "level-level/wp-browser-woocommerce", - "version": "0.1.10", - "source": { - "type": "git", - "url": "https://github.com/level-level/wp-browser-woocommerce.git", - "reference": "616616628465c9f209a988d2c334213bc115c2cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/level-level/wp-browser-woocommerce/zipball/616616628465c9f209a988d2c334213bc115c2cc", - "reference": "616616628465c9f209a988d2c334213bc115c2cc", - "shasum": "" - }, - "require": { - "lucatume/wp-browser": "^2|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "LevelLevel\\WPBrowserWooCommerce\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "WooCommerce object factories for WP Browser integration tests.", - "support": { - "issues": "https://github.com/level-level/wp-browser-woocommerce/issues", - "source": "https://github.com/level-level/wp-browser-woocommerce/tree/0.1.10" - }, - "time": "2024-03-18T15:27:32+00:00" - }, - { - "name": "lucatume/wp-browser", - "version": "3.2.3", - "source": { - "type": "git", - "url": "https://github.com/lucatume/wp-browser.git", - "reference": "0bec9fabe8be43f80dac4af7f90131ec9e299ff4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lucatume/wp-browser/zipball/0bec9fabe8be43f80dac4af7f90131ec9e299ff4", - "reference": "0bec9fabe8be43f80dac4af7f90131ec9e299ff4", - "shasum": "" - }, - "require": { - "antecedent/patchwork": "^2.0", - "bordoni/phpass": "^0.3", - "codeception/codeception": "^4", - "codeception/module-asserts": "^1.0", - "codeception/module-cli": "^1.0", - "codeception/module-db": "^1.0", - "codeception/module-filesystem": "^1.0", - "codeception/module-phpbrowser": "^1.0", - "codeception/module-webdriver": "^1.0", - "codeception/util-universalframework": "^1.0", - "dg/mysql-dump": "^1.3", - "ext-fileinfo": "*", - "ext-json": "*", - "ext-pdo": "*", - "mikehaertl/php-shellcommand": "^1.6", - "mikemclin/laravel-wp-password": "~2.0.0", - "php": ">=5.6.0", - "vria/nodiacritic": "^0.1.2", - "wp-cli/wp-cli": ">=2.0 <3.0.0", - "wp-cli/wp-cli-bundle": "*", - "zordius/lightncandy": "^1.2" - }, - "conflict": { - "codeception/module-asserts": ">=2.0", - "codeception/module-cli": ">=2.0", - "codeception/module-db": ">=2.0", - "codeception/module-filesystem": ">=2.0", - "codeception/module-phpbrowser": ">=2.0", - "codeception/module-webdriver": ">=2.0", - "codeception/util-universalframework": ">=2.0" - }, - "require-dev": { - "erusev/parsedown": "^1.7", - "gumlet/php-image-resize": "^1.6", - "lucatume/codeception-snapshot-assertions": "^0.2", - "mikey179/vfsstream": "^1.6", - "symfony/translation": "^3.4", - "victorjonsson/markdowndocs": "dev-master", - "vlucas/phpdotenv": "^3.0" - }, - "suggest": { - "codeception/module-asserts:^1.0": "Codeception 4.0 compatibility.", - "codeception/module-cli:^1.0": "Codeception 4.0 compatibility; required by the WPCLI module.", - "codeception/module-db:^1.0": "Codeception 4.0 compatibility; required by the WPDb module, PHP 5.6 compatible version.", - "codeception/module-filesystem:^1.0": "Codeception 4.0 compatibility; required by the WPFilesystem module.", - "codeception/module-phpbrowser:^1.0": "Codeception 4.0 compatibility; required by the WPBrowser module.", - "codeception/module-webdriver:^1.0": "Codeception 4.0 compatibility; required by the WPWebDriver module.", - "codeception/util-universalframework:^1.0": "Codeception 4.0 compatibility; required by the WordPress framework module.", - "gumlet/php-image-resize": "To handle runtime image modification in the WPDb::haveAttachmentInDatabase method.", - "vlucas/phpdotenv:^4.0": "To manage more complex environment file based configuration of the suites." - }, - "type": "library", - "extra": { - "_hash": "484f861f69198089cab0e642f27e5653" - }, - "autoload": { - "files": [ - "src/tad/WPBrowser/utils.php", - "src/tad/WPBrowser/wp-polyfills.php" - ], - "psr-4": { - "tad\\": "src/tad", - "Codeception\\": "src/Codeception", - "lucatume\\WPBrowser\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "theAverageDev (Luca Tumedei)", - "email": "luca@theaveragedev.com", - "homepage": "http://theaveragedev.com", - "role": "Developer" - } - ], - "description": "WordPress extension of the PhpBrowser class.", - "homepage": "http://github.com/lucatume/wp-browser", - "keywords": [ - "codeception", - "wordpress" - ], - "support": { - "issues": "https://github.com/lucatume/wp-browser/issues", - "source": "https://github.com/lucatume/wp-browser/tree/3.2.3" - }, - "funding": [ - { - "url": "https://github.com/lucatume", - "type": "github" - } - ], - "time": "2024-01-08T08:27:20+00:00" - }, - { - "name": "mck89/peast", - "version": "v1.16.3", - "source": { - "type": "git", - "url": "https://github.com/mck89/peast.git", - "reference": "645ec21b650bc2aced18285c85f220d22afc1430" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mck89/peast/zipball/645ec21b650bc2aced18285c85f220d22afc1430", - "reference": "645ec21b650bc2aced18285c85f220d22afc1430", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.16.3-dev" - } - }, - "autoload": { - "psr-4": { - "Peast\\": "lib/Peast/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Marco Marchiò", - "email": "marco.mm89@gmail.com" - } - ], - "description": "Peast is PHP library that generates AST for JavaScript code", - "support": { - "issues": "https://github.com/mck89/peast/issues", - "source": "https://github.com/mck89/peast/tree/v1.16.3" - }, - "time": "2024-07-23T14:00:32+00:00" - }, - { - "name": "mikehaertl/php-shellcommand", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/mikehaertl/php-shellcommand.git", - "reference": "e79ea528be155ffdec6f3bf1a4a46307bb49e545" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikehaertl/php-shellcommand/zipball/e79ea528be155ffdec6f3bf1a4a46307bb49e545", - "reference": "e79ea528be155ffdec6f3bf1a4a46307bb49e545", - "shasum": "" - }, - "require": { - "php": ">= 5.3.0" - }, - "require-dev": { - "phpunit/phpunit": ">4.0 <=9.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "mikehaertl\\shellcommand\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Härtl", - "email": "haertl.mike@gmail.com" - } - ], - "description": "An object oriented interface to shell commands", - "keywords": [ - "shell" - ], - "support": { - "issues": "https://github.com/mikehaertl/php-shellcommand/issues", - "source": "https://github.com/mikehaertl/php-shellcommand/tree/1.7.0" - }, - "time": "2023-04-19T08:25:22+00:00" - }, - { - "name": "mikemclin/laravel-wp-password", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/mikemclin/laravel-wp-password.git", - "reference": "5225c95f75aa0a5ad4040ec2074d1c8d7f10b5f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikemclin/laravel-wp-password/zipball/5225c95f75aa0a5ad4040ec2074d1c8d7f10b5f4", - "reference": "5225c95f75aa0a5ad4040ec2074d1c8d7f10b5f4", - "shasum": "" - }, - "require": { - "bordoni/phpass": "0.3.*", - "illuminate/support": ">=4.0.0", - "php": ">=5.3.0" - }, - "require-dev": { - "mockery/mockery": "~0.9", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "^2.2" - }, - "type": "laravel-package", - "extra": { - "laravel": { - "providers": [ - "MikeMcLin\\WpPassword\\WpPasswordProvider" - ], - "aliases": { - "WpPassword": "MikeMcLin\\WpPassword\\Facades\\WpPassword" - } - } - }, - "autoload": { - "psr-4": { - "MikeMcLin\\WpPassword\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike McLin", - "email": "mike@mikemclin.com", - "homepage": "http://mikemclin.net" - } - ], - "description": "Laravel package that checks and creates WordPress password hashes", - "homepage": "https://github.com/mikemclin/laravel-wp-password", - "keywords": [ - "hashing", - "laravel", - "password", - "wordpress" - ], - "support": { - "issues": "https://github.com/mikemclin/laravel-wp-password/issues", - "source": "https://github.com/mikemclin/laravel-wp-password/tree/2.0.3" - }, - "time": "2021-09-30T13:48:57+00:00" - }, - { - "name": "mustache/mustache", - "version": "v2.14.2", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "e62b7c3849d22ec55f3ec425507bf7968193a6cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e62b7c3849d22ec55f3ec425507bf7968193a6cb", - "reference": "e62b7c3849d22ec55f3ec425507bf7968193a6cb", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", - "phpunit/phpunit": "~3.7|~4.0|~5.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Mustache": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "A Mustache implementation in PHP.", - "homepage": "https://github.com/bobthecow/mustache.php", - "keywords": [ - "mustache", - "templating" - ], - "support": { - "issues": "https://github.com/bobthecow/mustache.php/issues", - "source": "https://github.com/bobthecow/mustache.php/tree/v2.14.2" - }, - "time": "2022-08-23T13:07:01+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.12.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3 <3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpspec/prophecy": "^1.10", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2024-06-12T14:39:25+00:00" - }, - { - "name": "nb/oxymel", - "version": "v0.1.0", - "source": { - "type": "git", - "url": "https://github.com/nb/oxymel.git", - "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nb/oxymel/zipball/cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", - "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "type": "library", - "autoload": { - "psr-0": { - "Oxymel": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nikolay Bachiyski", - "email": "nb@nikolay.bg", - "homepage": "http://extrapolate.me/" - } - ], - "description": "A sweet XML builder", - "homepage": "https://github.com/nb/oxymel", - "keywords": [ - "xml" - ], - "support": { - "issues": "https://github.com/nb/oxymel/issues", - "source": "https://github.com/nb/oxymel/tree/master" - }, - "time": "2013-02-24T15:01:54+00:00" - }, - { - "name": "nesbot/carbon", - "version": "2.72.5", - "source": { - "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/afd46589c216118ecd48ff2b95d77596af1e57ed", - "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed", - "shasum": "" - }, - "require": { - "carbonphp/carbon-doctrine-types": "*", - "ext-json": "*", - "php": "^7.1.8 || ^8.0", - "psr/clock": "^1.0", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" - }, - "provide": { - "psr/clock-implementation": "1.0" - }, - "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", - "doctrine/orm": "^2.7 || ^3.0", - "friendsofphp/php-cs-fixer": "^3.0", - "kylekatarnls/multi-tester": "^2.0", - "ondrejmirtes/better-reflection": "*", - "phpmd/phpmd": "^2.9", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.99 || ^1.7.14", - "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", - "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", - "squizlabs/php_codesniffer": "^3.4" - }, - "bin": [ - "bin/carbon" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev", - "dev-2.x": "2.x-dev" - }, - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "autoload": { - "psr-4": { - "Carbon\\": "src/Carbon/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "https://markido.com" - }, - { - "name": "kylekatarnls", - "homepage": "https://github.com/kylekatarnls" - } - ], - "description": "An API extension for DateTime that supports 281 different languages.", - "homepage": "https://carbon.nesbot.com", - "keywords": [ - "date", - "datetime", - "time" - ], - "support": { - "docs": "https://carbon.nesbot.com/docs", - "issues": "https://github.com/briannesbitt/Carbon/issues", - "source": "https://github.com/briannesbitt/Carbon" - }, - "funding": [ - { - "url": "https://github.com/sponsors/kylekatarnls", - "type": "github" - }, - { - "url": "https://opencollective.com/Carbon#sponsor", - "type": "opencollective" - }, - { - "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", - "type": "tidelift" - } - ], - "time": "2024-06-03T19:18:41+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v5.1.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", - "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "php": ">=7.4" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" - }, - "time": "2024-07-01T20:03:41+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "54750ef60c58e43759730615a392c31c80e23176" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", - "reference": "54750ef60c58e43759730615a392c31c80e23176", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2024-03-03T12:33:53+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "php-webdriver/webdriver", - "version": "1.15.1", - "source": { - "type": "git", - "url": "https://github.com/php-webdriver/php-webdriver.git", - "reference": "cd52d9342c5aa738c2e75a67e47a1b6df97154e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/cd52d9342c5aa738c2e75a67e47a1b6df97154e8", - "reference": "cd52d9342c5aa738c2e75a67e47a1b6df97154e8", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-zip": "*", - "php": "^7.3 || ^8.0", - "symfony/polyfill-mbstring": "^1.12", - "symfony/process": "^5.0 || ^6.0 || ^7.0" - }, - "replace": { - "facebook/webdriver": "*" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.20.0", - "ondram/ci-detector": "^4.0", - "php-coveralls/php-coveralls": "^2.4", - "php-mock/php-mock-phpunit": "^2.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpunit/phpunit": "^9.3", - "squizlabs/php_codesniffer": "^3.5", - "symfony/var-dumper": "^5.0 || ^6.0" - }, - "suggest": { - "ext-SimpleXML": "For Firefox profile creation" - }, - "type": "library", - "autoload": { - "files": [ - "lib/Exception/TimeoutException.php" - ], - "psr-4": { - "Facebook\\WebDriver\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP client for Selenium WebDriver. Previously facebook/webdriver.", - "homepage": "https://github.com/php-webdriver/php-webdriver", - "keywords": [ - "Chromedriver", - "geckodriver", - "php", - "selenium", - "webdriver" - ], - "support": { - "issues": "https://github.com/php-webdriver/php-webdriver/issues", - "source": "https://github.com/php-webdriver/php-webdriver/tree/1.15.1" - }, - "time": "2023-10-20T12:21:20+00:00" - }, - { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, - "time": "2019-12-27T09:44:58+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.3", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "paragonie", - "phpcs", - "polyfill", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" - }, - "funding": [ - { - "url": "https://github.com/PHPCompatibility", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", - "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - } - ], - "time": "2024-04-24T21:30:46+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.5", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "phpcs", - "standards", - "static analysis", - "wordpress" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" - }, - "funding": [ - { - "url": "https://github.com/PHPCompatibility", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", - "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - } - ], - "time": "2024-04-24T21:37:59+00:00" - }, - { - "name": "phpcsstandards/phpcsextra", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", - "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "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 || ^8.0 || ^9.0" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" - } - ], - "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", - "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", - "phpcs", - "standards", - "static analysis" - ], - "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" - } - ], - "time": "2023-12-08T16:49:07+00:00" - }, - { - "name": "phpcsstandards/phpcsutils", - "version": "1.0.12", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", - "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", - "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.10.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.1.0 || ^2.0.0" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" - } - }, - "autoload": { - "classmap": [ - "PHPCSUtils/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" - } - ], - "description": "A suite of utility functions for use with PHP_CodeSniffer", - "homepage": "https://phpcsutils.com/", - "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", - "phpcs", - "phpcs3", - "standards", - "static analysis", - "tokens", - "utility" - ], - "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" - } - ], - "time": "2024-05-20T13:34:27+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.31", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "PHP extension that provides line coverage", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:37:42+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.6.20", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "49d7820565836236411f5dc002d16dd689cde42f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", - "reference": "49d7820565836236411f5dc002d16dd689cde42f", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.5.0 || ^2", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", - "phar-io/manifest": "^2.0.4", - "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.31", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.6-dev" - } - }, - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" - } - ], - "time": "2024-07-10T11:45:39+00:00" - }, - { - "name": "pluginever/framework-model", - "version": "dev-master", - "source": { - "type": "git", - "url": "git@github.com:pluginever/framework-model.git", - "reference": "df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pluginever/framework-model/zipball/df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e", - "reference": "df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "byteever/byteever-sniffs": "dev-master" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-4": { - "Lib\\": "src" - } - }, - "scripts": { - "phpcs": [ - "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" - ], - "phpcbf": [ - "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" - ] - }, - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Sultan Nasir Uddin", - "email": "manikdrmc@gmail.com" - } - ], - "description": "Model for the framework", - "support": { - "source": "https://github.com/pluginever/framework-model/tree/v1.0.9", - "issues": "https://github.com/pluginever/framework-model/issues" - }, - "time": "2024-03-10T05:53:38+00:00" - }, - { - "name": "pluginever/framework-plugin", - "version": "dev-master", - "source": { - "type": "git", - "url": "git@github.com:pluginever/framework-plugin.git", - "reference": "dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pluginever/framework-plugin/zipball/dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0", - "reference": "dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "byteever/byteever-sniffs": "dev-master" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-4": { - "Lib\\": "src" - } - }, - "scripts": { - "phpcs": [ - "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" - ], - "phpcbf": [ - "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" - ] - }, - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Sultan Nasir Uddin", - "email": "manikdrmc@gmail.com" - } - ], - "description": "A set of related classes to kick start WordPress plugin development.", - "support": { - "source": "https://github.com/pluginever/framework-plugin/tree/v1.0.8", - "issues": "https://github.com/pluginever/framework-plugin/issues" - }, - "time": "2023-10-25T08:44:40+00:00" - }, - { - "name": "pluginever/framework-settings", - "version": "dev-master", - "source": { - "type": "git", - "url": "git@github.com:pluginever/framework-settings.git", - "reference": "5a1718ada466a9e58a55827d77257ad237c9f0bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pluginever/framework-settings/zipball/5a1718ada466a9e58a55827d77257ad237c9f0bd", - "reference": "5a1718ada466a9e58a55827d77257ad237c9f0bd", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "byteever/byteever-sniffs": "dev-master" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-4": { - "Lib\\": "src" - } - }, - "scripts": { - "phpcs": [ - "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" - ], - "phpcbf": [ - "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" - ] - }, - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Sultan Nasir Uddin", - "email": "manikdrmc@gmail.com" - } - ], - "description": "A set of related classes to kick start WordPress plugin development.", - "support": { - "source": "https://github.com/pluginever/framework-settings/tree/v1.0.7", - "issues": "https://github.com/pluginever/framework-settings/issues" - }, - "time": "2024-02-27T06:05:22+00:00" - }, - { - "name": "psr/clock", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/clock.git", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Clock\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for reading the clock.", - "homepage": "https://github.com/php-fig/clock", - "keywords": [ - "clock", - "now", - "psr", - "psr-20", - "time" - ], - "support": { - "issues": "https://github.com/php-fig/clock/issues", - "source": "https://github.com/php-fig/clock/tree/1.0.0" - }, - "time": "2022-11-25T14:36:26+00:00" - }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "psr/http-client", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client" - }, - "time": "2023-09-23T14:17:50+00:00" - }, - { - "name": "psr/http-factory", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", - "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory" - }, - "time": "2024-04-15T12:06:14+00:00" - }, - { - "name": "psr/http-message", - "version": "2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/2.0" - }, - "time": "2023-04-04T09:54:51+00:00" - }, - { - "name": "psr/log", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/2.0.0" - }, - "time": "2021-07-14T16:41:46+00:00" - }, - { - "name": "psr/simple-cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], - "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" - }, - "time": "2021-10-29T13:26:27+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "react/promise", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63", - "shasum": "" - }, - "require": { - "php": ">=7.1.0" - }, - "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", - "phpunit/phpunit": "^9.6 || ^7.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.2.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-05-24T10:39:05+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:27:43+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T12:41:17+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-22T06:19:30+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:30:58+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:03:51+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:33:00+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:35:11+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-22T06:20:34+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:14:26+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-14T16:00:52+00:00" - }, - { - "name": "sebastian/type", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:13:03+00:00" - }, - { - "name": "sebastian/version", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2", - "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.11", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "support": { - "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.11.0" - }, - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", - "type": "tidelift" - } - ], - "time": "2024-07-11T14:55:45+00:00" - }, - { - "name": "seld/phar-utils", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", - "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\PharUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "PHAR file format utilities, for when PHP phars you up", - "keywords": [ - "phar" - ], - "support": { - "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" - }, - "time": "2022-08-31T10:31:18+00:00" - }, - { - "name": "seld/signal-handler", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/signal-handler.git", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "require-dev": { - "phpstan/phpstan": "^1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^7.5.20 || ^8.5.23", - "psr/log": "^1 || ^2 || ^3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\Signal\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", - "keywords": [ - "posix", - "sigint", - "signal", - "sigterm", - "unix" - ], - "support": { - "issues": "https://github.com/Seldaek/signal-handler/issues", - "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" - }, - "time": "2023-09-03T09:24:00+00:00" - }, - { - "name": "softcreatr/jsonpath", - "version": "0.7.5", - "source": { - "type": "git", - "url": "https://github.com/SoftCreatR/JSONPath.git", - "reference": "008569bf80aa3584834f7890781576bc7b65afa7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/SoftCreatR/JSONPath/zipball/008569bf80aa3584834f7890781576bc7b65afa7", - "reference": "008569bf80aa3584834f7890781576bc7b65afa7", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=7.1" - }, - "replace": { - "flow/jsonpath": "*" - }, - "require-dev": { - "phpunit/phpunit": ">=7.0", - "roave/security-advisories": "dev-master", - "squizlabs/php_codesniffer": "^3.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Flow\\JSONPath\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Stephen Frank", - "email": "stephen@flowsa.com", - "homepage": "https://prismaticbytes.com", - "role": "Developer" - }, - { - "name": "Sascha Greuel", - "email": "hello@1-2.dev", - "homepage": "http://1-2.dev", - "role": "Developer" - } - ], - "description": "JSONPath implementation for parsing, searching and flattening arrays", - "support": { - "email": "hello@1-2.dev", - "forum": "https://github.com/SoftCreatR/JSONPath/discussions", - "issues": "https://github.com/SoftCreatR/JSONPath/issues", - "source": "https://github.com/SoftCreatR/JSONPath" - }, - "funding": [ - { - "url": "https://github.com/softcreatr", - "type": "github" - } - ], - "time": "2021-06-02T22:15:26+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.10.2", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" - }, - "bin": [ - "bin/phpcbf", - "bin/phpcs" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "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/PHPCSStandards/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], - "support": { - "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" - } - ], - "time": "2024-07-21T23:26:44+00:00" - }, - { - "name": "symfony/browser-kit", - "version": "v5.4.40", - "source": { - "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/92c8ba1e5ee12d07120744c90898516132b4e58b", - "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/dom-crawler": "^4.4|^5.0|^6.0", - "symfony/polyfill-php80": "^1.16" - }, - "require-dev": { - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.4.40" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T14:33:22+00:00" - }, - { - "name": "symfony/console", - "version": "v5.4.42", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v5.4.42" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-07-26T12:21:55+00:00" - }, - { - "name": "symfony/css-selector", - "version": "v5.4.40", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", - "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Converts CSS selectors to XPath expressions", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.40" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T14:33:22+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.0.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:55:41+00:00" - }, - { - "name": "symfony/dom-crawler", - "version": "v5.4.40", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "2ad469c3e07fdba677b278d0e266071a51aa0dac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2ad469c3e07fdba677b278d0e266071a51aa0dac", - "reference": "2ad469c3e07fdba677b278d0e266071a51aa0dac", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "masterminds/html5": "<2.6" - }, - "require-dev": { - "masterminds/html5": "^2.6", - "symfony/css-selector": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases DOM navigation for HTML and XML documents", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.40" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T14:33:22+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v5.4.40", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a54e2a8a114065f31020d6a89ede83e34c3b27a4", - "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<4.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.40" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T14:33:22+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v3.0.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:55:41+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v6.0.19", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3d49eec03fda1f0fc19b7349fbbe55ebc1004214", - "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.0.19" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-20T17:44:14+00:00" - }, - { - "name": "symfony/finder", - "version": "v5.4.42", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "0724c51fa067b198e36506d2864e09a52180998a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", - "reference": "0724c51fa067b198e36506d2864e09a52180998a", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.42" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-07-22T08:53:29+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.30.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T15:07:36+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.30.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T15:07:36+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.30.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T15:07:36+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.30.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-06-19T12:30:46+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.30.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T15:07:36+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.30.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T15:07:36+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.30.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", - "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-06-19T12:30:46+00:00" - }, - { - "name": "symfony/process", - "version": "v6.0.19", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "2114fd60f26a296cc403a7939ab91478475a33d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2114fd60f26a296cc403a7939ab91478475a33d4", - "reference": "2114fd60f26a296cc403a7939ab91478475a33d4", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v6.0.19" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-01T08:36:10+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.0.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66", - "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.0.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-30T19:17:58+00:00" - }, - { - "name": "symfony/string", - "version": "v6.0.19", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.0" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v6.0.19" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-01T08:36:10+00:00" - }, - { - "name": "symfony/translation", - "version": "v6.0.19", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", - "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.3|^3.0" - }, - "conflict": { - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/http-kernel": "<5.4", - "symfony/twig-bundle": "<5.4", - "symfony/yaml": "<5.4" - }, - "provide": { - "symfony/translation-implementation": "2.3|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", - "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^5.4|^6.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to internationalize your application", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/translation/tree/v6.0.19" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-01T08:36:10+00:00" - }, - { - "name": "symfony/translation-contracts", - "version": "v3.0.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/acbfbb274e730e5a0236f619b6168d9dedb3e282", - "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to translation", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.0.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-06-27T17:10:44+00:00" - }, - { - "name": "symfony/yaml", - "version": "v5.4.40", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "81cad0ceab3d61fe14fe941ff18a230ac9c80f83" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/81cad0ceab3d61fe14fe941ff18a230ac9c80f83", - "reference": "81cad0ceab3d61fe14fe941ff18a230ac9c80f83", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<5.3" - }, - "require-dev": { - "symfony/console": "^5.3|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.40" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-05-31T14:33:22+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.3", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2024-03-03T12:36:25+00:00" - }, - { - "name": "voku/portable-ascii", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/voku/portable-ascii.git", - "reference": "b56450eed252f6801410d810c8e1727224ae0743" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", - "reference": "b56450eed252f6801410d810c8e1727224ae0743", - "shasum": "" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" - }, - "suggest": { - "ext-intl": "Use Intl for transliterator_transliterate() support" - }, - "type": "library", - "autoload": { - "psr-4": { - "voku\\": "src/voku/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" - } - ], - "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", - "homepage": "https://github.com/voku/portable-ascii", - "keywords": [ - "ascii", - "clean", - "php" - ], - "support": { - "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/2.0.1" - }, - "funding": [ - { - "url": "https://www.paypal.me/moelleken", - "type": "custom" - }, - { - "url": "https://github.com/voku", - "type": "github" - }, - { - "url": "https://opencollective.com/portable-ascii", - "type": "open_collective" - }, - { - "url": "https://www.patreon.com/voku", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", - "type": "tidelift" - } - ], - "time": "2022-03-08T17:03:00+00:00" - }, - { - "name": "vria/nodiacritic", - "version": "0.1.2", - "source": { - "type": "git", - "url": "https://github.com/vria/nodiacritic.git", - "reference": "3efeb60fb2586fe3ce8ff0f3c122d380717b8b07" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vria/nodiacritic/zipball/3efeb60fb2586fe3ce8ff0f3c122d380717b8b07", - "reference": "3efeb60fb2586fe3ce8ff0f3c122d380717b8b07", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "4.8.*" - }, - "type": "library", - "autoload": { - "psr-4": { - "VRia\\Utils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0" - ], - "authors": [ - { - "name": "Riabchenko Vlad", - "email": "contact@vria.eu", - "homepage": "http://vria.eu" - } - ], - "description": "Tiny helper function that removes all diacritical signs from characters", - "homepage": "https://github.com/vria/nodiacritic", - "keywords": [ - "accent", - "diacritic", - "filter", - "string", - "text" - ], - "support": { - "email": "contact@vria.eu", - "issues": "https://github.com/vria/nodiacritic/issues", - "source": "https://github.com/vria/nodiacritic/tree/0.1.2" - }, - "time": "2016-09-17T22:03:11+00:00" - }, - { - "name": "wp-cli/cache-command", - "version": "v2.1.3", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/cache-command.git", - "reference": "1dbb59e5ed126b9a2fa9d521d29910f3f4eb0f97" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/1dbb59e5ed126b9a2fa9d521d29910f3f4eb0f97", - "reference": "1dbb59e5ed126b9a2fa9d521d29910f3f4eb0f97", - "shasum": "" - }, - "require": { - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "cache", - "cache add", - "cache decr", - "cache delete", - "cache flush", - "cache flush-group", - "cache get", - "cache incr", - "cache replace", - "cache set", - "cache supports", - "cache type", - "transient", - "transient delete", - "transient get", - "transient set", - "transient type", - "transient list" - ] - }, - "autoload": { - "files": [ - "cache-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - } - ], - "description": "Manages object and transient caches.", - "homepage": "https://github.com/wp-cli/cache-command", - "support": { - "issues": "https://github.com/wp-cli/cache-command/issues", - "source": "https://github.com/wp-cli/cache-command/tree/v2.1.3" - }, - "time": "2024-04-26T14:54:22+00:00" - }, - { - "name": "wp-cli/checksum-command", - "version": "v2.2.5", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/checksum-command.git", - "reference": "f6911998734018da08f75464a168feb0d07b4475" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/checksum-command/zipball/f6911998734018da08f75464a168feb0d07b4475", - "reference": "f6911998734018da08f75464a168feb0d07b4475", - "shasum": "" - }, - "require": { - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "core verify-checksums", - "plugin verify-checksums" - ] - }, - "autoload": { - "files": [ - "checksum-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - } - ], - "description": "Verifies file integrity by comparing to published checksums.", - "homepage": "https://github.com/wp-cli/checksum-command", - "support": { - "issues": "https://github.com/wp-cli/checksum-command/issues", - "source": "https://github.com/wp-cli/checksum-command/tree/v2.2.5" - }, - "time": "2023-11-10T21:54:15+00:00" - }, - { - "name": "wp-cli/config-command", - "version": "v2.3.5", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/config-command.git", - "reference": "a4ae2c73a03706b7f5b8c74426a44b4df198352c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/config-command/zipball/a4ae2c73a03706b7f5b8c74426a44b4df198352c", - "reference": "a4ae2c73a03706b7f5b8c74426a44b4df198352c", - "shasum": "" - }, - "require": { - "wp-cli/wp-cli": "^2.5", - "wp-cli/wp-config-transformer": "^1.2.1" - }, - "require-dev": { - "wp-cli/db-command": "^1.3 || ^2", - "wp-cli/wp-cli-tests": "^4.2.8" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "config", - "config edit", - "config delete", - "config create", - "config get", - "config has", - "config is-true", - "config list", - "config path", - "config set", - "config shuffle-salts" - ] - }, - "autoload": { - "files": [ - "config-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - }, - { - "name": "Alain Schlesser", - "email": "alain.schlesser@gmail.com", - "homepage": "https://www.alainschlesser.com" - } - ], - "description": "Generates and reads the wp-config.php file.", - "homepage": "https://github.com/wp-cli/config-command", - "support": { - "issues": "https://github.com/wp-cli/config-command/issues", - "source": "https://github.com/wp-cli/config-command/tree/v2.3.5" - }, - "time": "2024-07-22T10:31:46+00:00" - }, - { - "name": "wp-cli/core-command", - "version": "v2.1.18", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/core-command.git", - "reference": "f7580f93fe66a5584fa7b7c42bd2c0c1435c9d2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/core-command/zipball/f7580f93fe66a5584fa7b7c42bd2c0c1435c9d2e", - "reference": "f7580f93fe66a5584fa7b7c42bd2c0c1435c9d2e", - "shasum": "" - }, - "require": { - "composer/semver": "^1.4 || ^2 || ^3", - "wp-cli/wp-cli": "^2.5.1" - }, - "require-dev": { - "wp-cli/checksum-command": "^1 || ^2", - "wp-cli/db-command": "^1.3 || ^2", - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "core", - "core check-update", - "core download", - "core install", - "core is-installed", - "core multisite-convert", - "core multisite-install", - "core update", - "core update-db", - "core version" - ] - }, - "autoload": { - "files": [ - "core-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - } - ], - "description": "Downloads, installs, updates, and manages a WordPress installation.", - "homepage": "https://github.com/wp-cli/core-command", - "support": { - "issues": "https://github.com/wp-cli/core-command/issues", - "source": "https://github.com/wp-cli/core-command/tree/v2.1.18" - }, - "time": "2024-04-12T09:36:36+00:00" - }, - { - "name": "wp-cli/cron-command", - "version": "v2.3.0", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/cron-command.git", - "reference": "2108295a2f30de77d3ee70b1a60d1b542c2dfd79" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/cron-command/zipball/2108295a2f30de77d3ee70b1a60d1b542c2dfd79", - "reference": "2108295a2f30de77d3ee70b1a60d1b542c2dfd79", - "shasum": "" - }, - "require": { - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/eval-command": "^2.0", - "wp-cli/server-command": "^2.0", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "cron", - "cron test", - "cron event", - "cron event delete", - "cron event list", - "cron event run", - "cron event schedule", - "cron schedule", - "cron schedule list", - "cron event unschedule" - ] - }, - "autoload": { - "files": [ - "cron-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - } - ], - "description": "Tests, runs, and deletes WP-Cron events; manages WP-Cron schedules.", - "homepage": "https://github.com/wp-cli/cron-command", - "support": { - "issues": "https://github.com/wp-cli/cron-command/issues", - "source": "https://github.com/wp-cli/cron-command/tree/v2.3.0" - }, - "time": "2024-02-15T10:23:39+00:00" - }, - { - "name": "wp-cli/db-command", - "version": "v2.1.1", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/db-command.git", - "reference": "60ee5535e4b39e2d930894b7f435a2e488171c27" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/db-command/zipball/60ee5535e4b39e2d930894b7f435a2e488171c27", - "reference": "60ee5535e4b39e2d930894b7f435a2e488171c27", - "shasum": "" - }, - "require": { - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "db", - "db clean", - "db create", - "db drop", - "db reset", - "db check", - "db optimize", - "db prefix", - "db repair", - "db cli", - "db query", - "db export", - "db import", - "db search", - "db tables", - "db size", - "db columns" - ] - }, - "autoload": { - "files": [ - "db-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - } - ], - "description": "Performs basic database operations using credentials stored in wp-config.php.", - "homepage": "https://github.com/wp-cli/db-command", - "support": { - "issues": "https://github.com/wp-cli/db-command/issues", - "source": "https://github.com/wp-cli/db-command/tree/v2.1.1" - }, - "time": "2024-07-10T17:31:56+00:00" - }, - { - "name": "wp-cli/embed-command", - "version": "v2.0.16", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/embed-command.git", - "reference": "edfa448396484770a419ac7a17b0ec194ae76654" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/embed-command/zipball/edfa448396484770a419ac7a17b0ec194ae76654", - "reference": "edfa448396484770a419ac7a17b0ec194ae76654", - "shasum": "" - }, - "require": { - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "embed", - "embed fetch", - "embed provider", - "embed provider list", - "embed provider match", - "embed handler", - "embed handler list", - "embed cache", - "embed cache clear", - "embed cache find", - "embed cache trigger" - ] - }, - "autoload": { - "files": [ - "embed-command.php" - ], - "psr-4": { - "WP_CLI\\Embeds\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Pascal Birchler", - "homepage": "https://pascalbirchler.com/" - } - ], - "description": "Inspects oEmbed providers, clears embed cache, and more.", - "homepage": "https://github.com/wp-cli/embed-command", - "support": { - "issues": "https://github.com/wp-cli/embed-command/issues", - "source": "https://github.com/wp-cli/embed-command/tree/v2.0.16" - }, - "time": "2024-04-04T11:57:03+00:00" - }, - { - "name": "wp-cli/entity-command", - "version": "v2.7.0", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/entity-command.git", - "reference": "8110a596db62eb423f7f8e49c99dbacacf01f6ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/entity-command/zipball/8110a596db62eb423f7f8e49c99dbacacf01f6ed", - "reference": "8110a596db62eb423f7f8e49c99dbacacf01f6ed", - "shasum": "" - }, - "require": { - "wp-cli/wp-cli": "^2.10" - }, - "require-dev": { - "wp-cli/cache-command": "^1 || ^2", - "wp-cli/db-command": "^1.3 || ^2", - "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/media-command": "^1.1 || ^2", - "wp-cli/super-admin-command": "^1 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "comment", - "comment approve", - "comment count", - "comment create", - "comment delete", - "comment exists", - "comment generate", - "comment get", - "comment list", - "comment meta", - "comment meta add", - "comment meta delete", - "comment meta get", - "comment meta list", - "comment meta patch", - "comment meta pluck", - "comment meta update", - "comment recount", - "comment spam", - "comment status", - "comment trash", - "comment unapprove", - "comment unspam", - "comment untrash", - "comment update", - "menu", - "menu create", - "menu delete", - "menu item", - "menu item add-custom", - "menu item add-post", - "menu item add-term", - "menu item delete", - "menu item list", - "menu item update", - "menu list", - "menu location", - "menu location assign", - "menu location list", - "menu location remove", - "network meta", - "network meta add", - "network meta delete", - "network meta get", - "network meta list", - "network meta patch", - "network meta pluck", - "network meta update", - "option", - "option add", - "option delete", - "option get", - "option list", - "option patch", - "option pluck", - "option update", - "option set-autoload", - "option get-autoload", - "post", - "post create", - "post delete", - "post edit", - "post exists", - "post generate", - "post get", - "post list", - "post meta", - "post meta add", - "post meta clean-duplicates", - "post meta delete", - "post meta get", - "post meta list", - "post meta patch", - "post meta pluck", - "post meta update", - "post term", - "post term add", - "post term list", - "post term remove", - "post term set", - "post update", - "post url-to-id", - "post-type", - "post-type get", - "post-type list", - "site", - "site activate", - "site archive", - "site create", - "site deactivate", - "site delete", - "site empty", - "site list", - "site mature", - "site meta", - "site meta add", - "site meta delete", - "site meta get", - "site meta list", - "site meta patch", - "site meta pluck", - "site meta update", - "site option", - "site private", - "site public", - "site spam", - "site unarchive", - "site unmature", - "site unspam", - "taxonomy", - "taxonomy get", - "taxonomy list", - "term", - "term create", - "term delete", - "term generate", - "term get", - "term list", - "term meta", - "term meta add", - "term meta delete", - "term meta get", - "term meta list", - "term meta patch", - "term meta pluck", - "term meta update", - "term recount", - "term update", - "user", - "user add-cap", - "user add-role", - "user application-password", - "user application-password create", - "user application-password delete", - "user application-password exists", - "user application-password get", - "user application-password list", - "user application-password record-usage", - "user application-password update", - "user create", - "user delete", - "user exists", - "user generate", - "user get", - "user import-csv", - "user list", - "user list-caps", - "user meta", - "user meta add", - "user meta delete", - "user meta get", - "user meta list", - "user meta patch", - "user meta pluck", - "user meta update", - "user remove-cap", - "user remove-role", - "user reset-password", - "user session", - "user session destroy", - "user session list", - "user set-role", - "user spam", - "user term", - "user term add", - "user term list", - "user term remove", - "user term set", - "user unspam", - "user update" - ] - }, - "autoload": { - "files": [ - "entity-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - } - ], - "description": "Manage WordPress comments, menus, options, posts, sites, terms, and users.", - "homepage": "https://github.com/wp-cli/entity-command", - "support": { - "issues": "https://github.com/wp-cli/entity-command/issues", - "source": "https://github.com/wp-cli/entity-command/tree/v2.7.0" - }, - "time": "2024-04-29T07:34:56+00:00" - }, - { - "name": "wp-cli/eval-command", - "version": "v2.2.4", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/eval-command.git", - "reference": "5a9c605ae52d118f582693209d2f1c5c4f214b76" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/eval-command/zipball/5a9c605ae52d118f582693209d2f1c5c4f214b76", - "reference": "5a9c605ae52d118f582693209d2f1c5c4f214b76", - "shasum": "" - }, - "require": { - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "eval", - "eval-file" - ] - }, - "autoload": { - "files": [ - "eval-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - } - ], - "description": "Executes arbitrary PHP code or files.", - "homepage": "https://github.com/wp-cli/eval-command", - "support": { - "issues": "https://github.com/wp-cli/eval-command/issues", - "source": "https://github.com/wp-cli/eval-command/tree/v2.2.4" - }, - "time": "2023-08-30T14:51:36+00:00" - }, - { - "name": "wp-cli/export-command", - "version": "v2.1.12", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/export-command.git", - "reference": "31e3d714ac6d6f0af613c34b33dbc02b85dc2e68" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/export-command/zipball/31e3d714ac6d6f0af613c34b33dbc02b85dc2e68", - "reference": "31e3d714ac6d6f0af613c34b33dbc02b85dc2e68", - "shasum": "" - }, - "require": { - "nb/oxymel": "~0.1.0", - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/db-command": "^1.3 || ^2", - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/import-command": "^1 || ^2", - "wp-cli/media-command": "^1 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "export" - ] - }, - "autoload": { - "files": [ - "export-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - } - ], - "description": "Exports WordPress content to a WXR file.", - "homepage": "https://github.com/wp-cli/export-command", - "support": { - "issues": "https://github.com/wp-cli/export-command/issues", - "source": "https://github.com/wp-cli/export-command/tree/v2.1.12" - }, - "time": "2023-09-18T21:41:00+00:00" - }, - { - "name": "wp-cli/extension-command", - "version": "v2.1.22", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/extension-command.git", - "reference": "7baa058ae33e78a8e19f6a189203ed08e03a21be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/7baa058ae33e78a8e19f6a189203ed08e03a21be", - "reference": "7baa058ae33e78a8e19f6a189203ed08e03a21be", - "shasum": "" - }, - "require": { - "composer/semver": "^1.4 || ^2 || ^3", - "wp-cli/wp-cli": "^2.10" - }, - "require-dev": { - "wp-cli/cache-command": "^2.0", - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/language-command": "^2.0", - "wp-cli/scaffold-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "plugin", - "plugin activate", - "plugin deactivate", - "plugin delete", - "plugin get", - "plugin install", - "plugin is-installed", - "plugin list", - "plugin path", - "plugin search", - "plugin status", - "plugin toggle", - "plugin uninstall", - "plugin update", - "theme", - "theme activate", - "theme delete", - "theme disable", - "theme enable", - "theme get", - "theme install", - "theme is-installed", - "theme list", - "theme mod", - "theme mod get", - "theme mod set", - "theme mod remove", - "theme path", - "theme search", - "theme status", - "theme update", - "theme mod list" - ] - }, - "autoload": { - "files": [ - "extension-command.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" - }, - { - "name": "Alain Schlesser", - "email": "alain.schlesser@gmail.com", - "homepage": "https://www.alainschlesser.com" - } - ], - "description": "Manages plugins and themes, including installs, activations, and updates.", - "homepage": "https://github.com/wp-cli/extension-command", - "support": { - "issues": "https://github.com/wp-cli/extension-command/issues", - "source": "https://github.com/wp-cli/extension-command/tree/v2.1.22" - }, - "time": "2024-06-04T12:24:31+00:00" - }, - { - "name": "wp-cli/i18n-command", - "version": "v2.6.2", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/i18n-command.git", - "reference": "53518a11f314119e320597c7a8274f11b1295bdc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/53518a11f314119e320597c7a8274f11b1295bdc", - "reference": "53518a11f314119e320597c7a8274f11b1295bdc", - "shasum": "" - }, - "require": { - "eftec/bladeone": "3.52", - "gettext/gettext": "^4.8", - "mck89/peast": "^1.13.11", - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/scaffold-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "suggest": { - "ext-json": "Used for reading and generating JSON translation files", - "ext-mbstring": "Used for calculating include/exclude matches in code extraction" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "i18n", - "i18n make-pot", - "i18n make-json", - "i18n make-mo", - "i18n make-php", - "i18n update-po" - ] + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" }, - "autoload": { - "files": [ - "i18n-command.php" - ], - "psr-4": { - "WP_CLI\\I18n\\": "src/" - } + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL-3.0-or-later" ], "authors": [ { - "name": "Pascal Birchler", - "homepage": "https://pascalbirchler.com/" + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" } ], - "description": "Provides internationalization tools for WordPress projects.", - "homepage": "https://github.com/wp-cli/i18n-command", + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis", + "wordpress" + ], "support": { - "issues": "https://github.com/wp-cli/i18n-command/issues", - "source": "https://github.com/wp-cli/i18n-command/tree/v2.6.2" + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, - "time": "2024-07-03T12:50:00+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:37:59+00:00" }, { - "name": "wp-cli/import-command", - "version": "v2.0.12", + "name": "phpcsstandards/phpcsextra", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/wp-cli/import-command.git", - "reference": "7aafa54bf7c122dfbd777b5e5fbb5907af38e504" + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/import-command/zipball/7aafa54bf7c122dfbd777b5e5fbb5907af38e504", - "reference": "7aafa54bf7c122dfbd777b5e5fbb5907af38e504", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.0.9", + "squizlabs/php_codesniffer": "^3.8.0" }, "require-dev": { - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/export-command": "^1 || ^2", - "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^4" + "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 || ^8.0 || ^9.0" }, - "type": "wp-cli-package", + "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "import" - ] - }, - "autoload": { - "files": [ - "import-command.php" - ], - "classmap": [ - "src/" - ] + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL-3.0-or-later" ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" } ], - "description": "Imports content from a given WXR file.", - "homepage": "https://github.com/wp-cli/import-command", + "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "standards", + "static analysis" + ], "support": { - "issues": "https://github.com/wp-cli/import-command/issues", - "source": "https://github.com/wp-cli/import-command/tree/v2.0.12" + "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" }, - "time": "2023-08-30T15:53:58+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": "wp-cli/language-command", - "version": "v2.0.21", + "name": "phpcsstandards/phpcsutils", + "version": "1.0.12", "source": { "type": "git", - "url": "https://github.com/wp-cli/language-command.git", - "reference": "a9b5ae5976ebb48ee5465cf2f8d9afc863bc4e1c" + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/language-command/zipball/a9b5ae5976ebb48ee5465cf2f8d9afc863bc4e1c", - "reference": "a9b5ae5976ebb48ee5465cf2f8d9afc863bc4e1c", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev" }, "require-dev": { - "wp-cli/db-command": "^1.3 || ^2", - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^4" + "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.1.0 || ^2.0.0" }, - "type": "wp-cli-package", + "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "language", - "language core", - "language core activate", - "language core is-installed", - "language core install", - "language core list", - "language core uninstall", - "language core update", - "language plugin", - "language plugin is-installed", - "language plugin install", - "language plugin list", - "language plugin uninstall", - "language plugin update", - "language theme", - "language theme is-installed", - "language theme install", - "language theme list", - "language theme uninstall", - "language theme update" - ] + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } }, "autoload": { - "files": [ - "language-command.php" - ], "classmap": [ - "src/" + "PHPCSUtils/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL-3.0-or-later" ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" } ], - "description": "Installs, activates, and manages language packs.", - "homepage": "https://github.com/wp-cli/language-command", + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "phpcs3", + "standards", + "static analysis", + "tokens", + "utility" + ], "support": { - "issues": "https://github.com/wp-cli/language-command/issues", - "source": "https://github.com/wp-cli/language-command/tree/v2.0.21" + "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": "2024-06-21T10:12:40+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": "2024-05-20T13:34:27+00:00" }, { - "name": "wp-cli/maintenance-mode-command", - "version": "v2.1.1", + "name": "pluginever/framework-model", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/wp-cli/maintenance-mode-command.git", - "reference": "a329a536eb96890654b913b5499b300fcc3f8eab" + "url": "git@github.com:pluginever/framework-model.git", + "reference": "df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/maintenance-mode-command/zipball/a329a536eb96890654b913b5499b300fcc3f8eab", - "reference": "a329a536eb96890654b913b5499b300fcc3f8eab", + "url": "https://api.github.com/repos/pluginever/framework-model/zipball/df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e", + "reference": "df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "php": ">=5.6" }, "require-dev": { - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "maintenance-mode", - "maintenance-mode activate", - "maintenance-mode deactivate", - "maintenance-mode status", - "maintenance-mode is-active" - ] + "byteever/byteever-sniffs": "dev-master" }, + "default-branch": true, + "type": "library", "autoload": { - "files": [ - "maintenance-mode-command.php" - ], "psr-4": { - "WP_CLI\\MaintenanceMode\\": "src/" + "Lib\\": "src" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "phpcs": [ + "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" + ], + "phpcbf": [ + "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" + ] + }, "license": [ - "MIT" + "GPL-3.0-or-later" ], "authors": [ { - "name": "Thrijith Thankachan", - "email": "thrijith13@gmail.com", - "homepage": "https://thrijith.com" + "name": "Sultan Nasir Uddin", + "email": "manikdrmc@gmail.com" } ], - "description": "Activates, deactivates or checks the status of the maintenance mode of a site.", - "homepage": "https://github.com/wp-cli/maintenance-mode-command", + "description": "Model for the framework", "support": { - "issues": "https://github.com/wp-cli/maintenance-mode-command/issues", - "source": "https://github.com/wp-cli/maintenance-mode-command/tree/v2.1.1" + "source": "https://github.com/pluginever/framework-model/tree/v1.0.9", + "issues": "https://github.com/pluginever/framework-model/issues" }, - "time": "2024-04-04T11:28:11+00:00" + "time": "2024-03-10T05:53:38+00:00" }, { - "name": "wp-cli/media-command", - "version": "v2.2.0", + "name": "pluginever/framework-plugin", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/wp-cli/media-command.git", - "reference": "8eefc101713713871c1802e387b87348f6a048d5" + "url": "git@github.com:pluginever/framework-plugin.git", + "reference": "dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/media-command/zipball/8eefc101713713871c1802e387b87348f6a048d5", - "reference": "8eefc101713713871c1802e387b87348f6a048d5", + "url": "https://api.github.com/repos/pluginever/framework-plugin/zipball/dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0", + "reference": "dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "php": ">=5.6" }, "require-dev": { - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/extension-command": "^2.0", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "media", - "media import", - "media regenerate", - "media image-size" - ] + "byteever/byteever-sniffs": "dev-master" }, + "default-branch": true, + "type": "library", "autoload": { - "files": [ - "media-command.php" + "psr-4": { + "Lib\\": "src" + } + }, + "scripts": { + "phpcs": [ + "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" ], - "classmap": [ - "src/" + "phpcbf": [ + "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "GPL-3.0-or-later" ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Sultan Nasir Uddin", + "email": "manikdrmc@gmail.com" } ], - "description": "Imports files as attachments, regenerates thumbnails, or lists registered image sizes.", - "homepage": "https://github.com/wp-cli/media-command", + "description": "A set of related classes to kick start WordPress plugin development.", "support": { - "issues": "https://github.com/wp-cli/media-command/issues", - "source": "https://github.com/wp-cli/media-command/tree/v2.2.0" + "source": "https://github.com/pluginever/framework-plugin/tree/v1.0.8", + "issues": "https://github.com/pluginever/framework-plugin/issues" }, - "time": "2024-06-06T09:32:12+00:00" + "time": "2023-10-25T08:44:40+00:00" }, { - "name": "wp-cli/mustangostang-spyc", - "version": "0.6.3", + "name": "pluginever/framework-settings", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/wp-cli/spyc.git", - "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7" + "url": "git@github.com:pluginever/framework-settings.git", + "reference": "5a1718ada466a9e58a55827d77257ad237c9f0bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", - "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "url": "https://api.github.com/repos/pluginever/framework-settings/zipball/5a1718ada466a9e58a55827d77257ad237c9f0bd", + "reference": "5a1718ada466a9e58a55827d77257ad237c9f0bd", "shasum": "" }, "require": { - "php": ">=5.3.1" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "4.3.*@dev" + "byteever/byteever-sniffs": "dev-master" }, + "default-branch": true, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.5.x-dev" - } - }, "autoload": { - "files": [ - "includes/functions.php" - ], "psr-4": { - "Mustangostang\\": "src/" + "Lib\\": "src" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "phpcs": [ + "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" + ], + "phpcbf": [ + "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" + ] + }, "license": [ - "MIT" + "GPL-3.0-or-later" ], "authors": [ { - "name": "mustangostang", - "email": "vlad.andersen@gmail.com" + "name": "Sultan Nasir Uddin", + "email": "manikdrmc@gmail.com" } ], - "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", - "homepage": "https://github.com/mustangostang/spyc/", + "description": "A set of related classes to kick start WordPress plugin development.", "support": { - "source": "https://github.com/wp-cli/spyc/tree/autoload" + "source": "https://github.com/pluginever/framework-settings/tree/v1.0.7", + "issues": "https://github.com/pluginever/framework-settings/issues" }, - "time": "2017-04-25T11:26:20+00:00" + "time": "2024-02-27T06:05:22+00:00" }, { - "name": "wp-cli/package-command", - "version": "v2.5.2", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/wp-cli/package-command.git", - "reference": "3370dd88ddf906992bda3a28c8c387c8f4f33073" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/package-command/zipball/3370dd88ddf906992bda3a28c8c387c8f4f33073", - "reference": "3370dd88ddf906992bda3a28c8c387c8f4f33073", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "composer/composer": "^1.10.23 || ^2.2.17", - "ext-json": "*", - "wp-cli/wp-cli": "^2.8" - }, - "require-dev": { - "wp-cli/scaffold-command": "^1 || ^2", - "wp-cli/wp-cli-tests": "^4" + "php": ">=7.4.0" }, - "type": "wp-cli-package", + "type": "library", "extra": { "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "package", - "package browse", - "package install", - "package list", - "package update", - "package uninstall" - ] + "dev-master": "2.0.x-dev" + } }, "autoload": { - "files": [ - "package-command.php" - ], - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -9811,122 +893,161 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Lists, installs, and removes WP-CLI packages.", - "homepage": "https://github.com/wp-cli/package-command", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], "support": { - "issues": "https://github.com/wp-cli/package-command/issues", - "source": "https://github.com/wp-cli/package-command/tree/v2.5.2" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2024-05-22T05:26:05+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { - "name": "wp-cli/php-cli-tools", - "version": "v0.11.22", + "name": "squizlabs/php_codesniffer", + "version": "3.10.2", "source": { "type": "git", - "url": "https://github.com/wp-cli/php-cli-tools.git", - "reference": "a6bb94664ca36d0962f9c2ff25591c315a550c51" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/a6bb94664ca36d0962f9c2ff25591c315a550c51", - "reference": "a6bb94664ca36d0962f9c2ff25591c315a550c51", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", "shasum": "" }, "require": { - "php": ">= 5.3.0" + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" }, "require-dev": { - "roave/security-advisories": "dev-latest", - "wp-cli/wp-cli-tests": "^4" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "0.11.x-dev" - } - }, - "autoload": { - "files": [ - "lib/cli/cli.php" - ], - "psr-0": { - "cli": "lib/" + "dev-master": "3.x-dev" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@handbuilt.co", - "role": "Maintainer" + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" }, { - "name": "James Logsdon", - "email": "jlogsdon@php.net", - "role": "Developer" + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], - "description": "Console utilities for PHP", - "homepage": "http://github.com/wp-cli/php-cli-tools", + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ - "cli", - "console" + "phpcs", + "standards", + "static analysis" ], "support": { - "issues": "https://github.com/wp-cli/php-cli-tools/issues", - "source": "https://github.com/wp-cli/php-cli-tools/tree/v0.11.22" + "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-12-03T19:25:05+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": "2024-07-21T23:26:44+00:00" }, { - "name": "wp-cli/rewrite-command", - "version": "v2.0.13", + "name": "symfony/console", + "version": "v5.4.42", "source": { "type": "git", - "url": "https://github.com/wp-cli/rewrite-command.git", - "reference": "293f9de9905b9d0199d72ff0d17e837228e47a10" + "url": "https://github.com/symfony/console.git", + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/rewrite-command/zipball/293f9de9905b9d0199d72ff0d17e837228e47a10", - "reference": "293f9de9905b9d0199d72ff0d17e837228e47a10", + "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/wp-cli-tests": "^4" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "rewrite", - "rewrite flush", - "rewrite list", - "rewrite structure" - ] + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, + "type": "library", "autoload": { - "files": [ - "rewrite-command.php" - ], - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -9935,64 +1056,71 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Lists or flushes the site's rewrite rules, updates the permalink structure.", - "homepage": "https://github.com/wp-cli/rewrite-command", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], "support": { - "issues": "https://github.com/wp-cli/rewrite-command/issues", - "source": "https://github.com/wp-cli/rewrite-command/tree/v2.0.13" + "source": "https://github.com/symfony/console/tree/v5.4.42" }, - "time": "2023-08-30T15:25:42+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-07-26T12:21:55+00:00" }, { - "name": "wp-cli/role-command", - "version": "v2.0.14", + "name": "symfony/deprecation-contracts", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/wp-cli/role-command.git", - "reference": "7680178016a1811421897aeb9eeae9e81e6893ac" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/role-command/zipball/7680178016a1811421897aeb9eeae9e81e6893ac", - "reference": "7680178016a1811421897aeb9eeae9e81e6893ac", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/wp-cli-tests": "^4" + "php": ">=8.0.2" }, - "type": "wp-cli-package", + "type": "library", "extra": { "branch-alias": { - "dev-main": "2.x-dev" + "dev-main": "3.0-dev" }, - "bundled": true, - "commands": [ - "role", - "role create", - "role delete", - "role exists", - "role list", - "role reset", - "cap", - "cap add", - "cap list", - "cap remove" - ] + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } }, "autoload": { "files": [ - "role-command.php" - ], - "classmap": [ - "src/" + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10001,64 +1129,61 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Adds, removes, lists, and resets roles and capabilities.", - "homepage": "https://github.com/wp-cli/role-command", + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/wp-cli/role-command/issues", - "source": "https://github.com/wp-cli/role-command/tree/v2.0.14" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" }, - "time": "2023-08-30T16:18:53+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:55:41+00:00" }, { - "name": "wp-cli/scaffold-command", - "version": "v2.3.0", + "name": "symfony/finder", + "version": "v5.4.42", "source": { "type": "git", - "url": "https://github.com/wp-cli/scaffold-command.git", - "reference": "7a7d145c260ead64fa93a59498d60def970d5214" + "url": "https://github.com/symfony/finder.git", + "reference": "0724c51fa067b198e36506d2864e09a52180998a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/scaffold-command/zipball/7a7d145c260ead64fa93a59498d60def970d5214", - "reference": "7a7d145c260ead64fa93a59498d60def970d5214", + "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", + "reference": "0724c51fa067b198e36506d2864e09a52180998a", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "scaffold", - "scaffold underscores", - "scaffold block", - "scaffold child-theme", - "scaffold plugin", - "scaffold plugin-tests", - "scaffold post-type", - "scaffold taxonomy", - "scaffold theme-tests" - ] + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, + "type": "library", "autoload": { - "files": [ - "scaffold-command.php" - ], - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10067,59 +1192,72 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Generates code for post types, taxonomies, blocks, plugins, child themes, etc.", - "homepage": "https://github.com/wp-cli/scaffold-command", + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/wp-cli/scaffold-command/issues", - "source": "https://github.com/wp-cli/scaffold-command/tree/v2.3.0" + "source": "https://github.com/symfony/finder/tree/v5.4.42" }, - "time": "2024-04-26T21:05:48+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-07-22T08:53:29+00:00" }, { - "name": "wp-cli/search-replace-command", - "version": "v2.1.7", + "name": "symfony/polyfill-ctype", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/wp-cli/search-replace-command.git", - "reference": "89e1653c9b888179a121a8354c75fc5e8ca7931d" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/search-replace-command/zipball/89e1653c9b888179a121a8354c75fc5e8ca7931d", - "reference": "89e1653c9b888179a121a8354c75fc5e8ca7931d", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "php": ">=7.1" }, - "require-dev": { - "wp-cli/db-command": "^1.3 || ^2", - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^4" + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" }, - "type": "wp-cli-package", + "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "search-replace" - ] + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } }, "autoload": { "files": [ - "search-replace-command.php" + "bootstrap.php" ], - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -10127,57 +1265,75 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Searches/replaces strings in the database.", - "homepage": "https://github.com/wp-cli/search-replace-command", + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], "support": { - "issues": "https://github.com/wp-cli/search-replace-command/issues", - "source": "https://github.com/wp-cli/search-replace-command/tree/v2.1.7" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, - "time": "2024-06-28T09:30:38+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "wp-cli/server-command", - "version": "v2.0.13", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/wp-cli/server-command.git", - "reference": "42babfa0fdd517cd8bdd66528b3c9027d6d14a29" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/server-command/zipball/42babfa0fdd517cd8bdd66528b3c9027d6d14a29", - "reference": "42babfa0fdd517cd8bdd66528b3c9027d6d14a29", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "php": ">=7.1" }, - "require-dev": { - "wp-cli/entity-command": "^2", - "wp-cli/wp-cli-tests": "^4" + "suggest": { + "ext-intl": "For best performance" }, - "type": "wp-cli-package", + "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "server" - ] + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } }, "autoload": { "files": [ - "server-command.php" + "bootstrap.php" ], - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -10185,55 +1341,79 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Launches PHP's built-in web server for a specific WordPress installation.", - "homepage": "https://github.com/wp-cli/server-command", + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/wp-cli/server-command/issues", - "source": "https://github.com/wp-cli/server-command/tree/v2.0.13" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, - "time": "2023-08-30T15:27:57+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "wp-cli/shell-command", - "version": "v2.0.14", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/wp-cli/shell-command.git", - "reference": "f470d04a597e294ef29ad73dace9d4de98df7c42" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/shell-command/zipball/f470d04a597e294ef29ad73dace9d4de98df7c42", - "reference": "f470d04a597e294ef29ad73dace9d4de98df7c42", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "php": ">=7.1" }, - "require-dev": { - "wp-cli/wp-cli-tests": "^4" + "suggest": { + "ext-intl": "For best performance" }, - "type": "wp-cli-package", + "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "shell" - ] + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } }, "autoload": { "files": [ - "shell-command.php" + "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10242,60 +1422,80 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Opens an interactive PHP console for running and testing PHP code.", - "homepage": "https://github.com/wp-cli/shell-command", + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/wp-cli/shell-command/issues", - "source": "https://github.com/wp-cli/shell-command/tree/v2.0.14" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, - "time": "2023-08-30T15:58:08+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "wp-cli/super-admin-command", - "version": "v2.0.14", + "name": "symfony/polyfill-mbstring", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/wp-cli/super-admin-command.git", - "reference": "0fc8a6146d0450a8b522485e50886e976f5249b6" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/super-admin-command/zipball/0fc8a6146d0450a8b522485e50886e976f5249b6", - "reference": "0fc8a6146d0450a8b522485e50886e976f5249b6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "php": ">=7.1" }, - "require-dev": { - "wp-cli/entity-command": "^1.3 || ^2", - "wp-cli/wp-cli-tests": "^4" + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" }, - "type": "wp-cli-package", + "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "super-admin", - "super-admin add", - "super-admin list", - "super-admin remove" - ] + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } }, "autoload": { "files": [ - "super-admin-command.php" + "bootstrap.php" ], - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -10303,65 +1503,75 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Lists, adds, or removes super admin users on a multisite installation.", - "homepage": "https://github.com/wp-cli/super-admin-command", + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/wp-cli/super-admin-command/issues", - "source": "https://github.com/wp-cli/super-admin-command/tree/v2.0.14" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, - "time": "2024-02-26T12:17:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-19T12:30:46+00:00" }, { - "name": "wp-cli/widget-command", - "version": "v2.1.10", + "name": "symfony/polyfill-php73", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/wp-cli/widget-command.git", - "reference": "7062ed3fdfa17265320737f43efe5651d783f439" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/widget-command/zipball/7062ed3fdfa17265320737f43efe5651d783f439", - "reference": "7062ed3fdfa17265320737f43efe5651d783f439", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" - }, - "require-dev": { - "wp-cli/extension-command": "^1.2 || ^2", - "wp-cli/wp-cli-tests": "^4" + "php": ">=7.1" }, - "type": "wp-cli-package", + "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - }, - "bundled": true, - "commands": [ - "widget", - "widget add", - "widget deactivate", - "widget delete", - "widget list", - "widget move", - "widget reset", - "widget update", - "sidebar", - "sidebar list" - ] + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } }, "autoload": { "files": [ - "widget-command.php" + "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10370,186 +1580,243 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Adds, moves, and removes widgets; lists sidebars.", - "homepage": "https://github.com/wp-cli/widget-command", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/wp-cli/widget-command/issues", - "source": "https://github.com/wp-cli/widget-command/tree/v2.1.10" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" }, - "time": "2024-04-19T13:21:01+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "wp-cli/wp-cli", - "version": "v2.10.0", + "name": "symfony/polyfill-php80", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/wp-cli/wp-cli.git", - "reference": "a339dca576df73c31af4b4d8054efc2dab9a0685" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/a339dca576df73c31af4b4d8054efc2dab9a0685", - "reference": "a339dca576df73c31af4b4d8054efc2dab9a0685", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { - "ext-curl": "*", - "mustache/mustache": "^2.14.1", - "php": "^5.6 || ^7.0 || ^8.0", - "symfony/finder": ">2.7", - "wp-cli/mustangostang-spyc": "^0.6.3", - "wp-cli/php-cli-tools": "~0.11.2" - }, - "require-dev": { - "roave/security-advisories": "dev-latest", - "wp-cli/db-command": "^1.3 || ^2", - "wp-cli/entity-command": "^1.2 || ^2", - "wp-cli/extension-command": "^1.1 || ^2", - "wp-cli/package-command": "^1 || ^2", - "wp-cli/wp-cli-tests": "^4.0.1" - }, - "suggest": { - "ext-readline": "Include for a better --prompt implementation", - "ext-zip": "Needed to support extraction of ZIP archives when doing downloads or updates" + "php": ">=7.1" }, - "bin": [ - "bin/wp", - "bin/wp.bat" - ], "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.10.x-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-0": { - "WP_CLI\\": "php/" + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" }, "classmap": [ - "php/class-wp-cli.php", - "php/class-wp-cli-command.php" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "WP-CLI framework", - "homepage": "https://wp-cli.org", + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "cli", - "wordpress" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "docs": "https://make.wordpress.org/cli/handbook/", - "issues": "https://github.com/wp-cli/wp-cli/issues", - "source": "https://github.com/wp-cli/wp-cli" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, - "time": "2024-02-08T16:52:43+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "wp-cli/wp-cli-bundle", - "version": "v2.10.0", + "name": "symfony/service-contracts", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/wp-cli/wp-cli-bundle.git", - "reference": "b795ca19f12bf9605dc8d85235d55a721b43064c" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-cli-bundle/zipball/b795ca19f12bf9605dc8d85235d55a721b43064c", - "reference": "b795ca19f12bf9605dc8d85235d55a721b43064c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66", + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66", "shasum": "" }, "require": { - "php": ">=5.6", - "wp-cli/cache-command": "^2", - "wp-cli/checksum-command": "^2.1", - "wp-cli/config-command": "^2.1", - "wp-cli/core-command": "^2.1", - "wp-cli/cron-command": "^2", - "wp-cli/db-command": "^2", - "wp-cli/embed-command": "^2", - "wp-cli/entity-command": "^2", - "wp-cli/eval-command": "^2", - "wp-cli/export-command": "^2", - "wp-cli/extension-command": "^2.1", - "wp-cli/i18n-command": "^2", - "wp-cli/import-command": "^2", - "wp-cli/language-command": "^2", - "wp-cli/maintenance-mode-command": "^2", - "wp-cli/media-command": "^2", - "wp-cli/package-command": "^2.1", - "wp-cli/rewrite-command": "^2", - "wp-cli/role-command": "^2", - "wp-cli/scaffold-command": "^2", - "wp-cli/search-replace-command": "^2", - "wp-cli/server-command": "^2", - "wp-cli/shell-command": "^2", - "wp-cli/super-admin-command": "^2", - "wp-cli/widget-command": "^2", - "wp-cli/wp-cli": "^2.10.0" + "php": ">=8.0.2", + "psr/container": "^2.0" }, - "require-dev": { - "roave/security-advisories": "dev-latest", - "wp-cli/wp-cli-tests": "^4" + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { - "psy/psysh": "Enhanced `wp shell` functionality" + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.9.x-dev" + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "WP-CLI bundle package with default commands.", - "homepage": "https://wp-cli.org", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", "keywords": [ - "cli", - "wordpress" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "docs": "https://make.wordpress.org/cli/handbook/", - "issues": "https://github.com/wp-cli/wp-cli-bundle/issues", - "source": "https://github.com/wp-cli/wp-cli-bundle" + "source": "https://github.com/symfony/service-contracts/tree/v3.0.2" }, - "time": "2024-02-08T17:05:33+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-05-30T19:17:58+00:00" }, { - "name": "wp-cli/wp-config-transformer", - "version": "v1.3.6", + "name": "symfony/string", + "version": "v6.0.19", "source": { "type": "git", - "url": "https://github.com/wp-cli/wp-config-transformer.git", - "reference": "88f516f44dce1660fc4b780da513e3ca12d7d24f" + "url": "https://github.com/symfony/string.git", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-config-transformer/zipball/88f516f44dce1660fc4b780da513e3ca12d7d24f", - "reference": "88f516f44dce1660fc4b780da513e3ca12d7d24f", + "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0 || ^8.0" + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" }, "require-dev": { - "wp-cli/wp-cli-tests": "^4.0" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { "files": [ - "src/WPConfigTransformer.php" + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10558,17 +1825,42 @@ ], "authors": [ { - "name": "Frankie Jarrett", - "email": "fjarrett@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Programmatically edit a wp-config.php file.", - "homepage": "https://github.com/wp-cli/wp-config-transformer", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], "support": { - "issues": "https://github.com/wp-cli/wp-config-transformer/issues", - "source": "https://github.com/wp-cli/wp-config-transformer/tree/v1.3.6" + "source": "https://github.com/symfony/string/tree/v6.0.19" }, - "time": "2024-05-23T06:32:14+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-01T08:36:10+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -10635,62 +1927,6 @@ } ], "time": "2024-03-25T16:39:00+00:00" - }, - { - "name": "zordius/lightncandy", - "version": "v1.2.6", - "source": { - "type": "git", - "url": "https://github.com/zordius/lightncandy.git", - "reference": "b451f73e8b5c73e62e365997ba3c993a0376b72a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zordius/lightncandy/zipball/b451f73e8b5c73e62e365997ba3c993a0376b72a", - "reference": "b451f73e8b5c73e62e365997ba3c993a0376b72a", - "shasum": "" - }, - "require": { - "php": ">=7.1.0" - }, - "require-dev": { - "phpunit/phpunit": ">=7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.5-dev" - } - }, - "autoload": { - "psr-4": { - "LightnCandy\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Zordius Chen", - "email": "zordius@gmail.com" - } - ], - "description": "An extremely fast PHP implementation of handlebars ( http://handlebarsjs.com/ ) and mustache ( http://mustache.github.io/ ).", - "homepage": "https://github.com/zordius/lightncandy", - "keywords": [ - "handlebars", - "logicless", - "mustache", - "php", - "template" - ], - "support": { - "issues": "https://github.com/zordius/lightncandy/issues", - "source": "https://github.com/zordius/lightncandy/tree/v1.2.6" - }, - "time": "2021-07-11T04:52:41+00:00" } ], "aliases": [], @@ -10703,7 +1939,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.0" + "php": ">=7.4" }, "platform-dev": [], "plugin-api-version": "2.6.0" diff --git a/src/Plugin.php b/src/Plugin.php index b448c22f..bd870ff8 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -45,9 +45,22 @@ public function includes() { public function init_hooks() { register_activation_hook( $this->get_file(), array( Installer::class, 'install' ) ); add_action( 'admin_notices', array( $this, 'dependencies_notices' ) ); + add_action( 'before_woocommerce_init', array( $this, 'on_before_woocommerce_init' ) ); add_action( 'woocommerce_loaded', array( $this, 'init' ), 0 ); } + /** + * Run on before WooCommerce init. + * + * @since 1.0.0 + * @return void + */ + public function on_before_woocommerce_init() { + if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', $this->get_file(), true ); + } + } + /** * Missing dependencies notice. * diff --git a/wc-serial-numbers.php b/wc-serial-numbers.php index a94feb2b..d63a173e 100644 --- a/wc-serial-numbers.php +++ b/wc-serial-numbers.php @@ -34,52 +34,8 @@ // Don't call the file directly. defined( 'ABSPATH' ) || exit(); -// Autoload function. -spl_autoload_register( - function ( $class_name ) { - $prefix = 'WooCommerceSerialNumbers\\'; - $len = strlen( $prefix ); - - // Bail out if the class name doesn't start with our prefix. - if ( strncmp( $prefix, $class_name, $len ) !== 0 ) { - return; - } - - // Remove the prefix from the class name. - $relative_class = substr( $class_name, $len ); - // Replace the namespace separator with the directory separator. - $file = str_replace( '\\', DIRECTORY_SEPARATOR, $relative_class ) . '.php'; - - // Look for the file in the src and lib directories. - $file_paths = array( - __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . $file, - __DIR__ . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . $file, - ); - - foreach ( $file_paths as $file_path ) { - if ( file_exists( $file_path ) ) { - require_once $file_path; - break; - } - } - } -); - - -/** - * Plugin compatibility with WooCommerce HPOS - * - * @since 1.0.0 - * @return void - */ -add_action( - 'before_woocommerce_init', - function () { - if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { - \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); - } - } -); +// Require the autoloader. +require_once __DIR__ . '/vendor/autoload.php'; /** * Get the plugin instance. From c28c0f6906994763f12a4fed55f926ed3cb3ef7e Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Wed, 31 Jul 2024 15:41:35 +0600 Subject: [PATCH 2/5] Update composer --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 523c2cbc..dfcbe52a 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,6 @@ "WooCommerceSerialNumbers\\": ["src/","lib/"] } }, - "autoload-dev": {}, "config": { "optimize-autoloader": true, "sort-packages": true, From a354a18c0286b4c155b82c63456c31fa1e2ba579 Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Wed, 31 Jul 2024 15:49:01 +0600 Subject: [PATCH 3/5] Update header doc block --- .distignore | 4 ---- package.json | 2 +- phpcs.xml | 1 - readme.txt | 8 +++++++- wc-serial-numbers.php | 2 +- wpml-config.xml | 2 -- 6 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 wpml-config.xml diff --git a/.distignore b/.distignore index fd31f11f..d1f2d45c 100644 --- a/.distignore +++ b/.distignore @@ -29,7 +29,6 @@ bower.json bower_components .* - # Test related files phpunit.xml phpunit.xml.dist @@ -42,7 +41,6 @@ codeception.yml phpcs.xml phpcs.xml.dist - # IDE related files .idea *.iml @@ -61,7 +59,6 @@ phpcs.xml.dist *.zip /bin/ - # OS related files .DS_Store .DS_Store? @@ -71,7 +68,6 @@ phpcs.xml.dist ehthumbs.db Thumbs.db - # Action related files .wordpress-org diff --git a/package.json b/package.json index 5ed70cd7..3ceb2b56 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wc-serial-numbers", "title": "WC Serial Numbers", - "version": "1.7.6", + "version": "1.7.7", "description": "Sell and manage license keys/ serial numbers/ secret keys easily within your WooCommerce store.", "homepage": "https://pluginever.com/plugins/wc-serial-numbers/", "license": "GPL-3.0+", diff --git a/phpcs.xml b/phpcs.xml index 69cf092e..b9e66e2a 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -27,5 +27,4 @@ - diff --git a/readme.txt b/readme.txt index d2c58412..bc60b408 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: license manager, license, license number, serial number, activation number Requires at least: 5.0 Tested up to: 6.6 Requires PHP: 7.4 -Stable tag: 1.7.6 +Stable tag: 1.7.7 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -251,6 +251,12 @@ Yes, you are always welcome to [provide suggestions](https://github.com/pluginev 9. Thank You Page with Keys == Changelog == += 1.7.7 (31 Jul 2024) = +Enhance: Enhance optimized code for better autoload classes. +Enhance: Enhanced security. +Update: Update the WooCommence HPOS support +Fix: Few known issues. + = 1.7.6 (30 Jul 2024) = Enhance: Enhanced security to handle form actions. Enhance: Enhanced security to handle Ajax search. diff --git a/wc-serial-numbers.php b/wc-serial-numbers.php index d63a173e..e2e0a758 100644 --- a/wc-serial-numbers.php +++ b/wc-serial-numbers.php @@ -3,7 +3,7 @@ * Plugin Name: WC Serial Numbers * Plugin URI: https://www.pluginever.com/plugins/wocommerce-serial-numbers-pro/ * Description: Sell and manage license keys/ serial numbers/ secret keys easily within your WooCommerce store. - * Version: 1.7.6 + * Version: 1.7.7 * Requires at least: 5.0 * Requires PHP: 7.4 * Author: PluginEver diff --git a/wpml-config.xml b/wpml-config.xml deleted file mode 100644 index fedba13f..00000000 --- a/wpml-config.xml +++ /dev/null @@ -1,2 +0,0 @@ - - From b7a1b53c82f34250635e1953cc20d2cdc03b7a0e Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Wed, 31 Jul 2024 15:51:37 +0600 Subject: [PATCH 4/5] Update readme file --- readme.txt | 3 - trunk/assets/blocks/index.js | 0 trunk/assets/dist/blocks/blocks.asset.php | 1 + trunk/assets/dist/blocks/blocks.js | 0 trunk/assets/dist/css/admin-style.asset.php | 1 + trunk/assets/dist/css/admin-style.css | 1 + .../assets/dist/css/frontend-style.asset.php | 1 + trunk/assets/dist/css/frontend-style.css | 1 + trunk/assets/dist/images/add-generator.png | Bin 0 -> 82665 bytes trunk/assets/dist/images/csv-export.png | Bin 0 -> 70115 bytes trunk/assets/dist/images/csv-import.png | Bin 0 -> 57578 bytes trunk/assets/dist/images/txt-import.png | Bin 0 -> 79528 bytes trunk/assets/dist/js/admin-script.asset.php | 1 + trunk/assets/dist/js/admin-script.js | 1 + .../assets/dist/js/frontend-script.asset.php | 1 + trunk/assets/dist/js/frontend-script.js | 1 + trunk/assets/images/add-generator.png | Bin 0 -> 82665 bytes trunk/assets/images/csv-export.png | Bin 0 -> 70115 bytes trunk/assets/images/csv-import.png | Bin 0 -> 57578 bytes trunk/assets/images/txt-import.png | Bin 0 -> 79528 bytes trunk/examples/api-test.txt | 96 + trunk/languages/wc-serial-numbers.pot | 1543 ++++ trunk/readme.txt | 534 ++ trunk/src/API.php | 90 + trunk/src/Actions.php | 129 + trunk/src/Admin/Actions.php | 253 + trunk/src/Admin/Admin.php | 186 + .../src/Admin/ListTables/ActivationsTable.php | 289 + trunk/src/Admin/ListTables/KeysTable.php | 559 ++ trunk/src/Admin/ListTables/ListTable.php | 208 + trunk/src/Admin/ListTables/StockTable.php | 197 + trunk/src/Admin/Menus.php | 518 ++ trunk/src/Admin/Metaboxes.php | 283 + trunk/src/Admin/Notices.php | 166 + trunk/src/Admin/Orders.php | 280 + trunk/src/Admin/Products.php | 76 + trunk/src/Admin/Settings.php | 193 + trunk/src/Admin/views/html-add-key.php | 199 + trunk/src/Admin/views/html-api-actions.php | 201 + trunk/src/Admin/views/html-api-validation.php | 170 + trunk/src/Admin/views/html-edit-key.php | 198 + .../src/Admin/views/html-list-activations.php | 32 + trunk/src/Admin/views/html-list-keys.php | 51 + trunk/src/Admin/views/html-list-stock.php | 21 + trunk/src/Admin/views/html-reports.php | 25 + trunk/src/Admin/views/html-tools.php | 25 + trunk/src/Ajax.php | 233 + trunk/src/Cache.php | 37 + trunk/src/Compat.php | 82 + trunk/src/Cron.php | 73 + trunk/src/Deprecated/Functions.php | 440 + trunk/src/Encryption.php | 220 + trunk/src/Frontend/Frontend.php | 62 + trunk/src/Frontend/Shortcodes.php | 315 + trunk/src/Functions/Template.php | 312 + trunk/src/Installer.php | 386 + trunk/src/Models/Activation.php | 298 + trunk/src/Models/Key.php | 855 ++ trunk/src/Models/Model.php | 21 + trunk/src/Orders.php | 178 + trunk/src/Plugin.php | 177 + trunk/src/RestAPI.php | 411 + trunk/src/Stocks.php | 43 + trunk/src/Utilities/Utilities.php | 31 + trunk/src/functions.php | 1062 +++ trunk/templates/email-stock-notification.php | 42 + trunk/uninstall.php | 11 + trunk/vendor/autoload.php | 25 + trunk/vendor/bin/mozart | 119 + trunk/vendor/bin/phpcbf | 119 + trunk/vendor/bin/phpcs | 119 + .../byteever/byteever-sniffs/renovate.json | 5 + .../src/ByteEver-Default/ruleset.xml | 108 + trunk/vendor/coenjacobs/mozart/Dockerfile | 17 + trunk/vendor/coenjacobs/mozart/LICENSE | 21 + trunk/vendor/coenjacobs/mozart/bin/mozart | 29 + trunk/vendor/coenjacobs/mozart/psalm.xml | 15 + .../src/Composer/Autoload/Autoloader.php | 9 + .../mozart/src/Composer/Autoload/Classmap.php | 36 + .../Composer/Autoload/NamespaceAutoloader.php | 49 + .../mozart/src/Composer/Autoload/Psr0.php | 7 + .../mozart/src/Composer/Autoload/Psr4.php | 22 + .../mozart/src/Composer/Package.php | 69 + .../mozart/src/Console/Application.php | 20 + .../mozart/src/Console/Commands/Compose.php | 243 + trunk/vendor/coenjacobs/mozart/src/Mover.php | 243 + .../mozart/src/Replace/BaseReplacer.php | 20 + .../mozart/src/Replace/ClassmapReplacer.php | 64 + .../mozart/src/Replace/NamespaceReplacer.php | 43 + .../mozart/src/Replace/Replacer.php | 11 + .../vendor/coenjacobs/mozart/src/Replacer.php | 223 + trunk/vendor/composer/ClassLoader.php | 579 ++ trunk/vendor/composer/InstalledVersions.php | 359 + trunk/vendor/composer/LICENSE | 21 + trunk/vendor/composer/autoload_classmap.php | 323 + trunk/vendor/composer/autoload_files.php | 17 + trunk/vendor/composer/autoload_namespaces.php | 9 + trunk/vendor/composer/autoload_psr4.php | 25 + trunk/vendor/composer/autoload_real.php | 50 + trunk/vendor/composer/autoload_static.php | 451 + trunk/vendor/composer/installed.json | 2036 +++++ trunk/vendor/composer/installed.php | 278 + trunk/vendor/composer/platform_check.php | 26 + .../CODE_OF_CONDUCT.md | 129 + .../LICENSE.md | 21 + .../src/Plugin.php | 621 ++ .../league/flysystem/CODE_OF_CONDUCT.md | 76 + trunk/vendor/league/flysystem/LICENSE | 19 + trunk/vendor/league/flysystem/SECURITY.md | 16 + trunk/vendor/league/flysystem/deprecations.md | 19 + .../flysystem/src/Adapter/AbstractAdapter.php | 72 + .../src/Adapter/AbstractFtpAdapter.php | 705 ++ .../src/Adapter/CanOverwriteFiles.php | 12 + .../league/flysystem/src/Adapter/Ftp.php | 584 ++ .../league/flysystem/src/Adapter/Ftpd.php | 48 + .../league/flysystem/src/Adapter/Local.php | 533 ++ .../flysystem/src/Adapter/NullAdapter.php | 144 + .../Polyfill/NotSupportingVisibilityTrait.php | 33 + .../Adapter/Polyfill/StreamedCopyTrait.php | 51 + .../Adapter/Polyfill/StreamedReadingTrait.php | 44 + .../src/Adapter/Polyfill/StreamedTrait.php | 9 + .../Adapter/Polyfill/StreamedWritingTrait.php | 60 + .../flysystem/src/Adapter/SynologyFtp.php | 8 + .../league/flysystem/src/AdapterInterface.php | 118 + trunk/vendor/league/flysystem/src/Config.php | 107 + .../league/flysystem/src/ConfigAwareTrait.php | 49 + .../src/ConnectionErrorException.php | 9 + .../src/ConnectionRuntimeException.php | 9 + .../flysystem/src/CorruptedPathDetected.php | 17 + .../vendor/league/flysystem/src/Directory.php | 31 + .../vendor/league/flysystem/src/Exception.php | 8 + trunk/vendor/league/flysystem/src/File.php | 205 + .../flysystem/src/FileExistsException.php | 37 + .../flysystem/src/FileNotFoundException.php | 37 + .../league/flysystem/src/Filesystem.php | 409 + .../flysystem/src/FilesystemException.php | 7 + .../flysystem/src/FilesystemInterface.php | 284 + .../src/FilesystemNotFoundException.php | 12 + trunk/vendor/league/flysystem/src/Handler.php | 137 + .../flysystem/src/InvalidRootException.php | 9 + .../league/flysystem/src/MountManager.php | 648 ++ .../flysystem/src/NotSupportedException.php | 37 + .../flysystem/src/Plugin/AbstractPlugin.php | 24 + .../league/flysystem/src/Plugin/EmptyDir.php | 34 + .../flysystem/src/Plugin/ForcedCopy.php | 44 + .../flysystem/src/Plugin/ForcedRename.php | 44 + .../flysystem/src/Plugin/GetWithMetadata.php | 51 + .../league/flysystem/src/Plugin/ListFiles.php | 35 + .../league/flysystem/src/Plugin/ListPaths.php | 36 + .../league/flysystem/src/Plugin/ListWith.php | 60 + .../flysystem/src/Plugin/PluggableTrait.php | 97 + .../src/Plugin/PluginNotFoundException.php | 10 + .../league/flysystem/src/PluginInterface.php | 20 + .../league/flysystem/src/ReadInterface.php | 88 + .../flysystem/src/RootViolationException.php | 10 + .../league/flysystem/src/SafeStorage.php | 39 + .../flysystem/src/UnreadableFileException.php | 18 + trunk/vendor/league/flysystem/src/Util.php | 354 + .../src/Util/ContentListingFormatter.php | 122 + .../league/flysystem/src/Util/MimeType.php | 80 + .../flysystem/src/Util/StreamHasher.php | 36 + .../league/mime-type-detection/CHANGELOG.md | 59 + .../vendor/league/mime-type-detection/LICENSE | 19 + .../src/EmptyExtensionToMimeTypeMap.php | 13 + .../src/ExtensionLookup.php | 14 + .../src/ExtensionMimeTypeDetector.php | 56 + .../src/ExtensionToMimeTypeMap.php | 10 + .../src/FinfoMimeTypeDetector.php | 106 + .../src/GeneratedExtensionToMimeTypeMap.php | 2298 ++++++ .../src/MimeTypeDetector.php | 19 + .../src/OverridingExtensionToMimeTypeMap.php | 30 + .../php-compatibility/CHANGELOG.md | 1488 ++++ .../php-compatibility/LICENSE | 165 + .../php-compatibility/PHPCSAliases.php | 73 + .../AbstractComplexVersionSniff.php | 147 + .../AbstractFunctionCallParameterSniff.php | 193 + .../AbstractNewFeatureSniff.php | 115 + .../AbstractRemovedFeatureSniff.php | 156 + .../ComplexVersionInterface.php | 84 + .../PHPCompatibility/PHPCSHelper.php | 678 ++ .../PHPCompatibility/Sniff.php | 2267 +++++ .../ForbiddenAbstractPrivateMethodsSniff.php | 90 + .../Classes/NewAnonymousClassesSniff.php | 91 + .../Sniffs/Classes/NewClassesSniff.php | 913 ++ .../Classes/NewConstVisibilitySniff.php | 80 + .../Classes/NewLateStaticBindingSniff.php | 88 + .../Classes/NewTypedPropertiesSniff.php | 132 + .../Classes/RemovedOrphanedParentSniff.php | 115 + .../Sniffs/Constants/NewConstantsSniff.php | 3756 +++++++++ .../Constants/NewMagicClassConstantSniff.php | 80 + .../Constants/RemovedConstantsSniff.php | 574 ++ .../DiscouragedSwitchContinueSniff.php | 238 + ...ForbiddenBreakContinueOutsideLoopSniff.php | 116 + ...denBreakContinueVariableArgumentsSniff.php | 110 + ...enSwitchWithMultipleDefaultBlocksSniff.php | 81 + .../NewExecutionDirectivesSniff.php | 378 + .../NewForeachExpressionReferencingSniff.php | 99 + .../NewListInForeachSniff.php | 84 + .../ControlStructures/NewMultiCatchSniff.php | 78 + .../Extensions/RemovedExtensionsSniff.php | 346 + ...biddenParameterShadowSuperGlobalsSniff.php | 79 + .../ForbiddenParametersWithSameNameSniff.php | 88 + .../ForbiddenToStringParametersSniff.php | 99 + ...orbiddenVariableNamesInClosureUseSniff.php | 122 + .../FunctionDeclarations/NewClosureSniff.php | 264 + .../NewExceptionsFromToStringSniff.php | 171 + .../NewNullableTypesSniff.php | 169 + .../NewParamTypeDeclarationsSniff.php | 237 + .../NewReturnTypeDeclarationsSniff.php | 194 + .../NonStaticMagicMethodsSniff.php | 216 + .../NewMagicMethodsSniff.php | 231 + .../RemovedMagicAutoloadSniff.php | 92 + .../RemovedNamespacedAssertSniff.php | 101 + .../RemovedPHP4StyleConstructorsSniff.php | 158 + .../ReservedFunctionNamesSniff.php | 205 + ...gumentFunctionsReportCurrentValueSniff.php | 455 + .../ArgumentFunctionsUsageSniff.php | 169 + .../NewFunctionParametersSniff.php | 1109 +++ .../Sniffs/FunctionUse/NewFunctionsSniff.php | 2008 +++++ ...ionalToRequiredFunctionParametersSniff.php | 173 + .../RemovedFunctionParametersSniff.php | 292 + .../FunctionUse/RemovedFunctionsSniff.php | 1104 +++ ...uiredToOptionalFunctionParametersSniff.php | 350 + .../Generators/NewGeneratorReturnSniff.php | 158 + .../IniDirectives/NewIniDirectivesSniff.php | 855 ++ .../RemovedIniDirectivesSniff.php | 424 + .../NewConstantArraysUsingConstSniff.php | 82 + .../NewConstantArraysUsingDefineSniff.php | 101 + .../NewConstantScalarExpressionsSniff.php | 556 ++ .../Sniffs/InitialValue/NewHeredocSniff.php | 100 + .../Interfaces/InternalInterfacesSniff.php | 103 + .../Sniffs/Interfaces/NewInterfacesSniff.php | 362 + .../Keywords/CaseSensitiveKeywordsSniff.php | 76 + .../ForbiddenNamesAsDeclaredSniff.php | 259 + .../ForbiddenNamesAsInvokedFunctionsSniff.php | 188 + .../Sniffs/Keywords/ForbiddenNamesSniff.php | 442 + .../Sniffs/Keywords/NewKeywordsSniff.php | 391 + .../NewEmptyNonVariableSniff.php | 91 + .../NewLanguageConstructsSniff.php | 159 + .../Sniffs/Lists/AssignmentOrderSniff.php | 188 + .../ForbiddenEmptyListAssignmentSniff.php | 116 + .../Sniffs/Lists/NewKeyedListSniff.php | 227 + .../Lists/NewListReferenceAssignmentSniff.php | 74 + .../Sniffs/Lists/NewShortListSniff.php | 84 + .../ForbiddenToStringParametersSniff.php | 103 + .../MethodUse/NewDirectCallsToCloneSniff.php | 117 + .../Miscellaneous/NewPHPOpenTagEOFSniff.php | 147 + .../RemovedAlternativePHPTagsSniff.php | 172 + .../Miscellaneous/ValidIntegersSniff.php | 250 + .../ChangedConcatOperatorPrecedenceSniff.php | 199 + .../ForbiddenNegativeBitshiftSniff.php | 109 + .../Sniffs/Operators/NewOperatorsSniff.php | 317 + .../Sniffs/Operators/NewShortTernarySniff.php | 73 + .../RemovedTernaryAssociativitySniff.php | 157 + .../ForbiddenGetClassNullSniff.php | 84 + ...orbiddenStripTagsSelfClosingXHTMLSniff.php | 113 + .../NewArrayReduceInitialTypeSniff.php | 116 + .../ParameterValues/NewFopenModesSniff.php | 119 + .../NewHTMLEntitiesEncodingDefaultSniff.php | 92 + .../NewHashAlgorithmsSniff.php | 185 + .../NewIDNVariantDefaultSniff.php | 91 + .../NewIconvMbstringCharsetDefaultSniff.php | 231 + .../NewNegativeStringOffsetSniff.php | 129 + .../ParameterValues/NewPCREModifiersSniff.php | 127 + .../ParameterValues/NewPackFormatSniff.php | 132 + .../NewPasswordAlgoConstantValuesSniff.php | 125 + .../NewProcOpenCmdArraySniff.php | 136 + .../NewStripTagsAllowableTagsArraySniff.php | 152 + .../RemovedHashAlgorithmsSniff.php | 117 + .../RemovedIconvEncodingSniff.php | 86 + .../RemovedImplodeFlexibleParamOrderSniff.php | 323 + ...emovedMbStrrposEncodingThirdParamSniff.php | 149 + .../RemovedMbstringModifiersSniff.php | 135 + .../RemovedNonCryptoHashSniff.php | 121 + .../RemovedPCREModifiersSniff.php | 241 + .../RemovedSetlocaleStringSniff.php | 104 + .../ForbiddenCallTimePassByReferenceSniff.php | 259 + .../NewArrayStringDereferencingSniff.php | 199 + .../Sniffs/Syntax/NewArrayUnpackingSniff.php | 142 + .../Syntax/NewClassMemberAccessSniff.php | 192 + .../Syntax/NewDynamicAccessToStaticSniff.php | 89 + .../Syntax/NewFlexibleHeredocNowdocSniff.php | 255 + .../NewFunctionArrayDereferencingSniff.php | 187 + .../NewFunctionCallTrailingCommaSniff.php | 120 + .../Sniffs/Syntax/NewShortArraySniff.php | 77 + .../RemovedCurlyBraceArrayAccessSniff.php | 362 + .../Syntax/RemovedNewReferenceSniff.php | 80 + .../NewUnicodeEscapeSequenceSniff.php | 162 + .../Sniffs/TypeCasts/NewTypeCastsSniff.php | 222 + .../TypeCasts/RemovedTypeCastsSniff.php | 158 + .../Sniffs/Upgrade/LowPHPCSSniff.php | 187 + .../Sniffs/Upgrade/LowPHPSniff.php | 182 + .../NewGroupUseDeclarationsSniff.php | 118 + .../NewUseConstFunctionSniff.php | 109 + .../ForbiddenGlobalVariableVariableSniff.php | 125 + .../ForbiddenThisUseContextsSniff.php | 425 + .../NewUniformVariableSyntaxSniff.php | 114 + .../RemovedPredefinedGlobalVariablesSniff.php | 318 + .../PHPCompatibility/ruleset.xml | 7 + .../php-compatibility/phpunit-bootstrap.php | 86 + .../phpcompatibility-paragonie/LICENSE | 165 + .../ruleset.xml | 40 + .../ruleset.xml | 245 + .../phpcompatibility-wp/LICENSE | 165 + .../PHPCompatibilityWP/ruleset.xml | 85 + .../phpcsstandards/phpcsextra/CHANGELOG.md | 590 ++ .../vendor/phpcsstandards/phpcsextra/LICENSE | 165 + .../Docs/FunctionCalls/DirnameStandard.xml | 40 + .../Sniffs/FunctionCalls/DirnameSniff.php | 382 + .../phpcsextra/Modernize/ruleset.xml | 5 + .../Docs/Arrays/ArrayBraceSpacingStandard.xml | 94 + .../Docs/Arrays/CommaAfterLastStandard.xml | 43 + .../Sniffs/Arrays/ArrayBraceSpacingSniff.php | 305 + .../Sniffs/Arrays/CommaAfterLastSniff.php | 226 + .../phpcsextra/NormalizedArrays/ruleset.xml | 5 + .../DisallowShortArraySyntaxStandard.xml | 27 + .../Docs/Arrays/DuplicateArrayKeyStandard.xml | 44 + .../Arrays/MixedArrayKeyTypesStandard.xml | 40 + .../Arrays/MixedKeyedUnkeyedArrayStandard.xml | 31 + .../DisallowAnonClassParenthesesStandard.xml | 24 + .../Classes/DisallowFinalClassStandard.xml | 25 + .../Classes/ModifierKeywordOrderStandard.xml | 27 + .../RequireAnonClassParenthesesStandard.xml | 23 + .../Classes/RequireFinalClassStandard.xml | 25 + .../ConstructorDestructorReturnStandard.xml | 64 + .../ForeachUniqueAssignmentStandard.xml | 26 + .../CodeAnalysis/NoDoubleNegativeStandard.xml | 27 + .../CodeAnalysis/NoEchoSprintfStandard.xml | 25 + .../StaticInFinalClassStandard.xml | 43 + ...owercaseClassResolutionKeywordStandard.xml | 23 + .../ModifierKeywordOrderStandard.xml | 30 + .../UppercaseMagicConstantsStandard.xml | 25 + .../DisallowAlternativeSyntaxStandard.xml | 35 + .../DisallowLonelyIfStandard.xml | 49 + .../IfElseDeclarationStandard.xml | 37 + .../Files/SeparateFunctionsFromOOStandard.xml | 45 + .../NoLongClosuresStandard.xml | 42 + .../RequireFinalMethodsInTraitsStandard.xml | 33 + .../Lists/DisallowLongListSyntaxStandard.xml | 23 + .../Lists/DisallowShortListSyntaxStandard.xml | 23 + .../DisallowCurlyBraceSyntaxStandard.xml | 27 + ...DisallowDeclarationWithoutNameStandard.xml | 25 + .../EnforceCurlyBraceSyntaxStandard.xml | 27 + .../OneDeclarationPerFileStandard.xml | 27 + ...oReservedKeywordParameterNamesStandard.xml | 23 + .../AlphabeticExtendsImplementsStandard.xml | 27 + .../Docs/Operators/ConcatPositionStandard.xml | 31 + .../DisallowLogicalAndOrStandard.xml | 30 + .../DisallowShortTernaryStandard.xml | 26 + ...andalonePostIncrementDecrementStandard.xml | 44 + .../Operators/StrictComparisonsStandard.xml | 29 + .../TypeSeparatorSpacingStandard.xml | 33 + .../Docs/PHP/LowercasePHPTagStandard.xml | 25 + .../OneStatementInShortEchoTagStandard.xml | 41 + .../DisallowMixedGroupUseStandard.xml | 39 + .../DisallowUseClassStandard.xml | 25 + .../DisallowUseConstStandard.xml | 25 + .../DisallowUseFunctionStandard.xml | 25 + .../UseStatements/KeywordSpacingStandard.xml | 29 + .../LowercaseFunctionConstStandard.xml | 25 + .../NoLeadingBackslashStandard.xml | 23 + .../NoUselessAliasesStandard.xml | 30 + .../AnonClassKeywordSpacingStandard.xml | 31 + .../Docs/WhiteSpace/CommaSpacingStandard.xml | 94 + .../WhiteSpace/DisallowInlineTabsStandard.xml | 25 + .../WhiteSpace/PrecisionAlignmentStandard.xml | 29 + .../Universal/Helpers/DummyTokenizer.php | 60 + .../Arrays/DisallowShortArraySyntaxSniff.php | 89 + .../Sniffs/Arrays/DuplicateArrayKeySniff.php | 297 + .../Sniffs/Arrays/MixedArrayKeyTypesSniff.php | 174 + .../Arrays/MixedKeyedUnkeyedArraySniff.php | 134 + .../DisallowAnonClassParenthesesSniff.php | 112 + .../Classes/DisallowFinalClassSniff.php | 116 + .../Classes/ModifierKeywordOrderSniff.php | 188 + .../RequireAnonClassParenthesesSniff.php | 81 + .../Sniffs/Classes/RequireFinalClassSniff.php | 102 + .../ConstructorDestructorReturnSniff.php | 211 + .../ForeachUniqueAssignmentSniff.php | 153 + .../CodeAnalysis/NoDoubleNegativeSniff.php | 269 + .../CodeAnalysis/NoEchoSprintfSniff.php | 131 + .../CodeAnalysis/StaticInFinalClassSniff.php | 216 + .../LowercaseClassResolutionKeywordSniff.php | 106 + .../Constants/ModifierKeywordOrderSniff.php | 199 + .../UppercaseMagicConstantsSniff.php | 89 + .../DisallowAlternativeSyntaxSniff.php | 216 + .../DisallowLonelyIfSniff.php | 348 + .../IfElseDeclarationSniff.php | 164 + .../Files/SeparateFunctionsFromOOSniff.php | 190 + .../NoLongClosuresSniff.php | 233 + .../RequireFinalMethodsInTraitsSniff.php | 120 + .../Lists/DisallowLongListSyntaxSniff.php | 71 + .../Lists/DisallowShortListSyntaxSniff.php | 86 + .../DisallowCurlyBraceSyntaxSniff.php | 81 + .../DisallowDeclarationWithoutNameSniff.php | 80 + .../EnforceCurlyBraceSyntaxSniff.php | 81 + .../Namespaces/OneDeclarationPerFileSniff.php | 96 + .../NoReservedKeywordParameterNamesSniff.php | 190 + .../AlphabeticExtendsImplementsSniff.php | 275 + .../Sniffs/Operators/ConcatPositionSniff.php | 204 + .../Operators/DisallowLogicalAndOrSniff.php | 112 + .../Operators/DisallowShortTernarySniff.php | 76 + ...wStandalonePostIncrementDecrementSniff.php | 197 + .../Operators/StrictComparisonsSniff.php | 116 + .../Operators/TypeSeparatorSpacingSniff.php | 85 + .../Sniffs/PHP/LowercasePHPTagSniff.php | 87 + .../PHP/OneStatementInShortEchoTagSniff.php | 101 + .../DisallowMixedGroupUseSniff.php | 248 + .../UseStatements/DisallowUseClassSniff.php | 211 + .../UseStatements/DisallowUseConstSniff.php | 211 + .../DisallowUseFunctionSniff.php | 211 + .../UseStatements/KeywordSpacingSniff.php | 207 + .../LowercaseFunctionConstSniff.php | 156 + .../UseStatements/NoLeadingBackslashSniff.php | 170 + .../UseStatements/NoUselessAliasesSniff.php | 155 + .../AnonClassKeywordSpacingSniff.php | 79 + .../Sniffs/WhiteSpace/CommaSpacingSniff.php | 408 + .../WhiteSpace/DisallowInlineTabsSniff.php | 173 + .../WhiteSpace/PrecisionAlignmentSniff.php | 445 + .../phpcsextra/Universal/ruleset.xml | 5 + .../phpcsstandards/phpcsutils/CHANGELOG.md | 1106 +++ .../vendor/phpcsstandards/phpcsutils/LICENSE | 165 + .../AbstractArrayDeclarationSniff.php | 551 ++ .../PHPCSUtils/BackCompat/BCFile.php | 781 ++ .../PHPCSUtils/BackCompat/BCTokens.php | 123 + .../PHPCSUtils/BackCompat/Helper.php | 202 + .../Exceptions/InvalidTokenArray.php | 44 + .../Exceptions/TestFileNotFound.php | 47 + .../Exceptions/TestMarkerNotFound.php | 43 + .../Exceptions/TestTargetNotFound.php | 50 + .../PHPCSUtils/Fixers/SpacesFixer.php | 246 + .../phpcsutils/PHPCSUtils/Internal/Cache.php | 218 + .../Internal/IsShortArrayOrList.php | 687 ++ .../Internal/IsShortArrayOrListWithCache.php | 269 + .../PHPCSUtils/Internal/NoFileCache.php | 164 + .../PHPCSUtils/Internal/StableCollections.php | 75 + .../TestUtils/UtilityMethodTestCase.php | 459 + .../PHPCSUtils/Tokens/Collections.php | 837 ++ .../PHPCSUtils/Tokens/TokenHelper.php | 55 + .../phpcsutils/PHPCSUtils/Utils/Arrays.php | 227 + .../PHPCSUtils/Utils/Conditions.php | 156 + .../phpcsutils/PHPCSUtils/Utils/Context.php | 232 + .../PHPCSUtils/Utils/ControlStructures.php | 276 + .../PHPCSUtils/Utils/FunctionDeclarations.php | 828 ++ .../PHPCSUtils/Utils/GetTokensAsString.php | 262 + .../phpcsutils/PHPCSUtils/Utils/Lists.php | 359 + .../PHPCSUtils/Utils/MessageHelper.php | 145 + .../PHPCSUtils/Utils/Namespaces.php | 389 + .../PHPCSUtils/Utils/NamingConventions.php | 116 + .../phpcsutils/PHPCSUtils/Utils/Numbers.php | 322 + .../PHPCSUtils/Utils/ObjectDeclarations.php | 359 + .../phpcsutils/PHPCSUtils/Utils/Operators.php | 252 + .../PHPCSUtils/Utils/Orthography.php | 120 + .../PHPCSUtils/Utils/Parentheses.php | 419 + .../PHPCSUtils/Utils/PassedParameters.php | 510 ++ .../phpcsutils/PHPCSUtils/Utils/Scopes.php | 143 + .../PHPCSUtils/Utils/TextStrings.php | 331 + .../PHPCSUtils/Utils/UseStatements.php | 432 + .../phpcsutils/PHPCSUtils/Utils/Variables.php | 333 + .../phpcsutils/PHPCSUtils/ruleset.xml | 4 + .../phpcsutils/phpcsutils-autoload.php | 68 + trunk/vendor/psr/container/LICENSE | 21 + .../src/ContainerExceptionInterface.php | 12 + .../psr/container/src/ContainerInterface.php | 36 + .../src/NotFoundExceptionInterface.php | 10 + .../squizlabs/php_codesniffer/CHANGELOG.md | 7346 +++++++++++++++++ .../php_codesniffer/CodeSniffer.conf | 5 + .../php_codesniffer/CodeSniffer.conf.dist | 9 + .../squizlabs/php_codesniffer/autoload.php | 345 + .../squizlabs/php_codesniffer/bin/phpcbf | 15 + .../squizlabs/php_codesniffer/bin/phpcbf.bat | 10 + .../squizlabs/php_codesniffer/bin/phpcs | 15 + .../squizlabs/php_codesniffer/bin/phpcs.bat | 10 + .../squizlabs/php_codesniffer/licence.txt | 24 + .../squizlabs/php_codesniffer/phpcs.xsd | 136 + .../squizlabs/php_codesniffer/src/Config.php | 1661 ++++ .../src/Exceptions/DeepExitException.php | 20 + .../src/Exceptions/RuntimeException.php | 17 + .../src/Exceptions/TokenizerException.php | 17 + .../php_codesniffer/src/Files/DummyFile.php | 82 + .../php_codesniffer/src/Files/File.php | 2950 +++++++ .../php_codesniffer/src/Files/FileList.php | 261 + .../php_codesniffer/src/Files/LocalFile.php | 219 + .../src/Filters/ExactMatch.php | 156 + .../php_codesniffer/src/Filters/Filter.php | 288 + .../src/Filters/GitModified.php | 124 + .../php_codesniffer/src/Filters/GitStaged.php | 126 + .../squizlabs/php_codesniffer/src/Fixer.php | 846 ++ .../src/Generators/Generator.php | 119 + .../php_codesniffer/src/Generators/HTML.php | 272 + .../src/Generators/Markdown.php | 163 + .../php_codesniffer/src/Generators/Text.php | 255 + .../php_codesniffer/src/Reporter.php | 445 + .../php_codesniffer/src/Reports/Cbf.php | 254 + .../src/Reports/Checkstyle.php | 111 + .../php_codesniffer/src/Reports/Code.php | 365 + .../php_codesniffer/src/Reports/Csv.php | 92 + .../php_codesniffer/src/Reports/Diff.php | 131 + .../php_codesniffer/src/Reports/Emacs.php | 91 + .../php_codesniffer/src/Reports/Full.php | 260 + .../php_codesniffer/src/Reports/Gitblame.php | 91 + .../php_codesniffer/src/Reports/Hgblame.php | 110 + .../php_codesniffer/src/Reports/Info.php | 173 + .../php_codesniffer/src/Reports/Json.php | 107 + .../php_codesniffer/src/Reports/Junit.php | 133 + .../src/Reports/Notifysend.php | 243 + .../src/Reports/Performance.php | 161 + .../php_codesniffer/src/Reports/Report.php | 87 + .../php_codesniffer/src/Reports/Source.php | 337 + .../php_codesniffer/src/Reports/Summary.php | 184 + .../php_codesniffer/src/Reports/Svnblame.php | 73 + .../src/Reports/VersionControl.php | 377 + .../php_codesniffer/src/Reports/Xml.php | 128 + .../squizlabs/php_codesniffer/src/Ruleset.php | 1623 ++++ .../squizlabs/php_codesniffer/src/Runner.php | 984 +++ .../src/Sniffs/AbstractArraySniff.php | 172 + .../src/Sniffs/AbstractPatternSniff.php | 936 +++ .../src/Sniffs/AbstractScopeSniff.php | 189 + .../src/Sniffs/AbstractVariableSniff.php | 230 + .../src/Sniffs/DeprecatedSniff.php | 63 + .../php_codesniffer/src/Sniffs/Sniff.php | 80 + .../DisallowLongArraySyntaxStandard.xml | 23 + .../DisallowShortArraySyntaxStandard.xml | 23 + .../Classes/DuplicateClassNameStandard.xml | 27 + .../Classes/OpeningBraceSameLineStandard.xml | 36 + .../AssignmentInConditionStandard.xml | 23 + .../EmptyPHPStatementStandard.xml | 44 + .../CodeAnalysis/EmptyStatementStandard.xml | 23 + .../ForLoopShouldBeWhileLoopStandard.xml | 23 + .../ForLoopWithTestFunctionCallStandard.xml | 24 + .../JumbledIncrementerStandard.xml | 25 + ...licitBooleanOperatorPrecedenceStandard.xml | 44 + .../UnconditionalIfStatementStandard.xml | 39 + .../UnnecessaryFinalModifierStandard.xml | 29 + .../UnusedFunctionParameterStandard.xml | 25 + .../UselessOverridingMethodStandard.xml | 32 + .../Docs/Commenting/DocCommentStandard.xml | 269 + .../Generic/Docs/Commenting/FixmeStandard.xml | 25 + .../Generic/Docs/Commenting/TodoStandard.xml | 25 + .../DisallowYodaConditionsStandard.xml | 23 + .../InlineControlStructureStandard.xml | 22 + .../Generic/Docs/Debug/CSSLintStandard.xml | 19 + .../Docs/Debug/ClosureLinterStandard.xml | 19 + .../Generic/Docs/Debug/JSHintStandard.xml | 19 + .../Docs/Files/ByteOrderMarkStandard.xml | 7 + .../Docs/Files/EndFileNewlineStandard.xml | 7 + .../Docs/Files/EndFileNoNewlineStandard.xml | 7 + .../Docs/Files/ExecutableFileStandard.xml | 7 + .../Generic/Docs/Files/InlineHTMLStandard.xml | 24 + .../Docs/Files/LineEndingsStandard.xml | 7 + .../Generic/Docs/Files/LineLengthStandard.xml | 7 + .../Docs/Files/LowercasedFilenameStandard.xml | 7 + .../Docs/Files/OneClassPerFileStandard.xml | 29 + .../Files/OneInterfacePerFileStandard.xml | 29 + .../OneObjectStructurePerFileStandard.xml | 29 + .../Docs/Files/OneTraitPerFileStandard.xml | 29 + .../DisallowMultipleStatementsStandard.xml | 20 + .../MultipleStatementAlignmentStandard.xml | 56 + .../Formatting/NoSpaceAfterCastStandard.xml | 19 + .../Formatting/SpaceAfterCastStandard.xml | 19 + .../Docs/Formatting/SpaceAfterNotStandard.xml | 22 + .../Formatting/SpaceBeforeCastStandard.xml | 21 + .../CallTimePassByReferenceStandard.xml | 31 + .../FunctionCallArgumentSpacingStandard.xml | 39 + .../OpeningFunctionBraceBsdAllmanStandard.xml | 24 + ...gFunctionBraceKernighanRitchieStandard.xml | 24 + .../Metrics/CyclomaticComplexityStandard.xml | 7 + .../Docs/Metrics/NestingLevelStandard.xml | 7 + .../AbstractClassNamePrefixStandard.xml | 23 + .../CamelCapsFunctionNameStandard.xml | 23 + .../ConstructorNameStandard.xml | 29 + .../InterfaceNameSuffixStandard.xml | 23 + .../TraitNameSuffixStandard.xml | 23 + .../UpperCaseConstantNameStandard.xml | 29 + .../Docs/PHP/BacktickOperatorStandard.xml | 7 + .../CharacterBeforePHPOpeningTagStandard.xml | 22 + .../Docs/PHP/ClosingPHPTagStandard.xml | 22 + .../Docs/PHP/DeprecatedFunctionsStandard.xml | 19 + .../DisallowAlternativePHPTagsStandard.xml | 7 + .../DisallowRequestSuperglobalStandard.xml | 7 + .../Docs/PHP/DisallowShortOpenTagStandard.xml | 7 + .../Docs/PHP/DiscourageGotoStandard.xml | 7 + .../Docs/PHP/ForbiddenFunctionsStandard.xml | 19 + .../Docs/PHP/LowerCaseConstantStandard.xml | 23 + .../Docs/PHP/LowerCaseKeywordStandard.xml | 19 + .../Docs/PHP/LowerCaseTypeStandard.xml | 38 + .../Docs/PHP/NoSilencedErrorsStandard.xml | 23 + .../Docs/PHP/RequireStrictTypesStandard.xml | 38 + .../Generic/Docs/PHP/SAPIUsageStandard.xml | 23 + .../Generic/Docs/PHP/SyntaxStandard.xml | 21 + .../Docs/PHP/UpperCaseConstantStandard.xml | 23 + .../UnnecessaryStringConcatStandard.xml | 19 + .../SubversionPropertiesStandard.xml | 7 + .../ArbitraryParenthesesSpacingStandard.xml | 23 + .../DisallowSpaceIndentStandard.xml | 7 + .../WhiteSpace/DisallowTabIndentStandard.xml | 7 + .../IncrementDecrementSpacingStandard.xml | 26 + .../LanguageConstructSpacingStandard.xml | 44 + .../Docs/WhiteSpace/ScopeIndentStandard.xml | 23 + .../SpreadOperatorSpacingAfterStandard.xml | 34 + .../Sniffs/Arrays/ArrayIndentSniff.php | 193 + .../Arrays/DisallowLongArraySyntaxSniff.php | 72 + .../Arrays/DisallowShortArraySyntaxSniff.php | 61 + .../Classes/DuplicateClassNameSniff.php | 118 + .../Classes/OpeningBraceSameLineSniff.php | 124 + .../AssignmentInConditionSniff.php | 171 + .../CodeAnalysis/EmptyPHPStatementSniff.php | 162 + .../CodeAnalysis/EmptyStatementSniff.php | 97 + .../ForLoopShouldBeWhileLoopSniff.php | 91 + .../ForLoopWithTestFunctionCallSniff.php | 101 + .../CodeAnalysis/JumbledIncrementerSniff.php | 134 + ...ExplicitBooleanOperatorPrecedenceSniff.php | 119 + .../UnconditionalIfStatementSniff.php | 93 + .../UnnecessaryFinalModifierSniff.php | 88 + .../UnusedFunctionParameterSniff.php | 307 + .../UselessOverridingMethodSniff.php | 184 + .../Sniffs/Commenting/DocCommentSniff.php | 357 + .../Generic/Sniffs/Commenting/FixmeSniff.php | 78 + .../Generic/Sniffs/Commenting/TodoSniff.php | 77 + .../DisallowYodaConditionsSniff.php | 185 + .../InlineControlStructureSniff.php | 381 + .../Generic/Sniffs/Debug/CSSLintSniff.php | 98 + .../Sniffs/Debug/ClosureLinterSniff.php | 119 + .../Generic/Sniffs/Debug/ESLintSniff.php | 115 + .../Generic/Sniffs/Debug/JSHintSniff.php | 97 + .../Sniffs/Files/ByteOrderMarkSniff.php | 82 + .../Sniffs/Files/EndFileNewlineSniff.php | 84 + .../Sniffs/Files/EndFileNoNewlineSniff.php | 91 + .../Sniffs/Files/ExecutableFileSniff.php | 62 + .../Generic/Sniffs/Files/InlineHTMLSniff.php | 79 + .../Generic/Sniffs/Files/LineEndingsSniff.php | 148 + .../Generic/Sniffs/Files/LineLengthSniff.php | 201 + .../Sniffs/Files/LowercasedFilenameSniff.php | 70 + .../Sniffs/Files/OneClassPerFileSniff.php | 57 + .../Sniffs/Files/OneInterfacePerFileSniff.php | 57 + .../Files/OneObjectStructurePerFileSniff.php | 62 + .../Sniffs/Files/OneTraitPerFileSniff.php | 57 + .../DisallowMultipleStatementsSniff.php | 105 + .../MultipleStatementAlignmentSniff.php | 426 + .../Formatting/NoSpaceAfterCastSniff.php | 61 + .../Sniffs/Formatting/SpaceAfterCastSniff.php | 161 + .../Sniffs/Formatting/SpaceAfterNotSniff.php | 143 + .../Formatting/SpaceBeforeCastSniff.php | 73 + .../CallTimePassByReferenceSniff.php | 141 + .../FunctionCallArgumentSpacingSniff.php | 197 + .../OpeningFunctionBraceBsdAllmanSniff.php | 225 + ...ningFunctionBraceKernighanRitchieSniff.php | 182 + .../Metrics/CyclomaticComplexitySniff.php | 117 + .../Sniffs/Metrics/NestingLevelSniff.php | 100 + .../AbstractClassNamePrefixSniff.php | 60 + .../CamelCapsFunctionNameSniff.php | 223 + .../ConstructorNameSniff.php | 163 + .../InterfaceNameSuffixSniff.php | 54 + .../TraitNameSuffixSniff.php | 54 + .../UpperCaseConstantNameSniff.php | 149 + .../Sniffs/PHP/BacktickOperatorSniff.php | 48 + .../PHP/CharacterBeforePHPOpeningTagSniff.php | 86 + .../Generic/Sniffs/PHP/ClosingPHPTagSniff.php | 54 + .../Sniffs/PHP/DeprecatedFunctionsSniff.php | 75 + .../PHP/DisallowAlternativePHPTagsSniff.php | 253 + .../PHP/DisallowRequestSuperglobalSniff.php | 55 + .../Sniffs/PHP/DisallowShortOpenTagSniff.php | 168 + .../Sniffs/PHP/DiscourageGotoSniff.php | 50 + .../Sniffs/PHP/ForbiddenFunctionsSniff.php | 245 + .../Sniffs/PHP/LowerCaseConstantSniff.php | 244 + .../Sniffs/PHP/LowerCaseKeywordSniff.php | 85 + .../Generic/Sniffs/PHP/LowerCaseTypeSniff.php | 364 + .../Sniffs/PHP/NoSilencedErrorsSniff.php | 77 + .../Sniffs/PHP/RequireStrictTypesSniff.php | 108 + .../Generic/Sniffs/PHP/SAPIUsageSniff.php | 67 + .../Generic/Sniffs/PHP/SyntaxSniff.php | 75 + .../Sniffs/PHP/UpperCaseConstantSniff.php | 57 + .../Strings/UnnecessaryStringConcatSniff.php | 129 + .../VersionControl/GitMergeConflictSniff.php | 228 + .../SubversionPropertiesSniff.php | 186 + .../ArbitraryParenthesesSpacingSniff.php | 239 + .../WhiteSpace/DisallowSpaceIndentSniff.php | 232 + .../WhiteSpace/DisallowTabIndentSniff.php | 200 + .../IncrementDecrementSpacingSniff.php | 174 + .../LanguageConstructSpacingSniff.php | 146 + .../Sniffs/WhiteSpace/ScopeIndentSniff.php | 1591 ++++ .../SpreadOperatorSpacingAfterSniff.php | 159 + .../Tests/Arrays/ArrayIndentUnitTest.inc | 154 + .../Arrays/ArrayIndentUnitTest.inc.fixed | 155 + .../Tests/Arrays/ArrayIndentUnitTest.php | 81 + .../DisallowLongArraySyntaxUnitTest.1.inc | 33 + ...isallowLongArraySyntaxUnitTest.1.inc.fixed | 33 + .../DisallowLongArraySyntaxUnitTest.2.inc | 17 + ...isallowLongArraySyntaxUnitTest.2.inc.fixed | 17 + .../DisallowLongArraySyntaxUnitTest.3.inc | 7 + .../DisallowLongArraySyntaxUnitTest.php | 75 + .../DisallowShortArraySyntaxUnitTest.inc | 12 + ...DisallowShortArraySyntaxUnitTest.inc.fixed | 12 + .../DisallowShortArraySyntaxUnitTest.php | 58 + .../Classes/DuplicateClassNameUnitTest.1.inc | 14 + .../Classes/DuplicateClassNameUnitTest.2.inc | 6 + .../Classes/DuplicateClassNameUnitTest.3.inc | 10 + .../Classes/DuplicateClassNameUnitTest.4.inc | 5 + .../Classes/DuplicateClassNameUnitTest.5.inc | 8 + .../Classes/DuplicateClassNameUnitTest.6.inc | 12 + .../Classes/DuplicateClassNameUnitTest.php | 83 + .../Classes/OpeningBraceSameLineUnitTest.inc | 100 + .../OpeningBraceSameLineUnitTest.inc.fixed | 100 + .../Classes/OpeningBraceSameLineUnitTest.php | 68 + .../AssignmentInConditionUnitTest.1.inc | 95 + .../AssignmentInConditionUnitTest.2.inc | 4 + .../AssignmentInConditionUnitTest.3.inc | 4 + .../AssignmentInConditionUnitTest.4.inc | 6 + .../AssignmentInConditionUnitTest.5.inc | 6 + .../AssignmentInConditionUnitTest.6.inc | 5 + .../AssignmentInConditionUnitTest.php | 96 + .../EmptyPHPStatementUnitTest.inc | 86 + .../EmptyPHPStatementUnitTest.inc.fixed | 80 + .../EmptyPHPStatementUnitTest.php | 73 + .../CodeAnalysis/EmptyStatementUnitTest.inc | 74 + .../CodeAnalysis/EmptyStatementUnitTest.php | 68 + .../ForLoopShouldBeWhileLoopUnitTest.1.inc | 37 + .../ForLoopShouldBeWhileLoopUnitTest.2.inc | 4 + .../ForLoopShouldBeWhileLoopUnitTest.3.inc | 6 + .../ForLoopShouldBeWhileLoopUnitTest.php | 64 + .../ForLoopWithTestFunctionCallUnitTest.1.inc | 95 + .../ForLoopWithTestFunctionCallUnitTest.2.inc | 5 + .../ForLoopWithTestFunctionCallUnitTest.3.inc | 6 + .../ForLoopWithTestFunctionCallUnitTest.php | 75 + .../JumbledIncrementerUnitTest.1.inc | 89 + .../JumbledIncrementerUnitTest.2.inc | 8 + .../JumbledIncrementerUnitTest.3.inc | 6 + .../JumbledIncrementerUnitTest.4.inc | 8 + .../JumbledIncrementerUnitTest.php | 72 + ...licitBooleanOperatorPrecedenceUnitTest.inc | 131 + ...licitBooleanOperatorPrecedenceUnitTest.php | 91 + .../UnconditionalIfStatementUnitTest.1.inc | 13 + .../UnconditionalIfStatementUnitTest.2.inc | 4 + .../UnconditionalIfStatementUnitTest.php | 65 + .../UnnecessaryFinalModifierUnitTest.1.inc | 56 + .../UnnecessaryFinalModifierUnitTest.2.inc | 5 + .../UnnecessaryFinalModifierUnitTest.php | 69 + .../UnusedFunctionParameterUnitTest.1.inc | 274 + .../UnusedFunctionParameterUnitTest.2.inc | 5 + .../UnusedFunctionParameterUnitTest.3.inc | 5 + .../UnusedFunctionParameterUnitTest.php | 78 + .../UselessOverridingMethodUnitTest.1.inc | 173 + .../UselessOverridingMethodUnitTest.2.inc | 7 + .../UselessOverridingMethodUnitTest.3.inc | 10 + .../UselessOverridingMethodUnitTest.4.inc | 10 + .../UselessOverridingMethodUnitTest.5.inc | 10 + .../UselessOverridingMethodUnitTest.6.inc | 10 + .../UselessOverridingMethodUnitTest.php | 72 + .../Tests/Commenting/DocCommentUnitTest.1.inc | 270 + .../Commenting/DocCommentUnitTest.1.inc.fixed | 275 + .../Tests/Commenting/DocCommentUnitTest.1.js | 270 + .../Commenting/DocCommentUnitTest.1.js.fixed | 275 + .../Tests/Commenting/DocCommentUnitTest.2.inc | 6 + .../Tests/Commenting/DocCommentUnitTest.2.js | 4 + .../Tests/Commenting/DocCommentUnitTest.php | 127 + .../Tests/Commenting/FixmeUnitTest.inc | 23 + .../Generic/Tests/Commenting/FixmeUnitTest.js | 23 + .../Tests/Commenting/FixmeUnitTest.php | 63 + .../Generic/Tests/Commenting/TodoUnitTest.inc | 23 + .../Generic/Tests/Commenting/TodoUnitTest.js | 23 + .../Generic/Tests/Commenting/TodoUnitTest.php | 62 + .../DisallowYodaConditionsUnitTest.inc | 187 + .../DisallowYodaConditionsUnitTest.php | 95 + .../InlineControlStructureUnitTest.1.inc | 278 + ...InlineControlStructureUnitTest.1.inc.fixed | 314 + .../InlineControlStructureUnitTest.2.inc | 8 + .../InlineControlStructureUnitTest.3.inc | 4 + .../InlineControlStructureUnitTest.4.inc | 5 + .../InlineControlStructureUnitTest.5.inc | 4 + .../InlineControlStructureUnitTest.6.inc | 6 + .../InlineControlStructureUnitTest.7.inc | 16 + .../InlineControlStructureUnitTest.js | 35 + .../InlineControlStructureUnitTest.js.fixed | 44 + .../InlineControlStructureUnitTest.php | 119 + .../Generic/Tests/Debug/CSSLintUnitTest.css | 6 + .../Generic/Tests/Debug/CSSLintUnitTest.php | 75 + .../Tests/Debug/ClosureLinterUnitTest.js | 6 + .../Tests/Debug/ClosureLinterUnitTest.php | 74 + .../Generic/Tests/Debug/ESLintUnitTest.js | 1 + .../Generic/Tests/Debug/ESLintUnitTest.php | 122 + .../Generic/Tests/Debug/JSHintUnitTest.js | 3 + .../Generic/Tests/Debug/JSHintUnitTest.php | 71 + .../Tests/Files/ByteOrderMarkUnitTest.1.inc | 4 + .../Tests/Files/ByteOrderMarkUnitTest.2.inc | 3 + .../Tests/Files/ByteOrderMarkUnitTest.3.inc | 1 + .../Tests/Files/ByteOrderMarkUnitTest.4.inc | Bin 0 -> 208 bytes .../Tests/Files/ByteOrderMarkUnitTest.5.inc | Bin 0 -> 202 bytes .../Tests/Files/ByteOrderMarkUnitTest.php | 63 + .../Tests/Files/EndFileNewlineUnitTest.1.css | 3 + .../Tests/Files/EndFileNewlineUnitTest.1.inc | 3 + .../Tests/Files/EndFileNewlineUnitTest.1.js | 3 + .../Tests/Files/EndFileNewlineUnitTest.2.css | 2 + .../Tests/Files/EndFileNewlineUnitTest.2.inc | 2 + .../Tests/Files/EndFileNewlineUnitTest.2.js | 2 + .../Tests/Files/EndFileNewlineUnitTest.3.css | 2 + .../Files/EndFileNewlineUnitTest.3.css.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.3.inc | 2 + .../Files/EndFileNewlineUnitTest.3.inc.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.3.js | 2 + .../Files/EndFileNewlineUnitTest.3.js.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.4.inc | 2 + .../Files/EndFileNewlineUnitTest.4.inc.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.5.inc | 2 + .../Tests/Files/EndFileNewlineUnitTest.6.inc | 1 + .../Files/EndFileNewlineUnitTest.6.inc.fixed | 1 + .../Tests/Files/EndFileNewlineUnitTest.7.inc | 1 + .../Files/EndFileNewlineUnitTest.7.inc.fixed | 1 + .../Tests/Files/EndFileNewlineUnitTest.8.inc | 1 + .../Tests/Files/EndFileNewlineUnitTest.php | 68 + .../Files/EndFileNoNewlineUnitTest.1.css | 3 + .../EndFileNoNewlineUnitTest.1.css.fixed | 2 + .../Files/EndFileNoNewlineUnitTest.1.inc | 3 + .../EndFileNoNewlineUnitTest.1.inc.fixed | 2 + .../Tests/Files/EndFileNoNewlineUnitTest.1.js | 3 + .../Files/EndFileNoNewlineUnitTest.1.js.fixed | 2 + .../Files/EndFileNoNewlineUnitTest.10.inc | 1 + .../Files/EndFileNoNewlineUnitTest.2.css | 2 + .../EndFileNoNewlineUnitTest.2.css.fixed | 2 + .../Files/EndFileNoNewlineUnitTest.2.inc | 3 + .../EndFileNoNewlineUnitTest.2.inc.fixed | 3 + .../Tests/Files/EndFileNoNewlineUnitTest.2.js | 2 + .../Files/EndFileNoNewlineUnitTest.2.js.fixed | 2 + .../Files/EndFileNoNewlineUnitTest.3.css | 2 + .../Files/EndFileNoNewlineUnitTest.3.inc | 2 + .../Tests/Files/EndFileNoNewlineUnitTest.3.js | 2 + .../Files/EndFileNoNewlineUnitTest.4.inc | 3 + .../Files/EndFileNoNewlineUnitTest.5.inc | 2 + .../Files/EndFileNoNewlineUnitTest.6.inc | 2 + .../EndFileNoNewlineUnitTest.6.inc.fixed | 2 + .../Files/EndFileNoNewlineUnitTest.7.inc | 6 + .../Files/EndFileNoNewlineUnitTest.8.inc | 1 + .../EndFileNoNewlineUnitTest.8.inc.fixed | 1 + .../Files/EndFileNoNewlineUnitTest.9.inc | 1 + .../EndFileNoNewlineUnitTest.9.inc.fixed | 1 + .../Tests/Files/EndFileNoNewlineUnitTest.php | 72 + .../Tests/Files/ExecutableFileUnitTest.1.inc | 1 + .../Tests/Files/ExecutableFileUnitTest.2.inc | 1 + .../Tests/Files/ExecutableFileUnitTest.3.inc | 1 + .../Tests/Files/ExecutableFileUnitTest.4.inc | 1 + .../Tests/Files/ExecutableFileUnitTest.php | 76 + .../Tests/Files/InlineHTMLUnitTest.1.inc | 3 + .../Tests/Files/InlineHTMLUnitTest.2.inc | 3 + .../Tests/Files/InlineHTMLUnitTest.3.inc | 6 + .../Tests/Files/InlineHTMLUnitTest.4.inc | 3 + .../Tests/Files/InlineHTMLUnitTest.5.inc | 3 + .../Tests/Files/InlineHTMLUnitTest.6.inc | 2 + .../Tests/Files/InlineHTMLUnitTest.7.inc | 2 + .../Tests/Files/InlineHTMLUnitTest.php | 69 + .../Tests/Files/LineEndingsUnitTest.1.inc | 18 + .../Files/LineEndingsUnitTest.1.inc.fixed | 18 + .../Tests/Files/LineEndingsUnitTest.2.inc | 5 + .../Files/LineEndingsUnitTest.2.inc.fixed | 5 + .../Tests/Files/LineEndingsUnitTest.css | 3 + .../Tests/Files/LineEndingsUnitTest.css.fixed | 3 + .../Tests/Files/LineEndingsUnitTest.js | 2 + .../Tests/Files/LineEndingsUnitTest.js.fixed | 2 + .../Tests/Files/LineEndingsUnitTest.php | 68 + .../Tests/Files/LineLengthUnitTest.1.inc | 84 + .../Tests/Files/LineLengthUnitTest.2.inc | 7 + .../Tests/Files/LineLengthUnitTest.3.inc | 16 + .../Tests/Files/LineLengthUnitTest.4.inc | 16 + .../Tests/Files/LineLengthUnitTest.php | 114 + .../Files/LowercasedFilenameUnitTest.1.inc | 7 + .../Files/LowercasedFilenameUnitTest.2.inc | 7 + .../Files/LowercasedFilenameUnitTest.php | 61 + .../Tests/Files/OneClassPerFileUnitTest.inc | 13 + .../Tests/Files/OneClassPerFileUnitTest.php | 56 + .../Files/OneInterfacePerFileUnitTest.inc | 13 + .../Files/OneInterfacePerFileUnitTest.php | 56 + .../OneObjectStructurePerFileUnitTest.inc | 26 + .../OneObjectStructurePerFileUnitTest.php | 59 + .../Tests/Files/OneTraitPerFileUnitTest.inc | 17 + .../Tests/Files/OneTraitPerFileUnitTest.php | 56 + .../DisallowMultipleStatementsUnitTest.inc | 20 + ...sallowMultipleStatementsUnitTest.inc.fixed | 25 + .../DisallowMultipleStatementsUnitTest.php | 59 + .../MultipleStatementAlignmentUnitTest.inc | 504 ++ ...ltipleStatementAlignmentUnitTest.inc.fixed | 504 ++ .../MultipleStatementAlignmentUnitTest.js | 118 + ...ultipleStatementAlignmentUnitTest.js.fixed | 118 + .../MultipleStatementAlignmentUnitTest.php | 170 + .../Formatting/NoSpaceAfterCastUnitTest.inc | 51 + .../NoSpaceAfterCastUnitTest.inc.fixed | 51 + .../Formatting/NoSpaceAfterCastUnitTest.php | 77 + .../Formatting/SpaceAfterCastUnitTest.1.inc | 100 + .../SpaceAfterCastUnitTest.1.inc.fixed | 97 + .../Formatting/SpaceAfterCastUnitTest.2.inc | 3 + .../Formatting/SpaceAfterCastUnitTest.php | 103 + .../Formatting/SpaceAfterNotUnitTest.1.inc | 86 + .../SpaceAfterNotUnitTest.1.inc.fixed | 83 + .../Formatting/SpaceAfterNotUnitTest.2.inc | 7 + .../Tests/Formatting/SpaceAfterNotUnitTest.js | 5 + .../Formatting/SpaceAfterNotUnitTest.js.fixed | 5 + .../Formatting/SpaceAfterNotUnitTest.php | 96 + .../Formatting/SpaceBeforeCastUnitTest.inc | 65 + .../SpaceBeforeCastUnitTest.inc.fixed | 65 + .../Formatting/SpaceBeforeCastUnitTest.php | 83 + .../CallTimePassByReferenceUnitTest.1.inc | 66 + .../CallTimePassByReferenceUnitTest.2.inc | 7 + .../CallTimePassByReferenceUnitTest.3.inc | 7 + .../CallTimePassByReferenceUnitTest.php | 75 + .../FunctionCallArgumentSpacingUnitTest.1.inc | 199 + ...ionCallArgumentSpacingUnitTest.1.inc.fixed | 199 + .../FunctionCallArgumentSpacingUnitTest.2.inc | 7 + .../FunctionCallArgumentSpacingUnitTest.php | 96 + .../OpeningFunctionBraceBsdAllmanUnitTest.inc | 270 + ...ngFunctionBraceBsdAllmanUnitTest.inc.fixed | 287 + .../OpeningFunctionBraceBsdAllmanUnitTest.php | 91 + ...gFunctionBraceKernighanRitchieUnitTest.inc | 214 + ...ionBraceKernighanRitchieUnitTest.inc.fixed | 202 + ...gFunctionBraceKernighanRitchieUnitTest.php | 82 + .../Metrics/CyclomaticComplexityUnitTest.inc | 454 + .../Metrics/CyclomaticComplexityUnitTest.php | 63 + .../Tests/Metrics/NestingLevelUnitTest.inc | 102 + .../Tests/Metrics/NestingLevelUnitTest.php | 56 + .../AbstractClassNamePrefixUnitTest.inc | 59 + .../AbstractClassNamePrefixUnitTest.php | 58 + .../CamelCapsFunctionNameUnitTest.inc | 185 + .../CamelCapsFunctionNameUnitTest.php | 97 + .../ConstructorNameUnitTest.inc | 97 + .../ConstructorNameUnitTest.php | 59 + .../InterfaceNameSuffixUnitTest.inc | 27 + .../InterfaceNameSuffixUnitTest.php | 52 + .../TraitNameSuffixUnitTest.inc | 13 + .../TraitNameSuffixUnitTest.php | 55 + .../UpperCaseConstantNameUnitTest.inc | 43 + .../UpperCaseConstantNameUnitTest.php | 63 + .../Tests/PHP/BacktickOperatorUnitTest.inc | 9 + .../Tests/PHP/BacktickOperatorUnitTest.php | 57 + ...CharacterBeforePHPOpeningTagUnitTest.1.inc | 9 + ...CharacterBeforePHPOpeningTagUnitTest.2.inc | 4 + ...CharacterBeforePHPOpeningTagUnitTest.3.inc | 3 + .../CharacterBeforePHPOpeningTagUnitTest.php | 61 + .../Tests/PHP/ClosingPHPTagUnitTest.1.inc | 10 + .../Tests/PHP/ClosingPHPTagUnitTest.2.inc | 5 + .../Tests/PHP/ClosingPHPTagUnitTest.php | 64 + .../Tests/PHP/DeprecatedFunctionsUnitTest.inc | 4 + .../Tests/PHP/DeprecatedFunctionsUnitTest.php | 63 + .../DisallowAlternativePHPTagsUnitTest.1.inc | 14 + ...llowAlternativePHPTagsUnitTest.1.inc.fixed | 14 + .../DisallowAlternativePHPTagsUnitTest.2.inc | 6 + ...llowAlternativePHPTagsUnitTest.2.inc.fixed | 6 + .../DisallowAlternativePHPTagsUnitTest.3.inc | 7 + .../DisallowAlternativePHPTagsUnitTest.php | 110 + .../DisallowRequestSuperglobalUnitTest.inc | 16 + .../DisallowRequestSuperglobalUnitTest.php | 56 + .../PHP/DisallowShortOpenTagUnitTest.1.inc | 11 + .../DisallowShortOpenTagUnitTest.1.inc.fixed | 11 + .../PHP/DisallowShortOpenTagUnitTest.2.inc | 8 + .../DisallowShortOpenTagUnitTest.2.inc.fixed | 8 + .../PHP/DisallowShortOpenTagUnitTest.3.inc | 16 + .../PHP/DisallowShortOpenTagUnitTest.php | 108 + .../Tests/PHP/DiscourageGotoUnitTest.inc | 18 + .../Tests/PHP/DiscourageGotoUnitTest.php | 58 + .../Tests/PHP/ForbiddenFunctionsUnitTest.inc | 60 + .../Tests/PHP/ForbiddenFunctionsUnitTest.php | 59 + .../Tests/PHP/LowerCaseConstantUnitTest.1.inc | 153 + .../PHP/LowerCaseConstantUnitTest.1.inc.fixed | 153 + .../Tests/PHP/LowerCaseConstantUnitTest.2.inc | 4 + .../Tests/PHP/LowerCaseConstantUnitTest.js | 14 + .../PHP/LowerCaseConstantUnitTest.js.fixed | 14 + .../Tests/PHP/LowerCaseConstantUnitTest.php | 105 + .../Tests/PHP/LowerCaseKeywordUnitTest.inc | 48 + .../PHP/LowerCaseKeywordUnitTest.inc.fixed | 48 + .../Tests/PHP/LowerCaseKeywordUnitTest.php | 71 + .../Tests/PHP/LowerCaseTypeUnitTest.inc | 145 + .../Tests/PHP/LowerCaseTypeUnitTest.inc.fixed | 145 + .../Tests/PHP/LowerCaseTypeUnitTest.php | 117 + .../Tests/PHP/NoSilencedErrorsUnitTest.inc | 16 + .../Tests/PHP/NoSilencedErrorsUnitTest.php | 57 + .../PHP/RequireStrictTypesUnitTest.1.inc | 8 + .../PHP/RequireStrictTypesUnitTest.10.inc | 5 + .../PHP/RequireStrictTypesUnitTest.11.inc | 5 + .../RequireStrictTypesUnitTest.11.inc.fixed | 5 + .../PHP/RequireStrictTypesUnitTest.12.inc | 5 + .../RequireStrictTypesUnitTest.12.inc.fixed | 5 + .../PHP/RequireStrictTypesUnitTest.13.inc | 3 + .../PHP/RequireStrictTypesUnitTest.14.inc | 5 + .../RequireStrictTypesUnitTest.14.inc.fixed | 5 + .../PHP/RequireStrictTypesUnitTest.15.inc | 5 + .../RequireStrictTypesUnitTest.15.inc.fixed | 5 + .../PHP/RequireStrictTypesUnitTest.2.inc | 2 + .../PHP/RequireStrictTypesUnitTest.3.inc | 5 + .../PHP/RequireStrictTypesUnitTest.4.inc | 10 + .../PHP/RequireStrictTypesUnitTest.5.inc | 6 + .../PHP/RequireStrictTypesUnitTest.6.inc | 4 + .../PHP/RequireStrictTypesUnitTest.7.inc | 4 + .../PHP/RequireStrictTypesUnitTest.8.inc | 5 + .../PHP/RequireStrictTypesUnitTest.9.inc | 5 + .../Tests/PHP/RequireStrictTypesUnitTest.php | 72 + .../Generic/Tests/PHP/SAPIUsageUnitTest.inc | 5 + .../Generic/Tests/PHP/SAPIUsageUnitTest.php | 53 + .../Generic/Tests/PHP/SyntaxUnitTest.1.inc | 4 + .../Generic/Tests/PHP/SyntaxUnitTest.2.inc | 3 + .../Generic/Tests/PHP/SyntaxUnitTest.php | 63 + .../Tests/PHP/UpperCaseConstantUnitTest.inc | 98 + .../PHP/UpperCaseConstantUnitTest.inc.fixed | 98 + .../Tests/PHP/UpperCaseConstantUnitTest.php | 75 + .../UnnecessaryStringConcatUnitTest.1.inc | 34 + .../UnnecessaryStringConcatUnitTest.2.inc | 7 + .../UnnecessaryStringConcatUnitTest.js | 15 + .../UnnecessaryStringConcatUnitTest.php | 87 + .../GitMergeConflictUnitTest.1.css | 35 + .../GitMergeConflictUnitTest.1.inc | 61 + .../GitMergeConflictUnitTest.2.css | 32 + .../GitMergeConflictUnitTest.2.inc | 31 + .../GitMergeConflictUnitTest.3.inc | 43 + .../GitMergeConflictUnitTest.4.inc | 71 + .../GitMergeConflictUnitTest.5.inc | 34 + .../GitMergeConflictUnitTest.6.inc | 34 + .../GitMergeConflictUnitTest.7.inc | 19 + .../GitMergeConflictUnitTest.js | 33 + .../GitMergeConflictUnitTest.php | 175 + .../SubversionPropertiesUnitTest.inc | 3 + .../SubversionPropertiesUnitTest.php | 66 + .../ArbitraryParenthesesSpacingUnitTest.1.inc | 192 + ...raryParenthesesSpacingUnitTest.1.inc.fixed | 180 + .../ArbitraryParenthesesSpacingUnitTest.2.inc | 4 + .../ArbitraryParenthesesSpacingUnitTest.php | 106 + .../DisallowSpaceIndentUnitTest.1.inc | 118 + .../DisallowSpaceIndentUnitTest.1.inc.fixed | 118 + .../DisallowSpaceIndentUnitTest.2.inc | 118 + .../DisallowSpaceIndentUnitTest.2.inc.fixed | 118 + .../DisallowSpaceIndentUnitTest.3.inc | 19 + .../DisallowSpaceIndentUnitTest.3.inc.fixed | 19 + .../DisallowSpaceIndentUnitTest.4.inc | 13 + .../DisallowSpaceIndentUnitTest.css | 4 + .../DisallowSpaceIndentUnitTest.css.fixed | 4 + .../WhiteSpace/DisallowSpaceIndentUnitTest.js | 9 + .../DisallowSpaceIndentUnitTest.js.fixed | 9 + .../DisallowSpaceIndentUnitTest.php | 144 + .../DisallowTabIndentUnitTest.1.inc | 93 + .../DisallowTabIndentUnitTest.1.inc.fixed | 93 + .../DisallowTabIndentUnitTest.2.inc | 19 + .../DisallowTabIndentUnitTest.2.inc.fixed | 19 + .../DisallowTabIndentUnitTest.3.inc | 13 + .../WhiteSpace/DisallowTabIndentUnitTest.css | 5 + .../DisallowTabIndentUnitTest.css.fixed | 5 + .../WhiteSpace/DisallowTabIndentUnitTest.js | 9 + .../DisallowTabIndentUnitTest.js.fixed | 9 + .../WhiteSpace/DisallowTabIndentUnitTest.php | 151 + .../IncrementDecrementSpacingUnitTest.inc | 43 + ...ncrementDecrementSpacingUnitTest.inc.fixed | 41 + .../IncrementDecrementSpacingUnitTest.js | 17 + ...IncrementDecrementSpacingUnitTest.js.fixed | 16 + .../IncrementDecrementSpacingUnitTest.php | 86 + .../LanguageConstructSpacingUnitTest.1.inc | 91 + ...nguageConstructSpacingUnitTest.1.inc.fixed | 85 + .../LanguageConstructSpacingUnitTest.2.inc | 4 + .../LanguageConstructSpacingUnitTest.php | 98 + .../WhiteSpace/ScopeIndentUnitTest.1.inc | 1653 ++++ .../ScopeIndentUnitTest.1.inc.fixed | 1653 ++++ .../Tests/WhiteSpace/ScopeIndentUnitTest.1.js | 239 + .../WhiteSpace/ScopeIndentUnitTest.1.js.fixed | 239 + .../WhiteSpace/ScopeIndentUnitTest.2.inc | 1653 ++++ .../ScopeIndentUnitTest.2.inc.fixed | 1653 ++++ .../WhiteSpace/ScopeIndentUnitTest.3.inc | 28 + .../ScopeIndentUnitTest.3.inc.fixed | 28 + .../WhiteSpace/ScopeIndentUnitTest.4.inc | 6 + .../Tests/WhiteSpace/ScopeIndentUnitTest.php | 219 + .../SpreadOperatorSpacingAfterUnitTest.1.inc | 76 + ...adOperatorSpacingAfterUnitTest.1.inc.fixed | 71 + .../SpreadOperatorSpacingAfterUnitTest.2.inc | 4 + .../SpreadOperatorSpacingAfterUnitTest.php | 71 + .../src/Standards/Generic/ruleset.xml | 4 + .../Sniffs/CSS/BrowserSpecificStylesSniff.php | 89 + .../Channels/DisallowSelfActionsSniff.php | 127 + .../Sniffs/Channels/IncludeOwnSystemSniff.php | 100 + .../Sniffs/Channels/IncludeSystemSniff.php | 316 + .../Sniffs/Channels/UnusedSystemSniff.php | 143 + .../Commenting/FunctionCommentSniff.php | 86 + .../MySource/Sniffs/Debug/DebugCodeSniff.php | 57 + .../Sniffs/Debug/FirebugConsoleSniff.php | 66 + .../Sniffs/Objects/AssignThisSniff.php | 83 + .../Objects/CreateWidgetTypeCallbackSniff.php | 220 + .../Sniffs/Objects/DisallowNewWidgetSniff.php | 61 + .../Sniffs/PHP/AjaxNullComparisonSniff.php | 105 + .../Sniffs/PHP/EvalObjectFactorySniff.php | 116 + .../Sniffs/PHP/GetRequestDataSniff.php | 108 + .../Sniffs/PHP/ReturnFunctionValueSniff.php | 65 + .../Sniffs/Strings/JoinStringsSniff.php | 78 + .../CSS/BrowserSpecificStylesUnitTest.css | 13 + .../CSS/BrowserSpecificStylesUnitTest.php | 53 + .../Channels/DisallowSelfActionsUnitTest.inc | 51 + .../Channels/DisallowSelfActionsUnitTest.php | 58 + .../Tests/Channels/IncludeSystemUnitTest.inc | 112 + .../Tests/Channels/IncludeSystemUnitTest.php | 65 + .../Tests/Channels/UnusedSystemUnitTest.inc | 67 + .../Tests/Channels/UnusedSystemUnitTest.php | 60 + .../Commenting/FunctionCommentUnitTest.inc | 101 + .../Commenting/FunctionCommentUnitTest.php | 59 + .../Tests/Debug/DebugCodeUnitTest.inc | 4 + .../Tests/Debug/DebugCodeUnitTest.php | 56 + .../Tests/Debug/FirebugConsoleUnitTest.js | 8 + .../Tests/Debug/FirebugConsoleUnitTest.php | 66 + .../Tests/Objects/AssignThisUnitTest.js | 20 + .../Tests/Objects/AssignThisUnitTest.php | 63 + .../CreateWidgetTypeCallbackUnitTest.js | 186 + .../CreateWidgetTypeCallbackUnitTest.php | 62 + .../Objects/DisallowNewWidgetUnitTest.inc | 6 + .../Objects/DisallowNewWidgetUnitTest.php | 53 + .../Tests/PHP/AjaxNullComparisonUnitTest.inc | 182 + .../Tests/PHP/AjaxNullComparisonUnitTest.php | 60 + .../Tests/PHP/EvalObjectFactoryUnitTest.inc | 26 + .../Tests/PHP/EvalObjectFactoryUnitTest.php | 57 + .../Tests/PHP/GetRequestDataUnitTest.inc | 30 + .../Tests/PHP/GetRequestDataUnitTest.php | 61 + .../Tests/PHP/ReturnFunctionValueUnitTest.inc | 9 + .../Tests/PHP/ReturnFunctionValueUnitTest.php | 57 + .../Tests/Strings/JoinStringsUnitTest.js | 18 + .../Tests/Strings/JoinStringsUnitTest.php | 67 + .../src/Standards/MySource/ruleset.xml | 18 + .../Docs/Classes/ClassDeclarationStandard.xml | 22 + .../Docs/Commenting/ClassCommentStandard.xml | 177 + .../Docs/Commenting/FileCommentStandard.xml | 286 + .../Commenting/FunctionCommentStandard.xml | 230 + .../Docs/Commenting/InlineCommentStandard.xml | 19 + .../ControlSignatureStandard.xml | 36 + .../MultiLineConditionStandard.xml | 60 + .../PEAR/Docs/Files/IncludingFileStandard.xml | 24 + .../PEAR/Docs/Files/LineLengthStandard.xml | 7 + .../MultiLineAssignmentStandard.xml | 35 + .../FunctionCallSignatureStandard.xml | 19 + .../Functions/FunctionDeclarationStandard.xml | 41 + .../Functions/ValidDefaultValueStandard.xml | 25 + .../ValidClassNameStandard.xml | 23 + .../ValidFunctionNameStandard.xml | 23 + .../ValidVariableNameStandard.xml | 29 + .../ObjectOperatorIndentStandard.xml | 39 + .../WhiteSpace/ScopeClosingBraceStandard.xml | 23 + .../Docs/WhiteSpace/ScopeIndentStandard.xml | 29 + .../Sniffs/Classes/ClassDeclarationSniff.php | 150 + .../Sniffs/Commenting/ClassCommentSniff.php | 122 + .../Sniffs/Commenting/FileCommentSniff.php | 583 ++ .../Commenting/FunctionCommentSniff.php | 539 ++ .../Sniffs/Commenting/InlineCommentSniff.php | 68 + .../ControlSignatureSniff.php | 48 + .../MultiLineConditionSniff.php | 283 + .../PEAR/Sniffs/Files/IncludingFileSniff.php | 136 + .../Formatting/MultiLineAssignmentSniff.php | 106 + .../Functions/FunctionCallSignatureSniff.php | 634 ++ .../Functions/FunctionDeclarationSniff.php | 549 ++ .../Functions/ValidDefaultValueSniff.php | 78 + .../NamingConventions/ValidClassNameSniff.php | 98 + .../ValidFunctionNameSniff.php | 284 + .../ValidVariableNameSniff.php | 103 + .../WhiteSpace/ObjectOperatorIndentSniff.php | 204 + .../WhiteSpace/ScopeClosingBraceSniff.php | 182 + .../Sniffs/WhiteSpace/ScopeIndentSniff.php | 24 + .../Classes/ClassDeclarationUnitTest.1.inc | 114 + .../ClassDeclarationUnitTest.1.inc.fixed | 125 + .../Classes/ClassDeclarationUnitTest.2.inc | 11 + .../Classes/ClassDeclarationUnitTest.php | 100 + .../Tests/Commenting/ClassCommentUnitTest.inc | 163 + .../Tests/Commenting/ClassCommentUnitTest.php | 78 + .../Commenting/FileCommentUnitTest.1.inc | 53 + .../Commenting/FileCommentUnitTest.2.inc | 9 + .../Commenting/FileCommentUnitTest.3.inc | 8 + .../Commenting/FileCommentUnitTest.4.inc | 7 + .../Tests/Commenting/FileCommentUnitTest.php | 95 + .../Commenting/FunctionCommentUnitTest.inc | 512 ++ .../FunctionCommentUnitTest.inc.fixed | 491 ++ .../Commenting/FunctionCommentUnitTest.php | 103 + .../Commenting/InlineCommentUnitTest.inc | 29 + .../InlineCommentUnitTest.inc.fixed | 29 + .../Commenting/InlineCommentUnitTest.php | 60 + .../ControlSignatureUnitTest.inc | 165 + .../ControlSignatureUnitTest.php | 77 + .../MultiLineConditionUnitTest.inc | 251 + .../MultiLineConditionUnitTest.inc.fixed | 247 + .../MultiLineConditionUnitTest.js | 251 + .../MultiLineConditionUnitTest.js.fixed | 247 + .../MultiLineConditionUnitTest.php | 96 + .../Tests/Files/IncludingFileUnitTest.inc | 99 + .../Files/IncludingFileUnitTest.inc.fixed | 99 + .../Tests/Files/IncludingFileUnitTest.php | 72 + .../MultiLineAssignmentUnitTest.inc | 22 + .../MultiLineAssignmentUnitTest.php | 57 + .../FunctionCallSignatureUnitTest.inc | 576 ++ .../FunctionCallSignatureUnitTest.inc.fixed | 591 ++ .../FunctionCallSignatureUnitTest.js | 80 + .../FunctionCallSignatureUnitTest.js.fixed | 84 + .../FunctionCallSignatureUnitTest.php | 164 + .../FunctionDeclarationUnitTest.1.inc | 490 ++ .../FunctionDeclarationUnitTest.1.inc.fixed | 487 ++ .../FunctionDeclarationUnitTest.2.inc | 7 + .../Functions/FunctionDeclarationUnitTest.js | 59 + .../FunctionDeclarationUnitTest.js.fixed | 60 + .../Functions/FunctionDeclarationUnitTest.php | 149 + .../Functions/ValidDefaultValueUnitTest.1.inc | 116 + .../Functions/ValidDefaultValueUnitTest.2.inc | 7 + .../Functions/ValidDefaultValueUnitTest.php | 73 + .../ValidClassNameUnitTest.inc | 90 + .../ValidClassNameUnitTest.php | 78 + .../ValidFunctionNameUnitTest.inc | 243 + .../ValidFunctionNameUnitTest.php | 154 + .../ValidVariableNameUnitTest.inc | 101 + .../ValidVariableNameUnitTest.php | 61 + .../ObjectOperatorIndentUnitTest.inc | 142 + .../ObjectOperatorIndentUnitTest.inc.fixed | 142 + .../ObjectOperatorIndentUnitTest.php | 79 + .../WhiteSpace/ScopeClosingBraceUnitTest.inc | 170 + .../ScopeClosingBraceUnitTest.inc.fixed | 177 + .../WhiteSpace/ScopeClosingBraceUnitTest.php | 73 + .../Tests/WhiteSpace/ScopeIndentUnitTest.inc | 314 + .../WhiteSpace/ScopeIndentUnitTest.inc.fixed | 314 + .../Tests/WhiteSpace/ScopeIndentUnitTest.php | 71 + .../src/Standards/PEAR/ruleset.xml | 41 + .../Docs/Classes/ClassDeclarationStandard.xml | 48 + .../PSR1/Docs/Files/SideEffectsStandard.xml | 27 + .../Methods/CamelCapsMethodNameStandard.xml | 29 + .../Sniffs/Classes/ClassDeclarationSniff.php | 75 + .../PSR1/Sniffs/Files/SideEffectsSniff.php | 303 + .../Methods/CamelCapsMethodNameSniff.php | 91 + .../Classes/ClassDeclarationUnitTest.1.inc | 3 + .../Classes/ClassDeclarationUnitTest.2.inc | 4 + .../Classes/ClassDeclarationUnitTest.3.inc | 3 + .../Classes/ClassDeclarationUnitTest.php | 62 + .../Tests/Files/SideEffectsUnitTest.1.inc | 87 + .../Tests/Files/SideEffectsUnitTest.10.inc | 8 + .../Tests/Files/SideEffectsUnitTest.11.inc | 11 + .../Tests/Files/SideEffectsUnitTest.12.inc | 8 + .../Tests/Files/SideEffectsUnitTest.13.inc | 2 + .../Tests/Files/SideEffectsUnitTest.14.inc | 2 + .../Tests/Files/SideEffectsUnitTest.15.inc | 2 + .../Tests/Files/SideEffectsUnitTest.16.inc | 2 + .../Tests/Files/SideEffectsUnitTest.17.inc | 8 + .../Tests/Files/SideEffectsUnitTest.2.inc | 24 + .../Tests/Files/SideEffectsUnitTest.3.inc | 6 + .../Tests/Files/SideEffectsUnitTest.4.inc | 10 + .../Tests/Files/SideEffectsUnitTest.5.inc | 2 + .../Tests/Files/SideEffectsUnitTest.6.inc | 9 + .../Tests/Files/SideEffectsUnitTest.7.inc | 8 + .../Tests/Files/SideEffectsUnitTest.8.inc | 8 + .../Tests/Files/SideEffectsUnitTest.9.inc | 8 + .../PSR1/Tests/Files/SideEffectsUnitTest.php | 85 + .../Methods/CamelCapsMethodNameUnitTest.inc | 81 + .../Methods/CamelCapsMethodNameUnitTest.php | 64 + .../src/Standards/PSR1/ruleset.xml | 47 + .../Classes/ClassInstantiationStandard.xml | 19 + .../Docs/Classes/ClosingBraceStandard.xml | 35 + .../Classes/OpeningBraceSpaceStandard.xml | 32 + .../BooleanOperatorPlacementStandard.xml | 59 + .../ControlStructureSpacingStandard.xml | 124 + .../Docs/Files/ImportStatementStandard.xml | 33 + .../PSR12/Docs/Files/OpenTagStandard.xml | 40 + .../NullableTypeDeclarationStandard.xml | 45 + .../ReturnTypeDeclarationStandard.xml | 41 + .../ShortFormTypeKeywordsStandard.xml | 19 + .../CompoundNamespaceDepthStandard.xml | 28 + .../Operators/OperatorSpacingStandard.xml | 27 + .../Properties/ConstantVisibilityStandard.xml | 27 + .../Classes/AnonClassDeclarationSniff.php | 246 + .../Classes/ClassInstantiationSniff.php | 112 + .../Sniffs/Classes/ClosingBraceSniff.php | 67 + .../Sniffs/Classes/OpeningBraceSpaceSniff.php | 80 + .../BooleanOperatorPlacementSniff.php | 229 + .../ControlStructureSpacingSniff.php | 207 + .../Sniffs/Files/DeclareStatementSniff.php | 262 + .../PSR12/Sniffs/Files/FileHeaderSniff.php | 429 + .../Sniffs/Files/ImportStatementSniff.php | 77 + .../PSR12/Sniffs/Files/OpenTagSniff.php | 76 + .../NullableTypeDeclarationSniff.php | 94 + .../Functions/ReturnTypeDeclarationSniff.php | 110 + .../Keywords/ShortFormTypeKeywordsSniff.php | 75 + .../CompoundNamespaceDepthSniff.php | 80 + .../Sniffs/Operators/OperatorSpacingSniff.php | 128 + .../Properties/ConstantVisibilitySniff.php | 64 + .../Sniffs/Traits/UseDeclarationSniff.php | 700 ++ .../Classes/AnonClassDeclarationUnitTest.inc | 96 + .../AnonClassDeclarationUnitTest.inc.fixed | 98 + .../Classes/AnonClassDeclarationUnitTest.php | 80 + .../Classes/ClassInstantiationUnitTest.inc | 51 + .../ClassInstantiationUnitTest.inc.fixed | 51 + .../Classes/ClassInstantiationUnitTest.php | 72 + .../Tests/Classes/ClosingBraceUnitTest.inc | 52 + .../Tests/Classes/ClosingBraceUnitTest.php | 60 + .../Classes/OpeningBraceSpaceUnitTest.inc | 57 + .../OpeningBraceSpaceUnitTest.inc.fixed | 48 + .../Classes/OpeningBraceSpaceUnitTest.php | 60 + .../BooleanOperatorPlacementUnitTest.inc | 131 + ...BooleanOperatorPlacementUnitTest.inc.fixed | 141 + .../BooleanOperatorPlacementUnitTest.php | 64 + .../ControlStructureSpacingUnitTest.inc | 100 + .../ControlStructureSpacingUnitTest.inc.fixed | 103 + .../ControlStructureSpacingUnitTest.php | 73 + .../Files/DeclareStatementUnitTest.1.inc | 50 + .../DeclareStatementUnitTest.1.inc.fixed | 54 + .../Files/DeclareStatementUnitTest.2.inc | 3 + .../Tests/Files/DeclareStatementUnitTest.php | 84 + .../Tests/Files/FileHeaderUnitTest.1.inc | 29 + .../Tests/Files/FileHeaderUnitTest.10.inc | 4 + .../Files/FileHeaderUnitTest.10.inc.fixed | 5 + .../Tests/Files/FileHeaderUnitTest.11.inc | 21 + .../Files/FileHeaderUnitTest.11.inc.fixed | 22 + .../Tests/Files/FileHeaderUnitTest.12.inc | 17 + .../Files/FileHeaderUnitTest.12.inc.fixed | 18 + .../Tests/Files/FileHeaderUnitTest.13.inc | 24 + .../Tests/Files/FileHeaderUnitTest.14.inc | 7 + .../Tests/Files/FileHeaderUnitTest.15.inc | 5 + .../Tests/Files/FileHeaderUnitTest.16.inc | 13 + .../Tests/Files/FileHeaderUnitTest.17.inc | 13 + .../Tests/Files/FileHeaderUnitTest.18.inc | 16 + .../Tests/Files/FileHeaderUnitTest.2.inc | 33 + .../Files/FileHeaderUnitTest.2.inc.fixed | 29 + .../Tests/Files/FileHeaderUnitTest.3.inc | 27 + .../Tests/Files/FileHeaderUnitTest.4.inc | 15 + .../Files/FileHeaderUnitTest.4.inc.fixed | 19 + .../Tests/Files/FileHeaderUnitTest.5.inc | 18 + .../Tests/Files/FileHeaderUnitTest.6.inc | 13 + .../Tests/Files/FileHeaderUnitTest.7.inc | 2 + .../Files/FileHeaderUnitTest.7.inc.fixed | 3 + .../Tests/Files/FileHeaderUnitTest.8.inc | 5 + .../Tests/Files/FileHeaderUnitTest.9.inc | 7 + .../PSR12/Tests/Files/FileHeaderUnitTest.php | 87 + .../Tests/Files/ImportStatementUnitTest.inc | 26 + .../Files/ImportStatementUnitTest.inc.fixed | 26 + .../Tests/Files/ImportStatementUnitTest.php | 57 + .../PSR12/Tests/Files/OpenTagUnitTest.1.inc | 3 + .../PSR12/Tests/Files/OpenTagUnitTest.2.inc | 1 + .../Tests/Files/OpenTagUnitTest.2.inc.fixed | 2 + .../PSR12/Tests/Files/OpenTagUnitTest.3.inc | 3 + .../PSR12/Tests/Files/OpenTagUnitTest.4.inc | 2 + .../PSR12/Tests/Files/OpenTagUnitTest.5.inc | 1 + .../PSR12/Tests/Files/OpenTagUnitTest.php | 60 + .../NullableTypeDeclarationUnitTest.inc | 95 + .../NullableTypeDeclarationUnitTest.inc.fixed | 92 + .../NullableTypeDeclarationUnitTest.php | 72 + .../ReturnTypeDeclarationUnitTest.inc | 66 + .../ReturnTypeDeclarationUnitTest.inc.fixed | 62 + .../ReturnTypeDeclarationUnitTest.php | 66 + .../ShortFormTypeKeywordsUnitTest.inc | 14 + .../ShortFormTypeKeywordsUnitTest.inc.fixed | 14 + .../ShortFormTypeKeywordsUnitTest.php | 59 + .../CompoundNamespaceDepthUnitTest.inc | 31 + .../CompoundNamespaceDepthUnitTest.php | 57 + .../Operators/OperatorSpacingUnitTest.1.inc | 79 + .../OperatorSpacingUnitTest.1.inc.fixed | 79 + .../Operators/OperatorSpacingUnitTest.2.inc | 3 + .../Operators/OperatorSpacingUnitTest.3.inc | 6 + .../Operators/OperatorSpacingUnitTest.php | 81 + .../Properties/ConstantVisibilityUnitTest.inc | 22 + .../Properties/ConstantVisibilityUnitTest.php | 57 + .../Tests/Traits/UseDeclarationUnitTest.inc | 221 + .../Traits/UseDeclarationUnitTest.inc.fixed | 213 + .../Tests/Traits/UseDeclarationUnitTest.php | 76 + .../src/Standards/PSR12/ruleset.xml | 348 + .../Docs/Classes/ClassDeclarationStandard.xml | 23 + .../Classes/PropertyDeclarationStandard.xml | 81 + .../ControlStructureSpacingStandard.xml | 23 + .../ElseIfDeclarationStandard.xml | 27 + .../SwitchDeclarationStandard.xml | 104 + .../PSR2/Docs/Files/ClosingTagStandard.xml | 23 + .../Docs/Files/EndFileNewlineStandard.xml | 7 + .../Methods/FunctionCallSignatureStandard.xml | 107 + .../Methods/FunctionClosingBraceStandard.xml | 26 + .../Methods/MethodDeclarationStandard.xml | 51 + .../NamespaceDeclarationStandard.xml | 22 + .../Namespaces/UseDeclarationStandard.xml | 57 + .../Sniffs/Classes/ClassDeclarationSniff.php | 540 ++ .../Classes/PropertyDeclarationSniff.php | 226 + .../ControlStructureSpacingSniff.php | 141 + .../ElseIfDeclarationSniff.php | 72 + .../SwitchDeclarationSniff.php | 396 + .../PSR2/Sniffs/Files/ClosingTagSniff.php | 89 + .../PSR2/Sniffs/Files/EndFileNewlineSniff.php | 107 + .../Methods/FunctionCallSignatureSniff.php | 79 + .../Methods/FunctionClosingBraceSniff.php | 91 + .../Sniffs/Methods/MethodDeclarationSniff.php | 162 + .../Namespaces/NamespaceDeclarationSniff.php | 100 + .../Sniffs/Namespaces/UseDeclarationSniff.php | 297 + .../Classes/ClassDeclarationUnitTest.inc | 346 + .../ClassDeclarationUnitTest.inc.fixed | 335 + .../Classes/ClassDeclarationUnitTest.php | 103 + .../Classes/PropertyDeclarationUnitTest.inc | 87 + .../PropertyDeclarationUnitTest.inc.fixed | 84 + .../Classes/PropertyDeclarationUnitTest.php | 84 + .../ControlStructureSpacingUnitTest.inc | 81 + .../ControlStructureSpacingUnitTest.inc.fixed | 80 + .../ControlStructureSpacingUnitTest.php | 67 + .../ElseIfDeclarationUnitTest.inc | 17 + .../ElseIfDeclarationUnitTest.inc.fixed | 17 + .../ElseIfDeclarationUnitTest.php | 56 + .../SwitchDeclarationUnitTest.inc | 598 ++ .../SwitchDeclarationUnitTest.inc.fixed | 593 ++ .../SwitchDeclarationUnitTest.php | 86 + .../PSR2/Tests/Files/ClosingTagUnitTest.1.inc | 12 + .../Files/ClosingTagUnitTest.1.inc.fixed | 12 + .../PSR2/Tests/Files/ClosingTagUnitTest.2.inc | 3 + .../PSR2/Tests/Files/ClosingTagUnitTest.3.inc | 7 + .../PSR2/Tests/Files/ClosingTagUnitTest.4.inc | 1 + .../Files/ClosingTagUnitTest.4.inc.fixed | 1 + .../PSR2/Tests/Files/ClosingTagUnitTest.5.inc | 1 + .../Files/ClosingTagUnitTest.5.inc.fixed | 1 + .../PSR2/Tests/Files/ClosingTagUnitTest.6.inc | 5 + .../Files/ClosingTagUnitTest.6.inc.fixed | 5 + .../PSR2/Tests/Files/ClosingTagUnitTest.7.inc | 5 + .../Files/ClosingTagUnitTest.7.inc.fixed | 5 + .../PSR2/Tests/Files/ClosingTagUnitTest.php | 69 + .../Tests/Files/EndFileNewlineUnitTest.1.inc | 3 + .../Files/EndFileNewlineUnitTest.1.inc.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.10.inc | 3 + .../Files/EndFileNewlineUnitTest.10.inc.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.11.inc | 1 + .../Files/EndFileNewlineUnitTest.11.inc.fixed | 1 + .../Tests/Files/EndFileNewlineUnitTest.12.inc | 1 + .../Files/EndFileNewlineUnitTest.12.inc.fixed | 1 + .../Tests/Files/EndFileNewlineUnitTest.13.inc | 5 + .../Files/EndFileNewlineUnitTest.13.inc.fixed | 1 + .../Tests/Files/EndFileNewlineUnitTest.14.inc | 1 + .../Tests/Files/EndFileNewlineUnitTest.2.inc | 2 + .../Tests/Files/EndFileNewlineUnitTest.3.inc | 2 + .../Files/EndFileNewlineUnitTest.3.inc.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.4.inc | 4 + .../Tests/Files/EndFileNewlineUnitTest.5.inc | 6 + .../Tests/Files/EndFileNewlineUnitTest.6.inc | 2 + .../Files/EndFileNewlineUnitTest.6.inc.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.7.inc | 11 + .../Files/EndFileNewlineUnitTest.7.inc.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.8.inc | 2 + .../Tests/Files/EndFileNewlineUnitTest.9.inc | 2 + .../Files/EndFileNewlineUnitTest.9.inc.fixed | 2 + .../Tests/Files/EndFileNewlineUnitTest.php | 71 + .../Methods/FunctionCallSignatureUnitTest.inc | 267 + .../FunctionCallSignatureUnitTest.inc.fixed | 283 + .../Methods/FunctionCallSignatureUnitTest.php | 99 + .../Methods/FunctionClosingBraceUnitTest.inc | 70 + .../FunctionClosingBraceUnitTest.inc.fixed | 61 + .../Methods/FunctionClosingBraceUnitTest.php | 60 + .../Methods/MethodDeclarationUnitTest.inc | 75 + .../MethodDeclarationUnitTest.inc.fixed | 75 + .../Methods/MethodDeclarationUnitTest.php | 76 + .../NamespaceDeclarationUnitTest.inc | 26 + .../NamespaceDeclarationUnitTest.inc.fixed | 28 + .../NamespaceDeclarationUnitTest.php | 58 + .../Namespaces/UseDeclarationUnitTest.1.inc | 40 + .../Namespaces/UseDeclarationUnitTest.10.inc | 8 + .../UseDeclarationUnitTest.10.inc.fixed | 9 + .../Namespaces/UseDeclarationUnitTest.11.inc | 2 + .../UseDeclarationUnitTest.11.inc.fixed | 4 + .../Namespaces/UseDeclarationUnitTest.12.inc | 9 + .../UseDeclarationUnitTest.12.inc.fixed | 11 + .../Namespaces/UseDeclarationUnitTest.13.inc | 10 + .../UseDeclarationUnitTest.13.inc.fixed | 11 + .../Namespaces/UseDeclarationUnitTest.14.inc | 8 + .../UseDeclarationUnitTest.14.inc.fixed | 9 + .../Namespaces/UseDeclarationUnitTest.15.inc | 10 + .../Namespaces/UseDeclarationUnitTest.16.inc | 11 + .../UseDeclarationUnitTest.16.inc.fixed | 9 + .../Namespaces/UseDeclarationUnitTest.17.inc | 3 + .../Namespaces/UseDeclarationUnitTest.18.inc | 4 + .../Namespaces/UseDeclarationUnitTest.2.inc | 21 + .../UseDeclarationUnitTest.2.inc.fixed | 27 + .../Namespaces/UseDeclarationUnitTest.3.inc | 16 + .../UseDeclarationUnitTest.3.inc.fixed | 16 + .../Namespaces/UseDeclarationUnitTest.4.inc | 4 + .../Namespaces/UseDeclarationUnitTest.5.inc | 47 + .../UseDeclarationUnitTest.5.inc.fixed | 56 + .../Namespaces/UseDeclarationUnitTest.6.inc | 1 + .../Namespaces/UseDeclarationUnitTest.7.inc | 1 + .../Namespaces/UseDeclarationUnitTest.8.inc | 8 + .../Namespaces/UseDeclarationUnitTest.9.inc | 8 + .../Namespaces/UseDeclarationUnitTest.php | 102 + .../src/Standards/PSR2/ruleset.xml | 218 + .../Arrays/ArrayBracketSpacingStandard.xml | 19 + .../Docs/Arrays/ArrayDeclarationStandard.xml | 117 + .../LowercaseClassKeywordsStandard.xml | 23 + .../Classes/SelfMemberReferenceStandard.xml | 63 + .../DocCommentAlignmentStandard.xml | 39 + .../FunctionCommentThrowTagStandard.xml | 32 + .../ForEachLoopDeclarationStandard.xml | 39 + .../ForLoopDeclarationStandard.xml | 55 + .../LowercaseDeclarationStandard.xml | 23 + .../FunctionDuplicateArgumentStandard.xml | 23 + .../LowercaseFunctionKeywordsStandard.xml | 25 + .../Docs/Scope/StaticThisUsageStandard.xml | 31 + .../Docs/Strings/EchoedStringsStandard.xml | 19 + .../Docs/WhiteSpace/CastSpacingStandard.xml | 19 + .../FunctionClosingBraceSpaceStandard.xml | 73 + .../FunctionOpeningBraceStandard.xml | 41 + .../LanguageConstructSpacingStandard.xml | 19 + .../WhiteSpace/MemberVarSpacingStandard.xml | 91 + .../ObjectOperatorSpacingStandard.xml | 19 + .../WhiteSpace/ScopeClosingBraceStandard.xml | 59 + .../ScopeKeywordSpacingStandard.xml | 23 + .../WhiteSpace/SemicolonSpacingStandard.xml | 19 + .../SuperfluousWhitespaceStandard.xml | 98 + .../Arrays/ArrayBracketSpacingSniff.php | 95 + .../Sniffs/Arrays/ArrayDeclarationSniff.php | 942 +++ .../ClassDefinitionClosingBraceSpaceSniff.php | 136 + .../CSS/ClassDefinitionNameSpacingSniff.php | 113 + .../ClassDefinitionOpeningBraceSpaceSniff.php | 178 + .../Squiz/Sniffs/CSS/ColonSpacingSniff.php | 109 + .../Sniffs/CSS/ColourDefinitionSniff.php | 90 + .../DisallowMultipleStyleDefinitionsSniff.php | 73 + .../CSS/DuplicateClassDefinitionSniff.php | 118 + .../CSS/DuplicateStyleDefinitionSniff.php | 90 + .../Sniffs/CSS/EmptyClassDefinitionSniff.php | 63 + .../Sniffs/CSS/EmptyStyleDefinitionSniff.php | 66 + .../Squiz/Sniffs/CSS/ForbiddenStylesSniff.php | 179 + .../Squiz/Sniffs/CSS/IndentationSniff.php | 152 + .../CSS/LowercaseStyleDefinitionSniff.php | 99 + .../Squiz/Sniffs/CSS/MissingColonSniff.php | 93 + .../Squiz/Sniffs/CSS/NamedColoursSniff.php | 95 + .../Squiz/Sniffs/CSS/OpacitySniff.php | 103 + .../Sniffs/CSS/SemicolonSpacingSniff.php | 105 + .../Squiz/Sniffs/CSS/ShorthandSizeSniff.php | 183 + .../Sniffs/Classes/ClassDeclarationSniff.php | 207 + .../Sniffs/Classes/ClassFileNameSniff.php | 70 + .../Sniffs/Classes/DuplicatePropertySniff.php | 84 + .../Classes/LowercaseClassKeywordsSniff.php | 73 + .../Classes/SelfMemberReferenceSniff.php | 240 + .../Sniffs/Classes/ValidClassNameSniff.php | 87 + .../Sniffs/Commenting/BlockCommentSniff.php | 401 + .../Sniffs/Commenting/ClassCommentSniff.php | 109 + .../ClosingDeclarationCommentSniff.php | 130 + .../Commenting/DocCommentAlignmentSniff.php | 167 + .../Commenting/EmptyCatchCommentSniff.php | 55 + .../Sniffs/Commenting/FileCommentSniff.php | 228 + .../Commenting/FunctionCommentSniff.php | 800 ++ .../FunctionCommentThrowTagSniff.php | 233 + .../Sniffs/Commenting/InlineCommentSniff.php | 349 + .../LongConditionClosingCommentSniff.php | 218 + .../Commenting/PostStatementCommentSniff.php | 121 + .../Commenting/VariableCommentSniff.php | 201 + .../ControlSignatureSniff.php | 337 + .../ElseIfDeclarationSniff.php | 51 + .../ForEachLoopDeclarationSniff.php | 236 + .../ForLoopDeclarationSniff.php | 316 + .../InlineIfDeclarationSniff.php | 155 + .../LowercaseDeclarationSniff.php | 75 + .../SwitchDeclarationSniff.php | 304 + .../Squiz/Sniffs/Debug/JSLintSniff.php | 88 + .../Sniffs/Debug/JavaScriptLintSniff.php | 91 + .../Squiz/Sniffs/Files/FileExtensionSniff.php | 68 + .../Formatting/OperatorBracketSniff.php | 395 + ...unctionDeclarationArgumentSpacingSniff.php | 398 + .../Functions/FunctionDeclarationSniff.php | 34 + .../FunctionDuplicateArgumentSniff.php | 64 + .../Sniffs/Functions/GlobalFunctionSniff.php | 61 + .../LowercaseFunctionKeywordsSniff.php | 69 + .../MultiLineFunctionDeclarationSniff.php | 257 + .../ValidFunctionNameSniff.php | 54 + .../ValidVariableNameSniff.php | 190 + .../DisallowObjectStringIndexSniff.php | 87 + .../Objects/ObjectInstantiationSniff.php | 85 + .../Sniffs/Objects/ObjectMemberCommaSniff.php | 66 + .../ComparisonOperatorUsageSniff.php | 235 + .../IncrementDecrementUsageSniff.php | 231 + .../Operators/ValidLogicalOperatorsSniff.php | 67 + .../Sniffs/PHP/CommentedOutCodeSniff.php | 283 + .../PHP/DisallowBooleanStatementSniff.php | 59 + .../PHP/DisallowComparisonAssignmentSniff.php | 112 + .../Sniffs/PHP/DisallowInlineIfSniff.php | 57 + .../PHP/DisallowMultipleAssignmentsSniff.php | 190 + .../PHP/DisallowSizeFunctionsInLoopsSniff.php | 116 + .../Sniffs/PHP/DiscouragedFunctionsSniff.php | 38 + .../Squiz/Sniffs/PHP/EmbeddedPhpSniff.php | 512 ++ .../Standards/Squiz/Sniffs/PHP/EvalSniff.php | 48 + .../Squiz/Sniffs/PHP/GlobalKeywordSniff.php | 53 + .../Squiz/Sniffs/PHP/HeredocSniff.php | 51 + .../Squiz/Sniffs/PHP/InnerFunctionsSniff.php | 76 + .../Sniffs/PHP/LowercasePHPFunctionsSniff.php | 167 + .../Sniffs/PHP/NonExecutableCodeSniff.php | 303 + .../Sniffs/Scope/MemberVarScopeSniff.php | 77 + .../Squiz/Sniffs/Scope/MethodScopeSniff.php | 83 + .../Sniffs/Scope/StaticThisUsageSniff.php | 128 + .../Strings/ConcatenationSpacingSniff.php | 164 + .../Sniffs/Strings/DoubleQuoteUsageSniff.php | 144 + .../Sniffs/Strings/EchoedStringsSniff.php | 88 + .../Sniffs/WhiteSpace/CastSpacingSniff.php | 65 + .../ControlStructureSpacingSniff.php | 359 + .../FunctionClosingBraceSpaceSniff.php | 164 + .../FunctionOpeningBraceSpaceSniff.php | 98 + .../WhiteSpace/FunctionSpacingSniff.php | 366 + .../LanguageConstructSpacingSniff.php | 91 + .../LogicalOperatorSpacingSniff.php | 102 + .../WhiteSpace/MemberVarSpacingSniff.php | 252 + .../WhiteSpace/ObjectOperatorSpacingSniff.php | 167 + .../WhiteSpace/OperatorSpacingSniff.php | 409 + .../WhiteSpace/PropertyLabelSpacingSniff.php | 81 + .../WhiteSpace/ScopeClosingBraceSniff.php | 114 + .../WhiteSpace/ScopeKeywordSpacingSniff.php | 172 + .../WhiteSpace/SemicolonSpacingSniff.php | 116 + .../WhiteSpace/SuperfluousWhitespaceSniff.php | 265 + .../Arrays/ArrayBracketSpacingUnitTest.inc | 31 + .../ArrayBracketSpacingUnitTest.inc.fixed | 31 + .../Arrays/ArrayBracketSpacingUnitTest.php | 62 + .../Arrays/ArrayDeclarationUnitTest.1.inc | 549 ++ .../ArrayDeclarationUnitTest.1.inc.fixed | 588 ++ .../Arrays/ArrayDeclarationUnitTest.2.inc | 538 ++ .../ArrayDeclarationUnitTest.2.inc.fixed | 575 ++ .../Tests/Arrays/ArrayDeclarationUnitTest.php | 255 + ...assDefinitionClosingBraceSpaceUnitTest.css | 81 + ...initionClosingBraceSpaceUnitTest.css.fixed | 85 + ...assDefinitionClosingBraceSpaceUnitTest.php | 65 + .../ClassDefinitionNameSpacingUnitTest.css | 66 + .../ClassDefinitionNameSpacingUnitTest.php | 56 + ...assDefinitionOpeningBraceSpaceUnitTest.css | 108 + ...initionOpeningBraceSpaceUnitTest.css.fixed | 106 + ...assDefinitionOpeningBraceSpaceUnitTest.php | 69 + .../Squiz/Tests/CSS/ColonSpacingUnitTest.css | 42 + .../Tests/CSS/ColonSpacingUnitTest.css.fixed | 40 + .../Squiz/Tests/CSS/ColonSpacingUnitTest.php | 65 + .../Tests/CSS/ColourDefinitionUnitTest.css | 16 + .../CSS/ColourDefinitionUnitTest.css.fixed | 16 + .../Tests/CSS/ColourDefinitionUnitTest.php | 57 + ...sallowMultipleStyleDefinitionsUnitTest.css | 17 + ...MultipleStyleDefinitionsUnitTest.css.fixed | 27 + ...sallowMultipleStyleDefinitionsUnitTest.php | 59 + .../CSS/DuplicateClassDefinitionUnitTest.css | 103 + .../CSS/DuplicateClassDefinitionUnitTest.php | 59 + .../CSS/DuplicateStyleDefinitionUnitTest.css | 27 + .../CSS/DuplicateStyleDefinitionUnitTest.php | 53 + .../CSS/EmptyClassDefinitionUnitTest.css | 15 + .../CSS/EmptyClassDefinitionUnitTest.php | 59 + .../CSS/EmptyStyleDefinitionUnitTest.css | 11 + .../CSS/EmptyStyleDefinitionUnitTest.php | 58 + .../Tests/CSS/ForbiddenStylesUnitTest.css | 18 + .../CSS/ForbiddenStylesUnitTest.css.fixed | 18 + .../Tests/CSS/ForbiddenStylesUnitTest.php | 62 + .../Squiz/Tests/CSS/IndentationUnitTest.1.css | 79 + .../Tests/CSS/IndentationUnitTest.1.css.fixed | 73 + .../Squiz/Tests/CSS/IndentationUnitTest.2.css | 3 + .../Squiz/Tests/CSS/IndentationUnitTest.php | 80 + .../CSS/LowercaseStyleDefinitionUnitTest.css | 14 + .../CSS/LowercaseStyleDefinitionUnitTest.php | 58 + .../Squiz/Tests/CSS/MissingColonUnitTest.css | 21 + .../Squiz/Tests/CSS/MissingColonUnitTest.php | 58 + .../Squiz/Tests/CSS/NamedColoursUnitTest.css | 25 + .../Squiz/Tests/CSS/NamedColoursUnitTest.php | 59 + .../Squiz/Tests/CSS/OpacityUnitTest.css | 35 + .../Squiz/Tests/CSS/OpacityUnitTest.css.fixed | 35 + .../Squiz/Tests/CSS/OpacityUnitTest.php | 65 + .../Tests/CSS/SemicolonSpacingUnitTest.css | 61 + .../CSS/SemicolonSpacingUnitTest.css.fixed | 58 + .../Tests/CSS/SemicolonSpacingUnitTest.php | 63 + .../Tests/CSS/ShorthandSizeUnitTest.1.css | 41 + .../CSS/ShorthandSizeUnitTest.1.css.fixed | 37 + .../Tests/CSS/ShorthandSizeUnitTest.2.css | 3 + .../Squiz/Tests/CSS/ShorthandSizeUnitTest.php | 72 + .../Classes/ClassDeclarationUnitTest.inc | 130 + .../ClassDeclarationUnitTest.inc.fixed | 140 + .../Classes/ClassDeclarationUnitTest.php | 91 + .../Tests/Classes/ClassFileNameUnitTest.inc | 45 + .../Tests/Classes/ClassFileNameUnitTest.php | 82 + .../Classes/DuplicatePropertyUnitTest.js | 45 + .../Classes/DuplicatePropertyUnitTest.php | 57 + .../LowercaseClassKeywordsUnitTest.inc | 16 + .../LowercaseClassKeywordsUnitTest.inc.fixed | 16 + .../LowercaseClassKeywordsUnitTest.php | 66 + .../Classes/SelfMemberReferenceUnitTest.inc | 185 + .../SelfMemberReferenceUnitTest.inc.fixed | 173 + .../Classes/SelfMemberReferenceUnitTest.php | 70 + .../Tests/Classes/ValidClassNameUnitTest.inc | 191 + .../Tests/Classes/ValidClassNameUnitTest.php | 80 + .../Tests/Commenting/BlockCommentUnitTest.inc | 309 + .../Commenting/BlockCommentUnitTest.inc.fixed | 311 + .../Tests/Commenting/BlockCommentUnitTest.php | 109 + .../Tests/Commenting/ClassCommentUnitTest.inc | 145 + .../Tests/Commenting/ClassCommentUnitTest.php | 66 + .../ClosingDeclarationCommentUnitTest.1.inc | 124 + ...singDeclarationCommentUnitTest.1.inc.fixed | 117 + .../ClosingDeclarationCommentUnitTest.2.inc | 7 + .../ClosingDeclarationCommentUnitTest.3.inc | 7 + .../ClosingDeclarationCommentUnitTest.4.inc | 8 + ...singDeclarationCommentUnitTest.4.inc.fixed | 8 + .../ClosingDeclarationCommentUnitTest.5.inc | 11 + ...singDeclarationCommentUnitTest.5.inc.fixed | 11 + .../ClosingDeclarationCommentUnitTest.php | 96 + .../DocCommentAlignmentUnitTest.inc | 103 + .../DocCommentAlignmentUnitTest.inc.fixed | 103 + .../Commenting/DocCommentAlignmentUnitTest.js | 76 + .../DocCommentAlignmentUnitTest.js.fixed | 76 + .../DocCommentAlignmentUnitTest.php | 81 + .../Commenting/EmptyCatchCommentUnitTest.inc | 55 + .../Commenting/EmptyCatchCommentUnitTest.php | 60 + .../Commenting/FileCommentUnitTest.1.inc | 43 + .../FileCommentUnitTest.1.inc.fixed | 43 + .../Tests/Commenting/FileCommentUnitTest.1.js | 40 + .../Commenting/FileCommentUnitTest.1.js.fixed | 40 + .../Commenting/FileCommentUnitTest.10.inc | 12 + .../Commenting/FileCommentUnitTest.2.inc | 11 + .../Tests/Commenting/FileCommentUnitTest.2.js | 10 + .../Commenting/FileCommentUnitTest.3.inc | 9 + .../Commenting/FileCommentUnitTest.4.inc | 3 + .../Commenting/FileCommentUnitTest.5.inc | 4 + .../Commenting/FileCommentUnitTest.6.inc | 12 + .../Commenting/FileCommentUnitTest.7.inc | 12 + .../Commenting/FileCommentUnitTest.8.inc | 9 + .../Commenting/FileCommentUnitTest.9.inc | 12 + .../Tests/Commenting/FileCommentUnitTest.php | 82 + .../FunctionCommentThrowTagUnitTest.inc | 511 ++ .../FunctionCommentThrowTagUnitTest.php | 65 + .../Commenting/FunctionCommentUnitTest.inc | 1160 +++ .../FunctionCommentUnitTest.inc.fixed | 1160 +++ .../Commenting/FunctionCommentUnitTest.php | 208 + .../Commenting/InlineCommentUnitTest.inc | 196 + .../InlineCommentUnitTest.inc.fixed | 189 + .../Tests/Commenting/InlineCommentUnitTest.js | 129 + .../Commenting/InlineCommentUnitTest.js.fixed | 125 + .../Commenting/InlineCommentUnitTest.php | 96 + .../LongConditionClosingCommentUnitTest.inc | 1033 +++ ...gConditionClosingCommentUnitTest.inc.fixed | 1033 +++ .../LongConditionClosingCommentUnitTest.js | 444 + ...ngConditionClosingCommentUnitTest.js.fixed | 444 + .../LongConditionClosingCommentUnitTest.php | 107 + .../PostStatementCommentUnitTest.1.js | 36 + .../PostStatementCommentUnitTest.1.js.fixed | 39 + .../PostStatementCommentUnitTest.2.js | 2 + .../PostStatementCommentUnitTest.inc | 54 + .../PostStatementCommentUnitTest.inc.fixed | 59 + .../PostStatementCommentUnitTest.php | 74 + .../Commenting/VariableCommentUnitTest.inc | 456 + .../VariableCommentUnitTest.inc.fixed | 456 + .../Commenting/VariableCommentUnitTest.php | 88 + .../ControlSignatureUnitTest.1.inc | 320 + .../ControlSignatureUnitTest.1.inc.fixed | 324 + .../ControlSignatureUnitTest.2.inc | 5 + .../ControlSignatureUnitTest.js | 135 + .../ControlSignatureUnitTest.js.fixed | 141 + .../ControlSignatureUnitTest.php | 115 + .../ElseIfDeclarationUnitTest.inc | 14 + .../ElseIfDeclarationUnitTest.inc.fixed | 14 + .../ElseIfDeclarationUnitTest.php | 56 + .../ForEachLoopDeclarationUnitTest.inc | 36 + .../ForEachLoopDeclarationUnitTest.inc.fixed | 36 + .../ForEachLoopDeclarationUnitTest.php | 61 + .../ForLoopDeclarationUnitTest.1.inc | 126 + .../ForLoopDeclarationUnitTest.1.inc.fixed | 92 + .../ForLoopDeclarationUnitTest.1.js | 122 + .../ForLoopDeclarationUnitTest.1.js.fixed | 88 + .../ForLoopDeclarationUnitTest.2.inc | 6 + .../ForLoopDeclarationUnitTest.2.js | 2 + .../ForLoopDeclarationUnitTest.3.inc | 6 + .../ForLoopDeclarationUnitTest.php | 138 + .../InlineIfDeclarationUnitTest.inc | 48 + .../InlineIfDeclarationUnitTest.inc.fixed | 48 + .../InlineIfDeclarationUnitTest.php | 80 + .../LowercaseDeclarationUnitTest.inc | 24 + .../LowercaseDeclarationUnitTest.inc.fixed | 24 + .../LowercaseDeclarationUnitTest.php | 66 + .../SwitchDeclarationUnitTest.inc | 333 + .../SwitchDeclarationUnitTest.inc.fixed | 342 + .../SwitchDeclarationUnitTest.js | 287 + .../SwitchDeclarationUnitTest.php | 157 + .../Squiz/Tests/Debug/JSLintUnitTest.js | 2 + .../Squiz/Tests/Debug/JSLintUnitTest.php | 74 + .../Tests/Debug/JavaScriptLintUnitTest.js | 2 + .../Tests/Debug/JavaScriptLintUnitTest.php | 71 + .../Tests/Files/FileExtensionUnitTest.1.inc | 3 + .../Tests/Files/FileExtensionUnitTest.2.inc | 3 + .../Tests/Files/FileExtensionUnitTest.3.inc | 3 + .../Tests/Files/FileExtensionUnitTest.4.inc | 3 + .../Tests/Files/FileExtensionUnitTest.5.inc | 3 + .../Tests/Files/FileExtensionUnitTest.php | 60 + .../Formatting/OperatorBracketUnitTest.inc | 203 + .../OperatorBracketUnitTest.inc.fixed | 203 + .../Formatting/OperatorBracketUnitTest.js | 118 + .../OperatorBracketUnitTest.js.fixed | 118 + .../Formatting/OperatorBracketUnitTest.php | 121 + ...tionDeclarationArgumentSpacingUnitTest.inc | 111 + ...clarationArgumentSpacingUnitTest.inc.fixed | 111 + ...tionDeclarationArgumentSpacingUnitTest.php | 91 + .../Functions/FunctionDeclarationUnitTest.inc | 75 + .../Functions/FunctionDeclarationUnitTest.php | 56 + .../FunctionDuplicateArgumentUnitTest.inc | 6 + .../FunctionDuplicateArgumentUnitTest.php | 57 + .../Functions/GlobalFunctionUnitTest.inc | 17 + .../Functions/GlobalFunctionUnitTest.php | 53 + .../LowercaseFunctionKeywordsUnitTest.inc | 28 + ...owercaseFunctionKeywordsUnitTest.inc.fixed | 28 + .../LowercaseFunctionKeywordsUnitTest.php | 63 + .../MultiLineFunctionDeclarationUnitTest.inc | 304 + ...iLineFunctionDeclarationUnitTest.inc.fixed | 316 + .../MultiLineFunctionDeclarationUnitTest.js | 73 + ...tiLineFunctionDeclarationUnitTest.js.fixed | 81 + .../MultiLineFunctionDeclarationUnitTest.php | 118 + .../ValidFunctionNameUnitTest.inc | 27 + .../ValidFunctionNameUnitTest.php | 64 + .../ValidVariableNameUnitTest.inc | 157 + .../ValidVariableNameUnitTest.php | 93 + .../DisallowObjectStringIndexUnitTest.js | 37 + .../DisallowObjectStringIndexUnitTest.php | 64 + .../Objects/ObjectInstantiationUnitTest.inc | 49 + .../Objects/ObjectInstantiationUnitTest.php | 58 + .../Objects/ObjectMemberCommaUnitTest.js | 47 + .../ObjectMemberCommaUnitTest.js.fixed | 47 + .../Objects/ObjectMemberCommaUnitTest.php | 58 + .../ComparisonOperatorUsageUnitTest.inc | 138 + .../ComparisonOperatorUsageUnitTest.js | 71 + .../ComparisonOperatorUsageUnitTest.php | 105 + .../IncrementDecrementUsageUnitTest.inc | 56 + .../IncrementDecrementUsageUnitTest.php | 73 + .../ValidLogicalOperatorsUnitTest.inc | 28 + .../ValidLogicalOperatorsUnitTest.php | 57 + .../Tests/PHP/CommentedOutCodeUnitTest.css | 23 + .../Tests/PHP/CommentedOutCodeUnitTest.inc | 158 + .../Tests/PHP/CommentedOutCodeUnitTest.php | 80 + .../PHP/DisallowBooleanStatementUnitTest.inc | 27 + .../PHP/DisallowBooleanStatementUnitTest.php | 58 + .../DisallowComparisonAssignmentUnitTest.inc | 83 + .../DisallowComparisonAssignmentUnitTest.php | 64 + .../Tests/PHP/DisallowInlineIfUnitTest.inc | 18 + .../Tests/PHP/DisallowInlineIfUnitTest.js | 2 + .../Tests/PHP/DisallowInlineIfUnitTest.php | 67 + .../DisallowMultipleAssignmentsUnitTest.1.inc | 136 + .../DisallowMultipleAssignmentsUnitTest.2.inc | 7 + .../DisallowMultipleAssignmentsUnitTest.php | 71 + .../DisallowSizeFunctionsInLoopsUnitTest.inc | 58 + .../DisallowSizeFunctionsInLoopsUnitTest.js | 13 + .../DisallowSizeFunctionsInLoopsUnitTest.php | 77 + .../PHP/DiscouragedFunctionsUnitTest.inc | 7 + .../PHP/DiscouragedFunctionsUnitTest.php | 57 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc | 271 + .../Tests/PHP/EmbeddedPhpUnitTest.1.inc.fixed | 283 + .../Tests/PHP/EmbeddedPhpUnitTest.10.inc | 16 + .../Tests/PHP/EmbeddedPhpUnitTest.11.inc | 14 + .../Tests/PHP/EmbeddedPhpUnitTest.12.inc | 12 + .../PHP/EmbeddedPhpUnitTest.12.inc.fixed | 10 + .../Tests/PHP/EmbeddedPhpUnitTest.13.inc | 12 + .../PHP/EmbeddedPhpUnitTest.13.inc.fixed | 10 + .../Tests/PHP/EmbeddedPhpUnitTest.14.inc | 8 + .../Tests/PHP/EmbeddedPhpUnitTest.15.inc | 9 + .../Tests/PHP/EmbeddedPhpUnitTest.16.inc | 8 + .../Tests/PHP/EmbeddedPhpUnitTest.17.inc | 8 + .../Tests/PHP/EmbeddedPhpUnitTest.18.inc | 15 + .../PHP/EmbeddedPhpUnitTest.18.inc.fixed | 13 + .../Tests/PHP/EmbeddedPhpUnitTest.19.inc | 17 + .../PHP/EmbeddedPhpUnitTest.19.inc.fixed | 15 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc | 7 + .../Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed | 7 + .../Tests/PHP/EmbeddedPhpUnitTest.20.inc | 15 + .../PHP/EmbeddedPhpUnitTest.20.inc.fixed | 16 + .../Tests/PHP/EmbeddedPhpUnitTest.21.inc | 15 + .../PHP/EmbeddedPhpUnitTest.21.inc.fixed | 16 + .../Tests/PHP/EmbeddedPhpUnitTest.22.inc | 30 + .../PHP/EmbeddedPhpUnitTest.22.inc.fixed | 31 + .../Tests/PHP/EmbeddedPhpUnitTest.23.inc | 23 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc | 123 + .../Tests/PHP/EmbeddedPhpUnitTest.3.inc.fixed | 132 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc | 7 + .../Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed | 7 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc | 48 + .../Tests/PHP/EmbeddedPhpUnitTest.5.inc.fixed | 39 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.6.inc | 8 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.7.inc | 8 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.8.inc | 10 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.9.inc | 10 + .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.php | 215 + .../Squiz/Tests/PHP/EvalUnitTest.inc | 5 + .../Squiz/Tests/PHP/EvalUnitTest.php | 56 + .../Squiz/Tests/PHP/GlobalKeywordUnitTest.inc | 13 + .../Squiz/Tests/PHP/GlobalKeywordUnitTest.php | 56 + .../Squiz/Tests/PHP/HeredocUnitTest.1.inc | 12 + .../Squiz/Tests/PHP/HeredocUnitTest.2.inc | 17 + .../Squiz/Tests/PHP/HeredocUnitTest.php | 64 + .../Tests/PHP/InnerFunctionsUnitTest.inc | 87 + .../Tests/PHP/InnerFunctionsUnitTest.php | 58 + .../PHP/LowercasePHPFunctionsUnitTest.inc | 50 + .../LowercasePHPFunctionsUnitTest.inc.fixed | 50 + .../PHP/LowercasePHPFunctionsUnitTest.php | 60 + .../Tests/PHP/NonExecutableCodeUnitTest.1.inc | 420 + .../Tests/PHP/NonExecutableCodeUnitTest.2.inc | 73 + .../Tests/PHP/NonExecutableCodeUnitTest.3.inc | 64 + .../Tests/PHP/NonExecutableCodeUnitTest.4.inc | 6 + .../Tests/PHP/NonExecutableCodeUnitTest.php | 124 + .../Tests/Scope/MemberVarScopeUnitTest.inc | 72 + .../Tests/Scope/MemberVarScopeUnitTest.php | 63 + .../Squiz/Tests/Scope/MethodScopeUnitTest.inc | 57 + .../Squiz/Tests/Scope/MethodScopeUnitTest.php | 58 + .../Tests/Scope/StaticThisUsageUnitTest.inc | 127 + .../Tests/Scope/StaticThisUsageUnitTest.php | 67 + .../Strings/ConcatenationSpacingUnitTest.inc | 49 + .../ConcatenationSpacingUnitTest.inc.fixed | 47 + .../Strings/ConcatenationSpacingUnitTest.php | 71 + .../Strings/DoubleQuoteUsageUnitTest.inc | 37 + .../DoubleQuoteUsageUnitTest.inc.fixed | 37 + .../Strings/DoubleQuoteUsageUnitTest.php | 67 + .../Tests/Strings/EchoedStringsUnitTest.inc | 13 + .../Strings/EchoedStringsUnitTest.inc.fixed | 13 + .../Tests/Strings/EchoedStringsUnitTest.php | 60 + .../Tests/WhiteSpace/CastSpacingUnitTest.inc | 9 + .../WhiteSpace/CastSpacingUnitTest.inc.fixed | 9 + .../Tests/WhiteSpace/CastSpacingUnitTest.php | 59 + .../ControlStructureSpacingUnitTest.inc | 269 + .../ControlStructureSpacingUnitTest.inc.fixed | 261 + .../ControlStructureSpacingUnitTest.js | 93 + .../ControlStructureSpacingUnitTest.js.fixed | 93 + .../ControlStructureSpacingUnitTest.php | 107 + .../FunctionClosingBraceSpaceUnitTest.inc | 39 + ...unctionClosingBraceSpaceUnitTest.inc.fixed | 45 + .../FunctionClosingBraceSpaceUnitTest.js | 132 + ...FunctionClosingBraceSpaceUnitTest.js.fixed | 133 + .../FunctionClosingBraceSpaceUnitTest.php | 80 + .../FunctionOpeningBraceSpaceUnitTest.inc | 54 + ...unctionOpeningBraceSpaceUnitTest.inc.fixed | 49 + .../FunctionOpeningBraceSpaceUnitTest.js | 115 + ...FunctionOpeningBraceSpaceUnitTest.js.fixed | 109 + .../FunctionOpeningBraceSpaceUnitTest.php | 73 + .../WhiteSpace/FunctionSpacingUnitTest.1.inc | 584 ++ .../FunctionSpacingUnitTest.1.inc.fixed | 673 ++ .../WhiteSpace/FunctionSpacingUnitTest.2.inc | 5 + .../FunctionSpacingUnitTest.2.inc.fixed | 7 + .../WhiteSpace/FunctionSpacingUnitTest.3.inc | 10 + .../FunctionSpacingUnitTest.3.inc.fixed | 7 + .../WhiteSpace/FunctionSpacingUnitTest.4.inc | 7 + .../WhiteSpace/FunctionSpacingUnitTest.5.inc | 8 + .../FunctionSpacingUnitTest.5.inc.fixed | 10 + .../WhiteSpace/FunctionSpacingUnitTest.6.inc | 13 + .../FunctionSpacingUnitTest.6.inc.fixed | 10 + .../WhiteSpace/FunctionSpacingUnitTest.7.inc | 10 + .../WhiteSpace/FunctionSpacingUnitTest.php | 141 + .../LanguageConstructSpacingUnitTest.inc | 43 + ...LanguageConstructSpacingUnitTest.inc.fixed | 41 + .../LanguageConstructSpacingUnitTest.php | 65 + .../LogicalOperatorSpacingUnitTest.inc | 19 + .../LogicalOperatorSpacingUnitTest.inc.fixed | 19 + .../LogicalOperatorSpacingUnitTest.js | 19 + .../LogicalOperatorSpacingUnitTest.js.fixed | 19 + .../LogicalOperatorSpacingUnitTest.php | 59 + .../WhiteSpace/MemberVarSpacingUnitTest.inc | 374 + .../MemberVarSpacingUnitTest.inc.fixed | 359 + .../WhiteSpace/MemberVarSpacingUnitTest.php | 90 + .../ObjectOperatorSpacingUnitTest.inc | 52 + .../ObjectOperatorSpacingUnitTest.inc.fixed | 48 + .../ObjectOperatorSpacingUnitTest.php | 73 + .../WhiteSpace/OperatorSpacingUnitTest.1.inc | 510 ++ .../OperatorSpacingUnitTest.1.inc.fixed | 502 ++ .../WhiteSpace/OperatorSpacingUnitTest.2.inc | 3 + .../WhiteSpace/OperatorSpacingUnitTest.3.inc | 6 + .../WhiteSpace/OperatorSpacingUnitTest.js | 104 + .../OperatorSpacingUnitTest.js.fixed | 98 + .../WhiteSpace/OperatorSpacingUnitTest.php | 180 + .../PropertyLabelSpacingUnitTest.js | 40 + .../PropertyLabelSpacingUnitTest.js.fixed | 39 + .../PropertyLabelSpacingUnitTest.php | 60 + .../WhiteSpace/ScopeClosingBraceUnitTest.inc | 134 + .../ScopeClosingBraceUnitTest.inc.fixed | 138 + .../WhiteSpace/ScopeClosingBraceUnitTest.php | 64 + .../ScopeKeywordSpacingUnitTest.1.inc | 149 + .../ScopeKeywordSpacingUnitTest.1.inc.fixed | 143 + .../ScopeKeywordSpacingUnitTest.2.inc | 6 + .../ScopeKeywordSpacingUnitTest.3.inc | 6 + .../ScopeKeywordSpacingUnitTest.3.inc.fixed | 6 + .../ScopeKeywordSpacingUnitTest.php | 88 + .../WhiteSpace/SemicolonSpacingUnitTest.inc | 42 + .../SemicolonSpacingUnitTest.inc.fixed | 41 + .../WhiteSpace/SemicolonSpacingUnitTest.js | 25 + .../SemicolonSpacingUnitTest.js.fixed | 25 + .../WhiteSpace/SemicolonSpacingUnitTest.php | 87 + .../SuperfluousWhitespaceUnitTest.1.css | 32 + .../SuperfluousWhitespaceUnitTest.1.css.fixed | 30 + .../SuperfluousWhitespaceUnitTest.1.inc | 74 + .../SuperfluousWhitespaceUnitTest.1.inc.fixed | 68 + .../SuperfluousWhitespaceUnitTest.1.js | 56 + .../SuperfluousWhitespaceUnitTest.1.js.fixed | 50 + .../SuperfluousWhitespaceUnitTest.2.css | 3 + .../SuperfluousWhitespaceUnitTest.2.css.fixed | 3 + .../SuperfluousWhitespaceUnitTest.2.inc | 9 + .../SuperfluousWhitespaceUnitTest.2.inc.fixed | 7 + .../SuperfluousWhitespaceUnitTest.2.js | 1 + .../SuperfluousWhitespaceUnitTest.2.js.fixed | 1 + .../SuperfluousWhitespaceUnitTest.3.css | 3 + .../SuperfluousWhitespaceUnitTest.3.css.fixed | 3 + .../SuperfluousWhitespaceUnitTest.3.inc | 14 + .../SuperfluousWhitespaceUnitTest.3.inc.fixed | 5 + .../SuperfluousWhitespaceUnitTest.3.js | 1 + .../SuperfluousWhitespaceUnitTest.3.js.fixed | 1 + .../SuperfluousWhitespaceUnitTest.4.inc | 4 + .../SuperfluousWhitespaceUnitTest.4.inc.fixed | 4 + .../SuperfluousWhitespaceUnitTest.5.inc | 5 + .../SuperfluousWhitespaceUnitTest.5.inc.fixed | 4 + .../SuperfluousWhitespaceUnitTest.php | 117 + .../src/Standards/Squiz/ruleset.xml | 132 + .../Zend/Docs/Debug/CodeAnalyzerStandard.xml | 25 + .../Zend/Docs/Files/ClosingTagStandard.xml | 22 + .../ValidVariableNameStandard.xml | 37 + .../Zend/Sniffs/Debug/CodeAnalyzerSniff.php | 100 + .../Zend/Sniffs/Files/ClosingTagSniff.php | 79 + .../ValidVariableNameSniff.php | 196 + .../Zend/Tests/Debug/CodeAnalyzerUnitTest.inc | 6 + .../Zend/Tests/Debug/CodeAnalyzerUnitTest.php | 71 + .../Zend/Tests/Files/ClosingTagUnitTest.1.inc | 12 + .../Files/ClosingTagUnitTest.1.inc.fixed | 12 + .../Zend/Tests/Files/ClosingTagUnitTest.2.inc | 3 + .../Zend/Tests/Files/ClosingTagUnitTest.3.inc | 1 + .../Files/ClosingTagUnitTest.3.inc.fixed | 1 + .../Zend/Tests/Files/ClosingTagUnitTest.4.inc | 1 + .../Files/ClosingTagUnitTest.4.inc.fixed | 1 + .../Zend/Tests/Files/ClosingTagUnitTest.5.inc | 1 + .../Files/ClosingTagUnitTest.5.inc.fixed | 1 + .../Zend/Tests/Files/ClosingTagUnitTest.6.inc | 3 + .../Files/ClosingTagUnitTest.6.inc.fixed | 3 + .../Zend/Tests/Files/ClosingTagUnitTest.7.inc | 1 + .../Files/ClosingTagUnitTest.7.inc.fixed | 1 + .../Zend/Tests/Files/ClosingTagUnitTest.php | 70 + .../ValidVariableNameUnitTest.inc | 131 + .../ValidVariableNameUnitTest.php | 102 + .../src/Standards/Zend/ruleset.xml | 32 + .../php_codesniffer/src/Tokenizers/CSS.php | 541 ++ .../src/Tokenizers/Comment.php | 283 + .../php_codesniffer/src/Tokenizers/JS.php | 1256 +++ .../php_codesniffer/src/Tokenizers/PHP.php | 3875 +++++++++ .../src/Tokenizers/Tokenizer.php | 1735 ++++ .../php_codesniffer/src/Util/Cache.php | 355 + .../php_codesniffer/src/Util/Common.php | 586 ++ .../php_codesniffer/src/Util/Help.php | 626 ++ .../php_codesniffer/src/Util/Standards.php | 340 + .../php_codesniffer/src/Util/Timing.php | 119 + .../php_codesniffer/src/Util/Tokens.php | 812 ++ trunk/vendor/symfony/console/Application.php | 1301 +++ .../symfony/console/Attribute/AsCommand.php | 39 + trunk/vendor/symfony/console/CHANGELOG.md | 217 + .../console/CI/GithubActionReporter.php | 99 + trunk/vendor/symfony/console/Color.php | 180 + .../symfony/console/Command/Command.php | 710 ++ .../console/Command/CompleteCommand.php | 205 + .../console/Command/DumpCompletionCommand.php | 145 + .../symfony/console/Command/HelpCommand.php | 101 + .../symfony/console/Command/LazyCommand.php | 218 + .../symfony/console/Command/ListCommand.php | 95 + .../symfony/console/Command/LockableTrait.php | 69 + .../Command/SignalableCommandInterface.php | 30 + .../CommandLoader/CommandLoaderInterface.php | 42 + .../CommandLoader/ContainerCommandLoader.php | 63 + .../CommandLoader/FactoryCommandLoader.php | 62 + .../console/Completion/CompletionInput.php | 249 + .../Completion/CompletionSuggestions.php | 99 + .../Output/BashCompletionOutput.php | 33 + .../Output/CompletionOutputInterface.php | 25 + .../symfony/console/Completion/Suggestion.php | 37 + .../vendor/symfony/console/ConsoleEvents.php | 72 + trunk/vendor/symfony/console/Cursor.php | 207 + .../AddConsoleCommandPass.php | 148 + .../Descriptor/ApplicationDescription.php | 143 + .../symfony/console/Descriptor/Descriptor.php | 94 + .../Descriptor/DescriptorInterface.php | 24 + .../console/Descriptor/JsonDescriptor.php | 181 + .../console/Descriptor/MarkdownDescriptor.php | 206 + .../console/Descriptor/TextDescriptor.php | 341 + .../console/Descriptor/XmlDescriptor.php | 247 + .../console/Event/ConsoleCommandEvent.php | 54 + .../console/Event/ConsoleErrorEvent.php | 58 + .../symfony/console/Event/ConsoleEvent.php | 67 + .../console/Event/ConsoleSignalEvent.php | 35 + .../console/Event/ConsoleTerminateEvent.php | 43 + .../console/EventListener/ErrorListener.php | 95 + .../Exception/CommandNotFoundException.php | 43 + .../console/Exception/ExceptionInterface.php | 21 + .../Exception/InvalidArgumentException.php | 19 + .../Exception/InvalidOptionException.php | 21 + .../console/Exception/LogicException.php | 19 + .../Exception/MissingInputException.php | 21 + .../Exception/NamespaceNotFoundException.php | 21 + .../console/Exception/RuntimeException.php | 19 + .../console/Formatter/NullOutputFormatter.php | 69 + .../Formatter/NullOutputFormatterStyle.php | 66 + .../console/Formatter/OutputFormatter.php | 294 + .../Formatter/OutputFormatterInterface.php | 60 + .../Formatter/OutputFormatterStyle.php | 109 + .../OutputFormatterStyleInterface.php | 52 + .../Formatter/OutputFormatterStyleStack.php | 110 + .../WrappableOutputFormatterInterface.php | 25 + .../console/Helper/DebugFormatterHelper.php | 107 + .../console/Helper/DescriptorHelper.php | 92 + .../vendor/symfony/console/Helper/Dumper.php | 64 + .../console/Helper/FormatterHelper.php | 92 + .../vendor/symfony/console/Helper/Helper.php | 180 + .../console/Helper/HelperInterface.php | 39 + .../symfony/console/Helper/HelperSet.php | 108 + .../console/Helper/InputAwareHelper.php | 33 + .../symfony/console/Helper/ProcessHelper.php | 144 + .../symfony/console/Helper/ProgressBar.php | 612 ++ .../console/Helper/ProgressIndicator.php | 247 + .../symfony/console/Helper/QuestionHelper.php | 613 ++ .../console/Helper/SymfonyQuestionHelper.php | 109 + trunk/vendor/symfony/console/Helper/Table.php | 917 ++ .../symfony/console/Helper/TableCell.php | 78 + .../symfony/console/Helper/TableCellStyle.php | 89 + .../symfony/console/Helper/TableRows.php | 30 + .../symfony/console/Helper/TableSeparator.php | 25 + .../symfony/console/Helper/TableStyle.php | 376 + .../symfony/console/Input/ArgvInput.php | 378 + .../symfony/console/Input/ArrayInput.php | 210 + trunk/vendor/symfony/console/Input/Input.php | 213 + .../symfony/console/Input/InputArgument.php | 129 + .../console/Input/InputAwareInterface.php | 26 + .../symfony/console/Input/InputDefinition.php | 424 + .../symfony/console/Input/InputInterface.php | 151 + .../symfony/console/Input/InputOption.php | 231 + .../Input/StreamableInputInterface.php | 37 + .../symfony/console/Input/StringInput.php | 84 + trunk/vendor/symfony/console/LICENSE | 19 + .../symfony/console/Logger/ConsoleLogger.php | 126 + .../symfony/console/Output/BufferedOutput.php | 45 + .../symfony/console/Output/ConsoleOutput.php | 172 + .../console/Output/ConsoleOutputInterface.php | 32 + .../console/Output/ConsoleSectionOutput.php | 143 + .../symfony/console/Output/NullOutput.php | 128 + .../vendor/symfony/console/Output/Output.php | 174 + .../console/Output/OutputInterface.php | 110 + .../symfony/console/Output/StreamOutput.php | 123 + .../console/Output/TrimmedBufferOutput.php | 63 + .../console/Question/ChoiceQuestion.php | 183 + .../console/Question/ConfirmationQuestion.php | 57 + .../symfony/console/Question/Question.php | 299 + .../console/Resources/bin/hiddeninput.exe | Bin 0 -> 9216 bytes .../symfony/console/Resources/completion.bash | 84 + .../console/SignalRegistry/SignalRegistry.php | 65 + .../console/SingleCommandApplication.php | 72 + .../symfony/console/Style/OutputStyle.php | 153 + .../symfony/console/Style/StyleInterface.php | 132 + .../symfony/console/Style/SymfonyStyle.php | 518 ++ trunk/vendor/symfony/console/Terminal.php | 177 + .../console/Tester/ApplicationTester.php | 85 + .../Tester/CommandCompletionTester.php | 56 + .../symfony/console/Tester/CommandTester.php | 76 + .../Tester/Constraint/CommandIsSuccessful.php | 55 + .../symfony/console/Tester/TesterTrait.php | 197 + .../deprecation-contracts/CHANGELOG.md | 5 + .../symfony/deprecation-contracts/LICENSE | 19 + .../deprecation-contracts/function.php | 27 + trunk/vendor/symfony/finder/CHANGELOG.md | 87 + .../symfony/finder/Comparator/Comparator.php | 117 + .../finder/Comparator/DateComparator.php | 50 + .../finder/Comparator/NumberComparator.php | 78 + .../Exception/AccessDeniedException.php | 19 + .../Exception/DirectoryNotFoundException.php | 19 + trunk/vendor/symfony/finder/Finder.php | 806 ++ trunk/vendor/symfony/finder/Gitignore.php | 93 + trunk/vendor/symfony/finder/Glob.php | 111 + .../finder/Iterator/CustomFilterIterator.php | 64 + .../Iterator/DateRangeFilterIterator.php | 61 + .../Iterator/DepthRangeFilterIterator.php | 51 + .../ExcludeDirectoryFilterIterator.php | 97 + .../Iterator/FileTypeFilterIterator.php | 56 + .../Iterator/FilecontentFilterIterator.php | 61 + .../Iterator/FilenameFilterIterator.php | 50 + .../symfony/finder/Iterator/LazyIterator.php | 32 + .../Iterator/MultiplePcreFilterIterator.php | 117 + .../finder/Iterator/PathFilterIterator.php | 59 + .../Iterator/RecursiveDirectoryIterator.php | 157 + .../Iterator/SizeRangeFilterIterator.php | 60 + .../finder/Iterator/SortableIterator.php | 104 + .../Iterator/VcsIgnoredFilterIterator.php | 151 + trunk/vendor/symfony/finder/LICENSE | 19 + trunk/vendor/symfony/finder/SplFileInfo.php | 88 + trunk/vendor/symfony/polyfill-ctype/Ctype.php | 232 + trunk/vendor/symfony/polyfill-ctype/LICENSE | 19 + .../symfony/polyfill-ctype/bootstrap.php | 50 + .../symfony/polyfill-ctype/bootstrap80.php | 46 + .../polyfill-intl-grapheme/Grapheme.php | 247 + .../symfony/polyfill-intl-grapheme/LICENSE | 19 + .../polyfill-intl-grapheme/bootstrap.php | 58 + .../polyfill-intl-grapheme/bootstrap80.php | 50 + .../symfony/polyfill-intl-normalizer/LICENSE | 19 + .../polyfill-intl-normalizer/Normalizer.php | 310 + .../Resources/stubs/Normalizer.php | 17 + .../unidata/canonicalComposition.php | 945 +++ .../unidata/canonicalDecomposition.php | 2065 +++++ .../Resources/unidata/combiningClass.php | 876 ++ .../unidata/compatibilityDecomposition.php | 3695 +++++++++ .../polyfill-intl-normalizer/bootstrap.php | 23 + .../polyfill-intl-normalizer/bootstrap80.php | 19 + .../vendor/symfony/polyfill-mbstring/LICENSE | 19 + .../symfony/polyfill-mbstring/Mbstring.php | 996 +++ .../Resources/unidata/caseFolding.php | 119 + .../Resources/unidata/lowerCase.php | 1397 ++++ .../Resources/unidata/titleCaseRegexp.php | 5 + .../Resources/unidata/upperCase.php | 1489 ++++ .../symfony/polyfill-mbstring/bootstrap.php | 159 + .../symfony/polyfill-mbstring/bootstrap80.php | 155 + trunk/vendor/symfony/polyfill-php73/LICENSE | 19 + trunk/vendor/symfony/polyfill-php73/Php73.php | 43 + .../Resources/stubs/JsonException.php | 16 + .../symfony/polyfill-php73/bootstrap.php | 31 + trunk/vendor/symfony/polyfill-php80/LICENSE | 19 + trunk/vendor/symfony/polyfill-php80/Php80.php | 115 + .../symfony/polyfill-php80/PhpToken.php | 103 + .../Resources/stubs/Attribute.php | 31 + .../Resources/stubs/PhpToken.php | 16 + .../Resources/stubs/Stringable.php | 20 + .../Resources/stubs/UnhandledMatchError.php | 16 + .../Resources/stubs/ValueError.php | 16 + .../symfony/polyfill-php80/bootstrap.php | 42 + .../service-contracts/Attribute/Required.php | 25 + .../Attribute/SubscribedService.php | 33 + .../symfony/service-contracts/CHANGELOG.md | 5 + .../vendor/symfony/service-contracts/LICENSE | 19 + .../service-contracts/ResetInterface.php | 30 + .../service-contracts/ServiceLocatorTrait.php | 124 + .../ServiceProviderInterface.php | 36 + .../ServiceSubscriberInterface.php | 53 + .../ServiceSubscriberTrait.php | 77 + .../Test/ServiceLocatorTest.php | 92 + .../vendor/symfony/string/AbstractString.php | 716 ++ .../symfony/string/AbstractUnicodeString.php | 606 ++ trunk/vendor/symfony/string/ByteString.php | 493 ++ trunk/vendor/symfony/string/CHANGELOG.md | 35 + .../vendor/symfony/string/CodePointString.php | 260 + .../string/Exception/ExceptionInterface.php | 16 + .../Exception/InvalidArgumentException.php | 16 + .../string/Exception/RuntimeException.php | 16 + .../string/Inflector/EnglishInflector.php | 511 ++ .../string/Inflector/FrenchInflector.php | 157 + .../string/Inflector/InflectorInterface.php | 33 + trunk/vendor/symfony/string/LICENSE | 19 + trunk/vendor/symfony/string/LazyString.php | 143 + .../Resources/data/wcswidth_table_wide.php | 1143 +++ .../Resources/data/wcswidth_table_zero.php | 1415 ++++ .../symfony/string/Resources/functions.php | 38 + .../symfony/string/Slugger/AsciiSlugger.php | 176 + .../string/Slugger/SluggerInterface.php | 27 + trunk/vendor/symfony/string/UnicodeString.php | 358 + .../wp-coding-standards/wpcs/CHANGELOG.md | 1654 ++++ trunk/vendor/wp-coding-standards/wpcs/LICENSE | 21 + .../wpcs/WordPress-Core/ruleset.xml | 948 +++ .../wpcs/WordPress-Docs/ruleset.xml | 109 + .../wpcs/WordPress-Extra/ruleset.xml | 199 + ...stractArrayAssignmentRestrictionsSniff.php | 261 + .../AbstractClassRestrictionsSniff.php | 257 + .../AbstractFunctionParameterSniff.php | 111 + .../AbstractFunctionRestrictionsSniff.php | 358 + .../Docs/Arrays/ArrayIndentationStandard.xml | 116 + .../ArrayKeySpacingRestrictionsStandard.xml | 31 + .../MultipleStatementAlignmentStandard.xml | 50 + .../EscapedNotTranslatedStandard.xml | 24 + .../DateTime/CurrentTimeTimestampStandard.xml | 35 + .../DateTime/RestrictedFunctionsStandard.xml | 54 + .../PrefixAllGlobalsStandard.xml | 119 + .../ValidHookNameStandard.xml | 35 + .../ValidPostTypeSlugStandard.xml | 121 + .../WordPress/Docs/PHP/IniSetStandard.xml | 40 + .../Docs/PHP/StrictInArrayStandard.xml | 53 + .../Docs/PHP/YodaConditionsStandard.xml | 27 + .../Docs/Security/SafeRedirectStandard.xml | 23 + .../Docs/WP/CapabilitiesStandard.xml | 69 + .../Docs/WP/CapitalPDangitStandard.xml | 43 + .../Docs/WP/ClassNameCaseStandard.xml | 23 + .../Docs/WP/CronIntervalStandard.xml | 45 + .../Docs/WP/DeprecatedClassesStandard.xml | 23 + .../Docs/WP/DeprecatedFunctionsStandard.xml | 23 + .../WP/DeprecatedParameterValuesStandard.xml | 23 + .../Docs/WP/DeprecatedParametersStandard.xml | 40 + .../WP/EnqueuedResourceParametersStandard.xml | 92 + .../Docs/WP/EnqueuedResourcesStandard.xml | 57 + .../Docs/WP/PostsPerPageStandard.xml | 73 + .../CastStructureSpacingStandard.xml | 27 + .../ControlStructureSpacingStandard.xml | 150 + .../ObjectOperatorSpacingStandard.xml | 19 + .../WhiteSpace/OperatorSpacingStandard.xml | 61 + .../Helpers/ArrayWalkingFunctionsHelper.php | 108 + .../WordPress/Helpers/ConstantsHelper.php | 135 + .../wpcs/WordPress/Helpers/ContextHelper.php | 394 + .../WordPress/Helpers/DeprecationHelper.php | 84 + .../Helpers/EscapingFunctionsTrait.php | 256 + .../Helpers/FormattingFunctionsHelper.php | 60 + .../WordPress/Helpers/IsUnitTestTrait.php | 238 + .../wpcs/WordPress/Helpers/ListHelper.php | 101 + .../Helpers/MinimumWPVersionTrait.php | 159 + .../Helpers/PrintingFunctionsTrait.php | 122 + .../Helpers/RulesetPropertyHelper.php | 73 + .../Helpers/SanitizationHelperTrait.php | 418 + .../WordPress/Helpers/SnakeCaseHelper.php | 60 + .../Helpers/UnslashingFunctionsHelper.php | 59 + .../WordPress/Helpers/ValidationHelper.php | 349 + .../wpcs/WordPress/Helpers/VariableHelper.php | 262 + .../wpcs/WordPress/Helpers/WPDBTrait.php | 115 + .../Helpers/WPGlobalVariablesHelper.php | 312 + .../wpcs/WordPress/Helpers/WPHookHelper.php | 113 + .../wpcs/WordPress/Sniff.php | 72 + .../Arrays/ArrayDeclarationSpacingSniff.php | 252 + .../Sniffs/Arrays/ArrayIndentationSniff.php | 550 ++ .../ArrayKeySpacingRestrictionsSniff.php | 174 + .../MultipleStatementAlignmentSniff.php | 583 ++ .../AssignmentInTernaryConditionSniff.php | 173 + .../EscapedNotTranslatedSniff.php | 89 + .../Sniffs/DB/DirectDatabaseQuerySniff.php | 301 + .../DB/PreparedSQLPlaceholdersSniff.php | 761 ++ .../WordPress/Sniffs/DB/PreparedSQLSniff.php | 242 + .../Sniffs/DB/RestrictedClassesSniff.php | 57 + .../Sniffs/DB/RestrictedFunctionsSniff.php | 63 + .../WordPress/Sniffs/DB/SlowDBQuerySniff.php | 58 + .../DateTime/CurrentTimeTimestampSniff.php | 168 + .../DateTime/RestrictedFunctionsSniff.php | 59 + .../WordPress/Sniffs/Files/FileNameSniff.php | 313 + .../PrefixAllGlobalsSniff.php | 1297 +++ .../ValidFunctionNameSniff.php | 188 + .../NamingConventions/ValidHookNameSniff.php | 277 + .../ValidPostTypeSlugSniff.php | 230 + .../ValidVariableNameSniff.php | 289 + .../Sniffs/PHP/DevelopmentFunctionsSniff.php | 63 + .../PHP/DiscouragedPHPFunctionsSniff.php | 100 + .../WordPress/Sniffs/PHP/DontExtractSniff.php | 52 + .../wpcs/WordPress/Sniffs/PHP/IniSetSniff.php | 193 + .../Sniffs/PHP/NoSilencedErrorsSniff.php | 245 + .../Sniffs/PHP/POSIXFunctionsSniff.php | 73 + .../Sniffs/PHP/PregQuoteDelimiterSniff.php | 70 + .../PHP/RestrictedPHPFunctionsSniff.php | 45 + .../Sniffs/PHP/StrictInArraySniff.php | 122 + .../WordPress/Sniffs/PHP/TypeCastsSniff.php | 90 + .../Sniffs/PHP/YodaConditionsSniff.php | 124 + .../Sniffs/Security/EscapeOutputSniff.php | 903 ++ .../Security/NonceVerificationSniff.php | 422 + .../Sniffs/Security/PluginMenuSlugSniff.php | 126 + .../Sniffs/Security/SafeRedirectSniff.php | 45 + .../Security/ValidatedSanitizedInputSniff.php | 244 + .../Sniffs/Utils/I18nTextDomainFixerSniff.php | 862 ++ .../Sniffs/WP/AlternativeFunctionsSniff.php | 371 + .../WordPress/Sniffs/WP/CapabilitiesSniff.php | 478 ++ .../Sniffs/WP/CapitalPDangitSniff.php | 315 + .../Sniffs/WP/ClassNameCaseSniff.php | 897 ++ .../WordPress/Sniffs/WP/CronIntervalSniff.php | 321 + .../Sniffs/WP/DeprecatedClassesSniff.php | 152 + .../Sniffs/WP/DeprecatedFunctionsSniff.php | 1708 ++++ .../WP/DeprecatedParameterValuesSniff.php | 291 + .../Sniffs/WP/DeprecatedParametersSniff.php | 509 ++ .../Sniffs/WP/DiscouragedConstantsSniff.php | 160 + .../Sniffs/WP/DiscouragedFunctionsSniff.php | 54 + .../WP/EnqueuedResourceParametersSniff.php | 241 + .../Sniffs/WP/EnqueuedResourcesSniff.php | 108 + .../WP/GlobalVariablesOverrideSniff.php | 436 + .../wpcs/WordPress/Sniffs/WP/I18nSniff.php | 977 +++ .../WordPress/Sniffs/WP/PostsPerPageSniff.php | 102 + .../WhiteSpace/CastStructureSpacingSniff.php | 59 + .../ControlStructureSpacingSniff.php | 486 ++ .../WhiteSpace/ObjectOperatorSpacingSniff.php | 63 + .../WhiteSpace/OperatorSpacingSniff.php | 60 + .../wpcs/WordPress/ruleset.xml | 13 + .../wpcs/phpcs.xml.dist.sample | 153 + trunk/wc-serial-numbers.php | 72 + 2331 files changed, 316279 insertions(+), 3 deletions(-) create mode 100644 trunk/assets/blocks/index.js create mode 100644 trunk/assets/dist/blocks/blocks.asset.php create mode 100644 trunk/assets/dist/blocks/blocks.js create mode 100644 trunk/assets/dist/css/admin-style.asset.php create mode 100644 trunk/assets/dist/css/admin-style.css create mode 100644 trunk/assets/dist/css/frontend-style.asset.php create mode 100644 trunk/assets/dist/css/frontend-style.css create mode 100644 trunk/assets/dist/images/add-generator.png create mode 100644 trunk/assets/dist/images/csv-export.png create mode 100644 trunk/assets/dist/images/csv-import.png create mode 100644 trunk/assets/dist/images/txt-import.png create mode 100644 trunk/assets/dist/js/admin-script.asset.php create mode 100644 trunk/assets/dist/js/admin-script.js create mode 100644 trunk/assets/dist/js/frontend-script.asset.php create mode 100644 trunk/assets/dist/js/frontend-script.js create mode 100644 trunk/assets/images/add-generator.png create mode 100644 trunk/assets/images/csv-export.png create mode 100644 trunk/assets/images/csv-import.png create mode 100644 trunk/assets/images/txt-import.png create mode 100644 trunk/examples/api-test.txt create mode 100644 trunk/languages/wc-serial-numbers.pot create mode 100644 trunk/readme.txt create mode 100644 trunk/src/API.php create mode 100644 trunk/src/Actions.php create mode 100644 trunk/src/Admin/Actions.php create mode 100644 trunk/src/Admin/Admin.php create mode 100644 trunk/src/Admin/ListTables/ActivationsTable.php create mode 100644 trunk/src/Admin/ListTables/KeysTable.php create mode 100644 trunk/src/Admin/ListTables/ListTable.php create mode 100644 trunk/src/Admin/ListTables/StockTable.php create mode 100644 trunk/src/Admin/Menus.php create mode 100644 trunk/src/Admin/Metaboxes.php create mode 100644 trunk/src/Admin/Notices.php create mode 100644 trunk/src/Admin/Orders.php create mode 100644 trunk/src/Admin/Products.php create mode 100644 trunk/src/Admin/Settings.php create mode 100644 trunk/src/Admin/views/html-add-key.php create mode 100644 trunk/src/Admin/views/html-api-actions.php create mode 100644 trunk/src/Admin/views/html-api-validation.php create mode 100644 trunk/src/Admin/views/html-edit-key.php create mode 100644 trunk/src/Admin/views/html-list-activations.php create mode 100644 trunk/src/Admin/views/html-list-keys.php create mode 100644 trunk/src/Admin/views/html-list-stock.php create mode 100644 trunk/src/Admin/views/html-reports.php create mode 100644 trunk/src/Admin/views/html-tools.php create mode 100644 trunk/src/Ajax.php create mode 100644 trunk/src/Cache.php create mode 100644 trunk/src/Compat.php create mode 100644 trunk/src/Cron.php create mode 100644 trunk/src/Deprecated/Functions.php create mode 100644 trunk/src/Encryption.php create mode 100644 trunk/src/Frontend/Frontend.php create mode 100644 trunk/src/Frontend/Shortcodes.php create mode 100644 trunk/src/Functions/Template.php create mode 100644 trunk/src/Installer.php create mode 100644 trunk/src/Models/Activation.php create mode 100644 trunk/src/Models/Key.php create mode 100644 trunk/src/Models/Model.php create mode 100644 trunk/src/Orders.php create mode 100644 trunk/src/Plugin.php create mode 100644 trunk/src/RestAPI.php create mode 100644 trunk/src/Stocks.php create mode 100644 trunk/src/Utilities/Utilities.php create mode 100644 trunk/src/functions.php create mode 100644 trunk/templates/email-stock-notification.php create mode 100644 trunk/uninstall.php create mode 100644 trunk/vendor/autoload.php create mode 100755 trunk/vendor/bin/mozart create mode 100755 trunk/vendor/bin/phpcbf create mode 100755 trunk/vendor/bin/phpcs create mode 100644 trunk/vendor/byteever/byteever-sniffs/renovate.json create mode 100644 trunk/vendor/byteever/byteever-sniffs/src/ByteEver-Default/ruleset.xml create mode 100644 trunk/vendor/coenjacobs/mozart/Dockerfile create mode 100644 trunk/vendor/coenjacobs/mozart/LICENSE create mode 100755 trunk/vendor/coenjacobs/mozart/bin/mozart create mode 100644 trunk/vendor/coenjacobs/mozart/psalm.xml create mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Classmap.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr4.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Package.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Console/Application.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Mover.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Replace/Replacer.php create mode 100644 trunk/vendor/coenjacobs/mozart/src/Replacer.php create mode 100644 trunk/vendor/composer/ClassLoader.php create mode 100644 trunk/vendor/composer/InstalledVersions.php create mode 100644 trunk/vendor/composer/LICENSE create mode 100644 trunk/vendor/composer/autoload_classmap.php create mode 100644 trunk/vendor/composer/autoload_files.php create mode 100644 trunk/vendor/composer/autoload_namespaces.php create mode 100644 trunk/vendor/composer/autoload_psr4.php create mode 100644 trunk/vendor/composer/autoload_real.php create mode 100644 trunk/vendor/composer/autoload_static.php create mode 100644 trunk/vendor/composer/installed.json create mode 100644 trunk/vendor/composer/installed.php create mode 100644 trunk/vendor/composer/platform_check.php create mode 100644 trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/CODE_OF_CONDUCT.md create mode 100644 trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md create mode 100644 trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php create mode 100644 trunk/vendor/league/flysystem/CODE_OF_CONDUCT.md create mode 100644 trunk/vendor/league/flysystem/LICENSE create mode 100644 trunk/vendor/league/flysystem/SECURITY.md create mode 100644 trunk/vendor/league/flysystem/deprecations.md create mode 100644 trunk/vendor/league/flysystem/src/Adapter/AbstractAdapter.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/Ftp.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/Ftpd.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/Local.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/NullAdapter.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedCopyTrait.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedWritingTrait.php create mode 100644 trunk/vendor/league/flysystem/src/Adapter/SynologyFtp.php create mode 100644 trunk/vendor/league/flysystem/src/AdapterInterface.php create mode 100644 trunk/vendor/league/flysystem/src/Config.php create mode 100644 trunk/vendor/league/flysystem/src/ConfigAwareTrait.php create mode 100644 trunk/vendor/league/flysystem/src/ConnectionErrorException.php create mode 100644 trunk/vendor/league/flysystem/src/ConnectionRuntimeException.php create mode 100644 trunk/vendor/league/flysystem/src/CorruptedPathDetected.php create mode 100644 trunk/vendor/league/flysystem/src/Directory.php create mode 100644 trunk/vendor/league/flysystem/src/Exception.php create mode 100644 trunk/vendor/league/flysystem/src/File.php create mode 100644 trunk/vendor/league/flysystem/src/FileExistsException.php create mode 100644 trunk/vendor/league/flysystem/src/FileNotFoundException.php create mode 100644 trunk/vendor/league/flysystem/src/Filesystem.php create mode 100644 trunk/vendor/league/flysystem/src/FilesystemException.php create mode 100644 trunk/vendor/league/flysystem/src/FilesystemInterface.php create mode 100644 trunk/vendor/league/flysystem/src/FilesystemNotFoundException.php create mode 100644 trunk/vendor/league/flysystem/src/Handler.php create mode 100644 trunk/vendor/league/flysystem/src/InvalidRootException.php create mode 100644 trunk/vendor/league/flysystem/src/MountManager.php create mode 100644 trunk/vendor/league/flysystem/src/NotSupportedException.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/AbstractPlugin.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/EmptyDir.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/ForcedCopy.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/ForcedRename.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/GetWithMetadata.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/ListFiles.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/ListPaths.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/ListWith.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/PluggableTrait.php create mode 100644 trunk/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php create mode 100644 trunk/vendor/league/flysystem/src/PluginInterface.php create mode 100644 trunk/vendor/league/flysystem/src/ReadInterface.php create mode 100644 trunk/vendor/league/flysystem/src/RootViolationException.php create mode 100644 trunk/vendor/league/flysystem/src/SafeStorage.php create mode 100644 trunk/vendor/league/flysystem/src/UnreadableFileException.php create mode 100644 trunk/vendor/league/flysystem/src/Util.php create mode 100644 trunk/vendor/league/flysystem/src/Util/ContentListingFormatter.php create mode 100644 trunk/vendor/league/flysystem/src/Util/MimeType.php create mode 100644 trunk/vendor/league/flysystem/src/Util/StreamHasher.php create mode 100644 trunk/vendor/league/mime-type-detection/CHANGELOG.md create mode 100644 trunk/vendor/league/mime-type-detection/LICENSE create mode 100644 trunk/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php create mode 100644 trunk/vendor/league/mime-type-detection/src/ExtensionLookup.php create mode 100644 trunk/vendor/league/mime-type-detection/src/ExtensionMimeTypeDetector.php create mode 100644 trunk/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php create mode 100644 trunk/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php create mode 100644 trunk/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php create mode 100644 trunk/vendor/league/mime-type-detection/src/MimeTypeDetector.php create mode 100644 trunk/vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/CHANGELOG.md create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/LICENSE create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractComplexVersionSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractNewFeatureSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractRemovedFeatureSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ComplexVersionInterface.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/PHPCSHelper.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenAbstractPrivateMethodsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsInvokedFunctionsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/ValidIntegersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml create mode 100644 trunk/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php create mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-paragonie/LICENSE create mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat/ruleset.xml create mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieSodiumCompat/ruleset.xml create mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-wp/LICENSE create mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/CHANGELOG.md create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/LICENSE create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/CHANGELOG.md create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/LICENSE create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml create mode 100644 trunk/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php create mode 100644 trunk/vendor/psr/container/LICENSE create mode 100644 trunk/vendor/psr/container/src/ContainerExceptionInterface.php create mode 100644 trunk/vendor/psr/container/src/ContainerInterface.php create mode 100644 trunk/vendor/psr/container/src/NotFoundExceptionInterface.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/CHANGELOG.md create mode 100644 trunk/vendor/squizlabs/php_codesniffer/CodeSniffer.conf create mode 100644 trunk/vendor/squizlabs/php_codesniffer/CodeSniffer.conf.dist create mode 100644 trunk/vendor/squizlabs/php_codesniffer/autoload.php create mode 100755 trunk/vendor/squizlabs/php_codesniffer/bin/phpcbf create mode 100644 trunk/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat create mode 100755 trunk/vendor/squizlabs/php_codesniffer/bin/phpcs create mode 100755 trunk/vendor/squizlabs/php_codesniffer/bin/phpcs.bat create mode 100644 trunk/vendor/squizlabs/php_codesniffer/licence.txt create mode 100644 trunk/vendor/squizlabs/php_codesniffer/phpcs.xsd create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Config.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Exceptions/DeepExitException.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Exceptions/TokenizerException.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Files/File.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Files/FileList.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Filters/ExactMatch.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Filters/Filter.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Filters/GitStaged.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Fixer.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Generators/Generator.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Generators/HTML.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Generators/Markdown.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Generators/Text.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reporter.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Checkstyle.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Code.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Csv.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Diff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Emacs.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Full.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Gitblame.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Info.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Json.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Junit.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Performance.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Report.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Source.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Summary.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Svnblame.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Xml.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Ruleset.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Runner.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractScopeSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/DeprecatedSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowLongArraySyntaxStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowShortArraySyntaxStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/DuplicateClassNameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/OpeningBraceSameLineStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/AssignmentInConditionStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/EmptyPHPStatementStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/EmptyStatementStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopShouldBeWhileLoopStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopWithTestFunctionCallStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/JumbledIncrementerStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnconditionalIfStatementStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnnecessaryFinalModifierStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnusedFunctionParameterStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UselessOverridingMethodStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/DocCommentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/FixmeStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/TodoStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/DisallowYodaConditionsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/InlineControlStructureStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/CSSLintStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/ClosureLinterStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/JSHintStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ByteOrderMarkStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNewlineStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNoNewlineStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ExecutableFileStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/InlineHTMLStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineEndingsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineLengthStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LowercasedFilenameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneClassPerFileStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneInterfacePerFileStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneObjectStructurePerFileStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneTraitPerFileStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/DisallowMultipleStatementsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/MultipleStatementAlignmentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/NoSpaceAfterCastStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterCastStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterNotStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceBeforeCastStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/CallTimePassByReferenceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/FunctionCallArgumentSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceBsdAllmanStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceKernighanRitchieStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/CyclomaticComplexityStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/NestingLevelStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/AbstractClassNamePrefixStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/CamelCapsFunctionNameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/ConstructorNameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/InterfaceNameSuffixStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/TraitNameSuffixStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/UpperCaseConstantNameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/BacktickOperatorStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/CharacterBeforePHPOpeningTagStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ClosingPHPTagStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DeprecatedFunctionsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowAlternativePHPTagsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/RequireStrictTypesStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SyntaxStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/IncrementDecrementSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowRequestSuperglobalSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DiscourageGotoSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/NoSilencedErrorsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/RequireStrictTypesSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SAPIUsageSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.1.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.1.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.2.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.1.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.1.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.2.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.2.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.4.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.6.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.7.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.8.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.10.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.3.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.3.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.6.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.8.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.8.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.9.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.9.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.1.inc create mode 100755 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.3.inc create mode 100755 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneClassPerFileUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneClassPerFileUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneInterfacePerFileUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneInterfacePerFileUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneObjectStructurePerFileUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneObjectStructurePerFileUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.10.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.11.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.11.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.12.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.12.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.13.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.14.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.14.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.15.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.15.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.8.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.9.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.11.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.12.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.13.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.8.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.9.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClosingBraceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/OpeningBraceSpaceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/BooleanOperatorPlacementStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/ControlStructureSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/ImportStatementStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/OpenTagStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/ReturnTypeDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.10.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.10.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.11.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.11.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.12.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.12.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.13.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.14.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.17.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.18.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.4.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.7.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.8.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.9.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.10.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.10.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.11.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.11.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.14.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.6.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.7.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.8.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.9.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.9.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.10.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.10.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.11.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.11.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.12.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.12.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.13.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.13.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.14.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.14.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.15.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.16.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.16.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.17.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.18.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.8.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.9.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionClosingBraceSpaceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/MemberVarSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SuperfluousWhitespaceStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.4.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.5.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.9.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.10.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.11.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.12.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.12.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.13.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.13.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.14.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.15.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.16.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.17.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.23.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.8.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.9.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.5.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.6.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.2.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Cache.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Common.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Help.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Standards.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Timing.php create mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php create mode 100644 trunk/vendor/symfony/console/Application.php create mode 100644 trunk/vendor/symfony/console/Attribute/AsCommand.php create mode 100644 trunk/vendor/symfony/console/CHANGELOG.md create mode 100644 trunk/vendor/symfony/console/CI/GithubActionReporter.php create mode 100644 trunk/vendor/symfony/console/Color.php create mode 100644 trunk/vendor/symfony/console/Command/Command.php create mode 100644 trunk/vendor/symfony/console/Command/CompleteCommand.php create mode 100644 trunk/vendor/symfony/console/Command/DumpCompletionCommand.php create mode 100644 trunk/vendor/symfony/console/Command/HelpCommand.php create mode 100644 trunk/vendor/symfony/console/Command/LazyCommand.php create mode 100644 trunk/vendor/symfony/console/Command/ListCommand.php create mode 100644 trunk/vendor/symfony/console/Command/LockableTrait.php create mode 100644 trunk/vendor/symfony/console/Command/SignalableCommandInterface.php create mode 100644 trunk/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php create mode 100644 trunk/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php create mode 100644 trunk/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php create mode 100644 trunk/vendor/symfony/console/Completion/CompletionInput.php create mode 100644 trunk/vendor/symfony/console/Completion/CompletionSuggestions.php create mode 100644 trunk/vendor/symfony/console/Completion/Output/BashCompletionOutput.php create mode 100644 trunk/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php create mode 100644 trunk/vendor/symfony/console/Completion/Suggestion.php create mode 100644 trunk/vendor/symfony/console/ConsoleEvents.php create mode 100644 trunk/vendor/symfony/console/Cursor.php create mode 100644 trunk/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php create mode 100644 trunk/vendor/symfony/console/Descriptor/ApplicationDescription.php create mode 100644 trunk/vendor/symfony/console/Descriptor/Descriptor.php create mode 100644 trunk/vendor/symfony/console/Descriptor/DescriptorInterface.php create mode 100644 trunk/vendor/symfony/console/Descriptor/JsonDescriptor.php create mode 100644 trunk/vendor/symfony/console/Descriptor/MarkdownDescriptor.php create mode 100644 trunk/vendor/symfony/console/Descriptor/TextDescriptor.php create mode 100644 trunk/vendor/symfony/console/Descriptor/XmlDescriptor.php create mode 100644 trunk/vendor/symfony/console/Event/ConsoleCommandEvent.php create mode 100644 trunk/vendor/symfony/console/Event/ConsoleErrorEvent.php create mode 100644 trunk/vendor/symfony/console/Event/ConsoleEvent.php create mode 100644 trunk/vendor/symfony/console/Event/ConsoleSignalEvent.php create mode 100644 trunk/vendor/symfony/console/Event/ConsoleTerminateEvent.php create mode 100644 trunk/vendor/symfony/console/EventListener/ErrorListener.php create mode 100644 trunk/vendor/symfony/console/Exception/CommandNotFoundException.php create mode 100644 trunk/vendor/symfony/console/Exception/ExceptionInterface.php create mode 100644 trunk/vendor/symfony/console/Exception/InvalidArgumentException.php create mode 100644 trunk/vendor/symfony/console/Exception/InvalidOptionException.php create mode 100644 trunk/vendor/symfony/console/Exception/LogicException.php create mode 100644 trunk/vendor/symfony/console/Exception/MissingInputException.php create mode 100644 trunk/vendor/symfony/console/Exception/NamespaceNotFoundException.php create mode 100644 trunk/vendor/symfony/console/Exception/RuntimeException.php create mode 100644 trunk/vendor/symfony/console/Formatter/NullOutputFormatter.php create mode 100644 trunk/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php create mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatter.php create mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatterInterface.php create mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatterStyle.php create mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php create mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php create mode 100644 trunk/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php create mode 100644 trunk/vendor/symfony/console/Helper/DebugFormatterHelper.php create mode 100644 trunk/vendor/symfony/console/Helper/DescriptorHelper.php create mode 100644 trunk/vendor/symfony/console/Helper/Dumper.php create mode 100644 trunk/vendor/symfony/console/Helper/FormatterHelper.php create mode 100644 trunk/vendor/symfony/console/Helper/Helper.php create mode 100644 trunk/vendor/symfony/console/Helper/HelperInterface.php create mode 100644 trunk/vendor/symfony/console/Helper/HelperSet.php create mode 100644 trunk/vendor/symfony/console/Helper/InputAwareHelper.php create mode 100644 trunk/vendor/symfony/console/Helper/ProcessHelper.php create mode 100644 trunk/vendor/symfony/console/Helper/ProgressBar.php create mode 100644 trunk/vendor/symfony/console/Helper/ProgressIndicator.php create mode 100644 trunk/vendor/symfony/console/Helper/QuestionHelper.php create mode 100644 trunk/vendor/symfony/console/Helper/SymfonyQuestionHelper.php create mode 100644 trunk/vendor/symfony/console/Helper/Table.php create mode 100644 trunk/vendor/symfony/console/Helper/TableCell.php create mode 100644 trunk/vendor/symfony/console/Helper/TableCellStyle.php create mode 100644 trunk/vendor/symfony/console/Helper/TableRows.php create mode 100644 trunk/vendor/symfony/console/Helper/TableSeparator.php create mode 100644 trunk/vendor/symfony/console/Helper/TableStyle.php create mode 100644 trunk/vendor/symfony/console/Input/ArgvInput.php create mode 100644 trunk/vendor/symfony/console/Input/ArrayInput.php create mode 100644 trunk/vendor/symfony/console/Input/Input.php create mode 100644 trunk/vendor/symfony/console/Input/InputArgument.php create mode 100644 trunk/vendor/symfony/console/Input/InputAwareInterface.php create mode 100644 trunk/vendor/symfony/console/Input/InputDefinition.php create mode 100644 trunk/vendor/symfony/console/Input/InputInterface.php create mode 100644 trunk/vendor/symfony/console/Input/InputOption.php create mode 100644 trunk/vendor/symfony/console/Input/StreamableInputInterface.php create mode 100644 trunk/vendor/symfony/console/Input/StringInput.php create mode 100644 trunk/vendor/symfony/console/LICENSE create mode 100644 trunk/vendor/symfony/console/Logger/ConsoleLogger.php create mode 100644 trunk/vendor/symfony/console/Output/BufferedOutput.php create mode 100644 trunk/vendor/symfony/console/Output/ConsoleOutput.php create mode 100644 trunk/vendor/symfony/console/Output/ConsoleOutputInterface.php create mode 100644 trunk/vendor/symfony/console/Output/ConsoleSectionOutput.php create mode 100644 trunk/vendor/symfony/console/Output/NullOutput.php create mode 100644 trunk/vendor/symfony/console/Output/Output.php create mode 100644 trunk/vendor/symfony/console/Output/OutputInterface.php create mode 100644 trunk/vendor/symfony/console/Output/StreamOutput.php create mode 100644 trunk/vendor/symfony/console/Output/TrimmedBufferOutput.php create mode 100644 trunk/vendor/symfony/console/Question/ChoiceQuestion.php create mode 100644 trunk/vendor/symfony/console/Question/ConfirmationQuestion.php create mode 100644 trunk/vendor/symfony/console/Question/Question.php create mode 100644 trunk/vendor/symfony/console/Resources/bin/hiddeninput.exe create mode 100644 trunk/vendor/symfony/console/Resources/completion.bash create mode 100644 trunk/vendor/symfony/console/SignalRegistry/SignalRegistry.php create mode 100644 trunk/vendor/symfony/console/SingleCommandApplication.php create mode 100644 trunk/vendor/symfony/console/Style/OutputStyle.php create mode 100644 trunk/vendor/symfony/console/Style/StyleInterface.php create mode 100644 trunk/vendor/symfony/console/Style/SymfonyStyle.php create mode 100644 trunk/vendor/symfony/console/Terminal.php create mode 100644 trunk/vendor/symfony/console/Tester/ApplicationTester.php create mode 100644 trunk/vendor/symfony/console/Tester/CommandCompletionTester.php create mode 100644 trunk/vendor/symfony/console/Tester/CommandTester.php create mode 100644 trunk/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php create mode 100644 trunk/vendor/symfony/console/Tester/TesterTrait.php create mode 100644 trunk/vendor/symfony/deprecation-contracts/CHANGELOG.md create mode 100644 trunk/vendor/symfony/deprecation-contracts/LICENSE create mode 100644 trunk/vendor/symfony/deprecation-contracts/function.php create mode 100644 trunk/vendor/symfony/finder/CHANGELOG.md create mode 100644 trunk/vendor/symfony/finder/Comparator/Comparator.php create mode 100644 trunk/vendor/symfony/finder/Comparator/DateComparator.php create mode 100644 trunk/vendor/symfony/finder/Comparator/NumberComparator.php create mode 100644 trunk/vendor/symfony/finder/Exception/AccessDeniedException.php create mode 100644 trunk/vendor/symfony/finder/Exception/DirectoryNotFoundException.php create mode 100644 trunk/vendor/symfony/finder/Finder.php create mode 100644 trunk/vendor/symfony/finder/Gitignore.php create mode 100644 trunk/vendor/symfony/finder/Glob.php create mode 100644 trunk/vendor/symfony/finder/Iterator/CustomFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/FilenameFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/LazyIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/SortableIterator.php create mode 100644 trunk/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php create mode 100644 trunk/vendor/symfony/finder/LICENSE create mode 100644 trunk/vendor/symfony/finder/SplFileInfo.php create mode 100644 trunk/vendor/symfony/polyfill-ctype/Ctype.php create mode 100644 trunk/vendor/symfony/polyfill-ctype/LICENSE create mode 100644 trunk/vendor/symfony/polyfill-ctype/bootstrap.php create mode 100644 trunk/vendor/symfony/polyfill-ctype/bootstrap80.php create mode 100644 trunk/vendor/symfony/polyfill-intl-grapheme/Grapheme.php create mode 100644 trunk/vendor/symfony/polyfill-intl-grapheme/LICENSE create mode 100644 trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap.php create mode 100644 trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php create mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/LICENSE create mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Normalizer.php create mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php create mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php create mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php create mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php create mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php create mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap.php create mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php create mode 100644 trunk/vendor/symfony/polyfill-mbstring/LICENSE create mode 100644 trunk/vendor/symfony/polyfill-mbstring/Mbstring.php create mode 100644 trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php create mode 100644 trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php create mode 100644 trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php create mode 100644 trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php create mode 100644 trunk/vendor/symfony/polyfill-mbstring/bootstrap.php create mode 100644 trunk/vendor/symfony/polyfill-mbstring/bootstrap80.php create mode 100644 trunk/vendor/symfony/polyfill-php73/LICENSE create mode 100644 trunk/vendor/symfony/polyfill-php73/Php73.php create mode 100644 trunk/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php create mode 100644 trunk/vendor/symfony/polyfill-php73/bootstrap.php create mode 100644 trunk/vendor/symfony/polyfill-php80/LICENSE create mode 100644 trunk/vendor/symfony/polyfill-php80/Php80.php create mode 100644 trunk/vendor/symfony/polyfill-php80/PhpToken.php create mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php create mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php create mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php create mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php create mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php create mode 100644 trunk/vendor/symfony/polyfill-php80/bootstrap.php create mode 100644 trunk/vendor/symfony/service-contracts/Attribute/Required.php create mode 100644 trunk/vendor/symfony/service-contracts/Attribute/SubscribedService.php create mode 100644 trunk/vendor/symfony/service-contracts/CHANGELOG.md create mode 100644 trunk/vendor/symfony/service-contracts/LICENSE create mode 100644 trunk/vendor/symfony/service-contracts/ResetInterface.php create mode 100644 trunk/vendor/symfony/service-contracts/ServiceLocatorTrait.php create mode 100644 trunk/vendor/symfony/service-contracts/ServiceProviderInterface.php create mode 100644 trunk/vendor/symfony/service-contracts/ServiceSubscriberInterface.php create mode 100644 trunk/vendor/symfony/service-contracts/ServiceSubscriberTrait.php create mode 100644 trunk/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php create mode 100644 trunk/vendor/symfony/string/AbstractString.php create mode 100644 trunk/vendor/symfony/string/AbstractUnicodeString.php create mode 100644 trunk/vendor/symfony/string/ByteString.php create mode 100644 trunk/vendor/symfony/string/CHANGELOG.md create mode 100644 trunk/vendor/symfony/string/CodePointString.php create mode 100644 trunk/vendor/symfony/string/Exception/ExceptionInterface.php create mode 100644 trunk/vendor/symfony/string/Exception/InvalidArgumentException.php create mode 100644 trunk/vendor/symfony/string/Exception/RuntimeException.php create mode 100644 trunk/vendor/symfony/string/Inflector/EnglishInflector.php create mode 100644 trunk/vendor/symfony/string/Inflector/FrenchInflector.php create mode 100644 trunk/vendor/symfony/string/Inflector/InflectorInterface.php create mode 100644 trunk/vendor/symfony/string/LICENSE create mode 100644 trunk/vendor/symfony/string/LazyString.php create mode 100644 trunk/vendor/symfony/string/Resources/data/wcswidth_table_wide.php create mode 100644 trunk/vendor/symfony/string/Resources/data/wcswidth_table_zero.php create mode 100644 trunk/vendor/symfony/string/Resources/functions.php create mode 100644 trunk/vendor/symfony/string/Slugger/AsciiSlugger.php create mode 100644 trunk/vendor/symfony/string/Slugger/SluggerInterface.php create mode 100644 trunk/vendor/symfony/string/UnicodeString.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/CHANGELOG.md create mode 100644 trunk/vendor/wp-coding-standards/wpcs/LICENSE create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/UnslashingFunctionsHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php create mode 100755 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php create mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/ruleset.xml create mode 100644 trunk/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample create mode 100644 trunk/wc-serial-numbers.php diff --git a/readme.txt b/readme.txt index bc60b408..f083919f 100644 --- a/readme.txt +++ b/readme.txt @@ -253,9 +253,6 @@ Yes, you are always welcome to [provide suggestions](https://github.com/pluginev == Changelog == = 1.7.7 (31 Jul 2024) = Enhance: Enhance optimized code for better autoload classes. -Enhance: Enhanced security. -Update: Update the WooCommence HPOS support -Fix: Few known issues. = 1.7.6 (30 Jul 2024) = Enhance: Enhanced security to handle form actions. diff --git a/trunk/assets/blocks/index.js b/trunk/assets/blocks/index.js new file mode 100644 index 00000000..e69de29b diff --git a/trunk/assets/dist/blocks/blocks.asset.php b/trunk/assets/dist/blocks/blocks.asset.php new file mode 100644 index 00000000..f5345333 --- /dev/null +++ b/trunk/assets/dist/blocks/blocks.asset.php @@ -0,0 +1 @@ + array(), 'version' => '31d6cfe0d16ae931b73c'); diff --git a/trunk/assets/dist/blocks/blocks.js b/trunk/assets/dist/blocks/blocks.js new file mode 100644 index 00000000..e69de29b diff --git a/trunk/assets/dist/css/admin-style.asset.php b/trunk/assets/dist/css/admin-style.asset.php new file mode 100644 index 00000000..39a03212 --- /dev/null +++ b/trunk/assets/dist/css/admin-style.asset.php @@ -0,0 +1 @@ + array(), 'version' => '857b6146e419226c7061'); diff --git a/trunk/assets/dist/css/admin-style.css b/trunk/assets/dist/css/admin-style.css new file mode 100644 index 00000000..c949891a --- /dev/null +++ b/trunk/assets/dist/css/admin-style.css @@ -0,0 +1 @@ +.pev-wrap{margin-left:auto;margin-right:auto;max-width:1400px;padding-right:20px}.pev-navbar{margin:0 0 1em}.pev-navbar+.subsubsub{margin:-8px 0 0}.pev-poststuff{margin-right:340px;margin-top:10px}.pev-poststuff .column-1{float:left;min-width:463px;width:100%}.pev-poststuff .column-2{float:right;margin-right:-340px;width:320px}@media only screen and (max-width:850px){.pev-poststuff{margin-right:0}.pev-poststuff .column-1,.pev-poststuff .column-2{float:none;margin-right:0;min-width:0;width:100%}}.pev-card,.pev-panel{background:#fff;border:1px solid #e1e2e2;box-sizing:border-box;display:block;font-size:13px;line-height:1.5;margin:0 auto 1.5em;max-width:none;min-height:1px;min-width:auto;position:relative;width:100%}.pev-card [class*=pev],.pev-panel [class*=pev]{box-sizing:inherit}.pev-card:after,.pev-card:before,.pev-panel:after,.pev-panel:before{box-sizing:inherit;content:"";display:table}.pev-card h2,.pev-card h3,.pev-card h4,.pev-card h5,.pev-card h6,.pev-panel h2,.pev-panel h3,.pev-panel h4,.pev-panel h5,.pev-panel h6{margin-top:0;padding-top:0}.pev-card ol li,.pev-card ul li,.pev-panel ol li,.pev-panel ul li{line-height:1.7;margin-bottom:.5em}.pev-card>.pev-card__body,.pev-panel{color:#555;position:relative}.pev-card>.pev-card__body h2,.pev-card>.pev-card__body h3,.pev-card>.pev-card__body h4,.pev-panel h2,.pev-panel h3,.pev-panel h4{color:inherit}.pev-card>.pev-card__body>:first-child,.pev-panel>:first-child{margin-top:0}.pev-card>.pev-card__body table:not(.widefat),.pev-panel table:not(.widefat){width:100%}.pev-card>.pev-card__body table:not(.widefat) td,.pev-card>.pev-card__body table:not(.widefat) th,.pev-panel table:not(.widefat) td,.pev-panel table:not(.widefat) th{text-align:left;vertical-align:top}.pev-card>.pev-card__body table:not(.widefat) th,.pev-panel table:not(.widefat) th{padding:0 6px 6px 0}.pev-card>.pev-card__body table:not(.widefat) td,.pev-panel table:not(.widefat) td{padding:0 0 6px}.pev-card>.pev-card__body a:active,.pev-card>.pev-card__body a:focus,.pev-panel a:active,.pev-panel a:focus{box-shadow:none;outline:none}.pev-card__group,.pev-panel__group{align-items:center;box-sizing:border-box;display:flex;flex-wrap:nowrap;gap:10px;justify-content:space-between;margin-bottom:1em;min-height:25px}.pev-card__group>.icon,.pev-card__group>img,.pev-panel__group>.icon,.pev-panel__group>img{border-radius:6px;height:54px;-o-object-fit:cover;object-fit:cover;width:54px}.pev-card__group>.icon,.pev-panel__group>.icon{align-items:center;background-color:#f5f5f5;color:#777;display:flex;font-size:50px;justify-content:center;line-height:54px}.pev-card__group>div,.pev-panel__group>div{align-items:center;display:flex;gap:10px}.pev-card h2,.pev-card h3,.pev-card__title{color:inherit;font-size:14px;font-weight:600;margin:0;padding:0}.pev-card__subtitle{color:#777;font-size:13px;font-weight:400}.pev-card>.pev-card__footer,.pev-card>.pev-card__header{align-items:center;display:flex;flex-direction:row;justify-content:space-between}.pev-card>.pev-card__footer h2,.pev-card>.pev-card__footer h3,.pev-card>.pev-card__footer p,.pev-card>.pev-card__header h2,.pev-card>.pev-card__header h3,.pev-card>.pev-card__header p{margin:0;padding:0}.pev-card>.pev-card__footer .select2,.pev-card>.pev-card__footer button,.pev-card>.pev-card__footer input,.pev-card>.pev-card__footer select,.pev-card>.pev-card__header .select2,.pev-card>.pev-card__header button,.pev-card>.pev-card__header input,.pev-card>.pev-card__header select{margin-right:5px}.pev-card>.pev-card__footer .select2:last-child,.pev-card>.pev-card__footer button:last-child,.pev-card>.pev-card__footer input:last-child,.pev-card>.pev-card__footer select:last-child,.pev-card>.pev-card__header .select2:last-child,.pev-card>.pev-card__header button:last-child,.pev-card>.pev-card__header input:last-child,.pev-card>.pev-card__header select:last-child{margin-right:0}.pev-card>[class*=pev-card]:not([class*=wide]){padding:8px 10px}.pev-card>[class*=pev-card__]:not(:last-child){border-bottom:1px solid #e1e2e2}.pev-panel{padding:8px 10px}.pev-panel__title{font-size:18px;line-height:1.2;padding:0}.pev-panel__subtitle,.pev-panel__title{font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,sans-serif;font-weight:400;margin:0}.pev-panel__subtitle{color:#777;font-size:13px;line-height:1.6em}.pev-panel__legend{background-color:rgba(0,0,0,0);border-bottom-left-radius:8px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #e5e5e5 #e5e5e5;border-style:solid;border-width:1px;color:#aaa;font-size:11px;line-height:1em;padding:3px 2px 4px 7px;position:absolute;right:-1px;top:-1px;z-index:11}.promo-panel .pev-panel__legend{border-color:rgba(0,0,0,0) rgba(0,0,0,0) currentColor currentColor;color:#fff}.pev-panel:has(.pev-panel__legend){padding-top:20px}.pev-panel.promo-panel{background-color:#482ac9;border-color:#482ac9;color:#fff}.pev-panel.promo-panel a:not(.button){color:#fff}.pev-panel.promo-panel .button{color:#482ac9;display:block;font-weight:700;margin-top:20px;text-align:center;text-transform:uppercase}.pev-form-field{box-sizing:border-box;display:flex;flex-direction:column;margin:1em 0;min-height:32px;min-width:0;position:relative;vertical-align:top;width:100%}.pev-form-field label{-ms-grid-row-align:self-start;align-items:center;align-self:self-start;display:flex;gap:5px;justify-content:flex-start;margin:0 0 3px}.pev-form-field label abbr[title=required]{color:red;text-decoration:none}.pev-form-field label abbr[title=required]:after{content:"*"}.pev-form-field p{margin-bottom:0}.pev-form-field textarea{resize:none}.pev-form-field input:not([type=checkbox]):not([type=radio]):not(.addon),.pev-form-field select:not(.addon),.pev-form-field textarea:not(.addon){flex:1 1 auto;margin:0;max-width:unset;min-width:0;position:relative}.pev-form-field input:not([type=checkbox]):not([type=radio]):not(.addon):focus,.pev-form-field select:not(.addon):focus,.pev-form-field textarea:not(.addon):focus{z-index:3}.pev-form-field__group{-ms-grid-row-align:center;align-items:stretch;align-self:center;display:flex;flex-wrap:nowrap;position:relative;width:100%}.pev-form-field__group .button,.pev-form-field__group button{align-items:center;border-width:1px;display:flex;margin:0;position:relative;z-index:2}.pev-form-field__group .button:focus,.pev-form-field__group button:focus{z-index:3}.pev-form-field__group .addon{align-items:center;background-color:#eee;border:1px solid #8c8f94;border-radius:4px;display:flex;padding:0 8px;text-align:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.pev-form-field__group>:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.pev-form-field__group>:not(:last-child) .select2-selection{border-bottom-right-radius:0;border-top-right-radius:0}.pev-form-field__group>:nth-last-child(n+3){border-bottom-right-radius:0;border-top-right-radius:0}.pev-form-field__group>:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px!important}.pev-form-field__group>:not(:first-child) .select2-selection{border-bottom-left-radius:0;border-top-left-radius:0}.pev-form-field__group>:nth-child(2) .select2-selection{border-bottom-left-radius:4px;border-top-left-radius:4px}@media screen and (min-width:850px){.form-inline .pev-form-field{-ms-grid-rows:1fr;-ms-grid-columns:150px 1fr;display:-ms-grid;display:grid;grid-template-columns:150px 1fr;grid-template-rows:1fr}.form-inline .pev-form-field .label,.form-inline .pev-form-field>label:first-child{-ms-grid-column:1;grid-column:1;min-width:150px;padding-right:10px;width:150px}.form-inline .pev-form-field>:not(:first-child){-ms-grid-column:2;grid-column:2}}.wcsn-card{box-sizing:border-box;margin-top:20px}.wcsn-card__body,.wcsn-card__header{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;padding:1em 2em;position:relative;width:100%}.wcsn-card__header{align-items:center;border-bottom:0;display:flex;justify-content:space-between}.wcsn-card__header h2,.wcsn-card__header h3{margin:0}.wcsn-feature-promo-banner{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin-top:20px;max-width:800px;position:relative}.wcsn-feature-promo-banner>img{height:auto;width:100%}.wcsn-feature-promo-banner__content{align-items:center;background:hsla(0,0%,100%,.7);bottom:0;display:flex;flex-direction:column;justify-content:center;left:0;position:absolute;right:0;top:0;transition:opacity .3s ease-in-out}.wcsn-feature-promo-banner__content h3{color:red;font-size:1.5em;margin:0 0 1em;text-align:center}.wcsn-key{background:#f0f0f1;background:rgba(0,0,0,.07);border-radius:3px;color:rgba(0,0,0,.4);cursor:pointer;display:inline-block;font-family:Consolas,monospace;font-weight:400;line-height:20px;min-height:20px;padding:3px 10px 2px;position:relative;text-align:left;width:90%}.wcsn-key.copying{color:#155724}.wcsn-nav-tabs{margin-bottom:20px!important}.wp-list-table.keys .column-key{width:15%}.wp-list-table.keys .wcsn-key-status{background-color:silver;border:1px solid rgba(0,0,0,0);border-radius:3px;color:#fff;font-size:14px;line-height:1;padding:3px 10px;white-space:nowrap}.wp-list-table.keys .wcsn-key-status.available{background-color:#d4edda;border-color:#c3e6cb;color:#155724}.wp-list-table.keys .wcsn-key-status.pending{background-color:#fff3cd;border-color:#ffeeba;color:#856404}.wp-list-table.keys .wcsn-key-status.sold{background:#cce5ff;border-color:#b8daff;color:#004085}.wp-list-table.keys .wcsn-key-status.cancelled{background-color:#d6d8d9;border-color:#c6c8ca;color:#1b1e21}.wp-list-table.stocks .column-action,.wp-list-table.stocks .column-stock{width:10%}.wp-list-table.stocks .column-source{width:20%}.wp-list-table.stocks .column-sku{width:25%}.tablenav .wcsn_search_customer+.select2-container,.tablenav .wcsn_search_order+.select2-container,.tablenav .wcsn_search_product+.select2-container{font-size:14px;margin:1px 6px 4px 1px;min-width:200px!important;vertical-align:middle}._serial_key_source_field label{margin:0;width:100%}.wcsn-tools-tab-status table h2{font-size:14px;margin:0}.wcsn-tools-tab-status table tbody tr td:first-child{font-size:1.1em;font-weight:400;width:33%}.wcsn-tools-tab-status table tbody tr td:nth-child(2){width:1em} diff --git a/trunk/assets/dist/css/frontend-style.asset.php b/trunk/assets/dist/css/frontend-style.asset.php new file mode 100644 index 00000000..14341f63 --- /dev/null +++ b/trunk/assets/dist/css/frontend-style.asset.php @@ -0,0 +1 @@ + array(), 'version' => '630a7ef02a321c38e3ae'); diff --git a/trunk/assets/dist/css/frontend-style.css b/trunk/assets/dist/css/frontend-style.css new file mode 100644 index 00000000..48a25ce8 --- /dev/null +++ b/trunk/assets/dist/css/frontend-style.css @@ -0,0 +1 @@ +.wcsn-api-form input[type=email],.wcsn-api-form input[type=text],.wcsn-api-form select{box-sizing:border-box;display:block;width:100%}.wcsn-api-form .required{border-bottom:0!important;color:#e2401c} diff --git a/trunk/assets/dist/images/add-generator.png b/trunk/assets/dist/images/add-generator.png new file mode 100644 index 0000000000000000000000000000000000000000..e0c4fcfafe182e3959d8d02606312efa2deb449a GIT binary patch literal 82665 zcmeFYc~nws_&L(gseN11l|k4?fYXLhUZzND;lPT8tO zbJd!^_Qn|P@lIH`t|IZpnP$hoPWU+3hq-?|({ZLupK~M5;_1E%Zv&sQHe{}lpY z3;!R5FruXh0>wx2DjAOqqo?DW;|&{5*3Y!-HM=#;r1qkDi(G;ZOTrSDupskIDw|DN z5n~+7d<76F#Ka3RsSn(Y-fk@_$caV?8xoakhVS(_G~=sTwWzfq(8$!5khP$`T;> z<@vGBOH<6JBa*Ce7I-j>83f!3iaRi}8T4W8GqZ_jw%YxuGZM{J0^qV=Y>YXmG3hK+ zq+BI{U6#C1uCX2Q$__7aRk57=`onnI;_o_sZ2$-qgZcIKGAKrCamo*3ZZZ97YmqA7 z4$UXBU3ED+QNNmcn_a)(ImTAo7ko|u^udV@AVb*b0y{@X8$DGTtHg9kc%Q5)0-kuJ zOF0~v=kcj<3r(b#(I1x1o}b<^BU;1<^&W_(m%Hr@^|N0BcgJ)p*C>LfPW?!N`rSlN zJZqTD&)APkRONPA%yu01+9W3)Cnr8FJ9=@lKldw432o6gmt@Z0Ik7mh7IHFbbZgGl z)jxBhX1-kE>;i^UwZVf5psFqRMFrWYJM^+=#uLjDfwx{ClzFGx+8aQW;t#yday-Jw~Nu8f1npak;r;&zFSiN2&bUfPL)JQ~X$^-M(h=|Ilp zD1c6GmlLY-(!5r>v@okt@a*=JwI%#x$!MkF8^fcRB<0UTfa2xmVP<|(O_&@t$8E2$ z$Wy*!C7CKOT1#=XtTEAc)-Z)kSQLkOmGWv7W^PmOgGDGd*@BBLe-kG5xW^OU!AITTbpIjJ^#>+`jZwQxjk z!GWX}KdagFUSbVp&V>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l4`02NJj!+J{{SpF<|ssK9&^4aNp?d%aa7&49!+UQ2i z3}+ueo>5$VfALhr7Uv<{W|dU`2}z0g_7N|%;4Jhddc~DIcnN%UI!~g&M&?O+dzQpj_CqRn^T3~cEyf=*_bqmKlznU*n^jLFhzAVWj%wy?1 z^?B0cBjX&qH}0`+{#L}Rzb&w_4;KA8U%7Z{$=d(VKQ!wyJ@AG9mq?%E9_!w3qj%B1 I`Qgm}0x7}*DF6Tf literal 0 HcmV?d00001 diff --git a/trunk/assets/dist/images/csv-export.png b/trunk/assets/dist/images/csv-export.png new file mode 100644 index 0000000000000000000000000000000000000000..7337d35a07c14e1510fbb2de7e59ad36def73765 GIT binary patch literal 70115 zcmeFZc~nws{5NVxQya{zPJ?6RDKn?EoJA`uD>F(<3#W|C6cLA<0L7+bqjt(PCumYL zMKc9Q)Y76fB_~i&&pp{B1v=UAnIdm>z#nh1h6g)WDK=gUVmlX`b z<>xm0U*8G|kALyZKO{2DWaR*1=e12fH@$0D2*2E{-)z2f$FbU%M`{oGb^jA>sc!sk z_)FNKlck$Bv5&g`Rln}9Z6$X?orw0>ZPm(8zdszY!$$6D;yH(41$mr{+yQA5m2SZi z{3Bc7lSD`scR(J~$Q@|n)M+{&07wLmkm!hiPdZNxuUkIbzrIFUanih2WqSFCeabf+ zmruSQ{69nf_mN9Ykdji$#+j)~$~r{TlIRy&)9H6}Bm-WZAF5}a?joB9bm~{H&~e^F zTV}#*6H^SIB<^egtRUsd6RZDJ4;oxCtSzAWBH+m10X3090z2da6)9jMx%gaME}}89 zW=X`bW!p~IjHU%?RJfFrM09Uyf^1RJA^V*CMF4NL`5CgV!iB^!PBTf1Sr^Yto*0-1QeI1Rc(ep zm<6<`jHtx1?2yeS?pkDhTb-Xq5$jr$JI}}6=@EW4Ob;*n*09*^$x~NSvNQW5Udhf< zYwfYSdWS}|cRqhOYj_s2vn^>(^jEs1X_0NA3A?AG+_m3D6orS(=@xBO+nzkz{TCP{ z>egD-gWYY@w1gmMXm~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!z}tEBoC*-_%2BMvq*Os(y@0Togs?y7$8YNcC1FiOk(ADHrZ zb#xVy^FF|t$+3;3e*;Cwb;k6FE>m>}dV^v%yXqr;v=YM?F|ON4SD}KV;-GL@sFm@V z?KYtbo>rNX$8btO359nh303Wq^iB9Xo&JKW2;cdmGe2ByLaN9ihO0H`dgeW8$~P&8 z?~FZF#Y)0TON?(#3Qw0jr6h68_J;M`=BD%o`~PKQMAm#GfoFdqMn6{%I}XFJCq*2P!&49q>Sy7YHrD)yb~ zHC}(Z-9qcZ;*avLb8`iJLdL+(xJl&?zM^84GSG)ED9aJ*(YayLC`0qDN)qSW9!AoC zDAIdsi{ycPq^W9h1m7sPR4K&XUel`}@GlcuQrH`9=X^kIY#v~1IIc!nJX)Vt>n;ul z1IwQ_7$bd`6{)fL35oWovH4S&O}hqBLG!c)gk4qCbn4B{r8RRZ#cJo9Ib-@=DR#4_ zQ;Hw#=1l9|_09NVS|F%(*5YXsflT}F`=+wIb`B^0A75w^QHyr?L9_Bn7nGm-`NzOr KRX?1#@IL?rTGg%q literal 0 HcmV?d00001 diff --git a/trunk/assets/dist/images/csv-import.png b/trunk/assets/dist/images/csv-import.png new file mode 100644 index 0000000000000000000000000000000000000000..eead52175b5a0e13dfee3dd50f3a56b7c98f0192 GIT binary patch literal 57578 zcmeFZc~p|y`!`I(X*Q1yr@`rzm32xj%UQI+GIJ_DIiO-?=72cn1S*x4c}neMil#z? zL*_u1;D}h7l%!ZHC@7eQq==*lh=4pd_Wl0Wde?g2=f8J7|2%gq!Ta9#-q*f{&vjjU zU)%KaF7|5ccCG_~Kxz(W?c6}1--bY-6>e)*0e4XT8^plJ+Q_rsF(An&xY?fsRd;Jm0KcpZI^lc*1ggneFTea72sDCnusiX0!m=ra>*uSSBK>)tO-U8+ z{4S22n`H3}_XfU#w7&OPzwpY@^Jz%`^3rX3@BH@NCmb4(zTf!HP*ZUJ95FbYe>O45 z)WGlIG+fkLidd)bwT*uTKZjBD70(l7AEMi zsP^klw@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9#i(L7|)xalUVK)^HUE+qW2pLQ-#9#`DK@6{#d(;w$PH+k?_OLAu2QdIfWtA%V-l&O3|%zOQnBmtYt^lCN>j55ceR zGD8+&;SCO!)KJ3oR@df>HWRj{95y8oT^phVL7&_$q>li5#K8R?)zJGw$)LbY&x3`D zI#A`7k4A0!%B+)tsc+fX-iOhP7DS+=J0KDFzd-QHWYzmWV+lYFR| zac+tcRZYu0yJUZq;L(|!d8&XgFhfdgyY_yTn*g3j6CA3v)4V+9Lq-gkaIr~3Jf?cd*>-PUY)zxkg1yvpd+x%~#`gulg6Of{&%Iywy@`&0R6Kv{`>gt<346<9LF*2aJ&AXN>p*?a28{(lxgSJz*AynnmDUEIHOCu(!7_nqI|d>*o= zpyBg_2gZ;UoDXaSpkl@f55O}-4CxLBK$E(_H9ZXt;8{+FIgE^uYdb8M!E@cf8CEtH ksD2*ki0T2!fi~!0ebvJi=5~S(;8XEDUHx3vIVCg!096k&CIA2c literal 0 HcmV?d00001 diff --git a/trunk/assets/dist/images/txt-import.png b/trunk/assets/dist/images/txt-import.png new file mode 100644 index 0000000000000000000000000000000000000000..d65f68d48dd019f968ec5fe692012215070ac0eb GIT binary patch literal 79528 zcmeFZdsLEJ^fpR&_bxSSm!+n=+GS-%S!$_BcXyex(@OJ3<~CDQOv4MHbhn#QX;n--kUwphdkP(84`>i-9Nqp5{Y=m*1lPJ{to9EnTVmHxHDR zvj%uLFUG^=AgHX}Yy^0-Fyw&S0T8GHzjQWm5on$royK*h!kp=?> z)pZr7vnRqu16Af01Q+qhe&I2zn12-BMkhKUD?YtM?vDvNP=+4ZVDzq4e|@X|!B+k2 z=}R}dl8k!2cmKKR%;G;j-1*Z3IJ%+#?^YgbKg3*bm6$}0jPY@{J6QB?)m?JH~)v|=2{70(0dQEoK<5# zzq*3m+T-M7J%emtB;<=j*m$j|Y_QoBX$DL?Ga0amD|u6+C1e9IeOB@v8`7S$Z_*)* zpQI84c2HfvW$T<>fP9}NJA%xv{0KJ1ABt+yw_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Y*Uvb!8jAbFRIkW9zb-)(rBN}z9M9^!H$JU)MXFC2WB20bo(06)P z`$-$WT`;=dfhXVEZ}2wpQ{HUi(cnX$ow;>#6uvCkFr+8^aI8*8m3UIz>eo*fh@lwAQu62={i!z)tZ$k z(aV`x9V9vqg8g%Veuo3q>rRT;fPUCGGY&uPB5tn$fMK`_TV~z`%~MLJjbt`=lqEmq zbtG22weV$9!nZ*mMpQzrcvYTclosYjp_ zK3-pJj`HUO_tahOVPBO(!pnsh%(IcxAD}<=p_5(*)r~-o5^q!a6_2na z3K^N0ub;FhFs^YJGh4A}05GoKWA|cpo3Pc;)nl9Zwr7E|jkG-hpg;`ZjQ>3>i1!QQ z702>CZZb4>jwS%T?g!HrKbeoudK-^kg!(GNz!z9<7`W?RF6hdHYYHAA>W4lh~S&@ zL;Vy0N=1DcsldL%_u2T=FtjU}UqC(bQG5 z6(~*RD`1>Ny=0uqEHJ-;?!TS*+E}Qt^1evo3B{fFs5s54_rxGrMgc@#>FtSf{YXDfQV z6%@H--5Hiq!YbFa4j<>+5;Z>$47w)#S;hfR@llSLE)WTrXg!^C$7_vt|KXZQUR_Nk z78!hGhu^Dw2}AymaX6TirY??+_ADXgvxS|T>=paa8si;!@d#rO7iYT_Vchwr(mW#i zGj}P7E_3&e8;adu)zIxBAa7Ac-~G|z26kvI$y@9oJUaXAVcfOR#gxV84$9BYr}s0y z^ls895VSqqkphktuQX~w=Ho9rK@2W%Vf$U`9$3NvTZhs*rx<5)fg^8 array(), 'version' => '8220dccf5702b2fb7fb8'); diff --git a/trunk/assets/dist/js/admin-script.js b/trunk/assets/dist/js/admin-script.js new file mode 100644 index 00000000..07b5f249 --- /dev/null +++ b/trunk/assets/dist/js/admin-script.js @@ -0,0 +1 @@ +!function(){"use strict";function e(a){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(a)}!function(a,r){if("undefined"==typeof wc_serial_numbers_vars)return!1;a(document).ready((function(){a(document).on("click",".wcsn-key",(function(){var e=a(this);if(!e.hasClass("copying")){var r=a("");a("body").append(r),r.val(e.data("unmasked")).select(),document.execCommand("copy"),r.remove(),e.text(wc_serial_numbers_vars.i18n.copied).addClass("copying"),setTimeout((function(){e.text(e.data("masked")).removeClass("copying")}),1e3)}})).on("mouseenter mouseleave",".wcsn-key:not(.copying)",(function(e){var r=a(this);"mouseenter"===e.type?r.text(r.data("unmasked")):r.text(r.data("masked"))})).on("submit",".wcsn-api-form",(function(e){e.preventDefault();var r=a(this);a.ajax({url:wc_serial_numbers_vars.apiurl,method:"POST",data:r.serialize(),dataType:"json",beforeSend:function(){r.addClass("loading"),r.find(".wcsn-api-response").text("Loading...")},success:function(e){r.find(".wcsn-api-response").text(JSON.stringify(e,null,2))},error:function(e){r.find(".wcsn-api-response").text(JSON.stringify(e,null,2))},always:function(){r.removeClass("loading")}})})),a(".wcsn_search_product, .wc-serial-numbers-select-product").select2({ajax:{cache:!0,delay:500,url:wc_serial_numbers_vars.ajaxurl,method:"POST",dataType:"json",data:function(e){return{action:"wc_serial_numbers_search_product",nonce:wc_serial_numbers_vars.search_nonce,search:e.term,page:e.page||1}},processResults:function(e,a){return!1===e.success&&alert(e.data.message),a.page=a.page||1,{results:e.results,pagination:{more:e.pagination.more}}}},placeholder:wc_serial_numbers_vars.i18n.search_product,minimumInputLength:1,allowClear:!0}),a(".wcsn_search_order").select2({ajax:{cache:!0,delay:500,url:wc_serial_numbers_vars.ajaxurl,method:"POST",dataType:"json",data:function(e){return{action:"wc_serial_numbers_search_orders",nonce:wc_serial_numbers_vars.search_nonce,search:e.term,page:e.page}},processResults:function(e,a){return!1===e.success&&alert(e.data.message),a.page=a.page||1,{results:e.results,pagination:{more:e.pagination.more}}}},placeholder:wc_serial_numbers_vars.i18n.search_order,minimumInputLength:1,allowClear:!0}),a(".wcsn_search_customer").select2({ajax:{cache:!0,delay:500,url:wc_serial_numbers_vars.ajaxurl,method:"POST",dataType:"json",data:function(e){return{action:"wc_serial_numbers_search_customers",nonce:wc_serial_numbers_vars.search_nonce,search:e.term,page:e.page}},processResults:function(e,a){return!1===e.success&&alert(e.data.message),a.page=a.page||1,{results:e.results,pagination:{more:e.pagination.more}}}},placeholder:wc_serial_numbers_vars.i18n.search_customer,minimumInputLength:1,allowClear:!0}),void 0!==a.fn.datepicker&&a(".wc-serial-numbers-select-date").datepicker({changeMonth:!0,changeYear:!0,dateFormat:"yy-mm-dd",firstDay:7,minDate:new Date}),void 0!==e(a.fn.select2)&&a(":input.wcsn-select2").filter(":not(.enhanced)").each((function(){var e=a(this),r={allowClear:e.data("allow_clear")&&!e.prop("multiple")||!0,placeholder:e.data("placeholder")||e.attr("placeholder")||"",minimumInputLength:e.data("minimum_input_length")?e.data("minimum_input_length"):0,ajax:{url:wc_serial_numbers_vars.ajaxurl,dataType:"json",delay:250,method:"POST",data:function(a){return{term:a.term,action:e.data("action"),type:e.data("type"),_wpnonce:e.data("nonce")||wc_serial_numbers_vars.ajax_nonce,exclude:e.data("exclude"),include:e.data("include"),limit:e.data("limit"),page:a.page||1}},processResults:function(e){return e.page=e.page||1,e},cache:!0}};e.data("action")||delete r.ajax,e.select2(r).addClass("enhanced")})),a('#wcsn-add-key-form :input[name="status"]').on("change",(function(){var e=a(this),r=e.closest("form"),n=r.find(':input[name="customer_id"]'),t=r.find(':input[name="order_id"]');if(!a(this).is(":checked")||!a(this).val())return!1;"create_order"===e.val()?(n.prop("required",!0).closest("tr").show(),t.prop("required",!1).closest("tr").hide()):"existing_order"===e.val()?(n.prop("required",!1).closest("tr").hide(),t.prop("required",!0).closest("tr").show()):(n.prop("required",!1).closest("tr").hide(),t.prop("required",!1).closest("tr").hide())})).trigger("change")}))}(jQuery,window)}(); \ No newline at end of file diff --git a/trunk/assets/dist/js/frontend-script.asset.php b/trunk/assets/dist/js/frontend-script.asset.php new file mode 100644 index 00000000..9a49bf5f --- /dev/null +++ b/trunk/assets/dist/js/frontend-script.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'fade3928866aae61465a'); diff --git a/trunk/assets/dist/js/frontend-script.js b/trunk/assets/dist/js/frontend-script.js new file mode 100644 index 00000000..7b9a4842 --- /dev/null +++ b/trunk/assets/dist/js/frontend-script.js @@ -0,0 +1 @@ +!function(a){"use strict";a(document).ready((function(){a(document).on("submit",".wcsn-api-form",(function(e){e.preventDefault();var t=a(this),n=t.find('input[type="submit"]');if(t.hasClass("loading"))return!1;a.ajax({url:wc_serial_numbers_frontend_vars.ajax_url,method:"POST",data:t.serialize(),dataType:"json",beforeSend:function(){t.addClass("loading"),n.attr("data-label",n.val()).attr("disabled","disabled").val(wc_serial_numbers_frontend_vars.i18n.loading)},complete:function(a){var e=a.responseJSON;e&&e.message&&window.alert(e.message),n.removeAttr("disabled").val(n.attr("data-label")),t.removeClass("loading")}})}))}))}(jQuery); \ No newline at end of file diff --git a/trunk/assets/images/add-generator.png b/trunk/assets/images/add-generator.png new file mode 100644 index 0000000000000000000000000000000000000000..e0c4fcfafe182e3959d8d02606312efa2deb449a GIT binary patch literal 82665 zcmeFYc~nws_&L(gseN11l|k4?fYXLhUZzND;lPT8tO zbJd!^_Qn|P@lIH`t|IZpnP$hoPWU+3hq-?|({ZLupK~M5;_1E%Zv&sQHe{}lpY z3;!R5FruXh0>wx2DjAOqqo?DW;|&{5*3Y!-HM=#;r1qkDi(G;ZOTrSDupskIDw|DN z5n~+7d<76F#Ka3RsSn(Y-fk@_$caV?8xoakhVS(_G~=sTwWzfq(8$!5khP$`T;> z<@vGBOH<6JBa*Ce7I-j>83f!3iaRi}8T4W8GqZ_jw%YxuGZM{J0^qV=Y>YXmG3hK+ zq+BI{U6#C1uCX2Q$__7aRk57=`onnI;_o_sZ2$-qgZcIKGAKrCamo*3ZZZ97YmqA7 z4$UXBU3ED+QNNmcn_a)(ImTAo7ko|u^udV@AVb*b0y{@X8$DGTtHg9kc%Q5)0-kuJ zOF0~v=kcj<3r(b#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Aq5F zPAE6fr%3XxTS3_`oCUd zT`WcNsKe=gKVe^ECyFPJH~BrW((psIM@rT2_E5dGs)~_KdrSpH+rVLC0owR-Gt{`TP1htMiz_~xx-AVoZ=@d z21)pem>_3*Ha`I^vG!lkN4BcDB057F@EWG|uWkzcn`VzC{BKbILoq7V^&M~{Oh;aU zB7E`oU!`TrP1+oagYviB6>!~}mgAVOn{jxD{(!f=8@NvHOF<7n#;2Tx1|bQ`bxl*o&& zx)m-2DU++2y`^Xs?kGUg36H|_Ldru?sjVx?iBpWrKVr`+6=YwbzGbVe`jOZgXKxgn zjD>ju3cRj@pKfRT07vOYMn;}*Q*e4%ayi$;Na2SrSB5gMz1jj5ezrI|d2_E}V*8d+ z(M)Tdr}DxS$k>FJfamBS@rl4`02NJj!+J{{SpF<|ssK9&^4aNp?d%aa7&49!+UQ2i z3}+ueo>5$VfALhr7Uv<{W|dU`2}z0g_7N|%;4Jhddc~DIcnN%UI!~g&M&?O+dzQpj_CqRn^T3~cEyf=*_bqmKlznU*n^jLFhzAVWj%wy?1 z^?B0cBjX&qH}0`+{#L}Rzb&w_4;KA8U%7Z{$=d(VKQ!wyJ@AG9mq?%E9_!w3qj%B1 I`Qgm}0x7}*DF6Tf literal 0 HcmV?d00001 diff --git a/trunk/assets/images/csv-export.png b/trunk/assets/images/csv-export.png new file mode 100644 index 0000000000000000000000000000000000000000..7337d35a07c14e1510fbb2de7e59ad36def73765 GIT binary patch literal 70115 zcmeFZc~nws{5NVxQya{zPJ?6RDKn?EoJA`uD>F(<3#W|C6cLA<0L7+bqjt(PCumYL zMKc9Q)Y76fB_~i&&pp{B1v=UAnIdm>z#nh1h6g)WDK=gUVmlX`b z<>xm0U*8G|kALyZKO{2DWaR*1=e12fH@$0D2*2E{-)z2f$FbU%M`{oGb^jA>sc!sk z_)FNKlck$Bv5&g`Rln}9Z6$X?orw0>ZPm(8zdszY!$$6D;yH(41$mr{+yQA5m2SZi z{3Bc7lSD`scR(J~$Q@|n)M+{&07wLm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=G~GX9uhsF*7ldG~#f z-0SYP&!}^EJKmY}jb|jC6V3ZaG2p%Ik2m4g>&3#^a7{nO5^{z~IHKz^<(c!jUG>Uh zzw+Qvw3H`db-MOR%$vmo`30ES)Acmnp}D%kyqs!6bD;1 z4t#QfYJ4A9fgB-C$_Q)L+bnwM4yJlX=sBkWTYC-sy;5gCu}0=%^hY|k~<795vpCN{q>@HWkdy&d0SQQV@{CZHEJPmvo{x0ab8{n zy1~J#yUlbv8pF3MA?47KI_%0!H25iUHoOe zq~~aWpCl7dJzZUwU*(nRszU|% zKP&XQSOn5SE8!4us`IKNoHFLk4$}hji#mbsEH*Yd*IYraV)e?aP{Az{x;~S5M3oxa#4u}29TtI8O+36Jd z&SCv|^VSk17HN?*Hu!z}tEBoC*-_%2BMvq*Os(y@0Togs?y7$8YNcC1FiOk(ADHrZ zb#xVy^FF|t$+3;3e*;Cwb;k6FE>m>}dV^v%yXqr;v=YM?F|ON4SD}KV;-GL@sFm@V z?KYtbo>rNX$8btO359nh303Wq^iB9Xo&JKW2;cdmGe2ByLaN9ihO0H`dgeW8$~P&8 z?~FZF#Y)0TON?(#3Qw0jr6h68_J;M`=BD%o`~PKQMAm#GfoFdqMn6{%I}XFJCq*2P!&49q>Sy7YHrD)yb~ zHC}(Z-9qcZ;*avLb8`iJLdL+(xJl&?zM^84GSG)ED9aJ*(YayLC`0qDN)qSW9!AoC zDAIdsi{ycPq^W9h1m7sPR4K&XUel`}@GlcuQrH`9=X^kIY#v~1IIc!nJX)Vt>n;ul z1IwQ_7$bd`6{)fL35oWovH4S&O}hqBLG!c)gk4qCbn4B{r8RRZ#cJo9Ib-@=DR#4_ zQ;Hw#=1l9|_09NVS|F%(*5YXsflT}F`=+wIb`B^0A75w^QHyr?L9_Bn7nGm-`NzOr KRX?1#@IL?rTGg%q literal 0 HcmV?d00001 diff --git a/trunk/assets/images/csv-import.png b/trunk/assets/images/csv-import.png new file mode 100644 index 0000000000000000000000000000000000000000..eead52175b5a0e13dfee3d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V?S~J)wep1}%Sy3r@{SH>DjvI-+~8U783#Y$LDs9R6`EZ69s${6N~@ZgVzt_fZ-Z zonHL{af9~QScK5w%xlBv*pAd1LFC>(a=0PzDu@m& zJ?2%g@Tmhl+SpLQ!rc$dH()Dz4Jki>*A{NGlw5|PFgi98LH5H*%ZZ}yutp>3AQ8?M z5ZigBb3=dj1?EDA_@1IWXkZ7n+lA?veh=qjgMJ|)HDiR#un@G4)#j+PIPwQjvzp#Rs?Tz z+qXk$5=uM$5m+Q((3SBM?%@B0J+wiW)8OF!s7z9T7_WDWQXv3SQ5%35z&W$S;rMnM z^jDACty)T(1iP*VXJ3}s&kVmr611c6GVbw|tbN51B1%zer5oEBeIzZ*3Vzy$OrY=^ zSqRo?9#i(L7|)xalUVK)^HUE+qW2pLQ-#9#`DK@6{#d(;w$PH+k?_OLAu2QdIfWtA%V-l&O3|%zOQnBmtYt^lCN>j55ceR zGD8+&;SCO!)KJ3oR@df>HWRj{95y8oT^phVL7&_$q>li5#K8R?)zJGw$)LbY&x3`D zI#A`7k4A0!%B+)tsc+fX-iOhP7DS+=J0KDFzd-QHWYzmWV+lYFR| zac+tcRZYu0yJUZq;L(|!d8&XgFhfdgyY_yTn*g3j6CA3v)4V+9Lq-gkaIr~3Jf?cd*>-PUY)zxkg1yvpd+x%~#`gulg6Of{&%Iywy@`&0R6Kv{`>gt<346<9LF*2aJ&AXN>p*?a28{(lxgSJz*AynnmDUEIHOCu(!7_nqI|d>*o= zpyBg_2gZ;UoDXaSpkl@f55O}-4CxLBK$E(_H9ZXt;8{+FIgE^uYdb8M!E@cf8CEtH ksD2*ki0T2!fi~!0ebvJi=5~S(;8XEDUHx3vIVCg!096k&CIA2c literal 0 HcmV?d00001 diff --git a/trunk/assets/images/txt-import.png b/trunk/assets/images/txt-import.png new file mode 100644 index 0000000000000000000000000000000000000000..d65f68d48dd019f968ec5fe692012215070ac0eb GIT binary patch literal 79528 zcmeFZdsLEJ^fpR&_bxSSm!+n=+GS-%S!$_B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Gj}P7E_3&e8;adu)zIxBAa7Ac-~G|z26kvI$y@9oJUaXAVcfOR#gxV84$9BYr}s0y z^ls895VSqqkphktuQX~w=Ho9rK@2W%Vf$U`9$3NvTZhs*rx<5)fg^8'; + print_r( $data['body'] ); + echo ''; +} + +$links = array( + 'check' => 'Check request', + 'activation' => 'Activation request', + 'deactivation' => 'Deactivation', + 'version_check' => 'Version Check', +); + +foreach ( $links as $key => $value ) { + echo '' . $value . ' | '; +} + +// Valid check request +if ( $request == 'check' ) { + $args = array( + 'wc-api' => 'serial-numbers-api', + 'request' => 'check', + 'email' => $email, + 'serial_key' => $license_key, + 'product_id' => $product_id, + ); + echo '
    '; + echo '
    '; + echo 'Valid check request:
    '; + execute_request( $args ); +} + +// Valid activation request +if ( $request == 'activation' ) { + $args = array( + 'wc-api' => 'serial-numbers-api', + 'request' => 'activate', + 'email' => $email, + 'serial_key' => $license_key, + 'product_id' => $product_id, + 'instance' => $instance, + ); + + echo 'Valid activation request:
    '; + execute_request( $args ); +} + + +// Valid deactivation reset request +if ( $request == 'deactivation' ) { + $args = array( + 'wc-api' => 'serial-numbers-api', + 'request' => 'deactivate', + 'email' => $email, + 'serial_key' => $license_key, + 'product_id' => $product_id, + 'instance' => $instance, + ); + + echo 'Valid deactivation request:
    '; + execute_request( $args ); +} + +// Version check +if ( $request == 'version_check' ) { + $args = array( + 'wc-api' => 'serial-numbers-api', + 'request' => 'version_check', + 'email' => $email, + 'serial_key' => $license_key, + 'product_id' => $product_id, + 'instance' => $instance, + ); + + echo 'Valid Version check request:
    '; + execute_request( $args ); +} diff --git a/trunk/languages/wc-serial-numbers.pot b/trunk/languages/wc-serial-numbers.pot new file mode 100644 index 00000000..f2292502 --- /dev/null +++ b/trunk/languages/wc-serial-numbers.pot @@ -0,0 +1,1543 @@ +# Copyright (C) 2024 PluginEver +# This file is distributed under the GPL v2 or later. +msgid "" +msgstr "" +"Project-Id-Version: WC Serial Numbers 1.7.6\n" +"Report-Msgid-Bugs-To: https://pluginever.com/support\n" +"POT-Creation-Date: 2024-07-30 09:41:06+00:00\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2024-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-Country: United States\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: " +"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_" +"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-Bookmarks: \n" +"X-Textdomain-Support: yes\n" +"X-Generator: grunt-wp-i18n 1.0.3\n" + +#: lib/Lib/Model.php:424 +#. translators: %s: database error message. +msgid "Could not insert item into the database error %s" +msgstr "" + +#: lib/Lib/Model.php:489 +msgid "Could not update item in the database." +msgstr "" + +#: lib/Lib/Plugin.php:309 +msgid "Go Pro" +msgstr "" + +#: lib/Lib/Plugin.php:655 src/Admin/Settings.php:190 +msgid "Documentation" +msgstr "" + +#: lib/Lib/Plugin.php:662 +msgid "Support" +msgstr "" + +#: lib/Lib/Plugin.php:669 +msgid "Review" +msgstr "" + +#: lib/Lib/Plugin.php:675 +msgid "More Plugins" +msgstr "" + +#: lib/Lib/Plugin.php:692 src/Admin/Menus.php:171 src/Admin/Menus.php:172 +msgid "Settings" +msgstr "" + +#: lib/Lib/Settings.php:97 +msgid "Settings saved." +msgstr "" + +#: lib/Lib/Settings.php:236 lib/Lib/Settings.php:324 +msgid "Recommended" +msgstr "" + +#: lib/Lib/Settings.php:237 lib/Lib/Settings.php:325 +msgid "Install Now" +msgstr "" + +#: lib/Lib/Settings.php:296 +msgid "Need Help?" +msgstr "" + +#: lib/Lib/Settings.php:339 +msgid "Join our Community" +msgstr "" + +#: lib/Lib/Settings.php:343 +msgid "Request a Feature" +msgstr "" + +#: lib/Lib/Settings.php:347 +msgid "Report a Bug" +msgstr "" + +#: src/API.php:68 +msgid "Missing data." +msgstr "" + +#: src/Admin/Actions.php:39 src/Ajax.php:37 src/Ajax.php:100 src/Ajax.php:175 +msgid "You do not have permission to access this endpoint." +msgstr "" + +#: src/Admin/Actions.php:193 src/Admin/Actions.php:224 +msgid "You do not have permission to perform this action." +msgstr "" + +#: src/Admin/Actions.php:244 +msgid "Key added successfully." +msgstr "" + +#: src/Admin/Actions.php:246 +msgid "Key updated successfully." +msgstr "" + +#: src/Admin/Admin.php:65 +msgid "Search by product" +msgstr "" + +#: src/Admin/Admin.php:66 +msgid "Search by order" +msgstr "" + +#: src/Admin/Admin.php:67 +msgid "Search by customer" +msgstr "" + +#: src/Admin/Admin.php:68 +msgid "Show" +msgstr "" + +#: src/Admin/Admin.php:69 +msgid "Hide" +msgstr "" + +#: src/Admin/Admin.php:70 src/Frontend/Frontend.php:56 +msgid "Copied" +msgstr "" + +#: src/Admin/Admin.php:108 +#. translators: 1: Plugin name 2: WordPress +msgid "" +"Thank you for using %1$s! Share your appreciation with a five-star review " +"%2$s." +msgstr "" + +#: src/Admin/Admin.php:110 +msgid "Thanks :)" +msgstr "" + +#: src/Admin/Admin.php:128 +#. translators: 1: Plugin version +msgid "Version %s" +msgstr "" + +#: src/Admin/Admin.php:141 src/Admin/Menus.php:54 src/Admin/Menus.php:89 +#: src/Admin/Menus.php:90 src/Admin/Menus.php:435 src/Admin/Metaboxes.php:36 +#: src/Admin/Metaboxes.php:257 src/Functions/Template.php:226 +msgid "Serial Numbers" +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:39 +#: src/Admin/ListTables/KeysTable.php:356 +msgid "Activation" +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:40 src/Admin/Menus.php:120 +#: src/Admin/Menus.php:121 src/Admin/views/html-list-activations.php:18 +msgid "Activations" +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:100 +msgid "No activations found. Once a serial key is activated, it will appear here." +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:113 +#: src/Admin/ListTables/KeysTable.php:281 +#: src/Admin/ListTables/StockTable.php:82 +msgid "Filter" +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:164 +#: src/Admin/ListTables/ActivationsTable.php:239 +#: src/Admin/ListTables/KeysTable.php:336 +#: src/Admin/ListTables/KeysTable.php:428 src/Admin/views/html-edit-key.php:130 +msgid "Delete" +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:176 +#: src/Admin/views/html-api-actions.php:141 src/Frontend/Shortcodes.php:146 +msgid "Instance" +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:177 +#: src/Admin/ListTables/KeysTable.php:350 +#: src/Admin/ListTables/StockTable.php:95 src/Admin/views/html-add-key.php:33 +#: src/Admin/views/html-api-actions.php:118 +#: src/Admin/views/html-api-validation.php:121 +#: src/Admin/views/html-edit-key.php:37 src/Deprecated/Functions.php:358 +#: src/Frontend/Shortcodes.php:44 src/Frontend/Shortcodes.php:141 +msgid "Product" +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:178 +#: src/Admin/ListTables/KeysTable.php:349 src/Admin/Orders.php:233 +#: src/Admin/views/html-api-actions.php:131 +#: src/Admin/views/html-api-validation.php:134 src/Functions/Template.php:42 +#: src/functions.php:1009 +msgid "Key" +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:179 +#: src/Admin/views/html-api-actions.php:152 src/Frontend/Shortcodes.php:148 +msgid "Platform" +msgstr "" + +#: src/Admin/ListTables/ActivationsTable.php:180 +msgid "Activation Time" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:78 +msgid "key" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:79 +msgid "keys" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:170 +msgid "No keys found." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:170 +msgid "Add new key" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:174 +msgid "Keys can have one of the following statuses:" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:178 +#: src/Admin/ListTables/KeysTable.php:235 src/functions.php:46 +msgid "Available" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:180 +msgid "This means the key is available for purchase." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:183 +#: src/Admin/ListTables/KeysTable.php:242 src/functions.php:47 +msgid "Pending" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:185 +msgid "This means the key has been sold, but the order has not been completed yet." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:188 +#: src/Admin/ListTables/KeysTable.php:249 +#: src/Admin/ListTables/StockTable.php:97 src/functions.php:48 +msgid "Sold" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:190 +msgid "This means the key has been sold, and the order has been completed." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:193 +#: src/Admin/ListTables/KeysTable.php:256 src/Functions/Template.php:72 +#: src/functions.php:49 +msgid "Expired" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:195 +msgid "This means the key has expired and is no longer valid." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:198 +#: src/Admin/ListTables/KeysTable.php:263 src/functions.php:50 +msgid "Cancelled" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:200 +msgid "" +"This means the key has been cancelled and is no longer available for " +"purchase or use." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:226 +msgid "All keys." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:228 +msgid "All" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:233 +msgid "Available for sell." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:240 +msgid "Pending payment." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:247 +msgid "Sold keys." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:254 +msgid "Expired keys." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:261 +msgid "Cancelled keys." +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:337 +msgid "Reset Activations" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:351 src/Admin/views/html-add-key.php:120 +msgid "Order" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:352 +msgid "Validity" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:359 +msgid "Order Date" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:360 src/Admin/Menus.php:322 +#: src/Admin/Orders.php:245 src/Admin/views/html-add-key.php:91 +#: src/Admin/views/html-edit-key.php:92 src/Functions/Template.php:78 +#: src/functions.php:1034 +msgid "Status" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:426 +#. translators: %d: key id. +msgid "ID: %d" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:427 +#: src/Admin/ListTables/StockTable.php:143 +msgid "Edit" +msgstr "" + +#: src/Admin/ListTables/KeysTable.php:522 +#. translators: %1$s: validity, %2$s: validity. +msgid "%s Day
    After purchase" +msgid_plural "%s Days
    After purchase" +msgstr[0] "" +msgstr[1] "" + +#: src/Admin/ListTables/KeysTable.php:532 src/Admin/Orders.php:238 +#: src/Functions/Template.php:63 src/functions.php:1030 +msgid "Lifetime" +msgstr "" + +#: src/Admin/ListTables/ListTable.php:140 +#: src/Admin/ListTables/ListTable.php:142 +msgid "Filter by order" +msgstr "" + +#: src/Admin/ListTables/ListTable.php:163 +msgid "Filter by product" +msgstr "" + +#: src/Admin/ListTables/ListTable.php:186 +msgid "Filter by customer" +msgstr "" + +#: src/Admin/ListTables/StockTable.php:20 +msgid "stock" +msgstr "" + +#: src/Admin/ListTables/StockTable.php:21 +msgid "stocks" +msgstr "" + +#: src/Admin/ListTables/StockTable.php:70 +msgid "No products selling serial keys from \"stock\" found." +msgstr "" + +#: src/Admin/ListTables/StockTable.php:96 +msgid "Source" +msgstr "" + +#: src/Admin/ListTables/StockTable.php:98 src/Admin/Menus.php:282 +msgid "Stock" +msgstr "" + +#: src/Admin/ListTables/StockTable.php:172 +msgid "Manual" +msgstr "" + +#: src/Admin/ListTables/StockTable.php:174 +msgid "Generator Rule" +msgstr "" + +#: src/Admin/ListTables/StockTable.php:176 +msgid "Auto Generated" +msgstr "" + +#: src/Admin/ListTables/StockTable.php:178 +msgid "Unknown" +msgstr "" + +#: src/Admin/Menus.php:100 src/Admin/Menus.php:101 +#: src/Admin/views/html-list-keys.php:18 +msgid "Serial Keys" +msgstr "" + +#: src/Admin/Menus.php:137 src/Admin/Menus.php:138 +msgid "Tools" +msgstr "" + +#: src/Admin/Menus.php:154 src/Admin/Menus.php:155 +msgid "Reports" +msgstr "" + +#: src/Admin/Menus.php:191 src/Admin/Metaboxes.php:136 +#: src/Admin/Metaboxes.php:157 +msgid "Upgrade to Pro" +msgstr "" + +#: src/Admin/Menus.php:247 src/Admin/Menus.php:383 +msgid "Generators" +msgstr "" + +#: src/Admin/Menus.php:248 +msgid "API Toolkit" +msgstr "" + +#: src/Admin/Menus.php:249 src/Admin/views/html-list-keys.php:25 +msgid "Import" +msgstr "" + +#: src/Admin/Menus.php:250 src/Admin/views/html-list-keys.php:29 +msgid "Export" +msgstr "" + +#: src/Admin/Menus.php:337 src/Admin/Menus.php:344 src/Admin/Menus.php:362 +#: src/Admin/Menus.php:380 +msgid "Available in Pro Version" +msgstr "" + +#: src/Admin/Menus.php:338 src/Admin/Menus.php:345 src/Admin/Menus.php:363 +#: src/Admin/Menus.php:381 +msgid "Upgrade to Pro Now" +msgstr "" + +#: src/Admin/Menus.php:340 src/Admin/Menus.php:347 +msgid "Import Serial Numbers" +msgstr "" + +#: src/Admin/Menus.php:365 +msgid "Export Serial Numbers" +msgstr "" + +#: src/Admin/Menus.php:410 +msgid "Table exists" +msgstr "" + +#: src/Admin/Menus.php:412 +msgid "Table does not exist" +msgstr "" + +#: src/Admin/Menus.php:418 +msgid "Hourly cron" +msgstr "" + +#: src/Admin/Menus.php:419 +msgid "Daily cron" +msgstr "" + +#: src/Admin/Menus.php:425 +#. translators: %s: Next scheduled time. +msgid "Next run: %s" +msgstr "" + +#: src/Admin/Menus.php:427 +msgid "Not scheduled" +msgstr "" + +#: src/Admin/Metaboxes.php:57 +msgid "Sell keys" +msgstr "" + +#: src/Admin/Metaboxes.php:58 +msgid "Enable this if you are selling keys or licensing this product." +msgstr "" + +#: src/Admin/Metaboxes.php:71 +msgid "Delivery quantity" +msgstr "" + +#: src/Admin/Metaboxes.php:72 +msgid "Number of key(s) will be delivered per item. Available in PRO." +msgstr "" + +#: src/Admin/Metaboxes.php:92 src/Admin/Metaboxes.php:124 +msgid "Key source" +msgstr "" + +#: src/Admin/Metaboxes.php:110 +msgid "Software version" +msgstr "" + +#: src/Admin/Metaboxes.php:111 +msgid "Version number for the software. Ignore if it's not a software." +msgstr "" + +#: src/Admin/Metaboxes.php:112 +msgid "e.g. 1.0" +msgstr "" + +#: src/Admin/Metaboxes.php:126 +msgid "key available." +msgid_plural "keys available." +msgstr[0] "" +msgstr[1] "" + +#: src/Admin/Metaboxes.php:134 +msgid "Want to sell keys for variable products?" +msgstr "" + +#: src/Admin/Metaboxes.php:155 +msgid "" +"The free version of Serial Numbers for WooCommerce does not support product " +"variation." +msgstr "" + +#: src/Admin/Metaboxes.php:239 +msgid "Order missing serial numbers for this item." +msgstr "" + +#: src/Admin/Notices.php:49 +#. translators: %1$s: link to the plugin page, %2$s: link to the plugin page +msgid "" +"%s is not functional because you are using outdated version of the plugin, " +"please update to the version 1.2.1 or higher." +msgstr "" + +#: src/Admin/Notices.php:63 +#. translators: %1$s: link to the plugin page, %2$s: link to the plugin page +msgid "" +"Upgrade to %6$s to unlock the full potential of %5$s and avail a %1$s " +"discount by using the promo code %2$s. %3$s Upgrade Now%4$s." +msgstr "" + +#: src/Admin/Orders.php:53 src/Admin/Orders.php:166 +msgid "Add serial keys" +msgstr "" + +#: src/Admin/Orders.php:54 src/Admin/Orders.php:167 +msgid "Remove serial keys" +msgstr "" + +#: src/Admin/Orders.php:73 +msgid "Serial keys added successfully to the order." +msgstr "" + +#: src/Admin/Orders.php:77 +msgid "Serial keys removed successfully from the order." +msgstr "" + +#: src/Admin/Orders.php:114 src/Admin/Orders.php:146 +msgid "Order is fullfilled." +msgstr "" + +#: src/Admin/Orders.php:117 src/Admin/Orders.php:149 +msgid "Order is not fullfilled." +msgstr "" + +#: src/Admin/Orders.php:195 +#. Translators: %d: number of orders. +msgid "%d orders updated successfully." +msgstr "" + +#: src/Admin/Orders.php:228 +msgid "Serial keys sold with this product:" +msgstr "" + +#: src/Admin/Orders.php:237 +msgid "Expire date" +msgstr "" + +#: src/Admin/Orders.php:241 src/Admin/views/html-add-key.php:65 +#: src/Admin/views/html-edit-key.php:67 +msgid "Activation limit" +msgstr "" + +#: src/Admin/Orders.php:242 +msgid "Unlimited" +msgstr "" + +#: src/Admin/Orders.php:272 +#. translators: %s is the item number. +msgid "View Details" +msgstr "" + +#: src/Admin/Settings.php:25 +msgid "General" +msgstr "" + +#: src/Admin/Settings.php:46 +msgid "General Settings" +msgstr "" + +#: src/Admin/Settings.php:48 +msgid "These options determine the behavior and operation of the plugin." +msgstr "" + +#: src/Admin/Settings.php:52 +msgid "Auto-complete orders" +msgstr "" + +#: src/Admin/Settings.php:54 +msgid "Automatically completes orders after successful payments." +msgstr "" + +#: src/Admin/Settings.php:59 +msgid "Reuse keys" +msgstr "" + +#: src/Admin/Settings.php:61 +msgid "Recover failed, refunded keys for selling again." +msgstr "" + +#: src/Admin/Settings.php:62 +msgid "" +"If you enable this option, the keys will be available for selling again if " +"the order is refunded or failed." +msgstr "" + +#: src/Admin/Settings.php:68 +msgid "Revoke keys" +msgstr "" + +#: src/Admin/Settings.php:70 +msgid "Revoke keys when the order status changes to cancelled or refunded." +msgstr "" + +#: src/Admin/Settings.php:71 +msgid "" +"If you enable this option, the keys will be revoked when the order status " +"changes to cancelled or refunded." +msgstr "" + +#: src/Admin/Settings.php:76 +msgid "Hide keys" +msgstr "" + +#: src/Admin/Settings.php:78 +msgid "Keys will be masked in the list table." +msgstr "" + +#: src/Admin/Settings.php:83 +msgid "Disable software support" +msgstr "" + +#: src/Admin/Settings.php:85 +msgid "Disable Software Licensing support & API functionalities." +msgstr "" + +#: src/Admin/Settings.php:86 +msgid "" +"If you enable this option, the activation menu and it’s functionality will " +"be turned off." +msgstr "" + +#: src/Admin/Settings.php:95 +msgid "Stock Notification" +msgstr "" + +#: src/Admin/Settings.php:97 +msgid "These options determine the operation of the key's stock notification." +msgstr "" + +#: src/Admin/Settings.php:101 +msgid "Stock notification email" +msgstr "" + +#: src/Admin/Settings.php:103 +msgid "Sends notification emails when key stock is low." +msgstr "" + +#: src/Admin/Settings.php:109 +msgid "Stock threshold" +msgstr "" + +#: src/Admin/Settings.php:111 +msgid "" +"An email notification will be sent when the key stock falls below the " +"specified number." +msgstr "" + +#: src/Admin/Settings.php:116 +msgid "Notification recipient email" +msgstr "" + +#: src/Admin/Settings.php:118 +msgid "The email address which will be used to send email notifications." +msgstr "" + +#: src/Admin/Settings.php:152 +msgid "Create and assign keys for WooCommerce variable products." +msgstr "" + +#: src/Admin/Settings.php:153 +msgid "Generate bulk keys with your custom key generator rule." +msgstr "" + +#: src/Admin/Settings.php:154 src/Admin/views/html-add-key.php:172 +msgid "Random & sequential key order for the generator rules." +msgstr "" + +#: src/Admin/Settings.php:155 +msgid "Automatic key generator to auto-create & assign keys with orders." +msgstr "" + +#: src/Admin/Settings.php:156 src/Admin/views/html-add-key.php:174 +msgid "License key management option from the order page with required actions." +msgstr "" + +#: src/Admin/Settings.php:157 +msgid "Support for bulk import/export of keys from/to CSV." +msgstr "" + +#: src/Admin/Settings.php:158 +msgid "Send keys via SMS with Twilio." +msgstr "" + +#: src/Admin/Settings.php:159 +msgid "Option to sell keys even if there are no available keys in the stock." +msgstr "" + +#: src/Admin/Settings.php:160 src/Admin/views/html-add-key.php:178 +msgid "Custom deliverable quantity to deliver multiple keys with a single product." +msgstr "" + +#: src/Admin/Settings.php:161 src/Admin/views/html-add-key.php:179 +msgid "" +"Manual delivery option to manually deliver license keys instead of " +"automatic." +msgstr "" + +#: src/Admin/Settings.php:162 +msgid "" +"Email template to easily and quickly customize the order confirmation & low " +"stock alert email." +msgstr "" + +#: src/Admin/Settings.php:163 src/Admin/views/html-add-key.php:181 +msgid "Many more ..." +msgstr "" + +#: src/Admin/Settings.php:167 src/Admin/views/html-add-key.php:185 +msgid "Want More?" +msgstr "" + +#: src/Admin/Settings.php:168 src/Admin/views/html-add-key.php:186 +msgid "" +"This plugin offers a premium version which comes with the following " +"features:" +msgstr "" + +#: src/Admin/Settings.php:174 src/Admin/views/html-add-key.php:192 +msgid "Upgrade to PRO" +msgstr "" + +#: src/Admin/views/html-add-key.php:15 +msgid "Add Serial Key" +msgstr "" + +#: src/Admin/views/html-add-key.php:17 src/Admin/views/html-edit-key.php:22 +msgid "Go Back" +msgstr "" + +#: src/Admin/views/html-add-key.php:22 +msgid "" +"This section allows you to add a new key that can be sold to customers. " +"Additionally, you can choose to associate this key with either a new order " +"or an existing order." +msgstr "" + +#: src/Admin/views/html-add-key.php:38 src/Admin/views/html-add-key.php:39 +#: src/Admin/views/html-edit-key.php:40 +msgid "Select Product" +msgstr "" + +#: src/Admin/views/html-add-key.php:42 +msgid "" +"Choose the product to which this key is applicable. The key will be " +"associated with this product for sale." +msgstr "" + +#: src/Admin/views/html-add-key.php:50 src/Admin/views/html-edit-key.php:56 +msgid "Serial key" +msgstr "" + +#: src/Admin/views/html-add-key.php:57 +msgid "" +"Enter the unique serial key you want to sell. This key will be sent to the " +"customer after the order status is marked as complete. e.g. " +"4CE0460D0G-4CE0460D1G-4CE0460D2G" +msgstr "" + +#: src/Admin/views/html-add-key.php:68 +msgid "e.g. 5" +msgstr "" + +#: src/Admin/views/html-add-key.php:70 +msgid "" +"For software products, specify the maximum number of times the key can be " +"used to activate the software. If the product is not software, you can " +"leave this field blank." +msgstr "" + +#: src/Admin/views/html-add-key.php:78 +msgid "Valid for (days)" +msgstr "" + +#: src/Admin/views/html-add-key.php:82 +msgid "e.g. 365" +msgstr "" + +#: src/Admin/views/html-add-key.php:83 +msgid "" +"For software products, enter the number of days the key will be valid from " +"the purchase date. If the key should have a lifetime validity, leave this " +"field blank." +msgstr "" + +#: src/Admin/views/html-add-key.php:99 +msgid "" +"Set as available for selling: The key will be available for purchase by " +"customers." +msgstr "" + +#: src/Admin/views/html-add-key.php:105 +msgid "" +"Create a new corresponding order for this key: This option generates a new " +"order specifically for this key." +msgstr "" + +#: src/Admin/views/html-add-key.php:111 +msgid "" +"Associate this key with an existing order: If the customer has already made " +"a purchase and wants to associate this key with that order, select this " +"option." +msgstr "" + +#: src/Admin/views/html-add-key.php:125 src/Admin/views/html-add-key.php:126 +#: src/Admin/views/html-edit-key.php:106 +msgid "Select Order" +msgstr "" + +#: src/Admin/views/html-add-key.php:129 +msgid "" +"Select the order to which this key should be associated. The key will be " +"sent to the customer after the order status is marked as complete." +msgstr "" + +#: src/Admin/views/html-add-key.php:138 +msgid "Customer" +msgstr "" + +#: src/Admin/views/html-add-key.php:143 src/Admin/views/html-add-key.php:144 +msgid "Select Customer" +msgstr "" + +#: src/Admin/views/html-add-key.php:147 +msgid "" +"Select the customer to which this key should be associated. The key will be " +"sent to the customer after the order status is marked as complete." +msgstr "" + +#: src/Admin/views/html-add-key.php:158 +msgid "Add Key" +msgstr "" + +#: src/Admin/views/html-add-key.php:170 +msgid "Create and assign license keys for WooCommerce variable products." +msgstr "" + +#: src/Admin/views/html-add-key.php:171 +msgid "Generate bulk license keys with your custom key generator rule." +msgstr "" + +#: src/Admin/views/html-add-key.php:173 +msgid "Automatic license key generator to auto-create & assign keys with orders." +msgstr "" + +#: src/Admin/views/html-add-key.php:175 +msgid "Support for bulk import/export of license keys from/to CSV." +msgstr "" + +#: src/Admin/views/html-add-key.php:176 +msgid "Send Serial Keys via SMS with Twilio." +msgstr "" + +#: src/Admin/views/html-add-key.php:177 +msgid "" +"Option to sell license keys even if there are no available keys in the " +"stock." +msgstr "" + +#: src/Admin/views/html-add-key.php:180 +msgid "" +"Email Template to easily and quickly customize the order confirmation & low " +"stock alert email." +msgstr "" + +#: src/Admin/views/html-api-actions.php:21 +msgid "API Actions" +msgstr "" + +#: src/Admin/views/html-api-actions.php:26 +msgid "" +"You can use the API to perform actions on your website or on another " +"website." +msgstr "" + +#: src/Admin/views/html-api-actions.php:29 +msgid "To perform an action, you need to send a POST request to the following URL:" +msgstr "" + +#: src/Admin/views/html-api-actions.php:33 +#: src/Admin/views/html-api-validation.php:46 +msgid "The request must contain the following parameters:" +msgstr "" + +#: src/Admin/views/html-api-actions.php:37 +#: src/Admin/views/html-api-actions.php:104 +#: src/Admin/views/html-api-validation.php:50 +#: src/Admin/views/html-api-validation.php:105 +msgid "The ID of the product for which the serial key is valid." +msgstr "" + +#: src/Admin/views/html-api-actions.php:40 +#: src/Admin/views/html-api-validation.php:53 +msgid "The serial key to validate." +msgstr "" + +#: src/Admin/views/html-api-actions.php:43 +msgid "The request type. Must be set to \"activate\" or \"deactivate\"." +msgstr "" + +#: src/Admin/views/html-api-actions.php:46 +msgid "" +"Instance is the base of activation and deactivation. It is a unique " +"identifier for the installation. For example, you can use the domain name " +"of the website." +msgstr "" + +#: src/Admin/views/html-api-actions.php:49 +msgid "" +"Optional. The platform on which the serial key is used. For example, " +"\"Windows\" or \"Mac\"." +msgstr "" + +#: src/Admin/views/html-api-actions.php:52 +#: src/Admin/views/html-api-validation.php:59 +msgid "" +"Using email is completely voluntary. The API will verify that the serial " +"number is associated with the given email address." +msgstr "" + +#: src/Admin/views/html-api-actions.php:57 +#: src/Admin/views/html-api-validation.php:63 +msgid "Example:" +msgstr "" + +#: src/Admin/views/html-api-actions.php:75 +#: src/Admin/views/html-api-validation.php:80 +msgid "The API will return a JSON response with the following parameters:" +msgstr "" + +#: src/Admin/views/html-api-actions.php:80 +msgid "" +"The response code. \"key_activated\" or \"key_deactivated\" if the request " +"was successful. \"invalid_key\" or \"invalid_request\" if the request was " +"not successful." +msgstr "" + +#: src/Admin/views/html-api-actions.php:83 +#: src/Admin/views/html-api-validation.php:87 +msgid "" +"The response message. If the serial key is valid, the message will be " +"\"Serial key is valid\"." +msgstr "" + +#: src/Admin/views/html-api-actions.php:86 +msgid "Activated or deactivated when the request is successful." +msgstr "" + +#: src/Admin/views/html-api-actions.php:89 +#: src/Admin/views/html-api-validation.php:90 +msgid "The activation limit for the serial key." +msgstr "" + +#: src/Admin/views/html-api-actions.php:92 +#: src/Admin/views/html-api-validation.php:93 +msgid "The number of activations for the serial key." +msgstr "" + +#: src/Admin/views/html-api-actions.php:95 +#: src/Admin/views/html-api-validation.php:96 +msgid "The number of activations left for the serial key." +msgstr "" + +#: src/Admin/views/html-api-actions.php:98 +#: src/Admin/views/html-api-validation.php:99 +msgid "The expiration date for the serial key." +msgstr "" + +#: src/Admin/views/html-api-actions.php:101 +msgid "The expiration date for the serial key in Unix timestamp format." +msgstr "" + +#: src/Admin/views/html-api-actions.php:107 +#: src/Admin/views/html-api-validation.php:108 +msgid "The name of the product for which the serial key is valid." +msgstr "" + +#: src/Admin/views/html-api-actions.php:110 +#: src/Admin/views/html-api-validation.php:111 +msgid "The list of activations for the serial key." +msgstr "" + +#: src/Admin/views/html-api-actions.php:113 +msgid "You can use the form below to test the API activation/deactivation." +msgstr "" + +#: src/Admin/views/html-api-actions.php:126 +msgid "Select a product to activate/deactivate serial key for." +msgstr "" + +#: src/Admin/views/html-api-actions.php:133 +msgid "Please enter serial key to activate/deactivate" +msgstr "" + +#: src/Admin/views/html-api-actions.php:135 +msgid "Required field. Enter serial key to activate/deactivate." +msgstr "" + +#: src/Admin/views/html-api-actions.php:143 +msgid "Please enter a unique instance" +msgstr "" + +#: src/Admin/views/html-api-actions.php:145 +msgid "" +"Required field. Instance is the unique identifier of the activation record. " +"It is used to identify the activation when activating/deactivating serial " +"key." +msgstr "" + +#: src/Admin/views/html-api-actions.php:154 +msgid "Please enter a platform. e.g. Windows" +msgstr "" + +#: src/Admin/views/html-api-actions.php:156 +msgid "" +"Optional field. Platform is the extra information of the activation record. " +"You can use it to identify the platform of the activation." +msgstr "" + +#: src/Admin/views/html-api-actions.php:162 +#: src/Admin/views/html-api-validation.php:144 +#: src/Admin/views/html-edit-key.php:154 src/Deprecated/Functions.php:360 +#: src/Frontend/Shortcodes.php:47 src/Frontend/Shortcodes.php:144 +msgid "Email" +msgstr "" + +#: src/Admin/views/html-api-actions.php:164 +#: src/Admin/views/html-api-validation.php:146 +msgid "Please enter a valid email address" +msgstr "" + +#: src/Admin/views/html-api-actions.php:166 +msgid "" +"Optional field when duplicate key is off. If email is provided, only serial " +"key that are assigned to the email will be activated/deactivated otherwise " +"ignored." +msgstr "" + +#: src/Admin/views/html-api-actions.php:172 src/Frontend/Shortcodes.php:150 +msgid "Action" +msgstr "" + +#: src/Admin/views/html-api-actions.php:175 src/Frontend/Shortcodes.php:157 +msgid "Activate" +msgstr "" + +#: src/Admin/views/html-api-actions.php:176 src/Frontend/Shortcodes.php:158 +msgid "Deactivate" +msgstr "" + +#: src/Admin/views/html-api-actions.php:179 +msgid "Select an action to perform on the serial key." +msgstr "" + +#: src/Admin/views/html-api-actions.php:185 +#: src/Admin/views/html-api-validation.php:153 +msgid "API response" +msgstr "" + +#: src/Admin/views/html-api-actions.php:195 src/Frontend/Shortcodes.php:151 +msgid "Submit" +msgstr "" + +#: src/Admin/views/html-api-validation.php:20 +msgid "API Validation" +msgstr "" + +#: src/Admin/views/html-api-validation.php:30 +#. translators: %s: link to the pro version +msgid "" +"You are using the free version of Serial Numbers for WooCommerce. Upgrade to Pro to get more features." +msgstr "" + +#: src/Admin/views/html-api-validation.php:39 +msgid "" +"You can use the API to validate serial keys on your website or on another " +"website." +msgstr "" + +#: src/Admin/views/html-api-validation.php:42 +msgid "" +"To validate a serial key, you need to send a GET request to the following " +"URL:" +msgstr "" + +#: src/Admin/views/html-api-validation.php:56 +msgid "The request type. Must be set to \"validate\"." +msgstr "" + +#: src/Admin/views/html-api-validation.php:84 +msgid "" +"The response code. If the serial key is valid, the code will be " +"\"key_valid\"." +msgstr "" + +#: src/Admin/views/html-api-validation.php:102 +msgid "The status of the serial key." +msgstr "" + +#: src/Admin/views/html-api-validation.php:115 +msgid "You can test the API using the form below." +msgstr "" + +#: src/Admin/views/html-api-validation.php:129 +msgid "Select a product to validate serial key for." +msgstr "" + +#: src/Admin/views/html-api-validation.php:136 +msgid "Please enter serial key to validate" +msgstr "" + +#: src/Admin/views/html-api-validation.php:138 +msgid "Required field. Enter serial key to validate." +msgstr "" + +#: src/Admin/views/html-api-validation.php:148 +msgid "" +"Optional field. If email is provided, only serial key that are assigned to " +"the email will be validated otherwise ignored." +msgstr "" + +#: src/Admin/views/html-api-validation.php:164 src/Frontend/Shortcodes.php:49 +msgid "Validate" +msgstr "" + +#: src/Admin/views/html-edit-key.php:16 +msgid "Edit Serial Key" +msgstr "" + +#: src/Admin/views/html-edit-key.php:18 +msgid "Add Another" +msgstr "" + +#: src/Admin/views/html-edit-key.php:31 +msgid "Key Details" +msgstr "" + +#: src/Admin/views/html-edit-key.php:50 +msgid "Select the product for which this key is applicable." +msgstr "" + +#: src/Admin/views/html-edit-key.php:61 +msgid "" +"Enter your serial key, also supports multiline. For example: " +"4CE0460D0G-4CE0460D1G-4CE0460D2G" +msgstr "" + +#: src/Admin/views/html-edit-key.php:71 +msgid "" +"Maximum number of times the key can be used to activate the software. If " +"the product is not software, keep it blank." +msgstr "" + +#: src/Admin/views/html-edit-key.php:77 +msgid "Valid for" +msgstr "" + +#: src/Admin/views/html-edit-key.php:82 +msgid "Days" +msgstr "" + +#: src/Admin/views/html-edit-key.php:85 +msgid "" +"Number of days the key will be valid from the purchase date. Leave it blank " +"for lifetime validity." +msgstr "" + +#: src/Admin/views/html-edit-key.php:99 +msgid "Serial key status auto-updates with order status. Avoid manual changes." +msgstr "" + +#: src/Admin/views/html-edit-key.php:104 +msgid "Order ID" +msgstr "" + +#: src/Admin/views/html-edit-key.php:115 +msgid "The order to which the serial number will be assigned." +msgstr "" + +#: src/Admin/views/html-edit-key.php:126 +msgid "Actions" +msgstr "" + +#: src/Admin/views/html-edit-key.php:132 +msgid "Save Key" +msgstr "" + +#: src/Admin/views/html-edit-key.php:139 +msgid "Customer details" +msgstr "" + +#: src/Admin/views/html-edit-key.php:146 +msgid "Name" +msgstr "" + +#: src/Admin/views/html-edit-key.php:162 +msgid "Address" +msgstr "" + +#: src/Admin/views/html-edit-key.php:171 +msgid "Phone" +msgstr "" + +#: src/Admin/views/html-edit-key.php:181 +msgid "View Order" +msgstr "" + +#: src/Admin/views/html-list-activations.php:26 +msgid "Search activation" +msgstr "" + +#: src/Admin/views/html-list-keys.php:21 +msgid "Add New" +msgstr "" + +#: src/Admin/views/html-list-keys.php:33 +msgid "Generate" +msgstr "" + +#: src/Admin/views/html-list-keys.php:44 +msgid "Search key" +msgstr "" + +#: src/Admin/views/html-list-stock.php:16 +msgid "Search" +msgstr "" + +#: src/Ajax.php:211 +#. translators: $1: customer name, $2 customer id, $3: customer email +msgid "%1$s (#%2$s - %3$s)" +msgstr "" + +#: src/Cron.php:57 +msgid "Serial Numbers stock running low" +msgstr "" + +#: src/Deprecated/Functions.php:154 +msgid "Serial number not found." +msgstr "" + +#: src/Deprecated/Functions.php:359 +msgid "Serial Number" +msgstr "" + +#: src/Deprecated/Functions.php:361 src/Functions/Template.php:52 +#: src/functions.php:1019 +msgid "Activation Limit" +msgstr "" + +#: src/Deprecated/Functions.php:362 +msgid "Expires" +msgstr "" + +#: src/Frontend/Frontend.php:57 +msgid "Loading" +msgstr "" + +#: src/Frontend/Shortcodes.php:43 +msgid "Serial Key Validation" +msgstr "" + +#: src/Frontend/Shortcodes.php:45 src/Frontend/Shortcodes.php:142 +msgid "Serial Key" +msgstr "" + +#: src/Frontend/Shortcodes.php:46 src/Frontend/Shortcodes.php:143 +msgid "Enter your serial key" +msgstr "" + +#: src/Frontend/Shortcodes.php:48 src/Frontend/Shortcodes.php:109 +#: src/Frontend/Shortcodes.php:145 src/Frontend/Shortcodes.php:221 +msgid "Enter your email" +msgstr "" + +#: src/Frontend/Shortcodes.php:80 +msgid "No products found." +msgstr "" + +#: src/Frontend/Shortcodes.php:94 src/Frontend/Shortcodes.php:205 +msgid "Select a product" +msgstr "" + +#: src/Frontend/Shortcodes.php:140 +msgid "Activate/Deactivate Serial Key" +msgstr "" + +#: src/Frontend/Shortcodes.php:147 +msgid "Enter your instance" +msgstr "" + +#: src/Frontend/Shortcodes.php:149 +msgid "Enter platform" +msgstr "" + +#: src/Frontend/Shortcodes.php:191 +msgid "Could not find any products with serial numbers enabled." +msgstr "" + +#: src/Frontend/Shortcodes.php:270 src/Frontend/Shortcodes.php:286 +msgid "Invalid request." +msgstr "" + +#: src/Functions/Template.php:47 src/functions.php:1014 +msgid "Activation Email" +msgstr "" + +#: src/Functions/Template.php:53 src/Functions/Template.php:58 +#: src/functions.php:1020 src/functions.php:1025 +msgid "None" +msgstr "" + +#: src/Functions/Template.php:57 src/functions.php:1024 +msgid "Activation Count" +msgstr "" + +#: src/Functions/Template.php:62 src/functions.php:1029 +msgid "Expire Date" +msgstr "" + +#: src/Functions/Template.php:70 +msgid "Active" +msgstr "" + +#: src/Functions/Template.php:305 +msgid "Order is waiting for serial numbers to be assigned." +msgstr "" + +#: src/Installer.php:50 +msgid "Once a Minute" +msgstr "" + +#: src/Installer.php:101 +#. translators: 1: plugin name 2: version number +msgid "%1$s updated to version %2$s successfully." +msgstr "" + +#: src/Models/Activation.php:245 +msgid "Serial id is required." +msgstr "" + +#: src/Models/Activation.php:250 +msgid "Instance is required." +msgstr "" + +#: src/Models/Key.php:484 +msgid "Product id is required." +msgstr "" + +#: src/Models/Key.php:489 +msgid "Product id is invalid." +msgstr "" + +#: src/Models/Key.php:494 src/RestAPI.php:148 +msgid "Serial key is required." +msgstr "" + +#: src/Models/Key.php:506 +msgid "Serial key already exists. Duplicate serial keys are not allowed." +msgstr "" + +#: src/Models/Key.php:512 +msgid "Order id is invalid." +msgstr "" + +#: src/Orders.php:67 +#. translators: %1$s: product title, %2$s: stock quantity. +msgid "" +"Sorry, there aren’t enough Serial Keys for %1$s. Please remove this item or " +"lower the quantity. For now, we have %2$s Serial Keys for this product." +msgstr "" + +#: src/Orders.php:110 +msgid "Order automatically completed by the Serial Numbers for WooCommerce." +msgstr "" + +#: src/Plugin.php:63 +#. translators: 1: plugin name 2: WooCommerce +msgid "%1$s requires %2$s to be installed and active." +msgstr "" + +#: src/Plugin.php:65 +msgid "WooCommerce" +msgstr "" + +#: src/RestAPI.php:144 +msgid "Invalid product ID." +msgstr "" + +#: src/RestAPI.php:159 +msgid "Serial key is invalid." +msgstr "" + +#: src/RestAPI.php:164 +msgid "Serial key is not authorized to use." +msgstr "" + +#: src/RestAPI.php:170 +msgid "Please complete your order to activate the serial key." +msgstr "" + +#: src/RestAPI.php:175 +msgid "Serial key is not valid for this product." +msgstr "" + +#: src/RestAPI.php:180 +msgid "Invalid email address." +msgstr "" + +#: src/RestAPI.php:185 +msgid "Serial key is expired." +msgstr "" + +#: src/RestAPI.php:187 +msgid "Serial key is cancelled." +msgstr "" + +#: src/RestAPI.php:190 +msgid "Invalid serial key." +msgstr "" + +#: src/RestAPI.php:216 +msgid "Serial key is valid." +msgstr "" + +#: src/RestAPI.php:274 +msgid "Instance is already activated." +msgstr "" + +#: src/RestAPI.php:279 +msgid "Activation limit reached." +msgstr "" + +#: src/RestAPI.php:295 +msgid "Serial key is activated." +msgstr "" + +#: src/RestAPI.php:333 +msgid "Instance is missing, You must provide an instance to deactivate license." +msgstr "" + +#: src/RestAPI.php:351 +msgid "Instance not found." +msgstr "" + +#: src/RestAPI.php:359 +msgid "Serial key is deactivated." +msgstr "" + +#: src/functions.php:91 +msgid "Manually added" +msgstr "" + +#: src/functions.php:533 +#. translators: 1: product title 2: source and 3: Quantity +msgid "" +"There is not enough serial numbers for the product %1$s from selected " +"source %2$s, needed total %3$d." +msgstr "" + +#: templates/email-stock-notification.php:14 +msgid "Hi There," +msgstr "" + +#: templates/email-stock-notification.php:15 +msgid "" +"There are few products stock running low, please add serial numbers for " +"these products" +msgstr "" + +#: templates/email-stock-notification.php:37 +#. translators: %s: plugin url. +msgid "" +"The email is sent by Serial Numbers for " +"WooCommerce" +msgstr "" + +#. Plugin Name of the plugin/theme +msgid "WC Serial Numbers" +msgstr "" + +#. Plugin URI of the plugin/theme +msgid "https://www.pluginever.com/plugins/wocommerce-serial-numbers-pro/" +msgstr "" + +#. Description of the plugin/theme +msgid "" +"Sell and manage license keys/ serial numbers/ secret keys easily within " +"your WooCommerce store." +msgstr "" + +#. Author of the plugin/theme +msgid "PluginEver" +msgstr "" + +#. Author URI of the plugin/theme +msgid "http://pluginever.com" +msgstr "" \ No newline at end of file diff --git a/trunk/readme.txt b/trunk/readme.txt new file mode 100644 index 00000000..bc60b408 --- /dev/null +++ b/trunk/readme.txt @@ -0,0 +1,534 @@ +=== WC Serial Numbers - Ultimate License Manager for Selling, Licensing & Securely Delivering Digital Content with WooCommerce === +Contributors: pluginever, manikmist09 +Tags: license manager, license, license number, serial number, activation number, key, serial key, license key, activation key, product key, serial code, license code, activation code, digital, digital downloads, digital product key, digital license, product license, software license, software license key, software activation, license key for digital products, digital product license, virtual product key, virtual product license, subscription product license, license key generator, woocommerce +Requires at least: 5.0 +Tested up to: 6.6 +Requires PHP: 7.4 +Stable tag: 1.7.7 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +The easiest way to sell digital products and manage licenses with WooCommerce. + +== Description == + += Ultimate Solution for Selling Digital Products and Content with WooCommerce = +**[WC Serial Numbers](https://pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=product-page-wordpress.org&utm_medium=product-page-wordpress.org&utm_campaign=product-page-wordpress.org)** is the most powerful WordPress license manager plugin created for WooCommerce store owners. Sell keys, manage licenses, assign serial keys to products, and keep track of customer activations, all without leaving the WooCommerce dashboard. + +WooCommerce is the best eCommerce platform out there, but lacks key features for selling digital products. WC Serial Numbers plugin bridges this gap by seamlessly integrating all the necessary functionalities. Transform your WooCommerce store into a complete digital marketplace by incorporating license management, secured and authorized distribution. + +=== 👨‍💻 This Plugin is Ideal for: === + +* Content Creators +* Developers and Digital Agencies +* Event Organizers +* License Key/Product Key Resellers +* Any Kind of Digital Product Sellers + +=== 💵 With WC Serial Numbers You Can Sell: === + +* Digital Assets (Themes, Plugins, Digital Arts, Photos, Videos, Music, NFTs, Templates) +* Digital Tools (Software, Apps, Games, Mockup) +* Digital Entries (Event Tickets, Entry Pass for Conferences, or Workshops) +* Digital Gifts (Gift Cards, Lottery, and Secret Number-based Products) +* Custom Activation Codes, License Keys, Secret Codes, Usernames & Passwords +* Online Courses & Professional Services (Tutorials, Coaching, Consultations) +* eBooks and Audiobooks +* And many more. + +Despite being the ultimate license manager for WooCommerce, Serial Numbers is versatile when it comes to use cases. For authenticating your physical products, private label them, or stop the spread of counterfeits, you can apply this technology to any tangible products. + +[**💻 Live Demo Site**](https://demo.pluginever.com/serial-numbers) | [**📄 Plugin Documentation**](https://pluginever.com/docs/woocommerce-serial-numbers) + +=== ✨ How You can benefit from using WC Serial Numbers for your businesses: === + +- **Generate Fast Revenue:** Stop worrying about the licensing management system and put all of your energy into creating and improving your products. + +- **Self-Hosted, No Platform Fees:** This allows you comprehensive control over the selling process. You are not required to pay a percentage of your earnings to the platform regardless of how many digital products you sell. + +- **Streamlined Order Fulfilment:** Automate the delivery process by generating and sending keys to customers after successful payment. This eliminates the need for manual intervention, saves time, and reduces errors. + +- **Customizable and Scalable:** Customize the format and appearance of keys to align with your brand. Additionally, the plugin is scalable and can handle a large volume of orders, ensuring smooth operations even during peak periods. + +- **Increased Customer Satisfaction:** Instant delivery of keys after purchase enhances the customer experience. Customers can immediately access and activate their products, resulting in higher satisfaction and reduced support requests. + +- **Prevent Counterfeiting and Piracy:** The plugin is capable of avoiding piracy and fraud. It's a safety net since WooCommerce store owners can verify the product is authentic and hasn't been tampered with. Those who have bought a product online can check to see if it is a legitimate copy or a fake. + + + +=== ✨ WC Serial Numbers Features: === + +- **Add Keys Manually:** You can manually enter as many keys as you wish, or you can use our powerful built-in bulk importer to do the work for you. + +- **Deliver Keys Automatically:** You have the option to auto-complete any order to send and show keys to your customer’s order details page after successful payment. This ensures a seamless and hassle-free purchase experience for your customers. + +- **Detailed Reporting:** The plugin provides comprehensive reporting and logging features, allowing you to track the usage and activation of the keys. This helps you monitor and analyze the performance of your products. + +- **Self-service:** Customers can manage their license keys and downloads for all of their associated orders at any time by logging into their accounts on the "My Account" page of your store. + +- **License Key Encryption:** To guarantee your security, the keys kept in the database are encrypted. With this plugin, you may avoid headaches and second thoughts by knowing that your license keys are secure. + +- **Key Generator (PRO):** You can control how your keys will be generated. Using the built-in license generator, you can customize your key interface rule to generate keys. The generator will allow you to generate both sequential and random keys. + +- **Automatically Generate Keys (PRO):** You can use the automatic key generation rule for a license-enabled product, our plugin will automatically generate and deliver a key to the customers whenever they purchase that product. + +- **Flexible Activation Options:** You can choose to require customers to activate their keys before accessing or using your digital products. This allows you to control access and prevent unauthorized usage. + +- **API Form for Validation, Activation, Deactivation:** Serial Numbers includes a built-in license key validator API form to validate, activate and deactivate keys without any complexity. You can also show an API form for your customers anywhere on your website using our predefined shortcode for the form. +You can also use different methods that allow you to validate, activate, and deactivate license keys as well as access the software's current version number using HTTP requests. + +- **Reuse Keys:** When a sold key is refunded or an order fails, activating this option allows you to reuse the refunded or failed keys. You don't have to be concerned about which keys are refunded or failed. + +- **Revoke Keys:** When an order is canceled or reimbursed, the key can be revoked. The key will be invalidated if the order is canceled or refunded. + +- **Simple Product Support:** Create and assign keys for simple products. You can sell keys for any of your products that fall into the group of "simple products.” + +- **Variable Product Support (PRO):** This functionality allows you to generate and assign keys for product variations of your variable products. As a result, it avoids the issue of selling license-enabled variable products. + +- **Backorder Support (PRO):** You can sell keys even when the product is out of stock, and you can assign keys to orders with a single click when they become available. + +- **Support for Expiry Dates:** For products that require time-limited access or subscription-based licensing, this plugin allows you to set expiry dates for keys. This ensures that customers cannot use the keys beyond the specified period. + +- **Bulk Import (PRO):** You may use our bulk import license for product update the serial key table with pre-existing or new keys. The bulk importer accepts CSV and TXT files. CSV importer works when you import several items at once, whereas TXT works when you import a single product with many product keys. + +- **Bulk Export (PRO):**You can export specific orders by entering Order IDs. You will be able to export keys from products based on their status, such as **Available, Sold, Refunded**, etc. You will also have options to export from fields such as product ID, and activation limit. + +- **Keys For Older Orders:** Keys can be added to previous orders by simply assigning them, and activation settings can be applied if necessary. This will assist in delivering instant updates to existing customers. + +- **Assign Keys Manually (PRO):** You can stop assigning keys automatically with the orders and you can assign them manually. This way you can control the key delivery system on your own when you'll have to assign it manually. + +- **Automated Email Delivery:** You can automatically send an email containing the assigned key to the customer after a successful purchase. This eliminates the need for manual key distribution and ensures a smooth customer experience. + +- **Twilio SMS (PRO):** Your keys can be automatically sent to your customers via SMS, courtesy of the amazing Twilio API. No more dependency on emails and no more delayed responses! Your customers will receive instant notifications with their product keys as soon as they make a purchase. + +- **Allow Duplicate Keys (PRO):** You can add and sell duplicate keys depending on your use case. This will allow you to sell the same keys with different orders from the key database. + +- **Translation (PRO):** You can translate the notification texts and warning labels as you wish. This gives you the freedom to communicate and guide your customers to proceed with operating their orders in your direction. + +- **License Key Stock Notification:** You can enable this option to receive an email notification when your stock is about to expire. You must configure your stock limit so that you receive notifications anytime a product drops below that quantity. + +- **Order Table Key Properties (PRO):** When an order is completed, your customer will receive a key both on the order page and via mail. The order details page and email both include a table with the keys and other required data. You can decide which key fields to display and you can edit each field from the order table settings menu. + +- **Powered by WooCommerce:** Enjoy the power of WooCommerce to use any payment gateway and manage orders natively. There's no need for third-party plugins, making it a seamless addition to your WooCommerce ecosystem. + +- **Useful Integrations:** Enjoy compatibility with popular plugins like WPML for multilingual support, PDF Invoice & Packing Slips for easy documentation, and multivendor sites. This plugin is designed to integrate smoothly with a wide variety of tools and platforms to enhance your store experience. + +> Maximize the potential of WC Serial Numbers plugin by unlocking all its advanced features. Get The PRO Version. + + +=== ⚡ More Upcoming Features: === + +We are constantly improving our plugin and bringing new enhancements for your connivance. We’re currently working on some exclusive features and will release them periodically. Have a look at what’s in our pipeline. + +- **Subscription Support:** You’ll have the option to sell your subscription products with the WooCommerce subscription feature. It will give you all the features and functionalities to sell keys by managing subscriptions efficiently. + +- **Rest API:** You’ll be able to operate a set of standard rules and conventions for communicating with other web-based applications and services. REST API treats everything as a resource, including a WooCommerce product. License keys are managed as resources and are accessed through endpoints that are also resources. + +- **Fast Checkout:** You’ll have the option to let your customers go through a fast checkout process if they only add digital products to their cart. With this option, customers won't have to worry about filling out fields they don't need to. + +- **Custom Emails:** You’ll have the full option to take control over sending emails to your customers. You’ll have options to disable sending emails and also you can send custom emails instead of sending default emails sent via WooCommerce itself. + +- **Key Placements:** You’ll have the option to display keys for your customers depending on your preferences. On that note, you don’t have to stick with the default key placements by the plugin. You can also choose file formats for showing your keys. + +- **Barcode Integration:** You’ll have the option to create fully functional barcodes as you know that a barcode is a visual representation of the ‘serial number’ that is located beneath it. You can input product-related data or information using available formats of barcodes. + + +== 💚 Why Creators and Digital Product Sellers Love WC Serial Numbers: == + +- **Unparalleled Features:** Serial Numbers plugin is second to none when it comes to generating serial numbers and managing licenses for your WooCommerce products. This license manager plugin is a powerhouse on its own, with features like auto-generating unique keys, integration with the REST API, and so on. + +- **Regular Updates:** The plugin is constantly being improved, and we make those improvements available to our customers at no extra cost. We release updates to ensure compatibility with WooCommerce as well as the latest version of PHP. + +- **Fast and Friendly Support:** The constant availability of our help desk and positive feedback on the reviews page for the plugin says a lot. We’re constantly working on new innovative features to give you more power. Whether you have a question or want to request a new feature, we’re just a quick message away. + - [Free support (forum)](https://wordpress.org/support/plugin/wc-serial-numbers/) + - [Premium & pre-sales support (email)](https://pluginever.com/support/) + +=== 💝 User Reviews and Testimonials: === + +WC Serial Numbers is helping tens of thousands of store owners sell and manage keys and they just love it! See all the 5-star reviews from our users [here](https://wordpress.org/support/plugin/wc-serial-numbers/reviews/?filter=5). + +=== 💢 Supercharge Your Store with Our Other WooCommerce Plugins: === + +- **[Min Max Quantities for WooCommerce](https://wordpress.org/plugins/wc-min-max-quantities "Min Max Quantities for WooCommerce")** +- **[Product Category Slider for WooCommerce](https://wordpress.org/plugins/woo-category-slider-by-pluginever "Product Category Slider for WooCommerce")** +- **[Product Category Showcase for WooCommerce](https://wordpress.org/plugins/wc-category-showcase "Product Category Showcase for WooCommerce")** +- **[Product Variation Swatches for WooCommerce](https://wordpress.org/plugins/wc-variation-swatches "Product Variation Swatches for WooCommerce")** + +Visit [PluginEver](https://pluginever.com) to learn from our WooCommerce tutorials and find out about other [WooCommerce plugins](https://pluginever.com/plugins). + +== Installation == + += Minimum requirements = + +* WordPress 5.0 or greater +* WooCommerce 5.0 or greater +* PHP version 7.4 or greater +* MySQL version 5.6 or greater +* MariaDB version 10 or later + += Automatic installation = + +Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't need to leave your web browser. To do an automatic install of Serial Numbers, log in to your WordPress dashboard, navigate to the Plugins menu, and click "Add New". + +In the search field type "Serial Numbers" and click Search Plugins. Once you have found the plugin you can view details about it such as the point release, rating, and description. Most importantly, of course, you can install it by simply clicking "Install Now". + += Manual installation = + +1. Upload the plugin files to the `/wp-content/plugins/wc-serial-numbers` directory, or install the plugin through the WordPress plugins screen directly. +1. Activate the plugin through the 'Plugins' screen in WordPress + += Updating = + +Automatic updates should work like a charm; as always though, ensure you backup your site just in case. + +== Frequently Asked Questions == + += What is the difference between Serial Numbers and License Keys? = + +Serial Numbers can be used as product labels or product identifiers. It helps to prevent product theft and ensures complete control over your products. License Keys can be used for digital products and software activation purposes. It grants access to authorized users and makes products usable. You can even set the validity date for limit usage and set the activation limit. + += Do I need any coding skills to operate this plugin? = + +No, you don’t need any coding or programming skills to manage the plugin. It's made to be simple and effective for your use. + += What file types I can sell? = + +Well, there is no restrictions, and any file type can be sold with this plugin. You can sell .PDF,.DOC,.MP3,.MOV,.EPUB,.PSD,.MP4,.JPG, and any other extension that exists are supported. + += How the keys are delivered? = + +The keys are primarily delivered to the order details page of the customer's account and to their emails. Also, you can deliver keys through SMS directly to your customer's phone numbers through the [Twilio SMS](https://pluginever.com/docs/wocommerce-serial-numbers/sms-integration-with-woocommerce-serial-numbers-pro/) feature. + += Where can customers see their purchase history? = + +Your customers can see their purchase history within the my account section’s “Orders” menu. You can also show your users the order details and license keys available for both activation and download. + += Can I import my own custom keys? = + +Yes, with this plugin you can sell your own custom keys and you can also bulk import your custom keys via CSV and TXT file format. + += Can I use this plugin to provide a licensing system for my own software? = + +Yes, this plugin comes with HTTP based API integration and also has REST API functionality. You can easily integrate the license validation function in any of your software. Our plugin has a dedicated page for Software API. You can learn more from our [documentation](https://pluginever.com/docs/wocommerce-serial-numbers/woocommerce-serial-numbers-api-docs/) about how it works. + += Does this plugin works with variable products? = + +Yes, the plugin supports variable products. You can add keys to each and every specific variation of a product. + += Can I customize emails? = + +Yes, check out the [helpful guide](https://pluginever.com/docs/wocommerce-serial-numbers/) that we've put up on how to personalize emails. + += What payment processors are supported? = + +WC Serial Numbers is powered by WooCommerce and it supports all the payment processors/gateways available within WooCommerce like Stripe, PayPal, Square, etc. + += Does this plugin supports subscription/recurring payments? = + +Yes, with [WooCommerce subscription](https://woocommerce.com/products/woocommerce-subscriptions/) feature, you can create subscriptions so that customers continue paying you over time. This is great for selling memberships, courses, access passes, software licenses, and other products which require ongoing payments. + += Is this plugin translatable? = + +Yes, all the strings in this plugin can be translated and over time we hope to offer many translations out of the box. + += How do I upgrade to the Pro version to get access to the advanced features? = + +You can purchase the premium version of the plugin from our [website](https://pluginever.com/plugins/woocommerce-serial-numbers-pro/). + += Can I request/suggest a new feature? = + +Yes, you are always welcome to [provide suggestions](https://github.com/pluginever/wc-serial-numbers/issues) for new features and enhancements. + +== Screenshots == +1. Serial Keys List +2. Add New Key +3. Validation Form +4. Activation Log +5. Reports Page +6. Settings Page +7. Product Page Options +8. Order Complete Email with Keys +9. Thank You Page with Keys + +== Changelog == += 1.7.7 (31 Jul 2024) = +Enhance: Enhance optimized code for better autoload classes. +Enhance: Enhanced security. +Update: Update the WooCommence HPOS support +Fix: Few known issues. + += 1.7.6 (30 Jul 2024) = +Enhance: Enhanced security to handle form actions. +Enhance: Enhanced security to handle Ajax search. +Enhance: Enhanced security to handle the GET & POST supper global variables. +Fix: Vulnerability security issue. +Fix: Few other known issues. + += 1.7.5 (01 Jul 2024) = +Enhance: Enhanced security to handle form actions. +Enhance: Enhanced security to handle Ajax search. +Fix: Few known issues fixed. + += 1.7.4 (11 Jun 2024) = +Fix: Vulnerability issue. +Fix: Shortcode permission issue. + += 1.7.3 (12 May 2024) = +Enhance: Move query arg based API to REST API +Fix: Few known issues fixed. + += 1.7.2 (19 Apr 2024) = +* Fix: Text domain issue fixed. + += 1.7.1 (15 Mar 2024) = +* Fix: Few known issues fixed. + += 1.7.0 (7 Mar 2024) = +* Fix: Few known issues fixed. + += 1.6.9 (28 Feb 2024) = +* Fix: The keys column is missing on the order table. +* Fix: Add serial keys, Remove serial keys actions missing on the order table. + += 1.6.8 (18 Feb 2024) = +* Fix: Compatibility with WooCommerce 8.6 + += 1.6.7 (23 Jan 2024) = +* Fix: Compatibility with WooCommerce 8.5 + += 1.6.6 (13 Nov 2023) = +* Fix: Compatibility with WordPress 6.4 + += 1.6.5 (25 Oct 2023) = +* Fix: API request is not working. + += 1.6.4 (25 Oct 2023) = +* Enhance: Optimize and improve code for better performance & security. + += 1.6.3 (8 Oct 2023) = +* Fix: Dropdown active color is not working. +* Enhance: Allow keys to be sold without checking key source. + += 1.6.2 (27 Sep 2023) = +* Enhance: Add compatibility with WooCommerce HPOS. + += 1.6.1 (11 Sep 2023) = +* Fix: Conflict PHP Autoloader with other plugins. + += 1.6.0 (28 Aug 2023) = +* Fix: Product dropdown showing HTML tags. +* Fix: Fix typo. +* Enhance: Improve `wc_serial_numbers_allow_backorder` filter. + += 1.5.9 (16 Aug 2023) = +* Fix: Email validation is not working when email contains uppercase letters. +* Fix: Reset activations showing wrong activation count. + += 1.5.8 (10 Aug 2023) = +* Fix: Reset activation is not showing correct activation count. +* Fix: API email validation ignore the email case sensitivity. + += 1.5.7 (2 Aug 2023) = +* Fix: Keys page showing blank page. + += 1.5.6 (2 Aug 2023) = +* Enhance: Key edit page UI improvement. +* Fix: Search by order ID not working in the serial numbers list page. + += 1.5.4 (18 Jun 2023) = +* Enhance: Labels and notice texts. +* Fix: Sequential pointers with manual assigning not working properly. +* Fix: Reports filter not working. + += 1.5.3 (14 Jun 2023) = +* Enhance: Added bulk reset action for serial keys. +* Enhance: Added product ID and Sold count in the stock report. +* Fix: API response is not showing activations. + += 1.5.2 (24 May 2023) = +* Fix : Key properties is not sorting properly. +* Fix : Optimized the code for better performance. + += 1.5.1 (11 April 2023) = +* Fix : Admin order details showing only 20 serial keys when bought more than 20 serial keys. +* Fix : When order status is changed from 'completed' to 'on-hold' to 'completed' serial keys added twice. + += 1.5.0 (9 April 2023) = +* Fix : Serial keys list table not working when filter by status. +* Fix : Stock report product link not working when variable product. + += 1.4.9 (8 April 2023) = +* Fix : Serial keys list table not showing pagination when status is sold. +* Enhance: Enhance the UI of sold serial keys in the order details page and order complete email. + += 1.4.8 (6 April 2023) = +* Fix : Only 20 records are showing when bought more than 20 serial keys. +* Fix : Serial keys assigned only for first 2 products when bought more than 2 products. +* Fix : Action 'Edit' is not working for variable products on Report menu. +* Enhance: Add search option for serial number in the stock report table. +* Enhance: Fix duplicate key issue when importing. +* Enhance: UI improvements. + += 1.4.7 (3 April 2023) = +* Fix : Search key by customer name is not working. +* Fix : Stock report is showing only 20 records. +* Enhance: Order table add bulk action to add/remove serial keys. +* Enhance : Add product filter in the stock report table. + += 1.4.6 (1 April 2023) = +* Enhance: Enhanced API implementation. +* Enhance: Update Serial Number statues. +* Enhance: Add shortcodes for serial number verification and activation/deactivation. +* Enhance: Add admin tools to verify and activate/deactivate serial numbers. +* Enhance: Add plugin status page. +* Enhance: Admin support clicking to copy serial number. +* Enhance: UI improvements. +* Deprecated: Duplicate serial number feature removed. +* Fix: Few known issues fixed. + += 1.4.5 (30 January 2023) = +* Fix: Few known issues fixed. +* Enhance: Framework updated. + += 1.4.4 (16 January 2023) = +* Fix: Product select dropdown not working for non english languages. +* Fix: Product select dropdown search limit increased to 100. + += 1.4.3 (15 January 2023) = +* Fix: Translation breaking page +* Fix: Reuse license key not working + += 1.4.2 (15 January 2023 )= +* Enhancement: New settings UI with performance improvements. +* Enhancement: Optimized plugin assets. + += 1.2.10 (20 May, 2022) = +Fix - Compatibility with WP 6.1 +Fix - Compatibility with WC 71. + += 1.2.10 (17 May, 2022) = +Fix - Compatibility with WC v6.5.1 +Fix - Fix typo +Enhance - Enhance simple product metabox styles + += 1.2.9 (19 December, 2021) = +* Fix - Compatibility with WP v5.8.2 +* Fix - Compatibility with WC v6.0.0 + += 1.2.8 (27 May, 2021) = +* Fix - Compatibility with WP v5.7.2 +* Fix - Compatibility with WC v5.3.0 + += 1.2.7 (8 September, 2020) = +* Fix - Shop manager User level: Search products do not show and decrypting key failed +* Fix - Notification email conflict +* Fix - Stock notification need to skip private products +* Fix - Activation list table serial number column is not working + += 1.2.6 (24 August, 2020) = +* Fix - Unicode character not showing on PDF +* Fix - Translate path not found +* Enhance - Ordered serial numbers in dedicated metabox on order edit page + += 1.2.5 (12 August, 2020) = +* Fix - Error on order edit page when contains non serial numbers + += 1.2.4 (9 August, 2020) = +* Fix - Serial numbers are not showing in order edit page + += 1.2.3 (3 August, 2020) = +* Fix - Order status changed on pending status +* Fix - Order edit throwing error not found order_id + += 1.2.2 (28 July, 2020) = +* Fix - Can't add manually order + += 1.2.1 (25 July, 2020) = +* Fix - Order email showing wrong when order contains non serial items +* Fix - Can not add manual serial numbers + += 1.2.0 (23 July, 2020) = +* Enhance - Full rewritten plugin +* Enhance - Product tab for serial numbers +* Enhance - Serial Key list table with status, order date and expire date +* Enhance - All Settings are in one place +* Enhance - API response +* Fix - Order confirmation page needs reload +* Remove - The notification tab from admin bar + += 1.1.3 (24 November, 2019) = +* Enhance - Improve API response +* Fix - Added compatibility with Product Input Fields +* Fix - Option to modify license validity +* Fix - WP Compatibility v5.3 + += 1.1.2 (11 November, 2019) = +* New - Obscure serial keys in dashboard +* Enhance - Change API response +* Fix - Indexing serial number table +* Fix - WC Compatibility v3.8.0 + += 1.1.1 (16 October, 2019) = +* New - Built-in support for leading PDF Invoice & Packing Slip plugins. +* Fix - Show auto draft products while creating serial numbers. +* Fix - Admin panel notification update latency. +* Fix - WP Compatibility v5.2.4 +* Fix - WC Compatibility v3.7.1 + += 1.1.0 (22 September, 2019) = +* Fix - Serial number reuse is not working on paypal gateway + += 1.0.9 (25 August, 2019) = +* Fix - WPML Support +* Fix - WP Compatibility +* Fix - WC Compatibility + += 1.0.8 (6 July, 2019) = +* Fix - Table create failed below mysql v5.6 +* Fix - Serial number label chancing is not working on order complete page +* Fix - Creating multiple serial number for a single product when order failed + += 1.0.7 (24 June, 2019) = +* Fix - Compatibly with WP v5.2.2 + += 1.0.6 (18 June, 2019) = +* Fix - Plugin translation issue +* Fix - Product order page serial number limitation +* Fix - Unwanted notification for the serial number +* Fix - Empty email notification +* New - Encryption - all serial number at DB is encrypted +* Tweak - Notification moved to the background process. No more failed check. + += 1.0.5 (24 April, 2019) = +* Fix - Serial number table not generating in sql version lower than 5.5 [#31] +* Confirm compatibility with WC 3.6.1 + += 1.0.4 (1 April, 2019) = +* Fix - Email notification stop is not working +* Fix - Notification is showing for normal products too +* Fix - Validity takes negative value as input +* Fix - Sending serial numbers table even when order does not contains serial enabled products +* Fix - Serial number search is not working +* Enhance - Add serial number search filter +* Confirm compatibility with WC 3.5.7 + += 1.0.3 (18 March, 2019) = +* Fix - Aroken style +* Fix - Auto-complete order +* Conditional styles/script loading + += 1.0.2 (15 March, 2019) = +* Fix - Link from product page to add new serial number page +* Fix - Conflict with Divi theme admin design +* Fix - Compatibly with WP v5.1.1 +* Fix - Compatibly with WC v3.5.6 + += 1.0.1 (6 March, 2019) = +* Rewrite - Key generation process +* Add - Software API +* Update - Settings +* Improve - Notification +* Fix - Bug + += 1.0 (21 January, 2019) = +Initial release diff --git a/trunk/src/API.php b/trunk/src/API.php new file mode 100644 index 00000000..d76cf426 --- /dev/null +++ b/trunk/src/API.php @@ -0,0 +1,90 @@ +query_vars['request'] ) ? sanitize_key( $wp->query_vars['request'] ) : ''; + $product_id = isset( $wp->query_vars['product_id'] ) ? absint( $wp->query_vars['product_id'] ) : ''; + $serial_key = isset( $wp->query_vars['serial_key'] ) ? sanitize_text_field( $wp->query_vars['serial_key'] ) : ''; + $email = isset( $wp->query_vars['email'] ) ? strtolower( sanitize_email( $wp->query_vars['email'] ) ) : ''; + $instance = isset( $wp->query_vars['instance'] ) ? sanitize_text_field( $wp->query_vars['instance'] ) : ''; + $platform = isset( $wp->query_vars['platform'] ) ? sanitize_text_field( $wp->query_vars['platform'] ) : ''; + + // if key, action or product id is missing, return error. + if ( empty( $action ) || empty( $product_id ) || empty( $serial_key ) ) { + wp_send_json_error( + array( + 'code' => 'missing_data', + 'message' => __( 'Missing data.', 'wc-serial-numbers' ), + ) + ); + } + + // end rest api base url. + $end_point = rest_url( 'wcsn/' . $action ); + $redirect_url = add_query_arg( + array( + 'product_id' => $product_id, + 'serial_key' => $serial_key, + 'request' => $action, + 'email' => $email, + 'instance' => $instance, + 'platform' => $platform, + ), + $end_point + ); + + wp_safe_redirect( $redirect_url ); + exit(); + } +} diff --git a/trunk/src/Actions.php b/trunk/src/Actions.php new file mode 100644 index 00000000..b26fe1f2 --- /dev/null +++ b/trunk/src/Actions.php @@ -0,0 +1,129 @@ +get_product_id(); + + if ( $product_id ) { + update_post_meta( $product_id, '_is_serial_number', 'yes' ); + } + } + } + + /** + * Delete activations. + * + * @param Key $key The key object. + * + * @since 1.4.6 + */ + public static function delete_activations( $key ) { + $activations = $key->get_activations(); + if ( $activations ) { + foreach ( $activations as $activation ) { + $activation->delete(); + } + } + } + + /** + * Revoke order item keys. + * + * @param bool $revoke The revoke flag. + * + * @since 1.4.6 + */ + public static function revoke_order_item_keys( $revoke ) { + if ( 'yes' !== get_option( 'wc_serial_numbers_revoke_keys', 'yes' ) ) { + $revoke = false; + } + + return $revoke; + } + + + /** + * Update activation count. + * + * @param Activation $activation The activation object. + * + * @since 1.0.0 + */ + public static function update_activation_count( $activation ) { + $key = Key::get( $activation->get_serial_id() ); + if ( $key ) { + $key->recount_remaining_activation(); + } + } +} diff --git a/trunk/src/Admin/Actions.php b/trunk/src/Admin/Actions.php new file mode 100644 index 00000000..22ecbbef --- /dev/null +++ b/trunk/src/Admin/Actions.php @@ -0,0 +1,253 @@ + esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) ); + } + + $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : ''; + $term = isset( $_POST['term'] ) ? sanitize_text_field( wp_unslash( $_POST['term'] ) ) : ''; + $limit = isset( $_POST['limit'] ) ? absint( $_POST['limit'] ) : 20; + $page = isset( $_POST['page'] ) ? absint( $_POST['page'] ) : 1; + $results = array(); + $total = 0; + $offset = ( $page - 1 ) * $limit; + + switch ( $type ) { + case 'product': + $args = array_merge( + wcsn_get_products_query_args(), + array( + 'paged' => $page, + 'posts_per_page' => $limit, + 's' => $term, + 'fields' => 'ids', + ) + ); + // if the term is numeric then search by product id. + if ( is_numeric( $term ) ) { + $args['post__in'] = array( $term ); + unset( $args['s'] ); + } + + $the_query = new \WP_Query( $args ); + $product_ids = $the_query->get_posts(); + $total = $the_query->found_posts; + foreach ( $product_ids as $product_id ) { + $product = wc_get_product( $product_id ); + + if ( ! $product ) { + continue; + } + + $text = sprintf( + '(#%1$s) %2$s', + $product->get_id(), + wp_strip_all_tags( $product->get_formatted_name() ) + ); + + $results[] = array( + 'id' => $product->get_id(), + 'text' => $text, + ); + } + break; + case 'order': + $args = array( + 'paged' => $page, + 'posts_per_page' => $limit, + 's' => $term, + 'fields' => 'ids', + 'post_type' => 'shop_order', + 'post_status' => array_keys( wc_get_order_statuses() ), + ); + // if the term is numeric then search by order id. + if ( is_numeric( $term ) ) { + $args['post__in'] = array( $term ); + unset( $args['s'] ); + } + + $the_query = new \WP_Query( $args ); + $order_ids = $the_query->get_posts(); + $total = $the_query->found_posts; + foreach ( $order_ids as $order_id ) { + $order = wc_get_order( $order_id ); + + if ( ! $order ) { + continue; + } + + $text = sprintf( + '(#%1$s) %2$s - %3$s', + $order->get_id(), + wp_strip_all_tags( $order->get_formatted_billing_full_name() ), + wp_strip_all_tags( wc_format_datetime( $order->get_date_created() ) ) + ); + + $results[] = array( + 'id' => $order->get_id(), + 'text' => $text, + ); + } + break; + + case 'customer': + case 'user': + // query wp users. + $args = array( + 'paged' => $page, + 'number' => $limit, + 'search' => '*' . $term . '*', + 'search_columns' => array( 'user_login', 'user_email', 'user_nicename' ), + 'fields' => 'ID', + ); + // if the term is numeric then search by user id. + if ( is_numeric( $term ) ) { + $args['include'] = array( $term ); + unset( $args['search'] ); + } + + $user_query = new \WP_User_Query( $args ); + $user_ids = $user_query->get_results(); + $total = $user_query->get_total(); + + foreach ( $user_ids as $user_id ) { + $user = get_user_by( 'id', $user_id ); + + if ( ! $user ) { + continue; + } + + $text = sprintf( + '(#%1$s) %2$s - %3$s', + $user->ID, + wp_strip_all_tags( $user->display_name ), + wp_strip_all_tags( $user->user_email ) + ); + + $results[] = array( + 'id' => $user->ID, + 'text' => $text, + ); + } + + break; + } + + wp_send_json( + array( + 'page' => $page, + 'results' => $results, + 'pagination' => array( + 'more' => $total > ( $offset + $limit ), + ), + ) + ); + } + + /** + * Handle add key. + * + * @since 1.0.0 + * @return void + */ + public static function handle_add_key() { + check_admin_referer( 'wcsn_add_key' ); + + // Must have WC Serial Numbers manager role to access this endpoint. + if ( ! current_user_can( wcsn_get_manager_role() ) ) { + WCSN()->add_notice( __( 'You do not have permission to perform this action.', 'wc-serial-numbers' ), 'error' ); + wp_safe_redirect( wp_get_referer() ); + exit; + } + + $data = wc_clean( wp_unslash( $_POST ) ); + $key = Key::insert( $data ); + if ( is_wp_error( $key ) ) { + WCSN()->add_notice( $key->get_error_message(), 'error' ); + // redirect to referrer. + wp_safe_redirect( wp_get_referer() ); + exit(); + } + // Adding manually so let's enable to product and set the source. + $product_id = $key->get_product_id(); + update_post_meta( $product_id, '_is_serial_number', 'yes' ); + update_post_meta( $product_id, '_serial_key_source', 'custom_source' ); + $status = isset( $data['status'] ) ? $data['status'] : ''; + } + + /** + * Handle edit key. + * + * @since 1.0.0 + * @return void + */ + public static function handle_edit_key() { + check_admin_referer( 'wcsn_edit_key' ); + + // Must have WC Serial Numbers manager role to access this endpoint. + if ( ! current_user_can( wcsn_get_manager_role() ) ) { + WCSN()->add_notice( __( 'You do not have permission to perform this action.', 'wc-serial-numbers' ), 'error' ); + wp_safe_redirect( wp_get_referer() ); + exit; + } + + $data = wc_clean( wp_unslash( $_POST ) ); + $key = Key::insert( $data ); + if ( is_wp_error( $key ) ) { + WCSN()->add_notice( $key->get_error_message(), 'error' ); + // redirect to referrer. + wp_safe_redirect( wp_get_referer() ); + exit(); + } + $add = empty( $data['id'] ) ? true : false; + if ( $add ) { + // Adding manually so let's enable to product and set the source. + $product_id = $key->get_product_id(); + update_post_meta( $product_id, '_is_serial_number', 'yes' ); + update_post_meta( $product_id, '_serial_key_source', 'custom_source' ); + + WCSN()->add_notice( __( 'Key added successfully.', 'wc-serial-numbers' ) ); + } else { + WCSN()->add_notice( __( 'Key updated successfully.', 'wc-serial-numbers' ) ); + } + + $redirect_to = admin_url( 'admin.php?page=wc-serial-numbers&edit=' . $key->get_id() ); + wp_safe_redirect( $redirect_to ); + exit; + } +} diff --git a/trunk/src/Admin/Admin.php b/trunk/src/Admin/Admin.php new file mode 100644 index 00000000..9d10ad4c --- /dev/null +++ b/trunk/src/Admin/Admin.php @@ -0,0 +1,186 @@ +services['admin/settings'] = Settings::instance(); + WCSN()->services['admin/menus'] = new Menus(); + WCSN()->services['admin/notices'] = new Notices(); + WCSN()->services['admin/actions'] = new Actions(); + WCSN()->services['admin/metaboxes'] = new Metaboxes(); + WCSN()->services['admin/orders'] = new Orders(); + WCSN()->services['admin/products'] = new Products(); + } + + /** + * Enqueue admin scripts. + * + * @param string $hook Hook name. + * + * @since 1.0.0 + */ + public function enqueue_scripts( $hook ) { + if ( ! in_array( $hook, self::get_screen_ids(), true ) ) { + return; + } + wp_enqueue_style( 'jquery-ui-style' ); + wp_enqueue_style( 'select2' ); + wp_enqueue_script( 'jquery-ui-datepicker' ); + + WCSN()->enqueue_style( 'wc-serial-numbers-admin', 'css/admin-style.css' ); + WCSN()->enqueue_script( 'wc-serial-numbers-admin', 'js/admin-script.js', array( 'jquery', 'jquery-ui-datepicker', 'select2', 'wp-util' ) ); + wp_localize_script( + 'wc-serial-numbers-admin', + 'wc_serial_numbers_vars', + array( + 'i18n' => array( + 'search_product' => __( 'Search by product', 'wc-serial-numbers' ), + 'search_order' => __( 'Search by order', 'wc-serial-numbers' ), + 'search_customer' => __( 'Search by customer', 'wc-serial-numbers' ), + 'show' => __( 'Show', 'wc-serial-numbers' ), + 'hide' => __( 'Hide', 'wc-serial-numbers' ), + 'copied' => __( 'Copied', 'wc-serial-numbers' ), + ), + 'search_nonce' => wp_create_nonce( 'wc_serial_numbers_search_nonce' ), + 'ajax_nonce' => wp_create_nonce( 'wcsn_ajax_search' ), + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'apiurl' => site_url( '?wc-api=serial-numbers-api' ), + ) + ); + + // add inline style for select2 --wp-admin-theme-color. + wp_add_inline_style( 'common', ':root{--wp-admin-theme-color:#0073aa;}' ); + } + + + /** + * Add the plugin screens to the WooCommerce screens. + * This will load the WooCommerce admin styles and scripts. + * + * @param array $ids Screen ids. + * + * @return array + */ + public function screen_ids( $ids ) { + return array_merge( $ids, self::get_screen_ids() ); + } + + /** + * Admin footer text. + * + * @param string $footer_text Footer text. + * + * @since 1.0.0 + * @return string + */ + public function admin_footer_text( $footer_text ) { + if ( WCSN()->get_review_url() && in_array( get_current_screen()->id, self::get_screen_ids(), true ) ) { + $footer_text = sprintf( + /* translators: 1: Plugin name 2: WordPress */ + __( 'Thank you for using %1$s! Share your appreciation with a five-star review %2$s.', 'wc-serial-numbers' ), + '' . esc_html( WCSN()->get_name() ) . '', + 'here' + ); + } + + return $footer_text; + } + + /** + * Update footer. + * + * @param string $footer_text Footer text. + * + * @since 1.0.0 + * @return string + */ + public function update_footer( $footer_text ) { + if ( in_array( get_current_screen()->id, self::get_screen_ids(), true ) ) { + /* translators: 1: Plugin version */ + $footer_text = sprintf( esc_html__( 'Version %s', 'wc-serial-numbers' ), WCSN()->get_version() ); + } + + return $footer_text; + } + + /** + * Get screen ids. + * + * @since 1.0.0 + * @return array + */ + public static function get_screen_ids() { + $screen_id = sanitize_title( __( 'Serial Numbers', 'wc-serial-numbers' ) ); + $screen_ids = array( + 'toplevel_page_' . $screen_id, + 'toplevel_page_wc-serial-numbers', + $screen_id . '_page_wc-serial-numbers-activations', + $screen_id . '_page_wc-serial-numbers-products', + $screen_id . '_page_wc-serial-numbers-tools', + $screen_id . '_page_wc-serial-numbers-reports', + $screen_id . '_page_wc-serial-numbers-settings', + ); + + return apply_filters( 'wc_serial_numbers_screen_ids', $screen_ids ); + } + + /** + * Render a view. + * + * @param string $view The name of the view to render. + * @param array $args The arguments to pass to the view. + * @param string $path The path to the view file. + * + * @since 1.0.0 + * @return void + */ + public static function view( $view, $args = array(), $path = '' ) { + if ( empty( $path ) ) { + $path = __DIR__ . '/views/'; + } + // replace .php extension if it was added. + $view = str_replace( '.php', '', $view ); + $view = ltrim( $view, '/' ); + $path = rtrim( $path, '/' ); + + $file = $path . '/' . $view . '.php'; + + if ( ! file_exists( $file ) ) { + return; + } + + if ( $args && is_array( $args ) ) { + extract( $args ); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract + } + + include $file; + } +} diff --git a/trunk/src/Admin/ListTables/ActivationsTable.php b/trunk/src/Admin/ListTables/ActivationsTable.php new file mode 100644 index 00000000..6fa0d673 --- /dev/null +++ b/trunk/src/Admin/ListTables/ActivationsTable.php @@ -0,0 +1,289 @@ + __( 'Activation', 'wc-serial-numbers' ), + 'plural' => __( 'Activations', 'wc-serial-numbers' ), + 'ajax' => false, + ) + ); + } + + /** + * Prepare table data. + * + * @since 1.4.6 + */ + public function prepare_items() { + $per_page = $this->get_items_per_page( 'wcsn_activations_per_page' ); + $columns = $this->get_columns(); + $hidden = array(); + $sortable = $this->get_sortable_columns(); + $this->_column_headers = array( $columns, $hidden, $sortable ); + $current_page = $this->get_pagenum(); + $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_SPECIAL_CHARS ); + $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_SPECIAL_CHARS ); + $search = filter_input( INPUT_GET, 's', FILTER_SANITIZE_SPECIAL_CHARS ); + $product_id = filter_input( INPUT_GET, 'product_id', FILTER_SANITIZE_NUMBER_INT ); + $order_id = filter_input( INPUT_GET, 'order_id', FILTER_SANITIZE_NUMBER_INT ); + $customer_id = filter_input( INPUT_GET, 'customer_id', FILTER_SANITIZE_NUMBER_INT ); + $id = filter_input( INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT ); + $serial_id = filter_input( INPUT_GET, 'serial_id', FILTER_SANITIZE_NUMBER_INT ); + + if ( array_key_exists( $orderby, $this->get_sortable_columns() ) && 'order_date' !== $orderby ) { + $args['orderby'] = $orderby; + } + + $args = array( + 'per_page' => $per_page, + 'paged' => $current_page, + 'orderby' => $orderby, + 'order' => $order, + 'product_id' => $product_id, + 'order_id' => $order_id, + 'customer_id' => $customer_id, + 'include' => $id, + 'search' => $search, + 'serial_id' => $serial_id, + ); + + $this->items = Activation::query( $args ); + $this->total_count = Activation::count( $args ); + + $this->set_pagination_args( + array( + 'total_items' => $this->total_count, + 'per_page' => $per_page, + 'total_pages' => $this->total_count > 0 ? ceil( $this->total_count / $per_page ) : 0, + ) + ); + } + + /** + * No items found text. + */ + public function no_items() { + esc_html_e( 'No activations found. Once a serial key is activated, it will appear here.', 'wc-serial-numbers' ); + } + + /** + * Adds the order and product filters to the licenses list. + * + * @param string $which Which nav. + */ + protected function extra_tablenav( $which ) { + if ( 'top' === $which ) { + echo '

    '; + $this->order_dropdown(); + $this->product_dropdown(); + submit_button( __( 'Filter', 'wc-serial-numbers' ), '', 'filter-action', false ); + echo '
    '; + } + } + + /** + * Process bulk action. + * + * @param string $doaction Action name. + * + * @since 1.4.6 + */ + public function process_bulk_actions( $doaction ) { + if ( $doaction && check_ajax_referer( 'bulk-activations' ) && current_user_can( wcsn_get_manager_role() ) ) { + if ( isset( $_REQUEST['id'] ) ) { + $ids = wp_parse_id_list( wp_unslash( $_REQUEST['id'] ) ); + } elseif ( isset( $_REQUEST['ids'] ) ) { + $ids = array_map( 'absint', $_REQUEST['ids'] ); + } elseif ( wp_get_referer() ) { + wp_safe_redirect( wp_get_referer() ); + exit; + } + + foreach ( $ids as $id ) { // Check the permissions on each. + $key = Activation::get( $id ); + if ( ! $key ) { + continue; + } + switch ( $doaction ) { + case 'delete': + $key->delete(); + break; + } + } + + wp_safe_redirect( wp_get_referer() ); + exit; + } + + parent::process_bulk_actions( $doaction ); + } + + /** + * Get bulk actions + * + * since 1.0.0 + * + * @return array + */ + public function get_bulk_actions() { + return array( + 'delete' => __( 'Delete', 'wc-serial-numbers' ), + ); + } + + /** + * since 1.0.0 + * + * @return array + */ + public function get_columns() { + $columns = array( + 'cb' => '', + 'instance' => __( 'Instance', 'wc-serial-numbers' ), + 'product' => __( 'Product', 'wc-serial-numbers' ), + 'serial_id' => __( 'Key', 'wc-serial-numbers' ), + 'platform' => __( 'Platform', 'wc-serial-numbers' ), + 'activation_time' => __( 'Activation Time', 'wc-serial-numbers' ), + ); + + return apply_filters( 'wc_serial_numbers_activations_table_columns', $columns ); + } + + /** + * since 1.0.0 + * + * @return array + */ + public function get_sortable_columns() { + $sortable_columns = array( + 'instance' => array( 'instance', false ), + 'serial_id' => array( 'serial_id', false ), + 'platform' => array( 'platform', false ), + 'activation_time' => array( 'activation_time', false ), + ); + + return apply_filters( 'wc_serial_numbers_activations_table_sortable_columns', $sortable_columns ); + } + + /** + * Gets the name of the primary column. + * + * @since 1.0.0 + * @access protected + * @return string Name of the primary column. + */ + protected function get_primary_column_name() { + return 'instance'; + } + + /** + * since 1.0.0 + * + * @param object $item Item. + * + * @return string|void + */ + protected function column_cb( $item ) { + return ""; + } + + /** + * Display key. + * + * @param Activation $activation Activation. + * + * @since 1.4.6 + */ + protected function column_instance( $activation ) { + $delete_url = add_query_arg( + array( + 'id' => $activation->id, + 'action' => 'delete', + ), + admin_url( 'admin.php?page=wc-serial-numbers-activations' ) + ); + $actions['delete'] = sprintf( '%2$s', wp_nonce_url( $delete_url, 'bulk-activations' ), __( 'Delete', 'wc-serial-numbers' ) ); + + return sprintf( '%1$s %2$s', esc_html( $activation->get_instance() ), $this->row_actions( $actions ) ); + } + + /** + * Display product column. + * + * @param Activation $activation Activation. + * + * @since 1.4.6 + */ + protected function column_product( $activation ) { + return esc_html( $activation->get_product_title() ); + } + + /** + * Display key. + * + * @param Activation $activation Activation. + * + * @since 1.4.6 + */ + protected function column_serial_id( $activation ) { + $edit_url = admin_url( 'admin.php?page=wc-serial-numbers&id=' . $activation->get_serial_id() ); + + return sprintf( '#%2$s', esc_url( $edit_url ), esc_html( $activation->get_serial_id() ) ); + } + + /** + * Display platform. + * + * @param Activation $activation Activation. + * + * @since 1.4.6 + */ + protected function column_platform( $activation ) { + return empty( $activation->get_platform() ) ? '—' : esc_html( $activation->get_platform() ); + } + + /** + * Display activation time. + * + * @param Activation $activation Activation. + * + * @since 1.4.6 + */ + protected function column_activation_time( $activation ) { + return empty( $activation->get_activation_time() ) ? '—' : esc_html( $activation->get_activation_time() ); + } +} diff --git a/trunk/src/Admin/ListTables/KeysTable.php b/trunk/src/Admin/ListTables/KeysTable.php new file mode 100644 index 00000000..9ab8eaac --- /dev/null +++ b/trunk/src/Admin/ListTables/KeysTable.php @@ -0,0 +1,559 @@ + __( 'key', 'wc-serial-numbers' ), + 'plural' => __( 'keys', 'wc-serial-numbers' ), + 'ajax' => false, + ) + ); + } + + /** + * Prepare table data. + * + * @since 1.4.6 + */ + public function prepare_items() { + $per_page = $this->get_items_per_page( 'wc_serial_numbers_keys_per_page' ); + $columns = $this->get_columns(); + $hidden = array(); + $sortable = $this->get_sortable_columns(); + $this->_column_headers = array( $columns, $hidden, $sortable ); + $current_page = $this->get_pagenum(); + $status = filter_input( INPUT_GET, 'status', FILTER_SANITIZE_SPECIAL_CHARS ); + $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_SPECIAL_CHARS ); + $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_SPECIAL_CHARS ); + $search = filter_input( INPUT_GET, 's', FILTER_SANITIZE_SPECIAL_CHARS ); + $product_id = filter_input( INPUT_GET, 'product_id', FILTER_SANITIZE_NUMBER_INT ); + $order_id = filter_input( INPUT_GET, 'order_id', FILTER_SANITIZE_NUMBER_INT ); + $customer_id = filter_input( INPUT_GET, 'customer_id', FILTER_SANITIZE_NUMBER_INT ); + $id = filter_input( INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT ); + + if ( ! empty( $status ) && ! array_key_exists( $status, wcsn_get_key_statuses() ) ) { + $status = 'available'; + } + + if ( array_key_exists( $orderby, $this->get_sortable_columns() ) && 'order_date' !== $orderby ) { + $args['orderby'] = $orderby; + } + + $args = array( + 'per_page' => $per_page, + 'paged' => $current_page, + 'orderby' => $orderby, + 'order' => $order, + 'status' => $status, + 'product_id' => $product_id, + 'order_id' => $order_id, + 'customer_id' => $customer_id, + 'include' => $id, + 'search' => $search, + ); + + $this->items = Key::query( $args ); + $this->available_count = Key::count( array_merge( $args, array( 'status' => 'available' ) ) ); + $this->pending_count = Key::count( array_merge( $args, array( 'status' => 'pending' ) ) ); + $this->sold_count = Key::count( array_merge( $args, array( 'status' => 'sold' ) ) ); + $this->expired_count = Key::count( array_merge( $args, array( 'status' => 'expired' ) ) ); + $this->cancelled_count = Key::count( array_merge( $args, array( 'status' => 'cancelled' ) ) ); + $this->total_count = array_sum( array( $this->available_count, $this->sold_count, $this->pending_count, $this->expired_count, $this->cancelled_count ) ); + + switch ( $status ) { + case 'available': + $total_items = $this->available_count; + break; + case 'pending': + $total_items = $this->pending_count; + break; + case 'sold': + $total_items = $this->sold_count; + break; + case 'expired': + $total_items = $this->expired_count; + break; + case 'cancelled': + $total_items = $this->cancelled_count; + break; + case 'any': + default: + $total_items = $this->total_count; + break; + } + + $this->set_pagination_args( + array( + 'total_items' => $total_items, + 'per_page' => get_user_option( 'serials_per_page' ), + 'total_pages' => $total_items > 0 ? ceil( $total_items / $per_page ) : 0, + ) + ); + } + + /** + * No items found text. + */ + public function no_items() { + printf( '%s %s', esc_html__( 'No keys found.', 'wc-serial-numbers' ), '' . esc_html__( 'Add new key', 'wc-serial-numbers' ) . '' ); + // Show a documentation about key's statuses. + ?> +

    + +

    +
      +
    • + + ‐ + +
    • +
    • + + ‐ + +
    • +
    • + + ‐ + +
    • +
    • + + ‐ + +
    • +
    • + + ‐ + +
    • +
    + (' . $this->available_count . ')'; + $pending_count = ' (' . $this->pending_count . ')'; + $sold_count = ' (' . $this->sold_count . ')'; + $expired_count = ' (' . $this->expired_count . ')'; + $cancelled_count = ' (' . $this->cancelled_count . ')'; + $total_count = ' (' . $this->total_count . ')'; + $url = admin_url( 'admin.php?page=wc-serial-numbers' ); + $views = array( + 'all' => sprintf( + '%s', + remove_query_arg( 'status', $url ), + __( 'All keys.', 'wc-serial-numbers' ), + 'all' === $current || '' === $current ? ' class="current"' : '', + __( 'All', 'wc-serial-numbers' ) . $total_count + ), + 'available' => sprintf( + '%s', + add_query_arg( 'status', 'available', $url ), + __( 'Available for sell.', 'wc-serial-numbers' ), + 'available' === $current ? ' class="current"' : '', + __( 'Available', 'wc-serial-numbers' ) . $available_count + ), + 'pending' => sprintf( + '%s', + add_query_arg( 'status', 'pending', $url ), + __( 'Pending payment.', 'wc-serial-numbers' ), + 'pending' === $current ? ' class="current"' : '', + __( 'Pending', 'wc-serial-numbers' ) . $pending_count + ), + 'sold' => sprintf( + '%s', + add_query_arg( 'status', 'sold', $url ), + __( 'Sold keys.', 'wc-serial-numbers' ), + 'sold' === $current ? ' class="current"' : '', + __( 'Sold', 'wc-serial-numbers' ) . $sold_count + ), + 'expired' => sprintf( + '%s', + add_query_arg( 'status', 'expired', $url ), + __( 'Expired keys.', 'wc-serial-numbers' ), + 'expired' === $current ? ' class="current"' : '', + __( 'Expired', 'wc-serial-numbers' ) . $expired_count + ), + 'cancelled' => sprintf( + '%s', + add_query_arg( 'status', 'cancelled', $url ), + __( 'Cancelled keys.', 'wc-serial-numbers' ), + 'cancelled' === $current ? ' class="current"' : '', + __( 'Cancelled', 'wc-serial-numbers' ) . $cancelled_count + ), + ); + + return $views; + } + + /** + * Adds the order and product filters to the licenses list. + * + * @param string $which The location of the extra table nav markup: 'top' or 'bottom'. + */ + protected function extra_tablenav( $which ) { + if ( 'top' === $which ) { + echo '
    '; + $this->order_dropdown(); + $this->product_dropdown(); + $this->customer_dropdown(); + submit_button( __( 'Filter', 'wc-serial-numbers' ), '', 'filter-action', false ); + + echo '
    '; + } + } + + /** + * Process bulk action. + * + * @param string $doaction Action name. + * + * @since 1.4.6 + */ + public function process_bulk_actions( $doaction ) { + if ( $doaction && check_ajax_referer( 'bulk-' . $this->_args['plural'] ) && current_user_can( wcsn_get_manager_role() ) ) { + if ( wp_unslash( isset( $_REQUEST['id'] ) ) ) { + $ids = wp_parse_id_list( wp_unslash( $_REQUEST['id'] ) ); + } elseif ( isset( $_REQUEST['ids'] ) ) { + $ids = array_map( 'absint', $_REQUEST['ids'] ); + } elseif ( wp_get_referer() ) { + wp_safe_redirect( wp_get_referer() ); + exit; + } + + foreach ( $ids as $id ) { // Check the permissions on each. + $key = Key::get( $id ); + if ( ! $key ) { + continue; + } + switch ( $doaction ) { + case 'delete': + $key->delete(); + break; + case 'reset_activations': + $key->reset_activations(); + break; + } + } + + wp_safe_redirect( wp_get_referer() ); + exit; + } + + parent::process_bulk_actions( $doaction ); + } + + /** + * Get bulk actions + * + * since 1.0.0 + * + * @return array + */ + public function get_bulk_actions() { + return array( + 'delete' => __( 'Delete', 'wc-serial-numbers' ), + 'reset_activations' => __( 'Reset Activations', 'wc-serial-numbers' ), + ); + } + + /** + * since 1.0.0 + * + * @return array + */ + public function get_columns() { + $columns = array( + 'cb' => '', + 'key' => __( 'Key', 'wc-serial-numbers' ), + 'product' => __( 'Product', 'wc-serial-numbers' ), + 'order' => __( 'Order', 'wc-serial-numbers' ), + 'valid_for' => __( 'Validity', 'wc-serial-numbers' ), + ); + + if ( wcsn_is_software_support_enabled() ) { + $columns['activation'] = __( 'Activation', 'wc-serial-numbers' ); + } + + $columns['order_date'] = __( 'Order Date', 'wc-serial-numbers' ); + $columns['status'] = __( 'Status', 'wc-serial-numbers' ); + + return apply_filters( 'wc_serial_numbers_keys_table_columns', $columns ); + } + + /** + * since 1.0.0 + * + * @return array + */ + public function get_sortable_columns() { + $sortable_columns = array( + 'key' => array( 'serial_key', false ), + 'product' => array( 'product_id', false ), + 'order' => array( 'order_id', false ), + 'customer' => array( 'customer', false ), + 'activation' => array( 'activation_limit', false ), + 'expire_date' => array( 'expire_date', false ), + 'valid_for' => array( 'valid_for', false ), + 'status' => array( 'status', false ), + 'order_date' => array( 'order_date', false ), + ); + + return apply_filters( 'wc_serial_numbers_keys_table_sortable_columns', $sortable_columns ); + } + + /** + * Gets the name of the primary column. + * + * @since 1.0.0 + * @access protected + * @return string Name of the primary column. + */ + protected function get_primary_column_name() { + return 'key'; + } + + /** + * since 1.0.0 + * + * @param \StdClass $item Item. + * + * @return string|void + */ + protected function column_cb( $item ) { + return ""; + } + + /** + * Display key. + * + * @param Key $item Item. + * + * @since 1.4.6 + */ + protected function column_key( $item ) { + $is_hidden = 'yes' === get_option( 'wc_serial_numbers_hide_serial_number', 'yes' ); + $edit_url = add_query_arg( array( 'edit' => $item->id ), admin_url( 'admin.php?page=wc-serial-numbers' ) ); + $delete_url = add_query_arg( + array( + 'id' => $item->id, + 'action' => 'delete', + ), + admin_url( 'admin.php?page=wc-serial-numbers' ) + ); + // translators: %d: key id. + $actions['id'] = sprintf( __( 'ID: %d', 'wc-serial-numbers' ), esc_html( $item->id ) ); + $actions['edit'] = sprintf( '%2$s', $edit_url, __( 'Edit', 'wc-serial-numbers' ) ); + $actions['delete'] = sprintf( '%2$s', wp_nonce_url( $delete_url, 'bulk-keys' ), __( 'Delete', 'wc-serial-numbers' ) ); + + return sprintf( '%1$s %2$s', $item->print_key( $is_hidden ), $this->row_actions( $actions ) ); + } + + /** + * Display column product. + * + * @param Key $item Item. + * + * @since 1.4.6 + */ + protected function column_product( $item ) { + $product = wc_get_product( $item->product_id ); + + return empty( $item->product_id ) || empty( $product ) ? '—' : sprintf( '#%d - %s', wcsn_get_edit_product_link( $product->get_id() ), $product->get_id(), $product->get_formatted_name() ); + } + + /** + * Display column order. + * + * @param Key $item Item. + * + * @since 1.4.6 + */ + protected function column_order( $item ) { + $order = $item->get_order(); + if ( empty( $order ) ) { + return '—'; + } + + return sprintf( '#%d - %s', get_edit_post_link( $order->get_id() ), $order->get_id(), $order->get_formatted_billing_full_name() ); + } + + /** + * Display column customer. + * + * @param \StdClass $item Item. + * + * @since 1.4.6 + */ + protected function column_customer( $item ) { + if ( empty( $item->order_id ) ) { + return '—'; + } + $order = wc_get_order( $item->order_id ); + if ( empty( $order ) || empty( $order->get_id() ) ) { + return '—'; + } + + return sprintf( + '%s (#%d - %s)', + get_edit_user_link( $order->get_customer_id() ), + $order->get_formatted_billing_full_name(), + $order->get_customer_id(), + $order->get_billing_email() + ); + } + + /** + * Display column activation. + * + * @param Key $key Key object. + * + * @since 1.4.6 + */ + protected function column_activation( $key ) { + $limit = ! empty( $key->activation_limit ) ? $key->activation_limit : '∞'; + $count = (int) $key->activation_count; + $link = add_query_arg( + array( + 'serial_id' => $key->id, + 'page' => 'wc-serial-numbers-activations', + ), + admin_url( 'admin.php' ) + ); + + $activated = sprintf( '%s', $link, $count ); + + return sprintf( '%s / %s', $activated, $limit ); + } + + /** + * Display column valid for. + * + * @param Key $key Key object. + * + * @since 1.4.6 + */ + protected function column_valid_for( $key ) { + if ( ! empty( $key->get_validity() ) ) { + return wp_kses_post( + sprintf( + // translators: %1$s: validity, %2$s: validity. + _n( + '%s Day
    After purchase', + '%s Days
    After purchase', + $key->get_validity(), + 'wc-serial-numbers' + ), + number_format_i18n( $key->get_validity() ) + ) + ); + } + return __( 'Lifetime', 'wc-serial-numbers' ); + } + + /** + * Display column order date. + * + * @param Key $key Key object. + * + * @since 1.4.6 + */ + protected function column_order_date( $key ) { + if ( ! empty( $key->order_date ) && '0000-00-00 00:00:00' !== $key->order_date ) { + return wp_date( get_option( 'date_format' ), strtotime( $key->order_date ) ); + } + return '—'; + } + + /** + * Display column status. + * + * @param Key $key Key object. + * + * @since 1.4.6 + */ + protected function column_status( $key ) { + return sprintf( "%s", sanitize_html_class( $key->status ), ucfirst( $key->status ) ); + } +} diff --git a/trunk/src/Admin/ListTables/ListTable.php b/trunk/src/Admin/ListTables/ListTable.php new file mode 100644 index 00000000..1c527375 --- /dev/null +++ b/trunk/src/Admin/ListTables/ListTable.php @@ -0,0 +1,208 @@ +get_request_var( 's', '' ); + } + + /** + * Retrieve the order query string. + * + * @since 1.4.6 + * @return string Order query. + */ + protected function get_order() { + return $this->get_request_var( 'order', 'DESC' ); + } + + /** + * Retrieve the orderby query string. + * + * @since 1.4.6 + * @return string Orderby query. + */ + protected function get_orderby() { + return $this->get_request_var( 'orderby', 'date' ); + } + + /** + * Retrieve the page query string. + * + * @since 1.4.6 + * @return string Page query. + */ + protected function get_page() { + return $this->get_request_var( 'page', '' ); + } + + /** + * Retrieve the current page URL. + * + * @since 1.4.6 + * @return string Current page URL. + */ + protected function get_current_page_url() { + $page = $this->get_page(); + + // Build the base URL. + return add_query_arg( 'page', $page, admin_url( 'admin.php' ) ); + } + + /** + * Show the search field + * + * @param string $text Label for the search box. + * @param string $input_id ID of the search box. + * + * @since 1.4.6 + * @return void + */ + public function search_box( $text, $input_id ) { + if ( empty( $this->get_search() ) && ! $this->has_items() ) { + return; + } + + $input_id = $input_id . '-search-input'; + $orderby = $this->get_orderby(); + $order = $this->get_order(); + + if ( ! empty( $orderby ) ) { + echo ''; + } + if ( ! empty( $order ) ) { + echo ''; + } + ?> + + + + + + + + + + + __( 'stock', 'wc-serial-numbers' ), + 'plural' => __( 'stocks', 'wc-serial-numbers' ), + 'ajax' => false, + ) + ); + } + + /** + * Prepare table data. + * + * @since 1.4.6 + */ + public function prepare_items() { + $per_page = 20; + $columns = $this->get_columns(); + $hidden = array(); + $sortable = $this->get_sortable_columns(); + $this->_column_headers = array( $columns, $hidden, $sortable ); + $current_page = $this->get_pagenum(); + $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_SPECIAL_CHARS ); + $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_SPECIAL_CHARS ); + $search = filter_input( INPUT_GET, 's', FILTER_SANITIZE_SPECIAL_CHARS ); + $product_id = filter_input( INPUT_GET, 'product_id', FILTER_SANITIZE_NUMBER_INT ); + + $query_args = array( + 'posts_per_page' => $per_page, + 'fields' => 'ids', + 's' => $search, + 'paged' => $current_page, + 'orderby' => $orderby, + 'order' => $order, + 'post__in' => $product_id ? wp_parse_id_list( $product_id ) : array(), + ); + $post_ids = wcsn_get_products( $query_args ); + + $this->items = array_map( 'wc_get_product', $post_ids ); + $this->total_count = wcsn_get_products( array_merge( $query_args, array( 'count' => true ) ) ); + $this->set_pagination_args( + array( + 'total_items' => $this->total_count, + 'per_page' => $per_page, + 'total_pages' => $this->total_count > 0 ? ceil( $this->total_count / $per_page ) : 0, + ) + ); + } + + /** + * No items found text. + */ + public function no_items() { + esc_html_e( 'No products selling serial keys from "stock" found.', 'wc-serial-numbers' ); + } + + /** + * Adds the order and product filters to the licenses list. + * + * @param string $which The location of the extra table nav markup: 'top' or 'bottom'. + */ + protected function extra_tablenav( $which ) { + if ( 'top' === $which ) { + echo '
    '; + $this->product_dropdown(); + submit_button( __( 'Filter', 'wc-serial-numbers' ), '', 'filter-action', false ); + + echo '
    '; + } + } + + /** + * since 1.0.0 + * + * @return array + */ + public function get_columns() { + $columns = array( + 'product' => __( 'Product', 'wc-serial-numbers' ), + 'source' => __( 'Source', 'wc-serial-numbers' ), + 'sold' => __( 'Sold', 'wc-serial-numbers' ), + 'stock' => __( 'Stock', 'wc-serial-numbers' ), + ); + + return apply_filters( 'wc_serial_numbers_stock_table_columns', $columns ); + } + + /** + * since 1.0.0 + * + * @return array + */ + public function get_sortable_columns() { + $columns = array( + 'product' => array( 'product_id', false ), + ); + + return apply_filters( 'wc_serial_numbers_stock_table_sortable_columns', $columns ); + } + + /** + * Gets the name of the primary column. + * + * @since 1.0.0 + * @access protected + * @return string Name of the primary column. + */ + protected function get_primary_column_name() { + return 'product'; + } + + /** + * since 1.0.0 + * + * @param \WC_Product $item The current item. + * + * @return string + */ + public function column_product( $item ) { + $product_id = $item->get_id(); + $product = wc_get_product( $product_id ); + $title = $product->get_formatted_name(); + $edit_link = wcsn_get_edit_product_link( $product_id ); + + $actions = array( + 'id' => sprintf( 'ID: %d', esc_attr( $item->get_id() ) ), + 'edit' => sprintf( '%s', esc_url( $edit_link ), esc_html__( 'Edit', 'wc-serial-numbers' ) ), + ); + + return sprintf( '%s %s', esc_url( $edit_link ), wp_kses_post( $title ), $this->row_actions( $actions ) ); + } + + /** + * since 1.0.0 + * + * @param \WC_Product $item The current item. + * @param string $column_name The current column name. + * + * @return string + */ + public function column_default( $item, $column_name ) { + switch ( $column_name ) { + case 'sold': + $sold_count = wcsn_get_keys( + array( + 'status__in' => array( 'sold', 'expired' ), + 'product_id' => $item->get_id(), + 'count' => true, + ) + ); + + return number_format_i18n( $sold_count ); + case 'source': + $source = get_post_meta( $item->get_id(), '_serial_key_source', true ); + if ( 'custom_source' === $source ) { + $label = esc_html__( 'Manual', 'wc-serial-numbers' ); + } elseif ( 'generator_rule' === $source ) { + $label = esc_html__( 'Generator Rule', 'wc-serial-numbers' ); + } elseif ( 'auto_generated' === $source ) { + $label = esc_html__( 'Auto Generated', 'wc-serial-numbers' ); + } else { + $label = esc_html__( 'Unknown', 'wc-serial-numbers' ); + } + + return $label; + + case 'stock': + $stocks = wcsn_get_stocks_count(); + if ( array_key_exists( $item->get_id(), $stocks ) ) { + $stock = number_format_i18n( $stocks[ $item->get_id() ] ); + $link = admin_url( 'admin.php?page=wc-serial-numbers&status=available&product_id=' . $item->get_id() ); + + return sprintf( '%s', esc_url( $link ), $stock ); + } else { + return '—'; + } + default: + return apply_filters( 'wc_serial_numbers_stock_table_column_content', '', $item, $column_name ); + } + } +} diff --git a/trunk/src/Admin/Menus.php b/trunk/src/Admin/Menus.php new file mode 100644 index 00000000..e97ae3d0 --- /dev/null +++ b/trunk/src/Admin/Menus.php @@ -0,0 +1,518 @@ +id ) ? $screen->id : ''; + } + + // Ensure the table handler is only loaded once. Prevents multiple loads if a plugin calls check_ajax_referer many times. + remove_action( 'current_screen', array( $this, 'setup_screen' ) ); + remove_action( 'check_ajax_referer', array( $this, 'setup_screen' ) ); + } + + /** + * Validate screen options on update. + * + * @param bool|int $status Screen option value. Default false to skip. + * @param string $option The option name. + * @param int $value The number of rows to use. + */ + public function save_screen_options( $status, $option, $value ) { + if ( in_array( $option, array( 'wsn_keys_per_page', 'wsn_generators_per_page', 'wsn_activations_per_page' ), true ) ) { + return $value; + } + + return $status; + } + + /** + * Add menu. + * + * @since 1.0.0 + * @return void + */ + public function main_menu() { + $role = wcsn_get_manager_role(); + add_menu_page( + __( 'Serial Numbers', 'wc-serial-numbers' ), + __( 'Serial Numbers', 'wc-serial-numbers' ), + $role, + 'wc-serial-numbers', + null, + 'dashicons-lock', + '55.9' + ); + + add_submenu_page( + 'wc-serial-numbers', + __( 'Serial Keys', 'wc-serial-numbers' ), + __( 'Serial Keys', 'wc-serial-numbers' ), + $role, + 'wc-serial-numbers', + array( $this, 'output_main_page' ) + ); + } + + /** + * Add activations menu. + * + * @since 1.0.0 + * @return void + */ + public function activations_menu() { + if ( ! wcsn_is_software_support_enabled() ) { + return; + } + add_submenu_page( + 'wc-serial-numbers', + __( 'Activations', 'wc-serial-numbers' ), + __( 'Activations', 'wc-serial-numbers' ), + wcsn_get_manager_role(), + 'wc-serial-numbers-activations', + array( $this, 'output_activations_page' ) + ); + } + + /** + * Add tools menu. + * + * @since 1.0.0 + * @return void + */ + public function tools_menu() { + add_submenu_page( + 'wc-serial-numbers', + __( 'Tools', 'wc-serial-numbers' ), + __( 'Tools', 'wc-serial-numbers' ), + wcsn_get_manager_role(), + 'wc-serial-numbers-tools', + array( $this, 'output_tools_page' ) + ); + } + + /** + * Add reports menu. + * + * @since 1.0.0 + * @return void + */ + public function reports_menu() { + add_submenu_page( + 'wc-serial-numbers', + __( 'Reports', 'wc-serial-numbers' ), + __( 'Reports', 'wc-serial-numbers' ), + wcsn_get_manager_role(), + 'wc-serial-numbers-reports', + array( $this, 'output_reports_page' ) + ); + } + + /** + * Settings menu. + * + * @since 1.0.0 + * @return void + */ + public function settings_menu() { + add_submenu_page( + 'wc-serial-numbers', + __( 'Settings', 'wc-serial-numbers' ), + __( 'Settings', 'wc-serial-numbers' ), + wcsn_get_manager_role(), + 'wc-serial-numbers-settings', + array( Settings::class, 'output' ) + ); + } + + /** + * Add promo Menu. + * + * @since 1.0.0 + * @return void + */ + public function promo_menu() { + $role = wcsn_get_manager_role(); + if ( ! WCSN()->is_premium_active() ) { + add_submenu_page( + 'wc-serial-numbers', + '', + ' ' . __( 'Upgrade to Pro', 'wc-serial-numbers' ) . '', + $role, + 'go_wcsn_pro', + array( $this, 'go_pro_redirect' ) + ); + } + } + + /** + * Output keys page. + * + * @since 1.0.0 + * @return void + */ + public function output_main_page() { + wp_verify_nonce( '_nonce' ); + $add = isset( $_GET['add'] ) ? true : false; + $edit = isset( $_GET['edit'] ) ? absint( $_GET['edit'] ) : 0; + if ( $edit ) { + $key = new Key( $edit ); + if ( ! $key->exists() ) { + wp_safe_redirect( remove_query_arg( 'edit' ) ); + exit(); + } + } + + if ( $add ) { + $key = new Key(); + include __DIR__ . '/views/html-edit-key.php'; + } elseif ( $edit ) { + include __DIR__ . '/views/html-edit-key.php'; + } else { + include __DIR__ . '/views/html-list-keys.php'; + } + } + + /** + * Output activations page. + * + * @since 1.0.0 + * @return void + */ + public function output_activations_page() { + Admin::view( 'html-list-activations.php' ); + } + + + /** + * Output tools page. + * + * @since 1.0.0 + * @return void + */ + public function output_tools_page() { + wp_verify_nonce( '_nonce' ); + $tabs = array( + 'generators' => __( 'Generators', 'wc-serial-numbers' ), + 'api' => __( 'API Toolkit', 'wc-serial-numbers' ), + 'import' => __( 'Import', 'wc-serial-numbers' ), + 'export' => __( 'Export', 'wc-serial-numbers' ), + ); + + // If software support is disabled, remove the activations tab. + if ( ! wcsn_is_software_support_enabled() ) { + unset( $tabs['api'] ); + } + + $tabs = apply_filters( 'wc_serial_numbers_tools_tabs', $tabs ); + $tab_ids = array_keys( $tabs ); + $current_tab = isset( $_GET['tab'] ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : reset( $tab_ids ); + $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; + + Admin::view( + 'html-tools.php', + array( + 'tabs' => $tabs, + 'current_tab' => $current_tab, + 'page' => $page, + ) + ); + } + + /** + * Output reports page. + * + * @since 1.0.0 + * @return void + */ + public function output_reports_page() { + wp_verify_nonce( '_nonce' ); + $tabs = array( + 'stock' => __( 'Stock', 'wc-serial-numbers' ), + ); + + $tabs = apply_filters( 'wc_serial_numbers_reports_tabs', $tabs ); + $tab_ids = array_keys( $tabs ); + $current_tab = isset( $_GET['tab'] ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : reset( $tab_ids ); + $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; + + Admin::view( + 'html-reports.php', + array( + 'tabs' => $tabs, + 'current_tab' => $current_tab, + 'page' => $page, + ) + ); + } + + /** + * Redirect to pro page. + * + * @since 1.0.0 + * @return void + */ + public function go_pro_redirect() { + wp_verify_nonce( '_nonce' ); + if ( isset( $_GET['page'] ) && 'go_wcsn_pro' === $_GET['page'] ) { + wp_safe_redirect( 'https://pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=admin-menu&utm_medium=link&utm_campaign=upgrade&utm_id=wc-serial-numbers' ); + die; + } + } + + /** + * Add status tab. + * + * @param array $tabs Tabs. + * + * @return array + */ + public static function add_tools_status_tab( $tabs ) { + $tabs['status'] = __( 'Status', 'wc-serial-numbers' ); + + return $tabs; + } + + /** + * Import tab content. + * + * @since 1.0.0 + * @return void + */ + public static function import_tab() { + ?> +
    +
    +

    + +
    + <?php esc_attr_e( 'Import Serial Numbers', 'wc-serial-numbers' ); ?> +
    +
    +
    +

    + +
    + <?php esc_attr_e( 'Import Serial Numbers', 'wc-serial-numbers' ); ?> +
    + +
    +
    +

    + +
    + <?php esc_attr_e( 'Export Serial Numbers', 'wc-serial-numbers' ); ?> +
    + +
    +
    +

    + +
    + <?php esc_attr_e( 'Generators', 'wc-serial-numbers' ); ?> +
    + WCSN()->get_version(), + ); + if ( WCSN()->is_premium_active() && function_exists( 'wc_serial_numbers_pro' ) ) { + $statuses['Serial Numbers Pro version'] = WCSN_PRO()->get_version(); + } + + // Check if required tables exist. + $required_tables = array( + 'serial_numbers', + 'serial_numbers_activations', + ); + foreach ( $required_tables as $table ) { + $exists = $GLOBALS['wpdb']->get_var( $GLOBALS['wpdb']->prepare( 'SHOW TABLES LIKE %s', $GLOBALS['wpdb']->prefix . $table ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + if ( $exists ) { + $statuses[ $table ] = __( 'Table exists', 'wc-serial-numbers' ); + } else { + $statuses[ $table ] = __( 'Table does not exist', 'wc-serial-numbers' ); + } + } + + // Cron jobs. + $cron_jobs = array( + 'wc_serial_numbers_hourly_event' => __( 'Hourly cron', 'wc-serial-numbers' ), + 'wc_serial_numbers_daily_event' => __( 'Daily cron', 'wc-serial-numbers' ), + ); + foreach ( $cron_jobs as $cron_job => $cron_job_name ) { + $next_scheduled = wp_next_scheduled( $cron_job ); + if ( $next_scheduled ) { + // translators: %s: Next scheduled time. + $statuses[ $cron_job_name ] = sprintf( __( 'Next run: %s', 'wc-serial-numbers' ), esc_html( date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $next_scheduled ) ) ); + } else { + $statuses[ $cron_job_name ] = __( 'Not scheduled', 'wc-serial-numbers' ); + } + } + $statuses = apply_filters( 'wc_serial_numbers_plugin_statuses', $statuses ); + ?> + + + + + + + + $value ) : ?> + + + + + + + + +

    + + - 1, + 'fields' => 'ids', + ) + ); + $the_query = new \WP_Query( $args ); + $product_ids = $the_query->get_posts(); + $products = array(); + foreach ( $product_ids as $product_id ) { + $product = wc_get_product( $product_id ); + if ( ! $product ) { + continue; + } + $products[ $product->get_id() ] = sprintf( '%s (#%d)', $product->get_name(), $product->get_id() ); + } + + Admin::view( 'html-api-validation', array( 'products' => $products ) ); + } + + /** + * Activation deactivation section. + * + * @since 1.4.6 + * @return void + */ + public static function api_activation_deactivation_section() { + $args = array_merge( + wcsn_get_products_query_args(), + array( + 'posts_per_page' => - 1, + 'fields' => 'ids', + ) + ); + $the_query = new \WP_Query( $args ); + $product_ids = $the_query->get_posts(); + $products = array(); + foreach ( $product_ids as $product_id ) { + $product = wc_get_product( $product_id ); + if ( ! $product ) { + continue; + } + $products[ $product->get_id() ] = sprintf( '%s (#%d)', $product->get_name(), $product->get_id() ); + } + + Admin::view( 'html-api-actions', array( 'products' => $products ) ); + } + + /** + * Stock section. + * + * @since 1.4.6 + * @return void + */ + public static function reports_stock_tab() { + Admin::view( 'html-list-stock' ); + } +} diff --git a/trunk/src/Admin/Metaboxes.php b/trunk/src/Admin/Metaboxes.php new file mode 100644 index 00000000..bbaa3558 --- /dev/null +++ b/trunk/src/Admin/Metaboxes.php @@ -0,0 +1,283 @@ + __( 'Serial Numbers', 'wc-serial-numbers' ), + 'target' => 'wc_serial_numbers_data', + 'class' => array( 'show_if_simple' ), + 'priority' => 11, + ); + + return $tabs; + } + + /** + * since 1.0.0 + */ + public static function product_write_panel() { + global $post, $woocommerce; + ?> + + is_premium_active() ) { + echo wp_kses_post( + sprintf( + '

    %s %s

    ', + __( 'The free version of Serial Numbers for WooCommerce does not support product variation.', 'wc-serial-numbers' ), + 'https://www.pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=product_page_license_area&utm_medium=link&utm_campaign=wc-serial-numbers&utm_content=Upgrade%20to%20Pro', + __( 'Upgrade to Pro', 'wc-serial-numbers' ) + ) + ); + } + } + + /** + * since 1.0.0 + */ + public static function product_save_data() { + global $post; + if ( ! isset( $_POST['woocommerce_meta_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['woocommerce_meta_nonce'] ) ), 'woocommerce_save_data' ) ) { + return; + } + + // Must have WC Serial Numbers manager role to access this endpoint. + if ( ! current_user_can( wcsn_get_manager_role() ) ) { + return; + } + + $status = isset( $_POST['_is_serial_number'] ) ? 'yes' : 'no'; + $source = isset( $_POST['_serial_key_source'] ) ? sanitize_text_field( wp_unslash( $_POST['_serial_key_source'] ) ) : 'custom_source'; + update_post_meta( $post->ID, '_is_serial_number', $status ); + update_post_meta( $post->ID, '_serial_key_source', $source ); + // save only if software licensing enabled. + if ( wcsn_is_software_support_enabled() ) { + $software_version = isset( $_POST['_software_version'] ) ? sanitize_text_field( wp_unslash( $_POST['_software_version'] ) ) : ''; + update_post_meta( $post->ID, '_software_version', $software_version ); + } + + do_action( 'wcsn_save_simple_product_meta', $post ); + } + + + /** + * Display serial numbers in order item meta. + * + * @param int $o_item_id order item id. + * @param \WC_Order_Item $o_item order item object. + * @param \WC_Product $product product object. + * + * @since 1.1.6 + * + * @return void + */ + public function order_itemmeta( $o_item_id, $o_item, $product ) { + global $post; + if ( ! is_object( $post ) || ! isset( $post->ID ) ) { + return; + } + + $order = wc_get_order( $post->ID ); + + // bail for no order. + if ( ! $order ) { + return; + } + + if ( 'completed' !== $order->get_status( 'edit' ) ) { + return; + } + + // if this is not product then no need to process. + if ( empty( $product ) ) { + return; + } + + if ( 'yes' !== get_post_meta( $product->get_id(), '_is_serial_number', true ) ) { + return; + } + + $items = wcsn_get_keys( + array( + 'order_id' => $post->ID, + 'product_id' => $product->get_id(), + ) + ); + + if ( empty( $items ) && $order ) { + echo wp_kses_post( + sprintf( + '
    %s
    ', + __( 'Order missing serial numbers for this item.', 'wc-serial-numbers' ) + ) + ); + return; + } + + $url = admin_url( 'admin.php?page=wc-serial-numbers' ); + printf( + '
    %s→', + esc_url( + add_query_arg( + array( + 'order_id' => $post->ID, + 'product_id' => $product->get_id(), + ), + $url + ) + ), + esc_html__( 'Serial Numbers', 'wc-serial-numbers' ) + ); + + $url = admin_url( 'admin.php?page=wc-serial-numbers' ); + + $li = ''; + + foreach ( $items as $item ) { + $li .= sprintf( + '
  •  %s
  • ', + add_query_arg( + array( + 'edit' => $item->id, + ), + $url + ), + wcsn_decrypt_key( $item->serial_key ) + ); + } + echo wp_kses_post( + sprintf( + '
      %s
    ', + $li + ) + ); + } +} diff --git a/trunk/src/Admin/Notices.php b/trunk/src/Admin/Notices.php new file mode 100644 index 00000000..0e71a552 --- /dev/null +++ b/trunk/src/Admin/Notices.php @@ -0,0 +1,166 @@ +get_version() && version_compare( wc_serial_numbers_pro()->get_version(), '1.2.1', '<' ); + } + if ( $is_outdated_pro ) { + $this->notices[] = array( + 'type' => 'error', // add notice-alt and notice-large class. + 'message' => sprintf( + /* translators: %1$s: link to the plugin page, %2$s: link to the plugin page */ + __( '%s is not functional because you are using outdated version of the plugin, please update to the version 1.2.1 or higher.', 'wc-serial-numbers' ), + 'WC Serial Numbers Pro' + ), + ); + } + + if ( ! $this->is_notice_dismissed( 'wc_serial_numbers_upgrade_to_pro_wcsnpro10' ) && ! function_exists( 'wc_serial_numbers_pro' ) ) { + $this->notices[] = array( + 'type' => 'info', + 'classes' => 'notice-alt notice-large', + 'dismissible' => true, + 'id' => 'wc_serial_numbers_upgrade_to_pro_wcsnpro10', + 'message' => sprintf( + /* translators: %1$s: link to the plugin page, %2$s: link to the plugin page */ + __( 'Upgrade to %6$s to unlock the full potential of %5$s and avail a %1$s discount by using the promo code %2$s. %3$s Upgrade Now%4$s.', 'wc-serial-numbers' ), + '10%', + 'WCSNPRO10', + '', + '', + '' . WCSN()->get_name() . '', + 'PRO' + ), + ); + } + } + + /** + * Admin notices. + * + * @since 1.0.0 + */ + public function output_notices() { + foreach ( $this->notices as $notice ) { + $notice = wp_parse_args( + $notice, + array( + 'id' => wp_generate_password( 12, false ), + 'type' => 'info', + 'classes' => '', + 'message' => '', + 'dismissible' => false, + ) + ); + + $notice_classes = array( 'notice', 'notice-' . $notice['type'] ); + if ( $notice['dismissible'] ) { + $notice_classes[] = 'is-dismissible'; + } + if ( $notice['classes'] ) { + $notice_classes[] = $notice['classes']; + } + ?> +
    +

    +
    + + + get_id(); + $action = current_action(); + $action = str_replace( 'woocommerce_order_action_', '', $action ); + if ( 'wcsn_add_keys' === $action ) { + wcsn_order_update_keys( $order_id ); + // add a notice. + WCSN()->add_notice( __( 'Serial keys added successfully to the order.', 'wc-serial-numbers' ) ); + } elseif ( 'wcsn_remove_keys' === $action ) { + wcsn_order_remove_keys( $order_id ); + // add a notice. + WCSN()->add_notice( __( 'Serial keys removed successfully from the order.', 'wc-serial-numbers' ) ); + } + } + + /** + * Add order serial column. + * + * @param array $columns Order columns. + * + * @since 1.2.0 + * @return array|string[] + */ + public static function add_order_serial_column( $columns ) { + $position = 3; + $new = array_slice( $columns, 0, $position, true ) + array( 'order_serials' => '' ) + array_slice( $columns, $position, count( $columns ) - $position, true ); + + return $new; + } + + /** + * Add order serial column content. + * + * @param string $column Column name. + * @param int $order_id Order ID. + * + * @since 1.2.0 + */ + public static function add_order_serial_column_content( $column, $order_id ) { + + $order_status = wc_get_order( $order_id )->get_status(); + + if ( 'order_serials' === $column ) { + if ( ! wcsn_order_has_products( $order_id ) || ! in_array( $order_status, array( 'completed', 'processing' ), true ) ) { + echo '—'; + } else { + if ( wcsn_order_is_fullfilled( $order_id ) ) { + $style = 'color:green'; + $title = __( 'Order is fullfilled.', 'wc-serial-numbers' ); + } else { + $style = 'color:red'; + $title = __( 'Order is not fullfilled.', 'wc-serial-numbers' ); + } + $url = add_query_arg( array( 'order_id' => $order_id ), admin_url( 'admin.php?page=wc-serial-numbers' ) ); + printf( '', esc_url( $url ), esc_html( $title ), esc_attr( $style ) ); + } + } + } + + /** + * HPOS Add order serial column content. + * + * @param string $column Column name. + * @param int $order_id Order ID. + * + * @since 1.6.9 + */ + public static function hpos_add_order_serial_column_content( $column, $order_id ) { + + $order = wc_get_order( $order_id ); + + $order_id = $order->get_id(); + $order_status = $order->get_status(); + + if ( 'order_serials' === $column ) { + if ( ! wcsn_order_has_products( $order_id ) || ! in_array( $order_status, array( 'completed', 'processing' ), true ) ) { + echo '—'; + } else { + if ( wcsn_order_is_fullfilled( $order_id ) ) { + $style = 'color:green'; + $title = __( 'Order is fullfilled.', 'wc-serial-numbers' ); + } else { + $style = 'color:red'; + $title = __( 'Order is not fullfilled.', 'wc-serial-numbers' ); + } + $url = add_query_arg( array( 'order_id' => $order_id ), admin_url( 'admin.php?page=wc-serial-numbers' ) ); + printf( '', esc_url( $url ), esc_html( $title ), esc_attr( $style ) ); + } + } + } + + /** + * Add order bulk action. + * + * @param array $actions Order actions. + * + * @since 1.2.0 + * @return array + */ + public function add_order_bulk_action( $actions ) { + $actions['wcsn_add_keys'] = __( 'Add serial keys', 'wc-serial-numbers' ); + $actions['wcsn_remove_keys'] = __( 'Remove serial keys', 'wc-serial-numbers' ); + + return $actions; + } + + /** + * Handle order bulk action. + * + * @param string $redirect_to Redirect URL. + * @param string $action Action name. + * @param array $order_ids Order IDs. + * + * @since 1.2.0 + * @return string + */ + public function handle_order_bulk_action( $redirect_to, $action, $order_ids ) { + if ( in_array( $action, array( 'wcsn_add_keys', 'wcsn_remove_keys' ), true ) ) { + foreach ( $order_ids as $order_id ) { + switch ( $action ) { + case 'wcsn_add_keys': + wcsn_order_update_keys( $order_id ); + break; + case 'wcsn_remove_keys': + wcsn_order_remove_keys( $order_id ); + break; + } + } + // Translators: %d: number of orders. + WCSN()->add_notice( sprintf( __( '%d orders updated successfully.', 'wc-serial-numbers' ), count( $order_ids ) ) ); + $redirect_to = add_query_arg( 'bulk_action', $action, $redirect_to ); + } + + return $redirect_to; + } + + /** + * Show order item meta. + * + * @param int $item_id Item ID. + * @param \WC_Order_Item $item Item. + * @param \WC_Product $product Product. + * + * @since 1.0.0 + */ + public static function display_order_item_meta( $item_id, $item, $product ) { + $order_id = wc_get_order_id_by_order_item_id( $item_id ); + if ( ! $order_id || ! $product || ! wcsn_is_product_enabled( $product->get_id() ) ) { + return; + } + $keys = wcsn_get_keys( + array( + 'order_id' => $order_id, + 'product_id' => $product->get_id(), + 'limit' => - 1, + ) + ); + + if ( empty( $keys ) ) { + return; + } + + echo '

    ' . esc_html__( 'Serial keys sold with this product:', 'wc-serial-numbers' ) . '

    '; + + foreach ( $keys as $index => $key ) { + $data = array( + 'key' => array( + 'label' => __( 'Key', 'wc-serial-numbers' ), + 'value' => '' . $key->get_key() . '', + ), + 'expire_date' => array( + 'label' => __( 'Expire date', 'wc-serial-numbers' ), + 'value' => $key->get_expire_date() ? $key->get_expire_date() : __( 'Lifetime', 'wc-serial-numbers' ), + ), + 'activation_limit' => array( + 'label' => __( 'Activation limit', 'wc-serial-numbers' ), + 'value' => $key->get_activation_limit() ? $key->get_activation_limit() : __( 'Unlimited', 'wc-serial-numbers' ), + ), + 'status' => array( + 'label' => __( 'Status', 'wc-serial-numbers' ), + 'value' => $key->get_status_label(), + ), + ); + + $data = apply_filters( 'wc_serial_numbers_admin_order_item_data', $data, $key, $item, $product, $order_id ); + if ( empty( $data ) ) { + continue; + } + + ?> + + + + + + $field ) : ?> + + + + + + + + + +
    + + +
    :
    + +
    + + + __( 'General', 'wc-serial-numbers' ), + ); + + return apply_filters( 'wc_serial_numbers_settings_tabs', $tabs ); + } + + /** + * Get settings. + * + * @param string $tab Current tab. + * + * @since 1.0.0 + * @return array + */ + public function get_settings( $tab ) { + $settings = array(); + + switch ( $tab ) { + case 'general': + $settings = array( + array( + 'title' => __( 'General Settings', 'wc-serial-numbers' ), + 'type' => 'title', + 'desc' => __( 'These options determine the behavior and operation of the plugin.', 'wc-serial-numbers' ), + 'id' => 'section_serial_numbers', + ), + array( + 'title' => __( 'Auto-complete orders', 'wc-serial-numbers' ), + 'id' => 'wc_serial_numbers_autocomplete_order', + 'desc' => __( 'Automatically completes orders after successful payments.', 'wc-serial-numbers' ), + 'type' => 'checkbox', + 'default' => 'no', + ), + array( + 'title' => __( 'Reuse keys', 'wc-serial-numbers' ), + 'id' => 'wc_serial_numbers_reuse_serial_number', + 'desc' => __( 'Recover failed, refunded keys for selling again.', 'wc-serial-numbers' ), + 'desc_tip' => __( 'If you enable this option, the keys will be available for selling again if the order is refunded or failed.', 'wc-serial-numbers' ), + 'type' => 'checkbox', + 'default' => 'no', + ), + // Revoke serial keys. + array( + 'title' => __( 'Revoke keys', 'wc-serial-numbers' ), + 'id' => 'wc_serial_numbers_revoke_keys', + 'desc' => __( 'Revoke keys when the order status changes to cancelled or refunded.', 'wc-serial-numbers' ), + 'desc_tip' => __( 'If you enable this option, the keys will be revoked when the order status changes to cancelled or refunded.', 'wc-serial-numbers' ), + 'type' => 'checkbox', + 'default' => 'no', + ), + array( + 'title' => __( 'Hide keys', 'wc-serial-numbers' ), + 'id' => 'wc_serial_numbers_hide_serial_number', + 'desc' => __( 'Keys will be masked in the list table.', 'wc-serial-numbers' ), + 'default' => 'yes', + 'type' => 'checkbox', + ), + array( + 'title' => __( 'Disable software support', 'wc-serial-numbers' ), + 'id' => 'wc_serial_numbers_disable_software_support', + 'desc' => __( 'Disable Software Licensing support & API functionalities.', 'wc-serial-numbers' ), + 'desc_tip' => __( 'If you enable this option, the activation menu and it’s functionality will be turned off.', 'wc-serial-numbers' ), + 'default' => 'no', + 'type' => 'checkbox', + ), + array( + 'type' => 'sectionend', + 'id' => 'section_serial_numbers', + ), + array( + 'title' => __( 'Stock Notification', 'wc-serial-numbers' ), + 'type' => 'title', + 'desc' => __( 'These options determine the operation of the key\'s stock notification.', 'wc-serial-numbers' ), + 'id' => 'stock_section', + ), + array( + 'title' => __( 'Stock notification email', 'wc-serial-numbers' ), + 'id' => 'wc_serial_numbers_enable_stock_notification', + 'desc' => __( 'Sends notification emails when key stock is low.', 'wc-serial-numbers' ), + 'type' => 'checkbox', + 'sanitize_callback' => 'intval', + 'default' => 'yes', + ), + array( + 'title' => __( 'Stock threshold', 'wc-serial-numbers' ), + 'id' => 'wc_serial_numbers_stock_threshold', + 'desc' => __( 'An email notification will be sent when the key stock falls below the specified number.', 'wc-serial-numbers' ), + 'type' => 'number', + 'default' => '5', + ), + array( + 'title' => __( 'Notification recipient email', 'wc-serial-numbers' ), + 'id' => 'wc_serial_numbers_notification_recipient', + 'desc' => __( 'The email address which will be used to send email notifications.', 'wc-serial-numbers' ), + 'type' => 'text', + 'default' => get_option( 'admin_email' ), + ), + array( + 'type' => 'sectionend', + 'id' => 'stock_section', + ), + ); + break; + } + /** + * Filter the settings for the plugin. + * + * @param array $settings The settings. + * + * @deprecated 1.4.1 + */ + $settings = apply_filters( 'wc_serial_numbers_' . $tab . '_settings_fields', $settings ); + + return apply_filters( 'wc_serial_numbers_get_settings_' . $tab, $settings ); + } + + /** + * Output premium widget. + * + * @since 1.0.0 + * @return void + */ + protected function output_premium_widget() { + if ( WCSN()->is_premium_active() ) { + return; + } + $features = array( + __( 'Create and assign keys for WooCommerce variable products.', 'wc-serial-numbers' ), + __( 'Generate bulk keys with your custom key generator rule.', 'wc-serial-numbers' ), + __( 'Random & sequential key order for the generator rules.', 'wc-serial-numbers' ), + __( 'Automatic key generator to auto-create & assign keys with orders.', 'wc-serial-numbers' ), + __( 'License key management option from the order page with required actions.', 'wc-serial-numbers' ), + __( 'Support for bulk import/export of keys from/to CSV.', 'wc-serial-numbers' ), + __( 'Send keys via SMS with Twilio.', 'wc-serial-numbers' ), + __( 'Option to sell keys even if there are no available keys in the stock.', 'wc-serial-numbers' ), + __( 'Custom deliverable quantity to deliver multiple keys with a single product.', 'wc-serial-numbers' ), + __( 'Manual delivery option to manually deliver license keys instead of automatic.', 'wc-serial-numbers' ), + __( 'Email template to easily and quickly customize the order confirmation & low stock alert email.', 'wc-serial-numbers' ), + __( 'Many more ...', 'wc-serial-numbers' ), + ); + ?> +
    +

    +

    +
      + +
    • -
    • + +
    + +
    + get_docs_url() ) { + printf( '%s', esc_url( WCSN()->get_docs_url() ), esc_html__( 'Documentation', 'wc-serial-numbers' ) ); + } + } +} diff --git a/trunk/src/Admin/views/html-add-key.php b/trunk/src/Admin/views/html-add-key.php new file mode 100644 index 00000000..a6f321ff --- /dev/null +++ b/trunk/src/Admin/views/html-add-key.php @@ -0,0 +1,199 @@ + + +
    +

    + + + + +

    + +

    + +

    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +

    + +

    +
    + + + +

    + +

    +
    + + + +

    + +

    +
    + + + +

    +
    + + +

    + +

    +

    + +

    +

    + +

    +
    + + + +

    + +

    +
    + + + +

    + +

    +
    + + + + +
    +
    +
    + is_premium_active() ) : ?> + +
    +

    +

    +
      + +
    • -
    • + +
    + +
    + +
    + +
    +
    +
    diff --git a/trunk/src/Admin/views/html-api-actions.php b/trunk/src/Admin/views/html-api-actions.php new file mode 100644 index 00000000..c84d7433 --- /dev/null +++ b/trunk/src/Admin/views/html-api-actions.php @@ -0,0 +1,201 @@ + 'serial-numbers-api', + ), + home_url( '/' ) +); + +?> +
    +
    +

    +
    + +
    +

    + +

    +

    + +

    +
    +

    + +

    +
      +
    1. + product_id - +
    2. +
    3. + serial_key - +
    4. +
    5. + request - +
    6. +
    7. + instance - +
    8. +
    9. + platform - +
    10. +
    11. + email - +
    12. +
    + +

    + + + 123, + 'serial_key' => '123456789', + 'request' => 'activate', + 'instance' => 'example.com', + ), + $api_url + ) + ); + ?> + +

    +

    + +

    + +
      +
    1. + code - +
    2. +
    3. + message - +
    4. +
    5. + activated/deactivated - +
    6. +
    7. + activation_limit - +
    8. +
    9. + activation_count - +
    10. +
    11. + activations_left - +
    12. +
    13. + expire_date - +
    14. +
    15. + expires_at - +
    16. +
    17. + product_id - +
    18. +
    19. + product - +
    20. +
    21. + activations - +
    22. +
    +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    + +

    +
    + +

    + +

    +
    + +

    + +

    +
    + +

    + +

    +
    + +

    + +

    +
    + +

    + +

    +
    +
    +
    + +
    +
    +
    +
    diff --git a/trunk/src/Admin/views/html-api-validation.php b/trunk/src/Admin/views/html-api-validation.php new file mode 100644 index 00000000..15af4f6a --- /dev/null +++ b/trunk/src/Admin/views/html-api-validation.php @@ -0,0 +1,170 @@ + 'serial-numbers-api', + ), + home_url( '/' ) +); +?> +
    +
    +

    +
    +
    + is_premium_active() ) : ?> +
    +

    + Upgrade to Pro to get more features.', 'wc-serial-numbers' ), + esc_url( WCSN()->get_premium_url() . '?utm_source=create_serial_page&utm_medium=button&utm_campaign=wc-serial-numbers&utm_content=View%20Details' ) + ) + ); + ?> +

    +
    + +

    + +

    +

    + +

    +
    +

    + +

    +
      +
    1. + product_id - +
    2. +
    3. + serial_key - +
    4. +
    5. + request - +
    6. +
    7. + email - +
    8. +
    +

    + + + 1, + 'serial_key' => '123456789', + 'request' => 'validate', + ), + $api_url + ) + ); + ?> + +

    +

    + +

    +
      +
    1. + code - +
    2. +
    3. + message - +
    4. +
    5. + activation_limit - +
    6. +
    7. + activation_count - +
    8. +
    9. + activations_left - +
    10. +
    11. + expire_date - +
    12. +
    13. + status - +
    14. +
    15. + product_id - +
    16. +
    17. + product - +
    18. +
    19. + activations - +
    20. +
    + +

    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    + +

    +
    + +

    + +

    +
    + +

    + +

    +
    +
    +
    + + +
    +
    +
    +
    diff --git a/trunk/src/Admin/views/html-edit-key.php b/trunk/src/Admin/views/html-edit-key.php new file mode 100644 index 00000000..e018c16a --- /dev/null +++ b/trunk/src/Admin/views/html-edit-key.php @@ -0,0 +1,198 @@ + +
    +

    + exists() ) : ?> + + + + + + + + +

    + +
    +
    +
    +
    +
    +

    +
    +
    + +
    + + +

    + +

    +
    + +
    + + +

    + +

    +
    + + +
    + + + +

    + +

    +
    + +
    + +
    + +
    + +
    +
    +

    +
    + + + +
    + + +

    +
    + +
    + + +

    +
    + +
    +
    + +
    + +
    +
    +
    +

    +
    + +
    + + get_order() ) : ?> +
    +
    +

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + get_order()->get_formatted_billing_full_name() ); ?> +
    + + + get_order()->get_billing_email() ); ?> +
    + + + get_order()->get_formatted_billing_address() ); ?> +
    + + + get_order()->get_billing_phone() ); ?> +
      + + + +
    +
    +
    + + +
    +
    + + + + +
    +
    diff --git a/trunk/src/Admin/views/html-list-activations.php b/trunk/src/Admin/views/html-list-activations.php new file mode 100644 index 00000000..c4dcaaa0 --- /dev/null +++ b/trunk/src/Admin/views/html-list-activations.php @@ -0,0 +1,32 @@ +current_action(); +$list_table->process_bulk_actions( $doaction ); +?> + +
    +

    + +

    + +
    +
    + prepare_items(); + $list_table->views(); + $list_table->search_box( __( 'Search activation', 'wc-serial-numbers' ), 'activation' ); + $list_table->display(); + ?> + +
    +
    +current_action(); +$list_table->process_bulk_actions( $doaction ); +?> + +
    +

    + +

    + + + + + + + + + + + + + + + + +
    + +
    + prepare_items(); + $list_table->views(); + $list_table->search_box( __( 'Search key', 'wc-serial-numbers' ), 'key' ); + $list_table->display(); + ?> + + +
    +
    + diff --git a/trunk/src/Admin/views/html-list-stock.php b/trunk/src/Admin/views/html-list-stock.php new file mode 100644 index 00000000..9b7cd740 --- /dev/null +++ b/trunk/src/Admin/views/html-list-stock.php @@ -0,0 +1,21 @@ + + +
    + prepare_items(); + $list_table->views(); + $list_table->search_box( __( 'Search', 'wc-serial-numbers' ), 'key' ); + $list_table->display(); + ?> + + +
    diff --git a/trunk/src/Admin/views/html-reports.php b/trunk/src/Admin/views/html-reports.php new file mode 100644 index 00000000..23365141 --- /dev/null +++ b/trunk/src/Admin/views/html-reports.php @@ -0,0 +1,25 @@ + +
    + + + +
    +
    + +
    +
    diff --git a/trunk/src/Admin/views/html-tools.php b/trunk/src/Admin/views/html-tools.php new file mode 100644 index 00000000..fe4d7704 --- /dev/null +++ b/trunk/src/Admin/views/html-tools.php @@ -0,0 +1,25 @@ + +
    + + + +
    +
    + +
    +
    diff --git a/trunk/src/Ajax.php b/trunk/src/Ajax.php new file mode 100644 index 00000000..a23e2e18 --- /dev/null +++ b/trunk/src/Ajax.php @@ -0,0 +1,233 @@ + esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) ); + wp_die(); + } + + $search = isset( $_REQUEST['search'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['search'] ) ) : ''; + $page = isset( $_REQUEST['page'] ) ? absint( $_REQUEST['page'] ) : 1; + $per_page = absint( 100 ); + $args = array_merge( + wcsn_get_products_query_args(), + array( + 'posts_per_page' => $per_page, + 's' => $search, + 'fields' => 'ids', + ) + ); + $the_query = new \WP_Query( $args ); + $product_ids = $the_query->get_posts(); + $results = array(); + foreach ( $product_ids as $product_id ) { + $product = wc_get_product( $product_id ); + + if ( ! $product ) { + continue; + } + + $text = sprintf( + '(#%1$s) %2$s', + $product->get_id(), + wp_strip_all_tags( $product->get_formatted_name() ) + ); + + $results[] = array( + 'id' => $product->get_id(), + 'text' => $text, + ); + } + $more = false; + if ( $the_query->found_posts > ( $per_page * $page ) ) { + $more = true; + } + wp_send_json( + array( + 'page' => $page, + 'results' => $results, + 'pagination' => array( + 'more' => $more, + ), + ) + ); + wp_die(); + } + + /** + * Search orders. + * + * @since 1.3.1 + * @return void + */ + public static function search_orders() { + check_ajax_referer( 'wc_serial_numbers_search_nonce', 'nonce' ); + + // Must have WC Serial Numbers manager role to access this endpoint. + if ( ! current_user_can( wcsn_get_manager_role() ) ) { + wp_send_json_error( array( 'message' => esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) ); + wp_die(); + } + + $search = isset( $_REQUEST['search'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['search'] ) ) : ''; + $page = isset( $_REQUEST['page'] ) ? absint( $_REQUEST['page'] ) : 1; + $per_page = absint( 100 ); + + $ids = array(); + if ( is_numeric( $search ) ) { + $order = wc_get_order( intval( $search ) ); + + // Order does exist. + if ( $order && 0 !== $order->get_id() ) { + $ids[] = $order->get_id(); + } + } + + if ( empty( $ids ) && ! is_numeric( $search ) ) { + $data_store = \WC_Data_Store::load( 'order' ); + if ( 3 > strlen( $search ) ) { + $per_page = 20; + } + $ids = $data_store->search_orders( + $search, + array( + 'limit' => $per_page, + 'page' => $page, + ) + ); + } + + $results = array(); + foreach ( $ids as $order_id ) { + $order = wc_get_order( $order_id ); + + if ( ! $order ) { + continue; + } + + $text = sprintf( + '(#%1$s) %2$s', + $order->get_id(), + wp_strip_all_tags( $order->get_formatted_billing_full_name() ) + ); + + $results[] = array( + 'id' => $order->get_id(), + 'text' => $text, + ); + } + + wp_send_json( + array( + 'page' => $page, + 'results' => $results, + 'pagination' => array( + 'more' => false, + ), + ) + ); + wp_die(); + } + + /** + * Search customers. + * + * @since 1.3.1 + * @return void + */ + public static function search_customers() { + check_ajax_referer( 'wc_serial_numbers_search_nonce', 'nonce' ); + + // Must have WC Serial Numbers manager role to access this endpoint. + if ( ! current_user_can( wcsn_get_manager_role() ) ) { + wp_send_json_error( array( 'message' => esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) ); + wp_die(); + } + + $search = isset( $_REQUEST['search'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['search'] ) ) : ''; + $page = isset( $_REQUEST['page'] ) ? absint( $_REQUEST['page'] ) : 1; + $per_page = absint( 100 ); + + $ids = array(); + // Search by ID. + if ( is_numeric( $search ) ) { + $customer = new \WC_Customer( intval( $search ) ); + + // Customer does not exists. + if ( $customer && 0 !== $customer->get_id() ) { + $ids = array( $customer->get_id() ); + } + } + + // Usernames can be numeric so we first check that no users was found by ID before searching for numeric username, this prevents performance issues with ID lookups. + if ( empty( $ids ) ) { + $data_store = \WC_Data_Store::load( 'customer' ); + + // If search is smaller than 3 characters, limit result set to avoid + // too many rows being returned. + if ( 3 > strlen( $search ) ) { + $per_page = 20; + } + $ids = $data_store->search_customers( $search, $per_page ); + } + + $results = array(); + foreach ( $ids as $id ) { + $customer = new \WC_Customer( $id ); + $text = sprintf( + /* translators: $1: customer name, $2 customer id, $3: customer email */ + esc_html__( '%1$s (#%2$s - %3$s)', 'wc-serial-numbers' ), + $customer->get_first_name() . ' ' . $customer->get_last_name(), + $customer->get_id(), + $customer->get_email() + ); + + $results[] = array( + 'id' => $id, + 'text' => $text, + ); + } + + wp_send_json( + array( + 'page' => $page, + 'results' => $results, + 'pagination' => array( + 'more' => false, + ), + ) + ); + } +} diff --git a/trunk/src/Cache.php b/trunk/src/Cache.php new file mode 100644 index 00000000..5321afdd --- /dev/null +++ b/trunk/src/Cache.php @@ -0,0 +1,37 @@ + + + query( "update {$wpdb->prefix}serial_numbers set status='expired' where validity !='0' AND (order_date + INTERVAL validity DAY ) < NOW()" ); + } + + /** + * Send low stock email notification. + * + * @since 1.2.0 + * @return bool + */ + public static function send_stock_alert_email() { + if ( 'yes' !== get_option( 'wc_serial_numbers_enable_stock_notification' ) ) { + return false; + } + + $stock_threshold = get_option( 'wc_serial_numbers_stock_threshold', 5 ); + $to = get_option( 'wc_serial_numbers_notification_recipient', get_option( 'admin_email' ) ); + if ( empty( $to ) ) { + return false; + } + + $low_stock_products = wcsn_get_stocks_count( $stock_threshold ); + if ( empty( $low_stock_products ) ) { + return false; + } + + $subject = __( 'Serial Numbers stock running low', 'wc-serial-numbers' ); + /** $woocommerce WooCommerce */ + global $woocommerce; + $mailer = $woocommerce->mailer(); + + ob_start(); + wcsn_get_template( 'email-stock-notification.php', array( 'low_stock_products' => $low_stock_products ) ); + $message = ob_get_contents(); + ob_get_clean(); + + $message = $mailer->wrap_message( $subject, $message ); + $headers = apply_filters( 'woocommerce_email_headers', '', 'wc_serial_numbers_low_stock_notification', $mailer ); + $mailer->send( $to, $subject, $message, $headers, array() ); + + exit(); + } +} diff --git a/trunk/src/Deprecated/Functions.php b/trunk/src/Deprecated/Functions.php new file mode 100644 index 00000000..9d1317cf --- /dev/null +++ b/trunk/src/Deprecated/Functions.php @@ -0,0 +1,440 @@ +set_status( $status ); + + return $key->save(); +} + +/** + * Delete serial number. + * + * @param $id + * + * @since 1.2.0 + * @return bool + * @deprecated 1.4.6 + */ +function wc_serial_numbers_delete_serial_number( $id ) { + wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_delete_key' ); + + return wcsn_delete_key( $id ); +} + +/** + * @param $id + * + * @since 1.2.0 + * @return mixed + * @deprecated 1.4.6 + */ +function wc_serial_numbers_get_serial_number( $id ) { + wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_get_key' ); + + return wcsn_get_key( $id ); +} + +/** + * Get activation + * + * @param $args + * + * @since 1.2.0 + * @deprecated 1.4.6 + */ +function wc_serial_numbers_get_activation( $activation_id ) { + wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_get_activation' ); + + return wcsn_get_activation( $activation_id ); +} + +/** + * @param $args + * + * @since 1.2.0 + * @return int|WP_Error + * @deprecated 1.4.6 + */ +function wc_serial_numbers_insert_activation( $args ) { + wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_insert_activation' ); + + return wcsn_insert_activation( $args ); +} + +/** + * @param $args + * + * @since 1.2.0 + * @return int|WP_Error + * @deprecated 1.4.6 + */ +function wc_serial_numbers_update_activation( $args ) { + wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_insert_activation' ); + + return wcsn_insert_activation( $args ); +} + +/** + * @param $id + * + * @since 1.2.0 + * @return bool + * @deprecated 1.4.6 + */ +function wc_serial_numbers_delete_activation( $id ) { + wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_delete_activation' ); + + return wcsn_delete_activation( $id ); +} + +/** + * @param $id + * @param int $status + * + * @since 1.2.0 + * @return int|WP_Error + * @deprecated 1.4.6 + */ +function wc_serial_numbers_update_activation_status( $id, $status = 1 ) { + // Do nothing. +} + +/** + * Encrypt serial number. + * + * @param string $key Serial number. + * + * @since 1.2.0 + * @return false|string + * @deprecated 1.4.6 + */ +function wc_serial_numbers_encrypt_key( $key ) { + return wcsn_encrypt_key( $key ); +} + +/** + * Decrypt number. + * + * @param string $key Serial number. + * + * @since 1.2.0 + * @return false|string + * @deprecated 1.4.6 + */ +function wc_serial_numbers_decrypt_key( $key ) { + return wcsn_decrypt_key( $key ); +} + +/** + * Get Low stock products. + * + * @param int $stock + * + * @since 1.0.0 + * @return array + * @deprecated 1.4.6 + */ +function wc_serial_numbers_get_low_stock_products( $force = false, $stock = 10 ) { + return wcsn_get_stocks_count( $stock, $force ); +} + +/** + * Check if software disabled. + * + * @since 1.2.0 + * @return bool + * @deprecated 1.4.6 + */ +function wc_serial_numbers_software_support_disabled() { + return ! wcsn_is_software_support_enabled(); +} + +/** + * Get refund statuses. + * + * @since 1.2.0 + * @return array|bool|mixed + * @deprecated 1.4.6 + */ +function wc_serial_numbers_get_revoke_statuses() { + return wcsn_get_revoke_statuses(); +} + +/** + * Get serial number user role. + * + * @since 1.2.0 + * @return mixed|void + * @deprecated 1.4.6 + */ +function wc_serial_numbers_get_user_role() { + return wcsn_get_manager_role(); +} + +/** + * Get key sources. + * + * @since 1.2.0 + * @return mixed|void + * @deprecated 1.4.6 + */ +function wc_serial_numbers_get_key_sources() { + return wcsn_get_key_sources(); +} + +/** + * Check if order contains serial numbers. + * + * @param $order + * + * @since 1.2.0 + * @return bool|int + * @deprecated 1.4.6 + */ +function wc_serial_numbers_order_has_serial_numbers( $order ) { + return wcsn_order_has_products( $order ); +} + +/** + * Serial number order table get columns. + * + * @since 1.2.0 + * @return mixed|void + */ +function wc_serial_numbers_get_order_table_columns() { + $columns = array( + 'product' => __( 'Product', 'wc-serial-numbers' ), + 'serial_key' => __( 'Serial Number', 'wc-serial-numbers' ), + 'activation_email' => __( 'Email', 'wc-serial-numbers' ), + 'activation_limit' => __( 'Activation Limit', 'wc-serial-numbers' ), + 'expire_date' => __( 'Expires', 'wc-serial-numbers' ), + ); + + return apply_filters( 'wc_serial_numbers_order_table_columns', $columns ); +} + +/** + * Get product stock + * + * @param $product_id + * + * @since 1.2.0 + * @return int + * @deprecated 1.4.6 + */ +function wc_serial_numbers_get_stock_quantity( $product_id ) { + $source = get_post_meta( $product_id, '_serial_key_source', true ); + if ( 'custom_source' == get_post_meta( $product_id, '_serial_key_source', true ) || empty( $source ) ) { + $stocks = wcsn_get_stocks_count(); + if ( isset( $stocks[ $product_id ] ) ) { + return absint( $stocks[ $product_id ] ); + } + + return 0; + } + + return 9999; +} + +/** + * Get order table. + * + * @param bool $return + * + * @param $order + * + * @since 1.2.0 + * + * @return false|string|void + */ +function wc_serial_numbers_get_order_table( $order, $return = false ) { + wcsn_display_order_keys( $order, $return ); +} + +/** + * Control software related columns + * + * @param $columns + * + * @since 1.2.0 + * @return mixed + */ +function wc_serial_numbers_control_order_table_columns( $columns ) { + if ( wc_serial_numbers_software_support_disabled() ) { + $software_columns = array( 'activation_email', 'activation_limit', 'expire_date' ); + foreach ( $columns as $key => $label ) { + if ( in_array( $key, $software_columns ) ) { + unset( $columns[ $key ] ); + } + } + } + + return $columns; +} + +add_filter( 'wc_serial_numbers_order_table_columns', 'wc_serial_numbers_control_order_table_columns', 99 ); + + +/** + * Sanitize boolean + * + * @param $string + * + * @since 1.2.0 + * @return mixed + */ +function wc_serial_numbers_validate_boolean( $string ) { + return filter_var( $string, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE ); +} diff --git a/trunk/src/Encryption.php b/trunk/src/Encryption.php new file mode 100644 index 00000000..94c253b1 --- /dev/null +++ b/trunk/src/Encryption.php @@ -0,0 +1,220 @@ +services['frontend/my-account'] = new MyAccount(); + * + * @since 1.5.6 + * @return void + */ + public function init() { + WCSN()->services['frontend/shortcodes'] = new Shortcodes(); + } + + /** + * Enqueue frontend scripts. + * + * @since 1.5.6 + * @return void + */ + public function enqueue_scripts() { + WCSN()->enqueue_style( 'wc-serial-numbers-frontend', 'css/frontend-style.css' ); + WCSN()->enqueue_script( 'wc-serial-numbers-frontend', 'js/frontend-script.js', array( 'jquery' ) ); + wp_localize_script( + 'wc-serial-numbers-frontend', + 'wc_serial_numbers_frontend_vars', + array( + 'ajax_url' => admin_url( 'admin-ajax.php' ), + 'i18n' => array( + 'copied' => __( 'Copied', 'wc-serial-numbers' ), + 'loading' => __( 'Loading', 'wc-serial-numbers' ), + ), + ) + ); + } +} diff --git a/trunk/src/Frontend/Shortcodes.php b/trunk/src/Frontend/Shortcodes.php new file mode 100644 index 00000000..2dcb10c5 --- /dev/null +++ b/trunk/src/Frontend/Shortcodes.php @@ -0,0 +1,315 @@ + 0, + 'email_field' => 'yes', + 'title' => __( 'Serial Key Validation', 'wc-serial-numbers' ), + 'product_field_label' => __( 'Product', 'wc-serial-numbers' ), + 'key_field_label' => __( 'Serial Key', 'wc-serial-numbers' ), + 'key_field_placeholder' => __( 'Enter your serial key', 'wc-serial-numbers' ), + 'email_field_label' => __( 'Email', 'wc-serial-numbers' ), + 'email_field_placeholder' => __( 'Enter your email', 'wc-serial-numbers' ), + 'button_label' => __( 'Validate', 'wc-serial-numbers' ), + ), + $atts, + 'wc_serial_numbers_validation_form' + ); + + // If product ID is not set, get all enabled products and make a dropdown. + $products = array(); + if ( empty( $atts['product_id'] ) ) { + $args = array_merge( + wcsn_get_products_query_args(), + array( + 'posts_per_page' => - 1, + 'fields' => 'ids', + ) + ); + $the_query = new \WP_Query( $args ); + $product_ids = $the_query->get_posts(); + foreach ( $product_ids as $product_id ) { + $product = wc_get_product( $product_id ); + if ( ! $product ) { + continue; + } + $products[ $product->get_id() ] = $product->get_name(); + } + } + + ob_start(); + + // If product ID is not set and no products found, return with error message. + if ( empty( $atts['product_id'] ) && empty( $products ) ) { + return '

    ' . __( 'No products found.', 'wc-serial-numbers' ) . '

    '; + } + + ?> +
    + +

    + + + + +

    + + +

    + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + +
    + 0, + 'action' => '', + 'email_field' => 'yes', + 'platform_field' => 'yes', + 'title' => __( 'Activate/Deactivate Serial Key', 'wc-serial-numbers' ), + 'product_field_label' => __( 'Product', 'wc-serial-numbers' ), + 'key_field_label' => __( 'Serial Key', 'wc-serial-numbers' ), + 'key_field_placeholder' => __( 'Enter your serial key', 'wc-serial-numbers' ), + 'email_field_label' => __( 'Email', 'wc-serial-numbers' ), + 'email_field_placeholder' => __( 'Enter your email', 'wc-serial-numbers' ), + 'instance_field_label' => __( 'Instance', 'wc-serial-numbers' ), + 'instance_field_placeholder' => __( 'Enter your instance', 'wc-serial-numbers' ), + 'platform_field_label' => __( 'Platform', 'wc-serial-numbers' ), + 'platform_field_placeholder' => __( 'Enter platform', 'wc-serial-numbers' ), + 'action_field_label' => __( 'Action', 'wc-serial-numbers' ), + 'button_label' => __( 'Submit', 'wc-serial-numbers' ), + ), + $atts, + 'wc_serial_numbers_activation_form' + ); + $actions = array( + 'activate' => esc_html__( 'Activate', 'wc-serial-numbers' ), + 'deactivate' => esc_html__( 'Deactivate', 'wc-serial-numbers' ), + ); + $products = array(); + if ( empty( $atts['product_id'] ) ) { + $args = array_merge( + wcsn_get_products_query_args(), + array( + 'posts_per_page' => - 1, + 'fields' => 'ids', + 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query + array( + 'key' => '_is_serial_number', + 'value' => 'yes', + 'compare' => '=', + ), + ), + ) + ); + $the_query = new \WP_Query( $args ); + $product_ids = $the_query->get_posts(); + foreach ( $product_ids as $product_id ) { + $product = wc_get_product( $product_id ); + if ( ! $product ) { + continue; + } + $products[ $product->get_id() ] = $product->get_name(); + } + } + + ob_start(); + + // If product ID is not set and no products found, return with error message. + if ( empty( $atts['product_id'] ) && empty( $products ) ) { + return esc_html__( 'Could not find any products with serial numbers enabled.', 'wc-serial-numbers' ); + } + ?> +
    + +

    + + + + + +

    + + +

    + +

    + + +

    + + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + + + + +

    + + +

    + + +

    + +

    + + +
    + __( 'Invalid request.', 'wc-serial-numbers' ) ) ); + } + + // perform a rest api request internally. + wp_send_json( $this->rest_api_request( 'validate', $_POST ) ); + } + + /** + * Activate serial key. + * + * @since 1.0.0 + * + * @return void + */ + public function activate_serial_key() { + if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['_wpnonce'] ), 'wcsn_user_action' ) ) { + wp_send_json_error( array( 'message' => __( 'Invalid request.', 'wc-serial-numbers' ) ) ); + } + + $request = isset( $_POST['request'] ) ? sanitize_text_field( wp_unslash( $_POST['request'] ) ) : 'activate'; + + // perform a rest api request internally. + wp_send_json( $this->rest_api_request( $request, $_POST ) ); + } + + /** + * Perform a rest API request. + * + * @param string $route The route to request. + * @param array $params The request parameters. + * + * @since 1.0.0 + * @return array + */ + public function rest_api_request( $route, $params ) { + $namespace = '/wcsn/'; + $endpoint = wp_normalize_path( $namespace . '/' . $route ); + $request = new \WP_REST_Request( 'GET', $endpoint ); + $request->set_query_params( $params ); + $response = rest_do_request( $request ); + $server = rest_get_server(); + $json = $server->response_to_data( $response, false ); + + return $json; + } +} diff --git a/trunk/src/Functions/Template.php b/trunk/src/Functions/Template.php new file mode 100644 index 00000000..87831583 --- /dev/null +++ b/trunk/src/Functions/Template.php @@ -0,0 +1,312 @@ +get_template_path() ); +} + +/** + * output key properties. + * + * @param Key $key Key object. + * @param bool $output Echo or return. + * + * @since 1.4.9 + * @return void|string Return html if $output is false. + */ +function wcsn_display_key_html( $key, $output = true ) { + $text_align = is_rtl() ? 'right' : 'left'; + $margin_side = is_rtl() ? 'left' : 'right'; + + $properties = array( + 'key' => array( + 'label' => __( 'Key', 'wc-serial-numbers' ), + 'value' => '' . $key->get_key() . '', + 'priority' => 10, + ), + 'activation_email' => array( + 'label' => __( 'Activation Email', 'wc-serial-numbers' ), + 'value' => $key->get_customer_email(), + 'priority' => 20, + ), + 'activation_limit' => array( + 'label' => __( 'Activation Limit', 'wc-serial-numbers' ), + 'value' => ! empty( $key->get_activation_limit() ) ? number_format_i18n( $key->get_activation_limit() ) : __( 'None', 'wc-serial-numbers' ), + 'priority' => 30, + ), + 'activation_count' => array( + 'label' => __( 'Activation Count', 'wc-serial-numbers' ), + 'value' => ! empty( $key->get_activation_count() ) ? number_format_i18n( $key->get_activation_count() ) : __( 'None', 'wc-serial-numbers' ), + 'priority' => 40, + ), + 'expire_date' => array( + 'label' => __( 'Expire Date', 'wc-serial-numbers' ), + 'value' => ! empty( $key->get_expire_date() ) ? $key->get_expire_date() : __( 'Lifetime', 'wc-serial-numbers' ), + 'priority' => 50, + ), + ); + + $status = $key->get_status(); + if ( 'sold' === $status ) { + $status = '' . __( 'Active', 'wc-serial-numbers' ) . ''; + } elseif ( 'expired' === $status ) { + $status = '' . __( 'Expired', 'wc-serial-numbers' ) . ''; + } else { + $status = ' '; + } + + $properties['status'] = array( + 'label' => __( 'Status', 'wc-serial-numbers' ), + 'value' => $status, + 'priority' => 60, + ); + + /** + * Filter key properties. + * + * @param array $props Key properties. + * @param Key $key Key object. + * + * @since 1.4.9 + */ + $properties = apply_filters( 'wc_serial_numbers_display_key_props', $properties, $key ); + + usort( + $properties, + function ( $a, $b ) { + return $a['priority'] - $b['priority']; + } + ); + + ob_start(); + + ?> +
      + $prop_data ) : ?> +
    • + + : + + +
    • + + +
    + get_id() ); + if ( empty( $line_items ) ) { + return; + } + + ?> +
    + + + + + + + +
    + ' . esc_html( $title ) . ''; +} + + +/** + * Display order keys table. + * + * @param \WC_Order $order The order object. + * @param array $line_items The line items data. + * + * @since 1.4.6 + * @return void + */ +function wcsn_display_order_keys_table( $order, $line_items ) { + foreach ( $line_items as $line_item ) { + /** + * Filters the query arguments for getting keys. + * + * @param array $args The query arguments. + * @param \WC_Order $order The order object. + * @param array $line_item The line item data. + * + * @since 1.4.6 + */ + $args = apply_filters( + 'wc_serial_numbers_display_order_keys_table_query_args', + array( + 'order_id' => $order->get_id(), + 'product_id' => $line_item['product_id'], + 'status__in' => array( 'sold', 'expired' ), + 'limit' => - 1, + ) + ); + + $keys = wcsn_get_keys( $args ); + ?> + + + + + + + + + + + + + + + + + + +
    %s', esc_url( get_permalink( $line_item['product_id'] ) ), esc_html( get_the_title( $line_item['product_id'] ) ) ); ?> +
    + + + + + +
    %s

    ', esc_html( apply_filters( 'wc_serial_numbers_pending_notice', __( 'Order is waiting for serial numbers to be assigned.', 'wc-serial-numbers' ) ) ) ); ?>
    + 'update_112', + '1.2.0' => 'update_120', + '1.2.1' => 'update_121', + '1.4.6' => 'update_146', + '1.5.6' => 'update_156', + ); + + /** + * Installer constructor. + * + * @since 1.4.2 + */ + public function __construct() { + add_filter( 'cron_schedules', array( __CLASS__, 'custom_cron_schedules' ), 20 ); // phpcs:ignore WordPress.WP.CronInterval.CronSchedulesInterval + add_action( 'init', array( $this, 'check_update' ), 0 ); + } + + /** + * Add custom cron schedule + * + * @param array $schedules list of cron schedules. + * + * @since 1.0.0 + * @return array + */ + public static function custom_cron_schedules( $schedules ) { + $schedules ['once_a_minute'] = array( + 'interval' => 60, + 'display' => esc_html__( 'Once a Minute', 'wc-serial-numbers' ), + ); + + return $schedules; + } + + /** + * Check the plugin version and run the updater if necessary. + * + * This check is done on all requests and runs if the versions do not match. + * + * @since 1.4.2 + * @return void + */ + public function check_update() { + $db_version = WCSN()->get_db_version(); + $current_version = WCSN()->get_version(); + $requires_update = version_compare( $db_version, $current_version, '<' ); + $can_install = ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && ! defined( 'IFRAME_REQUEST' ); + if ( $can_install && $requires_update ) { + static::install(); + + $update_versions = array_keys( $this->updates ); + usort( $update_versions, 'version_compare' ); + if ( ! is_null( $db_version ) && version_compare( $db_version, end( $update_versions ), '<' ) ) { + $this->update(); + } else { + WCSN()->update_db_version( $current_version ); + } + } + } + + /** + * Update the plugin. + * + * @since 1.4.2 + * @return void + */ + public function update() { + $db_version = WCSN()->get_db_version(); + foreach ( $this->updates as $version => $callbacks ) { + $callbacks = (array) $callbacks; + if ( version_compare( $db_version, $version, '<' ) ) { + foreach ( $callbacks as $callback ) { + WCSN()->log( sprintf( 'Updating to %s from %s', $version, $db_version ) ); + // if the callback return false then we need to update the db version. + $continue = call_user_func( array( $this, $callback ) ); + if ( ! $continue ) { + WCSN()->update_db_version( $version ); + $notice = sprintf( + /* translators: 1: plugin name 2: version number */ + __( '%1$s updated to version %2$s successfully.', 'wc-serial-numbers' ), + 'Serial Numbers for WooCommerce', + '' . $version . '' + ); + WCSN()->add_notice( $notice, 'success' ); + } + } + } + } + } + + /** + * Install the plugin. + * + * @since 1.4.2 + * @return void + */ + public static function install() { + if ( ! is_blog_installed() ) { + return; + } + + self::create_tables(); + self::create_cron_jobs(); + Admin\Settings::instance()->save_defaults(); + WCSN()->update_db_version( WCSN()->get_version(), false ); + add_option( 'wc_serial_numbers_install_date', current_time( 'mysql' ) ); + set_transient( 'wc_serial_numbers_activated', true, 30 ); + set_transient( 'wc_serial_numbers_activation_redirect', true, 30 ); + } + + /** + * Create tables. + * + * @return void + */ + public static function create_tables() { + global $wpdb; + $wpdb->hide_errors(); + // todo rename table names to wcsn_keys and wcsn_activations. + $tables = array( + "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}serial_numbers( + id bigint(20) NOT NULL AUTO_INCREMENT, + serial_key longtext DEFAULT NULL, + product_id bigint(20) NOT NULL, + activation_limit int(9) NOT NULL DEFAULT 0, + activation_count int(9) NOT NULL DEFAULT 0, + order_id bigint(20) DEFAULT NULL, + order_item_id bigint(20) DEFAULT NULL, + vendor_id bigint(20) DEFAULT NULL, + status varchar(50) DEFAULT 'available', + validity varchar(200) DEFAULT NULL, + expire_date DATETIME NULL DEFAULT NULL, + order_date DATETIME NULL DEFAULT NULL, + uuid varchar(50) DEFAULT NULL, + source varchar(50) DEFAULT 'custom_source', + created_date DATETIME NULL DEFAULT NULL, + PRIMARY KEY (id), + key product_id (product_id), + key order_id (order_id), + key vendor_id (vendor_id), + key activation_limit (activation_limit), + KEY order_item_id (order_item_id), + UNIQUE KEY uuid (uuid), + key status (status) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ", + "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}serial_numbers_activations( + id bigint(20) NOT NULL auto_increment, + serial_id bigint(20) NOT NULL, + instance varchar(200) NOT NULL, + platform varchar(200) DEFAULT NULL, + activation_time DATETIME NULL DEFAULT NULL, + PRIMARY KEY (id), + key serial_id (serial_id) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8;", + ); + + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; + foreach ( $tables as $table ) { + dbDelta( $table ); + } + } + + /** + * Create cron jobs (clear them first). + * + * @since 1.0.0 + * @return void + */ + public static function create_cron_jobs() { + // setup transient actions. + if ( false === wp_next_scheduled( 'wc_serial_numbers_hourly_event' ) ) { + wp_schedule_event( time(), 'hourly', 'wc_serial_numbers_hourly_event' ); + } + + if ( false === wp_next_scheduled( 'wc_serial_numbers_daily_event' ) ) { + wp_schedule_event( time(), 'daily', 'wc_serial_numbers_daily_event' ); + } + } + + /** + * Update to version 1.1.2 + * + * @since 1.1.2 + * @return void + */ + protected function update_112() { + global $wpdb; + $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers ADD KEY product_id(`product_id`)" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers ADD KEY order_id (`order_id`)" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers ADD KEY status (`status`)" ); + + $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers CHANGE expire_date expire_date DATETIME DEFAULT NULL" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers CHANGE order_date order_date DATETIME DEFAULT NULL" ); + $wpdb->query( "UPDATE {$wpdb->prefix}wcsn_serial_numbers set expire_date=NULL WHERE expire_date='0000-00-00 00:00:00'" ); + $wpdb->query( "UPDATE {$wpdb->prefix}wcsn_serial_numbers set order_date=NULL WHERE order_date='0000-00-00 00:00:00'" ); + + $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_activations ADD KEY serial_id (`serial_id`)" ); + } + + /** + * Update to version 1.2.0 + * + * @since 1.2.0 + * @return void + */ + protected function update_120() { + wp_clear_scheduled_hook( 'wcsn_per_minute_event' ); + wp_clear_scheduled_hook( 'wcsn_daily_event' ); + wp_clear_scheduled_hook( 'wcsn_hourly_event' ); + + if ( ! wp_next_scheduled( 'wc_serial_numbers_hourly_event' ) ) { + wp_schedule_event( time(), 'hourly', 'wc_serial_numbers_hourly_event' ); + } + + if ( ! wp_next_scheduled( 'wc_serial_numbers_daily_event' ) ) { + wp_schedule_event( time(), 'daily', 'wc_serial_numbers_daily_event' ); + } + + global $wpdb; + $wpdb->query( "RENAME TABLE `{$wpdb->prefix}wcsn_serial_numbers` TO `{$wpdb->prefix}serial_numbers`" ); + $wpdb->query( "RENAME TABLE `{$wpdb->prefix}wcsn_activations` TO `{$wpdb->prefix}serial_numbers_activations`" ); + + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers DROP COLUMN `serial_image`;" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers DROP COLUMN `activation_email`;" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers CHANGE `created` `created_date` DATETIME NULL DEFAULT NULL;" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD vendor_id bigint(20) NOT NULL DEFAULT 0" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD activation_count int(9) NOT NULL DEFAULT 0" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD KEY vendor_id(`vendor_id`)" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD source varchar(200) NOT NULL default 'custom_source'" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers_activations CHANGE platform platform varchar(200) DEFAULT NULL" ); + // status update. + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set status=%s WHERE status=%s AND order_id=0", 'available', 'new' ) ); + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set status=%s WHERE status=%s AND order_id != 0", 'sold', 'active' ) ); + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set status=%s WHERE status=%s", 'cancelled', 'pending' ) ); + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set status=%s WHERE status=%s", 'cancelled', 'rejected' ) ); + global $current_user; + if ( ! empty( $current_user->ID ) && current_user_can( 'manage_options' ) ) { + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set vendor_id=%d", $current_user->ID ) ); + } + + $activations = $wpdb->get_results( "select serial_id, count(id) as active_count from {$wpdb->prefix}serial_numbers_activations where active='1' GROUP BY serial_id" ); + foreach ( $activations as $activation ) { + global $wpdb; + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers SET activation_count = %d WHERE id=%d", intval( $activation->active_count ), intval( $activation->serial_id ) ) ); + } + + $wpdb->query( "UPDATE {$wpdb->prefix}serial_numbers set status='available', order_date='0000-00-00 00:00:00', order_id='0' WHERE status !='available' AND order_id='0' AND expire_date='0000-00-00 00:00:00'" ); + + // settings update. + $heading_text = $this->update_1_2_0_get_option( 'heading_text', 'Serial Numbers', 'wsn_delivery_settings' ); + $serial_col_heading = $this->update_1_2_0_get_option( 'table_column_heading', 'Serial Number', 'wsn_delivery_settings' ); + $serial_key_label = $this->update_1_2_0_get_option( 'serial_key_label', 'Serial Number', 'wsn_delivery_settings' ); + $serial_email_label = $this->update_1_2_0_get_option( 'serial_email_label', 'Activation Email', 'wsn_delivery_settings' ); + $show_validity = 'yes' === $this->update_1_2_0_get_option( 'show_validity', 'yes', 'wsn_delivery_settings' ); + $show_activation_limit = 'yes' === $this->update_1_2_0_get_option( 'show_activation_limit', 'yes', 'wsn_delivery_settings' ); + $license = get_option( 'woocommerce_serial_numbers_pro_pluginever_license' ); + $options = array( + 'wc_serial_numbers_autocomplete_order' => $this->update_1_2_0_get_option( 'wsn_auto_complete_order', 'yes', 'wsn_delivery_settings' ), + 'wc_serial_numbers_reuse_serial_number' => $this->update_1_2_0_get_option( 'wsn_re_use_serial', 'no', 'wsn_delivery_settings' ), + 'wc_serial_numbers_disable_software_support' => 'no', + 'wc_serial_numbers_manual_delivery' => 'no', + 'wc_serial_numbers_hide_serial_number' => 'yes', + 'wc_serial_numbers_revoke_status_cancelled' => in_array( 'cancelled', $this->update_1_2_0_get_option( 'wsn_revoke_serial_number', array(), 'wsn_delivery_settings' ), true ) ? 'yes' : 'no', + 'wc_serial_numbers_revoke_status_refunded' => in_array( 'refunded', $this->update_1_2_0_get_option( 'wsn_revoke_serial_number', array(), 'wsn_delivery_settings' ), true ) ? 'yes' : 'no', + 'wc_serial_numbers_revoke_status_failed' => in_array( 'failed', $this->update_1_2_0_get_option( 'wsn_revoke_serial_number', array(), 'wsn_delivery_settings' ), true ) ? 'yes' : 'no', + 'wc_serial_numbers_enable_stock_notification' => $this->update_1_2_0_get_option( 'wsn_admin_bar_notification_send_email', 'yes', 'wsn_notification_settings' ), + 'wc_serial_numbers_stock_threshold' => $this->update_1_2_0_get_option( 'wsn_admin_bar_notification_number', '5', 'wsn_notification_settings' ), + 'wc_serial_numbers_notification_recipient' => $this->update_1_2_0_get_option( 'wsn_admin_bar_notification_email', get_option( 'admin_email' ), 'wsn_notification_settings' ), + 'wc_serial_numbers_order_table_heading' => $heading_text, + 'wc_serial_numbers_order_table_col_product_label' => 'Product', + 'wc_serial_numbers_order_table_col_key_label' => $serial_key_label, + 'wc_serial_numbers_order_table_col_email_label' => $serial_email_label, + 'wc_serial_numbers_order_table_col_limit_label' => 'Activation Limit', + 'wc_serial_numbers_order_table_col_expires_label' => 'Expire Date', + 'wc_serial_numbers_order_table_col_product' => 'yes', + 'wc_serial_numbers_order_table_col_key' => 'yes', + 'wc_serial_numbers_order_table_col_email' => 'no', + 'wc_serial_numbers_order_table_col_limit' => $show_activation_limit ? 'yes' : 'no', + 'wc_serial_numbers_order_table_col_expires' => $show_validity ? 'yes' : 'no', + 'wc_serial_numbers_install_time' => get_option( 'woocommerceserialnumbers_install_time' ), + 'woocommerce-serial-numbers-pro_license_key' => array_key_exists( 'key', $license ) ? $license['key'] : '', + 'woocommerce-serial-numbers-pro_license_status' => array_key_exists( 'license', $license ) ? $license['license'] : '', + ); + foreach ( $options as $key => $option ) { + add_option( $key, $option ); + } + } + + /** + * Get option from old settings. + * + * @param string $option_name Option name. + * @param string $default_value Default value. + * @param string $section Section name. + * + * @return string + */ + protected function update_1_2_0_get_option( $option_name, $default_value, $section = 'serial_numbers_settings' ) { + $settings = get_option( $section, array() ); + + return ! empty( $settings[ $option_name ] ) ? $settings[ $option_name ] : $default_value; + } + + /** + * Update to version 1.2.1 + * + * @since 1.2.1 + * @return void + */ + protected function update_121() { + global $wpdb; + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers CHANGE order_id order_id bigint(20) DEFAULT NULL" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers CHANGE vendor_id vendor_id bigint(20) DEFAULT NULL" ); + } + + /** + * Update to version 1.4.6 + * + * @since 1.4.6 + * @return void + */ + protected function update_146() { + global $wpdb; + // Update key status default value to 'available'. + // Change key status. + // Drop expired column. + $statuses_map = array( + 'refunded' => 'cancelled', + 'expired' => 'expired', + 'failed' => 'cancelled', + 'inactive' => 'sold', + ); + + foreach ( $statuses_map as $old_status => $new_status ) { + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers SET status = %s WHERE status = %s", $new_status, $old_status ) ); + } + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers DROP expire_date" ); + + // Remove all inactive activations. + $wpdb->query( "DELETE FROM {$wpdb->prefix}serial_numbers_activations WHERE active = 0" ); + // Drop active column. + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers_activations DROP active" ); + } + + /** + * Update to version 1.5.6 + * + * @since 1.5.6 + */ + protected function update_156() { + global $wpdb; + // if order_item_id column not exist then add it. + if ( ! $wpdb->get_var( "SHOW COLUMNS FROM {$wpdb->prefix}serial_numbers LIKE 'order_item_id'" ) ) { + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD order_item_id bigint(20) DEFAULT NULL AFTER order_id" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD KEY order_item_id (order_item_id)" ); + } + + // if uuid column not exist then add it. + if ( ! $wpdb->get_var( "SHOW COLUMNS FROM {$wpdb->prefix}serial_numbers LIKE 'uuid'" ) ) { + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD uuid varchar(50) DEFAULT NULL AFTER order_item_id" ); + $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD UNIQUE KEY uuid (uuid)" ); + $wpdb->query( "UPDATE {$wpdb->prefix}serial_numbers SET uuid = UUID()" ); + } + } +} diff --git a/trunk/src/Models/Activation.php b/trunk/src/Models/Activation.php new file mode 100644 index 00000000..b4328b24 --- /dev/null +++ b/trunk/src/Models/Activation.php @@ -0,0 +1,298 @@ + 0, + 'serial_id' => '', + 'instance' => '', + 'platform' => '', + 'activation_time' => '', + // todo add ip address support. + ); + + /* + |-------------------------------------------------------------------------- + | Getters and Setters + |-------------------------------------------------------------------------- + | + | Methods for getting and setting data. + | + */ + /** + * Get the key. + * + * @since 1.4.6 + * + * @return string + */ + public function get_id() { + return $this->get_prop( 'id' ); + } + + /** + * Set the key. + * + * @param string $id Key. + * + * @since 1.4.6 + * + * @return void + */ + public function set_id( $id ) { + $this->set_prop( 'id', absint( $id ) ); + } + + /** + * Get the serial id + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return int + */ + public function get_serial_id( $context = 'view' ) { + return $this->get_prop( 'serial_id', $context ); + } + + /** + * Get the key object. + * + * @since 1.4.6 + * + * @return Key + */ + public function get_key() { + if ( empty( $this->get_serial_id() ) ) { + return null; + } + + return Key::get( $this->get_serial_id() ); + } + + /** + * Get the product id. + * + * @since 1.4.6 + * + * @return int + */ + public function get_product_id() { + if ( empty( $this->get_key() ) ) { + return null; + } + + return $this->get_key()->get_product_id(); + } + + /** + * Get the product title. + * + * @since 1.4.6 + * + * @return string + */ + public function get_product_title() { + if ( empty( $this->get_key() ) ) { + return null; + } + + return $this->get_key()->get_product_title(); + } + + /** + * Set the serial id + * + * @param int $serial_id The serial id. + * + * @since 1.4.6 + * + * @return void + */ + public function set_serial_id( $serial_id ) { + $this->set_prop( 'serial_id', absint( $serial_id ) ); + } + + /** + * Get the instance + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return string + */ + public function get_instance( $context = 'view' ) { + return $this->get_prop( 'instance', $context ); + } + + /** + * Set the instance + * + * @param string $instance The instance. + * + * @since 1.4.6 + * + * @return void + */ + public function set_instance( $instance ) { + $this->set_prop( 'instance', sanitize_text_field( $instance ) ); + } + + /** + * Get the platform + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return string + */ + public function get_platform( $context = 'view' ) { + return $this->get_prop( 'platform', $context ); + } + + /** + * Set the platform + * + * @param string $platform The platform. + * + * @since 1.4.6 + * + * @return void + */ + public function set_platform( $platform ) { + $this->set_prop( 'platform', sanitize_text_field( $platform ) ); + } + + /** + * Get the activation time + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return string + */ + public function get_activation_time( $context = 'view' ) { + return $this->get_prop( 'activation_time', $context ); + } + + /** + * Set the activation time + * + * @param string $activation_time The activation time. + * + * @since 1.4.6 + * + * @return void + */ + public function set_activation_time( $activation_time ) { + $this->set_prop( 'activation_time', sanitize_text_field( $activation_time ) ); + } + + /* + |-------------------------------------------------------------------------- + | CRUD methods + |-------------------------------------------------------------------------- + | + | Methods which create, read, update and delete discounts from the database. + | + */ + /** + * Saves an object in the database. + * + * @since 1.0.0 + * @return true|\WP_Error True on success, WP_Error on failure. + */ + public function save() { + // Serial id is required. + if ( empty( $this->get_serial_id() ) ) { + return new \WP_Error( 'missing_required', __( 'Serial id is required.', 'wc-serial-numbers' ) ); + } + + // Instance is required. + if ( empty( $this->get_instance() ) ) { + return new \WP_Error( 'missing_required', __( 'Instance is required.', 'wc-serial-numbers' ) ); + } + + // If the activation time is empty, set it to now. + if ( empty( $this->get_activation_time() ) ) { + $this->set_activation_time( current_time( 'mysql' ) ); + } + + return parent::save(); + } + + /* + |-------------------------------------------------------------------------- + | Query Methods + |-------------------------------------------------------------------------- + | + | Methods for reading and manipulating the object properties. + | + */ + + /** + * Prepare where query. + * + * @param array $clauses Query clauses. + * @param array $args Array of args to pass to the query method. + * + * @since 1.0.0 + * @return array + */ + protected function prepare_where_query( $clauses, $args = array() ) { + global $wpdb; + $clauses = parent::prepare_where_query( $clauses, $args ); + // If order_id or product_id is set, we need to join with the key table and filter by those. + if ( ! empty( $args['order_id'] ) || ! empty( $args['product_id'] ) ) { + $key_table = ( new Key() )->get_table_name(); + $clauses['join'] .= " INNER JOIN {$wpdb->prefix}" . $key_table . " AS serial_numbers ON {$this->table_name}.serial_id = serial_numbers.id"; + } + + if ( ! empty( $args['order_id'] ) ) { + $clauses['where'] .= $wpdb->prepare( ' AND serial_numbers.order_id = %d', $args['order_id'] ); + } + + if ( ! empty( $args['product_id'] ) ) { + $clauses['where'] .= $wpdb->prepare( ' AND serial_numbers.product_id = %d', $args['product_id'] ); + } + + return $clauses; + } +} diff --git a/trunk/src/Models/Key.php b/trunk/src/Models/Key.php new file mode 100644 index 00000000..77c09881 --- /dev/null +++ b/trunk/src/Models/Key.php @@ -0,0 +1,855 @@ + 0, + 'serial_key' => '', + 'product_id' => 0, + 'activation_limit' => 0, + 'activation_count' => 0, + 'order_id' => 0, + 'vendor_id' => 0, + 'status' => 'available', + 'validity' => 0, + 'order_date' => '', + 'source' => 'custom_source', + 'created_date' => '', + ); + + /* + |-------------------------------------------------------------------------- + | Getters and Setters + |-------------------------------------------------------------------------- + | + | Methods for getting and setting data. + | + */ + /** + * Get the key. + * + * @since 1.4.6 + * + * @return string + */ + public function get_id() { + return $this->get_prop( 'id' ); + } + + /** + * Set the key. + * + * @param string $id Key. + * + * @since 1.4.6 + * + * @return void + */ + public function set_id( $id ) { + $this->set_prop( 'id', absint( $id ) ); + } + + /** + * Get the serial key. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return string + */ + public function get_serial_key( $context = 'edit' ) { + return $this->get_prop( 'serial_key', $context ); + } + + /** + * Get the key. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return string + */ + public function get_key( $context = 'edit' ) { + return $this->get_serial_key( $context ); + } + + /** + * Set the serial key. + * + * @param string $serial_key Serial key. + * + * @since 1.4.6 + * + * @return void + */ + public function set_serial_key( $serial_key ) { + $this->set_prop( 'serial_key', sanitize_textarea_field( $serial_key ) ); + } + + /** + * Get the product id. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return int + */ + public function get_product_id( $context = 'edit' ) { + return $this->get_prop( 'product_id', $context ); + } + + /** + * Get product. + * + * @since 1.4.6 + * + * @return \WC_Product|null Product object or null if not found. + */ + public function get_product() { + $product_id = $this->get_product_id(); + + if ( $product_id ) { + return wc_get_product( $product_id ); + } + + return null; + } + + /** + * Get product name. + * + * @since 1.4.6 + * + * @return string Product name. + */ + public function get_product_title() { + return wcsn_get_product_title( $this->get_product_id() ); + } + + /** + * Set the product id. + * + * @param int $product_id Product id. + * + * @since 1.4.6 + * + * @return void + */ + public function set_product_id( $product_id ) { + $this->set_prop( 'product_id', absint( $product_id ) ); + } + + /** + * Get the activation limit. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return int + */ + public function get_activation_limit( $context = 'edit' ) { + return $this->get_prop( 'activation_limit', $context ); + } + + /** + * Set the activation limit. + * + * @param int $activation_limit Activation limit. + * + * @since 1.4.6 + * + * @return void + */ + public function set_activation_limit( $activation_limit ) { + $this->set_prop( 'activation_limit', absint( $activation_limit ) ); + } + + /** + * Get the activation count. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return int + */ + public function get_activation_count( $context = 'edit' ) { + return $this->get_prop( 'activation_count', $context ); + } + + /** + * Set the activation count. + * + * @param int $activation_count Activation count. + * + * @since 1.4.6 + * + * @return void + */ + public function set_activation_count( $activation_count ) { + $this->set_prop( 'activation_count', absint( $activation_count ) ); + } + + /** + * Get the order id. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return int + */ + public function get_order_id( $context = 'edit' ) { + return $this->get_prop( 'order_id', $context ); + } + + /** + * Get order. + * + * @since 1.4.6 + * + * @return \WC_Order|null Order object or null if not found. + */ + public function get_order() { + $order_id = $this->get_order_id(); + + if ( $order_id ) { + return wc_get_order( $order_id ); + } + + return null; + } + + /** + * Get order title. + * + * @since 1.4.6 + * + * @return string Order title. + */ + public function get_order_title() { + if ( ! $this->get_order() ) { + return ''; + } + + return sprintf( + '(#%1$s) %2$s', + $this->get_order()->get_id(), + wp_strip_all_tags( $this->get_order()->get_formatted_billing_full_name() ) + ); + } + + /** + * Set the order id. + * + * @param int $order_id Order id. + * + * @since 1.4.6 + * + * @return void + */ + public function set_order_id( $order_id ) { + $this->set_prop( 'order_id', absint( $order_id ) ); + } + + /** + * Get the vendor id. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return int + */ + public function get_vendor_id( $context = 'edit' ) { + return $this->get_prop( 'vendor_id', $context ); + } + + /** + * Get vendor. + * + * @since 1.4.6 + * + * @return \WP_User|null Vendor object or null if not found. + */ + public function get_vendor() { + $vendor_id = $this->get_vendor_id(); + + if ( $vendor_id ) { + return get_user_by( 'id', $vendor_id ); + } + + return null; + } + + /** + * Set the vendor id. + * + * @param int $vendor_id Vendor id. + * + * @since 1.4.6 + * + * @return void + */ + public function set_vendor_id( $vendor_id ) { + $this->set_prop( 'vendor_id', absint( $vendor_id ) ); + } + + /** + * Get the status. + * Possible values: 'active', 'inactive', 'expired', 'cancelled', 'pending', 'failed', 'refunded', 'deleted'. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return string + */ + public function get_status( $context = 'edit' ) { + return $this->get_prop( 'status', $context ); + } + + /** + * Set the status. + * Possible values: 'active', 'inactive', 'expired', 'cancelled', 'pending', 'failed', 'refunded', 'deleted'. + * + * @param string $status Status. + * + * @since 1.4.6 + * + * @return void + */ + public function set_status( $status ) { + if ( array_key_exists( $status, wcsn_get_key_statuses() ) ) { + $this->set_prop( 'status', $status ); + } + } + + /** + * Get the validity. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return string + */ + public function get_validity( $context = 'edit' ) { + return $this->get_prop( 'validity', $context ); + } + + /** + * Set the validity. + * + * @param string $validity Validity. + * + * @since 1.4.6 + * + * @return void + */ + public function set_validity( $validity ) { + $this->set_prop( 'validity', absint( $validity ) ); + } + + /** + * Get the order date. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return string + */ + public function get_order_date( $context = 'edit' ) { + return $this->get_prop( 'order_date', $context ); + } + + /** + * Set the order date. + * + * @param string $order_date Order date. + * + * @since 1.4.6 + * + * @return void + */ + public function set_order_date( $order_date ) { + $this->set_date_prop( 'order_date', $order_date ); + } + + /** + * Get the source. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return string + */ + public function get_source( $context = 'edit' ) { + return $this->get_prop( 'source', $context ); + } + + /** + * Set the source. + * + * @param string $source Source. + * + * @since 1.4.6 + * + * @return void + */ + public function set_source( $source ) { + $this->set_prop( 'source', sanitize_text_field( $source ) ); + } + + /** + * Get the created date. + * + * @param string $context What the value is for. Valid values are 'view' and 'edit'. + * + * @since 1.4.6 + * + * @return int + */ + public function get_created_date( $context = 'edit' ) { + return $this->get_prop( 'created_date', $context ); + } + + /** + * Set the created date. + * + * @param string $created_date Created date. + * + * @since 1.4.6 + * + * @return void + */ + public function set_created_date( $created_date ) { + $this->set_date_prop( 'created_date', $created_date ); + } + + /* + |-------------------------------------------------------------------------- + | CRUD methods + |-------------------------------------------------------------------------- + | + | Methods which create, read, update and delete discounts from the database. + | + */ + /** + * Saves an object in the database. + * + * @since 1.0.0 + * @return true|\WP_Error True on success, WP_Error on failure. + */ + public function save() { + // Product id is required. + if ( ! $this->get_product_id() ) { + return new \WP_Error( 'missing-required', __( 'Product id is required.', 'wc-serial-numbers' ) ); + } + + // Check if product id is valid. + if ( empty( wc_get_product( $this->get_product_id() ) ) ) { + return new \WP_Error( 'invalid-data', __( 'Product id is invalid.', 'wc-serial-numbers' ) ); + } + + // Serial key is required. + if ( ! $this->get_serial_key() ) { + return new \WP_Error( 'missing-required', __( 'Serial key is required.', 'wc-serial-numbers' ) ); + } + + // Duplicate serial key is not allowed. + if ( ! wcsn_is_duplicate_key_allowed() ) { + $existing = self::get( + array( + 'serial_key' => $this->get_serial_key(), + ) + ); + + if ( $existing && $existing->get_id() !== $this->get_id() ) { + return new \WP_Error( 'invalid-data', __( 'Serial key already exists. Duplicate serial keys are not allowed.', 'wc-serial-numbers' ) ); + } + } + + // If order id is set, check if it is valid. + if ( $this->get_order_id() && empty( wc_get_order( $this->get_order_id() ) ) ) { + return new \WP_Error( 'invalid-data', __( 'Order id is invalid.', 'wc-serial-numbers' ) ); + } + + // If status is available, order date should not be set. + if ( 'available' === $this->get_status() ) { + $this->set_order_id( 0 ); + $this->set_order_date( null ); + $this->set_activation_count( 0 ); + } + + // If order is set, order date should be set. + if ( $this->get_order_id() && ! $this->get_order_date() ) { + $order = wc_get_order( $this->get_order_id() ); + // Get order confirmed date. + $order_date = $order->get_date_completed() ? $order->get_date_completed()->getTimestamp() : wp_date( 'Y-m-d H:i:s' ); + $this->set_date_prop( 'order_date', $order_date ); + } + + // If key is not created yet, set created date. + if ( ! $this->get_created_date() ) { + $this->set_date_prop( 'created_date', wp_date( 'Y-m-d H:i:s' ) ); + } + + return parent::save(); + } + + /* + |-------------------------------------------------------------------------- + | Query Methods + |-------------------------------------------------------------------------- + | + | Methods for reading and manipulating the object properties. + | + */ + + /** + * Retrieve the object instance. + * + * @param int|array|static $data Object ID or array of arguments. + * + * @since 1.0.0 + * + * @return static|false Object instance on success, false on failure. + */ + public static function get( $data ) { + // If by is set to serial key, encrypt it. + if ( is_array( $data ) && array_key_exists( 'serial_key', $data ) ) { + $data['serial_key'] = wcsn_encrypt_key( $data['serial_key'] ); + } + + return parent::get( $data ); + } + + /** + * Prepare where query. + * + * @param array $clauses Query clauses. + * @param array $args Array of args to pass to the query method. + * + * @since 1.0.0 + * @return array + */ + protected function prepare_where_query( $clauses, $args = array() ) { + global $wpdb; + $clauses = parent::prepare_where_query( $clauses, $args ); + + // If customer id is set, find the orders having that customer id and limit the results to those orders. + if ( ! empty( $args['customer_id'] ) ) { + $customer_id = absint( $args['customer_id'] ); + $order_ids = wc_get_orders( + array( + 'customer_id' => $customer_id, + 'limit' => - 1, + 'return' => 'ids', + ) + ); + + if ( ! empty( $order_ids ) ) { + $clauses['where'] .= " AND {$this->table_name}.order_id IN (" . implode( ',', $order_ids ) . ')'; + } else { + $clauses['where'] .= ' AND 0'; + } + } + + return $clauses; + } + + /** + * Prepare search query. + * + * @param array $clauses Query clauses. + * @param array $args Array of args to pass to the query method. + * + * @since 1.0.0 + * @return array + */ + protected function prepare_search_query( $clauses, $args = array() ) { + global $wpdb; + /** + * Filter the search query before setting up the query. + * + * @param array $clauses Query clauses. + * @param array $args Query arguments. + * @param static $this Current instance of the class. + * + * @return array + * @since 1.0.0 + */ + $clauses = apply_filters( $this->get_hook_prefix() . '_pre_setup_search_query', $clauses, $args, $this ); + + if ( ! empty( $args['search'] ) ) { + $search = $args['search']; + if ( ! empty( $args['search_columns'] ) ) { + $search_columns = wp_parse_list( $args['search_columns'] ); + } else { + /** + * Filter the columns to search in when performing a search query. + * + * @param array $search_columns Array of columns to search in. + * @param array $args Query arguments. + * @param static $object Current instance of the class. + * + * @return array + * @since 1.0.0 + */ + $search_columns = apply_filters( $this->get_hook_prefix() . '_search_columns', $this->get_searchable_keys(), $args, $this ); + } + $search_columns = array_filter( array_unique( $search_columns ) ); + $like = '%' . $wpdb->esc_like( $search ) . '%'; + + $search_clauses = array(); + foreach ( $search_columns as $column ) { + if ( 'serial_key' === $column ) { + $like = '%' . $wpdb->esc_like( wcsn_encrypt_key( $search ) ) . '%'; + } + $search_clauses[] = $wpdb->prepare( $this->table_name . '.' . $column . ' LIKE %s', $like ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared + } + + if ( ! empty( $search_clauses ) ) { + $clauses['where'] .= 'AND (' . implode( ' OR ', $search_clauses ) . ')'; + } + } + + /** + * Filter the search query after setting up the query. + * + * @param array $clauses Query clauses. + * @param array $args Query arguments. + * @param static $this Current instance of the class. + * + * @return array + * @since 1.0.0 + */ + return apply_filters( $this->get_hook_prefix() . '_setup_search_query', $clauses, $args, $this ); + } + + /* + |-------------------------------------------------------------------------- + | Helpers Methods + |-------------------------------------------------------------------------- + | + | Common methods used by the class. + | + */ + /** + * Get status label. + * + * @since 1.5.6 + * @return string + */ + public function get_status_label() { + $statuses = wcsn_get_key_statuses(); + if ( array_key_exists( $this->get_status(), $statuses ) ) { + return $statuses[ $this->get_status() ]; + } + + return '—'; + } + + /** + * Reset activations. + * + * @since 1.0.0 + */ + public function reset_activations() { + $activations = $this->get_activations(); + foreach ( $activations as $activation ) { + $activation->delete(); + } + } + /** + * Get customer id. + * + * @since 1.0.0 + * + * @return int + */ + public function get_customer_id() { + if ( ! $this->get_order() ) { + return 0; + } + + return $this->get_order()->get_customer_id(); + } + + /** + * Get customer email. + * + * @since 1.0.0 + * + * @return string + */ + public function get_customer_email() { + if ( ! $this->get_order() ) { + return ''; + } + + return $this->get_order()->get_billing_email(); + } + + /** + * Get customer name. + * + * @since 1.0.0 + * + * @return string + */ + public function get_customer_name() { + if ( ! $this->get_order() ) { + return ''; + } + + return $this->get_order()->get_formatted_billing_full_name(); + } + + /** + * Get the expiry date. + * + * @since 1.4.6 + * + * @return string + */ + public function get_expire_date() { + // If order date is not set or validity is not set, return empty string. + if ( ! $this->get_order_date() || ! $this->get_validity() ) { + return ''; + } + $order_date = $this->get_order_date(); + $validity = $this->get_validity(); + + $expiry_date = strtotime( "+{$validity} days", strtotime( $order_date ) ); + + return wp_date( 'Y-m-d H:i:s', $expiry_date ); + } + + /** + * Recount activations. + * + * @since 1.0.0 + * + * @return int + */ + public function recount_remaining_activation() { + $count = $this->get_activations( array( 'count' => true ) ); + $this->set_activation_count( $count ); + $this->save(); + + return $count; + } + + /** + * Check if the key is expired. + * + * @since 1.0.0 + * @return bool + */ + public function is_expired() { + if ( ! $this->get_order_date() || ! $this->get_validity() ) { + return false; + } + + return strtotime( $this->get_expire_date() ) < time(); + } + + /** + * Get remaining activations. + * + * @since 1.0.0 + * @return int + */ + public function get_activations_left() { + $activation_count = $this->get_activation_count(); + $activation_limit = $this->get_activation_limit(); + if ( ! $activation_limit ) { + return 9999; + } + + return $activation_limit - $activation_count; + } + + /** + * Get activations. + * + * @param array $args Array of args to pass to the query method. + * + * @since 1.0.0 + * + * @return array|int Array of activations or count. + */ + public function get_activations( $args = array() ) { + $args = wp_parse_args( + $args, + array( + 'serial_id' => $this->get_id(), + ) + ); + + return Activation::query( $args ); + } + + /** + * Display the serial key. + * + * @param bool $masked Whether to mask the key or not. + * + * @since 1.5.0 + * @return string + */ + public function print_key( $masked = false ) { + $key = $this->get_serial_key(); + if ( $masked ) { + // Divide the length of the key by 3 and round up. Then mask the middle part of the key. + $mask_length = ceil( strlen( $key ) / 3 ); + $mask_start = ceil( ( strlen( $key ) - $mask_length ) / 2 ); + $mask_end = $mask_start + $mask_length; + $masked_key = substr( $key, 0, $mask_start ) . str_repeat( '*', $mask_length ) . substr( $key, $mask_end ); + $key = sprintf( '%s', esc_attr( $masked_key ), esc_attr( $key ), $masked_key ); + } else { + $key = sprintf( '%s', esc_attr( $key ), esc_attr( $key ), $key ); + } + + return apply_filters( $this->get_hook_prefix() . '_display_key', $key, $this ); + } +} diff --git a/trunk/src/Models/Model.php b/trunk/src/Models/Model.php new file mode 100644 index 00000000..5d1bcf9a --- /dev/null +++ b/trunk/src/Models/Model.php @@ -0,0 +1,21 @@ +cart->get_cart_contents(); + foreach ( $cart_products as $id => $cart_product ) { + // @var \WC_Product $product Product object. + $product = $cart_product['data']; + $product_id = $product->get_id(); + $quantity = $cart_product['quantity']; + $allow_backorder = apply_filters( 'wc_serial_numbers_allow_backorder', false, $product_id, $cart_product ); + + if ( wcsn_is_product_enabled( $product_id ) && ! $allow_backorder ) { + $per_item_quantity = absint( apply_filters( 'wc_serial_numbers_per_product_delivery_qty', 1, $product_id ) ); + $needed_quantity = $quantity * ( empty( $per_item_quantity ) ? 1 : absint( $per_item_quantity ) ); + $source = apply_filters( 'wc_serial_numbers_product_serial_source', 'custom_source', $product_id, $needed_quantity ); + if ( 'custom_source' === $source ) { + $args = array( + 'product_id' => $product_id, + 'status' => 'available', + ); + $total_found = Key::count( $args ); + if ( $total_found < $needed_quantity ) { + $stock = floor( $total_found / $per_item_quantity ); + // translators: %1$s: product title, %2$s: stock quantity. + $message = sprintf( esc_html__( 'Sorry, there aren’t enough Serial Keys for %1$s. Please remove this item or lower the quantity. For now, we have %2$s Serial Keys for this product.', 'wc-serial-numbers' ), '{product_title}', '{stock_quantity}' ); + $notice = apply_filters( 'wc_serial_numbers_low_stock_message', $message ); + $notice = str_replace( '{product_title}', $product->get_title(), $notice ); + $notice = str_replace( '{stock_quantity}', $stock, $notice ); + + wc_add_notice( $notice, 'error' ); + + return; + } + } + } + + do_action( 'wc_serial_number_product_cart_validation_complete', $product_id, $cart_product ); + } + } + + /** + * Automatically set the order's status to complete. + * + * @param string $new_order_status The new order status. + * @param int $order_id The order ID. + * @param \WC_Order $order The order object. + * + * @since 1.4.6 + * @return string $new_order_status + */ + public static function maybe_autocomplete_order( $new_order_status, $order_id, $order = null ) { + // Exit early if the order has no ID, or if the new order status is not 'processing'. + if ( 'yes' !== get_option( 'wc_serial_numbers_autocomplete_order' ) || 0 === $order_id || 'processing' !== $new_order_status ) { + return $new_order_status; + } + if ( null === $order ) { + remove_filter( 'woocommerce_payment_complete_order_status', __METHOD__, 10 ); + $order = wc_get_order( $order_id ); + add_filter( 'woocommerce_payment_complete_order_status', __METHOD__, 10, 3 ); + } + + if ( wcsn_order_has_products( $order ) ) { + $new_order_status = 'completed'; + // Add a note to the order mentioning that the order has been automatically completed by the plugin. + $order->add_order_note( + apply_filters( + 'wc_serial_numbers_autocomplete_order_note', + __( 'Order automatically completed by the Serial Numbers for WooCommerce.', 'wc-serial-numbers' ), + $order + ) + ); + } + + return $new_order_status; + } + + /** + * Handle order status changed. + * + * @param int|\WC_Order $order_id The order ID or WC_Order object. + * + * @since 1.4.6 + */ + public static function handle_order_status_changed( $order_id ) { + if ( apply_filters( 'wc_serial_numbers_maybe_manual_delivery', false, $order_id ) ) { + return; + } + wcsn_order_update_keys( $order_id ); + } + + /** + * Print ordered serials + * + * @param \WC_Order $order The order object. + * + * @since 1.2.0 + */ + public static function order_display_keys( $order ) { + /** + * Filter to allow or disallow displaying keys in order details. + * + * @param bool $allow Whether to allow or disallow displaying serial numbers in order details. + * @param \WC_Order $order The order object. + */ + $allow = apply_filters( 'wc_serial_numbers_allow_order_display_keys', $order->has_status( 'completed' ), $order ); + + if ( ! $allow || ! wcsn_order_has_products( $order ) ) { + return; + } + + wcsn_display_order_keys( $order ); + } + + /** + * Order email keys. + * + * @param \WC_Order $order The order object. + * + * @since 1.2.0 + */ + public static function order_email_keys( $order ) { + /** + * Filter to allow or disallow sending serial numbers in order emails. + * + * @param bool $allow Whether to allow or disallow sending serial numbers in order emails. + * @param \WC_Order $order The order object. + */ + $allow = apply_filters( 'wc_serial_numbers_allow_order_email_keys', $order->has_status( 'completed' ), $order ); + + if ( ! $allow || ! wcsn_order_has_products( $order ) ) { + return; + } + + wcsn_display_order_keys( $order ); + } +} diff --git a/trunk/src/Plugin.php b/trunk/src/Plugin.php new file mode 100644 index 00000000..bd870ff8 --- /dev/null +++ b/trunk/src/Plugin.php @@ -0,0 +1,177 @@ +includes(); + $this->init_hooks(); + } + + /** + * Include required files. + * + * @since 1.0.0 + * @return void + */ + public function includes() { + require_once __DIR__ . '/functions.php'; + require_once __DIR__ . '/Deprecated/Functions.php'; + } + + /** + * Hook into actions and filters. + * + * @since 1.0.0 + * @return void + */ + public function init_hooks() { + register_activation_hook( $this->get_file(), array( Installer::class, 'install' ) ); + add_action( 'admin_notices', array( $this, 'dependencies_notices' ) ); + add_action( 'before_woocommerce_init', array( $this, 'on_before_woocommerce_init' ) ); + add_action( 'woocommerce_loaded', array( $this, 'init' ), 0 ); + } + + /** + * Run on before WooCommerce init. + * + * @since 1.0.0 + * @return void + */ + public function on_before_woocommerce_init() { + if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', $this->get_file(), true ); + } + } + + /** + * Missing dependencies notice. + * + * @since 1.0.0 + * @return void + */ + public function dependencies_notices() { + if ( $this->is_plugin_active( 'woocommerce' ) ) { + return; + } + $notice = sprintf( + /* translators: 1: plugin name 2: WooCommerce */ + __( '%1$s requires %2$s to be installed and active.', 'wc-serial-numbers' ), + '' . esc_html( $this->get_name() ) . '', + '' . esc_html__( 'WooCommerce', 'wc-serial-numbers' ) . '' + ); + + echo '

    ' . wp_kses_post( $notice ) . '

    '; + } + + /** + * Init the plugin after plugins_loaded so environment variables are set. + * + * @since 1.0.0 + * @return void + */ + public function init() { + $this->services['installer'] = new Installer(); + $this->services['cron'] = new Cron(); + $this->services['cache'] = new Cache(); + $this->services['encryption'] = new Encryption(); + $this->services['orders'] = new Orders(); + $this->services['stocks'] = new Stocks(); + $this->services['ajax'] = new Ajax(); + $this->services['actions'] = new Actions(); + $this->services['restapi'] = new RestAPI(); + $this->services['utilities'] = new Utilities\Utilities(); + $this->services['frontend'] = new Frontend\Frontend(); + + if ( wcsn_is_software_support_enabled() ) { + $this->services['api'] = new API(); + } + + if ( self::is_request( 'admin' ) ) { + $this->services['admin'] = new Admin\Admin(); + } + + // Init action. + do_action( 'wc_serial_numbers_loaded' ); + } + + /** + * Determines if the pro version active. + * + * @since 1.0.0 + * @return bool + * @deprecated 1.4.0 + */ + public static function is_pro_active() { + _deprecated_function( __METHOD__, '1.4.0', 'Plugin::is_premium_active()' ); + + return self::$instance->is_premium_active(); + } + + /** + * Determines if the wc is active. + * + * @since 1.0.0 + * @return bool + * @deprecated 1.4.0 + */ + public function is_wc_active() { + return $this->is_plugin_active( 'woocommerce/woocommerce.php' ); + } + + /** + * Plugin URL getter. + * + * @since 1.2.0 + * @return string + * @deprecated 1.4.0 + */ + public function plugin_url() { + _deprecated_function( __METHOD__, '1.4.0', 'Plugin::get_url()' ); + + return $this->get_url(); + } + + /** + * Plugin path getter. + * + * @since 1.2.0 + * @return string + * @deprecated 1.4.0 + */ + public function plugin_path() { + _deprecated_function( __METHOD__, '1.4.0', 'Plugin::get_path()' ); + + return $this->get_path(); + } + + /** + * Plugin base path name getter. + * + * @since 1.2.0 + * @return string + * @deprecated 1.4.2 + */ + public function plugin_basename() { + _deprecated_function( __METHOD__, '1.4.2', 'Plugin::get_basename()' ); + + return $this->get_basename(); + } +} diff --git a/trunk/src/RestAPI.php b/trunk/src/RestAPI.php new file mode 100644 index 00000000..c2f7d497 --- /dev/null +++ b/trunk/src/RestAPI.php @@ -0,0 +1,411 @@ + 'GET', + 'permission_callback' => array( $this, 'validate_request' ), + 'callback' => array( $this, 'validate_key' ), + 'args' => array( + 'product_id' => array( + 'required' => true, + 'type' => array( 'string', 'integer' ), + ), + 'serial_key' => array( + 'required' => true, + 'type' => 'string', + ), + 'email' => array( + 'required' => false, + 'type' => 'email', + ), + ), + ) + ); + + // activate key. + register_rest_route( + 'wcsn', + '/activate', + array( + 'methods' => 'GET', + 'permission_callback' => array( $this, 'validate_request' ), + 'callback' => array( $this, 'activate_key' ), + 'args' => array( + 'product_id' => array( + 'required' => true, + 'type' => 'string', + ), + 'serial_key' => array( + 'required' => true, + 'type' => 'string', + ), + 'email' => array( + 'required' => false, + 'type' => 'email', + ), + ), + ) + ); + + // deactivate key. + register_rest_route( + 'wcsn', + '/deactivate', + array( + 'methods' => 'GET', + 'permission_callback' => array( $this, 'validate_request' ), + 'callback' => array( $this, 'deactivate_key' ), + 'args' => array( + 'product_id' => array( + 'required' => true, + 'type' => 'string', + ), + 'serial_key' => array( + 'required' => true, + 'type' => 'string', + ), + 'email' => array( + 'required' => false, + 'type' => 'email', + ), + ), + ) + ); + + // Check version. + register_rest_route( + 'wcsn', + '/version_check', + array( + 'methods' => 'GET', + 'permission_callback' => array( $this, 'validate_request' ), + 'callback' => array( $this, 'version_check' ), + array( + 'product_id' => array( + 'required' => true, + 'type' => 'string', + ), + 'serial_key' => array( + 'required' => true, + 'type' => 'string', + ), + 'email' => array( + 'required' => false, + 'type' => 'email', + ), + ), + ) + ); + } + + /** + * Check if a given request has access to create an item. + * + * @param \WP_REST_Request $request Full details about the request. + * + * @return \WP_Error|boolean + */ + public function validate_request( $request ) { + $product_id = absint( $request->get_param( 'product_id' ) ); + $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); + $email = sanitize_email( $request->get_param( 'email' ) ); + + // Check if product ID is valid. + if ( ! $product_id || ! get_post( $product_id ) ) { + return new \WP_Error( 'invalid_product_id', __( 'Invalid product ID.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + // Check if key is valid. + if ( empty( $key ) ) { + return new \WP_Error( 'missing_key', __( 'Serial key is required.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + // Check if key exists. + $serial_key = Key::get( + array( + 'serial_key' => $key, + 'product_id' => $product_id, + ) + ); + if ( ! $serial_key ) { + return new \WP_Error( 'invalid_key', __( 'Serial key is invalid.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + // Check if the key has order ID. + if ( empty( $serial_key->get_order_id() ) || ( $serial_key->get_order_id() && ! get_post( $serial_key->get_order_id() ) ) ) { + return new \WP_Error( 'invalid_key', __( 'Serial key is not authorized to use.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + // Check if order status is completed. + $order = wc_get_order( $serial_key->get_order_id() ); + if ( ! $order || ! apply_filters( 'wc_serial_numbers_api_validate_order_status', 'completed' === $order->get_status(), $order ) ) { + return new \WP_Error( 'invalid_order', __( 'Please complete your order to activate the serial key.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + // Check if key is valid for the product. + if ( $serial_key->get_product_id() !== $product_id ) { + return new \WP_Error( 'invalid_product_key', __( 'Serial key is not valid for this product.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + // If email is provided, check if it is valid. + if ( ( $email || wcsn_is_duplicate_key_allowed() ) && strtolower( $order->get_billing_email() ) !== $email ) { + return new \WP_Error( 'invalid_email', __( 'Invalid email address.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + // based on key status send response. + if ( 'expired' === $serial_key->get_status() ) { + return new \WP_Error( 'expired_key', __( 'Serial key is expired.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } elseif ( 'cancelled' === $serial_key->get_status() ) { + return new \WP_Error( 'key_cancelled', __( 'Serial key is cancelled.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + + } elseif ( 'sold' !== $serial_key->get_status() ) { + return new \WP_Error( 'invalid_key_status', __( 'Invalid serial key.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + return true; + } + + /** + * Validate key. + * + * @param \WP_REST_Request $request Full details about the request. + * + * @return \WP_REST_Response + */ + public function validate_key( $request ) { + $product_id = absint( $request->get_param( 'product_id' ) ); + $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); + + $serial_key = Key::get( + array( + 'serial_key' => $key, + 'product_id' => $product_id, + ) + ); + + $response = array( + 'code' => 'key_valid', + 'message' => __( 'Serial key is valid.', 'wc-serial-numbers' ), + 'activation_limit' => $serial_key->get_activation_limit(), + 'activation_count' => $serial_key->get_activation_count(), + 'activations_left' => $serial_key->get_activations_left(), + 'expire_date' => $serial_key->get_expire_date(), + 'status' => 'sold' === $serial_key->get_status() ? 'active' : $serial_key->get_status(), + 'product_id' => $serial_key->get_product_id(), + 'product' => $serial_key->get_product_title(), + 'activations' => $serial_key->get_activations( + array( + 'limit' => - 1, + 'output' => ARRAY_A, + ) + ), + + // Deprecated. + 'remaining' => $serial_key->get_activations_left(), + ); + + // send response. + return rest_ensure_response( apply_filters( 'wc_serial_numbers_api_validate_response', $response, $serial_key ) ); + } + + /** + * Activate key. + * + * @param \WP_REST_Request $request Full details about the request. + * + * @return \WP_REST_Response|\WP_Error Activation response. + */ + public function activate_key( $request ) { + $product_id = absint( $request->get_param( 'product_id' ) ); + $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); + $email = sanitize_email( $request->get_param( 'email' ) ); + $instance = sanitize_text_field( $request->get_param( 'instance' ) ); + $platform = sanitize_text_field( $request->get_param( 'platform' ) ); + + // if instance is not provided, create a new instance based on the request. + if ( empty( $instance ) ) { + $instance = md5( $email . $platform . time() ); + } + + $serial_key = Key::get( + array( + 'serial_key' => $key, + 'product_id' => $product_id, + ) + ); + + // Check if instance is already activated. + $activation = Activation::get( + array( + 'serial_id' => $serial_key->get_id(), + 'instance' => $instance, + ) + ); + + if ( $activation ) { + return new \WP_Error( 'instance_already_activated', __( 'Instance is already activated.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + // Check if key is already activated. + if ( $serial_key->get_activations_left() <= 0 ) { + return new \WP_Error( 'no_activations_left', __( 'Activation limit reached.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + // Create activation. + $activation = Activation::insert( + array( + 'serial_id' => $serial_key->get_id(), + 'instance' => $instance, + 'platform' => $platform, + ) + ); + + $serial_key->recount_remaining_activation(); + + $response = array( + 'code' => 'key_activated', + 'message' => __( 'Serial key is activated.', 'wc-serial-numbers' ), + 'activated' => true, + 'instance' => $activation->get_instance(), + 'platform' => $activation->get_platform(), + 'activation_limit' => $serial_key->get_activation_limit(), + 'activation_count' => $serial_key->get_activation_count(), + 'activations_left' => $serial_key->get_activations_left(), + 'expires_at' => $serial_key->get_expire_date(), + 'product_id' => $serial_key->get_product_id(), + 'product' => $serial_key->get_product_title(), + 'activations' => $serial_key->get_activations( + array( + 'limit' => - 1, + 'output' => ARRAY_A, + ) + ), + + // Deprecated. + 'remaining' => $serial_key->get_activations_left(), + ); + + // send response. + return rest_ensure_response( apply_filters( 'wc_serial_numbers_api_activate_response', $response, $activation, $serial_key ) ); + } + + /** + * Deactivate key. + * + * @param \WP_REST_Request $request Full details about the request. + * + * @return \WP_REST_Response|\WP_Error Deactivation response. + */ + public function deactivate_key( $request ) { + $product_id = absint( $request->get_param( 'product_id' ) ); + $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); + $instance = sanitize_text_field( $request->get_param( 'instance' ) ); + + if ( empty( $instance ) ) { + return new \WP_Error( 'missing_instance', __( 'Instance is missing, You must provide an instance to deactivate license.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + $serial_key = Key::get( + array( + 'serial_key' => $key, + 'product_id' => $product_id, + ) + ); + + $activation = Activation::get( + array( + 'serial_id' => $serial_key->get_id(), + 'instance' => $instance, + ) + ); + + if ( ! $activation ) { + return new \WP_Error( 'instance_not_found', __( 'Instance not found.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); + } + + $activation->delete(); + $serial_key->recount_remaining_activation(); + + $response = array( + 'code' => 'key_deactivated', + 'message' => __( 'Serial key is deactivated.', 'wc-serial-numbers' ), + 'deactivated' => true, + 'instance' => $activation->get_instance(), + 'activation_limit' => $serial_key->get_activation_limit(), + 'activation_count' => $serial_key->get_activation_count(), + 'activations_left' => $serial_key->get_activations_left(), + 'expires_at' => $serial_key->get_expire_date(), + 'product_id' => $serial_key->get_product_id(), + 'product' => $serial_key->get_product_title(), + 'activations' => $serial_key->get_activations( + array( + 'limit' => - 1, + 'output' => ARRAY_A, + ) + ), + + // Deprecated. + 'remaining' => $serial_key->get_activations_left(), + ); + + // send response. + return rest_ensure_response( apply_filters( 'wc_serial_numbers_api_deactivate_response', $response, $activation, $serial_key ) ); + } + + /** + * Check version. + * + * @param \WP_REST_Request $request Full details about the request. + * + * @return \WP_REST_Response|\WP_Error Version check response. + */ + public function version_check( $request ) { + $product_id = absint( $request->get_param( 'product_id' ) ); + $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); + + $serial_key = Key::get( + array( + 'serial_key' => $key, + 'product_id' => $product_id, + ) + ); + + $response = array( + 'code' => 'version_checked', + 'product_id' => $serial_key->get_product_id(), + 'product' => $serial_key->get_product_title(), + 'version' => get_post_meta( $serial_key->get_product_id(), '_software_version', true ), + ); + + // send response. + return rest_ensure_response( $response ); + } +} diff --git a/trunk/src/Stocks.php b/trunk/src/Stocks.php new file mode 100644 index 00000000..0f358e14 --- /dev/null +++ b/trunk/src/Stocks.php @@ -0,0 +1,43 @@ +get_id() ) ) { + $stocks = wcsn_get_stocks_count(); + if ( isset( $stocks[ $product->get_id() ] ) ) { + $quantity = $stocks[ $product->get_id() ]; + } + } + + return $quantity; + } +} diff --git a/trunk/src/Utilities/Utilities.php b/trunk/src/Utilities/Utilities.php new file mode 100644 index 00000000..4dff1c35 --- /dev/null +++ b/trunk/src/Utilities/Utilities.php @@ -0,0 +1,31 @@ + __( 'Available', 'wc-serial-numbers' ), // when ready for selling. + 'pending' => __( 'Pending', 'wc-serial-numbers' ), // Assigned to an order but not paid yet. + 'sold' => __( 'Sold', 'wc-serial-numbers' ), // Assigned to an order and paid. + 'expired' => __( 'Expired', 'wc-serial-numbers' ), // when expired. + 'cancelled' => __( 'Cancelled', 'wc-serial-numbers' ), // when cancelled. + ); + + return apply_filters( 'wc_serial_numbers_key_statuses', $statuses ); +} + +/** + * Check if serial number is reusing. + * + * @since 1.2.0 + * @return bool + */ +function wcsn_is_reusing_keys() { + return 'yes' === get_option( 'wc_serial_numbers_reuse_serial_number', 'no' ); +} + +/** + * Get order revoke statuses. + * + * @since 1.4.6 + * @return array + */ +function wcsn_get_revoke_statuses() { + $statues = array( + 'cancelled', + 'refunded', + 'failed', + 'pending', + ); + + return apply_filters( 'wc_serial_numbers_revoke_statuses', $statues ); +} + +/** + * Get key sources. + * + * @since 1.2.0 + * @return mixed|void + */ +function wcsn_get_key_sources() { + $sources = array( + 'custom_source' => __( 'Manually added', 'wc-serial-numbers' ), + ); + + return apply_filters( 'wc_serial_numbers_key_sources', $sources ); +} + +/** + * Return true if pre argument version is older than the current version. + * + * @param string $version WC version. + * + * @since 1.4.6 + * + * @return bool + */ +function wcsn_is_woocommerce_pre( $version ) { + return defined( 'WC_VERSION' ) && version_compare( WC_VERSION, $version, '<' ); +} + +/** + * Return the product object. + * + * @param int|mixed $product WC_Product or order ID. + * + * @since 1.4.6 + * + * @return null|\WC_Product object or null if not found. + */ +function wcsn_get_product_object( $product ) { + return is_object( $product ) ? $product : wc_get_product( $product ); +} + +/** + * Return the customer/user ID. + * + * @param int|mixed $order WC_Order or order ID. + * + * @since 1.4.6 + * + * @return bool|int|mixed false if not found. + */ +function wcsn_get_customer_id( $order ) { + $order = wcsn_get_order_object( $order ); + + if ( $order && ! ( $order instanceof \WC_Order_Refund ) ) { + return wcsn_is_woocommerce_pre( '3.0' ) ? $order->get_user_id() : $order->get_customer_id(); + } + + return false; +} + +/** + * Return the order object. + * + * @param int|mixed $order WC_Order or order ID. + * + * @since 1.4.6 + * + * @return bool|\WC_Order + */ +function wcsn_get_order_object( $order ) { + return is_object( $order ) ? $order : wc_get_order( $order ); +} + +/** + * Insert key. + * + * @param array $args Key arguments. + * @param boolean $wp_error Optional. Whether to return a WP_Error on failure. Default false. + * + * @since 1.4.6 + * @return Key|WP_Error object on success, WP_Error object on failure. + */ +function wcsn_insert_key( $args, $wp_error = true ) { + return Key::insert( $args, $wp_error ); +} + +/** + * Query keys. + * + * @param array $args Query arguments. + * @param bool $count Optional. Whether to return only the total found count. Default false. + * + * @since 1.4.6 + * @return Key[]|array|int Keys array or count of keys. + */ +function wcsn_get_keys( $args = array(), $count = false ) { + $defaults = array( + 'limit' => 20, + 'offset' => 0, + 'orderby' => 'id', + 'order' => 'DESC', + 'fields' => 'all', + ); + $args = wp_parse_args( $args, $defaults ); + if ( $count ) { + return Key::count( $args ); + } + + return Key::query( $args ); +} + +/** + * Get key. + * + * @param mixed $key Key ID. + * + * @since 1.4.6 + * @return Key|false + */ +function wcsn_get_key( $key ) { + return Key::get( $key ); +} + +/** + * Delete key. + * + * @param int $key_id Key ID. + * + * @since 1.4.6 + * @return bool True on success, false on failure. + */ +function wcsn_delete_key( $key_id ) { + $key = wcsn_get_key( $key_id ); + if ( ! $key ) { + return false; + } + + return $key->delete(); +} + +/** + * Insert activation. + * + * @param array $args Activation arguments. + * + * @since 1.4.6 + * @return Activation|WP_Error object on success, WP_Error object on failure. + */ +function wcsn_insert_activation( $args ) { + return Activation::insert( $args ); +} + +/** + * Query activations. + * + * @param array $args Query arguments. + * @param bool $count Optional. Whether to return only the total found count. Default false. + * + * @since 1.4.6 + * @return Activation[]|array|int Activations array or count of activations. + */ +function wcsn_get_activations( $args = array(), $count = false ) { + $defaults = array( + 'limit' => 20, + 'offset' => 0, + 'orderby' => 'id', + 'order' => 'DESC', + 'fields' => 'all', + ); + $args = wp_parse_args( $args, $defaults ); + if ( $count ) { + return Activation::count( $args ); + } + + return Activation::query( $args ); +} + +/** + * Get activation. + * + * @param mixed $activation Activation ID. + * + * @since 1.4.6 + * @return Activation|false + */ +function wcsn_get_activation( $activation ) { + return Activation::get( $activation ); +} + +/** + * Delete activation. + * + * @param int $activation_id Activation ID. + * + * @since 1.4.6 + * @return bool True on success, false on failure. + */ +function wcsn_delete_activation( $activation_id ) { + $activation = wcsn_get_activation( $activation_id ); + if ( ! $activation ) { + return false; + } + + return $activation->delete(); +} + +/** + * Check if product enabled for selling serial numbers. + * + * @param int $product_id Product ID. + * + * @since 1.2.0 + * @return bool True if enabled, false otherwise. + */ +function wcsn_is_product_enabled( $product_id ) { + return 'yes' === get_post_meta( $product_id, '_is_serial_number', true ); +} + +/** + * Get order items. + * + * @param int $order_id Order ID. + * @param int $order_item_id Order item ID. If not provided it will return all order items. + * + * @since 1.2.0 + * @return array + */ +function wcsn_get_order_line_items_data( $order_id, $order_item_id = null ) { + // Cache the line items. + $line_items = array(); + $order = wcsn_get_order_object( $order_id ); + $items = $order->get_items(); + if ( is_object( $order ) && count( $items ) > 0 ) { + foreach ( $items as $item_id => $item ) { + $product = $item->get_product(); + if ( ! $product ) { + continue; + } + $product_id = $product->get_id(); + if ( ! wcsn_is_product_enabled( $product_id ) ) { + continue; + } + if ( $order_item_id && absint( $order_item_id ) !== absint( $item_id ) ) { + continue; + } + $quantity = ! empty( $item->get_quantity() ) ? $item->get_quantity() : 0; + $refund_qty = $order->get_qty_refunded_for_item( $item_id ); + // Deprecated filter. + // todo: remove this filter in the future. + $sources = apply_filters( 'wc_serial_numbers_product_serial_source', 'custom_source', $product_id ); + $quantity = $quantity * apply_filters( 'wc_serial_numbers_per_product_delivery_qty', 1, $product_id, $order_id ); + + $data = array( + 'product_id' => $product_id, + 'order_item_id' => ! empty( $item_id ) ? (int) $item_id : 0, + 'refunded_qty' => $refund_qty, + 'quantity' => apply_filters( 'wc_serial_numbers_order_item_quantity', $quantity, $product_id, $order_id ), + 'key_source' => $sources, + ); + + $line_items[] = $data; + } + } + + return apply_filters( 'wc_serial_numbers_order_line_items_data', $line_items, $order_id ); +} + +/** + * Determine if the order contains product that enabled for selling serial numbers. + * + * @param int|WC_Order $order_id Order ID. + * + * @since 1.2.0 + * @return bool True if order contains product that enabled for selling serial numbers, false otherwise. + */ +function wcsn_order_has_products( $order_id ) { + return ! empty( wcsn_get_order_line_items_data( $order_id ) ); +} + +/** + * Get order keys. + * + * @param int $order_id Order ID. + * + * @since 1.0.0 + * @return Key[] + */ +function wcsn_order_get_keys( $order_id ) { + if ( ! wcsn_order_has_products( $order_id ) ) { + return array(); + } + + return Key::query( + array( + 'order_id' => $order_id, + 'limit' => - 1, + ) + ); +} + +/** + * Determine if the order is fullfilled. + * + * @param int $order_id Order ID. + * + * @since 1.2.0 + * @return bool True if order is fullfilled, false otherwise. + */ +function wcsn_order_is_fullfilled( $order_id ) { + if ( ! wcsn_order_has_products( $order_id ) ) { + return true; + } + + $keys = wcsn_order_get_keys( $order_id ); + $line_items = wcsn_get_order_line_items_data( $order_id ); + $total_qty = 0; + foreach ( $line_items as $line_item ) { + $total_qty += $line_item['quantity']; + } + + return count( $keys ) >= $total_qty; +} + +/** + * Order get unfulfilled items. + * + * @param int $order_id Order ID. + * + * @since 1.2.0 + * @return array + */ +function wcsn_order_get_unfulfilled_items( $order_id ) { + if ( ! wcsn_order_has_products( $order_id ) ) { + return array(); + } + + $line_items = wcsn_get_order_line_items_data( $order_id ); + $keys = wcsn_order_get_keys( $order_id ); + $items = array(); + + foreach ( $line_items as $line_item ) { + $qty = $line_item['quantity']; + foreach ( $keys as $key ) { + if ( $key->get_product_id() !== $line_item['product_id'] ) { + continue; + } + // todo uncomment this when we will support for order item id. + + --$qty; + } + if ( $qty > 0 ) { + $items[] = array_merge( $line_item, array( 'quantity' => $qty ) ); + } + } + + return $items; +} + +/** + * Update order keys. + * + * @param int $order_id Order ID. + * + * @since 1.4.6 + * @return void + */ +function wcsn_order_update_keys( $order_id ) { + $order = wcsn_get_order_object( $order_id ); + $customer_id = $order->get_customer_id(); + $line_items = wcsn_get_order_line_items_data( $order ); + $revoke_statues = wcsn_get_revoke_statuses(); + $order_status = $order->get_status( 'edit' ); + if ( empty( $line_items ) ) { + return; + } + + if ( ! apply_filters( 'wc_serial_numbers_update_order_keys', true, $order_id, $line_items, $order_status ) ) { + return; + } + + /** + * Action hook to pre update order keys. + * + * @param int $order_id Order ID. + * @param array $line_items Order line items. + * + * @since 1.4.6 + */ + do_action( 'wc_serial_numbers_pre_update_order_keys', $order_id, $line_items ); + + $do_add = apply_filters( 'wc_serial_numbers_add_order_keys', true, $order_id, $line_items, $order_status ); + + if ( in_array( $order_status, array( 'processing', 'completed' ), true ) && ! wcsn_order_is_fullfilled( $order_id ) && $do_add ) { + + /** + * Action hook to pre add order keys. + * + * @param int $order_id Order ID. + * @param array $line_items Order line items. + * @param string $order_status Order status. + * + * @since 1.4.6 + */ + do_action( 'wc_serial_numbers_pre_add_order_keys', $order_id, $line_items, $order_status ); + $added = 0; + foreach ( $line_items as $k => $item ) { + if ( ! apply_filters( 'wc_serial_numbers_add_order_item_keys', true, $item, $order_id ) ) { + continue; + } + + $delivered_qty = Key::count( + array( + 'order_id' => $order_id, + 'product_id' => $item['product_id'], + 'status__not_in' => array( 'cancelled' ), + ) + ); + if ( $item['refunded_qty'] >= $item['quantity'] ) { + continue; + } + $needed_count = $item['quantity'] - $delivered_qty - $item['refunded_qty']; + if ( $delivered_qty >= $needed_count || empty( $needed_count ) ) { + continue; + } + + /** + * Action hook to pre add keys to order item. + * + * @param array $line_item Order line item. + * @param int $order_id Order ID. + * @param int $needed_count Needed count. + */ + do_action( 'wc_serial_numbers_pre_add_order_item_keys', $item, $order_id, $needed_count ); + + // Deprecated. use wc_serial_numbers_pre_order_add_keys instead. Will be removed in 1.5.0. + apply_filters( 'wc_serial_numbers_pre_order_item_connect_serial_numbers', $item['product_id'], $needed_count, $item['key_source'], $order_id ); + + // Get new keys. + $keys = Key::query( + array( + 'product_id' => $item['product_id'], + 'status' => 'available', + 'limit' => $needed_count, + 'orderby' => 'id', + 'order' => 'ASC', + ) + ); + if ( count( $keys ) < $needed_count ) { + $order->add_order_note( + sprintf( + /* translators: 1: product title 2: source and 3: Quantity */ + esc_html__( 'There is not enough serial numbers for the product %1$s from selected source %2$s, needed total %3$d.', 'wc-serial-numbers' ), + wcsn_get_product_title( $item['product_id'] ), + $item['key_source'], + $needed_count + ), + false + ); + + continue; + } + + // Assign keys to order. + foreach ( $keys as $key ) { + $key->set_data( + array( + 'order_id' => $order_id, + 'order_item_id' => $item['order_item_id'], + 'order_date' => $order->get_date_created() ? $order->get_date_created()->format( 'Y-m-d H:i:s' ) : current_time( 'mysql' ), + 'customer_id' => $customer_id, + 'status' => 'sold', + ) + ); + if ( ! is_wp_error( $key->save() ) ) { + ++$added; + } + } + + /** + * Action hook to post add keys to order item. + * + * @param array $line_item Order line item. + * @param int $order_id Order ID. + * @param int $needed_count Needed count. + */ + do_action( 'wc_serial_numbers_added_order_item_keys', $item, $order_id, $needed_count ); + + // Deprecated. use wc_serial_numbers_pre_order_add_keys instead. Will be removed in 1.5.0. + do_action( 'wc_serial_numbers_order_connect_serial_numbers', $order_id, count( $keys ) ); + } + + if ( $added > 0 ) { + /** + * Action hook to post add order keys. + * + * @param int $order_id Order ID. + * @param array $line_items Order line items. + * @param string $order_status Order status. + * + * @since 1.4.6 + */ + do_action( 'wc_serial_numbers_add_order_keys', $order_id, $line_items, $order_status ); + } + } + + // Revoke keys. + $keys = Key::query( + array( + 'order_id' => $order_id, + 'limit' => - 1, + ) + ); + + foreach ( $keys as $key ) { + $is_expired = $key->is_expired(); + if ( $is_expired && 'expired' !== $key->get_status() ) { + $key->set_status( 'expired' ); + $key->save(); + } elseif ( ! $is_expired && in_array( + $order_status, + array( + 'processing', + 'complete', + ), + true + ) && 'sold' !== $key->get_status() ) { + $key->set_status( 'sold' ); + $key->save(); + } elseif ( 'on-hold' === $order_status && ! $is_expired && 'pending' !== $key->get_status() ) { + $key->set_status( 'pending' ); + $key->save(); + } elseif ( in_array( $order_status, $revoke_statues, true ) && ! $is_expired && apply_filters( 'wc_serial_numbers_revoke_order_item_keys', true, $line_items, $order_id ) ) { + wcsn_order_remove_keys( $order_id ); + } + } + + /** + * Action hook to post add keys to order item. + * + * @param int $order_id Order ID. + * @param array $line_items Order line items. + * + * @since 1.4.6 + */ + do_action( 'wc_serial_numbers_order_update_keys', $order_id, $line_items ); +} + +/** + * Order remove keys. + * + * @param int $order_id Order ID. + * @param int $product_id Product ID. + * + * @since 1.4.6 + * + * @return array|false Array of keys or false if no keys found. + */ +function wcsn_order_remove_keys( $order_id, $product_id = null ) { + $is_reusing = wcsn_is_reusing_keys(); + $args = array( + 'order_id' => $order_id, + 'limit' => - 1, + ); + + if ( ! empty( $product_id ) ) { + $args['product_id'] = $product_id; + } + + $keys = Key::query( $args ); + + if ( ! $keys ) { + return false; + } + + /** + * Action hook to pre revoke keys from order item. + * + * @param int $order_id Order ID. + * @param int $product_id Product ID. + * @param array $keys Order keys. + * + * @since 1.4.6 + */ + do_action( 'wc_serial_numbers_pre_revoke_order_keys', $order_id, $product_id, $keys ); + + foreach ( $keys as $key ) { + $props = array( + 'status' => $is_reusing ? 'available' : 'cancelled', + ); + if ( ! $is_reusing ) { + $props['order_id'] = 0; + $props['order_item_id'] = 0; + $props['order_date'] = null; + } + $key->set_data( $props ); + $key->save(); + } + + /** + * Action hook to post revoke keys from order item. + * + * @param int $order_id Order ID. + * @param int $product_id Product ID. + * @param array $keys Order keys. + * + * @since 1.4.6 + */ + do_action( 'wc_serial_numbers_revoke_order_keys', $order_id, $product_id, $keys ); + + return $keys; +} + +/** + * Replace keys. + * + * @param int $order_id Order ID. + * @param int $product_id Product ID. + * @param int $key_id Key ID. + * + * @since 1.4.7 + * + * @return bool + */ +function wcsn_order_replace_key( $order_id, $product_id = null, $key_id = null ) { + $is_reusing = wcsn_is_reusing_keys(); + $args = array( + 'order_id' => $order_id, + 'limit' => - 1, + 'no_count' => true, + ); + + if ( ! empty( $product_id ) ) { + $args['product_id'] = $product_id; + } + + if ( ! empty( $key_id ) ) { + $args['include'] = $key_id; + } + + $keys = Key::query( $args ); + + if ( ! $keys ) { + return false; + } + + /** + * Action hook to pre replace keys from order item. + * + * @param int $order_id Order ID. + * @param int $product_id Product ID. + * @param array $keys Order keys. + * + * @since 1.4.7 + */ + do_action( 'wc_serial_numbers_pre_replace_order_keys', $order_id, $product_id, $keys ); + + $replaced = 0; + + foreach ( $keys as $key ) { + $props = array( + 'status' => $is_reusing ? 'available' : 'cancelled', + ); + if ( ! $is_reusing ) { + $props['order_id'] = 0; + $props['order_item_id'] = 0; + $props['order_date'] = null; + } + $key->set_data( $props ); + if ( $key->save() ) { + ++$replaced; + } + } + + if ( $replaced > 0 ) { + wcsn_order_update_keys( $order_id ); + + /** + * Action hook to post replace keys from order item. + * + * @param int $order_id Order ID. + * @param int $product_id Product ID. + * @param array $keys Order keys. + * + * @since 1.4.7 + */ + do_action( 'wc_serial_numbers_replace_order_keys', $order_id, $product_id, $keys ); + + return true; + } + + return false; +} + +/** + * Get product title. + * + * @param \WC_Product| int $product Product title. + * + * @since 1.2.0 + * + * @return string + */ +function wcsn_get_product_title( $product ) { + $product = wcsn_get_product_object( $product ); + if ( $product && ! empty( $product->get_id() ) ) { + return sprintf( + '(#%1$s) %2$s', + $product->get_id(), + wp_strip_all_tags( $product->get_formatted_name() ) + ); + } + + return ''; +} + +/** + * Get enabled products query args. + * + * @since 1.4.6 + * + * @return array + */ +function wcsn_get_products_query_args() { + $args = array( + 'post_type' => array( 'product' ), + 'tax_query' => array( // @codingStandardsIgnoreLine + 'relation' => 'OR', + array( + 'taxonomy' => 'product_type', + 'field' => 'slug', + 'terms' => array( 'simple' ), + 'operator' => 'IN', + ), + ), + ); + + return apply_filters( 'wc_serial_numbers_products_query_args', $args ); +} + +/** + * Get enabled products. + * + * @param array $args Query args. + * + * @since 1.4.6 + * @return array|int List of products or number of products. + */ +function wcsn_get_products( $args = array() ) { + $args = wp_parse_args( $args, wcsn_get_products_query_args() ); + if ( empty( $args['meta_query'] ) ) { + $args['meta_query'] = array(); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query + } + $args['meta_query'][] = array( + 'key' => '_is_serial_number', + 'value' => 'yes', + 'compare' => '=', + ); + + $is_count = isset( $args['count'] ) && $args['count']; + unset( $args['count'] ); + $query = new \WP_Query( $args ); + if ( $is_count ) { + return $query->found_posts; + } + + return $query->posts; +} + +/** + * Encrypt serial number. + * + * @param string $key Key. + * + * @since 1.2.0 + * @return false|string + */ +function wcsn_encrypt_key( $key ) { + return Encryption::maybeEncrypt( $key ); +} + +/** + * Decrypt number. + * + * @param string $key Key. + * + * @since 1.2.0 + * @return false|string + */ +function wcsn_decrypt_key( $key ) { + return Encryption::maybeDecrypt( $key ); +} + +/** + * Get product stocks + * + * @param int $stock_limit Stock limit. + * @param bool $force Force. + * + * @since 1.4.6 + * + * @return array + */ +function wcsn_get_stocks_count( $stock_limit = null, $force = true ) { + $transient_key = 'wcsn_products_stock_count'; + $counts = get_transient( $transient_key ); + + if ( $force || false === $counts ) { + $counts = array(); + $post_ids = wcsn_get_products( + array( + 'posts_per_page' => - 1, + 'fields' => 'ids', + 'meta_query' => array( // @codingStandardsIgnoreLine + 'relation' => 'AND', + array( + 'key' => '_serial_key_source', + 'value' => 'custom_source', + 'compare' => '=', + ), + ), + ) + ); + + foreach ( $post_ids as $post_id ) { + $counts[ $post_id ] = wcsn_get_keys( + array( + 'product_id' => $post_id, + 'status' => 'available', + 'count' => true, + ) + ); + } + + set_transient( $transient_key, $counts, 60 * 60 ); + } + if ( $stock_limit > 0 ) { + // get the results where value is equal or less than max. + $counts = array_filter( + $counts, + function ( $value ) use ( $stock_limit ) { + return $value <= $stock_limit; + } + ); + } + + return $counts; +} + +/** + * Get stock of product. + * + * @param int $product_id Product ID. + * + * @since 1.4.6 + * @retun int + */ +function wcsn_get_product_stock( $product_id ) { + $counts = wcsn_get_stocks_count(); + if ( isset( $counts[ $product_id ] ) ) { + return $counts[ $product_id ]; + } + + return 0; +} + +/** + * Get product edit link. + * + * @param int $product_id Product ID. + * + * @since 1.4.8 + * @retun string + */ +function wcsn_get_edit_product_link( $product_id ) { + // If the product is a variation, get the parent product. + + $product = wc_get_product( $product_id ); + if ( $product && $product->is_type( 'variation' ) ) { + $product_id = $product->get_parent_id(); + } + + return get_edit_post_link( $product_id ); +} + +/** + * Is duplicate serial key allowed. + * + * @since 1.4.8 + * @return bool + */ +function wcsn_is_duplicate_key_allowed() { + return apply_filters( 'wc_serial_numbers_allow_duplicate_key', false ); +} + +/** + * Get product link. + * + * @param int $product_id Product ID. + * + * @since 1.4.8 + * @retun string + */ +function wcsn_get_product_link( $product_id ) { + // If the product is a variation, get the parent product. + $product = wc_get_product( $product_id ); + if ( $product && $product->is_type( 'variation' ) ) { + $product_id = $product->get_parent_id(); + } + + return get_permalink( $product_id ); +} + +/** + * Get product display properties. + * + * @param Key $key Key object. + * @param string $context Context. + * + * @since 1.5.6 + * @return array + */ +function wcsn_get_key_display_properties( $key, $context = 'order_details' ) { + if ( empty( $key ) || ! $key instanceof Key ) { + return array(); + } + $properties = array( + 'key' => array( + 'label' => __( 'Key', 'wc-serial-numbers' ), + 'value' => '' . $key->get_key() . '', + 'priority' => 10, + ), + 'activation_email' => array( + 'label' => __( 'Activation Email', 'wc-serial-numbers' ), + 'value' => $key->get_customer_email(), + 'priority' => 20, + ), + 'activation_limit' => array( + 'label' => __( 'Activation Limit', 'wc-serial-numbers' ), + 'value' => ! empty( $key->get_activation_limit() ) ? number_format_i18n( $key->get_activation_limit() ) : __( 'None', 'wc-serial-numbers' ), + 'priority' => 30, + ), + 'activation_count' => array( + 'label' => __( 'Activation Count', 'wc-serial-numbers' ), + 'value' => ! empty( $key->get_activation_count() ) ? number_format_i18n( $key->get_activation_count() ) : __( 'None', 'wc-serial-numbers' ), + 'priority' => 40, + ), + 'expire_date' => array( + 'label' => __( 'Expire Date', 'wc-serial-numbers' ), + 'value' => ! empty( $key->get_expire_date() ) ? $key->get_expire_date() : __( 'Lifetime', 'wc-serial-numbers' ), + 'priority' => 50, + ), + 'status' => array( + 'label' => __( 'Status', 'wc-serial-numbers' ), + 'value' => $key->get_status(), + 'priority' => 100, + ), + ); + + /** + * Filter key properties. + * + * @param array $props Key properties. + * @param Key $key Key object. + * @param string $context Context. + * + * @since 1.4.9 + */ + $properties = apply_filters( 'wc_serial_numbers_display_key_props', $properties, $key, $context ); + + usort( + $properties, + function ( $a, $b ) { + $a_priority = isset( $a['priority'] ) ? $a['priority'] : 10; + $b_priority = isset( $b['priority'] ) ? $b['priority'] : 10; + + return $a_priority - $b_priority; + } + ); + + return $properties; +} diff --git a/trunk/templates/email-stock-notification.php b/trunk/templates/email-stock-notification.php new file mode 100644 index 00000000..47126236 --- /dev/null +++ b/trunk/templates/email-stock-notification.php @@ -0,0 +1,42 @@ + + + + +

    +

    +
      + $stock ) { + $product_id = absint( $product_id ); + if ( ! $product_id ) { + continue; + } + $product = wc_get_product( $product_id ); + + printf( "
    • %s - Stock %s
    • ", esc_url( get_edit_post_link( $product->get_id() ) ), esc_html( $product->get_formatted_name() ), esc_html( $stock ) ); + } + ?> +
    + +
    +
    +

    + Serial Numbers for WooCommerce', 'wc-serial-numbers' ), + 'https://pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=serialnumberemail&utm_medium=email&utm_campaign=lowstocknotification' + ) + ); + ?> +

    diff --git a/trunk/uninstall.php b/trunk/uninstall.php new file mode 100644 index 00000000..1a4873ef --- /dev/null +++ b/trunk/uninstall.php @@ -0,0 +1,11 @@ +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/coenjacobs/mozart/bin/mozart'); + } +} + +return include __DIR__ . '/..'.'/coenjacobs/mozart/bin/mozart'; diff --git a/trunk/vendor/bin/phpcbf b/trunk/vendor/bin/phpcbf new file mode 100755 index 00000000..1c0c79c4 --- /dev/null +++ b/trunk/vendor/bin/phpcbf @@ -0,0 +1,119 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'); + } +} + +return include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'; diff --git a/trunk/vendor/bin/phpcs b/trunk/vendor/bin/phpcs new file mode 100755 index 00000000..04e658cf --- /dev/null +++ b/trunk/vendor/bin/phpcs @@ -0,0 +1,119 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'); + } +} + +return include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'; diff --git a/trunk/vendor/byteever/byteever-sniffs/renovate.json b/trunk/vendor/byteever/byteever-sniffs/renovate.json new file mode 100644 index 00000000..ee8c906b --- /dev/null +++ b/trunk/vendor/byteever/byteever-sniffs/renovate.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "config:base" + ] +} diff --git a/trunk/vendor/byteever/byteever-sniffs/src/ByteEver-Default/ruleset.xml b/trunk/vendor/byteever/byteever-sniffs/src/ByteEver-Default/ruleset.xml new file mode 100644 index 00000000..dc4c80af --- /dev/null +++ b/trunk/vendor/byteever/byteever-sniffs/src/ByteEver-Default/ruleset.xml @@ -0,0 +1,108 @@ + + + A base ruleset that all other ByteEver rules should extend. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + 0 + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + warning + + + + + warning + + + diff --git a/trunk/vendor/coenjacobs/mozart/Dockerfile b/trunk/vendor/coenjacobs/mozart/Dockerfile new file mode 100644 index 00000000..240bd4c5 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/Dockerfile @@ -0,0 +1,17 @@ +FROM composer:2.0.8 + +FROM php:8.0.1-cli-alpine AS base + +FROM base as builder +RUN apk update && apk add git +COPY --from=composer /usr/bin/composer /usr/bin/composer +COPY ./composer.json /mozart/ +WORKDIR /mozart/ +RUN composer install --no-dev -o + +FROM base AS application +RUN mkdir project +WORKDIR /project/ +COPY --from=builder /mozart/ /mozart/ +COPY ./bin/ /mozart/bin/ +COPY ./src/ /mozart/src/ diff --git a/trunk/vendor/coenjacobs/mozart/LICENSE b/trunk/vendor/coenjacobs/mozart/LICENSE new file mode 100644 index 00000000..2f9c2570 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Coen Jacobs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/trunk/vendor/coenjacobs/mozart/bin/mozart b/trunk/vendor/coenjacobs/mozart/bin/mozart new file mode 100755 index 00000000..ef2e21ff --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/bin/mozart @@ -0,0 +1,29 @@ +#!/usr/bin/env php +run(); +}, '0.7.1'); diff --git a/trunk/vendor/coenjacobs/mozart/psalm.xml b/trunk/vendor/coenjacobs/mozart/psalm.xml new file mode 100644 index 00000000..30258a70 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/psalm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php b/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php new file mode 100644 index 00000000..9aa6b218 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php @@ -0,0 +1,9 @@ +files, $value); + } else { + array_push($this->paths, $value); + } + } + } + + /** + * @throws \Exception + * + * @return void + */ + public function getSearchNamespace() + { + throw new \Exception('Classmap autoloaders do not contain a namespace and this method can not be used.'); + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php b/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php new file mode 100644 index 00000000..f8393995 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php @@ -0,0 +1,49 @@ + $value) { + $this->namespace = $key; + array_push($this->paths, $value); + } + } + + /** + * @return string + */ + public function getSearchNamespace() + { + return $this->namespace; + } + + /** + * @return string + */ + public function getNamespacePath() + { + return ''; + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php b/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php new file mode 100644 index 00000000..2a009821 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php @@ -0,0 +1,7 @@ +namespace, '\\'); + } + + /** + * @return string + */ + public function getNamespacePath() + { + return str_replace('\\', DIRECTORY_SEPARATOR, $this->namespace); + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Composer/Package.php b/trunk/vendor/coenjacobs/mozart/src/Composer/Package.php new file mode 100644 index 00000000..78800fe8 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Composer/Package.php @@ -0,0 +1,69 @@ +path = $path; + $this->config = json_decode(file_get_contents($this->path . '/composer.json')); + + if (isset($overrideAutoload)) { + $this->config->autoload = $overrideAutoload; + } + } + + /** + * @return void + */ + public function findAutoloaders() + { + $namespace_autoloaders = array( + 'psr-0' => 'CoenJacobs\Mozart\Composer\Autoload\Psr0', + 'psr-4' => 'CoenJacobs\Mozart\Composer\Autoload\Psr4', + 'classmap' => 'CoenJacobs\Mozart\Composer\Autoload\Classmap', + ); + + if (! isset($this->config->autoload)) { + return; + } + + foreach ($namespace_autoloaders as $key => $value) { + if (! isset($this->config->autoload->$key)) { + continue; + } + + $autoloadConfig = (array)$this->config->autoload->$key; + + /** @var Autoloader $autoloader */ + $autoloader = new $value(); + $autoloader->processConfig($autoloadConfig); + + array_push($this->autoloaders, $autoloader); + } + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Console/Application.php b/trunk/vendor/coenjacobs/mozart/src/Console/Application.php new file mode 100644 index 00000000..caa82dd3 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Console/Application.php @@ -0,0 +1,20 @@ +add($composeCommand); + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php b/trunk/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php new file mode 100644 index 00000000..ced06a51 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php @@ -0,0 +1,243 @@ +setName('compose'); + $this->setDescription('Composes all dependencies as a package inside a WordPress plugin.'); + $this->setHelp(''); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $workingDir = getcwd(); + $this->workingDir = $workingDir; + + $composerFile = $workingDir . DIRECTORY_SEPARATOR. 'composer.json'; + if (!file_exists($composerFile)) { + $output->write('No composer.json found at current directory: ' . $workingDir); + return 1; + } + + $composer = json_decode(file_get_contents($composerFile)); + // If the json was malformed. + if (!is_object($composer)) { + $output->write('Unable to parse composer.json read at: ' . $workingDir); + return 1; + } + + // if `extra` is missing or not an object or if it does not have a `mozart` key which is an object. + if (!isset($composer->extra) || !is_object($composer->extra) + || !isset($composer->extra->mozart) || !is_object($composer->extra->mozart)) { + $output->write('Mozart config not readable in composer.json at extra->mozart'); + return 1; + } + $config = $composer->extra->mozart; + + $config->dep_namespace = preg_replace("/\\\{2,}$/", "\\", "$config->dep_namespace\\"); + + $this->config = $config; + + $require = array(); + if (isset($config->packages) && is_array($config->packages)) { + $require = $config->packages; + } elseif (isset($composer->require) && is_object($composer->require)) { + $require = array_keys(get_object_vars($composer->require)); + } + + $packagesByName = $this->findPackages($require); + $excludedPackagesNames = isset($config->excluded_packages) ? $config->excluded_packages : []; + $packagesToMoveByName = array_diff_key($packagesByName, array_flip($excludedPackagesNames)); + $packages = array_values($packagesToMoveByName); + + foreach ($packages as $package) { + $package->dependencies = array_diff_key($package->dependencies, array_flip($excludedPackagesNames)); + } + + $this->mover = new Mover($workingDir, $config); + $this->replacer = new Replacer($workingDir, $config); + + $this->mover->deleteTargetDirs($packages); + $this->movePackages($packages); + $this->replacePackages($packages); + $this->replaceParentInTree($packages); + $this->replacer->replaceParentClassesInDirectory($this->config->classmap_directory); + + return 0; + } + + /** + * @param $workingDir + * @param $config + * @param array $packages + * + * @return void + */ + protected function movePackages($packages): void + { + foreach ($packages as $package) { + $this->movePackage($package); + } + + $this->mover->deleteEmptyDirs(); + } + + /** + * @param $workingDir + * @param $config + * @param array $packages + * + * @return void + */ + protected function replacePackages($packages): void + { + foreach ($packages as $package) { + $this->replacePackage($package); + } + } + + /** + * Move all the packages over, one by one, starting on the deepest level of dependencies. + * + * @return void + */ + public function movePackage($package): void + { + if (! empty($package->dependencies)) { + foreach ($package->dependencies as $dependency) { + $this->movePackage($dependency); + } + } + + $this->mover->movePackage($package); + } + + /** + * Replace contents of all the packages, one by one, starting on the deepest level of dependencies. + * + * @return void + */ + public function replacePackage($package): void + { + if (! empty($package->dependencies)) { + foreach ($package->dependencies as $dependency) { + $this->replacePackage($dependency); + } + } + + $this->replacer->replacePackage($package); + } + + /** + * Loops through all dependencies and their dependencies and so on... + * will eventually return a list of all packages required by the full tree. + * + * @param ((int|string)|mixed)[] $slugs + * + * @return Package[] + * + * @psalm-return array + */ + private function findPackages(array $slugs): array + { + $packages = []; + + foreach ($slugs as $package_slug) { + $packageDir = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' + . DIRECTORY_SEPARATOR . $package_slug . DIRECTORY_SEPARATOR; + + if (! is_dir($packageDir)) { + continue; + } + + $autoloaders = null; + if (isset($this->config->override_autoload) && isset($this->config->override_autoload->$package_slug)) { + $autoloaders = $this->config->override_autoload->$package_slug; + } + + $package = new Package($packageDir, $autoloaders); + $package->findAutoloaders(); + + $config = json_decode(file_get_contents($packageDir . 'composer.json')); + + $dependencies = []; + if (isset($config->require)) { + $dependencies = array_keys((array)$config->require); + } + + $package->dependencies = $this->findPackages($dependencies); + $packages[$package_slug] = $package; + } + + return $packages; + } + + /** + * Get an array containing all the dependencies and dependencies + * @param Package $package + * @param array $dependencies + * @return array + */ + private function getAllDependenciesOfPackage(Package $package, $dependencies = []): array + { + if (empty($package->dependencies)) { + return $dependencies; + } + + /** @var Package $dependency */ + foreach ($package->dependencies as $dependency) { + $dependencies[] = $dependency; + } + + foreach ($package->dependencies as $dependency) { + $dependencies = $this->getAllDependenciesOfPackage($dependency, $dependencies); + } + + return $dependencies; + } + + /** + * @param array $packages + */ + private function replaceParentInTree(array $packages): void + { + /** @var Package $package */ + foreach ($packages as $package) { + $dependencies = $this->getAllDependenciesOfPackage($package); + + /** @var Package $dependency */ + foreach ($dependencies as $dependency) { + $this->replacer->replaceParentPackage($dependency, $package); + } + + $this->replaceParentInTree($package->dependencies); + } + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Mover.php b/trunk/vendor/coenjacobs/mozart/src/Mover.php new file mode 100644 index 00000000..6106bf6c --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Mover.php @@ -0,0 +1,243 @@ +workingDir = $workingDir; + $this->targetDir = $config->dep_directory; + $this->config = $config; + + $this->filesystem = new Filesystem(new Local($this->workingDir)); + } + + /** + * Create the required `dep_directory` and `classmap_directory` and delete targetDirs of packages about to be moved. + * + * @param Package[] $packages The packages that, in the next step, will be moved. + * + * @return void + */ + public function deleteTargetDirs($packages): void + { + $this->filesystem->createDir($this->config->dep_directory); + + $this->filesystem->createDir($this->config->classmap_directory); + + foreach ($packages as $package) { + $this->deleteDepTargetDirs($package); + } + } + + /** + * Delete the directories about to be used for packages earmarked for Mozart namespacing. + * + * @visibility private to allow recursion through packages and subpackages. + * + * @param Package $package + * + * @return void + */ + private function deleteDepTargetDirs($package): void + { + foreach ($package->autoloaders as $packageAutoloader) { + $autoloaderType = get_class($packageAutoloader); + + switch ($autoloaderType) { + case Psr0::class: + case Psr4::class: + $outputDir = $this->config->dep_directory . $packageAutoloader->namespace; + $outputDir = str_replace('\\', DIRECTORY_SEPARATOR, $outputDir); + $this->filesystem->deleteDir($outputDir); + break; + case Classmap::class: + $outputDir = $this->config->classmap_directory . $package->config->name; + $outputDir = str_replace('\\', DIRECTORY_SEPARATOR, $outputDir); + $this->filesystem->deleteDir($outputDir); + break; + } + } + + foreach ($package->dependencies as $subPackage) { + $this->deleteDepTargetDirs($subPackage); + } + } + + public function deleteEmptyDirs(): void + { + if (count($this->filesystem->listContents($this->config->dep_directory, true)) === 0) { + $this->filesystem->deleteDir($this->config->dep_directory); + } + + if (count($this->filesystem->listContents($this->config->classmap_directory, true)) === 0) { + $this->filesystem->deleteDir($this->config->classmap_directory); + } + } + + /** + * @return void + */ + public function movePackage(Package $package) + { + if (in_array($package->config->name, $this->movedPackages)) { + return; + } + + foreach ($package->autoloaders as $autoloader) { + if ($autoloader instanceof NamespaceAutoloader) { + $finder = new Finder(); + + foreach ($autoloader->paths as $path) { + $source_path = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR + . $package->config->name . DIRECTORY_SEPARATOR . $path; + + $source_path = str_replace('/', DIRECTORY_SEPARATOR, $source_path); + + $finder->files()->in($source_path); + + foreach ($finder as $file) { + $this->moveFile($package, $autoloader, $file, $path); + } + } + } elseif ($autoloader instanceof Classmap) { + $finder = new Finder(); + + $files_to_move = array(); + + foreach ($autoloader->files as $file) { + $source_path = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' + . DIRECTORY_SEPARATOR . $package->config->name; + $finder->files()->name($file)->in($source_path); + + foreach ($finder as $foundFile) { + $filePath = $foundFile->getRealPath(); + $files_to_move[ $filePath ] = $foundFile; + } + } + + $finder = new Finder(); + + foreach ($autoloader->paths as $path) { + $source_path = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' + . DIRECTORY_SEPARATOR . $package->config->name . DIRECTORY_SEPARATOR . $path; + + $finder->files()->in($source_path); + + foreach ($finder as $foundFile) { + $filePath = $foundFile->getRealPath(); + $files_to_move[ $filePath ] = $foundFile; + } + } + + foreach ($files_to_move as $foundFile) { + $this->moveFile($package, $autoloader, $foundFile); + } + } + + if (!in_array($package->config->name, $this->movedPackages)) { + $this->movedPackages[] = $package->config->name; + } + } + + if (!isset($this->config->delete_vendor_directories) || $this->config->delete_vendor_directories === true) { + $this->deletePackageVendorDirectories(); + } + } + + /** + * @param Package $package + * @param Autoloader $autoloader + * @param SplFileInfo $file + * @param string $path + * @return string + */ + public function moveFile(Package $package, $autoloader, $file, $path = '') + { + if ($autoloader instanceof NamespaceAutoloader) { + $namespacePath = $autoloader->getNamespacePath(); + $replaceWith = $this->config->dep_directory . $namespacePath; + $targetFile = str_replace($this->workingDir, $replaceWith, $file->getPathname()); + + $packageVendorPath = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package->config->name + . DIRECTORY_SEPARATOR . $path; + $packageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath); + $targetFile = str_replace($packageVendorPath, '', $targetFile); + } else { + $namespacePath = $package->config->name; + $replaceWith = $this->config->classmap_directory . DIRECTORY_SEPARATOR . $namespacePath; + $targetFile = str_replace($this->workingDir, $replaceWith, $file->getPathname()); + + $packageVendorPath = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package->config->name + . DIRECTORY_SEPARATOR; + $packageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath); + $targetFile = str_replace($packageVendorPath, DIRECTORY_SEPARATOR, $targetFile); + } + + $this->filesystem->copy( + str_replace($this->workingDir, '', $file->getPathname()), + $targetFile + ); + + return $targetFile; + } + + /** + * Deletes all the packages that are moved from the /vendor/ directory to + * prevent packages that are prefixed/namespaced from being used or + * influencing the output of the code. They just need to be gone. + * + * @return void + */ + protected function deletePackageVendorDirectories(): void + { + foreach ($this->movedPackages as $movedPackage) { + $packageDir = 'vendor' . DIRECTORY_SEPARATOR . $movedPackage; + if (!is_dir($packageDir) || is_link($packageDir)) { + continue; + } + + $this->filesystem->deleteDir($packageDir); + + //Delete parent directory too if it became empty + //(because that package was the only one from that vendor) + $parentDir = dirname($packageDir); + if ($this->dirIsEmpty($parentDir)) { + $this->filesystem->deleteDir($parentDir); + } + } + } + + private function dirIsEmpty(string $dir): bool + { + $di = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS); + return iterator_count($di) === 0; + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php b/trunk/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php new file mode 100644 index 00000000..442551e8 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php @@ -0,0 +1,20 @@ +autoloader = $autoloader; + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php b/trunk/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php new file mode 100644 index 00000000..2cc297ed --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php @@ -0,0 +1,64 @@ +classmap_prefix . $matches[1]; + $this->saveReplacedClass($matches[1], $replace); + return str_replace($matches[1], $replace, $matches[0]); + }, + $contents + ); + } + + public function saveReplacedClass($classname, string $replacedName): void + { + $this->replacedClasses[ $classname ] = $replacedName; + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php b/trunk/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php new file mode 100644 index 00000000..711ec086 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php @@ -0,0 +1,43 @@ +autoloader->getSearchNamespace(), '/'); + $dependencyNamespace = preg_quote($this->dep_namespace, '/'); + + return preg_replace_callback( + " + / # Start the pattern + ([^a-zA-Z0-9_\x7f-\xff]) # Match the non-class character before the namespace + ( # Start the namespace matcher + (?dep_namespace . $matches[2]; + }, + $contents + ); + } +} diff --git a/trunk/vendor/coenjacobs/mozart/src/Replace/Replacer.php b/trunk/vendor/coenjacobs/mozart/src/Replace/Replacer.php new file mode 100644 index 00000000..33b1a150 --- /dev/null +++ b/trunk/vendor/coenjacobs/mozart/src/Replace/Replacer.php @@ -0,0 +1,11 @@ +workingDir = $workingDir; + $this->targetDir = $config->dep_directory; + $this->config = $config; + + $this->filesystem = new Filesystem(new Local($this->workingDir)); + } + + public function replacePackage(Package $package): void + { + foreach ($package->autoloaders as $autoloader) { + $this->replacePackageByAutoloader($package, $autoloader); + } + } + + /** + * @param $targetFile + * @param $autoloader + * + * @return void + */ + public function replaceInFile($targetFile, Autoloader $autoloader): void + { + $targetFile = str_replace($this->workingDir, '', $targetFile); + try { + $contents = $this->filesystem->read($targetFile); + } catch (FileNotFoundException $e) { + return; + } + + if (empty($contents) || false === $contents) { + return; + } + + if ($autoloader instanceof NamespaceAutoloader) { + $replacer = new NamespaceReplacer(); + $replacer->dep_namespace = $this->config->dep_namespace; + } else { + $replacer = new ClassmapReplacer(); + $replacer->classmap_prefix = $this->config->classmap_prefix; + } + + $replacer->setAutoloader($autoloader); + $contents = $replacer->replace($contents); + + if ($replacer instanceof ClassmapReplacer) { + $this->replacedClasses = array_merge($this->replacedClasses, $replacer->replacedClasses); + } + + $this->filesystem->put($targetFile, $contents); + } + + /** + * @param Package $package + * @param $autoloader + * + * @return void + */ + public function replacePackageByAutoloader(Package $package, Composer\Autoload\Autoloader $autoloader): void + { + if ($autoloader instanceof NamespaceAutoloader) { + $source_path = $this->workingDir . $this->targetDir + . str_replace('\\', DIRECTORY_SEPARATOR, $autoloader->namespace) + . DIRECTORY_SEPARATOR; + $this->replaceInDirectory($autoloader, $source_path); + } elseif ($autoloader instanceof Classmap) { + $finder = new Finder(); + $source_path = $this->workingDir . $this->config->classmap_directory . DIRECTORY_SEPARATOR + . $package->config->name; + $finder->files()->in($source_path); + + foreach ($finder as $foundFile) { + $targetFile = $foundFile->getRealPath(); + + if ('.php' == substr($targetFile, -4, 4)) { + $this->replaceInFile($targetFile, $autoloader); + } + } + } + } + + /** + * @param $autoloader + * @param $directory + * + * @return void + */ + public function replaceParentClassesInDirectory(string $directory): void + { + if (count($this->replacedClasses)===0) { + return; + } + + $directory = trim($directory, '//'); + $finder = new Finder(); + $finder->files()->in($directory); + + $replacedClasses = $this->replacedClasses; + + foreach ($finder as $file) { + $targetFile = $file->getPathName(); + + if ('.php' == substr($targetFile, -4, 4)) { + try { + $contents = $this->filesystem->read($targetFile); + } catch (FileNotFoundException $e) { + continue; + } + + if (empty($contents) || false === $contents) { + continue; + } + + foreach ($replacedClasses as $original => $replacement) { + $contents = preg_replace_callback( + '/(.*)([^a-zA-Z0-9_\x7f-\xff])'. $original . '([^a-zA-Z0-9_\x7f-\xff])/U', + function ($matches) use ($replacement) { + if (preg_match('/(include|require)/', $matches[0], $output_array)) { + return $matches[0]; + } + return $matches[1] . $matches[2] . $replacement . $matches[3]; + }, + $contents + ); + } + + $this->filesystem->put($targetFile, $contents); + } + } + } + + /** + * @param $autoloader + * @param $directory + * + * @return void + */ + public function replaceInDirectory(NamespaceAutoloader $autoloader, string $directory): void + { + $finder = new Finder(); + $finder->files()->in($directory); + + foreach ($finder as $file) { + $targetFile = $file->getPathName(); + + if ('.php' == substr($targetFile, -4, 4)) { + $this->replaceInFile($targetFile, $autoloader); + } + } + } + + /** + * Replace everything in parent package, based on the dependency package. + * This is done to ensure that package A (which requires package B), is also + * updated with the replacements being made in package B. + * + * @param Package $package + * @param Package $parent + * + * @return void + */ + public function replaceParentPackage(Package $package, Package $parent): void + { + foreach ($parent->autoloaders as $parentAutoloader) { + foreach ($package->autoloaders as $autoloader) { + if ($parentAutoloader instanceof NamespaceAutoloader) { + $namespace = str_replace('\\', DIRECTORY_SEPARATOR, $parentAutoloader->namespace); + $directory = $this->workingDir . $this->config->dep_directory . $namespace + . DIRECTORY_SEPARATOR; + + if ($autoloader instanceof NamespaceAutoloader) { + $this->replaceInDirectory($autoloader, $directory); + } else { + $directory = str_replace($this->workingDir, '', $directory); + $this->replaceParentClassesInDirectory($directory); + } + } else { + $directory = $this->workingDir . $this->config->classmap_directory . $parent->config->name; + + if ($autoloader instanceof NamespaceAutoloader) { + $this->replaceInDirectory($autoloader, $directory); + } else { + $directory = str_replace($this->workingDir, '', $directory); + $this->replaceParentClassesInDirectory($directory); + } + } + } + } + } +} diff --git a/trunk/vendor/composer/ClassLoader.php b/trunk/vendor/composer/ClassLoader.php new file mode 100644 index 00000000..7824d8f7 --- /dev/null +++ b/trunk/vendor/composer/ClassLoader.php @@ -0,0 +1,579 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + + // PSR-4 + /** + * @var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var list + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ + private $prefixesPsr0 = array(); + /** + * @var list + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var array + */ + private $missingClasses = array(); + + /** @var string|null */ + private $apcuPrefix; + + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return list + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return list + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return array Array of classname => path + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + $includeFile = self::$includeFile; + $includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } + + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } +} diff --git a/trunk/vendor/composer/InstalledVersions.php b/trunk/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000..51e734a7 --- /dev/null +++ b/trunk/vendor/composer/InstalledVersions.php @@ -0,0 +1,359 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/trunk/vendor/composer/LICENSE b/trunk/vendor/composer/LICENSE new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/trunk/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/trunk/vendor/composer/autoload_classmap.php b/trunk/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..4ddc75d4 --- /dev/null +++ b/trunk/vendor/composer/autoload_classmap.php @@ -0,0 +1,323 @@ + $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\Autoloader' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\Classmap' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/Classmap.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\NamespaceAutoloader' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\Psr0' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/Psr0.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\Psr4' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/Psr4.php', + 'CoenJacobs\\Mozart\\Composer\\Package' => $vendorDir . '/coenjacobs/mozart/src/Composer/Package.php', + 'CoenJacobs\\Mozart\\Console\\Application' => $vendorDir . '/coenjacobs/mozart/src/Console/Application.php', + 'CoenJacobs\\Mozart\\Console\\Commands\\Compose' => $vendorDir . '/coenjacobs/mozart/src/Console/Commands/Compose.php', + 'CoenJacobs\\Mozart\\Mover' => $vendorDir . '/coenjacobs/mozart/src/Mover.php', + 'CoenJacobs\\Mozart\\Replace\\BaseReplacer' => $vendorDir . '/coenjacobs/mozart/src/Replace/BaseReplacer.php', + 'CoenJacobs\\Mozart\\Replace\\ClassmapReplacer' => $vendorDir . '/coenjacobs/mozart/src/Replace/ClassmapReplacer.php', + 'CoenJacobs\\Mozart\\Replace\\NamespaceReplacer' => $vendorDir . '/coenjacobs/mozart/src/Replace/NamespaceReplacer.php', + 'CoenJacobs\\Mozart\\Replace\\Replacer' => $vendorDir . '/coenjacobs/mozart/src/Replace/Replacer.php', + 'CoenJacobs\\Mozart\\Replacer' => $vendorDir . '/coenjacobs/mozart/src/Replacer.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin' => $vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php', + 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', + 'League\\Flysystem\\AdapterInterface' => $vendorDir . '/league/flysystem/src/AdapterInterface.php', + 'League\\Flysystem\\Adapter\\AbstractAdapter' => $vendorDir . '/league/flysystem/src/Adapter/AbstractAdapter.php', + 'League\\Flysystem\\Adapter\\AbstractFtpAdapter' => $vendorDir . '/league/flysystem/src/Adapter/AbstractFtpAdapter.php', + 'League\\Flysystem\\Adapter\\CanOverwriteFiles' => $vendorDir . '/league/flysystem/src/Adapter/CanOverwriteFiles.php', + 'League\\Flysystem\\Adapter\\Ftp' => $vendorDir . '/league/flysystem/src/Adapter/Ftp.php', + 'League\\Flysystem\\Adapter\\Ftpd' => $vendorDir . '/league/flysystem/src/Adapter/Ftpd.php', + 'League\\Flysystem\\Adapter\\Local' => $vendorDir . '/league/flysystem/src/Adapter/Local.php', + 'League\\Flysystem\\Adapter\\NullAdapter' => $vendorDir . '/league/flysystem/src/Adapter/NullAdapter.php', + 'League\\Flysystem\\Adapter\\Polyfill\\NotSupportingVisibilityTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php', + 'League\\Flysystem\\Adapter\\Polyfill\\StreamedCopyTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/StreamedCopyTrait.php', + 'League\\Flysystem\\Adapter\\Polyfill\\StreamedReadingTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php', + 'League\\Flysystem\\Adapter\\Polyfill\\StreamedTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php', + 'League\\Flysystem\\Adapter\\Polyfill\\StreamedWritingTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/StreamedWritingTrait.php', + 'League\\Flysystem\\Adapter\\SynologyFtp' => $vendorDir . '/league/flysystem/src/Adapter/SynologyFtp.php', + 'League\\Flysystem\\Config' => $vendorDir . '/league/flysystem/src/Config.php', + 'League\\Flysystem\\ConfigAwareTrait' => $vendorDir . '/league/flysystem/src/ConfigAwareTrait.php', + 'League\\Flysystem\\ConnectionErrorException' => $vendorDir . '/league/flysystem/src/ConnectionErrorException.php', + 'League\\Flysystem\\ConnectionRuntimeException' => $vendorDir . '/league/flysystem/src/ConnectionRuntimeException.php', + 'League\\Flysystem\\CorruptedPathDetected' => $vendorDir . '/league/flysystem/src/CorruptedPathDetected.php', + 'League\\Flysystem\\Directory' => $vendorDir . '/league/flysystem/src/Directory.php', + 'League\\Flysystem\\Exception' => $vendorDir . '/league/flysystem/src/Exception.php', + 'League\\Flysystem\\File' => $vendorDir . '/league/flysystem/src/File.php', + 'League\\Flysystem\\FileExistsException' => $vendorDir . '/league/flysystem/src/FileExistsException.php', + 'League\\Flysystem\\FileNotFoundException' => $vendorDir . '/league/flysystem/src/FileNotFoundException.php', + 'League\\Flysystem\\Filesystem' => $vendorDir . '/league/flysystem/src/Filesystem.php', + 'League\\Flysystem\\FilesystemException' => $vendorDir . '/league/flysystem/src/FilesystemException.php', + 'League\\Flysystem\\FilesystemInterface' => $vendorDir . '/league/flysystem/src/FilesystemInterface.php', + 'League\\Flysystem\\FilesystemNotFoundException' => $vendorDir . '/league/flysystem/src/FilesystemNotFoundException.php', + 'League\\Flysystem\\Handler' => $vendorDir . '/league/flysystem/src/Handler.php', + 'League\\Flysystem\\InvalidRootException' => $vendorDir . '/league/flysystem/src/InvalidRootException.php', + 'League\\Flysystem\\MountManager' => $vendorDir . '/league/flysystem/src/MountManager.php', + 'League\\Flysystem\\NotSupportedException' => $vendorDir . '/league/flysystem/src/NotSupportedException.php', + 'League\\Flysystem\\PluginInterface' => $vendorDir . '/league/flysystem/src/PluginInterface.php', + 'League\\Flysystem\\Plugin\\AbstractPlugin' => $vendorDir . '/league/flysystem/src/Plugin/AbstractPlugin.php', + 'League\\Flysystem\\Plugin\\EmptyDir' => $vendorDir . '/league/flysystem/src/Plugin/EmptyDir.php', + 'League\\Flysystem\\Plugin\\ForcedCopy' => $vendorDir . '/league/flysystem/src/Plugin/ForcedCopy.php', + 'League\\Flysystem\\Plugin\\ForcedRename' => $vendorDir . '/league/flysystem/src/Plugin/ForcedRename.php', + 'League\\Flysystem\\Plugin\\GetWithMetadata' => $vendorDir . '/league/flysystem/src/Plugin/GetWithMetadata.php', + 'League\\Flysystem\\Plugin\\ListFiles' => $vendorDir . '/league/flysystem/src/Plugin/ListFiles.php', + 'League\\Flysystem\\Plugin\\ListPaths' => $vendorDir . '/league/flysystem/src/Plugin/ListPaths.php', + 'League\\Flysystem\\Plugin\\ListWith' => $vendorDir . '/league/flysystem/src/Plugin/ListWith.php', + 'League\\Flysystem\\Plugin\\PluggableTrait' => $vendorDir . '/league/flysystem/src/Plugin/PluggableTrait.php', + 'League\\Flysystem\\Plugin\\PluginNotFoundException' => $vendorDir . '/league/flysystem/src/Plugin/PluginNotFoundException.php', + 'League\\Flysystem\\ReadInterface' => $vendorDir . '/league/flysystem/src/ReadInterface.php', + 'League\\Flysystem\\RootViolationException' => $vendorDir . '/league/flysystem/src/RootViolationException.php', + 'League\\Flysystem\\SafeStorage' => $vendorDir . '/league/flysystem/src/SafeStorage.php', + 'League\\Flysystem\\UnreadableFileException' => $vendorDir . '/league/flysystem/src/UnreadableFileException.php', + 'League\\Flysystem\\Util' => $vendorDir . '/league/flysystem/src/Util.php', + 'League\\Flysystem\\Util\\ContentListingFormatter' => $vendorDir . '/league/flysystem/src/Util/ContentListingFormatter.php', + 'League\\Flysystem\\Util\\MimeType' => $vendorDir . '/league/flysystem/src/Util/MimeType.php', + 'League\\Flysystem\\Util\\StreamHasher' => $vendorDir . '/league/flysystem/src/Util/StreamHasher.php', + 'League\\MimeTypeDetection\\EmptyExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\ExtensionLookup' => $vendorDir . '/league/mime-type-detection/src/ExtensionLookup.php', + 'League\\MimeTypeDetection\\ExtensionMimeTypeDetector' => $vendorDir . '/league/mime-type-detection/src/ExtensionMimeTypeDetector.php', + 'League\\MimeTypeDetection\\ExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/ExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\FinfoMimeTypeDetector' => $vendorDir . '/league/mime-type-detection/src/FinfoMimeTypeDetector.php', + 'League\\MimeTypeDetection\\GeneratedExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\MimeTypeDetector' => $vendorDir . '/league/mime-type-detection/src/MimeTypeDetector.php', + 'League\\MimeTypeDetection\\OverridingExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php', + 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PHPCSUtils\\AbstractSniffs\\AbstractArrayDeclarationSniff' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php', + 'PHPCSUtils\\BackCompat\\BCFile' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php', + 'PHPCSUtils\\BackCompat\\BCTokens' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php', + 'PHPCSUtils\\BackCompat\\Helper' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php', + 'PHPCSUtils\\Exceptions\\InvalidTokenArray' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php', + 'PHPCSUtils\\Exceptions\\TestFileNotFound' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php', + 'PHPCSUtils\\Exceptions\\TestMarkerNotFound' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php', + 'PHPCSUtils\\Exceptions\\TestTargetNotFound' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php', + 'PHPCSUtils\\Fixers\\SpacesFixer' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php', + 'PHPCSUtils\\Internal\\Cache' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php', + 'PHPCSUtils\\Internal\\IsShortArrayOrList' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php', + 'PHPCSUtils\\Internal\\IsShortArrayOrListWithCache' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php', + 'PHPCSUtils\\Internal\\NoFileCache' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php', + 'PHPCSUtils\\Internal\\StableCollections' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php', + 'PHPCSUtils\\TestUtils\\UtilityMethodTestCase' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php', + 'PHPCSUtils\\Tokens\\Collections' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php', + 'PHPCSUtils\\Tokens\\TokenHelper' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php', + 'PHPCSUtils\\Utils\\Arrays' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php', + 'PHPCSUtils\\Utils\\Conditions' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php', + 'PHPCSUtils\\Utils\\Context' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php', + 'PHPCSUtils\\Utils\\ControlStructures' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php', + 'PHPCSUtils\\Utils\\FunctionDeclarations' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php', + 'PHPCSUtils\\Utils\\GetTokensAsString' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php', + 'PHPCSUtils\\Utils\\Lists' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php', + 'PHPCSUtils\\Utils\\MessageHelper' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php', + 'PHPCSUtils\\Utils\\Namespaces' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php', + 'PHPCSUtils\\Utils\\NamingConventions' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php', + 'PHPCSUtils\\Utils\\Numbers' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php', + 'PHPCSUtils\\Utils\\ObjectDeclarations' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php', + 'PHPCSUtils\\Utils\\Operators' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php', + 'PHPCSUtils\\Utils\\Orthography' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php', + 'PHPCSUtils\\Utils\\Parentheses' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php', + 'PHPCSUtils\\Utils\\PassedParameters' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php', + 'PHPCSUtils\\Utils\\Scopes' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php', + 'PHPCSUtils\\Utils\\TextStrings' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php', + 'PHPCSUtils\\Utils\\UseStatements' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php', + 'PHPCSUtils\\Utils\\Variables' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php', + 'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php', + 'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php', + 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', + 'Symfony\\Component\\Console\\Application' => $vendorDir . '/symfony/console/Application.php', + 'Symfony\\Component\\Console\\Attribute\\AsCommand' => $vendorDir . '/symfony/console/Attribute/AsCommand.php', + 'Symfony\\Component\\Console\\CI\\GithubActionReporter' => $vendorDir . '/symfony/console/CI/GithubActionReporter.php', + 'Symfony\\Component\\Console\\Color' => $vendorDir . '/symfony/console/Color.php', + 'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => $vendorDir . '/symfony/console/CommandLoader/CommandLoaderInterface.php', + 'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/ContainerCommandLoader.php', + 'Symfony\\Component\\Console\\CommandLoader\\FactoryCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/FactoryCommandLoader.php', + 'Symfony\\Component\\Console\\Command\\Command' => $vendorDir . '/symfony/console/Command/Command.php', + 'Symfony\\Component\\Console\\Command\\CompleteCommand' => $vendorDir . '/symfony/console/Command/CompleteCommand.php', + 'Symfony\\Component\\Console\\Command\\DumpCompletionCommand' => $vendorDir . '/symfony/console/Command/DumpCompletionCommand.php', + 'Symfony\\Component\\Console\\Command\\HelpCommand' => $vendorDir . '/symfony/console/Command/HelpCommand.php', + 'Symfony\\Component\\Console\\Command\\LazyCommand' => $vendorDir . '/symfony/console/Command/LazyCommand.php', + 'Symfony\\Component\\Console\\Command\\ListCommand' => $vendorDir . '/symfony/console/Command/ListCommand.php', + 'Symfony\\Component\\Console\\Command\\LockableTrait' => $vendorDir . '/symfony/console/Command/LockableTrait.php', + 'Symfony\\Component\\Console\\Command\\SignalableCommandInterface' => $vendorDir . '/symfony/console/Command/SignalableCommandInterface.php', + 'Symfony\\Component\\Console\\Completion\\CompletionInput' => $vendorDir . '/symfony/console/Completion/CompletionInput.php', + 'Symfony\\Component\\Console\\Completion\\CompletionSuggestions' => $vendorDir . '/symfony/console/Completion/CompletionSuggestions.php', + 'Symfony\\Component\\Console\\Completion\\Output\\BashCompletionOutput' => $vendorDir . '/symfony/console/Completion/Output/BashCompletionOutput.php', + 'Symfony\\Component\\Console\\Completion\\Output\\CompletionOutputInterface' => $vendorDir . '/symfony/console/Completion/Output/CompletionOutputInterface.php', + 'Symfony\\Component\\Console\\Completion\\Suggestion' => $vendorDir . '/symfony/console/Completion/Suggestion.php', + 'Symfony\\Component\\Console\\ConsoleEvents' => $vendorDir . '/symfony/console/ConsoleEvents.php', + 'Symfony\\Component\\Console\\Cursor' => $vendorDir . '/symfony/console/Cursor.php', + 'Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => $vendorDir . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php', + 'Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => $vendorDir . '/symfony/console/Descriptor/ApplicationDescription.php', + 'Symfony\\Component\\Console\\Descriptor\\Descriptor' => $vendorDir . '/symfony/console/Descriptor/Descriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => $vendorDir . '/symfony/console/Descriptor/DescriptorInterface.php', + 'Symfony\\Component\\Console\\Descriptor\\JsonDescriptor' => $vendorDir . '/symfony/console/Descriptor/JsonDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => $vendorDir . '/symfony/console/Descriptor/MarkdownDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => $vendorDir . '/symfony/console/Descriptor/TextDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => $vendorDir . '/symfony/console/Descriptor/XmlDescriptor.php', + 'Symfony\\Component\\Console\\EventListener\\ErrorListener' => $vendorDir . '/symfony/console/EventListener/ErrorListener.php', + 'Symfony\\Component\\Console\\Event\\ConsoleCommandEvent' => $vendorDir . '/symfony/console/Event/ConsoleCommandEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleErrorEvent' => $vendorDir . '/symfony/console/Event/ConsoleErrorEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleEvent' => $vendorDir . '/symfony/console/Event/ConsoleEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleSignalEvent' => $vendorDir . '/symfony/console/Event/ConsoleSignalEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => $vendorDir . '/symfony/console/Event/ConsoleTerminateEvent.php', + 'Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => $vendorDir . '/symfony/console/Exception/CommandNotFoundException.php', + 'Symfony\\Component\\Console\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/console/Exception/ExceptionInterface.php', + 'Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/console/Exception/InvalidArgumentException.php', + 'Symfony\\Component\\Console\\Exception\\InvalidOptionException' => $vendorDir . '/symfony/console/Exception/InvalidOptionException.php', + 'Symfony\\Component\\Console\\Exception\\LogicException' => $vendorDir . '/symfony/console/Exception/LogicException.php', + 'Symfony\\Component\\Console\\Exception\\MissingInputException' => $vendorDir . '/symfony/console/Exception/MissingInputException.php', + 'Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => $vendorDir . '/symfony/console/Exception/NamespaceNotFoundException.php', + 'Symfony\\Component\\Console\\Exception\\RuntimeException' => $vendorDir . '/symfony/console/Exception/RuntimeException.php', + 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatter' => $vendorDir . '/symfony/console/Formatter/NullOutputFormatter.php', + 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatterStyle' => $vendorDir . '/symfony/console/Formatter/NullOutputFormatterStyle.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => $vendorDir . '/symfony/console/Formatter/OutputFormatter.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => $vendorDir . '/symfony/console/Formatter/OutputFormatterInterface.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyle.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyleInterface.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyleStack.php', + 'Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' => $vendorDir . '/symfony/console/Formatter/WrappableOutputFormatterInterface.php', + 'Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => $vendorDir . '/symfony/console/Helper/DebugFormatterHelper.php', + 'Symfony\\Component\\Console\\Helper\\DescriptorHelper' => $vendorDir . '/symfony/console/Helper/DescriptorHelper.php', + 'Symfony\\Component\\Console\\Helper\\Dumper' => $vendorDir . '/symfony/console/Helper/Dumper.php', + 'Symfony\\Component\\Console\\Helper\\FormatterHelper' => $vendorDir . '/symfony/console/Helper/FormatterHelper.php', + 'Symfony\\Component\\Console\\Helper\\Helper' => $vendorDir . '/symfony/console/Helper/Helper.php', + 'Symfony\\Component\\Console\\Helper\\HelperInterface' => $vendorDir . '/symfony/console/Helper/HelperInterface.php', + 'Symfony\\Component\\Console\\Helper\\HelperSet' => $vendorDir . '/symfony/console/Helper/HelperSet.php', + 'Symfony\\Component\\Console\\Helper\\InputAwareHelper' => $vendorDir . '/symfony/console/Helper/InputAwareHelper.php', + 'Symfony\\Component\\Console\\Helper\\ProcessHelper' => $vendorDir . '/symfony/console/Helper/ProcessHelper.php', + 'Symfony\\Component\\Console\\Helper\\ProgressBar' => $vendorDir . '/symfony/console/Helper/ProgressBar.php', + 'Symfony\\Component\\Console\\Helper\\ProgressIndicator' => $vendorDir . '/symfony/console/Helper/ProgressIndicator.php', + 'Symfony\\Component\\Console\\Helper\\QuestionHelper' => $vendorDir . '/symfony/console/Helper/QuestionHelper.php', + 'Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => $vendorDir . '/symfony/console/Helper/SymfonyQuestionHelper.php', + 'Symfony\\Component\\Console\\Helper\\Table' => $vendorDir . '/symfony/console/Helper/Table.php', + 'Symfony\\Component\\Console\\Helper\\TableCell' => $vendorDir . '/symfony/console/Helper/TableCell.php', + 'Symfony\\Component\\Console\\Helper\\TableCellStyle' => $vendorDir . '/symfony/console/Helper/TableCellStyle.php', + 'Symfony\\Component\\Console\\Helper\\TableRows' => $vendorDir . '/symfony/console/Helper/TableRows.php', + 'Symfony\\Component\\Console\\Helper\\TableSeparator' => $vendorDir . '/symfony/console/Helper/TableSeparator.php', + 'Symfony\\Component\\Console\\Helper\\TableStyle' => $vendorDir . '/symfony/console/Helper/TableStyle.php', + 'Symfony\\Component\\Console\\Input\\ArgvInput' => $vendorDir . '/symfony/console/Input/ArgvInput.php', + 'Symfony\\Component\\Console\\Input\\ArrayInput' => $vendorDir . '/symfony/console/Input/ArrayInput.php', + 'Symfony\\Component\\Console\\Input\\Input' => $vendorDir . '/symfony/console/Input/Input.php', + 'Symfony\\Component\\Console\\Input\\InputArgument' => $vendorDir . '/symfony/console/Input/InputArgument.php', + 'Symfony\\Component\\Console\\Input\\InputAwareInterface' => $vendorDir . '/symfony/console/Input/InputAwareInterface.php', + 'Symfony\\Component\\Console\\Input\\InputDefinition' => $vendorDir . '/symfony/console/Input/InputDefinition.php', + 'Symfony\\Component\\Console\\Input\\InputInterface' => $vendorDir . '/symfony/console/Input/InputInterface.php', + 'Symfony\\Component\\Console\\Input\\InputOption' => $vendorDir . '/symfony/console/Input/InputOption.php', + 'Symfony\\Component\\Console\\Input\\StreamableInputInterface' => $vendorDir . '/symfony/console/Input/StreamableInputInterface.php', + 'Symfony\\Component\\Console\\Input\\StringInput' => $vendorDir . '/symfony/console/Input/StringInput.php', + 'Symfony\\Component\\Console\\Logger\\ConsoleLogger' => $vendorDir . '/symfony/console/Logger/ConsoleLogger.php', + 'Symfony\\Component\\Console\\Output\\BufferedOutput' => $vendorDir . '/symfony/console/Output/BufferedOutput.php', + 'Symfony\\Component\\Console\\Output\\ConsoleOutput' => $vendorDir . '/symfony/console/Output/ConsoleOutput.php', + 'Symfony\\Component\\Console\\Output\\ConsoleOutputInterface' => $vendorDir . '/symfony/console/Output/ConsoleOutputInterface.php', + 'Symfony\\Component\\Console\\Output\\ConsoleSectionOutput' => $vendorDir . '/symfony/console/Output/ConsoleSectionOutput.php', + 'Symfony\\Component\\Console\\Output\\NullOutput' => $vendorDir . '/symfony/console/Output/NullOutput.php', + 'Symfony\\Component\\Console\\Output\\Output' => $vendorDir . '/symfony/console/Output/Output.php', + 'Symfony\\Component\\Console\\Output\\OutputInterface' => $vendorDir . '/symfony/console/Output/OutputInterface.php', + 'Symfony\\Component\\Console\\Output\\StreamOutput' => $vendorDir . '/symfony/console/Output/StreamOutput.php', + 'Symfony\\Component\\Console\\Output\\TrimmedBufferOutput' => $vendorDir . '/symfony/console/Output/TrimmedBufferOutput.php', + 'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => $vendorDir . '/symfony/console/Question/ChoiceQuestion.php', + 'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => $vendorDir . '/symfony/console/Question/ConfirmationQuestion.php', + 'Symfony\\Component\\Console\\Question\\Question' => $vendorDir . '/symfony/console/Question/Question.php', + 'Symfony\\Component\\Console\\SignalRegistry\\SignalRegistry' => $vendorDir . '/symfony/console/SignalRegistry/SignalRegistry.php', + 'Symfony\\Component\\Console\\SingleCommandApplication' => $vendorDir . '/symfony/console/SingleCommandApplication.php', + 'Symfony\\Component\\Console\\Style\\OutputStyle' => $vendorDir . '/symfony/console/Style/OutputStyle.php', + 'Symfony\\Component\\Console\\Style\\StyleInterface' => $vendorDir . '/symfony/console/Style/StyleInterface.php', + 'Symfony\\Component\\Console\\Style\\SymfonyStyle' => $vendorDir . '/symfony/console/Style/SymfonyStyle.php', + 'Symfony\\Component\\Console\\Terminal' => $vendorDir . '/symfony/console/Terminal.php', + 'Symfony\\Component\\Console\\Tester\\ApplicationTester' => $vendorDir . '/symfony/console/Tester/ApplicationTester.php', + 'Symfony\\Component\\Console\\Tester\\CommandCompletionTester' => $vendorDir . '/symfony/console/Tester/CommandCompletionTester.php', + 'Symfony\\Component\\Console\\Tester\\CommandTester' => $vendorDir . '/symfony/console/Tester/CommandTester.php', + 'Symfony\\Component\\Console\\Tester\\Constraint\\CommandIsSuccessful' => $vendorDir . '/symfony/console/Tester/Constraint/CommandIsSuccessful.php', + 'Symfony\\Component\\Console\\Tester\\TesterTrait' => $vendorDir . '/symfony/console/Tester/TesterTrait.php', + 'Symfony\\Component\\Finder\\Comparator\\Comparator' => $vendorDir . '/symfony/finder/Comparator/Comparator.php', + 'Symfony\\Component\\Finder\\Comparator\\DateComparator' => $vendorDir . '/symfony/finder/Comparator/DateComparator.php', + 'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => $vendorDir . '/symfony/finder/Comparator/NumberComparator.php', + 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => $vendorDir . '/symfony/finder/Exception/AccessDeniedException.php', + 'Symfony\\Component\\Finder\\Exception\\DirectoryNotFoundException' => $vendorDir . '/symfony/finder/Exception/DirectoryNotFoundException.php', + 'Symfony\\Component\\Finder\\Finder' => $vendorDir . '/symfony/finder/Finder.php', + 'Symfony\\Component\\Finder\\Gitignore' => $vendorDir . '/symfony/finder/Gitignore.php', + 'Symfony\\Component\\Finder\\Glob' => $vendorDir . '/symfony/finder/Glob.php', + 'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => $vendorDir . '/symfony/finder/Iterator/CustomFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DateRangeFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\DepthRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DepthRangeFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator' => $vendorDir . '/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FileTypeFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilecontentFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilenameFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\LazyIterator' => $vendorDir . '/symfony/finder/Iterator/LazyIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' => $vendorDir . '/symfony/finder/Iterator/MultiplePcreFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\PathFilterIterator' => $vendorDir . '/symfony/finder/Iterator/PathFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => $vendorDir . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\SizeRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/SizeRangeFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\SortableIterator' => $vendorDir . '/symfony/finder/Iterator/SortableIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\VcsIgnoredFilterIterator' => $vendorDir . '/symfony/finder/Iterator/VcsIgnoredFilterIterator.php', + 'Symfony\\Component\\Finder\\SplFileInfo' => $vendorDir . '/symfony/finder/SplFileInfo.php', + 'Symfony\\Component\\String\\AbstractString' => $vendorDir . '/symfony/string/AbstractString.php', + 'Symfony\\Component\\String\\AbstractUnicodeString' => $vendorDir . '/symfony/string/AbstractUnicodeString.php', + 'Symfony\\Component\\String\\ByteString' => $vendorDir . '/symfony/string/ByteString.php', + 'Symfony\\Component\\String\\CodePointString' => $vendorDir . '/symfony/string/CodePointString.php', + 'Symfony\\Component\\String\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/string/Exception/ExceptionInterface.php', + 'Symfony\\Component\\String\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/string/Exception/InvalidArgumentException.php', + 'Symfony\\Component\\String\\Exception\\RuntimeException' => $vendorDir . '/symfony/string/Exception/RuntimeException.php', + 'Symfony\\Component\\String\\Inflector\\EnglishInflector' => $vendorDir . '/symfony/string/Inflector/EnglishInflector.php', + 'Symfony\\Component\\String\\Inflector\\FrenchInflector' => $vendorDir . '/symfony/string/Inflector/FrenchInflector.php', + 'Symfony\\Component\\String\\Inflector\\InflectorInterface' => $vendorDir . '/symfony/string/Inflector/InflectorInterface.php', + 'Symfony\\Component\\String\\LazyString' => $vendorDir . '/symfony/string/LazyString.php', + 'Symfony\\Component\\String\\Slugger\\AsciiSlugger' => $vendorDir . '/symfony/string/Slugger/AsciiSlugger.php', + 'Symfony\\Component\\String\\Slugger\\SluggerInterface' => $vendorDir . '/symfony/string/Slugger/SluggerInterface.php', + 'Symfony\\Component\\String\\UnicodeString' => $vendorDir . '/symfony/string/UnicodeString.php', + 'Symfony\\Contracts\\Service\\Attribute\\Required' => $vendorDir . '/symfony/service-contracts/Attribute/Required.php', + 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => $vendorDir . '/symfony/service-contracts/Attribute/SubscribedService.php', + 'Symfony\\Contracts\\Service\\ResetInterface' => $vendorDir . '/symfony/service-contracts/ResetInterface.php', + 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => $vendorDir . '/symfony/service-contracts/ServiceLocatorTrait.php', + 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => $vendorDir . '/symfony/service-contracts/ServiceProviderInterface.php', + 'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberInterface.php', + 'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberTrait.php', + 'Symfony\\Contracts\\Service\\Test\\ServiceLocatorTest' => $vendorDir . '/symfony/service-contracts/Test/ServiceLocatorTest.php', + 'Symfony\\Polyfill\\Ctype\\Ctype' => $vendorDir . '/symfony/polyfill-ctype/Ctype.php', + 'Symfony\\Polyfill\\Intl\\Grapheme\\Grapheme' => $vendorDir . '/symfony/polyfill-intl-grapheme/Grapheme.php', + 'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Normalizer.php', + 'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php', + 'Symfony\\Polyfill\\Php73\\Php73' => $vendorDir . '/symfony/polyfill-php73/Php73.php', + 'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php', + 'Symfony\\Polyfill\\Php80\\PhpToken' => $vendorDir . '/symfony/polyfill-php80/PhpToken.php', + 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', + 'WooCommerceSerialNumbers\\API' => $baseDir . '/src/API.php', + 'WooCommerceSerialNumbers\\Actions' => $baseDir . '/src/Actions.php', + 'WooCommerceSerialNumbers\\Admin\\Actions' => $baseDir . '/src/Admin/Actions.php', + 'WooCommerceSerialNumbers\\Admin\\Admin' => $baseDir . '/src/Admin/Admin.php', + 'WooCommerceSerialNumbers\\Admin\\ListTables\\ActivationsTable' => $baseDir . '/src/Admin/ListTables/ActivationsTable.php', + 'WooCommerceSerialNumbers\\Admin\\ListTables\\KeysTable' => $baseDir . '/src/Admin/ListTables/KeysTable.php', + 'WooCommerceSerialNumbers\\Admin\\ListTables\\ListTable' => $baseDir . '/src/Admin/ListTables/ListTable.php', + 'WooCommerceSerialNumbers\\Admin\\ListTables\\StockTable' => $baseDir . '/src/Admin/ListTables/StockTable.php', + 'WooCommerceSerialNumbers\\Admin\\Menus' => $baseDir . '/src/Admin/Menus.php', + 'WooCommerceSerialNumbers\\Admin\\Metaboxes' => $baseDir . '/src/Admin/Metaboxes.php', + 'WooCommerceSerialNumbers\\Admin\\Notices' => $baseDir . '/src/Admin/Notices.php', + 'WooCommerceSerialNumbers\\Admin\\Orders' => $baseDir . '/src/Admin/Orders.php', + 'WooCommerceSerialNumbers\\Admin\\Products' => $baseDir . '/src/Admin/Products.php', + 'WooCommerceSerialNumbers\\Admin\\Settings' => $baseDir . '/src/Admin/Settings.php', + 'WooCommerceSerialNumbers\\Ajax' => $baseDir . '/src/Ajax.php', + 'WooCommerceSerialNumbers\\Cache' => $baseDir . '/src/Cache.php', + 'WooCommerceSerialNumbers\\Compat' => $baseDir . '/src/Compat.php', + 'WooCommerceSerialNumbers\\Cron' => $baseDir . '/src/Cron.php', + 'WooCommerceSerialNumbers\\Encryption' => $baseDir . '/src/Encryption.php', + 'WooCommerceSerialNumbers\\Frontend\\Frontend' => $baseDir . '/src/Frontend/Frontend.php', + 'WooCommerceSerialNumbers\\Frontend\\Shortcodes' => $baseDir . '/src/Frontend/Shortcodes.php', + 'WooCommerceSerialNumbers\\Installer' => $baseDir . '/src/Installer.php', + 'WooCommerceSerialNumbers\\Lib\\Container' => $baseDir . '/lib/Lib/Container.php', + 'WooCommerceSerialNumbers\\Lib\\Model' => $baseDir . '/lib/Lib/Model.php', + 'WooCommerceSerialNumbers\\Lib\\Plugin' => $baseDir . '/lib/Lib/Plugin.php', + 'WooCommerceSerialNumbers\\Lib\\PluginInterface' => $baseDir . '/lib/Lib/PluginInterface.php', + 'WooCommerceSerialNumbers\\Lib\\Settings' => $baseDir . '/lib/Lib/Settings.php', + 'WooCommerceSerialNumbers\\Models\\Activation' => $baseDir . '/src/Models/Activation.php', + 'WooCommerceSerialNumbers\\Models\\Key' => $baseDir . '/src/Models/Key.php', + 'WooCommerceSerialNumbers\\Models\\Model' => $baseDir . '/src/Models/Model.php', + 'WooCommerceSerialNumbers\\Orders' => $baseDir . '/src/Orders.php', + 'WooCommerceSerialNumbers\\Plugin' => $baseDir . '/src/Plugin.php', + 'WooCommerceSerialNumbers\\RestAPI' => $baseDir . '/src/RestAPI.php', + 'WooCommerceSerialNumbers\\Stocks' => $baseDir . '/src/Stocks.php', + 'WooCommerceSerialNumbers\\Utilities\\Utilities' => $baseDir . '/src/Utilities/Utilities.php', +); diff --git a/trunk/vendor/composer/autoload_files.php b/trunk/vendor/composer/autoload_files.php new file mode 100644 index 00000000..e7095988 --- /dev/null +++ b/trunk/vendor/composer/autoload_files.php @@ -0,0 +1,17 @@ + $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', +); diff --git a/trunk/vendor/composer/autoload_namespaces.php b/trunk/vendor/composer/autoload_namespaces.php new file mode 100644 index 00000000..15a2ff3a --- /dev/null +++ b/trunk/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($baseDir . '/src', $baseDir . '/lib'), + 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), + 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), + 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), + 'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'), + 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), + 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'), + 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'), + 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), + 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), + 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), + 'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'), + 'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'), + 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => array($vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src'), + 'CoenJacobs\\Mozart\\' => array($vendorDir . '/coenjacobs/mozart/src'), +); diff --git a/trunk/vendor/composer/autoload_real.php b/trunk/vendor/composer/autoload_real.php new file mode 100644 index 00000000..0a80273a --- /dev/null +++ b/trunk/vendor/composer/autoload_real.php @@ -0,0 +1,50 @@ +register(true); + + $filesToLoad = \Composer\Autoload\ComposerStaticInit1708bb6e2309c5b3f2b0c1d7ea103daf::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); + } + + return $loader; + } +} diff --git a/trunk/vendor/composer/autoload_static.php b/trunk/vendor/composer/autoload_static.php new file mode 100644 index 00000000..d0745bd8 --- /dev/null +++ b/trunk/vendor/composer/autoload_static.php @@ -0,0 +1,451 @@ + __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', + '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'W' => + array ( + 'WooCommerceSerialNumbers\\' => 25, + ), + 'S' => + array ( + 'Symfony\\Polyfill\\Php80\\' => 23, + 'Symfony\\Polyfill\\Php73\\' => 23, + 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, + 'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31, + 'Symfony\\Polyfill\\Ctype\\' => 23, + 'Symfony\\Contracts\\Service\\' => 26, + 'Symfony\\Component\\String\\' => 25, + 'Symfony\\Component\\Finder\\' => 25, + 'Symfony\\Component\\Console\\' => 26, + ), + 'P' => + array ( + 'Psr\\Container\\' => 14, + ), + 'L' => + array ( + 'League\\MimeTypeDetection\\' => 25, + 'League\\Flysystem\\' => 17, + ), + 'D' => + array ( + 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => 55, + ), + 'C' => + array ( + 'CoenJacobs\\Mozart\\' => 18, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'WooCommerceSerialNumbers\\' => + array ( + 0 => __DIR__ . '/../..' . '/src', + 1 => __DIR__ . '/../..' . '/lib', + ), + 'Symfony\\Polyfill\\Php80\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', + ), + 'Symfony\\Polyfill\\Php73\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', + ), + 'Symfony\\Polyfill\\Mbstring\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', + ), + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', + ), + 'Symfony\\Polyfill\\Intl\\Grapheme\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme', + ), + 'Symfony\\Polyfill\\Ctype\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', + ), + 'Symfony\\Contracts\\Service\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/service-contracts', + ), + 'Symfony\\Component\\String\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/string', + ), + 'Symfony\\Component\\Finder\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/finder', + ), + 'Symfony\\Component\\Console\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/console', + ), + 'Psr\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/container/src', + ), + 'League\\MimeTypeDetection\\' => + array ( + 0 => __DIR__ . '/..' . '/league/mime-type-detection/src', + ), + 'League\\Flysystem\\' => + array ( + 0 => __DIR__ . '/..' . '/league/flysystem/src', + ), + 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => + array ( + 0 => __DIR__ . '/..' . '/dealerdirect/phpcodesniffer-composer-installer/src', + ), + 'CoenJacobs\\Mozart\\' => + array ( + 0 => __DIR__ . '/..' . '/coenjacobs/mozart/src', + ), + ); + + public static $classMap = array ( + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\Autoloader' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\Classmap' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/Classmap.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\NamespaceAutoloader' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\Psr0' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/Psr0.php', + 'CoenJacobs\\Mozart\\Composer\\Autoload\\Psr4' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/Psr4.php', + 'CoenJacobs\\Mozart\\Composer\\Package' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Package.php', + 'CoenJacobs\\Mozart\\Console\\Application' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Console/Application.php', + 'CoenJacobs\\Mozart\\Console\\Commands\\Compose' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Console/Commands/Compose.php', + 'CoenJacobs\\Mozart\\Mover' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Mover.php', + 'CoenJacobs\\Mozart\\Replace\\BaseReplacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replace/BaseReplacer.php', + 'CoenJacobs\\Mozart\\Replace\\ClassmapReplacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replace/ClassmapReplacer.php', + 'CoenJacobs\\Mozart\\Replace\\NamespaceReplacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replace/NamespaceReplacer.php', + 'CoenJacobs\\Mozart\\Replace\\Replacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replace/Replacer.php', + 'CoenJacobs\\Mozart\\Replacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replacer.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin' => __DIR__ . '/..' . '/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php', + 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', + 'League\\Flysystem\\AdapterInterface' => __DIR__ . '/..' . '/league/flysystem/src/AdapterInterface.php', + 'League\\Flysystem\\Adapter\\AbstractAdapter' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/AbstractAdapter.php', + 'League\\Flysystem\\Adapter\\AbstractFtpAdapter' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/AbstractFtpAdapter.php', + 'League\\Flysystem\\Adapter\\CanOverwriteFiles' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/CanOverwriteFiles.php', + 'League\\Flysystem\\Adapter\\Ftp' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Ftp.php', + 'League\\Flysystem\\Adapter\\Ftpd' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Ftpd.php', + 'League\\Flysystem\\Adapter\\Local' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Local.php', + 'League\\Flysystem\\Adapter\\NullAdapter' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/NullAdapter.php', + 'League\\Flysystem\\Adapter\\Polyfill\\NotSupportingVisibilityTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php', + 'League\\Flysystem\\Adapter\\Polyfill\\StreamedCopyTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/StreamedCopyTrait.php', + 'League\\Flysystem\\Adapter\\Polyfill\\StreamedReadingTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php', + 'League\\Flysystem\\Adapter\\Polyfill\\StreamedTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php', + 'League\\Flysystem\\Adapter\\Polyfill\\StreamedWritingTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/StreamedWritingTrait.php', + 'League\\Flysystem\\Adapter\\SynologyFtp' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/SynologyFtp.php', + 'League\\Flysystem\\Config' => __DIR__ . '/..' . '/league/flysystem/src/Config.php', + 'League\\Flysystem\\ConfigAwareTrait' => __DIR__ . '/..' . '/league/flysystem/src/ConfigAwareTrait.php', + 'League\\Flysystem\\ConnectionErrorException' => __DIR__ . '/..' . '/league/flysystem/src/ConnectionErrorException.php', + 'League\\Flysystem\\ConnectionRuntimeException' => __DIR__ . '/..' . '/league/flysystem/src/ConnectionRuntimeException.php', + 'League\\Flysystem\\CorruptedPathDetected' => __DIR__ . '/..' . '/league/flysystem/src/CorruptedPathDetected.php', + 'League\\Flysystem\\Directory' => __DIR__ . '/..' . '/league/flysystem/src/Directory.php', + 'League\\Flysystem\\Exception' => __DIR__ . '/..' . '/league/flysystem/src/Exception.php', + 'League\\Flysystem\\File' => __DIR__ . '/..' . '/league/flysystem/src/File.php', + 'League\\Flysystem\\FileExistsException' => __DIR__ . '/..' . '/league/flysystem/src/FileExistsException.php', + 'League\\Flysystem\\FileNotFoundException' => __DIR__ . '/..' . '/league/flysystem/src/FileNotFoundException.php', + 'League\\Flysystem\\Filesystem' => __DIR__ . '/..' . '/league/flysystem/src/Filesystem.php', + 'League\\Flysystem\\FilesystemException' => __DIR__ . '/..' . '/league/flysystem/src/FilesystemException.php', + 'League\\Flysystem\\FilesystemInterface' => __DIR__ . '/..' . '/league/flysystem/src/FilesystemInterface.php', + 'League\\Flysystem\\FilesystemNotFoundException' => __DIR__ . '/..' . '/league/flysystem/src/FilesystemNotFoundException.php', + 'League\\Flysystem\\Handler' => __DIR__ . '/..' . '/league/flysystem/src/Handler.php', + 'League\\Flysystem\\InvalidRootException' => __DIR__ . '/..' . '/league/flysystem/src/InvalidRootException.php', + 'League\\Flysystem\\MountManager' => __DIR__ . '/..' . '/league/flysystem/src/MountManager.php', + 'League\\Flysystem\\NotSupportedException' => __DIR__ . '/..' . '/league/flysystem/src/NotSupportedException.php', + 'League\\Flysystem\\PluginInterface' => __DIR__ . '/..' . '/league/flysystem/src/PluginInterface.php', + 'League\\Flysystem\\Plugin\\AbstractPlugin' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/AbstractPlugin.php', + 'League\\Flysystem\\Plugin\\EmptyDir' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/EmptyDir.php', + 'League\\Flysystem\\Plugin\\ForcedCopy' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ForcedCopy.php', + 'League\\Flysystem\\Plugin\\ForcedRename' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ForcedRename.php', + 'League\\Flysystem\\Plugin\\GetWithMetadata' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/GetWithMetadata.php', + 'League\\Flysystem\\Plugin\\ListFiles' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ListFiles.php', + 'League\\Flysystem\\Plugin\\ListPaths' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ListPaths.php', + 'League\\Flysystem\\Plugin\\ListWith' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ListWith.php', + 'League\\Flysystem\\Plugin\\PluggableTrait' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/PluggableTrait.php', + 'League\\Flysystem\\Plugin\\PluginNotFoundException' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/PluginNotFoundException.php', + 'League\\Flysystem\\ReadInterface' => __DIR__ . '/..' . '/league/flysystem/src/ReadInterface.php', + 'League\\Flysystem\\RootViolationException' => __DIR__ . '/..' . '/league/flysystem/src/RootViolationException.php', + 'League\\Flysystem\\SafeStorage' => __DIR__ . '/..' . '/league/flysystem/src/SafeStorage.php', + 'League\\Flysystem\\UnreadableFileException' => __DIR__ . '/..' . '/league/flysystem/src/UnreadableFileException.php', + 'League\\Flysystem\\Util' => __DIR__ . '/..' . '/league/flysystem/src/Util.php', + 'League\\Flysystem\\Util\\ContentListingFormatter' => __DIR__ . '/..' . '/league/flysystem/src/Util/ContentListingFormatter.php', + 'League\\Flysystem\\Util\\MimeType' => __DIR__ . '/..' . '/league/flysystem/src/Util/MimeType.php', + 'League\\Flysystem\\Util\\StreamHasher' => __DIR__ . '/..' . '/league/flysystem/src/Util/StreamHasher.php', + 'League\\MimeTypeDetection\\EmptyExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\ExtensionLookup' => __DIR__ . '/..' . '/league/mime-type-detection/src/ExtensionLookup.php', + 'League\\MimeTypeDetection\\ExtensionMimeTypeDetector' => __DIR__ . '/..' . '/league/mime-type-detection/src/ExtensionMimeTypeDetector.php', + 'League\\MimeTypeDetection\\ExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/ExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\FinfoMimeTypeDetector' => __DIR__ . '/..' . '/league/mime-type-detection/src/FinfoMimeTypeDetector.php', + 'League\\MimeTypeDetection\\GeneratedExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\MimeTypeDetector' => __DIR__ . '/..' . '/league/mime-type-detection/src/MimeTypeDetector.php', + 'League\\MimeTypeDetection\\OverridingExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php', + 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PHPCSUtils\\AbstractSniffs\\AbstractArrayDeclarationSniff' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php', + 'PHPCSUtils\\BackCompat\\BCFile' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php', + 'PHPCSUtils\\BackCompat\\BCTokens' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php', + 'PHPCSUtils\\BackCompat\\Helper' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php', + 'PHPCSUtils\\Exceptions\\InvalidTokenArray' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php', + 'PHPCSUtils\\Exceptions\\TestFileNotFound' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php', + 'PHPCSUtils\\Exceptions\\TestMarkerNotFound' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php', + 'PHPCSUtils\\Exceptions\\TestTargetNotFound' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php', + 'PHPCSUtils\\Fixers\\SpacesFixer' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php', + 'PHPCSUtils\\Internal\\Cache' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php', + 'PHPCSUtils\\Internal\\IsShortArrayOrList' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php', + 'PHPCSUtils\\Internal\\IsShortArrayOrListWithCache' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php', + 'PHPCSUtils\\Internal\\NoFileCache' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php', + 'PHPCSUtils\\Internal\\StableCollections' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php', + 'PHPCSUtils\\TestUtils\\UtilityMethodTestCase' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php', + 'PHPCSUtils\\Tokens\\Collections' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php', + 'PHPCSUtils\\Tokens\\TokenHelper' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php', + 'PHPCSUtils\\Utils\\Arrays' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php', + 'PHPCSUtils\\Utils\\Conditions' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php', + 'PHPCSUtils\\Utils\\Context' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php', + 'PHPCSUtils\\Utils\\ControlStructures' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php', + 'PHPCSUtils\\Utils\\FunctionDeclarations' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php', + 'PHPCSUtils\\Utils\\GetTokensAsString' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php', + 'PHPCSUtils\\Utils\\Lists' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php', + 'PHPCSUtils\\Utils\\MessageHelper' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php', + 'PHPCSUtils\\Utils\\Namespaces' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php', + 'PHPCSUtils\\Utils\\NamingConventions' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php', + 'PHPCSUtils\\Utils\\Numbers' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php', + 'PHPCSUtils\\Utils\\ObjectDeclarations' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php', + 'PHPCSUtils\\Utils\\Operators' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php', + 'PHPCSUtils\\Utils\\Orthography' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php', + 'PHPCSUtils\\Utils\\Parentheses' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php', + 'PHPCSUtils\\Utils\\PassedParameters' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php', + 'PHPCSUtils\\Utils\\Scopes' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php', + 'PHPCSUtils\\Utils\\TextStrings' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php', + 'PHPCSUtils\\Utils\\UseStatements' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php', + 'PHPCSUtils\\Utils\\Variables' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php', + 'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php', + 'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php', + 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', + 'Symfony\\Component\\Console\\Application' => __DIR__ . '/..' . '/symfony/console/Application.php', + 'Symfony\\Component\\Console\\Attribute\\AsCommand' => __DIR__ . '/..' . '/symfony/console/Attribute/AsCommand.php', + 'Symfony\\Component\\Console\\CI\\GithubActionReporter' => __DIR__ . '/..' . '/symfony/console/CI/GithubActionReporter.php', + 'Symfony\\Component\\Console\\Color' => __DIR__ . '/..' . '/symfony/console/Color.php', + 'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => __DIR__ . '/..' . '/symfony/console/CommandLoader/CommandLoaderInterface.php', + 'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/ContainerCommandLoader.php', + 'Symfony\\Component\\Console\\CommandLoader\\FactoryCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/FactoryCommandLoader.php', + 'Symfony\\Component\\Console\\Command\\Command' => __DIR__ . '/..' . '/symfony/console/Command/Command.php', + 'Symfony\\Component\\Console\\Command\\CompleteCommand' => __DIR__ . '/..' . '/symfony/console/Command/CompleteCommand.php', + 'Symfony\\Component\\Console\\Command\\DumpCompletionCommand' => __DIR__ . '/..' . '/symfony/console/Command/DumpCompletionCommand.php', + 'Symfony\\Component\\Console\\Command\\HelpCommand' => __DIR__ . '/..' . '/symfony/console/Command/HelpCommand.php', + 'Symfony\\Component\\Console\\Command\\LazyCommand' => __DIR__ . '/..' . '/symfony/console/Command/LazyCommand.php', + 'Symfony\\Component\\Console\\Command\\ListCommand' => __DIR__ . '/..' . '/symfony/console/Command/ListCommand.php', + 'Symfony\\Component\\Console\\Command\\LockableTrait' => __DIR__ . '/..' . '/symfony/console/Command/LockableTrait.php', + 'Symfony\\Component\\Console\\Command\\SignalableCommandInterface' => __DIR__ . '/..' . '/symfony/console/Command/SignalableCommandInterface.php', + 'Symfony\\Component\\Console\\Completion\\CompletionInput' => __DIR__ . '/..' . '/symfony/console/Completion/CompletionInput.php', + 'Symfony\\Component\\Console\\Completion\\CompletionSuggestions' => __DIR__ . '/..' . '/symfony/console/Completion/CompletionSuggestions.php', + 'Symfony\\Component\\Console\\Completion\\Output\\BashCompletionOutput' => __DIR__ . '/..' . '/symfony/console/Completion/Output/BashCompletionOutput.php', + 'Symfony\\Component\\Console\\Completion\\Output\\CompletionOutputInterface' => __DIR__ . '/..' . '/symfony/console/Completion/Output/CompletionOutputInterface.php', + 'Symfony\\Component\\Console\\Completion\\Suggestion' => __DIR__ . '/..' . '/symfony/console/Completion/Suggestion.php', + 'Symfony\\Component\\Console\\ConsoleEvents' => __DIR__ . '/..' . '/symfony/console/ConsoleEvents.php', + 'Symfony\\Component\\Console\\Cursor' => __DIR__ . '/..' . '/symfony/console/Cursor.php', + 'Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => __DIR__ . '/..' . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php', + 'Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => __DIR__ . '/..' . '/symfony/console/Descriptor/ApplicationDescription.php', + 'Symfony\\Component\\Console\\Descriptor\\Descriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/Descriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => __DIR__ . '/..' . '/symfony/console/Descriptor/DescriptorInterface.php', + 'Symfony\\Component\\Console\\Descriptor\\JsonDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/JsonDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/MarkdownDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/TextDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/XmlDescriptor.php', + 'Symfony\\Component\\Console\\EventListener\\ErrorListener' => __DIR__ . '/..' . '/symfony/console/EventListener/ErrorListener.php', + 'Symfony\\Component\\Console\\Event\\ConsoleCommandEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleCommandEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleErrorEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleErrorEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleSignalEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleSignalEvent.php', + 'Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleTerminateEvent.php', + 'Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/CommandNotFoundException.php', + 'Symfony\\Component\\Console\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/console/Exception/ExceptionInterface.php', + 'Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidArgumentException.php', + 'Symfony\\Component\\Console\\Exception\\InvalidOptionException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidOptionException.php', + 'Symfony\\Component\\Console\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/console/Exception/LogicException.php', + 'Symfony\\Component\\Console\\Exception\\MissingInputException' => __DIR__ . '/..' . '/symfony/console/Exception/MissingInputException.php', + 'Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/NamespaceNotFoundException.php', + 'Symfony\\Component\\Console\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/console/Exception/RuntimeException.php', + 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatter' => __DIR__ . '/..' . '/symfony/console/Formatter/NullOutputFormatter.php', + 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatterStyle' => __DIR__ . '/..' . '/symfony/console/Formatter/NullOutputFormatterStyle.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatter.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterInterface.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyle.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyleInterface.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyleStack.php', + 'Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/WrappableOutputFormatterInterface.php', + 'Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DebugFormatterHelper.php', + 'Symfony\\Component\\Console\\Helper\\DescriptorHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DescriptorHelper.php', + 'Symfony\\Component\\Console\\Helper\\Dumper' => __DIR__ . '/..' . '/symfony/console/Helper/Dumper.php', + 'Symfony\\Component\\Console\\Helper\\FormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/FormatterHelper.php', + 'Symfony\\Component\\Console\\Helper\\Helper' => __DIR__ . '/..' . '/symfony/console/Helper/Helper.php', + 'Symfony\\Component\\Console\\Helper\\HelperInterface' => __DIR__ . '/..' . '/symfony/console/Helper/HelperInterface.php', + 'Symfony\\Component\\Console\\Helper\\HelperSet' => __DIR__ . '/..' . '/symfony/console/Helper/HelperSet.php', + 'Symfony\\Component\\Console\\Helper\\InputAwareHelper' => __DIR__ . '/..' . '/symfony/console/Helper/InputAwareHelper.php', + 'Symfony\\Component\\Console\\Helper\\ProcessHelper' => __DIR__ . '/..' . '/symfony/console/Helper/ProcessHelper.php', + 'Symfony\\Component\\Console\\Helper\\ProgressBar' => __DIR__ . '/..' . '/symfony/console/Helper/ProgressBar.php', + 'Symfony\\Component\\Console\\Helper\\ProgressIndicator' => __DIR__ . '/..' . '/symfony/console/Helper/ProgressIndicator.php', + 'Symfony\\Component\\Console\\Helper\\QuestionHelper' => __DIR__ . '/..' . '/symfony/console/Helper/QuestionHelper.php', + 'Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => __DIR__ . '/..' . '/symfony/console/Helper/SymfonyQuestionHelper.php', + 'Symfony\\Component\\Console\\Helper\\Table' => __DIR__ . '/..' . '/symfony/console/Helper/Table.php', + 'Symfony\\Component\\Console\\Helper\\TableCell' => __DIR__ . '/..' . '/symfony/console/Helper/TableCell.php', + 'Symfony\\Component\\Console\\Helper\\TableCellStyle' => __DIR__ . '/..' . '/symfony/console/Helper/TableCellStyle.php', + 'Symfony\\Component\\Console\\Helper\\TableRows' => __DIR__ . '/..' . '/symfony/console/Helper/TableRows.php', + 'Symfony\\Component\\Console\\Helper\\TableSeparator' => __DIR__ . '/..' . '/symfony/console/Helper/TableSeparator.php', + 'Symfony\\Component\\Console\\Helper\\TableStyle' => __DIR__ . '/..' . '/symfony/console/Helper/TableStyle.php', + 'Symfony\\Component\\Console\\Input\\ArgvInput' => __DIR__ . '/..' . '/symfony/console/Input/ArgvInput.php', + 'Symfony\\Component\\Console\\Input\\ArrayInput' => __DIR__ . '/..' . '/symfony/console/Input/ArrayInput.php', + 'Symfony\\Component\\Console\\Input\\Input' => __DIR__ . '/..' . '/symfony/console/Input/Input.php', + 'Symfony\\Component\\Console\\Input\\InputArgument' => __DIR__ . '/..' . '/symfony/console/Input/InputArgument.php', + 'Symfony\\Component\\Console\\Input\\InputAwareInterface' => __DIR__ . '/..' . '/symfony/console/Input/InputAwareInterface.php', + 'Symfony\\Component\\Console\\Input\\InputDefinition' => __DIR__ . '/..' . '/symfony/console/Input/InputDefinition.php', + 'Symfony\\Component\\Console\\Input\\InputInterface' => __DIR__ . '/..' . '/symfony/console/Input/InputInterface.php', + 'Symfony\\Component\\Console\\Input\\InputOption' => __DIR__ . '/..' . '/symfony/console/Input/InputOption.php', + 'Symfony\\Component\\Console\\Input\\StreamableInputInterface' => __DIR__ . '/..' . '/symfony/console/Input/StreamableInputInterface.php', + 'Symfony\\Component\\Console\\Input\\StringInput' => __DIR__ . '/..' . '/symfony/console/Input/StringInput.php', + 'Symfony\\Component\\Console\\Logger\\ConsoleLogger' => __DIR__ . '/..' . '/symfony/console/Logger/ConsoleLogger.php', + 'Symfony\\Component\\Console\\Output\\BufferedOutput' => __DIR__ . '/..' . '/symfony/console/Output/BufferedOutput.php', + 'Symfony\\Component\\Console\\Output\\ConsoleOutput' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleOutput.php', + 'Symfony\\Component\\Console\\Output\\ConsoleOutputInterface' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleOutputInterface.php', + 'Symfony\\Component\\Console\\Output\\ConsoleSectionOutput' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleSectionOutput.php', + 'Symfony\\Component\\Console\\Output\\NullOutput' => __DIR__ . '/..' . '/symfony/console/Output/NullOutput.php', + 'Symfony\\Component\\Console\\Output\\Output' => __DIR__ . '/..' . '/symfony/console/Output/Output.php', + 'Symfony\\Component\\Console\\Output\\OutputInterface' => __DIR__ . '/..' . '/symfony/console/Output/OutputInterface.php', + 'Symfony\\Component\\Console\\Output\\StreamOutput' => __DIR__ . '/..' . '/symfony/console/Output/StreamOutput.php', + 'Symfony\\Component\\Console\\Output\\TrimmedBufferOutput' => __DIR__ . '/..' . '/symfony/console/Output/TrimmedBufferOutput.php', + 'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ChoiceQuestion.php', + 'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ConfirmationQuestion.php', + 'Symfony\\Component\\Console\\Question\\Question' => __DIR__ . '/..' . '/symfony/console/Question/Question.php', + 'Symfony\\Component\\Console\\SignalRegistry\\SignalRegistry' => __DIR__ . '/..' . '/symfony/console/SignalRegistry/SignalRegistry.php', + 'Symfony\\Component\\Console\\SingleCommandApplication' => __DIR__ . '/..' . '/symfony/console/SingleCommandApplication.php', + 'Symfony\\Component\\Console\\Style\\OutputStyle' => __DIR__ . '/..' . '/symfony/console/Style/OutputStyle.php', + 'Symfony\\Component\\Console\\Style\\StyleInterface' => __DIR__ . '/..' . '/symfony/console/Style/StyleInterface.php', + 'Symfony\\Component\\Console\\Style\\SymfonyStyle' => __DIR__ . '/..' . '/symfony/console/Style/SymfonyStyle.php', + 'Symfony\\Component\\Console\\Terminal' => __DIR__ . '/..' . '/symfony/console/Terminal.php', + 'Symfony\\Component\\Console\\Tester\\ApplicationTester' => __DIR__ . '/..' . '/symfony/console/Tester/ApplicationTester.php', + 'Symfony\\Component\\Console\\Tester\\CommandCompletionTester' => __DIR__ . '/..' . '/symfony/console/Tester/CommandCompletionTester.php', + 'Symfony\\Component\\Console\\Tester\\CommandTester' => __DIR__ . '/..' . '/symfony/console/Tester/CommandTester.php', + 'Symfony\\Component\\Console\\Tester\\Constraint\\CommandIsSuccessful' => __DIR__ . '/..' . '/symfony/console/Tester/Constraint/CommandIsSuccessful.php', + 'Symfony\\Component\\Console\\Tester\\TesterTrait' => __DIR__ . '/..' . '/symfony/console/Tester/TesterTrait.php', + 'Symfony\\Component\\Finder\\Comparator\\Comparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/Comparator.php', + 'Symfony\\Component\\Finder\\Comparator\\DateComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/DateComparator.php', + 'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/NumberComparator.php', + 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => __DIR__ . '/..' . '/symfony/finder/Exception/AccessDeniedException.php', + 'Symfony\\Component\\Finder\\Exception\\DirectoryNotFoundException' => __DIR__ . '/..' . '/symfony/finder/Exception/DirectoryNotFoundException.php', + 'Symfony\\Component\\Finder\\Finder' => __DIR__ . '/..' . '/symfony/finder/Finder.php', + 'Symfony\\Component\\Finder\\Gitignore' => __DIR__ . '/..' . '/symfony/finder/Gitignore.php', + 'Symfony\\Component\\Finder\\Glob' => __DIR__ . '/..' . '/symfony/finder/Glob.php', + 'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/CustomFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/DateRangeFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\DepthRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/DepthRangeFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FileTypeFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilecontentFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilenameFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\LazyIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/LazyIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/MultiplePcreFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\PathFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/PathFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\SizeRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/SizeRangeFilterIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\SortableIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/SortableIterator.php', + 'Symfony\\Component\\Finder\\Iterator\\VcsIgnoredFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/VcsIgnoredFilterIterator.php', + 'Symfony\\Component\\Finder\\SplFileInfo' => __DIR__ . '/..' . '/symfony/finder/SplFileInfo.php', + 'Symfony\\Component\\String\\AbstractString' => __DIR__ . '/..' . '/symfony/string/AbstractString.php', + 'Symfony\\Component\\String\\AbstractUnicodeString' => __DIR__ . '/..' . '/symfony/string/AbstractUnicodeString.php', + 'Symfony\\Component\\String\\ByteString' => __DIR__ . '/..' . '/symfony/string/ByteString.php', + 'Symfony\\Component\\String\\CodePointString' => __DIR__ . '/..' . '/symfony/string/CodePointString.php', + 'Symfony\\Component\\String\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/string/Exception/ExceptionInterface.php', + 'Symfony\\Component\\String\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/string/Exception/InvalidArgumentException.php', + 'Symfony\\Component\\String\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/string/Exception/RuntimeException.php', + 'Symfony\\Component\\String\\Inflector\\EnglishInflector' => __DIR__ . '/..' . '/symfony/string/Inflector/EnglishInflector.php', + 'Symfony\\Component\\String\\Inflector\\FrenchInflector' => __DIR__ . '/..' . '/symfony/string/Inflector/FrenchInflector.php', + 'Symfony\\Component\\String\\Inflector\\InflectorInterface' => __DIR__ . '/..' . '/symfony/string/Inflector/InflectorInterface.php', + 'Symfony\\Component\\String\\LazyString' => __DIR__ . '/..' . '/symfony/string/LazyString.php', + 'Symfony\\Component\\String\\Slugger\\AsciiSlugger' => __DIR__ . '/..' . '/symfony/string/Slugger/AsciiSlugger.php', + 'Symfony\\Component\\String\\Slugger\\SluggerInterface' => __DIR__ . '/..' . '/symfony/string/Slugger/SluggerInterface.php', + 'Symfony\\Component\\String\\UnicodeString' => __DIR__ . '/..' . '/symfony/string/UnicodeString.php', + 'Symfony\\Contracts\\Service\\Attribute\\Required' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/Required.php', + 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/SubscribedService.php', + 'Symfony\\Contracts\\Service\\ResetInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ResetInterface.php', + 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceLocatorTrait.php', + 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceProviderInterface.php', + 'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberInterface.php', + 'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberTrait.php', + 'Symfony\\Contracts\\Service\\Test\\ServiceLocatorTest' => __DIR__ . '/..' . '/symfony/service-contracts/Test/ServiceLocatorTest.php', + 'Symfony\\Polyfill\\Ctype\\Ctype' => __DIR__ . '/..' . '/symfony/polyfill-ctype/Ctype.php', + 'Symfony\\Polyfill\\Intl\\Grapheme\\Grapheme' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/Grapheme.php', + 'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Normalizer.php', + 'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php', + 'Symfony\\Polyfill\\Php73\\Php73' => __DIR__ . '/..' . '/symfony/polyfill-php73/Php73.php', + 'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php', + 'Symfony\\Polyfill\\Php80\\PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/PhpToken.php', + 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', + 'WooCommerceSerialNumbers\\API' => __DIR__ . '/../..' . '/src/API.php', + 'WooCommerceSerialNumbers\\Actions' => __DIR__ . '/../..' . '/src/Actions.php', + 'WooCommerceSerialNumbers\\Admin\\Actions' => __DIR__ . '/../..' . '/src/Admin/Actions.php', + 'WooCommerceSerialNumbers\\Admin\\Admin' => __DIR__ . '/../..' . '/src/Admin/Admin.php', + 'WooCommerceSerialNumbers\\Admin\\ListTables\\ActivationsTable' => __DIR__ . '/../..' . '/src/Admin/ListTables/ActivationsTable.php', + 'WooCommerceSerialNumbers\\Admin\\ListTables\\KeysTable' => __DIR__ . '/../..' . '/src/Admin/ListTables/KeysTable.php', + 'WooCommerceSerialNumbers\\Admin\\ListTables\\ListTable' => __DIR__ . '/../..' . '/src/Admin/ListTables/ListTable.php', + 'WooCommerceSerialNumbers\\Admin\\ListTables\\StockTable' => __DIR__ . '/../..' . '/src/Admin/ListTables/StockTable.php', + 'WooCommerceSerialNumbers\\Admin\\Menus' => __DIR__ . '/../..' . '/src/Admin/Menus.php', + 'WooCommerceSerialNumbers\\Admin\\Metaboxes' => __DIR__ . '/../..' . '/src/Admin/Metaboxes.php', + 'WooCommerceSerialNumbers\\Admin\\Notices' => __DIR__ . '/../..' . '/src/Admin/Notices.php', + 'WooCommerceSerialNumbers\\Admin\\Orders' => __DIR__ . '/../..' . '/src/Admin/Orders.php', + 'WooCommerceSerialNumbers\\Admin\\Products' => __DIR__ . '/../..' . '/src/Admin/Products.php', + 'WooCommerceSerialNumbers\\Admin\\Settings' => __DIR__ . '/../..' . '/src/Admin/Settings.php', + 'WooCommerceSerialNumbers\\Ajax' => __DIR__ . '/../..' . '/src/Ajax.php', + 'WooCommerceSerialNumbers\\Cache' => __DIR__ . '/../..' . '/src/Cache.php', + 'WooCommerceSerialNumbers\\Compat' => __DIR__ . '/../..' . '/src/Compat.php', + 'WooCommerceSerialNumbers\\Cron' => __DIR__ . '/../..' . '/src/Cron.php', + 'WooCommerceSerialNumbers\\Encryption' => __DIR__ . '/../..' . '/src/Encryption.php', + 'WooCommerceSerialNumbers\\Frontend\\Frontend' => __DIR__ . '/../..' . '/src/Frontend/Frontend.php', + 'WooCommerceSerialNumbers\\Frontend\\Shortcodes' => __DIR__ . '/../..' . '/src/Frontend/Shortcodes.php', + 'WooCommerceSerialNumbers\\Installer' => __DIR__ . '/../..' . '/src/Installer.php', + 'WooCommerceSerialNumbers\\Lib\\Container' => __DIR__ . '/../..' . '/lib/Lib/Container.php', + 'WooCommerceSerialNumbers\\Lib\\Model' => __DIR__ . '/../..' . '/lib/Lib/Model.php', + 'WooCommerceSerialNumbers\\Lib\\Plugin' => __DIR__ . '/../..' . '/lib/Lib/Plugin.php', + 'WooCommerceSerialNumbers\\Lib\\PluginInterface' => __DIR__ . '/../..' . '/lib/Lib/PluginInterface.php', + 'WooCommerceSerialNumbers\\Lib\\Settings' => __DIR__ . '/../..' . '/lib/Lib/Settings.php', + 'WooCommerceSerialNumbers\\Models\\Activation' => __DIR__ . '/../..' . '/src/Models/Activation.php', + 'WooCommerceSerialNumbers\\Models\\Key' => __DIR__ . '/../..' . '/src/Models/Key.php', + 'WooCommerceSerialNumbers\\Models\\Model' => __DIR__ . '/../..' . '/src/Models/Model.php', + 'WooCommerceSerialNumbers\\Orders' => __DIR__ . '/../..' . '/src/Orders.php', + 'WooCommerceSerialNumbers\\Plugin' => __DIR__ . '/../..' . '/src/Plugin.php', + 'WooCommerceSerialNumbers\\RestAPI' => __DIR__ . '/../..' . '/src/RestAPI.php', + 'WooCommerceSerialNumbers\\Stocks' => __DIR__ . '/../..' . '/src/Stocks.php', + 'WooCommerceSerialNumbers\\Utilities\\Utilities' => __DIR__ . '/../..' . '/src/Utilities/Utilities.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit1708bb6e2309c5b3f2b0c1d7ea103daf::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit1708bb6e2309c5b3f2b0c1d7ea103daf::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit1708bb6e2309c5b3f2b0c1d7ea103daf::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/trunk/vendor/composer/installed.json b/trunk/vendor/composer/installed.json new file mode 100644 index 00000000..cf3fd131 --- /dev/null +++ b/trunk/vendor/composer/installed.json @@ -0,0 +1,2036 @@ +{ + "packages": [ + { + "name": "byteever/byteever-sniffs", + "version": "v1.0.2", + "version_normalized": "1.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/byteever/byteever-sniffs.git", + "reference": "7a62a7c8aa62fcc67a0d19ed0af2df05b103042d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/byteever/byteever-sniffs/zipball/7a62a7c8aa62fcc67a0d19ed0af2df05b103042d", + "reference": "7a62a7c8aa62fcc67a0d19ed0af2df05b103042d", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "phpcompatibility/phpcompatibility-wp": "^2.1", + "wp-coding-standards/wpcs": "^3.1" + }, + "require-dev": { + "roave/security-advisories": "dev-latest" + }, + "time": "2024-06-28T06:59:58+00:00", + "type": "phpcodesniffer-standard", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-only" + ], + "authors": [ + { + "name": "Sultan Nasir Uddin", + "email": "sultan@byteever.com" + } + ], + "description": "ByteEver PHP Coding Standards", + "keywords": [ + "byteever", + "phpcs", + "standards", + "wordpress" + ], + "support": { + "issues": "https://github.com/byteever/byteever-sniffs/issues", + "source": "https://github.com/byteever/byteever-sniffs/tree/v1.0.2" + }, + "install-path": "../byteever/byteever-sniffs" + }, + { + "name": "coenjacobs/mozart", + "version": "0.7.1", + "version_normalized": "0.7.1.0", + "source": { + "type": "git", + "url": "https://github.com/coenjacobs/mozart.git", + "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/dbcdeb992d20d9c8914eef090f9a0d684bb1102c", + "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c", + "shasum": "" + }, + "require": { + "league/flysystem": "^1.0", + "php": "^7.3|^8.0", + "symfony/console": "^4|^5", + "symfony/finder": "^4|^5" + }, + "require-dev": { + "mheap/phpunit-github-actions-printer": "^1.4", + "phpunit/phpunit": "^8.5", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.4" + }, + "time": "2021-02-02T21:37:03+00:00", + "bin": [ + "bin/mozart" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "CoenJacobs\\Mozart\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Coen Jacobs", + "email": "coenjacobs@gmail.com" + } + ], + "description": "Composes all dependencies as a package inside a WordPress plugin", + "support": { + "issues": "https://github.com/coenjacobs/mozart/issues", + "source": "https://github.com/coenjacobs/mozart/tree/0.7.1" + }, + "funding": [ + { + "url": "https://github.com/coenjacobs", + "type": "github" + } + ], + "install-path": "../coenjacobs/mozart" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.2", + "version_normalized": "0.7.2.0", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" + }, + "time": "2022-02-04T12:51:07+00:00", + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "install-path": "../dealerdirect/phpcodesniffer-composer-installer" + }, + { + "name": "league/flysystem", + "version": "1.1.10", + "version_normalized": "1.1.10.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" + }, + "suggest": { + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "time": "2022-10-04T09:16:37+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" + }, + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], + "install-path": "../league/flysystem" + }, + { + "name": "league/mime-type-detection", + "version": "1.15.0", + "version_normalized": "1.15.0.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + }, + "time": "2024-01-28T23:22:08+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "install-path": "../league/mime-type-detection" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "version_normalized": "9.3.5.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "time": "2019-12-27T09:44:58+00:00", + "type": "phpcodesniffer-standard", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "install-path": "../phpcompatibility/php-compatibility" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.3", + "version_normalized": "1.3.3.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "time": "2024-04-24T21:30:46+00:00", + "type": "phpcodesniffer-standard", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "install-path": "../phpcompatibility/phpcompatibility-paragonie" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.5", + "version_normalized": "2.1.5.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "time": "2024-04-24T21:37:59+00:00", + "type": "phpcodesniffer-standard", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "install-path": "../phpcompatibility/phpcompatibility-wp" + }, + { + "name": "phpcsstandards/phpcsextra", + "version": "1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "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 || ^8.0 || ^9.0" + }, + "time": "2023-12-08T16:49:07+00:00", + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + } + ], + "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "standards", + "static analysis" + ], + "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.12", + "version_normalized": "1.0.12.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", + "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.10.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.1.0 || ^2.0.0" + }, + "time": "2024-05-20T13:34:27+00:00", + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "PHPCSUtils/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + } + ], + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "phpcs3", + "standards", + "static analysis", + "tokens", + "utility" + ], + "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": "pluginever/framework-model", + "version": "dev-master", + "version_normalized": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:pluginever/framework-model.git", + "reference": "df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pluginever/framework-model/zipball/df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e", + "reference": "df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "byteever/byteever-sniffs": "dev-master" + }, + "time": "2024-03-10T05:53:38+00:00", + "default-branch": true, + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Lib\\": "src" + } + }, + "scripts": { + "phpcs": [ + "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" + ], + "phpcbf": [ + "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" + ] + }, + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Sultan Nasir Uddin", + "email": "manikdrmc@gmail.com" + } + ], + "description": "Model for the framework", + "support": { + "source": "https://github.com/pluginever/framework-model/tree/v1.0.9", + "issues": "https://github.com/pluginever/framework-model/issues" + }, + "install-path": "../pluginever/framework-model" + }, + { + "name": "pluginever/framework-plugin", + "version": "dev-master", + "version_normalized": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:pluginever/framework-plugin.git", + "reference": "dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pluginever/framework-plugin/zipball/dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0", + "reference": "dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "byteever/byteever-sniffs": "dev-master" + }, + "time": "2023-10-25T08:44:40+00:00", + "default-branch": true, + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Lib\\": "src" + } + }, + "scripts": { + "phpcs": [ + "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" + ], + "phpcbf": [ + "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" + ] + }, + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Sultan Nasir Uddin", + "email": "manikdrmc@gmail.com" + } + ], + "description": "A set of related classes to kick start WordPress plugin development.", + "support": { + "source": "https://github.com/pluginever/framework-plugin/tree/v1.0.8", + "issues": "https://github.com/pluginever/framework-plugin/issues" + }, + "install-path": "../pluginever/framework-plugin" + }, + { + "name": "pluginever/framework-settings", + "version": "dev-master", + "version_normalized": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:pluginever/framework-settings.git", + "reference": "5a1718ada466a9e58a55827d77257ad237c9f0bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pluginever/framework-settings/zipball/5a1718ada466a9e58a55827d77257ad237c9f0bd", + "reference": "5a1718ada466a9e58a55827d77257ad237c9f0bd", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "byteever/byteever-sniffs": "dev-master" + }, + "time": "2024-02-27T06:05:22+00:00", + "default-branch": true, + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Lib\\": "src" + } + }, + "scripts": { + "phpcs": [ + "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" + ], + "phpcbf": [ + "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" + ] + }, + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Sultan Nasir Uddin", + "email": "manikdrmc@gmail.com" + } + ], + "description": "A set of related classes to kick start WordPress plugin development.", + "support": { + "source": "https://github.com/pluginever/framework-settings/tree/v1.0.7", + "issues": "https://github.com/pluginever/framework-settings/issues" + }, + "install-path": "../pluginever/framework-settings" + }, + { + "name": "psr/container", + "version": "2.0.2", + "version_normalized": "2.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "time": "2021-11-05T16:47:00+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "install-path": "../psr/container" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.10.2", + "version_normalized": "3.10.2.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "time": "2024-07-21T23:26:44+00:00", + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "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/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "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" + }, + { + "name": "symfony/console", + "version": "v5.4.42", + "version_normalized": "5.4.42.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "time": "2024-07-26T12:21:55+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.42" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/console" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.2", + "version_normalized": "3.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "time": "2022-01-02T09:55:41+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + }, + { + "name": "symfony/finder", + "version": "v5.4.42", + "version_normalized": "5.4.42.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "0724c51fa067b198e36506d2864e09a52180998a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", + "reference": "0724c51fa067b198e36506d2864e09a52180998a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "time": "2024-07-22T08:53:29+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.42" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/finder" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "time": "2024-05-31T15:07:36+00:00", + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-ctype" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "time": "2024-05-31T15:07:36+00:00", + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-intl-grapheme" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "time": "2024-05-31T15:07:36+00:00", + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-intl-normalizer" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2024-06-19T12:30:46+00:00", + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-mbstring" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2024-05-31T15:07:36+00:00", + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php73" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.30.0", + "version_normalized": "1.30.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2024-05-31T15:07:36+00:00", + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + }, + { + "name": "symfony/service-contracts", + "version": "v3.0.2", + "version_normalized": "3.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66", + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "time": "2022-05-30T19:17:58+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/service-contracts" + }, + { + "name": "symfony/string", + "version": "v6.0.19", + "version_normalized": "6.0.19.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "time": "2023-01-01T08:36:10+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/string" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "3.1.0", + "version_normalized": "3.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-libxml": "*", + "ext-tokenizer": "*", + "ext-xmlreader": "*", + "php": ">=5.4", + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.10", + "squizlabs/php_codesniffer": "^3.9.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.0", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "suggest": { + "ext-iconv": "For improved results", + "ext-mbstring": "For improved results" + }, + "time": "2024-03-25T16:39:00+00:00", + "type": "phpcodesniffer-standard", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" + }, + "funding": [ + { + "url": "https://opencollective.com/php_codesniffer", + "type": "custom" + } + ], + "install-path": "../wp-coding-standards/wpcs" + } + ], + "dev": true, + "dev-package-names": [ + "byteever/byteever-sniffs", + "coenjacobs/mozart", + "dealerdirect/phpcodesniffer-composer-installer", + "league/flysystem", + "league/mime-type-detection", + "phpcompatibility/php-compatibility", + "phpcompatibility/phpcompatibility-paragonie", + "phpcompatibility/phpcompatibility-wp", + "phpcsstandards/phpcsextra", + "phpcsstandards/phpcsutils", + "pluginever/framework-model", + "pluginever/framework-plugin", + "pluginever/framework-settings", + "psr/container", + "squizlabs/php_codesniffer", + "symfony/console", + "symfony/deprecation-contracts", + "symfony/finder", + "symfony/polyfill-ctype", + "symfony/polyfill-intl-grapheme", + "symfony/polyfill-intl-normalizer", + "symfony/polyfill-mbstring", + "symfony/polyfill-php73", + "symfony/polyfill-php80", + "symfony/service-contracts", + "symfony/string", + "wp-coding-standards/wpcs" + ] +} diff --git a/trunk/vendor/composer/installed.php b/trunk/vendor/composer/installed.php new file mode 100644 index 00000000..8d86c747 --- /dev/null +++ b/trunk/vendor/composer/installed.php @@ -0,0 +1,278 @@ + array( + 'name' => 'pluginever/wc-serial-numbers', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => 'da424e6c693e67e72637453ce6b98e48516884ae', + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + 'byteever/byteever-sniffs' => array( + 'pretty_version' => 'v1.0.2', + 'version' => '1.0.2.0', + 'reference' => '7a62a7c8aa62fcc67a0d19ed0af2df05b103042d', + 'type' => 'phpcodesniffer-standard', + 'install_path' => __DIR__ . '/../byteever/byteever-sniffs', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'coenjacobs/mozart' => array( + 'pretty_version' => '0.7.1', + 'version' => '0.7.1.0', + 'reference' => 'dbcdeb992d20d9c8914eef090f9a0d684bb1102c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../coenjacobs/mozart', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'dealerdirect/phpcodesniffer-composer-installer' => array( + 'pretty_version' => 'v0.7.2', + 'version' => '0.7.2.0', + 'reference' => '1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'league/flysystem' => array( + 'pretty_version' => '1.1.10', + 'version' => '1.1.10.0', + 'reference' => '3239285c825c152bcc315fe0e87d6b55f5972ed1', + 'type' => 'library', + 'install_path' => __DIR__ . '/../league/flysystem', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'league/mime-type-detection' => array( + 'pretty_version' => '1.15.0', + 'version' => '1.15.0.0', + 'reference' => 'ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301', + 'type' => 'library', + 'install_path' => __DIR__ . '/../league/mime-type-detection', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpcompatibility/php-compatibility' => array( + 'pretty_version' => '9.3.5', + 'version' => '9.3.5.0', + 'reference' => '9fb324479acf6f39452e0655d2429cc0d3914243', + 'type' => 'phpcodesniffer-standard', + 'install_path' => __DIR__ . '/../phpcompatibility/php-compatibility', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpcompatibility/phpcompatibility-paragonie' => array( + 'pretty_version' => '1.3.3', + 'version' => '1.3.3.0', + 'reference' => '293975b465e0e709b571cbf0c957c6c0a7b9a2ac', + 'type' => 'phpcodesniffer-standard', + 'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-paragonie', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpcompatibility/phpcompatibility-wp' => array( + 'pretty_version' => '2.1.5', + 'version' => '2.1.5.0', + 'reference' => '01c1ff2704a58e46f0cb1ca9d06aee07b3589082', + 'type' => 'phpcodesniffer-standard', + 'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-wp', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpcsstandards/phpcsextra' => array( + 'pretty_version' => '1.2.1', + 'version' => '1.2.1.0', + 'reference' => '11d387c6642b6e4acaf0bd9bf5203b8cca1ec489', + 'type' => 'phpcodesniffer-standard', + 'install_path' => __DIR__ . '/../phpcsstandards/phpcsextra', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'phpcsstandards/phpcsutils' => array( + 'pretty_version' => '1.0.12', + 'version' => '1.0.12.0', + 'reference' => '87b233b00daf83fb70f40c9a28692be017ea7c6c', + 'type' => 'phpcodesniffer-standard', + 'install_path' => __DIR__ . '/../phpcsstandards/phpcsutils', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'pluginever/framework-model' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => 'df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../pluginever/framework-model', + 'aliases' => array( + 0 => '9999999-dev', + ), + 'dev_requirement' => true, + ), + 'pluginever/framework-plugin' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => 'dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../pluginever/framework-plugin', + 'aliases' => array( + 0 => '9999999-dev', + ), + 'dev_requirement' => true, + ), + 'pluginever/framework-settings' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '5a1718ada466a9e58a55827d77257ad237c9f0bd', + 'type' => 'library', + 'install_path' => __DIR__ . '/../pluginever/framework-settings', + 'aliases' => array( + 0 => '9999999-dev', + ), + 'dev_requirement' => true, + ), + 'pluginever/wc-serial-numbers' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => 'da424e6c693e67e72637453ce6b98e48516884ae', + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/container' => array( + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/container', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'psr/log-implementation' => array( + 'dev_requirement' => true, + 'provided' => array( + 0 => '1.0|2.0', + ), + ), + 'squizlabs/php_codesniffer' => array( + 'pretty_version' => '3.10.2', + 'version' => '3.10.2.0', + 'reference' => '86e5f5dd9a840c46810ebe5ff1885581c42a3017', + 'type' => 'library', + 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/console' => array( + 'pretty_version' => 'v5.4.42', + 'version' => '5.4.42.0', + 'reference' => 'cef62396a0477e94fc52e87a17c6e5c32e226b7f', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/console', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v3.0.2', + 'version' => '3.0.2.0', + 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/finder' => array( + 'pretty_version' => 'v5.4.42', + 'version' => '5.4.42.0', + 'reference' => '0724c51fa067b198e36506d2864e09a52180998a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/finder', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-ctype' => array( + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => '0424dff1c58f028c451efff2045f5d92410bd540', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-intl-grapheme' => array( + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => '64647a7c30b2283f5d49b874d84a18fc22054b7a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-intl-normalizer' => array( + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => 'a95281b0be0d9ab48050ebd988b967875cdb9fdb', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-php73' => array( + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => 'ec444d3f3f6505bb28d11afa41e75faadebc10a1', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php73', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.30.0', + 'version' => '1.30.0.0', + 'reference' => '77fa7995ac1b21ab60769b7323d600a991a90433', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/service-contracts' => array( + 'pretty_version' => 'v3.0.2', + 'version' => '3.0.2.0', + 'reference' => 'd78d39c1599bd1188b8e26bb341da52c3c6d8a66', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/service-contracts', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/string' => array( + 'pretty_version' => 'v6.0.19', + 'version' => '6.0.19.0', + 'reference' => 'd9e72497367c23e08bf94176d2be45b00a9d232a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/string', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'wp-coding-standards/wpcs' => array( + 'pretty_version' => '3.1.0', + 'version' => '3.1.0.0', + 'reference' => '9333efcbff231f10dfd9c56bb7b65818b4733ca7', + 'type' => 'phpcodesniffer-standard', + 'install_path' => __DIR__ . '/../wp-coding-standards/wpcs', + 'aliases' => array(), + 'dev_requirement' => true, + ), + ), +); diff --git a/trunk/vendor/composer/platform_check.php b/trunk/vendor/composer/platform_check.php new file mode 100644 index 00000000..580fa960 --- /dev/null +++ b/trunk/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70400)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/CODE_OF_CONDUCT.md b/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..a408703d --- /dev/null +++ b/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/CODE_OF_CONDUCT.md @@ -0,0 +1,129 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md b/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md new file mode 100644 index 00000000..893aafb7 --- /dev/null +++ b/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016-2022 Dealerdirect B.V. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php b/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php new file mode 100644 index 00000000..75653e49 --- /dev/null +++ b/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php @@ -0,0 +1,621 @@ + + */ +class Plugin implements PluginInterface, EventSubscriberInterface +{ + const KEY_MAX_DEPTH = 'phpcodesniffer-search-depth'; + + const MESSAGE_ERROR_WRONG_MAX_DEPTH = + 'The value of "%s" (in the composer.json "extra".section) must be an integer larger then %d, %s given.'; + + const MESSAGE_NOT_INSTALLED = 'PHPCodeSniffer is not installed'; + const MESSAGE_NOTHING_TO_INSTALL = 'Nothing to install or update'; + const MESSAGE_PLUGIN_UNINSTALLED = 'PHPCodeSniffer Composer Installer is uninstalled'; + const MESSAGE_RUNNING_INSTALLER = 'Running PHPCodeSniffer Composer Installer'; + + const PACKAGE_NAME = 'squizlabs/php_codesniffer'; + const PACKAGE_TYPE = 'phpcodesniffer-standard'; + + const PHPCS_CONFIG_REGEX = '`%s:[^\r\n]+`'; + const PHPCS_CONFIG_KEY = 'installed_paths'; + + const PLUGIN_NAME = 'dealerdirect/phpcodesniffer-composer-installer'; + + /** + * @var Composer + */ + private $composer; + + /** + * @var string + */ + private $cwd; + + /** + * @var Filesystem + */ + private $filesystem; + + /** + * @var array + */ + private $installedPaths; + + /** + * @var IOInterface + */ + private $io; + + /** + * @var ProcessExecutor + */ + private $processExecutor; + + /** + * Triggers the plugin's main functionality. + * + * Makes it possible to run the plugin as a custom command. + * + * @param Event $event + * + * @throws \InvalidArgumentException + * @throws \RuntimeException + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + public static function run(Event $event) + { + $io = $event->getIO(); + $composer = $event->getComposer(); + + $instance = new static(); + + $instance->io = $io; + $instance->composer = $composer; + $instance->init(); + $instance->onDependenciesChangedEvent(); + } + + /** + * {@inheritDoc} + * + * @throws \RuntimeException + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + public function activate(Composer $composer, IOInterface $io) + { + $this->composer = $composer; + $this->io = $io; + + $this->init(); + } + + /** + * {@inheritDoc} + */ + public function deactivate(Composer $composer, IOInterface $io) + { + } + + /** + * {@inheritDoc} + */ + public function uninstall(Composer $composer, IOInterface $io) + { + } + + /** + * Prepares the plugin so it's main functionality can be run. + * + * @throws \RuntimeException + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + private function init() + { + $this->cwd = getcwd(); + $this->installedPaths = array(); + + $this->processExecutor = new ProcessExecutor($this->io); + $this->filesystem = new Filesystem($this->processExecutor); + } + + /** + * {@inheritDoc} + */ + public static function getSubscribedEvents() + { + return array( + ScriptEvents::POST_INSTALL_CMD => array( + array('onDependenciesChangedEvent', 0), + ), + ScriptEvents::POST_UPDATE_CMD => array( + array('onDependenciesChangedEvent', 0), + ), + ); + } + + /** + * Entry point for post install and post update events. + * + * @throws \InvalidArgumentException + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + public function onDependenciesChangedEvent() + { + $io = $this->io; + $isVerbose = $io->isVerbose(); + $exitCode = 0; + + if ($isVerbose) { + $io->write(sprintf('%s', self::MESSAGE_RUNNING_INSTALLER)); + } + + if ($this->isPHPCodeSnifferInstalled() === true) { + $this->loadInstalledPaths(); + $installPathCleaned = $this->cleanInstalledPaths(); + $installPathUpdated = $this->updateInstalledPaths(); + + if ($installPathCleaned === true || $installPathUpdated === true) { + $exitCode = $this->saveInstalledPaths(); + } elseif ($isVerbose) { + $io->write(sprintf('%s', self::MESSAGE_NOTHING_TO_INSTALL)); + } + } else { + $pluginPackage = $this + ->composer + ->getRepositoryManager() + ->getLocalRepository() + ->findPackages(self::PLUGIN_NAME) + ; + + $isPluginUninstalled = count($pluginPackage) === 0; + + if ($isPluginUninstalled) { + if ($isVerbose) { + $io->write(sprintf('%s', self::MESSAGE_PLUGIN_UNINSTALLED)); + } + } else { + $exitCode = 1; + if ($isVerbose) { + $io->write(sprintf('%s', self::MESSAGE_NOT_INSTALLED)); + } + } + } + + return $exitCode; + } + + /** + * Load all paths from PHP_CodeSniffer into an array. + * + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + private function loadInstalledPaths() + { + if ($this->isPHPCodeSnifferInstalled() === true) { + $this->processExecutor->execute( + 'phpcs --config-show', + $output, + $this->composer->getConfig()->get('bin-dir') + ); + + $regex = sprintf(self::PHPCS_CONFIG_REGEX, self::PHPCS_CONFIG_KEY); + if (preg_match($regex, $output, $match) === 1) { + $phpcsInstalledPaths = str_replace(self::PHPCS_CONFIG_KEY . ': ', '', $match[0]); + $phpcsInstalledPaths = trim($phpcsInstalledPaths); + + if ($phpcsInstalledPaths !== '') { + $this->installedPaths = explode(',', $phpcsInstalledPaths); + } + } + } + } + + /** + * Save all coding standard paths back into PHP_CodeSniffer + * + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + * + * @return int Exit code. 0 for success, 1 or higher for failure. + */ + private function saveInstalledPaths() + { + // Check if we found installed paths to set. + if (count($this->installedPaths) !== 0) { + sort($this->installedPaths); + $paths = implode(',', $this->installedPaths); + $arguments = array('--config-set', self::PHPCS_CONFIG_KEY, $paths); + $configMessage = sprintf( + 'PHP CodeSniffer Config %s set to %s', + self::PHPCS_CONFIG_KEY, + $paths + ); + } else { + // Delete the installed paths if none were found. + $arguments = array('--config-delete', self::PHPCS_CONFIG_KEY); + $configMessage = sprintf( + 'PHP CodeSniffer Config %s delete', + self::PHPCS_CONFIG_KEY + ); + } + + // Prepare message in case of failure + $failMessage = sprintf( + 'Failed to set PHP CodeSniffer %s Config', + self::PHPCS_CONFIG_KEY + ); + + // Determine the path to the main PHPCS file. + $phpcsPath = $this->getPHPCodeSnifferInstallPath(); + if (file_exists($phpcsPath . '/bin/phpcs') === true) { + // PHPCS 3.x. + $phpcsExecutable = './bin/phpcs'; + } else { + // PHPCS 2.x. + $phpcsExecutable = './scripts/phpcs'; + } + + // Okay, lets rock! + $command = vsprintf( + '%s %s %s', + array( + 'php executable' => $this->getPhpExecCommand(), + 'phpcs executable' => $phpcsExecutable, + 'arguments' => implode(' ', $arguments), + ) + ); + + $exitCode = $this->processExecutor->execute($command, $configResult, $phpcsPath); + if ($exitCode === 0) { + $exitCode = $this->verifySaveSuccess(); + } + + if ($exitCode === 0) { + $this->io->write($configMessage); + } else { + $this->io->write($failMessage); + } + + if ($this->io->isVerbose() && !empty($configResult)) { + $this->io->write(sprintf('%s', $configResult)); + } + + return $exitCode; + } + + /** + * Verify that the paths which were expected to be saved, have been. + * + * @return int Exit code. 0 for success, 1 for failure. + */ + private function verifySaveSuccess() + { + $exitCode = 1; + $expectedPaths = $this->installedPaths; + + // Request the currently set installed paths after the save. + $this->loadInstalledPaths(); + + $registeredPaths = array_intersect($this->installedPaths, $expectedPaths); + $registeredCount = count($registeredPaths); + $expectedCount = count($expectedPaths); + + if ($expectedCount === $registeredCount) { + $exitCode = 0; + } + + if ($exitCode === 1 && $this->io->isVerbose()) { + $verificationMessage = sprintf( + "Paths to external standards found by the plugin: %s\n" + . 'Actual paths registered with PHPCS: %s', + implode(', ', $expectedPaths), + implode(', ', $this->installedPaths) + ); + $this->io->write($verificationMessage); + } + + return $exitCode; + } + + /** + * Get the path to the current PHP version being used. + * + * Duplicate of the same in the EventDispatcher class in Composer itself. + */ + protected function getPhpExecCommand() + { + $finder = new PhpExecutableFinder(); + + $phpPath = $finder->find(false); + + if ($phpPath === false) { + throw new \RuntimeException('Failed to locate PHP binary to execute ' . $phpPath); + } + + $phpArgs = $finder->findArguments(); + $phpArgs = $phpArgs + ? ' ' . implode(' ', $phpArgs) + : '' + ; + + $command = ProcessExecutor::escape($phpPath) . + $phpArgs . + ' -d allow_url_fopen=' . ProcessExecutor::escape(ini_get('allow_url_fopen')) . + ' -d disable_functions=' . ProcessExecutor::escape(ini_get('disable_functions')) . + ' -d memory_limit=' . ProcessExecutor::escape(ini_get('memory_limit')) + ; + + return $command; + } + + /** + * Iterate trough all known paths and check if they are still valid. + * + * If path does not exists, is not an directory or isn't readable, the path + * is removed from the list. + * + * @return bool True if changes where made, false otherwise + */ + private function cleanInstalledPaths() + { + $changes = false; + foreach ($this->installedPaths as $key => $path) { + // This might be a relative path as well + $alternativePath = realpath($this->getPHPCodeSnifferInstallPath() . \DIRECTORY_SEPARATOR . $path); + + if ( + (is_dir($path) === false || is_readable($path) === false) && + ( + $alternativePath === false || + is_dir($alternativePath) === false || + is_readable($alternativePath) === false + ) + ) { + unset($this->installedPaths[$key]); + $changes = true; + } + } + return $changes; + } + + /** + * Check all installed packages (including the root package) against + * the installed paths from PHP_CodeSniffer and add the missing ones. + * + * @return bool True if changes where made, false otherwise + * + * @throws \InvalidArgumentException + * @throws \RuntimeException + */ + private function updateInstalledPaths() + { + $changes = false; + + $searchPaths = array($this->cwd); + $codingStandardPackages = $this->getPHPCodingStandardPackages(); + foreach ($codingStandardPackages as $package) { + $installPath = $this->composer->getInstallationManager()->getInstallPath($package); + if ($this->filesystem->isAbsolutePath($installPath) === false) { + $installPath = $this->filesystem->normalizePath( + $this->cwd . \DIRECTORY_SEPARATOR . $installPath + ); + } + $searchPaths[] = $installPath; + } + + $finder = new Finder(); + $finder->files() + ->depth('<= ' . $this->getMaxDepth()) + ->depth('>= ' . $this->getMinDepth()) + ->ignoreUnreadableDirs() + ->ignoreVCS(true) + ->in($searchPaths) + ->name('ruleset.xml'); + + // Process each found possible ruleset. + foreach ($finder as $ruleset) { + $standardsPath = $ruleset->getPath(); + + // Pick the directory above the directory containing the standard, unless this is the project root. + if ($standardsPath !== $this->cwd) { + $standardsPath = dirname($standardsPath); + } + + // Use relative paths for local project repositories. + if ($this->isRunningGlobally() === false) { + $standardsPath = $this->filesystem->findShortestPath( + $this->getPHPCodeSnifferInstallPath(), + $standardsPath, + true + ); + } + + // De-duplicate and add when directory is not configured. + if (in_array($standardsPath, $this->installedPaths, true) === false) { + $this->installedPaths[] = $standardsPath; + $changes = true; + } + } + + return $changes; + } + + /** + * Iterates through Composers' local repository looking for valid Coding + * Standard packages. + * + * If the package is the RootPackage (the one the plugin is installed into), + * the package is ignored for now since it needs a different install path logic. + * + * @return array Composer packages containing coding standard(s) + */ + private function getPHPCodingStandardPackages() + { + $codingStandardPackages = array_filter( + $this->composer->getRepositoryManager()->getLocalRepository()->getPackages(), + function (PackageInterface $package) { + if ($package instanceof AliasPackage) { + return false; + } + return $package->getType() === Plugin::PACKAGE_TYPE; + } + ); + + if ( + ! $this->composer->getPackage() instanceof RootPackageInterface + && $this->composer->getPackage()->getType() === self::PACKAGE_TYPE + ) { + $codingStandardPackages[] = $this->composer->getPackage(); + } + + return $codingStandardPackages; + } + + /** + * Searches for the installed PHP_CodeSniffer Composer package + * + * @param null|string|\Composer\Semver\Constraint\ConstraintInterface $versionConstraint to match against + * + * @return PackageInterface|null + */ + private function getPHPCodeSnifferPackage($versionConstraint = null) + { + $packages = $this + ->composer + ->getRepositoryManager() + ->getLocalRepository() + ->findPackages(self::PACKAGE_NAME, $versionConstraint); + + return array_shift($packages); + } + + /** + * Returns the path to the PHP_CodeSniffer package installation location + * + * @return string + */ + private function getPHPCodeSnifferInstallPath() + { + return $this->composer->getInstallationManager()->getInstallPath($this->getPHPCodeSnifferPackage()); + } + + /** + * Simple check if PHP_CodeSniffer is installed. + * + * @param null|string|\Composer\Semver\Constraint\ConstraintInterface $versionConstraint to match against + * + * @return bool Whether PHP_CodeSniffer is installed + */ + private function isPHPCodeSnifferInstalled($versionConstraint = null) + { + return ($this->getPHPCodeSnifferPackage($versionConstraint) !== null); + } + + /** + * Test if composer is running "global" + * This check kinda dirty, but it is the "Composer Way" + * + * @return bool Whether Composer is running "globally" + * + * @throws \RuntimeException + */ + private function isRunningGlobally() + { + return ($this->composer->getConfig()->get('home') === $this->cwd); + } + + /** + * Determines the maximum search depth when searching for Coding Standards. + * + * @return int + * + * @throws \InvalidArgumentException + */ + private function getMaxDepth() + { + $maxDepth = 3; + + $extra = $this->composer->getPackage()->getExtra(); + + if (array_key_exists(self::KEY_MAX_DEPTH, $extra)) { + $maxDepth = $extra[self::KEY_MAX_DEPTH]; + $minDepth = $this->getMinDepth(); + + if ( + (string) (int) $maxDepth !== (string) $maxDepth /* Must be an integer or cleanly castable to one */ + || $maxDepth <= $minDepth /* Larger than the minimum */ + || is_float($maxDepth) === true /* Within the boundaries of integer */ + ) { + $message = vsprintf( + self::MESSAGE_ERROR_WRONG_MAX_DEPTH, + array( + 'key' => self::KEY_MAX_DEPTH, + 'min' => $minDepth, + 'given' => var_export($maxDepth, true), + ) + ); + + throw new \InvalidArgumentException($message); + } + } + + return (int) $maxDepth; + } + + /** + * Returns the minimal search depth for Coding Standard packages. + * + * Usually this is 0, unless PHP_CodeSniffer >= 3 is used. + * + * @return int + */ + private function getMinDepth() + { + if ($this->isPHPCodeSnifferInstalled('>= 3.0.0') !== true) { + return 1; + } + return 0; + } +} diff --git a/trunk/vendor/league/flysystem/CODE_OF_CONDUCT.md b/trunk/vendor/league/flysystem/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..89569c01 --- /dev/null +++ b/trunk/vendor/league/flysystem/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at info+flysystem@frankdejonge.nl. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/trunk/vendor/league/flysystem/LICENSE b/trunk/vendor/league/flysystem/LICENSE new file mode 100644 index 00000000..f2684c84 --- /dev/null +++ b/trunk/vendor/league/flysystem/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2013-2019 Frank de Jonge + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/league/flysystem/SECURITY.md b/trunk/vendor/league/flysystem/SECURITY.md new file mode 100644 index 00000000..f5b205ed --- /dev/null +++ b/trunk/vendor/league/flysystem/SECURITY.md @@ -0,0 +1,16 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 1.0.x | :white_check_mark: | +| 2.0.x | :x: | + +## Reporting a Vulnerability + +When you've encountered a security vulnerability, please disclose it securely. + +The security process is described at: +[https://flysystem.thephpleague.com/docs/security/](https://flysystem.thephpleague.com/docs/security/) + diff --git a/trunk/vendor/league/flysystem/deprecations.md b/trunk/vendor/league/flysystem/deprecations.md new file mode 100644 index 00000000..c336a425 --- /dev/null +++ b/trunk/vendor/league/flysystem/deprecations.md @@ -0,0 +1,19 @@ +# Deprecations + +This document lists all the planned deprecations. + +## Handlers will be removed in 2.0 + +The `Handler` type and associated calls will be removed in version 2.0. + +### Upgrade path + +You should create your own implementation for handling OOP usage, +but it's recommended to move away from using an OOP-style wrapper entirely. + +The reason for this is that it's too easy for implementation details (for +your application this is Flysystem) to leak into the application. The most +important part for Flysystem is that it improves portability and creates a +solid boundary between your application core and the infrastructure you use. +The OOP-style handling breaks this principle, therefore I want to stop +promoting it. diff --git a/trunk/vendor/league/flysystem/src/Adapter/AbstractAdapter.php b/trunk/vendor/league/flysystem/src/Adapter/AbstractAdapter.php new file mode 100644 index 00000000..a6a8ed02 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/AbstractAdapter.php @@ -0,0 +1,72 @@ +pathPrefix = null; + + return; + } + + $this->pathPrefix = rtrim($prefix, '\\/') . $this->pathSeparator; + } + + /** + * Get the path prefix. + * + * @return string|null path prefix or null if pathPrefix is empty + */ + public function getPathPrefix() + { + return $this->pathPrefix; + } + + /** + * Prefix a path. + * + * @param string $path + * + * @return string prefixed path + */ + public function applyPathPrefix($path) + { + return $this->getPathPrefix() . ltrim($path, '\\/'); + } + + /** + * Remove a path prefix. + * + * @param string $path + * + * @return string path without the prefix + */ + public function removePathPrefix($path) + { + return substr($path, strlen((string) $this->getPathPrefix())); + } +} diff --git a/trunk/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php b/trunk/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php new file mode 100644 index 00000000..25d949ea --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php @@ -0,0 +1,705 @@ +safeStorage = new SafeStorage(); + $this->setConfig($config); + } + + /** + * Set the config. + * + * @param array $config + * + * @return $this + */ + public function setConfig(array $config) + { + foreach ($this->configurable as $setting) { + if ( ! isset($config[$setting])) { + continue; + } + + $method = 'set' . ucfirst($setting); + + if (method_exists($this, $method)) { + $this->$method($config[$setting]); + } + } + + return $this; + } + + /** + * Returns the host. + * + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Set the host. + * + * @param string $host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + + return $this; + } + + /** + * Set the public permission value. + * + * @param int $permPublic + * + * @return $this + */ + public function setPermPublic($permPublic) + { + $this->permPublic = $permPublic; + + return $this; + } + + /** + * Set the private permission value. + * + * @param int $permPrivate + * + * @return $this + */ + public function setPermPrivate($permPrivate) + { + $this->permPrivate = $permPrivate; + + return $this; + } + + /** + * Returns the ftp port. + * + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Returns the root folder to work from. + * + * @return string + */ + public function getRoot() + { + return $this->root; + } + + /** + * Set the ftp port. + * + * @param int|string $port + * + * @return $this + */ + public function setPort($port) + { + $this->port = (int) $port; + + return $this; + } + + /** + * Set the root folder to work from. + * + * @param string $root + * + * @return $this + */ + public function setRoot($root) + { + $this->root = rtrim($root, '\\/') . $this->separator; + + return $this; + } + + /** + * Returns the ftp username. + * + * @return string username + */ + public function getUsername() + { + $username = $this->safeStorage->retrieveSafely('username'); + + return $username !== null ? $username : 'anonymous'; + } + + /** + * Set ftp username. + * + * @param string $username + * + * @return $this + */ + public function setUsername($username) + { + $this->safeStorage->storeSafely('username', $username); + + return $this; + } + + /** + * Returns the password. + * + * @return string password + */ + public function getPassword() + { + return $this->safeStorage->retrieveSafely('password'); + } + + /** + * Set the ftp password. + * + * @param string $password + * + * @return $this + */ + public function setPassword($password) + { + $this->safeStorage->storeSafely('password', $password); + + return $this; + } + + /** + * Returns the amount of seconds before the connection will timeout. + * + * @return int + */ + public function getTimeout() + { + return $this->timeout; + } + + /** + * Set the amount of seconds before the connection should timeout. + * + * @param int $timeout + * + * @return $this + */ + public function setTimeout($timeout) + { + $this->timeout = (int) $timeout; + + return $this; + } + + /** + * Return the FTP system type. + * + * @return string + */ + public function getSystemType() + { + return $this->systemType; + } + + /** + * Set the FTP system type (windows or unix). + * + * @param string $systemType + * + * @return $this + */ + public function setSystemType($systemType) + { + $this->systemType = strtolower($systemType); + + return $this; + } + + /** + * True to enable timestamps for FTP servers that return unix-style listings. + * + * @param bool $bool + * + * @return $this + */ + public function setEnableTimestampsOnUnixListings($bool = false) + { + $this->enableTimestampsOnUnixListings = $bool; + + return $this; + } + + /** + * @inheritdoc + */ + public function listContents($directory = '', $recursive = false) + { + return $this->listDirectoryContents($directory, $recursive); + } + + abstract protected function listDirectoryContents($directory, $recursive = false); + + /** + * Normalize a directory listing. + * + * @param array $listing + * @param string $prefix + * + * @return array directory listing + */ + protected function normalizeListing(array $listing, $prefix = '') + { + $base = $prefix; + $result = []; + $listing = $this->removeDotDirectories($listing); + + while ($item = array_shift($listing)) { + if (preg_match('#^.*:$#', $item)) { + $base = preg_replace('~^\./*|:$~', '', $item); + continue; + } + + $result[] = $this->normalizeObject($item, $base); + } + + return $this->sortListing($result); + } + + /** + * Sort a directory listing. + * + * @param array $result + * + * @return array sorted listing + */ + protected function sortListing(array $result) + { + $compare = function ($one, $two) { + return strnatcmp($one['path'], $two['path']); + }; + + usort($result, $compare); + + return $result; + } + + /** + * Normalize a file entry. + * + * @param string $item + * @param string $base + * + * @return array normalized file array + * + * @throws NotSupportedException + */ + protected function normalizeObject($item, $base) + { + $systemType = $this->systemType ?: $this->detectSystemType($item); + + if ($systemType === 'unix') { + return $this->normalizeUnixObject($item, $base); + } elseif ($systemType === 'windows') { + return $this->normalizeWindowsObject($item, $base); + } + + throw NotSupportedException::forFtpSystemType($systemType); + } + + /** + * Normalize a Unix file entry. + * + * Given $item contains: + * '-rw-r--r-- 1 ftp ftp 409 Aug 19 09:01 file1.txt' + * + * This function will return: + * [ + * 'type' => 'file', + * 'path' => 'file1.txt', + * 'visibility' => 'public', + * 'size' => 409, + * 'timestamp' => 1566205260 + * ] + * + * @param string $item + * @param string $base + * + * @return array normalized file array + */ + protected function normalizeUnixObject($item, $base) + { + $item = preg_replace('#\s+#', ' ', trim($item), 7); + + if (count(explode(' ', $item, 9)) !== 9) { + throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); + } + + list($permissions, /* $number */, /* $owner */, /* $group */, $size, $month, $day, $timeOrYear, $name) = explode(' ', $item, 9); + $type = $this->detectType($permissions); + $path = $base === '' ? $name : $base . $this->separator . $name; + + if ($type === 'dir') { + $result = compact('type', 'path'); + if ($this->enableTimestampsOnUnixListings) { + $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); + $result += compact('timestamp'); + } + + return $result; + } + + $permissions = $this->normalizePermissions($permissions); + $visibility = $permissions & 0044 ? AdapterInterface::VISIBILITY_PUBLIC : AdapterInterface::VISIBILITY_PRIVATE; + $size = (int) $size; + + $result = compact('type', 'path', 'visibility', 'size'); + if ($this->enableTimestampsOnUnixListings) { + $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); + $result += compact('timestamp'); + } + + return $result; + } + + /** + * Only accurate to the minute (current year), or to the day. + * + * Inadequacies in timestamp accuracy are due to limitations of the FTP 'LIST' command + * + * Note: The 'MLSD' command is a machine-readable replacement for 'LIST' + * but many FTP servers do not support it :( + * + * @param string $month e.g. 'Aug' + * @param string $day e.g. '19' + * @param string $timeOrYear e.g. '09:01' OR '2015' + * + * @return int + */ + protected function normalizeUnixTimestamp($month, $day, $timeOrYear) + { + if (is_numeric($timeOrYear)) { + $year = $timeOrYear; + $hour = '00'; + $minute = '00'; + $seconds = '00'; + } else { + $year = date('Y'); + list($hour, $minute) = explode(':', $timeOrYear); + $seconds = '00'; + } + $dateTime = DateTime::createFromFormat('Y-M-j-G:i:s', "{$year}-{$month}-{$day}-{$hour}:{$minute}:{$seconds}"); + + return $dateTime->getTimestamp(); + } + + /** + * Normalize a Windows/DOS file entry. + * + * @param string $item + * @param string $base + * + * @return array normalized file array + */ + protected function normalizeWindowsObject($item, $base) + { + $item = preg_replace('#\s+#', ' ', trim($item), 3); + + if (count(explode(' ', $item, 4)) !== 4) { + throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); + } + + list($date, $time, $size, $name) = explode(' ', $item, 4); + $path = $base === '' ? $name : $base . $this->separator . $name; + + // Check for the correct date/time format + $format = strlen($date) === 8 ? 'm-d-yH:iA' : 'Y-m-dH:i'; + $dt = DateTime::createFromFormat($format, $date . $time); + $timestamp = $dt ? $dt->getTimestamp() : (int) strtotime("$date $time"); + + if ($size === '
    ') { + $type = 'dir'; + + return compact('type', 'path', 'timestamp'); + } + + $type = 'file'; + $visibility = AdapterInterface::VISIBILITY_PUBLIC; + $size = (int) $size; + + return compact('type', 'path', 'visibility', 'size', 'timestamp'); + } + + /** + * Get the system type from a listing item. + * + * @param string $item + * + * @return string the system type + */ + protected function detectSystemType($item) + { + return preg_match('/^[0-9]{2,4}-[0-9]{2}-[0-9]{2}/', trim($item)) ? 'windows' : 'unix'; + } + + /** + * Get the file type from the permissions. + * + * @param string $permissions + * + * @return string file type + */ + protected function detectType($permissions) + { + return substr($permissions, 0, 1) === 'd' ? 'dir' : 'file'; + } + + /** + * Normalize a permissions string. + * + * @param string $permissions + * + * @return int + */ + protected function normalizePermissions($permissions) + { + if (is_numeric($permissions)) { + return ((int) $permissions) & 0777; + } + + // remove the type identifier + $permissions = substr($permissions, 1); + + // map the string rights to the numeric counterparts + $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1']; + $permissions = strtr($permissions, $map); + + // split up the permission groups + $parts = str_split($permissions, 3); + + // convert the groups + $mapper = function ($part) { + return array_sum(str_split($part)); + }; + + // converts to decimal number + return octdec(implode('', array_map($mapper, $parts))); + } + + /** + * Filter out dot-directories. + * + * @param array $list + * + * @return array + */ + public function removeDotDirectories(array $list) + { + $filter = function ($line) { + return $line !== '' && ! preg_match('#.* \.(\.)?$|^total#', $line); + }; + + return array_filter($list, $filter); + } + + /** + * @inheritdoc + */ + public function has($path) + { + return $this->getMetadata($path); + } + + /** + * @inheritdoc + */ + public function getSize($path) + { + return $this->getMetadata($path); + } + + /** + * @inheritdoc + */ + public function getVisibility($path) + { + return $this->getMetadata($path); + } + + /** + * Ensure a directory exists. + * + * @param string $dirname + */ + public function ensureDirectory($dirname) + { + $dirname = (string) $dirname; + + if ($dirname !== '' && ! $this->has($dirname)) { + $this->createDir($dirname, new Config()); + } + } + + /** + * @return mixed + */ + public function getConnection() + { + if ( ! $this->isConnected()) { + $this->disconnect(); + $this->connect(); + } + + return $this->connection; + } + + /** + * Get the public permission value. + * + * @return int + */ + public function getPermPublic() + { + return $this->permPublic; + } + + /** + * Get the private permission value. + * + * @return int + */ + public function getPermPrivate() + { + return $this->permPrivate; + } + + /** + * Disconnect on destruction. + */ + public function __destruct() + { + $this->disconnect(); + } + + /** + * Establish a connection. + */ + abstract public function connect(); + + /** + * Close the connection. + */ + abstract public function disconnect(); + + /** + * Check if a connection is active. + * + * @return bool + */ + abstract public function isConnected(); + + protected function escapePath($path) + { + return str_replace(['*', '[', ']'], ['\\*', '\\[', '\\]'], $path); + } +} diff --git a/trunk/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php b/trunk/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php new file mode 100644 index 00000000..fd8d2161 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php @@ -0,0 +1,12 @@ +transferMode = $mode; + + return $this; + } + + /** + * Set if Ssl is enabled. + * + * @param bool $ssl + * + * @return $this + */ + public function setSsl($ssl) + { + $this->ssl = (bool) $ssl; + + return $this; + } + + /** + * Set if passive mode should be used. + * + * @param bool $passive + */ + public function setPassive($passive = true) + { + $this->passive = $passive; + } + + /** + * @param bool $ignorePassiveAddress + */ + public function setIgnorePassiveAddress($ignorePassiveAddress) + { + $this->ignorePassiveAddress = $ignorePassiveAddress; + } + + /** + * @param bool $recurseManually + */ + public function setRecurseManually($recurseManually) + { + $this->recurseManually = $recurseManually; + } + + /** + * @param bool $utf8 + */ + public function setUtf8($utf8) + { + $this->utf8 = (bool) $utf8; + } + + /** + * Connect to the FTP server. + */ + public function connect() + { + $tries = 3; + start_connecting: + + if ($this->ssl) { + $this->connection = @ftp_ssl_connect($this->getHost(), $this->getPort(), $this->getTimeout()); + } else { + $this->connection = @ftp_connect($this->getHost(), $this->getPort(), $this->getTimeout()); + } + + if ( ! $this->connection) { + $tries--; + + if ($tries > 0) goto start_connecting; + + throw new ConnectionRuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); + } + + $this->login(); + $this->setUtf8Mode(); + $this->setConnectionPassiveMode(); + $this->setConnectionRoot(); + $this->isPureFtpd = $this->isPureFtpdServer(); + } + + /** + * Set the connection to UTF-8 mode. + */ + protected function setUtf8Mode() + { + if ($this->utf8) { + $response = ftp_raw($this->connection, "OPTS UTF8 ON"); + if (!in_array(substr($response[0], 0, 3), ['200', '202'])) { + throw new ConnectionRuntimeException( + 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort() + ); + } + } + } + + /** + * Set the connections to passive mode. + * + * @throws ConnectionRuntimeException + */ + protected function setConnectionPassiveMode() + { + if (is_bool($this->ignorePassiveAddress) && defined('FTP_USEPASVADDRESS')) { + ftp_set_option($this->connection, FTP_USEPASVADDRESS, ! $this->ignorePassiveAddress); + } + + if ( ! ftp_pasv($this->connection, $this->passive)) { + throw new ConnectionRuntimeException( + 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort() + ); + } + } + + /** + * Set the connection root. + */ + protected function setConnectionRoot() + { + $root = $this->getRoot(); + $connection = $this->connection; + + if ($root && ! ftp_chdir($connection, $root)) { + throw new InvalidRootException('Root is invalid or does not exist: ' . $this->getRoot()); + } + + // Store absolute path for further reference. + // This is needed when creating directories and + // initial root was a relative path, else the root + // would be relative to the chdir'd path. + $this->root = ftp_pwd($connection); + } + + /** + * Login. + * + * @throws ConnectionRuntimeException + */ + protected function login() + { + set_error_handler(function () { + }); + $isLoggedIn = ftp_login( + $this->connection, + $this->getUsername(), + $this->getPassword() + ); + restore_error_handler(); + + if ( ! $isLoggedIn) { + $this->disconnect(); + throw new ConnectionRuntimeException( + 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort( + ) . ', username: ' . $this->getUsername() + ); + } + } + + /** + * Disconnect from the FTP server. + */ + public function disconnect() + { + if ($this->hasFtpConnection()) { + @ftp_close($this->connection); + } + + $this->connection = null; + } + + /** + * @inheritdoc + */ + public function write($path, $contents, Config $config) + { + $stream = fopen('php://temp', 'w+b'); + fwrite($stream, $contents); + rewind($stream); + $result = $this->writeStream($path, $stream, $config); + fclose($stream); + + if ($result === false) { + return false; + } + + $result['contents'] = $contents; + $result['mimetype'] = $config->get('mimetype') ?: Util::guessMimeType($path, $contents); + + return $result; + } + + /** + * @inheritdoc + */ + public function writeStream($path, $resource, Config $config) + { + $this->ensureDirectory(Util::dirname($path)); + + if ( ! ftp_fput($this->getConnection(), $path, $resource, $this->transferMode)) { + return false; + } + + if ($visibility = $config->get('visibility')) { + $this->setVisibility($path, $visibility); + } + + $type = 'file'; + + return compact('type', 'path', 'visibility'); + } + + /** + * @inheritdoc + */ + public function update($path, $contents, Config $config) + { + return $this->write($path, $contents, $config); + } + + /** + * @inheritdoc + */ + public function updateStream($path, $resource, Config $config) + { + return $this->writeStream($path, $resource, $config); + } + + /** + * @inheritdoc + */ + public function rename($path, $newpath) + { + return ftp_rename($this->getConnection(), $path, $newpath); + } + + /** + * @inheritdoc + */ + public function delete($path) + { + return ftp_delete($this->getConnection(), $path); + } + + /** + * @inheritdoc + */ + public function deleteDir($dirname) + { + $connection = $this->getConnection(); + $contents = array_reverse($this->listDirectoryContents($dirname, false)); + + foreach ($contents as $object) { + if ($object['type'] === 'file') { + if ( ! ftp_delete($connection, $object['path'])) { + return false; + } + } elseif ( ! $this->deleteDir($object['path'])) { + return false; + } + } + + return ftp_rmdir($connection, $dirname); + } + + /** + * @inheritdoc + */ + public function createDir($dirname, Config $config) + { + $connection = $this->getConnection(); + $directories = explode('/', $dirname); + + foreach ($directories as $directory) { + if (false === $this->createActualDirectory($directory, $connection)) { + $this->setConnectionRoot(); + + return false; + } + + ftp_chdir($connection, $directory); + } + + $this->setConnectionRoot(); + + return ['type' => 'dir', 'path' => $dirname]; + } + + /** + * Create a directory. + * + * @param string $directory + * @param resource $connection + * + * @return bool + */ + protected function createActualDirectory($directory, $connection) + { + // List the current directory + $listing = ftp_nlist($connection, '.') ?: []; + + foreach ($listing as $key => $item) { + if (preg_match('~^\./.*~', $item)) { + $listing[$key] = substr($item, 2); + } + } + + if (in_array($directory, $listing, true)) { + return true; + } + + return (boolean) ftp_mkdir($connection, $directory); + } + + /** + * @inheritdoc + */ + public function getMetadata($path) + { + if ($path === '') { + return ['type' => 'dir', 'path' => '']; + } + + if (@ftp_chdir($this->getConnection(), $path) === true) { + $this->setConnectionRoot(); + + return ['type' => 'dir', 'path' => $path]; + } + + $listing = $this->ftpRawlist('-A', $path); + + if (empty($listing) || in_array('total 0', $listing, true)) { + return false; + } + + if (preg_match('/.* not found/', $listing[0])) { + return false; + } + + if (preg_match('/^total [0-9]*$/', $listing[0])) { + array_shift($listing); + } + + return $this->normalizeObject($listing[0], ''); + } + + /** + * @inheritdoc + */ + public function getMimetype($path) + { + if ( ! $metadata = $this->getMetadata($path)) { + return false; + } + + $metadata['mimetype'] = MimeType::detectByFilename($path); + + return $metadata; + } + + /** + * @inheritdoc + */ + public function getTimestamp($path) + { + $timestamp = ftp_mdtm($this->getConnection(), $path); + + return ($timestamp !== -1) ? ['path' => $path, 'timestamp' => $timestamp] : false; + } + + /** + * @inheritdoc + */ + public function read($path) + { + if ( ! $object = $this->readStream($path)) { + return false; + } + + $object['contents'] = stream_get_contents($object['stream']); + fclose($object['stream']); + unset($object['stream']); + + return $object; + } + + /** + * @inheritdoc + */ + public function readStream($path) + { + $stream = fopen('php://temp', 'w+b'); + $result = ftp_fget($this->getConnection(), $stream, $path, $this->transferMode); + rewind($stream); + + if ( ! $result) { + fclose($stream); + + return false; + } + + return ['type' => 'file', 'path' => $path, 'stream' => $stream]; + } + + /** + * @inheritdoc + */ + public function setVisibility($path, $visibility) + { + $mode = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? $this->getPermPublic() : $this->getPermPrivate(); + + if ( ! ftp_chmod($this->getConnection(), $mode, $path)) { + return false; + } + + return compact('path', 'visibility'); + } + + /** + * @inheritdoc + * + * @param string $directory + */ + protected function listDirectoryContents($directory, $recursive = true) + { + if ($recursive && $this->recurseManually) { + return $this->listDirectoryContentsRecursive($directory); + } + + $options = $recursive ? '-alnR' : '-aln'; + $listing = $this->ftpRawlist($options, $directory); + + return $listing ? $this->normalizeListing($listing, $directory) : []; + } + + /** + * @inheritdoc + * + * @param string $directory + */ + protected function listDirectoryContentsRecursive($directory) + { + $listing = $this->normalizeListing($this->ftpRawlist('-aln', $directory) ?: [], $directory); + $output = []; + + foreach ($listing as $item) { + $output[] = $item; + if ($item['type'] !== 'dir') { + continue; + } + $output = array_merge($output, $this->listDirectoryContentsRecursive($item['path'])); + } + + return $output; + } + + /** + * Check if the connection is open. + * + * @return bool + * + * @throws ConnectionErrorException + */ + public function isConnected() + { + return $this->hasFtpConnection() && $this->getRawExecResponseCode('NOOP') === 200; + } + + /** + * @return bool + */ + protected function isPureFtpdServer() + { + $response = ftp_raw($this->connection, 'HELP'); + + return stripos(implode(' ', $response), 'Pure-FTPd') !== false; + } + + /** + * The ftp_rawlist function with optional escaping. + * + * @param string $options + * @param string $path + * + * @return array + */ + protected function ftpRawlist($options, $path) + { + $connection = $this->getConnection(); + + if ($this->isPureFtpd) { + $path = str_replace([' ', '[', ']'], ['\ ', '\\[', '\\]'], $path); + } + + return ftp_rawlist($connection, $options . ' ' . $this->escapePath($path)); + } + + private function getRawExecResponseCode($command) + { + $response = @ftp_raw($this->connection, trim($command)) ?: []; + + return (int) preg_replace('/\D/', '', implode(' ', (array) $response)); + } + + private function hasFtpConnection(): bool + { + return is_resource($this->connection) || $this->connection instanceof \FTP\Connection; + } +} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Ftpd.php b/trunk/vendor/league/flysystem/src/Adapter/Ftpd.php new file mode 100644 index 00000000..7e71d19f --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/Ftpd.php @@ -0,0 +1,48 @@ + 'dir', 'path' => '']; + } + + if (@ftp_chdir($this->getConnection(), $path) === true) { + $this->setConnectionRoot(); + + return ['type' => 'dir', 'path' => $path]; + } + + $object = ftp_raw($this->getConnection(), 'STAT ' . $this->escapePath($path)); + + if ( ! $object || count($object) < 3) { + return false; + } + + if (substr($object[1], 0, 5) === "ftpd:") { + return false; + } + + return $this->normalizeObject($object[1], ''); + } + + /** + * @inheritdoc + */ + protected function listDirectoryContents($directory, $recursive = true) + { + $listing = ftp_rawlist($this->getConnection(), $this->escapePath($directory), $recursive); + + if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) { + return []; + } + + return $this->normalizeListing($listing, $directory); + } +} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Local.php b/trunk/vendor/league/flysystem/src/Adapter/Local.php new file mode 100644 index 00000000..747c463e --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/Local.php @@ -0,0 +1,533 @@ + [ + 'public' => 0644, + 'private' => 0600, + ], + 'dir' => [ + 'public' => 0755, + 'private' => 0700, + ], + ]; + + /** + * @var string + */ + protected $pathSeparator = DIRECTORY_SEPARATOR; + + /** + * @var array + */ + protected $permissionMap; + + /** + * @var int + */ + protected $writeFlags; + + /** + * @var int + */ + private $linkHandling; + + /** + * Constructor. + * + * @param string $root + * @param int $writeFlags + * @param int $linkHandling + * @param array $permissions + * + * @throws LogicException + */ + public function __construct($root, $writeFlags = LOCK_EX, $linkHandling = self::DISALLOW_LINKS, array $permissions = []) + { + $root = is_link($root) ? realpath($root) : $root; + $this->permissionMap = array_replace_recursive(static::$permissions, $permissions); + $this->ensureDirectory($root); + + if ( ! is_dir($root) || ! is_readable($root)) { + throw new LogicException('The root path ' . $root . ' is not readable.'); + } + + $this->setPathPrefix($root); + $this->writeFlags = $writeFlags; + $this->linkHandling = $linkHandling; + } + + /** + * Ensure the root directory exists. + * + * @param string $root root directory path + * + * @return void + * + * @throws Exception in case the root directory can not be created + */ + protected function ensureDirectory($root) + { + if ( ! is_dir($root)) { + $umask = umask(0); + + if ( ! @mkdir($root, $this->permissionMap['dir']['public'], true)) { + $mkdirError = error_get_last(); + } + + umask($umask); + clearstatcache(false, $root); + + if ( ! is_dir($root)) { + $errorMessage = isset($mkdirError['message']) ? $mkdirError['message'] : ''; + throw new Exception(sprintf('Impossible to create the root directory "%s". %s', $root, $errorMessage)); + } + } + } + + /** + * @inheritdoc + */ + public function has($path) + { + $location = $this->applyPathPrefix($path); + + return file_exists($location); + } + + /** + * @inheritdoc + */ + public function write($path, $contents, Config $config) + { + $location = $this->applyPathPrefix($path); + $this->ensureDirectory(dirname($location)); + + if (($size = file_put_contents($location, $contents, $this->writeFlags)) === false) { + return false; + } + + $type = 'file'; + $result = compact('contents', 'type', 'size', 'path'); + + if ($visibility = $config->get('visibility')) { + $result['visibility'] = $visibility; + $this->setVisibility($path, $visibility); + } + + return $result; + } + + /** + * @inheritdoc + */ + public function writeStream($path, $resource, Config $config) + { + $location = $this->applyPathPrefix($path); + $this->ensureDirectory(dirname($location)); + $stream = fopen($location, 'w+b'); + + if ( ! $stream || stream_copy_to_stream($resource, $stream) === false || ! fclose($stream)) { + return false; + } + + $type = 'file'; + $result = compact('type', 'path'); + + if ($visibility = $config->get('visibility')) { + $this->setVisibility($path, $visibility); + $result['visibility'] = $visibility; + } + + return $result; + } + + /** + * @inheritdoc + */ + public function readStream($path) + { + $location = $this->applyPathPrefix($path); + $stream = fopen($location, 'rb'); + + return ['type' => 'file', 'path' => $path, 'stream' => $stream]; + } + + /** + * @inheritdoc + */ + public function updateStream($path, $resource, Config $config) + { + return $this->writeStream($path, $resource, $config); + } + + /** + * @inheritdoc + */ + public function update($path, $contents, Config $config) + { + $location = $this->applyPathPrefix($path); + $size = file_put_contents($location, $contents, $this->writeFlags); + + if ($size === false) { + return false; + } + + $type = 'file'; + + $result = compact('type', 'path', 'size', 'contents'); + + if ($visibility = $config->get('visibility')) { + $this->setVisibility($path, $visibility); + $result['visibility'] = $visibility; + } + + return $result; + } + + /** + * @inheritdoc + */ + public function read($path) + { + $location = $this->applyPathPrefix($path); + $contents = @file_get_contents($location); + + if ($contents === false) { + return false; + } + + return ['type' => 'file', 'path' => $path, 'contents' => $contents]; + } + + /** + * @inheritdoc + */ + public function rename($path, $newpath) + { + $location = $this->applyPathPrefix($path); + $destination = $this->applyPathPrefix($newpath); + $parentDirectory = $this->applyPathPrefix(Util::dirname($newpath)); + $this->ensureDirectory($parentDirectory); + + return rename($location, $destination); + } + + /** + * @inheritdoc + */ + public function copy($path, $newpath) + { + $location = $this->applyPathPrefix($path); + $destination = $this->applyPathPrefix($newpath); + $this->ensureDirectory(dirname($destination)); + + return copy($location, $destination); + } + + /** + * @inheritdoc + */ + public function delete($path) + { + $location = $this->applyPathPrefix($path); + + return @unlink($location); + } + + /** + * @inheritdoc + */ + public function listContents($directory = '', $recursive = false) + { + $result = []; + $location = $this->applyPathPrefix($directory); + + if ( ! is_dir($location)) { + return []; + } + + $iterator = $recursive ? $this->getRecursiveDirectoryIterator($location) : $this->getDirectoryIterator($location); + + foreach ($iterator as $file) { + $path = $this->getFilePath($file); + + if (preg_match('#(^|/|\\\\)\.{1,2}$#', $path)) { + continue; + } + + $result[] = $this->normalizeFileInfo($file); + } + + unset($iterator); + + return array_filter($result); + } + + /** + * @inheritdoc + */ + public function getMetadata($path) + { + $location = $this->applyPathPrefix($path); + clearstatcache(false, $location); + $info = new SplFileInfo($location); + + return $this->normalizeFileInfo($info); + } + + /** + * @inheritdoc + */ + public function getSize($path) + { + return $this->getMetadata($path); + } + + /** + * @inheritdoc + */ + public function getMimetype($path) + { + $location = $this->applyPathPrefix($path); + $finfo = new Finfo(FILEINFO_MIME_TYPE); + $mimetype = $finfo->file($location); + + if (in_array($mimetype, ['application/octet-stream', 'inode/x-empty', 'application/x-empty'])) { + $mimetype = Util\MimeType::detectByFilename($location); + } + + return ['path' => $path, 'type' => 'file', 'mimetype' => $mimetype]; + } + + /** + * @inheritdoc + */ + public function getTimestamp($path) + { + return $this->getMetadata($path); + } + + /** + * @inheritdoc + */ + public function getVisibility($path) + { + $location = $this->applyPathPrefix($path); + clearstatcache(false, $location); + $permissions = octdec(substr(sprintf('%o', fileperms($location)), -4)); + $type = is_dir($location) ? 'dir' : 'file'; + + foreach ($this->permissionMap[$type] as $visibility => $visibilityPermissions) { + if ($visibilityPermissions == $permissions) { + return compact('path', 'visibility'); + } + } + + $visibility = substr(sprintf('%o', fileperms($location)), -4); + + return compact('path', 'visibility'); + } + + /** + * @inheritdoc + */ + public function setVisibility($path, $visibility) + { + $location = $this->applyPathPrefix($path); + $type = is_dir($location) ? 'dir' : 'file'; + $success = chmod($location, $this->permissionMap[$type][$visibility]); + + if ($success === false) { + return false; + } + + return compact('path', 'visibility'); + } + + /** + * @inheritdoc + */ + public function createDir($dirname, Config $config) + { + $location = $this->applyPathPrefix($dirname); + $umask = umask(0); + $visibility = $config->get('visibility', 'public'); + $return = ['path' => $dirname, 'type' => 'dir']; + + if ( ! is_dir($location)) { + if (false === @mkdir($location, $this->permissionMap['dir'][$visibility], true) + || false === is_dir($location)) { + $return = false; + } + } + + umask($umask); + + return $return; + } + + /** + * @inheritdoc + */ + public function deleteDir($dirname) + { + $location = $this->applyPathPrefix($dirname); + + if ( ! is_dir($location)) { + return false; + } + + $contents = $this->getRecursiveDirectoryIterator($location, RecursiveIteratorIterator::CHILD_FIRST); + + /** @var SplFileInfo $file */ + foreach ($contents as $file) { + $this->guardAgainstUnreadableFileInfo($file); + $this->deleteFileInfoObject($file); + } + + unset($contents); + + return rmdir($location); + } + + /** + * @param SplFileInfo $file + */ + protected function deleteFileInfoObject(SplFileInfo $file) + { + switch ($file->getType()) { + case 'dir': + rmdir($file->getRealPath()); + break; + case 'link': + unlink($file->getPathname()); + break; + default: + unlink($file->getRealPath()); + } + } + + /** + * Normalize the file info. + * + * @param SplFileInfo $file + * + * @return array|void + * + * @throws NotSupportedException + */ + protected function normalizeFileInfo(SplFileInfo $file) + { + if ( ! $file->isLink()) { + return $this->mapFileInfo($file); + } + + if ($this->linkHandling & self::DISALLOW_LINKS) { + throw NotSupportedException::forLink($file); + } + } + + /** + * Get the normalized path from a SplFileInfo object. + * + * @param SplFileInfo $file + * + * @return string + */ + protected function getFilePath(SplFileInfo $file) + { + $location = $file->getPathname(); + $path = $this->removePathPrefix($location); + + return trim(str_replace('\\', '/', $path), '/'); + } + + /** + * @param string $path + * @param int $mode + * + * @return RecursiveIteratorIterator + */ + protected function getRecursiveDirectoryIterator($path, $mode = RecursiveIteratorIterator::SELF_FIRST) + { + return new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), + $mode + ); + } + + /** + * @param string $path + * + * @return DirectoryIterator + */ + protected function getDirectoryIterator($path) + { + $iterator = new DirectoryIterator($path); + + return $iterator; + } + + /** + * @param SplFileInfo $file + * + * @return array + */ + protected function mapFileInfo(SplFileInfo $file) + { + $normalized = [ + 'type' => $file->getType(), + 'path' => $this->getFilePath($file), + ]; + + $normalized['timestamp'] = $file->getMTime(); + + if ($normalized['type'] === 'file') { + $normalized['size'] = $file->getSize(); + } + + return $normalized; + } + + /** + * @param SplFileInfo $file + * + * @throws UnreadableFileException + */ + protected function guardAgainstUnreadableFileInfo(SplFileInfo $file) + { + if ( ! $file->isReadable()) { + throw UnreadableFileException::forFileInfo($file); + } + } +} diff --git a/trunk/vendor/league/flysystem/src/Adapter/NullAdapter.php b/trunk/vendor/league/flysystem/src/Adapter/NullAdapter.php new file mode 100644 index 00000000..2527087f --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/NullAdapter.php @@ -0,0 +1,144 @@ +get('visibility')) { + $result['visibility'] = $visibility; + } + + return $result; + } + + /** + * @inheritdoc + */ + public function update($path, $contents, Config $config) + { + return false; + } + + /** + * @inheritdoc + */ + public function read($path) + { + return false; + } + + /** + * @inheritdoc + */ + public function rename($path, $newpath) + { + return false; + } + + /** + * @inheritdoc + */ + public function delete($path) + { + return false; + } + + /** + * @inheritdoc + */ + public function listContents($directory = '', $recursive = false) + { + return []; + } + + /** + * @inheritdoc + */ + public function getMetadata($path) + { + return false; + } + + /** + * @inheritdoc + */ + public function getSize($path) + { + return false; + } + + /** + * @inheritdoc + */ + public function getMimetype($path) + { + return false; + } + + /** + * @inheritdoc + */ + public function getTimestamp($path) + { + return false; + } + + /** + * @inheritdoc + */ + public function getVisibility($path) + { + return false; + } + + /** + * @inheritdoc + */ + public function setVisibility($path, $visibility) + { + return compact('visibility'); + } + + /** + * @inheritdoc + */ + public function createDir($dirname, Config $config) + { + return ['path' => $dirname, 'type' => 'dir']; + } + + /** + * @inheritdoc + */ + public function deleteDir($dirname) + { + return false; + } +} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php b/trunk/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php new file mode 100644 index 00000000..fc0a747a --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php @@ -0,0 +1,33 @@ +readStream($path); + + if ($response === false || ! is_resource($response['stream'])) { + return false; + } + + $result = $this->writeStream($newpath, $response['stream'], new Config()); + + if ($result !== false && is_resource($response['stream'])) { + fclose($response['stream']); + } + + return $result !== false; + } + + // Required abstract method + + /** + * @param string $path + * + * @return resource + */ + abstract public function readStream($path); + + /** + * @param string $path + * @param resource $resource + * @param Config $config + * + * @return resource + */ + abstract public function writeStream($path, $resource, Config $config); +} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php b/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php new file mode 100644 index 00000000..2b31c01d --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php @@ -0,0 +1,44 @@ +read($path)) { + return false; + } + + $stream = fopen('php://temp', 'w+b'); + fwrite($stream, $data['contents']); + rewind($stream); + $data['stream'] = $stream; + unset($data['contents']); + + return $data; + } + + /** + * Reads a file. + * + * @param string $path + * + * @return array|false + * + * @see League\Flysystem\ReadInterface::read() + */ + abstract public function read($path); +} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php b/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php new file mode 100644 index 00000000..80424960 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php @@ -0,0 +1,9 @@ +stream($path, $resource, $config, 'write'); + } + + /** + * Update a file using a stream. + * + * @param string $path + * @param resource $resource + * @param Config $config Config object or visibility setting + * + * @return mixed false of file metadata + */ + public function updateStream($path, $resource, Config $config) + { + return $this->stream($path, $resource, $config, 'update'); + } + + // Required abstract methods + abstract public function write($pash, $contents, Config $config); + abstract public function update($pash, $contents, Config $config); +} diff --git a/trunk/vendor/league/flysystem/src/Adapter/SynologyFtp.php b/trunk/vendor/league/flysystem/src/Adapter/SynologyFtp.php new file mode 100644 index 00000000..fe0d344c --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Adapter/SynologyFtp.php @@ -0,0 +1,8 @@ +settings = $settings; + } + + /** + * Get a setting. + * + * @param string $key + * @param mixed $default + * + * @return mixed config setting or default when not found + */ + public function get($key, $default = null) + { + if ( ! array_key_exists($key, $this->settings)) { + return $this->getDefault($key, $default); + } + + return $this->settings[$key]; + } + + /** + * Check if an item exists by key. + * + * @param string $key + * + * @return bool + */ + public function has($key) + { + if (array_key_exists($key, $this->settings)) { + return true; + } + + return $this->fallback instanceof Config + ? $this->fallback->has($key) + : false; + } + + /** + * Try to retrieve a default setting from a config fallback. + * + * @param string $key + * @param mixed $default + * + * @return mixed config setting or default when not found + */ + protected function getDefault($key, $default) + { + if ( ! $this->fallback) { + return $default; + } + + return $this->fallback->get($key, $default); + } + + /** + * Set a setting. + * + * @param string $key + * @param mixed $value + * + * @return $this + */ + public function set($key, $value) + { + $this->settings[$key] = $value; + + return $this; + } + + /** + * Set the fallback. + * + * @param Config $fallback + * + * @return $this + */ + public function setFallback(Config $fallback) + { + $this->fallback = $fallback; + + return $this; + } +} diff --git a/trunk/vendor/league/flysystem/src/ConfigAwareTrait.php b/trunk/vendor/league/flysystem/src/ConfigAwareTrait.php new file mode 100644 index 00000000..202d605d --- /dev/null +++ b/trunk/vendor/league/flysystem/src/ConfigAwareTrait.php @@ -0,0 +1,49 @@ +config = $config ? Util::ensureConfig($config) : new Config; + } + + /** + * Get the Config. + * + * @return Config config object + */ + public function getConfig() + { + return $this->config; + } + + /** + * Convert a config array to a Config object with the correct fallback. + * + * @param array $config + * + * @return Config + */ + protected function prepareConfig(array $config) + { + $config = new Config($config); + $config->setFallback($this->getConfig()); + + return $config; + } +} diff --git a/trunk/vendor/league/flysystem/src/ConnectionErrorException.php b/trunk/vendor/league/flysystem/src/ConnectionErrorException.php new file mode 100644 index 00000000..adb651d3 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/ConnectionErrorException.php @@ -0,0 +1,9 @@ +filesystem->deleteDir($this->path); + } + + /** + * List the directory contents. + * + * @param bool $recursive + * + * @return array|bool directory contents or false + */ + public function getContents($recursive = false) + { + return $this->filesystem->listContents($this->path, $recursive); + } +} diff --git a/trunk/vendor/league/flysystem/src/Exception.php b/trunk/vendor/league/flysystem/src/Exception.php new file mode 100644 index 00000000..4596c0a9 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Exception.php @@ -0,0 +1,8 @@ +filesystem->has($this->path); + } + + /** + * Read the file. + * + * @return string|false file contents + */ + public function read() + { + return $this->filesystem->read($this->path); + } + + /** + * Read the file as a stream. + * + * @return resource|false file stream + */ + public function readStream() + { + return $this->filesystem->readStream($this->path); + } + + /** + * Write the new file. + * + * @param string $content + * + * @return bool success boolean + */ + public function write($content) + { + return $this->filesystem->write($this->path, $content); + } + + /** + * Write the new file using a stream. + * + * @param resource $resource + * + * @return bool success boolean + */ + public function writeStream($resource) + { + return $this->filesystem->writeStream($this->path, $resource); + } + + /** + * Update the file contents. + * + * @param string $content + * + * @return bool success boolean + */ + public function update($content) + { + return $this->filesystem->update($this->path, $content); + } + + /** + * Update the file contents with a stream. + * + * @param resource $resource + * + * @return bool success boolean + */ + public function updateStream($resource) + { + return $this->filesystem->updateStream($this->path, $resource); + } + + /** + * Create the file or update if exists. + * + * @param string $content + * + * @return bool success boolean + */ + public function put($content) + { + return $this->filesystem->put($this->path, $content); + } + + /** + * Create the file or update if exists using a stream. + * + * @param resource $resource + * + * @return bool success boolean + */ + public function putStream($resource) + { + return $this->filesystem->putStream($this->path, $resource); + } + + /** + * Rename the file. + * + * @param string $newpath + * + * @return bool success boolean + */ + public function rename($newpath) + { + if ($this->filesystem->rename($this->path, $newpath)) { + $this->path = $newpath; + + return true; + } + + return false; + } + + /** + * Copy the file. + * + * @param string $newpath + * + * @return File|false new file or false + */ + public function copy($newpath) + { + if ($this->filesystem->copy($this->path, $newpath)) { + return new File($this->filesystem, $newpath); + } + + return false; + } + + /** + * Get the file's timestamp. + * + * @return string|false The timestamp or false on failure. + */ + public function getTimestamp() + { + return $this->filesystem->getTimestamp($this->path); + } + + /** + * Get the file's mimetype. + * + * @return string|false The file mime-type or false on failure. + */ + public function getMimetype() + { + return $this->filesystem->getMimetype($this->path); + } + + /** + * Get the file's visibility. + * + * @return string|false The visibility (public|private) or false on failure. + */ + public function getVisibility() + { + return $this->filesystem->getVisibility($this->path); + } + + /** + * Get the file's metadata. + * + * @return array|false The file metadata or false on failure. + */ + public function getMetadata() + { + return $this->filesystem->getMetadata($this->path); + } + + /** + * Get the file size. + * + * @return int|false The file size or false on failure. + */ + public function getSize() + { + return $this->filesystem->getSize($this->path); + } + + /** + * Delete the file. + * + * @return bool success boolean + */ + public function delete() + { + return $this->filesystem->delete($this->path); + } +} diff --git a/trunk/vendor/league/flysystem/src/FileExistsException.php b/trunk/vendor/league/flysystem/src/FileExistsException.php new file mode 100644 index 00000000..c82e20c1 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/FileExistsException.php @@ -0,0 +1,37 @@ +path = $path; + + parent::__construct('File already exists at path: ' . $this->getPath(), $code, $previous); + } + + /** + * Get the path which was found. + * + * @return string + */ + public function getPath() + { + return $this->path; + } +} diff --git a/trunk/vendor/league/flysystem/src/FileNotFoundException.php b/trunk/vendor/league/flysystem/src/FileNotFoundException.php new file mode 100644 index 00000000..989df69b --- /dev/null +++ b/trunk/vendor/league/flysystem/src/FileNotFoundException.php @@ -0,0 +1,37 @@ +path = $path; + + parent::__construct('File not found at path: ' . $this->getPath(), $code, $previous); + } + + /** + * Get the path which was not found. + * + * @return string + */ + public function getPath() + { + return $this->path; + } +} diff --git a/trunk/vendor/league/flysystem/src/Filesystem.php b/trunk/vendor/league/flysystem/src/Filesystem.php new file mode 100644 index 00000000..c4eaf278 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Filesystem.php @@ -0,0 +1,409 @@ +adapter = $adapter; + $this->setConfig($config); + } + + /** + * Get the Adapter. + * + * @return AdapterInterface adapter + */ + public function getAdapter() + { + return $this->adapter; + } + + /** + * @inheritdoc + */ + public function has($path) + { + $path = Util::normalizePath($path); + + return strlen($path) === 0 ? false : (bool) $this->getAdapter()->has($path); + } + + /** + * @inheritdoc + */ + public function write($path, $contents, array $config = []) + { + $path = Util::normalizePath($path); + $this->assertAbsent($path); + $config = $this->prepareConfig($config); + + return (bool) $this->getAdapter()->write($path, $contents, $config); + } + + /** + * @inheritdoc + */ + public function writeStream($path, $resource, array $config = []) + { + if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { + throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); + } + + $path = Util::normalizePath($path); + $this->assertAbsent($path); + $config = $this->prepareConfig($config); + + Util::rewindStream($resource); + + return (bool) $this->getAdapter()->writeStream($path, $resource, $config); + } + + /** + * @inheritdoc + */ + public function put($path, $contents, array $config = []) + { + $path = Util::normalizePath($path); + $config = $this->prepareConfig($config); + + if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { + return (bool) $this->getAdapter()->update($path, $contents, $config); + } + + return (bool) $this->getAdapter()->write($path, $contents, $config); + } + + /** + * @inheritdoc + */ + public function putStream($path, $resource, array $config = []) + { + if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { + throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); + } + + $path = Util::normalizePath($path); + $config = $this->prepareConfig($config); + Util::rewindStream($resource); + + if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { + return (bool) $this->getAdapter()->updateStream($path, $resource, $config); + } + + return (bool) $this->getAdapter()->writeStream($path, $resource, $config); + } + + /** + * @inheritdoc + */ + public function readAndDelete($path) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + $contents = $this->read($path); + + if ($contents === false) { + return false; + } + + $this->delete($path); + + return $contents; + } + + /** + * @inheritdoc + */ + public function update($path, $contents, array $config = []) + { + $path = Util::normalizePath($path); + $config = $this->prepareConfig($config); + + $this->assertPresent($path); + + return (bool) $this->getAdapter()->update($path, $contents, $config); + } + + /** + * @inheritdoc + */ + public function updateStream($path, $resource, array $config = []) + { + if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { + throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); + } + + $path = Util::normalizePath($path); + $config = $this->prepareConfig($config); + $this->assertPresent($path); + Util::rewindStream($resource); + + return (bool) $this->getAdapter()->updateStream($path, $resource, $config); + } + + /** + * @inheritdoc + */ + public function read($path) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + + if ( ! ($object = $this->getAdapter()->read($path))) { + return false; + } + + return $object['contents']; + } + + /** + * @inheritdoc + */ + public function readStream($path) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + + if ( ! $object = $this->getAdapter()->readStream($path)) { + return false; + } + + return $object['stream']; + } + + /** + * @inheritdoc + */ + public function rename($path, $newpath) + { + $path = Util::normalizePath($path); + $newpath = Util::normalizePath($newpath); + $this->assertPresent($path); + $this->assertAbsent($newpath); + + return (bool) $this->getAdapter()->rename($path, $newpath); + } + + /** + * @inheritdoc + */ + public function copy($path, $newpath) + { + $path = Util::normalizePath($path); + $newpath = Util::normalizePath($newpath); + $this->assertPresent($path); + $this->assertAbsent($newpath); + + return $this->getAdapter()->copy($path, $newpath); + } + + /** + * @inheritdoc + */ + public function delete($path) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + + return $this->getAdapter()->delete($path); + } + + /** + * @inheritdoc + */ + public function deleteDir($dirname) + { + $dirname = Util::normalizePath($dirname); + + if ($dirname === '') { + throw new RootViolationException('Root directories can not be deleted.'); + } + + return (bool) $this->getAdapter()->deleteDir($dirname); + } + + /** + * @inheritdoc + */ + public function createDir($dirname, array $config = []) + { + $dirname = Util::normalizePath($dirname); + $config = $this->prepareConfig($config); + + return (bool) $this->getAdapter()->createDir($dirname, $config); + } + + /** + * @inheritdoc + */ + public function listContents($directory = '', $recursive = false) + { + $directory = Util::normalizePath($directory); + $contents = $this->getAdapter()->listContents($directory, $recursive); + + return (new ContentListingFormatter($directory, $recursive, $this->config->get('case_sensitive', true))) + ->formatListing($contents); + } + + /** + * @inheritdoc + */ + public function getMimetype($path) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + + if (( ! $object = $this->getAdapter()->getMimetype($path)) || ! array_key_exists('mimetype', $object)) { + return false; + } + + return $object['mimetype']; + } + + /** + * @inheritdoc + */ + public function getTimestamp($path) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + + if (( ! $object = $this->getAdapter()->getTimestamp($path)) || ! array_key_exists('timestamp', $object)) { + return false; + } + + return (int) $object['timestamp']; + } + + /** + * @inheritdoc + */ + public function getVisibility($path) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + + if (( ! $object = $this->getAdapter()->getVisibility($path)) || ! array_key_exists('visibility', $object)) { + return false; + } + + return $object['visibility']; + } + + /** + * @inheritdoc + */ + public function getSize($path) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + + if (( ! $object = $this->getAdapter()->getSize($path)) || ! array_key_exists('size', $object)) { + return false; + } + + return (int) $object['size']; + } + + /** + * @inheritdoc + */ + public function setVisibility($path, $visibility) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + + return (bool) $this->getAdapter()->setVisibility($path, $visibility); + } + + /** + * @inheritdoc + */ + public function getMetadata($path) + { + $path = Util::normalizePath($path); + $this->assertPresent($path); + + return $this->getAdapter()->getMetadata($path); + } + + /** + * @inheritdoc + */ + public function get($path, Handler $handler = null) + { + $path = Util::normalizePath($path); + + if ( ! $handler) { + $metadata = $this->getMetadata($path); + $handler = ($metadata && $metadata['type'] === 'file') ? new File($this, $path) : new Directory($this, $path); + } + + $handler->setPath($path); + $handler->setFilesystem($this); + + return $handler; + } + + /** + * Assert a file is present. + * + * @param string $path path to file + * + * @throws FileNotFoundException + * + * @return void + */ + public function assertPresent($path) + { + if ($this->config->get('disable_asserts', false) === false && ! $this->has($path)) { + throw new FileNotFoundException($path); + } + } + + /** + * Assert a file is absent. + * + * @param string $path path to file + * + * @throws FileExistsException + * + * @return void + */ + public function assertAbsent($path) + { + if ($this->config->get('disable_asserts', false) === false && $this->has($path)) { + throw new FileExistsException($path); + } + } +} diff --git a/trunk/vendor/league/flysystem/src/FilesystemException.php b/trunk/vendor/league/flysystem/src/FilesystemException.php new file mode 100644 index 00000000..3121e533 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/FilesystemException.php @@ -0,0 +1,7 @@ +path = $path; + $this->filesystem = $filesystem; + } + + /** + * Check whether the entree is a directory. + * + * @return bool + */ + public function isDir() + { + return $this->getType() === 'dir'; + } + + /** + * Check whether the entree is a file. + * + * @return bool + */ + public function isFile() + { + return $this->getType() === 'file'; + } + + /** + * Retrieve the entree type (file|dir). + * + * @return string file or dir + */ + public function getType() + { + $metadata = $this->filesystem->getMetadata($this->path); + + return $metadata ? $metadata['type'] : 'dir'; + } + + /** + * Set the Filesystem object. + * + * @param FilesystemInterface $filesystem + * + * @return $this + */ + public function setFilesystem(FilesystemInterface $filesystem) + { + $this->filesystem = $filesystem; + + return $this; + } + + /** + * Retrieve the Filesystem object. + * + * @return FilesystemInterface + */ + public function getFilesystem() + { + return $this->filesystem; + } + + /** + * Set the entree path. + * + * @param string $path + * + * @return $this + */ + public function setPath($path) + { + $this->path = $path; + + return $this; + } + + /** + * Retrieve the entree path. + * + * @return string path + */ + public function getPath() + { + return $this->path; + } + + /** + * Plugins pass-through. + * + * @param string $method + * @param array $arguments + * + * @return mixed + */ + public function __call($method, array $arguments) + { + array_unshift($arguments, $this->path); + $callback = [$this->filesystem, $method]; + + try { + return call_user_func_array($callback, $arguments); + } catch (BadMethodCallException $e) { + throw new BadMethodCallException( + 'Call to undefined method ' + . get_called_class() + . '::' . $method + ); + } + } +} diff --git a/trunk/vendor/league/flysystem/src/InvalidRootException.php b/trunk/vendor/league/flysystem/src/InvalidRootException.php new file mode 100644 index 00000000..468d1d58 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/InvalidRootException.php @@ -0,0 +1,9 @@ + Filesystem,] + * + * @throws InvalidArgumentException + */ + public function __construct(array $filesystems = []) + { + $this->mountFilesystems($filesystems); + } + + /** + * Mount filesystems. + * + * @param FilesystemInterface[] $filesystems [:prefix => Filesystem,] + * + * @throws InvalidArgumentException + * + * @return $this + */ + public function mountFilesystems(array $filesystems) + { + foreach ($filesystems as $prefix => $filesystem) { + $this->mountFilesystem($prefix, $filesystem); + } + + return $this; + } + + /** + * Mount filesystems. + * + * @param string $prefix + * @param FilesystemInterface $filesystem + * + * @throws InvalidArgumentException + * + * @return $this + */ + public function mountFilesystem($prefix, FilesystemInterface $filesystem) + { + if ( ! is_string($prefix)) { + throw new InvalidArgumentException(__METHOD__ . ' expects argument #1 to be a string.'); + } + + $this->filesystems[$prefix] = $filesystem; + + return $this; + } + + /** + * Get the filesystem with the corresponding prefix. + * + * @param string $prefix + * + * @throws FilesystemNotFoundException + * + * @return FilesystemInterface + */ + public function getFilesystem($prefix) + { + if ( ! isset($this->filesystems[$prefix])) { + throw new FilesystemNotFoundException('No filesystem mounted with prefix ' . $prefix); + } + + return $this->filesystems[$prefix]; + } + + /** + * Retrieve the prefix from an arguments array. + * + * @param array $arguments + * + * @throws InvalidArgumentException + * + * @return array [:prefix, :arguments] + */ + public function filterPrefix(array $arguments) + { + if (empty($arguments)) { + throw new InvalidArgumentException('At least one argument needed'); + } + + $path = array_shift($arguments); + + if ( ! is_string($path)) { + throw new InvalidArgumentException('First argument should be a string'); + } + + list($prefix, $path) = $this->getPrefixAndPath($path); + array_unshift($arguments, $path); + + return [$prefix, $arguments]; + } + + /** + * @param string $directory + * @param bool $recursive + * + * @throws InvalidArgumentException + * @throws FilesystemNotFoundException + * + * @return array + */ + public function listContents($directory = '', $recursive = false) + { + list($prefix, $directory) = $this->getPrefixAndPath($directory); + $filesystem = $this->getFilesystem($prefix); + $result = $filesystem->listContents($directory, $recursive); + + foreach ($result as &$file) { + $file['filesystem'] = $prefix; + } + + return $result; + } + + /** + * Call forwarder. + * + * @param string $method + * @param array $arguments + * + * @throws InvalidArgumentException + * @throws FilesystemNotFoundException + * + * @return mixed + */ + public function __call($method, $arguments) + { + list($prefix, $arguments) = $this->filterPrefix($arguments); + + return $this->invokePluginOnFilesystem($method, $arguments, $prefix); + } + + /** + * @param string $from + * @param string $to + * @param array $config + * + * @throws InvalidArgumentException + * @throws FilesystemNotFoundException + * @throws FileExistsException + * + * @return bool + */ + public function copy($from, $to, array $config = []) + { + list($prefixFrom, $from) = $this->getPrefixAndPath($from); + + $buffer = $this->getFilesystem($prefixFrom)->readStream($from); + + if ($buffer === false) { + return false; + } + + list($prefixTo, $to) = $this->getPrefixAndPath($to); + + $result = $this->getFilesystem($prefixTo)->writeStream($to, $buffer, $config); + + if (is_resource($buffer)) { + fclose($buffer); + } + + return $result; + } + + /** + * List with plugin adapter. + * + * @param array $keys + * @param string $directory + * @param bool $recursive + * + * @throws InvalidArgumentException + * @throws FilesystemNotFoundException + * + * @return array + */ + public function listWith(array $keys = [], $directory = '', $recursive = false) + { + list($prefix, $directory) = $this->getPrefixAndPath($directory); + $arguments = [$keys, $directory, $recursive]; + + return $this->invokePluginOnFilesystem('listWith', $arguments, $prefix); + } + + /** + * Move a file. + * + * @param string $from + * @param string $to + * @param array $config + * + * @throws InvalidArgumentException + * @throws FilesystemNotFoundException + * + * @return bool + */ + public function move($from, $to, array $config = []) + { + list($prefixFrom, $pathFrom) = $this->getPrefixAndPath($from); + list($prefixTo, $pathTo) = $this->getPrefixAndPath($to); + + if ($prefixFrom === $prefixTo) { + $filesystem = $this->getFilesystem($prefixFrom); + $renamed = $filesystem->rename($pathFrom, $pathTo); + + if ($renamed && isset($config['visibility'])) { + return $filesystem->setVisibility($pathTo, $config['visibility']); + } + + return $renamed; + } + + $copied = $this->copy($from, $to, $config); + + if ($copied) { + return $this->delete($from); + } + + return false; + } + + /** + * Invoke a plugin on a filesystem mounted on a given prefix. + * + * @param string $method + * @param array $arguments + * @param string $prefix + * + * @throws FilesystemNotFoundException + * + * @return mixed + */ + public function invokePluginOnFilesystem($method, $arguments, $prefix) + { + $filesystem = $this->getFilesystem($prefix); + + try { + return $this->invokePlugin($method, $arguments, $filesystem); + } catch (PluginNotFoundException $e) { + // Let it pass, it's ok, don't panic. + } + + $callback = [$filesystem, $method]; + + return call_user_func_array($callback, $arguments); + } + + /** + * @param string $path + * + * @throws InvalidArgumentException + * + * @return string[] [:prefix, :path] + */ + protected function getPrefixAndPath($path) + { + if (strpos($path, '://') < 1) { + throw new InvalidArgumentException('No prefix detected in path: ' . $path); + } + + return explode('://', $path, 2); + } + + /** + * Check whether a file exists. + * + * @param string $path + * + * @return bool + */ + public function has($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->has($path); + } + + /** + * Read a file. + * + * @param string $path The path to the file. + * + * @throws FileNotFoundException + * + * @return string|false The file contents or false on failure. + */ + public function read($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->read($path); + } + + /** + * Retrieves a read-stream for a path. + * + * @param string $path The path to the file. + * + * @throws FileNotFoundException + * + * @return resource|false The path resource or false on failure. + */ + public function readStream($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->readStream($path); + } + + /** + * Get a file's metadata. + * + * @param string $path The path to the file. + * + * @throws FileNotFoundException + * + * @return array|false The file metadata or false on failure. + */ + public function getMetadata($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->getMetadata($path); + } + + /** + * Get a file's size. + * + * @param string $path The path to the file. + * + * @throws FileNotFoundException + * + * @return int|false The file size or false on failure. + */ + public function getSize($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->getSize($path); + } + + /** + * Get a file's mime-type. + * + * @param string $path The path to the file. + * + * @throws FileNotFoundException + * + * @return string|false The file mime-type or false on failure. + */ + public function getMimetype($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->getMimetype($path); + } + + /** + * Get a file's timestamp. + * + * @param string $path The path to the file. + * + * @throws FileNotFoundException + * + * @return string|false The timestamp or false on failure. + */ + public function getTimestamp($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->getTimestamp($path); + } + + /** + * Get a file's visibility. + * + * @param string $path The path to the file. + * + * @throws FileNotFoundException + * + * @return string|false The visibility (public|private) or false on failure. + */ + public function getVisibility($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->getVisibility($path); + } + + /** + * Write a new file. + * + * @param string $path The path of the new file. + * @param string $contents The file contents. + * @param array $config An optional configuration array. + * + * @throws FileExistsException + * + * @return bool True on success, false on failure. + */ + public function write($path, $contents, array $config = []) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->write($path, $contents, $config); + } + + /** + * Write a new file using a stream. + * + * @param string $path The path of the new file. + * @param resource $resource The file handle. + * @param array $config An optional configuration array. + * + * @throws InvalidArgumentException If $resource is not a file handle. + * @throws FileExistsException + * + * @return bool True on success, false on failure. + */ + public function writeStream($path, $resource, array $config = []) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->writeStream($path, $resource, $config); + } + + /** + * Update an existing file. + * + * @param string $path The path of the existing file. + * @param string $contents The file contents. + * @param array $config An optional configuration array. + * + * @throws FileNotFoundException + * + * @return bool True on success, false on failure. + */ + public function update($path, $contents, array $config = []) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->update($path, $contents, $config); + } + + /** + * Update an existing file using a stream. + * + * @param string $path The path of the existing file. + * @param resource $resource The file handle. + * @param array $config An optional configuration array. + * + * @throws InvalidArgumentException If $resource is not a file handle. + * @throws FileNotFoundException + * + * @return bool True on success, false on failure. + */ + public function updateStream($path, $resource, array $config = []) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->updateStream($path, $resource, $config); + } + + /** + * Rename a file. + * + * @param string $path Path to the existing file. + * @param string $newpath The new path of the file. + * + * @throws FileExistsException Thrown if $newpath exists. + * @throws FileNotFoundException Thrown if $path does not exist. + * + * @return bool True on success, false on failure. + */ + public function rename($path, $newpath) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->rename($path, $newpath); + } + + /** + * Delete a file. + * + * @param string $path + * + * @throws FileNotFoundException + * + * @return bool True on success, false on failure. + */ + public function delete($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->delete($path); + } + + /** + * Delete a directory. + * + * @param string $dirname + * + * @throws RootViolationException Thrown if $dirname is empty. + * + * @return bool True on success, false on failure. + */ + public function deleteDir($dirname) + { + list($prefix, $dirname) = $this->getPrefixAndPath($dirname); + + return $this->getFilesystem($prefix)->deleteDir($dirname); + } + + /** + * Create a directory. + * + * @param string $dirname The name of the new directory. + * @param array $config An optional configuration array. + * + * @return bool True on success, false on failure. + */ + public function createDir($dirname, array $config = []) + { + list($prefix, $dirname) = $this->getPrefixAndPath($dirname); + + return $this->getFilesystem($prefix)->createDir($dirname); + } + + /** + * Set the visibility for a file. + * + * @param string $path The path to the file. + * @param string $visibility One of 'public' or 'private'. + * + * @throws FileNotFoundException + * + * @return bool True on success, false on failure. + */ + public function setVisibility($path, $visibility) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->setVisibility($path, $visibility); + } + + /** + * Create a file or update if exists. + * + * @param string $path The path to the file. + * @param string $contents The file contents. + * @param array $config An optional configuration array. + * + * @return bool True on success, false on failure. + */ + public function put($path, $contents, array $config = []) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->put($path, $contents, $config); + } + + /** + * Create a file or update if exists. + * + * @param string $path The path to the file. + * @param resource $resource The file handle. + * @param array $config An optional configuration array. + * + * @throws InvalidArgumentException Thrown if $resource is not a resource. + * + * @return bool True on success, false on failure. + */ + public function putStream($path, $resource, array $config = []) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->putStream($path, $resource, $config); + } + + /** + * Read and delete a file. + * + * @param string $path The path to the file. + * + * @throws FileNotFoundException + * + * @return string|false The file contents, or false on failure. + */ + public function readAndDelete($path) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->readAndDelete($path); + } + + /** + * Get a file/directory handler. + * + * @deprecated + * + * @param string $path The path to the file. + * @param Handler $handler An optional existing handler to populate. + * + * @return Handler Either a file or directory handler. + */ + public function get($path, Handler $handler = null) + { + list($prefix, $path) = $this->getPrefixAndPath($path); + + return $this->getFilesystem($prefix)->get($path); + } +} diff --git a/trunk/vendor/league/flysystem/src/NotSupportedException.php b/trunk/vendor/league/flysystem/src/NotSupportedException.php new file mode 100644 index 00000000..e0a989b2 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/NotSupportedException.php @@ -0,0 +1,37 @@ +getPathname()); + } + + /** + * Create a new exception for a link. + * + * @param string $systemType + * + * @return static + */ + public static function forFtpSystemType($systemType) + { + $message = "The FTP system type '$systemType' is currently not supported."; + + return new static($message); + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/AbstractPlugin.php b/trunk/vendor/league/flysystem/src/Plugin/AbstractPlugin.php new file mode 100644 index 00000000..0d567897 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/AbstractPlugin.php @@ -0,0 +1,24 @@ +filesystem = $filesystem; + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/EmptyDir.php b/trunk/vendor/league/flysystem/src/Plugin/EmptyDir.php new file mode 100644 index 00000000..b5ae7f58 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/EmptyDir.php @@ -0,0 +1,34 @@ +filesystem->listContents($dirname, false); + + foreach ($listing as $item) { + if ($item['type'] === 'dir') { + $this->filesystem->deleteDir($item['path']); + } else { + $this->filesystem->delete($item['path']); + } + } + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ForcedCopy.php b/trunk/vendor/league/flysystem/src/Plugin/ForcedCopy.php new file mode 100644 index 00000000..a41e9f3a --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/ForcedCopy.php @@ -0,0 +1,44 @@ +filesystem->delete($newpath); + } catch (FileNotFoundException $e) { + // The destination path does not exist. That's ok. + $deleted = true; + } + + if ($deleted) { + return $this->filesystem->copy($path, $newpath); + } + + return false; + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ForcedRename.php b/trunk/vendor/league/flysystem/src/Plugin/ForcedRename.php new file mode 100644 index 00000000..3f51cd60 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/ForcedRename.php @@ -0,0 +1,44 @@ +filesystem->delete($newpath); + } catch (FileNotFoundException $e) { + // The destination path does not exist. That's ok. + $deleted = true; + } + + if ($deleted) { + return $this->filesystem->rename($path, $newpath); + } + + return false; + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/GetWithMetadata.php b/trunk/vendor/league/flysystem/src/Plugin/GetWithMetadata.php new file mode 100644 index 00000000..2f13d2fd --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/GetWithMetadata.php @@ -0,0 +1,51 @@ +filesystem->getMetadata($path); + + if ( ! $object) { + return false; + } + + $keys = array_diff($metadata, array_keys($object)); + + foreach ($keys as $key) { + if ( ! method_exists($this->filesystem, $method = 'get' . ucfirst($key))) { + throw new InvalidArgumentException('Could not fetch metadata: ' . $key); + } + + $object[$key] = $this->filesystem->{$method}($path); + } + + return $object; + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ListFiles.php b/trunk/vendor/league/flysystem/src/Plugin/ListFiles.php new file mode 100644 index 00000000..9669fe7e --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/ListFiles.php @@ -0,0 +1,35 @@ +filesystem->listContents($directory, $recursive); + + $filter = function ($object) { + return $object['type'] === 'file'; + }; + + return array_values(array_filter($contents, $filter)); + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ListPaths.php b/trunk/vendor/league/flysystem/src/Plugin/ListPaths.php new file mode 100644 index 00000000..0889d1f8 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/ListPaths.php @@ -0,0 +1,36 @@ +filesystem->listContents($directory, $recursive); + + foreach ($contents as $object) { + $result[] = $object['path']; + } + + return $result; + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ListWith.php b/trunk/vendor/league/flysystem/src/Plugin/ListWith.php new file mode 100644 index 00000000..d64debec --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/ListWith.php @@ -0,0 +1,60 @@ +filesystem->listContents($directory, $recursive); + + foreach ($contents as $index => $object) { + if ($object['type'] === 'file') { + $missingKeys = array_diff($keys, array_keys($object)); + $contents[$index] = array_reduce($missingKeys, [$this, 'getMetadataByName'], $object); + } + } + + return $contents; + } + + /** + * Get a meta-data value by key name. + * + * @param array $object + * @param string $key + * + * @return array + */ + protected function getMetadataByName(array $object, $key) + { + $method = 'get' . ucfirst($key); + + if ( ! method_exists($this->filesystem, $method)) { + throw new \InvalidArgumentException('Could not get meta-data for key: ' . $key); + } + + $object[$key] = $this->filesystem->{$method}($object['path']); + + return $object; + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/PluggableTrait.php b/trunk/vendor/league/flysystem/src/Plugin/PluggableTrait.php new file mode 100644 index 00000000..922edfe5 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/PluggableTrait.php @@ -0,0 +1,97 @@ +plugins[$plugin->getMethod()] = $plugin; + + return $this; + } + + /** + * Find a specific plugin. + * + * @param string $method + * + * @throws PluginNotFoundException + * + * @return PluginInterface + */ + protected function findPlugin($method) + { + if ( ! isset($this->plugins[$method])) { + throw new PluginNotFoundException('Plugin not found for method: ' . $method); + } + + return $this->plugins[$method]; + } + + /** + * Invoke a plugin by method name. + * + * @param string $method + * @param array $arguments + * @param FilesystemInterface $filesystem + * + * @throws PluginNotFoundException + * + * @return mixed + */ + protected function invokePlugin($method, array $arguments, FilesystemInterface $filesystem) + { + $plugin = $this->findPlugin($method); + $plugin->setFilesystem($filesystem); + $callback = [$plugin, 'handle']; + + return call_user_func_array($callback, $arguments); + } + + /** + * Plugins pass-through. + * + * @param string $method + * @param array $arguments + * + * @throws BadMethodCallException + * + * @return mixed + */ + public function __call($method, array $arguments) + { + try { + return $this->invokePlugin($method, $arguments, $this); + } catch (PluginNotFoundException $e) { + throw new BadMethodCallException( + 'Call to undefined method ' + . get_class($this) + . '::' . $method + ); + } + } +} diff --git a/trunk/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php b/trunk/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php new file mode 100644 index 00000000..fd1d7e7e --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php @@ -0,0 +1,10 @@ +hash = spl_object_hash($this); + static::$safeStorage[$this->hash] = []; + } + + public function storeSafely($key, $value) + { + static::$safeStorage[$this->hash][$key] = $value; + } + + public function retrieveSafely($key) + { + if (array_key_exists($key, static::$safeStorage[$this->hash])) { + return static::$safeStorage[$this->hash][$key]; + } + } + + public function __destruct() + { + unset(static::$safeStorage[$this->hash]); + } +} diff --git a/trunk/vendor/league/flysystem/src/UnreadableFileException.php b/trunk/vendor/league/flysystem/src/UnreadableFileException.php new file mode 100644 index 00000000..e6680338 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/UnreadableFileException.php @@ -0,0 +1,18 @@ +getRealPath() + ) + ); + } +} diff --git a/trunk/vendor/league/flysystem/src/Util.php b/trunk/vendor/league/flysystem/src/Util.php new file mode 100644 index 00000000..1a2db718 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Util.php @@ -0,0 +1,354 @@ + '']; + } + + /** + * Normalize a dirname return value. + * + * @param string $dirname + * + * @return string normalized dirname + */ + public static function normalizeDirname($dirname) + { + return $dirname === '.' ? '' : $dirname; + } + + /** + * Get a normalized dirname from a path. + * + * @param string $path + * + * @return string dirname + */ + public static function dirname($path) + { + return static::normalizeDirname(dirname($path)); + } + + /** + * Map result arrays. + * + * @param array $object + * @param array $map + * + * @return array mapped result + */ + public static function map(array $object, array $map) + { + $result = []; + + foreach ($map as $from => $to) { + if ( ! isset($object[$from])) { + continue; + } + + $result[$to] = $object[$from]; + } + + return $result; + } + + /** + * Normalize path. + * + * @param string $path + * + * @throws LogicException + * + * @return string + */ + public static function normalizePath($path) + { + return static::normalizeRelativePath($path); + } + + /** + * Normalize relative directories in a path. + * + * @param string $path + * + * @throws LogicException + * + * @return string + */ + public static function normalizeRelativePath($path) + { + $path = str_replace('\\', '/', $path); + $path = static::removeFunkyWhiteSpace($path); + $parts = []; + + foreach (explode('/', $path) as $part) { + switch ($part) { + case '': + case '.': + break; + + case '..': + if (empty($parts)) { + throw new LogicException( + 'Path is outside of the defined root, path: [' . $path . ']' + ); + } + array_pop($parts); + break; + + default: + $parts[] = $part; + break; + } + } + + $path = implode('/', $parts); + + return $path; + } + + /** + * Rejects unprintable characters and invalid unicode characters. + * + * @param string $path + * + * @return string $path + */ + protected static function removeFunkyWhiteSpace($path) + { + if (preg_match('#\p{C}+#u', $path)) { + throw CorruptedPathDetected::forPath($path); + } + + return $path; + } + + /** + * Normalize prefix. + * + * @param string $prefix + * @param string $separator + * + * @return string normalized path + */ + public static function normalizePrefix($prefix, $separator) + { + return rtrim($prefix, $separator) . $separator; + } + + /** + * Get content size. + * + * @param string $contents + * + * @return int content size + */ + public static function contentSize($contents) + { + return defined('MB_OVERLOAD_STRING') ? mb_strlen($contents, '8bit') : strlen($contents); + } + + /** + * Guess MIME Type based on the path of the file and it's content. + * + * @param string $path + * @param string|resource $content + * + * @return string|null MIME Type or NULL if no extension detected + */ + public static function guessMimeType($path, $content) + { + $mimeType = MimeType::detectByContent($content); + + if ( ! (empty($mimeType) || in_array($mimeType, ['application/x-empty', 'text/plain', 'text/x-asm']))) { + return $mimeType; + } + + return MimeType::detectByFilename($path); + } + + /** + * Emulate directories. + * + * @param array $listing + * + * @return array listing with emulated directories + */ + public static function emulateDirectories(array $listing) + { + $directories = []; + $listedDirectories = []; + + foreach ($listing as $object) { + [$directories, $listedDirectories] = static::emulateObjectDirectories($object, $directories, $listedDirectories); + } + + $directories = array_diff(array_unique($directories), array_unique($listedDirectories)); + + foreach ($directories as $directory) { + $listing[] = static::pathinfo($directory) + ['type' => 'dir']; + } + + return $listing; + } + + /** + * Ensure a Config instance. + * + * @param null|array|Config $config + * + * @return Config config instance + * + * @throw LogicException + */ + public static function ensureConfig($config) + { + if ($config === null) { + return new Config(); + } + + if ($config instanceof Config) { + return $config; + } + + if (is_array($config)) { + return new Config($config); + } + + throw new LogicException('A config should either be an array or a Flysystem\Config object.'); + } + + /** + * Rewind a stream. + * + * @param resource $resource + */ + public static function rewindStream($resource) + { + if (ftell($resource) !== 0 && static::isSeekableStream($resource)) { + rewind($resource); + } + } + + public static function isSeekableStream($resource) + { + $metadata = stream_get_meta_data($resource); + + return $metadata['seekable']; + } + + /** + * Get the size of a stream. + * + * @param resource $resource + * + * @return int|null stream size + */ + public static function getStreamSize($resource) + { + $stat = fstat($resource); + + if ( ! is_array($stat) || ! isset($stat['size'])) { + return null; + } + + return $stat['size']; + } + + /** + * Emulate the directories of a single object. + * + * @param array $object + * @param array $directories + * @param array $listedDirectories + * + * @return array + */ + protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories) + { + if ($object['type'] === 'dir') { + $listedDirectories[] = $object['path']; + } + + if ( ! isset($object['dirname']) || trim($object['dirname']) === '') { + return [$directories, $listedDirectories]; + } + + $parent = $object['dirname']; + + while (isset($parent) && trim($parent) !== '' && ! in_array($parent, $directories)) { + $directories[] = $parent; + $parent = static::dirname($parent); + } + + if (isset($object['type']) && $object['type'] === 'dir') { + $listedDirectories[] = $object['path']; + + return [$directories, $listedDirectories]; + } + + return [$directories, $listedDirectories]; + } + + /** + * Returns the trailing name component of the path. + * + * @param string $path + * + * @return string + */ + private static function basename($path) + { + $separators = DIRECTORY_SEPARATOR === '/' ? '/' : '\/'; + + $path = rtrim($path, $separators); + + $basename = preg_replace('#.*?([^' . preg_quote($separators, '#') . ']+$)#', '$1', $path); + + if (DIRECTORY_SEPARATOR === '/') { + return $basename; + } + // @codeCoverageIgnoreStart + // Extra Windows path munging. This is tested via AppVeyor, but code + // coverage is not reported. + + // Handle relative paths with drive letters. c:file.txt. + while (preg_match('#^[a-zA-Z]{1}:[^\\\/]#', $basename)) { + $basename = substr($basename, 2); + } + + // Remove colon for standalone drive letter names. + if (preg_match('#^[a-zA-Z]{1}:$#', $basename)) { + $basename = rtrim($basename, ':'); + } + + return $basename; + // @codeCoverageIgnoreEnd + } +} diff --git a/trunk/vendor/league/flysystem/src/Util/ContentListingFormatter.php b/trunk/vendor/league/flysystem/src/Util/ContentListingFormatter.php new file mode 100644 index 00000000..ae0d3b91 --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Util/ContentListingFormatter.php @@ -0,0 +1,122 @@ +directory = rtrim($directory, '/'); + $this->recursive = $recursive; + $this->caseSensitive = $caseSensitive; + } + + /** + * Format contents listing. + * + * @param array $listing + * + * @return array + */ + public function formatListing(array $listing) + { + $listing = array_filter(array_map([$this, 'addPathInfo'], $listing), [$this, 'isEntryOutOfScope']); + + return $this->sortListing(array_values($listing)); + } + + private function addPathInfo(array $entry) + { + return $entry + Util::pathinfo($entry['path']); + } + + /** + * Determine if the entry is out of scope. + * + * @param array $entry + * + * @return bool + */ + private function isEntryOutOfScope(array $entry) + { + if (empty($entry['path']) && $entry['path'] !== '0') { + return false; + } + + if ($this->recursive) { + return $this->residesInDirectory($entry); + } + + return $this->isDirectChild($entry); + } + + /** + * Check if the entry resides within the parent directory. + * + * @param array $entry + * + * @return bool + */ + private function residesInDirectory(array $entry) + { + if ($this->directory === '') { + return true; + } + + return $this->caseSensitive + ? strpos($entry['path'], $this->directory . '/') === 0 + : stripos($entry['path'], $this->directory . '/') === 0; + } + + /** + * Check if the entry is a direct child of the directory. + * + * @param array $entry + * + * @return bool + */ + private function isDirectChild(array $entry) + { + return $this->caseSensitive + ? $entry['dirname'] === $this->directory + : strcasecmp($this->directory, $entry['dirname']) === 0; + } + + /** + * @param array $listing + * + * @return array + */ + private function sortListing(array $listing) + { + usort($listing, function ($a, $b) { + return strcasecmp($a['path'], $b['path']); + }); + + return $listing; + } +} diff --git a/trunk/vendor/league/flysystem/src/Util/MimeType.php b/trunk/vendor/league/flysystem/src/Util/MimeType.php new file mode 100644 index 00000000..35cba3fb --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Util/MimeType.php @@ -0,0 +1,80 @@ +detectMimeTypeFromBuffer($content); + } + + return 'text/plain'; + } + + /** + * Detects MIME Type based on file extension. + * + * @param string $extension + * + * @return string MIME Type + */ + public static function detectByFileExtension($extension) + { + return static::detector()->detectMimeTypeFromPath('artificial.' . $extension) ?: 'text/plain'; + } + + /** + * @param string $filename + * + * @return string MIME Type + */ + public static function detectByFilename($filename) + { + return static::detector()->detectMimeTypeFromPath($filename) ?: 'text/plain'; + } + + /** + * @return array Map of file extension to MIME Type + */ + public static function getExtensionToMimeTypeMap() + { + return static::$extensionToMimeTypeMap; + } +} diff --git a/trunk/vendor/league/flysystem/src/Util/StreamHasher.php b/trunk/vendor/league/flysystem/src/Util/StreamHasher.php new file mode 100644 index 00000000..938ec5db --- /dev/null +++ b/trunk/vendor/league/flysystem/src/Util/StreamHasher.php @@ -0,0 +1,36 @@ +algo = $algo; + } + + /** + * @param resource $resource + * + * @return string + */ + public function hash($resource) + { + rewind($resource); + $context = hash_init($this->algo); + hash_update_stream($context, $resource); + fclose($resource); + + return hash_final($context); + } +} diff --git a/trunk/vendor/league/mime-type-detection/CHANGELOG.md b/trunk/vendor/league/mime-type-detection/CHANGELOG.md new file mode 100644 index 00000000..a45872a9 --- /dev/null +++ b/trunk/vendor/league/mime-type-detection/CHANGELOG.md @@ -0,0 +1,59 @@ +# Changelog + +## 1.15.0 - 2024-01-28 + +- Updated lookup + +## 1.14.0 - 2022-10-17 + +### Updated + +- Updated lookup + +## 1.13.0 - 2023-08-05 + +### Added + +- A reverse lookup mechanism to fetch one or all extensions for a given mimetype + +## 1.12.0 - 2023-08-03 + +### Updated + +- Updated lookup + +## 1.11.0 - 2023-04-17 + +### Updated + +- Updated lookup + +## 1.10.0 - 2022-04-11 + +### Fixed + +- Added Flysystem v1 inconclusive mime-types and made it configurable as a constructor parameter. + +## 1.9.0 - 2021-11-21 + +### Updated + +- Updated lookup + +## 1.8.0 - 2021-09-25 + +### Added + +- Added the decorator `OverridingExtensionToMimeTypeMap` which allows you to override values. + +## 1.7.0 - 2021-01-18 + +### Added + +- Added a `bufferSampleSize` parameter to the `FinfoMimeTypeDetector` class that allows you to send a reduced content sample which costs less memory. + +## 1.6.0 - 2021-01-18 + +### Changes + +- Updated generated mime-type map diff --git a/trunk/vendor/league/mime-type-detection/LICENSE b/trunk/vendor/league/mime-type-detection/LICENSE new file mode 100644 index 00000000..39d50b5e --- /dev/null +++ b/trunk/vendor/league/mime-type-detection/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2013-2023 Frank de Jonge + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php b/trunk/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php new file mode 100644 index 00000000..fc042416 --- /dev/null +++ b/trunk/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php @@ -0,0 +1,13 @@ +extensions = $extensions ?: new GeneratedExtensionToMimeTypeMap(); + } + + public function detectMimeType(string $path, $contents): ?string + { + return $this->detectMimeTypeFromPath($path); + } + + public function detectMimeTypeFromPath(string $path): ?string + { + $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); + + return $this->extensions->lookupMimeType($extension); + } + + public function detectMimeTypeFromFile(string $path): ?string + { + return $this->detectMimeTypeFromPath($path); + } + + public function detectMimeTypeFromBuffer(string $contents): ?string + { + return null; + } + + public function lookupExtension(string $mimetype): ?string + { + return $this->extensions instanceof ExtensionLookup + ? $this->extensions->lookupExtension($mimetype) + : null; + } + + public function lookupAllExtensions(string $mimetype): array + { + return $this->extensions instanceof ExtensionLookup + ? $this->extensions->lookupAllExtensions($mimetype) + : []; + } +} diff --git a/trunk/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php b/trunk/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php new file mode 100644 index 00000000..1dad7bc1 --- /dev/null +++ b/trunk/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php @@ -0,0 +1,10 @@ + + */ + private $inconclusiveMimetypes; + + public function __construct( + string $magicFile = '', + ExtensionToMimeTypeMap $extensionMap = null, + ?int $bufferSampleSize = null, + array $inconclusiveMimetypes = self::INCONCLUSIVE_MIME_TYPES + ) { + $this->finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile); + $this->extensionMap = $extensionMap ?: new GeneratedExtensionToMimeTypeMap(); + $this->bufferSampleSize = $bufferSampleSize; + $this->inconclusiveMimetypes = $inconclusiveMimetypes; + } + + public function detectMimeType(string $path, $contents): ?string + { + $mimeType = is_string($contents) + ? (@$this->finfo->buffer($this->takeSample($contents)) ?: null) + : null; + + if ($mimeType !== null && ! in_array($mimeType, $this->inconclusiveMimetypes)) { + return $mimeType; + } + + return $this->detectMimeTypeFromPath($path); + } + + public function detectMimeTypeFromPath(string $path): ?string + { + $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); + + return $this->extensionMap->lookupMimeType($extension); + } + + public function detectMimeTypeFromFile(string $path): ?string + { + return @$this->finfo->file($path) ?: null; + } + + public function detectMimeTypeFromBuffer(string $contents): ?string + { + return @$this->finfo->buffer($this->takeSample($contents)) ?: null; + } + + private function takeSample(string $contents): string + { + if ($this->bufferSampleSize === null) { + return $contents; + } + + return (string) substr($contents, 0, $this->bufferSampleSize); + } + + public function lookupExtension(string $mimetype): ?string + { + return $this->extensionMap instanceof ExtensionLookup + ? $this->extensionMap->lookupExtension($mimetype) + : null; + } + + public function lookupAllExtensions(string $mimetype): array + { + return $this->extensionMap instanceof ExtensionLookup + ? $this->extensionMap->lookupAllExtensions($mimetype) + : []; + } +} diff --git a/trunk/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php b/trunk/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php new file mode 100644 index 00000000..1ce17911 --- /dev/null +++ b/trunk/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php @@ -0,0 +1,2298 @@ + + * + * @internal + */ + public const MIME_TYPES_FOR_EXTENSIONS = [ + '1km' => 'application/vnd.1000minds.decision-model+xml', + '3dml' => 'text/vnd.in3d.3dml', + '3ds' => 'image/x-3ds', + '3g2' => 'video/3gpp2', + '3gp' => 'video/3gp', + '3gpp' => 'video/3gpp', + '3mf' => 'model/3mf', + '7z' => 'application/x-7z-compressed', + '7zip' => 'application/x-7z-compressed', + '123' => 'application/vnd.lotus-1-2-3', + 'aab' => 'application/x-authorware-bin', + 'aac' => 'audio/acc', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abw' => 'application/x-abiword', + 'ac' => 'application/vnd.nokia.n-gage.ac+xml', + 'ac3' => 'audio/ac3', + 'acc' => 'application/vnd.americandynamics.acc', + 'ace' => 'application/x-ace-compressed', + 'acu' => 'application/vnd.acucobol', + 'acutc' => 'application/vnd.acucorp', + 'adp' => 'audio/adpcm', + 'adts' => 'audio/aac', + 'aep' => 'application/vnd.audiograph', + 'afm' => 'application/x-font-type1', + 'afp' => 'application/vnd.ibm.modcap', + 'age' => 'application/vnd.age', + 'ahead' => 'application/vnd.ahead.space', + 'ai' => 'application/pdf', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'air' => 'application/vnd.adobe.air-application-installer-package+zip', + 'ait' => 'application/vnd.dvb.ait', + 'ami' => 'application/vnd.amiga.ami', + 'aml' => 'application/automationml-aml+xml', + 'amlx' => 'application/automationml-amlx+zip', + 'amr' => 'audio/amr', + 'apk' => 'application/vnd.android.package-archive', + 'apng' => 'image/apng', + 'appcache' => 'text/cache-manifest', + 'appinstaller' => 'application/appinstaller', + 'application' => 'application/x-ms-application', + 'appx' => 'application/appx', + 'appxbundle' => 'application/appxbundle', + 'apr' => 'application/vnd.lotus-approach', + 'arc' => 'application/x-freearc', + 'arj' => 'application/x-arj', + 'asc' => 'application/pgp-signature', + 'asf' => 'video/x-ms-asf', + 'asm' => 'text/x-asm', + 'aso' => 'application/vnd.accpac.simply.aso', + 'asx' => 'video/x-ms-asf', + 'atc' => 'application/vnd.acucorp', + 'atom' => 'application/atom+xml', + 'atomcat' => 'application/atomcat+xml', + 'atomdeleted' => 'application/atomdeleted+xml', + 'atomsvc' => 'application/atomsvc+xml', + 'atx' => 'application/vnd.antix.game-component', + 'au' => 'audio/x-au', + 'avci' => 'image/avci', + 'avcs' => 'image/avcs', + 'avi' => 'video/x-msvideo', + 'avif' => 'image/avif', + 'aw' => 'application/applixware', + 'azf' => 'application/vnd.airzip.filesecure.azf', + 'azs' => 'application/vnd.airzip.filesecure.azs', + 'azv' => 'image/vnd.airzip.accelerator.azv', + 'azw' => 'application/vnd.amazon.ebook', + 'b16' => 'image/vnd.pco.b16', + 'bat' => 'application/x-msdownload', + 'bcpio' => 'application/x-bcpio', + 'bdf' => 'application/x-font-bdf', + 'bdm' => 'application/vnd.syncml.dm+wbxml', + 'bdoc' => 'application/x-bdoc', + 'bed' => 'application/vnd.realvnc.bed', + 'bh2' => 'application/vnd.fujitsu.oasysprs', + 'bin' => 'application/octet-stream', + 'blb' => 'application/x-blorb', + 'blorb' => 'application/x-blorb', + 'bmi' => 'application/vnd.bmi', + 'bmml' => 'application/vnd.balsamiq.bmml+xml', + 'bmp' => 'image/bmp', + 'book' => 'application/vnd.framemaker', + 'box' => 'application/vnd.previewsystems.box', + 'boz' => 'application/x-bzip2', + 'bpk' => 'application/octet-stream', + 'bpmn' => 'application/octet-stream', + 'brf' => 'application/braille', + 'bsp' => 'model/vnd.valve.source.compiled-map', + 'btf' => 'image/prs.btif', + 'btif' => 'image/prs.btif', + 'buffer' => 'application/octet-stream', + 'bz' => 'application/x-bzip', + 'bz2' => 'application/x-bzip2', + 'c' => 'text/x-c', + 'c4d' => 'application/vnd.clonk.c4group', + 'c4f' => 'application/vnd.clonk.c4group', + 'c4g' => 'application/vnd.clonk.c4group', + 'c4p' => 'application/vnd.clonk.c4group', + 'c4u' => 'application/vnd.clonk.c4group', + 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', + 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', + 'cab' => 'application/vnd.ms-cab-compressed', + 'caf' => 'audio/x-caf', + 'cap' => 'application/vnd.tcpdump.pcap', + 'car' => 'application/vnd.curl.car', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cb7' => 'application/x-cbr', + 'cba' => 'application/x-cbr', + 'cbr' => 'application/x-cbr', + 'cbt' => 'application/x-cbr', + 'cbz' => 'application/x-cbr', + 'cc' => 'text/x-c', + 'cco' => 'application/x-cocoa', + 'cct' => 'application/x-director', + 'ccxml' => 'application/ccxml+xml', + 'cdbcmsg' => 'application/vnd.contact.cmsg', + 'cdf' => 'application/x-netcdf', + 'cdfx' => 'application/cdfx+xml', + 'cdkey' => 'application/vnd.mediastation.cdkey', + 'cdmia' => 'application/cdmi-capability', + 'cdmic' => 'application/cdmi-container', + 'cdmid' => 'application/cdmi-domain', + 'cdmio' => 'application/cdmi-object', + 'cdmiq' => 'application/cdmi-queue', + 'cdr' => 'application/cdr', + 'cdx' => 'chemical/x-cdx', + 'cdxml' => 'application/vnd.chemdraw+xml', + 'cdy' => 'application/vnd.cinderella', + 'cer' => 'application/pkix-cert', + 'cfs' => 'application/x-cfs-compressed', + 'cgm' => 'image/cgm', + 'chat' => 'application/x-chat', + 'chm' => 'application/vnd.ms-htmlhelp', + 'chrt' => 'application/vnd.kde.kchart', + 'cif' => 'chemical/x-cif', + 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', + 'cil' => 'application/vnd.ms-artgalry', + 'cjs' => 'application/node', + 'cla' => 'application/vnd.claymore', + 'class' => 'application/octet-stream', + 'cld' => 'model/vnd.cld', + 'clkk' => 'application/vnd.crick.clicker.keyboard', + 'clkp' => 'application/vnd.crick.clicker.palette', + 'clkt' => 'application/vnd.crick.clicker.template', + 'clkw' => 'application/vnd.crick.clicker.wordbank', + 'clkx' => 'application/vnd.crick.clicker', + 'clp' => 'application/x-msclip', + 'cmc' => 'application/vnd.cosmocaller', + 'cmdf' => 'chemical/x-cmdf', + 'cml' => 'chemical/x-cml', + 'cmp' => 'application/vnd.yellowriver-custom-menu', + 'cmx' => 'image/x-cmx', + 'cod' => 'application/vnd.rim.cod', + 'coffee' => 'text/coffeescript', + 'com' => 'application/x-msdownload', + 'conf' => 'text/plain', + 'cpio' => 'application/x-cpio', + 'cpl' => 'application/cpl+xml', + 'cpp' => 'text/x-c', + 'cpt' => 'application/mac-compactpro', + 'crd' => 'application/x-mscardfile', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'crx' => 'application/x-chrome-extension', + 'cryptonote' => 'application/vnd.rig.cryptonote', + 'csh' => 'application/x-csh', + 'csl' => 'application/vnd.citationstyles.style+xml', + 'csml' => 'chemical/x-csml', + 'csp' => 'application/vnd.commonspace', + 'csr' => 'application/octet-stream', + 'css' => 'text/css', + 'cst' => 'application/x-director', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'curl' => 'text/vnd.curl', + 'cwl' => 'application/cwl', + 'cww' => 'application/prs.cww', + 'cxt' => 'application/x-director', + 'cxx' => 'text/x-c', + 'dae' => 'model/vnd.collada+xml', + 'daf' => 'application/vnd.mobius.daf', + 'dart' => 'application/vnd.dart', + 'dataless' => 'application/vnd.fdsn.seed', + 'davmount' => 'application/davmount+xml', + 'dbf' => 'application/vnd.dbf', + 'dbk' => 'application/docbook+xml', + 'dcr' => 'application/x-director', + 'dcurl' => 'text/vnd.curl.dcurl', + 'dd2' => 'application/vnd.oma.dd2+xml', + 'ddd' => 'application/vnd.fujixerox.ddd', + 'ddf' => 'application/vnd.syncml.dmddf+xml', + 'dds' => 'image/vnd.ms-dds', + 'deb' => 'application/x-debian-package', + 'def' => 'text/plain', + 'deploy' => 'application/octet-stream', + 'der' => 'application/x-x509-ca-cert', + 'dfac' => 'application/vnd.dreamfactory', + 'dgc' => 'application/x-dgc-compressed', + 'dib' => 'image/bmp', + 'dic' => 'text/x-c', + 'dir' => 'application/x-director', + 'dis' => 'application/vnd.mobius.dis', + 'disposition-notification' => 'message/disposition-notification', + 'dist' => 'application/octet-stream', + 'distz' => 'application/octet-stream', + 'djv' => 'image/vnd.djvu', + 'djvu' => 'image/vnd.djvu', + 'dll' => 'application/octet-stream', + 'dmg' => 'application/x-apple-diskimage', + 'dmn' => 'application/octet-stream', + 'dmp' => 'application/vnd.tcpdump.pcap', + 'dms' => 'application/octet-stream', + 'dna' => 'application/vnd.dna', + 'doc' => 'application/msword', + 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dot' => 'application/msword', + 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'dp' => 'application/vnd.osgi.dp', + 'dpg' => 'application/vnd.dpgraph', + 'dpx' => 'image/dpx', + 'dra' => 'audio/vnd.dra', + 'drle' => 'image/dicom-rle', + 'dsc' => 'text/prs.lines.tag', + 'dssc' => 'application/dssc+der', + 'dst' => 'application/octet-stream', + 'dtb' => 'application/x-dtbook+xml', + 'dtd' => 'application/xml-dtd', + 'dts' => 'audio/vnd.dts', + 'dtshd' => 'audio/vnd.dts.hd', + 'dump' => 'application/octet-stream', + 'dvb' => 'video/vnd.dvb.file', + 'dvi' => 'application/x-dvi', + 'dwd' => 'application/atsc-dwd+xml', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/vnd.dwg', + 'dxf' => 'image/vnd.dxf', + 'dxp' => 'application/vnd.spotfire.dxp', + 'dxr' => 'application/x-director', + 'ear' => 'application/java-archive', + 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', + 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', + 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', + 'ecma' => 'application/ecmascript', + 'edm' => 'application/vnd.novadigm.edm', + 'edx' => 'application/vnd.novadigm.edx', + 'efif' => 'application/vnd.picsel', + 'ei6' => 'application/vnd.pg.osasli', + 'elc' => 'application/octet-stream', + 'emf' => 'image/emf', + 'eml' => 'message/rfc822', + 'emma' => 'application/emma+xml', + 'emotionml' => 'application/emotionml+xml', + 'emz' => 'application/x-msmetafile', + 'eol' => 'audio/vnd.digital-winds', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'es3' => 'application/vnd.eszigno3+xml', + 'esa' => 'application/vnd.osgi.subsystem', + 'esf' => 'application/vnd.epson.esf', + 'et3' => 'application/vnd.eszigno3+xml', + 'etx' => 'text/x-setext', + 'eva' => 'application/x-eva', + 'evy' => 'application/x-envoy', + 'exe' => 'application/octet-stream', + 'exi' => 'application/exi', + 'exp' => 'application/express', + 'exr' => 'image/aces', + 'ext' => 'application/vnd.novadigm.ext', + 'ez' => 'application/andrew-inset', + 'ez2' => 'application/vnd.ezpix-album', + 'ez3' => 'application/vnd.ezpix-package', + 'f' => 'text/x-fortran', + 'f4v' => 'video/mp4', + 'f77' => 'text/x-fortran', + 'f90' => 'text/x-fortran', + 'fbs' => 'image/vnd.fastbidsheet', + 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', + 'fcs' => 'application/vnd.isac.fcs', + 'fdf' => 'application/vnd.fdf', + 'fdt' => 'application/fdt+xml', + 'fe_launch' => 'application/vnd.denovo.fcselayout-link', + 'fg5' => 'application/vnd.fujitsu.oasysgp', + 'fgd' => 'application/x-director', + 'fh' => 'image/x-freehand', + 'fh4' => 'image/x-freehand', + 'fh5' => 'image/x-freehand', + 'fh7' => 'image/x-freehand', + 'fhc' => 'image/x-freehand', + 'fig' => 'application/x-xfig', + 'fits' => 'image/fits', + 'flac' => 'audio/x-flac', + 'fli' => 'video/x-fli', + 'flo' => 'application/vnd.micrografx.flo', + 'flv' => 'video/x-flv', + 'flw' => 'application/vnd.kde.kivio', + 'flx' => 'text/vnd.fmi.flexstor', + 'fly' => 'text/vnd.fly', + 'fm' => 'application/vnd.framemaker', + 'fnc' => 'application/vnd.frogans.fnc', + 'fo' => 'application/vnd.software602.filler.form+xml', + 'for' => 'text/x-fortran', + 'fpx' => 'image/vnd.fpx', + 'frame' => 'application/vnd.framemaker', + 'fsc' => 'application/vnd.fsc.weblaunch', + 'fst' => 'image/vnd.fst', + 'ftc' => 'application/vnd.fluxtime.clip', + 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', + 'fvt' => 'video/vnd.fvt', + 'fxp' => 'application/vnd.adobe.fxp', + 'fxpl' => 'application/vnd.adobe.fxp', + 'fzs' => 'application/vnd.fuzzysheet', + 'g2w' => 'application/vnd.geoplan', + 'g3' => 'image/g3fax', + 'g3w' => 'application/vnd.geospace', + 'gac' => 'application/vnd.groove-account', + 'gam' => 'application/x-tads', + 'gbr' => 'application/rpki-ghostbusters', + 'gca' => 'application/x-gca-compressed', + 'gdl' => 'model/vnd.gdl', + 'gdoc' => 'application/vnd.google-apps.document', + 'ged' => 'text/vnd.familysearch.gedcom', + 'geo' => 'application/vnd.dynageo', + 'geojson' => 'application/geo+json', + 'gex' => 'application/vnd.geometry-explorer', + 'ggb' => 'application/vnd.geogebra.file', + 'ggt' => 'application/vnd.geogebra.tool', + 'ghf' => 'application/vnd.groove-help', + 'gif' => 'image/gif', + 'gim' => 'application/vnd.groove-identity-message', + 'glb' => 'model/gltf-binary', + 'gltf' => 'model/gltf+json', + 'gml' => 'application/gml+xml', + 'gmx' => 'application/vnd.gmx', + 'gnumeric' => 'application/x-gnumeric', + 'gpg' => 'application/gpg-keys', + 'gph' => 'application/vnd.flographit', + 'gpx' => 'application/gpx+xml', + 'gqf' => 'application/vnd.grafeq', + 'gqs' => 'application/vnd.grafeq', + 'gram' => 'application/srgs', + 'gramps' => 'application/x-gramps-xml', + 'gre' => 'application/vnd.geometry-explorer', + 'grv' => 'application/vnd.groove-injector', + 'grxml' => 'application/srgs+xml', + 'gsf' => 'application/x-font-ghostscript', + 'gsheet' => 'application/vnd.google-apps.spreadsheet', + 'gslides' => 'application/vnd.google-apps.presentation', + 'gtar' => 'application/x-gtar', + 'gtm' => 'application/vnd.groove-tool-message', + 'gtw' => 'model/vnd.gtw', + 'gv' => 'text/vnd.graphviz', + 'gxf' => 'application/gxf', + 'gxt' => 'application/vnd.geonext', + 'gz' => 'application/gzip', + 'gzip' => 'application/gzip', + 'h' => 'text/x-c', + 'h261' => 'video/h261', + 'h263' => 'video/h263', + 'h264' => 'video/h264', + 'hal' => 'application/vnd.hal+xml', + 'hbci' => 'application/vnd.hbci', + 'hbs' => 'text/x-handlebars-template', + 'hdd' => 'application/x-virtualbox-hdd', + 'hdf' => 'application/x-hdf', + 'heic' => 'image/heic', + 'heics' => 'image/heic-sequence', + 'heif' => 'image/heif', + 'heifs' => 'image/heif-sequence', + 'hej2' => 'image/hej2k', + 'held' => 'application/atsc-held+xml', + 'hh' => 'text/x-c', + 'hjson' => 'application/hjson', + 'hlp' => 'application/winhlp', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hpid' => 'application/vnd.hp-hpid', + 'hps' => 'application/vnd.hp-hps', + 'hqx' => 'application/mac-binhex40', + 'hsj2' => 'image/hsj2', + 'htc' => 'text/x-component', + 'htke' => 'application/vnd.kenameaapp', + 'htm' => 'text/html', + 'html' => 'text/html', + 'hvd' => 'application/vnd.yamaha.hv-dic', + 'hvp' => 'application/vnd.yamaha.hv-voice', + 'hvs' => 'application/vnd.yamaha.hv-script', + 'i2g' => 'application/vnd.intergeo', + 'icc' => 'application/vnd.iccprofile', + 'ice' => 'x-conference/x-cooltalk', + 'icm' => 'application/vnd.iccprofile', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ief' => 'image/ief', + 'ifb' => 'text/calendar', + 'ifm' => 'application/vnd.shana.informed.formdata', + 'iges' => 'model/iges', + 'igl' => 'application/vnd.igloader', + 'igm' => 'application/vnd.insors.igm', + 'igs' => 'model/iges', + 'igx' => 'application/vnd.micrografx.igx', + 'iif' => 'application/vnd.shana.informed.interchange', + 'img' => 'application/octet-stream', + 'imp' => 'application/vnd.accpac.simply.imp', + 'ims' => 'application/vnd.ms-ims', + 'in' => 'text/plain', + 'ini' => 'text/plain', + 'ink' => 'application/inkml+xml', + 'inkml' => 'application/inkml+xml', + 'install' => 'application/x-install-instructions', + 'iota' => 'application/vnd.astraea-software.iota', + 'ipfix' => 'application/ipfix', + 'ipk' => 'application/vnd.shana.informed.package', + 'irm' => 'application/vnd.ibm.rights-management', + 'irp' => 'application/vnd.irepository.package+xml', + 'iso' => 'application/x-iso9660-image', + 'itp' => 'application/vnd.shana.informed.formtemplate', + 'its' => 'application/its+xml', + 'ivp' => 'application/vnd.immervision-ivp', + 'ivu' => 'application/vnd.immervision-ivu', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'jade' => 'text/jade', + 'jam' => 'application/vnd.jam', + 'jar' => 'application/java-archive', + 'jardiff' => 'application/x-java-archive-diff', + 'java' => 'text/x-java-source', + 'jhc' => 'image/jphc', + 'jisp' => 'application/vnd.jisp', + 'jls' => 'image/jls', + 'jlt' => 'application/vnd.hp-jlyt', + 'jng' => 'image/x-jng', + 'jnlp' => 'application/x-java-jnlp-file', + 'joda' => 'application/vnd.joost.joda-archive', + 'jp2' => 'image/jp2', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpf' => 'image/jpx', + 'jpg' => 'image/jpeg', + 'jpg2' => 'image/jp2', + 'jpgm' => 'video/jpm', + 'jpgv' => 'video/jpeg', + 'jph' => 'image/jph', + 'jpm' => 'video/jpm', + 'jpx' => 'image/jpx', + 'js' => 'application/javascript', + 'json' => 'application/json', + 'json5' => 'application/json5', + 'jsonld' => 'application/ld+json', + 'jsonml' => 'application/jsonml+json', + 'jsx' => 'text/jsx', + 'jt' => 'model/jt', + 'jxr' => 'image/jxr', + 'jxra' => 'image/jxra', + 'jxrs' => 'image/jxrs', + 'jxs' => 'image/jxs', + 'jxsc' => 'image/jxsc', + 'jxsi' => 'image/jxsi', + 'jxss' => 'image/jxss', + 'kar' => 'audio/midi', + 'karbon' => 'application/vnd.kde.karbon', + 'kdb' => 'application/octet-stream', + 'kdbx' => 'application/x-keepass2', + 'key' => 'application/x-iwork-keynote-sffkey', + 'kfo' => 'application/vnd.kde.kformula', + 'kia' => 'application/vnd.kidspiration', + 'kml' => 'application/vnd.google-earth.kml+xml', + 'kmz' => 'application/vnd.google-earth.kmz', + 'kne' => 'application/vnd.kinar', + 'knp' => 'application/vnd.kinar', + 'kon' => 'application/vnd.kde.kontour', + 'kpr' => 'application/vnd.kde.kpresenter', + 'kpt' => 'application/vnd.kde.kpresenter', + 'kpxx' => 'application/vnd.ds-keypoint', + 'ksp' => 'application/vnd.kde.kspread', + 'ktr' => 'application/vnd.kahootz', + 'ktx' => 'image/ktx', + 'ktx2' => 'image/ktx2', + 'ktz' => 'application/vnd.kahootz', + 'kwd' => 'application/vnd.kde.kword', + 'kwt' => 'application/vnd.kde.kword', + 'lasxml' => 'application/vnd.las.las+xml', + 'latex' => 'application/x-latex', + 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', + 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', + 'les' => 'application/vnd.hhe.lesson-player', + 'less' => 'text/less', + 'lgr' => 'application/lgr+xml', + 'lha' => 'application/octet-stream', + 'link66' => 'application/vnd.route66.link66+xml', + 'list' => 'text/plain', + 'list3820' => 'application/vnd.ibm.modcap', + 'listafp' => 'application/vnd.ibm.modcap', + 'litcoffee' => 'text/coffeescript', + 'lnk' => 'application/x-ms-shortcut', + 'log' => 'text/plain', + 'lostxml' => 'application/lost+xml', + 'lrf' => 'application/octet-stream', + 'lrm' => 'application/vnd.ms-lrm', + 'ltf' => 'application/vnd.frogans.ltf', + 'lua' => 'text/x-lua', + 'luac' => 'application/x-lua-bytecode', + 'lvp' => 'audio/vnd.lucent.voice', + 'lwp' => 'application/vnd.lotus-wordpro', + 'lzh' => 'application/octet-stream', + 'm1v' => 'video/mpeg', + 'm2a' => 'audio/mpeg', + 'm2v' => 'video/mpeg', + 'm3a' => 'audio/mpeg', + 'm3u' => 'text/plain', + 'm3u8' => 'application/vnd.apple.mpegurl', + 'm4a' => 'audio/x-m4a', + 'm4p' => 'application/mp4', + 'm4s' => 'video/iso.segment', + 'm4u' => 'application/vnd.mpegurl', + 'm4v' => 'video/x-m4v', + 'm13' => 'application/x-msmediaview', + 'm14' => 'application/x-msmediaview', + 'm21' => 'application/mp21', + 'ma' => 'application/mathematica', + 'mads' => 'application/mads+xml', + 'maei' => 'application/mmt-aei+xml', + 'mag' => 'application/vnd.ecowin.chart', + 'maker' => 'application/vnd.framemaker', + 'man' => 'text/troff', + 'manifest' => 'text/cache-manifest', + 'map' => 'application/json', + 'mar' => 'application/octet-stream', + 'markdown' => 'text/markdown', + 'mathml' => 'application/mathml+xml', + 'mb' => 'application/mathematica', + 'mbk' => 'application/vnd.mobius.mbk', + 'mbox' => 'application/mbox', + 'mc1' => 'application/vnd.medcalcdata', + 'mcd' => 'application/vnd.mcd', + 'mcurl' => 'text/vnd.curl.mcurl', + 'md' => 'text/markdown', + 'mdb' => 'application/x-msaccess', + 'mdi' => 'image/vnd.ms-modi', + 'mdx' => 'text/mdx', + 'me' => 'text/troff', + 'mesh' => 'model/mesh', + 'meta4' => 'application/metalink4+xml', + 'metalink' => 'application/metalink+xml', + 'mets' => 'application/mets+xml', + 'mfm' => 'application/vnd.mfmp', + 'mft' => 'application/rpki-manifest', + 'mgp' => 'application/vnd.osgeo.mapguide.package', + 'mgz' => 'application/vnd.proteus.magazine', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mie' => 'application/x-mie', + 'mif' => 'application/vnd.mif', + 'mime' => 'message/rfc822', + 'mj2' => 'video/mj2', + 'mjp2' => 'video/mj2', + 'mjs' => 'text/javascript', + 'mk3d' => 'video/x-matroska', + 'mka' => 'audio/x-matroska', + 'mkd' => 'text/x-markdown', + 'mks' => 'video/x-matroska', + 'mkv' => 'video/x-matroska', + 'mlp' => 'application/vnd.dolby.mlp', + 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', + 'mmf' => 'application/vnd.smaf', + 'mml' => 'text/mathml', + 'mmr' => 'image/vnd.fujixerox.edmics-mmr', + 'mng' => 'video/x-mng', + 'mny' => 'application/x-msmoney', + 'mobi' => 'application/x-mobipocket-ebook', + 'mods' => 'application/mods+xml', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/mpeg', + 'mp2a' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4s' => 'application/mp4', + 'mp4v' => 'video/mp4', + 'mp21' => 'application/mp21', + 'mpc' => 'application/vnd.mophun.certificate', + 'mpd' => 'application/dash+xml', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpf' => 'application/media-policy-dataset+xml', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'mpga' => 'audio/mpeg', + 'mpkg' => 'application/vnd.apple.installer+xml', + 'mpm' => 'application/vnd.blueice.multipass', + 'mpn' => 'application/vnd.mophun.application', + 'mpp' => 'application/vnd.ms-project', + 'mpt' => 'application/vnd.ms-project', + 'mpy' => 'application/vnd.ibm.minipay', + 'mqy' => 'application/vnd.mobius.mqy', + 'mrc' => 'application/marc', + 'mrcx' => 'application/marcxml+xml', + 'ms' => 'text/troff', + 'mscml' => 'application/mediaservercontrol+xml', + 'mseed' => 'application/vnd.fdsn.mseed', + 'mseq' => 'application/vnd.mseq', + 'msf' => 'application/vnd.epson.msf', + 'msg' => 'application/vnd.ms-outlook', + 'msh' => 'model/mesh', + 'msi' => 'application/x-msdownload', + 'msix' => 'application/msix', + 'msixbundle' => 'application/msixbundle', + 'msl' => 'application/vnd.mobius.msl', + 'msm' => 'application/octet-stream', + 'msp' => 'application/octet-stream', + 'msty' => 'application/vnd.muvee.style', + 'mtl' => 'model/mtl', + 'mts' => 'model/vnd.mts', + 'mus' => 'application/vnd.musician', + 'musd' => 'application/mmt-usd+xml', + 'musicxml' => 'application/vnd.recordare.musicxml+xml', + 'mvb' => 'application/x-msmediaview', + 'mvt' => 'application/vnd.mapbox-vector-tile', + 'mwf' => 'application/vnd.mfer', + 'mxf' => 'application/mxf', + 'mxl' => 'application/vnd.recordare.musicxml', + 'mxmf' => 'audio/mobile-xmf', + 'mxml' => 'application/xv+xml', + 'mxs' => 'application/vnd.triscape.mxs', + 'mxu' => 'video/vnd.mpegurl', + 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', + 'n3' => 'text/n3', + 'nb' => 'application/mathematica', + 'nbp' => 'application/vnd.wolfram.player', + 'nc' => 'application/x-netcdf', + 'ncx' => 'application/x-dtbncx+xml', + 'ndjson' => 'application/x-ndjson', + 'nfo' => 'text/x-nfo', + 'ngdat' => 'application/vnd.nokia.n-gage.data', + 'nitf' => 'application/vnd.nitf', + 'nlu' => 'application/vnd.neurolanguage.nlu', + 'nml' => 'application/vnd.enliven', + 'nnd' => 'application/vnd.noblenet-directory', + 'nns' => 'application/vnd.noblenet-sealer', + 'nnw' => 'application/vnd.noblenet-web', + 'npx' => 'image/vnd.net-fpx', + 'nq' => 'application/n-quads', + 'nsc' => 'application/x-conference', + 'nsf' => 'application/vnd.lotus-notes', + 'nt' => 'application/n-triples', + 'ntf' => 'application/vnd.nitf', + 'numbers' => 'application/x-iwork-numbers-sffnumbers', + 'nzb' => 'application/x-nzb', + 'oa2' => 'application/vnd.fujitsu.oasys2', + 'oa3' => 'application/vnd.fujitsu.oasys3', + 'oas' => 'application/vnd.fujitsu.oasys', + 'obd' => 'application/x-msbinder', + 'obgx' => 'application/vnd.openblox.game+xml', + 'obj' => 'model/obj', + 'oda' => 'application/oda', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odft' => 'application/vnd.oasis.opendocument.formula-template', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'odm' => 'application/vnd.oasis.opendocument.text-master', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'oga' => 'audio/ogg', + 'ogex' => 'model/vnd.opengex', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'omdoc' => 'application/omdoc+xml', + 'onepkg' => 'application/onenote', + 'onetmp' => 'application/onenote', + 'onetoc' => 'application/onenote', + 'onetoc2' => 'application/onenote', + 'opf' => 'application/oebps-package+xml', + 'opml' => 'text/x-opml', + 'oprc' => 'application/vnd.palm', + 'opus' => 'audio/ogg', + 'org' => 'text/x-org', + 'osf' => 'application/vnd.yamaha.openscoreformat', + 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', + 'osm' => 'application/vnd.openstreetmap.data+xml', + 'otc' => 'application/vnd.oasis.opendocument.chart-template', + 'otf' => 'font/otf', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'oti' => 'application/vnd.oasis.opendocument.image-template', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'ova' => 'application/x-virtualbox-ova', + 'ovf' => 'application/x-virtualbox-ovf', + 'owl' => 'application/rdf+xml', + 'oxps' => 'application/oxps', + 'oxt' => 'application/vnd.openofficeorg.extension', + 'p' => 'text/x-pascal', + 'p7a' => 'application/x-pkcs7-signature', + 'p7b' => 'application/x-pkcs7-certificates', + 'p7c' => 'application/pkcs7-mime', + 'p7m' => 'application/pkcs7-mime', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'p8' => 'application/pkcs8', + 'p10' => 'application/x-pkcs10', + 'p12' => 'application/x-pkcs12', + 'pac' => 'application/x-ns-proxy-autoconfig', + 'pages' => 'application/x-iwork-pages-sffpages', + 'pas' => 'text/x-pascal', + 'paw' => 'application/vnd.pawaafile', + 'pbd' => 'application/vnd.powerbuilder6', + 'pbm' => 'image/x-portable-bitmap', + 'pcap' => 'application/vnd.tcpdump.pcap', + 'pcf' => 'application/x-font-pcf', + 'pcl' => 'application/vnd.hp-pcl', + 'pclxl' => 'application/vnd.hp-pclxl', + 'pct' => 'image/x-pict', + 'pcurl' => 'application/vnd.curl.pcurl', + 'pcx' => 'image/x-pcx', + 'pdb' => 'application/x-pilot', + 'pde' => 'text/x-processing', + 'pdf' => 'application/pdf', + 'pem' => 'application/x-x509-user-cert', + 'pfa' => 'application/x-font-type1', + 'pfb' => 'application/x-font-type1', + 'pfm' => 'application/x-font-type1', + 'pfr' => 'application/font-tdpfr', + 'pfx' => 'application/x-pkcs12', + 'pgm' => 'image/x-portable-graymap', + 'pgn' => 'application/x-chess-pgn', + 'pgp' => 'application/pgp', + 'phar' => 'application/octet-stream', + 'php' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'phtml' => 'application/x-httpd-php', + 'pic' => 'image/x-pict', + 'pkg' => 'application/octet-stream', + 'pki' => 'application/pkixcmp', + 'pkipath' => 'application/pkix-pkipath', + 'pkpass' => 'application/vnd.apple.pkpass', + 'pl' => 'application/x-perl', + 'plb' => 'application/vnd.3gpp.pic-bw-large', + 'plc' => 'application/vnd.mobius.plc', + 'plf' => 'application/vnd.pocketlearn', + 'pls' => 'application/pls+xml', + 'pm' => 'application/x-perl', + 'pml' => 'application/vnd.ctc-posml', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'portpkg' => 'application/vnd.macports.portpkg', + 'pot' => 'application/vnd.ms-powerpoint', + 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppa' => 'application/vnd.ms-powerpoint', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'ppd' => 'application/vnd.cups-ppd', + 'ppm' => 'image/x-portable-pixmap', + 'pps' => 'application/vnd.ms-powerpoint', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'ppt' => 'application/powerpoint', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'pqa' => 'application/vnd.palm', + 'prc' => 'model/prc', + 'pre' => 'application/vnd.lotus-freelance', + 'prf' => 'application/pics-rules', + 'provx' => 'application/provenance+xml', + 'ps' => 'application/postscript', + 'psb' => 'application/vnd.3gpp.pic-bw-small', + 'psd' => 'application/x-photoshop', + 'psf' => 'application/x-font-linux-psf', + 'pskcxml' => 'application/pskc+xml', + 'pti' => 'image/prs.pti', + 'ptid' => 'application/vnd.pvi.ptid1', + 'pub' => 'application/x-mspublisher', + 'pv' => 'application/octet-stream', + 'pvb' => 'application/vnd.3gpp.pic-bw-var', + 'pwn' => 'application/vnd.3m.post-it-notes', + 'pxf' => 'application/octet-stream', + 'pya' => 'audio/vnd.ms-playready.media.pya', + 'pyo' => 'model/vnd.pytha.pyox', + 'pyox' => 'model/vnd.pytha.pyox', + 'pyv' => 'video/vnd.ms-playready.media.pyv', + 'qam' => 'application/vnd.epson.quickanime', + 'qbo' => 'application/vnd.intu.qbo', + 'qfx' => 'application/vnd.intu.qfx', + 'qps' => 'application/vnd.publishare-delta-tree', + 'qt' => 'video/quicktime', + 'qwd' => 'application/vnd.quark.quarkxpress', + 'qwt' => 'application/vnd.quark.quarkxpress', + 'qxb' => 'application/vnd.quark.quarkxpress', + 'qxd' => 'application/vnd.quark.quarkxpress', + 'qxl' => 'application/vnd.quark.quarkxpress', + 'qxt' => 'application/vnd.quark.quarkxpress', + 'ra' => 'audio/x-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'raml' => 'application/raml+yaml', + 'rapd' => 'application/route-apd+xml', + 'rar' => 'application/x-rar', + 'ras' => 'image/x-cmu-raster', + 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', + 'rdf' => 'application/rdf+xml', + 'rdz' => 'application/vnd.data-vision.rdz', + 'relo' => 'application/p2p-overlay+xml', + 'rep' => 'application/vnd.businessobjects', + 'res' => 'application/x-dtbresource+xml', + 'rgb' => 'image/x-rgb', + 'rif' => 'application/reginfo+xml', + 'rip' => 'audio/vnd.rip', + 'ris' => 'application/x-research-info-systems', + 'rl' => 'application/resource-lists+xml', + 'rlc' => 'image/vnd.fujixerox.edmics-rlc', + 'rld' => 'application/resource-lists-diff+xml', + 'rm' => 'audio/x-pn-realaudio', + 'rmi' => 'audio/midi', + 'rmp' => 'audio/x-pn-realaudio-plugin', + 'rms' => 'application/vnd.jcp.javame.midlet-rms', + 'rmvb' => 'application/vnd.rn-realmedia-vbr', + 'rnc' => 'application/relax-ng-compact-syntax', + 'rng' => 'application/xml', + 'roa' => 'application/rpki-roa', + 'roff' => 'text/troff', + 'rp9' => 'application/vnd.cloanto.rp9', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rpss' => 'application/vnd.nokia.radio-presets', + 'rpst' => 'application/vnd.nokia.radio-preset', + 'rq' => 'application/sparql-query', + 'rs' => 'application/rls-services+xml', + 'rsa' => 'application/x-pkcs7', + 'rsat' => 'application/atsc-rsat+xml', + 'rsd' => 'application/rsd+xml', + 'rsheet' => 'application/urc-ressheet+xml', + 'rss' => 'application/rss+xml', + 'rtf' => 'text/rtf', + 'rtx' => 'text/richtext', + 'run' => 'application/x-makeself', + 'rusd' => 'application/route-usd+xml', + 'rv' => 'video/vnd.rn-realvideo', + 's' => 'text/x-asm', + 's3m' => 'audio/s3m', + 'saf' => 'application/vnd.yamaha.smaf-audio', + 'sass' => 'text/x-sass', + 'sbml' => 'application/sbml+xml', + 'sc' => 'application/vnd.ibm.secure-container', + 'scd' => 'application/x-msschedule', + 'scm' => 'application/vnd.lotus-screencam', + 'scq' => 'application/scvp-cv-request', + 'scs' => 'application/scvp-cv-response', + 'scss' => 'text/x-scss', + 'scurl' => 'text/vnd.curl.scurl', + 'sda' => 'application/vnd.stardivision.draw', + 'sdc' => 'application/vnd.stardivision.calc', + 'sdd' => 'application/vnd.stardivision.impress', + 'sdkd' => 'application/vnd.solent.sdkm+xml', + 'sdkm' => 'application/vnd.solent.sdkm+xml', + 'sdp' => 'application/sdp', + 'sdw' => 'application/vnd.stardivision.writer', + 'sea' => 'application/octet-stream', + 'see' => 'application/vnd.seemail', + 'seed' => 'application/vnd.fdsn.seed', + 'sema' => 'application/vnd.sema', + 'semd' => 'application/vnd.semd', + 'semf' => 'application/vnd.semf', + 'senmlx' => 'application/senml+xml', + 'sensmlx' => 'application/sensml+xml', + 'ser' => 'application/java-serialized-object', + 'setpay' => 'application/set-payment-initiation', + 'setreg' => 'application/set-registration-initiation', + 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', + 'sfs' => 'application/vnd.spotfire.sfs', + 'sfv' => 'text/x-sfv', + 'sgi' => 'image/sgi', + 'sgl' => 'application/vnd.stardivision.writer-global', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'sh' => 'application/x-sh', + 'shar' => 'application/x-shar', + 'shex' => 'text/shex', + 'shf' => 'application/shf+xml', + 'shtml' => 'text/html', + 'sid' => 'image/x-mrsid-image', + 'sieve' => 'application/sieve', + 'sig' => 'application/pgp-signature', + 'sil' => 'audio/silk', + 'silo' => 'model/mesh', + 'sis' => 'application/vnd.symbian.install', + 'sisx' => 'application/vnd.symbian.install', + 'sit' => 'application/x-stuffit', + 'sitx' => 'application/x-stuffitx', + 'siv' => 'application/sieve', + 'skd' => 'application/vnd.koan', + 'skm' => 'application/vnd.koan', + 'skp' => 'application/vnd.koan', + 'skt' => 'application/vnd.koan', + 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'slim' => 'text/slim', + 'slm' => 'text/slim', + 'sls' => 'application/route-s-tsid+xml', + 'slt' => 'application/vnd.epson.salt', + 'sm' => 'application/vnd.stepmania.stepchart', + 'smf' => 'application/vnd.stardivision.math', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'smv' => 'video/x-smv', + 'smzip' => 'application/vnd.stepmania.package', + 'snd' => 'audio/basic', + 'snf' => 'application/x-font-snf', + 'so' => 'application/octet-stream', + 'spc' => 'application/x-pkcs7-certificates', + 'spdx' => 'text/spdx', + 'spf' => 'application/vnd.yamaha.smaf-phrase', + 'spl' => 'application/x-futuresplash', + 'spot' => 'text/vnd.in3d.spot', + 'spp' => 'application/scvp-vp-response', + 'spq' => 'application/scvp-vp-request', + 'spx' => 'audio/ogg', + 'sql' => 'application/x-sql', + 'src' => 'application/x-wais-source', + 'srt' => 'application/x-subrip', + 'sru' => 'application/sru+xml', + 'srx' => 'application/sparql-results+xml', + 'ssdl' => 'application/ssdl+xml', + 'sse' => 'application/vnd.kodak-descriptor', + 'ssf' => 'application/vnd.epson.ssf', + 'ssml' => 'application/ssml+xml', + 'sst' => 'application/octet-stream', + 'st' => 'application/vnd.sailingtracker.track', + 'stc' => 'application/vnd.sun.xml.calc.template', + 'std' => 'application/vnd.sun.xml.draw.template', + 'step' => 'application/STEP', + 'stf' => 'application/vnd.wt.stf', + 'sti' => 'application/vnd.sun.xml.impress.template', + 'stk' => 'application/hyperstudio', + 'stl' => 'model/stl', + 'stp' => 'application/STEP', + 'stpx' => 'model/step+xml', + 'stpxz' => 'model/step-xml+zip', + 'stpz' => 'model/step+zip', + 'str' => 'application/vnd.pg.format', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'styl' => 'text/stylus', + 'stylus' => 'text/stylus', + 'sub' => 'text/vnd.dvb.subtitle', + 'sus' => 'application/vnd.sus-calendar', + 'susp' => 'application/vnd.sus-calendar', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svc' => 'application/vnd.dvb.service', + 'svd' => 'application/vnd.svd', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + 'swa' => 'application/x-director', + 'swf' => 'application/x-shockwave-flash', + 'swi' => 'application/vnd.aristanetworks.swi', + 'swidtag' => 'application/swid+xml', + 'sxc' => 'application/vnd.sun.xml.calc', + 'sxd' => 'application/vnd.sun.xml.draw', + 'sxg' => 'application/vnd.sun.xml.writer.global', + 'sxi' => 'application/vnd.sun.xml.impress', + 'sxm' => 'application/vnd.sun.xml.math', + 'sxw' => 'application/vnd.sun.xml.writer', + 't' => 'text/troff', + 't3' => 'application/x-t3vm-image', + 't38' => 'image/t38', + 'taglet' => 'application/vnd.mynfc', + 'tao' => 'application/vnd.tao.intent-module-archive', + 'tap' => 'image/vnd.tencent.tap', + 'tar' => 'application/x-tar', + 'tcap' => 'application/vnd.3gpp2.tcap', + 'tcl' => 'application/x-tcl', + 'td' => 'application/urc-targetdesc+xml', + 'teacher' => 'application/vnd.smart.teacher', + 'tei' => 'application/tei+xml', + 'teicorpus' => 'application/tei+xml', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', + 'texinfo' => 'application/x-texinfo', + 'text' => 'text/plain', + 'tfi' => 'application/thraud+xml', + 'tfm' => 'application/x-tex-tfm', + 'tfx' => 'image/tiff-fx', + 'tga' => 'image/x-tga', + 'tgz' => 'application/x-tar', + 'thmx' => 'application/vnd.ms-officetheme', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'tk' => 'application/x-tcl', + 'tmo' => 'application/vnd.tmobile-livetv', + 'toml' => 'application/toml', + 'torrent' => 'application/x-bittorrent', + 'tpl' => 'application/vnd.groove-tool-template', + 'tpt' => 'application/vnd.trid.tpt', + 'tr' => 'text/troff', + 'tra' => 'application/vnd.trueapp', + 'trig' => 'application/trig', + 'trm' => 'application/x-msterminal', + 'ts' => 'video/mp2t', + 'tsd' => 'application/timestamped-data', + 'tsv' => 'text/tab-separated-values', + 'ttc' => 'font/collection', + 'ttf' => 'font/ttf', + 'ttl' => 'text/turtle', + 'ttml' => 'application/ttml+xml', + 'twd' => 'application/vnd.simtech-mindmapper', + 'twds' => 'application/vnd.simtech-mindmapper', + 'txd' => 'application/vnd.genomatix.tuxedo', + 'txf' => 'application/vnd.mobius.txf', + 'txt' => 'text/plain', + 'u3d' => 'model/u3d', + 'u8dsn' => 'message/global-delivery-status', + 'u8hdr' => 'message/global-headers', + 'u8mdn' => 'message/global-disposition-notification', + 'u8msg' => 'message/global', + 'u32' => 'application/x-authorware-bin', + 'ubj' => 'application/ubjson', + 'udeb' => 'application/x-debian-package', + 'ufd' => 'application/vnd.ufdl', + 'ufdl' => 'application/vnd.ufdl', + 'ulx' => 'application/x-glulx', + 'umj' => 'application/vnd.umajin', + 'unityweb' => 'application/vnd.unity', + 'uo' => 'application/vnd.uoml+xml', + 'uoml' => 'application/vnd.uoml+xml', + 'uri' => 'text/uri-list', + 'uris' => 'text/uri-list', + 'urls' => 'text/uri-list', + 'usda' => 'model/vnd.usda', + 'usdz' => 'model/vnd.usdz+zip', + 'ustar' => 'application/x-ustar', + 'utz' => 'application/vnd.uiq.theme', + 'uu' => 'text/x-uuencode', + 'uva' => 'audio/vnd.dece.audio', + 'uvd' => 'application/vnd.dece.data', + 'uvf' => 'application/vnd.dece.data', + 'uvg' => 'image/vnd.dece.graphic', + 'uvh' => 'video/vnd.dece.hd', + 'uvi' => 'image/vnd.dece.graphic', + 'uvm' => 'video/vnd.dece.mobile', + 'uvp' => 'video/vnd.dece.pd', + 'uvs' => 'video/vnd.dece.sd', + 'uvt' => 'application/vnd.dece.ttml+xml', + 'uvu' => 'video/vnd.uvvu.mp4', + 'uvv' => 'video/vnd.dece.video', + 'uvva' => 'audio/vnd.dece.audio', + 'uvvd' => 'application/vnd.dece.data', + 'uvvf' => 'application/vnd.dece.data', + 'uvvg' => 'image/vnd.dece.graphic', + 'uvvh' => 'video/vnd.dece.hd', + 'uvvi' => 'image/vnd.dece.graphic', + 'uvvm' => 'video/vnd.dece.mobile', + 'uvvp' => 'video/vnd.dece.pd', + 'uvvs' => 'video/vnd.dece.sd', + 'uvvt' => 'application/vnd.dece.ttml+xml', + 'uvvu' => 'video/vnd.uvvu.mp4', + 'uvvv' => 'video/vnd.dece.video', + 'uvvx' => 'application/vnd.dece.unspecified', + 'uvvz' => 'application/vnd.dece.zip', + 'uvx' => 'application/vnd.dece.unspecified', + 'uvz' => 'application/vnd.dece.zip', + 'vbox' => 'application/x-virtualbox-vbox', + 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack', + 'vcard' => 'text/vcard', + 'vcd' => 'application/x-cdlink', + 'vcf' => 'text/x-vcard', + 'vcg' => 'application/vnd.groove-vcard', + 'vcs' => 'text/x-vcalendar', + 'vcx' => 'application/vnd.vcx', + 'vdi' => 'application/x-virtualbox-vdi', + 'vds' => 'model/vnd.sap.vds', + 'vhd' => 'application/x-virtualbox-vhd', + 'vis' => 'application/vnd.visionary', + 'viv' => 'video/vnd.vivo', + 'vlc' => 'application/videolan', + 'vmdk' => 'application/x-virtualbox-vmdk', + 'vob' => 'video/x-ms-vob', + 'vor' => 'application/vnd.stardivision.writer', + 'vox' => 'application/x-authorware-bin', + 'vrml' => 'model/vrml', + 'vsd' => 'application/vnd.visio', + 'vsf' => 'application/vnd.vsf', + 'vss' => 'application/vnd.visio', + 'vst' => 'application/vnd.visio', + 'vsw' => 'application/vnd.visio', + 'vtf' => 'image/vnd.valve.source.texture', + 'vtt' => 'text/vtt', + 'vtu' => 'model/vnd.vtu', + 'vxml' => 'application/voicexml+xml', + 'w3d' => 'application/x-director', + 'wad' => 'application/x-doom', + 'wadl' => 'application/vnd.sun.wadl+xml', + 'war' => 'application/java-archive', + 'wasm' => 'application/wasm', + 'wav' => 'audio/x-wav', + 'wax' => 'audio/x-ms-wax', + 'wbmp' => 'image/vnd.wap.wbmp', + 'wbs' => 'application/vnd.criticaltools.wbs+xml', + 'wbxml' => 'application/wbxml', + 'wcm' => 'application/vnd.ms-works', + 'wdb' => 'application/vnd.ms-works', + 'wdp' => 'image/vnd.ms-photo', + 'weba' => 'audio/webm', + 'webapp' => 'application/x-web-app-manifest+json', + 'webm' => 'video/webm', + 'webmanifest' => 'application/manifest+json', + 'webp' => 'image/webp', + 'wg' => 'application/vnd.pmi.widget', + 'wgsl' => 'text/wgsl', + 'wgt' => 'application/widget', + 'wif' => 'application/watcherinfo+xml', + 'wks' => 'application/vnd.ms-works', + 'wm' => 'video/x-ms-wm', + 'wma' => 'audio/x-ms-wma', + 'wmd' => 'application/x-ms-wmd', + 'wmf' => 'image/wmf', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'wmv' => 'video/x-ms-wmv', + 'wmx' => 'video/x-ms-wmx', + 'wmz' => 'application/x-msmetafile', + 'woff' => 'font/woff', + 'woff2' => 'font/woff2', + 'word' => 'application/msword', + 'wpd' => 'application/vnd.wordperfect', + 'wpl' => 'application/vnd.ms-wpl', + 'wps' => 'application/vnd.ms-works', + 'wqd' => 'application/vnd.wqd', + 'wri' => 'application/x-mswrite', + 'wrl' => 'model/vrml', + 'wsc' => 'message/vnd.wfa.wsc', + 'wsdl' => 'application/wsdl+xml', + 'wspolicy' => 'application/wspolicy+xml', + 'wtb' => 'application/vnd.webturbo', + 'wvx' => 'video/x-ms-wvx', + 'x3d' => 'model/x3d+xml', + 'x3db' => 'model/x3d+fastinfoset', + 'x3dbz' => 'model/x3d+binary', + 'x3dv' => 'model/x3d-vrml', + 'x3dvz' => 'model/x3d+vrml', + 'x3dz' => 'model/x3d+xml', + 'x32' => 'application/x-authorware-bin', + 'x_b' => 'model/vnd.parasolid.transmit.binary', + 'x_t' => 'model/vnd.parasolid.transmit.text', + 'xaml' => 'application/xaml+xml', + 'xap' => 'application/x-silverlight-app', + 'xar' => 'application/vnd.xara', + 'xav' => 'application/xcap-att+xml', + 'xbap' => 'application/x-ms-xbap', + 'xbd' => 'application/vnd.fujixerox.docuworks.binder', + 'xbm' => 'image/x-xbitmap', + 'xca' => 'application/xcap-caps+xml', + 'xcs' => 'application/calendar+xml', + 'xdf' => 'application/xcap-diff+xml', + 'xdm' => 'application/vnd.syncml.dm+xml', + 'xdp' => 'application/vnd.adobe.xdp+xml', + 'xdssc' => 'application/dssc+xml', + 'xdw' => 'application/vnd.fujixerox.docuworks', + 'xel' => 'application/xcap-el+xml', + 'xenc' => 'application/xenc+xml', + 'xer' => 'application/patch-ops-error+xml', + 'xfdf' => 'application/xfdf', + 'xfdl' => 'application/vnd.xfdl', + 'xht' => 'application/xhtml+xml', + 'xhtm' => 'application/vnd.pwg-xhtml-print+xml', + 'xhtml' => 'application/xhtml+xml', + 'xhvml' => 'application/xv+xml', + 'xif' => 'image/vnd.xiff', + 'xl' => 'application/excel', + 'xla' => 'application/vnd.ms-excel', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'xlc' => 'application/vnd.ms-excel', + 'xlf' => 'application/xliff+xml', + 'xlm' => 'application/vnd.ms-excel', + 'xls' => 'application/vnd.ms-excel', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xlt' => 'application/vnd.ms-excel', + 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'xlw' => 'application/vnd.ms-excel', + 'xm' => 'audio/xm', + 'xml' => 'application/xml', + 'xns' => 'application/xcap-ns+xml', + 'xo' => 'application/vnd.olpc-sugar', + 'xop' => 'application/xop+xml', + 'xpi' => 'application/x-xpinstall', + 'xpl' => 'application/xproc+xml', + 'xpm' => 'image/x-xpixmap', + 'xpr' => 'application/vnd.is-xpr', + 'xps' => 'application/vnd.ms-xpsdocument', + 'xpw' => 'application/vnd.intercon.formnet', + 'xpx' => 'application/vnd.intercon.formnet', + 'xsd' => 'application/xml', + 'xsf' => 'application/prs.xsf+xml', + 'xsl' => 'application/xml', + 'xslt' => 'application/xslt+xml', + 'xsm' => 'application/vnd.syncml+xml', + 'xspf' => 'application/xspf+xml', + 'xul' => 'application/vnd.mozilla.xul+xml', + 'xvm' => 'application/xv+xml', + 'xvml' => 'application/xv+xml', + 'xwd' => 'image/x-xwindowdump', + 'xyz' => 'chemical/x-xyz', + 'xz' => 'application/x-xz', + 'yaml' => 'text/yaml', + 'yang' => 'application/yang', + 'yin' => 'application/yin+xml', + 'yml' => 'text/yaml', + 'ymp' => 'text/x-suse-ymp', + 'z' => 'application/x-compress', + 'z1' => 'application/x-zmachine', + 'z2' => 'application/x-zmachine', + 'z3' => 'application/x-zmachine', + 'z4' => 'application/x-zmachine', + 'z5' => 'application/x-zmachine', + 'z6' => 'application/x-zmachine', + 'z7' => 'application/x-zmachine', + 'z8' => 'application/x-zmachine', + 'zaz' => 'application/vnd.zzazz.deck+xml', + 'zip' => 'application/zip', + 'zir' => 'application/vnd.zul', + 'zirz' => 'application/vnd.zul', + 'zmm' => 'application/vnd.handheld-entertainment+xml', + 'zsh' => 'text/x-scriptzsh', + ]; + + /** + * @var array + * + * @internal + */ + public const EXTENSIONS_FOR_MIME_TIMES = [ + 'application/andrew-inset' => ['ez'], + 'application/appinstaller' => ['appinstaller'], + 'application/applixware' => ['aw'], + 'application/appx' => ['appx'], + 'application/appxbundle' => ['appxbundle'], + 'application/atom+xml' => ['atom'], + 'application/atomcat+xml' => ['atomcat'], + 'application/atomdeleted+xml' => ['atomdeleted'], + 'application/atomsvc+xml' => ['atomsvc'], + 'application/atsc-dwd+xml' => ['dwd'], + 'application/atsc-held+xml' => ['held'], + 'application/atsc-rsat+xml' => ['rsat'], + 'application/automationml-aml+xml' => ['aml'], + 'application/automationml-amlx+zip' => ['amlx'], + 'application/bdoc' => ['bdoc'], + 'application/calendar+xml' => ['xcs'], + 'application/ccxml+xml' => ['ccxml'], + 'application/cdfx+xml' => ['cdfx'], + 'application/cdmi-capability' => ['cdmia'], + 'application/cdmi-container' => ['cdmic'], + 'application/cdmi-domain' => ['cdmid'], + 'application/cdmi-object' => ['cdmio'], + 'application/cdmi-queue' => ['cdmiq'], + 'application/cpl+xml' => ['cpl'], + 'application/cu-seeme' => ['cu'], + 'application/cwl' => ['cwl'], + 'application/dash+xml' => ['mpd'], + 'application/dash-patch+xml' => ['mpp'], + 'application/davmount+xml' => ['davmount'], + 'application/docbook+xml' => ['dbk'], + 'application/dssc+der' => ['dssc'], + 'application/dssc+xml' => ['xdssc'], + 'application/ecmascript' => ['ecma'], + 'application/emma+xml' => ['emma'], + 'application/emotionml+xml' => ['emotionml'], + 'application/epub+zip' => ['epub'], + 'application/exi' => ['exi'], + 'application/express' => ['exp'], + 'application/fdf' => ['fdf'], + 'application/fdt+xml' => ['fdt'], + 'application/font-tdpfr' => ['pfr'], + 'application/geo+json' => ['geojson'], + 'application/gml+xml' => ['gml'], + 'application/gpx+xml' => ['gpx'], + 'application/gxf' => ['gxf'], + 'application/gzip' => ['gz', 'gzip'], + 'application/hjson' => ['hjson'], + 'application/hyperstudio' => ['stk'], + 'application/inkml+xml' => ['ink', 'inkml'], + 'application/ipfix' => ['ipfix'], + 'application/its+xml' => ['its'], + 'application/java-archive' => ['jar', 'war', 'ear'], + 'application/java-serialized-object' => ['ser'], + 'application/java-vm' => ['class'], + 'application/javascript' => ['js'], + 'application/json' => ['json', 'map'], + 'application/json5' => ['json5'], + 'application/jsonml+json' => ['jsonml'], + 'application/ld+json' => ['jsonld'], + 'application/lgr+xml' => ['lgr'], + 'application/lost+xml' => ['lostxml'], + 'application/mac-binhex40' => ['hqx'], + 'application/mac-compactpro' => ['cpt'], + 'application/mads+xml' => ['mads'], + 'application/manifest+json' => ['webmanifest'], + 'application/marc' => ['mrc'], + 'application/marcxml+xml' => ['mrcx'], + 'application/mathematica' => ['ma', 'nb', 'mb'], + 'application/mathml+xml' => ['mathml'], + 'application/mbox' => ['mbox'], + 'application/media-policy-dataset+xml' => ['mpf'], + 'application/mediaservercontrol+xml' => ['mscml'], + 'application/metalink+xml' => ['metalink'], + 'application/metalink4+xml' => ['meta4'], + 'application/mets+xml' => ['mets'], + 'application/mmt-aei+xml' => ['maei'], + 'application/mmt-usd+xml' => ['musd'], + 'application/mods+xml' => ['mods'], + 'application/mp21' => ['m21', 'mp21'], + 'application/mp4' => ['mp4', 'mpg4', 'mp4s', 'm4p'], + 'application/msix' => ['msix'], + 'application/msixbundle' => ['msixbundle'], + 'application/msword' => ['doc', 'dot', 'word'], + 'application/mxf' => ['mxf'], + 'application/n-quads' => ['nq'], + 'application/n-triples' => ['nt'], + 'application/node' => ['cjs'], + 'application/octet-stream' => ['bin', 'dms', 'lrf', 'mar', 'so', 'dist', 'distz', 'pkg', 'bpk', 'dump', 'elc', 'deploy', 'exe', 'dll', 'deb', 'dmg', 'iso', 'img', 'msi', 'msp', 'msm', 'buffer', 'phar', 'lha', 'lzh', 'class', 'sea', 'dmn', 'bpmn', 'kdb', 'sst', 'csr', 'dst', 'pv', 'pxf'], + 'application/oda' => ['oda'], + 'application/oebps-package+xml' => ['opf'], + 'application/ogg' => ['ogx'], + 'application/omdoc+xml' => ['omdoc'], + 'application/onenote' => ['onetoc', 'onetoc2', 'onetmp', 'onepkg'], + 'application/oxps' => ['oxps'], + 'application/p2p-overlay+xml' => ['relo'], + 'application/patch-ops-error+xml' => ['xer'], + 'application/pdf' => ['pdf', 'ai'], + 'application/pgp-encrypted' => ['pgp'], + 'application/pgp-keys' => ['asc'], + 'application/pgp-signature' => ['sig', 'asc'], + 'application/pics-rules' => ['prf'], + 'application/pkcs10' => ['p10'], + 'application/pkcs7-mime' => ['p7m', 'p7c'], + 'application/pkcs7-signature' => ['p7s'], + 'application/pkcs8' => ['p8'], + 'application/pkix-attr-cert' => ['ac'], + 'application/pkix-cert' => ['cer'], + 'application/pkix-crl' => ['crl'], + 'application/pkix-pkipath' => ['pkipath'], + 'application/pkixcmp' => ['pki'], + 'application/pls+xml' => ['pls'], + 'application/postscript' => ['ai', 'eps', 'ps'], + 'application/provenance+xml' => ['provx'], + 'application/prs.cww' => ['cww'], + 'application/prs.xsf+xml' => ['xsf'], + 'application/pskc+xml' => ['pskcxml'], + 'application/raml+yaml' => ['raml'], + 'application/rdf+xml' => ['rdf', 'owl'], + 'application/reginfo+xml' => ['rif'], + 'application/relax-ng-compact-syntax' => ['rnc'], + 'application/resource-lists+xml' => ['rl'], + 'application/resource-lists-diff+xml' => ['rld'], + 'application/rls-services+xml' => ['rs'], + 'application/route-apd+xml' => ['rapd'], + 'application/route-s-tsid+xml' => ['sls'], + 'application/route-usd+xml' => ['rusd'], + 'application/rpki-ghostbusters' => ['gbr'], + 'application/rpki-manifest' => ['mft'], + 'application/rpki-roa' => ['roa'], + 'application/rsd+xml' => ['rsd'], + 'application/rss+xml' => ['rss'], + 'application/rtf' => ['rtf'], + 'application/sbml+xml' => ['sbml'], + 'application/scvp-cv-request' => ['scq'], + 'application/scvp-cv-response' => ['scs'], + 'application/scvp-vp-request' => ['spq'], + 'application/scvp-vp-response' => ['spp'], + 'application/sdp' => ['sdp'], + 'application/senml+xml' => ['senmlx'], + 'application/sensml+xml' => ['sensmlx'], + 'application/set-payment-initiation' => ['setpay'], + 'application/set-registration-initiation' => ['setreg'], + 'application/shf+xml' => ['shf'], + 'application/sieve' => ['siv', 'sieve'], + 'application/smil+xml' => ['smi', 'smil'], + 'application/sparql-query' => ['rq'], + 'application/sparql-results+xml' => ['srx'], + 'application/sql' => ['sql'], + 'application/srgs' => ['gram'], + 'application/srgs+xml' => ['grxml'], + 'application/sru+xml' => ['sru'], + 'application/ssdl+xml' => ['ssdl'], + 'application/ssml+xml' => ['ssml'], + 'application/swid+xml' => ['swidtag'], + 'application/tei+xml' => ['tei', 'teicorpus'], + 'application/thraud+xml' => ['tfi'], + 'application/timestamped-data' => ['tsd'], + 'application/toml' => ['toml'], + 'application/trig' => ['trig'], + 'application/ttml+xml' => ['ttml'], + 'application/ubjson' => ['ubj'], + 'application/urc-ressheet+xml' => ['rsheet'], + 'application/urc-targetdesc+xml' => ['td'], + 'application/vnd.1000minds.decision-model+xml' => ['1km'], + 'application/vnd.3gpp.pic-bw-large' => ['plb'], + 'application/vnd.3gpp.pic-bw-small' => ['psb'], + 'application/vnd.3gpp.pic-bw-var' => ['pvb'], + 'application/vnd.3gpp2.tcap' => ['tcap'], + 'application/vnd.3m.post-it-notes' => ['pwn'], + 'application/vnd.accpac.simply.aso' => ['aso'], + 'application/vnd.accpac.simply.imp' => ['imp'], + 'application/vnd.acucobol' => ['acu'], + 'application/vnd.acucorp' => ['atc', 'acutc'], + 'application/vnd.adobe.air-application-installer-package+zip' => ['air'], + 'application/vnd.adobe.formscentral.fcdt' => ['fcdt'], + 'application/vnd.adobe.fxp' => ['fxp', 'fxpl'], + 'application/vnd.adobe.xdp+xml' => ['xdp'], + 'application/vnd.adobe.xfdf' => ['xfdf'], + 'application/vnd.age' => ['age'], + 'application/vnd.ahead.space' => ['ahead'], + 'application/vnd.airzip.filesecure.azf' => ['azf'], + 'application/vnd.airzip.filesecure.azs' => ['azs'], + 'application/vnd.amazon.ebook' => ['azw'], + 'application/vnd.americandynamics.acc' => ['acc'], + 'application/vnd.amiga.ami' => ['ami'], + 'application/vnd.android.package-archive' => ['apk'], + 'application/vnd.anser-web-certificate-issue-initiation' => ['cii'], + 'application/vnd.anser-web-funds-transfer-initiation' => ['fti'], + 'application/vnd.antix.game-component' => ['atx'], + 'application/vnd.apple.installer+xml' => ['mpkg'], + 'application/vnd.apple.keynote' => ['key'], + 'application/vnd.apple.mpegurl' => ['m3u8'], + 'application/vnd.apple.numbers' => ['numbers'], + 'application/vnd.apple.pages' => ['pages'], + 'application/vnd.apple.pkpass' => ['pkpass'], + 'application/vnd.aristanetworks.swi' => ['swi'], + 'application/vnd.astraea-software.iota' => ['iota'], + 'application/vnd.audiograph' => ['aep'], + 'application/vnd.balsamiq.bmml+xml' => ['bmml'], + 'application/vnd.blueice.multipass' => ['mpm'], + 'application/vnd.bmi' => ['bmi'], + 'application/vnd.businessobjects' => ['rep'], + 'application/vnd.chemdraw+xml' => ['cdxml'], + 'application/vnd.chipnuts.karaoke-mmd' => ['mmd'], + 'application/vnd.cinderella' => ['cdy'], + 'application/vnd.citationstyles.style+xml' => ['csl'], + 'application/vnd.claymore' => ['cla'], + 'application/vnd.cloanto.rp9' => ['rp9'], + 'application/vnd.clonk.c4group' => ['c4g', 'c4d', 'c4f', 'c4p', 'c4u'], + 'application/vnd.cluetrust.cartomobile-config' => ['c11amc'], + 'application/vnd.cluetrust.cartomobile-config-pkg' => ['c11amz'], + 'application/vnd.commonspace' => ['csp'], + 'application/vnd.contact.cmsg' => ['cdbcmsg'], + 'application/vnd.cosmocaller' => ['cmc'], + 'application/vnd.crick.clicker' => ['clkx'], + 'application/vnd.crick.clicker.keyboard' => ['clkk'], + 'application/vnd.crick.clicker.palette' => ['clkp'], + 'application/vnd.crick.clicker.template' => ['clkt'], + 'application/vnd.crick.clicker.wordbank' => ['clkw'], + 'application/vnd.criticaltools.wbs+xml' => ['wbs'], + 'application/vnd.ctc-posml' => ['pml'], + 'application/vnd.cups-ppd' => ['ppd'], + 'application/vnd.curl.car' => ['car'], + 'application/vnd.curl.pcurl' => ['pcurl'], + 'application/vnd.dart' => ['dart'], + 'application/vnd.data-vision.rdz' => ['rdz'], + 'application/vnd.dbf' => ['dbf'], + 'application/vnd.dece.data' => ['uvf', 'uvvf', 'uvd', 'uvvd'], + 'application/vnd.dece.ttml+xml' => ['uvt', 'uvvt'], + 'application/vnd.dece.unspecified' => ['uvx', 'uvvx'], + 'application/vnd.dece.zip' => ['uvz', 'uvvz'], + 'application/vnd.denovo.fcselayout-link' => ['fe_launch'], + 'application/vnd.dna' => ['dna'], + 'application/vnd.dolby.mlp' => ['mlp'], + 'application/vnd.dpgraph' => ['dpg'], + 'application/vnd.dreamfactory' => ['dfac'], + 'application/vnd.ds-keypoint' => ['kpxx'], + 'application/vnd.dvb.ait' => ['ait'], + 'application/vnd.dvb.service' => ['svc'], + 'application/vnd.dynageo' => ['geo'], + 'application/vnd.ecowin.chart' => ['mag'], + 'application/vnd.enliven' => ['nml'], + 'application/vnd.epson.esf' => ['esf'], + 'application/vnd.epson.msf' => ['msf'], + 'application/vnd.epson.quickanime' => ['qam'], + 'application/vnd.epson.salt' => ['slt'], + 'application/vnd.epson.ssf' => ['ssf'], + 'application/vnd.eszigno3+xml' => ['es3', 'et3'], + 'application/vnd.ezpix-album' => ['ez2'], + 'application/vnd.ezpix-package' => ['ez3'], + 'application/vnd.fdf' => ['fdf'], + 'application/vnd.fdsn.mseed' => ['mseed'], + 'application/vnd.fdsn.seed' => ['seed', 'dataless'], + 'application/vnd.flographit' => ['gph'], + 'application/vnd.fluxtime.clip' => ['ftc'], + 'application/vnd.framemaker' => ['fm', 'frame', 'maker', 'book'], + 'application/vnd.frogans.fnc' => ['fnc'], + 'application/vnd.frogans.ltf' => ['ltf'], + 'application/vnd.fsc.weblaunch' => ['fsc'], + 'application/vnd.fujitsu.oasys' => ['oas'], + 'application/vnd.fujitsu.oasys2' => ['oa2'], + 'application/vnd.fujitsu.oasys3' => ['oa3'], + 'application/vnd.fujitsu.oasysgp' => ['fg5'], + 'application/vnd.fujitsu.oasysprs' => ['bh2'], + 'application/vnd.fujixerox.ddd' => ['ddd'], + 'application/vnd.fujixerox.docuworks' => ['xdw'], + 'application/vnd.fujixerox.docuworks.binder' => ['xbd'], + 'application/vnd.fuzzysheet' => ['fzs'], + 'application/vnd.genomatix.tuxedo' => ['txd'], + 'application/vnd.geogebra.file' => ['ggb'], + 'application/vnd.geogebra.tool' => ['ggt'], + 'application/vnd.geometry-explorer' => ['gex', 'gre'], + 'application/vnd.geonext' => ['gxt'], + 'application/vnd.geoplan' => ['g2w'], + 'application/vnd.geospace' => ['g3w'], + 'application/vnd.gmx' => ['gmx'], + 'application/vnd.google-apps.document' => ['gdoc'], + 'application/vnd.google-apps.presentation' => ['gslides'], + 'application/vnd.google-apps.spreadsheet' => ['gsheet'], + 'application/vnd.google-earth.kml+xml' => ['kml'], + 'application/vnd.google-earth.kmz' => ['kmz'], + 'application/vnd.grafeq' => ['gqf', 'gqs'], + 'application/vnd.groove-account' => ['gac'], + 'application/vnd.groove-help' => ['ghf'], + 'application/vnd.groove-identity-message' => ['gim'], + 'application/vnd.groove-injector' => ['grv'], + 'application/vnd.groove-tool-message' => ['gtm'], + 'application/vnd.groove-tool-template' => ['tpl'], + 'application/vnd.groove-vcard' => ['vcg'], + 'application/vnd.hal+xml' => ['hal'], + 'application/vnd.handheld-entertainment+xml' => ['zmm'], + 'application/vnd.hbci' => ['hbci'], + 'application/vnd.hhe.lesson-player' => ['les'], + 'application/vnd.hp-hpgl' => ['hpgl'], + 'application/vnd.hp-hpid' => ['hpid'], + 'application/vnd.hp-hps' => ['hps'], + 'application/vnd.hp-jlyt' => ['jlt'], + 'application/vnd.hp-pcl' => ['pcl'], + 'application/vnd.hp-pclxl' => ['pclxl'], + 'application/vnd.hydrostatix.sof-data' => ['sfd-hdstx'], + 'application/vnd.ibm.minipay' => ['mpy'], + 'application/vnd.ibm.modcap' => ['afp', 'listafp', 'list3820'], + 'application/vnd.ibm.rights-management' => ['irm'], + 'application/vnd.ibm.secure-container' => ['sc'], + 'application/vnd.iccprofile' => ['icc', 'icm'], + 'application/vnd.igloader' => ['igl'], + 'application/vnd.immervision-ivp' => ['ivp'], + 'application/vnd.immervision-ivu' => ['ivu'], + 'application/vnd.insors.igm' => ['igm'], + 'application/vnd.intercon.formnet' => ['xpw', 'xpx'], + 'application/vnd.intergeo' => ['i2g'], + 'application/vnd.intu.qbo' => ['qbo'], + 'application/vnd.intu.qfx' => ['qfx'], + 'application/vnd.ipunplugged.rcprofile' => ['rcprofile'], + 'application/vnd.irepository.package+xml' => ['irp'], + 'application/vnd.is-xpr' => ['xpr'], + 'application/vnd.isac.fcs' => ['fcs'], + 'application/vnd.jam' => ['jam'], + 'application/vnd.jcp.javame.midlet-rms' => ['rms'], + 'application/vnd.jisp' => ['jisp'], + 'application/vnd.joost.joda-archive' => ['joda'], + 'application/vnd.kahootz' => ['ktz', 'ktr'], + 'application/vnd.kde.karbon' => ['karbon'], + 'application/vnd.kde.kchart' => ['chrt'], + 'application/vnd.kde.kformula' => ['kfo'], + 'application/vnd.kde.kivio' => ['flw'], + 'application/vnd.kde.kontour' => ['kon'], + 'application/vnd.kde.kpresenter' => ['kpr', 'kpt'], + 'application/vnd.kde.kspread' => ['ksp'], + 'application/vnd.kde.kword' => ['kwd', 'kwt'], + 'application/vnd.kenameaapp' => ['htke'], + 'application/vnd.kidspiration' => ['kia'], + 'application/vnd.kinar' => ['kne', 'knp'], + 'application/vnd.koan' => ['skp', 'skd', 'skt', 'skm'], + 'application/vnd.kodak-descriptor' => ['sse'], + 'application/vnd.las.las+xml' => ['lasxml'], + 'application/vnd.llamagraphics.life-balance.desktop' => ['lbd'], + 'application/vnd.llamagraphics.life-balance.exchange+xml' => ['lbe'], + 'application/vnd.lotus-1-2-3' => ['123'], + 'application/vnd.lotus-approach' => ['apr'], + 'application/vnd.lotus-freelance' => ['pre'], + 'application/vnd.lotus-notes' => ['nsf'], + 'application/vnd.lotus-organizer' => ['org'], + 'application/vnd.lotus-screencam' => ['scm'], + 'application/vnd.lotus-wordpro' => ['lwp'], + 'application/vnd.macports.portpkg' => ['portpkg'], + 'application/vnd.mapbox-vector-tile' => ['mvt'], + 'application/vnd.mcd' => ['mcd'], + 'application/vnd.medcalcdata' => ['mc1'], + 'application/vnd.mediastation.cdkey' => ['cdkey'], + 'application/vnd.mfer' => ['mwf'], + 'application/vnd.mfmp' => ['mfm'], + 'application/vnd.micrografx.flo' => ['flo'], + 'application/vnd.micrografx.igx' => ['igx'], + 'application/vnd.mif' => ['mif'], + 'application/vnd.mobius.daf' => ['daf'], + 'application/vnd.mobius.dis' => ['dis'], + 'application/vnd.mobius.mbk' => ['mbk'], + 'application/vnd.mobius.mqy' => ['mqy'], + 'application/vnd.mobius.msl' => ['msl'], + 'application/vnd.mobius.plc' => ['plc'], + 'application/vnd.mobius.txf' => ['txf'], + 'application/vnd.mophun.application' => ['mpn'], + 'application/vnd.mophun.certificate' => ['mpc'], + 'application/vnd.mozilla.xul+xml' => ['xul'], + 'application/vnd.ms-artgalry' => ['cil'], + 'application/vnd.ms-cab-compressed' => ['cab'], + 'application/vnd.ms-excel' => ['xls', 'xlm', 'xla', 'xlc', 'xlt', 'xlw'], + 'application/vnd.ms-excel.addin.macroenabled.12' => ['xlam'], + 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => ['xlsb'], + 'application/vnd.ms-excel.sheet.macroenabled.12' => ['xlsm'], + 'application/vnd.ms-excel.template.macroenabled.12' => ['xltm'], + 'application/vnd.ms-fontobject' => ['eot'], + 'application/vnd.ms-htmlhelp' => ['chm'], + 'application/vnd.ms-ims' => ['ims'], + 'application/vnd.ms-lrm' => ['lrm'], + 'application/vnd.ms-officetheme' => ['thmx'], + 'application/vnd.ms-outlook' => ['msg'], + 'application/vnd.ms-pki.seccat' => ['cat'], + 'application/vnd.ms-pki.stl' => ['stl'], + 'application/vnd.ms-powerpoint' => ['ppt', 'pps', 'pot', 'ppa'], + 'application/vnd.ms-powerpoint.addin.macroenabled.12' => ['ppam'], + 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => ['pptm'], + 'application/vnd.ms-powerpoint.slide.macroenabled.12' => ['sldm'], + 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => ['ppsm'], + 'application/vnd.ms-powerpoint.template.macroenabled.12' => ['potm'], + 'application/vnd.ms-project' => ['mpp', 'mpt'], + 'application/vnd.ms-word.document.macroenabled.12' => ['docm'], + 'application/vnd.ms-word.template.macroenabled.12' => ['dotm'], + 'application/vnd.ms-works' => ['wps', 'wks', 'wcm', 'wdb'], + 'application/vnd.ms-wpl' => ['wpl'], + 'application/vnd.ms-xpsdocument' => ['xps'], + 'application/vnd.mseq' => ['mseq'], + 'application/vnd.musician' => ['mus'], + 'application/vnd.muvee.style' => ['msty'], + 'application/vnd.mynfc' => ['taglet'], + 'application/vnd.neurolanguage.nlu' => ['nlu'], + 'application/vnd.nitf' => ['ntf', 'nitf'], + 'application/vnd.noblenet-directory' => ['nnd'], + 'application/vnd.noblenet-sealer' => ['nns'], + 'application/vnd.noblenet-web' => ['nnw'], + 'application/vnd.nokia.n-gage.ac+xml' => ['ac'], + 'application/vnd.nokia.n-gage.data' => ['ngdat'], + 'application/vnd.nokia.n-gage.symbian.install' => ['n-gage'], + 'application/vnd.nokia.radio-preset' => ['rpst'], + 'application/vnd.nokia.radio-presets' => ['rpss'], + 'application/vnd.novadigm.edm' => ['edm'], + 'application/vnd.novadigm.edx' => ['edx'], + 'application/vnd.novadigm.ext' => ['ext'], + 'application/vnd.oasis.opendocument.chart' => ['odc'], + 'application/vnd.oasis.opendocument.chart-template' => ['otc'], + 'application/vnd.oasis.opendocument.database' => ['odb'], + 'application/vnd.oasis.opendocument.formula' => ['odf'], + 'application/vnd.oasis.opendocument.formula-template' => ['odft'], + 'application/vnd.oasis.opendocument.graphics' => ['odg'], + 'application/vnd.oasis.opendocument.graphics-template' => ['otg'], + 'application/vnd.oasis.opendocument.image' => ['odi'], + 'application/vnd.oasis.opendocument.image-template' => ['oti'], + 'application/vnd.oasis.opendocument.presentation' => ['odp'], + 'application/vnd.oasis.opendocument.presentation-template' => ['otp'], + 'application/vnd.oasis.opendocument.spreadsheet' => ['ods'], + 'application/vnd.oasis.opendocument.spreadsheet-template' => ['ots'], + 'application/vnd.oasis.opendocument.text' => ['odt'], + 'application/vnd.oasis.opendocument.text-master' => ['odm'], + 'application/vnd.oasis.opendocument.text-template' => ['ott'], + 'application/vnd.oasis.opendocument.text-web' => ['oth'], + 'application/vnd.olpc-sugar' => ['xo'], + 'application/vnd.oma.dd2+xml' => ['dd2'], + 'application/vnd.openblox.game+xml' => ['obgx'], + 'application/vnd.openofficeorg.extension' => ['oxt'], + 'application/vnd.openstreetmap.data+xml' => ['osm'], + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => ['pptx'], + 'application/vnd.openxmlformats-officedocument.presentationml.slide' => ['sldx'], + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => ['ppsx'], + 'application/vnd.openxmlformats-officedocument.presentationml.template' => ['potx'], + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => ['xlsx'], + 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => ['xltx'], + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => ['docx'], + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => ['dotx'], + 'application/vnd.osgeo.mapguide.package' => ['mgp'], + 'application/vnd.osgi.dp' => ['dp'], + 'application/vnd.osgi.subsystem' => ['esa'], + 'application/vnd.palm' => ['pdb', 'pqa', 'oprc'], + 'application/vnd.pawaafile' => ['paw'], + 'application/vnd.pg.format' => ['str'], + 'application/vnd.pg.osasli' => ['ei6'], + 'application/vnd.picsel' => ['efif'], + 'application/vnd.pmi.widget' => ['wg'], + 'application/vnd.pocketlearn' => ['plf'], + 'application/vnd.powerbuilder6' => ['pbd'], + 'application/vnd.previewsystems.box' => ['box'], + 'application/vnd.proteus.magazine' => ['mgz'], + 'application/vnd.publishare-delta-tree' => ['qps'], + 'application/vnd.pvi.ptid1' => ['ptid'], + 'application/vnd.pwg-xhtml-print+xml' => ['xhtm'], + 'application/vnd.quark.quarkxpress' => ['qxd', 'qxt', 'qwd', 'qwt', 'qxl', 'qxb'], + 'application/vnd.rar' => ['rar'], + 'application/vnd.realvnc.bed' => ['bed'], + 'application/vnd.recordare.musicxml' => ['mxl'], + 'application/vnd.recordare.musicxml+xml' => ['musicxml'], + 'application/vnd.rig.cryptonote' => ['cryptonote'], + 'application/vnd.rim.cod' => ['cod'], + 'application/vnd.rn-realmedia' => ['rm'], + 'application/vnd.rn-realmedia-vbr' => ['rmvb'], + 'application/vnd.route66.link66+xml' => ['link66'], + 'application/vnd.sailingtracker.track' => ['st'], + 'application/vnd.seemail' => ['see'], + 'application/vnd.sema' => ['sema'], + 'application/vnd.semd' => ['semd'], + 'application/vnd.semf' => ['semf'], + 'application/vnd.shana.informed.formdata' => ['ifm'], + 'application/vnd.shana.informed.formtemplate' => ['itp'], + 'application/vnd.shana.informed.interchange' => ['iif'], + 'application/vnd.shana.informed.package' => ['ipk'], + 'application/vnd.simtech-mindmapper' => ['twd', 'twds'], + 'application/vnd.smaf' => ['mmf'], + 'application/vnd.smart.teacher' => ['teacher'], + 'application/vnd.software602.filler.form+xml' => ['fo'], + 'application/vnd.solent.sdkm+xml' => ['sdkm', 'sdkd'], + 'application/vnd.spotfire.dxp' => ['dxp'], + 'application/vnd.spotfire.sfs' => ['sfs'], + 'application/vnd.stardivision.calc' => ['sdc'], + 'application/vnd.stardivision.draw' => ['sda'], + 'application/vnd.stardivision.impress' => ['sdd'], + 'application/vnd.stardivision.math' => ['smf'], + 'application/vnd.stardivision.writer' => ['sdw', 'vor'], + 'application/vnd.stardivision.writer-global' => ['sgl'], + 'application/vnd.stepmania.package' => ['smzip'], + 'application/vnd.stepmania.stepchart' => ['sm'], + 'application/vnd.sun.wadl+xml' => ['wadl'], + 'application/vnd.sun.xml.calc' => ['sxc'], + 'application/vnd.sun.xml.calc.template' => ['stc'], + 'application/vnd.sun.xml.draw' => ['sxd'], + 'application/vnd.sun.xml.draw.template' => ['std'], + 'application/vnd.sun.xml.impress' => ['sxi'], + 'application/vnd.sun.xml.impress.template' => ['sti'], + 'application/vnd.sun.xml.math' => ['sxm'], + 'application/vnd.sun.xml.writer' => ['sxw'], + 'application/vnd.sun.xml.writer.global' => ['sxg'], + 'application/vnd.sun.xml.writer.template' => ['stw'], + 'application/vnd.sus-calendar' => ['sus', 'susp'], + 'application/vnd.svd' => ['svd'], + 'application/vnd.symbian.install' => ['sis', 'sisx'], + 'application/vnd.syncml+xml' => ['xsm'], + 'application/vnd.syncml.dm+wbxml' => ['bdm'], + 'application/vnd.syncml.dm+xml' => ['xdm'], + 'application/vnd.syncml.dmddf+xml' => ['ddf'], + 'application/vnd.tao.intent-module-archive' => ['tao'], + 'application/vnd.tcpdump.pcap' => ['pcap', 'cap', 'dmp'], + 'application/vnd.tmobile-livetv' => ['tmo'], + 'application/vnd.trid.tpt' => ['tpt'], + 'application/vnd.triscape.mxs' => ['mxs'], + 'application/vnd.trueapp' => ['tra'], + 'application/vnd.ufdl' => ['ufd', 'ufdl'], + 'application/vnd.uiq.theme' => ['utz'], + 'application/vnd.umajin' => ['umj'], + 'application/vnd.unity' => ['unityweb'], + 'application/vnd.uoml+xml' => ['uoml', 'uo'], + 'application/vnd.vcx' => ['vcx'], + 'application/vnd.visio' => ['vsd', 'vst', 'vss', 'vsw'], + 'application/vnd.visionary' => ['vis'], + 'application/vnd.vsf' => ['vsf'], + 'application/vnd.wap.wbxml' => ['wbxml'], + 'application/vnd.wap.wmlc' => ['wmlc'], + 'application/vnd.wap.wmlscriptc' => ['wmlsc'], + 'application/vnd.webturbo' => ['wtb'], + 'application/vnd.wolfram.player' => ['nbp'], + 'application/vnd.wordperfect' => ['wpd'], + 'application/vnd.wqd' => ['wqd'], + 'application/vnd.wt.stf' => ['stf'], + 'application/vnd.xara' => ['xar'], + 'application/vnd.xfdl' => ['xfdl'], + 'application/vnd.yamaha.hv-dic' => ['hvd'], + 'application/vnd.yamaha.hv-script' => ['hvs'], + 'application/vnd.yamaha.hv-voice' => ['hvp'], + 'application/vnd.yamaha.openscoreformat' => ['osf'], + 'application/vnd.yamaha.openscoreformat.osfpvg+xml' => ['osfpvg'], + 'application/vnd.yamaha.smaf-audio' => ['saf'], + 'application/vnd.yamaha.smaf-phrase' => ['spf'], + 'application/vnd.yellowriver-custom-menu' => ['cmp'], + 'application/vnd.zul' => ['zir', 'zirz'], + 'application/vnd.zzazz.deck+xml' => ['zaz'], + 'application/voicexml+xml' => ['vxml'], + 'application/wasm' => ['wasm'], + 'application/watcherinfo+xml' => ['wif'], + 'application/widget' => ['wgt'], + 'application/winhlp' => ['hlp'], + 'application/wsdl+xml' => ['wsdl'], + 'application/wspolicy+xml' => ['wspolicy'], + 'application/x-7z-compressed' => ['7z', '7zip'], + 'application/x-abiword' => ['abw'], + 'application/x-ace-compressed' => ['ace'], + 'application/x-apple-diskimage' => ['dmg'], + 'application/x-arj' => ['arj'], + 'application/x-authorware-bin' => ['aab', 'x32', 'u32', 'vox'], + 'application/x-authorware-map' => ['aam'], + 'application/x-authorware-seg' => ['aas'], + 'application/x-bcpio' => ['bcpio'], + 'application/x-bdoc' => ['bdoc'], + 'application/x-bittorrent' => ['torrent'], + 'application/x-blorb' => ['blb', 'blorb'], + 'application/x-bzip' => ['bz'], + 'application/x-bzip2' => ['bz2', 'boz'], + 'application/x-cbr' => ['cbr', 'cba', 'cbt', 'cbz', 'cb7'], + 'application/x-cdlink' => ['vcd'], + 'application/x-cfs-compressed' => ['cfs'], + 'application/x-chat' => ['chat'], + 'application/x-chess-pgn' => ['pgn'], + 'application/x-chrome-extension' => ['crx'], + 'application/x-cocoa' => ['cco'], + 'application/x-conference' => ['nsc'], + 'application/x-cpio' => ['cpio'], + 'application/x-csh' => ['csh'], + 'application/x-debian-package' => ['deb', 'udeb'], + 'application/x-dgc-compressed' => ['dgc'], + 'application/x-director' => ['dir', 'dcr', 'dxr', 'cst', 'cct', 'cxt', 'w3d', 'fgd', 'swa'], + 'application/x-doom' => ['wad'], + 'application/x-dtbncx+xml' => ['ncx'], + 'application/x-dtbook+xml' => ['dtb'], + 'application/x-dtbresource+xml' => ['res'], + 'application/x-dvi' => ['dvi'], + 'application/x-envoy' => ['evy'], + 'application/x-eva' => ['eva'], + 'application/x-font-bdf' => ['bdf'], + 'application/x-font-ghostscript' => ['gsf'], + 'application/x-font-linux-psf' => ['psf'], + 'application/x-font-pcf' => ['pcf'], + 'application/x-font-snf' => ['snf'], + 'application/x-font-type1' => ['pfa', 'pfb', 'pfm', 'afm'], + 'application/x-freearc' => ['arc'], + 'application/x-futuresplash' => ['spl'], + 'application/x-gca-compressed' => ['gca'], + 'application/x-glulx' => ['ulx'], + 'application/x-gnumeric' => ['gnumeric'], + 'application/x-gramps-xml' => ['gramps'], + 'application/x-gtar' => ['gtar'], + 'application/x-hdf' => ['hdf'], + 'application/x-httpd-php' => ['php', 'php4', 'php3', 'phtml'], + 'application/x-install-instructions' => ['install'], + 'application/x-iso9660-image' => ['iso'], + 'application/x-iwork-keynote-sffkey' => ['key'], + 'application/x-iwork-numbers-sffnumbers' => ['numbers'], + 'application/x-iwork-pages-sffpages' => ['pages'], + 'application/x-java-archive-diff' => ['jardiff'], + 'application/x-java-jnlp-file' => ['jnlp'], + 'application/x-keepass2' => ['kdbx'], + 'application/x-latex' => ['latex'], + 'application/x-lua-bytecode' => ['luac'], + 'application/x-lzh-compressed' => ['lzh', 'lha'], + 'application/x-makeself' => ['run'], + 'application/x-mie' => ['mie'], + 'application/x-mobipocket-ebook' => ['prc', 'mobi'], + 'application/x-ms-application' => ['application'], + 'application/x-ms-shortcut' => ['lnk'], + 'application/x-ms-wmd' => ['wmd'], + 'application/x-ms-wmz' => ['wmz'], + 'application/x-ms-xbap' => ['xbap'], + 'application/x-msaccess' => ['mdb'], + 'application/x-msbinder' => ['obd'], + 'application/x-mscardfile' => ['crd'], + 'application/x-msclip' => ['clp'], + 'application/x-msdos-program' => ['exe'], + 'application/x-msdownload' => ['exe', 'dll', 'com', 'bat', 'msi'], + 'application/x-msmediaview' => ['mvb', 'm13', 'm14'], + 'application/x-msmetafile' => ['wmf', 'wmz', 'emf', 'emz'], + 'application/x-msmoney' => ['mny'], + 'application/x-mspublisher' => ['pub'], + 'application/x-msschedule' => ['scd'], + 'application/x-msterminal' => ['trm'], + 'application/x-mswrite' => ['wri'], + 'application/x-netcdf' => ['nc', 'cdf'], + 'application/x-ns-proxy-autoconfig' => ['pac'], + 'application/x-nzb' => ['nzb'], + 'application/x-perl' => ['pl', 'pm'], + 'application/x-pilot' => ['prc', 'pdb'], + 'application/x-pkcs12' => ['p12', 'pfx'], + 'application/x-pkcs7-certificates' => ['p7b', 'spc'], + 'application/x-pkcs7-certreqresp' => ['p7r'], + 'application/x-rar-compressed' => ['rar'], + 'application/x-redhat-package-manager' => ['rpm'], + 'application/x-research-info-systems' => ['ris'], + 'application/x-sea' => ['sea'], + 'application/x-sh' => ['sh'], + 'application/x-shar' => ['shar'], + 'application/x-shockwave-flash' => ['swf'], + 'application/x-silverlight-app' => ['xap'], + 'application/x-sql' => ['sql'], + 'application/x-stuffit' => ['sit'], + 'application/x-stuffitx' => ['sitx'], + 'application/x-subrip' => ['srt'], + 'application/x-sv4cpio' => ['sv4cpio'], + 'application/x-sv4crc' => ['sv4crc'], + 'application/x-t3vm-image' => ['t3'], + 'application/x-tads' => ['gam'], + 'application/x-tar' => ['tar', 'tgz'], + 'application/x-tcl' => ['tcl', 'tk'], + 'application/x-tex' => ['tex'], + 'application/x-tex-tfm' => ['tfm'], + 'application/x-texinfo' => ['texinfo', 'texi'], + 'application/x-tgif' => ['obj'], + 'application/x-ustar' => ['ustar'], + 'application/x-virtualbox-hdd' => ['hdd'], + 'application/x-virtualbox-ova' => ['ova'], + 'application/x-virtualbox-ovf' => ['ovf'], + 'application/x-virtualbox-vbox' => ['vbox'], + 'application/x-virtualbox-vbox-extpack' => ['vbox-extpack'], + 'application/x-virtualbox-vdi' => ['vdi'], + 'application/x-virtualbox-vhd' => ['vhd'], + 'application/x-virtualbox-vmdk' => ['vmdk'], + 'application/x-wais-source' => ['src'], + 'application/x-web-app-manifest+json' => ['webapp'], + 'application/x-x509-ca-cert' => ['der', 'crt', 'pem'], + 'application/x-xfig' => ['fig'], + 'application/x-xliff+xml' => ['xlf'], + 'application/x-xpinstall' => ['xpi'], + 'application/x-xz' => ['xz'], + 'application/x-zmachine' => ['z1', 'z2', 'z3', 'z4', 'z5', 'z6', 'z7', 'z8'], + 'application/xaml+xml' => ['xaml'], + 'application/xcap-att+xml' => ['xav'], + 'application/xcap-caps+xml' => ['xca'], + 'application/xcap-diff+xml' => ['xdf'], + 'application/xcap-el+xml' => ['xel'], + 'application/xcap-ns+xml' => ['xns'], + 'application/xenc+xml' => ['xenc'], + 'application/xfdf' => ['xfdf'], + 'application/xhtml+xml' => ['xhtml', 'xht'], + 'application/xliff+xml' => ['xlf'], + 'application/xml' => ['xml', 'xsl', 'xsd', 'rng'], + 'application/xml-dtd' => ['dtd'], + 'application/xop+xml' => ['xop'], + 'application/xproc+xml' => ['xpl'], + 'application/xslt+xml' => ['xsl', 'xslt'], + 'application/xspf+xml' => ['xspf'], + 'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'], + 'application/yang' => ['yang'], + 'application/yin+xml' => ['yin'], + 'application/zip' => ['zip'], + 'audio/3gpp' => ['3gpp'], + 'audio/aac' => ['adts', 'aac'], + 'audio/adpcm' => ['adp'], + 'audio/amr' => ['amr'], + 'audio/basic' => ['au', 'snd'], + 'audio/midi' => ['mid', 'midi', 'kar', 'rmi'], + 'audio/mobile-xmf' => ['mxmf'], + 'audio/mp3' => ['mp3'], + 'audio/mp4' => ['m4a', 'mp4a'], + 'audio/mpeg' => ['mpga', 'mp2', 'mp2a', 'mp3', 'm2a', 'm3a'], + 'audio/ogg' => ['oga', 'ogg', 'spx', 'opus'], + 'audio/s3m' => ['s3m'], + 'audio/silk' => ['sil'], + 'audio/vnd.dece.audio' => ['uva', 'uvva'], + 'audio/vnd.digital-winds' => ['eol'], + 'audio/vnd.dra' => ['dra'], + 'audio/vnd.dts' => ['dts'], + 'audio/vnd.dts.hd' => ['dtshd'], + 'audio/vnd.lucent.voice' => ['lvp'], + 'audio/vnd.ms-playready.media.pya' => ['pya'], + 'audio/vnd.nuera.ecelp4800' => ['ecelp4800'], + 'audio/vnd.nuera.ecelp7470' => ['ecelp7470'], + 'audio/vnd.nuera.ecelp9600' => ['ecelp9600'], + 'audio/vnd.rip' => ['rip'], + 'audio/wav' => ['wav'], + 'audio/wave' => ['wav'], + 'audio/webm' => ['weba'], + 'audio/x-aac' => ['aac'], + 'audio/x-aiff' => ['aif', 'aiff', 'aifc'], + 'audio/x-caf' => ['caf'], + 'audio/x-flac' => ['flac'], + 'audio/x-m4a' => ['m4a'], + 'audio/x-matroska' => ['mka'], + 'audio/x-mpegurl' => ['m3u'], + 'audio/x-ms-wax' => ['wax'], + 'audio/x-ms-wma' => ['wma'], + 'audio/x-pn-realaudio' => ['ram', 'ra', 'rm'], + 'audio/x-pn-realaudio-plugin' => ['rmp', 'rpm'], + 'audio/x-realaudio' => ['ra'], + 'audio/x-wav' => ['wav'], + 'audio/xm' => ['xm'], + 'chemical/x-cdx' => ['cdx'], + 'chemical/x-cif' => ['cif'], + 'chemical/x-cmdf' => ['cmdf'], + 'chemical/x-cml' => ['cml'], + 'chemical/x-csml' => ['csml'], + 'chemical/x-xyz' => ['xyz'], + 'font/collection' => ['ttc'], + 'font/otf' => ['otf'], + 'font/ttf' => ['ttf'], + 'font/woff' => ['woff'], + 'font/woff2' => ['woff2'], + 'image/aces' => ['exr'], + 'image/apng' => ['apng'], + 'image/avci' => ['avci'], + 'image/avcs' => ['avcs'], + 'image/avif' => ['avif'], + 'image/bmp' => ['bmp', 'dib'], + 'image/cgm' => ['cgm'], + 'image/dicom-rle' => ['drle'], + 'image/dpx' => ['dpx'], + 'image/emf' => ['emf'], + 'image/fits' => ['fits'], + 'image/g3fax' => ['g3'], + 'image/gif' => ['gif'], + 'image/heic' => ['heic'], + 'image/heic-sequence' => ['heics'], + 'image/heif' => ['heif'], + 'image/heif-sequence' => ['heifs'], + 'image/hej2k' => ['hej2'], + 'image/hsj2' => ['hsj2'], + 'image/ief' => ['ief'], + 'image/jls' => ['jls'], + 'image/jp2' => ['jp2', 'jpg2'], + 'image/jpeg' => ['jpeg', 'jpg', 'jpe'], + 'image/jph' => ['jph'], + 'image/jphc' => ['jhc'], + 'image/jpm' => ['jpm', 'jpgm'], + 'image/jpx' => ['jpx', 'jpf'], + 'image/jxr' => ['jxr'], + 'image/jxra' => ['jxra'], + 'image/jxrs' => ['jxrs'], + 'image/jxs' => ['jxs'], + 'image/jxsc' => ['jxsc'], + 'image/jxsi' => ['jxsi'], + 'image/jxss' => ['jxss'], + 'image/ktx' => ['ktx'], + 'image/ktx2' => ['ktx2'], + 'image/png' => ['png'], + 'image/prs.btif' => ['btif', 'btf'], + 'image/prs.pti' => ['pti'], + 'image/sgi' => ['sgi'], + 'image/svg+xml' => ['svg', 'svgz'], + 'image/t38' => ['t38'], + 'image/tiff' => ['tif', 'tiff'], + 'image/tiff-fx' => ['tfx'], + 'image/vnd.adobe.photoshop' => ['psd'], + 'image/vnd.airzip.accelerator.azv' => ['azv'], + 'image/vnd.dece.graphic' => ['uvi', 'uvvi', 'uvg', 'uvvg'], + 'image/vnd.djvu' => ['djvu', 'djv'], + 'image/vnd.dvb.subtitle' => ['sub'], + 'image/vnd.dwg' => ['dwg'], + 'image/vnd.dxf' => ['dxf'], + 'image/vnd.fastbidsheet' => ['fbs'], + 'image/vnd.fpx' => ['fpx'], + 'image/vnd.fst' => ['fst'], + 'image/vnd.fujixerox.edmics-mmr' => ['mmr'], + 'image/vnd.fujixerox.edmics-rlc' => ['rlc'], + 'image/vnd.microsoft.icon' => ['ico'], + 'image/vnd.ms-dds' => ['dds'], + 'image/vnd.ms-modi' => ['mdi'], + 'image/vnd.ms-photo' => ['wdp'], + 'image/vnd.net-fpx' => ['npx'], + 'image/vnd.pco.b16' => ['b16'], + 'image/vnd.tencent.tap' => ['tap'], + 'image/vnd.valve.source.texture' => ['vtf'], + 'image/vnd.wap.wbmp' => ['wbmp'], + 'image/vnd.xiff' => ['xif'], + 'image/vnd.zbrush.pcx' => ['pcx'], + 'image/webp' => ['webp'], + 'image/wmf' => ['wmf'], + 'image/x-3ds' => ['3ds'], + 'image/x-cmu-raster' => ['ras'], + 'image/x-cmx' => ['cmx'], + 'image/x-freehand' => ['fh', 'fhc', 'fh4', 'fh5', 'fh7'], + 'image/x-icon' => ['ico'], + 'image/x-jng' => ['jng'], + 'image/x-mrsid-image' => ['sid'], + 'image/x-ms-bmp' => ['bmp'], + 'image/x-pcx' => ['pcx'], + 'image/x-pict' => ['pic', 'pct'], + 'image/x-portable-anymap' => ['pnm'], + 'image/x-portable-bitmap' => ['pbm'], + 'image/x-portable-graymap' => ['pgm'], + 'image/x-portable-pixmap' => ['ppm'], + 'image/x-rgb' => ['rgb'], + 'image/x-tga' => ['tga'], + 'image/x-xbitmap' => ['xbm'], + 'image/x-xpixmap' => ['xpm'], + 'image/x-xwindowdump' => ['xwd'], + 'message/disposition-notification' => ['disposition-notification'], + 'message/global' => ['u8msg'], + 'message/global-delivery-status' => ['u8dsn'], + 'message/global-disposition-notification' => ['u8mdn'], + 'message/global-headers' => ['u8hdr'], + 'message/rfc822' => ['eml', 'mime'], + 'message/vnd.wfa.wsc' => ['wsc'], + 'model/3mf' => ['3mf'], + 'model/gltf+json' => ['gltf'], + 'model/gltf-binary' => ['glb'], + 'model/iges' => ['igs', 'iges'], + 'model/jt' => ['jt'], + 'model/mesh' => ['msh', 'mesh', 'silo'], + 'model/mtl' => ['mtl'], + 'model/obj' => ['obj'], + 'model/prc' => ['prc'], + 'model/step+xml' => ['stpx'], + 'model/step+zip' => ['stpz'], + 'model/step-xml+zip' => ['stpxz'], + 'model/stl' => ['stl'], + 'model/u3d' => ['u3d'], + 'model/vnd.cld' => ['cld'], + 'model/vnd.collada+xml' => ['dae'], + 'model/vnd.dwf' => ['dwf'], + 'model/vnd.gdl' => ['gdl'], + 'model/vnd.gtw' => ['gtw'], + 'model/vnd.mts' => ['mts'], + 'model/vnd.opengex' => ['ogex'], + 'model/vnd.parasolid.transmit.binary' => ['x_b'], + 'model/vnd.parasolid.transmit.text' => ['x_t'], + 'model/vnd.pytha.pyox' => ['pyo', 'pyox'], + 'model/vnd.sap.vds' => ['vds'], + 'model/vnd.usda' => ['usda'], + 'model/vnd.usdz+zip' => ['usdz'], + 'model/vnd.valve.source.compiled-map' => ['bsp'], + 'model/vnd.vtu' => ['vtu'], + 'model/vrml' => ['wrl', 'vrml'], + 'model/x3d+binary' => ['x3db', 'x3dbz'], + 'model/x3d+fastinfoset' => ['x3db'], + 'model/x3d+vrml' => ['x3dv', 'x3dvz'], + 'model/x3d+xml' => ['x3d', 'x3dz'], + 'model/x3d-vrml' => ['x3dv'], + 'text/cache-manifest' => ['appcache', 'manifest'], + 'text/calendar' => ['ics', 'ifb'], + 'text/coffeescript' => ['coffee', 'litcoffee'], + 'text/css' => ['css'], + 'text/csv' => ['csv'], + 'text/html' => ['html', 'htm', 'shtml'], + 'text/jade' => ['jade'], + 'text/javascript' => ['js', 'mjs'], + 'text/jsx' => ['jsx'], + 'text/less' => ['less'], + 'text/markdown' => ['md', 'markdown'], + 'text/mathml' => ['mml'], + 'text/mdx' => ['mdx'], + 'text/n3' => ['n3'], + 'text/plain' => ['txt', 'text', 'conf', 'def', 'list', 'log', 'in', 'ini', 'm3u'], + 'text/prs.lines.tag' => ['dsc'], + 'text/richtext' => ['rtx'], + 'text/rtf' => ['rtf'], + 'text/sgml' => ['sgml', 'sgm'], + 'text/shex' => ['shex'], + 'text/slim' => ['slim', 'slm'], + 'text/spdx' => ['spdx'], + 'text/stylus' => ['stylus', 'styl'], + 'text/tab-separated-values' => ['tsv'], + 'text/troff' => ['t', 'tr', 'roff', 'man', 'me', 'ms'], + 'text/turtle' => ['ttl'], + 'text/uri-list' => ['uri', 'uris', 'urls'], + 'text/vcard' => ['vcard'], + 'text/vnd.curl' => ['curl'], + 'text/vnd.curl.dcurl' => ['dcurl'], + 'text/vnd.curl.mcurl' => ['mcurl'], + 'text/vnd.curl.scurl' => ['scurl'], + 'text/vnd.dvb.subtitle' => ['sub'], + 'text/vnd.familysearch.gedcom' => ['ged'], + 'text/vnd.fly' => ['fly'], + 'text/vnd.fmi.flexstor' => ['flx'], + 'text/vnd.graphviz' => ['gv'], + 'text/vnd.in3d.3dml' => ['3dml'], + 'text/vnd.in3d.spot' => ['spot'], + 'text/vnd.sun.j2me.app-descriptor' => ['jad'], + 'text/vnd.wap.wml' => ['wml'], + 'text/vnd.wap.wmlscript' => ['wmls'], + 'text/vtt' => ['vtt'], + 'text/wgsl' => ['wgsl'], + 'text/x-asm' => ['s', 'asm'], + 'text/x-c' => ['c', 'cc', 'cxx', 'cpp', 'h', 'hh', 'dic'], + 'text/x-component' => ['htc'], + 'text/x-fortran' => ['f', 'for', 'f77', 'f90'], + 'text/x-handlebars-template' => ['hbs'], + 'text/x-java-source' => ['java'], + 'text/x-lua' => ['lua'], + 'text/x-markdown' => ['mkd'], + 'text/x-nfo' => ['nfo'], + 'text/x-opml' => ['opml'], + 'text/x-org' => ['org'], + 'text/x-pascal' => ['p', 'pas'], + 'text/x-processing' => ['pde'], + 'text/x-sass' => ['sass'], + 'text/x-scss' => ['scss'], + 'text/x-setext' => ['etx'], + 'text/x-sfv' => ['sfv'], + 'text/x-suse-ymp' => ['ymp'], + 'text/x-uuencode' => ['uu'], + 'text/x-vcalendar' => ['vcs'], + 'text/x-vcard' => ['vcf'], + 'text/xml' => ['xml'], + 'text/yaml' => ['yaml', 'yml'], + 'video/3gpp' => ['3gp', '3gpp'], + 'video/3gpp2' => ['3g2'], + 'video/h261' => ['h261'], + 'video/h263' => ['h263'], + 'video/h264' => ['h264'], + 'video/iso.segment' => ['m4s'], + 'video/jpeg' => ['jpgv'], + 'video/jpm' => ['jpm', 'jpgm'], + 'video/mj2' => ['mj2', 'mjp2'], + 'video/mp2t' => ['ts'], + 'video/mp4' => ['mp4', 'mp4v', 'mpg4', 'f4v'], + 'video/mpeg' => ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v'], + 'video/ogg' => ['ogv'], + 'video/quicktime' => ['qt', 'mov'], + 'video/vnd.dece.hd' => ['uvh', 'uvvh'], + 'video/vnd.dece.mobile' => ['uvm', 'uvvm'], + 'video/vnd.dece.pd' => ['uvp', 'uvvp'], + 'video/vnd.dece.sd' => ['uvs', 'uvvs'], + 'video/vnd.dece.video' => ['uvv', 'uvvv'], + 'video/vnd.dvb.file' => ['dvb'], + 'video/vnd.fvt' => ['fvt'], + 'video/vnd.mpegurl' => ['mxu', 'm4u'], + 'video/vnd.ms-playready.media.pyv' => ['pyv'], + 'video/vnd.uvvu.mp4' => ['uvu', 'uvvu'], + 'video/vnd.vivo' => ['viv'], + 'video/webm' => ['webm'], + 'video/x-f4v' => ['f4v'], + 'video/x-fli' => ['fli'], + 'video/x-flv' => ['flv'], + 'video/x-m4v' => ['m4v'], + 'video/x-matroska' => ['mkv', 'mk3d', 'mks'], + 'video/x-mng' => ['mng'], + 'video/x-ms-asf' => ['asf', 'asx'], + 'video/x-ms-vob' => ['vob'], + 'video/x-ms-wm' => ['wm'], + 'video/x-ms-wmv' => ['wmv'], + 'video/x-ms-wmx' => ['wmx'], + 'video/x-ms-wvx' => ['wvx'], + 'video/x-msvideo' => ['avi'], + 'video/x-sgi-movie' => ['movie'], + 'video/x-smv' => ['smv'], + 'x-conference/x-cooltalk' => ['ice'], + 'application/x-photoshop' => ['psd'], + 'application/smil' => ['smi', 'smil'], + 'application/powerpoint' => ['ppt'], + 'application/vnd.ms-powerpoint.addin.macroEnabled.12' => ['ppam'], + 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' => ['pptm', 'potm'], + 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' => ['ppsm'], + 'application/wbxml' => ['wbxml'], + 'application/wmlc' => ['wmlc'], + 'application/x-httpd-php-source' => ['phps'], + 'application/x-compress' => ['z'], + 'application/x-rar' => ['rar'], + 'video/vnd.rn-realvideo' => ['rv'], + 'application/vnd.ms-word.template.macroEnabled.12' => ['docm', 'dotm'], + 'application/vnd.ms-excel.sheet.macroEnabled.12' => ['xlsm'], + 'application/vnd.ms-excel.template.macroEnabled.12' => ['xltm'], + 'application/vnd.ms-excel.addin.macroEnabled.12' => ['xlam'], + 'application/vnd.ms-excel.sheet.binary.macroEnabled.12' => ['xlsb'], + 'application/excel' => ['xl'], + 'application/x-x509-user-cert' => ['pem'], + 'application/x-pkcs10' => ['p10'], + 'application/x-pkcs7-signature' => ['p7a'], + 'application/pgp' => ['pgp'], + 'application/gpg-keys' => ['gpg'], + 'application/x-pkcs7' => ['rsa'], + 'video/3gp' => ['3gp'], + 'audio/acc' => ['aac'], + 'application/vnd.mpegurl' => ['m4u'], + 'application/videolan' => ['vlc'], + 'audio/x-au' => ['au'], + 'audio/ac3' => ['ac3'], + 'text/x-scriptzsh' => ['zsh'], + 'application/cdr' => ['cdr'], + 'application/STEP' => ['step', 'stp'], + 'application/x-ndjson' => ['ndjson'], + 'application/braille' => ['brf'], + ]; + + public function lookupMimeType(string $extension): ?string + { + return self::MIME_TYPES_FOR_EXTENSIONS[$extension] ?? null; + } + + public function lookupExtension(string $mimetype): ?string + { + return self::EXTENSIONS_FOR_MIME_TIMES[$mimetype][0] ?? null; + } + + /** + * @return string[] + */ + public function lookupAllExtensions(string $mimetype): array + { + return self::EXTENSIONS_FOR_MIME_TIMES[$mimetype] ?? []; + } +} diff --git a/trunk/vendor/league/mime-type-detection/src/MimeTypeDetector.php b/trunk/vendor/league/mime-type-detection/src/MimeTypeDetector.php new file mode 100644 index 00000000..5d799d2a --- /dev/null +++ b/trunk/vendor/league/mime-type-detection/src/MimeTypeDetector.php @@ -0,0 +1,19 @@ + $overrides + */ + public function __construct(ExtensionToMimeTypeMap $innerMap, array $overrides) + { + $this->innerMap = $innerMap; + $this->overrides = $overrides; + } + + public function lookupMimeType(string $extension): ?string + { + return $this->overrides[$extension] ?? $this->innerMap->lookupMimeType($extension); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/CHANGELOG.md b/trunk/vendor/phpcompatibility/php-compatibility/CHANGELOG.md new file mode 100644 index 00000000..b92ae254 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/CHANGELOG.md @@ -0,0 +1,1488 @@ +# Change Log for the PHPCompatibility standard for PHP Codesniffer + +All notable changes to this project will be documented in this file. + +This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/). + +Up to version 8.0.0, the `major.minor` version numbers were based on the PHP version for which compatibility check support was added, with `patch` version numbers being specific to this library. +From version 8.0.0 onwards, [Semantic Versioning](http://semver.org/) is used. + + + + +## [Unreleased] + +_Nothing yet._ + +## [9.3.5] - 2019-12-27 + +See all related issues and PRs in the [9.3.5 milestone]. + +### Added +- :star: `PHPCompatibility.Classes.NewClasses` sniff: recognize the new `FFI` extension related classes as introduced in PHP 7.4. [#949](https://github.com/PHPCompatibility/PHPCompatibility/pull/949) +- :star: `PHPCompatibility.IniDirectives.NewIniDirectives` sniff: detect use of the new `FFI` extension related ini directives as introduced in PHP 7.4. [#949](https://github.com/PHPCompatibility/PHPCompatibility/pull/949) + +### Changed +- :pencil: `PHPCompatibility.Syntax.NewShortArray`: improved clarity of the error message and made it consistent with other error messages in this standard. [#934](https://github.com/PHPCompatibility/PHPCompatibility/pull/934) +- :pencil: `PHPCompatibility.Interfaces.NewInterfaces`: updated the URL which is mentioned in select error messages. [#942](https://github.com/PHPCompatibility/PHPCompatibility/pull/942) +- :recycle: Another slew of code documentation fixes. [#937](https://github.com/PHPCompatibility/PHPCompatibility/pull/937), [#939](https://github.com/PHPCompatibility/PHPCompatibility/pull/939), [#940](https://github.com/PHPCompatibility/PHPCompatibility/pull/940), [#941](https://github.com/PHPCompatibility/PHPCompatibility/pull/941), [#943](https://github.com/PHPCompatibility/PHPCompatibility/pull/943), [#944](https://github.com/PHPCompatibility/PHPCompatibility/pull/944), [#951](https://github.com/PHPCompatibility/PHPCompatibility/pull/951), [#950](https://github.com/PHPCompatibility/PHPCompatibility/pull/950). Fixes [#734](https://github.com/PHPCompatibility/PHPCompatibility/issues/734). +- :green_heart: Travis: various tweaks. The builds against PHP 7.4 are no longer allowed to fail. [#935](https://github.com/PHPCompatibility/PHPCompatibility/pull/935), [#938](https://github.com/PHPCompatibility/PHPCompatibility/pull/938) + For running the sniffs on PHP 7.4, it is recommended to use PHP_CodeSniffer 3.5.0+ as PHP_CodeSniffer itself is + not compatible with PHP 7.4 until version 3.5.0. + +### Fixed +- :bug: `PHPCompatibility.Classes.NewClasses`: two new PHP 7.4 classes were being checked as if they were Exceptions. [#945](https://github.com/PHPCompatibility/PHPCompatibility/pull/945) + +### Credits +Thanks go out to [William Entriken] for their contribution to this version. :clap: + + +## [9.3.4] - 2019-11-15 + +See all related issues and PRs in the [9.3.4 milestone]. + +### Fixed +- :bug: `PHPCompatibility.Keywords.ForbiddenNames`: false positive for list when used in a `foreach()` condition. [#930](https://github.com/PHPCompatibility/PHPCompatibility/pull/930). Fixes [#928](https://github.com/PHPCompatibility/PHPCompatibility/issues/928), [#929](https://github.com/PHPCompatibility/PHPCompatibility/pull/929) + +### Credits +Thanks go out to [Sergii Bondarenko] for their contribution to this version. :clap: + + +## [9.3.3] - 2019-11-11 + +See all related issues and PRs in the [9.3.3 milestone]. + +### Added +- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of yet more (undocumented) PHP 7.2 Sodium constants. [#924](https://github.com/PHPCompatibility/PHPCompatibility/pull/924) +- :star: `PHPCompatibility.Keywords.ForbiddenNames` sniff: detect the use of more reserved keywords which are not allowed to be used to name certain constructs. [#923](https://github.com/PHPCompatibility/PHPCompatibility/pull/923). Fixes [#922](https://github.com/PHPCompatibility/PHPCompatibility/issues/922) + +### Fixed +- :bug: `PHPCompatibility.FunctionNameRestrictions.RemovedPHP4StyleConstructors`: false positive detecting PHP4-style constructors when declared in interfaces. The class implementing the interface will not have the same name as the interface, so the actual method would not be regarded as a PHP4 style constructor. [#921](https://github.com/PHPCompatibility/PHPCompatibility/pull/921) + +### Credits +Thanks go out to [Nikhil] for their contribution to this version. :clap: + + +## [9.3.2] - 2019-10-16 + +See all related issues and PRs in the [9.3.2 milestone]. + +### Added +- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of the PHP 7.2 `SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13` constant. [#915](https://github.com/PHPCompatibility/PHPCompatibility/pull/915) +- :books: Readme: a list of projects which are build upon or extend PHPCompatibility. [#904](https://github.com/PHPCompatibility/PHPCompatibility/pull/904) + +### Changed +- :pushpin: `PHPCompatibility.FunctionNameRestrictions.RemovedPHP4StyleConstructors`: minor efficiency fix to make the sniff faster. [#912](https://github.com/PHPCompatibility/PHPCompatibility/pull/912) +- :pushpin: `PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames`: functions marked as `@deprecated` in the function docblock will now be ignored by this sniff. [#917](https://github.com/PHPCompatibility/PHPCompatibility/pull/917). Fixes [#911](https://github.com/PHPCompatibility/PHPCompatibility/issues/911) +- :pencil: `PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters`: the `$ooScopeTokens` property is now `protected`, it should never have been `public` in the first place. [#907](https://github.com/PHPCompatibility/PHPCompatibility/pull/907) +- :recycle: More code documentation fixes. [#903](https://github.com/PHPCompatibility/PHPCompatibility/pull/903), [#916](https://github.com/PHPCompatibility/PHPCompatibility/pull/916) +- :books: Readme/Contributing: various tweaks. [#904](https://github.com/PHPCompatibility/PHPCompatibility/pull/904), [#905](https://github.com/PHPCompatibility/PHPCompatibility/pull/905) + +### Fixed +- :bug: `PHPCompatibility.FunctionUse.OptionalToRequiredFunctionParameters`: false positive when a class is instantiated which has the same name as one of the affected functions. [#914](https://github.com/PHPCompatibility/PHPCompatibility/pull/914). Fixes [#913](https://github.com/PHPCompatibility/PHPCompatibility/issues/913) +- :bug: `PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters`: false positive when a class is instantiated which has the same name as one of the affected functions. [#914](https://github.com/PHPCompatibility/PHPCompatibility/pull/914) +- :bug: `PHPCompatibility.MethodUse.NewDirectCallsToClone`: false positive on calling `__clone()` from within the class being cloned [#910](https://github.com/PHPCompatibility/PHPCompatibility/pull/910). Fixes [#629 (comment)](https://github.com/PHPCompatibility/PHPCompatibility/issues/629#issuecomment-532607809) +- :bug: `PHPCompatibility.Miscellaneous.ValidIntegers`: binary numbers using an uppercase `B` were not always recognized correctly. [#909](https://github.com/PHPCompatibility/PHPCompatibility/pull/909) + + +## [9.3.1] - 2019-09-06 + +See all related issues and PRs in the [9.3.1 milestone]. + +### Changed +- :recycle: A whole slew of code documentation fixes. [#892](https://github.com/PHPCompatibility/PHPCompatibility/pull/892), [#895](https://github.com/PHPCompatibility/PHPCompatibility/pull/895), [#896](https://github.com/PHPCompatibility/PHPCompatibility/pull/896), [#897](https://github.com/PHPCompatibility/PHPCompatibility/pull/897), [#898](https://github.com/PHPCompatibility/PHPCompatibility/pull/898), [#899](https://github.com/PHPCompatibility/PHPCompatibility/pull/899), [#900](https://github.com/PHPCompatibility/PHPCompatibility/pull/900) +- :wrench: Travis: minor tweaks to the build script. [#893](https://github.com/PHPCompatibility/PHPCompatibility/pull/893) + +### Fixed +- :bug: `PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder`: false positive when an array item in the second parameter contained a ternary. [#891](https://github.com/PHPCompatibility/PHPCompatibility/pull/891). Fixes [#890](https://github.com/PHPCompatibility/PHPCompatibility/issues/890) +- :bug: `PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder`: will now take array casts into account when determining which parameter is `$pieces`. [#891](https://github.com/PHPCompatibility/PHPCompatibility/pull/891). +- :bug: `PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder`: hardening of the logic to not examine the second parameter when the first is just and only a text string (`$glue`). [#891](https://github.com/PHPCompatibility/PHPCompatibility/pull/891). + + +## [9.3.0] - 2019-08-29 + +See all related issues and PRs in the [9.3.0 milestone]. + +To keep informed of the progress of covering "_everything PHP 7.4_" in PHPCompatibility, please subscribe to issue [#808](https://github.com/PHPCompatibility/PHPCompatibility/issues/808). + +### Changes expected in PHPCompatibility 10.0.0 +The next version of PHPCompatibility is expected to include a new external dependency. + +In this same release, support for PHP < 5.4 and PHP_CodeSniffer < 2.6.0 will be dropped. + +The `10.0.0` release is expected around the same time as the release of PHP 7.4 - end of November/beginning of December 2019. + +### Added +- :star2: New `PHPCompatibility.Miscellaneous.NewPHPOpenTagEOF` sniff to detect a stand-alone PHP open tag at the end of a file, without trailing newline, as will be supported as of PHP 7.4. [#843](https://github.com/PHPCompatibility/PHPCompatibility/pull/846) +- :star2: New `PHPCompatibility.ParameterValues.ForbiddenStripTagsSelfClosingXHTML` sniff to detect calls to `strip_tags()` passing self-closing XHTML tags in the `$allowable_tags` parameter. This has not been supported since PHP 5.3.4. [#866](https://github.com/PHPCompatibility/PHPCompatibility/pull/866) +- :star2: New `PHPCompatibility.ParameterValues.NewHTMLEntitiesEncodingDefault` sniff to detect calls to `html_entity_decode()`, `htmlentities()` and `htmlspecialchars()` which are impacted by the change to the default value of the `$encoding` parameter in PHP 5.4. [#862](https://github.com/PHPCompatibility/PHPCompatibility/pull/862) +- :star2: New `PHPCompatibility.ParameterValues.NewIconvMbstringCharsetDefault` sniff to detect code impacted by the change in the `default_charset` value in PHP 5.6. [#864](https://github.com/PHPCompatibility/PHPCompatibility/pull/864) Fixes [#839](https://github.com/PHPCompatibility/PHPCompatibility/issues/839) +- :star2: New `PHPCompatibility.ParameterValues.NewIDNVariantDefault` sniff to detect calls to `idn_to_ascii()` and `idn_to_utf8()` impacted by the PHP 7.4 change in the default value for the `$variant` parameter. [#861](https://github.com/PHPCompatibility/PHPCompatibility/pull/861) +- :star2: New `PHPCompatibility.ParameterValues.NewPasswordAlgoConstantValues` sniff to detect calls to `password_hash()` and `password_needs_rehash()` impacted by the changed value of the `PASSWORD_DEFAULT`, `PASSWORD_BCRYPT`, `PASSWORD_ARGON2I` and `PASSWORD_ARGON2ID` constants in PHP 7.4. [#865](https://github.com/PHPCompatibility/PHPCompatibility/pull/865) +- :star2: New `PHPCompatibility.ParameterValues.NewProcOpenCmdArray` sniff to detect calls to `proc_open()` passing an array for the `$cmd` parameter as supported as of PHP 7.4. [#869](https://github.com/PHPCompatibility/PHPCompatibility/pull/869) +- :star2: New `PHPCompatibility.ParameterValues.NewStripTagsAllowableTagsArray` sniff to detect calls to `strip_tags()` passing an array for the `$allowable_tags` parameter as will be supported as of PHP 7.4. [#867](https://github.com/PHPCompatibility/PHPCompatibility/pull/867) +- :star2: New `PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder` sniff to detect `implode()` being called with `$glue` and `$pieces` in reverse order from the documented argument order. This was previously allowed for historical reasons, but will be deprecated in PHP 7.4. [#846](https://github.com/PHPCompatibility/PHPCompatibility/pull/846) +- :star2: New `PHPCompatibility.ParameterValues.RemovedMbStrrposEncodingThirdParam` sniff to detect the `$encoding` being passed as the third, instead of the fourth parameter, to `mb_strrpos()` as has been soft deprecated since PHP 5.2 and will be hard deprecated as of PHP 7.4. [#860](https://github.com/PHPCompatibility/PHPCompatibility/pull/860) +- :star2: New `PHPCompatibility.Syntax.RemovedCurlyBraceArrayAccess` sniff to detect array and string offset access using curly braces as will be deprecated as of PHP 7.4. [#855](https://github.com/PHPCompatibility/PHPCompatibility/pull/855) + - In contrast to any other sniff in the PHPCompatibility standard, this sniff contains an auto-fixer. +- :star2: New `PHPCompatibility.TextStrings.NewUnicodeEscapeSequence` sniff to detect use of the PHP 7.0+ unicode codepoint escape sequences and issues with invalid sequences. [#856](https://github.com/PHPCompatibility/PHPCompatibility/pull/856) +- :star2: New `PHPCompatibility.Upgrade.LowPHP` sniff to give users of old PHP versions advance warning when support will be dropped in the near future. [#838](https://github.com/PHPCompatibility/PHPCompatibility/pull/838) + At this moment, the intention is to drop support for PHP 5.3 by the end of this year. +- :star: `PHPCompatibility.Classes.NewClasses` sniff: recognize the new `WeakReference` class as introduced in PHP 7.4. [#857](https://github.com/PHPCompatibility/PHPCompatibility/pull/857) +- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of new Curl constants as introduced in PHP 7.3.5. [#878](https://github.com/PHPCompatibility/PHPCompatibility/pull/878) +- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of the revived `T_BAD_CHARACTER` constant as re-introduced in PHP 7.4. [#882](https://github.com/PHPCompatibility/PHPCompatibility/pull/882) +- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of the new `IMG_FILTER_SCATTER` and `PASSWORD_ARGON2_PROVIDER` constants as introduced in PHP 7.4. [#887](https://github.com/PHPCompatibility/PHPCompatibility/pull/887) +- :star: `PHPCompatibility.Constants.RemovedConstants` sniff: detection of use of the `CURLPIPE_HTTP1` constant which will be deprecated in PHP 7.4. [#879](https://github.com/PHPCompatibility/PHPCompatibility/pull/879) +- :star: `PHPCompatibility.Constants.RemovedConstants` sniff: detection of use of the `FILTER_SANITIZE_MAGIC_QUOTES` constant which will be deprecated in PHP 7.4. [#845](https://github.com/PHPCompatibility/PHPCompatibility/pull/845) +- :star: `PHPCompatibility.Constants.RemovedConstants` sniff: detection of use of the `T_CHARACTER` and `T_BAD_CHARACTER` constants which were removed in PHP 7.0. [#882](https://github.com/PHPCompatibility/PHPCompatibility/pull/882) +- :star: `PHPCompatibility.FunctionDeclarations.NewMagicMethods` sniff: recognize the new `__serialize()` and `__unserialize()` magic methods as introduced in PHP 7.4. [#868](https://github.com/PHPCompatibility/PHPCompatibility/pull/868) +- :star: `PHPCompatibility.FunctionDeclarations.NewMagicMethods` sniff: recognize the PHP 5.0 `__construct()` and `__destruct()` magic methods. [#884](https://github.com/PHPCompatibility/PHPCompatibility/pull/884) +- :star: `PHPCompatibility.FunctionDeclarations.NonStaticMagicMethods` sniff: recognize the new `__serialize()` and `__unserialize()` magic methods as introduced in PHP 7.4. [#868](https://github.com/PHPCompatibility/PHPCompatibility/pull/868) +- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: recognize the new PHP 7.4 function `imagecreatefromtga()`. [#873](https://github.com/PHPCompatibility/PHPCompatibility/pull/873) +- :star: `PHPCompatibility.FunctionUse.RemovedFunctionParameters` sniff: recognize the deprecation of the `$age` parameter of the `curl_version()` function. [#874](https://github.com/PHPCompatibility/PHPCompatibility/pull/874) +- :star: `PHPCompatibility.FunctionUse.RemovedFunctions` sniff: recognize the PHP 7.4 deprecated `convert_cyr_string()()`, `ezmlm_hash()`, `get_magic_quotes_gpc()`, `get_magic_quotes_runtime()`, `hebrevc()`, `is_real()`, `money_format()` and `restore_include_path()` functions. [#847](https://github.com/PHPCompatibility/PHPCompatibility/pull/847) +- :star: `PHPCompatibility.IniDirectives.NewIniDirectives` sniff: detect use of the new PHP 7.4 `zend.exception_ignore_args` ini directive. [#871](https://github.com/PHPCompatibility/PHPCompatibility/pull/871) +- :star: `PHPCompatibility.IniDirectives.RemovedIniDirectives` sniff: detect use of the `allow_url_include` ini directive which is deprecated as of PHP 7.4. [#870](https://github.com/PHPCompatibility/PHPCompatibility/pull/870) +- :star: `PHPCompatibility.IniDirectives.RemovedIniDirectives` sniff: detection of use of the `opcache.load_comments` directive which was removed in PHP 7.0. [#883](https://github.com/PHPCompatibility/PHPCompatibility/pull/883) +- :star: `PHPCompatibility.ParameterValues.NewHashAlgorithms`: recognize use of the new PHP 7.4 `crc32c` hash algorithm. [#872](https://github.com/PHPCompatibility/PHPCompatibility/pull/872) +- :star: `PHPCompatibility.TypeCasts.RemovedTypeCasts` sniff: detect usage of the `(real)` type cast which will be deprecated in PHP 7.4. [#844](https://github.com/PHPCompatibility/PHPCompatibility/pull/844) +- :star: Recognize the `recode` extension functionality which will be removed in PHP 7.4 (moved to PECL) in the `RemovedExtensions` and `RemovedFunctions` sniffs. [#841](https://github.com/PHPCompatibility/PHPCompatibility/pull/841) +- :star: Recognize the `OPcache` extension functionality which was be introduced in PHP 5.5, but not yet fully accounted for in the `NewFunctions` and `NewIniDirectives` sniffs. [#883](https://github.com/PHPCompatibility/PHPCompatibility/pull/883) +- :star: New `getCompleteTextString()` utility method to the `PHPCompatibility\Sniff` class. [#856](https://github.com/PHPCompatibility/PHPCompatibility/pull/856) +- :umbrella: Unit test for the `PHPCompatibility.Upgrade.LowPHPCS` sniff. +- :umbrella: Some extra unit tests for the `PHPCompatibility.ParameterValues.NewNegativeStringOffset`, `PHPCompatibility.ParameterValues.RemovedMbStringModifiers` and sniffs. [#876](https://github.com/PHPCompatibility/PHPCompatibility/pull/876), [#877](https://github.com/PHPCompatibility/PHPCompatibility/pull/877) +- :books: `CONTRIBUTING.md`: Added a list of typical sources for information about changes to PHP. [#875](https://github.com/PHPCompatibility/PHPCompatibility/pull/875) + +### Changed +- :pushpin: `PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString` sniff: the sniff will now also examine the function docblock, if available, and will throw an error when a `@throws` tag is found in the docblock. [#880](https://github.com/PHPCompatibility/PHPCompatibility/pull/880). Fixes [#863](https://github.com/PHPCompatibility/PHPCompatibility/issues/863) +- :pushpin: `PHPCompatibility.FunctionDeclarations.NonStaticMagicMethods` sniff: will now also check the visibility and `static` (or not) requirements of the magic `__construct()`, `__destruct()`, `__clone()`, `__debugInfo()`, `__invoke()` and `__set_state()` methods. [#885](https://github.com/PHPCompatibility/PHPCompatibility/pull/885) +- :pushpin: `PHPCompatibility.Syntax.NewArrayStringDereferencing` sniff: the sniff will now also recognize array string dereferencing using curly braces as was (silently) supported since PHP 7.0. [#851](https://github.com/PHPCompatibility/PHPCompatibility/pull/851) + - The sniff will now also throw errors for each dereference found on the array/string, not just the first one. +- :pushpin: `PHPCompatibility.Syntax.NewClassMemberAccess` sniff: the sniff will now also recognize class member access on instantiation and cloning using curly braces as was (silently) supported since PHP 7.0. [#852](https://github.com/PHPCompatibility/PHPCompatibility/pull/852) + - The sniff will now also throw errors for each access detected, not just the first one. + - The line number on which the error is thrown in now set more precisely. +- :pushpin: `PHPCompatibility.Syntax.NewFunctionArrayDereferencing` sniff: the sniff will now also recognize function array dereferencing using curly braces as was (silently) supported since PHP 7.0. [#853](https://github.com/PHPCompatibility/PHPCompatibility/pull/853) + - The sniff will now also throw errors for each access detected, not just the first one. + - The line number on which the error is thrown in now set more precisely. +- :recycle: Various code clean-up and improvements. [#849](https://github.com/PHPCompatibility/PHPCompatibility/pull/849), [#850](https://github.com/PHPCompatibility/PHPCompatibility/pull/850) +- :recycle: Various minor inline documentation fixes. [#854](https://github.com/PHPCompatibility/PHPCompatibility/pull/854), [#886](https://github.com/PHPCompatibility/PHPCompatibility/pull/886) +- :wrench: Travis: various tweaks to the build script. [#834](https://github.com/PHPCompatibility/PHPCompatibility/pull/834), [#842](https://github.com/PHPCompatibility/PHPCompatibility/pull/842) + +### Fixed +- :bug: `PHPCompatibility.FunctionDeclarations.ForbiddenParametersWithSameName` sniff: variable names are case-sensitive, so recognition of same named parameters should be done in a case-sensitive manner. [#848](https://github.com/PHPCompatibility/PHPCompatibility/pull/848) +- :bug: `PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString` sniff: Exceptions thrown within a `try` should not trigger the sniff. [#880](https://github.com/PHPCompatibility/PHPCompatibility/pull/880). Fixes [#863](https://github.com/PHPCompatibility/PHPCompatibility/issues/863) +- :bug: `PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString` sniff: the `$ooScopeTokens` property should never have been a public property. [#880](https://github.com/PHPCompatibility/PHPCompatibility/pull/880). +- :umbrella: Some of the unit tests for the `PHPCompatibility.Operators.RemovedTernaryAssociativity` sniff were not being run. [#836](https://github.com/PHPCompatibility/PHPCompatibility/pull/836) + + +## [9.2.0] - 2019-06-28 + +See all related issues and PRs in the [9.2.0 milestone]. + +To keep informed of the progress of covering "_everything PHP 7.4_" in PHPCompatibility, please subscribe to issue [#808](https://github.com/PHPCompatibility/PHPCompatibility/issues/808). + +### Added +- :star2: New `PHPCompatibility.Classes.ForbiddenAbstractPrivateMethods` sniff to detect methods declared as both `private` as well as `abstract`. This was allowed between PHP 5.0.0 and 5.0.4, but disallowed in PHP 5.1 as the behaviour of `private` and `abstract` are mutually exclusive. [#822](https://github.com/PHPCompatibility/PHPCompatibility/pull/822) +- :star2: New `PHPCompatibility.Classes.NewTypedProperties` sniff to detect PHP 7.4 typed property declarations. [#801](https://github.com/PHPCompatibility/PHPCompatibility/pull/801), [#829](https://github.com/PHPCompatibility/PHPCompatibility/pull/829) +- :star2: New `PHPCompatibility.Classes.RemovedOrphanedParent` sniff to detect the use of the `parent` keyword in classes without a parent (non-extended classes). This code pattern is deprecated in PHP 7.4 and will become a compile-error in PHP 8.0. [#818](https://github.com/PHPCompatibility/PHPCompatibility/pull/818) +- :star2: New `PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString` sniff to detect throwing exceptions from `__toString()` methods. This would previously result in a fatal error, but will be allowed as of PHP 7.4. [#814](https://github.com/PHPCompatibility/PHPCompatibility/pull/814) +- :star2: New `PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters` sniff to detect `__toString()` function declarations expecting parameters. This was disallowed in PHP 5.3. [#815](https://github.com/PHPCompatibility/PHPCompatibility/pull/815) +- :star2: New `PHPCompatibility.MethodUse.ForbiddenToStringParameters` sniff to detect direct calls to `__toString()` magic methods passing parameters. This was disallowed in PHP 5.3. [#830](https://github.com/PHPCompatibility/PHPCompatibility/pull/830) +- :star2: New `PHPCompatibility.Operators.ChangedConcatOperatorPrecedence` sniff to detect code affected by the upcoming change in operator precedence for the concatenation operator. The concatenation operator precedence will be lowered in PHP 8.0, with deprecation notices for code affected being thrown in PHP 7.4. [#805](https://github.com/PHPCompatibility/PHPCompatibility/pull/805) +- :star2: New `PHPCompatibility.Operators.RemovedTernaryAssociativity` sniff to detect code relying on left-associativity of the ternary operator. This behaviour will be deprecated in PHP 7.4 and removed in PHP 8.0. [#810](https://github.com/PHPCompatibility/PHPCompatibility/pull/810) +- :star2: New `PHPCompatibility.Syntax.NewArrayUnpacking` sniff to detect the use of the spread operator to unpack arrays when declaring a new array, as introduced in PHP 7.4. [#804](https://github.com/PHPCompatibility/PHPCompatibility/pull/804) +- :star: `PHPCompatibility.Classes.NewClasses` sniff: recognize the new `ReflectionReference` class as introduced in PHP 7.4. [#820](https://github.com/PHPCompatibility/PHPCompatibility/pull/820) +- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of the new PHP 7.4 Core (Standard), MBString, Socket and Tidy constants. [#821](https://github.com/PHPCompatibility/PHPCompatibility/pull/821) +- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: detect usage of the new PHP 7.4 `get_mangled_object_vars()`, `mb_str_split()`, `openssl_x509_verify()`, `password_algos()`, `pcntl_unshare()`, `sapi_windows_set_ctrl_handler()` and `sapi_windows_generate_ctrl_event()` functions. [#811](https://github.com/PHPCompatibility/PHPCompatibility/pull/811), [#819](https://github.com/PHPCompatibility/PHPCompatibility/pull/819), [#827](https://github.com/PHPCompatibility/PHPCompatibility/pull/827) +- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: recognize the new OCI functions as introduced in PHP 7.2.14 and PHP 7.3.1. [#786](https://github.com/PHPCompatibility/PHPCompatibility/pull/786) +- :star: `PHPCompatibility.FunctionUse.RemovedFunctions` sniff: recognize the PHP 7.4 deprecated `ldap_control_paged_result_response()` and `ldap_control_paged_result()` functions. [#831](https://github.com/PHPCompatibility/PHPCompatibility/pull/831) +- :star: `PHPCompatibility.FunctionUse.RemovedFunctions` sniff: recognize the `Payflow Pro/pfpro` functions as removed in PHP 5.1. [#823](https://github.com/PHPCompatibility/PHPCompatibility/pull/823) +- :star: `PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters` sniff: account for the parameters for `array_merge()` and `array_merge_recursive()` becoming optional in PHP 7.4. [#817](https://github.com/PHPCompatibility/PHPCompatibility/pull/817) +- :star: `PHPCompatibility.IniDirectives.RemovedIniDirectives` sniff: recognize the `Payflow Pro/pfpro` ini directives as removed in PHP 5.1. [#823](https://github.com/PHPCompatibility/PHPCompatibility/pull/823) +- :star: Recognize the `interbase/Firebird` extension functionality which will be removed in PHP 7.4 (moved to PECL) in the `RemovedConstants`, `RemovedExtensions`, `RemovedFunctions` and `RemovedIniDirectives` sniffs. [#807](https://github.com/PHPCompatibility/PHPCompatibility/pull/807) +- :star: Recognize the `wddx` extension functionality which will be removed in PHP 7.4 (moved to PECL) in the `RemovedExtensions` and `RemovedFunctions` sniffs. [#826](https://github.com/PHPCompatibility/PHPCompatibility/pull/826) +- :star: New `isShortTernary()` and `isUnaryPlusMinus()` utility methods to the `PHPCompatibility\Sniff` class. [#810](https://github.com/PHPCompatibility/PHPCompatibility/pull/810), [#805](https://github.com/PHPCompatibility/PHPCompatibility/pull/805) + +### Changed +- :pencil2: The `PHPCompatibility.Extensions.RemovedExtensions` sniff will now only report on the removed `Payflow Pro` extension when a function uses `pfpro_` as a prefix. Previously, it used the `pfpro` prefix (without underscore) for detection. [#812](https://github.com/PHPCompatibility/PHPCompatibility/pull/812) +- :pencil2: The error message thrown when the `T_ELLIPSIS` token, i.e. the spread operator, is detected. [#803](https://github.com/PHPCompatibility/PHPCompatibility/pull/803) + PHP 7.4 adds a third use-case for the spread operator. The adjusted error message accounts for this. +- :umbrella: `PHPCompatibility.FunctionDeclarations.NewParamTypeDeclarations` is now also tested with parameters using the splat operator. [#802](https://github.com/PHPCompatibility/PHPCompatibility/pull/802) +- :books: The documentation now uses the GitHub repo of `PHP_CodeSniffer` as the canonical entry point for `PHP_CodeSniffer`. Previously, it would point to the PEAR package. [#788](https://github.com/PHPCompatibility/PHPCompatibility/pull/788) +- :books: The links in the changelog now all point to the `PHPCompatibility/PHPCompatibility` repo and no longer to the (deprecated) `wimg/PHPCompatibility` repo. [#828](https://github.com/PHPCompatibility/PHPCompatibility/pull/828) +- :recycle: Various minor inline documentation improvements. [#825](https://github.com/PHPCompatibility/PHPCompatibility/pull/825) +- :wrench: Various performance optimizations and code simplifications. [#783](https://github.com/PHPCompatibility/PHPCompatibility/pull/783), [#784](https://github.com/PHPCompatibility/PHPCompatibility/pull/784), [#795](https://github.com/PHPCompatibility/PHPCompatibility/pull/795), [#813](https://github.com/PHPCompatibility/PHPCompatibility/pull/813) +- :green_heart: Travis: build tests are now being run against PHP 7.4 (unstable) as well. [#790](https://github.com/PHPCompatibility/PHPCompatibility/pull/790) + Note: the builds are currently not (yet) tested against PHP 8.0 (unstable) as there is no compatible PHPUnit version available (yet). +- :wrench: Travis: The build script has been refactored to use [stages](https://docs.travis-ci.com/user/build-stages/) to get the most relevant results faster. Additionally some more tweaks have been made to improve and/or simplify the build script. [#798](https://github.com/PHPCompatibility/PHPCompatibility/pull/798) +- :wrench: Build/PHPCS: warnings are no longer allowed for the PHPCompatibility native code. [#800](https://github.com/PHPCompatibility/PHPCompatibility/pull/800) +- :wrench: Build/PHPCS: added variable assignment alignment check and file include check to the PHPCompatibility native CS configuration. [#824](https://github.com/PHPCompatibility/PHPCompatibility/pull/824) +- :wrench: The minimum version for the recommended `DealerDirect/phpcodesniffer-composer-installer` Composer plugin has been upped to `0.5.0`. [#791](https://github.com/PHPCompatibility/PHPCompatibility/pull/791) + +### Fixed +- :bug: The `PHPCompatibility.Extensions.RemovedExtensions` sniff contained a typo in the alternative recommended for the removed `mcve` extension. [#806](https://github.com/PHPCompatibility/PHPCompatibility/pull/806) +- :bug: The `PHPCompatibility.Extensions.RemovedExtensions` sniff listed the wrong removal version number for the `Payflow Pro/pfpro` extension (PHP 5.3 instead of the correct 5.1). [#823](https://github.com/PHPCompatibility/PHPCompatibility/pull/823) + +### Credits +Thanks go out to [Yılmaz] and [Tim Millwood] for their contribution to this version. :clap: + + +## [9.1.1] - 2018-12-31 + +See all related issues and PRs in the [9.1.1 milestone]. + +### Fixed +- :bug: `ForbiddenThisUseContexts`: false positive for unsetting `$this['key']` on objects implementing `ArrayAccess`. [#781](https://github.com/PHPCompatibility/PHPCompatibility/pull/781). Fixes [#780](https://github.com/PHPCompatibility/PHPCompatibility/issues/780) + +## [9.1.0] - 2018-12-16 + +See all related issues and PRs in the [9.1.0 milestone]. + +### Added +- :star2: New `PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue` sniff to detect code which could be affected by the PHP 7.0 change in the values reported by `func_get_arg()`, `func_get_args()`, `debug_backtrace()` and exception backtraces. [#750](https://github.com/PHPCompatibility/PHPCompatibility/pull/750). Fixes [#585](https://github.com/PHPCompatibility/PHPCompatibility/pull/585). +- :star2: New `PHPCompatibility.MethodUse.NewDirectCallsToClone` sniff to detect direct call to a `__clone()` magic method which wasn't allowed prior to PHP 7.0. [#743](https://github.com/PHPCompatibility/PHPCompatibility/pull/743). Fixes [#629](https://github.com/PHPCompatibility/PHPCompatibility/issues/629). +- :star2: New `PHPCompatibility.Variables.ForbiddenThisUseContext` sniff to detect most of the inconsistencies surrounding the use of the `$this` variable, which were removed in PHP 7.1. [#762](https://github.com/PHPCompatibility/PHPCompatibility/pull/762), [#771](https://github.com/PHPCompatibility/PHPCompatibility/pull/771). Fixes [#262](https://github.com/PHPCompatibility/PHPCompatibility/issues/262) and [#740](https://github.com/PHPCompatibility/PHPCompatibility/issues/740). +- :star: `NewClasses`: detection of more native PHP Exceptions. [#743](https://github.com/PHPCompatibility/PHPCompatibility/pull/743), [#753](https://github.com/PHPCompatibility/PHPCompatibility/pull/753) +- :star: `NewConstants` : detection of the new PHP 7.3 Curl, Stream Crypto and LDAP constants and some more PHP 7.0 Tokenizer constants. [#752](https://github.com/PHPCompatibility/PHPCompatibility/pull/752), [#767](https://github.com/PHPCompatibility/PHPCompatibility/pull/767), [#778](https://github.com/PHPCompatibility/PHPCompatibility/pull/778) +- :star: `NewFunctions` sniff: recognize (more) new LDAP functions as introduced in PHP 7.3. [#768](https://github.com/PHPCompatibility/PHPCompatibility/pull/768) +- :star: `NewFunctionParameters` sniff: recognize the new `$serverctrls` parameter which was added to a number of LDAP functions in PHP 7.3. [#769](https://github.com/PHPCompatibility/PHPCompatibility/pull/769) +- :star: `NewIniDirectives` sniff: recognize the new `imap.enable_insecure_rsh` ini directive as introduced in PHP 7.1.25, 7.2.13 and 7.3.0. [#770](https://github.com/PHPCompatibility/PHPCompatibility/pull/770) +- :star: `NewInterfaces` sniff: recognize two more Session related interfaces which were introduced in PHP 5.5.1 and 7.0 respectively. [#748](https://github.com/PHPCompatibility/PHPCompatibility/pull/748) +- :star: Duplicate of upstream `findStartOfStatement()` method to the `PHPCompatibility\PHPCSHelper` class to allow for PHPCS cross-version usage of that method. [#750](https://github.com/PHPCompatibility/PHPCompatibility/pull/750) + +### Changed +- :pushpin: `RemovedPHP4StyleConstructors`: will now also detect PHP4-style constructors when declared in interfaces. [#751](https://github.com/PHPCompatibility/PHPCompatibility/pull/751) +- :pushpin: `Sniff::validDirectScope()`: the return value of this method has changed. Previously it would always be a boolean. It will stil return `false` when no valid direct scope has been found, but it will now return the `stackPtr` to the scope token if a _valid_ direct scope was encountered. [#758](https://github.com/PHPCompatibility/PHPCompatibility/pull/758) +- :rewind: `NewOperators` : updated the version number for `T_COALESCE_EQUAL`. [#746](https://github.com/PHPCompatibility/PHPCompatibility/pull/746) +- :pencil: Minor improvement to an error message in the unit test suite. [#742](https://github.com/PHPCompatibility/PHPCompatibility/pull/742) +- :recycle: Various code clean-up and improvements. [#745](https://github.com/PHPCompatibility/PHPCompatibility/pull/745), [#756](https://github.com/PHPCompatibility/PHPCompatibility/pull/756), [#774](https://github.com/PHPCompatibility/PHPCompatibility/pull/774) +- :recycle: Various minor inline documentation fixes. [#749](https://github.com/PHPCompatibility/PHPCompatibility/pull/749), [#757](https://github.com/PHPCompatibility/PHPCompatibility/pull/757) +- :umbrella: Improved code coverage recording. [#744](https://github.com/PHPCompatibility/PHPCompatibility/pull/744), [#776](https://github.com/PHPCompatibility/PHPCompatibility/pull/776) +- :green_heart: Travis: build tests are now being run against PHP 7.3 as well. [#511](https://github.com/PHPCompatibility/PHPCompatibility/pull/511) + Note: full PHP 7.3 support is only available in combination with PHP_CodeSniffer 2.9.2 or 3.3.1+ due to an incompatibility within PHP_CodeSniffer itself. + +### Fixed +- :white_check_mark: Compatibility with the upcoming release of PHPCS 3.4.0. Deal with changed behaviour of the PHPCS `Tokenizer` regarding binary type casts. [#760](https://github.com/PHPCompatibility/PHPCompatibility/pull/760) +- :bug: `InternalInterfaces`: false negative for implemented/extended interfaces prefixed with a namespace separator. [#775](https://github.com/PHPCompatibility/PHPCompatibility/pull/775) +- :bug: `NewClasses`: the introduction version of various native PHP Exceptions has been corrected. [#743](https://github.com/PHPCompatibility/PHPCompatibility/pull/743), [#753](https://github.com/PHPCompatibility/PHPCompatibility/pull/753) +- :bug: `NewInterfaces`: false negative for implemented/extended interfaces prefixed with a namespace separator. [#775](https://github.com/PHPCompatibility/PHPCompatibility/pull/775) +- :bug: `RemovedPHP4StyleConstructors`: the sniff would examine methods in nested anonymous classes as if they were methods of the higher level class. [#751](https://github.com/PHPCompatibility/PHPCompatibility/pull/751) +- :rewind: `RemovedPHP4StyleConstructors`: the sniff will no longer throw false positives for the first method in an anonymous class when used in combination with PHPCS 2.3.x. [#751](https://github.com/PHPCompatibility/PHPCompatibility/pull/751) +- :rewind: `ReservedFunctionNames`: fixed incorrect error message text for methods in anonymous classes when used in combination with PHPCS 2.3.x. [#755](https://github.com/PHPCompatibility/PHPCompatibility/pull/755) +- :bug: `ReservedFunctionNames`: prevent duplicate errors being thrown for methods in nested anonymous classes. [#755](https://github.com/PHPCompatibility/PHPCompatibility/pull/755) +- :bug: `PHPCSHelper::findEndOfStatement()`: minor bug fix. [#749](https://github.com/PHPCompatibility/PHPCompatibility/pull/749) +- :bug: `Sniff::isClassProperty()`: class properties for classes nested in conditions or function calls were not always recognized as class properties. [#758](https://github.com/PHPCompatibility/PHPCompatibility/pull/758) + +### Credits +Thanks go out to [Jonathan Champ] for his contribution to this version. :clap: + + +## [9.0.0] - 2018-10-07 + +**IMPORTANT**: This release contains **breaking changes**. Please read the below information carefully before upgrading! + +All sniffs have been placed in meaningful categories and a number of sniffs have been renamed to have more consistent, meaningful and future-proof names. + +Both the `PHPCompatibilityJoomla` [[GH](https://github.com/PHPCompatibility/PHPCompatibilityJoomla) | [Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-joomla)] as well as the `PHPCompatibilityWP` [[GH](https://github.com/PHPCompatibility/PHPCompatibilityWP)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp)] rulesets have already been adjusted for this change and have released a new version which is compatible with this version of PHPCompatibility. + +Aside from those CMS-based rulesets, this project now also offers a number of polyfill-library specific rulesets, such as `PHPCompatibilityPasswordCompat` [[GH](https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat) | [Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-passwordcompat)] for @ircmaxell's [`password_compat`](https://github.com/ircmaxell/password_compat) libary, `PHPCompatibilityParagonieRandomCompat` and `PHPCompatibilityParagonieSodiumCompat` [[GH](https://github.com/PHPCompatibility/PHPCompatibilityParagonie)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-paragonie)] for the [Paragonie polyfills](https://github.com/paragonie?utf8=?&q=polyfill) and a number of rulesets related to various [polyfills offered by the Symfony project](https://github.com/symfony?utf8=?&q=polyfill) [[GH](https://github.com/PHPCompatibility/PHPCompatibilitySymfony)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-symfony)]. + +If your project uses one of these polyfills, please consider using these special polyfill rulesets to prevent false positives. + +Also as of this version, [Juliette Reinders Folmer] is now officially a co-maintainer of this package. + +### Upgrade instructions + +* If you have `` directives in your own project's custom ruleset which relate to sniffs from the PHPCompatibility library, you will need to update your ruleset to use the new sniff names. +* If you use the new [PHPCS 3.2+ inline annotations](https://github.com/squizlabs/PHP_CodeSniffer/releases/3.2.0), i.e. `// phpcs:ignore Standard.Category.SniffName`, in combination with PHPCompatibility sniff names, you will need to update these annotations. +* If you use neither of the above, you should be fine and upgrading should be painless. + +### Overview of all the sniff renames: + +Old Category.SniffName | New Category.SniffName +--- | --- +**PHP**.ArgumentFunctionsUsage | **FunctionUse**.ArgumentFunctionsUsage +**PHP**.CaseSensitiveKeywords | **Keywords**.CaseSensitiveKeywords +**PHP**.ConstantArraysUsingConst | **InitialValue**.**New**ConstantArraysUsingConst +**PHP**.ConstantArraysUsingDefine | **InitialValue**.**New**ConstantArraysUsingDefine +**PHP**.**Deprecated**Functions | **FunctionUse**.**Removed**Functions +**PHP**.**Deprecated**IniDirectives | **IniDirectives**.**Removed**IniDirectives +**PHP**.**Deprecated**MagicAutoload | **FunctionNameRestrictions**.**Removed**MagicAutoload +**PHP**.**Deprecated**NewReference | **Syntax**.**Removed**NewReference +**PHP**.**Deprecated**PHP4StyleConstructors | **FunctionNameRestrictions**.**Removed**PHP4StyleConstructors +**PHP**.**Deprecated**TypeCasts | **TypeCasts**.**Removed**TypeCasts +**PHP**.DiscouragedSwitchContinue | **ControlStructures**.DiscouragedSwitchContinue +**PHP**.DynamicAccessToStatic | **Syntax**.**New**DynamicAccessToStatic +**PHP**.EmptyNonVariable | **LanguageConstructs**.**New**EmptyNonVariable +**PHP**.ForbiddenBreakContinueOutsideLoop | **ControlStructures**.ForbiddenBreakContinueOutsideLoop +**PHP**.ForbiddenBreakContinueVariableArguments | **ControlStructures**.ForbiddenBreakContinueVariableArguments +**PHP**.ForbiddenCallTimePassByReference | **Syntax**.ForbiddenCallTimePassByReference +**PHP**.Forbidden**ClosureUseVariableNames** | **FunctionDeclarations**.Forbidden**VariableNamesInClosureUse** +**PHP**.ForbiddenEmptyListAssignment | **Lists**.ForbiddenEmptyListAssignment +**PHP**.Forbidden**Function**ParametersWithSameName | **FunctionDeclarations**.ForbiddenParametersWithSameName +**PHP**.ForbiddenGlobalVariableVariable | **Variables**.ForbiddenGlobalVariableVariable +**PHP**.ForbiddenNames | **Keywords**.ForbiddenNames +**PHP**.ForbiddenNamesAsDeclared | **Keywords**.ForbiddenNamesAsDeclared +**PHP**.ForbiddenNamesAsInvokedFunctions | **Keywords**.ForbiddenNamesAsInvokedFunctions +**PHP**.ForbiddenNegativeBitshift | **Operators**.ForbiddenNegativeBitshift +**PHP**.ForbiddenSwitchWithMultipleDefaultBlocks | **ControlStructures**.ForbiddenSwitchWithMultipleDefaultBlocks +**PHP**.InternalInterfaces | **Interfaces**.InternalInterfaces +**PHP**.LateStaticBinding | **Classes**.**New**LateStaticBinding +**PHP**.**MbstringReplaceE**Modifier | **ParameterValues**.**RemovedMbstring**Modifier**s** +**PHP**.NewAnonymousClasses | **Classes**.NewAnonymousClasses +**PHP**.NewArrayStringDereferencing | **Syntax**.NewArrayStringDereferencing +**PHP**.NewClasses | **Classes**.NewClasses +**PHP**.NewClassMemberAccess | **Syntax**.NewClassMemberAccess +**PHP**.NewClosure | **FunctionDeclarations**.NewClosure +**PHP**.NewConstants | **Constants**.NewConstants +**PHP**.NewConstantScalarExpressions | **InitialValue**.NewConstantScalarExpressions +**PHP**.NewConstVisibility | **Classes**.NewConstVisibility +**PHP**.NewExecutionDirectives | **ControlStructures**.NewExecutionDirectives +**PHP**.NewFunctionArrayDereferencing | **Syntax**.NewFunctionArrayDereferencing +**PHP**.NewFunctionParameters | **FunctionUse**.NewFunctionParameters +**PHP**.NewFunctions | **FunctionUse**.NewFunctions +**PHP**.NewGeneratorReturn | **Generators**.NewGeneratorReturn +**PHP**.NewGroupUseDeclarations | **UseDeclarations**.NewGroupUseDeclarations +**PHP**.NewHashAlgorithms | **ParameterValues**.NewHashAlgorithms +**PHP**.NewHeredoc**Initialize** | **InitialValue**.NewHeredoc +**PHP**.NewIniDirectives | **IniDirectives**.NewIniDirectives +**PHP**.NewInterfaces | **Interfaces**.NewInterfaces +**PHP**.NewKeywords | **Keywords**.NewKeywords +**PHP**.NewLanguageConstructs | **LanguageConstructs**.NewLanguageConstructs +**PHP**.NewMagicClassConstant | **Constants**.NewMagicClassConstant +**PHP**.NewMagicMethods | **FunctionNameRestrictions**.NewMagicMethods +**PHP**.NewMultiCatch | **ControlStructures**.NewMultiCatch +**PHP**.NewNullableTypes | **FunctionDeclarations**.NewNullableTypes +**PHP**.NewReturnTypeDeclarations | **FunctionDeclarations**.NewReturnTypeDeclarations +**PHP**.New**Scalar**TypeDeclarations | **FunctionDeclarations**.New**Param**TypeDeclarations +**PHP**.NewTrailingComma | **Syntax**.New**FunctionCall**TrailingComma +**PHP**.NewTypeCasts | **TypeCasts**.NewTypeCasts +**PHP**.NewUseConstFunction | **UseDeclarations**.NewUseConstFunction +**PHP**.NonStaticMagicMethods | **FunctionDeclarations**.NonStaticMagicMethods +**PHP**.OptionalRequiredFunctionParameters | **FunctionUse**.Optional**To**RequiredFunctionParameters +**PHP**.ParameterShadowSuperGlobals | **FunctionDeclarations**.**Forbidden**ParameterShadowSuperGlobals +**PHP**.**PCRENew**Modifiers | **ParameterValues**.**NewPCRE**Modifiers +**PHP**.**PregReplaceE**Modifier | **ParameterValues**.**RemovedPCRE**Modifier**s** +**PHP**.RemovedAlternativePHPTags | **Miscellaneous**.RemovedAlternativePHPTags +**PHP**.RemovedConstants | **Constants**.RemovedConstants +**PHP**.RemovedExtensions | **Extensions**.RemovedExtensions +**PHP**.RemovedFunctionParameters | **FunctionUse**.RemovedFunctionParameters +**PHP**.RemovedGlobalVariables | **Variables**.Removed**Predefined**GlobalVariables +**PHP**.RemovedHashAlgorithms | **ParameterValues**.RemovedHashAlgorithms +**PHP**.ReservedFunctionNames | **FunctionNameRestrictions**.ReservedFunctionNames +**PHP**.RequiredOptionalFunctionParameters | **FunctionUse**.Required**To**OptionalFunctionParameters +**PHP**.ShortArray | **Syntax**.**New**ShortArray +**PHP**.Ternary**Operators** | **Operators**.**NewShort**Ternary +**PHP**.ValidIntegers | **Miscellaneous**.ValidIntegers +**PHP**.**VariableVariables** | **Variables**.**NewUniformVariableSyntax** + +### Changelog for version 9.0.0 + +See all related issues and PRs in the [9.0.0 milestone]. + +### Added +- :star2: New `PHPCompatibility.ControlStructures.NewForeachExpressionReferencing` sniff to detect referencing of `$value` within a `foreach()` when the iterated array is not a variable. This was not supported prior to PHP 5.5. [#664](https://github.com/PHPCompatibility/PHPCompatibility/pull/664) +- :star2: New `PHPCompatibility.ControlStructures.NewListInForeach` sniff to detect unpacking nested arrays into separate variables via the `list()` construct in a `foreach()` statement. This was not supported prior to PHP 5.5. [#657](https://github.com/PHPCompatibility/PHPCompatibility/pull/657) +- :star2: New `PHPCompatibility.FunctionNameRestrictions.RemovedNamespacedAssert` sniff to detect declaring a function called `assert()` within a namespace. This has been deprecated as of PHP 7.3. [#735](https://github.com/PHPCompatibility/PHPCompatibility/pull/735). Partially fixes [#718](https://github.com/PHPCompatibility/PHPCompatibility/issues/718). +- :star2: New `PHPCompatibility.Lists.AssignmentOrder` sniff to detect `list()` constructs affected by the change in assignment order in PHP 7.0. [#656](https://github.com/PHPCompatibility/PHPCompatibility/pull/656) +- :star2: New `PHPCompatibility.Lists.NewKeyedList` sniff to detect usage of keys in `list()`, support for which was added in PHP 7.1. [#655](https://github.com/PHPCompatibility/PHPCompatibility/pull/655). Fixes [#252](https://github.com/PHPCompatibility/PHPCompatibility/issues/252). +- :star2: New `PHPCompatibility.Lists.NewListReferenceAssignment` sniff to detect reference assignments being used in `list()` constructs, support for which has been added in PHP 7.3. [#731](https://github.com/PHPCompatibility/PHPCompatibility/pull/731) +- :star2: New `PHPCompatibility.Lists.NewShortList` sniff to detect the shorthand array syntax `[]` being used for symmetric array destructuring as introduced in PHP 7.1. [#654](https://github.com/PHPCompatibility/PHPCompatibility/pull/654). Fixes [#248](https://github.com/PHPCompatibility/PHPCompatibility/issues/248). +- :star2: New `PHPCompatibility.Operators.NewOperators` sniff which checks for usage of the pow, pow equals, spaceship and coalesce (equals) operators. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) + These checks were previously contained within the `PHPCompatibility.LanguageConstructs.NewLanguageConstructs` sniff. +- :star2: New `PHPCompatibility.ParameterValues.ForbiddenGetClassNull` sniff to detect `null` being passed to `get_class()`, support for which has been removed in PHP 7.2 [#659](https://github.com/PHPCompatibility/PHPCompatibility/pull/659). Fixes [#557](https://github.com/PHPCompatibility/PHPCompatibility/issues/557). +- :star2: New `PHPCompatibility.ParameterValues.NewArrayReduceInitialType` sniff to detect non-integers being passed as the `$initial` parameter to the `array_reduce()` function, which was not supported before PHP 5.3. [#666](https://github.com/PHPCompatibility/PHPCompatibility/pull/666). Fixes [#649](https://github.com/PHPCompatibility/PHPCompatibility/issues/649) +- :star2: New `PHPCompatibility.ParameterValues.NewFopenModes` sniff to examine the `$mode` parameter passed to `fopen()` for modes not available in older PHP versions. [#658](https://github.com/PHPCompatibility/PHPCompatibility/pull/658) +- :star2: New `PHPCompatibility.ParameterValues.NewNegativeStringOffset` sniff to detect negative string offsets being passed to string manipulation functions which was not supported before PHP 7.1. [#662](https://github.com/PHPCompatibility/PHPCompatibility/pull/662). Partially fixes [#253](https://github.com/PHPCompatibility/PHPCompatibility/issues/253). +- :star2: New `PHPCompatibility.ParameterValues.NewPackFormats` sniff to examine the `$format` parameter passed to `pack()` for formats not available in older PHP versions. [#665](https://github.com/PHPCompatibility/PHPCompatibility/pull/665) +- :star2: New `PHPCompatibility.ParameterValues.RemovedIconvEncoding` sniff to detect the PHP 5.6 deprecated encoding `$type`s being passed to `iconv_set_encoding()`. [#660](https://github.com/PHPCompatibility/PHPCompatibility/pull/660). Fixes [#475](https://github.com/PHPCompatibility/PHPCompatibility/issues/475). +- :star2: New `PHPCompatibility.ParameterValues.RemovedNonCryptoHashes` sniff to detect non-cryptographic hash algorithms being passed to various `hash_*()` functions. This is no longer accepted as of PHP 7.2. [#663](https://github.com/PHPCompatibility/PHPCompatibility/pull/663). Fixes [#559](https://github.com/PHPCompatibility/PHPCompatibility/issues/559) +- :star2: New `PHPCompatibility.ParameterValues.RemovedSetlocaleString` sniff to detect string literals being passed to the `$category` parameter of the `setlocale()` function. This behaviour was deprecated in PHP 4.2 and support has been removed in PHP 7.0. [#661](https://github.com/PHPCompatibility/PHPCompatibility/pull/661) +- :star2: New `PHPCompatibility.Syntax.NewFlexibleHeredocNowdoc` sniff to detect the new heredoc/nowdoc format as allowed as of PHP 7.3. [#736](https://github.com/PHPCompatibility/PHPCompatibility/pull/736). Fixes [#705](https://github.com/PHPCompatibility/PHPCompatibility/issues/705). + Note: This sniff is only supported in combination with PHP_CodeSniffer 2.6.0 and higher. +- :star: `PHPCompatibility.Classes.NewClasses` sniff: recognize the new `CompileError` and `JsonException` classes as introduced in PHP 7.3. [#676](https://github.com/PHPCompatibility/PHPCompatibility/pull/676) +- :star: `PHPCompatibility.Constants.NewConstants` sniff: recognize new constants which are being introduced in PHP 7.3. [#678](https://github.com/PHPCompatibility/PHPCompatibility/pull/678) +- :star: `PHPCompatibility.Constants.RemovedConstants` sniff: recognize constants which have been deprecated or removed in PHP 7.3. [#710](https://github.com/PHPCompatibility/PHPCompatibility/pull/710). Partially fixes [#718](https://github.com/PHPCompatibility/PHPCompatibility/issues/718). +- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: recognize various new functions being introduced in PHP 7.3. [#679](https://github.com/PHPCompatibility/PHPCompatibility/pull/679) +- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: recognize the `sapi_windows_*()`, `hash_hkdf()` and `pcntl_signal_get_handler()` functions as introduced in PHP 7.1. [#728](https://github.com/PHPCompatibility/PHPCompatibility/pull/728) +- :star: `PHPCompatibility.FunctionUse.RemovedFunctionParameters` sniff: recognize the deprecation of the `$case_insensitive` parameter for the `define()` function in PHP 7.3. [#706](https://github.com/PHPCompatibility/PHPCompatibility/pull/706) +- :star: `PHPCompatibility.FunctionUse.RemovedFunctions` sniff: recognize the PHP 7.3 deprecation of the `image2wbmp()`, `fgetss()` and `gzgetss()` functions, as well as the deprecation of undocumented Mbstring function aliases. [#681](https://github.com/PHPCompatibility/PHPCompatibility/pull/681), [#714](https://github.com/PHPCompatibility/PHPCompatibility/pull/714), [#720](https://github.com/PHPCompatibility/PHPCompatibility/pull/720). Partially fixes [#718](https://github.com/PHPCompatibility/PHPCompatibility/issues/718). +- :star: `PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters` sniff: account for the second parameter for `array_push()` and `array_unshift()` becoming optional in PHP 7.3, as well as for the `$mode` parameter for a range of `ftp_*()` functions becoming optional. [#680](https://github.com/PHPCompatibility/PHPCompatibility/pull/680) +- :star: `PHPCompatibility.IniDirectives.NewIniDirectives` sniff: recognize new `syslog` and `session` ini directives as introduced in PHP 7.3. [#702](https://github.com/PHPCompatibility/PHPCompatibility/pull/702), [#719](https://github.com/PHPCompatibility/PHPCompatibility/pull/719), [#730](https://github.com/PHPCompatibility/PHPCompatibility/pull/730) +- :star: `PHPCompatibility.IniDirectives.NewIniDirectives` sniff: recognize some more ini directives which were introduced in PHP 7.1. [#727](https://github.com/PHPCompatibility/PHPCompatibility/pull/727) +- :star: `PHPCompatibility.IniDirectives.RemovedIniDirectived` sniff: recognize ini directives removed in PHP 7.3. [#677](https://github.com/PHPCompatibility/PHPCompatibility/pull/677), [#717](https://github.com/PHPCompatibility/PHPCompatibility/pull/717). Partially fixes [#718](https://github.com/PHPCompatibility/PHPCompatibility/issues/718). +- :star: New `isNumericCalculation()` and `isVariable()` utility methods to the `PHPCompatibility\Sniff` class. [#664](https://github.com/PHPCompatibility/PHPCompatibility/pull/664), [#666](https://github.com/PHPCompatibility/PHPCompatibility/pull/666) +- :books: A section about the new sniff naming conventions to the `Contributing` file. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) + +### Changed +- :fire: All sniffs have been placed in meaningful categories and a number of sniffs have been renamed to have more consistent, meaningful and future-proof names. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738). Fixes [#601](https://github.com/PHPCompatibility/PHPCompatibility/issues/601), [#692](https://github.com/PHPCompatibility/PHPCompatibility/issues/692) + See the table at the top of this changelog for details of all the file renames. +- :umbrella: The unit test files have been moved about as well. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) + * The directory structure for these now mirrors the default directory structure used by PHPCS itself. + * The file names of the unit test files have been adjusted for the changes made in the sniffs. + * The unit test case files have been renamed and moved to the same directory as the actual test file they apply to. + * The `BaseSniffTest::sniffFile()` method has been adjusted to match. The signature of this method has changed. Where it previously expected a relative path to the unit test case file, it now expects an absolute path. + * The unit tests for the utility methods in the `PHPCompatibility\Sniff` class have been moved to a new `PHPCompatibility\Util\Tests\Core` subdirectory. + * The bootstrap file used for PHPUnit has been moved to the project root directory and renamed `phpunit-bootstrap.php`. +- :twisted_rightwards_arrows: The `PHPCompatibility.LanguageConstructs.NewLanguageConstructs` sniff has been split into two sniffs. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) + The `PHPCompatibility.LanguageConstructs.NewLanguageConstructs` sniff now contains just the checks for the namespace separator and the ellipsis. + The new `PHPCompatibility.Operators.NewOperators` sniff now contains the checks regarding the pow, pow equals, spaceship and coalesce (equals) operators. +- :pushpin: The `PHPCompatibility.ParameterValues.RemovedMbstringModifiers` sniff will now also recognize removed regex modifiers when used within a function call to one of the undocumented Mbstring function aliases for the Mbstring regex functions. [#715](https://github.com/PHPCompatibility/PHPCompatibility/pull/715) +- :pushpin: The `PHPCompatibility\Sniff::getFunctionCallParameter()` utility method now allows for closures called via a variable. [#723](https://github.com/PHPCompatibility/PHPCompatibility/pull/723) +- :pencil2: `PHPCompatibility.Upgrade.LowPHPCS`: the minimum supported PHPCS version is now 2.3.0. [#699](https://github.com/PHPCompatibility/PHPCompatibility/pull/699) +- :pencil2: Minor inline documentation improvements. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) +- :umbrella: Minor improvements to the unit tests for the `PHPCompatibility.FunctionNameRestrctions.RemovedMagicAutoload` sniff. [#716](https://github.com/PHPCompatibility/PHPCompatibility/pull/716) +- :recycle: Minor other optimizations. [#698](https://github.com/PHPCompatibility/PHPCompatibility/pull/698), [#697](https://github.com/PHPCompatibility/PHPCompatibility/pull/697) +- :wrench: Minor improvements to the build tools. [#701](https://github.com/PHPCompatibility/PHPCompatibility/pull/701) +- :wrench: Removed some unnecessary inline annotations. [#700](https://github.com/PHPCompatibility/PHPCompatibility/pull/700) +- :books: Replaced some of the badges in the Readme file. [#721](https://github.com/PHPCompatibility/PHPCompatibility/pull/721), [#722](https://github.com/PHPCompatibility/PHPCompatibility/pull/722) +- :books: Composer: updated the list of package authors. [#739](https://github.com/PHPCompatibility/PHPCompatibility/pull/739) + +### Removed +- :no_entry_sign: Support for PHP_CodeSniffer 1.x and low 2.x versions. The new minimum version of PHP_CodeSniffer to be able to use this library is 2.3.0. [#699](https://github.com/PHPCompatibility/PHPCompatibility/pull/699). Fixes [#691](https://github.com/PHPCompatibility/PHPCompatibility/issues/691). + The minimum _recommended_ version of PHP_CodeSniffer remains the same, i.e. 2.6.0. +- :no_entry_sign: The `\PHPCompatibility\Sniff::inUseScope()` method has been removed as it is no longer needed now support for PHPCS 1.x has been dropped. [#699](https://github.com/PHPCompatibility/PHPCompatibility/pull/699) +- :no_entry_sign: Composer: The `autoload` section has been removed from the `composer.json` file. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738). Fixes [#568](https://github.com/PHPCompatibility/PHPCompatibility/issues/568). + Autoloading for this library is done via the PHP_CodeSniffer default mechanism, enhanced with our own autoloader, so the Composer autoloader shouldn't be needed and was causing issues in a particular use-case. + +### Fixed +- :bug: `PHPCompatibility.FunctionUse.NewFunctionParameters` sniff: The new `$mode` parameter of the `php_uname()` function was added in PHP 4.3, not in PHP 7.0 as was previously being reported. + The previous implementation of this check was based on an error in the PHP documentation. The error in the PHP documentation has been rectified and the sniff has followed suit. [#711](https://github.com/PHPCompatibility/PHPCompatibility/pull/711) +- :bug: `PHPCompatibility.Generators.NewGeneratorReturn` sniff: The sniff would throw false positives for `return` statements in nested constructs and did not correctly detect the scope which should be examined. [#725](https://github.com/PHPCompatibility/PHPCompatibility/pull/725). Fixes [#724](https://github.com/PHPCompatibility/PHPCompatibility/pull/724). +- :bug: `PHPCompatibility.Keywords.NewKeywords` sniff: PHP magic constants are case _in_sensitive. This sniff now accounts for this. [#707](https://github.com/PHPCompatibility/PHPCompatibility/pull/707) +- :bug: Various bugs in the `PHPCompatibility.Syntax.ForbiddenCallTimePassByReference` sniff [#723](https://github.com/PHPCompatibility/PHPCompatibility/pull/723): + - Closures called via a variable will now also be examined. (false negative) + - References within arrays/closures passed as function call parameters would incorrectly trigger an error. (false positive) +- :green_heart: Compatibility with PHPUnit 7.2. [#712](https://github.com/PHPCompatibility/PHPCompatibility/pull/712) + +### Credits +Thanks go out to [Jonathan Champ] for his contribution to this version. :clap: + + +## [8.2.0] - 2018-07-17 + +See all related issues and PRs in the [8.2.0 milestone]. + +### Important changes + +#### The repository has moved +As of July 13 2018, the PHPCompatibility repository has moved from the personal account of Wim Godden `wimg` to its own organization `PHPCompatibility`. +Composer users are advised to update their `composer.json`. The dependency is now called `phpcompatibility/php-compatibility`. + +#### Framework/CMS specific PHPCompatibility rulesets +Within this new organization, hosting will be offered for framework/CMS specific PHPCompatibility rulesets. + +The first two such repositories have been created and are now available for use: +* PHPCompatibilityJoomla [GitHub](https://github.com/PHPCompatibility/PHPCompatibilityJoomla)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-joomla) +* PHPCompatibilityWP [GitHub](https://github.com/PHPCompatibility/PHPCompatibilityWP)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp) + +If you want to make sure you have all PHPCompatibility rulesets available at any time, you can use the PHPCompatibilityAll package [GitHub](https://github.com/PHPCompatibility/PHPCompatibilityAll)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-all). + +For more information, see the [Readme](https://github.com/PHPCompatibility/PHPCompatibility#using-a-frameworkcms-specific-ruleset) and [Contributing guidelines](https://github.com/PHPCompatibility/PHPCompatibility/blob/master/.github/CONTRIBUTING.md#frameworkcms-specific-rulesets). + +#### Changes expected in PHPCompatibility 9.0.0 +The next version of PHPCompatibility will include a major directory layout restructuring which means that the sniff codes of all sniffs will change. + +In this same release, support for PHP_CodeSniffer 1.5.x will be dropped. The new minimum supported PHPCS version will be 2.3.0. + +For more information about these upcoming changes, please read the [announcement](https://github.com/PHPCompatibility/PHPCompatibility/issues/688). + +The `9.0.0` release is expected to be ready later this summer. + + +### Added +- :star2: New `ArgumentFunctionsUsage` sniff to detect usage of the `func_get_args()`, `func_get_arg()` and `func_num_args()` functions and the changes regarding these functions introduced in PHP 5.3. [#596](https://github.com/PHPCompatibility/PHPCompatibility/pull/596). Fixes [#372](https://github.com/PHPCompatibility/PHPCompatibility/issues/372). +- :star2: New `DiscouragedSwitchContinue` sniff to detect `continue` targetting a `switch` control structure for which `E_WARNINGS` will be thrown as of PHP 7.3. [#687](https://github.com/PHPCompatibility/PHPCompatibility/pull/687) +- :star2: New `NewClassMemberAccess` sniff to detect class member access on instantiation as added in PHP 5.4 and class member access on cloning as added in PHP 7.0. [#619](https://github.com/PHPCompatibility/PHPCompatibility/pull/619). Fixes [#53](https://github.com/PHPCompatibility/PHPCompatibility/issues/53). +- :star2: New `NewConstantScalarExpressions` sniff to detect PHP 5.6 scalar expression in contexts where PHP previously only allowed static values. [#617](https://github.com/PHPCompatibility/PHPCompatibility/pull/617). Fixes [#399](https://github.com/PHPCompatibility/PHPCompatibility/issues/399). +- :star2: New `NewGeneratorReturn` sniff to detect `return` statements within generators as introduced in PHP 7.0. [#618](https://github.com/PHPCompatibility/PHPCompatibility/pull/618) +- :star2: New `PCRENewModifiers` sniff to initially detect the new `J` regex modifier as introduced in PHP 7.2. [#600](https://github.com/PHPCompatibility/PHPCompatibility/pull/600). Fixes [#556](https://github.com/PHPCompatibility/PHPCompatibility/issues/556). +- :star2: New `ReservedFunctionNames` sniff to report on double underscore prefixed functions and methods. This was previously reported via an upstream sniff. [#581](https://github.com/PHPCompatibility/PHPCompatibility/pull/581) +- :star2: New `NewTrailingComma` sniff to detect trailing comma's in function calls, method calls, `isset()` and `unset()` as will be introduced in PHP 7.3. [#632](https://github.com/PHPCompatibility/PHPCompatibility/pull/632) +- :star2: New `Upgrade/LowPHPCS` sniff to give users of old PHP_CodeSniffer versions advance warning when support will be dropped in the near future. [#693](https://github.com/PHPCompatibility/PHPCompatibility/pull/693) +- :star: `NewClasses` sniff: check for some 40+ additional PHP native classes added in various PHP versions. [#573](https://github.com/PHPCompatibility/PHPCompatibility/pull/573) +- :star: `NewClosure` sniff: check for usage of `self`/`parent`/`static::` being used within closures, support for which was only added in PHP 5.4. [#669](https://github.com/PHPCompatibility/PHPCompatibility/pull/669). Fixes [#668](https://github.com/PHPCompatibility/PHPCompatibility/pull/668). +- :star: `NewConstants` sniff: recognize constants added by the PHP 5.5+ password extension. [#626](https://github.com/PHPCompatibility/PHPCompatibility/pull/626) +- :star: `NewFunctionParameters` sniff: recognize a number of additional function parameters added in PHP 7.0, 7.1 and 7.2. [#602](https://github.com/PHPCompatibility/PHPCompatibility/pull/602) +- :star: `NewFunctions` sniff: recognize the PHP 5.1 SPL extension functions, the PHP 5.1.1 `hash_hmac()` function, the PHP 5.6 `pg_lo_truncate()` function, more PHP 7.2 Sodium functions and the new PHP 7.3 `is_countable()` function. [#606](https://github.com/PHPCompatibility/PHPCompatibility/pull/606), [#625](https://github.com/PHPCompatibility/PHPCompatibility/pull/625), [#640](https://github.com/PHPCompatibility/PHPCompatibility/pull/640), [#651](https://github.com/PHPCompatibility/PHPCompatibility/pull/651) +- :star: `NewHashAlgorithms` sniff: recognize the new hash algorithms which were added in PHP 7.1. [#599](https://github.com/PHPCompatibility/PHPCompatibility/pull/599) +- :star: `NewInterfaces` sniff: check for the PHP 5.0 `Reflector` interface. [#572](https://github.com/PHPCompatibility/PHPCompatibility/pull/572) +- :star: `OptionalRequiredFunctionParameters` sniff: detect missing `$salt` parameter in calls to the `crypt()` function (PHP 5.6+). [#605](https://github.com/PHPCompatibility/PHPCompatibility/pull/605) +- :star: `RequiredOptionalFunctionParameters` sniff: recognize that the `$varname` parameter of `getenv()` and the `$scale` parameter of `bcscale()` have become optional as of PHP 7.1 and 7.3 respectively. [#598](https://github.com/PHPCompatibility/PHPCompatibility/pull/598), [#612](https://github.com/PHPCompatibility/PHPCompatibility/pull/612) +- :star: New `AbstractFunctionCallParameterSniff` to be used as a basis for sniffs examining function call parameters. [#636](https://github.com/PHPCompatibility/PHPCompatibility/pull/636) +- :star: New `getReturnTypeHintName()` utility method to the `PHPCompatibility\Sniff` class. [#578](https://github.com/PHPCompatibility/PHPCompatibility/pull/578), [#642](https://github.com/PHPCompatibility/PHPCompatibility/pull/642) +- :star: New `isNumber()`, `isPositiveNumber()` and `isNegativeNumber()` utility methods to the `PHPCompatibility\Sniff` class. [#610](https://github.com/PHPCompatibility/PHPCompatibility/pull/610), [#650](https://github.com/PHPCompatibility/PHPCompatibility/pull/650) +- :star: New `isShortList()` utility method to the `PHPCompatibility\Sniff` class. [#635](https://github.com/PHPCompatibility/PHPCompatibility/pull/635) +- :star: New `getCommandLineData()` method to the `PHPCompatibility\PHPCSHelper` class to provide PHPCS cross-version compatible access to command line info at run time. [#693](https://github.com/PHPCompatibility/PHPCompatibility/pull/693) +- :star: Duplicate of upstream `findEndOfStatement()` method to the `PHPCompatibility\PHPCSHelper` class to allow for PHPCS cross-version usage of that method. [#614](https://github.com/PHPCompatibility/PHPCompatibility/pull/614) +- :umbrella: additional unit test to confirm that the `PHPCompatibility\Sniff::isUseOfGlobalConstant()` method handles multi-constant declarations correctly. [#587](https://github.com/PHPCompatibility/PHPCompatibility/pull/587) +- :umbrella: additional unit tests to confirm that the `PHPCompatibility\Sniff::isClassProperty()` method handles multi-property declarations correctly. [#583](https://github.com/PHPCompatibility/PHPCompatibility/pull/583) +- :books: [Readme](https://github.com/PHPCompatibility/PHPCompatibility#using-a-frameworkcms-specific-ruleset) & [Contributing](https://github.com/PHPCompatibility/PHPCompatibility/blob/master/.github/CONTRIBUTING.md#frameworkcms-specific-rulesets): add information about the framework/CMS specific rulesets. Related PRs: [#615](https://github.com/PHPCompatibility/PHPCompatibility/pull/615), [#624](https://github.com/PHPCompatibility/PHPCompatibility/pull/624), [#648](https://github.com/PHPCompatibility/PHPCompatibility/pull/648), [#674](https://github.com/PHPCompatibility/PHPCompatibility/pull/674), [#685](https://github.com/PHPCompatibility/PHPCompatibility/pull/685), [#694](https://github.com/PHPCompatibility/PHPCompatibility/pull/694). Related to issue [#530](https://github.com/PHPCompatibility/PHPCompatibility/issues/530). +- :books: Readme: information about the PHPCS 3.3.0 change which allows for a `testVersion` in a custom ruleset to be overruled by the command-line. [#607](https://github.com/PHPCompatibility/PHPCompatibility/pull/607) + +### Changed +- :books: Adjusted references to the old repository location throughout the codebase to reflect the move to a GitHub organization. [#689](https://github.com/PHPCompatibility/PHPCompatibility/pull/689) + This repository will now live in [https://github.com/PHPCompatibility/PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) and the Packagist reference will now be `phpcompatibility/php-compatibility`. +- :white_check_mark: The `getReturnTypeHintToken()` utility method has been made compatible with the changes in the PHPCS tokenizer which were introduced in PHP_CodeSniffer 3.3.0. [#642](https://github.com/PHPCompatibility/PHPCompatibility/pull/642). Fixes [#639](https://github.com/PHPCompatibility/PHPCompatibility/issues/639). +- :pushpin: `ConstantArrayUsingConst`: improved handling of multi-constant declarations. [#593](https://github.com/PHPCompatibility/PHPCompatibility/pull/593) +- :pushpin: `NewHeredocInitialize`: improved handling of constant declarations using the `const` keyword. + The sniff will now also report on multi-declarations for variables, constants and class properties and on using heredoc as a function parameter default. [#641](https://github.com/PHPCompatibility/PHPCompatibility/pull/641) +- :pushpin: `ForbiddenEmptyListAssignment`: this sniff will now also report on empty list assignments when the PHP 7.1 short list syntax is used. [#653](https://github.com/PHPCompatibility/PHPCompatibility/pull/653) +- :pushpin: The `ForbiddenNegativeBitshift` sniff would previously only report on "bitshift right". As of this version, "bitshift left" and bitshift assignments will also be recognized. [#614](https://github.com/PHPCompatibility/PHPCompatibility/pull/614) +- :pushpin: The `NewClasses` and `NewInterfaces` sniffs will now also report on new classes/interfaces when used as _return type_ declarations. [#578](https://github.com/PHPCompatibility/PHPCompatibility/pull/578) +- :pushpin: The `NewScalarTypeDeclarations` sniff will now recognize `parent` as a valid type declaration. + The sniff will now also throw an error about using `self` and `parent` when PHP < 5.2 needs to be supported as PHP 5.1 and lower would presume these to be class names instead of keywords. [#595](https://github.com/PHPCompatibility/PHPCompatibility/pull/595) +- :pushpin: The `PregReplaceEModifier` sniff - and the `PCRENewModifiers` sniff by extension - will now correctly examine and report on modifiers in regexes passed via calls to `preg_replace_callback_array()`. [#600](https://github.com/PHPCompatibility/PHPCompatibility/pull/600), [#636](https://github.com/PHPCompatibility/PHPCompatibility/pull/636) +- :pushpin: `getReturnTypeHintToken()` utility method: improved support for interface methods and abstract function declarations. [#652](https://github.com/PHPCompatibility/PHPCompatibility/pull/652) +- :pushpin: The `findExtendedClassName()`, `findImplementedInterfaceNames()`, `getMethodParameters()` utility methods which are duplicates of upstream PHPCS methods, have been moved from the `PHPCompatibility\Sniff` class to the `PHPCompatibility\PHPCSHelper` class and have become static methods. [#613](https://github.com/PHPCompatibility/PHPCompatibility/pull/613) +- :white_check_mark: `getReturnTypeHintToken()` utility method: align returned `$stackPtr` with native PHPCS behaviour by returning the last token of the type declaration. [#575](https://github.com/PHPCompatibility/PHPCompatibility/pull/575) +- :white_check_mark: PHPCS cross-version compatibility: sync `getMethodParameters()` method with improved upstream version. [#643](https://github.com/PHPCompatibility/PHPCompatibility/pull/643) +- :pencil2: The `MbstringReplaceEModifier`, `PregReplaceEModifier` and the `PregReplaceEModifier` sniffs now `extend` the new `AbstractFunctionCallParameterSniff` class. This should yield more accurate results when checking whether one of the target PHP functions was called. [#636](https://github.com/PHPCompatibility/PHPCompatibility/pull/636) +- :pencil2: `DeprecatedNewReference` sniff: minor change to the error text and code - was `Forbidden`, now `Removed` -. Custom rulesets which explicitly excluded this error code will need to be updated. [#594](https://github.com/PHPCompatibility/PHPCompatibility/pull/594) +- :pencil2: `NewScalarTypeDeclarations` sniff: minor change to the error message text.[#644](https://github.com/PHPCompatibility/PHPCompatibility/pull/644) +- :umbrella: The unit test framework now allows for sniffs in categories other than `PHP`. [#634](https://github.com/PHPCompatibility/PHPCompatibility/pull/634) +- :umbrella: Boyscouting: fixed up some (non-relevant) parse errors in a unit test case file. [#576](https://github.com/PHPCompatibility/PHPCompatibility/pull/576) +- :green_heart: Travis: build tests are now also being run against the lowest supported PHPCS 3.x version. Previously only the highest supported PHPCS 3.x version was tested against. [#633](https://github.com/PHPCompatibility/PHPCompatibility/pull/633) +- :books: Readme: Improved Composer install instructions. [#690](https://github.com/PHPCompatibility/PHPCompatibility/pull/690) +- :books: Minor documentation fixes. [#672](https://github.com/PHPCompatibility/PHPCompatibility/pull/672) +- :wrench: Minor performance optimizations and code simplifications. [#592](https://github.com/PHPCompatibility/PHPCompatibility/pull/592), [#630](https://github.com/PHPCompatibility/PHPCompatibility/pull/630), [#671](https://github.com/PHPCompatibility/PHPCompatibility/pull/671) +- :wrench: Composer: Various improvements, including improved information about the suggested packages, suggesting `roave/security-advisories`, allowing for PHPUnit 7.x. [#604](https://github.com/PHPCompatibility/PHPCompatibility/pull/604/files), [#616](https://github.com/PHPCompatibility/PHPCompatibility/pull/616), [#622](https://github.com/PHPCompatibility/PHPCompatibility/pull/622), [#646](https://github.com/PHPCompatibility/PHPCompatibility/pull/646) +- :wrench: Various Travis build script improvements, including tweaks for faster build time, validation of the `composer.json` file, validation of the framework specific rulesets. [#570](https://github.com/PHPCompatibility/PHPCompatibility/pull/570), [#571](https://github.com/PHPCompatibility/PHPCompatibility/pull/571), [#579](https://github.com/PHPCompatibility/PHPCompatibility/pull/579), [#621](https://github.com/PHPCompatibility/PHPCompatibility/pull/621), [#631](https://github.com/PHPCompatibility/PHPCompatibility/pull/631) +- :wrench: Build/PHPCS: made some more CS conventions explicit and start using PHPCS 3.x options for the PHPCompatibility native ruleset. [#586](https://github.com/PHPCompatibility/PHPCompatibility/pull/586), [#667](https://github.com/PHPCompatibility/PHPCompatibility/pull/667), [#673](https://github.com/PHPCompatibility/PHPCompatibility/pull/673) +- :wrench: Some code style clean up and start using the new inline PHPCS 3.2+ annotations where applicable. [#586](https://github.com/PHPCompatibility/PHPCompatibility/pull/586), [#591](https://github.com/PHPCompatibility/PHPCompatibility/pull/591), [#620](https://github.com/PHPCompatibility/PHPCompatibility/pull/620), [#673](https://github.com/PHPCompatibility/PHPCompatibility/pull/673) + +### Removed +- :no_entry_sign: PHPCompatibility no longer explicitly supports PHP_CodeSniffer 2.2.0. [#687](https://github.com/PHPCompatibility/PHPCompatibility/pull/687), [#690](https://github.com/PHPCompatibility/PHPCompatibility/pull/690) +- :no_entry_sign: The PHPCompatibility ruleset no longer includes the PHPCS native `Generic.NamingConventions.CamelCapsFunctionName`. Double underscore prefixed function names are now being reported on by a new dedicated sniff. [#581](https://github.com/PHPCompatibility/PHPCompatibility/pull/581) +- :no_entry_sign: PHPCompatibility no longer explicitly supports HHVM and builds are no longer tested against HHVM. + For now, running PHPCompatibility on HHVM to test PHP code may still work for a little while, but HHVM has announced they are [dropping PHP support](https://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html). [#623](https://github.com/PHPCompatibility/PHPCompatibility/pull/623). Fixes [#603](https://github.com/PHPCompatibility/PHPCompatibility/issues/603). +- :books: Readme: badges from services which are no longer supported or inaccurate. [#609](https://github.com/PHPCompatibility/PHPCompatibility/pull/609), [#628](https://github.com/PHPCompatibility/PHPCompatibility/pull/628) + +### Fixed +- :bug: Previously, the PHPCS native `Generic.NamingConventions.CamelCapsFunctionName` sniff was included in PHPCompatibility. Some error codes of this sniff were excluded, as well as some error messages changed (via the ruleset). + If/when PHPCompatibility would be used in combination with a code style-type ruleset, this could inadvertently lead to underreporting of issues which the CS-type ruleset intends to have reported - i.e. the error codes excluded by PHPCompatibility -. This has now been fixed. [#581](https://github.com/PHPCompatibility/PHPCompatibility/pull/581) +- :bug: The `ForbiddenNegativeBitshift` sniff would incorrectly throw an error when a bitshift was based on a calculation which included a negative number, but would not necessarily result in a negative number. [#614](https://github.com/PHPCompatibility/PHPCompatibility/pull/614). Fixes [#294](https://github.com/PHPCompatibility/PHPCompatibility/issues/294), [#466](https://github.com/PHPCompatibility/PHPCompatibility/issues/466). +- :bug: The `NewClosure` sniff would report the same issue twice when the issue was encountered in a nested closure. [#669](https://github.com/PHPCompatibility/PHPCompatibility/pull/669) +- :bug: The `NewKeywords` sniff would underreport on non-lowercase keywords. [#627](https://github.com/PHPCompatibility/PHPCompatibility/pull/627) +- :bug: The `NewKeywords` sniff would incorrectly report on the use of class constants and class properties using the same name as a keyword. [#627](https://github.com/PHPCompatibility/PHPCompatibility/pull/627) +- :bug: The `NewNullableTypes` sniff would potentially underreport when comments where interspersed in the (return) type declarations. [#577](https://github.com/PHPCompatibility/PHPCompatibility/pull/577) +- :bug: The `Sniff::getFunctionCallParameters()` utility method would in rare cases return incorrect results when it encountered a closure as a parameter. [#682](https://github.com/PHPCompatibility/PHPCompatibility/pull/682) +- :bug: The `Sniff::getReturnTypeHintToken()` utility method would not always return a `$stackPtr`. [#645](https://github.com/PHPCompatibility/PHPCompatibility/pull/645) +- :bug: Minor miscellanous other bugfixes. [#670](https://github.com/PHPCompatibility/PHPCompatibility/pull/670) +- :umbrella: `PHPCompatibility\Tests\BaseClass\MethodTestFrame::getTargetToken()` could potentially not find the correct token to run a test against. [#588](https://github.com/PHPCompatibility/PHPCompatibility/pull/588) + +### Credits +Thanks go out to [Michael Babker] and [Juliette Reinders Folmer] for their contributions to this version. :clap: + + +## [8.1.0] - 2017-12-27 + +See all related issues and PRs in the [8.1.0 milestone]. + +### Added +- :star2: New `NewConstants` and `RemovedConstants` sniffs to detect usage of new/removed PHP constants for all PHP versions from PHP 5 up. [#526](https://github.com/PHPCompatibility/PHPCompatibility/pull/525), [#551](https://github.com/PHPCompatibility/PHPCompatibility/pull/551), [#566](https://github.com/PHPCompatibility/PHPCompatibility/pull/566). Fixes [#263](https://github.com/PHPCompatibility/PHPCompatibility/issues/263). +- :star2: New `MagicAutoloadDeprecation` sniff to detect deprecated `__autoload()` functions as deprecated in PHP 7.2. [#540](https://github.com/PHPCompatibility/PHPCompatibility/pull/540) +- :star2: New `OptionalRequiredFunctionParameter` sniff to check for missing function call parameters which were required and only became optional in a later PHP version. [#524](https://github.com/PHPCompatibility/PHPCompatibility/pull/524) +- :star2: New `DynamicAccessToStatic` sniff to detect dynamic access to static methods and properties, as well as class constants, prior to PHP 5.3. [#535](https://github.com/PHPCompatibility/PHPCompatibility/pull/535). Fixes [#534](https://github.com/PHPCompatibility/PHPCompatibility/issues/534). +- :star: `DeprecatedFunctions` sniff: recognize yet more PHP 7.2 deprecated functions. [#561](https://github.com/PHPCompatibility/PHPCompatibility/pull/561), [#566](https://github.com/PHPCompatibility/PHPCompatibility/pull/566) +- :star: `DeprecatedIniDirectives` sniff: recognize the last of the PHP 7.2 deprecated ini directives. [#566](https://github.com/PHPCompatibility/PHPCompatibility/pull/566), [#567](https://github.com/PHPCompatibility/PHPCompatibility/pull/567) +- :star: `NewFunctions` : detection of all new PHP 7.2 functions added. [#522](https://github.com/PHPCompatibility/PHPCompatibility/pull/522), [#545](https://github.com/PHPCompatibility/PHPCompatibility/pull/545), [#551](https://github.com/PHPCompatibility/PHPCompatibility/pull/551), [#565](https://github.com/PHPCompatibility/PHPCompatibility/pull/565) +- :star: `RemovedExtensions` : report on usage of the `mcrypt` extension which has been removed in PHP 7.2. [#566](https://github.com/PHPCompatibility/PHPCompatibility/pull/566) +- :star: `RemovedGlobalVariables` : detection of the use of `$php_errormsg` with `track_errors` which has been deprecated in PHP 7.2. [#528](https://github.com/PHPCompatibility/PHPCompatibility/pull/528) +- :books: Documentation : added reporting usage instructions. [#533](https://github.com/PHPCompatibility/PHPCompatibility/pull/533), [#552](https://github.com/PHPCompatibility/PHPCompatibility/pull/552) + +### Changed +- :pushpin: `NewClosures` : downgraded "$this found in closure outside class" to warning. [#536](https://github.com/PHPCompatibility/PHPCompatibility/pull/535). Fixes [#527](https://github.com/PHPCompatibility/PHPCompatibility/issues/527). +- :pushpin: `ForbiddenGlobalVariableVariable` : the sniff will now throw an error for each variable in a `global` statement which is no longer supported and show the variable found to make it easier to fix this. Previously only one error would be thrown per `global` statement. [#564](https://github.com/PHPCompatibility/PHPCompatibility/pull/564) +- :pushpin: `ForbiddenGlobalVariableVariable` : the sniff will now throw `warning`s for non-bare variables used in a `global` statement as those are discouraged since PHP 7.0. [#564](https://github.com/PHPCompatibility/PHPCompatibility/pull/564) +- :rewind: `NewLanguageConstructs` : updated the version number for `T_COALESCE_EQUAL`. [#523](https://github.com/PHPCompatibility/PHPCompatibility/pull/523) +- :pencil2: `Sniff::getTestVersion()` : simplified regex logic. [#520](https://github.com/PHPCompatibility/PHPCompatibility/pull/520) +- :green_heart: Travis : build tests are now being run against PHP 7.2 as well. [#511](https://github.com/PHPCompatibility/PHPCompatibility/pull/511) +- :wrench: Improved check for superfluous whitespaces in files. [#542](https://github.com/PHPCompatibility/PHPCompatibility/pull/542) +- :wrench: Build/PHPCS : stabilized the exclude patterns. [#529](https://github.com/PHPCompatibility/PHPCompatibility/pull/529) +- :wrench: Build/PHPCS : added array indentation check. [#538](https://github.com/PHPCompatibility/PHPCompatibility/pull/538) +- :white_check_mark: PHPCS cross-version compatibility : sync `FindExtendedClassname()` method with upstream. [#507](https://github.com/PHPCompatibility/PHPCompatibility/pull/507) +- :wrench: The minimum version for the recommended `DealerDirect/phpcodesniffer-composer-installer` Composer plugin has been upped to `0.4.3`. [#548](https://github.com/PHPCompatibility/PHPCompatibility/pull/548) + +### Fixed +- :bug: `ForbiddenCallTimePassByReference` : a false positive was being thrown when a global constant was followed by a _bitwise and_. [#562](https://github.com/PHPCompatibility/PHPCompatibility/pull/562). Fixes [#39](https://github.com/PHPCompatibility/PHPCompatibility/issues/39). +- :bug: `ForbiddenGlobalVariableVariable` : the sniff was overzealous and would also report on `global` in combination with variable variables which are still supported. [#564](https://github.com/PHPCompatibility/PHPCompatibility/pull/564). Fixes [#537](https://github.com/PHPCompatibility/PHPCompatibility/issues/537). +- :bug: `ForbiddenGlobalVariableVariable` : variables interspersed with whitespace and/or comments were not being reported. [#564](https://github.com/PHPCompatibility/PHPCompatibility/pull/564) +- :rewind: `ForbiddenNamesAsInvokedFunctions` : improved recognition of function invocations using forbidden words and prevent warnings for keywords which are no longer forbidden as method names in PHP 7.0+. [#516](https://github.com/PHPCompatibility/PHPCompatibility/pull/516). Fixes [#515](https://github.com/PHPCompatibility/PHPCompatibility/issues/515) +- :bug: `VariableVariables` : variables interspersed with whitespace and/or comments were not being reported. [#563](https://github.com/PHPCompatibility/PHPCompatibility/pull/563) +- :umbrella: Fixed some unintentional syntax errors in test files. [#539](https://github.com/PHPCompatibility/PHPCompatibility/pull/539) +- :umbrella: Tests : fixed case numbering error. [#525](https://github.com/PHPCompatibility/PHPCompatibility/pull/525) +- :books: Tests : added missing test skip explanation. [#521](https://github.com/PHPCompatibility/PHPCompatibility/pull/521) +- :wrench: Fixed PHPCS whitespaces. [#543](https://github.com/PHPCompatibility/PHPCompatibility/pull/543) +- :wrench: Fixed code test coverage verification. [#550](https://github.com/PHPCompatibility/PHPCompatibility/pull/550). Fixes [#549](https://github.com/PHPCompatibility/PHPCompatibility/issues/549). + +### Credits +Thanks go out to [Juliette Reinders Folmer] and [Jonathan Van Belle] for their contributions to this version. :clap: + + +## [8.0.1] - 2017-08-07 + +See all related issues and PRs in the [8.0.1 milestone]. + +### Added +- :star2: New `DeprecatedTypeCasts` sniff to detect deprecated and removed type casts, such as the `(unset)` type cast as deprecated in PHP 7.2. [#498](https://github.com/PHPCompatibility/PHPCompatibility/pull/498) +- :star2: New `NewTypeCasts` sniff to detect type casts not present in older PHP versions such as the `(binary)` type cast as added in PHP 5.2.1. [#497](https://github.com/PHPCompatibility/PHPCompatibility/pull/497) +- :star: `NewGroupUseDeclaration`: Detection of PHP 7.2 trailing comma's in group use statements. [#504](https://github.com/PHPCompatibility/PHPCompatibility/pull/504) +- :star: `DeprecatedFunctions` sniff: recognize some more PHP 7.2 deprecated functions. [#501](https://github.com/PHPCompatibility/PHPCompatibility/pull/501) +- :star: `DeprecatedIniDirectives` sniff: recognize more PHP 7.2 deprecated ini directives. [#500](https://github.com/PHPCompatibility/PHPCompatibility/pull/500) +- :star: `ForbiddenNames` sniff: recognize `object` as a forbidden keyword since PHP 7.2. [#499](https://github.com/PHPCompatibility/PHPCompatibility/pull/499) +- :star: `NewReturnTypeDeclarations` sniff: recognize generic `parent`, PHP 7.1 `iterable` and PHP 7.2 `object` return type declarations. [#505](https://github.com/PHPCompatibility/PHPCompatibility/pull/505), [#499](https://github.com/PHPCompatibility/PHPCompatibility/pull/499) +- :star: `NewScalarTypeDeclarations` sniff: recognize PHP 7.2 `object` type declarion. [#499](https://github.com/PHPCompatibility/PHPCompatibility/pull/499) + +### Changed +- :pencil2: Improved clarity of the deprecated functions alternative in the error message. [#502](https://github.com/PHPCompatibility/PHPCompatibility/pull/502) + +### Fixed +- :fire_engine: Temporary hotfix for installed_paths (pending [upstream fix](https://github.com/squizlabs/PHP_CodeSniffer/issues/1591).) [#503](https://github.com/PHPCompatibility/PHPCompatibility/pull/503) + +### Credits +Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: + + + +## [8.0.0] - 2017-08-03 + +**IMPORTANT**: This release contains a **breaking change**. Please read the below information carefully before upgrading! + +The directory layout of the PHPCompatibility standard has been changed for improved compatibility with Composer. +This means that the PHPCompatibility standard no longer extends from the root directory of the repository, but now lives in its own subdirectory `/PHPCompatibility`. + +This release also bring compatibility with PHPCS 3.x to the PHPCompatibility standard. + +There are two things you will need to be aware of: +* The path to the PHPCompatibility standard has changed. +* If you intend to upgrade to PHPCS 3.x, the path to the `phpcs` script has changed (upstream change). + +Please follow the below upgrade instructions carefully. This should be a one-time only action. + +### Upgrade instructions + +### Before upgrading + +If you had previously made accommodations for the old directory layout, you should remove any such _"hacks"_ (meant in the kindest of ways) now. + +By this we mean: symlinks for the PHPCompatibility install to the `PHP_CodeSniffer/CodeSniffer/Standards` directory, scripts to move the sniffs files to the PHPCS directory, scripts which made symlinks etc. + +So, please remove those first. + +> **Side-note**: +> +> If you had previously forked this repository to solve this issue, please consider reverting your fork to the official version or removing it all together. + +### Upgrading: re-registering PHPCompatibility with PHP CodeSniffer + +External PHP CodeSniffer standards need to be registered with PHP CodeSniffer. You have probably done this the first time you used PHPCompatibility or have a script or Composer plugin in place to do this for you. + +As the directory layout of PHPCompatibility has changed, the path previously registered with PHP CodeSniffer will no longer work and running `phpcs -i` will **_not_** list PHPCompatibility as one of the registered standards. + +#### Using a Composer plugin + +If you use Composer, we recommend you use a Composer plugin to sort this out. In previous install instructions we recommended the SimplyAdmin plugin for this. This plugin has since been abandoned. We now recommend the DealerDirect plugin. +```bash +composer remove --dev simplyadmire/composer-plugins +composer require --dev dealerdirect/phpcodesniffer-composer-installer:^0.4.3 +composer install +composer update phpcompatibility/php-compatibility squizlabs/php_codesniffer +vendor/bin/phpcs -i +``` +If all went well, you should now see PHPCompatibility listed again in the list of installed standards. + +#### Manually re-registering PHPCompatibility + +1. First run `phpcs --config-show` to check which path(s) are currently registered with PHP CodeSniffer for external standards. +2. Check in the below table what the new path for PHPCompatibility will be - the path should point to the root directory of your PHPCompatibility install (not to the sub-directory of the same name): + + Install type | Old path | New path + ------------ | -------- | --------- + Composer | `vendor/wimg` | `vendor/phpcompatibility/php-compatibility` + Unzipped release to arbitrary directory | `path/to/dir/abovePHPCompatibility` | `path/to/dir/abovePHPCompatibility/PHPCompatibility` + Git checkout | `path/to/dir/abovePHPCompatibility` | `path/to/dir/abovePHPCompatibility/PHPCompatibility` + PEAR | If the old install instruction has been followed, not registered. | `path/to/PHPCompatibility` + + > **Side-note**: + > + > If you used the old install instructions for a PEAR install, i.e. checking out the latest release to the `PHP/CodeSniffer/Standards/PHPCompatibility` directory, and you intend to upgrade to PHP CodeSniffer 3.x, it is recommended you move the PHPCompatibility folder out of the PEAR directory now, as the layout of the PHPCS directory has changed with PHPCS 3.x and you may otherwise lose your PHPCompatibility install when you upgrade PHP CodeSniffer via PEAR. + +3. There are two ways in which you can register the new `installed_paths` value with PHP CodeSniffer. Choose your preferred method: + * Run `phpcs --config-set installed_paths ...` and include all previously installed paths including the _adjusted_ path for the PHPCompatibility standard. + + For example, if the previous value of `installed_paths` was + + `/path/to/MyStandard,/path/to/dir/abovePHPCompatibility` + + you should now set it using + + `phpcs --config-set installed_paths /path/to/MyStandard,/path/to/PHPCompatibility` + + * If you use a custom ruleset in combination with PHPCS 2.6.0 or higher, you can pass the value to PHPCS from your custom ruleset: + ```xml + + ``` +4. Run `phpcs -i` to verify that the PHPCompatibility standard is now listed again in the list of installed standards. + + +### Upgrading to PHPCS 3.x + +The path to the `phpcs` script has changed in PHPCS 3.x which will impact how you call PHPCS. + +Version | PHPCS 2.x | PHPCS 3.x +------- | --------- | --------- +Generic `phpcs` Command | `path/to/PHP_CodeSniffer/scripts/phpcs ....` | `path/to/PHP_CodeSniffer/bin/phpcs ....` +Composer command | `vendor/bin/phpcs ...` | `vendor/bin/phpcs ...` + +So, for Composer users, nothing changes. For everyone else, you may want to add the `path/to/PHP_CodeSniffer/bin/phpcs` path to your PATH environment variable or adjust any scripts - like build scripts - which call PHPCS. + + +### Upgrading a Travis build script + +If you run PHPCompatibility against your code as part of your Travis build: +* If you use Composer to install PHP CodeSniffer and PHPCompatibility on the travis image and you've made the above mentioned changes, your build should pass again. +* If you use `git clone` to install PHP CodeSniffer and PHPCompatibility on the travis image, your build will fail until you make the following changes: + 1. Check which branch of PHPCS is being checked out. If you previously fixed this to a pre-PHPCS 3.x branch or tag, you can now change this (back) to `master` or a PHPCS 3 tag. + 2. Check to which path PHPCompatibility is being cloned and adjust the path if necessary. + 3. Adjust the `phpcs --config-set installed_paths` command as described above to point to the root of the cloned PHPCompatibility repo. + 4. If you switched to using PHPCS 3.x, adjust the call to PHPCS. + + + +### Changelog for version 8.0.0 + +See all related issues and PRs in the [8.0.0 milestone]. + +### Added +- :two_hearts: Support for PHP CodeSniffer 3.x. [#482](https://github.com/PHPCompatibility/PHPCompatibility/pull/482), [#481](https://github.com/PHPCompatibility/PHPCompatibility/pull/481), [#480](https://github.com/PHPCompatibility/PHPCompatibility/pull/480), [#488](https://github.com/PHPCompatibility/PHPCompatibility/pull/488), [#489](https://github.com/PHPCompatibility/PHPCompatibility/pull/489), [#495](https://github.com/PHPCompatibility/PHPCompatibility/pull/495) + +### Changed +- :gift: As of this version PHPCompatibility will use semantic versioning. +- :fire: The directory structure of the repository has changed for better compatibility with installation via Composer. [#446](https://github.com/PHPCompatibility/PHPCompatibility/pull/446). Fixes [#102](https://github.com/PHPCompatibility/PHPCompatibility/issues/102), [#107](https://github.com/PHPCompatibility/PHPCompatibility/issues/107) +- :pencil2: The custom `functionWhitelist` property for the `PHPCompatibility.PHP.RemovedExtensions` sniff is now only supported in combination with PHP CodeSniffer 2.6.0 or higher (due to an upstream bug which was fixed in PHPCS 2.6.0). [#482](https://github.com/PHPCompatibility/PHPCompatibility/pull/482) +- :wrench: Improved the information provided to Composer from the `composer.json` file. [#446](https://github.com/PHPCompatibility/PHPCompatibility/pull/446), [#482](https://github.com/PHPCompatibility/PHPCompatibility/pull/482), [#486](https://github.com/PHPCompatibility/PHPCompatibility/pull/486) +- :wrench: Release archives will no longer contain the unit tests and other typical development files. You can still get these by using Composer with `--prefer-source` or by checking out a git clone of the repository. [#494](https://github.com/PHPCompatibility/PHPCompatibility/pull/494) +- :wrench: A variety of minor improvements to the build process. [#485](https://github.com/PHPCompatibility/PHPCompatibility/pull/485), [#486](https://github.com/PHPCompatibility/PHPCompatibility/pull/486), [#487](https://github.com/PHPCompatibility/PHPCompatibility/pull/487) +- :wrench: Some files for use by contributors have been renamed to use `.dist` extensions or moved for easier access. [#478](https://github.com/PHPCompatibility/PHPCompatibility/pull/478), [#479](https://github.com/PHPCompatibility/PHPCompatibility/pull/479), [#483](https://github.com/PHPCompatibility/PHPCompatibility/pull/483), [#493](https://github.com/PHPCompatibility/PHPCompatibility/pull/493) +- :books: The installation instructions in the Readme. [#496](https://github.com/PHPCompatibility/PHPCompatibility/pull/496) +- :books: The unit test instructions in the Contributing file. [#496](https://github.com/PHPCompatibility/PHPCompatibility/pull/496) +- :books: Improved the example code in the Readme. [#490](https://github.com/PHPCompatibility/PHPCompatibility/pull/490) + +### Removed +- :no_entry_sign: Support for PHP 5.1 and 5.2. + + The sniffs can now only be run on PHP 5.3 or higher in combination with PHPCS 1.5.6 or 2.x and on PHP 5.4 or higher in combination with PHPCS 3.x. [#484](https://github.com/PHPCompatibility/PHPCompatibility/pull/484), [#482](https://github.com/PHPCompatibility/PHPCompatibility/pull/482) + +### Credits +Thanks go out to [Gary Jones] and [Juliette Reinders Folmer] for their contributions to this version. :clap: + + +## [7.1.5] - 2017-07-17 + +See all related issues and PRs in the [7.1.5 milestone]. + +### Added +- :star: The `NewKeywords` sniff will now also sniff for `yield from` which was introduced in PHP 7.0. [#477](https://github.com/PHPCompatibility/PHPCompatibility/pull/477). Fixes [#476](https://github.com/PHPCompatibility/PHPCompatibility/issues/476) +- :books: The LGPL-3.0 license. [#447](https://github.com/PHPCompatibility/PHPCompatibility/pull/447) + +### Changed +- :rewind: The `NewExecutionDirectives` sniff will now also report on execution directives when used in combination with PHPCS 2.0.0-2.3.3. [#451](https://github.com/PHPCompatibility/PHPCompatibility/pull/451) +- :rewind: The `getMethodParameters()` utility method will no longer break when used with PHPCS 1.5.x < 1.5.6. This affected a number of sniffs. [#452](https://github.com/PHPCompatibility/PHPCompatibility/pull/452) +- :rewind: The `inUseScope()` utility method will no longer break when used with PHPCS 2.0.0 - 2.2.0. This affected a number of sniffs. [#454](https://github.com/PHPCompatibility/PHPCompatibility/pull/454) +- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#443](https://github.com/PHPCompatibility/PHPCompatibility/pull/443), [#474](https://github.com/PHPCompatibility/PHPCompatibility/pull/474) +- :pencil2: Renamed a test file for consistency. [#453](https://github.com/PHPCompatibility/PHPCompatibility/pull/453) +- :wrench: Code style clean up. [#429](https://github.com/PHPCompatibility/PHPCompatibility/pull/429) +- :wrench: Prevent Composer installing PHPCS 3.x. **_PHPCS 3.x is not (yet) supported by the PHPCompatibility standard, but will be in the near future._** [#444](https://github.com/PHPCompatibility/PHPCompatibility/pull/444) +- :green_heart: The code base will now be checked for consistent code style during build testing. [#429](https://github.com/PHPCompatibility/PHPCompatibility/pull/429) +- :green_heart: The sniffs are now also tested against HHVM for consistent results. _Note: the sniffs do not contain any HHVM specific checks nor is there any intention to add them at this time._ [#450](https://github.com/PHPCompatibility/PHPCompatibility/pull/450) +- :books: Made it explicit that - at this moment - PHPCS 3.x is not (yet) supported. [#444](https://github.com/PHPCompatibility/PHPCompatibility/pull/444) +- :books: Minor improvements to the Readme. [#448](https://github.com/PHPCompatibility/PHPCompatibility/pull/448), [#449](https://github.com/PHPCompatibility/PHPCompatibility/pull/449), [#468](https://github.com/PHPCompatibility/PHPCompatibility/pull/468) +- :books: Minor improvements to the Contributing guidelines. [#467](https://github.com/PHPCompatibility/PHPCompatibility/pull/467) + +### Removed +- :no_entry_sign: The `DefaultTimeZoneRequired` sniff. This sniff was checking server settings rather than code. [#458](https://github.com/PHPCompatibility/PHPCompatibility/pull/458). Fixes [#457](https://github.com/PHPCompatibility/PHPCompatibility/issues/457) +- :no_entry_sign: The `NewMagicClassConstant` sniff as introduced in v 7.1.4 contained two additional checks for not strictly compatibility related issues. One of these was plainly wrong, the other opinionated. Both have been removed. [#442](https://github.com/PHPCompatibility/PHPCompatibility/pull/442). Fixes [#436](https://github.com/PHPCompatibility/PHPCompatibility/issues/436) + +### Fixed +- :bug: `NewClass` sniff: was reporting an incorrect introduction version number for a few of the Exception classes. [#441](https://github.com/PHPCompatibility/PHPCompatibility/pull/441). Fixes [#440](https://github.com/PHPCompatibility/PHPCompatibility/issues/440). +- :bug: `ForbiddenBreakContinueVariableArguments` sniff: was incorrectly reporting an error if the `break` or `continue` was followed by a PHP closing tag (breaking out of PHP). [#462](https://github.com/PHPCompatibility/PHPCompatibility/pull/462). Fixes [#460](https://github.com/PHPCompatibility/PHPCompatibility/issues/460) +- :bug: `ForbiddenGlobalVariableVariable` sniff: was incorrectly reporting an error if the `global` statement was followed by a PHP closing tag (breaking out of PHP). [#463](https://github.com/PHPCompatibility/PHPCompatibility/pull/463). +- :bug: `DeprecatedFunctions` sniff: was reporting false positives for classes using the same name as a deprecated function. [#465](https://github.com/PHPCompatibility/PHPCompatibility/pull/465). Fixes [#464](https://github.com/PHPCompatibility/PHPCompatibility/issues/464) + +### Credits +Thanks go out to [Juliette Reinders Folmer] and [Mark Clements] for their contributions to this version. :clap: + + +## [7.1.4] - 2017-05-06 + +See all related issues and PRs in the [7.1.4 milestone]. + +### Added +- :star2: New `CaseSensitiveKeywords` sniff to detect use of non-lowercase `self`, `static` and `parent` keywords which could cause compatibility issues pre-PHP 5.5. [#382](https://github.com/PHPCompatibility/PHPCompatibility/pull/382) +- :star2: New `ConstantArraysUsingConst` sniff to detect constants defined using the `const` keyword being assigned an array value which was not supported prior to PHP 5.6. [#397](https://github.com/PHPCompatibility/PHPCompatibility/pull/397) +- :star2: New `ForbiddenClosureUseVariableNames` sniff to detect PHP 7.1 forbidden variable names in closure use statements. [#386](https://github.com/PHPCompatibility/PHPCompatibility/pull/386). Fixes [#374](https://github.com/PHPCompatibility/PHPCompatibility/issues/374) +- :star2: New `NewArrayStringDereferencing` sniff to detect array and string literal dereferencing as introduced in PHP 5.5. [#388](https://github.com/PHPCompatibility/PHPCompatibility/pull/388) +- :star2: New `NewHeredocInitialize` sniff to detect initialization of static variables and class properties/constants using the heredoc syntax which is supported since PHP 5.3. [#391](https://github.com/PHPCompatibility/PHPCompatibility/pull/391). Fixes [#51](https://github.com/PHPCompatibility/PHPCompatibility/issues/51) +- :star2: New `NewMagicClassConstant` sniff to detect use of the magic `::class` constant as introduced in PHP 5.5. [#403](https://github.com/PHPCompatibility/PHPCompatibility/pull/403). Fixes [#364](https://github.com/PHPCompatibility/PHPCompatibility/issues/364). +- :star2: New `NewUseConstFunction` sniff to detect use statements importing constants and functions as introduced in PHP 5.6. [#401](https://github.com/PHPCompatibility/PHPCompatibility/pull/401) +- :star: `DeprecatedFunctions` sniff: recognize PHP 7.2 deprecated GD functions. [#392](https://github.com/PHPCompatibility/PHPCompatibility/pull/392) +- :star: `DeprecatedIniDirectives` sniff: recognize PHP 7.2 deprecated `mbstring.func_overload` directive. [#377](https://github.com/PHPCompatibility/PHPCompatibility/pull/377) +- :star: `NewClasses` sniff: check for the PHP 5.1 `libXMLError` class. [#412](https://github.com/PHPCompatibility/PHPCompatibility/pull/412) +- :star: `NewClasses` sniff: recognize all native PHP Exception classes. [#418](https://github.com/PHPCompatibility/PHPCompatibility/pull/418) +- :star: `NewClosure` sniff: check for closures being declared as static and closures using `$this`. Both of which was not supported pre-PHP 5.4. [#389](https://github.com/PHPCompatibility/PHPCompatibility/pull/389). Fixes [#24](https://github.com/PHPCompatibility/PHPCompatibility/issues/24). +- :star: `NewFunctionParameters` sniff: recognize new `exclude_disabled` parameter for the `get_defined_functions()` function as introduced in PHP 7.0.15. [#375](https://github.com/PHPCompatibility/PHPCompatibility/pull/375) +- :star: `NewFunctions` sniff: recognize new PHP 7.2 socket related functions. [#376](https://github.com/PHPCompatibility/PHPCompatibility/pull/376) +- :star: `NewInterfaces` sniff: check for some more PHP native interfaces. [#411](https://github.com/PHPCompatibility/PHPCompatibility/pull/411) +- :star: New `isClassProperty()`, `isClassConstant()` and `validDirectScope()` utility methods to the `PHPCompatibility_Sniff` class. [#393](https://github.com/PHPCompatibility/PHPCompatibility/pull/393), [#391](https://github.com/PHPCompatibility/PHPCompatibility/pull/391). +- :star: New `getTypeHintsFromFunctionDeclaration()` utility method to the `PHPCompatibility_Sniff` class. [#414](https://github.com/PHPCompatibility/PHPCompatibility/pull/414). +- :umbrella: Unit tests against false positives for the `NewMagicMethods` sniff. [#381](https://github.com/PHPCompatibility/PHPCompatibility/pull/381) +- :umbrella: More unit tests for the `getTestVersion()` utility method. [#405](https://github.com/PHPCompatibility/PHPCompatibility/pull/405), [#430](https://github.com/PHPCompatibility/PHPCompatibility/pull/430) +- :green_heart: The XML of the ruleset will now be validated and checked for consistent code style during the build testing by Travis. [#433](https://github.com/PHPCompatibility/PHPCompatibility/pull/433) +- :books: Readme: information about setting `installed_paths` via a custom ruleset. [#407](https://github.com/PHPCompatibility/PHPCompatibility/pull/407) +- :books: `Changelog.md` file containing a record of notable changes since the first tagged release. [#421](https://github.com/PHPCompatibility/PHPCompatibility/pull/421) + +### Changed +- :pushpin: The `ForbiddenNamesAsDeclared` sniff will now emit `warning`s for soft reserved keywords. [#406](https://github.com/PHPCompatibility/PHPCompatibility/pull/406), [#370](https://github.com/PHPCompatibility/PHPCompatibility/pull/370). +- :pushpin: The `ForbiddenNames` sniff will now allow for the more liberal rules for usage of reserved keywords as of PHP 7.0. [#417](https://github.com/PHPCompatibility/PHPCompatibility/pull/417) +- :pushpin: The `InternalInterfaces`, `NewClasses`, `NewConstVisibility`, `NewInterfaces`, `NewMagicMethods`, `NonStaticMagicMethods` and `RemovedGlobalVariables` sniffs will now also sniff for and correctly report violations in combination with anonymous classes. [#378](https://github.com/PHPCompatibility/PHPCompatibility/pull/378), [#383](https://github.com/PHPCompatibility/PHPCompatibility/pull/383), [#393](https://github.com/PHPCompatibility/PHPCompatibility/pull/393), [#394](https://github.com/PHPCompatibility/PHPCompatibility/pull/394), [#395](https://github.com/PHPCompatibility/PHPCompatibility/pull/395), [#396](https://github.com/PHPCompatibility/PHPCompatibility/pull/396). Fixes [#351](https://github.com/PHPCompatibility/PHPCompatibility/issues/351) and [#333](https://github.com/PHPCompatibility/PHPCompatibility/issues/333). +- :pushpin: The `NewClasses` and `NewInterfaces` sniffs will now also report on new classes/interfaces when used as type hints. [#414](https://github.com/PHPCompatibility/PHPCompatibility/pull/414), [#416](https://github.com/PHPCompatibility/PHPCompatibility/pull/416). Fixes [#352](https://github.com/PHPCompatibility/PHPCompatibility/issues/352) +- :pushpin: The `NewClasses` sniff will now also report on Exception classes when used in (multi-)`catch` statements. [#418](https://github.com/PHPCompatibility/PHPCompatibility/pull/418). Fixes [#373](https://github.com/PHPCompatibility/PHPCompatibility/issues/373). +- :pushpin: The `NewScalarTypeDeclarations` sniff will now report on new type hints even when the type hint is nullable. [#379](https://github.com/PHPCompatibility/PHPCompatibility/pull/379) +- :twisted_rightwards_arrows: The `NewNowdoc` sniff has been renamed to `NewNowdocQuotedHeredoc` and will now also check for double quoted heredoc identifiers as introduced in PHP 5.3. [#390](https://github.com/PHPCompatibility/PHPCompatibility/pull/390) +- :rewind: The `NewClasses` sniff will now also report anonymous classes which `extend` a new sniff when used in combination with PHPCS 2.4.0-2.8.0. [#432](https://github.com/PHPCompatibility/PHPCompatibility/pull/432). Fixes [#334](https://github.com/PHPCompatibility/PHPCompatibility/issues/334). +- :pencil2: `NewFunctionParameter` sniff: version number precision for two parameters. [#384](https://github.com/PHPCompatibility/PHPCompatibility/pull/384), [#428](https://github.com/PHPCompatibility/PHPCompatibility/pull/428) +- :umbrella: Skipping two unit tests for the `ForbiddenClosureUseVariable` sniff when run on PHPCS 2.5.1 as these cause an infinite loop due to an upstream bug. [#408](https://github.com/PHPCompatibility/PHPCompatibility/pull/408) +- :umbrella: Skipping unit tests involving `trait`s in combination with PHP < 5.4 and PHPCS < 2.4.0 as `trait`s are not recognized in those circumstances. [#431](https://github.com/PHPCompatibility/PHPCompatibility/pull/431) +- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#385](https://github.com/PHPCompatibility/PHPCompatibility/pull/385), [#387](https://github.com/PHPCompatibility/PHPCompatibility/pull/387), [#415](https://github.com/PHPCompatibility/PHPCompatibility/pull/415), [#423](https://github.com/PHPCompatibility/PHPCompatibility/pull/423), [#424](https://github.com/PHPCompatibility/PHPCompatibility/pull/424) +- :recycle: Minor simplification of the PHPUnit 6 compatibility layer and other test code. [#426](https://github.com/PHPCompatibility/PHPCompatibility/pull/426), [#425](https://github.com/PHPCompatibility/PHPCompatibility/pull/425) +- General housekeeping. [#398](https://github.com/PHPCompatibility/PHPCompatibility/pull/398), [#400](https://github.com/PHPCompatibility/PHPCompatibility/pull/400) +- :wrench: Minor tweaks to the Travis build script. [#409](https://github.com/PHPCompatibility/PHPCompatibility/pull/409) +- :green_heart: The sniffs are now also tested against PHP nightly for consistent results. [#380](https://github.com/PHPCompatibility/PHPCompatibility/pull/380) + +### Fixed +- :fire: Using unbounded ranges in `testVersion` resulted in unreported errors when used with sniffs using the `supportsBelow()` method. This affected the results of approximately half the sniffs. [#430](https://github.com/PHPCompatibility/PHPCompatibility/pull/430) +- :bug: The `ForbiddenNames` sniff would throw false positives for `use` statements with the `final` modifier in traits. [#402](https://github.com/PHPCompatibility/PHPCompatibility/pull/402). +- :bug: The `ForbiddenNames` sniff would fail to report on functions declared to return by reference using a reserved keyword as the function name. [#413](https://github.com/PHPCompatibility/PHPCompatibility/pull/413) +- :bug: The `ForbiddenNames` sniff would only examine the first part of a namespace and not report on reserved keywords used in subsequent parts of a nested namespace. [#419](https://github.com/PHPCompatibility/PHPCompatibility/pull/419) +- :bug: The `ForbiddenNames` sniff would not always correctly report on use statements importing constants or functions using reserved keywords. [#420](https://github.com/PHPCompatibility/PHPCompatibility/pull/420) +- :bug: The `NewKeywords` sniff would sometimes fail to report on the `const` keyword when used in a class, but not for a class constant. [#424](https://github.com/PHPCompatibility/PHPCompatibility/pull/424) +- :green_heart: PHPCS has released version 3.0 and updated the `master` branch to reflect this. This was causing the builds to fail. [#422](https://github.com/PHPCompatibility/PHPCompatibility/pull/422) + +### Credits +Thanks go out to [Juliette Reinders Folmer] and [Mark Clements] for their contributions to this version. :clap: + + +## [7.1.3] - 2017-04-02 + +See all related issues and PRs in the [7.1.3 milestone]. + +### Added +- :zap: The `testVersion` config parameter now allows for specifying unbounded ranges. + For example: specifying `-5.6` means: check for compatibility with all PHP versions up to and including PHP 5.6; + Specifying `7.0-` means: check for compatibility with all PHP versions from PHP 7.0 upwards. + For more information about setting the `testVersion`, see [Using the compatibility sniffs](https://github.com/PHPCompatibility/PHPCompatibility#using-the-compatibility-sniffs) in the readme. +- :umbrella: Unit test for multi-line short arrays for the `ShortArray` sniff. [#347](https://github.com/PHPCompatibility/PHPCompatibility/pull/347) +- :umbrella: Various additional unit tests against false positives. [#345](https://github.com/PHPCompatibility/PHPCompatibility/pull/345), [#369](https://github.com/PHPCompatibility/PHPCompatibility/pull/369) +- :umbrella: Unit tests for the `supportsBelow()`, `supportsAbove()` and `getTestVersion()` utility methods. [#363](https://github.com/PHPCompatibility/PHPCompatibility/pull/363) +- :books: Readme: information about installation of the standard using git check-out. [#349](https://github.com/PHPCompatibility/PHPCompatibility/pull/349) +- :books: `Contributing.md` file with information about reporting bugs, requesting features, making pull requests and running the unit tests. [#350](https://github.com/PHPCompatibility/PHPCompatibility/pull/350) + +### Changed +- :pushpin: The `ForbiddenFunctionParametersWithSameName`, `NewScalarTypeDeclarations`, `ParameterShadowSuperGlobals` sniff will now also sniff for and report violations in closures. [#331](https://github.com/PHPCompatibility/PHPCompatibility/pull/331) +- :twisted_rightwards_arrows: :rewind: The check for the PHP 5.3 `nowdoc` structure has been moved from the `NewKeywords` sniff to a new stand-alone `NewNowdoc` sniff which will now also recognize this structure when the sniffs are run on PHP 5.2. [#335](https://github.com/PHPCompatibility/PHPCompatibility/pull/335) +- :rewind: The `ForbiddenNames` sniff will now also correctly recognize reserved keywords used in a declared namespace when run on PHP 5.2. [#362](https://github.com/PHPCompatibility/PHPCompatibility/pull/362) +- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#360](https://github.com/PHPCompatibility/PHPCompatibility/pull/360) +- :recycle: The unit tests would previously run each test case file against all PHPCompatibility sniffs. Now, they will only be tested against the sniff which the test case file is intended to test. This allows for more test cases to be tested, more precise testing in combination with `testVersion` settings and makes the unit tests run ~6 x faster. + Relevant additional unit tests have been added and others adjusted. [#369](https://github.com/PHPCompatibility/PHPCompatibility/pull/369) +- :recycle: Refactoring/tidying up of some unit test code. [#343](https://github.com/PHPCompatibility/PHPCompatibility/pull/343), [#345](https://github.com/PHPCompatibility/PHPCompatibility/pull/345), [#356](https://github.com/PHPCompatibility/PHPCompatibility/pull/356), [#355](https://github.com/PHPCompatibility/PHPCompatibility/pull/355), [#359](https://github.com/PHPCompatibility/PHPCompatibility/pull/359) +- General housekeeping. [#346](https://github.com/PHPCompatibility/PHPCompatibility/pull/346) +- :books: Readme: Clarify minimum requirements and influence on the results. [#348](https://github.com/PHPCompatibility/PHPCompatibility/pull/348) + +### Removed +- :twisted_rightwards_arrows: Removed the `LongArrays` sniff. The checks it contained have been moved into the `RemovedGlobalVariables` sniff. Both sniffs essentially did the same thing, just for different PHP native superglobals. [#354](https://github.com/PHPCompatibility/PHPCompatibility/pull/354) + +### Fixed +- :bug: The `PregReplaceEModifier` sniff would throw a false positive if a quote character was used as the regex delimiter. [#357](https://github.com/PHPCompatibility/PHPCompatibility/pull/357) +- :bug: `RemovedGlobalVariables` sniff would report false positives for class properties shadowing the removed `$HTTP_RAW_POST_DATA` variables. [#354](https://github.com/PHPCompatibility/PHPCompatibility/pull/354). +- :bug: The `getFQClassNameFromNewToken()` utility function could go into an infinite loop causing PHP to run out of memory when examining unfinished code (examination during live coding). [#338](https://github.com/PHPCompatibility/PHPCompatibility/pull/338), [#342](https://github.com/PHPCompatibility/PHPCompatibility/pull/342) +- :bug: The `determineNamespace()` utility method would in certain cases not break out a loop. [#358](https://github.com/PHPCompatibility/PHPCompatibility/pull/358) +- :wrench: Travis script: Minor tweak for PHP 5.2 compatibility. [#341](https://github.com/PHPCompatibility/PHPCompatibility/pull/341) +- :wrench: The unit test suite is now also compatible with PHPUnit 6. [#365](https://github.com/PHPCompatibility/PHPCompatibility/pull/365) +- :books: Readme: Typo in the composer instructions. [#344](https://github.com/PHPCompatibility/PHPCompatibility/pull/344) + +### Credits +Thanks go out to [Arthur Edamov], [Juliette Reinders Folmer], [Mark Clements] and [Tadas Juozapaitis] for their contributions to this version. :clap: + + +## [7.1.2] - 2017-02-17 + +See all related issues and PRs in the [7.1.2 milestone]. + +### Added +- :star2: New `VariableVariables` sniff to detect variables variables for which the behaviour has changed in PHP 7.0. [#310](https://github.com/PHPCompatibility/PHPCompatibility/pull/310) Fixes [#309](https://github.com/PHPCompatibility/PHPCompatibility/issues/309). +- :star: The `NewReturnTypeDeclarations` sniff will now also sniff for non-scalar return type declarations, i.e. `array`, `callable`, `self` or a class name. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) +- :star: The `NewLanguageConstructs` sniff will now also sniff for the null coalesce equal operator `??=`. This operator is slated to be introduced in PHP 7.2 and PHPCS already accounts for it. [#340](https://github.com/PHPCompatibility/PHPCompatibility/pull/340) +- :star: New `getReturnTypeHintToken()` utility method to the `PHPCompatibility_Sniff` class to retrieve return type hints from function declarations in a cross-PHPCS-version compatible way. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323). +- :star: New `stripVariables()` utility method to the `PHPCompatibility_Sniff` class to strip variables from interpolated text strings. [#341](https://github.com/PHPCompatibility/PHPCompatibility/pull/314). +- :umbrella: Additional unit tests covering previously uncovered code. [#308](https://github.com/PHPCompatibility/PHPCompatibility/pull/308) + +### Changed +- :pushpin: The `MbstringReplaceEModifier`, `PregReplaceEModifier` and `NewExecutionDirectives` sniffs will now also correctly interpret double quoted text strings with interpolated variables. [#341](https://github.com/PHPCompatibility/PHPCompatibility/pull/314), [#324](https://github.com/PHPCompatibility/PHPCompatibility/pull/324). +- :pushpin: The `NewNullableTypes` sniff will now also report on nullable (return) type hints when used with closures. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) +- :pushpin: The `NewReturnTypeDeclarations` sniff will now also report on return type hints when used with closures. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) +- :pushpin: Allow for anonymous classes in the `inClassScope()` utility method. [#315](https://github.com/PHPCompatibility/PHPCompatibility/pull/315) +- :pushpin: The function call parameter related utility functions can now also be used to get the individual items from an array declaration. [#300](https://github.com/PHPCompatibility/PHPCompatibility/pull/300) +- :twisted_rightwards_arrows: The `NewScalarReturnTypeDeclarations` sniff has been renamed to `NewReturnTypeDeclarations`. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) +- :rewind: The `ForbiddenNames` sniff will now also correctly ignore anonymous classes when used in combination with PHPCS < 2.3.4. [#319](https://github.com/PHPCompatibility/PHPCompatibility/pull/319) +- :rewind: The `NewAnonymousClasses` sniff will now correctly recognize and report on anonymous classes when used in combination with PHPCS < 2.5.2. [#325](https://github.com/PHPCompatibility/PHPCompatibility/pull/325) +- :rewind: The `NewGroupUseDeclarations` sniff will now correctly recognize and report on group use statements when used in combination with PHPCS < 2.6.0. [#320](https://github.com/PHPCompatibility/PHPCompatibility/pull/320) +- :rewind: The `NewNullableTypes` sniff will now correctly recognize and report on nullable return types when used in combination with PHPCS < 2.6.0. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) +- :rewind: The `NewReturnTypeDeclarations` sniff will now correctly recognize and report on new return types when used in combination with PHPCS < 2.6.0. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) +- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#317](https://github.com/PHPCompatibility/PHPCompatibility/pull/317) +- :recycle: Defer to upstream `hasCondition()` utility method where appropriate. [#315](https://github.com/PHPCompatibility/PHPCompatibility/pull/315) +- :recycle: Minor refactoring of some unit test code. [#304](https://github.com/PHPCompatibility/PHPCompatibility/pull/304), [#303](https://github.com/PHPCompatibility/PHPCompatibility/pull/303), [#318](https://github.com/PHPCompatibility/PHPCompatibility/pull/318) +- :wrench: All unit tests now have appropriate `@group` annotations allowing for quicker/easier testing of a select group of tests/sniffs. [#305](https://github.com/PHPCompatibility/PHPCompatibility/pull/305) +- :wrench: All unit tests now have appropriate `@covers` annotations to improve code coverage reporting and remove bleed through of accidental coverage. [#307](https://github.com/PHPCompatibility/PHPCompatibility/pull/307) +- :wrench: Minor tweaks to the travis script. [#322](https://github.com/PHPCompatibility/PHPCompatibility/pull/322) +- :green_heart: The PHPCompatibility code base itself will now be checked for cross-version compatibility during build testing. [#322](https://github.com/PHPCompatibility/PHPCompatibility/pull/322) + +### Fixed +- :bug: The `ConstantArraysUsingDefine` sniff would throw false positives if the value of the `define()` was retrieved via a function call and an array parameter was passed. [#327](https://github.com/PHPCompatibility/PHPCompatibility/pull/327) +- :bug: The `ForbiddenCallTimePassByReference` sniff would throw false positives on assign by reference within function calls or conditions. [#302](https://github.com/PHPCompatibility/PHPCompatibility/pull/302) Fixes the last two cases reported in [#68](https://github.com/PHPCompatibility/PHPCompatibility/issues/68#issuecomment-231366445) +- :bug: The `ForbiddenGlobalVariableVariableSniff` sniff would only examine the first variable in a `global ...` statement causing unreported issues if subsequent variables were variable variables. [#316](https://github.com/PHPCompatibility/PHPCompatibility/pull/316) +- :bug: The `NewKeywords` sniff would throw a false positive for the `const` keyword when encountered in an interface. [#312](https://github.com/PHPCompatibility/PHPCompatibility/pull/312) +- :bug: The `NewNullableTypes` sniff would not report on nullable return types for namespaced classnames used as a type hint. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) +- :bug: The `PregReplaceEModifier` sniff would always consider the first parameter passed as a single regex, while it could also be an array of regexes. This led to false positives and potentially unreported use of the `e` modifier when an array of regexes was passed. [#300](https://github.com/PHPCompatibility/PHPCompatibility/pull/300) +- :bug: The `PregReplaceEModifier` sniff could misidentify the regex delimiter when the regex to be examined was concatenated together from various text strings taken from a compound parameter leading to false positives. [#300](https://github.com/PHPCompatibility/PHPCompatibility/pull/300) +- :white_check_mark: Compatibility with PHPCS 2.7.x. Deal with changed behaviour of the upstream PHP tokenizer and utility function(s). [#313](https://github.com/PHPCompatibility/PHPCompatibility/pull/313), [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323), [#326](https://github.com/PHPCompatibility/PHPCompatibility/pull/326), [#340](https://github.com/PHPCompatibility/PHPCompatibility/pull/340) + +### Credits +Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: + + +## [7.1.1] - 2016-12-14 + +See all related issues and PRs in the [7.1.1 milestone]. + +### Added +- :star: `ForbiddenNamesAsDeclared` sniff: detection of the PHP 7.1 `iterable` and `void` reserved keywords when used to name classes, interfaces or traits. [#298](https://github.com/PHPCompatibility/PHPCompatibility/pull/298) + +### Fixed +- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff would incorrectly throw an error if the `clone` keyword was used with parenthesis. [#299](https://github.com/PHPCompatibility/PHPCompatibility/pull/299). Fixes [#284](https://github.com/PHPCompatibility/PHPCompatibility/issues/284) + +### Credits +Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: + + +## [7.1.0] - 2016-12-14 + +See all related issues and PRs in the [7.1.0 milestone]. + +### Added +- :star: New `stringToErrorCode()`, `arrayKeysToLowercase()` and `addMessage()` utility methods to the `PHPCompatibility_Sniff` class. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291). + +### Changed +- :pushpin: All sniff error messages now have modular error codes allowing for selectively disabling individual checks - and even selectively disabling individual sniff for specific files - without disabling the complete sniff. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) +- :pencil2: Minor changes to some of the error message texts for consistency across sniffs. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) +- :recycle: Refactored the complex version sniffs to reduce code duplication. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) +- :recycle: Miscellaneous other refactoring for improved performance and sniff accuracy. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) +- :umbrella: The unit tests for the `RemovedExtensions` sniff now verify that the correct alternative extension is being suggested. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) + +### Credits +Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: + + +## [7.0.8] - 2016-10-31 - :ghost: Spooky! :jack_o_lantern: + +See all related issues and PRs in the [7.0.8 milestone]. + +### Added +- :star2: New `ForbiddenNamesAsDeclared` sniff: detection of the [other reserved keywords](http://php.net/manual/en/reserved.other-reserved-words.php) which are reserved as of PHP 7.0 (or higher). [#287](https://github.com/PHPCompatibility/PHPCompatibility/pull/287). Fixes [#115](https://github.com/PHPCompatibility/PHPCompatibility/issues/115). + These were previously sniffed for by the `ForbiddenNames` and `ForbiddenNamesAsInvokedFunctions` sniffs causing false positives as the rules for their reservation are different from the rules for "normal" [reserved keywords](http://php.net/manual/en/reserved.keywords.php). +- :star: New `inUseScope()` utility method to the `PHPCompatibility_Sniff` class which handles PHPCS cross-version compatibility when determining the scope of a `use` statement. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). +- :umbrella: More unit tests for the `ForbiddenNames` sniff. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). + +### Changed +- :pushpin: _Deprecated_ functionality should throw a `warning`. _Removed_ or otherwise unavailable functionality should throw an `error`. This distinction was previously not consistently applied everywhere. [#286](https://github.com/PHPCompatibility/PHPCompatibility/pull/286) + This change affects the following sniffs: + * `DeprecatedPHP4StyleConstructors` will now throw a `warning` instead of an `error` for deprecated PHP4 style class constructors. + * `ForbiddenCallTimePassByReference` will now throw a `warning` if the `testVersion` is `5.3` and an `error` if the `testVersion` if `5.4` or higher. + * `MbstringReplaceEModifier` will now throw a `warning` instead of an `error` for usage of the deprecated `e` modifier. + * `PregReplaceEModifier` will now throw a `warning` if the `testVersion` is `5.5` or `5.6` and an `error` if the `testVersion` if `7.0` or higher. Fixes [#290](https://github.com/PHPCompatibility/PHPCompatibility/issues/290). + * `TernaryOperators` will now throw an `error` when the `testVersion` < `5.3` and the middle part has been omitted. + * `ValidIntegers` will now throw a `warning` when an invalid binary integer is detected. +- :pencil2: `DeprecatedFunctions` and `DeprecatedIniDirectives` sniffs: minor change in the sniff error message text. Use _"removed"_ rather than the ominous _"forbidden"_. [#285](https://github.com/PHPCompatibility/PHPCompatibility/pull/285) + Also updated relevant internal variable names and documentation to match. + +### Fixed +- :bug: `ForbiddenNames` sniff would throw false positives for `use` statements which changed the visibility of methods in traits. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). +- :bug: `ForbiddenNames` sniff would not report reserved keywords when used in combination with `use function` or `use const`. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). +- :bug: `ForbiddenNames` sniff would potentially - unintentionally - skip over tokens, thereby - potentially - not reporting all errors. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). +- :wrench: Composer config: `prefer-stable` should be a root element of the json file. Fixes [#277](https://github.com/PHPCompatibility/PHPCompatibility/issues/277). + +### Credits +Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: + + +## [7.0.7] - 2016-10-20 + +See all related issues and PRs in the [7.0.7 milestone]. + +### Added +- :star2: New `ForbiddenBreakContinueOutsideLoop` sniff: verify that `break`/`continue` is not used outside of a loop structure. This will cause fatal errors since PHP 7.0. [#278](https://github.com/PHPCompatibility/PHPCompatibility/pull/278). Fixes [#275](https://github.com/PHPCompatibility/PHPCompatibility/issues/275) +- :star2: New `NewConstVisibility` sniff: detect visibility indicators for `class` and `interface` constants as introduced in PHP 7.1. [#280](https://github.com/PHPCompatibility/PHPCompatibility/pull/280). Fixes [#249](https://github.com/PHPCompatibility/PHPCompatibility/issues/249) +- :star2: New `NewHashAlgorithms` sniff to check used hash algorithms against the PHP version in which they were introduced. [#242](https://github.com/PHPCompatibility/PHPCompatibility/pull/242) +- :star2: New `NewMultiCatch` sniff: detect catch statements catching multiple Exceptions as introduced in PHP 7.1. [#281](https://github.com/PHPCompatibility/PHPCompatibility/pull/281). Fixes [#251](https://github.com/PHPCompatibility/PHPCompatibility/issues/251) +- :star2: New `NewNullableTypes` sniff: detect nullable parameter and return type hints (only supported in PHPCS >= 2.3.4) as introduced in PHP 7.1. [#282](https://github.com/PHPCompatibility/PHPCompatibility/pull/282). Fixes [#247](https://github.com/PHPCompatibility/PHPCompatibility/issues/247) +- :star: `DeprecatedIniDirectives` sniff: recognize PHP 7.1 removed `session` ini directives. [#256](https://github.com/PHPCompatibility/PHPCompatibility/pull/256) +- :star: `NewFunctions` sniff: recognize new `socket_export_stream()` function as introduced in PHP 7.0.7. [#264](https://github.com/PHPCompatibility/PHPCompatibility/pull/264) +- :star: `NewFunctions` sniff: recognize new `curl_...()`, `is_iterable()`, `pcntl_async_signals()`, `session_create_id()`, `session_gc()` functions as introduced in PHP 7.1. [#273](https://github.com/PHPCompatibility/PHPCompatibility/pull/273) +- :star: `NewFunctionParameters` sniff: recognize new OpenSSL function parameters as introduced in PHP 7.1. [#258](https://github.com/PHPCompatibility/PHPCompatibility/pull/258) +- :star: `NewIniDirectives` sniff: recognize new `session` ini directives as introduced in PHP 7.1. [#259](https://github.com/PHPCompatibility/PHPCompatibility/pull/259) +- :star: `NewScalarReturnTypeDeclarations` sniff: recognize PHP 7.1 `void` return type hint. [#250](https://github.com/PHPCompatibility/PHPCompatibility/pull/250) +- :star: `NewScalarTypeDeclarations` sniff: recognize PHP 7.1 `iterable` type hint. [#255](https://github.com/PHPCompatibility/PHPCompatibility/pull/255) +- :star: Recognize the PHP 7.1 deprecated `mcrypt` functionality in the `RemovedExtensions`, `DeprecatedFunctions` and `DeprecatedIniDirectives` sniffs. [#257](https://github.com/PHPCompatibility/PHPCompatibility/pull/257) + +### Changed +- :pushpin: `LongArrays` sniff used to only throw `warning`s. It will now throw `error`s for PHP versions in which the long superglobals have been removed. [#270](https://github.com/PHPCompatibility/PHPCompatibility/pull/270) +- :pushpin: The `NewIniDirectives` sniff used to always throw an `warning`. Now it will throw an `error` when a new ini directive is used in combination with `ini_set()`. [#246](https://github.com/PHPCompatibility/PHPCompatibility/pull/246). +- :pushpin: `RemovedHashAlgorithms` sniff: also recognize removed algorithms when used with the PHP 5.5+ `hash_pbkdf2()` function. [#240](https://github.com/PHPCompatibility/PHPCompatibility/pull/240) +- :pushpin: Properly recognize nullable type hints in the `getMethodParameters()` utility method. [#282](https://github.com/PHPCompatibility/PHPCompatibility/pull/282) +- :pencil2: `DeprecatedPHP4StyleConstructors` sniff: minor error message text fix. [#236](https://github.com/PHPCompatibility/PHPCompatibility/pull/236) +- :pencil2: `NewIniDirectives` sniff: improved precision for the introduction version numbers being reported. [#246](https://github.com/PHPCompatibility/PHPCompatibility/pull/246) +- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#238](https://github.com/PHPCompatibility/PHPCompatibility/pull/238), [#244](https://github.com/PHPCompatibility/PHPCompatibility/pull/244), [#240](https://github.com/PHPCompatibility/PHPCompatibility/pull/240), [#276](https://github.com/PHPCompatibility/PHPCompatibility/pull/276) +- :umbrella: Re-activate the unit tests for the `NewScalarReturnTypeDeclarations` sniff. [#250](https://github.com/PHPCompatibility/PHPCompatibility/pull/250) + +### Fixed +- :bug: The `DeprecatedPHP4StyleConstructors` sniff would not report errors when the case of the class name and the PHP4 constructor function name did not match. [#236](https://github.com/PHPCompatibility/PHPCompatibility/pull/236) +- :bug: `LongArrays` sniff would report false positives for class properties shadowing removed PHP superglobals. [#270](https://github.com/PHPCompatibility/PHPCompatibility/pull/270). Fixes [#268](https://github.com/PHPCompatibility/PHPCompatibility/issues/268). +- :bug: The `NewClasses` sniff would not report errors when the case of the class name used and "official" class name did not match. [#237](https://github.com/PHPCompatibility/PHPCompatibility/pull/237) +- :bug: The `NewIniDirectives` sniff would report violations against the PHP version in which the ini directive was introduced. This should be the version below it. [#246](https://github.com/PHPCompatibility/PHPCompatibility/pull/246) +- :bug: `PregReplaceEModifier` sniff would report false positives for compound regex parameters with different quote types. [#266](https://github.com/PHPCompatibility/PHPCompatibility/pull/266). Fixes [#265](https://github.com/PHPCompatibility/PHPCompatibility/issues/265). +- :bug: `RemovedGlobalVariables` sniff would report false positives for lowercase/mixed cased variables shadowing superglobals. [#245](https://github.com/PHPCompatibility/PHPCompatibility/pull/245). +- :bug: The `RemovedHashAlgorithms` sniff would not report errors when the case of the hash function name used and "official" class name did not match. [#240](https://github.com/PHPCompatibility/PHPCompatibility/pull/240) +- :bug: The `ShortArray` sniff would report all violations on the line of the PHP open tag, not on the lines of the short array open/close tags. [#238](https://github.com/PHPCompatibility/PHPCompatibility/pull/238) + +### Credits +Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: + + +## [7.0.6] - 2016-09-23 + +See all related issues and PRs in the [7.0.6 milestone]. + +### Added +- :star: New `stripQuotes()` utility method in the `PHPCompatibility_Sniff` base class to strip quotes which surround text strings in a consistent manner. [#224](https://github.com/PHPCompatibility/PHPCompatibility/pull/224) +- :books: Readme: Add _PHP Version Support_ section. [#225](https://github.com/PHPCompatibility/PHPCompatibility/pull/225) + +### Changed +- :pushpin: The `ForbiddenCallTimePassByReference` sniff will now also report the deprecation as of PHP 5.3, not just its removal as of PHP 5.4. [#203](https://github.com/PHPCompatibility/PHPCompatibility/pull/203) +- :pushpin: The `NewFunctionArrayDereferencing` sniff will now also check _method_ calls for array dereferencing, not just function calls. [#229](https://github.com/PHPCompatibility/PHPCompatibility/pull/229). Fixes [#227](https://github.com/PHPCompatibility/PHPCompatibility/issues/227). +- :pencil2: The `NewExecutionDirectives` sniff will now throw `warning`s instead of `error`s for invalid values encountered in execution directives. [#223](https://github.com/PHPCompatibility/PHPCompatibility/pull/223) +- :pencil2: Minor miscellaneous fixes. [#231](https://github.com/PHPCompatibility/PHPCompatibility/pull/231) +- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#219](https://github.com/PHPCompatibility/PHPCompatibility/pull/219), [#203](https://github.com/PHPCompatibility/PHPCompatibility/pull/203) +- :recycle: Defer to upstream `findImplementedInterfaceNames()` utility method when it exists. [#222](https://github.com/PHPCompatibility/PHPCompatibility/pull/222) +- :wrench: Exclude the test files from analysis by Scrutinizer CI. [#230](https://github.com/PHPCompatibility/PHPCompatibility/pull/230) + +### Removed +- :no_entry_sign: Some redundant code. [#232](https://github.com/PHPCompatibility/PHPCompatibility/pull/232) + +### Fixed +- :bug: The `EmptyNonVariable` sniff would throw false positives for variable variables and for array access with a (partially) variable array index. [#212](https://github.com/PHPCompatibility/PHPCompatibility/pull/212). Fixes [#210](https://github.com/PHPCompatibility/PHPCompatibility/issues/210). +- :bug: The `NewFunctionArrayDereferencing` sniff would throw false positives for lines of code containing both a function call as well as square brackets, even when they were unrelated. [#228](https://github.com/PHPCompatibility/PHPCompatibility/pull/228). Fixes [#226](https://github.com/PHPCompatibility/PHPCompatibility/issues/226). +- :bug: `ParameterShadowSuperGlobals` sniff would report false positives for lowercase/mixed cased variables shadowing superglobals. [#218](https://github.com/PHPCompatibility/PHPCompatibility/pull/218). Fixes [#214](https://github.com/PHPCompatibility/PHPCompatibility/issues/214). +- :bug: The `determineNamespace()` utility method now accounts properly for namespaces within scoped `declare()` statements. [#221](https://github.com/PHPCompatibility/PHPCompatibility/pull/221) +- :books: Readme: Logo alignment in the Credits section. [#233](https://github.com/PHPCompatibility/PHPCompatibility/pull/233) + +### Credits +Thanks go out to [Jason Stallings], [Juliette Reinders Folmer] and [Mark Clements] for their contributions to this version. :clap: + + +## [7.0.5] - 2016-09-08 + +See all related issues and PRs in the [7.0.5 milestone]. + +### Added +- :star2: New `MbstringReplaceEModifier` sniff to detect the use of the PHP 7.1 deprecated `e` modifier in Mbstring regex functions. [#202](https://github.com/PHPCompatibility/PHPCompatibility/pull/202) +- :star: The `ForbiddenBreakContinueVariableArguments` sniff will now also report on `break 0`/`continue 0` which is not allowed since PHP 5.4. [#209](https://github.com/PHPCompatibility/PHPCompatibility/pull/209) +- :star: New `getFunctionCallParameters()`, `getFunctionCallParameter()` utility methods in the `PHPCompatibility_Sniff` base class. [#170](https://github.com/PHPCompatibility/PHPCompatibility/pull/170) +- :star: New `tokenHasScope()` utility method in the `PHPCompatibility_Sniff` base class. [#189](https://github.com/PHPCompatibility/PHPCompatibility/pull/189) +- :umbrella: Unit test for `goto` and `callable` detection and some other miscellanous extra unit tests for the `NewKeywords` sniff. [#189](https://github.com/PHPCompatibility/PHPCompatibility/pull/189) +- :books: Readme: Information for sniff developers about running unit tests for _other_ sniff libraries using the PHPCS native test framework without running into conflicts with the PHPCompatibility specific unit test framework. [#217](https://github.com/PHPCompatibility/PHPCompatibility/pull/217) + +### Changed +- :pushpin: The `ForbiddenNames` sniff will now also check interface declarations for usage of reserved keywords. [#200](https://github.com/PHPCompatibility/PHPCompatibility/pull/200) +- :pushpin: `PregReplaceEModifier` sniff: improved handling of regexes build up of a combination of variables, function calls and/or text strings. [#201](https://github.com/PHPCompatibility/PHPCompatibility/pull/201) +- :rewind: The `NewKeywords` sniff will now also correctly recognize new keywords when used in combination with older PHPCS versions and/or run on older PHP versions. [#189](https://github.com/PHPCompatibility/PHPCompatibility/pull/189) +- :pencil2: `PregReplaceEModifier` sniff: minor improvement to the error message text. [#201](https://github.com/PHPCompatibility/PHPCompatibility/pull/201) +- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#170](https://github.com/PHPCompatibility/PHPCompatibility/pull/170), [#188](https://github.com/PHPCompatibility/PHPCompatibility/pull/188), [#189](https://github.com/PHPCompatibility/PHPCompatibility/pull/189), [#199](https://github.com/PHPCompatibility/PHPCompatibility/pull/199), [#200](https://github.com/PHPCompatibility/PHPCompatibility/pull/200), [#201](https://github.com/PHPCompatibility/PHPCompatibility/pull/201), [#208](https://github.com/PHPCompatibility/PHPCompatibility/pull/208) +- :wrench: The unit tests for the utility methods have been moved to their own subdirectory within `Tests`. [#215](https://github.com/PHPCompatibility/PHPCompatibility/pull/215) +- :green_heart: The sniffs are now also tested against PHP 7.1 for consistent results. [#216](https://github.com/PHPCompatibility/PHPCompatibility/pull/216) + +### Removed +- :no_entry_sign: Some redundant code. [26d0b6](https://github.com/PHPCompatibility/PHPCompatibility/commit/26d0b6cf0921f75d93a4faaf09c390f386dde9ff) and [841616](https://github.com/PHPCompatibility/PHPCompatibility/commit/8416162ea81f4067226324f5948f4a50f7958a9b) + +### Fixed +- :bug: `ConstantArraysUsingDefine` sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. [#199](https://github.com/PHPCompatibility/PHPCompatibility/pull/199) +- :bug: The `DeprecatedIniDirectives` and `NewIniDirectives` sniffs could potentially trigger on the ini value instead of the ini directive name. [#170](https://github.com/PHPCompatibility/PHPCompatibility/pull/170) +- :bug: `ForbiddenNames` sniff: Reserved keywords when used as the name of a constant declared using `define()` would always be reported independently of the `testVersion` set. [#200](https://github.com/PHPCompatibility/PHPCompatibility/pull/200) +- :bug: `PregReplaceEModifier` sniff would not report errors when the function name used was not in lowercase. [#201](https://github.com/PHPCompatibility/PHPCompatibility/pull/201) +- :bug: `TernaryOperators` sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. [#188](https://github.com/PHPCompatibility/PHPCompatibility/pull/188) +- :bug: The `getFQClassNameFromNewToken()` and `getFQClassNameFromDoubleColonToken()` utility methods would get confused when the class name was a variable instead of being hard-coded, resulting in a PHP warning being thown. [#206](https://github.com/PHPCompatibility/PHPCompatibility/pull/206). Fixes [#205](https://github.com/PHPCompatibility/PHPCompatibility/issues/205). +- :bug: The `getFunctionCallParameters()` utility method would incorrectly identify an extra parameter if the last parameter passed to a function would have an - unnecessary - comma after it. The `getFunctionCallParameters()` utility method also did not handle parameters passed as short arrays correctly. [#213](https://github.com/PHPCompatibility/PHPCompatibility/pull/213). Fixes [#211](https://github.com/PHPCompatibility/PHPCompatibility/issues/211). +- :umbrella: Unit tests for the `NewFunctionArrayDereferencing` sniff were not being run due to a naming error. [#208](https://github.com/PHPCompatibility/PHPCompatibility/pull/208) +- :books: Readme: Information about setting the `testVersion` from a custom ruleset was incorrect. [#204](https://github.com/PHPCompatibility/PHPCompatibility/pull/204) +- :wrench: Path to PHPCS in the unit tests breaking for non-Composer installs. [#198](https://github.com/PHPCompatibility/PHPCompatibility/pull/198) + +### Credits +Thanks go out to [Juliette Reinders Folmer] and [Yoshiaki Yoshida] for their contributions to this version. :clap: + + +## [7.0.4] - 2016-08-20 + +See all related issues and PRs in the [7.0.4 milestone]. + +### Added +- :star2: New `EmptyNonVariable` sniff: detection of empty being used on non-variables for PHP < 5.5. [#187](https://github.com/PHPCompatibility/PHPCompatibility/pull/187) +- :star2: New `NewMagicMethods` sniff: detection of declaration of magic methods before the method became "magic". Includes a check for the changed behaviour for the `__toString()` magic method in PHP 5.2. [#176](https://github.com/PHPCompatibility/PHPCompatibility/pull/176). Fixes [#64](https://github.com/PHPCompatibility/PHPCompatibility/issues/64). +- :star2: New `RemovedAlternativePHPTags` sniff: detection of ASP and script open tags for which support was removed in PHP 7.0. [#184](https://github.com/PHPCompatibility/PHPCompatibility/pull/184), [#193](https://github.com/PHPCompatibility/PHPCompatibility/pull/193). Fixes [#127](https://github.com/PHPCompatibility/PHPCompatibility/issues/127). +- :star: `NonStaticMagicMethods` sniff: detection of the `__callStatic()`, `__sleep()`, `__toString()` and `__set_state()` magic methods. +- :green_heart: Lint all non-test case files for syntax errors during the build testing by Travis. [#192](https://github.com/PHPCompatibility/PHPCompatibility/pull/192) + +### Changed +- :pushpin: `NonStaticMagicMethods` sniff: will now also sniff `trait`s for magic methods. [#174](https://github.com/PHPCompatibility/PHPCompatibility/pull/174) +- :pushpin: `NonStaticMagicMethods` sniff: will now also check for magic methods which should be declared as `static`. [#174](https://github.com/PHPCompatibility/PHPCompatibility/pull/174) +- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#178](https://github.com/PHPCompatibility/PHPCompatibility/pull/178), [#179](https://github.com/PHPCompatibility/PHPCompatibility/pull/179), [#174](https://github.com/PHPCompatibility/PHPCompatibility/pull/174), [#171](https://github.com/PHPCompatibility/PHPCompatibility/pull/171) +- :recycle: The unit test suite now internally caches PHPCS run results in combination with a set `testVersion` to speed up the running of the unit tests. These are now ~3 x faster. [#148](https://github.com/PHPCompatibility/PHPCompatibility/pull/148) +- :books: Readme: Minor clarification of the minimum requirements. +- :books: Readme: Advise to use the latest stable version of this repository. +- :wrench: The unit tests can now be run with PHPCS installed in an arbitrary location by passing the location through an environment option. [#191](https://github.com/PHPCompatibility/PHPCompatibility/pull/191). +- :wrench: Improved coveralls configuration and compatibility. [#194](https://github.com/PHPCompatibility/PHPCompatibility/pull/194) +- :green_heart: The sniffs are now also tested against PHP 5.2 for consistent results. Except for namespace, trait and group use related errors, most sniffs work as intended on PHP 5.2. [#196](https://github.com/PHPCompatibility/PHPCompatibility/pull/196) + +### Fixed +- :bug: The `ForbiddenBreakContinueVariableArguments` sniff would not report on `break`/`continue` with a closure as an argument. [#171](https://github.com/PHPCompatibility/PHPCompatibility/pull/171) +- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff would not report on reserved keywords which were not lowercase. [#186](https://github.com/PHPCompatibility/PHPCompatibility/pull/186) +- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff would not report on the `goto` and `namespace` keywords when run on PHP 5.2. [#193](https://github.com/PHPCompatibility/PHPCompatibility/pull/193) +- :bug: `NewAnonymousClasses` sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. [#195](https://github.com/PHPCompatibility/PHPCompatibility/pull/195). +- :bug: `NewGroupUseDeclarations` sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. [#190](https://github.com/PHPCompatibility/PHPCompatibility/pull/190). +- :bug: The `NonStaticMagicMethods` sniff would not report on magic methods when the function name as declared was not in the same case as used in the PHP manual. [#174](https://github.com/PHPCompatibility/PHPCompatibility/pull/174) +- :wrench: The unit tests would exit with `0` if PHPCS could not be found. [#191](https://github.com/PHPCompatibility/PHPCompatibility/pull/191) +- :green_heart: The PHPCompatibility library itself was not fully compatible with PHP 5.2. [#193](https://github.com/PHPCompatibility/PHPCompatibility/pull/193) + +### Credits +Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: + + +## [7.0.3] - 2016-08-18 + +See all related issues and PRs in the [7.0.3 milestone]. + +### Added +- :star2: New `InternalInterfaces` sniff: detection of internal PHP interfaces being which should not be implemented by user land classes. [#144](https://github.com/PHPCompatibility/PHPCompatibility/pull/144) +- :star2: New `LateStaticBinding` sniff: detection of PHP 5.3 late static binding. [#177](https://github.com/PHPCompatibility/PHPCompatibility/pull/177) +- :star2: New `NewExecutionDirectives` sniff: verify execution directives set with `declare()`. [#169](https://github.com/PHPCompatibility/PHPCompatibility/pull/169) +- :star2: New `NewInterfaces` sniff: detection of the use of newly introduced PHP native interfaces. This sniff will also detect unsupported methods when a class implements the `Serializable` interface. [#144](https://github.com/PHPCompatibility/PHPCompatibility/pull/144) +- :star2: New `RequiredOptionalFunctionParameters` sniff: detection of missing function parameters which were required in earlier PHP versions only to become optional in later versions. [#165](https://github.com/PHPCompatibility/PHPCompatibility/pull/165) +- :star2: New `ValidIntegers` sniff: detection of binary integers for PHP < 5.4, detection of hexademical numeric strings for which recognition as hex integers was removed in PHP 7.0, detection of invalid binary and octal integers. [#160](https://github.com/PHPCompatibility/PHPCompatibility/pull/160). Fixes [#55](https://github.com/PHPCompatibility/PHPCompatibility/issues/55). +- :star: `DeprecatedExtensions` sniff: detect removal of the `ereg` extension in PHP 7. [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) +- :star: `DeprecatedFunctions` sniff: detection of the PHP 5.0.5 deprecated `php_check_syntax()` and PHP 5.4 deprecated `mysqli_get_cache_stats()` functions. [#155](https://github.com/PHPCompatibility/PHPCompatibility/pull/155). +- :star: `DeprecatedFunctions` sniff: detect deprecation of a number of the `mysqli` functions in PHP 5.3. [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) +- :star: `DeprecatedFunctions` sniff: detect removal of the `call_user_method()`, `ldap_sort()`, `ereg_*()` and `mysql_*()` functions in PHP 7.0. [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) +- :star: `DeprecatedIniDirectives` sniff: detection of a _lot_ more deprecated/removed ini directives. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) +- :star: `NewFunctionParameters` sniff: detection of a _lot_ more new function parameters. [#164](https://github.com/PHPCompatibility/PHPCompatibility/pull/164) +- :star: `NewFunctions` sniff: detection of numerous extra new functions. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/161) +- :star: `NewIniDirectives` sniff: detection of a _lot_ more new ini directives. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) +- :star: `NewLanguageConstructs` sniff: detection of the PHP 5.6 ellipsis `...` construct. [#175](https://github.com/PHPCompatibility/PHPCompatibility/pull/175) +- :star: `NewScalarTypeDeclarations` sniff: detection of PHP 5.1 `array` and PHP 5.4 `callable` type hints. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) +- :star: `RemovedFunctionParameters` sniff: detection of a few extra removed function parameters. [#163](https://github.com/PHPCompatibility/PHPCompatibility/pull/163) +- :star: Detection of functions and methods with a double underscore prefix as these are reserved by PHP for future use. The existing upstream `Generic.NamingConventions.CamelCapsFunctionName` sniff is re-used for this with some customization. [#173](https://github.com/PHPCompatibility/PHPCompatibility/pull/173) +- :star: New `getFQClassNameFromNewToken()`, `getFQExtendedClassName()`, `getFQClassNameFromDoubleColonToken()`, `getFQName()`, `isNamespaced()`, `determineNamespace()` and `getDeclaredNamespaceName()` utility methods in the `PHPCompatibility_Sniff` base class for namespace determination. [#162](https://github.com/PHPCompatibility/PHPCompatibility/pull/162) +- :recycle: New `inClassScope()` utility method in the `PHPCompatibility_Sniff` base class. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) +- :recycle: New `doesFunctionCallHaveParameters()` and `getFunctionCallParameterCount()` utility methods in the `PHPCompatibility_Sniff` base class. [#153](https://github.com/PHPCompatibility/PHPCompatibility/pull/153) +- :umbrella: Unit test for `__halt_compiler()` detection by the `NewKeywords` sniff. +- :umbrella: Unit tests for the `NewFunctions` sniff. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/161) +- :umbrella: Unit tests for the `ParameterShadowSuperGlobals` sniff. [#180](https://github.com/PHPCompatibility/PHPCompatibility/pull/180) +- :wrench: Minimal config for Scrutinizer CI. [#145](https://github.com/PHPCompatibility/PHPCompatibility/pull/145). + +### Changed +- :pushpin: The `DeprecatedIniDirectives` and the `NewIniDirectives` sniffs will now indicate an alternative ini directive in case the directive has been renamed. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) +- :pushpin: The `NewClasses` sniff will now also report on new classes being extended by child classes. [#140](https://github.com/PHPCompatibility/PHPCompatibility/pull/140). +- :pushpin: The `NewClasses` sniff will now also report on static use of new classes. [#162](https://github.com/PHPCompatibility/PHPCompatibility/pull/162). +- :pushpin: The `NewScalarTypeDeclarations` sniff will now throw an error on use of type hints pre-PHP 5.0. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) +- :pushpin: The `NewScalarTypeDeclarations` sniff will now verify type hints used against typical mistakes. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) +- :pushpin: The `ParameterShadowSuperGlobals` sniff will now do a case-insensitive variable name compare. [#180](https://github.com/PHPCompatibility/PHPCompatibility/pull/180) +- :pushpin: The `RemovedFunctionParameters` sniff will now also report `warning`s on deprecation of function parameters. [#163](https://github.com/PHPCompatibility/PHPCompatibility/pull/163) +- :twisted_rightwards_arrows: The check for `JsonSerializable` has been moved from the `NewClasses` sniff to the `NewInterfaces` sniff. [#162](https://github.com/PHPCompatibility/PHPCompatibility/pull/162) +- :rewind: The `NewLanguageConstructs` sniff will now also recognize new language constructs when used in combination with PHPCS 1.5.x. [#175](https://github.com/PHPCompatibility/PHPCompatibility/pull/175) +- :pencil2: `NewFunctionParameters` sniff: use correct name for the new parameter for the `dirname()` function. [#164](https://github.com/PHPCompatibility/PHPCompatibility/pull/164) +- :pencil2: `NewScalarTypeDeclarations` sniff: minor change in the sniff error message text. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) +- :pencil2: `RemovedFunctionParameters` sniff: minor change in the sniff error message text. [#163](https://github.com/PHPCompatibility/PHPCompatibility/pull/163) +- :pencil2: The `ParameterShadowSuperGlobals` sniff now extends the `PHPCompatibility_Sniff` class. [#180](https://github.com/PHPCompatibility/PHPCompatibility/pull/180) +- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#181](https://github.com/PHPCompatibility/PHPCompatibility/pull/181), [#182](https://github.com/PHPCompatibility/PHPCompatibility/pull/182), [#166](https://github.com/PHPCompatibility/PHPCompatibility/pull/166), [#167](https://github.com/PHPCompatibility/PHPCompatibility/pull/167), [#172](https://github.com/PHPCompatibility/PHPCompatibility/pull/172), [#180](https://github.com/PHPCompatibility/PHPCompatibility/pull/180), [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146), [#138](https://github.com/PHPCompatibility/PHPCompatibility/pull/138) +- :recycle: Various refactoring to remove code duplication in the unit tests and add proper test skip notifications where relevant. [#139](https://github.com/PHPCompatibility/PHPCompatibility/pull/139), [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) + +### Fixed +- :bug: The `DeprecatedFunctions` sniff was reporting an incorrect deprecation/removal version number for a few functions. [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) +- :bug: The `DeprecatedIniDirectives` sniff was in select cases reporting deprecation of an ini directive prior to removal, while the ini directive was never deprecated prior to its removal. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) +- :bug: The `DeprecatedPHP4StyleConstructors` sniff would cause false positives for methods with the same name as the class in namespaced classes. [#167](https://github.com/PHPCompatibility/PHPCompatibility/pull/167) +- :bug: The `ForbiddenEmptyListAssignment` sniff did not report errors when there were only comments or parentheses between the list parentheses. [#166](https://github.com/PHPCompatibility/PHPCompatibility/pull/166) +- :bug: The `ForbiddenEmptyListAssignment` sniff will no longer cause false positives during live coding. [#166](https://github.com/PHPCompatibility/PHPCompatibility/pull/166) +- :bug: The `NewClasses` sniff would potentially misidentify namespaced classes as PHP native classes. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/162) +- :bug: The `NewFunctions` sniff would fail to identify called functions when the function call was not lowercase. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/161) +- :bug: The `NewFunctions` sniff would potentially misidentify namespaced userland functions as new functions. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/161) +- :bug: The `NewIniDirectives` sniff was reporting an incorrect introduction version number for a few ini directives. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) +- :bug: `NewKeywords` sniff: the use of the `const` keyword should only be reported when used outside of a class for PHP < 5.3. [#147](https://github.com/PHPCompatibility/PHPCompatibility/pull/147). Fixes [#129](https://github.com/PHPCompatibility/PHPCompatibility/issues/129). +- :bug: The `RemovedExtensions` sniff was incorrectly reporting a number of extensions as being removed in PHP 5.3 while they were actually removed in PHP 5.1. [#156](https://github.com/PHPCompatibility/PHPCompatibility/pull/156) +- :bug: :recycle: The `NewFunctionParameters` and `RemovedFunctionParameters` now use the new `doesFunctionCallHaveParameters()` and `getFunctionCallParameterCount()` utility methods for improved accuracy in identifying function parameters. This fixes several false positives. [#153](https://github.com/PHPCompatibility/PHPCompatibility/pull/153) Fixes [#120](https://github.com/PHPCompatibility/PHPCompatibility/issues/120), [#151](https://github.com/PHPCompatibility/PHPCompatibility/issues/151), [#152](https://github.com/PHPCompatibility/PHPCompatibility/issues/152). +- :bug: A number of sniffs would return `false` if the examined construct was not found. This could potentially cause race conditions/infinite sniff loops. [#138](https://github.com/PHPCompatibility/PHPCompatibility/pull/138) +- :wrench: The unit tests would fail to run when used in combination with a PEAR install of PHPCS. [#157](https://github.com/PHPCompatibility/PHPCompatibility/pull/157). +- :green_heart: Unit tests failing against PHPCS 2.6.1. [#158](https://github.com/PHPCompatibility/PHPCompatibility/pull/158) + The unit tests *will* still fail against PHPCS 2.6.2 due to a bug in PHPCS itself. This bug does not affect the running of the sniffs outside of a unit test context. + +### Credits +Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: + + +## [7.0.2] - 2016-08-03 + +See all related issues and PRs in the [7.0.2 milestone]. + +### Added +- :star: `RemovedExtensions` sniff: ability to whitelist userland functions for which the function prefix overlaps with a prefix of a deprecated/removed extension. [#130](https://github.com/PHPCompatibility/PHPCompatibility/pull/130). Fixes [#123](https://github.com/PHPCompatibility/PHPCompatibility/issues/123). + To use this feature, add the `functionWhitelist` property in your custom ruleset. For more information, see the [README](https://github.com/PHPCompatibility/PHPCompatibility#phpcompatibility-specific-options). + +### Changed +- :pencil2: A number of sniffs contained `public` class properties. Within PHPCS, `public` properties can be overruled via a custom ruleset. This was not the intention, so the visibility of these properties has been changed to `protected`. [#135](https://github.com/PHPCompatibility/PHPCompatibility/pull/135) +- :wrench: Composer config: Stable packages are preferred over unstable/dev. +- :pencil2: Ruleset name. [#134](https://github.com/PHPCompatibility/PHPCompatibility/pull/134) + +### Credits +Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: + + +## [7.0.1] - 2016-08-02 + +See all related issues and PRs in the [7.0.1 milestone]. + +### Changed +- :pushpin: The `DeprecatedIniDirectives` sniff used to throw an `error` when a deprecated ini directive was used in combination with `ini_get()`. It will now throw a `warning` instead. [#122](https://github.com/PHPCompatibility/PHPCompatibility/pull/122) Fixes [#119](https://github.com/PHPCompatibility/PHPCompatibility/issues/119). + Usage of deprecated ini directives in combination with `ini_set()` will still throw an `error`. +- :pushpin: The `PregReplaceEModifier` sniff now also detects the `e` modifier when used with the `preg_filter()` function. While this is undocumented, the `e` modifier was supported by the `preg_filter()` function as well. [#128](https://github.com/PHPCompatibility/PHPCompatibility/pull/128) +- :pencil2: The `RemovedExtensions` sniff contained superfluous deprecation information in the error message. [#131](https://github.com/PHPCompatibility/PHPCompatibility/pull/131) + +### Removed +- :wrench: Duplicate builds from the Travis CI build matrix. [#132](https://github.com/PHPCompatibility/PHPCompatibility/pull/132) + +### Fixed +- :bug: The `ForbiddenNames` sniff did not allow for the PHP 5.6 `use function ...` and `use const ...` syntax. [#126](https://github.com/PHPCompatibility/PHPCompatibility/pull/126) Fixes [#124](https://github.com/PHPCompatibility/PHPCompatibility/issues/124). +- :bug: The `NewClasses` sniff failed to detect new classes when the class was instantiated without parenthesis, i.e. `new NewClass;`. [#121](https://github.com/PHPCompatibility/PHPCompatibility/pull/121) +- :bug: The `PregReplaceEModifier` sniff failed to detect the `e` modifier when using bracket delimiters for the regex other than the `{}` brackets. [#128](https://github.com/PHPCompatibility/PHPCompatibility/pull/128) +- :green_heart: Unit tests failing against PHPCS 2.6.1. + +### Credits +Thanks go out to [Jason Stallings], [Juliette Reinders Folmer] and [Ryan Neufeld] for their contributions to this version. :clap: + + +## [7.0] - 2016-07-02 + +See all related issues and PRs in the [7.0 milestone]. + +### Added +- :zap: Ability to specify a range of PHP versions against which to test your code base for compatibility, i.e. `--runtime-set testVersion 5.0-5.4` will now test your code for compatibility with PHP 5.0 up to PHP 5.4. [#99](https://github.com/PHPCompatibility/PHPCompatibility/pull/99) +- :star2: New `NewFunctionArrayDereferencing` sniff to detect function array dereferencing as introduced in PHP 5.4. Fixes [#52](https://github.com/PHPCompatibility/PHPCompatibility/issues/52). +- :star2: New `ShortArray` sniff to detect short array syntax as introduced in PHP 5.4. [#97](https://github.com/PHPCompatibility/PHPCompatibility/pull/97). Fixes [#47](https://github.com/PHPCompatibility/PHPCompatibility/issues/47). +- :star2: New `TernaryOperators` sniff to detect ternaries without the middle part (`elvis` operator) as introduced in PHP 5.3. [#101](https://github.com/PHPCompatibility/PHPCompatibility/pull/101), [#103](https://github.com/PHPCompatibility/PHPCompatibility/pull/103). Fixes [#49](https://github.com/PHPCompatibility/PHPCompatibility/issues/49). +- :star2: New `ConstantArraysUsingDefine` sniff to detect constants declared using `define()` being assigned an `array` value which was not allowed prior to PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `DeprecatedPHP4StyleConstructors` sniff to detect PHP 4 style class constructor methods which are deprecated as of PHP 7. [#109](https://github.com/PHPCompatibility/PHPCompatibility/pull/109). +- :star2: New `ForbiddenEmptyListAssignment` sniff to detect empty list() assignments which have been removed in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `ForbiddenFunctionParametersWithSameName` sniff to detect functions declared with multiple same-named parameters which is no longer accepted since PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `ForbiddenGlobalVariableVariable` sniff to detect variable variables being made `global` which is not allowed since PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `ForbiddenNegativeBitshift` sniff to detect bitwise shifts by negative number which will throw an ArithmeticError in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `ForbiddenSwitchWithMultipleDefaultBlocks` sniff to detect switch statements with multiple default blocks which is not allowed since PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `NewAnonymousClasses` sniff to detect anonymous classes as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `NewClosure` sniff to detect anonymous functions as introduced in PHP 5.3. Fixes [#35](https://github.com/PHPCompatibility/PHPCompatibility/issues/35) +- :star2: New `NewFunctionParameters` sniff to detect use of new parameters in build-in PHP functions. Initially only sniffing for the new PHP 7.0 function parameters and the new PHP 5.3+ `before_needle` parameter for the `strstr()` function. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110), [#112](https://github.com/PHPCompatibility/PHPCompatibility/pull/112). Fixes [#27](https://github.com/PHPCompatibility/PHPCompatibility/issues/27). +- :star2: New `NewGroupUseDeclarations` sniff to detect group use declarations as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `NewScalarReturnTypeDeclarations` sniff to detect scalar return type hints as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `NewScalarTypeDeclarations` sniff to detect scalar function parameter type hints as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `RemovedFunctionParameters` sniff to detect use of removed parameters in build-in PHP functions. Initially only sniffing for the function parameters removed in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star2: New `RemovedGlobalVariables` sniff to detect the PHP 7.0 removed `$HTTP_RAW_POST_DATA` superglobal. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star: `DeprecatedFunctions` sniff: detection of the PHP 5.4 deprecated OCI8 functions. [#93](https://github.com/PHPCompatibility/PHPCompatibility/pull/93) +- :star: `ForbiddenNamesAsInvokedFunctions` sniff: recognize PHP 5.5 `finally` as a reserved keywords when invoked as a function. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star: `NewKeywords` sniff: detection of the use of the PHP 5.1+ `__halt_compiler` keyword. Fixes [#50](https://github.com/PHPCompatibility/PHPCompatibility/issues/50). +- :star: `NewKeywords` sniff: detection of the PHP 5.3+ `nowdoc` syntax. Fixes [#48](https://github.com/PHPCompatibility/PHPCompatibility/issues/48). +- :star: `NewKeywords` sniff: detection of the use of the `const` keyword outside of a class for PHP < 5.3. Fixes [#50](https://github.com/PHPCompatibility/PHPCompatibility/issues/50). +- :star: `DeprecatedFunctions` sniff: recognize PHP 7.0 deprecated and removed functions. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star: `DeprecatedIniDirectives` sniff: recognize PHP 7.0 removed ini directives. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star: `ForbiddenNamesAsInvokedFunctions` sniff: recognize new PHP 7.0 reserved keywords when invoked as functions. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star: `ForbiddenNames` sniff: recognize new PHP 7.0 reserved keywords. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star: `NewFunctions` sniff: recognize new functions as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star: `NewLanguageConstructs` sniff: recognize new PHP 7.0 `<=>` "spaceship" and `??` null coalescing operators. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :star: `RemovedExtensions` sniff: recognize PHP 7.0 removed `ereg`, `mssql`, `mysql` and `sybase_ct` extensions. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :umbrella: Additional unit tests for the `NewLanguageConstructs` sniff. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :books: Readme: New section containing information about the use of the `testVersion` config variable. +- :books: Readme: Sponsor credits. + +### Changed +- :pushpin: The `DeprecatedIniDirectives` sniff used to always throw an `warning`. Now it will throw an `error` when a removed ini directive is used. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110). +- :pushpin: The `DeprecatedNewReference` sniff will now throw an error when the `testVersion` includes PHP 7.0 or higher. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :pushpin: The `ForbiddenNames` sniff now supports detection of reserved keywords when used in combination with PHP 7 anonymous classes. [#108](https://github.com/PHPCompatibility/PHPCompatibility/pull/108), [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110). +- :pushpin: The `PregReplaceEModifier` sniff will now throw an error when the `testVersion` includes PHP 7.0 or higher. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) +- :pencil2: `NewKeywords` sniff: clarified the error message text for the `use` keyword. Fixes [#46](https://github.com/PHPCompatibility/PHPCompatibility/issues/46). +- :recycle: Minor refactor of the `testVersion` related utility functions. [#98](https://github.com/PHPCompatibility/PHPCompatibility/pull/98) +- :wrench: Add autoload to the `composer.json` file. [#96](https://github.com/PHPCompatibility/PHPCompatibility/pull/96) Fixes [#67](https://github.com/PHPCompatibility/PHPCompatibility/issues/67). +- :wrench: Minor other updates to the `composer.json` file. [#75](https://github.com/PHPCompatibility/PHPCompatibility/pull/75) +- :wrench: Improved creation of the code coverage reports needed by coveralls via Travis. +- :green_heart: The sniffs are now also tested against PHP 7.0 for consistent results. + +### Fixed +- :bug: The `ForbiddenCallTimePassByReference` sniff was throwing `Undefined index` notices when used in combination with PHPCS 2.2.0. [#100](https://github.com/PHPCompatibility/PHPCompatibility/pull/100). Fixes [#42](https://github.com/PHPCompatibility/PHPCompatibility/issues/42). +- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff would incorrectly throw an error if the `throw` keyword was used with parenthesis. Fixes [#118](https://github.com/PHPCompatibility/PHPCompatibility/issues/118). +- :bug: The `PregReplaceEModifier` sniff incorrectly identified `e`'s in the pattern as the `e` modifier when using `{}` bracket delimiters for the regex. [#94](https://github.com/PHPCompatibility/PHPCompatibility/pull/94) +- :bug: The `RemovedExtensions` sniff was throwing an `error` instead of a `warning` for deprecated, but not (yet) removed extensions. Fixes [#62](https://github.com/PHPCompatibility/PHPCompatibility/issues/62). + +### Credits +Thanks go out to AlexMiroshnikov, [Chris Abernethy], [dgudgeon], [djaenecke], [Eugene Maslovich], [Ken Guest], Koen Eelen, [Komarov Alexey], [Mark Clements] and [Remko van Bezooijen] for their contributions to this version. :clap: + + +## [5.6] - 2015-09-14 + +See all related issues and PRs in the [5.6 milestone]. + +### Added +- :star2: New: `NewLanguageConstructs` sniff. The initial version of this sniff checks for the PHP 5.6 `**` power operator and the `**=` power assignment operator. [#87](https://github.com/PHPCompatibility/PHPCompatibility/pull/87). Fixes [#60](https://github.com/PHPCompatibility/PHPCompatibility/issues/60). +- :star2: New: `ParameterShadowSuperGlobals` sniff which covers the PHP 5.4 change _Parameter names that shadow super globals now cause a fatal error.`_. [#74](https://github.com/PHPCompatibility/PHPCompatibility/pull/74) +- :star2: New: `PregReplaceEModifier` sniff which detects usage of the `e` modifier in literal regular expressions used with `preg_replace()`. The `e` modifier will not (yet) be detected when the regex passed is a variable or constant. [#81](https://github.com/PHPCompatibility/PHPCompatibility/pull/81), [#84](https://github.com/PHPCompatibility/PHPCompatibility/pull/84). Fixes [#71](https://github.com/PHPCompatibility/PHPCompatibility/issues/71), [#83](https://github.com/PHPCompatibility/PHPCompatibility/issues/83). +- :star: `DeprecatedIniDirectives` sniff: PHP 5.6 deprecated ini directives. +- :star: `NewKeywords` sniff: detection of the `goto` keyword introduced in PHP 5.3 and the `callable` keyword introduced in PHP 5.4. [#57](https://github.com/PHPCompatibility/PHPCompatibility/pull/57) +- :recycle: `PHPCompatibility_Sniff` base class initially containing the `supportsAbove()` and `supportsBelow()` utility methods. (Nearly) All sniffs now extend this base class and use these methods to determine whether or not violations should be reported for a set `testVersion`. [#77](https://github.com/PHPCompatibility/PHPCompatibility/pull/77) +- :books: Readme: Composer installation instructions. [#32](https://github.com/PHPCompatibility/PHPCompatibility/pull/32), [#61](https://github.com/PHPCompatibility/PHPCompatibility/pull/61) +- :wrench: `.gitignore` to ignore vendor and IDE related directories. [#78](https://github.com/PHPCompatibility/PHPCompatibility/pull/78) +- :green_heart: Code coverage checking via coveralls. + +### Changed +- :twisted_rightwards_arrows: The check for the `\` namespace separator has been moved from the `NewKeywords` sniff to the `NewLanguageConstructs` sniff. [#88](https://github.com/PHPCompatibility/PHPCompatibility/pull/88) +- :pencil2: `DeprecatedIniDirectives` sniff: minor change in the sniff error message text. +- :pencil2: `DeprecatedFunctions` sniff: minor change in the sniff error message text. +- :wrench: Minor updates to the `composer.json` file. [#31](https://github.com/PHPCompatibility/PHPCompatibility/pull/31), [34](https://github.com/PHPCompatibility/PHPCompatibility/pull/34), [#70](https://github.com/PHPCompatibility/PHPCompatibility/pull/70) +- :wrench: Tests: The unit tests can now be run without configuration. +- :wrench: Tests: Skipped unit tests will now be annotated as such. [#85](https://github.com/PHPCompatibility/PHPCompatibility/pull/85) +- :green_heart: The sniffs are now also tested against PHP 5.6 for consistent results. +- :green_heart: The sniffs are now also tested against PHPCS 2.0+. +- :green_heart: The sniffs are now tested using the new container-based infrastructure in Travis CI. [#37](https://github.com/PHPCompatibility/PHPCompatibility/pull/37) + +### Fixed +- :bug: The `ForbiddenCallTimePassByReference` sniff was throwing false positives when a bitwise and `&` was used in combination with class constants and class properties within function calls. [#44](https://github.com/PHPCompatibility/PHPCompatibility/pull/44). Fixes [#39](https://github.com/PHPCompatibility/PHPCompatibility/issues/39). +- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff was throwing false positives in certain cases when a comment separated a `try` from the `catch` block. [#29](https://github.com/PHPCompatibility/PHPCompatibility/pull/29) +- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff was incorrectly reporting `instanceof` as being introduced in PHP 5.4 while it has been around since PHP 5.0. [#80](https://github.com/PHPCompatibility/PHPCompatibility/pull/80) +- :white_check_mark: Compatibility with PHPCS 2.0 - 2.3. [#63](https://github.com/PHPCompatibility/PHPCompatibility/pull/63), [#65](https://github.com/PHPCompatibility/PHPCompatibility/pull/65) + +### Credits +Thanks go out to Daniel Jänecke, [Declan Kelly], [Dominic], [Jaap van Otterdijk], [Marin Crnkovic], [Mark Clements], [Nick Pack], [Oliver Klee], [Rowan Collins] and [Sam Van der Borght] for their contributions to this version. :clap: + + +## 5.5 - 2014-04-04 + +First tagged release. + +See all related issues and PRs in the [5.5 milestone]. + + + +[Unreleased]: https://github.com/PHPCompatibility/PHPCompatibility/compare/master...HEAD +[9.3.5]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.4...9.3.5 +[9.3.4]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.3...9.3.4 +[9.3.3]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.2...9.3.3 +[9.3.2]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.1...9.3.2 +[9.3.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.0...9.3.1 +[9.3.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.2.0...9.3.0 +[9.2.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.1.1...9.2.0 +[9.1.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.1.0...9.1.1 +[9.1.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.0.0...9.1.0 +[9.0.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/8.2.0...9.0.0 +[8.2.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/8.1.0...8.2.0 +[8.1.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/8.0.1...8.1.0 +[8.0.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/8.0.0...8.0.1 +[8.0.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.5...8.0.0 +[7.1.5]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.4...7.1.5 +[7.1.4]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.3...7.1.4 +[7.1.3]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.2...7.1.3 +[7.1.2]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.1...7.1.2 +[7.1.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.0...7.1.1 +[7.1.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.8...7.1.0 +[7.0.8]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.7...7.0.8 +[7.0.7]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.6...7.0.7 +[7.0.6]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.5...7.0.6 +[7.0.5]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.4...7.0.5 +[7.0.4]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.3...7.0.4 +[7.0.3]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.2...7.0.3 +[7.0.2]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.1...7.0.2 +[7.0.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0...7.0.1 +[7.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/5.6...7.0 +[5.6]: https://github.com/PHPCompatibility/PHPCompatibility/compare/5.5...5.6 + +[9.3.5 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/34 +[9.3.4 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/33 +[9.3.3 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/32 +[9.3.2 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/31 +[9.3.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/30 +[9.3.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/29 +[9.2.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/28 +[9.1.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/27 +[9.1.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/25 +[9.0.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/24 +[8.2.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/22 +[8.1.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/21 +[8.0.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/20 +[8.0.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/19 +[7.1.5 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/17 +[7.1.4 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/15 +[7.1.3 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/14 +[7.1.2 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/13 +[7.1.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/12 +[7.1.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/11 +[7.0.8 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/10 +[7.0.7 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/9 +[7.0.6 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/8 +[7.0.5 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/7 +[7.0.4 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/6 +[7.0.3 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/5 +[7.0.2 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/4 +[7.0.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/3 +[7.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/2 +[5.6 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/1 +[5.5 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/16 + +[Arthur Edamov]: https://github.com/edamov +[Chris Abernethy]: https://github.com/cabernet-zerve +[Declan Kelly]: https://github.com/declank +[dgudgeon]: https://github.com/dgudgeon +[djaenecke]: https://github.com/djaenecke +[Dominic]: https://github.com/dol +[Eugene Maslovich]: https://github.com/ehpc +[Gary Jones]: https://github.com/GaryJones +[Jaap van Otterdijk]: https://github.com/jaapio +[Jason Stallings]: https://github.com/octalmage +[Jonathan Champ]: https://github.com/jrchamp +[Jonathan Van Belle]: https://github.com/Grummfy +[Juliette Reinders Folmer]: https://github.com/jrfnl +[Ken Guest]: https://github.com/kenguest +[Komarov Alexey]: https://github.com/erdraug +[Marin Crnkovic]: https://github.com/anorgan +[Mark Clements]: https://github.com/MarkMaldaba +[Michael Babker]: https://github.com/mbabker +[Nick Pack]: https://github.com/nickpack +[Nikhil]: https://github.com/Nikschavan +[Oliver Klee]: https://github.com/oliverklee +[Remko van Bezooijen]: https://github.com/emkookmer +[Rowan Collins]: https://github.com/IMSoP +[Ryan Neufeld]: https://github.com/ryanneufeld +[Sam Van der Borght]: https://github.com/samvdb +[Sergii Bondarenko]: https://github.com/BR0kEN- +[Tadas Juozapaitis]: https://github.com/kasp3r +[Tim Millwood]: https://github.com/timmillwood +[William Entriken]: https://github.com/fulldecent +[Yılmaz]: https://github.com/edigu +[Yoshiaki Yoshida]: https://github.com/kakakakakku diff --git a/trunk/vendor/phpcompatibility/php-compatibility/LICENSE b/trunk/vendor/phpcompatibility/php-compatibility/LICENSE new file mode 100644 index 00000000..65c5ca88 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php new file mode 100644 index 00000000..97591a3f --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php @@ -0,0 +1,73 @@ +` ruleset directive. + * + * {@internal The PHPCS file have been reorganized in PHPCS 3.x, quite + * a few "old" classes have been split and spread out over several "new" + * classes. In other words, this will only work for a limited number + * of classes.} + * + * {@internal The `class_exists` wrappers are needed to play nice with other + * external PHPCS standards creating cross-version compatibility in the same + * manner.} + */ +if (defined('PHPCOMPATIBILITY_PHPCS_ALIASES_SET') === false) { + if (interface_exists('\PHP_CodeSniffer_Sniff') === false) { + class_alias('PHP_CodeSniffer\Sniffs\Sniff', '\PHP_CodeSniffer_Sniff'); + } + if (class_exists('\PHP_CodeSniffer_File') === false) { + class_alias('PHP_CodeSniffer\Files\File', '\PHP_CodeSniffer_File'); + } + if (class_exists('\PHP_CodeSniffer_Tokens') === false) { + class_alias('PHP_CodeSniffer\Util\Tokens', '\PHP_CodeSniffer_Tokens'); + } + if (class_exists('\PHP_CodeSniffer_Exception') === false) { + class_alias('PHP_CodeSniffer\Exceptions\RuntimeException', '\PHP_CodeSniffer_Exception'); + } + if (class_exists('\PHP_CodeSniffer_Standards_AbstractScopeSniff') === false) { + class_alias('PHP_CodeSniffer\Sniffs\AbstractScopeSniff', '\PHP_CodeSniffer_Standards_AbstractScopeSniff'); + } + if (class_exists('\Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff') === false) { + class_alias('PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff', '\Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff'); + } + + define('PHPCOMPATIBILITY_PHPCS_ALIASES_SET', true); + + /* + * Register an autoloader. + * + * {@internal When `installed_paths` is set via the ruleset, this autoloader + * is needed to run the sniffs. + * Upstream issue: {@link https://github.com/squizlabs/PHP_CodeSniffer/issues/1591} } + * + * @since 8.0.0 + */ + spl_autoload_register(function ($class) { + // Only try & load our own classes. + if (stripos($class, 'PHPCompatibility') !== 0) { + return; + } + + $file = realpath(__DIR__) . DIRECTORY_SEPARATOR . strtr($class, '\\', DIRECTORY_SEPARATOR) . '.php'; + + if (file_exists($file)) { + include_once $file; + } + }); +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractComplexVersionSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractComplexVersionSniff.php new file mode 100644 index 00000000..95245b6a --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractComplexVersionSniff.php @@ -0,0 +1,147 @@ +getItemArray($itemInfo); + $errorInfo = $this->getErrorInfo($itemArray, $itemInfo); + + if ($this->shouldThrowError($errorInfo) === true) { + $this->addError($phpcsFile, $stackPtr, $itemInfo, $errorInfo); + } + } + + + /** + * Determine whether an error/warning should be thrown for an item based on collected information. + * + * @since 7.1.0 + * + * @param array $errorInfo Detail information about an item. + * + * @return bool + */ + abstract protected function shouldThrowError(array $errorInfo); + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array(); + } + + + /** + * Retrieve a subset of an item array containing only the array keys which + * contain PHP version information. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about an item. + * + * @return array Array with only the version information. + */ + protected function getVersionArray(array $itemArray) + { + return array_diff_key($itemArray, array_flip($this->getNonVersionArrayKeys())); + } + + + /** + * Get the item name to be used for the creation of the error code and in the error message. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * @param array $errorInfo Detail information about an item. + * + * @return string + */ + protected function getItemName(array $itemInfo, array $errorInfo) + { + return $itemInfo['name']; + } + + + /** + * Get the error message template for a specific sniff. + * + * @since 7.1.0 + * + * @return string + */ + abstract protected function getErrorMsgTemplate(); + + + /** + * Allow for concrete child classes to filter the error message before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param string $error The error message which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return string + */ + protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) + { + return $error; + } + + + /** + * Allow for concrete child classes to filter the error data before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param array $data The error data array which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return array + */ + protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) + { + return $data; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php new file mode 100644 index 00000000..6db8cd08 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php @@ -0,0 +1,193 @@ + true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_NEW => true, + \T_CONST => true, + \T_USE => true, + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.2.0 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of function names. + $this->targetFunctions = $this->arrayKeysToLowercase($this->targetFunctions); + + return array(\T_STRING); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->bowOutEarly() === true) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $function = $tokens[$stackPtr]['content']; + $functionLc = strtolower($function); + + if (isset($this->targetFunctions[$functionLc]) === false) { + return; + } + + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + if ($this->isMethod === true) { + if ($tokens[$prevNonEmpty]['code'] !== \T_DOUBLE_COLON + && $tokens[$prevNonEmpty]['code'] !== \T_OBJECT_OPERATOR + ) { + // Not a call to a PHP method. + return; + } + } else { + if (isset($this->ignoreTokens[$tokens[$prevNonEmpty]['code']]) === true) { + // Not a call to a PHP function. + return; + } + + if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR + && $tokens[$prevNonEmpty - 1]['code'] === \T_STRING + ) { + // Namespaced function. + return; + } + } + + $parameters = $this->getFunctionCallParameters($phpcsFile, $stackPtr); + + if (empty($parameters)) { + return $this->processNoParameters($phpcsFile, $stackPtr, $function); + } else { + return $this->processParameters($phpcsFile, $stackPtr, $function, $parameters); + } + } + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 8.2.0 + * + * If the check done in a child class is not specific to one PHP version, + * this function should return `false`. + * + * @return bool + */ + abstract protected function bowOutEarly(); + + + /** + * Process the parameters of a matched function. + * + * This method has to be made concrete in child classes. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + abstract public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters); + + + /** + * Process the function if no parameters were found. + * + * Defaults to doing nothing. Can be overloaded in child classes to handle functions + * were parameters are expected, but none found. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processNoParameters(File $phpcsFile, $stackPtr, $functionName) + { + return; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractNewFeatureSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractNewFeatureSniff.php new file mode 100644 index 00000000..25406fda --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractNewFeatureSniff.php @@ -0,0 +1,115 @@ + '', + 'error' => true, + ); + + $versionArray = $this->getVersionArray($itemArray); + + if (empty($versionArray) === false) { + foreach ($versionArray as $version => $present) { + if ($errorInfo['not_in_version'] === '' && $present === false + && $this->supportsBelow($version) === true + ) { + $errorInfo['not_in_version'] = $version; + } + } + } + + return $errorInfo; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return '%s is not present in PHP version %s or earlier'; + } + + + /** + * Generates the error or warning for this item. + * + * @since 7.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the relevant token in + * the stack. + * @param array $itemInfo Base information about the item. + * @param array $errorInfo Array with detail (version) information + * relevant to the item. + * + * @return void + */ + public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) + { + $itemName = $this->getItemName($itemInfo, $errorInfo); + $error = $this->getErrorMsgTemplate(); + + $errorCode = $this->stringToErrorCode($itemName) . 'Found'; + $data = array( + $itemName, + $errorInfo['not_in_version'], + ); + + $error = $this->filterErrorMsg($error, $itemInfo, $errorInfo); + $data = $this->filterErrorData($data, $itemInfo, $errorInfo); + + $this->addMessage($phpcsFile, $error, $stackPtr, $errorInfo['error'], $errorCode, $data); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractRemovedFeatureSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractRemovedFeatureSniff.php new file mode 100644 index 00000000..94103922 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractRemovedFeatureSniff.php @@ -0,0 +1,156 @@ + '', + 'removed' => '', + 'alternative' => '', + 'error' => false, + ); + + $versionArray = $this->getVersionArray($itemArray); + + if (empty($versionArray) === false) { + foreach ($versionArray as $version => $removed) { + if ($this->supportsAbove($version) === true) { + if ($removed === true && $errorInfo['removed'] === '') { + $errorInfo['removed'] = $version; + $errorInfo['error'] = true; + } elseif ($errorInfo['deprecated'] === '') { + $errorInfo['deprecated'] = $version; + } + } + } + } + + if (isset($itemArray['alternative']) === true) { + $errorInfo['alternative'] = $itemArray['alternative']; + } + + return $errorInfo; + } + + + /** + * Get the error message template for suggesting an alternative for a specific sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getAlternativeOptionTemplate() + { + return '; Use %s instead'; + } + + + /** + * Generates the error or warning for this item. + * + * @since 7.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the relevant token in + * the stack. + * @param array $itemInfo Base information about the item. + * @param array $errorInfo Array with detail (version) information + * relevant to the item. + * + * @return void + */ + public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) + { + $itemName = $this->getItemName($itemInfo, $errorInfo); + $error = $this->getErrorMsgTemplate(); + + $errorCode = $this->stringToErrorCode($itemName); + $data = array($itemName); + + if ($errorInfo['deprecated'] !== '') { + $error .= 'deprecated since PHP %s and '; + $errorCode .= 'Deprecated'; + $data[] = $errorInfo['deprecated']; + } + + if ($errorInfo['removed'] !== '') { + $error .= 'removed since PHP %s and '; + $errorCode .= 'Removed'; + $data[] = $errorInfo['removed']; + } + + // Remove the last 'and' from the message. + $error = substr($error, 0, (\strlen($error) - 5)); + + if ($errorInfo['alternative'] !== '') { + $error .= $this->getAlternativeOptionTemplate(); + $data[] = $errorInfo['alternative']; + } + + $error = $this->filterErrorMsg($error, $itemInfo, $errorInfo); + $data = $this->filterErrorData($data, $itemInfo, $errorInfo); + + $this->addMessage($phpcsFile, $error, $stackPtr, $errorInfo['error'], $errorCode, $data); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ComplexVersionInterface.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ComplexVersionInterface.php new file mode 100644 index 00000000..f5f63bbf --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ComplexVersionInterface.php @@ -0,0 +1,84 @@ +config; + if (isset($config->{$key})) { + return $config->{$key}; + } + } else { + // PHPCS 2.x. + $config = $phpcsFile->phpcs->cli->getCommandLineValues(); + if (isset($config[$key])) { + return $config[$key]; + } + } + + return null; + } + + + /** + * Returns the position of the first non-whitespace token in a statement. + * + * {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` + * class and introduced in PHPCS 2.1.0 and improved in PHPCS 2.7.1. + * + * Once the minimum supported PHPCS version for this standard goes beyond + * that, this method can be removed and calls to it replaced with + * `$phpcsFile->findStartOfStatement($start, $ignore)` calls. + * + * Last synced with PHPCS version: PHPCS 3.3.2 at commit 6ad28354c04b364c3c71a34e4a18b629cc3b231e} + * + * @since 9.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int $start The position to start searching from in the token stack. + * @param int|array $ignore Token types that should not be considered stop points. + * + * @return int + */ + public static function findStartOfStatement(File $phpcsFile, $start, $ignore = null) + { + if (version_compare(self::getVersion(), '2.7.1', '>=') === true) { + return $phpcsFile->findStartOfStatement($start, $ignore); + } + + $tokens = $phpcsFile->getTokens(); + $endTokens = Tokens::$blockOpeners; + + $endTokens[\T_COLON] = true; + $endTokens[\T_COMMA] = true; + $endTokens[\T_DOUBLE_ARROW] = true; + $endTokens[\T_SEMICOLON] = true; + $endTokens[\T_OPEN_TAG] = true; + $endTokens[\T_CLOSE_TAG] = true; + $endTokens[\T_OPEN_SHORT_ARRAY] = true; + + if ($ignore !== null) { + $ignore = (array) $ignore; + foreach ($ignore as $code) { + if (isset($endTokens[$code]) === true) { + unset($endTokens[$code]); + } + } + } + + $lastNotEmpty = $start; + + for ($i = $start; $i >= 0; $i--) { + if (isset($endTokens[$tokens[$i]['code']]) === true) { + // Found the end of the previous statement. + return $lastNotEmpty; + } + + if (isset($tokens[$i]['scope_opener']) === true + && $i === $tokens[$i]['scope_closer'] + ) { + // Found the end of the previous scope block. + return $lastNotEmpty; + } + + // Skip nested statements. + if (isset($tokens[$i]['bracket_opener']) === true + && $i === $tokens[$i]['bracket_closer'] + ) { + $i = $tokens[$i]['bracket_opener']; + } elseif (isset($tokens[$i]['parenthesis_opener']) === true + && $i === $tokens[$i]['parenthesis_closer'] + ) { + $i = $tokens[$i]['parenthesis_opener']; + } + + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { + $lastNotEmpty = $i; + } + }//end for + + return 0; + } + + + /** + * Returns the position of the last non-whitespace token in a statement. + * + * {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` + * class and introduced in PHPCS 2.1.0 and improved in PHPCS 2.7.1 and 3.3.0. + * + * Once the minimum supported PHPCS version for this standard goes beyond + * that, this method can be removed and calls to it replaced with + * `$phpcsFile->findEndOfStatement($start, $ignore)` calls. + * + * Last synced with PHPCS version: PHPCS 3.3.0-alpha at commit f5d899dcb5c534a1c3cca34668624517856ba823} + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int $start The position to start searching from in the token stack. + * @param int|array $ignore Token types that should not be considered stop points. + * + * @return int + */ + public static function findEndOfStatement(File $phpcsFile, $start, $ignore = null) + { + if (version_compare(self::getVersion(), '3.3.0', '>=') === true) { + return $phpcsFile->findEndOfStatement($start, $ignore); + } + + $tokens = $phpcsFile->getTokens(); + $endTokens = array( + \T_COLON => true, + \T_COMMA => true, + \T_DOUBLE_ARROW => true, + \T_SEMICOLON => true, + \T_CLOSE_PARENTHESIS => true, + \T_CLOSE_SQUARE_BRACKET => true, + \T_CLOSE_CURLY_BRACKET => true, + \T_CLOSE_SHORT_ARRAY => true, + \T_OPEN_TAG => true, + \T_CLOSE_TAG => true, + ); + + if ($ignore !== null) { + $ignore = (array) $ignore; + foreach ($ignore as $code) { + if (isset($endTokens[$code]) === true) { + unset($endTokens[$code]); + } + } + } + + $lastNotEmpty = $start; + + for ($i = $start; $i < $phpcsFile->numTokens; $i++) { + if ($i !== $start && isset($endTokens[$tokens[$i]['code']]) === true) { + // Found the end of the statement. + if ($tokens[$i]['code'] === \T_CLOSE_PARENTHESIS + || $tokens[$i]['code'] === \T_CLOSE_SQUARE_BRACKET + || $tokens[$i]['code'] === \T_CLOSE_CURLY_BRACKET + || $tokens[$i]['code'] === \T_CLOSE_SHORT_ARRAY + || $tokens[$i]['code'] === \T_OPEN_TAG + || $tokens[$i]['code'] === \T_CLOSE_TAG + ) { + return $lastNotEmpty; + } + + return $i; + } + + // Skip nested statements. + if (isset($tokens[$i]['scope_closer']) === true + && ($i === $tokens[$i]['scope_opener'] + || $i === $tokens[$i]['scope_condition']) + ) { + if ($i === $start && isset(Tokens::$scopeOpeners[$tokens[$i]['code']]) === true) { + return $tokens[$i]['scope_closer']; + } + + $i = $tokens[$i]['scope_closer']; + } elseif (isset($tokens[$i]['bracket_closer']) === true + && $i === $tokens[$i]['bracket_opener'] + ) { + $i = $tokens[$i]['bracket_closer']; + } elseif (isset($tokens[$i]['parenthesis_closer']) === true + && $i === $tokens[$i]['parenthesis_opener'] + ) { + $i = $tokens[$i]['parenthesis_closer']; + } + + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { + $lastNotEmpty = $i; + } + }//end for + + return ($phpcsFile->numTokens - 1); + } + + + /** + * Returns the name of the class that the specified class extends + * (works for classes, anonymous classes and interfaces). + * + * Returns FALSE on error or if there is no extended class name. + * + * {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` + * class, but with some improvements which have been introduced in + * PHPCS 2.8.0. + * {@link https://github.com/squizlabs/PHP_CodeSniffer/commit/0011d448119d4c568e3ac1f825ae78815bf2cc34}. + * + * Once the minimum supported PHPCS version for this standard goes beyond + * that, this method can be removed and calls to it replaced with + * `$phpcsFile->findExtendedClassName($stackPtr)` calls. + * + * Last synced with PHPCS version: PHPCS 3.1.0-alpha at commit a9efcc9b0703f3f9f4a900623d4e97128a6aafc6} + * + * @since 7.1.4 + * @since 8.2.0 Moved from the `Sniff` class to this class. + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int $stackPtr The position of the class token in the stack. + * + * @return string|false + */ + public static function findExtendedClassName(File $phpcsFile, $stackPtr) + { + if (version_compare(self::getVersion(), '3.1.0', '>=') === true) { + return $phpcsFile->findExtendedClassName($stackPtr); + } + + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return false; + } + + if ($tokens[$stackPtr]['code'] !== \T_CLASS + && $tokens[$stackPtr]['type'] !== 'T_ANON_CLASS' + && $tokens[$stackPtr]['type'] !== 'T_INTERFACE' + ) { + return false; + } + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return false; + } + + $classCloserIndex = $tokens[$stackPtr]['scope_closer']; + $extendsIndex = $phpcsFile->findNext(\T_EXTENDS, $stackPtr, $classCloserIndex); + if ($extendsIndex === false) { + return false; + } + + $find = array( + \T_NS_SEPARATOR, + \T_STRING, + \T_WHITESPACE, + ); + + $end = $phpcsFile->findNext($find, ($extendsIndex + 1), $classCloserIndex, true); + $name = $phpcsFile->getTokensAsString(($extendsIndex + 1), ($end - $extendsIndex - 1)); + $name = trim($name); + + if ($name === '') { + return false; + } + + return $name; + } + + + /** + * Returns the name(s) of the interface(s) that the specified class implements. + * + * Returns FALSE on error or if there are no implemented interface names. + * + * {@internal Duplicate of same method as introduced in PHPCS 2.7. + * This method also includes an improvement we use which was only introduced + * in PHPCS 2.8.0, so only defer to upstream for higher versions. + * Once the minimum supported PHPCS version for this sniff library goes beyond + * that, this method can be removed and calls to it replaced with + * `$phpcsFile->findImplementedInterfaceNames($stackPtr)` calls.} + * + * @since 7.0.3 + * @since 8.2.0 Moved from the `Sniff` class to this class. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the class token. + * + * @return array|false + */ + public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr) + { + if (version_compare(self::getVersion(), '2.7.1', '>') === true) { + return $phpcsFile->findImplementedInterfaceNames($stackPtr); + } + + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return false; + } + + if ($tokens[$stackPtr]['code'] !== \T_CLASS + && $tokens[$stackPtr]['type'] !== 'T_ANON_CLASS' + ) { + return false; + } + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return false; + } + + $classOpenerIndex = $tokens[$stackPtr]['scope_opener']; + $implementsIndex = $phpcsFile->findNext(\T_IMPLEMENTS, $stackPtr, $classOpenerIndex); + if ($implementsIndex === false) { + return false; + } + + $find = array( + \T_NS_SEPARATOR, + \T_STRING, + \T_WHITESPACE, + \T_COMMA, + ); + + $end = $phpcsFile->findNext($find, ($implementsIndex + 1), ($classOpenerIndex + 1), true); + $name = $phpcsFile->getTokensAsString(($implementsIndex + 1), ($end - $implementsIndex - 1)); + $name = trim($name); + + if ($name === '') { + return false; + } else { + $names = explode(',', $name); + $names = array_map('trim', $names); + return $names; + } + } + + + /** + * Returns the method parameters for the specified function token. + * + * Each parameter is in the following format: + * + * + * 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. + * 'pass_by_reference' => boolean, // Is the variable passed by reference? + * 'variable_length' => boolean, // Is the param of variable length through use of `...` ? + * 'type_hint' => string, // The type hint for the variable. + * 'type_hint_token' => integer, // The stack pointer to the type hint + * // or false if there is no type hint. + * 'nullable_type' => boolean, // Is the variable using a nullable type? + * ) + * + * + * Parameters with default values have an additional array index of + * 'default' with the value of the default as a string. + * + * {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` + * class. + * + * Last synced with PHPCS version: PHPCS 3.3.0-alpha at commit 53a28408d345044c0360c2c1b4a2aaebf4a3b8c9} + * + * @since 7.0.3 + * @since 8.2.0 Moved from the `Sniff` class to this class. + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int $stackPtr The position in the stack of the + * function token to acquire the + * parameters for. + * + * @return array|false + * @throws \PHP_CodeSniffer_Exception If the specified $stackPtr is not of + * type T_FUNCTION or T_CLOSURE. + */ + public static function getMethodParameters(File $phpcsFile, $stackPtr) + { + if (version_compare(self::getVersion(), '3.3.0', '>=') === true) { + return $phpcsFile->getMethodParameters($stackPtr); + } + + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return false; + } + + if ($tokens[$stackPtr]['code'] !== \T_FUNCTION + && $tokens[$stackPtr]['code'] !== \T_CLOSURE + ) { + throw new PHPCS_Exception('$stackPtr must be of type T_FUNCTION or T_CLOSURE'); + } + + $opener = $tokens[$stackPtr]['parenthesis_opener']; + $closer = $tokens[$stackPtr]['parenthesis_closer']; + + $vars = array(); + $currVar = null; + $paramStart = ($opener + 1); + $defaultStart = null; + $paramCount = 0; + $passByReference = false; + $variableLength = false; + $typeHint = ''; + $typeHintToken = false; + $nullableType = false; + + for ($i = $paramStart; $i <= $closer; $i++) { + // Check to see if this token has a parenthesis or bracket opener. If it does + // it's likely to be an array which might have arguments in it. This + // could cause problems in our parsing below, so lets just skip to the + // end of it. + if (isset($tokens[$i]['parenthesis_opener']) === true) { + // Don't do this if it's the close parenthesis for the method. + if ($i !== $tokens[$i]['parenthesis_closer']) { + $i = ($tokens[$i]['parenthesis_closer'] + 1); + } + } + + if (isset($tokens[$i]['bracket_opener']) === true) { + // Don't do this if it's the close parenthesis for the method. + if ($i !== $tokens[$i]['bracket_closer']) { + $i = ($tokens[$i]['bracket_closer'] + 1); + } + } + + switch ($tokens[$i]['type']) { + case 'T_BITWISE_AND': + if ($defaultStart === null) { + $passByReference = true; + } + break; + case 'T_VARIABLE': + $currVar = $i; + break; + case 'T_ELLIPSIS': + $variableLength = true; + break; + case 'T_ARRAY_HINT': // Pre-PHPCS 3.3.0. + case 'T_CALLABLE': + if ($typeHintToken === false) { + $typeHintToken = $i; + } + + $typeHint .= $tokens[$i]['content']; + break; + case 'T_SELF': + case 'T_PARENT': + case 'T_STATIC': + // Self and parent are valid, static invalid, but was probably intended as type hint. + if (isset($defaultStart) === false) { + if ($typeHintToken === false) { + $typeHintToken = $i; + } + + $typeHint .= $tokens[$i]['content']; + } + break; + case 'T_STRING': + // This is a string, so it may be a type hint, but it could + // also be a constant used as a default value. + $prevComma = false; + for ($t = $i; $t >= $opener; $t--) { + if ($tokens[$t]['code'] === \T_COMMA) { + $prevComma = $t; + break; + } + } + + if ($prevComma !== false) { + $nextEquals = false; + for ($t = $prevComma; $t < $i; $t++) { + if ($tokens[$t]['code'] === \T_EQUAL) { + $nextEquals = $t; + break; + } + } + + if ($nextEquals !== false) { + break; + } + } + + if ($defaultStart === null) { + if ($typeHintToken === false) { + $typeHintToken = $i; + } + + $typeHint .= $tokens[$i]['content']; + } + break; + case 'T_NS_SEPARATOR': + // Part of a type hint or default value. + if ($defaultStart === null) { + if ($typeHintToken === false) { + $typeHintToken = $i; + } + + $typeHint .= $tokens[$i]['content']; + } + break; + case 'T_NULLABLE': + case 'T_INLINE_THEN': // Pre-PHPCS 2.8.0. + if ($defaultStart === null) { + $nullableType = true; + $typeHint .= $tokens[$i]['content']; + } + break; + case 'T_CLOSE_PARENTHESIS': + case 'T_COMMA': + // If it's null, then there must be no parameters for this + // method. + if ($currVar === null) { + break; + } + + $vars[$paramCount] = array(); + $vars[$paramCount]['token'] = $currVar; + $vars[$paramCount]['name'] = $tokens[$currVar]['content']; + $vars[$paramCount]['content'] = trim($phpcsFile->getTokensAsString($paramStart, ($i - $paramStart))); + + if ($defaultStart !== null) { + $vars[$paramCount]['default'] = trim( + $phpcsFile->getTokensAsString( + $defaultStart, + ($i - $defaultStart) + ) + ); + } + + $vars[$paramCount]['pass_by_reference'] = $passByReference; + $vars[$paramCount]['variable_length'] = $variableLength; + $vars[$paramCount]['type_hint'] = $typeHint; + $vars[$paramCount]['type_hint_token'] = $typeHintToken; + $vars[$paramCount]['nullable_type'] = $nullableType; + + // Reset the vars, as we are about to process the next parameter. + $defaultStart = null; + $paramStart = ($i + 1); + $passByReference = false; + $variableLength = false; + $typeHint = ''; + $typeHintToken = false; + $nullableType = false; + + $paramCount++; + break; + case 'T_EQUAL': + $defaultStart = ($i + 1); + break; + }//end switch + }//end for + + return $vars; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniff.php new file mode 100644 index 00000000..38fb7092 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniff.php @@ -0,0 +1,2267 @@ +prop, self::prop and $var[]. + * + * @since 7.1.2 + * + * @var string + */ + const REGEX_COMPLEX_VARS = '`(?:(\{)?(?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)(?:->\$?(?P>varname)|\[[^\]]+\]|::\$?(?P>varname)|\([^\)]*\))*(?(3)\}|)(?(2)\}|)(?(1)\}|)`'; + + /** + * List of superglobals as an array of strings. + * + * Used by the ForbiddenParameterShadowSuperGlobals and ForbiddenClosureUseVariableNames sniffs. + * + * @since 7.0.0 + * @since 7.1.4 Moved from the `ForbiddenParameterShadowSuperGlobals` sniff to the base `Sniff` class. + * + * @var array + */ + protected $superglobals = array( + '$GLOBALS' => true, + '$_SERVER' => true, + '$_GET' => true, + '$_POST' => true, + '$_FILES' => true, + '$_COOKIE' => true, + '$_SESSION' => true, + '$_REQUEST' => true, + '$_ENV' => true, + ); + + /** + * List of functions using hash algorithm as parameter (always the first parameter). + * + * Used by the new/removed hash algorithm sniffs. + * Key is the function name, value is the 1-based parameter position in the function call. + * + * @since 5.5 + * @since 7.0.7 Moved from the `RemovedHashAlgorithms` sniff to the base `Sniff` class. + * + * @var array + */ + protected $hashAlgoFunctions = array( + 'hash_file' => 1, + 'hash_hmac_file' => 1, + 'hash_hmac' => 1, + 'hash_init' => 1, + 'hash_pbkdf2' => 1, + 'hash' => 1, + ); + + + /** + * List of functions which take an ini directive as parameter (always the first parameter). + * + * Used by the new/removed ini directives sniffs. + * Key is the function name, value is the 1-based parameter position in the function call. + * + * @since 7.1.0 + * + * @var array + */ + protected $iniFunctions = array( + 'ini_get' => 1, + 'ini_set' => 1, + ); + + + /** + * Get the testVersion configuration variable. + * + * The testVersion configuration variable may be in any of the following formats: + * 1) Omitted/empty, in which case no version is specified. This effectively + * disables all the checks for new PHP features provided by this standard. + * 2) A single PHP version number, e.g. "5.4" in which case the standard checks that + * the code will run on that version of PHP (no deprecated features or newer + * features being used). + * 3) A range, e.g. "5.0-5.5", in which case the standard checks the code will run + * on all PHP versions in that range, and that it doesn't use any features that + * were deprecated by the final version in the list, or which were not available + * for the first version in the list. + * We accept ranges where one of the components is missing, e.g. "-5.6" means + * all versions up to PHP 5.6, and "7.0-" means all versions above PHP 7.0. + * PHP version numbers should always be in Major.Minor format. Both "5", "5.3.2" + * would be treated as invalid, and ignored. + * + * @since 7.0.0 + * @since 7.1.3 Now allows for partial ranges such as `5.2-`. + * + * @return array $arrTestVersions will hold 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 \PHP_CodeSniffer_Exception If testVersion is invalid. + */ + private function getTestVersion() + { + static $arrTestVersions = array(); + + $default = array(null, null); + $testVersion = trim(PHPCSHelper::getConfigData('testVersion')); + + if (empty($testVersion) === false && isset($arrTestVersions[$testVersion]) === false) { + + $arrTestVersions[$testVersion] = $default; + + if (preg_match('`^\d+\.\d+$`', $testVersion)) { + $arrTestVersions[$testVersion] = array($testVersion, $testVersion); + return $arrTestVersions[$testVersion]; + } + + if (preg_match('`^(\d+\.\d+)?\s*-\s*(\d+\.\d+)?$`', $testVersion, $matches)) { + if (empty($matches[1]) === false || empty($matches[2]) === false) { + // If no lower-limit is set, we set the min version to 4.0. + // Whilst development focuses on PHP 5 and above, we also accept + // sniffs for PHP 4, so we include that as the minimum. + // (It makes no sense to support PHP 3 as this was effectively a + // different language). + $min = empty($matches[1]) ? '4.0' : $matches[1]; + + // If no upper-limit is set, we set the max version to 99.9. + $max = empty($matches[2]) ? '99.9' : $matches[2]; + + if (version_compare($min, $max, '>')) { + trigger_error( + "Invalid range in testVersion setting: '" . $testVersion . "'", + \E_USER_WARNING + ); + return $default; + } else { + $arrTestVersions[$testVersion] = array($min, $max); + return $arrTestVersions[$testVersion]; + } + } + } + + trigger_error( + "Invalid testVersion setting: '" . $testVersion . "'", + \E_USER_WARNING + ); + return $default; + } + + if (isset($arrTestVersions[$testVersion])) { + return $arrTestVersions[$testVersion]; + } + + return $default; + } + + + /** + * Check whether a specific PHP version is equal to or higher than the maximum + * supported PHP version as provided by the user in `testVersion`. + * + * Should be used when sniffing for *old* PHP features (deprecated/removed). + * + * @since 5.6 + * + * @param string $phpVersion A PHP version number in 'major.minor' format. + * + * @return bool True if testVersion has not been provided or if the PHP version + * is equal to or higher than the highest supported PHP version + * in testVersion. False otherwise. + */ + public function supportsAbove($phpVersion) + { + $testVersion = $this->getTestVersion(); + $testVersion = $testVersion[1]; + + if (\is_null($testVersion) + || version_compare($testVersion, $phpVersion) >= 0 + ) { + return true; + } else { + return false; + } + } + + + /** + * Check whether a specific PHP version is equal to or lower than the minimum + * supported PHP version as provided by the user in `testVersion`. + * + * Should be used when sniffing for *new* PHP features. + * + * @since 5.6 + * + * @param string $phpVersion A PHP version number in 'major.minor' format. + * + * @return bool True if the PHP version is equal to or lower than the lowest + * supported PHP version in testVersion. + * False otherwise or if no testVersion is provided. + */ + public function supportsBelow($phpVersion) + { + $testVersion = $this->getTestVersion(); + $testVersion = $testVersion[0]; + + if (\is_null($testVersion) === false + && version_compare($testVersion, $phpVersion) <= 0 + ) { + return true; + } else { + return false; + } + } + + + /** + * Add a PHPCS message to the output stack as either a warning or an error. + * + * @since 7.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file the message applies to. + * @param string $message The message. + * @param int $stackPtr The position of the token + * the message relates to. + * @param bool $isError Whether to report the message as an + * 'error' or 'warning'. + * 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. + * + * @return void + */ + public function addMessage(File $phpcsFile, $message, $stackPtr, $isError, $code = 'Found', $data = array()) + { + if ($isError === true) { + $phpcsFile->addError($message, $stackPtr, $code, $data); + } else { + $phpcsFile->addWarning($message, $stackPtr, $code, $data); + } + } + + + /** + * Convert an arbitrary string to an alphanumeric string with underscores. + * + * Pre-empt issues with arbitrary strings being used as error codes in XML and PHP. + * + * @since 7.1.0 + * + * @param string $baseString Arbitrary string. + * + * @return string + */ + public function stringToErrorCode($baseString) + { + return preg_replace('`[^a-z0-9_]`i', '_', strtolower($baseString)); + } + + + /** + * Strip quotes surrounding an arbitrary string. + * + * Intended for use with the contents of a T_CONSTANT_ENCAPSED_STRING / T_DOUBLE_QUOTED_STRING. + * + * @since 7.0.6 + * + * @param string $string The raw string. + * + * @return string String without quotes around it. + */ + public function stripQuotes($string) + { + return preg_replace('`^([\'"])(.*)\1$`Ds', '$2', $string); + } + + + /** + * Strip variables from an arbitrary double quoted string. + * + * Intended for use with the contents of a T_DOUBLE_QUOTED_STRING. + * + * @since 7.1.2 + * + * @param string $string The raw string. + * + * @return string String without variables in it. + */ + public function stripVariables($string) + { + if (strpos($string, '$') === false) { + return $string; + } + + return preg_replace(self::REGEX_COMPLEX_VARS, '', $string); + } + + + /** + * Make all top level array keys in an array lowercase. + * + * @since 7.1.0 + * + * @param array $array Initial array. + * + * @return array Same array, but with all lowercase top level keys. + */ + public function arrayKeysToLowercase($array) + { + return array_change_key_case($array, \CASE_LOWER); + } + + + /** + * Checks if a function call has parameters. + * + * Expects to be passed the T_STRING or T_VARIABLE stack pointer for the function call. + * If passed a T_STRING which is *not* a function call, the behaviour is unreliable. + * + * Extra feature: If passed an T_ARRAY or T_OPEN_SHORT_ARRAY stack pointer, it + * will detect whether the array has values or is empty. + * + * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/120 + * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/152 + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the function call token. + * + * @return bool + */ + public function doesFunctionCallHaveParameters(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return false; + } + + // Is this one of the tokens this function handles ? + if (\in_array($tokens[$stackPtr]['code'], array(\T_STRING, \T_ARRAY, \T_OPEN_SHORT_ARRAY, \T_VARIABLE), true) === false) { + return false; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); + + // Deal with short array syntax. + if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + return false; + } + + if ($nextNonEmpty === $tokens[$stackPtr]['bracket_closer']) { + // No parameters. + return false; + } else { + return true; + } + } + + // Deal with function calls & long arrays. + // Next non-empty token should be the open parenthesis. + if ($nextNonEmpty === false && $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { + return false; + } + + if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) { + return false; + } + + $closeParenthesis = $tokens[$nextNonEmpty]['parenthesis_closer']; + $nextNextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $nextNonEmpty + 1, $closeParenthesis + 1, true); + + if ($nextNextNonEmpty === $closeParenthesis) { + // No parameters. + return false; + } + + return true; + } + + + /** + * Count the number of parameters a function call has been passed. + * + * Expects to be passed the T_STRING or T_VARIABLE stack pointer for the function call. + * If passed a T_STRING which is *not* a function call, the behaviour is unreliable. + * + * Extra feature: If passed an T_ARRAY or T_OPEN_SHORT_ARRAY stack pointer, + * it will return the number of values in the array. + * + * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/111 + * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/114 + * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/151 + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the function call token. + * + * @return int + */ + public function getFunctionCallParameterCount(File $phpcsFile, $stackPtr) + { + if ($this->doesFunctionCallHaveParameters($phpcsFile, $stackPtr) === false) { + return 0; + } + + return \count($this->getFunctionCallParameters($phpcsFile, $stackPtr)); + } + + + /** + * Get information on all parameters passed to a function call. + * + * Expects to be passed the T_STRING or T_VARIABLE stack pointer for the function call. + * If passed a T_STRING which is *not* a function call, the behaviour is unreliable. + * + * Will return an multi-dimentional array with the start token pointer, end token + * pointer and raw parameter value for all parameters. Index will be 1-based. + * If no parameters are found, will return an empty array. + * + * Extra feature: If passed an T_ARRAY or T_OPEN_SHORT_ARRAY stack pointer, + * it will tokenize the values / key/value pairs contained in the array call. + * + * @since 7.0.5 Split off from the `getFunctionCallParameterCount()` method. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the function call token. + * + * @return array + */ + public function getFunctionCallParameters(File $phpcsFile, $stackPtr) + { + if ($this->doesFunctionCallHaveParameters($phpcsFile, $stackPtr) === false) { + return array(); + } + + // Ok, we know we have a T_STRING, T_VARIABLE, T_ARRAY or T_OPEN_SHORT_ARRAY with parameters + // and valid open & close brackets/parenthesis. + $tokens = $phpcsFile->getTokens(); + + // Mark the beginning and end tokens. + if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { + $opener = $stackPtr; + $closer = $tokens[$stackPtr]['bracket_closer']; + + $nestedParenthesisCount = 0; + + } else { + $opener = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); + $closer = $tokens[$opener]['parenthesis_closer']; + + $nestedParenthesisCount = 1; + } + + // Which nesting level is the one we are interested in ? + if (isset($tokens[$opener]['nested_parenthesis'])) { + $nestedParenthesisCount += \count($tokens[$opener]['nested_parenthesis']); + } + + $parameters = array(); + $nextComma = $opener; + $paramStart = $opener + 1; + $cnt = 1; + while (($nextComma = $phpcsFile->findNext(array(\T_COMMA, $tokens[$closer]['code'], \T_OPEN_SHORT_ARRAY, \T_CLOSURE), $nextComma + 1, $closer + 1)) !== false) { + // Ignore anything within short array definition brackets. + if ($tokens[$nextComma]['type'] === 'T_OPEN_SHORT_ARRAY' + && (isset($tokens[$nextComma]['bracket_opener']) + && $tokens[$nextComma]['bracket_opener'] === $nextComma) + && isset($tokens[$nextComma]['bracket_closer']) + ) { + // Skip forward to the end of the short array definition. + $nextComma = $tokens[$nextComma]['bracket_closer']; + continue; + } + + // Skip past closures passed as function parameters. + if ($tokens[$nextComma]['type'] === 'T_CLOSURE' + && (isset($tokens[$nextComma]['scope_condition']) + && $tokens[$nextComma]['scope_condition'] === $nextComma) + && isset($tokens[$nextComma]['scope_closer']) + ) { + // Skip forward to the end of the closure declaration. + $nextComma = $tokens[$nextComma]['scope_closer']; + continue; + } + + // Ignore comma's at a lower nesting level. + if ($tokens[$nextComma]['type'] === 'T_COMMA' + && isset($tokens[$nextComma]['nested_parenthesis']) + && \count($tokens[$nextComma]['nested_parenthesis']) !== $nestedParenthesisCount + ) { + continue; + } + + // Ignore closing parenthesis/bracket if not 'ours'. + if ($tokens[$nextComma]['type'] === $tokens[$closer]['type'] && $nextComma !== $closer) { + continue; + } + + // Ok, we've reached the end of the parameter. + $parameters[$cnt]['start'] = $paramStart; + $parameters[$cnt]['end'] = $nextComma - 1; + $parameters[$cnt]['raw'] = trim($phpcsFile->getTokensAsString($paramStart, ($nextComma - $paramStart))); + + /* + * Check if there are more tokens before the closing parenthesis. + * Prevents code like the following from setting a third parameter: + * `functionCall( $param1, $param2, );`. + */ + $hasNextParam = $phpcsFile->findNext(Tokens::$emptyTokens, $nextComma + 1, $closer, true, null, true); + if ($hasNextParam === false) { + break; + } + + // Prepare for the next parameter. + $paramStart = $nextComma + 1; + $cnt++; + } + + return $parameters; + } + + + /** + * Get information on a specific parameter passed to a function call. + * + * Expects to be passed the T_STRING or T_VARIABLE stack pointer for the function call. + * If passed a T_STRING which is *not* a function call, the behaviour is unreliable. + * + * Will return a array with the start token pointer, end token pointer and the raw value + * of the parameter at a specific offset. + * If the specified parameter is not found, will return false. + * + * @since 7.0.5 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the function call token. + * @param int $paramOffset The 1-based index position of the parameter to retrieve. + * + * @return array|false + */ + public function getFunctionCallParameter(File $phpcsFile, $stackPtr, $paramOffset) + { + $parameters = $this->getFunctionCallParameters($phpcsFile, $stackPtr); + + if (isset($parameters[$paramOffset]) === false) { + return false; + } else { + return $parameters[$paramOffset]; + } + } + + + /** + * Verify whether a token is within a scoped condition. + * + * If the optional $validScopes parameter has been passed, the function + * will check that the token has at least one condition which is of a + * type defined in $validScopes. + * + * @since 7.0.5 Largely split off from the `inClassScope()` method. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token. + * @param array|int $validScopes Optional. Array of valid scopes + * or int value of a valid scope. + * Pass the T_.. constant(s) for the + * desired scope to this parameter. + * + * @return bool Without the optional $scopeTypes: True if within a scope, false otherwise. + * If the $scopeTypes are set: True if *one* of the conditions is a + * valid scope, false otherwise. + */ + public function tokenHasScope(File $phpcsFile, $stackPtr, $validScopes = null) + { + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return false; + } + + // No conditions = no scope. + if (empty($tokens[$stackPtr]['conditions'])) { + return false; + } + + // Ok, there are conditions, do we have to check for specific ones ? + if (isset($validScopes) === false) { + return true; + } + + return $phpcsFile->hasCondition($stackPtr, $validScopes); + } + + + /** + * Verify whether a token is within a class scope. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token. + * @param bool $strict Whether to strictly check for the T_CLASS + * scope or also accept interfaces and traits + * as scope. + * + * @return bool True if within class scope, false otherwise. + */ + public function inClassScope(File $phpcsFile, $stackPtr, $strict = true) + { + $validScopes = array(\T_CLASS); + if (\defined('T_ANON_CLASS') === true) { + $validScopes[] = \T_ANON_CLASS; + } + + if ($strict === false) { + $validScopes[] = \T_INTERFACE; + $validScopes[] = \T_TRAIT; + } + + return $phpcsFile->hasCondition($stackPtr, $validScopes); + } + + + /** + * Returns the fully qualified class name for a new class instantiation. + * + * Returns an empty string if the class name could not be reliably inferred. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of a T_NEW token. + * + * @return string + */ + public function getFQClassNameFromNewToken(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return ''; + } + + if ($tokens[$stackPtr]['code'] !== \T_NEW) { + return ''; + } + + $start = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); + if ($start === false) { + return ''; + } + + // Bow out if the next token is a variable as we don't know where it was defined. + if ($tokens[$start]['code'] === \T_VARIABLE) { + return ''; + } + + // Bow out if the next token is the class keyword. + if ($tokens[$start]['type'] === 'T_ANON_CLASS' || $tokens[$start]['code'] === \T_CLASS) { + return ''; + } + + $find = array( + \T_NS_SEPARATOR, + \T_STRING, + \T_NAMESPACE, + \T_WHITESPACE, + ); + + $end = $phpcsFile->findNext($find, ($start + 1), null, true, null, true); + $className = $phpcsFile->getTokensAsString($start, ($end - $start)); + $className = trim($className); + + return $this->getFQName($phpcsFile, $stackPtr, $className); + } + + + /** + * Returns the fully qualified name of the class that the specified class extends. + * + * Returns an empty string if the class does not extend another class or if + * the class name could not be reliably inferred. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of a T_CLASS token. + * + * @return string + */ + public function getFQExtendedClassName(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return ''; + } + + if ($tokens[$stackPtr]['code'] !== \T_CLASS + && $tokens[$stackPtr]['type'] !== 'T_ANON_CLASS' + && $tokens[$stackPtr]['type'] !== 'T_INTERFACE' + ) { + return ''; + } + + $extends = PHPCSHelper::findExtendedClassName($phpcsFile, $stackPtr); + if (empty($extends) || \is_string($extends) === false) { + return ''; + } + + return $this->getFQName($phpcsFile, $stackPtr, $extends); + } + + + /** + * Returns the class name for the static usage of a class. + * This can be a call to a method, the use of a property or constant. + * + * Returns an empty string if the class name could not be reliably inferred. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of a T_NEW token. + * + * @return string + */ + public function getFQClassNameFromDoubleColonToken(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return ''; + } + + if ($tokens[$stackPtr]['code'] !== \T_DOUBLE_COLON) { + return ''; + } + + // Nothing to do if previous token is a variable as we don't know where it was defined. + if ($tokens[$stackPtr - 1]['code'] === \T_VARIABLE) { + return ''; + } + + // Nothing to do if 'parent' or 'static' as we don't know how far the class tree extends. + if (\in_array($tokens[$stackPtr - 1]['code'], array(\T_PARENT, \T_STATIC), true)) { + return ''; + } + + // Get the classname from the class declaration if self is used. + if ($tokens[$stackPtr - 1]['code'] === \T_SELF) { + $classDeclarationPtr = $phpcsFile->findPrevious(\T_CLASS, $stackPtr - 1); + if ($classDeclarationPtr === false) { + return ''; + } + $className = $phpcsFile->getDeclarationName($classDeclarationPtr); + return $this->getFQName($phpcsFile, $classDeclarationPtr, $className); + } + + $find = array( + \T_NS_SEPARATOR, + \T_STRING, + \T_NAMESPACE, + \T_WHITESPACE, + ); + + $start = $phpcsFile->findPrevious($find, $stackPtr - 1, null, true, null, true); + if ($start === false || isset($tokens[($start + 1)]) === false) { + return ''; + } + + $start = ($start + 1); + $className = $phpcsFile->getTokensAsString($start, ($stackPtr - $start)); + $className = trim($className); + + return $this->getFQName($phpcsFile, $stackPtr, $className); + } + + + /** + * Get the Fully Qualified name for a class/function/constant etc. + * + * Checks if a class/function/constant name is already fully qualified and + * if not, enrich it with the relevant namespace information. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token. + * @param string $name The class / function / constant name. + * + * @return string + */ + public function getFQName(File $phpcsFile, $stackPtr, $name) + { + if (strpos($name, '\\') === 0) { + // Already fully qualified. + return $name; + } + + // Remove the namespace keyword if used. + if (strpos($name, 'namespace\\') === 0) { + $name = substr($name, 10); + } + + $namespace = $this->determineNamespace($phpcsFile, $stackPtr); + + if ($namespace === '') { + return '\\' . $name; + } else { + return '\\' . $namespace . '\\' . $name; + } + } + + + /** + * Is the class/function/constant name namespaced or global ? + * + * @since 7.0.3 + * + * @param string $FQName Fully Qualified name of a class, function etc. + * I.e. should always start with a `\`. + * + * @return bool True if namespaced, false if global. + * + * @throws \PHP_CodeSniffer_Exception If the name in the passed parameter + * is not fully qualified. + */ + public function isNamespaced($FQName) + { + if (strpos($FQName, '\\') !== 0) { + throw new PHPCS_Exception('$FQName must be a fully qualified name'); + } + + return (strpos(substr($FQName, 1), '\\') !== false); + } + + + /** + * Determine the namespace name an arbitrary token lives in. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int $stackPtr The token position for which to determine the namespace. + * + * @return string Namespace name or empty string if it couldn't be determined or no namespace applies. + */ + public function determineNamespace(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return ''; + } + + // Check for scoped namespace {}. + if (empty($tokens[$stackPtr]['conditions']) === false) { + $namespacePtr = $phpcsFile->getCondition($stackPtr, \T_NAMESPACE); + if ($namespacePtr !== false) { + $namespace = $this->getDeclaredNamespaceName($phpcsFile, $namespacePtr); + if ($namespace !== false) { + return $namespace; + } + + // We are in a scoped namespace, but couldn't determine the name. Searching for a global namespace is futile. + return ''; + } + } + + /* + * Not in a scoped namespace, so let's see if we can find a non-scoped namespace instead. + * Keeping in mind that: + * - there can be multiple non-scoped namespaces in a file (bad practice, but it happens). + * - the namespace keyword can also be used as part of a function/method call and such. + * - that a non-named namespace resolves to the global namespace. + */ + $previousNSToken = $stackPtr; + $namespace = false; + do { + $previousNSToken = $phpcsFile->findPrevious(\T_NAMESPACE, ($previousNSToken - 1)); + + // Stop if we encounter a scoped namespace declaration as we already know we're not in one. + if (empty($tokens[$previousNSToken]['scope_condition']) === false && $tokens[$previousNSToken]['scope_condition'] === $previousNSToken) { + break; + } + + $namespace = $this->getDeclaredNamespaceName($phpcsFile, $previousNSToken); + + } while ($namespace === false && $previousNSToken !== false); + + // If we still haven't got a namespace, return an empty string. + if ($namespace === false) { + return ''; + } else { + return $namespace; + } + } + + /** + * Get the complete namespace name for a namespace declaration. + * + * For hierarchical namespaces, the name will be composed of several tokens, + * i.e. MyProject\Sub\Level which will be returned together as one string. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int|bool $stackPtr The position of a T_NAMESPACE token. + * + * @return string|false Namespace name or false if not a namespace declaration. + * Namespace name can be an empty string for global namespace declaration. + */ + public function getDeclaredNamespaceName(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if ($stackPtr === false || isset($tokens[$stackPtr]) === false) { + return false; + } + + if ($tokens[$stackPtr]['code'] !== \T_NAMESPACE) { + return false; + } + + if ($tokens[($stackPtr + 1)]['code'] === \T_NS_SEPARATOR) { + // Not a namespace declaration, but use of, i.e. `namespace\someFunction();`. + return false; + } + + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); + if ($tokens[$nextToken]['code'] === \T_OPEN_CURLY_BRACKET) { + /* + * Declaration for global namespace when using multiple namespaces in a file. + * I.e.: `namespace {}`. + */ + return ''; + } + + // Ok, this should be a namespace declaration, so get all the parts together. + $validTokens = array( + \T_STRING => true, + \T_NS_SEPARATOR => true, + \T_WHITESPACE => true, + ); + + $namespaceName = ''; + while (isset($validTokens[$tokens[$nextToken]['code']]) === true) { + $namespaceName .= trim($tokens[$nextToken]['content']); + $nextToken++; + } + + return $namespaceName; + } + + + /** + * Get the stack pointer for a return type token for a given function. + * + * Compatible layer for older PHPCS versions which don't recognize + * return type hints correctly. + * + * Expects to be passed T_RETURN_TYPE, T_FUNCTION or T_CLOSURE token. + * + * @since 7.1.2 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token. + * + * @return int|false Stack pointer to the return type token or false if + * no return type was found or the passed token was + * not of the correct type. + */ + public function getReturnTypeHintToken(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (\defined('T_RETURN_TYPE') && $tokens[$stackPtr]['code'] === \T_RETURN_TYPE) { + return $stackPtr; + } + + if ($tokens[$stackPtr]['code'] !== \T_FUNCTION && $tokens[$stackPtr]['code'] !== \T_CLOSURE) { + return false; + } + + if (isset($tokens[$stackPtr]['parenthesis_closer']) === false) { + return false; + } + + // Allow for interface and abstract method declarations. + $endOfFunctionDeclaration = null; + if (isset($tokens[$stackPtr]['scope_opener'])) { + $endOfFunctionDeclaration = $tokens[$stackPtr]['scope_opener']; + } else { + $nextSemiColon = $phpcsFile->findNext(\T_SEMICOLON, ($tokens[$stackPtr]['parenthesis_closer'] + 1), null, false, null, true); + if ($nextSemiColon !== false) { + $endOfFunctionDeclaration = $nextSemiColon; + } + } + + if (isset($endOfFunctionDeclaration) === false) { + return false; + } + + $hasColon = $phpcsFile->findNext( + array(\T_COLON, \T_INLINE_ELSE), + ($tokens[$stackPtr]['parenthesis_closer'] + 1), + $endOfFunctionDeclaration + ); + if ($hasColon === false) { + return false; + } + + /* + * - `self`, `parent` and `callable` are not being recognized as return types in PHPCS < 2.6.0. + * - Return types are not recognized at all in PHPCS < 2.4.0. + * - The T_RETURN_TYPE token is defined, but no longer in use since PHPCS 3.3.0+. + * The token will now be tokenized as T_STRING. + * - An `array` (return) type declaration was tokenized as `T_ARRAY_HINT` in PHPCS 2.3.3 - 3.2.3 + * to prevent confusing sniffs looking for array declarations. + * As of PHPCS 3.3.0 `array` as a type declaration will be tokenized as `T_STRING`. + */ + $unrecognizedTypes = array( + \T_CALLABLE, + \T_SELF, + \T_PARENT, + \T_ARRAY, // PHPCS < 2.4.0. + \T_STRING, + ); + + return $phpcsFile->findPrevious($unrecognizedTypes, ($endOfFunctionDeclaration - 1), $hasColon); + } + + + /** + * Get the complete return type declaration for a given function. + * + * Cross-version compatible way to retrieve the complete return type declaration. + * + * For a classname-based return type, PHPCS, as well as the Sniff::getReturnTypeHintToken() + * method will mark the classname as the return type token. + * This method will find preceeding namespaces and namespace separators and will return a + * string containing the qualified return type declaration. + * + * Expects to be passed a T_RETURN_TYPE token or the return value from a call to + * the Sniff::getReturnTypeHintToken() method. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the return type token. + * + * @return string The name of the return type token. + */ + public function getReturnTypeHintName(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // In older PHPCS versions, the nullable indicator will turn a return type colon into a T_INLINE_ELSE. + $colon = $phpcsFile->findPrevious(array(\T_COLON, \T_INLINE_ELSE, \T_FUNCTION, \T_CLOSE_PARENTHESIS), ($stackPtr - 1)); + if ($colon === false + || ($tokens[$colon]['code'] !== \T_COLON && $tokens[$colon]['code'] !== \T_INLINE_ELSE) + ) { + // Shouldn't happen, just in case. + return ''; + } + + $returnTypeHint = ''; + for ($i = ($colon + 1); $i <= $stackPtr; $i++) { + // As of PHPCS 3.3.0+, all tokens are tokenized as "normal", so T_CALLABLE, T_SELF etc are + // all possible, just exclude anything that's regarded as empty and the nullable indicator. + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']])) { + continue; + } + + if ($tokens[$i]['type'] === 'T_NULLABLE') { + continue; + } + + if (\defined('T_NULLABLE') === false && $tokens[$i]['code'] === \T_INLINE_THEN) { + // Old PHPCS. + continue; + } + + $returnTypeHint .= $tokens[$i]['content']; + } + + return $returnTypeHint; + } + + + /** + * Check whether a T_VARIABLE token is a class property declaration. + * + * Compatibility layer for PHPCS cross-version compatibility + * as PHPCS 2.4.0 - 2.7.1 does not have good enough support for + * anonymous classes. Along the same lines, the`getMemberProperties()` + * method does not support the `var` prefix. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int $stackPtr The position in the stack of the + * T_VARIABLE token to verify. + * + * @return bool + */ + public function isClassProperty(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_VARIABLE) { + return false; + } + + // Note: interfaces can not declare properties. + $validScopes = array( + 'T_CLASS' => true, + 'T_ANON_CLASS' => true, + 'T_TRAIT' => true, + ); + + $scopePtr = $this->validDirectScope($phpcsFile, $stackPtr, $validScopes); + if ($scopePtr !== false) { + // Make sure it's not a method parameter. + if (empty($tokens[$stackPtr]['nested_parenthesis']) === true) { + return true; + } else { + $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']); + $deepestOpen = array_pop($parenthesis); + if ($deepestOpen < $scopePtr + || isset($tokens[$deepestOpen]['parenthesis_owner']) === false + || $tokens[$tokens[$deepestOpen]['parenthesis_owner']]['code'] !== \T_FUNCTION + ) { + return true; + } + } + } + + return false; + } + + + /** + * Check whether a T_CONST token is a class constant declaration. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int $stackPtr The position in the stack of the + * T_CONST token to verify. + * + * @return bool + */ + public function isClassConstant(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_CONST) { + return false; + } + + // Note: traits can not declare constants. + $validScopes = array( + 'T_CLASS' => true, + 'T_ANON_CLASS' => true, + 'T_INTERFACE' => true, + ); + if ($this->validDirectScope($phpcsFile, $stackPtr, $validScopes) !== false) { + return true; + } + + return false; + } + + + /** + * Check whether the direct wrapping scope of a token is within a limited set of + * acceptable tokens. + * + * Used to check, for instance, if a T_CONST is a class constant. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int $stackPtr The position in the stack of the + * token to verify. + * @param array $validScopes Array of token types. + * Keys should be the token types in string + * format to allow for newer token types. + * Value is irrelevant. + * + * @return int|bool StackPtr to the scope if valid, false otherwise. + */ + protected function validDirectScope(File $phpcsFile, $stackPtr, $validScopes) + { + $tokens = $phpcsFile->getTokens(); + + if (empty($tokens[$stackPtr]['conditions']) === true) { + return false; + } + + /* + * Check only the direct wrapping scope of the token. + */ + $conditions = array_keys($tokens[$stackPtr]['conditions']); + $ptr = array_pop($conditions); + + if (isset($tokens[$ptr]) === false) { + return false; + } + + if (isset($validScopes[$tokens[$ptr]['type']]) === true) { + return $ptr; + } + + return false; + } + + + /** + * Get an array of just the type hints from a function declaration. + * + * Expects to be passed T_FUNCTION or T_CLOSURE token. + * + * Strips potential nullable indicator and potential global namespace + * indicator from the type hints before returning them. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token. + * + * @return array Array with type hints or an empty array if + * - the function does not have any parameters + * - no type hints were found + * - or the passed token was not of the correct type. + */ + public function getTypeHintsFromFunctionDeclaration(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] !== \T_FUNCTION && $tokens[$stackPtr]['code'] !== \T_CLOSURE) { + return array(); + } + + $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); + if (empty($parameters) || \is_array($parameters) === false) { + return array(); + } + + $typeHints = array(); + + foreach ($parameters as $param) { + if ($param['type_hint'] === '') { + continue; + } + + // Strip off potential nullable indication. + $typeHint = ltrim($param['type_hint'], '?'); + + // Strip off potential (global) namespace indication. + $typeHint = ltrim($typeHint, '\\'); + + if ($typeHint !== '') { + $typeHints[] = $typeHint; + } + } + + return $typeHints; + } + + + /** + * Get the hash algorithm name from the parameter in a hash function call. + * + * @since 7.0.7 Logic was originally contained in the `RemovedHashAlgorithms` sniff. + * + * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. + * @param int $stackPtr The position of the T_STRING function token. + * + * @return string|false The algorithm name without quotes if this was a relevant hash + * function call or false if it was not. + */ + public function getHashAlgorithmParameter(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return false; + } + + if ($tokens[$stackPtr]['code'] !== \T_STRING) { + return false; + } + + $functionName = $tokens[$stackPtr]['content']; + $functionNameLc = strtolower($functionName); + + // Bow out if not one of the functions we're targetting. + if (isset($this->hashAlgoFunctions[$functionNameLc]) === false) { + return false; + } + + // Get the parameter from the function call which should contain the algorithm name. + $algoParam = $this->getFunctionCallParameter($phpcsFile, $stackPtr, $this->hashAlgoFunctions[$functionNameLc]); + if ($algoParam === false) { + return false; + } + + // Algorithm is a text string, so we need to remove the quotes. + $algo = strtolower(trim($algoParam['raw'])); + $algo = $this->stripQuotes($algo); + + return $algo; + } + + + /** + * Determine whether an arbitrary T_STRING token is the use of a global constant. + * + * @since 8.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the T_STRING token. + * + * @return bool + */ + public function isUseOfGlobalConstant(File $phpcsFile, $stackPtr) + { + static $isLowPHPCS, $isLowPHP; + + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return false; + } + + // Is this one of the tokens this function handles ? + if ($tokens[$stackPtr]['code'] !== \T_STRING) { + return false; + } + + // Check for older PHP, PHPCS version so we can compensate for misidentified tokens. + if (isset($isLowPHPCS, $isLowPHP) === false) { + $isLowPHP = false; + $isLowPHPCS = false; + if (version_compare(\PHP_VERSION_ID, '50400', '<')) { + $isLowPHP = true; + $isLowPHPCS = version_compare(PHPCSHelper::getVersion(), '2.4.0', '<'); + } + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($next !== false + && ($tokens[$next]['code'] === \T_OPEN_PARENTHESIS + || $tokens[$next]['code'] === \T_DOUBLE_COLON) + ) { + // Function call or declaration. + return false; + } + + // Array of tokens which if found preceding the $stackPtr indicate that a T_STRING is not a global constant. + $tokensToIgnore = array( + 'T_NAMESPACE' => true, + 'T_USE' => true, + 'T_CLASS' => true, + 'T_TRAIT' => true, + 'T_INTERFACE' => true, + 'T_EXTENDS' => true, + 'T_IMPLEMENTS' => true, + 'T_NEW' => true, + 'T_FUNCTION' => true, + 'T_DOUBLE_COLON' => true, + 'T_OBJECT_OPERATOR' => true, + 'T_INSTANCEOF' => true, + 'T_INSTEADOF' => true, + 'T_GOTO' => true, + 'T_AS' => true, + 'T_PUBLIC' => true, + 'T_PROTECTED' => true, + 'T_PRIVATE' => true, + ); + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prev !== false + && (isset($tokensToIgnore[$tokens[$prev]['type']]) === true + || ($tokens[$prev]['code'] === \T_STRING + && (($isLowPHPCS === true + && $tokens[$prev]['content'] === 'trait') + || ($isLowPHP === true + && $tokens[$prev]['content'] === 'insteadof')))) + ) { + // Not the use of a constant. + return false; + } + + if ($prev !== false + && $tokens[$prev]['code'] === \T_NS_SEPARATOR + && $tokens[($prev - 1)]['code'] === \T_STRING + ) { + // Namespaced constant of the same name. + return false; + } + + if ($prev !== false + && $tokens[$prev]['code'] === \T_CONST + && $this->isClassConstant($phpcsFile, $prev) === true + ) { + // Class constant declaration of the same name. + return false; + } + + /* + * Deal with a number of variations of use statements. + */ + for ($i = $stackPtr; $i > 0; $i--) { + if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) { + break; + } + } + + $firstOnLine = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); + if ($firstOnLine !== false && $tokens[$firstOnLine]['code'] === \T_USE) { + $nextOnLine = $phpcsFile->findNext(Tokens::$emptyTokens, ($firstOnLine + 1), null, true); + if ($nextOnLine !== false) { + if (($tokens[$nextOnLine]['code'] === \T_STRING && $tokens[$nextOnLine]['content'] === 'const') + || $tokens[$nextOnLine]['code'] === \T_CONST // Happens in some PHPCS versions. + ) { + $hasNsSep = $phpcsFile->findNext(\T_NS_SEPARATOR, ($nextOnLine + 1), $stackPtr); + if ($hasNsSep !== false) { + // Namespaced const (group) use statement. + return false; + } + } else { + // Not a const use statement. + return false; + } + } + } + + return true; + } + + + /** + * Determine whether the tokens between $start and $end together form a positive number + * as recognized by PHP. + * + * The outcome of this function is reliable for `true`, `false` should be regarded as + * "undetermined". + * + * Note: Zero is *not* regarded as a positive number. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $start Start of the snippet (inclusive), i.e. this + * token will be examined as part of the snippet. + * @param int $end End of the snippet (inclusive), i.e. this + * token will be examined as part of the snippet. + * @param bool $allowFloats Whether to only consider integers, or also floats. + * + * @return bool True if PHP would evaluate the snippet as a positive number. + * False if not or if it could not be reliably determined + * (variable or calculations and such). + */ + public function isPositiveNumber(File $phpcsFile, $start, $end, $allowFloats = false) + { + $number = $this->isNumber($phpcsFile, $start, $end, $allowFloats); + + if ($number === false) { + return false; + } + + return ($number > 0); + } + + + /** + * Determine whether the tokens between $start and $end together form a negative number + * as recognized by PHP. + * + * The outcome of this function is reliable for `true`, `false` should be regarded as + * "undetermined". + * + * Note: Zero is *not* regarded as a negative number. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $start Start of the snippet (inclusive), i.e. this + * token will be examined as part of the snippet. + * @param int $end End of the snippet (inclusive), i.e. this + * token will be examined as part of the snippet. + * @param bool $allowFloats Whether to only consider integers, or also floats. + * + * @return bool True if PHP would evaluate the snippet as a negative number. + * False if not or if it could not be reliably determined + * (variable or calculations and such). + */ + public function isNegativeNumber(File $phpcsFile, $start, $end, $allowFloats = false) + { + $number = $this->isNumber($phpcsFile, $start, $end, $allowFloats); + + if ($number === false) { + return false; + } + + return ($number < 0); + } + + /** + * Determine whether the tokens between $start and $end together form a number + * as recognized by PHP. + * + * The outcome of this function is reliable for "true-ish" values, `false` should + * be regarded as "undetermined". + * + * @link https://3v4l.org/npTeM + * + * Mainly intended for examining variable assignments, function call parameters, array values + * where the start and end of the snippet to examine is very clear. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $start Start of the snippet (inclusive), i.e. this + * token will be examined as part of the snippet. + * @param int $end End of the snippet (inclusive), i.e. this + * token will be examined as part of the snippet. + * @param bool $allowFloats Whether to only consider integers, or also floats. + * + * @return int|float|bool The number found if PHP would evaluate the snippet as a number. + * The return type will be int if $allowFloats is false, if + * $allowFloats is true, the return type will be float. + * False will be returned when the snippet does not evaluate to a + * number or if it could not be reliably determined + * (variable or calculations and such). + */ + protected function isNumber(File $phpcsFile, $start, $end, $allowFloats = false) + { + $stringTokens = Tokens::$heredocTokens + Tokens::$stringTokens; + + $validTokens = array(); + $validTokens[\T_LNUMBER] = true; + $validTokens[\T_TRUE] = true; // Evaluates to int 1. + $validTokens[\T_FALSE] = true; // Evaluates to int 0. + $validTokens[\T_NULL] = true; // Evaluates to int 0. + + if ($allowFloats === true) { + $validTokens[\T_DNUMBER] = true; + } + + $maybeValidTokens = $stringTokens + $validTokens; + + $tokens = $phpcsFile->getTokens(); + $searchEnd = ($end + 1); + $negativeNumber = false; + + if (isset($tokens[$start], $tokens[$searchEnd]) === false) { + return false; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $start, $searchEnd, true); + while ($nextNonEmpty !== false + && ($tokens[$nextNonEmpty]['code'] === \T_PLUS + || $tokens[$nextNonEmpty]['code'] === \T_MINUS) + ) { + + if ($tokens[$nextNonEmpty]['code'] === \T_MINUS) { + $negativeNumber = ($negativeNumber === false) ? true : false; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), $searchEnd, true); + } + + if ($nextNonEmpty === false || isset($maybeValidTokens[$tokens[$nextNonEmpty]['code']]) === false) { + return false; + } + + $content = false; + if ($tokens[$nextNonEmpty]['code'] === \T_LNUMBER + || $tokens[$nextNonEmpty]['code'] === \T_DNUMBER + ) { + $content = (float) $tokens[$nextNonEmpty]['content']; + } elseif ($tokens[$nextNonEmpty]['code'] === \T_TRUE) { + $content = 1.0; + } elseif ($tokens[$nextNonEmpty]['code'] === \T_FALSE + || $tokens[$nextNonEmpty]['code'] === \T_NULL + ) { + $content = 0.0; + } elseif (isset($stringTokens[$tokens[$nextNonEmpty]['code']]) === true) { + + if ($tokens[$nextNonEmpty]['code'] === \T_START_HEREDOC + || $tokens[$nextNonEmpty]['code'] === \T_START_NOWDOC + ) { + // Skip past heredoc/nowdoc opener to the first content. + $firstDocToken = $phpcsFile->findNext(array(\T_HEREDOC, \T_NOWDOC), ($nextNonEmpty + 1), $searchEnd); + if ($firstDocToken === false) { + // Live coding or parse error. + return false; + } + + $stringContent = $content = $tokens[$firstDocToken]['content']; + + // Skip forward to the end in preparation for the next part of the examination. + $nextNonEmpty = $phpcsFile->findNext(array(\T_END_HEREDOC, \T_END_NOWDOC), ($nextNonEmpty + 1), $searchEnd); + if ($nextNonEmpty === false) { + // Live coding or parse error. + return false; + } + } else { + // Gather subsequent lines for a multi-line string. + for ($i = $nextNonEmpty; $i < $searchEnd; $i++) { + if ($tokens[$i]['code'] !== $tokens[$nextNonEmpty]['code']) { + break; + } + $content .= $tokens[$i]['content']; + } + + $nextNonEmpty = --$i; + $content = $this->stripQuotes($content); + $stringContent = $content; + } + + /* + * Regexes based on the formats outlined in the manual, created by JRF. + * @link https://www.php.net/manual/en/language.types.float.php + */ + $regexInt = '`^\s*[0-9]+`'; + $regexFloat = '`^\s*(?:[+-]?(?:(?:(?P[0-9]+)|(?P([0-9]*\.(?P>LNUM)|(?P>LNUM)\.[0-9]*)))[eE][+-]?(?P>LNUM))|(?P>DNUM))`'; + + $intString = preg_match($regexInt, $content, $intMatch); + $floatString = preg_match($regexFloat, $content, $floatMatch); + + // Does the text string start with a number ? If so, PHP would juggle it and use it as a number. + if ($allowFloats === false) { + if ($intString !== 1 || $floatString === 1) { + if ($floatString === 1) { + // Found float. Only integers targetted. + return false; + } + + $content = 0.0; + } else { + $content = (float) trim($intMatch[0]); + } + } else { + if ($intString !== 1 && $floatString !== 1) { + $content = 0.0; + } else { + $content = ($floatString === 1) ? (float) trim($floatMatch[0]) : (float) trim($intMatch[0]); + } + } + + // Allow for different behaviour for hex numeric strings between PHP 5 vs PHP 7. + if ($intString === 1 && trim($intMatch[0]) === '0' + && preg_match('`^\s*(0x[A-Fa-f0-9]+)`', $stringContent, $hexNumberString) === 1 + && $this->supportsBelow('5.6') === true + ) { + // The filter extension still allows for hex numeric strings in PHP 7, so + // use that to get the numeric value if possible. + // If the filter extension is not available, the value will be zero, but so be it. + if (function_exists('filter_var')) { + $filtered = filter_var($hexNumberString[1], \FILTER_VALIDATE_INT, \FILTER_FLAG_ALLOW_HEX); + if ($filtered !== false) { + $content = $filtered; + } + } + } + } + + // OK, so we have a number, now is there still more code after it ? + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), $searchEnd, true); + if ($nextNonEmpty !== false) { + return false; + } + + if ($negativeNumber === true) { + $content = -$content; + } + + if ($allowFloats === false) { + return (int) $content; + } + + return $content; + } + + + /** + * Determine whether the tokens between $start and $end together form a numberic calculation + * as recognized by PHP. + * + * The outcome of this function is reliable for `true`, `false` should be regarded as "undetermined". + * + * Mainly intended for examining variable assignments, function call parameters, array values + * where the start and end of the snippet to examine is very clear. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $start Start of the snippet (inclusive), i.e. this + * token will be examined as part of the snippet. + * @param int $end End of the snippet (inclusive), i.e. this + * token will be examined as part of the snippet. + * + * @return bool + */ + protected function isNumericCalculation(File $phpcsFile, $start, $end) + { + $arithmeticTokens = Tokens::$arithmeticTokens; + + // phpcs:disable PHPCompatibility.Constants.NewConstants.t_powFound + if (\defined('T_POW') && isset($arithmeticTokens[\T_POW]) === false) { + // T_POW was not added to the arithmetic array until PHPCS 2.9.0. + $arithmeticTokens[\T_POW] = \T_POW; + } + // phpcs:enable + + $skipTokens = Tokens::$emptyTokens; + $skipTokens[] = \T_MINUS; + $skipTokens[] = \T_PLUS; + + // Find the first arithmetic operator, but skip past +/- signs before numbers. + $nextNonEmpty = ($start - 1); + do { + $nextNonEmpty = $phpcsFile->findNext($skipTokens, ($nextNonEmpty + 1), ($end + 1), true); + $arithmeticOperator = $phpcsFile->findNext($arithmeticTokens, ($nextNonEmpty + 1), ($end + 1)); + } while ($nextNonEmpty !== false && $arithmeticOperator !== false && $nextNonEmpty === $arithmeticOperator); + + if ($arithmeticOperator === false) { + return false; + } + + $tokens = $phpcsFile->getTokens(); + $subsetStart = $start; + $subsetEnd = ($arithmeticOperator - 1); + + while ($this->isNumber($phpcsFile, $subsetStart, $subsetEnd, true) !== false + && isset($tokens[($arithmeticOperator + 1)]) === true + ) { + // Recognize T_POW for PHPCS < 2.4.0 on low PHP versions. + if (\defined('T_POW') === false + && $tokens[$arithmeticOperator]['code'] === \T_MULTIPLY + && $tokens[($arithmeticOperator + 1)]['code'] === \T_MULTIPLY + && isset($tokens[$arithmeticOperator + 2]) === true + ) { + // Move operator one forward to the second * in T_POW. + ++$arithmeticOperator; + } + + $subsetStart = ($arithmeticOperator + 1); + $nextNonEmpty = $arithmeticOperator; + do { + $nextNonEmpty = $phpcsFile->findNext($skipTokens, ($nextNonEmpty + 1), ($end + 1), true); + $arithmeticOperator = $phpcsFile->findNext($arithmeticTokens, ($nextNonEmpty + 1), ($end + 1)); + } while ($nextNonEmpty !== false && $arithmeticOperator !== false && $nextNonEmpty === $arithmeticOperator); + + if ($arithmeticOperator === false) { + // Last calculation operator already reached. + if ($this->isNumber($phpcsFile, $subsetStart, $end, true) !== false) { + return true; + } + + return false; + } + + $subsetEnd = ($arithmeticOperator - 1); + } + + return false; + } + + + + /** + * Determine whether a ternary is a short ternary, i.e. without "middle". + * + * N.B.: This is a back-fill for a new method which is expected to go into + * PHP_CodeSniffer 3.5.0. + * Once that method has been merged into PHPCS, this one should be moved + * to the PHPCSHelper.php file. + * + * @since 9.2.0 + * + * @codeCoverageIgnore Method as pulled upstream is accompanied by unit tests. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the ternary operator + * in the stack. + * + * @return bool True if short ternary, or false otherwise. + */ + public function isShortTernary(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]) === false + || $tokens[$stackPtr]['code'] !== \T_INLINE_THEN + ) { + return false; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + // Live coding or parse error. + return false; + } + + if ($tokens[$nextNonEmpty]['code'] === \T_INLINE_ELSE) { + return true; + } + + return false; + } + + + /** + * Determine whether a T_OPEN/CLOSE_SHORT_ARRAY token is a list() construct. + * + * Note: A variety of PHPCS versions have bugs in the tokenizing of short arrays. + * In that case, the tokens are identified as T_OPEN/CLOSE_SQUARE_BRACKET. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the function call token. + * + * @return bool + */ + public function isShortList(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Check for the existence of the token. + if (isset($tokens[$stackPtr]) === false) { + return false; + } + + // Is this one of the tokens this function handles ? + if ($tokens[$stackPtr]['code'] !== \T_OPEN_SHORT_ARRAY + && $tokens[$stackPtr]['code'] !== \T_CLOSE_SHORT_ARRAY + ) { + return false; + } + + switch ($tokens[$stackPtr]['code']) { + case \T_OPEN_SHORT_ARRAY: + if (isset($tokens[$stackPtr]['bracket_closer']) === true) { + $opener = $stackPtr; + $closer = $tokens[$stackPtr]['bracket_closer']; + } + break; + + case \T_CLOSE_SHORT_ARRAY: + if (isset($tokens[$stackPtr]['bracket_opener']) === true) { + $opener = $tokens[$stackPtr]['bracket_opener']; + $closer = $stackPtr; + } + break; + } + + if (isset($opener, $closer) === false) { + // Parse error, live coding or real square bracket. + return false; + } + + /* + * PHPCS cross-version compatibility: work around for square brackets misidentified + * as short array when preceded by a variable variable in older PHPCS versions. + */ + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), null, true, null, true); + + if ($prevNonEmpty !== false + && $tokens[$prevNonEmpty]['code'] === \T_CLOSE_CURLY_BRACKET + && isset($tokens[$prevNonEmpty]['bracket_opener']) === true + ) { + $maybeVariableVariable = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($tokens[$prevNonEmpty]['bracket_opener'] - 1), + null, + true, + null, + true + ); + + if ($tokens[$maybeVariableVariable]['code'] === \T_VARIABLE + || $tokens[$maybeVariableVariable]['code'] === \T_DOLLAR + ) { + return false; + } + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($closer + 1), null, true, null, true); + + if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === \T_EQUAL) { + return true; + } + + if ($prevNonEmpty !== false + && $tokens[$prevNonEmpty]['code'] === \T_AS + && isset($tokens[$prevNonEmpty]['nested_parenthesis']) === true + ) { + $parentheses = array_reverse($tokens[$prevNonEmpty]['nested_parenthesis'], true); + foreach ($parentheses as $open => $close) { + if (isset($tokens[$open]['parenthesis_owner']) + && $tokens[$tokens[$open]['parenthesis_owner']]['code'] === \T_FOREACH + ) { + return true; + } + } + } + + // Maybe this is a short list syntax nested inside another short list syntax ? + $parentOpener = $opener; + do { + $parentOpener = $phpcsFile->findPrevious( + array(\T_OPEN_SHORT_ARRAY, \T_OPEN_SQUARE_BRACKET), + ($parentOpener - 1), + null, + false, + null, + true + ); + + if ($parentOpener === false) { + return false; + } + + } while (isset($tokens[$parentOpener]['bracket_closer']) === true + && $tokens[$parentOpener]['bracket_closer'] < $opener + ); + + if (isset($tokens[$parentOpener]['bracket_closer']) === true + && $tokens[$parentOpener]['bracket_closer'] > $closer + ) { + // Work around tokenizer issue in PHPCS 2.0 - 2.7. + $phpcsVersion = PHPCSHelper::getVersion(); + if ((version_compare($phpcsVersion, '2.0', '>') === true + && version_compare($phpcsVersion, '2.8', '<') === true) + && $tokens[$parentOpener]['code'] === \T_OPEN_SQUARE_BRACKET + ) { + $nextNonEmpty = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($tokens[$parentOpener]['bracket_closer'] + 1), + null, + true, + null, + true + ); + + if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === \T_EQUAL) { + return true; + } + + return false; + } + + return $this->isShortList($phpcsFile, $parentOpener); + } + + return false; + } + + + /** + * Determine whether the tokens between $start and $end could together represent a variable. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $start Starting point stack pointer. Inclusive. + * I.e. this token should be taken into account. + * @param int $end End point stack pointer. Exclusive. + * I.e. this token should not be taken into account. + * @param int $targetNestingLevel The nesting level the variable should be at. + * + * @return bool + */ + public function isVariable(File $phpcsFile, $start, $end, $targetNestingLevel) + { + static $tokenBlackList, $bracketTokens; + + // Create the token arrays only once. + if (isset($tokenBlackList, $bracketTokens) === false) { + + $tokenBlackList = array( + \T_OPEN_PARENTHESIS => \T_OPEN_PARENTHESIS, + \T_STRING_CONCAT => \T_STRING_CONCAT, + ); + $tokenBlackList += Tokens::$assignmentTokens; + $tokenBlackList += Tokens::$equalityTokens; + $tokenBlackList += Tokens::$comparisonTokens; + $tokenBlackList += Tokens::$operators; + $tokenBlackList += Tokens::$booleanOperators; + $tokenBlackList += Tokens::$castTokens; + + /* + * List of brackets which can be part of a variable variable. + * + * Key is the open bracket token, value the close bracket token. + */ + $bracketTokens = array( + \T_OPEN_CURLY_BRACKET => \T_CLOSE_CURLY_BRACKET, + \T_OPEN_SQUARE_BRACKET => \T_CLOSE_SQUARE_BRACKET, + ); + } + + $tokens = $phpcsFile->getTokens(); + + // If no variable at all was found, then it's definitely a no-no. + $hasVariable = $phpcsFile->findNext(\T_VARIABLE, $start, $end); + if ($hasVariable === false) { + return false; + } + + // Check if the variable found is at the right level. Deeper levels are always an error. + if (isset($tokens[$hasVariable]['nested_parenthesis']) + && \count($tokens[$hasVariable]['nested_parenthesis']) !== $targetNestingLevel + ) { + return false; + } + + // Ok, so the first variable is at the right level, now are there any + // blacklisted tokens within the empty() ? + $hasBadToken = $phpcsFile->findNext($tokenBlackList, $start, $end); + if ($hasBadToken === false) { + return true; + } + + // If there are also bracket tokens, the blacklisted token might be part of a variable + // variable, but if there are no bracket tokens, we know we have an error. + $hasBrackets = $phpcsFile->findNext($bracketTokens, $start, $end); + if ($hasBrackets === false) { + return false; + } + + // Ok, we have both a blacklisted token as well as brackets, so we need to walk + // the tokens of the variable variable. + for ($i = $start; $i < $end; $i++) { + // If this is a bracket token, skip to the end of the bracketed expression. + if (isset($bracketTokens[$tokens[$i]['code']], $tokens[$i]['bracket_closer'])) { + $i = $tokens[$i]['bracket_closer']; + continue; + } + + // If it's a blacklisted token, not within brackets, we have an error. + if (isset($tokenBlackList[$tokens[$i]['code']])) { + return false; + } + } + + return true; + } + + /** + * Determine whether a T_MINUS/T_PLUS token is a unary operator. + * + * N.B.: This is a back-fill for a new method which is expected to go into + * PHP_CodeSniffer 3.5.0. + * Once that method has been merged into PHPCS, this one should be moved + * to the PHPCSHelper.php file. + * + * @since 9.2.0 + * + * @codeCoverageIgnore Method as pulled upstream is accompanied by unit tests. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the plus/minus token. + * + * @return bool True if the token passed is a unary operator. + * False otherwise or if the token is not a T_PLUS/T_MINUS token. + */ + public static function isUnaryPlusMinus(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]) === false + || ($tokens[$stackPtr]['code'] !== \T_PLUS + && $tokens[$stackPtr]['code'] !== \T_MINUS) + ) { + return false; + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($next === false) { + // Live coding or parse error. + return false; + } + + if (isset(Tokens::$operators[$tokens[$next]['code']]) === true) { + // Next token is an operator, so this is not a unary. + return false; + } + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + if ($tokens[$prev]['code'] === \T_RETURN) { + // Just returning a positive/negative value; eg. (return -1). + return true; + } + + if (isset(Tokens::$operators[$tokens[$prev]['code']]) === true) { + // Just trying to operate on a positive/negative value; eg. ($var * -1). + return true; + } + + if (isset(Tokens::$comparisonTokens[$tokens[$prev]['code']]) === true) { + // Just trying to compare a positive/negative value; eg. ($var === -1). + return true; + } + + if (isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === true) { + // Just trying to compare a positive/negative value; eg. ($var || -1 === $b). + return true; + } + + if (isset(Tokens::$assignmentTokens[$tokens[$prev]['code']]) === true) { + // Just trying to assign a positive/negative value; eg. ($var = -1). + return true; + } + + if (isset(Tokens::$castTokens[$tokens[$prev]['code']]) === true) { + // Just casting a positive/negative value; eg. (string) -$var. + return true; + } + + // Other indicators that a plus/minus sign is a unary operator. + $invalidTokens = array( + \T_COMMA => true, + \T_OPEN_PARENTHESIS => true, + \T_OPEN_SQUARE_BRACKET => true, + \T_OPEN_SHORT_ARRAY => true, + \T_COLON => true, + \T_INLINE_THEN => true, + \T_INLINE_ELSE => true, + \T_CASE => true, + \T_OPEN_CURLY_BRACKET => true, + \T_STRING_CONCAT => true, + ); + + if (isset($invalidTokens[$tokens[$prev]['code']]) === true) { + // Just trying to use a positive/negative value; eg. myFunction($var, -2). + return true; + } + + return false; + } + + /** + * Get the complete contents of a multi-line text string. + * + * N.B.: This is a back-fill for a new method which is expected to go into + * PHP_CodeSniffer 3.5.0. + * Once that method has been merged into PHPCS, this one should be moved + * to the PHPCSHelper.php file. + * + * @since 9.3.0 + * + * @codeCoverageIgnore Method as pulled upstream is accompanied by unit tests. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr Pointer to the first text string token + * of a multi-line text string or to a + * Nowdoc/Heredoc opener. + * @param bool $stripQuotes Optional. Whether to strip text delimiter + * quotes off the resulting text string. + * Defaults to true. + * + * @return string + * + * @throws \PHP_CodeSniffer_Exception If the specified position is not a + * valid text string token or if the + * token is not the first text string token. + */ + public function getCompleteTextString(File $phpcsFile, $stackPtr, $stripQuotes = true) + { + $tokens = $phpcsFile->getTokens(); + + // Must be the start of a text string token. + if ($tokens[$stackPtr]['code'] !== \T_START_HEREDOC + && $tokens[$stackPtr]['code'] !== \T_START_NOWDOC + && $tokens[$stackPtr]['code'] !== \T_CONSTANT_ENCAPSED_STRING + && $tokens[$stackPtr]['code'] !== \T_DOUBLE_QUOTED_STRING + ) { + throw new PHPCS_Exception('$stackPtr must be of type T_START_HEREDOC, T_START_NOWDOC, T_CONSTANT_ENCAPSED_STRING or T_DOUBLE_QUOTED_STRING'); + } + + if ($tokens[$stackPtr]['code'] === \T_CONSTANT_ENCAPSED_STRING + || $tokens[$stackPtr]['code'] === \T_DOUBLE_QUOTED_STRING + ) { + $prev = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$stackPtr]['code'] === $tokens[$prev]['code']) { + throw new PHPCS_Exception('$stackPtr must be the start of the text string'); + } + } + + switch ($tokens[$stackPtr]['code']) { + case \T_START_HEREDOC: + $stripQuotes = false; + $targetType = \T_HEREDOC; + $current = ($stackPtr + 1); + break; + + case \T_START_NOWDOC: + $stripQuotes = false; + $targetType = \T_NOWDOC; + $current = ($stackPtr + 1); + break; + + default: + $targetType = $tokens[$stackPtr]['code']; + $current = $stackPtr; + break; + } + + $string = ''; + do { + $string .= $tokens[$current]['content']; + ++$current; + } while ($tokens[$current]['code'] === $targetType); + + if ($stripQuotes === true) { + return $this->stripQuotes($string); + } + + return $string; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenAbstractPrivateMethodsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenAbstractPrivateMethodsSniff.php new file mode 100644 index 00000000..d0d74dfe --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenAbstractPrivateMethodsSniff.php @@ -0,0 +1,90 @@ + true, + 'T_TRAIT' => true, + 'T_ANON_CLASS' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.2.0 + * + * @return array + */ + public function register() + { + return array(\T_FUNCTION); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('5.1') === false) { + return; + } + + if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) === false) { + // Function, not method. + return; + } + + $properties = $phpcsFile->getMethodProperties($stackPtr); + if ($properties['scope'] !== 'private' || $properties['is_abstract'] !== true) { + return; + } + + $phpcsFile->addError( + 'Abstract methods cannot be declared as private since PHP 5.1', + $stackPtr, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php new file mode 100644 index 00000000..572b6fcc --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php @@ -0,0 +1,91 @@ + \T_CLASS, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.0 + * + * @return array + */ + public function register() + { + if (\defined('T_ANON_CLASS')) { + $this->indicators[\T_ANON_CLASS] = \T_ANON_CLASS; + } + + return array(\T_NEW); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsBelow('5.6') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); + if ($nextNonEmpty === false || isset($this->indicators[$tokens[$nextNonEmpty]['code']]) === false) { + return; + } + + // Still here ? In that case, it is an anonymous class. + $phpcsFile->addError( + 'Anonymous classes are not supported in PHP 5.6 or earlier', + $stackPtr, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php new file mode 100644 index 00000000..19e5e439 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php @@ -0,0 +1,913 @@ + array(string => bool)) + */ + protected $newClasses = array( + 'ArrayObject' => array( + '4.4' => false, + '5.0' => true, + ), + 'ArrayIterator' => array( + '4.4' => false, + '5.0' => true, + ), + 'CachingIterator' => array( + '4.4' => false, + '5.0' => true, + ), + 'DirectoryIterator' => array( + '4.4' => false, + '5.0' => true, + ), + 'RecursiveDirectoryIterator' => array( + '4.4' => false, + '5.0' => true, + ), + 'RecursiveIteratorIterator' => array( + '4.4' => false, + '5.0' => true, + ), + 'php_user_filter' => array( + '4.4' => false, + '5.0' => true, + ), + 'tidy' => array( + '4.4' => false, + '5.0' => true, + ), + + 'SimpleXMLElement' => array( + '5.0.0' => false, + '5.0.1' => true, + ), + 'tidyNode' => array( + '5.0.0' => false, + '5.0.1' => true, + ), + + 'libXMLError' => array( + '5.0' => false, + '5.1' => true, + ), + 'PDO' => array( + '5.0' => false, + '5.1' => true, + ), + 'PDOStatement' => array( + '5.0' => false, + '5.1' => true, + ), + 'AppendIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'EmptyIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'FilterIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'InfiniteIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'IteratorIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'LimitIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'NoRewindIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'ParentIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'RecursiveArrayIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'RecursiveCachingIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'RecursiveFilterIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'SimpleXMLIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'SplFileObject' => array( + '5.0' => false, + '5.1' => true, + ), + 'XMLReader' => array( + '5.0' => false, + '5.1' => true, + ), + + 'SplFileInfo' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'SplTempFileObject' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'XMLWriter' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + + 'DateTime' => array( + '5.1' => false, + '5.2' => true, + ), + 'DateTimeZone' => array( + '5.1' => false, + '5.2' => true, + ), + 'RegexIterator' => array( + '5.1' => false, + '5.2' => true, + ), + 'RecursiveRegexIterator' => array( + '5.1' => false, + '5.2' => true, + ), + 'ReflectionFunctionAbstract' => array( + '5.1' => false, + '5.2' => true, + ), + 'ZipArchive' => array( + '5.1' => false, + '5.2' => true, + ), + + 'Closure' => array( + '5.2' => false, + '5.3' => true, + ), + 'DateInterval' => array( + '5.2' => false, + '5.3' => true, + ), + 'DatePeriod' => array( + '5.2' => false, + '5.3' => true, + ), + 'finfo' => array( + '5.2' => false, + '5.3' => true, + ), + 'Collator' => array( + '5.2' => false, + '5.3' => true, + ), + 'NumberFormatter' => array( + '5.2' => false, + '5.3' => true, + ), + 'Locale' => array( + '5.2' => false, + '5.3' => true, + ), + 'Normalizer' => array( + '5.2' => false, + '5.3' => true, + ), + 'MessageFormatter' => array( + '5.2' => false, + '5.3' => true, + ), + 'IntlDateFormatter' => array( + '5.2' => false, + '5.3' => true, + ), + 'Phar' => array( + '5.2' => false, + '5.3' => true, + ), + 'PharData' => array( + '5.2' => false, + '5.3' => true, + ), + 'PharFileInfo' => array( + '5.2' => false, + '5.3' => true, + ), + 'FilesystemIterator' => array( + '5.2' => false, + '5.3' => true, + ), + 'GlobIterator' => array( + '5.2' => false, + '5.3' => true, + ), + 'MultipleIterator' => array( + '5.2' => false, + '5.3' => true, + ), + 'RecursiveTreeIterator' => array( + '5.2' => false, + '5.3' => true, + ), + 'SplDoublyLinkedList' => array( + '5.2' => false, + '5.3' => true, + ), + 'SplFixedArray' => array( + '5.2' => false, + '5.3' => true, + ), + 'SplHeap' => array( + '5.2' => false, + '5.3' => true, + ), + 'SplMaxHeap' => array( + '5.2' => false, + '5.3' => true, + ), + 'SplMinHeap' => array( + '5.2' => false, + '5.3' => true, + ), + 'SplObjectStorage' => array( + '5.2' => false, + '5.3' => true, + ), + 'SplPriorityQueue' => array( + '5.2' => false, + '5.3' => true, + ), + 'SplQueue' => array( + '5.2' => false, + '5.3' => true, + ), + 'SplStack' => array( + '5.2' => false, + '5.3' => true, + ), + + 'ResourceBundle' => array( + '5.3.1' => false, + '5.3.2' => true, + ), + + 'CallbackFilterIterator' => array( + '5.3' => false, + '5.4' => true, + ), + 'RecursiveCallbackFilterIterator' => array( + '5.3' => false, + '5.4' => true, + ), + 'ReflectionZendExtension' => array( + '5.3' => false, + '5.4' => true, + ), + 'SessionHandler' => array( + '5.3' => false, + '5.4' => true, + ), + 'SNMP' => array( + '5.3' => false, + '5.4' => true, + ), + 'Transliterator' => array( + '5.3' => false, + '5.4' => true, + ), + 'Spoofchecker' => array( + '5.3' => false, + '5.4' => true, + ), + + 'Generator' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLFile' => array( + '5.4' => false, + '5.5' => true, + ), + 'DateTimeImmutable' => array( + '5.4' => false, + '5.5' => true, + ), + 'IntlCalendar' => array( + '5.4' => false, + '5.5' => true, + ), + 'IntlGregorianCalendar' => array( + '5.4' => false, + '5.5' => true, + ), + 'IntlTimeZone' => array( + '5.4' => false, + '5.5' => true, + ), + 'IntlBreakIterator' => array( + '5.4' => false, + '5.5' => true, + ), + 'IntlRuleBasedBreakIterator' => array( + '5.4' => false, + '5.5' => true, + ), + 'IntlCodePointBreakIterator' => array( + '5.4' => false, + '5.5' => true, + ), + 'UConverter' => array( + '5.4' => false, + '5.5' => true, + ), + + 'GMP' => array( + '5.5' => false, + '5.6' => true, + ), + + 'IntlChar' => array( + '5.6' => false, + '7.0' => true, + ), + 'ReflectionType' => array( + '5.6' => false, + '7.0' => true, + ), + 'ReflectionGenerator' => array( + '5.6' => false, + '7.0' => true, + ), + + 'ReflectionClassConstant' => array( + '7.0' => false, + '7.1' => true, + ), + + 'FFI' => array( + '7.3' => false, + '7.4' => true, + ), + 'FFI\CData' => array( + '7.3' => false, + '7.4' => true, + ), + 'FFI\CType' => array( + '7.3' => false, + '7.4' => true, + ), + 'ReflectionReference' => array( + '7.3' => false, + '7.4' => true, + ), + 'WeakReference' => array( + '7.3' => false, + '7.4' => true, + ), + ); + + /** + * A list of new Exception classes, not present in older versions. + * + * The array lists : version number with false (not present) or true (present). + * If's sufficient to list the first version where the class appears. + * + * {@internal Classes listed here do not need to be added to the $newClasses + * property as well. + * This list is automatically added to the $newClasses property + * in the `register()` method.} + * + * {@internal Helper to update this list: https://3v4l.org/MhlUp} + * + * @since 7.1.4 + * + * @var array(string => array(string => bool)) + */ + protected $newExceptions = array( + 'com_exception' => array( + '4.4' => false, + '5.0' => true, + ), + 'DOMException' => array( + '4.4' => false, + '5.0' => true, + ), + 'Exception' => array( + // According to the docs introduced in PHP 5.1, but this appears to be. + // an error. Class was introduced with try/catch keywords in PHP 5.0. + '4.4' => false, + '5.0' => true, + ), + 'ReflectionException' => array( + '4.4' => false, + '5.0' => true, + ), + 'SoapFault' => array( + '4.4' => false, + '5.0' => true, + ), + 'SQLiteException' => array( + '4.4' => false, + '5.0' => true, + ), + + 'ErrorException' => array( + '5.0' => false, + '5.1' => true, + ), + 'BadFunctionCallException' => array( + '5.0' => false, + '5.1' => true, + ), + 'BadMethodCallException' => array( + '5.0' => false, + '5.1' => true, + ), + 'DomainException' => array( + '5.0' => false, + '5.1' => true, + ), + 'InvalidArgumentException' => array( + '5.0' => false, + '5.1' => true, + ), + 'LengthException' => array( + '5.0' => false, + '5.1' => true, + ), + 'LogicException' => array( + '5.0' => false, + '5.1' => true, + ), + 'mysqli_sql_exception' => array( + '5.0' => false, + '5.1' => true, + ), + 'OutOfBoundsException' => array( + '5.0' => false, + '5.1' => true, + ), + 'OutOfRangeException' => array( + '5.0' => false, + '5.1' => true, + ), + 'OverflowException' => array( + '5.0' => false, + '5.1' => true, + ), + 'PDOException' => array( + '5.0' => false, + '5.1' => true, + ), + 'RangeException' => array( + '5.0' => false, + '5.1' => true, + ), + 'RuntimeException' => array( + '5.0' => false, + '5.1' => true, + ), + 'UnderflowException' => array( + '5.0' => false, + '5.1' => true, + ), + 'UnexpectedValueException' => array( + '5.0' => false, + '5.1' => true, + ), + + 'PharException' => array( + '5.2' => false, + '5.3' => true, + ), + + 'SNMPException' => array( + '5.3' => false, + '5.4' => true, + ), + + 'IntlException' => array( + '5.4' => false, + '5.5' => true, + ), + + 'Error' => array( + '5.6' => false, + '7.0' => true, + ), + 'ArithmeticError' => array( + '5.6' => false, + '7.0' => true, + ), + 'AssertionError' => array( + '5.6' => false, + '7.0' => true, + ), + 'DivisionByZeroError' => array( + '5.6' => false, + '7.0' => true, + ), + 'ParseError' => array( + '5.6' => false, + '7.0' => true, + ), + 'TypeError' => array( + '5.6' => false, + '7.0' => true, + ), + 'ClosedGeneratorException' => array( + '5.6' => false, + '7.0' => true, + ), + 'UI\Exception\InvalidArgumentException' => array( + '5.6' => false, + '7.0' => true, + ), + 'UI\Exception\RuntimeException' => array( + '5.6' => false, + '7.0' => true, + ), + + 'ArgumentCountError' => array( + '7.0' => false, + '7.1' => true, + ), + + 'SodiumException' => array( + '7.1' => false, + '7.2' => true, + ), + + 'CompileError' => array( + '7.2' => false, + '7.3' => true, + ), + 'JsonException' => array( + '7.2' => false, + '7.3' => true, + ), + + 'FFI\Exception' => array( + '7.3' => false, + '7.4' => true, + ), + 'FFI\ParserException' => array( + '7.3' => false, + '7.4' => true, + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * @since 7.0.3 - Now also targets the `class` keyword to detect extended classes. + * - Now also targets double colons to detect static class use. + * @since 7.1.4 - Now also targets anonymous classes to detect extended classes. + * - Now also targets functions/closures to detect new classes used + * as parameter type declarations. + * - Now also targets the `catch` control structure to detect new + * exception classes being caught. + * @since 8.2.0 Now also targets the `T_RETURN_TYPE` token to detect new classes used + * as return type declarations. + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of class names. + $this->newClasses = $this->arrayKeysToLowercase($this->newClasses); + $this->newExceptions = $this->arrayKeysToLowercase($this->newExceptions); + + // Add the Exception classes to the Classes list. + $this->newClasses = array_merge($this->newClasses, $this->newExceptions); + + $targets = array( + \T_NEW, + \T_CLASS, + \T_DOUBLE_COLON, + \T_FUNCTION, + \T_CLOSURE, + \T_CATCH, + ); + + if (\defined('T_ANON_CLASS')) { + $targets[] = \T_ANON_CLASS; + } + + if (\defined('T_RETURN_TYPE')) { + $targets[] = \T_RETURN_TYPE; + } + + return $targets; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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(); + + switch ($tokens[$stackPtr]['type']) { + case 'T_FUNCTION': + case 'T_CLOSURE': + $this->processFunctionToken($phpcsFile, $stackPtr); + + // Deal with older PHPCS version which don't recognize return type hints + // as well as newer PHPCS versions (3.3.0+) where the tokenization has changed. + $returnTypeHint = $this->getReturnTypeHintToken($phpcsFile, $stackPtr); + if ($returnTypeHint !== false) { + $this->processReturnTypeToken($phpcsFile, $returnTypeHint); + } + break; + + case 'T_CATCH': + $this->processCatchToken($phpcsFile, $stackPtr); + break; + + case 'T_RETURN_TYPE': + $this->processReturnTypeToken($phpcsFile, $stackPtr); + break; + + default: + $this->processSingularToken($phpcsFile, $stackPtr); + break; + } + } + + + /** + * Processes this test for when a token resulting in a singular class name is encountered. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + private function processSingularToken(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $FQClassName = ''; + + if ($tokens[$stackPtr]['type'] === 'T_NEW') { + $FQClassName = $this->getFQClassNameFromNewToken($phpcsFile, $stackPtr); + + } elseif ($tokens[$stackPtr]['type'] === 'T_CLASS' || $tokens[$stackPtr]['type'] === 'T_ANON_CLASS') { + $FQClassName = $this->getFQExtendedClassName($phpcsFile, $stackPtr); + + } elseif ($tokens[$stackPtr]['type'] === 'T_DOUBLE_COLON') { + $FQClassName = $this->getFQClassNameFromDoubleColonToken($phpcsFile, $stackPtr); + } + + if ($FQClassName === '') { + return; + } + + $className = substr($FQClassName, 1); // Remove global namespace indicator. + $classNameLc = strtolower($className); + + if (isset($this->newClasses[$classNameLc]) === false) { + return; + } + + $itemInfo = array( + 'name' => $className, + 'nameLc' => $classNameLc, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Processes this test for when a function token is encountered. + * + * - Detect new classes when used as a parameter type declaration. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + private function processFunctionToken(File $phpcsFile, $stackPtr) + { + // Retrieve typehints stripped of global NS indicator and/or nullable indicator. + $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); + if (empty($typeHints) || \is_array($typeHints) === false) { + return; + } + + foreach ($typeHints as $hint) { + + $typeHintLc = strtolower($hint); + + if (isset($this->newClasses[$typeHintLc]) === true) { + $itemInfo = array( + 'name' => $hint, + 'nameLc' => $typeHintLc, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + } + } + + + /** + * Processes this test for when a catch token is encountered. + * + * - Detect exceptions when used in a catch statement. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + private function processCatchToken(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Bow out during live coding. + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { + return; + } + + $opener = $tokens[$stackPtr]['parenthesis_opener']; + $closer = ($tokens[$stackPtr]['parenthesis_closer'] + 1); + $name = ''; + $listen = array( + // Parts of a (namespaced) class name. + \T_STRING => true, + \T_NS_SEPARATOR => true, + // End/split tokens. + \T_VARIABLE => false, + \T_BITWISE_OR => false, + \T_CLOSE_CURLY_BRACKET => false, // Shouldn't be needed as we expect a var before this. + ); + + for ($i = ($opener + 1); $i < $closer; $i++) { + if (isset($listen[$tokens[$i]['code']]) === false) { + continue; + } + + if ($listen[$tokens[$i]['code']] === true) { + $name .= $tokens[$i]['content']; + continue; + } else { + if (empty($name) === true) { + // Weird, we should have a name by the time we encounter a variable or |. + // So this may be the closer. + continue; + } + + $name = ltrim($name, '\\'); + $nameLC = strtolower($name); + + if (isset($this->newExceptions[$nameLC]) === true) { + $itemInfo = array( + 'name' => $name, + 'nameLc' => $nameLC, + ); + $this->handleFeature($phpcsFile, $i, $itemInfo); + } + + // Reset for a potential multi-catch. + $name = ''; + } + } + } + + + /** + * Processes this test for when a return type token is encountered. + * + * - Detect new classes when used as a return type declaration. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + private function processReturnTypeToken(File $phpcsFile, $stackPtr) + { + $returnTypeHint = $this->getReturnTypeHintName($phpcsFile, $stackPtr); + if (empty($returnTypeHint)) { + return; + } + + $returnTypeHint = ltrim($returnTypeHint, '\\'); + $returnTypeHintLc = strtolower($returnTypeHint); + + if (isset($this->newClasses[$returnTypeHintLc]) === false) { + return; + } + + // Still here ? Then this is a return type declaration using a new class. + $itemInfo = array( + 'name' => $returnTypeHint, + 'nameLc' => $returnTypeHintLc, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newClasses[$itemInfo['nameLc']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The built-in class ' . parent::getErrorMsgTemplate(); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php new file mode 100644 index 00000000..d2cb3feb --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php @@ -0,0 +1,80 @@ +supportsBelow('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); + + // Is the previous token a visibility indicator ? + if ($prevToken === false || isset(Tokens::$scopeModifiers[$tokens[$prevToken]['code']]) === false) { + return; + } + + // Is this a class constant ? + if ($this->isClassConstant($phpcsFile, $stackPtr) === false) { + // This may be a constant declaration in the global namespace with visibility, + // but that would throw a parse error, i.e. not our concern. + return; + } + + $phpcsFile->addError( + 'Visibility indicators for class constants are not supported in PHP 7.0 or earlier. Found "%s const"', + $stackPtr, + 'Found', + array($tokens[$prevToken]['content']) + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php new file mode 100644 index 00000000..9658a76f --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php @@ -0,0 +1,88 @@ +findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); + if ($nextNonEmpty === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + if ($tokens[$nextNonEmpty]['code'] !== \T_DOUBLE_COLON) { + return; + } + + $inClass = $this->inClassScope($phpcsFile, $stackPtr, false); + + if ($inClass === true && $this->supportsBelow('5.2') === true) { + $phpcsFile->addError( + 'Late static binding is not supported in PHP 5.2 or earlier.', + $stackPtr, + 'Found' + ); + } + + if ($inClass === false) { + $phpcsFile->addError( + 'Late static binding is not supported outside of class scope.', + $stackPtr, + 'OutsideClassScope' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php new file mode 100644 index 00000000..a609acc1 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php @@ -0,0 +1,132 @@ + \T_PRIVATE, + \T_PROTECTED => \T_PROTECTED, + \T_PUBLIC => \T_PUBLIC, + \T_STATIC => \T_STATIC, + \T_VAR => \T_VAR, + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.2.0 + * + * @return array + */ + public function register() + { + return array(\T_VARIABLE); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->isClassProperty($phpcsFile, $stackPtr) === false) { + return; + } + + $find = $this->modifierKeywords; + $find += array( + \T_SEMICOLON => \T_SEMICOLON, + \T_OPEN_CURLY_BRACKET => \T_OPEN_CURLY_BRACKET, + ); + + $tokens = $phpcsFile->getTokens(); + $modifier = $phpcsFile->findPrevious($find, ($stackPtr - 1)); + if ($modifier === false + || $tokens[$modifier]['code'] === \T_SEMICOLON + || $tokens[$modifier]['code'] === \T_OPEN_CURLY_BRACKET + ) { + // Parse error. Ignore. + return; + } + + $type = $phpcsFile->findNext(Tokens::$emptyTokens, ($modifier + 1), null, true); + if ($tokens[$type]['code'] === \T_VARIABLE) { + return; + } + + // Still here ? In that case, this will be a typed property. + if ($this->supportsBelow('7.3') === true) { + $phpcsFile->addError( + 'Typed properties are not supported in PHP 7.3 or earlier', + $type, + 'Found' + ); + } + + if ($this->supportsAbove('7.4') === true) { + // Examine the type to verify it's valid. + if ($tokens[$type]['type'] === 'T_NULLABLE' + // Needed to support PHPCS < 3.5.0 which doesn't correct to the nullable token type yet. + || $tokens[$type]['code'] === \T_INLINE_THEN + ) { + $type = $phpcsFile->findNext(Tokens::$emptyTokens, ($type + 1), null, true); + } + + $content = $tokens[$type]['content']; + if ($content === 'void' || $content === 'callable') { + $phpcsFile->addError( + '%s is not supported as a type declaration for properties', + $type, + 'InvalidType', + array($content) + ); + } + } + + $endOfStatement = $phpcsFile->findNext(\T_SEMICOLON, ($stackPtr + 1)); + if ($endOfStatement !== false) { + // Don't throw the same error multiple times for multi-property declarations. + return ($endOfStatement + 1); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php new file mode 100644 index 00000000..7ecfd6ca --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php @@ -0,0 +1,115 @@ + true, + 'T_ANON_CLASS' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.2.0 + * + * @return array + */ + public function register() + { + return array(\T_PARENT); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.4') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (empty($tokens[$stackPtr]['conditions']) === true) { + // Use within the global namespace. Not our concern. + return; + } + + /* + * Find the class within which this parent keyword is used. + */ + $conditions = $tokens[$stackPtr]['conditions']; + $conditions = array_reverse($conditions, true); + $classPtr = false; + + foreach ($conditions as $ptr => $type) { + if (isset($this->classScopeTokens[$tokens[$ptr]['type']])) { + $classPtr = $ptr; + break; + } + } + + if ($classPtr === false) { + // Use outside of a class scope. Not our concern. + return; + } + + if (isset($tokens[$classPtr]['scope_opener']) === false) { + // No scope opener known. Probably a parse error. + return; + } + + $extends = $phpcsFile->findNext(\T_EXTENDS, ($classPtr + 1), $tokens[$classPtr]['scope_opener']); + if ($extends !== false) { + // Class has a parent. + return; + } + + $phpcsFile->addError( + 'Using "parent" inside a class without parent is deprecated since PHP 7.4', + $stackPtr, + 'Deprecated' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php new file mode 100644 index 00000000..27ec4217 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php @@ -0,0 +1,3756 @@ + array(string => bool)) + */ + protected $newConstants = array( + 'E_STRICT' => array( + '4.4' => false, + '5.0' => true, + ), + // Curl: + 'CURLOPT_FTP_USE_EPRT' => array( + '4.4' => false, + '5.0' => true, + ), + 'CURLOPT_NOSIGNAL' => array( + '4.4' => false, + '5.0' => true, + ), + 'CURLOPT_UNRESTRICTED_AUTH' => array( + '4.4' => false, + '5.0' => true, + ), + 'CURLOPT_BUFFERSIZE' => array( + '4.4' => false, + '5.0' => true, + ), + 'CURLOPT_HTTPAUTH' => array( + '4.4' => false, + '5.0' => true, + ), + 'CURLOPT_PROXYPORT' => array( + '4.4' => false, + '5.0' => true, + ), + 'CURLOPT_PROXYTYPE' => array( + '4.4' => false, + '5.0' => true, + ), + 'CURLOPT_SSLCERTTYPE' => array( + '4.4' => false, + '5.0' => true, + ), + 'CURLOPT_HTTP200ALIASES' => array( + '4.4' => false, + '5.0' => true, + ), + // OpenSSL: + 'OPENSSL_ALGO_MD2' => array( + '4.4' => false, + '5.0' => true, + ), + 'OPENSSL_ALGO_MD4' => array( + '4.4' => false, + '5.0' => true, + ), + 'OPENSSL_ALGO_MD5' => array( + '4.4' => false, + '5.0' => true, + ), + 'OPENSSL_ALGO_SHA1' => array( + '4.4' => false, + '5.0' => true, + ), + 'OPENSSL_ALGO_DSS1' => array( + '4.4' => false, + '5.0' => true, + ), + // Tokenizer: + 'T_ABSTRACT' => array( + '4.4' => false, + '5.0' => true, + ), + 'T_CATCH' => array( + '4.4' => false, + '5.0' => true, + ), + + 'SORT_LOCALE_STRING' => array( + '5.0.1' => false, + '5.0.2' => true, + ), + 'PHP_EOL' => array( + '5.0.1' => false, + '5.0.2' => true, + ), + + 'PHP_INT_MAX' => array( + '5.0.4' => false, + '5.0.5' => true, + ), + 'PHP_INT_SIZE' => array( + '5.0.4' => false, + '5.0.5' => true, + ), + + '__COMPILER_HALT_OFFSET__' => array( + '5.0' => false, + '5.1' => true, + ), + 'GLOB_ERR' => array( + '5.0' => false, + '5.1' => true, + ), + // Curl: + 'CURLOPT_AUTOREFERER' => array( + '5.0' => false, + '5.1' => true, + ), + 'CURLOPT_BINARYTRANSFER' => array( + '5.0' => false, + '5.1' => true, + ), + 'CURLOPT_COOKIESESSION' => array( + '5.0' => false, + '5.1' => true, + ), + 'CURLOPT_FTPSSLAUTH' => array( + '5.0' => false, + '5.1' => true, + ), + 'CURLOPT_PROXYAUTH' => array( + '5.0' => false, + '5.1' => true, + ), + 'CURLOPT_TIMECONDITION' => array( + '5.0' => false, + '5.1' => true, + ), + // POSIX: + 'POSIX_F_OK' => array( + '5.0' => false, + '5.1' => true, + ), + 'POSIX_R_OK' => array( + '5.0' => false, + '5.1' => true, + ), + 'POSIX_W_OK' => array( + '5.0' => false, + '5.1' => true, + ), + 'POSIX_X_OK' => array( + '5.0' => false, + '5.1' => true, + ), + 'POSIX_S_IFBLK' => array( + '5.0' => false, + '5.1' => true, + ), + 'POSIX_S_IFCHR' => array( + '5.0' => false, + '5.1' => true, + ), + 'POSIX_S_IFIFO' => array( + '5.0' => false, + '5.1' => true, + ), + 'POSIX_S_IFREG' => array( + '5.0' => false, + '5.1' => true, + ), + 'POSIX_S_IFSOCK' => array( + '5.0' => false, + '5.1' => true, + ), + // Streams: + 'STREAM_IPPROTO_ICMP' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_IPPROTO_IP' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_IPPROTO_RAW' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_IPPROTO_TCP' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_IPPROTO_UDP' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_PF_INET' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_PF_INET6' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_PF_UNIX' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_SOCK_DGRAM' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_SOCK_RAW' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_SOCK_RDM' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_SOCK_SEQPACKET' => array( + '5.0' => false, + '5.1' => true, + ), + 'STREAM_SOCK_STREAM' => array( + '5.0' => false, + '5.1' => true, + ), + // Tokenizer: + 'T_HALT_COMPILER' => array( + '5.0' => false, + '5.1' => true, + ), + + // Date/Time: + 'DATE_ATOM' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_COOKIE' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_ISO8601' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_RFC822' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_RFC850' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_RFC1036' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_RFC1123' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_RFC2822' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_RFC3339' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_RSS' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + 'DATE_W3C' => array( + '5.1.0' => false, + '5.1.1' => true, + ), + + // Date/Time: + 'SUNFUNCS_RET_TIMESTAMP' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'SUNFUNCS_RET_STRING' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'SUNFUNCS_RET_DOUBLE' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + // XSL: + 'LIBXSLT_VERSION' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'LIBXSLT_DOTTED_VERSION' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'LIBEXSLT_VERSION' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'LIBEXSLT_DOTTED_VERSION' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + // URL: + 'PHP_URL_SCHEME' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'PHP_URL_HOST' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'PHP_URL_PORT' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'PHP_URL_USER' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'PHP_URL_PASS' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'PHP_URL_PATH' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'PHP_URL_QUERY' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'PHP_URL_FRAGMENT' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'PHP_QUERY_RFC1738' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'PHP_QUERY_RFC3986' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + + // Curl: + 'CURLINFO_HEADER_OUT' => array( + '5.1.2' => false, + '5.1.3' => true, + ), + + // Core: + 'E_RECOVERABLE_ERROR' => array( + '5.1' => false, + '5.2' => true, + ), + // Math: + 'M_EULER' => array( + '5.1' => false, + '5.2' => true, + ), + 'M_LNPI' => array( + '5.1' => false, + '5.2' => true, + ), + 'M_SQRT3' => array( + '5.1' => false, + '5.2' => true, + ), + 'M_SQRTPI' => array( + '5.1' => false, + '5.2' => true, + ), + 'PATHINFO_FILENAME' => array( + '5.1' => false, + '5.2' => true, + ), + 'UPLOAD_ERR_EXTENSION' => array( + '5.1' => false, + '5.2' => true, + ), + // Curl: + 'CURLE_FILESIZE_EXCEEDED' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLE_FTP_SSL_FAILED' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLE_LDAP_INVALID_URL' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLFTPAUTH_DEFAULT' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLFTPAUTH_SSL' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLFTPAUTH_TLS' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLFTPSSL_ALL' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLFTPSSL_CONTROL' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLFTPSSL_NONE' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLFTPSSL_TRY' => array( + '5.1' => false, + '5.2' => true, + ), + 'CURLOPT_FTP_SSL' => array( + '5.1' => false, + '5.2' => true, + ), + // Ming: + 'SWFTEXTFIELD_USEFONT' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWFTEXTFIELD_AUTOSIZE' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_NOT_COMPRESSED' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_ADPCM_COMPRESSED' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_MP3_COMPRESSED' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_NOT_COMPRESSED_LE' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_NELLY_COMPRESSED' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_5KHZ' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_11KHZ' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_22KHZ' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_44KHZ' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_8BITS' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_16BITS' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_MONO' => array( + '5.1' => false, + '5.2' => true, + ), + 'SWF_SOUND_STEREO' => array( + '5.1' => false, + '5.2' => true, + ), + // OpenSSL: + 'OPENSSL_KEYTYPE_EC' => array( + '5.1' => false, + '5.2' => true, + ), + 'OPENSSL_VERSION_NUMBER' => array( + '5.1' => false, + '5.2' => true, + ), + 'OPENSSL_VERSION_TEXT' => array( + '5.1' => false, + '5.2' => true, + ), + // PCRE: + 'PREG_BACKTRACK_LIMIT_ERROR' => array( + '5.1' => false, + '5.2' => true, + ), + 'PREG_BAD_UTF8_ERROR' => array( + '5.1' => false, + '5.2' => true, + ), + 'PREG_INTERNAL_ERROR' => array( + '5.1' => false, + '5.2' => true, + ), + 'PREG_NO_ERROR' => array( + '5.1' => false, + '5.2' => true, + ), + 'PREG_RECURSION_LIMIT_ERROR' => array( + '5.1' => false, + '5.2' => true, + ), + // Snmp: + 'SNMP_OID_OUTPUT_FULL' => array( + '5.1' => false, + '5.2' => true, + ), + 'SNMP_OID_OUTPUT_NUMERIC' => array( + '5.1' => false, + '5.2' => true, + ), + // Semaphore: + 'MSG_EAGAIN' => array( + '5.1' => false, + '5.2' => true, + ), + 'MSG_ENOMSG' => array( + '5.1' => false, + '5.2' => true, + ), + + // Curl: + 'CURLOPT_TCP_NODELAY' => array( + '5.2.0' => false, + '5.2.1' => true, + ), + + // Stream: + 'STREAM_SHUT_RD' => array( + '5.2.0' => false, + '5.2.1' => true, + ), + 'STREAM_SHUT_WR' => array( + '5.2.0' => false, + '5.2.1' => true, + ), + 'STREAM_SHUT_RDWR' => array( + '5.2.0' => false, + '5.2.1' => true, + ), + + 'GMP_VERSION' => array( + '5.2.1' => false, + '5.2.2' => true, + ), + + // Curl: + 'CURLOPT_TIMEOUT_MS' => array( + '5.2.2' => false, + '5.2.3' => true, + ), + 'CURLOPT_CONNECTTIMEOUT_MS' => array( + '5.2.2' => false, + '5.2.3' => true, + ), + + // Curl: + 'CURLOPT_PRIVATE' => array( + '5.2.3' => false, + '5.2.4' => true, + ), + 'CURLINFO_PRIVATE' => array( + '5.2.3' => false, + '5.2.4' => true, + ), + // GD: + 'GD_VERSION' => array( + '5.2.3' => false, + '5.2.4' => true, + ), + 'GD_MAJOR_VERSION' => array( + '5.2.3' => false, + '5.2.4' => true, + ), + 'GD_MINOR_VERSION' => array( + '5.2.3' => false, + '5.2.4' => true, + ), + 'GD_RELEASE_VERSION' => array( + '5.2.3' => false, + '5.2.4' => true, + ), + 'GD_EXTRA_VERSION' => array( + '5.2.3' => false, + '5.2.4' => true, + ), + // PCRE: + 'PCRE_VERSION' => array( + '5.2.3' => false, + '5.2.4' => true, + ), + + 'PHP_MAJOR_VERSION' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + 'PHP_MINOR_VERSION' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + 'PHP_RELEASE_VERSION' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + 'PHP_VERSION_ID' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + 'PHP_EXTRA_VERSION' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + 'PHP_ZTS' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + 'PHP_DEBUG' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + 'FILE_BINARY' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + 'FILE_TEXT' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + // Sockets: + 'TCP_NODELAY' => array( + '5.2.6' => false, + '5.2.7' => true, + ), + + // Curl: + 'CURLOPT_PROTOCOLS' => array( + '5.2.9' => false, + '5.2.10' => true, + ), + 'CURLOPT_REDIR_PROTOCOLS' => array( + '5.2.9' => false, + '5.2.10' => true, + ), + 'CURLPROXY_SOCKS4' => array( + '5.2.9' => false, + '5.2.10' => true, + ), + + // Libxml: + 'LIBXML_PARSEHUGE' => array( + '5.2.11' => false, + '5.2.12' => true, + ), + + // Core: + 'ENT_IGNORE' => array( + '5.2' => false, + '5.3' => true, + ), + 'E_DEPRECATED' => array( + '5.2' => false, + '5.3' => true, + ), + 'E_USER_DEPRECATED' => array( + '5.2' => false, + '5.3' => true, + ), + 'INI_SCANNER_NORMAL' => array( + '5.2' => false, + '5.3' => true, + ), + 'INI_SCANNER_RAW' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_MAXPATHLEN' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_NT_DOMAIN_CONTROLLER' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_NT_SERVER' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_NT_WORKSTATION' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_VERSION_BUILD' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_VERSION_MAJOR' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_VERSION_MINOR' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_VERSION_PLATFORM' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_VERSION_PRODUCTTYPE' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_VERSION_SP_MAJOR' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_VERSION_SP_MINOR' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_WINDOWS_VERSION_SUITEMASK' => array( + '5.2' => false, + '5.3' => true, + ), + // Curl: + 'CURLINFO_CERTINFO' => array( + '5.2' => false, + '5.3' => true, + ), + 'CURLOPT_PROGRESSFUNCTION' => array( + '5.2' => false, + '5.3' => true, + ), + 'CURLE_SSH' => array( + '5.2' => false, + '5.3' => true, + ), + // GD: + 'IMG_FILTER_PIXELATE' => array( + '5.2' => false, + '5.3' => true, + ), + 'IMAGETYPE_ICO' => array( + '5.2' => false, + '5.3' => true, + ), + // Fileinfo: + 'FILEINFO_MIME_TYPE' => array( + '5.2' => false, + '5.3' => true, + ), + 'FILEINFO_MIME_ENCODING' => array( + '5.2' => false, + '5.3' => true, + ), + // JSON: + 'JSON_ERROR_CTRL_CHAR' => array( + '5.2' => false, + '5.3' => true, + ), + 'JSON_ERROR_DEPTH' => array( + '5.2' => false, + '5.3' => true, + ), + 'JSON_ERROR_NONE' => array( + '5.2' => false, + '5.3' => true, + ), + 'JSON_ERROR_STATE_MISMATCH' => array( + '5.2' => false, + '5.3' => true, + ), + 'JSON_ERROR_SYNTAX' => array( + '5.2' => false, + '5.3' => true, + ), + 'JSON_FORCE_OBJECT' => array( + '5.2' => false, + '5.3' => true, + ), + 'JSON_HEX_TAG' => array( + '5.2' => false, + '5.3' => true, + ), + 'JSON_HEX_AMP' => array( + '5.2' => false, + '5.3' => true, + ), + 'JSON_HEX_APOS' => array( + '5.2' => false, + '5.3' => true, + ), + 'JSON_HEX_QUOT' => array( + '5.2' => false, + '5.3' => true, + ), + // LDAP: + 'LDAP_OPT_NETWORK_TIMEOUT' => array( + '5.2' => false, + '5.3' => true, + ), + // Libxml: + 'LIBXML_LOADED_VERSION' => array( + '5.2' => false, + '5.3' => true, + ), + // Math: + 'PHP_ROUND_HALF_UP' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_ROUND_HALF_DOWN' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_ROUND_HALF_EVEN' => array( + '5.2' => false, + '5.3' => true, + ), + 'PHP_ROUND_HALF_ODD' => array( + '5.2' => false, + '5.3' => true, + ), + // Mysqli + 'MYSQLI_OPT_INT_AND_FLOAT_NATIVE' => array( + '5.2' => false, + '5.3' => true, + ), + 'MYSQLI_OPT_NET_CMD_BUFFER_SIZE' => array( + '5.2' => false, + '5.3' => true, + ), + 'MYSQLI_OPT_NET_READ_BUFFER_SIZE' => array( + '5.2' => false, + '5.3' => true, + ), + 'MYSQLI_OPT_SSL_VERIFY_SERVER_CERT' => array( + '5.2' => false, + '5.3' => true, + ), + // OCI8: + 'OCI_CRED_EXT' => array( + '5.2' => false, + '5.3' => true, + ), + // PCRE: + 'PREG_BAD_UTF8_OFFSET_ERROR' => array( + '5.2' => false, + '5.3' => true, + ), + // PCNTL: + 'BUS_ADRALN' => array( + '5.2' => false, + '5.3' => true, + ), + 'BUS_ADRERR' => array( + '5.2' => false, + '5.3' => true, + ), + 'BUS_OBJERR' => array( + '5.2' => false, + '5.3' => true, + ), + 'CLD_CONTIUNED' => array( + '5.2' => false, + '5.3' => true, + ), + 'CLD_DUMPED' => array( + '5.2' => false, + '5.3' => true, + ), + 'CLD_EXITED' => array( + '5.2' => false, + '5.3' => true, + ), + 'CLD_KILLED' => array( + '5.2' => false, + '5.3' => true, + ), + 'CLD_STOPPED' => array( + '5.2' => false, + '5.3' => true, + ), + 'CLD_TRAPPED' => array( + '5.2' => false, + '5.3' => true, + ), + 'FPE_FLTDIV' => array( + '5.2' => false, + '5.3' => true, + ), + 'FPE_FLTINV' => array( + '5.2' => false, + '5.3' => true, + ), + 'FPE_FLTOVF' => array( + '5.2' => false, + '5.3' => true, + ), + 'FPE_FLTRES' => array( + '5.2' => false, + '5.3' => true, + ), + 'FPE_FLTSUB' => array( + '5.2' => false, + '5.3' => true, + ), + 'FPE_FLTUND' => array( + '5.2' => false, + '5.3' => true, + ), + 'FPE_INTDIV' => array( + '5.2' => false, + '5.3' => true, + ), + 'FPE_INTOVF' => array( + '5.2' => false, + '5.3' => true, + ), + 'ILL_BADSTK' => array( + '5.2' => false, + '5.3' => true, + ), + 'ILL_COPROC' => array( + '5.2' => false, + '5.3' => true, + ), + 'ILL_ILLADR' => array( + '5.2' => false, + '5.3' => true, + ), + 'ILL_ILLOPC' => array( + '5.2' => false, + '5.3' => true, + ), + 'ILL_ILLOPN' => array( + '5.2' => false, + '5.3' => true, + ), + 'ILL_ILLTRP' => array( + '5.2' => false, + '5.3' => true, + ), + 'ILL_PRVOPC' => array( + '5.2' => false, + '5.3' => true, + ), + 'ILL_PRVREG' => array( + '5.2' => false, + '5.3' => true, + ), + 'POLL_ERR' => array( + '5.2' => false, + '5.3' => true, + ), + 'POLL_HUP' => array( + '5.2' => false, + '5.3' => true, + ), + 'POLL_IN' => array( + '5.2' => false, + '5.3' => true, + ), + 'POLL_MSG' => array( + '5.2' => false, + '5.3' => true, + ), + 'POLL_OUT' => array( + '5.2' => false, + '5.3' => true, + ), + 'POLL_PRI' => array( + '5.2' => false, + '5.3' => true, + ), + 'SEGV_ACCERR' => array( + '5.2' => false, + '5.3' => true, + ), + 'SEGV_MAPERR' => array( + '5.2' => false, + '5.3' => true, + ), + 'SI_ASYNCIO' => array( + '5.2' => false, + '5.3' => true, + ), + 'SI_KERNEL' => array( + '5.2' => false, + '5.3' => true, + ), + 'SI_MSGGQ' => array( + '5.2' => false, + '5.3' => true, + ), + 'SI_NOINFO' => array( + '5.2' => false, + '5.3' => true, + ), + 'SI_QUEUE' => array( + '5.2' => false, + '5.3' => true, + ), + 'SI_SIGIO' => array( + '5.2' => false, + '5.3' => true, + ), + 'SI_TIMER' => array( + '5.2' => false, + '5.3' => true, + ), + 'SI_TKILL' => array( + '5.2' => false, + '5.3' => true, + ), + 'SI_USER' => array( + '5.2' => false, + '5.3' => true, + ), + 'SIG_BLOCK' => array( + '5.2' => false, + '5.3' => true, + ), + 'SIG_SETMASK' => array( + '5.2' => false, + '5.3' => true, + ), + 'SIG_UNBLOCK' => array( + '5.2' => false, + '5.3' => true, + ), + 'TRAP_BRKPT' => array( + '5.2' => false, + '5.3' => true, + ), + 'TRAP_TRACE' => array( + '5.2' => false, + '5.3' => true, + ), + // Tokenizer: + 'T_DIR' => array( + '5.2' => false, + '5.3' => true, + ), + 'T_GOTO' => array( + '5.2' => false, + '5.3' => true, + ), + 'T_NAMESPACE' => array( + '5.2' => false, + '5.3' => true, + ), + 'T_NS_C' => array( + '5.2' => false, + '5.3' => true, + ), + 'T_NS_SEPARATOR' => array( + '5.2' => false, + '5.3' => true, + ), + 'T_USE' => array( + '5.2' => false, + '5.3' => true, + ), + + // OCI8: + 'OCI_NO_AUTO_COMMIT' => array( + '5.3.1' => false, + '5.3.2' => true, + ), + // OpenSSL: + 'OPENSSL_TLSEXT_SERVER_NAME' => array( + '5.3.1' => false, + '5.3.2' => true, + ), + + // JSON: + 'JSON_ERROR_UTF8' => array( + '5.3.2' => false, + '5.3.3' => true, + ), + 'JSON_NUMERIC_CHECK' => array( + '5.3.2' => false, + '5.3.3' => true, + ), + + 'DEBUG_BACKTRACE_IGNORE_ARGS' => array( + '5.3.5' => false, + '5.3.6' => true, + ), + + 'CURLINFO_REDIRECT_URL' => array( + '5.3.6' => false, + '5.3.7' => true, + ), + 'PHP_MANDIR' => array( + '5.3.6' => false, + '5.3.7' => true, + ), + + 'PHP_BINARY' => array( + '5.3' => false, + '5.4' => true, + ), + 'SORT_NATURAL' => array( + '5.3' => false, + '5.4' => true, + ), + 'SORT_FLAG_CASE' => array( + '5.3' => false, + '5.4' => true, + ), + 'ENT_HTML401' => array( + '5.3' => false, + '5.4' => true, + ), + 'ENT_XML1' => array( + '5.3' => false, + '5.4' => true, + ), + 'ENT_XHTML' => array( + '5.3' => false, + '5.4' => true, + ), + 'ENT_HTML5' => array( + '5.3' => false, + '5.4' => true, + ), + 'ENT_SUBSTITUTE' => array( + '5.3' => false, + '5.4' => true, + ), + 'ENT_DISALLOWED' => array( + '5.3' => false, + '5.4' => true, + ), + 'IPPROTO_IP' => array( + '5.3' => false, + '5.4' => true, + ), + 'IPPROTO_IPV6' => array( + '5.3' => false, + '5.4' => true, + ), + 'IPV6_MULTICAST_HOPS' => array( + '5.3' => false, + '5.4' => true, + ), + 'IPV6_MULTICAST_IF' => array( + '5.3' => false, + '5.4' => true, + ), + 'IPV6_MULTICAST_LOOP' => array( + '5.3' => false, + '5.4' => true, + ), + 'IP_MULTICAST_IF' => array( + '5.3' => false, + '5.4' => true, + ), + 'IP_MULTICAST_LOOP' => array( + '5.3' => false, + '5.4' => true, + ), + 'IP_MULTICAST_TTL' => array( + '5.3' => false, + '5.4' => true, + ), + 'MCAST_JOIN_GROUP' => array( + '5.3' => false, + '5.4' => true, + ), + 'MCAST_LEAVE_GROUP' => array( + '5.3' => false, + '5.4' => true, + ), + 'MCAST_BLOCK_SOURCE' => array( + '5.3' => false, + '5.4' => true, + ), + 'MCAST_UNBLOCK_SOURCE' => array( + '5.3' => false, + '5.4' => true, + ), + 'MCAST_JOIN_SOURCE_GROUP' => array( + '5.3' => false, + '5.4' => true, + ), + 'MCAST_LEAVE_SOURCE_GROUP' => array( + '5.3' => false, + '5.4' => true, + ), + // Curl: + 'CURLOPT_MAX_RECV_SPEED_LARGE' => array( + '5.3' => false, + '5.4' => true, + ), + 'CURLOPT_MAX_SEND_SPEED_LARGE' => array( + '5.3' => false, + '5.4' => true, + ), + // Directories: + 'SCANDIR_SORT_ASCENDING' => array( + '5.3' => false, + '5.4' => true, + ), + 'SCANDIR_SORT_DESCENDING' => array( + '5.3' => false, + '5.4' => true, + ), + 'SCANDIR_SORT_NONE' => array( + '5.3' => false, + '5.4' => true, + ), + // LibXML: + 'LIBXML_HTML_NODEFDTD' => array( + '5.3' => false, + '5.4' => true, + ), + 'LIBXML_HTML_NOIMPLIED' => array( + '5.3' => false, + '5.4' => true, + ), + 'LIBXML_PEDANTIC' => array( + '5.3' => false, + '5.4' => true, + ), + // OpenSSL: + 'OPENSSL_CIPHER_AES_128_CBC' => array( + '5.3' => false, + '5.4' => true, + ), + 'OPENSSL_CIPHER_AES_192_CBC' => array( + '5.3' => false, + '5.4' => true, + ), + 'OPENSSL_CIPHER_AES_256_CBC' => array( + '5.3' => false, + '5.4' => true, + ), + 'OPENSSL_RAW_DATA' => array( + '5.3' => false, + '5.4' => true, + ), + 'OPENSSL_ZERO_PADDING' => array( + '5.3' => false, + '5.4' => true, + ), + // Output buffering: + 'PHP_OUTPUT_HANDLER_CLEAN' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_OUTPUT_HANDLER_CLEANABLE' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_OUTPUT_HANDLER_DISABLED' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_OUTPUT_HANDLER_FINAL' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_OUTPUT_HANDLER_FLUSH' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_OUTPUT_HANDLER_FLUSHABLE' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_OUTPUT_HANDLER_REMOVABLE' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_OUTPUT_HANDLER_STARTED' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_OUTPUT_HANDLER_STDFLAGS' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_OUTPUT_HANDLER_WRITE' => array( + '5.3' => false, + '5.4' => true, + ), + // Sessions: + 'PHP_SESSION_ACTIVE' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_SESSION_DISABLED' => array( + '5.3' => false, + '5.4' => true, + ), + 'PHP_SESSION_NONE' => array( + '5.3' => false, + '5.4' => true, + ), + // Streams: + 'STREAM_META_ACCESS' => array( + '5.3' => false, + '5.4' => true, + ), + 'STREAM_META_GROUP' => array( + '5.3' => false, + '5.4' => true, + ), + 'STREAM_META_GROUP_NAME' => array( + '5.3' => false, + '5.4' => true, + ), + 'STREAM_META_OWNER' => array( + '5.3' => false, + '5.4' => true, + ), + 'STREAM_META_OWNER_NAME' => array( + '5.3' => false, + '5.4' => true, + ), + 'STREAM_META_TOUCH' => array( + '5.3' => false, + '5.4' => true, + ), + // Intl: + 'U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_CHECK_BIDI' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_CHECK_CONTEXTJ' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_NONTRANSITIONAL_TO_ASCII' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_NONTRANSITIONAL_TO_UNICODE' => array( + '5.3' => false, + '5.4' => true, + ), + 'INTL_IDNA_VARIANT_2003' => array( + '5.3' => false, + '5.4' => true, + ), + 'INTL_IDNA_VARIANT_UTS46' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_EMPTY_LABEL' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_LABEL_TOO_LONG' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_DOMAIN_NAME_TOO_LONG' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_LEADING_HYPHEN' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_TRAILING_HYPHEN' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_HYPHEN_3_4' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_LEADING_COMBINING_MARK' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_DISALLOWED' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_PUNYCODE' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_LABEL_HAS_DOT' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_INVALID_ACE_LABEL' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_BIDI' => array( + '5.3' => false, + '5.4' => true, + ), + 'IDNA_ERROR_CONTEXTJ' => array( + '5.3' => false, + '5.4' => true, + ), + // Json: + 'JSON_PRETTY_PRINT' => array( + '5.3' => false, + '5.4' => true, + ), + 'JSON_UNESCAPED_SLASHES' => array( + '5.3' => false, + '5.4' => true, + ), + 'JSON_UNESCAPED_UNICODE' => array( + '5.3' => false, + '5.4' => true, + ), + 'JSON_BIGINT_AS_STRING' => array( + '5.3' => false, + '5.4' => true, + ), + 'JSON_OBJECT_AS_ARRAY' => array( + '5.3' => false, + '5.4' => true, + ), + // Snmp: + 'SNMP_OID_OUTPUT_SUFFIX' => array( + '5.3' => false, + '5.4' => true, + ), + 'SNMP_OID_OUTPUT_MODULE' => array( + '5.3' => false, + '5.4' => true, + ), + 'SNMP_OID_OUTPUT_UCD' => array( + '5.3' => false, + '5.4' => true, + ), + 'SNMP_OID_OUTPUT_NONE' => array( + '5.3' => false, + '5.4' => true, + ), + // Tokenizer: + 'T_INSTEADOF' => array( + '5.3' => false, + '5.4' => true, + ), + 'T_TRAIT' => array( + '5.3' => false, + '5.4' => true, + ), + 'T_TRAIT_C' => array( + '5.3' => false, + '5.4' => true, + ), + + // Curl: + 'CURLINFO_PRIMARY_IP' => array( + '5.4.6' => false, + '5.4.7' => true, + ), + 'CURLINFO_PRIMARY_PORT' => array( + '5.4.6' => false, + '5.4.7' => true, + ), + 'CURLINFO_LOCAL_IP' => array( + '5.4.6' => false, + '5.4.7' => true, + ), + 'CURLINFO_LOCAL_PORT' => array( + '5.4.6' => false, + '5.4.7' => true, + ), + + // OpenSSL: + 'OPENSSL_ALGO_RMD160' => array( + '5.4.7' => false, + '5.4.8' => true, + ), + 'OPENSSL_ALGO_SHA224' => array( + '5.4.7' => false, + '5.4.8' => true, + ), + 'OPENSSL_ALGO_SHA256' => array( + '5.4.7' => false, + '5.4.8' => true, + ), + 'OPENSSL_ALGO_SHA384' => array( + '5.4.7' => false, + '5.4.8' => true, + ), + 'OPENSSL_ALGO_SHA512' => array( + '5.4.7' => false, + '5.4.8' => true, + ), + + // Filter: + 'FILTER_VALIDATE_MAC' => array( + '5.4' => false, + '5.5' => true, + ), + // GD + 'IMG_AFFINE_TRANSLATE' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_AFFINE_SCALE' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_AFFINE_ROTATE' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_AFFINE_SHEAR_HORIZONTAL' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_AFFINE_SHEAR_VERTICAL' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_CROP_DEFAULT' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_CROP_TRANSPARENT' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_CROP_BLACK' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_CROP_WHITE' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_CROP_SIDES' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_FLIP_BOTH' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_FLIP_HORIZONTAL' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_FLIP_VERTICAL' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_BELL' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_BESSEL' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_BILINEAR_FIXED' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_BICUBIC' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_BICUBIC_FIXED' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_BLACKMAN' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_BOX' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_BSPLINE' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_CATMULLROM' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_GAUSSIAN' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_GENERALIZED_CUBIC' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_HERMITE' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_HAMMING' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_HANNING' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_MITCHELL' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_POWER' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_QUADRATIC' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_SINC' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_NEAREST_NEIGHBOUR' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_WEIGHTED4' => array( + '5.4' => false, + '5.5' => true, + ), + 'IMG_TRIANGLE' => array( + '5.4' => false, + '5.5' => true, + ), + // JSON: + 'JSON_ERROR_RECURSION' => array( + '5.4' => false, + '5.5' => true, + ), + 'JSON_ERROR_INF_OR_NAN' => array( + '5.4' => false, + '5.5' => true, + ), + 'JSON_ERROR_UNSUPPORTED_TYPE' => array( + '5.4' => false, + '5.5' => true, + ), + 'JSON_PARTIAL_OUTPUT_ON_ERROR' => array( + '5.4' => false, + '5.5' => true, + ), + // MySQLi + 'MYSQLI_SERVER_PUBLIC_KEY' => array( + '5.4' => false, + '5.5' => true, + ), + // Curl: + 'CURLOPT_SHARE' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLOPT_SSL_OPTIONS' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLSSLOPT_ALLOW_BEAST' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLOPT_USERNAME' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_RESPONSE_CODE' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_HTTP_CONNECTCODE' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_HTTPAUTH_AVAIL' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_PROXYAUTH_AVAIL' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_OS_ERRNO' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_NUM_CONNECTS' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_SSL_ENGINES' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_COOKIELIST' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_FTP_ENTRY_PATH' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_APPCONNECT_TIME' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_CONDITION_UNMET' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_RTSP_CLIENT_CSEQ' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_RTSP_CSEQ_RECV' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_RTSP_SERVER_CSEQ' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLINFO_RTSP_SESSION_ID' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLMOPT_PIPELINING' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLMOPT_MAXCONNECTS' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLPAUSE_ALL' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLPAUSE_CONT' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLPAUSE_RECV' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLPAUSE_RECV_CONT' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLPAUSE_SEND' => array( + '5.4' => false, + '5.5' => true, + ), + 'CURLPAUSE_SEND_CONT' => array( + '5.4' => false, + '5.5' => true, + ), + // Soap: + 'SOAP_SSL_METHOD_TLS' => array( + '5.4' => false, + '5.5' => true, + ), + 'SOAP_SSL_METHOD_SSLv2' => array( + '5.4' => false, + '5.5' => true, + ), + 'SOAP_SSL_METHOD_SSLv3' => array( + '5.4' => false, + '5.5' => true, + ), + 'SOAP_SSL_METHOD_SSLv23' => array( + '5.4' => false, + '5.5' => true, + ), + // Tokenizer: + 'T_FINALLY' => array( + '5.4' => false, + '5.5' => true, + ), + 'T_YIELD' => array( + '5.4' => false, + '5.5' => true, + ), + // Core/Password Hashing: + 'PASSWORD_BCRYPT' => array( + '5.4' => false, + '5.5' => true, + ), + 'PASSWORD_DEFAULT' => array( + '5.4' => false, + '5.5' => true, + ), + 'PASSWORD_BCRYPT_DEFAULT_COST' => array( + '5.4' => false, + '5.5' => true, + ), + + + // Libxml: + 'LIBXML_SCHEMA_CREATE' => array( + '5.5.1' => false, + '5.5.2' => true, + ), + + // Curl: + 'CURL_SSLVERSION_TLSv1_0' => array( + '5.5.18' => false, + '5.5.19' => true, + ), + 'CURL_SSLVERSION_TLSv1_1' => array( + '5.5.18' => false, + '5.5.19' => true, + ), + 'CURL_SSLVERSION_TLSv1_2' => array( + '5.5.18' => false, + '5.5.19' => true, + ), + + 'CURLPROXY_SOCKS4A' => array( + '5.5.22' => false, + '5.5.23' => true, + ), + 'CURLPROXY_SOCKS5_HOSTNAME' => array( + '5.5.22' => false, + '5.5.23' => true, + ), + + 'CURL_VERSION_HTTP2' => array( + '5.5.23' => false, + '5.5.24' => true, + ), + + 'ARRAY_FILTER_USE_KEY' => array( + '5.5' => false, + '5.6' => true, + ), + 'ARRAY_FILTER_USE_BOTH' => array( + '5.5' => false, + '5.6' => true, + ), + // LDAP: + 'LDAP_ESCAPE_DN' => array( + '5.5' => false, + '5.6' => true, + ), + 'LDAP_ESCAPE_FILTER' => array( + '5.5' => false, + '5.6' => true, + ), + // OpenSSL: + 'OPENSSL_DEFAULT_STREAM_CIPHERS' => array( + '5.5' => false, + '5.6' => true, + ), + 'STREAM_CRYPTO_METHOD_ANY_CLIENT' => array( + '5.5' => false, + '5.6' => true, + ), + 'STREAM_CRYPTO_METHOD_ANY_SERVER' => array( + '5.5' => false, + '5.6' => true, + ), + 'STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT' => array( + '5.5' => false, + '5.6' => true, + ), + 'STREAM_CRYPTO_METHOD_TLSv1_0_SERVER' => array( + '5.5' => false, + '5.6' => true, + ), + 'STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT' => array( + '5.5' => false, + '5.6' => true, + ), + 'STREAM_CRYPTO_METHOD_TLSv1_1_SERVER' => array( + '5.5' => false, + '5.6' => true, + ), + 'STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT' => array( + '5.5' => false, + '5.6' => true, + ), + 'STREAM_CRYPTO_METHOD_TLSv1_2_SERVER' => array( + '5.5' => false, + '5.6' => true, + ), + // PostgreSQL: + 'PGSQL_CONNECT_ASYNC' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_CONNECTION_AUTH_OK' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_CONNECTION_AWAITING_RESPONSE' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_CONNECTION_MADE' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_CONNECTION_SETENV' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_CONNECTION_SSL_STARTUP' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_CONNECTION_STARTED' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_DML_ESCAPE' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_POLLING_ACTIVE' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_POLLING_FAILED' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_POLLING_OK' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_POLLING_READING' => array( + '5.5' => false, + '5.6' => true, + ), + 'PGSQL_POLLING_WRITING' => array( + '5.5' => false, + '5.6' => true, + ), + // Tokenizer: + 'T_ELLIPSIS' => array( + '5.5' => false, + '5.6' => true, + ), + 'T_POW' => array( + '5.5' => false, + '5.6' => true, + ), + 'T_POW_EQUAL' => array( + '5.5' => false, + '5.6' => true, + ), + + 'INI_SCANNER_TYPED' => array( + '5.6.0' => false, + '5.6.1' => true, + ), + + 'JSON_PRESERVE_ZERO_FRACTION' => array( + '5.6.5' => false, + '5.6.6' => true, + ), + + 'MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT' => array( + '5.6.15' => false, + '5.6.16' => true, + ), + + // GD: + // Also introduced in 7.0.10. + 'IMG_WEBP' => array( + '5.6.24' => false, + '5.6.25' => true, + ), + + + 'TOKEN_PARSE' => array( + '5.6' => false, + '7.0' => true, + ), + 'FILTER_VALIDATE_DOMAIN' => array( + '5.6' => false, + '7.0' => true, + ), + 'PHP_INT_MIN' => array( + '5.6' => false, + '7.0' => true, + ), + // Curl: + 'CURLPIPE_NOTHING' => array( + '5.6' => false, + '7.0' => true, + ), + 'CURLPIPE_HTTP1' => array( + '5.6' => false, + '7.0' => true, + ), + 'CURLPIPE_MULTIPLEX' => array( + '5.6' => false, + '7.0' => true, + ), + // JSON: + 'JSON_ERROR_INVALID_PROPERTY_NAME' => array( + '5.6' => false, + '7.0' => true, + ), + 'JSON_ERROR_UTF16' => array( + '5.6' => false, + '7.0' => true, + ), + // LibXML: + 'LIBXML_BIGLINES' => array( + '5.6' => false, + '7.0' => true, + ), + // PCRE: + 'PREG_JIT_STACKLIMIT_ERROR' => array( + '5.6' => false, + '7.0' => true, + ), + // POSIX: + 'POSIX_RLIMIT_AS' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_CORE' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_CPU' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_DATA' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_FSIZE' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_LOCKS' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_MEMLOCK' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_MSGQUEUE' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_NICE' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_NOFILE' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_NPROC' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_RSS' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_RTPRIO' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_RTTIME' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_SIGPENDING' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_STACK' => array( + '5.6' => false, + '7.0' => true, + ), + 'POSIX_RLIMIT_INFINITY' => array( + '5.6' => false, + '7.0' => true, + ), + // Tokenizer: + 'T_COALESCE' => array( + '5.6' => false, + '7.0' => true, + ), + 'T_SPACESHIP' => array( + '5.6' => false, + '7.0' => true, + ), + 'T_YIELD_FROM' => array( + '5.6' => false, + '7.0' => true, + ), + + // Zlib: + // The first three are in the PHP 5.4 changelog, but the Extension constant page says 7.0. + 'ZLIB_ENCODING_RAW' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_ENCODING_DEFLATE' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_ENCODING_GZIP' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_FILTERED' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_HUFFMAN_ONLY' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_FIXED' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_RLE' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_DEFAULT_STRATEGY' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_BLOCK' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_FINISH' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_FULL_FLUSH' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_NO_FLUSH' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_PARTIAL_FLUSH' => array( + '5.6' => false, + '7.0' => true, + ), + 'ZLIB_SYNC_FLUSH' => array( + '5.6' => false, + '7.0' => true, + ), + + 'CURL_HTTP_VERSION_2' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURL_HTTP_VERSION_2TLS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURL_REDIR_POST_301' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURL_REDIR_POST_302' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURL_REDIR_POST_303' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURL_REDIR_POST_ALL' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURL_VERSION_KERBEROS5' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURL_VERSION_PSL' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURL_VERSION_UNIX_SOCKETS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLAUTH_NEGOTIATE' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLAUTH_NTLM_WB' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLFTP_CREATE_DIR' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLFTP_CREATE_DIR_NONE' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLFTP_CREATE_DIR_RETRY' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLHEADER_SEPARATE' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLHEADER_UNIFIED' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLMOPT_MAX_HOST_CONNECTIONS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLMOPT_MAX_PIPELINE_LENGTH' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLMOPT_MAX_TOTAL_CONNECTIONS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_CONNECT_TO' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_DEFAULT_PROTOCOL' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_DNS_INTERFACE' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_DNS_LOCAL_IP4' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_DNS_LOCAL_IP6' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_EXPECT_100_TIMEOUT_MS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_HEADEROPT' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_LOGIN_OPTIONS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_PATH_AS_IS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_PINNEDPUBLICKEY' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_PIPEWAIT' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_PROXY_SERVICE_NAME' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_PROXYHEADER' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_SASL_IR' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_SERVICE_NAME' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_SSL_ENABLE_ALPN' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_SSL_ENABLE_NPN' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_SSL_FALSESTART' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_SSL_VERIFYSTATUS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_STREAM_WEIGHT' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_TCP_FASTOPEN' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_TFTP_NO_OPTIONS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_UNIX_SOCKET_PATH' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLOPT_XOAUTH2_BEARER' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLPROTO_SMB' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLPROTO_SMBS' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLPROXY_HTTP_1_0' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLSSH_AUTH_AGENT' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + 'CURLSSLOPT_NO_REVOKE' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + + 'PHP_FD_SETSIZE' => array( + '7.0' => false, + '7.1' => true, + ), + // Curl: + 'CURLMOPT_PUSHFUNCTION' => array( + '7.0' => false, + '7.1' => true, + ), + 'CURL_PUSH_OK' => array( + '7.0' => false, + '7.1' => true, + ), + 'CURL_PUSH_DENY' => array( + '7.0' => false, + '7.1' => true, + ), + // Filter: + 'FILTER_FLAG_EMAIL_UNICODE' => array( + '7.0' => false, + '7.1' => true, + ), + // GD: + 'IMAGETYPE_WEBP' => array( + '7.0' => false, + '7.1' => true, + ), + // Json: + 'JSON_UNESCAPED_LINE_TERMINATORS' => array( + '7.0' => false, + '7.1' => true, + ), + // LDAP: + 'LDAP_OPT_X_SASL_NOCANON' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_SASL_USERNAME' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_CACERTDIR' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_CACERTFILE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_CERTFILE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_CIPHER_SUITE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_KEYFILE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_RANDOM_FILE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_CRLCHECK' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_CRL_NONE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_CRL_PEER' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_CRL_ALL' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_DHFILE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_CRLFILE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_PROTOCOL_MIN' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_PROTOCOL_SSL2' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_PROTOCOL_SSL3' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_PROTOCOL_TLS1_0' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_PROTOCOL_TLS1_1' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_PROTOCOL_TLS1_2' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_TLS_PACKAGE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_KEEPALIVE_IDLE' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_KEEPALIVE_PROBES' => array( + '7.0' => false, + '7.1' => true, + ), + 'LDAP_OPT_X_KEEPALIVE_INTERVAL' => array( + '7.0' => false, + '7.1' => true, + ), + // PostgreSQL: + 'PGSQL_NOTICE_LAST' => array( + '7.0' => false, + '7.1' => true, + ), + 'PGSQL_NOTICE_ALL' => array( + '7.0' => false, + '7.1' => true, + ), + 'PGSQL_NOTICE_CLEAR' => array( + '7.0' => false, + '7.1' => true, + ), + // SPL: + 'MT_RAND_PHP' => array( + '7.0' => false, + '7.1' => true, + ), + + // SQLite3: + 'SQLITE3_DETERMINISTIC' => array( + '7.1.3' => false, + '7.1.4' => true, + ), + + // Core: + 'PHP_OS_FAMILY' => array( + '7.1' => false, + '7.2' => true, + ), + 'PHP_FLOAT_DIG' => array( + '7.1' => false, + '7.2' => true, + ), + 'PHP_FLOAT_EPSILON' => array( + '7.1' => false, + '7.2' => true, + ), + 'PHP_FLOAT_MIN' => array( + '7.1' => false, + '7.2' => true, + ), + 'PHP_FLOAT_MAX' => array( + '7.1' => false, + '7.2' => true, + ), + + // Core/Password Hashing: + 'PASSWORD_ARGON2I' => array( + '7.1' => false, + '7.2' => true, + ), + 'PASSWORD_ARGON2_DEFAULT_MEMORY_COST' => array( + '7.1' => false, + '7.2' => true, + ), + 'PASSWORD_ARGON2_DEFAULT_TIME_COST' => array( + '7.1' => false, + '7.2' => true, + ), + 'PASSWORD_ARGON2_DEFAULT_THREADS' => array( + '7.1' => false, + '7.2' => true, + ), + + // Fileinfo: + 'FILEINFO_EXTENSION' => array( + '7.1' => false, + '7.2' => true, + ), + + // GD: + 'IMG_EFFECT_MULTIPLY' => array( + '7.1' => false, + '7.2' => true, + ), + 'IMG_BMP' => array( + '7.1' => false, + '7.2' => true, + ), + + // JSON: + 'JSON_INVALID_UTF8_IGNORE' => array( + '7.1' => false, + '7.2' => true, + ), + 'JSON_INVALID_UTF8_SUBSTITUTE' => array( + '7.1' => false, + '7.2' => true, + ), + + // LDAP: + 'LDAP_EXOP_START_TLS' => array( + '7.1' => false, + '7.2' => true, + ), + 'LDAP_EXOP_MODIFY_PASSWD' => array( + '7.1' => false, + '7.2' => true, + ), + 'LDAP_EXOP_REFRESH' => array( + '7.1' => false, + '7.2' => true, + ), + 'LDAP_EXOP_WHO_AM_I' => array( + '7.1' => false, + '7.2' => true, + ), + 'LDAP_EXOP_TURN' => array( + '7.1' => false, + '7.2' => true, + ), + + // PCRE: + 'PREG_UNMATCHED_AS_NULL' => array( + '7.1' => false, + '7.2' => true, + ), + + // Sodium: + 'SODIUM_LIBRARY_VERSION' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_LIBRARY_MAJOR_VERSION' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_LIBRARY_MINOR_VERSION' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_BASE64_VARIANT_ORIGINAL' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_BASE64_VARIANT_URLSAFE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_AES256GCM_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_AES256GCM_NSECBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_AES256GCM_NPUBBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_AES256GCM_ABYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_ABYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AUTH_BYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_AUTH_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_BOX_SEALBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_BOX_SECRETKEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_BOX_PUBLICKEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_BOX_KEYPAIRBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_BOX_MACBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_BOX_NONCEBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_BOX_SEEDBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_KDF_BYTES_MIN' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_KDF_BYTES_MAX' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_KDF_CONTEXTBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_KDF_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_KX_SEEDBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_KX_SESSIONKEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_KX_PUBLICKEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_KX_SECRETKEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_KX_KEYPAIRBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_GENERICHASH_BYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_GENERICHASH_BYTES_MIN' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_GENERICHASH_BYTES_MAX' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_GENERICHASH_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MIN' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MAX' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_ALG_DEFAULT' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_SALTBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_STRPREFIX' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_MEMLIMIT_SENSITIVE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SCALARMULT_BYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SCALARMULT_SCALARBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SHORTHASH_BYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SHORTHASH_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETBOX_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETBOX_MACBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETBOX_NONCEBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SIGN_BYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SIGN_SEEDBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SIGN_SECRETKEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_SIGN_KEYPAIRBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_STREAM_NONCEBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + 'SODIUM_CRYPTO_STREAM_KEYBYTES' => array( + '7.1' => false, + '7.2' => true, + ), + + 'CURLAUTH_BEARER' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLAUTH_GSSAPI' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLE_WEIRD_SERVER_REPLY' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_APPCONNECT_TIME_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_CONNECT_TIME_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_CONTENT_LENGTH_DOWNLOAD_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_CONTENT_LENGTH_UPLOAD_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_FILETIME_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_HTTP_VERSION' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_NAMELOOKUP_TIME_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_PRETRANSFER_TIME_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_PROTOCOL' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_PROXY_SSL_VERIFYRESULT' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_REDIRECT_TIME_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_SCHEME' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_SIZE_DOWNLOAD_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_SIZE_UPLOAD_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_SPEED_DOWNLOAD_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_SPEED_UPLOAD_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_STARTTRANSFER_TIME_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLINFO_TOTAL_TIME_T' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_LOCK_DATA_CONNECT' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_LOCK_DATA_PSL' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_MAX_READ_SIZE' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_ABSTRACT_UNIX_SOCKET' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_DISALLOW_USERNAME_IN_URL' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_DNS_SHUFFLE_ADDRESSES' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_HAPROXYPROTOCOL' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_KEEP_SENDING_ON_ERROR' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PRE_PROXY' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_CAINFO' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_CAPATH' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_CRLFILE' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_KEYPASSWD' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_PINNEDPUBLICKEY' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_SSLCERT' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_SSLCERTTYPE' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_SSL_CIPHER_LIST' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_SSLKEY' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_SSLKEYTYPE' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_SSL_OPTIONS' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_SSL_VERIFYHOST' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_SSL_VERIFYPEER' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_SSLVERSION' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_TLS13_CIPHERS' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_TLSAUTH_PASSWORD' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_TLSAUTH_TYPE' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_PROXY_TLSAUTH_USERNAME' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_REQUEST_TARGET' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_SOCKS5_AUTH' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_SSH_COMPRESSION' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_SUPPRESS_CONNECT_HEADERS' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_TIMEVALUE_LARGE' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLOPT_TLS13_CIPHERS' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLPROXY_HTTPS' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURLSSH_AUTH_GSSAPI' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_SSLVERSION_MAX_DEFAULT' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_SSLVERSION_MAX_NONE' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_SSLVERSION_MAX_TLSv1_0' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_SSLVERSION_MAX_TLSv1_1' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_SSLVERSION_MAX_TLSv1_2' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_SSLVERSION_MAX_TLSv1_3' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_SSLVERSION_TLSv1_3' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_ASYNCHDNS' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_BROTLI' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_CONV' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_DEBUG' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_GSSAPI' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_GSSNEGOTIATE' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_HTTPS_PROXY' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_IDN' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_LARGEFILE' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_MULTI_SSL' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_NTLM' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_NTLM_WB' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_SPNEGO' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_SSPI' => array( + '7.2' => false, + '7.3' => true, + ), + 'CURL_VERSION_TLSAUTH_SRP' => array( + '7.2' => false, + '7.3' => true, + ), + 'FILTER_SANITIZE_ADD_SLASHES' => array( + '7.2' => false, + '7.3' => true, + ), + 'JSON_THROW_ON_ERROR' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_MANAGEDSAIT' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_PROXY_AUTHZ' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_SUBENTRIES' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_VALUESRETURNFILTER' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_ASSERT' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_PRE_READ' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_POST_READ' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_SORTREQUEST' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_SORTRESPONSE' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_PAGEDRESULTS' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_AUTHZID_REQUEST' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_AUTHZID_RESPONSE' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_SYNC' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_SYNC_STATE' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_SYNC_DONE' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_DONTUSECOPY' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_PASSWORDPOLICYREQUEST' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_PASSWORDPOLICYRESPONSE' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_X_INCREMENTAL_VALUES' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_X_DOMAIN_SCOPE' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_X_PERMISSIVE_MODIFY' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_X_SEARCH_OPTIONS' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_X_TREE_DELETE' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_X_EXTENDED_DN' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_VLVREQUEST' => array( + '7.2' => false, + '7.3' => true, + ), + 'LDAP_CONTROL_VLVRESPONSE' => array( + '7.2' => false, + '7.3' => true, + ), + 'MB_CASE_FOLD' => array( + '7.2' => false, + '7.3' => true, + ), + 'MB_CASE_UPPER_SIMPLE' => array( + '7.2' => false, + '7.3' => true, + ), + 'MB_CASE_LOWER_SIMPLE' => array( + '7.2' => false, + '7.3' => true, + ), + 'MB_CASE_TITLE_SIMPLE' => array( + '7.2' => false, + '7.3' => true, + ), + 'MB_CASE_FOLD_SIMPLE' => array( + '7.2' => false, + '7.3' => true, + ), + 'PGSQL_DIAG_SCHEMA_NAME' => array( + '7.2' => false, + '7.3' => true, + ), + 'PGSQL_DIAG_TABLE_NAME' => array( + '7.2' => false, + '7.3' => true, + ), + 'PGSQL_DIAG_COLUMN_NAME' => array( + '7.2' => false, + '7.3' => true, + ), + 'PGSQL_DIAG_DATATYPE_NAME' => array( + '7.2' => false, + '7.3' => true, + ), + 'PGSQL_DIAG_CONSTRAINT_NAME' => array( + '7.2' => false, + '7.3' => true, + ), + 'PGSQL_DIAG_SEVERITY_NONLOCALIZED' => array( + '7.2' => false, + '7.3' => true, + ), + 'PASSWORD_ARGON2ID' => array( + '7.2' => false, + '7.3' => true, + ), + 'STREAM_CRYPTO_PROTO_SSLv3' => array( + '7.2' => false, + '7.3' => true, + ), + 'STREAM_CRYPTO_PROTO_TLSv1_0' => array( + '7.2' => false, + '7.3' => true, + ), + 'STREAM_CRYPTO_PROTO_TLSv1_1' => array( + '7.2' => false, + '7.3' => true, + ), + 'STREAM_CRYPTO_PROTO_TLSv1_2' => array( + '7.2' => false, + '7.3' => true, + ), + + 'CURL_VERSION_ALTSVC' => array( + '7.3.5' => false, + '7.3.6' => true, + ), + 'CURL_VERSION_CURLDEBUG' => array( + '7.3.5' => false, + '7.3.6' => true, + ), + + 'IMG_FILTER_SCATTER' => array( + '7.3' => false, + '7.4' => true, + ), + 'MB_ONIGURUMA_VERSION' => array( + '7.3' => false, + '7.4' => true, + ), + 'SO_LABEL' => array( + '7.3' => false, + '7.4' => true, + ), + 'SO_PEERLABEL' => array( + '7.3' => false, + '7.4' => true, + ), + 'SO_LISTENQLIMIT' => array( + '7.3' => false, + '7.4' => true, + ), + 'SO_LISTENQLEN' => array( + '7.3' => false, + '7.4' => true, + ), + 'SO_USER_COOKIE' => array( + '7.3' => false, + '7.4' => true, + ), + 'PASSWORD_ARGON2_PROVIDER' => array( + '7.3' => false, + '7.4' => true, + ), + 'PHP_WINDOWS_EVENT_CTRL_C' => array( + '7.3' => false, + '7.4' => true, + ), + 'PHP_WINDOWS_EVENT_CTRL_BREAK' => array( + '7.3' => false, + '7.4' => true, + ), + 'T_BAD_CHARACTER' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_ARTICLE' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_ASIDE' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_AUDIO' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_BDI' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_CANVAS' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_COMMAND' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_DATALIST' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_DETAILS' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_DIALOG' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_FIGCAPTION' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_FIGURE' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_FOOTER' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_HEADER' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_HGROUP' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_MAIN' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_MARK' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_MENUITEM' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_METER' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_NAV' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_OUTPUT' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_PROGRESS' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_SECTION' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_SOURCE' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_SUMMARY' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_TEMPLATE' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_TIME' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_TRACK' => array( + '7.3' => false, + '7.4' => true, + ), + 'TIDY_TAG_VIDEO' => array( + '7.3' => false, + '7.4' => true, + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.1.0 + * + * @return array + */ + public function register() + { + return array(\T_STRING); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.1.0 + * + * @param \PHP_CodeSniffer_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(); + $constantName = $tokens[$stackPtr]['content']; + + if (isset($this->newConstants[$constantName]) === false) { + return; + } + + if ($this->isUseOfGlobalConstant($phpcsFile, $stackPtr) === false) { + return; + } + + $itemInfo = array( + 'name' => $constantName, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 8.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newConstants[$itemInfo['name']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 8.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The constant "%s" is not present in PHP version %s or earlier'; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php new file mode 100644 index 00000000..ccd58641 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php @@ -0,0 +1,80 @@ +supportsBelow('5.4') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (strtolower($tokens[$stackPtr]['content']) !== 'class') { + return; + } + + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); + if ($prevToken === false || $tokens[$prevToken]['code'] !== \T_DOUBLE_COLON) { + return; + } + + $phpcsFile->addError( + 'The magic class constant ClassName::class was not available in PHP 5.4 or earlier', + $stackPtr, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php new file mode 100644 index 00000000..b6c8f8d7 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php @@ -0,0 +1,574 @@ + array(string => bool|string)) + */ + protected $removedConstants = array( + // Disabled since PHP 5.3.0 due to thread safety issues. + 'FILEINFO_COMPRESS' => array( + '5.3' => true, + ), + + 'CURLOPT_CLOSEPOLICY' => array( + '5.6' => true, + ), + 'CURLCLOSEPOLICY_LEAST_RECENTLY_USED' => array( + '5.6' => true, + ), + 'CURLCLOSEPOLICY_LEAST_TRAFFIC' => array( + '5.6' => true, + ), + 'CURLCLOSEPOLICY_SLOWEST' => array( + '5.6' => true, + ), + 'CURLCLOSEPOLICY_CALLBACK' => array( + '5.6' => true, + ), + 'CURLCLOSEPOLICY_OLDEST' => array( + '5.6' => true, + ), + + 'PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT' => array( + '7.0' => true, + ), + 'T_CHARACTER' => array( + '7.0' => true, + ), + 'T_BAD_CHARACTER' => array( + '7.0' => true, + ), + + 'INTL_IDNA_VARIANT_2003' => array( + '7.2' => false, + ), + + 'MCRYPT_MODE_ECB' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_MODE_CBC' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_MODE_CFB' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_MODE_OFB' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_MODE_NOFB' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_MODE_STREAM' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_ENCRYPT' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_DECRYPT' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_DEV_RANDOM' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_DEV_URANDOM' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RAND' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_3DES' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_ARCFOUR_IV' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_ARCFOUR' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_BLOWFISH' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_CAST_128' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_CAST_256' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_CRYPT' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_DES' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_DES_COMPAT' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_ENIGMA' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_GOST' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_IDEA' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_LOKI97' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_MARS' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_PANAMA' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RIJNDAEL_128' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RIJNDAEL_192' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RIJNDAEL_256' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RC2' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RC4' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RC6' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RC6_128' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RC6_192' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_RC6_256' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_SAFER64' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_SAFER128' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_SAFERPLUS' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_SERPENT' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_SERPENT_128' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_SERPENT_192' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_SERPENT_256' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_SKIPJACK' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_TEAN' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_THREEWAY' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_TRIPLEDES' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_TWOFISH' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_TWOFISH128' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_TWOFISH192' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_TWOFISH256' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_WAKE' => array( + '7.1' => false, + '7.2' => true, + ), + 'MCRYPT_XTEA' => array( + '7.1' => false, + '7.2' => true, + ), + + 'PHPDBG_FILE' => array( + '7.3' => true, + ), + 'PHPDBG_METHOD' => array( + '7.3' => true, + ), + 'PHPDBG_LINENO' => array( + '7.3' => true, + ), + 'PHPDBG_FUNC' => array( + '7.3' => true, + ), + 'FILTER_FLAG_SCHEME_REQUIRED' => array( + '7.3' => false, + ), + 'FILTER_FLAG_HOST_REQUIRED' => array( + '7.3' => false, + ), + + 'CURLPIPE_HTTP1' => array( + '7.4' => false, + ), + 'FILTER_SANITIZE_MAGIC_QUOTES' => array( + '7.4' => false, + 'alternative' => 'FILTER_SANITIZE_ADD_SLASHES', + ), + 'IBASE_BKP_CONVERT' => array( + '7.4' => true, + ), + 'IBASE_BKP_IGNORE_CHECKSUMS' => array( + '7.4' => true, + ), + 'IBASE_BKP_IGNORE_LIMBO' => array( + '7.4' => true, + ), + 'IBASE_BKP_METADATA_ONLY' => array( + '7.4' => true, + ), + 'IBASE_BKP_NO_GARBAGE_COLLECT' => array( + '7.4' => true, + ), + 'IBASE_BKP_NON_TRANSPORTABLE' => array( + '7.4' => true, + ), + 'IBASE_BKP_OLD_DESCRIPTIONS' => array( + '7.4' => true, + ), + 'IBASE_COMMITTED' => array( + '7.4' => true, + ), + 'IBASE_CONCURRENCY' => array( + '7.4' => true, + ), + 'IBASE_CONSISTENCY' => array( + '7.4' => true, + ), + 'IBASE_DEFAULT' => array( + '7.4' => true, + ), + 'IBASE_FETCH_ARRAYS' => array( + '7.4' => true, + ), + 'IBASE_FETCH_BLOBS' => array( + '7.4' => true, + ), + 'IBASE_NOWAIT' => array( + '7.4' => true, + ), + 'IBASE_PRP_ACCESS_MODE' => array( + '7.4' => true, + ), + 'IBASE_PRP_ACTIVATE' => array( + '7.4' => true, + ), + 'IBASE_PRP_AM_READONLY' => array( + '7.4' => true, + ), + 'IBASE_PRP_AM_READWRITE' => array( + '7.4' => true, + ), + 'IBASE_PRP_DENY_NEW_ATTACHMENTS' => array( + '7.4' => true, + ), + 'IBASE_PRP_DENY_NEW_TRANSACTIONS' => array( + '7.4' => true, + ), + 'IBASE_PRP_DB_ONLINE' => array( + '7.4' => true, + ), + 'IBASE_PRP_PAGE_BUFFERS' => array( + '7.4' => true, + ), + 'IBASE_PRP_RES' => array( + '7.4' => true, + ), + 'IBASE_PRP_RES_USE_FULL' => array( + '7.4' => true, + ), + 'IBASE_PRP_RESERVE_SPACE' => array( + '7.4' => true, + ), + 'IBASE_PRP_SET_SQL_DIALECT' => array( + '7.4' => true, + ), + 'IBASE_PRP_SHUTDOWN_DB' => array( + '7.4' => true, + ), + 'IBASE_PRP_SWEEP_INTERVAL' => array( + '7.4' => true, + ), + 'IBASE_PRP_WM_ASYNC' => array( + '7.4' => true, + ), + 'IBASE_PRP_WM_SYNC' => array( + '7.4' => true, + ), + 'IBASE_PRP_WRITE_MODE' => array( + '7.4' => true, + ), + 'IBASE_READ' => array( + '7.4' => true, + ), + 'IBASE_RES_CREATE' => array( + '7.4' => true, + ), + 'IBASE_RES_DEACTIVATE_IDX' => array( + '7.4' => true, + ), + 'IBASE_RES_NO_SHADOW' => array( + '7.4' => true, + ), + 'IBASE_RES_NO_VALIDITY' => array( + '7.4' => true, + ), + 'IBASE_RES_ONE_AT_A_TIME' => array( + '7.4' => true, + ), + 'IBASE_RES_REPLACE' => array( + '7.4' => true, + ), + 'IBASE_RES_USE_ALL_SPACE' => array( + '7.4' => true, + ), + 'IBASE_RPR_CHECK_DB' => array( + '7.4' => true, + ), + 'IBASE_RPR_FULL' => array( + '7.4' => true, + ), + 'IBASE_RPR_IGNORE_CHECKSUM' => array( + '7.4' => true, + ), + 'IBASE_RPR_KILL_SHADOWS' => array( + '7.4' => true, + ), + 'IBASE_RPR_MEND_DB' => array( + '7.4' => true, + ), + 'IBASE_RPR_SWEEP_DB' => array( + '7.4' => true, + ), + 'IBASE_RPR_VALIDATE_DB' => array( + '7.4' => true, + ), + 'IBASE_STS_DATA_PAGES' => array( + '7.4' => true, + ), + 'IBASE_STS_DB_LOG' => array( + '7.4' => true, + ), + 'IBASE_STS_HDR_PAGES' => array( + '7.4' => true, + ), + 'IBASE_STS_IDX_PAGES' => array( + '7.4' => true, + ), + 'IBASE_STS_SYS_RELATIONS' => array( + '7.4' => true, + ), + 'IBASE_SVC_GET_ENV' => array( + '7.4' => true, + ), + 'IBASE_SVC_GET_ENV_LOCK' => array( + '7.4' => true, + ), + 'IBASE_SVC_GET_ENV_MSG' => array( + '7.4' => true, + ), + 'IBASE_SVC_GET_USERS' => array( + '7.4' => true, + ), + 'IBASE_SVC_IMPLEMENTATION' => array( + '7.4' => true, + ), + 'IBASE_SVC_SERVER_VERSION' => array( + '7.4' => true, + ), + 'IBASE_SVC_SVR_DB_INFO' => array( + '7.4' => true, + ), + 'IBASE_SVC_USER_DBPATH' => array( + '7.4' => true, + ), + 'IBASE_UNIXTIME' => array( + '7.4' => true, + ), + 'IBASE_WAIT' => array( + '7.4' => true, + ), + 'IBASE_WRITE' => array( + '7.4' => true, + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.1.0 + * + * @return array + */ + public function register() + { + return array(\T_STRING); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.1.0 + * + * @param \PHP_CodeSniffer_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(); + $constantName = $tokens[$stackPtr]['content']; + + if (isset($this->removedConstants[$constantName]) === false) { + return; + } + + if ($this->isUseOfGlobalConstant($phpcsFile, $stackPtr) === false) { + return; + } + + $itemInfo = array( + 'name' => $constantName, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 8.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->removedConstants[$itemInfo['name']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 8.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The constant "%s" is '; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php new file mode 100644 index 00000000..8d56b93a --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php @@ -0,0 +1,238 @@ + \T_FOR, + \T_FOREACH => \T_FOREACH, + \T_WHILE => \T_WHILE, + \T_DO => \T_DO, + \T_SWITCH => \T_SWITCH, + ); + + /** + * Tokens which start a new case within a switch. + * + * @since 8.2.0 + * + * @var array + */ + protected $caseTokens = array( + \T_CASE => \T_CASE, + \T_DEFAULT => \T_DEFAULT, + ); + + /** + * Token codes which are accepted to determine the level for the continue. + * + * This array is enriched with the arithmetic operators in the register() method. + * + * @since 8.2.0 + * + * @var array + */ + protected $acceptedLevelTokens = array( + \T_LNUMBER => \T_LNUMBER, + \T_OPEN_PARENTHESIS => \T_OPEN_PARENTHESIS, + \T_CLOSE_PARENTHESIS => \T_CLOSE_PARENTHESIS, + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.2.0 + * + * @return array + */ + public function register() + { + $this->acceptedLevelTokens += Tokens::$arithmeticTokens; + $this->acceptedLevelTokens += Tokens::$emptyTokens; + + return array(\T_SWITCH); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.3') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $switchOpener = $tokens[$stackPtr]['scope_opener']; + $switchCloser = $tokens[$stackPtr]['scope_closer']; + + // Quick check whether we need to bother with the more complex logic. + $hasContinue = $phpcsFile->findNext(\T_CONTINUE, ($switchOpener + 1), $switchCloser); + if ($hasContinue === false) { + return; + } + + $caseDefault = $switchOpener; + + do { + $caseDefault = $phpcsFile->findNext($this->caseTokens, ($caseDefault + 1), $switchCloser); + if ($caseDefault === false) { + break; + } + + if (isset($tokens[$caseDefault]['scope_opener']) === false) { + // Unknown start of the case, skip. + continue; + } + + $caseOpener = $tokens[$caseDefault]['scope_opener']; + $nextCaseDefault = $phpcsFile->findNext($this->caseTokens, ($caseDefault + 1), $switchCloser); + if ($nextCaseDefault === false) { + $caseCloser = $switchCloser; + } else { + $caseCloser = $nextCaseDefault; + } + + // Check for unscoped control structures within the case. + $controlStructure = $caseOpener; + $doCount = 0; + while (($controlStructure = $phpcsFile->findNext($this->loopStructures, ($controlStructure + 1), $caseCloser)) !== false) { + if ($tokens[$controlStructure]['code'] === \T_DO) { + $doCount++; + } + + if (isset($tokens[$controlStructure]['scope_opener'], $tokens[$controlStructure]['scope_closer']) === false) { + if ($tokens[$controlStructure]['code'] === \T_WHILE && $doCount > 0) { + // While in a do-while construct. + $doCount--; + continue; + } + + // Control structure without braces found within the case, ignore this case. + continue 2; + } + } + + // Examine the contents of the case. + $continue = $caseOpener; + + do { + $continue = $phpcsFile->findNext(\T_CONTINUE, ($continue + 1), $caseCloser); + if ($continue === false) { + break; + } + + $nextSemicolon = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($continue + 1), $caseCloser); + $codeString = ''; + for ($i = ($continue + 1); $i < $nextSemicolon; $i++) { + if (isset($this->acceptedLevelTokens[$tokens[$i]['code']]) === false) { + // Function call/variable or other token which make numeric level impossible to determine. + continue 2; + } + + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { + continue; + } + + $codeString .= $tokens[$i]['content']; + } + + $level = null; + if ($codeString !== '') { + if (is_numeric($codeString)) { + $level = (int) $codeString; + } else { + // With the above logic, the string can only contain digits and operators, eval! + $level = eval("return ( $codeString );"); + } + } + + if (isset($level) === false || $level === 0) { + $level = 1; + } + + // Examine which control structure is being targeted by the continue statement. + if (isset($tokens[$continue]['conditions']) === false) { + continue; + } + + $conditions = array_reverse($tokens[$continue]['conditions'], true); + // PHPCS adds more structures to the conditions array than we want to take into + // consideration, so clean up the array. + foreach ($conditions as $tokenPtr => $tokenCode) { + if (isset($this->loopStructures[$tokenCode]) === false) { + unset($conditions[$tokenPtr]); + } + } + + $targetCondition = \array_slice($conditions, ($level - 1), 1, true); + if (empty($targetCondition)) { + continue; + } + + $conditionToken = key($targetCondition); + if ($conditionToken === $stackPtr) { + $phpcsFile->addWarning( + "Targeting a 'switch' control structure with a 'continue' statement is strongly discouraged and will throw a warning as of PHP 7.3.", + $continue, + 'Found' + ); + } + + } while ($continue < $caseCloser); + + } while ($caseDefault < $switchCloser); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php new file mode 100644 index 00000000..2cfbcc53 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php @@ -0,0 +1,116 @@ + true, + \T_FOREACH => true, + \T_WHILE => true, + \T_DO => true, + \T_SWITCH => true, + ); + + /** + * Token codes which did not correctly get a condition assigned in older PHPCS versions. + * + * @since 7.0.7 + * + * @var array + */ + protected $backCompat = array( + \T_CASE => true, + \T_DEFAULT => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.7 + * + * @return array + */ + public function register() + { + return array( + \T_BREAK, + \T_CONTINUE, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.7 + * + * @param \PHP_CodeSniffer_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(); + $token = $tokens[$stackPtr]; + + // Check if the break/continue is within a valid loop structure. + if (empty($token['conditions']) === false) { + foreach ($token['conditions'] as $tokenCode) { + if (isset($this->validLoopStructures[$tokenCode]) === true) { + return; + } + } + } else { + // Deal with older PHPCS versions. + if (isset($token['scope_condition']) === true && isset($this->backCompat[$tokens[$token['scope_condition']]['code']]) === true) { + return; + } + } + + // If we're still here, no valid loop structure container has been found, so throw an error. + $error = "Using '%s' outside of a loop or switch structure is invalid"; + $isError = false; + $errorCode = 'Found'; + $data = array($token['content']); + + if ($this->supportsAbove('7.0')) { + $error .= ' and will throw a fatal error since PHP 7.0'; + $isError = true; + $errorCode = 'FatalError'; + } + + $this->addMessage($phpcsFile, $error, $stackPtr, $isError, $errorCode, $data); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php new file mode 100644 index 00000000..f63c8488 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php @@ -0,0 +1,110 @@ + 'a variable argument', + 'zeroArgument' => '0 as an argument', + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * + * @return array + */ + public function register() + { + return array(\T_BREAK, \T_CONTINUE); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('5.4') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $nextSemicolonToken = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($stackPtr), null, false); + $errorType = ''; + for ($curToken = $stackPtr + 1; $curToken < $nextSemicolonToken; $curToken++) { + if ($tokens[$curToken]['type'] === 'T_STRING') { + // If the next non-whitespace token after the string + // is an opening parenthesis then it's a function call. + $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, $curToken + 1, null, true); + if ($tokens[$openBracket]['code'] === \T_OPEN_PARENTHESIS) { + $errorType = 'variableArgument'; + break; + } + + } elseif (\in_array($tokens[$curToken]['type'], array('T_VARIABLE', 'T_FUNCTION', 'T_CLOSURE'), true)) { + $errorType = 'variableArgument'; + break; + + } elseif ($tokens[$curToken]['type'] === 'T_LNUMBER' && $tokens[$curToken]['content'] === '0') { + $errorType = 'zeroArgument'; + break; + } + } + + if ($errorType !== '') { + $error = 'Using %s on break or continue is forbidden since PHP 5.4'; + $errorCode = $errorType . 'Found'; + $data = array($this->errorTypes[$errorType]); + + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php new file mode 100644 index 00000000..26f41c07 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php @@ -0,0 +1,81 @@ +supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $defaultToken = $stackPtr; + $defaultCount = 0; + $targetLevel = $tokens[$stackPtr]['level'] + 1; + while ($defaultCount < 2 && ($defaultToken = $phpcsFile->findNext(array(\T_DEFAULT), $defaultToken + 1, $tokens[$stackPtr]['scope_closer'])) !== false) { + // Same level or one below (= two default cases after each other). + if ($tokens[$defaultToken]['level'] === $targetLevel || $tokens[$defaultToken]['level'] === ($targetLevel + 1)) { + $defaultCount++; + } + } + + if ($defaultCount > 1) { + $phpcsFile->addError( + 'Switch statements can not have multiple default blocks since PHP 7.0', + $stackPtr, + 'Found' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php new file mode 100644 index 00000000..0e71a261 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php @@ -0,0 +1,378 @@ + array(string => bool|string|array)) + */ + protected $newDirectives = array( + 'ticks' => array( + '3.1' => false, + '4.0' => true, + 'valid_value_callback' => 'isNumeric', + ), + 'encoding' => array( + '5.2' => false, + '5.3' => '--enable-zend-multibyte', // Directive ignored unless. + '5.4' => true, + 'valid_value_callback' => 'validEncoding', + ), + 'strict_types' => array( + '5.6' => false, + '7.0' => true, + 'valid_values' => array(1), + ), + ); + + + /** + * Tokens to ignore when trying to find the value for the directive. + * + * @since 7.0.3 + * + * @var array + */ + protected $ignoreTokens = array(); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.3 + * + * @return array + */ + public function register() + { + $this->ignoreTokens = Tokens::$emptyTokens; + $this->ignoreTokens[\T_EQUAL] = \T_EQUAL; + + return array(\T_DECLARE); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_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(); + + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === true) { + $openParenthesis = $tokens[$stackPtr]['parenthesis_opener']; + $closeParenthesis = $tokens[$stackPtr]['parenthesis_closer']; + } else { + if (version_compare(PHPCSHelper::getVersion(), '2.3.4', '>=')) { + return; + } + + // Deal with PHPCS 2.3.0-2.3.3 which do not yet set the parenthesis properly for declare statements. + $openParenthesis = $phpcsFile->findNext(\T_OPEN_PARENTHESIS, ($stackPtr + 1), null, false, null, true); + if ($openParenthesis === false || isset($tokens[$openParenthesis]['parenthesis_closer']) === false) { + return; + } + $closeParenthesis = $tokens[$openParenthesis]['parenthesis_closer']; + } + + $directivePtr = $phpcsFile->findNext(\T_STRING, ($openParenthesis + 1), $closeParenthesis, false); + if ($directivePtr === false) { + return; + } + + $directiveContent = $tokens[$directivePtr]['content']; + + if (isset($this->newDirectives[$directiveContent]) === false) { + $error = 'Declare can only be used with the directives %s. Found: %s'; + $data = array( + implode(', ', array_keys($this->newDirectives)), + $directiveContent, + ); + + $phpcsFile->addError($error, $stackPtr, 'InvalidDirectiveFound', $data); + + } else { + // Check for valid directive for version. + $itemInfo = array( + 'name' => $directiveContent, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + + // Check for valid directive value. + $valuePtr = $phpcsFile->findNext($this->ignoreTokens, $directivePtr + 1, $closeParenthesis, true); + if ($valuePtr === false) { + return; + } + + $this->addWarningOnInvalidValue($phpcsFile, $valuePtr, $directiveContent); + } + } + + + /** + * Determine whether an error/warning should be thrown for an item based on collected information. + * + * @since 7.1.0 + * + * @param array $errorInfo Detail information about an item. + * + * @return bool + */ + protected function shouldThrowError(array $errorInfo) + { + return ($errorInfo['not_in_version'] !== '' || $errorInfo['conditional_version'] !== ''); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newDirectives[$itemInfo['name']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array( + 'valid_value_callback', + 'valid_values', + ); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + $errorInfo['conditional_version'] = ''; + $errorInfo['condition'] = ''; + + $versionArray = $this->getVersionArray($itemArray); + + if (empty($versionArray) === false) { + foreach ($versionArray as $version => $present) { + if (\is_string($present) === true && $this->supportsBelow($version) === true) { + // We cannot test for compilation option (ok, except by scraping the output of phpinfo...). + $errorInfo['conditional_version'] = $version; + $errorInfo['condition'] = $present; + } + } + } + + return $errorInfo; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'Directive ' . parent::getErrorMsgTemplate(); + } + + + /** + * Generates the error or warning for this item. + * + * @since 7.0.3 + * @since 7.1.0 This method now overloads the method from the `AbstractNewFeatureSniff` class. + * - Renamed from `maybeAddError()` to `addError()`. + * - Changed visibility from `protected` to `public`. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the relevant token in + * the stack. + * @param array $itemInfo Base information about the item. + * @param array $errorInfo Array with detail (version) information + * relevant to the item. + * + * @return void + */ + public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) + { + if ($errorInfo['not_in_version'] !== '') { + parent::addError($phpcsFile, $stackPtr, $itemInfo, $errorInfo); + } elseif ($errorInfo['conditional_version'] !== '') { + $error = 'Directive %s is present in PHP version %s but will be disregarded unless PHP is compiled with %s'; + $errorCode = $this->stringToErrorCode($itemInfo['name']) . 'WithConditionFound'; + $data = array( + $itemInfo['name'], + $errorInfo['conditional_version'], + $errorInfo['condition'], + ); + + $phpcsFile->addWarning($error, $stackPtr, $errorCode, $data); + } + } + + + /** + * Generates a error or warning for this sniff. + * + * @since 7.0.3 + * @since 7.0.6 Renamed from `addErrorOnInvalidValue()` to `addWarningOnInvalidValue()`. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the execution directive value + * in the token array. + * @param string $directive The directive. + * + * @return void + */ + protected function addWarningOnInvalidValue(File $phpcsFile, $stackPtr, $directive) + { + $tokens = $phpcsFile->getTokens(); + + $value = $tokens[$stackPtr]['content']; + if (isset(Tokens::$stringTokens[$tokens[$stackPtr]['code']]) === true) { + $value = $this->stripQuotes($value); + } + + $isError = false; + if (isset($this->newDirectives[$directive]['valid_values'])) { + if (\in_array($value, $this->newDirectives[$directive]['valid_values']) === false) { + $isError = true; + } + } elseif (isset($this->newDirectives[$directive]['valid_value_callback'])) { + $valid = \call_user_func(array($this, $this->newDirectives[$directive]['valid_value_callback']), $value); + if ($valid === false) { + $isError = true; + } + } + + if ($isError === true) { + $error = 'The execution directive %s does not seem to have a valid value. Please review. Found: %s'; + $errorCode = $this->stringToErrorCode($directive) . 'InvalidValueFound'; + $data = array( + $directive, + $value, + ); + + $phpcsFile->addWarning($error, $stackPtr, $errorCode, $data); + } + } + + + /** + * Check whether a value is numeric. + * + * Callback function to test whether the value for an execution directive is valid. + * + * @since 7.0.3 + * + * @param mixed $value The value to test. + * + * @return bool + */ + protected function isNumeric($value) + { + return is_numeric($value); + } + + + /** + * Check whether a value is a valid encoding. + * + * Callback function to test whether the value for an execution directive is valid. + * + * @since 7.0.3 + * + * @param mixed $value The value to test. + * + * @return bool + */ + protected function validEncoding($value) + { + static $encodings; + if (isset($encodings) === false && function_exists('mb_list_encodings')) { + $encodings = mb_list_encodings(); + } + + if (empty($encodings) || \is_array($encodings) === false) { + // If we can't test the encoding, let it pass through. + return true; + } + + return \in_array($value, $encodings, true); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php new file mode 100644 index 00000000..a2227692 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php @@ -0,0 +1,99 @@ +supportsBelow('5.4') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { + return; + } + + $opener = $tokens[$stackPtr]['parenthesis_opener']; + $closer = $tokens[$stackPtr]['parenthesis_closer']; + + $asToken = $phpcsFile->findNext(\T_AS, ($opener + 1), $closer); + if ($asToken === false) { + return; + } + + /* + * Note: referencing $key is not allowed in any version, so this should only find referenced $values. + * If it does find a referenced key, it would be a parse error anyway. + */ + $hasReference = $phpcsFile->findNext(\T_BITWISE_AND, ($asToken + 1), $closer); + if ($hasReference === false) { + return; + } + + $nestingLevel = 0; + if ($asToken !== ($opener + 1) && isset($tokens[$opener + 1]['nested_parenthesis'])) { + $nestingLevel = \count($tokens[$opener + 1]['nested_parenthesis']); + } + + if ($this->isVariable($phpcsFile, ($opener + 1), $asToken, $nestingLevel) === true) { + return; + } + + // Non-variable detected before the `as` keyword. + $phpcsFile->addError( + 'Referencing $value is only possible if the iterated array is a variable in PHP 5.4 or earlier.', + $hasReference, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php new file mode 100644 index 00000000..2398cf17 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php @@ -0,0 +1,84 @@ +supportsBelow('5.4') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { + return; + } + + $opener = $tokens[$stackPtr]['parenthesis_opener']; + $closer = $tokens[$stackPtr]['parenthesis_closer']; + + $asToken = $phpcsFile->findNext(\T_AS, ($opener + 1), $closer); + if ($asToken === false) { + return; + } + + $hasList = $phpcsFile->findNext(array(\T_LIST, \T_OPEN_SHORT_ARRAY), ($asToken + 1), $closer); + if ($hasList === false) { + return; + } + + $phpcsFile->addError( + 'Unpacking nested arrays with list() in a foreach is not supported in PHP 5.4 or earlier.', + $hasList, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php new file mode 100644 index 00000000..256f37ff --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php @@ -0,0 +1,78 @@ +supportsBelow('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$stackPtr]; + + // Bow out during live coding. + if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { + return; + } + + $hasBitwiseOr = $phpcsFile->findNext(\T_BITWISE_OR, $token['parenthesis_opener'], $token['parenthesis_closer']); + + if ($hasBitwiseOr === false) { + return; + } + + $phpcsFile->addError( + 'Catching multiple exceptions within one statement is not supported in PHP 7.0 or earlier.', + $hasBitwiseOr, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php new file mode 100644 index 00000000..13f5dfce --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php @@ -0,0 +1,346 @@ + + * + * + * + * + * + * @since 7.0.2 + * + * @var array + */ + public $functionWhitelist; + + /** + * A list of removed extensions with their alternative, if any. + * + * The array lists : version number with false (deprecated) and true (removed). + * If's sufficient to list the first version where the extension was deprecated/removed. + * + * @since 5.5 + * + * @var array(string => array(string => bool|string|null)) + */ + protected $removedExtensions = array( + 'activescript' => array( + '5.1' => true, + 'alternative' => 'pecl/activescript', + ), + 'cpdf' => array( + '5.1' => true, + 'alternative' => 'pecl/pdflib', + ), + 'dbase' => array( + '5.3' => true, + 'alternative' => null, + ), + 'dbx' => array( + '5.1' => true, + 'alternative' => 'pecl/dbx', + ), + 'dio' => array( + '5.1' => true, + 'alternative' => 'pecl/dio', + ), + 'ereg' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'pcre', + ), + 'fam' => array( + '5.1' => true, + 'alternative' => null, + ), + 'fbsql' => array( + '5.3' => true, + 'alternative' => null, + ), + 'fdf' => array( + '5.3' => true, + 'alternative' => 'pecl/fdf', + ), + 'filepro' => array( + '5.2' => true, + 'alternative' => null, + ), + 'hw_api' => array( + '5.2' => true, + 'alternative' => null, + ), + 'ibase' => array( + '7.4' => true, + 'alternative' => 'pecl/ibase', + ), + 'ingres' => array( + '5.1' => true, + 'alternative' => 'pecl/ingres', + ), + 'ircg' => array( + '5.1' => true, + 'alternative' => null, + ), + 'mcrypt' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'openssl (preferred) or pecl/mcrypt once available', + ), + 'mcve' => array( + '5.1' => true, + 'alternative' => 'pecl/mcve', + ), + 'ming' => array( + '5.3' => true, + 'alternative' => 'pecl/ming', + ), + 'mnogosearch' => array( + '5.1' => true, + 'alternative' => null, + ), + 'msql' => array( + '5.3' => true, + 'alternative' => null, + ), + 'mssql' => array( + '7.0' => true, + 'alternative' => null, + ), + 'mysql_' => array( + '5.5' => false, + '7.0' => true, + 'alternative' => 'mysqli', + ), + 'ncurses' => array( + '5.3' => true, + 'alternative' => 'pecl/ncurses', + ), + 'oracle' => array( + '5.1' => true, + 'alternative' => 'oci8 or pdo_oci', + ), + 'ovrimos' => array( + '5.1' => true, + 'alternative' => null, + ), + 'pfpro_' => array( + '5.1' => true, + 'alternative' => null, + ), + 'recode' => array( + '7.4' => true, + 'alternative' => 'iconv or mbstring', + ), + 'sqlite' => array( + '5.4' => true, + 'alternative' => null, + ), + // Has to be before `sybase` as otherwise it will never match. + 'sybase_ct' => array( + '7.0' => true, + 'alternative' => null, + ), + 'sybase' => array( + '5.3' => true, + 'alternative' => 'sybase_ct', + ), + 'w32api' => array( + '5.1' => true, + 'alternative' => 'pecl/ffi', + ), + 'wddx' => array( + '7.4' => true, + 'alternative' => 'pecl/wddx', + ), + 'yp' => array( + '5.1' => true, + 'alternative' => null, + ), + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of function names. + $this->removedExtensions = $this->arrayKeysToLowercase($this->removedExtensions); + + return array(\T_STRING); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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(); + + // Find the next non-empty token. + $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + if ($tokens[$openBracket]['code'] !== \T_OPEN_PARENTHESIS) { + // Not a function call. + return; + } + + if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { + // Not a function call. + return; + } + + // Find the previous non-empty token. + $search = Tokens::$emptyTokens; + $search[] = \T_BITWISE_AND; + $previous = $phpcsFile->findPrevious($search, ($stackPtr - 1), null, true); + if ($tokens[$previous]['code'] === \T_FUNCTION) { + // It's a function definition, not a function call. + return; + } + + if ($tokens[$previous]['code'] === \T_NEW) { + // We are creating an object, not calling a function. + return; + } + + if ($tokens[$previous]['code'] === \T_OBJECT_OPERATOR) { + // We are calling a method of an object. + return; + } + + $function = $tokens[$stackPtr]['content']; + $functionLc = strtolower($function); + + if ($this->isWhiteListed($functionLc) === true) { + // Function is whitelisted. + return; + } + + foreach ($this->removedExtensions as $extension => $versionList) { + if (strpos($functionLc, $extension) === 0) { + $itemInfo = array( + 'name' => $extension, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + break; + } + } + } + + + /** + * Is the current function being checked whitelisted ? + * + * Parsing the list late as it may be provided as a property, but also inline. + * + * @since 7.0.2 + * + * @param string $content Content of the current token. + * + * @return bool + */ + protected function isWhiteListed($content) + { + if (isset($this->functionWhitelist) === false) { + return false; + } + + if (\is_string($this->functionWhitelist) === true) { + if (strpos($this->functionWhitelist, ',') !== false) { + $this->functionWhitelist = explode(',', $this->functionWhitelist); + } else { + $this->functionWhitelist = (array) $this->functionWhitelist; + } + } + + if (\is_array($this->functionWhitelist) === true) { + $this->functionWhitelist = array_map('strtolower', $this->functionWhitelist); + return \in_array($content, $this->functionWhitelist, true); + } + + return false; + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->removedExtensions[$itemInfo['name']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return "Extension '%s' is "; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php new file mode 100644 index 00000000..0f52af71 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php @@ -0,0 +1,79 @@ +supportsAbove('5.4') === false) { + return; + } + + // Get all parameters from function signature. + $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); + if (empty($parameters) || \is_array($parameters) === false) { + return; + } + + foreach ($parameters as $param) { + if (isset($this->superglobals[$param['name']]) === true) { + $error = 'Parameter shadowing super global (%s) causes fatal error since PHP 5.4'; + $errorCode = $this->stringToErrorCode(substr($param['name'], 1)) . 'Found'; + $data = array($param['name']); + + $phpcsFile->addError($error, $param['token'], $errorCode, $data); + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php new file mode 100644 index 00000000..e94461ca --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php @@ -0,0 +1,88 @@ +supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$stackPtr]; + // Skip function without body. + if (isset($token['scope_opener']) === false) { + return; + } + + // Get all parameters from method signature. + $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); + if (empty($parameters) || \is_array($parameters) === false) { + return; + } + + $paramNames = array(); + foreach ($parameters as $param) { + $paramNames[] = $param['name']; + } + + if (\count($paramNames) !== \count(array_unique($paramNames))) { + $phpcsFile->addError( + 'Functions can not have multiple parameters with the same name since PHP 7.0', + $stackPtr, + 'Found' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php new file mode 100644 index 00000000..1625a4fa --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php @@ -0,0 +1,99 @@ + true, + 'T_INTERFACE' => true, + 'T_TRAIT' => true, + 'T_ANON_CLASS' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.2.0 + * + * @return array + */ + public function register() + { + return array(\T_FUNCTION); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('5.3') === false) { + return; + } + + $functionName = $phpcsFile->getDeclarationName($stackPtr); + if (strtolower($functionName) !== '__tostring') { + // Not the right function. + return; + } + + if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) === false) { + // Function, not method. + return; + } + + $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); + if (empty($params)) { + // Function declared without parameters. + return; + } + + $phpcsFile->addError( + 'The __toString() magic method can no longer accept arguments since PHP 5.3', + $stackPtr, + 'Declared' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php new file mode 100644 index 00000000..2e72c05e --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php @@ -0,0 +1,122 @@ +supportsAbove('7.1') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + // Verify this use statement is used with a closure - if so, it has to have parenthesis before it. + $previousNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); + if ($previousNonEmpty === false || $tokens[$previousNonEmpty]['code'] !== \T_CLOSE_PARENTHESIS + || isset($tokens[$previousNonEmpty]['parenthesis_opener']) === false + ) { + return; + } + + // ... and (a variable within) parenthesis after it. + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { + return; + } + + if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) { + // Live coding. + return; + } + + $closurePtr = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($tokens[$previousNonEmpty]['parenthesis_opener'] - 1), null, true); + if ($closurePtr === false || $tokens[$closurePtr]['code'] !== \T_CLOSURE) { + return; + } + + // Get the parameters declared by the closure. + $closureParams = PHPCSHelper::getMethodParameters($phpcsFile, $closurePtr); + + $errorMsg = 'Variables bound to a closure via the use construct cannot use the same name as superglobals, $this, or a declared parameter since PHP 7.1. Found: %s'; + + for ($i = ($nextNonEmpty + 1); $i < $tokens[$nextNonEmpty]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== \T_VARIABLE) { + continue; + } + + $variableName = $tokens[$i]['content']; + + if ($variableName === '$this') { + $phpcsFile->addError($errorMsg, $i, 'FoundThis', array($variableName)); + continue; + } + + if (isset($this->superglobals[$variableName]) === true) { + $phpcsFile->addError($errorMsg, $i, 'FoundSuperglobal', array($variableName)); + continue; + } + + // Check whether it is one of the parameters declared by the closure. + if (empty($closureParams) === false) { + foreach ($closureParams as $param) { + if ($param['name'] === $variableName) { + $phpcsFile->addError($errorMsg, $i, 'FoundShadowParam', array($variableName)); + continue 2; + } + } + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php new file mode 100644 index 00000000..b71bb320 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php @@ -0,0 +1,264 @@ +supportsBelow('5.2')) { + $phpcsFile->addError( + 'Closures / anonymous functions are not available in PHP 5.2 or earlier', + $stackPtr, + 'Found' + ); + } + + /* + * Closures can only be declared as static since PHP 5.4. + */ + $isStatic = $this->isClosureStatic($phpcsFile, $stackPtr); + if ($this->supportsBelow('5.3') && $isStatic === true) { + $phpcsFile->addError( + 'Closures / anonymous functions could not be declared as static in PHP 5.3 or earlier', + $stackPtr, + 'StaticFound' + ); + } + + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { + // Live coding or parse error. + return; + } + + $scopeStart = ($tokens[$stackPtr]['scope_opener'] + 1); + $scopeEnd = $tokens[$stackPtr]['scope_closer']; + $usesThis = $this->findThisUsageInClosure($phpcsFile, $scopeStart, $scopeEnd); + + if ($this->supportsBelow('5.3')) { + /* + * Closures declared within classes only have access to $this since PHP 5.4. + */ + if ($usesThis !== false) { + $thisFound = $usesThis; + do { + $phpcsFile->addError( + 'Closures / anonymous functions did not have access to $this in PHP 5.3 or earlier', + $thisFound, + 'ThisFound' + ); + + $thisFound = $this->findThisUsageInClosure($phpcsFile, ($thisFound + 1), $scopeEnd); + + } while ($thisFound !== false); + } + + /* + * Closures declared within classes only have access to self/parent/static since PHP 5.4. + */ + $usesClassRef = $this->findClassRefUsageInClosure($phpcsFile, $scopeStart, $scopeEnd); + + if ($usesClassRef !== false) { + do { + $phpcsFile->addError( + 'Closures / anonymous functions could not use "%s::" in PHP 5.3 or earlier', + $usesClassRef, + 'ClassRefFound', + array(strtolower($tokens[$usesClassRef]['content'])) + ); + + $usesClassRef = $this->findClassRefUsageInClosure($phpcsFile, ($usesClassRef + 1), $scopeEnd); + + } while ($usesClassRef !== false); + } + } + + /* + * Check for correct usage. + */ + if ($this->supportsAbove('5.4') && $usesThis !== false) { + + $thisFound = $usesThis; + + do { + /* + * Closures only have access to $this if not declared as static. + */ + if ($isStatic === true) { + $phpcsFile->addError( + 'Closures / anonymous functions declared as static do not have access to $this', + $thisFound, + 'ThisFoundInStatic' + ); + } + + /* + * Closures only have access to $this if used within a class context. + */ + elseif ($this->inClassScope($phpcsFile, $stackPtr, false) === false) { + $phpcsFile->addWarning( + 'Closures / anonymous functions only have access to $this if used within a class or when bound to an object using bindTo(). Please verify.', + $thisFound, + 'ThisFoundOutsideClass' + ); + } + + $thisFound = $this->findThisUsageInClosure($phpcsFile, ($thisFound + 1), $scopeEnd); + + } while ($thisFound !== false); + } + + // Prevent double reporting for nested closures. + return $scopeEnd; + } + + + /** + * Check whether the closure is declared as static. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return bool + */ + protected function isClosureStatic(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); + + return ($prevToken !== false && $tokens[$prevToken]['code'] === \T_STATIC); + } + + + /** + * Check if the code within a closure uses the $this variable. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $startToken The position within the closure to continue searching from. + * @param int $endToken The closure scope closer to stop searching at. + * + * @return int|false The stackPtr to the first $this usage if found or false if + * $this is not used. + */ + protected function findThisUsageInClosure(File $phpcsFile, $startToken, $endToken) + { + // Make sure the $startToken is valid. + if ($startToken >= $endToken) { + return false; + } + + return $phpcsFile->findNext( + \T_VARIABLE, + $startToken, + $endToken, + false, + '$this' + ); + } + + /** + * Check if the code within a closure uses "self/parent/static". + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $startToken The position within the closure to continue searching from. + * @param int $endToken The closure scope closer to stop searching at. + * + * @return int|false The stackPtr to the first classRef usage if found or false if + * they are not used. + */ + protected function findClassRefUsageInClosure(File $phpcsFile, $startToken, $endToken) + { + // Make sure the $startToken is valid. + if ($startToken >= $endToken) { + return false; + } + + $tokens = $phpcsFile->getTokens(); + $classRef = $phpcsFile->findNext(array(\T_SELF, \T_PARENT, \T_STATIC), $startToken, $endToken); + + if ($classRef === false || $tokens[$classRef]['code'] !== \T_STATIC) { + return $classRef; + } + + // T_STATIC, make sure it is used as a class reference. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($classRef + 1), $endToken, true); + if ($next === false || $tokens[$next]['code'] !== \T_DOUBLE_COLON) { + return false; + } + + return $classRef; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php new file mode 100644 index 00000000..05648961 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php @@ -0,0 +1,171 @@ + true, + 'T_TRAIT' => true, + 'T_ANON_CLASS' => true, + ); + + /** + * Tokens which should be ignored when they preface a function declaration + * when trying to find the docblock (if any). + * + * Array will be added to in the register() method. + * + * @since 9.3.0 + * + * @var array + */ + private $docblockIgnoreTokens = array( + \T_WHITESPACE => \T_WHITESPACE, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.2.0 + * + * @return array + */ + public function register() + { + // Enhance the array of tokens to ignore for finding the docblock. + $this->docblockIgnoreTokens += Tokens::$methodPrefixes; + if (isset(Tokens::$phpcsCommentTokens)) { + $this->docblockIgnoreTokens += Tokens::$phpcsCommentTokens; + } + + return array(\T_FUNCTION); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsBelow('7.3') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { + // Abstract function, interface function, live coding or parse error. + return; + } + + $functionName = $phpcsFile->getDeclarationName($stackPtr); + if (strtolower($functionName) !== '__tostring') { + // Not the right function. + return; + } + + if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) === false) { + // Function, not method. + return; + } + + /* + * Examine the content of the function. + */ + $error = 'Throwing exceptions from __toString() was not allowed prior to PHP 7.4'; + $throwPtr = $tokens[$stackPtr]['scope_opener']; + $errorThrown = false; + + do { + $throwPtr = $phpcsFile->findNext(\T_THROW, ($throwPtr + 1), $tokens[$stackPtr]['scope_closer']); + if ($throwPtr === false) { + break; + } + + $conditions = $tokens[$throwPtr]['conditions']; + $conditions = array_reverse($conditions, true); + $inTryCatch = false; + foreach ($conditions as $ptr => $type) { + if ($type === \T_TRY) { + $inTryCatch = true; + break; + } + + if ($ptr === $stackPtr) { + // Don't check the conditions outside the function scope. + break; + } + } + + if ($inTryCatch === false) { + $phpcsFile->addError($error, $throwPtr, 'Found'); + $errorThrown = true; + } + } while (true); + + if ($errorThrown === true) { + // We've already thrown an error for this method, no need to examine the docblock. + return; + } + + /* + * Check whether the function has a docblock and if so, whether it contains a @throws tag. + * + * {@internal This can be partially replaced by the findCommentAboveFunction() + * utility function in due time.} + */ + $commentEnd = $phpcsFile->findPrevious($this->docblockIgnoreTokens, ($stackPtr - 1), null, true); + if ($commentEnd === false || $tokens[$commentEnd]['code'] !== \T_DOC_COMMENT_CLOSE_TAG) { + return; + } + + $commentStart = $tokens[$commentEnd]['comment_opener']; + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + if ($tokens[$tag]['content'] !== '@throws') { + continue; + } + + // Found a throws tag. + $phpcsFile->addError($error, $stackPtr, 'ThrowsTagFoundInDocblock'); + break; + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php new file mode 100644 index 00000000..8dc0c416 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php @@ -0,0 +1,169 @@ +supportsBelow('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $tokenCode = $tokens[$stackPtr]['code']; + + if ($tokenCode === \T_FUNCTION || $tokenCode === \T_CLOSURE) { + $this->processFunctionDeclaration($phpcsFile, $stackPtr); + + // Deal with older PHPCS version which don't recognize return type hints + // as well as newer PHPCS versions (3.3.0+) where the tokenization has changed. + $returnTypeHint = $this->getReturnTypeHintToken($phpcsFile, $stackPtr); + if ($returnTypeHint !== false) { + $this->processReturnType($phpcsFile, $returnTypeHint); + } + } else { + $this->processReturnType($phpcsFile, $stackPtr); + } + } + + + /** + * Process this test for function tokens. + * + * @since 7.0.7 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return void + */ + protected function processFunctionDeclaration(File $phpcsFile, $stackPtr) + { + $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); + + if (empty($params) === false && \is_array($params)) { + foreach ($params as $param) { + if ($param['nullable_type'] === true) { + $phpcsFile->addError( + 'Nullable type declarations are not supported in PHP 7.0 or earlier. Found: %s', + $param['token'], + 'typeDeclarationFound', + array($param['type_hint']) + ); + } + } + } + } + + + /** + * Process this test for return type tokens. + * + * @since 7.0.7 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return void + */ + protected function processReturnType(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[($stackPtr - 1)]['code']) === false) { + return; + } + + $previous = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + // Deal with namespaced class names. + if ($tokens[$previous]['code'] === \T_NS_SEPARATOR) { + $validTokens = Tokens::$emptyTokens; + $validTokens[\T_STRING] = true; + $validTokens[\T_NS_SEPARATOR] = true; + + $stackPtr--; + + while (isset($validTokens[$tokens[($stackPtr - 1)]['code']]) === true) { + $stackPtr--; + } + + $previous = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + } + + // T_NULLABLE token was introduced in PHPCS 2.7.2. Before that it identified as T_INLINE_THEN. + if ((\defined('T_NULLABLE') === true && $tokens[$previous]['type'] === 'T_NULLABLE') + || (\defined('T_NULLABLE') === false && $tokens[$previous]['code'] === \T_INLINE_THEN) + ) { + $phpcsFile->addError( + 'Nullable return types are not supported in PHP 7.0 or earlier.', + $stackPtr, + 'returnTypeFound' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php new file mode 100644 index 00000000..6ad98b6a --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php @@ -0,0 +1,237 @@ + array(string => bool)) + */ + protected $newTypes = array( + 'array' => array( + '5.0' => false, + '5.1' => true, + ), + 'self' => array( + '5.1' => false, + '5.2' => true, + ), + 'parent' => array( + '5.1' => false, + '5.2' => true, + ), + 'callable' => array( + '5.3' => false, + '5.4' => true, + ), + 'int' => array( + '5.6' => false, + '7.0' => true, + ), + 'float' => array( + '5.6' => false, + '7.0' => true, + ), + 'bool' => array( + '5.6' => false, + '7.0' => true, + ), + 'string' => array( + '5.6' => false, + '7.0' => true, + ), + 'iterable' => array( + '7.0' => false, + '7.1' => true, + ), + 'object' => array( + '7.1' => false, + '7.2' => true, + ), + ); + + + /** + * Invalid types + * + * The array lists : the invalid type hint => what was probably intended/alternative. + * + * @since 7.0.3 + * + * @var array(string => string) + */ + protected $invalidTypes = array( + 'static' => 'self', + 'boolean' => 'bool', + 'integer' => 'int', + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.0 + * @since 7.1.3 Now also checks closures. + * + * @return array + */ + public function register() + { + return array( + \T_FUNCTION, + \T_CLOSURE, + ); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.0 + * @since 7.0.3 - Added check for non-scalar type declarations. + * - Added check for invalid type declarations. + * - Added check for usage of `self` type declaration outside + * class scope. + * @since 8.2.0 Added check for `parent` type declaration outside class scope. + * + * @param \PHP_CodeSniffer_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) + { + // Get all parameters from method signature. + $paramNames = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); + if (empty($paramNames)) { + return; + } + + $supportsPHP4 = $this->supportsBelow('4.4'); + + foreach ($paramNames as $param) { + if ($param['type_hint'] === '') { + continue; + } + + // Strip off potential nullable indication. + $typeHint = ltrim($param['type_hint'], '?'); + + if ($supportsPHP4 === true) { + $phpcsFile->addError( + 'Type declarations were not present in PHP 4.4 or earlier.', + $param['token'], + 'TypeHintFound' + ); + + } elseif (isset($this->newTypes[$typeHint])) { + $itemInfo = array( + 'name' => $typeHint, + ); + $this->handleFeature($phpcsFile, $param['token'], $itemInfo); + + // As of PHP 7.0, using `self` or `parent` outside class scope throws a fatal error. + // Only throw this error for PHP 5.2+ as before that the "type hint not supported" error + // will be thrown. + if (($typeHint === 'self' || $typeHint === 'parent') + && $this->inClassScope($phpcsFile, $stackPtr, false) === false + && $this->supportsAbove('5.2') !== false + ) { + $phpcsFile->addError( + "'%s' type cannot be used outside of class scope", + $param['token'], + ucfirst($typeHint) . 'OutsideClassScopeFound', + array($typeHint) + ); + } + } elseif (isset($this->invalidTypes[$typeHint])) { + $error = "'%s' is not a valid type declaration. Did you mean %s ?"; + $data = array( + $typeHint, + $this->invalidTypes[$typeHint], + ); + + $phpcsFile->addError($error, $param['token'], 'InvalidTypeHintFound', $data); + } + } + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newTypes[$itemInfo['name']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return "'%s' type declaration is not present in PHP version %s or earlier"; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php new file mode 100644 index 00000000..3e225616 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php @@ -0,0 +1,194 @@ + array(string => bool)) + */ + protected $newTypes = array( + 'int' => array( + '5.6' => false, + '7.0' => true, + ), + 'float' => array( + '5.6' => false, + '7.0' => true, + ), + 'bool' => array( + '5.6' => false, + '7.0' => true, + ), + 'string' => array( + '5.6' => false, + '7.0' => true, + ), + 'array' => array( + '5.6' => false, + '7.0' => true, + ), + 'callable' => array( + '5.6' => false, + '7.0' => true, + ), + 'parent' => array( + '5.6' => false, + '7.0' => true, + ), + 'self' => array( + '5.6' => false, + '7.0' => true, + ), + 'Class name' => array( + '5.6' => false, + '7.0' => true, + ), + + 'iterable' => array( + '7.0' => false, + '7.1' => true, + ), + 'void' => array( + '7.0' => false, + '7.1' => true, + ), + + 'object' => array( + '7.1' => false, + '7.2' => true, + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.0 + * @since 7.1.2 Now also checks based on the function and closure keywords. + * + * @return array + */ + public function register() + { + $tokens = array( + \T_FUNCTION, + \T_CLOSURE, + ); + + if (\defined('T_RETURN_TYPE')) { + $tokens[] = \T_RETURN_TYPE; + } + + return $tokens; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.0 + * + * @param \PHP_CodeSniffer_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(); + + // Deal with older PHPCS version which don't recognize return type hints + // as well as newer PHPCS versions (3.3.0+) where the tokenization has changed. + if ($tokens[$stackPtr]['code'] === \T_FUNCTION || $tokens[$stackPtr]['code'] === \T_CLOSURE) { + $returnTypeHint = $this->getReturnTypeHintToken($phpcsFile, $stackPtr); + if ($returnTypeHint !== false) { + $stackPtr = $returnTypeHint; + } + } + + if (isset($this->newTypes[$tokens[$stackPtr]['content']]) === true) { + $itemInfo = array( + 'name' => $tokens[$stackPtr]['content'], + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + // Handle class name based return types. + elseif ($tokens[$stackPtr]['code'] === \T_STRING + || (\defined('T_RETURN_TYPE') && $tokens[$stackPtr]['code'] === \T_RETURN_TYPE) + ) { + $itemInfo = array( + 'name' => 'Class name', + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newTypes[$itemInfo['name']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return '%s return type is not present in PHP version %s or earlier'; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php new file mode 100644 index 00000000..a86d56ef --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php @@ -0,0 +1,216 @@ + array( + 'static' => false, + ), + '__destruct' => array( + 'visibility' => 'public', + 'static' => false, + ), + '__clone' => array( + 'static' => false, + ), + '__get' => array( + 'visibility' => 'public', + 'static' => false, + ), + '__set' => array( + 'visibility' => 'public', + 'static' => false, + ), + '__isset' => array( + 'visibility' => 'public', + 'static' => false, + ), + '__unset' => array( + 'visibility' => 'public', + 'static' => false, + ), + '__call' => array( + 'visibility' => 'public', + 'static' => false, + ), + '__callstatic' => array( + 'visibility' => 'public', + 'static' => true, + ), + '__sleep' => array( + 'visibility' => 'public', + ), + '__tostring' => array( + 'visibility' => 'public', + ), + '__set_state' => array( + 'visibility' => 'public', + 'static' => true, + ), + '__debuginfo' => array( + 'visibility' => 'public', + 'static' => false, + ), + '__invoke' => array( + 'visibility' => 'public', + 'static' => false, + ), + '__serialize' => array( + 'visibility' => 'public', + 'static' => false, + ), + '__unserialize' => array( + 'visibility' => 'public', + 'static' => false, + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * @since 5.6 Now also checks traits. + * @since 7.1.4 Now also checks anonymous classes. + * + * @return array + */ + public function register() + { + $targets = array( + \T_CLASS, + \T_INTERFACE, + \T_TRAIT, + ); + + if (\defined('T_ANON_CLASS')) { + $targets[] = \T_ANON_CLASS; + } + + return $targets; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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) + { + // Should be removed, the requirement was previously also there, 5.3 just started throwing a warning about it. + if ($this->supportsAbove('5.3') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $classScopeCloser = $tokens[$stackPtr]['scope_closer']; + $functionPtr = $stackPtr; + + // Find all the functions in this class or interface. + while (($functionToken = $phpcsFile->findNext(\T_FUNCTION, $functionPtr, $classScopeCloser)) !== false) { + /* + * Get the scope closer for this function in order to know how + * to advance to the next function. + * If no body of function (e.g. for interfaces), there is + * no closing curly brace; advance the pointer differently. + */ + if (isset($tokens[$functionToken]['scope_closer'])) { + $scopeCloser = $tokens[$functionToken]['scope_closer']; + } else { + $scopeCloser = ($functionToken + 1); + } + + $methodName = $phpcsFile->getDeclarationName($functionToken); + $methodNameLc = strtolower($methodName); + if (isset($this->magicMethods[$methodNameLc]) === false) { + $functionPtr = $scopeCloser; + continue; + } + + $methodProperties = $phpcsFile->getMethodProperties($functionToken); + $errorCodeBase = $this->stringToErrorCode($methodNameLc); + + if (isset($this->magicMethods[$methodNameLc]['visibility']) && $this->magicMethods[$methodNameLc]['visibility'] !== $methodProperties['scope']) { + $error = 'Visibility for magic method %s must be %s. Found: %s'; + $errorCode = $errorCodeBase . 'MethodVisibility'; + $data = array( + $methodName, + $this->magicMethods[$methodNameLc]['visibility'], + $methodProperties['scope'], + ); + + $phpcsFile->addError($error, $functionToken, $errorCode, $data); + } + + if (isset($this->magicMethods[$methodNameLc]['static']) && $this->magicMethods[$methodNameLc]['static'] !== $methodProperties['is_static']) { + $error = 'Magic method %s cannot be defined as static.'; + $errorCode = $errorCodeBase . 'MethodStatic'; + $data = array($methodName); + + if ($this->magicMethods[$methodNameLc]['static'] === true) { + $error = 'Magic method %s must be defined as static.'; + $errorCode = $errorCodeBase . 'MethodNonStatic'; + } + + $phpcsFile->addError($error, $functionToken, $errorCode, $data); + } + + // Advance to next function. + $functionPtr = $scopeCloser; + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php new file mode 100644 index 00000000..4dc08f88 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php @@ -0,0 +1,231 @@ + array(string => bool|string)) + */ + protected $newMagicMethods = array( + '__construct' => array( + '4.4' => false, + '5.0' => true, + ), + '__destruct' => array( + '4.4' => false, + '5.0' => true, + ), + '__get' => array( + '4.4' => false, + '5.0' => true, + ), + + '__isset' => array( + '5.0' => false, + '5.1' => true, + ), + '__unset' => array( + '5.0' => false, + '5.1' => true, + ), + '__set_state' => array( + '5.0' => false, + '5.1' => true, + ), + + '__callstatic' => array( + '5.2' => false, + '5.3' => true, + ), + '__invoke' => array( + '5.2' => false, + '5.3' => true, + ), + + '__debuginfo' => array( + '5.5' => false, + '5.6' => true, + ), + + // Special case - only became properly magical in 5.2.0, + // before that it was only called for echo and print. + '__tostring' => array( + '5.1' => false, + '5.2' => true, + 'message' => 'The method %s() was not truly magical in PHP version %s and earlier. The associated magic functionality will only be called when directly combined with echo or print.', + ), + + '__serialize' => array( + '7.3' => false, + '7.4' => true, + ), + '__unserialize' => array( + '7.3' => false, + '7.4' => true, + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.4 + * + * @return array + */ + public function register() + { + return array(\T_FUNCTION); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.4 + * + * @param \PHP_CodeSniffer_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) + { + $functionName = $phpcsFile->getDeclarationName($stackPtr); + $functionNameLc = strtolower($functionName); + + if (isset($this->newMagicMethods[$functionNameLc]) === false) { + return; + } + + if ($this->inClassScope($phpcsFile, $stackPtr, false) === false) { + return; + } + + $itemInfo = array( + 'name' => $functionName, + 'nameLc' => $functionNameLc, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newMagicMethods[$itemInfo['nameLc']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array('message'); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + $errorInfo['error'] = false; // Warning, not error. + $errorInfo['message'] = ''; + + if (empty($itemArray['message']) === false) { + $errorInfo['message'] = $itemArray['message']; + } + + return $errorInfo; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The method %s() was not magical in PHP version %s and earlier. The associated magic functionality will not be invoked.'; + } + + + /** + * Allow for concrete child classes to filter the error message before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param string $error The error message which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return string + */ + protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) + { + if ($errorInfo['message'] !== '') { + $error = $errorInfo['message']; + } + + return $error; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php new file mode 100644 index 00000000..0ea5b0d6 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php @@ -0,0 +1,92 @@ + true, + 'T_ANON_CLASS' => true, + 'T_INTERFACE' => true, + 'T_TRAIT' => true, + 'T_NAMESPACE' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.1.0 + * + * @return array + */ + public function register() + { + return array(\T_FUNCTION); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.1.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.2') === false) { + return; + } + + $funcName = $phpcsFile->getDeclarationName($stackPtr); + + if (strtolower($funcName) !== '__autoload') { + return; + } + + if ($this->validDirectScope($phpcsFile, $stackPtr, $this->checkForScopes) !== false) { + return; + } + + if ($this->determineNamespace($phpcsFile, $stackPtr) !== '') { + return; + } + + $phpcsFile->addWarning('Use of __autoload() function is deprecated since PHP 7.2', $stackPtr, 'Found'); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php new file mode 100644 index 00000000..3c3feadc --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php @@ -0,0 +1,101 @@ +scopes[] = \T_ANON_CLASS; + } + + return array(\T_FUNCTION); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.3') === false) { + return; + } + + $funcName = $phpcsFile->getDeclarationName($stackPtr); + + if (strtolower($funcName) !== 'assert') { + return; + } + + if ($phpcsFile->hasCondition($stackPtr, $this->scopes) === true) { + return; + } + + if ($this->determineNamespace($phpcsFile, $stackPtr) === '') { + // Not a namespaced function declaration. This may be a parse error, but not our concern. + return; + } + + $phpcsFile->addWarning('Declaring a free-standing function called assert() is deprecated since PHP 7.3.', $stackPtr, 'Found'); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php new file mode 100644 index 00000000..a888f51d --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php @@ -0,0 +1,158 @@ +supportsAbove('7.0') === false) { + return; + } + + if ($this->determineNamespace($phpcsFile, $stackPtr) !== '') { + /* + * Namespaced methods with the same name as the class are treated as + * regular methods, so we can bow out if we're in a namespace. + * + * Note: the exception to this is PHP 5.3.0-5.3.2. This is currently + * not dealt with. + */ + return; + } + + $tokens = $phpcsFile->getTokens(); + + $class = $tokens[$stackPtr]; + + if (isset($class['scope_closer']) === false) { + return; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { + // Anonymous class in combination with PHPCS 2.3.x. + return; + } + + $scopeCloser = $class['scope_closer']; + $className = $tokens[$nextNonEmpty]['content']; + + if (empty($className) || \is_string($className) === false) { + return; + } + + $nextFunc = $stackPtr; + $classNameLc = strtolower($className); + $newConstructorFound = false; + $oldConstructorFound = false; + $oldConstructorPos = -1; + while (($nextFunc = $phpcsFile->findNext(array(\T_FUNCTION, \T_DOC_COMMENT_OPEN_TAG), ($nextFunc + 1), $scopeCloser)) !== false) { + // Skip over docblocks. + if ($tokens[$nextFunc]['code'] === \T_DOC_COMMENT_OPEN_TAG) { + $nextFunc = $tokens[$nextFunc]['comment_closer']; + continue; + } + + $functionScopeCloser = $nextFunc; + if (isset($tokens[$nextFunc]['scope_closer'])) { + // Normal (non-interface, non-abstract) method. + $functionScopeCloser = $tokens[$nextFunc]['scope_closer']; + } + + $funcName = $phpcsFile->getDeclarationName($nextFunc); + if (empty($funcName) || \is_string($funcName) === false) { + $nextFunc = $functionScopeCloser; + continue; + } + + $funcNameLc = strtolower($funcName); + + if ($funcNameLc === '__construct') { + $newConstructorFound = true; + } + + if ($funcNameLc === $classNameLc) { + $oldConstructorFound = true; + $oldConstructorPos = $nextFunc; + } + + // If both have been found, no need to continue looping through the functions. + if ($newConstructorFound === true && $oldConstructorFound === true) { + break; + } + + $nextFunc = $functionScopeCloser; + } + + if ($newConstructorFound === false && $oldConstructorFound === true) { + $phpcsFile->addWarning( + 'Use of deprecated PHP4 style class constructor is not supported since PHP 7.', + $oldConstructorPos, + 'Found' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php new file mode 100644 index 00000000..9ddb9e96 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php @@ -0,0 +1,205 @@ +magicMethods['debuginfo'] = true; + } + + + /** + * Processes the tokens within the scope. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being processed. + * @param int $stackPtr The position where this token was + * found. + * @param int $currScope The position of the current scope. + * + * @return void + */ + protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + /* + * Determine if this is a function which needs to be examined. + * The `processTokenWithinScope()` is called for each valid scope a method is in, + * so for nested classes, we need to make sure we only examine the token for + * the lowest level valid scope. + */ + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + $deepestScope = key($conditions); + if ($deepestScope !== $currScope) { + return; + } + + if ($this->isFunctionDeprecated($phpcsFile, $stackPtr) === true) { + /* + * Deprecated functions don't have to comply with the naming conventions, + * otherwise functions deprecated in favour of a function with a compliant + * name would still trigger an error. + */ + return; + } + + $methodName = $phpcsFile->getDeclarationName($stackPtr); + if ($methodName === null) { + // Ignore closures. + return; + } + + // Is this a magic method. i.e., is prefixed with "__" ? + if (preg_match('|^__[^_]|', $methodName) > 0) { + $magicPart = strtolower(substr($methodName, 2)); + if (isset($this->magicMethods[$magicPart]) === false + && isset($this->methodsDoubleUnderscore[$magicPart]) === false + ) { + $className = '[anonymous class]'; + $scopeNextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($currScope + 1), null, true); + if ($scopeNextNonEmpty !== false && $tokens[$scopeNextNonEmpty]['code'] === \T_STRING) { + $className = $tokens[$scopeNextNonEmpty]['content']; + } + + $phpcsFile->addWarning( + 'Method name "%s" is discouraged; PHP has reserved all method names with a double underscore prefix for future use.', + $stackPtr, + 'MethodDoubleUnderscore', + array($className . '::' . $methodName) + ); + } + } + } + + + /** + * Processes the tokens outside the scope. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being processed. + * @param int $stackPtr The position where this token was + * found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + if ($this->isFunctionDeprecated($phpcsFile, $stackPtr) === true) { + /* + * Deprecated functions don't have to comply with the naming conventions, + * otherwise functions deprecated in favour of a function with a compliant + * name would still trigger an error. + */ + return; + } + + $functionName = $phpcsFile->getDeclarationName($stackPtr); + if ($functionName === null) { + // Ignore closures. + return; + } + + // Is this a magic function. i.e., it is prefixed with "__". + if (preg_match('|^__[^_]|', $functionName) > 0) { + $magicPart = strtolower(substr($functionName, 2)); + if (isset($this->magicFunctions[$magicPart]) === false) { + $phpcsFile->addWarning( + 'Function name "%s" is discouraged; PHP has reserved all method names with a double underscore prefix for future use.', + $stackPtr, + 'FunctionDoubleUnderscore', + array($functionName) + ); + } + } + } + + + /** + * Check whether a function has been marked as deprecated via a @deprecated tag + * in the function docblock. + * + * @since 9.3.2 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of a T_FUNCTION + * token in the stack. + * + * @return bool + */ + private function isFunctionDeprecated(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $find = Tokens::$methodPrefixes; + $find[] = \T_WHITESPACE; + + $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); + if ($tokens[$commentEnd]['code'] !== \T_DOC_COMMENT_CLOSE_TAG) { + // Function doesn't have a doc comment or is using the wrong type of comment. + return false; + } + + $commentStart = $tokens[$commentEnd]['comment_opener']; + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + if ($tokens[$tag]['content'] === '@deprecated') { + return true; + } + } + + return false; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php new file mode 100644 index 00000000..4e904dea --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php @@ -0,0 +1,455 @@ + true, + 'func_get_args' => true, + 'debug_backtrace' => true, + 'debug_print_backtrace' => true, + ); + + /** + * Tokens to look out for to allow us to skip past nested scoped structures. + * + * @since 9.1.0 + * + * @var array + */ + private $skipPastNested = array( + 'T_CLASS' => true, + 'T_ANON_CLASS' => true, + 'T_INTERFACE' => true, + 'T_TRAIT' => true, + 'T_FUNCTION' => true, + 'T_CLOSURE' => true, + ); + + /** + * List of tokens which when they preceed a T_STRING *within a function* indicate + * this is not a call to a PHP native function. + * + * This list already takes into account that nested scoped structures are being + * skipped over, so doesn't check for those again. + * Similarly, as constants won't have parentheses, those don't need to be checked + * for either. + * + * @since 9.1.0 + * + * @var array + */ + private $noneFunctionCallIndicators = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + ); + + /** + * The tokens for variable incrementing/decrementing. + * + * @since 9.1.0 + * + * @var array + */ + private $plusPlusMinusMinus = array( + \T_DEC => true, + \T_INC => true, + ); + + /** + * Tokens to ignore when determining the start of a statement. + * + * @since 9.1.0 + * + * @var array + */ + private $ignoreForStartOfStatement = array( + \T_COMMA, + \T_DOUBLE_ARROW, + \T_OPEN_SQUARE_BRACKET, + \T_OPEN_PARENTHESIS, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.1.0 + * + * @return array + */ + public function register() + { + return array( + \T_FUNCTION, + \T_CLOSURE, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.1.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { + // Abstract function, interface function, live coding or parse error. + return; + } + + $scopeOpener = $tokens[$stackPtr]['scope_opener']; + $scopeCloser = $tokens[$stackPtr]['scope_closer']; + + // Does the function declaration have parameters ? + $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); + if (empty($params)) { + // No named arguments found, so no risk of them being changed. + return; + } + + $paramNames = array(); + foreach ($params as $param) { + $paramNames[] = $param['name']; + } + + for ($i = ($scopeOpener + 1); $i < $scopeCloser; $i++) { + if (isset($this->skipPastNested[$tokens[$i]['type']]) && isset($tokens[$i]['scope_closer'])) { + // Skip past nested structures. + $i = $tokens[$i]['scope_closer']; + continue; + } + + if ($tokens[$i]['code'] !== \T_STRING) { + continue; + } + + $foundFunctionName = strtolower($tokens[$i]['content']); + + if (isset($this->changedFunctions[$foundFunctionName]) === false) { + // Not one of the target functions. + continue; + } + + /* + * Ok, so is this really a function call to one of the PHP native functions ? + */ + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); + if ($next === false || $tokens[$next]['code'] !== \T_OPEN_PARENTHESIS) { + // Live coding, parse error or not a function call. + continue; + } + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), null, true); + if ($prev !== false) { + if (isset($this->noneFunctionCallIndicators[$tokens[$prev]['code']])) { + continue; + } + + // Check for namespaced functions, ie: \foo\bar() not \bar(). + if ($tokens[ $prev ]['code'] === \T_NS_SEPARATOR) { + $pprev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); + if ($pprev !== false && $tokens[ $pprev ]['code'] === \T_STRING) { + continue; + } + } + } + + /* + * Address some special cases. + */ + if ($foundFunctionName !== 'func_get_args') { + $paramOne = $this->getFunctionCallParameter($phpcsFile, $i, 1); + if ($paramOne !== false) { + switch ($foundFunctionName) { + /* + * Check if `debug_(print_)backtrace()` is called with the + * `DEBUG_BACKTRACE_IGNORE_ARGS` option. + */ + case 'debug_backtrace': + case 'debug_print_backtrace': + $hasIgnoreArgs = $phpcsFile->findNext( + \T_STRING, + $paramOne['start'], + ($paramOne['end'] + 1), + false, + 'DEBUG_BACKTRACE_IGNORE_ARGS' + ); + + if ($hasIgnoreArgs !== false) { + // Debug_backtrace() called with ignore args option. + continue 2; + } + break; + + /* + * Collect the necessary information to only throw a notice if the argument + * touched/changed is in line with the passed $arg_num. + * + * Also, we can ignore `func_get_arg()` if the argument offset passed is + * higher than the number of named parameters. + * + * {@internal Note: This does not take calculations into account! + * Should be exceptionally rare and can - if needs be - be addressed at a later stage.} + */ + case 'func_get_arg': + $number = $phpcsFile->findNext(\T_LNUMBER, $paramOne['start'], ($paramOne['end'] + 1)); + if ($number !== false) { + $argNumber = $tokens[$number]['content']; + + if (isset($paramNames[$argNumber]) === false) { + // Requesting a non-named additional parameter. Ignore. + continue 2; + } + } + break; + } + } + } else { + /* + * Check if the call to func_get_args() happens to be in an array_slice() or + * array_splice() with an $offset higher than the number of named parameters. + * In that case, we can ignore it. + * + * {@internal Note: This does not take offset calculations into account! + * Should be exceptionally rare and can - if needs be - be addressed at a later stage.} + */ + if ($prev !== false && $tokens[$prev]['code'] === \T_OPEN_PARENTHESIS) { + + $maybeFunctionCall = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); + if ($maybeFunctionCall !== false + && $tokens[$maybeFunctionCall]['code'] === \T_STRING + && ($tokens[$maybeFunctionCall]['content'] === 'array_slice' + || $tokens[$maybeFunctionCall]['content'] === 'array_splice') + ) { + $parentFuncParamTwo = $this->getFunctionCallParameter($phpcsFile, $maybeFunctionCall, 2); + $number = $phpcsFile->findNext( + \T_LNUMBER, + $parentFuncParamTwo['start'], + ($parentFuncParamTwo['end'] + 1) + ); + + if ($number !== false && isset($paramNames[$tokens[$number]['content']]) === false) { + // Requesting non-named additional parameters. Ignore. + continue ; + } + + // Slice starts at a named argument, but we know which params are being accessed. + $paramNamesSubset = \array_slice($paramNames, $tokens[$number]['content']); + } + } + } + + /* + * For debug_backtrace(), check if the result is being dereferenced and if so, + * whether the `args` index is used. + * I.e. whether `$index` in `debug_backtrace()[$stackFrame][$index]` is a string + * with the content `args`. + * + * Note: We already know that $next is the open parenthesis of the function call. + */ + if ($foundFunctionName === 'debug_backtrace' && isset($tokens[$next]['parenthesis_closer'])) { + $afterParenthesis = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($tokens[$next]['parenthesis_closer'] + 1), + null, + true + ); + + if ($tokens[$afterParenthesis]['code'] === \T_OPEN_SQUARE_BRACKET + && isset($tokens[$afterParenthesis]['bracket_closer']) + ) { + $afterStackFrame = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($tokens[$afterParenthesis]['bracket_closer'] + 1), + null, + true + ); + + if ($tokens[$afterStackFrame]['code'] === \T_OPEN_SQUARE_BRACKET + && isset($tokens[$afterStackFrame]['bracket_closer']) + ) { + $arrayIndex = $phpcsFile->findNext( + \T_CONSTANT_ENCAPSED_STRING, + ($afterStackFrame + 1), + $tokens[$afterStackFrame]['bracket_closer'] + ); + + if ($arrayIndex !== false && $this->stripQuotes($tokens[$arrayIndex]['content']) !== 'args') { + continue; + } + } + } + } + + /* + * Only check for variables before the start of the statement to + * prevent false positives on the return value of the function call + * being assigned to one of the parameters, i.e.: + * `$param = func_get_args();`. + */ + $startOfStatement = PHPCSHelper::findStartOfStatement($phpcsFile, $i, $this->ignoreForStartOfStatement); + + /* + * Ok, so we've found one of the target functions in the right scope. + * Now, let's check if any of the passed parameters were touched. + */ + $scanResult = 'clean'; + for ($j = ($scopeOpener + 1); $j < $startOfStatement; $j++) { + if (isset($this->skipPastNested[$tokens[$j]['type']]) + && isset($tokens[$j]['scope_closer']) + ) { + // Skip past nested structures. + $j = $tokens[$j]['scope_closer']; + continue; + } + + if ($tokens[$j]['code'] !== \T_VARIABLE) { + continue; + } + + if ($foundFunctionName === 'func_get_arg' && isset($argNumber)) { + if (isset($paramNames[$argNumber]) + && $tokens[$j]['content'] !== $paramNames[$argNumber] + ) { + // Different param than the one requested by func_get_arg(). + continue; + } + } elseif ($foundFunctionName === 'func_get_args' && isset($paramNamesSubset)) { + if (\in_array($tokens[$j]['content'], $paramNamesSubset, true) === false) { + // Different param than the ones requested by func_get_args(). + continue; + } + } elseif (\in_array($tokens[$j]['content'], $paramNames, true) === false) { + // Variable is not one of the function parameters. + continue; + } + + /* + * Ok, so we've found a variable which was passed as one of the parameters. + * Now, is this variable being changed, i.e. incremented, decremented or + * assigned something ? + */ + $scanResult = 'warning'; + if (isset($variableToken) === false) { + $variableToken = $j; + } + + $beforeVar = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($j - 1), null, true); + if ($beforeVar !== false && isset($this->plusPlusMinusMinus[$tokens[$beforeVar]['code']])) { + // Variable is being (pre-)incremented/decremented. + $scanResult = 'error'; + $variableToken = $j; + break; + } + + $afterVar = $phpcsFile->findNext(Tokens::$emptyTokens, ($j + 1), null, true); + if ($afterVar === false) { + // Shouldn't be possible, but just in case. + continue; + } + + if (isset($this->plusPlusMinusMinus[$tokens[$afterVar]['code']])) { + // Variable is being (post-)incremented/decremented. + $scanResult = 'error'; + $variableToken = $j; + break; + } + + if ($tokens[$afterVar]['code'] === \T_OPEN_SQUARE_BRACKET + && isset($tokens[$afterVar]['bracket_closer']) + ) { + // Skip past array access on the variable. + while (($afterVar = $phpcsFile->findNext(Tokens::$emptyTokens, ($tokens[$afterVar]['bracket_closer'] + 1), null, true)) !== false) { + if ($tokens[$afterVar]['code'] !== \T_OPEN_SQUARE_BRACKET + || isset($tokens[$afterVar]['bracket_closer']) === false + ) { + break; + } + } + } + + if ($afterVar !== false + && isset(Tokens::$assignmentTokens[$tokens[$afterVar]['code']]) + ) { + // Variable is being assigned something. + $scanResult = 'error'; + $variableToken = $j; + break; + } + } + + unset($argNumber, $paramNamesSubset); + + if ($scanResult === 'clean') { + continue; + } + + $error = 'Since PHP 7.0, functions inspecting arguments, like %1$s(), no longer report the original value as passed to a parameter, but will instead provide the current value. The parameter "%2$s" was %4$s on line %3$s.'; + $data = array( + $foundFunctionName, + $tokens[$variableToken]['content'], + $tokens[$variableToken]['line'], + ); + + if ($scanResult === 'error') { + $data[] = 'changed'; + $phpcsFile->addError($error, $i, 'Changed', $data); + + } elseif ($scanResult === 'warning') { + $data[] = 'used, and possibly changed (by reference),'; + $phpcsFile->addWarning($error, $i, 'NeedsInspection', $data); + } + + unset($variableToken); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php new file mode 100644 index 00000000..7c251119 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php @@ -0,0 +1,169 @@ + true, + 'func_get_arg' => true, + 'func_num_args' => true, + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.2.0 + * + * @return array + */ + public function register() + { + return array(\T_STRING); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_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(); + $functionLc = strtolower($tokens[$stackPtr]['content']); + if (isset($this->targetFunctions[$functionLc]) === false) { + return; + } + + // Next non-empty token should be the open parenthesis. + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { + return; + } + + $ignore = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_NEW => true, + ); + + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevNonEmpty]['code']]) === true) { + // Not a call to a PHP function. + return; + } elseif ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR && $tokens[$prevNonEmpty - 1]['code'] === \T_STRING) { + // Namespaced function. + return; + } + + $data = $tokens[$stackPtr]['content']; + + /* + * Check for use of the functions in the global scope. + * + * As PHPCS can not determine whether a file is included from within a function in + * another file, so always throw a warning/error. + */ + if ($phpcsFile->hasCondition($stackPtr, array(\T_FUNCTION, \T_CLOSURE)) === false) { + $isError = false; + $message = 'Use of %s() outside of a user-defined function is only supported if the file is included from within a user-defined function in another file prior to PHP 5.3.'; + + if ($this->supportsAbove('5.3') === true) { + $isError = true; + $message .= ' As of PHP 5.3, it is no longer supported at all.'; + } + + $this->addMessage($phpcsFile, $message, $stackPtr, $isError, 'OutsideFunctionScope', $data); + } + + /* + * Check for use of the functions as a parameter in a function call. + */ + if ($this->supportsBelow('5.2') === false) { + return; + } + + if (isset($tokens[$stackPtr]['nested_parenthesis']) === false) { + return; + } + + $throwError = false; + + $closer = end($tokens[$stackPtr]['nested_parenthesis']); + if (isset($tokens[$closer]['parenthesis_owner']) + && $tokens[$tokens[$closer]['parenthesis_owner']]['type'] === 'T_CLOSURE' + ) { + $throwError = true; + } else { + $opener = key($tokens[$stackPtr]['nested_parenthesis']); + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), null, true); + if ($tokens[$prevNonEmpty]['code'] !== \T_STRING) { + return; + } + + $prevPrevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true); + if ($tokens[$prevPrevNonEmpty]['code'] === \T_FUNCTION) { + return; + } + + $throwError = true; + } + + if ($throwError === false) { + return; + } + + $phpcsFile->addError( + '%s() could not be used in parameter lists prior to PHP 5.3.', + $stackPtr, + 'InParameterList', + $data + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php new file mode 100644 index 00000000..7b0d60bd --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php @@ -0,0 +1,1109 @@ + array( + 2 => array( + 'name' => 'flag', + '5.5' => false, + '5.6' => true, + ), + ), + 'array_slice' => array( + 1 => array( + 'name' => 'preserve_keys', + '5.0.1' => false, + '5.0.2' => true, + ), + ), + 'array_unique' => array( + 1 => array( + 'name' => 'sort_flags', + '5.2.8' => false, + '5.2.9' => true, + ), + ), + 'assert' => array( + 1 => array( + 'name' => 'description', + '5.4.7' => false, + '5.4.8' => true, + ), + ), + 'base64_decode' => array( + 1 => array( + 'name' => 'strict', + '5.1' => false, + '5.2' => true, + ), + ), + 'bcmod' => array( + 2 => array( + 'name' => 'scale', + '7.1' => false, + '7.2' => true, + ), + ), + 'class_implements' => array( + 1 => array( + 'name' => 'autoload', + '5.0' => false, + '5.1' => true, + ), + ), + 'class_parents' => array( + 1 => array( + 'name' => 'autoload', + '5.0' => false, + '5.1' => true, + ), + ), + 'clearstatcache' => array( + 0 => array( + 'name' => 'clear_realpath_cache', + '5.2' => false, + '5.3' => true, + ), + 1 => array( + 'name' => 'filename', + '5.2' => false, + '5.3' => true, + ), + ), + 'copy' => array( + 2 => array( + 'name' => 'context', + '5.2' => false, + '5.3' => true, + ), + ), + 'curl_multi_info_read' => array( + 1 => array( + 'name' => 'msgs_in_queue', + '5.1' => false, + '5.2' => true, + ), + ), + 'debug_backtrace' => array( + 0 => array( + 'name' => 'options', + '5.2.4' => false, + '5.2.5' => true, + ), + 1 => array( + 'name' => 'limit', + '5.3' => false, + '5.4' => true, + ), + ), + 'debug_print_backtrace' => array( + 0 => array( + 'name' => 'options', + '5.3.5' => false, + '5.3.6' => true, + ), + 1 => array( + 'name' => 'limit', + '5.3' => false, + '5.4' => true, + ), + ), + 'dirname' => array( + 1 => array( + 'name' => 'levels', + '5.6' => false, + '7.0' => true, + ), + ), + 'dns_get_record' => array( + 4 => array( + 'name' => 'raw', + '5.3' => false, + '5.4' => true, + ), + ), + 'fgetcsv' => array( + 4 => array( + 'name' => 'escape', + '5.2' => false, + '5.3' => true, + ), + ), + 'fputcsv' => array( + 4 => array( + 'name' => 'escape_char', + '5.5.3' => false, + '5.5.4' => true, + ), + ), + 'file_get_contents' => array( + 3 => array( + 'name' => 'offset', + '5.0' => false, + '5.1' => true, + ), + 4 => array( + 'name' => 'maxlen', + '5.0' => false, + '5.1' => true, + ), + ), + 'filter_input_array' => array( + 2 => array( + 'name' => 'add_empty', + '5.3' => false, + '5.4' => true, + ), + ), + 'filter_var_array' => array( + 2 => array( + 'name' => 'add_empty', + '5.3' => false, + '5.4' => true, + ), + ), + 'getenv' => array( + 1 => array( + 'name' => 'local_only', + '5.5.37' => false, + '5.5.38' => true, // Also introduced in PHP 5.6.24 and 7.0.9. + ), + ), + 'getopt' => array( + 2 => array( + 'name' => 'optind', + '7.0' => false, + '7.1' => true, + ), + ), + 'gettimeofday' => array( + 0 => array( + 'name' => 'return_float', + '5.0' => false, + '5.1' => true, + ), + ), + 'get_defined_functions' => array( + 0 => array( + 'name' => 'exclude_disabled', + '7.0.14' => false, + '7.0.15' => true, + ), + ), + 'get_headers' => array( + 2 => array( + 'name' => 'context', + '7.0' => false, + '7.1' => true, + ), + ), + 'get_html_translation_table' => array( + 2 => array( + 'name' => 'encoding', + '5.3.3' => false, + '5.3.4' => true, + ), + ), + 'get_loaded_extensions' => array( + 0 => array( + 'name' => 'zend_extensions', + '5.2.3' => false, + '5.2.4' => true, + ), + ), + 'gzcompress' => array( + 2 => array( + 'name' => 'encoding', + '5.3' => false, + '5.4' => true, + ), + ), + 'gzdeflate' => array( + 2 => array( + 'name' => 'encoding', + '5.3' => false, + '5.4' => true, + ), + ), + 'htmlentities' => array( + 3 => array( + 'name' => 'double_encode', + '5.2.2' => false, + '5.2.3' => true, + ), + ), + 'htmlspecialchars' => array( + 3 => array( + 'name' => 'double_encode', + '5.2.2' => false, + '5.2.3' => true, + ), + ), + 'http_build_query' => array( + 2 => array( + 'name' => 'arg_separator', + '5.1.1' => false, + '5.1.2' => true, + ), + 3 => array( + 'name' => 'enc_type', + '5.3' => false, + '5.4' => true, + ), + ), + 'idn_to_ascii' => array( + 2 => array( + 'name' => 'variant', + '5.3' => false, + '5.4' => true, + ), + 3 => array( + 'name' => 'idna_info', + '5.3' => false, + '5.4' => true, + ), + ), + 'idn_to_utf8' => array( + 2 => array( + 'name' => 'variant', + '5.3' => false, + '5.4' => true, + ), + 3 => array( + 'name' => 'idna_info', + '5.3' => false, + '5.4' => true, + ), + ), + 'imagecolorset' => array( + 5 => array( + 'name' => 'alpha', + '5.3' => false, + '5.4' => true, + ), + ), + 'imagepng' => array( + 2 => array( + 'name' => 'quality', + '5.1.1' => false, + '5.1.2' => true, + ), + 3 => array( + 'name' => 'filters', + '5.1.2' => false, + '5.1.3' => true, + ), + ), + 'imagerotate' => array( + 3 => array( + 'name' => 'ignore_transparent', + '5.0' => false, + '5.1' => true, + ), + ), + 'imap_open' => array( + 4 => array( + 'name' => 'n_retries', + '5.1' => false, + '5.2' => true, + ), + 5 => array( + 'name' => 'params', + '5.3.1' => false, + '5.3.2' => true, + ), + ), + 'imap_reopen' => array( + 3 => array( + 'name' => 'n_retries', + '5.1' => false, + '5.2' => true, + ), + ), + 'ini_get_all' => array( + 1 => array( + 'name' => 'details', + '5.2' => false, + '5.3' => true, + ), + ), + 'is_a' => array( + 2 => array( + 'name' => 'allow_string', + '5.3.8' => false, + '5.3.9' => true, + ), + ), + 'is_subclass_of' => array( + 2 => array( + 'name' => 'allow_string', + '5.3.8' => false, + '5.3.9' => true, + ), + ), + 'iterator_to_array' => array( + 1 => array( + 'name' => 'use_keys', + '5.2.0' => false, + '5.2.1' => true, + ), + ), + 'json_decode' => array( + 2 => array( + 'name' => 'depth', + '5.2' => false, + '5.3' => true, + ), + 3 => array( + 'name' => 'options', + '5.3' => false, + '5.4' => true, + ), + ), + 'json_encode' => array( + 1 => array( + 'name' => 'options', + '5.2' => false, + '5.3' => true, + ), + 2 => array( + 'name' => 'depth', + '5.4' => false, + '5.5' => true, + ), + ), + 'ldap_add' => array( + 3 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_compare' => array( + 4 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_delete' => array( + 2 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_list' => array( + 8 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_mod_add' => array( + 3 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_mod_del' => array( + 3 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_mod_replace' => array( + 3 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_modify_batch' => array( + 3 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_parse_result' => array( + 6 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_read' => array( + 8 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_rename' => array( + 5 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'ldap_search' => array( + 8 => array( + 'name' => 'serverctrls', + '7.2' => false, + '7.3' => true, + ), + ), + 'memory_get_peak_usage' => array( + 0 => array( + 'name' => 'real_usage', + '5.1' => false, + '5.2' => true, + ), + ), + 'memory_get_usage' => array( + 0 => array( + 'name' => 'real_usage', + '5.1' => false, + '5.2' => true, + ), + ), + 'mb_encode_numericentity' => array( + 3 => array( + 'name' => 'is_hex', + '5.3' => false, + '5.4' => true, + ), + ), + 'mb_strrpos' => array( + /* + * Note: the actual position is 2, but the original 3rd + * parameter 'encoding' was moved to the 4th position. + * So the only way to detect if offset is used is when + * both offset and encoding are set. + */ + 3 => array( + 'name' => 'offset', + '5.1' => false, + '5.2' => true, + ), + ), + 'mssql_connect' => array( + 3 => array( + 'name' => 'new_link', + '5.0' => false, + '5.1' => true, + ), + ), + 'mysqli_commit' => array( + 1 => array( + 'name' => 'flags', + '5.4' => false, + '5.5' => true, + ), + 2 => array( + 'name' => 'name', + '5.4' => false, + '5.5' => true, + ), + ), + 'mysqli_rollback' => array( + 1 => array( + 'name' => 'flags', + '5.4' => false, + '5.5' => true, + ), + 2 => array( + 'name' => 'name', + '5.4' => false, + '5.5' => true, + ), + ), + 'nl2br' => array( + 1 => array( + 'name' => 'is_xhtml', + '5.2' => false, + '5.3' => true, + ), + ), + 'openssl_decrypt' => array( + 4 => array( + 'name' => 'iv', + '5.3.2' => false, + '5.3.3' => true, + ), + 5 => array( + 'name' => 'tag', + '7.0' => false, + '7.1' => true, + ), + 6 => array( + 'name' => 'aad', + '7.0' => false, + '7.1' => true, + ), + ), + 'openssl_encrypt' => array( + 4 => array( + 'name' => 'iv', + '5.3.2' => false, + '5.3.3' => true, + ), + 5 => array( + 'name' => 'tag', + '7.0' => false, + '7.1' => true, + ), + 6 => array( + 'name' => 'aad', + '7.0' => false, + '7.1' => true, + ), + 7 => array( + 'name' => 'tag_length', + '7.0' => false, + '7.1' => true, + ), + ), + 'openssl_open' => array( + 4 => array( + 'name' => 'method', + '5.2' => false, + '5.3' => true, + ), + 5 => array( + 'name' => 'iv', + '5.6' => false, + '7.0' => true, + ), + ), + 'openssl_pkcs7_verify' => array( + 5 => array( + 'name' => 'content', + '5.0' => false, + '5.1' => true, + ), + 6 => array( + 'name' => 'p7bfilename', + '7.1' => false, + '7.2' => true, + ), + ), + 'openssl_seal' => array( + 4 => array( + 'name' => 'method', + '5.2' => false, + '5.3' => true, + ), + 5 => array( + 'name' => 'iv', + '5.6' => false, + '7.0' => true, + ), + ), + 'openssl_verify' => array( + 3 => array( + 'name' => 'signature_alg', + '5.1' => false, + '5.2' => true, + ), + ), + 'parse_ini_file' => array( + 2 => array( + 'name' => 'scanner_mode', + '5.2' => false, + '5.3' => true, + ), + ), + 'parse_url' => array( + 1 => array( + 'name' => 'component', + '5.1.1' => false, + '5.1.2' => true, + ), + ), + 'pg_fetch_all' => array( + 1 => array( + 'name' => 'result_type', + '7.0' => false, + '7.1' => true, + ), + ), + 'pg_last_notice' => array( + 1 => array( + 'name' => 'option', + '7.0' => false, + '7.1' => true, + ), + ), + 'pg_lo_create' => array( + 1 => array( + 'name' => 'object_id', + '5.2' => false, + '5.3' => true, + ), + ), + 'pg_lo_import' => array( + 2 => array( + 'name' => 'object_id', + '5.2' => false, + '5.3' => true, + ), + ), + 'pg_select' => array( + 4 => array( + 'name' => 'result_type', + '7.0' => false, + '7.1' => true, + ), + ), + 'php_uname' => array( + 0 => array( + 'name' => 'mode', + '4.2' => false, + '4.3' => true, + ), + ), + 'preg_replace' => array( + 4 => array( + 'name' => 'count', + '5.0' => false, + '5.1' => true, + ), + ), + 'preg_replace_callback' => array( + 4 => array( + 'name' => 'count', + '5.0' => false, + '5.1' => true, + ), + 5 => array( + 'name' => 'flags', + '7.3' => false, + '7.4' => true, + ), + ), + 'preg_replace_callback_array' => array( + 4 => array( + 'name' => 'flags', + '7.3' => false, + '7.4' => true, + ), + ), + 'round' => array( + 2 => array( + 'name' => 'mode', + '5.2' => false, + '5.3' => true, + ), + ), + 'sem_acquire' => array( + 1 => array( + 'name' => 'nowait', + '5.6' => false, + '5.6.1' => true, + ), + ), + 'session_regenerate_id' => array( + 0 => array( + 'name' => 'delete_old_session', + '5.0' => false, + '5.1' => true, + ), + ), + 'session_set_cookie_params' => array( + 4 => array( + 'name' => 'httponly', + '5.1' => false, + '5.2' => true, + ), + ), + 'session_set_save_handler' => array( + 6 => array( + 'name' => 'create_sid', + '5.5.0' => false, + '5.5.1' => true, + ), + 7 => array( + 'name' => 'validate_sid', + '5.6' => false, + '7.0' => true, + ), + 8 => array( + 'name' => 'update_timestamp', + '5.6' => false, + '7.0' => true, + ), + ), + 'session_start' => array( + 0 => array( + 'name' => 'options', + '5.6' => false, + '7.0' => true, + ), + ), + 'setcookie' => array( + 6 => array( + 'name' => 'httponly', + '5.1' => false, + '5.2' => true, + ), + ), + 'setrawcookie' => array( + 6 => array( + 'name' => 'httponly', + '5.1' => false, + '5.2' => true, + ), + ), + 'simplexml_load_file' => array( + 4 => array( + 'name' => 'is_prefix', + '5.1' => false, + '5.2' => true, + ), + ), + 'simplexml_load_string' => array( + 4 => array( + 'name' => 'is_prefix', + '5.1' => false, + '5.2' => true, + ), + ), + 'spl_autoload_register' => array( + 2 => array( + 'name' => 'prepend', + '5.2' => false, + '5.3' => true, + ), + ), + 'stream_context_create' => array( + 1 => array( + 'name' => 'params', + '5.2' => false, + '5.3' => true, + ), + ), + 'stream_copy_to_stream' => array( + 3 => array( + 'name' => 'offset', + '5.0' => false, + '5.1' => true, + ), + ), + 'stream_get_contents' => array( + 2 => array( + 'name' => 'offset', + '5.0' => false, + '5.1' => true, + ), + ), + 'stream_wrapper_register' => array( + 2 => array( + 'name' => 'flags', + '5.2.3' => false, + '5.2.4' => true, + ), + ), + 'stristr' => array( + 2 => array( + 'name' => 'before_needle', + '5.2' => false, + '5.3' => true, + ), + ), + 'strstr' => array( + 2 => array( + 'name' => 'before_needle', + '5.2' => false, + '5.3' => true, + ), + ), + 'str_word_count' => array( + 2 => array( + 'name' => 'charlist', + '5.0' => false, + '5.1' => true, + ), + ), + 'substr_count' => array( + 2 => array( + 'name' => 'offset', + '5.0' => false, + '5.1' => true, + ), + 3 => array( + 'name' => 'length', + '5.0' => false, + '5.1' => true, + ), + ), + 'sybase_connect' => array( + 5 => array( + 'name' => 'new', + '5.2' => false, + '5.3' => true, + ), + ), + 'timezone_transitions_get' => array( + 1 => array( + 'name' => 'timestamp_begin', + '5.2' => false, + '5.3' => true, + ), + 2 => array( + 'name' => 'timestamp_end', + '5.2' => false, + '5.3' => true, + ), + ), + 'timezone_identifiers_list' => array( + 0 => array( + 'name' => 'what', + '5.2' => false, + '5.3' => true, + ), + 1 => array( + 'name' => 'country', + '5.2' => false, + '5.3' => true, + ), + ), + 'token_get_all' => array( + 1 => array( + 'name' => 'flags', + '5.6' => false, + '7.0' => true, + ), + ), + 'ucwords' => array( + 1 => array( + 'name' => 'delimiters', + '5.4.31' => false, + '5.5.15' => false, + '5.4.32' => true, + '5.5.16' => true, + ), + ), + 'unpack' => array( + 2 => array( + 'name' => 'offset', + '7.0' => false, + '7.1' => true, + ), + ), + 'unserialize' => array( + 1 => array( + 'name' => 'options', + '5.6' => false, + '7.0' => true, + ), + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.0 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of function names. + $this->newFunctionParameters = $this->arrayKeysToLowercase($this->newFunctionParameters); + + return array(\T_STRING); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.0 + * + * @param \PHP_CodeSniffer_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(); + + $ignore = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_CONST => true, + ); + + $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function. + return; + } + + $function = $tokens[$stackPtr]['content']; + $functionLc = strtolower($function); + + if (isset($this->newFunctionParameters[$functionLc]) === false) { + return; + } + + $parameterCount = $this->getFunctionCallParameterCount($phpcsFile, $stackPtr); + if ($parameterCount === 0) { + return; + } + + // If the parameter count returned > 0, we know there will be valid open parenthesis. + $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); + $parameterOffsetFound = $parameterCount - 1; + + foreach ($this->newFunctionParameters[$functionLc] as $offset => $parameterDetails) { + if ($offset <= $parameterOffsetFound) { + $itemInfo = array( + 'name' => $function, + 'nameLc' => $functionLc, + 'offset' => $offset, + ); + $this->handleFeature($phpcsFile, $openParenthesis, $itemInfo); + } + } + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newFunctionParameters[$itemInfo['nameLc']][$itemInfo['offset']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array('name'); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + $errorInfo['paramName'] = $itemArray['name']; + + return $errorInfo; + } + + + /** + * Get the item name to be used for the creation of the error code. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * @param array $errorInfo Detail information about an item. + * + * @return string + */ + protected function getItemName(array $itemInfo, array $errorInfo) + { + return $itemInfo['name'] . '_' . $errorInfo['paramName']; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The function %s() does not have a parameter "%s" in PHP version %s or earlier'; + } + + + /** + * Allow for concrete child classes to filter the error data before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param array $data The error data array which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return array + */ + protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) + { + array_shift($data); + array_unshift($data, $itemInfo['name'], $errorInfo['paramName']); + return $data; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php new file mode 100644 index 00000000..c1a0ec4e --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php @@ -0,0 +1,2008 @@ + array(string => bool)) + */ + protected $newFunctions = array( + 'iterator_count' => array( + '5.0' => false, + '5.1' => true, + ), + 'iterator_to_array' => array( + '5.0' => false, + '5.1' => true, + ), + 'spl_autoload_call' => array( + '5.0' => false, + '5.1' => true, + ), + 'spl_autoload_extensions' => array( + '5.0' => false, + '5.1' => true, + ), + 'spl_autoload_functions' => array( + '5.0' => false, + '5.1' => true, + ), + 'spl_autoload_register' => array( + '5.0' => false, + '5.1' => true, + ), + 'spl_autoload_unregister' => array( + '5.0' => false, + '5.1' => true, + ), + 'spl_autoload' => array( + '5.0' => false, + '5.1' => true, + ), + 'hash_hmac' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'array_fill_keys' => array( + '5.1' => false, + '5.2' => true, + ), + 'error_get_last' => array( + '5.1' => false, + '5.2' => true, + ), + 'image_type_to_extension' => array( + '5.1' => false, + '5.2' => true, + ), + 'memory_get_peak_usage' => array( + '5.1' => false, + '5.2' => true, + ), + 'sys_get_temp_dir' => array( + '5.1' => false, + '5.2' => true, + ), + 'timezone_abbreviations_list' => array( + '5.1' => false, + '5.2' => true, + ), + 'timezone_identifiers_list' => array( + '5.1' => false, + '5.2' => true, + ), + 'timezone_name_from_abbr' => array( + '5.1' => false, + '5.2' => true, + ), + 'stream_socket_shutdown' => array( + '5.1' => false, + '5.2' => true, + ), + 'imagegrabscreen' => array( + '5.1' => false, + '5.2' => true, + ), + 'imagegrabwindow' => array( + '5.1' => false, + '5.2' => true, + ), + 'libxml_disable_entity_loader' => array( + '5.1' => false, + '5.2' => true, + ), + 'mb_stripos' => array( + '5.1' => false, + '5.2' => true, + ), + 'mb_stristr' => array( + '5.1' => false, + '5.2' => true, + ), + 'mb_strrchr' => array( + '5.1' => false, + '5.2' => true, + ), + 'mb_strrichr' => array( + '5.1' => false, + '5.2' => true, + ), + 'mb_strripos' => array( + '5.1' => false, + '5.2' => true, + ), + 'ming_setSWFCompression' => array( + '5.1' => false, + '5.2' => true, + ), + 'openssl_csr_get_public_key' => array( + '5.1' => false, + '5.2' => true, + ), + 'openssl_csr_get_subject' => array( + '5.1' => false, + '5.2' => true, + ), + 'openssl_pkey_get_details' => array( + '5.1' => false, + '5.2' => true, + ), + 'spl_object_hash' => array( + '5.1' => false, + '5.2' => true, + ), + 'iterator_apply' => array( + '5.1' => false, + '5.2' => true, + ), + 'preg_last_error' => array( + '5.1' => false, + '5.2' => true, + ), + 'pg_field_table' => array( + '5.1' => false, + '5.2' => true, + ), + 'posix_initgroups' => array( + '5.1' => false, + '5.2' => true, + ), + 'gmp_nextprime' => array( + '5.1' => false, + '5.2' => true, + ), + 'xmlwriter_full_end_element' => array( + '5.1' => false, + '5.2' => true, + ), + 'xmlwriter_write_raw' => array( + '5.1' => false, + '5.2' => true, + ), + 'xmlwriter_start_dtd_entity' => array( + '5.1' => false, + '5.2' => true, + ), + 'xmlwriter_end_dtd_entity' => array( + '5.1' => false, + '5.2' => true, + ), + 'xmlwriter_write_dtd_entity' => array( + '5.1' => false, + '5.2' => true, + ), + 'filter_has_var' => array( + '5.1' => false, + '5.2' => true, + ), + 'filter_id' => array( + '5.1' => false, + '5.2' => true, + ), + 'filter_input_array' => array( + '5.1' => false, + '5.2' => true, + ), + 'filter_input' => array( + '5.1' => false, + '5.2' => true, + ), + 'filter_list' => array( + '5.1' => false, + '5.2' => true, + ), + 'filter_var_array' => array( + '5.1' => false, + '5.2' => true, + ), + 'filter_var' => array( + '5.1' => false, + '5.2' => true, + ), + 'json_decode' => array( + '5.1' => false, + '5.2' => true, + ), + 'json_encode' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_close' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_entry_close' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_entry_compressedsize' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_entry_compressionmethod' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_entry_filesize' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_entry_name' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_entry_open' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_entry_read' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_open' => array( + '5.1' => false, + '5.2' => true, + ), + 'zip_read' => array( + '5.1' => false, + '5.2' => true, + ), + + 'array_replace' => array( + '5.2' => false, + '5.3' => true, + ), + 'array_replace_recursive' => array( + '5.2' => false, + '5.3' => true, + ), + 'class_alias' => array( + '5.2' => false, + '5.3' => true, + ), + 'forward_static_call' => array( + '5.2' => false, + '5.3' => true, + ), + 'forward_static_call_array' => array( + '5.2' => false, + '5.3' => true, + ), + 'gc_collect_cycles' => array( + '5.2' => false, + '5.3' => true, + ), + 'gc_disable' => array( + '5.2' => false, + '5.3' => true, + ), + 'gc_enable' => array( + '5.2' => false, + '5.3' => true, + ), + 'gc_enabled' => array( + '5.2' => false, + '5.3' => true, + ), + 'get_called_class' => array( + '5.2' => false, + '5.3' => true, + ), + 'gethostname' => array( + '5.2' => false, + '5.3' => true, + ), + 'header_remove' => array( + '5.2' => false, + '5.3' => true, + ), + 'lcfirst' => array( + '5.2' => false, + '5.3' => true, + ), + 'parse_ini_string' => array( + '5.2' => false, + '5.3' => true, + ), + 'quoted_printable_encode' => array( + '5.2' => false, + '5.3' => true, + ), + 'str_getcsv' => array( + '5.2' => false, + '5.3' => true, + ), + 'stream_context_set_default' => array( + '5.2' => false, + '5.3' => true, + ), + 'stream_supports_lock' => array( + '5.2' => false, + '5.3' => true, + ), + 'stream_context_get_params' => array( + '5.2' => false, + '5.3' => true, + ), + 'date_add' => array( + '5.2' => false, + '5.3' => true, + ), + 'date_create_from_format' => array( + '5.2' => false, + '5.3' => true, + ), + 'date_diff' => array( + '5.2' => false, + '5.3' => true, + ), + 'date_get_last_errors' => array( + '5.2' => false, + '5.3' => true, + ), + 'date_parse_from_format' => array( + '5.2' => false, + '5.3' => true, + ), + 'date_sub' => array( + '5.2' => false, + '5.3' => true, + ), + 'timezone_version_get' => array( + '5.2' => false, + '5.3' => true, + ), + 'gmp_testbit' => array( + '5.2' => false, + '5.3' => true, + ), + 'hash_copy' => array( + '5.2' => false, + '5.3' => true, + ), + 'imap_gc' => array( + '5.2' => false, + '5.3' => true, + ), + 'imap_utf8_to_mutf7' => array( + '5.2' => false, + '5.3' => true, + ), + 'imap_mutf7_to_utf8' => array( + '5.2' => false, + '5.3' => true, + ), + 'json_last_error' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqli_get_cache_stats' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqli_fetch_all' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqli_get_connection_status' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqli_poll' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqli_read_async_query' => array( + '5.2' => false, + '5.3' => true, + ), + 'openssl_random_pseudo_bytes' => array( + '5.2' => false, + '5.3' => true, + ), + 'pcntl_signal_dispatch' => array( + '5.2' => false, + '5.3' => true, + ), + 'pcntl_sigprocmask' => array( + '5.2' => false, + '5.3' => true, + ), + 'pcntl_sigtimedwait' => array( + '5.2' => false, + '5.3' => true, + ), + 'pcntl_sigwaitinfo' => array( + '5.2' => false, + '5.3' => true, + ), + 'preg_filter' => array( + '5.2' => false, + '5.3' => true, + ), + 'msg_queue_exists' => array( + '5.2' => false, + '5.3' => true, + ), + 'shm_has_vars' => array( + '5.2' => false, + '5.3' => true, + ), + 'acosh' => array( + '5.2' => false, + '5.3' => true, + ), + 'asinh' => array( + '5.2' => false, + '5.3' => true, + ), + 'atanh' => array( + '5.2' => false, + '5.3' => true, + ), + 'expm1' => array( + '5.2' => false, + '5.3' => true, + ), + 'log1p' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_describe' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_dict_exists' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_free_dict' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_free' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_get_error' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_init' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_list_dicts' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_request_dict' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_request_pwl_dict' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_broker_set_ordering' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_dict_add_to_personal' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_dict_add_to_session' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_dict_check' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_dict_describe' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_dict_get_error' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_dict_is_in_session' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_dict_quick_check' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_dict_store_replacement' => array( + '5.2' => false, + '5.3' => true, + ), + 'enchant_dict_suggest' => array( + '5.2' => false, + '5.3' => true, + ), + 'finfo_buffer' => array( + '5.2' => false, + '5.3' => true, + ), + 'finfo_close' => array( + '5.2' => false, + '5.3' => true, + ), + 'finfo_file' => array( + '5.2' => false, + '5.3' => true, + ), + 'finfo_open' => array( + '5.2' => false, + '5.3' => true, + ), + 'finfo_set_flags' => array( + '5.2' => false, + '5.3' => true, + ), + 'intl_error_name' => array( + '5.2' => false, + '5.3' => true, + ), + 'intl_get_error_code' => array( + '5.2' => false, + '5.3' => true, + ), + 'intl_get_error_message' => array( + '5.2' => false, + '5.3' => true, + ), + 'intl_is_failure' => array( + '5.2' => false, + '5.3' => true, + ), + + 'hex2bin' => array( + '5.3' => false, + '5.4' => true, + ), + 'http_response_code' => array( + '5.3' => false, + '5.4' => true, + ), + 'get_declared_traits' => array( + '5.3' => false, + '5.4' => true, + ), + 'getimagesizefromstring' => array( + '5.3' => false, + '5.4' => true, + ), + 'stream_set_chunk_size' => array( + '5.3' => false, + '5.4' => true, + ), + 'socket_import_stream' => array( + '5.3' => false, + '5.4' => true, + ), + 'trait_exists' => array( + '5.3' => false, + '5.4' => true, + ), + 'header_register_callback' => array( + '5.3' => false, + '5.4' => true, + ), + 'class_uses' => array( + '5.3' => false, + '5.4' => true, + ), + 'session_status' => array( + '5.3' => false, + '5.4' => true, + ), + 'session_register_shutdown' => array( + '5.3' => false, + '5.4' => true, + ), + 'mysqli_error_list' => array( + '5.3' => false, + '5.4' => true, + ), + 'mysqli_stmt_error_list' => array( + '5.3' => false, + '5.4' => true, + ), + 'libxml_set_external_entity_loader' => array( + '5.3' => false, + '5.4' => true, + ), + 'ldap_control_paged_result' => array( + '5.3' => false, + '5.4' => true, + ), + 'ldap_control_paged_result_response' => array( + '5.3' => false, + '5.4' => true, + ), + 'transliteral_create' => array( + '5.3' => false, + '5.4' => true, + ), + 'transliteral_create_from_rules' => array( + '5.3' => false, + '5.4' => true, + ), + 'transliteral_create_inverse' => array( + '5.3' => false, + '5.4' => true, + ), + 'transliteral_get_error_code' => array( + '5.3' => false, + '5.4' => true, + ), + 'transliteral_get_error_message' => array( + '5.3' => false, + '5.4' => true, + ), + 'transliteral_list_ids' => array( + '5.3' => false, + '5.4' => true, + ), + 'transliteral_transliterate' => array( + '5.3' => false, + '5.4' => true, + ), + 'zlib_decode' => array( + '5.3' => false, + '5.4' => true, + ), + 'zlib_encode' => array( + '5.3' => false, + '5.4' => true, + ), + + 'array_column' => array( + '5.4' => false, + '5.5' => true, + ), + 'boolval' => array( + '5.4' => false, + '5.5' => true, + ), + 'json_last_error_msg' => array( + '5.4' => false, + '5.5' => true, + ), + 'password_get_info' => array( + '5.4' => false, + '5.5' => true, + ), + 'password_hash' => array( + '5.4' => false, + '5.5' => true, + ), + 'password_needs_rehash' => array( + '5.4' => false, + '5.5' => true, + ), + 'password_verify' => array( + '5.4' => false, + '5.5' => true, + ), + 'hash_pbkdf2' => array( + '5.4' => false, + '5.5' => true, + ), + 'openssl_pbkdf2' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_escape' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_file_create' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_multi_setopt' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_multi_strerror' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_pause' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_reset' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_share_close' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_share_init' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_share_setopt' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_strerror' => array( + '5.4' => false, + '5.5' => true, + ), + 'curl_unescape' => array( + '5.4' => false, + '5.5' => true, + ), + 'imageaffinematrixconcat' => array( + '5.4' => false, + '5.5' => true, + ), + 'imageaffinematrixget' => array( + '5.4' => false, + '5.5' => true, + ), + 'imagecrop' => array( + '5.4' => false, + '5.5' => true, + ), + 'imagecropauto' => array( + '5.4' => false, + '5.5' => true, + ), + 'imageflip' => array( + '5.4' => false, + '5.5' => true, + ), + 'imagepalettetotruecolor' => array( + '5.4' => false, + '5.5' => true, + ), + 'imagescale' => array( + '5.4' => false, + '5.5' => true, + ), + 'mysqli_begin_transaction' => array( + '5.4' => false, + '5.5' => true, + ), + 'mysqli_release_savepoint' => array( + '5.4' => false, + '5.5' => true, + ), + 'mysqli_savepoint' => array( + '5.4' => false, + '5.5' => true, + ), + 'pg_escape_literal' => array( + '5.4' => false, + '5.5' => true, + ), + 'pg_escape_identifier' => array( + '5.4' => false, + '5.5' => true, + ), + 'socket_sendmsg' => array( + '5.4' => false, + '5.5' => true, + ), + 'socket_recvmsg' => array( + '5.4' => false, + '5.5' => true, + ), + 'socket_cmsg_space' => array( + '5.4' => false, + '5.5' => true, + ), + 'cli_get_process_title' => array( + '5.4' => false, + '5.5' => true, + ), + 'cli_set_process_title' => array( + '5.4' => false, + '5.5' => true, + ), + 'datefmt_format_object' => array( + '5.4' => false, + '5.5' => true, + ), + 'datefmt_get_calendar_object' => array( + '5.4' => false, + '5.5' => true, + ), + 'datefmt_get_timezone' => array( + '5.4' => false, + '5.5' => true, + ), + 'datefmt_set_timezone' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_create_instance' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_keyword_values_for_locale' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_now' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_available_locales' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_time' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_set_time' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_add' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_set_time_zone' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_after' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_before' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_set' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_roll' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_clear' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_field_difference' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_actual_maximum' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_actual_minumum' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_day_of_week_type' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_first_day_of_week' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_greatest_minimum' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_least_maximum' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_locale' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_maximum' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_minimal_days_in_first_week' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_minimum' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_time_zone' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_type' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_weekend_transition' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_in_daylight_time' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_is_equivalent_to' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_is_lenient' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_equals' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_repeated_wall_time_option' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_skipped_wall_time_option' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_set_repeated_wall_time_option' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_set_skipped_wall_time_option' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_from_date_time' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_to_date_time' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_error_code' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlcal_get_error_message' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlgregcal_create_instance' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlgregcal_set_gregorian_change' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlgregcal_get_gregorian_change' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlgregcal_is_leap_year' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_create_time_zone' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_create_default' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_id' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_gmt' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_unknown' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_create_enumeration' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_count_equivalent_ids' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_create_time_zone_id_enumeration' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_canonical_id' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_region' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_tz_data_version' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_equivalent_id' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_use_daylight_time' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_offset' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_raw_offset' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_has_same_rules' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_display_name' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_dst_savings' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_from_date_time_zone' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_to_date_time_zone' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_error_code' => array( + '5.4' => false, + '5.5' => true, + ), + 'intlz_get_error_message' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache_compile_file' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache_get_configuration' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache_get_status' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache_invalidate' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache_reset' => array( + '5.4' => false, + '5.5' => true, + ), + + 'opcache_is_script_cached' => array( + '5.5.10' => false, + '5.5.11' => true, + ), + + 'gmp_root' => array( + '5.5' => false, + '5.6' => true, + ), + 'gmp_rootrem' => array( + '5.5' => false, + '5.6' => true, + ), + 'hash_equals' => array( + '5.5' => false, + '5.6' => true, + ), + 'ldap_escape' => array( + '5.5' => false, + '5.6' => true, + ), + 'ldap_modify_batch' => array( + '5.4.25' => false, + '5.5.9' => false, + '5.4.26' => true, + '5.5.10' => true, + '5.6.0' => true, + ), + 'mysqli_get_links_stats' => array( + '5.5' => false, + '5.6' => true, + ), + 'openssl_get_cert_locations' => array( + '5.5' => false, + '5.6' => true, + ), + 'openssl_x509_fingerprint' => array( + '5.5' => false, + '5.6' => true, + ), + 'openssl_spki_new' => array( + '5.5' => false, + '5.6' => true, + ), + 'openssl_spki_verify' => array( + '5.5' => false, + '5.6' => true, + ), + 'openssl_spki_export_challenge' => array( + '5.5' => false, + '5.6' => true, + ), + 'openssl_spki_export' => array( + '5.5' => false, + '5.6' => true, + ), + 'pg_connect_poll' => array( + '5.5' => false, + '5.6' => true, + ), + 'pg_consume_input' => array( + '5.5' => false, + '5.6' => true, + ), + 'pg_flush' => array( + '5.5' => false, + '5.6' => true, + ), + 'pg_lo_truncate' => array( + '5.5' => false, + '5.6' => true, + ), + 'pg_socket' => array( + '5.5' => false, + '5.6' => true, + ), + 'session_abort' => array( + '5.5' => false, + '5.6' => true, + ), + 'session_reset' => array( + '5.5' => false, + '5.6' => true, + ), + + 'random_bytes' => array( + '5.6' => false, + '7.0' => true, + ), + 'random_int' => array( + '5.6' => false, + '7.0' => true, + ), + 'error_clear_last' => array( + '5.6' => false, + '7.0' => true, + ), + 'gmp_random_seed' => array( + '5.6' => false, + '7.0' => true, + ), + 'intdiv' => array( + '5.6' => false, + '7.0' => true, + ), + 'preg_replace_callback_array' => array( + '5.6' => false, + '7.0' => true, + ), + 'gc_mem_caches' => array( + '5.6' => false, + '7.0' => true, + ), + 'get_resources' => array( + '5.6' => false, + '7.0' => true, + ), + 'posix_setrlimit' => array( + '5.6' => false, + '7.0' => true, + ), + 'inflate_add' => array( + '5.6' => false, + '7.0' => true, + ), + 'deflate_add' => array( + '5.6' => false, + '7.0' => true, + ), + 'inflate_init' => array( + '5.6' => false, + '7.0' => true, + ), + 'deflate_init' => array( + '5.6' => false, + '7.0' => true, + ), + + 'socket_export_stream' => array( + '7.0.6' => false, + '7.0.7' => true, + ), + + 'curl_multi_errno' => array( + '7.0' => false, + '7.1' => true, + ), + 'curl_share_errno' => array( + '7.0' => false, + '7.1' => true, + ), + 'curl_share_strerror' => array( + '7.0' => false, + '7.1' => true, + ), + 'is_iterable' => array( + '7.0' => false, + '7.1' => true, + ), + 'pcntl_async_signals' => array( + '7.0' => false, + '7.1' => true, + ), + 'pcntl_signal_get_handler' => array( + '7.0' => false, + '7.1' => true, + ), + 'session_create_id' => array( + '7.0' => false, + '7.1' => true, + ), + 'session_gc' => array( + '7.0' => false, + '7.1' => true, + ), + 'sapi_windows_cp_set' => array( + '7.0' => false, + '7.1' => true, + ), + 'sapi_windows_cp_get' => array( + '7.0' => false, + '7.1' => true, + ), + 'sapi_windows_cp_is_utf8' => array( + '7.0' => false, + '7.1' => true, + ), + 'sapi_windows_cp_conv' => array( + '7.0' => false, + '7.1' => true, + ), + + 'hash_hkdf' => array( + '7.1.1' => false, + '7.1.2' => true, + ), + 'oci_register_taf_callback' => array( + '7.1.6' => false, + '7.1.7' => true, + ), + 'oci_unregister_taf_callback' => array( + '7.1.8' => false, + '7.1.9' => true, + ), + + 'stream_isatty' => array( + '7.1' => false, + '7.2' => true, + ), + 'sapi_windows_vt100_support' => array( + '7.1' => false, + '7.2' => true, + ), + 'ftp_append' => array( + '7.1' => false, + '7.2' => true, + ), + 'hash_hmac_algos' => array( + '7.1' => false, + '7.2' => true, + ), + 'imagebmp' => array( + '7.1' => false, + '7.2' => true, + ), + 'imagecreatefrombmp' => array( + '7.1' => false, + '7.2' => true, + ), + 'imagegetclip' => array( + '7.1' => false, + '7.2' => true, + ), + 'imageopenpolygon' => array( + '7.1' => false, + '7.2' => true, + ), + 'imageresolution' => array( + '7.1' => false, + '7.2' => true, + ), + 'imagesetclip' => array( + '7.1' => false, + '7.2' => true, + ), + 'ldap_exop' => array( + '7.1' => false, + '7.2' => true, + ), + 'ldap_exop_passwd' => array( + '7.1' => false, + '7.2' => true, + ), + 'ldap_exop_whoami' => array( + '7.1' => false, + '7.2' => true, + ), + 'ldap_parse_exop' => array( + '7.1' => false, + '7.2' => true, + ), + 'mb_chr' => array( + '7.1' => false, + '7.2' => true, + ), + 'mb_ord' => array( + '7.1' => false, + '7.2' => true, + ), + 'mb_scrub' => array( + '7.1' => false, + '7.2' => true, + ), + 'socket_addrinfo_lookup' => array( + '7.1' => false, + '7.2' => true, + ), + 'socket_addrinfo_connect' => array( + '7.1' => false, + '7.2' => true, + ), + 'socket_addrinfo_bind' => array( + '7.1' => false, + '7.2' => true, + ), + 'socket_addrinfo_explain' => array( + '7.1' => false, + '7.2' => true, + ), + 'spl_object_id' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_add' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_base642bin' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_bin2base64' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_bin2hex' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_compare' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_aes256gcm_decrypt' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_aes256gcm_encrypt' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_aes256gcm_is_available' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_aes256gcm_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_chacha20poly1305_decrypt' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_chacha20poly1305_encrypt' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_chacha20poly1305_ietf_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_chacha20poly1305_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_aead_xchacha20poly1305_ietf_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_auth_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_auth_verify' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_auth' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box_keypair_from_secretkey_and_publickey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box_keypair' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box_open' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box_publickey_from_secretkey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box_publickey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box_seal_open' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box_seal' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box_secretkey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box_seed_keypair' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_box' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_generichash_final' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_generichash_init' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_generichash_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_generichash_update' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_generichash' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_kdf_derive_from_key' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_kdf_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_kx_client_session_keys' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_kx_keypair' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_kx_publickey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_kx_secretkey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_kx_seed_keypair' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_kx_server_session_keys' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_pwhash_scryptsalsa208sha256_str_verify' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_pwhash_scryptsalsa208sha256_str' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_pwhash_scryptsalsa208sha256' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_pwhash_str_needs_rehash' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_pwhash_str_verify' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_pwhash_str' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_pwhash' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_scalarmult_base' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_scalarmult' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_secretbox_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_secretbox_open' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_secretbox' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_secretstream_xchacha20poly1305_init_pull' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_secretstream_xchacha20poly1305_init_push' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_secretstream_xchacha20poly1305_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_secretstream_xchacha20poly1305_pull' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_secretstream_xchacha20poly1305_push' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_secretstream_xchacha20poly1305_rekey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_shorthash_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_shorthash' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_detached' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_ed25519_pk_to_curve25519' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_ed25519_sk_to_curve25519' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_keypair_from_secretkey_and_publickey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_keypair' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_open' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_publickey_from_secretkey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_publickey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_secretkey' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_seed_keypair' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign_verify_detached' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_sign' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_stream_keygen' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_stream_xor' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_crypto_stream' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_hex2bin' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_increment' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_memcmp' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_memzero' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_pad' => array( + '7.1' => false, + '7.2' => true, + ), + 'sodium_unpad' => array( + '7.1' => false, + '7.2' => true, + ), + // Introduced in 7.2.14 and 7.3.1 simultanously. + 'oci_set_call_timeout' => array( + '7.2.13' => false, + '7.2.14' => true, + ), + // Introduced in 7.2.14 and 7.3.1 simultanously. + 'oci_set_db_operation' => array( + '7.2.13' => false, + '7.2.14' => true, + ), + + 'hrtime' => array( + '7.2' => false, + '7.3' => true, + ), + 'is_countable' => array( + '7.2' => false, + '7.3' => true, + ), + 'array_key_first' => array( + '7.2' => false, + '7.3' => true, + ), + 'array_key_last' => array( + '7.2' => false, + '7.3' => true, + ), + 'fpm_get_status' => array( + '7.2' => false, + '7.3' => true, + ), + 'net_get_interfaces' => array( + '7.2' => false, + '7.3' => true, + ), + 'gmp_binomial' => array( + '7.2' => false, + '7.3' => true, + ), + 'gmp_lcm' => array( + '7.2' => false, + '7.3' => true, + ), + 'gmp_perfect_power' => array( + '7.2' => false, + '7.3' => true, + ), + 'gmp_kronecker' => array( + '7.2' => false, + '7.3' => true, + ), + 'ldap_add_ext' => array( + '7.2' => false, + '7.3' => true, + ), + 'ldap_bind_ext' => array( + '7.2' => false, + '7.3' => true, + ), + 'ldap_delete_ext' => array( + '7.2' => false, + '7.3' => true, + ), + 'ldap_exop_refresh' => array( + '7.2' => false, + '7.3' => true, + ), + 'ldap_mod_add_ext' => array( + '7.2' => false, + '7.3' => true, + ), + 'ldap_mod_replace_ext' => array( + '7.2' => false, + '7.3' => true, + ), + 'ldap_mod_del_ext' => array( + '7.2' => false, + '7.3' => true, + ), + 'ldap_rename_ext' => array( + '7.2' => false, + '7.3' => true, + ), + 'normalizer_get_raw_decomposition' => array( + '7.2' => false, + '7.3' => true, + ), + 'openssl_pkey_derive' => array( + '7.2' => false, + '7.3' => true, + ), + 'socket_wsaprotocol_info_export' => array( + '7.2' => false, + '7.3' => true, + ), + 'socket_wsaprotocol_info_import' => array( + '7.2' => false, + '7.3' => true, + ), + 'socket_wsaprotocol_info_release' => array( + '7.2' => false, + '7.3' => true, + ), + + 'get_mangled_object_vars' => array( + '7.3' => false, + '7.4' => true, + ), + 'imagecreatefromtga' => array( + '7.3' => false, + '7.4' => true, + ), + 'mb_str_split' => array( + '7.3' => false, + '7.4' => true, + ), + 'openssl_x509_verify' => array( + '7.3' => false, + '7.4' => true, + ), + 'password_algos' => array( + '7.3' => false, + '7.4' => true, + ), + 'pcntl_unshare' => array( + '7.3' => false, + '7.4' => true, + ), + 'sapi_windows_set_ctrl_handler' => array( + '7.3' => false, + '7.4' => true, + ), + 'sapi_windows_generate_ctrl_event' => array( + '7.3' => false, + '7.4' => true, + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.6 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of function names. + $this->newFunctions = $this->arrayKeysToLowercase($this->newFunctions); + + return array(\T_STRING); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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(); + + $ignore = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_CONST => true, + ); + + $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function. + return; + + } elseif ($tokens[$prevToken]['code'] === \T_NS_SEPARATOR && $tokens[$prevToken - 1]['code'] === \T_STRING) { + // Namespaced function. + return; + } + + $function = $tokens[$stackPtr]['content']; + $functionLc = strtolower($function); + + if (isset($this->newFunctions[$functionLc]) === false) { + return; + } + + $itemInfo = array( + 'name' => $function, + 'nameLc' => $functionLc, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newFunctions[$itemInfo['nameLc']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The function %s() is not present in PHP version %s or earlier'; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php new file mode 100644 index 00000000..301e5e07 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php @@ -0,0 +1,173 @@ + array( + 1 => array( + 'name' => 'salt', + '5.6' => 'recommended', + ), + ), + 'parse_str' => array( + 1 => array( + 'name' => 'result', + '7.2' => false, + ), + ), + ); + + + /** + * Determine whether an error/warning should be thrown for an item based on collected information. + * + * @since 8.1.0 + * + * @param array $errorInfo Detail information about an item. + * + * @return bool + */ + protected function shouldThrowError(array $errorInfo) + { + return ($errorInfo['optionalDeprecated'] !== '' + || $errorInfo['optionalRemoved'] !== '' + || $errorInfo['optionalRecommended'] !== ''); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 8.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = array( + 'paramName' => '', + 'optionalRecommended' => '', + 'optionalDeprecated' => '', + 'optionalRemoved' => '', + 'error' => false, + ); + + $versionArray = $this->getVersionArray($itemArray); + + if (empty($versionArray) === false) { + foreach ($versionArray as $version => $required) { + if ($this->supportsAbove($version) === true) { + if ($required === true && $errorInfo['optionalRemoved'] === '') { + $errorInfo['optionalRemoved'] = $version; + $errorInfo['error'] = true; + } elseif ($required === 'recommended' && $errorInfo['optionalRecommended'] === '') { + $errorInfo['optionalRecommended'] = $version; + } elseif ($errorInfo['optionalDeprecated'] === '') { + $errorInfo['optionalDeprecated'] = $version; + } + } + } + } + + $errorInfo['paramName'] = $itemArray['name']; + + return $errorInfo; + } + + + /** + * Generates the error or warning for this item. + * + * @since 8.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the relevant token in + * the stack. + * @param array $itemInfo Base information about the item. + * @param array $errorInfo Array with detail (version) information + * relevant to the item. + * + * @return void + */ + public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) + { + $error = 'The "%s" parameter for function %s() is missing. Passing this parameter is '; + if ($errorInfo['optionalRecommended'] === '') { + $error .= 'no longer optional. The optional nature of the parameter is '; + } else { + $error .= 'strongly recommended '; + } + + $errorCode = $this->stringToErrorCode($itemInfo['name'] . '_' . $errorInfo['paramName']); + $data = array( + $errorInfo['paramName'], + $itemInfo['name'], + ); + + if ($errorInfo['optionalRecommended'] !== '') { + $error .= 'since PHP %s '; + $errorCode .= 'SoftRecommended'; + $data[] = $errorInfo['optionalRecommended']; + } else { + if ($errorInfo['optionalDeprecated'] !== '') { + $error .= 'deprecated since PHP %s and '; + $errorCode .= 'SoftRequired'; + $data[] = $errorInfo['optionalDeprecated']; + } + + if ($errorInfo['optionalRemoved'] !== '') { + $error .= 'removed since PHP %s and '; + $errorCode .= 'HardRequired'; + $data[] = $errorInfo['optionalRemoved']; + } + + // Remove the last 'and' from the message. + $error = substr($error, 0, (\strlen($error) - 5)); + } + + $this->addMessage($phpcsFile, $error, $stackPtr, $errorInfo['error'], $errorCode, $data); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php new file mode 100644 index 00000000..b4cad10b --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php @@ -0,0 +1,292 @@ + array( + 0 => array( + 'name' => 'age', + '7.4' => false, + 'callback' => 'curlVersionInvalidValue', + ), + ), + 'define' => array( + 2 => array( + 'name' => 'case_insensitive', + '7.3' => false, // Slated for removal in PHP 8.0.0. + ), + ), + 'gmmktime' => array( + 6 => array( + 'name' => 'is_dst', + '5.1' => false, + '7.0' => true, + ), + ), + 'ldap_first_attribute' => array( + 2 => array( + 'name' => 'ber_identifier', + '5.2.4' => true, + ), + ), + 'ldap_next_attribute' => array( + 2 => array( + 'name' => 'ber_identifier', + '5.2.4' => true, + ), + ), + 'mktime' => array( + 6 => array( + 'name' => 'is_dst', + '5.1' => false, + '7.0' => true, + ), + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.0 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of function names. + $this->removedFunctionParameters = $this->arrayKeysToLowercase($this->removedFunctionParameters); + + return array(\T_STRING); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.0 + * + * @param \PHP_CodeSniffer_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(); + + $ignore = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_CONST => true, + ); + + $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function. + return; + } + + $function = $tokens[$stackPtr]['content']; + $functionLc = strtolower($function); + + if (isset($this->removedFunctionParameters[$functionLc]) === false) { + return; + } + + $parameters = $this->getFunctionCallParameters($phpcsFile, $stackPtr); + $parameterCount = \count($parameters); + if ($parameterCount === 0) { + return; + } + + // If the parameter count returned > 0, we know there will be valid open parenthesis. + $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); + $parameterOffsetFound = $parameterCount - 1; + + foreach ($this->removedFunctionParameters[$functionLc] as $offset => $parameterDetails) { + if ($offset <= $parameterOffsetFound) { + if (isset($parameterDetails['callback']) && method_exists($this, $parameterDetails['callback'])) { + if ($this->{$parameterDetails['callback']}($phpcsFile, $parameters[($offset + 1)]) === false) { + continue; + } + } + + $itemInfo = array( + 'name' => $function, + 'nameLc' => $functionLc, + 'offset' => $offset, + ); + $this->handleFeature($phpcsFile, $openParenthesis, $itemInfo); + } + } + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->removedFunctionParameters[$itemInfo['nameLc']][$itemInfo['offset']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array('name', 'callback'); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + $errorInfo['paramName'] = $itemArray['name']; + + return $errorInfo; + } + + + /** + * Get the item name to be used for the creation of the error code. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * @param array $errorInfo Detail information about an item. + * + * @return string + */ + protected function getItemName(array $itemInfo, array $errorInfo) + { + return $itemInfo['name'] . '_' . $errorInfo['paramName']; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The "%s" parameter for function %s() is '; + } + + + /** + * Filter the error data before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param array $data The error data array which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return array + */ + protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) + { + array_shift($data); + array_unshift($data, $errorInfo['paramName'], $itemInfo['name']); + return $data; + } + + /** + * Check whether curl_version() was passed the default CURLVERSION_NOW. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param array $parameter Parameter info array. + * + * @return bool True if the value was not CURLVERSION_NOW, false otherwise. + */ + protected function curlVersionInvalidValue(File $phpcsFile, array $parameter) + { + $tokens = $phpcsFile->getTokens(); + $raw = ''; + for ($i = $parameter['start']; $i <= $parameter['end']; $i++) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']])) { + continue; + } + + $raw .= $tokens[$i]['content']; + } + + if ($raw !== 'CURLVERSION_NOW' + && $raw !== (string) \CURLVERSION_NOW + ) { + return true; + } + + return false; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php new file mode 100644 index 00000000..33f3d393 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php @@ -0,0 +1,1104 @@ + array(string => bool|string|null)) + */ + protected $removedFunctions = array( + 'php_check_syntax' => array( + '5.0.5' => true, + 'alternative' => null, + ), + + 'pfpro_cleanup' => array( + '5.1' => true, + 'alternative' => null, + ), + 'pfpro_init' => array( + '5.1' => true, + 'alternative' => null, + ), + 'pfpro_process_raw' => array( + '5.1' => true, + 'alternative' => null, + ), + 'pfpro_process' => array( + '5.1' => true, + 'alternative' => null, + ), + 'pfpro_version' => array( + '5.1' => true, + 'alternative' => null, + ), + + 'call_user_method' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'call_user_func()', + ), + 'call_user_method_array' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'call_user_func_array()', + ), + 'define_syslog_variables' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => null, + ), + 'dl' => array( + '5.3' => false, + 'alternative' => null, + ), + 'ereg' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_match()', + ), + 'ereg_replace' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_replace()', + ), + 'eregi' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_match()', + ), + 'eregi_replace' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_replace()', + ), + 'imagepsbbox' => array( + '7.0' => true, + 'alternative' => null, + ), + 'imagepsencodefont' => array( + '7.0' => true, + 'alternative' => null, + ), + 'imagepsextendfont' => array( + '7.0' => true, + 'alternative' => null, + ), + 'imagepsfreefont' => array( + '7.0' => true, + 'alternative' => null, + ), + 'imagepsloadfont' => array( + '7.0' => true, + 'alternative' => null, + ), + 'imagepsslantfont' => array( + '7.0' => true, + 'alternative' => null, + ), + 'imagepstext' => array( + '7.0' => true, + 'alternative' => null, + ), + 'import_request_variables' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => null, + ), + 'ldap_sort' => array( + '7.0' => false, + 'alternative' => null, + ), + 'mcrypt_generic_end' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'mcrypt_generic_deinit()', + ), + 'mysql_db_query' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'mysqli::select_db() and mysqli::query()', + ), + 'mysql_escape_string' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'mysqli::real_escape_string()', + ), + 'mysql_list_dbs' => array( + '5.4' => false, + '7.0' => true, + 'alternative' => null, + ), + 'mysqli_bind_param' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::bind_param()', + ), + 'mysqli_bind_result' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::bind_result()', + ), + 'mysqli_client_encoding' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli::character_set_name()', + ), + 'mysqli_fetch' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::fetch()', + ), + 'mysqli_param_count' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt_param_count()', + ), + 'mysqli_get_metadata' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::result_metadata()', + ), + 'mysqli_send_long_data' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::send_long_data()', + ), + 'magic_quotes_runtime' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => null, + ), + 'session_register' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_SESSION', + ), + 'session_unregister' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_SESSION', + ), + 'session_is_registered' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_SESSION', + ), + 'set_magic_quotes_runtime' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => null, + ), + 'set_socket_blocking' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'stream_set_blocking()', + ), + 'split' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_split()', + ), + 'spliti' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_split()', + ), + 'sql_regcase' => array( + '5.3' => false, + '7.0' => true, + 'alternative' => null, + ), + 'php_logo_guid' => array( + '5.5' => true, + 'alternative' => null, + ), + 'php_egg_logo_guid' => array( + '5.5' => true, + 'alternative' => null, + ), + 'php_real_logo_guid' => array( + '5.5' => true, + 'alternative' => null, + ), + 'zend_logo_guid' => array( + '5.5' => true, + 'alternative' => null, + ), + 'datefmt_set_timezone_id' => array( + '5.5' => false, + '7.0' => true, + 'alternative' => 'IntlDateFormatter::setTimeZone()', + ), + 'mcrypt_ecb' => array( + '5.5' => false, + '7.0' => true, + 'alternative' => null, + ), + 'mcrypt_cbc' => array( + '5.5' => false, + '7.0' => true, + 'alternative' => null, + ), + 'mcrypt_cfb' => array( + '5.5' => false, + '7.0' => true, + 'alternative' => null, + ), + 'mcrypt_ofb' => array( + '5.5' => false, + '7.0' => true, + 'alternative' => null, + ), + 'ocibindbyname' => array( + '5.4' => false, + 'alternative' => 'oci_bind_by_name()', + ), + 'ocicancel' => array( + '5.4' => false, + 'alternative' => 'oci_cancel()', + ), + 'ocicloselob' => array( + '5.4' => false, + 'alternative' => 'OCI-Lob::close()', + ), + 'ocicollappend' => array( + '5.4' => false, + 'alternative' => 'OCI-Collection::append()', + ), + 'ocicollassign' => array( + '5.4' => false, + 'alternative' => 'OCI-Collection::assign()', + ), + 'ocicollassignelem' => array( + '5.4' => false, + 'alternative' => 'OCI-Collection::assignElem()', + ), + 'ocicollgetelem' => array( + '5.4' => false, + 'alternative' => 'OCI-Collection::getElem()', + ), + 'ocicollmax' => array( + '5.4' => false, + 'alternative' => 'OCI-Collection::max()', + ), + 'ocicollsize' => array( + '5.4' => false, + 'alternative' => 'OCI-Collection::size()', + ), + 'ocicolltrim' => array( + '5.4' => false, + 'alternative' => 'OCI-Collection::trim()', + ), + 'ocicolumnisnull' => array( + '5.4' => false, + 'alternative' => 'oci_field_is_null()', + ), + 'ocicolumnname' => array( + '5.4' => false, + 'alternative' => 'oci_field_name()', + ), + 'ocicolumnprecision' => array( + '5.4' => false, + 'alternative' => 'oci_field_precision()', + ), + 'ocicolumnscale' => array( + '5.4' => false, + 'alternative' => 'oci_field_scale()', + ), + 'ocicolumnsize' => array( + '5.4' => false, + 'alternative' => 'oci_field_size()', + ), + 'ocicolumntype' => array( + '5.4' => false, + 'alternative' => 'oci_field_type()', + ), + 'ocicolumntyperaw' => array( + '5.4' => false, + 'alternative' => 'oci_field_type_raw()', + ), + 'ocicommit' => array( + '5.4' => false, + 'alternative' => 'oci_commit()', + ), + 'ocidefinebyname' => array( + '5.4' => false, + 'alternative' => 'oci_define_by_name()', + ), + 'ocierror' => array( + '5.4' => false, + 'alternative' => 'oci_error()', + ), + 'ociexecute' => array( + '5.4' => false, + 'alternative' => 'oci_execute()', + ), + 'ocifetch' => array( + '5.4' => false, + 'alternative' => 'oci_fetch()', + ), + 'ocifetchinto' => array( + '5.4' => false, + 'alternative' => null, + ), + 'ocifetchstatement' => array( + '5.4' => false, + 'alternative' => 'oci_fetch_all()', + ), + 'ocifreecollection' => array( + '5.4' => false, + 'alternative' => 'OCI-Collection::free()', + ), + 'ocifreecursor' => array( + '5.4' => false, + 'alternative' => 'oci_free_statement()', + ), + 'ocifreedesc' => array( + '5.4' => false, + 'alternative' => 'OCI-Lob::free()', + ), + 'ocifreestatement' => array( + '5.4' => false, + 'alternative' => 'oci_free_statement()', + ), + 'ociinternaldebug' => array( + '5.4' => false, + 'alternative' => 'oci_internal_debug()', + ), + 'ociloadlob' => array( + '5.4' => false, + 'alternative' => 'OCI-Lob::load()', + ), + 'ocilogoff' => array( + '5.4' => false, + 'alternative' => 'oci_close()', + ), + 'ocilogon' => array( + '5.4' => false, + 'alternative' => 'oci_connect()', + ), + 'ocinewcollection' => array( + '5.4' => false, + 'alternative' => 'oci_new_collection()', + ), + 'ocinewcursor' => array( + '5.4' => false, + 'alternative' => 'oci_new_cursor()', + ), + 'ocinewdescriptor' => array( + '5.4' => false, + 'alternative' => 'oci_new_descriptor()', + ), + 'ocinlogon' => array( + '5.4' => false, + 'alternative' => 'oci_new_connect()', + ), + 'ocinumcols' => array( + '5.4' => false, + 'alternative' => 'oci_num_fields()', + ), + 'ociparse' => array( + '5.4' => false, + 'alternative' => 'oci_parse()', + ), + 'ociplogon' => array( + '5.4' => false, + 'alternative' => 'oci_pconnect()', + ), + 'ociresult' => array( + '5.4' => false, + 'alternative' => 'oci_result()', + ), + 'ocirollback' => array( + '5.4' => false, + 'alternative' => 'oci_rollback()', + ), + 'ocirowcount' => array( + '5.4' => false, + 'alternative' => 'oci_num_rows()', + ), + 'ocisavelob' => array( + '5.4' => false, + 'alternative' => 'OCI-Lob::save()', + ), + 'ocisavelobfile' => array( + '5.4' => false, + 'alternative' => 'OCI-Lob::import()', + ), + 'ociserverversion' => array( + '5.4' => false, + 'alternative' => 'oci_server_version()', + ), + 'ocisetprefetch' => array( + '5.4' => false, + 'alternative' => 'oci_set_prefetch()', + ), + 'ocistatementtype' => array( + '5.4' => false, + 'alternative' => 'oci_statement_type()', + ), + 'ociwritelobtofile' => array( + '5.4' => false, + 'alternative' => 'OCI-Lob::export()', + ), + 'ociwritetemporarylob' => array( + '5.4' => false, + 'alternative' => 'OCI-Lob::writeTemporary()', + ), + 'mysqli_get_cache_stats' => array( + '5.4' => true, + 'alternative' => null, + ), + + 'mcrypt_create_iv' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'random_bytes() or OpenSSL', + ), + 'mcrypt_decrypt' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_get_algorithms_name' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_get_block_size' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_get_iv_size' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_get_key_size' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_get_modes_name' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_get_supported_key_sizes' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_is_block_algorithm_mode' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_is_block_algorithm' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_is_block_mode' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_enc_self_test' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_encrypt' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_generic_deinit' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_generic_init' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_generic' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_get_block_size' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_get_cipher_name' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_get_iv_size' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_get_key_size' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_list_algorithms' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_list_modes' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_module_close' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_module_get_algo_block_size' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_module_get_algo_key_size' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_module_get_supported_key_sizes' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_module_is_block_algorithm_mode' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_module_is_block_algorithm' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_module_is_block_mode' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_module_open' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mcrypt_module_self_test' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'mdecrypt_generic' => array( + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + ), + 'jpeg2wbmp' => array( + '7.2' => false, + 'alternative' => 'imagecreatefromjpeg() and imagewbmp()', + ), + 'png2wbmp' => array( + '7.2' => false, + 'alternative' => 'imagecreatefrompng() or imagewbmp()', + ), + 'create_function' => array( + '7.2' => false, + 'alternative' => 'an anonymous function', + ), + 'each' => array( + '7.2' => false, + 'alternative' => 'a foreach loop', + ), + 'gmp_random' => array( + '7.2' => false, + 'alternative' => 'gmp_random_bits() or gmp_random_range()', + ), + 'read_exif_data' => array( + '7.2' => false, + 'alternative' => 'exif_read_data()', + ), + + 'image2wbmp' => array( + '7.3' => false, + 'alternative' => 'imagewbmp()', + ), + 'mbregex_encoding' => array( + '7.3' => false, + 'alternative' => 'mb_regex_encoding()', + ), + 'mbereg' => array( + '7.3' => false, + 'alternative' => 'mb_ereg()', + ), + 'mberegi' => array( + '7.3' => false, + 'alternative' => 'mb_eregi()', + ), + 'mbereg_replace' => array( + '7.3' => false, + 'alternative' => 'mb_ereg_replace()', + ), + 'mberegi_replace' => array( + '7.3' => false, + 'alternative' => 'mb_eregi_replace()', + ), + 'mbsplit' => array( + '7.3' => false, + 'alternative' => 'mb_split()', + ), + 'mbereg_match' => array( + '7.3' => false, + 'alternative' => 'mb_ereg_match()', + ), + 'mbereg_search' => array( + '7.3' => false, + 'alternative' => 'mb_ereg_search()', + ), + 'mbereg_search_pos' => array( + '7.3' => false, + 'alternative' => 'mb_ereg_search_pos()', + ), + 'mbereg_search_regs' => array( + '7.3' => false, + 'alternative' => 'mb_ereg_search_regs()', + ), + 'mbereg_search_init' => array( + '7.3' => false, + 'alternative' => 'mb_ereg_search_init()', + ), + 'mbereg_search_getregs' => array( + '7.3' => false, + 'alternative' => 'mb_ereg_search_getregs()', + ), + 'mbereg_search_getpos' => array( + '7.3' => false, + 'alternative' => 'mb_ereg_search_getpos()', + ), + 'mbereg_search_setpos' => array( + '7.3' => false, + 'alternative' => 'mb_ereg_search_setpos()', + ), + 'fgetss' => array( + '7.3' => false, + 'alternative' => null, + ), + 'gzgetss' => array( + '7.3' => false, + 'alternative' => null, + ), + + 'convert_cyr_string' => array( + '7.4' => false, + 'alternative' => 'mb_convert_encoding(), iconv() or UConverter', + ), + 'ezmlm_hash' => array( + '7.4' => false, + 'alternative' => null, + ), + 'get_magic_quotes_gpc' => array( + '7.4' => false, + 'alternative' => null, + ), + 'get_magic_quotes_runtime' => array( + '7.4' => false, + 'alternative' => null, + ), + 'hebrevc' => array( + '7.4' => false, + 'alternative' => null, + ), + 'is_real' => array( + '7.4' => false, + 'alternative' => 'is_float()', + ), + 'money_format' => array( + '7.4' => false, + 'alternative' => 'NumberFormatter::formatCurrency()', + ), + 'restore_include_path' => array( + '7.4' => false, + 'alternative' => "ini_restore('include_path')", + ), + 'ibase_add_user' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_affected_rows' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_backup' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_blob_add' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_blob_cancel' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_blob_close' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_blob_create' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_blob_echo' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_blob_get' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_blob_import' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_blob_info' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_blob_open' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_close' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_commit_ret' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_commit' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_connect' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_db_info' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_delete_user' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_drop_db' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_errcode' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_errmsg' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_execute' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_fetch_assoc' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_fetch_object' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_fetch_row' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_field_info' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_free_event_handler' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_free_query' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_free_result' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_gen_id' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_maintain_db' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_modify_user' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_name_result' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_num_fields' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_num_params' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_param_info' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_pconnect' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_prepare' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_query' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_restore' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_rollback_ret' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_rollback' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_server_info' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_service_attach' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_service_detach' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_set_event_handler' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_trans' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ibase_wait_event' => array( + '7.4' => true, + 'alternative' => null, + ), + 'ldap_control_paged_result_response' => array( + '7.4' => false, + 'alternative' => 'ldap_search()', + ), + 'ldap_control_paged_result' => array( + '7.4' => false, + 'alternative' => 'ldap_search()', + ), + 'recode_file' => array( + '7.4' => true, + 'alternative' => 'the iconv or mbstring extension', + ), + 'recode_string' => array( + '7.4' => true, + 'alternative' => 'the iconv or mbstring extension', + ), + 'recode' => array( + '7.4' => true, + 'alternative' => 'the iconv or mbstring extension', + ), + 'wddx_add_vars' => array( + '7.4' => true, + 'alternative' => null, + ), + 'wddx_deserialize' => array( + '7.4' => true, + 'alternative' => null, + ), + 'wddx_packet_end' => array( + '7.4' => true, + 'alternative' => null, + ), + 'wddx_packet_start' => array( + '7.4' => true, + 'alternative' => null, + ), + 'wddx_serialize_value' => array( + '7.4' => true, + 'alternative' => null, + ), + 'wddx_serialize_vars' => array( + '7.4' => true, + 'alternative' => null, + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.6 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of function names. + $this->removedFunctions = $this->arrayKeysToLowercase($this->removedFunctions); + + return array(\T_STRING); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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(); + + $ignore = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_CLASS => true, + \T_CONST => true, + \T_USE => true, + \T_NS_SEPARATOR => true, + ); + + $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function. + return; + } + + $function = $tokens[$stackPtr]['content']; + $functionLc = strtolower($function); + + if (isset($this->removedFunctions[$functionLc]) === false) { + return; + } + + $itemInfo = array( + 'name' => $function, + 'nameLc' => $functionLc, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->removedFunctions[$itemInfo['nameLc']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'Function %s() is '; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php new file mode 100644 index 00000000..9c32ccca --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php @@ -0,0 +1,350 @@ + array( + 0 => array( + 'name' => 'array(s) to merge', + '7.3' => true, + '7.4' => false, + ), + ), + 'array_merge_recursive' => array( + 0 => array( + 'name' => 'array(s) to merge', + '7.3' => true, + '7.4' => false, + ), + ), + 'array_push' => array( + 1 => array( + 'name' => 'element to push', + '7.2' => true, + '7.3' => false, + ), + ), + 'array_unshift' => array( + 1 => array( + 'name' => 'element to prepend', + '7.2' => true, + '7.3' => false, + ), + ), + 'bcscale' => array( + 0 => array( + 'name' => 'scale', + '7.2' => true, + '7.3' => false, + ), + ), + 'ftp_fget' => array( + 3 => array( + 'name' => 'mode', + '7.2' => true, + '7.3' => false, + ), + ), + 'ftp_fput' => array( + 3 => array( + 'name' => 'mode', + '7.2' => true, + '7.3' => false, + ), + ), + 'ftp_get' => array( + 3 => array( + 'name' => 'mode', + '7.2' => true, + '7.3' => false, + ), + ), + 'ftp_nb_fget' => array( + 3 => array( + 'name' => 'mode', + '7.2' => true, + '7.3' => false, + ), + ), + 'ftp_nb_fput' => array( + 3 => array( + 'name' => 'mode', + '7.2' => true, + '7.3' => false, + ), + ), + 'ftp_nb_get' => array( + 3 => array( + 'name' => 'mode', + '7.2' => true, + '7.3' => false, + ), + ), + 'ftp_nb_put' => array( + 3 => array( + 'name' => 'mode', + '7.2' => true, + '7.3' => false, + ), + ), + 'ftp_put' => array( + 3 => array( + 'name' => 'mode', + '7.2' => true, + '7.3' => false, + ), + ), + 'getenv' => array( + 0 => array( + 'name' => 'varname', + '7.0' => true, + '7.1' => false, + ), + ), + 'preg_match_all' => array( + 2 => array( + 'name' => 'matches', + '5.3' => true, + '5.4' => false, + ), + ), + 'stream_socket_enable_crypto' => array( + 2 => array( + 'name' => 'crypto_type', + '5.5' => true, + '5.6' => false, + ), + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.3 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of function names. + $this->functionParameters = $this->arrayKeysToLowercase($this->functionParameters); + + return array(\T_STRING); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_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(); + + $ignore = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_CONST => true, + \T_NEW => true, + ); + + $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function. + return; + } + + $function = $tokens[$stackPtr]['content']; + $functionLc = strtolower($function); + + if (isset($this->functionParameters[$functionLc]) === false) { + return; + } + + $parameterCount = $this->getFunctionCallParameterCount($phpcsFile, $stackPtr); + $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); + + // If the parameter count returned > 0, we know there will be valid open parenthesis. + if ($parameterCount === 0 && $tokens[$openParenthesis]['code'] !== \T_OPEN_PARENTHESIS) { + return; + } + + $parameterOffsetFound = $parameterCount - 1; + + foreach ($this->functionParameters[$functionLc] as $offset => $parameterDetails) { + if ($offset > $parameterOffsetFound) { + $itemInfo = array( + 'name' => $function, + 'nameLc' => $functionLc, + 'offset' => $offset, + ); + $this->handleFeature($phpcsFile, $openParenthesis, $itemInfo); + } + } + } + + + /** + * Determine whether an error/warning should be thrown for an item based on collected information. + * + * @since 7.1.0 + * + * @param array $errorInfo Detail information about an item. + * + * @return bool + */ + protected function shouldThrowError(array $errorInfo) + { + return ($errorInfo['requiredVersion'] !== ''); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->functionParameters[$itemInfo['nameLc']][$itemInfo['offset']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array('name'); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = array( + 'paramName' => '', + 'requiredVersion' => '', + ); + + $versionArray = $this->getVersionArray($itemArray); + + if (empty($versionArray) === false) { + foreach ($versionArray as $version => $required) { + if ($required === true && $this->supportsBelow($version) === true) { + $errorInfo['requiredVersion'] = $version; + } + } + } + + $errorInfo['paramName'] = $itemArray['name']; + + return $errorInfo; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The "%s" parameter for function %s() is missing, but was required for PHP version %s and lower'; + } + + + /** + * Generates the error or warning for this item. + * + * @since 7.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the relevant token in + * the stack. + * @param array $itemInfo Base information about the item. + * @param array $errorInfo Array with detail (version) information + * relevant to the item. + * + * @return void + */ + public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) + { + $error = $this->getErrorMsgTemplate(); + $errorCode = $this->stringToErrorCode($itemInfo['name'] . '_' . $errorInfo['paramName']) . 'Missing'; + $data = array( + $errorInfo['paramName'], + $itemInfo['name'], + $errorInfo['requiredVersion'], + ); + + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php new file mode 100644 index 00000000..98ca2461 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php @@ -0,0 +1,158 @@ + \T_FUNCTION, + \T_CLOSURE => \T_CLOSURE, + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.2.0 + * + * @return array + */ + public function register() + { + $targets = array( + \T_YIELD, + ); + + /* + * The `yield` keyword was introduced in PHP 5.5 with the token T_YIELD. + * The `yield from` keyword was introduced in PHP 7.0 and tokenizes as + * "T_YIELD T_WHITESPACE T_STRING". + * + * Pre-PHPCS 3.1.0, the T_YIELD token was not correctly back-filled for PHP < 5.5. + * Also, as of PHPCS 3.1.0, the PHPCS tokenizer adds a new T_YIELD_FROM + * token. + * + * So for PHP 5.3-5.4 icw PHPCS < 3.1.0, we need to look for T_STRING with content "yield". + * For PHP 5.5+ we need to look for T_YIELD. + * For PHPCS 3.1.0+, we also need to look for T_YIELD_FROM. + */ + if (version_compare(\PHP_VERSION_ID, '50500', '<') === true + && version_compare(PHPCSHelper::getVersion(), '3.1.0', '<') === true + ) { + $targets[] = \T_STRING; + } + + if (\defined('T_YIELD_FROM')) { + $targets[] = \T_YIELD_FROM; + } + + return $targets; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * + * @return void|int Void or a stack pointer to skip forward. + */ + public function process(File $phpcsFile, $stackPtr) + { + if ($this->supportsBelow('5.6') !== true) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === \T_STRING + && $tokens[$stackPtr]['content'] !== 'yield' + ) { + return; + } + + if (empty($tokens[$stackPtr]['conditions']) === true) { + return; + } + + // Walk the condition from inner to outer to see if we can find a valid function/closure scope. + $conditions = array_reverse($tokens[$stackPtr]['conditions'], true); + foreach ($conditions as $ptr => $type) { + if (isset($this->validConditions[$type]) === true) { + $function = $ptr; + break; + } + } + + if (isset($function) === false) { + // Yield outside function scope, fatal error, but not our concern. + return; + } + + if (isset($tokens[$function]['scope_opener'], $tokens[$function]['scope_closer']) === false) { + // Can't reliably determine start/end of function scope. + return; + } + + $targets = array(\T_RETURN, \T_CLOSURE, \T_FUNCTION, \T_CLASS); + if (\defined('T_ANON_CLASS')) { + $targets[] = \T_ANON_CLASS; + } + + $current = $tokens[$function]['scope_opener']; + + while (($current = $phpcsFile->findNext($targets, ($current + 1), $tokens[$function]['scope_closer'])) !== false) { + if ($tokens[$current]['code'] === \T_RETURN) { + $phpcsFile->addError( + 'Returning a final expression from a generator was not supported in PHP 5.6 or earlier', + $current, + 'ReturnFound' + ); + + return $tokens[$function]['scope_closer']; + } + + // Found a nested scope in which return can exist without problems. + if (isset($tokens[$current]['scope_closer'])) { + // Skip past the nested scope. + $current = $tokens[$current]['scope_closer']; + } + } + + // Don't examine this function again. + return $tokens[$function]['scope_closer']; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php new file mode 100644 index 00000000..cd40fa68 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php @@ -0,0 +1,855 @@ + array( + '4.4' => false, + '5.0' => true, + ), + 'com.code_page' => array( + '4.4' => false, + '5.0' => true, + ), + 'date.default_latitude' => array( + '4.4' => false, + '5.0' => true, + ), + 'date.default_longitude' => array( + '4.4' => false, + '5.0' => true, + ), + 'date.sunrise_zenith' => array( + '4.4' => false, + '5.0' => true, + ), + 'date.sunset_zenith' => array( + '4.4' => false, + '5.0' => true, + ), + 'ibase.default_charset' => array( + '4.4' => false, + '5.0' => true, + ), + 'ibase.default_db' => array( + '4.4' => false, + '5.0' => true, + ), + 'mail.force_extra_parameters' => array( + '4.4' => false, + '5.0' => true, + ), + 'mime_magic.debug' => array( + '4.4' => false, + '5.0' => true, + ), + 'mysqli.max_links' => array( + '4.4' => false, + '5.0' => true, + ), + 'mysqli.default_port' => array( + '4.4' => false, + '5.0' => true, + ), + 'mysqli.default_socket' => array( + '4.4' => false, + '5.0' => true, + ), + 'mysqli.default_host' => array( + '4.4' => false, + '5.0' => true, + ), + 'mysqli.default_user' => array( + '4.4' => false, + '5.0' => true, + ), + 'mysqli.default_pw' => array( + '4.4' => false, + '5.0' => true, + ), + 'report_zend_debug' => array( + '4.4' => false, + '5.0' => true, + ), + 'session.hash_bits_per_character' => array( + '4.4' => false, + '5.0' => true, + ), + 'session.hash_function' => array( + '4.4' => false, + '5.0' => true, + ), + 'soap.wsdl_cache_dir' => array( + '4.4' => false, + '5.0' => true, + ), + 'soap.wsdl_cache_enabled' => array( + '4.4' => false, + '5.0' => true, + ), + 'soap.wsdl_cache_ttl' => array( + '4.4' => false, + '5.0' => true, + ), + 'sqlite.assoc_case' => array( + '4.4' => false, + '5.0' => true, + ), + 'tidy.clean_output' => array( + '4.4' => false, + '5.0' => true, + ), + 'tidy.default_config' => array( + '4.4' => false, + '5.0' => true, + ), + 'zend.ze1_compatibility_mode' => array( + '4.4' => false, + '5.0' => true, + ), + + 'date.timezone' => array( + '5.0' => false, + '5.1' => true, + ), + 'detect_unicode' => array( + '5.0' => false, + '5.1' => true, + ), + 'fbsql.batchsize' => array( + '5.0' => false, + '5.1' => true, + 'alternative' => 'fbsql.batchSize', + ), + 'realpath_cache_size' => array( + '5.0' => false, + '5.1' => true, + ), + 'realpath_cache_ttl' => array( + '5.0' => false, + '5.1' => true, + ), + + 'mbstring.strict_detection' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + 'mssql.charset' => array( + '5.1.1' => false, + '5.1.2' => true, + ), + + 'gd.jpeg_ignore_warning' => array( + '5.1.2' => false, + '5.1.3' => true, + ), + + 'fbsql.show_timestamp_decimals' => array( + '5.1.4' => false, + '5.1.5' => true, + ), + 'soap.wsdl_cache' => array( + '5.1.4' => false, + '5.1.5' => true, + ), + 'soap.wsdl_cache_limit' => array( + '5.1.4' => false, + '5.1.5' => true, + ), + + 'allow_url_include' => array( + '5.1' => false, + '5.2' => true, + ), + 'filter.default' => array( + '5.1' => false, + '5.2' => true, + ), + 'filter.default_flags' => array( + '5.1' => false, + '5.2' => true, + ), + 'pcre.backtrack_limit' => array( + '5.1' => false, + '5.2' => true, + ), + 'pcre.recursion_limit' => array( + '5.1' => false, + '5.2' => true, + ), + 'session.cookie_httponly' => array( + '5.1' => false, + '5.2' => true, + ), + + 'cgi.check_shebang_line' => array( + '5.2.0' => false, + '5.2.1' => true, + ), + + 'max_input_nesting_level' => array( + '5.2.2' => false, + '5.2.3' => true, + ), + + 'mysqli.allow_local_infile' => array( + '5.2.3' => false, + '5.2.4' => true, + ), + + 'max_file_uploads' => array( + '5.2.11' => false, + '5.2.12' => true, + ), + + 'cgi.discard_path' => array( + '5.2' => false, + '5.3' => true, + ), + 'exit_on_timeout' => array( + '5.2' => false, + '5.3' => true, + ), + 'intl.default_locale' => array( + '5.2' => false, + '5.3' => true, + ), + 'intl.error_level' => array( + '5.2' => false, + '5.3' => true, + ), + 'mail.add_x_header' => array( + '5.2' => false, + '5.3' => true, + ), + 'mail.log' => array( + '5.2' => false, + '5.3' => true, + ), + 'mbstring.http_output_conv_mimetype' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqli.allow_persistent' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqli.cache_size' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqli.max_persistent' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqlnd.collect_memory_statistics' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqlnd.collect_statistics' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqlnd.debug' => array( + '5.2' => false, + '5.3' => true, + ), + 'mysqlnd.net_read_buffer_size' => array( + '5.2' => false, + '5.3' => true, + ), + 'odbc.default_cursortype' => array( + '5.2' => false, + '5.3' => true, + ), + 'request_order' => array( + '5.2' => false, + '5.3' => true, + ), + 'user_ini.cache_ttl' => array( + '5.2' => false, + '5.3' => true, + ), + 'user_ini.filename' => array( + '5.2' => false, + '5.3' => true, + ), + 'zend.enable_gc' => array( + '5.2' => false, + '5.3' => true, + ), + + 'curl.cainfo' => array( + '5.3.6' => false, + '5.3.7' => true, + ), + + 'max_input_vars' => array( + '5.3.8' => false, + '5.3.9' => true, + ), + + 'sqlite3.extension_dir' => array( + '5.3.10' => false, + '5.3.11' => true, + ), + + 'cli.pager' => array( + '5.3' => false, + '5.4' => true, + ), + 'cli.prompt' => array( + '5.3' => false, + '5.4' => true, + ), + 'cli_server.color' => array( + '5.3' => false, + '5.4' => true, + ), + 'enable_post_data_reading' => array( + '5.3' => false, + '5.4' => true, + ), + 'mysqlnd.mempool_default_size' => array( + '5.3' => false, + '5.4' => true, + ), + 'mysqlnd.net_cmd_buffer_size' => array( + '5.3' => false, + '5.4' => true, + ), + 'mysqlnd.net_read_timeout' => array( + '5.3' => false, + '5.4' => true, + ), + 'phar.cache_list' => array( + '5.3' => false, + '5.4' => true, + ), + 'session.upload_progress.enabled' => array( + '5.3' => false, + '5.4' => true, + ), + 'session.upload_progress.cleanup' => array( + '5.3' => false, + '5.4' => true, + ), + 'session.upload_progress.name' => array( + '5.3' => false, + '5.4' => true, + ), + 'session.upload_progress.freq' => array( + '5.3' => false, + '5.4' => true, + ), + 'session.upload_progress.min_freq' => array( + '5.3' => false, + '5.4' => true, + ), + 'session.upload_progress.prefix' => array( + '5.3' => false, + '5.4' => true, + ), + 'windows_show_crt_warning' => array( + '5.3' => false, + '5.4' => true, + ), + 'zend.detect_unicode' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => 'detect_unicode', + ), + 'zend.multibyte' => array( + '5.3' => false, + '5.4' => true, + ), + 'zend.script_encoding' => array( + '5.3' => false, + '5.4' => true, + ), + 'zend.signal_check' => array( + '5.3' => false, + '5.4' => true, + ), + 'mysqlnd.log_mask' => array( + '5.3' => false, + '5.4' => true, + ), + + 'intl.use_exceptions' => array( + '5.4' => false, + '5.5' => true, + ), + 'mysqlnd.sha256_server_public_key' => array( + '5.4' => false, + '5.5' => true, + ), + 'mysqlnd.trace_alloc' => array( + '5.4' => false, + '5.5' => true, + ), + 'sys_temp_dir' => array( + '5.4' => false, + '5.5' => true, + ), + 'xsl.security_prefs' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.enable' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.enable_cli' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.memory_consumption' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.interned_strings_buffer' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.max_accelerated_files' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.max_wasted_percentage' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.use_cwd' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.validate_timestamps' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.revalidate_freq' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.revalidate_path' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.save_comments' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.load_comments' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.fast_shutdown' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.enable_file_override' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.optimization_level' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.inherited_hack' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.dups_fix' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.blacklist_filename' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.max_file_size' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.consistency_checks' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.force_restart_timeout' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.error_log' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.log_verbosity_level' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.preferred_memory_model' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.protect_memory' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.mmap_base' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.restrict_api' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.file_update_protection' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.huge_code_pages' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.lockfile_path' => array( + '5.4' => false, + '5.5' => true, + ), + 'opcache.opt_debug_level' => array( + '5.4' => false, + '5.5' => true, + ), + + 'session.use_strict_mode' => array( + '5.5.1' => false, + '5.5.2' => true, + ), + + 'mysqli.rollback_on_cached_plink' => array( + '5.5' => false, + '5.6' => true, + ), + + 'assert.exception' => array( + '5.6' => false, + '7.0' => true, + ), + 'pcre.jit' => array( + '5.6' => false, + '7.0' => true, + ), + 'session.lazy_write' => array( + '5.6' => false, + '7.0' => true, + ), + 'zend.assertions' => array( + '5.6' => false, + '7.0' => true, + ), + 'opcache.file_cache' => array( + '5.6' => false, + '7.0' => true, + ), + 'opcache.file_cache_only' => array( + '5.6' => false, + '7.0' => true, + ), + 'opcache.file_cache_consistency_checks' => array( + '5.6' => false, + '7.0' => true, + ), + 'opcache.file_cache_fallback' => array( + '5.6' => false, + '7.0' => true, + ), // Windows only. + + 'opcache.validate_permission' => array( + '7.0.13' => false, + '7.0.14' => true, + ), + 'opcache.validate_root' => array( + '7.0.13' => false, + '7.0.14' => true, + ), + + 'hard_timeout' => array( + '7.0' => false, + '7.1' => true, + ), + 'session.sid_length' => array( + '7.0' => false, + '7.1' => true, + ), + 'session.sid_bits_per_character' => array( + '7.0' => false, + '7.1' => true, + ), + 'session.trans_sid_hosts' => array( + '7.0' => false, + '7.1' => true, + ), + 'session.trans_sid_tags' => array( + '7.0' => false, + '7.1' => true, + ), + 'url_rewriter.hosts' => array( + '7.0' => false, + '7.1' => true, + ), + + // Introduced in PHP 7.1.25, 7.2.13, 7.3.0. + 'imap.enable_insecure_rsh' => array( + '7.1.24' => false, + '7.1.25' => true, + ), + + 'syslog.facility' => array( + '7.2' => false, + '7.3' => true, + ), + 'syslog.filter' => array( + '7.2' => false, + '7.3' => true, + ), + 'syslog.ident' => array( + '7.2' => false, + '7.3' => true, + ), + 'session.cookie_samesite' => array( + '7.2' => false, + '7.3' => true, + ), + + 'ffi.enable' => array( + '7.3' => false, + '7.4' => true, + ), + 'ffi.preload' => array( + '7.3' => false, + '7.4' => true, + ), + 'opcache.cache_id' => array( + '7.3' => false, + '7.4' => true, + ), + 'opcache.preload' => array( + '7.3' => false, + '7.4' => true, + ), + 'zend.exception_ignore_args' => array( + '7.3' => false, + '7.4' => true, + ), + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * + * @return array + */ + public function register() + { + return array(\T_STRING); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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(); + + $ignore = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_CONST => true, + ); + + $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function. + return; + } + + $functionLc = strtolower($tokens[$stackPtr]['content']); + if (isset($this->iniFunctions[$functionLc]) === false) { + return; + } + + $iniToken = $this->getFunctionCallParameter($phpcsFile, $stackPtr, $this->iniFunctions[$functionLc]); + if ($iniToken === false) { + return; + } + + $filteredToken = $this->stripQuotes($iniToken['raw']); + if (isset($this->newIniDirectives[$filteredToken]) === false) { + return; + } + + $itemInfo = array( + 'name' => $filteredToken, + 'functionLc' => $functionLc, + ); + $this->handleFeature($phpcsFile, $iniToken['end'], $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newIniDirectives[$itemInfo['name']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array('alternative'); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + $errorInfo['alternative'] = ''; + + if (isset($itemArray['alternative']) === true) { + $errorInfo['alternative'] = $itemArray['alternative']; + } + + // Lower error level to warning if the function used was ini_get. + if ($errorInfo['error'] === true && $itemInfo['functionLc'] === 'ini_get') { + $errorInfo['error'] = false; + } + + return $errorInfo; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return "INI directive '%s' is not present in PHP version %s or earlier"; + } + + + /** + * Allow for concrete child classes to filter the error message before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param string $error The error message which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return string + */ + protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) + { + if ($errorInfo['alternative'] !== '') { + $error .= ". This directive was previously called '%s'."; + } + + return $error; + } + + + /** + * Allow for concrete child classes to filter the error data before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param array $data The error data array which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return array + */ + protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) + { + if ($errorInfo['alternative'] !== '') { + $data[] = $errorInfo['alternative']; + } + + return $data; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php new file mode 100644 index 00000000..a6928ae0 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php @@ -0,0 +1,424 @@ + array( + '5.1' => true, + 'alternative' => 'fbsql.batchsize', + ), + 'pfpro.defaulthost' => array( + '5.1' => true, + ), + 'pfpro.defaultport' => array( + '5.1' => true, + ), + 'pfpro.defaulttimeout' => array( + '5.1' => true, + ), + 'pfpro.proxyaddress' => array( + '5.1' => true, + ), + 'pfpro.proxyport' => array( + '5.1' => true, + ), + 'pfpro.proxylogon' => array( + '5.1' => true, + ), + 'pfpro.proxypassword' => array( + '5.1' => true, + ), + + 'ifx.allow_persistent' => array( + '5.2.1' => true, + ), + 'ifx.blobinfile' => array( + '5.2.1' => true, + ), + 'ifx.byteasvarchar' => array( + '5.2.1' => true, + ), + 'ifx.charasvarchar' => array( + '5.2.1' => true, + ), + 'ifx.default_host' => array( + '5.2.1' => true, + ), + 'ifx.default_password' => array( + '5.2.1' => true, + ), + 'ifx.default_user' => array( + '5.2.1' => true, + ), + 'ifx.max_links' => array( + '5.2.1' => true, + ), + 'ifx.max_persistent' => array( + '5.2.1' => true, + ), + 'ifx.nullformat' => array( + '5.2.1' => true, + ), + 'ifx.textasvarchar' => array( + '5.2.1' => true, + ), + + 'zend.ze1_compatibility_mode' => array( + '5.3' => true, + ), + + 'allow_call_time_pass_reference' => array( + '5.3' => false, + '5.4' => true, + ), + 'define_syslog_variables' => array( + '5.3' => false, + '5.4' => true, + ), + 'detect_unicode' => array( + '5.4' => true, + 'alternative' => 'zend.detect_unicode', + ), + 'highlight.bg' => array( + '5.3' => false, + '5.4' => true, + ), + 'magic_quotes_gpc' => array( + '5.3' => false, + '5.4' => true, + ), + 'magic_quotes_runtime' => array( + '5.3' => false, + '5.4' => true, + ), + 'magic_quotes_sybase' => array( + '5.3' => false, + '5.4' => true, + ), + 'mbstring.script_encoding' => array( + '5.4' => true, + 'alternative' => 'zend.script_encoding', + ), + 'register_globals' => array( + '5.3' => false, + '5.4' => true, + ), + 'register_long_arrays' => array( + '5.3' => false, + '5.4' => true, + ), + 'safe_mode' => array( + '5.3' => false, + '5.4' => true, + ), + 'safe_mode_allowed_env_vars' => array( + '5.3' => false, + '5.4' => true, + ), + 'safe_mode_exec_dir' => array( + '5.3' => false, + '5.4' => true, + ), + 'safe_mode_gid' => array( + '5.3' => false, + '5.4' => true, + ), + 'safe_mode_include_dir' => array( + '5.3' => false, + '5.4' => true, + ), + 'safe_mode_protected_env_vars' => array( + '5.3' => false, + '5.4' => true, + ), + 'session.bug_compat_42' => array( + '5.3' => false, + '5.4' => true, + ), + 'session.bug_compat_warn' => array( + '5.3' => false, + '5.4' => true, + ), + 'y2k_compliance' => array( + '5.3' => false, + '5.4' => true, + ), + + 'always_populate_raw_post_data' => array( + '5.6' => false, + '7.0' => true, + ), + 'iconv.input_encoding' => array( + '5.6' => false, + ), + 'iconv.output_encoding' => array( + '5.6' => false, + ), + 'iconv.internal_encoding' => array( + '5.6' => false, + ), + 'mbstring.http_input' => array( + '5.6' => false, + ), + 'mbstring.http_output' => array( + '5.6' => false, + ), + 'mbstring.internal_encoding' => array( + '5.6' => false, + ), + + 'asp_tags' => array( + '7.0' => true, + ), + 'xsl.security_prefs' => array( + '7.0' => true, + ), + 'opcache.load_comments' => array( + '7.0' => true, + ), + + 'mcrypt.algorithms_dir' => array( + '7.1' => false, + '7.2' => true, + ), + 'mcrypt.modes_dir' => array( + '7.1' => false, + '7.2' => true, + ), + 'session.entropy_file' => array( + '7.1' => true, + ), + 'session.entropy_length' => array( + '7.1' => true, + ), + 'session.hash_function' => array( + '7.1' => true, + ), + 'session.hash_bits_per_character' => array( + '7.1' => true, + ), + + 'mbstring.func_overload' => array( + '7.2' => false, + ), + 'sql.safe_mode' => array( + '7.2' => true, + ), + 'track_errors' => array( + '7.2' => false, + ), + 'opcache.fast_shutdown' => array( + '7.2' => true, + ), + + 'birdstep.max_links' => array( + '7.3' => true, + ), + 'opcache.inherited_hack' => array( + '5.3' => false, // Soft deprecated, i.e. ignored. + '7.3' => true, + ), + 'pdo_odbc.db2_instance_name' => array( + '7.3' => false, // Has been marked as deprecated in the manual from before this time. Now hard-deprecated. + ), + + 'allow_url_include' => array( + '7.4' => false, + ), + 'ibase.allow_persistent' => array( + '7.4' => true, + ), + 'ibase.max_persistent' => array( + '7.4' => true, + ), + 'ibase.max_links' => array( + '7.4' => true, + ), + 'ibase.default_db' => array( + '7.4' => true, + ), + 'ibase.default_user' => array( + '7.4' => true, + ), + 'ibase.default_password' => array( + '7.4' => true, + ), + 'ibase.default_charset' => array( + '7.4' => true, + ), + 'ibase.timestampformat' => array( + '7.4' => true, + ), + 'ibase.dateformat' => array( + '7.4' => true, + ), + 'ibase.timeformat' => array( + '7.4' => true, + ), + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * + * @return array + */ + public function register() + { + return array(\T_STRING); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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(); + + $ignore = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_CONST => true, + ); + + $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function. + return; + } + + $functionLc = strtolower($tokens[$stackPtr]['content']); + if (isset($this->iniFunctions[$functionLc]) === false) { + return; + } + + $iniToken = $this->getFunctionCallParameter($phpcsFile, $stackPtr, $this->iniFunctions[$functionLc]); + if ($iniToken === false) { + return; + } + + $filteredToken = $this->stripQuotes($iniToken['raw']); + if (isset($this->deprecatedIniDirectives[$filteredToken]) === false) { + return; + } + + $itemInfo = array( + 'name' => $filteredToken, + 'functionLc' => $functionLc, + ); + $this->handleFeature($phpcsFile, $iniToken['end'], $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->deprecatedIniDirectives[$itemInfo['name']]; + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + + // Lower error level to warning if the function used was ini_get. + if ($errorInfo['error'] === true && $itemInfo['functionLc'] === 'ini_get') { + $errorInfo['error'] = false; + } + + return $errorInfo; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return "INI directive '%s' is "; + } + + + /** + * Get the error message template for suggesting an alternative for a specific sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getAlternativeOptionTemplate() + { + return str_replace('%s', "'%s'", parent::getAlternativeOptionTemplate()); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php new file mode 100644 index 00000000..c9c2225f --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php @@ -0,0 +1,82 @@ +supportsBelow('5.5') !== true) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $find = array( + \T_ARRAY => \T_ARRAY, + \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, + ); + + while (($hasArray = $phpcsFile->findNext($find, ($stackPtr + 1), null, false, null, true)) !== false) { + $phpcsFile->addError( + 'Constant arrays using the "const" keyword are not allowed in PHP 5.5 or earlier', + $hasArray, + 'Found' + ); + + // Skip past the content of the array. + $stackPtr = $hasArray; + if ($tokens[$hasArray]['code'] === \T_OPEN_SHORT_ARRAY && isset($tokens[$hasArray]['bracket_closer'])) { + $stackPtr = $tokens[$hasArray]['bracket_closer']; + } elseif ($tokens[$hasArray]['code'] === \T_ARRAY && isset($tokens[$hasArray]['parenthesis_closer'])) { + $stackPtr = $tokens[$hasArray]['parenthesis_closer']; + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php new file mode 100644 index 00000000..7b996728 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php @@ -0,0 +1,101 @@ +supportsBelow('5.6') !== true) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $ignore = array( + \T_DOUBLE_COLON => true, + \T_OBJECT_OPERATOR => true, + \T_FUNCTION => true, + \T_CONST => true, + ); + + $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function. + return; + } + + $functionLc = strtolower($tokens[$stackPtr]['content']); + if ($functionLc !== 'define') { + return; + } + + $secondParam = $this->getFunctionCallParameter($phpcsFile, $stackPtr, 2); + if (isset($secondParam['start'], $secondParam['end']) === false) { + return; + } + + $targetNestingLevel = 0; + if (isset($tokens[$secondParam['start']]['nested_parenthesis'])) { + $targetNestingLevel = \count($tokens[$secondParam['start']]['nested_parenthesis']); + } + + $array = $phpcsFile->findNext(array(\T_ARRAY, \T_OPEN_SHORT_ARRAY), $secondParam['start'], ($secondParam['end'] + 1)); + if ($array !== false) { + if ((isset($tokens[$array]['nested_parenthesis']) === false && $targetNestingLevel === 0) || \count($tokens[$array]['nested_parenthesis']) === $targetNestingLevel) { + $phpcsFile->addError( + 'Constant arrays using define are not allowed in PHP 5.6 or earlier', + $array, + 'Found' + ); + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php new file mode 100644 index 00000000..8e1cddca --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php @@ -0,0 +1,556 @@ + 'when defining constants using the const keyword', + 'property' => 'in property declarations', + 'staticvar' => 'in static variable declarations', + 'default' => 'in default function arguments', + ); + + /** + * Tokens which were allowed to be used in these declarations prior to PHP 5.6. + * + * This list will be enriched in the setProperties() method. + * + * @since 8.2.0 + * + * @var array + */ + protected $safeOperands = array( + \T_LNUMBER => \T_LNUMBER, + \T_DNUMBER => \T_DNUMBER, + \T_CONSTANT_ENCAPSED_STRING => \T_CONSTANT_ENCAPSED_STRING, + \T_TRUE => \T_TRUE, + \T_FALSE => \T_FALSE, + \T_NULL => \T_NULL, + + \T_LINE => \T_LINE, + \T_FILE => \T_FILE, + \T_DIR => \T_DIR, + \T_FUNC_C => \T_FUNC_C, + \T_CLASS_C => \T_CLASS_C, + \T_TRAIT_C => \T_TRAIT_C, + \T_METHOD_C => \T_METHOD_C, + \T_NS_C => \T_NS_C, + + // Special cases: + \T_NS_SEPARATOR => \T_NS_SEPARATOR, + /* + * This can be neigh anything, but for any usage except constants, + * the T_STRING will be combined with non-allowed tokens, so we should be good. + */ + \T_STRING => \T_STRING, + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.2.0 + * + * @return array + */ + public function register() + { + // Set the properties up only once. + $this->setProperties(); + + return array( + \T_CONST, + \T_VARIABLE, + \T_FUNCTION, + \T_CLOSURE, + \T_STATIC, + ); + } + + + /** + * Make some adjustments to the $safeOperands property. + * + * @since 8.2.0 + * + * @return void + */ + public function setProperties() + { + $this->safeOperands += Tokens::$heredocTokens; + $this->safeOperands += Tokens::$emptyTokens; + } + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 8.2.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('5.5') !== true); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * + * @return void|int Null or integer stack pointer to skip forward. + */ + public function process(File $phpcsFile, $stackPtr) + { + if ($this->bowOutEarly() === true) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + switch ($tokens[$stackPtr]['type']) { + case 'T_FUNCTION': + case 'T_CLOSURE': + $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); + if (empty($params)) { + // No parameters. + return; + } + + $funcToken = $tokens[$stackPtr]; + + if (isset($funcToken['parenthesis_owner'], $funcToken['parenthesis_opener'], $funcToken['parenthesis_closer']) === false + || $funcToken['parenthesis_owner'] !== $stackPtr + || isset($tokens[$funcToken['parenthesis_opener']], $tokens[$funcToken['parenthesis_closer']]) === false + ) { + // Hmm.. something is going wrong as these should all be available & valid. + return; + } + + $opener = $funcToken['parenthesis_opener']; + $closer = $funcToken['parenthesis_closer']; + + // Which nesting level is the one we are interested in ? + $nestedParenthesisCount = 1; + if (isset($tokens[$opener]['nested_parenthesis'])) { + $nestedParenthesisCount += \count($tokens[$opener]['nested_parenthesis']); + } + + foreach ($params as $param) { + if (isset($param['default']) === false) { + continue; + } + + $end = $param['token']; + while (($end = $phpcsFile->findNext(array(\T_COMMA, \T_CLOSE_PARENTHESIS), ($end + 1), ($closer + 1))) !== false) { + $maybeSkipTo = $this->isRealEndOfDeclaration($tokens, $end, $nestedParenthesisCount); + if ($maybeSkipTo !== true) { + $end = $maybeSkipTo; + continue; + } + + // Ignore closing parenthesis/bracket if not 'ours'. + if ($tokens[$end]['code'] === \T_CLOSE_PARENTHESIS && $end !== $closer) { + continue; + } + + // Ok, we've found the end of the param default value declaration. + break; + } + + if ($this->isValidAssignment($phpcsFile, $param['token'], $end) === false) { + $this->throwError($phpcsFile, $param['token'], 'default', $param['content']); + } + } + + /* + * No need for the sniff to be triggered by the T_VARIABLEs in the function + * definition as we've already examined them above, so let's skip over them. + */ + return $closer; + + case 'T_VARIABLE': + case 'T_STATIC': + case 'T_CONST': + $type = 'const'; + + // Filter out non-property declarations. + if ($tokens[$stackPtr]['code'] === \T_VARIABLE) { + if ($this->isClassProperty($phpcsFile, $stackPtr) === false) { + return; + } + + $type = 'property'; + + // Move back one token to have the same starting point as the others. + $stackPtr = ($stackPtr - 1); + } + + // Filter out late static binding and class properties. + if ($tokens[$stackPtr]['code'] === \T_STATIC) { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); + if ($next === false || $tokens[$next]['code'] !== \T_VARIABLE) { + // Late static binding. + return; + } + + if ($this->isClassProperty($phpcsFile, $next) === true) { + // Class properties are examined based on the T_VARIABLE token. + return; + } + unset($next); + + $type = 'staticvar'; + } + + $endOfStatement = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($stackPtr + 1)); + if ($endOfStatement === false) { + // No semi-colon - live coding. + return; + } + + $targetNestingLevel = 0; + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $targetNestingLevel = \count($tokens[$stackPtr]['nested_parenthesis']); + } + + // Examine each variable/constant in multi-declarations. + $start = $stackPtr; + $end = $stackPtr; + while (($end = $phpcsFile->findNext(array(\T_COMMA, \T_SEMICOLON, \T_OPEN_SHORT_ARRAY, \T_CLOSE_TAG), ($end + 1), ($endOfStatement + 1))) !== false) { + + $maybeSkipTo = $this->isRealEndOfDeclaration($tokens, $end, $targetNestingLevel); + if ($maybeSkipTo !== true) { + $end = $maybeSkipTo; + continue; + } + + $start = $phpcsFile->findNext(Tokens::$emptyTokens, ($start + 1), $end, true); + if ($start === false + || ($tokens[$stackPtr]['code'] === \T_CONST && $tokens[$start]['code'] !== \T_STRING) + || ($tokens[$stackPtr]['code'] !== \T_CONST && $tokens[$start]['code'] !== \T_VARIABLE) + ) { + // Shouldn't be possible. + continue; + } + + if ($this->isValidAssignment($phpcsFile, $start, $end) === false) { + // Create the "found" snippet. + $content = ''; + $tokenCount = ($end - $start); + if ($tokenCount < 20) { + // Prevent large arrays from being added to the error message. + $content = $phpcsFile->getTokensAsString($start, ($tokenCount + 1)); + } + + $this->throwError($phpcsFile, $start, $type, $content); + } + + $start = $end; + } + + // Skip to the end of the statement to prevent duplicate messages for multi-declarations. + return $endOfStatement; + } + } + + + /** + * Is a value declared and is the value declared valid pre-PHP 5.6 ? + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param int $end The end of the value definition. + * This will normally be a comma or semi-colon. + * + * @return bool + */ + protected function isValidAssignment(File $phpcsFile, $stackPtr, $end) + { + $tokens = $phpcsFile->getTokens(); + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), $end, true); + if ($next === false || $tokens[$next]['code'] !== \T_EQUAL) { + // No value assigned. + return true; + } + + return $this->isStaticValue($phpcsFile, $tokens, ($next + 1), ($end - 1)); + } + + + /** + * Is a value declared and is the value declared constant as accepted in PHP 5.5 and lower ? + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param array $tokens The token stack of the current file. + * @param int $start The stackPtr from which to start examining. + * @param int $end The end of the value definition (inclusive), + * i.e. this token will be examined as part of + * the snippet. + * @param int $nestedArrays Optional. Array nesting level when examining + * the content of an array. + * + * @return bool + */ + protected function isStaticValue(File $phpcsFile, $tokens, $start, $end, $nestedArrays = 0) + { + $nextNonSimple = $phpcsFile->findNext($this->safeOperands, $start, ($end + 1), true); + if ($nextNonSimple === false) { + return true; + } + + /* + * OK, so we have at least one token which needs extra examination. + */ + switch ($tokens[$nextNonSimple]['code']) { + case \T_MINUS: + case \T_PLUS: + if ($this->isNumber($phpcsFile, $start, $end, true) !== false) { + // Int or float with sign. + return true; + } + + return false; + + case \T_NAMESPACE: + case \T_PARENT: + case \T_SELF: + case \T_DOUBLE_COLON: + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonSimple + 1), ($end + 1), true); + + if ($tokens[$nextNonSimple]['code'] === \T_NAMESPACE) { + // Allow only `namespace\...`. + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_NS_SEPARATOR) { + return false; + } + } elseif ($tokens[$nextNonSimple]['code'] === \T_PARENT + || $tokens[$nextNonSimple]['code'] === \T_SELF + ) { + // Allow only `parent::` and `self::`. + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_DOUBLE_COLON) { + return false; + } + } elseif ($tokens[$nextNonSimple]['code'] === \T_DOUBLE_COLON) { + // Allow only `T_STRING::T_STRING`. + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { + return false; + } + + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextNonSimple - 1), null, true); + // No need to worry about parent/self, that's handled above and + // the double colon is skipped over in that case. + if ($prevNonEmpty === false || $tokens[$prevNonEmpty]['code'] !== \T_STRING) { + return false; + } + } + + // Examine what comes after the namespace/parent/self/double colon, if anything. + return $this->isStaticValue($phpcsFile, $tokens, ($nextNonEmpty + 1), $end, $nestedArrays); + + case \T_ARRAY: + case \T_OPEN_SHORT_ARRAY: + ++$nestedArrays; + + $arrayItems = $this->getFunctionCallParameters($phpcsFile, $nextNonSimple); + if (empty($arrayItems) === false) { + foreach ($arrayItems as $item) { + // Check for a double arrow, but only if it's for this array item, not for a nested array. + $doubleArrow = false; + + $maybeDoubleArrow = $phpcsFile->findNext( + array(\T_DOUBLE_ARROW, \T_ARRAY, \T_OPEN_SHORT_ARRAY), + $item['start'], + ($item['end'] + 1) + ); + if ($maybeDoubleArrow !== false && $tokens[$maybeDoubleArrow]['code'] === \T_DOUBLE_ARROW) { + // Double arrow is for this nesting level. + $doubleArrow = $maybeDoubleArrow; + } + + if ($doubleArrow === false) { + if ($this->isStaticValue($phpcsFile, $tokens, $item['start'], $item['end'], $nestedArrays) === false) { + return false; + } + + } else { + // Examine array key. + if ($this->isStaticValue($phpcsFile, $tokens, $item['start'], ($doubleArrow - 1), $nestedArrays) === false) { + return false; + } + + // Examine array value. + if ($this->isStaticValue($phpcsFile, $tokens, ($doubleArrow + 1), $item['end'], $nestedArrays) === false) { + return false; + } + } + } + } + + --$nestedArrays; + + /* + * Find the end of the array. + * We already know we will have a valid closer as otherwise we wouldn't have been + * able to get the array items. + */ + $closer = ($nextNonSimple + 1); + if ($tokens[$nextNonSimple]['code'] === \T_OPEN_SHORT_ARRAY + && isset($tokens[$nextNonSimple]['bracket_closer']) === true + ) { + $closer = $tokens[$nextNonSimple]['bracket_closer']; + } else { + $maybeOpener = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonSimple + 1), ($end + 1), true); + if ($tokens[$maybeOpener]['code'] === \T_OPEN_PARENTHESIS) { + $opener = $maybeOpener; + if (isset($tokens[$opener]['parenthesis_closer']) === true) { + $closer = $tokens[$opener]['parenthesis_closer']; + } + } + } + + if ($closer === $end) { + return true; + } + + // Examine what comes after the array, if anything. + return $this->isStaticValue($phpcsFile, $tokens, ($closer + 1), $end, $nestedArrays); + + } + + // Ok, so this unsafe token was not one of the exceptions, i.e. this is a PHP 5.6+ syntax. + return false; + } + + + /** + * Throw an error if a scalar expression is found. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token to link the error to. + * @param string $type Type of usage found. + * @param string $content Optional. The value for the declaration as found. + * + * @return void + */ + protected function throwError(File $phpcsFile, $stackPtr, $type, $content = '') + { + $error = static::ERROR_PHRASE; + $phrase = ''; + $errorCode = 'Found'; + + if (isset($this->errorPhrases[$type]) === true) { + $errorCode = $this->stringToErrorCode($type) . 'Found'; + $phrase = $this->errorPhrases[$type]; + } + + $data = array($phrase); + + if (empty($content) === false) { + $error .= ' Found: %s'; + $data[] = $content; + } + + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } + + + /** + * Helper function to find the end of multi variable/constant declarations. + * + * Checks whether a certain part of a declaration needs to be skipped over or + * if it is the real end of the declaration. + * + * @since 8.2.0 + * + * @param array $tokens Token stack of the current file. + * @param int $endPtr The token to examine as a candidate end pointer. + * @param int $targetLevel Target nesting level. + * + * @return bool|int True if this is the real end. Int stackPtr to skip to if not. + */ + private function isRealEndOfDeclaration($tokens, $endPtr, $targetLevel) + { + // Ignore anything within short array definition brackets for now. + if ($tokens[$endPtr]['code'] === \T_OPEN_SHORT_ARRAY + && (isset($tokens[$endPtr]['bracket_opener']) + && $tokens[$endPtr]['bracket_opener'] === $endPtr) + && isset($tokens[$endPtr]['bracket_closer']) + ) { + // Skip forward to the end of the short array definition. + return $tokens[$endPtr]['bracket_closer']; + } + + // Skip past comma's at a lower nesting level. + if ($tokens[$endPtr]['code'] === \T_COMMA) { + // Check if a comma is at the nesting level we're targetting. + $nestingLevel = 0; + if (isset($tokens[$endPtr]['nested_parenthesis']) === true) { + $nestingLevel = \count($tokens[$endPtr]['nested_parenthesis']); + } + if ($nestingLevel > $targetLevel) { + return $endPtr; + } + } + + return true; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php new file mode 100644 index 00000000..406237a5 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php @@ -0,0 +1,100 @@ + 'constants', + 'property' => 'class properties', + 'staticvar' => 'static variables', + 'default' => 'default parameter values', + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 8.2.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('5.2') !== true); + } + + + /** + * Is a value declared and does the declared value not contain an heredoc ? + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param int $end The end of the value definition. + * + * @return bool True if no heredoc (or assignment) is found, false otherwise. + */ + protected function isValidAssignment(File $phpcsFile, $stackPtr, $end) + { + $tokens = $phpcsFile->getTokens(); + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), $end, true); + if ($next === false || $tokens[$next]['code'] !== \T_EQUAL) { + // No value assigned. + return true; + } + + return ($phpcsFile->findNext(\T_START_HEREDOC, ($next + 1), $end, false, null, true) === false); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php new file mode 100644 index 00000000..e154a603 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php @@ -0,0 +1,103 @@ + string) + */ + protected $internalInterfaces = array( + 'Traversable' => 'shouldn\'t be implemented directly, implement the Iterator or IteratorAggregate interface instead.', + 'DateTimeInterface' => 'is intended for type hints only and is not implementable.', + 'Throwable' => 'cannot be implemented directly, extend the Exception class instead.', + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.3 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of interface names. + $this->internalInterfaces = $this->arrayKeysToLowercase($this->internalInterfaces); + + $targets = array(\T_CLASS); + + if (\defined('T_ANON_CLASS')) { + $targets[] = \T_ANON_CLASS; + } + + return $targets; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_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) + { + $interfaces = PHPCSHelper::findImplementedInterfaceNames($phpcsFile, $stackPtr); + + if (\is_array($interfaces) === false || $interfaces === array()) { + return; + } + + foreach ($interfaces as $interface) { + $interface = ltrim($interface, '\\'); + $interfaceLc = strtolower($interface); + if (isset($this->internalInterfaces[$interfaceLc]) === true) { + $error = 'The interface %s %s'; + $errorCode = $this->stringToErrorCode($interfaceLc) . 'Found'; + $data = array( + $interface, + $this->internalInterfaces[$interfaceLc], + ); + + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php new file mode 100644 index 00000000..35c5939b --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php @@ -0,0 +1,362 @@ + array(string => bool)) + */ + protected $newInterfaces = array( + 'Traversable' => array( + '4.4' => false, + '5.0' => true, + ), + 'Reflector' => array( + '4.4' => false, + '5.0' => true, + ), + + 'Countable' => array( + '5.0' => false, + '5.1' => true, + ), + 'OuterIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'RecursiveIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'SeekableIterator' => array( + '5.0' => false, + '5.1' => true, + ), + 'Serializable' => array( + '5.0' => false, + '5.1' => true, + ), + 'SplObserver' => array( + '5.0' => false, + '5.1' => true, + ), + 'SplSubject' => array( + '5.0' => false, + '5.1' => true, + ), + + 'JsonSerializable' => array( + '5.3' => false, + '5.4' => true, + ), + 'SessionHandlerInterface' => array( + '5.3' => false, + '5.4' => true, + ), + + 'DateTimeInterface' => array( + '5.4' => false, + '5.5' => true, + ), + + 'SessionIdInterface' => array( + '5.5.0' => false, + '5.5.1' => true, + ), + + 'Throwable' => array( + '5.6' => false, + '7.0' => true, + ), + 'SessionUpdateTimestampHandlerInterface' => array( + '5.6' => false, + '7.0' => true, + ), + ); + + /** + * A list of methods which cannot be used in combination with particular interfaces. + * + * @since 7.0.3 + * + * @var array(string => array(string => string)) + */ + protected $unsupportedMethods = array( + 'Serializable' => array( + '__sleep' => 'https://www.php.net/serializable', + '__wakeup' => 'https://www.php.net/serializable', + ), + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.3 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of interface names. + $this->newInterfaces = $this->arrayKeysToLowercase($this->newInterfaces); + $this->unsupportedMethods = $this->arrayKeysToLowercase($this->unsupportedMethods); + + $targets = array( + \T_CLASS, + \T_FUNCTION, + \T_CLOSURE, + ); + + if (\defined('T_ANON_CLASS')) { + $targets[] = \T_ANON_CLASS; + } + + if (\defined('T_RETURN_TYPE')) { + $targets[] = \T_RETURN_TYPE; + } + + return $targets; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_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(); + + switch ($tokens[$stackPtr]['type']) { + case 'T_CLASS': + case 'T_ANON_CLASS': + $this->processClassToken($phpcsFile, $stackPtr); + break; + + case 'T_FUNCTION': + case 'T_CLOSURE': + $this->processFunctionToken($phpcsFile, $stackPtr); + + // Deal with older PHPCS versions which don't recognize return type hints + // as well as newer PHPCS versions (3.3.0+) where the tokenization has changed. + $returnTypeHint = $this->getReturnTypeHintToken($phpcsFile, $stackPtr); + if ($returnTypeHint !== false) { + $this->processReturnTypeToken($phpcsFile, $returnTypeHint); + } + break; + + case 'T_RETURN_TYPE': + $this->processReturnTypeToken($phpcsFile, $stackPtr); + break; + + default: + // Deliberately left empty. + break; + } + } + + + /** + * Processes this test for when a class token is encountered. + * + * - Detect classes implementing the new interfaces. + * - Detect classes implementing the new interfaces with unsupported functions. + * + * @since 7.1.4 Split off from the `process()` method. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + private function processClassToken(File $phpcsFile, $stackPtr) + { + $interfaces = PHPCSHelper::findImplementedInterfaceNames($phpcsFile, $stackPtr); + + if (\is_array($interfaces) === false || $interfaces === array()) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $checkMethods = false; + + if (isset($tokens[$stackPtr]['scope_closer'])) { + $checkMethods = true; + $scopeCloser = $tokens[$stackPtr]['scope_closer']; + } + + foreach ($interfaces as $interface) { + $interface = ltrim($interface, '\\'); + $interfaceLc = strtolower($interface); + + if (isset($this->newInterfaces[$interfaceLc]) === true) { + $itemInfo = array( + 'name' => $interface, + 'nameLc' => $interfaceLc, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + if ($checkMethods === true && isset($this->unsupportedMethods[$interfaceLc]) === true) { + $nextFunc = $stackPtr; + while (($nextFunc = $phpcsFile->findNext(\T_FUNCTION, ($nextFunc + 1), $scopeCloser)) !== false) { + $funcName = $phpcsFile->getDeclarationName($nextFunc); + $funcNameLc = strtolower($funcName); + if ($funcNameLc === '') { + continue; + } + + if (isset($this->unsupportedMethods[$interfaceLc][$funcNameLc]) === true) { + $error = 'Classes that implement interface %s do not support the method %s(). See %s'; + $errorCode = $this->stringToErrorCode($interface) . 'UnsupportedMethod'; + $data = array( + $interface, + $funcName, + $this->unsupportedMethods[$interfaceLc][$funcNameLc], + ); + + $phpcsFile->addError($error, $nextFunc, $errorCode, $data); + } + } + } + } + } + + + /** + * Processes this test for when a function token is encountered. + * + * - Detect new interfaces when used as a type hint. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + private function processFunctionToken(File $phpcsFile, $stackPtr) + { + $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); + if (empty($typeHints) || \is_array($typeHints) === false) { + return; + } + + foreach ($typeHints as $hint) { + + $typeHintLc = strtolower($hint); + + if (isset($this->newInterfaces[$typeHintLc]) === true) { + $itemInfo = array( + 'name' => $hint, + 'nameLc' => $typeHintLc, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + } + } + + + /** + * Processes this test for when a return type token is encountered. + * + * - Detect new interfaces when used as a return type declaration. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + private function processReturnTypeToken(File $phpcsFile, $stackPtr) + { + $returnTypeHint = $this->getReturnTypeHintName($phpcsFile, $stackPtr); + if (empty($returnTypeHint)) { + return; + } + + $returnTypeHint = ltrim($returnTypeHint, '\\'); + $returnTypeHintLc = strtolower($returnTypeHint); + + if (isset($this->newInterfaces[$returnTypeHintLc]) === false) { + return; + } + + // Still here ? Then this is a return type declaration using a new interface. + $itemInfo = array( + 'name' => $returnTypeHint, + 'nameLc' => $returnTypeHintLc, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newInterfaces[$itemInfo['nameLc']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The built-in interface ' . parent::getErrorMsgTemplate(); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php new file mode 100644 index 00000000..64002b4d --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php @@ -0,0 +1,76 @@ +supportsBelow('5.4') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $tokenContentLC = strtolower($tokens[$stackPtr]['content']); + + if ($tokenContentLC !== $tokens[$stackPtr]['content']) { + $phpcsFile->addError( + 'The keyword \'%s\' was treated in a case-sensitive fashion in certain cases in PHP 5.4 or earlier. Use the lowercase version for consistent support.', + $stackPtr, + 'NonLowercaseFound', + array($tokenContentLC) + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php new file mode 100644 index 00000000..7f4411bc --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php @@ -0,0 +1,259 @@ + '7.0', + \T_TRUE => '7.0', + \T_FALSE => '7.0', + ); + + /** + * T_STRING keywords to recognize as forbidden names. + * + * @since 7.0.8 + * + * @var array + */ + protected $forbiddenNames = array( + 'null' => '7.0', + 'true' => '7.0', + 'false' => '7.0', + 'bool' => '7.0', + 'int' => '7.0', + 'float' => '7.0', + 'string' => '7.0', + 'iterable' => '7.1', + 'void' => '7.1', + 'object' => '7.2', + ); + + /** + * T_STRING keywords to recognize as soft reserved names. + * + * Using any of these keywords to name a class, interface, trait or namespace + * is highly discouraged since they may be used in future versions of PHP. + * + * @since 7.0.8 + * + * @var array + */ + protected $softReservedNames = array( + 'resource' => '7.0', + 'object' => '7.0', + 'mixed' => '7.0', + 'numeric' => '7.0', + ); + + /** + * Combined list of the two lists above. + * + * Used for quick check whether or not something is a reserved + * word. + * Set from the `register()` method. + * + * @since 7.0.8 + * + * @var array + */ + private $allForbiddenNames = array(); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.8 + * + * @return array + */ + public function register() + { + // Do the list merge only once. + $this->allForbiddenNames = array_merge($this->forbiddenNames, $this->softReservedNames); + + $targets = array( + \T_CLASS, + \T_INTERFACE, + \T_TRAIT, + \T_NAMESPACE, + \T_STRING, // Compat for PHPCS < 2.4.0 and PHP < 5.3. + ); + + return $targets; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.8 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $tokenCode = $tokens[$stackPtr]['code']; + $tokenType = $tokens[$stackPtr]['type']; + $tokenContentLc = strtolower($tokens[$stackPtr]['content']); + + // For string tokens we only care about 'trait' as that is the only one + // which may not be correctly recognized as it's own token. + // This only happens in older versions of PHP where the token doesn't exist yet as a keyword. + if ($tokenCode === \T_STRING && $tokenContentLc !== 'trait') { + return; + } + + if (\in_array($tokenType, array('T_CLASS', 'T_INTERFACE', 'T_TRAIT'), true)) { + // Check for the declared name being a name which is not tokenized as T_STRING. + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty !== false && isset($this->forbiddenTokens[$tokens[$nextNonEmpty]['code']]) === true) { + $name = $tokens[$nextNonEmpty]['content']; + } else { + // Get the declared name if it's a T_STRING. + $name = $phpcsFile->getDeclarationName($stackPtr); + } + unset($nextNonEmpty); + + if (isset($name) === false || \is_string($name) === false || $name === '') { + return; + } + + $nameLc = strtolower($name); + if (isset($this->allForbiddenNames[$nameLc]) === false) { + return; + } + + } elseif ($tokenCode === \T_NAMESPACE) { + $namespaceName = $this->getDeclaredNamespaceName($phpcsFile, $stackPtr); + + if ($namespaceName === false || $namespaceName === '') { + return; + } + + $namespaceParts = explode('\\', $namespaceName); + foreach ($namespaceParts as $namespacePart) { + $partLc = strtolower($namespacePart); + if (isset($this->allForbiddenNames[$partLc]) === true) { + $name = $namespacePart; + $nameLc = $partLc; + break; + } + } + } elseif ($tokenCode === \T_STRING) { + // Traits which are not yet tokenized as T_TRAIT. + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + return; + } + + $nextNonEmptyCode = $tokens[$nextNonEmpty]['code']; + + if ($nextNonEmptyCode !== \T_STRING && isset($this->forbiddenTokens[$nextNonEmptyCode]) === true) { + $name = $tokens[$nextNonEmpty]['content']; + $nameLc = strtolower($tokens[$nextNonEmpty]['content']); + } elseif ($nextNonEmptyCode === \T_STRING) { + $endOfStatement = $phpcsFile->findNext(array(\T_SEMICOLON, \T_OPEN_CURLY_BRACKET), ($stackPtr + 1)); + if ($endOfStatement === false) { + return; + } + + do { + $nextNonEmptyLc = strtolower($tokens[$nextNonEmpty]['content']); + + if (isset($this->allForbiddenNames[$nextNonEmptyLc]) === true) { + $name = $tokens[$nextNonEmpty]['content']; + $nameLc = $nextNonEmptyLc; + break; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), $endOfStatement, true); + } while ($nextNonEmpty !== false); + } + unset($nextNonEmptyCode, $nextNonEmptyLc, $endOfStatement); + } + + if (isset($name, $nameLc) === false) { + return; + } + + // Still here, so this is one of the reserved words. + // Build up the error message. + $error = "'%s' is a"; + $isError = null; + $errorCode = $this->stringToErrorCode($nameLc) . 'Found'; + $data = array( + $nameLc, + ); + + if (isset($this->softReservedNames[$nameLc]) === true + && $this->supportsAbove($this->softReservedNames[$nameLc]) === true + ) { + $error .= ' soft reserved keyword as of PHP version %s'; + $isError = false; + $data[] = $this->softReservedNames[$nameLc]; + } + + if (isset($this->forbiddenNames[$nameLc]) === true + && $this->supportsAbove($this->forbiddenNames[$nameLc]) === true + ) { + if (isset($isError) === true) { + $error .= ' and a'; + } + $error .= ' reserved keyword as of PHP version %s'; + $isError = true; + $data[] = $this->forbiddenNames[$nameLc]; + } + + if (isset($isError) === true) { + $error .= ' and should not be used to name a class, interface or trait or as part of a namespace (%s)'; + $data[] = $tokens[$stackPtr]['type']; + + $this->addMessage($phpcsFile, $error, $stackPtr, $isError, $errorCode, $data); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsInvokedFunctionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsInvokedFunctionsSniff.php new file mode 100644 index 00000000..c1c38281 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsInvokedFunctionsSniff.php @@ -0,0 +1,188 @@ + '5.0', + \T_CALLABLE => '5.4', + \T_CATCH => '5.0', + \T_FINAL => '5.0', + \T_FINALLY => '5.5', + \T_GOTO => '5.3', + \T_IMPLEMENTS => '5.0', + \T_INTERFACE => '5.0', + \T_INSTANCEOF => '5.0', + \T_INSTEADOF => '5.4', + \T_NAMESPACE => '5.3', + \T_PRIVATE => '5.0', + \T_PROTECTED => '5.0', + \T_PUBLIC => '5.0', + \T_TRAIT => '5.4', + \T_TRY => '5.0', + + ); + + /** + * T_STRING keywords to recognize as targetted tokens. + * + * Compatibility for PHP versions where the keyword is not yet recognized + * as its own token and for PHPCS versions which change the token to + * T_STRING when used in a method call. + * + * @since 5.5 + * + * @var array + */ + protected $targetedStringTokens = array( + 'abstract' => '5.0', + 'callable' => '5.4', + 'catch' => '5.0', + 'final' => '5.0', + 'finally' => '5.5', + 'goto' => '5.3', + 'implements' => '5.0', + 'interface' => '5.0', + 'instanceof' => '5.0', + 'insteadof' => '5.4', + 'namespace' => '5.3', + 'private' => '5.0', + 'protected' => '5.0', + 'public' => '5.0', + 'trait' => '5.4', + 'try' => '5.0', + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * + * @return array + */ + public function register() + { + $tokens = array_keys($this->targetedTokens); + $tokens[] = \T_STRING; + + return $tokens; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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(); + $tokenCode = $tokens[$stackPtr]['code']; + $tokenContentLc = strtolower($tokens[$stackPtr]['content']); + $isString = false; + + /* + * For string tokens we only care if the string is a reserved word used + * as a function. This only happens in older versions of PHP where the + * token doesn't exist yet for that keyword or in later versions when the + * token is used in a method invocation. + */ + if ($tokenCode === \T_STRING + && (isset($this->targetedStringTokens[$tokenContentLc]) === false) + ) { + return; + } + + if ($tokenCode === \T_STRING) { + $isString = true; + } + + // Make sure this is a function call. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($next === false || $tokens[$next]['code'] !== \T_OPEN_PARENTHESIS) { + // Not a function call. + return; + } + + // This sniff isn't concerned about function declarations. + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prev !== false && $tokens[$prev]['code'] === \T_FUNCTION) { + 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...", i.e. they can be invoked as a method call. + * + * Only needed for those keywords which we sniff out via T_STRING. + */ + if (($tokens[$prev]['code'] === \T_OBJECT_OPERATOR || $tokens[$prev]['code'] === \T_DOUBLE_COLON) + && $this->supportsBelow('5.6') === false + ) { + return; + } + + // For the word catch, it is valid to have an open parenthesis + // after it, but only if it is preceded by a right curly brace. + if ($tokenCode === \T_CATCH) { + if ($prev !== false && $tokens[$prev]['code'] === \T_CLOSE_CURLY_BRACKET) { + // Ok, it's fine. + return; + } + } + + if ($isString === true) { + $version = $this->targetedStringTokens[$tokenContentLc]; + } else { + $version = $this->targetedTokens[$tokenCode]; + } + + if ($this->supportsAbove($version)) { + $error = "'%s' is a reserved keyword introduced in PHP version %s and cannot be invoked as a function (%s)"; + $errorCode = $this->stringToErrorCode($tokenContentLc) . 'Found'; + $data = array( + $tokenContentLc, + $version, + $tokens[$stackPtr]['type'], + ); + + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php new file mode 100644 index 00000000..6be1de4f --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php @@ -0,0 +1,442 @@ + string) + */ + protected $invalidNames = array( + 'abstract' => '5.0', + 'and' => 'all', + 'array' => 'all', + 'as' => 'all', + 'break' => 'all', + 'callable' => '5.4', + 'case' => 'all', + 'catch' => '5.0', + 'class' => 'all', + 'clone' => '5.0', + 'const' => 'all', + 'continue' => 'all', + 'declare' => 'all', + 'default' => 'all', + 'die' => 'all', + 'do' => 'all', + 'echo' => 'all', + 'else' => 'all', + 'elseif' => 'all', + 'empty' => 'all', + 'enddeclare' => 'all', + 'endfor' => 'all', + 'endforeach' => 'all', + 'endif' => 'all', + 'endswitch' => 'all', + 'endwhile' => 'all', + 'eval' => 'all', + 'exit' => 'all', + 'extends' => 'all', + 'final' => '5.0', + 'finally' => '5.5', + 'for' => 'all', + 'foreach' => 'all', + 'function' => 'all', + 'global' => 'all', + 'goto' => '5.3', + 'if' => 'all', + 'implements' => '5.0', + 'include' => 'all', + 'include_once' => 'all', + 'instanceof' => '5.0', + 'insteadof' => '5.4', + 'interface' => '5.0', + 'isset' => 'all', + 'list' => 'all', + 'namespace' => '5.3', + 'new' => 'all', + 'or' => 'all', + 'print' => 'all', + 'private' => '5.0', + 'protected' => '5.0', + 'public' => '5.0', + 'require' => 'all', + 'require_once' => 'all', + 'return' => 'all', + 'static' => 'all', + 'switch' => 'all', + 'throw' => '5.0', + 'trait' => '5.4', + 'try' => '5.0', + 'unset' => 'all', + 'use' => 'all', + 'var' => 'all', + 'while' => 'all', + 'xor' => 'all', + 'yield' => '5.5', + '__class__' => 'all', + '__dir__' => '5.3', + '__file__' => 'all', + '__function__' => 'all', + '__method__' => 'all', + '__namespace__' => '5.3', + ); + + /** + * A list of keywords that can follow use statements. + * + * @since 7.0.1 + * + * @var array(string => string) + */ + protected $validUseNames = array( + 'const' => true, + 'function' => true, + ); + + /** + * Scope modifiers and other keywords allowed in trait use statements. + * + * @since 7.1.4 + * + * @var array + */ + private $allowedModifiers = array(); + + /** + * Targeted tokens. + * + * @since 5.5 + * + * @var array + */ + protected $targetedTokens = array( + \T_CLASS, + \T_FUNCTION, + \T_NAMESPACE, + \T_STRING, + \T_CONST, + \T_USE, + \T_AS, + \T_EXTENDS, + \T_INTERFACE, + \T_TRAIT, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * + * @return array + */ + public function register() + { + $this->allowedModifiers = Tokens::$scopeModifiers; + $this->allowedModifiers[\T_FINAL] = \T_FINAL; + + $tokens = $this->targetedTokens; + + if (\defined('T_ANON_CLASS')) { + $tokens[] = \T_ANON_CLASS; + } + + return $tokens; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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(); + + /* + * We distinguish between the class, function and namespace names vs the define statements. + */ + if ($tokens[$stackPtr]['type'] === 'T_STRING') { + $this->processString($phpcsFile, $stackPtr, $tokens); + } else { + $this->processNonString($phpcsFile, $stackPtr, $tokens); + } + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processNonString(File $phpcsFile, $stackPtr, $tokens) + { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + return; + } + + /* + * Deal with anonymous classes - `class` before a reserved keyword is sometimes + * misidentified as `T_ANON_CLASS`. + * In PHPCS < 2.3.4 these were tokenized as T_CLASS no matter what. + */ + if ($tokens[$stackPtr]['type'] === 'T_ANON_CLASS' || $tokens[$stackPtr]['type'] === 'T_CLASS') { + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prevNonEmpty !== false && $tokens[$prevNonEmpty]['type'] === 'T_NEW') { + return; + } + } + + /* + * PHP 5.6 allows for use const and use function, but only if followed by the function/constant name. + * - `use function HelloWorld` => move to the next token (HelloWorld) to verify. + * - `use const HelloWorld` => move to the next token (HelloWorld) to verify. + */ + elseif ($tokens[$stackPtr]['type'] === 'T_USE' + && isset($this->validUseNames[strtolower($tokens[$nextNonEmpty]['content'])]) === true + ) { + $maybeUseNext = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true, null, true); + if ($maybeUseNext !== false && $this->isEndOfUseStatement($tokens[$maybeUseNext]) === false) { + $nextNonEmpty = $maybeUseNext; + } + } + + /* + * Deal with visibility modifiers. + * - `use HelloWorld { sayHello as protected; }` => valid, bow out. + * - `use HelloWorld { sayHello as private myPrivateHello; }` => move to the next token to verify. + */ + elseif ($tokens[$stackPtr]['type'] === 'T_AS' + && isset($this->allowedModifiers[$tokens[$nextNonEmpty]['code']]) === true + && $phpcsFile->hasCondition($stackPtr, \T_USE) === true + ) { + $maybeUseNext = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true, null, true); + if ($maybeUseNext === false || $this->isEndOfUseStatement($tokens[$maybeUseNext]) === true) { + return; + } + + $nextNonEmpty = $maybeUseNext; + } + + /* + * Deal with foreach ( ... as list() ). + */ + elseif ($tokens[$stackPtr]['type'] === 'T_AS' + && isset($tokens[$stackPtr]['nested_parenthesis']) === true + && $tokens[$nextNonEmpty]['code'] === \T_LIST + ) { + $parentheses = array_reverse($tokens[$stackPtr]['nested_parenthesis'], true); + foreach ($parentheses as $open => $close) { + if (isset($tokens[$open]['parenthesis_owner']) + && $tokens[$tokens[$open]['parenthesis_owner']]['code'] === \T_FOREACH + ) { + return; + } + } + } + + /* + * Deal with functions declared to return by reference. + */ + elseif ($tokens[$stackPtr]['type'] === 'T_FUNCTION' + && $tokens[$nextNonEmpty]['type'] === 'T_BITWISE_AND' + ) { + $maybeUseNext = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true, null, true); + if ($maybeUseNext === false) { + // Live coding. + return; + } + + $nextNonEmpty = $maybeUseNext; + } + + /* + * Deal with nested namespaces. + */ + elseif ($tokens[$stackPtr]['type'] === 'T_NAMESPACE') { + if ($tokens[$stackPtr + 1]['code'] === \T_NS_SEPARATOR) { + // Not a namespace declaration, but use of, i.e. `namespace\someFunction();`. + return; + } + + $endToken = $phpcsFile->findNext(array(\T_SEMICOLON, \T_OPEN_CURLY_BRACKET), ($stackPtr + 1), null, false, null, true); + $namespaceName = trim($phpcsFile->getTokensAsString(($stackPtr + 1), ($endToken - $stackPtr - 1))); + if (empty($namespaceName) === true) { + return; + } + + $namespaceParts = explode('\\', $namespaceName); + foreach ($namespaceParts as $namespacePart) { + $partLc = strtolower($namespacePart); + if (isset($this->invalidNames[$partLc]) === false) { + continue; + } + + // Find the token position of the part which matched. + for ($i = ($stackPtr + 1); $i < $endToken; $i++) { + if ($tokens[$i]['content'] === $namespacePart) { + $nextNonEmpty = $i; + break; + } + } + } + unset($i, $namespacePart, $partLc); + } + + $nextContentLc = strtolower($tokens[$nextNonEmpty]['content']); + if (isset($this->invalidNames[$nextContentLc]) === 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, except that class may not be used as constant name." + */ + if ((($tokens[$stackPtr]['type'] === 'T_FUNCTION' + && $this->inClassScope($phpcsFile, $stackPtr, false) === true) + || ($tokens[$stackPtr]['type'] === 'T_CONST' + && $this->isClassConstant($phpcsFile, $stackPtr) === true + && $nextContentLc !== 'class')) + && $this->supportsBelow('5.6') === false + ) { + return; + } + + if ($this->supportsAbove($this->invalidNames[$nextContentLc])) { + $data = array( + $tokens[$nextNonEmpty]['content'], + $this->invalidNames[$nextContentLc], + ); + $this->addError($phpcsFile, $stackPtr, $tokens[$nextNonEmpty]['content'], $data); + } + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processString(File $phpcsFile, $stackPtr, $tokens) + { + $tokenContentLc = strtolower($tokens[$stackPtr]['content']); + + /* + * Special case for PHP versions where the target is not yet identified as + * its own token, but presents as T_STRING. + * - trait keyword in PHP < 5.4 + */ + if (version_compare(\PHP_VERSION_ID, '50400', '<') && $tokenContentLc === 'trait') { + $this->processNonString($phpcsFile, $stackPtr, $tokens); + return; + } + + // Look for any define/defined tokens (both T_STRING ones, blame Tokenizer). + if ($tokenContentLc !== 'define' && $tokenContentLc !== 'defined') { + return; + } + + // Retrieve the define(d) constant name. + $firstParam = $this->getFunctionCallParameter($phpcsFile, $stackPtr, 1); + if ($firstParam === false) { + return; + } + + $defineName = $this->stripQuotes($firstParam['raw']); + $defineNameLc = strtolower($defineName); + + if (isset($this->invalidNames[$defineNameLc]) && $this->supportsAbove($this->invalidNames[$defineNameLc])) { + $data = array( + $defineName, + $this->invalidNames[$defineNameLc], + ); + $this->addError($phpcsFile, $stackPtr, $defineNameLc, $data); + } + } + + + /** + * Add the error message. + * + * @since 7.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param string $content The token content found. + * @param array $data The data to pass into the error message. + * + * @return void + */ + protected function addError(File $phpcsFile, $stackPtr, $content, $data) + { + $error = "Function name, class name, namespace name or constant name can not be reserved keyword '%s' (since version %s)"; + $errorCode = $this->stringToErrorCode($content) . 'Found'; + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } + + + /** + * Check if the current token code is for a token which can be considered + * the end of a (partial) use statement. + * + * @since 7.0.8 + * + * @param int $token The current token information. + * + * @return bool + */ + protected function isEndOfUseStatement($token) + { + return \in_array($token['code'], array(\T_CLOSE_CURLY_BRACKET, \T_SEMICOLON, \T_COMMA), true); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php new file mode 100644 index 00000000..61f79aa5 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php @@ -0,0 +1,391 @@ + array(string => bool|string)) + */ + protected $newKeywords = array( + 'T_HALT_COMPILER' => array( + '5.0' => false, + '5.1' => true, + 'description' => '"__halt_compiler" keyword', + ), + 'T_CONST' => array( + '5.2' => false, + '5.3' => true, + 'description' => '"const" keyword', + 'condition' => 'isClassConstant', // Keyword is only new when not in class context. + ), + 'T_CALLABLE' => array( + '5.3' => false, + '5.4' => true, + 'description' => '"callable" keyword', + 'content' => 'callable', + ), + 'T_DIR' => array( + '5.2' => false, + '5.3' => true, + 'description' => '__DIR__ magic constant', + 'content' => '__DIR__', + ), + 'T_GOTO' => array( + '5.2' => false, + '5.3' => true, + 'description' => '"goto" keyword', + 'content' => 'goto', + ), + 'T_INSTEADOF' => array( + '5.3' => false, + '5.4' => true, + 'description' => '"insteadof" keyword (for traits)', + 'content' => 'insteadof', + ), + 'T_NAMESPACE' => array( + '5.2' => false, + '5.3' => true, + 'description' => '"namespace" keyword', + 'content' => 'namespace', + ), + 'T_NS_C' => array( + '5.2' => false, + '5.3' => true, + 'description' => '__NAMESPACE__ magic constant', + 'content' => '__NAMESPACE__', + ), + 'T_USE' => array( + '5.2' => false, + '5.3' => true, + 'description' => '"use" keyword (for traits/namespaces/anonymous functions)', + ), + 'T_START_NOWDOC' => array( + '5.2' => false, + '5.3' => true, + 'description' => 'nowdoc functionality', + ), + 'T_END_NOWDOC' => array( + '5.2' => false, + '5.3' => true, + 'description' => 'nowdoc functionality', + ), + 'T_START_HEREDOC' => array( + '5.2' => false, + '5.3' => true, + 'description' => '(Double) quoted Heredoc identifier', + 'condition' => 'isNotQuoted', // Heredoc is only new with quoted identifier. + ), + 'T_TRAIT' => array( + '5.3' => false, + '5.4' => true, + 'description' => '"trait" keyword', + 'content' => 'trait', + ), + 'T_TRAIT_C' => array( + '5.3' => false, + '5.4' => true, + 'description' => '__TRAIT__ magic constant', + 'content' => '__TRAIT__', + ), + // The specifics for distinguishing between 'yield' and 'yield from' are dealt + // with in the translation logic. + // This token has to be placed above the `T_YIELD` token in this array to allow for this. + 'T_YIELD_FROM' => array( + '5.6' => false, + '7.0' => true, + 'description' => '"yield from" keyword (for generators)', + 'content' => 'yield', + ), + 'T_YIELD' => array( + '5.4' => false, + '5.5' => true, + 'description' => '"yield" keyword (for generators)', + 'content' => 'yield', + ), + 'T_FINALLY' => array( + '5.4' => false, + '5.5' => true, + 'description' => '"finally" keyword (in exception handling)', + 'content' => 'finally', + ), + ); + + /** + * Translation table for T_STRING tokens. + * + * Will be set up from the register() method. + * + * @since 7.0.5 + * + * @var array(string => string) + */ + protected $translateContentToToken = array(); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * + * @return array + */ + public function register() + { + $tokens = array(); + $translate = array(); + foreach ($this->newKeywords as $token => $versions) { + if (\defined($token)) { + $tokens[] = constant($token); + } + if (isset($versions['content'])) { + $translate[strtolower($versions['content'])] = $token; + } + } + + /* + * Deal with tokens not recognized by the PHP version the sniffer is run + * under and (not correctly) compensated for by PHPCS. + */ + if (empty($translate) === false) { + $this->translateContentToToken = $translate; + $tokens[] = \T_STRING; + } + + return $tokens; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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(); + $tokenType = $tokens[$stackPtr]['type']; + + // Allow for dealing with multi-token keywords, like "yield from". + $end = $stackPtr; + + // Translate T_STRING token if necessary. + if ($tokens[$stackPtr]['type'] === 'T_STRING') { + $content = strtolower($tokens[$stackPtr]['content']); + + if (isset($this->translateContentToToken[$content]) === false) { + // Not one of the tokens we're looking for. + return; + } + + $tokenType = $this->translateContentToToken[$content]; + } + + /* + * Special case: distinguish between `yield` and `yield from`. + * + * PHPCS currently (at least up to v 3.0.1) does not backfill for the + * `yield` nor the `yield from` keywords. + * See: https://github.com/squizlabs/PHP_CodeSniffer/issues/1524 + * + * In PHP < 5.5, both `yield` as well as `from` are tokenized as T_STRING. + * In PHP 5.5 - 5.6, `yield` is tokenized as T_YIELD and `from` as T_STRING, + * but the `T_YIELD_FROM` token *is* defined in PHP. + * In PHP 7.0+ both are tokenized as their respective token, however, + * a multi-line "yield from" is tokenized as two tokens. + */ + if ($tokenType === 'T_YIELD') { + $nextToken = $phpcsFile->findNext(\T_WHITESPACE, ($end + 1), null, true); + if ($tokens[$nextToken]['code'] === \T_STRING + && $tokens[$nextToken]['content'] === 'from' + ) { + $tokenType = 'T_YIELD_FROM'; + $end = $nextToken; + } + unset($nextToken); + } + + if ($tokenType === 'T_YIELD_FROM' && $tokens[($stackPtr - 1)]['type'] === 'T_YIELD_FROM') { + // Multi-line "yield from", no need to report it twice. + return; + } + + if (isset($this->newKeywords[$tokenType]) === false) { + return; + } + + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + if ($prevToken !== false + && ($tokens[$prevToken]['code'] === \T_DOUBLE_COLON + || $tokens[$prevToken]['code'] === \T_OBJECT_OPERATOR) + ) { + // Class property of the same name as one of the keywords. Ignore. + return; + } + + // Skip attempts to use keywords as functions or class names - the former + // will be reported by ForbiddenNamesAsInvokedFunctionsSniff, whilst the + // latter will be (partially) reported by the ForbiddenNames sniff. + // Either type will result in false-positives when targetting lower versions + // of PHP where the name was not reserved, unless we explicitly check for + // them. + if (($nextToken === false + || $tokens[$nextToken]['type'] !== 'T_OPEN_PARENTHESIS') + && ($prevToken === false + || $tokens[$prevToken]['type'] !== 'T_CLASS' + || $tokens[$prevToken]['type'] !== 'T_INTERFACE') + ) { + // Skip based on token scope condition. + if (isset($this->newKeywords[$tokenType]['condition']) + && \call_user_func(array($this, $this->newKeywords[$tokenType]['condition']), $phpcsFile, $stackPtr) === true + ) { + return; + } + + $itemInfo = array( + 'name' => $tokenType, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newKeywords[$itemInfo['name']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array( + 'description', + 'condition', + 'content', + ); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + $errorInfo['description'] = $itemArray['description']; + + return $errorInfo; + } + + + /** + * Allow for concrete child classes to filter the error data before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param array $data The error data array which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return array + */ + protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) + { + $data[0] = $errorInfo['description']; + return $data; + } + + + /** + * Callback for the quoted heredoc identifier condition. + * + * A double quoted identifier will have the opening quote on position 3 + * in the string: `<<<"ID"`. + * + * @since 8.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return bool + */ + public function isNotQuoted(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + return ($tokens[$stackPtr]['content'][3] !== '"'); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php new file mode 100644 index 00000000..ffb9ef28 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php @@ -0,0 +1,91 @@ +supportsBelow('5.4') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $open = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); + if ($open === false + || $tokens[$open]['code'] !== \T_OPEN_PARENTHESIS + || isset($tokens[$open]['parenthesis_closer']) === false + ) { + return; + } + + $close = $tokens[$open]['parenthesis_closer']; + + $nestingLevel = 0; + if ($close !== ($open + 1) && isset($tokens[$open + 1]['nested_parenthesis'])) { + $nestingLevel = \count($tokens[$open + 1]['nested_parenthesis']); + } + + if ($this->isVariable($phpcsFile, ($open + 1), $close, $nestingLevel) === true) { + return; + } + + $phpcsFile->addError( + 'Only variables can be passed to empty() prior to PHP 5.5.', + $stackPtr, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php new file mode 100644 index 00000000..44488ed0 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php @@ -0,0 +1,159 @@ + array(string => bool|string)) + */ + protected $newConstructs = array( + 'T_NS_SEPARATOR' => array( + '5.2' => false, + '5.3' => true, + 'description' => 'the \ operator (for namespaces)', + ), + 'T_ELLIPSIS' => array( + '5.5' => false, + '5.6' => true, + 'description' => 'the ... spread operator', + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.6 + * + * @return array + */ + public function register() + { + $tokens = array(); + foreach ($this->newConstructs as $token => $versions) { + $tokens[] = constant($token); + } + return $tokens; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.6 + * + * @param \PHP_CodeSniffer_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(); + $tokenType = $tokens[$stackPtr]['type']; + + $itemInfo = array( + 'name' => $tokenType, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newConstructs[$itemInfo['name']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array('description'); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + $errorInfo['description'] = $itemArray['description']; + + return $errorInfo; + } + + + /** + * Allow for concrete child classes to filter the error data before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param array $data The error data array which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return array + */ + protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) + { + $data[0] = $errorInfo['description']; + return $data; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php new file mode 100644 index 00000000..f5ba4772 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php @@ -0,0 +1,188 @@ +supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY + && $this->isShortList($phpcsFile, $stackPtr) === false + ) { + // Short array, not short list. + return; + } + + if ($tokens[$stackPtr]['code'] === \T_LIST) { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false + || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS + || isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false + ) { + // Parse error or live coding. + return; + } + + $opener = $nextNonEmpty; + $closer = $tokens[$nextNonEmpty]['parenthesis_closer']; + } else { + // Short list syntax. + $opener = $stackPtr; + + if (isset($tokens[$stackPtr]['bracket_closer'])) { + $closer = $tokens[$stackPtr]['bracket_closer']; + } + } + + if (isset($opener, $closer) === false) { + return; + } + + /* + * OK, so we have the opener & closer, now we need to check all the variables in the + * list() to see if there are duplicates as that's the problem. + */ + $hasVars = $phpcsFile->findNext(array(\T_VARIABLE, \T_DOLLAR), ($opener + 1), $closer); + if ($hasVars === false) { + // Empty list, not our concern. + return ($closer + 1); + } + + // Set the variable delimiters based on the list type being examined. + $stopPoints = array(\T_COMMA); + if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { + $stopPoints[] = \T_CLOSE_SHORT_ARRAY; + } else { + $stopPoints[] = \T_CLOSE_PARENTHESIS; + } + + $listVars = array(); + $lastStopPoint = $opener; + + /* + * Create a list of all variables used within the `list()` construct. + * We're not concerned with whether these are nested or not, as any duplicate + * variable name used will be problematic, independent of nesting. + */ + do { + $nextStopPoint = $phpcsFile->findNext($stopPoints, ($lastStopPoint + 1), $closer); + if ($nextStopPoint === false) { + $nextStopPoint = $closer; + } + + // Also detect this in PHP 7.1 keyed lists. + $hasDoubleArrow = $phpcsFile->findNext(\T_DOUBLE_ARROW, ($lastStopPoint + 1), $nextStopPoint); + if ($hasDoubleArrow !== false) { + $lastStopPoint = $hasDoubleArrow; + } + + // Find the start of the variable, allowing for variable variables. + $nextStartPoint = $phpcsFile->findNext(array(\T_VARIABLE, \T_DOLLAR), ($lastStopPoint + 1), $nextStopPoint); + if ($nextStartPoint === false) { + // Skip past empty bits in the list, i.e. `list( $a, , ,)`. + $lastStopPoint = $nextStopPoint; + continue; + } + + /* + * Gather the content of all non-empty tokens to determine the "variable name". + * Variable name in this context includes array or object property syntaxes, such + * as `$a['name']` and `$b->property`. + */ + $varContent = ''; + + for ($i = $nextStartPoint; $i < $nextStopPoint; $i++) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']])) { + continue; + } + + $varContent .= $tokens[$i]['content']; + } + + if ($varContent !== '') { + $listVars[] = $varContent; + } + + $lastStopPoint = $nextStopPoint; + + } while ($lastStopPoint < $closer); + + if (empty($listVars)) { + // Shouldn't be possible, but just in case. + return ($closer + 1); + } + + // Verify that all variables used in the list() construct are unique. + if (\count($listVars) !== \count(array_unique($listVars))) { + $phpcsFile->addError( + 'list() will assign variable from left-to-right since PHP 7.0. Ensure all variables in list() are unique to prevent unexpected results.', + $stackPtr, + 'Affected' + ); + } + + return ($closer + 1); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php new file mode 100644 index 00000000..b9d4b7b0 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php @@ -0,0 +1,116 @@ +ignoreTokens = Tokens::$emptyTokens; + $this->ignoreTokens[\T_COMMA] = \T_COMMA; + $this->ignoreTokens[\T_OPEN_PARENTHESIS] = \T_OPEN_PARENTHESIS; + $this->ignoreTokens[\T_CLOSE_PARENTHESIS] = \T_CLOSE_PARENTHESIS; + + return array( + \T_LIST, + \T_OPEN_SHORT_ARRAY, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { + if ($this->isShortList($phpcsFile, $stackPtr) === false) { + return; + } + + $open = $stackPtr; + $close = $tokens[$stackPtr]['bracket_closer']; + } else { + // T_LIST. + $open = $phpcsFile->findNext(\T_OPEN_PARENTHESIS, $stackPtr, null, false, null, true); + if ($open === false || isset($tokens[$open]['parenthesis_closer']) === false) { + return; + } + + $close = $tokens[$open]['parenthesis_closer']; + } + + $error = true; + if (($close - $open) > 1) { + for ($cnt = $open + 1; $cnt < $close; $cnt++) { + if (isset($this->ignoreTokens[$tokens[$cnt]['code']]) === false) { + $error = false; + break; + } + } + } + + if ($error === true) { + $phpcsFile->addError( + 'Empty list() assignments are not allowed since PHP 7.0', + $stackPtr, + 'Found' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php new file mode 100644 index 00000000..7111b125 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php @@ -0,0 +1,227 @@ + \T_LIST, + \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, + ); + + /** + * The token(s) within the list construct which is being targeted. + * + * @since 9.0.0 + * + * @var array + */ + protected $targetsInList = array( + \T_DOUBLE_ARROW => \T_DOUBLE_ARROW, + ); + + /** + * All tokens needed to walk through the list construct and + * determine whether the target token is contained within. + * + * Set by the setUpAllTargets() method which is called from within register(). + * + * @since 9.0.0 + * + * @var array + */ + protected $allTargets; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.0.0 + * + * @return array + */ + public function register() + { + $this->setUpAllTargets(); + + return $this->sniffTargets; + } + + /** + * Prepare the $allTargets array only once. + * + * @since 9.0.0 + * + * @return void + */ + public function setUpAllTargets() + { + $this->allTargets = $this->sniffTargets + $this->targetsInList; + } + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('7.0') === false); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->bowOutEarly() === true) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY + && $this->isShortList($phpcsFile, $stackPtr) === false + ) { + // Short array, not short list. + return; + } + + if ($tokens[$stackPtr]['code'] === \T_LIST) { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false + || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS + || isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false + ) { + // Parse error or live coding. + return; + } + + $opener = $nextNonEmpty; + $closer = $tokens[$nextNonEmpty]['parenthesis_closer']; + } else { + // Short list syntax. + $opener = $stackPtr; + + if (isset($tokens[$stackPtr]['bracket_closer'])) { + $closer = $tokens[$stackPtr]['bracket_closer']; + } + } + + if (isset($opener, $closer) === false) { + return; + } + + $this->examineList($phpcsFile, $opener, $closer); + } + + + /** + * Examine the contents of a list construct to determine whether an error needs to be thrown. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $opener The position of the list open token. + * @param int $closer The position of the list close token. + * + * @return void + */ + protected function examineList(File $phpcsFile, $opener, $closer) + { + $start = $opener; + while (($start = $this->hasTargetInList($phpcsFile, $start, $closer)) !== false) { + $phpcsFile->addError( + 'Specifying keys in list constructs is not supported in PHP 7.0 or earlier.', + $start, + 'Found' + ); + } + } + + + /** + * Check whether a certain target token exists within a list construct. + * + * Skips past nested list constructs, so these can be examined based on their own token. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $start The position of the list open token or a token + * within the list to start (resume) the examination from. + * @param int $closer The position of the list close token. + * + * @return int|bool Stack pointer to the target token if encountered. False otherwise. + */ + protected function hasTargetInList(File $phpcsFile, $start, $closer) + { + $tokens = $phpcsFile->getTokens(); + + for ($i = ($start + 1); $i < $closer; $i++) { + if (isset($this->allTargets[$tokens[$i]['code']]) === false) { + continue; + } + + if (isset($this->targetsInList[$tokens[$i]['code']]) === true) { + return $i; + } + + // Skip past nested list constructs. + if ($tokens[$i]['code'] === \T_LIST) { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); + if ($nextNonEmpty !== false + && $tokens[$nextNonEmpty]['code'] === \T_OPEN_PARENTHESIS + && isset($tokens[$nextNonEmpty]['parenthesis_closer']) === true + ) { + $i = $tokens[$nextNonEmpty]['parenthesis_closer']; + } + } elseif ($tokens[$i]['code'] === \T_OPEN_SHORT_ARRAY + && isset($tokens[$i]['bracket_closer']) + ) { + $i = $tokens[$i]['bracket_closer']; + } + } + + return false; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php new file mode 100644 index 00000000..ebcd7c8e --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php @@ -0,0 +1,74 @@ + \T_BITWISE_AND, + ); + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('7.2') === false); + } + + /** + * Examine the contents of a list construct to determine whether an error needs to be thrown. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $opener The position of the list open token. + * @param int $closer The position of the list close token. + * + * @return void + */ + protected function examineList(File $phpcsFile, $opener, $closer) + { + $start = $opener; + while (($start = $this->hasTargetInList($phpcsFile, $start, $closer)) !== false) { + $phpcsFile->addError( + 'Reference assignments within list constructs are not supported in PHP 7.2 or earlier.', + $start, + 'Found' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php new file mode 100644 index 00000000..ee100fbe --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php @@ -0,0 +1,84 @@ +supportsBelow('7.0') === false) { + return; + } + + if ($this->isShortList($phpcsFile, $stackPtr) === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $closer = $tokens[$stackPtr]['bracket_closer']; + + $hasVariable = $phpcsFile->findNext(\T_VARIABLE, ($stackPtr + 1), $closer); + if ($hasVariable === false) { + // List syntax is only valid if there are variables in it. + return; + } + + $phpcsFile->addError( + 'The shorthand list syntax "[]" to destructure arrays is not available in PHP 7.0 or earlier.', + $stackPtr, + 'Found' + ); + + return ($closer + 1); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php new file mode 100644 index 00000000..d580bac7 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php @@ -0,0 +1,103 @@ +supportsAbove('5.3') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { + /* + * Not a method call. + * + * Note: This disregards method calls with the method name in a variable, like: + * $method = '__toString'; + * $obj->$method(); + * However, that would be very hard to examine reliably anyway. + */ + return; + } + + if (strtolower($tokens[$nextNonEmpty]['content']) !== '__tostring') { + // Not a call to the __toString() method. + return; + } + + $openParens = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true); + if ($openParens === false || $tokens[$openParens]['code'] !== \T_OPEN_PARENTHESIS) { + // Not a method call. + return; + } + + $closeParens = $phpcsFile->findNext(Tokens::$emptyTokens, ($openParens + 1), null, true); + if ($closeParens === false || $tokens[$closeParens]['code'] === \T_CLOSE_PARENTHESIS) { + // Not a method call. + return; + } + + // If we're still here, then this is a call to the __toString() magic method passing parameters. + $phpcsFile->addError( + 'The __toString() magic method will no longer accept passed arguments since PHP 5.3', + $stackPtr, + 'Passed' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php new file mode 100644 index 00000000..873ef1d2 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php @@ -0,0 +1,117 @@ +__clone()` is now allowed. This was the only magic method + * that had a compile-time check preventing some calls to it, which doesn't make sense. + * If we allow all other magic methods to be called, there's no reason to forbid this one." + * + * PHP version 7.0 + * + * @link https://wiki.php.net/rfc/abstract_syntax_tree#directly_calling_clone_is_allowed + * @link https://www.php.net/manual/en/language.oop5.cloning.php + * + * @since 9.1.0 + */ +class NewDirectCallsToCloneSniff extends Sniff +{ + + /** + * Tokens which indicate class internal use. + * + * @since 9.3.2 + * + * @var array + */ + protected $classInternal = array( + \T_PARENT => true, + \T_SELF => true, + \T_STATIC => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.1.0 + * + * @return array + */ + public function register() + { + return array( + \T_DOUBLE_COLON, + \T_OBJECT_OPERATOR, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.1.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsBelow('5.6') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { + /* + * Not a method call. + * + * Note: This disregards method calls with the method name in a variable, like: + * $method = '__clone'; + * $obj->$method(); + * However, that would be very hard to examine reliably anyway. + */ + return; + } + + if (strtolower($tokens[$nextNonEmpty]['content']) !== '__clone') { + // Not a call to the __clone() method. + return; + } + + $nextNextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true); + if ($nextNextNonEmpty === false || $tokens[$nextNextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { + // Not a method call. + return; + } + + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prevNonEmpty === false || isset($this->classInternal[$tokens[$prevNonEmpty]['code']])) { + // Class internal call to __clone(). + return; + } + + $phpcsFile->addError( + 'Direct calls to the __clone() magic method are not allowed in PHP 5.6 or earlier.', + $nextNonEmpty, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php new file mode 100644 index 00000000..85e10bcf --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php @@ -0,0 +1,147 @@ + ` interpreted as an opening PHP tag. Previously it was interpreted either as + * > ` interpreted as a literal `shortOpenTags = (bool) ini_get('short_open_tag'); + if ($this->shortOpenTags === false) { + $targets[] = \T_INLINE_HTML; + } else { + $targets[] = \T_STRING; + } + + if (version_compare(\PHP_VERSION_ID, '70399', '>')) { + $targets[] = \T_OPEN_TAG; + } + + return $targets; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsBelow('7.3') === false) { + return; + } + + if ($stackPtr !== ($phpcsFile->numTokens - 1)) { + // We're only interested in the last token in the file. + return; + } + + $tokens = $phpcsFile->getTokens(); + $contents = $tokens[$stackPtr]['content']; + $error = false; + + switch ($tokens[$stackPtr]['code']) { + case \T_INLINE_HTML: + // PHP < 7.4 with short open tags off. + if ($contents === 'addError( + 'A PHP open tag at the end of a file, without trailing newline, was not supported in PHP 7.3 or earlier and would result in a syntax error or be interpreted as a literal string', + $stackPtr, + 'Found' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php new file mode 100644 index 00000000..47143a3d --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php @@ -0,0 +1,172 @@ +aspTags = (bool) ini_get('asp_tags'); + } + + return array( + \T_OPEN_TAG, + \T_OPEN_TAG_WITH_ECHO, + \T_INLINE_HTML, + ); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.4 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $openTag = $tokens[$stackPtr]; + $content = trim($openTag['content']); + + if ($content === '' || $content === ']+)?language=[\'"]?php[\'"]?(?:[^>]+)?>)`i', $content, $match) === 1 + ) { + $found = $match[1]; + $data = array( + 'Script', + $found, + ); + $errorCode = 'ScriptOpenTagFound'; + } + + if (isset($errorCode, $data)) { + $phpcsFile->addError( + '%s style opening tags have been removed in PHP 7.0. Found "%s"', + $stackPtr, + $errorCode, + $data + ); + return; + } + + // If we're still here, we can't be sure if what we found was really intended as ASP open tags. + if ($openTag['code'] === \T_INLINE_HTML && $this->aspTags === false) { + if (strpos($content, '<%') !== false) { + $error = 'Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: %s'; + $snippet = $this->getSnippet($content, '<%'); + $data = array('<%' . $snippet); + + $phpcsFile->addWarning($error, $stackPtr, 'MaybeASPOpenTagFound', $data); + } + } + } + + + /** + * Get a snippet from a HTML token. + * + * @since 7.0.4 + * + * @param string $content The content of the HTML token. + * @param string $startAt Partial string to use as a starting point for the snippet. + * @param int $length The target length of the snippet to get. Defaults to 25. + * + * @return string + */ + protected function getSnippet($content, $startAt = '', $length = 25) + { + $startPos = 0; + + if ($startAt !== '') { + $startPos = strpos($content, $startAt); + if ($startPos !== false) { + $startPos += \strlen($startAt); + } + } + + $snippet = substr($content, $startPos, $length); + if ((\strlen($content) - $startPos) > $length) { + $snippet .= '...'; + } + + return $snippet; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/ValidIntegersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/ValidIntegersSniff.php new file mode 100644 index 00000000..53dce438 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/ValidIntegersSniff.php @@ -0,0 +1,250 @@ +isLowPHPVersion = version_compare(\PHP_VERSION_ID, '50400', '<'); + + return array( + \T_LNUMBER, // Binary, octal integers. + \T_CONSTANT_ENCAPSED_STRING, // Hex numeric string. + ); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$stackPtr]; + + if ($this->couldBeBinaryInteger($tokens, $stackPtr) === true) { + if ($this->supportsBelow('5.3')) { + $error = 'Binary integer literals were not present in PHP version 5.3 or earlier. Found: %s'; + if ($this->isLowPHPVersion === false) { + $data = array($token['content']); + } else { + $data = array($this->getBinaryInteger($phpcsFile, $tokens, $stackPtr)); + } + $phpcsFile->addError($error, $stackPtr, 'BinaryIntegerFound', $data); + } + + if ($this->isInvalidBinaryInteger($tokens, $stackPtr) === true) { + $error = 'Invalid binary integer detected. Found: %s'; + $data = array($this->getBinaryInteger($phpcsFile, $tokens, $stackPtr)); + $phpcsFile->addWarning($error, $stackPtr, 'InvalidBinaryIntegerFound', $data); + } + return; + } + + $isError = $this->supportsAbove('7.0'); + $data = array( $token['content'] ); + + if ($this->isInvalidOctalInteger($tokens, $stackPtr) === true) { + $this->addMessage( + $phpcsFile, + 'Invalid octal integer detected. Prior to PHP 7 this would lead to a truncated number. From PHP 7 onwards this causes a parse error. Found: %s', + $stackPtr, + $isError, + 'InvalidOctalIntegerFound', + $data + ); + return; + } + + if ($this->isHexidecimalNumericString($tokens, $stackPtr) === true) { + $this->addMessage( + $phpcsFile, + 'The behaviour of hexadecimal numeric strings was inconsistent prior to PHP 7 and support has been removed in PHP 7. Found: %s', + $stackPtr, + $isError, + 'HexNumericStringFound', + $data + ); + return; + } + } + + + /** + * Could the current token potentially be a binary integer ? + * + * @since 7.0.3 + * + * @param array $tokens Token stack. + * @param int $stackPtr The current position in the token stack. + * + * @return bool + */ + private function couldBeBinaryInteger($tokens, $stackPtr) + { + $token = $tokens[$stackPtr]; + + if ($token['code'] !== \T_LNUMBER) { + return false; + } + + if ($this->isLowPHPVersion === false) { + return (preg_match('`^0b[0-1]+$`iD', $token['content']) === 1); + } + // Pre-5.4, binary strings are tokenized as T_LNUMBER (0) + T_STRING ("b01010101"). + // At this point, we don't yet care whether it's a valid binary int, that's a separate check. + else { + return($token['content'] === '0' && $tokens[$stackPtr + 1]['code'] === \T_STRING && preg_match('`^b[0-9]+$`iD', $tokens[$stackPtr + 1]['content']) === 1); + } + } + + /** + * Is the current token an invalid binary integer ? + * + * @since 7.0.3 + * + * @param array $tokens Token stack. + * @param int $stackPtr The current position in the token stack. + * + * @return bool + */ + private function isInvalidBinaryInteger($tokens, $stackPtr) + { + if ($this->couldBeBinaryInteger($tokens, $stackPtr) === false) { + return false; + } + + if ($this->isLowPHPVersion === false) { + // If it's an invalid binary int, the token will be split into two T_LNUMBER tokens. + return ($tokens[$stackPtr + 1]['code'] === \T_LNUMBER); + } else { + return (preg_match('`^b[0-1]+$`iD', $tokens[$stackPtr + 1]['content']) === 0); + } + } + + /** + * Retrieve the content of the tokens which together look like a binary integer. + * + * @since 7.0.3 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param array $tokens Token stack. + * @param int $stackPtr The position of the current token in + * the stack. + * + * @return string + */ + private function getBinaryInteger(File $phpcsFile, $tokens, $stackPtr) + { + $length = 2; // PHP < 5.4 T_LNUMBER + T_STRING. + + if ($this->isLowPHPVersion === false) { + $i = $stackPtr; + while ($tokens[$i]['code'] === \T_LNUMBER) { + $i++; + } + $length = ($i - $stackPtr); + } + + return $phpcsFile->getTokensAsString($stackPtr, $length); + } + + /** + * Is the current token an invalid octal integer ? + * + * @since 7.0.3 + * + * @param array $tokens Token stack. + * @param int $stackPtr The current position in the token stack. + * + * @return bool + */ + private function isInvalidOctalInteger($tokens, $stackPtr) + { + $token = $tokens[$stackPtr]; + + if ($token['code'] === \T_LNUMBER && preg_match('`^0[0-7]*[8-9]+[0-9]*$`D', $token['content']) === 1) { + return true; + } + + return false; + } + + /** + * Is the current token a hexidecimal numeric string ? + * + * @since 7.0.3 + * + * @param array $tokens Token stack. + * @param int $stackPtr The current position in the token stack. + * + * @return bool + */ + private function isHexidecimalNumericString($tokens, $stackPtr) + { + $token = $tokens[$stackPtr]; + + if ($token['code'] === \T_CONSTANT_ENCAPSED_STRING && preg_match('`^0x[a-f0-9]+$`iD', $this->stripQuotes($token['content'])) === 1) { + return true; + } + + return false; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php new file mode 100644 index 00000000..3dfe738c --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php @@ -0,0 +1,199 @@ +>` operators. + * + * As of PHP 7.4, a deprecation warning will be thrown upon encountering an + * unparenthesized expression containing an `.` before a `+` or `-`. + * + * PHP version 7.4 + * PHP version 8.0 + * + * @link https://wiki.php.net/rfc/concatenation_precedence + * @link https://www.php.net/manual/en/language.operators.precedence.php + * + * @since 9.2.0 + */ +class ChangedConcatOperatorPrecedenceSniff extends Sniff +{ + + /** + * List of tokens with a lower operator precedence than concatenation in PHP >= 8.0. + * + * @since 9.2.0 + * + * @var array + */ + private $tokensWithLowerPrecedence = array( + 'T_BITWISE_AND' => true, + 'T_BITWISE_XOR' => true, + 'T_BITWISE_OR' => true, + 'T_COALESCE' => true, + 'T_INLINE_THEN' => true, + 'T_INLINE_ELSE' => true, + 'T_YIELD_FROM' => true, + 'T_YIELD' => true, + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.2.0 + * + * @return array + */ + public function register() + { + return array( + \T_PLUS, + \T_MINUS, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.4') === false) { + return; + } + + if ($this->isUnaryPlusMinus($phpcsFile, $stackPtr) === true) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + for ($i = ($stackPtr - 1); $stackPtr >= 0; $i--) { + if ($tokens[$i]['code'] === \T_STRING_CONCAT) { + // Found one. + break; + } + + if ($tokens[$i]['code'] === \T_SEMICOLON + || $tokens[$i]['code'] === \T_OPEN_CURLY_BRACKET + || $tokens[$i]['code'] === \T_OPEN_TAG + || $tokens[$i]['code'] === \T_OPEN_TAG_WITH_ECHO + || $tokens[$i]['code'] === \T_COMMA + || $tokens[$i]['code'] === \T_COLON + || $tokens[$i]['code'] === \T_CASE + ) { + // If we reached any of the above tokens, we've reached the end of + // the statement without encountering a concatenation operator. + return; + } + + if ($tokens[$i]['code'] === \T_OPEN_CURLY_BRACKET + && isset($tokens[$i]['bracket_closer']) + && $tokens[$i]['bracket_closer'] > $stackPtr + ) { + // No need to look any further, this is plus/minus within curly braces + // and we've reached the open curly. + return; + } + + if ($tokens[$i]['code'] === \T_OPEN_PARENTHESIS + && isset($tokens[$i]['parenthesis_closer']) + && $tokens[$i]['parenthesis_closer'] > $stackPtr + ) { + // No need to look any further, this is plus/minus within parenthesis + // and we've reached the open parenthesis. + return; + } + + if (($tokens[$i]['code'] === \T_OPEN_SHORT_ARRAY + || $tokens[$i]['code'] === \T_OPEN_SQUARE_BRACKET) + && isset($tokens[$i]['bracket_closer']) + && $tokens[$i]['bracket_closer'] > $stackPtr + ) { + // No need to look any further, this is plus/minus within a short array + // or array key square brackets and we've reached the opener. + return; + } + + if ($tokens[$i]['code'] === \T_CLOSE_CURLY_BRACKET) { + if (isset($tokens[$i]['scope_owner'])) { + // Different scope, we've passed the start of the statement. + return; + } + + if (isset($tokens[$i]['bracket_opener'])) { + $i = $tokens[$i]['bracket_opener']; + } + + continue; + } + + if ($tokens[$i]['code'] === \T_CLOSE_PARENTHESIS + && isset($tokens[$i]['parenthesis_opener']) + ) { + // Skip over statements in parenthesis, including long arrays. + $i = $tokens[$i]['parenthesis_opener']; + continue; + } + + if (($tokens[$i]['code'] === \T_CLOSE_SQUARE_BRACKET + || $tokens[$i]['code'] === \T_CLOSE_SHORT_ARRAY) + && isset($tokens[$i]['bracket_opener']) + ) { + // Skip over array keys and short arrays. + $i = $tokens[$i]['bracket_opener']; + continue; + } + + // Check for chain being broken by a token with a lower precedence. + if (isset(Tokens::$booleanOperators[$tokens[$i]['code']]) === true + || isset(Tokens::$assignmentTokens[$tokens[$i]['code']]) === true + ) { + return; + } + + if (isset($this->tokensWithLowerPrecedence[$tokens[$i]['type']]) === true) { + if ($tokens[$i]['code'] === \T_BITWISE_AND + && $phpcsFile->isReference($i) === true + ) { + continue; + } + + return; + } + } + + $message = 'Using an unparenthesized expression containing a "." before a "+" or "-" has been deprecated in PHP 7.4'; + $isError = false; + if ($this->supportsAbove('8.0') === true) { + $message .= ' and removed in PHP 8.0'; + $isError = true; + } + + $this->addMessage($phpcsFile, $message, $i, $isError); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php new file mode 100644 index 00000000..740e7dfd --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php @@ -0,0 +1,109 @@ + true, + \T_COMMA => true, + \T_DOUBLE_ARROW => true, + \T_SEMICOLON => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.0 + * @since 8.2.0 Now registers all bitshift tokens, not just bitshift right (`T_SR`). + * + * @return array + */ + public function register() + { + return array( + \T_SL, + \T_SL_EQUAL, + \T_SR, + \T_SR_EQUAL, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + // Determine the start and end of the part of the statement we need to examine. + $start = ($stackPtr + 1); + $next = $phpcsFile->findNext(Tokens::$emptyTokens, $start, null, true); + if ($next !== false && $tokens[$next]['code'] === \T_OPEN_PARENTHESIS) { + $start = ($next + 1); + } + + $end = PHPCSHelper::findEndOfStatement($phpcsFile, $start); + if (isset($this->inclusiveStopPoints[$tokens[$end]['code']]) === true) { + --$end; + } + + if ($this->isNegativeNumber($phpcsFile, $start, $end, true) !== true) { + // Not a negative number or undetermined. + return; + } + + $phpcsFile->addError( + 'Bitwise shifts by negative number will throw an ArithmeticError in PHP 7.0. Found: %s', + $stackPtr, + 'Found', + array($phpcsFile->getTokensAsString($start, ($end - $start + 1))) + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php new file mode 100644 index 00000000..7c50ad86 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php @@ -0,0 +1,317 @@ + array(string => bool|string)) + */ + protected $newOperators = array( + 'T_POW' => array( + '5.5' => false, + '5.6' => true, + 'description' => 'power operator (**)', + ), // Identified in PHP < 5.6 icw PHPCS < 2.4.0 as T_MULTIPLY + T_MULTIPLY. + 'T_POW_EQUAL' => array( + '5.5' => false, + '5.6' => true, + 'description' => 'power assignment operator (**=)', + ), // Identified in PHP < 5.6 icw PHPCS < 2.6.0 as T_MULTIPLY + T_MUL_EQUAL. + 'T_SPACESHIP' => array( + '5.6' => false, + '7.0' => true, + 'description' => 'spaceship operator (<=>)', + ), // Identified in PHP < 7.0 icw PHPCS < 2.5.1 as T_IS_SMALLER_OR_EQUAL + T_GREATER_THAN. + 'T_COALESCE' => array( + '5.6' => false, + '7.0' => true, + 'description' => 'null coalescing operator (??)', + ), // Identified in PHP < 7.0 icw PHPCS < 2.6.2 as T_INLINE_THEN + T_INLINE_THEN. + 'T_COALESCE_EQUAL' => array( + '7.3' => false, + '7.4' => true, + 'description' => 'null coalesce equal operator (??=)', + ), // Identified in PHP < 7.0 icw PHPCS < 2.6.2 as T_INLINE_THEN + T_INLINE_THEN + T_EQUAL and between PHPCS 2.6.2 and PHPCS 2.8.1 as T_COALESCE + T_EQUAL. + ); + + + /** + * A list of new operators which are not recognized in older PHPCS versions. + * + * The array lists an alternative token to listen for. + * + * @since 7.0.3 + * + * @var array(string => int) + */ + protected $newOperatorsPHPCSCompat = array( + 'T_POW' => \T_MULTIPLY, + 'T_POW_EQUAL' => \T_MUL_EQUAL, + 'T_SPACESHIP' => \T_GREATER_THAN, + 'T_COALESCE' => \T_INLINE_THEN, + 'T_COALESCE_EQUAL' => \T_EQUAL, + ); + + /** + * Token translation table for older PHPCS versions. + * + * The 'before' index lists the token which would have to be directly before the + * token found for it to be one of the new operators. + * The 'real_token' index indicates which operator was found in that case. + * + * If the token combination has multi-layer complexity, such as is the case + * with T_COALESCE(_EQUAL), a 'callback' index is added instead pointing to a + * separate function which can determine whether this is the targetted token across + * PHP and PHPCS versions. + * + * {@internal 'before' was chosen rather than 'after' as that allowed for a 1-on-1 + * translation list with the current tokens.} + * + * @since 7.0.3 + * + * @var array(string => array(string => string)) + */ + protected $PHPCSCompatTranslate = array( + 'T_MULTIPLY' => array( + 'before' => 'T_MULTIPLY', + 'real_token' => 'T_POW', + ), + 'T_MUL_EQUAL' => array( + 'before' => 'T_MULTIPLY', + 'real_token' => 'T_POW_EQUAL', + ), + 'T_GREATER_THAN' => array( + 'before' => 'T_IS_SMALLER_OR_EQUAL', + 'real_token' => 'T_SPACESHIP', + ), + 'T_INLINE_THEN' => array( + 'callback' => 'isTCoalesce', + 'real_token' => 'T_COALESCE', + ), + 'T_EQUAL' => array( + 'callback' => 'isTCoalesceEqual', + 'real_token' => 'T_COALESCE_EQUAL', + ), + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.6 + * + * @return array + */ + public function register() + { + $tokens = array(); + foreach ($this->newOperators as $token => $versions) { + if (\defined($token)) { + $tokens[] = constant($token); + } elseif (isset($this->newOperatorsPHPCSCompat[$token])) { + $tokens[] = $this->newOperatorsPHPCSCompat[$token]; + } + } + return $tokens; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.6 + * + * @param \PHP_CodeSniffer_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(); + $tokenType = $tokens[$stackPtr]['type']; + + // Translate older PHPCS token combis for new operators to the actual operator. + if (isset($this->newOperators[$tokenType]) === false) { + if (isset($this->PHPCSCompatTranslate[$tokenType]) + && ((isset($this->PHPCSCompatTranslate[$tokenType]['before'], $tokens[$stackPtr - 1]) === true + && $tokens[$stackPtr - 1]['type'] === $this->PHPCSCompatTranslate[$tokenType]['before']) + || (isset($this->PHPCSCompatTranslate[$tokenType]['callback']) === true + && \call_user_func(array($this, $this->PHPCSCompatTranslate[$tokenType]['callback']), $tokens, $stackPtr) === true)) + ) { + $tokenType = $this->PHPCSCompatTranslate[$tokenType]['real_token']; + } + } elseif ($tokenType === 'T_COALESCE') { + // Make sure that T_COALESCE is not confused with T_COALESCE_EQUAL. + if (isset($tokens[($stackPtr + 1)]) !== false && $tokens[($stackPtr + 1)]['code'] === \T_EQUAL) { + // Ignore as will be dealt with via the T_EQUAL token. + return; + } + } + + // If the translation did not yield one of the tokens we are looking for, bow out. + if (isset($this->newOperators[$tokenType]) === false) { + return; + } + + $itemInfo = array( + 'name' => $tokenType, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newOperators[$itemInfo['name']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 7.1.0 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array('description'); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 7.1.0 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + $errorInfo['description'] = $itemArray['description']; + + return $errorInfo; + } + + + /** + * Filter the error data before it's passed to PHPCS. + * + * @since 7.1.0 + * + * @param array $data The error data array which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return array + */ + protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) + { + $data[0] = $errorInfo['description']; + return $data; + } + + + /** + * Callback function to determine whether a T_EQUAL token is really a T_COALESCE_EQUAL token. + * + * @since 7.1.2 + * + * @param array $tokens The token stack. + * @param int $stackPtr The current position in the token stack. + * + * @return bool + */ + private function isTCoalesceEqual($tokens, $stackPtr) + { + if ($tokens[$stackPtr]['code'] !== \T_EQUAL || isset($tokens[($stackPtr - 1)]) === false) { + // Function called for wrong token or token has no predecessor. + return false; + } + + if ($tokens[($stackPtr - 1)]['type'] === 'T_COALESCE') { + return true; + } + if ($tokens[($stackPtr - 1)]['type'] === 'T_INLINE_THEN' + && (isset($tokens[($stackPtr - 2)]) && $tokens[($stackPtr - 2)]['type'] === 'T_INLINE_THEN') + ) { + return true; + } + + return false; + } + + /** + * Callback function to determine whether a T_INLINE_THEN token is really a T_COALESCE token. + * + * @since 7.1.2 + * + * @param array $tokens The token stack. + * @param int $stackPtr The current position in the token stack. + * + * @return bool + */ + private function isTCoalesce($tokens, $stackPtr) + { + if ($tokens[$stackPtr]['code'] !== \T_INLINE_THEN || isset($tokens[($stackPtr - 1)]) === false) { + // Function called for wrong token or token has no predecessor. + return false; + } + + if ($tokens[($stackPtr - 1)]['code'] === \T_INLINE_THEN) { + // Make sure not to confuse it with the T_COALESCE_EQUAL token. + if (isset($tokens[($stackPtr + 1)]) === false || $tokens[($stackPtr + 1)]['code'] !== \T_EQUAL) { + return true; + } + } + + return false; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php new file mode 100644 index 00000000..b65da597 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php @@ -0,0 +1,73 @@ +supportsBelow('5.2') === false) { + return; + } + + if ($this->isShortTernary($phpcsFile, $stackPtr) === false) { + return; + } + + $phpcsFile->addError( + 'Middle may not be omitted from ternary operators in PHP < 5.3', + $stackPtr, + 'MiddleMissing' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php new file mode 100644 index 00000000..21eca02b --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php @@ -0,0 +1,157 @@ + true, + 'T_YIELD' => true, + 'T_LOGICAL_AND' => true, + 'T_LOGICAL_OR' => true, + 'T_LOGICAL_XOR' => true, + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.2.0 + * + * @return array + */ + public function register() + { + return array(\T_INLINE_THEN); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.4') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $endOfStatement = PHPCSHelper::findEndOfStatement($phpcsFile, $stackPtr); + if ($tokens[$endOfStatement]['code'] !== \T_SEMICOLON + && $tokens[$endOfStatement]['code'] !== \T_COLON + && $tokens[$endOfStatement]['code'] !== \T_COMMA + && $tokens[$endOfStatement]['code'] !== \T_DOUBLE_ARROW + && $tokens[$endOfStatement]['code'] !== \T_OPEN_TAG + && $tokens[$endOfStatement]['code'] !== \T_CLOSE_TAG + ) { + // End of statement is last non-empty before close brace, so make sure we examine that token too. + ++$endOfStatement; + } + + $ternaryCount = 0; + $elseCount = 0; + $shortTernaryCount = 0; + + // Start at $stackPtr so we don't need duplicate code for short ternary determination. + for ($i = $stackPtr; $i < $endOfStatement; $i++) { + if (($tokens[$i]['code'] === \T_OPEN_SHORT_ARRAY + || $tokens[$i]['code'] === \T_OPEN_SQUARE_BRACKET + || $tokens[$i]['code'] === \T_OPEN_CURLY_BRACKET) + && isset($tokens[$i]['bracket_closer']) + ) { + // Skip over short arrays, array access keys and curlies. + $i = $tokens[$i]['bracket_closer']; + continue; + } + + if ($tokens[$i]['code'] === \T_OPEN_PARENTHESIS + && isset($tokens[$i]['parenthesis_closer']) + ) { + // Skip over anything between parentheses. + $i = $tokens[$i]['parenthesis_closer']; + continue; + } + + // Check for operators with lower operator precedence. + if (isset(Tokens::$assignmentTokens[$tokens[$i]['code']]) + || isset($this->tokensWithLowerPrecedence[$tokens[$i]['code']]) + ) { + break; + } + + if ($tokens[$i]['code'] === \T_INLINE_THEN) { + ++$ternaryCount; + + if ($this->isShortTernary($phpcsFile, $i) === true) { + ++$shortTernaryCount; + } + + continue; + } + + if ($tokens[$i]['code'] === \T_INLINE_ELSE) { + if (($ternaryCount - $elseCount) >= 2) { + // This is the `else` for a ternary in the middle part of a previous ternary. + --$ternaryCount; + } else { + ++$elseCount; + } + continue; + } + } + + if ($ternaryCount > 1 && $ternaryCount === $elseCount && $ternaryCount > $shortTernaryCount) { + $message = 'The left-associativity of the ternary operator has been deprecated in PHP 7.4'; + $isError = false; + if ($this->supportsAbove('8.0') === true) { + $message .= ' and removed in PHP 8.0'; + $isError = true; + } + + $message .= '. Multiple consecutive ternaries detected. Use parenthesis to clarify the order in which the operations should be executed'; + + $this->addMessage($phpcsFile, $message, $stackPtr, $isError); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php new file mode 100644 index 00000000..30452a09 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php @@ -0,0 +1,84 @@ + true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsAbove('7.2') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[1]) === false) { + return; + } + + if ($parameters[1]['raw'] !== 'null') { + return; + } + + $phpcsFile->addError( + 'Passing "null" as the $object to get_class() is not allowed since PHP 7.2.', + $parameters[1]['start'], + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php new file mode 100644 index 00000000..9ecae5c8 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php @@ -0,0 +1,113 @@ + true, + ); + + /** + * Text string tokens to examine. + * + * @since 9.3.0 + * + * @var array + */ + private $textStringTokens = array( + \T_CONSTANT_ENCAPSED_STRING => true, + \T_DOUBLE_QUOTED_STRING => true, + \T_INLINE_HTML => true, + \T_HEREDOC => true, + \T_NOWDOC => true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.3.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsAbove('5.4') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[2]) === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $targetParam = $parameters[2]; + for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { + if ($tokens[$i]['code'] === \T_STRING + || $tokens[$i]['code'] === \T_VARIABLE + ) { + // Variable, constant, function call. Ignore as undetermined. + return; + } + + if (isset($this->textStringTokens[$tokens[$i]['code']]) === true + && strpos($tokens[$i]['content'], '/>') !== false + ) { + + $phpcsFile->addError( + 'Self-closing XHTML tags are ignored. Only non-self-closing tags should be used in the strip_tags() $allowable_tags parameter since PHP 5.3.4. Found: %s', + $i, + 'Found', + array($targetParam['raw']) + ); + + // Only throw one error per function call. + return; + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php new file mode 100644 index 00000000..8045ac8a --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php @@ -0,0 +1,116 @@ + true, + ); + + /** + * Tokens which, for the purposes of this sniff, indicate that there is + * a variable element to the value passed. + * + * @since 9.0.0 + * + * @var array + */ + private $variableValueTokens = array( + \T_VARIABLE, + \T_STRING, + \T_SELF, + \T_PARENT, + \T_STATIC, + \T_DOUBLE_QUOTED_STRING, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('5.2') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[3]) === false) { + return; + } + + $targetParam = $parameters[3]; + if ($this->isNumber($phpcsFile, $targetParam['start'], $targetParam['end'], true) !== false) { + return; + } + + if ($this->isNumericCalculation($phpcsFile, $targetParam['start'], $targetParam['end']) === true) { + return; + } + + $error = 'Passing a non-integer as the value for $initial to array_reduce() is not supported in PHP 5.2 or lower.'; + if ($phpcsFile->findNext($this->variableValueTokens, $targetParam['start'], ($targetParam['end'] + 1)) === false) { + $phpcsFile->addError( + $error . ' Found %s', + $targetParam['start'], + 'InvalidTypeFound', + array($targetParam['raw']) + ); + } else { + $phpcsFile->addWarning( + $error . ' Variable value found. Found %s', + $targetParam['start'], + 'VariableFound', + array($targetParam['raw']) + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php new file mode 100644 index 00000000..83299822 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php @@ -0,0 +1,119 @@ + true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + // Version used here should be (above) the highest version from the `newModes` control, + // structure below, i.e. the last PHP version in which a new mode was introduced. + return ($this->supportsBelow('7.1') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[2]) === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $targetParam = $parameters[2]; + $errors = array(); + + for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { + if ($tokens[$i]['code'] !== \T_CONSTANT_ENCAPSED_STRING) { + continue; + } + + if (strpos($tokens[$i]['content'], 'c+') !== false && $this->supportsBelow('5.2.5')) { + $errors['cplusFound'] = array( + 'c+', + '5.2.5', + $targetParam['raw'], + ); + } elseif (strpos($tokens[$i]['content'], 'c') !== false && $this->supportsBelow('5.2.5')) { + $errors['cFound'] = array( + 'c', + '5.2.5', + $targetParam['raw'], + ); + } + + if (strpos($tokens[$i]['content'], 'e') !== false && $this->supportsBelow('7.0.15')) { + $errors['eFound'] = array( + 'e', + '7.0.15', + $targetParam['raw'], + ); + } + } + + if (empty($errors) === true) { + return; + } + + foreach ($errors as $errorCode => $errorData) { + $phpcsFile->addError( + 'Passing "%s" as the $mode to fopen() is not supported in PHP %s or lower. Found %s', + $targetParam['start'], + $errorCode, + $errorData + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php new file mode 100644 index 00000000..18895565 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php @@ -0,0 +1,92 @@ + 3, + 'htmlentities' => 3, + 'htmlspecialchars' => 3, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * Note: This sniff should only trigger errors when both PHP 5.3 or lower, + * as well as PHP 5.4 or higher need to be supported within the application. + * + * @since 9.3.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('5.3') === false || $this->supportsAbove('5.4') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + $functionLC = strtolower($functionName); + if (isset($parameters[$this->targetFunctions[$functionLC]]) === true) { + return; + } + + $phpcsFile->addError( + 'The default value of the $encoding parameter for %s() was changed from ISO-8859-1 to UTF-8 in PHP 5.4. For cross-version compatibility, the $encoding parameter should be explicitly set.', + $stackPtr, + 'NotSet', + array($functionName) + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php new file mode 100644 index 00000000..297f84ec --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php @@ -0,0 +1,185 @@ + array(string => bool)) + */ + protected $newAlgorithms = array( + 'md2' => array( + '5.2' => false, + '5.3' => true, + ), + 'ripemd256' => array( + '5.2' => false, + '5.3' => true, + ), + 'ripemd320' => array( + '5.2' => false, + '5.3' => true, + ), + 'salsa10' => array( + '5.2' => false, + '5.3' => true, + ), + 'salsa20' => array( + '5.2' => false, + '5.3' => true, + ), + 'snefru256' => array( + '5.2' => false, + '5.3' => true, + ), + 'sha224' => array( + '5.2' => false, + '5.3' => true, + ), + 'joaat' => array( + '5.3' => false, + '5.4' => true, + ), + 'fnv132' => array( + '5.3' => false, + '5.4' => true, + ), + 'fnv164' => array( + '5.3' => false, + '5.4' => true, + ), + 'gost-crypto' => array( + '5.5' => false, + '5.6' => true, + ), + + 'sha512/224' => array( + '7.0' => false, + '7.1' => true, + ), + 'sha512/256' => array( + '7.0' => false, + '7.1' => true, + ), + 'sha3-224' => array( + '7.0' => false, + '7.1' => true, + ), + 'sha3-256' => array( + '7.0' => false, + '7.1' => true, + ), + 'sha3-384' => array( + '7.0' => false, + '7.1' => true, + ), + 'sha3-512' => array( + '7.0' => false, + '7.1' => true, + ), + 'crc32c' => array( + '7.3' => false, + '7.4' => true, + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.0.7 + * + * @return array + */ + public function register() + { + return array(\T_STRING); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.0.7 + * + * @param \PHP_CodeSniffer_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) + { + $algo = $this->getHashAlgorithmParameter($phpcsFile, $stackPtr); + if (empty($algo) || \is_string($algo) === false) { + return; + } + + // Bow out if not one of the algorithms we're targetting. + if (isset($this->newAlgorithms[$algo]) === false) { + return; + } + + // Check if the algorithm used is new. + $itemInfo = array( + 'name' => $algo, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newAlgorithms[$itemInfo['name']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The %s hash algorithm is not present in PHP version %s or earlier'; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php new file mode 100644 index 00000000..2c9748ca --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php @@ -0,0 +1,91 @@ + 3, + 'idn_to_utf8' => 3, + ); + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * Note: This sniff should only trigger errors when both PHP 7.3 or lower, + * as well as PHP 7.4 or higher need to be supported within the application. + * + * @since 9.3.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('7.3') === false || $this->supportsAbove('7.4') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + $functionLC = strtolower($functionName); + if (isset($parameters[$this->targetFunctions[$functionLC]]) === true) { + return; + } + + $error = 'The default value of the %s() $variant parameter has changed from INTL_IDNA_VARIANT_2003 to INTL_IDNA_VARIANT_UTS46 in PHP 7.4. For optimal cross-version compatibility, the $variant parameter should be explicitly set.'; + $phpcsFile->addError( + $error, + $stackPtr, + 'NotSet', + array($functionName) + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php new file mode 100644 index 00000000..51cc894e --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php @@ -0,0 +1,231 @@ + 3, + 'iconv_mime_decode' => 3, + 'iconv_mime_encode' => 3, // Special case. + 'iconv_strlen' => 2, + 'iconv_strpos' => 4, + 'iconv_strrpos' => 3, + 'iconv_substr' => 4, + + 'mb_check_encoding' => 2, + 'mb_chr' => 2, + 'mb_convert_case' => 3, + 'mb_convert_encoding' => 3, + 'mb_convert_kana' => 3, + 'mb_decode_numericentity' => 3, + 'mb_encode_numericentity' => 3, + 'mb_ord' => 2, + 'mb_scrub' => 2, + 'mb_strcut' => 4, + 'mb_stripos' => 4, + 'mb_stristr' => 4, + 'mb_strlen' => 2, + 'mb_strpos' => 4, + 'mb_strrchr' => 4, + 'mb_strrichr' => 4, + 'mb_strripos' => 4, + 'mb_strrpos' => 4, + 'mb_strstr' => 4, + 'mb_strtolower' => 2, + 'mb_strtoupper' => 2, + 'mb_strwidth' => 2, + 'mb_substr_count' => 3, + 'mb_substr' => 4, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * Note: This sniff should only trigger errors when both PHP 5.5 or lower, + * as well as PHP 5.6 or higher need to be supported within the application. + * + * @since 9.3.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('5.5') === false || $this->supportsAbove('5.6') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + $functionLC = strtolower($functionName); + if ($functionLC === 'iconv_mime_encode') { + // Special case the iconv_mime_encode() function. + return $this->processIconvMimeEncode($phpcsFile, $stackPtr, $functionName, $parameters); + } + + if (isset($parameters[$this->targetFunctions[$functionLC]]) === true) { + return; + } + + $paramName = '$encoding'; + if (strpos($functionLC, 'iconv_') === 0) { + $paramName = '$charset'; + } elseif ($functionLC === 'mb_convert_encoding') { + $paramName = '$from_encoding'; + } + + $error = 'The default value of the %1$s parameter for %2$s() was changed from ISO-8859-1 to UTF-8 in PHP 5.6. For cross-version compatibility, the %1$s parameter should be explicitly set.'; + $data = array( + $paramName, + $functionName, + ); + + $phpcsFile->addError($error, $stackPtr, 'NotSet', $data); + } + + /** + * Process the parameters of a matched call to the iconv_mime_encode() function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processIconvMimeEncode(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + $error = 'The default value of the %s parameter index for iconv_mime_encode() was changed from ISO-8859-1 to UTF-8 in PHP 5.6. For cross-version compatibility, the %s should be explicitly set.'; + + $functionLC = strtolower($functionName); + if (isset($parameters[$this->targetFunctions[$functionLC]]) === false) { + $phpcsFile->addError( + $error, + $stackPtr, + 'PreferencesNotSet', + array( + '$preferences[\'input/output-charset\']', + '$preferences[\'input-charset\'] and $preferences[\'output-charset\'] indexes', + ) + ); + + return; + } + + $tokens = $phpcsFile->getTokens(); + $targetParam = $parameters[$this->targetFunctions[$functionLC]]; + $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $targetParam['start'], ($targetParam['end'] + 1), true); + if ($firstNonEmpty === false) { + // Parse error or live coding. + return; + } + + if ($tokens[$firstNonEmpty]['code'] === \T_ARRAY + || $tokens[$firstNonEmpty]['code'] === \T_OPEN_SHORT_ARRAY + ) { + $hasInputCharset = preg_match('`([\'"])input-charset\1\s*=>`', $targetParam['raw']); + $hasOutputCharset = preg_match('`([\'"])output-charset\1\s*=>`', $targetParam['raw']); + if ($hasInputCharset === 1 && $hasOutputCharset === 1) { + // Both input as well as output charset are set. + return; + } + + if ($hasInputCharset !== 1) { + $phpcsFile->addError( + $error, + $firstNonEmpty, + 'InputPreferenceNotSet', + array( + '$preferences[\'input-charset\']', + '$preferences[\'input-charset\'] index', + ) + ); + } + + if ($hasOutputCharset !== 1) { + $phpcsFile->addError( + $error, + $firstNonEmpty, + 'OutputPreferenceNotSet', + array( + '$preferences[\'output-charset\']', + '$preferences[\'output-charset\'] index', + ) + ); + } + + return; + } + + // The $preferences parameter was passed, but it was a variable/constant/output of a function call. + $phpcsFile->addWarning( + $error, + $firstNonEmpty, + 'Undetermined', + array( + '$preferences[\'input/output-charset\']', + '$preferences[\'input-charset\'] and $preferences[\'output-charset\'] indexes', + ) + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php new file mode 100644 index 00000000..f2aea60e --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php @@ -0,0 +1,129 @@ + 1-based parameter offset of the affected parameters => parameter name. + */ + protected $targetFunctions = array( + 'file_get_contents' => array( + 4 => 'offset', + ), + 'grapheme_extract' => array( + 4 => 'start', + ), + 'grapheme_stripos' => array( + 3 => 'offset', + ), + 'grapheme_strpos' => array( + 3 => 'offset', + ), + 'iconv_strpos' => array( + 3 => 'offset', + ), + 'mb_ereg_search_setpos' => array( + 1 => 'position', + ), + 'mb_strimwidth' => array( + 2 => 'start', + 3 => 'width', + ), + 'mb_stripos' => array( + 3 => 'offset', + ), + 'mb_strpos' => array( + 3 => 'offset', + ), + 'stripos' => array( + 3 => 'offset', + ), + 'strpos' => array( + 3 => 'offset', + ), + 'substr_count' => array( + 3 => 'offset', + 4 => 'length', + ), + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('7.0') === false); + } + + /** + * Process the parameters of a matched function. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + $functionLC = strtolower($functionName); + foreach ($this->targetFunctions[$functionLC] as $pos => $name) { + if (isset($parameters[$pos]) === false) { + continue; + } + + $targetParam = $parameters[$pos]; + + if ($this->isNegativeNumber($phpcsFile, $targetParam['start'], $targetParam['end']) === false) { + continue; + } + + $phpcsFile->addError( + 'Negative string offsets were not supported for the $%s parameter in %s() in PHP 7.0 or lower. Found %s', + $targetParam['start'], + 'Found', + array( + $name, + $functionName, + $targetParam['raw'], + ) + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php new file mode 100644 index 00000000..65339e50 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php @@ -0,0 +1,127 @@ + true, + 'preg_grep' => true, + 'preg_match_all' => true, + 'preg_match' => true, + 'preg_replace_callback_array' => true, + 'preg_replace_callback' => true, + 'preg_replace' => true, + 'preg_split' => true, + ); + + /** + * Array listing newly introduced regex modifiers. + * + * The key should be the modifier (case-sensitive!). + * The value should be the PHP version in which the modifier was introduced. + * + * @since 8.2.0 + * + * @var array + */ + protected $newModifiers = array( + 'J' => array( + '7.1' => false, + '7.2' => true, + ), + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 8.2.0 + * + * @return bool + */ + protected function bowOutEarly() + { + // Version used here should be the highest version from the `$newModifiers` array, + // i.e. the last PHP version in which a new modifier was introduced. + return ($this->supportsBelow('7.2') === false); + } + + + /** + * Examine the regex modifier string. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param string $functionName The function which contained the pattern. + * @param string $modifiers The regex modifiers found. + * + * @return void + */ + protected function examineModifiers(File $phpcsFile, $stackPtr, $functionName, $modifiers) + { + $error = 'The PCRE regex modifier "%s" is not present in PHP version %s or earlier'; + + foreach ($this->newModifiers as $modifier => $versionArray) { + if (strpos($modifiers, $modifier) === false) { + continue; + } + + $notInVersion = ''; + foreach ($versionArray as $version => $present) { + if ($notInVersion === '' && $present === false + && $this->supportsBelow($version) === true + ) { + $notInVersion = $version; + } + } + + if ($notInVersion === '') { + continue; + } + + $errorCode = $modifier . 'ModifierFound'; + $data = array( + $modifier, + $notInVersion, + ); + + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php new file mode 100644 index 00000000..7e42f3e9 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php @@ -0,0 +1,132 @@ + true, + ); + + /** + * List of new format character codes added to pack(). + * + * @since 9.0.0 + * + * @var array Regex pattern => Version array. + */ + protected $newFormats = array( + '`([Z])`' => array( + '5.4' => false, + '5.5' => true, + ), + '`([qQJP])`' => array( + '5.6.2' => false, + '5.6.3' => true, + ), + '`([eEgG])`' => array( + '7.0.14' => false, + '7.0.15' => true, // And 7.1.1. + ), + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsBelow('7.1') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[1]) === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $targetParam = $parameters[1]; + + for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { + if ($tokens[$i]['code'] !== \T_CONSTANT_ENCAPSED_STRING + && $tokens[$i]['code'] !== \T_DOUBLE_QUOTED_STRING + ) { + continue; + } + + $content = $tokens[$i]['content']; + if ($tokens[$i]['code'] === \T_DOUBLE_QUOTED_STRING) { + $content = $this->stripVariables($content); + } + + foreach ($this->newFormats as $pattern => $versionArray) { + if (preg_match($pattern, $content, $matches) !== 1) { + continue; + } + + foreach ($versionArray as $version => $present) { + if ($present === false && $this->supportsBelow($version) === true) { + $phpcsFile->addError( + 'Passing the $format(s) "%s" to pack() is not supported in PHP %s or lower. Found %s', + $targetParam['start'], + 'NewFormatFound', + array( + $matches[1], + $version, + $targetParam['raw'], + ) + ); + continue 2; + } + } + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php new file mode 100644 index 00000000..94a1360d --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php @@ -0,0 +1,125 @@ + 2, + 'password_needs_rehash' => 2, + ); + + /** + * Tokens types which indicate that the parameter passed is not the PHP native constant. + * + * @since 9.3.0 + * + * @var array + */ + private $invalidTokenTypes = array( + \T_NULL => true, + \T_TRUE => true, + \T_FALSE => true, + \T_LNUMBER => true, + \T_DNUMBER => true, + \T_CONSTANT_ENCAPSED_STRING => true, + \T_DOUBLE_QUOTED_STRING => true, + \T_HEREDOC => true, + \T_NOWDOC => true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.3.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsAbove('7.4') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + $functionLC = strtolower($functionName); + if (isset($parameters[$this->targetFunctions[$functionLC]]) === false) { + return; + } + + $targetParam = $parameters[$this->targetFunctions[$functionLC]]; + $tokens = $phpcsFile->getTokens(); + + for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { + continue; + } + + if (isset($this->invalidTokenTypes[$tokens[$i]['code']]) === true) { + $phpcsFile->addWarning( + 'The value of the password hash algorithm constants has changed in PHP 7.4. Pass a PHP native constant to the %s() function instead of using the value of the constant. Found: %s', + $stackPtr, + 'NotAlgoConstant', + array( + $functionName, + $targetParam['raw'], + ) + ); + + break; + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php new file mode 100644 index 00000000..4e9f1500 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php @@ -0,0 +1,136 @@ + true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.3.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return false; + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[1]) === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $targetParam = $parameters[1]; + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $targetParam['start'], $targetParam['end'], true); + + if ($nextNonEmpty === false) { + // Shouldn't be possible. + return; + } + + if ($tokens[$nextNonEmpty]['code'] !== \T_ARRAY + && $tokens[$nextNonEmpty]['code'] !== \T_OPEN_SHORT_ARRAY + ) { + // Not passed as an array. + return; + } + + if ($this->supportsBelow('7.3') === true) { + $phpcsFile->addError( + 'The proc_open() function did not accept $cmd to be passed in array format in PHP 7.3 and earlier.', + $nextNonEmpty, + 'Found' + ); + } + + if ($this->supportsAbove('7.4') === true) { + if (strpos($targetParam['raw'], 'escapeshellarg(') === false) { + // Efficiency: prevent needlessly walking the array. + return; + } + + $items = $this->getFunctionCallParameters($phpcsFile, $nextNonEmpty); + + if (empty($items)) { + return; + } + + foreach ($items as $item) { + for ($i = $item['start']; $i <= $item['end']; $i++) { + if ($tokens[$i]['code'] !== \T_STRING + || $tokens[$i]['content'] !== 'escapeshellarg' + ) { + continue; + } + + // @todo Potential future enhancement: check if it's a call to the PHP native function. + + $phpcsFile->addWarning( + 'When passing proc_open() the $cmd parameter as an array, PHP will take care of any necessary argument escaping. Found: %s', + $i, + 'Invalid', + array($item['raw']) + ); + + // Only throw one error per array item. + break; + } + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php new file mode 100644 index 00000000..9d9ede05 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php @@ -0,0 +1,152 @@ + true, + ); + + /** + * Text string tokens to examine. + * + * @since 9.3.0 + * + * @var array + */ + private $textStringTokens = array( + \T_CONSTANT_ENCAPSED_STRING => true, + \T_DOUBLE_QUOTED_STRING => true, + \T_INLINE_HTML => true, + \T_HEREDOC => true, + \T_NOWDOC => true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.3.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return false; + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[2]) === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $targetParam = $parameters[2]; + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $targetParam['start'], $targetParam['end'], true); + + if ($nextNonEmpty === false) { + // Shouldn't be possible. + return; + } + + if ($tokens[$nextNonEmpty]['code'] !== \T_ARRAY + && $tokens[$nextNonEmpty]['code'] !== \T_OPEN_SHORT_ARRAY + ) { + // Not passed as a hard-coded array. + return; + } + + if ($this->supportsBelow('7.3') === true) { + $phpcsFile->addError( + 'The strip_tags() function did not accept $allowable_tags to be passed in array format in PHP 7.3 and earlier.', + $nextNonEmpty, + 'Found' + ); + } + + if ($this->supportsAbove('7.4') === true) { + if (strpos($targetParam['raw'], '>') === false) { + // Efficiency: prevent needlessly walking the array. + return; + } + + $items = $this->getFunctionCallParameters($phpcsFile, $nextNonEmpty); + + if (empty($items)) { + return; + } + + foreach ($items as $item) { + for ($i = $item['start']; $i <= $item['end']; $i++) { + if ($tokens[$i]['code'] === \T_STRING + || $tokens[$i]['code'] === \T_VARIABLE + ) { + // Variable, constant, function call. Ignore complete item as undetermined. + break; + } + + if (isset($this->textStringTokens[$tokens[$i]['code']]) === true + && strpos($tokens[$i]['content'], '>') !== false + ) { + + $phpcsFile->addWarning( + 'When passing strip_tags() the $allowable_tags parameter as an array, the tags should not be enclosed in <> brackets. Found: %s', + $i, + 'Invalid', + array($item['raw']) + ); + + // Only throw one error per array item. + break; + } + } + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php new file mode 100644 index 00000000..83d4b8b3 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php @@ -0,0 +1,117 @@ + array(string => bool)) + */ + protected $removedAlgorithms = array( + 'salsa10' => array( + '5.4' => true, + ), + 'salsa20' => array( + '5.4' => true, + ), + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * + * @return array + */ + public function register() + { + return array(\T_STRING); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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) + { + $algo = $this->getHashAlgorithmParameter($phpcsFile, $stackPtr); + if (empty($algo) || \is_string($algo) === false) { + return; + } + + // Bow out if not one of the algorithms we're targetting. + if (isset($this->removedAlgorithms[$algo]) === false) { + return; + } + + $itemInfo = array( + 'name' => $algo, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->removedAlgorithms[$itemInfo['name']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The %s hash algorithm is '; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php new file mode 100644 index 00000000..d7c7c663 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php @@ -0,0 +1,86 @@ + true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsAbove('5.6') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[1]) === false) { + return; + } + + $phpcsFile->addWarning( + 'All previously accepted values for the $type parameter of iconv_set_encoding() have been deprecated since PHP 5.6. Found %s', + $parameters[1]['start'], + 'DeprecatedValueFound', + $parameters[1]['raw'] + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php new file mode 100644 index 00000000..1ff0f90f --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php @@ -0,0 +1,323 @@ + true, + 'join' => true, + ); + + /** + * List of PHP native constants which should be recognized as text strings. + * + * @since 9.3.0 + * + * @var array + */ + private $constantStrings = array( + 'DIRECTORY_SEPARATOR' => true, + 'PHP_EOL' => true, + ); + + /** + * List of PHP native functions which should be recognized as returning an array. + * + * Note: The array_*() functions will always be taken into account. + * + * @since 9.3.0 + * + * @var array + */ + private $arrayFunctions = array( + 'compact' => true, + 'explode' => true, + 'range' => true, + ); + + /** + * List of PHP native array functions which should *not* be recognized as returning an array. + * + * @since 9.3.0 + * + * @var array + */ + private $arrayFunctionExceptions = array( + 'array_key_exists' => true, + 'array_key_first' => true, + 'array_key_last' => true, + 'array_multisort' => true, + 'array_pop' => true, + 'array_product' => true, + 'array_push' => true, + 'array_search' => true, + 'array_shift' => true, + 'array_sum' => true, + 'array_unshift' => true, + 'array_walk_recursive' => true, + 'array_walk' => true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.3.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsAbove('7.4') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[2]) === false) { + // Only one parameter, this must be $pieces. Bow out. + return; + } + + $tokens = $phpcsFile->getTokens(); + + /* + * Examine the first parameter. + * If there is any indication that this is an array declaration, we have an error. + */ + + $targetParam = $parameters[1]; + $start = $targetParam['start']; + $end = ($targetParam['end'] + 1); + $isOnlyText = true; + + $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $start, $end, true); + if ($firstNonEmpty === false) { + // Parse error. Shouldn't be possible. + return; + } + + if ($tokens[$firstNonEmpty]['code'] === \T_OPEN_PARENTHESIS) { + $start = ($firstNonEmpty + 1); + $end = $tokens[$firstNonEmpty]['parenthesis_closer']; + } + + $hasTernary = $phpcsFile->findNext(\T_INLINE_THEN, $start, $end); + if ($hasTernary !== false + && isset($tokens[$start]['nested_parenthesis'], $tokens[$hasTernary]['nested_parenthesis']) + && count($tokens[$start]['nested_parenthesis']) === count($tokens[$hasTernary]['nested_parenthesis']) + ) { + $start = ($hasTernary + 1); + } + + for ($i = $start; $i < $end; $i++) { + $tokenCode = $tokens[$i]['code']; + + if (isset(Tokens::$emptyTokens[$tokenCode])) { + continue; + } + + if ($tokenCode === \T_STRING && isset($this->constantStrings[$tokens[$i]['content']])) { + continue; + } + + if ($hasTernary !== false && $tokenCode === \T_INLINE_ELSE) { + continue; + } + + if (isset(Tokens::$stringTokens[$tokenCode]) === false) { + $isOnlyText = false; + } + + if ($tokenCode === \T_ARRAY || $tokenCode === \T_OPEN_SHORT_ARRAY || $tokenCode === \T_ARRAY_CAST) { + $this->throwNotice($phpcsFile, $stackPtr, $functionName); + return; + } + + if ($tokenCode === \T_STRING) { + /* + * Check for specific functions which return an array (i.e. $pieces). + */ + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $end, true); + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { + continue; + } + + $nameLc = strtolower($tokens[$i]['content']); + if (isset($this->arrayFunctions[$nameLc]) === false + && (strpos($nameLc, 'array_') !== 0 + || isset($this->arrayFunctionExceptions[$nameLc]) === true) + ) { + continue; + } + + // Now make sure it's the PHP native function being called. + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $start, true); + if ($tokens[$prevNonEmpty]['code'] === \T_DOUBLE_COLON + || $tokens[$prevNonEmpty]['code'] === \T_OBJECT_OPERATOR + ) { + // Method call, not a call to the PHP native function. + continue; + } + + if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR + && $tokens[$prevNonEmpty - 1]['code'] === \T_STRING + ) { + // Namespaced function. + continue; + } + + // Ok, so we know that there is an array function in the first param. + // 99.9% chance that this is $pieces, not $glue. + $this->throwNotice($phpcsFile, $stackPtr, $functionName); + return; + } + } + + if ($isOnlyText === true) { + // First parameter only contained text string tokens, i.e. glue. + return; + } + + /* + * Examine the second parameter. + */ + + $targetParam = $parameters[2]; + $start = $targetParam['start']; + $end = ($targetParam['end'] + 1); + + $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $start, $end, true); + if ($firstNonEmpty === false) { + // Parse error. Shouldn't be possible. + return; + } + + if ($tokens[$firstNonEmpty]['code'] === \T_OPEN_PARENTHESIS) { + $start = ($firstNonEmpty + 1); + $end = $tokens[$firstNonEmpty]['parenthesis_closer']; + } + + $hasTernary = $phpcsFile->findNext(\T_INLINE_THEN, $start, $end); + if ($hasTernary !== false + && isset($tokens[$start]['nested_parenthesis'], $tokens[$hasTernary]['nested_parenthesis']) + && count($tokens[$start]['nested_parenthesis']) === count($tokens[$hasTernary]['nested_parenthesis']) + ) { + $start = ($hasTernary + 1); + } + + for ($i = $start; $i < $end; $i++) { + $tokenCode = $tokens[$i]['code']; + + if (isset(Tokens::$emptyTokens[$tokenCode])) { + continue; + } + + if ($tokenCode === \T_ARRAY || $tokenCode === \T_OPEN_SHORT_ARRAY || $tokenCode === \T_ARRAY_CAST) { + // Found an array, $pieces is second. + return; + } + + if ($tokenCode === \T_STRING && isset($this->constantStrings[$tokens[$i]['content']])) { + // One of the special cased, PHP native string constants found. + $this->throwNotice($phpcsFile, $stackPtr, $functionName); + return; + } + + if ($tokenCode === \T_STRING || $tokenCode === \T_VARIABLE) { + // Function call, constant or variable encountered. + // No matter what this is combined with, we won't be able to reliably determine the value. + return; + } + + if ($tokenCode === \T_CONSTANT_ENCAPSED_STRING + || $tokenCode === \T_DOUBLE_QUOTED_STRING + || $tokenCode === \T_HEREDOC + || $tokenCode === \T_NOWDOC + ) { + $this->throwNotice($phpcsFile, $stackPtr, $functionName); + return; + } + } + } + + + /** + * Throw the error/warning. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * + * @return void + */ + protected function throwNotice(File $phpcsFile, $stackPtr, $functionName) + { + $message = 'Passing the $glue and $pieces parameters in reverse order to %s has been deprecated since PHP 7.4'; + $isError = false; + $errorCode = 'Deprecated'; + $data = array($functionName); + + /* + Support for the deprecated behaviour is expected to be removed in PHP 8.0. + Once this has been implemented, this section should be uncommented. + if ($this->supportsAbove('8.0') === true) { + $message .= ' and is removed since PHP 8.0'; + $isError = true; + $errorCode = 'Removed'; + } + */ + + $message .= '; $glue should be the first parameter and $pieces the second'; + + $this->addMessage($phpcsFile, $message, $stackPtr, $isError, $errorCode, $data); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php new file mode 100644 index 00000000..7406d9a8 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php @@ -0,0 +1,149 @@ + true, + ); + + /** + * Tokens which should be recognized as text. + * + * @since 9.3.0 + * + * @var array + */ + private $textStringTokens = array( + \T_CONSTANT_ENCAPSED_STRING, + \T_DOUBLE_QUOTED_STRING, + \T_HEREDOC, + \T_NOWDOC, + ); + + /** + * Tokens which should be recognized as numbers. + * + * @since 9.3.0 + * + * @var array + */ + private $numberTokens = array( + \T_LNUMBER => \T_LNUMBER, + \T_DNUMBER => \T_DNUMBER, + \T_MINUS => \T_MINUS, + \T_PLUS => \T_PLUS, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.3.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return $this->supportsAbove('5.2') === false; + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[3]) === false) { + // Optional third parameter not set. + return; + } + + if (isset($parameters[4]) === true) { + // Encoding set as fourth parameter. + return; + } + + $targetParam = $parameters[3]; + $targets = $this->numberTokens + Tokens::$emptyTokens; + $nonNumber = $phpcsFile->findNext($targets, $targetParam['start'], ($targetParam['end'] + 1), true); + if ($nonNumber === false) { + return; + } + + if ($this->isNumericCalculation($phpcsFile, $targetParam['start'], $targetParam['end']) === true) { + return; + } + + $hasString = $phpcsFile->findNext($this->textStringTokens, $targetParam['start'], ($targetParam['end'] + 1)); + if ($hasString === false) { + // No text strings found. Undetermined. + return; + } + + $error = 'Passing the encoding to mb_strrpos() as third parameter is soft deprecated since PHP 5.2'; + if ($this->supportsAbove('7.4') === true) { + $error .= ' and hard deprecated since PHP 7.4'; + } + + $error .= '. Use an explicit 0 as the offset in the third parameter.'; + + $phpcsFile->addWarning( + $error, + $targetParam['start'], + 'Deprecated' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php new file mode 100644 index 00000000..83e4de97 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php @@ -0,0 +1,135 @@ + 4, + 'mb_eregi_replace' => 4, + 'mb_regex_set_options' => 1, + 'mbereg_replace' => 4, // Undocumented, but valid function alias. + 'mberegi_replace' => 4, // Undocumented, but valid function alias. + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 8.2.0 + * + * @return bool + */ + protected function bowOutEarly() + { + // Version used here should be the highest version from the `$newModifiers` array, + // i.e. the last PHP version in which a new modifier was introduced. + return ($this->supportsAbove('7.1') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 7.0.5 + * @since 8.2.0 Renamed from `process()` to `processParameters()` and removed + * logic superfluous now the sniff extends the abstract. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + $tokens = $phpcsFile->getTokens(); + $functionNameLc = strtolower($functionName); + + // Check whether the options parameter in the function call is passed. + if (isset($parameters[$this->targetFunctions[$functionNameLc]]) === false) { + return; + } + + $optionsParam = $parameters[$this->targetFunctions[$functionNameLc]]; + + $stringToken = $phpcsFile->findNext(Tokens::$stringTokens, $optionsParam['start'], $optionsParam['end'] + 1); + if ($stringToken === false) { + // No string token found in the options parameter, so skip it (e.g. variable passed in). + return; + } + + $options = ''; + + /* + * Get the content of any string tokens in the options parameter and remove the quotes and variables. + */ + for ($i = $stringToken; $i <= $optionsParam['end']; $i++) { + if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === false) { + continue; + } + + $content = $this->stripQuotes($tokens[$i]['content']); + if ($tokens[$i]['code'] === \T_DOUBLE_QUOTED_STRING) { + $content = $this->stripVariables($content); + } + $content = trim($content); + + if (empty($content) === false) { + $options .= $content; + } + } + + if (strpos($options, 'e') !== false) { + $error = 'The Mbstring regex "e" modifier is deprecated since PHP 7.1.'; + + // The alternative mb_ereg_replace_callback() function is only available since 5.4.1. + if ($this->supportsBelow('5.4.1') === false) { + $error .= ' Use mb_ereg_replace_callback() instead (PHP 5.4.1+).'; + } + + $phpcsFile->addWarning($error, $stackPtr, 'Deprecated'); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php new file mode 100644 index 00000000..832a1f62 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php @@ -0,0 +1,121 @@ + true, + 'hash_hmac_file' => true, + 'hash_init' => true, + 'hash_pbkdf2' => true, + ); + + /** + * List of the non-cryptographic hashes. + * + * @since 9.0.0 + * + * @var array + */ + protected $disabledCryptos = array( + 'adler32' => true, + 'crc32' => true, + 'crc32b' => true, + 'fnv132' => true, + 'fnv1a32' => true, + 'fnv164' => true, + 'fnv1a64' => true, + 'joaat' => true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsAbove('7.2') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[1]) === false) { + return; + } + + $targetParam = $parameters[1]; + + if (isset($this->disabledCryptos[$this->stripQuotes($targetParam['raw'])]) === false) { + return; + } + + if (strtolower($functionName) === 'hash_init' + && (isset($parameters[2]) === false + || ($parameters[2]['raw'] !== 'HASH_HMAC' + && $parameters[2]['raw'] !== (string) \HASH_HMAC)) + ) { + // For hash_init(), these hashes are only disabled with HASH_HMAC set. + return; + } + + $phpcsFile->addError( + 'Non-cryptographic hashes are no longer accepted by function %s() since PHP 7.2. Found: %s', + $targetParam['start'], + $this->stringToErrorCode($functionName), + array( + $functionName, + $targetParam['raw'], + ) + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php new file mode 100644 index 00000000..377ed79f --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php @@ -0,0 +1,241 @@ + true, + 'preg_filter' => true, + ); + + /** + * Regex bracket delimiters. + * + * @since 7.0.5 This array was originally contained within the `process()` method. + * + * @var array + */ + protected $doublesSeparators = array( + '{' => '}', + '[' => ']', + '(' => ')', + '<' => '>', + ); + + + /** + * Process the parameters of a matched function. + * + * @since 5.6 + * @since 8.2.0 Renamed from `process()` to `processParameters()` and removed + * logic superfluous now the sniff extends the abstract. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + // Check the first parameter in the function call as that should contain the regex(es). + if (isset($parameters[1]) === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $functionNameLc = strtolower($functionName); + $firstParam = $parameters[1]; + + // Differentiate between an array of patterns passed and a single pattern. + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $firstParam['start'], ($firstParam['end'] + 1), true); + if ($nextNonEmpty !== false && ($tokens[$nextNonEmpty]['code'] === \T_ARRAY || $tokens[$nextNonEmpty]['code'] === \T_OPEN_SHORT_ARRAY)) { + $arrayValues = $this->getFunctionCallParameters($phpcsFile, $nextNonEmpty); + if ($functionNameLc === 'preg_replace_callback_array') { + // For preg_replace_callback_array(), the patterns will be in the array keys. + foreach ($arrayValues as $value) { + $hasKey = $phpcsFile->findNext(\T_DOUBLE_ARROW, $value['start'], ($value['end'] + 1)); + if ($hasKey === false) { + continue; + } + + $value['end'] = ($hasKey - 1); + $value['raw'] = trim($phpcsFile->getTokensAsString($value['start'], ($hasKey - $value['start']))); + $this->processRegexPattern($value, $phpcsFile, $value['end'], $functionName); + } + + } else { + // Otherwise, the patterns will be in the array values. + foreach ($arrayValues as $value) { + $hasKey = $phpcsFile->findNext(\T_DOUBLE_ARROW, $value['start'], ($value['end'] + 1)); + if ($hasKey !== false) { + $value['start'] = ($hasKey + 1); + $value['raw'] = trim($phpcsFile->getTokensAsString($value['start'], (($value['end'] + 1) - $value['start']))); + } + + $this->processRegexPattern($value, $phpcsFile, $value['end'], $functionName); + } + } + + } else { + $this->processRegexPattern($firstParam, $phpcsFile, $stackPtr, $functionName); + } + } + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 8.2.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsAbove('5.5') === false); + } + + + /** + * Analyse a potential regex pattern for use of the /e modifier. + * + * @since 7.1.2 This logic was originally contained within the `process()` method. + * + * @param array $pattern Array containing the start and end token + * pointer of the potential regex pattern and + * the raw string value of the pattern. + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param string $functionName The function which contained the pattern. + * + * @return void + */ + protected function processRegexPattern($pattern, File $phpcsFile, $stackPtr, $functionName) + { + $tokens = $phpcsFile->getTokens(); + + /* + * The pattern might be build up of a combination of strings, variables + * and function calls. We are only concerned with the strings. + */ + $regex = ''; + for ($i = $pattern['start']; $i <= $pattern['end']; $i++) { + if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true) { + $content = $this->stripQuotes($tokens[$i]['content']); + if ($tokens[$i]['code'] === \T_DOUBLE_QUOTED_STRING) { + $content = $this->stripVariables($content); + } + + $regex .= trim($content); + } + } + + // Deal with multi-line regexes which were broken up in several string tokens. + if ($tokens[$pattern['start']]['line'] !== $tokens[$pattern['end']]['line']) { + $regex = $this->stripQuotes($regex); + } + + if ($regex === '') { + // No string token found in the first parameter, so skip it (e.g. if variable passed in). + return; + } + + $regexFirstChar = substr($regex, 0, 1); + + // Make sure that the character identified as the delimiter is valid. + // Otherwise, it is a false positive caused by the string concatenation. + if (preg_match('`[a-z0-9\\\\ ]`i', $regexFirstChar) === 1) { + return; + } + + if (isset($this->doublesSeparators[$regexFirstChar])) { + $regexEndPos = strrpos($regex, $this->doublesSeparators[$regexFirstChar]); + } else { + $regexEndPos = strrpos($regex, $regexFirstChar); + } + + if ($regexEndPos !== false) { + $modifiers = substr($regex, $regexEndPos + 1); + $this->examineModifiers($phpcsFile, $stackPtr, $functionName, $modifiers); + } + } + + + /** + * Examine the regex modifier string. + * + * @since 8.2.0 Split off from the `processRegexPattern()` method. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param string $functionName The function which contained the pattern. + * @param string $modifiers The regex modifiers found. + * + * @return void + */ + protected function examineModifiers(File $phpcsFile, $stackPtr, $functionName, $modifiers) + { + if (strpos($modifiers, 'e') !== false) { + $error = '%s() - /e modifier is deprecated since PHP 5.5'; + $isError = false; + $errorCode = 'Deprecated'; + $data = array($functionName); + + if ($this->supportsAbove('7.0')) { + $error .= ' and removed since PHP 7.0'; + $isError = true; + $errorCode = 'Removed'; + } + + $this->addMessage($phpcsFile, $error, $stackPtr, $isError, $errorCode, $data); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php new file mode 100644 index 00000000..6f1eced1 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php @@ -0,0 +1,104 @@ + true, + ); + + + /** + * Do a version check to determine if this sniff needs to run at all. + * + * @since 9.0.0 + * + * @return bool + */ + protected function bowOutEarly() + { + return ($this->supportsAbove('4.2') === false); + } + + + /** + * Process the parameters of a matched function. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the stack. + * @param string $functionName The token content (function name) which was matched. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) + { + if (isset($parameters[1]) === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $targetParam = $parameters[1]; + + for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { + if ($tokens[$i]['code'] !== \T_CONSTANT_ENCAPSED_STRING + && $tokens[$i]['code'] !== \T_DOUBLE_QUOTED_STRING + ) { + continue; + } + + $message = 'Passing the $category as a string to setlocale() has been deprecated since PHP 4.2'; + $isError = false; + $errorCode = 'Deprecated'; + $data = array($targetParam['raw']); + + if ($this->supportsAbove('7.0') === true) { + $message .= ' and is removed since PHP 7.0'; + $isError = true; + $errorCode = 'Removed'; + } + + $message .= '; Pass one of the LC_* constants instead. Found: %s'; + + $this->addMessage($phpcsFile, $message, $i, $isError, $errorCode, $data); + break; + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php new file mode 100644 index 00000000..96b49827 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php @@ -0,0 +1,259 @@ + true, + 'T_IS_NOT_EQUAL' => true, + 'T_IS_IDENTICAL' => true, + 'T_IS_NOT_IDENTICAL' => true, + 'T_IS_SMALLER_OR_EQUAL' => true, + 'T_IS_GREATER_OR_EQUAL' => true, + + // Assignment tokens. + 'T_EQUAL' => true, + 'T_AND_EQUAL' => true, + 'T_OR_EQUAL' => true, + 'T_CONCAT_EQUAL' => true, + 'T_DIV_EQUAL' => true, + 'T_MINUS_EQUAL' => true, + 'T_POW_EQUAL' => true, + 'T_MOD_EQUAL' => true, + 'T_MUL_EQUAL' => true, + 'T_PLUS_EQUAL' => true, + 'T_XOR_EQUAL' => true, + 'T_DOUBLE_ARROW' => true, + 'T_SL_EQUAL' => true, + 'T_SR_EQUAL' => true, + 'T_COALESCE_EQUAL' => true, + 'T_ZSR_EQUAL' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * + * @return array + */ + public function register() + { + return array( + \T_STRING, + \T_VARIABLE, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('5.3') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + // Skip tokens that are the names of functions or classes + // within their definitions. For example: function myFunction... + // "myFunction" is T_STRING but we should skip because it is not a + // function or method *call*. + $findTokens = Tokens::$emptyTokens; + $findTokens[] = \T_BITWISE_AND; + + $prevNonEmpty = $phpcsFile->findPrevious( + $findTokens, + ($stackPtr - 1), + null, + true + ); + + if ($prevNonEmpty !== false && \in_array($tokens[$prevNonEmpty]['type'], array('T_FUNCTION', 'T_CLASS', 'T_INTERFACE', 'T_TRAIT'), true)) { + return; + } + + // If the next non-whitespace token after the function or method call + // is not an opening parenthesis then it can't really be a *call*. + $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + if ($openBracket === false || $tokens[$openBracket]['code'] !== \T_OPEN_PARENTHESIS + || isset($tokens[$openBracket]['parenthesis_closer']) === false + ) { + return; + } + + // Get the function call parameters. + $parameters = $this->getFunctionCallParameters($phpcsFile, $stackPtr); + if (\count($parameters) === 0) { + return; + } + + // Which nesting level is the one we are interested in ? + $nestedParenthesisCount = 1; + if (isset($tokens[$openBracket]['nested_parenthesis'])) { + $nestedParenthesisCount = \count($tokens[$openBracket]['nested_parenthesis']) + 1; + } + + foreach ($parameters as $parameter) { + if ($this->isCallTimePassByReferenceParam($phpcsFile, $parameter, $nestedParenthesisCount) === true) { + // T_BITWISE_AND represents a pass-by-reference. + $error = 'Using a call-time pass-by-reference is deprecated since PHP 5.3'; + $isError = false; + $errorCode = 'Deprecated'; + + if ($this->supportsAbove('5.4')) { + $error .= ' and prohibited since PHP 5.4'; + $isError = true; + $errorCode = 'NotAllowed'; + } + + $this->addMessage($phpcsFile, $error, $parameter['start'], $isError, $errorCode); + } + } + } + + + /** + * Determine whether a parameter is passed by reference. + * + * @since 7.0.6 Split off from the `process()` method. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param array $parameter Information on the current parameter + * to be examined. + * @param int $nestingLevel Target nesting level. + * + * @return bool + */ + protected function isCallTimePassByReferenceParam(File $phpcsFile, $parameter, $nestingLevel) + { + $tokens = $phpcsFile->getTokens(); + + $searchStartToken = $parameter['start'] - 1; + $searchEndToken = $parameter['end'] + 1; + $nextVariable = $searchStartToken; + do { + $nextVariable = $phpcsFile->findNext(array(\T_VARIABLE, \T_OPEN_SHORT_ARRAY, \T_CLOSURE), ($nextVariable + 1), $searchEndToken); + if ($nextVariable === false) { + return false; + } + + // Ignore anything within short array definition brackets. + if ($tokens[$nextVariable]['type'] === 'T_OPEN_SHORT_ARRAY' + && (isset($tokens[$nextVariable]['bracket_opener']) + && $tokens[$nextVariable]['bracket_opener'] === $nextVariable) + && isset($tokens[$nextVariable]['bracket_closer']) + ) { + // Skip forward to the end of the short array definition. + $nextVariable = $tokens[$nextVariable]['bracket_closer']; + continue; + } + + // Skip past closures passed as function parameters. + if ($tokens[$nextVariable]['type'] === 'T_CLOSURE' + && (isset($tokens[$nextVariable]['scope_condition']) + && $tokens[$nextVariable]['scope_condition'] === $nextVariable) + && isset($tokens[$nextVariable]['scope_closer']) + ) { + // Skip forward to the end of the closure declaration. + $nextVariable = $tokens[$nextVariable]['scope_closer']; + continue; + } + + // Make sure the variable belongs directly to this function call + // and is not inside a nested function call or array. + if (isset($tokens[$nextVariable]['nested_parenthesis']) === false + || (\count($tokens[$nextVariable]['nested_parenthesis']) !== $nestingLevel) + ) { + continue; + } + + // Checking this: $value = my_function(...[*]$arg...). + $tokenBefore = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($nextVariable - 1), + $searchStartToken, + true + ); + + if ($tokenBefore === false || $tokens[$tokenBefore]['code'] !== \T_BITWISE_AND) { + // Nothing before the token or no &. + continue; + } + + if ($phpcsFile->isReference($tokenBefore) === false) { + continue; + } + + // Checking this: $value = my_function(...[*]&$arg...). + $tokenBefore = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($tokenBefore - 1), + $searchStartToken, + true + ); + + // Prevent false positive on assign by reference and compare with reference + // within function call parameters. + if (isset($this->assignOrCompare[$tokens[$tokenBefore]['type']])) { + continue; + } + + // The found T_BITWISE_AND represents a pass-by-reference. + return true; + + } while ($nextVariable < $searchEndToken); + + // This code should never be reached, but here in case of weird bugs. + return false; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php new file mode 100644 index 00000000..2cc1e551 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php @@ -0,0 +1,199 @@ +supportsBelow('5.6') === false) { + return; + } + + $dereferencing = $this->isArrayStringDereferencing($phpcsFile, $stackPtr); + if (empty($dereferencing)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $supports54 = $this->supportsBelow('5.4'); + + foreach ($dereferencing['braces'] as $openBrace => $closeBrace) { + if ($supports54 === true + && ($tokens[$openBrace]['type'] === 'T_OPEN_SQUARE_BRACKET' + || $tokens[$openBrace]['type'] === 'T_OPEN_SHORT_ARRAY') // Work around bug #1381 in PHPCS 2.8.1 and lower. + ) { + $phpcsFile->addError( + 'Direct array dereferencing of %s is not present in PHP version 5.4 or earlier', + $openBrace, + 'Found', + array($dereferencing['type']) + ); + + continue; + } + + // PHP 7.0 Array/string dereferencing using curly braces. + if ($tokens[$openBrace]['type'] === 'T_OPEN_CURLY_BRACKET') { + $phpcsFile->addError( + 'Direct array dereferencing of %s using curly braces is not present in PHP version 5.6 or earlier', + $openBrace, + 'FoundUsingCurlies', + array($dereferencing['type']) + ); + } + } + } + + + /** + * Check if this string/array is being dereferenced. + * + * @since 9.3.0 Logic split off from the process method. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return array Array containing the type of access and stack pointers to the + * open/close braces involved in the array/string dereferencing; + * or an empty array if no array/string dereferencing was detected. + */ + public function isArrayStringDereferencing(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + switch ($tokens[$stackPtr]['code']) { + case \T_CONSTANT_ENCAPSED_STRING: + $type = 'string literals'; + $end = $stackPtr; + break; + + case \T_ARRAY: + if (isset($tokens[$stackPtr]['parenthesis_closer']) === false) { + // Live coding. + return array(); + } else { + $type = 'arrays'; + $end = $tokens[$stackPtr]['parenthesis_closer']; + } + break; + + case \T_OPEN_SHORT_ARRAY: + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + // Live coding. + return array(); + } else { + $type = 'arrays'; + $end = $tokens[$stackPtr]['bracket_closer']; + } + break; + } + + if (isset($type, $end) === false) { + // Shouldn't happen, but for some reason did. + return array(); + } + + $braces = array(); + + do { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true, null, true); + if ($nextNonEmpty === false) { + break; + } + + if ($tokens[$nextNonEmpty]['type'] === 'T_OPEN_SQUARE_BRACKET' + || $tokens[$nextNonEmpty]['type'] === 'T_OPEN_CURLY_BRACKET' // PHP 7.0+. + || $tokens[$nextNonEmpty]['type'] === 'T_OPEN_SHORT_ARRAY' // Work around bug #1381 in PHPCS 2.8.1 and lower. + ) { + if (isset($tokens[$nextNonEmpty]['bracket_closer']) === false) { + // Live coding or parse error. + break; + } + + $braces[$nextNonEmpty] = $tokens[$nextNonEmpty]['bracket_closer']; + + // Continue, just in case there is nested array access, i.e. `array(1, 2, 3)[$i][$j];`. + $end = $tokens[$nextNonEmpty]['bracket_closer']; + continue; + } + + // If we're still here, we've reached the end of the variable. + break; + + } while (true); + + if (empty($braces)) { + return array(); + } + + return array( + 'type' => $type, + 'braces' => $braces, + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php new file mode 100644 index 00000000..f0f66b86 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php @@ -0,0 +1,142 @@ +supportsBelow('7.3') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + /* + * Determine the array opener & closer. + */ + $closer = $phpcsFile->numTokens; + if ($tokens[$stackPtr]['code'] === \T_ARRAY) { + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { + return; + } + + $opener = $tokens[$stackPtr]['parenthesis_opener']; + + if (isset($tokens[$opener]['parenthesis_closer'])) { + $closer = $tokens[$opener]['parenthesis_closer']; + } + } else { + // Short array syntax. + $opener = $stackPtr; + + if (isset($tokens[$stackPtr]['bracket_closer'])) { + $closer = $tokens[$stackPtr]['bracket_closer']; + } + } + + $nestingLevel = 0; + if (isset($tokens[($opener + 1)]['nested_parenthesis'])) { + $nestingLevel = count($tokens[($opener + 1)]['nested_parenthesis']); + } + + for ($i = $opener; $i < $closer;) { + $i = $phpcsFile->findNext(array(\T_ELLIPSIS, \T_OPEN_SHORT_ARRAY, \T_ARRAY), ($i + 1), $closer); + if ($i === false) { + return; + } + + if ($tokens[$i]['code'] === \T_OPEN_SHORT_ARRAY) { + if (isset($tokens[$i]['bracket_closer']) === false) { + // Live coding, unfinished nested array, handle this when the array opener + // of the nested array is passed. + return; + } + + // Skip over nested short arrays. These will be handled when the array opener + // of the nested array is passed. + $i = $tokens[$i]['bracket_closer']; + continue; + } + + if ($tokens[$i]['code'] === \T_ARRAY) { + if (isset($tokens[$i]['parenthesis_closer']) === false) { + // Live coding, unfinished nested array, handle this when the array opener + // of the nested array is passed. + return; + } + + // Skip over nested long arrays. These will be handled when the array opener + // of the nested array is passed. + $i = $tokens[$i]['parenthesis_closer']; + continue; + } + + // Ensure this is not function call variable unpacking. + if (isset($tokens[$i]['nested_parenthesis']) + && count($tokens[$i]['nested_parenthesis']) > $nestingLevel + ) { + continue; + } + + // Ok, found one. + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); + $snippet = trim($phpcsFile->getTokensAsString($i, (($nextNonEmpty - $i) + 1))); + $phpcsFile->addError( + 'Array unpacking within array declarations using the spread operator is not supported in PHP 7.3 or earlier. Found: %s', + $i, + 'Found', + array($snippet) + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php new file mode 100644 index 00000000..218f0c9f --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php @@ -0,0 +1,192 @@ +bar()`. + * PHP 7.0: Class member access on cloning has been added, e.g. `(clone $foo)->bar()`. + * + * As of PHP 7.0, class member access on instantiation also works when using curly braces. + * While unclear, this most likely has to do with the Uniform Variable Syntax changes. + * + * PHP version 5.4 + * PHP version 7.0 + * + * @link https://www.php.net/manual/en/language.oop5.basic.php#example-177 + * @link https://www.php.net/manual/en/language.oop5.cloning.php#language.oop5.traits.properties.example + * @link https://www.php.net/manual/en/migration54.new-features.php + * @link https://wiki.php.net/rfc/instance-method-call + * @link https://wiki.php.net/rfc/uniform_variable_syntax + * + * {@internal The reason for splitting the logic of this sniff into different methods is + * to allow re-use of the logic by the PHP 7.4 `RemovedCurlyBraceArrayAccess` sniff.} + * + * @since 8.2.0 + * @since 9.3.0 Now also detects class member access on instantiation using curly braces. + */ +class NewClassMemberAccessSniff extends Sniff +{ + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.2.0 + * + * @return array + */ + public function register() + { + return array( + \T_NEW, + \T_CLONE, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.2.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsBelow('5.6') === false) { + return; + } + + $pointers = $this->isClassMemberAccess($phpcsFile, $stackPtr); + if (empty($pointers)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $supports53 = $this->supportsBelow('5.3'); + + $error = 'Class member access on object %s was not supported in PHP %s or earlier'; + $data = array('instantiation', '5.3'); + $errorCode = 'OnNewFound'; + + if ($tokens[$stackPtr]['code'] === \T_CLONE) { + $data = array('cloning', '5.6'); + $errorCode = 'OnCloneFound'; + } + + foreach ($pointers as $open => $close) { + $itemData = $data; + $itemErrorCode = $errorCode; + + if ($tokens[$stackPtr]['code'] === \T_NEW + && $tokens[$open]['code'] !== \T_OPEN_CURLY_BRACKET + ) { + if ($supports53 === true) { + $phpcsFile->addError($error, $open, $itemErrorCode, $itemData); + } + continue; + } + + if ($tokens[$stackPtr]['code'] === \T_NEW + && $tokens[$open]['code'] === \T_OPEN_CURLY_BRACKET + ) { + // Non-curlies was already handled above. + $itemData = array('instantiation using curly braces', '5.6'); + $itemErrorCode = 'OnNewFoundUsingCurlies'; + } + + $phpcsFile->addError($error, $open, $itemErrorCode, $itemData); + } + } + + + /** + * Check if the class being instantiated/cloned is being dereferenced. + * + * @since 9.3.0 Logic split off from the process method. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return array Array containing the stack pointers to the object operator or + * the open/close braces involved in the class member access; + * or an empty array if no class member access was detected. + */ + public function isClassMemberAccess(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['nested_parenthesis']) === false) { + // The `new className/clone $a` has to be in parentheses, without is not supported. + return array(); + } + + $parenthesisCloser = end($tokens[$stackPtr]['nested_parenthesis']); + $parenthesisOpener = key($tokens[$stackPtr]['nested_parenthesis']); + + if (isset($tokens[$parenthesisOpener]['parenthesis_owner']) === true) { + // If there is an owner, these parentheses are for a different purpose. + return array(); + } + + $prevBeforeParenthesis = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($parenthesisOpener - 1), null, true); + if ($prevBeforeParenthesis !== false && $tokens[$prevBeforeParenthesis]['code'] === \T_STRING) { + // This is most likely a function call with the new/cloned object as a parameter. + return array(); + } + + $braces = array(); + $end = $parenthesisCloser; + + do { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true, null, true); + if ($nextNonEmpty === false) { + break; + } + + if ($tokens[$nextNonEmpty]['code'] === \T_OBJECT_OPERATOR) { + // No need to walk any further if this is object access. + $braces[$nextNonEmpty] = true; + break; + } + + if ($tokens[$nextNonEmpty]['code'] === \T_OPEN_SQUARE_BRACKET + || $tokens[$nextNonEmpty]['code'] === \T_OPEN_CURLY_BRACKET // PHP 7.0+. + ) { + if (isset($tokens[$nextNonEmpty]['bracket_closer']) === false) { + // Live coding or parse error. + break; + } + + $braces[$nextNonEmpty] = $tokens[$nextNonEmpty]['bracket_closer']; + + // Continue, just in case there is nested array access, i.e. `(new Foo())[1][0];`. + $end = $tokens[$nextNonEmpty]['bracket_closer']; + continue; + } + + // If we're still here, we've reached the end. + break; + + } while (true); + + return $braces; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php new file mode 100644 index 00000000..4fd3b2fa --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php @@ -0,0 +1,89 @@ +supportsBelow('5.2') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + // Disregard `static::` as well. Late static binding is reported by another sniff. + if ($tokens[$prevNonEmpty]['code'] === \T_SELF + || $tokens[$prevNonEmpty]['code'] === \T_PARENT + || $tokens[$prevNonEmpty]['code'] === \T_STATIC + ) { + return; + } + + if ($tokens[$prevNonEmpty]['code'] === \T_STRING) { + $prevPrevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true); + + if ($tokens[$prevPrevNonEmpty]['code'] !== \T_OBJECT_OPERATOR) { + return; + } + } + + $phpcsFile->addError( + 'Static class properties and methods, as well as class constants, could not be accessed using a dynamic (variable) classname in PHP 5.2 or earlier.', + $stackPtr, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php new file mode 100644 index 00000000..b24590a6 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php @@ -0,0 +1,255 @@ +') === false) { + // Start identifier of a PHP 7.3 flexible heredoc/nowdoc. + $targets[] = \T_STRING; + } + + return $targets; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_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) + { + /* + * Due to a tokenizer bug which gets hit when the PHP 7.3 heredoc/nowdoc syntax + * is used, this part of the sniff cannot possibly work on PHPCS < 2.6.0. + * See upstream issue #928. + */ + if ($this->supportsBelow('7.2') === true && version_compare(PHPCSHelper::getVersion(), '2.6.0', '>=')) { + $this->detectIndentedNonStandAloneClosingMarker($phpcsFile, $stackPtr); + } + + $tokens = $phpcsFile->getTokens(); + if ($this->supportsAbove('7.3') === true && $tokens[$stackPtr]['code'] !== \T_STRING) { + $this->detectClosingMarkerInBody($phpcsFile, $stackPtr); + } + } + + + /** + * Detect indented and/or non-stand alone closing markers. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * + * @return void + */ + protected function detectIndentedNonStandAloneClosingMarker(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $indentError = 'Heredoc/nowdoc with an indented closing marker is not supported in PHP 7.2 or earlier.'; + $indentErrorCode = 'IndentedClosingMarker'; + $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) { + + /* + * Check for indented closing marker. + */ + if (ltrim($tokens[$stackPtr]['content']) !== $tokens[$stackPtr]['content']) { + $phpcsFile->addError($indentError, $stackPtr, $indentErrorCode); + } + + /* + * Check for tokens after the closing marker. + */ + $nextNonWhitespace = $phpcsFile->findNext(array(\T_WHITESPACE, \T_SEMICOLON), ($stackPtr + 1), null, true); + if ($tokens[$stackPtr]['line'] === $tokens[$nextNonWhitespace]['line']) { + $phpcsFile->addError($trailingError, $stackPtr, $trailingErrorCode); + } + } else { + // For PHP < 7.3, we're only interested in T_STRING tokens. + if ($tokens[$stackPtr]['code'] !== \T_STRING) { + return; + } + + if (preg_match('`^<<<([\'"]?)([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\1[\r\n]+`', $tokens[$stackPtr]['content'], $matches) !== 1) { + // Not the start of a PHP 7.3 flexible heredoc/nowdoc. + return; + } + + $identifier = $matches[2]; + + for ($i = ($stackPtr + 1); $i <= $phpcsFile->numTokens; $i++) { + if ($tokens[$i]['code'] !== \T_ENCAPSED_AND_WHITESPACE) { + continue; + } + + $trimmed = ltrim($tokens[$i]['content']); + + if (strpos($trimmed, $identifier) !== 0) { + continue; + } + + // OK, we've found the PHP 7.3 flexible heredoc/nowdoc closing marker. + + /* + * Check for indented closing marker. + */ + if ($trimmed !== $tokens[$i]['content']) { + // Indent found before closing marker. + $phpcsFile->addError($indentError, $i, $indentErrorCode); + } + + /* + * Check for tokens after the closing marker. + */ + // Remove the identifier. + $afterMarker = substr($trimmed, \strlen($identifier)); + // Remove a potential semi-colon at the beginning of what's left of the string. + $afterMarker = ltrim($afterMarker, ';'); + // Remove new line characters at the end of the string. + $afterMarker = rtrim($afterMarker, "\r\n"); + + if ($afterMarker !== '') { + $phpcsFile->addError($trailingError, $i, $trailingErrorCode); + } + + break; + } + } + } + + + /** + * Detect heredoc/nowdoc identifiers at the start of lines in the heredoc/nowdoc body. + * + * @since 9.0.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * + * @return void + */ + protected function detectClosingMarkerInBody(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $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) { + $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($stackPtr + 1), null, true, null, true); + if ($nextNonWhitespace === false + || $tokens[$nextNonWhitespace]['code'] === \T_SEMICOLON + || (($tokens[$nextNonWhitespace]['code'] === \T_COMMA + || $tokens[$nextNonWhitespace]['code'] === \T_STRING_CONCAT) + && $tokens[$nextNonWhitespace]['line'] !== $tokens[$stackPtr]['line']) + ) { + // This is most likely a correctly identified closing marker. + return; + } + + // The real closing tag has to be before the next heredoc/nowdoc. + $nextHereNowDoc = $phpcsFile->findNext(array(\T_START_HEREDOC, \T_START_NOWDOC), ($stackPtr + 1)); + if ($nextHereNowDoc === false) { + $nextHereNowDoc = null; + } + + $identifier = trim($tokens[$stackPtr]['content']); + $realClosingMarker = $stackPtr; + + while (($realClosingMarker = $phpcsFile->findNext(\T_STRING, ($realClosingMarker + 1), $nextHereNowDoc, false, $identifier)) !== false) { + + $prevNonWhitespace = $phpcsFile->findPrevious(\T_WHITESPACE, ($realClosingMarker - 1), null, true); + if ($prevNonWhitespace === false + || $tokens[$prevNonWhitespace]['line'] === $tokens[$realClosingMarker]['line'] + ) { + // Marker text found, but not at the start of the line. + continue; + } + + // The original T_END_HEREDOC/T_END_NOWDOC was most likely incorrect as we've found + // a possible alternative closing marker. + $phpcsFile->addError($error, $stackPtr, $errorCode); + + break; + } + + } else { + if (isset($tokens[$stackPtr]['scope_closer'], $tokens[$stackPtr]['scope_opener']) === true + && $tokens[$stackPtr]['scope_closer'] === $stackPtr + ) { + $opener = $tokens[$stackPtr]['scope_opener']; + } else { + // PHPCS < 3.0.2 did not add scope_* values for Nowdocs. + $opener = $phpcsFile->findPrevious(\T_START_NOWDOC, ($stackPtr - 1)); + if ($opener === false) { + return; + } + } + + $quotedIdentifier = preg_quote($tokens[$stackPtr]['content'], '`'); + + // Throw an error for each line in the body which starts with the identifier. + for ($i = ($opener + 1); $i < $stackPtr; $i++) { + if (preg_match('`^[ \t]*' . $quotedIdentifier . '\b`', $tokens[$i]['content']) === 1) { + $phpcsFile->addError($error, $i, $errorCode); + } + } + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php new file mode 100644 index 00000000..ac5e6b72 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php @@ -0,0 +1,187 @@ +supportsBelow('5.6') === false) { + return; + } + + $dereferencing = $this->isFunctionArrayDereferencing($phpcsFile, $stackPtr); + if (empty($dereferencing)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $supports53 = $this->supportsBelow('5.3'); + + foreach ($dereferencing as $openBrace => $closeBrace) { + if ($supports53 === true + && $tokens[$openBrace]['type'] === 'T_OPEN_SQUARE_BRACKET' + ) { + $phpcsFile->addError( + 'Function array dereferencing is not present in PHP version 5.3 or earlier', + $openBrace, + 'Found' + ); + + continue; + } + + // PHP 7.0 function array dereferencing using curly braces. + if ($tokens[$openBrace]['type'] === 'T_OPEN_CURLY_BRACKET') { + $phpcsFile->addError( + 'Function array dereferencing using curly braces is not present in PHP version 5.6 or earlier', + $openBrace, + 'FoundUsingCurlies' + ); + } + } + } + + + /** + * Check if the return of a function/method call is being dereferenced. + * + * @since 9.3.0 Logic split off from the process method. + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return array Array containing stack pointers to the open/close braces + * involved in the function dereferencing; + * or an empty array if no function dereferencing was detected. + */ + public function isFunctionArrayDereferencing(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Next non-empty token should be the open parenthesis. + $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); + if ($openParenthesis === false || $tokens[$openParenthesis]['code'] !== \T_OPEN_PARENTHESIS) { + return array(); + } + + // Don't throw errors during live coding. + if (isset($tokens[$openParenthesis]['parenthesis_closer']) === false) { + return array(); + } + + // Is this T_STRING really a function or method call ? + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prevToken !== false + && \in_array($tokens[$prevToken]['code'], array(\T_DOUBLE_COLON, \T_OBJECT_OPERATOR), true) === false + ) { + if ($tokens[$prevToken]['code'] === \T_BITWISE_AND) { + // This may be a function declared by reference. + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), null, true); + } + + $ignore = array( + \T_FUNCTION => true, + \T_CONST => true, + \T_USE => true, + \T_NEW => true, + \T_CLASS => true, + \T_INTERFACE => true, + ); + + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function or method. + return array(); + } + } + + $current = $tokens[$openParenthesis]['parenthesis_closer']; + $braces = array(); + + do { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), null, true, null, true); + if ($nextNonEmpty === false) { + break; + } + + if ($tokens[$nextNonEmpty]['type'] === 'T_OPEN_SQUARE_BRACKET' + || $tokens[$nextNonEmpty]['type'] === 'T_OPEN_CURLY_BRACKET' // PHP 7.0+. + ) { + if (isset($tokens[$nextNonEmpty]['bracket_closer']) === false) { + // Live coding or parse error. + break; + } + + $braces[$nextNonEmpty] = $tokens[$nextNonEmpty]['bracket_closer']; + + // Continue, just in case there is nested array access, i.e. `echo $foo->bar()[0][2];`. + $current = $tokens[$nextNonEmpty]['bracket_closer']; + continue; + } + + // If we're still here, we've reached the end of the function call. + break; + + } while (true); + + return $braces; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php new file mode 100644 index 00000000..39208b35 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php @@ -0,0 +1,120 @@ +supportsBelow('7.2') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS + || isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false + ) { + return; + } + + if ($tokens[$stackPtr]['code'] === \T_STRING) { + $ignore = array( + \T_FUNCTION => true, + \T_CONST => true, + \T_USE => true, + ); + + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevNonEmpty]['code']]) === true) { + // Not a function call. + return; + } + } + + $closer = $tokens[$nextNonEmpty]['parenthesis_closer']; + $lastInParenthesis = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closer - 1), $nextNonEmpty, true); + + if ($tokens[$lastInParenthesis]['code'] !== \T_COMMA) { + return; + } + + $data = array(); + switch ($tokens[$stackPtr]['code']) { + case \T_ISSET: + $data[] = 'calls to isset()'; + $errorCode = 'FoundInIsset'; + break; + + case \T_UNSET: + $data[] = 'calls to unset()'; + $errorCode = 'FoundInUnset'; + break; + + default: + $data[] = 'function calls'; + $errorCode = 'FoundInFunctionCall'; + break; + } + + $phpcsFile->addError( + 'Trailing comma\'s are not allowed in %s in PHP 7.2 or earlier', + $lastInParenthesis, + $errorCode, + $data + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php new file mode 100644 index 00000000..c60ba5c3 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php @@ -0,0 +1,77 @@ +supportsBelow('5.3') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$stackPtr]; + + $error = '%s is not supported in PHP 5.3 or lower'; + $data = array(); + + if ($token['type'] === 'T_OPEN_SHORT_ARRAY') { + $data[] = 'Short array syntax (open)'; + } elseif ($token['type'] === 'T_CLOSE_SHORT_ARRAY') { + $data[] = 'Short array syntax (close)'; + } + + $phpcsFile->addError($error, $stackPtr, 'Found', $data); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php new file mode 100644 index 00000000..b2c29e5f --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php @@ -0,0 +1,362 @@ +newArrayStringDereferencing = new NewArrayStringDereferencingSniff(); + $this->newClassMemberAccess = new NewClassMemberAccessSniff(); + $this->newFunctionArrayDereferencing = new NewFunctionArrayDereferencingSniff(); + } + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.3.0 + * + * @return array + */ + public function register() + { + $targets = array( + array( + \T_VARIABLE, + \T_STRING, // Constants. + ), + ); + + // Registers T_ARRAY, T_OPEN_SHORT_ARRAY and T_CONSTANT_ENCAPSED_STRING. + $additionalTargets = $this->newArrayStringDereferencing->register(); + $this->newArrayStringDereferencingTargets = array_flip($additionalTargets); + $targets[] = $additionalTargets; + + // Registers T_NEW and T_CLONE. + $additionalTargets = $this->newClassMemberAccess->register(); + $this->newClassMemberAccessTargets = array_flip($additionalTargets); + $targets[] = $additionalTargets; + + // Registers T_STRING. + $additionalTargets = $this->newFunctionArrayDereferencing->register(); + $this->newFunctionArrayDereferencingTargets = array_flip($additionalTargets); + $targets[] = $additionalTargets; + + return call_user_func_array('array_merge', $targets); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.4') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $braces = array(); + + // Note: Overwriting braces in each `if` is fine as only one will match anyway. + if ($tokens[$stackPtr]['code'] === \T_VARIABLE) { + $braces = $this->isVariableArrayAccess($phpcsFile, $stackPtr); + } + + if (isset($this->newArrayStringDereferencingTargets[$tokens[$stackPtr]['code']])) { + $dereferencing = $this->newArrayStringDereferencing->isArrayStringDereferencing($phpcsFile, $stackPtr); + if (isset($dereferencing['braces'])) { + $braces = $dereferencing['braces']; + } + } + + if (isset($this->newClassMemberAccessTargets[$tokens[$stackPtr]['code']])) { + $braces = $this->newClassMemberAccess->isClassMemberAccess($phpcsFile, $stackPtr); + } + + if (isset($this->newFunctionArrayDereferencingTargets[$tokens[$stackPtr]['code']])) { + $braces = $this->newFunctionArrayDereferencing->isFunctionArrayDereferencing($phpcsFile, $stackPtr); + } + + if (empty($braces) && $tokens[$stackPtr]['code'] === \T_STRING) { + $braces = $this->isConstantArrayAccess($phpcsFile, $stackPtr); + } + + if (empty($braces)) { + return; + } + + foreach ($braces as $open => $close) { + // Some of the functions will sniff for both curlies as well as square braces. + if ($tokens[$open]['code'] !== \T_OPEN_CURLY_BRACKET) { + continue; + } + + // Make sure there is something between the braces, otherwise it's still not curly brace array access. + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($open + 1), $close, true); + if ($nextNonEmpty === false) { + // Nothing between the brackets. Parse error. Ignore. + continue; + } + + // OK, so we've found curly brace array access. + $snippet = $phpcsFile->getTokensAsString($stackPtr, (($close - $stackPtr) + 1)); + $fix = $phpcsFile->addFixableWarning( + 'Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: %s', + $open, + 'Found', + array($snippet) + ); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($open, '['); + $phpcsFile->fixer->replaceToken($close, ']'); + $phpcsFile->fixer->endChangeset(); + } + } + } + + + /** + * Determine whether a variable is being dereferenced using curly brace syntax. + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return array An array with the stack pointers to the open/close braces of + * the curly brace array access, or an empty array if no curly + * brace array access was detected. + */ + protected function isVariableArrayAccess(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $current = $stackPtr; + $braces = array(); + + do { + $current = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), null, true); + if ($current === false) { + break; + } + + // Skip over square bracket array access. Bracket styles can be mixed. + if ($tokens[$current]['code'] === \T_OPEN_SQUARE_BRACKET + && isset($tokens[$current]['bracket_closer']) === true + && $current === $tokens[$current]['bracket_opener'] + ) { + $current = $tokens[$current]['bracket_closer']; + continue; + } + + // Handle property access. + if ($tokens[$current]['code'] === \T_OBJECT_OPERATOR) { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), null, true); + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { + // Live coding or parse error. + break; + } + + $current = $nextNonEmpty; + continue; + } + + if ($tokens[$current]['code'] === \T_OPEN_CURLY_BRACKET) { + if (isset($tokens[$current]['bracket_closer']) === false) { + // Live coding or parse error. + break; + } + + $braces[$current] = $tokens[$current]['bracket_closer']; + + // Continue, just in case there is nested access using curly braces, i.e. `$a{$i}{$j};`. + $current = $tokens[$current]['bracket_closer']; + continue; + } + + // If we're still here, we've reached the end of the variable. + break; + + } while (true); + + return $braces; + } + + + /** + * Determine whether a T_STRING is a constant being dereferenced using curly brace syntax. + * + * {@internal Note: the first braces for array access to a constant, for some unknown reason, + * can never be curlies, but have to be square brackets. + * Subsequent braces can be curlies.} + * + * @since 9.3.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return array An array with the stack pointers to the open/close braces of + * the curly brace array access, or an empty array if no curly + * brace array access was detected. + */ + protected function isConstantArrayAccess(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + if ($this->isUseOfGlobalConstant($phpcsFile, $stackPtr) === false + && $tokens[$prevNonEmpty]['code'] !== \T_DOUBLE_COLON // Class constant access. + ) { + return array(); + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + return array(); + } + + if ($tokens[$nextNonEmpty]['code'] !== \T_OPEN_SQUARE_BRACKET + || isset($tokens[$nextNonEmpty]['bracket_closer']) === false + ) { + // Array access for constants must start with square brackets. + return array(); + } + + $current = $tokens[$nextNonEmpty]['bracket_closer']; + $braces = array(); + + do { + $current = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), null, true); + if ($current === false) { + break; + } + + // Skip over square bracket array access. Bracket styles can be mixed. + if ($tokens[$current]['code'] === \T_OPEN_SQUARE_BRACKET + && isset($tokens[$current]['bracket_closer']) === true + && $current === $tokens[$current]['bracket_opener'] + ) { + $current = $tokens[$current]['bracket_closer']; + continue; + } + + if ($tokens[$current]['code'] === \T_OPEN_CURLY_BRACKET) { + if (isset($tokens[$current]['bracket_closer']) === false) { + // Live coding or parse error. + break; + } + + $braces[$current] = $tokens[$current]['bracket_closer']; + + // Continue, just in case there is nested access using curly braces, i.e. `$a{$i}{$j};`. + $current = $tokens[$current]['bracket_closer']; + continue; + } + + // If we're still here, we've reached the end of the variable. + break; + + } while (true); + + return $braces; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php new file mode 100644 index 00000000..ad76828c --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php @@ -0,0 +1,80 @@ +supportsAbove('5.3') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prevNonEmpty === false || $tokens[$prevNonEmpty]['type'] !== 'T_BITWISE_AND') { + return; + } + + $error = 'Assigning the return value of new by reference is deprecated in PHP 5.3'; + $isError = false; + $errorCode = 'Deprecated'; + + if ($this->supportsAbove('7.0') === true) { + $error .= ' and has been removed in PHP 7.0'; + $isError = true; + $errorCode = 'Removed'; + } + + $this->addMessage($phpcsFile, $error, $stackPtr, $isError, $errorCode); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php new file mode 100644 index 00000000..aa5a39a3 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php @@ -0,0 +1,162 @@ +getTokens(); + + // Check whether this is a single quoted or double quoted string. + if ($tokens[$stackPtr]['code'] === \T_CONSTANT_ENCAPSED_STRING) { + + // Find the start of the - potentially multi-line - text string. + $start = $stackPtr; + for ($i = ($stackPtr - 1); $i >= 0; $i--) { + if ($tokens[$i]['code'] === \T_WHITESPACE) { + continue; + } + + if ($tokens[$i]['code'] === \T_CONSTANT_ENCAPSED_STRING) { + $start = $i; + continue; + } + + break; + } + + try { + $textString = $this->getCompleteTextString($phpcsFile, $start, false); + } catch (PHPCS_Exception $e) { + // Something went wrong determining the start of the text string. + return; + } + + $startQuote = $textString[0]; + $endQuote = substr($textString, -1); + if (($startQuote === "'" && $endQuote === "'") + || $startQuote !== $endQuote + ) { + // Single quoted string, not our concern. + return; + } + } + + $content = $this->stripQuotes($tokens[$stackPtr]['content']); + $count = preg_match_all('`(?isValidUnicodeEscapeSequence($match[1]); + } + + if ($this->supportsBelow('5.6') === true && $valid === true) { + $phpcsFile->addError( + 'Unicode codepoint escape sequences are not supported in PHP 5.6 or earlier. Found: %s', + $stackPtr, + 'Found', + array($match[0]) + ); + } + + if ($this->supportsAbove('7.0') === true && $valid === false) { + $phpcsFile->addError( + 'Strings containing a literal \u{ followed by an invalid unicode codepoint escape sequence will cause a fatal error in PHP 7.0 and above. Escape the leading backslash to prevent this. Found: %s', + $stackPtr, + 'Invalid', + array($match[0]) + ); + } + } + } + + + /** + * Verify if the codepoint in a unicode escape sequence is valid. + * + * @since 9.3.0 + * + * @param string $codepoint The codepoint as a string. + * + * @return bool + */ + protected function isValidUnicodeEscapeSequence($codepoint) + { + if (trim($codepoint) === '') { + return false; + } + + // Check if it's a valid hex codepoint. + if (preg_match('`^[0-9A-F]+$`iD', $codepoint, $match) !== 1) { + return false; + } + + if (hexdec($codepoint) > 1114111) { + // Outside of the maximum permissable range. + return false; + } + + return true; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php new file mode 100644 index 00000000..12e47318 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php @@ -0,0 +1,222 @@ + array(string => bool|string)) + */ + protected $newTypeCasts = array( + 'T_UNSET_CAST' => array( + '4.4' => false, + '5.0' => true, + 'description' => 'The unset cast', + ), + 'T_BINARY_CAST' => array( + '5.2.0' => false, + '5.2.1' => true, + 'description' => 'The binary cast', + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.0.1 + * + * @return array + */ + public function register() + { + $tokens = array(); + foreach ($this->newTypeCasts as $token => $versions) { + if (\defined($token)) { + $tokens[] = constant($token); + } + } + + /* + * Work around tokenizer issues. + * + * - (binary) cast is incorrectly tokenized as T_STRING_CAST by PHP and PHPCS. + * - b"something" binary cast is incorrectly tokenized as T_CONSTANT_ENCAPSED_STRING by PHP and PHPCS. + * - Since PHPCS 3.4.0, PHPCS *will* tokenize these correctly. + * + * @link https://github.com/squizlabs/PHP_CodeSniffer/issues/1574 + */ + if (version_compare(PHPCSHelper::getVersion(), '3.4.0', '<') === true) { + $tokens[] = \T_STRING_CAST; + $tokens[] = \T_CONSTANT_ENCAPSED_STRING; + } + + return $tokens; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.0.1 + * + * @param \PHP_CodeSniffer_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(); + $tokenType = $tokens[$stackPtr]['type']; + + // Detect incorrectly tokenized binary casts. + if (isset($this->newTypeCasts[$tokenType]) === false) { + $tokenContent = $tokens[$stackPtr]['content']; + switch ($tokenType) { + case 'T_STRING_CAST': + if (preg_match('`^\(\s*binary\s*\)$`i', $tokenContent) !== 1) { + return; + } + + $tokenType = 'T_BINARY_CAST'; + break; + + case 'T_CONSTANT_ENCAPSED_STRING': + if ((strpos($tokenContent, 'b"') === 0 && substr($tokenContent, -1) === '"') + || (strpos($tokenContent, "b'") === 0 && substr($tokenContent, -1) === "'") + ) { + $tokenType = 'T_BINARY_CAST'; + } else { + return; + } + break; + + } + } + + // If the translation did not yield one of the tokens we are looking for, bow out. + if (isset($this->newTypeCasts[$tokenType]) === false) { + return; + } + + $itemInfo = array( + 'name' => $tokenType, + 'content' => $tokens[$stackPtr]['content'], + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 8.0.1 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->newTypeCasts[$itemInfo['name']]; + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 8.0.1 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array('description'); + } + + + /** + * Retrieve the relevant detail (version) information for use in an error message. + * + * @since 8.0.1 + * + * @param array $itemArray Version and other information about the item. + * @param array $itemInfo Base information about the item. + * + * @return array + */ + public function getErrorInfo(array $itemArray, array $itemInfo) + { + $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); + $errorInfo['description'] = $itemArray['description']; + + return $errorInfo; + } + + + /** + * Filter the error message before it's passed to PHPCS. + * + * @since 8.0.1 + * + * @param string $error The error message which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return string + */ + protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) + { + return $error . '. Found: %s'; + } + + + /** + * Filter the error data before it's passed to PHPCS. + * + * @since 8.0.1 + * + * @param array $data The error data array which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return array + */ + protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) + { + $data[0] = $errorInfo['description']; + $data[] = $itemInfo['content']; + return $data; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php new file mode 100644 index 00000000..3791f0b5 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php @@ -0,0 +1,158 @@ + array(string => bool|string)) + */ + protected $deprecatedTypeCasts = array( + 'T_UNSET_CAST' => array( + '7.2' => false, + 'alternative' => 'unset()', + 'description' => 'unset', + ), + 'T_DOUBLE_CAST' => array( + '7.4' => false, + 'alternative' => '(float)', + 'description' => 'real', + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 8.0.1 + * + * @return array + */ + public function register() + { + $tokens = array(); + foreach ($this->deprecatedTypeCasts as $token => $versions) { + $tokens[] = constant($token); + } + + return $tokens; + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 8.0.1 + * + * @param \PHP_CodeSniffer_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(); + $tokenType = $tokens[$stackPtr]['type']; + + // Special case `T_DOUBLE_CAST` as the same token is used for (float) and (double) casts. + if ($tokenType === 'T_DOUBLE_CAST' && strpos($tokens[$stackPtr]['content'], 'real') === false) { + // Float/double casts, not (real) cast. + return; + } + + $itemInfo = array( + 'name' => $tokenType, + 'description' => $this->deprecatedTypeCasts[$tokenType]['description'], + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get an array of the non-PHP-version array keys used in a sub-array. + * + * @since 8.0.1 + * + * @return array + */ + protected function getNonVersionArrayKeys() + { + return array('description', 'alternative'); + } + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 8.0.1 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->deprecatedTypeCasts[$itemInfo['name']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 8.0.1 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return 'The %s cast is '; + } + + + /** + * Filter the error data before it's passed to PHPCS. + * + * @since 8.0.1 + * + * @param array $data The error data array which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return array + */ + protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) + { + $data[0] = $itemInfo['description']; + return $data; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php new file mode 100644 index 00000000..1e79873c --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php @@ -0,0 +1,187 @@ +examine === false) { + return ($phpcsFile->numTokens + 1); + } + + $phpcsVersion = PHPCSHelper::getVersion(); + + // Don't do anything if the PHPCS version used is above the minimum recommended version. + if (version_compare($phpcsVersion, self::MIN_RECOMMENDED_VERSION, '>=')) { + $this->examine = false; + return ($phpcsFile->numTokens + 1); + } + + if (version_compare($phpcsVersion, self::MIN_SUPPORTED_VERSION, '<')) { + $isError = true; + $message = 'IMPORTANT: Please be advised that the minimum PHP_CodeSniffer version the PHPCompatibility standard supports is %s. You are currently using PHP_CodeSniffer %s. Please upgrade your PHP_CodeSniffer installation. The recommended version of PHP_CodeSniffer for PHPCompatibility is %s or higher.'; + $errorCode = 'Unsupported_' . $this->stringToErrorCode(self::MIN_SUPPORTED_VERSION); + $replacements = array( + self::MIN_SUPPORTED_VERSION, + $phpcsVersion, + self::MIN_RECOMMENDED_VERSION, + $errorCode, + ); + } else { + $isError = false; + $message = 'IMPORTANT: Please be advised that for the most reliable PHPCompatibility results, PHP_CodeSniffer %s or higher should be used. Support for lower versions will be dropped in the foreseeable future. You are currently using PHP_CodeSniffer %s. Please upgrade your PHP_CodeSniffer installation to version %s or higher.'; + $errorCode = 'BelowRecommended_' . $this->stringToErrorCode(self::MIN_RECOMMENDED_VERSION); + $replacements = array( + self::MIN_RECOMMENDED_VERSION, + $phpcsVersion, + self::MIN_RECOMMENDED_VERSION, + $errorCode, + ); + } + + /* + * Figure out the report width to determine how long the delimiter lines should be. + * + * This is not an exact calculation as there are a number of unknowns at the time the + * notice is thrown (whether there are other notices for the file, whether those are + * warnings or errors, whether there are auto-fixable issues etc). + * + * In other words, this is just an approximation to get a reasonably stable and + * readable message layout format. + * + * {@internal + * PHPCS has had some changes as to how the messages display over the years. + * Most significantly in 2.4.0 it was attempted to solve an issue with messages + * containing new lines. Unfortunately, that solution is buggy. + * An improved version has been pulled upstream and will hopefully make it + * into PHPCS 3.3.1/3.4.0. + * + * Anyway, this means that instead of new lines, delimiter lines will be used to improved + * the readability of the (long) message. + * + * Also, as of PHPCS 2.2.0, the report width when using the `-s` option is 8 wider than + * it should be. A patch for that is included in the same upstream PR. + * + * If/when the upstream PR has been merged and the minimum supported/recommended version + * of PHPCompatibility would go beyond that, the below code should be adjusted.} + */ + $reportWidth = PHPCSHelper::getCommandLineData($phpcsFile, 'reportWidth'); + if (empty($reportWidth)) { + $reportWidth = 80; + } + $showSources = PHPCSHelper::getCommandLineData($phpcsFile, 'showSources'); + if ($showSources === true) { + $reportWidth += 6; + } + + $messageWidth = ($reportWidth - 15); // 15 is length of " # | WARNING | ". + $delimiterLine = str_repeat('-', ($messageWidth)); + $disableNotice = 'To disable this notice, add --exclude=PHPCompatibility.Upgrade.LowPHPCS to your command or add to your custom ruleset. '; + $thankYou = 'Thank you for using PHPCompatibility!'; + + $message .= ' ' . $delimiterLine; + $message .= ' ' . $disableNotice; + $message .= ' ' . $delimiterLine; + $message .= ' ' . $thankYou; + + $this->addMessage($phpcsFile, $message, 0, $isError, $errorCode, $replacements); + + $this->examine = false; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php new file mode 100644 index 00000000..7a171633 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php @@ -0,0 +1,182 @@ +examine === false) { + return ($phpcsFile->numTokens + 1); + } + + $phpVersion = phpversion(); + + // Don't do anything if the PHPCS version used is above the minimum recommended version. + if (version_compare($phpVersion, self::MIN_RECOMMENDED_VERSION, '>=')) { + $this->examine = false; + return ($phpcsFile->numTokens + 1); + } + + if (version_compare($phpVersion, self::MIN_SUPPORTED_VERSION, '<')) { + $isError = true; + $message = 'IMPORTANT: Please be advised that the minimum PHP version the PHPCompatibility standard supports is %s. You are currently using PHP %s. Please upgrade your PHP installation. The recommended version of PHP for PHPCompatibility is %s or higher.'; + $errorCode = 'Unsupported_' . $this->stringToErrorCode(self::MIN_SUPPORTED_VERSION); + $replacements = array( + self::MIN_SUPPORTED_VERSION, + $phpVersion, + self::MIN_RECOMMENDED_VERSION, + $errorCode, + ); + } else { + $isError = false; + $message = 'IMPORTANT: Please be advised that for the most reliable PHPCompatibility results, PHP %s or higher should be used. Support for lower versions will be dropped in the foreseeable future. You are currently using PHP %s. Please upgrade your PHP installation to version %s or higher.'; + $errorCode = 'BelowRecommended_' . $this->stringToErrorCode(self::MIN_RECOMMENDED_VERSION); + $replacements = array( + self::MIN_RECOMMENDED_VERSION, + $phpVersion, + self::MIN_RECOMMENDED_VERSION, + $errorCode, + ); + } + + /* + * Figure out the report width to determine how long the delimiter lines should be. + * + * This is not an exact calculation as there are a number of unknowns at the time the + * notice is thrown (whether there are other notices for the file, whether those are + * warnings or errors, whether there are auto-fixable issues etc). + * + * In other words, this is just an approximation to get a reasonably stable and + * readable message layout format. + * + * {@internal + * PHPCS has had some changes as to how the messages display over the years. + * Most significantly in 2.4.0 it was attempted to solve an issue with messages + * containing new lines. Unfortunately, that solution is buggy. + * An improved version has been pulled upstream and will hopefully make it + * into PHPCS 3.3.1/3.4.0. + * + * Anyway, this means that instead of new lines, delimiter lines will be used to improved + * the readability of the (long) message. + * + * Also, as of PHPCS 2.2.0, the report width when using the `-s` option is 8 wider than + * it should be. A patch for that is included in the same upstream PR. + * + * If/when the upstream PR has been merged and the minimum supported/recommended version + * of PHPCompatibility would go beyond that, the below code should be adjusted.} + */ + $reportWidth = PHPCSHelper::getCommandLineData($phpcsFile, 'reportWidth'); + if (empty($reportWidth)) { + $reportWidth = 80; + } + $showSources = PHPCSHelper::getCommandLineData($phpcsFile, 'showSources'); + if ($showSources === true) { + $reportWidth += 6; + } + + $messageWidth = ($reportWidth - 15); // 15 is length of " # | WARNING | ". + $delimiterLine = str_repeat('-', ($messageWidth)); + $disableNotice = 'To disable this notice, add --exclude=PHPCompatibility.Upgrade.LowPHP to your command or add to your custom ruleset. '; + $thankYou = 'Thank you for using PHPCompatibility!'; + + $message .= ' ' . $delimiterLine; + $message .= ' ' . $disableNotice; + $message .= ' ' . $delimiterLine; + $message .= ' ' . $thankYou; + + $this->addMessage($phpcsFile, $message, 0, $isError, $errorCode, $replacements); + + $this->examine = false; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php new file mode 100644 index 00000000..a681a4a3 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php @@ -0,0 +1,118 @@ +supportsBelow('7.1') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$stackPtr]; + + // Deal with PHPCS pre-2.6.0. + if ($token['code'] === \T_USE) { + $hasCurlyBrace = $phpcsFile->findNext(\T_OPEN_CURLY_BRACKET, ($stackPtr + 1), null, false, null, true); + if ($hasCurlyBrace === false) { + return; + } + + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($hasCurlyBrace - 1), null, true); + if ($prevToken === false || $tokens[$prevToken]['code'] !== \T_NS_SEPARATOR) { + return; + } + + $stackPtr = $hasCurlyBrace; + } + + // Still here ? In that case, it is a group use statement. + if ($this->supportsBelow('5.6') === true) { + $phpcsFile->addError( + 'Group use declarations are not allowed in PHP 5.6 or earlier', + $stackPtr, + 'Found' + ); + } + + $closers = array(\T_CLOSE_CURLY_BRACKET); + if (\defined('T_CLOSE_USE_GROUP')) { + $closers[] = \T_CLOSE_USE_GROUP; + } + + $closeCurly = $phpcsFile->findNext($closers, ($stackPtr + 1), null, false, null, true); + if ($closeCurly === false) { + return; + } + + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closeCurly - 1), null, true); + if ($tokens[$prevToken]['code'] === \T_COMMA) { + $phpcsFile->addError( + 'Trailing comma\'s are not allowed in group use statements in PHP 7.1 or earlier', + $prevToken, + 'TrailingCommaFound' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php new file mode 100644 index 00000000..2d166fb5 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php @@ -0,0 +1,109 @@ + string) + */ + protected $validUseNames = array( + 'const' => true, + 'function' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 7.1.4 + * + * @return array + */ + public function register() + { + return array(\T_USE); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 7.1.4 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsBelow('5.5') !== true) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + // Live coding. + return; + } + + if (isset($this->validUseNames[strtolower($tokens[$nextNonEmpty]['content'])]) === false) { + // Not a `use const` or `use function` statement. + return; + } + + // `use const` and `use function` have to be followed by the function/constant name. + $functionOrConstName = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true); + if ($functionOrConstName === false + // Identifies as T_AS or T_STRING, this covers both. + || ($tokens[$functionOrConstName]['content'] === 'as' + || $tokens[$functionOrConstName]['code'] === \T_COMMA) + ) { + // Live coding or incorrect use of reserved keyword, but that is + // covered by the ForbiddenNames sniff. + return; + } + + // Still here ? In that case we have encountered a `use const` or `use function` statement. + $phpcsFile->addError( + 'Importing functions and constants through a "use" statement is not supported in PHP 5.5 or lower.', + $nextNonEmpty, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php new file mode 100644 index 00000000..c7f715d2 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php @@ -0,0 +1,125 @@ +supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $endOfStatement = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($stackPtr + 1)); + if ($endOfStatement === false) { + // No semi-colon - live coding. + return; + } + + for ($ptr = ($stackPtr + 1); $ptr <= $endOfStatement; $ptr++) { + $errorThrown = false; + $nextComma = $phpcsFile->findNext(\T_COMMA, $ptr, $endOfStatement, false, null, true); + $varEnd = ($nextComma === false) ? $endOfStatement : $nextComma; + $variable = $phpcsFile->findNext(\T_VARIABLE, $ptr, $varEnd); + $varString = trim($phpcsFile->getTokensAsString($ptr, ($varEnd - $ptr))); + $data = array($varString); + + if ($variable !== false) { + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($variable - 1), $ptr, true); + + if ($prev !== false && $tokens[$prev]['type'] === 'T_DOLLAR') { + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($variable + 1), $varEnd, true); + + if ($next !== false + && \in_array($tokens[$next]['code'], array(\T_OPEN_SQUARE_BRACKET, \T_OBJECT_OPERATOR, \T_DOUBLE_COLON), true) === true + ) { + $phpcsFile->addError( + 'Global with variable variables is not allowed since PHP 7.0. Found %s', + $variable, + 'Found', + $data + ); + $errorThrown = true; + } else { + $phpcsFile->addWarning( + 'Global with anything other than bare variables is discouraged since PHP 7.0. Found %s', + $variable, + 'NonBareVariableFound', + $data + ); + $errorThrown = true; + } + } + } + + if ($errorThrown === false) { + $dollar = $phpcsFile->findNext(\T_DOLLAR, $ptr, $varEnd); + if ($dollar !== false) { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($dollar + 1), $varEnd, true); + if ($tokens[$next]['code'] === \T_OPEN_CURLY_BRACKET) { + $phpcsFile->addWarning( + 'Global with anything other than bare variables is discouraged since PHP 7.0. Found %s', + $dollar, + 'NonBareVariableFound', + $data + ); + } + } + } + + // Move the stack pointer forward to the next variable for multi-variable statements. + if ($nextComma === false) { + break; + } + $ptr = $nextComma; + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php new file mode 100644 index 00000000..fc0ddc65 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php @@ -0,0 +1,425 @@ + \T_CLASS, + 'T_INTERFACE' => \T_INTERFACE, + 'T_TRAIT' => \T_TRAIT, + ); + + /** + * Scopes to skip over when examining the contents of functions. + * + * @since 9.1.0 + * + * @var array + */ + private $skipOverScopes = array( + 'T_FUNCTION' => true, + 'T_CLOSURE' => true, + ); + + /** + * Valid uses of $this in plain functions or methods outside object context. + * + * @since 9.1.0 + * + * @var array + */ + private $validUseOutsideObject = array( + \T_ISSET => true, + \T_EMPTY => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 9.1.0 + * + * @return array + */ + public function register() + { + if (\defined('T_ANON_CLASS')) { + $this->ooScopeTokens['T_ANON_CLASS'] = \T_ANON_CLASS; + } + + $this->skipOverScopes += $this->ooScopeTokens; + + return array( + \T_FUNCTION, + \T_CLOSURE, + \T_GLOBAL, + \T_CATCH, + \T_FOREACH, + \T_UNSET, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 9.1.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('7.1') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + switch ($tokens[$stackPtr]['code']) { + case \T_FUNCTION: + $this->isThisUsedAsParameter($phpcsFile, $stackPtr); + $this->isThisUsedOutsideObjectContext($phpcsFile, $stackPtr); + break; + + case \T_CLOSURE: + $this->isThisUsedAsParameter($phpcsFile, $stackPtr); + break; + + case \T_GLOBAL: + /* + * $this can no longer be imported using the `global` keyword. + * This worked in PHP 7.0, though in PHP 5.x, it would throw a + * fatal "Cannot re-assign $this" error. + */ + $endOfStatement = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($stackPtr + 1)); + if ($endOfStatement === false) { + // No semi-colon - live coding. + return; + } + + for ($i = ($stackPtr + 1); $i < $endOfStatement; $i++) { + if ($tokens[$i]['code'] !== \T_VARIABLE || $tokens[$i]['content'] !== '$this') { + continue; + } + + $phpcsFile->addError( + '"$this" can no longer be used with the "global" keyword since PHP 7.1.', + $i, + 'Global' + ); + } + + break; + + case \T_CATCH: + /* + * $this can no longer be used as a catch variable. + */ + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { + return; + } + + $varPtr = $phpcsFile->findNext( + \T_VARIABLE, + ($tokens[$stackPtr]['parenthesis_opener'] + 1), + $tokens[$stackPtr]['parenthesis_closer'] + ); + + if ($varPtr === false || $tokens[$varPtr]['content'] !== '$this') { + return; + } + + $phpcsFile->addError( + '"$this" can no longer be used as a catch variable since PHP 7.1.', + $varPtr, + 'Catch' + ); + + break; + + case \T_FOREACH: + /* + * $this can no longer be used as a foreach *value* variable. + * This worked in PHP 7.0, though in PHP 5.x, it would throw a + * fatal "Cannot re-assign $this" error. + */ + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { + return; + } + + $stopPtr = $phpcsFile->findPrevious( + array(\T_AS, \T_DOUBLE_ARROW), + ($tokens[$stackPtr]['parenthesis_closer'] - 1), + $tokens[$stackPtr]['parenthesis_opener'] + ); + if ($stopPtr === false) { + return; + } + + $valueVarPtr = $phpcsFile->findNext( + \T_VARIABLE, + ($stopPtr + 1), + $tokens[$stackPtr]['parenthesis_closer'] + ); + if ($valueVarPtr === false || $tokens[$valueVarPtr]['content'] !== '$this') { + return; + } + + $afterThis = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($valueVarPtr + 1), + $tokens[$stackPtr]['parenthesis_closer'], + true + ); + + if ($afterThis !== false + && ($tokens[$afterThis]['code'] === \T_OBJECT_OPERATOR + || $tokens[$afterThis]['code'] === \T_DOUBLE_COLON) + ) { + return; + } + + $phpcsFile->addError( + '"$this" can no longer be used as value variable in a foreach control structure since PHP 7.1.', + $valueVarPtr, + 'ForeachValueVar' + ); + + break; + + case \T_UNSET: + /* + * $this can no longer be unset. + */ + $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($openParenthesis === false + || $tokens[$openParenthesis]['code'] !== \T_OPEN_PARENTHESIS + || isset($tokens[$openParenthesis]['parenthesis_closer']) === false + ) { + return; + } + + for ($i = ($openParenthesis + 1); $i < $tokens[$openParenthesis]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== \T_VARIABLE || $tokens[$i]['content'] !== '$this') { + continue; + } + + $afterThis = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($i + 1), + $tokens[$openParenthesis]['parenthesis_closer'], + true + ); + + if ($afterThis !== false + && ($tokens[$afterThis]['code'] === \T_OBJECT_OPERATOR + || $tokens[$afterThis]['code'] === \T_DOUBLE_COLON + || $tokens[$afterThis]['code'] === \T_OPEN_SQUARE_BRACKET) + ) { + $i = $afterThis; + continue; + } + + $phpcsFile->addError( + '"$this" can no longer be unset since PHP 7.1.', + $i, + 'Unset' + ); + } + + break; + } + } + + /** + * Check if $this is used as a parameter in a function declaration. + * + * $this can no longer be used as a parameter in a *global* function. + * Use as a parameter in a method was already an error prior to PHP 7.1. + * + * @since 9.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + protected function isThisUsedAsParameter(File $phpcsFile, $stackPtr) + { + if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) !== false) { + return; + } + + $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); + if (empty($params)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + foreach ($params as $param) { + if ($param['name'] !== '$this') { + continue; + } + + if ($tokens[$stackPtr]['code'] === \T_FUNCTION) { + $phpcsFile->addError( + '"$this" can no longer be used as a parameter since PHP 7.1.', + $param['token'], + 'FunctionParam' + ); + } else { + $phpcsFile->addError( + '"$this" can no longer be used as a closure parameter since PHP 7.0.7.', + $param['token'], + 'ClosureParam' + ); + } + } + } + + /** + * Check if $this is used in a plain function or method. + * + * Prior to PHP 7.1, this would result in an "undefined variable" notice + * and execution would continue with $this regarded as `null`. + * As of PHP 7.1, this throws an exception. + * + * Note: use within isset() and empty() to check object context is still allowed. + * Note: $this can still be used within a closure. + * + * @since 9.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + protected function isThisUsedOutsideObjectContext(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) !== false) { + $methodProps = $phpcsFile->getMethodProperties($stackPtr); + if ($methodProps['is_static'] === false) { + return; + } else { + $methodName = $phpcsFile->getDeclarationName($stackPtr); + if ($methodName === '__call') { + /* + * This is an exception. + * @link https://wiki.php.net/rfc/this_var#always_show_true_this_value_in_magic_method_call + */ + return; + } + } + } + + for ($i = ($tokens[$stackPtr]['scope_opener'] + 1); $i < $tokens[$stackPtr]['scope_closer']; $i++) { + if (isset($this->skipOverScopes[$tokens[$i]['type']])) { + if (isset($tokens[$i]['scope_closer']) === false) { + // Live coding or parse error, will only lead to inaccurate results. + return; + } + + // Skip over nested structures. + $i = $tokens[$i]['scope_closer']; + continue; + } + + if ($tokens[$i]['code'] !== \T_VARIABLE || $tokens[$i]['content'] !== '$this') { + continue; + } + + if (isset($tokens[$i]['nested_parenthesis']) === true) { + $nestedParenthesis = $tokens[$i]['nested_parenthesis']; + $nestedOpenParenthesis = array_keys($nestedParenthesis); + $lastOpenParenthesis = array_pop($nestedOpenParenthesis); + + $previousNonEmpty = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($lastOpenParenthesis - 1), + null, + true, + null, + true + ); + + if (isset($this->validUseOutsideObject[$tokens[$previousNonEmpty]['code']])) { + continue; + } + } + + $phpcsFile->addError( + '"$this" can no longer be used in a plain function or method since PHP 7.1.', + $i, + 'OutsideObjectContext' + ); + } + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php new file mode 100644 index 00000000..f7948079 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php @@ -0,0 +1,114 @@ +supportsAbove('7.0') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + // Verify that the next token is a square open bracket. If not, bow out. + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); + + if ($nextToken === false || $tokens[$nextToken]['code'] !== \T_OPEN_SQUARE_BRACKET || isset($tokens[$nextToken]['bracket_closer']) === false) { + return; + } + + // The previous non-empty token has to be a $, -> or ::. + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); + if ($prevToken === false || \in_array($tokens[$prevToken]['code'], array(\T_DOLLAR, \T_OBJECT_OPERATOR, \T_DOUBLE_COLON), true) === false) { + return; + } + + // For static object calls, it only applies when this is a function call. + if ($tokens[$prevToken]['code'] === \T_DOUBLE_COLON) { + $hasBrackets = $tokens[$nextToken]['bracket_closer']; + while (($hasBrackets = $phpcsFile->findNext(Tokens::$emptyTokens, ($hasBrackets + 1), null, true, null, true)) !== false) { + if ($tokens[$hasBrackets]['code'] === \T_OPEN_SQUARE_BRACKET) { + if (isset($tokens[$hasBrackets]['bracket_closer'])) { + $hasBrackets = $tokens[$hasBrackets]['bracket_closer']; + continue; + } else { + // Live coding. + return; + } + + } elseif ($tokens[$hasBrackets]['code'] === \T_OPEN_PARENTHESIS) { + // Caught! + break; + + } else { + // Not a function call, so bow out. + return; + } + } + + // Now let's also prevent false positives when used with self and static which still work fine. + $classToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), null, true, null, true); + if ($classToken !== false) { + if ($tokens[$classToken]['code'] === \T_STATIC || $tokens[$classToken]['code'] === \T_SELF) { + return; + } elseif ($tokens[$classToken]['code'] === \T_STRING && $tokens[$classToken]['content'] === 'self') { + return; + } + } + } + + $phpcsFile->addError( + 'Indirect access to variables, properties and methods will be evaluated strictly in left-to-right order since PHP 7.0. Use curly braces to remove ambiguity.', + $stackPtr, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php new file mode 100644 index 00000000..c814e7dc --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php @@ -0,0 +1,318 @@ + array(string => bool|string)) + */ + protected $removedGlobalVariables = array( + 'HTTP_POST_VARS' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_POST', + ), + 'HTTP_GET_VARS' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_GET', + ), + 'HTTP_ENV_VARS' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_ENV', + ), + 'HTTP_SERVER_VARS' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_SERVER', + ), + 'HTTP_COOKIE_VARS' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_COOKIE', + ), + 'HTTP_SESSION_VARS' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_SESSION', + ), + 'HTTP_POST_FILES' => array( + '5.3' => false, + '5.4' => true, + 'alternative' => '$_FILES', + ), + + 'HTTP_RAW_POST_DATA' => array( + '5.6' => false, + '7.0' => true, + 'alternative' => 'php://input', + ), + + 'php_errormsg' => array( + '7.2' => false, + 'alternative' => 'error_get_last()', + ), + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.5 + * @since 7.0 + * + * @return array + */ + public function register() + { + return array(\T_VARIABLE); + } + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * @since 7.0 + * + * @param \PHP_CodeSniffer_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) + { + if ($this->supportsAbove('5.3') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $varName = substr($tokens[$stackPtr]['content'], 1); + + if (isset($this->removedGlobalVariables[$varName]) === false) { + return; + } + + if ($this->isClassProperty($phpcsFile, $stackPtr) === true) { + // Ok, so this was a class property declaration, not our concern. + return; + } + + // Check for static usage of class properties shadowing the removed global variables. + if ($this->inClassScope($phpcsFile, $stackPtr, false) === true) { + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); + if ($prevToken !== false && $tokens[$prevToken]['code'] === \T_DOUBLE_COLON) { + return; + } + } + + // Do some additional checks for the $php_errormsg variable. + if ($varName === 'php_errormsg' + && $this->isTargetPHPErrormsgVar($phpcsFile, $stackPtr, $tokens) === false + ) { + return; + } + + // Still here, so throw an error/warning. + $itemInfo = array( + 'name' => $varName, + ); + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + + /** + * Get the relevant sub-array for a specific item from a multi-dimensional array. + * + * @since 7.1.0 + * + * @param array $itemInfo Base information about the item. + * + * @return array Version and other information about the item. + */ + public function getItemArray(array $itemInfo) + { + return $this->removedGlobalVariables[$itemInfo['name']]; + } + + + /** + * Get the error message template for this sniff. + * + * @since 7.1.0 + * + * @return string + */ + protected function getErrorMsgTemplate() + { + return "Global variable '\$%s' is "; + } + + + /** + * Filter the error message before it's passed to PHPCS. + * + * @since 8.1.0 + * + * @param string $error The error message which was created. + * @param array $itemInfo Base information about the item this error message applies to. + * @param array $errorInfo Detail information about an item this error message applies to. + * + * @return string + */ + protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) + { + if ($itemInfo['name'] === 'php_errormsg') { + $error = str_replace('Global', 'The', $error); + } + return $error; + } + + /** + * Run some additional checks for the `$php_errormsg` variable. + * + * @since 8.1.0 + * + * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param array $tokens Token array of the current file. + * + * @return bool + */ + private function isTargetPHPErrormsgVar(File $phpcsFile, $stackPtr, array $tokens) + { + $scopeStart = 0; + + /* + * If the variable is detected within the scope of a function/closure, limit the checking. + */ + $function = $phpcsFile->getCondition($stackPtr, \T_CLOSURE); + if ($function === false) { + $function = $phpcsFile->getCondition($stackPtr, \T_FUNCTION); + } + + // It could also be a function param, which is not in the function scope. + if ($function === false && isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $nestedParentheses = $tokens[$stackPtr]['nested_parenthesis']; + $parenthesisCloser = end($nestedParentheses); + if (isset($tokens[$parenthesisCloser]['parenthesis_owner']) + && ($tokens[$tokens[$parenthesisCloser]['parenthesis_owner']]['code'] === \T_FUNCTION + || $tokens[$tokens[$parenthesisCloser]['parenthesis_owner']]['code'] === \T_CLOSURE) + ) { + $function = $tokens[$parenthesisCloser]['parenthesis_owner']; + } + } + + if ($function !== false) { + $scopeStart = $tokens[$function]['scope_opener']; + } + + /* + * Now, let's do some additional checks. + */ + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + // Is the variable being used as an array ? + if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === \T_OPEN_SQUARE_BRACKET) { + // The PHP native variable is a string, so this is probably not it + // (except for array access to string, but why would you in this case ?). + return false; + } + + // Is this a variable assignment ? + if ($nextNonEmpty !== false + && isset(Tokens::$assignmentTokens[$tokens[$nextNonEmpty]['code']]) === true + ) { + return false; + } + + // Is this a function param shadowing the PHP native one ? + if ($function !== false) { + $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $function); + if (\is_array($parameters) === true && empty($parameters) === false) { + foreach ($parameters as $param) { + if ($param['name'] === '$php_errormsg') { + return false; + } + } + } + } + + $skipPast = array( + 'T_CLASS' => true, + 'T_ANON_CLASS' => true, + 'T_INTERFACE' => true, + 'T_TRAIT' => true, + 'T_FUNCTION' => true, + 'T_CLOSURE' => true, + ); + + // Walk back and see if there is an assignment to the variable within the same scope. + for ($i = ($stackPtr - 1); $i >= $scopeStart; $i--) { + if ($tokens[$i]['code'] === \T_CLOSE_CURLY_BRACKET + && isset($tokens[$i]['scope_condition']) + && isset($skipPast[$tokens[$tokens[$i]['scope_condition']]['type']]) + ) { + // Skip past functions, classes etc. + $i = $tokens[$i]['scope_condition']; + continue; + } + + if ($tokens[$i]['code'] !== \T_VARIABLE || $tokens[$i]['content'] !== '$php_errormsg') { + continue; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); + + if ($nextNonEmpty !== false + && isset(Tokens::$assignmentTokens[$tokens[$nextNonEmpty]['code']]) === true + ) { + return false; + } + } + + return true; + } +} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml new file mode 100644 index 00000000..3eb0b673 --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml @@ -0,0 +1,7 @@ + + + Coding Standard that checks for PHP version compatibility. + + ./../PHPCSAliases.php + + diff --git a/trunk/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php b/trunk/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php new file mode 100644 index 00000000..f66ec0cf --- /dev/null +++ b/trunk/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php @@ -0,0 +1,86 @@ +=') + && class_exists('PHPUnit_Framework_TestCase') === false +) { + class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase'); +} + +require_once __DIR__ . $ds . 'PHPCompatibility' . $ds . 'Tests' . $ds . 'BaseSniffTest.php'; +require_once __DIR__ . $ds . 'PHPCompatibility' . $ds . 'Util' . $ds . 'Tests' . $ds . 'CoreMethodTestFrame.php'; +unset($ds, $phpcsDir, $vendorDir); diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/LICENSE b/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/LICENSE new file mode 100644 index 00000000..65c5ca88 --- /dev/null +++ b/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat/ruleset.xml b/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat/ruleset.xml new file mode 100644 index 00000000..e67a12e0 --- /dev/null +++ b/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat/ruleset.xml @@ -0,0 +1,40 @@ + + + PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Paragonie random_compat library. + + + + + + + + + + + + + + + + + + + /random_compat/lib/byte_safe_strings\.php$ + + + /random_compat/lib/random_bytes_dev_urandom\.php$ + + + /random_compat/lib/random_bytes_mcrypt\.php$ + + + /random_compat/lib/random_bytes_mcrypt\.php$ + + + /random_compat/lib/random_bytes_mcrypt\.php$ + + + /random_compat/lib/random_bytes_libsodium\.php$ + + + diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieSodiumCompat/ruleset.xml b/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieSodiumCompat/ruleset.xml new file mode 100644 index 00000000..ee1f6ab5 --- /dev/null +++ b/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieSodiumCompat/ruleset.xml @@ -0,0 +1,245 @@ + + + PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Paragonie sodium_compat library. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /sodium_compat/autoload\.php$ + + + /sodium_compat/src/Core(32)?/Curve25519/Fe\.php$ + /sodium_compat/src/Core/AES/Block\.php$ + + + /sodium_compat/src/Core/Util\.php$ + + + /sodium_compat/src/Core/Util\.php$ + + + /sodium_compat/src/Compat\.php$ + + + /sodium_compat/src/Compat\.php$ + + + /sodium_compat/src/Compat\.php$ + + + /sodium_compat/src/Compat\.php$ + + + /sodium_compat/src/Compat\.php$ + + + /sodium_compat/src/Compat\.php$ + + + /sodium_compat/src/Compat\.php$ + + + /sodium_compat/src/Compat\.php$ + + + /sodium_compat/src/Compat\.php$ + + + /sodium_compat/src/Core/Util\.php$ + + + diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-wp/LICENSE b/trunk/vendor/phpcompatibility/phpcompatibility-wp/LICENSE new file mode 100644 index 00000000..65c5ca88 --- /dev/null +++ b/trunk/vendor/phpcompatibility/phpcompatibility-wp/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml b/trunk/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml new file mode 100644 index 00000000..7f797a19 --- /dev/null +++ b/trunk/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml @@ -0,0 +1,85 @@ + + + WordPress specific ruleset which checks for PHP cross version compatibility. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/CHANGELOG.md b/trunk/vendor/phpcsstandards/phpcsextra/CHANGELOG.md new file mode 100644 index 00000000..3ee3258b --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/CHANGELOG.md @@ -0,0 +1,590 @@ +# Change Log for the PHPCSExtra standard for PHP CodeSniffer + +All notable changes to this project will be documented in this file. + +This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses [Semantic Versioning](http://semver.org/). + +**Legend**: +:wrench: = Includes auto-fixer. +:bar_chart: = Includes metrics. +:books: = Includes CLI documentation. + + +## [Unreleased] + +_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 + +#### Other + +* Various housekeeping. + +### Fixed + +#### Universal + +* `Universal.CodeAnalysis.ConstructorDestructorReturn`: the sniff will now correctly ignore methods mirroring the class name (PHP-4 style constructors) in namespaced code. [#207], [#272] + +[#272]: https://github.com/PHPCSStandards/PHPCSExtra/pull/272 + + +## [1.1.1] - 2023-08-26 + +### Changed + +#### Modernize + +* `Modernize.FunctionCalls.Dirname`: the sniff will now respect a potentially set [`php_version` configuration option][php_version-config] and only report on modernizations which are possible on the configured `php_version`. [#261] + If the `php_version` is not set, the sniff will continue to report on all modernization options. + +#### Other + +* Various documentation improvements. Props in part to [@szepeviktor]. +* Improved defensive coding in select places. +* Various housekeeping. + +[#261]: https://github.com/PHPCSStandards/PHPCSExtra/pull/261 + + +## [1.1.0] - 2023-07-19 + +### Added + +#### Universal + +* :wrench: :books: New `Universal.CodeAnalysis.NoEchoSprintf` sniff to detect use of the inefficient `echo [v]sprintf(...);` combi and recommends using `[v]printf()` instead. [#242] +* :bar_chart: :books: New `Universal.FunctionDeclarations.NoLongClosures` sniff to detect "long" closures and recommend using a named function instead. [#240] + The sniff offers the following properties to influence its behaviour: `recommendedLines` (defaults to `5`), `maxLines` (defaults to `8`), `ignoreCommentLines` (defaults to `true`) and `ignoreEmptyLines` (defaults to `true`). +* :wrench: :bar_chart: :books: New `Universal.FunctionDeclarations.RequireFinalMethodsInTraits` sniff to enforce non-private, non-abstract methods in traits to be declared as `final`. [#243], [#245] + There is a separate `NonFinalMagicMethodFound` error code for magic methods to allow those to be excluded from the check. +* :wrench: :bar_chart: :books: New `Universal.UseStatements.DisallowMixedGroupUse` sniff to disallow group use statements which import a combination of namespace/OO construct, functions and/or constants in one statement. [#241], [#246] + Note: the fixer will use a semi-standardized format for group use statements. If there are more specific requirements for the formatting of group use statements, the ruleset configurator should ensure that additional sniffs are included in the ruleset to enforce the required format. +* :wrench: :bar_chart: :books: New `Universal.UseStatements.KeywordSpacing` sniff to enforce the use of a single space after the `use`, `function`, `const` keywords and both before and after the `as` keyword in import `use` statements. [#247] + The sniff has modular error codes to allow for disabling individual checks. +* :wrench: :books: New `Universal.UseStatements.NoUselessAliases` sniff to detect useless aliases (aliasing something to its original name) in import use statements. [#244] + Note: as OO and function names in PHP are case-insensitive, aliasing to the same name, using a different case is also considered useless. +* :wrench: :bar_chart: :books: New `Universal.WhiteSpace.CommaSpacing` sniff to enforce that there is no space before a comma and exactly one space, or a new line, after a comma. [#254] + Additionally, the sniff also enforces that the comma should follow the code and not be placed after a trailing comment. + The sniff has modular error codes to allow for disabling individual checks and checks in certain contexts. + The sniff will respect a potentially set [`php_version` configuration option][php_version-config] when deciding how to handle the spacing after a heredoc/nowdoc closer. + +### Changed + +#### Universal + +* Minor performance improvements for the `Universal.Arrays.DuplicateArrayKey` and the `Universal.CodeAnalysis.ConstructorDestructorReturn` sniffs. [#251], [#252] + +#### Other + +* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.8` (was `^1.0.6`). [#249], [#254] +* Various housekeeping. + +[#240]: https://github.com/PHPCSStandards/PHPCSExtra/pull/240 +[#241]: https://github.com/PHPCSStandards/PHPCSExtra/pull/241 +[#242]: https://github.com/PHPCSStandards/PHPCSExtra/pull/242 +[#243]: https://github.com/PHPCSStandards/PHPCSExtra/pull/243 +[#244]: https://github.com/PHPCSStandards/PHPCSExtra/pull/244 +[#245]: https://github.com/PHPCSStandards/PHPCSExtra/pull/245 +[#246]: https://github.com/PHPCSStandards/PHPCSExtra/pull/246 +[#247]: https://github.com/PHPCSStandards/PHPCSExtra/pull/247 +[#249]: https://github.com/PHPCSStandards/PHPCSExtra/pull/249 +[#251]: https://github.com/PHPCSStandards/PHPCSExtra/pull/251 +[#252]: https://github.com/PHPCSStandards/PHPCSExtra/pull/252 +[#254]: https://github.com/PHPCSStandards/PHPCSExtra/pull/254 + + +## [1.0.4] - 2023-06-18 + +### Changed + +#### Other + +* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.6` (was `^1.0.0`). [#237] +* Various housekeeping. + +### Fixed + +#### Universal + +* `Universal.Constants.LowercaseClassResolutionKeyword`: prevent false positives for function calls to methods called `class`. [#226] + +[#226]: https://github.com/PHPCSStandards/PHPCSExtra/pull/226 +[#237]: https://github.com/PHPCSStandards/PHPCSExtra/pull/237 + + +## [1.0.3] - 2023-03-28 + +### Changed + +#### Universal + +* `Universal.WhiteSpace.DisallowInlineTabs`: significant performance improvement. [#216], [#217] + +#### Other + +* Various housekeeping. + +### Fixed + +#### Modernize + +* `Modernize.FunctionCalls.Dirname`: prevent false positives for attribute classes called `dirname`. [#211], [#213] + +[#211]: https://github.com/PHPCSStandards/PHPCSExtra/pull/211 +[#213]: https://github.com/PHPCSStandards/PHPCSExtra/pull/213 +[#216]: https://github.com/PHPCSStandards/PHPCSExtra/pull/216 +[#217]: https://github.com/PHPCSStandards/PHPCSExtra/pull/217 + + +## [1.0.2] - 2023-01-10 + +### Changed + +#### Universal + +* `Universal.CodeAnalysis.ConstructorDestructorReturn`: the sniff will now respect a potentially set [`php_version` configuration option][php_version-config] and only report on PHP4-style constructors when the `php_version` is below `'80000'`. Thanks [@anomiex] for reporting! [#207], [#208] + +[#207]: https://github.com/PHPCSStandards/PHPCSExtra/issues/207 +[#208]: https://github.com/PHPCSStandards/PHPCSExtra/pull/208 + + +## [1.0.1] - 2023-01-05 + +### Fixed + +#### Universal + +* `Universal.CodeAnalysis.ConstructorDestructorReturn`: fixed false positive for return statements in nested functions/closures declared within constructor/destructor methods. Thanks [@anomiex] for reporting! [#201], [#202] + +[#201]: https://github.com/PHPCSStandards/PHPCSExtra/issues/201 +[#202]: https://github.com/PHPCSStandards/PHPCSExtra/pull/202 + + +## [1.0.0] - 2023-01-04 + +:warning: Important: this package now requires [PHPCSUtils 1.0.0]. Please make sure you use `--with-[all-]dependencies` when running `composer update`. :exclamation: + +For the full list of features, please see the changelogs of the alpha/rc releases: +* [1.0.0-rc1](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-rc1) +* [1.0.0-alpha3](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-alpha3) +* [1.0.0-alpha2](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-alpha2) +* [1.0.0-alpha1](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-alpha1) + +### Changed + +#### Other + +* Updated various sniffs to take advantage of PHPCSUtils 1.0.0(-rc1). [#193], [#194], [#195] +* Minor documentation improvements. +* Various housekeeping. + +### Fixed + +#### Modernize + +* `Modernize.FunctionCalls.Dirname`: the sniff will now correctly recognize magic constants in a case-insensitive manner. [#187] + +[PHPCSUtils 1.0.0]: https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.0 + +[#187]: https://github.com/PHPCSStandards/PHPCSExtra/pull/187 +[#193]: https://github.com/PHPCSStandards/PHPCSExtra/pull/193 +[#194]: https://github.com/PHPCSStandards/PHPCSExtra/pull/194 +[#195]: https://github.com/PHPCSStandards/PHPCSExtra/pull/195 + + +## [1.0.0-RC1] - 2022-12-07 + +:warning: Important: this package now requires [PHPCSUtils 1.0.0-alpha4]. Please make sure you use `--with-[all-]dependencies` when running `composer update`. :exclamation: + +### Added + +#### Modernize + +* This is a new standard with one sniff to start with. +* :wrench: :books: New `Modernize.FunctionCalls.Dirname` sniff to detect and auto-fix two typical code modernizations which can be made related to the [`dirname()`][php-manual-dirname] function. [#172] + +#### Universal + +* :wrench: :bar_chart: :books: New `Universal.Classes.DisallowAnonClassParentheses` sniff to disallow the use of parentheses when declaring an anonymous class without passing parameters. [#76], [#162] +* :wrench: :bar_chart: :books: New `Universal.Classes.RequireAnonClassParentheses` sniff to require the use of parentheses when declaring an anonymous class, whether parameters are passed or not. [#76], [#166] +* :wrench: :bar_chart: :books: New `Universal.Classes.DisallowFinalClass` sniff to disallow classes being declared `final`. [#108], [#114], [#148], [#163] +* :wrench: :bar_chart: :books: New `Universal.Classes.RequireFinalClass` sniff to require all non-`abstract` classes to be declared `final`. [#109], [#148], [#164] + Warning: the auto-fixer for this sniff _may_ have unintended side-effects for applications and should be used with care! This is considered a _risky_ fixer. +* :wrench: :bar_chart: :books: New `Universal.Classes.ModifierKeywordOrder` sniff to standardize the modifier keyword order for class declarations. [#142] + The sniff offers an `order` property to specify the preferred order. +* :wrench: :books: New `Universal.CodeAnalysis.ConstructorDestructorReturn` sniff to verify that class constructor/destructor methods 1) do not have a return type declaration and 2) do not return a value. [#137], [#140], [#146] Inspired by [@derickr]. +* :wrench: :books: New `Universal.CodeAnalysis.ForeachUniqueAssignment` sniff to detect `foreach` control structures which use the same variable for both the key as well as the value assignment as this will lead to unexpected - and most likely unintended - behaviour. [#110], [#175] + The fixer will maintain the existing behaviour of the code. Mind: this may not be the _intended_ behaviour. +* :wrench: :books: New `Universal.CodeAnalysis.StaticInFinalClass` sniff to detect using `static` instead of `self` in OO constructs which are `final`. [#116], [#180] + The sniff has modular error codes to allow for making exceptions based on the type of use for `static`. +* :wrench: :bar_chart: :books: New `Universal.Constants.LowercaseClassResolutionKeyword` sniff to enforce that the `class` keyword when used for class name resolution, i.e. `::class`, is in lowercase. [#72] +* :wrench: :bar_chart: :books: New `Universal.Constants.ModifierKeywordOrder` sniff to standardize the modifier keyword order for OO constant declarations. [#143] + The sniff offers an `order` property to specify the preferred order. +* :wrench: :books: New `Universal.ControlStructures.DisallowLonelyIf` sniff to disallow `if` statements as the only statement in an `else` block. [#85], [#168], [#169] + Inspired by the [ESLint "no lonely if"] rule. + Note: This sniff will not fix the indentation of the "inner" code. It is strongly recommended to run this sniff together with the `Generic.WhiteSpace.ScopeIndent` sniff to get the correct indentation. +* :bar_chart: :books: New `Universal.Files.SeparateFunctionsFromOO` sniff to enforce that a file should either declare (global/namespaced) functions or declare OO structures, but not both. [#95], [#170], [#171] + Nested function declarations, i.e. functions declared within a function/method will be disregarded for the purposes of this sniff. + The same goes for anonymous classes, closures and arrow functions. +* :books: New `Universal.NamingConventions.NoReservedKeywordParameterNames` sniff to verify that function parameters do not use reserved keywords as names, as this can quickly become confusing when people use them in function calls using named parameters. [#80], [#81], [#106], [#107], [#173] + The sniff has modular error codes to allow for making exceptions for specific keywords. +* :wrench: :bar_chart: :books: New `Universal.Operators.TypeSeparatorSpacing` sniff to enforce no spaces around union type and intersection type separators. [#117] +* :wrench: :books: New `Universal.PHP.OneStatementInShortEchoTag` sniff to disallow short open echo tags `= 8.0][php-rfc-negative_array_index]. [#177], [#178] + If a [`php_version` configuration option][php_version-config] has been passed to PHPCS, it will be respected by the sniff and only report duplicate keys for the configured PHP version. +* `Universal.ControlStructures.DisallowAlternativeSyntax`: the sniff will now also record a metric when single-line (no body) control structures are encountered. [#158] +* `Universal.ControlStructures.DisallowAlternativeSyntax`: the error message thrown by the sniff is now more descriptive. [#159] +* `Universal.ControlStructures.DisallowAlternativeSyntax`: metrics will no longer be recorded for `elseif` and `else` keywords, but only on the `if` keyword as the type of syntax used has to be the same for the whole "chain". [#161] +* `Universal.Lists.DisallowLongListSyntax`: the sniff will no longer record (incomplete) metrics about long vs short list usage. [#155] +* `Universal.Lists.DisallowShortListSyntax`: the sniff will now record (complete) metrics about long vs short list usage. [#155] +* `Universal.OOStructures.AlphabeticExtendsImplements`: documented support for `enum ... implements`. [#150] +* `Universal.UseStatements.DisallowUseClass`: updated error message and metric name to take PHP 8.1 `enum`s into account. [#149] +* `Universal.UseStatements.NoLeadingBackslash`: the sniff will now also flag and auto-fix leading backslashes in group use statements. [#167] + +#### Other +* Updated the sniffs for compatibility with PHPCSUtils 1.0.0-alpha4. [#134] +* Updated the sniffs to correctly handle PHP 8.0/8.1/8.2 features whenever relevant. +* Readme: Updated installation instructions for compatibility with Composer 2.2+. [#101] +* Composer: The minimum `PHP_CodeSniffer` requirement has been updated to `^3.7.1` (was `^3.3.1`). [#115], [#130] +* Composer: The package will now identify itself as a static analysis tool. Thanks [@GaryJones]! [#126] +* All non-`abstract` classes in this package are now `final`. [#121] +* All XML documentation now has a schema annotation. [#128] +* Various housekeeping. + +### Fixed + +The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which potentially could have affected sniffs in this package. + +#### NormalizedArrays +* `NormalizedArrays.Arrays.ArrayBraceSpacing`: the sniff now allows for trailing comments after the array opener in multi-line arrays. [#118] +* `NormalizedArrays.Arrays.ArrayBraceSpacing`: trailing comments at the end of an array, but before the closer, in multi-line arrays will no longer confuse the sniff. [#135] +* `NormalizedArrays.Arrays.CommaAfterLast`: the fixer will now recognize PHP 7.3+ flexible heredoc/nowdocs and in that case, will add the comma on the same line as the heredoc/nowdoc closer. [#144] + +#### Universal +* `Universal.Arrays.DisallowShortArraySyntax`: nested short arrays in short lists will now be detected and fixed correctly. [#153] +* `Universal.ControlStructures.DisallowAlternativeSyntax`: the sniff will no longer bow out indiscriminately when the `allowWithInlineHTML` property is set to `true`. [#90], [#161] +* `Universal.ControlStructures.DisallowAlternativeSyntax`: when alternative control structure syntax is allowed in combination with inline HTML (`allowWithInlineHTML` property set to `true`), inline HTML in functions declared within the control structure body will no longer be taken into account for determining whether or not the control structure contains inline HTML. [#160] +* `Universal.Lists.DisallowShortListSyntax`: the sniff will work around a tokenizer bug in PHPCS 3.7.1, which previously could lead to false negatives. [#151]. +* `Universal.Lists.DisallowShortListSyntax`: nested short lists in short arrays will now be detected and fixed correctly. [#152] +* `Universal.Operators.DisallowStandalonePostIncrementDecrement`: the sniff will now correctly recognize stand-alone statements which end on a PHP close tag. [#176] + +[#72]: https://github.com/PHPCSStandards/PHPCSExtra/pull/72 +[#76]: https://github.com/PHPCSStandards/PHPCSExtra/pull/76 +[#80]: https://github.com/PHPCSStandards/PHPCSExtra/pull/80 +[#81]: https://github.com/PHPCSStandards/PHPCSExtra/pull/81 +[#85]: https://github.com/PHPCSStandards/PHPCSExtra/pull/85 +[#89]: https://github.com/PHPCSStandards/PHPCSExtra/pull/89 +[#90]: https://github.com/PHPCSStandards/PHPCSExtra/pull/90 +[#95]: https://github.com/PHPCSStandards/PHPCSExtra/pull/95 +[#101]: https://github.com/PHPCSStandards/PHPCSExtra/pull/101 +[#106]: https://github.com/PHPCSStandards/PHPCSExtra/pull/106 +[#107]: https://github.com/PHPCSStandards/PHPCSExtra/pull/107 +[#108]: https://github.com/PHPCSStandards/PHPCSExtra/pull/108 +[#109]: https://github.com/PHPCSStandards/PHPCSExtra/pull/109 +[#110]: https://github.com/PHPCSStandards/PHPCSExtra/pull/110 +[#114]: https://github.com/PHPCSStandards/PHPCSExtra/pull/114 +[#115]: https://github.com/PHPCSStandards/PHPCSExtra/pull/115 +[#116]: https://github.com/PHPCSStandards/PHPCSExtra/pull/116 +[#117]: https://github.com/PHPCSStandards/PHPCSExtra/pull/117 +[#118]: https://github.com/PHPCSStandards/PHPCSExtra/pull/118 +[#119]: https://github.com/PHPCSStandards/PHPCSExtra/pull/119 +[#120]: https://github.com/PHPCSStandards/PHPCSExtra/pull/120 +[#121]: https://github.com/PHPCSStandards/PHPCSExtra/pull/121 +[#122]: https://github.com/PHPCSStandards/PHPCSExtra/pull/122 +[#123]: https://github.com/PHPCSStandards/PHPCSExtra/pull/123 +[#124]: https://github.com/PHPCSStandards/PHPCSExtra/pull/124 +[#126]: https://github.com/PHPCSStandards/PHPCSExtra/pull/126 +[#128]: https://github.com/PHPCSStandards/PHPCSExtra/pull/128 +[#130]: https://github.com/PHPCSStandards/PHPCSExtra/pull/130 +[#134]: https://github.com/PHPCSStandards/PHPCSExtra/pull/134 +[#135]: https://github.com/PHPCSStandards/PHPCSExtra/pull/135 +[#137]: https://github.com/PHPCSStandards/PHPCSExtra/pull/137 +[#140]: https://github.com/PHPCSStandards/PHPCSExtra/pull/140 +[#142]: https://github.com/PHPCSStandards/PHPCSExtra/pull/142 +[#143]: https://github.com/PHPCSStandards/PHPCSExtra/pull/143 +[#144]: https://github.com/PHPCSStandards/PHPCSExtra/pull/144 +[#146]: https://github.com/PHPCSStandards/PHPCSExtra/pull/146 +[#147]: https://github.com/PHPCSStandards/PHPCSExtra/pull/147 +[#148]: https://github.com/PHPCSStandards/PHPCSExtra/pull/148 +[#149]: https://github.com/PHPCSStandards/PHPCSExtra/pull/149 +[#150]: https://github.com/PHPCSStandards/PHPCSExtra/pull/150 +[#151]: https://github.com/PHPCSStandards/PHPCSExtra/pull/151 +[#152]: https://github.com/PHPCSStandards/PHPCSExtra/pull/152 +[#153]: https://github.com/PHPCSStandards/PHPCSExtra/pull/153 +[#154]: https://github.com/PHPCSStandards/PHPCSExtra/pull/154 +[#155]: https://github.com/PHPCSStandards/PHPCSExtra/pull/155 +[#158]: https://github.com/PHPCSStandards/PHPCSExtra/pull/158 +[#159]: https://github.com/PHPCSStandards/PHPCSExtra/pull/159 +[#160]: https://github.com/PHPCSStandards/PHPCSExtra/pull/160 +[#161]: https://github.com/PHPCSStandards/PHPCSExtra/pull/161 +[#162]: https://github.com/PHPCSStandards/PHPCSExtra/pull/162 +[#163]: https://github.com/PHPCSStandards/PHPCSExtra/pull/163 +[#164]: https://github.com/PHPCSStandards/PHPCSExtra/pull/164 +[#165]: https://github.com/PHPCSStandards/PHPCSExtra/pull/165 +[#166]: https://github.com/PHPCSStandards/PHPCSExtra/pull/166 +[#167]: https://github.com/PHPCSStandards/PHPCSExtra/pull/167 +[#168]: https://github.com/PHPCSStandards/PHPCSExtra/pull/168 +[#169]: https://github.com/PHPCSStandards/PHPCSExtra/pull/169 +[#170]: https://github.com/PHPCSStandards/PHPCSExtra/pull/170 +[#171]: https://github.com/PHPCSStandards/PHPCSExtra/pull/171 +[#172]: https://github.com/PHPCSStandards/PHPCSExtra/pull/172 +[#173]: https://github.com/PHPCSStandards/PHPCSExtra/pull/173 +[#175]: https://github.com/PHPCSStandards/PHPCSExtra/pull/175 +[#176]: https://github.com/PHPCSStandards/PHPCSExtra/pull/176 +[#177]: https://github.com/PHPCSStandards/PHPCSExtra/pull/177 +[#178]: https://github.com/PHPCSStandards/PHPCSExtra/pull/178 +[#180]: https://github.com/PHPCSStandards/PHPCSExtra/pull/180 + +[php-manual-dirname]: https://www.php.net/function.dirname +[php-rfc-negative_array_index]: https://wiki.php.net/rfc/negative_array_index +[ESLint "no lonely if"]: https://eslint.org/docs/rules/no-lonely-if +[PHPCSUtils 1.0.0-alpha4]: https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.0-alpha4 + + +## [1.0.0-alpha3] - 2020-06-29 + +### Added + +#### Universal + +* :wrench: :books: New `Universal.Arrays.DisallowShortArraySyntax` sniff to disallow short array syntax. [#40] + In contrast to the PHPCS native `Generic.Arrays.DisallowShortArraySyntax` sniff, this sniff will ignore short list syntax and not cause parse errors when the fixer is used. +* :wrench: :bar_chart: :books: New `Universal.Constants.UppercaseMagicConstants` sniff to enforce that PHP native magic constants are in uppercase. [#64] +* :bar_chart: :books: New `Universal.Namespaces.DisallowDeclarationWithoutName` sniff to disallow namespace declarations without a namespace name. [#50] +* :bar_chart: :books: New `Universal.Operators.DisallowLogicalAndOr` sniff to enforce the use of the boolean `&&` and `||` operators instead of the logical `and`/`or` operators. [#52] + Note: as the [operator precedence] of the logical operators is significantly lower than the operator precedence of boolean operators, this sniff does not contain an auto-fixer. +* :bar_chart: :books: New `Universal.Operators.DisallowShortTernary` sniff to disallow the use of short ternaries `?:`. [#42] + While short ternaries are useful when used correctly, the principle of them is often misunderstood and they are more often than not used incorrectly, leading to hard to debug issues and/or PHP warnings/notices. +* :wrench: :bar_chart: :books: New `Universal.Operators.DisallowStandalonePostIncrementDecrement` sniff disallow the use of post-in/decrements in stand-alone statements and discourage the use of multiple increment/decrement operators in a stand-alone statement. [#65] +* :wrench: :bar_chart: :books: New `Universal.Operators.StrictComparisons` sniff to enforce the use of strict comparisons. [#48] + Warning: the auto-fixer for this sniff _may_ cause bugs in applications and should be used with care! This is considered a _risky_ fixer. +* :wrench: :bar_chart: :books: New `Universal.OOStructures.AlphabeticExtendsImplements` sniff to verify that the names used in a class "implements" statement or an interface "extends" statement are listed in alphabetic order. [#55] + * This sniff contains a public `orderby` property to determine the sort order to use for the statement. + If all names used are unqualified, the sort order won't make a difference. + However, if one or more of the names are partially or fully qualified, the chosen sort order will determine how the sorting between unqualified, partially and fully qualified names is handled. + The sniff supports two sort order options: + - _'name'_ : sort by the interface name only (default); + - _'full'_ : sort by the full name as used in the statement (without leading backslash). + In both cases, the sorting will be done using natural sort, case-insensitive. + * The sniff has modular error codes to allow for selective inclusion/exclusion: + - `ImplementsWrongOrder` - for "class implements" statements. + - `ImplementsWrongOrderWithComments` - for "class implements" statements interlaced with comments. These will not be auto-fixed. + - `ExtendsWrongOrder` - for "interface extends" statements. + - `ExtendsWrongOrderWithComments` - for "interface extends" statements interlaced with comments. These will not be auto-fixed. + * When fixing, the existing spacing between the names in an `implements`/`extends` statement will not be maintained. + 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. +* :wrench: :bar_chart: :books: New `Universal.UseStatements.LowercaseFunctionConst` sniff to enforce that `function` and `const` keywords when used in an import `use` statement are always lowercase. [#58] +* :wrench: :bar_chart: :books: New `Universal.UseStatements.NoLeadingBackslash` sniff to verify that a name being imported in an import `use` statement does not start with a leading backslash. [#46] + Names in import `use` statements should always be fully qualified, so a leading backslash is not needed and it is strongly recommended not to use one. + This sniff handles all types of import use statements supported by PHP, in contrast to other sniffs for the same in, for instance, the PSR12 or the Slevomat standard, which are incomplete. +* :wrench: :books: New `Universal.WhiteSpace.DisallowInlineTabs` sniff to enforce using spaces for mid-line alignment. [#43] + +### Changed + +#### Other +* The `master` branch has been renamed to `stable`. +* Composer: The version requirements for the [Composer PHPCS plugin] have been widened to allow for version 0.7.0 which supports Composer 2.0.0. [#62] +* Various housekeeping. + +[#40]: https://github.com/PHPCSStandards/PHPCSExtra/pull/40 +[#42]: https://github.com/PHPCSStandards/PHPCSExtra/pull/42 +[#43]: https://github.com/PHPCSStandards/PHPCSExtra/pull/43 +[#46]: https://github.com/PHPCSStandards/PHPCSExtra/pull/46 +[#48]: https://github.com/PHPCSStandards/PHPCSExtra/pull/48 +[#50]: https://github.com/PHPCSStandards/PHPCSExtra/pull/50 +[#52]: https://github.com/PHPCSStandards/PHPCSExtra/pull/52 +[#55]: https://github.com/PHPCSStandards/PHPCSExtra/pull/55 +[#58]: https://github.com/PHPCSStandards/PHPCSExtra/pull/58 +[#62]: https://github.com/PHPCSStandards/PHPCSExtra/pull/62 +[#64]: https://github.com/PHPCSStandards/PHPCSExtra/pull/64 +[#65]: https://github.com/PHPCSStandards/PHPCSExtra/pull/65 + +[operator precedence]: https://www.php.net/language.operators.precedence + + +## [1.0.0-alpha2] - 2020-02-18 + +### Added + +#### Universal +* :wrench: :bar_chart: :books: New `Universal.ControlStructures.DisallowAlternativeSyntax` sniff to disallow using the alternative syntax for control structures. [#23] + - This sniff contains a `allowWithInlineHTML` property to allow alternative syntax when inline HTML is used within the control structure. In all other cases, the use of the alternative syntax will still be disallowed. + - The sniff has modular error codes to allow for making exceptions based on specific control structures and/or specific control structures in combination with inline HTML. +* :bar_chart: `Universal.UseStatements.DisallowUseClass/Function/Const`: new, additional metrics about the import source will be shown in the `info` report. [#25] + +#### Other +* Readme: installation instructions and sniff list. [#26] + +### Changed + +#### Universal +* `Universal.Arrays.DuplicateArrayKey`: wording of the error message. [#18] +* `Universal.UseStatements.DisallowUseClass/Function/Const`: the error codes have been made more modular. [#25] + Each of these sniffs now has four additional error codes: +
      +
    • FoundSameNamespace, FoundSameNamespaceWithAlias for use statements importing from the same namespace;
    • +
    • FoundGlobalNamespace, FoundGlobalNamespaceWithAlias for use statements importing from the global namespace, like import statements for PHP native classes, functions and constants.
    • +
    + In all other circumstances, the existing error codes FoundWithAlias and FoundWithoutAlias will continue to be used. + +#### Other +* Improved formatting of the CLI documentation which can be viewed using `--generator=text`. [#17] +* Various housekeeping. + +### Fixed + +#### Universal +* `Universal.Arrays.DuplicateArrayKey`: improved handling of parse errors. [#34] +* `Universal.ControlStructures.IfElseDeclaration`: the fixer will now respect tab indentation. [#19] +* `Universal.UseStatements.DisallowUseClass/Function/Const`: the determination of whether a import is aliased in now done in a case-insensitive manner. [#25] +* `Universal.UseStatements.DisallowUseClass/Function/Const`: an import from the global namespace would previously always be seen as non-aliased, even when it was aliased. [#25] +* `Universal.UseStatements.DisallowUseClass/Function/Const`: improved tolerance for `use` import statements with leading backslashes. [#25] + +[#17]: https://github.com/PHPCSStandards/PHPCSExtra/pull/17 +[#18]: https://github.com/PHPCSStandards/PHPCSExtra/pull/18 +[#19]: https://github.com/PHPCSStandards/PHPCSExtra/pull/19 +[#23]: https://github.com/PHPCSStandards/PHPCSExtra/pull/23 +[#25]: https://github.com/PHPCSStandards/PHPCSExtra/pull/25 +[#26]: https://github.com/PHPCSStandards/PHPCSExtra/pull/26 +[#34]: https://github.com/PHPCSStandards/PHPCSExtra/pull/34 + + +## 1.0.0-alpha1 - 2020-01-23 + +Initial alpha release containing: +* A `NormalizedArrays` standard which will contain a full set of sniffs to check the formatting of array declarations. +* A `Universal` standard which will contain a collection of universal sniffs. + DO NOT INCLUDE THIS AS A STANDARD. + `Universal`, like the upstream PHPCS `Generic` standard, contains sniffs which contradict each other. + Include individual sniffs from this standard in a custom project/company ruleset to use them. + +This initial alpha release contains the following sniffs: + +### NormalizedArrays +* :wrench: :bar_chart: :books: `NormalizedArrays.Arrays.ArrayBraceSpacing`: enforce consistent spacing for the open/close braces of array declarations. + The sniff allows for having different settings for: + - Space between the array keyword and the open parenthesis for long arrays via the `keywordSpacing` property. + Accepted values: (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces. + - Spaces on the inside of the braces for empty arrays via the `spacesWhenEmpty` property. + Accepted values: (string) `newline`, (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces. + - Spaces on the inside of the braces for single-line arrays via the `spacesSingleLine` property; + Accepted values: (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces. + - Spaces on the inside of the braces for multi-line arrays via the `spacesMultiLine` property. + Accepted values: (string) `newline`, (int) number of spaces or `false` to turn this check off. Defaults to `newline`. + Note: if any of the above properties are set to `newline`, it is recommended to also include an array indentation sniff. This sniff will not handle the indentation. +* :wrench: :bar_chart: :books: `NormalizedArrays.Arrays.CommaAfterLast`: enforce/forbid a comma after the last item in an array declaration. + By default, this sniff will: +
      +
    • forbid a comma after the last array item for single-line arrays.
    • +
    • enforce a comma after the last array item for multi-line arrays.
    • +
    + This can be changed for each type or array individually by setting the singleLine or multiLine properties in a custom ruleset. + The valid values are: enforce, forbid or skip to not check the comma after the last array item for a particular type of array. + +### Universal +* :books: `Universal.Arrays.DuplicateArrayKey`: detects duplicate array keys in array declarations. +* :books: `Universal.Arrays.MixedArrayKeyTypes`: best practice sniff: don't use a mix of integer and numeric keys for array items. +* :books: `Universal.Arrays.MixedKeyedUnkeyedArray`: best practice sniff: don't use a mix of keyed and unkeyed array items. +* :wrench: :bar_chart: :books: `Universal.ControlStructures.IfElseDeclaration`: verify that else(if) statements with braces are on a new line. +* :wrench: :bar_chart: :books: `Universal.Lists.DisallowLongListSyntax`: disallow the use of long `list`s. +* :wrench: :bar_chart: :books: `Universal.Lists.DisallowShortListSyntax`: disallow the use of short lists. +* :bar_chart: :books: `Universal.Namespaces.DisallowCurlyBraceSyntax`: disallow the use of the alternative namespace declaration syntax using curly braces. +* :bar_chart: :books: `Universal.Namespaces.EnforceCurlyBraceSyntax`: enforce the use of the alternative namespace syntax using curly braces. +* :books: `Universal.Namespaces.OneDeclarationPerFile`: disallow the use of multiple namespaces within a file. +* :bar_chart: :books: `Universal.UseStatements.DisallowUseClass`: forbid using import use statements for classes/traits/interfaces. + Individual sub-types can be allowed by excluding specific error codes. +* :bar_chart: :books: `Universal.UseStatements.DisallowUseConst`: forbid using import use statements for constants. + Individual sub-types can be allowed by excluding specific error codes. +* :bar_chart: :books: `Universal.UseStatements.DisallowUseFunction`: forbid using import use statements for functions. + 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/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 +[1.0.4]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.3...1.0.4 +[1.0.3]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-rc1...1.0.0 +[1.0.0-RC1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha3...1.0.0-rc1 +[1.0.0-alpha3]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha2...1.0.0-alpha3 +[1.0.0-alpha2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha1...1.0.0-alpha2 + +[@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/trunk/vendor/phpcsstandards/phpcsextra/LICENSE b/trunk/vendor/phpcsstandards/phpcsextra/LICENSE new file mode 100644 index 00000000..0a041280 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml new file mode 100644 index 00000000..5f486646 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml @@ -0,0 +1,40 @@ + + + + = 5.3: Usage of dirname(__FILE__) can be replaced with __DIR__. + ]]> + + + + __DIR__; + ]]> + + + dirname(__FILE__); + ]]> + + + + = 7.0: Nested calls to dirname() can be replaced by using dirname() with the $levels parameter. + ]]> + + + + dirname($file, 3); + ]]> + + + dirname(dirname(dirname($file))); + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php new file mode 100644 index 00000000..b064b264 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php @@ -0,0 +1,382 @@ + + */ + public function register() + { + return [\T_STRING]; + } + + /** + * 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) + { + if (isset($this->phpVersion) === false || \defined('PHP_CODESNIFFER_IN_TESTS')) { + // Set default value to prevent this code from running every time the sniff is triggered. + $this->phpVersion = 0; + + $phpVersion = Helper::getConfigData('php_version'); + if ($phpVersion !== null) { + $this->phpVersion = (int) $phpVersion; + } + } + + if ($this->phpVersion !== 0 && $this->phpVersion < 50300) { + // PHP version too low, nothing to do. + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (\strtolower($tokens[$stackPtr]['content']) !== 'dirname') { + // Not our target. + return; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false + || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS + || isset($tokens[$nextNonEmpty]['parenthesis_owner']) === true + ) { + // Not our target. + return; + } + + if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) { + // Live coding or parse error, ignore. + return; + } + + if (Context::inAttribute($phpcsFile, $stackPtr) === true) { + // Class instantiation in attribute, not function call. + return; + } + + // Check if it is really a function call to the global function. + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + if (isset(Collections::objectOperators()[$tokens[$prevNonEmpty]['code']]) === true + || $tokens[$prevNonEmpty]['code'] === \T_NEW + ) { + // Method call, class instantiation or other "not our target". + return; + } + + if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR) { + $prevPrevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true); + if ($tokens[$prevPrevToken]['code'] === \T_STRING + || $tokens[$prevPrevToken]['code'] === \T_NAMESPACE + ) { + // Namespaced function. + return; + } + } + + /* + * As of here, we can be pretty sure this is a function call to the global function. + */ + $opener = $nextNonEmpty; + $closer = $tokens[$nextNonEmpty]['parenthesis_closer']; + + $parameters = PassedParameters::getParameters($phpcsFile, $stackPtr); + $paramCount = \count($parameters); + if (empty($parameters) || $paramCount > 2) { + // No parameters or too many parameter. + return; + } + + $pathParam = PassedParameters::getParameterFromStack($parameters, 1, 'path'); + if ($pathParam === false) { + // If the path parameter doesn't exist, there's nothing to do. + return; + } + + $levelsParam = PassedParameters::getParameterFromStack($parameters, 2, 'levels'); + if ($levelsParam === false && $paramCount === 2) { + // There must be a typo in the param name or an otherwise stray parameter. Ignore. + return; + } + + /* + * PHP 5.3+: Detect use of dirname(__FILE__). + */ + if (\strtoupper($pathParam['clean']) === '__FILE__') { + $levelsValue = false; + + // Determine if the issue is auto-fixable. + $hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($opener + 1), $closer); + $fixable = ($hasComment === false); + + if ($fixable === true) { + $levelsValue = $this->getLevelsValue($phpcsFile, $levelsParam); + if ($levelsParam !== false && $levelsValue === false) { + // Can't autofix if we don't know the value of the $levels parameter. + $fixable = false; + } + } + + $error = 'Use the __DIR__ constant instead of calling dirname(__FILE__) (PHP >= 5.3)'; + $code = 'FileConstant'; + + // Throw the error. + if ($fixable === false) { + $phpcsFile->addError($error, $stackPtr, $code); + return; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); + if ($fix === true) { + if ($levelsParam === false || $levelsValue === 1) { + // No $levels or $levels set to 1: we can replace the complete function call. + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($stackPtr, '__DIR__'); + + for ($i = ($stackPtr + 1); $i <= $closer; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + // Remove potential leading \. + if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR) { + $phpcsFile->fixer->replaceToken($prevNonEmpty, ''); + } + + $phpcsFile->fixer->endChangeset(); + } else { + // We can replace the $path parameter and will need to adjust the $levels parameter. + $filePtr = $phpcsFile->findNext(\T_FILE, $pathParam['start'], ($pathParam['end'] + 1)); + $levelsPtr = $phpcsFile->findNext(\T_LNUMBER, $levelsParam['start'], ($levelsParam['end'] + 1)); + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($filePtr, '__DIR__'); + $phpcsFile->fixer->replaceToken($levelsPtr, ($levelsValue - 1)); + $phpcsFile->fixer->endChangeset(); + } + } + + return; + } + + /* + * PHP 7.0+: Detect use of nested calls to dirname(). + */ + if ($this->phpVersion !== 0 && $this->phpVersion < 70000) { + // No need to check for this issue if the PHP version would not allow for it anyway. + return; + } + + if (\preg_match('`^\s*\\\\?dirname\s*\(`i', $pathParam['clean']) !== 1) { + return; + } + + /* + * Check if there is something _behind_ the nested dirname() call within the same parameter. + * + * Note: the findNext() calls are safe and will always match the dirname() function call + * as otherwise the above regex wouldn't have matched. + */ + $innerDirnamePtr = $phpcsFile->findNext(\T_STRING, $pathParam['start'], ($pathParam['end'] + 1)); + $innerOpener = $phpcsFile->findNext(\T_OPEN_PARENTHESIS, ($innerDirnamePtr + 1), ($pathParam['end'] + 1)); + if (isset($tokens[$innerOpener]['parenthesis_closer']) === false) { + // Shouldn't be possible. + return; // @codeCoverageIgnore + } + + $innerCloser = $tokens[$innerOpener]['parenthesis_closer']; + if ($innerCloser !== $pathParam['end']) { + $hasContentAfter = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($innerCloser + 1), + ($pathParam['end'] + 1), + true + ); + if ($hasContentAfter !== false) { + // Matched code like: `dirname(dirname($file) . 'something')`. Ignore. + return; + } + } + + /* + * Determine if this is an auto-fixable error. + */ + + // Step 1: Are there comments ? If so, not auto-fixable as we don't want to remove comments. + $fixable = true; + $outerLevelsValue = false; + $innerParameters = []; + $innerLevelsParam = false; + $innerLevelsValue = false; + + for ($i = ($opener + 1); $i < $closer; $i++) { + if (isset(Tokens::$commentTokens[$tokens[$i]['code']])) { + $fixable = false; + break; + } + + if ($tokens[$i]['code'] === \T_OPEN_PARENTHESIS + && isset($tokens[$i]['parenthesis_closer']) + ) { + // Skip over everything within the nested dirname() function call. + $i = $tokens[$i]['parenthesis_closer']; + } + } + + // Step 2: Does the `$levels` parameter exist for the outer dirname() call and if so, is it usable ? + if ($fixable === true) { + $outerLevelsValue = $this->getLevelsValue($phpcsFile, $levelsParam); + if ($levelsParam !== false && $outerLevelsValue === false) { + // Can't autofix if we don't know the value of the $levels parameter. + $fixable = false; + } + } + + // Step 3: Does the `$levels` parameter exist for the inner dirname() call and if so, is it usable ? + if ($fixable === true) { + $innerParameters = PassedParameters::getParameters($phpcsFile, $innerDirnamePtr); + $innerLevelsParam = PassedParameters::getParameterFromStack($innerParameters, 2, 'levels'); + $innerLevelsValue = $this->getLevelsValue($phpcsFile, $innerLevelsParam); + if ($innerLevelsParam !== false && $innerLevelsValue === false) { + // Can't autofix if we don't know the value of the $levels parameter. + $fixable = false; + } + } + + /* + * Throw the error. + */ + $error = 'Pass the $levels parameter to the dirname() call instead of using nested dirname() calls'; + $error .= ' (PHP >= 7.0)'; + $code = 'Nested'; + + if ($fixable === false) { + $phpcsFile->addError($error, $stackPtr, $code); + return; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); + if ($fix === false) { + return; + } + + /* + * Fix the error. + */ + $phpcsFile->fixer->beginChangeset(); + + // Remove the info in the _outer_ param call. + for ($i = $opener; $i < $innerOpener; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + for ($i = ($innerCloser + 1); $i <= $closer; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + if ($innerLevelsParam !== false) { + // Inner $levels parameter already exists, just adjust the value. + $innerLevelsPtr = $phpcsFile->findNext( + \T_LNUMBER, + $innerLevelsParam['start'], + ($innerLevelsParam['end'] + 1) + ); + $phpcsFile->fixer->replaceToken($innerLevelsPtr, ($innerLevelsValue + $outerLevelsValue)); + } else { + // Inner $levels parameter does not exist yet. We need to add it. + $content = ', '; + + $prevBeforeCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($innerCloser - 1), null, true); + if ($tokens[$prevBeforeCloser]['code'] === \T_COMMA) { + // Trailing comma found, no need to add the comma. + $content = ' '; + } + + $innerPathParam = PassedParameters::getParameterFromStack($innerParameters, 1, 'path'); + if (isset($innerPathParam['name_token']) === true) { + // Non-named param cannot follow named param, so add param name. + $content .= 'levels: '; + } + + $content .= ($innerLevelsValue + $outerLevelsValue); + $phpcsFile->fixer->addContentBefore($innerCloser, $content); + } + + $phpcsFile->fixer->endChangeset(); + } + + /** + * Determine the value of the $levels parameter passed to dirname(). + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array|false $levelsParam The information about the parameter as retrieved + * via PassedParameters::getParameterFromStack(). + * + * @return int|false Integer levels value or FALSE if the levels value couldn't be determined. + */ + private function getLevelsValue($phpcsFile, $levelsParam) + { + if ($levelsParam === false) { + return 1; + } + + $ignore = Tokens::$emptyTokens; + $ignore[] = \T_LNUMBER; + + $hasNonNumber = $phpcsFile->findNext($ignore, $levelsParam['start'], ($levelsParam['end'] + 1), true); + if ($hasNonNumber !== false) { + return false; + } + + return (int) $levelsParam['clean']; + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml b/trunk/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml new file mode 100644 index 00000000..c30d745d --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml @@ -0,0 +1,5 @@ + + + + A collection of sniffs to detect code modernization opportunities. + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml new file mode 100644 index 00000000..e8a006f0 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + (1, 2); + ]]> + + + + + + + + + + + ); + +$args = [ ]; + ]]> + + + + + + + + + + + 1, 2 ); + +$args = [ 1, 2 ]; + ]]> + + + + + + + + + 1, + 2 +); + +$args = [ + 1, + 2 +]; + ]]> + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml new file mode 100644 index 00000000..c5094c5c --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml @@ -0,0 +1,43 @@ + + + + no comma after the last array item. + + However, for multi-line arrays, there should be a comma after the last array item. + ]]> + + + + + + + , ); + ]]> + + + + + 'foo', + 2 => 'bar', +]; + ]]> + + + 'foo', + 2 => 'bar' +]; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php new file mode 100644 index 00000000..b6317707 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php @@ -0,0 +1,305 @@ + + */ + 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 PHP_CodeSniffer file where the + * token was found. + * @param int $stackPtr The position in the PHP_CodeSniffer + * file's token stack where the token + * was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + /* + * Normalize the public settings. + */ + if ($this->keywordSpacing !== false) { + $this->keywordSpacing = \max((int) $this->keywordSpacing, 0); + } + + if ($this->spacesSingleLine !== false) { + $this->spacesSingleLine = \max((int) $this->spacesSingleLine, 0); + } + + if ($this->spacesMultiLine !== false && $this->spacesMultiLine !== 'newline') { + $this->spacesMultiLine = \max((int) $this->spacesMultiLine, 0); + } + + if ($this->spacesWhenEmpty !== false && $this->spacesWhenEmpty !== 'newline') { + $this->spacesWhenEmpty = \max((int) $this->spacesWhenEmpty, 0); + } + + if ($this->keywordSpacing === false + && $this->spacesSingleLine === false + && $this->spacesMultiLine === false + && $this->spacesWhenEmpty === false + ) { + // Nothing to do. Why was the sniff turned on at all ? + return; + } + + $openClose = Arrays::getOpenClose($phpcsFile, $stackPtr); + if ($openClose === false) { + // Live coding, short list or real square brackets. + return; + } + + $tokens = $phpcsFile->getTokens(); + $opener = $openClose['opener']; + $closer = $openClose['closer']; + + /* + * Check the spacing between the array keyword and the open parenthesis for long arrays. + */ + if ($tokens[$stackPtr]['code'] === \T_ARRAY && $this->keywordSpacing !== false) { + $error = 'There should be %s between the "array" keyword and the open parenthesis. Found: %s'; + $code = 'SpaceAfterKeyword'; + + SpacesFixer::checkAndFix( + $phpcsFile, + $stackPtr, + $opener, + $this->keywordSpacing, + $error, + $code, + 'error', + 0, + 'Space between array keyword and open brace' + ); + } + + /* + * Check for empty arrays. + */ + $nextNonWhiteSpace = $phpcsFile->findNext(\T_WHITESPACE, ($opener + 1), null, true); + if ($nextNonWhiteSpace === $closer) { + if ($this->spacesWhenEmpty === false) { + // Check was turned off. + return; + } + + $error = 'There should be %s between the array opener and closer for an empty array. Found: %s'; + $code = 'EmptyArraySpacing'; + + SpacesFixer::checkAndFix( + $phpcsFile, + $opener, + $closer, + $this->spacesWhenEmpty, + $error, + $code, + 'error', + 0, + 'Space between open and close brace for an empty array' + ); + + return; + } + + /* + * Check non-empty arrays. + */ + if ($tokens[$opener]['line'] === $tokens[$closer]['line']) { + // Single line array. + if ($this->spacesSingleLine === false) { + // Check was turned off. + return; + } + + $error = 'Expected %s after the array opener in a single line array. Found: %s'; + $code = 'SpaceAfterArrayOpenerSingleLine'; + + SpacesFixer::checkAndFix( + $phpcsFile, + $opener, + $phpcsFile->findNext(\T_WHITESPACE, ($opener + 1), null, true), + $this->spacesSingleLine, + $error, + $code, + 'error', + 0, + 'Space after array opener, single line array' + ); + + $error = 'Expected %s before the array closer in a single line array. Found: %s'; + $code = 'SpaceBeforeArrayCloserSingleLine'; + + SpacesFixer::checkAndFix( + $phpcsFile, + $closer, + $phpcsFile->findPrevious(\T_WHITESPACE, ($closer - 1), null, true), + $this->spacesSingleLine, + $error, + $code, + 'error', + 0, + 'Space before array closer, single line array' + ); + + return; + } + + // Multi-line array. + if ($this->spacesMultiLine === false) { + // Check was turned off. + return; + } + + $error = 'Expected %s after the array opener in a multi line array. Found: %s'; + $code = 'SpaceAfterArrayOpenerMultiLine'; + + $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($opener + 1), null, true); + if ($this->spacesMultiLine === 'newline') { + // Check for a trailing comment after the array opener and allow for it. + if (($tokens[$nextNonWhitespace]['code'] === \T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[$nextNonWhitespace]['code']]) === true) + && $tokens[$nextNonWhitespace]['line'] === $tokens[$opener]['line'] + ) { + // We found a trailing comment after array opener. Treat that as the opener instead. + $opener = $nextNonWhitespace; + $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($opener + 1), null, true); + } + } + + SpacesFixer::checkAndFix( + $phpcsFile, + $opener, + $nextNonWhitespace, + $this->spacesMultiLine, + $error, + $code, + 'error', + 0, + 'Space after array opener, multi-line array' + ); + + $error = 'Expected %s before the array closer in a multi line array. Found: %s'; + $code = 'SpaceBeforeArrayCloserMultiLine'; + + SpacesFixer::checkAndFix( + $phpcsFile, + $closer, + $phpcsFile->findPrevious(\T_WHITESPACE, ($closer - 1), null, true), + $this->spacesMultiLine, + $error, + $code, + 'error', + 0, + 'Space before array closer, multi-line array' + ); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php new file mode 100644 index 00000000..7384421d --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php @@ -0,0 +1,226 @@ + + */ + 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/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml new file mode 100644 index 00000000..69c54a8e --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml @@ -0,0 +1,5 @@ + + + + A ruleset for PHP_CodeSniffer to check arrays for normalized format. + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml new file mode 100644 index 00000000..4a84b536 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + array( + 'foo' => 'bar', +); + ]]> + + + [ + 'foo' => 'bar', +]; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml new file mode 100644 index 00000000..00f9b7bb --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml @@ -0,0 +1,44 @@ + + + + + + + + 'foo' => 22, + 'bar' => 25, + 'baz' => 28, +); + +$args = array( + 22, + 25, + 2 => 28, +); + ]]> + + + 'foo' => 22, + 'bar' => 25, + 'bar' => 28, +); + +$args = array( + 22, + 25, + 1 => 28, +); + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml new file mode 100644 index 00000000..f7efdda1 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml @@ -0,0 +1,40 @@ + + + + + + + + 'foo' => 22, + 'bar' => 25, +); + +$args = array( + 0 => 22, + 1 => 25, +); + ]]> + + + 22, + 25, +); + +$args = array( + 'foo' => 22, + 12 => 25, +); + + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml new file mode 100644 index 00000000..79897c19 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml @@ -0,0 +1,31 @@ + + + + + + + + 'foo' => 22, + 'bar' => 25, +); + +$args = array(22, 25); + ]]> + + + 22, + 25, +); + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml new file mode 100644 index 00000000..ebfd7c6c --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml @@ -0,0 +1,24 @@ + + + + + + + + {}; +$anon = new class($param) {}; + ]]> + + + () {}; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml new file mode 100644 index 00000000..fd7ddb67 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + class Foo {} +abstract class Bar implements MyInterface {} + ]]> + + + final class Foo {} +final class Bar extends MyAbstract {} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml new file mode 100644 index 00000000..a80ae0da --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + final readonly class Foo {} +abstract readonly class Bar {} + ]]> + + + readonly final class Foo {} +readonly abstract class Bar {} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml new file mode 100644 index 00000000..48fa148e --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + () {}; + ]]> + + + {}; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml new file mode 100644 index 00000000..107b8f41 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + final class Foo {} +final class Bar extends MyAbstract {} + ]]> + + + class Foo {} +abstract class Bar implements MyInterface {} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml new file mode 100644 index 00000000..b44b4777 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + : int {} +} + ]]> + + + + + + + + + + + + $this; + } + + public function __destruct() { + // Do something. + return false; + } +} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml new file mode 100644 index 00000000..6f9676ee --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml @@ -0,0 +1,26 @@ + + + + + + + + $v ) {} + ]]> + + + $k ) {} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml new file mode 100644 index 00000000..953149b7 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + ! $b; + +if((bool) callMe($a)) {} + ]]> + + + ! ! $b; + +if(! ! ! callMe($a)) {} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml new file mode 100644 index 00000000..914eb65d --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + printf('text %s text', $var); +echo callMe('text %s text', $var); + ]]> + + + echo sprintf('text %s text', $var); +echo vsprintf('text %s text', [$var]); + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml new file mode 100644 index 00000000..5f9f45bd --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml @@ -0,0 +1,43 @@ + + + + + + + + self + { + $var = self::functionCall(); + $var = $obj instanceof self; + $var = new self; + } +} + ]]> + + + static|false { + $var = static::$prop; + $var = $obj instanceof static; + $var = new static(); + } +}; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml new file mode 100644 index 00000000..7b61c8fa --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + MyClass::CLASS; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml new file mode 100644 index 00000000..f42483a0 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml @@ -0,0 +1,30 @@ + + + + + + + + final public const FOO = 'foo'; +} + ]]> + + + protected final const BAR = 'foo'; +} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml new file mode 100644 index 00000000..2a9583fa --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + __LINE__; +include __DIR__ . '/file.php'; + ]]> + + + __NameSpace__; +include dirname(__file__) . '/file.php'; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml new file mode 100644 index 00000000..4be7e6df --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml @@ -0,0 +1,35 @@ + + + + + + + + { + $var = 1; +} + +while (++$i < 10) { + echo $i; +} + ]]> + + + : + $var = 1; +endif; + +while (++$i < 10): + echo $i; +endwhile; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml new file mode 100644 index 00000000..88d09228 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml @@ -0,0 +1,49 @@ + + + + + + + + elseif ($bar) { + // ... +} + +if ($foo) { + // ... +} else { + if ($bar) { + // ... + } + + doSomethingElse(); + +} + + ]]> + + + if ($bar) { + // ... + } else { + // ... + } +} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml new file mode 100644 index 00000000..b1506f64 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml @@ -0,0 +1,37 @@ + + + + + + + + +elseif ($bar) { + $var = 2; +} +else { + $var = 3; +} + ]]> + + + elseif ($bar) { + $var = 2; +} else { + $var = 3; +} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml new file mode 100644 index 00000000..db0a2671 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml new file mode 100644 index 00000000..dc84e0b1 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml new file mode 100644 index 00000000..4b2622de --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml @@ -0,0 +1,33 @@ + + + + + + + + final public function bar() {} + final public static function baz() {} + + // Also valid (out of scope): + protected abstract function overload() {} + private function okay() {} +} + ]]> + + + public function bar() {} + protected static function baz() {} +} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml new file mode 100644 index 00000000..35475eab --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + [$a, $b] = $array; + ]]> + + + list($a, $b) = $array; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml new file mode 100644 index 00000000..214b6862 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + list($a, $b) = $array; + ]]> + + + [$a, $b] = $array; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml new file mode 100644 index 00000000..95174d73 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + ; + +// Code + ]]> + + + { + // Code. +} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml new file mode 100644 index 00000000..465ea556 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + Vendor\Name { +} + ]]> + + + { +} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml new file mode 100644 index 00000000..8e1892ca --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + { + // Code. +} + ]]> + + + ; + +// Code + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml new file mode 100644 index 00000000..6aa0f15c --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + namespace Vendor\Project\Sub\B { +} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml new file mode 100644 index 00000000..d44935cf --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml new file mode 100644 index 00000000..f22a7193 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + Bar, Foo +{ +} + ]]> + + + Foo, Bar +{ +} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml new file mode 100644 index 00000000..4d2761af --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml @@ -0,0 +1,31 @@ + + + + + + + + . $b . 'text' + . $c; + ]]> + + + . + $b . 'text' + . $c; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml new file mode 100644 index 00000000..4e398784 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml @@ -0,0 +1,30 @@ + + + + + + + + && $var > 10) {} + +if (empty($var) || $var < 0) {} + ]]> + + + and $var > 10) {} + +if (empty($var) or $var < 0) {} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml new file mode 100644 index 00000000..0ef2ea31 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml @@ -0,0 +1,26 @@ + + + + + + + + ? $a : 'default'; + ]]> + + + ?: 'default'; +echo $a ? : 'default'; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml new file mode 100644 index 00000000..06780034 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml @@ -0,0 +1,44 @@ + + + + + + + + ++$i; +--$j; + ]]> + + + ++; +$j--; + ]]> + + + + + + + + ++$i; + ]]> + + + --$i++++; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml new file mode 100644 index 00000000..b4507ede --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml @@ -0,0 +1,29 @@ + + + + + + + + === 'text') {} + +if ($var !== true) {} + ]]> + + + == 'text') {} + +if ($var != true) {} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml new file mode 100644 index 00000000..3d3c328e --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml @@ -0,0 +1,33 @@ + + + + + + + + |string $paramA, + TypeA&TypeB $paramB +): int|false {} + ]]> + + + | string $paramA, + TypeA & TypeB $paramB +): int + | + false {} + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml new file mode 100644 index 00000000..261f93cd --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml new file mode 100644 index 00000000..103ca13e --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml @@ -0,0 +1,41 @@ + + + + + + + + + ]]> + + + $text; echo $moreText; ?> + ]]> + + + + + +echo $text; +echo $moreText; +?> + ]]> + + + $text; +echo $moreText; +?> + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml new file mode 100644 index 00000000..2b930f27 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml new file mode 100644 index 00000000..1699d9db --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml new file mode 100644 index 00000000..0dbec70b --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml new file mode 100644 index 00000000..f3cb1f67 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml new file mode 100644 index 00000000..55d430e2 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml @@ -0,0 +1,29 @@ + + + + + + + + function strpos; +use const PHP_EOL as MY_EOL; + ]]> + + + function strpos; +use + const + PHP_EOL + as + MY_EOL; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml new file mode 100644 index 00000000..66acd83b --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + function strpos; +use const PHP_EOL; + ]]> + + + Function strpos; +use CONST PHP_EOL; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml new file mode 100644 index 00000000..ff0b786c --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + use Package\ClassName; + ]]> + + + \Package\ClassName; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml new file mode 100644 index 00000000..39bb90d1 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml new file mode 100644 index 00000000..1770f747 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml @@ -0,0 +1,31 @@ + + + + + + + + class($param) +{ + public function __construct($p) {} +}; + ]]> + + + class ($param) +{ + public function __construct($p) {} +}; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml new file mode 100644 index 00000000..503ae6f7 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml @@ -0,0 +1,94 @@ + + + + + + + + , $param2, $param3); + +function_call( + $param1, + $param2, + $param3 +); + +$array = array($item1, $item2, $item3); +$array = [ + $item1, + $item2, +]; + +list(, $a, $b,,) = $array; +list( + , + $a, + $b, +) = $array; + ]]> + + + , $param2,$param3); + +function_call( + $a + ,$b + ,$c +); + +$array = array($item1,$item2 , $item3); +$array = [ + $item1, + $item2 , +]; + +list( ,$a, $b ,,) = $array; +list( + , + $a, + $b , +) = $array; + ]]> + + + + + + + + , // Comment. + $param2, /* Comment. */ +); + ]]> + + + , + $param2 /* Comment. */, +); + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml new file mode 100644 index 00000000..b259ab40 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml @@ -0,0 +1,25 @@ + + + + + + + + [space]= 'text'; +$text[space][space]= 'more text'; + ]]> + + + [tab]= 'text'; +$text[tab]= 'more text'; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml new file mode 100644 index 00000000..cde20f25 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml @@ -0,0 +1,29 @@ + + + + + + + + [space][space][space][space]$foo = 'bar'; + +[tab]$foo = 'bar'; + ]]> + + + [space][space]$foo = 'bar'; + +[tab][space]$foo = 'bar'; + ]]> + + + diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php new file mode 100644 index 00000000..7c172e34 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php @@ -0,0 +1,60 @@ +eolChar = $eolChar; + $this->config = $config; + } + + /** + * Creates an array of tokens when given some content. + * + * @param string $string The string to tokenize. + * + * @return array> + */ + protected function tokenize($string) + { + return []; + } + + /** + * Performs additional processing after main tokenizing. + * + * @return void + */ + protected function processAdditional() + { + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php new file mode 100644 index 00000000..829daaa9 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php @@ -0,0 +1,89 @@ + + */ + 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) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === \T_ARRAY) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); + return; + } + + if (Arrays::isShortArray($phpcsFile, $stackPtr) === false) { + // Square brackets, but not a short array. Probably short list or real square brackets. + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); + + $error = 'Short array syntax is not allowed'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($tokens[$stackPtr]['bracket_opener'], 'array('); + $phpcsFile->fixer->replaceToken($tokens[$stackPtr]['bracket_closer'], ')'); + $phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php new file mode 100644 index 00000000..7097fad7 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php @@ -0,0 +1,297 @@ +> + */ + private $keysSeenLt8 = []; + + /** + * Keep track of which array keys have been seen already on PHP >= 8.0. + * + * @since 1.0.0 + * + * @var array> + */ + private $keysSeenGt8 = []; + + /** + * Keep track of the maximum seen integer key to know what the next value will be for + * array items without a key on PHP < 8.0. + * + * @since 1.0.0 + * + * @var int + */ + private $currentMaxIntKeyLt8; + + /** + * Keep track of the maximum seen integer key to know what the next value will be for + * array items without a key on PHP >= 8.0. + * + * @since 1.0.0 + * + * @var int + */ + private $currentMaxIntKeyGt8; + + /** + * PHP version as configured or -1 if unknown. + * + * @since 1.0.0 + * + * @var int + */ + private $phpVersion; + + /** + * Process every part of the array declaration. + * + * This contains the default logic for the sniff, but can be overloaded in a concrete child class + * if needed. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token was found. + * + * @return void + */ + public function processArray(File $phpcsFile) + { + // Reset properties before processing this array. + $this->keysSeenLt8 = []; + $this->keysSeenGt8 = []; + + if (isset($this->phpVersion) === false) { + // Set default value to prevent this code from running every time the sniff is triggered. + $this->phpVersion = -1; + + $phpVersion = Helper::getConfigData('php_version'); + if ($phpVersion !== null) { + $this->phpVersion = (int) $phpVersion; + } + } + + unset($this->currentMaxIntKeyLt8, $this->currentMaxIntKeyGt8); + + parent::processArray($phpcsFile); + } + + /** + * Process the tokens in an array key. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token was found. + * @param int $startPtr The stack pointer to the first token in the "key" part of + * an array item. + * @param int $endPtr The stack pointer to the last token in the "key" part of + * an array item. + * @param int $itemNr Which item in the array is being handled. + * + * @return void + */ + public function processKey(File $phpcsFile, $startPtr, $endPtr, $itemNr) + { + $key = $this->getActualArrayKey($phpcsFile, $startPtr, $endPtr); + + if (isset($key) === false) { + // Key could not be determined. + return; + } + + $integerKey = \is_int($key); + + $errorMsg = 'Duplicate array key found. The value will be overwritten%s.' + . ' The %s array key "%s" was first seen on line %d'; + $errorCode = 'Found'; + $errors = []; + $baseData = [ + ($integerKey === true) ? 'integer' : 'string', + $key, + ]; + + /* + * Check if we've seen the key before. + */ + if (($this->phpVersion === -1 || $this->phpVersion < 80000) + && isset($this->keysSeenLt8[$key]) === true + ) { + $errors['phplt8'] = [ + 'data_subset' => $baseData, + 'error_suffix' => '', + 'code_suffix' => '', + ]; + + if ($integerKey === true) { + $errors['phplt8']['error_suffix'] = ' when using PHP < 8.0'; + $errors['phplt8']['code_suffix'] = 'ForPHPlt80'; + } + + $firstSeen = $this->keysSeenLt8[$key]; + $firstNonEmptyFirstSeen = $phpcsFile->findNext(Tokens::$emptyTokens, $firstSeen['ptr'], null, true); + + $errors['phplt8']['data_subset'][] = $this->tokens[$firstNonEmptyFirstSeen]['line']; + } + + if (($this->phpVersion === -1 || $this->phpVersion >= 80000) + && isset($this->keysSeenGt8[$key]) === true + ) { + $errors['phpgt8'] = [ + 'data_subset' => $baseData, + 'error_suffix' => '', + 'code_suffix' => '', + ]; + + if ($integerKey === true) { + $errors['phpgt8']['error_suffix'] = ' when using PHP >= 8.0'; + $errors['phpgt8']['code_suffix'] = 'ForPHPgte80'; + } + + $firstSeen = $this->keysSeenGt8[$key]; + $firstNonEmptyFirstSeen = $phpcsFile->findNext(Tokens::$emptyTokens, $firstSeen['ptr'], null, true); + + $errors['phpgt8']['data_subset'][] = $this->tokens[$firstNonEmptyFirstSeen]['line']; + } + + /* + * Throw the error(s). + * + * If no PHP version was passed, throw errors both for PHP < 8.0 and PHP >= 8.0. + * If a PHP version was set, only throw the error appropriate for the selected PHP version. + * If both errors would effectively be the same, only throw one. + */ + if ($errors !== []) { + $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); + + if (isset($errors['phplt8'], $errors['phpgt8']) + && $errors['phplt8']['data_subset'] === $errors['phpgt8']['data_subset'] + ) { + // Only throw the error once if it would be the same for PHP < 8.0 and PHP >= 8.0. + $data = $errors['phplt8']['data_subset']; + \array_unshift($data, ''); + + $phpcsFile->addError($errorMsg, $firstNonEmpty, $errorCode, $data); + return; + } + + if (isset($errors['phplt8'])) { + $code = $errorCode . $errors['phplt8']['code_suffix']; + $data = $errors['phplt8']['data_subset']; + \array_unshift($data, $errors['phplt8']['error_suffix']); + + $phpcsFile->addError($errorMsg, $firstNonEmpty, $code, $data); + } + + if (isset($errors['phpgt8'])) { + $code = $errorCode . $errors['phpgt8']['code_suffix']; + $data = $errors['phpgt8']['data_subset']; + \array_unshift($data, $errors['phpgt8']['error_suffix']); + + $phpcsFile->addError($errorMsg, $firstNonEmpty, $code, $data); + } + + return; + } + + /* + * Key not seen before. Add to arrays. + */ + $this->keysSeenLt8[$key] = [ + 'item' => $itemNr, + 'ptr' => $startPtr, + ]; + $this->keysSeenGt8[$key] = [ + 'item' => $itemNr, + 'ptr' => $startPtr, + ]; + + if ($integerKey === true) { + if ((isset($this->currentMaxIntKeyLt8) === false && $key > -1) + || (isset($this->currentMaxIntKeyLt8) === true && $key > $this->currentMaxIntKeyLt8) + ) { + $this->currentMaxIntKeyLt8 = $key; + } + + if (isset($this->currentMaxIntKeyGt8) === false + || $key > $this->currentMaxIntKeyGt8 + ) { + $this->currentMaxIntKeyGt8 = $key; + } + } + } + + /** + * Process an array item without an array key. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token was found. + * @param int $startPtr The stack pointer to the first token in the array item, + * which in this case will be the first token of the array + * value part of the array item. + * @param int $itemNr Which item in the array is being handled. + * + * @return void + */ + public function processNoKey(File $phpcsFile, $startPtr, $itemNr) + { + // Track the key for PHP < 8.0. + if (isset($this->currentMaxIntKeyLt8) === false) { + $this->currentMaxIntKeyLt8 = -1; + } + + ++$this->currentMaxIntKeyLt8; + $this->keysSeenLt8[$this->currentMaxIntKeyLt8] = [ + 'item' => $itemNr, + 'ptr' => $startPtr, + ]; + + // Track the key for PHP 8.0+. + if (isset($this->currentMaxIntKeyGt8) === false) { + $this->currentMaxIntKeyGt8 = -1; + } + + ++$this->currentMaxIntKeyGt8; + $this->keysSeenGt8[$this->currentMaxIntKeyGt8] = [ + 'item' => $itemNr, + 'ptr' => $startPtr, + ]; + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php new file mode 100644 index 00000000..49d9260b --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php @@ -0,0 +1,174 @@ +seenStringKey = false; + $this->seenNumericKey = false; + + parent::processArray($phpcsFile); + } + + /** + * Process the tokens in an array key. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token was found. + * @param int $startPtr The stack pointer to the first token in the "key" part of + * an array item. + * @param int $endPtr The stack pointer to the last token in the "key" part of + * an array item. + * @param int $itemNr Which item in the array is being handled. + * + * @return true|void Returning `TRUE` will short-circuit the array item loop and stop processing. + * In effect, this means that the sniff will not examine the double arrow, the array + * value or comma for this array item and will not process any array items after this one. + */ + public function processKey(File $phpcsFile, $startPtr, $endPtr, $itemNr) + { + $key = $this->getActualArrayKey($phpcsFile, $startPtr, $endPtr); + if (isset($key) === false) { + // Key could not be determined. + return; + } + + $integerKey = \is_int($key); + + // Handle integer key. + if ($integerKey === true) { + if ($this->seenStringKey === false) { + if ($this->seenNumericKey !== false) { + // Already seen a numeric key before. + return; + } + + $this->seenNumericKey = true; + return; + } + + // Ok, so we've seen a string key before and now see an explicit numeric key. + $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); + $phpcsFile->addError( + 'Arrays should have either numeric keys or string keys. Explicit numeric key detected,' + . ' while all previous keys in this array were string keys.', + $firstNonEmpty, + 'ExplicitNumericKey' + ); + + // Stop the loop. + return true; + } + + // Handle string key. + if ($this->seenNumericKey === false) { + if ($this->seenStringKey !== false) { + // Already seen a string key before. + return; + } + + $this->seenStringKey = true; + return; + } + + // Ok, so we've seen a numeric key before and now see a string key. + $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); + $phpcsFile->addError( + 'Arrays should have either numeric keys or string keys. String key detected,' + . ' while all previous keys in this array were integer based keys.', + $firstNonEmpty, + 'StringKey' + ); + + // Stop the loop. + return true; + } + + /** + * Process an array item without an array key. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token was found. + * @param int $startPtr The stack pointer to the first token in the array item, + * which in this case will be the first token of the array + * value part of the array item. + * @param int $itemNr Which item in the array is being handled. + * + * @return true|void Returning `TRUE` will short-circuit the array item loop and stop processing. + * In effect, this means that the sniff will not examine the array value or + * comma for this array item and will not process any array items after this one. + */ + public function processNoKey(File $phpcsFile, $startPtr, $itemNr) + { + if ($this->seenStringKey === false) { + if ($this->seenNumericKey !== false) { + // Already seen a numeric key before. + return; + } + + $this->seenNumericKey = true; + return; + } + + // Ok, so we've seen a string key before and now see an implicit numeric key. + $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); + $phpcsFile->addError( + 'Arrays should have either numeric keys or string keys. Implicit numeric key detected,' + . ' while all previous keys in this array were string keys.', + $firstNonEmpty, + 'ImplicitNumericKey' + ); + + // Stop the loop. + return true; + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php new file mode 100644 index 00000000..c47f217f --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php @@ -0,0 +1,134 @@ + Key is the item number; value the stack point to the first non empty token in the item. + */ + private $itemsWithoutKey = []; + + /** + * Process the array declaration. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token was found. + * + * @return void + */ + public function processArray(File $phpcsFile) + { + // Reset properties before processing this array. + $this->hasKeys = false; + $this->itemsWithoutKey = []; + + parent::processArray($phpcsFile); + } + + /** + * Process the tokens in an array key. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token was found. + * @param int $startPtr The stack pointer to the first token in the "key" part of + * an array item. + * @param int $endPtr The stack pointer to the last token in the "key" part of + * an array item. + * @param int $itemNr Which item in the array is being handled. + * + * @return void + */ + public function processKey(File $phpcsFile, $startPtr, $endPtr, $itemNr) + { + $this->hasKeys = true; + + // Process any previously encountered items without keys. + if (empty($this->itemsWithoutKey) === false) { + foreach ($this->itemsWithoutKey as $itemNr => $stackPtr) { + $phpcsFile->addError( + 'Inconsistent array detected. A mix of keyed and unkeyed array items is not allowed.' + . ' The array item in position %d does not have an array key.', + $stackPtr, + 'Found', + [$itemNr] + ); + } + + // No need to do this again. + $this->itemsWithoutKey = []; + } + } + + /** + * Process an array item without an array key. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token was found. + * @param int $startPtr The stack pointer to the first token in the array item, + * which in this case will be the first token of the array + * value part of the array item. + * @param int $itemNr Which item in the array is being handled. + * + * @return void + */ + public function processNoKey(File $phpcsFile, $startPtr, $itemNr) + { + $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); + if ($firstNonEmpty === false || $this->tokens[$firstNonEmpty]['code'] === \T_COMMA) { + // Shouldn't really be possible, but this must be a parse error (empty array item). + return; + } + + // If we already know there are keys in the array, throw an error message straight away. + if ($this->hasKeys === true) { + $phpcsFile->addError( + 'Inconsistent array detected. A mix of keyed and unkeyed array items is not allowed.' + . ' The array item in position %d does not have an array key.', + $firstNonEmpty, + 'Found', + [$itemNr] + ); + } else { + // Save the array item info for later in case we do encounter an array key later on in the array. + $this->itemsWithoutKey[$itemNr] = $firstNonEmpty; + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php new file mode 100644 index 00000000..dae01252 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php @@ -0,0 +1,112 @@ + + */ + public function register() + { + return [\T_ANON_CLASS]; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + // Note: no need to check for `false` as PHPCS won't retokenize `class` to `T_ANON_CLASS` in that case. + if ($tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { + // No parentheses found. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); + return; + } + + if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) { + /* + * Incomplete set of parentheses. Ignore. + * Shouldn't be possible as PHPCS won't retokenize `class` to `T_ANON_CLASS` in that case. + */ + // @codeCoverageIgnoreStart + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); + return; + // @codeCoverageIgnoreEnd + } + + $opener = $nextNonEmpty; + $closer = $tokens[$opener]['parenthesis_closer']; + $hasParams = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), $closer, true); + if ($hasParams !== false) { + // There is something between the parentheses. Ignore. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes, with parameter(s)'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); + + $fix = $phpcsFile->addFixableError( + 'Parenthesis not allowed when creating a new anonymous class without passing parameters', + $stackPtr, + 'Found' + ); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + for ($i = $opener; $i <= $closer; $i++) { + if (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { + continue; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php new file mode 100644 index 00000000..4e3f4719 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php @@ -0,0 +1,116 @@ + + */ + public function register() + { + return [\T_CLASS]; + } + + /** + * 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) + { + $classProp = ObjectDeclarations::getClassProperties($phpcsFile, $stackPtr); + if ($classProp['is_final'] === false) { + if ($classProp['is_abstract'] === true) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'abstract'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'not abstract, not final'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'final'); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + // Live coding or parse error. + return; + } + + // No extra safeguards needed, we know the keyword will exist based on the check above. + $finalKeyword = $phpcsFile->findPrevious(\T_FINAL, ($stackPtr - 1)); + $snippetEnd = $nextNonEmpty; + $classCloser = ''; + + $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['scope_opener']) === true) { + $snippetEnd = $tokens[$stackPtr]['scope_opener']; + $classCloser = '}'; + } + + $snippet = GetTokensAsString::compact($phpcsFile, $finalKeyword, $snippetEnd, true); + $fix = $phpcsFile->addFixableError( + 'Declaring a class as final is not allowed. Found: %s%s', + $finalKeyword, + 'FinalClassFound', + [$snippet, $classCloser] + ); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($finalKeyword, ''); + + // Remove redundant whitespace. + for ($i = ($finalKeyword + 1); $i < $stackPtr; $i++) { + if ($tokens[$i]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($i, ''); + continue; + } + + break; + } + + $phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php new file mode 100644 index 00000000..88fdfe20 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php @@ -0,0 +1,188 @@ + + */ + public function register() + { + return [\T_CLASS]; + } + + /** + * 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) + { + $classProp = ObjectDeclarations::getClassProperties($phpcsFile, $stackPtr); + + if ($classProp['readonly_token'] === false + || ($classProp['final_token'] === false && $classProp['abstract_token'] === false) + ) { + /* + * Either no modifier keywords found at all; or only one type of modifier + * keyword (abstract/final or readonly) declared, but not both. No ordering needed. + */ + return; + } + + if ($classProp['final_token'] !== false && $classProp['abstract_token'] !== false) { + // Parse error. Ignore. + return; + } + + $readonly = $classProp['readonly_token']; + + if ($classProp['final_token'] !== false) { + $extendability = $classProp['final_token']; + } else { + $extendability = $classProp['abstract_token']; + } + + if ($readonly < $extendability) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::READONLY_EXTEND); + } else { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::EXTEND_READONLY); + } + + $message = 'Class modifier keywords are not in the correct order. Expected: "%s", found: "%s"'; + + switch ($this->order) { + case self::READONLY_EXTEND: + if ($readonly < $extendability) { + // Order is correct. Nothing to do. + return; + } + + $this->handleError($phpcsFile, $extendability, $readonly); + break; + + case self::EXTEND_READONLY: + default: + if ($extendability < $readonly) { + // Order is correct. Nothing to do. + return; + } + + $this->handleError($phpcsFile, $readonly, $extendability); + break; + } + } + + /** + * Throw the error and potentially fix it. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $firstKeyword The position of the first keyword found. + * @param int $secondKeyword The position of the second keyword token. + * + * @return void + */ + private function handleError(File $phpcsFile, $firstKeyword, $secondKeyword) + { + $tokens = $phpcsFile->getTokens(); + + $message = 'Class modifier keywords are not in the correct order. Expected: "%s", found: "%s"'; + $data = [ + $tokens[$secondKeyword]['content'] . ' ' . $tokens[$firstKeyword]['content'], + $tokens[$firstKeyword]['content'] . ' ' . $tokens[$secondKeyword]['content'], + ]; + + $fix = $phpcsFile->addFixableError($message, $firstKeyword, 'Incorrect', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($secondKeyword, ''); + + // Prevent leaving behind trailing whitespace. + $i = ($secondKeyword + 1); + while ($tokens[$i]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($i, ''); + ++$i; + } + + // Use the original token content as the case used for keywords is not the concern of this sniff. + $phpcsFile->fixer->addContentBefore($firstKeyword, $tokens[$secondKeyword]['content'] . ' '); + + $phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php new file mode 100644 index 00000000..2715b392 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php @@ -0,0 +1,81 @@ + + */ + public function register() + { + return [\T_ANON_CLASS]; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + // Note: no need to check for `false` as PHPCS won't retokenize `class` to `T_ANON_CLASS` in that case. + if ($tokens[$nextNonEmpty]['code'] === \T_OPEN_PARENTHESIS) { + // Parentheses found. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); + + $fix = $phpcsFile->addFixableError( + 'Parenthesis required when creating a new anonymous class.', + $stackPtr, + 'Missing' + ); + + if ($fix === true) { + $phpcsFile->fixer->addContent($stackPtr, '()'); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php new file mode 100644 index 00000000..843f1add --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php @@ -0,0 +1,102 @@ + + */ + public function register() + { + return [\T_CLASS]; + } + + /** + * 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) + { + $classProp = ObjectDeclarations::getClassProperties($phpcsFile, $stackPtr); + if ($classProp['is_final'] === true) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'final'); + return; + } + + if ($classProp['is_abstract'] === true) { + // Abstract classes can't be final. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'abstract'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'not abstract, not final'); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + // Live coding or parse error. + return; + } + + $snippetEnd = $nextNonEmpty; + $classCloser = ''; + + $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['scope_opener']) === true) { + $snippetEnd = $tokens[$stackPtr]['scope_opener']; + $classCloser = '}'; + } + + $snippet = GetTokensAsString::compact($phpcsFile, $stackPtr, $snippetEnd, true); + $fix = $phpcsFile->addFixableError( + 'A non-abstract class should be declared as final. Found: %s%s', + $stackPtr, + 'NonFinalClassFound', + [$snippet, $classCloser] + ); + + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($stackPtr, 'final '); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php new file mode 100644 index 00000000..6f78cb66 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php @@ -0,0 +1,211 @@ + + */ + public function register() + { + return [\T_FUNCTION]; + } + + /** + * 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) + { + if (isset($this->phpVersion) === false || \defined('PHP_CODESNIFFER_IN_TESTS')) { + // Set default value to prevent this code from running every time the sniff is triggered. + $this->phpVersion = 0; + + $phpVersion = Helper::getConfigData('php_version'); + if ($phpVersion !== null) { + $this->phpVersion = (int) $phpVersion; + } + } + + $scopePtr = Scopes::validDirectScope($phpcsFile, $stackPtr, Tokens::$ooScopeTokens); + if ($scopePtr === false) { + // Not an OO method. + return; + } + + $functionName = FunctionDeclarations::getName($phpcsFile, $stackPtr); + $functionNameLC = \strtolower($functionName); + + if ($functionNameLC === '__construct' || $functionNameLC === '__destruct') { + $functionType = \sprintf('A "%s()" magic method', $functionNameLC); + } else { + // If the PHP version is explicitly set to PHP 8.0 or higher, ignore PHP 4-style constructors. + if ($this->phpVersion >= 80000) { + return; + } + + // This may be a PHP 4-style constructor which should be handled. + $OOName = ObjectDeclarations::getName($phpcsFile, $scopePtr); + + if (empty($OOName) === true) { + // Anonymous class or parse error. The function can't be a PHP 4-style constructor. + return; + } + + if (NamingConventions::isEqual($functionName, $OOName) === false) { + // Class and function name not the same, so not a PHP 4-style constructor. + return; + } + + if (Namespaces::determineNamespace($phpcsFile, $stackPtr) !== '') { + /* + * Namespaced methods with the same name as the class are treated as + * regular methods, so we can bow out if we're in a namespace. + * + * Note: the exception to this is PHP 5.3.0-5.3.2. This is currently + * not dealt with. + */ + return; + } + + $functionType = 'A PHP 4-style constructor'; + } + + /* + * OK, so now we know for sure that this is a constructor/destructor method. + */ + + // Check for a return type. + $tokens = $phpcsFile->getTokens(); + $properties = FunctionDeclarations::getProperties($phpcsFile, $stackPtr); + if ($properties['return_type'] !== '' && $properties['return_type_token'] !== false) { + $data = [ + $functionType, + $properties['return_type'], + ]; + + $fix = $phpcsFile->addFixableError( + '%s can not declare a return type. Found: %s', + $properties['return_type_token'], + 'ReturnTypeFound', + $data + ); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $parensCloser = $tokens[$stackPtr]['parenthesis_closer']; + for ($i = ($parensCloser + 1); $i <= $properties['return_type_end_token']; $i++) { + if (isset(Tokens::$commentTokens[$tokens[$i]['code']])) { + // Ignore comments and leave them be. + continue; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { + // Abstract/interface method, live coding or parse error. + return; + } + + // Check for a value being returned. + $current = $tokens[$stackPtr]['scope_opener']; + $end = $tokens[$stackPtr]['scope_closer']; + + // Not searching for arrow functions as those have an implicit return, so no + $search = Collections::functionDeclarationTokens(); + $search[\T_RETURN] = \T_RETURN; + + do { + $current = $phpcsFile->findNext($search, ($current + 1), $end); + if ($current === false) { + break; + } + + if (isset(Collections::functionDeclarationTokens()[$tokens[$current]['code']]) + && isset($tokens[$current]['scope_closer']) + ) { + // Skip over nested function/closure declarations. + $current = $tokens[$current]['scope_closer']; + continue; + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), $end, true); + if ($next === false + || $tokens[$next]['code'] === \T_SEMICOLON + || $tokens[$next]['code'] === \T_CLOSE_TAG + ) { + // Return statement without value. + continue; + } + + $endOfStatement = BCFile::findEndOfStatement($phpcsFile, $next); + + $data = [ + $functionType, + GetTokensAsString::compact($phpcsFile, $current, $endOfStatement, true), + ]; + + $phpcsFile->addWarning( + '%s can not return a value. Found: "%s"', + $current, + 'ReturnValueFound', + $data + ); + } while ($current < $end); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php new file mode 100644 index 00000000..8895c56c --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php @@ -0,0 +1,153 @@ + + */ + public function register() + { + return [\T_FOREACH]; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { + // Parse error or live coding, not our concern. + return; + } + + $opener = $tokens[$stackPtr]['parenthesis_opener']; + $closer = $tokens[$stackPtr]['parenthesis_closer']; + + $asPtr = $phpcsFile->findNext(\T_AS, ($opener + 1), $closer); + if ($asPtr === false) { + // Parse error or live coding, not our concern. + return; + } + + // Real target. + $find = [\T_DOUBLE_ARROW]; + // Prevent matching on double arrows within a list assignment. + $find += Collections::listTokens(); + + $doubleArrowPtr = $phpcsFile->findNext($find, ($asPtr + 1), $closer); + if ($doubleArrowPtr === false + || $tokens[$doubleArrowPtr]['code'] !== \T_DOUBLE_ARROW + ) { + // No key assignment. + return; + } + + $isListAssignment = $phpcsFile->findNext(Tokens::$emptyTokens, ($doubleArrowPtr + 1), $closer, true); + if ($isListAssignment === false) { + // Parse error or live coding, not our concern. + } + + $keyAsString = \ltrim(GetTokensAsString::noEmpties($phpcsFile, ($asPtr + 1), ($doubleArrowPtr - 1)), '&'); + $valueAssignments = []; + if (isset(Collections::listTokens()[$tokens[$isListAssignment]['code']]) === false) { + // Single value assignment. + $valueAssignments[] = GetTokensAsString::noEmpties($phpcsFile, ($doubleArrowPtr + 1), ($closer - 1)); + } else { + // List assignment. + $assignments = Lists::getAssignments($phpcsFile, $isListAssignment); + foreach ($assignments as $listItem) { + if ($listItem['assignment'] === '') { + // Ignore empty list assignments. + continue; + } + + // Note: this doesn't take nested lists into account (yet). + $valueAssignments[] = $listItem['assignment']; + } + } + + if (empty($valueAssignments)) { + // No assignments found. + return; + } + + foreach ($valueAssignments as $valueAsString) { + $valueAsString = \ltrim($valueAsString, '&'); + + if ($keyAsString !== $valueAsString) { + // Key and value not the same. + continue; + } + + $error = 'The variables used for the key and the value in a foreach assignment should be unique.'; + $error .= 'Both the key and the value will currently be assigned to: "%s"'; + + $fix = $phpcsFile->addFixableError($error, $doubleArrowPtr, 'NotUnique', [$valueAsString]); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + // Remove the key. + for ($i = ($asPtr + 1); $i < ($doubleArrowPtr + 1); $i++) { + if ($tokens[$i]['code'] === \T_WHITESPACE + && isset(Tokens::$commentTokens[$tokens[($i + 1)]['code']]) + ) { + // Don't remove whitespace when followed directly by a comment. + continue; + } + + if (isset(Tokens::$commentTokens[$tokens[$i]['code']])) { + // Don't remove comments. + continue; + } + + // Remove everything else. + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + break; + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php new file mode 100644 index 00000000..549c8cd3 --- /dev/null +++ b/trunk/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/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php new file mode 100644 index 00000000..67035f2a --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php @@ -0,0 +1,131 @@ + + */ + private $targetFunctions = [ + 'sprintf' => 'printf', + 'vsprintf' => 'vprintf', + ]; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.1.0 + * + * @return array + */ + public function register() + { + return [\T_ECHO]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.1.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(); + + $skip = Tokens::$emptyTokens; + $skip[] = \T_NS_SEPARATOR; + + $next = $phpcsFile->findNext($skip, ($stackPtr + 1), null, true); + if ($next === false + || $tokens[$next]['code'] !== \T_STRING + || isset($this->targetFunctions[\strtolower($tokens[$next]['content'])]) === false + ) { + // Not our target. + return; + } + + $detectedFunction = \strtolower($tokens[$next]['content']); + + $openParens = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + if ($openParens === false + || $tokens[$openParens]['code'] !== \T_OPEN_PARENTHESIS + || isset($tokens[$openParens]['parenthesis_closer']) === false + ) { + // Live coding/parse error. + return; + } + + $closeParens = $tokens[$openParens]['parenthesis_closer']; + $afterFunctionCall = $phpcsFile->findNext(Tokens::$emptyTokens, ($closeParens + 1), null, true); + if ($afterFunctionCall === false + || ($tokens[$afterFunctionCall]['code'] !== \T_SEMICOLON + && $tokens[$afterFunctionCall]['code'] !== \T_CLOSE_TAG) + ) { + // Live coding/parse error or compound echo statement. + return; + } + + $fix = $phpcsFile->addFixableError( + 'Unnecessary "echo %s(...)" found. Use "%s(...)" instead.', + $next, + 'Found', + [ + $tokens[$next]['content'], + $this->targetFunctions[$detectedFunction], + ] + ); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + // Remove echo and whitespace. + $phpcsFile->fixer->replaceToken($stackPtr, ''); + + for ($i = ($stackPtr + 1); $i < $next; $i++) { + if ($tokens[$i]['code'] !== \T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->replaceToken($next, $this->targetFunctions[$detectedFunction]); + + $phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php new file mode 100644 index 00000000..2136bcdb --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php @@ -0,0 +1,216 @@ + + */ + private $validOOScopes = [ + \T_CLASS, // Only if final. + \T_ANON_CLASS, // Final by nature. + \T_ENUM, // Final by design. + ]; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + return [ + // These tokens are used to retrieve return types reliably. + \T_FUNCTION, + \T_FN, + // While this is our "real" target. + \T_STATIC, + // But we also need this as after "instanceof", `static` is tokenized as `T_STRING in PHPCS < 4.0.0. + // See: https://github.com/squizlabs/PHP_CodeSniffer/pull/3121 + \T_STRING, + ]; + } + + /** + * 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 int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === \T_STRING + && \strtolower($tokens[$stackPtr]['content']) !== 'static' + ) { + return; + } + + if ($tokens[$stackPtr]['code'] === \T_FUNCTION + || $tokens[$stackPtr]['code'] === \T_FN + ) { + /* + * Check return types for methods in final classes, anon classes and enums. + * + * Will return the scope opener of the function to prevent potential duplicate notifications. + */ + $scopeOpener = $stackPtr; + if (isset($tokens[$stackPtr]['scope_opener']) === true) { + $scopeOpener = $tokens[$stackPtr]['scope_opener']; + } + + if ($tokens[$stackPtr]['code'] === \T_FUNCTION) { + $ooPtr = Scopes::validDirectScope($phpcsFile, $stackPtr, $this->validOOScopes); + if ($ooPtr === false) { + // Method in a trait (not known where it is used), interface (never final) or not in an OO scope. + return $scopeOpener; + } + } else { + $ooPtr = Conditions::getLastCondition($phpcsFile, $stackPtr, $this->validOOScopes); + if ($ooPtr === false) { + // Arrow function outside of OO. + return $scopeOpener; + } + } + + if ($tokens[$ooPtr]['code'] === \T_CLASS) { + $classProps = ObjectDeclarations::getClassProperties($phpcsFile, $ooPtr); + if ($classProps['is_final'] === false) { + // Method in a non-final class. + return $scopeOpener; + } + } + + $functionProps = FunctionDeclarations::getProperties($phpcsFile, $stackPtr); + if ($functionProps['return_type'] === '') { + return $scopeOpener; + } + + $staticPtr = $phpcsFile->findNext( + \T_STATIC, + $functionProps['return_type_token'], + ($functionProps['return_type_end_token'] + 1) + ); + + if ($staticPtr === false) { + return $scopeOpener; + } + + // Found a return type containing the `static` type. + $this->handleError($phpcsFile, $staticPtr, 'ReturnType', '"static" return type'); + + return $scopeOpener; + } + + /* + * Check other uses of static. + */ + $functionPtr = Conditions::getLastCondition($phpcsFile, $stackPtr, [\T_FUNCTION, \T_CLOSURE]); + if ($functionPtr === false || $tokens[$functionPtr]['code'] === \T_CLOSURE) { + /* + * When `false`, this code is absolutely invalid, but not something to be addressed via this sniff. + * When a closure, we're not interested in it. The closure class is final, but closures + * can be bound to other classes. This needs further research and should maybe get its own sniff. + */ + return; + } + + $ooPtr = Scopes::validDirectScope($phpcsFile, $functionPtr, $this->validOOScopes); + if ($ooPtr === false) { + // Not in an OO context. + return; + } + + if ($tokens[$ooPtr]['code'] === \T_CLASS) { + $classProps = ObjectDeclarations::getClassProperties($phpcsFile, $ooPtr); + if ($classProps['is_final'] === false) { + // Token in a non-final class. + return; + } + } + + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prevNonEmpty !== false) { + if ($tokens[$prevNonEmpty]['code'] === \T_INSTANCEOF) { + $prevPrevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true); + $extraMsg = GetTokensAsString::compact($phpcsFile, $prevPrevNonEmpty, $stackPtr, true); + $this->handleError($phpcsFile, $stackPtr, 'InstanceOf', '"' . $extraMsg . '"'); + return; + } + + if ($tokens[$prevNonEmpty]['code'] === \T_NEW) { + $this->handleError($phpcsFile, $stackPtr, 'NewInstance', '"new static"'); + return; + } + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === \T_DOUBLE_COLON) { + $nextNextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true); + $extraMsg = GetTokensAsString::compact($phpcsFile, $stackPtr, $nextNextNonEmpty, true); + $this->handleError($phpcsFile, $stackPtr, 'ScopeResolution', '"' . $extraMsg . '"'); + return; + } + } + + /** + * Throw and potentially fix the error. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of erroneous `T_STATIC` token. + * @param string $errorCode The error code for the message. + * @param string $extraMsg Addition to the error message. + * + * @return void + */ + private function handleError($phpcsFile, $stackPtr, $errorCode, $extraMsg) + { + $fix = $phpcsFile->addFixableError( + 'Use "self" instead of "static" when using late static binding in a final OO construct. Found: %s', + $stackPtr, + $errorCode, + [$extraMsg] + ); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, 'self'); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php new file mode 100644 index 00000000..7a67e479 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php @@ -0,0 +1,106 @@ + + */ + public function register() + { + return [\T_STRING]; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + $content = $tokens[$stackPtr]['content']; + $contentLC = \strtolower($content); + + if ($contentLC !== 'class') { + return; + } + + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextToken !== false && $tokens[$nextToken]['code'] === \T_OPEN_PARENTHESIS) { + // Function call or declaration for a function called "class". + return; + } + + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prevToken === false || $tokens[$prevToken]['code'] !== \T_DOUBLE_COLON) { + return; + } + + if ($contentLC === $content) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'lowercase'); + return; + } + + $error = "The ::class keyword for class name resolution must be in lowercase. Expected: '::%s'; found: '::%s'"; + $data = [ + $contentLC, + $content, + ]; + + $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($error, $stackPtr, $errorCode, $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLC); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php new file mode 100644 index 00000000..4b2e7183 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php @@ -0,0 +1,199 @@ + + */ + public function register() + { + return [\T_CONST]; + } + + /** + * 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) + { + if (Scopes::isOOConstant($phpcsFile, $stackPtr) === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $valid = Collections::constantModifierKeywords() + Tokens::$emptyTokens; + + $finalPtr = false; + $visibilityPtr = false; + + for ($i = ($stackPtr - 1); $i > 0; $i--) { + if (isset($valid[$tokens[$i]['code']]) === false) { + break; + } + + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { + continue; + } + + if ($tokens[$i]['code'] === \T_FINAL) { + $finalPtr = $i; + } else { + $visibilityPtr = $i; + } + } + + if ($finalPtr === false || $visibilityPtr === false) { + /* + * Either no modifier keywords found at all; or only one type of modifier + * keyword (final or visibility) declared, but not both. No ordering needed. + */ + return; + } + + if ($visibilityPtr < $finalPtr) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::VISIBILITY_FINAL); + } else { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::FINAL_VISIBILITY); + } + + $message = 'OO constant modifier keywords are not in the correct order. Expected: "%s", found: "%s"'; + + switch ($this->order) { + case self::VISIBILITY_FINAL: + if ($visibilityPtr < $finalPtr) { + // Order is correct. Nothing to do. + return; + } + + $this->handleError($phpcsFile, $finalPtr, $visibilityPtr); + break; + + case self::FINAL_VISIBILITY: + default: + if ($finalPtr < $visibilityPtr) { + // Order is correct. Nothing to do. + return; + } + + $this->handleError($phpcsFile, $visibilityPtr, $finalPtr); + break; + } + } + + /** + * Throw the error and potentially fix it. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $firstKeyword The position of the first keyword found. + * @param int $secondKeyword The position of the second keyword token. + * + * @return void + */ + private function handleError(File $phpcsFile, $firstKeyword, $secondKeyword) + { + $tokens = $phpcsFile->getTokens(); + + $message = 'Constant modifier keywords are not in the correct order. Expected: "%s", found: "%s"'; + $data = [ + $tokens[$secondKeyword]['content'] . ' ' . $tokens[$firstKeyword]['content'], + $tokens[$firstKeyword]['content'] . ' ' . $tokens[$secondKeyword]['content'], + ]; + + $fix = $phpcsFile->addFixableError($message, $firstKeyword, 'Incorrect', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($secondKeyword, ''); + + // Prevent leaving behind trailing whitespace. + $i = ($secondKeyword + 1); + while ($tokens[$i]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($i, ''); + ++$i; + } + + // Use the original token content as the case used for keywords is not the concern of this sniff. + $phpcsFile->fixer->addContentBefore($firstKeyword, $tokens[$secondKeyword]['content'] . ' '); + + $phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php new file mode 100644 index 00000000..348cf65e --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php @@ -0,0 +1,89 @@ + + */ + public function register() + { + return Tokens::$magicConstants; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + $content = $tokens[$stackPtr]['content']; + $contentUC = \strtoupper($content); + if ($contentUC === $content) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'uppercase'); + return; + } + + $error = 'Magic constants should be in uppercase. Expected: %s; found: %s'; + $errorCode = ''; + $data = [ + $contentUC, + $content, + ]; + + if (\strtolower($content) === $content) { + $errorCode = 'Lowercase'; + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'lowercase'); + } else { + $errorCode = 'Mixedcase'; + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'mixed case'); + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentUC); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php new file mode 100644 index 00000000..ab78a70a --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php @@ -0,0 +1,216 @@ + + */ + public function register() + { + $targets = Collections::alternativeControlStructureSyntaxes(); + + // Don't look for elseif/else as they need to be dealt with in one go with the if. + unset($targets[\T_ELSEIF], $targets[\T_ELSE]); + + return $targets; + } + + /** + * 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) + { + /* + * Ignore control structures without body (i.e. single line control structures). + * This doesn't ignore _empty_ bodies. + */ + if (ControlStructures::hasBody($phpcsFile, $stackPtr, true) === false) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'single line (without body)'); + return; + } + + $tokens = $phpcsFile->getTokens(); + + /* + * Check if the control structure uses alternative syntax. + */ + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { + // No scope opener found: inline control structure or parse error. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'inline'); + return; + } + + $opener = $tokens[$stackPtr]['scope_opener']; + $closer = $tokens[$stackPtr]['scope_closer']; + + if ($tokens[$opener]['code'] !== \T_COLON) { + // Curly brace syntax (not our concern). + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'curly braces'); + return; + } + + /* + * As of here, we *know* the control structure must be using alternative syntax and + * must have all scope openers/closers set as, in case of parse errors, PHPCS wouldn't + * have set the scope opener, even for the first `if`. + * + * Also note that alternative syntax cannot be used with `else if`, so we don't need to take that + * into account. + */ + + /* + * Determine whether there is inline HTML. + * + * For "chained" control structures (if - elseif - else), the complete control structure + * needs to be examined in one go as these cannot be changed individually, only as a complete group. + */ + $closedScopes = Collections::closedScopes(); + $find = $closedScopes; + $find[\T_INLINE_HTML] = \T_INLINE_HTML; + + $chainedIssues = []; + $hasInlineHTML = false; + $currentPtr = $stackPtr; + + do { + $opener = $tokens[$currentPtr]['scope_opener']; + $closer = $tokens[$currentPtr]['scope_closer']; + $chainedIssues[$opener] = $closer; + + if ($hasInlineHTML === true) { + // No need to search the contents, we already know there is inline HTML. + $currentPtr = $closer; + continue; + } + + $inlineHTMLPtr = $opener; + + do { + $inlineHTMLPtr = $phpcsFile->findNext($find, ($inlineHTMLPtr + 1), $closer); + if ($tokens[$inlineHTMLPtr]['code'] === \T_INLINE_HTML) { + $hasInlineHTML = true; + break; + } + + if (isset($closedScopes[$tokens[$inlineHTMLPtr]['code']], $tokens[$inlineHTMLPtr]['scope_closer'])) { + $inlineHTMLPtr = $tokens[$inlineHTMLPtr]['scope_closer']; + } + } while ($inlineHTMLPtr !== false && $inlineHTMLPtr < $closer); + + $currentPtr = $closer; + } while (isset(Collections::alternativeControlStructureSyntaxes()[$tokens[$closer]['code']]) === true); + + if ($hasInlineHTML === true) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'alternative syntax with inline HTML'); + } else { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'alternative syntax'); + } + + if ($hasInlineHTML === true && $this->allowWithInlineHTML === true) { + return; + } + + $error = 'Using control structures with the alternative syntax is not allowed'; + if ($this->allowWithInlineHTML === true) { + $error .= ' unless the control structure contains inline HTML'; + } + $error .= '. Found: %1$s(): ... end%1$s;'; + + $code = 'Found' . \ucfirst($tokens[$stackPtr]['content']); + if ($hasInlineHTML === true) { + $code .= 'WithInlineHTML'; + } + + $data = [$tokens[$stackPtr]['content']]; + + foreach ($chainedIssues as $opener => $closer) { + $fix = $phpcsFile->addFixableError($error, $opener, $code, $data); + } + + if ($fix === false) { + return; + } + + /* + * Fix all issues for this chain in one go to diminish the chance of conflicts. + */ + $phpcsFile->fixer->beginChangeset(); + + foreach ($chainedIssues as $opener => $closer) { + $phpcsFile->fixer->replaceToken($opener, '{'); + + if (isset(Collections::alternativeControlStructureSyntaxClosers()[$tokens[$closer]['code']]) === true) { + $phpcsFile->fixer->replaceToken($closer, '}'); + + $semicolon = $phpcsFile->findNext(Tokens::$emptyTokens, ($closer + 1), null, true); + if ($semicolon !== false && $tokens[$semicolon]['code'] === \T_SEMICOLON) { + $phpcsFile->fixer->replaceToken($semicolon, ''); + } + } else { + /* + * This must be an if/else using alternative syntax. + * The closer will be the next control structure keyword. + */ + $phpcsFile->fixer->addContentBefore($closer, '} '); + } + } + + $phpcsFile->fixer->endChangeset(); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php new file mode 100644 index 00000000..58c81ae1 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php @@ -0,0 +1,348 @@ + + */ + public function register() + { + return [\T_ELSE]; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + + /* + * Deal with `else if`. + */ + if (ControlStructures::isElseIf($phpcsFile, $stackPtr) === true) { + // Ignore, not our real target. + return; + } + + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { + // Either an else without curly braces or a parse error. Ignore. + return; + } + + $outerScopeOpener = $tokens[$stackPtr]['scope_opener']; + $outerScopeCloser = $tokens[$stackPtr]['scope_closer']; + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($outerScopeOpener + 1), $outerScopeCloser, true); + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_IF) { + // Definitely not a lonely if statement. + return; + } + + if (isset($tokens[$nextNonEmpty]['scope_closer']) === false) { + // Either a control structure without curly braces or a parse error. Ignore. + return; + } + + /* + * Find the end of an if - else chain. + */ + + $innerIfPtr = $nextNonEmpty; + $innerIfToken = $tokens[$innerIfPtr]; + $autoFixable = true; + $innerScopeCloser = $innerIfToken['scope_closer']; + + // For alternative syntax fixer only. + // Remember the individual inner scope opener and closers so the fixer doesn't need + // to do the same walking over the if/else chain again. + $innerScopes = [ + $innerIfToken['scope_opener'] => $innerScopeCloser, + ]; + + do { + /* + * Handle control structures using alternative syntax. + */ + if ($tokens[$innerScopeCloser]['code'] !== \T_CLOSE_CURLY_BRACKET) { + if ($tokens[$innerScopeCloser]['code'] === \T_ENDIF) { + $nextAfter = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($innerScopeCloser + 1), + $outerScopeCloser, + true + ); + + if ($tokens[$nextAfter]['code'] === \T_CLOSE_TAG) { + // Not "lonely" as at the very least there must be a PHP open tag before the outer closer. + return; + } + + if ($tokens[$nextAfter]['code'] === \T_SEMICOLON) { + $innerScopeCloser = $nextAfter; + } else { + // Missing semi-colon. Report, but don't auto-fix. + $autoFixable = false; + } + } else { + // This must be an else[if]. + --$innerScopeCloser; + } + } + + $innerNextNonEmpty = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($innerScopeCloser + 1), + $outerScopeCloser, + true + ); + if ($innerNextNonEmpty === false) { + // This was the last closer. + break; + } + + if ($tokens[$innerNextNonEmpty]['code'] !== \T_ELSE + && $tokens[$innerNextNonEmpty]['code'] !== \T_ELSEIF + ) { + // Found another statement after the control structure. The "if" is not lonely. + return; + } + + if (isset($tokens[$innerNextNonEmpty]['scope_closer']) === false) { + // This may still be an "else if"... + $nextAfter = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($innerNextNonEmpty + 1), + $outerScopeCloser, + true + ); + + if ($nextAfter === false + || $tokens[$nextAfter]['code'] !== \T_IF + || isset($tokens[$nextAfter]['scope_closer']) === false + ) { + // Defense in depth. Either a control structure without curly braces or a parse error. Ignore. + return; + } + + $innerNextNonEmpty = $nextAfter; + } + + $innerScopeCloser = $tokens[$innerNextNonEmpty]['scope_closer']; + $innerScopes[$tokens[$innerNextNonEmpty]['scope_opener']] = $innerScopeCloser; + } while (true); + + /* + * As of now, we know we have an error. Check if it can be auto-fixed. + */ + if ($phpcsFile->findNext(\T_WHITESPACE, ($innerScopeCloser + 1), $outerScopeCloser, true) !== false) { + // Comment between the inner and outer closers. + $autoFixable = false; + } + + if ($tokens[$innerScopeCloser]['code'] === \T_SEMICOLON) { + $hasComment = $phpcsFile->findPrevious(\T_WHITESPACE, ($innerScopeCloser - 1), null, true); + if ($tokens[$hasComment]['code'] !== \T_ENDIF) { + // Comment between the "endif" and the semi-colon. + $autoFixable = false; + } + } + + if ($tokens[$outerScopeOpener]['line'] !== $innerIfToken['line']) { + for ($startOfNextLine = ($outerScopeOpener + 1); $startOfNextLine < $innerIfPtr; $startOfNextLine++) { + if ($tokens[$outerScopeOpener]['line'] !== $tokens[$startOfNextLine]['line']) { + break; + } + } + + if ($phpcsFile->findNext(\T_WHITESPACE, $startOfNextLine, $innerIfPtr, true) !== false) { + // Comment between the inner and outer openers. + $autoFixable = false; + } + } + + if (isset($innerIfToken['parenthesis_opener'], $innerIfToken['parenthesis_closer']) === false) { + // Start/end of the condition of the if unclear. Most likely a parse error. + $autoFixable = false; + } + + /* + * Throw the error and potentially fix it. + */ + $error = 'If control structure block found as the only statement within an "else" block. Use elseif instead.'; + $code = 'Found'; + + if ($autoFixable === false) { + $phpcsFile->addError($error, $stackPtr, $code); + return; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); + if ($fix === false) { + return; + } + + /* + * Fix it. + */ + $outerInnerSameType = false; + if (($tokens[$outerScopeCloser]['code'] === \T_CLOSE_CURLY_BRACKET + && $tokens[$innerScopeCloser]['code'] === \T_CLOSE_CURLY_BRACKET) + || ($tokens[$outerScopeCloser]['code'] === \T_ENDIF + && $tokens[$innerScopeCloser]['code'] === \T_SEMICOLON) + ) { + $outerInnerSameType = true; + } + + $targetIsCurly = ($tokens[$outerScopeCloser]['code'] === \T_CLOSE_CURLY_BRACKET); + + $innerScopeCount = \count($innerScopes); + + $condition = GetTokensAsString::origContent($phpcsFile, ($innerIfPtr + 1), ($innerIfToken['scope_opener'] - 1)); + if ($targetIsCurly === true) { + $condition = \rtrim($condition) . ' '; + } + + $phpcsFile->fixer->beginChangeset(); + + // Remove the inner if + condition up to and including the scope opener. + for ($i = $innerIfPtr; $i <= $innerIfToken['scope_opener']; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + // Potentially remove trailing whitespace/new line if there is no comment after the inner condition. + while ($tokens[$i]['line'] === $innerIfToken['line'] + && $tokens[$i]['code'] === \T_WHITESPACE + ) { + $phpcsFile->fixer->replaceToken($i, ''); + ++$i; + } + + // Remove any potential indentation whitespace for the inner if. + if ($tokens[$outerScopeOpener]['line'] !== $innerIfToken['line'] + && $tokens[$i]['line'] !== $innerIfToken['line'] + ) { + $i = ($nextNonEmpty - 1); + while ($tokens[$i]['line'] === $innerIfToken['line'] + && $tokens[$i]['code'] === \T_WHITESPACE + ) { + $phpcsFile->fixer->replaceToken($i, ''); + --$i; + } + } + + // Remove the inner scope closer. + $phpcsFile->fixer->replaceToken($innerScopeCloser, ''); + $i = ($innerScopeCloser - 1); + + // Handle alternative syntax for the closer. + if ($tokens[$innerScopeCloser]['code'] === \T_SEMICOLON) { + // Remove potential whitespace between the "endif" and the semicolon. + while ($tokens[$i]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($i, ''); + --$i; + } + + // Remove the "endif". + $phpcsFile->fixer->replaceToken($i, ''); + --$i; + } + + // Remove superfluous whitespace before the inner scope closer. + while ($tokens[$i]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($i, ''); + --$i; + } + + // Replace the else. + $phpcsFile->fixer->replaceToken($stackPtr, 'elseif' . $condition); + + // Remove potential superfluous whitespace between the new condition and the scope opener. + $i = ($stackPtr + 1); + while ($tokens[$i]['line'] === $tokens[$stackPtr]['line'] + && $tokens[$i]['code'] === \T_WHITESPACE + ) { + $phpcsFile->fixer->replaceToken($i, ''); + ++$i; + } + + if ($outerInnerSameType === false + && $innerScopeCount > 1 + ) { + $loop = 1; + foreach ($innerScopes as $opener => $closer) { + if ($targetIsCurly === true) { + if ($loop !== 1) { + // Only handle the opener when it's not the first of the chain as that's already handled above. + $phpcsFile->fixer->replaceToken($opener, ' {'); + } + + if ($loop !== $innerScopeCount) { + // Only handle the closer when it's not the last of the chain as that's already handled above. + $phpcsFile->fixer->addContentBefore($closer, '} '); + } + } else { + if ($loop !== 1) { + // Only handle the opener when it's not the first of the chain as that's already handled above. + $phpcsFile->fixer->replaceToken($opener, ':'); + } + + if ($loop !== $innerScopeCount) { + // Only handle the closer when it's not the last of the chain as that's already handled above. + $phpcsFile->fixer->replaceToken($closer, ''); + + $j = ($closer + 1); + while ($tokens[$j]['code'] === \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($j, ''); + ++$j; + } + } + } + + ++$loop; + } + } + + $phpcsFile->fixer->endChangeset(); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php new file mode 100644 index 00000000..fb2c39d4 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php @@ -0,0 +1,164 @@ + + */ + public function register() + { + return [ + \T_ELSE, + \T_ELSEIF, + ]; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + + /* + * Check for control structures without braces and alternative syntax. + */ + $scopePtr = $stackPtr; + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + // Deal with "else if". + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($tokens[$next]['code'] === \T_IF) { + $scopePtr = $next; + } + } + + if (isset($tokens[$scopePtr]['scope_opener']) === false + || $tokens[$tokens[$scopePtr]['scope_opener']]['code'] === \T_COLON + ) { + // No scope opener found or alternative syntax (not our concern). + return; + } + + /* + * Check whether the else(if) is on a new line. + */ + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prevNonEmpty === false || $tokens[$prevNonEmpty]['code'] !== \T_CLOSE_CURLY_BRACKET) { + // Parse error or mixing braced and non-braced. Not our concern. + return; + } + + if ($tokens[$prevNonEmpty]['line'] !== $tokens[$stackPtr]['line']) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); + + $errorBase = \strtoupper($tokens[$stackPtr]['content']); + $error = $errorBase . ' statement must be on a new line.'; + + $prevNonWhitespace = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + + if ($prevNonWhitespace !== $prevNonEmpty) { + // Comment found between previous scope closer and the keyword. + $fix = $phpcsFile->addError($error, $stackPtr, 'NoNewLine'); + return; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoNewLine'); + if ($fix === false) { + return; + } + + /* + * Fix it. + */ + + // Figure out the indentation for the else(if). + $indentBase = $prevNonEmpty; + if (isset($tokens[$prevNonEmpty]['scope_condition']) === true + && ($tokens[$tokens[$prevNonEmpty]['scope_condition']]['column'] === 1 + || ($tokens[($tokens[$prevNonEmpty]['scope_condition'] - 1)]['code'] === \T_WHITESPACE + && $tokens[($tokens[$prevNonEmpty]['scope_condition'] - 1)]['column'] === 1)) + ) { + // Base the indentation off the previous if/elseif if on a line by itself. + $indentBase = $tokens[$prevNonEmpty]['scope_condition']; + } + + $indent = ''; + $firstOnIndentLine = $indentBase; + if ($tokens[$firstOnIndentLine]['column'] !== 1) { + while (isset($tokens[($firstOnIndentLine - 1)]) && $tokens[--$firstOnIndentLine]['column'] !== 1); + + if ($tokens[$firstOnIndentLine]['code'] === \T_WHITESPACE) { + $indent = $tokens[$firstOnIndentLine]['content']; + + // If tabs were replaced, use the original content. + if (isset($tokens[$firstOnIndentLine]['orig_content']) === true) { + $indent = $tokens[$firstOnIndentLine]['orig_content']; + } + } + } + + $phpcsFile->fixer->beginChangeset(); + + // Remove any whitespace between the previous scope closer and the else(if). + for ($i = ($prevNonEmpty + 1); $i < $stackPtr; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addContent($prevNonEmpty, $phpcsFile->eolChar . $indent); + $phpcsFile->fixer->endChangeset(); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php new file mode 100644 index 00000000..c274e751 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php @@ -0,0 +1,190 @@ + + */ + private $search = [ + // Some tokens to help skip over structures we're not interested in. + \T_START_HEREDOC => \T_START_HEREDOC, + \T_START_NOWDOC => \T_START_NOWDOC, + ]; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + $this->search += Tokens::$ooScopeTokens; + $this->search += Collections::functionDeclarationTokens(); + + return Collections::phpOpenTags(); + } + + /** + * 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 int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $firstOO = null; + $firstFunction = null; + $functionCount = 0; + $OOCount = 0; + + for ($i = 0; $i < $phpcsFile->numTokens; $i++) { + // Ignore anything within square brackets. + if ($tokens[$i]['code'] !== \T_OPEN_CURLY_BRACKET + && isset($tokens[$i]['bracket_opener'], $tokens[$i]['bracket_closer']) + && $i === $tokens[$i]['bracket_opener'] + ) { + $i = $tokens[$i]['bracket_closer']; + continue; + } + + // Skip past nested arrays, function calls and arbitrary groupings. + if ($tokens[$i]['code'] === \T_OPEN_PARENTHESIS + && isset($tokens[$i]['parenthesis_closer']) + ) { + $i = $tokens[$i]['parenthesis_closer']; + continue; + } + + // Skip over potentially large docblocks. + if ($tokens[$i]['code'] === \T_DOC_COMMENT_OPEN_TAG + && isset($tokens[$i]['comment_closer']) + ) { + $i = $tokens[$i]['comment_closer']; + continue; + } + + // Ignore everything else we're not interested in. + if (isset($this->search[$tokens[$i]['code']]) === false) { + continue; + } + + // Skip over structures which won't contain anything we're interested in. + if (($tokens[$i]['code'] === \T_START_HEREDOC + || $tokens[$i]['code'] === \T_START_NOWDOC + || $tokens[$i]['code'] === \T_ANON_CLASS + || $tokens[$i]['code'] === \T_CLOSURE + || $tokens[$i]['code'] === \T_FN) + && isset($tokens[$i]['scope_condition'], $tokens[$i]['scope_closer']) + && $tokens[$i]['scope_condition'] === $i + ) { + $i = $tokens[$i]['scope_closer']; + continue; + } + + // This will be either a function declaration or an OO declaration token. + if ($tokens[$i]['code'] === \T_FUNCTION) { + if (isset($firstFunction) === false) { + $firstFunction = $i; + } + + ++$functionCount; + } else { + if (isset($firstOO) === false) { + $firstOO = $i; + } + + ++$OOCount; + } + + if (isset($tokens[$i]['scope_closer']) === true) { + $i = $tokens[$i]['scope_closer']; + } + } + + if ($functionCount > 0 && $OOCount > 0) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'Both function and OO declarations'); + + $reportToken = \max($firstFunction, $firstOO); + + $phpcsFile->addError( + 'A file should either contain function declarations or OO structure declarations, but not both.' + . ' Found %d function declaration(s) and %d OO structure declaration(s).' + . ' The first function declaration was found on line %d;' + . ' the first OO declaration was found on line %d', + $reportToken, + 'Mixed', + [ + $functionCount, + $OOCount, + $tokens[$firstFunction]['line'], + $tokens[$firstOO]['line'], + ] + ); + } elseif ($functionCount > 0) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'Only function(s)'); + } elseif ($OOCount > 0) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'Only OO structure(s)'); + } else { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'Neither'); + } + + // Ignore the rest of the file. + return ($phpcsFile->numTokens + 1); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php new file mode 100644 index 00000000..a9ccf78b --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php @@ -0,0 +1,233 @@ + + */ + public function register() + { + return [\T_CLOSURE]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.1.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) + { + $this->recommendedLines = (int) $this->recommendedLines; + $this->maxLines = (int) $this->maxLines; + + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { + // Live coding/parse error. Shouldn't be possible as in that case tokenizer won't retokenize to T_CLOSURE. + return; // @codeCoverageIgnore + } + + $opener = $tokens[$stackPtr]['scope_opener']; + $closer = $tokens[$stackPtr]['scope_closer']; + + $currentLine = $tokens[$opener]['line']; + $closerLine = $tokens[$closer]['line']; + + $codeLines = 0; + $commentLines = 0; + $blankLines = 0; + + // Check whether the line of the scope opener needs to be counted, but ignore trailing comments on that line. + $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), $closer, true); + if ($firstNonEmpty !== false && $tokens[$firstNonEmpty]['line'] === $currentLine) { + ++$codeLines; + } + + // Check whether the line of the scope closer needs to be counted. + if ($closerLine !== $currentLine) { + $hasCommentTokens = false; + $hasCodeTokens = false; + for ($i = ($closer - 1); $tokens[$i]['line'] === $closerLine && $i > $opener; $i--) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { + $hasCodeTokens = true; + } elseif (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { + $hasCommentTokens = true; + } + } + + if ($hasCodeTokens === true) { + ++$codeLines; + } elseif ($hasCommentTokens === true) { + ++$commentLines; + } + } + + // We've already examined the opener line, so move to the next line. + for ($i = ($opener + 1); $tokens[$i]['line'] === $currentLine && $i < $closer; $i++); + $currentLine = $tokens[$i]['line']; + + // Walk tokens. + while ($currentLine !== $closerLine) { + $hasCommentTokens = false; + $hasCodeTokens = false; + + while ($tokens[$i]['line'] === $currentLine) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { + $hasCodeTokens = true; + } elseif (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { + $hasCommentTokens = true; + } + + ++$i; + } + + if ($hasCodeTokens === true) { + ++$codeLines; + } elseif ($hasCommentTokens === true) { + ++$commentLines; + } else { + // Only option left is that this is an empty line. + ++$blankLines; + } + + $currentLine = $tokens[$i]['line']; + } + + $nonBlankLines = ($codeLines + $commentLines); + $totalLines = ($codeLines + $commentLines + $blankLines); + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_CODE, $codeLines . ' lines'); + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_COMMENTS, $nonBlankLines . ' lines'); + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_ALL, $totalLines . ' lines'); + + $lines = $codeLines; + if ($this->ignoreCommentLines === false) { + $lines += $commentLines; + } + if ($this->ignoreEmptyLines === false) { + $lines += $blankLines; + } + + $errorSuffix = ' Declare a named function instead. Found closure containing %s lines'; + + if ($lines > $this->maxLines) { + $phpcsFile->addError( + 'Closures which are longer than %s lines are forbidden.' . $errorSuffix, + $stackPtr, + 'ExceedsMaximum', + [$this->maxLines, $lines] + ); + + return; + } + + if ($lines > $this->recommendedLines) { + $phpcsFile->addWarning( + 'It is recommended for closures to contain %s lines or less.' . $errorSuffix, + $stackPtr, + 'ExceedsRecommended', + [$this->recommendedLines, $lines] + ); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php new file mode 100644 index 00000000..505c19b3 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php @@ -0,0 +1,120 @@ + + */ + public function register() + { + return [\T_FUNCTION]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.1.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(); + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { + // Parse error/live coding. + return; + } + + $scopePtr = Scopes::validDirectScope($phpcsFile, $stackPtr, \T_TRAIT); + if ($scopePtr === false) { + // Not a trait method. + return; + } + + $methodProps = FunctionDeclarations::getProperties($phpcsFile, $stackPtr); + if ($methodProps['scope'] === 'private') { + // Private methods can't be final. + return; + } + + if ($methodProps['is_final'] === true) { + // Already final, nothing to do. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'final'); + return; + } + + if ($methodProps['is_abstract'] === true) { + // Abstract classes can't be final. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'abstract'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'not abstract, not final'); + + $methodName = FunctionDeclarations::getName($phpcsFile, $stackPtr); + $magic = ''; + $code = 'NonFinalMethodFound'; + if (FunctionDeclarations::isMagicMethodName($methodName) === true) { + // Use separate error code for magic methods. + $magic = 'magic '; + $code = 'NonFinalMagicMethodFound'; + } + + $data = [ + $methodProps['scope'], + $magic, + $methodName, + ObjectDeclarations::getName($phpcsFile, $scopePtr), + ]; + + $fix = $phpcsFile->addFixableError( + 'The non-abstract, %s %smethod "%s()" in trait %s should be declared as final.', + $stackPtr, + $code, + $data + ); + + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($stackPtr, 'final '); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php new file mode 100644 index 00000000..de7447e0 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php @@ -0,0 +1,71 @@ + + */ + public function register() + { + return [\T_LIST]; + } + + /** + * 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) + { + $openClose = Lists::getOpenClose($phpcsFile, $stackPtr); + if ($openClose === false) { + // Live coding or parse error. + return; + } + + $fix = $phpcsFile->addFixableError('Long list syntax is not allowed', $stackPtr, 'Found'); + + if ($fix === true) { + $opener = $openClose['opener']; + $closer = $openClose['closer']; + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($stackPtr, ''); + $phpcsFile->fixer->replaceToken($opener, '['); + $phpcsFile->fixer->replaceToken($closer, ']'); + + $phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php new file mode 100644 index 00000000..af2a9489 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php @@ -0,0 +1,86 @@ + + */ + public function register() + { + return Collections::listOpenTokensBC(); + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === \T_LIST) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); + return; + } + + $openClose = Lists::getOpenClose($phpcsFile, $stackPtr); + + if ($openClose === false) { + // Not a short list, live coding or parse error. + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); + + $fix = $phpcsFile->addFixableError('Short list syntax is not allowed', $stackPtr, 'Found'); + + if ($fix === true) { + $opener = $openClose['opener']; + $closer = $openClose['closer']; + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($opener, 'list('); + $phpcsFile->fixer->replaceToken($closer, ')'); + $phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php new file mode 100644 index 00000000..3b6ad982 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php @@ -0,0 +1,81 @@ + + */ + public function register() + { + return [\T_NAMESPACE]; + } + + /** + * 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) + { + if (Namespaces::isDeclaration($phpcsFile, $stackPtr) === false) { + // Namespace operator, not a declaration; or live coding/parse error. + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_condition']) === false + || $tokens[$stackPtr]['scope_condition'] !== $stackPtr + ) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); + + $phpcsFile->addError( + 'Namespace declarations using the curly brace syntax are not allowed.', + $stackPtr, + 'Forbidden' + ); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php new file mode 100644 index 00000000..5348e707 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php @@ -0,0 +1,80 @@ + + */ + public function register() + { + return [\T_NAMESPACE]; + } + + /** + * 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) + { + $name = Namespaces::getDeclaredName($phpcsFile, $stackPtr); + if ($name === false) { + // Use of the namespace keyword as an operator or live coding/parse error. + return; + } + + if ($name !== '') { + // Named namespace. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); + + // Namespace declaration without namespace name (= global namespace). + $phpcsFile->addError( + 'Namespace declarations without a namespace name are not allowed.', + $stackPtr, + 'Forbidden' + ); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php new file mode 100644 index 00000000..78fa3261 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php @@ -0,0 +1,81 @@ + + */ + public function register() + { + return [\T_NAMESPACE]; + } + + /** + * 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) + { + if (Namespaces::isDeclaration($phpcsFile, $stackPtr) === false) { + // Namespace operator, not a declaration; or live coding/parse error. + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_condition']) === true + && $tokens[$stackPtr]['scope_condition'] === $stackPtr + ) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); + + $phpcsFile->addError( + 'Namespace declarations without curly braces are not allowed.', + $stackPtr, + 'Forbidden' + ); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php new file mode 100644 index 00000000..65f3e589 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php @@ -0,0 +1,96 @@ + + */ + public function register() + { + return [\T_NAMESPACE]; + } + + /** + * 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) + { + $fileName = $phpcsFile->getFilename(); + if ($this->currentFile !== $fileName) { + // Reset the properties for each new file. + $this->currentFile = $fileName; + $this->declarationSeen = false; + } + + if (Namespaces::isDeclaration($phpcsFile, $stackPtr) === false) { + // Namespace operator, not a declaration; or live coding/parse error. + return; + } + + if ($this->declarationSeen === false) { + // This is the first namespace declaration in the file. + $this->declarationSeen = $stackPtr; + return; + } + + $tokens = $phpcsFile->getTokens(); + + // OK, so this is a file with multiple namespace declarations. + $phpcsFile->addError( + 'There should be only one namespace declaration per file. The first declaration was found on line %d', + $stackPtr, + 'MultipleFound', + [$tokens[$this->declarationSeen]['line']] + ); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php new file mode 100644 index 00000000..7815e7e0 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php @@ -0,0 +1,190 @@ + Key is the lowercased keyword, value the "proper" cased keyword. + */ + private $reservedNames = [ + 'abstract' => 'abstract', + 'and' => 'and', + 'array' => 'array', + 'as' => 'as', + 'break' => 'break', + 'callable' => 'callable', + 'case' => 'case', + 'catch' => 'catch', + 'class' => 'class', + 'clone' => 'clone', + 'const' => 'const', + 'continue' => 'continue', + 'declare' => 'declare', + 'default' => 'default', + 'die' => 'die', + 'do' => 'do', + 'echo' => 'echo', + 'else' => 'else', + 'elseif' => 'elseif', + 'empty' => 'empty', + 'enddeclare' => 'enddeclare', + 'endfor' => 'endfor', + 'endforeach' => 'endforeach', + 'endif' => 'endif', + 'endswitch' => 'endswitch', + 'endwhile' => 'endwhile', + 'enum' => 'enum', + 'eval' => 'eval', + 'exit' => 'exit', + 'extends' => 'extends', + 'final' => 'final', + 'finally' => 'finally', + 'fn' => 'fn', + 'for' => 'for', + 'foreach' => 'foreach', + 'function' => 'function', + 'global' => 'global', + 'goto' => 'goto', + 'if' => 'if', + 'implements' => 'implements', + 'include' => 'include', + 'include_once' => 'include_once', + 'instanceof' => 'instanceof', + 'insteadof' => 'insteadof', + 'interface' => 'interface', + 'isset' => 'isset', + 'list' => 'list', + 'match' => 'match', + 'namespace' => 'namespace', + 'new' => 'new', + 'or' => 'or', + 'print' => 'print', + 'private' => 'private', + 'protected' => 'protected', + 'public' => 'public', + 'readonly' => 'readonly', + 'require' => 'require', + 'require_once' => 'require_once', + 'return' => 'return', + 'static' => 'static', + 'switch' => 'switch', + 'throw' => 'throw', + 'trait' => 'trait', + 'try' => 'try', + 'unset' => 'unset', + 'use' => 'use', + 'var' => 'var', + 'while' => 'while', + 'xor' => 'xor', + 'yield' => 'yield', + '__class__' => '__CLASS__', + '__dir__' => '__DIR__', + '__file__' => '__FILE__', + '__function__' => '__FUNCTION__', + '__line__' => '__LINE__', + '__method__' => '__METHOD__', + '__namespace__' => '__NAMESPACE__', + '__trait__' => '__TRAIT__', + 'int' => 'int', + 'float' => 'float', + 'bool' => 'bool', + 'string' => 'string', + 'true' => 'true', + 'false' => 'false', + 'null' => 'null', + 'void' => 'void', + 'iterable' => 'iterable', + 'object' => 'object', + 'resource' => 'resource', + 'mixed' => 'mixed', + 'numeric' => 'numeric', + 'never' => 'never', + + /* + * Not reserved keywords, but equally confusing when used in the context of function calls + * with named parameters. + */ + 'parent' => 'parent', + 'self' => 'self', + ]; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + return Collections::functionDeclarationTokens(); + } + + /** + * 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) + { + // Get all parameters from method signature. + $parameters = FunctionDeclarations::getParameters($phpcsFile, $stackPtr); + if (empty($parameters)) { + return; + } + + $message = 'It is recommended not to use reserved keyword "%s" as function parameter name. Found: %s'; + + foreach ($parameters as $param) { + $name = \ltrim($param['name'], '$'); + $nameLC = \strtolower($name); + if (isset($this->reservedNames[$nameLC]) === true) { + $errorCode = $nameLC . 'Found'; + $data = [ + $this->reservedNames[$nameLC], + $param['name'], + ]; + + $phpcsFile->addWarning($message, $param['token'], $errorCode, $data); + } + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php new file mode 100644 index 00000000..4d765c2c --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php @@ -0,0 +1,275 @@ + + * class Foo implements \Vendor\DiffIterator, My\Count, DateTimeInterface {} + *
    + * + * If sorted using the "name" sort-order, the sniff looks just at the interface name, i.e. + * `DiffIterator`, `Count` and `DateTimeInterface`, which for this example would mean + * the correct order would be `My\Count, DateTimeInterface, \Vendor\DiffIterator`. + * + * If sorted using the "full" sort-order, the sniff will look at the full name as used + * in the `implements` statement, without leading backslashes. + * For the example above, this would mean that the correct order would be: + * `DateTimeInterface, My\Count, \Vendor\DiffIterator`. + * + * @since 1.0.0 + * + * @var string + */ + public $orderby = 'name'; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + return (Collections::ooCanExtend() + Collections::ooCanImplement()); + } + + /** + * 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 setting. + */ + if ($this->orderby !== 'full') { + // Use the default. + $this->orderby = 'name'; + } + $metricNameAlpha = \sprintf(self::METRIC_NAME_ALPHA, $this->orderby); + + $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + // Parse error or live coding. Ignore. + return; + } + + $scopeOpener = $tokens[$stackPtr]['scope_opener']; + + /* + * Get the names. + */ + if (isset(Collections::ooCanImplement()[$tokens[$stackPtr]['code']]) === true) { + $names = ObjectDeclarations::findImplementedInterfaceNames($phpcsFile, $stackPtr); + } else { + $names = ObjectDeclarations::findExtendedInterfaceNames($phpcsFile, $stackPtr); + } + + if (\is_array($names) === false) { + // Class/interface/enum doesn't extend or implement. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_COUNT, 0); + $phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'n/a'); + return; + } + + $count = \count($names); + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_COUNT, $count); + + if ($count < 2) { + // Nothing to sort. + $phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'n/a'); + return; + } + + /* + * Check the order. + */ + if ($this->orderby === 'name') { + $sorted = $this->sortByName($names); + } else { + $sorted = $this->sortByFull($names); + } + + if ($sorted === $names) { + // Order is already correct. + $phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'yes'); + return; + } + + $phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'no'); + + /* + * Throw the error. + */ + $keyword = \T_IMPLEMENTS; + if (isset(Collections::ooCanImplement()[$tokens[$stackPtr]['code']]) === false) { + $keyword = \T_EXTENDS; + } + + $fixable = true; + $keywordPtr = $phpcsFile->findNext($keyword, ($stackPtr + 1), $scopeOpener); + $hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($keywordPtr + 1), $scopeOpener); + if ($hasComment !== false) { + $fixable = false; + } + + $error = "The interface names in a \"%s %s\" statement should be ordered alphabetically.\n"; + $error .= 'Expected: %s; Found: %s'; + $code = \ucfirst(\strtolower($tokens[$keywordPtr]['content'])) . 'WrongOrder'; + $data = [ + $tokens[$stackPtr]['content'], + $tokens[$keywordPtr]['content'], + \implode(', ', $names), + \implode(', ', $sorted), + ]; + + if ($fixable === false) { + $code .= 'WithComments'; + $phpcsFile->addError($error, $keywordPtr, $code, $data); + return; + } + + // OK, so we appear to have a fixable error. + $fix = $phpcsFile->addFixableError($error, $keywordPtr, $code, $data); + if ($fix === false) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + // Remove the complete previous extends/implements part. + for ($i = ($keywordPtr + 1); $i < $scopeOpener; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addContent($keywordPtr, ' ' . \implode(', ', $sorted) . ' '); + + $phpcsFile->fixer->endChangeset(); + } + + /** + * Sort an array of potentially mixed qualified and unqualified names by the interface name. + * + * @since 1.0.0 + * + * @param string[] $names Interface names, potentially mixed qualified and unqualified. + * + * @return string[] + */ + protected function sortByName(array $names) + { + $getLastName = function ($name) { + $last = \strrchr($name, '\\'); + if ($last === false) { + $last = $name; + } else { + $last = \substr($last, 1); + } + + return $last; + }; + + return $this->sortNames($names, $getLastName); + } + + /** + * Sort an array of potentially mixed qualified and unqualified names by the full name. + * + * @since 1.0.0 + * + * @param string[] $names Interface names, potentially mixed qualified and unqualified. + * + * @return string[] + */ + protected function sortByFull(array $names) + { + $trimLeadingBackslash = function ($name) { + return \ltrim($name, '\\'); + }; + + return $this->sortNames($names, $trimLeadingBackslash); + } + + /** + * Sort an array of names. + * + * @since 1.0.0 + * + * @param string[] $names Interface names, potentially mixed qualified and unqualified. + * @param callable $prepareNames Function to call to prepare the names before sorting. + * + * @return string[] + */ + private function sortNames(array $names, callable $prepareNames) + { + $preppedNames = \array_map($prepareNames, $names); + $names = \array_combine($names, $preppedNames); + + \natcasesort($names); + + return \array_keys($names); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php new file mode 100644 index 00000000..093785ad --- /dev/null +++ b/trunk/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/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php new file mode 100644 index 00000000..19e49717 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php @@ -0,0 +1,112 @@ + + */ + private $metricType = [ + \T_LOGICAL_AND => 'logical (and/or)', + \T_LOGICAL_OR => 'logical (and/or)', + \T_BOOLEAN_AND => 'boolean (&&/||)', + \T_BOOLEAN_OR => 'boolean (&&/||)', + ]; + + /** + * The tokens this sniff targets with error code and replacements. + * + * @since 1.0.0 + * + * @var array> + */ + private $targetTokenInfo = [ + \T_LOGICAL_AND => [ + 'error_code' => 'LogicalAnd', + 'replacement' => '&&', + ], + \T_LOGICAL_OR => [ + 'error_code' => 'LogicalOr', + 'replacement' => '||', + ], + ]; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + return \array_keys($this->metricType); + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + $tokenCode = $tokens[$stackPtr]['code']; + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, $this->metricType[$tokenCode]); + + if (isset($this->targetTokenInfo[$tokenCode]) === false) { + // Already using boolean operator. + return; + } + + $error = 'Using logical operators is not allowed. Expected: "%s"; Found: "%s"'; + $data = [ + $this->targetTokenInfo[$tokenCode]['replacement'], + $tokens[ $stackPtr ]['content'], + ]; + + $phpcsFile->addError($error, $stackPtr, $this->targetTokenInfo[$tokenCode]['error_code'], $data); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php new file mode 100644 index 00000000..37a39a18 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php @@ -0,0 +1,76 @@ + + */ + public function register() + { + return [\T_INLINE_THEN]; + } + + /** + * 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) + { + if (Operators::isShortTernary($phpcsFile, $stackPtr) === false) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'long'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'short'); + + $phpcsFile->addError( + 'Using short ternaries is not allowed as they are rarely used correctly', + $stackPtr, + 'Found' + ); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php new file mode 100644 index 00000000..b8538882 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php @@ -0,0 +1,197 @@ + + */ + private $allowedTokens = [ + \T_VARIABLE => \T_VARIABLE, + ]; + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + $this->allowedTokens += Collections::ooHierarchyKeywords(); + $this->allowedTokens += Collections::objectOperators(); + $this->allowedTokens += Collections::namespacedNameTokens(); + + /* + * Remove nullsafe object operator. In/decrement not allowed in write context, + * so ignore. + */ + unset($this->allowedTokens[\T_NULLSAFE_OBJECT_OPERATOR]); + + return Collections::incrementDecrementOperators(); + } + + /** + * 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 int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (empty($tokens[$stackPtr]['nested_parenthesis']) === false) { + // Not a stand-alone statement. + return; + } + + $start = BCFile::findStartOfStatement($phpcsFile, $stackPtr); + $end = BCFile::findEndOfStatement($phpcsFile, $stackPtr); + + if (isset(Collections::incrementDecrementOperators()[$tokens[$end]['code']])) { + // Statement ends on a PHP close tag, set the end pointer to the close tag. + $end = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); + } + + if ($tokens[$end]['code'] !== \T_SEMICOLON + && $tokens[$end]['code'] !== \T_CLOSE_TAG + ) { + // Not a stand-alone statement. + return $end; + } + + $counter = 0; + $lastCode = null; + $operators = Collections::incrementDecrementOperators(); + for ($i = $start; $i < $end; $i++) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { + continue; + } + + if (isset($operators[$tokens[$i]['code']]) === true) { + $lastCode = $tokens[$i]['code']; + ++$counter; + continue; + } + + if (isset($this->allowedTokens[$tokens[$i]['code']]) === true) { + $lastCode = $tokens[$i]['code']; + continue; + } + + if ($tokens[$i]['code'] === \T_OPEN_SQUARE_BRACKET + && isset($tokens[$i]['bracket_closer']) + && ($lastCode === \T_VARIABLE || $lastCode === \T_STRING) + ) { + // Array access. + $i = $tokens[$i]['bracket_closer']; + continue; + } + + // Came across an unexpected token. This is (probably) not a stand-alone statement. + return $end; + } + + if ($counter > 1) { + $phpcsFile->addWarning( + 'Using multiple increment/decrement operators in a stand-alone statement is strongly discouraged.' + . ' Found: %s', + $stackPtr, + 'MultipleOperatorsFound', + [GetTokensAsString::compact($phpcsFile, $start, ($end - 1), true)] + ); + + return $end; + } + + $type = 'increment'; + if ($tokens[$stackPtr]['code'] === \T_DEC) { + $type = 'decrement'; + } + + $lastNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($end - 1), $start, true); + if ($start === $stackPtr && $lastNonEmpty !== $stackPtr) { + // This is already pre-in/decrement. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'pre-' . $type); + return $end; + } + + if ($lastNonEmpty === false || $lastNonEmpty === $start || $lastNonEmpty !== $stackPtr) { + // Parse error or otherwise unsupported syntax. Ignore. + return $end; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'post-' . $type); + + $error = 'Stand-alone post-%1$s statement found. Use pre-%1$s instead: %2$s.'; + $errorCode = 'Post' . \ucfirst($type) . 'Found'; + $replacement = $tokens[$stackPtr]['content']; + $replacement .= GetTokensAsString::compact($phpcsFile, $start, ($lastNonEmpty - 1), true); + $data = [ + $type, + $replacement, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($stackPtr, ''); + $phpcsFile->fixer->addContentBefore($start, $tokens[$stackPtr]['content']); + $phpcsFile->fixer->endChangeset(); + } + + return $end; + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php new file mode 100644 index 00000000..c828df9e --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php @@ -0,0 +1,116 @@ + + */ + private $metricType = [ + \T_IS_EQUAL => 'loose', + \T_IS_NOT_EQUAL => 'loose', + \T_IS_IDENTICAL => 'strict', + \T_IS_NOT_IDENTICAL => 'strict', + ]; + + /** + * The tokens this sniff targets with error code and replacements. + * + * @since 1.0.0 + * + * @var array> + */ + private $targetTokenInfo = [ + \T_IS_EQUAL => [ + 'error_code' => 'LooseEqual', + 'replacement' => '===', + ], + \T_IS_NOT_EQUAL => [ + 'error_code' => 'LooseNotEqual', + 'replacement' => '!==', + ], + ]; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + return \array_keys($this->metricType); + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + $tokenCode = $tokens[$stackPtr]['code']; + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, $this->metricType[$tokenCode]); + + if (isset($this->targetTokenInfo[$tokenCode]) === false) { + // Already using strict comparison operator. + return; + } + + $error = 'Loose comparisons are not allowed. Expected: "%s"; Found: "%s"'; + $data = [ + $this->targetTokenInfo[$tokenCode]['replacement'], + $tokens[ $stackPtr ]['content'], + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $this->targetTokenInfo[$tokenCode]['error_code'], $data); + if ($fix === false) { + return; + } + + $phpcsFile->fixer->replaceToken($stackPtr, $this->targetTokenInfo[$tokenCode]['replacement']); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php new file mode 100644 index 00000000..440ecc86 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php @@ -0,0 +1,85 @@ + + */ + public function register() + { + return [ + \T_TYPE_UNION, + \T_TYPE_INTERSECTION, + ]; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + + $type = ($tokens[$stackPtr]['code'] === \T_TYPE_UNION) ? 'union' : 'intersection'; + $code = \ucfirst($type) . 'Type'; + + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + SpacesFixer::checkAndFix( + $phpcsFile, + $stackPtr, + $prevNonEmpty, + 0, // Expected spaces. + 'Expected %s before the ' . $type . ' type separator. Found: %s', + $code . 'SpacesBefore', + 'error', + 0, // Severity. + 'Space before ' . $type . ' type separator' + ); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + SpacesFixer::checkAndFix( + $phpcsFile, + $stackPtr, + $nextNonEmpty, + 0, // Expected spaces. + 'Expected %s after the ' . $type . ' type separator. Found: %s', + $code . 'SpacesAfter', + 'error', + 0, // Severity. + 'Space after ' . $type . ' type separator' + ); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php new file mode 100644 index 00000000..b231b225 --- /dev/null +++ b/trunk/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/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php new file mode 100644 index 00000000..cbccb4c6 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php @@ -0,0 +1,101 @@ + + */ + public function register() + { + return [\T_OPEN_TAG_WITH_ECHO]; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + + for ($endOfStatement = ($stackPtr + 1); $endOfStatement < $phpcsFile->numTokens; $endOfStatement++) { + if ($tokens[$endOfStatement]['code'] === \T_CLOSE_TAG + || $tokens[$endOfStatement]['code'] === \T_SEMICOLON + ) { + break; + } + + // Skip over anything within parenthesis. + if ($tokens[$endOfStatement]['code'] === \T_OPEN_PARENTHESIS + && isset($tokens[$endOfStatement]['parenthesis_closer']) + ) { + $endOfStatement = $tokens[$endOfStatement]['parenthesis_closer']; + } + } + + if ($endOfStatement === $phpcsFile->numTokens + || $tokens[$endOfStatement]['code'] === \T_CLOSE_TAG + ) { + return; + } + + // Semi-colon, so check for any code between it and the close tag. + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($endOfStatement + 1), null, true); + if ($nextNonEmpty === false + || $tokens[$nextNonEmpty]['code'] === \T_CLOSE_TAG + ) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Only one statement is allowed when using short open echo PHP tags.' + . ' Use the "fixer->replaceToken($stackPtr, 'fixer->replaceToken($stackPtr, ' + */ + public function register() + { + return [\T_USE]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.1.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) + { + if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { + // Closure or trait use statement. Bow out. + return; + } + + $useStatements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); + + $ooCount = \count($useStatements['name']); + $functionCount = \count($useStatements['function']); + $constantCount = \count($useStatements['const']); + $totalCount = $ooCount + $functionCount + $constantCount; + + if ($totalCount === 0) { + // There must have been a parse error. Bow out. + return; + } + + // End of statement will always be found, otherwise the import statement parsing would have failed. + $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); + $groupStart = $phpcsFile->findNext(\T_OPEN_USE_GROUP, ($stackPtr + 1), $endOfStatement); + + if ($groupStart === false) { + // Not a group use statement. Just record the metric. + if ($totalCount === 1) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'single import'); + } else { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'multi import'); + } + + return; + } + + if ($totalCount === 1 + || ($ooCount !== 0 && $functionCount === 0 && $constantCount === 0) + || ($ooCount === 0 && $functionCount !== 0 && $constantCount === 0) + || ($ooCount === 0 && $functionCount === 0 && $constantCount !== 0) + ) { + // Not a *mixed* group use statement. + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'group use, single type'); + return; + } + + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'group use, multi type'); + + // Build up the error message. + $foundPhrases = []; + if ($ooCount > 1) { + $foundPhrases[] = \sprintf('%d namespaces/OO names', $ooCount); + } elseif ($ooCount === 1) { + $foundPhrases[] = \sprintf('%d namespace/OO name', $ooCount); + } + + if ($functionCount > 1) { + $foundPhrases[] = \sprintf('%d functions', $functionCount); + } elseif ($functionCount === 1) { + $foundPhrases[] = \sprintf('%d function', $functionCount); + } + + if ($constantCount > 1) { + $foundPhrases[] = \sprintf('%d constants', $constantCount); + } elseif ($constantCount === 1) { + $foundPhrases[] = \sprintf('%d constant', $constantCount); + } + + if (\count($foundPhrases) === 2) { + $found = \implode(' and ', $foundPhrases); + } else { + $found = \array_shift($foundPhrases) . ', '; + $found .= \implode(' and ', $foundPhrases); + } + + $error = 'Group use statements should import one type of construct.' + . ' Mixed group use statement found importing %s.'; + $code = 'Found'; + $data = [$found]; + + $hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($stackPtr + 1), $endOfStatement); + if ($hasComment !== false) { + // Don't attempt to auto-fix is there are comments or PHPCS annotations in the statement. + $phpcsFile->addError($error, $stackPtr, $code, $data); + return; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $code, $data); + + if ($fix === false) { + return; + } + + /* + * Fix it. + * + * This fixer complies with the following (arbitrary) requirements: + * - It will re-use the original base "group" name, i.e. the part before \{. + * - It take take aliases into account, but only when something is aliased to a different name. + * Aliases re-using the original name will be removed. + * - The fix will not add a trailing comma after the last group use sub-statement. + * This is a PHP 7.2+ feature. + * If a standard wants to enforce trailing commas, they should use a separate sniff for that. + * - If there is only 1 statement of a certain type, the replacement will be a single + * import use statement, not a group use statement. + */ + + $phpcsFile->fixer->beginChangeset(); + + // Ensure that a potential close PHP tag ending the statement is not removed. + $tokens = $phpcsFile->getTokens(); + $endRemoval = $endOfStatement; + if ($tokens[$endOfStatement]['code'] !== \T_SEMICOLON) { + $endRemoval = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($endOfStatement - 1), null, true); + } + + // Remove old statement with the exception of the `use` keyword. + for ($i = ($stackPtr + 1); $i <= $endRemoval; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + // Build up the new use import statements. + $newStatements = []; + + $useIndent = \str_repeat(' ', ($tokens[$stackPtr]['column'] - 1)); + $insideIndent = $useIndent . \str_repeat(' ', 4); + + $baseGroupName = GetTokensAsString::noEmpties($phpcsFile, ($stackPtr + 1), ($groupStart - 1)); + + foreach ($useStatements as $type => $statements) { + $count = \count($statements); + if ($count === 0) { + continue; + } + + $typeName = $type . ' '; + if ($type === 'name') { + $typeName = ''; + } + + if ($count === 1) { + $fqName = \reset($statements); + $alias = \key($statements); + + $newStatement = 'use ' . $typeName . $fqName; + + $unqualifiedName = \ltrim(\substr($fqName, \strrpos($fqName, '\\')), '\\'); + if ($unqualifiedName !== $alias) { + $newStatement .= ' as ' . $alias; + } + + $newStatement .= ';'; + + $newStatements[] = $newStatement; + continue; + } + + // Multiple statements, add a single-type group use statement. + $newStatement = 'use ' . $typeName . $baseGroupName . '{' . $phpcsFile->eolChar; + + foreach ($statements as $alias => $fqName) { + $partialName = \str_replace($baseGroupName, '', $fqName); + $newStatement .= $insideIndent . $partialName; + + $unqualifiedName = \ltrim(\substr($partialName, \strrpos($partialName, '\\')), '\\'); + if ($unqualifiedName !== $alias) { + $newStatement .= ' as ' . $alias; + } + + $newStatement .= ',' . $phpcsFile->eolChar; + } + + // Remove trailing comma after last statement as that's PHP 7.2+. + $newStatement = \rtrim($newStatement, ',' . $phpcsFile->eolChar); + + $newStatement .= $phpcsFile->eolChar . $useIndent . '};'; + $newStatements[] = $newStatement; + } + + $replacement = \implode($phpcsFile->eolChar . $useIndent, $newStatements); + + $phpcsFile->fixer->replaceToken($stackPtr, $replacement); + + $phpcsFile->fixer->endChangeset(); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php new file mode 100644 index 00000000..8dcf8ddb --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php @@ -0,0 +1,211 @@ + + */ + public function register() + { + return [ + \T_USE, + \T_NAMESPACE, + ]; + } + + /** + * 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) + { + $file = $phpcsFile->getFilename(); + if ($file !== $this->currentFile) { + // Reset the current namespace for each new file. + $this->currentFile = $file; + $this->currentNamespace = ''; + } + + $tokens = $phpcsFile->getTokens(); + + // Get the name of the current namespace. + if ($tokens[$stackPtr]['code'] === \T_NAMESPACE) { + $namespaceName = Namespaces::getDeclaredName($phpcsFile, $stackPtr); + if ($namespaceName !== false) { + $this->currentNamespace = $namespaceName; + } + + return; + } + + // Ok, so this is a T_USE token. + try { + $statements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); + } catch (RuntimeException $e) { + // Not an import use statement. Bow out. + return; + } + + if (empty($statements['name'])) { + // No class/trait/interface/enum import statements found. + return; + } + + $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); + + foreach ($statements['name'] as $alias => $fullName) { + $reportPtr = $stackPtr; + do { + $reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias); + if ($reportPtr === false) { + // Shouldn't be possible. + continue 2; // @codeCoverageIgnore + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($reportPtr + 1), $endOfStatement, true); + if ($next !== false && $tokens[$next]['code'] === \T_NS_SEPARATOR) { + // Namespace level with same name. Continue searching. + continue; + } + + break; + } while (true); + + /* + * Build the error message and code. + * + * Check whether this is a non-namespaced (global) import and check whether this is an + * import from within the same namespace. + * + * Takes incorrect use statements with leading backslash into account. + * Takes case-INsensitivity of namespaces names into account. + * + * The "GlobalNamespace" error code takes precedence over the "SameNamespace" error code + * in case this is a non-namespaced file. + */ + + $error = 'Use import statements for class/interface/trait/enum%s are not allowed.'; + $error .= ' Found import statement for: "%s"'; + $errorCode = 'Found'; + $data = [ + '', + $fullName, + ]; + + $globalNamespace = false; + $sameNamespace = false; + if (\strpos($fullName, '\\', 1) === false) { + $globalNamespace = true; + $errorCode = 'FromGlobalNamespace'; + $data[0] = ' from the global namespace'; + + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace'); + } elseif ($this->currentNamespace !== '' + && (\stripos($fullName, $this->currentNamespace . '\\') === 0 + || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0) + ) { + $sameNamespace = true; + $errorCode = 'FromSameNamespace'; + $data[0] = ' from the same namespace'; + + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'same namespace'); + } else { + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'different namespace'); + } + + $hasAlias = false; + $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1))); + $aliasLC = \strtolower($alias); + if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) { + $hasAlias = true; + $error .= ' with alias: "%s"'; + $errorCode .= 'WithAlias'; + $data[] = $alias; + + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'with alias'); + } else { + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'without alias'); + } + + if ($errorCode === 'Found') { + $errorCode = 'FoundWithoutAlias'; + } + + $phpcsFile->addError($error, $reportPtr, $errorCode, $data); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php new file mode 100644 index 00000000..44388f6a --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php @@ -0,0 +1,211 @@ + + */ + public function register() + { + return [ + \T_USE, + \T_NAMESPACE, + ]; + } + + /** + * 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) + { + $file = $phpcsFile->getFilename(); + if ($file !== $this->currentFile) { + // Reset the current namespace for each new file. + $this->currentFile = $file; + $this->currentNamespace = ''; + } + + $tokens = $phpcsFile->getTokens(); + + // Get the name of the current namespace. + if ($tokens[$stackPtr]['code'] === \T_NAMESPACE) { + $namespaceName = Namespaces::getDeclaredName($phpcsFile, $stackPtr); + if ($namespaceName !== false) { + $this->currentNamespace = $namespaceName; + } + + return; + } + + // Ok, so this is a T_USE token. + try { + $statements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); + } catch (RuntimeException $e) { + // Not an import use statement. Bow out. + return; + } + + if (empty($statements['const'])) { + // No import statements for constants found. + return; + } + + $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); + + foreach ($statements['const'] as $alias => $fullName) { + $reportPtr = $stackPtr; + do { + $reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias); + if ($reportPtr === false) { + // Shouldn't be possible. + continue 2; // @codeCoverageIgnore + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($reportPtr + 1), $endOfStatement, true); + if ($next !== false && $tokens[$next]['code'] === \T_NS_SEPARATOR) { + // Namespace level with same name. Continue searching. + continue; + } + + break; + } while (true); + + /* + * Build the error message and code. + * + * Check whether this is a non-namespaced (global) import and check whether this is an + * import from within the same namespace. + * + * Takes incorrect use statements with leading backslash into account. + * Takes case-INsensitivity of namespaces names into account. + * + * The "GlobalNamespace" error code takes precedence over the "SameNamespace" error code + * in case this is a non-namespaced file. + */ + + $error = 'Use import statements for constants%s are not allowed.'; + $error .= ' Found import statement for: "%s"'; + $errorCode = 'Found'; + $data = [ + '', + $fullName, + ]; + + $globalNamespace = false; + $sameNamespace = false; + if (\strpos($fullName, '\\', 1) === false) { + $globalNamespace = true; + $errorCode = 'FromGlobalNamespace'; + $data[0] = ' from the global namespace'; + + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace'); + } elseif ($this->currentNamespace !== '' + && (\stripos($fullName, $this->currentNamespace . '\\') === 0 + || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0) + ) { + $sameNamespace = true; + $errorCode = 'FromSameNamespace'; + $data[0] = ' from the same namespace'; + + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'same namespace'); + } else { + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'different namespace'); + } + + $hasAlias = false; + $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1))); + $aliasLC = \strtolower($alias); + if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) { + $hasAlias = true; + $error .= ' with alias: "%s"'; + $errorCode .= 'WithAlias'; + $data[] = $alias; + + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'with alias'); + } else { + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'without alias'); + } + + if ($errorCode === 'Found') { + $errorCode = 'FoundWithoutAlias'; + } + + $phpcsFile->addError($error, $reportPtr, $errorCode, $data); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php new file mode 100644 index 00000000..46a39edb --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php @@ -0,0 +1,211 @@ + + */ + public function register() + { + return [ + \T_USE, + \T_NAMESPACE, + ]; + } + + /** + * 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) + { + $file = $phpcsFile->getFilename(); + if ($file !== $this->currentFile) { + // Reset the current namespace for each new file. + $this->currentFile = $file; + $this->currentNamespace = ''; + } + + $tokens = $phpcsFile->getTokens(); + + // Get the name of the current namespace. + if ($tokens[$stackPtr]['code'] === \T_NAMESPACE) { + $namespaceName = Namespaces::getDeclaredName($phpcsFile, $stackPtr); + if ($namespaceName !== false) { + $this->currentNamespace = $namespaceName; + } + + return; + } + + // Ok, so this is a T_USE token. + try { + $statements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); + } catch (RuntimeException $e) { + // Not an import use statement. Bow out. + return; + } + + if (empty($statements['function'])) { + // No import statements for functions found. + return; + } + + $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); + + foreach ($statements['function'] as $alias => $fullName) { + $reportPtr = $stackPtr; + do { + $reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias); + if ($reportPtr === false) { + // Shouldn't be possible. + continue 2; // @codeCoverageIgnore + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($reportPtr + 1), $endOfStatement, true); + if ($next !== false && $tokens[$next]['code'] === \T_NS_SEPARATOR) { + // Namespace level with same name. Continue searching. + continue; + } + + break; + } while (true); + + /* + * Build the error message and code. + * + * Check whether this is a non-namespaced (global) import and check whether this is an + * import from within the same namespace. + * + * Takes incorrect use statements with leading backslash into account. + * Takes case-INsensitivity of namespaces names into account. + * + * The "GlobalNamespace" error code takes precedence over the "SameNamespace" error code + * in case this is a non-namespaced file. + */ + + $error = 'Use import statements for functions%s are not allowed.'; + $error .= ' Found import statement for: "%s"'; + $errorCode = 'Found'; + $data = [ + '', + $fullName, + ]; + + $globalNamespace = false; + $sameNamespace = false; + if (\strpos($fullName, '\\', 1) === false) { + $globalNamespace = true; + $errorCode = 'FromGlobalNamespace'; + $data[0] = ' from the global namespace'; + + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace'); + } elseif ($this->currentNamespace !== '' + && (\stripos($fullName, $this->currentNamespace . '\\') === 0 + || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0) + ) { + $sameNamespace = true; + $errorCode = 'FromSameNamespace'; + $data[0] = ' from the same namespace'; + + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'same namespace'); + } else { + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'different namespace'); + } + + $hasAlias = false; + $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1))); + $aliasLC = \strtolower($alias); + if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) { + $hasAlias = true; + $error .= ' with alias: "%s"'; + $errorCode .= 'WithAlias'; + $data[] = $alias; + + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'with alias'); + } else { + $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'without alias'); + } + + if ($errorCode === 'Found') { + $errorCode = 'FoundWithoutAlias'; + } + + $phpcsFile->addError($error, $reportPtr, $errorCode, $data); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php new file mode 100644 index 00000000..3dd47c03 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php @@ -0,0 +1,207 @@ + + */ + protected $keywords = [ + 'const' => true, + 'function' => true, + ]; + + /** + * Returns an array of tokens this sniff wants to listen for. + * + * @since 1.1.0 + * + * @return array + */ + public function register() + { + return [\T_USE]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.1.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) + { + if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { + // Trait or closure use statement. + return; + } + + $tokens = $phpcsFile->getTokens(); + $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); + if ($endOfStatement === false) { + // Live coding or parse error. + return; + } + + // Check the spacing after the `use` keyword. + $this->checkSpacingAfterKeyword($phpcsFile, $stackPtr, $tokens[$stackPtr]['content']); + + // Check the spacing before and after each `as` keyword. + $current = $stackPtr; + do { + $current = $phpcsFile->findNext(\T_AS, ($current + 1), $endOfStatement); + if ($current === false) { + break; + } + + // Prevent false positives when "as" is used within a "name". + if (isset(Tokens::$emptyTokens[$tokens[($current - 1)]['code']]) === true) { + $this->checkSpacingBeforeKeyword($phpcsFile, $current, $tokens[$current]['content']); + $this->checkSpacingAfterKeyword($phpcsFile, $current, $tokens[$current]['content']); + } + } while (true); + + /* + * Check the spacing after `function` and `const` keywords. + */ + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if (isset($this->keywords[\strtolower($tokens[$nextNonEmpty]['content'])]) === true) { + // Keyword found at start of statement, applies to whole statement. + $this->checkSpacingAfterKeyword($phpcsFile, $nextNonEmpty, $tokens[$nextNonEmpty]['content']); + return; + } + + // This may still be a group use statement with function/const substatements. + $openGroup = $phpcsFile->findNext(\T_OPEN_USE_GROUP, ($stackPtr + 1), $endOfStatement); + if ($openGroup === false) { + // Not a group use statement. + return; + } + + $closeGroup = $phpcsFile->findNext(\T_CLOSE_USE_GROUP, ($openGroup + 1), $endOfStatement); + + $current = $openGroup; + do { + $current = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), $closeGroup, true); + if ($current === false) { + return; + } + + if (isset($this->keywords[\strtolower($tokens[$current]['content'])]) === true) { + $this->checkSpacingAfterKeyword($phpcsFile, $current, $tokens[$current]['content']); + } + + // We're within the use group, so find the next comma. + $current = $phpcsFile->findNext(\T_COMMA, ($current + 1), $closeGroup); + } while ($current !== false); + } + + /** + * Check the spacing before a found keyword. + * + * @since 1.1.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the keyword in the token stack. + * @param string $content The keyword as found. + * + * @return void + */ + public function checkSpacingBeforeKeyword(File $phpcsFile, $stackPtr, $content) + { + $contentLC = \strtolower($content); + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + SpacesFixer::checkAndFix( + $phpcsFile, + $stackPtr, + $prevNonEmpty, + 1, // Expected spaces. + 'Expected %s before the "' . $contentLC . '" keyword. Found: %s', + 'SpaceBefore' . \ucfirst($contentLC), + 'error', + 0, // Severity. + \sprintf(self::METRIC_NAME_BEFORE, $contentLC) + ); + } + + /** + * Check the spacing after a found keyword. + * + * @since 1.1.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the keyword in the token stack. + * @param string $content The keyword as found. + * + * @return void + */ + public function checkSpacingAfterKeyword(File $phpcsFile, $stackPtr, $content) + { + $contentLC = \strtolower($content); + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + SpacesFixer::checkAndFix( + $phpcsFile, + $stackPtr, + $nextNonEmpty, + 1, // Expected spaces. + 'Expected %s after the "' . $contentLC . '" keyword. Found: %s', + 'SpaceAfter' . \ucfirst($contentLC), + 'error', + 0, // Severity. + \sprintf(self::METRIC_NAME_AFTER, $contentLC) + ); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php new file mode 100644 index 00000000..b9f87f24 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php @@ -0,0 +1,156 @@ + + */ + protected $keywords = [ + 'const' => true, + 'function' => true, + ]; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + return [\T_USE]; + } + + /** + * 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) + { + if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { + // Trait or closure use statement. + return; + } + + $tokens = $phpcsFile->getTokens(); + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + // Live coding or parse error. + return; + } + + if (isset($this->keywords[\strtolower($tokens[$nextNonEmpty]['content'])]) === true) { + // Keyword found at start of statement, applies to whole statement. + $this->processKeyword($phpcsFile, $nextNonEmpty, $tokens[$nextNonEmpty]['content']); + return; + } + + // This may still be a group use statement with function/const substatements. + $openGroup = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG, \T_OPEN_USE_GROUP], ($stackPtr + 1)); + if ($openGroup === false || $tokens[$openGroup]['code'] !== \T_OPEN_USE_GROUP) { + // Not a group use statement. + return; + } + + $closeGroup = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG, \T_CLOSE_USE_GROUP], ($openGroup + 1)); + if ($closeGroup === false || $tokens[$closeGroup]['code'] !== \T_CLOSE_USE_GROUP) { + // Live coding or parse error. + return; + } + + $current = $openGroup; + do { + $current = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), $closeGroup, true); + if ($current === false) { + return; + } + + if (isset($this->keywords[\strtolower($tokens[$current]['content'])]) === true) { + $this->processKeyword($phpcsFile, $current, $tokens[$current]['content']); + } + + // We're within the use group, so find the next comma. + $current = $phpcsFile->findNext(\T_COMMA, ($current + 1), $closeGroup); + } while ($current !== false); + } + + /** + * Processes a found keyword. + * + * @since 1.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the keyword in the token stack. + * @param string $content The keyword as found. + * + * @return void + */ + public function processKeyword(File $phpcsFile, $stackPtr, $content) + { + $contentLC = \strtolower($content); + $metricName = \sprintf(self::METRIC_NAME, $contentLC); + if ($contentLC === $content) { + // Already lowercase. Bow out. + $phpcsFile->recordMetric($stackPtr, $metricName, 'lowercase'); + return; + } + + if (\strtoupper($content) === $content) { + $phpcsFile->recordMetric($stackPtr, $metricName, 'uppercase'); + } else { + $phpcsFile->recordMetric($stackPtr, $metricName, 'mixed case'); + } + + $error = 'The "%s" keyword when used in an import use statements must be lowercase.'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotLowercase', [$contentLC]); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLC); + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php new file mode 100644 index 00000000..1fccc828 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php @@ -0,0 +1,170 @@ + + */ + public function register() + { + return [\T_USE]; + } + + /** + * 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) + { + if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { + // Trait or closure use statement. + return; + } + + $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG, \T_OPEN_USE_GROUP], ($stackPtr + 1)); + if ($endOfStatement === false) { + // Live coding or parse error. + return; + } + + $tokens = $phpcsFile->getTokens(); + $current = $stackPtr; + + do { + $continue = $this->processImport($phpcsFile, $current, $endOfStatement); + if ($continue === false) { + break; + } + + // Move the stackPtr forward to the next part of the use statement, if any. + $current = $phpcsFile->findNext(\T_COMMA, ($current + 1), $endOfStatement); + } while ($current !== false); + + if ($tokens[$endOfStatement]['code'] !== \T_OPEN_USE_GROUP) { + // Finished the statement. + return; + } + + $current = $endOfStatement; // Group open brace. + $endOfStatement = $phpcsFile->findNext([\T_CLOSE_USE_GROUP], ($endOfStatement + 1)); + if ($endOfStatement === false) { + // Live coding or parse error. + return; + } + + do { + $continue = $this->processImport($phpcsFile, $current, $endOfStatement, true); + if ($continue === false) { + break; + } + + // Move the stackPtr forward to the next part of the use statement, if any. + $current = $phpcsFile->findNext(\T_COMMA, ($current + 1), $endOfStatement); + } while ($current !== false); + } + + /** + * Examine an individual import statement. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token. + * @param int $endOfStatement End token for the current import statement. + * @param bool $groupUse Whether the current statement is a partial one + * within a group use statement. + * + * @return bool Whether or not to continue examining this import use statement. + */ + private function processImport(File $phpcsFile, $stackPtr, $endOfStatement, $groupUse = false) + { + $tokens = $phpcsFile->getTokens(); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), $endOfStatement, true); + if ($nextNonEmpty === false) { + // Reached the end of the statement. + return false; + } + + // Skip past 'function'/'const' keyword. + $contentLC = \strtolower($tokens[$nextNonEmpty]['content']); + if ($tokens[$nextNonEmpty]['code'] === \T_STRING + && ($contentLC === 'function' || $contentLC === 'const') + ) { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), $endOfStatement, true); + if ($nextNonEmpty === false) { + // Reached the end of the statement. + return false; + } + } + + if ($tokens[$nextNonEmpty]['code'] === \T_NS_SEPARATOR) { + $phpcsFile->recordMetric($nextNonEmpty, self::METRIC_NAME, 'yes'); + + $error = 'An import use statement should never start with a leading backslash'; + $code = 'LeadingBackslashFound'; + + if ($groupUse === true) { + $error = 'Parse error: partial import use statement in a use group starting with a leading backslash'; + $code = 'LeadingBackslashFoundInGroup'; + } + + $fix = $phpcsFile->addFixableError($error, $nextNonEmpty, $code); + + if ($fix === true) { + if ($tokens[$nextNonEmpty - 1]['code'] !== \T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($nextNonEmpty, ' '); + } else { + $phpcsFile->fixer->replaceToken($nextNonEmpty, ''); + } + } + } else { + $phpcsFile->recordMetric($nextNonEmpty, self::METRIC_NAME, 'no'); + } + + return true; + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php new file mode 100644 index 00000000..93de596c --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php @@ -0,0 +1,155 @@ + + */ + public function register() + { + return [\T_USE]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.1.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) + { + if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { + // Closure or trait use statement. Bow out. + return; + } + + $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); + if ($endOfStatement === false) { + // Parse error or live coding. + return; + } + + $hasAliases = $phpcsFile->findNext(\T_AS, ($stackPtr + 1), $endOfStatement); + if ($hasAliases === false) { + // This use import statement does not alias anything, bow out. + return; + } + + $useStatements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); + if (\count($useStatements, \COUNT_RECURSIVE) <= 3) { + // No statements found. Shouldn't be possible, but still. Bow out. + return; + } + + $tokens = $phpcsFile->getTokens(); + + // Collect all places where aliases are used in this use statement. + $aliasPtrs = []; + $currentAs = $hasAliases; + do { + $aliasPtr = $phpcsFile->findNext(Tokens::$emptyTokens, ($currentAs + 1), null, true); + if ($aliasPtr !== false && $tokens[$aliasPtr]['code'] === \T_STRING) { + $aliasPtrs[$currentAs] = $aliasPtr; + } + + $currentAs = $phpcsFile->findNext(\T_AS, ($currentAs + 1), $endOfStatement); + } while ($currentAs !== false); + + // Now check the names in each use statement for useless aliases. + foreach ($useStatements as $type => $statements) { + foreach ($statements as $alias => $fqName) { + $unqualifiedName = \ltrim(\substr($fqName, \strrpos($fqName, '\\')), '\\'); + + $uselessAlias = false; + if ($type === 'const') { + // Do a case-sensitive comparison for constants. + if ($unqualifiedName === $alias) { + $uselessAlias = true; + } + } elseif (NamingConventions::isEqual($unqualifiedName, $alias)) { + $uselessAlias = true; + } + + if ($uselessAlias === false) { + continue; + } + + // Now check if this is actually used as an alias or just the actual name. + foreach ($aliasPtrs as $asPtr => $aliasPtr) { + if ($tokens[$aliasPtr]['content'] !== $alias) { + continue; + } + + // Make sure this is really the right one. + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($asPtr - 1), null, true); + if ($tokens[$prev]['code'] !== \T_STRING + || $tokens[$prev]['content'] !== $unqualifiedName + ) { + continue; + } + + $error = 'Useless alias "%s" found for import of "%s"'; + $code = 'Found'; + $data = [$alias, $fqName]; + + // Okay, so this is the one which should be flagged. + $hasComments = $phpcsFile->findNext(Tokens::$commentTokens, ($prev + 1), $aliasPtr); + if ($hasComments !== false) { + // Don't auto-fix if there are comments. + $phpcsFile->addError($error, $aliasPtr, $code, $data); + break; + } + + $fix = $phpcsFile->addFixableError($error, $aliasPtr, $code, $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + for ($i = ($prev + 1); $i <= $aliasPtr; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + break; + } + } + } + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php new file mode 100644 index 00000000..31163165 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php @@ -0,0 +1,79 @@ + + */ + public function register() + { + return [\T_ANON_CLASS]; + } + + /** + * 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) + { + $tokens = $phpcsFile->getTokens(); + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { + // No parentheses, nothing to do. + return; + } + + SpacesFixer::checkAndFix( + $phpcsFile, + $stackPtr, + $nextNonEmpty, + (int) $this->spacing, + 'There must be %1$s between the class keyword and the open parenthesis for an anonymous class. Found: %2$s', + 'Incorrect', + 'error', + 0, + 'Anon class: space between keyword and open parenthesis' + ); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php new file mode 100644 index 00000000..376e9046 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php @@ -0,0 +1,408 @@ + + */ + public function register() + { + return [\T_COMMA]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.1.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) + { + if (isset($this->phpVersion) === false || \defined('PHP_CODESNIFFER_IN_TESTS')) { + // Set default value to prevent this code from running every time the sniff is triggered. + $this->phpVersion = 0; + + $phpVersion = Helper::getConfigData('php_version'); + if ($phpVersion !== null) { + $this->phpVersion = (int) $phpVersion; + } + } + + $this->processSpacingBefore($phpcsFile, $stackPtr); + $this->processSpacingAfter($phpcsFile, $stackPtr); + } + + /** + * Check the spacing before the comma. + * + * @since 1.1.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 + */ + protected function processSpacingBefore(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $prevNonWhitespace = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + if ($prevNonWhitespace !== $prevNonEmpty + && $tokens[$prevNonEmpty]['code'] !== \T_COMMA + && $tokens[$prevNonEmpty]['line'] !== $tokens[$nextNonEmpty]['line'] + ) { + // Special case: comma after a trailing comment - the comma should be moved to before the comment. + $fix = $phpcsFile->addFixableError( + 'Comma found after comment, expected the comma after the end of the code', + $stackPtr, + 'CommaAfterComment' + ); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($stackPtr, ''); + $phpcsFile->fixer->addContent($prevNonEmpty, ','); + + // Clean up potential trailing whitespace left behind, but don't remove blank lines. + $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[($stackPtr - 1)]['code'] === \T_WHITESPACE + && $tokens[($stackPtr - 1)]['line'] === $tokens[$stackPtr]['line'] + && $tokens[$stackPtr]['line'] !== $tokens[$nextNonWhitespace]['line'] + ) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); + } + + $phpcsFile->fixer->endChangeset(); + } + return; + } + + if ($tokens[$prevNonWhitespace]['code'] === \T_COMMA) { + // This must be a list assignment with ignored items. Ignore. + return; + } + + if (isset(Tokens::$blockOpeners[$tokens[$prevNonWhitespace]['code']]) === true + || $tokens[$prevNonWhitespace]['code'] === \T_OPEN_SHORT_ARRAY + || $tokens[$prevNonWhitespace]['code'] === \T_OPEN_USE_GROUP + ) { + // Should only realistically be possible for lists. Leave for a block brace spacing sniff to sort out. + return; + } + + $expectedSpaces = 0; + + if ($tokens[$prevNonEmpty]['code'] === \T_END_HEREDOC + || $tokens[$prevNonEmpty]['code'] === \T_END_NOWDOC + ) { + /* + * If php_version is explicitly set to PHP < 7.3, enforce a new line between the closer and the comma. + * + * If php_version is *not* explicitly set, let the indent be leading and only enforce + * a new line between the closer and the comma when this is an old-style heredoc/nowdoc. + */ + if ($this->phpVersion !== 0 && $this->phpVersion < 70300) { + $expectedSpaces = 'newline'; + } + + if ($this->phpVersion === 0 + && \ltrim($tokens[$prevNonEmpty]['content']) === $tokens[$prevNonEmpty]['content'] + ) { + $expectedSpaces = 'newline'; + } + } + + $error = 'Expected %1$s between "' . $this->escapePlaceholders($tokens[$prevNonWhitespace]['content']) + . '" and the comma. Found: %2$s'; + $codeSuffix = $this->getSuffix($phpcsFile, $stackPtr); + $metricSuffix = $this->codeSuffixToMetric($codeSuffix); + + SpacesFixer::checkAndFix( + $phpcsFile, + $stackPtr, + $prevNonWhitespace, + $expectedSpaces, + $error, + 'SpaceBefore' . $codeSuffix, + 'error', + 0, + self::METRIC_NAME_BEFORE . $metricSuffix + ); + } + + /** + * Check the spacing after the comma. + * + * @since 1.1.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 + */ + protected function processSpacingAfter(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($stackPtr + 1), null, true); + if ($nextNonWhitespace === false) { + // Live coding/parse error. Ignore. + return; + } + + if ($tokens[$nextNonWhitespace]['code'] === \T_COMMA) { + // This must be a list assignment with ignored items. Ignore. + return; + } + + if ($tokens[$nextNonWhitespace]['code'] === \T_CLOSE_CURLY_BRACKET + || $tokens[$nextNonWhitespace]['code'] === \T_CLOSE_SQUARE_BRACKET + || $tokens[$nextNonWhitespace]['code'] === \T_CLOSE_PARENTHESIS + || $tokens[$nextNonWhitespace]['code'] === \T_CLOSE_SHORT_ARRAY + || $tokens[$nextNonWhitespace]['code'] === \T_CLOSE_USE_GROUP + ) { + // Ignore. Leave for a block spacing sniff to sort out. + return; + } + + $nextToken = $tokens[($stackPtr + 1)]; + + $error = 'Expected %1$s between the comma and "' + . $this->escapePlaceholders($tokens[$nextNonWhitespace]['content']) . '". Found: %2$s'; + + $codeSuffix = $this->getSuffix($phpcsFile, $stackPtr); + $metricSuffix = $this->codeSuffixToMetric($codeSuffix); + + if ($nextToken['code'] === \T_WHITESPACE) { + if ($nextToken['content'] === ' ') { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_AFTER . $metricSuffix, '1 space'); + return; + } + + // Note: this check allows for trailing whitespace between the comma and a new line char. + // The trailing whitespace is not the concern of this sniff. + if (\ltrim($nextToken['content'], ' ') === $phpcsFile->eolChar) { + $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_AFTER . $metricSuffix, 'a new line'); + return; + } + + $errorCode = 'TooMuchSpaceAfter' . $codeSuffix; + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if (isset(Tokens::$commentTokens[$tokens[$nextNonWhitespace]['code']]) === true + && ($nextNonEmpty === false || $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) + ) { + // Separate error code to allow for aligning trailing comments. + $errorCode = 'TooMuchSpaceAfterCommaBeforeTrailingComment'; + } + + SpacesFixer::checkAndFix( + $phpcsFile, + $stackPtr, + $nextNonWhitespace, + 1, + $error, + $errorCode, + 'error', + 0, + self::METRIC_NAME_AFTER . $metricSuffix + ); + return; + } + + SpacesFixer::checkAndFix( + $phpcsFile, + $stackPtr, + $nextNonWhitespace, + 1, + $error, + 'NoSpaceAfter' . $codeSuffix, + 'error', + 0, + self::METRIC_NAME_AFTER . $metricSuffix + ); + } + + /** + * Escape arbitrary token content for *printf() placeholders. + * + * @since 1.1.0 + * + * @param string $text Arbitrary text string. + * + * @return string + */ + private function escapePlaceholders($text) + { + return \preg_replace('`(?:^|[^%])(%)(?:[^%]|$)`', '%%', \trim($text)); + } + + /** + * Retrieve a text string for use as a suffix to an error code. + * + * This allows for modular error codes, which in turn allow for selectively excluding + * error codes. + * + * {@internal Closure use will be parentheses owner in PHPCS 4.x, this code will + * need an update for that in due time.} + * + * @since 1.1.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 string + */ + private function getSuffix($phpcsFile, $stackPtr) + { + $opener = Parentheses::getLastOpener($phpcsFile, $stackPtr); + if ($opener === false) { + return ''; + } + + $tokens = $phpcsFile->getTokens(); + + $owner = Parentheses::getOwner($phpcsFile, $opener); + if ($owner !== false) { + switch ($tokens[$owner]['code']) { + case \T_FUNCTION: + case \T_CLOSURE: + case \T_FN: + return 'InFunctionDeclaration'; + + case \T_DECLARE: + return 'InDeclare'; + + case \T_ANON_CLASS: + case \T_ISSET: + case \T_UNSET: + return 'InFunctionCall'; + + // Long array, long list, isset, unset, empty, exit, eval, control structures. + default: + return ''; + } + } + + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), null, true); + + if (isset(Collections::nameTokens()[$tokens[$prevNonEmpty]['code']]) === true) { + return 'InFunctionCall'; + } + + switch ($tokens[$prevNonEmpty]['code']) { + case \T_USE: + return 'InClosureUse'; + + case \T_VARIABLE: + case \T_SELF: + case \T_STATIC: + case \T_PARENT: + return 'InFunctionCall'; + + default: + return ''; + } + } + + /** + * Transform a suffix for an error code into a suffix for a metric. + * + * @since 1.1.0 + * + * @param string $suffix Error code suffix. + * + * @return string + */ + private function codeSuffixToMetric($suffix) + { + return \strtolower(\preg_replace('`([A-Z])`', ' $1', $suffix)); + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php new file mode 100644 index 00000000..817a44e1 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php @@ -0,0 +1,173 @@ + + * + *
    + * + * The PHPCS native `Generic.Whitespace.DisallowTabIndent` sniff oversteps its reach and silently + * does mid-line tab to space replacements as well. + * However, the sister-sniff `Generic.Whitespace.DisallowSpaceIndent` leaves mid-line tabs/spaces alone. + * This sniff fills that gap. + * + * @since 1.0.0 + */ +final class DisallowInlineTabsSniff implements Sniff +{ + + /** + * The --tab-width CLI value that is being used. + * + * @since 1.0.0 + * + * @var int + */ + private $tabWidth; + + /** + * Tokens to check for mid-line tabs. + * + * @since 1.0.0 + * + * @var array + */ + private $find = [ + \T_WHITESPACE => true, + \T_DOC_COMMENT_WHITESPACE => true, + \T_DOC_COMMENT_STRING => true, + \T_COMMENT => true, + ]; + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + return Collections::phpOpenTags(); + } + + /** + * 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 int Integer stack pointer to skip the rest of the file. + */ + public function process(File $phpcsFile, $stackPtr) + { + if (isset($this->tabWidth) === false) { + $this->tabWidth = (int) Helper::getTabWidth($phpcsFile); + } + + if (\defined('PHP_CODESNIFFER_IN_TESTS')) { + $this->tabWidth = (int) Helper::getCommandLineData($phpcsFile, 'tabWidth'); + } + + $tokens = $phpcsFile->getTokens(); + $dummy = new DummyTokenizer('', $phpcsFile->config); + + for ($i = 0; $i < $phpcsFile->numTokens; $i++) { + // Skip all non-whitespace tokens and skip whitespace at the start of a new line. + if (isset($this->find[$tokens[$i]['code']]) === false + || (($tokens[$i]['code'] === \T_WHITESPACE + || $tokens[$i]['code'] === \T_DOC_COMMENT_WHITESPACE) + && $tokens[$i]['column'] === 1) + ) { + continue; + } + + // If tabs haven't been converted to spaces by the tokenizer, do so now. + $token = $tokens[$i]; + if (isset($token['orig_content']) === false) { + if ($token['content'] === '' || \strpos($token['content'], "\t") === false) { + // If there are no tabs, we can continue, no matter what. + continue; + } + + $dummy->replaceTabsInToken($token); + } + + /* + * Tokens only have the 'orig_content' key if they contain tabs, + * so from here on out, we **know** there will be tabs in the content. + */ + $origContent = $token['orig_content']; + $commentOnly = ''; + + $multiLineComment = false; + if (($tokens[$i]['code'] === \T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']])) + && $tokens[$i]['column'] === 1 + && ($tokens[($i - 1)]['code'] === \T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[($i - 1)]['code']])) + ) { + $multiLineComment = true; + } + + if ($multiLineComment === true) { + // This is the subsequent line of a multi-line comment. Account for indentation. + $commentOnly = \ltrim($origContent); + if ($commentOnly === '' || \strpos($commentOnly, "\t") === false) { + continue; + } + } + + $fix = $phpcsFile->addFixableError( + 'Spaces must be used for mid-line alignment; tabs are not allowed', + $i, + 'NonIndentTabsUsed' + ); + + if ($fix === false) { + continue; + } + + $indent = ''; + if ($multiLineComment === true) { + // Take the original indent (tabs/spaces) and combine with the tab-replaced comment content. + $indent = \str_replace($commentOnly, '', $origContent); + $token['content'] = \ltrim($token['content']); + } + + $phpcsFile->fixer->replaceToken($i, $indent . $token['content']); + } + + // Scanned the whole file in one go. Don't scan this file again. + return $phpcsFile->numTokens; + } +} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php new file mode 100644 index 00000000..af689684 --- /dev/null +++ b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php @@ -0,0 +1,445 @@ + + * + * + * + * + * + * + * + * + * + * ``` + * + * @since 1.0.0 + * + * @var string[] + */ + public $ignoreAlignmentBefore = []; + + /** + * Whether or not potential trailing whitespace on otherwise blank lines should be examined or ignored. + * + * Defaults to `true`, i.e. ignore blank lines. + * + * It is recommended to only set this to `false` if the standard including this sniff does not + * include the `Squiz.WhiteSpace.SuperfluousWhitespace` sniff (which is included in most standards). + * + * @since 1.0.0 + * + * @var bool + */ + public $ignoreBlankLines = true; + + /** + * The --tab-width CLI value that is being used. + * + * @since 1.0.0 + * + * @var int + */ + private $tabWidth; + + /** + * Whitespace tokens and tokens which can contain leading whitespace. + * + * A few additional tokens will be added to this list in the register() method. + * + * @since 1.0.0 + * + * @var array + */ + private $tokensToCheck = [ + \T_WHITESPACE => \T_WHITESPACE, + \T_INLINE_HTML => \T_INLINE_HTML, + \T_DOC_COMMENT_WHITESPACE => \T_DOC_COMMENT_WHITESPACE, + \T_COMMENT => \T_COMMENT, + \T_END_HEREDOC => \T_END_HEREDOC, + \T_END_NOWDOC => \T_END_NOWDOC, + ]; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.0.0 + * + * @return array + */ + public function register() + { + // Add the ignore annotation tokens to the list of tokens to check. + $this->tokensToCheck += Tokens::$phpcsCommentTokens; + + return Collections::phpOpenTags(); + } + + /** + * 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 int Integer stack pointer to skip the rest of the file. + */ + public function process(File $phpcsFile, $stackPtr) + { + /* + * Handle the properties. + */ + if (isset($this->tabWidth) === false || \defined('PHP_CODESNIFFER_IN_TESTS') === true) { + $this->tabWidth = Helper::getTabWidth($phpcsFile); + } + + if (isset($this->indent) === true) { + $indent = (int) $this->indent; + } else { + $indent = $this->tabWidth; + } + + $ignoreTokens = (array) $this->ignoreAlignmentBefore; + if (empty($ignoreTokens) === false) { + $ignoreTokens = \array_flip($ignoreTokens); + } + + /* + * Check the whole file in one go. + */ + $tokens = $phpcsFile->getTokens(); + + for ($i = 0; $i < $phpcsFile->numTokens; $i++) { + if ($tokens[$i]['column'] !== 1) { + // Only interested in the first token on each line. + continue; + } + + if (isset($this->tokensToCheck[$tokens[$i]['code']]) === false) { + // Not one of the target tokens. + continue; + } + + if ($tokens[$i]['content'] === $phpcsFile->eolChar) { + // Skip completely blank lines. + continue; + } + + if (isset($ignoreTokens[$tokens[$i]['type']]) === true + || (isset($tokens[($i + 1)]) && isset($ignoreTokens[$tokens[($i + 1)]['type']])) + ) { + // This is one of the tokens being ignored. + continue; + } + + $origContent = null; + if (isset($tokens[$i]['orig_content']) === true) { + $origContent = $tokens[$i]['orig_content']; + } + + $spaces = 0; + $length = 0; + $content = ''; + $closer = ''; + + switch ($tokens[$i]['code']) { + case \T_WHITESPACE: + if ($this->ignoreBlankLines === true + && isset($tokens[($i + 1)]) + && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] + ) { + // Skip blank lines which only contain trailing whitespace. + continue 2; + } + + $spaces = ($tokens[$i]['length'] % $indent); + break; + + case \T_DOC_COMMENT_WHITESPACE: + /* + * Blank lines with trailing whitespace in docblocks are tokenized as + * two T_DOC_COMMENT_WHITESPACE tokens: one for the trailing whitespace, + * one for the new line character. + */ + if ($this->ignoreBlankLines === true + && isset($tokens[($i + 1)]) + && $tokens[($i + 1)]['content'] === $phpcsFile->eolChar + && isset($tokens[($i + 2)]) + && $tokens[$i]['line'] !== $tokens[($i + 2)]['line'] + ) { + // Skip blank lines which only contain trailing whitespace. + continue 2; + } + + $spaces = ($tokens[$i]['length'] % $indent); + + if (isset($tokens[($i + 1)]) === true + && ($tokens[($i + 1)]['code'] === \T_DOC_COMMENT_STAR + || $tokens[($i + 1)]['code'] === \T_DOC_COMMENT_CLOSE_TAG) + && $spaces !== 0 + ) { + // One alignment space expected before the *. + --$spaces; + } + break; + + case \T_COMMENT: + case \T_INLINE_HTML: + if ($this->ignoreBlankLines === true + && \trim($tokens[$i]['content']) === '' + && isset($tokens[($i + 1)]) + && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] + ) { + // Skip blank lines which only contain trailing whitespace. + continue 2; + } + + // Deliberate fall-through. + + case \T_PHPCS_ENABLE: + case \T_PHPCS_DISABLE: + case \T_PHPCS_SET: + case \T_PHPCS_IGNORE: + case \T_PHPCS_IGNORE_FILE: + /* + * Indentation is included in the contents of the token for: + * - inline HTML + * - PHP 7.3+ flexible heredoc/nowdoc closer identifiers (see below); + * - subsequent lines of multi-line comments; + * - PHPCS native annotations when part of a multi-line comment. + */ + $content = \ltrim($tokens[$i]['content']); + $whitespace = \str_replace($content, '', $tokens[$i]['content']); + + /* + * If there is no content, this is a blank line in a comment or in inline HTML. + * In that case, use the predetermined length as otherwise the new line character + * at the end of the whitespace will throw the count off. + */ + $length = ($content === '') ? $tokens[$i]['length'] : \strlen($whitespace); + $spaces = ($length % $indent); + + /* + * For multi-line star-comments, which use (aligned) stars on subsequent + * lines, we don't want to trigger on the one extra space before the star. + * + * While not 100% correct, don't exclude inline HTML from this check as + * otherwise the sniff would trigger on multi-line /*-style inline javascript comments. + * This may cause false negatives as there is no check for being in a + * tags. This is the most portable way to include PHP code on differing operating systems and setups. + ]]> + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml new file mode 100644 index 00000000..519d7f5c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml new file mode 100644 index 00000000..8086ea27 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml @@ -0,0 +1,7 @@ + + + to delimit PHP code, not the shorthand. This is the most portable way to include PHP code on differing operating systems and setups. + ]]> + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml new file mode 100644 index 00000000..83bceef4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml new file mode 100644 index 00000000..c0f18b55 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml @@ -0,0 +1,19 @@ + + + + + + + count($bar); + ]]> + + + sizeof($bar); + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml new file mode 100644 index 00000000..7dc30c10 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml @@ -0,0 +1,23 @@ + + + true, false and null constants must always be lowercase. + ]]> + + + + false || $var === null) { + $var = true; +} + ]]> + + + FALSE || $var === NULL) { + $var = TRUE; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml new file mode 100644 index 00000000..965742d9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml @@ -0,0 +1,19 @@ + + + + + + + array(); + ]]> + + + Array(); + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml new file mode 100644 index 00000000..f38df3af --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml @@ -0,0 +1,38 @@ + + + + + + + + + + Int $foo) : STRING { +} + ]]> + + + + + + + + + + + (BOOL) $isValid; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml new file mode 100644 index 00000000..df698879 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml @@ -0,0 +1,23 @@ + + + + + + + isset($foo) && $foo) { + echo "Hello\n"; +} + ]]> + + + @$foo) { + echo "Hello\n"; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/RequireStrictTypesStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/RequireStrictTypesStandard.xml new file mode 100644 index 00000000..701cb484 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/RequireStrictTypesStandard.xml @@ -0,0 +1,38 @@ + + + + + + + strict_types=1); + +declare(encoding='UTF-8', strict_types=0); + ]]> + + + ); + ]]> + + + + + + + + 1); + ]]> + + + 0); + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml new file mode 100644 index 00000000..e74005ad --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml @@ -0,0 +1,23 @@ + + + + + + + PHP_SAPI === 'cli') { + echo "Hello, CLI user."; +} + ]]> + + + php_sapi_name() === 'cli') { + echo "Hello, CLI user."; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SyntaxStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SyntaxStandard.xml new file mode 100644 index 00000000..1c2457df --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SyntaxStandard.xml @@ -0,0 +1,21 @@ + + + + + + + echo "Hello!"; +$array = [1, 2, 3]; + ]]> + + + // Missing semicolon. +$array = [1, 2, 3; // Missing closing bracket. + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml new file mode 100644 index 00000000..1f337f77 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml @@ -0,0 +1,23 @@ + + + true, false and null constants must always be uppercase. + ]]> + + + + FALSE || $var === NULL) { + $var = TRUE; +} + ]]> + + + false || $var === null) { + $var = true; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml new file mode 100644 index 00000000..a4c9887b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml new file mode 100644 index 00000000..f4f3e19c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml new file mode 100644 index 00000000..338c8389 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml new file mode 100644 index 00000000..2e399b34 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml new file mode 100644 index 00000000..7013ffd9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/IncrementDecrementSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/IncrementDecrementSpacingStandard.xml new file mode 100644 index 00000000..92532fc6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/IncrementDecrementSpacingStandard.xml @@ -0,0 +1,26 @@ + + + + + + + $i; +--$i['key']['id']; +ClassName::$prop++; +$obj->prop--; + ]]> + + + $i; +-- $i['key']['id']; +ClassName::$prop ++; +$obj->prop +--; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml new file mode 100644 index 00000000..a9cd5a65 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml @@ -0,0 +1,44 @@ + + + + + + + 'Hello, World!'; +throw new Exception(); +return $newLine; + ]]> + + + 'Hello, World!'; +throw new Exception(); +return +$newLine; + ]]> + + + + + + + + from [1, 2, 3]; + ]]> + + + from [1, 2, 3]; +yield from [1, 2, 3]; +yield +from [1, 2, 3]; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml new file mode 100644 index 00000000..bdd36d49 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml @@ -0,0 +1,23 @@ + + + + + + + $var = 1; +} + ]]> + + + $var = 1; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml new file mode 100644 index 00000000..d33b6051 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml @@ -0,0 +1,34 @@ + + + + + + + &...$spread) { + bar(...$spread); + + bar( + [...$foo], + ...array_values($keyedArray) + ); +} + ]]> + + + ... $spread) { + bar(... + $spread + ); + + bar( + [... $foo ],.../*comment*/array_values($keyedArray) + ); +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php new file mode 100644 index 00000000..b6e3d37d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php @@ -0,0 +1,193 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; + +use PHP_CodeSniffer\Sniffs\AbstractArraySniff; +use PHP_CodeSniffer\Util\Tokens; + +class ArrayIndentSniff extends AbstractArraySniff +{ + + /** + * The number of spaces each array key should be indented. + * + * @var integer + */ + public $indent = 4; + + + /** + * Processes a single-line array definition. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $arrayStart The token that starts the array definition. + * @param int $arrayEnd The token that ends the array definition. + * @param array $indices An array of token positions for the array keys, + * double arrows, and values. + * + * @return void + */ + public function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices) + { + + }//end processSingleLineArray() + + + /** + * Processes a multi-line array definition. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $arrayStart The token that starts the array definition. + * @param int $arrayEnd The token that ends the array definition. + * @param array $indices An array of token positions for the array keys, + * double arrows, and values. + * + * @return void + */ + public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices) + { + $tokens = $phpcsFile->getTokens(); + + // Determine how far indented the entire array declaration should be. + $ignore = Tokens::$emptyTokens; + $ignore[] = T_DOUBLE_ARROW; + $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); + $start = $phpcsFile->findStartOfStatement($prev); + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $start, true); + $baseIndent = ($tokens[$first]['column'] - 1); + + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); + $startIndent = ($tokens[$first]['column'] - 1); + + // If the open brace is not indented to at least to the level of the start + // of the statement, the sniff will conflict with other sniffs trying to + // check indent levels because it's not valid. But we don't enforce exactly + // how far indented it should be. + if ($startIndent < $baseIndent) { + $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); + if ($fix === true) { + $padding = str_repeat(' ', $baseIndent); + if ($startIndent === 0) { + $phpcsFile->fixer->addContentBefore($first, $padding); + } else { + $phpcsFile->fixer->replaceToken(($first - 1), $padding); + } + } + + return; + }//end if + + $expectedIndent = ($startIndent + $this->indent); + + foreach ($indices as $index) { + if (isset($index['index_start']) === true) { + $start = $index['index_start']; + } else { + $start = $index['value_start']; + } + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($start - 1), null, true); + if ($tokens[$prev]['line'] === $tokens[$start]['line']) { + // This index isn't the only content on the line + // so we can't check indent rules. + continue; + } + + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $start, true); + + $foundIndent = ($tokens[$first]['column'] - 1); + if ($foundIndent === $expectedIndent) { + continue; + } + + $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); + if ($fix === false) { + continue; + } + + $padding = str_repeat(' ', $expectedIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($first, $padding); + } else { + $phpcsFile->fixer->replaceToken(($first - 1), $padding); + } + }//end foreach + + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($arrayEnd - 1), null, true); + if ($tokens[$prev]['line'] === $tokens[$arrayEnd]['line']) { + $error = 'Closing brace of array declaration must be on a new line'; + $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNotNewLine'); + if ($fix === true) { + $padding = $phpcsFile->eolChar.str_repeat(' ', $startIndent); + $phpcsFile->fixer->addContentBefore($arrayEnd, $padding); + } + + return; + } + + // The close brace must be indented one stop less. + $foundIndent = ($tokens[$arrayEnd]['column'] - 1); + if ($foundIndent === $startIndent) { + return; + } + + $pluralizeSpace = 's'; + if ($startIndent === 1) { + $pluralizeSpace = ''; + } + + $error = 'Array close brace not indented correctly; expected %s space%s but found %s'; + $data = [ + $startIndent, + $pluralizeSpace, + $foundIndent, + ]; + $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceIncorrect', $data); + if ($fix === false) { + return; + } + + $padding = str_repeat(' ', $startIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($arrayEnd, $padding); + } else { + $phpcsFile->fixer->replaceToken(($arrayEnd - 1), $padding); + } + + }//end processMultiLineArray() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php new file mode 100644 index 00000000..6854945a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php @@ -0,0 +1,72 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DisallowLongArraySyntaxSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_ARRAY]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'no'); + + $error = 'Short array syntax must be used to define arrays'; + + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { + // Live coding/parse error, just show the error, don't try and fix it. + $phpcsFile->addError($error, $stackPtr, 'Found'); + return; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); + + if ($fix === true) { + $opener = $tokens[$stackPtr]['parenthesis_opener']; + $closer = $tokens[$stackPtr]['parenthesis_closer']; + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($stackPtr, ''); + $phpcsFile->fixer->replaceToken($opener, '['); + $phpcsFile->fixer->replaceToken($closer, ']'); + + $phpcsFile->fixer->endChangeset(); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php new file mode 100644 index 00000000..f9827711 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php @@ -0,0 +1,61 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DisallowShortArraySyntaxSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_SHORT_ARRAY]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'yes'); + + $error = 'Short array syntax is not allowed'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); + + if ($fix === true) { + $tokens = $phpcsFile->getTokens(); + $opener = $tokens[$stackPtr]['bracket_opener']; + $closer = $tokens[$stackPtr]['bracket_closer']; + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($opener, 'array('); + $phpcsFile->fixer->replaceToken($closer, ')'); + $phpcsFile->fixer->endChangeset(); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php new file mode 100644 index 00000000..19ff1edf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php @@ -0,0 +1,118 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DuplicateClassNameSniff implements Sniff +{ + + /** + * List of classes that have been found during checking. + * + * @var array + */ + protected $foundClasses = []; + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $namespace = ''; + $findTokens = [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + T_NAMESPACE, + T_CLOSE_TAG, + ]; + + $stackPtr = $phpcsFile->findNext($findTokens, ($stackPtr + 1)); + while ($stackPtr !== false) { + if ($tokens[$stackPtr]['code'] === T_CLOSE_TAG) { + // We can stop here. The sniff will continue from the next open + // tag when PHPCS reaches that token, if there is one. + return; + } + + // Keep track of what namespace we are in. + if ($tokens[$stackPtr]['code'] === T_NAMESPACE) { + $nsEnd = $phpcsFile->findNext( + [ + T_NS_SEPARATOR, + T_STRING, + T_WHITESPACE, + ], + ($stackPtr + 1), + null, + true + ); + + $namespace = trim($phpcsFile->getTokensAsString(($stackPtr + 1), ($nsEnd - $stackPtr - 1))); + $stackPtr = $nsEnd; + } else { + $nameToken = $phpcsFile->findNext(T_STRING, $stackPtr); + $name = $tokens[$nameToken]['content']; + if ($namespace !== '') { + $name = $namespace.'\\'.$name; + } + + $compareName = strtolower($name); + if (isset($this->foundClasses[$compareName]) === true) { + $type = strtolower($tokens[$stackPtr]['content']); + $file = $this->foundClasses[$compareName]['file']; + $line = $this->foundClasses[$compareName]['line']; + $error = 'Duplicate %s name "%s" found; first defined in %s on line %s'; + $data = [ + $type, + $name, + $file, + $line, + ]; + $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); + } else { + $this->foundClasses[$compareName] = [ + 'file' => $phpcsFile->getFilename(), + 'line' => $tokens[$stackPtr]['line'], + ]; + } + }//end if + + $stackPtr = $phpcsFile->findNext($findTokens, ($stackPtr + 1)); + }//end while + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php new file mode 100644 index 00000000..40291ea4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php @@ -0,0 +1,124 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class OpeningBraceSameLineSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $scopeIdentifier = $phpcsFile->findNext(T_STRING, ($stackPtr + 1)); + $errorData = [strtolower($tokens[$stackPtr]['content']).' '.$tokens[$scopeIdentifier]['content']]; + + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + $error = 'Possible parse error: %s missing opening or closing brace'; + $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $errorData); + return; + } + + $openingBrace = $tokens[$stackPtr]['scope_opener']; + + // Is the brace on the same line as the class/interface/trait declaration ? + $lastClassLineToken = $phpcsFile->findPrevious(T_WHITESPACE, ($openingBrace - 1), $stackPtr, true); + $lastClassLine = $tokens[$lastClassLineToken]['line']; + $braceLine = $tokens[$openingBrace]['line']; + $lineDifference = ($braceLine - $lastClassLine); + + if ($lineDifference > 0) { + $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'new line'); + $error = 'Opening brace should be on the same line as the declaration for %s'; + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnNewLine', $errorData); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($lastClassLineToken, ' {'); + $phpcsFile->fixer->replaceToken($openingBrace, ''); + $phpcsFile->fixer->endChangeset(); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'same line'); + } + + // Is the opening brace the last thing on the line ? + $next = $phpcsFile->findNext(T_WHITESPACE, ($openingBrace + 1), null, true); + if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { + if ($next === $tokens[$stackPtr]['scope_closer']) { + // Ignore empty classes. + 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 continue checking if the opening brace looks good. + if ($lineDifference > 0) { + return; + } + + // Is there precisely one space before the opening brace ? + if ($tokens[($openingBrace - 1)]['code'] !== T_WHITESPACE) { + $length = 0; + } else if ($tokens[($openingBrace - 1)]['content'] === "\t") { + $length = '\t'; + } else { + $length = $tokens[($openingBrace - 1)]['length']; + } + + if ($length !== 1) { + $error = 'Expected 1 space before opening brace; found %s'; + $data = [$length]; + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'SpaceBeforeBrace', $data); + if ($fix === true) { + if ($length === 0 || $length === '\t') { + $phpcsFile->fixer->addContentBefore($openingBrace, ' '); + } else { + $phpcsFile->fixer->replaceToken(($openingBrace - 1), ' '); + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php new file mode 100644 index 00000000..fecd16a7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php @@ -0,0 +1,171 @@ + + * @copyright 2017 Juliette Reinders Folmer. All rights reserved. + * @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 AssignmentInConditionSniff implements Sniff +{ + + /** + * Assignment tokens to trigger on. + * + * Set in the register() method. + * + * @var array + */ + protected $assignmentTokens = []; + + /** + * The tokens that indicate the start of a condition. + * + * @var array + */ + protected $conditionStartTokens = []; + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + $this->assignmentTokens = Tokens::$assignmentTokens; + unset($this->assignmentTokens[T_DOUBLE_ARROW]); + + $starters = Tokens::$booleanOperators; + $starters[T_SEMICOLON] = T_SEMICOLON; + $starters[T_OPEN_PARENTHESIS] = T_OPEN_PARENTHESIS; + + $this->conditionStartTokens = $starters; + + return [ + T_IF, + T_ELSEIF, + T_FOR, + T_SWITCH, + T_CASE, + T_WHILE, + T_MATCH, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $token = $tokens[$stackPtr]; + + // Find the condition opener/closer. + if ($token['code'] === T_FOR) { + if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { + return; + } + + $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($token['parenthesis_opener'] + 1), ($token['parenthesis_closer'])); + if ($semicolon === false) { + return; + } + + $opener = $semicolon; + + $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($opener + 1), ($token['parenthesis_closer'])); + if ($semicolon === false) { + return; + } + + $closer = $semicolon; + unset($semicolon); + } else if ($token['code'] === T_CASE) { + if (isset($token['scope_opener']) === false) { + return; + } + + $opener = $stackPtr; + $closer = $token['scope_opener']; + } else { + if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { + return; + } + + $opener = $token['parenthesis_opener']; + $closer = $token['parenthesis_closer']; + }//end if + + $startPos = $opener; + + do { + $hasAssignment = $phpcsFile->findNext($this->assignmentTokens, ($startPos + 1), $closer); + if ($hasAssignment === false) { + return; + } + + // Examine whether the left side is a variable. + $hasVariable = false; + $conditionStart = $startPos; + $altConditionStart = $phpcsFile->findPrevious($this->conditionStartTokens, ($hasAssignment - 1), $startPos); + if ($altConditionStart !== false) { + $conditionStart = $altConditionStart; + } + + for ($i = $hasAssignment; $i > $conditionStart; $i--) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { + continue; + } + + // If this is a variable or array, we've seen all we need to see. + if ($tokens[$i]['code'] === T_VARIABLE || $tokens[$i]['code'] === T_CLOSE_SQUARE_BRACKET) { + $hasVariable = true; + break; + } + + // If this is a function call or something, we are OK. + if ($tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { + break; + } + } + + if ($hasVariable === true) { + $errorCode = 'Found'; + if ($token['code'] === T_WHILE) { + $errorCode = 'FoundInWhileCondition'; + } + + $phpcsFile->addWarning( + 'Variable assignment found within a condition. Did you mean to do a comparison ?', + $hasAssignment, + $errorCode + ); + } + + $startPos = $hasAssignment; + } while ($startPos < $closer); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php new file mode 100644 index 00000000..4ecf6303 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php @@ -0,0 +1,162 @@ + + * @copyright 2017 Juliette Reinders Folmer. All rights reserved. + * @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 EmptyPHPStatementSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_SEMICOLON, + T_CLOSE_TAG, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + switch ($tokens[$stackPtr]['type']) { + // Detect `something();;`. + case 'T_SEMICOLON': + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + if ($prevNonEmpty === false) { + return; + } + + if ($tokens[$prevNonEmpty]['code'] !== T_SEMICOLON + && $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG + && $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG_WITH_ECHO + ) { + if (isset($tokens[$prevNonEmpty]['scope_condition']) === false) { + return; + } + + if ($tokens[$prevNonEmpty]['scope_opener'] !== $prevNonEmpty + && $tokens[$prevNonEmpty]['code'] !== T_CLOSE_CURLY_BRACKET + ) { + return; + } + + $scopeOwner = $tokens[$tokens[$prevNonEmpty]['scope_condition']]['code']; + if ($scopeOwner === T_CLOSURE || $scopeOwner === T_ANON_CLASS || $scopeOwner === T_MATCH) { + return; + } + + // Else, it's something like `if (foo) {};` and the semicolon is not needed. + } + + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $nested = $tokens[$stackPtr]['nested_parenthesis']; + $lastCloser = array_pop($nested); + if (isset($tokens[$lastCloser]['parenthesis_owner']) === true + && $tokens[$tokens[$lastCloser]['parenthesis_owner']]['code'] === T_FOR + ) { + // Empty for() condition. + return; + } + } + + $fix = $phpcsFile->addFixableWarning( + 'Empty PHP statement detected: superfluous semicolon.', + $stackPtr, + 'SemicolonWithoutCodeDetected' + ); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[$prevNonEmpty]['code'] === T_OPEN_TAG + || $tokens[$prevNonEmpty]['code'] === T_OPEN_TAG_WITH_ECHO + ) { + // Check for superfluous whitespace after the semicolon which will be + // removed as the `fixer->replaceToken(($stackPtr + 1), $replacement); + } + } + + for ($i = $stackPtr; $i > $prevNonEmpty; $i--) { + if ($tokens[$i]['code'] !== T_SEMICOLON + && $tokens[$i]['code'] !== T_WHITESPACE + ) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + break; + + // Detect ``. + case 'T_CLOSE_TAG': + $prevNonEmpty = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + + if ($prevNonEmpty === false + || ($tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG + && $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG_WITH_ECHO) + ) { + return; + } + + $fix = $phpcsFile->addFixableWarning( + 'Empty PHP open/close tag combination detected.', + $prevNonEmpty, + 'EmptyPHPOpenCloseTagsDetected' + ); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + for ($i = $prevNonEmpty; $i <= $stackPtr; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + break; + + default: + // Deliberately left empty. + break; + }//end switch + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php new file mode 100644 index 00000000..ded042a9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php @@ -0,0 +1,97 @@ + + * stmt { + * // foo + * } + * stmt (conditions) { + * // foo + * } + * + * + * @author Manuel Pichler + * @author Greg Sherwood + * @copyright 2007-2014 Manuel Pichler. All rights reserved. + * @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 EmptyStatementSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_TRY, + T_CATCH, + T_FINALLY, + T_DO, + T_ELSE, + T_ELSEIF, + T_FOR, + T_FOREACH, + T_IF, + T_SWITCH, + T_WHILE, + T_MATCH, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $token = $tokens[$stackPtr]; + + // Skip statements without a body. + if (isset($token['scope_opener']) === false) { + return; + } + + $next = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($token['scope_opener'] + 1), + ($token['scope_closer'] - 1), + true + ); + + if ($next !== false) { + return; + } + + // Get token identifier. + $name = strtoupper($token['content']); + $error = 'Empty %s statement detected'; + $phpcsFile->addError($error, $stackPtr, 'Detected'.ucfirst(strtolower($name)), [$name]); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php new file mode 100644 index 00000000..726b32c5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php @@ -0,0 +1,91 @@ + + * class Foo + * { + * public function bar($x) + * { + * for (;true;) true; // No Init or Update part, may as well be: while (true) + * } + * } + * + * + * @author Manuel Pichler + * @copyright 2007-2014 Manuel Pichler. All rights reserved. + * @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 ForLoopShouldBeWhileLoopSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FOR]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $token = $tokens[$stackPtr]; + + // Skip invalid statement. + if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { + return; + } + + $next = ++$token['parenthesis_opener']; + $end = --$token['parenthesis_closer']; + + $parts = [ + 0, + 0, + 0, + ]; + $index = 0; + + for (; $next <= $end; ++$next) { + $code = $tokens[$next]['code']; + if ($code === T_SEMICOLON) { + ++$index; + } else if (isset(Tokens::$emptyTokens[$code]) === false) { + ++$parts[$index]; + } + } + + if ($parts[0] === 0 && $parts[2] === 0 && $parts[1] > 0) { + $error = 'This FOR loop can be simplified to a WHILE loop'; + $phpcsFile->addWarning($error, $stackPtr, 'CanSimplify'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php new file mode 100644 index 00000000..0374a8f7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php @@ -0,0 +1,101 @@ + + * class Foo + * { + * public function bar($x) + * { + * $a = array(1, 2, 3, 4); + * for ($i = 0; $i < count($a); $i++) { + * $a[$i] *= $i; + * } + * } + * } + * + * + * @author Greg Sherwood + * @author Manuel Pichler + * @copyright 2007-2014 Manuel Pichler. All rights reserved. + * @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 ForLoopWithTestFunctionCallSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FOR]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $token = $tokens[$stackPtr]; + + // Skip invalid statement. + if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { + return; + } + + $next = ++$token['parenthesis_opener']; + $end = --$token['parenthesis_closer']; + + $position = 0; + + for (; $next <= $end; ++$next) { + $code = $tokens[$next]['code']; + if ($code === T_SEMICOLON) { + ++$position; + } + + if ($position < 1) { + continue; + } else if ($position > 1) { + break; + } else if ($code !== T_VARIABLE && $code !== T_STRING) { + continue; + } + + // Find next non empty token, if it is a open parenthesis we have a + // function call. + $index = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + + if ($tokens[$index]['code'] === T_OPEN_PARENTHESIS) { + $error = 'Avoid function calls in a FOR loop test part'; + $phpcsFile->addWarning($error, $stackPtr, 'NotAllowed'); + break; + } + }//end for + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php new file mode 100644 index 00000000..8174d665 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php @@ -0,0 +1,134 @@ + + * class Foo + * { + * public function bar($x) + * { + * for ($i = 0; $i < 10; $i++) + * { + * for ($k = 0; $k < 20; $i++) + * { + * echo 'Hello'; + * } + * } + * } + * } + * + * + * @author Manuel Pichler + * @copyright 2007-2014 Manuel Pichler. All rights reserved. + * @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; + +class JumbledIncrementerSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FOR]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $token = $tokens[$stackPtr]; + + // Skip for-loop without body. + if (isset($token['scope_opener']) === false) { + return; + } + + // Find incrementers for outer loop. + $outer = $this->findIncrementers($tokens, $token); + + // Skip if empty. + if (count($outer) === 0) { + return; + } + + // Find nested for loops. + $start = ++$token['scope_opener']; + $end = --$token['scope_closer']; + + for (; $start <= $end; ++$start) { + if ($tokens[$start]['code'] !== T_FOR) { + continue; + } + + $inner = $this->findIncrementers($tokens, $tokens[$start]); + $diff = array_intersect($outer, $inner); + + if (count($diff) !== 0) { + $error = 'Loop incrementer (%s) jumbling with inner loop'; + $data = [implode(', ', $diff)]; + $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); + } + } + + }//end process() + + + /** + * Get all used variables in the incrementer part of a for statement. + * + * @param array $tokens Array with all code sniffer tokens. + * @param array $token Current for loop token. + * + * @return string[] List of all found incrementer variables. + */ + protected function findIncrementers(array $tokens, array $token) + { + // Skip invalid statement. + if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { + return []; + } + + $start = ++$token['parenthesis_opener']; + $end = --$token['parenthesis_closer']; + + $incrementers = []; + $semicolons = 0; + for ($next = $start; $next <= $end; ++$next) { + $code = $tokens[$next]['code']; + if ($code === T_SEMICOLON) { + ++$semicolons; + } else if ($semicolons === 2 && $code === T_VARIABLE) { + $incrementers[] = $tokens[$next]['content']; + } + } + + return $incrementers; + + }//end findIncrementers() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceSniff.php new file mode 100644 index 00000000..93afe2e3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceSniff.php @@ -0,0 +1,119 @@ + + * $one = false; + * $two = false; + * $three = true; + * + * $result = $one && $two || $three; + * $result3 = $one && !$two xor $three; + * + * + * {@internal The unary `!` operator is not handled, because its high precedence matches its visuals of + * applying only to the sub-expression right next to it, making it unlikely that someone would + * misinterpret its precedence. Requiring parentheses around it would reduce the readability of + * expressions due to the additional characters, especially if multiple subexpressions / variables + * need to be negated.} + * + * Sister-sniff to the `Squiz.ControlStructures.InlineIfDeclaration` and + * `Squiz.Formatting.OperatorBracket.MissingBrackets` sniffs. + * + * @author Tim Duesterhus + * @copyright 2021-2023 WoltLab GmbH. + * @copyright 2024 PHPCSStandards and contributors + * @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 RequireExplicitBooleanOperatorPrecedenceSniff implements Sniff +{ + + /** + * Array of tokens this test searches for to find either a boolean + * operator or the start of the current (sub-)expression. Used for + * performance optimization purposes. + * + * @var array + */ + private $searchTargets = []; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + $this->searchTargets = Tokens::$booleanOperators; + $this->searchTargets += Tokens::$blockOpeners; + $this->searchTargets[T_INLINE_THEN] = T_INLINE_THEN; + $this->searchTargets[T_INLINE_ELSE] = T_INLINE_ELSE; + + return Tokens::$booleanOperators; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $start = $phpcsFile->findStartOfStatement($stackPtr); + + $previous = $phpcsFile->findPrevious( + $this->searchTargets, + ($stackPtr - 1), + $start, + false, + null, + true + ); + + if ($previous === false) { + // No token found. + return; + } + + if ($tokens[$previous]['code'] === $tokens[$stackPtr]['code']) { + // Identical operator found. + return; + } + + if (in_array($tokens[$previous]['code'], [T_INLINE_THEN, T_INLINE_ELSE], true) === true) { + // Beginning of the expression found for the ternary conditional operator. + return; + } + + if (isset(Tokens::$blockOpeners[$tokens[$previous]['code']]) === true) { + // Beginning of the expression found for a block opener. Needed to + // correctly handle match arms. + return; + } + + // We found a mismatching operator, thus we must report the error. + $error = 'Mixing different binary boolean operators within an expression'; + $error .= ' without using parentheses to clarify precedence is not allowed.'; + $phpcsFile->addError($error, $stackPtr, 'MissingParentheses'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php new file mode 100644 index 00000000..db71a967 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php @@ -0,0 +1,93 @@ +true
    or false + * + * + * class Foo + * { + * public function close() + * { + * if (true) + * { + * // ... + * } + * } + * } + * + * + * @author Manuel Pichler + * @copyright 2007-2014 Manuel Pichler. All rights reserved. + * @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 UnconditionalIfStatementSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_IF, + T_ELSEIF, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $token = $tokens[$stackPtr]; + + // Skip if statement without body. + if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { + return; + } + + $next = ++$token['parenthesis_opener']; + $end = --$token['parenthesis_closer']; + + $goodCondition = false; + for (; $next <= $end; ++$next) { + $code = $tokens[$next]['code']; + + if (isset(Tokens::$emptyTokens[$code]) === true) { + continue; + } else if ($code !== T_TRUE && $code !== T_FALSE) { + $goodCondition = true; + } + } + + if ($goodCondition === false) { + $error = 'Avoid IF statements that are always true or false'; + $phpcsFile->addWarning($error, $stackPtr, 'Found'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php new file mode 100644 index 00000000..2f4faa89 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php @@ -0,0 +1,88 @@ + + * final class Foo + * { + * public final function bar() + * { + * } + * } + * + * + * @author Manuel Pichler + * @copyright 2007-2014 Manuel Pichler. All rights reserved. + * @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; + +class UnnecessaryFinalModifierSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_CLASS]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $token = $tokens[$stackPtr]; + + // Skip for statements without body. + if (isset($token['scope_opener']) === false) { + return; + } + + if ($phpcsFile->getClassProperties($stackPtr)['is_final'] === false) { + // This class is not final so we don't need to check it. + return; + } + + $next = ++$token['scope_opener']; + $end = --$token['scope_closer']; + + for (; $next <= $end; ++$next) { + if ($tokens[$next]['code'] === T_FINAL) { + $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() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php new file mode 100644 index 00000000..e076b83d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php @@ -0,0 +1,307 @@ + + * @author Greg Sherwood + * @copyright 2007-2014 Manuel Pichler. All rights reserved. + * @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 UnusedFunctionParameterSniff implements Sniff +{ + + /** + * The list of class type hints which will be ignored. + * + * @var array + */ + 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. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + T_FN, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $token = $tokens[$stackPtr]; + + // Skip broken function declarations. + if (isset($token['scope_opener']) === false || isset($token['parenthesis_opener']) === false) { + return; + } + + $errorCode = 'Found'; + $implements = false; + + 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); + + // Skip when no parameters found. + $methodParamsCount = count($methodParams); + if ($methodParamsCount === 0) { + return; + } + + foreach ($methodParams as $param) { + if (isset($param['property_visibility']) === true) { + // Ignore constructor property promotion. + continue; + } + + $params[$param['name']] = $stackPtr; + } + + $next = ++$token['scope_opener']; + $end = --$token['scope_closer']; + + // Check the end token for arrow functions as + // they can end at a content token due to not having + // a clearly defined closing token. + if ($token['code'] === T_FN) { + ++$end; + } + + $foundContent = false; + $validTokens = [ + T_HEREDOC => T_HEREDOC, + T_NOWDOC => T_NOWDOC, + T_END_HEREDOC => T_END_HEREDOC, + T_END_NOWDOC => T_END_NOWDOC, + T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, + ]; + $validTokens += Tokens::$emptyTokens; + + for (; $next <= $end; ++$next) { + $token = $tokens[$next]; + $code = $token['code']; + + // Ignorable tokens. + if (isset(Tokens::$emptyTokens[$code]) === true) { + continue; + } + + if ($foundContent === false) { + // A throw statement as the first content indicates an interface method. + if ($code === T_THROW && $implements !== false) { + return; + } + + // A return statement as the first content indicates an interface method. + if ($code === T_RETURN) { + $firstNonEmptyTokenAfterReturn = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + if ($tokens[$firstNonEmptyTokenAfterReturn]['code'] === T_SEMICOLON && $implements !== false) { + return; + } + + $secondNonEmptyTokenAfterReturn = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($firstNonEmptyTokenAfterReturn + 1), + null, + true + ); + + if ($secondNonEmptyTokenAfterReturn !== false + && $tokens[$secondNonEmptyTokenAfterReturn]['code'] === T_SEMICOLON + && $implements !== false + ) { + // There is a return . + return; + } + }//end if + }//end if + + $foundContent = true; + + if ($code === T_VARIABLE && isset($params[$token['content']]) === true) { + unset($params[$token['content']]); + } else if ($code === T_DOLLAR) { + $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); + if ($tokens[$nextToken]['code'] === T_OPEN_CURLY_BRACKET) { + $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($nextToken + 1), null, true); + if ($tokens[$nextToken]['code'] === T_STRING) { + $varContent = '$'.$tokens[$nextToken]['content']; + if (isset($params[$varContent]) === true) { + unset($params[$varContent]); + } + } + } + } else if ($code === T_DOUBLE_QUOTED_STRING + || $code === T_START_HEREDOC + || $code === T_START_NOWDOC + ) { + // Tokenize strings that can contain variables. + // Make sure the string is re-joined if it occurs over multiple lines. + $content = $token['content']; + for ($i = ($next + 1); $i <= $end; $i++) { + if (isset($validTokens[$tokens[$i]['code']]) === true) { + $content .= $tokens[$i]['content']; + $next++; + } else { + break; + } + } + + $stringTokens = token_get_all(sprintf('', $content)); + foreach ($stringTokens as $stringPtr => $stringToken) { + if (is_array($stringToken) === false) { + continue; + } + + $varContent = ''; + if ($stringToken[0] === T_DOLLAR_OPEN_CURLY_BRACES) { + $varContent = '$'.$stringTokens[($stringPtr + 1)][1]; + } else if ($stringToken[0] === T_VARIABLE) { + $varContent = $stringToken[1]; + } + + if ($varContent !== '' && isset($params[$varContent]) === true) { + unset($params[$varContent]); + } + } + }//end if + }//end for + + if ($foundContent === true && count($params) > 0) { + $error = 'The method parameter %s is never used'; + + // If there is only one parameter and it is unused, no need for additional errorcode toggling logic. + if ($methodParamsCount === 1) { + foreach ($params as $paramName => $position) { + if (in_array($methodParams[0]['type_hint'], $this->ignoreTypeHints, true) === true) { + continue; + } + + $data = [$paramName]; + $phpcsFile->addWarning($error, $position, $errorCode, $data); + } + + return; + } + + $foundLastUsed = false; + $lastIndex = ($methodParamsCount - 1); + $errorInfo = []; + for ($i = $lastIndex; $i >= 0; --$i) { + if ($foundLastUsed !== false) { + if (isset($params[$methodParams[$i]['name']]) === true) { + $errorInfo[$methodParams[$i]['name']] = [ + 'position' => $params[$methodParams[$i]['name']], + 'errorcode' => $errorCode.'BeforeLastUsed', + 'typehint' => $methodParams[$i]['type_hint'], + ]; + } + } else { + if (isset($params[$methodParams[$i]['name']]) === false) { + $foundLastUsed = true; + } else { + $errorInfo[$methodParams[$i]['name']] = [ + 'position' => $params[$methodParams[$i]['name']], + 'errorcode' => $errorCode.'AfterLastUsed', + 'typehint' => $methodParams[$i]['type_hint'], + ]; + } + } + }//end for + + if (count($errorInfo) > 0) { + $errorInfo = array_reverse($errorInfo); + foreach ($errorInfo as $paramName => $info) { + if (in_array($info['typehint'], $this->ignoreTypeHints, true) === true) { + continue; + } + + $data = [$paramName]; + $phpcsFile->addWarning($error, $info['position'], $info['errorcode'], $data); + } + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php new file mode 100644 index 00000000..5163da71 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php @@ -0,0 +1,184 @@ + + * class FooBar { + * public function __construct($a, $b) { + * parent::__construct($a, $b); + * } + * } + * + * + * @author Manuel Pichler + * @copyright 2007-2014 Manuel Pichler. All rights reserved. + * @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 UselessOverridingMethodSniff implements Sniff +{ + + /** + * Object-Oriented scopes in which a call to parent::method() can exist. + * + * @var array Keys are the token constants, value is irrelevant. + */ + private $validOOScopes = [ + T_CLASS => true, + T_ANON_CLASS => true, + T_TRAIT => true, + ]; + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $token = $tokens[$stackPtr]; + + // Skip function without body. + if (isset($token['scope_opener'], $token['scope_closer']) === false) { + return; + } + + $conditions = $token['conditions']; + $lastCondition = end($conditions); + + // Skip functions that are not a method part of a class, anon class or trait. + if (isset($this->validOOScopes[$lastCondition]) === false) { + return; + } + + // Get function name. + $methodName = $phpcsFile->getDeclarationName($stackPtr); + + // Get all parameters from method signature. + $signature = []; + foreach ($phpcsFile->getMethodParameters($stackPtr) as $param) { + $signature[] = $param['name']; + } + + $next = ++$token['scope_opener']; + $end = --$token['scope_closer']; + + for (; $next <= $end; ++$next) { + $code = $tokens[$next]['code']; + + if (isset(Tokens::$emptyTokens[$code]) === true) { + continue; + } else if ($code === T_RETURN) { + continue; + } + + break; + } + + // Any token except 'parent' indicates correct code. + if ($tokens[$next]['code'] !== T_PARENT) { + return; + } + + // Find next non empty token index, should be double colon. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + + // Skip for invalid code. + if ($tokens[$next]['code'] !== T_DOUBLE_COLON) { + return; + } + + // Find next non empty token index, should be the name of the method being called. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + + // Skip for invalid code or other method. + if (strcasecmp($tokens[$next]['content'], $methodName) !== 0) { + return; + } + + // Find next non empty token index, should be the open parenthesis. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + + // Skip for invalid code. + if ($tokens[$next]['code'] !== T_OPEN_PARENTHESIS || isset($tokens[$next]['parenthesis_closer']) === false) { + return; + } + + $parameters = ['']; + $parenthesisCount = 1; + for (++$next; $next < $phpcsFile->numTokens; ++$next) { + $code = $tokens[$next]['code']; + + if ($code === T_OPEN_PARENTHESIS) { + ++$parenthesisCount; + } else if ($code === T_CLOSE_PARENTHESIS) { + --$parenthesisCount; + } else if ($parenthesisCount === 1 && $code === T_COMMA) { + $parameters[] = ''; + } else if (isset(Tokens::$emptyTokens[$code]) === false) { + $parameters[(count($parameters) - 1)] .= $tokens[$next]['content']; + } + + if ($parenthesisCount === 0) { + break; + } + }//end for + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + if ($tokens[$next]['code'] !== T_SEMICOLON && $tokens[$next]['code'] !== T_CLOSE_TAG) { + return; + } + + // This list deliberately does not include the `T_OPEN_TAG_WITH_ECHO` as that token implicitly is an echo statement, i.e. content. + $nonContent = Tokens::$emptyTokens; + $nonContent[T_OPEN_TAG] = T_OPEN_TAG; + $nonContent[T_CLOSE_TAG] = T_CLOSE_TAG; + + // Check rest of the scope. + for (++$next; $next <= $end; ++$next) { + $code = $tokens[$next]['code']; + // Skip for any other content. + if (isset($nonContent[$code]) === false) { + return; + } + } + + $parameters = array_map('trim', $parameters); + $parameters = array_filter($parameters); + + if (count($parameters) === count($signature) && $parameters === $signature) { + $phpcsFile->addWarning('Possible useless method overriding detected', $stackPtr, 'Found'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php new file mode 100644 index 00000000..f34ffc2b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php @@ -0,0 +1,357 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_DOC_COMMENT_OPEN_TAG]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['comment_closer']) === false + || ($tokens[$tokens[$stackPtr]['comment_closer']]['content'] === '' + && $tokens[$stackPtr]['comment_closer'] === ($phpcsFile->numTokens - 1)) + ) { + // Don't process an unfinished comment during live coding. + return; + } + + $commentStart = $stackPtr; + $commentEnd = $tokens[$stackPtr]['comment_closer']; + + $empty = [ + T_DOC_COMMENT_WHITESPACE, + T_DOC_COMMENT_STAR, + ]; + + $short = $phpcsFile->findNext($empty, ($stackPtr + 1), $commentEnd, true); + if ($short === false) { + // No content at all. + $error = 'Doc comment is empty'; + $phpcsFile->addError($error, $stackPtr, 'Empty'); + return; + } + + // The first line of the comment should just be the /** code. + if ($tokens[$short]['line'] === $tokens[$stackPtr]['line']) { + $error = 'The open comment tag must be the only content on the line'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpen'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addNewline($stackPtr); + $phpcsFile->fixer->addContentBefore($short, '* '); + $phpcsFile->fixer->endChangeset(); + } + } + + // The last line of the comment should just be the */ code. + $prev = $phpcsFile->findPrevious($empty, ($commentEnd - 1), $stackPtr, true); + if ($tokens[$prev]['line'] === $tokens[$commentEnd]['line']) { + $error = 'The close comment tag must be the only content on the line'; + $fix = $phpcsFile->addFixableError($error, $commentEnd, 'ContentBeforeClose'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($commentEnd); + } + } + + // Check for additional blank lines at the end of the comment. + if ($tokens[$prev]['line'] < ($tokens[$commentEnd]['line'] - 1)) { + $error = 'Additional blank lines found at end of doc comment'; + $fix = $phpcsFile->addFixableError($error, $commentEnd, 'SpacingAfter'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prev + 1); $i < $commentEnd; $i++) { + if ($tokens[($i + 1)]['line'] === $tokens[$commentEnd]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + // Check for a comment description. + if ($tokens[$short]['code'] !== T_DOC_COMMENT_STRING) { + $error = 'Missing short description in doc comment'; + $phpcsFile->addError($error, $stackPtr, 'MissingShort'); + } else { + // No extra newline before short description. + if ($tokens[$short]['line'] !== ($tokens[$stackPtr]['line'] + 1)) { + $error = 'Doc comment short description must be on the first line'; + $fix = $phpcsFile->addFixableError($error, $short, 'SpacingBeforeShort'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = $stackPtr; $i < $short; $i++) { + if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { + continue; + } else if ($tokens[$i]['line'] === $tokens[$short]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + // Account for the fact that a short description might cover + // multiple lines. + $shortContent = $tokens[$short]['content']; + $shortEnd = $short; + for ($i = ($short + 1); $i < $commentEnd; $i++) { + if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { + if ($tokens[$i]['line'] === ($tokens[$shortEnd]['line'] + 1)) { + $shortContent .= $tokens[$i]['content']; + $shortEnd = $i; + } else { + break; + } + } + } + + if (preg_match('/^\p{Ll}/u', $shortContent) === 1) { + $error = 'Doc comment short description must start with a capital letter'; + $phpcsFile->addError($error, $short, 'ShortNotCapital'); + } + + $long = $phpcsFile->findNext($empty, ($shortEnd + 1), ($commentEnd - 1), true); + if ($long !== false && $tokens[$long]['code'] === T_DOC_COMMENT_STRING) { + if ($tokens[$long]['line'] !== ($tokens[$shortEnd]['line'] + 2)) { + $error = 'There must be exactly one blank line between descriptions in a doc comment'; + $fix = $phpcsFile->addFixableError($error, $long, 'SpacingBetween'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($shortEnd + 1); $i < $long; $i++) { + if ($tokens[$i]['line'] === $tokens[$shortEnd]['line']) { + continue; + } else if ($tokens[$i]['line'] === ($tokens[$long]['line'] - 1)) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + if (preg_match('/^\p{Ll}/u', $tokens[$long]['content']) === 1) { + $error = 'Doc comment long description must start with a capital letter'; + $phpcsFile->addError($error, $long, 'LongNotCapital'); + } + }//end if + }//end if + + if (empty($tokens[$commentStart]['comment_tags']) === true) { + // No tags in the comment. + return; + } + + $firstTag = $tokens[$commentStart]['comment_tags'][0]; + $prev = $phpcsFile->findPrevious($empty, ($firstTag - 1), $stackPtr, true); + if ($tokens[$firstTag]['line'] !== ($tokens[$prev]['line'] + 2) + && $tokens[$prev]['code'] !== T_DOC_COMMENT_OPEN_TAG + ) { + $error = 'There must be exactly one blank line before the tags in a doc comment'; + $fix = $phpcsFile->addFixableError($error, $firstTag, 'SpacingBeforeTags'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prev + 1); $i < $firstTag; $i++) { + if ($tokens[$i]['line'] === $tokens[$firstTag]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $indent = str_repeat(' ', $tokens[$stackPtr]['column']); + $phpcsFile->fixer->addContent($prev, $phpcsFile->eolChar.$indent.'*'.$phpcsFile->eolChar); + $phpcsFile->fixer->endChangeset(); + } + } + + // Break out the tags into groups and check alignment within each. + // A tag group is one where there are no blank lines between tags. + // The param tag group is special as it requires all @param tags to be inside. + $tagGroups = []; + $groupid = 0; + $paramGroupid = null; + foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { + if ($pos > 0) { + $prev = $phpcsFile->findPrevious( + T_DOC_COMMENT_STRING, + ($tag - 1), + $tokens[$commentStart]['comment_tags'][($pos - 1)] + ); + + if ($prev === false) { + $prev = $tokens[$commentStart]['comment_tags'][($pos - 1)]; + } + + if ($tokens[$prev]['line'] !== ($tokens[$tag]['line'] - 1)) { + $groupid++; + } + } + + if ($tokens[$tag]['content'] === '@param') { + if ($paramGroupid !== null + && $paramGroupid !== $groupid + ) { + $error = 'Parameter tags must be grouped together in a doc comment'; + $phpcsFile->addError($error, $tag, 'ParamGroup'); + } + + if ($paramGroupid === null) { + $paramGroupid = $groupid; + } + }//end if + + $tagGroups[$groupid][] = $tag; + }//end foreach + + foreach ($tagGroups as $groupid => $group) { + $maxLength = 0; + $paddings = []; + foreach ($group as $pos => $tag) { + if ($paramGroupid === $groupid + && $tokens[$tag]['content'] !== '@param' + ) { + $error = 'Tag %s cannot be grouped with parameter tags in a doc comment'; + $data = [$tokens[$tag]['content']]; + $phpcsFile->addError($error, $tag, 'NonParamGroup', $data); + } + + $tagLength = $tokens[$tag]['length']; + if ($tagLength > $maxLength) { + $maxLength = $tagLength; + } + + // Check for a value. No value means no padding needed. + $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); + if ($string !== false && $tokens[$string]['line'] === $tokens[$tag]['line']) { + $paddings[$tag] = $tokens[($tag + 1)]['length']; + } + } + + // Check that there was single blank line after the tag block + // 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($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)) { + $error = 'There must be a single blank line after a tag group'; + $fix = $phpcsFile->addFixableError($error, $lastTag, 'SpacingAfterTagGroup'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prev + 1); $i < $next; $i++) { + if ($tokens[$i]['line'] === $tokens[$next]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $indent = str_repeat(' ', $tokens[$stackPtr]['column']); + $phpcsFile->fixer->addContent($prev, $phpcsFile->eolChar.$indent.'*'.$phpcsFile->eolChar); + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + // Now check paddings. + foreach ($paddings as $tag => $padding) { + $required = ($maxLength - $tokens[$tag]['length'] + 1); + + if ($padding !== $required) { + $error = 'Tag value for %s tag indented incorrectly; expected %s spaces but found %s'; + $data = [ + $tokens[$tag]['content'], + $required, + $padding, + ]; + + $fix = $phpcsFile->addFixableError($error, ($tag + 1), 'TagValueIndent', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($tag + 1), str_repeat(' ', $required)); + } + } + } + }//end foreach + + // If there is a param group, it needs to be first. + if ($paramGroupid !== null && $paramGroupid !== 0) { + $error = 'Parameter tags must be defined first in a doc comment'; + $phpcsFile->addError($error, $tagGroups[$paramGroupid][0], 'ParamNotFirst'); + } + + $foundTags = []; + foreach ($tokens[$stackPtr]['comment_tags'] as $pos => $tag) { + $tagName = $tokens[$tag]['content']; + if (isset($foundTags[$tagName]) === true) { + $lastTag = $tokens[$stackPtr]['comment_tags'][($pos - 1)]; + if ($tokens[$lastTag]['content'] !== $tagName) { + $error = 'Tags must be grouped together in a doc comment'; + $phpcsFile->addError($error, $tag, 'TagsNotGrouped'); + } + + continue; + } + + $foundTags[$tagName] = true; + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php new file mode 100644 index 00000000..b78a6595 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php @@ -0,0 +1,78 @@ + + * @author Sam Graham + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 FixmeSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return array_diff(Tokens::$commentTokens, Tokens::$phpcsCommentTokens); + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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']; + $matches = []; + preg_match('/(?:\A|[^\p{L}]+)fixme([^\p{L}]+(.*)|\Z)/ui', $content, $matches); + if (empty($matches) === false) { + // Clear whitespace and some common characters not required at + // the end of a fixme message to make the error more informative. + $type = 'CommentFound'; + $fixmeMessage = trim($matches[1]); + $fixmeMessage = trim($fixmeMessage, '-:[](). '); + $error = 'Comment refers to a FIXME task'; + $data = [$fixmeMessage]; + if ($fixmeMessage !== '') { + $type = 'TaskFound'; + $error .= ' "%s"'; + } + + $phpcsFile->addError($error, $stackPtr, $type, $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php new file mode 100644 index 00000000..d24111cb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php @@ -0,0 +1,77 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 TodoSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return array_diff(Tokens::$commentTokens, Tokens::$phpcsCommentTokens); + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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']; + $matches = []; + preg_match('/(?:\A|[^\p{L}]+)todo([^\p{L}]+(.*)|\Z)/ui', $content, $matches); + if (empty($matches) === false) { + // Clear whitespace and some common characters not required at + // the end of a to-do message to make the warning more informative. + $type = 'CommentFound'; + $todoMessage = trim($matches[1]); + $todoMessage = trim($todoMessage, '-:[](). '); + $error = 'Comment refers to a TODO task'; + $data = [$todoMessage]; + if ($todoMessage !== '') { + $type = 'TaskFound'; + $error .= ' "%s"'; + } + + $phpcsFile->addWarning($error, $stackPtr, $type, $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php new file mode 100644 index 00000000..3dc7795b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php @@ -0,0 +1,185 @@ + + * @author Mark Scherer + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class DisallowYodaConditionsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + $tokens = Tokens::$comparisonTokens; + unset($tokens[T_COALESCE]); + + return $tokens; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $previousIndex = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + $relevantTokens = [ + T_CLOSE_SHORT_ARRAY, + T_CLOSE_PARENTHESIS, + T_TRUE, + T_FALSE, + T_NULL, + T_LNUMBER, + T_DNUMBER, + T_CONSTANT_ENCAPSED_STRING, + ]; + + if (in_array($tokens[$previousIndex]['code'], $relevantTokens, true) === false) { + return; + } + + if ($tokens[$previousIndex]['code'] === T_CLOSE_SHORT_ARRAY) { + $previousIndex = $tokens[$previousIndex]['bracket_opener']; + if ($this->isArrayStatic($phpcsFile, $previousIndex) === false) { + return; + } + } + + $prevIndex = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($previousIndex - 1), null, true); + + if (in_array($tokens[$prevIndex]['code'], Tokens::$arithmeticTokens, true) === true) { + return; + } + + if ($tokens[$prevIndex]['code'] === T_STRING_CONCAT) { + return; + } + + // Is it a parenthesis. + if ($tokens[$previousIndex]['code'] === T_CLOSE_PARENTHESIS) { + $beforeOpeningParenthesisIndex = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($tokens[$previousIndex]['parenthesis_opener'] - 1), + null, + true + ); + + if ($beforeOpeningParenthesisIndex === false || $tokens[$beforeOpeningParenthesisIndex]['code'] !== T_ARRAY) { + if ($tokens[$beforeOpeningParenthesisIndex]['code'] === T_STRING) { + return; + } + + // If it is not an array check what is inside. + $found = $phpcsFile->findPrevious( + T_VARIABLE, + ($previousIndex - 1), + $tokens[$previousIndex]['parenthesis_opener'] + ); + + // If a variable exists, it is not Yoda. + if ($found !== false) { + return; + } + + // If there is nothing inside the parenthesis, it is not a Yoda condition. + $opener = $tokens[$previousIndex]['parenthesis_opener']; + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($previousIndex - 1), ($opener + 1), true); + if ($prev === false) { + return; + } + } else if ($tokens[$beforeOpeningParenthesisIndex]['code'] === T_ARRAY + && $this->isArrayStatic($phpcsFile, $beforeOpeningParenthesisIndex) === false + ) { + return; + }//end if + }//end if + + $phpcsFile->addError( + 'Usage of Yoda conditions is not allowed; switch the expression order', + $stackPtr, + 'Found' + ); + + }//end process() + + + /** + * Determines if an array is a static definition. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $arrayToken The position of the array token. + * + * @return bool + */ + public function isArrayStatic(File $phpcsFile, $arrayToken) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$arrayToken]['code'] === T_OPEN_SHORT_ARRAY) { + $start = $arrayToken; + $end = $tokens[$arrayToken]['bracket_closer']; + } else if ($tokens[$arrayToken]['code'] === T_ARRAY) { + $start = $tokens[$arrayToken]['parenthesis_opener']; + $end = $tokens[$arrayToken]['parenthesis_closer']; + } else { + // Shouldn't be possible but may happen if external sniffs are using this method. + return true; + } + + $staticTokens = Tokens::$emptyTokens; + $staticTokens += Tokens::$textStringTokens; + $staticTokens += Tokens::$assignmentTokens; + $staticTokens += Tokens::$equalityTokens; + $staticTokens += Tokens::$comparisonTokens; + $staticTokens += Tokens::$arithmeticTokens; + $staticTokens += Tokens::$operators; + $staticTokens += Tokens::$booleanOperators; + $staticTokens += Tokens::$castTokens; + $staticTokens += Tokens::$bracketTokens; + $staticTokens += [ + T_DOUBLE_ARROW => T_DOUBLE_ARROW, + T_COMMA => T_COMMA, + T_TRUE => T_TRUE, + T_FALSE => T_FALSE, + ]; + + for ($i = ($start + 1); $i < $end; $i++) { + if (isset($tokens[$i]['scope_closer']) === true) { + $i = $tokens[$i]['scope_closer']; + continue; + } + + if (isset($staticTokens[$tokens[$i]['code']]) === false) { + return false; + } + } + + return true; + + }//end isArrayStatic() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php new file mode 100644 index 00000000..bc4a916d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php @@ -0,0 +1,381 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class InlineControlStructureSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * If true, an error will be thrown; otherwise a warning. + * + * @var boolean + */ + public $error = true; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_IF, + T_ELSE, + T_ELSEIF, + T_FOREACH, + T_WHILE, + T_DO, + T_SWITCH, + T_FOR, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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|int + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_opener']) === true) { + $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'no'); + return; + } + + // Ignore the ELSE in ELSE IF. We'll process the IF part later. + if ($tokens[$stackPtr]['code'] === T_ELSE) { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($tokens[$next]['code'] === T_IF) { + return; + } + } + + if ($tokens[$stackPtr]['code'] === T_WHILE || $tokens[$stackPtr]['code'] === T_FOR) { + // This could be from a DO WHILE, which doesn't have an opening brace or a while/for without body. + if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { + $afterParensCloser = $phpcsFile->findNext(Tokens::$emptyTokens, ($tokens[$stackPtr]['parenthesis_closer'] + 1), null, true); + if ($afterParensCloser === false) { + // Live coding. + return; + } + + if ($tokens[$afterParensCloser]['code'] === T_SEMICOLON) { + $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'no'); + return; + } + } + + // In Javascript DO WHILE loops without curly braces are legal. This + // is only valid if a single statement is present between the DO and + // the WHILE. We can detect this by checking only a single semicolon + // is present between them. + if ($tokens[$stackPtr]['code'] === T_WHILE && $phpcsFile->tokenizerType === 'JS') { + $lastDo = $phpcsFile->findPrevious(T_DO, ($stackPtr - 1)); + $lastSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, ($stackPtr - 1)); + if ($lastDo !== false && $lastSemicolon !== false && $lastDo < $lastSemicolon) { + $precedingSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, ($lastSemicolon - 1)); + if ($precedingSemicolon === false || $precedingSemicolon < $lastDo) { + return; + } + } + } + }//end if + + if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false + && $tokens[$stackPtr]['code'] !== T_ELSE + ) { + if ($tokens[$stackPtr]['code'] !== T_DO) { + // Live coding or parse error. + return; + } + + $nextWhile = $phpcsFile->findNext(T_WHILE, ($stackPtr + 1)); + if ($nextWhile !== false + && isset($tokens[$nextWhile]['parenthesis_opener'], $tokens[$nextWhile]['parenthesis_closer']) === false + ) { + // Live coding or parse error. + return; + } + + unset($nextWhile); + } + + $start = $stackPtr; + if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { + $start = $tokens[$stackPtr]['parenthesis_closer']; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($start + 1), null, true); + if ($nextNonEmpty === false) { + // Live coding or parse error. + return; + } + + if ($tokens[$nextNonEmpty]['code'] === T_OPEN_CURLY_BRACKET + || $tokens[$nextNonEmpty]['code'] === T_COLON + ) { + // T_CLOSE_CURLY_BRACKET missing, or alternative control structure with + // T_END... missing. Either live coding, parse error or end + // tag in short open tags and scan run with short_open_tag=Off. + // Bow out completely as any further detection will be unreliable + // and create incorrect fixes or cause fixer conflicts. + return $phpcsFile->numTokens; + } + + unset($nextNonEmpty, $start); + + // This is a control structure without an opening brace, + // so it is an inline statement. + if ($this->error === true) { + $fix = $phpcsFile->addFixableError('Inline control structures are not allowed', $stackPtr, 'NotAllowed'); + } else { + $fix = $phpcsFile->addFixableWarning('Inline control structures are discouraged', $stackPtr, 'Discouraged'); + } + + $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'yes'); + + // Stop here if we are not fixing the error. + if ($fix !== true) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { + $closer = $tokens[$stackPtr]['parenthesis_closer']; + } else { + $closer = $stackPtr; + } + + if ($tokens[($closer + 1)]['code'] === T_WHITESPACE + || $tokens[($closer + 1)]['code'] === T_SEMICOLON + ) { + $phpcsFile->fixer->addContent($closer, ' {'); + } else { + $phpcsFile->fixer->addContent($closer, ' { '); + } + + $fixableScopeOpeners = $this->register(); + + $lastNonEmpty = $closer; + for ($end = ($closer + 1); $end < $phpcsFile->numTokens; $end++) { + if ($tokens[$end]['code'] === T_SEMICOLON) { + break; + } + + if ($tokens[$end]['code'] === T_CLOSE_TAG) { + $end = $lastNonEmpty; + break; + } + + if (in_array($tokens[$end]['code'], $fixableScopeOpeners, true) === true + && isset($tokens[$end]['scope_opener']) === false + ) { + // The best way to fix nested inline scopes is middle-out. + // So skip this one. It will be detected and fixed on a future loop. + $phpcsFile->fixer->rollbackChangeset(); + return; + } + + if (isset($tokens[$end]['scope_opener']) === true) { + $type = $tokens[$end]['code']; + $end = $tokens[$end]['scope_closer']; + if ($type === T_DO + || $type === T_IF || $type === T_ELSEIF + || $type === T_TRY || $type === T_CATCH || $type === T_FINALLY + ) { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); + if ($next === false) { + break; + } + + $nextType = $tokens[$next]['code']; + + // Let additional conditions loop and find their ending. + if (($type === T_IF + || $type === T_ELSEIF) + && ($nextType === T_ELSEIF + || $nextType === T_ELSE) + ) { + continue; + } + + // Account for TRY... CATCH/FINALLY statements. + if (($type === T_TRY + || $type === T_CATCH + || $type === T_FINALLY) + && ($nextType === T_CATCH + || $nextType === T_FINALLY) + ) { + continue; + } + + // Account for DO... WHILE conditions. + if ($type === T_DO && $nextType === T_WHILE) { + $end = $phpcsFile->findNext(T_SEMICOLON, ($next + 1)); + } + } else if ($type === T_CLOSURE) { + // There should be a semicolon after the closing brace. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); + if ($next !== false && $tokens[$next]['code'] === T_SEMICOLON) { + $end = $next; + } + }//end if + + if ($tokens[$end]['code'] !== T_END_HEREDOC + && $tokens[$end]['code'] !== T_END_NOWDOC + ) { + break; + } + }//end if + + if (isset($tokens[$end]['parenthesis_closer']) === true) { + $end = $tokens[$end]['parenthesis_closer']; + $lastNonEmpty = $end; + continue; + } + + if ($tokens[$end]['code'] !== T_WHITESPACE) { + $lastNonEmpty = $end; + } + }//end for + + if ($end === $phpcsFile->numTokens) { + $end = $lastNonEmpty; + } + + $nextContent = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); + if ($nextContent === false || $tokens[$nextContent]['line'] !== $tokens[$end]['line']) { + // Looks for completely empty statements. + $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), ($end + 1), true); + } else { + $next = ($end + 1); + $endLine = $end; + } + + if ($next !== $end) { + if ($nextContent === false || $tokens[$nextContent]['line'] !== $tokens[$end]['line']) { + // Account for a comment on the end of the line. + for ($endLine = $end; $endLine < $phpcsFile->numTokens; $endLine++) { + if (isset($tokens[($endLine + 1)]) === false + || $tokens[$endLine]['line'] !== $tokens[($endLine + 1)]['line'] + ) { + break; + } + } + + if (isset(Tokens::$commentTokens[$tokens[$endLine]['code']]) === false + && ($tokens[$endLine]['code'] !== T_WHITESPACE + || isset(Tokens::$commentTokens[$tokens[($endLine - 1)]['code']]) === false) + ) { + $endLine = $end; + } + } + + if ($endLine !== $end) { + $endToken = $endLine; + $addedContent = ''; + } else { + $endToken = $end; + $addedContent = $phpcsFile->eolChar; + + if ($tokens[$end]['code'] !== T_SEMICOLON + && $tokens[$end]['code'] !== T_CLOSE_CURLY_BRACKET + ) { + $phpcsFile->fixer->addContent($end, '; '); + } + } + + $next = $phpcsFile->findNext(T_WHITESPACE, ($endToken + 1), null, true); + if ($next !== false + && ($tokens[$next]['code'] === T_ELSE + || $tokens[$next]['code'] === T_ELSEIF) + ) { + $phpcsFile->fixer->addContentBefore($next, '} '); + } else { + $indent = ''; + for ($first = $stackPtr; $first > 0; $first--) { + if ($tokens[$first]['column'] === 1) { + break; + } + } + + if ($tokens[$first]['code'] === T_WHITESPACE) { + $indent = $tokens[$first]['content']; + } else if ($tokens[$first]['code'] === T_INLINE_HTML + || $tokens[$first]['code'] === T_OPEN_TAG + ) { + $addedContent = ''; + } + + $addedContent .= $indent.'}'; + if ($next !== false && $tokens[$endToken]['code'] === T_COMMENT) { + $addedContent .= $phpcsFile->eolChar; + } + + $phpcsFile->fixer->addContent($endToken, $addedContent); + }//end if + } else { + if ($nextContent === false || $tokens[$nextContent]['line'] !== $tokens[$end]['line']) { + // Account for a comment on the end of the line. + for ($endLine = $end; $endLine < $phpcsFile->numTokens; $endLine++) { + if (isset($tokens[($endLine + 1)]) === false + || $tokens[$endLine]['line'] !== $tokens[($endLine + 1)]['line'] + ) { + break; + } + } + + if ($tokens[$endLine]['code'] !== T_COMMENT + && ($tokens[$endLine]['code'] !== T_WHITESPACE + || $tokens[($endLine - 1)]['code'] !== T_COMMENT) + ) { + $endLine = $end; + } + } + + if ($endLine !== $end) { + $phpcsFile->fixer->replaceToken($end, ''); + $phpcsFile->fixer->addNewlineBefore($endLine); + $phpcsFile->fixer->addContent($endLine, '}'); + } else { + $phpcsFile->fixer->replaceToken($end, '}'); + } + }//end if + + $phpcsFile->fixer->endChangeset(); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php new file mode 100644 index 00000000..6df4c1ff --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php @@ -0,0 +1,98 @@ + + * @copyright 2013-2014 Roman Levishchenko + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Common; + +class CSSLintSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return int + */ + public function process(File $phpcsFile, $stackPtr) + { + $csslintPath = Config::getExecutablePath('csslint'); + if ($csslintPath === null) { + return $phpcsFile->numTokens; + } + + $fileName = $phpcsFile->getFilename(); + + $cmd = Common::escapeshellcmd($csslintPath).' '.escapeshellarg($fileName).' 2>&1'; + exec($cmd, $output, $retval); + + if (is_array($output) === false) { + return $phpcsFile->numTokens; + } + + $count = count($output); + + for ($i = 0; $i < $count; $i++) { + $matches = []; + $numMatches = preg_match( + '/(error|warning) at line (\d+)/', + $output[$i], + $matches + ); + + if ($numMatches === 0) { + continue; + } + + $line = (int) $matches[2]; + $message = 'csslint says: '.$output[($i + 1)]; + // First line is message with error line and error code. + // Second is error message. + // Third is wrong line in file. + // Fourth is empty line. + $i += 4; + + $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); + }//end for + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php new file mode 100644 index 00000000..637bf41e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php @@ -0,0 +1,119 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Common; + +class ClosureLinterSniff implements Sniff +{ + + /** + * A list of error codes that should show errors. + * + * All other error codes will show warnings. + * + * @var array + */ + public $errorCodes = []; + + /** + * A list of error codes to ignore. + * + * @var array + */ + public $ignoreCodes = []; + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @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 $phpcsFile->numTokens; + } + + $fileName = $phpcsFile->getFilename(); + + $lintPath = Common::escapeshellcmd($lintPath); + $cmd = $lintPath.' --nosummary --notime --unix_mode '.escapeshellarg($fileName); + exec($cmd, $output, $retval); + + if (is_array($output) === false) { + return $phpcsFile->numTokens; + } + + foreach ($output as $finding) { + $matches = []; + $numMatches = preg_match('/^(.*):([0-9]+):\(.*?([0-9]+)\)(.*)$/', $finding, $matches); + if ($numMatches === 0) { + continue; + } + + // Skip error codes we are ignoring. + $code = $matches[3]; + if (in_array($code, $this->ignoreCodes) === true) { + continue; + } + + $line = (int) $matches[2]; + $error = trim($matches[4]); + + $message = 'gjslint says: (%s) %s'; + $data = [ + $code, + $error, + ]; + if (in_array($code, $this->errorCodes) === true) { + $phpcsFile->addErrorOnLine($message, $line, 'ExternalToolError', $data); + } else { + $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool', $data); + } + }//end foreach + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php new file mode 100644 index 00000000..1c6b0e3f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php @@ -0,0 +1,115 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Common; + +class ESLintSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + /** + * ESLint configuration file path. + * + * @var string|null Path to eslintrc. Null to autodetect. + */ + public $configFile = null; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @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 $phpcsFile->numTokens; + } + + $filename = $phpcsFile->getFilename(); + + $configFile = $this->configFile; + if (empty($configFile) === true) { + // Attempt to autodetect. + $candidates = glob('.eslintrc{.js,.yaml,.yml,.json}', GLOB_BRACE); + if (empty($candidates) === false) { + $configFile = $candidates[0]; + } + } + + $eslintOptions = ['--format json']; + if (empty($configFile) === false) { + $eslintOptions[] = '--config '.escapeshellarg($configFile); + } + + $cmd = Common::escapeshellcmd(escapeshellarg($eslintPath).' '.implode(' ', $eslintOptions).' '.escapeshellarg($filename)); + + // Execute! + exec($cmd, $stdout, $code); + + if ($code <= 0) { + // No errors, continue. + return $phpcsFile->numTokens; + } + + $data = json_decode(implode("\n", $stdout)); + if (json_last_error() !== JSON_ERROR_NONE) { + // Ignore any errors. + return $phpcsFile->numTokens; + } + + // Data is a list of files, but we only pass a single one. + $messages = $data[0]->messages; + foreach ($messages as $error) { + $message = 'eslint says: '.$error->message; + if (empty($error->fatal) === false || $error->severity === 2) { + $phpcsFile->addErrorOnLine($message, $error->line, 'ExternalTool'); + } else { + $phpcsFile->addWarningOnLine($message, $error->line, 'ExternalTool'); + } + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php new file mode 100644 index 00000000..ae8264eb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php @@ -0,0 +1,97 @@ + + * @author Alexander Wei§ + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Common; + +class JSHintSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @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 ($jshintPath === null) { + return $phpcsFile->numTokens; + } + + $fileName = $phpcsFile->getFilename(); + $jshintPath = Common::escapeshellcmd($jshintPath); + + if ($rhinoPath !== null) { + $rhinoPath = Common::escapeshellcmd($rhinoPath); + $cmd = "$rhinoPath \"$jshintPath\" ".escapeshellarg($fileName); + exec($cmd, $output, $retval); + + $regex = '`^(?P.+)\(.+:(?P[0-9]+).*:[0-9]+\)$`'; + } else { + $cmd = "$jshintPath ".escapeshellarg($fileName); + exec($cmd, $output, $retval); + + $regex = '`^(.+?): line (?P[0-9]+), col [0-9]+, (?P.+)$`'; + } + + if (is_array($output) === true) { + foreach ($output as $finding) { + $matches = []; + $numMatches = preg_match($regex, $finding, $matches); + if ($numMatches === 0) { + continue; + } + + $line = (int) $matches['line']; + $message = 'jshint says: '.trim($matches['error']); + $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); + } + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php new file mode 100644 index 00000000..5a1fde6f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php @@ -0,0 +1,82 @@ + + * @author Greg Sherwood + * @copyright 2010-2014 mediaSELF Sp. z o.o. + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ByteOrderMarkSniff implements Sniff +{ + + /** + * List of supported BOM definitions. + * + * Use encoding names as keys and hex BOM representations as values. + * + * @var array + */ + protected $bomDefinitions = [ + 'UTF-8' => 'efbbbf', + 'UTF-16 (BE)' => 'feff', + 'UTF-16 (LE)' => 'fffe', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_INLINE_HTML]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + // The BOM will be the very first token in the file. + if ($stackPtr !== 0) { + return $phpcsFile->numTokens; + } + + $tokens = $phpcsFile->getTokens(); + + foreach ($this->bomDefinitions as $bomName => $expectedBomHex) { + $bomByteLength = (strlen($expectedBomHex) / 2); + $htmlBomHex = bin2hex(substr($tokens[$stackPtr]['content'], 0, $bomByteLength)); + if ($htmlBomHex === $expectedBomHex) { + $errorData = [$bomName]; + $error = 'File contains %s byte order mark, which may corrupt your application'; + $phpcsFile->addError($error, $stackPtr, 'Found', $errorData); + $phpcsFile->recordMetric($stackPtr, 'Using byte order mark', 'yes'); + return $phpcsFile->numTokens; + } + } + + $phpcsFile->recordMetric($stackPtr, 'Using byte order mark', 'no'); + + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php new file mode 100644 index 00000000..71bcabbb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php @@ -0,0 +1,84 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class EndFileNewlineSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + 'CSS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + // Skip to the end of the file. + $tokens = $phpcsFile->getTokens(); + $stackPtr = ($phpcsFile->numTokens - 1); + + if ($tokens[$stackPtr]['content'] === '') { + $stackPtr--; + } + + $eolCharLen = strlen($phpcsFile->eolChar); + $lastChars = substr($tokens[$stackPtr]['content'], ($eolCharLen * -1)); + if ($lastChars !== $phpcsFile->eolChar) { + $phpcsFile->recordMetric($stackPtr, 'Newline at EOF', 'no'); + + $error = 'File must end with a newline character'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotFound'); + if ($fix === true) { + $phpcsFile->fixer->addNewline($stackPtr); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Newline at EOF', 'yes'); + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php new file mode 100644 index 00000000..3f766075 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php @@ -0,0 +1,91 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class EndFileNoNewlineSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + 'CSS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + // Skip to the end of the file. + $tokens = $phpcsFile->getTokens(); + $stackPtr = ($phpcsFile->numTokens - 1); + + if ($tokens[$stackPtr]['content'] === '') { + --$stackPtr; + } + + $eolCharLen = strlen($phpcsFile->eolChar); + $lastChars = substr($tokens[$stackPtr]['content'], ($eolCharLen * -1)); + if ($lastChars === $phpcsFile->eolChar) { + $error = 'File must not end with a newline character'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + for ($i = $stackPtr; $i > 0; $i--) { + $newContent = rtrim($tokens[$i]['content'], $phpcsFile->eolChar); + $phpcsFile->fixer->replaceToken($i, $newContent); + + if ($newContent !== '') { + break; + } + } + + $phpcsFile->fixer->endChangeset(); + } + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php new file mode 100644 index 00000000..8f597dfd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php @@ -0,0 +1,62 @@ + + * @copyright 2019 Matthew Peveler + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ExecutableFileSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $filename = $phpcsFile->getFilename(); + + if ($filename !== 'STDIN') { + $perms = fileperms($phpcsFile->getFilename()); + if (($perms & 0x0040) !== 0 || ($perms & 0x0008) !== 0 || ($perms & 0x0001) !== 0) { + $error = 'A PHP file should not be executable; found file permissions set to %s'; + $data = [substr(sprintf('%o', $perms), -4)]; + $phpcsFile->addError($error, 0, 'Executable', $data); + } + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php new file mode 100644 index 00000000..d90b8930 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php @@ -0,0 +1,79 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class InlineHTMLSniff implements Sniff +{ + + /** + * List of supported BOM definitions. + * + * Use encoding names as keys and hex BOM representations as values. + * + * @var array + */ + protected $bomDefinitions = [ + 'UTF-8' => 'efbbbf', + 'UTF-16 (BE)' => 'feff', + 'UTF-16 (LE)' => 'fffe', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_INLINE_HTML]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + // Allow a byte-order mark. + $tokens = $phpcsFile->getTokens(); + foreach ($this->bomDefinitions as $expectedBomHex) { + $bomByteLength = (strlen($expectedBomHex) / 2); + $htmlBomHex = bin2hex(substr($tokens[0]['content'], 0, $bomByteLength)); + if ($htmlBomHex === $expectedBomHex && strlen($tokens[0]['content']) === $bomByteLength) { + return; + } + } + + // Ignore shebang lines. + $tokens = $phpcsFile->getTokens(); + if (substr($tokens[$stackPtr]['content'], 0, 2) === '#!') { + return; + } + + $error = 'PHP files must only contain PHP code'; + $phpcsFile->addError($error, $stackPtr, 'Found'); + + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php new file mode 100644 index 00000000..1814b555 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php @@ -0,0 +1,148 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class LineEndingsSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + 'CSS', + ]; + + /** + * The valid EOL character. + * + * @var string + */ + public $eolChar = '\n'; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $found = $phpcsFile->eolChar; + $found = str_replace("\n", '\n', $found); + $found = str_replace("\r", '\r', $found); + + $phpcsFile->recordMetric($stackPtr, 'EOL char', $found); + + if ($found === $this->eolChar) { + // Ignore the rest of the file. + return $phpcsFile->numTokens; + } + + // Check for single line files without an EOL. This is a very special + // case and the EOL char is set to \n when this happens. + if ($found === '\n') { + $tokens = $phpcsFile->getTokens(); + $lastToken = ($phpcsFile->numTokens - 1); + if ($tokens[$lastToken]['line'] === 1 + && $tokens[$lastToken]['content'] !== "\n" + ) { + return $phpcsFile->numTokens; + } + } + + $error = 'End of line character is invalid; expected "%s" but found "%s"'; + $expected = $this->eolChar; + $expected = str_replace("\n", '\n', $expected); + $expected = str_replace("\r", '\r', $expected); + $data = [ + $expected, + $found, + ]; + + // Errors are always reported on line 1, no matter where the first PHP tag is. + $fix = $phpcsFile->addFixableError($error, 0, 'InvalidEOLChar', $data); + + if ($fix === true) { + $tokens = $phpcsFile->getTokens(); + switch ($this->eolChar) { + case '\n': + $eolChar = "\n"; + break; + case '\r': + $eolChar = "\r"; + break; + case '\r\n': + $eolChar = "\r\n"; + break; + default: + $eolChar = $this->eolChar; + break; + } + + for ($i = 0; $i < $phpcsFile->numTokens; $i++) { + if (isset($tokens[($i + 1)]) === true + && $tokens[($i + 1)]['line'] <= $tokens[$i]['line'] + ) { + continue; + } + + // Token is the last on a line. + if (isset($tokens[$i]['orig_content']) === true) { + $tokenContent = $tokens[$i]['orig_content']; + } else { + $tokenContent = $tokens[$i]['content']; + } + + if ($tokenContent === '') { + // Special case for JS/CSS close tag. + continue; + } + + $newContent = rtrim($tokenContent, "\r\n"); + $newContent .= $eolChar; + if ($tokenContent !== $newContent) { + $phpcsFile->fixer->replaceToken($i, $newContent); + } + }//end for + }//end if + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php new file mode 100644 index 00000000..a65baf76 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php @@ -0,0 +1,201 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class LineLengthSniff implements Sniff +{ + + /** + * The limit that the length of a line should not exceed. + * + * @var integer + */ + public $lineLimit = 80; + + /** + * The limit that the length of a line must not exceed. + * + * Set to zero (0) to disable. + * + * @var integer + */ + public $absoluteLineLimit = 100; + + /** + * Whether or not to ignore trailing comments. + * + * This has the effect of also ignoring all lines + * that only contain comments. + * + * @var boolean + */ + public $ignoreComments = false; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + for ($i = 1; $i < $phpcsFile->numTokens; $i++) { + if ($tokens[$i]['column'] === 1) { + $this->checkLineLength($phpcsFile, $tokens, $i); + } + } + + $this->checkLineLength($phpcsFile, $tokens, $i); + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + + /** + * Checks if a line is too long. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $tokens The token stack. + * @param int $stackPtr The first token on the next line. + * + * @return void + */ + protected function checkLineLength($phpcsFile, $tokens, $stackPtr) + { + // The passed token is the first on the line. + $stackPtr--; + + if ($tokens[$stackPtr]['column'] === 1 + && $tokens[$stackPtr]['length'] === 0 + ) { + // Blank line. + return; + } + + if ($tokens[$stackPtr]['column'] !== 1 + && $tokens[$stackPtr]['content'] === $phpcsFile->eolChar + ) { + $stackPtr--; + } + + $onlyComment = false; + if (isset(Tokens::$commentTokens[$tokens[$stackPtr]['code']]) === true) { + $prevNonWhiteSpace = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$stackPtr]['line'] !== $tokens[$prevNonWhiteSpace]['line']) { + $onlyComment = true; + } + } + + if ($onlyComment === true + && isset(Tokens::$phpcsCommentTokens[$tokens[$stackPtr]['code']]) === true + ) { + // Ignore PHPCS annotation comments that are on a line by themselves. + return; + } + + $lineLength = ($tokens[$stackPtr]['column'] + $tokens[$stackPtr]['length'] - 1); + + if ($this->ignoreComments === true + && isset(Tokens::$commentTokens[$tokens[$stackPtr]['code']]) === true + ) { + // Trailing comments are being ignored in line length calculations. + if ($onlyComment === true) { + // The comment is the only thing on the line, so no need to check length. + return; + } + + $lineLength -= $tokens[$stackPtr]['length']; + } + + // Record metrics for common line length groupings. + if ($lineLength <= 80) { + $phpcsFile->recordMetric($stackPtr, 'Line length', '80 or less'); + } else if ($lineLength <= 120) { + $phpcsFile->recordMetric($stackPtr, 'Line length', '81-120'); + } else if ($lineLength <= 150) { + $phpcsFile->recordMetric($stackPtr, 'Line length', '121-150'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Line length', '151 or more'); + } + + if ($onlyComment === true) { + // If this is a long comment, check if it can be broken up onto multiple lines. + // Some comments contain unbreakable strings like URLs and so it makes sense + // to ignore the line length in these cases if the URL would be longer than the max + // line length once you indent it to the correct level. + if ($lineLength > $this->lineLimit) { + $oldLength = strlen($tokens[$stackPtr]['content']); + $newLength = strlen(ltrim($tokens[$stackPtr]['content'], "/#\t ")); + $indent = (($tokens[$stackPtr]['column'] - 1) + ($oldLength - $newLength)); + + $nonBreakingLength = $tokens[$stackPtr]['length']; + + $space = strrpos($tokens[$stackPtr]['content'], ' '); + if ($space !== false) { + $nonBreakingLength -= ($space + 1); + } + + if (($nonBreakingLength + $indent) > $this->lineLimit) { + return; + } + } + }//end if + + if ($this->absoluteLineLimit > 0 + && $lineLength > $this->absoluteLineLimit + ) { + $data = [ + $this->absoluteLineLimit, + $lineLength, + ]; + + $error = 'Line exceeds maximum limit of %s characters; contains %s characters'; + $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); + } else if ($lineLength > $this->lineLimit) { + $data = [ + $this->lineLimit, + $lineLength, + ]; + + $warning = 'Line exceeds %s characters; contains %s characters'; + $phpcsFile->addWarning($warning, $stackPtr, 'TooLong', $data); + } + + }//end checkLineLength() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php new file mode 100644 index 00000000..1773cb8a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php @@ -0,0 +1,70 @@ + + * @copyright 2010-2014 Andy Grunwald + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class LowercasedFilenameSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $filename = $phpcsFile->getFilename(); + if ($filename === 'STDIN') { + return $phpcsFile->numTokens; + } + + $filename = basename($filename); + $lowercaseFilename = strtolower($filename); + if ($filename !== $lowercaseFilename) { + $data = [ + $filename, + $lowercaseFilename, + ]; + $error = 'Filename "%s" doesn\'t match the expected filename "%s"'; + $phpcsFile->addError($error, $stackPtr, 'NotFound', $data); + $phpcsFile->recordMetric($stackPtr, 'Lowercase filename', 'no'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Lowercase filename', 'yes'); + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php new file mode 100644 index 00000000..e328e744 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php @@ -0,0 +1,57 @@ + + * @copyright 2010-2014 Andy Grunwald + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class OneClassPerFileSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_CLASS]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + $start = ($stackPtr + 1); + if (isset($tokens[$stackPtr]['scope_closer']) === true) { + $start = ($tokens[$stackPtr]['scope_closer'] + 1); + } + + $nextClass = $phpcsFile->findNext($this->register(), $start); + if ($nextClass !== false) { + $error = 'Only one class is allowed in a file'; + $phpcsFile->addError($error, $nextClass, 'MultipleFound'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php new file mode 100644 index 00000000..34211f2f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php @@ -0,0 +1,57 @@ + + * @copyright 2010-2014 Andy Grunwald + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class OneInterfacePerFileSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_INTERFACE]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + $start = ($stackPtr + 1); + if (isset($tokens[$stackPtr]['scope_closer']) === true) { + $start = ($tokens[$stackPtr]['scope_closer'] + 1); + } + + $nextInterface = $phpcsFile->findNext($this->register(), $start); + if ($nextInterface !== false) { + $error = 'Only one interface is allowed in a file'; + $phpcsFile->addError($error, $nextInterface, 'MultipleFound'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php new file mode 100644 index 00000000..459c5d1a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php @@ -0,0 +1,62 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class OneObjectStructurePerFileSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + $start = ($stackPtr + 1); + if (isset($tokens[$stackPtr]['scope_closer']) === true) { + $start = ($tokens[$stackPtr]['scope_closer'] + 1); + } + + $nextClass = $phpcsFile->findNext($this->register(), $start); + if ($nextClass !== false) { + $error = 'Only one object structure is allowed in a file'; + $phpcsFile->addError($error, $nextClass, 'MultipleFound'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php new file mode 100644 index 00000000..309383fc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php @@ -0,0 +1,57 @@ + + * @copyright 2010-2014 Alexander Obuhovich + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class OneTraitPerFileSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_TRAIT]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + $start = ($stackPtr + 1); + if (isset($tokens[$stackPtr]['scope_closer']) === true) { + $start = ($tokens[$stackPtr]['scope_closer'] + 1); + } + + $nextClass = $phpcsFile->findNext($this->register(), $start); + if ($nextClass !== false) { + $error = 'Only one trait is allowed in a file'; + $phpcsFile->addError($error, $nextClass, 'MultipleFound'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php new file mode 100644 index 00000000..750fdabc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php @@ -0,0 +1,105 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DisallowMultipleStatementsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_SEMICOLON]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $fixable = true; + $prev = $stackPtr; + + do { + $prev = $phpcsFile->findPrevious([T_SEMICOLON, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_PHPCS_IGNORE], ($prev - 1)); + if ($prev === false + || $tokens[$prev]['code'] === T_OPEN_TAG + || $tokens[$prev]['code'] === T_OPEN_TAG_WITH_ECHO + ) { + $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no'); + return; + } + + if ($tokens[$prev]['code'] === T_PHPCS_IGNORE) { + $fixable = false; + } + } while ($tokens[$prev]['code'] === T_PHPCS_IGNORE); + + // Ignore multiple statements in a FOR condition. + foreach ([$stackPtr, $prev] as $checkToken) { + if (isset($tokens[$checkToken]['nested_parenthesis']) === true) { + foreach ($tokens[$checkToken]['nested_parenthesis'] as $bracket) { + if (isset($tokens[$bracket]['parenthesis_owner']) === false) { + // Probably a closure sitting inside a function call. + continue; + } + + $owner = $tokens[$bracket]['parenthesis_owner']; + if ($tokens[$owner]['code'] === T_FOR) { + return; + } + } + } + } + + if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) { + $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'yes'); + + $error = 'Each PHP statement must be on a line by itself'; + $code = 'SameLine'; + if ($fixable === false) { + $phpcsFile->addError($error, $stackPtr, $code); + return; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addNewline($prev); + if ($tokens[($prev + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($prev + 1), ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no'); + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php new file mode 100644 index 00000000..8916659a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php @@ -0,0 +1,426 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class MultipleStatementAlignmentSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * If true, an error will be thrown; otherwise a warning. + * + * @var boolean + */ + public $error = false; + + /** + * The maximum amount of padding before the alignment is ignored. + * + * If the amount of padding required to align this assignment with the + * surrounding assignments exceeds this number, the assignment will be + * ignored and no errors or warnings will be thrown. + * + * @var integer + */ + public $maxPadding = 1000; + + /** + * Controls which side of the assignment token is used for alignment. + * + * @var boolean + */ + public $alignAtEnd = true; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + $tokens = Tokens::$assignmentTokens; + unset($tokens[T_DOUBLE_ARROW]); + return $tokens; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $lastAssign = $this->checkAlignment($phpcsFile, $stackPtr); + return ($lastAssign + 1); + + }//end process() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 $end The token where checking should end. + * If NULL, the entire file will be checked. + * + * @return int + */ + public function checkAlignment($phpcsFile, $stackPtr, $end=null) + { + $tokens = $phpcsFile->getTokens(); + + // Ignore assignments used in a condition, like an IF or FOR or closure param defaults. + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + // If the parenthesis is on the same line as the assignment, + // then it should be ignored as it is specifically being grouped. + $parens = $tokens[$stackPtr]['nested_parenthesis']; + $lastParen = array_pop($parens); + if ($tokens[$lastParen]['line'] === $tokens[$stackPtr]['line']) { + return $stackPtr; + } + + foreach ($tokens[$stackPtr]['nested_parenthesis'] as $start => $end) { + if (isset($tokens[$start]['parenthesis_owner']) === true) { + return $stackPtr; + } + } + } + + $assignments = []; + $prevAssign = null; + $lastLine = $tokens[$stackPtr]['line']; + $maxPadding = null; + $stopped = null; + $lastCode = $stackPtr; + $lastSemi = null; + $arrayEnd = null; + + if ($end === null) { + $end = $phpcsFile->numTokens; + } + + $find = Tokens::$assignmentTokens; + unset($find[T_DOUBLE_ARROW]); + + $scopes = Tokens::$scopeOpeners; + unset($scopes[T_CLOSURE]); + unset($scopes[T_ANON_CLASS]); + unset($scopes[T_OBJECT]); + + for ($assign = $stackPtr; $assign < $end; $assign++) { + if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) { + // Statement is in a different context, so the block is over. + break; + } + + if (isset($tokens[$assign]['scope_opener']) === true + && $tokens[$assign]['level'] === $tokens[$stackPtr]['level'] + ) { + if (isset($scopes[$tokens[$assign]['code']]) === true) { + // This type of scope indicates that the assignment block is over. + break; + } + + // Skip over the scope block because it is seen as part of the assignment block, + // but also process any assignment blocks that are inside as well. + $nextAssign = $phpcsFile->findNext($find, ($assign + 1), ($tokens[$assign]['scope_closer'] - 1)); + if ($nextAssign !== false) { + $assign = $this->checkAlignment($phpcsFile, $nextAssign); + } else { + $assign = $tokens[$assign]['scope_closer']; + } + + $lastCode = $assign; + continue; + } + + if ($assign === $arrayEnd) { + $arrayEnd = null; + } + + if (isset($find[$tokens[$assign]['code']]) === false) { + // A blank line indicates that the assignment block has ended. + if (isset(Tokens::$emptyTokens[$tokens[$assign]['code']]) === false + && ($tokens[$assign]['line'] - $tokens[$lastCode]['line']) > 1 + && $tokens[$assign]['level'] === $tokens[$stackPtr]['level'] + && $arrayEnd === null + ) { + break; + } + + if ($tokens[$assign]['code'] === T_CLOSE_TAG) { + // Breaking out of PHP ends the assignment block. + break; + } + + if ($tokens[$assign]['code'] === T_OPEN_SHORT_ARRAY + && isset($tokens[$assign]['bracket_closer']) === true + ) { + $arrayEnd = $tokens[$assign]['bracket_closer']; + } + + if ($tokens[$assign]['code'] === T_ARRAY + && isset($tokens[$assign]['parenthesis_opener']) === true + && isset($tokens[$tokens[$assign]['parenthesis_opener']]['parenthesis_closer']) === true + ) { + $arrayEnd = $tokens[$tokens[$assign]['parenthesis_opener']]['parenthesis_closer']; + } + + if (isset(Tokens::$emptyTokens[$tokens[$assign]['code']]) === false) { + $lastCode = $assign; + + if ($tokens[$assign]['code'] === T_SEMICOLON) { + if ($tokens[$assign]['conditions'] === $tokens[$stackPtr]['conditions']) { + if ($lastSemi !== null && $prevAssign !== null && $lastSemi > $prevAssign) { + // This statement did not have an assignment operator in it. + break; + } else { + $lastSemi = $assign; + } + } else if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) { + // Statement is in a different context, so the block is over. + break; + } + } + }//end if + + continue; + } else if ($assign !== $stackPtr && $tokens[$assign]['line'] === $lastLine) { + // Skip multiple assignments on the same line. We only need to + // try and align the first assignment. + continue; + }//end if + + if ($assign !== $stackPtr) { + if ($tokens[$assign]['level'] > $tokens[$stackPtr]['level']) { + // Has to be nested inside the same conditions as the first assignment. + // We've gone one level down, so process this new block. + $assign = $this->checkAlignment($phpcsFile, $assign); + $lastCode = $assign; + continue; + } else if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) { + // We've gone one level up, so the block we are processing is done. + break; + } else if ($arrayEnd !== null) { + // Assignments inside arrays are not part of + // the original block, so process this new block. + $assign = ($this->checkAlignment($phpcsFile, $assign, $arrayEnd) - 1); + $arrayEnd = null; + $lastCode = $assign; + continue; + } + + // Make sure it is not assigned inside a condition (eg. IF, FOR). + if (isset($tokens[$assign]['nested_parenthesis']) === true) { + // If the parenthesis is on the same line as the assignment, + // then it should be ignored as it is specifically being grouped. + $parens = $tokens[$assign]['nested_parenthesis']; + $lastParen = array_pop($parens); + if ($tokens[$lastParen]['line'] === $tokens[$assign]['line']) { + break; + } + + foreach ($tokens[$assign]['nested_parenthesis'] as $start => $end) { + if (isset($tokens[$start]['parenthesis_owner']) === true) { + break(2); + } + } + } + }//end if + + $var = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($assign - 1), + null, + true + ); + + // Make sure we wouldn't break our max padding length if we + // aligned with this statement, or they wouldn't break the max + // padding length if they aligned with us. + $varEnd = $tokens[($var + 1)]['column']; + $assignLen = $tokens[$assign]['length']; + if ($this->alignAtEnd !== true) { + $assignLen = 1; + } + + if ($assign !== $stackPtr) { + if ($prevAssign === null) { + // Processing an inner block but no assignments found. + break; + } + + if (($varEnd + 1) > $assignments[$prevAssign]['assign_col']) { + $padding = 1; + $assignColumn = ($varEnd + 1); + } else { + $padding = ($assignments[$prevAssign]['assign_col'] - $varEnd + $assignments[$prevAssign]['assign_len'] - $assignLen); + if ($padding <= 0) { + $padding = 1; + } + + if ($padding > $this->maxPadding) { + $stopped = $assign; + break; + } + + $assignColumn = ($varEnd + $padding); + }//end if + + if (($assignColumn + $assignLen) > ($assignments[$maxPadding]['assign_col'] + $assignments[$maxPadding]['assign_len'])) { + $newPadding = ($varEnd - $assignments[$maxPadding]['var_end'] + $assignLen - $assignments[$maxPadding]['assign_len'] + 1); + if ($newPadding > $this->maxPadding) { + $stopped = $assign; + break; + } else { + // New alignment settings for previous assignments. + foreach ($assignments as $i => $data) { + if ($i === $assign) { + break; + } + + $newPadding = ($varEnd - $data['var_end'] + $assignLen - $data['assign_len'] + 1); + $assignments[$i]['expected'] = $newPadding; + $assignments[$i]['assign_col'] = ($data['var_end'] + $newPadding); + } + + $padding = 1; + $assignColumn = ($varEnd + 1); + } + } else if ($padding > $assignments[$maxPadding]['expected']) { + $maxPadding = $assign; + }//end if + } else { + $padding = 1; + $assignColumn = ($varEnd + 1); + $maxPadding = $assign; + }//end if + + $found = 0; + if ($tokens[($var + 1)]['code'] === T_WHITESPACE) { + $found = $tokens[($var + 1)]['length']; + if ($found === 0) { + // This means a newline was found. + $found = 1; + } + } + + $assignments[$assign] = [ + 'var_end' => $varEnd, + 'assign_len' => $assignLen, + 'assign_col' => $assignColumn, + 'expected' => $padding, + 'found' => $found, + ]; + + $lastLine = $tokens[$assign]['line']; + $prevAssign = $assign; + }//end for + + if (empty($assignments) === true) { + return $stackPtr; + } + + $numAssignments = count($assignments); + + $errorGenerated = false; + foreach ($assignments as $assignment => $data) { + if ($data['found'] === $data['expected']) { + continue; + } + + $expectedText = $data['expected'].' space'; + if ($data['expected'] !== 1) { + $expectedText .= 's'; + } + + if ($data['found'] === null) { + $foundText = 'a new line'; + } else { + $foundText = $data['found'].' space'; + if ($data['found'] !== 1) { + $foundText .= 's'; + } + } + + if ($numAssignments === 1) { + $type = 'Incorrect'; + $error = 'Equals sign not aligned correctly; expected %s but found %s'; + } else { + $type = 'NotSame'; + $error = 'Equals sign not aligned with surrounding assignments; expected %s but found %s'; + } + + $errorData = [ + $expectedText, + $foundText, + ]; + + if ($this->error === true) { + $fix = $phpcsFile->addFixableError($error, $assignment, $type, $errorData); + } else { + $fix = $phpcsFile->addFixableWarning($error, $assignment, $type.'Warning', $errorData); + } + + $errorGenerated = true; + + if ($fix === true && $data['found'] !== null) { + $newContent = str_repeat(' ', $data['expected']); + if ($data['found'] === 0) { + $phpcsFile->fixer->addContentBefore($assignment, $newContent); + } else { + $phpcsFile->fixer->replaceToken(($assignment - 1), $newContent); + } + } + }//end foreach + + if ($numAssignments > 1) { + if ($errorGenerated === true) { + $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'no'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'yes'); + } + } + + if ($stopped !== null) { + return $this->checkAlignment($phpcsFile, $stopped); + } else { + return $assign; + } + + }//end checkAlignment() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php new file mode 100644 index 00000000..f7644df0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php @@ -0,0 +1,61 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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. + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class NoSpaceAfterCastSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$castTokens; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + return; + } + + $error = 'A cast statement must not be followed by a space'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceFound'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php new file mode 100644 index 00000000..d831ea7d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php @@ -0,0 +1,161 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class SpaceAfterCastSniff implements Sniff +{ + + /** + * The number of spaces desired after a cast token. + * + * @var integer + */ + public $spacing = 1; + + /** + * Allow newlines instead of spaces. + * + * @var boolean + */ + public $ignoreNewlines = false; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$castTokens; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $this->spacing = (int) $this->spacing; + $pluralizeSpace = 's'; + if ($this->spacing === 1) { + $pluralizeSpace = ''; + } + + if ($tokens[$stackPtr]['code'] === T_BINARY_CAST + && $tokens[$stackPtr]['content'] === 'b' + ) { + // You can't replace a space after this type of binary casting. + return; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + return; + } + + if ($this->ignoreNewlines === true + && $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line'] + ) { + $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', 'newline'); + return; + } + + if ($this->spacing === 0 && $nextNonEmpty === ($stackPtr + 1)) { + $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', 0); + return; + } + + $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, + $pluralizeSpace, + ]; + $phpcsFile->addError($error, $stackPtr, 'CommentFound', $data); + + if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', $tokens[($stackPtr + 1)]['length']); + } else { + $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', 0); + } + + return; + } + + $found = 0; + if ($tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) { + $found = 'newline'; + } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $found = $tokens[($stackPtr + 1)]['length']; + } + + $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', $found); + + if ($found === $this->spacing) { + return; + } + + $error = 'Expected %s space%s after cast statement; %s found'; + $data = [ + $this->spacing, + $pluralizeSpace, + $found, + ]; + + $errorCode = 'TooMuchSpace'; + if ($this->spacing !== 0) { + if ($found === 0) { + $errorCode = 'NoSpace'; + } else if ($found !== 'newline' && $found < $this->spacing) { + $errorCode = 'TooLittleSpace'; + } + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); + + if ($fix === true) { + $padding = str_repeat(' ', $this->spacing); + if ($found === 0) { + $phpcsFile->fixer->addContent($stackPtr, $padding); + } else { + $phpcsFile->fixer->beginChangeset(); + $start = ($stackPtr + 1); + + if ($this->spacing > 0) { + $phpcsFile->fixer->replaceToken($start, $padding); + ++$start; + } + + for ($i = $start; $i < $nextNonWhitespace; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php new file mode 100644 index 00000000..a1a6d093 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php @@ -0,0 +1,143 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class SpaceAfterNotSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * The number of spaces desired after the NOT operator. + * + * @var integer + */ + public $spacing = 1; + + /** + * Allow newlines instead of spaces. + * + * @var boolean + */ + public $ignoreNewlines = false; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_BOOLEAN_NOT]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $this->spacing = (int) $this->spacing; + $pluralizeSpace = 's'; + if ($this->spacing === 1) { + $pluralizeSpace = ''; + } + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + return; + } + + if ($this->ignoreNewlines === true + && $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line'] + ) { + return; + } + + if ($this->spacing === 0 && $nextNonEmpty === ($stackPtr + 1)) { + return; + } + + $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, + $pluralizeSpace, + ]; + $phpcsFile->addError($error, $stackPtr, 'CommentFound', $data); + return; + } + + $found = 0; + if ($tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) { + $found = 'newline'; + } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $found = $tokens[($stackPtr + 1)]['length']; + } + + if ($found === $this->spacing) { + return; + } + + $error = 'Expected %s space%s after NOT operator; %s found'; + $data = [ + $this->spacing, + $pluralizeSpace, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->spacing); + if ($found === 0) { + $phpcsFile->fixer->addContent($stackPtr, $padding); + } else { + $phpcsFile->fixer->beginChangeset(); + $start = ($stackPtr + 1); + + if ($this->spacing > 0) { + $phpcsFile->fixer->replaceToken($start, $padding); + ++$start; + } + + for ($i = $start; $i < $nextNonWhitespace; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php new file mode 100644 index 00000000..96082e3f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php @@ -0,0 +1,73 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class SpaceBeforeCastSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$castTokens; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if ($tokens[$stackPtr]['column'] === 1) { + return; + } + + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { + $error = 'A cast statement must be preceded by a single space'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpace'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + } + + $phpcsFile->recordMetric($stackPtr, 'Spacing before cast statement', 0); + return; + } + + $phpcsFile->recordMetric($stackPtr, 'Spacing before cast statement', $tokens[($stackPtr - 1)]['length']); + + if ($tokens[($stackPtr - 1)]['column'] !== 1 && $tokens[($stackPtr - 1)]['length'] !== 1) { + $error = 'A cast statement must be preceded by a single space'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpace'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php new file mode 100644 index 00000000..76c4a630 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php @@ -0,0 +1,141 @@ + + * @copyright 2009-2014 Florian Grandel + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class CallTimePassByReferenceSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_STRING, + T_VARIABLE, + T_ANON_CLASS, + T_PARENT, + T_SELF, + T_STATIC, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $findTokens = Tokens::$emptyTokens; + $findTokens[] = T_BITWISE_AND; + + $prev = $phpcsFile->findPrevious($findTokens, ($stackPtr - 1), null, true); + + // Skip tokens that are the names of functions + // within their definitions. For example: function myFunction... + // "myFunction" is T_STRING but we should skip because it is not a + // function or method *call*. + $prevCode = $tokens[$prev]['code']; + if ($prevCode === T_FUNCTION) { + return; + } + + // If the next non-whitespace token after the function or method call + // is not an opening parenthesis then it cant really be a *call*. + $functionName = $stackPtr; + $openBracket = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($functionName + 1), + null, + true + ); + + if ($openBracket === false || $tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { + return; + } + + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + + $nextSeparator = $openBracket; + $find = [ + T_VARIABLE, + T_OPEN_SHORT_ARRAY, + ]; + + while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { + if ($tokens[$nextSeparator]['code'] === T_OPEN_SHORT_ARRAY) { + $nextSeparator = $tokens[$nextSeparator]['bracket_closer']; + continue; + } + + // Make sure the variable belongs directly to this function call + // and is not inside a nested function call or array. + $brackets = $tokens[$nextSeparator]['nested_parenthesis']; + $lastBracket = array_pop($brackets); + if ($lastBracket !== $closeBracket) { + continue; + } + + $tokenBefore = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($nextSeparator - 1), + null, + true + ); + + if ($tokens[$tokenBefore]['code'] === T_BITWISE_AND) { + if ($phpcsFile->isReference($tokenBefore) === false) { + continue; + } + + // We also want to ignore references used in assignment + // operations passed as function arguments, but isReference() + // sees them as valid references (which they are). + $tokenBefore = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($tokenBefore - 1), + null, + true + ); + + if (isset(Tokens::$assignmentTokens[$tokens[$tokenBefore]['code']]) === true) { + continue; + } + + // T_BITWISE_AND represents a pass-by-reference. + $error = 'Call-time pass-by-reference calls are prohibited'; + $phpcsFile->addError($error, $tokenBefore, 'NotAllowed'); + }//end if + }//end while + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php new file mode 100644 index 00000000..bf93c553 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php @@ -0,0 +1,197 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class FunctionCallArgumentSpacingSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return[ + T_STRING, + T_ISSET, + T_UNSET, + T_SELF, + T_STATIC, + T_PARENT, + T_VARIABLE, + T_CLOSE_CURLY_BRACKET, + T_CLOSE_PARENTHESIS, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Skip tokens that are the names of functions or classes + // within their definitions. For example: + // function myFunction... + // "myFunction" is T_STRING but we should skip because it is not a + // function or method *call*. + $functionName = $stackPtr; + $ignoreTokens = Tokens::$emptyTokens; + $ignoreTokens[] = T_BITWISE_AND; + $functionKeyword = $phpcsFile->findPrevious($ignoreTokens, ($stackPtr - 1), null, true); + if ($tokens[$functionKeyword]['code'] === T_FUNCTION || $tokens[$functionKeyword]['code'] === T_CLASS) { + return; + } + + if ($tokens[$stackPtr]['code'] === T_CLOSE_CURLY_BRACKET + && isset($tokens[$stackPtr]['scope_condition']) === true + ) { + // Not a function call. + return; + } + + // If the next non-whitespace token after the function or method call + // is not an opening parenthesis then it can't really be a *call*. + $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($functionName + 1), null, true); + if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { + return; + } + + $this->checkSpacing($phpcsFile, $stackPtr, $openBracket); + + }//end process() + + + /** + * Checks the spacing around commas. + * + * @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 $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * + * @return void + */ + public function checkSpacing(File $phpcsFile, $stackPtr, $openBracket) + { + $tokens = $phpcsFile->getTokens(); + + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + $nextSeparator = $openBracket; + + $find = [ + T_COMMA, + T_CLOSURE, + T_FN, + T_ANON_CLASS, + T_OPEN_SHORT_ARRAY, + T_MATCH, + ]; + + while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { + if ($tokens[$nextSeparator]['code'] === T_CLOSURE + || $tokens[$nextSeparator]['code'] === T_ANON_CLASS + || $tokens[$nextSeparator]['code'] === T_MATCH + ) { + // Skip closures, anon class declarations and match control structures. + $nextSeparator = $tokens[$nextSeparator]['scope_closer']; + continue; + } else if ($tokens[$nextSeparator]['code'] === T_FN) { + // Skip arrow functions, but don't skip the arrow function closer as it is likely to + // be the comma separating it from the next function call argument (or the parenthesis closer). + $nextSeparator = ($tokens[$nextSeparator]['scope_closer'] - 1); + continue; + } else if ($tokens[$nextSeparator]['code'] === T_OPEN_SHORT_ARRAY) { + // Skips arrays using short notation. + $nextSeparator = $tokens[$nextSeparator]['bracket_closer']; + continue; + } + + // Make sure the comma or variable belongs directly to this function call, + // and is not inside a nested function call or array. + $brackets = $tokens[$nextSeparator]['nested_parenthesis']; + $lastBracket = array_pop($brackets); + if ($lastBracket !== $closeBracket) { + continue; + } + + if ($tokens[$nextSeparator]['code'] === T_COMMA) { + if ($tokens[($nextSeparator - 1)]['code'] === T_WHITESPACE) { + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextSeparator - 2), null, true); + if (isset(Tokens::$heredocTokens[$tokens[$prev]['code']]) === false) { + $error = 'Space found before comma in argument list'; + $fix = $phpcsFile->addFixableError($error, $nextSeparator, 'SpaceBeforeComma'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[$prev]['line'] !== $tokens[$nextSeparator]['line']) { + $phpcsFile->fixer->addContent($prev, ','); + $phpcsFile->fixer->replaceToken($nextSeparator, ''); + } else { + $phpcsFile->fixer->replaceToken(($nextSeparator - 1), ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + + if ($tokens[($nextSeparator + 1)]['code'] !== T_WHITESPACE) { + // 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 + // each argument on a newline, which is valid, so ignore it. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextSeparator + 1), null, true); + if ($tokens[$next]['line'] === $tokens[$nextSeparator]['line']) { + $space = $tokens[($nextSeparator + 1)]['length']; + if ($space > 1) { + $error = 'Expected 1 space after comma in argument list; %s found'; + $data = [$space]; + $fix = $phpcsFile->addFixableError($error, $nextSeparator, 'TooMuchSpaceAfterComma', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($nextSeparator + 1), ' '); + } + } + } + }//end if + }//end if + }//end while + + }//end checkSpacing() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php new file mode 100644 index 00000000..be96f585 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php @@ -0,0 +1,225 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class OpeningFunctionBraceBsdAllmanSniff implements Sniff +{ + + /** + * Should this sniff check function braces? + * + * @var boolean + */ + public $checkFunctions = true; + + /** + * Should this sniff check closure braces? + * + * @var boolean + */ + public $checkClosures = false; + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + if (($tokens[$stackPtr]['code'] === T_FUNCTION + && (bool) $this->checkFunctions === false) + || ($tokens[$stackPtr]['code'] === T_CLOSURE + && (bool) $this->checkClosures === false) + ) { + return; + } + + $openingBrace = $tokens[$stackPtr]['scope_opener']; + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + } + } + + // Find the end of the function declaration. + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); + + $functionLine = $tokens[$prev]['line']; + $braceLine = $tokens[$openingBrace]['line']; + + $lineDifference = ($braceLine - $functionLine); + + $metricType = 'Function'; + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $metricType = 'Closure'; + } + + if ($lineDifference === 0) { + $error = 'Opening brace should be on a new line'; + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnSameLine'); + if ($fix === true) { + $hasTrailingAnnotation = false; + for ($nextLine = ($openingBrace + 1); $nextLine < $phpcsFile->numTokens; $nextLine++) { + if ($tokens[$openingBrace]['line'] !== $tokens[$nextLine]['line']) { + break; + } + + if (isset(Tokens::$phpcsCommentTokens[$tokens[$nextLine]['code']]) === true) { + $hasTrailingAnnotation = true; + } + } + + $phpcsFile->fixer->beginChangeset(); + $indent = $phpcsFile->findFirstOnLine([], $openingBrace); + + if ($hasTrailingAnnotation === false || $nextLine === false) { + if ($tokens[$indent]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->addContentBefore($openingBrace, $tokens[$indent]['content']); + } + + if ($tokens[($openingBrace - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($openingBrace - 1), ''); + } + + $phpcsFile->fixer->addNewlineBefore($openingBrace); + } else { + $phpcsFile->fixer->replaceToken($openingBrace, ''); + $phpcsFile->fixer->addNewlineBefore($nextLine); + $phpcsFile->fixer->addContentBefore($nextLine, '{'); + + if ($tokens[$indent]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->addContentBefore($nextLine, $tokens[$indent]['content']); + } + } + + $phpcsFile->fixer->endChangeset(); + }//end if + + $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'same line'); + } else if ($lineDifference > 1) { + $error = 'Opening brace should be on the line after the declaration; found %s blank line(s)'; + $data = [($lineDifference - 1)]; + + $prevNonWs = $phpcsFile->findPrevious(T_WHITESPACE, ($openingBrace - 1), $closeBracket, true); + if ($prevNonWs !== $prev) { + // There must be a comment between the end of the function declaration and the open brace. + // Report, but don't fix. + $phpcsFile->addError($error, $openingBrace, 'BraceSpacing', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceSpacing', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = $openingBrace; $i > $prev; $i--) { + if ($tokens[$i]['line'] === $tokens[$openingBrace]['line']) { + if ($tokens[$i]['column'] === 1) { + $phpcsFile->fixer->addNewLineBefore($i); + } + + continue; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + + $ignore = Tokens::$phpcsCommentTokens; + $ignore[] = T_WHITESPACE; + $next = $phpcsFile->findNext($ignore, ($openingBrace + 1), null, true); + if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { + // 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); + } + } + } + + // Only continue checking if the opening brace looks good. + if ($lineDifference !== 1) { + return; + } + + // We need to actually find the first piece of content on this line, + // as if this is a method with tokens before it (public, static etc) + // or an if with an else before it, then we need to start the scope + // checking from there, rather than the current token. + $lineStart = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); + + // The opening brace is on the correct line, now it needs to be + // checked to be correctly indented. + $startColumn = $tokens[$lineStart]['column']; + $braceIndent = $tokens[$openingBrace]['column']; + + if ($braceIndent !== $startColumn) { + $expected = ($startColumn - 1); + $found = ($braceIndent - 1); + + $error = 'Opening brace indented incorrectly; expected %s spaces, found %s'; + $data = [ + $expected, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceIndent', $data); + if ($fix === true) { + $indent = str_repeat(' ', $expected); + if ($found === 0) { + $phpcsFile->fixer->addContentBefore($openingBrace, $indent); + } else { + $phpcsFile->fixer->replaceToken(($openingBrace - 1), $indent); + } + } + }//end if + + $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'new line'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php new file mode 100644 index 00000000..ca259854 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php @@ -0,0 +1,182 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class OpeningFunctionBraceKernighanRitchieSniff implements Sniff +{ + + /** + * Should this sniff check function braces? + * + * @var boolean + */ + public $checkFunctions = true; + + /** + * Should this sniff check closure braces? + * + * @var boolean + */ + public $checkClosures = false; + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + if (($tokens[$stackPtr]['code'] === T_FUNCTION + && (bool) $this->checkFunctions === false) + || ($tokens[$stackPtr]['code'] === T_CLOSURE + && (bool) $this->checkClosures === false) + ) { + return; + } + + $openingBrace = $tokens[$stackPtr]['scope_opener']; + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + } + } + + // Find the end of the function declaration. + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); + + $functionLine = $tokens[$prev]['line']; + $braceLine = $tokens[$openingBrace]['line']; + + $lineDifference = ($braceLine - $functionLine); + + $metricType = 'Function'; + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $metricType = 'Closure'; + } + + if ($lineDifference > 0) { + $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'new line'); + $error = 'Opening brace should be on the same line as the declaration'; + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnNewLine'); + if ($fix === true) { + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($prev, ' {'); + $phpcsFile->fixer->replaceToken($openingBrace, ''); + if ($tokens[($openingBrace + 1)]['code'] === T_WHITESPACE + && $tokens[($openingBrace + 2)]['line'] > $tokens[$openingBrace]['line'] + ) { + // Brace is followed by a new line, so remove it to ensure we don't + // leave behind a blank line at the top of the block. + $phpcsFile->fixer->replaceToken(($openingBrace + 1), ''); + + if ($tokens[($openingBrace - 1)]['code'] === T_WHITESPACE + && $tokens[($openingBrace - 1)]['line'] === $tokens[$openingBrace]['line'] + && $tokens[($openingBrace - 2)]['line'] < $tokens[$openingBrace]['line'] + ) { + // Brace is preceded by indent, so remove it to ensure we don't + // leave behind more indent than is required for the first line. + $phpcsFile->fixer->replaceToken(($openingBrace - 1), ''); + } + } + + $phpcsFile->fixer->endChangeset(); + }//end if + } else { + $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'same line'); + }//end if + + $ignore = Tokens::$phpcsCommentTokens; + $ignore[] = T_WHITESPACE; + $next = $phpcsFile->findNext($ignore, ($openingBrace + 1), null, true); + if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { + // Only throw this error when this is not an empty function. + if ($next !== $tokens[$stackPtr]['scope_closer'] + && $tokens[$next]['code'] !== T_CLOSE_TAG + ) { + $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 continue checking if the opening brace looks good. + if ($lineDifference > 0) { + return; + } + + // We are looking for tabs, even if they have been replaced, because + // we enforce a space here. + if (isset($tokens[($openingBrace - 1)]['orig_content']) === true) { + $spacing = $tokens[($openingBrace - 1)]['orig_content']; + } else { + $spacing = $tokens[($openingBrace - 1)]['content']; + } + + if ($tokens[($openingBrace - 1)]['code'] !== T_WHITESPACE) { + $length = 0; + } else if ($spacing === "\t") { + $length = '\t'; + } else { + $length = strlen($spacing); + } + + if ($length !== 1) { + $error = 'Expected 1 space before opening brace; found %s'; + $data = [$length]; + $fix = $phpcsFile->addFixableError($error, $openingBrace, 'SpaceBeforeBrace', $data); + if ($fix === true) { + if ($length === 0 || $length === '\t') { + $phpcsFile->fixer->addContentBefore($openingBrace, ' '); + } else { + $phpcsFile->fixer->replaceToken(($openingBrace - 1), ' '); + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php new file mode 100644 index 00000000..8cba81da --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php @@ -0,0 +1,117 @@ + + * @author Greg Sherwood + * @copyright 2007-2014 Mayflower GmbH + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class CyclomaticComplexitySniff implements Sniff +{ + + /** + * A complexity higher than this value will throw a warning. + * + * @var integer + */ + public $complexity = 10; + + /** + * A complexity higher than this value will throw an error. + * + * @var integer + */ + public $absoluteComplexity = 20; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Ignore abstract methods. + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + // Detect start and end of this function definition. + $start = $tokens[$stackPtr]['scope_opener']; + $end = $tokens[$stackPtr]['scope_closer']; + + // Predicate nodes for PHP. + $find = [ + T_CASE => true, + T_DEFAULT => true, + T_CATCH => true, + T_IF => true, + T_FOR => true, + T_FOREACH => true, + T_WHILE => true, + T_ELSEIF => true, + T_INLINE_THEN => true, + T_COALESCE => true, + T_COALESCE_EQUAL => true, + T_MATCH_ARROW => true, + T_NULLSAFE_OBJECT_OPERATOR => true, + ]; + + $complexity = 1; + + // Iterate from start to end and count predicate nodes. + for ($i = ($start + 1); $i < $end; $i++) { + if (isset($find[$tokens[$i]['code']]) === true) { + $complexity++; + } + } + + if ($complexity > $this->absoluteComplexity) { + $error = 'Function\'s cyclomatic complexity (%s) exceeds allowed maximum of %s'; + $data = [ + $complexity, + $this->absoluteComplexity, + ]; + $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); + } else if ($complexity > $this->complexity) { + $warning = 'Function\'s cyclomatic complexity (%s) exceeds %s; consider refactoring the function'; + $data = [ + $complexity, + $this->complexity, + ]; + $phpcsFile->addWarning($warning, $stackPtr, 'TooHigh', $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php new file mode 100644 index 00000000..3c086c7f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php @@ -0,0 +1,100 @@ + + * @author Greg Sherwood + * @copyright 2007-2014 Mayflower GmbH + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class NestingLevelSniff implements Sniff +{ + + /** + * A nesting level higher than this value will throw a warning. + * + * @var integer + */ + public $nestingLevel = 5; + + /** + * A nesting level higher than this value will throw an error. + * + * @var integer + */ + public $absoluteNestingLevel = 10; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Ignore abstract methods. + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + // Detect start and end of this function definition. + $start = $tokens[$stackPtr]['scope_opener']; + $end = $tokens[$stackPtr]['scope_closer']; + + $nestingLevel = 0; + + // Find the maximum nesting level of any token in the function. + for ($i = ($start + 1); $i < $end; $i++) { + $level = $tokens[$i]['level']; + if ($nestingLevel < $level) { + $nestingLevel = $level; + } + } + + // We subtract the nesting level of the function itself. + $nestingLevel = ($nestingLevel - $tokens[$stackPtr]['level'] - 1); + + if ($nestingLevel > $this->absoluteNestingLevel) { + $error = 'Function\'s nesting level (%s) exceeds allowed maximum of %s'; + $data = [ + $nestingLevel, + $this->absoluteNestingLevel, + ]; + $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); + } else if ($nestingLevel > $this->nestingLevel) { + $warning = 'Function\'s nesting level (%s) exceeds %s; consider refactoring the function'; + $data = [ + $nestingLevel, + $this->nestingLevel, + ]; + $phpcsFile->addWarning($warning, $stackPtr, 'TooHigh', $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php new file mode 100644 index 00000000..145dddf7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php @@ -0,0 +1,60 @@ + + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class AbstractClassNamePrefixSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_CLASS]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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) + { + if ($phpcsFile->getClassProperties($stackPtr)['is_abstract'] === false) { + // This class is not abstract so we don't need to check it. + return; + } + + $className = $phpcsFile->getDeclarationName($stackPtr); + if ($className === null) { + // We are not interested in anonymous classes. + return; + } + + $prefix = substr($className, 0, 8); + if (strtolower($prefix) !== 'abstract') { + $phpcsFile->addError('Abstract class names must be prefixed with "Abstract"; found "%s"', $stackPtr, 'Missing', [$className]); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php new file mode 100644 index 00000000..ec1cfd00 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php @@ -0,0 +1,223 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; +use PHP_CodeSniffer\Util\Common; +use PHP_CodeSniffer\Util\Tokens; + +class CamelCapsFunctionNameSniff extends AbstractScopeSniff +{ + + /** + * A list of all PHP magic methods. + * + * @var array + */ + protected $magicMethods = [ + 'construct' => true, + 'destruct' => true, + 'call' => true, + 'callstatic' => true, + 'get' => true, + 'set' => true, + 'isset' => true, + 'unset' => true, + 'sleep' => true, + 'wakeup' => true, + 'serialize' => true, + 'unserialize' => true, + 'tostring' => true, + 'invoke' => true, + 'set_state' => true, + 'clone' => true, + 'debuginfo' => true, + ]; + + /** + * A list of all PHP non-magic methods starting with a double underscore. + * + * These come from PHP modules such as SOAPClient. + * + * @var array + */ + protected $methodsDoubleUnderscore = [ + 'dorequest' => true, + 'getcookies' => true, + 'getfunctions' => true, + 'getlastrequest' => true, + 'getlastrequestheaders' => true, + 'getlastresponse' => true, + 'getlastresponseheaders' => true, + 'gettypes' => true, + 'setcookie' => true, + 'setlocation' => true, + 'setsoapheaders' => true, + 'soapcall' => true, + ]; + + /** + * A list of all PHP magic functions. + * + * @var array + */ + protected $magicFunctions = ['autoload' => true]; + + /** + * If TRUE, the string must not have two capital letters next to each other. + * + * @var boolean + */ + public $strict = true; + + + /** + * Constructs a Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff. + */ + public function __construct() + { + parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION], true); + + }//end __construct() + + + /** + * Processes the tokens within the scope. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. + * @param int $stackPtr The position where this token was + * found. + * @param int $currScope The position of the current scope. + * + * @return void + */ + protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + // Determine if this is a function which needs to be examined. + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + $deepestScope = key($conditions); + if ($deepestScope !== $currScope) { + return; + } + + $methodName = $phpcsFile->getDeclarationName($stackPtr); + if ($methodName === null) { + // Ignore closures. + return; + } + + $className = $phpcsFile->getDeclarationName($currScope); + if (isset($className) === false) { + $className = '[Anonymous Class]'; + } + + $errorData = [$className.'::'.$methodName]; + + $methodNameLc = strtolower($methodName); + $classNameLc = strtolower($className); + + // Is this a magic method. i.e., is prefixed with "__" ? + if (preg_match('|^__[^_]|', $methodName) !== 0) { + $magicPart = substr($methodNameLc, 2); + if (isset($this->magicMethods[$magicPart]) === true + || isset($this->methodsDoubleUnderscore[$magicPart]) === true + ) { + return; + } + + $error = 'Method name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; + $phpcsFile->addError($error, $stackPtr, 'MethodDoubleUnderscore', $errorData); + } + + // PHP4 constructors are allowed to break our rules. + if ($methodNameLc === $classNameLc) { + return; + } + + // PHP4 destructors are allowed to break our rules. + if ($methodNameLc === '_'.$classNameLc) { + return; + } + + // Ignore first underscore in methods prefixed with "_". + $methodName = ltrim($methodName, '_'); + + $methodProps = $phpcsFile->getMethodProperties($stackPtr); + if (Common::isCamelCaps($methodName, false, true, $this->strict) === false) { + if ($methodProps['scope_specified'] === true) { + $error = '%s method name "%s" is not in camel caps format'; + $data = [ + ucfirst($methodProps['scope']), + $errorData[0], + ]; + $phpcsFile->addError($error, $stackPtr, 'ScopeNotCamelCaps', $data); + } else { + $error = 'Method name "%s" is not in camel caps format'; + $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); + } + + $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'no'); + return; + } else { + $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); + } + + }//end processTokenWithinScope() + + + /** + * Processes the tokens outside the scope. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. + * @param int $stackPtr The position where this token was + * found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + $functionName = $phpcsFile->getDeclarationName($stackPtr); + if ($functionName === null) { + // Ignore closures. + return; + } + + $errorData = [$functionName]; + + // Is this a magic function. i.e., it is prefixed with "__". + if (preg_match('|^__[^_]|', $functionName) !== 0) { + $magicPart = strtolower(substr($functionName, 2)); + if (isset($this->magicFunctions[$magicPart]) === true) { + return; + } + + $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; + $phpcsFile->addError($error, $stackPtr, 'FunctionDoubleUnderscore', $errorData); + } + + // Ignore first underscore in functions prefixed with "_". + $functionName = ltrim($functionName, '_'); + + if (Common::isCamelCaps($functionName, false, true, $this->strict) === false) { + $error = 'Function name "%s" is not in camel caps format'; + $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); + $phpcsFile->recordMetric($stackPtr, 'CamelCase function name', 'no'); + } else { + $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); + } + + }//end processTokenOutsideScope() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php new file mode 100644 index 00000000..75fbd226 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php @@ -0,0 +1,163 @@ + + * @author Leif Wickland + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; + +class ConstructorNameSniff extends AbstractScopeSniff +{ + + /** + * The name of the class we are currently checking. + * + * @var string + */ + private $currentClass = ''; + + /** + * A list of functions in the current class. + * + * @var string[] + */ + private $functionList = []; + + + /** + * Constructs the test with the tokens it wishes to listen for. + */ + public function __construct() + { + parent::__construct([T_CLASS, T_ANON_CLASS], [T_FUNCTION], true); + + }//end __construct() + + + /** + * Processes this test when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $currScope A pointer to the start of the scope. + * + * @return void + */ + protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + // Determine if this is a function which needs to be examined. + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + $deepestScope = key($conditions); + if ($deepestScope !== $currScope) { + return; + } + + $className = $phpcsFile->getDeclarationName($currScope); + if (empty($className) === false) { + // Not an anonymous class. + $className = strtolower($className); + } + + if ($className !== $this->currentClass) { + $this->loadFunctionNamesInScope($phpcsFile, $currScope); + $this->currentClass = $className; + } + + $methodName = strtolower($phpcsFile->getDeclarationName($stackPtr)); + + if ($methodName === $className) { + if (in_array('__construct', $this->functionList, true) === false) { + $error = 'PHP4 style constructors are not allowed; use "__construct()" instead'; + $phpcsFile->addError($error, $stackPtr, 'OldStyle'); + } + } else if ($methodName !== '__construct') { + // Not a constructor. + return; + } + + // Stop if the constructor doesn't have a body, like when it is abstract. + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $parentClassName = strtolower($phpcsFile->findExtendedClassName($currScope)); + if ($parentClassName === false) { + return; + } + + $endFunctionIndex = $tokens[$stackPtr]['scope_closer']; + $startIndex = $stackPtr; + while (($doubleColonIndex = $phpcsFile->findNext(T_DOUBLE_COLON, $startIndex, $endFunctionIndex)) !== false) { + if ($tokens[($doubleColonIndex + 1)]['code'] === T_STRING + && strtolower($tokens[($doubleColonIndex + 1)]['content']) === $parentClassName + ) { + $error = 'PHP4 style calls to parent constructors are not allowed; use "parent::__construct()" instead'; + $phpcsFile->addError($error, ($doubleColonIndex + 1), 'OldStyleCall'); + } + + $startIndex = ($doubleColonIndex + 1); + } + + }//end processTokenWithinScope() + + + /** + * Processes a token that is found within the scope that this test is + * listening to. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position in the stack where this + * token was found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + + }//end processTokenOutsideScope() + + + /** + * Extracts all the function names found in the given scope. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. + * @param int $currScope A pointer to the start of the scope. + * + * @return void + */ + protected function loadFunctionNamesInScope(File $phpcsFile, $currScope) + { + $this->functionList = []; + $tokens = $phpcsFile->getTokens(); + + for ($i = ($tokens[$currScope]['scope_opener'] + 1); $i < $tokens[$currScope]['scope_closer']; $i++) { + if ($tokens[$i]['code'] !== T_FUNCTION) { + continue; + } + + $this->functionList[] = trim(strtolower($phpcsFile->getDeclarationName($i))); + + if (isset($tokens[$i]['scope_closer']) !== false) { + // Skip past nested functions and such. + $i = $tokens[$i]['scope_closer']; + } + } + + }//end loadFunctionNamesInScope() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php new file mode 100644 index 00000000..637e036f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php @@ -0,0 +1,54 @@ + + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class InterfaceNameSuffixSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_INTERFACE]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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) + { + $interfaceName = $phpcsFile->getDeclarationName($stackPtr); + if ($interfaceName === null) { + return; + } + + $suffix = substr($interfaceName, -9); + if (strtolower($suffix) !== 'interface') { + $phpcsFile->addError('Interface names must be suffixed with "Interface"; found "%s"', $stackPtr, 'Missing', [$interfaceName]); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php new file mode 100644 index 00000000..cbd9651d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php @@ -0,0 +1,54 @@ + + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class TraitNameSuffixSniff implements Sniff +{ + + + /** + * Registers the tokens that this sniff wants to listen for. + * + * @return array + */ + public function register() + { + return [T_TRAIT]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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) + { + $traitName = $phpcsFile->getDeclarationName($stackPtr); + if ($traitName === null) { + return; + } + + $suffix = substr($traitName, -5); + if (strtolower($suffix) !== 'trait') { + $phpcsFile->addError('Trait names must be suffixed with "Trait"; found "%s"', $stackPtr, 'Missing', [$traitName]); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php new file mode 100644 index 00000000..f62cfe94 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php @@ -0,0 +1,149 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class UpperCaseConstantNameSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_STRING, + T_CONST, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if ($tokens[$stackPtr]['code'] === T_CONST) { + // This is a constant declared with the "const" keyword. + // This may be an OO constant, in which case it could be typed, so we need to + // jump over a potential type to get to the name. + $assignmentOperator = $phpcsFile->findNext([T_EQUAL, T_SEMICOLON], ($stackPtr + 1)); + if ($assignmentOperator === false || $tokens[$assignmentOperator]['code'] !== T_EQUAL) { + // Parse error/live coding. Nothing to do. Rest of loop is moot. + return; + } + + $constant = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($assignmentOperator - 1), ($stackPtr + 1), true); + if ($constant === false) { + return; + } + + $constName = $tokens[$constant]['content']; + + if (strtoupper($constName) !== $constName) { + if (strtolower($constName) === $constName) { + $phpcsFile->recordMetric($constant, 'Constant name case', 'lower'); + } else { + $phpcsFile->recordMetric($constant, 'Constant name case', 'mixed'); + } + + $error = 'Class constants must be uppercase; expected %s but found %s'; + $data = [ + strtoupper($constName), + $constName, + ]; + $phpcsFile->addError($error, $constant, 'ClassConstantNotUpperCase', $data); + } else { + $phpcsFile->recordMetric($constant, 'Constant name case', 'upper'); + } + + return; + }//end if + + // Only interested in define statements now. + if (strtolower($tokens[$stackPtr]['content']) !== 'define') { + return; + } + + // Make sure this is not a method call. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR + || $tokens[$prev]['code'] === T_DOUBLE_COLON + || $tokens[$prev]['code'] === T_NULLSAFE_OBJECT_OPERATOR + ) { + return; + } + + // If the next non-whitespace token after this token + // is not an opening parenthesis then it is not a function call. + $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($openBracket === false) { + return; + } + + // The next non-whitespace token must be the constant name. + $constPtr = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), null, true); + if ($tokens[$constPtr]['code'] !== T_CONSTANT_ENCAPSED_STRING) { + return; + } + + $constName = $tokens[$constPtr]['content']; + + // Check for constants like self::CONSTANT. + $prefix = ''; + $splitPos = strpos($constName, '::'); + if ($splitPos !== false) { + $prefix = substr($constName, 0, ($splitPos + 2)); + $constName = substr($constName, ($splitPos + 2)); + } + + // Strip namespace from constant like /foo/bar/CONSTANT. + $splitPos = strrpos($constName, '\\'); + if ($splitPos !== false) { + $prefix = substr($constName, 0, ($splitPos + 1)); + $constName = substr($constName, ($splitPos + 1)); + } + + if (strtoupper($constName) !== $constName) { + if (strtolower($constName) === $constName) { + $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'lower'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'mixed'); + } + + $error = 'Constants must be uppercase; expected %s but found %s'; + $data = [ + $prefix.strtoupper($constName), + $prefix.$constName, + ]; + $phpcsFile->addError($error, $stackPtr, 'ConstantNotUpperCase', $data); + } else { + $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'upper'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php new file mode 100644 index 00000000..f3c56b58 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php @@ -0,0 +1,48 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class BacktickOperatorSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_BACKTICK]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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) + { + $error = 'Use of the backtick operator is forbidden'; + $phpcsFile->addError($error, $stackPtr, 'Found'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php new file mode 100644 index 00000000..61ff4f2f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php @@ -0,0 +1,86 @@ + + * @copyright 2010-2014 Andy Grunwald + * @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; + +class CharacterBeforePHPOpeningTagSniff implements Sniff +{ + + /** + * List of supported BOM definitions. + * + * Use encoding names as keys and hex BOM representations as values. + * + * @var array + */ + protected $bomDefinitions = [ + 'UTF-8' => 'efbbbf', + 'UTF-16 (BE)' => 'feff', + 'UTF-16 (LE)' => 'fffe', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $expected = 0; + if ($stackPtr > 0) { + // Allow a byte-order mark. + $tokens = $phpcsFile->getTokens(); + foreach ($this->bomDefinitions as $expectedBomHex) { + $bomByteLength = (strlen($expectedBomHex) / 2); + $htmlBomHex = bin2hex(substr($tokens[0]['content'], 0, $bomByteLength)); + if ($htmlBomHex === $expectedBomHex) { + $expected++; + break; + } + } + + // Allow a shebang line. + if (substr($tokens[0]['content'], 0, 2) === '#!') { + $expected++; + } + } + + if ($stackPtr !== $expected) { + $error = 'The opening PHP tag must be the first content in the file'; + $phpcsFile->addError($error, $stackPtr, 'Found'); + } + + // Skip the rest of the file so we don't pick up additional + // open tags, typically embedded in HTML. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php new file mode 100644 index 00000000..23dd2b6b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php @@ -0,0 +1,54 @@ + + * @copyright 2010-2014 Stefano Kowalke + * @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; + +class ClosingPHPTagSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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) + { + $closeTag = $phpcsFile->findNext(T_CLOSE_TAG, $stackPtr); + if ($closeTag === false) { + $error = 'The PHP open tag does not have a corresponding PHP close tag'; + $phpcsFile->addError($error, $stackPtr, 'NotFound'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php new file mode 100644 index 00000000..44efd53a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php @@ -0,0 +1,75 @@ + + * @author Greg Sherwood + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; + +use ReflectionFunction; + +class DeprecatedFunctionsSniff extends ForbiddenFunctionsSniff +{ + + /** + * A list of forbidden functions with their alternatives. + * + * The value is NULL if no alternative exists. IE, the + * function should just not be used. + * + * @var array + */ + public $forbiddenFunctions = []; + + + /** + * Constructor. + * + * Uses the Reflection API to get a list of deprecated functions. + */ + public function __construct() + { + $functions = get_defined_functions(); + + foreach ($functions['internal'] as $functionName) { + $function = new ReflectionFunction($functionName); + + if ($function->isDeprecated() === true) { + $this->forbiddenFunctions[$functionName] = null; + } + } + + }//end __construct() + + + /** + * Generates the error or warning for this sniff. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the forbidden function + * in the token array. + * @param string $function The name of the forbidden function. + * @param string $pattern The pattern used for the match. + * + * @return void + */ + protected function addError($phpcsFile, $stackPtr, $function, $pattern=null) + { + $data = [$function]; + $error = 'Function %s() has been deprecated'; + $type = 'Deprecated'; + + if ($this->error === true) { + $phpcsFile->addError($error, $stackPtr, $type, $data); + } else { + $phpcsFile->addWarning($error, $stackPtr, $type, $data); + } + + }//end addError() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php new file mode 100644 index 00000000..a2cf1b93 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php @@ -0,0 +1,253 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DisallowAlternativePHPTagsSniff implements Sniff +{ + + /** + * Whether ASP tags are enabled or not. + * + * @var boolean + */ + private $aspTags = false; + + /** + * The current PHP version. + * + * @var integer|string|null + */ + private $phpVersion = null; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + if ($this->phpVersion === null) { + $this->phpVersion = Config::getConfigData('php_version'); + if ($this->phpVersion === null) { + $this->phpVersion = PHP_VERSION_ID; + } + } + + if ($this->phpVersion < 70000) { + $this->aspTags = (bool) ini_get('asp_tags'); + } + + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + T_INLINE_HTML, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $openTag = $tokens[$stackPtr]; + $content = $openTag['content']; + + if (trim($content) === '') { + return; + } + + if ($openTag['code'] === T_OPEN_TAG) { + if ($content === '<%') { + $error = 'ASP style opening tag used; expected "findClosingTag($phpcsFile, $tokens, $stackPtr, '%>'); + $errorCode = 'ASPOpenTagFound'; + } else if (strpos($content, ''); + $errorCode = 'ScriptOpenTagFound'; + } + + if (isset($error, $closer, $errorCode) === true) { + $data = [$content]; + + if ($closer === false) { + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } else { + $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); + if ($fix === true) { + $this->addChangeset($phpcsFile, $tokens, $stackPtr, $closer); + } + } + } + + return; + }//end if + + if ($openTag['code'] === T_OPEN_TAG_WITH_ECHO && $content === '<%=') { + $error = 'ASP style opening tag used with echo; expected "findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + $snippet = $this->getSnippet($tokens[$nextVar]['content']); + $data = [ + $snippet, + $content, + $snippet, + ]; + + $closer = $this->findClosingTag($phpcsFile, $tokens, $stackPtr, '%>'); + + if ($closer === false) { + $phpcsFile->addError($error, $stackPtr, 'ASPShortOpenTagFound', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ASPShortOpenTagFound', $data); + if ($fix === true) { + $this->addChangeset($phpcsFile, $tokens, $stackPtr, $closer, true); + } + } + + return; + }//end if + + // Account for incorrect script open tags. + if ($openTag['code'] === T_INLINE_HTML + && preg_match('`( + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed new file mode 100644 index 00000000..2a695c89 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed @@ -0,0 +1,14 @@ +
    + +Some content here. + + + + +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc new file mode 100644 index 00000000..cd5a6620 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc @@ -0,0 +1,6 @@ +
    +<% echo $var; %> +

    Some text <% echo $var; %> and some more text

    +<%= $var . ' and some more text to make sure the snippet works'; %> +

    Some text <%= $var %> and some more text

    +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed new file mode 100644 index 00000000..6eafb422 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed @@ -0,0 +1,6 @@ +
    + +

    Some text and some more text

    + +

    Some text and some more text

    +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc new file mode 100644 index 00000000..ba86345a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc @@ -0,0 +1,7 @@ + +
    +<% echo $var; %> +

    Some text <% echo $var; %> and some more text

    +<%= $var . ' and some more text to make sure the snippet works'; %> +

    Some text <%= $var %> and some more text

    +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php new file mode 100644 index 00000000..8dd6deb9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php @@ -0,0 +1,110 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowAlternativePHPTags sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff + */ +final class DisallowAlternativePHPTagsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Get a list of all test files to check. + * + * @param string $testFileBase The base path that the unit tests files will have. + * + * @return string[] + */ + protected function getTestFiles($testFileBase) + { + $testFiles = [$testFileBase.'1.inc']; + + $aspTags = false; + if (PHP_VERSION_ID < 70000) { + $aspTags = (bool) ini_get('asp_tags'); + } + + if ($aspTags === true) { + $testFiles[] = $testFileBase.'2.inc'; + } else { + $testFiles[] = $testFileBase.'3.inc'; + } + + return $testFiles; + + }//end getTestFiles() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'DisallowAlternativePHPTagsUnitTest.1.inc': + return [ + 4 => 1, + 7 => 1, + 8 => 1, + 11 => 1, + ]; + case 'DisallowAlternativePHPTagsUnitTest.2.inc': + return [ + 2 => 1, + 3 => 1, + 4 => 1, + 5 => 1, + ]; + default: + return []; + }//end switch + + }//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($testFile='') + { + if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { + return [ + 3 => 1, + 4 => 1, + 5 => 1, + 6 => 1, + ]; + } + + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc new file mode 100644 index 00000000..974e45c0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc @@ -0,0 +1,16 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php new file mode 100644 index 00000000..15510a69 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php @@ -0,0 +1,56 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowRequestSuperglobal sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowRequestSuperglobalSniff + */ +final class DisallowRequestSuperglobalUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + protected function getErrorList() + { + return [ + 2 => 1, + 12 => 1, + 13 => 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. + * + * @return array + */ + protected function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc new file mode 100644 index 00000000..040e62dc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc @@ -0,0 +1,11 @@ +
    + +Some content here. + + +Some content Some more content + + +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed new file mode 100644 index 00000000..1ea281a4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed @@ -0,0 +1,11 @@ +
    + +Some content here. + + +Some content Some more content + + +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc new file mode 100644 index 00000000..85617ded --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc @@ -0,0 +1,8 @@ +
    + +Some content Some more content + + +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed new file mode 100644 index 00000000..afe5d8f2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed @@ -0,0 +1,8 @@ +
    + +Some content Some more content + + +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc new file mode 100644 index 00000000..9b7ccd6d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc @@ -0,0 +1,16 @@ +// Test warning for when short_open_tag is off. + +Some content Some more content + +// Test multi-line. +Some content Some more content + +// Make sure skipping works. +Some content Some more content + +// Only recognize closing tag after opener. +Some?> content + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowShortOpenTag sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff + */ +final class DisallowShortOpenTagUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Get a list of all test files to check. + * + * @param string $testFileBase The base path that the unit tests files will have. + * + * @return string[] + */ + protected function getTestFiles($testFileBase) + { + $testFiles = [$testFileBase.'1.inc']; + + $option = (bool) ini_get('short_open_tag'); + if ($option === true) { + $testFiles[] = $testFileBase.'2.inc'; + } else { + $testFiles[] = $testFileBase.'3.inc'; + } + + return $testFiles; + + }//end getTestFiles() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'DisallowShortOpenTagUnitTest.1.inc': + return [ + 5 => 1, + 6 => 1, + 7 => 1, + 10 => 1, + ]; + case 'DisallowShortOpenTagUnitTest.2.inc': + return [ + 2 => 1, + 3 => 1, + 4 => 1, + 7 => 1, + ]; + default: + return []; + }//end switch + + }//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($testFile='') + { + switch ($testFile) { + case 'DisallowShortOpenTagUnitTest.1.inc': + return []; + case 'DisallowShortOpenTagUnitTest.3.inc': + return [ + 3 => 1, + 6 => 1, + 11 => 1, + ]; + default: + return []; + }//end switch + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc new file mode 100644 index 00000000..f564215b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc @@ -0,0 +1,18 @@ + + * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DiscourageGoto sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DiscourageGotoSniff + */ +final class DiscourageGotoUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [ + 3 => 1, + 6 => 1, + 11 => 1, + 16 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc new file mode 100644 index 00000000..060da612 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc @@ -0,0 +1,60 @@ +sizeof($array); +$size = $class->count($array); +$class->delete($filepath); +$class->unset($filepath); + +function delete() {} +function unset() {} +function sizeof() {} +function count() {} + +trait DelProvider { + public function delete() { + //irrelevant + } +} + +class LeftSideTest { + use DelProvider { + delete as protected unsetter; + } +} + +class RightSideTest { + use DelProvider { + delete as delete; + } +} + +class RightSideVisTest { + use DelProvider { + delete as protected delete; + DelProvider::delete insteadof delete; + } +} + +namespace Something\sizeof; +$var = new Sizeof(); +class SizeOf implements Something {} + +function mymodule_form_callback(SizeOf $sizeof) { +} + +$size = $class?->sizeof($array); + +#[SizeOf(10)] +function doSomething() {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php new file mode 100644 index 00000000..cb093131 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php @@ -0,0 +1,59 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ForbiddenFunctions sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff + */ +final class ForbiddenFunctionsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + $errors = [ + 2 => 1, + 4 => 1, + 6 => 1, + ]; + + return $errors; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc new file mode 100644 index 00000000..396cf6a4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc @@ -0,0 +1,153 @@ +NULL = 7; + +use Zend\Log\Writer\NULL as NullWriter; +new \Zend\Log\Writer\NULL(); + +namespace False; + +class True extends Null implements False {} + +use True\Something; +use Something\True; +class MyClass +{ + public function myFunction() + { + $var = array('foo' => new True()); + } +} + +$x = $f?FALSE:true; +$x = $f? FALSE:true; + +class MyClass +{ + // Spice things up a little. + const TRUE = false; +} + +var_dump(MyClass::TRUE); + +function tRUE() {} + +$input->getFilterChain()->attachByName('Null', ['type' => Null::TYPE_STRING]); + +// Issue #3332 - ignore type declarations, but not default values. +class TypedThings { + const MYCONST = FALSE; + + public int|FALSE $int = FALSE; + public Type|NULL $int = new MyObj(NULL); + + private function typed(int|FALSE $param = NULL, Type|NULL $obj = new MyObj(FALSE)) : string|FALSE|NULL + { + if (TRUE === FALSE) { + return NULL; + } + } +} + +$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() {}; + } +} + +// PHP 8.3 introduces typed constants. +class TypedConstants { + const MyClass|NULL|TRUE|FALSE MYCONST = FALSE; +} + +// Global constants can not be typed. +const MYCONST = TRUE; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed new file mode 100644 index 00000000..96b1c78d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed @@ -0,0 +1,153 @@ +NULL = 7; + +use Zend\Log\Writer\NULL as NullWriter; +new \Zend\Log\Writer\NULL(); + +namespace False; + +class True extends Null implements False {} + +use True\Something; +use Something\True; +class MyClass +{ + public function myFunction() + { + $var = array('foo' => new True()); + } +} + +$x = $f?false:true; +$x = $f? false:true; + +class MyClass +{ + // Spice things up a little. + const TRUE = false; +} + +var_dump(MyClass::TRUE); + +function tRUE() {} + +$input->getFilterChain()->attachByName('Null', ['type' => Null::TYPE_STRING]); + +// Issue #3332 - ignore type declarations, but not default values. +class TypedThings { + const MYCONST = false; + + public int|FALSE $int = false; + public Type|NULL $int = new MyObj(null); + + private function typed(int|FALSE $param = null, Type|NULL $obj = new MyObj(false)) : string|FALSE|NULL + { + if (true === false) { + return null; + } + } +} + +$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() {}; + } +} + +// PHP 8.3 introduces typed constants. +class TypedConstants { + const MyClass|NULL|TRUE|FALSE MYCONST = false; +} + +// Global constants can not be typed. +const MYCONST = true; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.2.inc new file mode 100644 index 00000000..c61a0a50 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.2.inc @@ -0,0 +1,4 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LowerCaseConstant sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff + */ +final class LowerCaseConstantUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'LowerCaseConstantUnitTest.1.inc': + return [ + 7 => 1, + 10 => 1, + 15 => 1, + 16 => 1, + 23 => 1, + 26 => 1, + 31 => 1, + 32 => 1, + 39 => 1, + 42 => 1, + 47 => 1, + 48 => 1, + 70 => 1, + 71 => 1, + 87 => 1, + 89 => 1, + 90 => 1, + 92 => 2, + 94 => 2, + 95 => 1, + 100 => 2, + 104 => 1, + 108 => 1, + 118 => 1, + 119 => 1, + 120 => 1, + 121 => 1, + 125 => 1, + 129 => 1, + 149 => 1, + 153 => 1, + ]; + + case 'LowerCaseConstantUnitTest.js': + return [ + 2 => 1, + 3 => 1, + 4 => 1, + 7 => 1, + 8 => 1, + 12 => 1, + 13 => 1, + 14 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc new file mode 100644 index 00000000..37579d32 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc @@ -0,0 +1,48 @@ + $x; +$r = Match ($x) { + 1 => 1, + 2 => 2, + DEFAULT, => 3, +}; + +class Reading { + Public READOnly int $var; +} + +EnuM ENUM: string +{ + Case HEARTS; +} + +__HALT_COMPILER(); // An exception due to phar support. +function diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed new file mode 100644 index 00000000..7063327a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed @@ -0,0 +1,48 @@ + $x; +$r = match ($x) { + 1 => 1, + 2 => 2, + default, => 3, +}; + +class Reading { + public readonly int $var; +} + +enum ENUM: string +{ + case HEARTS; +} + +__HALT_COMPILER(); // An exception due to phar support. +function diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php new file mode 100644 index 00000000..17f0e25d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php @@ -0,0 +1,71 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LowerCaseKeyword sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff + */ +final class LowerCaseKeywordUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 10 => 3, + 11 => 4, + 12 => 1, + 13 => 3, + 14 => 7, + 15 => 1, + 19 => 1, + 20 => 1, + 21 => 1, + 25 => 1, + 28 => 1, + 31 => 1, + 32 => 1, + 35 => 1, + 39 => 2, + 42 => 1, + 44 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc new file mode 100644 index 00000000..fb5b1fd5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc @@ -0,0 +1,145 @@ + $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 {}; + +class TypedClassConstants +{ + const UNTYPED = null; + const FLOAT = 'Reserved keyword as name is valid and should not be changed'; + const OBJECT = 'Reserved keyword as name is valid and should not be changed'; + + const ClassName FIRST = null; + public const Int SECOND = 0; + private const ?BOOL THIRD = false; + public const Self FOURTH = null; +} +interface TypedInterfaceConstants +{ + protected const PaRenT FIRST = null; + private const ARRAY SECOND = []; + public const Float THIRD = 2.5; + final const ?STRING FOURTH = 'fourth'; +} +trait TypedTraitConstants { + const IterablE FIRST = null; + const Object SECOND = null; + const Mixed THIRD = 'third'; +} +enum TypedEnumConstants { + public const Iterable|FALSE|NULL FIRST = null; + protected const SELF|Parent /* comment */ |\Fully\Qualified\ClassName|UnQualifiedClass SECOND = null; + private const ClassName|/*comment*/Float|STRING|False THIRD = 'third'; + public const sTRing | aRRaY | FaLSe FOURTH = 'fourth'; +} + +class DNFTypes { + const (Parent&Something)|Float CONST_NAME = 1.5; + + public readonly TRUE|(\A&B) $prop; + + function DNFParamTypes ( + null|(\Package\ClassName&\Package\Other_Class)|INT $DNFinMiddle, + (\Package\ClassName&\Package\Other_Class)|ARRAY $parensAtStart, + False|(\Package\ClassName&\Package\Other_Class) $parentAtEnd, + ) {} + + function DNFReturnTypes ($var): object|(Self&\Package\Other_Class)|sTRINg|false {} +} + +// Intentional error, should be ignored by the sniff. +interface PropertiesNotAllowed { + public $notAllowed; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed new file mode 100644 index 00000000..10be06b0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed @@ -0,0 +1,145 @@ + $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 {}; + +class TypedClassConstants +{ + const UNTYPED = null; + const FLOAT = 'Reserved keyword as name is valid and should not be changed'; + const OBJECT = 'Reserved keyword as name is valid and should not be changed'; + + const ClassName FIRST = null; + public const int SECOND = 0; + private const ?bool THIRD = false; + public const self FOURTH = null; +} +interface TypedInterfaceConstants +{ + protected const parent FIRST = null; + private const array SECOND = []; + public const float THIRD = 2.5; + final const ?string FOURTH = 'fourth'; +} +trait TypedTraitConstants { + const iterable FIRST = null; + const object SECOND = null; + const mixed THIRD = 'third'; +} +enum TypedEnumConstants { + public const iterable|false|null FIRST = null; + protected const self|parent /* comment */ |\Fully\Qualified\ClassName|UnQualifiedClass SECOND = null; + private const ClassName|/*comment*/float|string|false THIRD = 'third'; + public const string | array | false FOURTH = 'fourth'; +} + +class DNFTypes { + const (parent&Something)|float CONST_NAME = 1.5; + + public readonly true|(\A&B) $prop; + + function DNFParamTypes ( + null|(\Package\ClassName&\Package\Other_Class)|int $DNFinMiddle, + (\Package\ClassName&\Package\Other_Class)|array $parensAtStart, + false|(\Package\ClassName&\Package\Other_Class) $parentAtEnd, + ) {} + + function DNFReturnTypes ($var): object|(self&\Package\Other_Class)|string|false {} +} + +// Intentional error, should be ignored by the sniff. +interface PropertiesNotAllowed { + public $notAllowed; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php new file mode 100644 index 00000000..26219328 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php @@ -0,0 +1,117 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LowerCaseType sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseTypeSniff + */ +final class LowerCaseTypeUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 14 => 1, + 15 => 1, + 16 => 1, + 17 => 1, + 18 => 1, + 21 => 4, + 22 => 3, + 23 => 3, + 25 => 1, + 26 => 2, + 27 => 2, + 32 => 4, + 36 => 1, + 37 => 1, + 38 => 1, + 39 => 1, + 43 => 2, + 44 => 1, + 46 => 1, + 49 => 1, + 51 => 2, + 53 => 1, + 55 => 2, + 60 => 1, + 61 => 1, + 62 => 1, + 63 => 1, + 64 => 1, + 65 => 1, + 66 => 1, + 67 => 1, + 68 => 1, + 69 => 1, + 71 => 3, + 72 => 2, + 73 => 3, + 74 => 3, + 78 => 3, + 82 => 2, + 85 => 1, + 94 => 5, + 96 => 4, + 105 => 1, + 106 => 1, + 107 => 1, + 111 => 1, + 112 => 1, + 113 => 1, + 114 => 1, + 117 => 1, + 118 => 1, + 119 => 1, + 122 => 3, + 123 => 2, + 124 => 3, + 125 => 3, + 129 => 2, + 131 => 1, + 134 => 1, + 135 => 1, + 136 => 1, + 139 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + // Warning from getMemberProperties() about parse error. + return [144 => 1]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc new file mode 100644 index 00000000..98159b47 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc @@ -0,0 +1,16 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the NoSilencedErrors sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\NoSilencedErrorsSniff + */ +final class NoSilencedErrorsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [13 => 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. + * + * @return array + */ + public function getWarningList() + { + return [ + 5 => 1, + 10 => 1, + 16 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc new file mode 100644 index 00000000..387cec24 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc @@ -0,0 +1,8 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the RequireStrictType sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\RequireStrictTypesSniff + */ +final class RequireStrictTypesUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'RequireStrictTypesUnitTest.2.inc': + case 'RequireStrictTypesUnitTest.5.inc': + case 'RequireStrictTypesUnitTest.6.inc': + case 'RequireStrictTypesUnitTest.10.inc': + return [1 => 1]; + + default: + return []; + } + + }//end getErrorList() + + + /** + * Returns the lines where warnings should occur. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getWarningList($testFile='') + { + 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() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc new file mode 100644 index 00000000..f0f350f3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc @@ -0,0 +1,5 @@ +php_sapi_name() === true) {} +if ($object?->php_sapi_name() === true) {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php new file mode 100644 index 00000000..9ee274b6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php @@ -0,0 +1,53 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SAPIUsage sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SAPIUsageSniff + */ +final class SAPIUsageUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [2 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc new file mode 100644 index 00000000..4f0d9d84 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc @@ -0,0 +1,4 @@ + +
    text
    + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php new file mode 100644 index 00000000..58433eb1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php @@ -0,0 +1,63 @@ + + * @author Blaine Schmeisser + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the Syntax sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SyntaxSniff + */ +final class SyntaxUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'SyntaxUnitTest.1.inc': + case 'SyntaxUnitTest.2.inc': + return [3 => 1]; + + default: + return []; + } + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc new file mode 100644 index 00000000..30c6d298 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc @@ -0,0 +1,98 @@ +null = 7; + +use Zend\Log\Writer\Null as NullWriter; +new \Zend\Log\Writer\Null(); + +namespace False; + +class True extends Null implements False {} + +use True\Something; +use Something\True; +class MyClass +{ + public function myFunction() + { + $var = array('foo' => new True()); + } +} + +$x = $f?false:TRUE; +$x = $f? false:TRUE; + +class MyClass +{ + // Spice things up a little. + const true = FALSE; +} + +var_dump(MyClass::true); + +function true() {} + +// Issue #3332 - ignore type declarations, but not default values. +class TypedThings { + const MYCONST = false; + + public int|false $int = false; + public Type|null $int = new MyObj(null); + + private function typed(int|false $param = null, Type|null $obj = new MyObj(false)) : string|false|null + { + if (true === false) { + return null; + } + } +} + +$cl = function (int|false $param = null, Type|null $obj = new MyObj(false)) : string|false|null {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed new file mode 100644 index 00000000..7705198c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed @@ -0,0 +1,98 @@ +null = 7; + +use Zend\Log\Writer\Null as NullWriter; +new \Zend\Log\Writer\Null(); + +namespace False; + +class True extends Null implements False {} + +use True\Something; +use Something\True; +class MyClass +{ + public function myFunction() + { + $var = array('foo' => new True()); + } +} + +$x = $f?FALSE:TRUE; +$x = $f? FALSE:TRUE; + +class MyClass +{ + // Spice things up a little. + const true = FALSE; +} + +var_dump(MyClass::true); + +function true() {} + +// Issue #3332 - ignore type declarations, but not default values. +class TypedThings { + const MYCONST = FALSE; + + public int|false $int = FALSE; + public Type|null $int = new MyObj(NULL); + + private function typed(int|false $param = NULL, Type|null $obj = new MyObj(FALSE)) : string|false|null + { + if (TRUE === FALSE) { + return NULL; + } + } +} + +$cl = function (int|false $param = NULL, Type|null $obj = new MyObj(FALSE)) : string|false|null {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php new file mode 100644 index 00000000..481c4ab1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php @@ -0,0 +1,75 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the UpperCaseConstant sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\UpperCaseConstantSniff + */ +final class UpperCaseConstantUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 7 => 1, + 10 => 1, + 15 => 1, + 16 => 1, + 23 => 1, + 26 => 1, + 31 => 1, + 32 => 1, + 39 => 1, + 42 => 1, + 47 => 1, + 48 => 1, + 70 => 1, + 71 => 1, + 85 => 1, + 87 => 1, + 88 => 1, + 90 => 2, + 92 => 2, + 93 => 1, + 98 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.1.inc new file mode 100644 index 00000000..d2ac790d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.1.inc @@ -0,0 +1,34 @@ +'; +$code = '<'.'?php '; + +$string = 'This is a really long string. ' + . 'It is being used for errors. ' + . 'The message is not translated.'; + +$shouldBail = 1 + 1; + +$shouldNotTrigger = 'My' . /* comment */ 'string'; +$shouldNotTrigger = 'My' /* comment */ . 'string'; + +// phpcs:set Generic.Strings.UnnecessaryStringConcat allowMultiline true +$string = 'Multiline strings are allowed ' + . 'when setting is enabled.'; +// phpcs:set Generic.Strings.UnnecessaryStringConcat allowMultiline false + +// phpcs:set Generic.Strings.UnnecessaryStringConcat error false +$throwWarning = 'My' . 'string'; +// phpcs:set Generic.Strings.UnnecessaryStringConcat error true diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.2.inc new file mode 100644 index 00000000..6a5fcba9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.2.inc @@ -0,0 +1,7 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\Strings; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the UnnecessaryStringConcat sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff + */ +final class UnnecessaryStringConcatUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'UnnecessaryStringConcatUnitTest.1.inc': + return [ + 2 => 1, + 6 => 1, + 9 => 1, + 12 => 1, + 19 => 1, + 20 => 1, + ]; + + case 'UnnecessaryStringConcatUnitTest.js': + return [ + 1 => 1, + 8 => 1, + 11 => 1, + 14 => 1, + 15 => 1, + ]; + + default: + return []; + }//end switch + + }//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($testFile='') + { + switch ($testFile) { + case 'UnnecessaryStringConcatUnitTest.1.inc': + return [ + 33 => 1, + ]; + + default: + return []; + } + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css new file mode 100644 index 00000000..de84a948 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css @@ -0,0 +1,35 @@ +/* + * This is a CSS comment. +<<<<<<< HEAD + * This is a merge conflict... +======= + * which should be detected. +>>>>>>> ref/heads/feature-branch + */ + +.SettingsTabPaneWidgetType-tab-mid { + background: transparent url(tab_inact_mid.png) repeat-x; +<<<<<<< HEAD + line-height: -25px; +======= + line-height: -20px; +>>>>>>> ref/heads/feature-branch + cursor: pointer; + -moz-user-select: none; +} + +/* + * The above tests are based on "normal" tokens. + * The below test checks that once the tokenizer breaks down because of + * unexpected merge conflict boundaries, subsequent boundaries will still + * be detected correctly. + */ + +/* + * This is a CSS comment. +<<<<<<< HEAD + * This is a merge conflict... +======= + * which should be detected. +>>>>>>> ref/heads/feature-branch + */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc new file mode 100644 index 00000000..470c3b8f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc @@ -0,0 +1,61 @@ +> -1); +var_dump( +1 +<< +-1 +); + +$string = +<< 'a' +<<<<<<< HEAD + 'b' => 'b' +======= + 'c' => 'c' +>>>>>>> master + ); + } + +/* + * The above tests are based on "normal" tokens. + * The below test checks that once the tokenizer breaks down because of + * unexpected merge conflict boundaries - i.e. after the first merge conflict + * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent + * merge conflict boundaries will still be detected correctly. + */ + +/* + * Testing detecting subsequent merge conflicts. + * +<<<<<<< HEAD + * @var string $bar + */ +public function foo($bar){ } + +/** +============ +The above is not the boundary, the below is. +======= + * @var string $bar +>>>>>>> f19f8a5... Commit message +*/ + +// Test that stray boundaries, i.e. an opener without closer and such, are detected. +<<<<<<< HEAD +$a = 1; +======= diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css new file mode 100644 index 00000000..6caa78d0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css @@ -0,0 +1,32 @@ +/* + * This is a CSS comment. +<<<<<<< HEAD + * This is a merge conflict started in a comment, ending in a CSS block. + */ +.SettingsTabPaneWidgetType-tab-mid { + background: transparent url(tab_inact_mid.png) repeat-x; +======= + * which should be detected. + **/ +.SettingsTabPaneWidgetType-tab-start { + line-height: -25px; +>>>>>>> ref/heads/feature-branch + cursor: pointer; + -moz-user-select: none; +} + +/* + * The above tests are based on "normal" tokens. + * The below test checks that once the tokenizer breaks down because of + * unexpected merge conflict boundaries, subsequent boundaries will still + * be detected correctly. + */ + +/* + * This is a CSS comment. +<<<<<<< HEAD + * This is a merge conflict... +======= + * which should be detected. +>>>>>>> ref/heads/feature-branch + */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc new file mode 100644 index 00000000..809b17d6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc @@ -0,0 +1,31 @@ +>>>>>> master + */ + +/* + * Testing detecting merge conflicts using different comment styles. + * +<<<<<<< HEAD + * @var string $bar + */ +public function foo($bar){ } + +/* +======= + * @var string $bar +>>>>>>> master +*/ + +// Comment +<<<<<<< HEAD +// Second comment line. NOTE: The above opener breaks the tokenizer. +======= +// New second comment line +>>>>>>> master +// Third comment line diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc new file mode 100644 index 00000000..ce709412 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc @@ -0,0 +1,43 @@ + +
    +<<<<<<< HEAD +

    Testing a merge conflict.

    +======= +

    Another text string.

    +>>>>>>> ref/heads/feature-branch +
    + + +
    +<<<<<<< HEAD +

    +======= +

    +>>>>>>> ref/heads/feature-branch +
    + +>>>>>> master + +/* + * The above tests are based on "normal" tokens. + * The below test checks that once the tokenizer breaks down because of + * unexpected merge conflict boundaries - i.e. after the first merge conflict + * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent + * merge conflict boundaries will still be detected correctly. + */ +?> + +
    +<<<<<<< HEAD +

    Testing a merge conflict.

    +======= +

    Another text string.

    +>>>>>>> ref/heads/feature-branch +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc new file mode 100644 index 00000000..99c0b997 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc @@ -0,0 +1,71 @@ +>>>>>> ref/heads/other-branchname +And now they are. +EOD; + +// Heredoc with a merge conflict starter, the closer is outside the heredoc. +$string = +<<>>>>>> ref/heads/other-branchname + +// Merge conflict starter outside with a closer inside of the heredoc. +// This breaks the tokenizer. +<<<<<<< HEAD +$string = +<<>>>>>> ref/heads/other-branchname +EOD; + +/* + * The above tests are based on "normal" tokens. + * The below test checks that once the tokenizer breaks down because of + * unexpected merge conflict boundaries - i.e. after the first merge conflict + * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent + * merge conflict boundaries will still be detected correctly. + */ + +$string = +<<>>>>>> ref/heads/other-branchname +And now they are. +EOD; + +$string = +<<>>>>>> ref/heads/other-branchname diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc new file mode 100644 index 00000000..7d55f6df --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc @@ -0,0 +1,34 @@ +>>>>>> ref/heads/other-branchname +And now they are. +EOD; + +// Break the tokenizer. +<<<<<<< HEAD + +/* + * The above tests are based on "normal" tokens. + * The below test checks that once the tokenizer breaks down because of + * unexpected merge conflict boundaries - i.e. after the first merge conflict + * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent + * merge conflict boundaries will still be detected correctly. + */ + +$string = +<<<'EOD' +can be problematic. +<<<<<<< HEAD +were previously not detected. +======= +should also be detected. +>>>>>>> ref/heads/other-branchname +And now they are. +EOD; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc new file mode 100644 index 00000000..aaea3245 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc @@ -0,0 +1,34 @@ +>>>>>> ref/heads/other-branchname + And now they are. + EOD; + +// Break the tokenizer. +>>>>>>> master + +/* + * The above tests are based on "normal" tokens. + * The below test checks that once the tokenizer breaks down because of + * unexpected merge conflict boundaries - i.e. after the first merge conflict + * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent + * merge conflict boundaries will still be detected correctly. + */ + +$string = + <<<"EOD" + Merge conflicts in PHP 7.3 indented heredocs +<<<<<<< HEAD + can be problematic. +======= + should also be detected. +>>>>>>> ref/heads/other-branchname + And now they are. + EOD; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc new file mode 100644 index 00000000..85cae1fd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc @@ -0,0 +1,19 @@ + +
    +<<<<<<< HEAD +

    Testing a merge conflict.

    +======= +

    Another text string.

    +>>>>>>> ref/heads/feature-branch +
    + + +
    +<<<<<<< HEAD +

    +======= +

    +>>>>>>> ref/heads/feature-branch +
    + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js new file mode 100644 index 00000000..cd7bc760 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js @@ -0,0 +1,33 @@ + +result = x?y:z; +result = x ? y : z; + +<<<<<<< HEAD +if (something === true +======= +if (something === false +>>>>>>> develop + ^ somethingElse === true +) { +<<<<<<< HEAD + return true; +======= + return false; +>>>>>>> develop +} + +y = 1 + + 2 + - 3; + +/* +<<<<<<< HEAD + * @var string $bar + */ +if (something === true + +/** +======= + * @var string $foo +>>>>>>> master + */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php new file mode 100644 index 00000000..bc966384 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php @@ -0,0 +1,175 @@ + + * @copyright 2017 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\VersionControl; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the GitMergeConflict sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\GitMergeConflictSniff + */ +final class GitMergeConflictUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'GitMergeConflictUnitTest.1.inc': + return [ + 26 => 1, + 28 => 1, + 30 => 1, + 45 => 1, + 53 => 1, + 55 => 1, + 59 => 1, + 61 => 1, + ]; + + case 'GitMergeConflictUnitTest.2.inc': + return [ + 4 => 1, + 6 => 1, + 8 => 1, + 14 => 1, + 20 => 1, + 22 => 1, + 26 => 1, + 28 => 1, + 30 => 1, + ]; + + case 'GitMergeConflictUnitTest.3.inc': + return [ + 3 => 1, + 5 => 1, + 7 => 1, + 12 => 1, + 14 => 1, + 16 => 1, + 22 => 1, + 24 => 1, + 26 => 1, + 38 => 1, + 40 => 1, + 42 => 1, + ]; + + case 'GitMergeConflictUnitTest.4.inc': + return [ + 6 => 1, + 8 => 1, + 10 => 1, + 18 => 1, + 22 => 1, + 25 => 1, + 29 => 1, + 34 => 1, + 39 => 1, + 53 => 1, + 55 => 1, + 57 => 1, + 64 => 1, + 68 => 1, + 71 => 1, + ]; + case 'GitMergeConflictUnitTest.5.inc': + case 'GitMergeConflictUnitTest.6.inc': + return [ + 6 => 1, + 8 => 1, + 10 => 1, + 15 => 1, + 28 => 1, + 30 => 1, + 32 => 1, + ]; + + case 'GitMergeConflictUnitTest.7.inc': + return [ + 3 => 1, + 5 => 1, + 7 => 1, + 12 => 1, + 14 => 1, + 16 => 1, + ]; + + case 'GitMergeConflictUnitTest.1.css': + return [ + 3 => 1, + 5 => 1, + 7 => 1, + 12 => 1, + 14 => 1, + 16 => 1, + 30 => 1, + 32 => 1, + 34 => 1, + ]; + + case 'GitMergeConflictUnitTest.2.css': + return [ + 3 => 1, + 8 => 1, + 13 => 1, + 27 => 1, + 29 => 1, + 31 => 1, + ]; + + case 'GitMergeConflictUnitTest.js': + return [ + 5 => 1, + 7 => 1, + 9 => 1, + 12 => 1, + 14 => 1, + 16 => 1, + 24 => 1, + 30 => 1, + 32 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc new file mode 100644 index 00000000..e4110dee --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc @@ -0,0 +1,3 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\VersionControl; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SubversionProperties sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\SubversionPropertiesSniff + */ +final class SubversionPropertiesUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Should this test be skipped for some reason. + * + * @return bool + */ + protected function shouldSkipTest() + { + // This sniff cannot be tested as no SVN version control directory is available. + return true; + + }//end shouldSkipTest() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc new file mode 100644 index 00000000..4ce05084 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc @@ -0,0 +1,192 @@ +{$var}( $foo,$bar ); + +$bar(function( $a, $b ) { + return function( $c, $d ) use ( $a, $b ) { + echo $a, $b, $c, $d; + }; +})( 'a','b' )( 'c','d' ); + +$closure( $foo,$bar ); +$var = $closure() + $closure( $foo,$bar ) + self::$closure( $foo,$bar ); + +class Test { + public static function baz( $foo, $bar ) { + $a = new self( $foo,$bar ); + $b = new static( $foo,$bar ); + } +} + +/* + * Test warning for empty parentheses. + */ +$a = 4 + (); // Warning. +$a = 4 + ( ); // Warning. +$a = 4 + (/* Not empty */); + +/* + * Test the actual sniff. + */ +if ((null !== $extra) && ($row->extra !== $extra)) {} + +if (( null !== $extra ) && ( $row->extra !== $extra )) {} // Bad x 4. + +if (( null !== $extra // Bad x 1. + && is_int($extra)) + && ( $row->extra !== $extra // Bad x 1. + || $something ) // Bad x 1. +) {} + +if (( null !== $extra ) // Bad x 2. + && ( $row->extra !== $extra ) // Bad x 2. +) {} + +$a = (null !== $extra); +$a = ( null !== $extra ); // Bad x 2. + +$sx = $vert ? ($w - 1) : 0; + +$this->is_overloaded = ( ( ini_get("mbstring.func_overload") & 2 ) != 0 ) && function_exists('mb_substr'); // Bad x 4. + +$image->flip( ($operation->axis & 1) != 0, ($operation->axis & 2) != 0 ); + +if ( $success && ('nothumb' == $target || 'all' == $target) ) {} + +$directory = ('/' == $file[ strlen($file)-1 ]); + +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 +if ((null !== $extra) && ($row->extra !== $extra)) {} // Bad x 4. + +if (( null !== $extra ) && ( $row->extra !== $extra )) {} + +if (( null !== $extra // Bad x 1. + && is_int($extra)) // Bad x 1. + && ( $row->extra !== $extra + || $something ) // Bad x 1. +) {} + +if ((null !== $extra) // Bad x 2. + && ($row->extra !== $extra) // Bad x 2. +) {} + +$a = (null !== $extra); // Bad x 2. +$a = ( null !== $extra ); + +$sx = $vert ? ($w - 1) : 0; // Bad x 2. + +$this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); // Bad x 4. + +$image->flip( ($operation->axis & 1) != 0, ($operation->axis & 2) != 0 ); // Bad x 4. + +if ( $success && ('nothumb' == $target || 'all' == $target) ) {} // Bad x 2. + +$directory = ('/' == $file[ strlen($file)-1 ]); // Bad x 2. + +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 + +/* + * Test handling of ignoreNewlines. + */ +if ( + ( + null !== $extra + ) && ( + $row->extra !== $extra + ) +) {} // Bad x 4, 1 x line 123, 2 x line 125, 1 x line 127. + + +$a = ( + null !== $extra +); // Bad x 2, 1 x line 131, 1 x line 133. + +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 +if ( + ( + null !== $extra + ) && ( + $row->extra !== $extra + ) +) {} // Bad x 4, 1 x line 137, 2 x line 139, 1 x line 141. + +$a = ( + null !== $extra +); // Bad x 2, 1 x line 144, 1 x line 146. +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 + +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines true +if ( + ( + null !== $extra + ) && ( + $row->extra !== $extra + ) +) {} + +$a = ( + null !== $extra +); +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines false + +if (true) {} ( 1+2) === 3 ? $a = 1 : $a = 2; +class A {} ( 1+2) === 3 ? $a = 1 : $a = 2; +function foo() {} ( 1+2) === 3 ? $a = 1 : $a = 2; + +// Issue #3618. +class NonArbitraryParenthesesWithKeywords { + public static function baz( $foo, $bar ) { + $a = new self(); + $b = new parent(); + $c = new static(); + + // self/static are already tested above, round line 45. + $d = new parent( $foo,$bar ); + } +} + +// Test that the match expression does not trigger the sniff. +$b = match ( $a ) { + 1 => true, +}; + +// Parentheses after die/exit in a switch case should be ignored. +switch ( $type ) { + case A: + exit( 1 ); + case B: + die(); + default: + break; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc.fixed new file mode 100644 index 00000000..a0022808 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc.fixed @@ -0,0 +1,180 @@ +{$var}( $foo,$bar ); + +$bar(function( $a, $b ) { + return function( $c, $d ) use ( $a, $b ) { + echo $a, $b, $c, $d; + }; +})( 'a','b' )( 'c','d' ); + +$closure( $foo,$bar ); +$var = $closure() + $closure( $foo,$bar ) + self::$closure( $foo,$bar ); + +class Test { + public static function baz( $foo, $bar ) { + $a = new self( $foo,$bar ); + $b = new static( $foo,$bar ); + } +} + +/* + * Test warning for empty parentheses. + */ +$a = 4 + (); // Warning. +$a = 4 + ( ); // Warning. +$a = 4 + (/* Not empty */); + +/* + * Test the actual sniff. + */ +if ((null !== $extra) && ($row->extra !== $extra)) {} + +if ((null !== $extra) && ($row->extra !== $extra)) {} // Bad x 4. + +if ((null !== $extra // Bad x 1. + && is_int($extra)) + && ($row->extra !== $extra // Bad x 1. + || $something) // Bad x 1. +) {} + +if ((null !== $extra) // Bad x 2. + && ($row->extra !== $extra) // Bad x 2. +) {} + +$a = (null !== $extra); +$a = (null !== $extra); // Bad x 2. + +$sx = $vert ? ($w - 1) : 0; + +$this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); // Bad x 4. + +$image->flip( ($operation->axis & 1) != 0, ($operation->axis & 2) != 0 ); + +if ( $success && ('nothumb' == $target || 'all' == $target) ) {} + +$directory = ('/' == $file[ strlen($file)-1 ]); + +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 +if (( null !== $extra ) && ( $row->extra !== $extra )) {} // Bad x 4. + +if (( null !== $extra ) && ( $row->extra !== $extra )) {} + +if (( null !== $extra // Bad x 1. + && is_int($extra) ) // Bad x 1. + && ( $row->extra !== $extra + || $something ) // Bad x 1. +) {} + +if (( null !== $extra ) // Bad x 2. + && ( $row->extra !== $extra ) // Bad x 2. +) {} + +$a = ( null !== $extra ); // Bad x 2. +$a = ( null !== $extra ); + +$sx = $vert ? ( $w - 1 ) : 0; // Bad x 2. + +$this->is_overloaded = ( ( ini_get("mbstring.func_overload") & 2 ) != 0 ) && function_exists('mb_substr'); // Bad x 4. + +$image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 ); // Bad x 4. + +if ( $success && ( 'nothumb' == $target || 'all' == $target ) ) {} // Bad x 2. + +$directory = ( '/' == $file[ strlen($file)-1 ] ); // Bad x 2. + +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 + +/* + * Test handling of ignoreNewlines. + */ +if ( + (null !== $extra) && ($row->extra !== $extra) +) {} // Bad x 4, 1 x line 123, 2 x line 125, 1 x line 127. + + +$a = (null !== $extra); // Bad x 2, 1 x line 131, 1 x line 133. + +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 +if ( + ( null !== $extra ) && ( $row->extra !== $extra ) +) {} // Bad x 4, 1 x line 137, 2 x line 139, 1 x line 141. + +$a = ( null !== $extra ); // Bad x 2, 1 x line 144, 1 x line 146. +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 + +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines true +if ( + ( + null !== $extra + ) && ( + $row->extra !== $extra + ) +) {} + +$a = ( + null !== $extra +); +// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines false + +if (true) {} (1+2) === 3 ? $a = 1 : $a = 2; +class A {} (1+2) === 3 ? $a = 1 : $a = 2; +function foo() {} (1+2) === 3 ? $a = 1 : $a = 2; + +// Issue #3618. +class NonArbitraryParenthesesWithKeywords { + public static function baz( $foo, $bar ) { + $a = new self(); + $b = new parent(); + $c = new static(); + + // self/static are already tested above, round line 45. + $d = new parent( $foo,$bar ); + } +} + +// Test that the match expression does not trigger the sniff. +$b = match ( $a ) { + 1 => true, +}; + +// Parentheses after die/exit in a switch case should be ignored. +switch ( $type ) { + case A: + exit( 1 ); + case B: + die(); + default: + break; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.2.inc new file mode 100644 index 00000000..3d5bcd0a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.2.inc @@ -0,0 +1,4 @@ + + * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ArbitraryParenthesesSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ArbitraryParenthesesSpacingSniff + */ +final class ArbitraryParenthesesSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ArbitraryParenthesesSpacingUnitTest.1.inc': + return [ + 64 => 4, + 66 => 1, + 68 => 1, + 69 => 1, + 72 => 2, + 73 => 2, + 77 => 2, + 81 => 4, + 90 => 4, + 94 => 1, + 95 => 1, + 97 => 1, + 100 => 2, + 101 => 2, + 104 => 2, + 107 => 2, + 109 => 4, + 111 => 4, + 113 => 2, + 115 => 2, + 123 => 1, + 125 => 2, + 127 => 1, + 131 => 1, + 133 => 1, + 137 => 1, + 139 => 2, + 141 => 1, + 144 => 1, + 146 => 1, + 163 => 1, + 164 => 1, + 165 => 1, + ]; + + default: + return []; + }//end switch + + }//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($testFile='') + { + switch ($testFile) { + case 'ArbitraryParenthesesSpacingUnitTest.1.inc': + return [ + 55 => 1, + 56 => 1, + ]; + + default: + return []; + }//end switch + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc new file mode 100644 index 00000000..1826b585 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc @@ -0,0 +1,118 @@ +"; + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; +// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; +// Doc comments are indent with tabs and one space +//[tab]/** +//[tab][space]* + /** + * CVS revision for HTTP headers. + * + * @var string + * @access private + */ + /** + * + */ + +$str = 'hello + there'; + +/** + * This PHP DocBlock should be fine, even though there is a single space at the beginning. + * + * @var int $x + */ +$x = 1; + +?> + + + Foo + + +
    +
    +
    +
    +
    +
    + + + +"; + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; +// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; +// Doc comments are indent with tabs and one space +//[tab]/** +//[tab][space]* + /** + * CVS revision for HTTP headers. + * + * @var string + * @access private + */ + /** + * + */ + +$str = 'hello + there'; + +/** + * This PHP DocBlock should be fine, even though there is a single space at the beginning. + * + * @var int $x + */ +$x = 1; + +?> + + + Foo + + +
    +
    +
    +
    +
    +
    + + + +"; + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; +// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; +// Doc comments are indent with tabs and one space +//[tab]/** +//[tab][space]* + /** + * CVS revision for HTTP headers. + * + * @var string + * @access private + */ + /** + * + */ + +$str = 'hello + there'; + +/** + * This PHP DocBlock should be fine, even though there is a single space at the beginning. + * + * @var int $x + */ +$x = 1; + +?> + + + Foo + + +
    +
    +
    +
    +
    +
    + + + +"; + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; +// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; +// Doc comments are indent with tabs and one space +//[tab]/** +//[tab][space]* + /** + * CVS revision for HTTP headers. + * + * @var string + * @access private + */ + /** + * + */ + +$str = 'hello + there'; + +/** + * This PHP DocBlock should be fine, even though there is a single space at the beginning. + * + * @var int $x + */ +$x = 1; + +?> + + + Foo + + +
    +
    +
    +
    +
    +
    + + + + + + + Foo + + +
    +
    +
    +
    +
    +
    + + + + + + + Foo + + +
    +
    +
    +
    +
    +
    + + + + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowSpaceIndent sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowSpaceIndentSniff + */ +final class DisallowSpaceIndentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Get a list of CLI values to set before the file is tested. + * + * @param string $testFile The name of the file being tested. + * @param \PHP_CodeSniffer\Config $config The config data for the test run. + * + * @return void + */ + public function setCliValues($testFile, $config) + { + if ($testFile === 'DisallowSpaceIndentUnitTest.2.inc') { + return; + } + + $config->tabWidth = 4; + + }//end setCliValues() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'DisallowSpaceIndentUnitTest.1.inc': + case 'DisallowSpaceIndentUnitTest.2.inc': + return [ + 5 => 1, + 9 => 1, + 15 => 1, + 22 => 1, + 24 => 1, + 30 => 1, + 35 => 1, + 50 => 1, + 55 => 1, + 57 => 1, + 58 => 1, + 59 => 1, + 60 => 1, + 65 => 1, + 66 => 1, + 67 => 1, + 68 => 1, + 69 => 1, + 70 => 1, + 73 => 1, + 77 => 1, + 81 => 1, + 104 => 1, + 105 => 1, + 106 => 1, + 107 => 1, + 108 => 1, + 110 => 1, + 111 => 1, + 112 => 1, + 114 => 1, + 115 => 1, + 117 => 1, + 118 => 1, + ]; + + case 'DisallowSpaceIndentUnitTest.3.inc': + return [ + 2 => 1, + 5 => 1, + 10 => 1, + 12 => 1, + 13 => 1, + 14 => 1, + 15 => 1, + ]; + + case 'DisallowSpaceIndentUnitTest.4.inc': + if (PHP_VERSION_ID >= 70300) { + return [ + 7 => 1, + 13 => 1, + ]; + } + + // PHP 7.2 or lower: PHP version which doesn't support flexible heredocs/nowdocs yet. + return []; + + case 'DisallowSpaceIndentUnitTest.js': + return [3 => 1]; + + case 'DisallowSpaceIndentUnitTest.css': + return [2 => 1]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc new file mode 100644 index 00000000..cf61177e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc @@ -0,0 +1,93 @@ + 'Czech republic', + 'România' => 'Romania', + 'Magyarország' => 'Hungary', +); + +$var = "$hello $there"; + +?> + + + Foo + + +
    +
    +
    +
    +
    +
    + + + + 'Czech republic', + 'România' => 'Romania', + 'Magyarország' => 'Hungary', +); + +$var = "$hello $there"; + +?> + + + Foo + + +
    +
    +
    +
    +
    +
    + + + + + + + Foo + + +
    +
    +
    +
    +
    +
    + + + + + + + Foo + + +
    +
    +
    +
    +
    +
    + + + + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowTabIndent sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff + */ +final class DisallowTabIndentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Get a list of CLI values to set before the file is tested. + * + * @param string $testFile The name of the file being tested. + * @param \PHP_CodeSniffer\Config $config The config data for the test run. + * + * @return void + */ + public function setCliValues($testFile, $config) + { + $config->tabWidth = 4; + + }//end setCliValues() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'DisallowTabIndentUnitTest.1.inc': + return [ + 5 => 2, + 9 => 1, + 15 => 1, + 20 => 2, + 21 => 1, + 22 => 2, + 23 => 1, + 24 => 2, + 31 => 1, + 32 => 2, + 33 => 2, + 41 => 1, + 42 => 1, + 43 => 1, + 44 => 1, + 45 => 1, + 46 => 1, + 47 => 1, + 48 => 1, + 54 => 1, + 55 => 1, + 56 => 1, + 57 => 1, + 58 => 1, + 59 => 1, + 79 => 1, + 80 => 1, + 81 => 1, + 82 => 1, + 83 => 1, + 85 => 1, + 86 => 1, + 87 => 1, + 89 => 1, + 90 => 1, + 92 => 1, + 93 => 1, + ]; + + case 'DisallowTabIndentUnitTest.2.inc': + return [ + 6 => 1, + 7 => 1, + 8 => 1, + 9 => 1, + 10 => 1, + 11 => 1, + 12 => 1, + 13 => 1, + 19 => 1, + ]; + + case 'DisallowTabIndentUnitTest.3.inc': + if (PHP_VERSION_ID >= 70300) { + return [ + 7 => 1, + 13 => 1, + ]; + } + + // PHP 7.2 or lower: PHP version which doesn't support flexible heredocs/nowdocs yet. + return []; + + case 'DisallowTabIndentUnitTest.js': + return [ + 3 => 1, + 5 => 1, + 6 => 1, + ]; + + case 'DisallowTabIndentUnitTest.css': + return [ + 1 => 1, + 2 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc new file mode 100644 index 00000000..535053b0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc @@ -0,0 +1,43 @@ +prop++; +$obj->prop ++; +$obj?->prop ++; + +$obj->obj->prop++; +$obj->obj->prop ++; +$obj?->obj->prop ++; + +$obj->prop['key']++; +$obj->prop['key'] ++; + +--ClassName::$prop; +-- ClassName::$prop; + +getObject()->count +++; +getObject()->count++; +++ getObject()->count; +++getObject()->count; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..c30332b2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed @@ -0,0 +1,41 @@ +prop++; +$obj->prop++; +$obj?->prop++; + +$obj->obj->prop++; +$obj->obj->prop++; +$obj?->obj->prop++; + +$obj->prop['key']++; +$obj->prop['key']++; + +--ClassName::$prop; +--ClassName::$prop; + +getObject()->count++; +getObject()->count++; +++getObject()->count; +++getObject()->count; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js new file mode 100644 index 00000000..b7b1c2f2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js @@ -0,0 +1,17 @@ +var i; + +i = 10; +--i; +-- i; +-- /*comment*/ i; +++i; +++ + i; +++/*comment*/i; + +i--; +i --; +i /*comment*/ --; +i++; +i ++; +i /*comment*/ ++; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js.fixed new file mode 100644 index 00000000..5d8b33a0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js.fixed @@ -0,0 +1,16 @@ +var i; + +i = 10; +--i; +--i; +-- /*comment*/ i; +++i; +++i; +++/*comment*/i; + +i--; +i--; +i /*comment*/ --; +i++; +i++; +i /*comment*/ ++; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php new file mode 100644 index 00000000..91e34933 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php @@ -0,0 +1,86 @@ + + * @copyright 2018 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the IncrementDecrementSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff + */ +final class IncrementDecrementSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + $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; + $errors[40] = 1; + $errors[42] = 1; + + return $errors; + + case 'IncrementDecrementSpacingUnitTest.js': + return $errors; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc new file mode 100644 index 00000000..1847778d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc @@ -0,0 +1,91 @@ + + * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LanguageConstructSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff + */ +final class LanguageConstructSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'LanguageConstructSpacingUnitTest.1.inc': + return [ + 3 => 1, + 5 => 1, + 8 => 1, + 10 => 1, + 13 => 1, + 15 => 1, + 18 => 1, + 20 => 1, + 23 => 1, + 25 => 1, + 28 => 1, + 30 => 1, + 33 => 1, + 36 => 1, + 39 => 1, + 40 => 1, + 43 => 1, + 44 => 1, + 45 => 1, + 46 => 1, + 48 => 1, + 52 => 1, + 55 => 1, + 56 => 1, + 57 => 2, + 60 => 1, + 63 => 1, + 65 => 1, + 73 => 1, + 75 => 1, + 77 => 1, + 81 => 1, + 83 => 1, + 85 => 1, + 86 => 1, + 90 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc new file mode 100644 index 00000000..bab866e0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc @@ -0,0 +1,1653 @@ +phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false + +hello(); + } + + function hello() + { + echo 'hello'; +}//end hello() + + function hello2() + { + if (TRUE) { + echo 'hello'; // no error here as its more than 4 spaces. + } else { + echo 'bye'; + } + + while (TRUE) { + echo 'hello'; + } + + do { + echo 'hello'; + } while (TRUE); + } + + function hello3() + { + switch ($hello) { + case 'hello': + break; + } + } + +} + +?> +
    +
    +
    +validate()) {
    +    $safe = $form->getSubmitValues();
    +}
    +?>
    +
    +open(); // error here + } + + public function open() + { + // Some inline stuff that shouldn't error + if (TRUE) echo 'hello'; + foreach ($tokens as $token) echo $token; + } + + /** + * This is a comment 1. + * This is a comment 2. + * This is a comment 3. + * This is a comment 4. + */ + public function close() + { + // All ok. + if (TRUE) { + if (TRUE) { + } else if (FALSE) { + foreach ($tokens as $token) { + switch ($token) { + case '1': + case '2': + if (true) { + if (false) { + if (false) { + if (false) { + echo 'hello'; + } + } + } + } + break; + case '5': + break; + } + do { + while (true) { + foreach ($tokens as $token) { + for ($i = 0; $i < $token; $i++) { + echo 'hello'; + } + } + } + } while (true); + } + } + } + } + + /* + This is another c style comment 1. + This is another c style comment 2. + This is another c style comment 3. + This is another c style comment 4. + This is another c style comment 5. + */ + + /* This is a T_COMMENT + * + * + * + */ + + /** This is a T_DOC_COMMENT + */ + + /* + This T_COMMENT has a newline in it. + + */ + + public function read() + { + echo 'hello'; + + // no errors below. + $array = array( + 'this', + 'that' => array( + 'hello', + 'hello again' => array( + 'hello', + ), + ), + ); + } +} + +abstract class Test3 +{ + public function parse() + { + + foreach ($t as $ndx => $token) { + if (is_array($token)) { + echo 'here'; + } else { + $ts[] = array("token" => $token, "value" => ''); + + $last = count($ts) - 1; + + switch ($token) { + case '(': + + if ($last >= 3 && + $ts[0]['token'] != T_CLASS && + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && + $ts[$last - 3]['token'] == T_VARIABLE ) { + + + if (true) { + echo 'hello'; + } + } + array_push($braces, $token); + break; + } + } + } + } +} + +function test() +{ + $o = << + + + + doSomething( + function () { + echo 123; + } + ); + } +} + +some_function( + function() { + $a = 403; + if ($a === 404) { + $a = 403; + } + } +); + +some_function( + function() { + $a = 403; + if ($a === 404) { + $a = 403; + } + } +); + +$myFunction = function() { + $a = 403; + if ($a === 404) { + $a = 403; + } +}; + +class Whatever +{ + protected $_protectedArray = array( + 'normalString' => 'That email address is already in use!', + 'offendingString' => <<<'STRING' +Each line of this string is always said to be at column 0, + no matter how many spaces are placed + at the beginning of each line +and the ending STRING on the next line is reported as having to be indented. +STRING + ); +} + +class MyClass +{ + public static function myFunction() + { + if (empty($keywords) === FALSE) { + $keywords = 'foo'; + $existing = 'foo'; + } + + return $keywords; + + }//end myFunction() + +}//end class + +$var = call_user_func( + $new_var = function () use (&$a) { + if ($a > 0) { + return $a++; + } else { + return $a--; + } + } +); + +class AnonymousFn +{ + public function getAnonFn() + { + return array( + 'functions' => Array( + 'function1' => function ($a, $b, $c) { + $a = $b + $c; + $b = $c / 2; + return Array($a, $b, $c); + }, + ), + ); + } +} +?> + +
    + +
    +
    + +
    +
    + +
    + + "") { + $test = true; + } else { + $test = true; + } + } + ?> + + + +
    +
    +
    + +
    +
    +
    + + +

    some text

    + function ($a) { + if ($a === true) { + echo 'hi'; + } + } +]; + +$list = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + } +]; + +if ($foo) { + foreach ($bar as $baz) { + if ($baz) { + ?> +
    +
    +
    + 1) { + echo '1'; + } + ?> +
    + 1) { + echo '1'; + } + ?> +
    + 1) { + echo '1'; + } + ?> +
    + +<?= CHtml::encode($this->pageTitle); ?> + +expects($this->at(2)) + ->with($this->callback( + function ($subject) + { + } + ) + ); + +/** @var Database $mockedDatabase */ +/** @var Container $mockedContainer */ + +echo $string->append('foo') + ->appaend('bar') + ->appaend('baz') + ->outputUsing( + function () + { + } + ); + +echo PHP_EOL; + +switch ($arg) { + case 1: + break; + case 2: + if ($arg2 == 'foo') { + } + case 3: + default: + echo 'default'; +} + +if ($tokens[$stackPtr]['content']{0} === '#') { +} else if ($tokens[$stackPtr]['content']{0} === '/' + && $tokens[$stackPtr]['content']{1} === '/' +) { +} + +$var = call_user_func( + function() { + if ($foo) { + $new_var = function() { + if ($a > 0) { + return $a++; + } else { + return $a--; + } + }; + } + } +); + +a( + function() { + $a = function() { + $b = false; + }; + true; + } +); + +$var = [ + [ + '1' => + function () { + return true; + }, + ], + [ + '1' => + function () { + return true; + }, + '2' => true, + ] +]; + +if ($foo) { + ?> +

    + self::_replaceKeywords($failingComment, $result), + 'screenshot' => Test::getScreenshotPath( + $projectid, + $result['class_name'], + ), + ); + +} + +$this->mockedDatabase + ->with( + $this->callback( + function () { + return; + } + ) + ); + +$this->subject->recordLogin(); + +function a() +{ + if (true) { + static::$a[$b] = + static::where($c) + ->where($c) + ->where( + function ($d) { + $d->whereNull(); + $d->orWhere(); + } + ) + ->first(); + + if (static::$a[$b] === null) { + static::$a[$b] = new static( + array( + 'a' => $a->id, + 'a' => $a->id, + ) + ); + } + } + + return static::$a[$b]; +} + +$foo->load( + array( + 'bar' => function ($baz) { + $baz->call(); + } + ) +); + +hello(); + +$foo = array_unique( + array_map( + function ($entry) { + return $entry * 2; + }, + array() + ) +); +bar($foo); + +class PHP_CodeSniffer_Tokenizers_JS +{ + + public $scopeOpeners = array( + T_CASE => array( + 'end' => array( + T_BREAK => T_BREAK, + T_RETURN => T_RETURN, + ), + 'strict' => true, + ), + ); +} + +echo $string-> + append('foo')-> + appaend('bar')-> + appaend('baz')-> + outputUsing( + function () + { + } + ); + +$str = 'the items I want to show are: ' . + implode( + ', ', + array('a', 'b', 'c') + ); + +echo $str; + +$str = 'foo' + . '1' + . '2'; + +echo $str; + +bar([ + 'foo' => foo(function () { + return 'foo'; + }) +]); + +$domains = array_unique( + array_map( + function ($url) { + $urlObject = new \Purl\Url($url); + return $urlObject->registerableDomain; + }, + $sites + ) +); + +return $domains; + +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; + +if ($foo): +if ($bar) $foo = 1; +elseif ($baz) $foo = 2; +endif; + +$this + ->method(array( + 'foo' => 'bar', + ), 'arg', array( + 'foo' => 'bar', + )); + +class Foo +{ + use Bar { + myMethod as renamedMethod; + } +} + +class Foo +{ + use Bar { + myMethod as renamedMethod; + } +} + +foo(); + +array( + 'key1' => function ($bar) { + return $bar; + }, + 'key2' => function ($foo) { + return $foo; + }, +); + +?> + + 1, + ]; +$c = 2; + +class foo +{ + public function get() + { + $foo = ['b' => 'c', + 'd' => [ + ['e' => 'f'] + ]]; + echo '42'; + + $foo = array('b' => 'c', + 'd' => array( + array('e' => 'f') + )); + echo '42'; + } +} + +switch ($foo) { + case 1: + return array(); + case 2: + return ''; + case 3: + return $function(); + case 4: + return $functionCall($param[0]); + case 5: + return array() + array(); // Array Merge + case 6: + // String connect + return $functionReturningString('') . $functionReturningString(array()); + case 7: + return functionCall( + $withMultiLineParam[0], + array(), + $functionReturningString( + $withMultiLineParam[1] + ) + ); + case 8: + return $param[0][0]; +} + +class Test { + + public + $foo + ,$bar + ,$baz = [ ] + ; + + public function wtfindent() { + } +} + +switch ($x) { + case 1: + return [1]; + default: + return [2]; +} + +switch ($foo) { + case self::FOO: + return $this->bar($gfoo, function ($id) { + return FOO::bar($id); + }, $values); + case self::BAR: + $values = $this->bar($foo, $values); + break; +} + +$var = array( + 'long description' => + array(0, 'something'), + 'another long description' => + array(1, "something else") +); + +$services = array( + 'service 1' => + Mockery::mock('class 1') + ->shouldReceive('setFilter')->once() + ->shouldReceive('getNbResults')->atLeast()->once() + ->shouldReceive('getSlice')->once()->andReturn(array()) + ->getMock(), + 'service 2' => + Mockery::mock('class 2') + ->shouldReceive('__invoke')->once() + ->getMock() +); + +class Foo +{ + public function setUp() + { + $this->foo = new class { + public $name = 'Some value'; + }; + } +} + +try { + foo(); +} catch (\Exception $e) { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} + +if ($foo) { + foo(); +} else if ($e) { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} else { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} + +switch ($parameter) { + case null: + return [ + 'foo' => in_array( + 'foo', + [] + ), + ]; + + default: + return []; +} + +class SomeClass +{ + public function someFunc() + { + a(function () { + echo "a"; + })->b(function () { + echo "b"; + }); + + if (true) { + echo "c"; + } + echo "d"; + } +} + +$params = self::validate_parameters(self::read_competency_framework_parameters(), + array( + 'id' => $id, + )); + +$framework = api::read_framework($params['id']); +self::validate_context($framework->get_context()); +$output = $PAGE->get_renderer('tool_lp'); + +class Test123 +{ + protected static + $prop1 = [ + 'testA' => 123, + ], + $prop2 = [ + 'testB' => 456, + ]; + + protected static + $prop3 = array( + 'testA' => 123, + ), + $prop4 = array( + 'testB' => 456, + ); + + protected static $prop5; +} + +$foo = foo( + function () { + $foo->debug( + $a, + $b + ); + + if ($a) { + $b = $a; + } + } +); + +if (somethingIsTrue()) { + ?> +
    + +
    + bar(foo(function () { + }), foo(function () { + })); + +echo 'foo'; + +class Test { + + public function a() { + ?>adebug( + $a, + $b + ); + + if ($a) { + $b = $a; + } + } +); + +function test() +{ + $array = []; + foreach ($array as $data) { + [ + 'key1' => $var1, + 'key2' => $var2, + ] = $data; + foreach ($var1 as $method) { + echo $method . $var2; + } + } +} + +switch ($a) { + case 0: + $a = function () { + }; + case 1: + break; +} + +class Test +{ + public function __construct() + { +if (false) { +echo 0; + } + } +} + +return [ + 'veryLongKeySoIWantToMakeALineBreak' + => 'veryLonValueSoIWantToMakeALineBreak', + + 'someOtherKey' => [ + 'someValue' + ], + + 'arrayWithArraysInThere' => [ + ['Value1', 'Value1'] + ], +]; + +switch ($sContext) { + case 'SOMETHING': + case 'CONSTANT': + do_something(); + break; + case 'GLOBAL': + case 'GLOBAL1': + do_something(); + // Fall through + default: + { + do_something(); + } +} + +array_map( + static function ( $item ) { + echo $item; + }, + $some_array +); + +/** + * Comment. + */ +$a(function () use ($app) { + echo 'hi'; +})(); + +$app->run(); + +function foo() +{ + $foo('some + long description', function () { + }); + + $foo('some + long + description', function () { + }); + + $foo( +'some long description', function () { + }); +} + +switch ( $a ) { +case 'a': + $b = 2; + /** + * A comment. + */ + apply_filter( 'something', $b ); + break; + +case 'aa': + $b = 2; + /* + * A comment. + */ + apply_filter( 'something', $b ); + break; + +case 'b': + $b = 3; +?> + + + + + +
    + +
    + +
    + +
    + + +
    + + + +
    + [ + ], + 'b' => <<<'FOO' +foo; +FOO + ], + $a, +]; + +$query = Model::query() + ->when($a, function () { + static $b = ''; + }); + +$result = array_map( + static fn(int $number) : int => $number + 1, + $numbers +); + +$a = $a === true ? [ + 'a' => 1, + ] : [ + 'a' => 100, +]; + +return [ + Url::make('View Song', fn($song) => $song->url()) + ->onlyOnDetail(), + + new Panel('Information', [ + Text::make('Title') + ]), +]; + +echo $string?->append('foo') + ?->outputUsing(); + +// phpcs:set Generic.WhiteSpace.ScopeIndent exact true +echo $string?->append('foo') + ?->outputUsing(); +// phpcs:set Generic.WhiteSpace.ScopeIndent exact false + +if (true) { + ?> null, + false => false, + 1, 2, 3 => true, + default => $value, +}; + +$value = match ($value) { + '' => null, +false => false, + 1, 2, 3 => true, + default => $value, +}; + +$value = match ( + $value + ) { + '' => null, + false + => false, + 1, + 2, + 3 => true, + default => +$value, +}; + +function toString(): string +{ + return sprintf( + '%s', + match ($type) { + 'foo' => 'bar', + }, + ); +} + +$list = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + }, + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + $list2 = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + } + ]; + } + } +]; + +$foo = match ($type) { + 'a' => [ + 'aa' => 'DESC', + 'ab' => 'DESC', + ], + 'b' => [ + 'ba' => 'DESC', + 'bb' => 'DESC', + ], + default => [ + 'da' => 'DESC', + ], +}; + +$a = [ + 'a' => [ + 'a' => fn () => foo() + ], + 'a' => [ + 'a' => 'a', + ] +]; + +switch ($foo) { + case 'a': + $foo = match ($foo) { + 'bar' => 'custom_1', + default => 'a' + }; + return $foo; + case 'b': + return match ($foo) { + 'bar' => 'custom_1', + default => 'b' + }; + default: + return 'default'; +} + +foo(function ($foo) { + return [ + match ($foo) { + } + ]; +}); + +// Issue #110. +echo match (1) { + 0 => match (2) { + 2 => match (3) { + 3 => 3, + default => -1, + }, + }, + 1 => match (2) { + 1 => match (3) { + 3 => 3, + default => -1, + }, + 2 => match (3) { + 3 => 3, + default => -1, + }, + }, +}; + +// Issue #437. +match (true) { + default => [ + 'unrelated' => '', + 'example' => array_filter( + array_map( + function () { + return null; + }, + [] + ) + ) + ] +}; + +/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ +?> + + + + + + + <<<'INTRO' + lorem ipsum + INTRO, + 'em' => [ + [ + '', + ], + ], + 'abc' => [ + 'a' => 'wop wop', + 'b' => 'ola ola.', + ], +]; + +echo "" diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed new file mode 100644 index 00000000..dbbfa71c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed @@ -0,0 +1,1653 @@ +phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false + +hello(); + } + + function hello() + { + echo 'hello'; + }//end hello() + + function hello2() + { + if (TRUE) { + echo 'hello'; // no error here as its more than 4 spaces. + } else { + echo 'bye'; + } + + while (TRUE) { + echo 'hello'; + } + + do { + echo 'hello'; + } while (TRUE); + } + + function hello3() + { + switch ($hello) { + case 'hello': + break; + } + } + +} + +?> +
    +
    +
    +validate()) {
    +    $safe = $form->getSubmitValues();
    +}
    +?>
    +
    +open(); // error here + } + + public function open() + { + // Some inline stuff that shouldn't error + if (TRUE) echo 'hello'; + foreach ($tokens as $token) echo $token; + } + + /** + * This is a comment 1. + * This is a comment 2. + * This is a comment 3. + * This is a comment 4. + */ + public function close() + { + // All ok. + if (TRUE) { + if (TRUE) { + } else if (FALSE) { + foreach ($tokens as $token) { + switch ($token) { + case '1': + case '2': + if (true) { + if (false) { + if (false) { + if (false) { + echo 'hello'; + } + } + } + } + break; + case '5': + break; + } + do { + while (true) { + foreach ($tokens as $token) { + for ($i = 0; $i < $token; $i++) { + echo 'hello'; + } + } + } + } while (true); + } + } + } + } + + /* + This is another c style comment 1. + This is another c style comment 2. + This is another c style comment 3. + This is another c style comment 4. + This is another c style comment 5. + */ + + /* This is a T_COMMENT + * + * + * + */ + + /** This is a T_DOC_COMMENT + */ + + /* + This T_COMMENT has a newline in it. + + */ + + public function read() + { + echo 'hello'; + + // no errors below. + $array = array( + 'this', + 'that' => array( + 'hello', + 'hello again' => array( + 'hello', + ), + ), + ); + } +} + +abstract class Test3 +{ + public function parse() + { + + foreach ($t as $ndx => $token) { + if (is_array($token)) { + echo 'here'; + } else { + $ts[] = array("token" => $token, "value" => ''); + + $last = count($ts) - 1; + + switch ($token) { + case '(': + + if ($last >= 3 && + $ts[0]['token'] != T_CLASS && + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && + $ts[$last - 3]['token'] == T_VARIABLE ) { + + + if (true) { + echo 'hello'; + } + } + array_push($braces, $token); + break; + } + } + } + } +} + +function test() +{ + $o = << + + + + doSomething( + function () { + echo 123; + } + ); + } +} + +some_function( + function() { + $a = 403; + if ($a === 404) { + $a = 403; + } + } +); + +some_function( + function() { + $a = 403; + if ($a === 404) { + $a = 403; + } + } +); + +$myFunction = function() { + $a = 403; + if ($a === 404) { + $a = 403; + } +}; + +class Whatever +{ + protected $_protectedArray = array( + 'normalString' => 'That email address is already in use!', + 'offendingString' => <<<'STRING' +Each line of this string is always said to be at column 0, + no matter how many spaces are placed + at the beginning of each line +and the ending STRING on the next line is reported as having to be indented. +STRING + ); +} + +class MyClass +{ + public static function myFunction() + { + if (empty($keywords) === FALSE) { + $keywords = 'foo'; + $existing = 'foo'; + } + + return $keywords; + + }//end myFunction() + +}//end class + +$var = call_user_func( + $new_var = function () use (&$a) { + if ($a > 0) { + return $a++; + } else { + return $a--; + } + } +); + +class AnonymousFn +{ + public function getAnonFn() + { + return array( + 'functions' => Array( + 'function1' => function ($a, $b, $c) { + $a = $b + $c; + $b = $c / 2; + return Array($a, $b, $c); + }, + ), + ); + } +} +?> + +
    + +
    +
    + +
    +
    + +
    + + "") { + $test = true; + } else { + $test = true; + } + } + ?> + + + +
    +
    +
    + +
    +
    +
    + + +

    some text

    + function ($a) { + if ($a === true) { + echo 'hi'; + } + } +]; + +$list = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + } +]; + +if ($foo) { + foreach ($bar as $baz) { + if ($baz) { + ?> +
    +
    +
    + 1) { + echo '1'; + } + ?> +
    + 1) { + echo '1'; + } + ?> +
    + 1) { + echo '1'; + } + ?> +
    + +<?= CHtml::encode($this->pageTitle); ?> + +expects($this->at(2)) + ->with($this->callback( + function ($subject) + { + } + ) + ); + +/** @var Database $mockedDatabase */ +/** @var Container $mockedContainer */ + +echo $string->append('foo') + ->appaend('bar') + ->appaend('baz') + ->outputUsing( + function () + { + } + ); + +echo PHP_EOL; + +switch ($arg) { + case 1: + break; + case 2: + if ($arg2 == 'foo') { + } + case 3: + default: + echo 'default'; +} + +if ($tokens[$stackPtr]['content']{0} === '#') { +} else if ($tokens[$stackPtr]['content']{0} === '/' + && $tokens[$stackPtr]['content']{1} === '/' +) { +} + +$var = call_user_func( + function() { + if ($foo) { + $new_var = function() { + if ($a > 0) { + return $a++; + } else { + return $a--; + } + }; + } + } +); + +a( + function() { + $a = function() { + $b = false; + }; + true; + } +); + +$var = [ + [ + '1' => + function () { + return true; + }, + ], + [ + '1' => + function () { + return true; + }, + '2' => true, + ] +]; + +if ($foo) { + ?> +

    + self::_replaceKeywords($failingComment, $result), + 'screenshot' => Test::getScreenshotPath( + $projectid, + $result['class_name'], + ), + ); + +} + +$this->mockedDatabase + ->with( + $this->callback( + function () { + return; + } + ) + ); + +$this->subject->recordLogin(); + +function a() +{ + if (true) { + static::$a[$b] = + static::where($c) + ->where($c) + ->where( + function ($d) { + $d->whereNull(); + $d->orWhere(); + } + ) + ->first(); + + if (static::$a[$b] === null) { + static::$a[$b] = new static( + array( + 'a' => $a->id, + 'a' => $a->id, + ) + ); + } + } + + return static::$a[$b]; +} + +$foo->load( + array( + 'bar' => function ($baz) { + $baz->call(); + } + ) +); + +hello(); + +$foo = array_unique( + array_map( + function ($entry) { + return $entry * 2; + }, + array() + ) +); +bar($foo); + +class PHP_CodeSniffer_Tokenizers_JS +{ + + public $scopeOpeners = array( + T_CASE => array( + 'end' => array( + T_BREAK => T_BREAK, + T_RETURN => T_RETURN, + ), + 'strict' => true, + ), + ); +} + +echo $string-> + append('foo')-> + appaend('bar')-> + appaend('baz')-> + outputUsing( + function () + { + } + ); + +$str = 'the items I want to show are: ' . + implode( + ', ', + array('a', 'b', 'c') + ); + +echo $str; + +$str = 'foo' + . '1' + . '2'; + +echo $str; + +bar([ + 'foo' => foo(function () { + return 'foo'; + }) +]); + +$domains = array_unique( + array_map( + function ($url) { + $urlObject = new \Purl\Url($url); + return $urlObject->registerableDomain; + }, + $sites + ) +); + +return $domains; + +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; + +if ($foo): + if ($bar) $foo = 1; + elseif ($baz) $foo = 2; +endif; + +$this + ->method(array( + 'foo' => 'bar', + ), 'arg', array( + 'foo' => 'bar', + )); + +class Foo +{ + use Bar { + myMethod as renamedMethod; + } +} + +class Foo +{ + use Bar { + myMethod as renamedMethod; + } +} + +foo(); + +array( + 'key1' => function ($bar) { + return $bar; + }, + 'key2' => function ($foo) { + return $foo; + }, +); + +?> + + 1, + ]; +$c = 2; + +class foo +{ + public function get() + { + $foo = ['b' => 'c', + 'd' => [ + ['e' => 'f'] + ]]; + echo '42'; + + $foo = array('b' => 'c', + 'd' => array( + array('e' => 'f') + )); + echo '42'; + } +} + +switch ($foo) { + case 1: + return array(); + case 2: + return ''; + case 3: + return $function(); + case 4: + return $functionCall($param[0]); + case 5: + return array() + array(); // Array Merge + case 6: + // String connect + return $functionReturningString('') . $functionReturningString(array()); + case 7: + return functionCall( + $withMultiLineParam[0], + array(), + $functionReturningString( + $withMultiLineParam[1] + ) + ); + case 8: + return $param[0][0]; +} + +class Test { + + public + $foo + ,$bar + ,$baz = [ ] + ; + + public function wtfindent() { + } +} + +switch ($x) { + case 1: + return [1]; + default: + return [2]; +} + +switch ($foo) { + case self::FOO: + return $this->bar($gfoo, function ($id) { + return FOO::bar($id); + }, $values); + case self::BAR: + $values = $this->bar($foo, $values); + break; +} + +$var = array( + 'long description' => + array(0, 'something'), + 'another long description' => + array(1, "something else") +); + +$services = array( + 'service 1' => + Mockery::mock('class 1') + ->shouldReceive('setFilter')->once() + ->shouldReceive('getNbResults')->atLeast()->once() + ->shouldReceive('getSlice')->once()->andReturn(array()) + ->getMock(), + 'service 2' => + Mockery::mock('class 2') + ->shouldReceive('__invoke')->once() + ->getMock() +); + +class Foo +{ + public function setUp() + { + $this->foo = new class { + public $name = 'Some value'; + }; + } +} + +try { + foo(); +} catch (\Exception $e) { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} + +if ($foo) { + foo(); +} else if ($e) { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} else { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} + +switch ($parameter) { + case null: + return [ + 'foo' => in_array( + 'foo', + [] + ), + ]; + + default: + return []; +} + +class SomeClass +{ + public function someFunc() + { + a(function () { + echo "a"; + })->b(function () { + echo "b"; + }); + + if (true) { + echo "c"; + } + echo "d"; + } +} + +$params = self::validate_parameters(self::read_competency_framework_parameters(), + array( + 'id' => $id, + )); + +$framework = api::read_framework($params['id']); +self::validate_context($framework->get_context()); +$output = $PAGE->get_renderer('tool_lp'); + +class Test123 +{ + protected static + $prop1 = [ + 'testA' => 123, + ], + $prop2 = [ + 'testB' => 456, + ]; + + protected static + $prop3 = array( + 'testA' => 123, + ), + $prop4 = array( + 'testB' => 456, + ); + + protected static $prop5; +} + +$foo = foo( + function () { + $foo->debug( + $a, + $b + ); + + if ($a) { + $b = $a; + } + } +); + +if (somethingIsTrue()) { + ?> +
    + +
    + bar(foo(function () { + }), foo(function () { + })); + +echo 'foo'; + +class Test { + + public function a() { + ?>adebug( + $a, + $b + ); + + if ($a) { + $b = $a; + } + } +); + +function test() +{ + $array = []; + foreach ($array as $data) { + [ + 'key1' => $var1, + 'key2' => $var2, + ] = $data; + foreach ($var1 as $method) { + echo $method . $var2; + } + } +} + +switch ($a) { + case 0: + $a = function () { + }; + case 1: + break; +} + +class Test +{ + public function __construct() + { + if (false) { + echo 0; + } + } +} + +return [ + 'veryLongKeySoIWantToMakeALineBreak' + => 'veryLonValueSoIWantToMakeALineBreak', + + 'someOtherKey' => [ + 'someValue' + ], + + 'arrayWithArraysInThere' => [ + ['Value1', 'Value1'] + ], +]; + +switch ($sContext) { + case 'SOMETHING': + case 'CONSTANT': + do_something(); + break; + case 'GLOBAL': + case 'GLOBAL1': + do_something(); + // Fall through + default: + { + do_something(); + } +} + +array_map( + static function ( $item ) { + echo $item; + }, + $some_array +); + +/** + * Comment. + */ +$a(function () use ($app) { + echo 'hi'; +})(); + +$app->run(); + +function foo() +{ + $foo('some + long description', function () { + }); + + $foo('some + long + description', function () { + }); + + $foo( + 'some long description', function () { + }); +} + +switch ( $a ) { + case 'a': + $b = 2; + /** + * A comment. + */ + apply_filter( 'something', $b ); + break; + + case 'aa': + $b = 2; + /* + * A comment. + */ + apply_filter( 'something', $b ); + break; + + case 'b': + $b = 3; + ?> + + + + + +
    + +
    + +
    + +
    + + +
    + + + +
    + [ + ], + 'b' => <<<'FOO' +foo; +FOO + ], + $a, +]; + +$query = Model::query() + ->when($a, function () { + static $b = ''; + }); + +$result = array_map( + static fn(int $number) : int => $number + 1, + $numbers +); + +$a = $a === true ? [ + 'a' => 1, + ] : [ + 'a' => 100, +]; + +return [ + Url::make('View Song', fn($song) => $song->url()) + ->onlyOnDetail(), + + new Panel('Information', [ + Text::make('Title') + ]), +]; + +echo $string?->append('foo') + ?->outputUsing(); + +// phpcs:set Generic.WhiteSpace.ScopeIndent exact true +echo $string?->append('foo') + ?->outputUsing(); +// phpcs:set Generic.WhiteSpace.ScopeIndent exact false + +if (true) { + ?> null, + false => false, + 1, 2, 3 => true, + default => $value, +}; + +$value = match ($value) { + '' => null, + false => false, + 1, 2, 3 => true, + default => $value, +}; + +$value = match ( + $value + ) { + '' => null, + false + => false, + 1, + 2, + 3 => true, + default => + $value, +}; + +function toString(): string +{ + return sprintf( + '%s', + match ($type) { + 'foo' => 'bar', + }, + ); +} + +$list = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + }, + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + $list2 = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + } + ]; + } + } +]; + +$foo = match ($type) { + 'a' => [ + 'aa' => 'DESC', + 'ab' => 'DESC', + ], + 'b' => [ + 'ba' => 'DESC', + 'bb' => 'DESC', + ], + default => [ + 'da' => 'DESC', + ], +}; + +$a = [ + 'a' => [ + 'a' => fn () => foo() + ], + 'a' => [ + 'a' => 'a', + ] +]; + +switch ($foo) { + case 'a': + $foo = match ($foo) { + 'bar' => 'custom_1', + default => 'a' + }; + return $foo; + case 'b': + return match ($foo) { + 'bar' => 'custom_1', + default => 'b' + }; + default: + return 'default'; +} + +foo(function ($foo) { + return [ + match ($foo) { + } + ]; +}); + +// Issue #110. +echo match (1) { + 0 => match (2) { + 2 => match (3) { + 3 => 3, + default => -1, + }, + }, + 1 => match (2) { + 1 => match (3) { + 3 => 3, + default => -1, + }, + 2 => match (3) { + 3 => 3, + default => -1, + }, + }, +}; + +// Issue #437. +match (true) { + default => [ + 'unrelated' => '', + 'example' => array_filter( + array_map( + function () { + return null; + }, + [] + ) + ) + ] +}; + +/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ +?> + + + + + + + <<<'INTRO' + lorem ipsum + INTRO, + 'em' => [ + [ + '', + ], + ], + 'abc' => [ + 'a' => 'wop wop', + 'b' => 'ola ola.', + ], +]; + +echo "" diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js new file mode 100644 index 00000000..2195bfb9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js @@ -0,0 +1,239 @@ +phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false +var script = document.createElement('script'); +script.onload = function() +{ + clearTimeout(t); + script456.onload = null; + script.onreadystatechange = null; + callback.call(this); + +}; + +this.callbacks[type] = { + namespaces: {}, +others: [] +}; + +blah = function() +{ + print something; + + } + +test(blah, function() { + print something; +}); + +var test = [{x: 10}]; +var test = [{ + x: 10, + y: { + b14h: 12, + 'b14h': 12 + }, + z: 23 +}]; + +Viper.prototype = { + + _removeEvents: function(elem) + { + if (!elem) { + elem = this.element; + } + + ViperUtil.removeEvent(elem, '.' + this.getEventNamespace()); + + } + +}; + +this.init = function(data) { + if (_pageListWdgt) { + GUI.getWidget('changedPagesList').addItemClickedCallback( + function(itemid, target) { + draftChangeTypeClicked( + itemid, + target, + { + reviewData: _reviewData, + pageid: itemid + } + ); + } + ); + }//end if + +}; + +a( + function() { + var _a = function() { + b = false; + + }; + true + } +); + +(function() { + a = function() { + a(function() { + if (true) { + a = true; + } + }); + + a( + function() { + if (true) { + if (true) { + a = true; + } + } + } + ); + + a( + function() { + if (true) { + a = true; + } + } + ); + + }; + +})(); + +a.prototype = { + + a: function() + { + var currentSize = null; + ViperUtil.addEvent( + header, + 'safedblclick', + function() {}, + ); + + if (topContent) { + ViperUtil.addClass(topContent, 'Viper-popup-top'); + main.appendChild(topContent); + } + + ViperUtil.addClass(midContent, 'Viper-popup-content'); + main.appendChild(midContent); + } + +}; + +a.prototype = { + + a: function() + { + ViperUtil.addClass(midContent, 'Viper-popup-content'); + main.appendChild(midContent); + + var mouseUpAction = function() {}; + var preventMouseUp = false; + var self = this; + if (clickAction) { + } + } + +}; + +a.prototype = { + + a: function() + { + var a = function() { + var a = 'foo'; + }; + + if (true) { + } + + }, + + b: function() + { + ViperUtil.addEvent( + function() { + if (fullScreen !== true) { + currentSize = { + }; + + showfullScreen(); + } + } + ); + + }, + + c: function() + { + this.a( + { + a: function() { + form.onsubmit = function() { + return false; + }; + + var a = true; + } + } + ); + + } + +}; + +a.prototype = { + init: function() + {}, + + _b: function() + { + } + +}; + +for (var i = 0; i < 10; i++) { + var foo = {foo:{'a':'b', + 'c':'d'}}; +} + +class TestOk +{ + destroy() + { + setTimeout(a, 1000); + + if (typeof self.callbackOnClose === "function") { + self.callbackOnClose(); + } + } +} + +class TestBad +{ + destroy() + { + setTimeout(function () { + return; + }, 1000); + + if (typeof self.callbackOnClose === "function") { + self.callbackOnClose(); + } + } +} + +( function( $ ) { + foo(function( value ) { + value.bind( function( newval ) { + $( '#bar' ).html( newval ); + } ); + } )( jQuery ); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed new file mode 100644 index 00000000..d4bf409b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed @@ -0,0 +1,239 @@ +phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false +var script = document.createElement('script'); +script.onload = function() +{ + clearTimeout(t); + script456.onload = null; + script.onreadystatechange = null; + callback.call(this); + +}; + +this.callbacks[type] = { + namespaces: {}, + others: [] +}; + +blah = function() +{ + print something; + +} + +test(blah, function() { + print something; +}); + +var test = [{x: 10}]; +var test = [{ + x: 10, + y: { + b14h: 12, + 'b14h': 12 + }, + z: 23 +}]; + +Viper.prototype = { + + _removeEvents: function(elem) + { + if (!elem) { + elem = this.element; + } + + ViperUtil.removeEvent(elem, '.' + this.getEventNamespace()); + + } + +}; + +this.init = function(data) { + if (_pageListWdgt) { + GUI.getWidget('changedPagesList').addItemClickedCallback( + function(itemid, target) { + draftChangeTypeClicked( + itemid, + target, + { + reviewData: _reviewData, + pageid: itemid + } + ); + } + ); + }//end if + +}; + +a( + function() { + var _a = function() { + b = false; + + }; + true + } +); + +(function() { + a = function() { + a(function() { + if (true) { + a = true; + } + }); + + a( + function() { + if (true) { + if (true) { + a = true; + } + } + } + ); + + a( + function() { + if (true) { + a = true; + } + } + ); + + }; + +})(); + +a.prototype = { + + a: function() + { + var currentSize = null; + ViperUtil.addEvent( + header, + 'safedblclick', + function() {}, + ); + + if (topContent) { + ViperUtil.addClass(topContent, 'Viper-popup-top'); + main.appendChild(topContent); + } + + ViperUtil.addClass(midContent, 'Viper-popup-content'); + main.appendChild(midContent); + } + +}; + +a.prototype = { + + a: function() + { + ViperUtil.addClass(midContent, 'Viper-popup-content'); + main.appendChild(midContent); + + var mouseUpAction = function() {}; + var preventMouseUp = false; + var self = this; + if (clickAction) { + } + } + +}; + +a.prototype = { + + a: function() + { + var a = function() { + var a = 'foo'; + }; + + if (true) { + } + + }, + + b: function() + { + ViperUtil.addEvent( + function() { + if (fullScreen !== true) { + currentSize = { + }; + + showfullScreen(); + } + } + ); + + }, + + c: function() + { + this.a( + { + a: function() { + form.onsubmit = function() { + return false; + }; + + var a = true; + } + } + ); + + } + +}; + +a.prototype = { + init: function() + {}, + + _b: function() + { + } + +}; + +for (var i = 0; i < 10; i++) { + var foo = {foo:{'a':'b', + 'c':'d'}}; +} + +class TestOk +{ + destroy() + { + setTimeout(a, 1000); + + if (typeof self.callbackOnClose === "function") { + self.callbackOnClose(); + } + } +} + +class TestBad +{ + destroy() + { + setTimeout(function () { + return; + }, 1000); + + if (typeof self.callbackOnClose === "function") { + self.callbackOnClose(); + } + } +} + +( function( $ ) { + foo(function( value ) { + value.bind( function( newval ) { + $( '#bar' ).html( newval ); + } ); + } )( jQuery ); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc new file mode 100644 index 00000000..de344f9f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc @@ -0,0 +1,1653 @@ +phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent true + +hello(); + } + + function hello() + { + echo 'hello'; +}//end hello() + + function hello2() + { + if (TRUE) { + echo 'hello'; // no error here as its more than 4 spaces. + } else { + echo 'bye'; + } + + while (TRUE) { + echo 'hello'; + } + + do { + echo 'hello'; + } while (TRUE); + } + + function hello3() + { + switch ($hello) { + case 'hello': + break; + } + } + +} + +?> +
    +
    +
    +validate()) {
    +	$safe = $form->getSubmitValues();
    +}
    +?>
    +
    +open(); // error here + } + + public function open() + { + // Some inline stuff that shouldn't error + if (TRUE) echo 'hello'; + foreach ($tokens as $token) echo $token; + } + + /** + * This is a comment 1. + * This is a comment 2. + * This is a comment 3. + * This is a comment 4. + */ + public function close() + { + // All ok. + if (TRUE) { + if (TRUE) { + } else if (FALSE) { + foreach ($tokens as $token) { + switch ($token) { + case '1': + case '2': + if (true) { + if (false) { + if (false) { + if (false) { + echo 'hello'; + } + } + } + } + break; + case '5': + break; + } + do { + while (true) { + foreach ($tokens as $token) { + for ($i = 0; $i < $token; $i++) { + echo 'hello'; + } + } + } + } while (true); + } + } + } + } + + /* + This is another c style comment 1. + This is another c style comment 2. + This is another c style comment 3. + This is another c style comment 4. + This is another c style comment 5. + */ + + /* This is a T_COMMENT + * + * + * + */ + + /** This is a T_DOC_COMMENT + */ + + /* + This T_COMMENT has a newline in it. + + */ + + public function read() + { + echo 'hello'; + + // no errors below. + $array = array( + 'this', + 'that' => array( + 'hello', + 'hello again' => array( + 'hello', + ), + ), + ); + } +} + +abstract class Test3 +{ + public function parse() + { + + foreach ($t as $ndx => $token) { + if (is_array($token)) { + echo 'here'; + } else { + $ts[] = array("token" => $token, "value" => ''); + + $last = count($ts) - 1; + + switch ($token) { + case '(': + + if ($last >= 3 && + $ts[0]['token'] != T_CLASS && + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && + $ts[$last - 3]['token'] == T_VARIABLE ) { + + + if (true) { + echo 'hello'; + } + } + array_push($braces, $token); + break; + } + } + } + } +} + +function test() +{ + $o = << + + + + doSomething( + function () { + echo 123; + } + ); + } +} + +some_function( + function() { + $a = 403; + if ($a === 404) { + $a = 403; + } + } +); + +some_function( + function() { + $a = 403; + if ($a === 404) { + $a = 403; + } + } +); + +$myFunction = function() { + $a = 403; + if ($a === 404) { + $a = 403; + } +}; + +class Whatever +{ + protected $_protectedArray = array( + 'normalString' => 'That email address is already in use!', + 'offendingString' => <<<'STRING' +Each line of this string is always said to be at column 0, + no matter how many spaces are placed + at the beginning of each line +and the ending STRING on the next line is reported as having to be indented. +STRING + ); +} + +class MyClass +{ + public static function myFunction() + { + if (empty($keywords) === FALSE) { + $keywords = 'foo'; + $existing = 'foo'; + } + + return $keywords; + + }//end myFunction() + +}//end class + +$var = call_user_func( + $new_var = function () use (&$a) { + if ($a > 0) { + return $a++; + } else { + return $a--; + } + } +); + +class AnonymousFn +{ + public function getAnonFn() + { + return array( + 'functions' => Array( + 'function1' => function ($a, $b, $c) { + $a = $b + $c; + $b = $c / 2; + return Array($a, $b, $c); + }, + ), + ); + } +} +?> + +
    + +
    +
    + +
    +
    + +
    + + "") { + $test = true; + } else { + $test = true; + } + } + ?> + + + +
    +
    +
    + +
    +
    +
    + + +

    some text

    + function ($a) { + if ($a === true) { + echo 'hi'; + } + } +]; + +$list = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + } +]; + +if ($foo) { + foreach ($bar as $baz) { + if ($baz) { + ?> +
    +
    +
    + 1) { + echo '1'; + } + ?> +
    + 1) { + echo '1'; + } + ?> +
    + 1) { + echo '1'; + } + ?> +
    + +<?= CHtml::encode($this->pageTitle); ?> + +expects($this->at(2)) + ->with($this->callback( + function ($subject) + { + } + ) + ); + +/** @var Database $mockedDatabase */ +/** @var Container $mockedContainer */ + +echo $string->append('foo') + ->appaend('bar') + ->appaend('baz') + ->outputUsing( + function () + { + } + ); + +echo PHP_EOL; + +switch ($arg) { + case 1: + break; + case 2: + if ($arg2 == 'foo') { + } + case 3: + default: + echo 'default'; +} + +if ($tokens[$stackPtr]['content']{0} === '#') { +} else if ($tokens[$stackPtr]['content']{0} === '/' + && $tokens[$stackPtr]['content']{1} === '/' +) { +} + +$var = call_user_func( + function() { + if ($foo) { + $new_var = function() { + if ($a > 0) { + return $a++; + } else { + return $a--; + } + }; + } + } +); + +a( + function() { + $a = function() { + $b = false; + }; + true; + } +); + +$var = [ + [ + '1' => + function () { + return true; + }, + ], + [ + '1' => + function () { + return true; + }, + '2' => true, + ] +]; + +if ($foo) { + ?> +

    + self::_replaceKeywords($failingComment, $result), + 'screenshot' => Test::getScreenshotPath( + $projectid, + $result['class_name'], + ), + ); + +} + +$this->mockedDatabase + ->with( + $this->callback( + function () { + return; + } + ) + ); + +$this->subject->recordLogin(); + +function a() +{ + if (true) { + static::$a[$b] = + static::where($c) + ->where($c) + ->where( + function ($d) { + $d->whereNull(); + $d->orWhere(); + } + ) + ->first(); + + if (static::$a[$b] === null) { + static::$a[$b] = new static( + array( + 'a' => $a->id, + 'a' => $a->id, + ) + ); + } + } + + return static::$a[$b]; +} + +$foo->load( + array( + 'bar' => function ($baz) { + $baz->call(); + } + ) +); + +hello(); + +$foo = array_unique( + array_map( + function ($entry) { + return $entry * 2; + }, + array() + ) +); +bar($foo); + +class PHP_CodeSniffer_Tokenizers_JS +{ + + public $scopeOpeners = array( + T_CASE => array( + 'end' => array( + T_BREAK => T_BREAK, + T_RETURN => T_RETURN, + ), + 'strict' => true, + ), + ); +} + +echo $string-> + append('foo')-> + appaend('bar')-> + appaend('baz')-> + outputUsing( + function () + { + } + ); + +$str = 'the items I want to show are: ' . + implode( + ', ', + array('a', 'b', 'c') + ); + +echo $str; + +$str = 'foo' + . '1' + . '2'; + +echo $str; + +bar([ + 'foo' => foo(function () { + return 'foo'; + }) +]); + +$domains = array_unique( + array_map( + function ($url) { + $urlObject = new \Purl\Url($url); + return $urlObject->registerableDomain; + }, + $sites + ) +); + +return $domains; + +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; + +if ($foo): +if ($bar) $foo = 1; +elseif ($baz) $foo = 2; +endif; + +$this + ->method(array( + 'foo' => 'bar', + ), 'arg', array( + 'foo' => 'bar', + )); + +class Foo +{ + use Bar { + myMethod as renamedMethod; + } +} + +class Foo +{ + use Bar { + myMethod as renamedMethod; + } +} + +foo(); + +array( + 'key1' => function ($bar) { + return $bar; + }, + 'key2' => function ($foo) { + return $foo; + }, +); + +?> + + 1, + ]; +$c = 2; + +class foo +{ + public function get() + { + $foo = ['b' => 'c', + 'd' => [ + ['e' => 'f'] + ]]; + echo '42'; + + $foo = array('b' => 'c', + 'd' => array( + array('e' => 'f') + )); + echo '42'; + } +} + +switch ($foo) { + case 1: + return array(); + case 2: + return ''; + case 3: + return $function(); + case 4: + return $functionCall($param[0]); + case 5: + return array() + array(); // Array Merge + case 6: + // String connect + return $functionReturningString('') . $functionReturningString(array()); + case 7: + return functionCall( + $withMultiLineParam[0], + array(), + $functionReturningString( + $withMultiLineParam[1] + ) + ); + case 8: + return $param[0][0]; +} + +class Test { + + public + $foo + ,$bar + ,$baz = [ ] + ; + + public function wtfindent() { + } +} + +switch ($x) { + case 1: + return [1]; + default: + return [2]; +} + +switch ($foo) { + case self::FOO: + return $this->bar($gfoo, function ($id) { + return FOO::bar($id); + }, $values); + case self::BAR: + $values = $this->bar($foo, $values); + break; +} + +$var = array( + 'long description' => + array(0, 'something'), + 'another long description' => + array(1, "something else") +); + +$services = array( + 'service 1' => + Mockery::mock('class 1') + ->shouldReceive('setFilter')->once() + ->shouldReceive('getNbResults')->atLeast()->once() + ->shouldReceive('getSlice')->once()->andReturn(array()) + ->getMock(), + 'service 2' => + Mockery::mock('class 2') + ->shouldReceive('__invoke')->once() + ->getMock() +); + +class Foo +{ + public function setUp() + { + $this->foo = new class { + public $name = 'Some value'; + }; + } +} + +try { + foo(); +} catch (\Exception $e) { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} + +if ($foo) { + foo(); +} else if ($e) { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} else { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} + +switch ($parameter) { + case null: + return [ + 'foo' => in_array( + 'foo', + [] + ), + ]; + + default: + return []; +} + +class SomeClass +{ + public function someFunc() + { + a(function () { + echo "a"; + })->b(function () { + echo "b"; + }); + + if (true) { + echo "c"; + } + echo "d"; + } +} + +$params = self::validate_parameters(self::read_competency_framework_parameters(), + array( + 'id' => $id, + )); + +$framework = api::read_framework($params['id']); +self::validate_context($framework->get_context()); +$output = $PAGE->get_renderer('tool_lp'); + +class Test123 +{ + protected static + $prop1 = [ + 'testA' => 123, + ], + $prop2 = [ + 'testB' => 456, + ]; + + protected static + $prop3 = array( + 'testA' => 123, + ), + $prop4 = array( + 'testB' => 456, + ); + + protected static $prop5; +} + +$foo = foo( + function () { + $foo->debug( + $a, + $b + ); + + if ($a) { + $b = $a; + } + } +); + +if (somethingIsTrue()) { + ?> +
    + +
    + bar(foo(function () { + }), foo(function () { + })); + +echo 'foo'; + +class Test { + + public function a() { + ?>adebug( + $a, + $b + ); + + if ($a) { + $b = $a; + } + } +); + +function test() +{ + $array = []; + foreach ($array as $data) { + [ + 'key1' => $var1, + 'key2' => $var2, + ] = $data; + foreach ($var1 as $method) { + echo $method . $var2; + } + } +} + +switch ($a) { + case 0: + $a = function () { + }; + case 1: + break; +} + +class Test +{ + public function __construct() + { +if (false) { +echo 0; + } + } +} + +return [ + 'veryLongKeySoIWantToMakeALineBreak' + => 'veryLonValueSoIWantToMakeALineBreak', + + 'someOtherKey' => [ + 'someValue' + ], + + 'arrayWithArraysInThere' => [ + ['Value1', 'Value1'] + ], +]; + +switch ($sContext) { + case 'SOMETHING': + case 'CONSTANT': + do_something(); + break; + case 'GLOBAL': + case 'GLOBAL1': + do_something(); + // Fall through + default: + { + do_something(); + } +} + +array_map( + static function ( $item ) { + echo $item; + }, + $some_array +); + +/** + * Comment. + */ +$a(function () use ($app) { + echo 'hi'; +})(); + +$app->run(); + +function foo() +{ + $foo('some + long description', function () { + }); + + $foo('some + long + description', function () { + }); + + $foo( +'some long description', function () { + }); +} + +switch ( $a ) { +case 'a': + $b = 2; + /** + * A comment. + */ + apply_filter( 'something', $b ); + break; + +case 'aa': + $b = 2; + /* + * A comment. + */ + apply_filter( 'something', $b ); + break; + +case 'b': + $b = 3; +?> + + + + + +
    + +
    + +
    + +
    + + +
    + + + +
    + [ + ], + 'b' => <<<'FOO' +foo; +FOO + ], + $a, +]; + +$query = Model::query() + ->when($a, function () { + static $b = ''; + }); + +$result = array_map( + static fn(int $number) : int => $number + 1, + $numbers +); + +$a = $a === true ? [ + 'a' => 1, + ] : [ + 'a' => 100, +]; + +return [ + Url::make('View Song', fn($song) => $song->url()) + ->onlyOnDetail(), + + new Panel('Information', [ + Text::make('Title') + ]), +]; + +echo $string?->append('foo') + ?->outputUsing(); + +// phpcs:set Generic.WhiteSpace.ScopeIndent exact true +echo $string?->append('foo') + ?->outputUsing(); +// phpcs:set Generic.WhiteSpace.ScopeIndent exact false + +if (true) { + ?> null, + false => false, + 1, 2, 3 => true, + default => $value, +}; + +$value = match ($value) { + '' => null, +false => false, + 1, 2, 3 => true, + default => $value, +}; + +$value = match ( + $value + ) { + '' => null, + false + => false, + 1, + 2, + 3 => true, + default => +$value, +}; + +function toString(): string +{ + return sprintf( + '%s', + match ($type) { + 'foo' => 'bar', + }, + ); +} + +$list = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + }, + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + $list2 = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + } + ]; + } + } +]; + +$foo = match ($type) { + 'a' => [ + 'aa' => 'DESC', + 'ab' => 'DESC', + ], + 'b' => [ + 'ba' => 'DESC', + 'bb' => 'DESC', + ], + default => [ + 'da' => 'DESC', + ], +}; + +$a = [ + 'a' => [ + 'a' => fn () => foo() + ], + 'a' => [ + 'a' => 'a', + ] +]; + +switch ($foo) { + case 'a': + $foo = match ($foo) { + 'bar' => 'custom_1', + default => 'a' + }; + return $foo; + case 'b': + return match ($foo) { + 'bar' => 'custom_1', + default => 'b' + }; + default: + return 'default'; +} + +foo(function ($foo) { + return [ + match ($foo) { + } + ]; +}); + +// Issue #110. +echo match (1) { + 0 => match (2) { + 2 => match (3) { + 3 => 3, + default => -1, + }, + }, + 1 => match (2) { + 1 => match (3) { + 3 => 3, + default => -1, + }, + 2 => match (3) { + 3 => 3, + default => -1, + }, + }, +}; + +// Issue #437. +match (true) { + default => [ + 'unrelated' => '', + 'example' => array_filter( + array_map( + function () { + return null; + }, + [] + ) + ) + ] +}; + +/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ +?> + + + + + + + <<<'INTRO' + lorem ipsum + INTRO, + 'em' => [ + [ + '', + ], + ], + 'abc' => [ + 'a' => 'wop wop', + 'b' => 'ola ola.', + ], +]; + +echo "" diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed new file mode 100644 index 00000000..3cf7fb61 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed @@ -0,0 +1,1653 @@ +phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent true + +hello(); + } + + function hello() + { + echo 'hello'; + }//end hello() + + function hello2() + { + if (TRUE) { + echo 'hello'; // no error here as its more than 4 spaces. + } else { + echo 'bye'; + } + + while (TRUE) { + echo 'hello'; + } + + do { + echo 'hello'; + } while (TRUE); + } + + function hello3() + { + switch ($hello) { + case 'hello': + break; + } + } + +} + +?> +
    +
    +
    +validate()) {
    +	$safe = $form->getSubmitValues();
    +}
    +?>
    +
    +open(); // error here + } + + public function open() + { + // Some inline stuff that shouldn't error + if (TRUE) echo 'hello'; + foreach ($tokens as $token) echo $token; + } + + /** + * This is a comment 1. + * This is a comment 2. + * This is a comment 3. + * This is a comment 4. + */ + public function close() + { + // All ok. + if (TRUE) { + if (TRUE) { + } else if (FALSE) { + foreach ($tokens as $token) { + switch ($token) { + case '1': + case '2': + if (true) { + if (false) { + if (false) { + if (false) { + echo 'hello'; + } + } + } + } + break; + case '5': + break; + } + do { + while (true) { + foreach ($tokens as $token) { + for ($i = 0; $i < $token; $i++) { + echo 'hello'; + } + } + } + } while (true); + } + } + } + } + + /* + This is another c style comment 1. + This is another c style comment 2. + This is another c style comment 3. + This is another c style comment 4. + This is another c style comment 5. + */ + + /* This is a T_COMMENT + * + * + * + */ + + /** This is a T_DOC_COMMENT + */ + + /* + This T_COMMENT has a newline in it. + + */ + + public function read() + { + echo 'hello'; + + // no errors below. + $array = array( + 'this', + 'that' => array( + 'hello', + 'hello again' => array( + 'hello', + ), + ), + ); + } +} + +abstract class Test3 +{ + public function parse() + { + + foreach ($t as $ndx => $token) { + if (is_array($token)) { + echo 'here'; + } else { + $ts[] = array("token" => $token, "value" => ''); + + $last = count($ts) - 1; + + switch ($token) { + case '(': + + if ($last >= 3 && + $ts[0]['token'] != T_CLASS && + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && + $ts[$last - 3]['token'] == T_VARIABLE ) { + + + if (true) { + echo 'hello'; + } + } + array_push($braces, $token); + break; + } + } + } + } +} + +function test() +{ + $o = << + + + + doSomething( + function () { + echo 123; + } + ); + } +} + +some_function( + function() { + $a = 403; + if ($a === 404) { + $a = 403; + } + } +); + +some_function( + function() { + $a = 403; + if ($a === 404) { + $a = 403; + } + } +); + +$myFunction = function() { + $a = 403; + if ($a === 404) { + $a = 403; + } +}; + +class Whatever +{ + protected $_protectedArray = array( + 'normalString' => 'That email address is already in use!', + 'offendingString' => <<<'STRING' +Each line of this string is always said to be at column 0, + no matter how many spaces are placed + at the beginning of each line +and the ending STRING on the next line is reported as having to be indented. +STRING + ); +} + +class MyClass +{ + public static function myFunction() + { + if (empty($keywords) === FALSE) { + $keywords = 'foo'; + $existing = 'foo'; + } + + return $keywords; + + }//end myFunction() + +}//end class + +$var = call_user_func( + $new_var = function () use (&$a) { + if ($a > 0) { + return $a++; + } else { + return $a--; + } + } +); + +class AnonymousFn +{ + public function getAnonFn() + { + return array( + 'functions' => Array( + 'function1' => function ($a, $b, $c) { + $a = $b + $c; + $b = $c / 2; + return Array($a, $b, $c); + }, + ), + ); + } +} +?> + +
    + +
    +
    + +
    +
    + +
    + + "") { + $test = true; + } else { + $test = true; + } + } + ?> + + + +
    +
    +
    + +
    +
    +
    + + +

    some text

    + function ($a) { + if ($a === true) { + echo 'hi'; + } + } +]; + +$list = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + } +]; + +if ($foo) { + foreach ($bar as $baz) { + if ($baz) { + ?> +
    +
    +
    + 1) { + echo '1'; + } + ?> +
    + 1) { + echo '1'; + } + ?> +
    + 1) { + echo '1'; + } + ?> +
    + +<?= CHtml::encode($this->pageTitle); ?> + +expects($this->at(2)) + ->with($this->callback( + function ($subject) + { + } + ) + ); + +/** @var Database $mockedDatabase */ +/** @var Container $mockedContainer */ + +echo $string->append('foo') + ->appaend('bar') + ->appaend('baz') + ->outputUsing( + function () + { + } + ); + +echo PHP_EOL; + +switch ($arg) { + case 1: + break; + case 2: + if ($arg2 == 'foo') { + } + case 3: + default: + echo 'default'; +} + +if ($tokens[$stackPtr]['content']{0} === '#') { +} else if ($tokens[$stackPtr]['content']{0} === '/' + && $tokens[$stackPtr]['content']{1} === '/' +) { +} + +$var = call_user_func( + function() { + if ($foo) { + $new_var = function() { + if ($a > 0) { + return $a++; + } else { + return $a--; + } + }; + } + } +); + +a( + function() { + $a = function() { + $b = false; + }; + true; + } +); + +$var = [ + [ + '1' => + function () { + return true; + }, + ], + [ + '1' => + function () { + return true; + }, + '2' => true, + ] +]; + +if ($foo) { + ?> +

    + self::_replaceKeywords($failingComment, $result), + 'screenshot' => Test::getScreenshotPath( + $projectid, + $result['class_name'], + ), + ); + +} + +$this->mockedDatabase + ->with( + $this->callback( + function () { + return; + } + ) + ); + +$this->subject->recordLogin(); + +function a() +{ + if (true) { + static::$a[$b] = + static::where($c) + ->where($c) + ->where( + function ($d) { + $d->whereNull(); + $d->orWhere(); + } + ) + ->first(); + + if (static::$a[$b] === null) { + static::$a[$b] = new static( + array( + 'a' => $a->id, + 'a' => $a->id, + ) + ); + } + } + + return static::$a[$b]; +} + +$foo->load( + array( + 'bar' => function ($baz) { + $baz->call(); + } + ) +); + +hello(); + +$foo = array_unique( + array_map( + function ($entry) { + return $entry * 2; + }, + array() + ) +); +bar($foo); + +class PHP_CodeSniffer_Tokenizers_JS +{ + + public $scopeOpeners = array( + T_CASE => array( + 'end' => array( + T_BREAK => T_BREAK, + T_RETURN => T_RETURN, + ), + 'strict' => true, + ), + ); +} + +echo $string-> + append('foo')-> + appaend('bar')-> + appaend('baz')-> + outputUsing( + function () + { + } + ); + +$str = 'the items I want to show are: ' . + implode( + ', ', + array('a', 'b', 'c') + ); + +echo $str; + +$str = 'foo' + . '1' + . '2'; + +echo $str; + +bar([ + 'foo' => foo(function () { + return 'foo'; + }) +]); + +$domains = array_unique( + array_map( + function ($url) { + $urlObject = new \Purl\Url($url); + return $urlObject->registerableDomain; + }, + $sites + ) +); + +return $domains; + +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; + +if ($foo): + if ($bar) $foo = 1; + elseif ($baz) $foo = 2; +endif; + +$this + ->method(array( + 'foo' => 'bar', + ), 'arg', array( + 'foo' => 'bar', + )); + +class Foo +{ + use Bar { + myMethod as renamedMethod; + } +} + +class Foo +{ + use Bar { + myMethod as renamedMethod; + } +} + +foo(); + +array( + 'key1' => function ($bar) { + return $bar; + }, + 'key2' => function ($foo) { + return $foo; + }, +); + +?> + + 1, + ]; +$c = 2; + +class foo +{ + public function get() + { + $foo = ['b' => 'c', + 'd' => [ + ['e' => 'f'] + ]]; + echo '42'; + + $foo = array('b' => 'c', + 'd' => array( + array('e' => 'f') + )); + echo '42'; + } +} + +switch ($foo) { + case 1: + return array(); + case 2: + return ''; + case 3: + return $function(); + case 4: + return $functionCall($param[0]); + case 5: + return array() + array(); // Array Merge + case 6: + // String connect + return $functionReturningString('') . $functionReturningString(array()); + case 7: + return functionCall( + $withMultiLineParam[0], + array(), + $functionReturningString( + $withMultiLineParam[1] + ) + ); + case 8: + return $param[0][0]; +} + +class Test { + + public + $foo + ,$bar + ,$baz = [ ] + ; + + public function wtfindent() { + } +} + +switch ($x) { + case 1: + return [1]; + default: + return [2]; +} + +switch ($foo) { + case self::FOO: + return $this->bar($gfoo, function ($id) { + return FOO::bar($id); + }, $values); + case self::BAR: + $values = $this->bar($foo, $values); + break; +} + +$var = array( + 'long description' => + array(0, 'something'), + 'another long description' => + array(1, "something else") +); + +$services = array( + 'service 1' => + Mockery::mock('class 1') + ->shouldReceive('setFilter')->once() + ->shouldReceive('getNbResults')->atLeast()->once() + ->shouldReceive('getSlice')->once()->andReturn(array()) + ->getMock(), + 'service 2' => + Mockery::mock('class 2') + ->shouldReceive('__invoke')->once() + ->getMock() +); + +class Foo +{ + public function setUp() + { + $this->foo = new class { + public $name = 'Some value'; + }; + } +} + +try { + foo(); +} catch (\Exception $e) { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} + +if ($foo) { + foo(); +} else if ($e) { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} else { + $foo = function() { + return 'foo'; + }; + + if (true) { + } +} + +switch ($parameter) { + case null: + return [ + 'foo' => in_array( + 'foo', + [] + ), + ]; + + default: + return []; +} + +class SomeClass +{ + public function someFunc() + { + a(function () { + echo "a"; + })->b(function () { + echo "b"; + }); + + if (true) { + echo "c"; + } + echo "d"; + } +} + +$params = self::validate_parameters(self::read_competency_framework_parameters(), + array( + 'id' => $id, + )); + +$framework = api::read_framework($params['id']); +self::validate_context($framework->get_context()); +$output = $PAGE->get_renderer('tool_lp'); + +class Test123 +{ + protected static + $prop1 = [ + 'testA' => 123, + ], + $prop2 = [ + 'testB' => 456, + ]; + + protected static + $prop3 = array( + 'testA' => 123, + ), + $prop4 = array( + 'testB' => 456, + ); + + protected static $prop5; +} + +$foo = foo( + function () { + $foo->debug( + $a, + $b + ); + + if ($a) { + $b = $a; + } + } +); + +if (somethingIsTrue()) { + ?> +
    + +
    + bar(foo(function () { + }), foo(function () { + })); + +echo 'foo'; + +class Test { + + public function a() { + ?>adebug( + $a, + $b + ); + + if ($a) { + $b = $a; + } + } +); + +function test() +{ + $array = []; + foreach ($array as $data) { + [ + 'key1' => $var1, + 'key2' => $var2, + ] = $data; + foreach ($var1 as $method) { + echo $method . $var2; + } + } +} + +switch ($a) { + case 0: + $a = function () { + }; + case 1: + break; +} + +class Test +{ + public function __construct() + { + if (false) { + echo 0; + } + } +} + +return [ + 'veryLongKeySoIWantToMakeALineBreak' + => 'veryLonValueSoIWantToMakeALineBreak', + + 'someOtherKey' => [ + 'someValue' + ], + + 'arrayWithArraysInThere' => [ + ['Value1', 'Value1'] + ], +]; + +switch ($sContext) { + case 'SOMETHING': + case 'CONSTANT': + do_something(); + break; + case 'GLOBAL': + case 'GLOBAL1': + do_something(); + // Fall through + default: + { + do_something(); + } +} + +array_map( + static function ( $item ) { + echo $item; + }, + $some_array +); + +/** + * Comment. + */ +$a(function () use ($app) { + echo 'hi'; +})(); + +$app->run(); + +function foo() +{ + $foo('some + long description', function () { + }); + + $foo('some + long + description', function () { + }); + + $foo( + 'some long description', function () { + }); +} + +switch ( $a ) { + case 'a': + $b = 2; + /** + * A comment. + */ + apply_filter( 'something', $b ); + break; + + case 'aa': + $b = 2; + /* + * A comment. + */ + apply_filter( 'something', $b ); + break; + + case 'b': + $b = 3; + ?> + + + + + +
    + +
    + +
    + +
    + + +
    + + + +
    + [ + ], + 'b' => <<<'FOO' +foo; +FOO + ], + $a, +]; + +$query = Model::query() + ->when($a, function () { + static $b = ''; + }); + +$result = array_map( + static fn(int $number) : int => $number + 1, + $numbers +); + +$a = $a === true ? [ + 'a' => 1, + ] : [ + 'a' => 100, +]; + +return [ + Url::make('View Song', fn($song) => $song->url()) + ->onlyOnDetail(), + + new Panel('Information', [ + Text::make('Title') + ]), +]; + +echo $string?->append('foo') + ?->outputUsing(); + +// phpcs:set Generic.WhiteSpace.ScopeIndent exact true +echo $string?->append('foo') + ?->outputUsing(); +// phpcs:set Generic.WhiteSpace.ScopeIndent exact false + +if (true) { + ?> null, + false => false, + 1, 2, 3 => true, + default => $value, +}; + +$value = match ($value) { + '' => null, + false => false, + 1, 2, 3 => true, + default => $value, +}; + +$value = match ( + $value + ) { + '' => null, + false + => false, + 1, + 2, + 3 => true, + default => + $value, +}; + +function toString(): string +{ + return sprintf( + '%s', + match ($type) { + 'foo' => 'bar', + }, + ); +} + +$list = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + }, + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + $list2 = [ + 'fn' => function ($a) { + if ($a === true) { + echo 'hi'; + } + } + ]; + } + } +]; + +$foo = match ($type) { + 'a' => [ + 'aa' => 'DESC', + 'ab' => 'DESC', + ], + 'b' => [ + 'ba' => 'DESC', + 'bb' => 'DESC', + ], + default => [ + 'da' => 'DESC', + ], +}; + +$a = [ + 'a' => [ + 'a' => fn () => foo() + ], + 'a' => [ + 'a' => 'a', + ] +]; + +switch ($foo) { + case 'a': + $foo = match ($foo) { + 'bar' => 'custom_1', + default => 'a' + }; + return $foo; + case 'b': + return match ($foo) { + 'bar' => 'custom_1', + default => 'b' + }; + default: + return 'default'; +} + +foo(function ($foo) { + return [ + match ($foo) { + } + ]; +}); + +// Issue #110. +echo match (1) { + 0 => match (2) { + 2 => match (3) { + 3 => 3, + default => -1, + }, + }, + 1 => match (2) { + 1 => match (3) { + 3 => 3, + default => -1, + }, + 2 => match (3) { + 3 => 3, + default => -1, + }, + }, +}; + +// Issue #437. +match (true) { + default => [ + 'unrelated' => '', + 'example' => array_filter( + array_map( + function () { + return null; + }, + [] + ) + ) + ] +}; + +/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ +?> + + + + + + + <<<'INTRO' + lorem ipsum + INTRO, + 'em' => [ + [ + '', + ], + ], + 'abc' => [ + 'a' => 'wop wop', + 'b' => 'ola ola.', + ], +]; + +echo "" diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc new file mode 100644 index 00000000..55d1a06a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc @@ -0,0 +1,28 @@ +phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false +phpcs:set Generic.WhiteSpace.ScopeIndent exact true + $enabled, + 'compression' => $compression, + ] = $options; +} + +$this->foo() + ->bar() + ->baz(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed new file mode 100644 index 00000000..e9ae5ff3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed @@ -0,0 +1,28 @@ +phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false +phpcs:set Generic.WhiteSpace.ScopeIndent exact true + $enabled, + 'compression' => $compression, + ] = $options; +} + +$this->foo() + ->bar() + ->baz(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc new file mode 100644 index 00000000..e58dc4de --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc @@ -0,0 +1,6 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ScopeIndent sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff + */ +final class ScopeIndentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Get a list of CLI values to set before the file is tested. + * + * @param string $testFile The name of the file being tested. + * @param \PHP_CodeSniffer\Config $config The config data for the test run. + * + * @return void + */ + public function setCliValues($testFile, $config) + { + // Tab width setting is only needed for the tabbed file. + if ($testFile === 'ScopeIndentUnitTest.2.inc') { + $config->tabWidth = 4; + } else { + $config->tabWidth = 0; + } + + }//end setCliValues() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + if ($testFile === 'ScopeIndentUnitTest.1.js') { + return [ + 6 => 1, + 14 => 1, + 21 => 1, + 30 => 1, + 32 => 1, + 33 => 1, + 34 => 1, + 39 => 1, + 42 => 1, + 59 => 1, + 60 => 1, + 75 => 1, + 120 => 1, + 121 => 1, + 122 => 1, + 123 => 1, + 141 => 1, + 142 => 1, + 155 => 1, + 156 => 1, + 168 => 1, + 184 => 1, + ]; + }//end if + + if ($testFile === 'ScopeIndentUnitTest.3.inc') { + return [ + 6 => 1, + 7 => 1, + 10 => 1, + ]; + } + + if ($testFile === 'ScopeIndentUnitTest.4.inc') { + return []; + } + + return [ + 7 => 1, + 10 => 1, + 13 => 1, + 17 => 1, + 20 => 1, + 24 => 1, + 25 => 1, + 27 => 1, + 28 => 1, + 29 => 1, + 30 => 1, + 58 => 1, + 123 => 1, + 224 => 1, + 225 => 1, + 279 => 1, + 280 => 1, + 281 => 1, + 282 => 1, + 283 => 1, + 284 => 1, + 285 => 1, + 286 => 1, + 336 => 1, + 349 => 1, + 380 => 1, + 386 => 1, + 387 => 1, + 388 => 1, + 389 => 1, + 390 => 1, + 397 => 1, + 419 => 1, + 420 => 1, + 465 => 1, + 467 => 1, + 472 => 1, + 473 => 1, + 474 => 1, + 496 => 1, + 498 => 1, + 500 => 1, + 524 => 1, + 526 => 1, + 544 => 1, + 545 => 1, + 546 => 1, + 639 => 1, + 660 => 1, + 662 => 1, + 802 => 1, + 803 => 1, + 823 => 1, + 858 => 1, + 879 => 1, + 1163 => 1, + 1197 => 1, + 1198 => 1, + 1259 => 1, + 1264 => 1, + 1265 => 1, + 1266 => 1, + 1269 => 1, + 1272 => 1, + 1273 => 1, + 1274 => 1, + 1275 => 1, + 1276 => 1, + 1277 => 1, + 1280 => 1, + 1281 => 1, + 1282 => 1, + 1284 => 1, + 1285 => 1, + 1288 => 1, + 1289 => 1, + 1290 => 1, + 1292 => 1, + 1293 => 1, + 1310 => 1, + 1312 => 1, + 1327 => 1, + 1328 => 1, + 1329 => 1, + 1330 => 1, + 1331 => 1, + 1332 => 1, + 1335 => 1, + 1340 => 1, + 1342 => 1, + 1345 => 1, + 1488 => 1, + 1489 => 1, + 1500 => 1, + 1503 => 1, + 1518 => 1, + 1520 => 1, + 1527 => 1, + 1529 => 1, + 1530 => 1, + 1625 => 1, + 1626 => 1, + 1627 => 1, + 1628 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc new file mode 100644 index 00000000..d30cd847 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc @@ -0,0 +1,76 @@ + + * @copyright 2019 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SpreadOperatorSpacingAfter sniff. + * + * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\SpreadOperatorSpacingAfterSniff + */ +final class SpreadOperatorSpacingAfterUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'SpreadOperatorSpacingAfterUnitTest.1.inc': + return [ + 12 => 1, + 13 => 1, + 20 => 2, + 40 => 1, + 41 => 1, + 46 => 2, + 60 => 1, + 61 => 1, + 66 => 2, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml new file mode 100644 index 00000000..728426e6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml @@ -0,0 +1,4 @@ + + + A collection of generic sniffs. This standard is not designed to be used to check code. + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php new file mode 100644 index 00000000..904769e1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php @@ -0,0 +1,89 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\CSS; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class BrowserSpecificStylesSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + /** + * A list of specific stylesheet suffixes we allow. + * + * These stylesheets contain browser specific styles + * so this sniff ignore them files in the form: + * *_moz.css and *_ie7.css etc. + * + * @var array + */ + protected $specificStylesheets = [ + 'moz' => true, + 'ie' => true, + 'ie7' => true, + 'ie8' => true, + 'webkit' => true, + ]; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_STYLE]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + // Ignore files with browser-specific suffixes. + $filename = $phpcsFile->getFilename(); + $breakChar = strrpos($filename, '_'); + if ($breakChar !== false && substr($filename, -4) === '.css') { + $specific = substr($filename, ($breakChar + 1), -4); + if (isset($this->specificStylesheets[$specific]) === true) { + return; + } + } + + $tokens = $phpcsFile->getTokens(); + $content = $tokens[$stackPtr]['content']; + + if ($content[0] === '-') { + $error = 'Browser-specific styles are not allowed'; + $phpcsFile->addError($error, $stackPtr, 'ForbiddenStyle'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php new file mode 100644 index 00000000..91004a84 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php @@ -0,0 +1,127 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; + +class DisallowSelfActionsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_CLASS]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + // We are not interested in abstract classes. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($prev !== false && $tokens[$prev]['code'] === T_ABSTRACT) { + return; + } + + // We are only interested in Action classes. + $classNameToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + $className = $tokens[$classNameToken]['content']; + if (substr($className, -7) !== 'Actions') { + return; + } + + $foundFunctions = []; + $foundCalls = []; + + // Find all static method calls in the form self::method() in the class. + $classEnd = $tokens[$stackPtr]['scope_closer']; + for ($i = ($classNameToken + 1); $i < $classEnd; $i++) { + if ($tokens[$i]['code'] !== T_DOUBLE_COLON) { + if ($tokens[$i]['code'] === T_FUNCTION) { + // Cache the function information. + $funcName = $phpcsFile->findNext(T_STRING, ($i + 1)); + $funcScope = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($i - 1)); + + $foundFunctions[$tokens[$funcName]['content']] = strtolower($tokens[$funcScope]['content']); + } + + continue; + } + + $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), null, true); + if ($tokens[$prevToken]['content'] !== 'self' + && $tokens[$prevToken]['content'] !== 'static' + ) { + continue; + } + + $funcNameToken = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), null, true); + if ($tokens[$funcNameToken]['code'] === T_VARIABLE) { + // We are only interested in function calls. + continue; + } + + $funcName = $tokens[$funcNameToken]['content']; + + // We've found the function, now we need to find it and see if it is + // public, private or protected. If it starts with an underscore we + // can assume it is private. + if ($funcName[0] === '_') { + continue; + } + + $foundCalls[$i] = [ + 'name' => $funcName, + 'type' => strtolower($tokens[$prevToken]['content']), + ]; + }//end for + + $errorClassName = substr($className, 0, -7); + + foreach ($foundCalls as $token => $funcData) { + if (isset($foundFunctions[$funcData['name']]) === false) { + // Function was not in this class, might have come from the parent. + // Either way, we can't really check this. + continue; + } else if ($foundFunctions[$funcData['name']] === 'public') { + $type = $funcData['type']; + $error = "Static calls to public methods in Action classes must not use the $type keyword; use %s::%s() instead"; + $data = [ + $errorClassName, + $funcName, + ]; + $phpcsFile->addError($error, $token, 'Found'.ucfirst($funcData['type']), $data); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php new file mode 100644 index 00000000..83bb5ff3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php @@ -0,0 +1,100 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class IncludeOwnSystemSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_DOUBLE_COLON]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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) + { + $fileName = $phpcsFile->getFilename(); + $matches = []; + if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|i', $fileName, $matches) === 0) { + // Not an actions file. + return; + } + + $ownClass = $matches[2]; + $tokens = $phpcsFile->getTokens(); + + $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 2), null, false, true); + $typeName = trim($tokens[$typeName]['content'], " '"); + switch (strtolower($tokens[($stackPtr + 1)]['content'])) { + case 'includesystem' : + $included = strtolower($typeName); + break; + case 'includeasset' : + $included = strtolower($typeName).'assettype'; + break; + case 'includewidget' : + $included = strtolower($typeName).'widgettype'; + break; + default: + return; + } + + if ($included === strtolower($ownClass)) { + $error = "You do not need to include \"%s\" from within the system's own actions file"; + $data = [$ownClass]; + $phpcsFile->addError($error, $stackPtr, 'NotRequired', $data); + } + + }//end process() + + + /** + * Determines the included class name from given token. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param array $tokens The array of file tokens. + * @param int $stackPtr The position in the tokens array of the + * potentially included class. + * + * @return bool + */ + protected function getIncludedClassFromToken( + $phpcsFile, + array $tokens, + $stackPtr + ) { + + return false; + + }//end getIncludedClassFromToken() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php new file mode 100644 index 00000000..063dab4a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php @@ -0,0 +1,316 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; + +use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; + +class IncludeSystemSniff extends AbstractScopeSniff +{ + + /** + * A list of classes that don't need to be included. + * + * @var array + */ + private $ignore = [ + 'self' => true, + 'static' => true, + 'parent' => true, + 'channels' => true, + 'basesystem' => true, + 'dal' => true, + 'init' => true, + 'pdo' => true, + 'util' => true, + 'ziparchive' => true, + 'phpunit_framework_assert' => true, + 'abstractmysourceunittest' => true, + 'abstractdatacleanunittest' => true, + 'exception' => true, + 'abstractwidgetwidgettype' => true, + 'domdocument' => true, + ]; + + + /** + * Constructs an AbstractScopeSniff. + */ + public function __construct() + { + parent::__construct([T_FUNCTION], [T_DOUBLE_COLON, T_EXTENDS], true); + + }//end __construct() + + + /** + * Processes the function tokens within the class. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param integer $stackPtr The position where the token was found. + * @param integer $currScope The current scope opener token. + * + * @return void + */ + protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + // Determine the name of the class that the static function + // is being called on. + $classNameToken = $phpcsFile->findPrevious( + T_WHITESPACE, + ($stackPtr - 1), + null, + true + ); + + // Don't process class names represented by variables as this can be + // an inexact science. + if ($tokens[$classNameToken]['code'] === T_VARIABLE) { + return; + } + + $className = $tokens[$classNameToken]['content']; + if (isset($this->ignore[strtolower($className)]) === true) { + return; + } + + $includedClasses = []; + + $fileName = strtolower($phpcsFile->getFilename()); + $matches = []; + if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|', $fileName, $matches) !== 0) { + // This is an actions file, which means we don't + // have to include the system in which it exists. + $includedClasses[$matches[2]] = true; + + // Or a system it implements. + $class = $phpcsFile->getCondition($stackPtr, T_CLASS); + $implements = $phpcsFile->findNext(T_IMPLEMENTS, $class, ($class + 10)); + if ($implements !== false) { + $implementsClass = $phpcsFile->findNext(T_STRING, $implements); + $implementsClassName = strtolower($tokens[$implementsClass]['content']); + if (substr($implementsClassName, -7) === 'actions') { + $includedClasses[substr($implementsClassName, 0, -7)] = true; + } + } + } + + // Go searching for includeSystem and includeAsset calls within this + // function, or the inclusion of .inc files, which + // would be library files. + for ($i = ($currScope + 1); $i < $stackPtr; $i++) { + $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); + if ($name !== false) { + $includedClasses[$name] = true; + // Special case for Widgets cause they are, well, special. + } else if (strtolower($tokens[$i]['content']) === 'includewidget') { + $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($i + 1)); + $typeName = trim($tokens[$typeName]['content'], " '"); + $includedClasses[strtolower($typeName).'widgettype'] = true; + } + } + + // Now go searching for includeSystem, includeAsset or require/include + // calls outside our scope. If we are in a class, look outside the + // class. If we are not, look outside the function. + $condPtr = $currScope; + if ($phpcsFile->hasCondition($stackPtr, T_CLASS) === true) { + foreach ($tokens[$stackPtr]['conditions'] as $condPtr => $condType) { + if ($condType === T_CLASS) { + break; + } + } + } + + for ($i = 0; $i < $condPtr; $i++) { + // Skip other scopes. + if (isset($tokens[$i]['scope_closer']) === true) { + $i = $tokens[$i]['scope_closer']; + continue; + } + + $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); + if ($name !== false) { + $includedClasses[$name] = true; + } + } + + // If we are in a testing class, we might have also included + // some systems and classes in our setUp() method. + $setupFunction = null; + if ($phpcsFile->hasCondition($stackPtr, T_CLASS) === true) { + foreach ($tokens[$stackPtr]['conditions'] as $condPtr => $condType) { + if ($condType === T_CLASS) { + // Is this is a testing class? + $name = $phpcsFile->findNext(T_STRING, $condPtr); + $name = $tokens[$name]['content']; + if (substr($name, -8) === 'UnitTest') { + // Look for a method called setUp(). + $end = $tokens[$condPtr]['scope_closer']; + $function = $phpcsFile->findNext(T_FUNCTION, ($condPtr + 1), $end); + while ($function !== false) { + $name = $phpcsFile->findNext(T_STRING, $function); + if ($tokens[$name]['content'] === 'setUp') { + $setupFunction = $function; + break; + } + + $function = $phpcsFile->findNext(T_FUNCTION, ($function + 1), $end); + } + } + } + }//end foreach + }//end if + + if ($setupFunction !== null) { + $start = ($tokens[$setupFunction]['scope_opener'] + 1); + $end = $tokens[$setupFunction]['scope_closer']; + for ($i = $start; $i < $end; $i++) { + $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); + if ($name !== false) { + $includedClasses[$name] = true; + } + } + }//end if + + if (isset($includedClasses[strtolower($className)]) === false) { + $error = 'Static method called on non-included class or system "%s"; include system with Channels::includeSystem() or include class with require_once'; + $data = [$className]; + $phpcsFile->addError($error, $stackPtr, 'NotIncludedCall', $data); + } + + }//end processTokenWithinScope() + + + /** + * Processes a token within the scope that this test is listening to. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * this token was found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === T_EXTENDS) { + // Find the class name. + $classNameToken = $phpcsFile->findNext(T_STRING, ($stackPtr + 1)); + $className = $tokens[$classNameToken]['content']; + } else { + // Determine the name of the class that the static function + // is being called on. But don't process class names represented by + // variables as this can be an inexact science. + $classNameToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$classNameToken]['code'] === T_VARIABLE) { + return; + } + + $className = $tokens[$classNameToken]['content']; + } + + // Some systems are always available. + if (isset($this->ignore[strtolower($className)]) === true) { + return; + } + + $includedClasses = []; + + $fileName = strtolower($phpcsFile->getFilename()); + $matches = []; + if (preg_match('|/systems/([^/]+)/([^/]+)?actions.inc$|', $fileName, $matches) !== 0) { + // This is an actions file, which means we don't + // have to include the system in which it exists + // We know the system from the path. + $includedClasses[$matches[1]] = true; + } + + // Go searching for includeSystem, includeAsset or require/include + // calls outside our scope. + for ($i = 0; $i < $stackPtr; $i++) { + // Skip classes and functions as will we never get + // into their scopes when including this file, although + // we have a chance of getting into IF, WHILE etc. + if (($tokens[$i]['code'] === T_CLASS + || $tokens[$i]['code'] === T_INTERFACE + || $tokens[$i]['code'] === T_FUNCTION) + && isset($tokens[$i]['scope_closer']) === true + ) { + $i = $tokens[$i]['scope_closer']; + continue; + } + + $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); + if ($name !== false) { + $includedClasses[$name] = true; + // Special case for Widgets cause they are, well, special. + } else if (strtolower($tokens[$i]['content']) === 'includewidget') { + $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($i + 1)); + $typeName = trim($tokens[$typeName]['content'], " '"); + $includedClasses[strtolower($typeName).'widgettype'] = true; + } + }//end for + + if (isset($includedClasses[strtolower($className)]) === false) { + if ($tokens[$stackPtr]['code'] === T_EXTENDS) { + $error = 'Class extends non-included class or system "%s"; include system with Channels::includeSystem() or include class with require_once'; + $data = [$className]; + $phpcsFile->addError($error, $stackPtr, 'NotIncludedExtends', $data); + } else { + $error = 'Static method called on non-included class or system "%s"; include system with Channels::includeSystem() or include class with require_once'; + $data = [$className]; + $phpcsFile->addError($error, $stackPtr, 'NotIncludedCall', $data); + } + } + + }//end processTokenOutsideScope() + + + /** + * Determines the included class name from given token. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param array $tokens The array of file tokens. + * @param int $stackPtr The position in the tokens array of the + * potentially included class. + * + * @return string|false + */ + protected function getIncludedClassFromToken(File $phpcsFile, array $tokens, $stackPtr) + { + if (strtolower($tokens[$stackPtr]['content']) === 'includesystem') { + $systemName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 1)); + $systemName = trim($tokens[$systemName]['content'], " '"); + return strtolower($systemName); + } else if (strtolower($tokens[$stackPtr]['content']) === 'includeasset') { + $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 1)); + $typeName = trim($tokens[$typeName]['content'], " '"); + return strtolower($typeName).'assettype'; + } else if (isset(Tokens::$includeTokens[$tokens[$stackPtr]['code']]) === true) { + $filePath = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 1)); + $filePath = $tokens[$filePath]['content']; + $filePath = trim($filePath, " '"); + $filePath = basename($filePath, '.inc'); + return strtolower($filePath); + } + + return false; + + }//end getIncludedClassFromToken() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php new file mode 100644 index 00000000..0f20f70b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php @@ -0,0 +1,143 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class UnusedSystemSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_DOUBLE_COLON]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + // Check if this is a call to includeSystem, includeAsset or includeWidget. + $methodName = strtolower($tokens[($stackPtr + 1)]['content']); + if ($methodName === 'includesystem' + || $methodName === 'includeasset' + || $methodName === 'includewidget' + ) { + $systemName = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 3), null, true); + if ($systemName === false || $tokens[$systemName]['code'] !== T_CONSTANT_ENCAPSED_STRING) { + // Must be using a variable instead of a specific system name. + // We can't accurately check that. + return; + } + + $systemName = trim($tokens[$systemName]['content'], " '"); + } else { + return; + } + + if ($methodName === 'includeasset') { + $systemName .= 'assettype'; + } else if ($methodName === 'includewidget') { + $systemName .= 'widgettype'; + } + + $systemName = strtolower($systemName); + + // Now check if this system is used anywhere in this scope. + $level = $tokens[$stackPtr]['level']; + for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { + if ($tokens[$i]['level'] < $level) { + // We have gone out of scope. + // If the original include was inside an IF statement that + // is checking if the system exists, check the outer scope + // as well. + if ($tokens[$stackPtr]['level'] === $level) { + // We are still in the base level, so this is the first + // time we have got here. + $conditions = array_keys($tokens[$stackPtr]['conditions']); + if (empty($conditions) === false) { + $cond = array_pop($conditions); + if ($tokens[$cond]['code'] === T_IF) { + $i = $tokens[$cond]['scope_closer']; + $level--; + continue; + } + } + } + + break; + }//end if + + if ($tokens[$i]['code'] !== T_DOUBLE_COLON + && $tokens[$i]['code'] !== T_EXTENDS + && $tokens[$i]['code'] !== T_IMPLEMENTS + ) { + continue; + } + + switch ($tokens[$i]['code']) { + case T_DOUBLE_COLON: + $usedName = strtolower($tokens[($i - 1)]['content']); + if ($usedName === $systemName) { + // The included system was used, so it is fine. + return; + } + break; + case T_EXTENDS: + $classNameToken = $phpcsFile->findNext(T_STRING, ($i + 1)); + $className = strtolower($tokens[$classNameToken]['content']); + if ($className === $systemName) { + // The included system was used, so it is fine. + return; + } + break; + case T_IMPLEMENTS: + $endImplements = $phpcsFile->findNext([T_EXTENDS, T_OPEN_CURLY_BRACKET], ($i + 1)); + for ($x = ($i + 1); $x < $endImplements; $x++) { + if ($tokens[$x]['code'] === T_STRING) { + $className = strtolower($tokens[$x]['content']); + if ($className === $systemName) { + // The included system was used, so it is fine. + return; + } + } + } + break; + }//end switch + }//end for + + // If we get to here, the system was not use. + $error = 'Included system "%s" is never used'; + $data = [$systemName]; + $phpcsFile->addError($error, $stackPtr, 'Found', $data); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php new file mode 100644 index 00000000..da00c903 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php @@ -0,0 +1,86 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Commenting; + +use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff as SquizFunctionCommentSniff; +use PHP_CodeSniffer\Util\Tokens; +use PHP_CodeSniffer\Files\File; + +class FunctionCommentSniff extends SquizFunctionCommentSniff +{ + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + parent::process($phpcsFile, $stackPtr); + + $tokens = $phpcsFile->getTokens(); + $find = Tokens::$methodPrefixes; + $find[] = T_WHITESPACE; + + $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); + if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG) { + return; + } + + $commentStart = $tokens[$commentEnd]['comment_opener']; + $hasApiTag = false; + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + if ($tokens[$tag]['content'] === '@api') { + if ($hasApiTag === true) { + // We've come across an API tag already, which means + // we were not the first tag in the API list. + $error = 'The @api tag must come first in the @api tag list in a function comment'; + $phpcsFile->addError($error, $tag, 'ApiNotFirst'); + } + + $hasApiTag = true; + + // There needs to be a blank line before the @api tag. + $prev = $phpcsFile->findPrevious([T_DOC_COMMENT_STRING, T_DOC_COMMENT_TAG], ($tag - 1)); + if ($tokens[$prev]['line'] !== ($tokens[$tag]['line'] - 2)) { + $error = 'There must be one blank line before the @api tag in a function comment'; + $phpcsFile->addError($error, $tag, 'ApiSpacing'); + } + } else if (substr($tokens[$tag]['content'], 0, 5) === '@api-') { + $hasApiTag = true; + + $prev = $phpcsFile->findPrevious([T_DOC_COMMENT_STRING, T_DOC_COMMENT_TAG], ($tag - 1)); + if ($tokens[$prev]['line'] !== ($tokens[$tag]['line'] - 1)) { + $error = 'There must be no blank line before the @%s tag in a function comment'; + $data = [$tokens[$tag]['content']]; + $phpcsFile->addError($error, $tag, 'ApiTagSpacing', $data); + } + }//end if + }//end foreach + + if ($hasApiTag === true && substr($tokens[$tag]['content'], 0, 4) !== '@api') { + // API tags must be the last tags in a function comment. + $error = 'The @api tags must be the last tags in a function comment'; + $phpcsFile->addError($error, $commentEnd, 'ApiNotLast'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php new file mode 100644 index 00000000..d40e064e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Debug; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class DebugCodeSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_DOUBLE_COLON]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + $className = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if (strtolower($tokens[$className]['content']) === 'debug') { + $method = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + $error = 'Call to debug function Debug::%s() must be removed'; + $data = [$tokens[$method]['content']]; + $phpcsFile->addError($error, $stackPtr, 'Found', $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php new file mode 100644 index 00000000..1f56a0e2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php @@ -0,0 +1,66 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Debug; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class FirebugConsoleSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_STRING, + T_PROPERTY, + T_LABEL, + T_OBJECT, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (strtolower($tokens[$stackPtr]['content']) === 'console') { + $error = 'Variables, functions and labels must not be named "console"; name may conflict with Firebug internal variable'; + $phpcsFile->addError($error, $stackPtr, 'ConflictFound'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php new file mode 100644 index 00000000..97732872 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php @@ -0,0 +1,83 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class AssignThisSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_THIS]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Ignore this.something and other uses of "this" that are not + // direct assignments. + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$next]['code'] !== T_SEMICOLON) { + if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { + return; + } + } + + // Something must be assigned to "this". + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$prev]['code'] !== T_EQUAL) { + return; + } + + // A variable needs to be assigned to "this". + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($prev - 1), null, true); + if ($tokens[$prev]['code'] !== T_STRING) { + return; + } + + // We can only assign "this" to a var called "self". + if ($tokens[$prev]['content'] !== 'self' && $tokens[$prev]['content'] !== '_self') { + $error = 'Keyword "this" can only be assigned to a variable called "self" or "_self"'; + $phpcsFile->addError($error, $prev, 'NotSelf'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php new file mode 100644 index 00000000..5d8dc996 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php @@ -0,0 +1,220 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; + +class CreateWidgetTypeCallbackSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OBJECT]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $className = $phpcsFile->findPrevious(T_STRING, ($stackPtr - 1)); + if (substr(strtolower($tokens[$className]['content']), -10) !== 'widgettype') { + return; + } + + // Search for a create method. + $create = $phpcsFile->findNext(T_PROPERTY, $stackPtr, $tokens[$stackPtr]['bracket_closer'], null, 'create'); + if ($create === false) { + return; + } + + $function = $phpcsFile->findNext([T_WHITESPACE, T_COLON], ($create + 1), null, true); + if ($tokens[$function]['code'] !== T_FUNCTION + && $tokens[$function]['code'] !== T_CLOSURE + ) { + return; + } + + $start = ($tokens[$function]['scope_opener'] + 1); + $end = ($tokens[$function]['scope_closer'] - 1); + + // Check that the first argument is called "callback". + $arg = $phpcsFile->findNext(T_WHITESPACE, ($tokens[$function]['parenthesis_opener'] + 1), null, true); + if ($tokens[$arg]['content'] !== 'callback') { + $error = 'The first argument of the create() method of a widget type must be called "callback"'; + $phpcsFile->addError($error, $arg, 'FirstArgNotCallback'); + } + + /* + Look for return statements within the function. They cannot return + anything and must be preceded by the callback.call() line. The + callback itself must contain "self" or "this" as the first argument + and there needs to be a call to the callback function somewhere + in the create method. All calls to the callback function must be + followed by a return statement or the end of the method. + */ + + $foundCallback = false; + $passedCallback = false; + $nestedFunction = null; + for ($i = $start; $i <= $end; $i++) { + // Keep track of nested functions. + if ($nestedFunction !== null) { + if ($i === $nestedFunction) { + $nestedFunction = null; + continue; + } + } else if (($tokens[$i]['code'] === T_FUNCTION + || $tokens[$i]['code'] === T_CLOSURE) + && isset($tokens[$i]['scope_closer']) === true + ) { + $nestedFunction = $tokens[$i]['scope_closer']; + continue; + } + + if ($nestedFunction === null && $tokens[$i]['code'] === T_RETURN) { + // Make sure return statements are not returning anything. + if ($tokens[($i + 1)]['code'] !== T_SEMICOLON) { + $error = 'The create() method of a widget type must not return a value'; + $phpcsFile->addError($error, $i, 'ReturnValue'); + } + + continue; + } else if ($tokens[$i]['code'] !== T_STRING + || $tokens[$i]['content'] !== 'callback' + ) { + continue; + } + + // If this is the form "callback.call(" then it is a call + // to the callback function. + if ($tokens[($i + 1)]['code'] !== T_OBJECT_OPERATOR + || $tokens[($i + 2)]['content'] !== 'call' + || $tokens[($i + 3)]['code'] !== T_OPEN_PARENTHESIS + ) { + // One last chance; this might be the callback function + // being passed to another function, like this + // "this.init(something, callback, something)". + if (isset($tokens[$i]['nested_parenthesis']) === false) { + continue; + } + + // Just make sure those brackets don't belong to anyone, + // like an IF or FOR statement. + foreach ($tokens[$i]['nested_parenthesis'] as $bracket) { + if (isset($tokens[$bracket]['parenthesis_owner']) === true) { + continue(2); + } + } + + // Note that we use this endBracket down further when checking + // for a RETURN statement. + $nestedParens = $tokens[$i]['nested_parenthesis']; + $endBracket = end($nestedParens); + $bracket = key($nestedParens); + + $prev = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($bracket - 1), + null, + true + ); + + if ($tokens[$prev]['code'] !== T_STRING) { + // This is not a function passing the callback. + continue; + } + + $passedCallback = true; + }//end if + + $foundCallback = true; + + if ($passedCallback === false) { + // The first argument must be "this" or "self". + $arg = $phpcsFile->findNext(T_WHITESPACE, ($i + 4), null, true); + if ($tokens[$arg]['content'] !== 'this' + && $tokens[$arg]['content'] !== 'self' + ) { + $error = 'The first argument passed to the callback function must be "this" or "self"'; + $phpcsFile->addError($error, $arg, 'FirstArgNotSelf'); + } + } + + // Now it must be followed by a return statement or the end of the function. + if ($passedCallback === false) { + $endBracket = $tokens[($i + 3)]['parenthesis_closer']; + } + + for ($next = $endBracket; $next <= $end; $next++) { + // Skip whitespace so we find the next content after the call. + if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true) { + continue; + } + + // Skip closing braces like END IF because it is not executable code. + if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { + continue; + } + + // We don't care about anything on the current line, like a + // semicolon. It doesn't matter if there are other statements on the + // line because another sniff will check for those. + if ($tokens[$next]['line'] === $tokens[$endBracket]['line']) { + continue; + } + + break; + } + + if ($next !== $tokens[$function]['scope_closer'] + && $tokens[$next]['code'] !== T_RETURN + ) { + $error = 'The call to the callback function must be followed by a return statement if it is not the last statement in the create() method'; + $phpcsFile->addError($error, $i, 'NoReturn'); + } + }//end for + + if ($foundCallback === false) { + $error = 'The create() method of a widget type must call the callback function'; + $phpcsFile->addError($error, $create, 'CallbackNotCalled'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php new file mode 100644 index 00000000..693a0371 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php @@ -0,0 +1,61 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class DisallowNewWidgetSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_NEW]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $className = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$className]['code'] !== T_STRING) { + return; + } + + if (substr(strtolower($tokens[$className]['content']), -10) === 'widgettype') { + $widgetType = substr($tokens[$className]['content'], 0, -10); + $error = 'Manual creation of widget objects is banned; use Widget::getWidget(\'%s\'); instead'; + $data = [$widgetType]; + $phpcsFile->addError($error, $stackPtr, 'Found', $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php new file mode 100644 index 00000000..06c25127 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php @@ -0,0 +1,105 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class AjaxNullComparisonSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + // Make sure it is an API function. We know this by the doc comment. + $commentEnd = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, $stackPtr); + $commentStart = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($commentEnd - 1)); + // If function doesn't contain any doc comments - skip it. + if ($commentEnd === false || $commentStart === false) { + return; + } + + $comment = $phpcsFile->getTokensAsString($commentStart, ($commentEnd - $commentStart)); + if (strpos($comment, '* @api') === false) { + return; + } + + // Find all the vars passed in as we are only interested in comparisons + // to NULL for these specific variables. + $foundVars = []; + $open = $tokens[$stackPtr]['parenthesis_opener']; + $close = $tokens[$stackPtr]['parenthesis_closer']; + for ($i = ($open + 1); $i < $close; $i++) { + if ($tokens[$i]['code'] === T_VARIABLE) { + $foundVars[$tokens[$i]['content']] = true; + } + } + + if (empty($foundVars) === true) { + return; + } + + $start = $tokens[$stackPtr]['scope_opener']; + $end = $tokens[$stackPtr]['scope_closer']; + for ($i = ($start + 1); $i < $end; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE + || isset($foundVars[$tokens[$i]['content']]) === false + ) { + continue; + } + + $operator = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), null, true); + if ($tokens[$operator]['code'] !== T_IS_IDENTICAL + && $tokens[$operator]['code'] !== T_IS_NOT_IDENTICAL + ) { + continue; + } + + $nullValue = $phpcsFile->findNext(T_WHITESPACE, ($operator + 1), null, true); + if ($tokens[$nullValue]['code'] !== T_NULL) { + continue; + } + + $error = 'Values submitted via Ajax requests should not be compared directly to NULL; use empty() instead'; + $phpcsFile->addWarning($error, $nullValue, 'Found'); + }//end for + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php new file mode 100644 index 00000000..6684691f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php @@ -0,0 +1,116 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; + +class EvalObjectFactorySniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_EVAL]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + /* + We need to find all strings that will be in the eval + to determine if the "new" keyword is being used. + */ + + $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($stackPtr + 1)); + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + + $strings = []; + $vars = []; + + for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { + if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true) { + $strings[$i] = $tokens[$i]['content']; + } else if ($tokens[$i]['code'] === T_VARIABLE) { + $vars[$i] = $tokens[$i]['content']; + } + } + + /* + We now have some variables that we need to expand into + the strings that were assigned to them, if any. + */ + + foreach ($vars as $varPtr => $varName) { + while (($prev = $phpcsFile->findPrevious(T_VARIABLE, ($varPtr - 1))) !== false) { + // Make sure this is an assignment of the variable. That means + // it will be the first thing on the line. + $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($prev - 1), null, true); + if ($tokens[$prevContent]['line'] === $tokens[$prev]['line']) { + $varPtr = $prevContent; + continue; + } + + if ($tokens[$prev]['content'] !== $varName) { + // This variable has a different name. + $varPtr = $prevContent; + continue; + } + + // We found one. + break; + }//end while + + if ($prev !== false) { + // Find all strings on the line. + $lineEnd = $phpcsFile->findNext(T_SEMICOLON, ($prev + 1)); + for ($i = ($prev + 1); $i < $lineEnd; $i++) { + if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true) { + $strings[$i] = $tokens[$i]['content']; + } + } + } + }//end foreach + + foreach ($strings as $string) { + // If the string has "new" in it, it is not allowed. + // We don't bother checking if the word "new" is printed to screen + // because that is unlikely to happen. We assume the use + // of "new" is for object instantiation. + if (strstr($string, ' new ') !== false) { + $error = 'Do not use eval() to create objects dynamically; use reflection instead'; + $phpcsFile->addWarning($error, $stackPtr, 'Found'); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php new file mode 100644 index 00000000..a0767796 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php @@ -0,0 +1,108 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class GetRequestDataSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_VARIABLE]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + $varName = $tokens[$stackPtr]['content']; + if ($varName !== '$_REQUEST' + && $varName !== '$_GET' + && $varName !== '$_POST' + && $varName !== '$_FILES' + ) { + return; + } + + // The only place these super globals can be accessed directly is + // in the getRequestData() method of the Security class. + $inClass = false; + foreach ($tokens[$stackPtr]['conditions'] as $i => $type) { + if ($tokens[$i]['code'] === T_CLASS) { + $className = $phpcsFile->findNext(T_STRING, $i); + $className = $tokens[$className]['content']; + if (strtolower($className) === 'security') { + $inClass = true; + } else { + // We don't have nested classes. + break; + } + } else if ($inClass === true && $tokens[$i]['code'] === T_FUNCTION) { + $funcName = $phpcsFile->findNext(T_STRING, $i); + $funcName = $tokens[$funcName]['content']; + if (strtolower($funcName) === 'getrequestdata') { + // This is valid. + return; + } else { + // We don't have nested functions. + break; + } + }//end if + }//end foreach + + // If we get to here, the super global was used incorrectly. + // First find out how it is being used. + $globalName = strtolower(substr($varName, 2)); + $usedVar = ''; + + $openBracket = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$openBracket]['code'] === T_OPEN_SQUARE_BRACKET) { + $closeBracket = $tokens[$openBracket]['bracket_closer']; + $usedVar = $phpcsFile->getTokensAsString(($openBracket + 1), ($closeBracket - $openBracket - 1)); + } + + $type = 'SuperglobalAccessed'; + $error = 'The %s super global must not be accessed directly; use Security::getRequestData('; + $data = [$varName]; + if ($usedVar !== '') { + $type .= 'WithVar'; + $error .= '%s, \'%s\''; + $data[] = $usedVar; + $data[] = $globalName; + } + + $error .= ') instead'; + $phpcsFile->addError($error, $stackPtr, $type, $data); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php new file mode 100644 index 00000000..697e91dc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php @@ -0,0 +1,65 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; + +class ReturnFunctionValueSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_RETURN]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + $functionName = $phpcsFile->findNext(T_STRING, ($stackPtr + 1), null, false, null, true); + + while ($functionName !== false) { + // Check if this is really a function. + $bracket = $phpcsFile->findNext(T_WHITESPACE, ($functionName + 1), null, true); + if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) { + // Not a function call. + $functionName = $phpcsFile->findNext(T_STRING, ($functionName + 1), null, false, null, true); + continue; + } + + $error = 'The result of a function call should be assigned to a variable before being returned'; + $phpcsFile->addWarning($error, $stackPtr, 'NotAssigned'); + break; + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php new file mode 100644 index 00000000..ee527b41 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php @@ -0,0 +1,78 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Strings; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; + +class JoinStringsSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_STRING]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param integer $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['content'] !== 'join') { + return; + } + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$prev]['code'] !== T_OBJECT_OPERATOR) { + return; + } + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); + if ($tokens[$prev]['code'] === T_CLOSE_SQUARE_BRACKET) { + $opener = $tokens[$prev]['bracket_opener']; + if ($tokens[($opener - 1)]['code'] !== T_STRING) { + // This means the array is declared inline, like x = [a,b,c].join() + // and not elsewhere, like x = y[a].join() + // The first is not allowed while the second is. + $error = 'Joining strings using inline arrays is not allowed; use the + operator instead'; + $phpcsFile->addError($error, $stackPtr, 'ArrayNotAllowed'); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css new file mode 100644 index 00000000..339ee154 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css @@ -0,0 +1,13 @@ +.SettingsTabPaneWidgetType-tab-mid { + background: transparent url(tab_inact_mid.png) repeat-x; + line-height: -25px; + cursor: pointer; + -moz-user-select: none; +} + +.AssetLineageWidgetType-item { + float: left; + list-style: none; + height: 22px; + cursor: pointer; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php new file mode 100644 index 00000000..7f10457c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php @@ -0,0 +1,53 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the BrowserSpecificStyles sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\CSS\BrowserSpecificStylesSniff + */ +final class BrowserSpecificStylesUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [5 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc new file mode 100644 index 00000000..95fd04b7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc @@ -0,0 +1,51 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php new file mode 100644 index 00000000..30a62d13 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php @@ -0,0 +1,58 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowSelfActions sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\DisallowSelfActionsSniff + */ +final class DisallowSelfActionsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 12 => 1, + 13 => 1, + 28 => 1, + 29 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc new file mode 100644 index 00000000..ccb0273e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc @@ -0,0 +1,112 @@ +fetch(PDO::FETCH_NUM) +BaseSystem::getDataDir(); +Util::getArrayIndex(array(), ''); + + +Channels::includeSystem('Widget'); +Widget::includeWidget('AbstractContainer'); +class MyWidget extends AbstractContainerWidgetType {} +class MyOtherWidget extends BookWidgetType {} + +$zip = new ZipArchive(); +$res = $zip->open($path, ZipArchive::CREATE); + +class AssetListingUnitTest extends AbstractMySourceUnitTest +{ + function setUp() { + parent::setUp(); + Channels::includeSystem('MySystem2'); + include_once 'Libs/FileSystem.inc'; + } + + function two() { + $siteid = MySystem2::getCurrentSiteId(); + $parserFiles = FileSystem::listDirectory(); + } + + function three() { + $siteid = MySystem3::getCurrentSiteId(); + $parserFiles = FileSystem::listDirectory(); + } +} + +if (Channels::systemExists('Log') === TRUE) { + Channels::includeSystem('Log'); +} else { + return; +} + +Log::addProjectLog('metadata.field.update', $msg); + +function two() { + Widget::includeWidget('CacheAdminScreen'); + $barChart = CacheAdminScreenWidgetType::constructBarchart($data); +} + +$adjustDialog->setOrientation(AbstractWidgetWidgetType::CENTER); + +$className = 'SquizPerspective'.ucfirst($property['type']).'PropertyType'; +Channels::includeSystem($className); +$className::setValue($assetid, $propertyid, $perspectives, $value, (array) $property['settings']); +?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php new file mode 100644 index 00000000..635054d3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php @@ -0,0 +1,65 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the IncludeSystem sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\IncludeSystemSniff + */ +final class IncludeSystemUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 9 => 1, + 14 => 1, + 24 => 1, + 27 => 1, + 28 => 1, + 31 => 1, + 36 => 1, + 41 => 1, + 61 => 1, + 70 => 1, + 89 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc new file mode 100644 index 00000000..c7bd4738 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc @@ -0,0 +1,67 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php new file mode 100644 index 00000000..05359a48 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php @@ -0,0 +1,60 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the UnusedSystem sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\UnusedSystemSniff + */ +final class UnusedSystemUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 5 => 1, + 8 => 1, + 24 => 1, + 34 => 1, + 54 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc new file mode 100644 index 00000000..19d5c5d4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc @@ -0,0 +1,101 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php new file mode 100644 index 00000000..07c62a95 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php @@ -0,0 +1,59 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionComment sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Commenting\FunctionCommentSniff + */ +final class FunctionCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 28 => 1, + 36 => 1, + 37 => 2, + 49 => 1, + 58 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc new file mode 100644 index 00000000..34901610 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc @@ -0,0 +1,4 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php new file mode 100644 index 00000000..1f85b23e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php @@ -0,0 +1,56 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Debug; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DebugCode sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Debug\DebugCodeSniff + */ +final class DebugCodeUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 3 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js new file mode 100644 index 00000000..d5e3df57 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js @@ -0,0 +1,8 @@ +console.info(); +console.warn(); +console.test(); +con.sole(); +var console = { + console: 'string'; +}; +function console() {} \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php new file mode 100644 index 00000000..8b9d6043 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php @@ -0,0 +1,66 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Debug; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FirebugConsole sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Debug\FirebugConsoleSniff + */ +final class FirebugConsoleUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + if ($testFile !== 'FirebugConsoleUnitTest.js') { + return []; + } + + return [ + 1 => 1, + 2 => 1, + 3 => 1, + 5 => 1, + 6 => 1, + 8 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js new file mode 100644 index 00000000..747a1008 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js @@ -0,0 +1,20 @@ +var self = this; +buttonWidget.addClickEvent(function() { + self.addDynamicSouce(); +}); + +var x = self; +var y = this; + +var test = ''; +if (true) { + test = this +} + +var itemid = this.items[i].getAttribute('itemid'); + +for (var x = this; y < 10; y++) { + var x = this + 1; +} + +var _self = this; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php new file mode 100644 index 00000000..7e44a857 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php @@ -0,0 +1,63 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the AssignThis sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\AssignThisSniff + */ +final class AssignThisUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + if ($testFile !== 'AssignThisUnitTest.js') { + return []; + } + + return [ + 7 => 1, + 11 => 1, + 16 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js new file mode 100644 index 00000000..22822d32 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js @@ -0,0 +1,186 @@ +SampleWidgetType.prototype = { + + create: function(callback) + { + if (x === 1) { + return; + } + + if (y === 1) { + callback.call(this); + // A comment here to explain the return is okay. + return; + } + + if (a === 1) { + // Cant return value even after calling callback. + callback.call(this); + return something; + } + + if (a === 1) { + // Need to pass self or this to callback function. + callback.call(a); + } + + callback.call(self); + + var self = this; + this.createChildren(null, function() { + callback.call(self, div); + }); + + // Never good to return a value. + return something; + + callback.call(self); + } + +}; + +AnotherSampleWidgetType.prototype = { + + create: function(input) + { + return; + } + + getSomething: function(input) + { + return 1; + } + +}; + + +NoCreateWidgetType.prototype = { + + getSomething: function(input) + { + return; + } + +}; + + +SomeRandom.prototype = { + + create: function(input) + { + return; + } + +}; + +SampleWidgetType.prototype = { + + create: function(callback) + { + if (a === 1) { + // This is ok because it is the last statement, + // even though it is conditional. + callback.call(self); + } + + } + +}; + +SampleWidgetType.prototype = { + + create: function(callback) + { + var something = callback; + + } + +}; + +SampleWidgetType.prototype = { + + create: function(callback) + { + // Also valid because we are passing the callback to + // someone else to call. + if (y === 1) { + this.something(callback); + return; + } + + this.init(callback); + + } + +}; + +SampleWidgetType.prototype = { + + create: function(callback) + { + // Also valid because we are passing the callback to + // someone else to call. + if (y === 1) { + this.something(callback); + } + + this.init(callback); + + } + +}; + +SampleWidgetType.prototype = { + + create: function(callback) + { + if (a === 1) { + // This is ok because it is the last statement, + // even though it is conditional. + this.something(callback); + } + + } + +}; + + +SampleWidgetType.prototype = { + + create: function(callback) + { + if (dfx.isFn(callback) === true) { + callback.call(this, cont); + return; + } + } + +}; + + +SampleWidgetType.prototype = { + + create: function(callback) + { + dfx.foreach(items, function(item) { + return true; + }); + + if (dfx.isFn(callback) === true) { + callback.call(this); + } + } + +}; + +SampleWidgetType.prototype = { + + create: function(callback) + { + var self = this; + this.createChildren(null, function() { + callback.call(self, div); + return; + }); + } + +}; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php new file mode 100644 index 00000000..5c9ca8e5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php @@ -0,0 +1,62 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the CreateWidgetTypeCallback sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\CreateWidgetTypeCallbackSniff + */ +final class CreateWidgetTypeCallbackUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 18 => 1, + 23 => 2, + 26 => 1, + 30 => 1, + 34 => 1, + 43 => 2, + 91 => 1, + 123 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc new file mode 100644 index 00000000..acf9baf7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc @@ -0,0 +1,6 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php new file mode 100644 index 00000000..04935604 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php @@ -0,0 +1,53 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowNewWidget sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\DisallowNewWidgetSniff + */ +final class DisallowNewWidgetUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [4 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc new file mode 100644 index 00000000..337914a8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc @@ -0,0 +1,182 @@ +getMessage()); + }//end try + + if ($something === NULL) { + if ($bar !== NULL) { + } + } + + return $issueid; + +}//end addIssue() + +/** + * Adds a new issue. + * + * Returns the new issue id. + * + * @param string $title Title of the new issue. + * @param string $description The description of the issue. + * @param string $reporter Asset id of the reporter. + * @param integer $projectid Id of the project that the issue belongs to. + * @param array $tags Array of tags. + * @param string $status The status of the issue. + * @param string $assignedTo The asset id of the user that the issue is + * assigned to. + * @param string $reportedDate If set then this date will be used instead of the + * current date and time. + * @param integer $reportedMilestone Reported milestone. + * + * @return integer + * @throws ChannelException If there is an error. + * + */ +public static function addIssue( + $title, + $description, + $reporter=NULL, + $projectid=NULL, + array $tags=array(), + $status=NULL, + $assignedTo=NULL, + $reportedDate=NULL, + $reportedMilestone=NULL +) { + // Get current projectid if not specified. + if ($projectid === NULL) { + Channels::includeSystem('Project'); + $projectid = Project::getCurrentProjectId(); + Channels::modifyBasket('project', $projectid); + } + +}//end addIssue() diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php new file mode 100644 index 00000000..fa39de07 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php @@ -0,0 +1,60 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the AjaxNullComparison sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\AjaxNullComparisonSniff + */ +final class AjaxNullComparisonUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [ + 41 => 1, + 53 => 1, + 64 => 1, + 77 => 1, + 92 => 1, + 122 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc new file mode 100644 index 00000000..992a7dc1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php new file mode 100644 index 00000000..e98ee285 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the EvalObjectFactory sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\EvalObjectFactorySniff + */ +final class EvalObjectFactoryUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [ + 4 => 1, + 12 => 1, + 21 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc new file mode 100644 index 00000000..7999763f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php new file mode 100644 index 00000000..f079325b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php @@ -0,0 +1,61 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the GetRequestData sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\GetRequestDataSniff + */ +final class GetRequestDataUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 5 => 1, + 8 => 1, + 21 => 1, + 26 => 1, + 27 => 1, + 28 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc new file mode 100644 index 00000000..f9148a78 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc @@ -0,0 +1,9 @@ +myFunction(); +return $obj->variable; +return MyClass::VARIABLE; +return $variable; +return ($var + 1); +?> \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php new file mode 100644 index 00000000..ce860461 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ReturnFunctionValue sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\ReturnFunctionValueSniff + */ +final class ReturnFunctionValueUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [ + 2 => 1, + 3 => 1, + 4 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js new file mode 100644 index 00000000..46d90cf9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js @@ -0,0 +1,18 @@ +one = (1 + 2); +two = (one + 2); +two = (one + one); +three = ('1' + 2); + +four = ['1', two].join(); +four = ['1', two].join(''); +four = ['1', [one, two].join(',')].join(' '); +four = ['1', [one, two].join()].join(' '); +four = ['1', [one, two].join()].join(); + +five = 'string' + ['1', [one, two].join()].join() + 'string'; + +six = myArray.join(' '); +six = [arrayOne, arrayTwo].join(); + +// This is fine because the array is not created inline. +var x = 'x' + test[x].join('p') + 't'; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php new file mode 100644 index 00000000..b3392233 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php @@ -0,0 +1,67 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\MySource\Tests\Strings; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the JoinStrings sniff. + * + * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Strings\JoinStringsSniff + */ +final class JoinStringsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + if ($testFile !== 'JoinStringsUnitTest.js') { + return []; + } + + return [ + 6 => 1, + 7 => 1, + 8 => 2, + 9 => 2, + 10 => 2, + 12 => 2, + 15 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml new file mode 100644 index 00000000..92407957 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml @@ -0,0 +1,18 @@ + + + The MySource coding standard builds on the Squiz coding standard. Currently used for MySource Mini development. + + */Tests/* + */Oven/* + */data/* + */jquery.js + */jquery.*.js + */viper/* + DALConf.inc + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml new file mode 100644 index 00000000..b5d53fdf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml @@ -0,0 +1,22 @@ + + + + + + + { +} + ]]> + + + { +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml new file mode 100644 index 00000000..fe816200 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml @@ -0,0 +1,177 @@ + + + + + + + /** + * The Foo class. + */ +class Foo +{ +} + ]]> + + + + + + + + /** + * The Foo class. + */ +class Foo +{ +} + ]]> + + + + + + + + /** + * The Foo class. + */ +class Foo +{ +} + ]]> + + + /** + * The Foo class. + */ + +class Foo +{ +} + ]]> + + + + + The Foo class. + */ +class Foo +{ +} + ]]> + + + The Foo class. + */ +class Foo +{ +} + ]]> + + + + + + * A helper for the Bar class. + * + * @see Bar + */ +class Foo +{ +} + ]]> + + + + * + * A helper for the Bar class. + * + * + * @see Bar + */ +class Foo +{ +} + ]]> + + + + + + * @see Bar + */ +class Foo +{ +} + ]]> + + + + * + * @see Bar + */ +class Foo +{ +} + ]]> + + + + + Release: 1.0 + */ +class Foo +{ +} + ]]> + + + 1.0 + */ +class Foo +{ +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml new file mode 100644 index 00000000..eef0b4e3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml @@ -0,0 +1,286 @@ + + + + + + + /** + * Short description here. + * + * PHP version 5 + * + * @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + ]]> + + + + + Short description here. + * + * PHP version 5 + * + * @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + * Short description here. + * + * PHP version 5 + * + * @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + + + * PHP version 5 + * + * @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + * + * PHP version 5 + * + * + * @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + + + * @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + * + * @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + + @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + + + + + @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + @category Foo + * @category Bar + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + + PHP version 5 + * + * @category Foo + * @package Foo_Helpers + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + @package Foo_Helpers + * @category Foo + * @author Marty McFly + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + + + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + + * @copyright 2013-2014 Foo Inc. + * @license MIT License + * @link http://example.com + */ + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml new file mode 100644 index 00000000..621649f2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml @@ -0,0 +1,230 @@ + + + + + + + /** + * Short description here. + * + * @return void + */ + function foo() + { + } + ]]> + + + + + + + + Short description here. + * + * @return void + */ + function foo() + { + } + ]]> + + + + * Short description here. + * + * @return void + */ + function foo() + { + } + ]]> + + + + + + * Long description here. + * + * @return void + */ + function foo() + { + } + ]]> + + + + * + * Long description here. + * + * + * @return void + */ + function foo() + { + } + ]]> + + + + + + * @return void + */ + function foo() + { + } + ]]> + + + + * + * @return void + */ + function foo() + { + } + ]]> + + + + + FooException + */ + function foo() + { + } + ]]> + + + @throws + */ + function foo() + { + } + ]]> + + + + + @return void + */ + function foo() + { + } + ]]> + + + + + + + + $foo Foo parameter + * @param string $bar Bar parameter + * @return void + */ + function foo($foo, $bar) + { + } + ]]> + + + $qux Bar parameter + * @return void + */ + function foo($foo, $bar) + { + } + ]]> + + + + + $foo Foo parameter + * @param string $bar Bar parameter + * @return void + */ + function foo($foo, $bar) + { + } + ]]> + + + $bar Bar parameter + * @param string $foo Foo parameter + * @return void + */ + function foo($foo, $bar) + { + } + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml new file mode 100644 index 00000000..53056e2a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml @@ -0,0 +1,19 @@ + + + + + + + // A comment. + ]]> + + + # A comment. + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml new file mode 100644 index 00000000..ce430fb1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml @@ -0,0 +1,36 @@ + + + + + + + ($foo) { +} + ]]> + + + ($foo){ +} + ]]> + + + + + { +} + ]]> + + + { +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml new file mode 100644 index 00000000..96d451dc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml @@ -0,0 +1,60 @@ + + + + + + + && $bar +) { +} + ]]> + + + && $bar +) { +} + ]]> + + + + + && $bar +) { +} + ]]> + + + && + $bar +) { +} + ]]> + + + + + ) { +} + ]]> + + + ) { +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml new file mode 100644 index 00000000..6d115be7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml @@ -0,0 +1,24 @@ + + + require_once. Anywhere you are conditionally including a class file (for example, factory methods), use include_once. Either of these will ensure that class files are included only once. They share the same file list, so you don't need to worry about mixing them - a file included with require_once will not be included again by include_once. + ]]> + + + include_once and require_once are statements, not functions. Parentheses should not surround the subject filename. + ]]> + + + + + + + ('PHP/CodeSniffer.php'); + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml new file mode 100644 index 00000000..e4911ef3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml new file mode 100644 index 00000000..e825c553 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml @@ -0,0 +1,35 @@ + + + + + + + = $bar; + ]]> + + + = + $bar; + ]]> + + + + + = $bar; + ]]> + + + = $bar; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml new file mode 100644 index 00000000..f8742277 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml @@ -0,0 +1,19 @@ + + + + + + + + + + ( $bar, $baz, $quux ) ; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml new file mode 100644 index 00000000..ced9ae2e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml @@ -0,0 +1,41 @@ + + + + + + + () use ($bar) { +}; + ]]> + + + ()use($bar){ +}; + ]]> + + + + + $bar, + $baz +) { +}; + ]]> + + + $bar, +$baz) +{ +}; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml new file mode 100644 index 00000000..56196cb6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml @@ -0,0 +1,25 @@ + + + + + + + $persistent = false) +{ + ... +} + ]]> + + + $persistent = false, $dsn) +{ + ... +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml new file mode 100644 index 00000000..d1608791 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml new file mode 100644 index 00000000..60841dd4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml new file mode 100644 index 00000000..4c707bdd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml @@ -0,0 +1,29 @@ + + + + + + + publicVar; + protected $protectedVar; + private $_privateVar; +} + ]]> + + + _publicVar; + protected $_protectedVar; + private $privateVar; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml new file mode 100644 index 00000000..9dee905d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml @@ -0,0 +1,39 @@ + + + + + + + ->bar() + ->baz(); + ]]> + + + -> + bar()-> + baz(); + ]]> + + + + + ->bar() + ->baz(); + ]]> + + + ->bar() +->baz(); + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml new file mode 100644 index 00000000..c8d6e274 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + + + } + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml new file mode 100644 index 00000000..fafa07ac --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml @@ -0,0 +1,29 @@ + + + + + + + if ($test) { + $var = 1; + } +} + ]]> + + + if ($test) { +$var = 1; +} +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php new file mode 100644 index 00000000..893dc9a8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php @@ -0,0 +1,150 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ClassDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param integer $stackPtr The position of the current token in the + * stack passed in $tokens. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $errorData = [strtolower($tokens[$stackPtr]['content'])]; + + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + $error = 'Possible parse error: %s missing opening or closing brace'; + $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $errorData); + return; + } + + $curlyBrace = $tokens[$stackPtr]['scope_opener']; + $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($curlyBrace - 1), $stackPtr, true); + $classLine = $tokens[$lastContent]['line']; + $braceLine = $tokens[$curlyBrace]['line']; + if ($braceLine === $classLine) { + $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'same line'); + $error = 'Opening brace of a %s must be on the line after the definition'; + $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNewLine', $errorData); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + if ($tokens[($curlyBrace - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($curlyBrace - 1), ''); + } + + $phpcsFile->fixer->addNewlineBefore($curlyBrace); + $phpcsFile->fixer->endChangeset(); + } + + return; + } else { + $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'new line'); + + if ($braceLine > ($classLine + 1)) { + $error = 'Opening brace of a %s must be on the line following the %s declaration; found %s line(s)'; + $data = [ + $tokens[$stackPtr]['content'], + $tokens[$stackPtr]['content'], + ($braceLine - $classLine - 1), + ]; + $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceWrongLine', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($curlyBrace - 1); $i > $lastContent; $i--) { + if ($tokens[$i]['line'] === ($tokens[$curlyBrace]['line'] + 1)) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + return; + }//end if + }//end if + + if ($tokens[($curlyBrace + 1)]['content'] !== $phpcsFile->eolChar) { + $error = 'Opening %s brace must be on a line by itself'; + + $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($curlyBrace + 1), null, true); + if ($tokens[$nextNonWhitespace]['code'] === T_PHPCS_IGNORE) { + // Don't auto-fix if the next thing is a PHPCS ignore annotation. + $phpcsFile->addError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData); + } else { + $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData); + if ($fix === true) { + $phpcsFile->fixer->addNewline($curlyBrace); + } + } + } + + if ($tokens[($curlyBrace - 1)]['code'] === T_WHITESPACE) { + $prevContent = $tokens[($curlyBrace - 1)]['content']; + if ($prevContent === $phpcsFile->eolChar) { + $spaces = 0; + } else { + $spaces = $tokens[($curlyBrace - 1)]['length']; + } + + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); + $expected = ($tokens[$first]['column'] - 1); + if ($spaces !== $expected) { + $error = 'Expected %s spaces before opening brace; %s found'; + $data = [ + $expected, + $spaces, + ]; + + $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'SpaceBeforeBrace', $data); + if ($fix === true) { + $indent = str_repeat(' ', $expected); + if ($spaces === 0) { + $phpcsFile->fixer->addContentBefore($curlyBrace, $indent); + } else { + $phpcsFile->fixer->replaceToken(($curlyBrace - 1), $indent); + } + } + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php new file mode 100644 index 00000000..8fa6bfba --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php @@ -0,0 +1,122 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class ClassCommentSniff extends FileCommentSniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $type = strtolower($tokens[$stackPtr]['content']); + $errorData = [$type]; + + $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) { + continue; + } + + if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END + && isset($tokens[$commentEnd]['attribute_opener']) === true + ) { + $commentEnd = $tokens[$commentEnd]['attribute_opener']; + continue; + } + + break; + } + + if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG + && $tokens[$commentEnd]['code'] !== T_COMMENT + ) { + $errorData[] = $phpcsFile->getDeclarationName($stackPtr); + $phpcsFile->addError('Missing doc comment for %s %s', $stackPtr, 'Missing', $errorData); + $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no'); + return; + } + + $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes'); + + if ($tokens[$commentEnd]['code'] === T_COMMENT) { + $phpcsFile->addError('You must use "/**" style comments for a %s comment', $stackPtr, 'WrongStyle', $errorData); + return; + } + + // Check each tag. + $this->processTags($phpcsFile, $stackPtr, $tokens[$commentEnd]['comment_opener']); + + }//end process() + + + /** + * Process the version tag. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $tags The tokens for these tags. + * + * @return void + */ + protected function processVersion($phpcsFile, array $tags) + { + $tokens = $phpcsFile->getTokens(); + foreach ($tags as $tag) { + if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { + // No content. + continue; + } + + $content = $tokens[($tag + 2)]['content']; + if ((strstr($content, 'Release:') === false)) { + $error = 'Invalid version "%s" in doc comment; consider "Release: " instead'; + $data = [$content]; + $phpcsFile->addWarning($error, $tag, 'InvalidVersion', $data); + } + } + + }//end processVersion() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php new file mode 100644 index 00000000..c47466a0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php @@ -0,0 +1,583 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Common; + +class FileCommentSniff implements Sniff +{ + + /** + * Tags in correct order and related info. + * + * @var array + */ + protected $tags = [ + '@category' => [ + 'required' => true, + 'allow_multiple' => false, + ], + '@package' => [ + 'required' => true, + 'allow_multiple' => false, + ], + '@subpackage' => [ + 'required' => false, + 'allow_multiple' => false, + ], + '@author' => [ + 'required' => true, + 'allow_multiple' => true, + ], + '@copyright' => [ + 'required' => false, + 'allow_multiple' => true, + ], + '@license' => [ + 'required' => true, + 'allow_multiple' => false, + ], + '@version' => [ + 'required' => false, + 'allow_multiple' => false, + ], + '@link' => [ + 'required' => true, + 'allow_multiple' => true, + ], + '@see' => [ + 'required' => false, + 'allow_multiple' => true, + ], + '@since' => [ + 'required' => false, + 'allow_multiple' => false, + ], + '@deprecated' => [ + 'required' => false, + 'allow_multiple' => false, + ], + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Find the next non whitespace token. + $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + + // Allow declare() statements at the top of the file. + if ($tokens[$commentStart]['code'] === T_DECLARE) { + $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($commentStart + 1)); + $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($semicolon + 1), null, true); + } + + // Ignore vim header. + if ($tokens[$commentStart]['code'] === T_COMMENT) { + if (strstr($tokens[$commentStart]['content'], 'vim:') !== false) { + $commentStart = $phpcsFile->findNext( + T_WHITESPACE, + ($commentStart + 1), + null, + true + ); + } + } + + $errorToken = ($stackPtr + 1); + if (isset($tokens[$errorToken]) === false) { + $errorToken--; + } + + if ($tokens[$commentStart]['code'] === T_CLOSE_TAG) { + // We are only interested if this is the first open tag. + return $phpcsFile->numTokens; + } else if ($tokens[$commentStart]['code'] === T_COMMENT) { + $error = 'You must use "/**" style comments for a file comment'; + $phpcsFile->addError($error, $errorToken, 'WrongStyle'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); + return $phpcsFile->numTokens; + } else if ($commentStart === false + || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG + ) { + $phpcsFile->addError('Missing file doc comment', $errorToken, 'Missing'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); + return $phpcsFile->numTokens; + } + + $commentEnd = $tokens[$commentStart]['comment_closer']; + + for ($nextToken = ($commentEnd + 1); $nextToken < $phpcsFile->numTokens; $nextToken++) { + if ($tokens[$nextToken]['code'] === T_WHITESPACE) { + continue; + } + + if ($tokens[$nextToken]['code'] === T_ATTRIBUTE + && isset($tokens[$nextToken]['attribute_closer']) === true + ) { + $nextToken = $tokens[$nextToken]['attribute_closer']; + continue; + } + + break; + } + + if ($nextToken === $phpcsFile->numTokens) { + $nextToken--; + } + + $ignore = [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + T_FUNCTION, + T_CLOSURE, + T_PUBLIC, + T_PRIVATE, + T_PROTECTED, + T_FINAL, + T_STATIC, + T_ABSTRACT, + T_READONLY, + T_CONST, + T_PROPERTY, + ]; + + if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { + $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); + return $phpcsFile->numTokens; + } + + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); + + // Check the PHP Version, which should be in some text before the first tag. + $found = false; + for ($i = ($commentStart + 1); $i < $commentEnd; $i++) { + if ($tokens[$i]['code'] === T_DOC_COMMENT_TAG) { + break; + } else if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING + && strstr(strtolower($tokens[$i]['content']), 'php version') !== false + ) { + $found = true; + break; + } + } + + if ($found === false) { + $error = 'PHP version not specified'; + $phpcsFile->addWarning($error, $commentEnd, 'MissingVersion'); + } + + // Check each tag. + $this->processTags($phpcsFile, $stackPtr, $commentStart); + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + + /** + * Processes each required or optional tag. + * + * @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 $commentStart Position in the stack where the comment started. + * + * @return void + */ + protected function processTags($phpcsFile, $stackPtr, $commentStart) + { + $tokens = $phpcsFile->getTokens(); + + if (get_class($this) === 'PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FileCommentSniff') { + $docBlock = 'file'; + } else { + $docBlock = 'class'; + } + + $commentEnd = $tokens[$commentStart]['comment_closer']; + + $foundTags = []; + $tagTokens = []; + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + $name = $tokens[$tag]['content']; + if (isset($this->tags[$name]) === false) { + continue; + } + + if ($this->tags[$name]['allow_multiple'] === false && isset($tagTokens[$name]) === true) { + $error = 'Only one %s tag is allowed in a %s comment'; + $data = [ + $name, + $docBlock, + ]; + $phpcsFile->addError($error, $tag, 'Duplicate'.ucfirst(substr($name, 1)).'Tag', $data); + } + + $foundTags[] = $name; + $tagTokens[$name][] = $tag; + + $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); + if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { + $error = 'Content missing for %s tag in %s comment'; + $data = [ + $name, + $docBlock, + ]; + $phpcsFile->addError($error, $tag, 'Empty'.ucfirst(substr($name, 1)).'Tag', $data); + continue; + } + }//end foreach + + // Check if the tags are in the correct position. + $pos = 0; + foreach ($this->tags as $tag => $tagData) { + if (isset($tagTokens[$tag]) === false) { + if ($tagData['required'] === true) { + $error = 'Missing %s tag in %s comment'; + $data = [ + $tag, + $docBlock, + ]; + $phpcsFile->addError($error, $commentEnd, 'Missing'.ucfirst(substr($tag, 1)).'Tag', $data); + } + + continue; + } else { + $method = 'process'.substr($tag, 1); + if (method_exists($this, $method) === true) { + // Process each tag if a method is defined. + call_user_func([$this, $method], $phpcsFile, $tagTokens[$tag]); + } + } + + if (isset($foundTags[$pos]) === false) { + break; + } + + if ($foundTags[$pos] !== $tag) { + $error = 'The tag in position %s should be the %s tag'; + $data = [ + ($pos + 1), + $tag, + ]; + $phpcsFile->addError($error, $tokens[$commentStart]['comment_tags'][$pos], ucfirst(substr($tag, 1)).'TagOrder', $data); + } + + // Account for multiple tags. + $pos++; + while (isset($foundTags[$pos]) === true && $foundTags[$pos] === $tag) { + $pos++; + } + }//end foreach + + }//end processTags() + + + /** + * Process the category tag. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $tags The tokens for these tags. + * + * @return void + */ + protected function processCategory($phpcsFile, array $tags) + { + $tokens = $phpcsFile->getTokens(); + foreach ($tags as $tag) { + if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { + // No content. + continue; + } + + $content = $tokens[($tag + 2)]['content']; + if (Common::isUnderscoreName($content) !== true) { + $newContent = str_replace(' ', '_', $content); + $nameBits = explode('_', $newContent); + $firstBit = array_shift($nameBits); + $newName = ucfirst($firstBit).'_'; + foreach ($nameBits as $bit) { + if ($bit !== '') { + $newName .= ucfirst($bit).'_'; + } + } + + $error = 'Category name "%s" is not valid; consider "%s" instead'; + $validName = trim($newName, '_'); + $data = [ + $content, + $validName, + ]; + $phpcsFile->addError($error, $tag, 'InvalidCategory', $data); + } + }//end foreach + + }//end processCategory() + + + /** + * Process the package tag. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $tags The tokens for these tags. + * + * @return void + */ + protected function processPackage($phpcsFile, array $tags) + { + $tokens = $phpcsFile->getTokens(); + foreach ($tags as $tag) { + if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { + // No content. + continue; + } + + $content = $tokens[($tag + 2)]['content']; + if (Common::isUnderscoreName($content) === true) { + continue; + } + + $newContent = str_replace(' ', '_', $content); + $newContent = trim($newContent, '_'); + $newContent = preg_replace('/[^A-Za-z_]/', '', $newContent); + + if ($newContent === '') { + $error = 'Package name "%s" is not valid'; + $data = [$content]; + $phpcsFile->addError($error, $tag, 'InvalidPackageValue', $data); + } else { + $nameBits = explode('_', $newContent); + $firstBit = array_shift($nameBits); + $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; + foreach ($nameBits as $bit) { + if ($bit !== '') { + $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; + } + } + + $error = 'Package name "%s" is not valid; consider "%s" instead'; + $validName = trim($newName, '_'); + $data = [ + $content, + $validName, + ]; + $phpcsFile->addError($error, $tag, 'InvalidPackage', $data); + }//end if + }//end foreach + + }//end processPackage() + + + /** + * Process the subpackage tag. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $tags The tokens for these tags. + * + * @return void + */ + protected function processSubpackage($phpcsFile, array $tags) + { + $tokens = $phpcsFile->getTokens(); + foreach ($tags as $tag) { + if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { + // No content. + continue; + } + + $content = $tokens[($tag + 2)]['content']; + if (Common::isUnderscoreName($content) === true) { + continue; + } + + $newContent = str_replace(' ', '_', $content); + $nameBits = explode('_', $newContent); + $firstBit = array_shift($nameBits); + $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; + foreach ($nameBits as $bit) { + if ($bit !== '') { + $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; + } + } + + $error = 'Subpackage name "%s" is not valid; consider "%s" instead'; + $validName = trim($newName, '_'); + $data = [ + $content, + $validName, + ]; + $phpcsFile->addError($error, $tag, 'InvalidSubpackage', $data); + }//end foreach + + }//end processSubpackage() + + + /** + * Process the author tag(s) that this header comment has. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $tags The tokens for these tags. + * + * @return void + */ + protected function processAuthor($phpcsFile, array $tags) + { + $tokens = $phpcsFile->getTokens(); + foreach ($tags as $tag) { + if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { + // No content. + continue; + } + + $content = $tokens[($tag + 2)]['content']; + $local = '\da-zA-Z-_+'; + // Dot character cannot be the first or last character in the local-part. + $localMiddle = $local.'.\w'; + if (preg_match('/^([^<]*)\s+<(['.$local.'](['.$localMiddle.']*['.$local.'])*@[\da-zA-Z][-.\w]*[\da-zA-Z]\.[a-zA-Z]{2,})>$/', $content) === 0) { + $error = 'Content of the @author tag must be in the form "Display Name "'; + $phpcsFile->addError($error, $tag, 'InvalidAuthors'); + } + } + + }//end processAuthor() + + + /** + * Process the copyright tags. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $tags The tokens for these tags. + * + * @return void + */ + protected function processCopyright($phpcsFile, array $tags) + { + $tokens = $phpcsFile->getTokens(); + foreach ($tags as $tag) { + if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { + // No content. + continue; + } + + $content = $tokens[($tag + 2)]['content']; + $matches = []; + if (preg_match('/^([0-9]{4})((.{1})([0-9]{4}))? (.+)$/', $content, $matches) !== 0) { + // Check earliest-latest year order. + if ($matches[3] !== '' && $matches[3] !== null) { + if ($matches[3] !== '-') { + $error = 'A hyphen must be used between the earliest and latest year'; + $phpcsFile->addError($error, $tag, 'CopyrightHyphen'); + } + + if ($matches[4] !== '' && $matches[4] !== null && $matches[4] < $matches[1]) { + $error = "Invalid year span \"$matches[1]$matches[3]$matches[4]\" found; consider \"$matches[4]-$matches[1]\" instead"; + $phpcsFile->addWarning($error, $tag, 'InvalidCopyright'); + } + } + } else { + $error = '@copyright tag must contain a year and the name of the copyright holder'; + $phpcsFile->addError($error, $tag, 'IncompleteCopyright'); + } + }//end foreach + + }//end processCopyright() + + + /** + * Process the license tag. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $tags The tokens for these tags. + * + * @return void + */ + protected function processLicense($phpcsFile, array $tags) + { + $tokens = $phpcsFile->getTokens(); + foreach ($tags as $tag) { + if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { + // No content. + continue; + } + + $content = $tokens[($tag + 2)]['content']; + $matches = []; + preg_match('/^([^\s]+)\s+(.*)/', $content, $matches); + if (count($matches) !== 3) { + $error = '@license tag must contain a URL and a license name'; + $phpcsFile->addError($error, $tag, 'IncompleteLicense'); + } + } + + }//end processLicense() + + + /** + * Process the version tag. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $tags The tokens for these tags. + * + * @return void + */ + protected function processVersion($phpcsFile, array $tags) + { + $tokens = $phpcsFile->getTokens(); + foreach ($tags as $tag) { + if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { + // No content. + continue; + } + + $content = $tokens[($tag + 2)]['content']; + if (strstr($content, 'CVS:') === false + && strstr($content, 'SVN:') === false + && strstr($content, 'GIT:') === false + && strstr($content, 'HG:') === false + ) { + $error = 'Invalid version "%s" in file comment; consider "CVS: " or "SVN: " or "GIT: " or "HG: " instead'; + $data = [$content]; + $phpcsFile->addWarning($error, $tag, 'InvalidVersion', $data); + } + } + + }//end processVersion() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php new file mode 100644 index 00000000..ee242cf6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php @@ -0,0 +1,539 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class FunctionCommentSniff implements Sniff +{ + + /** + * Disable the check for functions with a lower visibility than the value given. + * + * Allowed values are public, protected, and private. + * + * @var string + */ + public $minimumVisibility = 'private'; + + /** + * Array of methods which do not require a return type. + * + * @var array + */ + public $specialMethods = [ + '__construct', + '__destruct', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $scopeModifier = $phpcsFile->getMethodProperties($stackPtr)['scope']; + if (($scopeModifier === 'protected' + && $this->minimumVisibility === 'public') + || ($scopeModifier === 'private' + && ($this->minimumVisibility === 'public' || $this->minimumVisibility === 'protected')) + ) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $ignore = Tokens::$methodPrefixes; + $ignore[T_WHITESPACE] = T_WHITESPACE; + + for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { + if (isset($ignore[$tokens[$commentEnd]['code']]) === true) { + continue; + } + + if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END + && isset($tokens[$commentEnd]['attribute_opener']) === true + ) { + $commentEnd = $tokens[$commentEnd]['attribute_opener']; + continue; + } + + break; + } + + if ($tokens[$commentEnd]['code'] === T_COMMENT) { + // Inline comments might just be closing comments for + // control structures or functions instead of function comments + // using the wrong comment type. If there is other code on the line, + // assume they relate to that code. + $prev = $phpcsFile->findPrevious($ignore, ($commentEnd - 1), null, true); + if ($prev !== false && $tokens[$prev]['line'] === $tokens[$commentEnd]['line']) { + $commentEnd = $prev; + } + } + + if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG + && $tokens[$commentEnd]['code'] !== T_COMMENT + ) { + $function = $phpcsFile->getDeclarationName($stackPtr); + $phpcsFile->addError( + 'Missing doc comment for function %s()', + $stackPtr, + 'Missing', + [$function] + ); + $phpcsFile->recordMetric($stackPtr, 'Function has doc comment', 'no'); + return; + } else { + $phpcsFile->recordMetric($stackPtr, 'Function has doc comment', 'yes'); + } + + if ($tokens[$commentEnd]['code'] === T_COMMENT) { + $phpcsFile->addError('You must use "/**" style comments for a function comment', $stackPtr, 'WrongStyle'); + return; + } + + if ($tokens[$commentEnd]['line'] !== ($tokens[$stackPtr]['line'] - 1)) { + for ($i = ($commentEnd + 1); $i < $stackPtr; $i++) { + if ($tokens[$i]['column'] !== 1) { + continue; + } + + if ($tokens[$i]['code'] === T_WHITESPACE + && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] + ) { + $error = 'There must be no blank lines after the function comment'; + $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) { + if ($tokens[$tag]['content'] === '@see') { + // Make sure the tag isn't empty. + $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); + if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { + $error = 'Content missing for @see tag in function comment'; + $phpcsFile->addError($error, $tag, 'EmptySees'); + } + } + } + + $this->processReturn($phpcsFile, $stackPtr, $commentStart); + $this->processThrows($phpcsFile, $stackPtr, $commentStart); + $this->processParams($phpcsFile, $stackPtr, $commentStart); + + }//end process() + + + /** + * Process the return comment of this function comment. + * + * @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 $commentStart The position in the stack where the comment started. + * + * @return void + */ + protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) + { + $tokens = $phpcsFile->getTokens(); + + // Skip constructor and destructor. + $methodName = $phpcsFile->getDeclarationName($stackPtr); + $isSpecialMethod = in_array($methodName, $this->specialMethods, true); + + $return = null; + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + if ($tokens[$tag]['content'] === '@return') { + if ($return !== null) { + $error = 'Only 1 @return tag is allowed in a function comment'; + $phpcsFile->addError($error, $tag, 'DuplicateReturn'); + return; + } + + $return = $tag; + } + } + + if ($return !== null) { + $content = $tokens[($return + 2)]['content']; + if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) { + $error = 'Return type missing for @return tag in function comment'; + $phpcsFile->addError($error, $return, 'MissingReturnType'); + } + } else { + if ($isSpecialMethod === true) { + return; + } + + $error = 'Missing @return tag in function comment'; + $phpcsFile->addError($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn'); + }//end if + + }//end processReturn() + + + /** + * Process any throw tags that this function comment has. + * + * @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 $commentStart The position in the stack where the comment started. + * + * @return void + */ + protected function processThrows(File $phpcsFile, $stackPtr, $commentStart) + { + $tokens = $phpcsFile->getTokens(); + + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + if ($tokens[$tag]['content'] !== '@throws') { + continue; + } + + $exception = null; + if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { + $matches = []; + preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches); + $exception = $matches[1]; + } + + if ($exception === null) { + $error = 'Exception type missing for @throws tag in function comment'; + $phpcsFile->addError($error, $tag, 'InvalidThrows'); + } + }//end foreach + + }//end processThrows() + + + /** + * Process the function parameter comments. + * + * @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 $commentStart The position in the stack where the comment started. + * + * @return void + */ + protected function processParams(File $phpcsFile, $stackPtr, $commentStart) + { + $tokens = $phpcsFile->getTokens(); + + $params = []; + $maxType = 0; + $maxVar = 0; + foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { + if ($tokens[$tag]['content'] !== '@param') { + continue; + } + + $type = ''; + $typeSpace = 0; + $var = ''; + $varSpace = 0; + $comment = ''; + $commentEnd = 0; + $commentTokens = []; + + if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { + $matches = []; + preg_match('/((?:(?![$.]|&(?=\$)).)*)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches); + + if (empty($matches) === false) { + $typeLen = strlen($matches[1]); + $type = trim($matches[1]); + $typeSpace = ($typeLen - strlen($type)); + $typeLen = strlen($type); + if ($typeLen > $maxType) { + $maxType = $typeLen; + } + } + + if (isset($matches[2]) === true) { + $var = $matches[2]; + $varLen = strlen($var); + if ($varLen > $maxVar) { + $maxVar = $varLen; + } + + if (isset($matches[4]) === true) { + $varSpace = strlen($matches[3]); + $comment = $matches[4]; + + // Any strings until the next tag belong to this comment. + if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { + $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; + } else { + $end = $tokens[$commentStart]['comment_closer']; + } + + for ($i = ($tag + 3); $i < $end; $i++) { + if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { + $comment .= ' '.$tokens[$i]['content']; + $commentEnd = $i; + $commentTokens[] = $i; + } + } + } else { + $error = 'Missing parameter comment'; + $phpcsFile->addError($error, $tag, 'MissingParamComment'); + }//end if + } else { + $error = 'Missing parameter name'; + $phpcsFile->addError($error, $tag, 'MissingParamName'); + }//end if + } else { + $error = 'Missing parameter type'; + $phpcsFile->addError($error, $tag, 'MissingParamType'); + }//end if + + $params[] = [ + 'tag' => $tag, + 'type' => $type, + 'var' => $var, + 'comment' => $comment, + 'comment_end' => $commentEnd, + 'comment_tokens' => $commentTokens, + 'type_space' => $typeSpace, + 'var_space' => $varSpace, + ]; + }//end foreach + + $realParams = $phpcsFile->getMethodParameters($stackPtr); + $foundParams = []; + + // We want to use ... for all variable length arguments, so add + // this prefix to the variable name so comparisons are easier. + foreach ($realParams as $pos => $param) { + if ($param['variable_length'] === true) { + $realParams[$pos]['name'] = '...'.$realParams[$pos]['name']; + } + } + + foreach ($params as $pos => $param) { + if ($param['var'] === '') { + continue; + } + + $foundParams[] = $param['var']; + + if (trim($param['type']) !== '') { + // Check number of spaces after the type. + $spaces = ($maxType - strlen($param['type']) + 1); + if ($param['type_space'] !== $spaces) { + $error = 'Expected %s spaces after parameter type; %s found'; + $data = [ + $spaces, + $param['type_space'], + ]; + + $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamType', $data); + if ($fix === true) { + $commentToken = ($param['tag'] + 2); + + $content = $param['type']; + $content .= str_repeat(' ', $spaces); + $content .= $param['var']; + $content .= str_repeat(' ', $param['var_space']); + + $wrapLength = ($tokens[$commentToken]['length'] - $param['type_space'] - $param['var_space'] - strlen($param['type']) - strlen($param['var'])); + + $star = $phpcsFile->findPrevious(T_DOC_COMMENT_STAR, $param['tag']); + $spaceLength = (strlen($content) + $tokens[($commentToken - 1)]['length'] + $tokens[($commentToken - 2)]['length']); + + $padding = str_repeat(' ', ($tokens[$star]['column'] - 1)); + $padding .= '* '; + $padding .= str_repeat(' ', $spaceLength); + + $content .= wordwrap( + $param['comment'], + $wrapLength, + $phpcsFile->eolChar.$padding + ); + + $phpcsFile->fixer->replaceToken($commentToken, $content); + for ($i = ($commentToken + 1); $i <= $param['comment_end']; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + }//end if + }//end if + }//end if + + // Make sure the param name is correct. + if (isset($realParams[$pos]) === true) { + $realName = $realParams[$pos]['name']; + if ($realName !== $param['var']) { + $code = 'ParamNameNoMatch'; + $data = [ + $param['var'], + $realName, + ]; + + $error = 'Doc comment for parameter %s does not match '; + if (strtolower($param['var']) === strtolower($realName)) { + $error .= 'case of '; + $code = 'ParamNameNoCaseMatch'; + } + + $error .= 'actual variable name %s'; + + $phpcsFile->addError($error, $param['tag'], $code, $data); + } + } else if (substr($param['var'], -4) !== ',...') { + // We must have an extra parameter comment. + $error = 'Superfluous parameter comment'; + $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment'); + }//end if + + if ($param['comment'] === '') { + continue; + } + + // Check number of spaces after the param name. + $spaces = ($maxVar - strlen($param['var']) + 1); + if ($param['var_space'] !== $spaces) { + $error = 'Expected %s spaces after parameter name; %s found'; + $data = [ + $spaces, + $param['var_space'], + ]; + + $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamName', $data); + if ($fix === true) { + $commentToken = ($param['tag'] + 2); + + $content = $param['type']; + $content .= str_repeat(' ', $param['type_space']); + $content .= $param['var']; + $content .= str_repeat(' ', $spaces); + + $wrapLength = ($tokens[$commentToken]['length'] - $param['type_space'] - $param['var_space'] - strlen($param['type']) - strlen($param['var'])); + + $star = $phpcsFile->findPrevious(T_DOC_COMMENT_STAR, $param['tag']); + $spaceLength = (strlen($content) + $tokens[($commentToken - 1)]['length'] + $tokens[($commentToken - 2)]['length']); + + $padding = str_repeat(' ', ($tokens[$star]['column'] - 1)); + $padding .= '* '; + $padding .= str_repeat(' ', $spaceLength); + + $content .= wordwrap( + $param['comment'], + $wrapLength, + $phpcsFile->eolChar.$padding + ); + + $phpcsFile->fixer->replaceToken($commentToken, $content); + for ($i = ($commentToken + 1); $i <= $param['comment_end']; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + }//end if + }//end if + + // Check the alignment of multi-line param comments. + if ($param['tag'] !== $param['comment_end']) { + $wrapLength = ($tokens[($param['tag'] + 2)]['length'] - $param['type_space'] - $param['var_space'] - strlen($param['type']) - strlen($param['var'])); + + $startColumn = ($tokens[($param['tag'] + 2)]['column'] + $tokens[($param['tag'] + 2)]['length'] - $wrapLength); + + $star = $phpcsFile->findPrevious(T_DOC_COMMENT_STAR, $param['tag']); + $expected = ($startColumn - $tokens[$star]['column'] - 1); + + foreach ($param['comment_tokens'] as $commentToken) { + if ($tokens[$commentToken]['column'] === $startColumn) { + continue; + } + + $found = 0; + if ($tokens[($commentToken - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { + $found = $tokens[($commentToken - 1)]['length']; + } + + $error = 'Parameter comment not aligned correctly; expected %s spaces but found %s'; + $data = [ + $expected, + $found, + ]; + + if ($found < $expected) { + $code = 'ParamCommentAlignment'; + } else { + $code = 'ParamCommentAlignmentExceeded'; + } + + $fix = $phpcsFile->addFixableError($error, $commentToken, $code, $data); + if ($fix === true) { + $padding = str_repeat(' ', $expected); + if ($tokens[($commentToken - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($commentToken - 1), $padding); + } else { + $phpcsFile->fixer->addContentBefore($commentToken, $padding); + } + } + }//end foreach + }//end if + }//end foreach + + $realNames = []; + foreach ($realParams as $realParam) { + $realNames[] = $realParam['name']; + } + + // Report missing comments. + $diff = array_diff($realNames, $foundParams); + foreach ($diff as $neededParam) { + $error = 'Doc comment for parameter "%s" missing'; + $data = [$neededParam]; + $phpcsFile->addError($error, $commentStart, 'MissingParamTag', $data); + } + + }//end processParams() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php new file mode 100644 index 00000000..71c11808 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php @@ -0,0 +1,68 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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\Sniffs\Sniff; + +class InlineCommentSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_COMMENT]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if ($tokens[$stackPtr]['content'][0] === '#') { + $phpcsFile->recordMetric($stackPtr, 'Inline comment style', '# ...'); + + $error = 'Perl-style comments are not allowed. Use "// Comment."'; + $error .= ' or "/* comment */" instead.'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStyle'); + if ($fix === true) { + $newComment = ltrim($tokens[$stackPtr]['content'], '# '); + $newComment = '// '.$newComment; + $phpcsFile->fixer->replaceToken($stackPtr, $newComment); + } + } else if ($tokens[$stackPtr]['content'][0] === '/' + && $tokens[$stackPtr]['content'][1] === '/' + ) { + $phpcsFile->recordMetric($stackPtr, 'Inline comment style', '// ...'); + } else if ($tokens[$stackPtr]['content'][0] === '/' + && $tokens[$stackPtr]['content'][1] === '*' + ) { + $phpcsFile->recordMetric($stackPtr, 'Inline comment style', '/* ... */'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php new file mode 100644 index 00000000..4ca5451b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -0,0 +1,48 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Sniffs\AbstractPatternSniff; + +class ControlSignatureSniff extends AbstractPatternSniff +{ + + /** + * If true, comments will be ignored if they are found in the code. + * + * @var boolean + */ + public $ignoreComments = true; + + + /** + * Returns the patterns that this test wishes to verify. + * + * @return string[] + */ + protected function getPatterns() + { + return [ + 'do {EOL...} while (...);EOL', + 'while (...) {EOL', + 'for (...) {EOL', + 'if (...) {EOL', + 'foreach (...) {EOL', + '} else if (...) {EOL', + '} elseif (...) {EOL', + '} else {EOL', + 'do {EOL', + 'match (...) {EOL', + ]; + + }//end getPatterns() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php new file mode 100644 index 00000000..08752eda --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php @@ -0,0 +1,283 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class MultiLineConditionSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_IF, + T_ELSEIF, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { + return; + } + + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + $spaceAfterOpen = 0; + if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { + if (strpos($tokens[($openBracket + 1)]['content'], $phpcsFile->eolChar) !== false) { + $spaceAfterOpen = 'newline'; + } else { + $spaceAfterOpen = $tokens[($openBracket + 1)]['length']; + } + } + + if ($spaceAfterOpen !== 0) { + $error = 'First condition of a multi-line IF statement must directly follow the opening parenthesis'; + $fix = $phpcsFile->addFixableError($error, ($openBracket + 1), 'SpacingAfterOpenBrace'); + if ($fix === true) { + if ($spaceAfterOpen === 'newline') { + $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); + } else { + $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); + } + } + } + + // We need to work out how far indented the if statement + // itself is, so we can work out how far to indent conditions. + $statementIndent = 0; + for ($i = ($stackPtr - 1); $i >= 0; $i--) { + if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) { + $i++; + break; + } + } + + if ($i >= 0 && $tokens[$i]['code'] === T_WHITESPACE) { + $statementIndent = $tokens[$i]['length']; + } + + // Each line between the parenthesis should be indented 4 spaces + // and start with an operator, unless the line is inside a + // function call, in which case it is ignored. + $prevLine = $tokens[$openBracket]['line']; + for ($i = ($openBracket + 1); $i <= $closeBracket; $i++) { + if ($i === $closeBracket && $tokens[$openBracket]['line'] !== $tokens[$i]['line']) { + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), null, true); + if ($tokens[$prev]['line'] === $tokens[$i]['line']) { + // Closing bracket is on the same line as a condition. + $error = 'Closing parenthesis of a multi-line IF statement must be on a new line'; + $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketNewLine'); + if ($fix === true) { + // Account for a comment at the end of the line. + $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true); + if ($tokens[$next]['code'] !== T_COMMENT + && isset(Tokens::$phpcsCommentTokens[$tokens[$next]['code']]) === false + ) { + $phpcsFile->fixer->addNewlineBefore($closeBracket); + } else { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($closeBracket, ''); + $phpcsFile->fixer->addContentBefore($next, ')'); + $phpcsFile->fixer->endChangeset(); + } + } + } + }//end if + + if ($tokens[$i]['line'] !== $prevLine) { + if ($tokens[$i]['line'] === $tokens[$closeBracket]['line']) { + $next = $phpcsFile->findNext(T_WHITESPACE, $i, null, true); + if ($next !== $closeBracket) { + $expectedIndent = ($statementIndent + $this->indent); + } else { + // Closing brace needs to be indented to the same level + // as the statement. + $expectedIndent = $statementIndent; + }//end if + } else { + $expectedIndent = ($statementIndent + $this->indent); + }//end if + + if ($tokens[$i]['code'] === T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true + ) { + $prevLine = $tokens[$i]['line']; + continue; + } + + // We changed lines, so this should be a whitespace indent token. + if ($tokens[$i]['code'] !== T_WHITESPACE) { + $foundIndent = 0; + } else { + $foundIndent = $tokens[$i]['length']; + } + + if ($expectedIndent !== $foundIndent) { + $error = 'Multi-line IF statement not indented correctly; expected %s spaces but found %s'; + $data = [ + $expectedIndent, + $foundIndent, + ]; + + $fix = $phpcsFile->addFixableError($error, $i, 'Alignment', $data); + if ($fix === true) { + $spaces = str_repeat(' ', $expectedIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($i, $spaces); + } else { + $phpcsFile->fixer->replaceToken($i, $spaces); + } + } + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, $i, null, true); + if ($next !== $closeBracket && $tokens[$next]['line'] === $tokens[$i]['line']) { + if (isset(Tokens::$booleanOperators[$tokens[$next]['code']]) === false) { + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $openBracket, true); + $fixable = true; + if (isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === false + && $phpcsFile->findNext(T_WHITESPACE, ($prev + 1), $next, true) !== false + ) { + // Condition spread over multi-lines interspersed with comments. + $fixable = false; + } + + $error = 'Each line in a multi-line IF statement must begin with a boolean operator'; + if ($fixable === false) { + $phpcsFile->addError($error, $next, 'StartWithBoolean'); + } else { + $fix = $phpcsFile->addFixableError($error, $next, 'StartWithBoolean'); + if ($fix === true) { + if (isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($prev, ''); + $phpcsFile->fixer->addContentBefore($next, $tokens[$prev]['content'].' '); + $phpcsFile->fixer->endChangeset(); + } else { + for ($x = ($prev + 1); $x < $next; $x++) { + $phpcsFile->fixer->replaceToken($x, ''); + } + } + } + } + }//end if + }//end if + + $prevLine = $tokens[$i]['line']; + }//end if + + if ($tokens[$i]['code'] === T_STRING) { + $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), null, true); + if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) { + // This is a function call, so skip to the end as they + // have their own indentation rules. + $i = $tokens[$next]['parenthesis_closer']; + $prevLine = $tokens[$i]['line']; + continue; + } + } + }//end for + + // From here on, we are checking the spacing of the opening and closing + // braces. If this IF statement does not use braces, we end here. + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + // The opening brace needs to be one space away from the closing parenthesis. + $openBrace = $tokens[$stackPtr]['scope_opener']; + $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), $openBrace, true); + if ($next !== false) { + // Probably comments in between tokens, so don't check. + return; + } + + if ($tokens[$openBrace]['line'] > $tokens[$closeBracket]['line']) { + $length = -1; + } else if ($openBrace === ($closeBracket + 1)) { + $length = 0; + } else if ($openBrace === ($closeBracket + 2) + && $tokens[($closeBracket + 1)]['code'] === T_WHITESPACE + ) { + $length = $tokens[($closeBracket + 1)]['length']; + } else { + // Confused, so don't check. + $length = 1; + } + + if ($length === 1) { + return; + } + + $data = [$length]; + $code = 'SpaceBeforeOpenBrace'; + + $error = 'There must be a single space between the closing parenthesis and the opening brace of a multi-line IF statement; found '; + if ($length === -1) { + $error .= 'newline'; + $code = 'NewlineBeforeOpenBrace'; + } else { + $error .= '%s spaces'; + } + + $fix = $phpcsFile->addFixableError($error, ($closeBracket + 1), $code, $data); + if ($fix === true) { + if ($length === 0) { + $phpcsFile->fixer->addContent($closeBracket, ' '); + } else { + $phpcsFile->fixer->replaceToken(($closeBracket + 1), ' '); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php new file mode 100644 index 00000000..e0ed0fb1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php @@ -0,0 +1,136 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class IncludingFileSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_INCLUDE_ONCE, + T_REQUIRE_ONCE, + T_REQUIRE, + T_INCLUDE, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS) { + $error = '"%s" is a statement not a function; no parentheses are required'; + $data = [$tokens[$stackPtr]['content']]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'BracketsNotRequired', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($tokens[$nextToken]['parenthesis_closer'], ''); + if ($tokens[($nextToken - 1)]['code'] !== T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($nextToken, ' '); + } else { + $phpcsFile->fixer->replaceToken($nextToken, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + if (count($tokens[$stackPtr]['conditions']) !== 0) { + $inCondition = true; + } else { + $inCondition = false; + } + + // Check to see if this including statement is within the parenthesis + // of a condition. If that's the case then we need to process it as being + // within a condition, as they are checking the return value. + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + foreach ($tokens[$stackPtr]['nested_parenthesis'] as $left => $right) { + if (isset($tokens[$left]['parenthesis_owner']) === true) { + $inCondition = true; + } + } + } + + // Check to see if they are assigning the return value of this + // including call. If they are then they are probably checking it, so + // it's conditional. + $previous = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if (isset(Tokens::$assignmentTokens[$tokens[$previous]['code']]) === true) { + // The have assigned the return value to it, so its conditional. + $inCondition = true; + } + + $tokenCode = $tokens[$stackPtr]['code']; + if ($inCondition === true) { + // We are inside a conditional statement. We need an include_once. + if ($tokenCode === T_REQUIRE_ONCE) { + $error = 'File is being conditionally included; '; + $error .= 'use "include_once" instead'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseIncludeOnce'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, 'include_once'); + } + } else if ($tokenCode === T_REQUIRE) { + $error = 'File is being conditionally included; '; + $error .= 'use "include" instead'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseInclude'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, 'include'); + } + } + } else { + // We are unconditionally including, we need a require_once. + if ($tokenCode === T_INCLUDE_ONCE) { + $error = 'File is being unconditionally included; '; + $error .= 'use "require_once" instead'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseRequireOnce'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, 'require_once'); + } + } else if ($tokenCode === T_INCLUDE) { + $error = 'File is being unconditionally included; '; + $error .= 'use "require" instead'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseRequire'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, 'require'); + } + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php new file mode 100644 index 00000000..0f18710d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php @@ -0,0 +1,106 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class MultiLineAssignmentSniff implements Sniff +{ + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_EQUAL]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Equal sign can't be the last thing on the line. + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($next === false) { + // Bad assignment. + return; + } + + if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { + $error = 'Multi-line assignments must have the equal sign on the second line'; + $phpcsFile->addError($error, $stackPtr, 'EqualSignLine'); + return; + } + + // Make sure it is the first thing on the line, otherwise we ignore it. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), false, true); + if ($prev === false) { + // Bad assignment. + return; + } + + if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) { + return; + } + + // Find the required indent based on the ident of the previous line. + $assignmentIndent = 0; + $prevLine = $tokens[$prev]['line']; + for ($i = ($prev - 1); $i >= 0; $i--) { + if ($tokens[$i]['line'] !== $prevLine) { + $i++; + break; + } + } + + if ($tokens[$i]['code'] === T_WHITESPACE) { + $assignmentIndent = $tokens[$i]['length']; + } + + // Find the actual indent. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1)); + + $expectedIndent = ($assignmentIndent + $this->indent); + $foundIndent = $tokens[$prev]['length']; + if ($foundIndent !== $expectedIndent) { + $error = 'Multi-line assignment not indented correctly; expected %s spaces but found %s'; + $data = [ + $expectedIndent, + $foundIndent, + ]; + $phpcsFile->addError($error, $stackPtr, 'Indent', $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php new file mode 100644 index 00000000..772ab6b8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php @@ -0,0 +1,634 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class FunctionCallSignatureSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + /** + * If TRUE, multiple arguments can be defined per line in a multi-line call. + * + * @var boolean + */ + public $allowMultipleArguments = true; + + /** + * How many spaces should follow the opening bracket. + * + * @var integer + */ + public $requiredSpacesAfterOpen = 0; + + /** + * How many spaces should precede the closing bracket. + * + * @var integer + */ + public $requiredSpacesBeforeClose = 0; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + $tokens = Tokens::$functionNameTokens; + + $tokens[] = T_VARIABLE; + $tokens[] = T_CLOSE_CURLY_BRACKET; + $tokens[] = T_CLOSE_SQUARE_BRACKET; + $tokens[] = T_CLOSE_PARENTHESIS; + + return $tokens; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; + $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === T_CLOSE_CURLY_BRACKET + && isset($tokens[$stackPtr]['scope_condition']) === true + ) { + // Not a function call. + return; + } + + // Find the next non-empty token. + $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { + // Not a function call. + return; + } + + if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { + // Not a function call. + return; + } + + // Find the previous non-empty token. + $search = Tokens::$emptyTokens; + $search[] = T_BITWISE_AND; + $previous = $phpcsFile->findPrevious($search, ($stackPtr - 1), null, true); + if ($tokens[$previous]['code'] === T_FUNCTION) { + // It's a function definition, not a function call. + return; + } + + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + + if (($stackPtr + 1) !== $openBracket) { + // Checking this: $value = my_function[*](...). + $error = 'Space before opening parenthesis of function call prohibited'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeOpenBracket'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($stackPtr + 1); $i < $openBracket; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + // Modify the bracket as well to ensure a conflict if the bracket + // has been changed in some way by another sniff. + $phpcsFile->fixer->replaceToken($openBracket, '('); + $phpcsFile->fixer->endChangeset(); + } + } + + $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true); + if ($tokens[$next]['code'] === T_SEMICOLON) { + if (isset(Tokens::$emptyTokens[$tokens[($closeBracket + 1)]['code']]) === true) { + $error = 'Space after closing parenthesis of function call prohibited'; + $fix = $phpcsFile->addFixableError($error, $closeBracket, 'SpaceAfterCloseBracket'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($closeBracket + 1); $i < $next; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + // Modify the bracket as well to ensure a conflict if the bracket + // has been changed in some way by another sniff. + $phpcsFile->fixer->replaceToken($closeBracket, ')'); + $phpcsFile->fixer->endChangeset(); + } + } + } + + // Check if this is a single line or multi-line function call. + if ($this->isMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { + $this->processMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens); + } else { + $this->processSingleLineCall($phpcsFile, $stackPtr, $openBracket, $tokens); + } + + }//end process() + + + /** + * Determine if this is a multi-line function call. + * + * @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 $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return bool + */ + public function isMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) + { + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { + return true; + } + + return false; + + }//end isMultiLineCall() + + + /** + * Processes single-line calls. + * + * @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 $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processSingleLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) + { + $closer = $tokens[$openBracket]['parenthesis_closer']; + if ($openBracket === ($closer - 1)) { + return; + } + + // If the function call has no arguments or comments, enforce 0 spaces. + $next = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), $closer, true); + if ($next === false) { + $requiredSpacesAfterOpen = 0; + $requiredSpacesBeforeClose = 0; + } else { + $requiredSpacesAfterOpen = $this->requiredSpacesAfterOpen; + $requiredSpacesBeforeClose = $this->requiredSpacesBeforeClose; + } + + if ($requiredSpacesAfterOpen === 0 && $tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { + // Checking this: $value = my_function([*]...). + $error = 'Space after opening parenthesis of function call prohibited'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); + } + } else if ($requiredSpacesAfterOpen > 0) { + $spaceAfterOpen = 0; + if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { + $spaceAfterOpen = $tokens[($openBracket + 1)]['length']; + } + + if ($spaceAfterOpen !== $requiredSpacesAfterOpen) { + $error = 'Expected %s spaces after opening parenthesis; %s found'; + $data = [ + $requiredSpacesAfterOpen, + $spaceAfterOpen, + ]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket', $data); + if ($fix === true) { + $padding = str_repeat(' ', $requiredSpacesAfterOpen); + if ($spaceAfterOpen === 0) { + $phpcsFile->fixer->addContent($openBracket, $padding); + } else { + $phpcsFile->fixer->replaceToken(($openBracket + 1), $padding); + } + } + } + }//end if + + // Checking this: $value = my_function(...[*]). + $spaceBeforeClose = 0; + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closer - 1), $openBracket, true); + if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) { + // Need a newline after these tokens, so ignore this rule. + return; + } + + if ($tokens[$prev]['line'] !== $tokens[$closer]['line']) { + $spaceBeforeClose = 'newline'; + } else if ($tokens[($closer - 1)]['code'] === T_WHITESPACE) { + $spaceBeforeClose = $tokens[($closer - 1)]['length']; + } + + if ($spaceBeforeClose !== $requiredSpacesBeforeClose) { + $error = 'Expected %s spaces before closing parenthesis; %s found'; + $data = [ + $requiredSpacesBeforeClose, + $spaceBeforeClose, + ]; + $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceBeforeCloseBracket', $data); + if ($fix === true) { + $padding = str_repeat(' ', $requiredSpacesBeforeClose); + + if ($spaceBeforeClose === 0) { + $phpcsFile->fixer->addContentBefore($closer, $padding); + } else if ($spaceBeforeClose === 'newline') { + $phpcsFile->fixer->beginChangeset(); + + $closingContent = ')'; + + $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), null, true); + if ($tokens[$next]['code'] === T_SEMICOLON) { + $closingContent .= ';'; + for ($i = ($closer + 1); $i <= $next; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + + // We want to jump over any whitespace or inline comment and + // move the closing parenthesis after any other token. + $prev = ($closer - 1); + while (isset(Tokens::$emptyTokens[$tokens[$prev]['code']]) === true) { + if (($tokens[$prev]['code'] === T_COMMENT) + && (strpos($tokens[$prev]['content'], '*/') !== false) + ) { + break; + } + + $prev--; + } + + $phpcsFile->fixer->addContent($prev, $padding.$closingContent); + + $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($closer - 1), null, true); + for ($i = ($prevNonWhitespace + 1); $i <= $closer; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($closer - 1), $padding); + }//end if + }//end if + }//end if + + }//end processSingleLineCall() + + + /** + * Processes multi-line calls. + * + * @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 $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) + { + // We need to work out how far indented the function + // call itself is, so we can work out how far to + // indent the arguments. + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); + 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 + // the indent from there. + $prev = $phpcsFile->findPrevious(T_CONSTANT_ENCAPSED_STRING, ($first - 2), null, true); + $first = $phpcsFile->findFirstOnLine(Tokens::$emptyTokens, $prev, true); + if ($first === false) { + $first = ($prev + 1); + } + } + + $foundFunctionIndent = 0; + if ($first !== false) { + if ($tokens[$first]['code'] === T_INLINE_HTML + || ($tokens[$first]['code'] === T_CONSTANT_ENCAPSED_STRING + && $tokens[($first - 1)]['code'] === T_CONSTANT_ENCAPSED_STRING) + ) { + $trimmed = ltrim($tokens[$first]['content']); + if ($trimmed === '') { + $foundFunctionIndent = strlen($tokens[$first]['content']); + } else { + $foundFunctionIndent = (strlen($tokens[$first]['content']) - strlen($trimmed)); + } + } else { + $foundFunctionIndent = ($tokens[$first]['column'] - 1); + } + } + + // Make sure the function indent is divisible by the indent size. + // We round down here because this accounts for times when the + // surrounding code is indented a little too far in, and not correctly + // at a tab stop. Without this, the function will be indented a further + // $indent spaces to the right. + $functionIndent = (int) (floor($foundFunctionIndent / $this->indent) * $this->indent); + $adjustment = 0; + + if ($foundFunctionIndent !== $functionIndent) { + $error = 'Opening statement of multi-line function call not indented correctly; expected %s spaces but found %s'; + $data = [ + $functionIndent, + $foundFunctionIndent, + ]; + + $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); + if ($foundFunctionIndent === 0) { + $phpcsFile->fixer->addContentBefore($first, $padding); + } else if ($tokens[$first]['code'] === T_INLINE_HTML) { + $newContent = $padding.ltrim($tokens[$first]['content']); + $phpcsFile->fixer->replaceToken($first, $newContent); + } else { + $phpcsFile->fixer->replaceToken(($first - 1), $padding); + } + } + }//end if + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); + if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { + $error = 'Opening parenthesis of a multi-line function call must be the last content on the line'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpenBracket'); + if ($fix === true) { + $phpcsFile->fixer->addContent( + $openBracket, + $phpcsFile->eolChar.str_repeat(' ', ($foundFunctionIndent + $this->indent)) + ); + } + } + + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true); + if ($tokens[$prev]['line'] === $tokens[$closeBracket]['line']) { + $error = 'Closing parenthesis of a multi-line function call must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketLine'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore( + $closeBracket, + $phpcsFile->eolChar.str_repeat(' ', ($foundFunctionIndent + $this->indent)) + ); + } + } + + // Each line between the parenthesis should be indented n spaces. + $lastLine = ($tokens[$openBracket]['line'] - 1); + $argStart = null; + $argEnd = null; + + // Start processing at the first argument. + $i = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), null, true); + + if ($tokens[$i]['line'] > ($tokens[$openBracket]['line'] + 1)) { + $error = 'The first argument in a multi-line function call must be on the line after the opening parenthesis'; + $fix = $phpcsFile->addFixableError($error, $i, 'FirstArgumentPosition'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($openBracket + 1); $x < $i; $x++) { + if ($tokens[$x]['line'] === $tokens[$openBracket]['line']) { + continue; + } + + if ($tokens[$x]['line'] === $tokens[$i]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + + $i = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); + + if ($tokens[($i - 1)]['code'] === T_WHITESPACE + && $tokens[($i - 1)]['line'] === $tokens[$i]['line'] + ) { + // Make sure we check the indent. + $i--; + } + + for ($i; $i < $closeBracket; $i++) { + if ($i > $argStart && $i < $argEnd) { + $inArg = true; + } else { + $inArg = false; + } + + if ($tokens[$i]['line'] !== $lastLine) { + $lastLine = $tokens[$i]['line']; + + // Ignore heredoc indentation. + if (isset(Tokens::$heredocTokens[$tokens[$i]['code']]) === true) { + continue; + } + + // Ignore multi-line string indentation. + if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true + && $tokens[$i]['code'] === $tokens[($i - 1)]['code'] + ) { + continue; + } + + // Ignore inline HTML. + if ($tokens[$i]['code'] === T_INLINE_HTML) { + continue; + } + + if ($tokens[$i]['line'] !== $tokens[$openBracket]['line']) { + // We changed lines, so this should be a whitespace indent token, but first make + // sure it isn't a blank line because we don't need to check indent unless there + // is actually some code to indent. + if ($tokens[$i]['code'] === T_WHITESPACE) { + $nextCode = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closeBracket + 1), true); + if ($tokens[$nextCode]['line'] !== $lastLine) { + if ($inArg === false) { + $error = 'Empty lines are not allowed in multi-line function calls'; + $fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + + continue; + } + } else { + $nextCode = $i; + } + + if ($tokens[$nextCode]['line'] === $tokens[$closeBracket]['line']) { + // Closing brace needs to be indented to the same level + // as the function call. + $inArg = false; + $expectedIndent = ($foundFunctionIndent + $adjustment); + } else { + $expectedIndent = ($foundFunctionIndent + $this->indent + $adjustment); + } + + if ($tokens[$i]['code'] !== T_WHITESPACE + && $tokens[$i]['code'] !== T_DOC_COMMENT_WHITESPACE + ) { + // Just check if it is a multi-line block comment. If so, we can + // calculate the indent from the whitespace before the content. + if ($tokens[$i]['code'] === T_COMMENT + && $tokens[($i - 1)]['code'] === T_COMMENT + ) { + $trimmedLength = strlen(ltrim($tokens[$i]['content'])); + if ($trimmedLength === 0) { + // This is a blank comment line, so indenting it is + // pointless. + continue; + } + + $foundIndent = (strlen($tokens[$i]['content']) - $trimmedLength); + } else { + $foundIndent = 0; + } + } else { + $foundIndent = $tokens[$i]['length']; + } + + if ($foundIndent < $expectedIndent + || ($inArg === false + && $expectedIndent !== $foundIndent) + ) { + $error = 'Multi-line function call not indented correctly; expected %s spaces but found %s'; + $data = [ + $expectedIndent, + $foundIndent, + ]; + + $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $padding = str_repeat(' ', $expectedIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($i, $padding); + if (isset($tokens[$i]['scope_opener']) === true) { + $phpcsFile->fixer->changeCodeBlockIndent($i, $tokens[$i]['scope_closer'], $expectedIndent); + } + } else { + if ($tokens[$i]['code'] === T_COMMENT) { + $comment = $padding.ltrim($tokens[$i]['content']); + $phpcsFile->fixer->replaceToken($i, $comment); + } else { + $phpcsFile->fixer->replaceToken($i, $padding); + } + + if (isset($tokens[($i + 1)]['scope_opener']) === true) { + $phpcsFile->fixer->changeCodeBlockIndent(($i + 1), $tokens[($i + 1)]['scope_closer'], ($expectedIndent - $foundIndent)); + } + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + } else { + $nextCode = $i; + }//end if + + if ($inArg === false) { + $argStart = $nextCode; + $argEnd = $phpcsFile->findEndOfStatement($nextCode, [T_COLON]); + } + }//end if + + // If we are within an argument we should be ignoring commas + // as these are not signalling the end of an argument. + if ($inArg === false && $tokens[$i]['code'] === T_COMMA) { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $closeBracket, true); + if ($next === false) { + continue; + } + + if ($this->allowMultipleArguments === false) { + // Comma has to be the last token on the line. + if ($tokens[$i]['line'] === $tokens[$next]['line']) { + $error = 'Only one argument is allowed per line in a multi-line function call'; + $fix = $phpcsFile->addFixableError($error, $next, 'MultipleArguments'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($next - 1); $x > $i; $x--) { + if ($tokens[$x]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addContentBefore( + $next, + $phpcsFile->eolChar.str_repeat(' ', ($foundFunctionIndent + $this->indent)) + ); + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + $argStart = $next; + $argEnd = $phpcsFile->findEndOfStatement($next, [T_COLON]); + }//end if + }//end for + + }//end processMultiLineCall() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php new file mode 100644 index 00000000..1d0745b9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php @@ -0,0 +1,549 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceBsdAllmanSniff; +use PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceKernighanRitchieSniff; +use PHP_CodeSniffer\Util\Tokens; + +class FunctionDeclarationSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false + || isset($tokens[$stackPtr]['parenthesis_closer']) === false + || $tokens[$stackPtr]['parenthesis_opener'] === null + || $tokens[$stackPtr]['parenthesis_closer'] === null + ) { + return; + } + + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + + if (strtolower($tokens[$stackPtr]['content']) === 'function') { + // Must be one space after the FUNCTION keyword. + if ($tokens[($stackPtr + 1)]['content'] === $phpcsFile->eolChar) { + $spaces = 'newline'; + } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $spaces = $tokens[($stackPtr + 1)]['length']; + } else { + $spaces = 0; + } + + if ($spaces !== 1) { + $error = 'Expected 1 space after FUNCTION keyword; %s found'; + $data = [$spaces]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterFunction', $data); + if ($fix === true) { + if ($spaces === 0) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } else { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + } + }//end if + + // Must be no space before the opening parenthesis. For closures, this is + // enforced by the previous check because there is no content between the keywords + // and the opening parenthesis. + // Unfinished closures are tokenized as T_FUNCTION however, and can be excluded + // by checking for the scope_opener. + $methodProps = $phpcsFile->getMethodProperties($stackPtr); + if ($tokens[$stackPtr]['code'] === T_FUNCTION + && (isset($tokens[$stackPtr]['scope_opener']) === true || $methodProps['has_body'] === false) + ) { + if ($tokens[($openBracket - 1)]['content'] === $phpcsFile->eolChar) { + $spaces = 'newline'; + } else if ($tokens[($openBracket - 1)]['code'] === T_WHITESPACE) { + $spaces = $tokens[($openBracket - 1)]['length']; + } else { + $spaces = 0; + } + + if ($spaces !== 0) { + $error = 'Expected 0 spaces before opening parenthesis; %s found'; + $data = [$spaces]; + $fix = $phpcsFile->addFixableError($error, $openBracket, 'SpaceBeforeOpenParen', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($openBracket - 1), ''); + } + } + + // Must be no space before semicolon in abstract/interface methods. + if ($methodProps['has_body'] === false) { + $end = $phpcsFile->findNext(T_SEMICOLON, $closeBracket); + if ($end !== false) { + if ($tokens[($end - 1)]['content'] === $phpcsFile->eolChar) { + $spaces = 'newline'; + } else if ($tokens[($end - 1)]['code'] === T_WHITESPACE) { + $spaces = $tokens[($end - 1)]['length']; + } else { + $spaces = 0; + } + + if ($spaces !== 0) { + $error = 'Expected 0 spaces before semicolon; %s found'; + $data = [$spaces]; + $fix = $phpcsFile->addFixableError($error, $end, 'SpaceBeforeSemicolon', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($end - 1), ''); + } + } + } + }//end if + }//end if + + // Must be one space before and after USE keyword for closures. + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + if ($tokens[($use + 1)]['code'] !== T_WHITESPACE) { + $length = 0; + } else if ($tokens[($use + 1)]['content'] === "\t") { + $length = '\t'; + } else { + $length = $tokens[($use + 1)]['length']; + } + + if ($length !== 1) { + $error = 'Expected 1 space after USE keyword; found %s'; + $data = [$length]; + $fix = $phpcsFile->addFixableError($error, $use, 'SpaceAfterUse', $data); + if ($fix === true) { + if ($length === 0) { + $phpcsFile->fixer->addContent($use, ' '); + } else { + $phpcsFile->fixer->replaceToken(($use + 1), ' '); + } + } + } + + if ($tokens[($use - 1)]['code'] !== T_WHITESPACE) { + $length = 0; + } else if ($tokens[($use - 1)]['content'] === "\t") { + $length = '\t'; + } else { + $length = $tokens[($use - 1)]['length']; + } + + if ($length !== 1) { + $error = 'Expected 1 space before USE keyword; found %s'; + $data = [$length]; + $fix = $phpcsFile->addFixableError($error, $use, 'SpaceBeforeUse', $data); + if ($fix === true) { + if ($length === 0) { + $phpcsFile->fixer->addContentBefore($use, ' '); + } else { + $phpcsFile->fixer->replaceToken(($use - 1), ' '); + } + } + } + }//end if + }//end if + + if ($this->isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { + $this->processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens); + } else { + $this->processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens); + } + + }//end process() + + + /** + * Determine if this is a multi-line function declaration. + * + * @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 $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return bool + */ + public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) + { + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { + return true; + } + + // Closures may use the USE keyword and so be multi-line in this way. + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + // If the opening and closing parenthesis of the use statement + // are also on the same line, this is a single line declaration. + $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + $close = $tokens[$open]['parenthesis_closer']; + if ($tokens[$open]['line'] !== $tokens[$close]['line']) { + return true; + } + } + } + + return false; + + }//end isMultiLineDeclaration() + + + /** + * Processes single-line declarations. + * + * Just uses the Generic BSD-Allman brace sniff. + * + * @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 array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens) + { + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $sniff = new OpeningFunctionBraceKernighanRitchieSniff(); + } else { + $sniff = new OpeningFunctionBraceBsdAllmanSniff(); + } + + $sniff->checkClosures = true; + $sniff->process($phpcsFile, $stackPtr); + + }//end processSingleLineDeclaration() + + + /** + * Processes multi-line declarations. + * + * @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 array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens) + { + $this->processArgumentList($phpcsFile, $stackPtr, $this->indent); + + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + $closeBracket = $tokens[$open]['parenthesis_closer']; + } + } + + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + // 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'; + $code = 'NewlineBeforeOpenBrace'; + + $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 { + $fix = $phpcsFile->addFixableError($error, $opener, $code); + if ($fix === 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 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 { + // 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() + + + /** + * Processes multi-line argument list declarations. + * + * @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 $indent The number of spaces code should be indented. + * @param string $type The type of the token the brackets + * belong to. + * + * @return void + */ + public function processArgumentList($phpcsFile, $stackPtr, $indent, $type='function') + { + $tokens = $phpcsFile->getTokens(); + + // We need to work out how far indented the function + // declaration itself is, so we can work out how far to + // indent parameters. + $functionIndent = 0; + for ($i = ($stackPtr - 1); $i >= 0; $i--) { + if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) { + break; + } + } + + // Move $i back to the line the function is or to 0. + $i++; + + if ($tokens[$i]['code'] === T_WHITESPACE) { + $functionIndent = $tokens[$i]['length']; + } + + // The closing parenthesis must be on a new line, even + // when checking abstract function definitions. + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + $prev = $phpcsFile->findPrevious( + T_WHITESPACE, + ($closeBracket - 1), + null, + true + ); + + if ($tokens[$closeBracket]['line'] !== $tokens[$tokens[$closeBracket]['parenthesis_opener']]['line'] + && $tokens[$prev]['line'] === $tokens[$closeBracket]['line'] + ) { + $error = 'The closing parenthesis of a multi-line '.$type.' declaration must be on a new line'; + $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketLine'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($closeBracket); + } + } + + // If this is a closure and is using a USE statement, the closing + // parenthesis we need to look at from now on is the closing parenthesis + // of the USE statement. + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + $closeBracket = $tokens[$open]['parenthesis_closer']; + + $prev = $phpcsFile->findPrevious( + T_WHITESPACE, + ($closeBracket - 1), + null, + true + ); + + if ($tokens[$closeBracket]['line'] !== $tokens[$tokens[$closeBracket]['parenthesis_opener']]['line'] + && $tokens[$prev]['line'] === $tokens[$closeBracket]['line'] + ) { + $error = 'The closing parenthesis of a multi-line use declaration must be on a new line'; + $fix = $phpcsFile->addFixableError($error, $closeBracket, 'UseCloseBracketLine'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($closeBracket); + } + } + }//end if + }//end if + + // Each line between the parenthesis should be indented 4 spaces. + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + $lastLine = $tokens[$openBracket]['line']; + for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { + if ($tokens[$i]['line'] !== $lastLine) { + if ($i === $tokens[$stackPtr]['parenthesis_closer'] + || ($tokens[$i]['code'] === T_WHITESPACE + && (($i + 1) === $closeBracket + || ($i + 1) === $tokens[$stackPtr]['parenthesis_closer'])) + ) { + // Closing braces need to be indented to the same level + // as the function. + $expectedIndent = $functionIndent; + } else { + $expectedIndent = ($functionIndent + $indent); + } + + // We changed lines, so this should be a whitespace indent token. + $foundIndent = 0; + if ($tokens[$i]['code'] === T_WHITESPACE + && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] + ) { + $error = 'Blank lines are not allowed in a multi-line '.$type.' declaration'; + $fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + // This is an empty line, so don't check the indent. + continue; + } else if ($tokens[$i]['code'] === T_WHITESPACE) { + $foundIndent = $tokens[$i]['length']; + } else if ($tokens[$i]['code'] === T_DOC_COMMENT_WHITESPACE) { + $foundIndent = $tokens[$i]['length']; + ++$expectedIndent; + } + + if ($expectedIndent !== $foundIndent) { + $error = 'Multi-line '.$type.' declaration not indented correctly; expected %s spaces but found %s'; + $data = [ + $expectedIndent, + $foundIndent, + ]; + + $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); + if ($fix === true) { + $spaces = str_repeat(' ', $expectedIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($i, $spaces); + } else { + $phpcsFile->fixer->replaceToken($i, $spaces); + } + } + } + + $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) { + $i = $tokens[$i]['bracket_closer']; + } else { + $i = $tokens[$i]['parenthesis_closer']; + } + + $lastLine = $tokens[$i]['line']; + continue; + } + + if ($tokens[$i]['code'] === T_ATTRIBUTE) { + // Skip attributes as they have their own indentation rules. + $i = $tokens[$i]['attribute_closer']; + $lastLine = $tokens[$i]['line']; + continue; + } + }//end for + + }//end processArgumentList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php new file mode 100644 index 00000000..9952daa4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php @@ -0,0 +1,78 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ValidDefaultValueSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + T_FN, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + // Flag for when we have found a default in our arg list. + // If there is a value without a default after this, it is an error. + $defaultFound = false; + + $params = $phpcsFile->getMethodParameters($stackPtr); + foreach ($params as $param) { + if ($param['variable_length'] === true) { + continue; + } + + if (array_key_exists('default', $param) === true) { + $defaultFound = true; + // Check if the arg is type hinted and using NULL for the default. + // This does not make the argument optional - it just allows NULL + // to be passed in. + if ($param['type_hint'] !== '' && strtolower($param['default']) === 'null') { + $defaultFound = false; + } + + continue; + } + + if ($defaultFound === true) { + $error = 'Arguments with default values must be at the end of the argument list'; + $phpcsFile->addError($error, $param['token'], 'NotAtEnd'); + return; + } + }//end foreach + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php new file mode 100644 index 00000000..c2ed80ac --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php @@ -0,0 +1,98 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ValidClassNameSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being processed. + * @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(); + + $className = $phpcsFile->findNext(T_STRING, $stackPtr); + $name = trim($tokens[$className]['content']); + $errorData = [ucfirst($tokens[$stackPtr]['content'])]; + + // Make sure the first letter is a capital. + if (preg_match('|^[A-Z]|', $name) === 0) { + $error = '%s name must begin with a capital letter'; + $phpcsFile->addError($error, $stackPtr, 'StartWithCapital', $errorData); + } + + // Check that each new word starts with a capital as well, but don't + // check the first word, as it is checked above. + $validName = true; + $nameBits = explode('_', $name); + $firstBit = array_shift($nameBits); + foreach ($nameBits as $bit) { + if ($bit === '' || $bit[0] !== strtoupper($bit[0])) { + $validName = false; + break; + } + } + + if ($validName === false) { + // Strip underscores because they cause the suggested name + // to be incorrect. + $nameBits = explode('_', trim($name, '_')); + $firstBit = array_shift($nameBits); + if ($firstBit === '') { + $error = '%s name is not valid'; + $phpcsFile->addError($error, $stackPtr, 'Invalid', $errorData); + } else { + $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; + foreach ($nameBits as $bit) { + if ($bit !== '') { + $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; + } + } + + $newName = rtrim($newName, '_'); + $error = '%s name is not valid; consider %s instead'; + $data = $errorData; + $data[] = $newName; + $phpcsFile->addError($error, $stackPtr, 'Invalid', $data); + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php new file mode 100644 index 00000000..b1521aa6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php @@ -0,0 +1,284 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; +use PHP_CodeSniffer\Util\Common; +use PHP_CodeSniffer\Util\Tokens; + +class ValidFunctionNameSniff extends AbstractScopeSniff +{ + + /** + * A list of all PHP magic methods. + * + * @var array + */ + protected $magicMethods = [ + 'construct' => true, + 'destruct' => true, + 'call' => true, + 'callstatic' => true, + 'get' => true, + 'set' => true, + 'isset' => true, + 'unset' => true, + 'sleep' => true, + 'wakeup' => true, + 'serialize' => true, + 'unserialize' => true, + 'tostring' => true, + 'invoke' => true, + 'set_state' => true, + 'clone' => true, + 'debuginfo' => true, + ]; + + /** + * A list of all PHP magic functions. + * + * @var array + */ + protected $magicFunctions = ['autoload' => true]; + + + /** + * Constructs a PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff. + */ + public function __construct() + { + parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION], true); + + }//end __construct() + + + /** + * Processes the tokens within the scope. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. + * @param int $stackPtr The position where this token was + * found. + * @param int $currScope The position of the current scope. + * + * @return void + */ + protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + // Determine if this is a function which needs to be examined. + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + $deepestScope = key($conditions); + if ($deepestScope !== $currScope) { + return; + } + + $methodName = $phpcsFile->getDeclarationName($stackPtr); + if ($methodName === null) { + // Ignore closures. + return; + } + + $className = $phpcsFile->getDeclarationName($currScope); + if (isset($className) === false) { + $className = '[Anonymous Class]'; + } + + $errorData = [$className.'::'.$methodName]; + + $methodNameLc = strtolower($methodName); + $classNameLc = strtolower($className); + + // Is this a magic method. i.e., is prefixed with "__" ? + if (preg_match('|^__[^_]|', $methodName) !== 0) { + $magicPart = substr($methodNameLc, 2); + if (isset($this->magicMethods[$magicPart]) === true) { + return; + } + + $error = 'Method name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; + $phpcsFile->addError($error, $stackPtr, 'MethodDoubleUnderscore', $errorData); + } + + // PHP4 constructors are allowed to break our rules. + if ($methodNameLc === $classNameLc) { + return; + } + + // PHP4 destructors are allowed to break our rules. + if ($methodNameLc === '_'.$classNameLc) { + return; + } + + $methodProps = $phpcsFile->getMethodProperties($stackPtr); + $scope = $methodProps['scope']; + $scopeSpecified = $methodProps['scope_specified']; + + if ($methodProps['scope'] === 'private') { + $isPublic = false; + } else { + $isPublic = true; + } + + // If it's a private method, it must have an underscore on the front. + if ($isPublic === false) { + if ($methodName[0] !== '_') { + $error = 'Private method name "%s" must be prefixed with an underscore'; + $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $errorData); + $phpcsFile->recordMetric($stackPtr, 'Private method prefixed with underscore', 'no'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Private method prefixed with underscore', 'yes'); + } + } + + // If it's not a private method, it must not have an underscore on the front. + if ($isPublic === true && $scopeSpecified === true && $methodName[0] === '_') { + $error = '%s method name "%s" must not be prefixed with an underscore'; + $data = [ + ucfirst($scope), + $errorData[0], + ]; + $phpcsFile->addError($error, $stackPtr, 'PublicUnderscore', $data); + } + + $testMethodName = ltrim($methodName, '_'); + + if (Common::isCamelCaps($testMethodName, false, true, false) === false) { + if ($scopeSpecified === true) { + $error = '%s method name "%s" is not in camel caps format'; + $data = [ + ucfirst($scope), + $errorData[0], + ]; + $phpcsFile->addError($error, $stackPtr, 'ScopeNotCamelCaps', $data); + } else { + $error = 'Method name "%s" is not in camel caps format'; + $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); + } + } + + }//end processTokenWithinScope() + + + /** + * Processes the tokens outside the scope. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. + * @param int $stackPtr The position where this token was + * found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + $functionName = $phpcsFile->getDeclarationName($stackPtr); + if ($functionName === null) { + // Ignore closures. + return; + } + + if (ltrim($functionName, '_') === '') { + // Ignore special functions. + return; + } + + $errorData = [$functionName]; + + // Is this a magic function. i.e., it is prefixed with "__". + if (preg_match('|^__[^_]|', $functionName) !== 0) { + $magicPart = strtolower(substr($functionName, 2)); + if (isset($this->magicFunctions[$magicPart]) === true) { + return; + } + + $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; + $phpcsFile->addError($error, $stackPtr, 'FunctionDoubleUnderscore', $errorData); + } + + // Function names can be in two parts; the package name and + // the function name. + $packagePart = ''; + $underscorePos = strrpos($functionName, '_'); + if ($underscorePos === false) { + $camelCapsPart = $functionName; + } else { + $packagePart = substr($functionName, 0, $underscorePos); + $camelCapsPart = substr($functionName, ($underscorePos + 1)); + + // We don't care about _'s on the front. + $packagePart = ltrim($packagePart, '_'); + } + + // If it has a package part, make sure the first letter is a capital. + if ($packagePart !== '') { + if ($functionName[0] === '_') { + $error = 'Function name "%s" is invalid; only private methods should be prefixed with an underscore'; + $phpcsFile->addError($error, $stackPtr, 'FunctionUnderscore', $errorData); + } + + if ($functionName[0] !== strtoupper($functionName[0])) { + $error = 'Function name "%s" is prefixed with a package name but does not begin with a capital letter'; + $phpcsFile->addError($error, $stackPtr, 'FunctionNoCapital', $errorData); + } + } + + // If it doesn't have a camel caps part, it's not valid. + if (trim($camelCapsPart) === '') { + $error = 'Function name "%s" is not valid; name appears incomplete'; + $phpcsFile->addError($error, $stackPtr, 'FunctionInvalid', $errorData); + return; + } + + $validName = true; + $newPackagePart = $packagePart; + $newCamelCapsPart = $camelCapsPart; + + // Every function must have a camel caps part, so check that first. + if (Common::isCamelCaps($camelCapsPart, false, true, false) === false) { + $validName = false; + $newCamelCapsPart = strtolower($camelCapsPart[0]).substr($camelCapsPart, 1); + } + + if ($packagePart !== '') { + // Check that each new word starts with a capital. + $nameBits = explode('_', $packagePart); + $nameBits = array_filter($nameBits); + foreach ($nameBits as $bit) { + if ($bit[0] !== strtoupper($bit[0])) { + $newPackagePart = ''; + foreach ($nameBits as $bit) { + $newPackagePart .= strtoupper($bit[0]).substr($bit, 1).'_'; + } + + $validName = false; + break; + } + } + } + + if ($validName === false) { + if ($newPackagePart === '') { + $newName = $newCamelCapsPart; + } else { + $newName = rtrim($newPackagePart, '_').'_'.$newCamelCapsPart; + } + + $error = 'Function name "%s" is invalid; consider "%s" instead'; + $data = $errorData; + $data[] = $newName; + $phpcsFile->addError($error, $stackPtr, 'FunctionNameInvalid', $data); + } + + }//end processTokenOutsideScope() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php new file mode 100644 index 00000000..48674b1e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php @@ -0,0 +1,103 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; + +class ValidVariableNameSniff extends AbstractVariableSniff +{ + + + /** + * Processes class member variables. + * + * @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 + */ + protected function processMemberVar(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $memberProps = $phpcsFile->getMemberProperties($stackPtr); + if (empty($memberProps) === true) { + return; + } + + $memberName = ltrim($tokens[$stackPtr]['content'], '$'); + $scope = $memberProps['scope']; + $scopeSpecified = $memberProps['scope_specified']; + + if ($memberProps['scope'] === 'private') { + $isPublic = false; + } else { + $isPublic = true; + } + + // If it's a private member, it must have an underscore on the front. + if ($isPublic === false && $memberName[0] !== '_') { + $error = 'Private member variable "%s" must be prefixed with an underscore'; + $data = [$memberName]; + $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $data); + return; + } + + // If it's not a private member, it must not have an underscore on the front. + if ($isPublic === true && $scopeSpecified === true && $memberName[0] === '_') { + $error = '%s member variable "%s" must not be prefixed with an underscore'; + $data = [ + ucfirst($scope), + $memberName, + ]; + $phpcsFile->addError($error, $stackPtr, 'PublicUnderscore', $data); + return; + } + + }//end processMemberVar() + + + /** + * Processes normal variables. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processVariable(File $phpcsFile, $stackPtr) + { + /* + We don't care about normal variables. + */ + + }//end processVariable() + + + /** + * Processes variables in double quoted strings. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processVariableInString(File $phpcsFile, $stackPtr) + { + /* + We don't care about normal variables. + */ + + }//end processVariableInString() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php new file mode 100644 index 00000000..9c64c328 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php @@ -0,0 +1,204 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ObjectOperatorIndentSniff implements Sniff +{ + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + /** + * Indicates whether multilevel indenting is allowed. + * + * @var boolean + */ + public $multilevel = false; + + /** + * Tokens to listen for. + * + * @var array + */ + private $targets = [ + T_OBJECT_OPERATOR, + T_NULLSAFE_OBJECT_OPERATOR, + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return $this->targets; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. + * @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(); + + // Make sure this is the first object operator in a chain of them. + $start = $phpcsFile->findStartOfStatement($stackPtr); + $prev = $phpcsFile->findPrevious($this->targets, ($stackPtr - 1), $start); + if ($prev !== false) { + return; + } + + // Make sure this is a chained call. + $end = $phpcsFile->findEndOfStatement($stackPtr); + $next = $phpcsFile->findNext($this->targets, ($stackPtr + 1), $end); + if ($next === false) { + // Not a chained call. + return; + } + + // Determine correct indent. + for ($i = ($start - 1); $i >= 0; $i--) { + if ($tokens[$i]['line'] !== $tokens[$start]['line']) { + $i++; + break; + } + } + + $baseIndent = 0; + if ($i >= 0 && $tokens[$i]['code'] === T_WHITESPACE) { + $baseIndent = $tokens[$i]['length']; + } + + $baseIndent += $this->indent; + + // Determine the scope of the original object operator. + $origBrackets = null; + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $origBrackets = $tokens[$stackPtr]['nested_parenthesis']; + } + + $origConditions = null; + if (isset($tokens[$stackPtr]['conditions']) === true) { + $origConditions = $tokens[$stackPtr]['conditions']; + } + + // Check indentation of each object operator in the chain. + // If the first object operator is on a different line than + // the variable, make sure we check its indentation too. + if ($tokens[$stackPtr]['line'] > $tokens[$start]['line']) { + $next = $stackPtr; + } + + $previousIndent = $baseIndent; + + while ($next !== false) { + // Make sure it is in the same scope, otherwise don't check indent. + $brackets = null; + if (isset($tokens[$next]['nested_parenthesis']) === true) { + $brackets = $tokens[$next]['nested_parenthesis']; + } + + $conditions = null; + if (isset($tokens[$next]['conditions']) === true) { + $conditions = $tokens[$next]['conditions']; + } + + if ($origBrackets === $brackets && $origConditions === $conditions) { + // Make sure it starts a line, otherwise don't check indent. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($next - 1), $stackPtr, true); + $indent = $tokens[($next - 1)]; + if ($tokens[$prev]['line'] !== $tokens[$next]['line'] + && $indent['code'] === T_WHITESPACE + ) { + if ($indent['line'] === $tokens[$next]['line']) { + $foundIndent = strlen($indent['content']); + } else { + $foundIndent = 0; + } + + $minIndent = $previousIndent; + $maxIndent = $previousIndent; + $expectedIndent = $previousIndent; + + if ($this->multilevel === true) { + $minIndent = max(($previousIndent - $this->indent), $baseIndent); + $maxIndent = ($previousIndent + $this->indent); + $expectedIndent = min(max($foundIndent, $minIndent), $maxIndent); + } + + if ($foundIndent < $minIndent || $foundIndent > $maxIndent) { + $error = 'Object operator not indented correctly; expected %s spaces but found %s'; + $data = [ + $expectedIndent, + $foundIndent, + ]; + + $fix = $phpcsFile->addFixableError($error, $next, 'Incorrect', $data); + if ($fix === true) { + $spaces = str_repeat(' ', $expectedIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($next, $spaces); + } else { + $phpcsFile->fixer->replaceToken(($next - 1), $spaces); + } + } + } + + $previousIndent = $expectedIndent; + }//end if + + // It cant be the last thing on the line either. + $content = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); + if ($tokens[$content]['line'] !== $tokens[$next]['line']) { + $error = 'Object operator must be at the start of the line, not the end'; + $fix = $phpcsFile->addFixableError($error, $next, 'StartOfLine'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($next + 1); $x < $content; $x++) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addNewlineBefore($next); + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + $next = $phpcsFile->findNext( + $this->targets, + ($next + 1), + null, + false, + null, + true + ); + }//end while + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php new file mode 100644 index 00000000..cb8e46d5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php @@ -0,0 +1,182 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ScopeClosingBraceSniff implements Sniff +{ + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$scopeOpeners; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. + * @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(); + + // If this is an inline condition (ie. there is no scope opener), then + // return, as this is not a new scope. + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $scopeStart = $tokens[$stackPtr]['scope_opener']; + $scopeEnd = $tokens[$stackPtr]['scope_closer']; + + // If the scope closer doesn't think it belongs to this scope opener + // then the opener is sharing its closer with other tokens. We only + // want to process the closer once, so skip this one. + if (isset($tokens[$scopeEnd]['scope_condition']) === false + || $tokens[$scopeEnd]['scope_condition'] !== $stackPtr + ) { + return; + } + + // We need to actually find the first piece of content on this line, + // because if this is a method with tokens before it (public, static etc) + // or an if with an else before it, then we need to start the scope + // checking from there, rather than the current token. + $lineStart = ($stackPtr - 1); + for ($lineStart; $lineStart > 0; $lineStart--) { + if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false) { + break; + } + } + + $lineStart++; + + $startColumn = 1; + if ($tokens[$lineStart]['code'] === T_WHITESPACE) { + $startColumn = $tokens[($lineStart + 1)]['column']; + } else if ($tokens[$lineStart]['code'] === T_INLINE_HTML) { + $trimmed = ltrim($tokens[$lineStart]['content']); + if ($trimmed === '') { + $startColumn = $tokens[($lineStart + 1)]['column']; + } else { + $startColumn = (strlen($tokens[$lineStart]['content']) - strlen($trimmed)); + } + } + + // Check that the closing brace is on it's own line. + for ($lastContent = ($scopeEnd - 1); $lastContent > $scopeStart; $lastContent--) { + if ($tokens[$lastContent]['code'] === T_WHITESPACE || $tokens[$lastContent]['code'] === T_OPEN_TAG) { + continue; + } + + if ($tokens[$lastContent]['code'] === T_INLINE_HTML + && ltrim($tokens[$lastContent]['content']) === '' + ) { + continue; + } + + break; + } + + if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line']) { + $error = 'Closing brace must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Line'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($scopeEnd); + } + + return; + } + + // Check now that the closing brace is lined up correctly. + $lineStart = ($scopeEnd - 1); + for ($lineStart; $lineStart > 0; $lineStart--) { + if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false) { + break; + } + } + + $lineStart++; + + $braceIndent = 0; + if ($tokens[$lineStart]['code'] === T_WHITESPACE) { + $braceIndent = ($tokens[($lineStart + 1)]['column'] - 1); + } else if ($tokens[$lineStart]['code'] === T_INLINE_HTML) { + $trimmed = ltrim($tokens[$lineStart]['content']); + if ($trimmed === '') { + $braceIndent = ($tokens[($lineStart + 1)]['column'] - 1); + } else { + $braceIndent = (strlen($tokens[$lineStart]['content']) - strlen($trimmed) - 1); + } + } + + $fix = false; + if ($tokens[$stackPtr]['code'] === T_CASE + || $tokens[$stackPtr]['code'] === T_DEFAULT + ) { + // BREAK statements should be indented n spaces from the + // CASE or DEFAULT statement. + $expectedIndent = ($startColumn + $this->indent - 1); + if ($braceIndent !== $expectedIndent) { + $error = 'Case breaking statement indented incorrectly; expected %s spaces, found %s'; + $data = [ + $expectedIndent, + $braceIndent, + ]; + $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'BreakIndent', $data); + } + } else { + $expectedIndent = max(0, ($startColumn - 1)); + if ($braceIndent !== $expectedIndent) { + $error = 'Closing brace indented incorrectly; expected %s spaces, found %s'; + $data = [ + $expectedIndent, + $braceIndent, + ]; + $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data); + } + }//end if + + if ($fix === true) { + $spaces = str_repeat(' ', $expectedIndent); + if ($braceIndent === 0) { + $phpcsFile->fixer->addContentBefore($lineStart, $spaces); + } else { + $phpcsFile->fixer->replaceToken($lineStart, ltrim($tokens[$lineStart]['content'])); + $phpcsFile->fixer->addContentBefore($lineStart, $spaces); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php new file mode 100644 index 00000000..e95dc8bd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php @@ -0,0 +1,24 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff as GenericScopeIndentSniff; + +class ScopeIndentSniff extends GenericScopeIndentSniff +{ + + /** + * Any scope openers that should not cause an indent. + * + * @var int[] + */ + protected $nonIndentingScopes = [T_SWITCH]; + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc new file mode 100644 index 00000000..6942944b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc @@ -0,0 +1,114 @@ +setLogger(new class {}); + +var_dump(new class(10) extends SomeClass implements SomeInterface { + private $num; + + public function __construct($num) + { + $this->num = $num; + } + + use SomeTrait; +}); + +class IncorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ { +} + +class CorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration +/* Comment */ +{ +} + +// Don't move phpcs:ignore comments. +class PHPCSIgnoreAnnotationAfterOpeningBrace +{ // phpcs:ignore Standard.Cat.Sniff -- for reasons. +} + +// Moving any of the other trailing phpcs: comments is ok. +class PHPCSAnnotationAfterOpeningBrace +{ // phpcs:disable Standard.Cat.Sniff -- for reasons. +} + +if (!class_exists('ClassOpeningBraceShouldBeIndented')) { + abstract class ClassOpeningBraceShouldBeIndented +{ +} +} + +if (!class_exists('ClassOpeningBraceTooMuchIndentation')) { + final class ClassOpeningBraceTooMuchIndentation + { + } +} + +enum IncorrectBracePlacement {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed new file mode 100644 index 00000000..26688b15 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed @@ -0,0 +1,125 @@ +setLogger(new class {}); + +var_dump(new class(10) extends SomeClass implements SomeInterface { + private $num; + + public function __construct($num) + { + $this->num = $num; + } + + use SomeTrait; +}); + +class IncorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ +{ +} + +class CorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration +/* Comment */ +{ +} + +// Don't move phpcs:ignore comments. +class PHPCSIgnoreAnnotationAfterOpeningBrace +{ // phpcs:ignore Standard.Cat.Sniff -- for reasons. +} + +// Moving any of the other trailing phpcs: comments is ok. +class PHPCSAnnotationAfterOpeningBrace +{ + // phpcs:disable Standard.Cat.Sniff -- for reasons. +} + +if (!class_exists('ClassOpeningBraceShouldBeIndented')) { + abstract class ClassOpeningBraceShouldBeIndented + { +} +} + +if (!class_exists('ClassOpeningBraceTooMuchIndentation')) { + final class ClassOpeningBraceTooMuchIndentation + { + } +} + +enum IncorrectBracePlacement +{ +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc new file mode 100644 index 00000000..ac71fc9f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc @@ -0,0 +1,11 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff + */ +final class ClassDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Get a list of CLI values to set before the file is tested. + * + * @param string $testFile The name of the file being tested. + * @param \PHP_CodeSniffer\Config $config The config data for the test run. + * + * @return void + */ + public function setCliValues($testFile, $config) + { + if ($testFile === 'ClassDeclarationUnitTest.1.inc') { + return; + } + + $config->tabWidth = 4; + + }//end setCliValues() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ClassDeclarationUnitTest.1.inc': + return [ + 21 => 1, + 22 => 1, + 23 => 1, + 27 => 1, + 33 => 1, + 38 => 1, + 49 => 1, + 84 => 1, + 94 => 1, + 99 => 1, + 104 => 1, + 110 => 1, + 114 => 1, + ]; + + default: + return []; + }//end switch + + }//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($testFile='') + { + if ($testFile === 'ClassDeclarationUnitTest.2.inc') { + return [11 => 1]; + } + + return[]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc new file mode 100644 index 00000000..bd7d0618 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc @@ -0,0 +1,163 @@ + + * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 + */ +class Extra_Description_Newlines +{ + +}//end class + + +/** + * Sample class comment + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @version + * @link http://pear.php.net/package/PHP_CodeSniffer + */ +class Missing_Newlines_Before_Tags +{ + +}//end class + + +/** + * Simple class comment + * + * @category _wrong_category + * @package PHP_CodeSniffer + * @package ADDITIONAL PACKAGE TAG + * @subpackage SUBPACKAGE TAG + * @author Original Author + * @author Greg Sherwood gsherwood@squiz.net + * @author Mr T + * @author + * @copyright 1997~1994 The PHP Group + * @license http://www.php.net/license/3_0.txt + * @version INVALID VERSION CONTENT + * @see + * @see + * @link sdfsdf + * @see Net_Sample::Net_Sample() + * @see Net_Other + * @deprecated asd + * @unknown Unknown tag + * @since Class available since Release 1.2.0 + */ +class Checking_Tags +{ + class Sub_Class { + + }//end class + + +}//end class + + +/** + * + * + */ +class Empty_Class_Doc +{ + +}//end class + + +/** + * + * + */ +interface Empty_Interface_Doc +{ + +}//end interface + + +/** + * + * + */ +trait Empty_Trait_Doc +{ + +}//end trait + + +/** + * + * + */ +enum Empty_Enum_Doc +{ + +}//end enum + + +/** + * Sample class comment + * + * @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 + */ +#[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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php new file mode 100644 index 00000000..d60c0fe8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php @@ -0,0 +1,78 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\ClassCommentSniff + */ +final class ClassCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 1, + 15 => 1, + 51 => 1, + 63 => 1, + 65 => 2, + 66 => 1, + 68 => 1, + 70 => 1, + 71 => 1, + 72 => 1, + 74 => 2, + 75 => 1, + 76 => 1, + 77 => 1, + 85 => 1, + 96 => 5, + 106 => 5, + 116 => 5, + 126 => 5, + 161 => 1, + 163 => 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. + * + * @return array + */ + public function getWarningList() + { + return [ + 71 => 1, + 73 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc new file mode 100644 index 00000000..0b18fa38 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc @@ -0,0 +1,53 @@ + +* @author Greg Sherwood gsherwood@squiz.net +* @author Mr T +* @author +* @copyright 1997~1994 The PHP Group +* @copyright 1997~1994 The PHP Group +* @license http://www.php.net/license/3_0.txt +* @see +* @see +* @version INVALID VERSION CONTENT +* @see Net_Sample::Net_Sample() +* @see Net_Other +* @deprecated asd +* @since Class available since Release 1.2.0 +* @summary An unknown summary tag +* @package '' +* @subpackage !! +* @author Code AUthor +*/ +require_once '/some/path.php'; +?> + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc new file mode 100644 index 00000000..8845eb19 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc @@ -0,0 +1,9 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FileComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FileCommentSniff + */ +final class FileCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'FileCommentUnitTest.1.inc': + return [ + 21 => 1, + 23 => 2, + 24 => 1, + 26 => 1, + 28 => 1, + 29 => 1, + 30 => 1, + 31 => 1, + 32 => 2, + 33 => 1, + 34 => 1, + 35 => 1, + 40 => 2, + 41 => 2, + 43 => 1, + ]; + + case 'FileCommentUnitTest.2.inc': + case 'FileCommentUnitTest.3.inc': + case 'FileCommentUnitTest.4.inc': + return [1 => 1]; + + default: + return []; + }//end switch + + }//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($testFile='') + { + switch ($testFile) { + case 'FileCommentUnitTest.1.inc': + return [ + 29 => 1, + 30 => 1, + 34 => 1, + 43 => 1, + ]; + + default: + return []; + }//end switch + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc new file mode 100644 index 00000000..a20ba3a7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc @@ -0,0 +1,512 @@ + line numbers for each token. + * + * @param array $tokens The array of tokens to process. + * @param object $tokenizer The tokenizer being used to process this file. + * @param string $eolChar The EOL character to use for splitting strings. + * + * @return void + */ +function foo(&$tokens, $tokenizer, $eolChar) +{ + +}//end foo() + +/** + * Gettext. + * + */ +function _() { + return $foo; +} + +class Baz { + /** + * The PHP5 constructor + * + * No return tag + */ + public function __construct() { + + } +} + +/** + * Complete a step. + * + * @param string $status Status of step to complete. + * @param array $array Array. + * @param string $note Optional note. + * + * @return void + */ +function completeStep($status, array $array = [Class1::class, 'test'], $note = '') { + echo 'foo'; +} + +/** + * Variadic function. + * + * @param string $name1 Comment. + * @param string ...$name2 Comment. + * + * @return void + */ +function myFunction(string $name1, string ...$name2) { +} + + +/** + * Variadic function. + * + * @param string $name1 Comment. + * @param string $name2 Comment. + * + * @return void + */ +function myFunction(string $name1, string ...$name2) { +} + +/** + * Completely invalid format, but should not cause PHP notices. + * + * @param $bar + * Comment here. + * @param ... + * Additional arguments here. + * + * @return + * Return value + * + */ +function foo($bar) { +} + +/** + * Processes the test. + * + * @param PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token occurred. + * @param int $stackPtr The position in the tokens stack + * where the listening token type + * was found. + * + * @return void + * @see register() + */ +function process(File $phpcsFile, $stackPtr) +{ + +}//end process() + +/** + * Processes the test. + * + * @param int $phpcsFile The PHP_CodeSniffer + * file where the + * token occurred. + * @param int $stackPtr The position in the tokens stack + * where the listening token type + * was found. + * + * @return void + * @see register() + */ +function process(File $phpcsFile, $stackPtr) +{ + +}//end process() + +/** + * @param (Foo&Bar)|null $a Comment. + * @param string $b Comment. + * + * @return void + */ +public function setTranslator($a, &$b): void +{ + $this->translator = $translator; +} + +// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility protected +private function setTranslator2($a, &$b): void +{ + $this->translator = $translator; +} + +// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility public +protected function setTranslator3($a, &$b): void +{ + $this->translator = $translator; +} + +private function setTranslator4($a, &$b): void +{ + $this->translator = $translator; +} + +class Bar { + /** + * The PHP5 constructor + * + * @return + */ + public function __construct() { + + } +} + +// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] +class Bar { + /** + * The PHP5 constructor + */ + public function __construct() { + + } +} + +// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] ignored +/** + * Should be ok + */ +public function ignored() { + +} + +// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] __construct,__destruct + +class Something implements JsonSerializable { + /** + * Single attribute. + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function jsonSerialize() {} + + /** + * Multiple attributes. + * + * @return Something + */ + #[AttributeA] + #[AttributeB] + public function methodName() {} + + /** + * Blank line between docblock and attribute. + * + * @return mixed + */ + + #[ReturnTypeWillChange] + public function blankLineDetectionA() {} + + /** + * Blank line between attribute and function declaration. + * + * @return mixed + */ + #[ReturnTypeWillChange] + + public function blankLineDetectionB() {} + + /** + * Blank line between both docblock and attribute and attribute and function declaration. + * + * @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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed new file mode 100644 index 00000000..fc6d4f7e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed @@ -0,0 +1,491 @@ + line numbers for each token. + * + * @param array $tokens The array of tokens to process. + * @param object $tokenizer The tokenizer being used to process this file. + * @param string $eolChar The EOL character to use for splitting strings. + * + * @return void + */ +function foo(&$tokens, $tokenizer, $eolChar) +{ + +}//end foo() + +/** + * Gettext. + * + */ +function _() { + return $foo; +} + +class Baz { + /** + * The PHP5 constructor + * + * No return tag + */ + public function __construct() { + + } +} + +/** + * Complete a step. + * + * @param string $status Status of step to complete. + * @param array $array Array. + * @param string $note Optional note. + * + * @return void + */ +function completeStep($status, array $array = [Class1::class, 'test'], $note = '') { + echo 'foo'; +} + +/** + * Variadic function. + * + * @param string $name1 Comment. + * @param string ...$name2 Comment. + * + * @return void + */ +function myFunction(string $name1, string ...$name2) { +} + + +/** + * Variadic function. + * + * @param string $name1 Comment. + * @param string $name2 Comment. + * + * @return void + */ +function myFunction(string $name1, string ...$name2) { +} + +/** + * Completely invalid format, but should not cause PHP notices. + * + * @param $bar + * Comment here. + * @param ... + * Additional arguments here. + * + * @return + * Return value + * + */ +function foo($bar) { +} + +/** + * Processes the test. + * + * @param PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the + * token occurred. + * @param int $stackPtr The position in the tokens stack + * where the listening token type + * was found. + * + * @return void + * @see register() + */ +function process(File $phpcsFile, $stackPtr) +{ + +}//end process() + +/** + * Processes the test. + * + * @param int $phpcsFile The PHP_CodeSniffer + * file where the + * token occurred. + * @param int $stackPtr The position in the tokens stack + * where the listening token type + * was found. + * + * @return void + * @see register() + */ +function process(File $phpcsFile, $stackPtr) +{ + +}//end process() + +/** + * @param (Foo&Bar)|null $a Comment. + * @param string $b Comment. + * + * @return void + */ +public function setTranslator($a, &$b): void +{ + $this->translator = $translator; +} + +// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility protected +private function setTranslator2($a, &$b): void +{ + $this->translator = $translator; +} + +// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility public +protected function setTranslator3($a, &$b): void +{ + $this->translator = $translator; +} + +private function setTranslator4($a, &$b): void +{ + $this->translator = $translator; +} + +class Bar { + /** + * The PHP5 constructor + * + * @return + */ + public function __construct() { + + } +} + +// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] +class Bar { + /** + * The PHP5 constructor + */ + public function __construct() { + + } +} + +// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] ignored +/** + * Should be ok + */ +public function ignored() { + +} + +// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] __construct,__destruct + +class Something implements JsonSerializable { + /** + * Single attribute. + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function jsonSerialize() {} + + /** + * Multiple attributes. + * + * @return Something + */ + #[AttributeA] + #[AttributeB] + public function methodName() {} + + /** + * Blank line between docblock and attribute. + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function blankLineDetectionA() {} + + /** + * Blank line between attribute and function declaration. + * + * @return mixed + */ + #[ReturnTypeWillChange] + public function blankLineDetectionB() {} + + /** + * Blank line between both docblock and attribute and attribute and function declaration. + * + * @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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php new file mode 100644 index 00000000..62863be6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php @@ -0,0 +1,103 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff + */ +final class FunctionCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 5 => 1, + 10 => 1, + 12 => 1, + 13 => 1, + 14 => 1, + 15 => 1, + 28 => 1, + 76 => 1, + 87 => 1, + 103 => 1, + 109 => 1, + 112 => 1, + 122 => 1, + 123 => 2, + 124 => 2, + 125 => 1, + 126 => 1, + 137 => 1, + 138 => 1, + 139 => 1, + 152 => 1, + 155 => 1, + 165 => 1, + 172 => 1, + 183 => 1, + 190 => 2, + 206 => 1, + 234 => 1, + 272 => 1, + 313 => 1, + 317 => 1, + 327 => 1, + 329 => 1, + 332 => 1, + 344 => 1, + 343 => 1, + 345 => 1, + 346 => 1, + 360 => 1, + 361 => 1, + 363 => 1, + 364 => 1, + 406 => 1, + 417 => 1, + 455 => 1, + 464 => 1, + 473 => 1, + 485 => 1, + 501 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc new file mode 100644 index 00000000..187228c2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc @@ -0,0 +1,29 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the InlineComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\InlineCommentSniff + */ +final class InlineCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 15 => 1, + 24 => 1, + 25 => 1, + 27 => 1, + 28 => 1, + 29 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc new file mode 100644 index 00000000..cc9903aa --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc @@ -0,0 +1,165 @@ + 0); + +do +{ + echo $i; +} while ($i > 0); + +do +{ + echo $i; +} +while ($i > 0); + +do { echo $i; } while ($i > 0); + +do{ + echo $i; +}while($i > 0); + + +// while +while ($i < 1) { + echo $i; +} + +while($i < 1){ + echo $i; +} + +while ($i < 1) { echo $i; } + + +// for +for ($i = 1; $i < 1; $i++) { + echo $i; +} + +for($i = 1; $i < 1; $i++){ + echo $i; +} + +for ($i = 1; $i < 1; $i++) { echo $i; } + + +// foreach +foreach ($items as $item) { + echo $item; +} + +foreach($items as $item){ + echo $item; +} + +foreach ($items as $item) { echo $item; } + + +// if +if ($i == 0) { + $i = 1; +} + +if($i == 0){ + $i = 1; +} + +if ($i == 0) { $i = 1; } + + +// else +if ($i == 0) { + $i = 1; +} else { + $i = 0; +} + +if ($i == 0) { + $i = 1; +}else{ + $i = 0; +} + +if ($i == 0) { $i = 1; } else { $i = 0; } + + +// else +if ($i == 0) { + $i = 1; +} else { + $i = 0; +} + +if ($i == 0) { + $i = 1; +}else{ + $i = 0; +} + +if ($i == 0) { $i = 1; } else { $i = 0; } + + +// else if +if ($i == 0) { + $i = 1; +} else if ($i == 2) { + $i = 0; +} + +if ($i == 0) { + $i = 1; +} elseif ($i == 2) { + $i = 0; +} + +if ($i == 0) { + $i = 1; +}else if($i == 2){ + $i = 0; +} + +if ($i == 0) { + $i = 1; +}elseif($i == 2){ + $i = 0; +} + +if ($i == 0) { $i = 1; } else if ($i == 2) { $i = 0; } +if ($i == 0) { $i = 1; } elseif ($i == 2) { $i = 0; } + +if ($i == 0) { // this is ok because comments are allowed + $i = 1; +} + +if ($i == 0) {// this is ok because comments are allowed + $i = 1; +} + +if ($i == 0) { /* this is ok because comments are allowed*/ + $i = 1; +} + +if ($i == 0) +{ // this is not ok + $i = 1; +} + +if ($i == 0) /* this is ok */ { +} + +if ($i == 0) { +} +else { +} + +// match +$r = match ($x) { + 1 => 1, +}; + +$r = match( $x ){ 1 => 1 }; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php new file mode 100644 index 00000000..b387a93e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php @@ -0,0 +1,77 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ControlSignature sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\ControlSignatureSniff + */ +final class ControlSignatureUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 9 => 1, + 14 => 1, + 20 => 1, + 22 => 1, + 32 => 1, + 36 => 1, + 44 => 1, + 48 => 1, + 56 => 1, + 60 => 1, + 68 => 1, + 72 => 1, + 84 => 1, + 88 => 2, + 100 => 1, + 104 => 2, + 122 => 2, + 128 => 1, + 132 => 3, + 133 => 2, + 147 => 1, + 157 => 1, + 165 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc new file mode 100644 index 00000000..a7a3c69d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc @@ -0,0 +1,251 @@ + +

    some text

    +errorCode() == 401 || // comment + $IPP->errorCode() == 3200) /* long comment + here + */ +{ + return false; +} + +if ($IPP->errorCode() == 401 || // comment + $IPP->errorCode() == 3200) // long comment here +{ + return false; +} + +if ($IPP->errorCode() == 401 + // Comment explaining the next condition here. + || $IPP->errorCode() == 3200 +) { + return false; +} + +function bar() { + if ($a + && $b +) { + return false; + } +} + +if ($a + && foo( + 'a', + 'b' + )) { + return false; +} + +?> + + + + + +errorCode() == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. + $IPP->errorCode() == 3200) /* + phpcs:ignore Standard.Category.Sniff -- for reasons. + */ +{ + return false; +} + +if ($IPP->errorCode() == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. + $IPP->errorCode() == 3200) // phpcs:enable +{ + return false; +} + +if ($IPP->errorCode() == 401 + // phpcs:ignore Standard.Category.Sniff -- for reasons. + || $IPP->errorCode() == 3200 +) { + return false; +} + + if ($IPP->errorCode() == 401 || + /* + * phpcs:disable Standard.Category.Sniff -- for reasons. + */ + $IPP->errorCode() == 3200 + ) { + return false; + } + +if ($IPP->errorCode() == 401 + || $IPP->errorCode() == 3200 + // phpcs:ignore Standard.Category.Sniff -- for reasons. +) { + return false; +} + +if ($IPP->errorCode() == 401 + || $IPP->errorCode() + === 'someverylongexpectedoutput' +) { + return false; +} + +if ($IPP->errorCode() == 401 + || $IPP->errorCode() + // A comment. + === 'someverylongexpectedoutput' +) { + return false; +} + +if ($IPP->errorCode() == 401 + || $IPP->errorCode() + // phpcs:ignore Standard.Category.Sniff -- for reasons. + === 'someverylongexpectedoutput' +) { + return false; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed new file mode 100644 index 00000000..7d56c461 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed @@ -0,0 +1,247 @@ + +

    some text

    +errorCode() == 401 // comment + || $IPP->errorCode() == 3200 /* long comment + here + */ +) { + return false; +} + +if ($IPP->errorCode() == 401 // comment + || $IPP->errorCode() == 3200 // long comment here +) { + return false; +} + +if ($IPP->errorCode() == 401 + // Comment explaining the next condition here. + || $IPP->errorCode() == 3200 +) { + return false; +} + +function bar() { + if ($a + && $b + ) { + return false; + } +} + +if ($a + && foo( + 'a', + 'b' + ) +) { + return false; +} + +?> + + + + + +errorCode() == 401 // phpcs:ignore Standard.Category.Sniff -- for reasons. + || $IPP->errorCode() == 3200 /* + phpcs:ignore Standard.Category.Sniff -- for reasons. + */ +) { + return false; +} + +if ($IPP->errorCode() == 401 // phpcs:disable Standard.Category.Sniff -- for reasons. + || $IPP->errorCode() == 3200 // phpcs:enable +) { + return false; +} + +if ($IPP->errorCode() == 401 + // phpcs:ignore Standard.Category.Sniff -- for reasons. + || $IPP->errorCode() == 3200 +) { + return false; +} + + if ($IPP->errorCode() == 401 + /* + * phpcs:disable Standard.Category.Sniff -- for reasons. + */ + || $IPP->errorCode() == 3200 + ) { + return false; + } + +if ($IPP->errorCode() == 401 + || $IPP->errorCode() == 3200 + // phpcs:ignore Standard.Category.Sniff -- for reasons. +) { + return false; +} + +if ($IPP->errorCode() == 401 + || $IPP->errorCode() === 'someverylongexpectedoutput' +) { + return false; +} + +if ($IPP->errorCode() == 401 + || $IPP->errorCode() + // A comment. + === 'someverylongexpectedoutput' +) { + return false; +} + +if ($IPP->errorCode() == 401 + || $IPP->errorCode() + // phpcs:ignore Standard.Category.Sniff -- for reasons. + === 'someverylongexpectedoutput' +) { + return false; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js new file mode 100644 index 00000000..064d7ff7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js @@ -0,0 +1,251 @@ +if (blah(param)) { + +} + +if ((condition1 + || condition2) + && condition3 + && condition4 + && condition5 +) { +} + +if ((condition1 || condition2) && condition3 && condition4 && condition5) { +} + +if ((condition1 || condition2) + && condition3 +) { +} + +if ( + (condition1 || condition2) + && condition3 +) { +} + +if ((condition1 + || condition2) +) { +} + +if ((condition1 + || condition2) + && condition3 && + condition4 +) { +} + +if ((condition1 + || condition2) + && condition3 + && condition4 + && condition5 +) { +} + +if (($condition1 + || $condition2) +) { +} + +if ((condition1 + || condition2) + ) { +} + +if ( + ( + condition1 + || condition2 + ) + && condition3 +) { +} + + +if ( condition1 + || condition2 + || condition3 +) { +} + +if (condition1 + || condition2 + || condition3 +) { +} else if (condition1 + || condition2 + || condition3 +) { +} + +if (condition1 + || condition2 + || condition3 +) { +} else if ( + condition1 + || condition2 && + condition3 +) { +} + +if (condition1 + || condition2 +|| condition3) { +} + +if (condition1 + || condition2 || condition3 +){ +} + +if (condition1) + console.info('bar'); + +if (condition1 + || condition2 +|| condition3) + console.info('bar'); + + +if (condition1 + || condition2 || condition3 +) + console.info('bar'); + +if (!a(post) + && (!a(context.header) + ^ a(context.header, 'Content-Type')) +) { +// ... +} + +if (foo) +{ + console.info('bar'); +} + +// Should be no errors even though lines are +// not exactly aligned together. Multi-line function +// call takes precedence. +if (array_key_exists(key, value) + && foo.bar.baz( + key, value2 + ) +) { +} + +if (true) { + foo = true; +}; + +if (foo == 401 || // comment + bar == 3200) /* long comment + here + */ +{ + return false; +} + +if (foo == 401 || // comment + bar == 3200) // long comment here +{ + return false; +} + +if (IPP.errorCode() == 401 + // Comment explaining the next condition here. + || IPP.errorCode() == 3200 +) { + return false; +} + +function bar() { + if (a + && b +) { + return false; + } +} + +if (a + && foo( + 'a', + 'b' + )) { + return false; +} + + + + + + + + + + + + + +if (foo == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. + bar == 3200) /* + phpcs:ignore Standard.Category.Sniff -- for reasons. + */ +{ + return false; +} + +if (foo == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. + bar == 3200) // phpcs:enable +{ + return false; +} + +if (IPP.errorCode() == 401 + // phpcs:ignore Standard.Category.Sniff -- for reasons. + || IPP.errorCode() == 3200 +) { + return false; +} + + if (foo == 401 || + /* + * phpcs:disable Standard.Category.Sniff -- for reasons. + */ + bar == 3200 + ) { + return false; + } + +if (IPP.errorCode() == 401 + || IPP.errorCode() == 3200 + // phpcs:ignore Standard.Category.Sniff -- for reasons. +) { + return false; +} + +if (foo == 401 + || bar + == 'someverylongexpectedoutput' +) { + return false; +} + +if (IPP.errorCode() == 401 + || bar + // A comment. + == 'someverylongexpectedoutput' +) { + return false; +} + +if (foo == 401 + || IPP.errorCode() + // phpcs:ignore Standard.Category.Sniff -- for reasons. + == 'someverylongexpectedoutput' +) { + return false; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed new file mode 100644 index 00000000..cfde75d7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed @@ -0,0 +1,247 @@ +if (blah(param)) { + +} + +if ((condition1 + || condition2) + && condition3 + && condition4 + && condition5 +) { +} + +if ((condition1 || condition2) && condition3 && condition4 && condition5) { +} + +if ((condition1 || condition2) + && condition3 +) { +} + +if ((condition1 || condition2) + && condition3 +) { +} + +if ((condition1 + || condition2) +) { +} + +if ((condition1 + || condition2) + && condition3 + && condition4 +) { +} + +if ((condition1 + || condition2) + && condition3 + && condition4 + && condition5 +) { +} + +if (($condition1 + || $condition2) +) { +} + +if ((condition1 + || condition2) +) { +} + +if ((condition1 + || condition2) + && condition3 +) { +} + + +if (condition1 + || condition2 + || condition3 +) { +} + +if (condition1 + || condition2 + || condition3 +) { +} else if (condition1 + || condition2 + || condition3 +) { +} + +if (condition1 + || condition2 + || condition3 +) { +} else if (condition1 + || condition2 + && condition3 +) { +} + +if (condition1 + || condition2 + || condition3 +) { +} + +if (condition1 + || condition2 || condition3 +) { +} + +if (condition1) + console.info('bar'); + +if (condition1 + || condition2 + || condition3 +) + console.info('bar'); + + +if (condition1 + || condition2 || condition3 +) + console.info('bar'); + +if (!a(post) + && (!a(context.header) + ^ a(context.header, 'Content-Type')) +) { +// ... +} + +if (foo) { + console.info('bar'); +} + +// Should be no errors even though lines are +// not exactly aligned together. Multi-line function +// call takes precedence. +if (array_key_exists(key, value) + && foo.bar.baz( + key, value2 + ) +) { +} + +if (true) { + foo = true; +}; + +if (foo == 401 // comment + || bar == 3200 /* long comment + here + */ +) { + return false; +} + +if (foo == 401 // comment + || bar == 3200 // long comment here +) { + return false; +} + +if (IPP.errorCode() == 401 + // Comment explaining the next condition here. + || IPP.errorCode() == 3200 +) { + return false; +} + +function bar() { + if (a + && b + ) { + return false; + } +} + +if (a + && foo( + 'a', + 'b' + ) +) { + return false; +} + + + + + + + + + + + + + +if (foo == 401 // phpcs:ignore Standard.Category.Sniff -- for reasons. + || bar == 3200 /* + phpcs:ignore Standard.Category.Sniff -- for reasons. + */ +) { + return false; +} + +if (foo == 401 // phpcs:disable Standard.Category.Sniff -- for reasons. + || bar == 3200 // phpcs:enable +) { + return false; +} + +if (IPP.errorCode() == 401 + // phpcs:ignore Standard.Category.Sniff -- for reasons. + || IPP.errorCode() == 3200 +) { + return false; +} + + if (foo == 401 + /* + * phpcs:disable Standard.Category.Sniff -- for reasons. + */ + || bar == 3200 + ) { + return false; + } + +if (IPP.errorCode() == 401 + || IPP.errorCode() == 3200 + // phpcs:ignore Standard.Category.Sniff -- for reasons. +) { + return false; +} + +if (foo == 401 + || bar == 'someverylongexpectedoutput' +) { + return false; +} + +if (IPP.errorCode() == 401 + || bar + // A comment. + == 'someverylongexpectedoutput' +) { + return false; +} + +if (foo == 401 + || IPP.errorCode() + // phpcs:ignore Standard.Category.Sniff -- for reasons. + == 'someverylongexpectedoutput' +) { + return false; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php new file mode 100644 index 00000000..263906d1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php @@ -0,0 +1,96 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the MultiLineCondition sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\MultiLineConditionSniff + */ +final class MultiLineConditionUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + $errors = [ + 21 => 1, + 22 => 1, + 35 => 1, + 40 => 1, + 41 => 1, + 42 => 1, + 43 => 1, + 49 => 1, + 54 => 1, + 57 => 1, + 58 => 1, + 59 => 1, + 61 => 1, + 67 => 1, + 87 => 1, + 88 => 1, + 89 => 1, + 90 => 1, + 96 => 2, + 101 => 1, + 109 => 2, + 125 => 1, + 145 => 2, + 153 => 2, + 168 => 1, + 177 => 1, + 194 => 2, + 202 => 2, + 215 => 1, + 218 => 2, + 232 => 2, + 239 => 1, + 240 => 2, + 248 => 2, + ]; + + if ($testFile === 'MultiLineConditionUnitTest.inc') { + $errors[183] = 1; + } + + return $errors; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc new file mode 100644 index 00000000..dadfe923 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc @@ -0,0 +1,99 @@ + +
    +Some content goes here.
    +
    +
    + +
    +    Some content goes here.
    +    
    +    
    + +
    +Some content goes here.
    +
    +
    + +
    +    Some content goes here.
    +    
    +    
    + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the IncludingFile sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Files\IncludingFileSniff + */ +final class IncludingFileUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 1, + 5 => 1, + 11 => 1, + 12 => 1, + 16 => 1, + 17 => 1, + 33 => 1, + 34 => 1, + 47 => 1, + 48 => 1, + 64 => 1, + 65 => 1, + 73 => 1, + 74 => 1, + 85 => 1, + 86 => 1, + 98 => 1, + 99 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc new file mode 100644 index 00000000..fc6aea00 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc @@ -0,0 +1,22 @@ +additionalHeaderData[$this->strApplicationName] + = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); + +$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] + = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); + +$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] = + $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); + +$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] + = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); +$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] = 'boo'; + +$var='string'; + +function getInstalledStandards( + $includeGeneric=false, + $standardsDir='' +) { +} +?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php new file mode 100644 index 00000000..1be3296c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Formatting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the MultiLineAssignment sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting\MultiLineAssignmentSniff + */ +final class MultiLineAssignmentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 6 => 1, + 8 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc new file mode 100644 index 00000000..fddd3cba --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc @@ -0,0 +1,576 @@ +getFoo() + ->doBar( + $this->getX() // no comma here + ->doY() // this is still the first method argument + ->doZ() // this is still the first method argument + ); +} + +$var = myFunction( +$foo, +$bar +); + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false + +fputs( + STDOUT, + "Examples: + $ {$app} , --all + $ {$app} --all", $something +); + +$array = array(); +array_map( + function($x) + { + return trim($x, $y); + }, $foo, + $array +); + +$bar = new stdClass( + 4, /* thanks */ 5, /* PSR-2 */ 6 +); + +function doSomething() +{ + return $this->getFoo() + ->doBar( + $this->getX() // no comma here + ->doY() // this is still the first method argument + ->doZ() // this is still the first method argument + ); +} + +doError( + 404, // status code + 'Not Found', // error name + 'Check your id' // fix +); + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true + +// Don't report errors for closing braces. Leave that to other sniffs. +foo( + [ + 'this', + 'is', + 'an', + 'array' + ], +[ + 'this', + 'is', + 'an', + 'array' + ], + array( + 'this', + 'is', +'an', +'array' + ), + array( + 'this', + 'is', + 'an', + 'array' + ), + function($x) + { + echo 'wee'; + + return trim($x); + } +); + +function foo() +{ + myFunction( + 'string'. + // comment + // comment + 'string'. + /* comment + * comment + */ + 'string' + ); +} + +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 +test($arg, $arg2); +test( $arg, $arg2 ); +test( $arg, $arg2 ); +test(); +test( ); +test( ); +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 + +?> + + + +
  • + log(// ... + 'error', + sprintf( + 'Message: %s', + isset($e->getData()['object']['evidence_details']) + ? $e->getData()['object']['evidence_details']['due_by'] + : '' + ), + array($e->getData()['object']) +); + +?> +
    + $class + ] + ); ?> +
    + + function ($x) { + return true; + }, + 'baz' => false + ) +); +$qux = array_filter( + $quux, function ($x) { + return $x; + } +); + +array_filter( + [1, 2], + function ($i) : bool { + return $i === 0; + } +); + +foo(array( + 'callback' => function () { + $foo = 'foo'; + return; + }, +)); + +foo( + $a, + /* + $c, + + $d, + */ + $e +); + +test( + 1,2,3,4 + ); + +class Test +{ + public function getInstance() + { + return new static( + 'arg', + 'foo' + ); + } + + public function getSelf() + { + return new self( + 'a','b', 'c' + ); + } +} + +$x = $var('y', +'x'); + +$obj->{$x}(1, + 2); + +return (function ($a, $b) { + return function ($c, $d) use ($a, $b) { + echo $a, $b, $c, $d; + }; +})( + 'a','b' +)('c', + 'd'); + +class Foo +{ + public function bar($a, $b) + { + if (!$a || !$b) { + return; + } + + (new stdClass())->a = $a; + } +} + +return (function ($a, $b) { + return function ($c, $d) use ($a, $b) { + echo $a, $b, $c, $d; + }; +})('a','b')('c','d'); + +function foo() +{ + Bar( + function () { + } + ); +} + +$deprecated_functions = [ + 'the_category_ID' + => function_call( // 7 spaces, not 8. This is the problem line. + $a, + $b + ), +]; + +$deprecated_functions = [ + 'the_category_ID' + => function_call( // 9 spaces, not 8. This is the problem line. + $a, + $b + ), +]; + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false + +printf( + '', + $obj->getName(), // Trailing comment. + $obj->getID(), // phpcs:ignore Standard.Category.SniffName -- for reasons. + $option +); + +// Handling of PHP 7.3 trailing comma's. +functionCall($args, $foo,); +functionCall( + $args, $foo, +); +functionCall( + $args, + $foo, +); + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true + +$this->foo( + + ['a','b'], + true + +); + +$this->foo( + + // Comment + ['a','b'], + true + +); + +function m() +{ + $t = ' + ' . (empty(true) ? ' + ' . f( + '1', + '2', + ) . ' + ' : ''); +} + +class C +{ + + public function m() + { + $a = []; + $t = + "SELECT * FROM t +WHERE f IN(" . implode( + ",", + $a + ) . ")"; + } +} + +$notices = array( + 'index' => sprintf( + translation_function('a text string with %s placeholder'), + 'replacement' + ), +); + +$componentType = $this->componentTypeRepository->findByType($this->identifier) ?: + $this->componentTypeFactory->createForType( + $this->identifier, + $this->className, + true, + $this->isPrototypal + ); + +return [ + 'export-path' => 'exports/database/' + . env( + 'APP_CUSTOMER', + 'not-configured' + ) + . '/' . env( + 'APP_IDENTIFIER', + 'not-configured' + ), +]; + +$methods .= + str_replace( + array_keys($replacements), + array_values($replacements), + $methodTemplate + ) + . PHP_EOL . PHP_EOL . str_repeat(' ', 4); + +$rangeValues['min'] = + $this->adjustLowerThreshold( + $this->normalizeRatingForFilter($rangeValues['min']) + ); + +$salesOrderThresholdTransfer->fromArray($salesOrderThresholdEntity->toArray(), true) + ->setSalesOrderThresholdValue( + $this->mapSalesOrderThresholdValueTransfer($salesOrderThresholdTransfer, $salesOrderThresholdEntity) + )->setCurrency( + (new CurrencyTransfer())->fromArray($salesOrderThresholdEntity->getCurrency()->toArray(), true) + )->setStore( + (new StoreTransfer())->fromArray($salesOrderThresholdEntity->getStore()->toArray(), true) + ); + +return trim(preg_replace_callback( + // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) + // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ + sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), + function (array $term) use ($mode): string { + // query pieces have to bigger than one char, otherwise they are too expensive for the search + if (mb_strlen($term[1], 'UTF-8') > 1) { + // in boolean search mode '' (empty) means OR, '-' means NOT + return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); + } + + return ''; + }, + $search + )); + +$a = ['a' => function ($b) { return $b; }]; +$a['a']( 1 ); + +// PHP 8.0 named parameters. +array_fill_keys( + keys: range( + 1, + 12, + ), + value: true, +); + +array_fill_keys( + keys: range( 1, + 12, + ), value: true, +); + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false +array_fill_keys( + keys: range( 1, + 12, + ), value: true, +); +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true + +?> +
    +

    +
    +
    +

    +
    + +content +

    + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed new file mode 100644 index 00000000..1c525230 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed @@ -0,0 +1,591 @@ +getFoo() + ->doBar( + $this->getX() // no comma here + ->doY() // this is still the first method argument + ->doZ() // this is still the first method argument + ); +} + +$var = myFunction( + $foo, + $bar +); + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false + +fputs( + STDOUT, + "Examples: + $ {$app} , --all + $ {$app} --all", + $something +); + +$array = array(); +array_map( + function($x) + { + return trim($x, $y); + }, + $foo, + $array +); + +$bar = new stdClass( + 4, /* thanks */ + 5, /* PSR-2 */ + 6 +); + +function doSomething() +{ + return $this->getFoo() + ->doBar( + $this->getX() // no comma here + ->doY() // this is still the first method argument + ->doZ() // this is still the first method argument + ); +} + +doError( + 404, // status code + 'Not Found', // error name + 'Check your id' // fix +); + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true + +// Don't report errors for closing braces. Leave that to other sniffs. +foo( + [ + 'this', + 'is', + 'an', + 'array' + ], + [ + 'this', + 'is', + 'an', + 'array' + ], + array( + 'this', + 'is', + 'an', + 'array' + ), + array( + 'this', + 'is', + 'an', + 'array' + ), + function($x) + { + echo 'wee'; + + return trim($x); + } +); + +function foo() +{ + myFunction( + 'string'. + // comment + // comment + 'string'. + /* comment + * comment + */ + 'string' + ); +} + +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 +test( $arg, $arg2 ); +test( $arg, $arg2 ); +test( $arg, $arg2 ); +test(); +test(); +test(); +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 + +?> + + + +
  • + log(// ... + 'error', + sprintf( + 'Message: %s', + isset($e->getData()['object']['evidence_details']) + ? $e->getData()['object']['evidence_details']['due_by'] + : '' + ), + array($e->getData()['object']) +); + +?> +
    + $class + ] + ); ?> +
    + + function ($x) { + return true; + }, + 'baz' => false + ) +); +$qux = array_filter( + $quux, function ($x) { + return $x; + } +); + +array_filter( + [1, 2], + function ($i) : bool { + return $i === 0; + } +); + +foo( + array( + 'callback' => function () { + $foo = 'foo'; + return; + }, + ) +); + +foo( + $a, + /* + $c, + + $d, + */ + $e +); + +test( + 1,2,3,4 +); + +class Test +{ + public function getInstance() + { + return new static( + 'arg', + 'foo' + ); + } + + public function getSelf() + { + return new self( + 'a','b', 'c' + ); + } +} + +$x = $var( + 'y', + 'x' +); + +$obj->{$x}( + 1, + 2 +); + +return (function ($a, $b) { + return function ($c, $d) use ($a, $b) { + echo $a, $b, $c, $d; + }; +})( + 'a','b' +)( + 'c', + 'd' +); + +class Foo +{ + public function bar($a, $b) + { + if (!$a || !$b) { + return; + } + + (new stdClass())->a = $a; + } +} + +return (function ($a, $b) { + return function ($c, $d) use ($a, $b) { + echo $a, $b, $c, $d; + }; +})('a','b')('c','d'); + +function foo() +{ + Bar( + function () { + } + ); +} + +$deprecated_functions = [ + 'the_category_ID' + => function_call( // 7 spaces, not 8. This is the problem line. + $a, + $b + ), +]; + +$deprecated_functions = [ + 'the_category_ID' + => function_call( // 9 spaces, not 8. This is the problem line. + $a, + $b + ), +]; + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false + +printf( + '', + $obj->getName(), // Trailing comment. + $obj->getID(), // phpcs:ignore Standard.Category.SniffName -- for reasons. + $option +); + +// Handling of PHP 7.3 trailing comma's. +functionCall($args, $foo,); +functionCall( + $args, + $foo, +); +functionCall( + $args, + $foo, +); + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true + +$this->foo( + ['a','b'], + true +); + +$this->foo( + // Comment + ['a','b'], + true +); + +function m() +{ + $t = ' + ' . (empty(true) ? ' + ' . f( + '1', + '2', + ) . ' + ' : ''); +} + +class C +{ + + public function m() + { + $a = []; + $t = + "SELECT * FROM t +WHERE f IN(" . implode( + ",", + $a + ) . ")"; + } +} + +$notices = array( + 'index' => sprintf( + translation_function('a text string with %s placeholder'), + 'replacement' + ), +); + +$componentType = $this->componentTypeRepository->findByType($this->identifier) ?: + $this->componentTypeFactory->createForType( + $this->identifier, + $this->className, + true, + $this->isPrototypal + ); + +return [ + 'export-path' => 'exports/database/' + . env( + 'APP_CUSTOMER', + 'not-configured' + ) + . '/' . env( + 'APP_IDENTIFIER', + 'not-configured' + ), +]; + +$methods .= + str_replace( + array_keys($replacements), + array_values($replacements), + $methodTemplate + ) + . PHP_EOL . PHP_EOL . str_repeat(' ', 4); + +$rangeValues['min'] = + $this->adjustLowerThreshold( + $this->normalizeRatingForFilter($rangeValues['min']) + ); + +$salesOrderThresholdTransfer->fromArray($salesOrderThresholdEntity->toArray(), true) + ->setSalesOrderThresholdValue( + $this->mapSalesOrderThresholdValueTransfer($salesOrderThresholdTransfer, $salesOrderThresholdEntity) + )->setCurrency( + (new CurrencyTransfer())->fromArray($salesOrderThresholdEntity->getCurrency()->toArray(), true) + )->setStore( + (new StoreTransfer())->fromArray($salesOrderThresholdEntity->getStore()->toArray(), true) + ); + +return trim( + preg_replace_callback( + // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) + // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ + sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), + function (array $term) use ($mode): string { + // query pieces have to bigger than one char, otherwise they are too expensive for the search + if (mb_strlen($term[1], 'UTF-8') > 1) { + // in boolean search mode '' (empty) means OR, '-' means NOT + return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); + } + + return ''; + }, + $search + ) +); + +$a = ['a' => function ($b) { return $b; }]; +$a['a'](1); + +// PHP 8.0 named parameters. +array_fill_keys( + keys: range( + 1, + 12, + ), + value: true, +); + +array_fill_keys( + keys: range( + 1, + 12, + ), value: true, +); + +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false +array_fill_keys( + keys: range( + 1, + 12, + ), + value: true, +); +// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true + +?> +
    +

    +
    +
    +

    +
    + +content +

    + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js new file mode 100644 index 00000000..5e77e57a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js @@ -0,0 +1,80 @@ +test( +); +test(); +test(arg, arg2); +test (); +test( ); +test() ; +test( arg); +test( arg ); +test ( arg ); + +if (foo(arg) === true) { + +} + +var something = get(arg1, arg2); +var something = get(arg1, arg2) ; +var something = get(arg1, arg2) ; + +make_foo(string/*the string*/, true/*test*/); +make_foo(string/*the string*/, true/*test*/ ); +make_foo(string /*the string*/, true /*test*/); +make_foo(/*the string*/string, /*test*/true); +make_foo( /*the string*/string, /*test*/true); + +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 +test(arg, arg2); +test( arg, arg2 ); +test( arg, arg2 ); +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 + +this.init = function(data) { + a.b('').a(function(itemid, target) { + b( + itemid, + target, + { + reviewData: _reviewData, + pageid: itemid + }, + '', + function() { + var _showAspectItems = function(itemid) { + a.a(a.c(''), ''); + a.b(a.c('-' + itemid), ''); + }; + a.foo(function(itemid, target) { + _foo(itemid); + }); + } + ); + }); +}; + +a.prototype = { + + a: function() + { + this.addItem( + { + /** + * @return void + */ + a: function() + { + + }, + /** + * @return void + */ + a: function() + { + + }, + } + ); + } +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed new file mode 100644 index 00000000..7855ac67 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed @@ -0,0 +1,84 @@ +test( +); +test(); +test(arg, arg2); +test(); +test(); +test(); +test(arg); +test(arg); +test(arg); + +if (foo(arg) === true) { + +} + +var something = get(arg1, arg2); +var something = get(arg1, arg2); +var something = get(arg1, arg2); + +make_foo(string/*the string*/, true/*test*/); +make_foo(string/*the string*/, true/*test*/); +make_foo(string /*the string*/, true /*test*/); +make_foo(/*the string*/string, /*test*/true); +make_foo(/*the string*/string, /*test*/true); + +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 +test( arg, arg2 ); +test( arg, arg2 ); +test( arg, arg2 ); +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 +// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 + +this.init = function(data) { + a.b('').a( + function(itemid, target) { + b( + itemid, + target, + { + reviewData: _reviewData, + pageid: itemid + }, + '', + function() { + var _showAspectItems = function(itemid) { + a.a(a.c(''), ''); + a.b(a.c('-' + itemid), ''); + }; + a.foo( + function(itemid, target) { + _foo(itemid); + } + ); + } + ); + } + ); +}; + +a.prototype = { + + a: function() + { + this.addItem( + { + /** + * @return void + */ + a: function() + { + + }, + /** + * @return void + */ + a: function() + { + + }, + } + ); + } +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php new file mode 100644 index 00000000..5884bd8f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php @@ -0,0 +1,164 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionCallSignature sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff + */ +final class FunctionCallSignatureUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + if ($testFile === 'FunctionCallSignatureUnitTest.js') { + return [ + 5 => 1, + 6 => 2, + 7 => 1, + 8 => 1, + 9 => 2, + 10 => 3, + 17 => 1, + 18 => 1, + 21 => 1, + 24 => 1, + 28 => 2, + 30 => 2, + 35 => 1, + 49 => 1, + 51 => 1, + 54 => 1, + 70 => 1, + 71 => 1, + ]; + }//end if + + return [ + 5 => 1, + 6 => 2, + 7 => 1, + 8 => 1, + 9 => 2, + 10 => 3, + 17 => 1, + 18 => 1, + 31 => 1, + 34 => 1, + 43 => 2, + 57 => 1, + 59 => 1, + 63 => 1, + 64 => 1, + 82 => 1, + 93 => 1, + 100 => 1, + 106 => 2, + 119 => 1, + 120 => 1, + 129 => 1, + 137 => 1, + 142 => 2, + 171 => 1, + 180 => 1, + 181 => 1, + 194 => 1, + 213 => 2, + 215 => 2, + 217 => 2, + 218 => 2, + 277 => 1, + 278 => 1, + 303 => 1, + 308 => 1, + 321 => 1, + 322 => 1, + 329 => 1, + 330 => 1, + 337 => 1, + 342 => 1, + 343 => 1, + 345 => 1, + 346 => 2, + 353 => 1, + 354 => 1, + 355 => 2, + 377 => 1, + 378 => 1, + 379 => 1, + 380 => 1, + 385 => 1, + 386 => 1, + 387 => 1, + 388 => 1, + 393 => 1, + 394 => 1, + 395 => 1, + 396 => 1, + 411 => 1, + 422 => 1, + 424 => 1, + 429 => 1, + 432 => 1, + 440 => 1, + 441 => 1, + 442 => 1, + 464 => 1, + 510 => 1, + 513 => 1, + 514 => 1, + 523 => 1, + 524 => 3, + 527 => 2, + 539 => 1, + 540 => 1, + 546 => 1, + 547 => 1, + 548 => 1, + 559 => 1, + 567 => 1, + 568 => 1, + 573 => 1, + 574 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc new file mode 100644 index 00000000..6ba3bd9f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc @@ -0,0 +1,490 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff + */ +final class FunctionDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'FunctionDeclarationUnitTest.1.inc': + return [ + 3 => 1, + 4 => 1, + 5 => 1, + 9 => 1, + 10 => 1, + 11 => 1, + 14 => 1, + 17 => 1, + 44 => 1, + 52 => 1, + 61 => 2, + 98 => 1, + 110 => 2, + 120 => 3, + 121 => 1, + 140 => 1, + 145 => 1, + 161 => 2, + 162 => 2, + 164 => 2, + 167 => 2, + 171 => 1, + 173 => 1, + 201 => 1, + 206 => 1, + 208 => 1, + 216 => 1, + 223 => 1, + 230 => 1, + 237 => 1, + 243 => 1, + 247 => 1, + 251 => 2, + 253 => 2, + 257 => 2, + 259 => 1, + 263 => 1, + 265 => 1, + 269 => 1, + 273 => 1, + 277 => 1, + 278 => 1, + 283 => 1, + 287 => 2, + 289 => 2, + 293 => 2, + 295 => 1, + 299 => 1, + 301 => 1, + 305 => 1, + 309 => 1, + 313 => 1, + 314 => 1, + 350 => 1, + 351 => 1, + 352 => 1, + 353 => 1, + 361 => 1, + 362 => 1, + 363 => 1, + 364 => 1, + 365 => 1, + 366 => 1, + 367 => 1, + 368 => 1, + 369 => 1, + 370 => 1, + 371 => 1, + 402 => 1, + 406 => 1, + 475 => 1, + 483 => 1, + 490 => 2, + ]; + + case 'FunctionDeclarationUnitTest.js': + return [ + 3 => 1, + 4 => 1, + 5 => 1, + 9 => 1, + 10 => 1, + 11 => 1, + 14 => 1, + 17 => 1, + 41 => 1, + 48 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc new file mode 100644 index 00000000..2503f599 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc @@ -0,0 +1,116 @@ + $a[] = $b; + +class OnlyConstructorPropertyPromotion { + public function __construct( + public string $name = '', + protected $bar + ) {} +} + +class ConstructorPropertyPromotionMixedWithNormalParams { + public function __construct( + public string $name = '', + ?int $optionalParam = 0, + mixed $requiredParam, + ) {} +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.2.inc new file mode 100644 index 00000000..3cfece7a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.2.inc @@ -0,0 +1,7 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ValidDefaultValue sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff + */ +final class ValidDefaultValueUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ValidDefaultValueUnitTest.1.inc': + return [ + 29 => 1, + 34 => 1, + 39 => 1, + 71 => 1, + 76 => 1, + 81 => 1, + 91 => 1, + 99 => 1, + 101 => 1, + 106 => 1, + 114 => 1, + ]; + + default: + return []; + } + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc new file mode 100644 index 00000000..053a4fee --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc @@ -0,0 +1,90 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ValidClassName sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidClassNameSniff + */ +final class ValidClassNameUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 5 => 1, + 7 => 2, + 9 => 1, + 19 => 1, + 24 => 1, + 26 => 2, + 28 => 1, + 38 => 1, + 40 => 2, + 42 => 2, + 44 => 1, + 46 => 1, + 50 => 1, + 52 => 2, + 54 => 1, + 64 => 1, + 66 => 2, + 68 => 1, + 72 => 1, + 74 => 2, + 76 => 1, + 86 => 1, + 88 => 2, + 90 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc new file mode 100644 index 00000000..18b1a481 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc @@ -0,0 +1,243 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ValidFunctionName sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff + */ +final class ValidFunctionNameUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 11 => 1, + 12 => 1, + 13 => 1, + 14 => 1, + 15 => 1, + 16 => 1, + 17 => 2, + 18 => 2, + 19 => 2, + 20 => 2, + 24 => 1, + 25 => 1, + 26 => 1, + 27 => 1, + 28 => 1, + 29 => 1, + 30 => 2, + 31 => 2, + 32 => 2, + 33 => 2, + 35 => 1, + 36 => 1, + 37 => 2, + 38 => 2, + 39 => 2, + 40 => 2, + 43 => 1, + 44 => 1, + 45 => 1, + 46 => 1, + 50 => 1, + 51 => 1, + 52 => 1, + 53 => 1, + 56 => 1, + 57 => 1, + 58 => 1, + 59 => 1, + 67 => 1, + 68 => 1, + 69 => 1, + 70 => 1, + 71 => 1, + 72 => 1, + 73 => 2, + 74 => 2, + 75 => 2, + 76 => 2, + 80 => 1, + 81 => 1, + 82 => 1, + 83 => 1, + 86 => 1, + 87 => 1, + 88 => 1, + 89 => 1, + 95 => 1, + 96 => 1, + 97 => 1, + 98 => 1, + 99 => 1, + 100 => 1, + 101 => 2, + 102 => 2, + 103 => 2, + 104 => 2, + 123 => 1, + 125 => 1, + 126 => 2, + 129 => 1, + 130 => 1, + 131 => 1, + 132 => 1, + 133 => 1, + 134 => 1, + 135 => 1, + 136 => 1, + 137 => 1, + 138 => 1, + 139 => 1, + 140 => 3, + 141 => 1, + 143 => 1, + 144 => 1, + 145 => 3, + 147 => 2, + 148 => 1, + 149 => 1, + 181 => 1, + 201 => 1, + 203 => 1, + 204 => 2, + 207 => 2, + 212 => 1, + 213 => 1, + 214 => 1, + 235 => 1, + 236 => 2, + 239 => 1, + 242 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc new file mode 100644 index 00000000..3c03da3f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc @@ -0,0 +1,101 @@ +def["POP_{$cc}_A"]}' + and POP_{$cc}_B = +'{$this->def["POP_{$cc}_B"]}')"; + } +} + +class mpgResponse{ + var $term_id; + var $currentTag; + function characterHandler($parser,$data){ + switch($this->currentTag) + { + case "term_id": { + $this->term_id=$data; + break; + } + } + }//end characterHandler +}//end class mpgResponse + +class foo +{ + const bar = <<setLogger( + new class { + private $varName = 'hello'; + private $_varName = 'hello'; +}); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php new file mode 100644 index 00000000..c98af3bc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php @@ -0,0 +1,61 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ValidVariableName sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidVariableNameSniff + */ +final class ValidVariableNameUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 12 => 1, + 17 => 1, + 22 => 1, + 92 => 1, + 93 => 1, + 94 => 1, + 99 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc new file mode 100644 index 00000000..b1b09d93 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc @@ -0,0 +1,142 @@ +someFunction("some", "parameter") +->someOtherFunc(23, 42)-> + someOtherFunc2($one, $two) + + ->someOtherFunc3(23, 42) + ->andAThirdFunction(); + + $someObject->someFunction("some", "parameter") + ->someOtherFunc(23, 42); + +$someObject->someFunction("some", "parameter")->someOtherFunc(23, 42); + +$someObject->someFunction("some", "parameter") + ->someOtherFunc(23, 42); + +func( + $bar->foo() +) + ->bar(); + +func( + $bar->foo() +) + ->bar( + $bar->foo() + ->bar() + ->func() + ); + +$object + ->setBar($foo) + ->setFoo($bar); + +if ($bar) { + $object + ->setBar($foo) + ->setFoo($bar); +} + +$response -> CompletedTrackDetails -> TrackDetails -> Events; +$response + -> CompletedTrackDetails + -> TrackDetails + -> Events; + +$response + -> CompletedTrackDetails +-> TrackDetails + -> Events; + +$var = get_object( + $foo->something() + ->query() +)->two() + ->three(); + +$foo->one( + $foo + ->two() +); + +get_object()->one() + ->two() + ->three(); + +someclass::one() + ->two() + ->three(); + +(new someclass())->one() + ->two() + ->three(); + +// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true + +$someObject + ->startSomething() + ->someOtherFunc(23, 42) +->endSomething() +->doSomething(23, 42) +->endEverything(); + +$rootNode + ->one() + ->two() + ->three() + ->four() + ->five(); + +$rootNode + ->one() + ->two() + ->three() + ->four() + ->five(); + +$rootNode + ->one() + ->two() + ->three() + ->four() +->five(); + +$rootNode + ->one() + ->two() + ->three() + ->four() + ->five(); + +// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false + +$object + ?->setBar($foo) + ?->setFoo($bar); + +$someObject?->someFunction("some", "parameter") +->someOtherFunc(23, 42)?-> + someOtherFunc2($one, $two) + +->someOtherFunc3(23, 42) + ?->andAThirdFunction(); + +// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true +$object + ?->setBar($foo) + ?->setFoo($bar); + +$someObject?->someFunction("some", "parameter") +->someOtherFunc(23, 42) + ?->someOtherFunc2($one, $two) + +->someOtherFunc3(23, 42) + ?->andAThirdFunction(); +// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false + +$someObject + ->startSomething(paramName: $value) + ->someOtherFunc(nameA: 23, nameB: 42) +->endSomething($value, name: $value) +->endEverything(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed new file mode 100644 index 00000000..5d5b77be --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed @@ -0,0 +1,142 @@ +someFunction("some", "parameter") + ->someOtherFunc(23, 42) + ->someOtherFunc2($one, $two) + + ->someOtherFunc3(23, 42) + ->andAThirdFunction(); + + $someObject->someFunction("some", "parameter") + ->someOtherFunc(23, 42); + +$someObject->someFunction("some", "parameter")->someOtherFunc(23, 42); + +$someObject->someFunction("some", "parameter") + ->someOtherFunc(23, 42); + +func( + $bar->foo() +) + ->bar(); + +func( + $bar->foo() +) + ->bar( + $bar->foo() + ->bar() + ->func() + ); + +$object + ->setBar($foo) + ->setFoo($bar); + +if ($bar) { + $object + ->setBar($foo) + ->setFoo($bar); +} + +$response -> CompletedTrackDetails -> TrackDetails -> Events; +$response + -> CompletedTrackDetails + -> TrackDetails + -> Events; + +$response + -> CompletedTrackDetails + -> TrackDetails + -> Events; + +$var = get_object( + $foo->something() + ->query() +)->two() + ->three(); + +$foo->one( + $foo + ->two() +); + +get_object()->one() + ->two() + ->three(); + +someclass::one() + ->two() + ->three(); + +(new someclass())->one() + ->two() + ->three(); + +// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true + +$someObject + ->startSomething() + ->someOtherFunc(23, 42) + ->endSomething() + ->doSomething(23, 42) + ->endEverything(); + +$rootNode + ->one() + ->two() + ->three() + ->four() + ->five(); + +$rootNode + ->one() + ->two() + ->three() + ->four() + ->five(); + +$rootNode + ->one() + ->two() + ->three() + ->four() + ->five(); + +$rootNode + ->one() + ->two() + ->three() + ->four() + ->five(); + +// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false + +$object + ?->setBar($foo) + ?->setFoo($bar); + +$someObject?->someFunction("some", "parameter") + ->someOtherFunc(23, 42) + ?->someOtherFunc2($one, $two) + + ->someOtherFunc3(23, 42) + ?->andAThirdFunction(); + +// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true +$object + ?->setBar($foo) + ?->setFoo($bar); + +$someObject?->someFunction("some", "parameter") + ->someOtherFunc(23, 42) + ?->someOtherFunc2($one, $two) + + ->someOtherFunc3(23, 42) + ?->andAThirdFunction(); +// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false + +$someObject + ->startSomething(paramName: $value) + ->someOtherFunc(nameA: 23, nameB: 42) + ->endSomething($value, name: $value) + ->endEverything(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php new file mode 100644 index 00000000..9beb77fe --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php @@ -0,0 +1,79 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ObjectOperatorIndent sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ObjectOperatorIndentSniff + */ +final class ObjectOperatorIndentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 2, + 6 => 1, + 15 => 1, + 27 => 1, + 37 => 1, + 38 => 1, + 48 => 1, + 49 => 1, + 50 => 1, + 65 => 1, + 69 => 1, + 73 => 1, + 79 => 1, + 80 => 1, + 81 => 1, + 82 => 1, + 95 => 1, + 103 => 1, + 119 => 2, + 122 => 1, + 131 => 1, + 134 => 1, + 140 => 1, + 141 => 1, + 142 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc new file mode 100644 index 00000000..a97aca76 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc @@ -0,0 +1,170 @@ +{$property} =& new $class_name($this->db_index); + $this->modules[$module] =& $this->{$property}; +} + +foreach ($elements as $element) { + if ($something) { + // Do IF. + } else if ($somethingElse) { + // Do ELSE. + } +} + +switch ($foo) { +case 1: + switch ($bar) { + default: + if ($something) { + echo $string{1}; + } else if ($else) { + switch ($else) { + case 1: + // Do something. + break; + default: + // Do something. + break; + } + } + } +break; +case 2: + // Do something; + break; +} + +switch ($httpResponseCode) { + case 100: + case 101: + case 102: + default: + return 'Unknown'; +} + +switch ($httpResponseCode) { + case 100: + case 101: + case 102: + return 'Processing.'; + default: + return 'Unknown'; +} + +switch($i) { +case 1: {} +} + +switch ($httpResponseCode) { + case 100: + case 101: + case 102: + exit; + default: + exit; +} + +if ($foo): + if ($bar): + $foo = 1; + elseif ($baz): + $foo = 2; + endif; +endif; + +if ($foo): +elseif ($baz): $foo = 2; +endif; + +?> +
      + +
    • + +
    +
      + +
    • + +
    +
      + +
    • + +
    + +getSummaryCount(); ?> +
    class="empty"> + + 'a', 2 => 'b' }; + +$match = match ($test) { + 1 => 'a', + 2 => 'b' + }; + +enum Enum +{ +} + +enum Suits {} + +enum Cards +{ + } + +?> + + +
    +
    {$property} =& new $class_name($this->db_index); + $this->modules[$module] =& $this->{$property}; +} + +foreach ($elements as $element) { + if ($something) { + // Do IF. + } else if ($somethingElse) { + // Do ELSE. + } +} + +switch ($foo) { +case 1: + switch ($bar) { + default: + if ($something) { + echo $string{1}; + } else if ($else) { + switch ($else) { + case 1: + // Do something. + break; + default: + // Do something. + break; + } + } + } + break; +case 2: + // Do something; + break; +} + +switch ($httpResponseCode) { + case 100: + case 101: + case 102: + default: + return 'Unknown'; +} + +switch ($httpResponseCode) { + case 100: + case 101: + case 102: + return 'Processing.'; + default: + return 'Unknown'; +} + +switch($i) { +case 1: { + } +} + +switch ($httpResponseCode) { + case 100: + case 101: + case 102: + exit; + default: + exit; +} + +if ($foo): + if ($bar): + $foo = 1; + elseif ($baz): + $foo = 2; + endif; +endif; + +if ($foo): +elseif ($baz): $foo = 2; +endif; + +?> +
      + +
    • + +
    +
      + +
    • + +
    +
      + +
    • + +
    + +getSummaryCount(); ?> +
    class="empty"> + + 'a', 2 => 'b' +}; + +$match = match ($test) { + 1 => 'a', + 2 => 'b' +}; + +enum Enum +{ +} + +enum Suits { +} + +enum Cards +{ +} + +?> + + +
    +
    + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ScopeClosingBrace sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff + */ +final class ScopeClosingBraceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 11 => 1, + 13 => 1, + 24 => 1, + 30 => 1, + 61 => 1, + 65 => 1, + 85 => 1, + 89 => 1, + 98 => 1, + 122 => 1, + 127 => 1, + 135 => 1, + 141 => 1, + 146 => 1, + 149 => 1, + 154 => 1, + 160 => 1, + 164 => 1, + 170 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc new file mode 100644 index 00000000..b122a147 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc @@ -0,0 +1,314 @@ +hello(); // error here + } + + function hello() // error here + { // no error here as brackets can be put anywhere in the pear standard + echo 'hello'; + } + + function hello2() + { + if (TRUE) { // error here + echo 'hello'; // no error here as its more than 4 spaces. + } else { + echo 'bye'; // error here + } + + while (TRUE) { + echo 'hello'; // error here + } + + do { // error here + echo 'hello'; // error here + } while (TRUE); + } + + function hello3() + { + switch ($hello) { + case 'hello': + break; + } + } + +} + +?> +
    +
    +
    +validate()) {
    +    $safe = $form->getSubmitValues();
    +}
    +?>
    +
    +open(); // error here + } + + public function open() + { + // Some inline stuff that shouldn't error + if (TRUE) echo 'hello'; + foreach ($tokens as $token) echo $token; + } + + /** + * This is a comment 1. + * This is a comment 2. + * This is a comment 3. + * This is a comment 4. + */ + public function close() + { + // All ok. + if (TRUE) { + if (TRUE) { + } else if (FALSE) { + foreach ($tokens as $token) { + switch ($token) { + case '1': + case '2': + if (true) { + if (false) { + if (false) { + if (false) { + echo 'hello'; + } + } + } + } + break; + case '5': + break; + } + do { + while (true) { + foreach ($tokens as $token) { + for ($i = 0; $i < $token; $i++) { + echo 'hello'; + } + } + } + } while (true); + } + } + } + } + + /* + This is another c style comment 1. + This is another c style comment 2. + This is another c style comment 3. + This is another c style comment 4. + This is another c style comment 5. + */ + + /* + * + * + * + */ + + /** + */ + + /* + This comment has a newline in it. + + */ + + public function read() + { + echo 'hello'; + + // no errors below. + $array = array( + 'this', + 'that' => array( + 'hello', + 'hello again' => array( + 'hello', + ), + ), + ); + } +} + +abstract class Test3 +{ + public function parse() + { + + foreach ($t as $ndx => $token) { + if (is_array($token)) { + echo 'here'; + } else { + $ts[] = array("token" => $token, "value" => ''); + + $last = count($ts) - 1; + + switch ($token) { + case '(': + + if ($last >= 3 && + $ts[0]['token'] != T_CLASS && + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && + $ts[$last - 3]['token'] == T_VARIABLE ) { + + + if (true) { + echo 'hello'; + } + } + array_push($braces, $token); + break; + } + } + } + } +} + +function test() +{ + $o = <<hello(); // error here + } + + function hello() // error here + { // no error here as brackets can be put anywhere in the pear standard + echo 'hello'; + } + + function hello2() + { + if (TRUE) { // error here + echo 'hello'; // no error here as its more than 4 spaces. + } else { + echo 'bye'; // error here + } + + while (TRUE) { + echo 'hello'; // error here + } + + do { // error here + echo 'hello'; // error here + } while (TRUE); + } + + function hello3() + { + switch ($hello) { + case 'hello': + break; + } + } + +} + +?> +
    +
    +
    +validate()) {
    +    $safe = $form->getSubmitValues();
    +}
    +?>
    +
    +open(); // error here + } + + public function open() + { + // Some inline stuff that shouldn't error + if (TRUE) echo 'hello'; + foreach ($tokens as $token) echo $token; + } + + /** + * This is a comment 1. + * This is a comment 2. + * This is a comment 3. + * This is a comment 4. + */ + public function close() + { + // All ok. + if (TRUE) { + if (TRUE) { + } else if (FALSE) { + foreach ($tokens as $token) { + switch ($token) { + case '1': + case '2': + if (true) { + if (false) { + if (false) { + if (false) { + echo 'hello'; + } + } + } + } + break; + case '5': + break; + } + do { + while (true) { + foreach ($tokens as $token) { + for ($i = 0; $i < $token; $i++) { + echo 'hello'; + } + } + } + } while (true); + } + } + } + } + + /* + This is another c style comment 1. + This is another c style comment 2. + This is another c style comment 3. + This is another c style comment 4. + This is another c style comment 5. + */ + + /* + * + * + * + */ + + /** + */ + + /* + This comment has a newline in it. + + */ + + public function read() + { + echo 'hello'; + + // no errors below. + $array = array( + 'this', + 'that' => array( + 'hello', + 'hello again' => array( + 'hello', + ), + ), + ); + } +} + +abstract class Test3 +{ + public function parse() + { + + foreach ($t as $ndx => $token) { + if (is_array($token)) { + echo 'here'; + } else { + $ts[] = array("token" => $token, "value" => ''); + + $last = count($ts) - 1; + + switch ($token) { + case '(': + + if ($last >= 3 && + $ts[0]['token'] != T_CLASS && + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && + $ts[$last - 3]['token'] == T_VARIABLE ) { + + + if (true) { + echo 'hello'; + } + } + array_push($braces, $token); + break; + } + } + } + } +} + +function test() +{ + $o = << + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ScopeIndent sniff. + * + * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeIndentSniff + */ +final class ScopeIndentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 7 => 1, + 10 => 1, + 17 => 1, + 20 => 1, + 24 => 1, + 25 => 1, + 27 => 1, + 28 => 1, + 29 => 1, + 30 => 1, + 58 => 1, + 123 => 1, + 224 => 1, + 225 => 1, + 279 => 1, + 284 => 1, + 311 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml new file mode 100644 index 00000000..1bf94ca5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml @@ -0,0 +1,41 @@ + + + The PEAR coding standard. + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml new file mode 100644 index 00000000..eaae99b2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml @@ -0,0 +1,48 @@ + + + + + + + class Bar { +} + ]]> + + + class Bar { +} + +class Baz { +} + ]]> + + + + + namespace Foo; + +class Bar { +} + ]]> + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml new file mode 100644 index 00000000..0ed04a07 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + + + echo "Class Foo loaded." + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml new file mode 100644 index 00000000..8db899d6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml @@ -0,0 +1,29 @@ + + + + + + + doBar() + { + } +} + ]]> + + + do_bar() + { + } +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php new file mode 100644 index 00000000..e3f626b3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php @@ -0,0 +1,75 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ClassDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param integer $stackPtr The position of the current token in + * the token stack. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $errorData = [strtolower($tokens[$stackPtr]['content'])]; + + $nextClass = $phpcsFile->findNext([T_CLASS, T_INTERFACE, T_TRAIT, T_ENUM], ($tokens[$stackPtr]['scope_closer'] + 1)); + if ($nextClass !== false) { + $error = 'Each %s must be in a file by itself'; + $phpcsFile->addError($error, $nextClass, 'MultipleClasses', $errorData); + $phpcsFile->recordMetric($stackPtr, 'One class per file', 'no'); + } else { + $phpcsFile->recordMetric($stackPtr, 'One class per file', 'yes'); + } + + $namespace = $phpcsFile->findNext([T_NAMESPACE, T_CLASS, T_INTERFACE, T_TRAIT, T_ENUM], 0); + if ($tokens[$namespace]['code'] !== T_NAMESPACE) { + $error = 'Each %s must be in a namespace of at least one level (a top-level vendor name)'; + $phpcsFile->addError($error, $stackPtr, 'MissingNamespace', $errorData); + $phpcsFile->recordMetric($stackPtr, 'Class defined in namespace', 'no'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Class defined in namespace', 'yes'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php new file mode 100644 index 00000000..68a18d8c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php @@ -0,0 +1,303 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class SideEffectsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the token stack. + * + * @return int + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $result = $this->searchForConflict($phpcsFile, 0, ($phpcsFile->numTokens - 1), $tokens); + + if ($result['symbol'] !== null && $result['effect'] !== null) { + $error = 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line %s and the first side effect is on line %s.'; + $data = [ + $tokens[$result['symbol']]['line'], + $tokens[$result['effect']]['line'], + ]; + $phpcsFile->addWarning($error, 0, 'FoundWithSymbols', $data); + $phpcsFile->recordMetric($stackPtr, 'Declarations and side effects mixed', 'yes'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Declarations and side effects mixed', 'no'); + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + + /** + * Searches for symbol declarations and side effects. + * + * Returns the positions of both the first symbol declared and the first + * side effect in the file. A NULL value for either indicates nothing was + * found. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $start The token to start searching from. + * @param int $end The token to search to. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return array + */ + private function searchForConflict($phpcsFile, $start, $end, $tokens) + { + $symbols = [ + T_CLASS => T_CLASS, + T_INTERFACE => T_INTERFACE, + T_TRAIT => T_TRAIT, + T_ENUM => T_ENUM, + T_FUNCTION => T_FUNCTION, + ]; + + $conditions = [ + T_IF => T_IF, + T_ELSE => T_ELSE, + T_ELSEIF => T_ELSEIF, + ]; + + $checkAnnotations = $phpcsFile->config->annotations; + + $firstSymbol = null; + $firstEffect = null; + for ($i = $start; $i <= $end; $i++) { + // Respect phpcs:disable comments. + if ($checkAnnotations === true + && $tokens[$i]['code'] === T_PHPCS_DISABLE + && (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.FoundWithSymbols']) === true) + ) { + do { + $i = $phpcsFile->findNext(T_PHPCS_ENABLE, ($i + 1)); + } while ($i !== false + && 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.FoundWithSymbols']) === false); + + if ($i === false) { + // The entire rest of the file is disabled, + // so return what we have so far. + break; + } + + continue; + } + + // Ignore whitespace and comments. + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { + continue; + } + + // Ignore PHP tags. + if ($tokens[$i]['code'] === T_OPEN_TAG + || $tokens[$i]['code'] === T_CLOSE_TAG + ) { + continue; + } + + // Ignore shebang. + if (substr($tokens[$i]['content'], 0, 2) === '#!') { + continue; + } + + // Ignore logical operators. + if (isset(Tokens::$booleanOperators[$tokens[$i]['code']]) === true) { + continue; + } + + // Ignore entire namespace, declare, const and use statements. + if ($tokens[$i]['code'] === T_NAMESPACE + || $tokens[$i]['code'] === T_USE + || $tokens[$i]['code'] === T_DECLARE + || $tokens[$i]['code'] === T_CONST + ) { + if (isset($tokens[$i]['scope_opener']) === true) { + $i = $tokens[$i]['scope_closer']; + if ($tokens[$i]['code'] === T_ENDDECLARE) { + $semicolon = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); + if ($semicolon !== false && $tokens[$semicolon]['code'] === T_SEMICOLON) { + $i = $semicolon; + } + } + } else { + $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($i + 1)); + if ($semicolon !== false) { + $i = $semicolon; + } + } + + continue; + } + + // Ignore function/class prefixes. + if (isset(Tokens::$methodPrefixes[$tokens[$i]['code']]) === true + || $tokens[$i]['code'] === T_READONLY + ) { + continue; + } + + // Ignore anon classes. + if ($tokens[$i]['code'] === T_ANON_CLASS) { + $i = $tokens[$i]['scope_closer']; + continue; + } + + // Ignore attributes. + if ($tokens[$i]['code'] === T_ATTRIBUTE + && isset($tokens[$i]['attribute_closer']) === true + ) { + $i = $tokens[$i]['attribute_closer']; + continue; + } + + // Detect and skip over symbols. + if (isset($symbols[$tokens[$i]['code']]) === true + && isset($tokens[$i]['scope_closer']) === true + ) { + if ($firstSymbol === null) { + $firstSymbol = $i; + } + + $i = $tokens[$i]['scope_closer']; + continue; + } else if ($tokens[$i]['code'] === T_STRING + && strtolower($tokens[$i]['content']) === 'define' + ) { + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), null, true); + if ($tokens[$prev]['code'] !== T_OBJECT_OPERATOR + && $tokens[$prev]['code'] !== T_NULLSAFE_OBJECT_OPERATOR + && $tokens[$prev]['code'] !== T_DOUBLE_COLON + && $tokens[$prev]['code'] !== T_FUNCTION + ) { + if ($firstSymbol === null) { + $firstSymbol = $i; + } + + $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($i + 1)); + if ($semicolon !== false) { + $i = $semicolon; + } + + continue; + } + }//end if + + // Special case for defined() as it can be used to see + // if a constant (a symbol) should be defined or not and + // doesn't need to use a full conditional block. + if ($tokens[$i]['code'] === T_STRING + && strtolower($tokens[$i]['content']) === 'defined' + ) { + $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); + if ($openBracket !== false + && $tokens[$openBracket]['code'] === T_OPEN_PARENTHESIS + && isset($tokens[$openBracket]['parenthesis_closer']) === true + ) { + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), null, true); + if ($tokens[$prev]['code'] !== T_OBJECT_OPERATOR + && $tokens[$prev]['code'] !== T_NULLSAFE_OBJECT_OPERATOR + && $tokens[$prev]['code'] !== T_DOUBLE_COLON + && $tokens[$prev]['code'] !== T_FUNCTION + ) { + $i = $tokens[$openBracket]['parenthesis_closer']; + continue; + } + } + }//end if + + // Conditional statements are allowed in symbol files as long as the + // contents is only a symbol definition. So don't count these as effects + // in this case. + if (isset($conditions[$tokens[$i]['code']]) === true) { + if (isset($tokens[$i]['scope_opener']) === false) { + // Probably an "else if", so just ignore. + continue; + } + + $result = $this->searchForConflict( + $phpcsFile, + ($tokens[$i]['scope_opener'] + 1), + ($tokens[$i]['scope_closer'] - 1), + $tokens + ); + + if ($result['symbol'] !== null) { + if ($firstSymbol === null) { + $firstSymbol = $result['symbol']; + } + + if ($result['effect'] !== null) { + // Found a conflict. + $firstEffect = $result['effect']; + break; + } + } + + if ($firstEffect === null) { + $firstEffect = $result['effect']; + } + + $i = $tokens[$i]['scope_closer']; + continue; + }//end if + + if ($firstEffect === null) { + $firstEffect = $i; + } + + if ($firstSymbol !== null) { + // We have a conflict we have to report, so no point continuing. + break; + } + }//end for + + return [ + 'symbol' => $firstSymbol, + 'effect' => $firstEffect, + ]; + + }//end searchForConflict() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php new file mode 100644 index 00000000..0cf1022f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php @@ -0,0 +1,91 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff as GenericCamelCapsFunctionNameSniff; +use PHP_CodeSniffer\Util\Common; + +class CamelCapsMethodNameSniff extends GenericCamelCapsFunctionNameSniff +{ + + + /** + * Processes the tokens within the scope. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. + * @param int $stackPtr The position where this token was + * found. + * @param int $currScope The position of the current scope. + * + * @return void + */ + protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + // Determine if this is a function which needs to be examined. + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + $deepestScope = key($conditions); + if ($deepestScope !== $currScope) { + return; + } + + $methodName = $phpcsFile->getDeclarationName($stackPtr); + if ($methodName === null) { + // Ignore closures. + return; + } + + // Ignore magic methods. + if (preg_match('|^__[^_]|', $methodName) !== 0) { + $magicPart = strtolower(substr($methodName, 2)); + if (isset($this->magicMethods[$magicPart]) === true + || isset($this->methodsDoubleUnderscore[$magicPart]) === true + ) { + return; + } + } + + $testName = ltrim($methodName, '_'); + if ($testName !== '' && Common::isCamelCaps($testName, false, true, false) === false) { + $error = 'Method name "%s" is not in camel caps format'; + $className = $phpcsFile->getDeclarationName($currScope); + if (isset($className) === false) { + $className = '[Anonymous Class]'; + } + + $errorData = [$className.'::'.$methodName]; + $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); + $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'no'); + } else { + $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); + } + + }//end processTokenWithinScope() + + + /** + * Processes the tokens outside the scope. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. + * @param int $stackPtr The position where this token was + * found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + + }//end processTokenOutsideScope() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc new file mode 100644 index 00000000..58cb85e3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc @@ -0,0 +1,3 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR1\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff + */ +final class ClassDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + if ($testFile === 'ClassDeclarationUnitTest.2.inc') { + return []; + } + + return [ + 2 => 1, + 3 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc new file mode 100644 index 00000000..b7e1dc9a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc @@ -0,0 +1,87 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc new file mode 100644 index 00000000..63f256d4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc @@ -0,0 +1,8 @@ +define("MAXSIZE", 100); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc new file mode 100644 index 00000000..9499885b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc @@ -0,0 +1,2 @@ +define("MAXSIZE", 100); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc new file mode 100644 index 00000000..0500d10e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc @@ -0,0 +1,2 @@ +defined('MINSIZE') or define("MAXSIZE", 100); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc new file mode 100644 index 00000000..588ece58 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc @@ -0,0 +1,2 @@ +defined('MINSIZE') or define("MAXSIZE", 100); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc new file mode 100644 index 00000000..ec81bfed --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc @@ -0,0 +1,8 @@ +define(); +echo $object -> define(); +Foo::define(); + +$c = new class extends Something{ + + public function someMethod() + { + // ... + } + +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc new file mode 100644 index 00000000..d4ae77ee --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc @@ -0,0 +1,6 @@ + +'; +} + +printHead(); +?> + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc new file mode 100644 index 00000000..7265c637 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc @@ -0,0 +1,2 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc new file mode 100644 index 00000000..e02fed4b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc @@ -0,0 +1,9 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR1\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SideEffects sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff + */ +final class SideEffectsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Set CLI values before the file is tested. + * + * @param string $testFile The name of the file being tested. + * @param \PHP_CodeSniffer\Config $config The config data for the test run. + * + * @return void + */ + public function setCliValues($testFile, $config) + { + if ($testFile === 'SideEffectsUnitTest.12.inc') { + $config->annotations = false; + } + + }//end setCliValues() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + return []; + + }//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($testFile='') + { + switch ($testFile) { + case 'SideEffectsUnitTest.3.inc': + case 'SideEffectsUnitTest.4.inc': + case 'SideEffectsUnitTest.5.inc': + case 'SideEffectsUnitTest.10.inc': + case 'SideEffectsUnitTest.12.inc': + case 'SideEffectsUnitTest.15.inc': + case 'SideEffectsUnitTest.16.inc': + return [1 => 1]; + default: + return []; + }//end switch + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc new file mode 100644 index 00000000..7381517f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc @@ -0,0 +1,81 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR1\Tests\Methods; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the CamelCapsMethodName sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff + */ +final class CamelCapsMethodNameUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 6 => 1, + 7 => 1, + 11 => 1, + 12 => 1, + 13 => 1, + 17 => 1, + 21 => 1, + 25 => 1, + 26 => 1, + 77 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml new file mode 100644 index 00000000..65cbe20e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml @@ -0,0 +1,47 @@ + + + The PSR1 coding standard. + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml new file mode 100644 index 00000000..ae24611d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClosingBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClosingBraceStandard.xml new file mode 100644 index 00000000..b59d734f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClosingBraceStandard.xml @@ -0,0 +1,35 @@ + + + + + + + + +function bar() +{ + // Function content. +} + ]]> + + + echo 'Hello!'; + +function bar() +{ + // Function content. +} //end bar() + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/OpeningBraceSpaceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/OpeningBraceSpaceStandard.xml new file mode 100644 index 00000000..818bbe83 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/OpeningBraceSpaceStandard.xml @@ -0,0 +1,32 @@ + + + + + + + + public function bar() + { + // Method content. + } +} + ]]> + + + + public function bar() + { + // Method content. + } +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/BooleanOperatorPlacementStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/BooleanOperatorPlacementStandard.xml new file mode 100644 index 00000000..805e15c6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/BooleanOperatorPlacementStandard.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/ControlStructureSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/ControlStructureSpacingStandard.xml new file mode 100644 index 00000000..db4fe802 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/ControlStructureSpacingStandard.xml @@ -0,0 +1,124 @@ + + + + + + + ($expr) { +} + ]]> + + + ( $expr) { +} + ]]> + + + + + ($expr) { +} + ]]> + + + ) { +} + ]]> + + + + + + + + $expr1 + && $expr2 +) { +} + ]]> + + + ($expr1 + && $expr2 +) { +} + ]]> + + + + + $expr1 + && $expr2 +) { +} + ]]> + + + $expr1 + && $expr2 + && $expr3 +) { +} + ]]> + + + + + + + + ) { +} + ]]> + + + && $expr2) { +} + ]]> + + + + + ) { +} + ]]> + + + ) { +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/ImportStatementStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/ImportStatementStandard.xml new file mode 100644 index 00000000..66b58de0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/ImportStatementStandard.xml @@ -0,0 +1,33 @@ + + + + + + + + + + \Vendor\Package\ClassA as A; + +class FooBar extends A +{ + // Class content. +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/OpenTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/OpenTagStandard.xml new file mode 100644 index 00000000..20db18b2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/OpenTagStandard.xml @@ -0,0 +1,40 @@ + + + + + + + + +echo 'hi'; + ]]> + + + echo 'hi'; + ]]> + + + + + + + + + + + ]]> + + + + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml new file mode 100644 index 00000000..ac411ffb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/ReturnTypeDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/ReturnTypeDeclarationStandard.xml new file mode 100644 index 00000000..000459c3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/ReturnTypeDeclarationStandard.xml @@ -0,0 +1,41 @@ + + + + + + + string { + // Closure body. +}; + ]]> + + + string { + // Closure body. +}; + ]]> + + + + + : string { + // Function body. +}; + ]]> + + + : string { + // Function body. +}; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml new file mode 100644 index 00000000..9bb5a8a5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml @@ -0,0 +1,19 @@ + + + + + + + + + + (boolean) $isValid; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml new file mode 100644 index 00000000..b74e8b42 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml @@ -0,0 +1,28 @@ + + + + + + + + + + SubnamespaceOne\AnotherNamespace\ClassA, + SubnamespaceOne\ClassB, + ClassZ, +}; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml new file mode 100644 index 00000000..981b1d97 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml @@ -0,0 +1,27 @@ + + + + + + + $b) { + $variable = $foo ? 'foo' : 'bar'; +} + ]]> + + + $b) { + $variable=$foo?'foo':'bar'; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml new file mode 100644 index 00000000..da9b60a4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml @@ -0,0 +1,27 @@ + + + + + + + private const BAR = 'bar'; +} + ]]> + + + const BAR = 'bar'; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php new file mode 100644 index 00000000..552bfea4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php @@ -0,0 +1,246 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff; +use PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff; +use PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff; +use PHP_CodeSniffer\Util\Tokens; + +class AnonClassDeclarationSniff extends ClassDeclarationSniff +{ + + /** + * The PSR2 MultiLineFunctionDeclarations sniff. + * + * @var \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff + */ + private $multiLineSniff = null; + + /** + * The Generic FunctionCallArgumentSpacing sniff. + * + * @var \PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff + */ + private $functionCallSniff = null; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_ANON_CLASS]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + $this->multiLineSniff = new MultiLineFunctionDeclarationSniff(); + $this->functionCallSniff = new FunctionCallArgumentSpacingSniff(); + + $this->processOpen($phpcsFile, $stackPtr); + $this->processClose($phpcsFile, $stackPtr); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === true) { + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + if ($this->multiLineSniff->isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { + $this->processMultiLineArgumentList($phpcsFile, $stackPtr); + } else { + $this->processSingleLineArgumentList($phpcsFile, $stackPtr); + } + + $this->functionCallSniff->checkSpacing($phpcsFile, $stackPtr, $openBracket); + } + + $opener = $tokens[$stackPtr]['scope_opener']; + if ($tokens[$opener]['line'] === $tokens[$stackPtr]['line']) { + return; + } + + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), $stackPtr, true); + + $implements = $phpcsFile->findPrevious(T_IMPLEMENTS, ($opener - 1), $stackPtr); + if ($implements !== false + && $tokens[$opener]['line'] !== $tokens[$implements]['line'] + && $tokens[$opener]['line'] === $tokens[$prev]['line'] + ) { + // Opening brace must be on a new line as implements list wraps. + $error = 'Opening brace must be on the line after the last implemented interface'; + $fix = $phpcsFile->addFixableError($error, $opener, 'OpenBraceSameLine'); + if ($fix === true) { + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); + $indent = str_repeat(' ', ($tokens[$first]['column'] - 1)); + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[($prev + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($prev + 1), ''); + } + + $phpcsFile->fixer->addNewline($prev); + $phpcsFile->fixer->addContentBefore($opener, $indent); + $phpcsFile->fixer->endChangeset(); + } + } + + if ($tokens[$opener]['line'] > ($tokens[$prev]['line'] + 1)) { + // Opening brace is on a new line, so there must be no blank line before it. + $error = 'Opening brace must not be preceded by a blank line'; + $fix = $phpcsFile->addFixableError($error, $opener, 'OpenBraceLine'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($prev + 1); $x < $opener; $x++) { + if ($tokens[$x]['line'] === $tokens[$prev]['line']) { + // Maintain existing newline. + continue; + } + + if ($tokens[$x]['line'] === $tokens[$opener]['line']) { + // Maintain existing indent. + break; + } + + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + + }//end process() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 processSingleLineArgumentList(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + if ($openBracket === ($closeBracket - 1)) { + return; + } + + if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { + $error = 'Space after opening parenthesis of single-line argument list prohibited'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); + } + } + + $spaceBeforeClose = 0; + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), $openBracket, true); + if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) { + // Need a newline after these tokens, so ignore this rule. + return; + } + + if ($tokens[$prev]['line'] !== $tokens[$closeBracket]['line']) { + $spaceBeforeClose = 'newline'; + } else if ($tokens[($closeBracket - 1)]['code'] === T_WHITESPACE) { + $spaceBeforeClose = $tokens[($closeBracket - 1)]['length']; + } + + if ($spaceBeforeClose !== 0) { + $error = 'Space before closing parenthesis of single-line argument list prohibited'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeCloseBracket'); + if ($fix === true) { + if ($spaceBeforeClose === 'newline') { + $phpcsFile->fixer->beginChangeset(); + + $closingContent = ')'; + + $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true); + if ($tokens[$next]['code'] === T_SEMICOLON) { + $closingContent .= ';'; + for ($i = ($closeBracket + 1); $i <= $next; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + + // We want to jump over any whitespace or inline comment and + // move the closing parenthesis after any other token. + $prev = ($closeBracket - 1); + while (isset(Tokens::$emptyTokens[$tokens[$prev]['code']]) === true) { + if (($tokens[$prev]['code'] === T_COMMENT) + && (strpos($tokens[$prev]['content'], '*/') !== false) + ) { + break; + } + + $prev--; + } + + $phpcsFile->fixer->addContent($prev, $closingContent); + + $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true); + for ($i = ($prevNonWhitespace + 1); $i <= $closeBracket; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($closeBracket - 1), ''); + }//end if + }//end if + }//end if + + }//end processSingleLineArgumentList() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 processMultiLineArgumentList(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + + $this->multiLineSniff->processBracket($phpcsFile, $openBracket, $tokens, 'argument'); + $this->multiLineSniff->processArgumentList($phpcsFile, $stackPtr, $this->indent, 'argument'); + + }//end processMultiLineArgumentList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php new file mode 100644 index 00000000..048cb60c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php @@ -0,0 +1,112 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ClassInstantiationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_NEW]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Find the class name. + $allowed = [ + T_STRING => T_STRING, + T_NS_SEPARATOR => T_NS_SEPARATOR, + T_SELF => T_SELF, + T_STATIC => T_STATIC, + T_PARENT => T_PARENT, + T_VARIABLE => T_VARIABLE, + T_DOLLAR => T_DOLLAR, + T_OBJECT_OPERATOR => T_OBJECT_OPERATOR, + T_NULLSAFE_OBJECT_OPERATOR => T_NULLSAFE_OBJECT_OPERATOR, + T_DOUBLE_COLON => T_DOUBLE_COLON, + ]; + + $allowed += Tokens::$emptyTokens; + + $classNameEnd = null; + for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { + if (isset($allowed[$tokens[$i]['code']]) === true) { + continue; + } + + // Bow out when this is an anonymous class. + // Anonymous classes are the only situation which would allow for an attribute + // or for the readonly keyword between "new" and the class "name". + if ($tokens[$i]['code'] === T_ATTRIBUTE + || $tokens[$i]['code'] === T_READONLY + || $tokens[$i]['code'] === T_ANON_CLASS + ) { + return; + } + + if ($tokens[$i]['code'] === T_OPEN_SQUARE_BRACKET + || $tokens[$i]['code'] === T_OPEN_CURLY_BRACKET + ) { + $i = $tokens[$i]['bracket_closer']; + continue; + } + + $classNameEnd = $i; + break; + }//end for + + if ($classNameEnd === null) { + return; + } + + if ($tokens[$classNameEnd]['code'] === T_OPEN_PARENTHESIS) { + // Using parenthesis. + return; + } + + if ($classNameEnd === $stackPtr) { + // Failed to find the class name. + return; + } + + $error = 'Parentheses must be used when instantiating a new class'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MissingParentheses'); + if ($fix === true) { + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($classNameEnd - 1), null, true); + $phpcsFile->fixer->addContent($prev, '()'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php new file mode 100644 index 00000000..82f215f6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php @@ -0,0 +1,67 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ClosingBraceSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + T_FUNCTION, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $closer = $tokens[$stackPtr]['scope_closer']; + $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), null, true); + if ($next === false + || $tokens[$next]['line'] !== $tokens[$closer]['line'] + ) { + return; + } + + $error = 'Closing brace must not be followed by any comment or statement on the same line'; + $phpcsFile->addError($error, $closer, 'StatementAfter'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php new file mode 100644 index 00000000..261f7022 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php @@ -0,0 +1,80 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class OpeningBraceSpaceSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$ooScopeTokens; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + $opener = $tokens[$stackPtr]['scope_opener']; + $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); + if ($next === false + || $tokens[$next]['line'] <= ($tokens[$opener]['line'] + 1) + ) { + return; + } + + $error = 'Opening brace must not be followed by a blank line'; + $fix = $phpcsFile->addFixableError($error, $opener, 'Found'); + if ($fix === false) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + for ($i = ($opener + 1); $i < $next; $i++) { + if ($tokens[$i]['line'] === $tokens[$opener]['line']) { + continue; + } + + if ($tokens[$i]['line'] === $tokens[$next]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php new file mode 100644 index 00000000..dabb3187 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php @@ -0,0 +1,229 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class BooleanOperatorPlacementSniff implements Sniff +{ + + /** + * Used to restrict the placement of the boolean operator. + * + * Allowed value are "first" or "last". + * + * @var string|null + */ + public $allowOnly = null; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_IF, + T_WHILE, + T_SWITCH, + T_ELSEIF, + T_MATCH, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false + || isset($tokens[$stackPtr]['parenthesis_closer']) === false + ) { + return; + } + + $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; + $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; + + if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line']) { + // Conditions are all on the same line. + return; + } + + $find = [ + T_BOOLEAN_AND, + T_BOOLEAN_OR, + ]; + + if ($this->allowOnly === 'first' || $this->allowOnly === 'last') { + $position = $this->allowOnly; + } else { + $position = null; + } + + $operator = $parenOpener; + $error = false; + $operators = []; + + do { + $operator = $phpcsFile->findNext($find, ($operator + 1), $parenCloser); + if ($operator === false) { + break; + } + + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($operator - 1), $parenOpener, true); + if ($prev === false) { + // Parse error. + return; + } + + $next = $phpcsFile->findNext(T_WHITESPACE, ($operator + 1), $parenCloser, true); + if ($next === false) { + // Parse error. + return; + } + + $firstOnLine = false; + $lastOnLine = false; + + if ($tokens[$prev]['line'] < $tokens[$operator]['line']) { + // The boolean operator is the first content on the line. + $firstOnLine = true; + } + + if ($tokens[$next]['line'] > $tokens[$operator]['line']) { + // The boolean operator is the last content on the line. + $lastOnLine = true; + } + + if ($firstOnLine === true && $lastOnLine === true) { + // The operator is the only content on the line. + // Don't record it because we can't determine + // placement information from looking at it. + continue; + } + + $operators[] = $operator; + + if ($firstOnLine === false && $lastOnLine === false) { + // It's in the middle of content, so we can't determine + // placement information from looking at it, but we may + // still need to process it. + continue; + } + + if ($firstOnLine === true) { + if ($position === null) { + $position = 'first'; + } + + if ($position !== 'first') { + $error = true; + } + } else { + if ($position === null) { + $position = 'last'; + } + + if ($position !== 'last') { + $error = true; + } + } + } while ($operator !== false); + + if ($error === false) { + return; + } + + switch ($this->allowOnly) { + case 'first': + $error = 'Boolean operators between conditions must be at the beginning of the line'; + break; + case 'last': + $error = 'Boolean operators between conditions must be at the end of the line'; + break; + default: + $error = 'Boolean operators between conditions must be at the beginning or end of the line, but not both'; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundMixed'); + if ($fix === false) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + foreach ($operators as $operator) { + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($operator - 1), $parenOpener, true); + $next = $phpcsFile->findNext(T_WHITESPACE, ($operator + 1), $parenCloser, true); + + if ($position === 'last') { + if ($tokens[$next]['line'] === $tokens[$operator]['line']) { + if ($tokens[$prev]['line'] === $tokens[$operator]['line']) { + // Move the content after the operator to the next line. + if ($tokens[($operator + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($operator + 1), ''); + } + + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $operator, true); + $padding = str_repeat(' ', ($tokens[$first]['column'] - 1)); + $phpcsFile->fixer->addContent($operator, $phpcsFile->eolChar.$padding); + } else { + // Move the operator to the end of the previous line. + if ($tokens[($operator + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($operator + 1), ''); + } + + $phpcsFile->fixer->addContent($prev, ' '.$tokens[$operator]['content']); + $phpcsFile->fixer->replaceToken($operator, ''); + } + }//end if + } else { + if ($tokens[$prev]['line'] === $tokens[$operator]['line']) { + if ($tokens[$next]['line'] === $tokens[$operator]['line']) { + // Move the operator, and the rest of the expression, to the next line. + if ($tokens[($operator - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($operator - 1), ''); + } + + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $operator, true); + $padding = str_repeat(' ', ($tokens[$first]['column'] - 1)); + $phpcsFile->fixer->addContentBefore($operator, $phpcsFile->eolChar.$padding); + } else { + // Move the operator to the start of the next line. + if ($tokens[($operator - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($operator - 1), ''); + } + + $phpcsFile->fixer->addContentBefore($next, $tokens[$operator]['content'].' '); + $phpcsFile->fixer->replaceToken($operator, ''); + } + }//end if + }//end if + }//end foreach + + $phpcsFile->fixer->endChangeset(); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php new file mode 100644 index 00000000..9a200aa8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php @@ -0,0 +1,207 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff as PSR2ControlStructureSpacing; +use PHP_CodeSniffer\Util\Tokens; + +class ControlStructureSpacingSniff implements Sniff +{ + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + /** + * Instance of the PSR2 ControlStructureSpacingSniff sniff. + * + * @var \PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff + */ + private $psr2ControlStructureSpacing; + + + /** + * Constructor. + */ + public function __construct() + { + $this->psr2ControlStructureSpacing = new PSR2ControlStructureSpacing(); + + }//end __construct() + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_IF, + T_WHILE, + T_FOREACH, + T_FOR, + T_SWITCH, + T_ELSEIF, + T_CATCH, + T_MATCH, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false + || isset($tokens[$stackPtr]['parenthesis_closer']) === false + ) { + return; + } + + $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; + $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; + + if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line']) { + // Conditions are all on the same line, so follow PSR2. + return $this->psr2ControlStructureSpacing->process($phpcsFile, $stackPtr); + } + + $next = $phpcsFile->findNext(T_WHITESPACE, ($parenOpener + 1), $parenCloser, true); + if ($next === false) { + // No conditions; parse error. + return; + } + + // Check the first expression. + if ($tokens[$next]['line'] !== ($tokens[$parenOpener]['line'] + 1)) { + $error = 'The first expression of a multi-line control structure must be on the line after the opening parenthesis'; + $fix = $phpcsFile->addFixableError($error, $next, 'FirstExpressionLine'); + if ($fix === true) { + $phpcsFile->fixer->addNewline($parenOpener); + } + } + + // Check the indent of each line. + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); + $requiredIndent = ($tokens[$first]['column'] + $this->indent - 1); + for ($i = $parenOpener; $i < $parenCloser; $i++) { + if ($tokens[$i]['column'] !== 1 + || $tokens[($i + 1)]['line'] > $tokens[$i]['line'] + || isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true + ) { + continue; + } + + if (($i + 1) === $parenCloser) { + break; + } + + // Leave indentation inside multi-line strings. + if (isset(Tokens::$textStringTokens[$tokens[$i]['code']]) === true + || isset(Tokens::$heredocTokens[$tokens[$i]['code']]) === true + ) { + continue; + } + + if ($tokens[$i]['code'] !== T_WHITESPACE) { + $foundIndent = 0; + } else { + $foundIndent = $tokens[$i]['length']; + } + + if ($foundIndent < $requiredIndent) { + $error = 'Each line in a multi-line control structure must be indented at least once; expected at least %s spaces, but found %s'; + $data = [ + $requiredIndent, + $foundIndent, + ]; + $fix = $phpcsFile->addFixableError($error, $i, 'LineIndent', $data); + if ($fix === true) { + $padding = str_repeat(' ', $requiredIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($i, $padding); + } else { + $phpcsFile->fixer->replaceToken($i, $padding); + } + } + } + }//end for + + // Check the closing parenthesis. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($parenCloser - 1), $parenOpener, true); + if ($tokens[$parenCloser]['line'] !== ($tokens[$prev]['line'] + 1)) { + $error = 'The closing parenthesis of a multi-line control structure must be on the line after the last expression'; + $fix = $phpcsFile->addFixableError($error, $parenCloser, 'CloseParenthesisLine'); + if ($fix === true) { + if ($tokens[$parenCloser]['line'] === $tokens[$prev]['line']) { + $phpcsFile->fixer->addNewlineBefore($parenCloser); + } else { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prev + 1); $i < $parenCloser; $i++) { + // Maintain existing newline. + if ($tokens[$i]['line'] === $tokens[$prev]['line']) { + continue; + } + + // Maintain existing indent. + if ($tokens[$i]['line'] === $tokens[$parenCloser]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + + if ($tokens[$parenCloser]['line'] !== $tokens[$prev]['line']) { + $requiredIndent = ($tokens[$first]['column'] - 1); + $foundIndent = ($tokens[$parenCloser]['column'] - 1); + if ($foundIndent !== $requiredIndent) { + $error = 'The closing parenthesis of a multi-line control structure must be indented to the same level as start of the control structure; expected %s spaces but found %s'; + $data = [ + $requiredIndent, + $foundIndent, + ]; + $fix = $phpcsFile->addFixableError($error, $parenCloser, 'CloseParenthesisIndent', $data); + if ($fix === true) { + $padding = str_repeat(' ', $requiredIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($parenCloser, $padding); + } else { + $phpcsFile->fixer->replaceToken(($parenCloser - 1), $padding); + } + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php new file mode 100644 index 00000000..d9615f9a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php @@ -0,0 +1,262 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class DeclareStatementSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_DECLARE]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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) + { + // Allow a byte-order mark. + $tokens = $phpcsFile->getTokens(); + + // There should be no space between declare keyword and opening parenthesis. + $parenthesis = ($stackPtr + 1); + if ($tokens[($stackPtr + 1)]['type'] !== 'T_OPEN_PARENTHESIS') { + $parenthesis = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + $error = 'Expected no space between declare keyword and opening parenthesis in a declare statement'; + + if ($tokens[$parenthesis]['type'] === 'T_OPEN_PARENTHESIS') { + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceFoundAfterDeclare'); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + } else { + $phpcsFile->addError($error, $parenthesis, 'SpaceFoundAfterDeclare'); + $parenthesis = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($parenthesis + 1)); + } + } + + // There should be no space between open parenthesis and the directive. + $string = $phpcsFile->findNext(T_WHITESPACE, ($parenthesis + 1), null, true); + if ($parenthesis !== false) { + if ($tokens[($parenthesis + 1)]['type'] !== 'T_STRING') { + $error = 'Expected no space between opening parenthesis and directive in a declare statement'; + + if ($tokens[$string]['type'] === 'T_STRING') { + $fix = $phpcsFile->addFixableError($error, $parenthesis, 'SpaceFoundBeforeDirective'); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($parenthesis + 1), ''); + } + } else { + $phpcsFile->addError($error, $string, 'SpaceFoundBeforeDirective'); + $string = $phpcsFile->findNext(T_STRING, ($string + 1)); + } + } + } + + // There should be no space between directive and the equal sign. + $equals = $phpcsFile->findNext(T_WHITESPACE, ($string + 1), null, true); + if ($string !== false) { + // The directive must be in lowercase. + if ($tokens[$string]['content'] !== strtolower($tokens[$string]['content'])) { + $error = 'The directive of a declare statement must be in lowercase'; + $fix = $phpcsFile->addFixableError($error, $string, 'DirectiveNotLowercase'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($string, strtolower($tokens[$string]['content'])); + } + } + + if ($tokens[($string + 1)]['type'] !== 'T_EQUAL') { + $error = 'Expected no space between directive and the equals sign in a declare statement'; + + if ($tokens[$equals]['type'] === 'T_EQUAL') { + $fix = $phpcsFile->addFixableError($error, $equals, 'SpaceFoundAfterDirective'); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($string + 1), ''); + } + } else { + $phpcsFile->addError($error, $equals, 'SpaceFoundAfterDirective'); + $equals = $phpcsFile->findNext(T_EQUAL, ($equals + 1)); + } + } + }//end if + + // There should be no space between equal sign and directive value. + $value = $phpcsFile->findNext(T_WHITESPACE, ($equals + 1), null, true); + + if ($value === false) { + // Live coding / parse error. + return; + } + + if ($equals !== false) { + if ($tokens[($equals + 1)]['type'] !== 'T_LNUMBER') { + $error = 'Expected no space between equal sign and the directive value in a declare statement'; + + if ($tokens[$value]['type'] === 'T_LNUMBER') { + $fix = $phpcsFile->addFixableError($error, $value, 'SpaceFoundBeforeDirectiveValue'); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($equals + 1), ''); + } + } else { + $phpcsFile->addError($error, $value, 'SpaceFoundBeforeDirectiveValue'); + $value = $phpcsFile->findNext(T_LNUMBER, ($value + 1)); + } + } + } + + $parenthesis = $phpcsFile->findNext(T_WHITESPACE, ($value + 1), null, true); + if ($value !== false) { + if ($tokens[($value + 1)]['type'] !== 'T_CLOSE_PARENTHESIS') { + $error = 'Expected no space between the directive value and closing parenthesis in a declare statement'; + + if ($tokens[$parenthesis]['type'] === 'T_CLOSE_PARENTHESIS') { + $fix = $phpcsFile->addFixableError($error, $parenthesis, 'SpaceFoundAfterDirectiveValue'); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($value + 1), ''); + } + } else { + $phpcsFile->addError($error, $parenthesis, 'SpaceFoundAfterDirectiveValue'); + $parenthesis = $phpcsFile->findNext(T_CLOSE_PARENTHESIS, ($parenthesis + 1)); + } + } + } + + // Check for semicolon. + $curlyBracket = false; + if ($tokens[($parenthesis + 1)]['type'] !== 'T_SEMICOLON') { + $token = $phpcsFile->findNext(T_WHITESPACE, ($parenthesis + 1), null, true); + + if ($tokens[$token]['type'] === 'T_OPEN_CURLY_BRACKET') { + // Block declaration. + $curlyBracket = $token; + } else if ($tokens[$token]['type'] === 'T_SEMICOLON') { + $error = 'Expected no space between the closing parenthesis and the semicolon in a declare statement'; + $fix = $phpcsFile->addFixableError($error, $parenthesis, 'SpaceFoundBeforeSemicolon'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($parenthesis + 1), ''); + } + } else if ($tokens[$token]['type'] === 'T_CLOSE_TAG') { + if ($tokens[($parenthesis)]['line'] !== $tokens[$token]['line']) { + // Close tag must be on the same line.. + $error = 'The close tag must be on the same line as the declare statement'; + $fix = $phpcsFile->addFixableError($error, $parenthesis, 'CloseTagOnNewLine'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($parenthesis + 1), ' '); + } + } + } else { + $error = 'Expected no space between the closing parenthesis and the semicolon in a declare statement'; + $phpcsFile->addError($error, $parenthesis, 'SpaceFoundBeforeSemicolon'); + + // See if there is a semicolon or curly bracket after this token. + $token = $phpcsFile->findNext([T_WHITESPACE, T_COMMENT], ($token + 1), null, true); + if ($tokens[$token]['type'] === 'T_OPEN_CURLY_BRACKET') { + $curlyBracket = $token; + } + }//end if + }//end if + + if ($curlyBracket !== false) { + $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($curlyBracket - 1), null, true); + $error = 'Expected one space between closing parenthesis and opening curly bracket in a declare statement'; + + // The opening curly bracket must on the same line with a single space between closing bracket. + if ($tokens[$prevToken]['type'] !== 'T_CLOSE_PARENTHESIS') { + $phpcsFile->addError($error, $curlyBracket, 'ExtraSpaceFoundAfterBracket'); + } else if ($phpcsFile->getTokensAsString(($prevToken + 1), ($curlyBracket - $prevToken - 1)) !== ' ') { + $fix = $phpcsFile->addFixableError($error, $curlyBracket, 'ExtraSpaceFoundAfterBracket'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken(($prevToken + 1), ' '); + $nextToken = ($prevToken + 2); + while ($nextToken !== $curlyBracket) { + $phpcsFile->fixer->replaceToken($nextToken, ''); + $nextToken++; + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + + $closeCurlyBracket = $tokens[$curlyBracket]['bracket_closer']; + + $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($closeCurlyBracket - 1), null, true); + $nextToken = $phpcsFile->findNext([T_WHITESPACE, T_COMMENT], ($closeCurlyBracket + 1), null, true); + $line = $tokens[$closeCurlyBracket]['line']; + + // The closing curly bracket must be on a new line. + if ($tokens[$prevToken]['line'] === $line || $tokens[$nextToken]['line'] === $line) { + if ($tokens[$prevToken]['line'] === $line) { + $error = 'The closing curly bracket of a declare statement must be on a new line'; + $fix = $phpcsFile->addFixableError($error, $prevToken, 'CurlyBracketNotOnNewLine'); + if ($fix === true) { + $phpcsFile->fixer->addNewline($prevToken); + } + } + }//end if + + // Closing curly bracket must align with the declare keyword. + if ($tokens[$stackPtr]['column'] !== $tokens[$closeCurlyBracket]['column']) { + $error = 'The closing curly bracket of a declare statements must be aligned with the declare keyword'; + + $fix = $phpcsFile->addFixableError($error, $closeCurlyBracket, 'CloseBracketNotAligned'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($closeCurlyBracket - 1), str_repeat(' ', ($tokens[$stackPtr]['column'] - 1))); + } + } + + // The open curly bracket must be the last code on the line. + $token = $phpcsFile->findNext(Tokens::$emptyTokens, ($curlyBracket + 1), null, true); + if ($tokens[$curlyBracket]['line'] === $tokens[$token]['line']) { + $error = 'The open curly bracket of a declare statement must be the last code on the line'; + $fix = $phpcsFile->addFixableError($error, $token, 'CodeFoundAfterCurlyBracket'); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($token - 1), null, true); + + for ($i = ($prevToken + 1); $i < $token; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addNewLineBefore($token); + + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php new file mode 100644 index 00000000..f06357d4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php @@ -0,0 +1,429 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class FileHeaderSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this sniff when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current + * token in the stack. + * + * @return int|void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $possibleHeaders = []; + + $searchFor = Tokens::$ooScopeTokens; + $searchFor[T_OPEN_TAG] = T_OPEN_TAG; + + $openTag = $stackPtr; + do { + $headerLines = $this->getHeaderLines($phpcsFile, $openTag); + if (empty($headerLines) === true && $openTag === $stackPtr) { + // No content in the file. + return; + } + + $possibleHeaders[$openTag] = $headerLines; + if (count($headerLines) > 1) { + break; + } + + $next = $phpcsFile->findNext($searchFor, ($openTag + 1)); + if (isset(Tokens::$ooScopeTokens[$tokens[$next]['code']]) === true) { + // Once we find an OO token, the file content has + // definitely started. + break; + } + + $openTag = $next; + } while ($openTag !== false); + + if ($openTag === false) { + // We never found a proper file header. + // If the file has multiple PHP open tags, we know + // that it must be a mix of PHP and HTML (or similar) + // so the header rules do not apply. + if (count($possibleHeaders) > 1) { + return $phpcsFile->numTokens; + } + + // There is only one possible header. + // If it is the first content in the file, it technically + // serves as the file header, and the open tag needs to + // have a newline after it. Otherwise, ignore it. + if ($stackPtr > 0) { + return $phpcsFile->numTokens; + } + + $openTag = $stackPtr; + } else if (count($possibleHeaders) > 1) { + // There are other PHP blocks before the file header. + $error = 'The file header must be the first content in the file'; + $phpcsFile->addError($error, $openTag, 'HeaderPosition'); + } else { + // The first possible header was the file header block, + // so make sure it is the first content in the file. + if ($openTag !== 0) { + // Allow for hashbang lines. + $hashbang = false; + if ($tokens[($openTag - 1)]['code'] === T_INLINE_HTML) { + $content = trim($tokens[($openTag - 1)]['content']); + if (substr($content, 0, 2) === '#!') { + $hashbang = true; + } + } + + if ($hashbang === false) { + $error = 'The file header must be the first content in the file'; + $phpcsFile->addError($error, $openTag, 'HeaderPosition'); + } + } + }//end if + + $this->processHeaderLines($phpcsFile, $possibleHeaders[$openTag]); + + return $phpcsFile->numTokens; + + }//end process() + + + /** + * Gather information about the statements inside a possible file header. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current + * token in the stack. + * + * @return array + */ + public function getHeaderLines(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($next === false) { + return []; + } + + $headerLines = []; + $headerLines[] = [ + 'type' => 'tag', + 'start' => $stackPtr, + 'end' => $stackPtr, + ]; + + $foundDocblock = false; + + $commentOpeners = Tokens::$scopeOpeners; + unset($commentOpeners[T_NAMESPACE]); + unset($commentOpeners[T_DECLARE]); + unset($commentOpeners[T_USE]); + unset($commentOpeners[T_IF]); + unset($commentOpeners[T_WHILE]); + unset($commentOpeners[T_FOR]); + unset($commentOpeners[T_FOREACH]); + unset($commentOpeners[T_DO]); + unset($commentOpeners[T_TRY]); + + do { + switch ($tokens[$next]['code']) { + case T_DOC_COMMENT_OPEN_TAG: + if ($foundDocblock === true) { + // Found a second docblock, so start of code. + break(2); + } + + // Make sure this is not a code-level docblock. + $end = $tokens[$next]['comment_closer']; + for ($docToken = ($end + 1); $docToken < $phpcsFile->numTokens; $docToken++) { + if (isset(Tokens::$emptyTokens[$tokens[$docToken]['code']]) === true) { + continue; + } + + if ($tokens[$docToken]['code'] === T_ATTRIBUTE + && isset($tokens[$docToken]['attribute_closer']) === true + ) { + $docToken = $tokens[$docToken]['attribute_closer']; + continue; + } + + break; + } + + if ($docToken === $phpcsFile->numTokens) { + $docToken--; + } + + 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; + for ($i = $next; $i < $end; $i++) { + if ($tokens[$i]['code'] === T_DOC_COMMENT_TAG + && strtolower($tokens[$i]['content']) === '@var' + ) { + $annotation = true; + break; + } + } + + if ($annotation === false) { + $foundDocblock = true; + $headerLines[] = [ + 'type' => 'docblock', + 'start' => $next, + 'end' => $end, + ]; + } + }//end if + + $next = $end; + break; + case T_DECLARE: + case T_NAMESPACE: + if (isset($tokens[$next]['scope_opener']) === true) { + // If this statement is using bracketed syntax, it doesn't + // apply to the entire files and so is not part of header. + // The header has now ended and the main code block begins. + break(2); + } + + $end = $phpcsFile->findEndOfStatement($next); + + $headerLines[] = [ + 'type' => substr(strtolower($tokens[$next]['type']), 2), + 'start' => $next, + 'end' => $end, + ]; + + $next = $end; + break; + case T_USE: + $type = 'use'; + $useType = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + if ($useType !== false && $tokens[$useType]['code'] === T_STRING) { + $content = strtolower($tokens[$useType]['content']); + if ($content === 'function' || $content === 'const') { + $type .= ' '.$content; + } + } + + $end = $phpcsFile->findEndOfStatement($next); + + $headerLines[] = [ + 'type' => $type, + 'start' => $next, + 'end' => $end, + ]; + + $next = $end; + break; + default: + // Skip comments as PSR-12 doesn't say if these are allowed or not. + if (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true) { + $next = $phpcsFile->findNext(Tokens::$commentTokens, ($next + 1), null, true); + if ($next === false) { + // We reached the end of the file. + break(2); + } + + $next--; + break; + } + + // We found the start of the main code block. + break(2); + }//end switch + + $next = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); + } while ($next !== false); + + return $headerLines; + + }//end getHeaderLines() + + + /** + * Check the spacing and grouping of the statements inside each header block. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $headerLines Header information, as sourced + * from getHeaderLines(). + * + * @return void + */ + public function processHeaderLines(File $phpcsFile, $headerLines) + { + $tokens = $phpcsFile->getTokens(); + + $found = []; + + foreach ($headerLines as $i => $line) { + if (isset($headerLines[($i + 1)]) === false + || $headerLines[($i + 1)]['type'] !== $line['type'] + ) { + // We're at the end of the current header block. + // Make sure there is a single blank line after + // this block. + $next = $phpcsFile->findNext(T_WHITESPACE, ($line['end'] + 1), null, true); + if ($next !== false && $tokens[$next]['line'] !== ($tokens[$line['end']]['line'] + 2)) { + $error = 'Header blocks must be separated by a single blank line'; + $fix = $phpcsFile->addFixableError($error, $line['end'], 'SpacingAfterBlock'); + if ($fix === true) { + if ($tokens[$next]['line'] === $tokens[$line['end']]['line']) { + $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); + } else if ($tokens[$next]['line'] === ($tokens[$line['end']]['line'] + 1)) { + $phpcsFile->fixer->addNewline($line['end']); + } else { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($line['end'] + 1); $i < $next; $i++) { + if ($tokens[$i]['line'] === ($tokens[$line['end']]['line'] + 2)) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + + // Make sure we haven't seen this next block before. + if (isset($headerLines[($i + 1)]) === true + && isset($found[$headerLines[($i + 1)]['type']]) === true + ) { + $error = 'Similar statements must be grouped together inside header blocks; '; + $error .= 'the first "%s" statement was found on line %s'; + $data = [ + $headerLines[($i + 1)]['type'], + $tokens[$found[$headerLines[($i + 1)]['type']]['start']]['line'], + ]; + $phpcsFile->addError($error, $headerLines[($i + 1)]['start'], 'IncorrectGrouping', $data); + } + } else if ($headerLines[($i + 1)]['type'] === $line['type']) { + // Still in the same block, so make sure there is no + // blank line after this statement. + $next = $phpcsFile->findNext(T_WHITESPACE, ($line['end'] + 1), null, true); + if ($tokens[$next]['line'] > ($tokens[$line['end']]['line'] + 1)) { + $error = 'Header blocks must not contain blank lines'; + $fix = $phpcsFile->addFixableError($error, $line['end'], 'SpacingInsideBlock'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($line['end'] + 1); $i < $next; $i++) { + if ($tokens[$i]['line'] === $tokens[$line['end']]['line']) { + continue; + } + + if ($tokens[$i]['line'] === $tokens[$next]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + if (isset($found[$line['type']]) === false) { + $found[$line['type']] = $line; + } + }//end foreach + + /* + Next, check that the order of the header blocks + is correct: + Opening php tag. + File-level docblock. + One or more declare statements. + The namespace declaration of the file. + One or more class-based use import statements. + One or more function-based use import statements. + One or more constant-based use import statements. + */ + + $blockOrder = [ + 'tag' => 'opening PHP tag', + 'docblock' => 'file-level docblock', + 'declare' => 'declare statements', + 'namespace' => 'namespace declaration', + 'use' => 'class-based use imports', + 'use function' => 'function-based use imports', + 'use const' => 'constant-based use imports', + ]; + + foreach (array_keys($found) as $type) { + if ($type === 'tag') { + // The opening tag is always in the correct spot. + continue; + } + + do { + $orderedType = next($blockOrder); + } while ($orderedType !== false && key($blockOrder) !== $type); + + if ($orderedType === false) { + // We didn't find the block type in the rest of the + // ordered array, so it is out of place. + // Error and reset the array to the correct position + // so we can check the next block. + reset($blockOrder); + $prevValidType = 'tag'; + do { + $orderedType = next($blockOrder); + if (isset($found[key($blockOrder)]) === true + && key($blockOrder) !== $type + ) { + $prevValidType = key($blockOrder); + } + } while ($orderedType !== false && key($blockOrder) !== $type); + + $error = 'The %s must follow the %s in the file header'; + $data = [ + $blockOrder[$type], + $blockOrder[$prevValidType], + ]; + $phpcsFile->addError($error, $found[$type]['start'], 'IncorrectOrder', $data); + }//end if + }//end foreach + + }//end processHeaderLines() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php new file mode 100644 index 00000000..65198e86 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php @@ -0,0 +1,77 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ImportStatementSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_USE]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Make sure this is not a closure USE group. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) { + return; + } + + if ($phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens) === true) { + // This rule only applies to import statements. + return; + } + + if ($tokens[$next]['code'] === T_STRING + && (strtolower($tokens[$next]['content']) === 'function' + || strtolower($tokens[$next]['content']) === 'const') + ) { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); + } + + if ($tokens[$next]['code'] !== T_NS_SEPARATOR) { + return; + } + + $error = 'Import statements must not begin with a leading backslash'; + $fix = $phpcsFile->addFixableError($error, $next, 'LeadingSlash'); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken($next, ''); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php new file mode 100644 index 00000000..d0ac5d36 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php @@ -0,0 +1,76 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class OpenTagSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this sniff when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current + * token in the stack. + * + * @return int + */ + public function process(File $phpcsFile, $stackPtr) + { + if ($stackPtr !== 0) { + // This rule only applies if the open tag is on the first line of the file. + return $phpcsFile->numTokens; + } + + $tokens = $phpcsFile->getTokens(); + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($next === false) { + // Empty file. + 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; + } + + $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; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php new file mode 100644 index 00000000..4314194d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php @@ -0,0 +1,94 @@ + + * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class NullableTypeDeclarationSniff implements Sniff +{ + + /** + * An array of valid tokens after `T_NULLABLE` occurrences. + * + * @var array + */ + private $validTokens = [ + T_STRING => true, + T_NS_SEPARATOR => true, + T_CALLABLE => true, + T_SELF => true, + T_PARENT => true, + T_STATIC => true, + T_NULL => true, + T_FALSE => true, + T_TRUE => true, + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_NULLABLE]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $nextNonEmptyPtr = $phpcsFile->findNext([T_WHITESPACE], ($stackPtr + 1), null, true); + if ($nextNonEmptyPtr === false) { + // Parse error or live coding. + return; + } + + $tokens = $phpcsFile->getTokens(); + $nextNonEmptyCode = $tokens[$nextNonEmptyPtr]['code']; + $validTokenFound = isset($this->validTokens[$nextNonEmptyCode]); + + if ($validTokenFound === true && $nextNonEmptyPtr === ($stackPtr + 1)) { + // Valid structure. + return; + } + + $error = 'There must not be a space between the question mark and the type in nullable type declarations'; + + if ($validTokenFound === true) { + // No other tokens then whitespace tokens found; fixable. + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WhitespaceFound'); + if ($fix === true) { + for ($i = ($stackPtr + 1); $i < $nextNonEmptyPtr; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + + return; + } + + // Non-whitespace tokens found; trigger error but don't fix. + $phpcsFile->addError($error, $stackPtr, 'UnexpectedCharactersFound'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php new file mode 100644 index 00000000..cf1afc56 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php @@ -0,0 +1,110 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ReturnTypeDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + T_FN, + ]; + + }//end register() + + + /** + * Processes this test when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false + || isset($tokens[$stackPtr]['parenthesis_closer']) === false + || $tokens[$stackPtr]['parenthesis_opener'] === null + || $tokens[$stackPtr]['parenthesis_closer'] === null + ) { + return; + } + + $methodProperties = $phpcsFile->getMethodProperties($stackPtr); + if ($methodProperties['return_type'] === '') { + return; + } + + $returnType = $methodProperties['return_type_token']; + if ($methodProperties['nullable_return_type'] === true) { + $returnType = $phpcsFile->findPrevious(T_NULLABLE, ($returnType - 1)); + } + + if ($tokens[($returnType - 1)]['code'] !== T_WHITESPACE + || $tokens[($returnType - 1)]['content'] !== ' ' + || $tokens[($returnType - 2)]['code'] !== T_COLON + ) { + $error = 'There must be a single space between the colon and type in a return type declaration'; + if ($tokens[($returnType - 1)]['code'] === T_WHITESPACE + && $tokens[($returnType - 2)]['code'] === T_COLON + ) { + $fix = $phpcsFile->addFixableError($error, $returnType, 'SpaceBeforeReturnType'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($returnType - 1), ' '); + } + } else if ($tokens[($returnType - 1)]['code'] === T_COLON) { + $fix = $phpcsFile->addFixableError($error, $returnType, 'SpaceBeforeReturnType'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($returnType, ' '); + } + } else { + $phpcsFile->addError($error, $returnType, 'SpaceBeforeReturnType'); + } + } + + $colon = $phpcsFile->findPrevious(T_COLON, $returnType); + if ($tokens[($colon - 1)]['code'] !== T_CLOSE_PARENTHESIS) { + $error = 'There must not be a space before the colon in a return type declaration'; + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($colon - 1), null, true); + if ($tokens[$prev]['code'] === T_CLOSE_PARENTHESIS) { + $fix = $phpcsFile->addFixableError($error, $colon, 'SpaceBeforeColon'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($prev + 1); $x < $colon; $x++) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } else { + $phpcsFile->addError($error, $colon, 'SpaceBeforeColon'); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php new file mode 100644 index 00000000..65d39eb9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php @@ -0,0 +1,75 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ShortFormTypeKeywordsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_BOOL_CAST, + T_INT_CAST, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $typecast = str_replace(' ', '', $tokens[$stackPtr]['content']); + $typecast = str_replace("\t", '', $typecast); + $typecast = trim($typecast, '()'); + $typecastLc = strtolower($typecast); + + if (($tokens[$stackPtr]['code'] === T_BOOL_CAST + && $typecastLc === 'bool') + || ($tokens[$stackPtr]['code'] === T_INT_CAST + && $typecastLc === 'int') + ) { + return; + } + + $error = 'Short form type keywords must be used. Found: %s'; + $data = [$tokens[$stackPtr]['content']]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'LongFound', $data); + if ($fix === true) { + if ($tokens[$stackPtr]['code'] === T_BOOL_CAST) { + $replacement = str_replace($typecast, 'bool', $tokens[$stackPtr]['content']); + } else { + $replacement = str_replace($typecast, 'int', $tokens[$stackPtr]['content']); + } + + $phpcsFile->fixer->replaceToken($stackPtr, $replacement); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php new file mode 100644 index 00000000..34e7f461 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php @@ -0,0 +1,80 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class CompoundNamespaceDepthSniff implements Sniff +{ + + /** + * The max depth for compound namespaces. + * + * @var integer + */ + public $maxDepth = 2; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_USE_GROUP]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $this->maxDepth = (int) $this->maxDepth; + + $tokens = $phpcsFile->getTokens(); + + $end = $phpcsFile->findNext(T_CLOSE_USE_GROUP, ($stackPtr + 1)); + if ($end === false) { + return; + } + + $depth = 1; + for ($i = ($stackPtr + 1); $i <= $end; $i++) { + if ($tokens[$i]['code'] === T_NS_SEPARATOR) { + $depth++; + continue; + } + + if ($i === $end || $tokens[$i]['code'] === T_COMMA) { + // End of a namespace. + if ($depth > $this->maxDepth) { + $error = 'Compound namespaces cannot have a depth more than %s'; + $data = [$this->maxDepth]; + $phpcsFile->addError($error, $i, 'TooDeep', $data); + } + + $depth = 1; + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php new file mode 100644 index 00000000..41628ce3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php @@ -0,0 +1,128 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\OperatorSpacingSniff as SquizOperatorSpacingSniff; +use PHP_CodeSniffer\Util\Tokens; + +class OperatorSpacingSniff extends SquizOperatorSpacingSniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + parent::register(); + + $targets = Tokens::$comparisonTokens; + $targets += Tokens::$operators; + $targets += Tokens::$assignmentTokens; + $targets += Tokens::$booleanOperators; + $targets[] = T_INLINE_THEN; + $targets[] = T_INLINE_ELSE; + $targets[] = T_STRING_CONCAT; + $targets[] = T_INSTANCEOF; + + // Also register the contexts we want to specifically skip over. + $targets[] = T_DECLARE; + + return $targets; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @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. Return `$phpcsFile->numTokens` to skip + * the rest of the file. + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Skip over declare statements as those should be handled by different sniffs. + if ($tokens[$stackPtr]['code'] === T_DECLARE) { + if (isset($tokens[$stackPtr]['parenthesis_closer']) === false) { + // Parse error / live coding. + return $phpcsFile->numTokens; + } + + return $tokens[$stackPtr]['parenthesis_closer']; + } + + if ($this->isOperator($phpcsFile, $stackPtr) === false) { + return; + } + + $operator = $tokens[$stackPtr]['content']; + + $checkBefore = true; + $checkAfter = true; + + // Skip short ternary. + if ($tokens[($stackPtr)]['code'] === T_INLINE_ELSE + && $tokens[($stackPtr - 1)]['code'] === T_INLINE_THEN + ) { + $checkBefore = false; + } + + // Skip operator with comment on previous line. + if ($tokens[($stackPtr - 1)]['code'] === T_COMMENT + && $tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] + ) { + $checkBefore = false; + } + + if (isset($tokens[($stackPtr + 1)]) === true) { + // Skip short ternary. + if ($tokens[$stackPtr]['code'] === T_INLINE_THEN + && $tokens[($stackPtr + 1)]['code'] === T_INLINE_ELSE + ) { + $checkAfter = false; + } + } else { + // Skip partial files. + $checkAfter = false; + } + + if ($checkBefore === true && $tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected at least 1 space before "%s"; 0 found'; + $data = [$operator]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore', $data); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + } + } + + if ($checkAfter === true && $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected at least 1 space after "%s"; 0 found'; + $data = [$operator]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php new file mode 100644 index 00000000..8bcf0d56 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php @@ -0,0 +1,64 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ConstantVisibilitySniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_CONST]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Make sure this is a class constant. + if ($phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens) === false) { + return; + } + + $ignore = Tokens::$emptyTokens; + $ignore[] = T_FINAL; + + $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); + if (isset(Tokens::$scopeModifiers[$tokens[$prev]['code']]) === true) { + return; + } + + $error = 'Visibility must be declared on all constants if your project supports PHP 7.1 or later'; + $phpcsFile->addWarning($error, $stackPtr, 'NotFound'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php new file mode 100644 index 00000000..70e99d76 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php @@ -0,0 +1,700 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Traits; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class UseDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_USE]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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|int + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Needs to be a use statement directly inside a class. + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + if (isset(Tokens::$ooScopeTokens[current($conditions)]) === false) { + return; + } + + $ooToken = key($conditions); + $opener = $tokens[$ooToken]['scope_opener']; + + // Figure out where all the use statements are. + $useTokens = [$stackPtr]; + for ($i = ($stackPtr + 1); $i < $tokens[$ooToken]['scope_closer']; $i++) { + if ($tokens[$i]['code'] === T_USE) { + $useTokens[] = $i; + } + + if (isset($tokens[$i]['scope_closer']) === true) { + $i = $tokens[$i]['scope_closer']; + } + } + + $numUseTokens = count($useTokens); + foreach ($useTokens as $usePos => $useToken) { + if ($usePos === 0) { + /* + This is the first use statement. + */ + + // The first non-comment line must be the use line. + $lastValidContent = $useToken; + for ($i = ($useToken - 1); $i > $opener; $i--) { + if ($tokens[$i]['code'] === T_WHITESPACE + && ($tokens[($i - 1)]['line'] === $tokens[$i]['line'] + || $tokens[($i + 1)]['line'] === $tokens[$i]['line']) + ) { + continue; + } + + if (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { + if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { + // Skip past the comment. + $i = $tokens[$i]['comment_opener']; + } + + $lastValidContent = $i; + + continue; + } + + break; + }//end for + + if ($tokens[$lastValidContent]['line'] !== ($tokens[$opener]['line'] + 1)) { + $error = 'The first trait import statement must be declared on the first non-comment line after the %s opening brace'; + $data = [strtolower($tokens[$ooToken]['content'])]; + + // Figure out if we can fix this error. + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($useToken - 1), ($opener - 1), true); + if ($tokens[$prev]['line'] === $tokens[$opener]['line']) { + $fix = $phpcsFile->addFixableError($error, $useToken, 'UseAfterBrace', $data); + if ($fix === true) { + // We know that the USE statements is the first non-comment content + // in the class, so we just need to remove blank lines. + $phpcsFile->fixer->beginChangeset(); + for ($i = ($useToken - 1); $i > $opener; $i--) { + if ($tokens[$i]['line'] === $tokens[$opener]['line']) { + break; + } + + if ($tokens[$i]['line'] === $tokens[$useToken]['line']) { + continue; + } + + if ($tokens[$i]['code'] === T_WHITESPACE + && $tokens[($i - 1)]['line'] !== $tokens[$i]['line'] + && $tokens[($i + 1)]['line'] !== $tokens[$i]['line'] + ) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + if (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { + if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { + // Skip past the comment. + $i = $tokens[$i]['comment_opener']; + } + + $lastValidContent = $i; + } + }//end for + + $phpcsFile->fixer->endChangeset(); + }//end if + } else { + $phpcsFile->addError($error, $useToken, 'UseAfterBrace', $data); + }//end if + }//end if + } else { + // Make sure this use statement is not on the same line as the previous one. + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($useToken - 1), null, true); + if ($prev !== false && $tokens[$prev]['line'] === $tokens[$useToken]['line']) { + $error = 'Each imported trait must be on its own line'; + $prevNonWs = $phpcsFile->findPrevious(T_WHITESPACE, ($useToken - 1), null, true); + if ($prevNonWs !== $prev) { + $phpcsFile->addError($error, $useToken, 'SpacingBeforeImport'); + } else { + $fix = $phpcsFile->addFixableError($error, $useToken, 'SpacingBeforeImport'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($useToken - 1); $x > $prev; $x--) { + if ($tokens[$x]['line'] === $tokens[$useToken]['line'] + ) { + // Preserve indent. + continue; + } + + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addNewline($prev); + if ($tokens[$prev]['line'] === $tokens[$useToken]['line']) { + if ($tokens[($useToken - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($useToken - 1), ''); + } + + $padding = str_repeat(' ', ($tokens[$useTokens[0]]['column'] - 1)); + $phpcsFile->fixer->addContent($prev, $padding); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + }//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); + $end = $tokens[$useToken]['scope_closer']; + } else { + $this->processUseStatement($phpcsFile, $useToken); + $end = $phpcsFile->findNext(T_SEMICOLON, ($useToken + 1)); + if ($end === false) { + // Syntax error. + return; + } + } + + if ($usePos === ($numUseTokens - 1)) { + /* + This is the last use statement. + */ + + $next = $phpcsFile->findNext(T_WHITESPACE, ($end + 1), null, true); + if ($next === $tokens[$ooToken]['scope_closer']) { + // Last content in the class. + $closer = $tokens[$ooToken]['scope_closer']; + if ($tokens[$closer]['line'] > ($tokens[$end]['line'] + 1)) { + $error = 'There must be no blank line after the last trait import statement at the bottom of a %s'; + $data = [strtolower($tokens[$ooToken]['content'])]; + $fix = $phpcsFile->addFixableError($error, $end, 'BlankLineAfterLastUse', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($end + 1); $i < $closer; $i++) { + if ($tokens[$i]['line'] === $tokens[$end]['line']) { + continue; + } + + if ($tokens[$i]['line'] === $tokens[$closer]['line']) { + // Don't remove indents. + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + } else if ($tokens[$next]['code'] !== T_USE) { + // Comments are allowed on the same line as the use statement, so make sure + // we don't error for those. + for ($next = ($end + 1); $next < $tokens[$ooToken]['scope_closer']; $next++) { + if ($tokens[$next]['code'] === T_WHITESPACE) { + continue; + } + + if (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true + && $tokens[$next]['line'] === $tokens[$end]['line'] + ) { + continue; + } + + break; + } + + if ($tokens[$next]['line'] <= ($tokens[$end]['line'] + 1)) { + $error = 'There must be a blank line following the last trait import statement'; + $fix = $phpcsFile->addFixableError($error, $end, 'NoBlankLineAfterUse'); + if ($fix === true) { + if ($tokens[$next]['line'] === $tokens[$useToken]['line']) { + $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); + } else { + for ($i = ($next - 1); $i > $end; $i--) { + if ($tokens[$i]['line'] !== $tokens[$next]['line']) { + break; + } + } + + $phpcsFile->fixer->addNewlineBefore(($i + 1)); + } + } + } + }//end if + } else { + // Ensure use statements are grouped. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); + if ($next !== $useTokens[($usePos + 1)]) { + $error = 'Imported traits must be grouped together'; + $phpcsFile->addError($error, $useTokens[($usePos + 1)], 'NotGrouped'); + } + }//end if + }//end foreach + + return $tokens[$ooToken]['scope_closer']; + + }//end process() + + + /** + * Processes a group use statement. + * + * @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 + */ + protected function processUseGroup(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $opener = $tokens[$stackPtr]['scope_opener']; + $closer = $tokens[$stackPtr]['scope_closer']; + + if ($tokens[$opener]['line'] !== $tokens[$stackPtr]['line']) { + $error = 'The opening brace of a trait import statement must be on the same line as the USE keyword'; + // Figure out if we can fix this error. + $canFix = true; + for ($i = ($stackPtr + 1); $i < $opener; $i++) { + if ($tokens[$i]['line'] !== $tokens[($i + 1)]['line'] + && $tokens[$i]['code'] !== T_WHITESPACE + ) { + $canFix = false; + break; + } + } + + if ($canFix === true) { + $fix = $phpcsFile->addFixableError($error, $opener, 'OpenBraceNewLine'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($stackPtr + 1); $i < $opener; $i++) { + if ($tokens[$i]['line'] !== $tokens[($i + 1)]['line']) { + // Everything should have a single space around it. + $phpcsFile->fixer->replaceToken($i, ' '); + } + } + + $phpcsFile->fixer->endChangeset(); + } + } else { + $phpcsFile->addError($error, $opener, 'OpenBraceNewLine'); + } + }//end if + + $error = 'Expected 1 space before opening brace in trait import statement; %s found'; + if ($tokens[($opener - 1)]['code'] !== T_WHITESPACE) { + $data = ['0']; + $fix = $phpcsFile->addFixableError($error, $opener, 'SpaceBeforeOpeningBrace', $data); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($opener, ' '); + } + } else if ($tokens[($opener - 1)]['content'] !== ' ') { + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), null, true); + if ($tokens[$prev]['line'] !== $tokens[$opener]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($opener - 1)]['length']; + } + + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $opener, 'SpaceBeforeOpeningBrace', $data); + if ($fix === true) { + if ($found === 'newline') { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($opener - 1); $x > $prev; $x--) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addContentBefore($opener, ' '); + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($opener - 1), ' '); + } + } + }//end if + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), ($closer - 1), true); + if ($next !== false && $tokens[$next]['line'] !== ($tokens[$opener]['line'] + 1)) { + $error = 'First trait conflict resolution statement must be on the line after the opening brace'; + $nextNonWs = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), ($closer - 1), true); + if ($nextNonWs !== $next) { + $phpcsFile->addError($error, $opener, 'SpaceAfterOpeningBrace'); + } else { + $fix = $phpcsFile->addFixableError($error, $opener, 'SpaceAfterOpeningBrace'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($opener + 1); $x < $next; $x++) { + if ($tokens[$x]['line'] === $tokens[$next]['line']) { + // Preserve indent. + break; + } + + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addNewline($opener); + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + for ($i = ($stackPtr + 1); $i < $opener; $i++) { + if ($tokens[$i]['code'] !== T_COMMA) { + continue; + } + + if ($tokens[($i - 1)]['code'] === T_WHITESPACE) { + $error = 'Expected no space before comma in trait import statement; %s found'; + $data = [$tokens[($i - 1)]['length']]; + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeComma', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($i - 1), ''); + } + } + + $error = 'Expected 1 space after comma in trait import statement; %s found'; + if ($tokens[($i + 1)]['code'] !== T_WHITESPACE) { + $data = ['0']; + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterComma', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($i, ' '); + } + } else if ($tokens[($i + 1)]['content'] !== ' ') { + $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $opener, true); + if ($tokens[$next]['line'] !== $tokens[$i]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($i + 1)]['length']; + } + + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterComma', $data); + if ($fix === true) { + if ($found === 'newline') { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($i + 1); $x < $next; $x++) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addContent($i, ' '); + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($i + 1), ' '); + } + } + }//end if + }//end for + + for ($i = ($opener + 1); $i < $closer; $i++) { + if ($tokens[$i]['code'] === T_INSTEADOF) { + $error = 'Expected 1 space before INSTEADOF in trait import statement; %s found'; + if ($tokens[($i - 1)]['code'] !== T_WHITESPACE) { + $data = ['0']; + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeInsteadof', $data); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($i, ' '); + } + } else if ($tokens[($i - 1)]['content'] !== ' ') { + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), $opener, true); + if ($tokens[$prev]['line'] !== $tokens[$i]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($i - 1)]['length']; + } + + $data = [$found]; + + $prevNonWs = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $opener, true); + if ($prevNonWs !== $prev) { + $phpcsFile->addError($error, $i, 'SpaceBeforeInsteadof', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeInsteadof', $data); + if ($fix === true) { + if ($found === 'newline') { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($i - 1); $x > $prev; $x--) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addContentBefore($i, ' '); + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($i - 1), ' '); + } + } + } + }//end if + + $error = 'Expected 1 space after INSTEADOF in trait import statement; %s found'; + if ($tokens[($i + 1)]['code'] !== T_WHITESPACE) { + $data = ['0']; + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterInsteadof', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($i, ' '); + } + } else if ($tokens[($i + 1)]['content'] !== ' ') { + $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $closer, true); + if ($tokens[$next]['line'] !== $tokens[$i]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($i + 1)]['length']; + } + + $data = [$found]; + + $nextNonWs = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $closer, true); + if ($nextNonWs !== $next) { + $phpcsFile->addError($error, $i, 'SpaceAfterInsteadof', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterInsteadof', $data); + if ($fix === true) { + if ($found === 'newline') { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($i + 1); $x < $next; $x++) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addContent($i, ' '); + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($i + 1), ' '); + } + } + } + }//end if + }//end if + + if ($tokens[$i]['code'] === T_AS) { + $error = 'Expected 1 space before AS in trait import statement; %s found'; + if ($tokens[($i - 1)]['code'] !== T_WHITESPACE) { + $data = ['0']; + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeAs', $data); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($i, ' '); + } + } else if ($tokens[($i - 1)]['content'] !== ' ') { + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), $opener, true); + if ($tokens[$prev]['line'] !== $tokens[$i]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($i - 1)]['length']; + } + + $data = [$found]; + + $prevNonWs = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $opener, true); + if ($prevNonWs !== $prev) { + $phpcsFile->addError($error, $i, 'SpaceBeforeAs', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeAs', $data); + if ($fix === true) { + if ($found === 'newline') { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($i - 1); $x > $prev; $x--) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addContentBefore($i, ' '); + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($i - 1), ' '); + } + } + } + }//end if + + $error = 'Expected 1 space after AS in trait import statement; %s found'; + if ($tokens[($i + 1)]['code'] !== T_WHITESPACE) { + $data = ['0']; + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterAs', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($i, ' '); + } + } else if ($tokens[($i + 1)]['content'] !== ' ') { + $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $closer, true); + if ($tokens[$next]['line'] !== $tokens[$i]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($i + 1)]['length']; + } + + $data = [$found]; + + $nextNonWs = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $closer, true); + if ($nextNonWs !== $next) { + $phpcsFile->addError($error, $i, 'SpaceAfterAs', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterAs', $data); + if ($fix === true) { + if ($found === 'newline') { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($i + 1); $x < $next; $x++) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addContent($i, ' '); + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($i + 1), ' '); + } + } + } + }//end if + }//end if + + if ($tokens[$i]['code'] === T_SEMICOLON) { + if ($tokens[($i - 1)]['code'] === T_WHITESPACE) { + $error = 'Expected no space before semicolon in trait import statement; %s found'; + $data = [$tokens[($i - 1)]['length']]; + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeSemicolon', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($i - 1), ''); + } + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), ($closer - 1), true); + if ($next !== false && $tokens[$next]['line'] === $tokens[$i]['line']) { + $error = 'Each trait conflict resolution statement must be on a line by itself'; + $nextNonWs = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closer - 1), true); + if ($nextNonWs !== $next) { + $phpcsFile->addError($error, $i, 'ConflictSameLine'); + } else { + $fix = $phpcsFile->addFixableError($error, $i, 'ConflictSameLine'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + if ($tokens[($i + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($i + 1), ''); + } + + $phpcsFile->fixer->addNewline($i); + $phpcsFile->fixer->endChangeset(); + } + } + } + }//end if + }//end for + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closer - 1), ($opener + 1), true); + if ($prev !== false && $tokens[$prev]['line'] !== ($tokens[$closer]['line'] - 1)) { + $error = 'Closing brace must be on the line after the last trait conflict resolution statement'; + $prevNonWs = $phpcsFile->findPrevious(T_WHITESPACE, ($closer - 1), ($opener + 1), true); + if ($prevNonWs !== $prev) { + $phpcsFile->addError($error, $closer, 'SpaceBeforeClosingBrace'); + } else { + $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceBeforeClosingBrace'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($closer - 1); $x > $prev; $x--) { + if ($tokens[$x]['line'] === $tokens[$closer]['line']) { + // Preserve indent. + continue; + } + + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addNewline($prev); + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + }//end processUseGroup() + + + /** + * Processes a single use statement. + * + * @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 + */ + protected function processUseStatement(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $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'; + $fix = $phpcsFile->addFixableError($error, $next, 'MultipleImport'); + if ($fix === true) { + $padding = str_repeat(' ', ($tokens[$stackPtr]['column'] - 1)); + $phpcsFile->fixer->replaceToken($next, ';'.$phpcsFile->eolChar.$padding.'use '); + } + } + + }//end processUseStatement() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc new file mode 100644 index 00000000..386b12c2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc @@ -0,0 +1,96 @@ +bar( + new class implements Bar { + // ... + }, +); + +foo(new class { +}); + +// Issue #3790: OpenBraceSameLine fixer should not remove open brace. +$instance = new class() extends SomeClass implements + SomeInterface{ + public function __construct() {} +}; + +// PHP 8.3 readonly anonymous classes. +$anon = new readonly class {}; +$anon = new readonly class {}; +$anon = new readonly + class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed new file mode 100644 index 00000000..28b38f70 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed @@ -0,0 +1,98 @@ +bar( + new class implements Bar { + // ... + }, +); + +foo(new class { +}); + +// Issue #3790: OpenBraceSameLine fixer should not remove open brace. +$instance = new class () extends SomeClass implements + SomeInterface +{ + public function __construct() {} +}; + +// PHP 8.3 readonly anonymous classes. +$anon = new readonly class {}; +$anon = new readonly class {}; +$anon = new readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php new file mode 100644 index 00000000..24035270 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php @@ -0,0 +1,80 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the AnonClassDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\AnonClassDeclarationSniff + */ +final class AnonClassDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 28 => 3, + 30 => 1, + 31 => 4, + 32 => 1, + 33 => 1, + 34 => 1, + 35 => 1, + 36 => 1, + 37 => 3, + 39 => 1, + 40 => 1, + 43 => 3, + 44 => 4, + 45 => 1, + 48 => 1, + 52 => 3, + 53 => 1, + 54 => 1, + 55 => 1, + 56 => 2, + 63 => 1, + 75 => 1, + 87 => 1, + 88 => 1, + 94 => 1, + 96 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc new file mode 100644 index 00000000..26411677 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc @@ -0,0 +1,51 @@ +bar(); +echo (new Foo)->bar(); +echo (new Foo((new Bar)->getBaz()))->bar(); +$foo = (new Foo)::$bar; + +echo (new Foo((new Bar//comment +)->getBaz(new Baz /* comment */)))->bar(); + +$foo = new $bar['a'](); +$foo = new $bar['a']['b'](); +$foo = new $bar['a'][$baz['a']['b']]['b'](); +$foo = new $bar['a'] [$baz['a']/* comment */ ['b']]['b']; + +$a = new self::$transport[$cap_string]; +$renderer = new $this->inline_diff_renderer; +$a = new ${$varHoldingClassName}; + +$class = new $obj?->classname(); +$class = new $obj?->classname; +$class = new ${$obj?->classname}; + +// Issue 3456. +// Anon classes should be skipped, even when there is an attribute between the new and the class keywords. +$anonWithAttribute = new #[SomeAttribute('summary')] class { + public const SOME_STUFF = 'foo'; +}; + +$foo = new parent(); +$foo = new parent; + +// PHP 8.3: safeguard that the sniff ignores anonymous classes, even when declared as readonly. +$anon = new readonly class {}; +$anon = new #[MyAttribute] readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed new file mode 100644 index 00000000..1e580f45 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed @@ -0,0 +1,51 @@ +bar(); +echo (new Foo())->bar(); +echo (new Foo((new Bar())->getBaz()))->bar(); +$foo = (new Foo())::$bar; + +echo (new Foo((new Bar()//comment +)->getBaz(new Baz() /* comment */)))->bar(); + +$foo = new $bar['a'](); +$foo = new $bar['a']['b'](); +$foo = new $bar['a'][$baz['a']['b']]['b'](); +$foo = new $bar['a'] [$baz['a']/* comment */ ['b']]['b'](); + +$a = new self::$transport[$cap_string](); +$renderer = new $this->inline_diff_renderer(); +$a = new ${$varHoldingClassName}(); + +$class = new $obj?->classname(); +$class = new $obj?->classname(); +$class = new ${$obj?->classname}(); + +// Issue 3456. +// Anon classes should be skipped, even when there is an attribute between the new and the class keywords. +$anonWithAttribute = new #[SomeAttribute('summary')] class { + public const SOME_STUFF = 'foo'; +}; + +$foo = new parent(); +$foo = new parent(); + +// PHP 8.3: safeguard that the sniff ignores anonymous classes, even when declared as readonly. +$anon = new readonly class {}; +$anon = new #[MyAttribute] readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php new file mode 100644 index 00000000..10356921 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php @@ -0,0 +1,72 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassInstantiation sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClassInstantiationSniff + */ +final class ClassInstantiationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 4 => 1, + 9 => 1, + 11 => 1, + 14 => 1, + 16 => 1, + 20 => 1, + 21 => 1, + 22 => 1, + 24 => 1, + 25 => 1, + 30 => 1, + 32 => 1, + 33 => 1, + 34 => 1, + 37 => 1, + 38 => 1, + 47 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc new file mode 100644 index 00000000..2562d26c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc @@ -0,0 +1,52 @@ +bar( + $arg1, + function ($arg2) use ($var1) { + // body + }, + $arg3 +); + +$instance = new class extends \Foo implements \HandleableInterface { + // Class content +}; + +$app->get('/hello/{name}', function ($name) use ($app) { + return 'Hello ' . $app->escape($name); +}); + +enum Foo4 +{ + +}//end diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php new file mode 100644 index 00000000..196de8f5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php @@ -0,0 +1,60 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClosingBrace sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClosingBraceSniff + */ +final class ClosingBraceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 13 => 1, + 14 => 1, + 19 => 1, + 24 => 1, + 31 => 1, + 52 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc new file mode 100644 index 00000000..2c41bde9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the OpeningBraceSpace sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\OpeningBraceSpaceSniff + */ +final class OpeningBraceSpaceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 10 => 1, + 18 => 1, + 24 => 1, + 34 => 1, + 41 => 1, + 55 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc new file mode 100644 index 00000000..4bc2eceb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc @@ -0,0 +1,131 @@ + 0 && $n < 10) + || ($n > 10 && $n < 20) + || ($n > 20 && $n < 30) +) { + return $n; +} + +if ( + ( + $expr1 + && $expr2 + && $expr3 + && $expr4 + && $expr5 + && $expr6 + ) + || ($n > 100 && $n < 200) + || ($n > 200 && $n < 300) +) { + return $n; +} + +// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly first +if ( + $expr1 + && $expr2 + && ($expr3 + || $expr4) + && $expr5 +) { + // if body +} elseif ( + $expr1 && + ($expr3 || $expr4) + && $expr5 +) { + // elseif body +} elseif ( + $expr1 + && ($expr3 || $expr4) && + $expr5 +) { + // elseif body +} + +// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly last +if ( + $expr1 + && $expr2 + && ($expr3 + || $expr4) + && $expr5 +) { + // if body +} elseif ( + $expr1 && + ($expr3 || $expr4) + && $expr5 +) { + // elseif body +} elseif ( + $expr1 + && ($expr3 || $expr4) && + $expr5 +) { + // elseif body +} + +if ( + ($value == 1 || + $value == 2) + && + ($value == 3 || + $value == 4) +) { + return 5; +} + +// Reset to default. +// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly + +match ( + $expr1 + && $expr2 && + $expr3 +) { + // structure body +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed new file mode 100644 index 00000000..5f4d223e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed @@ -0,0 +1,141 @@ + 0 && $n < 10) + || ($n > 10 && $n < 20) + || ($n > 20 && $n < 30) +) { + return $n; +} + +if ( + ( + $expr1 + && $expr2 + && $expr3 + && $expr4 + && $expr5 + && $expr6 + ) + || ($n > 100 && $n < 200) + || ($n > 200 && $n < 300) +) { + return $n; +} + +// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly first +if ( + $expr1 + && $expr2 + && ($expr3 + || $expr4) + && $expr5 +) { + // if body +} elseif ( + $expr1 + && ($expr3 + || $expr4) + && $expr5 +) { + // elseif body +} elseif ( + $expr1 + && ($expr3 + || $expr4) + && $expr5 +) { + // elseif body +} + +// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly last +if ( + $expr1 && + $expr2 && + ($expr3 || + $expr4) && + $expr5 +) { + // if body +} elseif ( + $expr1 && + ($expr3 || + $expr4) && + $expr5 +) { + // elseif body +} elseif ( + $expr1 && + ($expr3 || + $expr4) && + $expr5 +) { + // elseif body +} + +if ( + ($value == 1 || + $value == 2) + && + ($value == 3 || + $value == 4) +) { + return 5; +} + +// Reset to default. +// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly + +match ( + $expr1 + && $expr2 + && $expr3 +) { + // structure body +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php new file mode 100644 index 00000000..957ea546 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php @@ -0,0 +1,64 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the BooleanOperatorPlacement sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\BooleanOperatorPlacementSniff + */ +final class BooleanOperatorPlacementUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 10 => 1, + 16 => 1, + 28 => 1, + 34 => 1, + 75 => 1, + 81 => 1, + 90 => 1, + 98 => 1, + 104 => 1, + 125 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc new file mode 100644 index 00000000..9c037d6c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc @@ -0,0 +1,100 @@ + $foo + /* + * A multi-line comment. + */ + && $foo === true + ) { + break; + } + +match ( + $expr1 && + $expr2 && + $expr3 + ) { + // structure body +}; + +match ($expr1 && +$expr2 && + $expr3) { + // structure body +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..7ea61b1e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed @@ -0,0 +1,103 @@ + $foo + /* + * A multi-line comment. + */ + && $foo === true + ) { + break; + } + +match ( + $expr1 && + $expr2 && + $expr3 +) { + // structure body +}; + +match ( + $expr1 && + $expr2 && + $expr3 +) { + // structure body +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php new file mode 100644 index 00000000..69ef8b7c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php @@ -0,0 +1,73 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ControlStructureSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\ControlStructureSpacingSniff + */ +final class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 2, + 16 => 1, + 17 => 1, + 18 => 1, + 22 => 1, + 23 => 1, + 32 => 1, + 33 => 1, + 34 => 1, + 37 => 1, + 38 => 1, + 39 => 1, + 48 => 2, + 58 => 1, + 59 => 1, + 92 => 1, + 96 => 1, + 97 => 1, + 98 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc new file mode 100644 index 00000000..f21daaff --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc @@ -0,0 +1,50 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DeclareStatement sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\DeclareStatementSniff + */ +final class DeclareStatementUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'DeclareStatementUnitTest.1.inc': + return [ + 2 => 1, + 3 => 1, + 4 => 1, + 5 => 2, + 6 => 1, + 7 => 1, + 9 => 2, + 10 => 1, + 11 => 3, + 12 => 2, + 13 => 1, + 14 => 2, + 16 => 3, + 19 => 3, + 22 => 1, + 24 => 1, + 26 => 3, + 28 => 3, + 34 => 2, + 43 => 1, + 46 => 1, + 47 => 1, + 49 => 1, + ]; + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc new file mode 100644 index 00000000..1298ed71 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc @@ -0,0 +1,29 @@ + + +

    + + + +

    + + + + +

    Demo

    + + +
  • My page
  • +
  • Write
  • +
  • Sign out
  • + +
  • Sign in
  • + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc new file mode 100644 index 00000000..11102beb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc @@ -0,0 +1,5 @@ + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc new file mode 100644 index 00000000..5c3df1f3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc @@ -0,0 +1,13 @@ + + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FileHeader sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\FileHeaderSniff + */ +final class FileHeaderUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'FileHeaderUnitTest.2.inc': + return [ + 1 => 1, + 6 => 1, + 7 => 1, + 18 => 1, + 20 => 1, + 24 => 1, + ]; + case 'FileHeaderUnitTest.3.inc': + return [ + 9 => 1, + 18 => 1, + ]; + case 'FileHeaderUnitTest.4.inc': + return [ + 1 => 1, + 2 => 1, + 3 => 1, + 7 => 1, + ]; + case 'FileHeaderUnitTest.5.inc': + return [4 => 1]; + case 'FileHeaderUnitTest.7.inc': + case 'FileHeaderUnitTest.10.inc': + case 'FileHeaderUnitTest.11.inc': + return [1 => 1]; + case 'FileHeaderUnitTest.12.inc': + return [4 => 2]; + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc new file mode 100644 index 00000000..6d024eaa --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc @@ -0,0 +1,26 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ImportStatement sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\ImportStatementSniff + */ +final class ImportStatementUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 4 => 1, + 7 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc new file mode 100644 index 00000000..0dbdf010 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc @@ -0,0 +1,3 @@ + +hi diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc new file mode 100644 index 00000000..09be8fbe --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc @@ -0,0 +1,2 @@ + + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the OpenTag sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\OpenTagSniff + */ +final class OpenTagUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'OpenTagUnitTest.2.inc': + return [1 => 1]; + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc new file mode 100644 index 00000000..056d74c3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc @@ -0,0 +1,95 @@ + + * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the NullableWhitespace sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\NullableTypeDeclarationSniff + */ +final class NullableTypeDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + protected function getErrorList() + { + return [ + 23 => 1, + 24 => 1, + 25 => 1, + 30 => 1, + 31 => 1, + 32 => 1, + 43 => 2, + 48 => 1, + 50 => 1, + 51 => 1, + 53 => 1, + 57 => 2, + 58 => 2, + 59 => 2, + 87 => 1, + 90 => 1, + 91 => 1, + 95 => 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. + * + * @return array + */ + protected function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc new file mode 100644 index 00000000..59ab1aa7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc @@ -0,0 +1,66 @@ + $arg; + +return (!$a ? [ new class { public function b(): c {} } ] : []); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed new file mode 100644 index 00000000..cd79f781 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed @@ -0,0 +1,62 @@ + $arg; + +return (!$a ? [ new class { public function b(): c {} } ] : []); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php new file mode 100644 index 00000000..d2962e8d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php @@ -0,0 +1,66 @@ + + * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ReturnTypeDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\ReturnTypeDeclarationSniff + */ +final class ReturnTypeDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + protected function getErrorList() + { + return [ + 27 => 1, + 28 => 1, + 35 => 2, + 41 => 2, + 48 => 2, + 52 => 1, + 55 => 1, + 56 => 1, + 59 => 1, + 60 => 1, + 62 => 1, + 64 => 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. + * + * @return array + */ + protected function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc new file mode 100644 index 00000000..6ce930d9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc @@ -0,0 +1,14 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Keywords; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ShortFormTypeKeywords sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords\ShortFormTypeKeywordsSniff + */ +final class ShortFormTypeKeywordsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 5 => 1, + 7 => 1, + 13 => 1, + 14 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc new file mode 100644 index 00000000..3336fc2d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc @@ -0,0 +1,31 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Namespaces; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the CompoundNamespaceDepth sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces\CompoundNamespaceDepthSniff + */ +final class CompoundNamespaceDepthUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 10 => 1, + 18 => 1, + 21 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc new file mode 100644 index 00000000..14cf8e9d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc @@ -0,0 +1,79 @@ + $b) { + $variable =$foo ? 'foo' :'bar'; + $variable.='text'.'text'; +} + +$foo+= $a&$b; +$foo = $a|$b; +$foo =$a^$b; +$foo = ~$a; +$foo *=$a<<$b; +$foo = $a>>$b; + +function foo(&$a,& $b) {} + +$foo = $a and$b; +$foo = $a or $b; +$foo = $a xor$b; +$foo = !$a; +$foo = $a&&$b; +$foo = $a||$b; + +$foo = $a instanceof Foo; +$foo = $a instanceof$b; + +$foo .= 'hi' + .= 'there'; + +$foo .= 'hi' +.= 'there'; + +$foo .= 'hi' // comment +.= 'there'; + +$foo/*comment*/=/*comment*/$a/*comment*/and/*comment*/$b; + +$foo .=//comment +'string' .=/*comment*/ +'string'; + +$foo = $foo ?: 'bar'; +$foo = $foo?:'bar'; + +try { +} catch (ExceptionType1|ExceptionType2 $e) { +} + +if (strpos($tokenContent, 'b"') === 0 && substr($tokenContent, -1) === '"') {} + +$oldConstructorPos = +1; +return -$content; + +function name($a = -1) {} + +$a =& $ref; +$a = [ 'a' => &$something ]; + +$fn = fn(array &$one) => 1; +$fn = fn(array & $one) => 1; + +$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); + +function issue3267(string|int ...$values) {} + +function setDefault(#[ImportValue( + constraints: [ + [ + Assert\Type::class, + ['type' => 'bool'], + ], + ] + )] ?bool $value = null): void + { + // Do something + } + +declare(strict_types=1); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc.fixed new file mode 100644 index 00000000..0f52f1cf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc.fixed @@ -0,0 +1,79 @@ + $b) { + $variable = $foo ? 'foo' : 'bar'; + $variable .= 'text' . 'text'; +} + +$foo += $a & $b; +$foo = $a | $b; +$foo = $a ^ $b; +$foo = ~$a; +$foo *= $a << $b; +$foo = $a >> $b; + +function foo(&$a,& $b) {} + +$foo = $a and $b; +$foo = $a or $b; +$foo = $a xor $b; +$foo = !$a; +$foo = $a && $b; +$foo = $a || $b; + +$foo = $a instanceof Foo; +$foo = $a instanceof $b; + +$foo .= 'hi' + .= 'there'; + +$foo .= 'hi' +.= 'there'; + +$foo .= 'hi' // comment +.= 'there'; + +$foo/*comment*/ = /*comment*/$a/*comment*/ and /*comment*/$b; + +$foo .= //comment +'string' .= /*comment*/ +'string'; + +$foo = $foo ?: 'bar'; +$foo = $foo ?: 'bar'; + +try { +} catch (ExceptionType1 | ExceptionType2 $e) { +} + +if (strpos($tokenContent, 'b"') === 0 && substr($tokenContent, -1) === '"') {} + +$oldConstructorPos = +1; +return -$content; + +function name($a = -1) {} + +$a =& $ref; +$a = [ 'a' => &$something ]; + +$fn = fn(array &$one) => 1; +$fn = fn(array & $one) => 1; + +$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); + +function issue3267(string|int ...$values) {} + +function setDefault(#[ImportValue( + constraints: [ + [ + Assert\Type::class, + ['type' => 'bool'], + ], + ] + )] ?bool $value = null): void + { + // Do something + } + +declare(strict_types=1); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.2.inc new file mode 100644 index 00000000..3a0dbac3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.2.inc @@ -0,0 +1,3 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Operators; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the OperatorSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators\OperatorSpacingSniff + */ +final class OperatorSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'OperatorSpacingUnitTest.1.inc': + return [ + 2 => 1, + 3 => 2, + 4 => 1, + 5 => 2, + 6 => 4, + 9 => 3, + 10 => 2, + 11 => 3, + 13 => 3, + 14 => 2, + 18 => 1, + 20 => 1, + 22 => 2, + 23 => 2, + 26 => 1, + 37 => 4, + 39 => 1, + 40 => 1, + 44 => 2, + 47 => 2, + ]; + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc new file mode 100644 index 00000000..84ea24b2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc @@ -0,0 +1,22 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Properties; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ConstantVisibility sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties\ConstantVisibilitySniff + */ +final class ConstantVisibilityUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [ + 4 => 1, + 12 => 1, + 21 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc new file mode 100644 index 00000000..152121cf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc @@ -0,0 +1,221 @@ + + * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR12\Tests\Traits; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the UseDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Traits\UseDeclarationSniff + */ +final class UseDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 15 => 1, + 29 => 2, + 30 => 1, + 42 => 1, + 57 => 4, + 59 => 3, + 61 => 1, + 63 => 5, + 65 => 1, + 71 => 1, + 73 => 2, + 76 => 1, + 86 => 2, + 103 => 1, + 112 => 1, + 122 => 1, + 132 => 1, + 157 => 1, + 165 => 1, + 170 => 1, + 208 => 1, + 219 => 3, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml new file mode 100644 index 00000000..2f9ae0a4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml @@ -0,0 +1,348 @@ + + + The PSR-12 coding standard. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + error + Method name "%s" must not be prefixed with an underscore to indicate visibility + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + + + + + + + + + + + + + + + 0 + + + 0 + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml new file mode 100644 index 00000000..4e56bc04 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml @@ -0,0 +1,23 @@ + + + + + + + class Foo +{ +} + ]]> + + + class Foo +{ +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml new file mode 100644 index 00000000..042c0c6c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml @@ -0,0 +1,81 @@ + + + + + + + bar; +} + ]]> + + + _bar; +} + ]]> + + + + + private $bar; +} + ]]> + + + var $bar; +} + ]]> + + + + + + + + $bar, $baz; +} + ]]> + + + + + static $bar; + private $baz; +} + ]]> + + + static protected $bar; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml new file mode 100644 index 00000000..dcbe98f5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml @@ -0,0 +1,23 @@ + + + + + + + $foo) { + $var = 1; +} + ]]> + + + $foo ) { + $var = 1; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml new file mode 100644 index 00000000..a22dd179 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml @@ -0,0 +1,27 @@ + + + + + + + elseif ($bar) { + $var = 2; +} + ]]> + + + else if ($bar) { + $var = 2; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml new file mode 100644 index 00000000..1d6d053d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml @@ -0,0 +1,104 @@ + + + + + + + case 'bar': + break; +} + ]]> + + + case 'bar': + break; +} + ]]> + + + + + 'bar': + break; +} + ]]> + + + 'bar': + break; +} + ]]> + + + + + : + break; + default: + break; +} + ]]> + + + : + break; + default : + break; +} + ]]> + + + + + break; +} + ]]> + + + break; +} + ]]> + + + + + // no break + default: + break; +} + ]]> + + + : + break; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml new file mode 100644 index 00000000..60d5e7fb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + ]]> + + + ?> + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml new file mode 100644 index 00000000..d6d3aad1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml new file mode 100644 index 00000000..257bcab0 --- /dev/null +++ b/trunk/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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml new file mode 100644 index 00000000..3b1b6555 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml @@ -0,0 +1,26 @@ + + + + + + + } + ]]> + + + +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml new file mode 100644 index 00000000..e45469e8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml @@ -0,0 +1,51 @@ + + + + + + + bar() + { + } +} + ]]> + + + _bar() + { + } +} + ]]> + + + + + final public static function bar() + { + } +} + ]]> + + + static public final function bar() + { + } +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml new file mode 100644 index 00000000..1f4d389a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml @@ -0,0 +1,22 @@ + + + + + + + +use \Baz; + ]]> + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml new file mode 100644 index 00000000..4082603c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml @@ -0,0 +1,57 @@ + + + + + + + + + + \Foo, \Bar; + ]]> + + + + + + + + + + + + + +class Baz +{ +} + ]]> + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php new file mode 100644 index 00000000..887c552e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php @@ -0,0 +1,540 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff as PEARClassDeclarationSniff; +use PHP_CodeSniffer\Util\Tokens; + +class ClassDeclarationSniff extends PEARClassDeclarationSniff +{ + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + // We want all the errors from the PEAR standard, plus some of our own. + parent::process($phpcsFile, $stackPtr); + + // Just in case. + $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + $this->processOpen($phpcsFile, $stackPtr); + $this->processClose($phpcsFile, $stackPtr); + + }//end process() + + + /** + * Processes the opening section of a class declaration. + * + * @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 processOpen(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $stackPtrType = strtolower($tokens[$stackPtr]['content']); + + // Check alignment of the keyword and braces. + $classModifiers = [ + T_ABSTRACT => T_ABSTRACT, + T_FINAL => T_FINAL, + T_READONLY => T_READONLY, + ]; + + $prevNonSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + if (isset($classModifiers[$tokens[$prevNonEmpty]['code']]) === true) { + $spaces = 0; + $errorCode = 'SpaceBeforeKeyword'; + if ($tokens[$prevNonEmpty]['line'] !== $tokens[$stackPtr]['line']) { + $spaces = 'newline'; + $errorCode = 'NewlineBeforeKeyword'; + } else if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { + $spaces = $tokens[($stackPtr - 1)]['length']; + } + + if ($spaces !== 1) { + $error = 'Expected 1 space between %s and %s keywords; %s found'; + $data = [ + strtolower($tokens[$prevNonEmpty]['content']), + $stackPtrType, + $spaces, + ]; + + if ($prevNonSpace !== $prevNonEmpty) { + // Comment found between modifier and class keyword. Do not auto-fix. + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } else { + $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); + if ($fix === true) { + if ($spaces === 0) { + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + } else { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); + for ($i = ($stackPtr - 2); $i > $prevNonSpace; $i--) { + $phpcsFile->fixer->replaceToken($i, ' '); + } + + $phpcsFile->fixer->endChangeset(); + } + } + } + }//end if + }//end if + + // We'll need the indent of the class/interface declaration for later. + $classIndent = 0; + for ($i = ($stackPtr - 1); $i > 0; $i--) { + if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { + continue; + } + + // We changed lines. + if ($tokens[($i + 1)]['code'] === T_WHITESPACE) { + $classIndent = $tokens[($i + 1)]['length']; + } + + break; + } + + $className = null; + $checkSpacing = true; + + if ($tokens[$stackPtr]['code'] !== T_ANON_CLASS) { + $className = $phpcsFile->findNext(T_STRING, $stackPtr); + } else { + // Ignore the spacing check if this is a simple anon class. + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($next === $tokens[$stackPtr]['scope_opener'] + && $tokens[$next]['line'] > $tokens[$stackPtr]['line'] + ) { + $checkSpacing = false; + } + } + + if ($checkSpacing === true) { + // Spacing of the keyword. + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + $gap = 0; + } else if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { + $gap = 'newline'; + } else { + $gap = $tokens[($stackPtr + 1)]['length']; + } + + if ($gap !== 1) { + $error = 'Expected 1 space after %s keyword; %s found'; + $data = [ + $stackPtrType, + $gap, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword', $data); + if ($fix === true) { + if ($gap === 0) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } else { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + } + }//end if + + // Check after the class/interface name. + if ($className !== null + && $tokens[($className + 2)]['line'] === $tokens[$className]['line'] + ) { + $gap = $tokens[($className + 1)]['content']; + if (strlen($gap) !== 1) { + $found = strlen($gap); + $error = 'Expected 1 space after %s name; %s found'; + $data = [ + $stackPtrType, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $className, 'SpaceAfterName', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($className + 1), ' '); + } + } + } + + $openingBrace = $tokens[$stackPtr]['scope_opener']; + + // Check positions of the extends and implements keywords. + $compareToken = $stackPtr; + $compareType = 'name'; + if ($tokens[$stackPtr]['code'] === T_ANON_CLASS) { + if (isset($tokens[$stackPtr]['parenthesis_opener']) === true) { + $compareToken = $tokens[$stackPtr]['parenthesis_closer']; + $compareType = 'closing parenthesis'; + } else { + $compareType = 'keyword'; + } + } + + foreach (['extends', 'implements'] as $keywordType) { + $keyword = $phpcsFile->findNext(constant('T_'.strtoupper($keywordType)), ($compareToken + 1), $openingBrace); + if ($keyword !== false) { + if ($tokens[$keyword]['line'] !== $tokens[$compareToken]['line']) { + $error = 'The '.$keywordType.' keyword must be on the same line as the %s '.$compareType; + $data = [$stackPtrType]; + $fix = $phpcsFile->addFixableError($error, $keyword, ucfirst($keywordType).'Line', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $comments = []; + + for ($i = ($compareToken + 1); $i < $keyword; ++$i) { + if ($tokens[$i]['code'] === T_COMMENT) { + $comments[] = trim($tokens[$i]['content']); + } + + if ($tokens[$i]['code'] === T_WHITESPACE + || $tokens[$i]['code'] === T_COMMENT + ) { + $phpcsFile->fixer->replaceToken($i, ' '); + } + } + + $phpcsFile->fixer->addContent($compareToken, ' '); + if (empty($comments) === false) { + $i = $keyword; + while ($tokens[($i + 1)]['line'] === $tokens[$keyword]['line']) { + ++$i; + } + + $phpcsFile->fixer->addContentBefore($i, ' '.implode(' ', $comments)); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + } else { + // Check the whitespace before. Whitespace after is checked + // later by looking at the whitespace before the first class name + // in the list. + $gap = $tokens[($keyword - 1)]['length']; + if ($gap !== 1) { + $error = 'Expected 1 space before '.$keywordType.' keyword; %s found'; + $data = [$gap]; + $fix = $phpcsFile->addFixableError($error, $keyword, 'SpaceBefore'.ucfirst($keywordType), $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($keyword - 1), ' '); + } + } + }//end if + }//end if + }//end foreach + + // Check each of the extends/implements class names. If the extends/implements + // keyword is the last content on the line, it means we need to check for + // the multi-line format, so we do not include the class names + // from the extends/implements list in the following check. + // Note that classes can only extend one other class, so they can't use a + // multi-line extends format, whereas an interface can extend multiple + // other interfaces, and so uses a multi-line extends format. + if ($tokens[$stackPtr]['code'] === T_INTERFACE) { + $keywordTokenType = T_EXTENDS; + } else { + $keywordTokenType = T_IMPLEMENTS; + } + + $implements = $phpcsFile->findNext($keywordTokenType, ($stackPtr + 1), $openingBrace); + $multiLineImplements = false; + if ($implements !== false) { + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $implements, true); + if ($tokens[$prev]['line'] !== $tokens[$implements]['line']) { + $multiLineImplements = true; + } + } + + $find = [ + T_STRING, + $keywordTokenType, + ]; + + if ($className !== null) { + $start = $className; + } else if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { + $start = $tokens[$stackPtr]['parenthesis_closer']; + } else { + $start = $stackPtr; + } + + $classNames = []; + $nextClass = $phpcsFile->findNext($find, ($start + 2), ($openingBrace - 1)); + while ($nextClass !== false) { + $classNames[] = $nextClass; + $nextClass = $phpcsFile->findNext($find, ($nextClass + 1), ($openingBrace - 1)); + } + + $classCount = count($classNames); + $checkingImplements = false; + $implementsToken = null; + foreach ($classNames as $n => $className) { + if ($tokens[$className]['code'] === $keywordTokenType) { + $checkingImplements = true; + $implementsToken = $className; + + continue; + } + + if ($checkingImplements === true + && $multiLineImplements === true + && ($tokens[($className - 1)]['code'] !== T_NS_SEPARATOR + || ($tokens[($className - 2)]['code'] !== T_STRING + && $tokens[($className - 2)]['code'] !== T_NAMESPACE)) + ) { + $prev = $phpcsFile->findPrevious( + [ + T_NS_SEPARATOR, + T_WHITESPACE, + ], + ($className - 1), + $implements, + true + ); + + if ($prev === $implementsToken && $tokens[$className]['line'] !== ($tokens[$prev]['line'] + 1)) { + if ($keywordTokenType === T_EXTENDS) { + $error = 'The first item in a multi-line extends list must be on the line following the extends keyword'; + $fix = $phpcsFile->addFixableError($error, $className, 'FirstExtendsInterfaceSameLine'); + } else { + $error = 'The first item in a multi-line implements list must be on the line following the implements keyword'; + $fix = $phpcsFile->addFixableError($error, $className, 'FirstInterfaceSameLine'); + } + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prev + 1); $i < $className; $i++) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addNewline($prev); + $phpcsFile->fixer->endChangeset(); + } + } else if ((isset(Tokens::$commentTokens[$tokens[$prev]['code']]) === false + && $tokens[$prev]['line'] !== ($tokens[$className]['line'] - 1)) + || $tokens[$prev]['line'] === $tokens[$className]['line'] + ) { + if ($keywordTokenType === T_EXTENDS) { + $error = 'Only one interface may be specified per line in a multi-line extends declaration'; + $fix = $phpcsFile->addFixableError($error, $className, 'ExtendsInterfaceSameLine'); + } else { + $error = 'Only one interface may be specified per line in a multi-line implements declaration'; + $fix = $phpcsFile->addFixableError($error, $className, 'InterfaceSameLine'); + } + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prev + 1); $i < $className; $i++) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addNewline($prev); + $phpcsFile->fixer->endChangeset(); + } + } else { + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($className - 1), $implements); + if ($tokens[$prev]['line'] !== $tokens[$className]['line']) { + $found = 0; + } else { + $found = $tokens[$prev]['length']; + } + + $expected = ($classIndent + $this->indent); + if ($found !== $expected) { + $error = 'Expected %s spaces before interface name; %s found'; + $data = [ + $expected, + $found, + ]; + $fix = $phpcsFile->addFixableError($error, $className, 'InterfaceWrongIndent', $data); + if ($fix === true) { + $padding = str_repeat(' ', $expected); + if ($found === 0) { + $phpcsFile->fixer->addContent($prev, $padding); + } else { + $phpcsFile->fixer->replaceToken($prev, $padding); + } + } + } + }//end if + } else if ($tokens[($className - 1)]['code'] !== T_NS_SEPARATOR + || ($tokens[($className - 2)]['code'] !== T_STRING + && $tokens[($className - 2)]['code'] !== T_NAMESPACE) + ) { + // Not part of a longer fully qualified or namespace relative class name. + if ($tokens[($className - 1)]['code'] === T_COMMA + || ($tokens[($className - 1)]['code'] === T_NS_SEPARATOR + && $tokens[($className - 2)]['code'] === T_COMMA) + ) { + $error = 'Expected 1 space before "%s"; 0 found'; + $data = [$tokens[$className]['content']]; + $fix = $phpcsFile->addFixableError($error, ($nextComma + 1), 'NoSpaceBeforeName', $data); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore(($nextComma + 1), ' '); + } + } else { + if ($tokens[($className - 1)]['code'] === T_NS_SEPARATOR) { + $prev = ($className - 2); + } else { + $prev = ($className - 1); + } + + $last = $phpcsFile->findPrevious(T_WHITESPACE, $prev, null, true); + $content = $phpcsFile->getTokensAsString(($last + 1), ($prev - $last)); + if ($content !== ' ') { + $found = strlen($content); + + $error = 'Expected 1 space before "%s"; %s found'; + $data = [ + $tokens[$className]['content'], + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $className, 'SpaceBeforeName', $data); + if ($fix === true) { + if ($tokens[$prev]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($prev, ' '); + while ($tokens[--$prev]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($prev, ' '); + } + + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->addContent($prev, ' '); + } + } + }//end if + }//end if + }//end if + + if ($checkingImplements === true + && $tokens[($className + 1)]['code'] !== T_NS_SEPARATOR + && $tokens[($className + 1)]['code'] !== T_COMMA + ) { + if ($n !== ($classCount - 1)) { + // This is not the last class name, and the comma + // is not where we expect it to be. + if ($tokens[($className + 2)]['code'] !== $keywordTokenType) { + $error = 'Expected 0 spaces between "%s" and comma; %s found'; + $data = [ + $tokens[$className]['content'], + $tokens[($className + 1)]['length'], + ]; + + $fix = $phpcsFile->addFixableError($error, $className, 'SpaceBeforeComma', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($className + 1), ''); + } + } + } + + $nextComma = $phpcsFile->findNext(T_COMMA, $className); + } else { + $nextComma = ($className + 1); + }//end if + }//end foreach + + }//end processOpen() + + + /** + * Processes the closing section of a class declaration. + * + * @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 processClose(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Check that the closing brace comes right after the code body. + $closeBrace = $tokens[$stackPtr]['scope_closer']; + $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); + if ($prevContent !== $tokens[$stackPtr]['scope_opener'] + && $tokens[$prevContent]['line'] !== ($tokens[$closeBrace]['line'] - 1) + ) { + $error = 'The closing brace for the %s must go on the next line after the body'; + $data = [$tokens[$stackPtr]['content']]; + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'CloseBraceAfterBody', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + 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->addNewline($prevContent); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + + if ($tokens[$stackPtr]['code'] !== T_ANON_CLASS) { + // Check the closing brace is on it's own line, but allow + // for comments like "//end class". + $ignoreTokens = Tokens::$phpcsCommentTokens; + $ignoreTokens[] = T_WHITESPACE; + $ignoreTokens[] = T_COMMENT; + $ignoreTokens[] = T_SEMICOLON; + $nextContent = $phpcsFile->findNext($ignoreTokens, ($closeBrace + 1), null, true); + if ($tokens[$nextContent]['line'] === $tokens[$closeBrace]['line']) { + $type = strtolower($tokens[$stackPtr]['content']); + $error = 'Closing %s brace must be on a line by itself'; + $data = [$type]; + $phpcsFile->addError($error, $closeBrace, 'CloseBraceSameLine', $data); + } + } + + }//end processClose() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php new file mode 100644 index 00000000..29d7023e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php @@ -0,0 +1,226 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes; + +use Exception; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; +use PHP_CodeSniffer\Util\Tokens; + +class PropertyDeclarationSniff extends AbstractVariableSniff +{ + + + /** + * Processes the function tokens within the class. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processMemberVar(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['content'][1] === '_') { + $error = 'Property name "%s" should not be prefixed with an underscore to indicate visibility'; + $data = [$tokens[$stackPtr]['content']]; + $phpcsFile->addWarning($error, $stackPtr, 'Underscore', $data); + } + + // Detect multiple properties defined at the same time. Throw an error + // for this, but also only process the first property in the list so we don't + // repeat errors. + $find = Tokens::$scopeModifiers; + $find[] = T_VARIABLE; + $find[] = T_VAR; + $find[] = T_READONLY; + $find[] = T_SEMICOLON; + $find[] = T_OPEN_CURLY_BRACKET; + + $prev = $phpcsFile->findPrevious($find, ($stackPtr - 1)); + if ($tokens[$prev]['code'] === T_VARIABLE) { + return; + } + + if ($tokens[$prev]['code'] === T_VAR) { + $error = 'The var keyword must not be used to declare a property'; + $phpcsFile->addError($error, $stackPtr, 'VarUsed'); + } + + $next = $phpcsFile->findNext([T_VARIABLE, T_SEMICOLON], ($stackPtr + 1)); + if ($next !== false && $tokens[$next]['code'] === T_VARIABLE) { + $error = 'There must not be more than one property declared per statement'; + $phpcsFile->addError($error, $stackPtr, 'Multiple'); + } + + try { + $propertyInfo = $phpcsFile->getMemberProperties($stackPtr); + if (empty($propertyInfo) === true) { + return; + } + } catch (Exception $e) { + // Turns out not to be a property after all. + return; + } + + if ($propertyInfo['type'] !== '') { + $typeToken = $propertyInfo['type_end_token']; + $error = 'There must be 1 space after the property type declaration; %s found'; + if ($tokens[($typeToken + 1)]['code'] !== T_WHITESPACE) { + $data = ['0']; + $fix = $phpcsFile->addFixableError($error, $typeToken, 'SpacingAfterType', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($typeToken, ' '); + } + } else if ($tokens[($typeToken + 1)]['content'] !== ' ') { + $next = $phpcsFile->findNext(T_WHITESPACE, ($typeToken + 1), null, true); + if ($tokens[$next]['line'] !== $tokens[$typeToken]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($typeToken + 1)]['length']; + } + + $data = [$found]; + + $nextNonWs = $phpcsFile->findNext(Tokens::$emptyTokens, ($typeToken + 1), null, true); + if ($nextNonWs !== $next) { + $phpcsFile->addError($error, $typeToken, 'SpacingAfterType', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $typeToken, 'SpacingAfterType', $data); + if ($fix === true) { + if ($found === 'newline') { + $phpcsFile->fixer->beginChangeset(); + for ($x = ($typeToken + 1); $x < $next; $x++) { + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addContent($typeToken, ' '); + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->replaceToken(($typeToken + 1), ' '); + } + } + } + }//end if + }//end if + + if ($propertyInfo['scope_specified'] === false) { + $error = 'Visibility must be declared on property "%s"'; + $data = [$tokens[$stackPtr]['content']]; + $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) { + $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; + } + + $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($readonlyPtr, $propertyInfo['scope'].' '); + + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + }//end processMemberVar() + + + /** + * Processes normal variables. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processVariable(File $phpcsFile, $stackPtr) + { + /* + We don't care about normal variables. + */ + + }//end processVariable() + + + /** + * Processes variables in double quoted strings. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processVariableInString(File $phpcsFile, $stackPtr) + { + /* + We don't care about normal variables. + */ + + }//end processVariableInString() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php new file mode 100644 index 00000000..d855dbd6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php @@ -0,0 +1,141 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ControlStructureSpacingSniff implements Sniff +{ + + /** + * How many spaces should follow the opening bracket. + * + * @var integer + */ + public $requiredSpacesAfterOpen = 0; + + /** + * How many spaces should precede the closing bracket. + * + * @var integer + */ + public $requiredSpacesBeforeClose = 0; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_IF, + T_WHILE, + T_FOREACH, + T_FOR, + T_SWITCH, + T_ELSEIF, + T_CATCH, + T_MATCH, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; + $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false + || isset($tokens[$stackPtr]['parenthesis_closer']) === false + ) { + return; + } + + $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; + $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; + $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($parenOpener + 1), null, true); + if (in_array($tokens[$nextContent]['code'], Tokens::$commentTokens, true) === false) { + $spaceAfterOpen = 0; + if ($tokens[($parenOpener + 1)]['code'] === T_WHITESPACE) { + if (strpos($tokens[($parenOpener + 1)]['content'], $phpcsFile->eolChar) !== false) { + $spaceAfterOpen = 'newline'; + } else { + $spaceAfterOpen = $tokens[($parenOpener + 1)]['length']; + } + } + + $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', $spaceAfterOpen); + + if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { + $error = 'Expected %s spaces after opening bracket; %s found'; + $data = [ + $this->requiredSpacesAfterOpen, + $spaceAfterOpen, + ]; + $fix = $phpcsFile->addFixableError($error, ($parenOpener + 1), 'SpacingAfterOpenBrace', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); + if ($spaceAfterOpen === 0) { + $phpcsFile->fixer->addContent($parenOpener, $padding); + } else if ($spaceAfterOpen === 'newline') { + $phpcsFile->fixer->replaceToken(($parenOpener + 1), ''); + } else { + $phpcsFile->fixer->replaceToken(($parenOpener + 1), $padding); + } + } + } + }//end if + + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($parenCloser - 1), $parenOpener, true); + if ($tokens[$prev]['line'] === $tokens[$parenCloser]['line']) { + $spaceBeforeClose = 0; + if ($tokens[($parenCloser - 1)]['code'] === T_WHITESPACE) { + $spaceBeforeClose = strlen(ltrim($tokens[($parenCloser - 1)]['content'], $phpcsFile->eolChar)); + } + + $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', $spaceBeforeClose); + + if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) { + $error = 'Expected %s spaces before closing bracket; %s found'; + $data = [ + $this->requiredSpacesBeforeClose, + $spaceBeforeClose, + ]; + $fix = $phpcsFile->addFixableError($error, ($parenCloser - 1), 'SpaceBeforeCloseBrace', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); + if ($spaceBeforeClose === 0) { + $phpcsFile->fixer->addContentBefore($parenCloser, $padding); + } else { + $phpcsFile->fixer->replaceToken(($parenCloser - 1), $padding); + } + } + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php new file mode 100644 index 00000000..7f5e97c1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php @@ -0,0 +1,72 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ElseIfDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_ELSE, + T_ELSEIF, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if ($tokens[$stackPtr]['code'] === T_ELSEIF) { + $phpcsFile->recordMetric($stackPtr, 'Use of ELSE IF or ELSEIF', 'elseif'); + return; + } + + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$next]['code'] === T_IF) { + $phpcsFile->recordMetric($stackPtr, 'Use of ELSE IF or ELSEIF', 'else if'); + $error = 'Usage of ELSE IF is discouraged; use ELSEIF instead'; + $fix = $phpcsFile->addFixableWarning($error, $stackPtr, 'NotAllowed'); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($stackPtr, 'elseif'); + for ($i = ($stackPtr + 1); $i <= $next; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php new file mode 100644 index 00000000..4b3b5ad2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php @@ -0,0 +1,396 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class SwitchDeclarationSniff implements Sniff +{ + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_SWITCH]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // We can't process SWITCH statements unless we know where they start and end. + if (isset($tokens[$stackPtr]['scope_opener']) === false + || isset($tokens[$stackPtr]['scope_closer']) === false + ) { + return; + } + + $switch = $tokens[$stackPtr]; + $nextCase = $stackPtr; + $caseAlignment = ($switch['column'] + $this->indent); + + while (($nextCase = $this->findNextCase($phpcsFile, ($nextCase + 1), $switch['scope_closer'])) !== false) { + if ($tokens[$nextCase]['code'] === T_DEFAULT) { + $type = 'default'; + } else { + $type = 'case'; + } + + if ($tokens[$nextCase]['content'] !== strtolower($tokens[$nextCase]['content'])) { + $expected = strtolower($tokens[$nextCase]['content']); + $error = strtoupper($type).' keyword must be lowercase; expected "%s" but found "%s"'; + $data = [ + $expected, + $tokens[$nextCase]['content'], + ]; + + $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'NotLower', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($nextCase, $expected); + } + } + + if ($type === 'case' + && ($tokens[($nextCase + 1)]['code'] !== T_WHITESPACE + || $tokens[($nextCase + 1)]['content'] !== ' ') + ) { + $error = 'CASE keyword must be followed by a single space'; + $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpacingAfterCase'); + if ($fix === true) { + if ($tokens[($nextCase + 1)]['code'] !== T_WHITESPACE) { + $phpcsFile->fixer->addContent($nextCase, ' '); + } else { + $phpcsFile->fixer->replaceToken(($nextCase + 1), ' '); + } + } + } + + $opener = $tokens[$nextCase]['scope_opener']; + $nextCloser = $tokens[$nextCase]['scope_closer']; + if ($tokens[$opener]['code'] === T_COLON) { + if ($tokens[($opener - 1)]['code'] === T_WHITESPACE) { + $error = 'There must be no space before the colon in a '.strtoupper($type).' statement'; + $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpaceBeforeColon'.strtoupper($type)); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($opener - 1), ''); + } + } + + for ($next = ($opener + 1); $next < $nextCloser; $next++) { + if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === false + || (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true + && $tokens[$next]['line'] !== $tokens[$opener]['line']) + ) { + break; + } + } + + if ($tokens[$next]['line'] !== ($tokens[$opener]['line'] + 1)) { + $error = 'The '.strtoupper($type).' body must start on the line following the statement'; + $fix = $phpcsFile->addFixableError($error, $nextCase, 'BodyOnNextLine'.strtoupper($type)); + if ($fix === true) { + if ($tokens[$next]['line'] === $tokens[$opener]['line']) { + $padding = str_repeat(' ', ($caseAlignment + $this->indent - 1)); + $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$padding); + } else { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($opener + 1); $i < $next; $i++) { + if ($tokens[$i]['line'] === $tokens[$opener]['line']) { + // Ignore trailing comments. + continue; + } + + if ($tokens[$i]['line'] === $tokens[$next]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + + if ($tokens[$nextCloser]['scope_condition'] === $nextCase) { + // Only need to check some things once, even if the + // closer is shared between multiple case statements, or even + // the default case. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($nextCloser - 1), $nextCase, true); + if ($tokens[$prev]['line'] === $tokens[$nextCloser]['line']) { + $error = 'Terminating statement must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $nextCloser, 'BreakNotNewLine'); + if ($fix === true) { + $phpcsFile->fixer->addNewLine($prev); + $phpcsFile->fixer->replaceToken($nextCloser, trim($tokens[$nextCloser]['content'])); + } + } else { + $diff = ($tokens[$nextCase]['column'] + $this->indent - $tokens[$nextCloser]['column']); + if ($diff !== 0) { + $error = 'Terminating statement must be indented to the same level as the CASE body'; + $fix = $phpcsFile->addFixableError($error, $nextCloser, 'BreakIndent'); + if ($fix === true) { + if ($diff > 0) { + $phpcsFile->fixer->addContentBefore($nextCloser, str_repeat(' ', $diff)); + } else { + $phpcsFile->fixer->substrToken(($nextCloser - 1), 0, $diff); + } + } + } + }//end if + }//end if + } else { + $error = strtoupper($type).' statements must be defined using a colon'; + $phpcsFile->addError($error, $nextCase, 'WrongOpener'.$type); + }//end if + + // We only want cases from here on in. + if ($type !== 'case') { + continue; + } + + $nextCode = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), $nextCloser, true); + + if ($tokens[$nextCode]['code'] !== T_CASE && $tokens[$nextCode]['code'] !== T_DEFAULT) { + // This case statement has content. If the next case or default comes + // before the closer, it means we don't have an obvious terminating + // statement and need to make some more effort to find one. If we + // don't, we do need a comment. + $nextCode = $this->findNextCase($phpcsFile, ($opener + 1), $nextCloser); + if ($nextCode !== false) { + $prevCode = $phpcsFile->findPrevious(T_WHITESPACE, ($nextCode - 1), $nextCase, true); + if (isset(Tokens::$commentTokens[$tokens[$prevCode]['code']]) === false + && $this->findNestedTerminator($phpcsFile, ($opener + 1), $nextCode) === false + ) { + $error = 'There must be a comment when fall-through is intentional in a non-empty case body'; + $phpcsFile->addError($error, $nextCase, 'TerminatingComment'); + } + } + } + }//end while + + }//end process() + + + /** + * Find the next CASE or DEFAULT statement from a point in the file. + * + * Note that nested switches are ignored. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position to start looking at. + * @param int $end The position to stop looking at. + * + * @return int|false + */ + private function findNextCase($phpcsFile, $stackPtr, $end) + { + $tokens = $phpcsFile->getTokens(); + while (($stackPtr = $phpcsFile->findNext([T_CASE, T_DEFAULT, T_SWITCH], $stackPtr, $end)) !== false) { + // Skip nested SWITCH statements; they are handled on their own. + if ($tokens[$stackPtr]['code'] === T_SWITCH) { + $stackPtr = $tokens[$stackPtr]['scope_closer']; + continue; + } + + break; + } + + return $stackPtr; + + }//end findNextCase() + + + /** + * Returns the position of the nested terminating statement. + * + * Returns false if no terminating statement was found. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position to start looking at. + * @param int $end The position to stop looking at. + * + * @return int|bool + */ + private function findNestedTerminator($phpcsFile, $stackPtr, $end) + { + $tokens = $phpcsFile->getTokens(); + + $lastToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($end - 1), $stackPtr, true); + if ($lastToken === false) { + return false; + } + + if ($tokens[$lastToken]['code'] === T_CLOSE_CURLY_BRACKET) { + // We found a closing curly bracket and want to check if its block + // belongs to a SWITCH, IF, ELSEIF or ELSE, TRY, CATCH OR FINALLY clause. + // If yes, we continue searching for a terminating statement within that + // block. Note that we have to make sure that every block of + // the entire if/else/switch statement has a terminating statement. + // For a try/catch/finally statement, either the finally block has + // to have a terminating statement or every try/catch block has to have one. + $currentCloser = $lastToken; + $hasElseBlock = false; + $hasCatchWithoutTerminator = false; + do { + $scopeOpener = $tokens[$currentCloser]['scope_opener']; + $scopeCloser = $tokens[$currentCloser]['scope_closer']; + + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($scopeOpener - 1), $stackPtr, true); + if ($prevToken === false) { + return false; + } + + // SWITCH, IF, ELSEIF, CATCH clauses possess a condition we have to account for. + if ($tokens[$prevToken]['code'] === T_CLOSE_PARENTHESIS) { + $prevToken = $tokens[$prevToken]['parenthesis_owner']; + } + + if ($tokens[$prevToken]['code'] === T_IF) { + // If we have not encountered an ELSE clause by now, we cannot + // be sure that the whole statement terminates in every case. + if ($hasElseBlock === false) { + return false; + } + + return $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); + } else if ($tokens[$prevToken]['code'] === T_ELSEIF + || $tokens[$prevToken]['code'] === T_ELSE + ) { + // If we find a terminating statement within this block, + // we continue with the previous ELSEIF or IF clause. + $hasTerminator = $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); + if ($hasTerminator === false) { + return false; + } + + $currentCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), $stackPtr, true); + if ($tokens[$prevToken]['code'] === T_ELSE) { + $hasElseBlock = true; + } + } else if ($tokens[$prevToken]['code'] === T_FINALLY) { + // If we find a terminating statement within this block, + // the whole try/catch/finally statement is covered. + $hasTerminator = $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); + if ($hasTerminator !== false) { + return $hasTerminator; + } + + // Otherwise, we continue with the previous TRY or CATCH clause. + $currentCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), $stackPtr, true); + } else if ($tokens[$prevToken]['code'] === T_TRY) { + // If we've seen CATCH blocks without terminator statement and + // have not seen a FINALLY *with* a terminator statement, we + // don't even need to bother checking the TRY. + if ($hasCatchWithoutTerminator === true) { + return false; + } + + return $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); + } else if ($tokens[$prevToken]['code'] === T_CATCH) { + // Keep track of seen catch statements without terminating statement, + // but don't bow out yet as there may still be a FINALLY clause + // with a terminating statement before the CATCH. + $hasTerminator = $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); + if ($hasTerminator === false) { + $hasCatchWithoutTerminator = true; + } + + $currentCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), $stackPtr, true); + } else if ($tokens[$prevToken]['code'] === T_SWITCH) { + $hasDefaultBlock = false; + $endOfSwitch = $tokens[$prevToken]['scope_closer']; + $nextCase = $prevToken; + + // We look for a terminating statement within every blocks. + while (($nextCase = $this->findNextCase($phpcsFile, ($nextCase + 1), $endOfSwitch)) !== false) { + if ($tokens[$nextCase]['code'] === T_DEFAULT) { + $hasDefaultBlock = true; + } + + $opener = $tokens[$nextCase]['scope_opener']; + + $nextCode = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), $endOfSwitch, true); + if ($tokens[$nextCode]['code'] === T_CASE || $tokens[$nextCode]['code'] === T_DEFAULT) { + // This case statement has no content, so skip it. + continue; + } + + $endOfCase = $this->findNextCase($phpcsFile, ($opener + 1), $endOfSwitch); + if ($endOfCase === false) { + $endOfCase = $endOfSwitch; + } + + $hasTerminator = $this->findNestedTerminator($phpcsFile, ($opener + 1), $endOfCase); + if ($hasTerminator === false) { + return false; + } + }//end while + + // If we have not encountered a DEFAULT block by now, we cannot + // be sure that the whole statement terminates in every case. + if ($hasDefaultBlock === false) { + return false; + } + + return $hasTerminator; + } else { + return false; + }//end if + } while ($currentCloser !== false && $tokens[$currentCloser]['code'] === T_CLOSE_CURLY_BRACKET); + + return true; + } else if ($tokens[$lastToken]['code'] === T_SEMICOLON) { + // We found the last statement of the CASE. Now we want to + // check whether it is a terminating one. + $terminators = [ + T_RETURN => T_RETURN, + T_BREAK => T_BREAK, + T_CONTINUE => T_CONTINUE, + T_THROW => T_THROW, + T_EXIT => T_EXIT, + ]; + + $terminator = $phpcsFile->findStartOfStatement(($lastToken - 1)); + if (isset($terminators[$tokens[$terminator]['code']]) === true) { + return $terminator; + } + }//end if + + return false; + + }//end findNestedTerminator() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php new file mode 100644 index 00000000..1cb63744 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php @@ -0,0 +1,89 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ClosingTagSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Make sure this file only contains PHP code. + for ($i = 0; $i < $phpcsFile->numTokens; $i++) { + if ($tokens[$i]['code'] === T_INLINE_HTML + && trim($tokens[$i]['content']) !== '' + ) { + return $phpcsFile->numTokens; + } + } + + // Find the last non-empty token. + for ($last = ($phpcsFile->numTokens - 1); $last > 0; $last--) { + if (trim($tokens[$last]['content']) !== '') { + break; + } + } + + if ($tokens[$last]['code'] === T_CLOSE_TAG) { + $error = 'A closing tag is not permitted at the end of a PHP file'; + $fix = $phpcsFile->addFixableError($error, $last, 'NotAllowed'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($last, $phpcsFile->eolChar); + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($last - 1), null, true); + if ($tokens[$prev]['code'] !== T_SEMICOLON + && $tokens[$prev]['code'] !== T_CLOSE_CURLY_BRACKET + && $tokens[$prev]['code'] !== T_OPEN_TAG + ) { + $phpcsFile->fixer->addContent($prev, ';'); + } + + $phpcsFile->fixer->endChangeset(); + } + + $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at end of PHP-only file', 'yes'); + } else { + $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at end of PHP-only file', 'no'); + }//end if + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php new file mode 100644 index 00000000..5b2d2817 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php @@ -0,0 +1,107 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class EndFileNewlineSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + if ($phpcsFile->findNext(T_INLINE_HTML, ($stackPtr + 1)) !== false) { + return $phpcsFile->numTokens; + } + + // Skip to the end of the file. + $tokens = $phpcsFile->getTokens(); + $lastToken = ($phpcsFile->numTokens - 1); + + if ($tokens[$lastToken]['content'] === '') { + $lastToken--; + } + + // Hard-coding the expected \n in this sniff as it is PSR-2 specific and + // PSR-2 enforces the use of unix style newlines. + if (substr($tokens[$lastToken]['content'], -1) !== "\n") { + $error = 'Expected 1 newline at end of file; 0 found'; + $fix = $phpcsFile->addFixableError($error, $lastToken, 'NoneFound'); + if ($fix === true) { + $phpcsFile->fixer->addNewline($lastToken); + } + + $phpcsFile->recordMetric($stackPtr, 'Number of newlines at EOF', '0'); + return $phpcsFile->numTokens; + } + + // Go looking for the last non-empty line. + $lastLine = $tokens[$lastToken]['line']; + if ($tokens[$lastToken]['code'] === T_WHITESPACE + || $tokens[$lastToken]['code'] === T_DOC_COMMENT_WHITESPACE + ) { + $lastCode = $phpcsFile->findPrevious([T_WHITESPACE, T_DOC_COMMENT_WHITESPACE], ($lastToken - 1), null, true); + } else { + $lastCode = $lastToken; + } + + $lastCodeLine = $tokens[$lastCode]['line']; + $blankLines = ($lastLine - $lastCodeLine + 1); + $phpcsFile->recordMetric($stackPtr, 'Number of newlines at EOF', $blankLines); + + if ($blankLines > 1) { + $error = 'Expected 1 blank line at end of file; %s found'; + $data = [$blankLines]; + $fix = $phpcsFile->addFixableError($error, $lastCode, 'TooMany', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($lastCode, rtrim($tokens[$lastCode]['content'])); + for ($i = ($lastCode + 1); $i < $lastToken; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->replaceToken($lastToken, $phpcsFile->eolChar); + $phpcsFile->fixer->endChangeset(); + } + } + + // Skip the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php new file mode 100644 index 00000000..cee18cac --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php @@ -0,0 +1,79 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff as PEARFunctionCallSignatureSniff; +use PHP_CodeSniffer\Util\Tokens; + +class FunctionCallSignatureSniff extends PEARFunctionCallSignatureSniff +{ + + /** + * If TRUE, multiple arguments can be defined per line in a multi-line call. + * + * @var boolean + */ + public $allowMultipleArguments = false; + + + /** + * Processes single-line calls. + * + * @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 $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return bool + */ + public function isMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) + { + // If the first argument is on a new line, this is a multi-line + // function call, even if there is only one argument. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); + if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { + return true; + } + + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + + $end = $phpcsFile->findEndOfStatement(($openBracket + 1), [T_COLON]); + while ($tokens[$end]['code'] === T_COMMA) { + // If the next bit of code is not on the same line, this is a + // multi-line function call. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); + if ($next === false) { + return false; + } + + if ($tokens[$next]['line'] !== $tokens[$end]['line']) { + return true; + } + + $end = $phpcsFile->findEndOfStatement($next, [T_COLON]); + } + + // We've reached the last argument, so see if the next content + // (should be the close bracket) is also on the same line. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); + if ($next !== false && $tokens[$next]['line'] !== $tokens[$end]['line']) { + return true; + } + + return false; + + }//end isMultiLineCall() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php new file mode 100644 index 00000000..c4f1a6f4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php @@ -0,0 +1,91 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class FunctionClosingBraceSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + // Probably an interface method. + return; + } + + $closeBrace = $tokens[$stackPtr]['scope_closer']; + $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); + $found = ($tokens[$closeBrace]['line'] - $tokens[$prevContent]['line'] - 1); + + if ($found < 0) { + // Brace isn't on a new line, so not handled by us. + return; + } + + if ($found === 0) { + // All is good. + return; + } + + $error = 'Function closing brace must go on the next line following the body; found %s blank lines before brace'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeClose', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prevContent + 1); $i < $closeBrace; $i++) { + if ($tokens[$i]['line'] === $tokens[$prevContent]['line']) { + continue; + } + + // Don't remove any indentation before the brace. + if ($tokens[$i]['line'] === $tokens[$closeBrace]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php new file mode 100644 index 00000000..6500d046 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php @@ -0,0 +1,162 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; +use PHP_CodeSniffer\Util\Tokens; + +class MethodDeclarationSniff extends AbstractScopeSniff +{ + + + /** + * Constructs a Squiz_Sniffs_Scope_MethodScopeSniff. + */ + public function __construct() + { + parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION]); + + }//end __construct() + + + /** + * Processes the function tokens within the class. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * @param int $currScope The current scope opener token. + * + * @return void + */ + protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + // Determine if this is a function which needs to be examined. + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + $deepestScope = key($conditions); + if ($deepestScope !== $currScope) { + return; + } + + $methodName = $phpcsFile->getDeclarationName($stackPtr); + if ($methodName === null) { + // Ignore closures. + return; + } + + if ($methodName[0] === '_' && isset($methodName[1]) === true && $methodName[1] !== '_') { + $error = 'Method name "%s" should not be prefixed with an underscore to indicate visibility'; + $data = [$methodName]; + $phpcsFile->addWarning($error, $stackPtr, 'Underscore', $data); + } + + $visibility = 0; + $static = 0; + $abstract = 0; + $final = 0; + + $find = (Tokens::$methodPrefixes + Tokens::$emptyTokens); + $prev = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); + + $prefix = $stackPtr; + while (($prefix = $phpcsFile->findPrevious(Tokens::$methodPrefixes, ($prefix - 1), $prev)) !== false) { + switch ($tokens[$prefix]['code']) { + case T_STATIC: + $static = $prefix; + break; + case T_ABSTRACT: + $abstract = $prefix; + break; + case T_FINAL: + $final = $prefix; + break; + default: + $visibility = $prefix; + break; + } + } + + $fixes = []; + + if ($visibility !== 0 && $final > $visibility) { + $error = 'The final declaration must precede the visibility declaration'; + $fix = $phpcsFile->addFixableError($error, $final, 'FinalAfterVisibility'); + if ($fix === true) { + $fixes[$final] = ''; + $fixes[($final + 1)] = ''; + if (isset($fixes[$visibility]) === true) { + $fixes[$visibility] = 'final '.$fixes[$visibility]; + } else { + $fixes[$visibility] = 'final '.$tokens[$visibility]['content']; + } + } + } + + if ($visibility !== 0 && $abstract > $visibility) { + $error = 'The abstract declaration must precede the visibility declaration'; + $fix = $phpcsFile->addFixableError($error, $abstract, 'AbstractAfterVisibility'); + if ($fix === true) { + $fixes[$abstract] = ''; + $fixes[($abstract + 1)] = ''; + if (isset($fixes[$visibility]) === true) { + $fixes[$visibility] = 'abstract '.$fixes[$visibility]; + } else { + $fixes[$visibility] = 'abstract '.$tokens[$visibility]['content']; + } + } + } + + if ($static !== 0 && $static < $visibility) { + $error = 'The static declaration must come after the visibility declaration'; + $fix = $phpcsFile->addFixableError($error, $static, 'StaticBeforeVisibility'); + if ($fix === true) { + $fixes[$static] = ''; + $fixes[($static + 1)] = ''; + if (isset($fixes[$visibility]) === true) { + $fixes[$visibility] .= ' static'; + } else { + $fixes[$visibility] = $tokens[$visibility]['content'].' static'; + } + } + } + + // Batch all the fixes together to reduce the possibility of conflicts. + if (empty($fixes) === false) { + $phpcsFile->fixer->beginChangeset(); + foreach ($fixes as $stackPtr => $content) { + $phpcsFile->fixer->replaceToken($stackPtr, $content); + } + + $phpcsFile->fixer->endChangeset(); + } + + }//end processTokenWithinScope() + + + /** + * Processes a token that is found within the scope that this test is + * listening to. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position in the stack where this + * token was found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + + }//end processTokenOutsideScope() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php new file mode 100644 index 00000000..7b1dad19 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php @@ -0,0 +1,100 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class NamespaceDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_NAMESPACE]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($tokens[$nextNonEmpty]['code'] === T_NS_SEPARATOR) { + // Namespace keyword as operator. Not a declaration. + return; + } + + $end = $phpcsFile->findEndOfStatement($stackPtr); + for ($i = ($end + 1); $i < ($phpcsFile->numTokens - 1); $i++) { + if ($tokens[$i]['line'] === $tokens[$end]['line']) { + continue; + } + + break; + } + + // The $i var now points to the first token on the line after the + // namespace declaration, which must be a blank line. + $next = $phpcsFile->findNext(T_WHITESPACE, $i, $phpcsFile->numTokens, true); + if ($next === false) { + return; + } + + $diff = ($tokens[$next]['line'] - $tokens[$i]['line']); + if ($diff === 1) { + return; + } + + if ($diff < 0) { + $diff = 0; + } + + $error = 'There must be one blank line after the namespace declaration'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'BlankLineAfter'); + + if ($fix === true) { + if ($diff === 0) { + $phpcsFile->fixer->addNewlineBefore($i); + } else { + $phpcsFile->fixer->beginChangeset(); + for ($x = $i; $x < $next; $x++) { + if ($tokens[$x]['line'] === $tokens[$next]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($x, ''); + } + + $phpcsFile->fixer->addNewline($i); + $phpcsFile->fixer->endChangeset(); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php new file mode 100644 index 00000000..39c69c8b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php @@ -0,0 +1,297 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class UseDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_USE]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + if ($this->shouldIgnoreUse($phpcsFile, $stackPtr) === true) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + // One space after the use keyword. + if ($tokens[($stackPtr + 1)]['content'] !== ' ') { + $error = 'There must be a single space after the USE keyword'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterUse'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + + // Only one USE declaration allowed per statement. + $next = $phpcsFile->findNext([T_COMMA, T_SEMICOLON, T_OPEN_USE_GROUP, T_CLOSE_TAG], ($stackPtr + 1)); + if ($next !== false + && $tokens[$next]['code'] !== T_SEMICOLON + && $tokens[$next]['code'] !== T_CLOSE_TAG + ) { + $error = 'There must be one USE keyword per declaration'; + + if ($tokens[$next]['code'] === T_COMMA) { + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MultipleDeclarations'); + if ($fix === true) { + switch ($tokens[($stackPtr + 2)]['content']) { + case 'const': + $baseUse = 'use const'; + break; + case 'function': + $baseUse = 'use function'; + break; + default: + $baseUse = 'use'; + } + + if ($tokens[($next + 1)]['code'] !== T_WHITESPACE) { + $baseUse .= ' '; + } + + $phpcsFile->fixer->replaceToken($next, ';'.$phpcsFile->eolChar.$baseUse); + } + } else { + $closingCurly = $phpcsFile->findNext(T_CLOSE_USE_GROUP, ($next + 1)); + if ($closingCurly === false) { + // Parse error or live coding. Not auto-fixable. + $phpcsFile->addError($error, $stackPtr, 'MultipleDeclarations'); + } else { + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MultipleDeclarations'); + if ($fix === true) { + $baseUse = rtrim($phpcsFile->getTokensAsString($stackPtr, ($next - $stackPtr))); + $lastNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingCurly - 1), null, true); + + $phpcsFile->fixer->beginChangeset(); + + // Remove base use statement. + for ($i = $stackPtr; $i <= $next; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + if (preg_match('`^[\r\n]+$`', $tokens[($next + 1)]['content']) === 1) { + $phpcsFile->fixer->replaceToken(($next + 1), ''); + } + + // Convert grouped use statements into full use statements. + do { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), $closingCurly, true); + if ($next === false) { + // Group use statement with trailing comma after last item. + break; + } + + $nonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($next - 1), null, true); + for ($i = ($nonWhitespace + 1); $i < $next; $i++) { + if (preg_match('`^[\r\n]+$`', $tokens[$i]['content']) === 1) { + // Preserve new lines. + continue; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + if ($tokens[$next]['content'] === 'const' || $tokens[$next]['content'] === 'function') { + $phpcsFile->fixer->addContentBefore($next, 'use '); + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), $closingCurly, true); + $phpcsFile->fixer->addContentBefore($next, str_replace('use ', '', $baseUse)); + } else { + $phpcsFile->fixer->addContentBefore($next, $baseUse); + } + + $next = $phpcsFile->findNext(T_COMMA, ($next + 1), $closingCurly); + if ($next !== false) { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), $closingCurly, true); + if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['line'] === $tokens[$next]['line']) { + $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($nextNonEmpty - 1), $next, true); + if ($prevNonWhitespace === $next) { + $phpcsFile->fixer->replaceToken($next, ';'.$phpcsFile->eolChar); + } else { + $phpcsFile->fixer->replaceToken($next, ';'); + $phpcsFile->fixer->addNewline($prevNonWhitespace); + } + } else { + // Last item with trailing comma or next item already on new line. + $phpcsFile->fixer->replaceToken($next, ';'); + } + } else { + // Last item without trailing comma. + $phpcsFile->fixer->addContent($lastNonWhitespace, ';'); + } + } while ($next !== false); + + // Remove closing curly, semicolon and any whitespace between last child and closing curly. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($closingCurly + 1), null, true); + if ($next === false || $tokens[$next]['code'] !== T_SEMICOLON) { + // Parse error, forgotten semicolon. + $next = $closingCurly; + } + + for ($i = ($lastNonWhitespace + 1); $i <= $next; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + }//end if + }//end if + + // Make sure this USE comes after the first namespace declaration. + $prev = $phpcsFile->findPrevious(T_NAMESPACE, ($stackPtr - 1)); + if ($prev === false) { + $next = $phpcsFile->findNext(T_NAMESPACE, ($stackPtr + 1)); + if ($next !== false) { + $error = 'USE declarations must go after the namespace declaration'; + $phpcsFile->addError($error, $stackPtr, 'UseBeforeNamespace'); + } + } + + // Only interested in the last USE statement from here onwards. + $nextUse = $phpcsFile->findNext(T_USE, ($stackPtr + 1)); + while ($this->shouldIgnoreUse($phpcsFile, $nextUse) === true) { + $nextUse = $phpcsFile->findNext(T_USE, ($nextUse + 1)); + if ($nextUse === false) { + break; + } + } + + if ($nextUse !== false) { + return; + } + + $end = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_USE_GROUP, T_CLOSE_TAG], ($stackPtr + 1)); + if ($end === false) { + return; + } + + if ($tokens[$end]['code'] === T_CLOSE_USE_GROUP) { + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); + if ($tokens[$nextNonEmpty]['code'] === T_SEMICOLON) { + $end = $nextNonEmpty; + } + } + + // Find either the start of the next line or the beginning of the next statement, + // whichever comes first. + for ($end = ++$end; $end < $phpcsFile->numTokens; $end++) { + if (isset(Tokens::$emptyTokens[$tokens[$end]['code']]) === false) { + break; + } + + if ($tokens[$end]['column'] === 1) { + // Reached the next line. + break; + } + } + + --$end; + + if (($tokens[$end]['code'] === T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[$end]['code']]) === true) + && substr($tokens[$end]['content'], 0, 2) === '/*' + && substr($tokens[$end]['content'], -2) !== '*/' + ) { + // Multi-line block comments are not allowed as trailing comment after a use statement. + --$end; + } + + $next = $phpcsFile->findNext(T_WHITESPACE, ($end + 1), null, true); + + if ($next === false || $tokens[$next]['code'] === T_CLOSE_TAG) { + return; + } + + $diff = ($tokens[$next]['line'] - $tokens[$end]['line'] - 1); + if ($diff !== 1) { + if ($diff < 0) { + $diff = 0; + } + + $error = 'There must be one blank line after the last USE statement; %s found;'; + $data = [$diff]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterLastUse', $data); + if ($fix === true) { + if ($diff === 0) { + $phpcsFile->fixer->addNewline($end); + } else { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($end + 1); $i < $next; $i++) { + if ($tokens[$i]['line'] === $tokens[$next]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addNewline($end); + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + }//end process() + + + /** + * Check if this use statement is part of the namespace block. + * + * @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 bool + */ + private function shouldIgnoreUse($phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Ignore USE keywords inside closures and during live coding. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($next === false || $tokens[$next]['code'] === T_OPEN_PARENTHESIS) { + return true; + } + + // Ignore USE keywords for traits. + if ($phpcsFile->hasCondition($stackPtr, [T_CLASS, T_TRAIT, T_ENUM]) === true) { + return true; + } + + return false; + + }//end shouldIgnoreUse() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc new file mode 100644 index 00000000..1df40d51 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc @@ -0,0 +1,346 @@ +anonymous = new class extends ArrayObject + { + public function __construct() + { + parent::__construct(['a' => 1, 'b' => 2]); + } + }; + } +} + +class A extends B + implements C +{ +} + +class C2 +{ + +} // phpcs:ignore Standard.Category.Sniff + +interface I1 extends + Foo +{ +} + +interface I2 extends + Bar +{ +} + +interface I3 extends + Foo, + Bar +{ +} + +class C1 extends + Foo +{ +} + +class C2 extends + Bar +{ +} + +class C3 extends Foo implements + Bar +{ +} + +class C4 extends Foo implements + Bar +{ +} + +class C5 extends Foo implements + Bar, + Baz +{ +} + +class C6 extends \Foo\Bar implements + \Baz\Bar +{ +} + +interface I4 extends + \Baz + \Bar +{ +} + +interface I5 extends /* comment */ + \Foo\Bar +{ +} + +interface I6 extends // comment + \Foo\Bar +{ +} + +class C7 extends // comment + \Foo\Bar implements \Baz\Bar +{ +} + +class +C8 +{ +} + +foo(new class { +}); + +readonly +class Test +{ +} + +readonly class Test +{ +} + +if (!class_exists('IndentedDeclaration')) { + class IndentedDeclaration + { + function foo() {} + + + } +} + +// Space between modifier and class keyword would not be flagged nor fixed if newline + indentation. +final + class FinalClassWithIndentation + { + } + +readonly + class ReadonlyClassWithIndentation + { + } + +// And would also not be flagged if there was a comment between (not auto-fixable). +final/*comment*/class FinalClassWithComment +{ +} +abstract /*comment*/ class AbstractClassWithComment +{ +} + +readonly + // comment + class ReadonlyClassWithComment + { + } + +// Safeguard against fixer conflict when there are namespace relative interface names in extends. +interface FooBar extends namespace\BarFoo +{ +} + +// Safeguard against fixer conflict when there are namespace relative interface names in a multi-line implements. +class BarFoo implements + namespace\BarFoo +{ +} + +// Safeguard that the sniff ignores comments between interface names in a multiline implements. +class ClassWithMultiLineImplementsAndIgnoreAnnotation implements + SomeInterface, + // phpcs:disable Stnd.Cat.Sniff -- For reasons. + + \AnotherInterface +{ +} + +class ClassWithMultiLineImplementsAndComment implements + SomeInterface, + // Comment. + +AnotherInterface +{ +} + +class ClassWithMultiLineImplementsAndCommentOnSameLineAsInterfaceName implements + SomeInterface, + /* Comment. */ AnotherInterface +{ +} + +// Verify the `CloseBraceSameLine` error code is thrown when expected. +class ClassBraceNotOnLineByItselfError +{ + public $prop; +} $foo = new ClassBraceNotOnLineByItselfError; + +interface ClassBraceNotOnLineByItselfTrailingCommentIsAllowed +{ + public function myMethod(); +} //end interface -- this comment is allowed. + +trait ClassBraceNotOnLineByItselfTrailingAnnotationIsAllowed +{ +} // phpcs:ignore Stnd.Cat.Sniff -- this comment is also allowed. + +// Issue squizlabs/PHP_CodeSniffer#2621 - fix was superseded by fix for #2678. +$foo->bar( + new class implements Bar { + // ... + }, +); + +enum BraceNotOnLineByItselfCloseTagError +{ +} ?> + +anonymous = new class extends ArrayObject + { + public function __construct() + { + parent::__construct(['a' => 1, 'b' => 2]); + } + }; + } +} + +class A extends B implements C +{ +} + +class C2 +{ + +} // phpcs:ignore Standard.Category.Sniff + +interface I1 extends + Foo +{ +} + +interface I2 extends + Bar +{ +} + +interface I3 extends + Foo, + Bar +{ +} + +class C1 extends Foo +{ +} + +class C2 extends Bar +{ +} + +class C3 extends Foo implements + Bar +{ +} + +class C4 extends Foo implements + Bar +{ +} + +class C5 extends Foo implements + Bar, + Baz +{ +} + +class C6 extends \Foo\Bar implements + \Baz\Bar +{ +} + +interface I4 extends + \Baz\Bar +{ +} + +interface I5 extends /* comment */ + \Foo\Bar +{ +} + +interface I6 extends // comment + \Foo\Bar +{ +} + +class C7 extends \Foo\Bar implements \Baz\Bar // comment +{ +} + +class C8 +{ +} + +foo(new class { +}); + +readonly class Test +{ +} + +readonly class Test +{ +} + +if (!class_exists('IndentedDeclaration')) { + class IndentedDeclaration + { + function foo() {} + } +} + +// Space between modifier and class keyword would not be flagged nor fixed if newline + indentation. +final class FinalClassWithIndentation +{ + } + +readonly class ReadonlyClassWithIndentation +{ + } + +// And would also not be flagged if there was a comment between (not auto-fixable). +final/*comment*/class FinalClassWithComment +{ +} +abstract /*comment*/ class AbstractClassWithComment +{ +} + +readonly + // comment + class ReadonlyClassWithComment + { + } + +// Safeguard against fixer conflict when there are namespace relative interface names in extends. +interface FooBar extends namespace\BarFoo +{ +} + +// Safeguard against fixer conflict when there are namespace relative interface names in a multi-line implements. +class BarFoo implements + namespace\BarFoo +{ +} + +// Safeguard that the sniff ignores comments between interface names in a multiline implements. +class ClassWithMultiLineImplementsAndIgnoreAnnotation implements + SomeInterface, + // phpcs:disable Stnd.Cat.Sniff -- For reasons. + + \AnotherInterface +{ +} + +class ClassWithMultiLineImplementsAndComment implements + SomeInterface, + // Comment. + + AnotherInterface +{ +} + +class ClassWithMultiLineImplementsAndCommentOnSameLineAsInterfaceName implements + SomeInterface, + /* Comment. */ + AnotherInterface +{ +} + +// Verify the `CloseBraceSameLine` error code is thrown when expected. +class ClassBraceNotOnLineByItselfError +{ + public $prop; +} $foo = new ClassBraceNotOnLineByItselfError; + +interface ClassBraceNotOnLineByItselfTrailingCommentIsAllowed +{ + public function myMethod(); +} //end interface -- this comment is allowed. + +trait ClassBraceNotOnLineByItselfTrailingAnnotationIsAllowed +{ +} // phpcs:ignore Stnd.Cat.Sniff -- this comment is also allowed. + +// Issue squizlabs/PHP_CodeSniffer#2621 - fix was superseded by fix for #2678. +$foo->bar( + new class implements Bar { + // ... + }, +); + +enum BraceNotOnLineByItselfCloseTagError +{ +} ?> + + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff + */ +final class ClassDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 7 => 3, + 12 => 1, + 13 => 1, + 17 => 1, + 19 => 2, + 20 => 1, + 21 => 1, + 22 => 1, + 25 => 1, + 27 => 2, + 34 => 1, + 35 => 2, + 44 => 1, + 45 => 1, + 63 => 1, + 95 => 1, + 116 => 1, + 118 => 1, + 119 => 1, + 124 => 1, + 130 => 2, + 131 => 1, + 158 => 1, + 168 => 1, + 178 => 1, + 179 => 1, + 184 => 1, + 189 => 1, + 194 => 1, + 204 => 1, + 205 => 1, + 210 => 1, + 215 => 2, + 216 => 1, + 231 => 2, + 235 => 1, + 244 => 1, + 248 => 1, + 258 => 1, + 263 => 1, + 268 => 1, + 273 => 1, + 276 => 1, + 282 => 1, + 310 => 1, + 316 => 1, + 324 => 1, + 344 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc new file mode 100644 index 00000000..3e086c6f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc @@ -0,0 +1,87 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the PropertyDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff + */ +final class PropertyDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 7 => 1, + 9 => 2, + 10 => 1, + 11 => 1, + 17 => 1, + 18 => 1, + 23 => 1, + 38 => 1, + 41 => 1, + 42 => 1, + 50 => 2, + 51 => 1, + 55 => 1, + 56 => 1, + 61 => 1, + 62 => 1, + 68 => 1, + 69 => 1, + 71 => 1, + 72 => 1, + 76 => 1, + 80 => 1, + 82 => 1, + 84 => 1, + 86 => 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. + * + * @return array + */ + public function getWarningList() + { + return [ + 13 => 1, + 14 => 1, + 15 => 1, + 53 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc new file mode 100644 index 00000000..542ab3cf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc @@ -0,0 +1,81 @@ + $that) {} +foreach ( $something as $blah => $that ) {} +foreach ( $something as $blah => $that ) {} +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 + +$binary = b"binary string"; + +if ($expr1 + && $expr2 ) { +} + +if ($expr1 + && $expr2 /* comment */ ) { +} + +if ($expr1 + && $expr2 + /* comment */ ) { +} + +$r = match ($x) {}; +$r = match ( $x ) {}; + +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 1 +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 1 +$r = match ($x) {}; +$r = match ( $x ) {}; +$r = match ( $x ) {}; +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..a29534be --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed @@ -0,0 +1,80 @@ + $that ) {} +foreach ( $something as $blah => $that ) {} +foreach ( $something as $blah => $that ) {} +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 + +$binary = b"binary string"; + +if ($expr1 + && $expr2) { +} + +if ($expr1 + && $expr2 /* comment */) { +} + +if ($expr1 + && $expr2 + /* comment */) { +} + +$r = match ($x) {}; +$r = match ($x) {}; + +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 1 +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 1 +$r = match ( $x ) {}; +$r = match ( $x ) {}; +$r = match ( $x ) {}; +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 +// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php new file mode 100644 index 00000000..a8ab73e1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php @@ -0,0 +1,67 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff + */ +final class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 1, + 14 => 2, + 26 => 2, + 27 => 2, + 31 => 1, + 51 => 2, + 53 => 2, + 60 => 1, + 64 => 1, + 69 => 1, + 73 => 2, + 77 => 2, + 79 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc new file mode 100644 index 00000000..778659c8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed new file mode 100644 index 00000000..4a7bfdc2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php new file mode 100644 index 00000000..79d46542 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php @@ -0,0 +1,56 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ElseIfDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff + */ +final class ElseIfDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [ + 4 => 1, + 12 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc new file mode 100644 index 00000000..2ca60a93 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc @@ -0,0 +1,598 @@ + 0) { + return 0; + } else { + return 1; + } + case 2: + return 2; +} + +// ERROR: No else clause +switch ($foo) { + case 1: + if ($bar > 0) { + return 0; + } elseif ($bar < 0) { + return 1; + } + case 2: + return 2; +} + +// OK: No fall-through present +switch ($foo) { + case 1: + if ($bar > 0) { + return 0; + } elseif ($bar < 0) { + return 1; + } +} + +// ERROR: No else clause (nested) +switch ($foo) { + case 1: + if ($bar > 0) { + return 0; + } else { + if ($foo > $bar) { + continue; + } + } + case 2: + return 2; +} + +// OK: Every clause terminates +switch ($foo) { + case 1: + if ($bar > 0) { + return 0; + } else { + if ($foo > $bar) { + continue; + } else { + break; + } + } + case 2: + return 2; +} + +// ERROR: Non-termination IF clause +switch ($foo) { + case 1: + if ($bar > 0) { + $offset = 0; + } else { + break; + } + case 2: + return 2; +} + +// ERROR: Non-termination IF clause (nested) +switch ($foo) { + case 1: + if ($bar > 0) { + continue; + } else { + if ($foo > $bar) { + $offset = 0; + } else { + break; + } + } + case 2: + return 2; +} + +switch ($sContext) +{ + case 'SOMETHING': + case 'CONSTANT': + do_something(); + break; + case 'GLOBAL': + case 'GLOBAL1': + do_something(); + // Fall through + default: + { + do_something(); + } +} + +$foo = $foo ? + function () { + switch ($a) { + case 'a': + break; + } + } : + null; + +switch ($foo) { +case Foo::INTERFACE: + echo '1'; + return self::INTERFACE; +case Foo::TRAIT: +case Foo::ARRAY: + echo '1'; + return self::VALUE; +} + +// OK: Every clause terminates +switch ($foo) { + case 1: + switch ($bar) { + case 1: + return 1; + default: + return 3; + } + case 2: + return 2; +} + +// KO: Not every clause terminates +switch ($foo) { + case 1: + switch ($bar) { + case 1: + return; + } + case 2: + return 2; +} + +// KO: Not every clause terminates +switch ($foo) { + case 1: + switch ($bar) { + case 1: + return; + default: + $a = 1; + } + case 2: + return 2; +} + +// OK: Every clause terminates +switch ($foo) { + case 1: + switch ($bar) { + case 1: + return 1; + default: + throw new \Exception(); + } + case 2: + return 2; +} + +switch ($foo) { + case 1: + // phpcs:ignore + case 2: + return 1; + case 3: + return 2; +} + +// Issue 3352. +switch ( $test ) { + case 2: // comment followed by empty line + + break; + + case 3: /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments. */ + + + + break; + + case 4: /** inline docblock */ + + + + break; + + case 5: /* checking how it handles */ /* two trailing comments */ + + break; + + case 6: + // Comment as first content of the body. + + break; + + case 7: + /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments at start of body. */ + + break; + + case 8: + /** inline docblock */ + + break; +} + +// Handle comments correctly. +switch ($foo) { + case 1: + if ($bar > 0) { + doSomething(); + } + // Comment + else { + return 1; + } + case 2: + return 2; +} + +switch ($foo) { + case 1: + if ($bar > 0) /*comment*/ { + return doSomething(); + } + else { + return 1; + } + case 2: + return 2; +} + +// Issue #3297. +// Okay - finally will always be executed, so all branches are covered by the `return` in finally. +switch ( $a ) { + case 1: + try { + doSomething(); + } catch (Exception $e) { + doSomething(); + } catch (AnotherException $e) { + doSomething(); + } finally { + return true; + } + default: + $other = $code; + break; +} + +// Okay - all - non-finally - branches have a terminating statement. +switch ( $a ) { + case 1: + try { + return false; + } catch (Exception $e) /*comment*/ { + return true; + } + // Comment + catch (AnotherException $e) { + return true; + } finally { + doSomething(); + } + default: + $other = $code; + break; +} + +// Okay - finally will always be executed, so all branches are covered by the `return` in finally. +// Non-standard structure order. +switch ( $a ) { + case 1: + try { + doSomething(); + } catch (Exception $e) { + doSomething(); + } finally { + return true; + } catch (AnotherException $e) { + doSomething(); + } + default: + $other = $code; + break; +} + +// Okay - all - non-finally - branches have a terminating statement. +// Non-standard structure order. +switch ( $a ) { + case 1: + try { + return false; + } finally { + doSomething(); + } catch (MyException $e) { + return true; + } catch (AnotherException $e) { + return true; + } + default: + $other = $code; + break; +} + +// All okay, no finally. Any exception still uncaught will terminate the case anyhow, so we're good. +switch ( $a ) { + case 1: + try { + return false; + } catch (MyException $e) { + return true; + } catch (AnotherException $e) { + return true; + } + default: + $other = $code; + break; +} + +// All okay, no catch +switch ( $a ) { + case 1: + try { + return true; + } finally { + doSomething(); + } + case 2: + $other = $code; + break; +} + +// All okay, try-catch nested in if. +switch ( $a ) { + case 1: + if ($a) { + try { + return true; // Comment. + } catch (MyException $e) { + throw new Exception($e->getMessage()); + } + } else { + return true; + } + case 2: + $other = $code; + break; +} + +// Missing fall-through comment. +switch ( $a ) { + case 1: + try { + doSomething(); + } finally { + doSomething(); + } + case 2: + $other = $code; + break; +} + +// Missing fall-through comment. One of the catches does not have a terminating statement. +switch ( $a ) { + case 1: + try { + return false; + } catch (Exception $e) { + doSomething(); + } catch (AnotherException $e) { + return true; + } finally { + doSomething(); + } + default: + $other = $code; + break; +} + +// Missing fall-through comment. Try does not have a terminating statement. +switch ( $a ) { + case 1: + try { + doSomething(); + } finally { + doSomething(); + } catch (Exception $e) { + return true; + } catch (AnotherException $e) { + return true; + } + default: + $other = $code; + break; +} + +// Missing fall-through comment. One of the catches does not have a terminating statement. +switch ( $a ) { + case 1: + try { + return false; + } catch (Exception $e) { + doSomething(); + } catch (AnotherException $e) { + return true; + } + default: + $other = $code; + break; +} + +// Issue 3550 - comment after terminating statement. +switch (rand()) { + case 1: + if (rand() === 1) { + break; + } else { + break; // comment + } + default: + break; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed new file mode 100644 index 00000000..bbc8b7c4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed @@ -0,0 +1,593 @@ + 0) { + return 0; + } else { + return 1; + } + case 2: + return 2; +} + +// ERROR: No else clause +switch ($foo) { + case 1: + if ($bar > 0) { + return 0; + } elseif ($bar < 0) { + return 1; + } + case 2: + return 2; +} + +// OK: No fall-through present +switch ($foo) { + case 1: + if ($bar > 0) { + return 0; + } elseif ($bar < 0) { + return 1; + } +} + +// ERROR: No else clause (nested) +switch ($foo) { + case 1: + if ($bar > 0) { + return 0; + } else { + if ($foo > $bar) { + continue; + } + } + case 2: + return 2; +} + +// OK: Every clause terminates +switch ($foo) { + case 1: + if ($bar > 0) { + return 0; + } else { + if ($foo > $bar) { + continue; + } else { + break; + } + } + case 2: + return 2; +} + +// ERROR: Non-termination IF clause +switch ($foo) { + case 1: + if ($bar > 0) { + $offset = 0; + } else { + break; + } + case 2: + return 2; +} + +// ERROR: Non-termination IF clause (nested) +switch ($foo) { + case 1: + if ($bar > 0) { + continue; + } else { + if ($foo > $bar) { + $offset = 0; + } else { + break; + } + } + case 2: + return 2; +} + +switch ($sContext) +{ + case 'SOMETHING': + case 'CONSTANT': + do_something(); + break; + case 'GLOBAL': + case 'GLOBAL1': + do_something(); + // Fall through + default: + { + do_something(); + } +} + +$foo = $foo ? + function () { + switch ($a) { + case 'a': + break; + } + } : + null; + +switch ($foo) { +case Foo::INTERFACE: + echo '1'; + return self::INTERFACE; +case Foo::TRAIT: +case Foo::ARRAY: + echo '1'; + return self::VALUE; +} + +// OK: Every clause terminates +switch ($foo) { + case 1: + switch ($bar) { + case 1: + return 1; + default: + return 3; + } + case 2: + return 2; +} + +// KO: Not every clause terminates +switch ($foo) { + case 1: + switch ($bar) { + case 1: + return; + } + case 2: + return 2; +} + +// KO: Not every clause terminates +switch ($foo) { + case 1: + switch ($bar) { + case 1: + return; + default: + $a = 1; + } + case 2: + return 2; +} + +// OK: Every clause terminates +switch ($foo) { + case 1: + switch ($bar) { + case 1: + return 1; + default: + throw new \Exception(); + } + case 2: + return 2; +} + +switch ($foo) { + case 1: + // phpcs:ignore + case 2: + return 1; + case 3: + return 2; +} + +// Issue 3352. +switch ( $test ) { + case 2: // comment followed by empty line + break; + + case 3: /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments. */ + break; + + case 4: /** inline docblock */ + break; + + case 5: /* checking how it handles */ /* two trailing comments */ + break; + + case 6: + // Comment as first content of the body. + + break; + + case 7: + /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments at start of body. */ + + break; + + case 8: + /** inline docblock */ + + break; +} + +// Handle comments correctly. +switch ($foo) { + case 1: + if ($bar > 0) { + doSomething(); + } + // Comment + else { + return 1; + } + case 2: + return 2; +} + +switch ($foo) { + case 1: + if ($bar > 0) /*comment*/ { + return doSomething(); + } + else { + return 1; + } + case 2: + return 2; +} + +// Issue #3297. +// Okay - finally will always be executed, so all branches are covered by the `return` in finally. +switch ( $a ) { + case 1: + try { + doSomething(); + } catch (Exception $e) { + doSomething(); + } catch (AnotherException $e) { + doSomething(); + } finally { + return true; + } + default: + $other = $code; + break; +} + +// Okay - all - non-finally - branches have a terminating statement. +switch ( $a ) { + case 1: + try { + return false; + } catch (Exception $e) /*comment*/ { + return true; + } + // Comment + catch (AnotherException $e) { + return true; + } finally { + doSomething(); + } + default: + $other = $code; + break; +} + +// Okay - finally will always be executed, so all branches are covered by the `return` in finally. +// Non-standard structure order. +switch ( $a ) { + case 1: + try { + doSomething(); + } catch (Exception $e) { + doSomething(); + } finally { + return true; + } catch (AnotherException $e) { + doSomething(); + } + default: + $other = $code; + break; +} + +// Okay - all - non-finally - branches have a terminating statement. +// Non-standard structure order. +switch ( $a ) { + case 1: + try { + return false; + } finally { + doSomething(); + } catch (MyException $e) { + return true; + } catch (AnotherException $e) { + return true; + } + default: + $other = $code; + break; +} + +// All okay, no finally. Any exception still uncaught will terminate the case anyhow, so we're good. +switch ( $a ) { + case 1: + try { + return false; + } catch (MyException $e) { + return true; + } catch (AnotherException $e) { + return true; + } + default: + $other = $code; + break; +} + +// All okay, no catch +switch ( $a ) { + case 1: + try { + return true; + } finally { + doSomething(); + } + case 2: + $other = $code; + break; +} + +// All okay, try-catch nested in if. +switch ( $a ) { + case 1: + if ($a) { + try { + return true; // Comment. + } catch (MyException $e) { + throw new Exception($e->getMessage()); + } + } else { + return true; + } + case 2: + $other = $code; + break; +} + +// Missing fall-through comment. +switch ( $a ) { + case 1: + try { + doSomething(); + } finally { + doSomething(); + } + case 2: + $other = $code; + break; +} + +// Missing fall-through comment. One of the catches does not have a terminating statement. +switch ( $a ) { + case 1: + try { + return false; + } catch (Exception $e) { + doSomething(); + } catch (AnotherException $e) { + return true; + } finally { + doSomething(); + } + default: + $other = $code; + break; +} + +// Missing fall-through comment. Try does not have a terminating statement. +switch ( $a ) { + case 1: + try { + doSomething(); + } finally { + doSomething(); + } catch (Exception $e) { + return true; + } catch (AnotherException $e) { + return true; + } + default: + $other = $code; + break; +} + +// Missing fall-through comment. One of the catches does not have a terminating statement. +switch ( $a ) { + case 1: + try { + return false; + } catch (Exception $e) { + doSomething(); + } catch (AnotherException $e) { + return true; + } + default: + $other = $code; + break; +} + +// Issue 3550 - comment after terminating statement. +switch (rand()) { + case 1: + if (rand() === 1) { + break; + } else { + break; // comment + } + default: + break; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php new file mode 100644 index 00000000..a292503d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php @@ -0,0 +1,86 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SwitchDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff + */ +final class SwitchDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 10 => 1, + 11 => 1, + 14 => 1, + 16 => 1, + 20 => 1, + 23 => 1, + 29 => 1, + 33 => 1, + 37 => 2, + 108 => 2, + 109 => 1, + 111 => 1, + 113 => 2, + 114 => 1, + 128 => 1, + 141 => 1, + 172 => 1, + 194 => 1, + 224 => 1, + 236 => 1, + 260 => 1, + 300 => 1, + 311 => 1, + 346 => 1, + 350 => 1, + 356 => 1, + 362 => 1, + 384 => 1, + 528 => 1, + 541 => 1, + 558 => 1, + 575 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc new file mode 100644 index 00000000..738e70e9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc @@ -0,0 +1,12 @@ + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed new file mode 100644 index 00000000..f70b9eba --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed @@ -0,0 +1,12 @@ + + +
    + +
    \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc new file mode 100644 index 00000000..d6a86175 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc @@ -0,0 +1,7 @@ + + +A: +B: +C: \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc new file mode 100644 index 00000000..dd103cde --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc @@ -0,0 +1 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed new file mode 100644 index 00000000..1058f1f3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed @@ -0,0 +1 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed new file mode 100644 index 00000000..93d55fbd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed new file mode 100644 index 00000000..534574d4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed @@ -0,0 +1,5 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed new file mode 100644 index 00000000..68e7d8ce --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed @@ -0,0 +1,5 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClosingTag sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\ClosingTagSniff + */ +final class ClosingTagUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ClosingTagUnitTest.1.inc': + return [11 => 1]; + + case 'ClosingTagUnitTest.4.inc': + case 'ClosingTagUnitTest.5.inc': + return [1 => 1]; + + case 'ClosingTagUnitTest.6.inc': + case 'ClosingTagUnitTest.7.inc': + return [5 => 1]; + + default: + return []; + } + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc new file mode 100644 index 00000000..ca2a7493 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed new file mode 100644 index 00000000..d3c19fee --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed @@ -0,0 +1 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc new file mode 100644 index 00000000..fa2f476a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc @@ -0,0 +1,5 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc new file mode 100644 index 00000000..1254e4a5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc @@ -0,0 +1,2 @@ + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc new file mode 100644 index 00000000..c3a59b67 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc @@ -0,0 +1,6 @@ + + + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the EndFileNewline sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff + */ +final class EndFileNewlineUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'EndFileNewlineUnitTest.1.inc': + case 'EndFileNewlineUnitTest.3.inc': + case 'EndFileNewlineUnitTest.6.inc': + case 'EndFileNewlineUnitTest.7.inc': + case 'EndFileNewlineUnitTest.9.inc': + case 'EndFileNewlineUnitTest.10.inc': + return [2 => 1]; + case 'EndFileNewlineUnitTest.11.inc': + case 'EndFileNewlineUnitTest.12.inc': + case 'EndFileNewlineUnitTest.13.inc': + return [1 => 1]; + default: + return []; + }//end switch + + }//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($testFile='') + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc new file mode 100644 index 00000000..1ca477d0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc @@ -0,0 +1,267 @@ +get('/hello/{name}', function ($name) use ($app) { + return 'Hello '.$app->escape($name); +}, array( + '1', + '2', + '3', +)); + +// error +somefunction2($foo, $bar, [ + // ... + ], +$baz); + +// ok +somefunction3(// ... + $foo, + $bar, + [ + // ... + ], + $baz +); + +// ok +somefunction4(' + this should not + give an error + because it\'s actually + one line call + with multi-line string +'); + +// ok +somefunction5("hey, +multi-line string with some +extra args", $foo, 12); + +// error +somefunction6(' + but args in a new line + are not ok… + ', + $foo +); + +$this->setFoo(true + ? 1 + : 2, false, array( + 'value', + 'more')); + +$this->setFoo('some' + . 'long' + . 'text', 'string'); + +foo(bar(), $a); +foo();bar(); + +foo( + true +); + +myFunction(<< function ($x) { + return true; + }, + 'baz' => false + ) +); +$qux = array_filter( + $quux, function ($x) { + return $x; + } +); + +$this->listeners[] = $events->getSharedManager()->attach( + 'Zend\Mvc\Application', MvcEvent::EVENT_DISPATCH, [$this, 'selectLayout'], 100 +); + +// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 1 +foo('Testing + multiline text' + ); + +foo('Testing + multiline text: ' // . $text + ); + +foo('Testing + multiline text: ' /* . $text */ + ); + +foo('Testing + multiline text: ' /* . $text */ + // . $other_text + ); + +foo('Testing + multiline text: ' /* + . $text +// . $text2 + */ + ); +// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 0 + +foo('Testing + multiline text' +); + +foo('Testing + multiline text' + ); + +foo('Testing + multiline text' // hello +); + +foo('Testing + multiline text' /* hello */ +); + +foo('Testing + multiline text' + // hello +); + +foo('Testing + multiline text' + /* hello */ +); + +$var = foo('Testing + multiline' + // hi + ) + foo('Testing + multiline' + // hi + ) +; + +class Test +{ + public function getInstance() + { + return new static( + 'arg', + 'foo' + ); + } + + public function getSelf() + { + return new self( + 'a', 'b', 'c' + ); + } +} + +$x = $var('y', + 'x'); + +$obj->{$x}(1, +2); + +(function ($a, $b) { + return function ($c, $d) use ($a, $b) { + echo $a, $b, $c, $d; + }; +})( + 'a','b' +)('c', + 'd'); + +return trim(preg_replace_callback( + // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) + // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ + sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), + function (array $term) use ($mode): string { + // query pieces have to bigger than one char, otherwise they are too expensive for the search + if (mb_strlen($term[1], 'UTF-8') > 1) { + // in boolean search mode '' (empty) means OR, '-' means NOT + return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); + } + + return ''; + }, + $search + )); + +return trim(preg_replace_callback( +// sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) +// /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ +sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), +function (array $term) use ($mode): string { + // query pieces have to bigger than one char, otherwise they are too expensive for the search + if (mb_strlen($term[1], 'UTF-8') > 1) { + // in boolean search mode '' (empty) means OR, '-' means NOT + return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); + } + + return ''; +}, +$search +)); + +// PHP 8.0 named parameters. +array_fill_keys( + keys: range( + 1, + 12, + ), + value: true, +); + +array_fill_keys( + keys: range( 1, + 12, + ), value: true, +); + +// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments true +array_fill_keys( + keys: range( 1, + 12, + ), value: true, +); +// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed new file mode 100644 index 00000000..dc383ed2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed @@ -0,0 +1,283 @@ +get('/hello/{name}', function ($name) use ($app) { + return 'Hello '.$app->escape($name); +}, array( + '1', + '2', + '3', +)); + +// error +somefunction2( + $foo, + $bar, + [ + // ... + ], + $baz +); + +// ok +somefunction3(// ... + $foo, + $bar, + [ + // ... + ], + $baz +); + +// ok +somefunction4(' + this should not + give an error + because it\'s actually + one line call + with multi-line string +'); + +// ok +somefunction5("hey, +multi-line string with some +extra args", $foo, 12); + +// error +somefunction6( + ' + but args in a new line + are not ok… + ', + $foo +); + +$this->setFoo(true + ? 1 + : 2, false, array( + 'value', + 'more')); + +$this->setFoo('some' + . 'long' + . 'text', 'string'); + +foo(bar(), $a); +foo();bar(); + +foo( + true +); + +myFunction(<< function ($x) { + return true; + }, + 'baz' => false + ) +); +$qux = array_filter( + $quux, + function ($x) { + return $x; + } +); + +$this->listeners[] = $events->getSharedManager()->attach( + 'Zend\Mvc\Application', + MvcEvent::EVENT_DISPATCH, + [$this, 'selectLayout'], + 100 +); + +// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 1 +foo('Testing + multiline text' ); + +foo('Testing + multiline text: ' ); // . $text + + +foo('Testing + multiline text: ' /* . $text */ ); + +foo('Testing + multiline text: ' /* . $text */ ); + // . $other_text + + +foo('Testing + multiline text: ' /* + . $text +// . $text2 + */ ); +// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 0 + +foo('Testing + multiline text'); + +foo('Testing + multiline text'); + +foo('Testing + multiline text'); // hello + + +foo('Testing + multiline text' /* hello */); + +foo('Testing + multiline text'); + // hello + + +foo('Testing + multiline text' + /* hello */); + +$var = foo('Testing + multiline') + // hi + + foo('Testing + multiline'); + // hi + + +class Test +{ + public function getInstance() + { + return new static( + 'arg', + 'foo' + ); + } + + public function getSelf() + { + return new self( + 'a', + 'b', + 'c' + ); + } +} + +$x = $var( + 'y', + 'x' +); + +$obj->{$x}( + 1, + 2 +); + +(function ($a, $b) { + return function ($c, $d) use ($a, $b) { + echo $a, $b, $c, $d; + }; +})( + 'a', + 'b' +)( + 'c', + 'd' +); + +return trim(preg_replace_callback( + // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) + // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ + sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), + function (array $term) use ($mode): string { + // query pieces have to bigger than one char, otherwise they are too expensive for the search + if (mb_strlen($term[1], 'UTF-8') > 1) { + // in boolean search mode '' (empty) means OR, '-' means NOT + return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); + } + + return ''; + }, + $search +)); + +return trim(preg_replace_callback( +// sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) +// /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ + sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), + function (array $term) use ($mode): string { + // query pieces have to bigger than one char, otherwise they are too expensive for the search + if (mb_strlen($term[1], 'UTF-8') > 1) { + // in boolean search mode '' (empty) means OR, '-' means NOT + return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); + } + + return ''; + }, + $search +)); + +// PHP 8.0 named parameters. +array_fill_keys( + keys: range( + 1, + 12, + ), + value: true, +); + +array_fill_keys( + keys: range( + 1, + 12, + ), + value: true, +); + +// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments true +array_fill_keys( + keys: range( + 1, + 12, + ), value: true, +); +// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php new file mode 100644 index 00000000..52cda174 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php @@ -0,0 +1,99 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionCallSignature sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff + */ +final class FunctionCallSignatureUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 18 => 3, + 21 => 1, + 48 => 1, + 87 => 1, + 90 => 1, + 91 => 1, + 103 => 1, + 111 => 1, + 117 => 4, + 123 => 1, + 127 => 1, + 131 => 1, + 136 => 1, + 143 => 1, + 148 => 1, + 152 => 1, + 156 => 1, + 160 => 1, + 165 => 1, + 170 => 1, + 175 => 1, + 178 => 2, + 186 => 1, + 187 => 1, + 194 => 3, + 199 => 1, + 200 => 2, + 202 => 1, + 203 => 1, + 210 => 2, + 211 => 1, + 212 => 2, + 217 => 1, + 218 => 1, + 227 => 1, + 228 => 1, + 233 => 1, + 234 => 1, + 242 => 1, + 243 => 1, + 256 => 1, + 257 => 1, + 258 => 1, + 263 => 1, + 264 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc new file mode 100644 index 00000000..7bf667e6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc @@ -0,0 +1,70 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionClosingBrace sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionClosingBraceSniff + */ +final class FunctionClosingBraceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 16 => 1, + 23 => 1, + 40 => 1, + 47 => 1, + 63 => 1, + 70 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc new file mode 100644 index 00000000..096b44bc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc @@ -0,0 +1,75 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the MethodDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff + */ +final class MethodDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 9 => 1, + 11 => 1, + 13 => 1, + 15 => 3, + 24 => 1, + 34 => 1, + 36 => 1, + 38 => 1, + 40 => 3, + 50 => 1, + 52 => 1, + 54 => 1, + 56 => 3, + 63 => 2, + 73 => 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. + * + * @return array + */ + public function getWarningList() + { + return [ + 5 => 1, + 21 => 1, + 30 => 1, + 46 => 1, + 63 => 1, + 70 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc new file mode 100644 index 00000000..70339339 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc @@ -0,0 +1,26 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\Namespaces; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the NamespaceDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\NamespaceDeclarationSniff + */ +final class NamespaceDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 6 => 1, + 9 => 1, + 17 => 1, + 19 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc new file mode 100644 index 00000000..977a7fb2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc @@ -0,0 +1,40 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed new file mode 100644 index 00000000..6579613b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed @@ -0,0 +1,27 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc new file mode 100644 index 00000000..8b290950 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc @@ -0,0 +1,16 @@ + +

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc new file mode 100644 index 00000000..1fdaccd3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc @@ -0,0 +1,47 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc new file mode 100644 index 00000000..dee56869 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc @@ -0,0 +1 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\PSR2\Tests\Namespaces; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the UseDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\UseDeclarationSniff + */ +final class UseDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'UseDeclarationUnitTest.2.inc': + return [ + 4 => 1, + 5 => 1, + 6 => 1, + 7 => 1, + 9 => 1, + 10 => 1, + 11 => 1, + 16 => 1, + ]; + case 'UseDeclarationUnitTest.3.inc': + return [ + 4 => 1, + 6 => 1, + ]; + case 'UseDeclarationUnitTest.5.inc': + return [ + 5 => 1, + 6 => 1, + 8 => 1, + 14 => 1, + 17 => 1, + 18 => 1, + 19 => 1, + 21 => 1, + 28 => 1, + 30 => 1, + 35 => 1, + ]; + case 'UseDeclarationUnitTest.10.inc': + case 'UseDeclarationUnitTest.11.inc': + case 'UseDeclarationUnitTest.12.inc': + case 'UseDeclarationUnitTest.13.inc': + case 'UseDeclarationUnitTest.14.inc': + case 'UseDeclarationUnitTest.16.inc': + case 'UseDeclarationUnitTest.17.inc': + return [2 => 1]; + case 'UseDeclarationUnitTest.15.inc': + return [ + 3 => 1, + 4 => 1, + 5 => 1, + ]; + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml new file mode 100644 index 00000000..ba5bd4e0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml @@ -0,0 +1,218 @@ + + + The PSR-2 coding standard. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + + + + + 0 + + + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml new file mode 100644 index 00000000..d91fec90 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml @@ -0,0 +1,19 @@ + + + + + + + ['bar']; + ]]> + + + [ 'bar' ]; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml new file mode 100644 index 00000000..ce4b9ae6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml @@ -0,0 +1,117 @@ + + + + + + array keyword must be lowercase. + ]]> + + + + + + + + + + + array keyword. + ]]> + + + + 'value1', + 'key2' => 'value2', + ); + ]]> + + + 'value1', + 'key2' => 'value2', + ); + ]]> + + + + array keyword. The closing parenthesis must be aligned with the start of the array keyword. + ]]> + + + + 'key1' => 'value1', + 'key2' => 'value2', + ); + ]]> + + + 'key1' => 'value1', + 'key2' => 'value2', +); + ]]> + + + + + + + + => 'ValueTen', + 'keyTwenty' => 'ValueTwenty', + ); + ]]> + + + => 'ValueTen', + 'keyTwenty' => 'ValueTwenty', + ); + ]]> + + + + + + + + 'value1', + 'key2' => 'value2', + 'key3' => 'value3', + ); + ]]> + + + 'value1', + 'key2' => 'value2', + 'key3' => 'value3' + ); + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml new file mode 100644 index 00000000..6d38c5a8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml @@ -0,0 +1,23 @@ + + + + + + + final class Foo extends Bar +{ +} + ]]> + + + Final Class Foo Extends Bar +{ +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml new file mode 100644 index 00000000..4f982fa4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml @@ -0,0 +1,63 @@ + + + + + + + self::foo(); + ]]> + + + SELF::foo(); + ]]> + + + + + ::foo(); + ]]> + + + :: foo(); + ]]> + + + + + self::bar(); + } +} + ]]> + + + Foo +{ + public static function bar() + { + } + + public static function baz() + { + Foo::bar(); + } +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml new file mode 100644 index 00000000..17fed42c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml @@ -0,0 +1,39 @@ + + + + + + + * @see foo() + */ + ]]> + + + * @see foo() +*/ + ]]> + + + + + @see foo() + */ + ]]> + + + @see foo() + */ + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml new file mode 100644 index 00000000..e3638a49 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml @@ -0,0 +1,32 @@ + + + + + + + @throws Exception all the time + * @return void + */ +function foo() +{ + throw new Exception('Danger!'); +} + ]]> + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml new file mode 100644 index 00000000..42fa6f43 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml @@ -0,0 +1,39 @@ + + + + + + + $foo as $bar => $baz) { + echo $baz; +} + ]]> + + + $foo as $bar=>$baz ) { + echo $baz; +} + ]]> + + + + + as $bar => $baz) { + echo $baz; +} + ]]> + + + AS $bar => $baz) { + echo $baz; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml new file mode 100644 index 00000000..37caaded --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml @@ -0,0 +1,55 @@ + + + + + + + $i = 0; $i < 10; $i++) { + echo $i; +} + ]]> + + + $i = 0; $i < 10; $i++ ) { + echo $i; +} + ]]> + + + + + ; $i < 10; $i++) { + echo $i; +} + ]]> + + + ; $i < 10 ; $i++) { + echo $i; +} + ]]> + + + + + $i < 10; $i++) { + echo $i; +} + ]]> + + + $i < 10;$i++) { + echo $i; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml new file mode 100644 index 00000000..08017b75 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml @@ -0,0 +1,23 @@ + + + + + + + if ($foo) { + $bar = true; +} + ]]> + + + IF ($foo) { + $bar = true; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml new file mode 100644 index 00000000..8a0e47ea --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml @@ -0,0 +1,23 @@ + + + + + + + isset($foo)) { + echo $foo; +} + ]]> + + + isSet($foo)) { + echo $foo; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml new file mode 100644 index 00000000..b97e8073 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml @@ -0,0 +1,25 @@ + + + + + + + function foo() +{ + return true; +} + ]]> + + + FUNCTION foo() +{ + return true; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml new file mode 100644 index 00000000..0145657d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml @@ -0,0 +1,31 @@ + + + + + + + static function bar() + { + return self::$staticMember; + } +} + ]]> + + + static function bar() + { + return $this->$staticMember; + } +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml new file mode 100644 index 00000000..2bc536eb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml @@ -0,0 +1,19 @@ + + + + + + + "Hello"; + ]]> + + + ("Hello"); + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml new file mode 100644 index 00000000..9529b1fd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml @@ -0,0 +1,19 @@ + + + + + + + int)'42'; + ]]> + + + int )'42'; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionClosingBraceSpaceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionClosingBraceSpaceStandard.xml new file mode 100644 index 00000000..ccbdfa21 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionClosingBraceSpaceStandard.xml @@ -0,0 +1,73 @@ + + + + + + + { + +} +]]> + + + {} +]]> + + + + + + + + + { + } + +} +]]> + + + {} + +} +]]> + + + + + + + + + { + } + +} +]]> + + + { + + } + +} +]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml new file mode 100644 index 00000000..28fa712f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml @@ -0,0 +1,41 @@ + + + + + + + { +} + ]]> + + + { +} + ]]> + + + + + return 42; +} + ]]> + + + + return 42; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml new file mode 100644 index 00000000..aceb8867 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml @@ -0,0 +1,19 @@ + + + + + + + "hi"; + ]]> + + + "hi"; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/MemberVarSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/MemberVarSpacingStandard.xml new file mode 100644 index 00000000..a551af8a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/MemberVarSpacingStandard.xml @@ -0,0 +1,91 @@ + + + + + + + + + protected $var1 = 'value'; +} + ]]> + + + + protected $var1 = 'value'; +} + ]]> + + + + + + + + + + public $var2 = 'value2'; + + public $var3 = 'value3'; +} + ]]> + + + + + + public $var2 = 'value2'; + public $var3 = 'value3'; +} + ]]> + + + + + + + + + public $actions = array(); +}; + ]]> + + + + + public $actions = array(); +}; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml new file mode 100644 index 00000000..44edc7b5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml @@ -0,0 +1,19 @@ + + + ) should not have any space around it. + ]]> + + + + ->bar(); + ]]> + + + -> bar(); + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml new file mode 100644 index 00000000..3284df97 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml @@ -0,0 +1,59 @@ + + + + + + + } + +if (!class_exists('Foo')) { + class Foo { + } +} + + + some output + ?> + ]]> + + + } + +if (!class_exists('Foo')) { + class Foo { +} + } + + + some output + ?> + ]]> + + + + + + + + } + ]]> + + + } + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml new file mode 100644 index 00000000..4394ea27 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml @@ -0,0 +1,23 @@ + + + + + + + static function foo() +{ +} + ]]> + + + static function foo() +{ +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml new file mode 100644 index 00000000..bb9bf8f0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml @@ -0,0 +1,19 @@ + + + + + + + ; + ]]> + + + ; + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SuperfluousWhitespaceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SuperfluousWhitespaceStandard.xml new file mode 100644 index 00000000..b4ad03d0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SuperfluousWhitespaceStandard.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + echo 'code here'; +} + ]]> + + + + + + + + + + ]]> + + + + + + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php new file mode 100644 index 00000000..b6bb31de --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php @@ -0,0 +1,95 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ArrayBracketSpacingSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_SQUARE_BRACKET, + T_CLOSE_SQUARE_BRACKET, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @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(); + + if (($tokens[$stackPtr]['code'] === T_OPEN_SQUARE_BRACKET + && isset($tokens[$stackPtr]['bracket_closer']) === false) + || ($tokens[$stackPtr]['code'] === T_CLOSE_SQUARE_BRACKET + && isset($tokens[$stackPtr]['bracket_opener']) === false) + ) { + // Bow out for parse error/during live coding. + return; + } + + // Square brackets can not have a space before them. + $prevType = $tokens[($stackPtr - 1)]['code']; + if ($prevType === T_WHITESPACE) { + $nonSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 2), null, true); + $expected = $tokens[$nonSpace]['content'].$tokens[$stackPtr]['content']; + $found = $phpcsFile->getTokensAsString($nonSpace, ($stackPtr - $nonSpace)).$tokens[$stackPtr]['content']; + $error = 'Space found before square bracket; expected "%s" but found "%s"'; + $data = [ + $expected, + $found, + ]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeBracket', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); + } + } + + // Open square brackets can't ever have spaces after them. + if ($tokens[$stackPtr]['code'] === T_OPEN_SQUARE_BRACKET) { + $nextType = $tokens[($stackPtr + 1)]['code']; + if ($nextType === T_WHITESPACE) { + $nonSpace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 2), null, true); + $expected = $tokens[$stackPtr]['content'].$tokens[$nonSpace]['content']; + $found = $phpcsFile->getTokensAsString($stackPtr, ($nonSpace - $stackPtr + 1)); + $error = 'Space found after square bracket; expected "%s" but found "%s"'; + $data = [ + $expected, + $found, + ]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterBracket', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php new file mode 100644 index 00000000..89cd7bd5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php @@ -0,0 +1,942 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ArrayDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_ARRAY, + T_OPEN_SHORT_ARRAY, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @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(); + + if ($tokens[$stackPtr]['code'] === T_ARRAY) { + $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'no'); + + // Array keyword should be lower case. + if ($tokens[$stackPtr]['content'] !== strtolower($tokens[$stackPtr]['content'])) { + if ($tokens[$stackPtr]['content'] === strtoupper($tokens[$stackPtr]['content'])) { + $phpcsFile->recordMetric($stackPtr, 'Array keyword case', 'upper'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Array keyword case', 'mixed'); + } + + $error = 'Array keyword should be lower case; expected "array" but found "%s"'; + $data = [$tokens[$stackPtr]['content']]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotLowerCase', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, 'array'); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Array keyword case', 'lower'); + } + + $arrayStart = $tokens[$stackPtr]['parenthesis_opener']; + if (isset($tokens[$arrayStart]['parenthesis_closer']) === false) { + return; + } + + $arrayEnd = $tokens[$arrayStart]['parenthesis_closer']; + + if ($arrayStart !== ($stackPtr + 1)) { + $error = 'There must be no space between the "array" keyword and the opening parenthesis'; + + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), $arrayStart, true); + if (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true) { + // We don't have anywhere to put the comment, so don't attempt to fix it. + $phpcsFile->addError($error, $stackPtr, 'SpaceAfterKeyword'); + } else { + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($stackPtr + 1); $i < $arrayStart; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'yes'); + $arrayStart = $stackPtr; + $arrayEnd = $tokens[$stackPtr]['bracket_closer']; + }//end if + + // Check for empty arrays. + $content = $phpcsFile->findNext(T_WHITESPACE, ($arrayStart + 1), ($arrayEnd + 1), true); + if ($content === $arrayEnd) { + // Empty array, but if the brackets aren't together, there's a problem. + if (($arrayEnd - $arrayStart) !== 1) { + $error = 'Empty array declaration must have no space between the parentheses'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceInEmptyArray'); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($arrayStart + 1); $i < $arrayEnd; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + // We can return here because there is nothing else to check. All code + // below can assume that the array is not empty. + return; + } + + if ($tokens[$arrayStart]['line'] === $tokens[$arrayEnd]['line']) { + $this->processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd); + } else { + $this->processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd); + } + + }//end process() + + + /** + * Processes a single-line array definition. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $arrayStart The token that starts the array definition. + * @param int $arrayEnd The token that ends the array definition. + * + * @return void + */ + public function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd) + { + $tokens = $phpcsFile->getTokens(); + + // Check if there are multiple values. If so, then it has to be multiple lines + // unless it is contained inside a function call or condition. + $valueCount = 0; + $commas = []; + for ($i = ($arrayStart + 1); $i < $arrayEnd; $i++) { + // Skip bracketed statements, like function calls. + if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { + $i = $tokens[$i]['parenthesis_closer']; + continue; + } + + if ($tokens[$i]['code'] === T_COMMA) { + // Before counting this comma, make sure we are not + // at the end of the array. + $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $arrayEnd, true); + if ($next !== false) { + $valueCount++; + $commas[] = $i; + } else { + // There is a comma at the end of a single line array. + $error = 'Comma not allowed after last value in single-line array declaration'; + $fix = $phpcsFile->addFixableError($error, $i, 'CommaAfterLast'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + } + }//end for + + // Now check each of the double arrows (if any). + $nextArrow = $arrayStart; + while (($nextArrow = $phpcsFile->findNext(T_DOUBLE_ARROW, ($nextArrow + 1), $arrayEnd)) !== false) { + if ($tokens[($nextArrow - 1)]['code'] !== T_WHITESPACE) { + $content = $tokens[($nextArrow - 1)]['content']; + $error = 'Expected 1 space between "%s" and double arrow; 0 found'; + $data = [$content]; + $fix = $phpcsFile->addFixableError($error, $nextArrow, 'NoSpaceBeforeDoubleArrow', $data); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($nextArrow, ' '); + } + } else { + $spaceLength = $tokens[($nextArrow - 1)]['length']; + if ($spaceLength !== 1) { + $content = $tokens[($nextArrow - 2)]['content']; + $error = 'Expected 1 space between "%s" and double arrow; %s found'; + $data = [ + $content, + $spaceLength, + ]; + + $fix = $phpcsFile->addFixableError($error, $nextArrow, 'SpaceBeforeDoubleArrow', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($nextArrow - 1), ' '); + } + } + }//end if + + if ($tokens[($nextArrow + 1)]['code'] !== T_WHITESPACE) { + $content = $tokens[($nextArrow + 1)]['content']; + $error = 'Expected 1 space between double arrow and "%s"; 0 found'; + $data = [$content]; + $fix = $phpcsFile->addFixableError($error, $nextArrow, 'NoSpaceAfterDoubleArrow', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($nextArrow, ' '); + } + } else { + $spaceLength = $tokens[($nextArrow + 1)]['length']; + if ($spaceLength !== 1) { + $content = $tokens[($nextArrow + 2)]['content']; + $error = 'Expected 1 space between double arrow and "%s"; %s found'; + $data = [ + $content, + $spaceLength, + ]; + + $fix = $phpcsFile->addFixableError($error, $nextArrow, 'SpaceAfterDoubleArrow', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($nextArrow + 1), ' '); + } + } + }//end if + }//end while + + if ($valueCount > 0) { + $nestedParenthesis = false; + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $nested = $tokens[$stackPtr]['nested_parenthesis']; + $nestedParenthesis = array_pop($nested); + } + + if ($nestedParenthesis === false + || $tokens[$nestedParenthesis]['line'] !== $tokens[$stackPtr]['line'] + ) { + $error = 'Array with multiple values cannot be declared on a single line'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SingleLineNotAllowed'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addNewline($arrayStart); + + if ($tokens[($arrayEnd - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($arrayEnd - 1), $phpcsFile->eolChar); + } else { + $phpcsFile->fixer->addNewlineBefore($arrayEnd); + } + + $phpcsFile->fixer->endChangeset(); + } + + return; + } + + // We have a multiple value array that is inside a condition or + // function. Check its spacing is correct. + foreach ($commas as $comma) { + if ($tokens[($comma + 1)]['code'] !== T_WHITESPACE) { + $content = $tokens[($comma + 1)]['content']; + $error = 'Expected 1 space between comma and "%s"; 0 found'; + $data = [$content]; + $fix = $phpcsFile->addFixableError($error, $comma, 'NoSpaceAfterComma', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($comma, ' '); + } + } else { + $spaceLength = $tokens[($comma + 1)]['length']; + if ($spaceLength !== 1) { + $content = $tokens[($comma + 2)]['content']; + $error = 'Expected 1 space between comma and "%s"; %s found'; + $data = [ + $content, + $spaceLength, + ]; + + $fix = $phpcsFile->addFixableError($error, $comma, 'SpaceAfterComma', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($comma + 1), ' '); + } + } + }//end if + + if ($tokens[($comma - 1)]['code'] === T_WHITESPACE) { + $content = $tokens[($comma - 2)]['content']; + $spaceLength = $tokens[($comma - 1)]['length']; + $error = 'Expected 0 spaces between "%s" and comma; %s found'; + $data = [ + $content, + $spaceLength, + ]; + + $fix = $phpcsFile->addFixableError($error, $comma, 'SpaceBeforeComma', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($comma - 1), ''); + } + } + }//end foreach + }//end if + + }//end processSingleLineArray() + + + /** + * Processes a multi-line array definition. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $arrayStart The token that starts the array definition. + * @param int $arrayEnd The token that ends the array definition. + * + * @return void + */ + public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd) + { + $tokens = $phpcsFile->getTokens(); + $keywordStart = $tokens[$stackPtr]['column']; + + // Check the closing bracket is on a new line. + $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($arrayEnd - 1), $arrayStart, true); + if ($tokens[$lastContent]['line'] === $tokens[$arrayEnd]['line']) { + $error = 'Closing parenthesis of array declaration must be on a new line'; + $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNewLine'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($arrayEnd); + } + } 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); + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Closing parenthesis not aligned correctly; expected %s space%s but found %s'; + $data = [ + $expected, + $pluralizeSpace, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNotAligned', $data); + if ($fix === true) { + if ($found === 0) { + $phpcsFile->fixer->addContent(($arrayEnd - 1), str_repeat(' ', $expected)); + } else { + $phpcsFile->fixer->replaceToken(($arrayEnd - 1), str_repeat(' ', $expected)); + } + } + }//end if + + $keyUsed = false; + $singleUsed = false; + $indices = []; + $maxLength = 0; + + if ($tokens[$stackPtr]['code'] === T_ARRAY) { + $lastToken = $tokens[$stackPtr]['parenthesis_opener']; + } else { + $lastToken = $stackPtr; + } + + // Find all the double arrows that reside in this scope. + for ($nextToken = ($stackPtr + 1); $nextToken < $arrayEnd; $nextToken++) { + // Skip bracketed statements, like function calls. + if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS + && (isset($tokens[$nextToken]['parenthesis_owner']) === false + || $tokens[$nextToken]['parenthesis_owner'] !== $stackPtr) + ) { + $nextToken = $tokens[$nextToken]['parenthesis_closer']; + continue; + } + + if ($tokens[$nextToken]['code'] === T_ARRAY + || $tokens[$nextToken]['code'] === T_OPEN_SHORT_ARRAY + || $tokens[$nextToken]['code'] === T_CLOSURE + || $tokens[$nextToken]['code'] === T_FN + || $tokens[$nextToken]['code'] === T_MATCH + ) { + // Let subsequent calls of this test handle nested arrays. + if ($tokens[$lastToken]['code'] !== T_DOUBLE_ARROW) { + $indices[] = ['value' => $nextToken]; + $lastToken = $nextToken; + } + + if ($tokens[$nextToken]['code'] === T_ARRAY) { + $nextToken = $tokens[$tokens[$nextToken]['parenthesis_opener']]['parenthesis_closer']; + } else if ($tokens[$nextToken]['code'] === T_OPEN_SHORT_ARRAY) { + $nextToken = $tokens[$nextToken]['bracket_closer']; + } else { + // T_CLOSURE. + $nextToken = $tokens[$nextToken]['scope_closer']; + } + + $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($nextToken + 1), null, true); + if ($tokens[$nextToken]['code'] !== T_COMMA) { + $nextToken--; + } else { + $lastToken = $nextToken; + } + + continue; + }//end if + + if ($tokens[$nextToken]['code'] !== T_DOUBLE_ARROW && $tokens[$nextToken]['code'] !== T_COMMA) { + continue; + } + + $currentEntry = []; + + if ($tokens[$nextToken]['code'] === T_COMMA) { + $stackPtrCount = 0; + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $stackPtrCount = count($tokens[$stackPtr]['nested_parenthesis']); + } + + $commaCount = 0; + if (isset($tokens[$nextToken]['nested_parenthesis']) === true) { + $commaCount = count($tokens[$nextToken]['nested_parenthesis']); + if ($tokens[$stackPtr]['code'] === T_ARRAY) { + // Remove parenthesis that are used to define the array. + $commaCount--; + } + } + + if ($commaCount > $stackPtrCount) { + // This comma is inside more parenthesis than the ARRAY keyword, + // then there it is actually a comma used to separate arguments + // in a function call. + continue; + } + + if ($keyUsed === true && $tokens[$lastToken]['code'] === T_COMMA) { + $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) { + if ($tokens[($nextToken - 1)]['code'] === T_WHITESPACE) { + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextToken - 1), null, true); + if (($tokens[$prev]['code'] !== T_END_HEREDOC + && $tokens[$prev]['code'] !== T_END_NOWDOC) + || $tokens[($nextToken - 1)]['line'] === $tokens[$nextToken]['line'] + ) { + if ($tokens[($nextToken - 1)]['content'] === $phpcsFile->eolChar) { + $spaceLength = 'newline'; + } else { + $spaceLength = $tokens[($nextToken - 1)]['length']; + } + + $error = 'Expected 0 spaces before comma; %s found'; + $data = [$spaceLength]; + + // The error is only fixable if there is only whitespace between the tokens. + if ($prev === $phpcsFile->findPrevious(T_WHITESPACE, ($nextToken - 1), null, true)) { + $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpaceBeforeComma', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($nextToken - 1), ''); + } + } else { + $phpcsFile->addError($error, $nextToken, 'SpaceBeforeComma', $data); + } + } + }//end if + + $valueContent = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($lastToken + 1), + $nextToken, + 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; + continue; + }//end if + + if ($tokens[$nextToken]['code'] === T_DOUBLE_ARROW) { + if ($singleUsed === true) { + $error = 'Key specified for array entry; first entry has no key'; + $phpcsFile->addError($error, $nextToken, 'KeySpecified'); + return; + } + + $currentEntry['arrow'] = $nextToken; + $keyUsed = true; + + // Find the start of index that uses this double arrow. + $indexEnd = $phpcsFile->findPrevious(T_WHITESPACE, ($nextToken - 1), $arrayStart, true); + $indexStart = $phpcsFile->findStartOfStatement($indexEnd); + + if ($indexStart === $indexEnd) { + $currentEntry['index'] = $indexEnd; + $currentEntry['index_content'] = $tokens[$indexEnd]['content']; + $currentEntry['index_length'] = $tokens[$indexEnd]['length']; + } else { + $currentEntry['index'] = $indexStart; + $currentEntry['index_content'] = ''; + $currentEntry['index_length'] = 0; + for ($i = $indexStart; $i <= $indexEnd; $i++) { + $currentEntry['index_content'] .= $tokens[$i]['content']; + $currentEntry['index_length'] += $tokens[$i]['length']; + } + } + + if ($maxLength < $currentEntry['index_length']) { + $maxLength = $currentEntry['index_length']; + } + + // Find the value of this index. + $nextContent = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($nextToken + 1), + $arrayEnd, + true + ); + + $currentEntry['value'] = $nextContent; + $indices[] = $currentEntry; + $lastToken = $nextToken; + }//end if + }//end for + + // Check for multi-line arrays that should be single-line. + $singleValue = false; + + if (empty($indices) === true) { + $singleValue = true; + } else if (count($indices) === 1 && $tokens[$lastToken]['code'] === T_COMMA) { + // There may be another array value without a comma. + $exclude = Tokens::$emptyTokens; + $exclude[] = T_COMMA; + $nextContent = $phpcsFile->findNext($exclude, ($indices[0]['value'] + 1), $arrayEnd, true); + if ($nextContent === false) { + $singleValue = true; + } + } + + if ($singleValue === true) { + // Before we complain, make sure the single value isn't a here/nowdoc. + $next = $phpcsFile->findNext(Tokens::$heredocTokens, ($arrayStart + 1), ($arrayEnd - 1)); + if ($next === false) { + // Array cannot be empty, so this is a multi-line array with + // a single value. It should be defined on single line. + $error = 'Multi-line array contains a single value; use single-line array instead'; + $errorCode = 'MultiLineNotAllowed'; + + $find = Tokens::$phpcsCommentTokens; + $find[] = T_COMMENT; + $comment = $phpcsFile->findNext($find, ($arrayStart + 1), $arrayEnd); + if ($comment === false) { + $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode); + } else { + $fix = false; + $phpcsFile->addError($error, $stackPtr, $errorCode); + } + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($arrayStart + 1); $i < $arrayEnd; $i++) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + for ($i = ($arrayEnd - 1); $i > $arrayStart; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + return; + }//end if + }//end if + + /* + This section checks for arrays that don't specify keys. + + Arrays such as: + array( + 'aaa', + 'bbb', + 'd', + ); + */ + + if ($keyUsed === false && empty($indices) === false) { + $count = count($indices); + $lastIndex = $indices[($count - 1)]['value']; + + $trailingContent = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($arrayEnd - 1), + $lastIndex, + true + ); + + if ($tokens[$trailingContent]['code'] !== T_COMMA) { + $phpcsFile->recordMetric($stackPtr, 'Array end comma', 'no'); + $error = 'Comma required after last value in array declaration'; + $fix = $phpcsFile->addFixableError($error, $trailingContent, 'NoCommaAfterLast'); + if ($fix === true) { + $phpcsFile->fixer->addContent($trailingContent, ','); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Array end comma', 'yes'); + } + + foreach ($indices as $valuePosition => $value) { + if (empty($value['value']) === true) { + // Array was malformed and we couldn't figure out + // the array value correctly, so we have to ignore it. + // Other parts of this sniff will correct the error. + continue; + } + + $valuePointer = $value['value']; + + $ignoreTokens = [ + T_WHITESPACE => T_WHITESPACE, + T_COMMA => T_COMMA, + ]; + $ignoreTokens += Tokens::$castTokens; + + if ($tokens[$valuePointer]['code'] === T_CLOSURE + || $tokens[$valuePointer]['code'] === T_FN + ) { + // Check if the closure is static, if it is, override the value pointer as indices before skip static. + $staticPointer = $phpcsFile->findPrevious($ignoreTokens, ($valuePointer - 1), ($arrayStart + 1), true); + if ($staticPointer !== false && $tokens[$staticPointer]['code'] === T_STATIC) { + $valuePointer = $staticPointer; + } + } + + $previous = $phpcsFile->findPrevious($ignoreTokens, ($valuePointer - 1), ($arrayStart + 1), true); + if ($previous === false) { + $previous = $stackPtr; + } + + $previousIsWhitespace = $tokens[($valuePointer - 1)]['code'] === T_WHITESPACE; + if ($tokens[$previous]['line'] === $tokens[$valuePointer]['line']) { + $error = 'Each value in a multi-line array must be on a new line'; + if ($valuePosition === 0) { + $error = 'The first value in a multi-value array must be on a new line'; + } + + $fix = $phpcsFile->addFixableError($error, $valuePointer, 'ValueNoNewline'); + if ($fix === true) { + if ($previousIsWhitespace === true) { + $phpcsFile->fixer->replaceToken(($valuePointer - 1), $phpcsFile->eolChar); + } else { + $phpcsFile->fixer->addNewlineBefore($valuePointer); + } + } + } else if ($previousIsWhitespace === true) { + $expected = $keywordStart; + + $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 space%s but found %s'; + $data = [ + $expected, + $pluralizeSpace, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $first, 'ValueNotAligned', $data); + if ($fix === true) { + if ($found === 0) { + $phpcsFile->fixer->addContent(($first - 1), str_repeat(' ', $expected)); + } else { + $phpcsFile->fixer->replaceToken(($first - 1), str_repeat(' ', $expected)); + } + } + } + }//end if + }//end foreach + }//end if + + /* + Below the actual indentation of the array is checked. + Errors will be thrown when a key is not aligned, when + a double arrow is not aligned, and when a value is not + aligned correctly. + If an error is found in one of the above areas, then errors + are not reported for the rest of the line to avoid reporting + spaces and columns incorrectly. Often fixing the first + problem will fix the other 2 anyway. + + For example: + + $a = array( + 'index' => '2', + ); + + or + + $a = [ + 'index' => '2', + ]; + + In this array, the double arrow is indented too far, but this + will also cause an error in the value's alignment. If the arrow were + to be moved back one space however, then both errors would be fixed. + */ + + $indicesStart = ($keywordStart + 1); + foreach ($indices as $valuePosition => $index) { + $valuePointer = $index['value']; + if ($valuePointer === false) { + // Syntax error or live coding. + continue; + } + + if (isset($index['index']) === false) { + // Array value only. + continue; + } + + $indexPointer = $index['index']; + $indexLine = $tokens[$indexPointer]['line']; + + $previous = $phpcsFile->findPrevious([T_WHITESPACE, T_COMMA], ($indexPointer - 1), ($arrayStart + 1), true); + if ($previous === false) { + $previous = $stackPtr; + } + + if ($tokens[$previous]['line'] === $indexLine) { + $error = 'Each index in a multi-line array must be on a new line'; + if ($valuePosition === 0) { + $error = 'The first index in a multi-value array must be on a new line'; + } + + $fix = $phpcsFile->addFixableError($error, $indexPointer, 'IndexNoNewline'); + if ($fix === true) { + if ($tokens[($indexPointer - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($indexPointer - 1), $phpcsFile->eolChar); + } else { + $phpcsFile->fixer->addNewlineBefore($indexPointer); + } + } + + continue; + } + + if ($tokens[$indexPointer]['column'] !== $indicesStart && ($indexPointer - 1) !== $arrayStart) { + $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, + ]; + + $fix = $phpcsFile->addFixableError($error, $indexPointer, 'KeyNotAligned', $data); + if ($fix === true) { + if ($found === 0 || $tokens[($indexPointer - 1)]['code'] !== T_WHITESPACE) { + $phpcsFile->fixer->addContent(($indexPointer - 1), str_repeat(' ', $expected)); + } else { + $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'])); + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Array double arrow not aligned correctly; expected %s space%s but found %s'; + $data = [ + $expected, + $pluralizeSpace, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $index['arrow'], 'DoubleArrowNotAligned', $data); + if ($fix === true) { + if ($found === 0) { + $phpcsFile->fixer->addContent(($index['arrow'] - 1), str_repeat(' ', $expected)); + } else { + $phpcsFile->fixer->replaceToken(($index['arrow'] - 1), str_repeat(' ', $expected)); + } + } + + continue; + }//end if + + $valueStart = ($arrowStart + 3); + if ($tokens[$valuePointer]['column'] !== $valueStart) { + $expected = ($valueStart - ($tokens[$index['arrow']]['length'] + $tokens[$index['arrow']]['column'])); + $found = ($tokens[$valuePointer]['column'] - ($tokens[$index['arrow']]['length'] + $tokens[$index['arrow']]['column'])); + if ($found < 0) { + $found = 'newline'; + } + + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Array value not aligned correctly; expected %s space%s but found %s'; + $data = [ + $expected, + $pluralizeSpace, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $index['arrow'], 'ValueNotAligned', $data); + if ($fix === true) { + if ($found === 'newline') { + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($valuePointer - 1), null, true); + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prev + 1); $i < $valuePointer; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->replaceToken(($valuePointer - 1), str_repeat(' ', $expected)); + $phpcsFile->fixer->endChangeset(); + } else if ($found === 0) { + $phpcsFile->fixer->addContent(($valuePointer - 1), str_repeat(' ', $expected)); + } else { + $phpcsFile->fixer->replaceToken(($valuePointer - 1), str_repeat(' ', $expected)); + } + } + }//end if + + // Check each line ends in a comma. + $valueStart = $valuePointer; + $nextComma = false; + + $end = $phpcsFile->findEndOfStatement($valueStart); + if ($end === false) { + $valueEnd = $valueStart; + } else if ($tokens[$end]['code'] === T_COMMA) { + $valueEnd = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($end - 1), $valueStart, true); + $nextComma = $end; + } else { + $valueEnd = $end; + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $arrayEnd, true); + if ($next !== false && $tokens[$next]['code'] === T_COMMA) { + $nextComma = $next; + } + } + + $valueLine = $tokens[$valueEnd]['line']; + if ($tokens[$valueEnd]['code'] === T_END_HEREDOC || $tokens[$valueEnd]['code'] === T_END_NOWDOC) { + $valueLine++; + } + + if ($nextComma === false || ($tokens[$nextComma]['line'] !== $valueLine)) { + $error = 'Each line in an array declaration must end in a comma'; + $fix = $phpcsFile->addFixableError($error, $valuePointer, 'NoComma'); + + if ($fix === true) { + // Find the end of the line and put a comma there. + for ($i = ($valuePointer + 1); $i <= $arrayEnd; $i++) { + if ($tokens[$i]['line'] > $valueLine) { + break; + } + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContentBefore(($i - 1), ','); + if ($nextComma !== false) { + $phpcsFile->fixer->replaceToken($nextComma, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + + // Check that there is no space before the comma. + if ($nextComma !== false && $tokens[($nextComma - 1)]['code'] === T_WHITESPACE) { + // Here/nowdoc closing tags must have the comma on the next line. + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextComma - 1), null, true); + if ($tokens[$prev]['code'] !== T_END_HEREDOC && $tokens[$prev]['code'] !== T_END_NOWDOC) { + $content = $tokens[($nextComma - 2)]['content']; + $spaceLength = $tokens[($nextComma - 1)]['length']; + $error = 'Expected 0 spaces between "%s" and comma; %s found'; + $data = [ + $content, + $spaceLength, + ]; + + $fix = $phpcsFile->addFixableError($error, $nextComma, 'SpaceBeforeComma', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($nextComma - 1), ''); + } + } + } + }//end foreach + + }//end processMultiLineArray() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php new file mode 100644 index 00000000..384a8f2b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php @@ -0,0 +1,136 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ClassDefinitionClosingBraceSpaceSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_CLOSE_CURLY_BRACKET]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $next = $stackPtr; + while (true) { + $next = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); + if ($next === false) { + return; + } + + if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true + && $tokens[$next]['line'] === $tokens[$stackPtr]['line'] + ) { + // Trailing comment. + continue; + } + + break; + } + + if ($tokens[$next]['code'] !== T_CLOSE_TAG) { + $found = (($tokens[$next]['line'] - $tokens[$stackPtr]['line']) - 1); + if ($found !== 1) { + $error = 'Expected one blank line after closing brace of class definition; %s found'; + $data = [max(0, $found)]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterClose', $data); + + if ($fix === true) { + $firstOnLine = $next; + while ($tokens[$firstOnLine]['column'] !== 1) { + --$firstOnLine; + } + + if ($found < 0) { + // Next statement on same line as the closing brace. + $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); + } else if ($found === 0) { + // Next statement on next line, no blank line. + $phpcsFile->fixer->addContentBefore($firstOnLine, $phpcsFile->eolChar); + } else { + // Too many blank lines. + $phpcsFile->fixer->beginChangeset(); + for ($i = ($firstOnLine - 1); $i > $stackPtr; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addContentBefore($firstOnLine, $phpcsFile->eolChar.$phpcsFile->eolChar); + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + }//end if + + // Ignore nested style definitions from here on. The spacing before the closing brace + // (a single blank line) will be enforced by the above check, which ensures there is a + // blank line after the last nested class. + $found = $phpcsFile->findPrevious( + T_CLOSE_CURLY_BRACKET, + ($stackPtr - 1), + $tokens[$stackPtr]['bracket_opener'] + ); + + if ($found !== false) { + return; + } + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($prev === false) { + return; + } + + if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) { + $error = 'Closing brace of class definition must be on new line'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBeforeClose'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($stackPtr); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php new file mode 100644 index 00000000..796bbbaa --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php @@ -0,0 +1,113 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ClassDefinitionNameSpacingSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_CURLY_BRACKET]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + // Syntax error or live coding, bow out. + return; + } + + // Do not check nested style definitions as, for example, in @media style rules. + $nested = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1), $tokens[$stackPtr]['bracket_closer']); + if ($nested !== false) { + return; + } + + // Find the first blank line before this opening brace, unless we get + // to another style definition, comment or the start of the file. + $endTokens = [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_OPEN_TAG => T_OPEN_TAG, + ]; + $endTokens += Tokens::$commentTokens; + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + $foundContent = false; + $currentLine = $tokens[$prev]['line']; + for ($i = ($stackPtr - 1); $i >= 0; $i--) { + if (isset($endTokens[$tokens[$i]['code']]) === true) { + break; + } + + if ($tokens[$i]['line'] === $currentLine) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + $foundContent = true; + } + + continue; + } + + // We changed lines. + if ($foundContent === false) { + // Before we throw an error, make sure we are not looking + // at a gap before the style definition. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, $i, null, true); + if ($prev !== false + && isset($endTokens[$tokens[$prev]['code']]) === false + ) { + $error = 'Blank lines are not allowed between class names'; + $phpcsFile->addError($error, ($i + 1), 'BlankLinesFound'); + } + + break; + } + + $foundContent = false; + $currentLine = $tokens[$i]['line']; + }//end for + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php new file mode 100644 index 00000000..7750fa1d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php @@ -0,0 +1,178 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ClassDefinitionOpeningBraceSpaceSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_CURLY_BRACKET]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + + if ($prevNonWhitespace !== false) { + $length = 0; + if ($tokens[$stackPtr]['line'] !== $tokens[$prevNonWhitespace]['line']) { + $length = 'newline'; + } else if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { + if (strpos($tokens[($stackPtr - 1)]['content'], "\t") !== false) { + $length = 'tab'; + } else { + $length = $tokens[($stackPtr - 1)]['length']; + } + } + + if ($length === 0) { + $error = 'Expected 1 space before opening brace of class definition; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoneBefore'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + } + } else if ($length !== 1) { + $error = 'Expected 1 space before opening brace of class definition; %s found'; + $data = [$length]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + for ($i = ($stackPtr - 1); $i > $prevNonWhitespace; $i--) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + return; + } + + if ($tokens[$nextNonEmpty]['line'] === $tokens[$stackPtr]['line']) { + $error = 'Opening brace should be the last content on the line'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBefore'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addNewline($stackPtr); + + // Remove potentially left over trailing whitespace. + if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } else { + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + // Syntax error or live coding, bow out. + return; + } + + // Check for nested class definitions. + $found = $phpcsFile->findNext( + T_OPEN_CURLY_BRACKET, + ($stackPtr + 1), + $tokens[$stackPtr]['bracket_closer'] + ); + + if ($found === false) { + // Not nested. + return; + } + + $lastOnLine = $stackPtr; + for ($lastOnLine; $lastOnLine < $tokens[$stackPtr]['bracket_closer']; $lastOnLine++) { + if ($tokens[$lastOnLine]['line'] !== $tokens[($lastOnLine + 1)]['line']) { + break; + } + } + + $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($lastOnLine + 1), null, true); + if ($nextNonWhiteSpace === false) { + return; + } + + $foundLines = ($tokens[$nextNonWhiteSpace]['line'] - $tokens[$stackPtr]['line'] - 1); + if ($foundLines !== 1) { + $error = 'Expected 1 blank line after opening brace of nesting class definition; %s found'; + $data = [max(0, $foundLines)]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'AfterNesting', $data); + + if ($fix === true) { + $firstOnNextLine = $nextNonWhiteSpace; + while ($tokens[$firstOnNextLine]['column'] !== 1) { + --$firstOnNextLine; + } + + if ($found < 0) { + // First statement on same line as the opening brace. + $phpcsFile->fixer->addContentBefore($nextNonWhiteSpace, $phpcsFile->eolChar.$phpcsFile->eolChar); + } else if ($found === 0) { + // Next statement on next line, no blank line. + $phpcsFile->fixer->addNewlineBefore($firstOnNextLine); + } else { + // Too many blank lines. + $phpcsFile->fixer->beginChangeset(); + for ($i = ($firstOnNextLine - 1); $i > $stackPtr; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addContentBefore($firstOnNextLine, $phpcsFile->eolChar.$phpcsFile->eolChar); + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php new file mode 100644 index 00000000..6459e035 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php @@ -0,0 +1,109 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ColonSpacingSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_COLON]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$prev]['code'] !== T_STYLE) { + // The colon is not part of a style definition. + return; + } + + if ($tokens[$prev]['content'] === 'progid') { + // Special case for IE filters. + return; + } + + if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { + $error = 'There must be no space before a colon in a style definition'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); + } + } + + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$next]['code'] === T_SEMICOLON || $tokens[$next]['code'] === T_STYLE) { + // Empty style definition, ignore it. + return; + } + + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space after colon in style definition; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoneAfter'); + if ($fix === true) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } + } else { + $content = $tokens[($stackPtr + 1)]['content']; + if (strpos($content, $phpcsFile->eolChar) === false) { + $length = strlen($content); + if ($length !== 1) { + $error = 'Expected 1 space after colon in style definition; %s found'; + $data = [$length]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'After', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + } else { + $error = 'Expected 1 space after colon in style definition; newline found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'AfterNewline'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php new file mode 100644 index 00000000..5114a0cb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php @@ -0,0 +1,90 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ColourDefinitionSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_COLOUR]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $colour = $tokens[$stackPtr]['content']; + + $expected = strtoupper($colour); + if ($colour !== $expected) { + $error = 'CSS colours must be defined in uppercase; expected %s but found %s'; + $data = [ + $expected, + $colour, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotUpper', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $expected); + } + } + + // Now check if shorthand can be used. + if (strlen($colour) !== 7) { + return; + } + + if ($colour[1] === $colour[2] && $colour[3] === $colour[4] && $colour[5] === $colour[6]) { + $expected = '#'.$colour[1].$colour[3].$colour[5]; + $error = 'CSS colours must use shorthand if available; expected %s but found %s'; + $data = [ + $expected, + $colour, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Shorthand', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $expected); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php new file mode 100644 index 00000000..72448a30 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php @@ -0,0 +1,73 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DisallowMultipleStyleDefinitionsSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var string[] + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_STYLE]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $next = $phpcsFile->findNext(T_STYLE, ($stackPtr + 1)); + if ($next === false) { + return; + } + + if ($tokens[$next]['content'] === 'progid') { + // Special case for IE filters. + return; + } + + if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { + $error = 'Each style definition must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $next, 'Found'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($next); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php new file mode 100644 index 00000000..82a974c8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php @@ -0,0 +1,118 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class DuplicateClassDefinitionSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Find the content of each class definition name. + $classNames = []; + $next = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1)); + if ($next === false) { + // No class definitions in the file. + return; + } + + // Save the class names in a "scope", + // to prevent false positives with @media blocks. + $scope = 'main'; + + $find = [ + T_CLOSE_CURLY_BRACKET, + T_OPEN_CURLY_BRACKET, + T_OPEN_TAG, + ]; + + while ($next !== false) { + $prev = $phpcsFile->findPrevious($find, ($next - 1)); + + // Check if an inner block was closed. + $beforePrev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); + if ($beforePrev !== false + && $tokens[$beforePrev]['code'] === T_CLOSE_CURLY_BRACKET + ) { + $scope = 'main'; + } + + // Create a sorted name for the class so we can compare classes + // even when the individual names are all over the place. + $name = ''; + for ($i = ($prev + 1); $i < $next; $i++) { + $name .= $tokens[$i]['content']; + } + + $name = trim($name); + $name = str_replace("\n", ' ', $name); + $name = preg_replace('|[\s]+|', ' ', $name); + $name = preg_replace('|\s*/\*.*\*/\s*|', '', $name); + $name = str_replace(', ', ',', $name); + + $names = explode(',', $name); + sort($names); + $name = implode(',', $names); + + if ($name[0] === '@') { + // Media block has its own "scope". + $scope = $name; + } else if (isset($classNames[$scope][$name]) === true) { + $first = $classNames[$scope][$name]; + $error = 'Duplicate class definition found; first defined on line %s'; + $data = [$tokens[$first]['line']]; + $phpcsFile->addError($error, $next, 'Found', $data); + } else { + $classNames[$scope][$name] = $next; + } + + $next = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($next + 1)); + }//end while + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php new file mode 100644 index 00000000..e9221470 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php @@ -0,0 +1,90 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DuplicateStyleDefinitionSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_CURLY_BRACKET]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + // Syntax error or live coding, bow out. + return; + } + + // Find the content of each style definition name. + $styleNames = []; + + $next = $stackPtr; + $end = $tokens[$stackPtr]['bracket_closer']; + + do { + $next = $phpcsFile->findNext([T_STYLE, T_OPEN_CURLY_BRACKET], ($next + 1), $end); + if ($next === false) { + // Class definition is empty. + break; + } + + if ($tokens[$next]['code'] === T_OPEN_CURLY_BRACKET) { + $next = $tokens[$next]['bracket_closer']; + continue; + } + + $name = $tokens[$next]['content']; + if (isset($styleNames[$name]) === true) { + $first = $styleNames[$name]; + $error = 'Duplicate style definition found; first defined on line %s'; + $data = [$tokens[$first]['line']]; + $phpcsFile->addError($error, $next, 'Found', $data); + } else { + $styleNames[$name] = $next; + } + } while ($next !== false); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php new file mode 100644 index 00000000..b7671d3e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php @@ -0,0 +1,63 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class EmptyClassDefinitionSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_CURLY_BRACKET]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + if ($next === false || $tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { + $error = 'Class definition is empty'; + $phpcsFile->addError($error, $stackPtr, 'Found'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php new file mode 100644 index 00000000..cc3007f2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php @@ -0,0 +1,66 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class EmptyStyleDefinitionSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_STYLE]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $ignore = Tokens::$emptyTokens; + $ignore[] = T_COLON; + + $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); + if ($next === false || $tokens[$next]['code'] === T_SEMICOLON || $tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { + $error = 'Style definition is empty'; + $phpcsFile->addError($error, $stackPtr, 'Found'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php new file mode 100644 index 00000000..982f4697 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php @@ -0,0 +1,179 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ForbiddenStylesSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + /** + * A list of forbidden styles with their alternatives. + * + * The value is NULL if no alternative exists. i.e., the + * style should just not be used. + * + * @var array + */ + protected $forbiddenStyles = [ + '-moz-border-radius' => 'border-radius', + '-webkit-border-radius' => 'border-radius', + '-moz-border-radius-topleft' => 'border-top-left-radius', + '-moz-border-radius-topright' => 'border-top-right-radius', + '-moz-border-radius-bottomright' => 'border-bottom-right-radius', + '-moz-border-radius-bottomleft' => 'border-bottom-left-radius', + '-moz-box-shadow' => 'box-shadow', + '-webkit-box-shadow' => 'box-shadow', + ]; + + /** + * A cache of forbidden style names, for faster lookups. + * + * @var string[] + */ + protected $forbiddenStyleNames = []; + + /** + * If true, forbidden styles will be considered regular expressions. + * + * @var boolean + */ + protected $patternMatch = false; + + /** + * If true, an error will be thrown; otherwise a warning. + * + * @var boolean + */ + public $error = true; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + $this->forbiddenStyleNames = array_keys($this->forbiddenStyles); + + if ($this->patternMatch === true) { + foreach ($this->forbiddenStyleNames as $i => $name) { + $this->forbiddenStyleNames[$i] = '/'.$name.'/i'; + } + } + + return [T_STYLE]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $style = strtolower($tokens[$stackPtr]['content']); + $pattern = null; + + if ($this->patternMatch === true) { + $count = 0; + $pattern = preg_replace( + $this->forbiddenStyleNames, + $this->forbiddenStyleNames, + $style, + 1, + $count + ); + + if ($count === 0) { + return; + } + + // Remove the pattern delimiters and modifier. + $pattern = substr($pattern, 1, -2); + } else { + if (in_array($style, $this->forbiddenStyleNames, true) === false) { + return; + } + }//end if + + $this->addError($phpcsFile, $stackPtr, $style, $pattern); + + }//end process() + + + /** + * Generates the error or warning for this sniff. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the forbidden style + * in the token array. + * @param string $style The name of the forbidden style. + * @param string $pattern The pattern used for the match. + * + * @return void + */ + protected function addError($phpcsFile, $stackPtr, $style, $pattern=null) + { + $data = [$style]; + $error = 'The use of style %s is '; + if ($this->error === true) { + $type = 'Found'; + $error .= 'forbidden'; + } else { + $type = 'Discouraged'; + $error .= 'discouraged'; + } + + if ($pattern === null) { + $pattern = $style; + } + + if ($this->forbiddenStyles[$pattern] !== null) { + $data[] = $this->forbiddenStyles[$pattern]; + if ($this->error === true) { + $fix = $phpcsFile->addFixableError($error.'; use %s instead', $stackPtr, $type.'WithAlternative', $data); + } else { + $fix = $phpcsFile->addFixableWarning($error.'; use %s instead', $stackPtr, $type.'WithAlternative', $data); + } + + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $this->forbiddenStyles[$pattern]); + } + } else { + if ($this->error === true) { + $phpcsFile->addError($error, $stackPtr, $type, $data); + } else { + $phpcsFile->addWarning($error, $stackPtr, $type, $data); + } + } + + }//end addError() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php new file mode 100644 index 00000000..56406ccb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php @@ -0,0 +1,152 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class IndentationSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $numTokens = (count($tokens) - 2); + $indentLevel = 0; + $nestingLevel = 0; + for ($i = 1; $i < $numTokens; $i++) { + if ($tokens[$i]['code'] === T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true + ) { + // Don't check the indent of comments. + continue; + } + + if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { + $indentLevel++; + + if (isset($tokens[$i]['bracket_closer']) === false) { + // Syntax error or live coding. + // Anything after this would receive incorrect fixes, so bow out. + return; + } + + // Check for nested class definitions. + $found = $phpcsFile->findNext( + T_OPEN_CURLY_BRACKET, + ($i + 1), + $tokens[$i]['bracket_closer'] + ); + + if ($found !== false) { + $nestingLevel = $indentLevel; + } + } + + if (($tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET + && $tokens[$i]['line'] !== $tokens[($i - 1)]['line']) + || ($tokens[($i + 1)]['code'] === T_CLOSE_CURLY_BRACKET + && $tokens[$i]['line'] === $tokens[($i + 1)]['line']) + ) { + $indentLevel--; + if ($indentLevel === 0) { + $nestingLevel = 0; + } + } + + if ($tokens[$i]['column'] !== 1 + || $tokens[$i]['code'] === T_OPEN_CURLY_BRACKET + || $tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET + ) { + continue; + } + + // We started a new line, so check indent. + if ($tokens[$i]['code'] === T_WHITESPACE) { + $content = str_replace($phpcsFile->eolChar, '', $tokens[$i]['content']); + $foundIndent = strlen($content); + } else { + $foundIndent = 0; + } + + $expectedIndent = ($indentLevel * $this->indent); + if ($expectedIndent > 0 + && strpos($tokens[$i]['content'], $phpcsFile->eolChar) !== false + ) { + if ($nestingLevel !== $indentLevel) { + $error = 'Blank lines are not allowed in class definitions'; + $fix = $phpcsFile->addFixableError($error, $i, 'BlankLine'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + } else if ($foundIndent !== $expectedIndent) { + $error = 'Line indented incorrectly; expected %s spaces, found %s'; + $data = [ + $expectedIndent, + $foundIndent, + ]; + + $fix = $phpcsFile->addFixableError($error, $i, 'Incorrect', $data); + if ($fix === true) { + $indent = str_repeat(' ', $expectedIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($i, $indent); + } else { + $phpcsFile->fixer->replaceToken($i, $indent); + } + } + }//end if + }//end for + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php new file mode 100644 index 00000000..c8393c51 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php @@ -0,0 +1,99 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class LowercaseStyleDefinitionSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_CURLY_BRACKET]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $start = ($stackPtr + 1); + $end = ($tokens[$stackPtr]['bracket_closer'] - 1); + $inStyle = null; + + for ($i = $start; $i <= $end; $i++) { + // Skip nested definitions as they are checked individually. + if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { + $i = $tokens[$i]['bracket_closer']; + continue; + } + + if ($tokens[$i]['code'] === T_STYLE) { + $inStyle = $tokens[$i]['content']; + } + + if ($tokens[$i]['code'] === T_SEMICOLON) { + $inStyle = null; + } + + if ($inStyle === 'progid') { + // Special case for IE filters. + continue; + } + + if ($tokens[$i]['code'] === T_STYLE + || ($inStyle !== null + && $tokens[$i]['code'] === T_STRING) + ) { + $expected = strtolower($tokens[$i]['content']); + if ($expected !== $tokens[$i]['content']) { + $error = 'Style definitions must be lowercase; expected %s but found %s'; + $data = [ + $expected, + $tokens[$i]['content'], + ]; + + $fix = $phpcsFile->addFixableError($error, $i, 'FoundUpper', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($i, $expected); + } + } + } + }//end for + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php new file mode 100644 index 00000000..83f2a6c8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php @@ -0,0 +1,93 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class MissingColonSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_CURLY_BRACKET]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['bracket_closer']) === false) { + // Syntax error or live coding, bow out. + return; + } + + $lastLine = $tokens[$stackPtr]['line']; + $end = $tokens[$stackPtr]['bracket_closer']; + + // Do not check nested style definitions as, for example, in @media style rules. + $nested = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1), $end); + if ($nested !== false) { + return; + } + + $foundColon = false; + $foundString = false; + for ($i = ($stackPtr + 1); $i <= $end; $i++) { + if ($tokens[$i]['line'] !== $lastLine) { + // We changed lines. + if ($foundColon === false && $foundString !== false) { + // We didn't find a colon on the previous line. + $error = 'No style definition found on line; check for missing colon'; + $phpcsFile->addError($error, $foundString, 'Found'); + } + + $foundColon = false; + $foundString = false; + $lastLine = $tokens[$i]['line']; + } + + if ($tokens[$i]['code'] === T_STRING) { + $foundString = $i; + } else if ($tokens[$i]['code'] === T_COLON) { + $foundColon = $i; + } + }//end for + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php new file mode 100644 index 00000000..586b4730 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php @@ -0,0 +1,95 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class NamedColoursSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + /** + * A list of named colours. + * + * This is the list of standard colours defined in the CSS specification. + * + * @var array + */ + protected $colourNames = [ + 'aqua' => 'aqua', + 'black' => 'black', + 'blue' => 'blue', + 'fuchsia' => 'fuchsia', + 'gray' => 'gray', + 'green' => 'green', + 'lime' => 'lime', + 'maroon' => 'maroon', + 'navy' => 'navy', + 'olive' => 'olive', + 'orange' => 'orange', + 'purple' => 'purple', + 'red' => 'red', + 'silver' => 'silver', + 'teal' => 'teal', + 'white' => 'white', + 'yellow' => 'yellow', + ]; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_STRING]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[($stackPtr - 1)]['code'] === T_HASH + || $tokens[($stackPtr - 1)]['code'] === T_STRING_CONCAT + ) { + // Class name. + return; + } + + if (isset($this->colourNames[strtolower($tokens[$stackPtr]['content'])]) === true) { + $error = 'Named colours are forbidden; use hex, rgb, or rgba values instead'; + $phpcsFile->addError($error, $stackPtr, 'Forbidden'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php new file mode 100644 index 00000000..0c1c553a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php @@ -0,0 +1,103 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class OpacitySniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_STYLE]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['content'] !== 'opacity') { + return; + } + + $ignore = Tokens::$emptyTokens; + $ignore[] = T_COLON; + + $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); + + if ($next === false + || ($tokens[$next]['code'] !== T_DNUMBER + && $tokens[$next]['code'] !== T_LNUMBER) + ) { + return; + } + + $value = $tokens[$next]['content']; + if ($tokens[$next]['code'] === T_LNUMBER) { + if ($value !== '0' && $value !== '1') { + $error = 'Opacity values must be between 0 and 1'; + $phpcsFile->addError($error, $next, 'Invalid'); + } + } else { + if (strlen($value) > 3) { + $error = 'Opacity values must have a single value after the decimal point'; + $phpcsFile->addError($error, $next, 'DecimalPrecision'); + } else if ($value === '0.0' || $value === '1.0') { + $error = 'Opacity value does not require decimal point; use %s instead'; + $data = [$value[0]]; + $fix = $phpcsFile->addFixableError($error, $next, 'PointNotRequired', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($next, $value[0]); + } + } else if ($value[0] === '.') { + $error = 'Opacity values must not start with a decimal point; use 0%s instead'; + $data = [$value]; + $fix = $phpcsFile->addFixableError($error, $next, 'StartWithPoint', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($next, '0'.$value); + } + } else if ($value[0] !== '0') { + $error = 'Opacity values must be between 0 and 1'; + $phpcsFile->addError($error, $next, 'Invalid'); + }//end if + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php new file mode 100644 index 00000000..9030468b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php @@ -0,0 +1,105 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class SemicolonSpacingSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_STYLE]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $nextStatement = $phpcsFile->findNext([T_STYLE, T_CLOSE_CURLY_BRACKET], ($stackPtr + 1)); + if ($nextStatement === false) { + return; + } + + $ignore = Tokens::$emptyTokens; + if ($tokens[$nextStatement]['code'] === T_STYLE) { + // Allow for star-prefix hack. + $ignore[] = T_MULTIPLY; + } + + $endOfThisStatement = $phpcsFile->findPrevious($ignore, ($nextStatement - 1), null, true); + if ($tokens[$endOfThisStatement]['code'] !== T_SEMICOLON) { + $error = 'Style definitions must end with a semicolon'; + $phpcsFile->addError($error, $endOfThisStatement, 'NotAtEnd'); + return; + } + + if ($tokens[($endOfThisStatement - 1)]['code'] !== T_WHITESPACE) { + return; + } + + // There is a semicolon, so now find the last token in the statement. + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($endOfThisStatement - 1), null, true); + $found = $tokens[($endOfThisStatement - 1)]['length']; + if ($tokens[$prevNonEmpty]['line'] !== $tokens[$endOfThisStatement]['line']) { + $found = 'newline'; + } + + $error = 'Expected 0 spaces before semicolon in style definition; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $prevNonEmpty, 'SpaceFound', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($prevNonEmpty, ';'); + $phpcsFile->fixer->replaceToken($endOfThisStatement, ''); + + for ($i = ($endOfThisStatement - 1); $i > $prevNonEmpty; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php new file mode 100644 index 00000000..76e7330c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php @@ -0,0 +1,183 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ShorthandSizeSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['CSS']; + + /** + * A list of styles that we shouldn't check. + * + * These have values that looks like sizes, but are not. + * + * @var array + */ + protected $excludeStyles = [ + 'background-position' => 'background-position', + 'box-shadow' => 'box-shadow', + 'transform-origin' => 'transform-origin', + '-webkit-transform-origin' => '-webkit-transform-origin', + '-ms-transform-origin' => '-ms-transform-origin', + ]; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_STYLE]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Some styles look like shorthand but are not actually a set of 4 sizes. + $style = strtolower($tokens[$stackPtr]['content']); + if (isset($this->excludeStyles[$style]) === true) { + return; + } + + $end = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1)); + if ($end === false) { + // Live coding or parse error. + return; + } + + // Get the whole style content. + $origContent = $phpcsFile->getTokensAsString(($stackPtr + 1), ($end - $stackPtr - 1)); + $origContent = trim($origContent, ':'); + $origContent = trim($origContent); + + // Account for a !important annotation. + $content = $origContent; + if (substr($content, -10) === '!important') { + $content = substr($content, 0, -10); + $content = trim($content); + } + + // Check if this style value is a set of numbers with optional prefixes. + $content = preg_replace('/\s+/', ' ', $content); + $values = []; + $num = preg_match_all( + '/(?:[0-9]+)(?:[a-zA-Z]{2}\s+|%\s+|\s+)/', + $content.' ', + $values, + PREG_SET_ORDER + ); + + // Only interested in styles that have multiple sizes defined. + if ($num < 2) { + return; + } + + // Rebuild the content we matched to ensure we got everything. + $matched = ''; + foreach ($values as $value) { + $matched .= $value[0]; + } + + if ($content !== trim($matched)) { + return; + } + + if ($num === 3) { + $expected = trim($content.' '.$values[1][0]); + $error = 'Shorthand syntax not allowed here; use %s instead'; + $data = [$expected]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAllowed', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + if (substr($origContent, -10) === '!important') { + $expected .= ' !important'; + } + + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 2), null, true); + $phpcsFile->fixer->replaceToken($next, $expected); + for ($next++; $next < $end; $next++) { + $phpcsFile->fixer->replaceToken($next, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + return; + }//end if + + if ($num === 2) { + if ($values[0][0] !== $values[1][0]) { + // Both values are different, so it is already shorthand. + return; + } + } else if ($values[0][0] !== $values[2][0] || $values[1][0] !== $values[3][0]) { + // Can't shorthand this. + return; + } + + if ($values[0][0] === $values[1][0]) { + // All values are the same. + $expected = trim($values[0][0]); + } else { + $expected = trim($values[0][0]).' '.trim($values[1][0]); + } + + $error = 'Size definitions must use shorthand if available; expected "%s" but found "%s"'; + $data = [ + $expected, + $content, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotUsed', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + if (substr($origContent, -10) === '!important') { + $expected .= ' !important'; + } + + $next = $phpcsFile->findNext(T_COLON, ($stackPtr + 1)); + $phpcsFile->fixer->addContent($next, ' '.$expected); + for ($next++; $next < $end; $next++) { + $phpcsFile->fixer->replaceToken($next, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php new file mode 100644 index 00000000..3f5e1fbc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php @@ -0,0 +1,207 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff as PSR2ClassDeclarationSniff; +use PHP_CodeSniffer\Util\Tokens; + +class ClassDeclarationSniff extends PSR2ClassDeclarationSniff +{ + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + // We want all the errors from the PSR2 standard, plus some of our own. + parent::process($phpcsFile, $stackPtr); + + // Check that this is the only class or interface in the file. + $nextClass = $phpcsFile->findNext([T_CLASS, T_INTERFACE], ($stackPtr + 1)); + if ($nextClass !== false) { + // We have another, so an error is thrown. + $error = 'Only one interface or class is allowed in a file'; + $phpcsFile->addError($error, $nextClass, 'MultipleClasses'); + } + + }//end process() + + + /** + * Processes the opening section of a class declaration. + * + * @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 processOpen(File $phpcsFile, $stackPtr) + { + parent::processOpen($phpcsFile, $stackPtr); + + $tokens = $phpcsFile->getTokens(); + + if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { + $prevContent = $tokens[($stackPtr - 1)]['content']; + if ($prevContent !== $phpcsFile->eolChar) { + $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); + $spaces = strlen($blankSpace); + + 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']); + $error = 'Expected 0 spaces before %s keyword; %s found'; + $data = [ + $type, + $spaces, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeKeyword', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); + } + } + } + }//end if + }//end if + + }//end processOpen() + + + /** + * Processes the closing section of a class declaration. + * + * @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 processClose(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $closeBrace = $tokens[$stackPtr]['scope_closer']; + + // Check that the closing brace has one blank line after it. + for ($nextContent = ($closeBrace + 1); $nextContent < $phpcsFile->numTokens; $nextContent++) { + // Ignore comments on the same line as the brace. + if ($tokens[$nextContent]['line'] === $tokens[$closeBrace]['line'] + && ($tokens[$nextContent]['code'] === T_WHITESPACE + || $tokens[$nextContent]['code'] === T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[$nextContent]['code']]) === true) + ) { + continue; + } + + if ($tokens[$nextContent]['code'] !== T_WHITESPACE) { + break; + } + } + + if ($nextContent === $phpcsFile->numTokens) { + // Ignore the line check as this is the very end of the file. + $difference = 1; + } else { + $difference = ($tokens[$nextContent]['line'] - $tokens[$closeBrace]['line'] - 1); + } + + $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), $stackPtr, true); + + if ($difference === -1 + || $tokens[$lastContent]['line'] === $tokens[$closeBrace]['line'] + ) { + $error = 'Closing %s brace must be on a line by itself'; + $data = [$tokens[$stackPtr]['content']]; + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'CloseBraceSameLine', $data); + if ($fix === true) { + if ($difference === -1) { + $phpcsFile->fixer->addNewlineBefore($nextContent); + } + + if ($tokens[$lastContent]['line'] === $tokens[$closeBrace]['line']) { + $phpcsFile->fixer->addNewlineBefore($closeBrace); + } + } + } else if ($tokens[($closeBrace - 1)]['code'] === T_WHITESPACE) { + $prevContent = $tokens[($closeBrace - 1)]['content']; + if ($prevContent !== $phpcsFile->eolChar) { + $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); + $spaces = strlen($blankSpace); + if ($spaces !== 0) { + if ($tokens[($closeBrace - 1)]['line'] !== $tokens[$closeBrace]['line']) { + $error = 'Expected 0 spaces before closing brace; newline found'; + $phpcsFile->addError($error, $closeBrace, 'NewLineBeforeCloseBrace'); + } else { + $error = 'Expected 0 spaces before closing brace; %s found'; + $data = [$spaces]; + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpaceBeforeCloseBrace', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($closeBrace - 1), ''); + } + } + } + } + }//end if + + if ($difference !== -1 && $difference !== 1) { + if ($tokens[$nextContent]['code'] === T_DOC_COMMENT_OPEN_TAG) { + $next = $phpcsFile->findNext(T_WHITESPACE, ($tokens[$nextContent]['comment_closer'] + 1), null, true); + if ($next !== false && $tokens[$next]['code'] === T_FUNCTION) { + return; + } + } + + $error = 'Closing brace of a %s must be followed by a single blank line; found %s'; + $data = [ + $tokens[$stackPtr]['content'], + $difference, + ]; + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'NewlinesAfterCloseBrace', $data); + if ($fix === true) { + if ($difference === 0) { + $first = $phpcsFile->findFirstOnLine([], $nextContent, true); + $phpcsFile->fixer->addNewlineBefore($first); + } else { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($closeBrace + 1); $i < $nextContent; $i++) { + if ($tokens[$i]['line'] <= ($tokens[$closeBrace]['line'] + 1)) { + continue; + } else if ($tokens[$i]['line'] === $tokens[$nextContent]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + }//end processClose() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php new file mode 100644 index 00000000..fc3ec047 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php @@ -0,0 +1,70 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ClassFileNameSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $fullPath = basename($phpcsFile->getFilename()); + $fileName = substr($fullPath, 0, strrpos($fullPath, '.')); + if ($fileName === '') { + // No filename probably means STDIN, so we can't do this check. + return; + } + + $tokens = $phpcsFile->getTokens(); + $decName = $phpcsFile->findNext(T_STRING, $stackPtr); + + if ($tokens[$decName]['content'] !== $fileName) { + $error = '%s name doesn\'t match filename; expected "%s %s"'; + $data = [ + ucfirst($tokens[$stackPtr]['content']), + $tokens[$stackPtr]['content'], + $fileName, + ]; + $phpcsFile->addError($error, $stackPtr, 'NoMatch', $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php new file mode 100644 index 00000000..12d8a245 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php @@ -0,0 +1,84 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DuplicatePropertySniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OBJECT]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being processed. + * @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(); + + $properties = []; + $wantedTokens = [ + T_PROPERTY, + T_OBJECT, + ]; + + $next = $phpcsFile->findNext($wantedTokens, ($stackPtr + 1), $tokens[$stackPtr]['bracket_closer']); + while ($next !== false && $next < $tokens[$stackPtr]['bracket_closer']) { + if ($tokens[$next]['code'] === T_OBJECT) { + // Skip nested objects. + $next = $tokens[$next]['bracket_closer']; + } else { + $propName = $tokens[$next]['content']; + if (isset($properties[$propName]) === true) { + $error = 'Duplicate property definition found for "%s"; previously defined on line %s'; + $data = [ + $propName, + $tokens[$properties[$propName]]['line'], + ]; + $phpcsFile->addError($error, $next, 'Found', $data); + } + + $properties[$propName] = $next; + }//end if + + $next = $phpcsFile->findNext($wantedTokens, ($next + 1), $tokens[$stackPtr]['bracket_closer']); + }//end while + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php new file mode 100644 index 00000000..b9d71db0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php @@ -0,0 +1,73 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class LowercaseClassKeywordsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + $targets = Tokens::$ooScopeTokens; + $targets[] = T_EXTENDS; + $targets[] = T_IMPLEMENTS; + $targets[] = T_ABSTRACT; + $targets[] = T_FINAL; + $targets[] = T_READONLY; + $targets[] = T_VAR; + $targets[] = T_CONST; + + return $targets; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 ($content !== $contentLc) { + $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; + $data = [ + strtoupper($content), + $contentLc, + $content, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php new file mode 100644 index 00000000..4c54aa46 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php @@ -0,0 +1,240 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; +use PHP_CodeSniffer\Util\Tokens; + +class SelfMemberReferenceSniff extends AbstractScopeSniff +{ + + + /** + * Constructs a Squiz_Sniffs_Classes_SelfMemberReferenceSniff. + */ + public function __construct() + { + parent::__construct([T_CLASS], [T_DOUBLE_COLON]); + + }//end __construct() + + + /** + * Processes the function tokens within the class. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * @param int $currScope The current scope opener token. + * + * @return void + */ + protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + // Determine if this is a double colon which needs to be examined. + $conditions = $tokens[$stackPtr]['conditions']; + $conditions = array_reverse($conditions, true); + foreach ($conditions as $conditionToken => $tokenCode) { + if ($tokenCode === T_CLASS || $tokenCode === T_ANON_CLASS || $tokenCode === T_CLOSURE) { + break; + } + } + + if ($conditionToken !== $currScope) { + return; + } + + $calledClassName = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($calledClassName === false) { + // Parse error. + return; + } + + if ($tokens[$calledClassName]['code'] === T_SELF) { + if ($tokens[$calledClassName]['content'] !== 'self') { + $error = 'Must use "self::" for local static member reference; found "%s::"'; + $data = [$tokens[$calledClassName]['content']]; + $fix = $phpcsFile->addFixableError($error, $calledClassName, 'IncorrectCase', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($calledClassName, 'self'); + } + + return; + } + } else if ($tokens[$calledClassName]['code'] === T_STRING) { + // If the class is called with a namespace prefix, build fully qualified + // namespace calls for both current scope class and requested class. + $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($calledClassName - 1), null, true); + if ($prevNonEmpty !== false && $tokens[$prevNonEmpty]['code'] === T_NS_SEPARATOR) { + $declarationName = $this->getDeclarationNameWithNamespace($tokens, $calledClassName); + $declarationName = ltrim($declarationName, '\\'); + $fullQualifiedClassName = $this->getNamespaceOfScope($phpcsFile, $currScope); + if ($fullQualifiedClassName === '\\') { + $fullQualifiedClassName = ''; + } else { + $fullQualifiedClassName .= '\\'; + } + + $fullQualifiedClassName .= $phpcsFile->getDeclarationName($currScope); + } else { + $declarationName = $phpcsFile->getDeclarationName($currScope); + $fullQualifiedClassName = $tokens[$calledClassName]['content']; + } + + if ($declarationName === $fullQualifiedClassName) { + // Class name is the same as the current class, which is not allowed. + $error = 'Must use "self::" for local static member reference'; + $fix = $phpcsFile->addFixableError($error, $calledClassName, 'NotUsed'); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $currentPointer = ($stackPtr - 1); + while ($tokens[$currentPointer]['code'] === T_NS_SEPARATOR + || $tokens[$currentPointer]['code'] === T_STRING + || isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true + ) { + if (isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true) { + --$currentPointer; + continue; + } + + $phpcsFile->fixer->replaceToken($currentPointer, ''); + --$currentPointer; + } + + $phpcsFile->fixer->replaceToken($stackPtr, 'self::'); + $phpcsFile->fixer->endChangeset(); + + // Fix potential whitespace issues in the next loop. + return; + }//end if + }//end if + }//end if + + if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { + $found = $tokens[($stackPtr - 1)]['length']; + $error = 'Expected 0 spaces before double colon; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, ($stackPtr - 1), 'SpaceBefore', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + for ($i = ($stackPtr - 1); $tokens[$i]['code'] === T_WHITESPACE; $i--) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $found = $tokens[($stackPtr + 1)]['length']; + $error = 'Expected 0 spaces after double colon; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, ($stackPtr - 1), 'SpaceAfter', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + for ($i = ($stackPtr + 1); $tokens[$i]['code'] === T_WHITESPACE; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + }//end processTokenWithinScope() + + + /** + * Processes a token that is found within the scope that this test is + * listening to. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position in the stack where this + * token was found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + + }//end processTokenOutsideScope() + + + /** + * Returns the declaration names for classes/interfaces/functions with a namespace. + * + * @param array $tokens Token stack for this file. + * @param int $stackPtr The position where the namespace building will start. + * + * @return string + */ + protected function getDeclarationNameWithNamespace(array $tokens, $stackPtr) + { + $nameParts = []; + $currentPointer = $stackPtr; + while ($tokens[$currentPointer]['code'] === T_NS_SEPARATOR + || $tokens[$currentPointer]['code'] === T_STRING + || isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true + ) { + if (isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true) { + --$currentPointer; + continue; + } + + $nameParts[] = $tokens[$currentPointer]['content']; + --$currentPointer; + } + + $nameParts = array_reverse($nameParts); + return implode('', $nameParts); + + }//end getDeclarationNameWithNamespace() + + + /** + * Returns the namespace declaration of a file. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the search for the + * namespace declaration will start. + * + * @return string + */ + protected function getNamespaceOfScope(File $phpcsFile, $stackPtr) + { + $namespace = '\\'; + $namespaceDeclaration = $phpcsFile->findPrevious(T_NAMESPACE, $stackPtr); + + if ($namespaceDeclaration !== false) { + $endOfNamespaceDeclaration = $phpcsFile->findNext([T_SEMICOLON, T_OPEN_CURLY_BRACKET, T_CLOSE_TAG], $namespaceDeclaration); + $namespace = $this->getDeclarationNameWithNamespace( + $phpcsFile->getTokens(), + ($endOfNamespaceDeclaration - 1) + ); + } + + return $namespace; + + }//end getNamespaceOfScope() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php new file mode 100644 index 00000000..a8975353 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php @@ -0,0 +1,87 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Common; + +class ValidClassNameSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being processed. + * @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(); + + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + $error = 'Possible parse error: %s missing opening or closing brace'; + $data = [$tokens[$stackPtr]['content']]; + $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $data); + return; + } + + // Determine the name of the class or interface. Note that we cannot + // simply look for the first T_STRING because a class name + // starting with the number will be multiple tokens. + $opener = $tokens[$stackPtr]['scope_opener']; + $nameStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), $opener, true); + $nameEnd = $phpcsFile->findNext([T_WHITESPACE, T_COLON], $nameStart, $opener); + if ($nameEnd === false) { + $name = $tokens[$nameStart]['content']; + } else { + $name = trim($phpcsFile->getTokensAsString($nameStart, ($nameEnd - $nameStart))); + } + + // Check for PascalCase format. + $valid = Common::isCamelCaps($name, true, true, false); + if ($valid === false) { + $type = ucfirst($tokens[$stackPtr]['content']); + $error = '%s name "%s" is not in PascalCase format'; + $data = [ + $type, + $name, + ]; + $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); + $phpcsFile->recordMetric($stackPtr, 'PascalCase class name', 'no'); + } else { + $phpcsFile->recordMetric($stackPtr, 'PascalCase class name', 'yes'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php new file mode 100644 index 00000000..9a565123 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php @@ -0,0 +1,401 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 BlockCommentSniff implements Sniff +{ + + /** + * The --tab-width CLI value that is being used. + * + * @var integer + */ + private $tabWidth = null; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_COMMENT, + T_DOC_COMMENT_OPEN_TAG, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current 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) + { + if ($this->tabWidth === null) { + if (isset($phpcsFile->config->tabWidth) === false || $phpcsFile->config->tabWidth === 0) { + // We have no idea how wide tabs are, so assume 4 spaces for fixing. + $this->tabWidth = 4; + } else { + $this->tabWidth = $phpcsFile->config->tabWidth; + } + } + + $tokens = $phpcsFile->getTokens(); + + // If it's an inline comment, return. + if (substr($tokens[$stackPtr]['content'], 0, 2) !== '/*') { + return; + } + + // If this is a function/class/interface doc block comment, skip it. + // We are only interested in inline doc block comments. + if ($tokens[$stackPtr]['code'] === T_DOC_COMMENT_OPEN_TAG) { + $nextToken = $stackPtr; + do { + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextToken + 1), null, true); + if ($tokens[$nextToken]['code'] === T_ATTRIBUTE) { + $nextToken = $tokens[$nextToken]['attribute_closer']; + continue; + } + + break; + } while (true); + + $ignore = [ + T_CLASS => true, + T_INTERFACE => true, + T_TRAIT => true, + T_ENUM => true, + T_FUNCTION => true, + T_PUBLIC => true, + T_PRIVATE => true, + T_FINAL => true, + T_PROTECTED => true, + T_STATIC => true, + T_ABSTRACT => true, + T_CONST => true, + T_VAR => true, + T_READONLY => true, + ]; + if (isset($ignore[$tokens[$nextToken]['code']]) === true) { + return; + } + + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$prevToken]['code'] === T_OPEN_TAG) { + return; + } + + $error = 'Block comments must be started with /*'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStart'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, '/*'); + } + + $end = $tokens[$stackPtr]['comment_closer']; + if ($tokens[$end]['content'] !== '*/') { + $error = 'Block comments must be ended with */'; + $fix = $phpcsFile->addFixableError($error, $end, 'WrongEnd'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($end, '*/'); + } + } + + return; + }//end if + + $commentLines = [$stackPtr]; + $nextComment = $stackPtr; + $lastLine = $tokens[$stackPtr]['line']; + $commentString = $tokens[$stackPtr]['content']; + + // Construct the comment into an array. + while (($nextComment = $phpcsFile->findNext(T_WHITESPACE, ($nextComment + 1), null, true)) !== false) { + if ($tokens[$nextComment]['code'] !== $tokens[$stackPtr]['code'] + && isset(Tokens::$phpcsCommentTokens[$tokens[$nextComment]['code']]) === false + ) { + // Found the next bit of code. + break; + } + + if (($tokens[$nextComment]['line'] - 1) !== $lastLine) { + // Not part of the block. + break; + } + + $lastLine = $tokens[$nextComment]['line']; + $commentLines[] = $nextComment; + $commentString .= $tokens[$nextComment]['content']; + if ($tokens[$nextComment]['code'] === T_DOC_COMMENT_CLOSE_TAG + || substr($tokens[$nextComment]['content'], -2) === '*/' + ) { + break; + } + }//end while + + $commentText = str_replace($phpcsFile->eolChar, '', $commentString); + $commentText = trim($commentText, "/* \t"); + if ($commentText === '') { + $error = 'Empty block comment not allowed'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($stackPtr, ''); + $lastToken = array_pop($commentLines); + for ($i = ($stackPtr + 1); $i <= $lastToken; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + return; + } + + if (count($commentLines) === 1) { + $error = 'Single line block comment not allowed; use inline ("// text") comment instead'; + + // Only fix comments when they are the last token on a line. + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) { + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SingleLine'); + if ($fix === true) { + $comment = '// '.$commentText.$phpcsFile->eolChar; + $phpcsFile->fixer->replaceToken($stackPtr, $comment); + } + } else { + $phpcsFile->addError($error, $stackPtr, 'SingleLine'); + } + + return; + } + + $content = trim($tokens[$stackPtr]['content']); + if ($content !== '/*' && $content !== '/**') { + $error = 'Block comment text must start on a new line'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoNewLine'); + if ($fix === true) { + $indent = ''; + if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { + if (isset($tokens[($stackPtr - 1)]['orig_content']) === true) { + $indent = $tokens[($stackPtr - 1)]['orig_content']; + } else { + $indent = $tokens[($stackPtr - 1)]['content']; + } + } + + $comment = preg_replace( + '/^(\s*\/\*\*?)/', + '$1'.$phpcsFile->eolChar.$indent, + $tokens[$stackPtr]['content'], + 1 + ); + $phpcsFile->fixer->replaceToken($stackPtr, $comment); + } + + return; + }//end if + + $starColumn = $tokens[$stackPtr]['column']; + $hasStars = false; + + // Make sure first line isn't blank. + if (trim($tokens[$commentLines[1]]['content']) === '') { + $error = 'Empty line not allowed at start of comment'; + $fix = $phpcsFile->addFixableError($error, $commentLines[1], 'HasEmptyLine'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($commentLines[1], ''); + } + } else { + // Check indentation of first line. + $content = $tokens[$commentLines[1]]['content']; + $commentText = ltrim($content); + $leadingSpace = (strlen($content) - strlen($commentText)); + + $expected = ($starColumn + 3); + if ($commentText[0] === '*') { + $expected = $starColumn; + $hasStars = true; + } + + if ($leadingSpace !== $expected) { + $expectedTxt = $expected.' space'; + if ($expected !== 1) { + $expectedTxt .= 's'; + } + + $data = [ + $expectedTxt, + $leadingSpace, + ]; + + $error = 'First line of comment not aligned correctly; expected %s but found %s'; + $fix = $phpcsFile->addFixableError($error, $commentLines[1], 'FirstLineIndent', $data); + if ($fix === true) { + if (isset($tokens[$commentLines[1]]['orig_content']) === true + && $tokens[$commentLines[1]]['orig_content'][0] === "\t" + ) { + // Line is indented using tabs. + $padding = str_repeat("\t", floor($expected / $this->tabWidth)); + $padding .= str_repeat(' ', ($expected % $this->tabWidth)); + } else { + $padding = str_repeat(' ', $expected); + } + + $phpcsFile->fixer->replaceToken($commentLines[1], $padding.$commentText); + } + }//end if + + if (preg_match('/^\p{Ll}/u', $commentText) === 1) { + $error = 'Block comments must start with a capital letter'; + $phpcsFile->addError($error, $commentLines[1], 'NoCapital'); + } + }//end if + + // Check that each line of the comment is indented past the star. + foreach ($commentLines as $line) { + // First and last lines (comment opener and closer) are handled separately. + if ($line === $commentLines[(count($commentLines) - 1)] || $line === $commentLines[0]) { + continue; + } + + // First comment line was handled above. + if ($line === $commentLines[1]) { + continue; + } + + // If it's empty, continue. + if (trim($tokens[$line]['content']) === '') { + continue; + } + + $commentText = ltrim($tokens[$line]['content']); + $leadingSpace = (strlen($tokens[$line]['content']) - strlen($commentText)); + + $expected = ($starColumn + 3); + if ($commentText[0] === '*') { + $expected = $starColumn; + $hasStars = true; + } + + if ($leadingSpace < $expected) { + $expectedTxt = $expected.' space'; + if ($expected !== 1) { + $expectedTxt .= 's'; + } + + $data = [ + $expectedTxt, + $leadingSpace, + ]; + + $error = 'Comment line indented incorrectly; expected at least %s but found %s'; + $fix = $phpcsFile->addFixableError($error, $line, 'LineIndent', $data); + if ($fix === true) { + if (isset($tokens[$line]['orig_content']) === true + && $tokens[$line]['orig_content'][0] === "\t" + ) { + // Line is indented using tabs. + $padding = str_repeat("\t", floor($expected / $this->tabWidth)); + $padding .= str_repeat(' ', ($expected % $this->tabWidth)); + } else { + $padding = str_repeat(' ', $expected); + } + + $phpcsFile->fixer->replaceToken($line, $padding.$commentText); + } + }//end if + }//end foreach + + // Finally, test the last line is correct. + $lastIndex = (count($commentLines) - 1); + $content = $tokens[$commentLines[$lastIndex]]['content']; + $commentText = ltrim($content); + if ($commentText !== '*/' && $commentText !== '**/') { + $error = 'Comment closer must be on a new line'; + $phpcsFile->addError($error, $commentLines[$lastIndex], 'CloserSameLine'); + } else { + $leadingSpace = (strlen($content) - strlen($commentText)); + + $expected = ($starColumn - 1); + if ($hasStars === true) { + $expected = $starColumn; + } + + if ($leadingSpace !== $expected) { + $expectedTxt = $expected.' space'; + if ($expected !== 1) { + $expectedTxt .= 's'; + } + + $data = [ + $expectedTxt, + $leadingSpace, + ]; + + $error = 'Last line of comment aligned incorrectly; expected %s but found %s'; + $fix = $phpcsFile->addFixableError($error, $commentLines[$lastIndex], 'LastLineIndent', $data); + if ($fix === true) { + if (isset($tokens[$line]['orig_content']) === true + && $tokens[$line]['orig_content'][0] === "\t" + ) { + // Line is indented using tabs. + $padding = str_repeat("\t", floor($expected / $this->tabWidth)); + $padding .= str_repeat(' ', ($expected % $this->tabWidth)); + } else { + $padding = str_repeat(' ', $expected); + } + + $phpcsFile->fixer->replaceToken($commentLines[$lastIndex], $padding.$commentText); + } + }//end if + }//end if + + // Check that the lines before and after this comment are blank. + $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ((isset($tokens[$contentBefore]['scope_closer']) === true + && $tokens[$contentBefore]['scope_opener'] === $contentBefore) + || $tokens[$contentBefore]['code'] === T_OPEN_TAG + || $tokens[$contentBefore]['code'] === T_OPEN_TAG_WITH_ECHO + ) { + if (($tokens[$stackPtr]['line'] - $tokens[$contentBefore]['line']) !== 1) { + $error = 'Empty line not required before block comment'; + $phpcsFile->addError($error, $stackPtr, 'HasEmptyLineBefore'); + } + } else { + if (($tokens[$stackPtr]['line'] - $tokens[$contentBefore]['line']) < 2) { + $error = 'Empty line required before block comment'; + $phpcsFile->addError($error, $stackPtr, 'NoEmptyLineBefore'); + } + } + + $commentCloser = $commentLines[$lastIndex]; + $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($commentCloser + 1), null, true); + if ($contentAfter !== false && ($tokens[$contentAfter]['line'] - $tokens[$commentCloser]['line']) < 2) { + $error = 'Empty line required after block comment'; + $phpcsFile->addError($error, $commentCloser, 'NoEmptyLineAfter'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php new file mode 100644 index 00000000..60d553fc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php @@ -0,0 +1,109 @@ + + *
  • A class doc comment exists.
  • + *
  • The comment uses the correct docblock style.
  • + *
  • There are no blank lines after the class comment.
  • + *
  • No tags are used in the docblock.
  • + * + * + * @author Greg Sherwood + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class ClassCommentSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_CLASS]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $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--) { + if (isset($find[$tokens[$commentEnd]['code']]) === true) { + continue; + } + + if ($previousContent === null) { + $previousContent = $commentEnd; + } + + if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END + && isset($tokens[$commentEnd]['attribute_opener']) === true + ) { + $commentEnd = $tokens[$commentEnd]['attribute_opener']; + continue; + } + + break; + } + + if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG + && $tokens[$commentEnd]['code'] !== T_COMMENT + ) { + $class = $phpcsFile->getDeclarationName($stackPtr); + $phpcsFile->addError('Missing doc comment for class %s', $stackPtr, 'Missing', [$class]); + $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no'); + return; + } + + $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes'); + + if ($tokens[$commentEnd]['code'] === T_COMMENT) { + $phpcsFile->addError('You must use "/**" style comments for a class comment', $stackPtr, 'WrongStyle'); + return; + } + + if ($tokens[$previousContent]['line'] !== ($tokens[$stackPtr]['line'] - 1)) { + $error = 'There must be no blank lines after the class comment'; + $phpcsFile->addError($error, $commentEnd, 'SpacingAfter'); + } + + $commentStart = $tokens[$commentEnd]['comment_opener']; + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + $error = '%s tag is not allowed in class comment'; + $data = [$tokens[$tag]['content']]; + $phpcsFile->addWarning($error, $tag, 'TagNotAllowed', $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php new file mode 100644 index 00000000..44bd4388 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php @@ -0,0 +1,130 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class ClosingDeclarationCommentSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CLASS, + T_ENUM, + T_FUNCTION, + T_INTERFACE, + T_TRAIT, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if ($tokens[$stackPtr]['code'] === T_FUNCTION) { + $methodProps = $phpcsFile->getMethodProperties($stackPtr); + + // Abstract methods do not require a closing comment. + if ($methodProps['is_abstract'] === true) { + return; + } + + // If this function is in an interface then we don't require + // a closing comment. + if ($phpcsFile->hasCondition($stackPtr, T_INTERFACE) === true) { + return; + } + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + $error = 'Possible parse error: non-abstract method defined as abstract'; + $phpcsFile->addWarning($error, $stackPtr, 'Abstract'); + return; + } + + $decName = $phpcsFile->getDeclarationName($stackPtr); + $comment = '//end '.$decName.'()'; + } else if ($tokens[$stackPtr]['code'] === T_CLASS) { + $comment = '//end class'; + } else if ($tokens[$stackPtr]['code'] === T_INTERFACE) { + $comment = '//end interface'; + } else if ($tokens[$stackPtr]['code'] === T_TRAIT) { + $comment = '//end trait'; + } else { + $comment = '//end enum'; + }//end if + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + $error = 'Possible parse error: %s missing opening or closing brace'; + $data = [$tokens[$stackPtr]['content']]; + $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $data); + return; + } + + $closingBracket = $tokens[$stackPtr]['scope_closer']; + + $data = [$comment]; + if (isset($tokens[($closingBracket + 1)]) === false || $tokens[($closingBracket + 1)]['code'] !== T_COMMENT) { + $next = $phpcsFile->findNext(T_WHITESPACE, ($closingBracket + 1), null, true); + if ($next !== false && rtrim($tokens[$next]['content']) === $comment) { + // The comment isn't really missing; it is just in the wrong place. + $fix = $phpcsFile->addFixableError('Expected %s directly after closing brace', $closingBracket, 'Misplaced', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($closingBracket + 1); $i < $next; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + // Just in case, because indentation fixes can add indents onto + // these comments and cause us to be unable to fix them. + $phpcsFile->fixer->replaceToken($next, $comment.$phpcsFile->eolChar); + $phpcsFile->fixer->endChangeset(); + } + } else { + $fix = $phpcsFile->addFixableError('Expected %s', $closingBracket, 'Missing', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($closingBracket, '}'.$comment); + } + } + + return; + }//end if + + if (rtrim($tokens[($closingBracket + 1)]['content']) !== $comment) { + $fix = $phpcsFile->addFixableError('Expected %s', $closingBracket, 'Incorrect', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($closingBracket + 1), $comment.$phpcsFile->eolChar); + } + + return; + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php new file mode 100644 index 00000000..453ff89c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php @@ -0,0 +1,167 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 DocCommentAlignmentSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_DOC_COMMENT_OPEN_TAG]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // We are only interested in function/class/interface doc block comments. + $ignore = Tokens::$emptyTokens; + if ($phpcsFile->tokenizerType === 'JS') { + $ignore[] = T_EQUAL; + $ignore[] = T_STRING; + $ignore[] = T_OBJECT_OPERATOR; + } + + $nextToken = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); + $ignore = [ + T_CLASS => true, + T_INTERFACE => true, + T_ENUM => true, + T_ENUM_CASE => true, + T_FUNCTION => true, + T_PUBLIC => true, + T_PRIVATE => true, + T_PROTECTED => true, + T_STATIC => true, + T_ABSTRACT => true, + T_PROPERTY => true, + T_OBJECT => true, + T_PROTOTYPE => true, + T_VAR => true, + T_READONLY => true, + ]; + + if ($nextToken === false || isset($ignore[$tokens[$nextToken]['code']]) === false) { + // Could be a file comment. + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$prevToken]['code'] !== T_OPEN_TAG) { + return; + } + } + + // There must be one space after each star (unless it is an empty comment line) + // and all the stars must be aligned correctly. + $requiredColumn = ($tokens[$stackPtr]['column'] + 1); + $endComment = $tokens[$stackPtr]['comment_closer']; + for ($i = ($stackPtr + 1); $i <= $endComment; $i++) { + if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR + && $tokens[$i]['code'] !== T_DOC_COMMENT_CLOSE_TAG + ) { + continue; + } + + if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { + if (trim($tokens[$i]['content']) === '') { + // Don't process an unfinished docblock close tag during live coding. + continue; + } + + // Can't process the close tag if it is not the first thing on the line. + $prev = $phpcsFile->findPrevious(T_DOC_COMMENT_WHITESPACE, ($i - 1), $stackPtr, true); + if ($tokens[$prev]['line'] === $tokens[$i]['line']) { + continue; + } + } + + if ($tokens[$i]['column'] !== $requiredColumn) { + $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); + if ($fix === true) { + $padding = str_repeat(' ', ($requiredColumn - 1)); + if ($tokens[$i]['column'] === 1) { + $phpcsFile->fixer->addContentBefore($i, $padding); + } else { + $phpcsFile->fixer->replaceToken(($i - 1), $padding); + } + } + }//end if + + if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR) { + continue; + } + + if ($tokens[($i + 2)]['line'] !== $tokens[$i]['line']) { + // Line is empty. + continue; + } + + if ($tokens[($i + 1)]['code'] !== T_DOC_COMMENT_WHITESPACE) { + $error = 'Expected 1 space after asterisk; 0 found'; + $fix = $phpcsFile->addFixableError($error, $i, 'NoSpaceAfterStar'); + if ($fix === true) { + $phpcsFile->fixer->addContent($i, ' '); + } + } else if ($tokens[($i + 2)]['code'] === T_DOC_COMMENT_TAG + && $tokens[($i + 1)]['content'] !== ' ' + ) { + $error = 'Expected 1 space after asterisk; %s found'; + $data = [$tokens[($i + 1)]['length']]; + $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterStar', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($i + 1), ' '); + } + } + }//end for + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php new file mode 100644 index 00000000..301537fe --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php @@ -0,0 +1,55 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class EmptyCatchCommentSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_CATCH]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. + * @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(); + + $scopeStart = $tokens[$stackPtr]['scope_opener']; + $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($scopeStart + 1), $tokens[$stackPtr]['scope_closer'], true); + + if ($firstContent === false) { + $error = 'Empty CATCH statement must have a comment to explain why the exception is not handled'; + $phpcsFile->addError($error, $scopeStart, 'Missing'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php new file mode 100644 index 00000000..cfff91fc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php @@ -0,0 +1,228 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class FileCommentSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + + if ($tokens[$commentStart]['code'] === T_COMMENT) { + $phpcsFile->addError('You must use "/**" style comments for a file comment', $commentStart, 'WrongStyle'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); + return $phpcsFile->numTokens; + } else if ($commentStart === false || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG) { + $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); + return $phpcsFile->numTokens; + } + + if (isset($tokens[$commentStart]['comment_closer']) === false + || ($tokens[$tokens[$commentStart]['comment_closer']]['content'] === '' + && $tokens[$commentStart]['comment_closer'] === ($phpcsFile->numTokens - 1)) + ) { + // Don't process an unfinished file comment during live coding. + return $phpcsFile->numTokens; + } + + $commentEnd = $tokens[$commentStart]['comment_closer']; + + for ($nextToken = ($commentEnd + 1); $nextToken < $phpcsFile->numTokens; $nextToken++) { + if ($tokens[$nextToken]['code'] === T_WHITESPACE) { + continue; + } + + if ($tokens[$nextToken]['code'] === T_ATTRIBUTE + && isset($tokens[$nextToken]['attribute_closer']) === true + ) { + $nextToken = $tokens[$nextToken]['attribute_closer']; + continue; + } + + break; + } + + if ($nextToken === $phpcsFile->numTokens) { + $nextToken--; + } + + $ignore = [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + T_FUNCTION, + T_CLOSURE, + T_PUBLIC, + T_PRIVATE, + T_PROTECTED, + T_FINAL, + T_STATIC, + T_ABSTRACT, + T_READONLY, + T_CONST, + T_PROPERTY, + T_INCLUDE, + T_INCLUDE_ONCE, + T_REQUIRE, + T_REQUIRE_ONCE, + ]; + + if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { + $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); + return $phpcsFile->numTokens; + } + + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); + + // No blank line between the open tag and the file comment. + if ($tokens[$commentStart]['line'] > ($tokens[$stackPtr]['line'] + 1)) { + $error = 'There must be no blank lines before the file comment'; + $phpcsFile->addError($error, $stackPtr, 'SpacingAfterOpen'); + } + + // Exactly one blank line after the file comment. + $next = $phpcsFile->findNext(T_WHITESPACE, ($commentEnd + 1), null, true); + if ($next !== false && $tokens[$next]['line'] !== ($tokens[$commentEnd]['line'] + 2)) { + $error = 'There must be exactly one blank line after the file comment'; + $phpcsFile->addError($error, $commentEnd, 'SpacingAfterComment'); + } + + // Required tags in correct order. + $required = [ + '@package' => true, + '@subpackage' => true, + '@author' => true, + '@copyright' => true, + ]; + + $foundTags = []; + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + $name = $tokens[$tag]['content']; + $isRequired = isset($required[$name]); + + if ($isRequired === true && in_array($name, $foundTags, true) === true) { + $error = 'Only one %s tag is allowed in a file comment'; + $data = [$name]; + $phpcsFile->addError($error, $tag, 'Duplicate'.ucfirst(substr($name, 1)).'Tag', $data); + } + + $foundTags[] = $name; + + if ($isRequired === false) { + continue; + } + + $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); + if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { + $error = 'Content missing for %s tag in file comment'; + $data = [$name]; + $phpcsFile->addError($error, $tag, 'Empty'.ucfirst(substr($name, 1)).'Tag', $data); + continue; + } + + if ($name === '@author') { + if ($tokens[$string]['content'] !== 'Squiz Pty Ltd ') { + $error = 'Expected "Squiz Pty Ltd " for author tag'; + $fix = $phpcsFile->addFixableError($error, $tag, 'IncorrectAuthor'); + if ($fix === true) { + $expected = 'Squiz Pty Ltd '; + $phpcsFile->fixer->replaceToken($string, $expected); + } + } + } else if ($name === '@copyright') { + if (preg_match('/^([0-9]{4})(-[0-9]{4})? (Squiz Pty Ltd \(ABN 77 084 670 600\))$/', $tokens[$string]['content']) === 0) { + $error = 'Expected "xxxx-xxxx Squiz Pty Ltd (ABN 77 084 670 600)" for copyright declaration'; + $fix = $phpcsFile->addFixableError($error, $tag, 'IncorrectCopyright'); + if ($fix === true) { + $matches = []; + preg_match('/^(([0-9]{4})(-[0-9]{4})?)?.*$/', $tokens[$string]['content'], $matches); + if (isset($matches[1]) === false) { + $matches[1] = date('Y'); + } + + $expected = $matches[1].' Squiz Pty Ltd (ABN 77 084 670 600)'; + $phpcsFile->fixer->replaceToken($string, $expected); + } + } + }//end if + }//end foreach + + // Check if the tags are in the correct position. + $pos = 0; + foreach ($required as $tag => $true) { + if (in_array($tag, $foundTags, true) === false) { + $error = 'Missing %s tag in file comment'; + $data = [$tag]; + $phpcsFile->addError($error, $commentEnd, 'Missing'.ucfirst(substr($tag, 1)).'Tag', $data); + } + + if (isset($foundTags[$pos]) === false) { + break; + } + + if ($foundTags[$pos] !== $tag) { + $error = 'The tag in position %s should be the %s tag'; + $data = [ + ($pos + 1), + $tag, + ]; + $phpcsFile->addError($error, $tokens[$commentStart]['comment_tags'][$pos], ucfirst(substr($tag, 1)).'TagOrder', $data); + } + + $pos++; + }//end foreach + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php new file mode 100644 index 00000000..b0b7cafb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php @@ -0,0 +1,800 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff as PEARFunctionCommentSniff; +use PHP_CodeSniffer\Util\Common; + +class FunctionCommentSniff extends PEARFunctionCommentSniff +{ + + /** + * Whether to skip inheritdoc comments. + * + * @var boolean + */ + public $skipIfInheritdoc = false; + + /** + * The current PHP version. + * + * @var integer|string|null + */ + private $phpVersion = null; + + + /** + * Process the return comment of this function comment. + * + * @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 $commentStart The position in the stack where the comment started. + * + * @return void + */ + protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) + { + $tokens = $phpcsFile->getTokens(); + $return = null; + + if ($this->skipIfInheritdoc === true) { + if ($this->checkInheritdoc($phpcsFile, $stackPtr, $commentStart) === true) { + return; + } + } + + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + if ($tokens[$tag]['content'] === '@return') { + if ($return !== null) { + $error = 'Only 1 @return tag is allowed in a function comment'; + $phpcsFile->addError($error, $tag, 'DuplicateReturn'); + return; + } + + $return = $tag; + } + } + + // Skip constructor and destructor. + $methodName = $phpcsFile->getDeclarationName($stackPtr); + $isSpecialMethod = in_array($methodName, $this->specialMethods, true); + + if ($return !== null) { + $content = $tokens[($return + 2)]['content']; + if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) { + $error = 'Return type missing for @return tag in function comment'; + $phpcsFile->addError($error, $return, 'MissingReturnType'); + } else { + // Support both a return type and a description. + preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $content, $returnParts); + if (isset($returnParts[1]) === false) { + return; + } + + $returnType = $returnParts[1]; + + // Check return type (can be multiple, separated by '|'). + $typeNames = explode('|', $returnType); + $suggestedNames = []; + foreach ($typeNames as $typeName) { + $suggestedName = Common::suggestType($typeName); + if (in_array($suggestedName, $suggestedNames, true) === false) { + $suggestedNames[] = $suggestedName; + } + } + + $suggestedType = implode('|', $suggestedNames); + if ($returnType !== $suggestedType) { + $error = 'Expected "%s" but found "%s" for function return type'; + $data = [ + $suggestedType, + $returnType, + ]; + $fix = $phpcsFile->addFixableError($error, $return, 'InvalidReturn', $data); + if ($fix === true) { + $replacement = $suggestedType; + if (empty($returnParts[2]) === false) { + $replacement .= $returnParts[2]; + } + + $phpcsFile->fixer->replaceToken(($return + 2), $replacement); + unset($replacement); + } + } + + // If the return type is void, make sure there is + // no return statement in the function. + if ($returnType === 'void') { + if (isset($tokens[$stackPtr]['scope_closer']) === true) { + $endToken = $tokens[$stackPtr]['scope_closer']; + for ($returnToken = $stackPtr; $returnToken < $endToken; $returnToken++) { + if ($tokens[$returnToken]['code'] === T_CLOSURE + || $tokens[$returnToken]['code'] === T_ANON_CLASS + ) { + $returnToken = $tokens[$returnToken]['scope_closer']; + continue; + } + + if ($tokens[$returnToken]['code'] === T_RETURN + || $tokens[$returnToken]['code'] === T_YIELD + || $tokens[$returnToken]['code'] === T_YIELD_FROM + ) { + break; + } + } + + if ($returnToken !== $endToken) { + // If the function is not returning anything, just + // exiting, then there is no problem. + $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true); + if ($tokens[$semicolon]['code'] !== T_SEMICOLON) { + $error = 'Function return type is void, but function contains return statement'; + $phpcsFile->addError($error, $return, 'InvalidReturnVoid'); + } + } + }//end if + } 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++) { + if ($tokens[$returnToken]['code'] === T_CLOSURE + || $tokens[$returnToken]['code'] === T_ANON_CLASS + ) { + $returnToken = $tokens[$returnToken]['scope_closer']; + continue; + } + + if ($tokens[$returnToken]['code'] === T_RETURN + || $tokens[$returnToken]['code'] === T_YIELD + || $tokens[$returnToken]['code'] === T_YIELD_FROM + ) { + break; + } + } + + if ($returnToken === $endToken) { + $error = 'Function return type is not void, but function has no return statement'; + $phpcsFile->addError($error, $return, 'InvalidNoReturn'); + } else { + $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true); + if ($tokens[$semicolon]['code'] === T_SEMICOLON) { + $error = 'Function return type is not void, but function is returning void here'; + $phpcsFile->addError($error, $returnToken, 'InvalidReturnNotVoid'); + } + } + }//end if + }//end if + }//end if + } else { + if ($isSpecialMethod === true) { + return; + } + + $error = 'Missing @return tag in function comment'; + $phpcsFile->addError($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn'); + }//end if + + }//end processReturn() + + + /** + * Process any throw tags that this function comment has. + * + * @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 $commentStart The position in the stack where the comment started. + * + * @return void + */ + protected function processThrows(File $phpcsFile, $stackPtr, $commentStart) + { + $tokens = $phpcsFile->getTokens(); + + if ($this->skipIfInheritdoc === true) { + if ($this->checkInheritdoc($phpcsFile, $stackPtr, $commentStart) === true) { + return; + } + } + + foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { + if ($tokens[$tag]['content'] !== '@throws') { + continue; + } + + $exception = null; + $comment = null; + if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { + $matches = []; + preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches); + $exception = $matches[1]; + if (isset($matches[2]) === true && trim($matches[2]) !== '') { + $comment = $matches[2]; + } + } + + if ($exception === null) { + $error = 'Exception type and comment missing for @throws tag in function comment'; + $phpcsFile->addError($error, $tag, 'InvalidThrows'); + } else if ($comment === null) { + $error = 'Comment missing for @throws tag in function comment'; + $phpcsFile->addError($error, $tag, 'EmptyThrows'); + } else { + // Any strings until the next tag belong to this comment. + if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { + $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; + } else { + $end = $tokens[$commentStart]['comment_closer']; + } + + for ($i = ($tag + 3); $i < $end; $i++) { + if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { + $comment .= ' '.$tokens[$i]['content']; + } + } + + $comment = trim($comment); + + // Starts with a capital letter and ends with a fullstop. + $firstChar = $comment[0]; + if (strtoupper($firstChar) !== $firstChar) { + $error = '@throws tag comment must start with a capital letter'; + $phpcsFile->addError($error, ($tag + 2), 'ThrowsNotCapital'); + } + + $lastChar = substr($comment, -1); + if ($lastChar !== '.') { + $error = '@throws tag comment must end with a full stop'; + $phpcsFile->addError($error, ($tag + 2), 'ThrowsNoFullStop'); + } + }//end if + }//end foreach + + }//end processThrows() + + + /** + * Process the function parameter comments. + * + * @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 $commentStart The position in the stack where the comment started. + * + * @return void + */ + protected function processParams(File $phpcsFile, $stackPtr, $commentStart) + { + if ($this->phpVersion === null) { + $this->phpVersion = Config::getConfigData('php_version'); + if ($this->phpVersion === null) { + $this->phpVersion = PHP_VERSION_ID; + } + } + + $tokens = $phpcsFile->getTokens(); + + if ($this->skipIfInheritdoc === true) { + if ($this->checkInheritdoc($phpcsFile, $stackPtr, $commentStart) === true) { + return; + } + } + + $params = []; + $maxType = 0; + $maxVar = 0; + foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { + if ($tokens[$tag]['content'] !== '@param') { + continue; + } + + $type = ''; + $typeSpace = 0; + $var = ''; + $varSpace = 0; + $comment = ''; + $commentLines = []; + if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { + $matches = []; + preg_match('/([^$&.]+)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches); + + if (empty($matches) === false) { + $typeLen = strlen($matches[1]); + $type = trim($matches[1]); + $typeSpace = ($typeLen - strlen($type)); + $typeLen = strlen($type); + if ($typeLen > $maxType) { + $maxType = $typeLen; + } + } + + if (isset($matches[2]) === true) { + $var = $matches[2]; + $varLen = strlen($var); + if ($varLen > $maxVar) { + $maxVar = $varLen; + } + + if (isset($matches[4]) === true) { + $varSpace = strlen($matches[3]); + $comment = $matches[4]; + $commentLines[] = [ + 'comment' => $comment, + 'token' => ($tag + 2), + 'indent' => $varSpace, + ]; + + // Any strings until the next tag belong to this comment. + if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { + $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; + } else { + $end = $tokens[$commentStart]['comment_closer']; + } + + for ($i = ($tag + 3); $i < $end; $i++) { + if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { + $indent = 0; + if ($tokens[($i - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { + $indent = $tokens[($i - 1)]['length']; + } + + $comment .= ' '.$tokens[$i]['content']; + $commentLines[] = [ + 'comment' => $tokens[$i]['content'], + 'token' => $i, + 'indent' => $indent, + ]; + } + } + } else { + $error = 'Missing parameter comment'; + $phpcsFile->addError($error, $tag, 'MissingParamComment'); + $commentLines[] = ['comment' => '']; + }//end if + } else if ($tokens[($tag + 2)]['content'][0] === '$') { + $error = 'Missing parameter type'; + $phpcsFile->addError($error, $tag, 'MissingParamType'); + } else { + $error = 'Missing parameter name'; + $phpcsFile->addError($error, $tag, 'MissingParamName'); + }//end if + } else { + $error = 'Missing parameter type'; + $phpcsFile->addError($error, $tag, 'MissingParamType'); + }//end if + + $params[] = [ + 'tag' => $tag, + 'type' => $type, + 'var' => $var, + 'comment' => $comment, + 'commentLines' => $commentLines, + 'type_space' => $typeSpace, + 'var_space' => $varSpace, + ]; + }//end foreach + + $realParams = $phpcsFile->getMethodParameters($stackPtr); + $foundParams = []; + + // We want to use ... for all variable length arguments, so added + // this prefix to the variable name so comparisons are easier. + foreach ($realParams as $pos => $param) { + if ($param['variable_length'] === true) { + $realParams[$pos]['name'] = '...'.$realParams[$pos]['name']; + } + } + + foreach ($params as $pos => $param) { + // If the type is empty, the whole line is empty. + if ($param['type'] === '') { + continue; + } + + // Check the param type value. + $typeNames = explode('|', $param['type']); + $suggestedTypeNames = []; + + foreach ($typeNames as $typeName) { + if ($typeName === '') { + continue; + } + + // Strip nullable operator. + if ($typeName[0] === '?') { + $typeName = substr($typeName, 1); + } + + $suggestedName = Common::suggestType($typeName); + $suggestedTypeNames[] = $suggestedName; + + if (count($typeNames) > 1) { + continue; + } + + // Check type hint for array and custom type. + $suggestedTypeHint = ''; + if (strpos($suggestedName, 'array') !== false || substr($suggestedName, -2) === '[]') { + $suggestedTypeHint = 'array'; + } else if (strpos($suggestedName, 'callable') !== false) { + $suggestedTypeHint = 'callable'; + } else if (strpos($suggestedName, 'callback') !== false) { + $suggestedTypeHint = 'callable'; + } else if (in_array($suggestedName, Common::$allowedTypes, true) === false) { + $suggestedTypeHint = $suggestedName; + } + + if ($this->phpVersion >= 70000) { + if ($suggestedName === 'string') { + $suggestedTypeHint = 'string'; + } else if ($suggestedName === 'int' || $suggestedName === 'integer') { + $suggestedTypeHint = 'int'; + } else if ($suggestedName === 'float') { + $suggestedTypeHint = 'float'; + } else if ($suggestedName === 'bool' || $suggestedName === 'boolean') { + $suggestedTypeHint = 'bool'; + } + } + + if ($this->phpVersion >= 70200) { + if ($suggestedName === 'object') { + $suggestedTypeHint = 'object'; + } + } + + if ($this->phpVersion >= 80000) { + if ($suggestedName === 'mixed') { + $suggestedTypeHint = 'mixed'; + } + } + + if ($suggestedTypeHint !== '' && isset($realParams[$pos]) === true && $param['var'] !== '') { + $typeHint = $realParams[$pos]['type_hint']; + + // Remove namespace prefixes when comparing. + $compareTypeHint = substr($suggestedTypeHint, (strlen($typeHint) * -1)); + + if ($typeHint === '') { + $error = 'Type hint "%s" missing for %s'; + $data = [ + $suggestedTypeHint, + $param['var'], + ]; + + $errorCode = 'TypeHintMissing'; + if ($suggestedTypeHint === 'string' + || $suggestedTypeHint === 'int' + || $suggestedTypeHint === 'float' + || $suggestedTypeHint === 'bool' + ) { + $errorCode = 'Scalar'.$errorCode; + } + + $phpcsFile->addError($error, $stackPtr, $errorCode, $data); + } else if ($typeHint !== $compareTypeHint && $typeHint !== '?'.$compareTypeHint) { + $error = 'Expected type hint "%s"; found "%s" for %s'; + $data = [ + $suggestedTypeHint, + $typeHint, + $param['var'], + ]; + $phpcsFile->addError($error, $stackPtr, 'IncorrectTypeHint', $data); + }//end if + } else if ($suggestedTypeHint === '' && isset($realParams[$pos]) === true) { + $typeHint = $realParams[$pos]['type_hint']; + if ($typeHint !== '') { + $error = 'Unknown type hint "%s" found for %s'; + $data = [ + $typeHint, + $param['var'], + ]; + $phpcsFile->addError($error, $stackPtr, 'InvalidTypeHint', $data); + } + }//end if + }//end foreach + + $suggestedType = implode('|', $suggestedTypeNames); + if ($param['type'] !== $suggestedType) { + $error = 'Expected "%s" but found "%s" for parameter type'; + $data = [ + $suggestedType, + $param['type'], + ]; + + $fix = $phpcsFile->addFixableError($error, $param['tag'], 'IncorrectParamVarName', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $content = $suggestedType; + $content .= str_repeat(' ', $param['type_space']); + $content .= $param['var']; + $content .= str_repeat(' ', $param['var_space']); + if (isset($param['commentLines'][0]) === true) { + $content .= $param['commentLines'][0]['comment']; + } + + $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); + + // Fix up the indent of additional comment lines. + foreach ($param['commentLines'] as $lineNum => $line) { + if ($lineNum === 0 + || $param['commentLines'][$lineNum]['indent'] === 0 + ) { + continue; + } + + $diff = (strlen($param['type']) - strlen($suggestedType)); + $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff); + $phpcsFile->fixer->replaceToken( + ($param['commentLines'][$lineNum]['token'] - 1), + str_repeat(' ', $newIndent) + ); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + + if ($param['var'] === '') { + continue; + } + + $foundParams[] = $param['var']; + + // Check number of spaces after the type. + $this->checkSpacingAfterParamType($phpcsFile, $param, $maxType); + + // Make sure the param name is correct. + if (isset($realParams[$pos]) === true) { + $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 = [ + $paramVarName, + $realName, + ]; + + $error = 'Doc comment for parameter %s does not match '; + if (strtolower($paramVarName) === strtolower($realName)) { + $error .= 'case of '; + $code = 'ParamNameNoCaseMatch'; + } + + $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'; + $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment'); + }//end if + + if ($param['comment'] === '') { + continue; + } + + // Check number of spaces after the var name. + $this->checkSpacingAfterParamName($phpcsFile, $param, $maxVar); + + // Param comments must start with a capital letter and end with a full stop. + if (preg_match('/^(\p{Ll}|\P{L})/u', $param['comment']) === 1) { + $error = 'Parameter comment must start with a capital letter'; + $phpcsFile->addError($error, $param['tag'], 'ParamCommentNotCapital'); + } + + $lastChar = substr($param['comment'], -1); + if ($lastChar !== '.') { + $error = 'Parameter comment must end with a full stop'; + $phpcsFile->addError($error, $param['tag'], 'ParamCommentFullStop'); + } + }//end foreach + + $realNames = []; + foreach ($realParams as $realParam) { + $realNames[] = $realParam['name']; + } + + // Report missing comments. + $diff = array_diff($realNames, $foundParams); + foreach ($diff as $neededParam) { + $error = 'Doc comment for parameter "%s" missing'; + $data = [$neededParam]; + $phpcsFile->addError($error, $commentStart, 'MissingParamTag', $data); + } + + }//end processParams() + + + /** + * Check the spacing after the type of a parameter. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $param The parameter to be checked. + * @param int $maxType The maxlength of the longest parameter type. + * @param int $spacing The number of spaces to add after the type. + * + * @return void + */ + protected function checkSpacingAfterParamType(File $phpcsFile, $param, $maxType, $spacing=1) + { + // Check number of spaces after the type. + $spaces = ($maxType - strlen($param['type']) + $spacing); + if ($param['type_space'] !== $spaces) { + $error = 'Expected %s spaces after parameter type; %s found'; + $data = [ + $spaces, + $param['type_space'], + ]; + + $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamType', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $content = $param['type']; + $content .= str_repeat(' ', $spaces); + $content .= $param['var']; + $content .= str_repeat(' ', $param['var_space']); + $content .= $param['commentLines'][0]['comment']; + $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); + + // Fix up the indent of additional comment lines. + $diff = ($param['type_space'] - $spaces); + foreach ($param['commentLines'] as $lineNum => $line) { + if ($lineNum === 0 + || $param['commentLines'][$lineNum]['indent'] === 0 + ) { + continue; + } + + $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff); + if ($newIndent <= 0) { + continue; + } + + $phpcsFile->fixer->replaceToken( + ($param['commentLines'][$lineNum]['token'] - 1), + str_repeat(' ', $newIndent) + ); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + + }//end checkSpacingAfterParamType() + + + /** + * Check the spacing after the name of a parameter. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param array $param The parameter to be checked. + * @param int $maxVar The maxlength of the longest parameter name. + * @param int $spacing The number of spaces to add after the type. + * + * @return void + */ + protected function checkSpacingAfterParamName(File $phpcsFile, $param, $maxVar, $spacing=1) + { + // Check number of spaces after the var name. + $spaces = ($maxVar - strlen($param['var']) + $spacing); + if ($param['var_space'] !== $spaces) { + $error = 'Expected %s spaces after parameter name; %s found'; + $data = [ + $spaces, + $param['var_space'], + ]; + + $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamName', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + + $content = $param['type']; + $content .= str_repeat(' ', $param['type_space']); + $content .= $param['var']; + $content .= str_repeat(' ', $spaces); + $content .= $param['commentLines'][0]['comment']; + $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); + + // Fix up the indent of additional comment lines. + foreach ($param['commentLines'] as $lineNum => $line) { + if ($lineNum === 0 + || $param['commentLines'][$lineNum]['indent'] === 0 + ) { + continue; + } + + $diff = ($param['var_space'] - $spaces); + $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff); + if ($newIndent <= 0) { + continue; + } + + $phpcsFile->fixer->replaceToken( + ($param['commentLines'][$lineNum]['token'] - 1), + str_repeat(' ', $newIndent) + ); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + + }//end checkSpacingAfterParamName() + + + /** + * Determines whether the whole comment is an inheritdoc comment. + * + * @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 $commentStart The position in the stack where the comment started. + * + * @return boolean TRUE if the docblock contains only {@inheritdoc} (case-insensitive). + */ + protected function checkInheritdoc(File $phpcsFile, $stackPtr, $commentStart) + { + $tokens = $phpcsFile->getTokens(); + + $allowedTokens = [ + T_DOC_COMMENT_OPEN_TAG, + T_DOC_COMMENT_WHITESPACE, + T_DOC_COMMENT_STAR, + ]; + for ($i = $commentStart; $i <= $tokens[$commentStart]['comment_closer']; $i++) { + if (in_array($tokens[$i]['code'], $allowedTokens) === false) { + $trimmedContent = strtolower(trim($tokens[$i]['content'])); + + if ($trimmedContent === '{@inheritdoc}') { + return true; + } else { + return false; + } + } + } + + return false; + + }//end checkInheritdoc() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php new file mode 100644 index 00000000..4fb332cf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php @@ -0,0 +1,233 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 FunctionCommentThrowTagSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + // Abstract or incomplete. + return; + } + + $find = Tokens::$methodPrefixes; + $find[] = T_WHITESPACE; + + $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); + if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG) { + // Function doesn't have a doc comment or is using the wrong type of comment. + return; + } + + $stackPtrEnd = $tokens[$stackPtr]['scope_closer']; + + // Find all the exception type tokens within the current scope. + $thrownExceptions = []; + $currPos = $stackPtr; + $foundThrows = false; + $unknownCount = 0; + do { + $currPos = $phpcsFile->findNext([T_THROW, T_ANON_CLASS, T_CLOSURE], ($currPos + 1), $stackPtrEnd); + if ($currPos === false) { + break; + } + + if ($tokens[$currPos]['code'] !== T_THROW) { + $currPos = $tokens[$currPos]['scope_closer']; + continue; + } + + $foundThrows = true; + + /* + If we can't find a NEW, we are probably throwing + a variable or calling a method. + + If we're throwing a variable, and it's the same variable as the + exception container from the nearest 'catch' block, we take that exception + as it is likely to be a re-throw. + + If we can't find a matching catch block, or the variable name + is different, it's probably a different variable, so we ignore it, + but they still need to provide at least one @throws tag, even through we + don't know the exception class. + */ + + $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($currPos + 1), null, true); + if ($tokens[$nextToken]['code'] === T_NEW + || $tokens[$nextToken]['code'] === T_NS_SEPARATOR + || $tokens[$nextToken]['code'] === T_STRING + ) { + if ($tokens[$nextToken]['code'] === T_NEW) { + $currException = $phpcsFile->findNext( + [ + T_NS_SEPARATOR, + T_STRING, + ], + $currPos, + $stackPtrEnd, + false, + null, + true + ); + } else { + $currException = $nextToken; + } + + if ($currException !== false) { + $endException = $phpcsFile->findNext( + [ + T_NS_SEPARATOR, + T_STRING, + ], + ($currException + 1), + $stackPtrEnd, + true, + null, + true + ); + + if ($endException === false) { + $thrownExceptions[] = $tokens[$currException]['content']; + } else { + $thrownExceptions[] = $phpcsFile->getTokensAsString($currException, ($endException - $currException)); + } + }//end if + } else if ($tokens[$nextToken]['code'] === T_VARIABLE) { + // Find the nearest catch block in this scope and, if the caught var + // matches our re-thrown var, use the exception types being caught as + // exception types that are being thrown as well. + $catch = $phpcsFile->findPrevious( + T_CATCH, + $currPos, + $tokens[$stackPtr]['scope_opener'], + false, + null, + false + ); + + if ($catch !== false) { + $thrownVar = $phpcsFile->findPrevious( + T_VARIABLE, + ($tokens[$catch]['parenthesis_closer'] - 1), + $tokens[$catch]['parenthesis_opener'] + ); + + if ($tokens[$thrownVar]['content'] === $tokens[$nextToken]['content']) { + $exceptions = explode('|', $phpcsFile->getTokensAsString(($tokens[$catch]['parenthesis_opener'] + 1), ($thrownVar - $tokens[$catch]['parenthesis_opener'] - 1))); + foreach ($exceptions as $exception) { + $thrownExceptions[] = trim($exception); + } + } + } + } else { + ++$unknownCount; + }//end if + } while ($currPos < $stackPtrEnd && $currPos !== false); + + if ($foundThrows === false) { + return; + } + + // Only need one @throws tag for each type of exception thrown. + $thrownExceptions = array_unique($thrownExceptions); + + $throwTags = []; + $commentStart = $tokens[$commentEnd]['comment_opener']; + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + if ($tokens[$tag]['content'] !== '@throws') { + continue; + } + + if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { + $exception = $tokens[($tag + 2)]['content']; + $space = strpos($exception, ' '); + if ($space !== false) { + $exception = substr($exception, 0, $space); + } + + $throwTags[$exception] = true; + } + } + + if (empty($throwTags) === true) { + $error = 'Missing @throws tag in function comment'; + $phpcsFile->addError($error, $commentEnd, 'Missing'); + return; + } else if (empty($thrownExceptions) === true) { + // If token count is zero, it means that only variables are being + // thrown, so we need at least one @throws tag (checked above). + // Nothing more to do. + return; + } + + // Make sure @throws tag count matches thrown count. + $thrownCount = (count($thrownExceptions) + $unknownCount); + $tagCount = count($throwTags); + if ($thrownCount !== $tagCount) { + $error = 'Expected %s @throws tag(s) in function comment; %s found'; + $data = [ + $thrownCount, + $tagCount, + ]; + $phpcsFile->addError($error, $commentEnd, 'WrongNumber', $data); + return; + } + + foreach ($thrownExceptions as $throw) { + if (isset($throwTags[$throw]) === true) { + continue; + } + + foreach ($throwTags as $tag => $ignore) { + if (strrpos($tag, $throw) === (strlen($tag) - strlen($throw))) { + continue 2; + } + } + + $error = 'Missing @throws tag for "%s" exception'; + $data = [$throw]; + $phpcsFile->addError($error, $commentEnd, 'Missing', $data); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php new file mode 100644 index 00000000..3c1ead70 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php @@ -0,0 +1,349 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 InlineCommentSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_COMMENT, + T_DOC_COMMENT_OPEN_TAG, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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|int + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // If this is a function/class/interface doc block comment, skip it. + // We are only interested in inline doc block comments, which are + // not allowed. + if ($tokens[$stackPtr]['code'] === T_DOC_COMMENT_OPEN_TAG) { + $nextToken = $stackPtr; + do { + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextToken + 1), null, true); + if ($tokens[$nextToken]['code'] === T_ATTRIBUTE) { + $nextToken = $tokens[$nextToken]['attribute_closer']; + continue; + } + + break; + } while (true); + + $ignore = [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_ENUM, + T_FUNCTION, + T_CLOSURE, + T_PUBLIC, + T_PRIVATE, + T_PROTECTED, + T_FINAL, + T_STATIC, + T_ABSTRACT, + T_READONLY, + T_CONST, + T_PROPERTY, + T_INCLUDE, + T_INCLUDE_ONCE, + T_REQUIRE, + T_REQUIRE_ONCE, + ]; + + if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { + return; + } + + if ($phpcsFile->tokenizerType === 'JS') { + // We allow block comments if a function or object + // is being assigned to a variable. + $ignore = Tokens::$emptyTokens; + $ignore[] = T_EQUAL; + $ignore[] = T_STRING; + $ignore[] = T_OBJECT_OPERATOR; + $nextToken = $phpcsFile->findNext($ignore, ($nextToken + 1), null, true); + if ($tokens[$nextToken]['code'] === T_FUNCTION + || $tokens[$nextToken]['code'] === T_CLOSURE + || $tokens[$nextToken]['code'] === T_OBJECT + || $tokens[$nextToken]['code'] === T_PROTOTYPE + ) { + return; + } + } + + $prevToken = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($stackPtr - 1), + null, + true + ); + + if ($tokens[$prevToken]['code'] === T_OPEN_TAG) { + return; + } + + if ($tokens[$stackPtr]['content'] === '/**') { + $error = 'Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead'; + $phpcsFile->addError($error, $stackPtr, 'DocBlock'); + } + }//end if + + if ($tokens[$stackPtr]['content'][0] === '#') { + $error = 'Perl-style comments are not allowed; use "// Comment" instead'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStyle'); + if ($fix === true) { + $comment = ltrim($tokens[$stackPtr]['content'], "# \t"); + $phpcsFile->fixer->replaceToken($stackPtr, "// $comment"); + } + } + + // We don't want end of block comments. Check if the last token before the + // comment is a closing curly brace. + $previousContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$previousContent]['line'] === $tokens[$stackPtr]['line']) { + if ($tokens[$previousContent]['code'] === T_CLOSE_CURLY_BRACKET) { + return; + } + + // Special case for JS files. + if ($tokens[$previousContent]['code'] === T_COMMA + || $tokens[$previousContent]['code'] === T_SEMICOLON + ) { + $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($previousContent - 1), null, true); + if ($tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { + return; + } + } + } + + // Only want inline comments. + if (substr($tokens[$stackPtr]['content'], 0, 2) !== '//') { + return; + } + + $commentTokens = [$stackPtr]; + + $nextComment = $stackPtr; + $lastComment = $stackPtr; + while (($nextComment = $phpcsFile->findNext(T_COMMENT, ($nextComment + 1), null, false)) !== false) { + if ($tokens[$nextComment]['line'] !== ($tokens[$lastComment]['line'] + 1)) { + break; + } + + // Only want inline comments. + if (substr($tokens[$nextComment]['content'], 0, 2) !== '//') { + break; + } + + // There is a comment on the very next line. If there is + // no code between the comments, they are part of the same + // comment block. + $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($nextComment - 1), $lastComment, true); + if ($prevNonWhitespace !== $lastComment) { + break; + } + + $commentTokens[] = $nextComment; + $lastComment = $nextComment; + }//end while + + $commentText = ''; + foreach ($commentTokens as $lastCommentToken) { + $comment = rtrim($tokens[$lastCommentToken]['content']); + + if (trim(substr($comment, 2)) === '') { + continue; + } + + $spaceCount = 0; + $tabFound = false; + + $commentLength = strlen($comment); + for ($i = 2; $i < $commentLength; $i++) { + if ($comment[$i] === "\t") { + $tabFound = true; + break; + } + + if ($comment[$i] !== ' ') { + break; + } + + $spaceCount++; + } + + $fix = false; + if ($tabFound === true) { + $error = 'Tab found before comment text; expected "// %s" but found "%s"'; + $data = [ + ltrim(substr($comment, 2)), + $comment, + ]; + $fix = $phpcsFile->addFixableError($error, $lastCommentToken, 'TabBefore', $data); + } else if ($spaceCount === 0) { + $error = 'No space found before comment text; expected "// %s" but found "%s"'; + $data = [ + substr($comment, 2), + $comment, + ]; + $fix = $phpcsFile->addFixableError($error, $lastCommentToken, 'NoSpaceBefore', $data); + } else if ($spaceCount > 1) { + $error = 'Expected 1 space before comment text but found %s; use block comment if you need indentation'; + $data = [ + $spaceCount, + substr($comment, (2 + $spaceCount)), + $comment, + ]; + $fix = $phpcsFile->addFixableError($error, $lastCommentToken, 'SpacingBefore', $data); + }//end if + + if ($fix === true) { + $newComment = '// '.ltrim($tokens[$lastCommentToken]['content'], "/\t "); + $phpcsFile->fixer->replaceToken($lastCommentToken, $newComment); + } + + $commentText .= trim(substr($tokens[$lastCommentToken]['content'], 2)); + }//end foreach + + if ($commentText === '') { + $error = 'Blank comments are not allowed'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, ''); + } + + return ($lastCommentToken + 1); + } + + if (preg_match('/^\p{Ll}/u', $commentText) === 1) { + $error = 'Inline comments must start with a capital letter'; + $phpcsFile->addError($error, $stackPtr, 'NotCapital'); + } + + // Only check the end of comment character if the start of the comment + // is a letter, indicating that the comment is just standard text. + if (preg_match('/^\p{L}/u', $commentText) === 1) { + $commentCloser = $commentText[(strlen($commentText) - 1)]; + $acceptedClosers = [ + 'full-stops' => '.', + 'exclamation marks' => '!', + 'or question marks' => '?', + ]; + + if (in_array($commentCloser, $acceptedClosers, true) === false) { + $error = 'Inline comments must end in %s'; + $ender = ''; + foreach ($acceptedClosers as $closerName => $symbol) { + $ender .= ' '.$closerName.','; + } + + $ender = trim($ender, ' ,'); + $data = [$ender]; + $phpcsFile->addError($error, $lastCommentToken, 'InvalidEndChar', $data); + } + } + + // Finally, the line below the last comment cannot be empty if this inline + // comment is on a line by itself. + if ($tokens[$previousContent]['line'] < $tokens[$stackPtr]['line']) { + $next = $phpcsFile->findNext(T_WHITESPACE, ($lastCommentToken + 1), null, true); + if ($next === false) { + // Ignore if the comment is the last non-whitespace token in a file. + return ($lastCommentToken + 1); + } + + if ($tokens[$next]['code'] === T_DOC_COMMENT_OPEN_TAG) { + // If this inline comment is followed by a docblock, + // ignore spacing as docblock/function etc spacing rules + // are likely to conflict with our rules. + return ($lastCommentToken + 1); + } + + $errorCode = 'SpacingAfter'; + + if (isset($tokens[$stackPtr]['conditions']) === true) { + $conditions = $tokens[$stackPtr]['conditions']; + $type = end($conditions); + $conditionPtr = key($conditions); + + if (($type === T_FUNCTION || $type === T_CLOSURE) + && $tokens[$conditionPtr]['scope_closer'] === $next + ) { + $errorCode = 'SpacingAfterAtFunctionEnd'; + } + } + + for ($i = ($lastCommentToken + 1); $i < $phpcsFile->numTokens; $i++) { + if ($tokens[$i]['line'] === ($tokens[$lastCommentToken]['line'] + 1)) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + return ($lastCommentToken + 1); + } + } else if ($tokens[$i]['line'] > ($tokens[$lastCommentToken]['line'] + 1)) { + break; + } + } + + $error = 'There must be no blank line following an inline comment'; + $fix = $phpcsFile->addFixableError($error, $lastCommentToken, $errorCode); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($lastCommentToken + 1); $i < $next; $i++) { + if ($tokens[$i]['line'] === $tokens[$next]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + + return ($lastCommentToken + 1); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php new file mode 100644 index 00000000..7c06e429 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php @@ -0,0 +1,218 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class LongConditionClosingCommentSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * The openers that we are interested in. + * + * @var integer[] + */ + private static $openers = [ + T_SWITCH, + T_IF, + T_FOR, + T_FOREACH, + T_WHILE, + T_TRY, + T_CASE, + T_MATCH, + ]; + + /** + * The length that a code block must be before + * requiring a closing comment. + * + * @var integer + */ + public $lineLimit = 20; + + /** + * The format the end comment should be in. + * + * The placeholder %s will be replaced with the type of condition opener. + * + * @var string + */ + public $commentFormat = '//end %s'; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_CLOSE_CURLY_BRACKET]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['scope_condition']) === false) { + // No scope condition. It is a function closer. + return; + } + + $startCondition = $tokens[$tokens[$stackPtr]['scope_condition']]; + $startBrace = $tokens[$tokens[$stackPtr]['scope_opener']]; + $endBrace = $tokens[$stackPtr]; + + // We are only interested in some code blocks. + if (in_array($startCondition['code'], self::$openers, true) === false) { + return; + } + + if ($startCondition['code'] === T_IF) { + // If this is actually an ELSE IF, skip it as the brace + // will be checked by the original IF. + $else = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$stackPtr]['scope_condition'] - 1), null, true); + if ($tokens[$else]['code'] === T_ELSE) { + return; + } + + // IF statements that have an ELSE block need to use + // "end if" rather than "end else" or "end elseif". + do { + $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$nextToken]['code'] === T_ELSE || $tokens[$nextToken]['code'] === T_ELSEIF) { + // Check for ELSE IF (2 tokens) as opposed to ELSEIF (1 token). + if ($tokens[$nextToken]['code'] === T_ELSE + && isset($tokens[$nextToken]['scope_closer']) === false + ) { + $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($nextToken + 1), null, true); + if ($tokens[$nextToken]['code'] !== T_IF + || isset($tokens[$nextToken]['scope_closer']) === false + ) { + // Not an ELSE IF or is an inline ELSE IF. + break; + } + } + + if (isset($tokens[$nextToken]['scope_closer']) === false) { + // There isn't going to be anywhere to print the "end if" comment + // because there is no closer. + return; + } + + // The end brace becomes the ELSE's end brace. + $stackPtr = $tokens[$nextToken]['scope_closer']; + $endBrace = $tokens[$stackPtr]; + } else { + break; + }//end if + } while (isset($tokens[$nextToken]['scope_closer']) === true); + }//end if + + if ($startCondition['code'] === T_TRY) { + // TRY statements need to check until the end of all CATCH statements. + do { + $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$nextToken]['code'] === T_CATCH + || $tokens[$nextToken]['code'] === T_FINALLY + ) { + // The end brace becomes the CATCH end brace. + $stackPtr = $tokens[$nextToken]['scope_closer']; + $endBrace = $tokens[$stackPtr]; + } else { + break; + } + } while (isset($tokens[$nextToken]['scope_closer']) === true); + } + + if ($startCondition['code'] === T_MATCH) { + // Move the stackPtr to after the semicolon/comma if there is one. + $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($nextToken !== false + && ($tokens[$nextToken]['code'] === T_SEMICOLON + || $tokens[$nextToken]['code'] === T_COMMA) + ) { + $stackPtr = $nextToken; + } + } + + $lineDifference = ($endBrace['line'] - $startBrace['line']); + + $expected = sprintf($this->commentFormat, $startCondition['content']); + $comment = $phpcsFile->findNext([T_COMMENT], $stackPtr, null, false); + + if (($comment === false) || ($tokens[$comment]['line'] !== $endBrace['line'])) { + if ($lineDifference >= $this->lineLimit) { + $error = 'End comment for long condition not found; expected "%s"'; + $data = [$expected]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Missing', $data); + + if ($fix === true) { + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($next !== false && $tokens[$next]['line'] === $tokens[$stackPtr]['line']) { + $expected .= $phpcsFile->eolChar; + } + + $phpcsFile->fixer->addContent($stackPtr, $expected); + } + } + + return; + } + + if (($comment - $stackPtr) !== 1) { + $error = 'Space found before closing comment; expected "%s"'; + $data = [$expected]; + $phpcsFile->addError($error, $stackPtr, 'SpacingBefore', $data); + } + + if (trim($tokens[$comment]['content']) !== $expected) { + $found = trim($tokens[$comment]['content']); + $error = 'Incorrect closing comment; expected "%s" but found "%s"'; + $data = [ + $expected, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Invalid', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($comment, $expected.$phpcsFile->eolChar); + } + + return; + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php new file mode 100644 index 00000000..9b36abe7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php @@ -0,0 +1,121 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class PostStatementCommentSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * Exceptions to the rule. + * + * If post statement comments are found within the condition + * parenthesis of these structures, leave them alone. + * + * @var array + */ + private $controlStructureExceptions = [ + T_IF => true, + T_ELSEIF => true, + T_SWITCH => true, + T_WHILE => true, + T_FOR => true, + T_FOREACH => true, + T_MATCH => true, + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_COMMENT]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + if (substr($tokens[$stackPtr]['content'], 0, 2) !== '//') { + return; + } + + $commentLine = $tokens[$stackPtr]['line']; + $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + + if ($lastContent === false + || $tokens[$lastContent]['line'] !== $commentLine + || $tokens[$stackPtr]['column'] === 1 + ) { + return; + } + + if ($tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { + return; + } + + // Special case for JS files and PHP closures. + if ($tokens[$lastContent]['code'] === T_COMMA + || $tokens[$lastContent]['code'] === T_SEMICOLON + ) { + $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($lastContent - 1), null, true); + if ($lastContent === false || $tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { + return; + } + } + + // Special case for (trailing) comments within multi-line control structures. + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; + foreach ($nestedParens as $open => $close) { + if (isset($tokens[$open]['parenthesis_owner']) === true + && isset($this->controlStructureExceptions[$tokens[$tokens[$open]['parenthesis_owner']]['code']]) === true + ) { + return; + } + } + } + + $error = 'Comments may not appear after statements'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($stackPtr); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php new file mode 100644 index 00000000..61ccbf7a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php @@ -0,0 +1,201 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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\AbstractVariableSniff; +use PHP_CodeSniffer\Util\Common; + +class VariableCommentSniff extends AbstractVariableSniff +{ + + + /** + * Called to process class member vars. + * + * @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 processMemberVar(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $ignore = [ + T_PUBLIC => T_PUBLIC, + T_PRIVATE => T_PRIVATE, + T_PROTECTED => T_PROTECTED, + T_VAR => T_VAR, + T_STATIC => T_STATIC, + T_READONLY => T_READONLY, + T_WHITESPACE => T_WHITESPACE, + T_STRING => T_STRING, + T_NS_SEPARATOR => T_NS_SEPARATOR, + T_NAMESPACE => T_NAMESPACE, + T_NULLABLE => T_NULLABLE, + T_TYPE_UNION => T_TYPE_UNION, + T_TYPE_INTERSECTION => T_TYPE_INTERSECTION, + T_NULL => T_NULL, + T_TRUE => T_TRUE, + T_FALSE => T_FALSE, + T_SELF => T_SELF, + T_PARENT => T_PARENT, + ]; + + for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { + if (isset($ignore[$tokens[$commentEnd]['code']]) === true) { + continue; + } + + if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END + && isset($tokens[$commentEnd]['attribute_opener']) === true + ) { + $commentEnd = $tokens[$commentEnd]['attribute_opener']; + continue; + } + + break; + } + + if ($commentEnd === false + || ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG + && $tokens[$commentEnd]['code'] !== T_COMMENT) + ) { + $phpcsFile->addError('Missing member variable doc comment', $stackPtr, 'Missing'); + return; + } + + if ($tokens[$commentEnd]['code'] === T_COMMENT) { + $phpcsFile->addError('You must use "/**" style comments for a member variable comment', $stackPtr, 'WrongStyle'); + return; + } + + $commentStart = $tokens[$commentEnd]['comment_opener']; + + $foundVar = null; + foreach ($tokens[$commentStart]['comment_tags'] as $tag) { + if ($tokens[$tag]['content'] === '@var') { + if ($foundVar !== null) { + $error = 'Only one @var tag is allowed in a member variable comment'; + $phpcsFile->addError($error, $tag, 'DuplicateVar'); + } else { + $foundVar = $tag; + } + } else if ($tokens[$tag]['content'] === '@see') { + // Make sure the tag isn't empty. + $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); + if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { + $error = 'Content missing for @see tag in member variable comment'; + $phpcsFile->addError($error, $tag, 'EmptySees'); + } + } else { + $error = '%s tag is not allowed in member variable comment'; + $data = [$tokens[$tag]['content']]; + $phpcsFile->addWarning($error, $tag, 'TagNotAllowed', $data); + }//end if + }//end foreach + + // The @var tag is the only one we require. + if ($foundVar === null) { + $error = 'Missing @var tag in member variable comment'; + $phpcsFile->addError($error, $commentEnd, 'MissingVar'); + return; + } + + $firstTag = $tokens[$commentStart]['comment_tags'][0]; + if ($foundVar !== null && $tokens[$firstTag]['content'] !== '@var') { + $error = 'The @var tag must be the first tag in a member variable comment'; + $phpcsFile->addError($error, $foundVar, 'VarOrder'); + } + + // Make sure the tag isn't empty and has the correct padding. + $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $foundVar, $commentEnd); + if ($string === false || $tokens[$string]['line'] !== $tokens[$foundVar]['line']) { + $error = 'Content missing for @var tag in member variable comment'; + $phpcsFile->addError($error, $foundVar, 'EmptyVar'); + return; + } + + // Support both a var type and a description. + preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $tokens[($foundVar + 2)]['content'], $varParts); + if (isset($varParts[1]) === false) { + return; + } + + $varType = $varParts[1]; + + // Check var type (can be multiple, separated by '|'). + $typeNames = explode('|', $varType); + $suggestedNames = []; + foreach ($typeNames as $typeName) { + $suggestedName = Common::suggestType($typeName); + if (in_array($suggestedName, $suggestedNames, true) === false) { + $suggestedNames[] = $suggestedName; + } + } + + $suggestedType = implode('|', $suggestedNames); + if ($varType !== $suggestedType) { + $error = 'Expected "%s" but found "%s" for @var tag in member variable comment'; + $data = [ + $suggestedType, + $varType, + ]; + $fix = $phpcsFile->addFixableError($error, $foundVar, 'IncorrectVarType', $data); + if ($fix === true) { + $replacement = $suggestedType; + if (empty($varParts[2]) === false) { + $replacement .= $varParts[2]; + } + + $phpcsFile->fixer->replaceToken(($foundVar + 2), $replacement); + unset($replacement); + } + } + + }//end processMemberVar() + + + /** + * Called to process a normal variable. + * + * Not required for this sniff. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this token was found. + * @param int $stackPtr The position where the double quoted + * string was found. + * + * @return void + */ + protected function processVariable(File $phpcsFile, $stackPtr) + { + + }//end processVariable() + + + /** + * Called to process variables found in double quoted strings. + * + * Not required for this sniff. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this token was found. + * @param int $stackPtr The position where the double quoted + * string was found. + * + * @return void + */ + protected function processVariableInString(File $phpcsFile, $stackPtr) + { + + }//end processVariableInString() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php new file mode 100644 index 00000000..06fd3edc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -0,0 +1,337 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ControlSignatureSniff implements Sniff +{ + + /** + * How many spaces should precede the colon if using alternative syntax. + * + * @var integer + */ + public $requiredSpacesBeforeColon = 1; + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_TRY, + T_CATCH, + T_FINALLY, + T_DO, + T_WHILE, + T_FOR, + T_IF, + T_FOREACH, + T_ELSE, + T_ELSEIF, + T_SWITCH, + T_MATCH, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextNonEmpty === false) { + return; + } + + $isAlternative = false; + if (isset($tokens[$stackPtr]['scope_opener']) === true + && $tokens[$tokens[$stackPtr]['scope_opener']]['code'] === T_COLON + ) { + $isAlternative = true; + } + + // Single space after the keyword. + $expected = 1; + if (isset($tokens[$stackPtr]['parenthesis_closer']) === false && $isAlternative === true) { + // Catching cases like: + // if (condition) : ... else: ... endif + // where there is no condition. + $expected = (int) $this->requiredSpacesBeforeColon; + } + + $found = 1; + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + $found = 0; + } else if ($tokens[($stackPtr + 1)]['content'] !== ' ') { + if (strpos($tokens[($stackPtr + 1)]['content'], $phpcsFile->eolChar) !== false) { + $found = 'newline'; + } else { + $found = $tokens[($stackPtr + 1)]['length']; + } + } + + if ($found !== $expected) { + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Expected %s space%s after %s keyword; %s found'; + $data = [ + $expected, + $pluralizeSpace, + strtoupper($tokens[$stackPtr]['content']), + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword', $data); + if ($fix === true) { + if ($found === 0) { + $phpcsFile->fixer->addContent($stackPtr, str_repeat(' ', $expected)); + } else { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), str_repeat(' ', $expected)); + } + } + }//end if + + // Single space after closing parenthesis. + if (isset($tokens[$stackPtr]['parenthesis_closer']) === true + && isset($tokens[$stackPtr]['scope_opener']) === true + ) { + $expected = 1; + if ($isAlternative === true) { + $expected = (int) $this->requiredSpacesBeforeColon; + } + + $closer = $tokens[$stackPtr]['parenthesis_closer']; + $opener = $tokens[$stackPtr]['scope_opener']; + $content = $phpcsFile->getTokensAsString(($closer + 1), ($opener - $closer - 1)); + + if (trim($content) === '') { + if (strpos($content, $phpcsFile->eolChar) !== false) { + $found = 'newline'; + } else { + $found = strlen($content); + } + } else { + $found = '"'.str_replace($phpcsFile->eolChar, '\n', $content).'"'; + } + + if ($found !== $expected) { + $pluralizeSpace = 's'; + if ($expected === 1) { + $pluralizeSpace = ''; + } + + $error = 'Expected %s space%s after closing parenthesis; found %s'; + $data = [ + $expected, + $pluralizeSpace, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceAfterCloseParenthesis', $data); + if ($fix === true) { + $padding = str_repeat(' ', $expected); + if ($closer === ($opener - 1)) { + $phpcsFile->fixer->addContent($closer, $padding); + } else { + $phpcsFile->fixer->beginChangeset(); + if (trim($content) === '') { + $phpcsFile->fixer->addContent($closer, $padding); + if ($found !== 0) { + for ($i = ($closer + 1); $i < $opener; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + } else { + $phpcsFile->fixer->addContent($closer, $padding.$tokens[$opener]['content']); + $phpcsFile->fixer->replaceToken($opener, ''); + + if ($tokens[$opener]['line'] !== $tokens[$closer]['line']) { + $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); + if ($tokens[$next]['line'] !== $tokens[$opener]['line']) { + for ($i = ($opener + 1); $i < $next; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + } + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + }//end if + }//end if + + // Single newline after opening brace. + if (isset($tokens[$stackPtr]['scope_opener']) === true) { + $opener = $tokens[$stackPtr]['scope_opener']; + for ($next = ($opener + 1); $next < $phpcsFile->numTokens; $next++) { + $code = $tokens[$next]['code']; + + if ($code === T_WHITESPACE + || ($code === T_INLINE_HTML + && trim($tokens[$next]['content']) === '') + ) { + continue; + } + + // Skip all empty tokens on the same line as the opener. + if ($tokens[$next]['line'] === $tokens[$opener]['line'] + && (isset(Tokens::$emptyTokens[$code]) === true + || $code === T_CLOSE_TAG) + ) { + continue; + } + + // We found the first bit of a code, or a comment on the + // following line. + break; + }//end for + + if ($tokens[$next]['line'] === $tokens[$opener]['line']) { + $error = 'Newline required after opening brace'; + $fix = $phpcsFile->addFixableError($error, $opener, 'NewlineAfterOpenBrace'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($opener + 1); $i < $next; $i++) { + if (trim($tokens[$i]['content']) !== '') { + break; + } + + // Remove whitespace. + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addContent($opener, $phpcsFile->eolChar); + $phpcsFile->fixer->endChangeset(); + } + }//end if + } else if ($tokens[$stackPtr]['code'] === T_WHILE) { + // Zero spaces after parenthesis closer, but only if followed by a semicolon. + $closer = $tokens[$stackPtr]['parenthesis_closer']; + $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($closer + 1), null, true); + if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === T_SEMICOLON) { + $found = 0; + if ($tokens[($closer + 1)]['code'] === T_WHITESPACE) { + if (strpos($tokens[($closer + 1)]['content'], $phpcsFile->eolChar) !== false) { + $found = 'newline'; + } else { + $found = $tokens[($closer + 1)]['length']; + } + } + + if ($found !== 0) { + $error = 'Expected 0 spaces before semicolon; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceBeforeSemicolon', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($closer + 1), ''); + } + } + } + }//end if + + // Only want to check multi-keyword structures from here on. + if ($tokens[$stackPtr]['code'] === T_WHILE) { + if (isset($tokens[$stackPtr]['scope_closer']) !== false) { + return; + } + + $closer = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($closer === false + || $tokens[$closer]['code'] !== T_CLOSE_CURLY_BRACKET + || $tokens[$tokens[$closer]['scope_condition']]['code'] !== T_DO + ) { + return; + } + } else if ($tokens[$stackPtr]['code'] === T_ELSE + || $tokens[$stackPtr]['code'] === T_ELSEIF + || $tokens[$stackPtr]['code'] === T_CATCH + || $tokens[$stackPtr]['code'] === T_FINALLY + ) { + if (isset($tokens[$stackPtr]['scope_opener']) === true + && $tokens[$tokens[$stackPtr]['scope_opener']]['code'] === T_COLON + ) { + // Special case for alternate syntax, where this token is actually + // the closer for the previous block, so there is no spacing to check. + return; + } + + $closer = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($closer === false || $tokens[$closer]['code'] !== T_CLOSE_CURLY_BRACKET) { + return; + } + } else { + return; + }//end if + + // Single space after closing brace. + $found = 1; + if ($tokens[($closer + 1)]['code'] !== T_WHITESPACE) { + $found = 0; + } else if ($tokens[$closer]['line'] !== $tokens[$stackPtr]['line']) { + $found = 'newline'; + } else if ($tokens[($closer + 1)]['content'] !== ' ') { + $found = $tokens[($closer + 1)]['length']; + } + + if ($found !== 1) { + $error = 'Expected 1 space after closing brace; %s found'; + $data = [$found]; + + if ($phpcsFile->findNext(Tokens::$commentTokens, ($closer + 1), $stackPtr) !== false) { + // Comment found between closing brace and keyword, don't auto-fix. + $phpcsFile->addError($error, $closer, 'SpaceAfterCloseBrace', $data); + return; + } + + $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceAfterCloseBrace', $data); + if ($fix === true) { + if ($found === 0) { + $phpcsFile->fixer->addContent($closer, ' '); + } else { + $phpcsFile->fixer->replaceToken(($closer + 1), ' '); + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php new file mode 100644 index 00000000..3cdb901d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php @@ -0,0 +1,51 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ElseIfDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_ELSEIF]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $error = 'Usage of ELSEIF not allowed; use ELSE IF instead'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAllowed'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, 'else if'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php new file mode 100644 index 00000000..bd51b265 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php @@ -0,0 +1,236 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ForEachLoopDeclarationSniff implements Sniff +{ + + /** + * How many spaces should follow the opening bracket. + * + * @var integer + */ + public $requiredSpacesAfterOpen = 0; + + /** + * How many spaces should precede the closing bracket. + * + * @var integer + */ + public $requiredSpacesBeforeClose = 0; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FOREACH]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; + $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; + $tokens = $phpcsFile->getTokens(); + + $openingBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr); + if ($openingBracket === false) { + $error = 'Possible parse error: FOREACH has no opening parenthesis'; + $phpcsFile->addWarning($error, $stackPtr, 'MissingOpenParenthesis'); + return; + } + + if (isset($tokens[$openingBracket]['parenthesis_closer']) === false) { + $error = 'Possible parse error: FOREACH has no closing parenthesis'; + $phpcsFile->addWarning($error, $stackPtr, 'MissingCloseParenthesis'); + return; + } + + $closingBracket = $tokens[$openingBracket]['parenthesis_closer']; + + if ($this->requiredSpacesAfterOpen === 0 && $tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { + $error = 'Space found after opening bracket of FOREACH loop'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpen'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($openingBracket + 1), ''); + } + } else if ($this->requiredSpacesAfterOpen > 0) { + $spaceAfterOpen = 0; + if ($tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { + $spaceAfterOpen = $tokens[($openingBracket + 1)]['length']; + } + + if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { + $error = 'Expected %s spaces after opening bracket; %s found'; + $data = [ + $this->requiredSpacesAfterOpen, + $spaceAfterOpen, + ]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); + if ($spaceAfterOpen === 0) { + $phpcsFile->fixer->addContent($openingBracket, $padding); + } else { + $phpcsFile->fixer->replaceToken(($openingBracket + 1), $padding); + } + } + } + }//end if + + if ($this->requiredSpacesBeforeClose === 0 && $tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { + $error = 'Space found before closing bracket of FOREACH loop'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($closingBracket - 1), ''); + } + } else if ($this->requiredSpacesBeforeClose > 0) { + $spaceBeforeClose = 0; + if ($tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { + $spaceBeforeClose = $tokens[($closingBracket - 1)]['length']; + } + + if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) { + $error = 'Expected %s spaces before closing bracket; %s found'; + $data = [ + $this->requiredSpacesBeforeClose, + $spaceBeforeClose, + ]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); + if ($spaceBeforeClose === 0) { + $phpcsFile->fixer->addContentBefore($closingBracket, $padding); + } else { + $phpcsFile->fixer->replaceToken(($closingBracket - 1), $padding); + } + } + } + }//end if + + $asToken = $phpcsFile->findNext(T_AS, $openingBracket); + if ($asToken === false) { + $error = 'Possible parse error: FOREACH has no AS statement'; + $phpcsFile->addWarning($error, $stackPtr, 'MissingAs'); + return; + } + + $content = $tokens[$asToken]['content']; + if ($content !== strtolower($content)) { + $expected = strtolower($content); + $error = 'AS keyword must be lowercase; expected "%s" but found "%s"'; + $data = [ + $expected, + $content, + ]; + + $fix = $phpcsFile->addFixableError($error, $asToken, 'AsNotLower', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($asToken, $expected); + } + } + + $doubleArrow = $phpcsFile->findNext(T_DOUBLE_ARROW, $asToken, $closingBracket); + + if ($doubleArrow !== false) { + if ($tokens[($doubleArrow - 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space before "=>"; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeArrow'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($doubleArrow, ' '); + } + } else { + if ($tokens[($doubleArrow - 1)]['length'] !== 1) { + $spaces = $tokens[($doubleArrow - 1)]['length']; + $error = 'Expected 1 space before "=>"; %s found'; + $data = [$spaces]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeArrow', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($doubleArrow - 1), ' '); + } + } + } + + if ($tokens[($doubleArrow + 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space after "=>"; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterArrow'); + if ($fix === true) { + $phpcsFile->fixer->addContent($doubleArrow, ' '); + } + } else { + if ($tokens[($doubleArrow + 1)]['length'] !== 1) { + $spaces = $tokens[($doubleArrow + 1)]['length']; + $error = 'Expected 1 space after "=>"; %s found'; + $data = [$spaces]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterArrow', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($doubleArrow + 1), ' '); + } + } + } + }//end if + + if ($tokens[($asToken - 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space before "as"; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeAs'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($asToken, ' '); + } + } else { + if ($tokens[($asToken - 1)]['length'] !== 1) { + $spaces = $tokens[($asToken - 1)]['length']; + $error = 'Expected 1 space before "as"; %s found'; + $data = [$spaces]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeAs', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($asToken - 1), ' '); + } + } + } + + if ($tokens[($asToken + 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space after "as"; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterAs'); + if ($fix === true) { + $phpcsFile->fixer->addContent($asToken, ' '); + } + } else { + if ($tokens[($asToken + 1)]['length'] !== 1) { + $spaces = $tokens[($asToken + 1)]['length']; + $error = 'Expected 1 space after "as"; %s found'; + $data = [$spaces]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterAs', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($asToken + 1), ' '); + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php new file mode 100644 index 00000000..38313e16 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php @@ -0,0 +1,316 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ForLoopDeclarationSniff implements Sniff +{ + + /** + * How many spaces should follow the opening bracket. + * + * @var integer + */ + public $requiredSpacesAfterOpen = 0; + + /** + * How many spaces should precede the closing bracket. + * + * @var integer + */ + public $requiredSpacesBeforeClose = 0; + + /** + * Allow newlines instead of spaces. + * + * @var boolean + */ + public $ignoreNewlines = false; + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FOR]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; + $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; + $tokens = $phpcsFile->getTokens(); + + $openingBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr); + if ($openingBracket === false || isset($tokens[$openingBracket]['parenthesis_closer']) === false) { + $error = 'Possible parse error: no opening/closing parenthesis for FOR keyword'; + $phpcsFile->addWarning($error, $stackPtr, 'NoOpenBracket'); + return; + } + + $closingBracket = $tokens[$openingBracket]['parenthesis_closer']; + + if ($this->requiredSpacesAfterOpen === 0 + && $tokens[($openingBracket + 1)]['code'] === T_WHITESPACE + ) { + $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($openingBracket + 1), $closingBracket, true); + if ($this->ignoreNewlines === false + || $tokens[$nextNonWhiteSpace]['line'] === $tokens[$openingBracket]['line'] + ) { + $error = 'Whitespace found after opening bracket of FOR loop'; + $fix = $phpcsFile->addFixableError($error, $openingBracket, 'SpacingAfterOpen'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($openingBracket + 1); $i < $closingBracket; $i++) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + } else if ($this->requiredSpacesAfterOpen > 0) { + $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($openingBracket + 1), $closingBracket, true); + $spaceAfterOpen = 0; + if ($tokens[$openingBracket]['line'] !== $tokens[$nextNonWhiteSpace]['line']) { + $spaceAfterOpen = 'newline'; + } else if ($tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { + $spaceAfterOpen = $tokens[($openingBracket + 1)]['length']; + } + + if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen + && ($this->ignoreNewlines === false + || $spaceAfterOpen !== 'newline') + ) { + $error = 'Expected %s spaces after opening bracket; %s found'; + $data = [ + $this->requiredSpacesAfterOpen, + $spaceAfterOpen, + ]; + $fix = $phpcsFile->addFixableError($error, $openingBracket, 'SpacingAfterOpen', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); + if ($spaceAfterOpen === 0) { + $phpcsFile->fixer->addContent($openingBracket, $padding); + } else { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken(($openingBracket + 1), $padding); + for ($i = ($openingBracket + 2); $i < $nextNonWhiteSpace; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + }//end if + + $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingBracket - 1), $openingBracket, true); + $beforeClosefixable = true; + if ($tokens[$prevNonWhiteSpace]['line'] !== $tokens[$closingBracket]['line'] + && isset(Tokens::$emptyTokens[$tokens[$prevNonWhiteSpace]['code']]) === true + ) { + $beforeClosefixable = false; + } + + if ($this->requiredSpacesBeforeClose === 0 + && $tokens[($closingBracket - 1)]['code'] === T_WHITESPACE + && ($this->ignoreNewlines === false + || $tokens[$prevNonWhiteSpace]['line'] === $tokens[$closingBracket]['line']) + ) { + $error = 'Whitespace found before closing bracket of FOR loop'; + + if ($beforeClosefixable === false) { + $phpcsFile->addError($error, $closingBracket, 'SpacingBeforeClose'); + } else { + $fix = $phpcsFile->addFixableError($error, $closingBracket, 'SpacingBeforeClose'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($closingBracket - 1); $i > $openingBracket; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + } else if ($this->requiredSpacesBeforeClose > 0) { + $spaceBeforeClose = 0; + if ($tokens[$closingBracket]['line'] !== $tokens[$prevNonWhiteSpace]['line']) { + $spaceBeforeClose = 'newline'; + } else if ($tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { + $spaceBeforeClose = $tokens[($closingBracket - 1)]['length']; + } + + if ($this->requiredSpacesBeforeClose !== $spaceBeforeClose + && ($this->ignoreNewlines === false + || $spaceBeforeClose !== 'newline') + ) { + $error = 'Expected %s spaces before closing bracket; %s found'; + $data = [ + $this->requiredSpacesBeforeClose, + $spaceBeforeClose, + ]; + + if ($beforeClosefixable === false) { + $phpcsFile->addError($error, $closingBracket, 'SpacingBeforeClose', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $closingBracket, 'SpacingBeforeClose', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); + if ($spaceBeforeClose === 0) { + $phpcsFile->fixer->addContentBefore($closingBracket, $padding); + } else { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken(($closingBracket - 1), $padding); + for ($i = ($closingBracket - 2); $i > $prevNonWhiteSpace; $i--) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + } + }//end if + }//end if + + /* + * Check whitespace around each of the semicolon tokens. + */ + + $semicolonCount = 0; + $semicolon = $openingBracket; + $targetNestinglevel = 0; + if (isset($tokens[$openingBracket]['conditions']) === true) { + $targetNestinglevel = count($tokens[$openingBracket]['conditions']); + } + + do { + $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($semicolon + 1), $closingBracket); + if ($semicolon === false) { + break; + } + + if (isset($tokens[$semicolon]['conditions']) === true + && count($tokens[$semicolon]['conditions']) > $targetNestinglevel + ) { + // Semicolon doesn't belong to the for(). + continue; + } + + ++$semicolonCount; + + $humanReadableCount = 'first'; + if ($semicolonCount !== 1) { + $humanReadableCount = 'second'; + } + + $humanReadableCode = ucfirst($humanReadableCount); + $data = [$humanReadableCount]; + + // Only examine the space before the first semicolon if the first expression is not empty. + // If it *is* empty, leave it up to the `SpacingAfterOpen` logic. + $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($semicolon - 1), $openingBracket, true); + if ($semicolonCount !== 1 || $prevNonWhiteSpace !== $openingBracket) { + if ($tokens[($semicolon - 1)]['code'] === T_WHITESPACE) { + $error = 'Whitespace found before %s semicolon of FOR loop'; + $errorCode = 'SpacingBefore'.$humanReadableCode; + $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($semicolon - 1); $i > $prevNonWhiteSpace; $i--) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + } + + // Only examine the space after the second semicolon if the last expression is not empty. + // If it *is* empty, leave it up to the `SpacingBeforeClose` logic. + $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($semicolon + 1), ($closingBracket + 1), true); + if ($semicolonCount !== 2 || $nextNonWhiteSpace !== $closingBracket) { + if ($tokens[($semicolon + 1)]['code'] !== T_WHITESPACE + && $tokens[($semicolon + 1)]['code'] !== T_SEMICOLON + ) { + $error = 'Expected 1 space after %s semicolon of FOR loop; 0 found'; + $errorCode = 'NoSpaceAfter'.$humanReadableCode; + $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($semicolon, ' '); + } + } else if ($tokens[($semicolon + 1)]['code'] === T_WHITESPACE + && $tokens[$nextNonWhiteSpace]['code'] !== T_SEMICOLON + ) { + $spaces = $tokens[($semicolon + 1)]['length']; + if ($tokens[$semicolon]['line'] !== $tokens[$nextNonWhiteSpace]['line']) { + $spaces = 'newline'; + } + + if ($spaces !== 1 + && ($this->ignoreNewlines === false + || $spaces !== 'newline') + ) { + $error = 'Expected 1 space after %s semicolon of FOR loop; %s found'; + $errorCode = 'SpacingAfter'.$humanReadableCode; + $data[] = $spaces; + $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken(($semicolon + 1), ' '); + for ($i = ($semicolon + 2); $i < $nextNonWhiteSpace; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + }//end if + } while ($semicolonCount < 2); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php new file mode 100644 index 00000000..ff39c847 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php @@ -0,0 +1,155 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class InlineIfDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_INLINE_THEN]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + $openBracket = null; + $closeBracket = null; + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $parens = $tokens[$stackPtr]['nested_parenthesis']; + $openBracket = array_pop($parens); + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + } + + // Find the beginning of the statement. If we don't find a + // semicolon (end of statement) or comma (end of array value) + // then assume the content before the closing parenthesis is the end. + $else = $phpcsFile->findNext(T_INLINE_ELSE, ($stackPtr + 1)); + $statementEnd = $phpcsFile->findNext([T_SEMICOLON, T_COMMA], ($else + 1), $closeBracket); + if ($statementEnd === false) { + $statementEnd = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true); + } + + // Make sure it's all on the same line. + if ($tokens[$statementEnd]['line'] !== $tokens[$stackPtr]['line']) { + $error = 'Inline shorthand IF statement must be declared on a single line'; + $phpcsFile->addError($error, $stackPtr, 'NotSingleLine'); + return; + } + + // Make sure there are spaces around the question mark. + $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$contentBefore]['code'] !== T_CLOSE_PARENTHESIS) { + $error = 'Inline shorthand IF statement requires brackets around comparison'; + $phpcsFile->addError($error, $stackPtr, 'NoBrackets'); + } + + $spaceBefore = ($tokens[$stackPtr]['column'] - ($tokens[$contentBefore]['column'] + $tokens[$contentBefore]['length'])); + if ($spaceBefore !== 1) { + $error = 'Inline shorthand IF statement requires 1 space before THEN; %s found'; + $data = [$spaceBefore]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeThen', $data); + if ($fix === true) { + if ($spaceBefore === 0) { + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + } else { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); + } + } + } + + // If there is no content between the ? and the : operators, then they are + // trying to replicate an elvis operator, even though PHP doesn't have one. + // In this case, we want no spaces between the two operators so ?: looks like + // an operator itself. + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$next]['code'] === T_INLINE_ELSE) { + $inlineElse = $next; + if ($inlineElse !== ($stackPtr + 1)) { + $error = 'Inline shorthand IF statement without THEN statement requires 0 spaces between THEN and ELSE'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ElvisSpacing'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + } + } else { + $spaceAfter = (($tokens[$contentAfter]['column']) - ($tokens[$stackPtr]['column'] + 1)); + if ($spaceAfter !== 1) { + $error = 'Inline shorthand IF statement requires 1 space after THEN; %s found'; + $data = [$spaceAfter]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterThen', $data); + if ($fix === true) { + if ($spaceAfter === 0) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } else { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + } + + // Make sure the ELSE has the correct spacing. + $inlineElse = $phpcsFile->findNext(T_INLINE_ELSE, ($stackPtr + 1), $statementEnd, false); + $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($inlineElse - 1), null, true); + $spaceBefore = ($tokens[$inlineElse]['column'] - ($tokens[$contentBefore]['column'] + $tokens[$contentBefore]['length'])); + if ($spaceBefore !== 1) { + $error = 'Inline shorthand IF statement requires 1 space before ELSE; %s found'; + $data = [$spaceBefore]; + $fix = $phpcsFile->addFixableError($error, $inlineElse, 'SpacingBeforeElse', $data); + if ($fix === true) { + if ($spaceBefore === 0) { + $phpcsFile->fixer->addContentBefore($inlineElse, ' '); + } else { + $phpcsFile->fixer->replaceToken(($inlineElse - 1), ' '); + } + } + } + }//end if + + $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($inlineElse + 1), null, true); + $spaceAfter = (($tokens[$contentAfter]['column']) - ($tokens[$inlineElse]['column'] + 1)); + if ($spaceAfter !== 1) { + $error = 'Inline shorthand IF statement requires 1 space after ELSE; %s found'; + $data = [$spaceAfter]; + $fix = $phpcsFile->addFixableError($error, $inlineElse, 'SpacingAfterElse', $data); + if ($fix === true) { + if ($spaceAfter === 0) { + $phpcsFile->fixer->addContent($inlineElse, ' '); + } else { + $phpcsFile->fixer->replaceToken(($inlineElse + 1), ' '); + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php new file mode 100644 index 00000000..068563c0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php @@ -0,0 +1,75 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class LowercaseDeclarationSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_IF, + T_ELSE, + T_ELSEIF, + T_FOREACH, + T_FOR, + T_DO, + T_SWITCH, + T_WHILE, + T_TRY, + T_CATCH, + T_MATCH, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 ($content !== $contentLc) { + $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; + $data = [ + strtoupper($content), + $contentLc, + $content, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php new file mode 100644 index 00000000..be46aed5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php @@ -0,0 +1,304 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class SwitchDeclarationSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * The number of spaces code should be indented. + * + * @var integer + */ + public $indent = 4; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_SWITCH]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // We can't process SWITCH statements unless we know where they start and end. + if (isset($tokens[$stackPtr]['scope_opener']) === false + || isset($tokens[$stackPtr]['scope_closer']) === false + ) { + return; + } + + $switch = $tokens[$stackPtr]; + $nextCase = $stackPtr; + $caseAlignment = ($switch['column'] + $this->indent); + $caseCount = 0; + $foundDefault = false; + + while (($nextCase = $phpcsFile->findNext([T_CASE, T_DEFAULT, T_SWITCH], ($nextCase + 1), $switch['scope_closer'])) !== false) { + // Skip nested SWITCH statements; they are handled on their own. + if ($tokens[$nextCase]['code'] === T_SWITCH) { + $nextCase = $tokens[$nextCase]['scope_closer']; + continue; + } + + if ($tokens[$nextCase]['code'] === T_DEFAULT) { + $type = 'Default'; + $foundDefault = true; + } else { + $type = 'Case'; + $caseCount++; + } + + if ($tokens[$nextCase]['content'] !== strtolower($tokens[$nextCase]['content'])) { + $expected = strtolower($tokens[$nextCase]['content']); + $error = strtoupper($type).' keyword must be lowercase; expected "%s" but found "%s"'; + $data = [ + $expected, + $tokens[$nextCase]['content'], + ]; + + $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'NotLower', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($nextCase, $expected); + } + } + + if ($tokens[$nextCase]['column'] !== $caseAlignment) { + $error = strtoupper($type).' keyword must be indented '.$this->indent.' spaces from SWITCH keyword'; + $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'Indent'); + + if ($fix === true) { + $padding = str_repeat(' ', ($caseAlignment - 1)); + if ($tokens[$nextCase]['column'] === 1 + || $tokens[($nextCase - 1)]['code'] !== T_WHITESPACE + ) { + $phpcsFile->fixer->addContentBefore($nextCase, $padding); + } else { + $phpcsFile->fixer->replaceToken(($nextCase - 1), $padding); + } + } + } + + if ($type === 'Case' + && ($tokens[($nextCase + 1)]['type'] !== 'T_WHITESPACE' + || $tokens[($nextCase + 1)]['content'] !== ' ') + ) { + $error = 'CASE keyword must be followed by a single space'; + $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpacingAfterCase'); + if ($fix === true) { + if ($tokens[($nextCase + 1)]['type'] !== 'T_WHITESPACE') { + $phpcsFile->fixer->addContent($nextCase, ' '); + } else { + $phpcsFile->fixer->replaceToken(($nextCase + 1), ' '); + } + } + } + + if (isset($tokens[$nextCase]['scope_opener']) === false) { + $error = 'Possible parse error: CASE missing opening colon'; + $phpcsFile->addWarning($error, $nextCase, 'MissingColon'); + continue; + } + + $opener = $tokens[$nextCase]['scope_opener']; + if ($tokens[($opener - 1)]['type'] === 'T_WHITESPACE') { + $error = 'There must be no space before the colon in a '.strtoupper($type).' statement'; + $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpaceBeforeColon'.$type); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($opener - 1), ''); + } + } + + $nextBreak = $tokens[$nextCase]['scope_closer']; + if ($tokens[$nextBreak]['code'] === T_BREAK + || $tokens[$nextBreak]['code'] === T_RETURN + || $tokens[$nextBreak]['code'] === T_CONTINUE + || $tokens[$nextBreak]['code'] === T_THROW + || $tokens[$nextBreak]['code'] === T_EXIT + ) { + if ($tokens[$nextBreak]['scope_condition'] === $nextCase) { + // Only need to check a couple of things once, even if the + // break is shared between multiple case statements, or even + // the default case. + if ($tokens[$nextBreak]['column'] !== $caseAlignment) { + $error = 'Case breaking statement must be indented '.$this->indent.' spaces from SWITCH keyword'; + $fix = $phpcsFile->addFixableError($error, $nextBreak, 'BreakIndent'); + + if ($fix === true) { + $padding = str_repeat(' ', ($caseAlignment - 1)); + if ($tokens[$nextBreak]['column'] === 1 + || $tokens[($nextBreak - 1)]['code'] !== T_WHITESPACE + ) { + $phpcsFile->fixer->addContentBefore($nextBreak, $padding); + } else { + $phpcsFile->fixer->replaceToken(($nextBreak - 1), $padding); + } + } + } + + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($nextBreak - 1), $stackPtr, true); + if ($tokens[$prev]['line'] !== ($tokens[$nextBreak]['line'] - 1)) { + $error = 'Blank lines are not allowed before case breaking statements'; + $phpcsFile->addError($error, $nextBreak, 'SpacingBeforeBreak'); + } + + $nextLine = $tokens[$tokens[$stackPtr]['scope_closer']]['line']; + $semicolon = $phpcsFile->findEndOfStatement($nextBreak); + for ($i = ($semicolon + 1); $i < $tokens[$stackPtr]['scope_closer']; $i++) { + if ($tokens[$i]['type'] !== 'T_WHITESPACE') { + $nextLine = $tokens[$i]['line']; + break; + } + } + + if ($type === 'Case') { + // Ensure the BREAK statement is followed by + // a single blank line, or the end switch brace. + if ($nextLine !== ($tokens[$semicolon]['line'] + 2) && $i !== $tokens[$stackPtr]['scope_closer']) { + $error = 'Case breaking statements must be followed by a single blank line'; + $fix = $phpcsFile->addFixableError($error, $nextBreak, 'SpacingAfterBreak'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($semicolon + 1); $i <= $tokens[$stackPtr]['scope_closer']; $i++) { + if ($tokens[$i]['line'] === $nextLine) { + $phpcsFile->fixer->addNewlineBefore($i); + break; + } + + if ($tokens[$i]['line'] === $tokens[$semicolon]['line']) { + continue; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + } else { + // Ensure the BREAK statement is not followed by a blank line. + if ($nextLine !== ($tokens[$semicolon]['line'] + 1)) { + $error = 'Blank lines are not allowed after the DEFAULT case\'s breaking statement'; + $phpcsFile->addError($error, $nextBreak, 'SpacingAfterDefaultBreak'); + } + }//end if + + $caseLine = $tokens[$nextCase]['line']; + $nextLine = $tokens[$nextBreak]['line']; + for ($i = ($opener + 1); $i < $nextBreak; $i++) { + if ($tokens[$i]['type'] !== 'T_WHITESPACE') { + $nextLine = $tokens[$i]['line']; + break; + } + } + + if ($nextLine !== ($caseLine + 1)) { + $error = 'Blank lines are not allowed after '.strtoupper($type).' statements'; + $phpcsFile->addError($error, $nextCase, 'SpacingAfter'.$type); + } + }//end if + + if ($tokens[$nextBreak]['code'] === T_BREAK) { + if ($type === 'Case') { + // Ensure empty CASE statements are not allowed. + // They must have some code content in them. A comment is not enough. + // But count RETURN statements as valid content if they also + // happen to close the CASE statement. + $foundContent = false; + for ($i = ($tokens[$nextCase]['scope_opener'] + 1); $i < $nextBreak; $i++) { + if ($tokens[$i]['code'] === T_CASE) { + $i = $tokens[$i]['scope_opener']; + continue; + } + + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { + $foundContent = true; + break; + } + } + + if ($foundContent === false) { + $error = 'Empty CASE statements are not allowed'; + $phpcsFile->addError($error, $nextCase, 'EmptyCase'); + } + } else { + // Ensure empty DEFAULT statements are not allowed. + // They must (at least) have a comment describing why + // the default case is being ignored. + $foundContent = false; + for ($i = ($tokens[$nextCase]['scope_opener'] + 1); $i < $nextBreak; $i++) { + if ($tokens[$i]['type'] !== 'T_WHITESPACE') { + $foundContent = true; + break; + } + } + + if ($foundContent === false) { + $error = 'Comment required for empty DEFAULT case'; + $phpcsFile->addError($error, $nextCase, 'EmptyDefault'); + } + }//end if + }//end if + } else if ($type === 'Default') { + $error = 'DEFAULT case must have a breaking statement'; + $phpcsFile->addError($error, $nextCase, 'DefaultNoBreak'); + }//end if + }//end while + + if ($foundDefault === false) { + $error = 'All SWITCH statements must contain a DEFAULT case'; + $phpcsFile->addError($error, $stackPtr, 'MissingDefault'); + } + + if ($tokens[$switch['scope_closer']]['column'] !== $switch['column']) { + $error = 'Closing brace of SWITCH statement must be aligned with SWITCH keyword'; + $phpcsFile->addError($error, $switch['scope_closer'], 'CloseBraceAlign'); + } + + if ($caseCount === 0) { + $error = 'SWITCH statements must contain at least one CASE statement'; + $phpcsFile->addError($error, $stackPtr, 'MissingCase'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php new file mode 100644 index 00000000..652391f1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php @@ -0,0 +1,88 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Common; + +class JSLintSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return int + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run. + */ + public function process(File $phpcsFile, $stackPtr) + { + $rhinoPath = Config::getExecutablePath('rhino'); + $jslintPath = Config::getExecutablePath('jslint'); + if ($rhinoPath === null || $jslintPath === null) { + return $phpcsFile->numTokens; + } + + $fileName = $phpcsFile->getFilename(); + + $rhinoPath = Common::escapeshellcmd($rhinoPath); + $jslintPath = Common::escapeshellcmd($jslintPath); + + $cmd = "$rhinoPath \"$jslintPath\" ".escapeshellarg($fileName); + exec($cmd, $output, $retval); + + if (is_array($output) === true) { + foreach ($output as $finding) { + $matches = []; + $numMatches = preg_match('/Lint at line ([0-9]+).*:(.*)$/', $finding, $matches); + if ($numMatches === 0) { + continue; + } + + $line = (int) $matches[1]; + $message = 'jslint says: '.trim($matches[2]); + $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); + } + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php new file mode 100644 index 00000000..031b2e39 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php @@ -0,0 +1,91 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Exceptions\RuntimeException; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Common; + +class JavaScriptLintSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @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 $phpcsFile->numTokens; + } + + $fileName = $phpcsFile->getFilename(); + + $cmd = '"'.Common::escapeshellcmd($jslPath).'" -nologo -nofilelisting -nocontext -nosummary -output-format __LINE__:__ERROR__ -process '.escapeshellarg($fileName); + $msg = exec($cmd, $output, $retval); + + // Variable $exitCode is the last line of $output if no error occurs, on + // error it is numeric. Try to handle various error conditions and + // provide useful error reporting. + if ($retval === 2 || $retval === 4) { + if (is_array($output) === true) { + $msg = implode('\n', $output); + } + + throw new RuntimeException("Failed invoking JavaScript Lint, retval was [$retval], output was [$msg]"); + } + + if (is_array($output) === true) { + foreach ($output as $finding) { + $split = strpos($finding, ':'); + $line = substr($finding, 0, $split); + $message = substr($finding, ($split + 1)); + $phpcsFile->addWarningOnLine(trim($message), $line, 'ExternalTool'); + } + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php new file mode 100644 index 00000000..aceecffd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php @@ -0,0 +1,68 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class FileExtensionSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $fileName = $phpcsFile->getFilename(); + $extension = substr($fileName, strrpos($fileName, '.')); + $nextClass = $phpcsFile->findNext([T_CLASS, T_INTERFACE, T_TRAIT, T_ENUM], $stackPtr); + + if ($nextClass !== false) { + $phpcsFile->recordMetric($stackPtr, 'File extension for class files', $extension); + if ($extension === '.php') { + $error = '%s found in ".php" file; use ".inc" extension instead'; + $data = [ucfirst($tokens[$nextClass]['content'])]; + $phpcsFile->addError($error, $stackPtr, 'ClassFound', $data); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'File extension for non-class files', $extension); + if ($extension === '.inc') { + $error = 'No interface or class found in ".inc" file; use ".php" extension instead'; + $phpcsFile->addError($error, $stackPtr, 'NoClass'); + } + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php new file mode 100644 index 00000000..b79e6b3e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php @@ -0,0 +1,395 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class OperatorBracketSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$operators; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if ($phpcsFile->tokenizerType === 'JS' && $tokens[$stackPtr]['code'] === T_PLUS) { + // JavaScript uses the plus operator for string concatenation as well + // so we cannot accurately determine if it is a string concat or addition. + // So just ignore it. + return; + } + + // If the & is a reference, then we don't want to check for brackets. + if ($tokens[$stackPtr]['code'] === T_BITWISE_AND && $phpcsFile->isReference($stackPtr) === true) { + return; + } + + // There is one instance where brackets aren't needed, which involves + // the minus sign being used to assign a negative number to a variable. + if ($tokens[$stackPtr]['code'] === T_MINUS) { + // Check to see if we are trying to return -n. + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$prev]['code'] === T_RETURN) { + return; + } + + $number = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$number]['code'] === T_LNUMBER || $tokens[$number]['code'] === T_DNUMBER) { + $previous = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($previous !== false) { + $isAssignment = isset(Tokens::$assignmentTokens[$tokens[$previous]['code']]); + $isEquality = isset(Tokens::$equalityTokens[$tokens[$previous]['code']]); + $isComparison = isset(Tokens::$comparisonTokens[$tokens[$previous]['code']]); + $isUnary = isset(Tokens::$operators[$tokens[$previous]['code']]); + if ($isAssignment === true || $isEquality === true || $isComparison === true || $isUnary === true) { + // This is a negative assignment or comparison. + // We need to check that the minus and the number are + // adjacent. + if (($number - $stackPtr) !== 1) { + $error = 'No space allowed between minus sign and number'; + $phpcsFile->addError($error, $stackPtr, 'SpacingAfterMinus'); + } + + return; + } + } + } + }//end if + + $previousToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true, null, true); + if ($previousToken !== false) { + // A list of tokens that indicate that the token is not + // part of an arithmetic operation. + $invalidTokens = [ + T_COMMA => true, + T_COLON => true, + T_OPEN_PARENTHESIS => true, + T_OPEN_SQUARE_BRACKET => true, + T_OPEN_CURLY_BRACKET => true, + T_OPEN_SHORT_ARRAY => true, + T_CASE => true, + T_EXIT => true, + T_MATCH_ARROW => true, + ]; + + if (isset($invalidTokens[$tokens[$previousToken]['code']]) === true) { + return; + } + } + + if ($tokens[$stackPtr]['code'] === T_BITWISE_OR + && isset($tokens[$stackPtr]['nested_parenthesis']) === true + ) { + $brackets = $tokens[$stackPtr]['nested_parenthesis']; + $lastBracket = array_pop($brackets); + if (isset($tokens[$lastBracket]['parenthesis_owner']) === true + && $tokens[$tokens[$lastBracket]['parenthesis_owner']]['code'] === T_CATCH + ) { + // This is a pipe character inside a catch statement, so it is acting + // as an exception type separator and not an arithmetic operation. + return; + } + } + + // Tokens that are allowed inside a bracketed operation. + $allowed = [ + T_VARIABLE, + T_LNUMBER, + T_DNUMBER, + T_STRING, + T_WHITESPACE, + T_NS_SEPARATOR, + T_THIS, + T_SELF, + T_STATIC, + T_PARENT, + T_OBJECT_OPERATOR, + T_NULLSAFE_OBJECT_OPERATOR, + T_DOUBLE_COLON, + T_OPEN_SQUARE_BRACKET, + T_CLOSE_SQUARE_BRACKET, + T_MODULUS, + T_NONE, + T_BITWISE_NOT, + ]; + + $allowed += Tokens::$operators; + + $lastBracket = false; + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $parenthesis = array_reverse($tokens[$stackPtr]['nested_parenthesis'], true); + foreach ($parenthesis as $bracket => $endBracket) { + $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($bracket - 1), null, true); + $prevCode = $tokens[$prevToken]['code']; + + if ($prevCode === T_ISSET) { + // This operation is inside an isset() call, but has + // no bracket of it's own. + break; + } + + if ($prevCode === T_STRING || $prevCode === T_SWITCH || $prevCode === T_MATCH) { + // We allow simple operations to not be bracketed. + // For example, ceil($one / $two). + for ($prev = ($stackPtr - 1); $prev > $bracket; $prev--) { + if (in_array($tokens[$prev]['code'], $allowed, true) === true) { + continue; + } + + if ($tokens[$prev]['code'] === T_CLOSE_PARENTHESIS) { + $prev = $tokens[$prev]['parenthesis_opener']; + } else { + break; + } + } + + if ($prev !== $bracket) { + break; + } + + for ($next = ($stackPtr + 1); $next < $endBracket; $next++) { + if (in_array($tokens[$next]['code'], $allowed, true) === true) { + continue; + } + + if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) { + $next = $tokens[$next]['parenthesis_closer']; + } else { + break; + } + } + + if ($next !== $endBracket) { + break; + } + }//end if + + if (in_array($prevCode, Tokens::$scopeOpeners, true) === true) { + // This operation is inside a control structure like FOREACH + // or IF, but has no bracket of it's own. + // The only control structures allowed to do this are SWITCH and MATCH. + if ($prevCode !== T_SWITCH && $prevCode !== T_MATCH) { + break; + } + } + + if ($prevCode === T_OPEN_PARENTHESIS) { + // These are two open parenthesis in a row. If the current + // one doesn't enclose the operator, go to the previous one. + if ($endBracket < $stackPtr) { + continue; + } + } + + $lastBracket = $bracket; + break; + }//end foreach + }//end if + + if ($lastBracket === false) { + // It is not in a bracketed statement at all. + $this->addMissingBracketsError($phpcsFile, $stackPtr); + return; + } else if ($tokens[$lastBracket]['parenthesis_closer'] < $stackPtr) { + // There are a set of brackets in front of it that don't include it. + $this->addMissingBracketsError($phpcsFile, $stackPtr); + return; + } else { + // We are enclosed in a set of bracket, so the last thing to + // check is that we are not also enclosed in square brackets + // like this: ($array[$index + 1]), which is invalid. + $brackets = [ + T_OPEN_SQUARE_BRACKET, + T_CLOSE_SQUARE_BRACKET, + ]; + + $squareBracket = $phpcsFile->findPrevious($brackets, ($stackPtr - 1), $lastBracket); + if ($squareBracket !== false && $tokens[$squareBracket]['code'] === T_OPEN_SQUARE_BRACKET) { + $closeSquareBracket = $phpcsFile->findNext($brackets, ($stackPtr + 1)); + if ($closeSquareBracket !== false && $tokens[$closeSquareBracket]['code'] === T_CLOSE_SQUARE_BRACKET) { + $this->addMissingBracketsError($phpcsFile, $stackPtr); + } + } + + return; + }//end if + + $lastAssignment = $phpcsFile->findPrevious(Tokens::$assignmentTokens, $stackPtr, null, false, null, true); + if ($lastAssignment !== false && $lastAssignment > $lastBracket) { + $this->addMissingBracketsError($phpcsFile, $stackPtr); + } + + }//end process() + + + /** + * Add and fix the missing brackets error. + * + * @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 addMissingBracketsError($phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $allowed = [ + T_VARIABLE => true, + T_LNUMBER => true, + T_DNUMBER => true, + T_STRING => true, + T_CONSTANT_ENCAPSED_STRING => true, + T_DOUBLE_QUOTED_STRING => true, + T_WHITESPACE => true, + T_NS_SEPARATOR => true, + T_THIS => true, + T_SELF => true, + T_STATIC => true, + T_OBJECT_OPERATOR => true, + T_NULLSAFE_OBJECT_OPERATOR => true, + T_DOUBLE_COLON => true, + T_MODULUS => true, + T_ISSET => true, + T_ARRAY => true, + T_NONE => true, + T_BITWISE_NOT => true, + ]; + + // Find the first token in the expression. + for ($before = ($stackPtr - 1); $before > 0; $before--) { + // Special case for plus operators because we can't tell if they are used + // for addition or string contact. So assume string concat to be safe. + if ($phpcsFile->tokenizerType === 'JS' && $tokens[$before]['code'] === T_PLUS) { + break; + } + + if (isset(Tokens::$emptyTokens[$tokens[$before]['code']]) === true + || isset(Tokens::$operators[$tokens[$before]['code']]) === true + || isset(Tokens::$castTokens[$tokens[$before]['code']]) === true + || isset($allowed[$tokens[$before]['code']]) === true + ) { + continue; + } + + if ($tokens[$before]['code'] === T_CLOSE_PARENTHESIS) { + $before = $tokens[$before]['parenthesis_opener']; + continue; + } + + if ($tokens[$before]['code'] === T_CLOSE_SQUARE_BRACKET) { + $before = $tokens[$before]['bracket_opener']; + continue; + } + + if ($tokens[$before]['code'] === T_CLOSE_SHORT_ARRAY) { + $before = $tokens[$before]['bracket_opener']; + continue; + } + + break; + }//end for + + $before = $phpcsFile->findNext(Tokens::$emptyTokens, ($before + 1), null, true); + + // A few extra tokens are allowed to be on the right side of the expression. + $allowed[T_EQUAL] = true; + $allowed[T_NEW] = true; + + // Find the last token in the expression. + for ($after = ($stackPtr + 1); $after < $phpcsFile->numTokens; $after++) { + // Special case for plus operators because we can't tell if they are used + // for addition or string concat. So assume string concat to be safe. + if ($phpcsFile->tokenizerType === 'JS' && $tokens[$after]['code'] === T_PLUS) { + break; + } + + if (isset(Tokens::$emptyTokens[$tokens[$after]['code']]) === true + || isset(Tokens::$operators[$tokens[$after]['code']]) === true + || isset(Tokens::$castTokens[$tokens[$after]['code']]) === true + || isset($allowed[$tokens[$after]['code']]) === true + ) { + continue; + } + + if ($tokens[$after]['code'] === T_OPEN_PARENTHESIS) { + $after = $tokens[$after]['parenthesis_closer']; + continue; + } + + if ($tokens[$after]['code'] === T_OPEN_SQUARE_BRACKET) { + $after = $tokens[$after]['bracket_closer']; + continue; + } + + if ($tokens[$after]['code'] === T_OPEN_SHORT_ARRAY) { + $after = $tokens[$after]['bracket_closer']; + continue; + } + + break; + }//end for + + $after = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($after - 1), null, true); + + $error = 'Operation must be bracketed'; + if ($before === $after || $before === $stackPtr || $after === $stackPtr) { + $phpcsFile->addError($error, $stackPtr, 'MissingBrackets'); + return; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MissingBrackets'); + if ($fix === true) { + // Can only fix this error if both tokens are available for fixing. + // Adding one bracket without the other will create parse errors. + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($before, '('.$tokens[$before]['content']); + $phpcsFile->fixer->replaceToken($after, $tokens[$after]['content'].')'); + $phpcsFile->fixer->endChangeset(); + } + + }//end addMissingBracketsError() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php new file mode 100644 index 00000000..7357a507 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php @@ -0,0 +1,398 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class FunctionDeclarationArgumentSpacingSniff implements Sniff +{ + + /** + * How many spaces should surround the equals signs. + * + * @var integer + */ + public $equalsSpacing = 0; + + /** + * How many spaces should follow the opening bracket. + * + * @var integer + */ + public $requiredSpacesAfterOpen = 0; + + /** + * How many spaces should precede the closing bracket. + * + * @var integer + */ + public $requiredSpacesBeforeClose = 0; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + T_FN, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false + || isset($tokens[$stackPtr]['parenthesis_closer']) === false + || $tokens[$stackPtr]['parenthesis_opener'] === null + || $tokens[$stackPtr]['parenthesis_closer'] === null + ) { + return; + } + + $this->equalsSpacing = (int) $this->equalsSpacing; + $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; + $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; + + $this->processBracket($phpcsFile, $tokens[$stackPtr]['parenthesis_opener']); + + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($tokens[$stackPtr]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1), null); + $this->processBracket($phpcsFile, $openBracket); + } + } + + }//end process() + + + /** + * Processes the contents of a single set of brackets. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $openBracket The position of the open bracket + * in the stack. + * + * @return void + */ + public function processBracket($phpcsFile, $openBracket) + { + $tokens = $phpcsFile->getTokens(); + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + $multiLine = ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']); + + if (isset($tokens[$openBracket]['parenthesis_owner']) === true) { + $stackPtr = $tokens[$openBracket]['parenthesis_owner']; + } else { + $stackPtr = $phpcsFile->findPrevious(T_USE, ($openBracket - 1)); + } + + $params = $phpcsFile->getMethodParameters($stackPtr); + + if (empty($params) === true) { + // Check spacing around parenthesis. + $next = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), $closeBracket, true); + if ($next === false) { + if (($closeBracket - $openBracket) !== 1) { + if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($openBracket + 1)]['length']; + } + + $error = 'Expected 0 spaces between parenthesis of function declaration; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $openBracket, 'SpacingBetween', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); + } + } + + // No params, so we don't check normal spacing rules. + return; + } + }//end if + + foreach ($params as $paramNumber => $param) { + if ($param['pass_by_reference'] === true) { + $refToken = $param['reference_token']; + + $gap = 0; + if ($tokens[($refToken + 1)]['code'] === T_WHITESPACE) { + $gap = $tokens[($refToken + 1)]['length']; + } + + if ($gap !== 0) { + $error = 'Expected 0 spaces after reference operator for argument "%s"; %s found'; + $data = [ + $param['name'], + $gap, + ]; + $fix = $phpcsFile->addFixableError($error, $refToken, 'SpacingAfterReference', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($refToken + 1), ''); + } + } + }//end if + + if ($param['variable_length'] === true) { + $variadicToken = $param['variadic_token']; + + $gap = 0; + if ($tokens[($variadicToken + 1)]['code'] === T_WHITESPACE) { + $gap = $tokens[($variadicToken + 1)]['length']; + } + + if ($gap !== 0) { + $error = 'Expected 0 spaces after variadic operator for argument "%s"; %s found'; + $data = [ + $param['name'], + $gap, + ]; + $fix = $phpcsFile->addFixableError($error, $variadicToken, 'SpacingAfterVariadic', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($variadicToken + 1), ''); + } + } + }//end if + + if (isset($param['default_equal_token']) === true) { + $equalToken = $param['default_equal_token']; + + $spacesBefore = 0; + if (($equalToken - $param['token']) > 1) { + $spacesBefore = $tokens[($param['token'] + 1)]['length']; + } + + if ($spacesBefore !== $this->equalsSpacing) { + $error = 'Incorrect spacing between argument "%s" and equals sign; expected '.$this->equalsSpacing.' but found %s'; + $data = [ + $param['name'], + $spacesBefore, + ]; + + $fix = $phpcsFile->addFixableError($error, $equalToken, 'SpaceBeforeEquals', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->equalsSpacing); + if ($spacesBefore === 0) { + $phpcsFile->fixer->addContentBefore($equalToken, $padding); + } else { + $phpcsFile->fixer->replaceToken(($equalToken - 1), $padding); + } + } + }//end if + + $spacesAfter = 0; + if ($tokens[($equalToken + 1)]['code'] === T_WHITESPACE) { + $spacesAfter = $tokens[($equalToken + 1)]['length']; + } + + if ($spacesAfter !== $this->equalsSpacing) { + $error = 'Incorrect spacing between default value and equals sign for argument "%s"; expected '.$this->equalsSpacing.' but found %s'; + $data = [ + $param['name'], + $spacesAfter, + ]; + + $fix = $phpcsFile->addFixableError($error, $equalToken, 'SpaceAfterEquals', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->equalsSpacing); + if ($spacesAfter === 0) { + $phpcsFile->fixer->addContent($equalToken, $padding); + } else { + $phpcsFile->fixer->replaceToken(($equalToken + 1), $padding); + } + } + }//end if + }//end if + + if ($param['type_hint_token'] !== false) { + $typeHintToken = $param['type_hint_end_token']; + + $gap = 0; + if ($tokens[($typeHintToken + 1)]['code'] === T_WHITESPACE) { + $gap = $tokens[($typeHintToken + 1)]['length']; + } + + if ($gap !== 1) { + $error = 'Expected 1 space between type hint and argument "%s"; %s found'; + $data = [ + $param['name'], + $gap, + ]; + $fix = $phpcsFile->addFixableError($error, $typeHintToken, 'SpacingAfterHint', $data); + if ($fix === true) { + if ($gap === 0) { + $phpcsFile->fixer->addContent($typeHintToken, ' '); + } else { + $phpcsFile->fixer->replaceToken(($typeHintToken + 1), ' '); + } + } + } + }//end if + + $commaToken = false; + if ($paramNumber > 0 && $params[($paramNumber - 1)]['comma_token'] !== false) { + $commaToken = $params[($paramNumber - 1)]['comma_token']; + } + + if ($commaToken !== false) { + if ($tokens[($commaToken - 1)]['code'] === T_WHITESPACE) { + $error = 'Expected 0 spaces between argument "%s" and comma; %s found'; + $data = [ + $params[($paramNumber - 1)]['name'], + $tokens[($commaToken - 1)]['length'], + ]; + + $fix = $phpcsFile->addFixableError($error, $commaToken, 'SpaceBeforeComma', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($commaToken - 1), ''); + } + } + + // Don't check spacing after the comma if it is the last content on the line. + $checkComma = true; + if ($multiLine === true) { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($commaToken + 1), $closeBracket, true); + if ($tokens[$next]['line'] !== $tokens[$commaToken]['line']) { + $checkComma = false; + } + } + + if ($checkComma === true) { + if ($param['type_hint_token'] === false) { + $spacesAfter = 0; + if ($tokens[($commaToken + 1)]['code'] === T_WHITESPACE) { + $spacesAfter = $tokens[($commaToken + 1)]['length']; + } + + if ($spacesAfter === 0) { + $error = 'Expected 1 space between comma and argument "%s"; 0 found'; + $data = [$param['name']]; + $fix = $phpcsFile->addFixableError($error, $commaToken, 'NoSpaceBeforeArg', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($commaToken, ' '); + } + } else if ($spacesAfter !== 1) { + $error = 'Expected 1 space between comma and argument "%s"; %s found'; + $data = [ + $param['name'], + $spacesAfter, + ]; + + $fix = $phpcsFile->addFixableError($error, $commaToken, 'SpacingBeforeArg', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($commaToken + 1), ' '); + } + }//end if + } else { + $hint = $phpcsFile->getTokensAsString($param['type_hint_token'], (($param['type_hint_end_token'] - $param['type_hint_token']) + 1)); + if ($param['nullable_type'] === true) { + $hint = '?'.$hint; + } + + if ($tokens[($commaToken + 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space between comma and type hint "%s"; 0 found'; + $data = [$hint]; + $fix = $phpcsFile->addFixableError($error, $commaToken, 'NoSpaceBeforeHint', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($commaToken, ' '); + } + } else { + $gap = $tokens[($commaToken + 1)]['length']; + if ($gap !== 1) { + $error = 'Expected 1 space between comma and type hint "%s"; %s found'; + $data = [ + $hint, + $gap, + ]; + $fix = $phpcsFile->addFixableError($error, $commaToken, 'SpacingBeforeHint', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($commaToken + 1), ' '); + } + } + }//end if + }//end if + }//end if + }//end if + }//end foreach + + // Only check spacing around parenthesis for single line definitions. + if ($multiLine === true) { + return; + } + + $gap = 0; + if ($tokens[($closeBracket - 1)]['code'] === T_WHITESPACE) { + $gap = $tokens[($closeBracket - 1)]['length']; + } + + if ($gap !== $this->requiredSpacesBeforeClose) { + $error = 'Expected %s spaces before closing parenthesis; %s found'; + $data = [ + $this->requiredSpacesBeforeClose, + $gap, + ]; + $fix = $phpcsFile->addFixableError($error, $closeBracket, 'SpacingBeforeClose', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); + if ($gap === 0) { + $phpcsFile->fixer->addContentBefore($closeBracket, $padding); + } else { + $phpcsFile->fixer->replaceToken(($closeBracket - 1), $padding); + } + } + } + + $gap = 0; + if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { + $gap = $tokens[($openBracket + 1)]['length']; + } + + if ($gap !== $this->requiredSpacesAfterOpen) { + $error = 'Expected %s spaces after opening parenthesis; %s found'; + $data = [ + $this->requiredSpacesAfterOpen, + $gap, + ]; + $fix = $phpcsFile->addFixableError($error, $openBracket, 'SpacingAfterOpen', $data); + if ($fix === true) { + $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); + if ($gap === 0) { + $phpcsFile->fixer->addContent($openBracket, $padding); + } else { + $phpcsFile->fixer->replaceToken(($openBracket + 1), $padding); + } + } + } + + }//end processBracket() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php new file mode 100644 index 00000000..fdb391c2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php @@ -0,0 +1,34 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; + +use PHP_CodeSniffer\Sniffs\AbstractPatternSniff; + +class FunctionDeclarationSniff extends AbstractPatternSniff +{ + + + /** + * Returns an array of patterns to check are correct. + * + * @return array + */ + protected function getPatterns() + { + return [ + 'function abc(...);', + 'function abc(...)', + 'abstract function abc(...);', + ]; + + }//end getPatterns() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php new file mode 100644 index 00000000..5eafbfdb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php @@ -0,0 +1,64 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class FunctionDuplicateArgumentSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + + $foundVariables = []; + for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { + if ($tokens[$i]['code'] === T_VARIABLE) { + $variable = $tokens[$i]['content']; + if (in_array($variable, $foundVariables, true) === true) { + $error = 'Variable "%s" appears more than once in function declaration'; + $data = [$variable]; + $phpcsFile->addError($error, $i, 'Found', $data); + } else { + $foundVariables[] = $variable; + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php new file mode 100644 index 00000000..af3d902e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php @@ -0,0 +1,61 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class GlobalFunctionSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (empty($tokens[$stackPtr]['conditions']) === true) { + $functionName = $phpcsFile->getDeclarationName($stackPtr); + if ($functionName === null) { + return; + } + + // Special exception for __autoload as it needs to be global. + if ($functionName !== '__autoload') { + $error = 'Consider putting global function "%s" in a static class'; + $data = [$functionName]; + $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php new file mode 100644 index 00000000..401b840c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php @@ -0,0 +1,69 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class LowercaseFunctionKeywordsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + $tokens = Tokens::$methodPrefixes; + $tokens[] = T_FUNCTION; + $tokens[] = T_CLOSURE; + $tokens[] = T_FN; + + return $tokens; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 ($content !== $contentLc) { + $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; + $data = [ + strtoupper($content), + $contentLc, + $content, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php new file mode 100644 index 00000000..61d23ce2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php @@ -0,0 +1,257 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; + +use PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff as PEARFunctionDeclarationSniff; +use PHP_CodeSniffer\Util\Tokens; + +class MultiLineFunctionDeclarationSniff extends PEARFunctionDeclarationSniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Determine if this is a multi-line function declaration. + * + * @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 $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return bool + */ + public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) + { + $bracketsToCheck = [$stackPtr => $openBracket]; + + // Closures may use the USE keyword and so be multi-line in this way. + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($tokens[$openBracket]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + if ($open !== false) { + $bracketsToCheck[$use] = $open; + } + } + } + + foreach ($bracketsToCheck as $stackPtr => $openBracket) { + // If the first argument is on a new line, this is a multi-line + // function declaration, even if there is only one argument. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); + if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { + return true; + } + + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + + $end = $phpcsFile->findEndOfStatement($openBracket + 1); + while ($tokens[$end]['code'] === T_COMMA) { + // If the next bit of code is not on the same line, this is a + // multi-line function declaration. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); + if ($next === false) { + continue(2); + } + + if ($tokens[$next]['line'] !== $tokens[$end]['line']) { + return true; + } + + $end = $phpcsFile->findEndOfStatement($next); + } + + // We've reached the last argument, so see if the next content + // (should be the close bracket) is also on the same line. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); + if ($next !== false && $tokens[$next]['line'] !== $tokens[$end]['line']) { + return true; + } + }//end foreach + + return false; + + }//end isMultiLineDeclaration() + + + /** + * Processes single-line declarations. + * + * Just uses the Generic BSD-Allman brace sniff. + * + * @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 array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens) + { + // We do everything the parent sniff does, and a bit more because we + // define multi-line declarations a bit differently. + parent::processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens); + + $openingBracket = $tokens[$stackPtr]['parenthesis_opener']; + $closingBracket = $tokens[$stackPtr]['parenthesis_closer']; + + $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingBracket - 1), $openingBracket, true); + if ($tokens[$prevNonWhiteSpace]['line'] !== $tokens[$closingBracket]['line']) { + $error = 'There must not be a newline before the closing parenthesis of a single-line function declaration'; + + if (isset(Tokens::$emptyTokens[$tokens[$prevNonWhiteSpace]['code']]) === true) { + $phpcsFile->addError($error, $closingBracket, 'CloseBracketNewLine'); + } else { + $fix = $phpcsFile->addFixableError($error, $closingBracket, 'CloseBracketNewLine'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($closingBracket - 1); $i > $openingBracket; $i--) { + if ($tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + + }//end processSingleLineDeclaration() + + + /** + * Processes multi-line declarations. + * + * @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 array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens) + { + // We do everything the parent sniff does, and a bit more. + parent::processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens); + + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + $this->processBracket($phpcsFile, $openBracket, $tokens, 'function'); + + if ($tokens[$stackPtr]['code'] !== T_CLOSURE) { + return; + } + + $use = $phpcsFile->findNext(T_USE, ($tokens[$stackPtr]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); + if ($use === false) { + return; + } + + $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1), null); + $this->processBracket($phpcsFile, $openBracket, $tokens, 'use'); + + }//end processMultiLineDeclaration() + + + /** + * Processes the contents of a single set of brackets. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $openBracket The position of the open bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * @param string $type The type of the token the brackets + * belong to (function or use). + * + * @return void + */ + public function processBracket($phpcsFile, $openBracket, $tokens, $type='function') + { + $errorPrefix = ''; + if ($type === 'use') { + $errorPrefix = 'Use'; + } + + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + + // The open bracket should be the last thing on the line. + if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); + if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { + $error = 'The first parameter of a multi-line '.$type.' declaration must be on the line after the opening bracket'; + $fix = $phpcsFile->addFixableError($error, $next, $errorPrefix.'FirstParamSpacing'); + if ($fix === true) { + if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { + $phpcsFile->fixer->addNewline($openBracket); + } else { + $phpcsFile->fixer->beginChangeset(); + for ($x = $openBracket; $x < $next; $x++) { + if ($tokens[$x]['line'] === $tokens[$openBracket]['line']) { + continue; + } + + if ($tokens[$x]['line'] === $tokens[$next]['line']) { + break; + } + } + + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + }//end if + + // Each line between the brackets should contain a single parameter. + for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { + // Skip brackets, like arrays, as they can contain commas. + if (isset($tokens[$i]['bracket_opener']) === true) { + $i = $tokens[$i]['bracket_closer']; + continue; + } + + if (isset($tokens[$i]['parenthesis_opener']) === true) { + $i = $tokens[$i]['parenthesis_closer']; + continue; + } + + if ($tokens[$i]['code'] !== T_COMMA) { + continue; + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); + if ($tokens[$next]['line'] === $tokens[$i]['line']) { + $error = 'Multi-line '.$type.' declarations must define one parameter per line'; + $fix = $phpcsFile->addFixableError($error, $next, $errorPrefix.'OneParamPerLine'); + if ($fix === true) { + $phpcsFile->fixer->addNewline($i); + } + } + }//end for + + }//end processBracket() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php new file mode 100644 index 00000000..2450ba7f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php @@ -0,0 +1,54 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff as PEARValidFunctionNameSniff; +use PHP_CodeSniffer\Util\Common; + +class ValidFunctionNameSniff extends PEARValidFunctionNameSniff +{ + + + /** + * Processes the tokens outside the scope. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. + * @param int $stackPtr The position where this token was + * found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + $functionName = $phpcsFile->getDeclarationName($stackPtr); + if ($functionName === null) { + return; + } + + $errorData = [$functionName]; + + // Does this function claim to be magical? + if (preg_match('|^__[^_]|', $functionName) !== 0) { + $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; + $phpcsFile->addError($error, $stackPtr, 'DoubleUnderscore', $errorData); + + $functionName = ltrim($functionName, '_'); + } + + if (Common::isCamelCaps($functionName, false, true, false) === false) { + $error = 'Function name "%s" is not in camel caps format'; + $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); + } + + }//end processTokenOutsideScope() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php new file mode 100644 index 00000000..79f9c4b2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php @@ -0,0 +1,190 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; +use PHP_CodeSniffer\Util\Common; +use PHP_CodeSniffer\Util\Tokens; + +class ValidVariableNameSniff extends AbstractVariableSniff +{ + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + protected function processVariable(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $varName = ltrim($tokens[$stackPtr]['content'], '$'); + + // If it's a php reserved var, then its ok. + if (isset($this->phpReservedVars[$varName]) === true) { + return; + } + + $objOperator = $phpcsFile->findNext([T_WHITESPACE], ($stackPtr + 1), null, true); + if ($tokens[$objOperator]['code'] === T_OBJECT_OPERATOR + || $tokens[$objOperator]['code'] === T_NULLSAFE_OBJECT_OPERATOR + ) { + // Check to see if we are using a variable from an object. + $var = $phpcsFile->findNext([T_WHITESPACE], ($objOperator + 1), null, true); + if ($tokens[$var]['code'] === T_STRING) { + $bracket = $phpcsFile->findNext([T_WHITESPACE], ($var + 1), null, true); + if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) { + $objVarName = $tokens[$var]['content']; + + // There is no way for us to know if the var is public or + // private, so we have to ignore a leading underscore if there is + // one and just check the main part of the variable name. + $originalVarName = $objVarName; + if (substr($objVarName, 0, 1) === '_') { + $objVarName = substr($objVarName, 1); + } + + if (Common::isCamelCaps($objVarName, false, true, false) === false) { + $error = 'Member variable "%s" is not in valid camel caps format'; + $data = [$originalVarName]; + $phpcsFile->addError($error, $var, 'MemberNotCamelCaps', $data); + } + }//end if + }//end if + }//end if + + $objOperator = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$objOperator]['code'] === T_DOUBLE_COLON) { + // The variable lives within a class, and is referenced like + // this: MyClass::$_variable, so we don't know its scope. + $objVarName = $varName; + if (substr($objVarName, 0, 1) === '_') { + $objVarName = substr($objVarName, 1); + } + + if (Common::isCamelCaps($objVarName, false, true, false) === false) { + $error = 'Member variable "%s" is not in valid camel caps format'; + $data = [$tokens[$stackPtr]['content']]; + $phpcsFile->addError($error, $stackPtr, 'MemberNotCamelCaps', $data); + } + + return; + } + + // There is no way for us to know if the var is public or private, + // so we have to ignore a leading underscore if there is one and just + // check the main part of the variable name. + $originalVarName = $varName; + if (substr($varName, 0, 1) === '_') { + $inClass = $phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens); + if ($inClass === true) { + $varName = substr($varName, 1); + } + } + + if (Common::isCamelCaps($varName, false, true, false) === false) { + $error = 'Variable "%s" is not in valid camel caps format'; + $data = [$originalVarName]; + $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); + } + + }//end processVariable() + + + /** + * Processes class member variables. + * + * @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 + */ + protected function processMemberVar(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $varName = ltrim($tokens[$stackPtr]['content'], '$'); + $memberProps = $phpcsFile->getMemberProperties($stackPtr); + if (empty($memberProps) === true) { + // Couldn't get any info about this variable, which + // generally means it is invalid or possibly has a parse + // error. Any errors will be reported by the core, so + // we can ignore it. + return; + } + + $public = ($memberProps['scope'] !== 'private'); + $errorData = [$varName]; + + if ($public === true) { + if (substr($varName, 0, 1) === '_') { + $error = '%s member variable "%s" must not contain a leading underscore'; + $data = [ + ucfirst($memberProps['scope']), + $errorData[0], + ]; + $phpcsFile->addError($error, $stackPtr, 'PublicHasUnderscore', $data); + } + } else { + if (substr($varName, 0, 1) !== '_') { + $error = 'Private member variable "%s" must contain a leading underscore'; + $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $errorData); + } + } + + // Remove a potential underscore prefix for testing CamelCaps. + $varName = ltrim($varName, '_'); + + if (Common::isCamelCaps($varName, false, true, false) === false) { + $error = 'Member variable "%s" is not in valid camel caps format'; + $phpcsFile->addError($error, $stackPtr, 'MemberNotCamelCaps', $errorData); + } + + }//end processMemberVar() + + + /** + * Processes the variable found within a double quoted string. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the double quoted + * string. + * + * @return void + */ + protected function processVariableInString(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (preg_match_all('|[^\\\]\${?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|', $tokens[$stackPtr]['content'], $matches) !== 0) { + foreach ($matches[1] as $varName) { + // If it's a php reserved var, then its ok. + if (isset($this->phpReservedVars[$varName]) === true) { + continue; + } + + if (Common::isCamelCaps($varName, false, true, false) === false) { + $error = 'Variable "%s" is not in valid camel caps format'; + $data = [$varName]; + $phpcsFile->addError($error, $stackPtr, 'StringNotCamelCaps', $data); + } + } + } + + }//end processVariableInString() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php new file mode 100644 index 00000000..b619924e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php @@ -0,0 +1,87 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DisallowObjectStringIndexSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_SQUARE_BRACKET]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Check if the next non whitespace token is a string. + $index = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$index]['code'] !== T_CONSTANT_ENCAPSED_STRING) { + return; + } + + // Make sure it is the only thing in the square brackets. + $next = $phpcsFile->findNext(T_WHITESPACE, ($index + 1), null, true); + if ($tokens[$next]['code'] !== T_CLOSE_SQUARE_BRACKET) { + return; + } + + // Allow indexes that have dots in them because we can't write + // them in dot notation. + $content = trim($tokens[$index]['content'], '"\' '); + if (strpos($content, '.') !== false) { + return; + } + + // Also ignore reserved words. + if ($content === 'super') { + return; + } + + // Token before the opening square bracket cannot be a var name. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$prev]['code'] === T_STRING) { + $error = 'Object indexes must be written in dot notation'; + $phpcsFile->addError($error, $prev, 'Found'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php new file mode 100644 index 00000000..d408a07c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php @@ -0,0 +1,85 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ObjectInstantiationSniff implements Sniff +{ + + + /** + * Registers the token types that this sniff wishes to listen to. + * + * @return array + */ + public function register() + { + return [T_NEW]; + + }//end register() + + + /** + * Process the tokens that this sniff is listening for. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $allowedTokens = Tokens::$emptyTokens; + $allowedTokens[] = T_BITWISE_AND; + + $prev = $phpcsFile->findPrevious($allowedTokens, ($stackPtr - 1), null, true); + + $allowedTokens = [ + T_EQUAL => T_EQUAL, + T_COALESCE_EQUAL => T_COALESCE_EQUAL, + T_DOUBLE_ARROW => T_DOUBLE_ARROW, + T_FN_ARROW => T_FN_ARROW, + T_MATCH_ARROW => T_MATCH_ARROW, + T_THROW => T_THROW, + T_RETURN => T_RETURN, + ]; + + if (isset($allowedTokens[$tokens[$prev]['code']]) === true) { + return; + } + + $ternaryLikeTokens = [ + T_COALESCE => true, + T_INLINE_THEN => true, + T_INLINE_ELSE => true, + ]; + + // For ternary like tokens, walk a little further back to see if it is preceded by + // one of the allowed tokens (within the same statement). + if (isset($ternaryLikeTokens[$tokens[$prev]['code']]) === true) { + $hasAllowedBefore = $phpcsFile->findPrevious($allowedTokens, ($prev - 1), null, false, null, true); + if ($hasAllowedBefore !== false) { + return; + } + } + + $error = 'New objects must be assigned to a variable'; + $phpcsFile->addError($error, $stackPtr, 'NotAssigned'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php new file mode 100644 index 00000000..dbbc1b84 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php @@ -0,0 +1,66 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ObjectMemberCommaSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Registers the token types that this sniff wishes to listen to. + * + * @return array + */ + public function register() + { + return [T_CLOSE_OBJECT]; + + }//end register() + + + /** + * Process the tokens that this sniff is listening for. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$prev]['code'] === T_COMMA) { + $error = 'Last member of object must not be followed by a comma'; + $fix = $phpcsFile->addFixableError($error, $prev, 'Found'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($prev, ''); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php new file mode 100644 index 00000000..e9b41d69 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php @@ -0,0 +1,235 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ComparisonOperatorUsageSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * A list of valid comparison operators. + * + * @var array + */ + private static $validOps = [ + T_IS_IDENTICAL => true, + T_IS_NOT_IDENTICAL => true, + T_LESS_THAN => true, + T_GREATER_THAN => true, + T_IS_GREATER_OR_EQUAL => true, + T_IS_SMALLER_OR_EQUAL => true, + T_INSTANCEOF => true, + ]; + + /** + * A list of invalid operators with their alternatives. + * + * @var array> + */ + private static $invalidOps = [ + 'PHP' => [ + T_IS_EQUAL => '===', + T_IS_NOT_EQUAL => '!==', + T_BOOLEAN_NOT => '=== FALSE', + ], + 'JS' => [ + T_IS_EQUAL => '===', + T_IS_NOT_EQUAL => '!==', + ], + ]; + + + /** + * Registers the token types that this sniff wishes to listen to. + * + * @return array + */ + public function register() + { + return [ + T_IF, + T_ELSEIF, + T_INLINE_THEN, + T_WHILE, + T_FOR, + ]; + + }//end register() + + + /** + * Process the tokens that this sniff is listening for. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where the token + * was found. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $tokenizer = $phpcsFile->tokenizerType; + + if ($tokens[$stackPtr]['code'] === T_INLINE_THEN) { + $end = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$end]['code'] !== T_CLOSE_PARENTHESIS) { + // This inline IF statement does not have its condition + // bracketed, so we need to guess where it starts. + for ($i = ($end - 1); $i >= 0; $i--) { + if ($tokens[$i]['code'] === T_SEMICOLON) { + // Stop here as we assume it is the end + // of the previous statement. + break; + } else if ($tokens[$i]['code'] === T_OPEN_TAG) { + // Stop here as this is the start of the file. + break; + } else if ($tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET) { + // Stop if this is the closing brace of + // a code block. + if (isset($tokens[$i]['scope_opener']) === true) { + break; + } + } else if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { + // Stop if this is the opening brace of + // a code block. + if (isset($tokens[$i]['scope_closer']) === true) { + break; + } + } else if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { + // Stop if this is the start of a pair of + // parentheses that surrounds the inline + // IF statement. + if (isset($tokens[$i]['parenthesis_closer']) === true + && $tokens[$i]['parenthesis_closer'] >= $stackPtr + ) { + break; + } + }//end if + }//end for + + $start = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); + } else { + if (isset($tokens[$end]['parenthesis_opener']) === false) { + return; + } + + $start = $tokens[$end]['parenthesis_opener']; + }//end if + } else if ($tokens[$stackPtr]['code'] === T_FOR) { + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { + return; + } + + $openingBracket = $tokens[$stackPtr]['parenthesis_opener']; + $closingBracket = $tokens[$stackPtr]['parenthesis_closer']; + + $start = $phpcsFile->findNext(T_SEMICOLON, $openingBracket, $closingBracket); + $end = $phpcsFile->findNext(T_SEMICOLON, ($start + 1), $closingBracket); + if ($start === false || $end === false) { + return; + } + } else { + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { + return; + } + + $start = $tokens[$stackPtr]['parenthesis_opener']; + $end = $tokens[$stackPtr]['parenthesis_closer']; + }//end if + + $requiredOps = 0; + $foundOps = 0; + $foundBooleans = 0; + + $lastNonEmpty = $start; + + for ($i = $start; $i <= $end; $i++) { + $type = $tokens[$i]['code']; + if (isset(self::$invalidOps[$tokenizer][$type]) === true) { + $error = 'Operator %s prohibited; use %s instead'; + $data = [ + $tokens[$i]['content'], + self::$invalidOps[$tokenizer][$type], + ]; + $phpcsFile->addError($error, $i, 'NotAllowed', $data); + $foundOps++; + } else if (isset(self::$validOps[$type]) === true) { + $foundOps++; + } + + if ($type === T_OPEN_PARENTHESIS + && isset($tokens[$i]['parenthesis_closer']) === true + && isset(Tokens::$functionNameTokens[$tokens[$lastNonEmpty]['code']]) === true + ) { + $i = $tokens[$i]['parenthesis_closer']; + $lastNonEmpty = $i; + continue; + } + + if ($tokens[$i]['code'] === T_TRUE || $tokens[$i]['code'] === T_FALSE) { + $foundBooleans++; + } + + if ($phpcsFile->tokenizerType !== 'JS' + && ($tokens[$i]['code'] === T_BOOLEAN_AND + || $tokens[$i]['code'] === T_BOOLEAN_OR) + ) { + $requiredOps++; + + // When the instanceof operator is used with another operator + // like ===, you can get more ops than are required. + if ($foundOps > $requiredOps) { + $foundOps = $requiredOps; + } + + // If we get to here and we have not found the right number of + // comparison operators, then we must have had an implicit + // true operation i.e., if ($a) instead of the required + // if ($a === true), so let's add an error. + if ($requiredOps !== $foundOps) { + $error = 'Implicit true comparisons prohibited; use === TRUE instead'; + $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); + $foundOps++; + } + } + + if (isset(Tokens::$emptyTokens[$type]) === false) { + $lastNonEmpty = $i; + } + }//end for + + $requiredOps++; + + if ($phpcsFile->tokenizerType !== 'JS' + && $foundOps < $requiredOps + && ($requiredOps !== $foundBooleans) + ) { + $error = 'Implicit true comparisons prohibited; use === TRUE instead'; + $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php new file mode 100644 index 00000000..a39e44e1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php @@ -0,0 +1,231 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class IncrementDecrementUsageSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_EQUAL, + T_PLUS_EQUAL, + T_MINUS_EQUAL, + T_INC, + T_DEC, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if ($tokens[$stackPtr]['code'] === T_INC || $tokens[$stackPtr]['code'] === T_DEC) { + $this->processIncDec($phpcsFile, $stackPtr); + } else { + $this->processAssignment($phpcsFile, $stackPtr); + } + + }//end process() + + + /** + * Checks to ensure increment and decrement operators are not confusing. + * + * @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 + */ + protected function processIncDec($phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Work out where the variable is so we know where to + // start looking for other operators. + if ($tokens[($stackPtr - 1)]['code'] === T_VARIABLE + || ($tokens[($stackPtr - 1)]['code'] === T_STRING + && ($tokens[($stackPtr - 2)]['code'] === T_OBJECT_OPERATOR + || $tokens[($stackPtr - 2)]['code'] === T_NULLSAFE_OBJECT_OPERATOR)) + ) { + $start = ($stackPtr + 1); + } else { + $start = ($stackPtr + 2); + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, $start, null, true); + if ($next === false) { + return; + } + + if (isset(Tokens::$arithmeticTokens[$tokens[$next]['code']]) === true) { + $error = 'Increment and decrement operators cannot be used in an arithmetic operation'; + $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); + return; + } + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($start - 3), null, true); + if ($prev === false) { + return; + } + + // Check if this is in a string concat. + if ($tokens[$next]['code'] === T_STRING_CONCAT || $tokens[$prev]['code'] === T_STRING_CONCAT) { + $error = 'Increment and decrement operators must be bracketed when used in string concatenation'; + $phpcsFile->addError($error, $stackPtr, 'NoBrackets'); + } + + }//end processIncDec() + + + /** + * Checks to ensure increment and decrement operators are used. + * + * @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 + */ + protected function processAssignment($phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $assignedVar = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + // Not an assignment, return. + if ($tokens[$assignedVar]['code'] !== T_VARIABLE) { + return; + } + + $statementEnd = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_PARENTHESIS, T_CLOSE_SQUARE_BRACKET, T_CLOSE_CURLY_BRACKET], $stackPtr); + + // If there is anything other than variables, numbers, spaces or operators we need to return. + $find = Tokens::$emptyTokens; + $find[] = T_LNUMBER; + $find[] = T_VARIABLE; + $find[] = T_PLUS; + $find[] = T_MINUS; + $find[] = T_OPEN_PARENTHESIS; + + $noiseTokens = $phpcsFile->findNext($find, ($stackPtr + 1), $statementEnd, true); + if ($noiseTokens !== false) { + return; + } + + // If we are already using += or -=, we need to ignore + // the statement if a variable is being used. + if ($tokens[$stackPtr]['code'] !== T_EQUAL) { + $nextVar = $phpcsFile->findNext(T_VARIABLE, ($stackPtr + 1), $statementEnd); + if ($nextVar !== false) { + return; + } + } + + if ($tokens[$stackPtr]['code'] === T_EQUAL) { + $nextVar = $stackPtr; + $previousVariable = $stackPtr; + $variableCount = 0; + while (($nextVar = $phpcsFile->findNext(T_VARIABLE, ($nextVar + 1), $statementEnd)) !== false) { + $previousVariable = $nextVar; + $variableCount++; + } + + if ($variableCount !== 1) { + return; + } + + $nextVar = $previousVariable; + if ($tokens[$nextVar]['content'] !== $tokens[$assignedVar]['content']) { + return; + } + } + + // We have only one variable, and it's the same as what is being assigned, + // so we need to check what is being added or subtracted. + $nextNumber = $stackPtr; + $previousNumber = $stackPtr; + $numberCount = 0; + while (($nextNumber = $phpcsFile->findNext([T_LNUMBER], ($nextNumber + 1), $statementEnd, false)) !== false) { + $previousNumber = $nextNumber; + $numberCount++; + } + + if ($numberCount !== 1) { + return; + } + + $nextNumber = $previousNumber; + if ($tokens[$nextNumber]['content'] === '1') { + if ($tokens[$stackPtr]['code'] === T_EQUAL) { + $opToken = $phpcsFile->findNext([T_PLUS, T_MINUS], ($nextVar + 1), $statementEnd); + if ($opToken === false) { + // Operator was before the variable, like: + // $var = 1 + $var; + // So we ignore it. + return; + } + + $operator = $tokens[$opToken]['content']; + } else { + $operator = substr($tokens[$stackPtr]['content'], 0, 1); + } + + // If we are adding or subtracting negative value, the operator + // needs to be reversed. + if ($tokens[$stackPtr]['code'] !== T_EQUAL) { + $negative = $phpcsFile->findPrevious(T_MINUS, ($nextNumber - 1), $stackPtr); + if ($negative !== false) { + if ($operator === '+') { + $operator = '-'; + } else { + $operator = '+'; + } + } + } + + $expected = $operator.$operator.$tokens[$assignedVar]['content']; + $found = $phpcsFile->getTokensAsString($assignedVar, ($statementEnd - $assignedVar + 1)); + + if ($operator === '+') { + $error = 'Increment'; + } else { + $error = 'Decrement'; + } + + $error .= " operators should be used where possible; found \"$found\" but expected \"$expected\""; + $phpcsFile->addError($error, $stackPtr, 'Found'); + }//end if + + }//end processAssignment() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php new file mode 100644 index 00000000..720e4724 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php @@ -0,0 +1,67 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ValidLogicalOperatorsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_LOGICAL_AND, + T_LOGICAL_OR, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current 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(); + + $replacements = [ + 'and' => '&&', + 'or' => '||', + ]; + + $operator = strtolower($tokens[$stackPtr]['content']); + if (isset($replacements[$operator]) === false) { + return; + } + + $error = 'Logical operator "%s" is prohibited; use "%s" instead'; + $data = [ + $operator, + $replacements[$operator], + ]; + $phpcsFile->addError($error, $stackPtr, 'NotAllowed', $data); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php new file mode 100644 index 00000000..c8e1a403 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php @@ -0,0 +1,283 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; + +use PHP_CodeSniffer\Exceptions\TokenizerException; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class CommentedOutCodeSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'CSS', + ]; + + /** + * If a comment is more than $maxPercentage% code, a warning will be shown. + * + * @var integer + */ + public $maxPercentage = 35; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_COMMENT]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Ignore comments at the end of code blocks. + if (substr($tokens[$stackPtr]['content'], 0, 6) === '//end ') { + return; + } + + $content = ''; + $lastLineSeen = $tokens[$stackPtr]['line']; + $commentStyle = 'line'; + if (strpos($tokens[$stackPtr]['content'], '/*') === 0) { + $commentStyle = 'block'; + } + + $lastCommentBlockToken = $stackPtr; + for ($i = $stackPtr; $i < $phpcsFile->numTokens; $i++) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { + break; + } + + if ($tokens[$i]['code'] === T_WHITESPACE) { + continue; + } + + if (isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true) { + $lastLineSeen = $tokens[$i]['line']; + continue; + } + + if ($commentStyle === 'line' + && ($lastLineSeen + 1) <= $tokens[$i]['line'] + && strpos($tokens[$i]['content'], '/*') === 0 + ) { + // First non-whitespace token on a new line is start of a different style comment. + break; + } + + if ($commentStyle === 'line' + && ($lastLineSeen + 1) < $tokens[$i]['line'] + ) { + // Blank line breaks a '//' style comment block. + break; + } + + /* + Trim as much off the comment as possible so we don't + have additional whitespace tokens or comment tokens + */ + + $tokenContent = trim($tokens[$i]['content']); + $break = false; + + if ($commentStyle === 'line') { + if (substr($tokenContent, 0, 2) === '//') { + $tokenContent = substr($tokenContent, 2); + } + + if (substr($tokenContent, 0, 1) === '#') { + $tokenContent = substr($tokenContent, 1); + } + } else { + if (substr($tokenContent, 0, 3) === '/**') { + $tokenContent = substr($tokenContent, 3); + } + + if (substr($tokenContent, 0, 2) === '/*') { + $tokenContent = substr($tokenContent, 2); + } + + if (substr($tokenContent, -2) === '*/') { + $tokenContent = substr($tokenContent, 0, -2); + $break = true; + } + + if (substr($tokenContent, 0, 1) === '*') { + $tokenContent = substr($tokenContent, 1); + } + }//end if + + $content .= $tokenContent.$phpcsFile->eolChar; + $lastLineSeen = $tokens[$i]['line']; + + $lastCommentBlockToken = $i; + + if ($break === true) { + // Closer of a block comment found. + break; + } + }//end for + + // Ignore typical warning suppression annotations from other tools. + if (preg_match('`^\s*@[A-Za-z()\._-]+\s*$`', $content) === 1) { + return ($lastCommentBlockToken + 1); + } + + // Quite a few comments use multiple dashes, equals signs etc + // to frame comments and licence headers. + $content = preg_replace('/[-=#*]{2,}/', '-', $content); + + // Random numbers sitting inside the content can throw parse errors + // for invalid literals in PHP7+, so strip those. + $content = preg_replace('/\d+/', '', $content); + + $content = trim($content); + + if ($content === '') { + return ($lastCommentBlockToken + 1); + } + + if ($phpcsFile->tokenizerType === 'PHP') { + $content = ''; + } + + // Because we are not really parsing code, the tokenizer can throw all sorts + // of errors that don't mean anything, so ignore them. + $oldErrors = ini_get('error_reporting'); + ini_set('error_reporting', 0); + try { + $tokenizerClass = get_class($phpcsFile->tokenizer); + $tokenizer = new $tokenizerClass($content, $phpcsFile->config, $phpcsFile->eolChar); + $stringTokens = $tokenizer->getTokens(); + } catch (TokenizerException $e) { + // We couldn't check the comment, so ignore it. + ini_set('error_reporting', $oldErrors); + return ($lastCommentBlockToken + 1); + } + + ini_set('error_reporting', $oldErrors); + + $numTokens = count($stringTokens); + + /* + We know what the first two and last two tokens should be + (because we put them there) so ignore this comment if those + tokens were not parsed correctly. It obviously means this is not + valid code. + */ + + // First token is always the opening tag. + if ($stringTokens[0]['code'] !== T_OPEN_TAG) { + return ($lastCommentBlockToken + 1); + } else { + array_shift($stringTokens); + --$numTokens; + } + + // Last token is always the closing tag, unless something went wrong. + if (isset($stringTokens[($numTokens - 1)]) === false + || $stringTokens[($numTokens - 1)]['code'] !== T_CLOSE_TAG + ) { + return ($lastCommentBlockToken + 1); + } else { + array_pop($stringTokens); + --$numTokens; + } + + // Second last token is always whitespace or a comment, depending + // on the code inside the comment. + if ($phpcsFile->tokenizerType === 'PHP') { + if (isset(Tokens::$emptyTokens[$stringTokens[($numTokens - 1)]['code']]) === false) { + return ($lastCommentBlockToken + 1); + } + + if ($stringTokens[($numTokens - 1)]['code'] === T_WHITESPACE) { + array_pop($stringTokens); + --$numTokens; + } + } + + $emptyTokens = [ + T_WHITESPACE => true, + T_STRING => true, + T_STRING_CONCAT => true, + T_ENCAPSED_AND_WHITESPACE => true, + T_NONE => true, + T_COMMENT => true, + ]; + $emptyTokens += Tokens::$phpcsCommentTokens; + + $numCode = 0; + $numNonWhitespace = 0; + + for ($i = 0; $i < $numTokens; $i++) { + // Do not count comments. + if (isset($emptyTokens[$stringTokens[$i]['code']]) === false + // Commented out HTML/XML and other docs contain a lot of these + // characters, so it is best to not use them directly. + && isset(Tokens::$comparisonTokens[$stringTokens[$i]['code']]) === false + && isset(Tokens::$arithmeticTokens[$stringTokens[$i]['code']]) === false + && $stringTokens[$i]['code'] !== T_GOTO_LABEL + ) { + // Looks like code. + $numCode++; + } + + if ($stringTokens[$i]['code'] !== T_WHITESPACE) { + ++$numNonWhitespace; + } + } + + // Ignore comments with only two or less non-whitespace tokens. + // Sample size too small for a reliably determination. + if ($numNonWhitespace <= 2) { + return ($lastCommentBlockToken + 1); + } + + $percentCode = ceil((($numCode / $numTokens) * 100)); + if ($percentCode > $this->maxPercentage) { + // Just in case. + $percentCode = min(100, $percentCode); + + $error = 'This comment is %s%% valid code; is this commented out code?'; + $data = [$percentCode]; + $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); + } + + return ($lastCommentBlockToken + 1); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php new file mode 100644 index 00000000..24dc1370 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php @@ -0,0 +1,59 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 DisallowBooleanStatementSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$booleanOperators; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + foreach ($tokens[$stackPtr]['nested_parenthesis'] as $open => $close) { + if (isset($tokens[$open]['parenthesis_owner']) === true) { + // Any owner means we are not just a simple statement. + return; + } + } + } + + $error = 'Boolean operators are not allowed outside of control structure conditions'; + $phpcsFile->addError($error, $stackPtr, 'Found'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php new file mode 100644 index 00000000..57dabbf1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php @@ -0,0 +1,112 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 DisallowComparisonAssignmentSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_EQUAL]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Ignore default value assignments in function definitions. + $function = $phpcsFile->findPrevious(T_FUNCTION, ($stackPtr - 1), null, false, null, true); + if ($function !== false) { + $opener = $tokens[$function]['parenthesis_opener']; + $closer = $tokens[$function]['parenthesis_closer']; + if ($opener < $stackPtr && $closer > $stackPtr) { + return; + } + } + + // Ignore values in array definitions or match structures. + $nextNonEmpty = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($stackPtr + 1), + null, + true + ); + + if ($nextNonEmpty !== false + && ($tokens[$nextNonEmpty]['code'] === T_ARRAY + || $tokens[$nextNonEmpty]['code'] === T_MATCH) + ) { + return; + } + + // Ignore function calls. + $ignore = [ + T_NULLSAFE_OBJECT_OPERATOR, + T_OBJECT_OPERATOR, + T_STRING, + T_VARIABLE, + T_WHITESPACE, + ]; + + $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); + if ($tokens[$next]['code'] === T_CLOSURE + || ($tokens[$next]['code'] === T_OPEN_PARENTHESIS + && $tokens[($next - 1)]['code'] === T_STRING) + ) { + // Code will look like: $var = myFunction( + // and will be ignored. + return; + } + + $endStatement = $phpcsFile->findEndOfStatement($stackPtr); + for ($i = ($stackPtr + 1); $i < $endStatement; $i++) { + if ((isset(Tokens::$comparisonTokens[$tokens[$i]['code']]) === true + && $tokens[$i]['code'] !== T_COALESCE) + || $tokens[$i]['code'] === T_INLINE_THEN + ) { + $error = 'The value of a comparison must not be assigned to a variable'; + $phpcsFile->addError($error, $stackPtr, 'AssignedComparison'); + break; + } + + if (isset(Tokens::$booleanOperators[$tokens[$i]['code']]) === true + || $tokens[$i]['code'] === T_BOOLEAN_NOT + ) { + $error = 'The value of a boolean operation must not be assigned to a variable'; + $phpcsFile->addError($error, $stackPtr, 'AssignedBool'); + break; + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php new file mode 100644 index 00000000..f2620c7d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class DisallowInlineIfSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_INLINE_THEN]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $phpcsFile->addError('Inline IF statements are not allowed', $stackPtr, 'Found'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php new file mode 100644 index 00000000..688d0bca --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php @@ -0,0 +1,190 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 DisallowMultipleAssignmentsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_EQUAL]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // Ignore default value assignments in function definitions. + $function = $phpcsFile->findPrevious([T_FUNCTION, T_CLOSURE, T_FN], ($stackPtr - 1), null, false, null, true); + if ($function !== false) { + if (isset($tokens[$function]['parenthesis_closer']) === false) { + // Live coding/parse error. Bow out. + return; + } + + $opener = $tokens[$function]['parenthesis_opener']; + $closer = $tokens[$function]['parenthesis_closer']; + if ($opener < $stackPtr && $closer > $stackPtr) { + return; + } + } + + // Ignore assignments in WHILE loop conditions. + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $nested = $tokens[$stackPtr]['nested_parenthesis']; + foreach ($nested as $opener => $closer) { + if (isset($tokens[$opener]['parenthesis_owner']) === true + && $tokens[$tokens[$opener]['parenthesis_owner']]['code'] === T_WHILE + ) { + return; + } + } + } + + // Ignore member var definitions. + if (empty($tokens[$stackPtr]['conditions']) === false) { + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + $deepestScope = key($conditions); + if (isset(Tokens::$ooScopeTokens[$tokens[$deepestScope]['code']]) === true) { + return; + } + } + + /* + The general rule is: + Find an equal sign and go backwards along the line. If you hit an + end bracket, skip to the opening bracket. When you find a variable, + stop. That variable must be the first non-empty token on the line + or in the statement. If not, throw an error. + */ + + for ($varToken = ($stackPtr - 1); $varToken >= 0; $varToken--) { + if (in_array($tokens[$varToken]['code'], [T_SEMICOLON, T_OPEN_CURLY_BRACKET, T_CLOSE_TAG], true) === true) { + // We've reached the previous statement, so we didn't find a variable. + return; + } + + // Skip brackets. + if (isset($tokens[$varToken]['parenthesis_opener']) === true && $tokens[$varToken]['parenthesis_opener'] < $varToken) { + $varToken = $tokens[$varToken]['parenthesis_opener']; + continue; + } + + if (isset($tokens[$varToken]['bracket_opener']) === true) { + $varToken = $tokens[$varToken]['bracket_opener']; + continue; + } + + if ($tokens[$varToken]['code'] === T_VARIABLE) { + // We found our variable. + break; + } + }//end for + + if ($varToken <= 0) { + // Didn't find a variable. + return; + } + + $start = $phpcsFile->findStartOfStatement($varToken); + + $allowed = Tokens::$emptyTokens; + + $allowed[T_STRING] = T_STRING; + $allowed[T_NS_SEPARATOR] = T_NS_SEPARATOR; + $allowed[T_DOUBLE_COLON] = T_DOUBLE_COLON; + $allowed[T_OBJECT_OPERATOR] = T_OBJECT_OPERATOR; + $allowed[T_ASPERAND] = T_ASPERAND; + $allowed[T_DOLLAR] = T_DOLLAR; + $allowed[T_SELF] = T_SELF; + $allowed[T_PARENT] = T_PARENT; + $allowed[T_STATIC] = T_STATIC; + + $varToken = $phpcsFile->findPrevious($allowed, ($varToken - 1), null, true); + + if ($varToken < $start + && $tokens[$varToken]['code'] !== T_OPEN_PARENTHESIS + && $tokens[$varToken]['code'] !== T_OPEN_SQUARE_BRACKET + ) { + $varToken = $start; + } + + // Ignore the first part of FOR loops as we are allowed to + // assign variables there even though the variable is not the + // first thing on the line. + if ($tokens[$varToken]['code'] === T_OPEN_PARENTHESIS && isset($tokens[$varToken]['parenthesis_owner']) === true) { + $owner = $tokens[$varToken]['parenthesis_owner']; + if ($tokens[$owner]['code'] === T_FOR) { + return; + } + } + + if ($tokens[$varToken]['code'] === T_VARIABLE + || $tokens[$varToken]['code'] === T_OPEN_TAG + || $tokens[$varToken]['code'] === T_GOTO_LABEL + || $tokens[$varToken]['code'] === T_INLINE_THEN + || $tokens[$varToken]['code'] === T_INLINE_ELSE + || $tokens[$varToken]['code'] === T_SEMICOLON + || $tokens[$varToken]['code'] === T_CLOSE_PARENTHESIS + || isset($allowed[$tokens[$varToken]['code']]) === true + ) { + return; + } + + $error = 'Assignments must be the first block of code on a line'; + $errorCode = 'Found'; + + if (isset($nested) === true) { + $controlStructures = [ + T_IF => T_IF, + T_ELSEIF => T_ELSEIF, + T_SWITCH => T_SWITCH, + T_CASE => T_CASE, + T_FOR => T_FOR, + T_MATCH => T_MATCH, + ]; + foreach ($nested as $opener => $closer) { + if (isset($tokens[$opener]['parenthesis_owner']) === true + && isset($controlStructures[$tokens[$tokens[$opener]['parenthesis_owner']]['code']]) === true + ) { + $errorCode .= 'InControlStructure'; + break; + } + } + } + + $phpcsFile->addError($error, $stackPtr, $errorCode); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php new file mode 100644 index 00000000..5d71c3ec --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php @@ -0,0 +1,116 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class DisallowSizeFunctionsInLoopsSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * An array of functions we don't want in the condition of loops. + * + * @var array + */ + protected $forbiddenFunctions = [ + 'PHP' => [ + 'sizeof' => true, + 'strlen' => true, + 'count' => true, + ], + 'JS' => ['length' => true], + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_WHILE, + T_FOR, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + $tokenizer = $phpcsFile->tokenizerType; + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + + if ($tokens[$stackPtr]['code'] === T_FOR) { + // We only want to check the condition in FOR loops. + $start = $phpcsFile->findNext(T_SEMICOLON, ($openBracket + 1)); + $end = $phpcsFile->findPrevious(T_SEMICOLON, ($closeBracket - 1)); + } else { + $start = $openBracket; + $end = $closeBracket; + } + + for ($i = ($start + 1); $i < $end; $i++) { + if ($tokens[$i]['code'] === T_STRING + && isset($this->forbiddenFunctions[$tokenizer][$tokens[$i]['content']]) === true + ) { + $functionName = $tokens[$i]['content']; + if ($tokenizer === 'JS') { + // Needs to be in the form object.function to be valid. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), null, true); + if ($prev === false || $tokens[$prev]['code'] !== T_OBJECT_OPERATOR) { + continue; + } + + $functionName = 'object.'.$functionName; + } else { + // Make sure it isn't a member var. + if ($tokens[($i - 1)]['code'] === T_OBJECT_OPERATOR + || $tokens[($i - 1)]['code'] === T_NULLSAFE_OBJECT_OPERATOR + ) { + continue; + } + + $functionName .= '()'; + } + + $error = 'The use of %s inside a loop condition is not allowed; assign the return value to a variable and use the variable in the loop condition instead'; + $data = [$functionName]; + $phpcsFile->addError($error, $i, 'Found', $data); + }//end if + }//end for + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php new file mode 100644 index 00000000..56fce551 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php @@ -0,0 +1,38 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; + +use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff as GenericForbiddenFunctionsSniff; + +class DiscouragedFunctionsSniff extends GenericForbiddenFunctionsSniff +{ + + /** + * A list of forbidden functions with their alternatives. + * + * The value is NULL if no alternative exists. IE, the + * function should just not be used. + * + * @var array + */ + public $forbiddenFunctions = [ + 'error_log' => null, + 'print_r' => null, + 'var_dump' => null, + ]; + + /** + * If true, an error will be thrown; otherwise a warning. + * + * @var boolean + */ + public $error = false; + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php new file mode 100644 index 00000000..0be6118e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php @@ -0,0 +1,512 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 EmbeddedPhpSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + // If the close php tag is on the same line as the opening + // then we have an inline embedded PHP block. + $closeTag = $phpcsFile->findNext(T_CLOSE_TAG, $stackPtr); + if ($closeTag === false || $tokens[$stackPtr]['line'] !== $tokens[$closeTag]['line']) { + $this->validateMultilineEmbeddedPhp($phpcsFile, $stackPtr, $closeTag); + } else { + $this->validateInlineEmbeddedPhp($phpcsFile, $stackPtr, $closeTag); + } + + }//end process() + + + /** + * Validates embedded PHP that exists on multiple lines. + * + * @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|false $closingTag The position of the PHP close tag in the + * stack passed in $tokens. + * + * @return void + */ + private function validateMultilineEmbeddedPhp($phpcsFile, $stackPtr, $closingTag) + { + $tokens = $phpcsFile->getTokens(); + + $prevTag = $phpcsFile->findPrevious($this->register(), ($stackPtr - 1)); + if ($prevTag === false) { + // This is the first open tag. + return; + } + + $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($firstContent === false) { + // Unclosed PHP open tag at the end of a file. Nothing to do. + return; + } + + if ($closingTag !== false) { + $firstContentAfterBlock = $phpcsFile->findNext(T_WHITESPACE, ($closingTag + 1), $phpcsFile->numTokens, true); + if ($firstContentAfterBlock === false) { + // Final closing tag. It will be handled elsewhere. + return; + } + + // We have an opening and a closing tag, that lie within other content. + if ($firstContent === $closingTag) { + $this->reportEmptyTagSet($phpcsFile, $stackPtr, $closingTag); + return; + } + }//end if + + if ($tokens[$firstContent]['line'] === $tokens[$stackPtr]['line']) { + $error = 'Opening PHP tag must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpen'); + if ($fix === true) { + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); + $padding = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($stackPtr, rtrim($tokens[$stackPtr]['content'])); + $phpcsFile->fixer->addNewline($stackPtr); + $phpcsFile->fixer->addContent($stackPtr, str_repeat(' ', $padding)); + + if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } else { + // Check the indent of the first line, except if it is a scope closer. + if (isset($tokens[$firstContent]['scope_closer']) === false + || $tokens[$firstContent]['scope_closer'] !== $firstContent + ) { + // Check for a blank line at the top. + if ($tokens[$firstContent]['line'] > ($tokens[$stackPtr]['line'] + 1)) { + // Find a token on the blank line to throw the error on. + $i = $stackPtr; + do { + $i++; + } while ($tokens[$i]['line'] !== ($tokens[$stackPtr]['line'] + 1)); + + $error = 'Blank line found at start of embedded PHP content'; + $fix = $phpcsFile->addFixableError($error, $i, 'SpacingBefore'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($stackPtr + 1); $i < $firstContent; $i++) { + if ($tokens[$i]['line'] === $tokens[$firstContent]['line'] + || $tokens[$i]['line'] === $tokens[$stackPtr]['line'] + ) { + continue; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + + $indent = 0; + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr); + if ($first === false) { + $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); + if ($first !== false) { + $indent = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); + } + } else { + $indent = ($tokens[($first + 1)]['column'] - 1); + } + + $contentColumn = ($tokens[$firstContent]['column'] - 1); + if ($contentColumn !== $indent) { + $error = 'First line of embedded PHP code must be indented %s spaces; %s found'; + $data = [ + $indent, + $contentColumn, + ]; + $fix = $phpcsFile->addFixableError($error, $firstContent, 'Indent', $data); + if ($fix === true) { + $padding = str_repeat(' ', $indent); + if ($contentColumn === 0) { + $phpcsFile->fixer->addContentBefore($firstContent, $padding); + } else { + $phpcsFile->fixer->replaceToken(($firstContent - 1), $padding); + } + } + } + }//end if + }//end if + + $lastContentBeforeBlock = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$lastContentBeforeBlock]['line'] === $tokens[$stackPtr]['line'] + && trim($tokens[$lastContentBeforeBlock]['content']) !== '' + ) { + $error = 'Opening PHP tag must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBeforeOpen'); + if ($fix === true) { + $padding = 0; + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr); + if ($first === false) { + $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); + if ($first !== false) { + $padding = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); + } + } else { + $padding = ($tokens[($first + 1)]['column'] - 1); + } + + $phpcsFile->fixer->addContentBefore($stackPtr, $phpcsFile->eolChar.str_repeat(' ', $padding)); + } + } else { + // Find the first token on the first non-empty line we find. + for ($first = ($lastContentBeforeBlock - 1); $first > 0; $first--) { + if ($tokens[$first]['line'] === $tokens[$stackPtr]['line']) { + continue; + } else if (trim($tokens[$first]['content']) !== '') { + $first = $phpcsFile->findFirstOnLine([], $first, true); + if ($tokens[$first]['code'] === T_COMMENT + && $tokens[$first]['content'] !== ltrim($tokens[$first]['content']) + ) { + // This is a subsequent line in a star-slash comment containing leading indent. + // We'll need the first line of the comment to correctly determine the indent. + continue; + } + + break; + } + } + + $expected = 0; + if ($tokens[$first]['code'] === T_INLINE_HTML + && trim($tokens[$first]['content']) !== '' + ) { + $expected = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); + } else if ($tokens[$first]['code'] === T_WHITESPACE) { + $expected = ($tokens[($first + 1)]['column'] - 1); + } + + $expected += 4; + $found = ($tokens[$stackPtr]['column'] - 1); + if ($found > $expected) { + $error = 'Opening PHP tag indent incorrect; expected no more than %s spaces but found %s'; + $data = [ + $expected, + $found, + ]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenTagIndent', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), str_repeat(' ', $expected)); + } + } + }//end if + + if ($closingTag === false) { + return; + } + + $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closingTag - 1), ($stackPtr + 1), true); + $firstContentAfterBlock = $phpcsFile->findNext(T_WHITESPACE, ($closingTag + 1), null, true); + + if ($tokens[$lastContent]['line'] === $tokens[$closingTag]['line']) { + $error = 'Closing PHP tag must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $closingTag, 'ContentBeforeEnd'); + if ($fix === true) { + // Calculate the indent for the close tag. + // If the close tag is on the same line as the first content, re-use the indent + // calculated for the first content line to prevent the indent being based on an + // "old" indent, not the _new_ (fixed) indent. + if ($tokens[$firstContent]['line'] === $tokens[$lastContent]['line'] + && isset($indent) === true + ) { + $closerIndent = $indent; + } else { + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $closingTag, true); + + while ($tokens[$first]['code'] === T_COMMENT + && $tokens[$first]['content'] !== ltrim($tokens[$first]['content']) + ) { + // This is a subsequent line in a star-slash comment containing leading indent. + // We'll need the first line of the comment to correctly determine the indent. + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, ($first - 1), true); + } + + $closerIndent = ($tokens[$first]['column'] - 1); + } + + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[($closingTag - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($closingTag - 1), ''); + } + + $phpcsFile->fixer->addContentBefore($closingTag, str_repeat(' ', $closerIndent)); + $phpcsFile->fixer->addNewlineBefore($closingTag); + $phpcsFile->fixer->endChangeset(); + }//end if + } else if ($firstContentAfterBlock !== false + && $tokens[$firstContentAfterBlock]['line'] === $tokens[$closingTag]['line'] + ) { + $error = 'Closing PHP tag must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $closingTag, 'ContentAfterEnd'); + if ($fix === true) { + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $closingTag, true); + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addNewline($closingTag); + $phpcsFile->fixer->addContent($closingTag, str_repeat(' ', ($tokens[$first]['column'] - 1))); + + if ($tokens[$firstContentAfterBlock]['code'] === T_INLINE_HTML) { + $trimmedHtmlContent = ltrim($tokens[$firstContentAfterBlock]['content']); + if ($trimmedHtmlContent === '') { + // HTML token contains only whitespace and the next token after is PHP, not HTML, so remove the whitespace. + $phpcsFile->fixer->replaceToken($firstContentAfterBlock, ''); + } else { + // The HTML token has content, so remove leading whitespace in favour of the indent. + $phpcsFile->fixer->replaceToken($firstContentAfterBlock, $trimmedHtmlContent); + } + } + + if ($tokens[$firstContentAfterBlock]['code'] === T_OPEN_TAG + || $tokens[$firstContentAfterBlock]['code'] === T_OPEN_TAG_WITH_ECHO + ) { + // Next token is a PHP open tag which will also have thrown an error. + // Prevent both fixers running in the same loop by making sure the token is "touched" during this loop. + // This prevents a stray new line being added between the close and open tags. + $phpcsFile->fixer->replaceToken($firstContentAfterBlock, $tokens[$firstContentAfterBlock]['content']); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + + $next = $phpcsFile->findNext($this->register(), ($closingTag + 1)); + if ($next === false) { + return; + } + + // Check for a blank line at the bottom. + if ((isset($tokens[$lastContent]['scope_closer']) === false + || $tokens[$lastContent]['scope_closer'] !== $lastContent) + && $tokens[$lastContent]['line'] < ($tokens[$closingTag]['line'] - 1) + ) { + // Find a token on the blank line to throw the error on. + $i = $closingTag; + do { + $i--; + } while ($tokens[$i]['line'] !== ($tokens[$closingTag]['line'] - 1)); + + $error = 'Blank line found at end of embedded PHP content'; + $fix = $phpcsFile->addFixableError($error, $i, 'SpacingAfter'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($lastContent + 1); $i < $closingTag; $i++) { + if ($tokens[$i]['line'] === $tokens[$lastContent]['line'] + || $tokens[$i]['line'] === $tokens[$closingTag]['line'] + ) { + continue; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + }//end if + + }//end validateMultilineEmbeddedPhp() + + + /** + * Validates embedded PHP that exists on one line. + * + * @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 $closeTag The position of the PHP close tag in the + * stack passed in $tokens. + * + * @return void + */ + private function validateInlineEmbeddedPhp($phpcsFile, $stackPtr, $closeTag) + { + $tokens = $phpcsFile->getTokens(); + + $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), $closeTag, true); + + if ($firstContent === false) { + $this->reportEmptyTagSet($phpcsFile, $stackPtr, $closeTag); + return; + } + + // Check that there is one, and only one space at the start of the statement. + $leadingSpace = 0; + if ($tokens[$stackPtr]['code'] === T_OPEN_TAG) { + // The long open tag token in a single line tag set always contains a single space after it. + $leadingSpace = 1; + } + + if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $leadingSpace += $tokens[($stackPtr + 1)]['length']; + } + + if ($leadingSpace !== 1) { + $error = 'Expected 1 space after opening PHP tag; %s found'; + $data = [$leadingSpace]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); + if ($fix === true) { + if ($tokens[$stackPtr]['code'] === T_OPEN_TAG) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + // Short open tag with too much whitespace. + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } else { + // Short open tag without whitespace. + $phpcsFile->fixer->addContent($stackPtr, ' '); + } + } + } + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closeTag - 1), $stackPtr, true); + if ($prev !== $stackPtr) { + if ((isset($tokens[$prev]['scope_opener']) === false + || $tokens[$prev]['scope_opener'] !== $prev) + && (isset($tokens[$prev]['scope_closer']) === false + || $tokens[$prev]['scope_closer'] !== $prev) + && $tokens[$prev]['code'] !== T_SEMICOLON + ) { + $error = 'Inline PHP statement must end with a semicolon'; + $code = 'NoSemicolon'; + if ($tokens[$stackPtr]['code'] === T_OPEN_TAG_WITH_ECHO) { + $code = 'ShortOpenEchoNoSemicolon'; + } + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); + if ($fix === true) { + $phpcsFile->fixer->addContent($prev, ';'); + } + } else if ($tokens[$prev]['code'] === T_SEMICOLON) { + $statementCount = 1; + for ($i = ($stackPtr + 1); $i < $prev; $i++) { + if ($tokens[$i]['code'] === T_SEMICOLON) { + $statementCount++; + } + } + + if ($statementCount > 1) { + $error = 'Inline PHP statement must contain a single statement; %s found'; + $data = [$statementCount]; + $phpcsFile->addError($error, $stackPtr, 'MultipleStatements', $data); + } + }//end if + }//end if + + $trailingSpace = 0; + if ($tokens[($closeTag - 1)]['code'] === T_WHITESPACE) { + $trailingSpace = $tokens[($closeTag - 1)]['length']; + } else if (($tokens[($closeTag - 1)]['code'] === T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[($closeTag - 1)]['code']]) === true) + && substr($tokens[($closeTag - 1)]['content'], -1) === ' ' + ) { + $trailingSpace = (strlen($tokens[($closeTag - 1)]['content']) - strlen(rtrim($tokens[($closeTag - 1)]['content']))); + } + + if ($trailingSpace !== 1) { + $error = 'Expected 1 space before closing PHP tag; %s found'; + $data = [$trailingSpace]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeClose', $data); + if ($fix === true) { + if ($trailingSpace === 0) { + $phpcsFile->fixer->addContentBefore($closeTag, ' '); + } else if ($tokens[($closeTag - 1)]['code'] === T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[($closeTag - 1)]['code']]) === true + ) { + $phpcsFile->fixer->replaceToken(($closeTag - 1), rtrim($tokens[($closeTag - 1)]['content']).' '); + } else { + $phpcsFile->fixer->replaceToken(($closeTag - 1), ' '); + } + } + } + + }//end validateInlineEmbeddedPhp() + + + /** + * Report and fix an set of empty PHP tags. + * + * @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 $closeTag The position of the PHP close tag in the + * stack passed in $tokens. + * + * @return void + */ + private function reportEmptyTagSet(File $phpcsFile, $stackPtr, $closeTag) + { + $tokens = $phpcsFile->getTokens(); + $error = 'Empty embedded PHP tag found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = $stackPtr; $i <= $closeTag; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + // Prevent leaving indentation whitespace behind when the empty tag set is the only thing on the affected lines. + if (isset($tokens[($closeTag + 1)]) === true + && $tokens[($closeTag + 1)]['line'] !== $tokens[$closeTag]['line'] + && $tokens[($stackPtr - 1)]['code'] === T_INLINE_HTML + && $tokens[($stackPtr - 1)]['line'] === $tokens[$stackPtr]['line'] + && $tokens[($stackPtr - 1)]['column'] === 1 + && trim($tokens[($stackPtr - 1)]['content']) === '' + ) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + }//end reportEmptyTagSet() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php new file mode 100644 index 00000000..102bd7c3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php @@ -0,0 +1,48 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class EvalSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_EVAL]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $error = 'Use of eval() is discouraged'; + $phpcsFile->addWarning($error, $stackPtr, 'Discouraged'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php new file mode 100644 index 00000000..fec3ec82 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php @@ -0,0 +1,53 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class GlobalKeywordSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_GLOBAL]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $nextVar = $tokens[$phpcsFile->findNext([T_VARIABLE], $stackPtr)]; + $varName = str_replace('$', '', $nextVar['content']); + $error = 'Use of the "global" keyword is forbidden; use "$GLOBALS[\'%s\']" instead'; + $data = [$varName]; + $phpcsFile->addError($error, $stackPtr, 'NotAllowed', $data); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php new file mode 100644 index 00000000..a3ab8e5a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php @@ -0,0 +1,51 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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; + +class HeredocSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_START_HEREDOC, + T_START_NOWDOC, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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) + { + $error = 'Use of heredoc and nowdoc syntax ("<<<") is not allowed; use standard strings or inline HTML instead'; + $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php new file mode 100644 index 00000000..1bc369a2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php @@ -0,0 +1,76 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['conditions']) === false) { + 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; + } + } + + if ($outerFuncToken === null) { + // Not a nested function. + return; + } + + $error = 'The use of inner functions is forbidden'; + $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php new file mode 100644 index 00000000..0b671d62 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php @@ -0,0 +1,167 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 LowercasePHPFunctionsSniff implements Sniff +{ + + /** + * String -> int hash map of all php built in function names + * + * @var array + */ + private $builtInFunctions; + + + /** + * Construct the LowercasePHPFunctionSniff + */ + public function __construct() + { + + $allFunctions = get_defined_functions(); + $this->builtInFunctions = array_flip($allFunctions['internal']); + + }//end __construct() + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_STRING]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 ($content === $contentLc) { + return; + } + + // Make sure it is an inbuilt PHP function. + // PHP_CodeSniffer can possibly include user defined functions + // through the use of vendor/autoload.php. + if (isset($this->builtInFunctions[$contentLc]) === false) { + return; + } + + // 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. + return; + } + + $ignore = Tokens::$emptyTokens; + $ignore[] = T_BITWISE_AND; + $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); + $prevPrev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); + + if ($tokens[$next]['code'] !== T_OPEN_PARENTHESIS) { + // Is this a use statement importing a PHP native function ? + if ($tokens[$next]['code'] !== T_NS_SEPARATOR + && $tokens[$prev]['code'] === T_STRING + && $tokens[$prev]['content'] === 'function' + && $prevPrev !== false + && $tokens[$prevPrev]['code'] === T_USE + ) { + $error = 'Use statements for PHP native functions must be lowercase; expected "%s" but found "%s"'; + $data = [ + $contentLc, + $content, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseStatementUppercase', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); + } + } + + // No open parenthesis; not a "use function" statement nor a function call. + return; + }//end if + + if ($tokens[$prev]['code'] === T_FUNCTION) { + // Function declaration, not a function call. + return; + } + + if ($tokens[$prev]['code'] === T_NS_SEPARATOR) { + if ($prevPrev !== false + && ($tokens[$prevPrev]['code'] === T_STRING + || $tokens[$prevPrev]['code'] === T_NAMESPACE + || $tokens[$prevPrev]['code'] === T_NEW) + ) { + // Namespaced class/function, not an inbuilt function. + // Could potentially give false negatives for non-namespaced files + // when namespace\functionName() is encountered. + return; + } + } + + if ($tokens[$prev]['code'] === T_NEW) { + // Object creation, not an inbuilt function. + return; + } + + if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR + || $tokens[$prev]['code'] === T_NULLSAFE_OBJECT_OPERATOR + ) { + // Not an inbuilt function. + return; + } + + if ($tokens[$prev]['code'] === T_DOUBLE_COLON) { + // Not an inbuilt function. + return; + } + + $error = 'Calls to PHP native functions must be lowercase; expected "%s" but found "%s"'; + $data = [ + $contentLc, + $content, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'CallUppercase', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php new file mode 100644 index 00000000..4c0d6bcb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php @@ -0,0 +1,303 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @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 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. + * + * @return array + */ + public function register() + { + return [ + T_BREAK, + T_CONTINUE, + T_RETURN, + T_THROW, + T_EXIT, + T_GOTO, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + + // 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; + } + + // 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; + } + + // 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(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($tokens[$next]['code'] === T_SEMICOLON) { + $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 + || $tokens[$owner]['code'] === T_CLOSURE + ) { + $warning = 'Empty return statement not required here'; + $phpcsFile->addWarning($warning, $stackPtr, 'ReturnNotRequired'); + return; + } + } + } + } + + if (isset($tokens[$stackPtr]['scope_opener']) === true) { + $owner = $tokens[$stackPtr]['scope_condition']; + if ($tokens[$owner]['code'] === T_CASE || $tokens[$owner]['code'] === T_DEFAULT) { + // This token closes the scope of a CASE or DEFAULT statement + // so any code between this statement and the next CASE, DEFAULT or + // end of SWITCH token will not be executable. + $end = $phpcsFile->findEndOfStatement($stackPtr); + $next = $phpcsFile->findNext( + [ + T_CASE, + T_DEFAULT, + T_CLOSE_CURLY_BRACKET, + T_ENDSWITCH, + ], + ($end + 1) + ); + + if ($next !== false) { + $lastLine = $tokens[$end]['line']; + for ($i = ($stackPtr + 1); $i < $next; $i++) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { + continue; + } + + $line = $tokens[$i]['line']; + if ($line > $lastLine) { + $type = substr($tokens[$stackPtr]['type'], 2); + $warning = 'Code after the %s statement on line %s cannot be executed'; + $data = [ + $type, + $tokens[$stackPtr]['line'], + ]; + $phpcsFile->addWarning($warning, $i, 'Unreachable', $data); + $lastLine = $line; + } + } + }//end if + + // That's all we have to check for these types of statements. + return; + }//end if + }//end if + + $ourConditions = array_keys($tokens[$stackPtr]['conditions']); + + if (empty($ourConditions) === false) { + $condition = array_pop($ourConditions); + + if (isset($tokens[$condition]['scope_closer']) === false) { + return; + } + + // Special case for BREAK statements sitting directly inside SWITCH + // statements. If we get to this point, we know the BREAK is not being + // used to close a CASE statement, so it is most likely non-executable + // code itself (as is the case when you put return; break; at the end of + // a case). So we need to ignore this token. + if ($tokens[$condition]['code'] === T_SWITCH + && $tokens[$stackPtr]['code'] === T_BREAK + ) { + return; + } + + $closer = $tokens[$condition]['scope_closer']; + + // If the closer for our condition is shared with other openers, + // we will need to throw errors from this token to the next + // shared opener (if there is one), not to the scope closer. + $nextOpener = null; + for ($i = ($stackPtr + 1); $i < $closer; $i++) { + if (isset($tokens[$i]['scope_closer']) === true) { + if ($tokens[$i]['scope_closer'] === $closer) { + // We found an opener that shares the same + // closing token as us. + $nextOpener = $i; + break; + } + } + }//end for + + if ($nextOpener === null) { + $end = $closer; + } else { + $end = ($nextOpener - 1); + } + } else { + // This token is in the global scope. + if ($tokens[$stackPtr]['code'] === T_BREAK) { + return; + } + + // Throw an error for all lines until the end of the file. + $end = ($phpcsFile->numTokens - 1); + }//end if + + // 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; + } + + if (isset($tokens[$start]['parenthesis_closer']) === true + && $tokens[$start]['code'] === T_OPEN_PARENTHESIS + ) { + $start = $tokens[$start]['parenthesis_closer']; + continue; + } + + if (isset($tokens[$start]['bracket_closer']) === true + && $tokens[$start]['code'] === T_OPEN_CURLY_BRACKET + ) { + $start = $tokens[$start]['bracket_closer']; + continue; + } + + if ($tokens[$start]['code'] === T_SEMICOLON || $tokens[$start]['code'] === T_CLOSE_TAG) { + break; + } + }//end for + + if (isset($tokens[$start]) === false) { + return; + } + + $lastLine = $tokens[$start]['line']; + for ($i = ($start + 1); $i < $end; $i++) { + if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true + || isset(Tokens::$bracketTokens[$tokens[$i]['code']]) === true + || $tokens[$i]['code'] === T_SEMICOLON + ) { + continue; + } + + // Skip whole functions and classes/interfaces because they are not + // technically executed code, but rather declarations that may be used. + if (isset(Tokens::$ooScopeTokens[$tokens[$i]['code']]) === true + || $tokens[$i]['code'] === T_FUNCTION + || $tokens[$i]['code'] === T_CLOSURE + ) { + if (isset($tokens[$i]['scope_closer']) === false) { + // Parse error/Live coding. + return; + } + + $i = $tokens[$i]['scope_closer']; + 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); + $warning = 'Code after the %s statement on line %s cannot be executed'; + $data = [ + $type, + $tokens[$stackPtr]['line'], + ]; + $phpcsFile->addWarning($warning, $i, 'Unreachable', $data); + $lastLine = $line; + } + }//end for + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php new file mode 100644 index 00000000..3d1c83f0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php @@ -0,0 +1,77 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; + +class MemberVarScopeSniff extends AbstractVariableSniff +{ + + + /** + * Processes the function tokens within the class. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processMemberVar(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $properties = $phpcsFile->getMemberProperties($stackPtr); + + if ($properties === [] || $properties['scope_specified'] !== false) { + return; + } + + $error = 'Scope modifier not specified for member variable "%s"'; + $data = [$tokens[$stackPtr]['content']]; + $phpcsFile->addError($error, $stackPtr, 'Missing', $data); + + }//end processMemberVar() + + + /** + * Processes normal variables. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processVariable(File $phpcsFile, $stackPtr) + { + /* + We don't care about normal variables. + */ + + }//end processVariable() + + + /** + * Processes variables in double quoted strings. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processVariableInString(File $phpcsFile, $stackPtr) + { + /* + We don't care about normal variables. + */ + + }//end processVariableInString() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php new file mode 100644 index 00000000..39ed5b0d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php @@ -0,0 +1,83 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; +use PHP_CodeSniffer\Util\Tokens; + +class MethodScopeSniff extends AbstractScopeSniff +{ + + + /** + * Constructs a Squiz_Sniffs_Scope_MethodScopeSniff. + */ + public function __construct() + { + parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION]); + + }//end __construct() + + + /** + * Processes the function tokens within the class. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * @param int $currScope The current scope opener token. + * + * @return void + */ + protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + // Determine if this is a function which needs to be examined. + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + $deepestScope = key($conditions); + if ($deepestScope !== $currScope) { + return; + } + + $methodName = $phpcsFile->getDeclarationName($stackPtr); + if ($methodName === null) { + // Ignore closures. + return; + } + + $properties = $phpcsFile->getMethodProperties($stackPtr); + if ($properties['scope_specified'] === false) { + $error = 'Visibility must be declared on method "%s"'; + $data = [$methodName]; + $phpcsFile->addError($error, $stackPtr, 'Missing', $data); + } + + }//end processTokenWithinScope() + + + /** + * Processes a token that is found within the scope that this test is + * listening to. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position in the stack where this + * token was found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + + }//end processTokenOutsideScope() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php new file mode 100644 index 00000000..aab5bdb7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php @@ -0,0 +1,128 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; +use PHP_CodeSniffer\Util\Tokens; + +class StaticThisUsageSniff extends AbstractScopeSniff +{ + + + /** + * Constructs the test with the tokens it wishes to listen for. + */ + public function __construct() + { + parent::__construct([T_CLASS, T_TRAIT, T_ENUM, T_ANON_CLASS], [T_FUNCTION]); + + }//end __construct() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * @param int $currScope A pointer to the start of the scope. + * + * @return void + */ + public function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) + { + $tokens = $phpcsFile->getTokens(); + + // Determine if this is a function which needs to be examined. + $conditions = $tokens[$stackPtr]['conditions']; + end($conditions); + $deepestScope = key($conditions); + if ($deepestScope !== $currScope) { + return; + } + + // Ignore abstract functions. + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($next === false || $tokens[$next]['code'] !== T_STRING) { + // Not a function declaration, or incomplete. + return; + } + + $methodProps = $phpcsFile->getMethodProperties($stackPtr); + if ($methodProps['is_static'] === false) { + return; + } + + $next = $stackPtr; + $end = $tokens[$stackPtr]['scope_closer']; + + $this->checkThisUsage($phpcsFile, $next, $end); + + }//end processTokenWithinScope() + + + /** + * Check for $this variable usage between $next and $end tokens. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. + * @param int $next The position of the next token to check. + * @param int $end The position of the last token to check. + * + * @return void + */ + private function checkThisUsage(File $phpcsFile, $next, $end) + { + $tokens = $phpcsFile->getTokens(); + + do { + $next = $phpcsFile->findNext([T_VARIABLE, T_ANON_CLASS], ($next + 1), $end); + if ($next === false) { + continue; + } + + if ($tokens[$next]['code'] === T_ANON_CLASS) { + $this->checkThisUsage($phpcsFile, $next, $tokens[$next]['scope_opener']); + $next = $tokens[$next]['scope_closer']; + continue; + } + + if ($tokens[$next]['content'] !== '$this') { + continue; + } + + $error = 'Usage of "$this" in static methods will cause runtime errors'; + $phpcsFile->addError($error, $next, 'Found'); + } while ($next !== false); + + }//end checkThisUsage() + + + /** + * Processes a token that is found within the scope that this test is + * listening to. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position in the stack where this + * token was found. + * + * @return void + */ + protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) + { + + }//end processTokenOutsideScope() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php new file mode 100644 index 00000000..66c32454 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php @@ -0,0 +1,164 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ConcatenationSpacingSniff implements Sniff +{ + + /** + * The number of spaces before and after a string concat. + * + * @var integer + */ + public $spacing = 0; + + /** + * Allow newlines instead of spaces. + * + * @var boolean + */ + public $ignoreNewlines = false; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_STRING_CONCAT]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + if (isset($tokens[($stackPtr + 2)]) === false) { + // Syntax error or live coding, bow out. + return; + } + + $ignoreBefore = false; + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) { + // Spacing before must be preserved due to the here/nowdoc closing tag. + $ignoreBefore = true; + } + + $this->spacing = (int) $this->spacing; + + if ($ignoreBefore === false) { + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { + $before = 0; + } else { + if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { + $before = 'newline'; + } else { + $before = $tokens[($stackPtr - 1)]['length']; + } + } + + $phpcsFile->recordMetric($stackPtr, 'Spacing before string concat', $before); + } + + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + $after = 0; + } else { + if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { + $after = 'newline'; + } else { + $after = $tokens[($stackPtr + 1)]['length']; + } + } + + $phpcsFile->recordMetric($stackPtr, 'Spacing after string concat', $after); + + if (($ignoreBefore === true + || $before === $this->spacing + || ($before === 'newline' + && $this->ignoreNewlines === true)) + && ($after === $this->spacing + || ($after === 'newline' + && $this->ignoreNewlines === true)) + ) { + return; + } + + if ($this->spacing === 0) { + $message = 'Concat operator must not be surrounded by spaces'; + $data = []; + } else { + if ($this->spacing > 1) { + $message = 'Concat operator must be surrounded by %s spaces'; + } else { + $message = 'Concat operator must be surrounded by a single space'; + } + + $data = [$this->spacing]; + } + + $fix = $phpcsFile->addFixableError($message, $stackPtr, 'PaddingFound', $data); + + if ($fix === true) { + $padding = str_repeat(' ', $this->spacing); + if ($ignoreBefore === false && ($before !== 'newline' || $this->ignoreNewlines === false)) { + if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken(($stackPtr - 1), $padding); + if ($this->spacing === 0 + && ($tokens[($stackPtr - 2)]['code'] === T_LNUMBER + || $tokens[($stackPtr - 2)]['code'] === T_DNUMBER) + ) { + $phpcsFile->fixer->replaceToken(($stackPtr - 2), '('.$tokens[($stackPtr - 2)]['content'].')'); + } + + $phpcsFile->fixer->endChangeset(); + } else if ($this->spacing > 0) { + $phpcsFile->fixer->addContent(($stackPtr - 1), $padding); + } + } + + if ($after !== 'newline' || $this->ignoreNewlines === false) { + if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken(($stackPtr + 1), $padding); + if ($this->spacing === 0 + && ($tokens[($stackPtr + 2)]['code'] === T_LNUMBER + || $tokens[($stackPtr + 2)]['code'] === T_DNUMBER) + ) { + $phpcsFile->fixer->replaceToken(($stackPtr + 2), '('.$tokens[($stackPtr + 2)]['content'].')'); + } + + $phpcsFile->fixer->endChangeset(); + } else if ($this->spacing > 0) { + $phpcsFile->fixer->addContent($stackPtr, $padding); + } + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php new file mode 100644 index 00000000..fb3b626f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php @@ -0,0 +1,144 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class DoubleQuoteUsageSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_CONSTANT_ENCAPSED_STRING, + T_DOUBLE_QUOTED_STRING, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // If tabs are being converted to spaces by the tokeniser, the + // original content should be used instead of the converted content. + if (isset($tokens[$stackPtr]['orig_content']) === true) { + $workingString = $tokens[$stackPtr]['orig_content']; + } else { + $workingString = $tokens[$stackPtr]['content']; + } + + $lastStringToken = $stackPtr; + + $i = ($stackPtr + 1); + if (isset($tokens[$i]) === true) { + while ($i < $phpcsFile->numTokens + && $tokens[$i]['code'] === $tokens[$stackPtr]['code'] + ) { + if (isset($tokens[$i]['orig_content']) === true) { + $workingString .= $tokens[$i]['orig_content']; + } else { + $workingString .= $tokens[$i]['content']; + } + + $lastStringToken = $i; + $i++; + } + } + + $skipTo = ($lastStringToken + 1); + + // Check if it's a double quoted string. + if ($workingString[0] !== '"' || substr($workingString, -1) !== '"') { + return $skipTo; + } + + // The use of variables in double quoted strings is not allowed. + if ($tokens[$stackPtr]['code'] === T_DOUBLE_QUOTED_STRING) { + $stringTokens = token_get_all('addError($error, $stackPtr, 'ContainsVar', $data); + } + } + + return $skipTo; + }//end if + + $allowedChars = [ + '\0', + '\1', + '\2', + '\3', + '\4', + '\5', + '\6', + '\7', + '\n', + '\r', + '\f', + '\t', + '\v', + '\x', + '\b', + '\e', + '\u', + '\'', + ]; + + foreach ($allowedChars as $testChar) { + if (strpos($workingString, $testChar) !== false) { + return $skipTo; + } + } + + $error = 'String %s does not require double quotes; use single quotes instead'; + $data = [str_replace(["\r", "\n"], ['\r', '\n'], $workingString)]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotRequired', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $innerContent = substr($workingString, 1, -1); + $innerContent = str_replace('\"', '"', $innerContent); + $innerContent = str_replace('\\$', '$', $innerContent); + $phpcsFile->fixer->replaceToken($stackPtr, "'$innerContent'"); + while ($lastStringToken !== $stackPtr) { + $phpcsFile->fixer->replaceToken($lastStringToken, ''); + $lastStringToken--; + } + + $phpcsFile->fixer->endChangeset(); + } + + return $skipTo; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php new file mode 100644 index 00000000..ec516a99 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php @@ -0,0 +1,88 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class EchoedStringsSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_ECHO]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + // If the first non-whitespace token is not an opening parenthesis, then we are not concerned. + if ($tokens[$firstContent]['code'] !== T_OPEN_PARENTHESIS) { + $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no'); + return; + } + + $end = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_TAG], $stackPtr, null, false); + + // If the token before the semicolon is not a closing parenthesis, then we are not concerned. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($end - 1), null, true); + if ($tokens[$prev]['code'] !== T_CLOSE_PARENTHESIS) { + $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no'); + return; + } + + // If the parenthesis don't match, then we are not concerned. + if ($tokens[$firstContent]['parenthesis_closer'] !== $prev) { + $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no'); + return; + } + + $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'yes'); + + if (($phpcsFile->findNext(Tokens::$operators, $stackPtr, $end, false)) === false) { + // There are no arithmetic operators in this. + $error = 'Echoed strings should not be bracketed'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'HasBracket'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($firstContent, ''); + if ($tokens[($firstContent - 1)]['code'] !== T_WHITESPACE) { + $phpcsFile->fixer->addContent(($firstContent - 1), ' '); + } + + $phpcsFile->fixer->replaceToken($prev, ''); + $phpcsFile->fixer->endChangeset(); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php new file mode 100644 index 00000000..2ae782ce --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php @@ -0,0 +1,65 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class CastSpacingSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$castTokens; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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']; + $expected = str_replace(' ', '', $content); + $expected = str_replace("\t", '', $expected); + + if ($content !== $expected) { + $error = 'Cast statements must not contain whitespace; expected "%s" but found "%s"'; + $data = [ + $expected, + $content, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContainsWhiteSpace', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, $expected); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php new file mode 100644 index 00000000..eb6e5b2a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php @@ -0,0 +1,359 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ControlStructureSpacingSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_IF, + T_WHILE, + T_FOREACH, + T_FOR, + T_SWITCH, + T_DO, + T_ELSE, + T_ELSEIF, + T_TRY, + T_CATCH, + T_FINALLY, + T_MATCH, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === true + && isset($tokens[$stackPtr]['parenthesis_closer']) === true + ) { + $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; + $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; + if ($tokens[($parenOpener + 1)]['code'] === T_WHITESPACE) { + $gap = $tokens[($parenOpener + 1)]['length']; + + if ($gap === 0) { + $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', 'newline'); + $gap = 'newline'; + } else { + $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', $gap); + } + + $error = 'Expected 0 spaces after opening bracket; %s found'; + $data = [$gap]; + $fix = $phpcsFile->addFixableError($error, ($parenOpener + 1), 'SpacingAfterOpenBrace', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($parenOpener + 1), ''); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', 0); + } + + if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line'] + && $tokens[($parenCloser - 1)]['code'] === T_WHITESPACE + ) { + $gap = $tokens[($parenCloser - 1)]['length']; + $error = 'Expected 0 spaces before closing bracket; %s found'; + $data = [$gap]; + $fix = $phpcsFile->addFixableError($error, ($parenCloser - 1), 'SpaceBeforeCloseBrace', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($parenCloser - 1), ''); + } + + if ($gap === 0) { + $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', 'newline'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', $gap); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', 0); + } + }//end if + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + $scopeOpener = $tokens[$stackPtr]['scope_opener']; + $scopeCloser = $tokens[$stackPtr]['scope_closer']; + + for ($firstContent = ($scopeOpener + 1); $firstContent < $phpcsFile->numTokens; $firstContent++) { + $code = $tokens[$firstContent]['code']; + + if ($code === T_WHITESPACE + || ($code === T_INLINE_HTML + && trim($tokens[$firstContent]['content']) === '') + ) { + continue; + } + + // Skip all empty tokens on the same line as the opener. + if ($tokens[$firstContent]['line'] === $tokens[$scopeOpener]['line'] + && (isset(Tokens::$emptyTokens[$code]) === true + || $code === T_CLOSE_TAG) + ) { + continue; + } + + break; + } + + // We ignore spacing for some structures that tend to have their own rules. + $ignore = [ + T_FUNCTION => true, + T_CLASS => true, + T_INTERFACE => true, + T_TRAIT => true, + T_ENUM => true, + T_DOC_COMMENT_OPEN_TAG => true, + ]; + + if (isset($ignore[$tokens[$firstContent]['code']]) === false + && $tokens[$firstContent]['line'] >= ($tokens[$scopeOpener]['line'] + 2) + ) { + $gap = ($tokens[$firstContent]['line'] - $tokens[$scopeOpener]['line'] - 1); + $phpcsFile->recordMetric($stackPtr, 'Blank lines at start of control structure', $gap); + + $error = 'Blank line found at start of control structure'; + $fix = $phpcsFile->addFixableError($error, $scopeOpener, 'SpacingAfterOpen'); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $i = ($scopeOpener + 1); + while ($tokens[$i]['line'] !== $tokens[$firstContent]['line']) { + // Start removing content from the line after the opener. + if ($tokens[$i]['line'] !== $tokens[$scopeOpener]['line']) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $i++; + } + + $phpcsFile->fixer->endChangeset(); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Blank lines at start of control structure', 0); + }//end if + + if ($firstContent !== $scopeCloser) { + $lastContent = $phpcsFile->findPrevious( + T_WHITESPACE, + ($scopeCloser - 1), + null, + true + ); + + $lastNonEmptyContent = $phpcsFile->findPrevious( + Tokens::$emptyTokens, + ($scopeCloser - 1), + null, + true + ); + + $checkToken = $lastContent; + if (isset($tokens[$lastNonEmptyContent]['scope_condition']) === true) { + $checkToken = $tokens[$lastNonEmptyContent]['scope_condition']; + } + + if (isset($ignore[$tokens[$checkToken]['code']]) === false + && $tokens[$lastContent]['line'] <= ($tokens[$scopeCloser]['line'] - 2) + ) { + $errorToken = $scopeCloser; + for ($i = ($scopeCloser - 1); $i > $lastContent; $i--) { + if ($tokens[$i]['line'] < $tokens[$scopeCloser]['line']) { + $errorToken = $i; + break; + } + } + + $gap = ($tokens[$scopeCloser]['line'] - $tokens[$lastContent]['line'] - 1); + $phpcsFile->recordMetric($stackPtr, 'Blank lines at end of control structure', $gap); + + $error = 'Blank line found at end of control structure'; + $fix = $phpcsFile->addFixableError($error, $errorToken, 'SpacingBeforeClose'); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($scopeCloser - 1); $i > $lastContent; $i--) { + if ($tokens[$i]['line'] === $tokens[$scopeCloser]['line']) { + continue; + } + + if ($tokens[$i]['line'] === $tokens[$lastContent]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } else { + $phpcsFile->recordMetric($stackPtr, 'Blank lines at end of control structure', 0); + }//end if + }//end if + + if ($tokens[$stackPtr]['code'] === T_MATCH) { + // Move the scope closer to the semicolon/comma. + $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($scopeCloser + 1), null, true); + if ($next !== false + && ($tokens[$next]['code'] === T_SEMICOLON || $tokens[$next]['code'] === T_COMMA) + ) { + $scopeCloser = $next; + } + } + + $trailingContent = $phpcsFile->findNext( + T_WHITESPACE, + ($scopeCloser + 1), + null, + true + ); + + if ($tokens[$trailingContent]['code'] === T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[$trailingContent]['code']]) === true + ) { + // Special exception for code where the comment about + // an ELSE or ELSEIF is written between the control structures. + $nextCode = $phpcsFile->findNext( + Tokens::$emptyTokens, + ($scopeCloser + 1), + null, + true + ); + + if ($tokens[$nextCode]['code'] === T_ELSE + || $tokens[$nextCode]['code'] === T_ELSEIF + || $tokens[$trailingContent]['line'] === $tokens[$scopeCloser]['line'] + ) { + $trailingContent = $nextCode; + } + }//end if + + if ($tokens[$trailingContent]['code'] === T_ELSE) { + if ($tokens[$stackPtr]['code'] === T_IF) { + // IF with ELSE. + return; + } + } + + if ($tokens[$trailingContent]['code'] === T_WHILE + && $tokens[$stackPtr]['code'] === T_DO + ) { + // DO with WHILE. + return; + } + + if ($tokens[$trailingContent]['code'] === T_CLOSE_TAG) { + // At the end of the script or embedded code. + return; + } + + if (isset($tokens[$trailingContent]['scope_condition']) === true + && $tokens[$trailingContent]['scope_condition'] !== $trailingContent + && isset($tokens[$trailingContent]['scope_opener']) === true + && $tokens[$trailingContent]['scope_opener'] !== $trailingContent + ) { + // Another control structure's closing brace. + $owner = $tokens[$trailingContent]['scope_condition']; + if ($tokens[$owner]['code'] === T_FUNCTION) { + // The next content is the closing brace of a function + // so normal function rules apply and we can ignore it. + return; + } + + if ($tokens[$owner]['code'] === T_CLOSURE + && ($phpcsFile->hasCondition($stackPtr, [T_FUNCTION, T_CLOSURE]) === true + || isset($tokens[$stackPtr]['nested_parenthesis']) === true) + ) { + return; + } + + if ($tokens[$trailingContent]['line'] !== ($tokens[$scopeCloser]['line'] + 1)) { + $error = 'Blank line found after control structure'; + $fix = $phpcsFile->addFixableError($error, $scopeCloser, 'LineAfterClose'); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $i = ($scopeCloser + 1); + while ($tokens[$i]['line'] !== $tokens[$trailingContent]['line']) { + $phpcsFile->fixer->replaceToken($i, ''); + $i++; + } + + $phpcsFile->fixer->addNewline($scopeCloser); + $phpcsFile->fixer->endChangeset(); + } + } + } else if ($tokens[$trailingContent]['code'] !== T_ELSE + && $tokens[$trailingContent]['code'] !== T_ELSEIF + && $tokens[$trailingContent]['code'] !== T_CATCH + && $tokens[$trailingContent]['code'] !== T_FINALLY + && $tokens[$trailingContent]['line'] === ($tokens[$scopeCloser]['line'] + 1) + ) { + $error = 'No blank line found after control structure'; + $fix = $phpcsFile->addFixableError($error, $scopeCloser, 'NoLineAfterClose'); + if ($fix === true) { + $trailingContent = $phpcsFile->findNext( + T_WHITESPACE, + ($scopeCloser + 1), + null, + true + ); + + if (($tokens[$trailingContent]['code'] === T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[$trailingContent]['code']]) === true) + && $tokens[$trailingContent]['line'] === $tokens[$scopeCloser]['line'] + ) { + $phpcsFile->fixer->addNewline($trailingContent); + } else { + $phpcsFile->fixer->addNewline($scopeCloser); + } + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php new file mode 100644 index 00000000..54b9ca92 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php @@ -0,0 +1,164 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class FunctionClosingBraceSpaceSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + // Probably an interface method. + return; + } + + $closeBrace = $tokens[$stackPtr]['scope_closer']; + $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); + + // Special case for empty JS functions. + if ($phpcsFile->tokenizerType === 'JS' && $prevContent === $tokens[$stackPtr]['scope_opener']) { + // In this case, the opening and closing brace must be + // right next to each other. + if ($tokens[$stackPtr]['scope_closer'] !== ($tokens[$stackPtr]['scope_opener'] + 1)) { + $error = 'The opening and closing braces of empty functions must be directly next to each other; e.g., function () {}'; + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBetween'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($tokens[$stackPtr]['scope_opener'] + 1); $i < $closeBrace; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + return; + } + + $nestedFunction = false; + if ($phpcsFile->hasCondition($stackPtr, [T_FUNCTION, T_CLOSURE]) === true + || isset($tokens[$stackPtr]['nested_parenthesis']) === true + ) { + $nestedFunction = true; + } + + $braceLine = $tokens[$closeBrace]['line']; + $prevLine = $tokens[$prevContent]['line']; + $found = ($braceLine - $prevLine - 1); + + if ($nestedFunction === true) { + if ($found < 0) { + $error = 'Closing brace of nested function must be on a new line'; + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'ContentBeforeClose'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($closeBrace); + } + } else if ($found > 0) { + $error = 'Expected 0 blank lines before closing brace of nested function; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeNestedClose', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $changeMade = false; + for ($i = ($prevContent + 1); $i < $closeBrace; $i++) { + // Try and maintain indentation. + if ($tokens[$i]['line'] === ($braceLine - 1)) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + $changeMade = true; + } + + // Special case for when the last content contains the newline + // token as well, like with a comment. + if ($changeMade === false) { + $phpcsFile->fixer->replaceToken(($prevContent + 1), ''); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + } else { + if ($found !== 1) { + if ($found < 0) { + $found = 0; + } + + $error = 'Expected 1 blank line before closing function brace; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeClose', $data); + + if ($fix === true) { + if ($found > 1) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prevContent + 1); $i < ($closeBrace - 1); $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->replaceToken($i, $phpcsFile->eolChar); + $phpcsFile->fixer->endChangeset(); + } else { + // Try and maintain indentation. + if ($tokens[($closeBrace - 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->addNewlineBefore($closeBrace - 1); + } else { + $phpcsFile->fixer->addNewlineBefore($closeBrace); + } + } + } + }//end if + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php new file mode 100644 index 00000000..3eff4e0f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php @@ -0,0 +1,98 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class FunctionOpeningBraceSpaceSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_FUNCTION, + T_CLOSURE, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + // Probably an interface or abstract method. + return; + } + + $openBrace = $tokens[$stackPtr]['scope_opener']; + $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($openBrace + 1), null, true); + + if ($nextContent === $tokens[$stackPtr]['scope_closer']) { + // The next bit of content is the closing brace, so this + // is an empty function and should have a blank line + // between the opening and closing braces. + return; + } + + $braceLine = $tokens[$openBrace]['line']; + $nextLine = $tokens[$nextContent]['line']; + + $found = ($nextLine - $braceLine - 1); + if ($found > 0) { + $error = 'Expected 0 blank lines after opening function brace; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $openBrace, 'SpacingAfter', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($openBrace + 1); $i < $nextContent; $i++) { + if ($tokens[$i]['line'] === $nextLine) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addNewline($openBrace); + $phpcsFile->fixer->endChangeset(); + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php new file mode 100644 index 00000000..01cbd647 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php @@ -0,0 +1,366 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class FunctionSpacingSniff implements Sniff +{ + + /** + * The number of blank lines between functions. + * + * @var integer + */ + public $spacing = 2; + + /** + * The number of blank lines before the first function in a class. + * + * @var integer + */ + public $spacingBeforeFirst = 2; + + /** + * The number of blank lines after the last function in a class. + * + * @var integer + */ + public $spacingAfterLast = 2; + + /** + * Original properties as set in a custom ruleset (if any). + * + * @var array|null + */ + private $rulesetProperties = null; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_FUNCTION]; + + }//end register() + + + /** + * Processes this sniff when one of its tokens is encountered. + * + * @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(); + $previousNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if ($previousNonEmpty !== false + && $tokens[$previousNonEmpty]['code'] === T_OPEN_TAG + && $tokens[$previousNonEmpty]['line'] !== 1 + ) { + // Ignore functions at the start of an embedded PHP block. + return; + } + + // If the ruleset has only overridden the spacing property, use + // that value for all spacing rules. + if ($this->rulesetProperties === null) { + $this->rulesetProperties = []; + if (isset($phpcsFile->ruleset->ruleset['Squiz.WhiteSpace.FunctionSpacing']) === true + && isset($phpcsFile->ruleset->ruleset['Squiz.WhiteSpace.FunctionSpacing']['properties']) === true + ) { + $this->rulesetProperties = $phpcsFile->ruleset->ruleset['Squiz.WhiteSpace.FunctionSpacing']['properties']; + if (isset($this->rulesetProperties['spacing']) === true) { + if (isset($this->rulesetProperties['spacingBeforeFirst']) === false) { + $this->spacingBeforeFirst = $this->spacing; + } + + if (isset($this->rulesetProperties['spacingAfterLast']) === false) { + $this->spacingAfterLast = $this->spacing; + } + } + } + } + + $this->spacing = (int) $this->spacing; + $this->spacingBeforeFirst = (int) $this->spacingBeforeFirst; + $this->spacingAfterLast = (int) $this->spacingAfterLast; + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + // Must be an interface method, so the closer is the semicolon. + $closer = $phpcsFile->findNext(T_SEMICOLON, $stackPtr); + } else { + $closer = $tokens[$stackPtr]['scope_closer']; + } + + $isFirst = false; + $isLast = false; + + $ignore = ([T_WHITESPACE => T_WHITESPACE] + Tokens::$methodPrefixes); + + $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); + + while ($tokens[$prev]['code'] === T_ATTRIBUTE_END) { + // Skip past function attributes. + $prev = $phpcsFile->findPrevious($ignore, ($tokens[$prev]['attribute_opener'] - 1), null, true); + } + + if ($tokens[$prev]['code'] === T_DOC_COMMENT_CLOSE_TAG) { + // Skip past function docblocks. + $prev = $phpcsFile->findPrevious($ignore, ($tokens[$prev]['comment_opener'] - 1), null, true); + } + + if ($tokens[$prev]['code'] === T_OPEN_CURLY_BRACKET) { + $isFirst = true; + } + + $next = $phpcsFile->findNext($ignore, ($closer + 1), null, true); + if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true + && $tokens[$next]['line'] === $tokens[$closer]['line'] + ) { + // Skip past "end" comments. + $next = $phpcsFile->findNext($ignore, ($next + 1), null, true); + } + + if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { + $isLast = true; + } + + /* + Check the number of blank lines + after the function. + */ + + // Allow for comments on the same line as the closer. + for ($nextLineToken = ($closer + 1); $nextLineToken < $phpcsFile->numTokens; $nextLineToken++) { + if ($tokens[$nextLineToken]['line'] !== $tokens[$closer]['line']) { + break; + } + } + + $requiredSpacing = $this->spacing; + $errorCode = 'After'; + if ($isLast === true) { + $requiredSpacing = $this->spacingAfterLast; + $errorCode = 'AfterLast'; + } + + $foundLines = 0; + if ($nextLineToken === ($phpcsFile->numTokens - 1)) { + // We are at the end of the file. + // Don't check spacing after the function because this + // should be done by an EOF sniff. + $foundLines = $requiredSpacing; + } else { + $nextContent = $phpcsFile->findNext(T_WHITESPACE, $nextLineToken, null, true); + if ($nextContent === false) { + // We are at the end of the file. + // Don't check spacing after the function because this + // should be done by an EOF sniff. + $foundLines = $requiredSpacing; + } else { + $foundLines = ($tokens[$nextContent]['line'] - $tokens[$nextLineToken]['line']); + } + } + + if ($isLast === true) { + $phpcsFile->recordMetric($stackPtr, 'Function spacing after last', $foundLines); + } else { + $phpcsFile->recordMetric($stackPtr, 'Function spacing after', $foundLines); + } + + if ($foundLines !== $requiredSpacing) { + $error = 'Expected %s blank line'; + if ($requiredSpacing !== 1) { + $error .= 's'; + } + + $error .= ' after function; %s found'; + $data = [ + $requiredSpacing, + $foundLines, + ]; + + $fix = $phpcsFile->addFixableError($error, $closer, $errorCode, $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = $nextLineToken; $i <= $nextContent; $i++) { + if ($tokens[$i]['line'] === $tokens[$nextContent]['line']) { + $phpcsFile->fixer->addContentBefore($i, str_repeat($phpcsFile->eolChar, $requiredSpacing)); + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + + /* + Check the number of blank lines + before the function. + */ + + $prevLineToken = null; + for ($i = $stackPtr; $i >= 0; $i--) { + if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { + continue; + } + + $prevLineToken = $i; + break; + } + + if ($prevLineToken === null) { + // Never found the previous line, which means + // there are 0 blank lines before the function. + $foundLines = 0; + $prevContent = 0; + $prevLineToken = 0; + } else { + $currentLine = $tokens[$stackPtr]['line']; + + $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, $prevLineToken, null, true); + + if ($tokens[$prevContent]['code'] === T_COMMENT + || isset(Tokens::$phpcsCommentTokens[$tokens[$prevContent]['code']]) === true + ) { + // Ignore comments as they can have different spacing rules, and this + // isn't a proper function comment anyway. + return; + } + + while ($tokens[$prevContent]['code'] === T_ATTRIBUTE_END + && $tokens[$prevContent]['line'] === ($currentLine - 1) + ) { + // Account for function attributes. + $currentLine = $tokens[$tokens[$prevContent]['attribute_opener']]['line']; + $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$prevContent]['attribute_opener'] - 1), null, true); + } + + if ($tokens[$prevContent]['code'] === T_DOC_COMMENT_CLOSE_TAG + && $tokens[$prevContent]['line'] === ($currentLine - 1) + ) { + // Account for function comments. + $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$prevContent]['comment_opener'] - 1), null, true); + } + + // 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. + $stopAt = 0; + 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. + return; + } + + if ($tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET + && $tokens[$tokens[$i]['scope_condition']]['code'] === T_FUNCTION + ) { + // Found a previous function. + return; + } + + $currentLine = $tokens[$i]['line']; + if ($currentLine === $prevLine) { + break; + } + + if ($tokens[($i - 1)]['line'] < $currentLine && $tokens[($i + 1)]['line'] > $currentLine) { + // This token is on a line by itself. If it is whitespace, the line is empty. + if ($tokens[$i]['code'] === T_WHITESPACE) { + $foundLines++; + } + } + + $i--; + }//end while + }//end if + + $requiredSpacing = $this->spacing; + $errorCode = 'Before'; + if ($isFirst === true) { + $requiredSpacing = $this->spacingBeforeFirst; + $errorCode = 'BeforeFirst'; + + $phpcsFile->recordMetric($stackPtr, 'Function spacing before first', $foundLines); + } else { + $phpcsFile->recordMetric($stackPtr, 'Function spacing before', $foundLines); + } + + if ($foundLines !== $requiredSpacing) { + $error = 'Expected %s blank line'; + if ($requiredSpacing !== 1) { + $error .= 's'; + } + + $error .= ' before function; %s found'; + $data = [ + $requiredSpacing, + $foundLines, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); + if ($fix === true) { + $nextSpace = $phpcsFile->findNext(T_WHITESPACE, ($prevContent + 1), $stackPtr); + if ($nextSpace === false) { + $nextSpace = ($stackPtr - 1); + } + + if ($foundLines < $requiredSpacing) { + $padding = str_repeat($phpcsFile->eolChar, ($requiredSpacing - $foundLines)); + $phpcsFile->fixer->addContent($prevLineToken, $padding); + } else { + $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($nextSpace + 1), null, true); + $phpcsFile->fixer->beginChangeset(); + for ($i = $nextSpace; $i < $nextContent; $i++) { + if ($tokens[$i]['line'] === $tokens[$prevContent]['line']) { + continue; + } + + if ($tokens[$i]['line'] === $tokens[$nextContent]['line']) { + $phpcsFile->fixer->addContentBefore($i, str_repeat($phpcsFile->eolChar, $requiredSpacing)); + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + }//end if + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php new file mode 100644 index 00000000..c4faf158 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php @@ -0,0 +1,91 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.3.0 Use the Generic.WhiteSpace.LanguageConstructSpacing sniff instead. + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util; + +class LanguageConstructSpacingSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_ECHO, + T_PRINT, + T_RETURN, + T_INCLUDE, + T_INCLUDE_ONCE, + T_REQUIRE, + T_REQUIRE_ONCE, + T_NEW, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[($stackPtr + 1)]) === false) { + // Skip if there is no next token. + return; + } + + if ($tokens[($stackPtr + 1)]['code'] === T_SEMICOLON) { + // No content for this language construct. + return; + } + + if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $content = $tokens[($stackPtr + 1)]['content']; + if ($content !== ' ') { + $error = 'Language constructs must be followed by a single space; expected 1 space but found "%s"'; + $data = [Util\Common::prepareForOutput($content)]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'IncorrectSingle', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + } else if ($tokens[($stackPtr + 1)]['code'] !== T_OPEN_PARENTHESIS) { + $error = 'Language constructs must be followed by a single space; expected "%s" but found "%s"'; + $data = [ + $tokens[$stackPtr]['content'].' '.$tokens[($stackPtr + 1)]['content'], + $tokens[$stackPtr]['content'].$tokens[($stackPtr + 1)]['content'], + ]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php new file mode 100644 index 00000000..d0f4c80c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php @@ -0,0 +1,102 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class LogicalOperatorSpacingSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$booleanOperators; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @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(); + + // Check there is one space before the operator. + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space before logical operator; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + } + } else { + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$stackPtr]['line'] === $tokens[$prev]['line'] + && $tokens[($stackPtr - 1)]['length'] !== 1 + ) { + $found = $tokens[($stackPtr - 1)]['length']; + $error = 'Expected 1 space before logical operator; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceBefore', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); + } + } + } + + // Check there is one space after the operator. + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space after logical operator; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter'); + if ($fix === true) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } + } else { + $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($tokens[$stackPtr]['line'] === $tokens[$next]['line'] + && $tokens[($stackPtr + 1)]['length'] !== 1 + ) { + $found = $tokens[($stackPtr + 1)]['length']; + $error = 'Expected 1 space after logical operator; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceAfter', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php new file mode 100644 index 00000000..773d25d4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php @@ -0,0 +1,252 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; +use PHP_CodeSniffer\Util\Tokens; + +class MemberVarSpacingSniff extends AbstractVariableSniff +{ + + /** + * The number of blank lines between member vars. + * + * @var integer + */ + public $spacing = 1; + + /** + * The number of blank lines before the first member var. + * + * @var integer + */ + public $spacingBeforeFirst = 1; + + + /** + * Processes the function tokens within the class. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @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. + */ + protected function processMemberVar(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $validPrefixes = Tokens::$methodPrefixes; + $validPrefixes[] = T_VAR; + + $startOfStatement = $phpcsFile->findPrevious($validPrefixes, ($stackPtr - 1), null, false, null, true); + if ($startOfStatement === false) { + return; + } + + $endOfStatement = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1), null, false, null, true); + + $ignore = $validPrefixes; + $ignore[T_WHITESPACE] = T_WHITESPACE; + + $start = $startOfStatement; + for ($prev = ($startOfStatement - 1); $prev >= 0; $prev--) { + if (isset($ignore[$tokens[$prev]['code']]) === true) { + continue; + } + + if ($tokens[$prev]['code'] === T_ATTRIBUTE_END + && isset($tokens[$prev]['attribute_opener']) === true + ) { + $prev = $tokens[$prev]['attribute_opener']; + $start = $prev; + continue; + } + + break; + } + + if (isset(Tokens::$commentTokens[$tokens[$prev]['code']]) === true) { + // Assume the comment belongs to the member var if it is on a line by itself. + $prevContent = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); + if ($tokens[$prevContent]['line'] !== $tokens[$prev]['line']) { + // Check the spacing, but then skip it. + $foundLines = ($tokens[$startOfStatement]['line'] - $tokens[$prev]['line'] - 1); + if ($foundLines > 0) { + for ($i = ($prev + 1); $i < $startOfStatement; $i++) { + if ($tokens[$i]['column'] !== 1) { + continue; + } + + if ($tokens[$i]['code'] === T_WHITESPACE + && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] + ) { + $error = 'Expected 0 blank lines after member var comment; %s found'; + $data = [$foundLines]; + $fix = $phpcsFile->addFixableError($error, $prev, 'AfterComment', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + // Inline comments have the newline included in the content but + // docblocks do not. + if ($tokens[$prev]['code'] === T_COMMENT) { + $phpcsFile->fixer->replaceToken($prev, rtrim($tokens[$prev]['content'])); + } + + for ($i = ($prev + 1); $i <= $startOfStatement; $i++) { + if ($tokens[$i]['line'] === $tokens[$startOfStatement]['line']) { + break; + } + + // Remove the newline after the docblock, and any entirely + // empty lines before the member var. + if (($tokens[$i]['code'] === T_WHITESPACE + && $tokens[$i]['line'] === $tokens[$prev]['line']) + || ($tokens[$i]['column'] === 1 + && $tokens[$i]['line'] !== $tokens[($i + 1)]['line']) + ) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + + $phpcsFile->fixer->addNewline($prev); + $phpcsFile->fixer->endChangeset(); + }//end if + + break; + }//end if + }//end for + }//end if + + $start = $prev; + }//end if + }//end if + + // There needs to be n blank lines before the var, not counting comments. + if ($start === $startOfStatement) { + // No comment found. + $first = $phpcsFile->findFirstOnLine(Tokens::$emptyTokens, $start, true); + if ($first === false) { + $first = $start; + } + } else if ($tokens[$start]['code'] === T_DOC_COMMENT_CLOSE_TAG) { + $first = $tokens[$start]['comment_opener']; + } else { + $first = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($start - 1), null, true); + $first = $phpcsFile->findNext(array_merge(Tokens::$commentTokens, [T_ATTRIBUTE]), ($first + 1)); + } + + // Determine if this is the first member var. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($first - 1), null, true); + if ($tokens[$prev]['code'] === T_CLOSE_CURLY_BRACKET + && isset($tokens[$prev]['scope_condition']) === true + && $tokens[$tokens[$prev]['scope_condition']]['code'] === T_FUNCTION + ) { + return; + } + + if ($tokens[$prev]['code'] === T_OPEN_CURLY_BRACKET + && isset(Tokens::$ooScopeTokens[$tokens[$tokens[$prev]['scope_condition']]['code']]) === true + ) { + $errorMsg = 'Expected %s blank line(s) before first member var; %s found'; + $errorCode = 'FirstIncorrect'; + $spacing = (int) $this->spacingBeforeFirst; + } else { + $errorMsg = 'Expected %s blank line(s) before member var; %s found'; + $errorCode = 'Incorrect'; + $spacing = (int) $this->spacing; + } + + $foundLines = ($tokens[$first]['line'] - $tokens[$prev]['line'] - 1); + + if ($errorCode === 'FirstIncorrect') { + $phpcsFile->recordMetric($stackPtr, 'Member var spacing before first', $foundLines); + } else { + $phpcsFile->recordMetric($stackPtr, 'Member var spacing before', $foundLines); + } + + if ($foundLines === $spacing) { + if ($endOfStatement !== false) { + return $endOfStatement; + } + + return; + } + + $data = [ + $spacing, + $foundLines, + ]; + + $fix = $phpcsFile->addFixableError($errorMsg, $startOfStatement, $errorCode, $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prev + 1); $i < $first; $i++) { + if ($tokens[$i]['line'] === $tokens[$prev]['line']) { + continue; + } + + if ($tokens[$i]['line'] === $tokens[$first]['line']) { + for ($x = 1; $x <= $spacing; $x++) { + $phpcsFile->fixer->addNewlineBefore($i); + } + + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + }//end if + + if ($endOfStatement !== false) { + return $endOfStatement; + } + + }//end processMemberVar() + + + /** + * Processes normal variables. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processVariable(File $phpcsFile, $stackPtr) + { + /* + We don't care about normal variables. + */ + + }//end processVariable() + + + /** + * Processes variables in double quoted strings. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position where the token was found. + * + * @return void + */ + protected function processVariableInString(File $phpcsFile, $stackPtr) + { + /* + We don't care about normal variables. + */ + + }//end processVariableInString() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php new file mode 100644 index 00000000..1c27be7a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php @@ -0,0 +1,167 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ObjectOperatorSpacingSniff implements Sniff +{ + + /** + * Allow newlines instead of spaces. + * + * @var boolean + */ + public $ignoreNewlines = false; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OBJECT_OPERATOR, + T_DOUBLE_COLON, + T_NULLSAFE_OBJECT_OPERATOR, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { + $before = 0; + } else { + if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { + $before = 'newline'; + } else { + $before = $tokens[($stackPtr - 1)]['length']; + } + } + + $phpcsFile->recordMetric($stackPtr, 'Spacing before object operator', $before); + $this->checkSpacingBeforeOperator($phpcsFile, $stackPtr, $before); + + if (isset($tokens[($stackPtr + 1)]) === false + || isset($tokens[($stackPtr + 2)]) === false + ) { + return; + } + + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + $after = 0; + } else { + if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { + $after = 'newline'; + } else { + $after = $tokens[($stackPtr + 1)]['length']; + } + } + + $phpcsFile->recordMetric($stackPtr, 'Spacing after object operator', $after); + $this->checkSpacingAfterOperator($phpcsFile, $stackPtr, $after); + + }//end process() + + + /** + * Check the spacing before the operator. + * + * @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 mixed $before The number of spaces found before the + * operator or the string 'newline'. + * + * @return boolean true if there was no error, false otherwise. + */ + protected function checkSpacingBeforeOperator(File $phpcsFile, $stackPtr, $before) + { + if ($before !== 0 + && ($before !== 'newline' || $this->ignoreNewlines === false) + ) { + $error = 'Space found before object operator'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before'); + if ($fix === true) { + $tokens = $phpcsFile->getTokens(); + $curPos = ($stackPtr - 1); + + $phpcsFile->fixer->beginChangeset(); + while ($tokens[$curPos]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($curPos, ''); + --$curPos; + } + + $phpcsFile->fixer->endChangeset(); + } + + return false; + } + + return true; + + }//end checkSpacingBeforeOperator() + + + /** + * Check the spacing after the operator. + * + * @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 mixed $after The number of spaces found after the + * operator or the string 'newline'. + * + * @return boolean true if there was no error, false otherwise. + */ + protected function checkSpacingAfterOperator(File $phpcsFile, $stackPtr, $after) + { + if ($after !== 0 + && ($after !== 'newline' || $this->ignoreNewlines === false) + ) { + $error = 'Space found after object operator'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'After'); + if ($fix === true) { + $tokens = $phpcsFile->getTokens(); + $curPos = ($stackPtr + 1); + + $phpcsFile->fixer->beginChangeset(); + while ($tokens[$curPos]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($curPos, ''); + ++$curPos; + } + + $phpcsFile->fixer->endChangeset(); + } + + return false; + } + + return true; + + }//end checkSpacingAfterOperator() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php new file mode 100644 index 00000000..2a87978a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php @@ -0,0 +1,409 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class OperatorSpacingSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + /** + * Allow newlines instead of spaces. + * + * @var boolean + */ + public $ignoreNewlines = false; + + /** + * Don't check spacing for assignment operators. + * + * This allows multiple assignment statements to be aligned. + * + * @var boolean + */ + public $ignoreSpacingBeforeAssignments = true; + + /** + * A list of tokens that aren't considered as operands. + * + * @var string[] + */ + private $nonOperandTokens = []; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + /* + First we setup an array of all the tokens that can come before + a T_MINUS or T_PLUS token to indicate that the token is not being + used as an operator. + */ + + // Trying to operate on a negative value; eg. ($var * -1). + $this->nonOperandTokens = Tokens::$operators; + + // Trying to compare a negative value; eg. ($var === -1). + $this->nonOperandTokens += Tokens::$comparisonTokens; + + // Trying to compare a negative value; eg. ($var || -1 === $b). + $this->nonOperandTokens += Tokens::$booleanOperators; + + // Trying to assign a negative value; eg. ($var = -1). + $this->nonOperandTokens += Tokens::$assignmentTokens; + + // Returning/printing a negative value; eg. (return -1). + $this->nonOperandTokens += [ + T_RETURN => T_RETURN, + T_ECHO => T_ECHO, + T_EXIT => T_EXIT, + T_PRINT => T_PRINT, + T_YIELD => T_YIELD, + T_FN_ARROW => T_FN_ARROW, + T_MATCH_ARROW => T_MATCH_ARROW, + ]; + + // Trying to use a negative value; eg. myFunction($var, -2). + $this->nonOperandTokens += [ + T_CASE => T_CASE, + T_COLON => T_COLON, + T_COMMA => T_COMMA, + T_INLINE_ELSE => T_INLINE_ELSE, + T_INLINE_THEN => T_INLINE_THEN, + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, + T_OPEN_SHORT_ARRAY => T_OPEN_SHORT_ARRAY, + T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, + T_STRING_CONCAT => T_STRING_CONCAT, + ]; + + // Casting a negative value; eg. (array) -$a. + $this->nonOperandTokens += Tokens::$castTokens; + + /* + These are the tokens the sniff is looking for. + */ + + $targets = Tokens::$comparisonTokens; + $targets += Tokens::$operators; + $targets += Tokens::$assignmentTokens; + $targets[] = T_INLINE_THEN; + $targets[] = T_INLINE_ELSE; + $targets[] = T_INSTANCEOF; + + // Also register the contexts we want to specifically skip over. + $targets[] = T_DECLARE; + + return $targets; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @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. Return `$phpcsFile->numTokens` to skip + * the rest of the file. + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + // Skip over declare statements as those should be handled by different sniffs. + if ($tokens[$stackPtr]['code'] === T_DECLARE) { + if (isset($tokens[$stackPtr]['parenthesis_closer']) === false) { + // Parse error / live coding. + return $phpcsFile->numTokens; + } + + return $tokens[$stackPtr]['parenthesis_closer']; + } + + if ($this->isOperator($phpcsFile, $stackPtr) === false) { + return; + } + + if ($tokens[$stackPtr]['code'] === T_BITWISE_AND) { + // Check there is one space before the & operator. + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space before "&" operator; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeAmp'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + } + + $phpcsFile->recordMetric($stackPtr, 'Space before operator', 0); + } else { + if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($stackPtr - 1)]['length']; + } + + $phpcsFile->recordMetric($stackPtr, 'Space before operator', $found); + if ($found !== 1 + && ($found !== 'newline' || $this->ignoreNewlines === false) + ) { + $error = 'Expected 1 space before "&" operator; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeAmp', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); + } + } + }//end if + + $hasNext = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($hasNext === false) { + // Live coding/parse error at end of file. + return; + } + + // Check there is one space after the & operator. + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space after "&" operator; 0 found'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterAmp'); + if ($fix === true) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } + + $phpcsFile->recordMetric($stackPtr, 'Space after operator', 0); + } else { + if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($stackPtr + 1)]['length']; + } + + $phpcsFile->recordMetric($stackPtr, 'Space after operator', $found); + if ($found !== 1 + && ($found !== 'newline' || $this->ignoreNewlines === false) + ) { + $error = 'Expected 1 space after "&" operator; %s found'; + $data = [$found]; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterAmp', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + }//end if + + return; + }//end if + + $operator = $tokens[$stackPtr]['content']; + + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE + && (($tokens[($stackPtr - 1)]['code'] === T_INLINE_THEN + && $tokens[($stackPtr)]['code'] === T_INLINE_ELSE) === false) + ) { + $error = "Expected 1 space before \"$operator\"; 0 found"; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore'); + if ($fix === true) { + $phpcsFile->fixer->addContentBefore($stackPtr, ' '); + } + + $phpcsFile->recordMetric($stackPtr, 'Space before operator', 0); + } else if (isset(Tokens::$assignmentTokens[$tokens[$stackPtr]['code']]) === false + || $this->ignoreSpacingBeforeAssignments === false + ) { + // Throw an error for assignments only if enabled using the sniff property + // because other standards allow multiple spaces to align assignments. + $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$prevNonWhitespace]['line'] !== $tokens[$stackPtr]['line']) { + $found = 'newline'; + } else { + $found = $tokens[($stackPtr - 1)]['length']; + } + + $phpcsFile->recordMetric($stackPtr, 'Space before operator', $found); + if ($found !== 1 + && ($found !== 'newline' || $this->ignoreNewlines === false) + ) { + $error = 'Expected 1 space before "%s"; %s found'; + $data = [ + $operator, + $found, + ]; + + if (isset(Tokens::$commentTokens[$tokens[$prevNonWhitespace]['code']]) === true) { + // Throw a non-fixable error if the token on the previous line is a comment token, + // as in that case it's not for the sniff to decide where the comment should be moved to + // and it would get us into unfixable situations as the new line char is included + // in the contents of the comment token. + $phpcsFile->addError($error, $stackPtr, 'SpacingBefore', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + if ($found === 'newline') { + $i = ($stackPtr - 2); + while ($tokens[$i]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($i, ''); + $i--; + } + } + + $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + }//end if + + $hasNext = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($hasNext === false) { + // Live coding/parse error at end of file. + return; + } + + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + // Skip short ternary such as: "$foo = $bar ?: true;". + if (($tokens[$stackPtr]['code'] === T_INLINE_THEN + && $tokens[($stackPtr + 1)]['code'] === T_INLINE_ELSE) + ) { + return; + } + + $error = "Expected 1 space after \"$operator\"; 0 found"; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter'); + if ($fix === true) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } + + $phpcsFile->recordMetric($stackPtr, 'Space after operator', 0); + } else { + if (isset($tokens[($stackPtr + 2)]) === true + && $tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line'] + ) { + $found = 'newline'; + } else { + $found = $tokens[($stackPtr + 1)]['length']; + } + + $phpcsFile->recordMetric($stackPtr, 'Space after operator', $found); + if ($found !== 1 + && ($found !== 'newline' || $this->ignoreNewlines === false) + ) { + $error = 'Expected 1 space after "%s"; %s found'; + $data = [ + $operator, + $found, + ]; + + $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + if ($nextNonWhitespace !== false + && isset(Tokens::$commentTokens[$tokens[$nextNonWhitespace]['code']]) === true + && $found === 'newline' + ) { + // Don't auto-fix when it's a comment or PHPCS annotation on a new line as + // it causes fixer conflicts and can cause the meaning of annotations to change. + $phpcsFile->addError($error, $stackPtr, 'SpacingAfter', $data); + } else { + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfter', $data); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + }//end if + }//end if + + }//end process() + + + /** + * Checks if an operator is actually a different type of token in the current context. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. + * @param int $stackPtr The position of the operator in + * the stack. + * + * @return boolean + */ + protected function isOperator(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$stackPtr]['code'] === T_DECLARE) { + return false; + } + + // Skip default values in function declarations. + // Skip declare statements. + if ($tokens[$stackPtr]['code'] === T_EQUAL) { + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']); + $bracket = array_pop($parenthesis); + if (isset($tokens[$bracket]['parenthesis_owner']) === true) { + $function = $tokens[$bracket]['parenthesis_owner']; + if ($tokens[$function]['code'] === T_FUNCTION + || $tokens[$function]['code'] === T_CLOSURE + || $tokens[$function]['code'] === T_FN + ) { + return false; + } + } + } + } + + if ($tokens[$stackPtr]['code'] === T_EQUAL) { + // Skip for '=&' case. + if (isset($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)]['code'] === T_BITWISE_AND + ) { + return false; + } + } + + if ($tokens[$stackPtr]['code'] === T_BITWISE_AND) { + // If it's not a reference, then we expect one space either side of the + // bitwise operator. + if ($phpcsFile->isReference($stackPtr) === true) { + return false; + } + } + + if ($tokens[$stackPtr]['code'] === T_MINUS || $tokens[$stackPtr]['code'] === T_PLUS) { + // Check minus spacing, but make sure we aren't just assigning + // a minus value or returning one. + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if (isset($this->nonOperandTokens[$tokens[$prev]['code']]) === true) { + return false; + } + }//end if + + return true; + + }//end isOperator() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php new file mode 100644 index 00000000..ec8218fe --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php @@ -0,0 +1,81 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class PropertyLabelSpacingSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = ['JS']; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_PROPERTY, + T_LABEL, + ]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $colon = $phpcsFile->findNext(T_COLON, ($stackPtr + 1)); + + if ($colon !== ($stackPtr + 1)) { + $error = 'There must be no space before the colon in a property/label declaration'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); + } + } + + if ($tokens[($colon + 1)]['code'] !== T_WHITESPACE || $tokens[($colon + 1)]['content'] !== ' ') { + $error = 'There must be a single space after the colon in a property/label declaration'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'After'); + if ($fix === true) { + if ($tokens[($colon + 1)]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken(($colon + 1), ' '); + } else { + $phpcsFile->fixer->addContent($colon, ' '); + } + } + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php new file mode 100644 index 00000000..852759e5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php @@ -0,0 +1,114 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ScopeClosingBraceSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return Tokens::$scopeOpeners; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. + * @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(); + + // If this is an inline condition (ie. there is no scope opener), then + // return, as this is not a new scope. + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + return; + } + + // We need to actually find the first piece of content on this line, + // as if this is a method with tokens before it (public, static etc) + // or an if with an else before it, then we need to start the scope + // checking from there, rather than the current token. + $lineStart = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], $stackPtr, true); + while ($tokens[$lineStart]['code'] === T_CONSTANT_ENCAPSED_STRING + && $tokens[($lineStart - 1)]['code'] === T_CONSTANT_ENCAPSED_STRING + ) { + $lineStart = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], ($lineStart - 1), true); + } + + $startColumn = $tokens[$lineStart]['column']; + $scopeStart = $tokens[$stackPtr]['scope_opener']; + $scopeEnd = $tokens[$stackPtr]['scope_closer']; + + // Check that the closing brace is on it's own line. + $lastContent = $phpcsFile->findPrevious([T_INLINE_HTML, T_WHITESPACE, T_OPEN_TAG], ($scopeEnd - 1), $scopeStart, true); + for ($lineStart = $scopeEnd; $tokens[$lineStart]['column'] > 1; $lineStart--); + + if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line'] + || ($tokens[$lineStart]['code'] === T_INLINE_HTML + && trim($tokens[$lineStart]['content']) !== '') + ) { + $error = 'Closing brace must be on a line by itself'; + $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'ContentBefore'); + if ($fix === true) { + if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line']) { + $phpcsFile->fixer->addNewlineBefore($scopeEnd); + } else { + $phpcsFile->fixer->addNewlineBefore(($lineStart + 1)); + } + } + + return; + } + + // Check now that the closing brace is lined up correctly. + $lineStart = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], $scopeEnd, true); + $braceIndent = $tokens[$lineStart]['column']; + if ($tokens[$stackPtr]['code'] !== T_DEFAULT + && $tokens[$stackPtr]['code'] !== T_CASE + && $braceIndent !== $startColumn + ) { + $error = 'Closing brace indented incorrectly; expected %s spaces, found %s'; + $data = [ + ($startColumn - 1), + ($braceIndent - 1), + ]; + + $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data); + if ($fix === true) { + $diff = ($startColumn - $braceIndent); + if ($diff > 0) { + $phpcsFile->fixer->addContentBefore($lineStart, str_repeat(' ', $diff)); + } else { + $phpcsFile->fixer->substrToken(($lineStart - 1), 0, $diff); + } + } + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php new file mode 100644 index 00000000..65cc13f9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php @@ -0,0 +1,172 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ScopeKeywordSpacingSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + $register = Tokens::$scopeModifiers; + $register[] = T_STATIC; + $register[] = T_READONLY; + return $register; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + if (isset($tokens[($stackPtr + 1)]) === false) { + return; + } + + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + + if ($tokens[$stackPtr]['code'] === T_STATIC) { + if (($nextToken === false || $tokens[$nextToken]['code'] === T_DOUBLE_COLON) + || $tokens[$prevToken]['code'] === T_NEW + ) { + // Late static binding, e.g., static:: OR new static() usage or live coding. + return; + } + + if ($prevToken !== false + && $tokens[$prevToken]['code'] === T_TYPE_UNION + ) { + // Not a scope keyword, but a union return type. + return; + } + + if ($prevToken !== false + && $tokens[$prevToken]['code'] === T_NULLABLE + ) { + // Not a scope keyword, but a return type. + return; + } + + if ($prevToken !== false + && $tokens[$prevToken]['code'] === T_COLON + ) { + $prevPrevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), null, true); + if ($prevPrevToken !== false + && $tokens[$prevPrevToken]['code'] === T_CLOSE_PARENTHESIS + ) { + // Not a scope keyword, but a return type. + return; + } + } + }//end if + + if ($tokens[$prevToken]['code'] === T_AS) { + // Trait visibility change, e.g., "use HelloWorld { sayHello as private; }". + return; + } + + $isInFunctionDeclaration = false; + if (empty($tokens[$stackPtr]['nested_parenthesis']) === false) { + // Check if this is PHP 8.0 constructor property promotion. + // In that case, we can't have multi-property definitions. + $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; + $lastCloseParens = end($nestedParens); + if (isset($tokens[$lastCloseParens]['parenthesis_owner']) === true + && $tokens[$tokens[$lastCloseParens]['parenthesis_owner']]['code'] === T_FUNCTION + ) { + $isInFunctionDeclaration = true; + } + } + + if ($nextToken !== false + && $tokens[$nextToken]['code'] === T_VARIABLE + && $isInFunctionDeclaration === false + ) { + $endOfStatement = $phpcsFile->findNext(T_SEMICOLON, ($nextToken + 1)); + if ($endOfStatement === false) { + // Live coding. + return; + } + + $multiProperty = $phpcsFile->findNext(T_VARIABLE, ($nextToken + 1), $endOfStatement); + if ($multiProperty !== false + && $tokens[$stackPtr]['line'] !== $tokens[$nextToken]['line'] + && $tokens[$nextToken]['line'] !== $tokens[$endOfStatement]['line'] + ) { + // Allow for multiple properties definitions to each be on their own line. + return; + } + } + + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + $spacing = 0; + } else if (isset($tokens[($stackPtr + 2)]) === false) { + // Parse error/live coding. Bow out. + return; + } else { + if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { + $spacing = 'newline'; + } else { + $spacing = $tokens[($stackPtr + 1)]['length']; + } + } + + if ($spacing !== 1) { + $error = 'Scope keyword "%s" must be followed by a single space; found %s'; + $data = [ + $tokens[$stackPtr]['content'], + $spacing, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); + if ($fix === true) { + if ($spacing === 0) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } else { + $phpcsFile->fixer->beginChangeset(); + + for ($i = ($stackPtr + 2); $i < $phpcsFile->numTokens; $i++) { + if (isset($tokens[$i]) === false || $tokens[$i]['code'] !== T_WHITESPACE) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + $phpcsFile->fixer->endChangeset(); + } + }//end if + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php new file mode 100644 index 00000000..dbf719d2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php @@ -0,0 +1,116 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class SemicolonSpacingSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + ]; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_SEMICOLON]; + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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(); + + $prevType = $tokens[($stackPtr - 1)]['code']; + if (isset(Tokens::$emptyTokens[$prevType]) === false) { + return; + } + + $nonSpace = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 2), null, true); + + // Detect whether this is a semicolon for a condition in a `for()` control structure. + $forCondition = false; + if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { + $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; + $closeParenthesis = end($nestedParens); + + if (isset($tokens[$closeParenthesis]['parenthesis_owner']) === true) { + $owner = $tokens[$closeParenthesis]['parenthesis_owner']; + + if ($tokens[$owner]['code'] === T_FOR) { + $forCondition = true; + $nonSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 2), null, true); + } + } + } + + if ($tokens[$nonSpace]['code'] === T_SEMICOLON + || ($forCondition === true && $nonSpace === $tokens[$owner]['parenthesis_opener']) + || (isset($tokens[$nonSpace]['scope_opener']) === true + && $tokens[$nonSpace]['scope_opener'] === $nonSpace) + ) { + // Empty statement. + return; + } + + $expected = $tokens[$nonSpace]['content'].';'; + $found = $phpcsFile->getTokensAsString($nonSpace, ($stackPtr - $nonSpace)).';'; + $found = str_replace("\n", '\n', $found); + $found = str_replace("\r", '\r', $found); + $found = str_replace("\t", '\t', $found); + $error = 'Space found before semicolon; expected "%s" but found "%s"'; + $data = [ + $expected, + $found, + ]; + + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $i = ($stackPtr - 1); + while (($tokens[$i]['code'] === T_WHITESPACE) && ($i > $nonSpace)) { + $phpcsFile->fixer->replaceToken($i, ''); + $i--; + } + + $phpcsFile->fixer->addContent($nonSpace, ';'); + $phpcsFile->fixer->replaceToken($stackPtr, ''); + + $phpcsFile->fixer->endChangeset(); + } + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php new file mode 100644 index 00000000..f13baba9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php @@ -0,0 +1,265 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class SuperfluousWhitespaceSniff implements Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = [ + 'PHP', + 'JS', + 'CSS', + ]; + + /** + * If TRUE, whitespace rules are not checked for blank lines. + * + * Blank lines are those that contain only whitespace. + * + * @var boolean + */ + public $ignoreBlankLines = false; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + T_CLOSE_TAG, + T_WHITESPACE, + T_COMMENT, + T_DOC_COMMENT_WHITESPACE, + T_CLOSURE, + ]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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(); + + if ($tokens[$stackPtr]['code'] === T_OPEN_TAG) { + /* + Check for start of file whitespace. + */ + + if ($phpcsFile->tokenizerType !== 'PHP') { + // The first token is always the open tag inserted when tokenized + // and the second token is always the first piece of content in + // the file. If the second token is whitespace, there was + // whitespace at the start of the file. + if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + return; + } + + if ($phpcsFile->fixer->enabled === true) { + $stackPtr = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); + } + } else { + // If it's the first token, then there is no space. + if ($stackPtr === 0) { + return; + } + + $beforeOpen = ''; + + for ($i = ($stackPtr - 1); $i >= 0; $i--) { + // If we find something that isn't inline html then there is something previous in the file. + if ($tokens[$i]['type'] !== 'T_INLINE_HTML') { + return; + } + + $beforeOpen .= $tokens[$i]['content']; + } + + // If we have ended up with inline html make sure it isn't just whitespace. + if (preg_match('`^[\pZ\s]+$`u', $beforeOpen) !== 1) { + return; + } + }//end if + + $fix = $phpcsFile->addFixableError('Additional whitespace found at start of file', $stackPtr, 'StartFile'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = 0; $i < $stackPtr; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } else if ($tokens[$stackPtr]['code'] === T_CLOSE_TAG) { + /* + Check for end of file whitespace. + */ + + if ($phpcsFile->tokenizerType === 'PHP') { + if (isset($tokens[($stackPtr + 1)]) === false) { + // The close PHP token is the last in the file. + return; + } + + $afterClose = ''; + + for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { + // If we find something that isn't inline HTML then there + // is more to the file. + if ($tokens[$i]['type'] !== 'T_INLINE_HTML') { + return; + } + + $afterClose .= $tokens[$i]['content']; + } + + // If we have ended up with inline html make sure it isn't just whitespace. + if (preg_match('`^[\pZ\s]+$`u', $afterClose) !== 1) { + return; + } + } else { + // The last token is always the close tag inserted when tokenized + // and the second last token is always the last piece of content in + // the file. If the second last token is whitespace, there was + // whitespace at the end of the file. + $stackPtr--; + + // The pointer is now looking at the last content in the file and + // not the fake PHP end tag the tokenizer inserted. + if ($tokens[$stackPtr]['code'] !== T_WHITESPACE) { + return; + } + + // Allow a single newline at the end of the last line in the file. + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE + && $tokens[$stackPtr]['content'] === $phpcsFile->eolChar + ) { + return; + } + }//end if + + $fix = $phpcsFile->addFixableError('Additional whitespace found at end of file', $stackPtr, 'EndFile'); + if ($fix === true) { + if ($phpcsFile->tokenizerType !== 'PHP') { + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + $stackPtr = ($prev + 1); + } + + $phpcsFile->fixer->beginChangeset(); + for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + } else { + /* + Check for end of line whitespace. + */ + + // Ignore whitespace that is not at the end of a line. + if (isset($tokens[($stackPtr + 1)]['line']) === true + && $tokens[($stackPtr + 1)]['line'] === $tokens[$stackPtr]['line'] + ) { + return; + } + + // Ignore blank lines if required. + if ($this->ignoreBlankLines === true + && $tokens[$stackPtr]['code'] === T_WHITESPACE + && $tokens[($stackPtr - 1)]['line'] !== $tokens[$stackPtr]['line'] + ) { + return; + } + + $tokenContent = rtrim($tokens[$stackPtr]['content'], $phpcsFile->eolChar); + if (empty($tokenContent) === false) { + if ($tokenContent !== rtrim($tokenContent)) { + $fix = $phpcsFile->addFixableError('Whitespace found at end of line', $stackPtr, 'EndLine'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($stackPtr, rtrim($tokenContent).$phpcsFile->eolChar); + } + } + } else if ($tokens[($stackPtr - 1)]['content'] !== rtrim($tokens[($stackPtr - 1)]['content']) + && $tokens[($stackPtr - 1)]['line'] === $tokens[$stackPtr]['line'] + ) { + $fix = $phpcsFile->addFixableError('Whitespace found at end of line', ($stackPtr - 1), 'EndLine'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($stackPtr - 1), rtrim($tokens[($stackPtr - 1)]['content'])); + } + } + + /* + Check for multiple blank lines in a function. + */ + + if (($phpcsFile->hasCondition($stackPtr, [T_FUNCTION, T_CLOSURE]) === true) + && $tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] + && $tokens[($stackPtr - 2)]['line'] === $tokens[($stackPtr - 1)]['line'] + ) { + // Properties and functions in nested classes have their own rules for spacing. + $conditions = $tokens[$stackPtr]['conditions']; + $deepestScope = end($conditions); + if ($deepestScope === T_ANON_CLASS) { + return; + } + + // This is an empty line and the line before this one is not + // empty, so this could be the start of a multiple empty + // line block. + $next = $phpcsFile->findNext(T_WHITESPACE, $stackPtr, null, true); + $lines = ($tokens[$next]['line'] - $tokens[$stackPtr]['line']); + if ($lines > 1) { + $error = 'Functions must not contain multiple empty lines in a row; found %s empty lines'; + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'EmptyLines', [$lines]); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $i = $stackPtr; + while ($tokens[$i]['line'] !== $tokens[$next]['line']) { + $phpcsFile->fixer->replaceToken($i, ''); + $i++; + } + + $phpcsFile->fixer->addNewlineBefore($i); + $phpcsFile->fixer->endChangeset(); + } + } + }//end if + }//end if + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc new file mode 100644 index 00000000..8ffc868a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc @@ -0,0 +1,31 @@ + 'bar', + 'bar' => 'foo', +]; + +if ($foo) {} +[$a, $b] = $c; + +echo foo()[ 1 ]; + +echo $this->addedCustomFunctions['nonce']; +echo $this->deprecated_functions[ $function_name ]['version']; + +echo [ 1,2,3 ][0]; +echo [ 1,2,3 ][ 0 ]; +echo 'PHP'[ 0 ]; + +$array = []; +$var = $var[$var[$var]]]; // Syntax error +$var = $var[$var[$var]; // Syntax error + +$myArray[ /* key start */'key'] = $value; +$myArray[ /* key start */'key'/* key end */ ] = $value; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..41d66409 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed @@ -0,0 +1,31 @@ + 'bar', + 'bar' => 'foo', +]; + +if ($foo) {} +[$a, $b] = $c; + +echo foo()[1]; + +echo $this->addedCustomFunctions['nonce']; +echo $this->deprecated_functions[$function_name]['version']; + +echo [ 1,2,3 ][0]; +echo [ 1,2,3 ][0]; +echo 'PHP'[0]; + +$array = []; +$var = $var[$var[$var]]]; // Syntax error +$var = $var[$var[$var]; // Syntax error + +$myArray[/* key start */'key'] = $value; +$myArray[/* key start */'key'/* key end */] = $value; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php new file mode 100644 index 00000000..0e687b80 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php @@ -0,0 +1,62 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Arrays; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ArrayBracketSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayBracketSpacingSniff + */ +final class ArrayBracketSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 5 => 3, + 7 => 3, + 17 => 2, + 20 => 2, + 23 => 2, + 24 => 2, + 30 => 1, + 31 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc new file mode 100644 index 00000000..cdbfff6c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc @@ -0,0 +1,549 @@ + 1, + ); +} + +class TestClass +{ + public $good = array( + 'width' => '', + 'height' => '', + ); + + private $_bad = Array( + 'width' => '', + 'height' => '' + ); + + + public function test() + { + $truck = array( + 'width' => '', + 'height' => '', + ); + + $plane = Array( + 'width' => '', + 'height' => '', + ); + + $car = array( + 'width' => '', + 'height' => '', + ); + + $bus = array( + 'width' => '', + 'height' => '' + ); + + $train = array ( + TRUE, + FALSE, + 'aaa' + ); + + $inline = array('aaa', 'bbb', 'ccc'); + $inline = array('aaa'); + $inline = Array('aaa'); + + $bigone = array( + 'name' => 'bigone', + 'children' => Array( + '1a' => 'child', + '11b' => 'child', + '111c' => 'child', + 'children' => Array( + 'child' => 'aaa', + ), + ), + 'short_name' => 'big' + ); + } + +}//end class + +$value = array ( ); +$value = array( ); +$value = array('1'=>$one, '2' => $two, '3'=> $three, '4' =>$four); +$value = array('1'=>$one); + +if (in_array('1', array('1','2','3')) === TRUE) { + $value = in_array('1', array('1' , '2', '3','4')); +} + +$value = array( + '1'=> TRUE, + FALSE, + '3' => 'aaa',); + +$value = array( + '1'=> TRUE, + FALSE, + ); + +$value = array( + TRUE, + '1' => FALSE, + ); + +$value = array(1, + 2 , + 3 , + ); + +$value = array(1 => $one, + 2 => $two , + 3 => $three , + ); + +$value = array( + 'tag' => $tag, + 'space' => $this->_getIndentation($tag, $tagElement), + ); + +$expected = array( + array( + '1' => 1, + '1' => 2, + ), + ); + +$expected = array( + array( + '1' => 1, + '1' => 2 + ) + ); + +// Space in second arg. +$args = array( + '"'.$this->id.'"', + (int) $hasSessions, + ); + +// No errors. +$paths = array( + Init::ROOT_DIR.'/Systems' => 'Systems', + Init::ROOT_DIR.'/Installer' => 'Systems', + ); + +$x = array( + ); + +$x = array('test' + ); +$x = array('test', + ); +$x = array('name' => 'test', + ); + +$x = array( + $x, + ); + +$func = array( + $x, + 'get'.$x.'Replacement' + ); + +$array = array( + 'input_one' => 'one', + 'inputTwo' => 'two', + 'input_3' => 3, + ); + +$array = array( + 'input_one', + 'inputTwo', + 'input_3', + ); + +// Malformed +$foo = array(1 +, 2); + +$listItems[$aliasPath] = array('itemContent' => implode('
    ', $aliases)); + +$listItems[$aliasPath] = array( + 'itemContent' => implode('
    ', $aliases) + ); + +$x = array + ( + $x, + $y, + ); + +$x = array +( + $x, + $y, + ); + +$x = array( + + $x, + $y, + ); + +$test = array( + 'test' => TestFunction::blah( + $value1, + $value2 + ), + ); + +$c = array('a' => 1,); + +function b() +{ + $a = array( + 'a' => a('a'), + + ); + +} + +$foo = Array('[',']',':',"\n","\r"); +$bar = Array('[',']',':',' ',' '); + +function foo() +{ + return array($a, $b->screen); +} + +$array = array( + 'name' => 'contactSubject', + 'required' => TRUE, + 'validators' => array( + new \Zend\Validator\InArray(array('haystack' => array_keys($aSubjects))), + ), + ); + +$var = array( + 'ViewHelper', + array('Foo'), + 'Errors', + ); + +$data = array( + 'first', + 'second', + 'third', + // Add more here + ); + +$data = array( + 'first', + 'second', + //'third', + ); + +$data = array( + 'first', + 'second' + //'third', + ); + +$foo = array( + $this->getViewName() . '.id' => 'value', + $this->getViewName() . '.title' => 'value', + ); + +$foo = array( + $this->getViewName() . '.id', + $this->getViewName() . '.title', + ); + +$weightings = array( + T_CLOSURE => 100, + + /* + Conditions. + */ + + T_WHILE => 50, + + /* + Operators and arithmetic. + */ + + T_BITWISE_AND => 8, + + T_BOOLEAN_AND => 5, + + /* + Equality. + */ + + T_IS_GREATER_OR_EQUAL => 5, + ); + +foreach (array( + 'foo' => 'bar', + 'foobaz' => 'bazzy', + ) as $key => $value) { +} + +$ids = array( + '1', // Foo. + '13', // Bar. + ); + +array( + 'key1' => function($bar) { + return $bar; + }, + 'key2' => function($foo) { + return $foo; + }, + 'key3' => function($bar) { + return $bar; + } +); + +array( + 'key1' => array( + '1', + '2', + ) +); + +$var = array( + 'tab_template' => ' +
  • %s
  • ', + 'panel_template' => ' +
    + %s +
    ', + ); + +function test() : array +{ + return []; +} + +$fields = array( + 'id' => array('type' => 'INT'), + 'value' => array('type' => 'VARCHAR')); + +get_current_screen()->add_help_tab( array( + 'id' => << false); + +$x = array( + 'xxxx' => array('aaaaaaaaaa' => 'ccccccccccc', + 'bbbbbbbb' => false), +); + +$foo = array + ('foo' => array + ('bar1' => 1 + ,'bar2' => 1 + ,'bar3' => 1 + ,'bar4' => 1 + ,'bar5' => 1 + ) + ); + +$foo = array( + '1' => $row['status'] === 'rejected' + ? self::REJECTED_CODE + : self::VERIFIED_CODE, + '2' => in_array($row['status'], array('notverified', 'unverified'), true) + ? self::STATUS_PENDING + : self::STATUS_VERIFIED, + '3' => strtotime($row['date']), + ); + +$foo = foo( + array( + // comment + ) +); + +$foo = array( + << lorem( + 1 + ), 2 => 2, +); + +$foo = array( + 'тип' => 'авто', + 'цвет' => 'синий', + ); + +$paths = array( + Init::ROOT_DIR.'/тип' => 'авто', + Init::ROOT_DIR.'/цвет' => 'синий', + ); + +$foo = array(<< fn() => return 1, + 'bb' => fn() => return 2, + 'ccc' => ( true ) ? + fn() => return 1 : + fn() => return 2, + ); + +$array = array( + 1 => '1', + 2 => fn ($x) => yield 'a' => $x, + 3 => '3', + ); + +$foo = array( + $this->fn => 'value', + $foo->fn => 'value', + ); + +array($a, $b, +$c); + +array('a' => $a, 'b' => $b, +'c' => $c); + +array( + static function() { + return null; + }, + (array) array(), + (bool) array(), + (double) array(), + (int) array(), + (object) array(), + (string) array(), + (unset) array(), +); + +array( + 'foo', + 'bar' + // This is a non-fixable error. + , +); + +yield array( + static fn () : string => '', +); + +yield array( + static fn () : string => '', + ); + +$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', + ); + +$x = array( + 1, static fn (float $item): float => match ($item) { + 2.0 => 3.0, + default => $item + }, + ); + +$x = array( + 1, static::helloWorld(), $class instanceof static, + 2, + ); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed new file mode 100644 index 00000000..6f8fe216 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed @@ -0,0 +1,588 @@ + 1); +} + +class TestClass +{ + public $good = array( + 'width' => '', + 'height' => '', + ); + + private $_bad = array( + 'width' => '', + 'height' => '', + ); + + + public function test() + { + $truck = array( + 'width' => '', + 'height' => '', + ); + + $plane = array( + 'width' => '', + 'height' => '', + ); + + $car = array( + 'width' => '', + 'height' => '', + ); + + $bus = array( + 'width' => '', + 'height' => '', + ); + + $train = array( + TRUE, + FALSE, + 'aaa', + ); + + $inline = array( + 'aaa', + 'bbb', + 'ccc', + ); + $inline = array('aaa'); + $inline = array('aaa'); + + $bigone = array( + 'name' => 'bigone', + 'children' => array( + '1a' => 'child', + '11b' => 'child', + '111c' => 'child', + 'children' => array('child' => 'aaa'), + ), + 'short_name' => 'big', + ); + } + +}//end class + +$value = array(); +$value = array(); +$value = array( + '1' => $one, + '2' => $two, + '3' => $three, + '4' => $four, + ); +$value = array('1' => $one); + +if (in_array('1', array('1', '2', '3')) === TRUE) { + $value = in_array('1', array('1', '2', '3', '4')); +} + +$value = array( + '1'=> TRUE, + FALSE, + '3' => 'aaa', + ); + +$value = array( + '1'=> TRUE, + FALSE, + ); + +$value = array( + TRUE, + '1' => FALSE, + ); + +$value = array( + 1, + 2, + 3, + ); + +$value = array( + 1 => $one, + 2 => $two, + 3 => $three, + ); + +$value = array( + 'tag' => $tag, + 'space' => $this->_getIndentation($tag, $tagElement), + ); + +$expected = array( + array( + '1' => 1, + '1' => 2, + ), + ); + +$expected = array( + array( + '1' => 1, + '1' => 2, + ), + ); + +// Space in second arg. +$args = array( + '"'.$this->id.'"', + (int) $hasSessions, + ); + +// No errors. +$paths = array( + Init::ROOT_DIR.'/Systems' => 'Systems', + Init::ROOT_DIR.'/Installer' => 'Systems', + ); + +$x = array(); + +$x = array('test'); +$x = array('test'); +$x = array('name' => 'test'); + +$x = array($x); + +$func = array( + $x, + 'get'.$x.'Replacement', + ); + +$array = array( + 'input_one' => 'one', + 'inputTwo' => 'two', + 'input_3' => 3, + ); + +$array = array( + 'input_one', + 'inputTwo', + 'input_3', + ); + +// Malformed +$foo = array( + 1, + 2, + ); + +$listItems[$aliasPath] = array('itemContent' => implode('
    ', $aliases)); + +$listItems[$aliasPath] = array( + 'itemContent' => implode('
    ', $aliases), + ); + +$x = array( + $x, + $y, + ); + +$x = array( + $x, + $y, + ); + +$x = array( + + $x, + $y, + ); + +$test = array( + 'test' => TestFunction::blah( + $value1, + $value2 + ), + ); + +$c = array('a' => 1); + +function b() +{ + $a = array( + 'a' => a('a'), + + ); + +} + +$foo = array( + '[', + ']', + ':', + "\n", + "\r", + ); +$bar = array( + '[', + ']', + ':', + ' ', + ' ', + ); + +function foo() +{ + return array( + $a, + $b->screen, + ); +} + +$array = array( + 'name' => 'contactSubject', + 'required' => TRUE, + 'validators' => array( + new \Zend\Validator\InArray(array('haystack' => array_keys($aSubjects))), + ), + ); + +$var = array( + 'ViewHelper', + array('Foo'), + 'Errors', + ); + +$data = array( + 'first', + 'second', + 'third', + // Add more here + ); + +$data = array( + 'first', + 'second', + //'third', + ); + +$data = array( + 'first', + 'second', + //'third', + ); + +$foo = array( + $this->getViewName() . '.id' => 'value', + $this->getViewName() . '.title' => 'value', + ); + +$foo = array( + $this->getViewName() . '.id', + $this->getViewName() . '.title', + ); + +$weightings = array( + T_CLOSURE => 100, + + /* + Conditions. + */ + + T_WHILE => 50, + + /* + Operators and arithmetic. + */ + + T_BITWISE_AND => 8, + + T_BOOLEAN_AND => 5, + + /* + Equality. + */ + + T_IS_GREATER_OR_EQUAL => 5, + ); + +foreach (array( + 'foo' => 'bar', + 'foobaz' => 'bazzy', + ) as $key => $value) { +} + +$ids = array( + '1', // Foo. + '13', // Bar. + ); + +array( + 'key1' => function($bar) { + return $bar; + }, + 'key2' => function($foo) { + return $foo; + }, + 'key3' => function($bar) { + return $bar; + }, +); + +array( + 'key1' => array( + '1', + '2', + ), +); + +$var = array( + 'tab_template' => ' +
  • %s
  • ', + 'panel_template' => ' +
    + %s +
    ', + ); + +function test() : array +{ + return []; +} + +$fields = array( + 'id' => array('type' => 'INT'), + 'value' => array('type' => 'VARCHAR'), + ); + +get_current_screen()->add_help_tab( array( + 'id' => << false); + +$x = array( + 'xxxx' => array( + 'aaaaaaaaaa' => 'ccccccccccc', + 'bbbbbbbb' => false, + ), + ); + +$foo = array( + 'foo' => array( + 'bar1' => 1, + 'bar2' => 1, + 'bar3' => 1, + 'bar4' => 1, + 'bar5' => 1, + ), + ); + +$foo = array( + '1' => $row['status'] === 'rejected' + ? self::REJECTED_CODE + : self::VERIFIED_CODE, + '2' => in_array($row['status'], array('notverified', 'unverified'), true) + ? self::STATUS_PENDING + : self::STATUS_VERIFIED, + '3' => strtotime($row['date']), + ); + +$foo = foo( + array( + // comment + ) +); + +$foo = array( + << lorem( + 1 + ), + 2 => 2, +); + +$foo = array( + 'тип' => 'авто', + 'цвет' => 'синий', + ); + +$paths = array( + Init::ROOT_DIR.'/тип' => 'авто', + Init::ROOT_DIR.'/цвет' => 'синий', + ); + +$foo = array(<< fn() => return 1, + 'bb' => fn() => return 2, + 'ccc' => ( true ) ? + fn() => return 1 : + fn() => return 2, + ); + +$array = array( + 1 => '1', + 2 => fn ($x) => yield 'a' => $x, + 3 => '3', + ); + +$foo = array( + $this->fn => 'value', + $foo->fn => 'value', + ); + +array( + $a, + $b, + $c, +); + +array( + 'a' => $a, + 'b' => $b, + 'c' => $c, +); + +array( + static function() { + return null; + }, + (array) array(), + (bool) array(), + (double) array(), + (int) array(), + (object) array(), + (string) array(), + (unset) array(), +); + +array( + 'foo', + 'bar' + // This is a non-fixable error. + , +); + +yield array( + static fn () : string => '', + ); + +yield array( + static fn () : string => '', + ); + +$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', + ); + +$x = array( + 1, + static fn (float $item): float => match ($item) { + 2.0 => 3.0, + default => $item + }, + ); + +$x = array( + 1, + static::helloWorld(), + $class instanceof static, + 2, + ); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc new file mode 100644 index 00000000..90b026f0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc @@ -0,0 +1,538 @@ + 1, + ]; +} + +class TestClass +{ + public $good = [ + 'width' => '', + 'height' => '', + ]; + + private $_bad = [ + 'width' => '', + 'height' => '' + ]; + + + public function test() + { + $truck = [ + 'width' => '', + 'height' => '', + ]; + + $plane = [ + 'width' => '', + 'height' => '', + ]; + + $car = [ + 'width' => '', + 'height' => '', + ]; + + $bus = [ + 'width' => '', + 'height' => '' + ]; + + $train = [ + TRUE, + FALSE, + 'aaa' + ]; + + $inline = ['aaa', 'bbb', 'ccc']; + $inline = ['aaa']; + $inline = ['aaa']; + + $bigone = [ + 'name' => 'bigone', + 'children' => [ + '1a' => 'child', + '11b' => 'child', + '111c' => 'child', + 'children' => [ + 'child' => 'aaa', + ], + ], + 'short_name' => 'big' + ]; + } + +}//end class + +$value = [ ]; +$value = [ ]; +$value = ['1'=>$one, '2' => $two, '3'=> $three, '4' =>$four]; +$value = ['1'=>$one]; + +if (in_array('1', ['1','2','3']) === TRUE) { + $value = in_array('1', ['1' , '2', '3','4']); +} + +$value = [ + '1'=> TRUE, + FALSE, + '3' => 'aaa',]; + +$value = [ + '1'=> TRUE, + FALSE, + ]; + +$value = [ + TRUE, + '1' => FALSE, + ]; + +$value = [1, + 2 , + 3 , + ]; + +$value = [1 => $one, + 2 => $two , + 3 => $three , + ]; + +$value = [ + 'tag' => $tag, + 'space' => $this->_getIndentation($tag, $tagElement), + ]; + +$expected = [ + [ + '1' => 1, + '1' => 2, + ], + ]; + +$expected = [ + [ + '1' => 1, + '1' => 2 + ] + ]; + +// Space in second arg. +$args = [ + '"'.$this->id.'"', + (int) $hasSessions, + ]; + +// No errors. +$paths = [ + Init::ROOT_DIR.'/Systems' => 'Systems', + Init::ROOT_DIR.'/Installer' => 'Systems', + ]; + +$x = [ + ]; + +$x = ['test' + ]; +$x = ['test', + ]; +$x = ['name' => 'test', + ]; + +$x = [ + $x, + ]; + +$func = [ + $x, + 'get'.$x.'Replacement' + ]; + +$array = [ + 'input_one' => 'one', + 'inputTwo' => 'two', + 'input_3' => 3, + ]; + +$array = [ + 'input_one', + 'inputTwo', + 'input_3', + ]; + +// Malformed +$foo = [1 +, 2]; + +$listItems[$aliasPath] = ['itemContent' => implode('
    ', $aliases)]; + +$listItems[$aliasPath] = [ + 'itemContent' => implode('
    ', $aliases) + ]; + +$x = + [ + $x, + $y, + ]; + +$x = +[ + $x, + $y, + ]; + +$x = [ + + $x, + $y, + ]; + +$test = [ + 'test' => TestFunction::blah( + $value1, + $value2 + ), + ]; + +$c = ['a' => 1,]; +$c->{$var}[ ] = 2; + +$foo = ['[',']',':',"\n","\r"]; +$bar = ['[',']',':',' ',' ']; + +function foo() +{ + return [$a, $b->screen]; +} + +$array = [ + 'name' => 'contactSubject', + 'required' => TRUE, + 'validators' => [ + new \Zend\Validator\InArray(['haystack' => array_keys($aSubjects)]), + ], + ]; + +$var = [ + 'ViewHelper', + ['Foo'], + 'Errors', + ]; + +$data = [ + 'first', + 'second', + 'third', + // Add more here + ]; + +$data = [ + 'first', + 'second', + //'third', + ]; + +$data = [ + 'first', + 'second' + //'third', + ]; + +$foo = [ + $this->getViewName() . '.id' => 'value', + $this->getViewName() . '.title' => 'value', + ]; + +$foo = [ + $this->getViewName() . '.id', + $this->getViewName() . '.title', + ]; + +$weightings = [ + T_CLOSURE => 100, + + /* + Conditions. + */ + + T_WHILE => 50, + + /* + Operators and arithmetic. + */ + + T_BITWISE_AND => 8, + + T_BOOLEAN_AND => 5, + + /* + Equality. + */ + + T_IS_GREATER_OR_EQUAL => 5, + ]; + +foreach ([ + 'foo' => 'bar', + 'foobaz' => 'bazzy', + ] as $key => $value) { +} + +$ids = [ + '1', // Foo. + '13', // Bar. + ]; + +[ + 'key1' => function($bar) { + return $bar; + }, + 'key2' => function($foo) { + return $foo; + }, + 'key3' => function($bar) { + return $bar; + } +]; + +[ + 'key1' => [ + '1', + '2', + ] +]; + +$var = [ + 'tab_template' => ' +
  • %s
  • ', + 'panel_template' => ' +
    + %s +
    ', + ]; + +function test() : array +{ + return []; +} + +$fields = [ + 'id' => ['type' => 'INT'], + 'value' => ['type' => 'VARCHAR']]; + +get_current_screen()->add_help_tab( [ + 'id' => << false]; + +$x = [ + 'xxxx' => ['aaaaaaaaaa' => 'ccccccccccc', + 'bbbbbbbb' => false], +]; + +$foo = ['foo' => ['bar1' => 1 + ,'bar2' => 1 + ,'bar3' => 1 + ,'bar4' => 1 + ,'bar5' => 1 + ] + ]; + +$foo = [ + '1' => $row['status'] === 'rejected' + ? self::REJECTED_CODE + : self::VERIFIED_CODE, + '2' => in_array($row['status'], ['notverified', 'unverified'], true) + ? self::STATUS_PENDING + : self::STATUS_VERIFIED, + '3' => strtotime($row['date']), + ]; + + +$foo = foo( + [ + // comment + ] +); + +$foo = [ + << lorem( + 1 + ), 2 => 2, +]; + +$foo = [ + 'тип' => 'авто', + 'цвет' => 'синий', + ]; + +$paths = [ + Init::ROOT_DIR.'/тип' => 'авто', + Init::ROOT_DIR.'/цвет' => 'синий', + ]; + +$foo = [<< fn() => return 1, + 'bb' => fn() => return 2, + 'ccc' => ( true ) ? + fn() => return 1 : + fn() => return 2, + ]; + +$array = [ + 1 => '1', + 2 => fn ($x) => yield 'a' => $x, + 3 => '3', + ]; + +$foo = [ + $this->fn => 'value', + $foo->fn => 'value', + ]; + +[$a, $b, +$c]; + +['a' => $a, 'b' => $b, +'c' => $c]; + +[ + static function() { + return null; + }, + (array) [], + (bool) [], + (double) [], + (int) [], + (object) [], + (string) [], + (unset) [], +]; + +[ + 'foo', + 'bar' + // This is a non-fixable error. + , +]; + +yield [ + static fn () : string => '', +]; + +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', + ]; + +$x = [ + 1, static fn (float $item): float => match ($item) { + 2.0 => 3.0, + default => $item + }, + ]; + +$x = [ + 1, static::helloWorld(), $class instanceof static, + 2, + ]; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed new file mode 100644 index 00000000..533be16a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed @@ -0,0 +1,575 @@ + 1]; +} + +class TestClass +{ + public $good = [ + 'width' => '', + 'height' => '', + ]; + + private $_bad = [ + 'width' => '', + 'height' => '', + ]; + + + public function test() + { + $truck = [ + 'width' => '', + 'height' => '', + ]; + + $plane = [ + 'width' => '', + 'height' => '', + ]; + + $car = [ + 'width' => '', + 'height' => '', + ]; + + $bus = [ + 'width' => '', + 'height' => '', + ]; + + $train = [ + TRUE, + FALSE, + 'aaa', + ]; + + $inline = [ + 'aaa', + 'bbb', + 'ccc', + ]; + $inline = ['aaa']; + $inline = ['aaa']; + + $bigone = [ + 'name' => 'bigone', + 'children' => [ + '1a' => 'child', + '11b' => 'child', + '111c' => 'child', + 'children' => ['child' => 'aaa'], + ], + 'short_name' => 'big', + ]; + } + +}//end class + +$value = []; +$value = []; +$value = [ + '1' => $one, + '2' => $two, + '3' => $three, + '4' => $four, + ]; +$value = ['1' => $one]; + +if (in_array('1', ['1', '2', '3']) === TRUE) { + $value = in_array('1', ['1', '2', '3', '4']); +} + +$value = [ + '1'=> TRUE, + FALSE, + '3' => 'aaa', + ]; + +$value = [ + '1'=> TRUE, + FALSE, + ]; + +$value = [ + TRUE, + '1' => FALSE, + ]; + +$value = [ + 1, + 2, + 3, + ]; + +$value = [ + 1 => $one, + 2 => $two, + 3 => $three, + ]; + +$value = [ + 'tag' => $tag, + 'space' => $this->_getIndentation($tag, $tagElement), + ]; + +$expected = [ + [ + '1' => 1, + '1' => 2, + ], + ]; + +$expected = [ + [ + '1' => 1, + '1' => 2, + ], + ]; + +// Space in second arg. +$args = [ + '"'.$this->id.'"', + (int) $hasSessions, + ]; + +// No errors. +$paths = [ + Init::ROOT_DIR.'/Systems' => 'Systems', + Init::ROOT_DIR.'/Installer' => 'Systems', + ]; + +$x = []; + +$x = ['test']; +$x = ['test']; +$x = ['name' => 'test']; + +$x = [$x]; + +$func = [ + $x, + 'get'.$x.'Replacement', + ]; + +$array = [ + 'input_one' => 'one', + 'inputTwo' => 'two', + 'input_3' => 3, + ]; + +$array = [ + 'input_one', + 'inputTwo', + 'input_3', + ]; + +// Malformed +$foo = [ + 1, + 2, + ]; + +$listItems[$aliasPath] = ['itemContent' => implode('
    ', $aliases)]; + +$listItems[$aliasPath] = [ + 'itemContent' => implode('
    ', $aliases), + ]; + +$x = + [ + $x, + $y, + ]; + +$x = +[ + $x, + $y, +]; + +$x = [ + + $x, + $y, + ]; + +$test = [ + 'test' => TestFunction::blah( + $value1, + $value2 + ), + ]; + +$c = ['a' => 1]; +$c->{$var}[ ] = 2; + +$foo = [ + '[', + ']', + ':', + "\n", + "\r", + ]; +$bar = [ + '[', + ']', + ':', + ' ', + ' ', + ]; + +function foo() +{ + return [ + $a, + $b->screen, + ]; +} + +$array = [ + 'name' => 'contactSubject', + 'required' => TRUE, + 'validators' => [ + new \Zend\Validator\InArray(['haystack' => array_keys($aSubjects)]), + ], + ]; + +$var = [ + 'ViewHelper', + ['Foo'], + 'Errors', + ]; + +$data = [ + 'first', + 'second', + 'third', + // Add more here + ]; + +$data = [ + 'first', + 'second', + //'third', + ]; + +$data = [ + 'first', + 'second', + //'third', + ]; + +$foo = [ + $this->getViewName() . '.id' => 'value', + $this->getViewName() . '.title' => 'value', + ]; + +$foo = [ + $this->getViewName() . '.id', + $this->getViewName() . '.title', + ]; + +$weightings = [ + T_CLOSURE => 100, + + /* + Conditions. + */ + + T_WHILE => 50, + + /* + Operators and arithmetic. + */ + + T_BITWISE_AND => 8, + + T_BOOLEAN_AND => 5, + + /* + Equality. + */ + + T_IS_GREATER_OR_EQUAL => 5, + ]; + +foreach ([ + 'foo' => 'bar', + 'foobaz' => 'bazzy', + ] as $key => $value) { +} + +$ids = [ + '1', // Foo. + '13', // Bar. + ]; + +[ + 'key1' => function($bar) { + return $bar; + }, + 'key2' => function($foo) { + return $foo; + }, + 'key3' => function($bar) { + return $bar; + }, +]; + +[ + 'key1' => [ + '1', + '2', + ], +]; + +$var = [ + 'tab_template' => ' +
  • %s
  • ', + 'panel_template' => ' +
    + %s +
    ', + ]; + +function test() : array +{ + return []; +} + +$fields = [ + 'id' => ['type' => 'INT'], + 'value' => ['type' => 'VARCHAR'], + ]; + +get_current_screen()->add_help_tab( [ + 'id' => << false]; + +$x = [ + 'xxxx' => [ + 'aaaaaaaaaa' => 'ccccccccccc', + 'bbbbbbbb' => false, + ], + ]; + +$foo = [ + 'foo' => [ + 'bar1' => 1, + 'bar2' => 1, + 'bar3' => 1, + 'bar4' => 1, + 'bar5' => 1, + ], + ]; + +$foo = [ + '1' => $row['status'] === 'rejected' + ? self::REJECTED_CODE + : self::VERIFIED_CODE, + '2' => in_array($row['status'], ['notverified', 'unverified'], true) + ? self::STATUS_PENDING + : self::STATUS_VERIFIED, + '3' => strtotime($row['date']), + ]; + + +$foo = foo( + [ + // comment + ] +); + +$foo = [ + << lorem( + 1 + ), + 2 => 2, +]; + +$foo = [ + 'тип' => 'авто', + 'цвет' => 'синий', + ]; + +$paths = [ + Init::ROOT_DIR.'/тип' => 'авто', + Init::ROOT_DIR.'/цвет' => 'синий', + ]; + +$foo = [<< fn() => return 1, + 'bb' => fn() => return 2, + 'ccc' => ( true ) ? + fn() => return 1 : + fn() => return 2, + ]; + +$array = [ + 1 => '1', + 2 => fn ($x) => yield 'a' => $x, + 3 => '3', + ]; + +$foo = [ + $this->fn => 'value', + $foo->fn => 'value', + ]; + +[ + $a, + $b, + $c, +]; + +[ + 'a' => $a, + 'b' => $b, + 'c' => $c, +]; + +[ + static function() { + return null; + }, + (array) [], + (bool) [], + (double) [], + (int) [], + (object) [], + (string) [], + (unset) [], +]; + +[ + 'foo', + 'bar' + // This is a non-fixable error. + , +]; + +yield [ + static fn () : string => '', + ]; + +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', + ]; + +$x = [ + 1, + static fn (float $item): float => match ($item) { + 2.0 => 3.0, + default => $item + }, + ]; + +$x = [ + 1, + static::helloWorld(), + $class instanceof static, + 2, + ]; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php new file mode 100644 index 00000000..b34044b2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php @@ -0,0 +1,255 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Arrays; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ArrayDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayDeclarationSniff + */ +final class ArrayDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ArrayDeclarationUnitTest.1.inc': + return [ + 2 => 1, + 8 => 2, + 10 => 2, + 22 => 1, + 23 => 2, + 24 => 2, + 25 => 1, + 31 => 2, + 35 => 1, + 36 => 2, + 41 => 1, + 46 => 1, + 47 => 1, + 50 => 1, + 51 => 1, + 53 => 1, + 56 => 1, + 58 => 1, + 61 => 1, + 62 => 1, + 63 => 1, + 64 => 1, + 65 => 1, + 66 => 3, + 70 => 1, + 76 => 2, + 77 => 1, + 78 => 7, + 79 => 2, + 81 => 2, + 82 => 4, + 87 => 1, + 88 => 1, + 92 => 1, + 97 => 1, + 100 => 1, + 101 => 1, + 102 => 1, + 105 => 1, + 106 => 1, + 107 => 1, + 125 => 1, + 126 => 1, + 141 => 1, + 144 => 1, + 146 => 1, + 148 => 1, + 151 => 1, + 157 => 1, + 173 => 1, + 174 => 3, + 179 => 1, + 182 => 1, + 188 => 1, + 207 => 1, + 212 => 2, + 214 => 1, + 218 => 2, + 219 => 2, + 223 => 1, + 255 => 1, + 294 => 1, + 295 => 1, + 296 => 1, + 311 => 1, + 317 => 1, + 339 => 2, + 348 => 2, + 352 => 2, + 355 => 3, + 358 => 3, + 359 => 2, + 360 => 1, + 362 => 1, + 363 => 2, + 364 => 1, + 365 => 2, + 366 => 2, + 367 => 2, + 368 => 2, + 369 => 1, + 370 => 1, + 383 => 1, + 394 => 1, + 400 => 1, + 406 => 1, + 441 => 1, + 444 => 2, + 445 => 2, + 447 => 2, + 448 => 3, + 467 => 1, + 471 => 1, + 472 => 1, + 510 => 1, + 516 => 1, + 523 => 1, + 530 => 1, + 537 => 1, + 540 => 1, + 547 => 2, + ]; + case 'ArrayDeclarationUnitTest.2.inc': + return [ + 2 => 1, + 10 => 1, + 23 => 2, + 24 => 2, + 25 => 1, + 31 => 2, + 36 => 2, + 41 => 1, + 46 => 1, + 47 => 1, + 51 => 1, + 53 => 1, + 56 => 1, + 61 => 1, + 63 => 1, + 64 => 1, + 65 => 1, + 66 => 2, + 70 => 1, + 76 => 1, + 77 => 1, + 78 => 7, + 79 => 2, + 81 => 2, + 82 => 4, + 87 => 1, + 88 => 1, + 92 => 1, + 97 => 1, + 100 => 1, + 101 => 1, + 102 => 1, + 105 => 1, + 106 => 1, + 107 => 1, + 125 => 1, + 126 => 1, + 141 => 1, + 144 => 1, + 146 => 1, + 148 => 1, + 151 => 1, + 157 => 1, + 173 => 1, + 174 => 3, + 179 => 1, + 190 => 1, + 191 => 1, + 192 => 1, + 207 => 1, + 210 => 1, + 211 => 1, + 215 => 1, + 247 => 1, + 286 => 1, + 287 => 1, + 288 => 1, + 303 => 1, + 309 => 1, + 331 => 2, + 345 => 3, + 348 => 3, + 349 => 2, + 350 => 1, + 352 => 2, + 353 => 2, + 354 => 2, + 355 => 2, + 356 => 2, + 357 => 1, + 358 => 1, + 372 => 1, + 383 => 1, + 389 => 1, + 395 => 1, + 430 => 1, + 433 => 2, + 434 => 2, + 436 => 2, + 437 => 3, + 456 => 1, + 460 => 1, + 461 => 1, + 499 => 1, + 505 => 1, + 512 => 1, + 519 => 1, + 526 => 1, + 529 => 1, + 536 => 2, + ]; + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css new file mode 100644 index 00000000..39abce23 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css @@ -0,0 +1,81 @@ +.my-style { +} + + +.my-style { +} + +/* Comment */ + +.my-style { +} + + +/* Comment */ + +.my-style { + float: left; + +} + +.AssetLineageWidgetType-item { + color: #CCC; +} + +/*.AssetLineageWidgetType-item2 .selected, +.AssetLineageWidgetType-item .selected { +}*/ + +.AssetLineageWidgetType-item.selected { +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } +} + +.GUITextBox.container:after {} + +@media screen and (max-device-width: 769px) { + .no-blank-line-after { + } + .no-blank-line-after-second-def { + } .my-style { + } + + .no-blank-line-and-trailing-comment { + } /* end long class */ + .too-many-blank-lines-and-trailing-comment-extra-whitespace-after-brace { + } /* end long class */ + + + + .has-blank-line-and-trailing-comment { + } /* end long class */ + + .no-blank-line-and-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + .too-many-blank-lines-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + + + + .has-blank-line-and-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%;}} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed new file mode 100644 index 00000000..ca77e83b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed @@ -0,0 +1,85 @@ +.my-style { +} + +.my-style { +} + +/* Comment */ + +.my-style { +} + +/* Comment */ + +.my-style { + float: left; + +} + +.AssetLineageWidgetType-item { + color: #CCC; +} + +/*.AssetLineageWidgetType-item2 .selected, +.AssetLineageWidgetType-item .selected { +}*/ + +.AssetLineageWidgetType-item.selected { +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +.GUITextBox.container:after { +} + +@media screen and (max-device-width: 769px) { + .no-blank-line-after { + } + + .no-blank-line-after-second-def { + } + +.my-style { + } + + .no-blank-line-and-trailing-comment { + } /* end long class */ + + .too-many-blank-lines-and-trailing-comment-extra-whitespace-after-brace { + } /* end long class */ + + .has-blank-line-and-trailing-comment { + } /* end long class */ + + .no-blank-line-and-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + + .too-many-blank-lines-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + + .has-blank-line-and-annotation { + } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; +} + +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php new file mode 100644 index 00000000..c9770cc1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php @@ -0,0 +1,65 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassDefinitionClosingBraceSpace sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionClosingBraceSpaceSniff + */ +final class ClassDefinitionClosingBraceSpaceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 11 => 1, + 44 => 1, + 47 => 1, + 51 => 1, + 53 => 1, + 57 => 1, + 59 => 1, + 67 => 1, + 69 => 1, + 81 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css new file mode 100644 index 00000000..6496cb83 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css @@ -0,0 +1,66 @@ +.AssetListingEditWidgetType-BottomPanel select, +#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { + float: left; +} + +.AssetListingEditWidgetType-BottomPanel select, + +#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { + float: left; +} + +.AssetListingEditWidgetType-BottomPanel select, +/*.AssetListingEditWidgetType-BottomPanel ul,*/ +#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { + float: left; +} + +.AssetListingEditWidgetType-BottomPanel select, + +.AssetListingEditWidgetType-BottomPanel ul, +#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { + float: left; +} + +#SuperUsersSystemConfigScreen-table { + display: block; + left: 50%; + margin-left: -500px; + margin-top: 180px; + position: relative; + width: 1000px; +} + +/** + * More styles below here. + */ + +td.TableWidgetType-header.TableWidgetType-header-lastLogin, +td.TableWidgetType-header.TableWidgetType-header-remove, +td.TableWidgetType-header.TableWidgetType-header-email, +td.TableWidgetType-header.TableWidgetType-header-userName { + background: url(images/ScreenImages/table_header_bg.png) repeat-x; + border-top: 1px solid #D4D4D4; + color: #787878; + height: 33px; + padding-left: 12px; + width: 150px; +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + padding: 20px; + margin: 40px; + } +} + +.foo +{ + border: none; +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php new file mode 100644 index 00000000..5320047c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php @@ -0,0 +1,56 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassDefinitionNameSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionNameSpacingSniff + */ +final class ClassDefinitionNameSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 7 => 1, + 19 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css new file mode 100644 index 00000000..98c8fa56 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css @@ -0,0 +1,108 @@ +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title{ + float: left; +} +.HelpWidgetType-new-bug-title { + + float: left; +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +@media screen and (max-device-width: 769px) { + header #logo img { + max-width: 100%; + } + +} + +@media screen and (max-device-width: 769px) { + + + + header #logo img { + max-width: 100%; + } + +} + +.GUITextBox.container:after {} + +.single-line {float: left;} + +#opening-brace-on-different-line + + +{ + color: #FFFFFF; +} + +#opening-brace-on-different-line-and-inline-style + + +{color: #FFFFFF;} + +@media screen and (max-device-width: 769px) { .everything-on-one-line { float: left; } } + +/* Document handling of comments in various places */ +.no-space-before-opening-with-comment /* comment*/{ + float: left; +} + +.space-before-opening-with-comment-on-next-line +/* comment*/ { + float: left; +} + +#opening-brace-on-different-line-with-comment-between +/*comment*/ +{ + padding: 0; +} + +.single-line-with-comment { /* comment*/ float: left; } + +.multi-line-with-trailing-comment { /* comment*/ + float: left; +} + + +@media screen and (max-device-width: 769px) { + /*comment*/ + .comment-line-after-nesting-class-opening { + } +} + +@media screen and (max-device-width: 769px) { + + /*comment*/ + .blank-line-and-comment-line-after-nesting-class-opening { + } +} + +@media screen and (max-device-width: 769px) { + + + + /* phpcs:ignore Standard.Category.Sniffname -- for reasons */ + .blank-line-and-annotation-after-nesting-class-opening { + } +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed new file mode 100644 index 00000000..b3f48a5c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed @@ -0,0 +1,106 @@ +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + + float: left; +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + +} + +.GUITextBox.container:after { +} + +.single-line { +float: left;} + +#opening-brace-on-different-line { + color: #FFFFFF; +} + +#opening-brace-on-different-line-and-inline-style { +color: #FFFFFF;} + +@media screen and (max-device-width: 769px) { + +.everything-on-one-line { +float: left; } } + +/* Document handling of comments in various places */ +.no-space-before-opening-with-comment /* comment*/ { + float: left; +} + +.space-before-opening-with-comment-on-next-line +/* comment*/ { + float: left; +} + +#opening-brace-on-different-line-with-comment-between +/*comment*/ { + padding: 0; +} + +.single-line-with-comment { +/* comment*/ float: left; } + +.multi-line-with-trailing-comment { /* comment*/ + float: left; +} + + +@media screen and (max-device-width: 769px) { + + /*comment*/ + .comment-line-after-nesting-class-opening { + } +} + +@media screen and (max-device-width: 769px) { + + /*comment*/ + .blank-line-and-comment-line-after-nesting-class-opening { + } +} + +@media screen and (max-device-width: 769px) { + + /* phpcs:ignore Standard.Category.Sniffname -- for reasons */ + .blank-line-and-annotation-after-nesting-class-opening { + } +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php new file mode 100644 index 00000000..3d5f37bb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php @@ -0,0 +1,69 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassDefinitionOpeningBraceSpace sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionOpeningBraceSpaceSniff + */ +final class ClassDefinitionOpeningBraceSpaceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 1, + 7 => 1, + 10 => 1, + 26 => 1, + 33 => 1, + 43 => 1, + 45 => 1, + 50 => 1, + 57 => 2, + 59 => 2, + 62 => 1, + 73 => 1, + 77 => 1, + 84 => 1, + 97 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css new file mode 100644 index 00000000..391bc85a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css @@ -0,0 +1,42 @@ +body { +font-family: Arial, Helvetica, sans-serif; +margin : 40px 0 0 0; +padding : 0; +background: #8FB7DB url(diag_lines_bg.gif) top left; +margin-top: +10px; +margin-bottom: +0px; +} + +.TableWidgetType .recover:hover { + background-color: #FFF; +} + +#clearCache-settings:rootNodes-list_0 { + border-top: none; +} + +.LookupEditScreenWidgetType-urls a, .LookupEditScreenWidgetType-urls a:visited { + text-decoration: none; + color: #444; +} + +/* checking embedded PHP */ +li { + background:url(/images//bullet.gif) left px no-repeat; + margin:0px; + padding-left:10px; + margin-bottom:px; + margin-top: px; + line-height:13px; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); +} + +/* Empty style defs. */ +.p { + margin:; + margin-right: + margin-left: 10px; + float:/* Some comment. */ ; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed new file mode 100644 index 00000000..e68bddce --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed @@ -0,0 +1,40 @@ +body { +font-family: Arial, Helvetica, sans-serif; +margin: 40px 0 0 0; +padding: 0; +background: #8FB7DB url(diag_lines_bg.gif) top left; +margin-top: 10px; +margin-bottom: 0px; +} + +.TableWidgetType .recover:hover { + background-color: #FFF; +} + +#clearCache-settings:rootNodes-list_0 { + border-top: none; +} + +.LookupEditScreenWidgetType-urls a, .LookupEditScreenWidgetType-urls a:visited { + text-decoration: none; + color: #444; +} + +/* checking embedded PHP */ +li { + background: url(/images//bullet.gif) left px no-repeat; + margin: 0px; + padding-left: 10px; + margin-bottom: px; + margin-top: px; + line-height: 13px; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); +} + +/* Empty style defs. */ +.p { + margin:; + margin-right: + margin-left: 10px; + float: /* Some comment. */ ; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php new file mode 100644 index 00000000..222bbe4e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php @@ -0,0 +1,65 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ColonSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColonSpacingSniff + */ +final class ColonSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 4 => 2, + 5 => 1, + 6 => 1, + 8 => 1, + 27 => 1, + 28 => 1, + 29 => 1, + 30 => 1, + 32 => 1, + 41 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css new file mode 100644 index 00000000..2dfd22ad --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css @@ -0,0 +1,16 @@ +#title-bar-bottom-right { + background-color: #333333; + padding: 10px; + border-bottom: 1px dotted #F0F0F0; + border-top: 1px dotted #FF00FF; + background: #08f7db url(diag_lines_bg.gif) top left; + + /* The sniff only deals with HEX colours. */ + color: DarkSlateGray; + background-color: rgb(255, 0, 0); + background-color: rgba(0, 0, 255, 0.3); + background-color: hsl(120, 100%, 50%); +} + +#add-new-comment { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed new file mode 100644 index 00000000..039209dd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed @@ -0,0 +1,16 @@ +#title-bar-bottom-right { + background-color: #333; + padding: 10px; + border-bottom: 1px dotted #F0F0F0; + border-top: 1px dotted #F0F; + background: #08F7DB url(diag_lines_bg.gif) top left; + + /* The sniff only deals with HEX colours. */ + color: DarkSlateGray; + background-color: rgb(255, 0, 0); + background-color: rgba(0, 0, 255, 0.3); + background-color: hsl(120, 100%, 50%); +} + +#add-new-comment { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php new file mode 100644 index 00000000..44a2d64f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ColourDefinition sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColourDefinitionSniff + */ +final class ColourDefinitionUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 5 => 1, + 6 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css new file mode 100644 index 00000000..4c11beaa --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css @@ -0,0 +1,17 @@ +.SettingsTabPaneWidgetType-tab-mid { + background: transparent url(tab_inact_mid.png) repeat-x; + height: 100%;float: left; + line-height: -25px; + cursor: pointer; margin: 10px; float: right; +} + +/* testing embedded PHP */ +li { + background:url(/images//bullet.gif) left px no-repeat; margin:0px; padding-left:10px; margin-bottom:px; line-height:13px; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); +} + +/* Document handling of comments and annotations. */ +div#annotations {-webkit-tap-highlight-color:transparent;/* phpcs:disable Standard.Cat.SniffName */-webkit-touch-callout:none;/*phpcs:enable*/-webkit-user-select:none;} + +div#comments {height:100%;/*comment*/width:100%;} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed new file mode 100644 index 00000000..93a7815e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed @@ -0,0 +1,27 @@ +.SettingsTabPaneWidgetType-tab-mid { + background: transparent url(tab_inact_mid.png) repeat-x; + height: 100%; +float: left; + line-height: -25px; + cursor: pointer; +margin: 10px; +float: right; +} + +/* testing embedded PHP */ +li { + background:url(/images//bullet.gif) left px no-repeat; +margin:0px; +padding-left:10px; +margin-bottom:px; +line-height:13px; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); +} + +/* Document handling of comments and annotations. */ +div#annotations {-webkit-tap-highlight-color:transparent;/* phpcs:disable Standard.Cat.SniffName */ +-webkit-touch-callout:none;/*phpcs:enable*/ +-webkit-user-select:none;} + +div#comments {height:100%;/*comment*/ +width:100%;} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php new file mode 100644 index 00000000..18abf1a5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php @@ -0,0 +1,59 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowMultipleStyleDefinitions sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DisallowMultipleStyleDefinitionsSniff + */ +final class DisallowMultipleStyleDefinitionsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 5 => 2, + 10 => 4, + 15 => 2, + 17 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css new file mode 100644 index 00000000..8ac95012 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css @@ -0,0 +1,103 @@ +.AssetLineageWidgetType-item { + color: #FFF; +} + +.AssetLineageWidgetType-title { + color: #CCC; +} + +.AssetLineageWidgetType-item { + color: #CCC; +} + +.AssetLineageWidgetType-item .selected { +} + +.AssetLineageWidgetType-item.selected { +} + +#Blah .AssetLineageWidgetType-item { +} + +#X.selected, +.AssetLineageWidgetType-item { +} + +.MyClass, .YourClass { +} + +.YourClass, .MyClass { +} + +.YourClass, .MyClass, .OurClass { +} + + +.ClassAtTopOfMediaBlock { +} + +@media print { + .ClassAtTopOfMediaBlock { + } + + .ClassInMultipleMediaBlocks { + } +} + +.ClassNotAtTopOfMediaBlock { +} + +@media handheld { + .SameClassInMediaBlock { + } + + .ClassNotAtTopOfMediaBlock { + } + + .SameClassInMediaBlock { + } +} + +@media braille { + .PlaceholderClass { + } + + .ClassNotAtTopOfMediaBlock { + } + + .ClassInMultipleMediaBlocks { + } +} + +.foo /* any comment */ +{ color: red; } + +/* print comment */ +@media print { + /* comment1 */ + td { + } + + /* comment2 */ + img { + } + + /* comment3 */ + td { + } +} + +@media handheld /* handheld comment */ +{ + td /* comment1 */ + { + } + + img /* comment2 */ + { + } + + td /* comment3 */ + { + } +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php new file mode 100644 index 00000000..70bc5b10 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php @@ -0,0 +1,59 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DuplicateClassDefinition sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateClassDefinitionSniff + */ +final class DuplicateClassDefinitionUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 9 => 1, + 29 => 1, + 57 => 1, + 86 => 1, + 101 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css new file mode 100644 index 00000000..c9c849f6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css @@ -0,0 +1,27 @@ +.ViperSubToolbar-wrapper { + height: 34px; + left: 0; + position: fixed; + top: 60px; + z-index: 997; + left: 50%; +} + +.expandable { + -moz-transition-property: margin-left, margin-right; + -moz-transition-duration: 0.2s; + -moz-transition-timing-function: ease; + -webkit-transition-property: margin-left, margin-right; + -webkit-transition-duration: 0.2s; + -webkit-transition-timing-function: ease; + z-index: 2; +} + +@media only screen and (max-width: 480px) { + header nav.meta a { display: none; } + header nav.meta a.search { display: block; } +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php new file mode 100644 index 00000000..f7e9e95f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php @@ -0,0 +1,53 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DuplicateStyleDefinition sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateStyleDefinitionSniff + */ +final class DuplicateStyleDefinitionUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [7 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css new file mode 100644 index 00000000..801dcda1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css @@ -0,0 +1,15 @@ +.HelpWidgetType-new-bug-title {} +.HelpWidgetType-new-bug-title { +} +.HelpWidgetType-new-bug-title { + +} +.HelpWidgetType-new-bug-title { + +} +.HelpWidgetType-new-bug-title { + /* Nothing to see here */ +} +.HelpWidgetType-new-bug-title { + float: left; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php new file mode 100644 index 00000000..b7587300 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php @@ -0,0 +1,59 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the EmptyClassDefinition sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyClassDefinitionSniff + */ +final class EmptyClassDefinitionUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 1 => 1, + 2 => 1, + 4 => 1, + 7 => 1, + 10 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css new file mode 100644 index 00000000..24910b71 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css @@ -0,0 +1,11 @@ +#MetadataAdminScreen-addField-fieldType { + margin-left: 10px; + margin-right: + float: ; +} + +#MetadataAdminScreen-addField-fieldType li { + margin-right: /* @todo */ + margin-left: 10px; + float: /* Some comment. */ ; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php new file mode 100644 index 00000000..55ec5331 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php @@ -0,0 +1,58 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the EmptyStyleDefinition sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyStyleDefinitionSniff + */ +final class EmptyStyleDefinitionUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 4 => 1, + 8 => 1, + 10 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css new file mode 100644 index 00000000..dbd54870 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css @@ -0,0 +1,18 @@ +#add-new-comment { + -moz-border-radius: 1px; + -webkit-border-radius: 1px; + border-radius: 1px; + + -moz-border-radius-topleft: 1px; + -moz-border-radius-topright: 1px; + -moz-border-radius-bottomright: 1px; + -moz-border-radius-bottomleft: 1px; + border-top-left-radius: 1px; + border-top-right-radius: 1px; + border-bottom-right-radius: 1px; + border-bottom-left-radius: 1px; + + -moz-box-shadow: 1px; + -webkit-box-shadow: 1px; + box-shadow: 1px; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed new file mode 100644 index 00000000..a8ea2704 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed @@ -0,0 +1,18 @@ +#add-new-comment { + border-radius: 1px; + border-radius: 1px; + border-radius: 1px; + + border-top-left-radius: 1px; + border-top-right-radius: 1px; + border-bottom-right-radius: 1px; + border-bottom-left-radius: 1px; + border-top-left-radius: 1px; + border-top-right-radius: 1px; + border-bottom-right-radius: 1px; + border-bottom-left-radius: 1px; + + box-shadow: 1px; + box-shadow: 1px; + box-shadow: 1px; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php new file mode 100644 index 00000000..f5cdae43 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php @@ -0,0 +1,62 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ForbiddenStyles sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ForbiddenStylesSniff + */ +final class ForbiddenStylesUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 3 => 1, + 6 => 1, + 7 => 1, + 8 => 1, + 9 => 1, + 15 => 1, + 16 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css new file mode 100644 index 00000000..216f00ee --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css @@ -0,0 +1,79 @@ +body { + + font-family: Arial, Helvetica, sans-serif; + margin: 40px 0 0 0; +padding: 0; + background: #8FB7DB url(diag_lines_bg.gif) top left; + +} + +td { + margin: 40px; + + padding: 20px; +} + +/* +#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { + background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; +} +#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { + background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; +} +*/ + +.GUITextBox.container:after {} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + padding: 20px; + margin: 40px; + } +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + + header #logo img { + min-width: 100%; + } + +} + +td { + margin: 40px; + + padding: 20px; + + +} + +.GUIFileUpload { +/* opacity: 0.25; */ +} + +.foo +{ + border: none; +} + +.mortgage-calculator h2 { + background: #072237; + color: #fff; + font-weight: normal; + height: 50px; + line-height: 50px; + padding: 0 0 0 30px; + } + +.WhitelistCommentIndentationShouldBeIgnored { +/* phpcs:disable Standard.Category.Sniff -- for reasons. */ +} + +/* syntax error */ +--------------------------------------------- */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed new file mode 100644 index 00000000..1fd128a5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed @@ -0,0 +1,73 @@ +body { + font-family: Arial, Helvetica, sans-serif; + margin: 40px 0 0 0; + padding: 0; + background: #8FB7DB url(diag_lines_bg.gif) top left; +} + +td { + margin: 40px; + padding: 20px; +} + +/* +#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { + background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; +} +#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { + background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; +} +*/ + +.GUITextBox.container:after {} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + padding: 20px; + margin: 40px; + } +} + +@media screen and (max-device-width: 769px) { + + header #logo img { + max-width: 100%; + } + + header #logo img { + min-width: 100%; + } + +} + +td { + margin: 40px; + padding: 20px; +} + +.GUIFileUpload { +/* opacity: 0.25; */ +} + +.foo +{ + border: none; +} + +.mortgage-calculator h2 { + background: #072237; + color: #fff; + font-weight: normal; + height: 50px; + line-height: 50px; + padding: 0 0 0 30px; +} + +.WhitelistCommentIndentationShouldBeIgnored { +/* phpcs:disable Standard.Category.Sniff -- for reasons. */ +} + +/* syntax error */ +--------------------------------------------- */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css new file mode 100644 index 00000000..48b22f6d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css @@ -0,0 +1,3 @@ +/* Live coding. Has to be the last (only) test in the file. */ +.intentional-parse-error { + float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php new file mode 100644 index 00000000..fe79ffb3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php @@ -0,0 +1,80 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the Indentation sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\IndentationSniff + */ +final class IndentationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'IndentationUnitTest.1.css': + return [ + 2 => 1, + 3 => 1, + 5 => 1, + 6 => 1, + 7 => 1, + 12 => 1, + 30 => 1, + 32 => 1, + 50 => 1, + 52 => 1, + 53 => 1, + 66 => 1, + 67 => 1, + 68 => 1, + 69 => 1, + 70 => 1, + 71 => 1, + 72 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css new file mode 100644 index 00000000..d0f2982f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css @@ -0,0 +1,14 @@ +.SettingsTabPaneWidgetType-tab-mid { + font-family: Arial; + Font-Family: arial; + background-color: #DA9393; + BACKGROUND-IMAGE: URL(Warning_Close.png); +} + +@media screen and (max-device-width: 769px) { + + .SettingsTabPaneWidgetType-tab-mid { + Font-Family: arial; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); + } +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php new file mode 100644 index 00000000..c47455a1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php @@ -0,0 +1,58 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LowercaseStyleDefinition sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\LowercaseStyleDefinitionSniff + */ +final class LowercaseStyleDefinitionUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 3 => 1, + 5 => 2, + 11 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css new file mode 100644 index 00000000..6c947e5b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css @@ -0,0 +1,21 @@ +.my-style { + margin-right 15px; + float: left; + margin-left 15px; + margin-top: 15px; + margin-bottom 15px; +} + +@media screen and (max-device-width: 769px) { + header #logo img { + max-width: 100%; + margin-bottom 15px; + } +} + +#foo { background-color: #FF0000; +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php new file mode 100644 index 00000000..29e39848 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php @@ -0,0 +1,58 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the MissingColon sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\MissingColonSniff + */ +final class MissingColonUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 4 => 1, + 6 => 1, + 12 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css new file mode 100644 index 00000000..05637a60 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css @@ -0,0 +1,25 @@ +#red { + background-color: red; +} + +.red { + border-bottom: 1px dotted black; + border-top: 1px dotted gray; +} + +#red.yellow { + background: yellow url(diag_lines_bg.gif) top left; + text-shadow: 0 1px 0 white; +} + +.something--white { + border: 0; +} + +.something--------------white { + border: 0; +} + +.-white { + border: 0; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php new file mode 100644 index 00000000..90744d35 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php @@ -0,0 +1,59 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the NamedColours sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\NamedColoursSniff + */ +final class NamedColoursUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 6 => 1, + 7 => 1, + 11 => 1, + 12 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css new file mode 100644 index 00000000..c656c78e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css @@ -0,0 +1,35 @@ +.my-style { + opacity: 0; + opacity: 0.0; + opacity: 1; + opacity: 1.0; + opacity: 1.5; + opacity: .5; + opacity: 0.5; + opacity: 2; + opacity: -1; + opacity: 0.55; +} + +div { + font-size: 1.2em; + background: linear-gradient(to bottom, #00F, #0F0) repeat scroll 50% 50% #EEE; + min-width: 250px; + max-width: 100%; + padding-bottom: 50px; + box-shadow: 2px -3px 3px rgba(100, 100, 100, 0.33); + border-left: 1px solid #000; + border-right: 1px solid #000; + border-top: 1px solid #000; + border-bottom: 1px dotted #000; + background: url(../1/2/3/4-5-6_7_100x100.png) repeat scroll 50% 50% #EEE; + opacity: -1; +} + +.my-commented-style { + opacity: /*comment*/ 0; + opacity: /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + 0.0; + opacity: /*comment*/ 1.0; + opacity: /*comment*/ .5; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed new file mode 100644 index 00000000..257e41a7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed @@ -0,0 +1,35 @@ +.my-style { + opacity: 0; + opacity: 0; + opacity: 1; + opacity: 1; + opacity: 1.5; + opacity: 0.5; + opacity: 0.5; + opacity: 2; + opacity: -1; + opacity: 0.55; +} + +div { + font-size: 1.2em; + background: linear-gradient(to bottom, #00F, #0F0) repeat scroll 50% 50% #EEE; + min-width: 250px; + max-width: 100%; + padding-bottom: 50px; + box-shadow: 2px -3px 3px rgba(100, 100, 100, 0.33); + border-left: 1px solid #000; + border-right: 1px solid #000; + border-top: 1px solid #000; + border-bottom: 1px dotted #000; + background: url(../1/2/3/4-5-6_7_100x100.png) repeat scroll 50% 50% #EEE; + opacity: -1; +} + +.my-commented-style { + opacity: /*comment*/ 0; + opacity: /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + 0; + opacity: /*comment*/ 1; + opacity: /*comment*/ 0.5; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php new file mode 100644 index 00000000..d323477b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php @@ -0,0 +1,65 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the Opacity sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\OpacitySniff + */ +final class OpacityUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 5 => 1, + 6 => 1, + 7 => 1, + 9 => 1, + 10 => 1, + 11 => 1, + 26 => 1, + 32 => 1, + 33 => 1, + 34 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css new file mode 100644 index 00000000..3ccb162e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css @@ -0,0 +1,61 @@ +.HelpWidgetType-new-bug-title { + width: 308px + float: left; +} + +#MetadataAdminScreen-addField-add { + float: left ; +} + +.TableWidgetType .recover:hover { + background-color: #FFF; +} + +#clearCache-settings:rootNodes-list_0 { + border-top: none; +} + +.HelpWidgetType-list { + list-style-image: url(); +} + +@media (min-width: 320px) and (max-width: 961px) { + .tooltipsrt:hover span.tltp, + .tooltipstp:hover span.tltp { + visibility: hidden; + } +} + +#single-line-multi-statement-no-semicolon { + padding: 0 border: 20; +} + +#multi-line-style-no-semicolon { + padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + border: + 20 + margin: + 0px /* top */ + 10px /* right + left */ +} + +#multi-line-style-whitespace { + padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ ; + border: + 20 ; + margin: + 10px /* top */ + 0px /* right + left */ + + + ; +} + +.allow-for-star-hack { + cursor: pointer; + *cursor: hand; +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed new file mode 100644 index 00000000..7efef588 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed @@ -0,0 +1,58 @@ +.HelpWidgetType-new-bug-title { + width: 308px + float: left; +} + +#MetadataAdminScreen-addField-add { + float: left; +} + +.TableWidgetType .recover:hover { + background-color: #FFF; +} + +#clearCache-settings:rootNodes-list_0 { + border-top: none; +} + +.HelpWidgetType-list { + list-style-image: url(); +} + +@media (min-width: 320px) and (max-width: 961px) { + .tooltipsrt:hover span.tltp, + .tooltipstp:hover span.tltp { + visibility: hidden; + } +} + +#single-line-multi-statement-no-semicolon { + padding: 0 border: 20; +} + +#multi-line-style-no-semicolon { + padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + border: + 20 + margin: + 0px /* top */ + 10px /* right + left */ +} + +#multi-line-style-whitespace { + padding: 0; /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ + border: + 20; + margin: + 10px /* top */ + 0px; /* right + left */ +} + +.allow-for-star-hack { + cursor: pointer; + *cursor: hand; +} + +/* Live coding. Has to be the last test in the file. */ +.intentional-parse-error { + float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php new file mode 100644 index 00000000..ab2c839b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php @@ -0,0 +1,63 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SemicolonSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\SemicolonSpacingSniff + */ +final class SemicolonSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 7 => 1, + 30 => 1, + 34 => 1, + 36 => 1, + 39 => 1, + 43 => 1, + 45 => 1, + 48 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css new file mode 100644 index 00000000..c3d07ef5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css @@ -0,0 +1,41 @@ +#add-new-comment { + background-color: #333333; + padding: 10px; + border-bottom: 1px dotted #F0F0F0; + border-top: 1px dotted #FF00FF; + background: #8fb7db url(diag_lines_bg.gif) top left; + tab-size: 1; + margin: 8px 8px 8px 8px; + margin: 8px 8px; + margin: 0 0 0 0; + margin: 0 8px 0 8px; + margin: 8px 4px 8px 4px; + margin: 8px 4% 8px 4%; + margin: 6px 2px 9px 2px; + margin: 6px 2px 9px; + border-radius: 2px 2px 2px 2px !important; + border-width: 2px 2px 2px 2px; + border-width: 1px 2px 2px 4px; + margin: 97px auto 0 auto; + text-shadow: 0 1px 0 #fff; + border-width: + 2px + 4px + 2px + 4px; + + /* These are style names excluded from this rule. */ + background-position: 0 0; + box-shadow: 2px 2px 2px 2px; + transform-origin: 0 110% 0; + + /* Sizes with comments between them will be ignored for the purposes of this sniff. */ + margin: 8px /*top*/ 8px /*right*/ 8px /*bottom*/ 8px /*left*/; + + /* Same with PHPCS annotations. */ + border-width: + 2px /* phpcs:ignore Standard.Category.SniffName -- for reasons */ + 4px + 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ + 4px; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed new file mode 100644 index 00000000..36297dd6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed @@ -0,0 +1,37 @@ +#add-new-comment { + background-color: #333333; + padding: 10px; + border-bottom: 1px dotted #F0F0F0; + border-top: 1px dotted #FF00FF; + background: #8fb7db url(diag_lines_bg.gif) top left; + tab-size: 1; + margin: 8px; + margin: 8px; + margin: 0; + margin: 0 8px; + margin: 8px 4px; + margin: 8px 4%; + margin: 6px 2px 9px 2px; + margin: 6px 2px 9px 2px; + border-radius: 2px !important; + border-width: 2px; + border-width: 1px 2px 2px 4px; + margin: 97px auto 0 auto; + text-shadow: 0 1px 0 #fff; + border-width: 2px 4px; + + /* These are style names excluded from this rule. */ + background-position: 0 0; + box-shadow: 2px 2px 2px 2px; + transform-origin: 0 110% 0; + + /* Sizes with comments between them will be ignored for the purposes of this sniff. */ + margin: 8px /*top*/ 8px /*right*/ 8px /*bottom*/ 8px /*left*/; + + /* Same with PHPCS annotations. */ + border-width: + 2px /* phpcs:ignore Standard.Category.SniffName -- for reasons */ + 4px + 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ + 4px; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css new file mode 100644 index 00000000..2a91cf71 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css @@ -0,0 +1,3 @@ +/* Intentional parse error. Live coding resilience. */ +#live-coding { + margin: 8px 8px 8px 8px diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php new file mode 100644 index 00000000..7394b77c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php @@ -0,0 +1,72 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ShorthandSize sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ShorthandSizeSniff + */ +final class ShorthandSizeUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ShorthandSizeUnitTest.1.css': + return [ + 8 => 1, + 9 => 1, + 10 => 1, + 11 => 1, + 12 => 1, + 13 => 1, + 15 => 1, + 16 => 1, + 17 => 1, + 21 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc new file mode 100644 index 00000000..2af42d37 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc @@ -0,0 +1,130 @@ + + + + + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassDeclarationSniff + */ +final class ClassDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 5 => 1, + 6 => 1, + 10 => 1, + 15 => 2, + 18 => 1, + 22 => 4, + 23 => 4, + 24 => 4, + 27 => 2, + 30 => 2, + 34 => 1, + 35 => 1, + 39 => 1, + 42 => 1, + 45 => 1, + 48 => 1, + 50 => 2, + 51 => 1, + 55 => 1, + 59 => 4, + 63 => 1, + 65 => 1, + 69 => 3, + 74 => 2, + 77 => 1, + 80 => 1, + 85 => 3, + 89 => 1, + 92 => 1, + 97 => 1, + 108 => 1, + 114 => 1, + 116 => 1, + 118 => 1, + 121 => 1, + 124 => 2, + 128 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc new file mode 100644 index 00000000..8b5a5aa7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc @@ -0,0 +1,45 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php new file mode 100644 index 00000000..7a01e9c0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php @@ -0,0 +1,82 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassFileName sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassFileNameSniff + */ +final class ClassFileNameUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 12 => 1, + 13 => 1, + 14 => 1, + 15 => 1, + 16 => 1, + 17 => 1, + 18 => 1, + 19 => 1, + 20 => 1, + 21 => 1, + 22 => 1, + 23 => 1, + 27 => 1, + 28 => 1, + 29 => 1, + 30 => 1, + 31 => 1, + 32 => 1, + 33 => 1, + 34 => 1, + 35 => 1, + 36 => 1, + 37 => 1, + 38 => 1, + 39 => 1, + 40 => 1, + 41 => 1, + 42 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js new file mode 100644 index 00000000..04126f86 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js @@ -0,0 +1,45 @@ +var x = { + abc: 1, + zyz: 2, + abc: 5, + mno: { + abc: 4 + }, + abc: 5 + + this.request({ + action: 'getSubmissions' + }); + + this.request({ + action: 'deleteSubmission' + }); +} + + +LinkingEditScreenWidgetType.prototype = { + + _addDeleteButtonEvent: function(parentid) + { + var params = { + screen: 'LinkingEditScreenWidget', + assetid: self.assetid, + parentid: parentid, + assetid: parentid, + op: 'deleteLink' + }; + + }, + + saveDesignEdit: function() + { + var params = { + screen: [this.id, 'Widget'].join(''), + assetid: this.assetid, + changes: dfx.jsonEncode(this.currnetLinksWdgt.getChanges()), + op: 'saveLinkEdit' + }; + + } + +}; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php new file mode 100644 index 00000000..567a89cc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DuplicateProperty sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\DuplicatePropertySniff + */ +final class DuplicatePropertyUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 1, + 8 => 1, + 28 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc new file mode 100644 index 00000000..da47fa17 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc @@ -0,0 +1,16 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LowercaseClassKeywords sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\LowercaseClassKeywordsSniff + */ +final class LowercaseClassKeywordsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + $errors = [ + 2 => 3, + 3 => 3, + 4 => 1, + 5 => 1, + 6 => 2, + 8 => 1, + 10 => 1, + 11 => 1, + 14 => 1, + 16 => 1, + ]; + + return $errors; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc new file mode 100644 index 00000000..f2c4713a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc @@ -0,0 +1,185 @@ +testResults; + + + // Correct call to self. + $testResults[] = self::selfMemberReferenceUnitTestFunction(); + $testResults[] = parent::selfMemberReferenceUnitTestFunction(); + + // Incorrect case. + $testResults[] = Self::selfMemberReferenceUnitTestFunction(); + $testResults[] = SELF::selfMemberReferenceUnitTestFunction(); + $testResults[] = SelfMemberReferenceUnitTestExample::selfMemberReferenceUnitTestFunction(); + + + // Incorrect spacing. + $testResults[] = self ::selfMemberReferenceUnitTestFunction(); + $testResults[] = self:: selfMemberReferenceUnitTestFunction(); + $testResults[] = self :: selfMemberReferenceUnitTestFunction(); + + // Remove ALL the newlines + $testResults[] = self + + + + + :: + + + + + selfMemberReferenceUnitTestFunction(); + + } + + + function selfMemberReferenceUnitTestFunction() + { + $this->testCount = $this->testCount + 1; + return $this->testCount; + + } + + +} + + +class MyClass { + + public static function test($value) { + echo "$value\n"; + } + + public static function walk() { + $callback = function($value, $key) { + // This is valid because you can't use self:: in a closure. + MyClass::test($value); + }; + + $array = array(1,2,3); + array_walk($array, $callback); + } +} + +MyClass::walk(); + +class Controller +{ + public function Action() + { + Doctrine\Common\Util\Debug::dump(); + } +} + +class Foo +{ + public static function bar() + { + \Foo::baz(); + } +} + +namespace TYPO3\CMS\Reports; + +class Status { + const NOTICE = -2; + const INFO = -1; + const OK = 0; + const WARNING = 1; + const ERROR = 2; +} + +namespace TYPO3\CMS\Reports\Report\Status; + +class Status implements \TYPO3\CMS\Reports\ReportInterface { + public function getHighestSeverity(array $statusCollection) { + $highestSeverity = \TYPO3\CMS\Reports\Status::NOTICE; + } +} + +namespace Foo; + +class Bar { + + function myFunction() + { + \Foo\Whatever::something(); + \Foo\Bar::something(); + } +} + +namespace Foo\Bar; + +class Baz { + + function myFunction() + { + \Foo\Bar\Whatever::something(); + \Foo\Bar\Baz::something(); + } +} + +class Nested_Anon_Class { + public function getAnonymousClass() { + // Spacing/comments should not cause false negatives for the NotUsed error. + Nested_Anon_Class :: $prop; + Nested_Anon_Class + /* some comment */ + + :: + + // phpcs:ignore Standard.Category.SniffName -- for reasons. + Bar(); + + // Anonymous class is a different scope. + return new class() { + public function nested_function() { + Nested_Anon_Class::$prop; + Nested_Anon_Class::BAR; + } + }; + } +} + +// Test dealing with scoped namespaces. +namespace Foo\Baz { + class BarFoo { + public function foo() { + echo Foo\Baz\BarFoo::$prop; + } + } +} + +// Prevent false negative when namespace has whitespace/comments. +namespace Foo /*comment*/ \ Bah { + class BarFoo { + public function foo() { + echo Foo \ /*comment*/ Bah\BarFoo::$prop; + } + } +} + +namespace EndsIn\CloseTag ?> +testResults; + + + // Correct call to self. + $testResults[] = self::selfMemberReferenceUnitTestFunction(); + $testResults[] = parent::selfMemberReferenceUnitTestFunction(); + + // Incorrect case. + $testResults[] = self::selfMemberReferenceUnitTestFunction(); + $testResults[] = self::selfMemberReferenceUnitTestFunction(); + $testResults[] = self::selfMemberReferenceUnitTestFunction(); + + + // Incorrect spacing. + $testResults[] = self::selfMemberReferenceUnitTestFunction(); + $testResults[] = self::selfMemberReferenceUnitTestFunction(); + $testResults[] = self::selfMemberReferenceUnitTestFunction(); + + // Remove ALL the newlines + $testResults[] = self::selfMemberReferenceUnitTestFunction(); + + } + + + function selfMemberReferenceUnitTestFunction() + { + $this->testCount = $this->testCount + 1; + return $this->testCount; + + } + + +} + + +class MyClass { + + public static function test($value) { + echo "$value\n"; + } + + public static function walk() { + $callback = function($value, $key) { + // This is valid because you can't use self:: in a closure. + MyClass::test($value); + }; + + $array = array(1,2,3); + array_walk($array, $callback); + } +} + +MyClass::walk(); + +class Controller +{ + public function Action() + { + Doctrine\Common\Util\Debug::dump(); + } +} + +class Foo +{ + public static function bar() + { + self::baz(); + } +} + +namespace TYPO3\CMS\Reports; + +class Status { + const NOTICE = -2; + const INFO = -1; + const OK = 0; + const WARNING = 1; + const ERROR = 2; +} + +namespace TYPO3\CMS\Reports\Report\Status; + +class Status implements \TYPO3\CMS\Reports\ReportInterface { + public function getHighestSeverity(array $statusCollection) { + $highestSeverity = \TYPO3\CMS\Reports\Status::NOTICE; + } +} + +namespace Foo; + +class Bar { + + function myFunction() + { + \Foo\Whatever::something(); + self::something(); + } +} + +namespace Foo\Bar; + +class Baz { + + function myFunction() + { + \Foo\Bar\Whatever::something(); + self::something(); + } +} + +class Nested_Anon_Class { + public function getAnonymousClass() { + // Spacing/comments should not cause false negatives for the NotUsed error. + self::$prop; + + /* some comment */ + + self::// phpcs:ignore Standard.Category.SniffName -- for reasons. + Bar(); + + // Anonymous class is a different scope. + return new class() { + public function nested_function() { + Nested_Anon_Class::$prop; + Nested_Anon_Class::BAR; + } + }; + } +} + +// Test dealing with scoped namespaces. +namespace Foo\Baz { + class BarFoo { + public function foo() { + echo self::$prop; + } + } +} + +// Prevent false negative when namespace has whitespace/comments. +namespace Foo /*comment*/ \ Bah { + class BarFoo { + public function foo() { + echo /*comment*/ self::$prop; + } + } +} + +namespace EndsIn\CloseTag ?> + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SelfMemberReference sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\SelfMemberReferenceSniff + */ +final class SelfMemberReferenceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 24 => 1, + 25 => 1, + 26 => 1, + 30 => 1, + 31 => 1, + 32 => 2, + 40 => 2, + 92 => 1, + 121 => 1, + 132 => 1, + 139 => 3, + 140 => 1, + 143 => 2, + 162 => 1, + 171 => 1, + 183 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc new file mode 100644 index 00000000..3fe39435 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc @@ -0,0 +1,191 @@ +anonymous = new class extends ArrayObject + { + public function __construct() + { + parent::__construct(['a' => 1, 'b' => 2]); + } + }; + } +} + +// Valid interface name. +interface ValidCamelCaseClass extends MyClass {} + + +// Incorrect usage of camel case. +interface invalidCamelCaseClass extends MyClass {} +interface Invalid_Camel_Case_Class_With_Underscores implements MyClass {} + + +// All lowercase. +interface invalidlowercaseclass extends MyClass {} +interface invalid_lowercase_class_with_underscores extends MyClass {} + + +// All uppercase. +interface VALIDUPPERCASECLASS extends MyClass {} +interface INVALID_UPPERCASE_CLASS_WITH_UNDERSCORES extends MyClass {} + + +// Mix camel case with uppercase. +interface ValidCamelCaseClassWithUPPERCASE extends MyClass {} + + +// Usage of numeric characters. +interface ValidCamelCaseClassWith1Number extends MyClass {} +interface ValidCamelCaseClassWith12345Numbers extends MyClass {} +interface 5InvalidCamelCaseClassStartingWithNumber extends MyClass {} +interface ValidCamelCaseClassEndingWithNumber5 extends MyClass {} +interface 12345 extends MyClass {} + +interface Testing{} + +interface Base +{ + protected $anonymous; + + public function __construct(); +} + + +// Valid trait name. +trait ValidCamelCaseClass extends MyClass {} + + +// Incorrect usage of camel case. +trait invalidCamelCaseClass extends MyClass {} +trait Invalid_Camel_Case_Class_With_Underscores implements MyClass {} + + +// All lowercase. +trait invalidlowercaseclass extends MyClass {} +trait invalid_lowercase_class_with_underscores extends MyClass {} + + +// All uppercase. +trait VALIDUPPERCASECLASS extends MyClass {} +trait INVALID_UPPERCASE_CLASS_WITH_UNDERSCORES extends MyClass {} + + +// Mix camel case with uppercase. +trait ValidCamelCaseClassWithUPPERCASE extends MyClass {} + + +// Usage of numeric characters. +trait ValidCamelCaseClassWith1Number extends MyClass {} +trait ValidCamelCaseClassWith12345Numbers extends MyClass {} +trait 5InvalidCamelCaseClassStartingWithNumber extends MyClass {} +trait ValidCamelCaseClassEndingWithNumber5 extends MyClass {} +trait 12345 extends MyClass {} + +trait Testing{} + +trait Base +{ + protected $anonymous; + + public function __construct() + { + $this->anonymous = new class extends ArrayObject + { + public function __construct() + { + parent::__construct(['a' => 1, 'b' => 2]); + } + }; + } +} + +// Valid enum name. +enum ValidCamelCaseClass: string {} + + +// Incorrect usage of camel case. +enum invalidCamelCaseClass {} +enum Invalid_Camel_Case_Class_With_Underscores {} + + +// All lowercase. +enum invalidlowercaseclass: INT {} +enum invalid_lowercase_class_with_underscores {} + + +// All uppercase. +enum VALIDUPPERCASECLASS: int {} +enum INVALID_UPPERCASE_CLASS_WITH_UNDERSCORES {} + + +// Mix camel case with uppercase. +enum ValidCamelCaseClassWithUPPERCASE : string {} + + +// Usage of numeric characters. +enum ValidCamelCaseClassWith1Number {} +enum ValidCamelCaseClassWith12345Numbers : string {} +enum ValidCamelCaseClassEndingWithNumber5 {} + +enum Testing{} + +enum Base +{ + public function __construct() + { + $this->anonymous = new class extends ArrayObject + { + public function __construct() + { + parent::__construct(['a' => 1, 'b' => 2]); + } + }; + } +} + +if ( class_exists( Test :: class ) ) {} +if ( class_exists( Test2 ::class ) ) {} + +$foo = new class( + new class implements Countable { + } +) extends DateTime { +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php new file mode 100644 index 00000000..8e505a41 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php @@ -0,0 +1,80 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ValidClassName sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff + */ +final class ValidClassNameUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 9 => 1, + 10 => 1, + 14 => 1, + 15 => 1, + 20 => 1, + 30 => 1, + 32 => 1, + 57 => 1, + 58 => 1, + 62 => 1, + 63 => 1, + 68 => 1, + 78 => 1, + 80 => 1, + 97 => 1, + 98 => 1, + 102 => 1, + 103 => 1, + 108 => 1, + 118 => 1, + 120 => 1, + 145 => 1, + 146 => 1, + 150 => 1, + 151 => 1, + 156 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc new file mode 100644 index 00000000..7cd04a21 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc @@ -0,0 +1,309 @@ + + + + + + + + + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the BlockComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\BlockCommentSniff + */ +final class BlockCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Get a list of CLI values to set before the file is tested. + * + * @param string $testFile The name of the file being tested. + * @param \PHP_CodeSniffer\Config $config The config data for the test run. + * + * @return void + */ + public function setCliValues($testFile, $config) + { + $config->tabWidth = 4; + + }//end setCliValues() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + $errors = [ + 3 => 1, + 8 => 1, + 20 => 1, + 24 => 1, + 30 => 1, + 31 => 1, + 34 => 1, + 40 => 1, + 45 => 1, + 49 => 1, + 51 => 1, + 53 => 1, + 57 => 1, + 60 => 1, + 61 => 1, + 63 => 1, + 65 => 1, + 68 => 1, + 70 => 1, + 72 => 1, + 75 => 1, + 84 => 1, + 87 => 1, + 89 => 1, + 92 => 1, + 111 => 1, + 159 => 1, + 181 => 1, + 188 => 1, + 208 => 1, + 214 => 1, + 226 => 1, + 227 => 1, + 232 => 1, + 233 => 1, + 256 => 1, + 271 => 1, + 273 => 1, + ]; + + return $errors; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc new file mode 100644 index 00000000..8de3d0a7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc @@ -0,0 +1,145 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClassComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff + */ +final class ClassCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 15 => 1, + 31 => 1, + 54 => 1, + 143 => 1, + 145 => 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. + * + * @return array + */ + public function getWarningList() + { + return [ + 29 => 1, + 30 => 1, + 50 => 1, + 66 => 1, + 67 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc new file mode 100644 index 00000000..560370bf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc @@ -0,0 +1,124 @@ + $a; + +trait TestTrait { +}//end trait + +trait TestTrait { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc.fixed new file mode 100644 index 00000000..8c690145 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc.fixed @@ -0,0 +1,117 @@ + $a; + +trait TestTrait { +}//end trait + +trait TestTrait { +}//end trait diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.2.inc new file mode 100644 index 00000000..25913dd8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.2.inc @@ -0,0 +1,7 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClosingDeclarationComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClosingDeclarationCommentSniff + */ +final class ClosingDeclarationCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the test file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ClosingDeclarationCommentUnitTest.1.inc': + return [ + 13 => 1, + 17 => 1, + 31 => 1, + 41 => 1, + 59 => 1, + 63 => 1, + 67 => 1, + 79 => 1, + 83 => 1, + 89 => 1, + 92 => 1, + 98 => 1, + 101 => 1, + 106 => 1, + 110 => 1, + 124 => 1, + ]; + + case 'ClosingDeclarationCommentUnitTest.4.inc': + return [8 => 1]; + + case 'ClosingDeclarationCommentUnitTest.5.inc': + return [11 => 1]; + + default: + return []; + }//end switch + + }//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 test file being tested. + * + * @return array + */ + public function getWarningList($testFile='') + { + switch ($testFile) { + case 'ClosingDeclarationCommentUnitTest.1.inc': + return [71 => 1]; + + case 'ClosingDeclarationCommentUnitTest.2.inc': + case 'ClosingDeclarationCommentUnitTest.3.inc': + return [7 => 1]; + + default: + return []; + } + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc new file mode 100644 index 00000000..d95acd2c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc @@ -0,0 +1,103 @@ + line numbers for each token. + * + * Long description with some points: + * - one + * - two + * - three + * + * @param array &$tokens The array of tokens to process. + * @param object $tokenizer The tokenizer being used to + * process this file. + * @param string $eolChar The EOL character to use for splitting strings. + * + * @return void + */ +function myFunction() {} + +class MyClass2 +{ + /** + * Some info about the variable here. + */ + var $x; +} + +abstract class MyClass +{ + /** +* Property comment + */ + readonly public string $prop; +} + +/** + * Some info about the enum here + * +*/ +enum Suits: string +{ + /** + * Some info about the case here. + */ + case HEARTS; +} + +/** ************************************************************************ + * Example with no errors. + **************************************************************************/ +function example() {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed new file mode 100644 index 00000000..ea6488a0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed @@ -0,0 +1,103 @@ + line numbers for each token. + * + * Long description with some points: + * - one + * - two + * - three + * + * @param array &$tokens The array of tokens to process. + * @param object $tokenizer The tokenizer being used to + * process this file. + * @param string $eolChar The EOL character to use for splitting strings. + * + * @return void + */ +function myFunction() {} + +class MyClass2 +{ + /** + * Some info about the variable here. + */ + var $x; +} + +abstract class MyClass +{ + /** + * Property comment + */ + readonly public string $prop; +} + +/** + * Some info about the enum here + * + */ +enum Suits: string +{ + /** + * Some info about the case here. + */ + case HEARTS; +} + +/** ************************************************************************ + * Example with no errors. + **************************************************************************/ +function example() {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js new file mode 100644 index 00000000..6e1a8781 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js @@ -0,0 +1,76 @@ + +/** +* Some info about the class here + * + */ +foo.prototype = { + + /** + * Some info about the function here. + * + *@return void + */ + bar: function() {} +} + +/** + * Some info about the class here + * + */ +foo.prototype = { + + /** + *Some info about the function here. + * + * @return void + */ + bar: function() {} +} + +/** + * Some info about the class here + * +*/ +foo.prototype = { + + /** + * Some info about the function here. + * + * @return void + */ + bar: function() {} +} + +/** @var Database $mockedDatabase */ +/** @var Container $mockedContainer */ + +function myFunction() +{ + console.info('hi'); + /** + Comment here. + */ +} + +/** + * Creates a map of tokens => line numbers for each token. + * + * Long description with some points: + * - one + * - two + * - three + * + * @param array &$tokens The array of tokens to process. + * @param object $tokenizer The tokenizer being used to + * process this file. + * @param string $eolChar The EOL character to use for splitting strings. + * + * @return void + */ +function myFunction() {} + +$.extend(Datepicker.prototype, { + _widgetDatepicker: function() { + }, + /* Action for selecting a new month/year. */ +}); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed new file mode 100644 index 00000000..9edb4ccc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed @@ -0,0 +1,76 @@ + +/** + * Some info about the class here + * + */ +foo.prototype = { + + /** + * Some info about the function here. + * + * @return void + */ + bar: function() {} +} + +/** + * Some info about the class here + * + */ +foo.prototype = { + + /** + * Some info about the function here. + * + * @return void + */ + bar: function() {} +} + +/** + * Some info about the class here + * + */ +foo.prototype = { + + /** + * Some info about the function here. + * + * @return void + */ + bar: function() {} +} + +/** @var Database $mockedDatabase */ +/** @var Container $mockedContainer */ + +function myFunction() +{ + console.info('hi'); + /** + Comment here. + */ +} + +/** + * Creates a map of tokens => line numbers for each token. + * + * Long description with some points: + * - one + * - two + * - three + * + * @param array &$tokens The array of tokens to process. + * @param object $tokenizer The tokenizer being used to + * process this file. + * @param string $eolChar The EOL character to use for splitting strings. + * + * @return void + */ +function myFunction() {} + +$.extend(Datepicker.prototype, { + _widgetDatepicker: function() { + }, + /* Action for selecting a new month/year. */ +}); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php new file mode 100644 index 00000000..a1ab9c32 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php @@ -0,0 +1,81 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DocCommentAlignment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff + */ +final class DocCommentAlignmentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + $errors = [ + 3 => 1, + 11 => 1, + 17 => 1, + 18 => 1, + 19 => 1, + 23 => 2, + 24 => 1, + 25 => 2, + 26 => 1, + 32 => 1, + 33 => 1, + 38 => 1, + 39 => 1, + ]; + + if ($testFile === 'DocCommentAlignmentUnitTest.inc') { + $errors[75] = 1; + $errors[83] = 1; + $errors[84] = 1; + $errors[90] = 1; + $errors[91] = 1; + $errors[95] = 1; + $errors[96] = 1; + } + + return $errors; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc new file mode 100644 index 00000000..cde6e462 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php new file mode 100644 index 00000000..06c308e0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php @@ -0,0 +1,60 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the EmptyCatchComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\EmptyCatchCommentSniff + */ +final class EmptyCatchCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 13 => 1, + 33 => 1, + 49 => 1, + 50 => 1, + 51 => 1, + 52 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc new file mode 100644 index 00000000..1db2861b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc @@ -0,0 +1,43 @@ + +* @author +* @copyright 1997~1994 The PHP Group +* @copyright 1994-1997 The PHP Group +* @copyright The PHP Group +* @license http://www.php.net/license/3_0.txt +* @summary An unknown summary tag +* +*/ + + +?> + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed new file mode 100644 index 00000000..f584c552 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed @@ -0,0 +1,43 @@ + +* @author +* @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 2024 Squiz Pty Ltd (ABN 77 084 670 600) +* @license http://www.php.net/license/3_0.txt +* @summary An unknown summary tag +* +*/ + + +?> + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js new file mode 100644 index 00000000..57d8d37a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js @@ -0,0 +1,40 @@ + + + + +/** +* +* 0Multi-line short description without full stop +* +* +* asdasd +* long description for file (if any) +* asdasdadada +* +* PHP versio +* +* LICENSE: This source file is subject to version 3.0 of the PHP license +* that is available through the world-wide-web at the following URI: +* http://www.php.net/license/3_0.txt. If you did not receive a copy of +* the PHP License and are unable to obtain it through the web, please +* send a note to license@php.net so we can mail you a copy immediately. +* @package SquizCMS +* @package ADDITIONAL PACKAGE TAG +* @subpkg not_camelcased +* @author Antônio Carlos Venâncio Júnior +* @author +* @copyright 1997~1994 The PHP Group +* @copyright 1994-1997 The PHP Group +* @copyright The PHP Group +* @license http://www.php.net/license/3_0.txt +* @summary An unknown summary tag +* +*/ + + +/** +* This bit here is not qualified as file comment +* +* as it is not the first comment in the file +* +*/ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed new file mode 100644 index 00000000..c7f54ffd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed @@ -0,0 +1,40 @@ + + + + +/** +* +* 0Multi-line short description without full stop +* +* +* asdasd +* long description for file (if any) +* asdasdadada +* +* PHP versio +* +* LICENSE: This source file is subject to version 3.0 of the PHP license +* that is available through the world-wide-web at the following URI: +* http://www.php.net/license/3_0.txt. If you did not receive a copy of +* the PHP License and are unable to obtain it through the web, please +* send a note to license@php.net so we can mail you a copy immediately. +* @package SquizCMS +* @package ADDITIONAL PACKAGE TAG +* @subpkg not_camelcased +* @author Squiz Pty Ltd +* @author +* @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) +* @copyright 2024 Squiz Pty Ltd (ABN 77 084 670 600) +* @license http://www.php.net/license/3_0.txt +* @summary An unknown summary tag +* +*/ + + +/** +* This bit here is not qualified as file comment +* +* as it is not the first comment in the file +* +*/ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc new file mode 100644 index 00000000..1f82abfe --- /dev/null +++ b/trunk/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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc new file mode 100644 index 00000000..520d3497 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc @@ -0,0 +1,11 @@ + + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + */ + +echo 'hi'; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js new file mode 100644 index 00000000..4bb4d50d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js @@ -0,0 +1,10 @@ +/** + * File comment. + * + * @package Package + * @subpackage Subpackage + * @author Squiz Pty Ltd + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + */ + +print 'hi'; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc new file mode 100644 index 00000000..b47603f2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc @@ -0,0 +1,9 @@ + + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + * diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc new file mode 100644 index 00000000..2fdeeba1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc @@ -0,0 +1,3 @@ + + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + */ + +class Foo { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc new file mode 100644 index 00000000..7074dac2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc @@ -0,0 +1,12 @@ + + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + */ +#[Attribute] +class Foo { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc new file mode 100644 index 00000000..5ef90f2a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc @@ -0,0 +1,9 @@ + + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.9.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.9.inc new file mode 100644 index 00000000..f6c9d996 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.9.inc @@ -0,0 +1,12 @@ + + * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) + */ + +enum Foo { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php new file mode 100644 index 00000000..d5816bff --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php @@ -0,0 +1,82 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FileComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FileCommentSniff + */ +final class FileCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'FileCommentUnitTest.1.inc': + case 'FileCommentUnitTest.1.js': + return [ + 1 => 1, + 22 => 2, + 23 => 1, + 24 => 2, + 25 => 2, + 26 => 1, + 27 => 2, + 28 => 2, + 32 => 2, + ]; + + case 'FileCommentUnitTest.4.inc': + case 'FileCommentUnitTest.6.inc': + case 'FileCommentUnitTest.7.inc': + case 'FileCommentUnitTest.9.inc': + case 'FileCommentUnitTest.10.inc': + return [1 => 1]; + + case 'FileCommentUnitTest.5.inc': + return [2 => 1]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc new file mode 100644 index 00000000..7e94bb26 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc @@ -0,0 +1,511 @@ +callSomeFunction(); + + }//end okFunction() + + + /** + * Comment inside function. + * + * @throws Exception + */ + function okFunction() + { + /** + * @var FooClass + */ + $foo = FooFactory::factory(); + throw new Exception; + + }//end okFunction + + /** + * Needs at throws tag for rethrown exception, + * even though we have one throws tag. + * + * @throws PHP_Exception1 + */ + public function notOkVariableRethrown() + { + throw new PHP_Exception1('Error'); + + try { + // Do something. + } catch (PHP_Exception2 $e) { + logError(); + throw $e; + } + + }//end notOkVariableRethrown() + + /** + * Needs at throws tag for rethrown exception, + * even though we have one throws tag. + * + * @throws PHP_Exception1 + */ + public function notOkVariableRethrown() + { + throw new PHP_Exception1('Error'); + + try { + // Do something. + } catch (PHP_Exception1 | PHP_Exception2 $e) { + logError(); + throw $e; + } + + }//end notOkVariableRethrown() + + /** + * Has correct throws tags for all exceptions + * + * @throws PHP_Exception1 + * @throws PHP_Exception2 + */ + public function okVariableRethrown() + { + throw new PHP_Exception1('Error'); + + try { + // Do something. + } catch (PHP_Exception2 $e) { + logError(); + throw $e; + } + + }//end okVariableRethrown() + + /** + * Has correct throws tags for all exceptions + * + * @throws PHP_Exception1 + * @throws PHP_Exception2 + */ + public function okVariableMultiRethrown() + { + try { + // Do something. + } catch (PHP_Exception1 | PHP_Exception2 $e) { + logError(); + throw $e; + } + + }//end okVariableMultiRethrown() +}//end class + +class NamespacedException { + /** + * @throws \Exception + */ + public function foo() { + throw new \Exception(); + } + + /** + * @throws \Foo\Bar\FooBarException + */ + public function fooBar2() { + throw new \Foo\Bar\FooBarException(); + } + + /** + * @throws FooBarException + */ + public function fooBar2() { + throw new \Foo\Bar\FooBarException(); + } +} + +class Foo { + /** + * Comment + */ + public function foo() { + }//end foo() + + public function bar() { + throw new Exception(); + } + + /** + * Returns information for a test. + * + * This info includes parameters, their valid values. + * + * @param integer $projectid Id of the project. + * + * @return array + * @throws ChannelException If the project is invalid. + */ + public static function getTestInfo($projectid=NULL) + { + try { + DAL::beginTransaction(); + DAL::commit(); + } catch (DALException $e) { + DAL::rollBack(); + throw new ChannelException($e); + } + } +} + +class Test +{ + /** + * Folder name. + * + * @var string + */ + protected $folderName; + + protected function setUp() + { + parent::setUp(); + + if ( !strlen($this->folderName) ) { + throw new \RuntimeException('The $this->folderName must be specified before proceeding.'); + } + } + + /* + * + */ + protected function foo() + { + } + + /** + * @return Closure + */ + public function getStuff() + { + return function () { + throw new RuntimeException("bam!"); + }; + } +} + +/** + * Class comment. + */ +class A +{ + /** + * Function B. + */ + public function b() + { + return new class { + public function c() + { + throw new \Exception(); + } + } + } +} + +/** + * Class comment. + */ +class A +{ + /** + * Function B. + */ + public function b() + { + return new class { + /** + * Tag and token number mismatch. + * + * @throws PHP_Exception1 + * @throws PHP_Exception2 + */ + public function oneLessThrowsTagNeeded() + { + throw new PHP_Exception1('Error'); + + }//end oneLessThrowsTagNeeded() + } + } +} + +abstract class SomeClass { + /** + * Comment here. + */ + abstract public function getGroups(); +} + +class SomeClass { + /** + * Validates something. + * + * @param string $method The set method parameter. + * + * @return string The validated method. + * + * @throws Prefix_Invalid_Argument_Exception The invalid argument exception. + * @throws InvalidArgumentException The invalid argument exception. + */ + protected function validate_something( $something ) { + if ( ! Prefix_Validator::is_string( $something ) ) { + throw Prefix_Invalid_Argument_Exception::invalid_string_parameter( $something, 'something' ); + } + + if ( ! in_array( $something, $this->valid_http_something, true ) ) { + throw new InvalidArgumentException( sprintf( '%s is not a valid HTTP something', $something ) ); + } + + return $something; + } + + /** + * Comment + * + * @throws Exception1 Comment. + * @throws Exception2 Comment. + * @throws Exception3 Comment. + */ + public function foo() { + switch ($foo) { + case 1: + throw Exception1::a(); + case 2: + throw Exception1::b(); + case 3: + throw Exception1::c(); + case 4: + throw Exception2::a(); + case 5: + throw Exception2::b(); + default: + throw new Exception3; + + } + } +} + +namespace Test\Admin { + class NameSpacedClass { + /** + * @throws \ExceptionFromGlobalNamespace + */ + public function ExceptionInGlobalNamespace() { + throw new \ExceptionFromGlobalNamespace(); + } + + /** + * @throws ExceptionFromSameNamespace + */ + public function ExceptionInSameNamespace() { + throw new ExceptionFromSameNamespace(); + } + + /** + * @throws \Test\Admin\ExceptionFromSameNamespace + */ + public function ExceptionInSameNamespaceToo() { + throw new ExceptionFromSameNamespace(); + } + + /** + * @throws \Different\NameSpaceName\ExceptionFromDifferentNamespace + */ + public function ExceptionInSameNamespaceToo() { + throw new \Different\NameSpaceName\ExceptionFromDifferentNamespace(); + } + } +} + +namespace { + class GlobalNameSpaceClass { + /** + * @throws SomeGlobalException + */ + public function ThrowGlobalException() { + throw new SomeGlobalException(); + } + + /** + * @throws \SomeGlobalException + */ + public function ThrowGlobalExceptionToo() { + throw new SomeGlobalException(); + } + } +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php new file mode 100644 index 00000000..178b85a2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php @@ -0,0 +1,65 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionCommentThrowTag sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentThrowTagSniff + */ +final class FunctionCommentThrowTagUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 9 => 1, + 21 => 1, + 35 => 1, + 47 => 1, + 61 => 2, + 106 => 1, + 123 => 1, + 200 => 1, + 219 => 1, + 287 => 1, + 397 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc new file mode 100644 index 00000000..4fcbb6db --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc @@ -0,0 +1,1160 @@ +MyClass) + */ +public function caseSensitive($a1, $a2, $a3, arRay $a4, $a5, $a6, myclas $a7) +{ + +}//end caseSensitive() + + +/** + * More type hint check for custom type and array. + * + * @param array $a1 Comment here. + * @param array $a2 Comment here. + * @param MyClass $a3 Comment here. + * @param MyClass $a4 Comment here. + * + * @return array(int => MyClass) + */ +public function typeHint(MyClass $a1, $a2, myclass $a3, $a4) +{ + return (3 => 'myclass obj'); + +}//end typeHint() + + +/** + * Mixed variable type separated by a '|'. + * + * @param array|string $a1 Comment here. + * @param mixed $a2 Comment here. + * @param string|array $a3 Comment here. + * @param MyClass|int $a4 Comment here. + * + * @return bool + */ +public function mixedType($a1, $a2, $a3, $a4) +{ + return true; + +}//end mixedType() + + +/** + * Array type. + * + * @param array(MyClass) $a1 OK. + * @param array() $a2 Invalid type. + * @param array( $a3 Typo. + * @param array(int) $a4 Use 'array(integer)' instead. + * @param array(int => integer) $a5 Use 'array(integer => integer)' instead. + * @param array(integer => bool) $a6 Use 'array(integer => boolean)' instead. + * @param aRRay $a7 Use 'array' instead. + * @param string $a8 String with unknown type hint. + * + * @return int + */ +public function mixedArrayType($a1, $a2, array $a3, $a4, $a5, $a6, $a7, unknownTypeHint $a8) +{ + return 1; + +}//end mixedArrayType() + + +/** + */ +function empty1() +{ +}//end empty1() + + +/** + * + */ +function empty2() +{ +}//end empty2() + + +/** + * + * + * + */ +function empty3() +{ +}//end empty3 + + +/** + * @return boolean + */ +public function missingShortDescriptionInFunctionComment() +{ + return true; + +}//end missingShortDescriptionInFunctionComment() + + +class Another_Class +{ + + /** + * Destructor should not include a return tag. + * + * @return void + */ + function __destruct() + { + return; + } + + /** + * Constructor should not include a return tag. + * + * @return void + */ + function __construct() + { + return; + } + +}//end class + + +/** + * Comment param alignment test. + * + * @param string $varrr1 Comment1.. + * @param string $vr2 Comment2. + * @param string $var3 Comment3.. + * + * @return void + */ +public static function paramAlign($varrr1, $vr2, $var3) +{ + +}//end paramAlign() + + +/** + * Comment. + * + * @param string $id Comment. + * @param array $design Comment. + * + * @return void + */ +public static function paint($id, array $design) +{ + +}//end paint() + + +/** + * Adds specified class name to class attribute of this widget. + * + * @since 4.0.0 + * @return string + */ +public function myFunction() +{ + if ($condition === FALSE) { + echo 'hi'; + } + +}//end myFunction() + + +/** + * Adds specified class name to class attribute of this widget. + * + * @return string + */ +public function myFunction() +{ + if ($condition === FALSE) { + echo 'hi'; + return; + } + + return 'blah'; + +}//end myFunction() + + +/** + * Adds specified class name to class attribute of this widget. + * + * @return string + */ +public function myFunction() +{ + if ($condition === FALSE) { + echo 'hi'; + } + + return 'blah'; + +}//end myFunction() + +/** + * Test function. + * + * @param string $arg1 An argument + * + * @access public + * @return bool + */ + +echo $blah; + +function myFunction($arg1) {} + +class MyClass() { + /** + * An abstract function. + * + * @return string[] + */ + abstract final protected function myFunction(); +} + +/** + * Comment. + * + * @param mixed $test An argument. + * + * @return mixed + */ +function test($test) +{ + if ($test === TRUE) { + return; + } + + return $test; + +}//end test() + + +/** Comment. + * + * @return mixed + * + */ +function test() +{ + +}//end test() + +/** + * Comment. + * + * @param \other\ns\item $test An argument. + * + * @return mixed + */ +function test(\other\ns\item $test) +{ + return $test; + +}//end test() + +/** + * Comment. + * + * @param item $test An argument. + * + * @return mixed + */ +function test(\other\ns\item $test) +{ + return $test; + +}//end test() + +/** + * Comment. + * + * @param \first\ns\item $test An argument. + * + * @return mixed + */ +function test(\first\ns\item $test = \second\ns::CONSTANT) +{ + return $test; + +}//end test() + +/** + * Comment. + * + * @param \first\item $test An argument. + * + * @return mixed + */ +function test(\first\ns\item $test = \second\ns::CONSTANT) +{ + return $test; + +}//end test() + +// Closures should be ignored. +preg_replace_callback( + '~-([a-z])~', + function ($match) { + return strtoupper($match[1]); + }, + 'hello-world' +); + +$callback = function ($bar) use ($foo) + { + $bar += $foo; + }; + +/** + * Comment should end with '*', not '**' before the slash. + **/ +function test123() { + +} + +/** + * Cant use resource for type hint. + * + * @param resource $test An argument. + * + * @return mixed + */ +function test($test) +{ + return $test; + +}//end test() + +/** + * Variable number of args. + * + * @param string $a1 Comment here. + * @param string $a2 Comment here. + * @param string $a2,... Comment here. + * + * @return boolean + */ +public function variableArgs($a1, $a2) +{ + return true; + +}//end variableArgs() + +/** + * Contains closure. + * + * @return void + */ +public function containsClosure() +{ + function ($e) { + return new Event($e); + }, + +}//end containsClosure() + +/** + * 这是一条测试评论. + * + * @return void + */ +public function test() +{ + +}//end variableArgs() + +/** + * Uses callable. + * + * @param callable $cb Test parameter. + * + * @return void + */ +public function usesCallable(callable $cb) { + $cb(); +}//end usesCallable() + +/** + * Creates a map of tokens => line numbers for each token. + * + * @param array $tokens The array of tokens to process. + * @param object $tokenizer The tokenizer being used to process this file. + * @param string $eolChar The EOL character + * to use for splitting strings. + * + * @return void + * @throws Exception If something really bad + * happens while doing foo. + */ +public function foo(array &$tokens, $tokenizer, $eolChar) +{ + +}//end foo() + +/** + * Some description. + * + * @param \Vendor\Package\SomeClass $someclass Some class. + * @param \OtherVendor\Package\SomeClass2 $someclass2 Some class. + * @param \OtherVendor\Package\SomeClass2 $someclass3 Some class. + * + * @return void + */ +public function foo(SomeClass $someclass, \OtherVendor\Package\SomeClass2 $someclass2, SomeClass3 $someclass3) +{ +} + +/** + * Gettext. + * + * @return string + */ +public function _() { + return $foo; +} + +class Baz { + /** + * The PHP5 constructor + * + * No return tag + */ + public function __construct() { + + } +} + +/** + * Test + * + * @return void + * @throws E + */ +function myFunction() {} + +/** + * Yield test + * + * @return integer + */ +function yieldTest() +{ + for ($i = 0; $i < 5; $i++) { + yield $i; + } +} + +/** + * Yield test + * + * @return void + */ +function yieldTest() +{ + for ($i = 0; $i < 5; $i++) { + yield $i; + } +} + +/** + * Using "array" as a type hint should satisfy a specified array parameter type. + * + * @param MyClass[] $values An array of MyClass objects. + * + * @return void + */ +public function specifiedArray(array $values) { + +}// end specifiedArray() + +/** + * Using "callable" as a type hint should satisfy a "callback" parameter type. + * + * @param callback $cb A callback. + * + * @return void + */ +public function callableCallback(callable $cb) { + +}// end callableCallback() + +/** + * PHP7 type hints. + * + * @param string $name1 Comment. + * @param integer $name2 Comment. + * @param float $name3 Comment. + * @param boolean $name4 Comment. + * + * @return void + */ +public function myFunction (string $name1, int $name2, float $name3, bool $name4) { +} + +/** + * Variadic function. + * + * @param string $name1 Comment. + * @param string ...$name2 Comment. + * + * @return void + */ +public function myFunction(string $name1, string ...$name2) { +} + + +/** + * Variadic function. + * + * @param string $name1 Comment. + * @param string $name2 Comment. + * + * @return void + */ +public function myFunction(string $name1, string ...$name2) { +} + +/** + * Return description function + correct type. + * + * @return integer This is a description. + */ +public function myFunction() { + return 5; +} + +/** + * Return description function + incorrect type. + * + * @return int This is a description. + */ +public function myFunction() { + return 5; +} + +/** + * Return description function + no return. + * + * @return void This is a description. + */ +public function myFunction() { +} + +/** + * Return description function + mixed return. + * + * @return mixed This is a description. + */ +public function myFunction() { +} + +/** + * Function comment. + * + * @param $bar + * Comment here. + * @param ... + * Additional arguments here. + * + * @return + * Return value + * + */ +function foo($bar) { +} + +/** + * Do something. + * + * @return void + */ +public function someFunc(): void +{ + $class = new class + { + /** + * Do something. + * + * @return string + */ + public function getString(): string + { + return 'some string'; + } + }; +} + +/** + * Return description function + mixed return types. + * + * @return bool|int This is a description. + */ +function returnTypeWithDescriptionA() +{ + return 5; + +}//end returnTypeWithDescriptionA() + + +/** + * Return description function + mixed return types. + * + * @return real|bool This is a description. + */ +function returnTypeWithDescriptionB() +{ + return 5; + +}//end returnTypeWithDescriptionB() + + +/** + * Return description function + lots of different mixed return types. + * + * @return int|object|string[]|real|double|float|bool|array(int=>MyClass)|callable And here we have a description + */ +function returnTypeWithDescriptionC() +{ + return 5; + +}//end returnTypeWithDescriptionC() + + +/** + * Return description function + lots of different mixed return types. + * + * @return array(int=>bool)|\OtherVendor\Package\SomeClass2|MyClass[]|void And here we have a description + */ +function returnTypeWithDescriptionD() +{ + +}//end returnTypeWithDescriptionD() + +/** + * Yield from test + * + * @return int[] + */ +function yieldFromTest() +{ + yield from foo(); +} + +/** + * Audio + * + * Generates an audio element to embed sounds + * + * @param mixed $src Either a source string or + * an array of sources. + * @param mixed $unsupportedMessage The message to display + * if the media tag is not supported by the browser. + * @param mixed $attributes HTML attributes. + * @return string + */ +function audio( + $src, + $unsupportedMessage = '', + $attributes = '', +) +{ + return 'test'; +} + +/** + * Test function + * + * @return array + */ +function returnArrayWithClosure() +{ + function () { + return; + }; + + return []; +} + +/** + * Test function + * + * @return array + */ +function returnArrayWithAnonymousClass() +{ + new class { + /** + * @return void + */ + public function test() { + return; + } + }; + + return []; +} + +/** + * @return void + */ +function returnVoidWithClosure() +{ + function () { + return 1; + }; +} + +/** + * @return void + */ +function returnVoidWithAnonymousClass() +{ + new class { + /** + * @return integer + */ + public function test() + { + return 1; + } + }; +} + +class TestReturnVoid +{ + /** + * @return void + */ + public function test() + { + function () { + return 4; + }; + } +} + +/** + * Comment here. + * + * @param integer $a This is A. + * @param ?array $b This is B. + * + * @return void + */ +public static function foo(?int $a, ?array $b) {} + +/** + * Comment here. + * + * @param object $a This is A. + * @param object $b This is B. + * + * @return void + */ +public function foo(object $a, ?object $b) {} + +/** + * Prepares given PHP class method for later code building. + * + * @param integer $foo Comment. + * - Additional comment. + * + * @return void + */ +function foo($foo) {} + +/** + * {@inheritDoc} + */ +public function foo($a, $b) {} + +// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true + +/** + * {@inheritDoc} + */ +public function foo($a, $b) {} + +/** + * Foo. + * + * @param mixed $a Comment. + * + * @return mixed + */ +public function foo(mixed $a): mixed {} + +// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] +class Bar { + /** + * The PHP5 constructor + */ + public function __construct() { + + } +} + +// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] ignored +/** + * Should be ok + */ +public function ignored() { + +} + +// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] __construct,__destruct + +/** + * @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() {} + +/** + * @param $noTypeNoComment + * @return void + */ +function paramVariation1($noTypeNoComment): void {} + +/** + * @param $noTypeWithComment This parameter has no type specified. + * @return void + */ +function paramVariation2($noTypeWithComment): void {} + +/** + * @param integer $hasTypeNoComment + * @return void + */ +function paramVariation3($hasTypeNoComment): void {} + +/** + * @param integer $hasTypehasComment This parameter has type. + * @return void + */ +function paramVariation4($hasTypehasComment): void {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed new file mode 100644 index 00000000..817630b5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed @@ -0,0 +1,1160 @@ + MyClass) + */ +public function caseSensitive($a1, $a2, $a3, arRay $a4, $a5, $a6, myclas $a7) +{ + +}//end caseSensitive() + + +/** + * More type hint check for custom type and array. + * + * @param array $a1 Comment here. + * @param array $a2 Comment here. + * @param MyClass $a3 Comment here. + * @param MyClass $a4 Comment here. + * + * @return array(integer => MyClass) + */ +public function typeHint(MyClass $a1, $a2, myclass $a3, $a4) +{ + return (3 => 'myclass obj'); + +}//end typeHint() + + +/** + * Mixed variable type separated by a '|'. + * + * @param array|string $a1 Comment here. + * @param mixed $a2 Comment here. + * @param string|array $a3 Comment here. + * @param MyClass|integer $a4 Comment here. + * + * @return boolean + */ +public function mixedType($a1, $a2, $a3, $a4) +{ + return true; + +}//end mixedType() + + +/** + * Array type. + * + * @param array(MyClass) $a1 OK. + * @param array $a2 Invalid type. + * @param array $a3 Typo. + * @param array(integer) $a4 Use 'array(integer)' instead. + * @param array(integer => integer) $a5 Use 'array(integer => integer)' instead. + * @param array(integer => boolean) $a6 Use 'array(integer => boolean)' instead. + * @param array $a7 Use 'array' instead. + * @param string $a8 String with unknown type hint. + * + * @return integer + */ +public function mixedArrayType($a1, $a2, array $a3, $a4, $a5, $a6, $a7, unknownTypeHint $a8) +{ + return 1; + +}//end mixedArrayType() + + +/** + */ +function empty1() +{ +}//end empty1() + + +/** + * + */ +function empty2() +{ +}//end empty2() + + +/** + * + * + * + */ +function empty3() +{ +}//end empty3 + + +/** + * @return boolean + */ +public function missingShortDescriptionInFunctionComment() +{ + return true; + +}//end missingShortDescriptionInFunctionComment() + + +class Another_Class +{ + + /** + * Destructor should not include a return tag. + * + * @return void + */ + function __destruct() + { + return; + } + + /** + * Constructor should not include a return tag. + * + * @return void + */ + function __construct() + { + return; + } + +}//end class + + +/** + * Comment param alignment test. + * + * @param string $varrr1 Comment1.. + * @param string $vr2 Comment2. + * @param string $var3 Comment3.. + * + * @return void + */ +public static function paramAlign($varrr1, $vr2, $var3) +{ + +}//end paramAlign() + + +/** + * Comment. + * + * @param string $id Comment. + * @param array $design Comment. + * + * @return void + */ +public static function paint($id, array $design) +{ + +}//end paint() + + +/** + * Adds specified class name to class attribute of this widget. + * + * @since 4.0.0 + * @return string + */ +public function myFunction() +{ + if ($condition === FALSE) { + echo 'hi'; + } + +}//end myFunction() + + +/** + * Adds specified class name to class attribute of this widget. + * + * @return string + */ +public function myFunction() +{ + if ($condition === FALSE) { + echo 'hi'; + return; + } + + return 'blah'; + +}//end myFunction() + + +/** + * Adds specified class name to class attribute of this widget. + * + * @return string + */ +public function myFunction() +{ + if ($condition === FALSE) { + echo 'hi'; + } + + return 'blah'; + +}//end myFunction() + +/** + * Test function. + * + * @param string $arg1 An argument + * + * @access public + * @return bool + */ + +echo $blah; + +function myFunction($arg1) {} + +class MyClass() { + /** + * An abstract function. + * + * @return string[] + */ + abstract final protected function myFunction(); +} + +/** + * Comment. + * + * @param mixed $test An argument. + * + * @return mixed + */ +function test($test) +{ + if ($test === TRUE) { + return; + } + + return $test; + +}//end test() + + +/** Comment. + * + * @return mixed + * + */ +function test() +{ + +}//end test() + +/** + * Comment. + * + * @param \other\ns\item $test An argument. + * + * @return mixed + */ +function test(\other\ns\item $test) +{ + return $test; + +}//end test() + +/** + * Comment. + * + * @param item $test An argument. + * + * @return mixed + */ +function test(\other\ns\item $test) +{ + return $test; + +}//end test() + +/** + * Comment. + * + * @param \first\ns\item $test An argument. + * + * @return mixed + */ +function test(\first\ns\item $test = \second\ns::CONSTANT) +{ + return $test; + +}//end test() + +/** + * Comment. + * + * @param \first\item $test An argument. + * + * @return mixed + */ +function test(\first\ns\item $test = \second\ns::CONSTANT) +{ + return $test; + +}//end test() + +// Closures should be ignored. +preg_replace_callback( + '~-([a-z])~', + function ($match) { + return strtoupper($match[1]); + }, + 'hello-world' +); + +$callback = function ($bar) use ($foo) + { + $bar += $foo; + }; + +/** + * Comment should end with '*', not '**' before the slash. + **/ +function test123() { + +} + +/** + * Cant use resource for type hint. + * + * @param resource $test An argument. + * + * @return mixed + */ +function test($test) +{ + return $test; + +}//end test() + +/** + * Variable number of args. + * + * @param string $a1 Comment here. + * @param string $a2 Comment here. + * @param string $a2,... Comment here. + * + * @return boolean + */ +public function variableArgs($a1, $a2) +{ + return true; + +}//end variableArgs() + +/** + * Contains closure. + * + * @return void + */ +public function containsClosure() +{ + function ($e) { + return new Event($e); + }, + +}//end containsClosure() + +/** + * 这是一条测试评论. + * + * @return void + */ +public function test() +{ + +}//end variableArgs() + +/** + * Uses callable. + * + * @param callable $cb Test parameter. + * + * @return void + */ +public function usesCallable(callable $cb) { + $cb(); +}//end usesCallable() + +/** + * Creates a map of tokens => line numbers for each token. + * + * @param array $tokens The array of tokens to process. + * @param object $tokenizer The tokenizer being used to process this file. + * @param string $eolChar The EOL character + * to use for splitting strings. + * + * @return void + * @throws Exception If something really bad + * happens while doing foo. + */ +public function foo(array &$tokens, $tokenizer, $eolChar) +{ + +}//end foo() + +/** + * Some description. + * + * @param \Vendor\Package\SomeClass $someclass Some class. + * @param \OtherVendor\Package\SomeClass2 $someclass2 Some class. + * @param \OtherVendor\Package\SomeClass2 $someclass3 Some class. + * + * @return void + */ +public function foo(SomeClass $someclass, \OtherVendor\Package\SomeClass2 $someclass2, SomeClass3 $someclass3) +{ +} + +/** + * Gettext. + * + * @return string + */ +public function _() { + return $foo; +} + +class Baz { + /** + * The PHP5 constructor + * + * No return tag + */ + public function __construct() { + + } +} + +/** + * Test + * + * @return void + * @throws E + */ +function myFunction() {} + +/** + * Yield test + * + * @return integer + */ +function yieldTest() +{ + for ($i = 0; $i < 5; $i++) { + yield $i; + } +} + +/** + * Yield test + * + * @return void + */ +function yieldTest() +{ + for ($i = 0; $i < 5; $i++) { + yield $i; + } +} + +/** + * Using "array" as a type hint should satisfy a specified array parameter type. + * + * @param MyClass[] $values An array of MyClass objects. + * + * @return void + */ +public function specifiedArray(array $values) { + +}// end specifiedArray() + +/** + * Using "callable" as a type hint should satisfy a "callback" parameter type. + * + * @param callback $cb A callback. + * + * @return void + */ +public function callableCallback(callable $cb) { + +}// end callableCallback() + +/** + * PHP7 type hints. + * + * @param string $name1 Comment. + * @param integer $name2 Comment. + * @param float $name3 Comment. + * @param boolean $name4 Comment. + * + * @return void + */ +public function myFunction (string $name1, int $name2, float $name3, bool $name4) { +} + +/** + * Variadic function. + * + * @param string $name1 Comment. + * @param string ...$name2 Comment. + * + * @return void + */ +public function myFunction(string $name1, string ...$name2) { +} + + +/** + * Variadic function. + * + * @param string $name1 Comment. + * @param string $name2 Comment. + * + * @return void + */ +public function myFunction(string $name1, string ...$name2) { +} + +/** + * Return description function + correct type. + * + * @return integer This is a description. + */ +public function myFunction() { + return 5; +} + +/** + * Return description function + incorrect type. + * + * @return integer This is a description. + */ +public function myFunction() { + return 5; +} + +/** + * Return description function + no return. + * + * @return void This is a description. + */ +public function myFunction() { +} + +/** + * Return description function + mixed return. + * + * @return mixed This is a description. + */ +public function myFunction() { +} + +/** + * Function comment. + * + * @param $bar + * Comment here. + * @param ... + * Additional arguments here. + * + * @return + * Return value + * + */ +function foo($bar) { +} + +/** + * Do something. + * + * @return void + */ +public function someFunc(): void +{ + $class = new class + { + /** + * Do something. + * + * @return string + */ + public function getString(): string + { + return 'some string'; + } + }; +} + +/** + * Return description function + mixed return types. + * + * @return boolean|integer This is a description. + */ +function returnTypeWithDescriptionA() +{ + return 5; + +}//end returnTypeWithDescriptionA() + + +/** + * Return description function + mixed return types. + * + * @return float|boolean This is a description. + */ +function returnTypeWithDescriptionB() +{ + return 5; + +}//end returnTypeWithDescriptionB() + + +/** + * Return description function + lots of different mixed return types. + * + * @return integer|object|string[]|float|boolean|array(integer => MyClass)|callable And here we have a description + */ +function returnTypeWithDescriptionC() +{ + return 5; + +}//end returnTypeWithDescriptionC() + + +/** + * Return description function + lots of different mixed return types. + * + * @return array(integer => boolean)|\OtherVendor\Package\SomeClass2|MyClass[]|void And here we have a description + */ +function returnTypeWithDescriptionD() +{ + +}//end returnTypeWithDescriptionD() + +/** + * Yield from test + * + * @return int[] + */ +function yieldFromTest() +{ + yield from foo(); +} + +/** + * Audio + * + * Generates an audio element to embed sounds + * + * @param mixed $src Either a source string or + * an array of sources. + * @param mixed $unsupportedMessage The message to display + * if the media tag is not supported by the browser. + * @param mixed $attributes HTML attributes. + * @return string + */ +function audio( + $src, + $unsupportedMessage = '', + $attributes = '', +) +{ + return 'test'; +} + +/** + * Test function + * + * @return array + */ +function returnArrayWithClosure() +{ + function () { + return; + }; + + return []; +} + +/** + * Test function + * + * @return array + */ +function returnArrayWithAnonymousClass() +{ + new class { + /** + * @return void + */ + public function test() { + return; + } + }; + + return []; +} + +/** + * @return void + */ +function returnVoidWithClosure() +{ + function () { + return 1; + }; +} + +/** + * @return void + */ +function returnVoidWithAnonymousClass() +{ + new class { + /** + * @return integer + */ + public function test() + { + return 1; + } + }; +} + +class TestReturnVoid +{ + /** + * @return void + */ + public function test() + { + function () { + return 4; + }; + } +} + +/** + * Comment here. + * + * @param integer $a This is A. + * @param array $b This is B. + * + * @return void + */ +public static function foo(?int $a, ?array $b) {} + +/** + * Comment here. + * + * @param object $a This is A. + * @param object $b This is B. + * + * @return void + */ +public function foo(object $a, ?object $b) {} + +/** + * Prepares given PHP class method for later code building. + * + * @param integer $foo Comment. + * - Additional comment. + * + * @return void + */ +function foo($foo) {} + +/** + * {@inheritDoc} + */ +public function foo($a, $b) {} + +// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true + +/** + * {@inheritDoc} + */ +public function foo($a, $b) {} + +/** + * Foo. + * + * @param mixed $a Comment. + * + * @return mixed + */ +public function foo(mixed $a): mixed {} + +// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] +class Bar { + /** + * The PHP5 constructor + */ + public function __construct() { + + } +} + +// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] ignored +/** + * Should be ok + */ +public function ignored() { + +} + +// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] __construct,__destruct + +/** + * @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() {} + +/** + * @param $noTypeNoComment + * @return void + */ +function paramVariation1($noTypeNoComment): void {} + +/** + * @param $noTypeWithComment This parameter has no type specified. + * @return void + */ +function paramVariation2($noTypeWithComment): void {} + +/** + * @param integer $hasTypeNoComment + * @return void + */ +function paramVariation3($hasTypeNoComment): void {} + +/** + * @param integer $hasTypehasComment This parameter has type. + * @return void + */ +function paramVariation4($hasTypehasComment): void {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php new file mode 100644 index 00000000..036bdc62 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php @@ -0,0 +1,208 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff + */ +final class FunctionCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + $errors = [ + 5 => 1, + 10 => 3, + 12 => 2, + 13 => 2, + 14 => 1, + 15 => 1, + 28 => 1, + 43 => 1, + 76 => 1, + 87 => 1, + 103 => 1, + 109 => 1, + 112 => 1, + 122 => 1, + 123 => 3, + 124 => 2, + 125 => 1, + 126 => 1, + 137 => 4, + 138 => 4, + 139 => 4, + 143 => 2, + 155 => 1, + 159 => 1, + 166 => 1, + 173 => 1, + 183 => 1, + 190 => 2, + 193 => 2, + 196 => 1, + 199 => 2, + 210 => 1, + 211 => 1, + 222 => 1, + 223 => 1, + 224 => 1, + 225 => 1, + 226 => 1, + 227 => 1, + 230 => 2, + 232 => 2, + 246 => 1, + 248 => 4, + 261 => 1, + 263 => 1, + 276 => 1, + 277 => 1, + 278 => 1, + 279 => 1, + 280 => 1, + 281 => 1, + 284 => 1, + 286 => 7, + 294 => 1, + 302 => 1, + 312 => 1, + 358 => 1, + 359 => 2, + 372 => 1, + 373 => 1, + 387 => 1, + 407 => 1, + 441 => 1, + 500 => 1, + 526 => 1, + 548 => 1, + 641 => 1, + 669 => 1, + 688 => 1, + 744 => 1, + 748 => 1, + 767 => 1, + 789 => 1, + 792 => 1, + 794 => 1, + 797 => 1, + 828 => 1, + 840 => 1, + 852 => 1, + 864 => 1, + 886 => 1, + 888 => 1, + 890 => 1, + 978 => 1, + 997 => 1, + 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, + 1138 => 1, + 1139 => 1, + 1144 => 1, + 1145 => 1, + 1151 => 1, + ]; + + // Scalar type hints only work from PHP 7 onwards. + if (PHP_VERSION_ID >= 70000) { + $errors[17] = 3; + $errors[128] = 1; + $errors[143] = 3; + $errors[161] = 2; + $errors[201] = 1; + $errors[232] = 7; + $errors[363] = 3; + $errors[377] = 1; + $errors[575] = 2; + $errors[627] = 1; + $errors[1002] = 1; + $errors[1075] = 6; + $errors[1089] = 3; + $errors[1107] = 8; + $errors[1129] = 3; + $errors[1154] = 1; + $errors[1160] = 1; + } 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) { + $errors[627] = 2; + } else { + $errors[992] = 2; + } + + // Mixed type hints only work from PHP 8.0 onwards. + if (PHP_VERSION_ID >= 80000) { + $errors[265] = 1; + $errors[459] = 1; + $errors[893] = 3; + } else { + $errors[1023] = 1; + } + + return $errors; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc new file mode 100644 index 00000000..02487684 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc @@ -0,0 +1,196 @@ + One +// -> One.One +// -> Two + +/* + Here is some inline example code: + -> One + -> One.One + -> Two +*/ + +/** + * Comment should be ignored in PHP 5.4. + * + */ +trait MyTrait { + +} + +$foo = 'foo'; // Var set to foo. + +echo $foo; + +// Comment here. +echo $foo; + +/** + * Comments about the include + */ +include_once($blah); + +// some comment without capital or full stop +echo $foo; // An unrelated comment. + +// An unrelated comment. +echo $foo; // some comment without capital or full stop + +class Foo +{ + // This is fine. + + /** + * Spacing is ignored above. + */ + function bar(){} +} + +if ($foo) { +}//end if +// Another comment here. +$foo++; + +if ($foo) { +}//end if +// another comment here. +$foo++; + +/** + * Comment should be ignored, even though there is an attribute between the docblock and the class declaration. + */ + +#[AttributeA] + +final class MyClass +{ + /** + * Comment should be ignored, even though there is an attribute between the docblock and the function declaration + */ + #[AttributeA] + #[AttributeB] + final public function test() {} +} + +/** + * Comment should be ignored. + * + */ +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 + * token in a file, does *not* throw an error as this would conflict with the common + * "new line required at end of file" rule. + */ + +// For this test line having an empty line below it, is fine. diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed new file mode 100644 index 00000000..949a9ff9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed @@ -0,0 +1,189 @@ + One +// -> One.One +// -> Two +/* + Here is some inline example code: + -> One + -> One.One + -> Two +*/ + +/** + * Comment should be ignored in PHP 5.4. + * + */ +trait MyTrait { + +} + +$foo = 'foo'; // Var set to foo. + +echo $foo; + +// Comment here. +echo $foo; + +/** + * Comments about the include + */ +include_once($blah); + +// some comment without capital or full stop +echo $foo; // An unrelated comment. + +// An unrelated comment. +echo $foo; // some comment without capital or full stop + +class Foo +{ + // This is fine. + + /** + * Spacing is ignored above. + */ + function bar(){} +} + +if ($foo) { +}//end if +// Another comment here. +$foo++; + +if ($foo) { +}//end if +// another comment here. +$foo++; + +/** + * Comment should be ignored, even though there is an attribute between the docblock and the class declaration. + */ + +#[AttributeA] + +final class MyClass +{ + /** + * Comment should be ignored, even though there is an attribute between the docblock and the function declaration + */ + #[AttributeA] + #[AttributeB] + final public function test() {} +} + +/** + * Comment should be ignored. + * + */ +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 + * token in a file, does *not* throw an error as this would conflict with the common + * "new line required at end of file" rule. + */ + +// For this test line having an empty line below it, is fine. diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js new file mode 100644 index 00000000..6b1093e6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js @@ -0,0 +1,129 @@ +// Some content here. +var code = 'hello'; + +// This comment contains # multiple +// hash signs (#). +code = 'hello'; + +/** + * This is the first line of a function comment. + * This is the second line. + */ +function testFunction() +{ + // Callback methods which are added by external objects. + this.callbacks = {}; + +}//end testFunction() + +/** + * This is the first line of a class comment. + * This is the second line. + */ +myClass.prototype = { + + /** + * This is the first line of a method comment. + * This is the second line. + */ + load: function(url, callback) + { + // Some code here. + + } +}; + +// some code goes here! + +/* + A longer comment goes here. + It spans multiple lines!! + Or does it? +*/ + +// 0This is a simple multi-line +// comment! +code = 'hello'; + +//This is not valid. +code = 'hello'; + +// Neither is this! +code = 'hello'; + +// +code = 'hello'; + +/** Neither is this! **/ +code = 'hello'; + +/** + * This is the first line of a function comment. + * This is the second line. + */ +var myFunction = function() { +} + +/** + * This is the first line of a function comment. + * This is the second line. + */ +myFunction = function() { +} + +/** + * This is the first line of a function comment. + * This is the second line. + */ +myClass.myFunction = function() { +} + +dfx.getIframeDocument = function(iframe) +{ + return doc; + +};//end dfx.getIframeDocument() + +mig.Gallery.prototype = { + + init: function(cb) + { + + },//end init() + + imageClicked: function(id) + { + + }//end imageClicked() + +}; + +// Here is some inline example code: +// -> One +// -> One.One +// -> Two + +/* + Here is some inline example code: + -> One + -> One.One + -> Two +*/ + + +var foo = 'foo'; // Var set to foo. + +console.info(foo); + +// Comment here. +console.info(foo); + +//** +* invalid comment +*/ + +// some comment without capital or full stop +console.log(foo); // An unrelated comment. + +// An unrelated comment. +console.log(foo); // some comment without capital or full stop diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed new file mode 100644 index 00000000..20e5041e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed @@ -0,0 +1,125 @@ +// Some content here. +var code = 'hello'; + +// This comment contains # multiple +// hash signs (#). +code = 'hello'; + +/** + * This is the first line of a function comment. + * This is the second line. + */ +function testFunction() +{ + // Callback methods which are added by external objects. + this.callbacks = {}; + +}//end testFunction() + +/** + * This is the first line of a class comment. + * This is the second line. + */ +myClass.prototype = { + + /** + * This is the first line of a method comment. + * This is the second line. + */ + load: function(url, callback) + { + // Some code here. + } +}; + +// some code goes here! +/* + A longer comment goes here. + It spans multiple lines!! + Or does it? +*/ + +// 0This is a simple multi-line +// comment! +code = 'hello'; + +// This is not valid. +code = 'hello'; + +// Neither is this! +code = 'hello'; + +code = 'hello'; + +/** Neither is this! **/ +code = 'hello'; + +/** + * This is the first line of a function comment. + * This is the second line. + */ +var myFunction = function() { +} + +/** + * This is the first line of a function comment. + * This is the second line. + */ +myFunction = function() { +} + +/** + * This is the first line of a function comment. + * This is the second line. + */ +myClass.myFunction = function() { +} + +dfx.getIframeDocument = function(iframe) +{ + return doc; + +};//end dfx.getIframeDocument() + +mig.Gallery.prototype = { + + init: function(cb) + { + + },//end init() + + imageClicked: function(id) + { + + }//end imageClicked() + +}; + +// Here is some inline example code: +// -> One +// -> One.One +// -> Two +/* + Here is some inline example code: + -> One + -> One.One + -> Two +*/ + + +var foo = 'foo'; // Var set to foo. + +console.info(foo); + +// Comment here. +console.info(foo); + +// ** +* invalid comment +*/ + +// some comment without capital or full stop +console.log(foo); // An unrelated comment. + +// An unrelated comment. +console.log(foo); // some comment without capital or full stop diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php new file mode 100644 index 00000000..c559c5ae --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php @@ -0,0 +1,96 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the InlineComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\InlineCommentSniff + */ +final class InlineCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'InlineCommentUnitTest.inc': + $errors = [ + 17 => 1, + 27 => 1, + 28 => 1, + 32 => 2, + 36 => 1, + 44 => 2, + 58 => 1, + 61 => 1, + 64 => 1, + 67 => 1, + 95 => 1, + 96 => 1, + 97 => 3, + 118 => 1, + 126 => 2, + 130 => 2, + 149 => 1, + ]; + + return $errors; + case 'InlineCommentUnitTest.js': + return [ + 31 => 1, + 36 => 2, + 48 => 1, + 51 => 1, + 54 => 1, + 57 => 1, + 102 => 1, + 103 => 1, + 104 => 3, + 118 => 1, + 121 => 1, + 125 => 2, + 129 => 2, + ]; + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc new file mode 100644 index 00000000..d6c4cf6c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc @@ -0,0 +1,1033 @@ + match ($foo) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 + }, +]; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed new file mode 100644 index 00000000..176cfe24 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed @@ -0,0 +1,1033 @@ + match ($foo) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 + },//end match +]; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js new file mode 100644 index 00000000..c0cf2821 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js @@ -0,0 +1,444 @@ +function long_function() +{ + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + }//end if + + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + } + + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + } else { + // Short ELSE + }//end if + + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + } else { + // Short ELSE + } +} + +for (variable=1; variable < 20; variable++) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end for + +for (variable=1; variable < 20; variable++) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + for (val =1; val < 20; val++) { + // Short for. + } + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end while + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + while (something) { + // Short while. + } + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} + +if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } +} //end if + +if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } +} else { + // Short ELSE +} //end if + +for (variable=1; variable < 20; variable++) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} //end for + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} //end while + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end for + +if (true) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} else if (condition) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} else { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end if + +if (something) { + // Line 1 + // Line 2 +} else if (somethingElse) { + // Line 1 + // Line 2 +} else { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} + +switch (something) { + case '1': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '2': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '3': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '4': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '5': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; +} + +// Wrong comment +if (condition) { + condition = true; +}//end foreach diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed new file mode 100644 index 00000000..231b51c5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed @@ -0,0 +1,444 @@ +function long_function() +{ + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + }//end if + + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + }//end if + + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + } else { + // Short ELSE + }//end if + + if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } + } else { + // Short ELSE + }//end if +} + +for (variable=1; variable < 20; variable++) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end for + +for (variable=1; variable < 20; variable++) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + for (val =1; val < 20; val++) { + // Short for. + } + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end for + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end while + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + while (something) { + // Short while. + } + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end while + +if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } +} //end if + +if (longFunction) { + // This is a long + // IF statement + // that does + // not have + // an ELSE + // block on it + variable = 'hello'; + + if (variable === 'hello') { + // This is a short + // IF statement + } + + if (variable === 'hello') { + // This is a short + // IF statement + } else { + // This is a short ELSE + // statement + } +} else { + // Short ELSE +} //end if + +for (variable=1; variable < 20; variable++) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} //end for + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} //end while + +while (variable < 20) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end while + +if (true) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} else if (condition) { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +} else { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end if + +if (something) { + // Line 1 + // Line 2 +} else if (somethingElse) { + // Line 1 + // Line 2 +} else { + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + // Line 6 + // Line 7 + // Line 8 + // Line 9 + // Line 10 + // Line 11 + // Line 12 + // Line 13 + // Line 14 + // Line 15 + // Line 16 + // Line 17 + // Line 18 + // Line 19 + // Line 20 +}//end if + +switch (something) { + case '1': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '2': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '3': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '4': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; + case '5': + // Line 1 + // Line 2 + // Line 3 + // Line 4 + // Line 5 + break; +}//end switch + +// Wrong comment +if (condition) { + condition = true; +}//end if diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php new file mode 100644 index 00000000..e2a0f7b0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php @@ -0,0 +1,107 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LongConditionClosingComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\LongConditionClosingCommentSniff + */ +final class LongConditionClosingCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'LongConditionClosingCommentUnitTest.inc': + return [ + 49 => 1, + 99 => 1, + 146 => 1, + 192 => 1, + 215 => 1, + 238 => 1, + 261 => 1, + 286 => 1, + 309 => 1, + 332 => 1, + 355 => 1, + 378 => 1, + 493 => 1, + 531 => 1, + 536 => 1, + 540 => 1, + 562 => 1, + 601 => 1, + 629 => 1, + 663 => 1, + 765 => 1, + 798 => 1, + 811 => 1, + 897 => 1, + 931 => 1, + 962 => 1, + 985 => 2, + 1008 => 1, + 1032 => 1, + ]; + + case 'LongConditionClosingCommentUnitTest.js': + return [ + 47 => 1, + 97 => 1, + 144 => 1, + 190 => 1, + 213 => 1, + 238 => 1, + 261 => 1, + 284 => 1, + 307 => 1, + 401 => 1, + 439 => 1, + 444 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js new file mode 100644 index 00000000..6de64210 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js @@ -0,0 +1,36 @@ +function test(id, buttons) // cool function +{ + alert('hello'); + alert('hello again'); // And again. + // Valid comment. + +}//end test() + +var good = true; // Indeed. + +mig.Gallery.prototype = { + + init: function(cb) + { + + },//end init() + + imageClicked: function(id) + { + + }//end imageClicked() + +}; + +dfx.getIframeDocument = function(iframe) +{ + + return doc; + +};//end dfx.getIframeDocument() + +// Verify that multi-line control structure with comments and annotations are left alone. +if (condition // comment + && anotherCondition) { + condition = true; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed new file mode 100644 index 00000000..1953760d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed @@ -0,0 +1,39 @@ +function test(id, buttons) +// cool function +{ + alert('hello'); + alert('hello again'); +// And again. + // Valid comment. + +}//end test() + +var good = true; +// Indeed. + +mig.Gallery.prototype = { + + init: function(cb) + { + + },//end init() + + imageClicked: function(id) + { + + }//end imageClicked() + +}; + +dfx.getIframeDocument = function(iframe) +{ + + return doc; + +};//end dfx.getIframeDocument() + +// Verify that multi-line control structure with comments and annotations are left alone. +if (condition // comment + && anotherCondition) { + condition = true; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js new file mode 100644 index 00000000..88d0e7d4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js @@ -0,0 +1,2 @@ +// Comment as first thing in a JS file. +var i = 100; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc new file mode 100644 index 00000000..b8346961 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc @@ -0,0 +1,54 @@ + function($b) { + }, // comment. + 'key' => 'value', // phpcs:ignore Standard.Category.SniffName -- for reasons. + 'key' => 'value', // comment. +]; + +// Verify that multi-line control structure with comments and annotations are left alone. +for ( + $i = 0; /* Start */ + $i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ + $i++ // comment + +) {} + +if ( $condition === true // comment + && $anotherCondition === false +) {} + +$match = match($foo // comment + && $bar +) { + 1 => 1, // comment +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed new file mode 100644 index 00000000..21a4bbe0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed @@ -0,0 +1,59 @@ + function($b) { + }, // comment. + 'key' => 'value', // phpcs:ignore Standard.Category.SniffName -- for reasons. + 'key' => 'value', +// comment. +]; + +// Verify that multi-line control structure with comments and annotations are left alone. +for ( + $i = 0; /* Start */ + $i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ + $i++ // comment + +) {} + +if ( $condition === true // comment + && $anotherCondition === false +) {} + +$match = match($foo // comment + && $bar +) { + 1 => 1, +// comment +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php new file mode 100644 index 00000000..b9751f61 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php @@ -0,0 +1,74 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the PostStatementComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\PostStatementCommentSniff + */ +final class PostStatementCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'PostStatementCommentUnitTest.inc': + return [ + 6 => 1, + 10 => 1, + 18 => 1, + 35 => 1, + 53 => 1, + ]; + + case 'PostStatementCommentUnitTest.1.js': + return [ + 1 => 1, + 4 => 1, + 9 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc new file mode 100644 index 00000000..54ef5d2d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc @@ -0,0 +1,456 @@ + $content) { + echo $content; + } + + return $var1; + + }//end checkVariable() + + + /** + * + * + */ + $emptyVarDoc = ''; + + /** + * Var type checking (int v.s. integer). + * + * @var int + */ + private $_varSimpleTypeCheck; + + + /** + * Var type checking (array(int => string) v.s. array(int => string)). + * + * @var array(int => string) + */ + private $_varArrayTypeCheck; + + + /** + * Boolean @var tag Capitalized + * + * @var Boolean + */ + public $CapBoolTag = true; + + + /** + * Boolean @var tag Capitalized + * + * @var BOOLEAN + */ + public $CapBoolTag2 = true; + + + /** + * Double @var tag Capitalized + * + * @var Double + */ + public $CapDoubleTag = 1; + + + /** + * Double @var tag Capitalized + * + * @var DOUBLE + */ + public $CapDoubleTag2 = 1; + + + /** + * Real @var tag Capitalized + * + * @var Real + */ + public $CapRealTag = 1; + + + /** + * Real @var tag Capitalized + * + * @var REAL + */ + public $CapRealTag2 = 1; + + + /** + * Float @var tag Capitalized + * + * @var Float + */ + public $CapFloatTag = 1; + + + /** + * Float @var tag Capitalized + * + * @var FLOAT + */ + public $CapFloatTag2 = 1; + + + /** + * Int @var tag Capitalized + * + * @var Int + */ + public $CapIntTag = 1; + + + /** + * Int @var tag Capitalized + * + * @var INT + */ + public $CapIntTag2 = 1; + + + /** + * Integer @var tag Capitalized + * + * @var Integer + */ + public $CapIntTag3 = 1; + + + /** + * Integer @var tag Capitalized + * + * @var INTEGER + */ + public $CapIntTag4 = 1; + + + /** + * Array @var tag Capitalized + * + * @var Array + */ + public $CapVarTag = []; + + + /** + * Array @var tag All Caps + * + * @var ARRAY + */ + public $CapVarTag2 = []; + + + /** + * Array @var tag Capitalized + * + * @var Array() + */ + public $CapVarTag3 = []; + + + /** + * Array @var tag All Caps + * + * @var ARRAY() + */ + public $CapVarTag4 = []; + + + /** + * Var type checking (STRING v.s. string). + * + * @var STRING + */ + private $_varCaseTypeCheck; + + + /** + * @var integer + */ + private $_varWithNoShortComment; + + protected $noComment2 = ''; + + + /** + * @var int Var type checking (int v.s. integer) with single-line comment. + */ + private $_varSimpleTypeCheckSingleLine; + + +}//end class + + +/** + * VariableCommentUnitTest2. + * + * Long description goes here. + * + */ +class VariableCommentUnitTest2 +{ + + public $hello; + + /** Comment starts here. + * + * @var string + * + */ + private $_varCaseTypeCheck; + + /** + * 这是一条测试评论. + * + * @var string + */ + public $foo; + +}//end class + + +/* + * Class comment + */ +class Foo +{ + + protected $bar; + + /** + * Short description of the member variable. + * + * @var array + */ + public static array $variableName = array(); + +} + +class Foo +{ + + /** + * Short description of the member variable. + * + * @var array + */ + public array $variableName = array(); + + + // Not "/**" style comment. + // + // @var string + private ?Folder\ClassName $_incorrectCommentStyle = null; + + + var int $noComment = 1; + } + +class HasAttributes +{ + /** + * Short description of the member variable. + * + * @var array + */ + #[ORM\Id]#[ORM\Column("integer")] + private $id; + + /** + * Short description of the member variable. + * + * @var array + */ + #[ORM\GeneratedValue] + #[ORM\Column(ORM\Column::T_INTEGER)] + protected $height; +} + +class ReadOnlyProps +{ + /** + * Short description of the member variable. + * + * @var array + */ + public readonly array $variableName = array(); + + /** + * Short description of the member variable. + * + * @var + */ + readonly protected ?int $variableName = 10; + + private readonly string $variable; +} + +class UnionTypes +{ + /** + * @var array|boolean + */ + private array|bool $variableName = array(); +} + +class IntersectionTypes +{ + /** + * @var \Iterator|\Countable + */ + private \Iterator&\Countable $variableName; +} + +class StandaloneNullTrueFalseTypes +{ + /** + * @var null + */ + public null $variableName = null; + + /** + * @var true + */ + protected true $variableName = true; + + /** + * @var false + */ + private false $variableName = false; +} + +class MoreMissingButSupportedTypes +{ + /** + * @var parent + */ + public parent $variableName; + + /** + * @var self + */ + protected self $variableName; + + /** + * @var SomeClass + */ + private namespace\SomeClass $variableName; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed new file mode 100644 index 00000000..a292b6de --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed @@ -0,0 +1,456 @@ + $content) { + echo $content; + } + + return $var1; + + }//end checkVariable() + + + /** + * + * + */ + $emptyVarDoc = ''; + + /** + * Var type checking (int v.s. integer). + * + * @var integer + */ + private $_varSimpleTypeCheck; + + + /** + * Var type checking (array(int => string) v.s. array(int => string)). + * + * @var array(integer => string) + */ + private $_varArrayTypeCheck; + + + /** + * Boolean @var tag Capitalized + * + * @var boolean + */ + public $CapBoolTag = true; + + + /** + * Boolean @var tag Capitalized + * + * @var boolean + */ + public $CapBoolTag2 = true; + + + /** + * Double @var tag Capitalized + * + * @var float + */ + public $CapDoubleTag = 1; + + + /** + * Double @var tag Capitalized + * + * @var float + */ + public $CapDoubleTag2 = 1; + + + /** + * Real @var tag Capitalized + * + * @var float + */ + public $CapRealTag = 1; + + + /** + * Real @var tag Capitalized + * + * @var float + */ + public $CapRealTag2 = 1; + + + /** + * Float @var tag Capitalized + * + * @var float + */ + public $CapFloatTag = 1; + + + /** + * Float @var tag Capitalized + * + * @var float + */ + public $CapFloatTag2 = 1; + + + /** + * Int @var tag Capitalized + * + * @var integer + */ + public $CapIntTag = 1; + + + /** + * Int @var tag Capitalized + * + * @var integer + */ + public $CapIntTag2 = 1; + + + /** + * Integer @var tag Capitalized + * + * @var integer + */ + public $CapIntTag3 = 1; + + + /** + * Integer @var tag Capitalized + * + * @var integer + */ + public $CapIntTag4 = 1; + + + /** + * Array @var tag Capitalized + * + * @var array + */ + public $CapVarTag = []; + + + /** + * Array @var tag All Caps + * + * @var array + */ + public $CapVarTag2 = []; + + + /** + * Array @var tag Capitalized + * + * @var array + */ + public $CapVarTag3 = []; + + + /** + * Array @var tag All Caps + * + * @var array + */ + public $CapVarTag4 = []; + + + /** + * Var type checking (STRING v.s. string). + * + * @var string + */ + private $_varCaseTypeCheck; + + + /** + * @var integer + */ + private $_varWithNoShortComment; + + protected $noComment2 = ''; + + + /** + * @var integer Var type checking (int v.s. integer) with single-line comment. + */ + private $_varSimpleTypeCheckSingleLine; + + +}//end class + + +/** + * VariableCommentUnitTest2. + * + * Long description goes here. + * + */ +class VariableCommentUnitTest2 +{ + + public $hello; + + /** Comment starts here. + * + * @var string + * + */ + private $_varCaseTypeCheck; + + /** + * 这是一条测试评论. + * + * @var string + */ + public $foo; + +}//end class + + +/* + * Class comment + */ +class Foo +{ + + protected $bar; + + /** + * Short description of the member variable. + * + * @var array + */ + public static array $variableName = array(); + +} + +class Foo +{ + + /** + * Short description of the member variable. + * + * @var array + */ + public array $variableName = array(); + + + // Not "/**" style comment. + // + // @var string + private ?Folder\ClassName $_incorrectCommentStyle = null; + + + var int $noComment = 1; + } + +class HasAttributes +{ + /** + * Short description of the member variable. + * + * @var array + */ + #[ORM\Id]#[ORM\Column("integer")] + private $id; + + /** + * Short description of the member variable. + * + * @var array + */ + #[ORM\GeneratedValue] + #[ORM\Column(ORM\Column::T_INTEGER)] + protected $height; +} + +class ReadOnlyProps +{ + /** + * Short description of the member variable. + * + * @var array + */ + public readonly array $variableName = array(); + + /** + * Short description of the member variable. + * + * @var + */ + readonly protected ?int $variableName = 10; + + private readonly string $variable; +} + +class UnionTypes +{ + /** + * @var array|boolean + */ + private array|bool $variableName = array(); +} + +class IntersectionTypes +{ + /** + * @var \Iterator|\Countable + */ + private \Iterator&\Countable $variableName; +} + +class StandaloneNullTrueFalseTypes +{ + /** + * @var null + */ + public null $variableName = null; + + /** + * @var true + */ + protected true $variableName = true; + + /** + * @var false + */ + private false $variableName = false; +} + +class MoreMissingButSupportedTypes +{ + /** + * @var parent + */ + public parent $variableName; + + /** + * @var self + */ + protected self $variableName; + + /** + * @var SomeClass + */ + private namespace\SomeClass $variableName; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php new file mode 100644 index 00000000..965e3c03 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php @@ -0,0 +1,88 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the VariableComment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\VariableCommentSniff + */ +final class VariableCommentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 21 => 1, + 24 => 1, + 56 => 1, + 64 => 1, + 73 => 1, + 84 => 1, + 130 => 1, + 136 => 1, + 144 => 1, + 152 => 1, + 160 => 1, + 168 => 1, + 176 => 1, + 184 => 1, + 192 => 1, + 200 => 1, + 208 => 1, + 216 => 1, + 224 => 1, + 232 => 1, + 240 => 1, + 248 => 1, + 256 => 1, + 264 => 1, + 272 => 1, + 280 => 1, + 290 => 1, + 294 => 1, + 311 => 1, + 336 => 1, + 361 => 1, + 364 => 1, + 399 => 1, + 403 => 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. + * + * @return array + */ + public function getWarningList() + { + return [93 => 1]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc new file mode 100644 index 00000000..de0235cd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc @@ -0,0 +1,320 @@ + 0); + +do +{ + echo $i; +} while ($i > 0); + +do +{ + echo $i; +} +while ($i > 0); + +do { echo $i; } while ($i > 0); + +do{ + echo $i; +}while($i > 0); + +while ($i < 1) { + echo $i; +} + +while($i < 1){ + echo $i; +} + +while ($i < 1) { echo $i; } + +for ($i = 1; $i < 1; $i++) { + echo $i; +} + +for($i = 1; $i < 1; $i++){ + echo $i; +} + +for ($i = 1; $i < 1; $i++) { echo $i; } + +if ($i == 0) { + $i = 1; +} + +if($i == 0){ + $i = 1; +} + +if ($i == 0) { $i = 1; } + +if ($i == 0) { + $i = 1; +} else { + $i = 0; +} + +if ($i == 0) { + $i = 1; +}else{ + $i = 0; +} + +if ($i == 0) { $i = 1; } else { $i = 0; } + +if ($i == 0) { + $i = 1; +} else if ($i == 2) { + $i = 0; +} + +if ($i == 0) { + $i = 1; +}else if($i == 2){ + $i = 0; +} + +if ($i == 0) { $i = 1; } else if ($i == 2) { $i = 0; } + +if ($i == 0) { // comments are allowed + $i = 1; +} + +if ($i == 0) {// comments are allowed + $i = 1; +} + +if ($i == 0) { /* comments are allowed*/ + $i = 1; +} + +if ($i == 0) +{ // this is ok + $i = 1; +} + +if ($i == 0) /* this is ok */ { +} + +try { + $code = 'this'; +} catch (Exception $e) { + // Caught! +} + +try { $code = 'this'; } catch (Exception $e) { + // Caught! +} + +do { echo $i; +} while ($i > 0); + +if ($i === 0) { + + $i = 1 +} + +if ($a) { + +} +elseif ($b) { +} + +foreach ($items as $item) { + echo $item; +} + +foreach($items as $item){ + echo $item; +} + +if ($a && $b) // && $c) +{ +} + +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; + +try { + // try body +} +catch (FirstExceptionType $e) { + // catch body +} +catch (OtherExceptionType $e) { + // catch body +} + +switch($foo) { + + case 'bar': + break; + +} + +if ($foo) : +endif; + +?> + +getRow()): ?> +

    + + + +
    + +
    + + + + + + + hello + + + + hello + + + + +getRow()) : ?> +

    + + + + + + + + hello + + + + hello + + 1, +}; + +$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 diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc.fixed new file mode 100644 index 00000000..03e6bf2c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc.fixed @@ -0,0 +1,324 @@ + 0); + +do { + echo $i; +} while ($i > 0); + +do { + echo $i; +} while ($i > 0); + +do { +echo $i; } while ($i > 0); + +do { + echo $i; +} while ($i > 0); + +while ($i < 1) { + echo $i; +} + +while ($i < 1) { + echo $i; +} + +while ($i < 1) { +echo $i; } + +for ($i = 1; $i < 1; $i++) { + echo $i; +} + +for ($i = 1; $i < 1; $i++) { + echo $i; +} + +for ($i = 1; $i < 1; $i++) { +echo $i; } + +if ($i == 0) { + $i = 1; +} + +if ($i == 0) { + $i = 1; +} + +if ($i == 0) { +$i = 1; } + +if ($i == 0) { + $i = 1; +} else { + $i = 0; +} + +if ($i == 0) { + $i = 1; +} else { + $i = 0; +} + +if ($i == 0) { +$i = 1; } else { +$i = 0; } + +if ($i == 0) { + $i = 1; +} else if ($i == 2) { + $i = 0; +} + +if ($i == 0) { + $i = 1; +} else if ($i == 2) { + $i = 0; +} + +if ($i == 0) { +$i = 1; } else if ($i == 2) { +$i = 0; } + +if ($i == 0) { // comments are allowed + $i = 1; +} + +if ($i == 0) {// comments are allowed + $i = 1; +} + +if ($i == 0) { /* comments are allowed*/ + $i = 1; +} + +if ($i == 0) { // this is ok + $i = 1; +} + +if ($i == 0) { /* this is ok */ +} + +try { + $code = 'this'; +} catch (Exception $e) { + // Caught! +} + +try { +$code = 'this'; } catch (Exception $e) { + // Caught! +} + +do { +echo $i; +} while ($i > 0); + +if ($i === 0) { + + $i = 1 +} + +if ($a) { + +} elseif ($b) { +} + +foreach ($items as $item) { + echo $item; +} + +foreach ($items as $item) { + echo $item; +} + +if ($a && $b) { // && $c) +} + +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; + +try { + // try body +} catch (FirstExceptionType $e) { + // catch body +} catch (OtherExceptionType $e) { + // catch body +} + +switch ($foo) { + + case 'bar': + break; + +} + +if ($foo) : +endif; + +?> + +getRow()) : ?> +

    + + + +
    + +
    + + + + + + + hello + + + + hello + + + + +getRow()): ?> +

    + + + + + + + + hello + + + + hello + + 1, +}; + +$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 diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.2.inc new file mode 100644 index 00000000..ef99b1a2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.2.inc @@ -0,0 +1,5 @@ + 0); + +do +{ + i = 0; +} while (i > 0); + +do +{ + i = 0; +} +while (i > 0); + +do { i = 0; } while (i > 0); + +do{ + i = 0; +}while(i > 0); + +while (i < 1) { + i = 0; +} + +while(i < 1){ + i = 0; +} + +while (i < 1) { i = 0; } + +for (i = 1; i < 1; i++) { + i = 0; +} + +for(i = 1; i < 1; i++){ + i = 0; +} + +for (i = 1; i < 1; i++) { i = 0; } + +if (i == 0) { + i = 1; +} + +if(i == 0){ + i = 1; +} + +if (i == 0) { i = 1; } + +if (i == 0) { + i = 1; +} else { + i = 0; +} + +if (i == 0) { + i = 1; +}else{ + i = 0; +} + +if (i == 0) { i = 1; } else { i = 0; } + +if (i == 0) { + i = 1; +} else if (i == 2) { + i = 0; +} + +if (i == 0) { + i = 1; +}else if(i == 2){ + i = 0; +} + +if (i == 0) { i = 1; } else if (i == 2) { i = 0; } + +if (i == 0) { // comments are allowed + i = 1; +} + +if (i == 0) {// comments are allowed + i = 1; +} + +if (i == 0) { /* comments are allowed*/ + i = 1; +} + +if (i == 0) +{ // this is ok + i = 1; +} + +if (i == 0) /* this is ok */ { +} + +try { + code = 'this'; +} catch (e) { + // Caught! +} + +try { code = 'this'; } catch (e) { + // Caught! +} + +do { i = 0; +} while (i > 0); + +if (i === 0) { + + i = 1 +} + +if (window.jQuery)(function($) { + $.fn.reset = function() { + return this.each(function() { + try { + this.reset(); + } catch (e) { + } + }); + }; +})(jQuery); + +if ($("#myid").rotationDegrees()=='90') + $('.modal').css({'transform': 'rotate(90deg)'}); + +if ($("#myid").rotationDegrees()=='90') + $foo = {'transform': 'rotate(90deg)'}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed new file mode 100644 index 00000000..e3ed6de7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed @@ -0,0 +1,141 @@ + +i = 0; +do { + i = 0; +} while (i > 0); + +do { + i = 0; +} while (i > 0); + +do { + i = 0; +} while (i > 0); + +do { +i = 0; } while (i > 0); + +do { + i = 0; +} while (i > 0); + +while (i < 1) { + i = 0; +} + +while (i < 1) { + i = 0; +} + +while (i < 1) { +i = 0; } + +for (i = 1; i < 1; i++) { + i = 0; +} + +for (i = 1; i < 1; i++) { + i = 0; +} + +for (i = 1; i < 1; i++) { +i = 0; } + +if (i == 0) { + i = 1; +} + +if (i == 0) { + i = 1; +} + +if (i == 0) { +i = 1; } + +if (i == 0) { + i = 1; +} else { + i = 0; +} + +if (i == 0) { + i = 1; +} else { + i = 0; +} + +if (i == 0) { +i = 1; } else { +i = 0; } + +if (i == 0) { + i = 1; +} else if (i == 2) { + i = 0; +} + +if (i == 0) { + i = 1; +} else if (i == 2) { + i = 0; +} + +if (i == 0) { +i = 1; } else if (i == 2) { +i = 0; } + +if (i == 0) { // comments are allowed + i = 1; +} + +if (i == 0) {// comments are allowed + i = 1; +} + +if (i == 0) { /* comments are allowed*/ + i = 1; +} + +if (i == 0) { // this is ok + i = 1; +} + +if (i == 0) { /* this is ok */ +} + +try { + code = 'this'; +} catch (e) { + // Caught! +} + +try { +code = 'this'; } catch (e) { + // Caught! +} + +do { +i = 0; +} while (i > 0); + +if (i === 0) { + + i = 1 +} + +if (window.jQuery)(function($) { + $.fn.reset = function() { + return this.each(function() { + try { + this.reset(); + } catch (e) { + } + }); + }; +})(jQuery); + +if ($("#myid").rotationDegrees()=='90') + $('.modal').css({'transform': 'rotate(90deg)'}); + +if ($("#myid").rotationDegrees()=='90') + $foo = {'transform': 'rotate(90deg)'}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php new file mode 100644 index 00000000..f6db4b19 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php @@ -0,0 +1,115 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ControlSignature sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff + */ +final class ControlSignatureUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + $errors = [ + 7 => 1, + 12 => 1, + 15 => 1, + 18 => 1, + 20 => 1, + 22 => 2, + 28 => 2, + 32 => 1, + 38 => 2, + 42 => 1, + 48 => 2, + 52 => 1, + 62 => 2, + 66 => 2, + 76 => 4, + 80 => 2, + 94 => 1, + 99 => 1, + 108 => 1, + 112 => 1, + ]; + + switch ($testFile) { + case 'ControlSignatureUnitTest.1.inc': + $errors[122] = 1; + $errors[130] = 2; + $errors[134] = 1; + $errors[150] = 1; + $errors[153] = 1; + $errors[158] = 1; + $errors[165] = 1; + $errors[170] = 2; + $errors[185] = 1; + $errors[190] = 2; + $errors[191] = 2; + $errors[195] = 1; + $errors[227] = 1; + $errors[234] = 1; + $errors[239] = 2; + $errors[243] = 2; + $errors[244] = 2; + $errors[248] = 1; + $errors[259] = 1; + $errors[262] = 1; + $errors[267] = 1; + $errors[269] = 1; + $errors[276] = 1; + $errors[279] = 1; + $errors[283] = 1; + $errors[306] = 3; + $errors[309] = 1; + $errors[315] = 1; + return $errors; + + case 'ControlSignatureUnitTest.js': + return $errors; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc new file mode 100644 index 00000000..91d0a23c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc @@ -0,0 +1,14 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ElseIfDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ElseIfDeclarationSniff + */ +final class ElseIfDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 8 => 1, + 13 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc new file mode 100644 index 00000000..4709923e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc @@ -0,0 +1,36 @@ + $that) { +} + +// Invalid. +foreach ( $something as $blah => $that ) { +} + +foreach ($something as $blah => $that) { +} + +foreach ($something as $blah => $that) { +} + +foreach (${something}AS$blah=>$that) { +} + +// The works. +foreach ( $something aS $blah => $that ) { +} + +// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 1 +foreach ($something as $blah => $that) {} +foreach ( $something as $blah => $that ) {} +foreach ( $something as $blah => $that ) {} +// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 0 + +foreach ([ + 'foo' => 'bar', + 'foobaz' => 'bazzy', + ] as $key => $value) { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed new file mode 100644 index 00000000..b0de6ebc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed @@ -0,0 +1,36 @@ + $that) { +} + +// Invalid. +foreach ($something as $blah => $that) { +} + +foreach ($something as $blah => $that) { +} + +foreach ($something as $blah => $that) { +} + +foreach (${something} as $blah => $that) { +} + +// The works. +foreach ($something as $blah => $that) { +} + +// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 1 +foreach ( $something as $blah => $that ) {} +foreach ( $something as $blah => $that ) {} +foreach ( $something as $blah => $that ) {} +// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 0 + +foreach ([ + 'foo' => 'bar', + 'foobaz' => 'bazzy', + ] as $key => $value) { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php new file mode 100644 index 00000000..5e70703e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php @@ -0,0 +1,61 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ForEachLoopDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff + */ +final class ForEachLoopDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 8 => 2, + 11 => 2, + 14 => 2, + 17 => 5, + 21 => 7, + 26 => 2, + 28 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc new file mode 100644 index 00000000..d10bd980 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc @@ -0,0 +1,126 @@ +i ; }; $i < function() { return $this->max; }; $i++) {} +for ($i = function() { return $this->i; }; $i < function() { return $this->max; } ; $i++) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines true +for ( + $i = 0; + $i < 5; + $i++ +) { + // body here +} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc.fixed new file mode 100644 index 00000000..85214c03 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc.fixed @@ -0,0 +1,92 @@ +i ; }; $i < function() { return $this->max; }; $i++) {} +for ($i = function() { return $this->i; }; $i < function() { return $this->max; }; $i++) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines true +for ( + $i = 0; + $i < 5; + $i++ +) { + // body here +} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js new file mode 100644 index 00000000..94e1f748 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js @@ -0,0 +1,122 @@ +// Valid. +for (var i = 0; i < 10; i++) { +} + +// Invalid. +for ( i = 0; i < 10; i++ ) { +} + +for (i = 0; i < 10; i++) { +} + +for (var i = 0 ; i < 10 ; i++) { +} + +for (i = 0;i < 10;i++) { +} + +// The works. +for ( var i = 0 ; i < 10 ; i++ ) { +} + +this.formats = {}; +dfx.inherits('ContentFormat', 'Widget'); + +for (var widgetid in this.loadedContents) { + if (dfx.isset(widget) === true) { + widget.loadAutoSaveCWidgetStore.setData('activeScreen', null);widget.getContents(this.loadedContents[widgetid], function() {self.widgetLoaded(widget.id);}); + } +} + +for (var i = 0; i < 10;) { +} +for (var i = 0; i < 10; ) { +} + +for (var i = 0; ; i++) { +} +for (var i = 0;; i++) { +} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for (var i = 0; i < 10; i++) {} +for ( var i = 0; i < 10; i++ ) {} +for ( var i = 0; i < 10; i++ ) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +for ( ; i < 10; i++) {} +for (; i < 10; i++) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( ; i < 10; i++ ) {} +for ( ; i < 10; i++ ) {} +for (; i < 10; i++ ) {} + +for ( i = 0; i < 10; ) {} +for ( i = 0; i < 10;) {} +for ( i = 0; i < 10; ) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +// Test handling of comments and inline annotations. +for ( /*phpcs:enable*/ i = 0 /*start*/ ; /*end*/i < 10/*comment*/; i++ /*comment*/ ) {} + +// Test multi-line FOR control structure. +for ( + i = 0; + i < 10; + i++ +) {} + +// Test multi-line FOR control structure with comments and annotations. +for ( + i = 0; /* Start */ + i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ + i++ // comment + +) {} + +// Test fixing each error in one go. Note: lines 84 + 88 contain trailing whitespace on purpose. +for ( + + + i = 0 + + ; + + i < 10 + + ; + + i++ + + +) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( + + + + i = 0 + + ; + + i < 10 + + ; + + i++ + + +) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +// Test with semicolon not belonging to for. +for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {} +for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);} ; i++) {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js.fixed new file mode 100644 index 00000000..fbf9b609 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js.fixed @@ -0,0 +1,88 @@ +// Valid. +for (var i = 0; i < 10; i++) { +} + +// Invalid. +for (i = 0; i < 10; i++) { +} + +for (i = 0; i < 10; i++) { +} + +for (var i = 0; i < 10; i++) { +} + +for (i = 0; i < 10; i++) { +} + +// The works. +for (var i = 0; i < 10; i++) { +} + +this.formats = {}; +dfx.inherits('ContentFormat', 'Widget'); + +for (var widgetid in this.loadedContents) { + if (dfx.isset(widget) === true) { + widget.loadAutoSaveCWidgetStore.setData('activeScreen', null);widget.getContents(this.loadedContents[widgetid], function() {self.widgetLoaded(widget.id);}); + } +} + +for (var i = 0; i < 10;) { +} +for (var i = 0; i < 10;) { +} + +for (var i = 0;; i++) { +} +for (var i = 0;; i++) { +} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( var i = 0; i < 10; i++ ) {} +for ( var i = 0; i < 10; i++ ) {} +for ( var i = 0; i < 10; i++ ) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +for (; i < 10; i++) {} +for (; i < 10; i++) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( ; i < 10; i++ ) {} +for ( ; i < 10; i++ ) {} +for ( ; i < 10; i++ ) {} + +for ( i = 0; i < 10; ) {} +for ( i = 0; i < 10; ) {} +for ( i = 0; i < 10; ) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +// Test handling of comments and inline annotations. +for (/*phpcs:enable*/ i = 0 /*start*/; /*end*/i < 10/*comment*/; i++ /*comment*/) {} + +// Test multi-line FOR control structure. +for (i = 0; i < 10; i++) {} + +// Test multi-line FOR control structure with comments and annotations. +for (i = 0; /* Start */ + i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ + i++ // comment + +) {} + +// Test fixing each error in one go. Note: lines 84 + 88 contain trailing whitespace on purpose. +for (i = 0; i < 10; i++) {} + +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 +for ( i = 0; i < 10; i++ ) {} +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 +// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 + +// Test with semicolon not belonging to for. +for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {} +for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);}; i++) {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.inc new file mode 100644 index 00000000..a327cced --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.inc @@ -0,0 +1,6 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ForLoopDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff + */ +final class ForLoopDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ForLoopDeclarationUnitTest.1.inc': + return [ + 8 => 2, + 11 => 2, + 14 => 2, + 17 => 2, + 21 => 6, + 27 => 1, + 30 => 1, + 37 => 2, + 39 => 2, + 43 => 1, + 49 => 1, + 50 => 1, + 53 => 1, + 54 => 1, + 59 => 4, + 62 => 1, + 63 => 1, + 64 => 1, + 66 => 1, + 69 => 1, + 74 => 1, + 77 => 1, + 82 => 2, + 86 => 2, + 91 => 1, + 95 => 1, + 101 => 2, + 105 => 2, + 110 => 1, + 116 => 2, + ]; + + case 'ForLoopDeclarationUnitTest.1.js': + return [ + 6 => 2, + 9 => 2, + 12 => 2, + 15 => 2, + 19 => 6, + 33 => 1, + 36 => 1, + 43 => 2, + 45 => 2, + 49 => 1, + 55 => 1, + 56 => 1, + 59 => 1, + 60 => 1, + 65 => 4, + 68 => 1, + 69 => 1, + 70 => 1, + 72 => 1, + 75 => 1, + 80 => 1, + 83 => 1, + 88 => 2, + 92 => 2, + 97 => 1, + 101 => 1, + 107 => 2, + 111 => 2, + 116 => 1, + 122 => 2, + ]; + + default: + return []; + }//end switch + + }//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($testFile='') + { + switch ($testFile) { + case 'ForLoopDeclarationUnitTest.2.inc': + case 'ForLoopDeclarationUnitTest.3.inc': + return [6 => 1]; + + case 'ForLoopDeclarationUnitTest.2.js': + return [2 => 1]; + + default: + return []; + }//end switch + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc new file mode 100644 index 00000000..f54ed8af --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc @@ -0,0 +1,48 @@ +id.'"', + '"'.$this->stepInfo['title'].'"', + '"'.((isset($this->stepInfo['description']) === TRUE) ? $this->stepInfo['description'] : '').'"', + '"'.(isset($this->stepInfo['description']) === TRUE ? $this->stepInfo['description'] : '').'"', + '"'.$this->stepInfo['title'].'"', + ); + +echo (TRUE)?'Hello':'Bye'; + +$array = array( + 'one' => ($test == 1) ? true : false, + 'two' => (($test == 1) ? true : false), + 'three' => (($test == 1) ? true : false) +); +$var = ($test == 1) ? true : false; +$var = (myFunc(1,2,3) == 1) ? true : false; + +set('config', function() { + $foo = ($bar === "on") ? "1" : "2"; +}); + +$config = function() { + $foo = ($bar === "on") ? "1" : "2"; +}; + +rand(0, 1) ? 'ěščřžýáí' : NULL; + +$c = ($argv[1]) ? : ""; +$filepath = realpath($argv[1]) ?: $argv[1]; +$c = ($argv[1]) ? /* comment */ : ""; +$c = ($argv[1]) ? +: ""; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed new file mode 100644 index 00000000..f7aa1d67 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed @@ -0,0 +1,48 @@ +id.'"', + '"'.$this->stepInfo['title'].'"', + '"'.((isset($this->stepInfo['description']) === TRUE) ? $this->stepInfo['description'] : '').'"', + '"'.(isset($this->stepInfo['description']) === TRUE ? $this->stepInfo['description'] : '').'"', + '"'.$this->stepInfo['title'].'"', + ); + +echo (TRUE) ? 'Hello' : 'Bye'; + +$array = array( + 'one' => ($test == 1) ? true : false, + 'two' => (($test == 1) ? true : false), + 'three' => (($test == 1) ? true : false) +); +$var = ($test == 1) ? true : false; +$var = (myFunc(1,2,3) == 1) ? true : false; + +set('config', function() { + $foo = ($bar === "on") ? "1" : "2"; +}); + +$config = function() { + $foo = ($bar === "on") ? "1" : "2"; +}; + +rand(0, 1) ? 'ěščřžýáí' : NULL; + +$c = ($argv[1]) ?: ""; +$filepath = realpath($argv[1]) ?: $argv[1]; +$c = ($argv[1]) ? /* comment */ : ""; +$c = ($argv[1]) ? +: ""; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php new file mode 100644 index 00000000..dc4738e0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php @@ -0,0 +1,80 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the InlineIfDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\InlineIfDeclarationSniff + */ +final class InlineIfDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Get a list of CLI values to set before the file is tested. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getCliValues($testFile) + { + return ['--encoding=utf-8']; + + }//end getCliValues() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 1, + 5 => 1, + 6 => 1, + 7 => 1, + 8 => 1, + 9 => 1, + 10 => 1, + 13 => 1, + 20 => 1, + 24 => 4, + 44 => 1, + 47 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc new file mode 100644 index 00000000..1acf3eac --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc @@ -0,0 +1,24 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LowercaseDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff + */ +final class LowercaseDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 5 => 1, + 7 => 1, + 9 => 1, + 10 => 1, + 12 => 1, + 14 => 1, + 15 => 1, + 16 => 1, + 20 => 1, + 21 => 1, + 24 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc new file mode 100644 index 00000000..cf397607 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc @@ -0,0 +1,333 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SwitchDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\SwitchDeclarationSniff + */ +final class SwitchDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'SwitchDeclarationUnitTest.inc': + return [ + 27 => 1, + 29 => 1, + 34 => 1, + 36 => 1, + 44 => 1, + 48 => 1, + 52 => 1, + 54 => 1, + 55 => 1, + 56 => 1, + 58 => 1, + 59 => 1, + 61 => 1, + 62 => 1, + 79 => 1, + 85 => 2, + 88 => 2, + 89 => 2, + 92 => 1, + 95 => 3, + 99 => 1, + 116 => 1, + 122 => 1, + 127 => 2, + 134 => 2, + 135 => 1, + 138 => 1, + 143 => 1, + 144 => 1, + 147 => 1, + 165 => 1, + 172 => 1, + 176 => 2, + 180 => 1, + 192 => 2, + 196 => 1, + 223 => 1, + 266 => 1, + 282 => 1, + 284 => 2, + 322 => 1, + 323 => 1, + 327 => 1, + 329 => 1, + 330 => 1, + ]; + + case 'SwitchDeclarationUnitTest.js': + return [ + 27 => 1, + 29 => 1, + 34 => 1, + 36 => 1, + 44 => 1, + 48 => 1, + 52 => 1, + 54 => 1, + 55 => 1, + 56 => 1, + 58 => 1, + 59 => 1, + 61 => 1, + 62 => 1, + 79 => 1, + 85 => 2, + 88 => 2, + 89 => 2, + 92 => 1, + 95 => 3, + 99 => 1, + 116 => 1, + 122 => 1, + 127 => 2, + 134 => 2, + 135 => 1, + 138 => 1, + 143 => 1, + 144 => 1, + 147 => 1, + 165 => 1, + 172 => 1, + 176 => 2, + 180 => 1, + 192 => 2, + 196 => 1, + 223 => 1, + 266 => 1, + 282 => 1, + 284 => 2, + ]; + + default: + return []; + }//end switch + + }//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($testFile='') + { + if ($testFile === 'SwitchDeclarationUnitTest.js') { + return [273 => 1]; + } + + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js new file mode 100644 index 00000000..797e0eea --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js @@ -0,0 +1,2 @@ +alert('hi') +alert('hi'); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php new file mode 100644 index 00000000..c4b14dc2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php @@ -0,0 +1,74 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Debug; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Config; + +/** + * Unit test class for the JSLint sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JSLintSniff + */ +final class JSLintUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Should this test be skipped for some reason. + * + * @return bool + */ + protected function shouldSkipTest() + { + $jslPath = Config::getExecutablePath('jslint'); + if ($jslPath === null) { + return true; + } + + return false; + + }//end shouldSkipTest() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [ + 1 => 2, + 2 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js new file mode 100644 index 00000000..797e0eea --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js @@ -0,0 +1,2 @@ +alert('hi') +alert('hi'); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php new file mode 100644 index 00000000..96a68d7c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php @@ -0,0 +1,71 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Debug; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Config; + +/** + * Unit test class for the JavaScriptLint sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JavaScriptLintSniff + */ +final class JavaScriptLintUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Should this test be skipped for some reason. + * + * @return bool + */ + protected function shouldSkipTest() + { + $jslPath = Config::getExecutablePath('jsl'); + if ($jslPath === null) { + return true; + } + + return false; + + }//end shouldSkipTest() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [2 => 1]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc new file mode 100644 index 00000000..3279edb5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc @@ -0,0 +1,3 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc new file mode 100644 index 00000000..05be6330 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc @@ -0,0 +1,3 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc new file mode 100644 index 00000000..ec1b0239 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc @@ -0,0 +1,3 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc new file mode 100644 index 00000000..ed045646 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc @@ -0,0 +1,3 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.5.inc new file mode 100644 index 00000000..d777aff6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.5.inc @@ -0,0 +1,3 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php new file mode 100644 index 00000000..06592254 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php @@ -0,0 +1,60 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FileExtension sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Files\FileExtensionSniff + */ +final class FileExtensionUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'FileExtensionUnitTest.1.inc': + return [1 => 1]; + default: + return []; + } + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc new file mode 100644 index 00000000..8e628963 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc @@ -0,0 +1,203 @@ +words[$wordPos-1]) || $this->words[$wordPos-1] !== ' ') { +} else if ($this->tokens[$pos + 1] === "\n") { +} + +if ($pos === count($this->tokens) - 1) { + $file = '...'.substr($file, (($padding * -1) + 3)); +} + +if (substr($basename, -5) !== 'Sniff') { + $i = ($this->_tokens[$i]['parenthesis_closer'] + 1); +} + +$pos = $this->_getShortCommentEndPos(); +if ($pos === -1) { + $stackPtr = ($tokens[$next][$to] - 1); + $stackPtr = ($tokens[$next][$pattern[$i]['to']] + 1); + $var = (($var1 + $var2) + $var3 + $var4) +} + +$commentStart = ($phpcsFile->findPrevious(T_DOC_COMMENT, ($commentEnd - 1), null, true) + 1); +$commentEnd = ($this->_phpcsFile->findNext(T_DOC_COMMENT, ($commentStart + 1), null, true) - 1); +$expected .= '...'.substr($tokens[($stackPtr - 2)]['content'], -5).$tokens[$stackPtr]['content']; + +if (($tokens[$nextToken - 1]['code']) !== T_WHITESPACE) { + $errorPos = ($params[(count($params) - 1)]->getLine() + $commentStart); +} + +while (($nextSpace = $phpcsFile->findNext(T_WHITESPACE, $nextSpace + 1, $nextBreak)) !== false) { +} + +foreach ($attributes as $id => &$attribute) { +} + +class MyClass +{ + + + public function &myFunction(array &$one, array &$two) + { + + }//end myFunction() + + +}//end class + +if ($index < -1) $index = 0; +if ($index < - 1) $index = 0; + +$three = ceil($one / $two); +$three = ceil(($one / $two) / $four); +$three = ceil($one / ($two / $four)); + +$four = -0.25; + +$three = ceil($one[1] / $two); + +switch ($number % 10) { + case -1: + $suffix = 'st'; + break; +} + +$expectedPermission = array( + 'granted' => 4, + 'denied' => 1, + 'cascade' => TRUE, + 'blockergranted' => 2, + 'blockerdenied' => - 3, + 'effective' => TRUE, + ); + +$value = (int) isset($blah) + 2; +$value = (int) isset($blah) + (int) isset($foo) + (int) isset($bar); + +doSomething(getValue($var, 2)) - $y; + +$codeFiles = array($global => $codeFiles[$global]) + $codeFiles; + +$var = array(-1); +$var = [-1]; +$var = [0, -1, -2]; + +$cntPages = ceil(count($items) / self::ON_PAGE); + +error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); +error_reporting(E_ALL & ~E_NOTICE | ~E_WARNING); +$results = $stmt->fetchAll(\PDO::FETCH_ASSOC | \PDO::FETCH_GROUP | \PDO::FETCH_UNIQUE); +$di = new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS); +foo(1 + 2 + 3); + +if (empty($foo[-1]) === true) { + $foo[-1] = 'foo'; +} + +try { +} catch (AException | BException $e) { +} + +$var = $foo['blah'] + []; + +$a = 2 * ${x} - ${minus}; + +$foo = $bar ?? $baz ?? ''; + +$foo = $myString{-1}; + +$value = (binary) $blah + b"binary $foo"; + +$test = (1 * static::TEST); +$test = myfunc(1 * static::TEST); + +$errorPos = $params[$x]?->getLine() + $commentStart; + +$foo = $this->gmail ?? $this->gmail = new Google_Service_Gmail($this->google); + +exit -1; + +$expr = match ($number - 10) { + -1 => 0, +}; + +$expr = match ($number % 10) { + 1 => 2 * $num, +}; + +$expr = match (true) { + $num * 100 > 500 => 'expression in key', +}; + +// PHP 8.0 named parameters. +if ($pos === count(value: $this->tokens) - 1) { + $file = '...'.substr(string: $file, offset: $padding * -1 + 3); +} + +match ($a) { + 'a' => -1, + 'b', 'c', 'd' => -2, + default => -3, +}; + +$cntPages = ceil(count($items) / parent::ON_PAGE); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed new file mode 100644 index 00000000..9fa0216c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed @@ -0,0 +1,203 @@ +words[($wordPos-1)]) || $this->words[($wordPos-1)] !== ' ') { +} else if ($this->tokens[($pos + 1)] === "\n") { +} + +if ($pos === (count($this->tokens) - 1)) { + $file = '...'.substr($file, (($padding * -1) + 3)); +} + +if (substr($basename, -5) !== 'Sniff') { + $i = ($this->_tokens[$i]['parenthesis_closer'] + 1); +} + +$pos = $this->_getShortCommentEndPos(); +if ($pos === -1) { + $stackPtr = ($tokens[$next][$to] - 1); + $stackPtr = ($tokens[$next][$pattern[$i]['to']] + 1); + $var = (($var1 + $var2) + $var3 + $var4) +} + +$commentStart = ($phpcsFile->findPrevious(T_DOC_COMMENT, ($commentEnd - 1), null, true) + 1); +$commentEnd = ($this->_phpcsFile->findNext(T_DOC_COMMENT, ($commentStart + 1), null, true) - 1); +$expected .= '...'.substr($tokens[($stackPtr - 2)]['content'], -5).$tokens[$stackPtr]['content']; + +if (($tokens[($nextToken - 1)]['code']) !== T_WHITESPACE) { + $errorPos = ($params[(count($params) - 1)]->getLine() + $commentStart); +} + +while (($nextSpace = $phpcsFile->findNext(T_WHITESPACE, ($nextSpace + 1), $nextBreak)) !== false) { +} + +foreach ($attributes as $id => &$attribute) { +} + +class MyClass +{ + + + public function &myFunction(array &$one, array &$two) + { + + }//end myFunction() + + +}//end class + +if ($index < -1) $index = 0; +if ($index < - 1) $index = 0; + +$three = ceil($one / $two); +$three = ceil(($one / $two) / $four); +$three = ceil($one / ($two / $four)); + +$four = -0.25; + +$three = ceil($one[1] / $two); + +switch ($number % 10) { + case -1: + $suffix = 'st'; + break; +} + +$expectedPermission = array( + 'granted' => 4, + 'denied' => 1, + 'cascade' => TRUE, + 'blockergranted' => 2, + 'blockerdenied' => - 3, + 'effective' => TRUE, + ); + +$value = ((int) isset($blah) + 2); +$value = ((int) isset($blah) + (int) isset($foo) + (int) isset($bar)); + +(doSomething(getValue($var, 2)) - $y); + +$codeFiles = (array($global => $codeFiles[$global]) + $codeFiles); + +$var = array(-1); +$var = [-1]; +$var = [0, -1, -2]; + +$cntPages = ceil(count($items) / self::ON_PAGE); + +error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); +error_reporting(E_ALL & ~E_NOTICE | ~E_WARNING); +$results = $stmt->fetchAll(\PDO::FETCH_ASSOC | \PDO::FETCH_GROUP | \PDO::FETCH_UNIQUE); +$di = new \RecursiveDirectoryIterator($path, (\RecursiveDirectoryIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS)); +foo(1 + 2 + 3); + +if (empty($foo[-1]) === true) { + $foo[-1] = 'foo'; +} + +try { +} catch (AException | BException $e) { +} + +$var = ($foo['blah'] + []); + +$a = 2 * ${x} - ${minus}; + +$foo = ($bar ?? $baz ?? ''); + +$foo = $myString{-1}; + +$value = ((binary) $blah + b"binary $foo"); + +$test = (1 * static::TEST); +$test = myfunc(1 * static::TEST); + +$errorPos = ($params[$x]?->getLine() + $commentStart); + +$foo = ($this->gmail ?? $this->gmail = new Google_Service_Gmail($this->google)); + +exit -1; + +$expr = match ($number - 10) { + -1 => 0, +}; + +$expr = match ($number % 10) { + 1 => (2 * $num), +}; + +$expr = match (true) { + ($num * 100) > 500 => 'expression in key', +}; + +// PHP 8.0 named parameters. +if ($pos === (count(value: $this->tokens) - 1)) { + $file = '...'.substr(string: $file, offset: ($padding * -1 + 3)); +} + +match ($a) { + 'a' => -1, + 'b', 'c', 'd' => -2, + default => -3, +}; + +$cntPages = ceil(count($items) / parent::ON_PAGE); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js new file mode 100644 index 00000000..92ed8038 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js @@ -0,0 +1,118 @@ +value = (one + two); +value = one + two; + +value = (one - two); +value = one - two; + +value = (one * two); +value = one * two; + +value = (one / two); +value = one / two; + +value = (one % two); +value = one % two; + +value = (one + two + three); +value = one + two + three; +value = (one + (two + three)); +value = one + (two + three); + +value++; +value--; +value = -1; +value = - 1; + +value = (1 + 2); +value = 1 + 2; + +value = (1 - 2); +value = 1 - 2; + +value = (1 * 2); +value = 1 * 2; + +value = (1 / 2); +value = 1 / 2; + +value = (1 % 2); +value = 1 % 2; + +value = (1 + 2 + 3); +value = 1 + 2 + 3; +value = (1 + (2 + 3)); +value = 1 + (2 + 3); + +value = one + 2 + 3 - (four * five * (6 + 7)) + nine + 2; +value = myFunction(tokens[stackPtr - 1]); + +for (i = 1 + 2; i < 4 + 5; i++) { +} + +function myFunction() +{ + value = (one + 1) + (two + 2) + (myFunction() + 2); + value = myFunction() + 2; + value = (myFunction(mvar) + myFunction2(mvar)); + return -1; +} + +params['mode'] = id.replace(/WidgetType/, ''); + +if (index < -1) index = 0; +if (index < - 1) index = 0; + +var classN = prvId.replace(/\./g, '-'); + +three = myFunction(one / two); +three = myFunction((one / two) / four); +three = myFunction(one / (two / four)); + +four = -0.25; + +id = id.replace(/row\/:/gi, ''); +return /MSIE/.test(navigator.userAgent); + +var re = new RegExp(/<\/?(\w+)((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/gim); + +var options = { + minVal: -1, + maxVal: -1 +}; + +stepWidth = Math.round(this.width / 5); + +date.setMonth(d[2] - 1); + +switch (number % 10) { + case -1: + suffix = 'st'; + break; +} + +var pathSplit = ipt.value.split(/\/|\\/); + +if (pairs[i].search(/=/) !== -1) { +} + +if (urlValue.search(/[a-zA-z]+:\/\//) !== 0) { +} + +if (urlValue.search(/[a-zA-z]+:\/\/*/) !== 0) { +} + +if (!value || /^\s*$/.test(value)) { + return true; +} + +parseInt(dfx.attr(selectors[idx], 'elemOffsetTop'), 10) - scrollCoords.y + 'px' + +if (something === true + ^ somethingElse === true +) { + return false; +} + +if (true === /^\d*\.?\d*$/.test(input)) return true; + +if ( ! /^(?:a|select)$/i.test( element.tagName ) ) return true; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed new file mode 100644 index 00000000..04e35d97 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed @@ -0,0 +1,118 @@ +value = (one + two); +value = one + two; + +value = (one - two); +value = (one - two); + +value = (one * two); +value = (one * two); + +value = (one / two); +value = (one / two); + +value = (one % two); +value = (one % two); + +value = (one + two + three); +value = one + two + three; +value = (one + (two + three)); +value = one + (two + three); + +value++; +value--; +value = -1; +value = - 1; + +value = (1 + 2); +value = 1 + 2; + +value = (1 - 2); +value = (1 - 2); + +value = (1 * 2); +value = (1 * 2); + +value = (1 / 2); +value = (1 / 2); + +value = (1 % 2); +value = (1 % 2); + +value = (1 + 2 + 3); +value = 1 + 2 + 3; +value = (1 + (2 + 3)); +value = 1 + (2 + 3); + +value = one + 2 + (3 - (four * five * (6 + 7))) + nine + 2; +value = myFunction(tokens[(stackPtr - 1)]); + +for (i = 1 + 2; i < 4 + 5; i++) { +} + +function myFunction() +{ + value = (one + 1) + (two + 2) + (myFunction() + 2); + value = myFunction() + 2; + value = (myFunction(mvar) + myFunction2(mvar)); + return -1; +} + +params['mode'] = id.replace(/WidgetType/, ''); + +if (index < -1) index = 0; +if (index < - 1) index = 0; + +var classN = prvId.replace(/\./g, '-'); + +three = myFunction(one / two); +three = myFunction((one / two) / four); +three = myFunction(one / (two / four)); + +four = -0.25; + +id = id.replace(/row\/:/gi, ''); +return /MSIE/.test(navigator.userAgent); + +var re = new RegExp(/<\/?(\w+)((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/gim); + +var options = { + minVal: -1, + maxVal: -1 +}; + +stepWidth = Math.round(this.width / 5); + +date.setMonth(d[2] - 1); + +switch (number % 10) { + case -1: + suffix = 'st'; + break; +} + +var pathSplit = ipt.value.split(/\/|\\/); + +if (pairs[i].search(/=/) !== -1) { +} + +if (urlValue.search(/[a-zA-z]+:\/\//) !== 0) { +} + +if (urlValue.search(/[a-zA-z]+:\/\/*/) !== 0) { +} + +if (!value || /^\s*$/.test(value)) { + return true; +} + +(parseInt(dfx.attr(selectors[idx], 'elemOffsetTop'), 10) - scrollCoords.y) + 'px' + +if (something === true + ^ somethingElse === true +) { + return false; +} + +if (true === /^\d*\.?\d*$/.test(input)) return true; + +if ( ! /^(?:a|select)$/i.test( element.tagName ) ) return true; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php new file mode 100644 index 00000000..0da13624 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php @@ -0,0 +1,121 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Formatting; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the OperatorBracket sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting\OperatorBracketSniff + */ +final class OperatorBracketUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'OperatorBracketUnitTest.inc': + return [ + 3 => 1, + 6 => 1, + 9 => 1, + 12 => 1, + 15 => 1, + 18 => 2, + 20 => 1, + 25 => 1, + 28 => 1, + 31 => 1, + 34 => 1, + 37 => 1, + 40 => 1, + 43 => 2, + 45 => 1, + 47 => 5, + 48 => 1, + 50 => 2, + 55 => 2, + 56 => 1, + 63 => 2, + 64 => 1, + 67 => 1, + 86 => 1, + 90 => 1, + 109 => 1, + 130 => 1, + 134 => 1, + 135 => 2, + 137 => 1, + 139 => 1, + 150 => 1, + 161 => 1, + 163 => 2, + 165 => 2, + 169 => 1, + 174 => 1, + 176 => 1, + 185 => 1, + 189 => 1, + 193 => 1, + 194 => 2, + ]; + + case 'OperatorBracketUnitTest.js': + return [ + 5 => 1, + 8 => 1, + 11 => 1, + 14 => 1, + 24 => 1, + 30 => 1, + 33 => 1, + 36 => 1, + 39 => 1, + 46 => 1, + 47 => 1, + 63 => 1, + 108 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc new file mode 100644 index 00000000..33564e2e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc @@ -0,0 +1,111 @@ + $a($b); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..68fb1c1c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed @@ -0,0 +1,111 @@ + $a($b); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php new file mode 100644 index 00000000..62ccfef2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php @@ -0,0 +1,91 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionDeclarationArgumentSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff + */ +final class FunctionDeclarationArgumentSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 5 => 2, + 7 => 2, + 8 => 2, + 9 => 2, + 11 => 2, + 13 => 7, + 14 => 2, + 15 => 2, + 16 => 4, + 18 => 2, + 35 => 2, + 36 => 2, + 44 => 2, + 45 => 1, + 46 => 1, + 51 => 2, + 53 => 2, + 55 => 1, + 56 => 1, + 58 => 1, + 73 => 7, + 76 => 1, + 77 => 1, + 81 => 1, + 89 => 2, + 92 => 1, + 93 => 1, + 94 => 1, + 95 => 1, + 99 => 11, + 100 => 2, + 101 => 2, + 102 => 2, + 106 => 1, + 107 => 2, + 111 => 3, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc new file mode 100644 index 00000000..0cde1138 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc @@ -0,0 +1,75 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff + */ +final class FunctionDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 55 => 1, + 68 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc new file mode 100644 index 00000000..27102d05 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc @@ -0,0 +1,6 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php new file mode 100644 index 00000000..f29f8090 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionDuplicateArgument sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDuplicateArgumentSniff + */ +final class FunctionDuplicateArgumentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 4 => 2, + 5 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc new file mode 100644 index 00000000..b7b7f205 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc @@ -0,0 +1,17 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php new file mode 100644 index 00000000..1a077915 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php @@ -0,0 +1,53 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the GlobalFunction sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff + */ +final class GlobalFunctionUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [2 => 1]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc new file mode 100644 index 00000000..4e868336 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc @@ -0,0 +1,28 @@ + $x; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed new file mode 100644 index 00000000..48c99777 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed @@ -0,0 +1,28 @@ + $x; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php new file mode 100644 index 00000000..c91c3008 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php @@ -0,0 +1,63 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LowercaseFunctionKeywords sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff + */ +final class LowercaseFunctionKeywordsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 16 => 1, + 17 => 1, + 20 => 1, + 21 => 1, + 22 => 1, + 23 => 1, + 24 => 3, + 25 => 4, + 28 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc new file mode 100644 index 00000000..811c56ec --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc @@ -0,0 +1,304 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the MultiLineFunctionDeclaration sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff + */ +final class MultiLineFunctionDeclarationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + if ($testFile === 'MultiLineFunctionDeclarationUnitTest.inc') { + $errors = [ + 2 => 1, + 3 => 1, + 4 => 2, + 5 => 1, + 7 => 1, + 11 => 1, + 12 => 1, + 13 => 1, + 16 => 1, + 36 => 1, + 43 => 2, + 48 => 1, + 81 => 1, + 82 => 2, + 88 => 1, + 102 => 2, + 137 => 1, + 141 => 2, + 142 => 1, + 158 => 1, + 160 => 1, + 182 => 2, + 186 => 2, + 190 => 2, + 194 => 1, + 195 => 1, + 233 => 1, + 234 => 1, + 235 => 1, + 236 => 1, + 244 => 1, + 245 => 1, + 246 => 1, + 247 => 1, + 248 => 1, + 249 => 1, + 250 => 1, + 251 => 1, + 252 => 1, + 253 => 1, + 254 => 1, + ]; + } else { + $errors = [ + 2 => 1, + 3 => 1, + 4 => 2, + 5 => 1, + 7 => 1, + 11 => 1, + 12 => 1, + 13 => 1, + 16 => 1, + 26 => 1, + 36 => 1, + 43 => 2, + 48 => 1, + 65 => 1, + ]; + }//end if + + return $errors; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc new file mode 100644 index 00000000..aacef347 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc @@ -0,0 +1,27 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php new file mode 100644 index 00000000..7b9692e7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php @@ -0,0 +1,64 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\NamingConventions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ValidFunctionName sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidFunctionNameSniff + */ +final class ValidFunctionNameUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 1, + 5 => 1, + 6 => 1, + 7 => 1, + 8 => 1, + 9 => 1, + 11 => 1, + 12 => 1, + 13 => 1, + 14 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc new file mode 100644 index 00000000..87c3bdf2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc @@ -0,0 +1,157 @@ +varName2; +echo $this->var_name2; +echo $this->varname2; +echo $this->_varName2; +echo $object->varName2; +echo $object->var_name2; +echo $object_name->varname2; +echo $object_name->_varName2; + +echo $this->myFunction($one, $two); +echo $object->myFunction($one_two); + +$error = "format is \$GLOBALS['$varName']"; + +echo $_SESSION['var_name']; +echo $_FILES['var_name']; +echo $_ENV['var_name']; +echo $_COOKIE['var_name']; + +$XML = 'hello'; +$myXML = 'hello'; +$XMLParser = 'hello'; +$xmlParser = 'hello'; + +echo "{$_SERVER['HOSTNAME']} $var_name"; + +// Need to be the last thing in this test file. +$obj->$classVar = $prefix.'-'.$type; + +class foo +{ + const bar = <<varName; +echo $obj?->var_name; +echo $obj?->varname; +echo $obj?->_varName; + +enum SomeEnum +{ + public function foo($foo, $_foo, $foo_bar) { + $bar = 1; + $_bar = 2; + $bar_foo = 3; + } +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php new file mode 100644 index 00000000..d8d8695c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php @@ -0,0 +1,93 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\NamingConventions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ValidVariableName sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidVariableNameSniff + */ +final class ValidVariableNameUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + $errors = [ + 3 => 1, + 5 => 1, + 10 => 1, + 12 => 1, + 15 => 1, + 17 => 1, + 20 => 1, + 22 => 1, + 25 => 1, + 27 => 1, + 31 => 1, + 33 => 1, + 36 => 1, + 37 => 1, + 39 => 1, + 42 => 1, + 44 => 1, + 53 => 1, + 58 => 1, + 62 => 1, + 63 => 1, + 64 => 1, + 67 => 1, + 81 => 1, + 106 => 1, + 107 => 2, + 108 => 1, + 111 => 1, + 112 => 1, + 113 => 1, + 114 => 1, + 123 => 1, + 138 => 1, + 141 => 1, + 146 => 1, + 152 => 1, + 155 => 1, + ]; + + return $errors; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js new file mode 100644 index 00000000..1c61fbfb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js @@ -0,0 +1,37 @@ +function test(id) +{ + + this.id = id; + +} +/**/ +test.prototype = { + init: function() + { + var x = {}; + x.name = 'test'; + x['phone'] = 123124324; + var t = ['test', 'this'].join(''); + var y = ['test'].join(''); + var a = x[0]; + var z = x[x['name']]; + var p = x[x.name]; + } + +}; + +function test() { + this.errors['step_' + step] = errors; + this.errors['test'] = x; + this.errors['test' + 10] = x; + this.errors['test' + y] = x; + this.errors['test' + 'blah'] = x; + this.errors[y] = x; + this.errors[y + z] = x; + this.permissions['workflow.cancel'] = x; +} + +if (child.prototype) { + above.prototype['constructor'] = parent; + child.prototype['super'] = new above(); +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php new file mode 100644 index 00000000..36880a9a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php @@ -0,0 +1,64 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowObjectStringIndex sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\DisallowObjectStringIndexSniff + */ +final class DisallowObjectStringIndexUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + if ($testFile !== 'DisallowObjectStringIndexUnitTest.js') { + return []; + } + + return [ + 13 => 1, + 17 => 1, + 25 => 1, + 35 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc new file mode 100644 index 00000000..b6df38c9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc @@ -0,0 +1,49 @@ + new MyClass()); +$object->myFunction(new MyClass()); + +throw new MyException($msg); + +function foo() { return new MyClass(); } + +$doodad = $x ? new Foo : new Bar; + +function returnFn() { + $fn = fn($x) => new MyClass(); +} + +function returnMatch() { + $match = match($x) { + 0 => new MyClass() + } +} + +// Issue 3333. +$time2 ??= new \DateTime(); +$time3 = $time1 ?? new \DateTime(); +$time3 = $time1 ?? $time2 ?? new \DateTime(); + +function_call($time1 ?? new \DateTime()); +$return = function_call($time1 ?? new \DateTime()); // False negative depending on interpretation of the sniff. + +function returnViaTernary() { + return ($y == false ) ? ($x === true ? new Foo : new Bar) : new FooBar; +} + +function nonAssignmentTernary() { + if (($x ? new Foo() : new Bar) instanceof FooBar) { + // Do something. + } +} + +// Test for tokenizer issue #3789. +$a = $b !== null + ? match ($c) { + default => 5, + } + : new Foo; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php new file mode 100644 index 00000000..bfd4bef2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php @@ -0,0 +1,58 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ObjectInstantiation sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectInstantiationSniff + */ +final class ObjectInstantiationUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 5 => 1, + 8 => 1, + 31 => 1, + 39 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js new file mode 100644 index 00000000..28bf85ad --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js @@ -0,0 +1,47 @@ +this.request({ action: 'getTypeFormatContents', }); + +addTypeFormatButton.addClickEvent(function() { + self.addNewTypeFormat(); +}); + +var x = {}; + +var y = { + VarOne : 'If you ask me, thats if you ask', + VarTwo : ['Alonzo played you', 'for a fool', 'esse'], + VarThree: function(arg) { + console.info(1); + } +}; + +var z = { + VarOne : 'If you ask me, thats if you ask', + VarTwo : ['Alonzo played you', 'for a fool', 'esse'], + VarThree: function(arg) { + console.info(1); + }, +}; + +var x = function() { + console.info(2); +}; + +AssetListingEditWidgetType.prototype = { + init: function(data, assetid, editables) + { + } +}; + +AssetListingEditWidgetType.prototype = { + init: function(data, assetid, editables) + { + }, +}; + +AssetListingEditWidgetType.prototype = { + // phpcs: disable Standard.Cat.SniffName -- testing annotation between closing brace and comma + init: function(data, assetid, editables) + { + }, + // phpcs:enable +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed new file mode 100644 index 00000000..df548c74 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed @@ -0,0 +1,47 @@ +this.request({ action: 'getTypeFormatContents' }); + +addTypeFormatButton.addClickEvent(function() { + self.addNewTypeFormat(); +}); + +var x = {}; + +var y = { + VarOne : 'If you ask me, thats if you ask', + VarTwo : ['Alonzo played you', 'for a fool', 'esse'], + VarThree: function(arg) { + console.info(1); + } +}; + +var z = { + VarOne : 'If you ask me, thats if you ask', + VarTwo : ['Alonzo played you', 'for a fool', 'esse'], + VarThree: function(arg) { + console.info(1); + } +}; + +var x = function() { + console.info(2); +}; + +AssetListingEditWidgetType.prototype = { + init: function(data, assetid, editables) + { + } +}; + +AssetListingEditWidgetType.prototype = { + init: function(data, assetid, editables) + { + } +}; + +AssetListingEditWidgetType.prototype = { + // phpcs: disable Standard.Cat.SniffName -- testing annotation between closing brace and comma + init: function(data, assetid, editables) + { + } + // phpcs:enable +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php new file mode 100644 index 00000000..0ac826f3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php @@ -0,0 +1,58 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ObjectMemberComma sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectMemberCommaSniff + */ +final class ObjectMemberCommaUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 1 => 1, + 22 => 1, + 38 => 1, + 45 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc new file mode 100644 index 00000000..8522438d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc @@ -0,0 +1,138 @@ + + 0)) { +} + +myFunction($var1 === true ? "" : "foobar"); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js new file mode 100644 index 00000000..048223ba --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js @@ -0,0 +1,71 @@ +if (value === TRUE) { +} else if (value === FALSE) { +} + +if (value == TRUE) { +} else if (value == FALSE) { +} + +if (value) { +} else if (!value) { +} + +if (value.isSomething === TRUE) { +} else if (myFunction(value) === FALSE) { +} + +if (value.isSomething == TRUE) { +} else if (myFunction(value) == FALSE) { +} + +if (value.isSomething) { +} else if (!myFunction(value)) { +} + +if (value === TRUE || other === FALSE) { +} + +if (value == TRUE || other == FALSE) { +} + +if (value || !other) { +} + +if (one === TRUE || two === TRUE || three === FALSE || four === TRUE) { +} + +if (one || two || !three || four) { +} + +while (one == true) { +} + +while (one === true) { +} + +do { +} while (one == true); + +do { +} while (one === true); + +for (one = 10; one != 0; one--) { +} + +for (one = 10; one !== 0; one--) { +} + +for (type in types) { +} + +variable = (variable2 === true) ? variable1 : "foobar"; + +variable = (variable2 == true) ? variable1 : "foobar"; + +variable = (variable2 === false) ? variable1 : "foobar"; + +variable = (variable2 == false) ? variable1 : "foobar"; + +variable = (variable2 === 0) ? variable1 : "foobar"; + +variable = (variable2 == 0) ? variable1 : "foobar"; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php new file mode 100644 index 00000000..1189725b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php @@ -0,0 +1,105 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ComparisonOperatorUsage sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ComparisonOperatorUsageSniff + */ +final class ComparisonOperatorUsageUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ComparisonOperatorUsageUnitTest.inc': + return [ + 6 => 1, + 7 => 1, + 10 => 1, + 11 => 1, + 18 => 1, + 19 => 1, + 22 => 1, + 23 => 1, + 29 => 2, + 32 => 2, + 38 => 4, + 47 => 2, + 69 => 1, + 72 => 1, + 75 => 1, + 78 => 1, + 80 => 1, + 82 => 1, + 83 => 1, + 89 => 1, + 92 => 1, + 100 => 1, + 106 => 1, + 112 => 1, + 123 => 1, + 127 => 1, + 131 => 1, + 135 => 1, + ]; + + case 'ComparisonOperatorUsageUnitTest.js': + return [ + 5 => 1, + 6 => 1, + 17 => 1, + 18 => 1, + 28 => 2, + 40 => 1, + 47 => 1, + 52 => 1, + 63 => 1, + 67 => 1, + 71 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc new file mode 100644 index 00000000..26669597 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc @@ -0,0 +1,56 @@ +i++).$id; +$id = $obj?->i++.$id; +$id = $obj?->i++*10; + +$var+=1; +$var-=1; + +$var=$var+1; +$var=$var-1; + +$var /*comment*/ +=1; +$var + // phpcs:ignore Something + -=1; + +$var += /*comment*/ 1; +$var = ( $var /*comment*/ - 1 /*comment*/); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php new file mode 100644 index 00000000..e27e196b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php @@ -0,0 +1,73 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the IncrementDecrementUsage sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\IncrementDecrementUsageSniff + */ +final class IncrementDecrementUsageUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 6 => 1, + 12 => 1, + 16 => 1, + 25 => 1, + 26 => 1, + 27 => 1, + 29 => 1, + 31 => 1, + 41 => 1, + 42 => 1, + 44 => 1, + 45 => 1, + 47 => 1, + 48 => 1, + 50 => 1, + 53 => 1, + 55 => 1, + 56 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc new file mode 100644 index 00000000..328ccc5d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc @@ -0,0 +1,28 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php new file mode 100644 index 00000000..d7ce889e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ValidLogicalOperators sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ValidLogicalOperatorsSniff + */ +final class ValidLogicalOperatorsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 5 => 1, + 11 => 1, + 17 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css new file mode 100644 index 00000000..94cc8f27 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css @@ -0,0 +1,23 @@ +/* CSS Document */ + +body { +font-family: Arial, Helvetica, sans-serif; +margin : 40px 0 0 0; +padding : 0; +/*background: #8FB7DB url(login_glow_bg.jpg) no-repeat 30% 0;*/ +background: #8FB7DB url(diag_lines_bg.gif) top left; +} + +#login-container { + margin-left: -225px; + margin-top: -161px; + position:absolute; + top :50%; + /*left :50%;*/ + width:450px; +} + +#cacheConfig-dayLabel, #cacheConfig-hourLabel, #cacheConfig-minuteLabel { + float: left; + padding-right: 8px; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc new file mode 100644 index 00000000..121240a9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc @@ -0,0 +1,158 @@ + + * + * Title + * Contents + * + * ... + * + * + * + * + * @return void + */ + +/* + [^\'"] +*/ + +// http://www.google.com + +// Base config function. + +// function () + +// T_STRING is not a function call or not listed in _getFunctionListWithCallableArgument(). + + // function myFunction( $param ) + // { + // do_something(); + // }//end myFunction() + // + +/* +function myFunction( $param ) +{ + // phpcs:disable Standard.Category.Sniff -- for reasons. + if ( preg_match( '`[abc]`', $param ) > 0 ) { + do_something(); + } + // phpcs:enable Standard.Category.Sniff -- for reasons. + +}//end myFunction() +*/ + + /* + * function myFunction( $param ) // @phpcs:ignore Standard.Category.Sniff -- for reasons. + * { + * + * }//end myFunction() + */ + + /* + * function myFunction( $param ) + * { + * // phpcs:disable Standard.Category.Sniff -- for reasons. + * if ( preg_match( '`[abc]`', $param ) > 0 ) { + * do_something(); + * } + * // phpcs:enable Standard.Category.Sniff -- for reasons. + * + * }//end myFunction() + */ + + // function myFunction( $param ) + // { + // phpcs:disable Standard.Category.Sniff -- for reasons. + // do_something(); + // phpcs:enable Standard.Category.Sniff -- for reasons. + // }//end myFunction() + // + +echo 'something'; // @codeCoverageIgnore +echo 'something'; // @codeCoverageIgnoreStart +echo 'something'; // @SuppressWarnings(PHPMD.UnusedLocalVariable) + +// Ok! + +/* Go! */ + +// ISO-639-3 + + // But override with a different text if any. + /* + $id = intval( str_replace( 'hook_name', '', $order_method['method_id'] ) ); + if ( ! empty( $id ) ) { + $info_text = get_post_meta( $location_id, 'meta_name' ); + + if ( ! empty( $info_text ) ) { + $text = $info_text; + } + + } + */ + // function() { $a = $b; }; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php new file mode 100644 index 00000000..99d8f01a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php @@ -0,0 +1,80 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the CommentedOutCode sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\CommentedOutCodeSniff + */ +final class CommentedOutCodeUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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($testFile='') + { + switch ($testFile) { + case 'CommentedOutCodeUnitTest.inc': + return [ + 6 => 1, + 8 => 1, + 15 => 1, + 19 => 1, + 87 => 1, + 91 => 1, + 97 => 1, + 109 => 1, + 116 => 1, + 128 => 1, + 147 => 1, + 158 => 1, + ]; + + case 'CommentedOutCodeUnitTest.css': + return [ + 7 => 1, + 16 => 1, + ]; + + default: + return []; + }//end switch + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc new file mode 100644 index 00000000..4701c23e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php new file mode 100644 index 00000000..8c3afa4d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php @@ -0,0 +1,58 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowBooleanStatement sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowBooleanStatementSniff + */ +final class DisallowBooleanStatementUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 8 => 1, + 13 => 1, + 15 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc new file mode 100644 index 00000000..a07047b1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc @@ -0,0 +1,83 @@ +nextSibling; $node; $node = $node->nextSibling) { + if ($node->nodeType !== XML_ELEMENT_NODE) { + continue; + } + + for ($node = $fields->nextSibling; $node; $node = $node->nextSibling) { + if ($node->nodeType !== XML_ELEMENT_NODE) { + continue; + } + } +} + +$a = $b ? $c : $d; +$a = $b === true ? $c : $d; + +$this->_args = $this->_getArgs(($_SERVER['argv'] ?? [])); +$args = ($_SERVER['argv'] ?? []); + +$a = [ + 'a' => ($foo) ? $foo : $bar, +]; + +$a = [ + 'a' => ($foo) ? fn() => return 1 : fn() => return 2, +]; + +$var = $foo->something(!$var); +$var = $foo?->something(!$var); + +$callback = function ($value) { + if ($value > 10) { + return false; + } +}; + +function issue3616() { + $food = 'cake'; + + $returnValue = match (true) { + $food === 'apple' => 'This food is an apple', + $food === 'bar' => 'This food is a bar', + $food === 'cake' => 'This food is a cake', + }; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php new file mode 100644 index 00000000..9c0f7e33 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php @@ -0,0 +1,64 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowComparisonAssignment sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowComparisonAssignmentSniff + */ +final class DisallowComparisonAssignmentUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 5 => 1, + 6 => 1, + 7 => 1, + 8 => 1, + 10 => 1, + 52 => 1, + 53 => 1, + 58 => 1, + 62 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc new file mode 100644 index 00000000..f57e0710 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc @@ -0,0 +1,18 @@ + $x; + +$b = fn ($b) => $b ? true : false; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js new file mode 100644 index 00000000..56387c06 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js @@ -0,0 +1,2 @@ +x = (x?a:x); +id = id.replace(/row\/:/gi, ''); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php new file mode 100644 index 00000000..14f79c87 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php @@ -0,0 +1,67 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowObEndFlush sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowInlineIfSniff + */ +final class DisallowInlineIfUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'DisallowInlineIfUnitTest.inc': + return [ + 8 => 1, + 18 => 1, + ]; + + case 'DisallowInlineIfUnitTest.js': + return [1 => 1]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.1.inc new file mode 100644 index 00000000..b4d63fca --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.1.inc @@ -0,0 +1,136 @@ +fetch(PDO::FETCH_NUM)) { + $result[$row[0]] = array(); + $result[$row[0]][] = $current; + + self::$_inTransaction = TRUE; + parent::$_inTransaction = TRUE; + static::$_inTransaction = TRUE; + $$varName = $varValue; + } + +}//end getVar() + +class myClass +{ + private static $_dbh = NULL; + public $dbh = NULL; + protected $dbh = NULL; + var $dbh = NULL; // Old PHP4 compatible code. +} + +A::$a = 'b'; +\A::$a = 'c'; +\A\B\C::$d = 'd'; +B\C::$d = 'e'; + +@$a = 1; + +$a = []; +foreach ($a as $b) + $c = 'd'; + +$var = $var2; +list ($a, $b) = explode(',', $c); +$var1 ? $var2 = 0 : $var2 = 1; + +$obj->$classVar = $prefix.'-'.$type; + +$closureWithDefaultParamter = function(array $testArray=array()) {}; +?> + + + 10, + false => 0 + }, +]; + +$arrow_function = fn ($a = null) => $a; + +function ($html) { + $regEx = '/regexp/'; + + return preg_replace_callback($regEx, function ($matches) { + [$all] = $matches; + return $all; + }, $html); +}; + + +function () { + $a = false; + + some_label: + + $b = getB(); +}; + +?> + + +// Issue PHPCSStandards/PHP_CodeSniffer#537. + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.2.inc new file mode 100644 index 00000000..3befd507 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.2.inc @@ -0,0 +1,7 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowMultipleAssignments sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowMultipleAssignmentsSniff + */ +final class DisallowMultipleAssignmentsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the test file to process. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'DisallowMultipleAssignmentsUnitTest.1.inc': + return [ + 4 => 1, + 5 => 2, + 7 => 1, + 9 => 1, + 12 => 1, + 14 => 1, + 15 => 1, + 79 => 1, + 85 => 1, + ]; + + default: + return []; + } + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc new file mode 100644 index 00000000..56802e37 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc @@ -0,0 +1,58 @@ +children); $i++) { +} + + + +for ($i = 0; $i < sizeof($array); $i++) { +} + +$num = sizeof($array); + +while ($i < sizeof($array)) { +} + +do { +} while ($i < sizeof($array)); + +for ($i = 0; $i < sizeof($this->children); $i++) { +} + + + + +for ($i = 0; $i < strlen($string); $i++) { +} + +$num = strlen($string); + +while ($i < strlen($string)) { +} + +do { +} while ($i < strlen($string)); + +for ($i = 0; $i < strlen($this->string); $i++) { +} + +for ($i = sizeof($array); $i > 0; $i--) { +} + +do { + echo $a->count; + $a->count--; +} while($a->count); + +for ($i = 0; $i < $a->count; $i++) {} +for ($i = 0; $i < $a?->count; $i++) {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js new file mode 100644 index 00000000..8f7f7b94 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js @@ -0,0 +1,13 @@ +for (var i = 0; i < permissions.length; i++) { + // Code here. +} + +var permLen = permissions.length; +for (var length = 0; i < permLen; i++) { + // Code here. +} + +var myArray = [1, 2, 3, 4]; +for (var i = myArray.length; i >= 0; i--) { + var x = i; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php new file mode 100644 index 00000000..3f923ad6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php @@ -0,0 +1,77 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DisallowSizeFunctionsInLoops sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowSizeFunctionsInLoopsSniff + */ +final class DisallowSizeFunctionsInLoopsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'DisallowSizeFunctionsInLoopsUnitTest.inc': + return [ + 2 => 1, + 7 => 1, + 11 => 1, + 13 => 1, + 18 => 1, + 23 => 1, + 27 => 1, + 29 => 1, + 35 => 1, + 40 => 1, + 44 => 1, + 46 => 1, + ]; + + case 'DisallowSizeFunctionsInLoopsUnitTest.js': + return [1 => 1]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc new file mode 100644 index 00000000..3c875d09 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc @@ -0,0 +1,7 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DiscouragedFunctions sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DiscouragedFunctionsSniff + */ +final class DiscouragedFunctionsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [ + 2 => 1, + 3 => 1, + 4 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc new file mode 100644 index 00000000..f28c5598 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc @@ -0,0 +1,271 @@ + + + +<?php echo $title ?> + + + + + hello + + + + + + + + + + + + + + + + + + + + + +section as $section) { + ?> + + + + + + section as $section) { + ?> +
    + + + + + + + + +?> + + + + + + + + + + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    + + + + +
    + + + + + + + + + + + + + + + + +<?php echo $title; ?> + + + + + hello + + + + + + + + + + + + + + + + + + + +section as $section) { + ?> +
    + + + + + section as $section) { + ?> +
    + + + + + + + + + + + + +?> + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.15.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.15.inc new file mode 100644 index 00000000..d8f05127 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.15.inc @@ -0,0 +1,9 @@ + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.16.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.16.inc new file mode 100644 index 00000000..754c241b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.16.inc @@ -0,0 +1,8 @@ + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.17.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.17.inc new file mode 100644 index 00000000..71de17bf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.17.inc @@ -0,0 +1,8 @@ + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc new file mode 100644 index 00000000..3d61d485 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc @@ -0,0 +1,15 @@ + + +
    + + +
    +

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc.fixed new file mode 100644 index 00000000..8c906d40 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc.fixed @@ -0,0 +1,13 @@ + + +
    + +
    +

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc new file mode 100644 index 00000000..34db64d6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc @@ -0,0 +1,17 @@ + + +
    + + +
    +

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc.fixed new file mode 100644 index 00000000..b1738db5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc.fixed @@ -0,0 +1,15 @@ + + +
    + +
    +

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc new file mode 100644 index 00000000..755fd355 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc @@ -0,0 +1,7 @@ + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed new file mode 100644 index 00000000..e9073da9 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed @@ -0,0 +1,7 @@ + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc new file mode 100644 index 00000000..28cdbdaf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc @@ -0,0 +1,15 @@ + + +
    + + +
    +

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc.fixed new file mode 100644 index 00000000..fcc24a27 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc.fixed @@ -0,0 +1,16 @@ + + +
    + + +
    +

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc new file mode 100644 index 00000000..1da67a2e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc @@ -0,0 +1,15 @@ + + +
    + + +
    +

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc.fixed new file mode 100644 index 00000000..d7487b50 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc.fixed @@ -0,0 +1,16 @@ + + +
    + + +
    +

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc new file mode 100644 index 00000000..5196a3b4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc @@ -0,0 +1,30 @@ +
    Inline HTML with indent to demonstrate the bug in the indent calculation.
    + + + + + + + + +Inline HTML with indent to demonstrate the bug in the indent calculation.
    + + + + + + + + + + + +
    + + +
    +

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc new file mode 100644 index 00000000..2d608490 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc @@ -0,0 +1,123 @@ + + + +<?= $title ?> + + + + + hello + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + +// Safeguard fixing when there is no whitespace between the close tag and the contents. + + + + + + + + + +<?= $title; ?> + + + + + hello + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// Safeguard fixing when there is no whitespace between the close tag and the contents. + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed new file mode 100644 index 00000000..b7985cc5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed @@ -0,0 +1,7 @@ + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc new file mode 100644 index 00000000..f4d8d8a0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc @@ -0,0 +1,48 @@ + + + + + + + +
    + + + + + + + +
    + + + + + + + + + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the EmbeddedPhp sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EmbeddedPhpSniff + */ +final class EmbeddedPhpUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'EmbeddedPhpUnitTest.1.inc': + return [ + 7 => 1, + 12 => 1, + 18 => 1, + 19 => 2, + 20 => 1, + 21 => 1, + 22 => 3, + 24 => 1, + 26 => 1, + 29 => 1, + 30 => 1, + 31 => 1, + 34 => 1, + 36 => 1, + 40 => 1, + 41 => 1, + 44 => 1, + 45 => 1, + 49 => 1, + 59 => 1, + 63 => 1, + 93 => 1, + 94 => 2, + 100 => 1, + 102 => 1, + 112 => 1, + 113 => 1, + 116 => 1, + 117 => 1, + 120 => 1, + 121 => 1, + 128 => 1, + 129 => 1, + 132 => 1, + 134 => 1, + 136 => 1, + 138 => 1, + 142 => 1, + 145 => 1, + 151 => 1, + 158 => 1, + 165 => 1, + 169 => 1, + 175 => 1, + 176 => 2, + 178 => 1, + 179 => 1, + 180 => 2, + 181 => 1, + 189 => 1, + 212 => 1, + 214 => 2, + 219 => 1, + 223 => 1, + 225 => 1, + 226 => 1, + 227 => 2, + 228 => 1, + 235 => 1, + 241 => 1, + 248 => 1, + 253 => 1, + 258 => 1, + 263 => 1, + 264 => 1, + ]; + + case 'EmbeddedPhpUnitTest.2.inc': + case 'EmbeddedPhpUnitTest.4.inc': + return [ + 5 => 2, + 6 => 2, + 7 => 2, + ]; + + case 'EmbeddedPhpUnitTest.3.inc': + return [ + 10 => 1, + 15 => 1, + 21 => 1, + 22 => 2, + 23 => 1, + 24 => 1, + 25 => 3, + 28 => 1, + 29 => 1, + 30 => 1, + 33 => 1, + 35 => 1, + 39 => 1, + 40 => 1, + 43 => 1, + 44 => 1, + 48 => 1, + 53 => 1, + 55 => 1, + 61 => 1, + 62 => 1, + 65 => 2, + 66 => 2, + 69 => 1, + 70 => 1, + 75 => 1, + 82 => 1, + 89 => 1, + 93 => 1, + 98 => 2, + 99 => 1, + 103 => 2, + 105 => 1, + 111 => 1, + 112 => 2, + 114 => 1, + 115 => 1, + 116 => 2, + 117 => 1, + ]; + + case 'EmbeddedPhpUnitTest.5.inc': + return [ + 16 => 1, + 18 => 1, + 25 => 1, + 26 => 1, + 29 => 1, + 31 => 1, + 33 => 1, + 35 => 1, + 39 => 1, + 42 => 1, + ]; + + case 'EmbeddedPhpUnitTest.12.inc': + case 'EmbeddedPhpUnitTest.13.inc': + return [ + 10 => 1, + 12 => 1, + ]; + + case 'EmbeddedPhpUnitTest.18.inc': + return [11 => 1]; + + case 'EmbeddedPhpUnitTest.19.inc': + return [13 => 1]; + + case 'EmbeddedPhpUnitTest.20.inc': + case 'EmbeddedPhpUnitTest.21.inc': + return [12 => 2]; + + case 'EmbeddedPhpUnitTest.22.inc': + return [ + 14 => 1, + 22 => 2, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc new file mode 100644 index 00000000..ee4c73e5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc @@ -0,0 +1,5 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php new file mode 100644 index 00000000..db0af7f0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php @@ -0,0 +1,56 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the Eval sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EvalSniff + */ +final class EvalUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [ + 2 => 1, + 4 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc new file mode 100644 index 00000000..4b2a2109 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc @@ -0,0 +1,13 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php new file mode 100644 index 00000000..c0c79baa --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php @@ -0,0 +1,56 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the GlobalKeyword sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\GlobalKeywordSniff + */ +final class GlobalKeywordUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 8 => 1, + 9 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc new file mode 100644 index 00000000..d1863c07 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc @@ -0,0 +1,12 @@ +foo. +Now, I am printing some {$foo->bar[1]}. +This should not print a capital 'A': \x41 +EOT; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc new file mode 100644 index 00000000..eb0062f0 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc @@ -0,0 +1,17 @@ + 'a' +<<<<<<< HEAD + 'b' => 'b' +======= + 'c' => 'c' +>>>>>>> master + ); + } diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php new file mode 100644 index 00000000..5d78d893 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php @@ -0,0 +1,64 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the Heredoc sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\HeredocSniff + */ +final class HeredocUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'HeredocUnitTest.1.inc': + return [ + 2 => 1, + 8 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc new file mode 100644 index 00000000..d16c7f2e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc @@ -0,0 +1,87 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the InnerFunctions sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\InnerFunctionsSniff + */ +final class InnerFunctionsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 5 => 1, + 46 => 1, + 55 => 1, + 83 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc new file mode 100644 index 00000000..702b13de --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc @@ -0,0 +1,50 @@ +Count(); +$count = $object::Count(); +$count = $object->count(); +$count = $object::count(); +class MyClass { + public function Count() {} +} + +function &Sort() { + +} + +$connection = new Db\Adapter\Pdo\Mysql($config); + +namespace Strtolower\Silly; + +use function strToUpper as somethingElse; +use function MyClass\WordsToUpper as UCWords; // Intentional redeclared function error. +use function strToUpper\NotTheFunction; + +class ArrayUnique {} + +$sillyComments = strToLower /*comment*/ ($string); + +$callToGlobalFunction = \STR_REPEAT($a, 2); +$callToGlobalFunction = \ /*comment*/ str_Repeat($a, 2); + +$callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT($a, 2); +$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative. + +$filePath = new \File($path); + +$count = $object?->Count(); + +class AttributesShouldBeIgnored +{ + #[Putenv('FOO', 'foo')] + public function foo(): void + {} +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed new file mode 100644 index 00000000..281425c5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed @@ -0,0 +1,50 @@ +Count(); +$count = $object::Count(); +$count = $object->count(); +$count = $object::count(); +class MyClass { + public function Count() {} +} + +function &Sort() { + +} + +$connection = new Db\Adapter\Pdo\Mysql($config); + +namespace Strtolower\Silly; + +use function strtoupper as somethingElse; +use function MyClass\WordsToUpper as UCWords; // Intentional redeclared function error. +use function strToUpper\NotTheFunction; + +class ArrayUnique {} + +$sillyComments = strtolower /*comment*/ ($string); + +$callToGlobalFunction = \str_repeat($a, 2); +$callToGlobalFunction = \ /*comment*/ str_repeat($a, 2); + +$callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT($a, 2); +$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative. + +$filePath = new \File($path); + +$count = $object?->Count(); + +class AttributesShouldBeIgnored +{ + #[Putenv('FOO', 'foo')] + public function foo(): void + {} +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php new file mode 100644 index 00000000..5feb363f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php @@ -0,0 +1,60 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LowercasePHPFunctions sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\LowercasePHPFunctionsSniff + */ +final class LowercasePHPFunctionsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 4 => 1, + 27 => 1, + 33 => 1, + 35 => 1, + 36 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc new file mode 100644 index 00000000..4b1d1ca6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc @@ -0,0 +1,420 @@ +{$action . 'JsonAction'}(); +} + +switch (true) { + case 1: + return foo( + function () { + $foo = $bar; // when this is removed it works ok + return false; // from here on it reports unreachable + } + ); +} + +for($i=0,$j=50; $i<100; $i++) { + while($j--) { + if($j==17) { + goto end; + echo 'unreachable'; + } + } +} + +switch ($var) { + case '1': + goto end; + echo 'hi'; + + case '2': + case '3': + if ($something === true) { + goto end; + echo 'hi'; + } + break; + default: + goto end; + + if ($something === true) { + goto end; + echo 'hi'; + } +} + +end: +echo 'j hit 17'; + +// Issue 2512. +class TestAlternativeControlStructures { + + public function alternative_switch_in_function( $var ) { + + switch ( $var ) : + case 'value1': + do_something(); + break; + + default: + case 'value2': + do_something_else(); + break; + endswitch; + } + + public function various_alternative_control_structures() { + $_while = 1; + + for ( $a = 0; $a++ < 1; ) : + foreach ( [ 1 ] as $b ) : + while ( $_while-- ) : + if ( 1 ) : + switch ( 1 ) : + default: + echo 'yay, we made it!'; + break; + endswitch; + endif; + endwhile; + endforeach; + endfor; + } +} + +$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. +}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc new file mode 100644 index 00000000..9b7a22bc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
    non-executable
    + + + + + + + + +
    non-executable
    + + + + + + + + +
    non-executable
    + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.4.inc new file mode 100644 index 00000000..189466b4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.4.inc @@ -0,0 +1,6 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the NonExecutableCode sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\NonExecutableCodeSniff + */ +final class NonExecutableCodeUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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($testFile='') + { + switch ($testFile) { + case 'NonExecutableCodeUnitTest.1.inc': + return [ + 5 => 1, + 11 => 1, + 17 => 1, + 18 => 1, + 19 => 2, + 28 => 1, + 32 => 1, + 33 => 2, + 34 => 2, + 42 => 1, + 45 => 1, + 54 => 1, + 58 => 1, + 73 => 1, + 83 => 1, + 95 => 1, + 105 => 1, + 123 => 1, + 147 => 1, + 150 => 1, + 153 => 1, + 166 => 1, + 180 => 1, + 232 => 1, + 240 => 1, + 246 => 1, + 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, + ]; + + case 'NonExecutableCodeUnitTest.2.inc': + return [ + 7 => 1, + 8 => 1, + 9 => 1, + 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, + ]; + default: + return []; + }//end switch + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc new file mode 100644 index 00000000..6df12cca --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc @@ -0,0 +1,72 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the MemberVarScope sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MemberVarScopeSniff + */ +final class MemberVarScopeUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 7 => 1, + 25 => 1, + 29 => 1, + 33 => 1, + 39 => 1, + 41 => 1, + 66 => 2, + 67 => 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. + * + * @return array + */ + public function getWarningList() + { + // Warning from getMemberProperties() about parse error. + return [71 => 1]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc new file mode 100644 index 00000000..3cc617d7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc @@ -0,0 +1,57 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the MethodScope sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff + */ +final class MethodScopeUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 6 => 1, + 30 => 1, + 39 => 1, + 46 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc new file mode 100644 index 00000000..dd6530e8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc @@ -0,0 +1,127 @@ +func2()); + $result = $this->getValue($value); + return $this->setValue($result); + } + + public static function /* */ func1() + { + return $this->setValue($result); + } + + public static function + func1() + { + return $this->setValue($result); + } + + public function func1() + { + $value = 'hello'; + $newValue = array($this->func2()); + $result = $this->getValue($value); + return $this->setValue($result); + } + + function func1() + { + $value = 'hello'; + $newValue = array($this->func2()); + $result = $this->getValue($value); + return $this->setValue($result); + } + + public static function func1() { + return function() { + echo $this->name; + }; + } + + private static function func1(array $data) + { + return new class() + { + private $data; + + public function __construct(array $data) + { + $this->data = $data; + } + }; + } + + public function getAnonymousClass() { + return new class() { + public static function something() { + $this->doSomething(); + } + }; + } +} + +trait MyTrait { + public static function myFunc() { + $this->doSomething(); + } +} + +$b = new class() +{ + public static function myFunc() { + $this->doSomething(); + } + + public static function other() { + return fn () => $this->name; + } + + public static function anonClassUseThis() { + return new class($this) { + public function __construct($class) { + } + }; + } + + public static function anonClassAnotherThis() { + return new class() { + public function __construct() { + $this->id = 1; + } + }; + } + + public static function anonClassNestedUseThis() { + return new class(new class($this) {}) { + }; + } + + public static function anonClassNestedAnotherThis() { + return new class(new class() { + public function __construct() { + $this->id = 1; + } + }) { + }; + } + + public static function thisMustBeLowercase() { + $This = 'hey'; + + return $This; + } +} + +enum MyEnum { + private function notStatic () { + $this->doSomething(); + } + + public static function myFunc() { + $this->doSomething(); + } +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php new file mode 100644 index 00000000..543b5697 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php @@ -0,0 +1,67 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the StaticThisUsage sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\StaticThisUsageSniff + */ +final class StaticThisUsageUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 7 => 1, + 8 => 1, + 9 => 1, + 14 => 1, + 20 => 1, + 41 => 1, + 61 => 1, + 69 => 1, + 76 => 1, + 80 => 1, + 84 => 1, + 99 => 1, + 125 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc new file mode 100644 index 00000000..3bf4186e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc @@ -0,0 +1,49 @@ +add_help_tab( array( +'id' => <<', +) ); + +// phpcs:set Squiz.Strings.ConcatenationSpacing spacing 1 + +$string = 'Hello'.$there.'. How are'.$you.$going. "today $okay"; +$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; +$string = 'Hello'.$there; +$string = 'Hello'. $there; +$string = 'Hello' .$there; + +// phpcs:set Squiz.Strings.ConcatenationSpacing ignoreNewlines true +$y = '1' + . '2' + . '3'; + +$y = '1' . + '2' . + '3'; + +$y = '1' +. '2' +. '3'; + +$y = '1' + .'2'. + '3' + . '4'; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..b45f1a43 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed @@ -0,0 +1,47 @@ +add_help_tab( array( +'id' => <<', +) ); + +// phpcs:set Squiz.Strings.ConcatenationSpacing spacing 1 + +$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; +$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; +$string = 'Hello' . $there; +$string = 'Hello' . $there; +$string = 'Hello' . $there; + +// phpcs:set Squiz.Strings.ConcatenationSpacing ignoreNewlines true +$y = '1' + . '2' + . '3'; + +$y = '1' . + '2' . + '3'; + +$y = '1' +. '2' +. '3'; + +$y = '1' + . '2' . + '3' + . '4'; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php new file mode 100644 index 00000000..e59da3c6 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php @@ -0,0 +1,71 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ConcatenationSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\ConcatenationSpacingSniff + */ +final class ConcatenationSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 5, + 5 => 1, + 6 => 1, + 9 => 1, + 10 => 1, + 12 => 1, + 13 => 1, + 14 => 1, + 15 => 1, + 16 => 5, + 22 => 1, + 27 => 5, + 29 => 1, + 30 => 1, + 31 => 1, + 47 => 2, + 49 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc new file mode 100644 index 00000000..c8cc6383 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc @@ -0,0 +1,37 @@ +"; +$string = "Value: $var[test]"; +$string = "\0"; +$string = "\$var"; + +$x = "bar = '$z', +baz = '" . $a . "'...$x"; + +$string = "Hello +there"; +$string = 'Hello +there'; + +$string = "\123 \234"."\u123"."\e"; + +echo "window.location = \"".$url."\";\n"; +echo "" + +$string = "Hello + there"; + +function test() { + echo "It Worked'; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed new file mode 100644 index 00000000..97309194 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed @@ -0,0 +1,37 @@ +"; +$string = "Value: $var[test]"; +$string = "\0"; +$string = '$var'; + +$x = "bar = '$z', +baz = '" . $a . "'...$x"; + +$string = 'Hello +there'; +$string = 'Hello +there'; + +$string = "\123 \234"."\u123"."\e"; + +echo 'window.location = "'.$url."\";\n"; +echo '' + +$string = 'Hello + there'; + +function test() { + echo "It Worked'; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php new file mode 100644 index 00000000..df50beee --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php @@ -0,0 +1,67 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the DoubleQuoteUsage sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\DoubleQuoteUsageSniff + */ +final class DoubleQuoteUsageUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 1, + 5 => 1, + 6 => 1, + 8 => 2, + 14 => 1, + 15 => 1, + 17 => 1, + 19 => 1, + 20 => 1, + 22 => 1, + 29 => 1, + 30 => 1, + 32 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc new file mode 100644 index 00000000..9e0391da --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc @@ -0,0 +1,13 @@ +returndate == 0) ? 'Not returned' : date('d/m/Y', $loan_device->returndate); +?> +

    +

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed new file mode 100644 index 00000000..37c7d24c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed @@ -0,0 +1,13 @@ +returndate == 0) ? 'Not returned' : date('d/m/Y', $loan_device->returndate); +?> +

    +

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php new file mode 100644 index 00000000..dd8ead06 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php @@ -0,0 +1,60 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the EchoedStrings sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\EchoedStringsSniff + */ +final class EchoedStringsUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 5 => 1, + 6 => 1, + 7 => 1, + 8 => 1, + 9 => 1, + 13 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc new file mode 100644 index 00000000..fa65112f --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc @@ -0,0 +1,9 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the CastSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff + */ +final class CastSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 4 => 1, + 5 => 1, + 6 => 1, + 9 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc new file mode 100644 index 00000000..70abae43 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc @@ -0,0 +1,269 @@ + +
    + + + +
    + children as $child) { + // There should be no error after this + // foreach, because it is followed by a + // close PHP tag. + } + ?> +
    +children as $child) { + echo $child; + +} + +if ($defaultPageDesign === 0 + && $defaultCascade === TRUE + && $defaultChildDesign === 0 +) { + $settingsUpdated = FALSE; +} + +foreach ( $blah as $var ) { + if ( $blah ) { + } +} + +if ( + $defaultPageDesign === 0 + && $defaultCascade === TRUE + && $defaultChildDesign === 0 +) { + $settingsUpdated = FALSE; +} + +$moo = 'blar'; +switch ($moo) +{ + case 'blar': + if ($moo === 'blar2') { + $moo = 'blar' + } + return $moo; + + default: + $moo = 'moo'; + break; +} + +do { +} +while (true); + +try { + // Something +} catch (Exception $e) { + // Something +} + +try { + + // Something + +} catch (Exception $e) { + + // Something + +} + +if ($one) { +} +elseif ($two) { +} +// else if something +else if ($three) { +} // else do something +else { +} + +if ($one) { + +} + +do { + echo 'hi'; +} while ( $blah ); + +if ($one) { +} +// No blank line here. +if ($two) { +} + +switch ($moo) +{ + case 'blar': + if ($moo === 'blar2') { + $moo = 'blar' + } + + return $moo; +} + +try { + // Something +} +catch (Exception $e) { + // Something +} +finally { + // Something +} + +if ($foo) { + + + /** + * Comment + */ + function foo() { + // Code here + } + + + /** + * Comment + */ + class bar() { + + }//end class + + +} + +if (true) { // some comment goes here + + echo 'foo'; +} + +if (true) { echo 'foo'; + + echo 'foo'; +} + +if ($true) { + echo 'hi 2'; +}//end if +echo 'hi'; + +if ($true) { + echo 'hi 2'; +} // phpcs:enable Standard.Category.Sniff -- for reasons. +echo 'hi'; + +?> + + + + + + + 1, + 2 => 2, + +}; +echo $expr; + +if($true) { + + enum SomeEnum {} + +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..c64de25e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed @@ -0,0 +1,261 @@ + + + + + +
    + children as $child) { + // There should be no error after this + // foreach, because it is followed by a + // close PHP tag. + } + ?> +
    +children as $child) { + echo $child; +} + +if ($defaultPageDesign === 0 + && $defaultCascade === TRUE + && $defaultChildDesign === 0 +) { + $settingsUpdated = FALSE; +} + +foreach ($blah as $var) { + if ($blah) { + } +} + +if ($defaultPageDesign === 0 + && $defaultCascade === TRUE + && $defaultChildDesign === 0 +) { + $settingsUpdated = FALSE; +} + +$moo = 'blar'; +switch ($moo) +{ + case 'blar': + if ($moo === 'blar2') { + $moo = 'blar' + } + return $moo; + + default: + $moo = 'moo'; + break; +} + +do { +} +while (true); + +try { + // Something +} catch (Exception $e) { + // Something +} + +try { + // Something +} catch (Exception $e) { + // Something +} + +if ($one) { +} +elseif ($two) { +} +// else if something +else if ($three) { +} // else do something +else { +} + +if ($one) { +} + +do { + echo 'hi'; +} while ($blah); + +if ($one) { +} + +// No blank line here. +if ($two) { +} + +switch ($moo) +{ + case 'blar': + if ($moo === 'blar2') { + $moo = 'blar' + } + return $moo; +} + +try { + // Something +} +catch (Exception $e) { + // Something +} +finally { + // Something +} + +if ($foo) { + + + /** + * Comment + */ + function foo() { + // Code here + } + + + /** + * Comment + */ + class bar() { + + }//end class + + +} + +if (true) { // some comment goes here + echo 'foo'; +} + +if (true) { echo 'foo'; + + echo 'foo'; +} + +if ($true) { + echo 'hi 2'; +}//end if + +echo 'hi'; + +if ($true) { + echo 'hi 2'; +} // phpcs:enable Standard.Category.Sniff -- for reasons. + +echo 'hi'; + +?> + + + + + + 1, + 2 => 2, +}; + +echo $expr; + +if($true) { + + enum SomeEnum {} + +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js new file mode 100644 index 00000000..1c889a1c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js @@ -0,0 +1,93 @@ + +if (something) { +} +for (i = 0; i < 10; i++) { +} + +while (true) { + for (i = 0; i < 10; i++) { + } + if (something) { + } + + do { + } while (true); + +} + +if (one) { +} else (two) { +} else if (three) { +} +if (one) { +} else (two) { +} else if (three) { +} + +switch (blah) { + case 'one': + if (blah) { + // There are no spaces before break. + } + break; + + default: + if (blah) { + // There are no spaces before break. + } + break; +} + +switch (blah) { + case 'one': + if (blah) { + // There are no spaces before break. + } + break; + + default: + if (blah) { + // Code here. + } +} + +for (i = 0; i < 10; i++) { + if (blah) { + } + break; +} + +while (true) { + for (i = 0; i < 10; i++) { + + if (something) { + } + + } + + do { + + alert(i); + } while (true); +} + +for ( i = 0; i < 10; i++ ) { + if ( blah ) { + } +} + +var x = { + a: function () { + if (blah) { + } + + }, +}; + +if (one) { +} +// else if something +else if (two) { +} // else do something +else { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed new file mode 100644 index 00000000..bb979bc8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed @@ -0,0 +1,93 @@ + +if (something) { +} + +for (i = 0; i < 10; i++) { +} + +while (true) { + for (i = 0; i < 10; i++) { + } + + if (something) { + } + + do { + } while (true); +} + +if (one) { +} else (two) { +} else if (three) { +} + +if (one) { +} else (two) { +} else if (three) { +} + +switch (blah) { + case 'one': + if (blah) { + // There are no spaces before break. + } + break; + + default: + if (blah) { + // There are no spaces before break. + } + break; +} + +switch (blah) { + case 'one': + if (blah) { + // There are no spaces before break. + } + break; + + default: + if (blah) { + // Code here. + } +} + +for (i = 0; i < 10; i++) { + if (blah) { + } + + break; +} + +while (true) { + for (i = 0; i < 10; i++) { + if (something) { + } + } + + do { + alert(i); + } while (true); +} + +for (i = 0; i < 10; i++) { + if (blah) { + } +} + +var x = { + a: function () { + if (blah) { + } + + }, +}; + +if (one) { +} +// else if something +else if (two) { +} // else do something +else { +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php new file mode 100644 index 00000000..c5567cb7 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php @@ -0,0 +1,107 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ControlStructureSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff + */ +final class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ControlStructureSpacingUnitTest.inc': + return [ + 3 => 1, + 5 => 1, + 8 => 1, + 15 => 1, + 23 => 1, + 74 => 1, + 79 => 1, + 82 => 1, + 83 => 1, + 87 => 1, + 103 => 1, + 113 => 2, + 114 => 2, + 118 => 1, + 150 => 1, + 153 => 1, + 154 => 1, + 157 => 1, + 170 => 1, + 176 => 2, + 179 => 1, + 189 => 1, + 225 => 1, + 237 => 1, + 242 => 1, + 246 => 1, + 248 => 1, + 257 => 3, + 261 => 1, + 262 => 1, + ]; + + case 'ControlStructureSpacingUnitTest.js': + return [ + 3 => 1, + 9 => 1, + 15 => 1, + 21 => 1, + 56 => 1, + 61 => 1, + 64 => 1, + 65 => 1, + 68 => 1, + 74 => 2, + 75 => 2, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc new file mode 100644 index 00000000..e831e257 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc @@ -0,0 +1,39 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionClosingBraceSpace sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionClosingBraceSpaceSniff + */ +final class FunctionClosingBraceSpaceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'FunctionClosingBraceSpaceUnitTest.inc': + return [ + 10 => 1, + 21 => 1, + 28 => 1, + 29 => 1, + 31 => 1, + 39 => 1, + ]; + + case 'FunctionClosingBraceSpaceUnitTest.js': + return [ + 13 => 1, + 25 => 1, + 32 => 1, + 53 => 1, + 59 => 1, + 67 => 1, + 84 => 1, + 128 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc new file mode 100644 index 00000000..fe2c903b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc @@ -0,0 +1,54 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionOpeningBraceSpace sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionOpeningBraceSpaceSniff + */ +final class FunctionOpeningBraceSpaceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'FunctionOpeningBraceSpaceUnitTest.inc': + return [ + 10 => 1, + 25 => 1, + 49 => 1, + ]; + + case 'FunctionOpeningBraceSpaceUnitTest.js': + return [ + 11 => 1, + 31 => 1, + 38 => 1, + 88 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc new file mode 100644 index 00000000..b03a0ed8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc @@ -0,0 +1,584 @@ +setLogger(new class { + public function a(){} + private function b(){} + protected function c(){} +}); + +?> + +setLogger(new class { + + public function a(){} + + private function b(){} + + protected function c(){} + +}); + +?> + + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the FunctionSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionSpacingSniff + */ +final class FunctionSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'FunctionSpacingUnitTest.1.inc': + return [ + 26 => 1, + 35 => 1, + 44 => 1, + 51 => 1, + 55 => 1, + 61 => 1, + 64 => 1, + 66 => 1, + 81 => 1, + 100 => 1, + 111 => 1, + 113 => 1, + 119 => 2, + 141 => 1, + 160 => 1, + 173 => 2, + 190 => 1, + 224 => 2, + 281 => 1, + 282 => 1, + 295 => 1, + 297 => 1, + 303 => 1, + 327 => 1, + 329 => 1, + 338 => 1, + 344 => 1, + 345 => 1, + 354 => 2, + 355 => 1, + 356 => 1, + 360 => 2, + 361 => 1, + 362 => 1, + 385 => 1, + 399 => 1, + 411 => 2, + 418 => 2, + 426 => 2, + 432 => 1, + 437 => 1, + 438 => 1, + 442 => 2, + 444 => 1, + 449 => 1, + 458 => 2, + 459 => 1, + 460 => 1, + 465 => 2, + 466 => 1, + 467 => 1, + 471 => 1, + 473 => 2, + 475 => 1, + 478 => 2, + 479 => 1, + 483 => 2, + 495 => 1, + 529 => 1, + 539 => 1, + 547 => 2, + 551 => 1, + 553 => 1, + 560 => 1, + 566 => 1, + 580 => 2, + 583 => 3, + ]; + + case 'FunctionSpacingUnitTest.2.inc': + return [2 => 1]; + + case 'FunctionSpacingUnitTest.3.inc': + return [7 => 1]; + + case 'FunctionSpacingUnitTest.5.inc': + return [5 => 1]; + + case 'FunctionSpacingUnitTest.6.inc': + return [10 => 1]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc new file mode 100644 index 00000000..e8f2edad --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc @@ -0,0 +1,43 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LanguageConstructSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LanguageConstructSpacingSniff + */ +final class LanguageConstructSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 7 => 1, + 11 => 1, + 15 => 1, + 19 => 1, + 23 => 1, + 27 => 1, + 31 => 1, + 34 => 1, + 35 => 1, + 39 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc new file mode 100644 index 00000000..c2f4ec7d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc @@ -0,0 +1,19 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the LogicalOperatorSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LogicalOperatorSpacingSniff + */ +final class LogicalOperatorSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 2, + 5 => 3, + 6 => 3, + 15 => 1, + 17 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc new file mode 100644 index 00000000..12b55176 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc @@ -0,0 +1,374 @@ + 'a', 'b' => 'b' ), + $varQ = 'string', + $varR = 123; +} + +// Make sure the determination of whether a property is the first property or not is done correctly. +class ClassUsingSimpleTraits +{ + use HelloWorld; + + + /* comment */ + public $firstVar = array( 'a', 'b' ); + protected $secondVar = true; +} + +class ClassUsingComplexTraits +{ + use A, B { + B::smallTalk insteadof A; + A::bigTalk insteadof B; + } + + + + public $firstVar = array( 'a', 'b' ); + + + /* comment */ + protected $secondVar = true; +} + +class Foo +{ + + + private function foo() + { + } + + + /* no error here because after function */ + private $bar = false; +} + +class CommentedOutCodeAtStartOfClass { + + /** + * Description. + * + * @var bool + */ + //public $commented_out_property = true; + + /** + * Description. + * + * @var bool + */ + public $property = true; +} + +class CommentedOutCodeAtStartOfClassNoBlankLine { + + // phpcs:disable Stnd.Cat.Sniff -- For reasons. + /** + * Description. + * + * @var bool + */ + public $property = true; +} + +class HasAttributes +{ + /** + * Short description of the member variable. + * + * @var array + */ + + #[ORM\Id]#[ORM\Column("integer")] + + private $id; + + + /** + * Short description of the member variable. + * + * @var array + */ + #[ORM\GeneratedValue] + + #[ORM\Column(ORM\Column::T_INTEGER)] + protected $height; + + #[SingleAttribute] + protected $propertySingle; + + #[FirstAttribute] + #[SecondAttribute] + protected $propertyDouble; + #[ThirdAttribute] + protected $propertyWithoutSpacing; +} + +enum SomeEnum +{ + // Enum cannot have properties + + case ONE = 'one'; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..d683eaad --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed @@ -0,0 +1,359 @@ + 'a', 'b' => 'b' ), + $varQ = 'string', + $varR = 123; +} + +// Make sure the determination of whether a property is the first property or not is done correctly. +class ClassUsingSimpleTraits +{ + use HelloWorld; + + /* comment */ + public $firstVar = array( 'a', 'b' ); + + protected $secondVar = true; +} + +class ClassUsingComplexTraits +{ + use A, B { + B::smallTalk insteadof A; + A::bigTalk insteadof B; + } + + public $firstVar = array( 'a', 'b' ); + + /* comment */ + protected $secondVar = true; +} + +class Foo +{ + + + private function foo() + { + } + + + /* no error here because after function */ + private $bar = false; +} + +class CommentedOutCodeAtStartOfClass { + + /** + * Description. + * + * @var bool + */ + //public $commented_out_property = true; + + /** + * Description. + * + * @var bool + */ + public $property = true; +} + +class CommentedOutCodeAtStartOfClassNoBlankLine { + + // phpcs:disable Stnd.Cat.Sniff -- For reasons. + + /** + * Description. + * + * @var bool + */ + public $property = true; +} + +class HasAttributes +{ + + /** + * Short description of the member variable. + * + * @var array + */ + #[ORM\Id]#[ORM\Column("integer")] + private $id; + + /** + * Short description of the member variable. + * + * @var array + */ + #[ORM\GeneratedValue] + #[ORM\Column(ORM\Column::T_INTEGER)] + protected $height; + + #[SingleAttribute] + protected $propertySingle; + + #[FirstAttribute] + #[SecondAttribute] + protected $propertyDouble; + + #[ThirdAttribute] + protected $propertyWithoutSpacing; +} + +enum SomeEnum +{ + // Enum cannot have properties + + case ONE = 'one'; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php new file mode 100644 index 00000000..548ee3ba --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php @@ -0,0 +1,90 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the MemberVarSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\MemberVarSpacingSniff + */ +final class MemberVarSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 4 => 1, + 7 => 1, + 20 => 1, + 30 => 1, + 35 => 1, + 44 => 1, + 50 => 1, + 73 => 1, + 86 => 1, + 106 => 1, + 115 => 1, + 150 => 1, + 160 => 1, + 165 => 1, + 177 => 1, + 186 => 1, + 200 => 1, + 209 => 1, + 211 => 1, + 224 => 1, + 229 => 1, + 241 => 1, + 246 => 1, + 252 => 1, + 254 => 1, + 261 => 1, + 275 => 1, + 276 => 1, + 288 => 1, + 292 => 1, + 333 => 1, + 342 => 1, + 346 => 1, + 353 => 1, + 357 => 1, + 366 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc new file mode 100644 index 00000000..67f8ee14 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc @@ -0,0 +1,52 @@ +testThis(); +$this-> testThis(); +$this -> testThis(); +$this-> /* comment here */testThis(); +$this/* comment here */ -> testThis(); +$this + ->testThis(); +$this-> + testThis(); + +// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true + +$this->testThis(); +$this-> testThis(); +$this -> testThis(); +$this->/* comment here */testThis(); +$this/* comment here */ -> testThis(); +$this + ->testThis(); +$this-> + testThis(); + +// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false + +thisObject::testThis(); +thisObject:: testThis(); +thisObject :: testThis(); +thisObject::/* comment here */testThis(); +thisObject/* comment here */ :: testThis(); +thisObject + ::testThis(); +thisObject:: + testThis(); + +// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true + +thisObject::testThis(); +thisObject:: testThis(); +thisObject :: testThis(); +thisObject::/* comment here */testThis(); +thisObject/* comment here */ :: testThis(); +thisObject + ::testThis(); +thisObject:: + testThis(); + +// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false + +$this?->testThis(); +$this?-> testThis(); +$this ?-> testThis(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..730b8e4a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed @@ -0,0 +1,48 @@ +testThis(); +$this->testThis(); +$this->testThis(); +$this->/* comment here */testThis(); +$this/* comment here */->testThis(); +$this->testThis(); +$this->testThis(); + +// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true + +$this->testThis(); +$this->testThis(); +$this->testThis(); +$this->/* comment here */testThis(); +$this/* comment here */->testThis(); +$this + ->testThis(); +$this-> + testThis(); + +// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false + +thisObject::testThis(); +thisObject::testThis(); +thisObject::testThis(); +thisObject::/* comment here */testThis(); +thisObject/* comment here */::testThis(); +thisObject::testThis(); +thisObject::testThis(); + +// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true + +thisObject::testThis(); +thisObject::testThis(); +thisObject::testThis(); +thisObject::/* comment here */testThis(); +thisObject/* comment here */::testThis(); +thisObject + ::testThis(); +thisObject:: + testThis(); + +// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false + +$this?->testThis(); +$this?->testThis(); +$this?->testThis(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php new file mode 100644 index 00000000..c1ef24a4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php @@ -0,0 +1,73 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ObjectOperatorSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ObjectOperatorSpacingSniff + */ +final class ObjectOperatorSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 4 => 2, + 5 => 1, + 6 => 2, + 8 => 1, + 9 => 1, + 15 => 1, + 16 => 2, + 18 => 2, + 27 => 1, + 28 => 2, + 30 => 2, + 32 => 1, + 33 => 1, + 39 => 1, + 40 => 2, + 42 => 2, + 51 => 1, + 52 => 2, + ]; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc new file mode 100644 index 00000000..29acf308 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc @@ -0,0 +1,510 @@ + $j && $k< $l && $m>= $n && $o<= $p && $q<> $r; + +$a ==$b && $c !=$d && $e ===$f && $g !==$h; +$i >$j && $k <$l && $m >=$n && $o <=$p && $q <>$r; + +function myFunction($variable=0, $var2='string') {} + +if (index > -1) { +} + +array_walk_recursive($array, function(&$item) use (&$something) { +}); + +$var = saveFile(&$model, &$foo); + +// This is all valid. +$boo = -$foo; +function foo($boo = -1) {} +$foo = array('boo' => -1); +$x = $test ? -1 : 1; +$y = $test ? 1 : -1; +$z = $test ?: false; + +$closureWithDefaultParameter = function (array $testArray=array()) {}; + +switch ($foo) { + case -1: + break; +} + +$y = 1 * -1; +$y = -1 * 1; +$y = -1 * $var; +$y = 10 / -2; +$y = -10 / 2; +$y = (-10 / 2); +$y = (-10 / $var); +$y = 10 + -2; +$y = -10 + 2; + +$a = $x?$y:$z; +$a = $x ? $y : $z; + +$y = 1 + + 2 + - 3; + +$y = 1 + + 2 - + 3; + +$y = 1 ++ 2 +- 3; + +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true +$y = 1 + + 2 + - 3; + +$y = 1 + + 2 - + 3; + +$y = 1 ++ 2 +- 3; +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false + +if (true || -1 == $b) { +} + +$var = array(-1); +$var = [-1]; +$var = [0, -1, -2]; + +$y = array(&$x); +$y = [&$x]; +$y = array(&$a, &$b, &$c); +$y = [&$a, &$b, &$c]; +$y = array(&$a => 1, 2 => &$b, &$c); +$y = [&$a => 1, 2 => &$b, &$c]; + +if ($a <=> $b) { +} + +if ($a <=>$b) { +} + +$a |= $b; +$a **= $b; +$a ??= $b; + +$a = +1; + +function bar($boo = +1) {} + +$username = $_GET['user']??'nobody'; + +function foo(string $bar, array $baz, ?MyClass $object) : MyClass {} + +declare(strict_types=1); + +function foo($c = ((BAR)?10:100)) {} + +$res = $a ?: $b; +$res = $a ?: $b; +$res = $a ?: $b; +$res = $a ?: $b; + +$res = $a ? : $b; +$res = $a ? : $b; +$res = $a ? : $b; +$res = $a ? : $b; + +function foo(string $a = '', ?string $b = ''): ?string {} + +// Issue #1605. +$text = preg_replace_callback( + self::CHAR_REFS_REGEX, + [ 'Sanitizer', 'decodeCharReferencesCallback' ], + $text, /* limit */ -1, $count ); + +if (true || /* test */ -1 == $b) {} +$y = 10 + /* test */ -2; + +// Issue #1604. +Hooks::run( 'ParserOptionsRegister', [ + &self::$defaults, + &self::$inCacheKey, + &self::$lazyOptions, +] ); + +$x = $foo ? function (): int { + return 1; +} : $bar; + +$x = $foo ? function ($foo) + // comment + : int { + return 1; +} : $bar; + +$x = $foo ? function ($foo) use /* comment */ ($bar): int { + return 1; +} : $bar; + +$x = !$foo ? $bar : function (): int { + return 1; +}; + +$a = + // Comment. + [ + 'a', + 'b', + ]; + +$a = +// phpcs:ignore Standard.Category.Sniff -- for reasons. +[ + 'a', + 'b', +]; + +$foo = is_array($bar) ? array_map( + function () {}, + $bar + ) : $bar; + +function bar(): array {} + +if ($line{-1} === ':') { + $line = substr($line, 0, -1); +} + +$a = $a instanceof $b; +$a = $a instanceof $b; +$a = ($a)instanceof$b; + +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; +func(-1); +$a = [-1]; +return -1; +print -1; +$a &= -1; +switch ($a) { + case -1: +} +$a = $a ?? -1; +$a .= -1; +$a /= -1; +$a = [1 => -1]; +$a = $a == -1; +$a = $a >= -1; +$a = $a === -1; +$a = $a != -1; +$a = $a !== -1; +$a = $a <= -1; +$a = $a <=> -1; +$a = $a and -1; +$a = $a or -1; +$a = $a xor -1; +$a -= -1; +$a %= -1; +$a *= -1; +$a |= -1; +$a += -1; +$a = $a ** -1; +$a **= -1; +$a = $a << -1; +$a <<= -1; +$a = $a >> -1; +$a >>= -1; +$a = (string) -1; +$a = (array) -1; +$a = (bool) -1; +$a = (object) -1; +$a = (unset) -1; +$a = (float) -1; +$a = (int) -1; +$a ^= -1; +$a = [$a, -1]; +$a = $a[-1]; +$a = $a ? -1 : -1; + +yield - 1; +echo - 1; +$a = - 1; +func(- 1); +$a = [- 1]; +return - 1; +print - 1; +$a &= - 1; +switch ($a) { + case - 1: +} +$a = $a ?? - 1; +$a .= - 1; +$a /= - 1; +$a = [1 => - 1]; +$a = $a == - 1; +$a = $a >= - 1; +$a = $a === - 1; +$a = $a != - 1; +$a = $a !== - 1; +$a = $a <= - 1; +$a = $a <=> - 1; +$a = $a and - 1; +$a = $a or - 1; +$a = $a xor - 1; +$a -= - 1; +$a %= - 1; +$a *= - 1; +$a |= - 1; +$a += - 1; +$a = $a ** - 1; +$a **= - 1; +$a = $a << - 1; +$a <<= - 1; +$a = $a >> - 1; +$a >>= - 1; +$a = (string) - 1; +$a = (array) - 1; +$a = (bool) - 1; +$a = (object) - 1; +$a = (unset) - 1; +$a = (float) - 1; +$a = (int) - 1; +$a ^= - 1; +$a = [$a, - 1]; +$a = $a[- 1]; +$a = $a ? - 1 : - 1; + + +yield -$b; +echo -$b; +$a = -$b; +func(-$b); +$a = [-$b]; +return -$b; +print -$b; +$a &= -$b; +switch ($a) { + case -$b: +} +$a = $a ?? -$b; +$a .= -$b; +$a /= -$b; +$a = [1 => -$b]; +$a = $a == -$b; +$a = $a >= -$b; +$a = $a === -$b; +$a = $a != -$b; +$a = $a !== -$b; +$a = $a <= -$b; +$a = $a <=> -$b; +$a = $a and -$b; +$a = $a or -$b; +$a = $a xor -$b; +$a -= -$b; +$a %= -$b; +$a *= -$b; +$a |= -$b; +$a += -$b; +$a = $a ** -$b; +$a **= -$b; +$a = $a << -$b; +$a <<= -$b; +$a = $a >> -$b; +$a >>= -$b; +$a = (string) -$b; +$a = (array) -$b; +$a = (bool) -$b; +$a = (object) -$b; +$a = (unset) -$b; +$a = (float) -$b; +$a = (int) -$b; +$a ^= -$b; +$a = [$a, -$b]; +$a = $a[-$b]; +$a = $a ? -$b : -$b; + +yield - $b; +echo - $b; +$a = - $b; +func(- $b); +$a = [- $b]; +return - $b; +print - $b; +$a &= - $b; +switch ($a) { + case - $b: +} +$a = $a ?? - $b; +$a .= - $b; +$a /= - $b; +$a = [1 => - $b]; +$a = $a == - $b; +$a = $a >= - $b; +$a = $a === - $b; +$a = $a != - $b; +$a = $a !== - $b; +$a = $a <= - $b; +$a = $a <=> - $b; +$a = $a and - $b; +$a = $a or - $b; +$a = $a xor - $b; +$a -= - $b; +$a %= - $b; +$a *= - $b; +$a |= - $b; +$a += - $b; +$a = $a ** - $b; +$a **= - $b; +$a = $a << - $b; +$a <<= - $b; +$a = $a >> - $b; +$a >>= - $b; +$a = (string) - $b; +$a = (array) - $b; +$a = (bool) - $b; +$a = (object) - $b; +$a = (unset) - $b; +$a = (float) - $b; +$a = (int) - $b; +$a ^= - $b; +$a = [$a, - $b]; +$a = $a[- $b]; +$a = $a ? - $b : - $b; + +exit -1; + +$cl = function ($boo =-1) {}; +$cl = function ($boo =+1) {}; +$fn = fn ($boo =-1) => $boo; +$fn = fn ($boo =+1) => $boo; + +$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); + +$a = 'a '.-MY_CONSTANT; +$a = 'a '.-$b; +$a = 'a '.- MY_CONSTANT; +$a = 'a '.- $b; + +match ($a) { + 'a' => -1, + 'b', 'c', 'd' => -2, + default => -3, +}; + +$foo = $var + ? 10 + : true; + +// Safeguard that a non-fixable error is thrown when there is a new line before the operator, +// but the last non-whitespace token before the operator is a comment token. +$foo = $var // Comment + ? false /* Comment */ + : true; + +$foo = $var // phpcs: ignore Stnd.Cat.Sniff -- for reasons. + + + ? $something /** + * Don't ask, but someone might have a docblock between the lines. It's valid PHP after all. + */ + + + : true; + +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true +$foo = $var // Comment + ? false // Comment + : true; +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc.fixed new file mode 100644 index 00000000..5c94e365 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc.fixed @@ -0,0 +1,502 @@ + $j && $k < $l && $m >= $n && $o <= $p && $q <> $r; + +$a == $b && $c != $d && $e === $f && $g !== $h; +$i > $j && $k < $l && $m >= $n && $o <= $p && $q <> $r; + +function myFunction($variable=0, $var2='string') {} + +if (index > -1) { +} + +array_walk_recursive($array, function(&$item) use (&$something) { +}); + +$var = saveFile(&$model, &$foo); + +// This is all valid. +$boo = -$foo; +function foo($boo = -1) {} +$foo = array('boo' => -1); +$x = $test ? -1 : 1; +$y = $test ? 1 : -1; +$z = $test ?: false; + +$closureWithDefaultParameter = function (array $testArray=array()) {}; + +switch ($foo) { + case -1: + break; +} + +$y = 1 * -1; +$y = -1 * 1; +$y = -1 * $var; +$y = 10 / -2; +$y = -10 / 2; +$y = (-10 / 2); +$y = (-10 / $var); +$y = 10 + -2; +$y = -10 + 2; + +$a = $x ? $y : $z; +$a = $x ? $y : $z; + +$y = 1 + 2 - 3; + +$y = 1 + 2 - 3; + +$y = 1 + 2 - 3; + +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true +$y = 1 + + 2 + - 3; + +$y = 1 + + 2 - + 3; + +$y = 1 ++ 2 +- 3; +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false + +if (true || -1 == $b) { +} + +$var = array(-1); +$var = [-1]; +$var = [0, -1, -2]; + +$y = array(&$x); +$y = [&$x]; +$y = array(&$a, &$b, &$c); +$y = [&$a, &$b, &$c]; +$y = array(&$a => 1, 2 => &$b, &$c); +$y = [&$a => 1, 2 => &$b, &$c]; + +if ($a <=> $b) { +} + +if ($a <=> $b) { +} + +$a |= $b; +$a **= $b; +$a ??= $b; + +$a = +1; + +function bar($boo = +1) {} + +$username = $_GET['user'] ?? 'nobody'; + +function foo(string $bar, array $baz, ?MyClass $object) : MyClass {} + +declare(strict_types=1); + +function foo($c = ((BAR) ? 10 : 100)) {} + +$res = $a ?: $b; +$res = $a ?: $b; +$res = $a ?: $b; +$res = $a ?: $b; + +$res = $a ? : $b; +$res = $a ? : $b; +$res = $a ? : $b; +$res = $a ? : $b; + +function foo(string $a = '', ?string $b = ''): ?string {} + +// Issue #1605. +$text = preg_replace_callback( + self::CHAR_REFS_REGEX, + [ 'Sanitizer', 'decodeCharReferencesCallback' ], + $text, /* limit */ -1, $count ); + +if (true || /* test */ -1 == $b) {} +$y = 10 + /* test */ -2; + +// Issue #1604. +Hooks::run( 'ParserOptionsRegister', [ + &self::$defaults, + &self::$inCacheKey, + &self::$lazyOptions, +] ); + +$x = $foo ? function (): int { + return 1; +} : $bar; + +$x = $foo ? function ($foo) + // comment + : int { + return 1; +} : $bar; + +$x = $foo ? function ($foo) use /* comment */ ($bar): int { + return 1; +} : $bar; + +$x = !$foo ? $bar : function (): int { + return 1; +}; + +$a = + // Comment. + [ + 'a', + 'b', + ]; + +$a = +// phpcs:ignore Standard.Category.Sniff -- for reasons. +[ + 'a', + 'b', +]; + +$foo = is_array($bar) ? array_map( + function () {}, + $bar + ) : $bar; + +function bar(): array {} + +if ($line{-1} === ':') { + $line = substr($line, 0, -1); +} + +$a = $a instanceof $b; +$a = $a instanceof $b; +$a = ($a) instanceof $b; + +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; +func(-1); +$a = [-1]; +return -1; +print -1; +$a &= -1; +switch ($a) { + case -1: +} +$a = $a ?? -1; +$a .= -1; +$a /= -1; +$a = [1 => -1]; +$a = $a == -1; +$a = $a >= -1; +$a = $a === -1; +$a = $a != -1; +$a = $a !== -1; +$a = $a <= -1; +$a = $a <=> -1; +$a = $a and -1; +$a = $a or -1; +$a = $a xor -1; +$a -= -1; +$a %= -1; +$a *= -1; +$a |= -1; +$a += -1; +$a = $a ** -1; +$a **= -1; +$a = $a << -1; +$a <<= -1; +$a = $a >> -1; +$a >>= -1; +$a = (string) -1; +$a = (array) -1; +$a = (bool) -1; +$a = (object) -1; +$a = (unset) -1; +$a = (float) -1; +$a = (int) -1; +$a ^= -1; +$a = [$a, -1]; +$a = $a[-1]; +$a = $a ? -1 : -1; + +yield - 1; +echo - 1; +$a = - 1; +func(- 1); +$a = [- 1]; +return - 1; +print - 1; +$a &= - 1; +switch ($a) { + case - 1: +} +$a = $a ?? - 1; +$a .= - 1; +$a /= - 1; +$a = [1 => - 1]; +$a = $a == - 1; +$a = $a >= - 1; +$a = $a === - 1; +$a = $a != - 1; +$a = $a !== - 1; +$a = $a <= - 1; +$a = $a <=> - 1; +$a = $a and - 1; +$a = $a or - 1; +$a = $a xor - 1; +$a -= - 1; +$a %= - 1; +$a *= - 1; +$a |= - 1; +$a += - 1; +$a = $a ** - 1; +$a **= - 1; +$a = $a << - 1; +$a <<= - 1; +$a = $a >> - 1; +$a >>= - 1; +$a = (string) - 1; +$a = (array) - 1; +$a = (bool) - 1; +$a = (object) - 1; +$a = (unset) - 1; +$a = (float) - 1; +$a = (int) - 1; +$a ^= - 1; +$a = [$a, - 1]; +$a = $a[- 1]; +$a = $a ? - 1 : - 1; + + +yield -$b; +echo -$b; +$a = -$b; +func(-$b); +$a = [-$b]; +return -$b; +print -$b; +$a &= -$b; +switch ($a) { + case -$b: +} +$a = $a ?? -$b; +$a .= -$b; +$a /= -$b; +$a = [1 => -$b]; +$a = $a == -$b; +$a = $a >= -$b; +$a = $a === -$b; +$a = $a != -$b; +$a = $a !== -$b; +$a = $a <= -$b; +$a = $a <=> -$b; +$a = $a and -$b; +$a = $a or -$b; +$a = $a xor -$b; +$a -= -$b; +$a %= -$b; +$a *= -$b; +$a |= -$b; +$a += -$b; +$a = $a ** -$b; +$a **= -$b; +$a = $a << -$b; +$a <<= -$b; +$a = $a >> -$b; +$a >>= -$b; +$a = (string) -$b; +$a = (array) -$b; +$a = (bool) -$b; +$a = (object) -$b; +$a = (unset) -$b; +$a = (float) -$b; +$a = (int) -$b; +$a ^= -$b; +$a = [$a, -$b]; +$a = $a[-$b]; +$a = $a ? -$b : -$b; + +yield - $b; +echo - $b; +$a = - $b; +func(- $b); +$a = [- $b]; +return - $b; +print - $b; +$a &= - $b; +switch ($a) { + case - $b: +} +$a = $a ?? - $b; +$a .= - $b; +$a /= - $b; +$a = [1 => - $b]; +$a = $a == - $b; +$a = $a >= - $b; +$a = $a === - $b; +$a = $a != - $b; +$a = $a !== - $b; +$a = $a <= - $b; +$a = $a <=> - $b; +$a = $a and - $b; +$a = $a or - $b; +$a = $a xor - $b; +$a -= - $b; +$a %= - $b; +$a *= - $b; +$a |= - $b; +$a += - $b; +$a = $a ** - $b; +$a **= - $b; +$a = $a << - $b; +$a <<= - $b; +$a = $a >> - $b; +$a >>= - $b; +$a = (string) - $b; +$a = (array) - $b; +$a = (bool) - $b; +$a = (object) - $b; +$a = (unset) - $b; +$a = (float) - $b; +$a = (int) - $b; +$a ^= - $b; +$a = [$a, - $b]; +$a = $a[- $b]; +$a = $a ? - $b : - $b; + +exit -1; + +$cl = function ($boo =-1) {}; +$cl = function ($boo =+1) {}; +$fn = fn ($boo =-1) => $boo; +$fn = fn ($boo =+1) => $boo; + +$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); + +$a = 'a '.-MY_CONSTANT; +$a = 'a '.-$b; +$a = 'a '.- MY_CONSTANT; +$a = 'a '.- $b; + +match ($a) { + 'a' => -1, + 'b', 'c', 'd' => -2, + default => -3, +}; + +$foo = $var ? 10 : true; + +// Safeguard that a non-fixable error is thrown when there is a new line before the operator, +// but the last non-whitespace token before the operator is a comment token. +$foo = $var // Comment + ? false /* Comment */ + : true; + +$foo = $var // phpcs: ignore Stnd.Cat.Sniff -- for reasons. + + + ? $something /** + * Don't ask, but someone might have a docblock between the lines. It's valid PHP after all. + */ + + + : true; + +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true +$foo = $var // Comment + ? false // Comment + : true; +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.2.inc new file mode 100644 index 00000000..3a0dbac3 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.2.inc @@ -0,0 +1,3 @@ +> y; +x >>= y; +x = x >>> y; +x >>>= y; + +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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed new file mode 100644 index 00000000..47c89302 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed @@ -0,0 +1,98 @@ + + +result = 1 + 2; +result = 1 + 2; +result = 1 + 2; +result = 1 + 2; +result = 1 + 2; +result = 1 + 2; + +result = 1 - 2; +result = 1 - 2; +result = 1 - 2; +result = 1 - 2; +result = 1 - 2; +result = 1 - 2; + +result = 1 * 2; +result = 1 * 2; +result = 1 * 2; +result = 1 * 2; +result = 1 * 2; +result = 1 * 2; + +result = 1 / 2; +result = 1 / 2; +result = 1 / 2; +result = 1 / 2; +result = 1 / 2; +result = 1 / 2; + +result = 1 % 2; +result = 1 % 2; +result = 1 % 2; +result = 1 % 2; +result = 1 % 2; +result = 1 % 2; +result = '100%'; + +result += 4; +result += 4; +result -= 4; +result -= 4; +result /= 4; +result /= 4; +result *= 4; +result *= 4; + +$.localScroll({offset: {top: -32}}); + +switch (result) { + case -1: + break; +} + +result = x ? y : z; +result = x ? y : z; + +if (something === true + ^ somethingElse === true +) { + return false; +} + +y = 1 + 2 - 3; + +y = 1 + 2 - 3; + +y = 1 + 2 - 3; + +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true +y = 1 + + 2 + - 3; + +y = 1 + + 2 - + 3; + +y = 1 ++ 2 +- 3; +// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false + +if (true || -1 == b) { +} + +x = x << y; +x <<= y; +x = x >> y; +x >>= y; +x = x >>> y; +x >>>= y; + +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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php new file mode 100644 index 00000000..e34a2ec4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php @@ -0,0 +1,180 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the OperatorSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\OperatorSpacingSniff + */ +final class OperatorSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'OperatorSpacingUnitTest.1.inc': + return [ + 4 => 1, + 5 => 2, + 6 => 1, + 7 => 1, + 8 => 2, + 11 => 1, + 12 => 2, + 13 => 1, + 14 => 1, + 15 => 2, + 18 => 1, + 19 => 2, + 20 => 1, + 21 => 1, + 22 => 2, + 25 => 1, + 26 => 2, + 27 => 1, + 28 => 1, + 29 => 2, + 32 => 1, + 33 => 2, + 34 => 1, + 35 => 1, + 36 => 2, + 40 => 2, + 42 => 2, + 44 => 2, + 45 => 1, + 46 => 2, + 53 => 4, + 54 => 3, + 59 => 10, + 64 => 1, + 77 => 4, + 78 => 1, + 79 => 1, + 80 => 2, + 81 => 1, + 84 => 6, + 85 => 6, + 87 => 4, + 88 => 5, + 90 => 4, + 91 => 5, + 128 => 4, + 132 => 1, + 133 => 1, + 135 => 1, + 136 => 1, + 140 => 1, + 141 => 1, + 174 => 1, + 177 => 1, + 178 => 1, + 179 => 1, + 185 => 2, + 191 => 4, + 194 => 1, + 195 => 1, + 196 => 2, + 199 => 1, + 200 => 1, + 201 => 2, + 239 => 1, + 246 => 1, + 265 => 2, + 266 => 2, + 271 => 2, + 487 => 1, + 488 => 1, + 493 => 1, + 494 => 1, + 499 => 1, + 504 => 1, + ]; + + case 'OperatorSpacingUnitTest.js': + return [ + 4 => 1, + 5 => 2, + 6 => 1, + 7 => 1, + 8 => 2, + 11 => 1, + 12 => 2, + 13 => 1, + 14 => 1, + 15 => 2, + 18 => 1, + 19 => 2, + 20 => 1, + 21 => 1, + 22 => 2, + 25 => 1, + 26 => 2, + 27 => 1, + 28 => 1, + 29 => 2, + 32 => 1, + 33 => 2, + 34 => 1, + 35 => 1, + 36 => 2, + 40 => 2, + 42 => 2, + 44 => 2, + 45 => 1, + 46 => 2, + 55 => 4, + 65 => 1, + 66 => 1, + 68 => 1, + 69 => 1, + 73 => 1, + 74 => 1, + 100 => 1, + 103 => 2, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js new file mode 100644 index 00000000..15890b96 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js @@ -0,0 +1,40 @@ +var x = { + b: 'x', + xasd: x, + abc:x, + a: function () { + alert('thats right'); + x = (x?a:x); + }, + casdasd : 123123, + omgwtfbbq: { + a: 1, + b: 2 + } +}; + +id = id.replace(/row\/:/gi, ''); + +outer_loop: +for (i=0; i<3; i++) { + for (j=0; j<5; j++) { + if (j==x) + break outer_loop; + } +} +alert('hi'); + +even_number: if ((i % 2) == 0) { + if (i == 12) + break even_number; +} + +switch (blah) { + case dfx.DOM_VK_LEFT: + this.caretLeft(shiftKey); + break; + default: + if (blah) { + } + break; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed new file mode 100644 index 00000000..f332878e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed @@ -0,0 +1,39 @@ +var x = { + b: 'x', + xasd: x, + abc: x, + a: function () { + alert('thats right'); + x = (x?a:x); + }, + casdasd: 123123, + omgwtfbbq: { + a: 1, + b: 2 + } +}; + +id = id.replace(/row\/:/gi, ''); + +outer_loop: for (i=0; i<3; i++) { + for (j=0; j<5; j++) { + if (j==x) + break outer_loop; + } +} +alert('hi'); + +even_number: if ((i % 2) == 0) { + if (i == 12) + break even_number; +} + +switch (blah) { + case dfx.DOM_VK_LEFT: + this.caretLeft(shiftKey); + break; + default: + if (blah) { + } + break; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php new file mode 100644 index 00000000..5c20b001 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php @@ -0,0 +1,60 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the PropertyLabel sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\PropertyLabelSpacingSniff + */ +final class PropertyLabelSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 2 => 1, + 4 => 1, + 9 => 2, + 10 => 1, + 12 => 1, + 18 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc new file mode 100644 index 00000000..ecae5c6d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc @@ -0,0 +1,134 @@ +{$property} =& new $class_name($this->db_index); + $this->modules[$module] =& $this->{$property}; +} + +foreach ($elements as $element) { + if ($something) { + // Do IF. + } else if ($somethingElse) { + // Do ELSE. + } +} + +if ($token['code'] === T_COMMENT + && $multiLineComment === false + && (substr($token['content'], 0, 2) === '//' + || $token['content']{0} === '#') +) { +} + +switch ($blah) { + case 'one': + echo 'one'; + break; + default: + echo 'another'; +} + +?> + +getRow()): ?> +

    + + + +
    + +

    o hai!

    + +
    + + + + + + + + + + + + $x + $y; + +$match = match ($test) { 1 => 'a', 2 => 'b' }; + +$match = match ($test) { + 1 => 'a', + 2 => 'b' + }; + +?> + +
    + +
    + +{$property} =& new $class_name($this->db_index); + $this->modules[$module] =& $this->{$property}; +} + +foreach ($elements as $element) { + if ($something) { + // Do IF. + } else if ($somethingElse) { + // Do ELSE. + } +} + +if ($token['code'] === T_COMMENT + && $multiLineComment === false + && (substr($token['content'], 0, 2) === '//' + || $token['content']{0} === '#') +) { +} + +switch ($blah) { + case 'one': + echo 'one'; + break; + default: + echo 'another'; +} + +?> + +getRow()): ?> +

    + + + +
    + +

    o hai!

    + +
    + + + + + + + + + + + + $x + $y; + +$match = match ($test) { 1 => 'a', 2 => 'b' +}; + +$match = match ($test) { + 1 => 'a', + 2 => 'b' +}; + +?> + +
    + +
    + + + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ScopeClosingBrace sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff + */ +final class ScopeClosingBraceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 11 => 1, + 13 => 1, + 24 => 1, + 80 => 1, + 102 => 1, + 111 => 1, + 116 => 1, + 122 => 1, + 130 => 1, + 134 => 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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc new file mode 100644 index 00000000..1d3ccebc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc @@ -0,0 +1,149 @@ + 'a', 'b' => 'b' ), + $varQ = 'string', + $varR = 123; + + // Intentionally missing a semicolon for testing. + public + $varS, + $varT +} + +// Issue #3188 - static as return type. +public static function fCreate($attributes = []): static +{ + return static::factory()->create($attributes); +} + +public static function fCreate($attributes = []): ?static +{ + return static::factory()->create($attributes); +} + +// Also account for static used within union types. +public function staticLast($attributes = []): object|static {} +public function staticMiddle(): string|static|object {} +public function staticFirst(): static|object {} + +// Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled. +$callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; }; + +class TypedProperties { + public + int $var; + + protected string $stringA, $stringB; + + private bool + $boolA, + $boolB; +} + +// PHP 8.0 constructor property promotion. +class ConstructorPropertyPromotionTest { + public function __construct( + public $x = 0.0, + protected $y = '', + private $z = null, + $normalParam, + ) {} +} + +class ConstructorPropertyPromotionWithTypesTest { + public function __construct(protected float|int $x, public?string &$y = 'test', private mixed $z) {} +} + +// PHP 8.1 readonly keywords. +class ReadonlyTest { + public readonly int $publicReadonlyProperty; + + protected readonly int $protectedReadonlyProperty; + + readonly protected int $protectedReadonlyProperty; + + readonly private int $privateReadonlyProperty; + + public function __construct(readonly protected float|int $x, public readonly?string &$y = 'test') {} +} + +// PHP 8.2 readonly classes. +readonly class ReadonlyClassTest {} +readonly class ReadonlyClassTest {} + +// PHP 8.3 readonly anonymous classes. +$anon = new readonly class {}; +$anon = new readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed new file mode 100644 index 00000000..d4e8a39e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed @@ -0,0 +1,143 @@ + 'a', 'b' => 'b' ), + $varQ = 'string', + $varR = 123; + + // Intentionally missing a semicolon for testing. + public + $varS, + $varT +} + +// Issue #3188 - static as return type. +public static function fCreate($attributes = []): static +{ + return static::factory()->create($attributes); +} + +public static function fCreate($attributes = []): ?static +{ + return static::factory()->create($attributes); +} + +// Also account for static used within union types. +public function staticLast($attributes = []): object|static {} +public function staticMiddle(): string|static|object {} +public function staticFirst(): static|object {} + +// Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled. +$callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; }; + +class TypedProperties { + public int $var; + + protected string $stringA, $stringB; + + private bool + $boolA, + $boolB; +} + +// PHP 8.0 constructor property promotion. +class ConstructorPropertyPromotionTest { + public function __construct( + public $x = 0.0, + protected $y = '', + private $z = null, + $normalParam, + ) {} +} + +class ConstructorPropertyPromotionWithTypesTest { + public function __construct(protected float|int $x, public ?string &$y = 'test', private mixed $z) {} +} + +// PHP 8.1 readonly keywords. +class ReadonlyTest { + public readonly int $publicReadonlyProperty; + + protected readonly int $protectedReadonlyProperty; + + readonly protected int $protectedReadonlyProperty; + + readonly private int $privateReadonlyProperty; + + public function __construct(readonly protected float|int $x, public readonly ?string &$y = 'test') {} +} + +// PHP 8.2 readonly classes. +readonly class ReadonlyClassTest {} +readonly class ReadonlyClassTest {} + +// PHP 8.3 readonly anonymous classes. +$anon = new readonly class {}; +$anon = new readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.2.inc new file mode 100644 index 00000000..45cfb534 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.2.inc @@ -0,0 +1,6 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ScopeKeywordSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff + */ +final class ScopeKeywordSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ScopeKeywordSpacingUnitTest.1.inc': + return [ + 7 => 2, + 8 => 1, + 13 => 1, + 14 => 1, + 15 => 1, + 17 => 2, + 26 => 1, + 28 => 1, + 29 => 1, + 64 => 1, + 67 => 1, + 71 => 1, + 103 => 1, + 106 => 1, + 111 => 1, + 119 => 1, + 121 => 1, + 127 => 2, + 134 => 2, + 138 => 2, + 140 => 3, + 145 => 1, + 149 => 1, + ]; + + case 'ScopeKeywordSpacingUnitTest.3.inc': + return [6 => 1]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc new file mode 100644 index 00000000..60f87e5b --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc @@ -0,0 +1,42 @@ +testThis(); +$test = $this->testThis() ; +$test = $this->testThis() ; +for ($var = 1 ; $var < 10 ; $var++) { + echo $var ; +} +$test = $this->testThis() /* comment here */; +$test = $this->testThis() /* comment here */ ; + +$hello ='foo'; +; + +$sum = $a /* + $b */; +$sum = $a // + $b +; +$sum = $a /* + $b + + $c */ ; + +/* + * Test that the sniff does *not* throw incorrect errors for semicolons in + * "empty" parts of a `for` control structure. + */ +for ($i = 1; ; $i++) {} +for ( ; $ptr >= 0; $ptr-- ) {} +for ( ; ; ) {} + +// But it should when the semicolon in a `for` follows a comment (but shouldn't move the semicolon). +for ( /* Deliberately left empty. */ ; $ptr >= 0; $ptr-- ) {} +for ( $i = 1 ; /* Deliberately left empty. */ ; $i++ ) {} + +switch ($foo) { + case 'foo': + ; + break + ; +} + +// This is an empty statement and should be ignored. +if ($foo) { +; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed new file mode 100644 index 00000000..b4dc0f13 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed @@ -0,0 +1,41 @@ +testThis(); +$test = $this->testThis(); +$test = $this->testThis(); +for ($var = 1; $var < 10; $var++) { + echo $var; +} +$test = $this->testThis(); /* comment here */ +$test = $this->testThis(); /* comment here */ + +$hello ='foo'; +; + +$sum = $a; /* + $b */ +$sum = $a; // + $b + +$sum = $a; /* + $b + + $c */ + +/* + * Test that the sniff does *not* throw incorrect errors for semicolons in + * "empty" parts of a `for` control structure. + */ +for ($i = 1; ; $i++) {} +for ( ; $ptr >= 0; $ptr-- ) {} +for ( ; ; ) {} + +// But it should when the semicolon in a `for` follows a comment (but shouldn't move the semicolon). +for ( /* Deliberately left empty. */; $ptr >= 0; $ptr-- ) {} +for ( $i = 1; /* Deliberately left empty. */; $i++ ) {} + +switch ($foo) { + case 'foo': + ; + break; +} + +// This is an empty statement and should be ignored. +if ($foo) { +; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js new file mode 100644 index 00000000..3aafd6da --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js @@ -0,0 +1,25 @@ +var x = { + a: function () { + alert('thats right') ; + x = (x?a:x) ; + }, +} ; + +id = id.replace(/row\/:;/gi, ''); + +for (i=0 ; i<3 ; i++) { + for (j=0; j<5 ; j++) { + if (j==x) + break ; + } +} +alert('hi'); +; + +var sum = a /* + b */; + +var sum = a // +b +; + +var sum = a /* +b + + c */ ; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed new file mode 100644 index 00000000..a547144d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed @@ -0,0 +1,25 @@ +var x = { + a: function () { + alert('thats right'); + x = (x?a:x); + }, +}; + +id = id.replace(/row\/:;/gi, ''); + +for (i=0; i<3; i++) { + for (j=0; j<5; j++) { + if (j==x) + break; + } +} +alert('hi'); +; + +var sum = a; /* + b */ + +var sum = a; // +b + + +var sum = a; /* +b + + c */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php new file mode 100644 index 00000000..218666dc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php @@ -0,0 +1,87 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SemicolonSpacing sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SemicolonSpacingSniff + */ +final class SemicolonSpacingUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'SemicolonSpacingUnitTest.inc': + return [ + 3 => 1, + 4 => 1, + 5 => 2, + 6 => 1, + 8 => 1, + 9 => 1, + 14 => 1, + 16 => 1, + 18 => 1, + 29 => 1, + 30 => 2, + 36 => 1, + ]; + + case 'SemicolonSpacingUnitTest.js': + return [ + 3 => 1, + 4 => 1, + 6 => 1, + 10 => 2, + 11 => 1, + 13 => 1, + 19 => 1, + 22 => 1, + 25 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css new file mode 100644 index 00000000..e3f3f029 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css @@ -0,0 +1,32 @@ + +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} + +.HelpWidgetType-new-bug-title{ + float: left; +} + +/* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true */ +.HelpWidgetType-new-bug-title{ + float: left; +} + +.HelpWidgetType-new-bug-title{ + 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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed new file mode 100644 index 00000000..11be21d5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed @@ -0,0 +1,30 @@ +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} +.HelpWidgetType-new-bug-title { + float: left; +} + +.HelpWidgetType-new-bug-title{ + float: left; +} + +/* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true */ +.HelpWidgetType-new-bug-title{ + float: left; +} + +.HelpWidgetType-new-bug-title{ + 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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc new file mode 100644 index 00000000..f9dca29a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc @@ -0,0 +1,74 @@ + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed new file mode 100644 index 00000000..1d764ebf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed @@ -0,0 +1,68 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js new file mode 100644 index 00000000..be542e77 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js @@ -0,0 +1,56 @@ + +alert('hi'); +alert('hello'); + +if (something) { + +} + + +function myFunction() +{ + alert('code here'); + + alert('code here'); + + + // Hello. + + /* + HI + */ + + +} + +function myFunction2() +{ + alert('code here'); + + + alert('code here'); + +} + +MyFunction = function() +{ + alert('code here'); + + + alert('code here'); + +}; + +// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true + +function myFunction2() +{ + alert('code here'); + + alert('code here'); + +} + +// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed new file mode 100644 index 00000000..960111a5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed @@ -0,0 +1,50 @@ +alert('hi'); +alert('hello'); + +if (something) { + +} + + +function myFunction() +{ + alert('code here'); + + alert('code here'); + + // Hello. + + /* + HI + */ + +} + +function myFunction2() +{ + alert('code here'); + + alert('code here'); + +} + +MyFunction = function() +{ + alert('code here'); + + alert('code here'); + +}; + +// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true + +function myFunction2() +{ + alert('code here'); + + alert('code here'); + +} + +// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css new file mode 100644 index 00000000..2025eeb1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css @@ -0,0 +1,3 @@ +.HelpWidgetType-new-bug-title { + float: left; +} \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed new file mode 100644 index 00000000..2025eeb1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed @@ -0,0 +1,3 @@ +.HelpWidgetType-new-bug-title { + float: left; +} \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc new file mode 100644 index 00000000..a6e2b8ad --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc @@ -0,0 +1,9 @@ + + +

    + +

    + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed new file mode 100644 index 00000000..78c45251 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed @@ -0,0 +1,7 @@ + +

    + +

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js new file mode 100644 index 00000000..7b0c8eac --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js @@ -0,0 +1 @@ +alert('hi'); \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed new file mode 100644 index 00000000..7b0c8eac --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed @@ -0,0 +1 @@ +alert('hi'); \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css new file mode 100644 index 00000000..9f794a08 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css @@ -0,0 +1,3 @@ +.HelpWidgetType-new-bug-title { + float: left; +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed new file mode 100644 index 00000000..2025eeb1 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed @@ -0,0 +1,3 @@ +.HelpWidgetType-new-bug-title { + float: left; +} \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc new file mode 100644 index 00000000..661ebdaf --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed new file mode 100644 index 00000000..0cb97480 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed @@ -0,0 +1,5 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js new file mode 100644 index 00000000..70f67193 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js @@ -0,0 +1 @@ +alert('hi'); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed new file mode 100644 index 00000000..70f67193 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed @@ -0,0 +1 @@ +alert('hi'); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc new file mode 100644 index 00000000..96860ffb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed new file mode 100644 index 00000000..b26b5b2c --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc new file mode 100644 index 00000000..4d6f06bc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc @@ -0,0 +1,5 @@ +   +  \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed new file mode 100644 index 00000000..8ec5f30d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php new file mode 100644 index 00000000..4f7c7cdb --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php @@ -0,0 +1,117 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the SuperfluousWhitespace sniff. + * + * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff + */ +final class SuperfluousWhitespaceUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'SuperfluousWhitespaceUnitTest.1.inc': + return [ + 2 => 1, + 4 => 1, + 5 => 1, + 6 => 1, + 7 => 1, + 16 => 1, + 23 => 1, + 28 => 1, + 33 => 1, + 49 => 1, + 62 => 1, + 65 => 1, + 73 => 1, + ]; + + case 'SuperfluousWhitespaceUnitTest.2.inc': + return [ + 2 => 1, + 8 => 1, + ]; + + case 'SuperfluousWhitespaceUnitTest.3.inc': + return [ + 6 => 1, + 10 => 1, + ]; + + case 'SuperfluousWhitespaceUnitTest.4.inc': + case 'SuperfluousWhitespaceUnitTest.5.inc': + return [ + 1 => 1, + 4 => 1, + ]; + + case 'SuperfluousWhitespaceUnitTest.1.js': + return [ + 1 => 1, + 3 => 1, + 4 => 1, + 5 => 1, + 6 => 1, + 15 => 1, + 22 => 1, + 29 => 1, + 38 => 1, + 56 => 1, + ]; + + case 'SuperfluousWhitespaceUnitTest.1.css': + return [ + 1 => 1, + 8 => 1, + 9 => 1, + 11 => 1, + 32 => 1, + ]; + + default: + return []; + }//end switch + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml new file mode 100644 index 00000000..87ab4c3e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml @@ -0,0 +1,132 @@ + + + The Squiz coding standard. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + %2$s + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + + + + + + 0 + + + error + + + + + 0 + + + error + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml new file mode 100644 index 00000000..c462b4f8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml @@ -0,0 +1,25 @@ + + + + + + + $bar + $baz; +} + ]]> + + + $bar + 2; +} + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml new file mode 100644 index 00000000..aa60b8ab --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml @@ -0,0 +1,22 @@ + + + + + + + + + + ?> + ]]> + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml new file mode 100644 index 00000000..5bcde4b8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml @@ -0,0 +1,37 @@ + + + + + + + $testNumber = 1; + ]]> + + + $Test_Number = 1; + ]]> + + + + + _bar; +} + ]]> + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php new file mode 100644 index 00000000..454f665a --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php @@ -0,0 +1,100 @@ + + * @author Greg Sherwood + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * + * @deprecated 3.9.0 + */ + +namespace PHP_CodeSniffer\Standards\Zend\Sniffs\Debug; + +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Exceptions\RuntimeException; +use PHP_CodeSniffer\Util\Common; + +class CodeAnalyzerSniff implements Sniff +{ + + + /** + * Returns the token types that this sniff is interested in. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes the tokens that this sniff is interested in. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. + * @param int $stackPtr The position in the stack where + * the token was found. + * + * @return int + * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If ZendCodeAnalyzer could not be run. + */ + public function process(File $phpcsFile, $stackPtr) + { + $analyzerPath = Config::getExecutablePath('zend_ca'); + if ($analyzerPath === null) { + return $phpcsFile->numTokens; + } + + $fileName = $phpcsFile->getFilename(); + + // In the command, 2>&1 is important because the code analyzer sends its + // findings to stderr. $output normally contains only stdout, so using 2>&1 + // will pipe even stderr to stdout. + $cmd = Common::escapeshellcmd($analyzerPath).' '.escapeshellarg($fileName).' 2>&1'; + + // There is the possibility to pass "--ide" as an option to the analyzer. + // This would result in an output format which would be easier to parse. + // The problem here is that no cleartext error messages are returned; only + // error-code-labels. So for a start we go for cleartext output. + $exitCode = exec($cmd, $output, $retval); + + // Variable $exitCode is the last line of $output if no error occurs, on + // error it is numeric. Try to handle various error conditions and + // provide useful error reporting. + if (is_numeric($exitCode) === true && $exitCode > 0) { + if (is_array($output) === true) { + $msg = implode('\n', $output); + } + + throw new RuntimeException("Failed invoking ZendCodeAnalyzer, exitcode was [$exitCode], retval was [$retval], output was [$msg]"); + } + + if (is_array($output) === true) { + foreach ($output as $finding) { + // The first two lines of analyzer output contain + // something like this: + // > Zend Code Analyzer 1.2.2 + // > Analyzing ... + // So skip these... + $res = preg_match("/^.+\(line ([0-9]+)\):(.+)$/", $finding, $regs); + if (empty($regs) === true || $res === false) { + continue; + } + + $phpcsFile->addWarningOnLine(trim($regs[2]), $regs[1], 'ExternalTool'); + } + } + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php new file mode 100644 index 00000000..7b547bfd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php @@ -0,0 +1,79 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Zend\Sniffs\Files; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; +use PHP_CodeSniffer\Util\Tokens; + +class ClosingTagSniff implements Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return [T_OPEN_TAG]; + + }//end register() + + + /** + * Processes this sniff, when one of its tokens is encountered. + * + * @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 + */ + public function process(File $phpcsFile, $stackPtr) + { + // Find the last non-empty token. + $tokens = $phpcsFile->getTokens(); + for ($last = ($phpcsFile->numTokens - 1); $last > 0; $last--) { + if (trim($tokens[$last]['content']) !== '') { + break; + } + } + + if ($tokens[$last]['code'] === T_CLOSE_TAG) { + $error = 'A closing tag is not permitted at the end of a PHP file'; + $fix = $phpcsFile->addFixableError($error, $last, 'NotAllowed'); + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($last, $phpcsFile->eolChar); + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($last - 1), null, true); + if ($tokens[$prev]['code'] !== T_SEMICOLON + && $tokens[$prev]['code'] !== T_CLOSE_CURLY_BRACKET + && $tokens[$prev]['code'] !== T_OPEN_TAG + ) { + $phpcsFile->fixer->addContent($prev, ';'); + } + + $phpcsFile->fixer->endChangeset(); + } + + $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at EOF', 'yes'); + } else { + $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at EOF', 'no'); + }//end if + + // Ignore the rest of the file. + return $phpcsFile->numTokens; + + }//end process() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php new file mode 100644 index 00000000..41b19481 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php @@ -0,0 +1,196 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; +use PHP_CodeSniffer\Util\Common; +use PHP_CodeSniffer\Util\Tokens; + +class ValidVariableNameSniff extends AbstractVariableSniff +{ + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + protected function processVariable(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $varName = ltrim($tokens[$stackPtr]['content'], '$'); + + // If it's a php reserved var, then its ok. + if (isset($this->phpReservedVars[$varName]) === true) { + return; + } + + $objOperator = $phpcsFile->findNext([T_WHITESPACE], ($stackPtr + 1), null, true); + if ($tokens[$objOperator]['code'] === T_OBJECT_OPERATOR + || $tokens[$objOperator]['code'] === T_NULLSAFE_OBJECT_OPERATOR + ) { + // Check to see if we are using a variable from an object. + $var = $phpcsFile->findNext([T_WHITESPACE], ($objOperator + 1), null, true); + if ($tokens[$var]['code'] === T_STRING) { + // Either a var name or a function call, so check for bracket. + $bracket = $phpcsFile->findNext([T_WHITESPACE], ($var + 1), null, true); + + if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) { + $objVarName = $tokens[$var]['content']; + + // There is no way for us to know if the var is public or private, + // so we have to ignore a leading underscore if there is one and just + // check the main part of the variable name. + $originalVarName = $objVarName; + if (substr($objVarName, 0, 1) === '_') { + $objVarName = substr($objVarName, 1); + } + + if (Common::isCamelCaps($objVarName, false, true, false) === false) { + $error = 'Variable "%s" is not in valid camel caps format'; + $data = [$originalVarName]; + $phpcsFile->addError($error, $var, 'NotCamelCaps', $data); + } else if (preg_match('|\d|', $objVarName) === 1) { + $warning = 'Variable "%s" contains numbers but this is discouraged'; + $data = [$originalVarName]; + $phpcsFile->addWarning($warning, $stackPtr, 'ContainsNumbers', $data); + } + }//end if + }//end if + }//end if + + // There is no way for us to know if the var is public or private, + // so we have to ignore a leading underscore if there is one and just + // check the main part of the variable name. + $originalVarName = $varName; + if (substr($varName, 0, 1) === '_') { + $objOperator = $phpcsFile->findPrevious([T_WHITESPACE], ($stackPtr - 1), null, true); + if ($tokens[$objOperator]['code'] === T_DOUBLE_COLON) { + // The variable lives within a class, and is referenced like + // this: MyClass::$_variable, so we don't know its scope. + $inClass = true; + } else { + $inClass = $phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens); + } + + if ($inClass === true) { + $varName = substr($varName, 1); + } + } + + if (Common::isCamelCaps($varName, false, true, false) === false) { + $error = 'Variable "%s" is not in valid camel caps format'; + $data = [$originalVarName]; + $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); + } else if (preg_match('|\d|', $varName) === 1) { + $warning = 'Variable "%s" contains numbers but this is discouraged'; + $data = [$originalVarName]; + $phpcsFile->addWarning($warning, $stackPtr, 'ContainsNumbers', $data); + } + + }//end processVariable() + + + /** + * Processes class member variables. + * + * @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 + */ + protected function processMemberVar(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $varName = ltrim($tokens[$stackPtr]['content'], '$'); + $memberProps = $phpcsFile->getMemberProperties($stackPtr); + if (empty($memberProps) === true) { + // Exception encountered. + return; + } + + $public = ($memberProps['scope'] === 'public'); + + if ($public === true) { + if (substr($varName, 0, 1) === '_') { + $error = 'Public member variable "%s" must not contain a leading underscore'; + $data = [$varName]; + $phpcsFile->addError($error, $stackPtr, 'PublicHasUnderscore', $data); + } + } else { + if (substr($varName, 0, 1) !== '_') { + $scope = ucfirst($memberProps['scope']); + $error = '%s member variable "%s" must contain a leading underscore'; + $data = [ + $scope, + $varName, + ]; + $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $data); + } + } + + // Remove a potential underscore prefix for testing CamelCaps. + $varName = ltrim($varName, '_'); + + if (Common::isCamelCaps($varName, false, true, false) === false) { + $error = 'Member variable "%s" is not in valid camel caps format'; + $data = [$varName]; + $phpcsFile->addError($error, $stackPtr, 'MemberVarNotCamelCaps', $data); + } else if (preg_match('|\d|', $varName) === 1) { + $warning = 'Member variable "%s" contains numbers but this is discouraged'; + $data = [$varName]; + $phpcsFile->addWarning($warning, $stackPtr, 'MemberVarContainsNumbers', $data); + } + + }//end processMemberVar() + + + /** + * Processes the variable found within a double quoted string. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the double quoted + * string. + * + * @return void + */ + protected function processVariableInString(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (preg_match_all('|[^\\\]\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|', $tokens[$stackPtr]['content'], $matches) !== 0) { + foreach ($matches[1] as $varName) { + // If it's a php reserved var, then its ok. + if (isset($this->phpReservedVars[$varName]) === true) { + continue; + } + + if (Common::isCamelCaps($varName, false, true, false) === false) { + $error = 'Variable "%s" is not in valid camel caps format'; + $data = [$varName]; + $phpcsFile->addError($error, $stackPtr, 'StringVarNotCamelCaps', $data); + } else if (preg_match('|\d|', $varName) === 1) { + $warning = 'Variable "%s" contains numbers but this is discouraged'; + $data = [$varName]; + $phpcsFile->addWarning($warning, $stackPtr, 'StringVarContainsNumbers', $data); + } + }//end foreach + }//end if + + }//end processVariableInString() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc new file mode 100644 index 00000000..c8d0499d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc @@ -0,0 +1,6 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php new file mode 100644 index 00000000..82781a7d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php @@ -0,0 +1,71 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Zend\Tests\Debug; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; +use PHP_CodeSniffer\Config; + +/** + * Unit test class for the CodeAnalyzer sniff. + * + * @covers \PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff + */ +final class CodeAnalyzerUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Should this test be skipped for some reason. + * + * @return bool + */ + protected function shouldSkipTest() + { + $analyzerPath = Config::getExecutablePath('zend_ca'); + if ($analyzerPath === null) { + return true; + } + + return false; + + }//end shouldSkipTest() + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return []; + + }//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. + * + * @return array + */ + public function getWarningList() + { + return [2 => 1]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc new file mode 100644 index 00000000..7e7089dc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc @@ -0,0 +1,12 @@ + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed new file mode 100644 index 00000000..caf3b38e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed @@ -0,0 +1,12 @@ + + +

    + +
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc new file mode 100644 index 00000000..63df04d5 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc @@ -0,0 +1 @@ +add('arg'))?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed new file mode 100644 index 00000000..b4c46219 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed @@ -0,0 +1 @@ +add('arg')); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc new file mode 100644 index 00000000..539365da --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc @@ -0,0 +1 @@ +add('arg')) /* comment */ ?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed new file mode 100644 index 00000000..4cc31a51 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed @@ -0,0 +1 @@ +add('arg')); /* comment */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc new file mode 100644 index 00000000..09e48440 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc @@ -0,0 +1 @@ +add('arg')); } ?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed new file mode 100644 index 00000000..9ff112a4 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed @@ -0,0 +1 @@ +add('arg')); } diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc new file mode 100644 index 00000000..48de7e03 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc @@ -0,0 +1,3 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed new file mode 100644 index 00000000..796727a8 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed @@ -0,0 +1,3 @@ + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed new file mode 100644 index 00000000..dc84e23e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed @@ -0,0 +1 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Zend\Tests\Files; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ClosingTag sniff. + * + * @covers \PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff + */ +final class ClosingTagUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @param string $testFile The name of the file being tested. + * + * @return array + */ + public function getErrorList($testFile='') + { + switch ($testFile) { + case 'ClosingTagUnitTest.1.inc': + return [11 => 1]; + + case 'ClosingTagUnitTest.3.inc': + case 'ClosingTagUnitTest.4.inc': + case 'ClosingTagUnitTest.5.inc': + case 'ClosingTagUnitTest.7.inc': + return [1 => 1]; + + case 'ClosingTagUnitTest.6.inc': + return [3 => 1]; + + default: + return []; + } + + }//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. + * + * @return array + */ + public function getWarningList() + { + return []; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc new file mode 100644 index 00000000..3325e115 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc @@ -0,0 +1,131 @@ +varName; +echo $this->var_name; +echo $this->varname; +echo $this->_varName; +echo $this->varName2; +echo $object->varName; +echo $object->var_name; +echo $object->varName2; +echo $object_name->varname; +echo $object_name->_varName; +echo $object_name->varName2; + +echo $this->myFunction($one, $two); +echo $object->myFunction($one_two, $var2); + +$error = "format is \$GLOBALS['$varName']"; +$error = "format is \$GLOBALS['$varName2']"; + +echo $_SESSION['var_name']; +echo $_FILES['var_name']; +echo $_ENV['var_name']; +echo $_COOKIE['var_name']; +echo $_COOKIE['var_name2']; + +$XML = 'hello'; +$myXML = 'hello'; +$XMLParser = 'hello'; +$xmlParser = 'hello'; +$xmlParser2 = 'hello'; + +echo "{$_SERVER['HOSTNAME']} $var_name"; + +$someObject->{$name}; +$someObject->my_function($var_name); + +var_dump($http_response_header); +var_dump($HTTP_RAW_POST_DATA); +var_dump($php_errormsg); + +interface Base +{ + protected $anonymous; + + public function __construct(); +} + +$anonClass = new class() { + public function foo($foo, $_foo, $foo_bar) { + $bar = 1; + $_bar = 2; + $bar_foo = 3; + } +}; + +echo $obj?->varName; +echo $obj?->var_name; +echo $obj?->varName; + +enum SomeEnum +{ + public function foo($foo, $_foo, $foo_bar) { + $bar = 1; + $_bar = 2; + $bar_foo = 3; + } +} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php new file mode 100644 index 00000000..c66a2a42 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php @@ -0,0 +1,102 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Standards\Zend\Tests\NamingConventions; + +use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; + +/** + * Unit test class for the ValidVariableName sniff. + * + * @covers \PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions\ValidVariableNameSniff + */ +final class ValidVariableNameUnitTest extends AbstractSniffUnitTest +{ + + + /** + * Returns the lines where errors should occur. + * + * The key of the array should represent the line number and the value + * should represent the number of errors that should occur on that line. + * + * @return array + */ + public function getErrorList() + { + return [ + 3 => 1, + 5 => 1, + 11 => 1, + 13 => 1, + 17 => 1, + 19 => 1, + 23 => 1, + 25 => 1, + 29 => 1, + 31 => 1, + 36 => 1, + 38 => 1, + 42 => 1, + 44 => 1, + 48 => 1, + 50 => 1, + 61 => 1, + 67 => 1, + 72 => 1, + 74 => 1, + 75 => 1, + 76 => 1, + 79 => 1, + 96 => 1, + 99 => 1, + 113 => 1, + 116 => 1, + 121 => 1, + 126 => 1, + 129 => 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. + * + * @return array + */ + public function getWarningList() + { + return [ + 6 => 1, + 14 => 1, + 20 => 1, + 26 => 1, + 32 => 1, + 39 => 1, + 45 => 1, + 51 => 1, + 64 => 1, + 70 => 1, + 73 => 1, + 76 => 1, + 79 => 1, + 82 => 1, + 94 => 1, + // Warning from getMemberProperties() about parse error. + 107 => 1, + ]; + + }//end getWarningList() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml new file mode 100644 index 00000000..d10b1039 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml @@ -0,0 +1,32 @@ + + + A coding standard based on an early Zend Framework coding standard. Note that this standard is out of date. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php new file mode 100644 index 00000000..36631ddc --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php @@ -0,0 +1,541 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tokenizers; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Exceptions\TokenizerException; +use PHP_CodeSniffer\Util; + +class CSS extends PHP +{ + + + /** + * Initialise the tokenizer. + * + * Pre-checks the content to see if it looks minified. + * + * @param string $content The content to tokenize. + * @param \PHP_CodeSniffer\Config $config The config data for the run. + * @param string $eolChar The EOL char used in the content. + * + * @return void + * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. + */ + public function __construct($content, Config $config, $eolChar='\n') + { + if ($this->isMinifiedContent($content, $eolChar) === true) { + throw new TokenizerException('File appears to be minified and cannot be processed'); + } + + parent::__construct($content, $config, $eolChar); + + }//end __construct() + + + /** + * Creates an array of tokens when given some CSS code. + * + * Uses the PHP tokenizer to do all the tricky work + * + * @param string $string The string to tokenize. + * + * @return array + */ + public function tokenize($string) + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** START CSS TOKENIZING 1ST PASS ***".PHP_EOL; + } + + // If the content doesn't have an EOL char on the end, add one so + // the open and close tags we add are parsed correctly. + $eolAdded = false; + if (substr($string, (strlen($this->eolChar) * -1)) !== $this->eolChar) { + $string .= $this->eolChar; + $eolAdded = true; + } + + $string = str_replace('', '^PHPCS_CSS_T_CLOSE_TAG^', $string); + $tokens = parent::tokenize(''); + + $finalTokens = []; + $finalTokens[0] = [ + 'code' => T_OPEN_TAG, + 'type' => 'T_OPEN_TAG', + 'content' => '', + ]; + + $newStackPtr = 1; + $numTokens = count($tokens); + $multiLineComment = false; + for ($stackPtr = 1; $stackPtr < $numTokens; $stackPtr++) { + $token = $tokens[$stackPtr]; + + // CSS files don't have lists, breaks etc, so convert these to + // standard strings early so they can be converted into T_STYLE + // tokens and joined with other strings if needed. + if ($token['code'] === T_BREAK + || $token['code'] === T_LIST + || $token['code'] === T_DEFAULT + || $token['code'] === T_SWITCH + || $token['code'] === T_FOR + || $token['code'] === T_FOREACH + || $token['code'] === T_WHILE + || $token['code'] === T_DEC + || $token['code'] === T_NEW + ) { + $token['type'] = 'T_STRING'; + $token['code'] = T_STRING; + } + + $token['content'] = str_replace('^PHPCS_CSS_T_OPEN_TAG^', '', $token['content']); + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $token['type']; + $content = Util\Common::prepareForOutput($token['content']); + echo "\tProcess token $stackPtr: $type => $content".PHP_EOL; + } + + if ($token['code'] === T_BITWISE_XOR + && $tokens[($stackPtr + 1)]['content'] === 'PHPCS_CSS_T_OPEN_TAG' + ) { + $content = ''; + $stackPtr += 2; + break; + } else { + $content .= $tokens[$stackPtr]['content']; + } + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t=> Found embedded PHP code: "; + $cleanContent = Util\Common::prepareForOutput($content); + echo $cleanContent.PHP_EOL; + } + + $finalTokens[$newStackPtr] = [ + 'type' => 'T_EMBEDDED_PHP', + 'code' => T_EMBEDDED_PHP, + 'content' => $content, + ]; + + $newStackPtr++; + continue; + }//end if + + if ($token['code'] === T_GOTO_LABEL) { + // Convert these back to T_STRING followed by T_COLON so we can + // more easily process style definitions. + $finalTokens[$newStackPtr] = [ + 'type' => 'T_STRING', + 'code' => T_STRING, + 'content' => substr($token['content'], 0, -1), + ]; + $newStackPtr++; + $finalTokens[$newStackPtr] = [ + 'type' => 'T_COLON', + 'code' => T_COLON, + 'content' => ':', + ]; + $newStackPtr++; + continue; + } + + if ($token['code'] === T_FUNCTION) { + // There are no functions in CSS, so convert this to a string. + $finalTokens[$newStackPtr] = [ + 'type' => 'T_STRING', + 'code' => T_STRING, + 'content' => $token['content'], + ]; + + $newStackPtr++; + continue; + } + + if ($token['code'] === T_COMMENT + && substr($token['content'], 0, 2) === '/*' + ) { + // Multi-line comment. Record it so we can ignore other + // comment tags until we get out of this one. + $multiLineComment = true; + } + + if ($token['code'] === T_COMMENT + && $multiLineComment === false + && (substr($token['content'], 0, 2) === '//' + || $token['content'][0] === '#') + ) { + $content = ltrim($token['content'], '#/'); + + // Guard against PHP7+ syntax errors by stripping + // leading zeros so the content doesn't look like an invalid int. + $leadingZero = false; + if ($content[0] === '0') { + $content = '1'.$content; + $leadingZero = true; + } + + $commentTokens = parent::tokenize(''); + + // The first and last tokens are the open/close tags. + array_shift($commentTokens); + $closeTag = array_pop($commentTokens); + + while ($closeTag['content'] !== '?'.'>') { + $closeTag = array_pop($commentTokens); + } + + if ($leadingZero === true) { + $commentTokens[0]['content'] = substr($commentTokens[0]['content'], 1); + $content = substr($content, 1); + } + + if ($token['content'][0] === '#') { + // The # character is not a comment in CSS files, so + // determine what it means in this context. + $firstContent = $commentTokens[0]['content']; + + // If the first content is just a number, it is probably a + // colour like 8FB7DB, which PHP splits into 8 and FB7DB. + if (($commentTokens[0]['code'] === T_LNUMBER + || $commentTokens[0]['code'] === T_DNUMBER) + && $commentTokens[1]['code'] === T_STRING + ) { + $firstContent .= $commentTokens[1]['content']; + array_shift($commentTokens); + } + + // If the first content looks like a colour and not a class + // definition, join the tokens together. + if (preg_match('/^[ABCDEF0-9]+$/i', $firstContent) === 1 + && $commentTokens[1]['content'] !== '-' + ) { + array_shift($commentTokens); + // Work out what we trimmed off above and remember to re-add it. + $trimmed = substr($token['content'], 0, (strlen($token['content']) - strlen($content))); + $finalTokens[$newStackPtr] = [ + 'type' => 'T_COLOUR', + 'code' => T_COLOUR, + 'content' => $trimmed.$firstContent, + ]; + } else { + $finalTokens[$newStackPtr] = [ + 'type' => 'T_HASH', + 'code' => T_HASH, + 'content' => '#', + ]; + } + } else { + $finalTokens[$newStackPtr] = [ + 'type' => 'T_STRING', + 'code' => T_STRING, + 'content' => '//', + ]; + }//end if + + $newStackPtr++; + + array_splice($tokens, $stackPtr, 1, $commentTokens); + $numTokens = count($tokens); + $stackPtr--; + continue; + }//end if + + if ($token['code'] === T_COMMENT + && substr($token['content'], -2) === '*/' + ) { + // Multi-line comment is done. + $multiLineComment = false; + } + + $finalTokens[$newStackPtr] = $token; + $newStackPtr++; + }//end for + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** END CSS TOKENIZING 1ST PASS ***".PHP_EOL; + echo "\t*** START CSS TOKENIZING 2ND PASS ***".PHP_EOL; + } + + // A flag to indicate if we are inside a style definition, + // which is defined using curly braces. + $inStyleDef = false; + + // A flag to indicate if an At-rule like "@media" is used, which will result + // in nested curly brackets. + $asperandStart = false; + + $numTokens = count($finalTokens); + for ($stackPtr = 0; $stackPtr < $numTokens; $stackPtr++) { + $token = $finalTokens[$stackPtr]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $token['type']; + $content = Util\Common::prepareForOutput($token['content']); + echo "\tProcess token $stackPtr: $type => $content".PHP_EOL; + } + + switch ($token['code']) { + case T_OPEN_CURLY_BRACKET: + // Opening curly brackets for an At-rule do not start a style + // definition. We also reset the asperand flag here because the next + // opening curly bracket could be indeed the start of a style + // definition. + if ($asperandStart === true) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + if ($inStyleDef === true) { + echo "\t\t* style definition closed *".PHP_EOL; + } + + if ($asperandStart === true) { + echo "\t\t* at-rule definition closed *".PHP_EOL; + } + } + + $inStyleDef = false; + $asperandStart = false; + } else { + $inStyleDef = true; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* style definition opened *".PHP_EOL; + } + } + break; + case T_CLOSE_CURLY_BRACKET: + if (PHP_CODESNIFFER_VERBOSITY > 1) { + if ($inStyleDef === true) { + echo "\t\t* style definition closed *".PHP_EOL; + } + + if ($asperandStart === true) { + echo "\t\t* at-rule definition closed *".PHP_EOL; + } + } + + $inStyleDef = false; + $asperandStart = false; + break; + case T_MINUS: + // Minus signs are often used instead of spaces inside + // class names, IDs and styles. + if ($finalTokens[($stackPtr + 1)]['code'] === T_STRING) { + if ($finalTokens[($stackPtr - 1)]['code'] === T_STRING) { + $newContent = $finalTokens[($stackPtr - 1)]['content'].'-'.$finalTokens[($stackPtr + 1)]['content']; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL; + $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']); + $new = Util\Common::prepareForOutput($newContent); + echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL; + } + + $finalTokens[($stackPtr + 1)]['content'] = $newContent; + unset($finalTokens[$stackPtr]); + unset($finalTokens[($stackPtr - 1)]); + } else { + $newContent = '-'.$finalTokens[($stackPtr + 1)]['content']; + + $finalTokens[($stackPtr + 1)]['content'] = $newContent; + unset($finalTokens[$stackPtr]); + } + } else if ($finalTokens[($stackPtr + 1)]['code'] === T_LNUMBER) { + // They can also be used to provide negative numbers. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token is part of a negative number; adding content to next token and ignoring *".PHP_EOL; + $content = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']); + echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$content\" to \"-$content\"".PHP_EOL; + } + + $finalTokens[($stackPtr + 1)]['content'] = '-'.$finalTokens[($stackPtr + 1)]['content']; + unset($finalTokens[$stackPtr]); + }//end if + break; + case T_COLON: + // Only interested in colons that are defining styles. + if ($inStyleDef === false) { + break; + } + + for ($x = ($stackPtr - 1); $x >= 0; $x--) { + if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) { + break; + } + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $finalTokens[$x]['type']; + echo "\t\t=> token $x changed from $type to T_STYLE".PHP_EOL; + } + + $finalTokens[$x]['type'] = 'T_STYLE'; + $finalTokens[$x]['code'] = T_STYLE; + break; + case T_STRING: + if (strtolower($token['content']) === 'url') { + // Find the next content. + for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { + if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) { + break; + } + } + + // Needs to be in the format "url(" for it to be a URL. + if ($finalTokens[$x]['code'] !== T_OPEN_PARENTHESIS) { + continue 2; + } + + // Make sure the content isn't empty. + for ($y = ($x + 1); $y < $numTokens; $y++) { + if (isset(Util\Tokens::$emptyTokens[$finalTokens[$y]['code']]) === false) { + break; + } + } + + if ($finalTokens[$y]['code'] === T_CLOSE_PARENTHESIS) { + continue 2; + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + for ($i = ($stackPtr + 1); $i <= $y; $i++) { + $type = $finalTokens[$i]['type']; + $content = Util\Common::prepareForOutput($finalTokens[$i]['content']); + echo "\tProcess token $i: $type => $content".PHP_EOL; + } + + echo "\t\t* token starts a URL *".PHP_EOL; + } + + // Join all the content together inside the url() statement. + $newContent = ''; + for ($i = ($x + 2); $i < $numTokens; $i++) { + if ($finalTokens[$i]['code'] === T_CLOSE_PARENTHESIS) { + break; + } + + $newContent .= $finalTokens[$i]['content']; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($finalTokens[$i]['content']); + echo "\t\t=> token $i added to URL string and ignored: $content".PHP_EOL; + } + + unset($finalTokens[$i]); + } + + $stackPtr = $i; + + // If the content inside the "url()" is in double quotes + // there will only be one token and so we don't have to do + // anything except change its type. If it is not empty, + // we need to do some token merging. + $finalTokens[($x + 1)]['type'] = 'T_URL'; + $finalTokens[($x + 1)]['code'] = T_URL; + + if ($newContent !== '') { + $finalTokens[($x + 1)]['content'] .= $newContent; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($finalTokens[($x + 1)]['content']); + echo "\t\t=> token content changed to: $content".PHP_EOL; + } + } + } else if ($finalTokens[$stackPtr]['content'][0] === '-' + && $finalTokens[($stackPtr + 1)]['code'] === T_STRING + ) { + if (isset($finalTokens[($stackPtr - 1)]) === true + && $finalTokens[($stackPtr - 1)]['code'] === T_STRING + ) { + $newContent = $finalTokens[($stackPtr - 1)]['content'].$finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content']; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL; + $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']); + $new = Util\Common::prepareForOutput($newContent); + echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL; + } + + $finalTokens[($stackPtr + 1)]['content'] = $newContent; + unset($finalTokens[$stackPtr]); + unset($finalTokens[($stackPtr - 1)]); + } else { + $newContent = $finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content']; + + $finalTokens[($stackPtr + 1)]['content'] = $newContent; + unset($finalTokens[$stackPtr]); + } + }//end if + break; + case T_ASPERAND: + $asperandStart = true; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* at-rule definition opened *".PHP_EOL; + } + break; + default: + // Nothing special to be done with this token. + break; + }//end switch + }//end for + + // Reset the array keys to avoid gaps. + $finalTokens = array_values($finalTokens); + $numTokens = count($finalTokens); + + // Blank out the content of the end tag. + $finalTokens[($numTokens - 1)]['content'] = ''; + + if ($eolAdded === true) { + // Strip off the extra EOL char we added for tokenizing. + $finalTokens[($numTokens - 2)]['content'] = substr( + $finalTokens[($numTokens - 2)]['content'], + 0, + (strlen($this->eolChar) * -1) + ); + + if ($finalTokens[($numTokens - 2)]['content'] === '') { + unset($finalTokens[($numTokens - 2)]); + $finalTokens = array_values($finalTokens); + $numTokens = count($finalTokens); + } + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** END CSS TOKENIZING 2ND PASS ***".PHP_EOL; + } + + return $finalTokens; + + }//end tokenize() + + + /** + * Performs additional processing after main tokenizing. + * + * @return void + */ + public function processAdditional() + { + /* + We override this method because we don't want the PHP version to + run during CSS processing because it is wasted processing time. + */ + + }//end processAdditional() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php new file mode 100644 index 00000000..b7c6e374 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php @@ -0,0 +1,283 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tokenizers; + +use PHP_CodeSniffer\Util\Common; + +class Comment +{ + + + /** + * Creates an array of tokens when given some PHP code. + * + * Starts by using token_get_all() but does a lot of extra processing + * to insert information about the context of the token. + * + * @param string $string The string to tokenize. + * @param string $eolChar The EOL character to use for splitting strings. + * @param int $stackPtr The position of the first token in the file. + * + * @return array>> + */ + public function tokenizeString($string, $eolChar, $stackPtr) + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t*** START COMMENT TOKENIZING ***".PHP_EOL; + } + + $tokens = []; + $numChars = strlen($string); + + /* + Doc block comments start with /*, but typically contain an + extra star when they are used for function and class comments. + */ + + $char = ($numChars - strlen(ltrim($string, '/*'))); + $lastChars = substr($string, -2); + if ($char === $numChars && $lastChars === '*/') { + // Edge case: docblock without whitespace or contents. + $openTag = substr($string, 0, -2); + $string = $lastChars; + } else { + $openTag = substr($string, 0, $char); + $string = ltrim($string, '/*'); + } + + $tokens[$stackPtr] = [ + 'content' => $openTag, + 'code' => T_DOC_COMMENT_OPEN_TAG, + 'type' => 'T_DOC_COMMENT_OPEN_TAG', + 'comment_tags' => [], + ]; + + $openPtr = $stackPtr; + $stackPtr++; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Common::prepareForOutput($openTag); + echo "\t\tCreate comment token: T_DOC_COMMENT_OPEN_TAG => $content".PHP_EOL; + } + + /* + Strip off the close tag so it doesn't interfere with any + of our comment line processing. The token will be added to the + stack just before we return it. + */ + + $closeTag = [ + 'content' => substr($string, strlen(rtrim($string, '/*'))), + 'code' => T_DOC_COMMENT_CLOSE_TAG, + 'type' => 'T_DOC_COMMENT_CLOSE_TAG', + 'comment_opener' => $openPtr, + ]; + + if ($closeTag['content'] === false) { + // In PHP < 8.0 substr() can return `false` instead of always returning a string. + $closeTag['content'] = ''; + } + + $string = rtrim($string, '/*'); + + /* + Process each line of the comment. + */ + + $lines = explode($eolChar, $string); + $numLines = count($lines); + foreach ($lines as $lineNum => $string) { + if ($lineNum !== ($numLines - 1)) { + $string .= $eolChar; + } + + $char = 0; + $numChars = strlen($string); + + // We've started a new line, so process the indent. + $space = $this->collectWhitespace($string, $char, $numChars); + if ($space !== null) { + $tokens[$stackPtr] = $space; + $stackPtr++; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Common::prepareForOutput($space['content']); + echo "\t\tCreate comment token: T_DOC_COMMENT_WHITESPACE => $content".PHP_EOL; + } + + $char += strlen($space['content']); + if ($char === $numChars) { + break; + } + } + + if ($string === '') { + continue; + } + + if ($lineNum > 0 && $string[$char] === '*') { + // This is a function or class doc block line. + $char++; + $tokens[$stackPtr] = [ + 'content' => '*', + 'code' => T_DOC_COMMENT_STAR, + 'type' => 'T_DOC_COMMENT_STAR', + ]; + + $stackPtr++; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\tCreate comment token: T_DOC_COMMENT_STAR => *".PHP_EOL; + } + } + + // Now we are ready to process the actual content of the line. + $lineTokens = $this->processLine($string, $eolChar, $char, $numChars); + foreach ($lineTokens as $lineToken) { + $tokens[$stackPtr] = $lineToken; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Common::prepareForOutput($lineToken['content']); + $type = $lineToken['type']; + echo "\t\tCreate comment token: $type => $content".PHP_EOL; + } + + if ($lineToken['code'] === T_DOC_COMMENT_TAG) { + $tokens[$openPtr]['comment_tags'][] = $stackPtr; + } + + $stackPtr++; + } + }//end foreach + + $tokens[$stackPtr] = $closeTag; + $tokens[$openPtr]['comment_closer'] = $stackPtr; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Common::prepareForOutput($closeTag['content']); + echo "\t\tCreate comment token: T_DOC_COMMENT_CLOSE_TAG => $content".PHP_EOL; + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t*** END COMMENT TOKENIZING ***".PHP_EOL; + } + + return $tokens; + + }//end tokenizeString() + + + /** + * Process a single line of a comment. + * + * @param string $string The comment string being tokenized. + * @param string $eolChar The EOL character to use for splitting strings. + * @param int $start The position in the string to start processing. + * @param int $end The position in the string to end processing. + * + * @return array> + */ + private function processLine($string, $eolChar, $start, $end) + { + $tokens = []; + + // Collect content padding. + $space = $this->collectWhitespace($string, $start, $end); + if ($space !== null) { + $tokens[] = $space; + $start += strlen($space['content']); + } + + if (isset($string[$start]) === false) { + return $tokens; + } + + if ($string[$start] === '@') { + // The content up until the first whitespace is the tag name. + $matches = []; + preg_match('/@[^\s]+/', $string, $matches, 0, $start); + if (isset($matches[0]) === true + && substr(strtolower($matches[0]), 0, 7) !== '@phpcs:' + ) { + $tagName = $matches[0]; + $start += strlen($tagName); + $tokens[] = [ + 'content' => $tagName, + 'code' => T_DOC_COMMENT_TAG, + 'type' => 'T_DOC_COMMENT_TAG', + ]; + + // Then there will be some whitespace. + $space = $this->collectWhitespace($string, $start, $end); + if ($space !== null) { + $tokens[] = $space; + $start += strlen($space['content']); + } + } + }//end if + + // Process the rest of the line. + $eol = strpos($string, $eolChar, $start); + if ($eol === false) { + $eol = $end; + } + + if ($eol > $start) { + $tokens[] = [ + 'content' => substr($string, $start, ($eol - $start)), + 'code' => T_DOC_COMMENT_STRING, + 'type' => 'T_DOC_COMMENT_STRING', + ]; + } + + if ($eol !== $end) { + $tokens[] = [ + 'content' => substr($string, $eol, strlen($eolChar)), + 'code' => T_DOC_COMMENT_WHITESPACE, + 'type' => 'T_DOC_COMMENT_WHITESPACE', + ]; + } + + return $tokens; + + }//end processLine() + + + /** + * Collect consecutive whitespace into a single token. + * + * @param string $string The comment string being tokenized. + * @param int $start The position in the string to start processing. + * @param int $end The position in the string to end processing. + * + * @return array|null + */ + private function collectWhitespace($string, $start, $end) + { + $space = ''; + for ($start; $start < $end; $start++) { + if ($string[$start] !== ' ' && $string[$start] !== "\t") { + break; + } + + $space .= $string[$start]; + } + + if ($space === '') { + return null; + } + + return [ + 'content' => $space, + 'code' => T_DOC_COMMENT_WHITESPACE, + 'type' => 'T_DOC_COMMENT_WHITESPACE', + ]; + + }//end collectWhitespace() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php new file mode 100644 index 00000000..c7249fcd --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php @@ -0,0 +1,1256 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tokenizers; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Exceptions\TokenizerException; +use PHP_CodeSniffer\Util; + +class JS extends Tokenizer +{ + + /** + * A list of tokens that are allowed to open a scope. + * + * This array also contains information about what kind of token the scope + * opener uses to open and close the scope, if the token strictly requires + * an opener, if the token can share a scope closer, and who it can be shared + * with. An example of a token that shares a scope closer is a CASE scope. + * + * @var array + */ + public $scopeOpeners = [ + T_IF => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_TRY => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_CATCH => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_ELSE => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_FOR => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_CLASS => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_FUNCTION => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_WHILE => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_DO => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_SWITCH => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_CASE => [ + 'start' => [T_COLON => T_COLON], + 'end' => [ + T_BREAK => T_BREAK, + T_RETURN => T_RETURN, + T_CONTINUE => T_CONTINUE, + T_THROW => T_THROW, + ], + 'strict' => true, + 'shared' => true, + 'with' => [ + T_DEFAULT => T_DEFAULT, + T_CASE => T_CASE, + T_SWITCH => T_SWITCH, + ], + ], + T_DEFAULT => [ + 'start' => [T_COLON => T_COLON], + 'end' => [ + T_BREAK => T_BREAK, + T_RETURN => T_RETURN, + T_CONTINUE => T_CONTINUE, + T_THROW => T_THROW, + ], + 'strict' => true, + 'shared' => true, + 'with' => [ + T_CASE => T_CASE, + T_SWITCH => T_SWITCH, + ], + ], + ]; + + /** + * A list of tokens that end the scope. + * + * This array is just a unique collection of the end tokens + * from the _scopeOpeners array. The data is duplicated here to + * save time during parsing of the file. + * + * @var array + */ + public $endScopeTokens = [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_BREAK => T_BREAK, + ]; + + /** + * A list of special JS tokens and their types. + * + * @var array + */ + protected $tokenValues = [ + 'class' => 'T_CLASS', + 'function' => 'T_FUNCTION', + 'prototype' => 'T_PROTOTYPE', + 'try' => 'T_TRY', + 'catch' => 'T_CATCH', + 'return' => 'T_RETURN', + 'throw' => 'T_THROW', + 'break' => 'T_BREAK', + 'switch' => 'T_SWITCH', + 'continue' => 'T_CONTINUE', + 'if' => 'T_IF', + 'else' => 'T_ELSE', + 'do' => 'T_DO', + 'while' => 'T_WHILE', + 'for' => 'T_FOR', + 'var' => 'T_VAR', + 'case' => 'T_CASE', + 'default' => 'T_DEFAULT', + 'true' => 'T_TRUE', + 'false' => 'T_FALSE', + 'null' => 'T_NULL', + 'this' => 'T_THIS', + 'typeof' => 'T_TYPEOF', + '(' => 'T_OPEN_PARENTHESIS', + ')' => 'T_CLOSE_PARENTHESIS', + '{' => 'T_OPEN_CURLY_BRACKET', + '}' => 'T_CLOSE_CURLY_BRACKET', + '[' => 'T_OPEN_SQUARE_BRACKET', + ']' => 'T_CLOSE_SQUARE_BRACKET', + '?' => 'T_INLINE_THEN', + '.' => 'T_OBJECT_OPERATOR', + '+' => 'T_PLUS', + '-' => 'T_MINUS', + '*' => 'T_MULTIPLY', + '%' => 'T_MODULUS', + '/' => 'T_DIVIDE', + '^' => 'T_LOGICAL_XOR', + ',' => 'T_COMMA', + ';' => 'T_SEMICOLON', + ':' => 'T_COLON', + '<' => 'T_LESS_THAN', + '>' => 'T_GREATER_THAN', + '<<' => 'T_SL', + '>>' => 'T_SR', + '>>>' => 'T_ZSR', + '<<=' => 'T_SL_EQUAL', + '>>=' => 'T_SR_EQUAL', + '>>>=' => 'T_ZSR_EQUAL', + '<=' => 'T_IS_SMALLER_OR_EQUAL', + '>=' => 'T_IS_GREATER_OR_EQUAL', + '=>' => 'T_DOUBLE_ARROW', + '!' => 'T_BOOLEAN_NOT', + '||' => 'T_BOOLEAN_OR', + '&&' => 'T_BOOLEAN_AND', + '|' => 'T_BITWISE_OR', + '&' => 'T_BITWISE_AND', + '!=' => 'T_IS_NOT_EQUAL', + '!==' => 'T_IS_NOT_IDENTICAL', + '=' => 'T_EQUAL', + '==' => 'T_IS_EQUAL', + '===' => 'T_IS_IDENTICAL', + '-=' => 'T_MINUS_EQUAL', + '+=' => 'T_PLUS_EQUAL', + '*=' => 'T_MUL_EQUAL', + '/=' => 'T_DIV_EQUAL', + '%=' => 'T_MOD_EQUAL', + '++' => 'T_INC', + '--' => 'T_DEC', + '//' => 'T_COMMENT', + '/*' => 'T_COMMENT', + '/**' => 'T_DOC_COMMENT', + '*/' => 'T_COMMENT', + ]; + + /** + * A list string delimiters. + * + * @var array + */ + protected $stringTokens = [ + '\'' => '\'', + '"' => '"', + ]; + + /** + * A list tokens that start and end comments. + * + * @var array + */ + protected $commentTokens = [ + '//' => null, + '/*' => '*/', + '/**' => '*/', + ]; + + + /** + * Initialise the tokenizer. + * + * Pre-checks the content to see if it looks minified. + * + * @param string $content The content to tokenize. + * @param \PHP_CodeSniffer\Config $config The config data for the run. + * @param string $eolChar The EOL char used in the content. + * + * @return void + * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. + */ + public function __construct($content, Config $config, $eolChar='\n') + { + if ($this->isMinifiedContent($content, $eolChar) === true) { + throw new TokenizerException('File appears to be minified and cannot be processed'); + } + + parent::__construct($content, $config, $eolChar); + + }//end __construct() + + + /** + * Creates an array of tokens when given some JS code. + * + * @param string $string The string to tokenize. + * + * @return array + */ + public function tokenize($string) + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** START JS TOKENIZING ***".PHP_EOL; + } + + $maxTokenLength = 0; + foreach ($this->tokenValues as $token => $values) { + if (strlen($token) > $maxTokenLength) { + $maxTokenLength = strlen($token); + } + } + + $tokens = []; + $inString = ''; + $stringChar = null; + $inComment = ''; + $buffer = ''; + $preStringBuffer = ''; + $cleanBuffer = false; + + $commentTokenizer = new Comment(); + + $tokens[] = [ + 'code' => T_OPEN_TAG, + 'type' => 'T_OPEN_TAG', + 'content' => '', + ]; + + // Convert newlines to single characters for ease of + // processing. We will change them back later. + $string = str_replace($this->eolChar, "\n", $string); + + $chars = str_split($string); + $numChars = count($chars); + for ($i = 0; $i < $numChars; $i++) { + $char = $chars[$i]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($char); + $bufferContent = Util\Common::prepareForOutput($buffer); + + if ($inString !== '') { + echo "\t"; + } + + if ($inComment !== '') { + echo "\t"; + } + + echo "\tProcess char $i => $content (buffer: $bufferContent)".PHP_EOL; + }//end if + + if ($inString === '' && $inComment === '' && $buffer !== '') { + // If the buffer only has whitespace and we are about to + // add a character, store the whitespace first. + if (trim($char) !== '' && trim($buffer) === '') { + $tokens[] = [ + 'code' => T_WHITESPACE, + 'type' => 'T_WHITESPACE', + 'content' => str_replace("\n", $this->eolChar, $buffer), + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($buffer); + echo "\t=> Added token T_WHITESPACE ($content)".PHP_EOL; + } + + $buffer = ''; + } + + // If the buffer is not whitespace and we are about to + // add a whitespace character, store the content first. + if ($inString === '' + && $inComment === '' + && trim($char) === '' + && trim($buffer) !== '' + ) { + $tokens[] = [ + 'code' => T_STRING, + 'type' => 'T_STRING', + 'content' => str_replace("\n", $this->eolChar, $buffer), + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($buffer); + echo "\t=> Added token T_STRING ($content)".PHP_EOL; + } + + $buffer = ''; + } + }//end if + + // Process strings. + if ($inComment === '' && isset($this->stringTokens[$char]) === true) { + if ($inString === $char) { + // This could be the end of the string, but make sure it + // is not escaped first. + $escapes = 0; + for ($x = ($i - 1); $x >= 0; $x--) { + if ($chars[$x] !== '\\') { + break; + } + + $escapes++; + } + + if ($escapes === 0 || ($escapes % 2) === 0) { + // There is an even number escape chars, + // so this is not escaped, it is the end of the string. + $tokens[] = [ + 'code' => T_CONSTANT_ENCAPSED_STRING, + 'type' => 'T_CONSTANT_ENCAPSED_STRING', + 'content' => str_replace("\n", $this->eolChar, $buffer).$char, + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* found end of string *".PHP_EOL; + $content = Util\Common::prepareForOutput($buffer.$char); + echo "\t=> Added token T_CONSTANT_ENCAPSED_STRING ($content)".PHP_EOL; + } + + $buffer = ''; + $preStringBuffer = ''; + $inString = ''; + $stringChar = null; + continue; + }//end if + } else if ($inString === '') { + $inString = $char; + $stringChar = $i; + $preStringBuffer = $buffer; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* looking for string closer *".PHP_EOL; + } + }//end if + }//end if + + if ($inString !== '' && $char === "\n") { + // Unless this newline character is escaped, the string did not + // end before the end of the line, which means it probably + // wasn't a string at all (maybe a regex). + if ($chars[($i - 1)] !== '\\') { + $i = $stringChar; + $buffer = $preStringBuffer; + $preStringBuffer = ''; + $inString = ''; + $stringChar = null; + $char = $chars[$i]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* found newline before end of string, bailing *".PHP_EOL; + } + } + } + + $buffer .= $char; + + // We don't look for special tokens inside strings, + // so if we are in a string, we can continue here now + // that the current char is in the buffer. + if ($inString !== '') { + continue; + } + + // Special case for T_DIVIDE which can actually be + // the start of a regular expression. + if ($buffer === $char && $char === '/' && $chars[($i + 1)] !== '*') { + $regex = $this->getRegexToken($i, $string, $chars, $tokens); + if ($regex !== null) { + $tokens[] = [ + 'code' => T_REGULAR_EXPRESSION, + 'type' => 'T_REGULAR_EXPRESSION', + 'content' => $regex['content'], + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($regex['content']); + echo "\t=> Added token T_REGULAR_EXPRESSION ($content)".PHP_EOL; + } + + $i = $regex['end']; + $buffer = ''; + $cleanBuffer = false; + continue; + }//end if + }//end if + + // Check for known tokens, but ignore tokens found that are not at + // the end of a string, like FOR and this.FORmat. + if (isset($this->tokenValues[strtolower($buffer)]) === true + && (preg_match('|[a-zA-z0-9_]|', $char) === 0 + || isset($chars[($i + 1)]) === false + || preg_match('|[a-zA-z0-9_]|', $chars[($i + 1)]) === 0) + ) { + $matchedToken = false; + $lookAheadLength = ($maxTokenLength - strlen($buffer)); + + if ($lookAheadLength > 0) { + // The buffer contains a token type, but we need + // to look ahead at the next chars to see if this is + // actually part of a larger token. For example, + // FOR and FOREACH. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* buffer possibly contains token, looking ahead $lookAheadLength chars *".PHP_EOL; + } + + $charBuffer = $buffer; + for ($x = 1; $x <= $lookAheadLength; $x++) { + if (isset($chars[($i + $x)]) === false) { + break; + } + + $charBuffer .= $chars[($i + $x)]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($charBuffer); + echo "\t\t=> Looking ahead $x chars => $content".PHP_EOL; + } + + if (isset($this->tokenValues[strtolower($charBuffer)]) === true) { + // We've found something larger that matches + // so we can ignore this char. Except for 1 very specific + // case where a comment like /**/ needs to tokenize as + // T_COMMENT and not T_DOC_COMMENT. + $oldType = $this->tokenValues[strtolower($buffer)]; + $newType = $this->tokenValues[strtolower($charBuffer)]; + if ($oldType === 'T_COMMENT' + && $newType === 'T_DOC_COMMENT' + && $chars[($i + $x + 1)] === '/' + ) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* look ahead ignored T_DOC_COMMENT, continuing *".PHP_EOL; + } + } else { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* look ahead found more specific token ($newType), ignoring $i *".PHP_EOL; + } + + $matchedToken = true; + break; + } + }//end if + }//end for + }//end if + + if ($matchedToken === false) { + if (PHP_CODESNIFFER_VERBOSITY > 1 && $lookAheadLength > 0) { + echo "\t\t* look ahead found nothing *".PHP_EOL; + } + + $value = $this->tokenValues[strtolower($buffer)]; + + if ($value === 'T_FUNCTION' && $buffer !== 'function') { + // The function keyword needs to be all lowercase or else + // it is just a function called "Function". + $value = 'T_STRING'; + } + + $tokens[] = [ + 'code' => constant($value), + 'type' => $value, + 'content' => $buffer, + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($buffer); + echo "\t=> Added token $value ($content)".PHP_EOL; + } + + $cleanBuffer = true; + }//end if + } else if (isset($this->tokenValues[strtolower($char)]) === true) { + // No matter what token we end up using, we don't + // need the content in the buffer any more because we have + // found a valid token. + $newContent = substr(str_replace("\n", $this->eolChar, $buffer), 0, -1); + if ($newContent !== '') { + $tokens[] = [ + 'code' => T_STRING, + 'type' => 'T_STRING', + 'content' => $newContent, + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput(substr($buffer, 0, -1)); + echo "\t=> Added token T_STRING ($content)".PHP_EOL; + } + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* char is token, looking ahead ".($maxTokenLength - 1).' chars *'.PHP_EOL; + } + + // The char is a token type, but we need to look ahead at the + // next chars to see if this is actually part of a larger token. + // For example, = and ===. + $charBuffer = $char; + $matchedToken = false; + for ($x = 1; $x <= $maxTokenLength; $x++) { + if (isset($chars[($i + $x)]) === false) { + break; + } + + $charBuffer .= $chars[($i + $x)]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($charBuffer); + echo "\t\t=> Looking ahead $x chars => $content".PHP_EOL; + } + + if (isset($this->tokenValues[strtolower($charBuffer)]) === true) { + // We've found something larger that matches + // so we can ignore this char. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokenValues[strtolower($charBuffer)]; + echo "\t\t* look ahead found more specific token ($type), ignoring $i *".PHP_EOL; + } + + $matchedToken = true; + break; + } + }//end for + + if ($matchedToken === false) { + $value = $this->tokenValues[strtolower($char)]; + $tokens[] = [ + 'code' => constant($value), + 'type' => $value, + 'content' => $char, + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* look ahead found nothing *".PHP_EOL; + $content = Util\Common::prepareForOutput($char); + echo "\t=> Added token $value ($content)".PHP_EOL; + } + + $cleanBuffer = true; + } else { + $buffer = $char; + }//end if + }//end if + + // Keep track of content inside comments. + if ($inComment === '' + && array_key_exists($buffer, $this->commentTokens) === true + ) { + // This is not really a comment if the content + // looks like \// (i.e., it is escaped). + if (isset($chars[($i - 2)]) === true && $chars[($i - 2)] === '\\') { + $lastToken = array_pop($tokens); + $lastContent = $lastToken['content']; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $value = $this->tokenValues[strtolower($lastContent)]; + $content = Util\Common::prepareForOutput($lastContent); + echo "\t=> Removed token $value ($content)".PHP_EOL; + } + + $lastChars = str_split($lastContent); + $lastNumChars = count($lastChars); + for ($x = 0; $x < $lastNumChars; $x++) { + $lastChar = $lastChars[$x]; + $value = $this->tokenValues[strtolower($lastChar)]; + $tokens[] = [ + 'code' => constant($value), + 'type' => $value, + 'content' => $lastChar, + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($lastChar); + echo "\t=> Added token $value ($content)".PHP_EOL; + } + } + } else { + // We have started a comment. + $inComment = $buffer; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* looking for end of comment *".PHP_EOL; + } + }//end if + } else if ($inComment !== '') { + if ($this->commentTokens[$inComment] === null) { + // Comment ends at the next newline. + if (strpos($buffer, "\n") !== false) { + $inComment = ''; + } + } else { + if ($this->commentTokens[$inComment] === $buffer) { + $inComment = ''; + } + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + if ($inComment === '') { + echo "\t\t* found end of comment *".PHP_EOL; + } + } + + if ($inComment === '' && $cleanBuffer === false) { + $tokens[] = [ + 'code' => T_STRING, + 'type' => 'T_STRING', + 'content' => str_replace("\n", $this->eolChar, $buffer), + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($buffer); + echo "\t=> Added token T_STRING ($content)".PHP_EOL; + } + + $buffer = ''; + } + }//end if + + if ($cleanBuffer === true) { + $buffer = ''; + $cleanBuffer = false; + } + }//end for + + if (empty($buffer) === false) { + if ($inString !== '') { + // The string did not end before the end of the file, + // which means there was probably a syntax error somewhere. + $tokens[] = [ + 'code' => T_STRING, + 'type' => 'T_STRING', + 'content' => str_replace("\n", $this->eolChar, $buffer), + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($buffer); + echo "\t=> Added token T_STRING ($content)".PHP_EOL; + } + } else { + // Buffer contains whitespace from the end of the file. + $tokens[] = [ + 'code' => T_WHITESPACE, + 'type' => 'T_WHITESPACE', + 'content' => str_replace("\n", $this->eolChar, $buffer), + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $content = Util\Common::prepareForOutput($buffer); + echo "\t=> Added token T_WHITESPACE ($content)".PHP_EOL; + } + }//end if + }//end if + + $tokens[] = [ + 'code' => T_CLOSE_TAG, + 'type' => 'T_CLOSE_TAG', + 'content' => '', + ]; + + /* + Now that we have done some basic tokenizing, we need to + modify the tokens to join some together and split some apart + so they match what the PHP tokenizer does. + */ + + $finalTokens = []; + $newStackPtr = 0; + $numTokens = count($tokens); + for ($stackPtr = 0; $stackPtr < $numTokens; $stackPtr++) { + $token = $tokens[$stackPtr]; + + /* + Look for comments and join the tokens together. + */ + + if ($token['code'] === T_COMMENT || $token['code'] === T_DOC_COMMENT) { + $newContent = ''; + $tokenContent = $token['content']; + + $endContent = null; + if (isset($this->commentTokens[$tokenContent]) === true) { + $endContent = $this->commentTokens[$tokenContent]; + } + + while ($tokenContent !== $endContent) { + if ($endContent === null + && strpos($tokenContent, $this->eolChar) !== false + ) { + // A null end token means the comment ends at the end of + // the line so we look for newlines and split the token. + $tokens[$stackPtr]['content'] = substr( + $tokenContent, + (strpos($tokenContent, $this->eolChar) + strlen($this->eolChar)) + ); + + $tokenContent = substr( + $tokenContent, + 0, + (strpos($tokenContent, $this->eolChar) + strlen($this->eolChar)) + ); + + // If the substr failed, skip the token as the content + // will now be blank. + if ($tokens[$stackPtr]['content'] !== false + && $tokens[$stackPtr]['content'] !== '' + ) { + $stackPtr--; + } + + break; + }//end if + + $stackPtr++; + $newContent .= $tokenContent; + if (isset($tokens[$stackPtr]) === false) { + break; + } + + $tokenContent = $tokens[$stackPtr]['content']; + }//end while + + if ($token['code'] === T_DOC_COMMENT) { + $commentTokens = $commentTokenizer->tokenizeString($newContent.$tokenContent, $this->eolChar, $newStackPtr); + foreach ($commentTokens as $commentToken) { + $finalTokens[$newStackPtr] = $commentToken; + $newStackPtr++; + } + + continue; + } else { + // Save the new content in the current token so + // the code below can chop it up on newlines. + $token['content'] = $newContent.$tokenContent; + } + }//end if + + /* + If this token has newlines in its content, split each line up + and create a new token for each line. We do this so it's easier + to ascertain where errors occur on a line. + Note that $token[1] is the token's content. + */ + + if (strpos($token['content'], $this->eolChar) !== false) { + $tokenLines = explode($this->eolChar, $token['content']); + $numLines = count($tokenLines); + + for ($i = 0; $i < $numLines; $i++) { + $newToken = ['content' => $tokenLines[$i]]; + if ($i === ($numLines - 1)) { + if ($tokenLines[$i] === '') { + break; + } + } else { + $newToken['content'] .= $this->eolChar; + } + + $newToken['type'] = $token['type']; + $newToken['code'] = $token['code']; + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + } + } else { + $finalTokens[$newStackPtr] = $token; + $newStackPtr++; + }//end if + + // Convert numbers, including decimals. + if ($token['code'] === T_STRING + || $token['code'] === T_OBJECT_OPERATOR + ) { + $newContent = ''; + $oldStackPtr = $stackPtr; + while (preg_match('|^[0-9\.]+$|', $tokens[$stackPtr]['content']) !== 0) { + $newContent .= $tokens[$stackPtr]['content']; + $stackPtr++; + } + + if ($newContent !== '' && $newContent !== '.') { + $finalTokens[($newStackPtr - 1)]['content'] = $newContent; + if (ctype_digit($newContent) === true) { + $finalTokens[($newStackPtr - 1)]['code'] = constant('T_LNUMBER'); + $finalTokens[($newStackPtr - 1)]['type'] = 'T_LNUMBER'; + } else { + $finalTokens[($newStackPtr - 1)]['code'] = constant('T_DNUMBER'); + $finalTokens[($newStackPtr - 1)]['type'] = 'T_DNUMBER'; + } + + $stackPtr--; + continue; + } else { + $stackPtr = $oldStackPtr; + } + }//end if + + // Convert the token after an object operator into a string, in most cases. + if ($token['code'] === T_OBJECT_OPERATOR) { + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (isset(Util\Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { + continue; + } + + if ($tokens[$i]['code'] !== T_PROTOTYPE + && $tokens[$i]['code'] !== T_LNUMBER + && $tokens[$i]['code'] !== T_DNUMBER + ) { + $tokens[$i]['code'] = T_STRING; + $tokens[$i]['type'] = 'T_STRING'; + } + + break; + } + } + }//end for + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** END TOKENIZING ***".PHP_EOL; + } + + return $finalTokens; + + }//end tokenize() + + + /** + * Tokenizes a regular expression if one is found. + * + * If a regular expression is not found, NULL is returned. + * + * @param int $char The index of the possible regex start character. + * @param string $string The complete content of the string being tokenized. + * @param array $chars An array of characters being tokenized. + * @param array $tokens The current array of tokens found in the string. + * + * @return array|null + */ + public function getRegexToken($char, $string, $chars, $tokens) + { + $beforeTokens = [ + T_EQUAL => true, + T_IS_NOT_EQUAL => true, + T_IS_IDENTICAL => true, + T_IS_NOT_IDENTICAL => true, + T_OPEN_PARENTHESIS => true, + T_OPEN_SQUARE_BRACKET => true, + T_RETURN => true, + T_BOOLEAN_OR => true, + T_BOOLEAN_AND => true, + T_BOOLEAN_NOT => true, + T_BITWISE_OR => true, + T_BITWISE_AND => true, + T_COMMA => true, + T_COLON => true, + T_TYPEOF => true, + T_INLINE_THEN => true, + T_INLINE_ELSE => true, + ]; + + $afterTokens = [ + ',' => true, + ')' => true, + ']' => true, + ';' => true, + ' ' => true, + '.' => true, + ':' => true, + $this->eolChar => true, + ]; + + // Find the last non-whitespace token that was added + // to the tokens array. + $numTokens = count($tokens); + for ($prev = ($numTokens - 1); $prev >= 0; $prev--) { + if (isset(Util\Tokens::$emptyTokens[$tokens[$prev]['code']]) === false) { + break; + } + } + + if (isset($beforeTokens[$tokens[$prev]['code']]) === false) { + return null; + } + + // This is probably a regular expression, so look for the end of it. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t* token possibly starts a regular expression *".PHP_EOL; + } + + $numChars = count($chars); + for ($next = ($char + 1); $next < $numChars; $next++) { + if ($chars[$next] === '/') { + // Just make sure this is not escaped first. + if ($chars[($next - 1)] !== '\\') { + // In the simple form: /.../ so we found the end. + break; + } else if ($chars[($next - 2)] === '\\') { + // In the form: /...\\/ so we found the end. + break; + } + } else { + $possibleEolChar = substr($string, $next, strlen($this->eolChar)); + if ($possibleEolChar === $this->eolChar) { + // This is the last token on the line and regular + // expressions need to be defined on a single line, + // so this is not a regular expression. + break; + } + } + } + + if ($chars[$next] !== '/') { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t* could not find end of regular expression *".PHP_EOL; + } + + return null; + } + + while (preg_match('|[a-zA-Z]|', $chars[($next + 1)]) !== 0) { + // The token directly after the end of the regex can + // be modifiers like global and case insensitive + // (.e.g, /pattern/gi). + $next++; + } + + $regexEnd = $next; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t* found end of regular expression at token $regexEnd *".PHP_EOL; + } + + for ($next += 1; $next < $numChars; $next++) { + if ($chars[$next] !== ' ') { + break; + } else { + $possibleEolChar = substr($string, $next, strlen($this->eolChar)); + if ($possibleEolChar === $this->eolChar) { + // This is the last token on the line. + break; + } + } + } + + if (isset($afterTokens[$chars[$next]]) === false) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t* tokens after regular expression do not look correct *".PHP_EOL; + } + + return null; + } + + // This is a regular expression, so join all the tokens together. + $content = ''; + for ($x = $char; $x <= $regexEnd; $x++) { + $content .= $chars[$x]; + } + + $token = [ + 'start' => $char, + 'end' => $regexEnd, + 'content' => $content, + ]; + + return $token; + + }//end getRegexToken() + + + /** + * Performs additional processing after main tokenizing. + * + * This additional processing looks for properties, closures, labels and objects. + * + * @return void + */ + public function processAdditional() + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** START ADDITIONAL JS PROCESSING ***".PHP_EOL; + } + + $numTokens = count($this->tokens); + $classStack = []; + + for ($i = 0; $i < $numTokens; $i++) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$i]['type']; + $content = Util\Common::prepareForOutput($this->tokens[$i]['content']); + + echo str_repeat("\t", count($classStack)); + echo "\tProcess token $i: $type => $content".PHP_EOL; + } + + // Looking for functions that are actually closures. + if ($this->tokens[$i]['code'] === T_FUNCTION && isset($this->tokens[$i]['scope_opener']) === true) { + for ($x = ($i + 1); $x < $numTokens; $x++) { + if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { + break; + } + } + + if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { + $this->tokens[$i]['code'] = T_CLOSURE; + $this->tokens[$i]['type'] = 'T_CLOSURE'; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$i]['line']; + echo str_repeat("\t", count($classStack)); + echo "\t* token $i on line $line changed from T_FUNCTION to T_CLOSURE *".PHP_EOL; + } + + for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { + if (isset($this->tokens[$x]['conditions'][$i]) === false) { + continue; + } + + $this->tokens[$x]['conditions'][$i] = T_CLOSURE; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$x]['type']; + echo str_repeat("\t", count($classStack)); + echo "\t\t* cleaned $x ($type) *".PHP_EOL; + } + } + }//end if + + continue; + } else if ($this->tokens[$i]['code'] === T_OPEN_CURLY_BRACKET + && isset($this->tokens[$i]['scope_condition']) === false + && isset($this->tokens[$i]['bracket_closer']) === true + ) { + $condition = $this->tokens[$i]['conditions']; + $condition = end($condition); + if ($condition === T_CLASS) { + // Possibly an ES6 method. To be classified as one, the previous + // non-empty tokens need to be a set of parenthesis, and then a string + // (the method name). + for ($parenCloser = ($i - 1); $parenCloser > 0; $parenCloser--) { + if (isset(Util\Tokens::$emptyTokens[$this->tokens[$parenCloser]['code']]) === false) { + break; + } + } + + if ($this->tokens[$parenCloser]['code'] === T_CLOSE_PARENTHESIS) { + $parenOpener = $this->tokens[$parenCloser]['parenthesis_opener']; + for ($name = ($parenOpener - 1); $name > 0; $name--) { + if (isset(Util\Tokens::$emptyTokens[$this->tokens[$name]['code']]) === false) { + break; + } + } + + if ($this->tokens[$name]['code'] === T_STRING) { + // We found a method name. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$name]['line']; + echo str_repeat("\t", count($classStack)); + echo "\t* token $name on line $line changed from T_STRING to T_FUNCTION *".PHP_EOL; + } + + $closer = $this->tokens[$i]['bracket_closer']; + + $this->tokens[$name]['code'] = T_FUNCTION; + $this->tokens[$name]['type'] = 'T_FUNCTION'; + + foreach ([$name, $i, $closer] as $token) { + $this->tokens[$token]['scope_condition'] = $name; + $this->tokens[$token]['scope_opener'] = $i; + $this->tokens[$token]['scope_closer'] = $closer; + $this->tokens[$token]['parenthesis_opener'] = $parenOpener; + $this->tokens[$token]['parenthesis_closer'] = $parenCloser; + $this->tokens[$token]['parenthesis_owner'] = $name; + } + + $this->tokens[$parenOpener]['parenthesis_owner'] = $name; + $this->tokens[$parenCloser]['parenthesis_owner'] = $name; + + for ($x = ($i + 1); $x < $closer; $x++) { + $this->tokens[$x]['conditions'][$name] = T_FUNCTION; + ksort($this->tokens[$x]['conditions'], SORT_NUMERIC); + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$x]['type']; + echo str_repeat("\t", count($classStack)); + echo "\t\t* added T_FUNCTION condition to $x ($type) *".PHP_EOL; + } + } + + continue; + }//end if + }//end if + }//end if + + $classStack[] = $i; + + $closer = $this->tokens[$i]['bracket_closer']; + $this->tokens[$i]['code'] = T_OBJECT; + $this->tokens[$i]['type'] = 'T_OBJECT'; + $this->tokens[$closer]['code'] = T_CLOSE_OBJECT; + $this->tokens[$closer]['type'] = 'T_CLOSE_OBJECT'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($classStack)); + echo "\t* token $i converted from T_OPEN_CURLY_BRACKET to T_OBJECT *".PHP_EOL; + echo str_repeat("\t", count($classStack)); + echo "\t* token $closer converted from T_CLOSE_CURLY_BRACKET to T_CLOSE_OBJECT *".PHP_EOL; + } + + for ($x = ($i + 1); $x < $closer; $x++) { + $this->tokens[$x]['conditions'][$i] = T_OBJECT; + ksort($this->tokens[$x]['conditions'], SORT_NUMERIC); + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$x]['type']; + echo str_repeat("\t", count($classStack)); + echo "\t\t* added T_OBJECT condition to $x ($type) *".PHP_EOL; + } + } + } else if ($this->tokens[$i]['code'] === T_CLOSE_OBJECT) { + array_pop($classStack); + } else if ($this->tokens[$i]['code'] === T_COLON) { + // If it is a scope opener, it belongs to a + // DEFAULT or CASE statement. + if (isset($this->tokens[$i]['scope_condition']) === true) { + continue; + } + + // Make sure this is not part of an inline IF statement. + for ($x = ($i - 1); $x >= 0; $x--) { + if ($this->tokens[$x]['code'] === T_INLINE_THEN) { + $this->tokens[$i]['code'] = T_INLINE_ELSE; + $this->tokens[$i]['type'] = 'T_INLINE_ELSE'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($classStack)); + echo "\t* token $i converted from T_COLON to T_INLINE_THEN *".PHP_EOL; + } + + continue(2); + } else if ($this->tokens[$x]['line'] < $this->tokens[$i]['line']) { + break; + } + } + + // The string to the left of the colon is either a property or label. + for ($label = ($i - 1); $label >= 0; $label--) { + if (isset(Util\Tokens::$emptyTokens[$this->tokens[$label]['code']]) === false) { + break; + } + } + + if ($this->tokens[$label]['code'] !== T_STRING + && $this->tokens[$label]['code'] !== T_CONSTANT_ENCAPSED_STRING + ) { + continue; + } + + if (empty($classStack) === false) { + $this->tokens[$label]['code'] = T_PROPERTY; + $this->tokens[$label]['type'] = 'T_PROPERTY'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($classStack)); + echo "\t* token $label converted from T_STRING to T_PROPERTY *".PHP_EOL; + } + } else { + $this->tokens[$label]['code'] = T_LABEL; + $this->tokens[$label]['type'] = 'T_LABEL'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($classStack)); + echo "\t* token $label converted from T_STRING to T_LABEL *".PHP_EOL; + } + }//end if + }//end if + }//end for + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** END ADDITIONAL JS PROCESSING ***".PHP_EOL; + } + + }//end processAdditional() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php new file mode 100644 index 00000000..a773ddfa --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php @@ -0,0 +1,3875 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tokenizers; + +use PHP_CodeSniffer\Util\Common; +use PHP_CodeSniffer\Util\Tokens; + +class PHP extends Tokenizer +{ + + /** + * A list of tokens that are allowed to open a scope. + * + * This array also contains information about what kind of token the scope + * opener uses to open and close the scope, if the token strictly requires + * an opener, if the token can share a scope closer, and who it can be shared + * with. An example of a token that shares a scope closer is a CASE scope. + * + * @var array + */ + public $scopeOpeners = [ + T_IF => [ + 'start' => [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_COLON => T_COLON, + ], + 'end' => [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_ENDIF => T_ENDIF, + T_ELSE => T_ELSE, + T_ELSEIF => T_ELSEIF, + ], + 'strict' => false, + 'shared' => false, + 'with' => [ + T_ELSE => T_ELSE, + T_ELSEIF => T_ELSEIF, + ], + ], + T_TRY => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_CATCH => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_FINALLY => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_ELSE => [ + 'start' => [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_COLON => T_COLON, + ], + 'end' => [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_ENDIF => T_ENDIF, + ], + 'strict' => false, + 'shared' => false, + 'with' => [ + T_IF => T_IF, + T_ELSEIF => T_ELSEIF, + ], + ], + T_ELSEIF => [ + 'start' => [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_COLON => T_COLON, + ], + 'end' => [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_ENDIF => T_ENDIF, + T_ELSE => T_ELSE, + T_ELSEIF => T_ELSEIF, + ], + 'strict' => false, + 'shared' => false, + 'with' => [ + T_IF => T_IF, + T_ELSE => T_ELSE, + ], + ], + T_FOR => [ + 'start' => [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_COLON => T_COLON, + ], + 'end' => [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_ENDFOR => T_ENDFOR, + ], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_FOREACH => [ + 'start' => [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_COLON => T_COLON, + ], + 'end' => [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_ENDFOREACH => T_ENDFOREACH, + ], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_INTERFACE => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_FUNCTION => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_CLASS => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_TRAIT => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_ENUM => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_USE => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_DECLARE => [ + 'start' => [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_COLON => T_COLON, + ], + 'end' => [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_ENDDECLARE => T_ENDDECLARE, + ], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_NAMESPACE => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_WHILE => [ + 'start' => [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_COLON => T_COLON, + ], + 'end' => [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_ENDWHILE => T_ENDWHILE, + ], + 'strict' => false, + 'shared' => false, + 'with' => [], + ], + T_DO => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_SWITCH => [ + 'start' => [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_COLON => T_COLON, + ], + 'end' => [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_ENDSWITCH => T_ENDSWITCH, + ], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_CASE => [ + 'start' => [ + T_COLON => T_COLON, + T_SEMICOLON => T_SEMICOLON, + ], + 'end' => [ + T_BREAK => T_BREAK, + T_RETURN => T_RETURN, + T_CONTINUE => T_CONTINUE, + T_THROW => T_THROW, + T_EXIT => T_EXIT, + ], + 'strict' => true, + 'shared' => true, + 'with' => [ + T_DEFAULT => T_DEFAULT, + T_CASE => T_CASE, + T_SWITCH => T_SWITCH, + ], + ], + T_DEFAULT => [ + 'start' => [ + T_COLON => T_COLON, + T_SEMICOLON => T_SEMICOLON, + ], + 'end' => [ + T_BREAK => T_BREAK, + T_RETURN => T_RETURN, + T_CONTINUE => T_CONTINUE, + T_THROW => T_THROW, + T_EXIT => T_EXIT, + ], + 'strict' => true, + 'shared' => true, + 'with' => [ + T_CASE => T_CASE, + T_SWITCH => T_SWITCH, + ], + ], + T_MATCH => [ + 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], + 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_START_HEREDOC => [ + 'start' => [T_START_HEREDOC => T_START_HEREDOC], + 'end' => [T_END_HEREDOC => T_END_HEREDOC], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + T_START_NOWDOC => [ + 'start' => [T_START_NOWDOC => T_START_NOWDOC], + 'end' => [T_END_NOWDOC => T_END_NOWDOC], + 'strict' => true, + 'shared' => false, + 'with' => [], + ], + ]; + + /** + * A list of tokens that end the scope. + * + * This array is just a unique collection of the end tokens + * from the scopeOpeners array. The data is duplicated here to + * save time during parsing of the file. + * + * @var array + */ + public $endScopeTokens = [ + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_ENDIF => T_ENDIF, + T_ENDFOR => T_ENDFOR, + T_ENDFOREACH => T_ENDFOREACH, + T_ENDWHILE => T_ENDWHILE, + T_ENDSWITCH => T_ENDSWITCH, + T_ENDDECLARE => T_ENDDECLARE, + T_BREAK => T_BREAK, + T_END_HEREDOC => T_END_HEREDOC, + T_END_NOWDOC => T_END_NOWDOC, + ]; + + /** + * Known lengths of tokens. + * + * @var array + */ + public $knownLengths = [ + T_ABSTRACT => 8, + T_AND_EQUAL => 2, + T_ARRAY => 5, + T_AS => 2, + T_BOOLEAN_AND => 2, + T_BOOLEAN_OR => 2, + T_BREAK => 5, + T_CALLABLE => 8, + T_CASE => 4, + T_CATCH => 5, + T_CLASS => 5, + T_CLASS_C => 9, + T_CLONE => 5, + T_CONCAT_EQUAL => 2, + T_CONST => 5, + T_CONTINUE => 8, + T_CURLY_OPEN => 2, + T_DEC => 2, + T_DECLARE => 7, + T_DEFAULT => 7, + T_DIR => 7, + T_DIV_EQUAL => 2, + T_DO => 2, + T_DOLLAR_OPEN_CURLY_BRACES => 2, + T_DOUBLE_ARROW => 2, + T_DOUBLE_COLON => 2, + T_ECHO => 4, + T_ELLIPSIS => 3, + T_ELSE => 4, + T_ELSEIF => 6, + T_EMPTY => 5, + T_ENDDECLARE => 10, + T_ENDFOR => 6, + T_ENDFOREACH => 10, + T_ENDIF => 5, + T_ENDSWITCH => 9, + T_ENDWHILE => 8, + T_ENUM => 4, + T_ENUM_CASE => 4, + T_EVAL => 4, + T_EXTENDS => 7, + T_FILE => 8, + T_FINAL => 5, + T_FINALLY => 7, + T_FN => 2, + T_FOR => 3, + T_FOREACH => 7, + T_FUNCTION => 8, + T_FUNC_C => 12, + T_GLOBAL => 6, + T_GOTO => 4, + T_HALT_COMPILER => 15, + T_IF => 2, + T_IMPLEMENTS => 10, + T_INC => 2, + T_INCLUDE => 7, + T_INCLUDE_ONCE => 12, + T_INSTANCEOF => 10, + T_INSTEADOF => 9, + T_INTERFACE => 9, + T_ISSET => 5, + T_IS_EQUAL => 2, + T_IS_GREATER_OR_EQUAL => 2, + T_IS_IDENTICAL => 3, + T_IS_NOT_EQUAL => 2, + T_IS_NOT_IDENTICAL => 3, + T_IS_SMALLER_OR_EQUAL => 2, + T_LINE => 8, + T_LIST => 4, + T_LOGICAL_AND => 3, + T_LOGICAL_OR => 2, + T_LOGICAL_XOR => 3, + T_MATCH => 5, + T_MATCH_ARROW => 2, + T_MATCH_DEFAULT => 7, + T_METHOD_C => 10, + T_MINUS_EQUAL => 2, + T_POW_EQUAL => 3, + T_MOD_EQUAL => 2, + T_MUL_EQUAL => 2, + T_NAMESPACE => 9, + T_NS_C => 13, + T_NS_SEPARATOR => 1, + T_NEW => 3, + T_NULLSAFE_OBJECT_OPERATOR => 3, + T_OBJECT_OPERATOR => 2, + T_OPEN_TAG_WITH_ECHO => 3, + T_OR_EQUAL => 2, + T_PLUS_EQUAL => 2, + T_PRINT => 5, + T_PRIVATE => 7, + T_PUBLIC => 6, + T_PROTECTED => 9, + T_READONLY => 8, + T_REQUIRE => 7, + T_REQUIRE_ONCE => 12, + T_RETURN => 6, + T_STATIC => 6, + T_SWITCH => 6, + T_THROW => 5, + T_TRAIT => 5, + T_TRAIT_C => 9, + T_TRY => 3, + T_UNSET => 5, + T_USE => 3, + T_VAR => 3, + T_WHILE => 5, + T_XOR_EQUAL => 2, + T_YIELD => 5, + T_OPEN_CURLY_BRACKET => 1, + T_CLOSE_CURLY_BRACKET => 1, + T_OPEN_SQUARE_BRACKET => 1, + T_CLOSE_SQUARE_BRACKET => 1, + T_OPEN_PARENTHESIS => 1, + T_CLOSE_PARENTHESIS => 1, + T_COLON => 1, + T_STRING_CONCAT => 1, + T_INLINE_THEN => 1, + T_INLINE_ELSE => 1, + T_NULLABLE => 1, + T_NULL => 4, + T_FALSE => 5, + T_TRUE => 4, + T_SEMICOLON => 1, + T_EQUAL => 1, + T_MULTIPLY => 1, + T_DIVIDE => 1, + T_PLUS => 1, + T_MINUS => 1, + T_MODULUS => 1, + T_POW => 2, + T_SPACESHIP => 3, + T_COALESCE => 2, + T_COALESCE_EQUAL => 3, + T_BITWISE_AND => 1, + T_BITWISE_OR => 1, + T_BITWISE_XOR => 1, + T_SL => 2, + T_SR => 2, + T_SL_EQUAL => 3, + T_SR_EQUAL => 3, + T_GREATER_THAN => 1, + T_LESS_THAN => 1, + T_BOOLEAN_NOT => 1, + T_SELF => 4, + T_PARENT => 6, + T_COMMA => 1, + T_THIS => 4, + T_CLOSURE => 8, + T_BACKTICK => 1, + T_OPEN_SHORT_ARRAY => 1, + T_CLOSE_SHORT_ARRAY => 1, + T_TYPE_UNION => 1, + T_TYPE_INTERSECTION => 1, + T_TYPE_OPEN_PARENTHESIS => 1, + T_TYPE_CLOSE_PARENTHESIS => 1, + ]; + + /** + * Contexts in which keywords should always be tokenized as T_STRING. + * + * @var array + */ + protected $tstringContexts = [ + T_OBJECT_OPERATOR => true, + T_NULLSAFE_OBJECT_OPERATOR => true, + T_FUNCTION => true, + T_CLASS => true, + T_INTERFACE => true, + T_TRAIT => true, + T_ENUM => true, + T_ENUM_CASE => true, + T_EXTENDS => true, + T_IMPLEMENTS => true, + T_ATTRIBUTE => true, + T_NEW => true, + T_CONST => true, + T_NS_SEPARATOR => true, + T_USE => true, + T_NAMESPACE => true, + T_PAAMAYIM_NEKUDOTAYIM => true, + ]; + + /** + * A cache of different token types, resolved into arrays. + * + * @var array + * @see standardiseToken() + */ + private static $resolveTokenCache = []; + + + /** + * Creates an array of tokens when given some PHP code. + * + * Starts by using token_get_all() but does a lot of extra processing + * to insert information about the context of the token. + * + * @param string $string The string to tokenize. + * + * @return array + */ + protected function tokenize($string) + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** START PHP TOKENIZING ***".PHP_EOL; + $isWin = false; + if (stripos(PHP_OS, 'WIN') === 0) { + $isWin = true; + } + } + + $tokens = @token_get_all($string); + $finalTokens = []; + + $newStackPtr = 0; + $numTokens = count($tokens); + $lastNotEmptyToken = 0; + + $insideInlineIf = []; + $insideUseGroup = false; + $insideConstDeclaration = false; + + $commentTokenizer = new Comment(); + + for ($stackPtr = 0; $stackPtr < $numTokens; $stackPtr++) { + // Special case for tokens we have needed to blank out. + if ($tokens[$stackPtr] === null) { + continue; + } + + $token = (array) $tokens[$stackPtr]; + $tokenIsArray = isset($token[1]); + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + if ($tokenIsArray === true) { + $type = Tokens::tokenName($token[0]); + $content = Common::prepareForOutput($token[1]); + } else { + $newToken = self::resolveSimpleToken($token[0]); + $type = $newToken['type']; + $content = Common::prepareForOutput($token[0]); + } + + echo "\tProcess token "; + if ($tokenIsArray === true) { + echo "[$stackPtr]"; + } else { + echo " $stackPtr "; + } + + echo ": $type => $content"; + }//end if + + if ($newStackPtr > 0 + && isset(Tokens::$emptyTokens[$finalTokens[($newStackPtr - 1)]['code']]) === false + ) { + $lastNotEmptyToken = ($newStackPtr - 1); + } + + /* + If we are using \r\n newline characters, the \r and \n are sometimes + split over two tokens. This normally occurs after comments. We need + to merge these two characters together so that our line endings are + consistent for all lines. + */ + + if ($tokenIsArray === true && substr($token[1], -1) === "\r") { + if (isset($tokens[($stackPtr + 1)]) === true + && is_array($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][1][0] === "\n" + ) { + $token[1] .= "\n"; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + if ($isWin === true) { + echo '\n'; + } else { + echo "\033[30;1m\\n\033[0m"; + } + } + + if ($tokens[($stackPtr + 1)][1] === "\n") { + // This token's content has been merged into the previous, + // so we can skip it. + $tokens[($stackPtr + 1)] = ''; + } else { + $tokens[($stackPtr + 1)][1] = substr($tokens[($stackPtr + 1)][1], 1); + } + } + }//end if + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo PHP_EOL; + } + + /* + Tokenize context sensitive keyword as string when it should be string. + */ + + if ($tokenIsArray === true + && isset(Tokens::$contextSensitiveKeywords[$token[0]]) === true + && (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true + || $finalTokens[$lastNotEmptyToken]['content'] === '&' + || $insideConstDeclaration === true) + ) { + if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true) { + $preserveKeyword = false; + + // `new class`, and `new static` should be preserved. + if ($finalTokens[$lastNotEmptyToken]['code'] === T_NEW + && ($token[0] === T_CLASS + || $token[0] === T_STATIC) + ) { + $preserveKeyword = true; + } + + // `new readonly class` should be preserved. + if ($finalTokens[$lastNotEmptyToken]['code'] === T_NEW + && strtolower($token[1]) === 'readonly' + ) { + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === false + || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false + ) { + break; + } + } + + if (is_array($tokens[$i]) === true && $tokens[$i][0] === T_CLASS) { + $preserveKeyword = true; + } + } + + // `new class extends` `new class implements` should be preserved + if (($token[0] === T_EXTENDS || $token[0] === T_IMPLEMENTS) + && $finalTokens[$lastNotEmptyToken]['code'] === T_CLASS + ) { + $preserveKeyword = true; + } + + // `namespace\` should be preserved + if ($token[0] === T_NAMESPACE) { + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === false) { + break; + } + + if (isset(Tokens::$emptyTokens[$tokens[$i][0]]) === true) { + continue; + } + + if ($tokens[$i][0] === T_NS_SEPARATOR) { + $preserveKeyword = true; + } + + break; + } + } + }//end if + + // Types in typed constants should not be touched, but the constant name should be. + if ((isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true + && $finalTokens[$lastNotEmptyToken]['code'] === T_CONST) + || $insideConstDeclaration === true + ) { + $preserveKeyword = true; + + // Find the next non-empty token. + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === true + && isset(Tokens::$emptyTokens[$tokens[$i][0]]) === true + ) { + continue; + } + + break; + } + + if ($tokens[$i] === '=' || $tokens[$i] === ';') { + $preserveKeyword = false; + $insideConstDeclaration = false; + } + }//end if + + if ($finalTokens[$lastNotEmptyToken]['content'] === '&') { + $preserveKeyword = true; + + for ($i = ($lastNotEmptyToken - 1); $i >= 0; $i--) { + if (isset(Tokens::$emptyTokens[$finalTokens[$i]['code']]) === true) { + continue; + } + + if ($finalTokens[$i]['code'] === T_FUNCTION) { + $preserveKeyword = false; + } + + break; + } + } + + if ($preserveKeyword === false) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = Tokens::tokenName($token[0]); + echo "\t\t* token $stackPtr changed from $type to T_STRING".PHP_EOL; + } + + $finalTokens[$newStackPtr] = [ + 'code' => T_STRING, + 'type' => 'T_STRING', + 'content' => $token[1], + ]; + + $newStackPtr++; + continue; + } + }//end if + + /* + Mark the start of a constant declaration to allow for handling keyword to T_STRING + convertion for constant names using reserved keywords. + */ + + if ($tokenIsArray === true && $token[0] === T_CONST) { + $insideConstDeclaration = true; + } + + /* + Close an open "inside constant declaration" marker when no keyword convertion was needed. + */ + + if ($insideConstDeclaration === true + && $tokenIsArray === false + && ($token[0] === '=' || $token[0] === ';') + ) { + $insideConstDeclaration = false; + } + + /* + Special case for `static` used as a function name, i.e. `static()`. + + Note: this may incorrectly change the static keyword directly before a DNF property type. + If so, this will be caught and corrected for in the additional processing. + */ + + 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(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. + */ + + if ($tokenIsArray === true + && ($token[0] === T_DOC_COMMENT + || ($token[0] === T_COMMENT && strpos($token[1], '/**') === 0 && $token[1] !== '/**/')) + ) { + $commentTokens = $commentTokenizer->tokenizeString($token[1], $this->eolChar, $newStackPtr); + foreach ($commentTokens as $commentToken) { + $finalTokens[$newStackPtr] = $commentToken; + $newStackPtr++; + } + + continue; + } + + /* + PHP 8 tokenizes a new line after a slash and hash comment to the next whitespace token. + */ + + if (PHP_VERSION_ID >= 80000 + && $tokenIsArray === true + && ($token[0] === T_COMMENT && (strpos($token[1], '//') === 0 || strpos($token[1], '#') === 0)) + && isset($tokens[($stackPtr + 1)]) === true + && is_array($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][0] === T_WHITESPACE + ) { + $nextToken = $tokens[($stackPtr + 1)]; + + // If the next token is a single new line, merge it into the comment token + // and set to it up to be skipped. + if ($nextToken[1] === "\n" || $nextToken[1] === "\r\n" || $nextToken[1] === "\n\r") { + $token[1] .= $nextToken[1]; + $tokens[($stackPtr + 1)] = null; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* merged newline after comment into comment token $stackPtr".PHP_EOL; + } + } else { + // This may be a whitespace token consisting of multiple new lines. + if (strpos($nextToken[1], "\r\n") === 0) { + $token[1] .= "\r\n"; + $tokens[($stackPtr + 1)][1] = substr($nextToken[1], 2); + } else if (strpos($nextToken[1], "\n\r") === 0) { + $token[1] .= "\n\r"; + $tokens[($stackPtr + 1)][1] = substr($nextToken[1], 2); + } else if (strpos($nextToken[1], "\n") === 0) { + $token[1] .= "\n"; + $tokens[($stackPtr + 1)][1] = substr($nextToken[1], 1); + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* stripped first newline after comment and added it to comment token $stackPtr".PHP_EOL; + } + }//end if + }//end if + + /* + For Explicit Octal Notation prior to PHP 8.1 we need to combine the + T_LNUMBER and T_STRING token values into a single token value, and + then ignore the T_STRING token. + */ + + if (PHP_VERSION_ID < 80100 + && $tokenIsArray === true && $token[1] === '0' + && (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 + ) { + $finalTokens[$newStackPtr] = [ + 'code' => T_LNUMBER, + 'type' => 'T_LNUMBER', + 'content' => $token[1] .= $matches[1], + ]; + $newStackPtr++; + + if (isset($matches[2]) === true && $matches[2] !== '') { + $type = 'T_LNUMBER'; + if ($matches[2][0] === '_') { + $type = 'T_STRING'; + } + + $finalTokens[$newStackPtr] = [ + 'code' => constant($type), + 'type' => $type, + 'content' => $matches[2], + ]; + $newStackPtr++; + } + + $stackPtr++; + continue; + }//end if + + /* + PHP 8.1 introduced two dedicated tokens for the & character. + Retokenizing both of these to T_BITWISE_AND, which is the + token PHPCS already tokenized them as. + */ + + if ($tokenIsArray === true + && ($token[0] === T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG + || $token[0] === T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG) + ) { + $finalTokens[$newStackPtr] = [ + 'code' => T_BITWISE_AND, + 'type' => 'T_BITWISE_AND', + 'content' => $token[1], + ]; + $newStackPtr++; + continue; + } + + /* + If this is a double quoted string, PHP will tokenize the whole + thing which causes problems with the scope map when braces are + within the string. So we need to merge the tokens together to + provide a single string. + */ + + if ($tokenIsArray === false && ($token[0] === '"' || $token[0] === 'b"')) { + // Binary casts need a special token. + if ($token[0] === 'b"') { + $finalTokens[$newStackPtr] = [ + 'code' => T_BINARY_CAST, + 'type' => 'T_BINARY_CAST', + 'content' => 'b', + ]; + $newStackPtr++; + } + + $tokenContent = '"'; + $nestedVars = []; + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + $subToken = (array) $tokens[$i]; + $subTokenIsArray = isset($subToken[1]); + + if ($subTokenIsArray === true) { + $tokenContent .= $subToken[1]; + if (($subToken[1] === '{' + || $subToken[1] === '${') + && $subToken[0] !== T_ENCAPSED_AND_WHITESPACE + ) { + $nestedVars[] = $i; + } + } else { + $tokenContent .= $subToken[0]; + if ($subToken[0] === '}') { + array_pop($nestedVars); + } + } + + if ($subTokenIsArray === false + && $subToken[0] === '"' + && empty($nestedVars) === true + ) { + // We found the other end of the double quoted string. + break; + } + }//end for + + $stackPtr = $i; + + // Convert each line within the double quoted string to a + // new token, so it conforms with other multiple line tokens. + $tokenLines = explode($this->eolChar, $tokenContent); + $numLines = count($tokenLines); + $newToken = []; + + for ($j = 0; $j < $numLines; $j++) { + $newToken['content'] = $tokenLines[$j]; + if ($j === ($numLines - 1)) { + if ($tokenLines[$j] === '') { + break; + } + } else { + $newToken['content'] .= $this->eolChar; + } + + $newToken['code'] = T_DOUBLE_QUOTED_STRING; + $newToken['type'] = 'T_DOUBLE_QUOTED_STRING'; + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + } + + // Continue, as we're done with this token. + continue; + }//end if + + /* + Detect binary casting and assign the casts their own token. + */ + + if ($tokenIsArray === true + && $token[0] === T_CONSTANT_ENCAPSED_STRING + && (substr($token[1], 0, 2) === 'b"' + || substr($token[1], 0, 2) === "b'") + ) { + $finalTokens[$newStackPtr] = [ + 'code' => T_BINARY_CAST, + 'type' => 'T_BINARY_CAST', + 'content' => 'b', + ]; + $newStackPtr++; + $token[1] = substr($token[1], 1); + } + + if ($tokenIsArray === true + && $token[0] === T_STRING_CAST + && preg_match('`^\(\s*binary\s*\)$`i', $token[1]) === 1 + ) { + $finalTokens[$newStackPtr] = [ + 'code' => T_BINARY_CAST, + 'type' => 'T_BINARY_CAST', + 'content' => $token[1], + ]; + $newStackPtr++; + continue; + } + + /* + If this is a heredoc, PHP will tokenize the whole + thing which causes problems when heredocs don't + contain real PHP code, which is almost never. + We want to leave the start and end heredoc tokens + alone though. + */ + + if ($tokenIsArray === true && $token[0] === T_START_HEREDOC) { + // Add the start heredoc token to the final array. + $finalTokens[$newStackPtr] = self::standardiseToken($token); + + // Check if this is actually a nowdoc and use a different token + // to help the sniffs. + $nowdoc = false; + if (strpos($token[1], "'") !== false) { + $finalTokens[$newStackPtr]['code'] = T_START_NOWDOC; + $finalTokens[$newStackPtr]['type'] = 'T_START_NOWDOC'; + $nowdoc = true; + } + + $tokenContent = ''; + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + $subTokenIsArray = is_array($tokens[$i]); + if ($subTokenIsArray === true + && $tokens[$i][0] === T_END_HEREDOC + ) { + // We found the other end of the heredoc. + break; + } + + if ($subTokenIsArray === true) { + $tokenContent .= $tokens[$i][1]; + } else { + $tokenContent .= $tokens[$i]; + } + } + + if ($i === $numTokens) { + // We got to the end of the file and never + // found the closing token, so this probably wasn't + // a heredoc. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $finalTokens[$newStackPtr]['type']; + echo "\t\t* failed to find the end of the here/nowdoc".PHP_EOL; + echo "\t\t* token $stackPtr changed from $type to T_STRING".PHP_EOL; + } + + $finalTokens[$newStackPtr]['code'] = T_STRING; + $finalTokens[$newStackPtr]['type'] = 'T_STRING'; + $newStackPtr++; + continue; + } + + $stackPtr = $i; + $newStackPtr++; + + // Convert each line within the heredoc to a + // new token, so it conforms with other multiple line tokens. + $tokenLines = explode($this->eolChar, $tokenContent); + $numLines = count($tokenLines); + $newToken = []; + + for ($j = 0; $j < $numLines; $j++) { + $newToken['content'] = $tokenLines[$j]; + if ($j === ($numLines - 1)) { + if ($tokenLines[$j] === '') { + break; + } + } else { + $newToken['content'] .= $this->eolChar; + } + + if ($nowdoc === true) { + $newToken['code'] = T_NOWDOC; + $newToken['type'] = 'T_NOWDOC'; + } else { + $newToken['code'] = T_HEREDOC; + $newToken['type'] = 'T_HEREDOC'; + } + + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + }//end for + + // Add the end heredoc token to the final array. + $finalTokens[$newStackPtr] = self::standardiseToken($tokens[$stackPtr]); + + if ($nowdoc === true) { + $finalTokens[$newStackPtr]['code'] = T_END_NOWDOC; + $finalTokens[$newStackPtr]['type'] = 'T_END_NOWDOC'; + } + + $newStackPtr++; + + // Continue, as we're done with this token. + continue; + }//end if + + /* + Enum keyword for PHP < 8.1 + */ + + if ($tokenIsArray === true + && $token[0] === T_STRING + && strtolower($token[1]) === 'enum' + ) { + // Get the next non-empty token. + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === false + || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false + ) { + break; + } + } + + if (isset($tokens[$i]) === true + && is_array($tokens[$i]) === true + && $tokens[$i][0] === T_STRING + ) { + // Modify $tokens directly so we can use it later when converting enum "case". + $tokens[$stackPtr][0] = T_ENUM; + + $newToken = []; + $newToken['code'] = T_ENUM; + $newToken['type'] = 'T_ENUM'; + $newToken['content'] = $token[1]; + $finalTokens[$newStackPtr] = $newToken; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from T_STRING to T_ENUM".PHP_EOL; + } + + $newStackPtr++; + continue; + } + }//end if + + /* + Convert enum "case" to T_ENUM_CASE + */ + + if ($tokenIsArray === true + && $token[0] === T_CASE + && isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false + ) { + $isEnumCase = false; + $scope = 1; + + for ($i = ($stackPtr - 1); $i > 0; $i--) { + if ($tokens[$i] === '}') { + $scope++; + continue; + } + + if ($tokens[$i] === '{') { + $scope--; + continue; + } + + if (is_array($tokens[$i]) === false) { + continue; + } + + if ($scope !== 0) { + continue; + } + + if ($tokens[$i][0] === T_SWITCH) { + break; + } + + if ($tokens[$i][0] === T_ENUM || $tokens[$i][0] === T_ENUM_CASE) { + $isEnumCase = true; + break; + } + }//end for + + if ($isEnumCase === true) { + // Modify $tokens directly so we can use it as optimisation for other enum "case". + $tokens[$stackPtr][0] = T_ENUM_CASE; + + $newToken = []; + $newToken['code'] = T_ENUM_CASE; + $newToken['type'] = 'T_ENUM_CASE'; + $newToken['content'] = $token[1]; + $finalTokens[$newStackPtr] = $newToken; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from T_CASE to T_ENUM_CASE".PHP_EOL; + } + + $newStackPtr++; + continue; + } + }//end if + + /* + As of PHP 8.0 fully qualified, partially qualified and namespace relative + identifier names are tokenized differently. + This "undoes" the new tokenization so the tokenization will be the same in + in PHP 5, 7 and 8. + */ + + if (PHP_VERSION_ID >= 80000 + && $tokenIsArray === true + && ($token[0] === T_NAME_QUALIFIED + || $token[0] === T_NAME_FULLY_QUALIFIED + || $token[0] === T_NAME_RELATIVE) + ) { + $name = $token[1]; + + if ($token[0] === T_NAME_FULLY_QUALIFIED) { + $newToken = []; + $newToken['code'] = T_NS_SEPARATOR; + $newToken['type'] = 'T_NS_SEPARATOR'; + $newToken['content'] = '\\'; + $finalTokens[$newStackPtr] = $newToken; + ++$newStackPtr; + + $name = ltrim($name, '\\'); + } + + if ($token[0] === T_NAME_RELATIVE) { + $newToken = []; + $newToken['code'] = T_NAMESPACE; + $newToken['type'] = 'T_NAMESPACE'; + $newToken['content'] = substr($name, 0, 9); + $finalTokens[$newStackPtr] = $newToken; + ++$newStackPtr; + + $newToken = []; + $newToken['code'] = T_NS_SEPARATOR; + $newToken['type'] = 'T_NS_SEPARATOR'; + $newToken['content'] = '\\'; + $finalTokens[$newStackPtr] = $newToken; + ++$newStackPtr; + + $name = substr($name, 10); + } + + $parts = explode('\\', $name); + $partCount = count($parts); + $lastPart = ($partCount - 1); + + foreach ($parts as $i => $part) { + $newToken = []; + $newToken['code'] = T_STRING; + $newToken['type'] = 'T_STRING'; + $newToken['content'] = $part; + $finalTokens[$newStackPtr] = $newToken; + ++$newStackPtr; + + if ($i !== $lastPart) { + $newToken = []; + $newToken['code'] = T_NS_SEPARATOR; + $newToken['type'] = 'T_NS_SEPARATOR'; + $newToken['content'] = '\\'; + $finalTokens[$newStackPtr] = $newToken; + ++$newStackPtr; + } + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = Tokens::tokenName($token[0]); + $content = Common::prepareForOutput($token[1]); + echo "\t\t* token $stackPtr split into individual tokens; was: $type => $content".PHP_EOL; + } + + continue; + }//end if + + /* + PHP 8.0 Attributes + */ + + if (PHP_VERSION_ID < 80000 + && $token[0] === T_COMMENT + && strpos($token[1], '#[') === 0 + ) { + $subTokens = $this->parsePhpAttribute($tokens, $stackPtr); + if ($subTokens !== null) { + array_splice($tokens, $stackPtr, 1, $subTokens); + $numTokens = count($tokens); + + $tokenIsArray = true; + $token = $tokens[$stackPtr]; + } else { + $token[0] = T_ATTRIBUTE; + } + } + + if ($tokenIsArray === true + && $token[0] === T_ATTRIBUTE + ) { + // Go looking for the close bracket. + $bracketCloser = $this->findCloser($tokens, ($stackPtr + 1), ['[', '#['], ']'); + + $newToken = []; + $newToken['code'] = T_ATTRIBUTE; + $newToken['type'] = 'T_ATTRIBUTE'; + $newToken['content'] = '#['; + $finalTokens[$newStackPtr] = $newToken; + + $tokens[$bracketCloser] = []; + $tokens[$bracketCloser][0] = T_ATTRIBUTE_END; + $tokens[$bracketCloser][1] = ']'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $bracketCloser changed from T_CLOSE_SQUARE_BRACKET to T_ATTRIBUTE_END".PHP_EOL; + } + + $newStackPtr++; + continue; + }//end if + + /* + Tokenize the parameter labels for PHP 8.0 named parameters as a special T_PARAM_NAME + token and ensures that the colon after it is always T_COLON. + */ + + if ($tokenIsArray === true + && ($token[0] === T_STRING + || preg_match('`^[a-zA-Z_\x80-\xff]`', $token[1]) === 1) + ) { + // Get the next non-empty token. + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === false + || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false + ) { + break; + } + } + + if (isset($tokens[$i]) === true + && is_array($tokens[$i]) === false + && $tokens[$i] === ':' + ) { + // Get the previous non-empty token. + for ($j = ($stackPtr - 1); $j > 0; $j--) { + if (is_array($tokens[$j]) === false + || isset(Tokens::$emptyTokens[$tokens[$j][0]]) === false + ) { + break; + } + } + + if (is_array($tokens[$j]) === false + && ($tokens[$j] === '(' + || $tokens[$j] === ',') + ) { + $newToken = []; + $newToken['code'] = T_PARAM_NAME; + $newToken['type'] = 'T_PARAM_NAME'; + $newToken['content'] = $token[1]; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + + // Modify the original token stack so that future checks, like + // determining T_COLON vs T_INLINE_ELSE can handle this correctly. + $tokens[$stackPtr][0] = T_PARAM_NAME; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = Tokens::tokenName($token[0]); + echo "\t\t* token $stackPtr changed from $type to T_PARAM_NAME".PHP_EOL; + } + + continue; + } + }//end if + }//end if + + /* + "readonly" keyword for PHP < 8.1 + */ + + if ($tokenIsArray === true + && strtolower($token[1]) === 'readonly' + && (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false + || $finalTokens[$lastNotEmptyToken]['code'] === T_NEW) + ) { + // Get the next non-whitespace token. + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === false + || isset(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(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', + 'content' => $token[1], + ]; + $newStackPtr++; + + 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 + + /* + Before PHP 7.0, the "yield from" was tokenized as + T_YIELD, T_WHITESPACE and T_STRING. So look for + and change this token in earlier versions. + */ + + if (PHP_VERSION_ID < 70000 + && PHP_VERSION_ID >= 50500 + && $tokenIsArray === true + && $token[0] === T_YIELD + && isset($tokens[($stackPtr + 1)]) === true + && isset($tokens[($stackPtr + 2)]) === true + && $tokens[($stackPtr + 1)][0] === T_WHITESPACE + && $tokens[($stackPtr + 2)][0] === T_STRING + && strtolower($tokens[($stackPtr + 2)][1]) === 'from' + ) { + // Could be multi-line, so adjust the token stack. + $token[0] = T_YIELD_FROM; + $token[1] .= $tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + for ($i = ($stackPtr + 1); $i <= ($stackPtr + 2); $i++) { + $type = Tokens::tokenName($tokens[$i][0]); + $content = Common::prepareForOutput($tokens[$i][1]); + echo "\t\t* token $i merged into T_YIELD_FROM; was: $type => $content".PHP_EOL; + } + } + + $tokens[($stackPtr + 1)] = null; + $tokens[($stackPtr + 2)] = null; + } + + /* + Before PHP 5.5, the yield keyword was tokenized as + T_STRING. So look for and change this token in + earlier versions. + Checks also if it is just "yield" or "yield from". + */ + + if (PHP_VERSION_ID < 50500 + && $tokenIsArray === true + && $token[0] === T_STRING + && strtolower($token[1]) === 'yield' + && isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false + ) { + if (isset($tokens[($stackPtr + 1)]) === true + && isset($tokens[($stackPtr + 2)]) === true + && $tokens[($stackPtr + 1)][0] === T_WHITESPACE + && $tokens[($stackPtr + 2)][0] === T_STRING + && strtolower($tokens[($stackPtr + 2)][1]) === 'from' + ) { + // Could be multi-line, so just just the token stack. + $token[0] = T_YIELD_FROM; + $token[1] .= $tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + for ($i = ($stackPtr + 1); $i <= ($stackPtr + 2); $i++) { + $type = Tokens::tokenName($tokens[$i][0]); + $content = Common::prepareForOutput($tokens[$i][1]); + echo "\t\t* token $i merged into T_YIELD_FROM; was: $type => $content".PHP_EOL; + } + } + + $tokens[($stackPtr + 1)] = null; + $tokens[($stackPtr + 2)] = null; + } else { + $newToken = []; + $newToken['code'] = T_YIELD; + $newToken['type'] = 'T_YIELD'; + $newToken['content'] = $token[1]; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + continue; + }//end if + }//end if + + /* + Before PHP 5.6, the ... operator was tokenized as three + T_STRING_CONCAT tokens in a row. So look for and combine + these tokens in earlier versions. + */ + + if ($tokenIsArray === false + && $token[0] === '.' + && isset($tokens[($stackPtr + 1)]) === true + && isset($tokens[($stackPtr + 2)]) === true + && $tokens[($stackPtr + 1)] === '.' + && $tokens[($stackPtr + 2)] === '.' + ) { + $newToken = []; + $newToken['code'] = T_ELLIPSIS; + $newToken['type'] = 'T_ELLIPSIS'; + $newToken['content'] = '...'; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr += 2; + continue; + } + + /* + Before PHP 5.6, the ** operator was tokenized as two + T_MULTIPLY tokens in a row. So look for and combine + these tokens in earlier versions. + */ + + if ($tokenIsArray === false + && $token[0] === '*' + && isset($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)] === '*' + ) { + $newToken = []; + $newToken['code'] = T_POW; + $newToken['type'] = 'T_POW'; + $newToken['content'] = '**'; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr++; + continue; + } + + /* + Before PHP 5.6, the **= operator was tokenized as + T_MULTIPLY followed by T_MUL_EQUAL. So look for and combine + these tokens in earlier versions. + */ + + if ($tokenIsArray === false + && $token[0] === '*' + && isset($tokens[($stackPtr + 1)]) === true + && is_array($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][1] === '*=' + ) { + $newToken = []; + $newToken['code'] = T_POW_EQUAL; + $newToken['type'] = 'T_POW_EQUAL'; + $newToken['content'] = '**='; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr++; + continue; + } + + /* + Before PHP 7, the ??= operator was tokenized as + T_INLINE_THEN, T_INLINE_THEN, T_EQUAL. + Between PHP 7.0 and 7.3, the ??= operator was tokenized as + T_COALESCE, T_EQUAL. + So look for and combine these tokens in earlier versions. + */ + + if (($tokenIsArray === false + && $token[0] === '?' + && isset($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][0] === '?' + && isset($tokens[($stackPtr + 2)]) === true + && $tokens[($stackPtr + 2)][0] === '=') + || ($tokenIsArray === true + && $token[0] === T_COALESCE + && isset($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][0] === '=') + ) { + $newToken = []; + $newToken['code'] = T_COALESCE_EQUAL; + $newToken['type'] = 'T_COALESCE_EQUAL'; + $newToken['content'] = '??='; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr++; + + if ($tokenIsArray === false) { + // Pre PHP 7. + $stackPtr++; + } + + continue; + } + + /* + Before PHP 7, the ?? operator was tokenized as + T_INLINE_THEN followed by T_INLINE_THEN. + So look for and combine these tokens in earlier versions. + */ + + if ($tokenIsArray === false + && $token[0] === '?' + && isset($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][0] === '?' + ) { + $newToken = []; + $newToken['code'] = T_COALESCE; + $newToken['type'] = 'T_COALESCE'; + $newToken['content'] = '??'; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr++; + continue; + } + + /* + Before PHP 8, the ?-> operator was tokenized as + T_INLINE_THEN followed by T_OBJECT_OPERATOR. + So look for and combine these tokens in earlier versions. + */ + + if ($tokenIsArray === false + && $token[0] === '?' + && isset($tokens[($stackPtr + 1)]) === true + && is_array($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][0] === T_OBJECT_OPERATOR + ) { + $newToken = []; + $newToken['code'] = T_NULLSAFE_OBJECT_OPERATOR; + $newToken['type'] = 'T_NULLSAFE_OBJECT_OPERATOR'; + $newToken['content'] = '?->'; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr++; + continue; + } + + /* + Before PHP 7.4, underscores inside T_LNUMBER and T_DNUMBER + tokens split the token with a T_STRING. So look for + and change these tokens in earlier versions. + */ + + if (PHP_VERSION_ID < 70400 + && ($tokenIsArray === true + && ($token[0] === T_LNUMBER + || $token[0] === T_DNUMBER) + && isset($tokens[($stackPtr + 1)]) === true + && is_array($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][0] === T_STRING + && $tokens[($stackPtr + 1)][1][0] === '_') + ) { + $newContent = $token[1]; + $newType = $token[0]; + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === false) { + break; + } + + if ($tokens[$i][0] === T_LNUMBER + || $tokens[$i][0] === T_DNUMBER + ) { + $newContent .= $tokens[$i][1]; + continue; + } + + if ($tokens[$i][0] === T_STRING + && $tokens[$i][1][0] === '_' + && ((strpos($newContent, '0x') === 0 + && preg_match('`^((? PHP_INT_MAX) + || (stripos($newContent, '0b') === 0 && bindec(str_replace('_', '', $newContent)) > PHP_INT_MAX) + || (stripos($newContent, '0o') === 0 && octdec(str_replace('_', '', $newContent)) > PHP_INT_MAX) + || (stripos($newContent, '0x') !== 0 + && (stripos($newContent, 'e') !== false || strpos($newContent, '.') !== false)) + || (strpos($newContent, '0') === 0 && stripos($newContent, '0x') !== 0 + && stripos($newContent, '0b') !== 0 && octdec(str_replace('_', '', $newContent)) > PHP_INT_MAX) + || (strpos($newContent, '0') !== 0 && str_replace('_', '', $newContent) > PHP_INT_MAX)) + ) { + $newType = T_DNUMBER; + } + + $newToken = []; + $newToken['code'] = $newType; + $newToken['type'] = Tokens::tokenName($newType); + $newToken['content'] = $newContent; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr = ($i - 1); + continue; + }//end if + + /* + Backfill the T_MATCH token for PHP versions < 8.0 and + do initial correction for non-match expression T_MATCH tokens + to T_STRING for PHP >= 8.0. + A final check for non-match expression T_MATCH tokens is done + in PHP::processAdditional(). + */ + + if ($tokenIsArray === true + && (($token[0] === T_STRING + && strtolower($token[1]) === 'match') + || $token[0] === T_MATCH) + ) { + $isMatch = false; + for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { + if (isset($tokens[$x][0], Tokens::$emptyTokens[$tokens[$x][0]]) === true) { + continue; + } + + if ($tokens[$x] !== '(') { + // This is not a match expression. + break; + } + + if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true) { + // Also not a match expression. + break; + } + + $isMatch = true; + break; + }//end for + + if ($isMatch === true && $token[0] === T_STRING) { + $newToken = []; + $newToken['code'] = T_MATCH; + $newToken['type'] = 'T_MATCH'; + $newToken['content'] = $token[1]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from T_STRING to T_MATCH".PHP_EOL; + } + + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + continue; + } else if ($isMatch === false && $token[0] === T_MATCH) { + // PHP 8.0, match keyword, but not a match expression. + $newToken = []; + $newToken['code'] = T_STRING; + $newToken['type'] = 'T_STRING'; + $newToken['content'] = $token[1]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from T_MATCH to T_STRING".PHP_EOL; + } + + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + continue; + }//end if + }//end if + + /* + Retokenize the T_DEFAULT in match control structures as T_MATCH_DEFAULT + to prevent scope being set and the scope for switch default statements + breaking. + */ + + if ($tokenIsArray === true + && $token[0] === T_DEFAULT + && isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false + ) { + for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { + if ($tokens[$x] === ',') { + // Skip over potential trailing comma (supported in PHP). + continue; + } + + if (is_array($tokens[$x]) === false + || isset(Tokens::$emptyTokens[$tokens[$x][0]]) === false + ) { + // Non-empty, non-comma content. + break; + } + } + + if (isset($tokens[$x]) === true + && is_array($tokens[$x]) === true + && $tokens[$x][0] === T_DOUBLE_ARROW + ) { + // Modify the original token stack for the double arrow so that + // future checks can disregard the double arrow token more easily. + // For match expression "case" statements, this is handled + // in PHP::processAdditional(). + $tokens[$x][0] = T_MATCH_ARROW; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $x changed from T_DOUBLE_ARROW to T_MATCH_ARROW".PHP_EOL; + } + + $newToken = []; + $newToken['code'] = T_MATCH_DEFAULT; + $newToken['type'] = 'T_MATCH_DEFAULT'; + $newToken['content'] = $token[1]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from T_DEFAULT to T_MATCH_DEFAULT".PHP_EOL; + } + + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + continue; + }//end if + }//end if + + /* + Convert ? to T_NULLABLE OR T_INLINE_THEN + */ + + if ($tokenIsArray === false && $token[0] === '?') { + $newToken = []; + $newToken['content'] = '?'; + + // For typed constants, we only need to check the token before the ? to be sure. + if ($finalTokens[$lastNotEmptyToken]['code'] === T_CONST) { + $newToken['code'] = T_NULLABLE; + $newToken['type'] = 'T_NULLABLE'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from ? to T_NULLABLE".PHP_EOL; + } + + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + continue; + } + + /* + * Check if the next non-empty token is one of the tokens which can be used + * in type declarations. If not, it's definitely a ternary. + * 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. + */ + + $lastRelevantNonEmpty = null; + + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === true) { + $tokenType = $tokens[$i][0]; + } else { + $tokenType = $tokens[$i]; + } + + if (isset(Tokens::$emptyTokens[$tokenType]) === true) { + 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 + ) { + $lastRelevantNonEmpty = $tokenType; + continue; + } + + if (($tokenType !== T_CALLABLE + && isset($lastRelevantNonEmpty) === false) + || ($lastRelevantNonEmpty === T_ARRAY + && $tokenType === '(') + || (($lastRelevantNonEmpty === T_STRING + || $lastRelevantNonEmpty === T_NAME_FULLY_QUALIFIED + || $lastRelevantNonEmpty === T_NAME_RELATIVE + || $lastRelevantNonEmpty === T_NAME_QUALIFIED) + && ($tokenType === T_DOUBLE_COLON + || $tokenType === '(' + || $tokenType === ':')) + ) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from ? to T_INLINE_THEN".PHP_EOL; + } + + $newToken['code'] = T_INLINE_THEN; + $newToken['type'] = 'T_INLINE_THEN'; + + $insideInlineIf[] = $stackPtr; + + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + continue 2; + } + + break; + }//end for + + /* + * This can still be a nullable type or a ternary. + * Do additional checking. + */ + + $prevNonEmpty = null; + $lastSeenNonEmpty = null; + + for ($i = ($stackPtr - 1); $i >= 0; $i--) { + if (is_array($tokens[$i]) === true) { + $tokenType = $tokens[$i][0]; + } else { + $tokenType = $tokens[$i]; + } + + if ($tokenType === T_STATIC + && ($lastSeenNonEmpty === T_DOUBLE_COLON + || $lastSeenNonEmpty === '(') + ) { + $lastSeenNonEmpty = $tokenType; + continue; + } + + if ($prevNonEmpty === null + && isset(Tokens::$emptyTokens[$tokenType]) === false + ) { + // Found the previous non-empty token. + if ($tokenType === ':' || $tokenType === ',' || $tokenType === T_ATTRIBUTE_END) { + $newToken['code'] = T_NULLABLE; + $newToken['type'] = 'T_NULLABLE'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from ? to T_NULLABLE".PHP_EOL; + } + + break; + } + + $prevNonEmpty = $tokenType; + } + + if ($tokenType === T_FUNCTION + || $tokenType === T_FN + || isset(Tokens::$methodPrefixes[$tokenType]) === true + || $tokenType === T_VAR + ) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from ? to T_NULLABLE".PHP_EOL; + } + + $newToken['code'] = T_NULLABLE; + $newToken['type'] = 'T_NULLABLE'; + break; + } else if (in_array($tokenType, [T_DOUBLE_ARROW, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, '=', '{', ';'], true) === true) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from ? to T_INLINE_THEN".PHP_EOL; + } + + $newToken['code'] = T_INLINE_THEN; + $newToken['type'] = 'T_INLINE_THEN'; + + $insideInlineIf[] = $stackPtr; + break; + } + + if (isset(Tokens::$emptyTokens[$tokenType]) === false) { + $lastSeenNonEmpty = $tokenType; + } + }//end for + + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + continue; + }//end if + + /* + Tokens after a double colon may look like scope openers, + such as when writing code like Foo::NAMESPACE, but they are + only ever variables or strings. + */ + + if ($stackPtr > 1 + && (is_array($tokens[($stackPtr - 1)]) === true + && $tokens[($stackPtr - 1)][0] === T_PAAMAYIM_NEKUDOTAYIM) + && $tokenIsArray === true + && $token[0] !== T_STRING + && $token[0] !== T_VARIABLE + && $token[0] !== T_DOLLAR + && isset(Tokens::$emptyTokens[$token[0]]) === false + ) { + $newToken = []; + $newToken['code'] = T_STRING; + $newToken['type'] = 'T_STRING'; + $newToken['content'] = $token[1]; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + continue; + } + + /* + Backfill the T_FN token for PHP versions < 7.4. + */ + + if ($tokenIsArray === true + && $token[0] === T_STRING + && strtolower($token[1]) === 'fn' + ) { + // Modify the original token stack so that + // future checks (like looking for T_NULLABLE) can + // detect the T_FN token more easily. + $tokens[$stackPtr][0] = T_FN; + $token[0] = T_FN; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from T_STRING to T_FN".PHP_EOL; + } + } + + /* + This is a special condition for T_ARRAY tokens used for + function return types. We want to keep the parenthesis map clean, + so let's tag these tokens as T_STRING. + */ + + if ($tokenIsArray === true + && ($token[0] === T_FUNCTION + || $token[0] === T_FN) + && $finalTokens[$lastNotEmptyToken]['code'] !== T_USE + ) { + // Go looking for the colon to start the return type hint. + // Start by finding the closing parenthesis of the function. + $parenthesisStack = []; + $parenthesisCloser = false; + for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { + if (is_array($tokens[$x]) === false && $tokens[$x] === '(') { + $parenthesisStack[] = $x; + } else if (is_array($tokens[$x]) === false && $tokens[$x] === ')') { + array_pop($parenthesisStack); + if (empty($parenthesisStack) === true) { + $parenthesisCloser = $x; + break; + } + } + } + + if ($parenthesisCloser !== false) { + for ($x = ($parenthesisCloser + 1); $x < $numTokens; $x++) { + if (is_array($tokens[$x]) === false + || isset(Tokens::$emptyTokens[$tokens[$x][0]]) === false + ) { + // Non-empty content. + if (is_array($tokens[$x]) === true && $tokens[$x][0] === T_USE) { + // Found a use statements, so search ahead for the closing parenthesis. + for ($x += 1; $x < $numTokens; $x++) { + if (is_array($tokens[$x]) === false && $tokens[$x] === ')') { + continue(2); + } + } + } + + break; + } + } + + if (isset($tokens[$x]) === true + && is_array($tokens[$x]) === false + && $tokens[$x] === ':' + ) { + // Find the start of the return type. + for ($x += 1; $x < $numTokens; $x++) { + if (is_array($tokens[$x]) === true + && isset(Tokens::$emptyTokens[$tokens[$x][0]]) === true + ) { + // Whitespace or comments before the return type. + continue; + } + + if (is_array($tokens[$x]) === false && $tokens[$x] === '?') { + // Found a nullable operator, so skip it. + // But also convert the token to save the tokenizer + // a bit of time later on. + $tokens[$x] = [ + T_NULLABLE, + '?', + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $x changed from ? to T_NULLABLE".PHP_EOL; + } + + continue; + } + + break; + }//end for + }//end if + }//end if + }//end if + + /* + Before PHP 7, the <=> operator was tokenized as + T_IS_SMALLER_OR_EQUAL followed by T_GREATER_THAN. + So look for and combine these tokens in earlier versions. + */ + + if ($tokenIsArray === true + && $token[0] === T_IS_SMALLER_OR_EQUAL + && isset($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][0] === '>' + ) { + $newToken = []; + $newToken['code'] = T_SPACESHIP; + $newToken['type'] = 'T_SPACESHIP'; + $newToken['content'] = '<=>'; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr++; + continue; + } + + /* + PHP doesn't assign a token to goto labels, so we have to. + These are just string tokens with a single colon after them. Double + colons are already tokenized and so don't interfere with this check. + But we do have to account for CASE statements, that look just like + goto labels. + */ + + if ($tokenIsArray === true + && $token[0] === T_STRING + && isset($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)] === ':' + && (is_array($tokens[($stackPtr - 1)]) === false + || $tokens[($stackPtr - 1)][0] !== T_PAAMAYIM_NEKUDOTAYIM) + ) { + $stopTokens = [ + T_CASE => true, + T_SEMICOLON => true, + T_OPEN_TAG => true, + T_OPEN_CURLY_BRACKET => true, + T_INLINE_THEN => true, + T_ENUM => true, + ]; + + for ($x = ($newStackPtr - 1); $x > 0; $x--) { + if (isset($stopTokens[$finalTokens[$x]['code']]) === true) { + break; + } + } + + if ($finalTokens[$x]['code'] !== T_CASE + && $finalTokens[$x]['code'] !== T_INLINE_THEN + && $finalTokens[$x]['code'] !== T_ENUM + ) { + $finalTokens[$newStackPtr] = [ + 'content' => $token[1].':', + 'code' => T_GOTO_LABEL, + 'type' => 'T_GOTO_LABEL', + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $stackPtr changed from T_STRING to T_GOTO_LABEL".PHP_EOL; + echo "\t\t* skipping T_COLON token ".($stackPtr + 1).PHP_EOL; + } + + $newStackPtr++; + $stackPtr++; + continue; + } + }//end if + + /* + If this token has newlines in its content, split each line up + and create a new token for each line. We do this so it's easier + to ascertain where errors occur on a line. + Note that $token[1] is the token's content. + */ + + if ($tokenIsArray === true && strpos($token[1], $this->eolChar) !== false) { + $tokenLines = explode($this->eolChar, $token[1]); + $numLines = count($tokenLines); + $newToken = [ + 'type' => Tokens::tokenName($token[0]), + 'code' => $token[0], + 'content' => '', + ]; + + for ($i = 0; $i < $numLines; $i++) { + $newToken['content'] = $tokenLines[$i]; + if ($i === ($numLines - 1)) { + if ($tokenLines[$i] === '') { + break; + } + } else { + $newToken['content'] .= $this->eolChar; + } + + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + } + } else { + // Some T_STRING tokens should remain that way due to their context. + if ($tokenIsArray === true && $token[0] === T_STRING) { + $preserveTstring = false; + + // True/false/parent/self/static in typed constants should be fixed to their own token, + // but the constant name should not be. + if ((isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true + && $finalTokens[$lastNotEmptyToken]['code'] === T_CONST) + || $insideConstDeclaration === true + ) { + // Find the next non-empty token. + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === true + && isset(Tokens::$emptyTokens[$tokens[$i][0]]) === true + ) { + continue; + } + + break; + } + + if ($tokens[$i] === '=') { + $preserveTstring = true; + $insideConstDeclaration = false; + } + } else if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true + && $finalTokens[$lastNotEmptyToken]['code'] !== T_CONST + ) { + $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(Tokens::$emptyTokens[$finalTokens[$i]['code']]) === true) { + continue; + } + + if ($finalTokens[$i]['code'] === T_FUNCTION) { + $preserveTstring = true; + } + + 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(Tokens::$emptyTokens[$tokens[$i][0]]) === true + ) { + continue; + } + + if ($tokens[$i][0] === '(') { + $preserveTstring = true; + } + + break; + } + }//end if + + if ($preserveTstring === true) { + $finalTokens[$newStackPtr] = [ + 'code' => T_STRING, + 'type' => 'T_STRING', + 'content' => $token[1], + ]; + + $newStackPtr++; + continue; + } + }//end if + + $newToken = null; + if ($tokenIsArray === false) { + if (isset(self::$resolveTokenCache[$token[0]]) === true) { + $newToken = self::$resolveTokenCache[$token[0]]; + } + } else { + $cacheKey = null; + if ($token[0] === T_STRING) { + $cacheKey = strtolower($token[1]); + } else if ($token[0] !== T_CURLY_OPEN) { + $cacheKey = $token[0]; + } + + if ($cacheKey !== null && isset(self::$resolveTokenCache[$cacheKey]) === true) { + $newToken = self::$resolveTokenCache[$cacheKey]; + $newToken['content'] = $token[1]; + } + } + + if ($newToken === null) { + $newToken = self::standardiseToken($token); + } + + // Convert colons that are actually the ELSE component of an + // inline IF statement. + if (empty($insideInlineIf) === false && $newToken['code'] === T_COLON) { + $isInlineIf = true; + + // Make sure this isn't a named parameter label. + // Get the previous non-empty token. + for ($i = ($stackPtr - 1); $i > 0; $i--) { + if (is_array($tokens[$i]) === false + || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false + ) { + break; + } + } + + if ($tokens[$i][0] === T_PARAM_NAME) { + $isInlineIf = false; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token is parameter label, not T_INLINE_ELSE".PHP_EOL; + } + } + + if ($isInlineIf === true) { + // Make sure this isn't a return type separator. + for ($i = ($stackPtr - 1); $i > 0; $i--) { + if (is_array($tokens[$i]) === false + || ($tokens[$i][0] !== T_DOC_COMMENT + && $tokens[$i][0] !== T_COMMENT + && $tokens[$i][0] !== T_WHITESPACE) + ) { + break; + } + } + + if ($tokens[$i] === ')') { + $parenCount = 1; + for ($i--; $i > 0; $i--) { + if ($tokens[$i] === '(') { + $parenCount--; + if ($parenCount === 0) { + break; + } + } else if ($tokens[$i] === ')') { + $parenCount++; + } + } + + // We've found the open parenthesis, so if the previous + // non-empty token is FUNCTION or USE, this is a return type. + // Note that we need to skip T_STRING tokens here as these + // can be function names. + for ($i--; $i > 0; $i--) { + if (is_array($tokens[$i]) === false + || ($tokens[$i][0] !== T_DOC_COMMENT + && $tokens[$i][0] !== T_COMMENT + && $tokens[$i][0] !== T_WHITESPACE + && $tokens[$i][0] !== T_STRING) + ) { + break; + } + } + + if ($tokens[$i][0] === T_FUNCTION || $tokens[$i][0] === T_FN || $tokens[$i][0] === T_USE) { + $isInlineIf = false; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token is return type, not T_INLINE_ELSE".PHP_EOL; + } + } + }//end if + }//end if + + // Check to see if this is a CASE or DEFAULT opener. + if ($isInlineIf === true) { + $inlineIfToken = $insideInlineIf[(count($insideInlineIf) - 1)]; + for ($i = $stackPtr; $i > $inlineIfToken; $i--) { + if (is_array($tokens[$i]) === true + && ($tokens[$i][0] === T_CASE + || $tokens[$i][0] === T_DEFAULT) + ) { + $isInlineIf = false; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token is T_CASE or T_DEFAULT opener, not T_INLINE_ELSE".PHP_EOL; + } + + break; + } + + if (is_array($tokens[$i]) === false + && ($tokens[$i] === ';' + || $tokens[$i] === '{' + || $tokens[$i] === '}') + ) { + break; + } + }//end for + }//end if + + if ($isInlineIf === true) { + array_pop($insideInlineIf); + $newToken['code'] = T_INLINE_ELSE; + $newToken['type'] = 'T_INLINE_ELSE'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token changed from T_COLON to T_INLINE_ELSE".PHP_EOL; + } + } + }//end if + + // This is a special condition for T_ARRAY tokens used for anything else + // but array declarations, like type hinting function arguments as + // being arrays. + // We want to keep the parenthesis map clean, so let's tag these tokens as + // T_STRING. + if ($newToken['code'] === T_ARRAY) { + for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { + if (is_array($tokens[$i]) === false + || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false + ) { + // Non-empty content. + break; + } + } + + if ($i !== $numTokens && $tokens[$i] !== '(') { + $newToken['code'] = T_STRING; + $newToken['type'] = 'T_STRING'; + } + } + + // This is a special case when checking PHP 5.5+ code in PHP < 5.5 + // where "finally" should be T_FINALLY instead of T_STRING. + if ($newToken['code'] === T_STRING + && strtolower($newToken['content']) === 'finally' + && $finalTokens[$lastNotEmptyToken]['code'] === T_CLOSE_CURLY_BRACKET + ) { + $newToken['code'] = T_FINALLY; + $newToken['type'] = 'T_FINALLY'; + } + + // This is a special case for PHP 5.6 use function and use const + // where "function" and "const" should be T_STRING instead of T_FUNCTION + // and T_CONST. + if (($newToken['code'] === T_FUNCTION + || $newToken['code'] === T_CONST) + && ($finalTokens[$lastNotEmptyToken]['code'] === T_USE || $insideUseGroup === true) + ) { + $newToken['code'] = T_STRING; + $newToken['type'] = 'T_STRING'; + } + + // This is a special case for use groups in PHP 7+ where leaving + // the curly braces as their normal tokens would confuse + // the scope map and sniffs. + if ($newToken['code'] === T_OPEN_CURLY_BRACKET + && $finalTokens[$lastNotEmptyToken]['code'] === T_NS_SEPARATOR + ) { + $newToken['code'] = T_OPEN_USE_GROUP; + $newToken['type'] = 'T_OPEN_USE_GROUP'; + $insideUseGroup = true; + } + + if ($insideUseGroup === true && $newToken['code'] === T_CLOSE_CURLY_BRACKET) { + $newToken['code'] = T_CLOSE_USE_GROUP; + $newToken['type'] = 'T_CLOSE_USE_GROUP'; + $insideUseGroup = false; + } + + $finalTokens[$newStackPtr] = $newToken; + $newStackPtr++; + }//end if + }//end for + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** END PHP TOKENIZING ***".PHP_EOL; + } + + return $finalTokens; + + }//end tokenize() + + + /** + * Performs additional processing after main tokenizing. + * + * This additional processing checks for CASE statements that are using curly + * braces for scope openers and closers. It also turns some T_FUNCTION tokens + * into T_CLOSURE when they are not standard function definitions. It also + * detects short array syntax and converts those square brackets into new tokens. + * It also corrects some usage of the static and class keywords. It also + * assigns tokens to function return types. + * + * @return void + */ + protected function processAdditional() + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** START ADDITIONAL PHP PROCESSING ***".PHP_EOL; + } + + $this->createAttributesNestingMap(); + + $numTokens = count($this->tokens); + $lastSeenTypeToken = $numTokens; + + for ($i = ($numTokens - 1); $i >= 0; $i--) { + // Check for any unset scope conditions due to alternate IF/ENDIF syntax. + if (isset($this->tokens[$i]['scope_opener']) === true + && isset($this->tokens[$i]['scope_condition']) === false + ) { + $this->tokens[$i]['scope_condition'] = $this->tokens[$this->tokens[$i]['scope_opener']]['scope_condition']; + } + + if ($this->tokens[$i]['code'] === T_FUNCTION) { + /* + Detect functions that are actually closures and + assign them a different token. + */ + + if (isset($this->tokens[$i]['scope_opener']) === true) { + for ($x = ($i + 1); $x < $numTokens; $x++) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false + && $this->tokens[$x]['code'] !== T_BITWISE_AND + ) { + break; + } + } + + if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { + $this->tokens[$i]['code'] = T_CLOSURE; + $this->tokens[$i]['type'] = 'T_CLOSURE'; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$i]['line']; + echo "\t* token $i on line $line changed from T_FUNCTION to T_CLOSURE".PHP_EOL; + } + + for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { + if (isset($this->tokens[$x]['conditions'][$i]) === false) { + continue; + } + + $this->tokens[$x]['conditions'][$i] = T_CLOSURE; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$x]['type']; + echo "\t\t* cleaned $x ($type) *".PHP_EOL; + } + } + } + }//end if + + continue; + } else if ($this->tokens[$i]['code'] === T_CLASS && isset($this->tokens[$i]['scope_opener']) === true) { + /* + Detect anonymous classes and assign them a different token. + */ + + for ($x = ($i + 1); $x < $numTokens; $x++) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { + break; + } + } + + if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS + || $this->tokens[$x]['code'] === T_OPEN_CURLY_BRACKET + || $this->tokens[$x]['code'] === T_EXTENDS + || $this->tokens[$x]['code'] === T_IMPLEMENTS + ) { + $this->tokens[$i]['code'] = T_ANON_CLASS; + $this->tokens[$i]['type'] = 'T_ANON_CLASS'; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$i]['line']; + echo "\t* token $i on line $line changed from T_CLASS to T_ANON_CLASS".PHP_EOL; + } + + if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS + && isset($this->tokens[$x]['parenthesis_closer']) === true + ) { + $closer = $this->tokens[$x]['parenthesis_closer']; + + $this->tokens[$i]['parenthesis_opener'] = $x; + $this->tokens[$i]['parenthesis_closer'] = $closer; + $this->tokens[$i]['parenthesis_owner'] = $i; + $this->tokens[$x]['parenthesis_owner'] = $i; + $this->tokens[$closer]['parenthesis_owner'] = $i; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$i]['line']; + echo "\t\t* added parenthesis keys to T_ANON_CLASS token $i on line $line".PHP_EOL; + } + } + + for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { + if (isset($this->tokens[$x]['conditions'][$i]) === false) { + continue; + } + + $this->tokens[$x]['conditions'][$i] = T_ANON_CLASS; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$x]['type']; + echo "\t\t* cleaned $x ($type) *".PHP_EOL; + } + } + }//end if + + continue; + } else if ($this->tokens[$i]['code'] === T_FN && isset($this->tokens[($i + 1)]) === true) { + // Possible arrow function. + for ($x = ($i + 1); $x < $numTokens; $x++) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false + && $this->tokens[$x]['code'] !== T_BITWISE_AND + ) { + // Non-whitespace content. + break; + } + } + + if (isset($this->tokens[$x]) === true && $this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { + $ignore = Tokens::$emptyTokens; + $ignore += [ + T_ARRAY => T_ARRAY, + T_CALLABLE => T_CALLABLE, + T_COLON => T_COLON, + T_NAMESPACE => T_NAMESPACE, + T_NS_SEPARATOR => T_NS_SEPARATOR, + T_NULL => T_NULL, + T_TRUE => T_TRUE, + T_FALSE => T_FALSE, + T_NULLABLE => T_NULLABLE, + T_PARENT => T_PARENT, + T_SELF => T_SELF, + T_STATIC => T_STATIC, + T_STRING => T_STRING, + T_TYPE_UNION => T_TYPE_UNION, + T_TYPE_INTERSECTION => T_TYPE_INTERSECTION, + T_TYPE_OPEN_PARENTHESIS => T_TYPE_OPEN_PARENTHESIS, + T_TYPE_CLOSE_PARENTHESIS => T_TYPE_CLOSE_PARENTHESIS, + ]; + + $closer = $this->tokens[$x]['parenthesis_closer']; + for ($arrow = ($closer + 1); $arrow < $numTokens; $arrow++) { + if (isset($ignore[$this->tokens[$arrow]['code']]) === false) { + break; + } + } + + if ($this->tokens[$arrow]['code'] === T_DOUBLE_ARROW) { + $endTokens = [ + T_COLON => true, + T_COMMA => true, + T_SEMICOLON => true, + T_CLOSE_PARENTHESIS => true, + T_CLOSE_SQUARE_BRACKET => true, + T_CLOSE_CURLY_BRACKET => true, + T_CLOSE_SHORT_ARRAY => true, + T_OPEN_TAG => true, + T_CLOSE_TAG => true, + ]; + + $inTernary = false; + $lastEndToken = null; + + for ($scopeCloser = ($arrow + 1); $scopeCloser < $numTokens; $scopeCloser++) { + // Arrow function closer should never be shared with the closer of a match + // control structure. + if (isset($this->tokens[$scopeCloser]['scope_closer'], $this->tokens[$scopeCloser]['scope_condition']) === true + && $scopeCloser === $this->tokens[$scopeCloser]['scope_closer'] + && $this->tokens[$this->tokens[$scopeCloser]['scope_condition']]['code'] === T_MATCH + ) { + if ($arrow < $this->tokens[$scopeCloser]['scope_condition']) { + // Match in return value of arrow function. Move on to the next token. + continue; + } + + // Arrow function as return value for the last match case without trailing comma. + if ($lastEndToken !== null) { + $scopeCloser = $lastEndToken; + break; + } + + for ($lastNonEmpty = ($scopeCloser - 1); $lastNonEmpty > $arrow; $lastNonEmpty--) { + if (isset(Tokens::$emptyTokens[$this->tokens[$lastNonEmpty]['code']]) === false) { + $scopeCloser = $lastNonEmpty; + break 2; + } + } + } + + if (isset($endTokens[$this->tokens[$scopeCloser]['code']]) === true) { + if ($lastEndToken !== null + && ((isset($this->tokens[$scopeCloser]['parenthesis_opener']) === true + && $this->tokens[$scopeCloser]['parenthesis_opener'] < $arrow) + || (isset($this->tokens[$scopeCloser]['bracket_opener']) === true + && $this->tokens[$scopeCloser]['bracket_opener'] < $arrow)) + ) { + for ($lastNonEmpty = ($scopeCloser - 1); $lastNonEmpty > $arrow; $lastNonEmpty--) { + if (isset(Tokens::$emptyTokens[$this->tokens[$lastNonEmpty]['code']]) === false) { + $scopeCloser = $lastNonEmpty; + break; + } + } + } + + break; + } + + if ($inTernary === false + && isset($this->tokens[$scopeCloser]['scope_closer'], $this->tokens[$scopeCloser]['scope_condition']) === true + && $scopeCloser === $this->tokens[$scopeCloser]['scope_closer'] + && $this->tokens[$this->tokens[$scopeCloser]['scope_condition']]['code'] === T_FN + ) { + // Found a nested arrow function that already has the closer set and is in + // the same scope as us, so we can use its closer. + break; + } + + if (isset($this->tokens[$scopeCloser]['scope_closer']) === true + && $this->tokens[$scopeCloser]['code'] !== T_INLINE_ELSE + && $this->tokens[$scopeCloser]['code'] !== T_END_HEREDOC + && $this->tokens[$scopeCloser]['code'] !== T_END_NOWDOC + ) { + // We minus 1 here in case the closer can be shared with us. + $scopeCloser = ($this->tokens[$scopeCloser]['scope_closer'] - 1); + continue; + } + + if (isset($this->tokens[$scopeCloser]['parenthesis_closer']) === true) { + $scopeCloser = $this->tokens[$scopeCloser]['parenthesis_closer']; + $lastEndToken = $scopeCloser; + continue; + } + + if (isset($this->tokens[$scopeCloser]['bracket_closer']) === true) { + $scopeCloser = $this->tokens[$scopeCloser]['bracket_closer']; + $lastEndToken = $scopeCloser; + continue; + } + + if ($this->tokens[$scopeCloser]['code'] === T_INLINE_THEN) { + $inTernary = true; + continue; + } + + if ($this->tokens[$scopeCloser]['code'] === T_INLINE_ELSE) { + if ($inTernary === false) { + break; + } + + $inTernary = false; + continue; + } + }//end for + + if ($scopeCloser !== $numTokens) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$i]['line']; + echo "\t=> token $i on line $line processed as arrow function".PHP_EOL; + echo "\t\t* scope opener set to $arrow *".PHP_EOL; + echo "\t\t* scope closer set to $scopeCloser *".PHP_EOL; + echo "\t\t* parenthesis opener set to $x *".PHP_EOL; + echo "\t\t* parenthesis closer set to $closer *".PHP_EOL; + } + + $this->tokens[$i]['code'] = T_FN; + $this->tokens[$i]['type'] = 'T_FN'; + $this->tokens[$i]['scope_condition'] = $i; + $this->tokens[$i]['scope_opener'] = $arrow; + $this->tokens[$i]['scope_closer'] = $scopeCloser; + $this->tokens[$i]['parenthesis_owner'] = $i; + $this->tokens[$i]['parenthesis_opener'] = $x; + $this->tokens[$i]['parenthesis_closer'] = $closer; + + $this->tokens[$arrow]['code'] = T_FN_ARROW; + $this->tokens[$arrow]['type'] = 'T_FN_ARROW'; + + $this->tokens[$arrow]['scope_condition'] = $i; + $this->tokens[$arrow]['scope_opener'] = $arrow; + $this->tokens[$arrow]['scope_closer'] = $scopeCloser; + $this->tokens[$scopeCloser]['scope_condition'] = $i; + $this->tokens[$scopeCloser]['scope_opener'] = $arrow; + $this->tokens[$scopeCloser]['scope_closer'] = $scopeCloser; + + $opener = $this->tokens[$i]['parenthesis_opener']; + $closer = $this->tokens[$i]['parenthesis_closer']; + $this->tokens[$opener]['parenthesis_owner'] = $i; + $this->tokens[$closer]['parenthesis_owner'] = $i; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$arrow]['line']; + echo "\t\t* token $arrow on line $line changed from T_DOUBLE_ARROW to T_FN_ARROW".PHP_EOL; + } + }//end if + }//end if + }//end if + + // If after all that, the extra tokens are not set, this is not an arrow function. + if (isset($this->tokens[$i]['scope_closer']) === false) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$i]['line']; + echo "\t=> token $i on line $line is not an arrow function".PHP_EOL; + echo "\t\t* token changed from T_FN to T_STRING".PHP_EOL; + } + + $this->tokens[$i]['code'] = T_STRING; + $this->tokens[$i]['type'] = 'T_STRING'; + } + } else if ($this->tokens[$i]['code'] === T_OPEN_SQUARE_BRACKET) { + if (isset($this->tokens[$i]['bracket_closer']) === false) { + continue; + } + + // Unless there is a variable or a bracket before this token, + // it is the start of an array being defined using the short syntax. + $isShortArray = false; + $allowed = [ + T_CLOSE_SQUARE_BRACKET => T_CLOSE_SQUARE_BRACKET, + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_CLOSE_PARENTHESIS => T_CLOSE_PARENTHESIS, + T_VARIABLE => T_VARIABLE, + T_OBJECT_OPERATOR => T_OBJECT_OPERATOR, + T_NULLSAFE_OBJECT_OPERATOR => T_NULLSAFE_OBJECT_OPERATOR, + T_STRING => T_STRING, + T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, + T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, + ]; + $allowed += Tokens::$magicConstants; + + for ($x = ($i - 1); $x >= 0; $x--) { + // If we hit a scope opener, the statement has ended + // without finding anything, so it's probably an array + // using PHP 7.1 short list syntax. + if (isset($this->tokens[$x]['scope_opener']) === true) { + $isShortArray = true; + break; + } + + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { + // Allow for control structures without braces. + if (($this->tokens[$x]['code'] === T_CLOSE_PARENTHESIS + && isset($this->tokens[$x]['parenthesis_owner']) === true + && isset(Tokens::$scopeOpeners[$this->tokens[$this->tokens[$x]['parenthesis_owner']]['code']]) === true) + || isset($allowed[$this->tokens[$x]['code']]) === false + ) { + $isShortArray = true; + } + + break; + } + }//end for + + if ($isShortArray === true) { + $this->tokens[$i]['code'] = T_OPEN_SHORT_ARRAY; + $this->tokens[$i]['type'] = 'T_OPEN_SHORT_ARRAY'; + + $closer = $this->tokens[$i]['bracket_closer']; + $this->tokens[$closer]['code'] = T_CLOSE_SHORT_ARRAY; + $this->tokens[$closer]['type'] = 'T_CLOSE_SHORT_ARRAY'; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$i]['line']; + echo "\t* token $i on line $line changed from T_OPEN_SQUARE_BRACKET to T_OPEN_SHORT_ARRAY".PHP_EOL; + $line = $this->tokens[$closer]['line']; + echo "\t* token $closer on line $line changed from T_CLOSE_SQUARE_BRACKET to T_CLOSE_SHORT_ARRAY".PHP_EOL; + } + } + + continue; + } else if ($this->tokens[$i]['code'] === T_MATCH) { + if (isset($this->tokens[$i]['scope_opener'], $this->tokens[$i]['scope_closer']) === false) { + // Not a match expression after all. + $this->tokens[$i]['code'] = T_STRING; + $this->tokens[$i]['type'] = 'T_STRING'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $i changed from T_MATCH to T_STRING".PHP_EOL; + } + + if (isset($this->tokens[$i]['parenthesis_opener'], $this->tokens[$i]['parenthesis_closer']) === true) { + $opener = $this->tokens[$i]['parenthesis_opener']; + $closer = $this->tokens[$i]['parenthesis_closer']; + unset( + $this->tokens[$opener]['parenthesis_owner'], + $this->tokens[$closer]['parenthesis_owner'] + ); + unset( + $this->tokens[$i]['parenthesis_opener'], + $this->tokens[$i]['parenthesis_closer'], + $this->tokens[$i]['parenthesis_owner'] + ); + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* cleaned parenthesis of token $i *".PHP_EOL; + } + } + } else { + // Retokenize the double arrows for match expression cases to `T_MATCH_ARROW`. + $searchFor = [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, + T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, + T_OPEN_SHORT_ARRAY => T_OPEN_SHORT_ARRAY, + T_DOUBLE_ARROW => T_DOUBLE_ARROW, + ]; + $searchFor += Tokens::$scopeOpeners; + + for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { + if (isset($searchFor[$this->tokens[$x]['code']]) === false) { + continue; + } + + if (isset($this->tokens[$x]['scope_closer']) === true) { + $x = $this->tokens[$x]['scope_closer']; + continue; + } + + if (isset($this->tokens[$x]['parenthesis_closer']) === true) { + $x = $this->tokens[$x]['parenthesis_closer']; + continue; + } + + if (isset($this->tokens[$x]['bracket_closer']) === true) { + $x = $this->tokens[$x]['bracket_closer']; + continue; + } + + // This must be a double arrow, but make sure anyhow. + if ($this->tokens[$x]['code'] === T_DOUBLE_ARROW) { + $this->tokens[$x]['code'] = T_MATCH_ARROW; + $this->tokens[$x]['type'] = 'T_MATCH_ARROW'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t* token $x changed from T_DOUBLE_ARROW to T_MATCH_ARROW".PHP_EOL; + } + } + }//end for + }//end if + + continue; + } else if ($this->tokens[$i]['code'] === T_BITWISE_OR + || $this->tokens[$i]['code'] === T_BITWISE_AND + || $this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS + ) { + if ($lastSeenTypeToken < $i) { + // We've already examined this code to check if it is a type declaration and concluded it wasn't. + // No need to do it again. + continue; + } + + /* + Convert "|" to T_TYPE_UNION or leave as T_BITWISE_OR. + Convert "&" to T_TYPE_INTERSECTION or leave as T_BITWISE_AND. + Convert "(" and ")" to T_TYPE_(OPEN|CLOSE)_PARENTHESIS or leave as T_(OPEN|CLOSE)_PARENTHESIS. + + All type related tokens will be converted in one go as soon as this section is hit. + */ + + $allowed = [ + T_STRING => T_STRING, + T_CALLABLE => T_CALLABLE, + T_SELF => T_SELF, + 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, + ]; + + $suspectedType = null; + $typeTokenCountAfter = 0; + + for ($x = ($i + 1); $x < $numTokens; $x++) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { + continue; + } + + if (isset($allowed[$this->tokens[$x]['code']]) === true) { + ++$typeTokenCountAfter; + continue; + } + + if (($typeTokenCountAfter > 0 + || ($this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS + && isset($this->tokens[$i]['parenthesis_owner']) === false)) + && ($this->tokens[$x]['code'] === T_BITWISE_AND + || $this->tokens[$x]['code'] === T_ELLIPSIS) + ) { + // Skip past reference and variadic indicators for parameter types. + continue; + } + + if ($this->tokens[$x]['code'] === T_VARIABLE) { + // Parameter/Property defaults can not contain variables, so this could be a type. + $suspectedType = 'property or parameter'; + break; + } + + if ($this->tokens[$x]['code'] === T_DOUBLE_ARROW) { + // Possible arrow function. + $suspectedType = 'return'; + break; + } + + if ($this->tokens[$x]['code'] === T_SEMICOLON) { + // Possible abstract method or interface method. + $suspectedType = 'return'; + break; + } + + if ($this->tokens[$x]['code'] === T_OPEN_CURLY_BRACKET + && isset($this->tokens[$x]['scope_condition']) === true + && $this->tokens[$this->tokens[$x]['scope_condition']]['code'] === T_FUNCTION + ) { + $suspectedType = 'return'; + break; + } + + if ($this->tokens[$x]['code'] === T_EQUAL) { + // Possible constant declaration, the `T_STRING` name will have been skipped over already. + $suspectedType = 'constant'; + break; + } + + break; + }//end for + + if (($typeTokenCountAfter === 0 + && ($this->tokens[$i]['code'] !== T_CLOSE_PARENTHESIS + || isset($this->tokens[$i]['parenthesis_owner']) === true)) + || isset($suspectedType) === false + ) { + // Definitely not a union, intersection or DNF type, move on. + continue; + } + + if ($suspectedType === 'property or parameter') { + unset($allowed[T_STATIC]); + } + + $typeTokenCountBefore = 0; + $typeOperators = [$i]; + $parenthesesCount = 0; + $confirmed = false; + $maybeNullable = null; + + if ($this->tokens[$i]['code'] === T_OPEN_PARENTHESIS || $this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { + ++$parenthesesCount; + } + + for ($x = ($i - 1); $x >= 0; $x--) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { + continue; + } + + if ($suspectedType === 'property or parameter' + && $this->tokens[$x]['code'] === T_STRING + && strtolower($this->tokens[$x]['content']) === 'static' + ) { + // Static keyword followed directly by an open parenthesis for a DNF type. + // This token should be T_STATIC and was incorrectly identified as a function call before. + $this->tokens[$x]['code'] = T_STATIC; + $this->tokens[$x]['type'] = 'T_STATIC'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$x]['line']; + echo "\t* token $x on line $line changed back from T_STRING to T_STATIC".PHP_EOL; + } + } + + if ($suspectedType === 'property or parameter' + && $this->tokens[$x]['code'] === T_OPEN_PARENTHESIS + ) { + // We need to prevent the open parenthesis for a function/fn declaration from being retokenized + // to T_TYPE_OPEN_PARENTHESIS if this is the first parameter in the declaration. + if (isset($this->tokens[$x]['parenthesis_owner']) === true + && $this->tokens[$this->tokens[$x]['parenthesis_owner']]['code'] === T_FUNCTION + ) { + $confirmed = true; + break; + } else { + // This may still be an arrow function which hasn't been handled yet. + for ($y = ($x - 1); $y > 0; $y--) { + if (isset(Tokens::$emptyTokens[$this->tokens[$y]['code']]) === false + && $this->tokens[$y]['code'] !== T_BITWISE_AND + ) { + // Non-whitespace content. + break; + } + } + + if ($this->tokens[$y]['code'] === T_FN) { + $confirmed = true; + break; + } + } + }//end if + + if (isset($allowed[$this->tokens[$x]['code']]) === true) { + ++$typeTokenCountBefore; + continue; + } + + // Union, intersection and DNF types can't use the nullable operator, but be tolerant to parse errors. + if (($typeTokenCountBefore > 0 + || ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS && isset($this->tokens[$x]['parenthesis_owner']) === false)) + && ($this->tokens[$x]['code'] === T_NULLABLE + || $this->tokens[$x]['code'] === T_INLINE_THEN) + ) { + if ($this->tokens[$x]['code'] === T_INLINE_THEN) { + $maybeNullable = $x; + } + + continue; + } + + if ($this->tokens[$x]['code'] === T_BITWISE_OR || $this->tokens[$x]['code'] === T_BITWISE_AND) { + $typeOperators[] = $x; + continue; + } + + if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS || $this->tokens[$x]['code'] === T_CLOSE_PARENTHESIS) { + ++$parenthesesCount; + $typeOperators[] = $x; + continue; + } + + if ($suspectedType === 'return' && $this->tokens[$x]['code'] === T_COLON) { + // Make sure this is not the colon from a parameter name. + for ($y = ($x - 1); $y > 0; $y--) { + if (isset(Tokens::$emptyTokens[$this->tokens[$y]['code']]) === false) { + break; + } + } + + if ($this->tokens[$y]['code'] !== T_PARAM_NAME) { + $confirmed = true; + } + + break; + } + + if ($suspectedType === 'constant' && $this->tokens[$x]['code'] === T_CONST) { + $confirmed = true; + break; + } + + if ($suspectedType === 'property or parameter' + && (isset(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. + $confirmed = true; + } + + break; + }//end for + + // Remember the last token we examined as part of the (non-)"type declaration". + $lastSeenTypeToken = $x; + + if ($confirmed === false + && $suspectedType === 'property or parameter' + && isset($this->tokens[$i]['nested_parenthesis']) === true + ) { + $parens = $this->tokens[$i]['nested_parenthesis']; + $last = end($parens); + + if (isset($this->tokens[$last]['parenthesis_owner']) === true + && $this->tokens[$this->tokens[$last]['parenthesis_owner']]['code'] === T_FUNCTION + ) { + $confirmed = true; + } else { + // No parenthesis owner set, this may be an arrow function which has not yet + // had additional processing done. + if (isset($this->tokens[$last]['parenthesis_opener']) === true) { + for ($x = ($this->tokens[$last]['parenthesis_opener'] - 1); $x >= 0; $x--) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { + continue; + } + + break; + } + + if ($this->tokens[$x]['code'] === T_FN) { + for (--$x; $x >= 0; $x--) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true + || $this->tokens[$x]['code'] === T_BITWISE_AND + ) { + continue; + } + + break; + } + + if ($this->tokens[$x]['code'] !== T_FUNCTION) { + $confirmed = true; + } + } + }//end if + }//end if + + unset($parens, $last); + }//end if + + if ($confirmed === false || ($parenthesesCount % 2) !== 0) { + // Not a (valid) union, intersection or DNF type after all, move on. + continue; + } + + foreach ($typeOperators as $x) { + if ($this->tokens[$x]['code'] === T_BITWISE_OR) { + $this->tokens[$x]['code'] = T_TYPE_UNION; + $this->tokens[$x]['type'] = 'T_TYPE_UNION'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$x]['line']; + echo "\t* token $x on line $line changed from T_BITWISE_OR to T_TYPE_UNION".PHP_EOL; + } + } else if ($this->tokens[$x]['code'] === T_BITWISE_AND) { + $this->tokens[$x]['code'] = T_TYPE_INTERSECTION; + $this->tokens[$x]['type'] = 'T_TYPE_INTERSECTION'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$x]['line']; + echo "\t* token $x on line $line changed from T_BITWISE_AND to T_TYPE_INTERSECTION".PHP_EOL; + } + } else if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { + $this->tokens[$x]['code'] = T_TYPE_OPEN_PARENTHESIS; + $this->tokens[$x]['type'] = 'T_TYPE_OPEN_PARENTHESIS'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$x]['line']; + echo "\t* token $x on line $line changed from T_OPEN_PARENTHESIS to T_TYPE_OPEN_PARENTHESIS".PHP_EOL; + } + } else if ($this->tokens[$x]['code'] === T_CLOSE_PARENTHESIS) { + $this->tokens[$x]['code'] = T_TYPE_CLOSE_PARENTHESIS; + $this->tokens[$x]['type'] = 'T_TYPE_CLOSE_PARENTHESIS'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$x]['line']; + echo "\t* token $x on line $line changed from T_CLOSE_PARENTHESIS to T_TYPE_CLOSE_PARENTHESIS".PHP_EOL; + } + }//end if + }//end foreach + + if (isset($maybeNullable) === true) { + $this->tokens[$maybeNullable]['code'] = T_NULLABLE; + $this->tokens[$maybeNullable]['type'] = 'T_NULLABLE'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$maybeNullable]['line']; + echo "\t* token $maybeNullable on line $line changed from T_INLINE_THEN to T_NULLABLE".PHP_EOL; + } + } + + continue; + } else if ($this->tokens[$i]['code'] === T_STATIC) { + for ($x = ($i - 1); $x > 0; $x--) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { + break; + } + } + + if ($this->tokens[$x]['code'] === T_INSTANCEOF) { + $this->tokens[$i]['code'] = T_STRING; + $this->tokens[$i]['type'] = 'T_STRING'; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$i]['line']; + echo "\t* token $i on line $line changed from T_STATIC to T_STRING".PHP_EOL; + } + } + + continue; + } else if ($this->tokens[$i]['code'] === T_TRUE + || $this->tokens[$i]['code'] === T_FALSE + || $this->tokens[$i]['code'] === T_NULL + ) { + for ($x = ($i + 1); $x < $numTokens; $x++) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { + // Non-whitespace content. + break; + } + } + + 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']; + echo "\t* token $i on line $line changed from $type to T_STRING".PHP_EOL; + } + + $this->tokens[$i]['code'] = T_STRING; + $this->tokens[$i]['type'] = 'T_STRING'; + } + }//end if + + if (($this->tokens[$i]['code'] !== T_CASE + && $this->tokens[$i]['code'] !== T_DEFAULT) + || isset($this->tokens[$i]['scope_opener']) === false + ) { + // Only interested in CASE and DEFAULT statements from here on in. + continue; + } + + $scopeOpener = $this->tokens[$i]['scope_opener']; + $scopeCloser = $this->tokens[$i]['scope_closer']; + + // If the first char after the opener is a curly brace + // and that brace has been ignored, it is actually + // opening this case statement and the opener and closer are + // probably set incorrectly. + for ($x = ($scopeOpener + 1); $x < $numTokens; $x++) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { + // Non-whitespace content. + break; + } + } + + if ($this->tokens[$x]['code'] === T_CASE || $this->tokens[$x]['code'] === T_DEFAULT) { + // Special case for multiple CASE statements that share the same + // closer. Because we are going backwards through the file, this next + // CASE statement is already fixed, so just use its closer and don't + // worry about fixing anything. + $newCloser = $this->tokens[$x]['scope_closer']; + $this->tokens[$i]['scope_closer'] = $newCloser; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $oldType = $this->tokens[$scopeCloser]['type']; + $newType = $this->tokens[$newCloser]['type']; + $line = $this->tokens[$i]['line']; + echo "\t* token $i (T_CASE) on line $line closer changed from $scopeCloser ($oldType) to $newCloser ($newType)".PHP_EOL; + } + + continue; + } + + if ($this->tokens[$x]['code'] !== T_OPEN_CURLY_BRACKET + || isset($this->tokens[$x]['scope_condition']) === true + ) { + // Not a CASE/DEFAULT with a curly brace opener. + continue; + } + + // The closer for this CASE/DEFAULT should be the closing curly brace and + // not whatever it already is. The opener needs to be the opening curly + // brace so everything matches up. + $newCloser = $this->tokens[$x]['bracket_closer']; + foreach ([$i, $x, $newCloser] as $index) { + $this->tokens[$index]['scope_condition'] = $i; + $this->tokens[$index]['scope_opener'] = $x; + $this->tokens[$index]['scope_closer'] = $newCloser; + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$i]['line']; + $tokenType = $this->tokens[$i]['type']; + + $oldType = $this->tokens[$scopeOpener]['type']; + $newType = $this->tokens[$x]['type']; + echo "\t* token $i ($tokenType) on line $line opener changed from $scopeOpener ($oldType) to $x ($newType)".PHP_EOL; + + $oldType = $this->tokens[$scopeCloser]['type']; + $newType = $this->tokens[$newCloser]['type']; + echo "\t* token $i ($tokenType) on line $line closer changed from $scopeCloser ($oldType) to $newCloser ($newType)".PHP_EOL; + } + + if ($this->tokens[$scopeOpener]['scope_condition'] === $i) { + unset($this->tokens[$scopeOpener]['scope_condition']); + unset($this->tokens[$scopeOpener]['scope_opener']); + unset($this->tokens[$scopeOpener]['scope_closer']); + } + + if ($this->tokens[$scopeCloser]['scope_condition'] === $i) { + unset($this->tokens[$scopeCloser]['scope_condition']); + unset($this->tokens[$scopeCloser]['scope_opener']); + unset($this->tokens[$scopeCloser]['scope_closer']); + } else { + // We were using a shared closer. All tokens that were + // sharing this closer with us, except for the scope condition + // and it's opener, need to now point to the new closer. + $condition = $this->tokens[$scopeCloser]['scope_condition']; + $start = ($this->tokens[$condition]['scope_opener'] + 1); + for ($y = $start; $y < $scopeCloser; $y++) { + if (isset($this->tokens[$y]['scope_closer']) === true + && $this->tokens[$y]['scope_closer'] === $scopeCloser + ) { + $this->tokens[$y]['scope_closer'] = $newCloser; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $line = $this->tokens[$y]['line']; + $tokenType = $this->tokens[$y]['type']; + $oldType = $this->tokens[$scopeCloser]['type']; + $newType = $this->tokens[$newCloser]['type']; + echo "\t\t* token $y ($tokenType) on line $line closer changed from $scopeCloser ($oldType) to $newCloser ($newType)".PHP_EOL; + } + } + } + }//end if + + unset($this->tokens[$x]['bracket_opener']); + unset($this->tokens[$x]['bracket_closer']); + unset($this->tokens[$newCloser]['bracket_opener']); + unset($this->tokens[$newCloser]['bracket_closer']); + $this->tokens[$scopeCloser]['conditions'][] = $i; + + // Now fix up all the tokens that think they are + // inside the CASE/DEFAULT statement when they are really outside. + for ($x = $newCloser; $x < $scopeCloser; $x++) { + foreach ($this->tokens[$x]['conditions'] as $num => $oldCond) { + if ($oldCond === $this->tokens[$i]['code']) { + $oldConditions = $this->tokens[$x]['conditions']; + unset($this->tokens[$x]['conditions'][$num]); + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$x]['type']; + $oldConds = ''; + foreach ($oldConditions as $condition) { + $oldConds .= Tokens::tokenName($condition).','; + } + + $oldConds = rtrim($oldConds, ','); + + $newConds = ''; + foreach ($this->tokens[$x]['conditions'] as $condition) { + $newConds .= Tokens::tokenName($condition).','; + } + + $newConds = rtrim($newConds, ','); + + echo "\t\t* cleaned $x ($type) *".PHP_EOL; + echo "\t\t\t=> conditions changed from $oldConds to $newConds".PHP_EOL; + } + + break; + }//end if + }//end foreach + }//end for + }//end for + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** END ADDITIONAL PHP PROCESSING ***".PHP_EOL; + } + + }//end processAdditional() + + + /** + * Takes a token produced from token_get_all() and produces a + * more uniform token. + * + * @param string|array $token The token to convert. + * + * @return array The new token. + */ + public static function standardiseToken($token) + { + if (isset($token[1]) === false) { + if (isset(self::$resolveTokenCache[$token[0]]) === true) { + return self::$resolveTokenCache[$token[0]]; + } + } else { + $cacheKey = null; + if ($token[0] === T_STRING) { + $cacheKey = strtolower($token[1]); + } else if ($token[0] !== T_CURLY_OPEN) { + $cacheKey = $token[0]; + } + + if ($cacheKey !== null && isset(self::$resolveTokenCache[$cacheKey]) === true) { + $newToken = self::$resolveTokenCache[$cacheKey]; + $newToken['content'] = $token[1]; + return $newToken; + } + } + + if (isset($token[1]) === false) { + return self::resolveSimpleToken($token[0]); + } + + if ($token[0] === T_STRING) { + switch ($cacheKey) { + case 'false': + $newToken['type'] = 'T_FALSE'; + break; + case 'true': + $newToken['type'] = 'T_TRUE'; + break; + case 'null': + $newToken['type'] = 'T_NULL'; + break; + case 'self': + $newToken['type'] = 'T_SELF'; + break; + case 'parent': + $newToken['type'] = 'T_PARENT'; + break; + default: + $newToken['type'] = 'T_STRING'; + break; + } + + $newToken['code'] = constant($newToken['type']); + + self::$resolveTokenCache[$cacheKey] = $newToken; + } else if ($token[0] === T_CURLY_OPEN) { + $newToken = [ + 'code' => T_OPEN_CURLY_BRACKET, + 'type' => 'T_OPEN_CURLY_BRACKET', + ]; + } else { + $newToken = [ + 'code' => $token[0], + 'type' => Tokens::tokenName($token[0]), + ]; + + self::$resolveTokenCache[$token[0]] = $newToken; + }//end if + + $newToken['content'] = $token[1]; + return $newToken; + + }//end standardiseToken() + + + /** + * Converts simple tokens into a format that conforms to complex tokens + * produced by token_get_all(). + * + * Simple tokens are tokens that are not in array form when produced from + * token_get_all(). + * + * @param string $token The simple token to convert. + * + * @return array The new token in array format. + */ + public static function resolveSimpleToken($token) + { + $newToken = []; + + switch ($token) { + case '{': + $newToken['type'] = 'T_OPEN_CURLY_BRACKET'; + break; + case '}': + $newToken['type'] = 'T_CLOSE_CURLY_BRACKET'; + break; + case '[': + $newToken['type'] = 'T_OPEN_SQUARE_BRACKET'; + break; + case ']': + $newToken['type'] = 'T_CLOSE_SQUARE_BRACKET'; + break; + case '(': + $newToken['type'] = 'T_OPEN_PARENTHESIS'; + break; + case ')': + $newToken['type'] = 'T_CLOSE_PARENTHESIS'; + break; + case ':': + $newToken['type'] = 'T_COLON'; + break; + case '.': + $newToken['type'] = 'T_STRING_CONCAT'; + break; + case ';': + $newToken['type'] = 'T_SEMICOLON'; + break; + case '=': + $newToken['type'] = 'T_EQUAL'; + break; + case '*': + $newToken['type'] = 'T_MULTIPLY'; + break; + case '/': + $newToken['type'] = 'T_DIVIDE'; + break; + case '+': + $newToken['type'] = 'T_PLUS'; + break; + case '-': + $newToken['type'] = 'T_MINUS'; + break; + case '%': + $newToken['type'] = 'T_MODULUS'; + break; + case '^': + $newToken['type'] = 'T_BITWISE_XOR'; + break; + case '&': + $newToken['type'] = 'T_BITWISE_AND'; + break; + case '|': + $newToken['type'] = 'T_BITWISE_OR'; + break; + case '~': + $newToken['type'] = 'T_BITWISE_NOT'; + break; + case '<': + $newToken['type'] = 'T_LESS_THAN'; + break; + case '>': + $newToken['type'] = 'T_GREATER_THAN'; + break; + case '!': + $newToken['type'] = 'T_BOOLEAN_NOT'; + break; + case ',': + $newToken['type'] = 'T_COMMA'; + break; + case '@': + $newToken['type'] = 'T_ASPERAND'; + break; + case '$': + $newToken['type'] = 'T_DOLLAR'; + break; + case '`': + $newToken['type'] = 'T_BACKTICK'; + break; + default: + $newToken['type'] = 'T_NONE'; + break; + }//end switch + + $newToken['code'] = constant($newToken['type']); + $newToken['content'] = $token; + + self::$resolveTokenCache[$token] = $newToken; + return $newToken; + + }//end resolveSimpleToken() + + + /** + * Finds a "closer" token (closing parenthesis or square bracket for example) + * Handle parenthesis balancing while searching for closing token + * + * @param array $tokens The list of tokens to iterate searching the closing token (as returned by token_get_all). + * @param int $start The starting position. + * @param string|string[] $openerTokens The opening character. + * @param string $closerChar The closing character. + * + * @return int|null The position of the closing token, if found. NULL otherwise. + */ + private function findCloser(array &$tokens, $start, $openerTokens, $closerChar) + { + $numTokens = count($tokens); + $stack = [0]; + $closer = null; + $openerTokens = (array) $openerTokens; + + for ($x = $start; $x < $numTokens; $x++) { + if (in_array($tokens[$x], $openerTokens, true) === true + || (is_array($tokens[$x]) === true && in_array($tokens[$x][1], $openerTokens, true) === true) + ) { + $stack[] = $x; + } else if ($tokens[$x] === $closerChar) { + array_pop($stack); + if (empty($stack) === true) { + $closer = $x; + break; + } + } + } + + return $closer; + + }//end findCloser() + + + /** + * PHP 8 attributes parser for PHP < 8 + * Handles single-line and multiline attributes. + * + * @param array $tokens The original array of tokens (as returned by token_get_all). + * @param int $stackPtr The current position in token array. + * + * @return array|null The array of parsed attribute tokens + */ + private function parsePhpAttribute(array &$tokens, $stackPtr) + { + + $token = $tokens[$stackPtr]; + + $commentBody = substr($token[1], 2); + $subTokens = @token_get_all(' $subToken) { + if (is_array($subToken) === true + && $subToken[0] === T_COMMENT + && strpos($subToken[1], '#[') === 0 + ) { + $reparsed = $this->parsePhpAttribute($subTokens, $i); + if ($reparsed !== null) { + array_splice($subTokens, $i, 1, $reparsed); + } else { + $subToken[0] = T_ATTRIBUTE; + } + } + } + + array_splice($subTokens, 0, 1, [[T_ATTRIBUTE, '#[']]); + + // Go looking for the close bracket. + $bracketCloser = $this->findCloser($subTokens, 1, '[', ']'); + if (PHP_VERSION_ID < 80000 && $bracketCloser === null) { + foreach (array_slice($tokens, ($stackPtr + 1)) as $token) { + if (is_array($token) === true) { + $commentBody .= $token[1]; + } else { + $commentBody .= $token; + } + } + + $subTokens = @token_get_all('findCloser($subTokens, 1, '[', ']'); + if ($bracketCloser !== null) { + array_splice($tokens, ($stackPtr + 1), count($tokens), array_slice($subTokens, ($bracketCloser + 1))); + $subTokens = array_slice($subTokens, 0, ($bracketCloser + 1)); + } + } + + if ($bracketCloser === null) { + return null; + } + + return $subTokens; + + }//end parsePhpAttribute() + + + /** + * Creates a map for the attributes tokens that surround other tokens. + * + * @return void + */ + private function createAttributesNestingMap() + { + $map = []; + for ($i = 0; $i < $this->numTokens; $i++) { + if (isset($this->tokens[$i]['attribute_opener']) === true + && $i === $this->tokens[$i]['attribute_opener'] + ) { + if (empty($map) === false) { + $this->tokens[$i]['nested_attributes'] = $map; + } + + if (isset($this->tokens[$i]['attribute_closer']) === true) { + $map[$this->tokens[$i]['attribute_opener']] + = $this->tokens[$i]['attribute_closer']; + } + } else if (isset($this->tokens[$i]['attribute_closer']) === true + && $i === $this->tokens[$i]['attribute_closer'] + ) { + array_pop($map); + if (empty($map) === false) { + $this->tokens[$i]['nested_attributes'] = $map; + } + } else { + if (empty($map) === false) { + $this->tokens[$i]['nested_attributes'] = $map; + } + }//end if + }//end for + + }//end createAttributesNestingMap() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php new file mode 100644 index 00000000..ba41f8da --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php @@ -0,0 +1,1735 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tokenizers; + +use PHP_CodeSniffer\Exceptions\TokenizerException; +use PHP_CodeSniffer\Util\Common; +use PHP_CodeSniffer\Util\Tokens; + +abstract class Tokenizer +{ + + /** + * The config data for the run. + * + * @var \PHP_CodeSniffer\Config + */ + protected $config = null; + + /** + * The EOL char used in the content. + * + * @var string + */ + protected $eolChar = ''; + + /** + * A token-based representation of the content. + * + * @var array + */ + protected $tokens = []; + + /** + * The number of tokens in the tokens array. + * + * @var integer + */ + protected $numTokens = 0; + + /** + * A list of tokens that are allowed to open a scope. + * + * @var array + */ + public $scopeOpeners = []; + + /** + * A list of tokens that end the scope. + * + * @var array + */ + public $endScopeTokens = []; + + /** + * Known lengths of tokens. + * + * @var array + */ + public $knownLengths = []; + + /** + * A list of lines being ignored due to error suppression comments. + * + * @var array + */ + public $ignoredLines = []; + + + /** + * Initialise and run the tokenizer. + * + * @param string $content The content to tokenize. + * @param \PHP_CodeSniffer\Config | null $config The config data for the run. + * @param string $eolChar The EOL char used in the content. + * + * @return void + * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. + */ + public function __construct($content, $config, $eolChar='\n') + { + $this->eolChar = $eolChar; + + $this->config = $config; + $this->tokens = $this->tokenize($content); + + if ($config === null) { + return; + } + + $this->createPositionMap(); + $this->createTokenMap(); + $this->createParenthesisNestingMap(); + $this->createScopeMap(); + $this->createLevelMap(); + + // Allow the tokenizer to do additional processing if required. + $this->processAdditional(); + + }//end __construct() + + + /** + * Checks the content to see if it looks minified. + * + * @param string $content The content to tokenize. + * @param string $eolChar The EOL char used in the content. + * + * @return boolean + */ + protected function isMinifiedContent($content, $eolChar='\n') + { + // Minified files often have a very large number of characters per line + // and cause issues when tokenizing. + $numChars = strlen($content); + $numLines = (substr_count($content, $eolChar) + 1); + $average = ($numChars / $numLines); + if ($average > 100) { + return true; + } + + return false; + + }//end isMinifiedContent() + + + /** + * Gets the array of tokens. + * + * @return array + */ + public function getTokens() + { + return $this->tokens; + + }//end getTokens() + + + /** + * Creates an array of tokens when given some content. + * + * @param string $string The string to tokenize. + * + * @return array + */ + abstract protected function tokenize($string); + + + /** + * Performs additional processing after main tokenizing. + * + * @return void + */ + abstract protected function processAdditional(); + + + /** + * Sets token position information. + * + * Can also convert tabs into spaces. Each tab can represent between + * 1 and $width spaces, so this cannot be a straight string replace. + * + * @return void + */ + private function createPositionMap() + { + $currColumn = 1; + $lineNumber = 1; + $eolLen = strlen($this->eolChar); + $ignoring = null; + $inTests = defined('PHP_CODESNIFFER_IN_TESTS'); + + $checkEncoding = false; + if (function_exists('iconv_strlen') === true) { + $checkEncoding = true; + } + + $checkAnnotations = $this->config->annotations; + $encoding = $this->config->encoding; + $tabWidth = $this->config->tabWidth; + + $tokensWithTabs = [ + T_WHITESPACE => true, + T_COMMENT => true, + T_DOC_COMMENT => true, + T_DOC_COMMENT_WHITESPACE => true, + T_DOC_COMMENT_STRING => true, + T_CONSTANT_ENCAPSED_STRING => true, + T_DOUBLE_QUOTED_STRING => true, + T_HEREDOC => true, + T_NOWDOC => true, + T_END_HEREDOC => true, + T_END_NOWDOC => true, + T_INLINE_HTML => true, + ]; + + $this->numTokens = count($this->tokens); + for ($i = 0; $i < $this->numTokens; $i++) { + $this->tokens[$i]['line'] = $lineNumber; + $this->tokens[$i]['column'] = $currColumn; + + if (isset($this->knownLengths[$this->tokens[$i]['code']]) === true) { + // There are no tabs in the tokens we know the length of. + $length = $this->knownLengths[$this->tokens[$i]['code']]; + $currColumn += $length; + } else if ($tabWidth === 0 + || isset($tokensWithTabs[$this->tokens[$i]['code']]) === false + || strpos($this->tokens[$i]['content'], "\t") === false + ) { + // There are no tabs in this content, or we aren't replacing them. + if ($checkEncoding === true) { + // Not using the default encoding, so take a bit more care. + $oldLevel = error_reporting(); + error_reporting(0); + $length = iconv_strlen($this->tokens[$i]['content'], $encoding); + error_reporting($oldLevel); + + if ($length === false) { + // String contained invalid characters, so revert to default. + $length = strlen($this->tokens[$i]['content']); + } + } else { + $length = strlen($this->tokens[$i]['content']); + } + + $currColumn += $length; + } else { + $this->replaceTabsInToken($this->tokens[$i]); + $length = $this->tokens[$i]['length']; + $currColumn += $length; + }//end if + + $this->tokens[$i]['length'] = $length; + + if (isset($this->knownLengths[$this->tokens[$i]['code']]) === false + && strpos($this->tokens[$i]['content'], $this->eolChar) !== false + ) { + $lineNumber++; + $currColumn = 1; + + // Newline chars are not counted in the token length. + $this->tokens[$i]['length'] -= $eolLen; + } + + if ($this->tokens[$i]['code'] === T_COMMENT + || $this->tokens[$i]['code'] === T_DOC_COMMENT_STRING + || $this->tokens[$i]['code'] === T_DOC_COMMENT_TAG + || ($inTests === true && $this->tokens[$i]['code'] === T_INLINE_HTML) + ) { + $commentText = ltrim($this->tokens[$i]['content'], " \t/*#"); + $commentText = rtrim($commentText, " */\t\r\n"); + $commentTextLower = strtolower($commentText); + if (strpos($commentText, '@codingStandards') !== false) { + // If this comment is the only thing on the line, it tells us + // to ignore the following line. If the line contains other content + // then we are just ignoring this one single line. + $ownLine = false; + if ($i > 0) { + for ($prev = ($i - 1); $prev >= 0; $prev--) { + if ($this->tokens[$prev]['code'] === T_WHITESPACE) { + continue; + } + + break; + } + + if ($this->tokens[$prev]['line'] !== $this->tokens[$i]['line']) { + $ownLine = true; + } + } + + if ($ignoring === null + && strpos($commentText, '@codingStandardsIgnoreStart') !== false + ) { + $ignoring = ['.all' => true]; + if ($ownLine === true) { + $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; + } + } else if ($ignoring !== null + && strpos($commentText, '@codingStandardsIgnoreEnd') !== false + ) { + if ($ownLine === true) { + $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; + } else { + $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; + } + + $ignoring = null; + } else if ($ignoring === null + && strpos($commentText, '@codingStandardsIgnoreLine') !== false + ) { + $ignoring = ['.all' => true]; + if ($ownLine === true) { + $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; + $this->ignoredLines[($this->tokens[$i]['line'] + 1)] = $ignoring; + } else { + $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; + } + + $ignoring = null; + }//end if + } else if (substr($commentTextLower, 0, 6) === 'phpcs:' + || substr($commentTextLower, 0, 7) === '@phpcs:' + ) { + // If the @phpcs: syntax is being used, strip the @ to make + // comparisons easier. + if ($commentText[0] === '@') { + $commentText = substr($commentText, 1); + $commentTextLower = strtolower($commentText); + } + + // If there is a comment on the end, strip it off. + $commentStart = strpos($commentTextLower, ' --'); + if ($commentStart !== false) { + $commentText = substr($commentText, 0, $commentStart); + $commentTextLower = strtolower($commentText); + } + + // If this comment is the only thing on the line, it tells us + // to ignore the following line. If the line contains other content + // then we are just ignoring this one single line. + $lineHasOtherContent = false; + $lineHasOtherTokens = false; + if ($i > 0) { + for ($prev = ($i - 1); $prev > 0; $prev--) { + if ($this->tokens[$prev]['line'] !== $this->tokens[$i]['line']) { + // Changed lines. + break; + } + + if ($this->tokens[$prev]['code'] === T_WHITESPACE + || $this->tokens[$prev]['code'] === T_DOC_COMMENT_WHITESPACE + || ($this->tokens[$prev]['code'] === T_INLINE_HTML + && trim($this->tokens[$prev]['content']) === '') + ) { + continue; + } + + $lineHasOtherTokens = true; + + if ($this->tokens[$prev]['code'] === T_OPEN_TAG + || $this->tokens[$prev]['code'] === T_DOC_COMMENT_STAR + ) { + continue; + } + + $lineHasOtherContent = true; + break; + }//end for + + $changedLines = false; + for ($next = $i; $next < $this->numTokens; $next++) { + if ($changedLines === true) { + // Changed lines. + break; + } + + if (isset($this->knownLengths[$this->tokens[$next]['code']]) === false + && strpos($this->tokens[$next]['content'], $this->eolChar) !== false + ) { + // Last token on the current line. + $changedLines = true; + } + + if ($next === $i) { + continue; + } + + if ($this->tokens[$next]['code'] === T_WHITESPACE + || $this->tokens[$next]['code'] === T_DOC_COMMENT_WHITESPACE + || ($this->tokens[$next]['code'] === T_INLINE_HTML + && trim($this->tokens[$next]['content']) === '') + ) { + continue; + } + + $lineHasOtherTokens = true; + + if ($this->tokens[$next]['code'] === T_CLOSE_TAG) { + continue; + } + + $lineHasOtherContent = true; + break; + }//end for + }//end if + + if (substr($commentTextLower, 0, 9) === 'phpcs:set') { + // Ignore standards for complete lines that change sniff settings. + if ($lineHasOtherTokens === false) { + $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; + } + + // Need to maintain case here, to get the correct sniff code. + $parts = explode(' ', substr($commentText, 10)); + if (count($parts) >= 2) { + $sniffParts = explode('.', $parts[0]); + if (count($sniffParts) >= 3) { + $this->tokens[$i]['sniffCode'] = array_shift($parts); + $this->tokens[$i]['sniffProperty'] = array_shift($parts); + $this->tokens[$i]['sniffPropertyValue'] = rtrim(implode(' ', $parts), " */\r\n"); + } + } + + $this->tokens[$i]['code'] = T_PHPCS_SET; + $this->tokens[$i]['type'] = 'T_PHPCS_SET'; + } else if (substr($commentTextLower, 0, 16) === 'phpcs:ignorefile') { + // The whole file will be ignored, but at least set the correct token. + $this->tokens[$i]['code'] = T_PHPCS_IGNORE_FILE; + $this->tokens[$i]['type'] = 'T_PHPCS_IGNORE_FILE'; + } else if (substr($commentTextLower, 0, 13) === 'phpcs:disable') { + if ($lineHasOtherContent === false) { + // Completely ignore the comment line. + $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; + } + + if ($ignoring === null) { + $ignoring = []; + } + + $disabledSniffs = []; + + $additionalText = substr($commentText, 14); + if (empty($additionalText) === true) { + $ignoring = ['.all' => true]; + } else { + $parts = explode(',', $additionalText); + foreach ($parts as $sniffCode) { + $sniffCode = trim($sniffCode); + $disabledSniffs[$sniffCode] = true; + $ignoring[$sniffCode] = true; + + // This newly disabled sniff might be disabling an existing + // enabled exception that we are tracking. + if (isset($ignoring['.except']) === true) { + foreach (array_keys($ignoring['.except']) as $ignoredSniffCode) { + if ($ignoredSniffCode === $sniffCode + || strpos($ignoredSniffCode, $sniffCode.'.') === 0 + ) { + unset($ignoring['.except'][$ignoredSniffCode]); + } + } + + if (empty($ignoring['.except']) === true) { + unset($ignoring['.except']); + } + } + }//end foreach + }//end if + + $this->tokens[$i]['code'] = T_PHPCS_DISABLE; + $this->tokens[$i]['type'] = 'T_PHPCS_DISABLE'; + $this->tokens[$i]['sniffCodes'] = $disabledSniffs; + } else if (substr($commentTextLower, 0, 12) === 'phpcs:enable') { + if ($ignoring !== null) { + $enabledSniffs = []; + + $additionalText = substr($commentText, 13); + if (empty($additionalText) === true) { + $ignoring = null; + } else { + $parts = explode(',', $additionalText); + foreach ($parts as $sniffCode) { + $sniffCode = trim($sniffCode); + $enabledSniffs[$sniffCode] = true; + + // This new enabled sniff might remove previously disabled + // sniffs if it is actually a standard or category of sniffs. + foreach (array_keys($ignoring) as $ignoredSniffCode) { + if ($ignoredSniffCode === $sniffCode + || strpos($ignoredSniffCode, $sniffCode.'.') === 0 + ) { + unset($ignoring[$ignoredSniffCode]); + } + } + + // This new enabled sniff might be able to clear up + // previously enabled sniffs if it is actually a standard or + // category of sniffs. + if (isset($ignoring['.except']) === true) { + foreach (array_keys($ignoring['.except']) as $ignoredSniffCode) { + if ($ignoredSniffCode === $sniffCode + || strpos($ignoredSniffCode, $sniffCode.'.') === 0 + ) { + unset($ignoring['.except'][$ignoredSniffCode]); + } + } + } + }//end foreach + + if (empty($ignoring) === true) { + $ignoring = null; + } else { + if (isset($ignoring['.except']) === true) { + $ignoring['.except'] += $enabledSniffs; + } else { + $ignoring['.except'] = $enabledSniffs; + } + } + }//end if + + if ($lineHasOtherContent === false) { + // Completely ignore the comment line. + $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; + } else { + // The comment is on the same line as the code it is ignoring, + // so respect the new ignore rules. + $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; + } + + $this->tokens[$i]['sniffCodes'] = $enabledSniffs; + }//end if + + $this->tokens[$i]['code'] = T_PHPCS_ENABLE; + $this->tokens[$i]['type'] = 'T_PHPCS_ENABLE'; + } else if (substr($commentTextLower, 0, 12) === 'phpcs:ignore') { + $ignoreRules = []; + + $additionalText = substr($commentText, 13); + if (empty($additionalText) === true) { + $ignoreRules = ['.all' => true]; + } else { + $parts = explode(',', $additionalText); + foreach ($parts as $sniffCode) { + $ignoreRules[trim($sniffCode)] = true; + } + } + + $this->tokens[$i]['code'] = T_PHPCS_IGNORE; + $this->tokens[$i]['type'] = 'T_PHPCS_IGNORE'; + $this->tokens[$i]['sniffCodes'] = $ignoreRules; + + if ($ignoring !== null) { + $ignoreRules += $ignoring; + } + + if ($lineHasOtherContent === false) { + // Completely ignore the comment line, and set the following + // line to include the ignore rules we've set. + $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; + $this->ignoredLines[($this->tokens[$i]['line'] + 1)] = $ignoreRules; + } else { + // The comment is on the same line as the code it is ignoring, + // so respect the ignore rules it set. + $this->ignoredLines[$this->tokens[$i]['line']] = $ignoreRules; + } + }//end if + }//end if + }//end if + + if ($ignoring !== null && isset($this->ignoredLines[$this->tokens[$i]['line']]) === false) { + $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; + } + }//end for + + // If annotations are being ignored, we clear out all the ignore rules + // but leave the annotations tokenized as normal. + if ($checkAnnotations === false) { + $this->ignoredLines = []; + } + + }//end createPositionMap() + + + /** + * Replaces tabs in original token content with spaces. + * + * Each tab can represent between 1 and $config->tabWidth spaces, + * so this cannot be a straight string replace. The original content + * is placed into an orig_content index and the new token length is also + * set in the length index. + * + * @param array $token The token to replace tabs inside. + * @param string $prefix The character to use to represent the start of a tab. + * @param string $padding The character to use to represent the end of a tab. + * @param int $tabWidth The number of spaces each tab represents. + * + * @return void + */ + public function replaceTabsInToken(&$token, $prefix=' ', $padding=' ', $tabWidth=null) + { + $checkEncoding = false; + if (function_exists('iconv_strlen') === true) { + $checkEncoding = true; + } + + $currColumn = $token['column']; + if ($tabWidth === null) { + $tabWidth = $this->config->tabWidth; + if ($tabWidth === 0) { + $tabWidth = 1; + } + } + + if (rtrim($token['content'], "\t") === '') { + // String only contains tabs, so we can shortcut the process. + $numTabs = strlen($token['content']); + + $firstTabSize = ($tabWidth - (($currColumn - 1) % $tabWidth)); + $length = ($firstTabSize + ($tabWidth * ($numTabs - 1))); + $newContent = $prefix.str_repeat($padding, ($length - 1)); + } else { + // We need to determine the length of each tab. + $tabs = explode("\t", $token['content']); + + $numTabs = (count($tabs) - 1); + $tabNum = 0; + $newContent = ''; + $length = 0; + + foreach ($tabs as $content) { + if ($content !== '') { + $newContent .= $content; + if ($checkEncoding === true) { + // Not using the default encoding, so take a bit more care. + $oldLevel = error_reporting(); + error_reporting(0); + $contentLength = iconv_strlen($content, $this->config->encoding); + error_reporting($oldLevel); + if ($contentLength === false) { + // String contained invalid characters, so revert to default. + $contentLength = strlen($content); + } + } else { + $contentLength = strlen($content); + } + + $currColumn += $contentLength; + $length += $contentLength; + } + + // The last piece of content does not have a tab after it. + if ($tabNum === $numTabs) { + break; + } + + // Process the tab that comes after the content. + $tabNum++; + + // Move the pointer to the next tab stop. + $pad = ($tabWidth - ($currColumn + $tabWidth - 1) % $tabWidth); + $currColumn += $pad; + $length += $pad; + $newContent .= $prefix.str_repeat($padding, ($pad - 1)); + }//end foreach + }//end if + + $token['orig_content'] = $token['content']; + $token['content'] = $newContent; + $token['length'] = $length; + + }//end replaceTabsInToken() + + + /** + * Creates a map of brackets positions. + * + * @return void + */ + private function createTokenMap() + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** START TOKEN MAP ***".PHP_EOL; + } + + $squareOpeners = []; + $curlyOpeners = []; + $this->numTokens = count($this->tokens); + + $openers = []; + $openOwner = null; + + for ($i = 0; $i < $this->numTokens; $i++) { + /* + Parenthesis mapping. + */ + + if (isset(Tokens::$parenthesisOpeners[$this->tokens[$i]['code']]) === true) { + $this->tokens[$i]['parenthesis_opener'] = null; + $this->tokens[$i]['parenthesis_closer'] = null; + $this->tokens[$i]['parenthesis_owner'] = $i; + $openOwner = $i; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", (count($openers) + 1)); + echo "=> Found parenthesis owner at $i".PHP_EOL; + } + } else if ($this->tokens[$i]['code'] === T_OPEN_PARENTHESIS) { + $openers[] = $i; + $this->tokens[$i]['parenthesis_opener'] = $i; + if ($openOwner !== null) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($openers)); + echo "=> Found parenthesis opener at $i for $openOwner".PHP_EOL; + } + + $this->tokens[$openOwner]['parenthesis_opener'] = $i; + $this->tokens[$i]['parenthesis_owner'] = $openOwner; + $openOwner = null; + } else if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($openers)); + echo "=> Found unowned parenthesis opener at $i".PHP_EOL; + } + } else if ($this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { + // Did we set an owner for this set of parenthesis? + $numOpeners = count($openers); + if ($numOpeners !== 0) { + $opener = array_pop($openers); + if (isset($this->tokens[$opener]['parenthesis_owner']) === true) { + $owner = $this->tokens[$opener]['parenthesis_owner']; + + $this->tokens[$owner]['parenthesis_closer'] = $i; + $this->tokens[$i]['parenthesis_owner'] = $owner; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", (count($openers) + 1)); + echo "=> Found parenthesis closer at $i for $owner".PHP_EOL; + } + } else if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", (count($openers) + 1)); + echo "=> Found unowned parenthesis closer at $i for $opener".PHP_EOL; + } + + $this->tokens[$i]['parenthesis_opener'] = $opener; + $this->tokens[$i]['parenthesis_closer'] = $i; + $this->tokens[$opener]['parenthesis_closer'] = $i; + }//end if + } else if ($this->tokens[$i]['code'] === T_ATTRIBUTE) { + $openers[] = $i; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($openers)); + echo "=> Found attribute opener at $i".PHP_EOL; + } + + $this->tokens[$i]['attribute_opener'] = $i; + $this->tokens[$i]['attribute_closer'] = null; + } else if ($this->tokens[$i]['code'] === T_ATTRIBUTE_END) { + $numOpeners = count($openers); + if ($numOpeners !== 0) { + $opener = array_pop($openers); + if (isset($this->tokens[$opener]['attribute_opener']) === true) { + $this->tokens[$opener]['attribute_closer'] = $i; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", (count($openers) + 1)); + echo "=> Found attribute closer at $i for $opener".PHP_EOL; + } + + for ($x = ($opener + 1); $x <= $i; ++$x) { + if (isset($this->tokens[$x]['attribute_closer']) === true) { + continue; + } + + $this->tokens[$x]['attribute_opener'] = $opener; + $this->tokens[$x]['attribute_closer'] = $i; + } + } else if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", (count($openers) + 1)); + echo "=> Found unowned attribute closer at $i for $opener".PHP_EOL; + } + }//end if + }//end if + + /* + Bracket mapping. + */ + + switch ($this->tokens[$i]['code']) { + case T_OPEN_SQUARE_BRACKET: + $squareOpeners[] = $i; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($squareOpeners)); + echo str_repeat("\t", count($curlyOpeners)); + echo "=> Found square bracket opener at $i".PHP_EOL; + } + break; + case T_OPEN_CURLY_BRACKET: + if (isset($this->tokens[$i]['scope_closer']) === false) { + $curlyOpeners[] = $i; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($squareOpeners)); + echo str_repeat("\t", count($curlyOpeners)); + echo "=> Found curly bracket opener at $i".PHP_EOL; + } + } + break; + case T_CLOSE_SQUARE_BRACKET: + if (empty($squareOpeners) === false) { + $opener = array_pop($squareOpeners); + $this->tokens[$i]['bracket_opener'] = $opener; + $this->tokens[$i]['bracket_closer'] = $i; + $this->tokens[$opener]['bracket_opener'] = $opener; + $this->tokens[$opener]['bracket_closer'] = $i; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($squareOpeners)); + echo str_repeat("\t", count($curlyOpeners)); + echo "\t=> Found square bracket closer at $i for $opener".PHP_EOL; + } + } + break; + case T_CLOSE_CURLY_BRACKET: + if (empty($curlyOpeners) === false + && isset($this->tokens[$i]['scope_opener']) === false + ) { + $opener = array_pop($curlyOpeners); + $this->tokens[$i]['bracket_opener'] = $opener; + $this->tokens[$i]['bracket_closer'] = $i; + $this->tokens[$opener]['bracket_opener'] = $opener; + $this->tokens[$opener]['bracket_closer'] = $i; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", count($squareOpeners)); + echo str_repeat("\t", count($curlyOpeners)); + echo "\t=> Found curly bracket closer at $i for $opener".PHP_EOL; + } + } + break; + default: + continue 2; + }//end switch + }//end for + + // Cleanup for any openers that we didn't find closers for. + // This typically means there was a syntax error breaking things. + foreach ($openers as $opener) { + unset($this->tokens[$opener]['parenthesis_opener']); + unset($this->tokens[$opener]['parenthesis_owner']); + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** END TOKEN MAP ***".PHP_EOL; + } + + }//end createTokenMap() + + + /** + * Creates a map for the parenthesis tokens that surround other tokens. + * + * @return void + */ + private function createParenthesisNestingMap() + { + $map = []; + for ($i = 0; $i < $this->numTokens; $i++) { + if (isset($this->tokens[$i]['parenthesis_opener']) === true + && $i === $this->tokens[$i]['parenthesis_opener'] + ) { + if (empty($map) === false) { + $this->tokens[$i]['nested_parenthesis'] = $map; + } + + if (isset($this->tokens[$i]['parenthesis_closer']) === true) { + $map[$this->tokens[$i]['parenthesis_opener']] + = $this->tokens[$i]['parenthesis_closer']; + } + } else if (isset($this->tokens[$i]['parenthesis_closer']) === true + && $i === $this->tokens[$i]['parenthesis_closer'] + ) { + array_pop($map); + if (empty($map) === false) { + $this->tokens[$i]['nested_parenthesis'] = $map; + } + } else { + if (empty($map) === false) { + $this->tokens[$i]['nested_parenthesis'] = $map; + } + }//end if + }//end for + + }//end createParenthesisNestingMap() + + + /** + * Creates a scope map of tokens that open scopes. + * + * @return void + * @see recurseScopeMap() + */ + private function createScopeMap() + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** START SCOPE MAP ***".PHP_EOL; + } + + for ($i = 0; $i < $this->numTokens; $i++) { + // Check to see if the current token starts a new scope. + if (isset($this->scopeOpeners[$this->tokens[$i]['code']]) === true) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$i]['type']; + $content = Common::prepareForOutput($this->tokens[$i]['content']); + echo "\tStart scope map at $i:$type => $content".PHP_EOL; + } + + if (isset($this->tokens[$i]['scope_condition']) === true) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t* already processed, skipping *".PHP_EOL; + } + + continue; + } + + $i = $this->recurseScopeMap($i); + }//end if + }//end for + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** END SCOPE MAP ***".PHP_EOL; + } + + }//end createScopeMap() + + + /** + * Recurses though the scope openers to build a scope map. + * + * @param int $stackPtr The position in the stack of the token that + * opened the scope (eg. an IF token or FOR token). + * @param int $depth How many scope levels down we are. + * @param int $ignore How many curly braces we are ignoring. + * + * @return int The position in the stack that closed the scope. + * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the nesting level gets too deep. + */ + private function recurseScopeMap($stackPtr, $depth=1, &$ignore=0) + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo "=> Begin scope map recursion at token $stackPtr with depth $depth".PHP_EOL; + } + + $opener = null; + $currType = $this->tokens[$stackPtr]['code']; + $startLine = $this->tokens[$stackPtr]['line']; + + // We will need this to restore the value if we end up + // returning a token ID that causes our calling function to go back + // over already ignored braces. + $originalIgnore = $ignore; + + // If the start token for this scope opener is the same as + // the scope token, we have already found our opener. + if (isset($this->scopeOpeners[$currType]['start'][$currType]) === true) { + $opener = $stackPtr; + } + + for ($i = ($stackPtr + 1); $i < $this->numTokens; $i++) { + $tokenType = $this->tokens[$i]['code']; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$i]['type']; + $line = $this->tokens[$i]['line']; + $content = Common::prepareForOutput($this->tokens[$i]['content']); + + echo str_repeat("\t", $depth); + echo "Process token $i on line $line ["; + if ($opener !== null) { + echo "opener:$opener;"; + } + + if ($ignore > 0) { + echo "ignore=$ignore;"; + } + + echo "]: $type => $content".PHP_EOL; + }//end if + + // Very special case for IF statements in PHP that can be defined without + // scope tokens. E.g., if (1) 1; 1 ? (1 ? 1 : 1) : 1; + // If an IF statement below this one has an opener but no + // keyword, the opener will be incorrectly assigned to this IF statement. + // The same case also applies to USE statements, which don't have to have + // openers, so a following USE statement can cause an incorrect brace match. + if (($currType === T_IF || $currType === T_ELSE || $currType === T_USE) + && $opener === null + && ($this->tokens[$i]['code'] === T_SEMICOLON + || $this->tokens[$i]['code'] === T_CLOSE_TAG) + ) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + if ($this->tokens[$i]['code'] === T_SEMICOLON) { + $closerType = 'semicolon'; + } else { + $closerType = 'close tag'; + } + + echo "=> Found $closerType before scope opener for $stackPtr:$type, bailing".PHP_EOL; + } + + return $i; + } + + // Special case for PHP control structures that have no braces. + // If we find a curly brace closer before we find the opener, + // we're not going to find an opener. That closer probably belongs to + // a control structure higher up. + if ($opener === null + && $ignore === 0 + && $tokenType === T_CLOSE_CURLY_BRACKET + && isset($this->scopeOpeners[$currType]['end'][$tokenType]) === true + ) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Found curly brace closer before scope opener for $stackPtr:$type, bailing".PHP_EOL; + } + + return ($i - 1); + } + + if ($opener !== null + && (isset($this->tokens[$i]['scope_opener']) === false + || $this->scopeOpeners[$this->tokens[$stackPtr]['code']]['shared'] === true) + && isset($this->scopeOpeners[$currType]['end'][$tokenType]) === true + ) { + if ($ignore > 0 && $tokenType === T_CLOSE_CURLY_BRACKET) { + // The last opening bracket must have been for a string + // offset or alike, so let's ignore it. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* finished ignoring curly brace *'.PHP_EOL; + } + + $ignore--; + continue; + } else if ($this->tokens[$opener]['code'] === T_OPEN_CURLY_BRACKET + && $tokenType !== T_CLOSE_CURLY_BRACKET + ) { + // The opener is a curly bracket so the closer must be a curly bracket as well. + // We ignore this closer to handle cases such as T_ELSE or T_ELSEIF being considered + // a closer of T_IF when it should not. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Ignoring non-curly scope closer for $stackPtr:$type".PHP_EOL; + } + } else { + $scopeCloser = $i; + $todo = [ + $stackPtr, + $opener, + ]; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + $closerType = $this->tokens[$scopeCloser]['type']; + echo str_repeat("\t", $depth); + echo "=> Found scope closer ($scopeCloser:$closerType) for $stackPtr:$type".PHP_EOL; + } + + $validCloser = true; + if (($this->tokens[$stackPtr]['code'] === T_IF || $this->tokens[$stackPtr]['code'] === T_ELSEIF) + && ($tokenType === T_ELSE || $tokenType === T_ELSEIF) + ) { + // To be a closer, this token must have an opener. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo "* closer needs to be tested *".PHP_EOL; + } + + $i = self::recurseScopeMap($i, ($depth + 1), $ignore); + + if (isset($this->tokens[$scopeCloser]['scope_opener']) === false) { + $validCloser = false; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo "* closer is not valid (no opener found) *".PHP_EOL; + } + } else if ($this->tokens[$this->tokens[$scopeCloser]['scope_opener']]['code'] !== $this->tokens[$opener]['code']) { + $validCloser = false; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + $type = $this->tokens[$this->tokens[$scopeCloser]['scope_opener']]['type']; + $openerType = $this->tokens[$opener]['type']; + echo "* closer is not valid (mismatched opener type; $type != $openerType) *".PHP_EOL; + } + } else if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo "* closer was valid *".PHP_EOL; + } + } else { + // The closer was not processed, so we need to + // complete that token as well. + $todo[] = $scopeCloser; + }//end if + + if ($validCloser === true) { + foreach ($todo as $token) { + $this->tokens[$token]['scope_condition'] = $stackPtr; + $this->tokens[$token]['scope_opener'] = $opener; + $this->tokens[$token]['scope_closer'] = $scopeCloser; + } + + if ($this->scopeOpeners[$this->tokens[$stackPtr]['code']]['shared'] === true) { + // As we are going back to where we started originally, restore + // the ignore value back to its original value. + $ignore = $originalIgnore; + return $opener; + } else if ($scopeCloser === $i + && isset($this->scopeOpeners[$tokenType]) === true + ) { + // Unset scope_condition here or else the token will appear to have + // already been processed, and it will be skipped. Normally we want that, + // but in this case, the token is both a closer and an opener, so + // it needs to act like an opener. This is also why we return the + // token before this one; so the closer has a chance to be processed + // a second time, but as an opener. + unset($this->tokens[$scopeCloser]['scope_condition']); + return ($i - 1); + } else { + return $i; + } + } else { + continue; + }//end if + }//end if + }//end if + + // Is this an opening condition ? + if (isset($this->scopeOpeners[$tokenType]) === true) { + if ($opener === null) { + if ($tokenType === T_USE) { + // PHP use keywords are special because they can be + // used as blocks but also inline in function definitions. + // So if we find them nested inside another opener, just skip them. + continue; + } + + if ($tokenType === T_NAMESPACE) { + // PHP namespace keywords are special because they can be + // used as blocks but also inline as operators. + // So if we find them nested inside another opener, just skip them. + continue; + } + + if ($tokenType === T_FUNCTION + && $this->tokens[$stackPtr]['code'] !== T_FUNCTION + ) { + // Probably a closure, so process it manually. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Found function before scope opener for $stackPtr:$type, processing manually".PHP_EOL; + } + + if (isset($this->tokens[$i]['scope_closer']) === true) { + // We've already processed this closure. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* already processed, skipping *'.PHP_EOL; + } + + $i = $this->tokens[$i]['scope_closer']; + continue; + } + + $i = self::recurseScopeMap($i, ($depth + 1), $ignore); + continue; + }//end if + + if ($tokenType === T_CLASS) { + // Probably an anonymous class inside another anonymous class, + // so process it manually. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Found class before scope opener for $stackPtr:$type, processing manually".PHP_EOL; + } + + if (isset($this->tokens[$i]['scope_closer']) === true) { + // We've already processed this anon class. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* already processed, skipping *'.PHP_EOL; + } + + $i = $this->tokens[$i]['scope_closer']; + continue; + } + + $i = self::recurseScopeMap($i, ($depth + 1), $ignore); + continue; + }//end if + + // Found another opening condition but still haven't + // found our opener, so we are never going to find one. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Found new opening condition before scope opener for $stackPtr:$type, "; + } + + if (($this->tokens[$stackPtr]['code'] === T_IF + || $this->tokens[$stackPtr]['code'] === T_ELSEIF + || $this->tokens[$stackPtr]['code'] === T_ELSE) + && ($this->tokens[$i]['code'] === T_ELSE + || $this->tokens[$i]['code'] === T_ELSEIF) + ) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "continuing".PHP_EOL; + } + + return ($i - 1); + } else { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "backtracking".PHP_EOL; + } + + return $stackPtr; + } + }//end if + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* token is an opening condition *'.PHP_EOL; + } + + $isShared = ($this->scopeOpeners[$tokenType]['shared'] === true); + + if (isset($this->tokens[$i]['scope_condition']) === true) { + // We've been here before. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* already processed, skipping *'.PHP_EOL; + } + + if ($isShared === false + && isset($this->tokens[$i]['scope_closer']) === true + ) { + $i = $this->tokens[$i]['scope_closer']; + } + + continue; + } else if ($currType === $tokenType + && $isShared === false + && $opener === null + ) { + // We haven't yet found our opener, but we have found another + // scope opener which is the same type as us, and we don't + // share openers, so we will never find one. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* it was another token\'s opener, bailing *'.PHP_EOL; + } + + return $stackPtr; + } else { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* searching for opener *'.PHP_EOL; + } + + if (isset($this->scopeOpeners[$tokenType]['end'][T_CLOSE_CURLY_BRACKET]) === true) { + $oldIgnore = $ignore; + $ignore = 0; + } + + // PHP has a max nesting level for functions. Stop before we hit that limit + // because too many loops means we've run into trouble anyway. + if ($depth > 50) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* reached maximum nesting level; aborting *'.PHP_EOL; + } + + throw new TokenizerException('Maximum nesting level reached; file could not be processed'); + } + + $oldDepth = $depth; + if ($isShared === true + && isset($this->scopeOpeners[$tokenType]['with'][$currType]) === true + ) { + // Don't allow the depth to increment because this is + // possibly not a true nesting if we are sharing our closer. + // This can happen, for example, when a SWITCH has a large + // number of CASE statements with the same shared BREAK. + $depth--; + } + + $i = self::recurseScopeMap($i, ($depth + 1), $ignore); + $depth = $oldDepth; + + if (isset($this->scopeOpeners[$tokenType]['end'][T_CLOSE_CURLY_BRACKET]) === true) { + $ignore = $oldIgnore; + } + }//end if + }//end if + + if (isset($this->scopeOpeners[$currType]['start'][$tokenType]) === true + && $opener === null + ) { + if ($tokenType === T_OPEN_CURLY_BRACKET) { + if (isset($this->tokens[$stackPtr]['parenthesis_closer']) === true + && $i < $this->tokens[$stackPtr]['parenthesis_closer'] + ) { + // We found a curly brace inside the condition of the + // current scope opener, so it must be a string offset. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* ignoring curly brace inside condition *'.PHP_EOL; + } + + $ignore++; + } else { + // Make sure this is actually an opener and not a + // string offset (e.g., $var{0}). + for ($x = ($i - 1); $x > 0; $x--) { + if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { + continue; + } else { + // If the first non-whitespace/comment token looks like this + // brace is a string offset, or this brace is mid-way through + // a new statement, it isn't a scope opener. + $disallowed = Tokens::$assignmentTokens; + $disallowed += [ + T_DOLLAR => true, + T_VARIABLE => true, + T_OBJECT_OPERATOR => true, + T_NULLSAFE_OBJECT_OPERATOR => true, + T_COMMA => true, + T_OPEN_PARENTHESIS => true, + ]; + + if (isset($disallowed[$this->tokens[$x]['code']]) === true) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* ignoring curly brace *'.PHP_EOL; + } + + $ignore++; + } + + break; + }//end if + }//end for + }//end if + }//end if + + if ($ignore === 0 || $tokenType !== T_OPEN_CURLY_BRACKET) { + $openerNested = isset($this->tokens[$i]['nested_parenthesis']); + $ownerNested = isset($this->tokens[$stackPtr]['nested_parenthesis']); + + if (($openerNested === true && $ownerNested === false) + || ($openerNested === false && $ownerNested === true) + || ($openerNested === true + && $this->tokens[$i]['nested_parenthesis'] !== $this->tokens[$stackPtr]['nested_parenthesis']) + ) { + // We found the a token that looks like the opener, but it's nested differently. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$i]['type']; + echo str_repeat("\t", $depth); + echo "* ignoring possible opener $i:$type as nested parenthesis don't match *".PHP_EOL; + } + } else { + // We found the opening scope token for $currType. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Found scope opener for $stackPtr:$type".PHP_EOL; + } + + $opener = $i; + } + }//end if + } else if ($tokenType === T_SEMICOLON + && $opener === null + && (isset($this->tokens[$stackPtr]['parenthesis_closer']) === false + || $i > $this->tokens[$stackPtr]['parenthesis_closer']) + ) { + // Found the end of a statement but still haven't + // found our opener, so we are never going to find one. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Found end of statement before scope opener for $stackPtr:$type, continuing".PHP_EOL; + } + + return ($i - 1); + } else if ($tokenType === T_OPEN_PARENTHESIS) { + if (isset($this->tokens[$i]['parenthesis_owner']) === true) { + $owner = $this->tokens[$i]['parenthesis_owner']; + if (isset(Tokens::$scopeOpeners[$this->tokens[$owner]['code']]) === true + && isset($this->tokens[$i]['parenthesis_closer']) === true + ) { + // If we get into here, then we opened a parenthesis for + // a scope (eg. an if or else if) so we need to update the + // start of the line so that when we check to see + // if the closing parenthesis is more than n lines away from + // the statement, we check from the closing parenthesis. + $startLine = $this->tokens[$this->tokens[$i]['parenthesis_closer']]['line']; + } + } + } else if ($tokenType === T_OPEN_CURLY_BRACKET && $opener !== null) { + // We opened something that we don't have a scope opener for. + // Examples of this are curly brackets for string offsets etc. + // We want to ignore this so that we don't have an invalid scope + // map. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* ignoring curly brace *'.PHP_EOL; + } + + $ignore++; + } else if ($tokenType === T_CLOSE_CURLY_BRACKET && $ignore > 0) { + // We found the end token for the opener we were ignoring. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* finished ignoring curly brace *'.PHP_EOL; + } + + $ignore--; + } else if ($opener === null + && isset($this->scopeOpeners[$currType]) === true + ) { + // If we still haven't found the opener after 30 lines, + // we're not going to find it, unless we know it requires + // an opener (in which case we better keep looking) or the last + // token was empty (in which case we'll just confirm there is + // more code in this file and not just a big comment). + if ($this->tokens[$i]['line'] >= ($startLine + 30) + && isset(Tokens::$emptyTokens[$this->tokens[($i - 1)]['code']]) === false + ) { + if ($this->scopeOpeners[$currType]['strict'] === true) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + $lines = ($this->tokens[$i]['line'] - $startLine); + echo str_repeat("\t", $depth); + echo "=> Still looking for $stackPtr:$type scope opener after $lines lines".PHP_EOL; + } + } else { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Couldn't find scope opener for $stackPtr:$type, bailing".PHP_EOL; + } + + return $stackPtr; + } + } + } else if ($opener !== null + && $tokenType !== T_BREAK + && isset($this->endScopeTokens[$tokenType]) === true + ) { + if (isset($this->tokens[$i]['scope_condition']) === false) { + if ($ignore > 0) { + // We found the end token for the opener we were ignoring. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo '* finished ignoring curly brace *'.PHP_EOL; + } + + $ignore--; + } else { + // We found a token that closes the scope but it doesn't + // have a condition, so it belongs to another token and + // our token doesn't have a closer, so pretend this is + // the closer. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Found (unexpected) scope closer for $stackPtr:$type".PHP_EOL; + } + + foreach ([$stackPtr, $opener] as $token) { + $this->tokens[$token]['scope_condition'] = $stackPtr; + $this->tokens[$token]['scope_opener'] = $opener; + $this->tokens[$token]['scope_closer'] = $i; + } + + return ($i - 1); + }//end if + }//end if + }//end if + }//end for + + return $stackPtr; + + }//end recurseScopeMap() + + + /** + * Constructs the level map. + * + * The level map adds a 'level' index to each token which indicates the + * depth that a token within a set of scope blocks. It also adds a + * 'conditions' index which is an array of the scope conditions that opened + * each of the scopes - position 0 being the first scope opener. + * + * @return void + */ + private function createLevelMap() + { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** START LEVEL MAP ***".PHP_EOL; + } + + $this->numTokens = count($this->tokens); + $level = 0; + $conditions = []; + $lastOpener = null; + $openers = []; + + for ($i = 0; $i < $this->numTokens; $i++) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$i]['type']; + $line = $this->tokens[$i]['line']; + $len = $this->tokens[$i]['length']; + $col = $this->tokens[$i]['column']; + + $content = Common::prepareForOutput($this->tokens[$i]['content']); + + echo str_repeat("\t", ($level + 1)); + echo "Process token $i on line $line [col:$col;len:$len;lvl:$level;"; + if (empty($conditions) !== true) { + $conditionString = 'conds;'; + foreach ($conditions as $condition) { + $conditionString .= Tokens::tokenName($condition).','; + } + + echo rtrim($conditionString, ',').';'; + } + + echo "]: $type => $content".PHP_EOL; + }//end if + + $this->tokens[$i]['level'] = $level; + $this->tokens[$i]['conditions'] = $conditions; + + if (isset($this->tokens[$i]['scope_condition']) === true) { + // Check to see if this token opened the scope. + if ($this->tokens[$i]['scope_opener'] === $i) { + $stackPtr = $this->tokens[$i]['scope_condition']; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", ($level + 1)); + echo "=> Found scope opener for $stackPtr:$type".PHP_EOL; + } + + $stackPtr = $this->tokens[$i]['scope_condition']; + + // If we find a scope opener that has a shared closer, + // then we need to go back over the condition map that we + // just created and fix ourselves as we just added some + // conditions where there was none. This happens for T_CASE + // statements that are using the same break statement. + if ($lastOpener !== null && $this->tokens[$lastOpener]['scope_closer'] === $this->tokens[$i]['scope_closer']) { + // This opener shares its closer with the previous opener, + // but we still need to check if the two openers share their + // closer with each other directly (like CASE and DEFAULT) + // or if they are just sharing because one doesn't have a + // closer (like CASE with no BREAK using a SWITCHes closer). + $thisType = $this->tokens[$this->tokens[$i]['scope_condition']]['code']; + $opener = $this->tokens[$lastOpener]['scope_condition']; + + $isShared = isset($this->scopeOpeners[$thisType]['with'][$this->tokens[$opener]['code']]); + + reset($this->scopeOpeners[$thisType]['end']); + reset($this->scopeOpeners[$this->tokens[$opener]['code']]['end']); + $sameEnd = (current($this->scopeOpeners[$thisType]['end']) === current($this->scopeOpeners[$this->tokens[$opener]['code']]['end'])); + + if ($isShared === true && $sameEnd === true) { + $badToken = $opener; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$badToken]['type']; + echo str_repeat("\t", ($level + 1)); + echo "* shared closer, cleaning up $badToken:$type *".PHP_EOL; + } + + for ($x = $this->tokens[$i]['scope_condition']; $x <= $i; $x++) { + $oldConditions = $this->tokens[$x]['conditions']; + $oldLevel = $this->tokens[$x]['level']; + $this->tokens[$x]['level']--; + unset($this->tokens[$x]['conditions'][$badToken]); + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$x]['type']; + $oldConds = ''; + foreach ($oldConditions as $condition) { + $oldConds .= Tokens::tokenName($condition).','; + } + + $oldConds = rtrim($oldConds, ','); + + $newConds = ''; + foreach ($this->tokens[$x]['conditions'] as $condition) { + $newConds .= Tokens::tokenName($condition).','; + } + + $newConds = rtrim($newConds, ','); + + $newLevel = $this->tokens[$x]['level']; + echo str_repeat("\t", ($level + 1)); + echo "* cleaned $x:$type *".PHP_EOL; + echo str_repeat("\t", ($level + 2)); + echo "=> level changed from $oldLevel to $newLevel".PHP_EOL; + echo str_repeat("\t", ($level + 2)); + echo "=> conditions changed from $oldConds to $newConds".PHP_EOL; + }//end if + }//end for + + unset($conditions[$badToken]); + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$badToken]['type']; + echo str_repeat("\t", ($level + 1)); + echo "* token $badToken:$type removed from conditions array *".PHP_EOL; + } + + unset($openers[$lastOpener]); + + $level--; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", ($level + 2)); + echo '* level decreased *'.PHP_EOL; + } + }//end if + }//end if + + $level++; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", ($level + 1)); + echo '* level increased *'.PHP_EOL; + } + + $conditions[$stackPtr] = $this->tokens[$stackPtr]['code']; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$stackPtr]['type']; + echo str_repeat("\t", ($level + 1)); + echo "* token $stackPtr:$type added to conditions array *".PHP_EOL; + } + + $lastOpener = $this->tokens[$i]['scope_opener']; + if ($lastOpener !== null) { + $openers[$lastOpener] = $lastOpener; + } + } else if ($lastOpener !== null && $this->tokens[$lastOpener]['scope_closer'] === $i) { + foreach (array_reverse($openers) as $opener) { + if ($this->tokens[$opener]['scope_closer'] === $i) { + $oldOpener = array_pop($openers); + if (empty($openers) === false) { + $lastOpener = array_pop($openers); + $openers[$lastOpener] = $lastOpener; + } else { + $lastOpener = null; + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$oldOpener]['type']; + echo str_repeat("\t", ($level + 1)); + echo "=> Found scope closer for $oldOpener:$type".PHP_EOL; + } + + $oldCondition = array_pop($conditions); + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", ($level + 1)); + echo '* token '.Tokens::tokenName($oldCondition).' removed from conditions array *'.PHP_EOL; + } + + // Make sure this closer actually belongs to us. + // Either the condition also has to think this is the + // closer, or it has to allow sharing with us. + $condition = $this->tokens[$this->tokens[$i]['scope_condition']]['code']; + if ($condition !== $oldCondition) { + if (isset($this->scopeOpeners[$oldCondition]['with'][$condition]) === false) { + $badToken = $this->tokens[$oldOpener]['scope_condition']; + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = Tokens::tokenName($oldCondition); + echo str_repeat("\t", ($level + 1)); + echo "* scope closer was bad, cleaning up $badToken:$type *".PHP_EOL; + } + + for ($x = ($oldOpener + 1); $x <= $i; $x++) { + $oldConditions = $this->tokens[$x]['conditions']; + $oldLevel = $this->tokens[$x]['level']; + $this->tokens[$x]['level']--; + unset($this->tokens[$x]['conditions'][$badToken]); + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $this->tokens[$x]['type']; + $oldConds = ''; + foreach ($oldConditions as $condition) { + $oldConds .= Tokens::tokenName($condition).','; + } + + $oldConds = rtrim($oldConds, ','); + + $newConds = ''; + foreach ($this->tokens[$x]['conditions'] as $condition) { + $newConds .= Tokens::tokenName($condition).','; + } + + $newConds = rtrim($newConds, ','); + + $newLevel = $this->tokens[$x]['level']; + echo str_repeat("\t", ($level + 1)); + echo "* cleaned $x:$type *".PHP_EOL; + echo str_repeat("\t", ($level + 2)); + echo "=> level changed from $oldLevel to $newLevel".PHP_EOL; + echo str_repeat("\t", ($level + 2)); + echo "=> conditions changed from $oldConds to $newConds".PHP_EOL; + }//end if + }//end for + }//end if + }//end if + + $level--; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", ($level + 2)); + echo '* level decreased *'.PHP_EOL; + } + + $this->tokens[$i]['level'] = $level; + $this->tokens[$i]['conditions'] = $conditions; + }//end if + }//end foreach + }//end if + }//end if + }//end for + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t*** END LEVEL MAP ***".PHP_EOL; + } + + }//end createLevelMap() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Cache.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Cache.php new file mode 100644 index 00000000..408de96e --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Cache.php @@ -0,0 +1,355 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Util; + +use FilesystemIterator; +use PHP_CodeSniffer\Autoload; +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Ruleset; +use RecursiveCallbackFilterIterator; +use RecursiveDirectoryIterator; +use RecursiveIteratorIterator; + +class Cache +{ + + /** + * The filesystem location of the cache file. + * + * @var string + */ + private static $path = ''; + + /** + * The cached data. + * + * @var array + */ + private static $cache = []; + + + /** + * Loads existing cache data for the run, if any. + * + * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run. + * @param \PHP_CodeSniffer\Config $config The config data for the run. + * + * @return void + */ + public static function load(Ruleset $ruleset, Config $config) + { + // Look at every loaded sniff class so far and use their file contents + // to generate a hash for the code used during the run. + // At this point, the loaded class list contains the core PHPCS code + // and all sniffs that have been loaded as part of the run. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo PHP_EOL."\tGenerating loaded file list for code hash".PHP_EOL; + } + + $codeHashFiles = []; + + $classes = array_keys(Autoload::getLoadedClasses()); + sort($classes); + + $installDir = dirname(__DIR__); + $installDirLen = strlen($installDir); + $standardDir = $installDir.DIRECTORY_SEPARATOR.'Standards'; + $standardDirLen = strlen($standardDir); + foreach ($classes as $file) { + if (substr($file, 0, $standardDirLen) !== $standardDir) { + if (substr($file, 0, $installDirLen) === $installDir) { + // We are only interested in sniffs here. + continue; + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t=> external file: $file".PHP_EOL; + } + } else if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t=> internal sniff: $file".PHP_EOL; + } + + $codeHashFiles[] = $file; + } + + // Add the content of the used rulesets to the hash so that sniff setting + // changes in the ruleset invalidate the cache. + $rulesets = $ruleset->paths; + sort($rulesets); + foreach ($rulesets as $file) { + if (substr($file, 0, $standardDirLen) !== $standardDir) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t=> external ruleset: $file".PHP_EOL; + } + } else if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t=> internal ruleset: $file".PHP_EOL; + } + + $codeHashFiles[] = $file; + } + + // Go through the core PHPCS code and add those files to the file + // hash. This ensures that core PHPCS changes will also invalidate the cache. + // Note that we ignore sniffs here, and any files that don't affect + // the outcome of the run. + $di = new RecursiveDirectoryIterator( + $installDir, + (FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS) + ); + $filter = new RecursiveCallbackFilterIterator( + $di, + function ($file, $key, $iterator) { + // Skip non-php files. + $filename = $file->getFilename(); + if ($file->isFile() === true && substr($filename, -4) !== '.php') { + return false; + } + + $filePath = Common::realpath($key); + if ($filePath === false) { + return false; + } + + if ($iterator->hasChildren() === true + && ($filename === 'Standards' + || $filename === 'Exceptions' + || $filename === 'Reports' + || $filename === 'Generators') + ) { + return false; + } + + return true; + } + ); + + $iterator = new RecursiveIteratorIterator($filter); + foreach ($iterator as $file) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t=> core file: $file".PHP_EOL; + } + + $codeHashFiles[] = $file->getPathname(); + } + + $codeHash = ''; + sort($codeHashFiles); + foreach ($codeHashFiles as $file) { + $codeHash .= md5_file($file); + } + + $codeHash = md5($codeHash); + + // Along with the code hash, use various settings that can affect + // the results of a run to create a new hash. This hash will be used + // in the cache file name. + $rulesetHash = md5(var_export($ruleset->ignorePatterns, true).var_export($ruleset->includePatterns, true)); + $phpExtensionsHash = md5(var_export(get_loaded_extensions(), true)); + $configData = [ + 'phpVersion' => PHP_VERSION_ID, + 'phpExtensions' => $phpExtensionsHash, + 'tabWidth' => $config->tabWidth, + 'encoding' => $config->encoding, + 'recordErrors' => $config->recordErrors, + 'annotations' => $config->annotations, + 'configData' => Config::getAllConfigData(), + 'codeHash' => $codeHash, + 'rulesetHash' => $rulesetHash, + ]; + + $configString = var_export($configData, true); + $cacheHash = substr(sha1($configString), 0, 12); + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\tGenerating cache key data".PHP_EOL; + foreach ($configData as $key => $value) { + if (is_array($value) === true) { + echo "\t\t=> $key:".PHP_EOL; + foreach ($value as $subKey => $subValue) { + echo "\t\t\t=> $subKey: $subValue".PHP_EOL; + } + + continue; + } + + if ($value === true || $value === false) { + $value = (int) $value; + } + + echo "\t\t=> $key: $value".PHP_EOL; + } + + echo "\t\t=> cacheHash: $cacheHash".PHP_EOL; + }//end if + + if ($config->cacheFile !== null) { + $cacheFile = $config->cacheFile; + } else { + // Determine the common paths for all files being checked. + // We can use this to locate an existing cache file, or to + // determine where to create a new one. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\tChecking possible cache file paths".PHP_EOL; + } + + $paths = []; + foreach ($config->files as $file) { + $file = Common::realpath($file); + while ($file !== DIRECTORY_SEPARATOR) { + if (isset($paths[$file]) === false) { + $paths[$file] = 1; + } else { + $paths[$file]++; + } + + $lastFile = $file; + $file = dirname($file); + if ($file === $lastFile) { + // Just in case something went wrong, + // we don't want to end up in an infinite loop. + break; + } + } + } + + ksort($paths); + $paths = array_reverse($paths); + + $numFiles = count($config->files); + + $cacheFile = null; + $cacheDir = getenv('XDG_CACHE_HOME'); + if ($cacheDir === false || is_dir($cacheDir) === false) { + $cacheDir = sys_get_temp_dir(); + } + + foreach ($paths as $file => $count) { + if ($count !== $numFiles) { + unset($paths[$file]); + continue; + } + + $fileHash = substr(sha1($file), 0, 12); + $testFile = $cacheDir.DIRECTORY_SEPARATOR."phpcs.$fileHash.$cacheHash.cache"; + if ($cacheFile === null) { + // This will be our default location if we can't find + // an existing file. + $cacheFile = $testFile; + } + + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t\t=> $testFile".PHP_EOL; + echo "\t\t\t * based on shared location: $file *".PHP_EOL; + } + + if (file_exists($testFile) === true) { + $cacheFile = $testFile; + break; + } + }//end foreach + + if ($cacheFile === null) { + // Unlikely, but just in case $paths is empty for some reason. + $cacheFile = $cacheDir.DIRECTORY_SEPARATOR."phpcs.$cacheHash.cache"; + } + }//end if + + self::$path = $cacheFile; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t=> Using cache file: ".self::$path.PHP_EOL; + } + + if (file_exists(self::$path) === true) { + self::$cache = json_decode(file_get_contents(self::$path), true); + + // Verify the contents of the cache file. + if (self::$cache['config'] !== $configData) { + self::$cache = []; + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t* cache was invalid and has been cleared *".PHP_EOL; + } + } + } else if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "\t* cache file does not exist *".PHP_EOL; + } + + self::$cache['config'] = $configData; + + }//end load() + + + /** + * Saves the current cache to the filesystem. + * + * @return void + */ + public static function save() + { + file_put_contents(self::$path, json_encode(self::$cache)); + + }//end save() + + + /** + * Retrieves a single entry from the cache. + * + * @param string $key The key of the data to get. If NULL, + * everything in the cache is returned. + * + * @return mixed + */ + public static function get($key=null) + { + if ($key === null) { + return self::$cache; + } + + if (isset(self::$cache[$key]) === true) { + return self::$cache[$key]; + } + + return false; + + }//end get() + + + /** + * Retrieves a single entry from the cache. + * + * @param string $key The key of the data to set. If NULL, + * sets the entire cache. + * @param mixed $value The value to set. + * + * @return void + */ + public static function set($key, $value) + { + if ($key === null) { + self::$cache = $value; + } else { + self::$cache[$key] = $value; + } + + }//end set() + + + /** + * Retrieves the number of cache entries. + * + * @return int + */ + public static function getSize() + { + return (count(self::$cache) - 1); + + }//end getSize() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Common.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Common.php new file mode 100644 index 00000000..63a76ce2 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Common.php @@ -0,0 +1,586 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Util; + +use Phar; + +class Common +{ + + /** + * An array of variable types for param/var we will check. + * + * @var string[] + */ + public static $allowedTypes = [ + 'array', + 'boolean', + 'float', + 'integer', + 'mixed', + 'object', + 'string', + 'resource', + 'callable', + ]; + + + /** + * Return TRUE if the path is a PHAR file. + * + * @param string $path The path to use. + * + * @return bool + */ + public static function isPharFile($path) + { + if (strpos($path, 'phar://') === 0) { + return true; + } + + return false; + + }//end isPharFile() + + + /** + * Checks if a file is readable. + * + * Addresses PHP bug related to reading files from network drives on Windows. + * e.g. when using WSL2. + * + * @param string $path The path to the file. + * + * @return boolean + */ + public static function isReadable($path) + { + if (@is_readable($path) === true) { + return true; + } + + if (@file_exists($path) === true && @is_file($path) === true) { + $f = @fopen($path, 'rb'); + if (fclose($f) === true) { + return true; + } + } + + return false; + + }//end isReadable() + + + /** + * CodeSniffer alternative for realpath. + * + * Allows for PHAR support. + * + * @param string $path The path to use. + * + * @return string|false + */ + public static function realpath($path) + { + // Support the path replacement of ~ with the user's home directory. + if (substr($path, 0, 2) === '~/') { + $homeDir = getenv('HOME'); + if ($homeDir !== false) { + $path = $homeDir.substr($path, 1); + } + } + + // Check for process substitution. + if (strpos($path, '/dev/fd') === 0) { + return str_replace('/dev/fd', 'php://fd', $path); + } + + // No extra work needed if this is not a phar file. + if (self::isPharFile($path) === false) { + return realpath($path); + } + + // Before trying to break down the file path, + // check if it exists first because it will mostly not + // change after running the below code. + if (file_exists($path) === true) { + return $path; + } + + $phar = Phar::running(false); + $extra = str_replace('phar://'.$phar, '', $path); + $path = realpath($phar); + if ($path === false) { + return false; + } + + $path = 'phar://'.$path.$extra; + if (file_exists($path) === true) { + return $path; + } + + return false; + + }//end realpath() + + + /** + * Removes a base path from the front of a file path. + * + * @param string $path The path of the file. + * @param string $basepath The base path to remove. This should not end + * with a directory separator. + * + * @return string + */ + public static function stripBasepath($path, $basepath) + { + if (empty($basepath) === true) { + return $path; + } + + $basepathLen = strlen($basepath); + if (substr($path, 0, $basepathLen) === $basepath) { + $path = substr($path, $basepathLen); + } + + $path = ltrim($path, DIRECTORY_SEPARATOR); + if ($path === '') { + $path = '.'; + } + + return $path; + + }//end stripBasepath() + + + /** + * Detects the EOL character being used in a string. + * + * @param string $contents The contents to check. + * + * @return string + */ + public static function detectLineEndings($contents) + { + if (preg_match("/\r\n?|\n/", $contents, $matches) !== 1) { + // Assume there are no newlines. + $eolChar = "\n"; + } else { + $eolChar = $matches[0]; + } + + return $eolChar; + + }//end detectLineEndings() + + + /** + * Check if STDIN is a TTY. + * + * @return boolean + */ + public static function isStdinATTY() + { + // The check is slow (especially calling `tty`) so we static + // cache the result. + static $isTTY = null; + + if ($isTTY !== null) { + return $isTTY; + } + + if (defined('STDIN') === false) { + return false; + } + + // If PHP has the POSIX extensions we will use them. + if (function_exists('posix_isatty') === true) { + $isTTY = (posix_isatty(STDIN) === true); + return $isTTY; + } + + // Next try is detecting whether we have `tty` installed and use that. + if (defined('PHP_WINDOWS_VERSION_PLATFORM') === true) { + $devnull = 'NUL'; + $which = 'where'; + } else { + $devnull = '/dev/null'; + $which = 'which'; + } + + $tty = trim(shell_exec("$which tty 2> $devnull")); + if (empty($tty) === false) { + exec("tty -s 2> $devnull", $output, $returnValue); + $isTTY = ($returnValue === 0); + return $isTTY; + } + + // Finally we will use fstat. The solution borrowed from + // https://stackoverflow.com/questions/11327367/detect-if-a-php-script-is-being-run-interactively-or-not + // This doesn't work on Mingw/Cygwin/... using Mintty but they + // have `tty` installed. + $type = [ + 'S_IFMT' => 0170000, + 'S_IFIFO' => 0010000, + ]; + + $stat = fstat(STDIN); + $mode = ($stat['mode'] & $type['S_IFMT']); + $isTTY = ($mode !== $type['S_IFIFO']); + + return $isTTY; + + }//end isStdinATTY() + + + /** + * Escape a path to a system command. + * + * @param string $cmd The path to the system command. + * + * @return string + */ + public static function escapeshellcmd($cmd) + { + $cmd = escapeshellcmd($cmd); + + if (stripos(PHP_OS, 'WIN') === 0) { + // Spaces are not escaped by escapeshellcmd on Windows, but need to be + // for the command to be able to execute. + $cmd = preg_replace('`(? 0) { + return false; + } + + if ($strict === true) { + // Check that there are not two capital letters next to each other. + $length = strlen($string); + $lastCharWasCaps = $classFormat; + + for ($i = 1; $i < $length; $i++) { + $ascii = ord($string[$i]); + if ($ascii >= 48 && $ascii <= 57) { + // The character is a number, so it can't be a capital. + $isCaps = false; + } else { + if (strtoupper($string[$i]) === $string[$i]) { + $isCaps = true; + } else { + $isCaps = false; + } + } + + if ($isCaps === true && $lastCharWasCaps === true) { + return false; + } + + $lastCharWasCaps = $isCaps; + } + }//end if + + return true; + + }//end isCamelCaps() + + + /** + * Returns true if the specified string is in the underscore caps format. + * + * @param string $string The string to verify. + * + * @return boolean + */ + public static function isUnderscoreName($string) + { + // If there are space in the name, it can't be valid. + if (strpos($string, ' ') !== false) { + return false; + } + + $validName = true; + $nameBits = explode('_', $string); + + if (preg_match('|^[A-Z]|', $string) === 0) { + // Name does not begin with a capital letter. + $validName = false; + } else { + foreach ($nameBits as $bit) { + if ($bit === '') { + continue; + } + + if ($bit[0] !== strtoupper($bit[0])) { + $validName = false; + break; + } + } + } + + return $validName; + + }//end isUnderscoreName() + + + /** + * Returns a valid variable type for param/var tags. + * + * If type is not one of the standard types, it must be a custom type. + * Returns the correct type name suggestion if type name is invalid. + * + * @param string $varType The variable type to process. + * + * @return string + */ + public static function suggestType($varType) + { + if ($varType === '') { + return ''; + } + + if (in_array($varType, self::$allowedTypes, true) === true) { + return $varType; + } else { + $lowerVarType = strtolower($varType); + switch ($lowerVarType) { + case 'bool': + case 'boolean': + return 'boolean'; + case 'double': + case 'real': + case 'float': + return 'float'; + case 'int': + case 'integer': + return 'integer'; + case 'array()': + case 'array': + return 'array'; + }//end switch + + if (strpos($lowerVarType, 'array(') !== false) { + // Valid array declaration: + // array, array(type), array(type1 => type2). + $matches = []; + $pattern = '/^array\(\s*([^\s^=^>]*)(\s*=>\s*(.*))?\s*\)/i'; + if (preg_match($pattern, $varType, $matches) !== 0) { + $type1 = ''; + if (isset($matches[1]) === true) { + $type1 = $matches[1]; + } + + $type2 = ''; + if (isset($matches[3]) === true) { + $type2 = $matches[3]; + } + + $type1 = self::suggestType($type1); + $type2 = self::suggestType($type2); + if ($type2 !== '') { + $type2 = ' => '.$type2; + } + + return "array($type1$type2)"; + } else { + return 'array'; + }//end if + } else if (in_array($lowerVarType, self::$allowedTypes, true) === true) { + // A valid type, but not lower cased. + return $lowerVarType; + } else { + // Must be a custom type name. + return $varType; + }//end if + }//end if + + }//end suggestType() + + + /** + * Given a sniff class name, returns the code for the sniff. + * + * @param string $sniffClass The fully qualified sniff class name. + * + * @return string + */ + public static function getSniffCode($sniffClass) + { + $parts = explode('\\', $sniffClass); + $sniff = array_pop($parts); + + if (substr($sniff, -5) === 'Sniff') { + // Sniff class name. + $sniff = substr($sniff, 0, -5); + } else { + // Unit test class name. + $sniff = substr($sniff, 0, -8); + } + + $category = array_pop($parts); + $sniffDir = array_pop($parts); + $standard = array_pop($parts); + $code = $standard.'.'.$category.'.'.$sniff; + return $code; + + }//end getSniffCode() + + + /** + * Removes project-specific information from a sniff class name. + * + * @param string $sniffClass The fully qualified sniff class name. + * + * @return string + */ + public static function cleanSniffClass($sniffClass) + { + $newName = strtolower($sniffClass); + + $sniffPos = strrpos($newName, '\sniffs\\'); + if ($sniffPos === false) { + // Nothing we can do as it isn't in a known format. + return $newName; + } + + $end = (strlen($newName) - $sniffPos + 1); + $start = strrpos($newName, '\\', ($end * -1)); + + if ($start === false) { + // Nothing needs to be cleaned. + return $newName; + } + + $newName = substr($newName, ($start + 1)); + return $newName; + + }//end cleanSniffClass() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Help.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Help.php new file mode 100644 index 00000000..a7602b7d --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Help.php @@ -0,0 +1,626 @@ + + * @copyright 2024 Juliette Reinders Folmer. All rights reserved. + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Util; + +use InvalidArgumentException; +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Util\Common; + +final class Help +{ + + + /** + * Short options which are available for both the `phpcs` as well as the `phpcbf` command. + * + * @var string + */ + const DEFAULT_SHORT_OPTIONS = '-hilnpqvw'; + + /** + * Long options which are available for both the `phpcs` as well as the `phpcbf` command. + * + * {@internal This should be a constant array, but those aren't supported until PHP 5.6.} + * + * @var string Comma-separated list of the option names. + */ + const DEFAULT_LONG_OPTIONS = 'basepath,bootstrap,colors,encoding,error-severity,exclude,extensions,file,file-list,filter,ignore,ignore-annotations,no-colors,parallel,php-ini,report-width,runtime-set,severity,sniffs,standard,stdin-path,tab-width,version,vv,vvv,warning-severity'; + + /** + * Minimum screen width. + * + * The help info needs room to display, so this is the minimum acceptable width. + * + * @var integer + */ + const MIN_WIDTH = 60; + + /** + * Indent option lines. + * + * @var string + */ + const INDENT = ' '; + + /** + * Gutter spacing for between the option argument info and the option description. + * + * @var string + */ + const GUTTER = ' '; + + /** + * The current PHPCS Configuration. + * + * @var \PHP_CodeSniffer\Config + */ + private $config; + + /** + * The options which should be shown for this help screen. + * + * @var array + */ + private $requestedOptions = []; + + /** + * Active options per category (after filtering). + * + * @var array>> + */ + private $activeOptions = []; + + /** + * Width of the indent for option lines. + * + * @var integer + */ + private $indentWidth = 0; + + /** + * Width of the gutter spacing. + * + * @var integer + */ + private $gutterWidth = 0; + + /** + * Width of longest option argument info entry. + * + * @var integer + */ + private $maxOptionNameLength = 0; + + + /** + * Constructor. + * + * @param \PHP_CodeSniffer\Config $config Configuration object. + * @param array $longOptions The long options which should be shown. + * @param string $shortOptions The short options which should be shown. + * + * @throws \InvalidArgumentException When $shortOptions is not a string. + */ + public function __construct(Config $config, array $longOptions, $shortOptions='') + { + if (is_string($shortOptions) === false) { + throw new InvalidArgumentException('The $shortOptions parameter must be a string'); + } + + $this->config = $config; + $this->requestedOptions = array_merge($longOptions, str_split($shortOptions)); + + $this->filterOptions(); + + $this->indentWidth = strlen(self::INDENT); + $this->gutterWidth = strlen(self::GUTTER); + + $this->setMaxOptionNameLength(); + + }//end __construct() + + + /** + * Display the help info. + * + * @return void + */ + public function display() + { + $this->printUsage(); + $this->printCategories(); + + }//end display() + + + /** + * Filter the available options based on the requested options. + * + * @return void + */ + private function filterOptions() + { + $filteredOptions = $this->getAllOptions(); + + foreach ($filteredOptions as $category => $options) { + // Initial state set to "true" to prevent a spacer at the start of an array. + $lastWasSpacer = true; + $spacerCount = 0; + + foreach ($options as $name => $option) { + if ($lastWasSpacer !== true && strpos($name, 'blank-line') === 0) { + ++$spacerCount; + $lastWasSpacer = true; + continue; + } + + if (in_array($name, $this->requestedOptions, true) === false) { + unset($filteredOptions[$category][$name]); + continue; + } + + $lastWasSpacer = false; + } + + // Make sure the final array doesn't contain a spacer at the end. + if (empty($filteredOptions[$category]) === false) { + end($filteredOptions[$category]); + $key = key($filteredOptions[$category]); + if (strpos($key, 'blank-line') === 0) { + unset($filteredOptions[$category][$key]); + --$spacerCount; + } + } + + // Remove categories now left empty. + if (empty($filteredOptions[$category]) === true || count($filteredOptions[$category]) === $spacerCount) { + unset($filteredOptions[$category]); + } + }//end foreach + + $this->activeOptions = $filteredOptions; + + }//end filterOptions() + + + /** + * Determine the length of the longest option argument and store it. + * + * @return void + */ + private function setMaxOptionNameLength() + { + $lengths = []; + foreach ($this->activeOptions as $category => $options) { + foreach ($options as $option) { + if (isset($option['argument']) === false) { + continue; + } + + $lengths[] = strlen($option['argument']); + } + } + + if (empty($lengths) === false) { + $this->maxOptionNameLength = max($lengths); + } + + }//end setMaxOptionNameLength() + + + /** + * Get the maximum width which can be used to display the help info. + * + * Independently of user preference/auto-determined width of the current screen, + * a minimum width is needed to display information, so don't allow this to get too low. + * + * @return int + */ + private function getMaxWidth() + { + return max(self::MIN_WIDTH, $this->config->reportWidth); + + }//end getMaxWidth() + + + /** + * Get the maximum width for the text in the option description column. + * + * @return int + */ + private function getDescriptionColumnWidth() + { + return ($this->getMaxWidth() - $this->maxOptionNameLength - $this->indentWidth - $this->gutterWidth); + + }//end getDescriptionColumnWidth() + + + /** + * Get the length of the indentation needed for follow up lines when the description does not fit on one line. + * + * @return int + */ + private function getDescriptionFollowupLineIndentLength() + { + return ($this->maxOptionNameLength + $this->indentWidth + $this->gutterWidth); + + }//end getDescriptionFollowupLineIndentLength() + + + /** + * Print basic usage information to the screen. + * + * @return void + */ + private function printUsage() + { + $command = 'phpcs'; + if (defined('PHP_CODESNIFFER_CBF') === true && PHP_CODESNIFFER_CBF === true) { + // @codeCoverageIgnore + $command = 'phpcbf'; + } + + $this->printCategoryHeader('Usage'); + + echo self::INDENT.$command.' [options] '.PHP_EOL; + + }//end printUsage() + + + /** + * Print details of all the requested options to the screen, sorted by category. + * + * @return void + */ + private function printCategories() + { + foreach ($this->activeOptions as $category => $options) { + $this->printCategoryHeader($category); + $this->printCategoryOptions($options); + } + + }//end printCategories() + + + /** + * Print a category header. + * + * @param string $header The header text. + * + * @return void + */ + private function printCategoryHeader($header) + { + $header .= ':'; + if ($this->config->colors === true) { + $header = "\033[33m{$header}\033[0m"; + } + + echo PHP_EOL.$header.PHP_EOL; + + }//end printCategoryHeader() + + + /** + * Print the options for a category. + * + * @param array> $options The options to display. + * + * @return void + */ + private function printCategoryOptions(array $options) + { + $maxDescriptionWidth = $this->getDescriptionColumnWidth(); + $maxTextWidth = ($this->getMaxWidth() - $this->indentWidth); + $secondLineIndent = str_repeat(' ', $this->getDescriptionFollowupLineIndentLength()); + + $output = ''; + foreach ($options as $option) { + if (isset($option['spacer']) === true) { + $output .= PHP_EOL; + } + + if (isset($option['text']) === true) { + $text = wordwrap($option['text'], $maxTextWidth, "\n"); + $output .= self::INDENT.implode(PHP_EOL.self::INDENT, explode("\n", $text)).PHP_EOL; + } + + if (isset($option['argument'], $option['description']) === true) { + $argument = str_pad($option['argument'], $this->maxOptionNameLength); + $argument = $this->colorizeVariableInput($argument); + $output .= self::INDENT."\033[32m{$argument}\033[0m"; + $output .= self::GUTTER; + + $description = wordwrap($option['description'], $maxDescriptionWidth, "\n"); + $output .= implode(PHP_EOL.$secondLineIndent, explode("\n", $description)).PHP_EOL; + } + } + + if ($this->config->colors === false) { + $output = Common::stripColors($output); + } + + echo $output; + + }//end printCategoryOptions() + + + /** + * Colorize "variable" input in the option argument info. + * + * For the purposes of this method, "variable" input is text between <> brackets. + * The regex allows for multiple tags and nested tags. + * + * @param string $text The text to process. + * + * @return string + */ + private function colorizeVariableInput($text) + { + return preg_replace('`(<(?:(?>[^<>]+)|(?R))*>)`', "\033[36m".'$1'."\033[32m", $text); + + }//end colorizeVariableInput() + + + /** + * Retrieve the help details for all supported CLI arguments per category. + * + * @return array>> + */ + private function getAllOptions() + { + $options = []; + + // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Readability is more important. + $options['Scan targets'] = [ + 'file' => [ + 'argument' => '', + 'description' => 'One or more files and/or directories to check, space separated.', + ], + '-' => [ + 'argument' => '-', + 'description' => 'Check STDIN instead of local files and directories.', + ], + 'stdin-path' => [ + 'argument' => '--stdin-path=', + 'description' => 'If processing STDIN, the file path that STDIN will be processed as.', + ], + 'file-list' => [ + 'argument' => '--file-list=', + 'description' => 'Check the files and/or directories which are defined in the file to which the path is provided (one per line).', + ], + 'filter' => [ + 'argument' => '--filter=', + 'description' => 'Check based on a predefined file filter. Use either the "GitModified" or "GitStaged" filter, or specify the path to a custom filter class.', + ], + 'ignore' => [ + 'argument' => '--ignore=', + 'description' => 'Ignore files based on a comma-separated list of patterns matching files and/or directories.', + ], + 'extensions' => [ + 'argument' => '--extensions=', + 'description' => 'Check files with the specified file extensions (comma-separated list). Defaults to php,inc/php,js,css.'."\n" + .'The type of the file can be specified using: ext/type; e.g. module/php,es/js.', + ], + 'l' => [ + 'argument' => '-l', + 'description' => 'Check local directory only, no recursion.', + ], + ]; + + $options['Rule Selection Options'] = [ + 'standard' => [ + 'argument' => '--standard=', + 'description' => 'The name of, or the path to, the coding standard to use. Can be a comma-separated list specifying multiple standards. If no standard is specified, PHP_CodeSniffer will look for a [.]phpcs.xml[.dist] custom ruleset file in the current directory and those above it.', + ], + 'sniffs' => [ + 'argument' => '--sniffs=', + 'description' => 'A comma-separated list of sniff codes to limit the scan to. All sniffs must be part of the standard in use.', + ], + 'exclude' => [ + 'argument' => '--exclude=', + 'description' => 'A comma-separated list of sniff codes to exclude from the scan. All sniffs must be part of the standard in use.', + ], + 'blank-line' => ['spacer' => ''], + + 'i' => [ + 'argument' => '-i', + 'description' => 'Show a list of installed coding standards.', + ], + 'e' => [ + 'argument' => '-e', + 'description' => 'Explain a standard by showing the names of all the sniffs it includes.', + ], + 'generator' => [ + 'argument' => '--generator=', + 'description' => 'Show documentation for a standard. Use either the "HTML", "Markdown" or "Text" generator.', + ], + ]; + + $options['Run Options'] = [ + 'a' => [ + 'argument' => '-a', + 'description' => 'Run in interactive mode, pausing after each file.', + ], + 'bootstrap' => [ + 'argument' => '--bootstrap=', + 'description' => 'Run the specified file(s) before processing begins. A list of files can be provided, separated by commas.', + ], + 'cache' => [ + 'argument' => '--cache[=]', + 'description' => 'Cache results between runs. Optionally, can be provided to use a specific file for caching. Otherwise, a temporary file is used.', + ], + 'no-cache' => [ + 'argument' => '--no-cache', + 'description' => 'Do not cache results between runs (default).', + ], + 'parallel' => [ + 'argument' => '--parallel=', + 'description' => 'The number of files to be checked simultaneously. Defaults to 1 (no parallel processing).'."\n" + .'If enabled, this option only takes effect if the PHP PCNTL (Process Control) extension is available.', + ], + 'suffix' => [ + 'argument' => '--suffix=', + 'description' => 'Write modified files to a filename using this suffix ("diff" and "patch" are not used in this mode).', + ], + 'blank-line' => ['spacer' => ''], + + 'php-ini' => [ + 'argument' => '-d ', + 'description' => 'Set the [key] php.ini value to [value] or set to [true] if value is omitted.'."\n" + .'Note: only php.ini settings which can be changed at runtime are supported.', + ], + ]; + + $options['Reporting Options'] = [ + 'report' => [ + 'argument' => '--report=', + 'description' => 'Print either the "full", "xml", "checkstyle", "csv", "json", "junit", "emacs", "source", "summary", "diff", "svnblame", "gitblame", "hgblame", "notifysend" or "performance" report or specify the path to a custom report class. By default, the "full" report is displayed.', + ], + 'report-file' => [ + 'argument' => '--report-file=', + 'description' => 'Write the report to the specified file path.', + ], + 'report-report' => [ + 'argument' => '--report-=', + 'description' => 'Write the report specified in to the specified file path.', + ], + 'report-width' => [ + 'argument' => '--report-width=', + 'description' => 'How many columns wide screen reports should be. Set to "auto" to use current screen width, where supported.', + ], + 'basepath' => [ + 'argument' => '--basepath=', + 'description' => 'Strip a path from the front of file paths inside reports.', + ], + 'blank-line-1' => ['spacer' => ''], + + 'w' => [ + 'argument' => '-w', + 'description' => 'Include both warnings and errors (default).', + ], + 'n' => [ + 'argument' => '-n', + 'description' => 'Do not include warnings. Shortcut for "--warning-severity=0".', + ], + 'severity' => [ + 'argument' => '--severity=', + 'description' => 'The minimum severity required to display an error or warning. Defaults to 5.', + ], + 'error-severity' => [ + 'argument' => '--error-severity=', + 'description' => 'The minimum severity required to display an error. Defaults to 5.', + ], + 'warning-severity' => [ + 'argument' => '--warning-severity=', + 'description' => 'The minimum severity required to display a warning. Defaults to 5.', + ], + 'blank-line-2' => ['spacer' => ''], + + 's' => [ + 'argument' => '-s', + 'description' => 'Show sniff error codes in all reports.', + ], + 'ignore-annotations' => [ + 'argument' => '--ignore-annotations', + 'description' => 'Ignore all "phpcs:..." annotations in code comments.', + ], + 'colors' => [ + 'argument' => '--colors', + 'description' => 'Use colors in screen output.', + ], + 'no-colors' => [ + 'argument' => '--no-colors', + 'description' => 'Do not use colors in screen output (default).', + ], + 'p' => [ + 'argument' => '-p', + 'description' => 'Show progress of the run.', + ], + 'q' => [ + 'argument' => '-q', + 'description' => 'Quiet mode; disables progress and verbose output.', + ], + 'm' => [ + 'argument' => '-m', + 'description' => 'Stop error messages from being recorded. This saves a lot of memory but stops many reports from being used.', + ], + ]; + + $options['Configuration Options'] = [ + 'encoding' => [ + 'argument' => '--encoding=', + 'description' => 'The encoding of the files being checked. Defaults to "utf-8".', + ], + 'tab-width' => [ + 'argument' => '--tab-width=', + 'description' => 'The number of spaces each tab represents.', + ], + 'blank-line' => ['spacer' => ''], + + 'config-explain' => [ + 'text' => 'Default values for a selection of options can be stored in a user-specific CodeSniffer.conf configuration file.'."\n" + .'This applies to the following options: "default_standard", "report_format", "tab_width", "encoding", "severity", "error_severity", "warning_severity", "show_warnings", "report_width", "show_progress", "quiet", "colors", "cache", "parallel".', + ], + 'config-show' => [ + 'argument' => '--config-show', + 'description' => 'Show the configuration options which are currently stored in the applicable CodeSniffer.conf file.', + ], + 'config-set' => [ + 'argument' => '--config-set ', + 'description' => 'Save a configuration option to the CodeSniffer.conf file.', + ], + 'config-delete' => [ + 'argument' => '--config-delete ', + 'description' => 'Delete a configuration option from the CodeSniffer.conf file.', + ], + 'runtime-set' => [ + 'argument' => '--runtime-set ', + 'description' => 'Set a configuration option to be applied to the current scan run only.', + ], + ]; + + $options['Miscellaneous Options'] = [ + 'h' => [ + 'argument' => '-h, -?, --help', + 'description' => 'Print this help message.', + ], + 'version' => [ + 'argument' => '--version', + 'description' => 'Print version information.', + ], + 'v' => [ + 'argument' => '-v', + 'description' => 'Verbose output: Print processed files.', + ], + 'vv' => [ + 'argument' => '-vv', + 'description' => 'Verbose output: Print ruleset and token output.', + ], + 'vvv' => [ + 'argument' => '-vvv', + 'description' => 'Verbose output: Print sniff processing information.', + ], + ]; + // phpcs:enable + + return $options; + + }//end getAllOptions() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Standards.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Standards.php new file mode 100644 index 00000000..f7217a72 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Standards.php @@ -0,0 +1,340 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Util; + +use DirectoryIterator; +use PHP_CodeSniffer\Config; + +class Standards +{ + + + /** + * Get a list of paths where standards are installed. + * + * Unresolvable relative paths will be excluded from the results. + * + * @return array + */ + public static function getInstalledStandardPaths() + { + $ds = DIRECTORY_SEPARATOR; + + $installedPaths = [dirname(dirname(__DIR__)).$ds.'src'.$ds.'Standards']; + $configPaths = Config::getConfigData('installed_paths'); + if ($configPaths !== null) { + $installedPaths = array_merge($installedPaths, explode(',', $configPaths)); + } + + $resolvedInstalledPaths = []; + foreach ($installedPaths as $installedPath) { + if (substr($installedPath, 0, 1) === '.') { + $installedPath = Common::realPath(__DIR__.$ds.'..'.$ds.'..'.$ds.$installedPath); + if ($installedPath === false) { + continue; + } + } + + $resolvedInstalledPaths[] = $installedPath; + } + + return $resolvedInstalledPaths; + + }//end getInstalledStandardPaths() + + + /** + * Get the details of all coding standards installed. + * + * Coding standards are directories located in the + * CodeSniffer/Standards directory. Valid coding standards + * include a Sniffs subdirectory. + * + * The details returned for each standard are: + * - path: the path to the coding standard's main directory + * - name: the name of the coding standard, as sourced from the ruleset.xml file + * - namespace: the namespace used by the coding standard, as sourced from the ruleset.xml file + * + * If you only need the paths to the installed standards, + * use getInstalledStandardPaths() instead as it performs less work to + * retrieve coding standard names. + * + * @param boolean $includeGeneric If true, the special "Generic" + * coding standard will be included + * if installed. + * @param string $standardsDir A specific directory to look for standards + * in. If not specified, PHP_CodeSniffer will + * look in its default locations. + * + * @return array + * @see getInstalledStandardPaths() + */ + public static function getInstalledStandardDetails( + $includeGeneric=false, + $standardsDir='' + ) { + $rulesets = []; + + if ($standardsDir === '') { + $installedPaths = self::getInstalledStandardPaths(); + } else { + $installedPaths = [$standardsDir]; + } + + foreach ($installedPaths as $standardsDir) { + // Check if the installed dir is actually a standard itself. + $csFile = $standardsDir.'/ruleset.xml'; + if (is_file($csFile) === true) { + $rulesets[] = $csFile; + continue; + } + + if (is_dir($standardsDir) === false) { + continue; + } + + $di = new DirectoryIterator($standardsDir); + foreach ($di as $file) { + if ($file->isDir() === true && $file->isDot() === false) { + $filename = $file->getFilename(); + + // Ignore the special "Generic" standard. + if ($includeGeneric === false && $filename === 'Generic') { + continue; + } + + // Valid coding standard dirs include a ruleset. + $csFile = $file->getPathname().'/ruleset.xml'; + if (is_file($csFile) === true) { + $rulesets[] = $csFile; + } + } + } + }//end foreach + + $installedStandards = []; + + foreach ($rulesets as $rulesetPath) { + $ruleset = @simplexml_load_string(file_get_contents($rulesetPath)); + if ($ruleset === false) { + continue; + } + + $standardName = (string) $ruleset['name']; + $dirname = basename(dirname($rulesetPath)); + + if (isset($ruleset['namespace']) === true) { + $namespace = (string) $ruleset['namespace']; + } else { + $namespace = $dirname; + } + + $installedStandards[$dirname] = [ + 'path' => dirname($rulesetPath), + 'name' => $standardName, + 'namespace' => $namespace, + ]; + }//end foreach + + return $installedStandards; + + }//end getInstalledStandardDetails() + + + /** + * Get a list of all coding standards installed. + * + * Coding standards are directories located in the + * CodeSniffer/Standards directory. Valid coding standards + * include a Sniffs subdirectory. + * + * @param boolean $includeGeneric If true, the special "Generic" + * coding standard will be included + * if installed. + * @param string $standardsDir A specific directory to look for standards + * in. If not specified, PHP_CodeSniffer will + * look in its default locations. + * + * @return array + * @see isInstalledStandard() + */ + public static function getInstalledStandards( + $includeGeneric=false, + $standardsDir='' + ) { + $installedStandards = []; + + if ($standardsDir === '') { + $installedPaths = self::getInstalledStandardPaths(); + } else { + $installedPaths = [$standardsDir]; + } + + foreach ($installedPaths as $standardsDir) { + // Check if the installed dir is actually a standard itself. + $csFile = $standardsDir.'/ruleset.xml'; + if (is_file($csFile) === true) { + $basename = basename($standardsDir); + $installedStandards[$basename] = $basename; + continue; + } + + if (is_dir($standardsDir) === false) { + // Doesn't exist. + continue; + } + + $di = new DirectoryIterator($standardsDir); + $standardsInDir = []; + foreach ($di as $file) { + if ($file->isDir() === true && $file->isDot() === false) { + $filename = $file->getFilename(); + + // Ignore the special "Generic" standard. + if ($includeGeneric === false && $filename === 'Generic') { + continue; + } + + // Valid coding standard dirs include a ruleset. + $csFile = $file->getPathname().'/ruleset.xml'; + if (is_file($csFile) === true) { + $standardsInDir[$filename] = $filename; + } + } + } + + natsort($standardsInDir); + $installedStandards += $standardsInDir; + }//end foreach + + return $installedStandards; + + }//end getInstalledStandards() + + + /** + * Determine if a standard is installed. + * + * Coding standards are directories located in the + * CodeSniffer/Standards directory. Valid coding standards + * include a ruleset.xml file. + * + * @param string $standard The name of the coding standard. + * + * @return boolean + * @see getInstalledStandards() + */ + public static function isInstalledStandard($standard) + { + $path = self::getInstalledStandardPath($standard); + if ($path !== null && strpos($path, 'ruleset.xml') !== false) { + return true; + } else { + // This could be a custom standard, installed outside our + // standards directory. + $standard = Common::realPath($standard); + if ($standard === false) { + return false; + } + + // Might be an actual ruleset file itUtil. + // If it has an XML extension, let's at least try it. + if (is_file($standard) === true + && (substr(strtolower($standard), -4) === '.xml' + || substr(strtolower($standard), -9) === '.xml.dist') + ) { + return true; + } + + // If it is a directory with a ruleset.xml file in it, + // it is a standard. + $ruleset = rtrim($standard, ' /\\').DIRECTORY_SEPARATOR.'ruleset.xml'; + if (is_file($ruleset) === true) { + return true; + } + }//end if + + return false; + + }//end isInstalledStandard() + + + /** + * Return the path of an installed coding standard. + * + * Coding standards are directories located in the + * CodeSniffer/Standards directory. Valid coding standards + * include a ruleset.xml file. + * + * @param string $standard The name of the coding standard. + * + * @return string|null + */ + public static function getInstalledStandardPath($standard) + { + if (strpos($standard, '.') !== false) { + return null; + } + + $installedPaths = self::getInstalledStandardPaths(); + foreach ($installedPaths as $installedPath) { + $standardPath = $installedPath.DIRECTORY_SEPARATOR.$standard; + if (file_exists($standardPath) === false) { + if (basename($installedPath) !== $standard) { + continue; + } + + $standardPath = $installedPath; + } + + $path = Common::realpath($standardPath.DIRECTORY_SEPARATOR.'ruleset.xml'); + + if ($path !== false && is_file($path) === true) { + return $path; + } else if (Common::isPharFile($standardPath) === true) { + $path = Common::realpath($standardPath); + if ($path !== false) { + return $path; + } + } + }//end foreach + + return null; + + }//end getInstalledStandardPath() + + + /** + * Prints out a list of installed coding standards. + * + * @return void + */ + public static function printInstalledStandards() + { + $installedStandards = self::getInstalledStandards(); + $numStandards = count($installedStandards); + + if ($numStandards === 0) { + echo 'No coding standards are installed.'.PHP_EOL; + } else { + $lastStandard = array_pop($installedStandards); + if ($numStandards === 1) { + echo "The only coding standard installed is $lastStandard".PHP_EOL; + } else { + $standardList = implode(', ', $installedStandards); + $standardList .= ' and '.$lastStandard; + echo 'The installed coding standards are '.$standardList.PHP_EOL; + } + } + + }//end printInstalledStandards() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Timing.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Timing.php new file mode 100644 index 00000000..57470c77 --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Timing.php @@ -0,0 +1,119 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Util; + +class Timing +{ + + /** + * The start time of the run. + * + * @var float + */ + private static $startTime; + + /** + * Used to make sure we only print the run time once per run. + * + * @var boolean + */ + private static $printed = false; + + + /** + * Start recording time for the run. + * + * @return void + */ + public static function startTiming() + { + + self::$startTime = microtime(true); + + }//end startTiming() + + + /** + * Get the duration of the run up to "now". + * + * @return float 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 float $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. + * + * @param boolean $force If TRUE, prints the output even if it has + * already been printed during the run. + * + * @return void + */ + public static function printRunTime($force=false) + { + if ($force === false && self::$printed === true) { + // A double call. + return; + } + + if (self::$startTime === null) { + // Timing was never started. + return; + } + + $duration = self::getDuration(); + $duration = self::getHumanReadableDuration($duration); + + $mem = round((memory_get_peak_usage(true) / (1024 * 1024)), 2).'MB'; + echo "Time: $duration; Memory: $mem".PHP_EOL.PHP_EOL; + + self::$printed = true; + + }//end printRunTime() + + +}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php new file mode 100644 index 00000000..5ec913df --- /dev/null +++ b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php @@ -0,0 +1,812 @@ + + * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Util; + +define('T_NONE', 'PHPCS_T_NONE'); +define('T_OPEN_CURLY_BRACKET', 'PHPCS_T_OPEN_CURLY_BRACKET'); +define('T_CLOSE_CURLY_BRACKET', 'PHPCS_T_CLOSE_CURLY_BRACKET'); +define('T_OPEN_SQUARE_BRACKET', 'PHPCS_T_OPEN_SQUARE_BRACKET'); +define('T_CLOSE_SQUARE_BRACKET', 'PHPCS_T_CLOSE_SQUARE_BRACKET'); +define('T_OPEN_PARENTHESIS', 'PHPCS_T_OPEN_PARENTHESIS'); +define('T_CLOSE_PARENTHESIS', 'PHPCS_T_CLOSE_PARENTHESIS'); +define('T_COLON', 'PHPCS_T_COLON'); +define('T_NULLABLE', 'PHPCS_T_NULLABLE'); +define('T_STRING_CONCAT', 'PHPCS_T_STRING_CONCAT'); +define('T_INLINE_THEN', 'PHPCS_T_INLINE_THEN'); +define('T_INLINE_ELSE', 'PHPCS_T_INLINE_ELSE'); +define('T_NULL', 'PHPCS_T_NULL'); +define('T_FALSE', 'PHPCS_T_FALSE'); +define('T_TRUE', 'PHPCS_T_TRUE'); +define('T_SEMICOLON', 'PHPCS_T_SEMICOLON'); +define('T_EQUAL', 'PHPCS_T_EQUAL'); +define('T_MULTIPLY', 'PHPCS_T_MULTIPLY'); +define('T_DIVIDE', 'PHPCS_T_DIVIDE'); +define('T_PLUS', 'PHPCS_T_PLUS'); +define('T_MINUS', 'PHPCS_T_MINUS'); +define('T_MODULUS', 'PHPCS_T_MODULUS'); +define('T_BITWISE_AND', 'PHPCS_T_BITWISE_AND'); +define('T_BITWISE_OR', 'PHPCS_T_BITWISE_OR'); +define('T_BITWISE_XOR', 'PHPCS_T_BITWISE_XOR'); +define('T_BITWISE_NOT', 'PHPCS_T_BITWISE_NOT'); +define('T_ARRAY_HINT', 'PHPCS_T_ARRAY_HINT'); +define('T_GREATER_THAN', 'PHPCS_T_GREATER_THAN'); +define('T_LESS_THAN', 'PHPCS_T_LESS_THAN'); +define('T_BOOLEAN_NOT', 'PHPCS_T_BOOLEAN_NOT'); +define('T_SELF', 'PHPCS_T_SELF'); +define('T_PARENT', 'PHPCS_T_PARENT'); +define('T_DOUBLE_QUOTED_STRING', 'PHPCS_T_DOUBLE_QUOTED_STRING'); +define('T_COMMA', 'PHPCS_T_COMMA'); +define('T_HEREDOC', 'PHPCS_T_HEREDOC'); +define('T_PROTOTYPE', 'PHPCS_T_PROTOTYPE'); +define('T_THIS', 'PHPCS_T_THIS'); +define('T_REGULAR_EXPRESSION', 'PHPCS_T_REGULAR_EXPRESSION'); +define('T_PROPERTY', 'PHPCS_T_PROPERTY'); +define('T_LABEL', 'PHPCS_T_LABEL'); +define('T_OBJECT', 'PHPCS_T_OBJECT'); +define('T_CLOSE_OBJECT', 'PHPCS_T_CLOSE_OBJECT'); +define('T_COLOUR', 'PHPCS_T_COLOUR'); +define('T_HASH', 'PHPCS_T_HASH'); +define('T_URL', 'PHPCS_T_URL'); +define('T_STYLE', 'PHPCS_T_STYLE'); +define('T_ASPERAND', 'PHPCS_T_ASPERAND'); +define('T_DOLLAR', 'PHPCS_T_DOLLAR'); +define('T_TYPEOF', 'PHPCS_T_TYPEOF'); +define('T_CLOSURE', 'PHPCS_T_CLOSURE'); +define('T_ANON_CLASS', 'PHPCS_T_ANON_CLASS'); +define('T_BACKTICK', 'PHPCS_T_BACKTICK'); +define('T_START_NOWDOC', 'PHPCS_T_START_NOWDOC'); +define('T_NOWDOC', 'PHPCS_T_NOWDOC'); +define('T_END_NOWDOC', 'PHPCS_T_END_NOWDOC'); +define('T_OPEN_SHORT_ARRAY', 'PHPCS_T_OPEN_SHORT_ARRAY'); +define('T_CLOSE_SHORT_ARRAY', 'PHPCS_T_CLOSE_SHORT_ARRAY'); +define('T_GOTO_LABEL', 'PHPCS_T_GOTO_LABEL'); +define('T_BINARY_CAST', 'PHPCS_T_BINARY_CAST'); +define('T_EMBEDDED_PHP', 'PHPCS_T_EMBEDDED_PHP'); +define('T_RETURN_TYPE', 'PHPCS_T_RETURN_TYPE'); +define('T_OPEN_USE_GROUP', 'PHPCS_T_OPEN_USE_GROUP'); +define('T_CLOSE_USE_GROUP', 'PHPCS_T_CLOSE_USE_GROUP'); +define('T_ZSR', 'PHPCS_T_ZSR'); +define('T_ZSR_EQUAL', 'PHPCS_T_ZSR_EQUAL'); +define('T_FN_ARROW', 'PHPCS_T_FN_ARROW'); +define('T_TYPE_UNION', 'PHPCS_T_TYPE_UNION'); +define('T_PARAM_NAME', 'PHPCS_T_PARAM_NAME'); +define('T_MATCH_ARROW', 'PHPCS_T_MATCH_ARROW'); +define('T_MATCH_DEFAULT', 'PHPCS_T_MATCH_DEFAULT'); +define('T_ATTRIBUTE_END', 'PHPCS_T_ATTRIBUTE_END'); +define('T_ENUM_CASE', 'PHPCS_T_ENUM_CASE'); +define('T_TYPE_INTERSECTION', 'PHPCS_T_TYPE_INTERSECTION'); +define('T_TYPE_OPEN_PARENTHESIS', 'PHPCS_T_TYPE_OPEN_PARENTHESIS'); +define('T_TYPE_CLOSE_PARENTHESIS', 'PHPCS_T_TYPE_CLOSE_PARENTHESIS'); + +// Some PHP 5.5 tokens, replicated for lower versions. +if (defined('T_FINALLY') === false) { + define('T_FINALLY', 'PHPCS_T_FINALLY'); +} + +if (defined('T_YIELD') === false) { + define('T_YIELD', 'PHPCS_T_YIELD'); +} + +// Some PHP 5.6 tokens, replicated for lower versions. +if (defined('T_ELLIPSIS') === false) { + define('T_ELLIPSIS', 'PHPCS_T_ELLIPSIS'); +} + +if (defined('T_POW') === false) { + define('T_POW', 'PHPCS_T_POW'); +} + +if (defined('T_POW_EQUAL') === false) { + define('T_POW_EQUAL', 'PHPCS_T_POW_EQUAL'); +} + +// Some PHP 7 tokens, replicated for lower versions. +if (defined('T_SPACESHIP') === false) { + define('T_SPACESHIP', 'PHPCS_T_SPACESHIP'); +} + +if (defined('T_COALESCE') === false) { + define('T_COALESCE', 'PHPCS_T_COALESCE'); +} + +if (defined('T_COALESCE_EQUAL') === false) { + define('T_COALESCE_EQUAL', 'PHPCS_T_COALESCE_EQUAL'); +} + +if (defined('T_YIELD_FROM') === false) { + define('T_YIELD_FROM', 'PHPCS_T_YIELD_FROM'); +} + +// Some PHP 7.4 tokens, replicated for lower versions. +if (defined('T_BAD_CHARACTER') === false) { + define('T_BAD_CHARACTER', 'PHPCS_T_BAD_CHARACTER'); +} + +if (defined('T_FN') === false) { + define('T_FN', 'PHPCS_T_FN'); +} + +// Some PHP 8.0 tokens, replicated for lower versions. +if (defined('T_NULLSAFE_OBJECT_OPERATOR') === false) { + define('T_NULLSAFE_OBJECT_OPERATOR', 'PHPCS_T_NULLSAFE_OBJECT_OPERATOR'); +} + +if (defined('T_NAME_QUALIFIED') === false) { + define('T_NAME_QUALIFIED', 'PHPCS_T_NAME_QUALIFIED'); +} + +if (defined('T_NAME_FULLY_QUALIFIED') === false) { + define('T_NAME_FULLY_QUALIFIED', 'PHPCS_T_NAME_FULLY_QUALIFIED'); +} + +if (defined('T_NAME_RELATIVE') === false) { + define('T_NAME_RELATIVE', 'PHPCS_T_NAME_RELATIVE'); +} + +if (defined('T_MATCH') === false) { + define('T_MATCH', 'PHPCS_T_MATCH'); +} + +if (defined('T_ATTRIBUTE') === false) { + define('T_ATTRIBUTE', 'PHPCS_T_ATTRIBUTE'); +} + +// Some PHP 8.1 tokens, replicated for lower versions. +if (defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG') === false) { + define('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', 'PHPCS_T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG'); +} + +if (defined('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG') === false) { + define('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', 'PHPCS_T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG'); +} + +if (defined('T_READONLY') === false) { + define('T_READONLY', 'PHPCS_T_READONLY'); +} + +if (defined('T_ENUM') === false) { + define('T_ENUM', 'PHPCS_T_ENUM'); +} + +// Tokens used for parsing doc blocks. +define('T_DOC_COMMENT_STAR', 'PHPCS_T_DOC_COMMENT_STAR'); +define('T_DOC_COMMENT_WHITESPACE', 'PHPCS_T_DOC_COMMENT_WHITESPACE'); +define('T_DOC_COMMENT_TAG', 'PHPCS_T_DOC_COMMENT_TAG'); +define('T_DOC_COMMENT_OPEN_TAG', 'PHPCS_T_DOC_COMMENT_OPEN_TAG'); +define('T_DOC_COMMENT_CLOSE_TAG', 'PHPCS_T_DOC_COMMENT_CLOSE_TAG'); +define('T_DOC_COMMENT_STRING', 'PHPCS_T_DOC_COMMENT_STRING'); + +// Tokens used for PHPCS instruction comments. +define('T_PHPCS_ENABLE', 'PHPCS_T_PHPCS_ENABLE'); +define('T_PHPCS_DISABLE', 'PHPCS_T_PHPCS_DISABLE'); +define('T_PHPCS_SET', 'PHPCS_T_PHPCS_SET'); +define('T_PHPCS_IGNORE', 'PHPCS_T_PHPCS_IGNORE'); +define('T_PHPCS_IGNORE_FILE', 'PHPCS_T_PHPCS_IGNORE_FILE'); + +final class Tokens +{ + + /** + * The token weightings. + * + * @var array + */ + public static $weightings = [ + T_CLASS => 1000, + T_INTERFACE => 1000, + T_TRAIT => 1000, + T_ENUM => 1000, + T_NAMESPACE => 1000, + T_FUNCTION => 100, + T_CLOSURE => 100, + + /* + * Conditions. + */ + + T_WHILE => 50, + T_FOR => 50, + T_FOREACH => 50, + T_IF => 50, + T_ELSE => 50, + T_ELSEIF => 50, + T_DO => 50, + T_TRY => 50, + T_CATCH => 50, + T_FINALLY => 50, + T_SWITCH => 50, + T_MATCH => 50, + + T_SELF => 25, + T_PARENT => 25, + + /* + * Operators and arithmetic. + */ + + T_BITWISE_AND => 8, + T_BITWISE_OR => 8, + T_BITWISE_XOR => 8, + + T_MULTIPLY => 5, + T_DIVIDE => 5, + T_PLUS => 5, + T_MINUS => 5, + T_MODULUS => 5, + T_POW => 5, + T_SPACESHIP => 5, + T_COALESCE => 5, + T_COALESCE_EQUAL => 5, + + T_SL => 5, + T_SR => 5, + T_SL_EQUAL => 5, + T_SR_EQUAL => 5, + + T_EQUAL => 5, + T_AND_EQUAL => 5, + T_CONCAT_EQUAL => 5, + T_DIV_EQUAL => 5, + T_MINUS_EQUAL => 5, + T_MOD_EQUAL => 5, + T_MUL_EQUAL => 5, + T_OR_EQUAL => 5, + T_PLUS_EQUAL => 5, + T_XOR_EQUAL => 5, + + T_BOOLEAN_AND => 5, + T_BOOLEAN_OR => 5, + + /* + * Equality. + */ + + T_IS_EQUAL => 5, + T_IS_NOT_EQUAL => 5, + T_IS_IDENTICAL => 5, + T_IS_NOT_IDENTICAL => 5, + T_IS_SMALLER_OR_EQUAL => 5, + T_IS_GREATER_OR_EQUAL => 5, + ]; + + /** + * Tokens that represent assignments. + * + * @var array + */ + public static $assignmentTokens = [ + T_EQUAL => T_EQUAL, + T_AND_EQUAL => T_AND_EQUAL, + T_OR_EQUAL => T_OR_EQUAL, + T_CONCAT_EQUAL => T_CONCAT_EQUAL, + T_DIV_EQUAL => T_DIV_EQUAL, + T_MINUS_EQUAL => T_MINUS_EQUAL, + T_POW_EQUAL => T_POW_EQUAL, + T_MOD_EQUAL => T_MOD_EQUAL, + T_MUL_EQUAL => T_MUL_EQUAL, + T_PLUS_EQUAL => T_PLUS_EQUAL, + T_XOR_EQUAL => T_XOR_EQUAL, + T_DOUBLE_ARROW => T_DOUBLE_ARROW, + T_SL_EQUAL => T_SL_EQUAL, + T_SR_EQUAL => T_SR_EQUAL, + T_COALESCE_EQUAL => T_COALESCE_EQUAL, + T_ZSR_EQUAL => T_ZSR_EQUAL, + ]; + + /** + * Tokens that represent equality comparisons. + * + * @var array + */ + public static $equalityTokens = [ + T_IS_EQUAL => T_IS_EQUAL, + T_IS_NOT_EQUAL => T_IS_NOT_EQUAL, + T_IS_IDENTICAL => T_IS_IDENTICAL, + T_IS_NOT_IDENTICAL => T_IS_NOT_IDENTICAL, + T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL, + T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL, + ]; + + /** + * Tokens that represent comparison operator. + * + * @var array + */ + public static $comparisonTokens = [ + T_IS_EQUAL => T_IS_EQUAL, + T_IS_IDENTICAL => T_IS_IDENTICAL, + T_IS_NOT_EQUAL => T_IS_NOT_EQUAL, + T_IS_NOT_IDENTICAL => T_IS_NOT_IDENTICAL, + T_LESS_THAN => T_LESS_THAN, + T_GREATER_THAN => T_GREATER_THAN, + T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL, + T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL, + T_SPACESHIP => T_SPACESHIP, + T_COALESCE => T_COALESCE, + ]; + + /** + * Tokens that represent arithmetic operators. + * + * @var array + */ + public static $arithmeticTokens = [ + T_PLUS => T_PLUS, + T_MINUS => T_MINUS, + T_MULTIPLY => T_MULTIPLY, + T_DIVIDE => T_DIVIDE, + T_MODULUS => T_MODULUS, + T_POW => T_POW, + ]; + + /** + * Tokens that perform operations. + * + * @var array + */ + public static $operators = [ + T_MINUS => T_MINUS, + T_PLUS => T_PLUS, + T_MULTIPLY => T_MULTIPLY, + T_DIVIDE => T_DIVIDE, + T_MODULUS => T_MODULUS, + T_POW => T_POW, + T_SPACESHIP => T_SPACESHIP, + T_COALESCE => T_COALESCE, + T_BITWISE_AND => T_BITWISE_AND, + T_BITWISE_OR => T_BITWISE_OR, + T_BITWISE_XOR => T_BITWISE_XOR, + T_SL => T_SL, + T_SR => T_SR, + ]; + + /** + * Tokens that perform boolean operations. + * + * @var array + */ + public static $booleanOperators = [ + T_BOOLEAN_AND => T_BOOLEAN_AND, + T_BOOLEAN_OR => T_BOOLEAN_OR, + T_LOGICAL_AND => T_LOGICAL_AND, + T_LOGICAL_OR => T_LOGICAL_OR, + T_LOGICAL_XOR => T_LOGICAL_XOR, + ]; + + /** + * Tokens that represent casting. + * + * @var array + */ + public static $castTokens = [ + T_INT_CAST => T_INT_CAST, + T_STRING_CAST => T_STRING_CAST, + T_DOUBLE_CAST => T_DOUBLE_CAST, + T_ARRAY_CAST => T_ARRAY_CAST, + T_BOOL_CAST => T_BOOL_CAST, + T_OBJECT_CAST => T_OBJECT_CAST, + T_UNSET_CAST => T_UNSET_CAST, + T_BINARY_CAST => T_BINARY_CAST, + ]; + + /** + * Token types that open parenthesis. + * + * @var array + */ + public static $parenthesisOpeners = [ + T_ARRAY => T_ARRAY, + T_LIST => T_LIST, + T_FUNCTION => T_FUNCTION, + T_CLOSURE => T_CLOSURE, + T_ANON_CLASS => T_ANON_CLASS, + T_WHILE => T_WHILE, + T_FOR => T_FOR, + T_FOREACH => T_FOREACH, + T_SWITCH => T_SWITCH, + T_IF => T_IF, + T_ELSEIF => T_ELSEIF, + T_CATCH => T_CATCH, + T_DECLARE => T_DECLARE, + T_MATCH => T_MATCH, + ]; + + /** + * Tokens that are allowed to open scopes. + * + * @var array + */ + public static $scopeOpeners = [ + T_CLASS => T_CLASS, + T_ANON_CLASS => T_ANON_CLASS, + T_INTERFACE => T_INTERFACE, + T_TRAIT => T_TRAIT, + T_ENUM => T_ENUM, + T_NAMESPACE => T_NAMESPACE, + T_FUNCTION => T_FUNCTION, + T_CLOSURE => T_CLOSURE, + T_IF => T_IF, + T_SWITCH => T_SWITCH, + T_CASE => T_CASE, + T_DECLARE => T_DECLARE, + T_DEFAULT => T_DEFAULT, + T_WHILE => T_WHILE, + T_ELSE => T_ELSE, + T_ELSEIF => T_ELSEIF, + T_FOR => T_FOR, + T_FOREACH => T_FOREACH, + T_DO => T_DO, + T_TRY => T_TRY, + T_CATCH => T_CATCH, + T_FINALLY => T_FINALLY, + T_PROPERTY => T_PROPERTY, + T_OBJECT => T_OBJECT, + T_USE => T_USE, + T_MATCH => T_MATCH, + ]; + + /** + * Tokens that represent scope modifiers. + * + * @var array + */ + public static $scopeModifiers = [ + T_PRIVATE => T_PRIVATE, + T_PUBLIC => T_PUBLIC, + T_PROTECTED => T_PROTECTED, + ]; + + /** + * Tokens that can prefix a method name + * + * @var array + */ + public static $methodPrefixes = [ + T_PRIVATE => T_PRIVATE, + T_PUBLIC => T_PUBLIC, + T_PROTECTED => T_PROTECTED, + T_ABSTRACT => T_ABSTRACT, + T_STATIC => T_STATIC, + T_FINAL => T_FINAL, + ]; + + /** + * Tokens that open code blocks. + * + * @var array + */ + public static $blockOpeners = [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, + T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, + T_OBJECT => T_OBJECT, + ]; + + /** + * Tokens that don't represent code. + * + * @var array + */ + public static $emptyTokens = [ + T_WHITESPACE => T_WHITESPACE, + T_COMMENT => T_COMMENT, + T_DOC_COMMENT => T_DOC_COMMENT, + T_DOC_COMMENT_STAR => T_DOC_COMMENT_STAR, + T_DOC_COMMENT_WHITESPACE => T_DOC_COMMENT_WHITESPACE, + T_DOC_COMMENT_TAG => T_DOC_COMMENT_TAG, + T_DOC_COMMENT_OPEN_TAG => T_DOC_COMMENT_OPEN_TAG, + T_DOC_COMMENT_CLOSE_TAG => T_DOC_COMMENT_CLOSE_TAG, + T_DOC_COMMENT_STRING => T_DOC_COMMENT_STRING, + T_PHPCS_ENABLE => T_PHPCS_ENABLE, + T_PHPCS_DISABLE => T_PHPCS_DISABLE, + T_PHPCS_SET => T_PHPCS_SET, + T_PHPCS_IGNORE => T_PHPCS_IGNORE, + T_PHPCS_IGNORE_FILE => T_PHPCS_IGNORE_FILE, + ]; + + /** + * Tokens that are comments. + * + * @var array + */ + public static $commentTokens = [ + T_COMMENT => T_COMMENT, + T_DOC_COMMENT => T_DOC_COMMENT, + T_DOC_COMMENT_STAR => T_DOC_COMMENT_STAR, + T_DOC_COMMENT_WHITESPACE => T_DOC_COMMENT_WHITESPACE, + T_DOC_COMMENT_TAG => T_DOC_COMMENT_TAG, + T_DOC_COMMENT_OPEN_TAG => T_DOC_COMMENT_OPEN_TAG, + T_DOC_COMMENT_CLOSE_TAG => T_DOC_COMMENT_CLOSE_TAG, + T_DOC_COMMENT_STRING => T_DOC_COMMENT_STRING, + T_PHPCS_ENABLE => T_PHPCS_ENABLE, + T_PHPCS_DISABLE => T_PHPCS_DISABLE, + T_PHPCS_SET => T_PHPCS_SET, + T_PHPCS_IGNORE => T_PHPCS_IGNORE, + T_PHPCS_IGNORE_FILE => T_PHPCS_IGNORE_FILE, + ]; + + /** + * Tokens that are comments containing PHPCS instructions. + * + * @var array + */ + public static $phpcsCommentTokens = [ + T_PHPCS_ENABLE => T_PHPCS_ENABLE, + T_PHPCS_DISABLE => T_PHPCS_DISABLE, + T_PHPCS_SET => T_PHPCS_SET, + T_PHPCS_IGNORE => T_PHPCS_IGNORE, + T_PHPCS_IGNORE_FILE => T_PHPCS_IGNORE_FILE, + ]; + + /** + * Tokens that represent strings. + * + * Note that T_STRINGS are NOT represented in this list. + * + * @var array + */ + public static $stringTokens = [ + T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, + T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, + ]; + + /** + * Tokens that represent text strings. + * + * @var array + */ + public static $textStringTokens = [ + T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, + T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, + T_INLINE_HTML => T_INLINE_HTML, + T_HEREDOC => T_HEREDOC, + T_NOWDOC => T_NOWDOC, + ]; + + /** + * Tokens that represent brackets and parenthesis. + * + * @var array + */ + public static $bracketTokens = [ + T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, + T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, + T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, + T_CLOSE_SQUARE_BRACKET => T_CLOSE_SQUARE_BRACKET, + T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, + T_CLOSE_PARENTHESIS => T_CLOSE_PARENTHESIS, + ]; + + /** + * Tokens that include files. + * + * @var array + */ + public static $includeTokens = [ + T_REQUIRE_ONCE => T_REQUIRE_ONCE, + T_REQUIRE => T_REQUIRE, + T_INCLUDE_ONCE => T_INCLUDE_ONCE, + T_INCLUDE => T_INCLUDE, + ]; + + /** + * Tokens that make up a heredoc string. + * + * @var array + */ + public static $heredocTokens = [ + T_START_HEREDOC => T_START_HEREDOC, + T_END_HEREDOC => T_END_HEREDOC, + T_HEREDOC => T_HEREDOC, + T_START_NOWDOC => T_START_NOWDOC, + T_END_NOWDOC => T_END_NOWDOC, + T_NOWDOC => T_NOWDOC, + ]; + + /** + * Tokens that represent the names of called functions. + * + * Mostly, these are just strings. But PHP tokenizes some language + * constructs and functions using their own tokens. + * + * @var array + */ + public static $functionNameTokens = [ + T_STRING => T_STRING, + T_EVAL => T_EVAL, + T_EXIT => T_EXIT, + T_INCLUDE => T_INCLUDE, + T_INCLUDE_ONCE => T_INCLUDE_ONCE, + T_REQUIRE => T_REQUIRE, + T_REQUIRE_ONCE => T_REQUIRE_ONCE, + T_ISSET => T_ISSET, + T_UNSET => T_UNSET, + T_EMPTY => T_EMPTY, + T_SELF => T_SELF, + T_PARENT => T_PARENT, + T_STATIC => T_STATIC, + ]; + + /** + * Tokens that open class and object scopes. + * + * @var array + */ + public static $ooScopeTokens = [ + T_CLASS => T_CLASS, + T_ANON_CLASS => T_ANON_CLASS, + T_INTERFACE => T_INTERFACE, + T_TRAIT => T_TRAIT, + T_ENUM => T_ENUM, + ]; + + /** + * Tokens representing PHP magic constants. + * + * @var array => + * + * @link https://www.php.net/language.constants.predefined PHP Manual on magic constants + */ + public static $magicConstants = [ + T_CLASS_C => T_CLASS_C, + T_DIR => T_DIR, + T_FILE => T_FILE, + T_FUNC_C => T_FUNC_C, + T_LINE => T_LINE, + T_METHOD_C => T_METHOD_C, + T_NS_C => T_NS_C, + T_TRAIT_C => T_TRAIT_C, + ]; + + /** + * Tokens representing context sensitive keywords in PHP. + * + * @var array + * + * https://wiki.php.net/rfc/context_sensitive_lexer + */ + public static $contextSensitiveKeywords = [ + T_ABSTRACT => T_ABSTRACT, + T_ARRAY => T_ARRAY, + T_AS => T_AS, + T_BREAK => T_BREAK, + T_CALLABLE => T_CALLABLE, + T_CASE => T_CASE, + T_CATCH => T_CATCH, + T_CLASS => T_CLASS, + T_CLONE => T_CLONE, + T_CONST => T_CONST, + T_CONTINUE => T_CONTINUE, + T_DECLARE => T_DECLARE, + T_DEFAULT => T_DEFAULT, + T_DO => T_DO, + T_ECHO => T_ECHO, + T_ELSE => T_ELSE, + T_ELSEIF => T_ELSEIF, + T_EMPTY => T_EMPTY, + T_ENDDECLARE => T_ENDDECLARE, + T_ENDFOR => T_ENDFOR, + T_ENDFOREACH => T_ENDFOREACH, + T_ENDIF => T_ENDIF, + T_ENDSWITCH => T_ENDSWITCH, + T_ENDWHILE => T_ENDWHILE, + T_ENUM => T_ENUM, + T_EVAL => T_EVAL, + T_EXIT => T_EXIT, + T_EXTENDS => T_EXTENDS, + T_FINAL => T_FINAL, + T_FINALLY => T_FINALLY, + T_FN => T_FN, + T_FOR => T_FOR, + T_FOREACH => T_FOREACH, + T_FUNCTION => T_FUNCTION, + T_GLOBAL => T_GLOBAL, + T_GOTO => T_GOTO, + T_IF => T_IF, + T_IMPLEMENTS => T_IMPLEMENTS, + T_INCLUDE => T_INCLUDE, + T_INCLUDE_ONCE => T_INCLUDE_ONCE, + T_INSTANCEOF => T_INSTANCEOF, + T_INSTEADOF => T_INSTEADOF, + T_INTERFACE => T_INTERFACE, + T_ISSET => T_ISSET, + T_LIST => T_LIST, + T_LOGICAL_AND => T_LOGICAL_AND, + T_LOGICAL_OR => T_LOGICAL_OR, + T_LOGICAL_XOR => T_LOGICAL_XOR, + T_MATCH => T_MATCH, + T_NAMESPACE => T_NAMESPACE, + T_NEW => T_NEW, + T_PRINT => T_PRINT, + T_PRIVATE => T_PRIVATE, + T_PROTECTED => T_PROTECTED, + T_PUBLIC => T_PUBLIC, + T_READONLY => T_READONLY, + T_REQUIRE => T_REQUIRE, + T_REQUIRE_ONCE => T_REQUIRE_ONCE, + T_RETURN => T_RETURN, + T_STATIC => T_STATIC, + T_SWITCH => T_SWITCH, + T_THROW => T_THROW, + T_TRAIT => T_TRAIT, + T_TRY => T_TRY, + T_UNSET => T_UNSET, + T_USE => T_USE, + T_VAR => T_VAR, + T_WHILE => T_WHILE, + T_YIELD => T_YIELD, + T_YIELD_FROM => T_YIELD_FROM, + ]; + + + /** + * Given a token, returns the name of the token. + * + * If passed an integer, the token name is sourced from PHP's token_name() + * function. If passed a string, it is assumed to be a PHPCS-supplied token + * that begins with PHPCS_T_, so the name is sourced from the token value itself. + * + * @param int|string $token The token to get the name for. + * + * @return string + */ + public static function tokenName($token) + { + if (is_string($token) === false) { + // PHP-supplied token name. + return token_name($token); + } + + return substr($token, 6); + + }//end tokenName() + + + /** + * Returns the highest weighted token type. + * + * Tokens are weighted by their approximate frequency of appearance in code + * - the less frequently they appear in the code, the higher the weighting. + * For example T_CLASS tokens appear very infrequently in a file, and + * therefore have a high weighting. + * + * Returns false if there are no weightings for any of the specified tokens. + * + * @param array $tokens The token types to get the highest weighted + * type for. + * + * @return int|false The highest weighted token. + */ + public static function getHighestWeightedToken(array $tokens) + { + $highest = -1; + $highestType = false; + + $weights = self::$weightings; + + foreach ($tokens as $token) { + if (isset($weights[$token]) === true) { + $weight = $weights[$token]; + } else { + $weight = 0; + } + + if ($weight > $highest) { + $highest = $weight; + $highestType = $token; + } + } + + return $highestType; + + }//end getHighestWeightedToken() + + +}//end class diff --git a/trunk/vendor/symfony/console/Application.php b/trunk/vendor/symfony/console/Application.php new file mode 100644 index 00000000..bb534188 --- /dev/null +++ b/trunk/vendor/symfony/console/Application.php @@ -0,0 +1,1301 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Command\CompleteCommand; +use Symfony\Component\Console\Command\DumpCompletionCommand; +use Symfony\Component\Console\Command\HelpCommand; +use Symfony\Component\Console\Command\LazyCommand; +use Symfony\Component\Console\Command\ListCommand; +use Symfony\Component\Console\Command\SignalableCommandInterface; +use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Event\ConsoleCommandEvent; +use Symfony\Component\Console\Event\ConsoleErrorEvent; +use Symfony\Component\Console\Event\ConsoleSignalEvent; +use Symfony\Component\Console\Event\ConsoleTerminateEvent; +use Symfony\Component\Console\Exception\CommandNotFoundException; +use Symfony\Component\Console\Exception\ExceptionInterface; +use Symfony\Component\Console\Exception\LogicException; +use Symfony\Component\Console\Exception\NamespaceNotFoundException; +use Symfony\Component\Console\Exception\RuntimeException; +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Helper\DebugFormatterHelper; +use Symfony\Component\Console\Helper\FormatterHelper; +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Helper\HelperSet; +use Symfony\Component\Console\Helper\ProcessHelper; +use Symfony\Component\Console\Helper\QuestionHelper; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputAwareInterface; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\SignalRegistry\SignalRegistry; +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\ErrorHandler\ErrorHandler; +use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; +use Symfony\Contracts\Service\ResetInterface; + +/** + * An Application is the container for a collection of commands. + * + * It is the main entry point of a Console application. + * + * This class is optimized for a standard CLI environment. + * + * Usage: + * + * $app = new Application('myapp', '1.0 (stable)'); + * $app->add(new SimpleCommand()); + * $app->run(); + * + * @author Fabien Potencier + */ +class Application implements ResetInterface +{ + private $commands = []; + private $wantHelps = false; + private $runningCommand; + private $name; + private $version; + private $commandLoader; + private $catchExceptions = true; + private $autoExit = true; + private $definition; + private $helperSet; + private $dispatcher; + private $terminal; + private $defaultCommand; + private $singleCommand = false; + private $initialized; + private $signalRegistry; + private $signalsToDispatchEvent = []; + + public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') + { + $this->name = $name; + $this->version = $version; + $this->terminal = new Terminal(); + $this->defaultCommand = 'list'; + if (\defined('SIGINT') && SignalRegistry::isSupported()) { + $this->signalRegistry = new SignalRegistry(); + $this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2]; + } + } + + /** + * @final + */ + public function setDispatcher(EventDispatcherInterface $dispatcher) + { + $this->dispatcher = $dispatcher; + } + + public function setCommandLoader(CommandLoaderInterface $commandLoader) + { + $this->commandLoader = $commandLoader; + } + + public function getSignalRegistry(): SignalRegistry + { + if (!$this->signalRegistry) { + throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); + } + + return $this->signalRegistry; + } + + public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) + { + $this->signalsToDispatchEvent = $signalsToDispatchEvent; + } + + /** + * Runs the current application. + * + * @return int 0 if everything went fine, or an error code + * + * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. + */ + public function run(?InputInterface $input = null, ?OutputInterface $output = null) + { + if (\function_exists('putenv')) { + @putenv('LINES='.$this->terminal->getHeight()); + @putenv('COLUMNS='.$this->terminal->getWidth()); + } + + if (null === $input) { + $input = new ArgvInput(); + } + + if (null === $output) { + $output = new ConsoleOutput(); + } + + $renderException = function (\Throwable $e) use ($output) { + if ($output instanceof ConsoleOutputInterface) { + $this->renderThrowable($e, $output->getErrorOutput()); + } else { + $this->renderThrowable($e, $output); + } + }; + if ($phpHandler = set_exception_handler($renderException)) { + restore_exception_handler(); + if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) { + $errorHandler = true; + } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) { + $phpHandler[0]->setExceptionHandler($errorHandler); + } + } + + $this->configureIO($input, $output); + + try { + $exitCode = $this->doRun($input, $output); + } catch (\Exception $e) { + if (!$this->catchExceptions) { + throw $e; + } + + $renderException($e); + + $exitCode = $e->getCode(); + if (is_numeric($exitCode)) { + $exitCode = (int) $exitCode; + if ($exitCode <= 0) { + $exitCode = 1; + } + } else { + $exitCode = 1; + } + } finally { + // if the exception handler changed, keep it + // otherwise, unregister $renderException + if (!$phpHandler) { + if (set_exception_handler($renderException) === $renderException) { + restore_exception_handler(); + } + restore_exception_handler(); + } elseif (!$errorHandler) { + $finalHandler = $phpHandler[0]->setExceptionHandler(null); + if ($finalHandler !== $renderException) { + $phpHandler[0]->setExceptionHandler($finalHandler); + } + } + } + + if ($this->autoExit) { + if ($exitCode > 255) { + $exitCode = 255; + } + + exit($exitCode); + } + + return $exitCode; + } + + /** + * Runs the current application. + * + * @return int 0 if everything went fine, or an error code + */ + public function doRun(InputInterface $input, OutputInterface $output) + { + if (true === $input->hasParameterOption(['--version', '-V'], true)) { + $output->writeln($this->getLongVersion()); + + return 0; + } + + try { + // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument. + $input->bind($this->getDefinition()); + } catch (ExceptionInterface $e) { + // Errors must be ignored, full binding/validation happens later when the command is known. + } + + $name = $this->getCommandName($input); + if (true === $input->hasParameterOption(['--help', '-h'], true)) { + if (!$name) { + $name = 'help'; + $input = new ArrayInput(['command_name' => $this->defaultCommand]); + } else { + $this->wantHelps = true; + } + } + + if (!$name) { + $name = $this->defaultCommand; + $definition = $this->getDefinition(); + $definition->setArguments(array_merge( + $definition->getArguments(), + [ + 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), + ] + )); + } + + try { + $this->runningCommand = null; + // the command name MUST be the first element of the input + $command = $this->find($name); + } catch (\Throwable $e) { + if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) { + if (null !== $this->dispatcher) { + $event = new ConsoleErrorEvent($input, $output, $e); + $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); + + if (0 === $event->getExitCode()) { + return 0; + } + + $e = $event->getError(); + } + + throw $e; + } + + $alternative = $alternatives[0]; + + $style = new SymfonyStyle($input, $output); + $output->writeln(''); + $formattedBlock = (new FormatterHelper())->formatBlock(sprintf('Command "%s" is not defined.', $name), 'error', true); + $output->writeln($formattedBlock); + if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { + if (null !== $this->dispatcher) { + $event = new ConsoleErrorEvent($input, $output, $e); + $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); + + return $event->getExitCode(); + } + + return 1; + } + + $command = $this->find($alternative); + } + + if ($command instanceof LazyCommand) { + $command = $command->getCommand(); + } + + $this->runningCommand = $command; + $exitCode = $this->doRunCommand($command, $input, $output); + $this->runningCommand = null; + + return $exitCode; + } + + /** + * {@inheritdoc} + */ + public function reset() + { + } + + public function setHelperSet(HelperSet $helperSet) + { + $this->helperSet = $helperSet; + } + + /** + * Get the helper set associated with the command. + * + * @return HelperSet + */ + public function getHelperSet() + { + if (!$this->helperSet) { + $this->helperSet = $this->getDefaultHelperSet(); + } + + return $this->helperSet; + } + + public function setDefinition(InputDefinition $definition) + { + $this->definition = $definition; + } + + /** + * Gets the InputDefinition related to this Application. + * + * @return InputDefinition + */ + public function getDefinition() + { + if (!$this->definition) { + $this->definition = $this->getDefaultInputDefinition(); + } + + if ($this->singleCommand) { + $inputDefinition = $this->definition; + $inputDefinition->setArguments(); + + return $inputDefinition; + } + + return $this->definition; + } + + /** + * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). + */ + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ( + CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() + && 'command' === $input->getCompletionName() + ) { + $commandNames = []; + foreach ($this->all() as $name => $command) { + // skip hidden commands and aliased commands as they already get added below + if ($command->isHidden() || $command->getName() !== $name) { + continue; + } + $commandNames[] = $command->getName(); + foreach ($command->getAliases() as $name) { + $commandNames[] = $name; + } + } + $suggestions->suggestValues(array_filter($commandNames)); + + return; + } + + if (CompletionInput::TYPE_OPTION_NAME === $input->getCompletionType()) { + $suggestions->suggestOptions($this->getDefinition()->getOptions()); + + return; + } + } + + /** + * Gets the help message. + * + * @return string + */ + public function getHelp() + { + return $this->getLongVersion(); + } + + /** + * Gets whether to catch exceptions or not during commands execution. + * + * @return bool + */ + public function areExceptionsCaught() + { + return $this->catchExceptions; + } + + /** + * Sets whether to catch exceptions or not during commands execution. + */ + public function setCatchExceptions(bool $boolean) + { + $this->catchExceptions = $boolean; + } + + /** + * Gets whether to automatically exit after a command execution or not. + * + * @return bool + */ + public function isAutoExitEnabled() + { + return $this->autoExit; + } + + /** + * Sets whether to automatically exit after a command execution or not. + */ + public function setAutoExit(bool $boolean) + { + $this->autoExit = $boolean; + } + + /** + * Gets the name of the application. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Sets the application name. + **/ + public function setName(string $name) + { + $this->name = $name; + } + + /** + * Gets the application version. + * + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Sets the application version. + */ + public function setVersion(string $version) + { + $this->version = $version; + } + + /** + * Returns the long version of the application. + * + * @return string + */ + public function getLongVersion() + { + if ('UNKNOWN' !== $this->getName()) { + if ('UNKNOWN' !== $this->getVersion()) { + return sprintf('%s %s', $this->getName(), $this->getVersion()); + } + + return $this->getName(); + } + + return 'Console Tool'; + } + + /** + * Registers a new command. + * + * @return Command + */ + public function register(string $name) + { + return $this->add(new Command($name)); + } + + /** + * Adds an array of command objects. + * + * If a Command is not enabled it will not be added. + * + * @param Command[] $commands An array of commands + */ + public function addCommands(array $commands) + { + foreach ($commands as $command) { + $this->add($command); + } + } + + /** + * Adds a command object. + * + * If a command with the same name already exists, it will be overridden. + * If the command is not enabled it will not be added. + * + * @return Command|null + */ + public function add(Command $command) + { + $this->init(); + + $command->setApplication($this); + + if (!$command->isEnabled()) { + $command->setApplication(null); + + return null; + } + + if (!$command instanceof LazyCommand) { + // Will throw if the command is not correctly initialized. + $command->getDefinition(); + } + + if (!$command->getName()) { + throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); + } + + $this->commands[$command->getName()] = $command; + + foreach ($command->getAliases() as $alias) { + $this->commands[$alias] = $command; + } + + return $command; + } + + /** + * Returns a registered command by name or alias. + * + * @return Command + * + * @throws CommandNotFoundException When given command name does not exist + */ + public function get(string $name) + { + $this->init(); + + if (!$this->has($name)) { + throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); + } + + // When the command has a different name than the one used at the command loader level + if (!isset($this->commands[$name])) { + throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); + } + + $command = $this->commands[$name]; + + if ($this->wantHelps) { + $this->wantHelps = false; + + $helpCommand = $this->get('help'); + $helpCommand->setCommand($command); + + return $helpCommand; + } + + return $command; + } + + /** + * Returns true if the command exists, false otherwise. + * + * @return bool + */ + public function has(string $name) + { + $this->init(); + + return isset($this->commands[$name]) || ($this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name))); + } + + /** + * Returns an array of all unique namespaces used by currently registered commands. + * + * It does not return the global namespace which always exists. + * + * @return string[] + */ + public function getNamespaces() + { + $namespaces = []; + foreach ($this->all() as $command) { + if ($command->isHidden()) { + continue; + } + + $namespaces[] = $this->extractAllNamespaces($command->getName()); + + foreach ($command->getAliases() as $alias) { + $namespaces[] = $this->extractAllNamespaces($alias); + } + } + + return array_values(array_unique(array_filter(array_merge([], ...$namespaces)))); + } + + /** + * Finds a registered namespace by a name or an abbreviation. + * + * @return string + * + * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous + */ + public function findNamespace(string $namespace) + { + $allNamespaces = $this->getNamespaces(); + $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; + $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); + + if (empty($namespaces)) { + $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); + + if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { + if (1 == \count($alternatives)) { + $message .= "\n\nDid you mean this?\n "; + } else { + $message .= "\n\nDid you mean one of these?\n "; + } + + $message .= implode("\n ", $alternatives); + } + + throw new NamespaceNotFoundException($message, $alternatives); + } + + $exact = \in_array($namespace, $namespaces, true); + if (\count($namespaces) > 1 && !$exact) { + throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); + } + + return $exact ? $namespace : reset($namespaces); + } + + /** + * Finds a command by name or alias. + * + * Contrary to get, this command tries to find the best + * match if you give it an abbreviation of a name or alias. + * + * @return Command + * + * @throws CommandNotFoundException When command name is incorrect or ambiguous + */ + public function find(string $name) + { + $this->init(); + + $aliases = []; + + foreach ($this->commands as $command) { + foreach ($command->getAliases() as $alias) { + if (!$this->has($alias)) { + $this->commands[$alias] = $command; + } + } + } + + if ($this->has($name)) { + return $this->get($name); + } + + $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); + $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*'; + $commands = preg_grep('{^'.$expr.'}', $allCommands); + + if (empty($commands)) { + $commands = preg_grep('{^'.$expr.'}i', $allCommands); + } + + // if no commands matched or we just matched namespaces + if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) { + if (false !== $pos = strrpos($name, ':')) { + // check if a namespace exists and contains commands + $this->findNamespace(substr($name, 0, $pos)); + } + + $message = sprintf('Command "%s" is not defined.', $name); + + if ($alternatives = $this->findAlternatives($name, $allCommands)) { + // remove hidden commands + $alternatives = array_filter($alternatives, function ($name) { + return !$this->get($name)->isHidden(); + }); + + if (1 == \count($alternatives)) { + $message .= "\n\nDid you mean this?\n "; + } else { + $message .= "\n\nDid you mean one of these?\n "; + } + $message .= implode("\n ", $alternatives); + } + + throw new CommandNotFoundException($message, array_values($alternatives)); + } + + // filter out aliases for commands which are already on the list + if (\count($commands) > 1) { + $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands; + $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) { + if (!$commandList[$nameOrAlias] instanceof Command) { + $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias); + } + + $commandName = $commandList[$nameOrAlias]->getName(); + + $aliases[$nameOrAlias] = $commandName; + + return $commandName === $nameOrAlias || !\in_array($commandName, $commands); + })); + } + + if (\count($commands) > 1) { + $usableWidth = $this->terminal->getWidth() - 10; + $abbrevs = array_values($commands); + $maxLen = 0; + foreach ($abbrevs as $abbrev) { + $maxLen = max(Helper::width($abbrev), $maxLen); + } + $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { + if ($commandList[$cmd]->isHidden()) { + unset($commands[array_search($cmd, $commands)]); + + return false; + } + + $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription(); + + return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev; + }, array_values($commands)); + + if (\count($commands) > 1) { + $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); + + throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); + } + } + + $command = $this->get(reset($commands)); + + if ($command->isHidden()) { + throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); + } + + return $command; + } + + /** + * Gets the commands (registered in the given namespace if provided). + * + * The array keys are the full names and the values the command instances. + * + * @return Command[] + */ + public function all(?string $namespace = null) + { + $this->init(); + + if (null === $namespace) { + if (!$this->commandLoader) { + return $this->commands; + } + + $commands = $this->commands; + foreach ($this->commandLoader->getNames() as $name) { + if (!isset($commands[$name]) && $this->has($name)) { + $commands[$name] = $this->get($name); + } + } + + return $commands; + } + + $commands = []; + foreach ($this->commands as $name => $command) { + if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { + $commands[$name] = $command; + } + } + + if ($this->commandLoader) { + foreach ($this->commandLoader->getNames() as $name) { + if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) { + $commands[$name] = $this->get($name); + } + } + } + + return $commands; + } + + /** + * Returns an array of possible abbreviations given a set of names. + * + * @return string[][] + */ + public static function getAbbreviations(array $names) + { + $abbrevs = []; + foreach ($names as $name) { + for ($len = \strlen($name); $len > 0; --$len) { + $abbrev = substr($name, 0, $len); + $abbrevs[$abbrev][] = $name; + } + } + + return $abbrevs; + } + + public function renderThrowable(\Throwable $e, OutputInterface $output): void + { + $output->writeln('', OutputInterface::VERBOSITY_QUIET); + + $this->doRenderThrowable($e, $output); + + if (null !== $this->runningCommand) { + $output->writeln(sprintf('%s', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); + $output->writeln('', OutputInterface::VERBOSITY_QUIET); + } + } + + protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void + { + do { + $message = trim($e->getMessage()); + if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { + $class = get_debug_type($e); + $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); + $len = Helper::width($title); + } else { + $len = 0; + } + + if (str_contains($message, "@anonymous\0")) { + $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { + return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; + }, $message); + } + + $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; + $lines = []; + foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) { + foreach ($this->splitStringByWidth($line, $width - 4) as $line) { + // pre-format lines to get the right string length + $lineLength = Helper::width($line) + 4; + $lines[] = [$line, $lineLength]; + + $len = max($lineLength, $len); + } + } + + $messages = []; + if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { + $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); + } + $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); + if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { + $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); + } + foreach ($lines as $line) { + $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); + } + $messages[] = $emptyLine; + $messages[] = ''; + + $output->writeln($messages, OutputInterface::VERBOSITY_QUIET); + + if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { + $output->writeln('Exception trace:', OutputInterface::VERBOSITY_QUIET); + + // exception related properties + $trace = $e->getTrace(); + + array_unshift($trace, [ + 'function' => '', + 'file' => $e->getFile() ?: 'n/a', + 'line' => $e->getLine() ?: 'n/a', + 'args' => [], + ]); + + for ($i = 0, $count = \count($trace); $i < $count; ++$i) { + $class = $trace[$i]['class'] ?? ''; + $type = $trace[$i]['type'] ?? ''; + $function = $trace[$i]['function'] ?? ''; + $file = $trace[$i]['file'] ?? 'n/a'; + $line = $trace[$i]['line'] ?? 'n/a'; + + $output->writeln(sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); + } + + $output->writeln('', OutputInterface::VERBOSITY_QUIET); + } + } while ($e = $e->getPrevious()); + } + + /** + * Configures the input and output instances based on the user arguments and options. + */ + protected function configureIO(InputInterface $input, OutputInterface $output) + { + if (true === $input->hasParameterOption(['--ansi'], true)) { + $output->setDecorated(true); + } elseif (true === $input->hasParameterOption(['--no-ansi'], true)) { + $output->setDecorated(false); + } + + if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) { + $input->setInteractive(false); + } + + switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { + case -1: + $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); + break; + case 1: + $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); + break; + case 2: + $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); + break; + case 3: + $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + break; + default: + $shellVerbosity = 0; + break; + } + + if (true === $input->hasParameterOption(['--quiet', '-q'], true)) { + $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); + $shellVerbosity = -1; + } else { + if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || 3 === $input->getParameterOption('--verbose', false, true)) { + $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + $shellVerbosity = 3; + } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || 2 === $input->getParameterOption('--verbose', false, true)) { + $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); + $shellVerbosity = 2; + } elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) { + $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); + $shellVerbosity = 1; + } + } + + if (-1 === $shellVerbosity) { + $input->setInteractive(false); + } + + if (\function_exists('putenv')) { + @putenv('SHELL_VERBOSITY='.$shellVerbosity); + } + $_ENV['SHELL_VERBOSITY'] = $shellVerbosity; + $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity; + } + + /** + * Runs the current command. + * + * If an event dispatcher has been attached to the application, + * events are also dispatched during the life-cycle of the command. + * + * @return int 0 if everything went fine, or an error code + */ + protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) + { + foreach ($command->getHelperSet() as $helper) { + if ($helper instanceof InputAwareInterface) { + $helper->setInput($input); + } + } + + if ($this->signalsToDispatchEvent) { + $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; + + if ($commandSignals || null !== $this->dispatcher) { + if (!$this->signalRegistry) { + throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); + } + + if (Terminal::hasSttyAvailable()) { + $sttyMode = shell_exec('stty -g'); + + foreach ([\SIGINT, \SIGTERM] as $signal) { + $this->signalRegistry->register($signal, static function () use ($sttyMode) { + shell_exec('stty '.$sttyMode); + }); + } + } + } + + if (null !== $this->dispatcher) { + foreach ($this->signalsToDispatchEvent as $signal) { + $event = new ConsoleSignalEvent($command, $input, $output, $signal); + + $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) { + $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL); + + // No more handlers, we try to simulate PHP default behavior + if (!$hasNext) { + if (!\in_array($signal, [\SIGUSR1, \SIGUSR2], true)) { + exit(0); + } + } + }); + } + } + + foreach ($commandSignals as $signal) { + $this->signalRegistry->register($signal, [$command, 'handleSignal']); + } + } + + if (null === $this->dispatcher) { + return $command->run($input, $output); + } + + // bind before the console.command event, so the listeners have access to input options/arguments + try { + $command->mergeApplicationDefinition(); + $input->bind($command->getDefinition()); + } catch (ExceptionInterface $e) { + // ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition + } + + $event = new ConsoleCommandEvent($command, $input, $output); + $e = null; + + try { + $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND); + + if ($event->commandShouldRun()) { + $exitCode = $command->run($input, $output); + } else { + $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; + } + } catch (\Throwable $e) { + $event = new ConsoleErrorEvent($input, $output, $e, $command); + $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); + $e = $event->getError(); + + if (0 === $exitCode = $event->getExitCode()) { + $e = null; + } + } + + $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); + $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); + + if (null !== $e) { + throw $e; + } + + return $event->getExitCode(); + } + + /** + * Gets the name of the command based on input. + * + * @return string|null + */ + protected function getCommandName(InputInterface $input) + { + return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument(); + } + + /** + * Gets the default input definition. + * + * @return InputDefinition + */ + protected function getDefaultInputDefinition() + { + return new InputDefinition([ + new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), + new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the '.$this->defaultCommand.' command'), + new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), + new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), + new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), + new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null), + new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), + ]); + } + + /** + * Gets the default commands that should always be available. + * + * @return Command[] + */ + protected function getDefaultCommands() + { + return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()]; + } + + /** + * Gets the default helper set with the helpers that should always be available. + * + * @return HelperSet + */ + protected function getDefaultHelperSet() + { + return new HelperSet([ + new FormatterHelper(), + new DebugFormatterHelper(), + new ProcessHelper(), + new QuestionHelper(), + ]); + } + + /** + * Returns abbreviated suggestions in string format. + */ + private function getAbbreviationSuggestions(array $abbrevs): string + { + return ' '.implode("\n ", $abbrevs); + } + + /** + * Returns the namespace part of the command name. + * + * This method is not part of public API and should not be used directly. + * + * @return string + */ + public function extractNamespace(string $name, ?int $limit = null) + { + $parts = explode(':', $name, -1); + + return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit)); + } + + /** + * Finds alternative of $name among $collection, + * if nothing is found in $collection, try in $abbrevs. + * + * @return string[] + */ + private function findAlternatives(string $name, iterable $collection): array + { + $threshold = 1e3; + $alternatives = []; + + $collectionParts = []; + foreach ($collection as $item) { + $collectionParts[$item] = explode(':', $item); + } + + foreach (explode(':', $name) as $i => $subname) { + foreach ($collectionParts as $collectionName => $parts) { + $exists = isset($alternatives[$collectionName]); + if (!isset($parts[$i]) && $exists) { + $alternatives[$collectionName] += $threshold; + continue; + } elseif (!isset($parts[$i])) { + continue; + } + + $lev = levenshtein($subname, $parts[$i]); + if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) { + $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; + } elseif ($exists) { + $alternatives[$collectionName] += $threshold; + } + } + } + + foreach ($collection as $item) { + $lev = levenshtein($name, $item); + if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { + $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; + } + } + + $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); + ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); + + return array_keys($alternatives); + } + + /** + * Sets the default Command name. + * + * @return $this + */ + public function setDefaultCommand(string $commandName, bool $isSingleCommand = false) + { + $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0]; + + if ($isSingleCommand) { + // Ensure the command exist + $this->find($commandName); + + $this->singleCommand = true; + } + + return $this; + } + + /** + * @internal + */ + public function isSingleCommand(): bool + { + return $this->singleCommand; + } + + private function splitStringByWidth(string $string, int $width): array + { + // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. + // additionally, array_slice() is not enough as some character has doubled width. + // we need a function to split string not by character count but by string width + if (false === $encoding = mb_detect_encoding($string, null, true)) { + return str_split($string, $width); + } + + $utf8String = mb_convert_encoding($string, 'utf8', $encoding); + $lines = []; + $line = ''; + + $offset = 0; + while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) { + $offset += \strlen($m[0]); + + foreach (preg_split('//u', $m[0]) as $char) { + // test if $char could be appended to current line + if (mb_strwidth($line.$char, 'utf8') <= $width) { + $line .= $char; + continue; + } + // if not, push current line to array and make new line + $lines[] = str_pad($line, $width); + $line = $char; + } + } + + $lines[] = \count($lines) ? str_pad($line, $width) : $line; + + mb_convert_variables($encoding, 'utf8', $lines); + + return $lines; + } + + /** + * Returns all namespaces of the command name. + * + * @return string[] + */ + private function extractAllNamespaces(string $name): array + { + // -1 as third argument is needed to skip the command short name when exploding + $parts = explode(':', $name, -1); + $namespaces = []; + + foreach ($parts as $part) { + if (\count($namespaces)) { + $namespaces[] = end($namespaces).':'.$part; + } else { + $namespaces[] = $part; + } + } + + return $namespaces; + } + + private function init() + { + if ($this->initialized) { + return; + } + $this->initialized = true; + + foreach ($this->getDefaultCommands() as $command) { + $this->add($command); + } + } +} diff --git a/trunk/vendor/symfony/console/Attribute/AsCommand.php b/trunk/vendor/symfony/console/Attribute/AsCommand.php new file mode 100644 index 00000000..b337f548 --- /dev/null +++ b/trunk/vendor/symfony/console/Attribute/AsCommand.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Attribute; + +/** + * Service tag to autoconfigure commands. + */ +#[\Attribute(\Attribute::TARGET_CLASS)] +class AsCommand +{ + public function __construct( + public string $name, + public ?string $description = null, + array $aliases = [], + bool $hidden = false, + ) { + if (!$hidden && !$aliases) { + return; + } + + $name = explode('|', $name); + $name = array_merge($name, $aliases); + + if ($hidden && '' !== $name[0]) { + array_unshift($name, ''); + } + + $this->name = implode('|', $name); + } +} diff --git a/trunk/vendor/symfony/console/CHANGELOG.md b/trunk/vendor/symfony/console/CHANGELOG.md new file mode 100644 index 00000000..6662dd1e --- /dev/null +++ b/trunk/vendor/symfony/console/CHANGELOG.md @@ -0,0 +1,217 @@ +CHANGELOG +========= + +5.4 +--- + + * Add `TesterTrait::assertCommandIsSuccessful()` to test command + * Deprecate `HelperSet::setCommand()` and `getCommand()` without replacement + +5.3 +--- + + * Add `GithubActionReporter` to render annotations in a Github Action + * Add `InputOption::VALUE_NEGATABLE` flag to handle `--foo`/`--no-foo` options + * Add the `Command::$defaultDescription` static property and the `description` attribute + on the `console.command` tag to allow the `list` command to instantiate commands lazily + * Add option `--short` to the `list` command + * Add support for bright colors + * Add `#[AsCommand]` attribute for declaring commands on PHP 8 + * Add `Helper::width()` and `Helper::length()` + * The `--ansi` and `--no-ansi` options now default to `null`. + +5.2.0 +----- + + * Added `SingleCommandApplication::setAutoExit()` to allow testing via `CommandTester` + * added support for multiline responses to questions through `Question::setMultiline()` + and `Question::isMultiline()` + * Added `SignalRegistry` class to stack signals handlers + * Added support for signals: + * Added `Application::getSignalRegistry()` and `Application::setSignalsToDispatchEvent()` methods + * Added `SignalableCommandInterface` interface + * Added `TableCellStyle` class to customize table cell + * Removed `php ` prefix invocation from help messages. + +5.1.0 +----- + + * `Command::setHidden()` is final since Symfony 5.1 + * Add `SingleCommandApplication` + * Add `Cursor` class + +5.0.0 +----- + + * removed support for finding hidden commands using an abbreviation, use the full name instead + * removed `TableStyle::setCrossingChar()` method in favor of `TableStyle::setDefaultCrossingChar()` + * removed `TableStyle::setHorizontalBorderChar()` method in favor of `TableStyle::setDefaultCrossingChars()` + * removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()` + * removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()` + * removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()` + * removed support for returning `null` from `Command::execute()`, return `0` instead + * `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument + * `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface` + for its `dispatcher` argument + * renamed `Application::renderException()` and `Application::doRenderException()` + to `renderThrowable()` and `doRenderThrowable()` respectively. + +4.4.0 +----- + + * deprecated finding hidden commands using an abbreviation, use the full name instead + * added `Question::setTrimmable` default to true to allow the answer to be trimmed + * added method `minSecondsBetweenRedraws()` and `maxSecondsBetweenRedraws()` on `ProgressBar` + * `Application` implements `ResetInterface` + * marked all dispatched event classes as `@final` + * added support for displaying table horizontally + * deprecated returning `null` from `Command::execute()`, return `0` instead + * Deprecated the `Application::renderException()` and `Application::doRenderException()` methods, + use `renderThrowable()` and `doRenderThrowable()` instead. + * added support for the `NO_COLOR` env var (https://no-color.org/) + +4.3.0 +----- + + * added support for hyperlinks + * added `ProgressBar::iterate()` method that simplify updating the progress bar when iterating + * added `Question::setAutocompleterCallback()` to provide a callback function + that dynamically generates suggestions as the user types + +4.2.0 +----- + + * allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to + `ProcessHelper::run()` to pass environment variables + * deprecated passing a command as a string to `ProcessHelper::run()`, + pass it the command as an array of its arguments instead + * made the `ProcessHelper` class final + * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`) + * added `capture_stderr_separately` option to `CommandTester::execute()` + +4.1.0 +----- + + * added option to run suggested command if command is not found and only 1 alternative is available + * added option to modify console output and print multiple modifiable sections + * added support for iterable messages in output `write` and `writeln` methods + +4.0.0 +----- + + * `OutputFormatter` throws an exception when unknown options are used + * removed `QuestionHelper::setInputStream()/getInputStream()` + * removed `Application::getTerminalWidth()/getTerminalHeight()` and + `Application::setTerminalDimensions()/getTerminalDimensions()` + * removed `ConsoleExceptionEvent` + * removed `ConsoleEvents::EXCEPTION` + +3.4.0 +----- + + * added `SHELL_VERBOSITY` env var to control verbosity + * added `CommandLoaderInterface`, `FactoryCommandLoader` and PSR-11 + `ContainerCommandLoader` for commands lazy-loading + * added a case-insensitive command name matching fallback + * added static `Command::$defaultName/getDefaultName()`, allowing for + commands to be registered at compile time in the application command loader. + Setting the `$defaultName` property avoids the need for filling the `command` + attribute on the `console.command` tag when using `AddConsoleCommandPass`. + +3.3.0 +----- + + * added `ExceptionListener` + * added `AddConsoleCommandPass` (originally in FrameworkBundle) + * [BC BREAK] `Input::getOption()` no longer returns the default value for options + with value optional explicitly passed empty + * added console.error event to catch exceptions thrown by other listeners + * deprecated console.exception event in favor of console.error + * added ability to handle `CommandNotFoundException` through the + `console.error` event + * deprecated default validation in `SymfonyQuestionHelper::ask` + +3.2.0 +------ + + * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs + * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) + * added StreamableInputInterface + * added LockableTrait + +3.1.0 +----- + + * added truncate method to FormatterHelper + * added setColumnWidth(s) method to Table + +2.8.3 +----- + + * remove readline support from the question helper as it caused issues + +2.8.0 +----- + + * use readline for user input in the question helper when available to allow + the use of arrow keys + +2.6.0 +----- + + * added a Process helper + * added a DebugFormatter helper + +2.5.0 +----- + + * deprecated the dialog helper (use the question helper instead) + * deprecated TableHelper in favor of Table + * deprecated ProgressHelper in favor of ProgressBar + * added ConsoleLogger + * added a question helper + * added a way to set the process name of a command + * added a way to set a default command instead of `ListCommand` + +2.4.0 +----- + + * added a way to force terminal dimensions + * added a convenient method to detect verbosity level + * [BC BREAK] made descriptors use output instead of returning a string + +2.3.0 +----- + + * added multiselect support to the select dialog helper + * added Table Helper for tabular data rendering + * added support for events in `Application` + * added a way to normalize EOLs in `ApplicationTester::getDisplay()` and `CommandTester::getDisplay()` + * added a way to set the progress bar progress via the `setCurrent` method + * added support for multiple InputOption shortcuts, written as `'-a|-b|-c'` + * added two additional verbosity levels, VERBOSITY_VERY_VERBOSE and VERBOSITY_DEBUG + +2.2.0 +----- + + * added support for colorization on Windows via ConEmu + * add a method to Dialog Helper to ask for a question and hide the response + * added support for interactive selections in console (DialogHelper::select()) + * added support for autocompletion as you type in Dialog Helper + +2.1.0 +----- + + * added ConsoleOutputInterface + * added the possibility to disable a command (Command::isEnabled()) + * added suggestions when a command does not exist + * added a --raw option to the list command + * added support for STDERR in the console output class (errors are now sent + to STDERR) + * made the defaults (helper set, commands, input definition) in Application + more easily customizable + * added support for the shell even if readline is not available + * added support for process isolation in Symfony shell via + `--process-isolation` switch + * added support for `--`, which disables options parsing after that point + (tokens will be parsed as arguments) diff --git a/trunk/vendor/symfony/console/CI/GithubActionReporter.php b/trunk/vendor/symfony/console/CI/GithubActionReporter.php new file mode 100644 index 00000000..06571785 --- /dev/null +++ b/trunk/vendor/symfony/console/CI/GithubActionReporter.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\CI; + +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Utility class for Github actions. + * + * @author Maxime Steinhausser + */ +class GithubActionReporter +{ + private $output; + + /** + * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85 + */ + private const ESCAPED_DATA = [ + '%' => '%25', + "\r" => '%0D', + "\n" => '%0A', + ]; + + /** + * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L87-L94 + */ + private const ESCAPED_PROPERTIES = [ + '%' => '%25', + "\r" => '%0D', + "\n" => '%0A', + ':' => '%3A', + ',' => '%2C', + ]; + + public function __construct(OutputInterface $output) + { + $this->output = $output; + } + + public static function isGithubActionEnvironment(): bool + { + return false !== getenv('GITHUB_ACTIONS'); + } + + /** + * Output an error using the Github annotations format. + * + * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message + */ + public function error(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void + { + $this->log('error', $message, $file, $line, $col); + } + + /** + * Output a warning using the Github annotations format. + * + * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message + */ + public function warning(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void + { + $this->log('warning', $message, $file, $line, $col); + } + + /** + * Output a debug log using the Github annotations format. + * + * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message + */ + public function debug(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void + { + $this->log('debug', $message, $file, $line, $col); + } + + private function log(string $type, string $message, ?string $file = null, ?int $line = null, ?int $col = null): void + { + // Some values must be encoded. + $message = strtr($message, self::ESCAPED_DATA); + + if (!$file) { + // No file provided, output the message solely: + $this->output->writeln(sprintf('::%s::%s', $type, $message)); + + return; + } + + $this->output->writeln(sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); + } +} diff --git a/trunk/vendor/symfony/console/Color.php b/trunk/vendor/symfony/console/Color.php new file mode 100644 index 00000000..22a4ce9f --- /dev/null +++ b/trunk/vendor/symfony/console/Color.php @@ -0,0 +1,180 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console; + +use Symfony\Component\Console\Exception\InvalidArgumentException; + +/** + * @author Fabien Potencier + */ +final class Color +{ + private const COLORS = [ + 'black' => 0, + 'red' => 1, + 'green' => 2, + 'yellow' => 3, + 'blue' => 4, + 'magenta' => 5, + 'cyan' => 6, + 'white' => 7, + 'default' => 9, + ]; + + private const BRIGHT_COLORS = [ + 'gray' => 0, + 'bright-red' => 1, + 'bright-green' => 2, + 'bright-yellow' => 3, + 'bright-blue' => 4, + 'bright-magenta' => 5, + 'bright-cyan' => 6, + 'bright-white' => 7, + ]; + + private const AVAILABLE_OPTIONS = [ + 'bold' => ['set' => 1, 'unset' => 22], + 'underscore' => ['set' => 4, 'unset' => 24], + 'blink' => ['set' => 5, 'unset' => 25], + 'reverse' => ['set' => 7, 'unset' => 27], + 'conceal' => ['set' => 8, 'unset' => 28], + ]; + + private $foreground; + private $background; + private $options = []; + + public function __construct(string $foreground = '', string $background = '', array $options = []) + { + $this->foreground = $this->parseColor($foreground); + $this->background = $this->parseColor($background, true); + + foreach ($options as $option) { + if (!isset(self::AVAILABLE_OPTIONS[$option])) { + throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); + } + + $this->options[$option] = self::AVAILABLE_OPTIONS[$option]; + } + } + + public function apply(string $text): string + { + return $this->set().$text.$this->unset(); + } + + public function set(): string + { + $setCodes = []; + if ('' !== $this->foreground) { + $setCodes[] = $this->foreground; + } + if ('' !== $this->background) { + $setCodes[] = $this->background; + } + foreach ($this->options as $option) { + $setCodes[] = $option['set']; + } + if (0 === \count($setCodes)) { + return ''; + } + + return sprintf("\033[%sm", implode(';', $setCodes)); + } + + public function unset(): string + { + $unsetCodes = []; + if ('' !== $this->foreground) { + $unsetCodes[] = 39; + } + if ('' !== $this->background) { + $unsetCodes[] = 49; + } + foreach ($this->options as $option) { + $unsetCodes[] = $option['unset']; + } + if (0 === \count($unsetCodes)) { + return ''; + } + + return sprintf("\033[%sm", implode(';', $unsetCodes)); + } + + private function parseColor(string $color, bool $background = false): string + { + if ('' === $color) { + return ''; + } + + if ('#' === $color[0]) { + $color = substr($color, 1); + + if (3 === \strlen($color)) { + $color = $color[0].$color[0].$color[1].$color[1].$color[2].$color[2]; + } + + if (6 !== \strlen($color)) { + throw new InvalidArgumentException(sprintf('Invalid "%s" color.', $color)); + } + + return ($background ? '4' : '3').$this->convertHexColorToAnsi(hexdec($color)); + } + + if (isset(self::COLORS[$color])) { + return ($background ? '4' : '3').self::COLORS[$color]; + } + + if (isset(self::BRIGHT_COLORS[$color])) { + return ($background ? '10' : '9').self::BRIGHT_COLORS[$color]; + } + + throw new InvalidArgumentException(sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); + } + + private function convertHexColorToAnsi(int $color): string + { + $r = ($color >> 16) & 255; + $g = ($color >> 8) & 255; + $b = $color & 255; + + // see https://github.com/termstandard/colors/ for more information about true color support + if ('truecolor' !== getenv('COLORTERM')) { + return (string) $this->degradeHexColorToAnsi($r, $g, $b); + } + + return sprintf('8;2;%d;%d;%d', $r, $g, $b); + } + + private function degradeHexColorToAnsi(int $r, int $g, int $b): int + { + if (0 === round($this->getSaturation($r, $g, $b) / 50)) { + return 0; + } + + return (round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255); + } + + private function getSaturation(int $r, int $g, int $b): int + { + $r = $r / 255; + $g = $g / 255; + $b = $b / 255; + $v = max($r, $g, $b); + + if (0 === $diff = $v - min($r, $g, $b)) { + return 0; + } + + return (int) $diff * 100 / $v; + } +} diff --git a/trunk/vendor/symfony/console/Command/Command.php b/trunk/vendor/symfony/console/Command/Command.php new file mode 100644 index 00000000..d1810367 --- /dev/null +++ b/trunk/vendor/symfony/console/Command/Command.php @@ -0,0 +1,710 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Exception\ExceptionInterface; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; +use Symfony\Component\Console\Helper\HelperSet; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Base class for all commands. + * + * @author Fabien Potencier + */ +class Command +{ + // see https://tldp.org/LDP/abs/html/exitcodes.html + public const SUCCESS = 0; + public const FAILURE = 1; + public const INVALID = 2; + + /** + * @var string|null The default command name + */ + protected static $defaultName; + + /** + * @var string|null The default command description + */ + protected static $defaultDescription; + + private $application; + private $name; + private $processTitle; + private $aliases = []; + private $definition; + private $hidden = false; + private $help = ''; + private $description = ''; + private $fullDefinition; + private $ignoreValidationErrors = false; + private $code; + private $synopsis = []; + private $usages = []; + private $helperSet; + + /** + * @return string|null + */ + public static function getDefaultName() + { + $class = static::class; + + if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { + return $attribute[0]->newInstance()->name; + } + + $r = new \ReflectionProperty($class, 'defaultName'); + + return $class === $r->class ? static::$defaultName : null; + } + + public static function getDefaultDescription(): ?string + { + $class = static::class; + + if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { + return $attribute[0]->newInstance()->description; + } + + $r = new \ReflectionProperty($class, 'defaultDescription'); + + return $class === $r->class ? static::$defaultDescription : null; + } + + /** + * @param string|null $name The name of the command; passing null means it must be set in configure() + * + * @throws LogicException When the command name is empty + */ + public function __construct(?string $name = null) + { + $this->definition = new InputDefinition(); + + if (null === $name && null !== $name = static::getDefaultName()) { + $aliases = explode('|', $name); + + if ('' === $name = array_shift($aliases)) { + $this->setHidden(true); + $name = array_shift($aliases); + } + + $this->setAliases($aliases); + } + + if (null !== $name) { + $this->setName($name); + } + + if ('' === $this->description) { + $this->setDescription(static::getDefaultDescription() ?? ''); + } + + $this->configure(); + } + + /** + * Ignores validation errors. + * + * This is mainly useful for the help command. + */ + public function ignoreValidationErrors() + { + $this->ignoreValidationErrors = true; + } + + public function setApplication(?Application $application = null) + { + $this->application = $application; + if ($application) { + $this->setHelperSet($application->getHelperSet()); + } else { + $this->helperSet = null; + } + + $this->fullDefinition = null; + } + + public function setHelperSet(HelperSet $helperSet) + { + $this->helperSet = $helperSet; + } + + /** + * Gets the helper set. + * + * @return HelperSet|null + */ + public function getHelperSet() + { + return $this->helperSet; + } + + /** + * Gets the application instance for this command. + * + * @return Application|null + */ + public function getApplication() + { + return $this->application; + } + + /** + * Checks whether the command is enabled or not in the current environment. + * + * Override this to check for x or y and return false if the command cannot + * run properly under the current conditions. + * + * @return bool + */ + public function isEnabled() + { + return true; + } + + /** + * Configures the current command. + */ + protected function configure() + { + } + + /** + * Executes the current command. + * + * This method is not abstract because you can use this class + * as a concrete class. In this case, instead of defining the + * execute() method, you set the code to execute by passing + * a Closure to the setCode() method. + * + * @return int 0 if everything went fine, or an exit code + * + * @throws LogicException When this abstract method is not implemented + * + * @see setCode() + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + throw new LogicException('You must override the execute() method in the concrete command class.'); + } + + /** + * Interacts with the user. + * + * This method is executed before the InputDefinition is validated. + * This means that this is the only place where the command can + * interactively ask for values of missing required arguments. + */ + protected function interact(InputInterface $input, OutputInterface $output) + { + } + + /** + * Initializes the command after the input has been bound and before the input + * is validated. + * + * This is mainly useful when a lot of commands extends one main command + * where some things need to be initialized based on the input arguments and options. + * + * @see InputInterface::bind() + * @see InputInterface::validate() + */ + protected function initialize(InputInterface $input, OutputInterface $output) + { + } + + /** + * Runs the command. + * + * The code to execute is either defined directly with the + * setCode() method or by overriding the execute() method + * in a sub-class. + * + * @return int The command exit code + * + * @throws ExceptionInterface When input binding fails. Bypass this by calling {@link ignoreValidationErrors()}. + * + * @see setCode() + * @see execute() + */ + public function run(InputInterface $input, OutputInterface $output) + { + // add the application arguments and options + $this->mergeApplicationDefinition(); + + // bind the input against the command specific arguments/options + try { + $input->bind($this->getDefinition()); + } catch (ExceptionInterface $e) { + if (!$this->ignoreValidationErrors) { + throw $e; + } + } + + $this->initialize($input, $output); + + if (null !== $this->processTitle) { + if (\function_exists('cli_set_process_title')) { + if (!@cli_set_process_title($this->processTitle)) { + if ('Darwin' === \PHP_OS) { + $output->writeln('Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', OutputInterface::VERBOSITY_VERY_VERBOSE); + } else { + cli_set_process_title($this->processTitle); + } + } + } elseif (\function_exists('setproctitle')) { + setproctitle($this->processTitle); + } elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) { + $output->writeln('Install the proctitle PECL to be able to change the process title.'); + } + } + + if ($input->isInteractive()) { + $this->interact($input, $output); + } + + // The command name argument is often omitted when a command is executed directly with its run() method. + // It would fail the validation if we didn't make sure the command argument is present, + // since it's required by the application. + if ($input->hasArgument('command') && null === $input->getArgument('command')) { + $input->setArgument('command', $this->getName()); + } + + $input->validate(); + + if ($this->code) { + $statusCode = ($this->code)($input, $output); + } else { + $statusCode = $this->execute($input, $output); + + if (!\is_int($statusCode)) { + throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, "%s" returned.', static::class, get_debug_type($statusCode))); + } + } + + return is_numeric($statusCode) ? (int) $statusCode : 0; + } + + /** + * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). + */ + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + } + + /** + * Sets the code to execute when running this command. + * + * If this method is used, it overrides the code defined + * in the execute() method. + * + * @param callable $code A callable(InputInterface $input, OutputInterface $output) + * + * @return $this + * + * @throws InvalidArgumentException + * + * @see execute() + */ + public function setCode(callable $code) + { + if ($code instanceof \Closure) { + $r = new \ReflectionFunction($code); + if (null === $r->getClosureThis()) { + set_error_handler(static function () {}); + try { + if ($c = \Closure::bind($code, $this)) { + $code = $c; + } + } finally { + restore_error_handler(); + } + } + } + + $this->code = $code; + + return $this; + } + + /** + * Merges the application definition with the command definition. + * + * This method is not part of public API and should not be used directly. + * + * @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments + * + * @internal + */ + public function mergeApplicationDefinition(bool $mergeArgs = true) + { + if (null === $this->application) { + return; + } + + $this->fullDefinition = new InputDefinition(); + $this->fullDefinition->setOptions($this->definition->getOptions()); + $this->fullDefinition->addOptions($this->application->getDefinition()->getOptions()); + + if ($mergeArgs) { + $this->fullDefinition->setArguments($this->application->getDefinition()->getArguments()); + $this->fullDefinition->addArguments($this->definition->getArguments()); + } else { + $this->fullDefinition->setArguments($this->definition->getArguments()); + } + } + + /** + * Sets an array of argument and option instances. + * + * @param array|InputDefinition $definition An array of argument and option instances or a definition instance + * + * @return $this + */ + public function setDefinition($definition) + { + if ($definition instanceof InputDefinition) { + $this->definition = $definition; + } else { + $this->definition->setDefinition($definition); + } + + $this->fullDefinition = null; + + return $this; + } + + /** + * Gets the InputDefinition attached to this Command. + * + * @return InputDefinition + */ + public function getDefinition() + { + return $this->fullDefinition ?? $this->getNativeDefinition(); + } + + /** + * Gets the InputDefinition to be used to create representations of this Command. + * + * Can be overridden to provide the original command representation when it would otherwise + * be changed by merging with the application InputDefinition. + * + * This method is not part of public API and should not be used directly. + * + * @return InputDefinition + */ + public function getNativeDefinition() + { + if (null === $this->definition) { + throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); + } + + return $this->definition; + } + + /** + * Adds an argument. + * + * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL + * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) + * + * @return $this + * + * @throws InvalidArgumentException When argument mode is not valid + */ + public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null) + { + $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); + if (null !== $this->fullDefinition) { + $this->fullDefinition->addArgument(new InputArgument($name, $mode, $description, $default)); + } + + return $this; + } + + /** + * Adds an option. + * + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants + * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) + * + * @return $this + * + * @throws InvalidArgumentException If option mode is invalid or incompatible + */ + public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null) + { + $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); + if (null !== $this->fullDefinition) { + $this->fullDefinition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); + } + + return $this; + } + + /** + * Sets the name of the command. + * + * This method can set both the namespace and the name if + * you separate them by a colon (:) + * + * $command->setName('foo:bar'); + * + * @return $this + * + * @throws InvalidArgumentException When the name is invalid + */ + public function setName(string $name) + { + $this->validateName($name); + + $this->name = $name; + + return $this; + } + + /** + * Sets the process title of the command. + * + * This feature should be used only when creating a long process command, + * like a daemon. + * + * @return $this + */ + public function setProcessTitle(string $title) + { + $this->processTitle = $title; + + return $this; + } + + /** + * Returns the command name. + * + * @return string|null + */ + public function getName() + { + return $this->name; + } + + /** + * @param bool $hidden Whether or not the command should be hidden from the list of commands + * The default value will be true in Symfony 6.0 + * + * @return $this + * + * @final since Symfony 5.1 + */ + public function setHidden(bool $hidden /* = true */) + { + $this->hidden = $hidden; + + return $this; + } + + /** + * @return bool whether the command should be publicly shown or not + */ + public function isHidden() + { + return $this->hidden; + } + + /** + * Sets the description for the command. + * + * @return $this + */ + public function setDescription(string $description) + { + $this->description = $description; + + return $this; + } + + /** + * Returns the description for the command. + * + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the help for the command. + * + * @return $this + */ + public function setHelp(string $help) + { + $this->help = $help; + + return $this; + } + + /** + * Returns the help for the command. + * + * @return string + */ + public function getHelp() + { + return $this->help; + } + + /** + * Returns the processed help for the command replacing the %command.name% and + * %command.full_name% patterns with the real values dynamically. + * + * @return string + */ + public function getProcessedHelp() + { + $name = $this->name; + $isSingleCommand = $this->application && $this->application->isSingleCommand(); + + $placeholders = [ + '%command.name%', + '%command.full_name%', + ]; + $replacements = [ + $name, + $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name, + ]; + + return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription()); + } + + /** + * Sets the aliases for the command. + * + * @param string[] $aliases An array of aliases for the command + * + * @return $this + * + * @throws InvalidArgumentException When an alias is invalid + */ + public function setAliases(iterable $aliases) + { + $list = []; + + foreach ($aliases as $alias) { + $this->validateName($alias); + $list[] = $alias; + } + + $this->aliases = \is_array($aliases) ? $aliases : $list; + + return $this; + } + + /** + * Returns the aliases for the command. + * + * @return array + */ + public function getAliases() + { + return $this->aliases; + } + + /** + * Returns the synopsis for the command. + * + * @param bool $short Whether to show the short version of the synopsis (with options folded) or not + * + * @return string + */ + public function getSynopsis(bool $short = false) + { + $key = $short ? 'short' : 'long'; + + if (!isset($this->synopsis[$key])) { + $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); + } + + return $this->synopsis[$key]; + } + + /** + * Add a command usage example, it'll be prefixed with the command name. + * + * @return $this + */ + public function addUsage(string $usage) + { + if (!str_starts_with($usage, $this->name)) { + $usage = sprintf('%s %s', $this->name, $usage); + } + + $this->usages[] = $usage; + + return $this; + } + + /** + * Returns alternative usages of the command. + * + * @return array + */ + public function getUsages() + { + return $this->usages; + } + + /** + * Gets a helper instance by name. + * + * @return mixed + * + * @throws LogicException if no HelperSet is defined + * @throws InvalidArgumentException if the helper is not defined + */ + public function getHelper(string $name) + { + if (null === $this->helperSet) { + throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); + } + + return $this->helperSet->get($name); + } + + /** + * Validates a command name. + * + * It must be non-empty and parts can optionally be separated by ":". + * + * @throws InvalidArgumentException When the name is invalid + */ + private function validateName(string $name) + { + if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { + throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); + } + } +} diff --git a/trunk/vendor/symfony/console/Command/CompleteCommand.php b/trunk/vendor/symfony/console/Command/CompleteCommand.php new file mode 100644 index 00000000..0e35143c --- /dev/null +++ b/trunk/vendor/symfony/console/Command/CompleteCommand.php @@ -0,0 +1,205 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Completion\Output\BashCompletionOutput; +use Symfony\Component\Console\Completion\Output\CompletionOutputInterface; +use Symfony\Component\Console\Exception\CommandNotFoundException; +use Symfony\Component\Console\Exception\ExceptionInterface; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Responsible for providing the values to the shell completion. + * + * @author Wouter de Jong + */ +final class CompleteCommand extends Command +{ + protected static $defaultName = '|_complete'; + protected static $defaultDescription = 'Internal command to provide shell completion suggestions'; + + private $completionOutputs; + + private $isDebug = false; + + /** + * @param array> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value + */ + public function __construct(array $completionOutputs = []) + { + // must be set before the parent constructor, as the property value is used in configure() + $this->completionOutputs = $completionOutputs + ['bash' => BashCompletionOutput::class]; + + parent::__construct(); + } + + protected function configure(): void + { + $this + ->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("'.implode('", "', array_keys($this->completionOutputs)).'")') + ->addOption('input', 'i', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An array of input tokens (e.g. COMP_WORDS or argv)') + ->addOption('current', 'c', InputOption::VALUE_REQUIRED, 'The index of the "input" array that the cursor is in (e.g. COMP_CWORD)') + ->addOption('symfony', 'S', InputOption::VALUE_REQUIRED, 'The version of the completion script') + ; + } + + protected function initialize(InputInterface $input, OutputInterface $output) + { + $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOLEAN); + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + try { + // uncomment when a bugfix or BC break has been introduced in the shell completion scripts + // $version = $input->getOption('symfony'); + // if ($version && version_compare($version, 'x.y', '>=')) { + // $message = sprintf('Completion script version is not supported ("%s" given, ">=x.y" required).', $version); + // $this->log($message); + + // $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.'); + + // return 126; + // } + + $shell = $input->getOption('shell'); + if (!$shell) { + throw new \RuntimeException('The "--shell" option must be set.'); + } + + if (!$completionOutput = $this->completionOutputs[$shell] ?? false) { + throw new \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); + } + + $completionInput = $this->createCompletionInput($input); + $suggestions = new CompletionSuggestions(); + + $this->log([ + '', + ''.date('Y-m-d H:i:s').'', + 'Input: ("|" indicates the cursor position)', + ' '.(string) $completionInput, + 'Command:', + ' '.(string) implode(' ', $_SERVER['argv']), + 'Messages:', + ]); + + $command = $this->findCommand($completionInput, $output); + if (null === $command) { + $this->log(' No command found, completing using the Application class.'); + + $this->getApplication()->complete($completionInput, $suggestions); + } elseif ( + $completionInput->mustSuggestArgumentValuesFor('command') + && $command->getName() !== $completionInput->getCompletionValue() + && !\in_array($completionInput->getCompletionValue(), $command->getAliases(), true) + ) { + $this->log(' No command found, completing using the Application class.'); + + // expand shortcut names ("cache:cl") into their full name ("cache:clear") + $suggestions->suggestValues(array_filter(array_merge([$command->getName()], $command->getAliases()))); + } else { + $command->mergeApplicationDefinition(); + $completionInput->bind($command->getDefinition()); + + if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { + $this->log(' Completing option names for the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' command.'); + + $suggestions->suggestOptions($command->getDefinition()->getOptions()); + } else { + $this->log([ + ' Completing using the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' class.', + ' Completing '.$completionInput->getCompletionType().' for '.$completionInput->getCompletionName().'', + ]); + if (null !== $compval = $completionInput->getCompletionValue()) { + $this->log(' Current value: '.$compval.''); + } + + $command->complete($completionInput, $suggestions); + } + } + + /** @var CompletionOutputInterface $completionOutput */ + $completionOutput = new $completionOutput(); + + $this->log('Suggestions:'); + if ($options = $suggestions->getOptionSuggestions()) { + $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options))); + } elseif ($values = $suggestions->getValueSuggestions()) { + $this->log(' '.implode(' ', $values)); + } else { + $this->log(' No suggestions were provided'); + } + + $completionOutput->write($suggestions, $output); + } catch (\Throwable $e) { + $this->log([ + 'Error!', + (string) $e, + ]); + + if ($output->isDebug()) { + throw $e; + } + + return 2; + } + + return 0; + } + + private function createCompletionInput(InputInterface $input): CompletionInput + { + $currentIndex = $input->getOption('current'); + if (!$currentIndex || !ctype_digit($currentIndex)) { + throw new \RuntimeException('The "--current" option must be set and it must be an integer.'); + } + + $completionInput = CompletionInput::fromTokens($input->getOption('input'), (int) $currentIndex); + + try { + $completionInput->bind($this->getApplication()->getDefinition()); + } catch (ExceptionInterface $e) { + } + + return $completionInput; + } + + private function findCommand(CompletionInput $completionInput, OutputInterface $output): ?Command + { + try { + $inputName = $completionInput->getFirstArgument(); + if (null === $inputName) { + return null; + } + + return $this->getApplication()->find($inputName); + } catch (CommandNotFoundException $e) { + } + + return null; + } + + private function log($messages): void + { + if (!$this->isDebug) { + return; + } + + $commandName = basename($_SERVER['argv'][0]); + file_put_contents(sys_get_temp_dir().'/sf_'.$commandName.'.log', implode(\PHP_EOL, (array) $messages).\PHP_EOL, \FILE_APPEND); + } +} diff --git a/trunk/vendor/symfony/console/Command/DumpCompletionCommand.php b/trunk/vendor/symfony/console/Command/DumpCompletionCommand.php new file mode 100644 index 00000000..eaf22be1 --- /dev/null +++ b/trunk/vendor/symfony/console/Command/DumpCompletionCommand.php @@ -0,0 +1,145 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Process\Process; + +/** + * Dumps the completion script for the current shell. + * + * @author Wouter de Jong + */ +final class DumpCompletionCommand extends Command +{ + protected static $defaultName = 'completion'; + protected static $defaultDescription = 'Dump the shell completion script'; + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('shell')) { + $suggestions->suggestValues($this->getSupportedShells()); + } + } + + protected function configure() + { + $fullCommand = $_SERVER['PHP_SELF']; + $commandName = basename($fullCommand); + $fullCommand = @realpath($fullCommand) ?: $fullCommand; + + $this + ->setHelp(<<%command.name% command dumps the shell completion script required +to use shell autocompletion (currently only bash completion is supported). + +Static installation +------------------- + +Dump the script to a global completion file and restart your shell: + + %command.full_name% bash | sudo tee /etc/bash_completion.d/{$commandName} + +Or dump the script to a local file and source it: + + %command.full_name% bash > completion.sh + + # source the file whenever you use the project + source completion.sh + + # or add this line at the end of your "~/.bashrc" file: + source /path/to/completion.sh + +Dynamic installation +-------------------- + +Add this to the end of your shell configuration file (e.g. "~/.bashrc"): + + eval "$({$fullCommand} completion bash)" +EOH + ) + ->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given') + ->addOption('debug', null, InputOption::VALUE_NONE, 'Tail the completion debug log') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $commandName = basename($_SERVER['argv'][0]); + + if ($input->getOption('debug')) { + $this->tailDebugLog($commandName, $output); + + return 0; + } + + $shell = $input->getArgument('shell') ?? self::guessShell(); + $completionFile = __DIR__.'/../Resources/completion.'.$shell; + if (!file_exists($completionFile)) { + $supportedShells = $this->getSupportedShells(); + + if ($output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + if ($shell) { + $output->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); + } else { + $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); + } + + return 2; + } + + $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, $this->getApplication()->getVersion()], file_get_contents($completionFile))); + + return 0; + } + + private static function guessShell(): string + { + return basename($_SERVER['SHELL'] ?? ''); + } + + private function tailDebugLog(string $commandName, OutputInterface $output): void + { + $debugFile = sys_get_temp_dir().'/sf_'.$commandName.'.log'; + if (!file_exists($debugFile)) { + touch($debugFile); + } + $process = new Process(['tail', '-f', $debugFile], null, null, null, 0); + $process->run(function (string $type, string $line) use ($output): void { + $output->write($line); + }); + } + + /** + * @return string[] + */ + private function getSupportedShells(): array + { + $shells = []; + + foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) { + if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) { + $shells[] = $file->getExtension(); + } + } + + return $shells; + } +} diff --git a/trunk/vendor/symfony/console/Command/HelpCommand.php b/trunk/vendor/symfony/console/Command/HelpCommand.php new file mode 100644 index 00000000..c66ef463 --- /dev/null +++ b/trunk/vendor/symfony/console/Command/HelpCommand.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Descriptor\ApplicationDescription; +use Symfony\Component\Console\Helper\DescriptorHelper; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * HelpCommand displays the help for a given command. + * + * @author Fabien Potencier + */ +class HelpCommand extends Command +{ + private $command; + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this->ignoreValidationErrors(); + + $this + ->setName('help') + ->setDefinition([ + new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), + new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), + ]) + ->setDescription('Display help for a command') + ->setHelp(<<<'EOF' +The %command.name% command displays help for a given command: + + %command.full_name% list + +You can also output the help in other formats by using the --format option: + + %command.full_name% --format=xml list + +To display the list of available commands, please use the list command. +EOF + ) + ; + } + + public function setCommand(Command $command) + { + $this->command = $command; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + if (null === $this->command) { + $this->command = $this->getApplication()->find($input->getArgument('command_name')); + } + + $helper = new DescriptorHelper(); + $helper->describe($output, $this->command, [ + 'format' => $input->getOption('format'), + 'raw_text' => $input->getOption('raw'), + ]); + + $this->command = null; + + return 0; + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('command_name')) { + $descriptor = new ApplicationDescription($this->getApplication()); + $suggestions->suggestValues(array_keys($descriptor->getCommands())); + + return; + } + + if ($input->mustSuggestOptionValuesFor('format')) { + $helper = new DescriptorHelper(); + $suggestions->suggestValues($helper->getFormats()); + } + } +} diff --git a/trunk/vendor/symfony/console/Command/LazyCommand.php b/trunk/vendor/symfony/console/Command/LazyCommand.php new file mode 100644 index 00000000..302a0809 --- /dev/null +++ b/trunk/vendor/symfony/console/Command/LazyCommand.php @@ -0,0 +1,218 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Helper\HelperSet; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author Nicolas Grekas + */ +final class LazyCommand extends Command +{ + private $command; + private $isEnabled; + + public function __construct(string $name, array $aliases, string $description, bool $isHidden, \Closure $commandFactory, ?bool $isEnabled = true) + { + $this->setName($name) + ->setAliases($aliases) + ->setHidden($isHidden) + ->setDescription($description); + + $this->command = $commandFactory; + $this->isEnabled = $isEnabled; + } + + public function ignoreValidationErrors(): void + { + $this->getCommand()->ignoreValidationErrors(); + } + + public function setApplication(?Application $application = null): void + { + if ($this->command instanceof parent) { + $this->command->setApplication($application); + } + + parent::setApplication($application); + } + + public function setHelperSet(HelperSet $helperSet): void + { + if ($this->command instanceof parent) { + $this->command->setHelperSet($helperSet); + } + + parent::setHelperSet($helperSet); + } + + public function isEnabled(): bool + { + return $this->isEnabled ?? $this->getCommand()->isEnabled(); + } + + public function run(InputInterface $input, OutputInterface $output): int + { + return $this->getCommand()->run($input, $output); + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + $this->getCommand()->complete($input, $suggestions); + } + + /** + * @return $this + */ + public function setCode(callable $code): self + { + $this->getCommand()->setCode($code); + + return $this; + } + + /** + * @internal + */ + public function mergeApplicationDefinition(bool $mergeArgs = true): void + { + $this->getCommand()->mergeApplicationDefinition($mergeArgs); + } + + /** + * @return $this + */ + public function setDefinition($definition): self + { + $this->getCommand()->setDefinition($definition); + + return $this; + } + + public function getDefinition(): InputDefinition + { + return $this->getCommand()->getDefinition(); + } + + public function getNativeDefinition(): InputDefinition + { + return $this->getCommand()->getNativeDefinition(); + } + + /** + * @return $this + */ + public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null): self + { + $this->getCommand()->addArgument($name, $mode, $description, $default); + + return $this; + } + + /** + * @return $this + */ + public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null): self + { + $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default); + + return $this; + } + + /** + * @return $this + */ + public function setProcessTitle(string $title): self + { + $this->getCommand()->setProcessTitle($title); + + return $this; + } + + /** + * @return $this + */ + public function setHelp(string $help): self + { + $this->getCommand()->setHelp($help); + + return $this; + } + + public function getHelp(): string + { + return $this->getCommand()->getHelp(); + } + + public function getProcessedHelp(): string + { + return $this->getCommand()->getProcessedHelp(); + } + + public function getSynopsis(bool $short = false): string + { + return $this->getCommand()->getSynopsis($short); + } + + /** + * @return $this + */ + public function addUsage(string $usage): self + { + $this->getCommand()->addUsage($usage); + + return $this; + } + + public function getUsages(): array + { + return $this->getCommand()->getUsages(); + } + + /** + * @return mixed + */ + public function getHelper(string $name) + { + return $this->getCommand()->getHelper($name); + } + + public function getCommand(): parent + { + if (!$this->command instanceof \Closure) { + return $this->command; + } + + $command = $this->command = ($this->command)(); + $command->setApplication($this->getApplication()); + + if (null !== $this->getHelperSet()) { + $command->setHelperSet($this->getHelperSet()); + } + + $command->setName($this->getName()) + ->setAliases($this->getAliases()) + ->setHidden($this->isHidden()) + ->setDescription($this->getDescription()); + + // Will throw if the command is not correctly initialized. + $command->getDefinition(); + + return $command; + } +} diff --git a/trunk/vendor/symfony/console/Command/ListCommand.php b/trunk/vendor/symfony/console/Command/ListCommand.php new file mode 100644 index 00000000..f04a4ef6 --- /dev/null +++ b/trunk/vendor/symfony/console/Command/ListCommand.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Descriptor\ApplicationDescription; +use Symfony\Component\Console\Helper\DescriptorHelper; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * ListCommand displays the list of all available commands for the application. + * + * @author Fabien Potencier + */ +class ListCommand extends Command +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('list') + ->setDefinition([ + new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), + new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), + new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'), + ]) + ->setDescription('List commands') + ->setHelp(<<<'EOF' +The %command.name% command lists all commands: + + %command.full_name% + +You can also display the commands for a specific namespace: + + %command.full_name% test + +You can also output the information in other formats by using the --format option: + + %command.full_name% --format=xml + +It's also possible to get raw list of commands (useful for embedding command runner): + + %command.full_name% --raw +EOF + ) + ; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $helper = new DescriptorHelper(); + $helper->describe($output, $this->getApplication(), [ + 'format' => $input->getOption('format'), + 'raw_text' => $input->getOption('raw'), + 'namespace' => $input->getArgument('namespace'), + 'short' => $input->getOption('short'), + ]); + + return 0; + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('namespace')) { + $descriptor = new ApplicationDescription($this->getApplication()); + $suggestions->suggestValues(array_keys($descriptor->getNamespaces())); + + return; + } + + if ($input->mustSuggestOptionValuesFor('format')) { + $helper = new DescriptorHelper(); + $suggestions->suggestValues($helper->getFormats()); + } + } +} diff --git a/trunk/vendor/symfony/console/Command/LockableTrait.php b/trunk/vendor/symfony/console/Command/LockableTrait.php new file mode 100644 index 00000000..d21edc2c --- /dev/null +++ b/trunk/vendor/symfony/console/Command/LockableTrait.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Exception\LogicException; +use Symfony\Component\Lock\LockFactory; +use Symfony\Component\Lock\LockInterface; +use Symfony\Component\Lock\Store\FlockStore; +use Symfony\Component\Lock\Store\SemaphoreStore; + +/** + * Basic lock feature for commands. + * + * @author Geoffrey Brier + */ +trait LockableTrait +{ + /** @var LockInterface|null */ + private $lock; + + /** + * Locks a command. + */ + private function lock(?string $name = null, bool $blocking = false): bool + { + if (!class_exists(SemaphoreStore::class)) { + throw new LogicException('To enable the locking feature you must install the symfony/lock component.'); + } + + if (null !== $this->lock) { + throw new LogicException('A lock is already in place.'); + } + + if (SemaphoreStore::isSupported()) { + $store = new SemaphoreStore(); + } else { + $store = new FlockStore(); + } + + $this->lock = (new LockFactory($store))->createLock($name ?: $this->getName()); + if (!$this->lock->acquire($blocking)) { + $this->lock = null; + + return false; + } + + return true; + } + + /** + * Releases the command lock if there is one. + */ + private function release() + { + if ($this->lock) { + $this->lock->release(); + $this->lock = null; + } + } +} diff --git a/trunk/vendor/symfony/console/Command/SignalableCommandInterface.php b/trunk/vendor/symfony/console/Command/SignalableCommandInterface.php new file mode 100644 index 00000000..d439728b --- /dev/null +++ b/trunk/vendor/symfony/console/Command/SignalableCommandInterface.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +/** + * Interface for command reacting to signal. + * + * @author Grégoire Pineau + */ +interface SignalableCommandInterface +{ + /** + * Returns the list of signals to subscribe. + */ + public function getSubscribedSignals(): array; + + /** + * The method will be called when the application is signaled. + */ + public function handleSignal(int $signal): void; +} diff --git a/trunk/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/trunk/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php new file mode 100644 index 00000000..0adaf886 --- /dev/null +++ b/trunk/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\CommandLoader; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\CommandNotFoundException; + +/** + * @author Robin Chalas + */ +interface CommandLoaderInterface +{ + /** + * Loads a command. + * + * @return Command + * + * @throws CommandNotFoundException + */ + public function get(string $name); + + /** + * Checks if a command exists. + * + * @return bool + */ + public function has(string $name); + + /** + * @return string[] + */ + public function getNames(); +} diff --git a/trunk/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/trunk/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php new file mode 100644 index 00000000..ddccb3d4 --- /dev/null +++ b/trunk/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\CommandLoader; + +use Psr\Container\ContainerInterface; +use Symfony\Component\Console\Exception\CommandNotFoundException; + +/** + * Loads commands from a PSR-11 container. + * + * @author Robin Chalas + */ +class ContainerCommandLoader implements CommandLoaderInterface +{ + private $container; + private $commandMap; + + /** + * @param array $commandMap An array with command names as keys and service ids as values + */ + public function __construct(ContainerInterface $container, array $commandMap) + { + $this->container = $container; + $this->commandMap = $commandMap; + } + + /** + * {@inheritdoc} + */ + public function get(string $name) + { + if (!$this->has($name)) { + throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + } + + return $this->container->get($this->commandMap[$name]); + } + + /** + * {@inheritdoc} + */ + public function has(string $name) + { + return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]); + } + + /** + * {@inheritdoc} + */ + public function getNames() + { + return array_keys($this->commandMap); + } +} diff --git a/trunk/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/trunk/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php new file mode 100644 index 00000000..7e2db346 --- /dev/null +++ b/trunk/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\CommandLoader; + +use Symfony\Component\Console\Exception\CommandNotFoundException; + +/** + * A simple command loader using factories to instantiate commands lazily. + * + * @author Maxime Steinhausser + */ +class FactoryCommandLoader implements CommandLoaderInterface +{ + private $factories; + + /** + * @param callable[] $factories Indexed by command names + */ + public function __construct(array $factories) + { + $this->factories = $factories; + } + + /** + * {@inheritdoc} + */ + public function has(string $name) + { + return isset($this->factories[$name]); + } + + /** + * {@inheritdoc} + */ + public function get(string $name) + { + if (!isset($this->factories[$name])) { + throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + } + + $factory = $this->factories[$name]; + + return $factory(); + } + + /** + * {@inheritdoc} + */ + public function getNames() + { + return array_keys($this->factories); + } +} diff --git a/trunk/vendor/symfony/console/Completion/CompletionInput.php b/trunk/vendor/symfony/console/Completion/CompletionInput.php new file mode 100644 index 00000000..2f631bcd --- /dev/null +++ b/trunk/vendor/symfony/console/Completion/CompletionInput.php @@ -0,0 +1,249 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion; + +use Symfony\Component\Console\Exception\RuntimeException; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * An input specialized for shell completion. + * + * This input allows unfinished option names or values and exposes what kind of + * completion is expected. + * + * @author Wouter de Jong + */ +final class CompletionInput extends ArgvInput +{ + public const TYPE_ARGUMENT_VALUE = 'argument_value'; + public const TYPE_OPTION_VALUE = 'option_value'; + public const TYPE_OPTION_NAME = 'option_name'; + public const TYPE_NONE = 'none'; + + private $tokens; + private $currentIndex; + private $completionType; + private $completionName = null; + private $completionValue = ''; + + /** + * Converts a terminal string into tokens. + * + * This is required for shell completions without COMP_WORDS support. + */ + public static function fromString(string $inputStr, int $currentIndex): self + { + preg_match_all('/(?<=^|\s)([\'"]?)(.+?)(?tokens = $tokens; + $input->currentIndex = $currentIndex; + + return $input; + } + + /** + * {@inheritdoc} + */ + public function bind(InputDefinition $definition): void + { + parent::bind($definition); + + $relevantToken = $this->getRelevantToken(); + if ('-' === $relevantToken[0]) { + // the current token is an input option: complete either option name or option value + [$optionToken, $optionValue] = explode('=', $relevantToken, 2) + ['', '']; + + $option = $this->getOptionFromToken($optionToken); + if (null === $option && !$this->isCursorFree()) { + $this->completionType = self::TYPE_OPTION_NAME; + $this->completionValue = $relevantToken; + + return; + } + + if (null !== $option && $option->acceptValue()) { + $this->completionType = self::TYPE_OPTION_VALUE; + $this->completionName = $option->getName(); + $this->completionValue = $optionValue ?: (!str_starts_with($optionToken, '--') ? substr($optionToken, 2) : ''); + + return; + } + } + + $previousToken = $this->tokens[$this->currentIndex - 1]; + if ('-' === $previousToken[0] && '' !== trim($previousToken, '-')) { + // check if previous option accepted a value + $previousOption = $this->getOptionFromToken($previousToken); + if (null !== $previousOption && $previousOption->acceptValue()) { + $this->completionType = self::TYPE_OPTION_VALUE; + $this->completionName = $previousOption->getName(); + $this->completionValue = $relevantToken; + + return; + } + } + + // complete argument value + $this->completionType = self::TYPE_ARGUMENT_VALUE; + + foreach ($this->definition->getArguments() as $argumentName => $argument) { + if (!isset($this->arguments[$argumentName])) { + break; + } + + $argumentValue = $this->arguments[$argumentName]; + $this->completionName = $argumentName; + if (\is_array($argumentValue)) { + $this->completionValue = $argumentValue ? $argumentValue[array_key_last($argumentValue)] : null; + } else { + $this->completionValue = $argumentValue; + } + } + + if ($this->currentIndex >= \count($this->tokens)) { + if (!isset($this->arguments[$argumentName]) || $this->definition->getArgument($argumentName)->isArray()) { + $this->completionName = $argumentName; + $this->completionValue = ''; + } else { + // we've reached the end + $this->completionType = self::TYPE_NONE; + $this->completionName = null; + $this->completionValue = ''; + } + } + } + + /** + * Returns the type of completion required. + * + * TYPE_ARGUMENT_VALUE when completing the value of an input argument + * TYPE_OPTION_VALUE when completing the value of an input option + * TYPE_OPTION_NAME when completing the name of an input option + * TYPE_NONE when nothing should be completed + * + * @return string One of self::TYPE_* constants. TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component + */ + public function getCompletionType(): string + { + return $this->completionType; + } + + /** + * The name of the input option or argument when completing a value. + * + * @return string|null returns null when completing an option name + */ + public function getCompletionName(): ?string + { + return $this->completionName; + } + + /** + * The value already typed by the user (or empty string). + */ + public function getCompletionValue(): string + { + return $this->completionValue; + } + + public function mustSuggestOptionValuesFor(string $optionName): bool + { + return self::TYPE_OPTION_VALUE === $this->getCompletionType() && $optionName === $this->getCompletionName(); + } + + public function mustSuggestArgumentValuesFor(string $argumentName): bool + { + return self::TYPE_ARGUMENT_VALUE === $this->getCompletionType() && $argumentName === $this->getCompletionName(); + } + + protected function parseToken(string $token, bool $parseOptions): bool + { + try { + return parent::parseToken($token, $parseOptions); + } catch (RuntimeException $e) { + // suppress errors, completed input is almost never valid + } + + return $parseOptions; + } + + private function getOptionFromToken(string $optionToken): ?InputOption + { + $optionName = ltrim($optionToken, '-'); + if (!$optionName) { + return null; + } + + if ('-' === ($optionToken[1] ?? ' ')) { + // long option name + return $this->definition->hasOption($optionName) ? $this->definition->getOption($optionName) : null; + } + + // short option name + return $this->definition->hasShortcut($optionName[0]) ? $this->definition->getOptionForShortcut($optionName[0]) : null; + } + + /** + * The token of the cursor, or the last token if the cursor is at the end of the input. + */ + private function getRelevantToken(): string + { + return $this->tokens[$this->isCursorFree() ? $this->currentIndex - 1 : $this->currentIndex]; + } + + /** + * Whether the cursor is "free" (i.e. at the end of the input preceded by a space). + */ + private function isCursorFree(): bool + { + $nrOfTokens = \count($this->tokens); + if ($this->currentIndex > $nrOfTokens) { + throw new \LogicException('Current index is invalid, it must be the number of input tokens or one more.'); + } + + return $this->currentIndex >= $nrOfTokens; + } + + public function __toString() + { + $str = ''; + foreach ($this->tokens as $i => $token) { + $str .= $token; + + if ($this->currentIndex === $i) { + $str .= '|'; + } + + $str .= ' '; + } + + if ($this->currentIndex > $i) { + $str .= '|'; + } + + return rtrim($str); + } +} diff --git a/trunk/vendor/symfony/console/Completion/CompletionSuggestions.php b/trunk/vendor/symfony/console/Completion/CompletionSuggestions.php new file mode 100644 index 00000000..d8905e5e --- /dev/null +++ b/trunk/vendor/symfony/console/Completion/CompletionSuggestions.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion; + +use Symfony\Component\Console\Input\InputOption; + +/** + * Stores all completion suggestions for the current input. + * + * @author Wouter de Jong + */ +final class CompletionSuggestions +{ + private $valueSuggestions = []; + private $optionSuggestions = []; + + /** + * Add a suggested value for an input option or argument. + * + * @param string|Suggestion $value + * + * @return $this + */ + public function suggestValue($value): self + { + $this->valueSuggestions[] = !$value instanceof Suggestion ? new Suggestion($value) : $value; + + return $this; + } + + /** + * Add multiple suggested values at once for an input option or argument. + * + * @param list $values + * + * @return $this + */ + public function suggestValues(array $values): self + { + foreach ($values as $value) { + $this->suggestValue($value); + } + + return $this; + } + + /** + * Add a suggestion for an input option name. + * + * @return $this + */ + public function suggestOption(InputOption $option): self + { + $this->optionSuggestions[] = $option; + + return $this; + } + + /** + * Add multiple suggestions for input option names at once. + * + * @param InputOption[] $options + * + * @return $this + */ + public function suggestOptions(array $options): self + { + foreach ($options as $option) { + $this->suggestOption($option); + } + + return $this; + } + + /** + * @return InputOption[] + */ + public function getOptionSuggestions(): array + { + return $this->optionSuggestions; + } + + /** + * @return Suggestion[] + */ + public function getValueSuggestions(): array + { + return $this->valueSuggestions; + } +} diff --git a/trunk/vendor/symfony/console/Completion/Output/BashCompletionOutput.php b/trunk/vendor/symfony/console/Completion/Output/BashCompletionOutput.php new file mode 100644 index 00000000..c6f76eb8 --- /dev/null +++ b/trunk/vendor/symfony/console/Completion/Output/BashCompletionOutput.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion\Output; + +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author Wouter de Jong + */ +class BashCompletionOutput implements CompletionOutputInterface +{ + public function write(CompletionSuggestions $suggestions, OutputInterface $output): void + { + $values = $suggestions->getValueSuggestions(); + foreach ($suggestions->getOptionSuggestions() as $option) { + $values[] = '--'.$option->getName(); + if ($option->isNegatable()) { + $values[] = '--no-'.$option->getName(); + } + } + $output->writeln(implode("\n", $values)); + } +} diff --git a/trunk/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php b/trunk/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php new file mode 100644 index 00000000..659e5965 --- /dev/null +++ b/trunk/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion\Output; + +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Transforms the {@see CompletionSuggestions} object into output readable by the shell completion. + * + * @author Wouter de Jong + */ +interface CompletionOutputInterface +{ + public function write(CompletionSuggestions $suggestions, OutputInterface $output): void; +} diff --git a/trunk/vendor/symfony/console/Completion/Suggestion.php b/trunk/vendor/symfony/console/Completion/Suggestion.php new file mode 100644 index 00000000..6c7bc4dc --- /dev/null +++ b/trunk/vendor/symfony/console/Completion/Suggestion.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion; + +/** + * Represents a single suggested value. + * + * @author Wouter de Jong + */ +class Suggestion +{ + private $value; + + public function __construct(string $value) + { + $this->value = $value; + } + + public function getValue(): string + { + return $this->value; + } + + public function __toString(): string + { + return $this->getValue(); + } +} diff --git a/trunk/vendor/symfony/console/ConsoleEvents.php b/trunk/vendor/symfony/console/ConsoleEvents.php new file mode 100644 index 00000000..6ae8f32b --- /dev/null +++ b/trunk/vendor/symfony/console/ConsoleEvents.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console; + +use Symfony\Component\Console\Event\ConsoleCommandEvent; +use Symfony\Component\Console\Event\ConsoleErrorEvent; +use Symfony\Component\Console\Event\ConsoleSignalEvent; +use Symfony\Component\Console\Event\ConsoleTerminateEvent; + +/** + * Contains all events dispatched by an Application. + * + * @author Francesco Levorato + */ +final class ConsoleEvents +{ + /** + * The COMMAND event allows you to attach listeners before any command is + * executed by the console. It also allows you to modify the command, input and output + * before they are handed to the command. + * + * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") + */ + public const COMMAND = 'console.command'; + + /** + * The SIGNAL event allows you to perform some actions + * after the command execution was interrupted. + * + * @Event("Symfony\Component\Console\Event\ConsoleSignalEvent") + */ + public const SIGNAL = 'console.signal'; + + /** + * The TERMINATE event allows you to attach listeners after a command is + * executed by the console. + * + * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") + */ + public const TERMINATE = 'console.terminate'; + + /** + * The ERROR event occurs when an uncaught exception or error appears. + * + * This event allows you to deal with the exception/error or + * to modify the thrown exception. + * + * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") + */ + public const ERROR = 'console.error'; + + /** + * Event aliases. + * + * These aliases can be consumed by RegisterListenersPass. + */ + public const ALIASES = [ + ConsoleCommandEvent::class => self::COMMAND, + ConsoleErrorEvent::class => self::ERROR, + ConsoleSignalEvent::class => self::SIGNAL, + ConsoleTerminateEvent::class => self::TERMINATE, + ]; +} diff --git a/trunk/vendor/symfony/console/Cursor.php b/trunk/vendor/symfony/console/Cursor.php new file mode 100644 index 00000000..0c4dafb6 --- /dev/null +++ b/trunk/vendor/symfony/console/Cursor.php @@ -0,0 +1,207 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console; + +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author Pierre du Plessis + */ +final class Cursor +{ + private $output; + private $input; + + /** + * @param resource|null $input + */ + public function __construct(OutputInterface $output, $input = null) + { + $this->output = $output; + $this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+')); + } + + /** + * @return $this + */ + public function moveUp(int $lines = 1): self + { + $this->output->write(sprintf("\x1b[%dA", $lines)); + + return $this; + } + + /** + * @return $this + */ + public function moveDown(int $lines = 1): self + { + $this->output->write(sprintf("\x1b[%dB", $lines)); + + return $this; + } + + /** + * @return $this + */ + public function moveRight(int $columns = 1): self + { + $this->output->write(sprintf("\x1b[%dC", $columns)); + + return $this; + } + + /** + * @return $this + */ + public function moveLeft(int $columns = 1): self + { + $this->output->write(sprintf("\x1b[%dD", $columns)); + + return $this; + } + + /** + * @return $this + */ + public function moveToColumn(int $column): self + { + $this->output->write(sprintf("\x1b[%dG", $column)); + + return $this; + } + + /** + * @return $this + */ + public function moveToPosition(int $column, int $row): self + { + $this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column)); + + return $this; + } + + /** + * @return $this + */ + public function savePosition(): self + { + $this->output->write("\x1b7"); + + return $this; + } + + /** + * @return $this + */ + public function restorePosition(): self + { + $this->output->write("\x1b8"); + + return $this; + } + + /** + * @return $this + */ + public function hide(): self + { + $this->output->write("\x1b[?25l"); + + return $this; + } + + /** + * @return $this + */ + public function show(): self + { + $this->output->write("\x1b[?25h\x1b[?0c"); + + return $this; + } + + /** + * Clears all the output from the current line. + * + * @return $this + */ + public function clearLine(): self + { + $this->output->write("\x1b[2K"); + + return $this; + } + + /** + * Clears all the output from the current line after the current position. + */ + public function clearLineAfter(): self + { + $this->output->write("\x1b[K"); + + return $this; + } + + /** + * Clears all the output from the cursors' current position to the end of the screen. + * + * @return $this + */ + public function clearOutput(): self + { + $this->output->write("\x1b[0J"); + + return $this; + } + + /** + * Clears the entire screen. + * + * @return $this + */ + public function clearScreen(): self + { + $this->output->write("\x1b[2J"); + + return $this; + } + + /** + * Returns the current cursor position as x,y coordinates. + */ + public function getCurrentPosition(): array + { + static $isTtySupported; + + if (null === $isTtySupported && \function_exists('proc_open')) { + $isTtySupported = (bool) @proc_open('echo 1 >/dev/null', [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']], $pipes); + } + + if (!$isTtySupported) { + return [1, 1]; + } + + $sttyMode = shell_exec('stty -g'); + shell_exec('stty -icanon -echo'); + + @fwrite($this->input, "\033[6n"); + + $code = trim(fread($this->input, 1024)); + + shell_exec(sprintf('stty %s', $sttyMode)); + + sscanf($code, "\033[%d;%dR", $row, $col); + + return [$col, $row]; + } +} diff --git a/trunk/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/trunk/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php new file mode 100644 index 00000000..1fbb212e --- /dev/null +++ b/trunk/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php @@ -0,0 +1,148 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\DependencyInjection; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Command\LazyCommand; +use Symfony\Component\Console\CommandLoader\ContainerCommandLoader; +use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\TypedReference; + +/** + * Registers console commands. + * + * @author Grégoire Pineau + */ +class AddConsoleCommandPass implements CompilerPassInterface +{ + private $commandLoaderServiceId; + private $commandTag; + private $noPreloadTag; + private $privateTagName; + + public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command', string $noPreloadTag = 'container.no_preload', string $privateTagName = 'container.private') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/console', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->commandLoaderServiceId = $commandLoaderServiceId; + $this->commandTag = $commandTag; + $this->noPreloadTag = $noPreloadTag; + $this->privateTagName = $privateTagName; + } + + public function process(ContainerBuilder $container) + { + $commandServices = $container->findTaggedServiceIds($this->commandTag, true); + $lazyCommandMap = []; + $lazyCommandRefs = []; + $serviceIds = []; + + foreach ($commandServices as $id => $tags) { + $definition = $container->getDefinition($id); + $definition->addTag($this->noPreloadTag); + $class = $container->getParameterBag()->resolveValue($definition->getClass()); + + if (isset($tags[0]['command'])) { + $aliases = $tags[0]['command']; + } else { + if (!$r = $container->getReflectionClass($class)) { + throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); + } + if (!$r->isSubclassOf(Command::class)) { + throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); + } + $aliases = str_replace('%', '%%', $class::getDefaultName() ?? ''); + } + + $aliases = explode('|', $aliases ?? ''); + $commandName = array_shift($aliases); + + if ($isHidden = '' === $commandName) { + $commandName = array_shift($aliases); + } + + if (null === $commandName) { + if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag($this->privateTagName)) { + $commandId = 'console.command.public_alias.'.$id; + $container->setAlias($commandId, $id)->setPublic(true); + $id = $commandId; + } + $serviceIds[] = $id; + + continue; + } + + $description = $tags[0]['description'] ?? null; + + unset($tags[0]); + $lazyCommandMap[$commandName] = $id; + $lazyCommandRefs[$id] = new TypedReference($id, $class); + + foreach ($aliases as $alias) { + $lazyCommandMap[$alias] = $id; + } + + foreach ($tags as $tag) { + if (isset($tag['command'])) { + $aliases[] = $tag['command']; + $lazyCommandMap[$tag['command']] = $id; + } + + $description = $description ?? $tag['description'] ?? null; + } + + $definition->addMethodCall('setName', [$commandName]); + + if ($aliases) { + $definition->addMethodCall('setAliases', [$aliases]); + } + + if ($isHidden) { + $definition->addMethodCall('setHidden', [true]); + } + + if (!$description) { + if (!$r = $container->getReflectionClass($class)) { + throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); + } + if (!$r->isSubclassOf(Command::class)) { + throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); + } + $description = str_replace('%', '%%', $class::getDefaultDescription() ?? ''); + } + + if ($description) { + $definition->addMethodCall('setDescription', [$description]); + + $container->register('.'.$id.'.lazy', LazyCommand::class) + ->setArguments([$commandName, $aliases, $description, $isHidden, new ServiceClosureArgument($lazyCommandRefs[$id])]); + + $lazyCommandRefs[$id] = new Reference('.'.$id.'.lazy'); + } + } + + $container + ->register($this->commandLoaderServiceId, ContainerCommandLoader::class) + ->setPublic(true) + ->addTag($this->noPreloadTag) + ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); + + $container->setParameter('console.command.ids', $serviceIds); + } +} diff --git a/trunk/vendor/symfony/console/Descriptor/ApplicationDescription.php b/trunk/vendor/symfony/console/Descriptor/ApplicationDescription.php new file mode 100644 index 00000000..eb11b4f9 --- /dev/null +++ b/trunk/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -0,0 +1,143 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\CommandNotFoundException; + +/** + * @author Jean-François Simon + * + * @internal + */ +class ApplicationDescription +{ + public const GLOBAL_NAMESPACE = '_global'; + + private $application; + private $namespace; + private $showHidden; + + /** + * @var array + */ + private $namespaces; + + /** + * @var array + */ + private $commands; + + /** + * @var array + */ + private $aliases; + + public function __construct(Application $application, ?string $namespace = null, bool $showHidden = false) + { + $this->application = $application; + $this->namespace = $namespace; + $this->showHidden = $showHidden; + } + + public function getNamespaces(): array + { + if (null === $this->namespaces) { + $this->inspectApplication(); + } + + return $this->namespaces; + } + + /** + * @return Command[] + */ + public function getCommands(): array + { + if (null === $this->commands) { + $this->inspectApplication(); + } + + return $this->commands; + } + + /** + * @throws CommandNotFoundException + */ + public function getCommand(string $name): Command + { + if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { + throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + } + + return $this->commands[$name] ?? $this->aliases[$name]; + } + + private function inspectApplication() + { + $this->commands = []; + $this->namespaces = []; + + $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); + foreach ($this->sortCommands($all) as $namespace => $commands) { + $names = []; + + /** @var Command $command */ + foreach ($commands as $name => $command) { + if (!$command->getName() || (!$this->showHidden && $command->isHidden())) { + continue; + } + + if ($command->getName() === $name) { + $this->commands[$name] = $command; + } else { + $this->aliases[$name] = $command; + } + + $names[] = $name; + } + + $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names]; + } + } + + private function sortCommands(array $commands): array + { + $namespacedCommands = []; + $globalCommands = []; + $sortedCommands = []; + foreach ($commands as $name => $command) { + $key = $this->application->extractNamespace($name, 1); + if (\in_array($key, ['', self::GLOBAL_NAMESPACE], true)) { + $globalCommands[$name] = $command; + } else { + $namespacedCommands[$key][$name] = $command; + } + } + + if ($globalCommands) { + ksort($globalCommands); + $sortedCommands[self::GLOBAL_NAMESPACE] = $globalCommands; + } + + if ($namespacedCommands) { + ksort($namespacedCommands, \SORT_STRING); + foreach ($namespacedCommands as $key => $commandsSet) { + ksort($commandsSet); + $sortedCommands[$key] = $commandsSet; + } + } + + return $sortedCommands; + } +} diff --git a/trunk/vendor/symfony/console/Descriptor/Descriptor.php b/trunk/vendor/symfony/console/Descriptor/Descriptor.php new file mode 100644 index 00000000..a3648301 --- /dev/null +++ b/trunk/vendor/symfony/console/Descriptor/Descriptor.php @@ -0,0 +1,94 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author Jean-François Simon + * + * @internal + */ +abstract class Descriptor implements DescriptorInterface +{ + /** + * @var OutputInterface + */ + protected $output; + + /** + * {@inheritdoc} + */ + public function describe(OutputInterface $output, object $object, array $options = []) + { + $this->output = $output; + + switch (true) { + case $object instanceof InputArgument: + $this->describeInputArgument($object, $options); + break; + case $object instanceof InputOption: + $this->describeInputOption($object, $options); + break; + case $object instanceof InputDefinition: + $this->describeInputDefinition($object, $options); + break; + case $object instanceof Command: + $this->describeCommand($object, $options); + break; + case $object instanceof Application: + $this->describeApplication($object, $options); + break; + default: + throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))); + } + } + + /** + * Writes content to output. + */ + protected function write(string $content, bool $decorated = false) + { + $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); + } + + /** + * Describes an InputArgument instance. + */ + abstract protected function describeInputArgument(InputArgument $argument, array $options = []); + + /** + * Describes an InputOption instance. + */ + abstract protected function describeInputOption(InputOption $option, array $options = []); + + /** + * Describes an InputDefinition instance. + */ + abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); + + /** + * Describes a Command instance. + */ + abstract protected function describeCommand(Command $command, array $options = []); + + /** + * Describes an Application instance. + */ + abstract protected function describeApplication(Application $application, array $options = []); +} diff --git a/trunk/vendor/symfony/console/Descriptor/DescriptorInterface.php b/trunk/vendor/symfony/console/Descriptor/DescriptorInterface.php new file mode 100644 index 00000000..ebea3036 --- /dev/null +++ b/trunk/vendor/symfony/console/Descriptor/DescriptorInterface.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Descriptor interface. + * + * @author Jean-François Simon + */ +interface DescriptorInterface +{ + public function describe(OutputInterface $output, object $object, array $options = []); +} diff --git a/trunk/vendor/symfony/console/Descriptor/JsonDescriptor.php b/trunk/vendor/symfony/console/Descriptor/JsonDescriptor.php new file mode 100644 index 00000000..1d286594 --- /dev/null +++ b/trunk/vendor/symfony/console/Descriptor/JsonDescriptor.php @@ -0,0 +1,181 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * JSON descriptor. + * + * @author Jean-François Simon + * + * @internal + */ +class JsonDescriptor extends Descriptor +{ + /** + * {@inheritdoc} + */ + protected function describeInputArgument(InputArgument $argument, array $options = []) + { + $this->writeData($this->getInputArgumentData($argument), $options); + } + + /** + * {@inheritdoc} + */ + protected function describeInputOption(InputOption $option, array $options = []) + { + $this->writeData($this->getInputOptionData($option), $options); + if ($option->isNegatable()) { + $this->writeData($this->getInputOptionData($option, true), $options); + } + } + + /** + * {@inheritdoc} + */ + protected function describeInputDefinition(InputDefinition $definition, array $options = []) + { + $this->writeData($this->getInputDefinitionData($definition), $options); + } + + /** + * {@inheritdoc} + */ + protected function describeCommand(Command $command, array $options = []) + { + $this->writeData($this->getCommandData($command, $options['short'] ?? false), $options); + } + + /** + * {@inheritdoc} + */ + protected function describeApplication(Application $application, array $options = []) + { + $describedNamespace = $options['namespace'] ?? null; + $description = new ApplicationDescription($application, $describedNamespace, true); + $commands = []; + + foreach ($description->getCommands() as $command) { + $commands[] = $this->getCommandData($command, $options['short'] ?? false); + } + + $data = []; + if ('UNKNOWN' !== $application->getName()) { + $data['application']['name'] = $application->getName(); + if ('UNKNOWN' !== $application->getVersion()) { + $data['application']['version'] = $application->getVersion(); + } + } + + $data['commands'] = $commands; + + if ($describedNamespace) { + $data['namespace'] = $describedNamespace; + } else { + $data['namespaces'] = array_values($description->getNamespaces()); + } + + $this->writeData($data, $options); + } + + /** + * Writes data as json. + */ + private function writeData(array $data, array $options) + { + $flags = $options['json_encoding'] ?? 0; + + $this->write(json_encode($data, $flags)); + } + + private function getInputArgumentData(InputArgument $argument): array + { + return [ + 'name' => $argument->getName(), + 'is_required' => $argument->isRequired(), + 'is_array' => $argument->isArray(), + 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()), + 'default' => \INF === $argument->getDefault() ? 'INF' : $argument->getDefault(), + ]; + } + + private function getInputOptionData(InputOption $option, bool $negated = false): array + { + return $negated ? [ + 'name' => '--no-'.$option->getName(), + 'shortcut' => '', + 'accept_value' => false, + 'is_value_required' => false, + 'is_multiple' => false, + 'description' => 'Negate the "--'.$option->getName().'" option', + 'default' => false, + ] : [ + 'name' => '--'.$option->getName(), + 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', + 'accept_value' => $option->acceptValue(), + 'is_value_required' => $option->isValueRequired(), + 'is_multiple' => $option->isArray(), + 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()), + 'default' => \INF === $option->getDefault() ? 'INF' : $option->getDefault(), + ]; + } + + private function getInputDefinitionData(InputDefinition $definition): array + { + $inputArguments = []; + foreach ($definition->getArguments() as $name => $argument) { + $inputArguments[$name] = $this->getInputArgumentData($argument); + } + + $inputOptions = []; + foreach ($definition->getOptions() as $name => $option) { + $inputOptions[$name] = $this->getInputOptionData($option); + if ($option->isNegatable()) { + $inputOptions['no-'.$name] = $this->getInputOptionData($option, true); + } + } + + return ['arguments' => $inputArguments, 'options' => $inputOptions]; + } + + private function getCommandData(Command $command, bool $short = false): array + { + $data = [ + 'name' => $command->getName(), + 'description' => $command->getDescription(), + ]; + + if ($short) { + $data += [ + 'usage' => $command->getAliases(), + ]; + } else { + $command->mergeApplicationDefinition(false); + + $data += [ + 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), + 'help' => $command->getProcessedHelp(), + 'definition' => $this->getInputDefinitionData($command->getDefinition()), + ]; + } + + $data['hidden'] = $command->isHidden(); + + return $data; + } +} diff --git a/trunk/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/trunk/vendor/symfony/console/Descriptor/MarkdownDescriptor.php new file mode 100644 index 00000000..21ceca6c --- /dev/null +++ b/trunk/vendor/symfony/console/Descriptor/MarkdownDescriptor.php @@ -0,0 +1,206 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Markdown descriptor. + * + * @author Jean-François Simon + * + * @internal + */ +class MarkdownDescriptor extends Descriptor +{ + /** + * {@inheritdoc} + */ + public function describe(OutputInterface $output, object $object, array $options = []) + { + $decorated = $output->isDecorated(); + $output->setDecorated(false); + + parent::describe($output, $object, $options); + + $output->setDecorated($decorated); + } + + /** + * {@inheritdoc} + */ + protected function write(string $content, bool $decorated = true) + { + parent::write($content, $decorated); + } + + /** + * {@inheritdoc} + */ + protected function describeInputArgument(InputArgument $argument, array $options = []) + { + $this->write( + '#### `'.($argument->getName() ?: '')."`\n\n" + .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '') + .'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n" + .'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n" + .'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`' + ); + } + + /** + * {@inheritdoc} + */ + protected function describeInputOption(InputOption $option, array $options = []) + { + $name = '--'.$option->getName(); + if ($option->isNegatable()) { + $name .= '|--no-'.$option->getName(); + } + if ($option->getShortcut()) { + $name .= '|-'.str_replace('|', '|-', $option->getShortcut()).''; + } + + $this->write( + '#### `'.$name.'`'."\n\n" + .($option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $option->getDescription())."\n\n" : '') + .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n" + .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n" + .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n" + .'* Is negatable: '.($option->isNegatable() ? 'yes' : 'no')."\n" + .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`' + ); + } + + /** + * {@inheritdoc} + */ + protected function describeInputDefinition(InputDefinition $definition, array $options = []) + { + if ($showArguments = \count($definition->getArguments()) > 0) { + $this->write('### Arguments'); + foreach ($definition->getArguments() as $argument) { + $this->write("\n\n"); + if (null !== $describeInputArgument = $this->describeInputArgument($argument)) { + $this->write($describeInputArgument); + } + } + } + + if (\count($definition->getOptions()) > 0) { + if ($showArguments) { + $this->write("\n\n"); + } + + $this->write('### Options'); + foreach ($definition->getOptions() as $option) { + $this->write("\n\n"); + if (null !== $describeInputOption = $this->describeInputOption($option)) { + $this->write($describeInputOption); + } + } + } + } + + /** + * {@inheritdoc} + */ + protected function describeCommand(Command $command, array $options = []) + { + if ($options['short'] ?? false) { + $this->write( + '`'.$command->getName()."`\n" + .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" + .($command->getDescription() ? $command->getDescription()."\n\n" : '') + .'### Usage'."\n\n" + .array_reduce($command->getAliases(), function ($carry, $usage) { + return $carry.'* `'.$usage.'`'."\n"; + }) + ); + + return; + } + + $command->mergeApplicationDefinition(false); + + $this->write( + '`'.$command->getName()."`\n" + .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" + .($command->getDescription() ? $command->getDescription()."\n\n" : '') + .'### Usage'."\n\n" + .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { + return $carry.'* `'.$usage.'`'."\n"; + }) + ); + + if ($help = $command->getProcessedHelp()) { + $this->write("\n"); + $this->write($help); + } + + $definition = $command->getDefinition(); + if ($definition->getOptions() || $definition->getArguments()) { + $this->write("\n\n"); + $this->describeInputDefinition($definition); + } + } + + /** + * {@inheritdoc} + */ + protected function describeApplication(Application $application, array $options = []) + { + $describedNamespace = $options['namespace'] ?? null; + $description = new ApplicationDescription($application, $describedNamespace); + $title = $this->getApplicationTitle($application); + + $this->write($title."\n".str_repeat('=', Helper::width($title))); + + foreach ($description->getNamespaces() as $namespace) { + if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { + $this->write("\n\n"); + $this->write('**'.$namespace['id'].':**'); + } + + $this->write("\n\n"); + $this->write(implode("\n", array_map(function ($commandName) use ($description) { + return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())); + }, $namespace['commands']))); + } + + foreach ($description->getCommands() as $command) { + $this->write("\n\n"); + if (null !== $describeCommand = $this->describeCommand($command, $options)) { + $this->write($describeCommand); + } + } + } + + private function getApplicationTitle(Application $application): string + { + if ('UNKNOWN' !== $application->getName()) { + if ('UNKNOWN' !== $application->getVersion()) { + return sprintf('%s %s', $application->getName(), $application->getVersion()); + } + + return $application->getName(); + } + + return 'Console Tool'; + } +} diff --git a/trunk/vendor/symfony/console/Descriptor/TextDescriptor.php b/trunk/vendor/symfony/console/Descriptor/TextDescriptor.php new file mode 100644 index 00000000..fbb140ae --- /dev/null +++ b/trunk/vendor/symfony/console/Descriptor/TextDescriptor.php @@ -0,0 +1,341 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * Text descriptor. + * + * @author Jean-François Simon + * + * @internal + */ +class TextDescriptor extends Descriptor +{ + /** + * {@inheritdoc} + */ + protected function describeInputArgument(InputArgument $argument, array $options = []) + { + if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { + $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); + } else { + $default = ''; + } + + $totalWidth = $options['total_width'] ?? Helper::width($argument->getName()); + $spacingWidth = $totalWidth - \strlen($argument->getName()); + + $this->writeText(sprintf(' %s %s%s%s', + $argument->getName(), + str_repeat(' ', $spacingWidth), + // + 4 = 2 spaces before , 2 spaces after + preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $argument->getDescription()), + $default + ), $options); + } + + /** + * {@inheritdoc} + */ + protected function describeInputOption(InputOption $option, array $options = []) + { + if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { + $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); + } else { + $default = ''; + } + + $value = ''; + if ($option->acceptValue()) { + $value = '='.strtoupper($option->getName()); + + if ($option->isValueOptional()) { + $value = '['.$value.']'; + } + } + + $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); + $synopsis = sprintf('%s%s', + $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', + sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) + ); + + $spacingWidth = $totalWidth - Helper::width($synopsis); + + $this->writeText(sprintf(' %s %s%s%s%s', + $synopsis, + str_repeat(' ', $spacingWidth), + // + 4 = 2 spaces before , 2 spaces after + preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $option->getDescription()), + $default, + $option->isArray() ? ' (multiple values allowed)' : '' + ), $options); + } + + /** + * {@inheritdoc} + */ + protected function describeInputDefinition(InputDefinition $definition, array $options = []) + { + $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); + foreach ($definition->getArguments() as $argument) { + $totalWidth = max($totalWidth, Helper::width($argument->getName())); + } + + if ($definition->getArguments()) { + $this->writeText('Arguments:', $options); + $this->writeText("\n"); + foreach ($definition->getArguments() as $argument) { + $this->describeInputArgument($argument, array_merge($options, ['total_width' => $totalWidth])); + $this->writeText("\n"); + } + } + + if ($definition->getArguments() && $definition->getOptions()) { + $this->writeText("\n"); + } + + if ($definition->getOptions()) { + $laterOptions = []; + + $this->writeText('Options:', $options); + foreach ($definition->getOptions() as $option) { + if (\strlen($option->getShortcut() ?? '') > 1) { + $laterOptions[] = $option; + continue; + } + $this->writeText("\n"); + $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); + } + foreach ($laterOptions as $option) { + $this->writeText("\n"); + $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); + } + } + } + + /** + * {@inheritdoc} + */ + protected function describeCommand(Command $command, array $options = []) + { + $command->mergeApplicationDefinition(false); + + if ($description = $command->getDescription()) { + $this->writeText('Description:', $options); + $this->writeText("\n"); + $this->writeText(' '.$description); + $this->writeText("\n\n"); + } + + $this->writeText('Usage:', $options); + foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) { + $this->writeText("\n"); + $this->writeText(' '.OutputFormatter::escape($usage), $options); + } + $this->writeText("\n"); + + $definition = $command->getDefinition(); + if ($definition->getOptions() || $definition->getArguments()) { + $this->writeText("\n"); + $this->describeInputDefinition($definition, $options); + $this->writeText("\n"); + } + + $help = $command->getProcessedHelp(); + if ($help && $help !== $description) { + $this->writeText("\n"); + $this->writeText('Help:', $options); + $this->writeText("\n"); + $this->writeText(' '.str_replace("\n", "\n ", $help), $options); + $this->writeText("\n"); + } + } + + /** + * {@inheritdoc} + */ + protected function describeApplication(Application $application, array $options = []) + { + $describedNamespace = $options['namespace'] ?? null; + $description = new ApplicationDescription($application, $describedNamespace); + + if (isset($options['raw_text']) && $options['raw_text']) { + $width = $this->getColumnWidth($description->getCommands()); + + foreach ($description->getCommands() as $command) { + $this->writeText(sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); + $this->writeText("\n"); + } + } else { + if ('' != $help = $application->getHelp()) { + $this->writeText("$help\n\n", $options); + } + + $this->writeText("Usage:\n", $options); + $this->writeText(" command [options] [arguments]\n\n", $options); + + $this->describeInputDefinition(new InputDefinition($application->getDefinition()->getOptions()), $options); + + $this->writeText("\n"); + $this->writeText("\n"); + + $commands = $description->getCommands(); + $namespaces = $description->getNamespaces(); + if ($describedNamespace && $namespaces) { + // make sure all alias commands are included when describing a specific namespace + $describedNamespaceInfo = reset($namespaces); + foreach ($describedNamespaceInfo['commands'] as $name) { + $commands[$name] = $description->getCommand($name); + } + } + + // calculate max. width based on available commands per namespace + $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) { + return array_intersect($namespace['commands'], array_keys($commands)); + }, array_values($namespaces))))); + + if ($describedNamespace) { + $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); + } else { + $this->writeText('Available commands:', $options); + } + + foreach ($namespaces as $namespace) { + $namespace['commands'] = array_filter($namespace['commands'], function ($name) use ($commands) { + return isset($commands[$name]); + }); + + if (!$namespace['commands']) { + continue; + } + + if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { + $this->writeText("\n"); + $this->writeText(' '.$namespace['id'].'', $options); + } + + foreach ($namespace['commands'] as $name) { + $this->writeText("\n"); + $spacingWidth = $width - Helper::width($name); + $command = $commands[$name]; + $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : ''; + $this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); + } + } + + $this->writeText("\n"); + } + } + + /** + * {@inheritdoc} + */ + private function writeText(string $content, array $options = []) + { + $this->write( + isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, + isset($options['raw_output']) ? !$options['raw_output'] : true + ); + } + + /** + * Formats command aliases to show them in the command description. + */ + private function getCommandAliasesText(Command $command): string + { + $text = ''; + $aliases = $command->getAliases(); + + if ($aliases) { + $text = '['.implode('|', $aliases).'] '; + } + + return $text; + } + + /** + * Formats input option/argument default value. + * + * @param mixed $default + */ + private function formatDefaultValue($default): string + { + if (\INF === $default) { + return 'INF'; + } + + if (\is_string($default)) { + $default = OutputFormatter::escape($default); + } elseif (\is_array($default)) { + foreach ($default as $key => $value) { + if (\is_string($value)) { + $default[$key] = OutputFormatter::escape($value); + } + } + } + + return str_replace('\\\\', '\\', json_encode($default, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)); + } + + /** + * @param array $commands + */ + private function getColumnWidth(array $commands): int + { + $widths = []; + + foreach ($commands as $command) { + if ($command instanceof Command) { + $widths[] = Helper::width($command->getName()); + foreach ($command->getAliases() as $alias) { + $widths[] = Helper::width($alias); + } + } else { + $widths[] = Helper::width($command); + } + } + + return $widths ? max($widths) + 2 : 0; + } + + /** + * @param InputOption[] $options + */ + private function calculateTotalWidthForOptions(array $options): int + { + $totalWidth = 0; + foreach ($options as $option) { + // "-" + shortcut + ", --" + name + $nameLength = 1 + max(Helper::width($option->getShortcut()), 1) + 4 + Helper::width($option->getName()); + if ($option->isNegatable()) { + $nameLength += 6 + Helper::width($option->getName()); // |--no- + name + } elseif ($option->acceptValue()) { + $valueLength = 1 + Helper::width($option->getName()); // = + value + $valueLength += $option->isValueOptional() ? 2 : 0; // [ + ] + + $nameLength += $valueLength; + } + $totalWidth = max($totalWidth, $nameLength); + } + + return $totalWidth; + } +} diff --git a/trunk/vendor/symfony/console/Descriptor/XmlDescriptor.php b/trunk/vendor/symfony/console/Descriptor/XmlDescriptor.php new file mode 100644 index 00000000..f17e5f1f --- /dev/null +++ b/trunk/vendor/symfony/console/Descriptor/XmlDescriptor.php @@ -0,0 +1,247 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Descriptor; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * XML descriptor. + * + * @author Jean-François Simon + * + * @internal + */ +class XmlDescriptor extends Descriptor +{ + public function getInputDefinitionDocument(InputDefinition $definition): \DOMDocument + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + $dom->appendChild($definitionXML = $dom->createElement('definition')); + + $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments')); + foreach ($definition->getArguments() as $argument) { + $this->appendDocument($argumentsXML, $this->getInputArgumentDocument($argument)); + } + + $definitionXML->appendChild($optionsXML = $dom->createElement('options')); + foreach ($definition->getOptions() as $option) { + $this->appendDocument($optionsXML, $this->getInputOptionDocument($option)); + } + + return $dom; + } + + public function getCommandDocument(Command $command, bool $short = false): \DOMDocument + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + $dom->appendChild($commandXML = $dom->createElement('command')); + + $commandXML->setAttribute('id', $command->getName()); + $commandXML->setAttribute('name', $command->getName()); + $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0); + + $commandXML->appendChild($usagesXML = $dom->createElement('usages')); + + $commandXML->appendChild($descriptionXML = $dom->createElement('description')); + $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription()))); + + if ($short) { + foreach ($command->getAliases() as $usage) { + $usagesXML->appendChild($dom->createElement('usage', $usage)); + } + } else { + $command->mergeApplicationDefinition(false); + + foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) { + $usagesXML->appendChild($dom->createElement('usage', $usage)); + } + + $commandXML->appendChild($helpXML = $dom->createElement('help')); + $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp()))); + + $definitionXML = $this->getInputDefinitionDocument($command->getDefinition()); + $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0)); + } + + return $dom; + } + + public function getApplicationDocument(Application $application, ?string $namespace = null, bool $short = false): \DOMDocument + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + $dom->appendChild($rootXml = $dom->createElement('symfony')); + + if ('UNKNOWN' !== $application->getName()) { + $rootXml->setAttribute('name', $application->getName()); + if ('UNKNOWN' !== $application->getVersion()) { + $rootXml->setAttribute('version', $application->getVersion()); + } + } + + $rootXml->appendChild($commandsXML = $dom->createElement('commands')); + + $description = new ApplicationDescription($application, $namespace, true); + + if ($namespace) { + $commandsXML->setAttribute('namespace', $namespace); + } + + foreach ($description->getCommands() as $command) { + $this->appendDocument($commandsXML, $this->getCommandDocument($command, $short)); + } + + if (!$namespace) { + $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces')); + + foreach ($description->getNamespaces() as $namespaceDescription) { + $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace')); + $namespaceArrayXML->setAttribute('id', $namespaceDescription['id']); + + foreach ($namespaceDescription['commands'] as $name) { + $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command')); + $commandXML->appendChild($dom->createTextNode($name)); + } + } + } + + return $dom; + } + + /** + * {@inheritdoc} + */ + protected function describeInputArgument(InputArgument $argument, array $options = []) + { + $this->writeDocument($this->getInputArgumentDocument($argument)); + } + + /** + * {@inheritdoc} + */ + protected function describeInputOption(InputOption $option, array $options = []) + { + $this->writeDocument($this->getInputOptionDocument($option)); + } + + /** + * {@inheritdoc} + */ + protected function describeInputDefinition(InputDefinition $definition, array $options = []) + { + $this->writeDocument($this->getInputDefinitionDocument($definition)); + } + + /** + * {@inheritdoc} + */ + protected function describeCommand(Command $command, array $options = []) + { + $this->writeDocument($this->getCommandDocument($command, $options['short'] ?? false)); + } + + /** + * {@inheritdoc} + */ + protected function describeApplication(Application $application, array $options = []) + { + $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null, $options['short'] ?? false)); + } + + /** + * Appends document children to parent node. + */ + private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) + { + foreach ($importedParent->childNodes as $childNode) { + $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); + } + } + + /** + * Writes DOM document. + */ + private function writeDocument(\DOMDocument $dom) + { + $dom->formatOutput = true; + $this->write($dom->saveXML()); + } + + private function getInputArgumentDocument(InputArgument $argument): \DOMDocument + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + + $dom->appendChild($objectXML = $dom->createElement('argument')); + $objectXML->setAttribute('name', $argument->getName()); + $objectXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0); + $objectXML->setAttribute('is_array', $argument->isArray() ? 1 : 0); + $objectXML->appendChild($descriptionXML = $dom->createElement('description')); + $descriptionXML->appendChild($dom->createTextNode($argument->getDescription())); + + $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); + $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? [var_export($argument->getDefault(), true)] : ($argument->getDefault() ? [$argument->getDefault()] : [])); + foreach ($defaults as $default) { + $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); + $defaultXML->appendChild($dom->createTextNode($default)); + } + + return $dom; + } + + private function getInputOptionDocument(InputOption $option): \DOMDocument + { + $dom = new \DOMDocument('1.0', 'UTF-8'); + + $dom->appendChild($objectXML = $dom->createElement('option')); + $objectXML->setAttribute('name', '--'.$option->getName()); + $pos = strpos($option->getShortcut() ?? '', '|'); + if (false !== $pos) { + $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); + $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut())); + } else { + $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); + } + $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); + $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); + $objectXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0); + $objectXML->appendChild($descriptionXML = $dom->createElement('description')); + $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); + + if ($option->acceptValue()) { + $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [var_export($option->getDefault(), true)] : ($option->getDefault() ? [$option->getDefault()] : [])); + $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); + + if (!empty($defaults)) { + foreach ($defaults as $default) { + $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); + $defaultXML->appendChild($dom->createTextNode($default)); + } + } + } + + if ($option->isNegatable()) { + $dom->appendChild($objectXML = $dom->createElement('option')); + $objectXML->setAttribute('name', '--no-'.$option->getName()); + $objectXML->setAttribute('shortcut', ''); + $objectXML->setAttribute('accept_value', 0); + $objectXML->setAttribute('is_value_required', 0); + $objectXML->setAttribute('is_multiple', 0); + $objectXML->appendChild($descriptionXML = $dom->createElement('description')); + $descriptionXML->appendChild($dom->createTextNode('Negate the "--'.$option->getName().'" option')); + } + + return $dom; + } +} diff --git a/trunk/vendor/symfony/console/Event/ConsoleCommandEvent.php b/trunk/vendor/symfony/console/Event/ConsoleCommandEvent.php new file mode 100644 index 00000000..1b4f9f9b --- /dev/null +++ b/trunk/vendor/symfony/console/Event/ConsoleCommandEvent.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +/** + * Allows to do things before the command is executed, like skipping the command or executing code before the command is + * going to be executed. + * + * Changing the input arguments will have no effect. + * + * @author Fabien Potencier + */ +final class ConsoleCommandEvent extends ConsoleEvent +{ + /** + * The return code for skipped commands, this will also be passed into the terminate event. + */ + public const RETURN_CODE_DISABLED = 113; + + /** + * Indicates if the command should be run or skipped. + */ + private $commandShouldRun = true; + + /** + * Disables the command, so it won't be run. + */ + public function disableCommand(): bool + { + return $this->commandShouldRun = false; + } + + public function enableCommand(): bool + { + return $this->commandShouldRun = true; + } + + /** + * Returns true if the command is runnable, false otherwise. + */ + public function commandShouldRun(): bool + { + return $this->commandShouldRun; + } +} diff --git a/trunk/vendor/symfony/console/Event/ConsoleErrorEvent.php b/trunk/vendor/symfony/console/Event/ConsoleErrorEvent.php new file mode 100644 index 00000000..d4c26493 --- /dev/null +++ b/trunk/vendor/symfony/console/Event/ConsoleErrorEvent.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Allows to handle throwables thrown while running a command. + * + * @author Wouter de Jong + */ +final class ConsoleErrorEvent extends ConsoleEvent +{ + private $error; + private $exitCode; + + public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, ?Command $command = null) + { + parent::__construct($command, $input, $output); + + $this->error = $error; + } + + public function getError(): \Throwable + { + return $this->error; + } + + public function setError(\Throwable $error): void + { + $this->error = $error; + } + + public function setExitCode(int $exitCode): void + { + $this->exitCode = $exitCode; + + $r = new \ReflectionProperty($this->error, 'code'); + $r->setAccessible(true); + $r->setValue($this->error, $this->exitCode); + } + + public function getExitCode(): int + { + return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); + } +} diff --git a/trunk/vendor/symfony/console/Event/ConsoleEvent.php b/trunk/vendor/symfony/console/Event/ConsoleEvent.php new file mode 100644 index 00000000..be7937d5 --- /dev/null +++ b/trunk/vendor/symfony/console/Event/ConsoleEvent.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Contracts\EventDispatcher\Event; + +/** + * Allows to inspect input and output of a command. + * + * @author Francesco Levorato + */ +class ConsoleEvent extends Event +{ + protected $command; + + private $input; + private $output; + + public function __construct(?Command $command, InputInterface $input, OutputInterface $output) + { + $this->command = $command; + $this->input = $input; + $this->output = $output; + } + + /** + * Gets the command that is executed. + * + * @return Command|null + */ + public function getCommand() + { + return $this->command; + } + + /** + * Gets the input instance. + * + * @return InputInterface + */ + public function getInput() + { + return $this->input; + } + + /** + * Gets the output instance. + * + * @return OutputInterface + */ + public function getOutput() + { + return $this->output; + } +} diff --git a/trunk/vendor/symfony/console/Event/ConsoleSignalEvent.php b/trunk/vendor/symfony/console/Event/ConsoleSignalEvent.php new file mode 100644 index 00000000..ef13ed2f --- /dev/null +++ b/trunk/vendor/symfony/console/Event/ConsoleSignalEvent.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author marie + */ +final class ConsoleSignalEvent extends ConsoleEvent +{ + private $handlingSignal; + + public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) + { + parent::__construct($command, $input, $output); + $this->handlingSignal = $handlingSignal; + } + + public function getHandlingSignal(): int + { + return $this->handlingSignal; + } +} diff --git a/trunk/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/trunk/vendor/symfony/console/Event/ConsoleTerminateEvent.php new file mode 100644 index 00000000..190038d1 --- /dev/null +++ b/trunk/vendor/symfony/console/Event/ConsoleTerminateEvent.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Event; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Allows to manipulate the exit code of a command after its execution. + * + * @author Francesco Levorato + */ +final class ConsoleTerminateEvent extends ConsoleEvent +{ + private $exitCode; + + public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) + { + parent::__construct($command, $input, $output); + + $this->setExitCode($exitCode); + } + + public function setExitCode(int $exitCode): void + { + $this->exitCode = $exitCode; + } + + public function getExitCode(): int + { + return $this->exitCode; + } +} diff --git a/trunk/vendor/symfony/console/EventListener/ErrorListener.php b/trunk/vendor/symfony/console/EventListener/ErrorListener.php new file mode 100644 index 00000000..e9c9e3ea --- /dev/null +++ b/trunk/vendor/symfony/console/EventListener/ErrorListener.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\EventListener; + +use Psr\Log\LoggerInterface; +use Symfony\Component\Console\ConsoleEvents; +use Symfony\Component\Console\Event\ConsoleErrorEvent; +use Symfony\Component\Console\Event\ConsoleEvent; +use Symfony\Component\Console\Event\ConsoleTerminateEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * @author James Halsall + * @author Robin Chalas + */ +class ErrorListener implements EventSubscriberInterface +{ + private $logger; + + public function __construct(?LoggerInterface $logger = null) + { + $this->logger = $logger; + } + + public function onConsoleError(ConsoleErrorEvent $event) + { + if (null === $this->logger) { + return; + } + + $error = $event->getError(); + + if (!$inputString = $this->getInputString($event)) { + $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); + + return; + } + + $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); + } + + public function onConsoleTerminate(ConsoleTerminateEvent $event) + { + if (null === $this->logger) { + return; + } + + $exitCode = $event->getExitCode(); + + if (0 === $exitCode) { + return; + } + + if (!$inputString = $this->getInputString($event)) { + $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); + + return; + } + + $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); + } + + public static function getSubscribedEvents() + { + return [ + ConsoleEvents::ERROR => ['onConsoleError', -128], + ConsoleEvents::TERMINATE => ['onConsoleTerminate', -128], + ]; + } + + private static function getInputString(ConsoleEvent $event): ?string + { + $commandName = $event->getCommand() ? $event->getCommand()->getName() : null; + $input = $event->getInput(); + + if (method_exists($input, '__toString')) { + if ($commandName) { + return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input); + } + + return (string) $input; + } + + return $commandName; + } +} diff --git a/trunk/vendor/symfony/console/Exception/CommandNotFoundException.php b/trunk/vendor/symfony/console/Exception/CommandNotFoundException.php new file mode 100644 index 00000000..81ec318a --- /dev/null +++ b/trunk/vendor/symfony/console/Exception/CommandNotFoundException.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * Represents an incorrect command name typed in the console. + * + * @author Jérôme Tamarelle + */ +class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface +{ + private $alternatives; + + /** + * @param string $message Exception message to throw + * @param string[] $alternatives List of similar defined names + * @param int $code Exception code + * @param \Throwable|null $previous Previous exception used for the exception chaining + */ + public function __construct(string $message, array $alternatives = [], int $code = 0, ?\Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + + $this->alternatives = $alternatives; + } + + /** + * @return string[] + */ + public function getAlternatives() + { + return $this->alternatives; + } +} diff --git a/trunk/vendor/symfony/console/Exception/ExceptionInterface.php b/trunk/vendor/symfony/console/Exception/ExceptionInterface.php new file mode 100644 index 00000000..1624e13d --- /dev/null +++ b/trunk/vendor/symfony/console/Exception/ExceptionInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * ExceptionInterface. + * + * @author Jérôme Tamarelle + */ +interface ExceptionInterface extends \Throwable +{ +} diff --git a/trunk/vendor/symfony/console/Exception/InvalidArgumentException.php b/trunk/vendor/symfony/console/Exception/InvalidArgumentException.php new file mode 100644 index 00000000..07cc0b61 --- /dev/null +++ b/trunk/vendor/symfony/console/Exception/InvalidArgumentException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * @author Jérôme Tamarelle + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/trunk/vendor/symfony/console/Exception/InvalidOptionException.php b/trunk/vendor/symfony/console/Exception/InvalidOptionException.php new file mode 100644 index 00000000..5cf62792 --- /dev/null +++ b/trunk/vendor/symfony/console/Exception/InvalidOptionException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * Represents an incorrect option name or value typed in the console. + * + * @author Jérôme Tamarelle + */ +class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/trunk/vendor/symfony/console/Exception/LogicException.php b/trunk/vendor/symfony/console/Exception/LogicException.php new file mode 100644 index 00000000..fc37b8d8 --- /dev/null +++ b/trunk/vendor/symfony/console/Exception/LogicException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * @author Jérôme Tamarelle + */ +class LogicException extends \LogicException implements ExceptionInterface +{ +} diff --git a/trunk/vendor/symfony/console/Exception/MissingInputException.php b/trunk/vendor/symfony/console/Exception/MissingInputException.php new file mode 100644 index 00000000..04f02ade --- /dev/null +++ b/trunk/vendor/symfony/console/Exception/MissingInputException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * Represents failure to read input from stdin. + * + * @author Gabriel Ostrolucký + */ +class MissingInputException extends RuntimeException implements ExceptionInterface +{ +} diff --git a/trunk/vendor/symfony/console/Exception/NamespaceNotFoundException.php b/trunk/vendor/symfony/console/Exception/NamespaceNotFoundException.php new file mode 100644 index 00000000..dd16e450 --- /dev/null +++ b/trunk/vendor/symfony/console/Exception/NamespaceNotFoundException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * Represents an incorrect namespace typed in the console. + * + * @author Pierre du Plessis + */ +class NamespaceNotFoundException extends CommandNotFoundException +{ +} diff --git a/trunk/vendor/symfony/console/Exception/RuntimeException.php b/trunk/vendor/symfony/console/Exception/RuntimeException.php new file mode 100644 index 00000000..51d7d80a --- /dev/null +++ b/trunk/vendor/symfony/console/Exception/RuntimeException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * @author Jérôme Tamarelle + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/trunk/vendor/symfony/console/Formatter/NullOutputFormatter.php b/trunk/vendor/symfony/console/Formatter/NullOutputFormatter.php new file mode 100644 index 00000000..d770e146 --- /dev/null +++ b/trunk/vendor/symfony/console/Formatter/NullOutputFormatter.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * @author Tien Xuan Vo + */ +final class NullOutputFormatter implements OutputFormatterInterface +{ + private $style; + + /** + * {@inheritdoc} + */ + public function format(?string $message): ?string + { + return null; + } + + /** + * {@inheritdoc} + */ + public function getStyle(string $name): OutputFormatterStyleInterface + { + // to comply with the interface we must return a OutputFormatterStyleInterface + return $this->style ?? $this->style = new NullOutputFormatterStyle(); + } + + /** + * {@inheritdoc} + */ + public function hasStyle(string $name): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isDecorated(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function setDecorated(bool $decorated): void + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function setStyle(string $name, OutputFormatterStyleInterface $style): void + { + // do nothing + } +} diff --git a/trunk/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/trunk/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php new file mode 100644 index 00000000..afd3d004 --- /dev/null +++ b/trunk/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * @author Tien Xuan Vo + */ +final class NullOutputFormatterStyle implements OutputFormatterStyleInterface +{ + /** + * {@inheritdoc} + */ + public function apply(string $text): string + { + return $text; + } + + /** + * {@inheritdoc} + */ + public function setBackground(?string $color = null): void + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function setForeground(?string $color = null): void + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function setOption(string $option): void + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function setOptions(array $options): void + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function unsetOption(string $option): void + { + // do nothing + } +} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatter.php b/trunk/vendor/symfony/console/Formatter/OutputFormatter.php new file mode 100644 index 00000000..4ec60024 --- /dev/null +++ b/trunk/vendor/symfony/console/Formatter/OutputFormatter.php @@ -0,0 +1,294 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +use Symfony\Component\Console\Exception\InvalidArgumentException; + +use function Symfony\Component\String\b; + +/** + * Formatter class for console output. + * + * @author Konstantin Kudryashov + * @author Roland Franssen + */ +class OutputFormatter implements WrappableOutputFormatterInterface +{ + private $decorated; + private $styles = []; + private $styleStack; + + public function __clone() + { + $this->styleStack = clone $this->styleStack; + foreach ($this->styles as $key => $value) { + $this->styles[$key] = clone $value; + } + } + + /** + * Escapes "<" and ">" special chars in given text. + * + * @return string + */ + public static function escape(string $text) + { + $text = preg_replace('/([^\\\\]|^)([<>])/', '$1\\\\$2', $text); + + return self::escapeTrailingBackslash($text); + } + + /** + * Escapes trailing "\" in given text. + * + * @internal + */ + public static function escapeTrailingBackslash(string $text): string + { + if (str_ends_with($text, '\\')) { + $len = \strlen($text); + $text = rtrim($text, '\\'); + $text = str_replace("\0", '', $text); + $text .= str_repeat("\0", $len - \strlen($text)); + } + + return $text; + } + + /** + * Initializes console output formatter. + * + * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances + */ + public function __construct(bool $decorated = false, array $styles = []) + { + $this->decorated = $decorated; + + $this->setStyle('error', new OutputFormatterStyle('white', 'red')); + $this->setStyle('info', new OutputFormatterStyle('green')); + $this->setStyle('comment', new OutputFormatterStyle('yellow')); + $this->setStyle('question', new OutputFormatterStyle('black', 'cyan')); + + foreach ($styles as $name => $style) { + $this->setStyle($name, $style); + } + + $this->styleStack = new OutputFormatterStyleStack(); + } + + /** + * {@inheritdoc} + */ + public function setDecorated(bool $decorated) + { + $this->decorated = $decorated; + } + + /** + * {@inheritdoc} + */ + public function isDecorated() + { + return $this->decorated; + } + + /** + * {@inheritdoc} + */ + public function setStyle(string $name, OutputFormatterStyleInterface $style) + { + $this->styles[strtolower($name)] = $style; + } + + /** + * {@inheritdoc} + */ + public function hasStyle(string $name) + { + return isset($this->styles[strtolower($name)]); + } + + /** + * {@inheritdoc} + */ + public function getStyle(string $name) + { + if (!$this->hasStyle($name)) { + throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); + } + + return $this->styles[strtolower($name)]; + } + + /** + * {@inheritdoc} + */ + public function format(?string $message) + { + return $this->formatAndWrap($message, 0); + } + + /** + * {@inheritdoc} + */ + public function formatAndWrap(?string $message, int $width) + { + if (null === $message) { + return ''; + } + + $offset = 0; + $output = ''; + $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; + $closeTagRegex = '[a-z][^<>]*+'; + $currentLineLength = 0; + preg_match_all("#<(($openTagRegex) | /($closeTagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE); + foreach ($matches[0] as $i => $match) { + $pos = $match[1]; + $text = $match[0]; + + if (0 != $pos && '\\' == $message[$pos - 1]) { + continue; + } + + // add the text up to the next tag + $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); + $offset = $pos + \strlen($text); + + // opening tag? + if ($open = '/' != $text[1]) { + $tag = $matches[1][$i][0]; + } else { + $tag = $matches[3][$i][0] ?? ''; + } + + if (!$open && !$tag) { + // + $this->styleStack->pop(); + } elseif (null === $style = $this->createStyleFromString($tag)) { + $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength); + } elseif ($open) { + $this->styleStack->push($style); + } else { + $this->styleStack->pop($style); + } + } + + $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); + + return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']); + } + + /** + * @return OutputFormatterStyleStack + */ + public function getStyleStack() + { + return $this->styleStack; + } + + /** + * Tries to create new style instance from string. + */ + private function createStyleFromString(string $string): ?OutputFormatterStyleInterface + { + if (isset($this->styles[$string])) { + return $this->styles[$string]; + } + + if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) { + return null; + } + + $style = new OutputFormatterStyle(); + foreach ($matches as $match) { + array_shift($match); + $match[0] = strtolower($match[0]); + + if ('fg' == $match[0]) { + $style->setForeground(strtolower($match[1])); + } elseif ('bg' == $match[0]) { + $style->setBackground(strtolower($match[1])); + } elseif ('href' === $match[0]) { + $url = preg_replace('{\\\\([<>])}', '$1', $match[1]); + $style->setHref($url); + } elseif ('options' === $match[0]) { + preg_match_all('([^,;]+)', strtolower($match[1]), $options); + $options = array_shift($options); + foreach ($options as $option) { + $style->setOption($option); + } + } else { + return null; + } + } + + return $style; + } + + /** + * Applies current style from stack to text, if must be applied. + */ + private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string + { + if ('' === $text) { + return ''; + } + + if (!$width) { + return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text; + } + + if (!$currentLineLength && '' !== $current) { + $text = ltrim($text); + } + + if ($currentLineLength) { + $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n"; + $text = substr($text, $i); + } else { + $prefix = ''; + } + + preg_match('~(\\n)$~', $text, $matches); + $text = $prefix.$this->addLineBreaks($text, $width); + $text = rtrim($text, "\n").($matches[1] ?? ''); + + if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) { + $text = "\n".$text; + } + + $lines = explode("\n", $text); + + foreach ($lines as $line) { + $currentLineLength += \strlen($line); + if ($width <= $currentLineLength) { + $currentLineLength = 0; + } + } + + if ($this->isDecorated()) { + foreach ($lines as $i => $line) { + $lines[$i] = $this->styleStack->getCurrent()->apply($line); + } + } + + return implode("\n", $lines); + } + + private function addLineBreaks(string $text, int $width): string + { + $encoding = mb_detect_encoding($text, null, true) ?: 'UTF-8'; + + return b($text)->toCodePointString($encoding)->wordwrap($width, "\n", true)->toByteString($encoding); + } +} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/trunk/vendor/symfony/console/Formatter/OutputFormatterInterface.php new file mode 100644 index 00000000..0b5f839a --- /dev/null +++ b/trunk/vendor/symfony/console/Formatter/OutputFormatterInterface.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * Formatter interface for console output. + * + * @author Konstantin Kudryashov + */ +interface OutputFormatterInterface +{ + /** + * Sets the decorated flag. + */ + public function setDecorated(bool $decorated); + + /** + * Whether the output will decorate messages. + * + * @return bool + */ + public function isDecorated(); + + /** + * Sets a new style. + */ + public function setStyle(string $name, OutputFormatterStyleInterface $style); + + /** + * Checks if output formatter has style with specified name. + * + * @return bool + */ + public function hasStyle(string $name); + + /** + * Gets style options from style with specified name. + * + * @return OutputFormatterStyleInterface + * + * @throws \InvalidArgumentException When style isn't defined + */ + public function getStyle(string $name); + + /** + * Formats a message according to the given styles. + * + * @return string|null + */ + public function format(?string $message); +} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/trunk/vendor/symfony/console/Formatter/OutputFormatterStyle.php new file mode 100644 index 00000000..d7ae6649 --- /dev/null +++ b/trunk/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -0,0 +1,109 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +use Symfony\Component\Console\Color; + +/** + * Formatter style class for defining styles. + * + * @author Konstantin Kudryashov + */ +class OutputFormatterStyle implements OutputFormatterStyleInterface +{ + private $color; + private $foreground; + private $background; + private $options; + private $href; + private $handlesHrefGracefully; + + /** + * Initializes output formatter style. + * + * @param string|null $foreground The style foreground color name + * @param string|null $background The style background color name + */ + public function __construct(?string $foreground = null, ?string $background = null, array $options = []) + { + $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); + } + + /** + * {@inheritdoc} + */ + public function setForeground(?string $color = null) + { + $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); + } + + /** + * {@inheritdoc} + */ + public function setBackground(?string $color = null) + { + $this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options); + } + + public function setHref(string $url): void + { + $this->href = $url; + } + + /** + * {@inheritdoc} + */ + public function setOption(string $option) + { + $this->options[] = $option; + $this->color = new Color($this->foreground, $this->background, $this->options); + } + + /** + * {@inheritdoc} + */ + public function unsetOption(string $option) + { + $pos = array_search($option, $this->options); + if (false !== $pos) { + unset($this->options[$pos]); + } + + $this->color = new Color($this->foreground, $this->background, $this->options); + } + + /** + * {@inheritdoc} + */ + public function setOptions(array $options) + { + $this->color = new Color($this->foreground, $this->background, $this->options = $options); + } + + /** + * {@inheritdoc} + */ + public function apply(string $text) + { + if (null === $this->handlesHrefGracefully) { + $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) + && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); + } + + if (null !== $this->href && $this->handlesHrefGracefully) { + $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; + } + + return $this->color->apply($text); + } +} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php new file mode 100644 index 00000000..89e4d243 --- /dev/null +++ b/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * Formatter style interface for defining styles. + * + * @author Konstantin Kudryashov + */ +interface OutputFormatterStyleInterface +{ + /** + * Sets style foreground color. + */ + public function setForeground(?string $color = null); + + /** + * Sets style background color. + */ + public function setBackground(?string $color = null); + + /** + * Sets some specific style option. + */ + public function setOption(string $option); + + /** + * Unsets some specific style option. + */ + public function unsetOption(string $option); + + /** + * Sets multiple style options at once. + */ + public function setOptions(array $options); + + /** + * Applies the style to a given text. + * + * @return string + */ + public function apply(string $text); +} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php new file mode 100644 index 00000000..1b935630 --- /dev/null +++ b/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Contracts\Service\ResetInterface; + +/** + * @author Jean-François Simon + */ +class OutputFormatterStyleStack implements ResetInterface +{ + /** + * @var OutputFormatterStyleInterface[] + */ + private $styles; + + private $emptyStyle; + + public function __construct(?OutputFormatterStyleInterface $emptyStyle = null) + { + $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); + $this->reset(); + } + + /** + * Resets stack (ie. empty internal arrays). + */ + public function reset() + { + $this->styles = []; + } + + /** + * Pushes a style in the stack. + */ + public function push(OutputFormatterStyleInterface $style) + { + $this->styles[] = $style; + } + + /** + * Pops a style from the stack. + * + * @return OutputFormatterStyleInterface + * + * @throws InvalidArgumentException When style tags incorrectly nested + */ + public function pop(?OutputFormatterStyleInterface $style = null) + { + if (empty($this->styles)) { + return $this->emptyStyle; + } + + if (null === $style) { + return array_pop($this->styles); + } + + foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { + if ($style->apply('') === $stackedStyle->apply('')) { + $this->styles = \array_slice($this->styles, 0, $index); + + return $stackedStyle; + } + } + + throw new InvalidArgumentException('Incorrectly nested style tag found.'); + } + + /** + * Computes current style with stacks top codes. + * + * @return OutputFormatterStyle + */ + public function getCurrent() + { + if (empty($this->styles)) { + return $this->emptyStyle; + } + + return $this->styles[\count($this->styles) - 1]; + } + + /** + * @return $this + */ + public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) + { + $this->emptyStyle = $emptyStyle; + + return $this; + } + + /** + * @return OutputFormatterStyleInterface + */ + public function getEmptyStyle() + { + return $this->emptyStyle; + } +} diff --git a/trunk/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/trunk/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php new file mode 100644 index 00000000..42319ee5 --- /dev/null +++ b/trunk/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Formatter; + +/** + * Formatter interface for console output that supports word wrapping. + * + * @author Roland Franssen + */ +interface WrappableOutputFormatterInterface extends OutputFormatterInterface +{ + /** + * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping). + */ + public function formatAndWrap(?string $message, int $width); +} diff --git a/trunk/vendor/symfony/console/Helper/DebugFormatterHelper.php b/trunk/vendor/symfony/console/Helper/DebugFormatterHelper.php new file mode 100644 index 00000000..e258ba05 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/DebugFormatterHelper.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +/** + * Helps outputting debug information when running an external program from a command. + * + * An external program can be a Process, an HTTP request, or anything else. + * + * @author Fabien Potencier + */ +class DebugFormatterHelper extends Helper +{ + private const COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; + private $started = []; + private $count = -1; + + /** + * Starts a debug formatting session. + * + * @return string + */ + public function start(string $id, string $message, string $prefix = 'RUN') + { + $this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)]; + + return sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); + } + + /** + * Adds progress to a formatting session. + * + * @return string + */ + public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR') + { + $message = ''; + + if ($error) { + if (isset($this->started[$id]['out'])) { + $message .= "\n"; + unset($this->started[$id]['out']); + } + if (!isset($this->started[$id]['err'])) { + $message .= sprintf('%s %s ', $this->getBorder($id), $errorPrefix); + $this->started[$id]['err'] = true; + } + + $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); + } else { + if (isset($this->started[$id]['err'])) { + $message .= "\n"; + unset($this->started[$id]['err']); + } + if (!isset($this->started[$id]['out'])) { + $message .= sprintf('%s %s ', $this->getBorder($id), $prefix); + $this->started[$id]['out'] = true; + } + + $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); + } + + return $message; + } + + /** + * Stops a formatting session. + * + * @return string + */ + public function stop(string $id, string $message, bool $successful, string $prefix = 'RES') + { + $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; + + if ($successful) { + return sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); + } + + $message = sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); + + unset($this->started[$id]['out'], $this->started[$id]['err']); + + return $message; + } + + private function getBorder(string $id): string + { + return sprintf(' ', self::COLORS[$this->started[$id]['border']]); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'debug_formatter'; + } +} diff --git a/trunk/vendor/symfony/console/Helper/DescriptorHelper.php b/trunk/vendor/symfony/console/Helper/DescriptorHelper.php new file mode 100644 index 00000000..af85e9c0 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/DescriptorHelper.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Descriptor\DescriptorInterface; +use Symfony\Component\Console\Descriptor\JsonDescriptor; +use Symfony\Component\Console\Descriptor\MarkdownDescriptor; +use Symfony\Component\Console\Descriptor\TextDescriptor; +use Symfony\Component\Console\Descriptor\XmlDescriptor; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * This class adds helper method to describe objects in various formats. + * + * @author Jean-François Simon + */ +class DescriptorHelper extends Helper +{ + /** + * @var DescriptorInterface[] + */ + private $descriptors = []; + + public function __construct() + { + $this + ->register('txt', new TextDescriptor()) + ->register('xml', new XmlDescriptor()) + ->register('json', new JsonDescriptor()) + ->register('md', new MarkdownDescriptor()) + ; + } + + /** + * Describes an object if supported. + * + * Available options are: + * * format: string, the output format name + * * raw_text: boolean, sets output type as raw + * + * @throws InvalidArgumentException when the given format is not supported + */ + public function describe(OutputInterface $output, ?object $object, array $options = []) + { + $options = array_merge([ + 'raw_text' => false, + 'format' => 'txt', + ], $options); + + if (!isset($this->descriptors[$options['format']])) { + throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); + } + + $descriptor = $this->descriptors[$options['format']]; + $descriptor->describe($output, $object, $options); + } + + /** + * Registers a descriptor. + * + * @return $this + */ + public function register(string $format, DescriptorInterface $descriptor) + { + $this->descriptors[$format] = $descriptor; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'descriptor'; + } + + public function getFormats(): array + { + return array_keys($this->descriptors); + } +} diff --git a/trunk/vendor/symfony/console/Helper/Dumper.php b/trunk/vendor/symfony/console/Helper/Dumper.php new file mode 100644 index 00000000..605e4d70 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/Dumper.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\VarDumper\Cloner\ClonerInterface; +use Symfony\Component\VarDumper\Cloner\VarCloner; +use Symfony\Component\VarDumper\Dumper\CliDumper; + +/** + * @author Roland Franssen + */ +final class Dumper +{ + private $output; + private $dumper; + private $cloner; + private $handler; + + public function __construct(OutputInterface $output, ?CliDumper $dumper = null, ?ClonerInterface $cloner = null) + { + $this->output = $output; + $this->dumper = $dumper; + $this->cloner = $cloner; + + if (class_exists(CliDumper::class)) { + $this->handler = function ($var): string { + $dumper = $this->dumper ?? $this->dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); + $dumper->setColors($this->output->isDecorated()); + + return rtrim($dumper->dump(($this->cloner ?? $this->cloner = new VarCloner())->cloneVar($var)->withRefHandles(false), true)); + }; + } else { + $this->handler = function ($var): string { + switch (true) { + case null === $var: + return 'null'; + case true === $var: + return 'true'; + case false === $var: + return 'false'; + case \is_string($var): + return '"'.$var.'"'; + default: + return rtrim(print_r($var, true)); + } + }; + } + } + + public function __invoke($var): string + { + return ($this->handler)($var); + } +} diff --git a/trunk/vendor/symfony/console/Helper/FormatterHelper.php b/trunk/vendor/symfony/console/Helper/FormatterHelper.php new file mode 100644 index 00000000..92d8dc72 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/FormatterHelper.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Formatter\OutputFormatter; + +/** + * The Formatter class provides helpers to format messages. + * + * @author Fabien Potencier + */ +class FormatterHelper extends Helper +{ + /** + * Formats a message within a section. + * + * @return string + */ + public function formatSection(string $section, string $message, string $style = 'info') + { + return sprintf('<%s>[%s] %s', $style, $section, $style, $message); + } + + /** + * Formats a message as a block of text. + * + * @param string|array $messages The message to write in the block + * + * @return string + */ + public function formatBlock($messages, string $style, bool $large = false) + { + if (!\is_array($messages)) { + $messages = [$messages]; + } + + $len = 0; + $lines = []; + foreach ($messages as $message) { + $message = OutputFormatter::escape($message); + $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); + $len = max(self::width($message) + ($large ? 4 : 2), $len); + } + + $messages = $large ? [str_repeat(' ', $len)] : []; + for ($i = 0; isset($lines[$i]); ++$i) { + $messages[] = $lines[$i].str_repeat(' ', $len - self::width($lines[$i])); + } + if ($large) { + $messages[] = str_repeat(' ', $len); + } + + for ($i = 0; isset($messages[$i]); ++$i) { + $messages[$i] = sprintf('<%s>%s', $style, $messages[$i], $style); + } + + return implode("\n", $messages); + } + + /** + * Truncates a message to the given length. + * + * @return string + */ + public function truncate(string $message, int $length, string $suffix = '...') + { + $computedLength = $length - self::width($suffix); + + if ($computedLength > self::width($message)) { + return $message; + } + + return self::substr($message, 0, $length).$suffix; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'formatter'; + } +} diff --git a/trunk/vendor/symfony/console/Helper/Helper.php b/trunk/vendor/symfony/console/Helper/Helper.php new file mode 100644 index 00000000..6b3f7f43 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/Helper.php @@ -0,0 +1,180 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; +use Symfony\Component\String\UnicodeString; + +/** + * Helper is the base class for all helper classes. + * + * @author Fabien Potencier + */ +abstract class Helper implements HelperInterface +{ + protected $helperSet = null; + + /** + * {@inheritdoc} + */ + public function setHelperSet(?HelperSet $helperSet = null) + { + $this->helperSet = $helperSet; + } + + /** + * {@inheritdoc} + */ + public function getHelperSet() + { + return $this->helperSet; + } + + /** + * Returns the length of a string, using mb_strwidth if it is available. + * + * @deprecated since Symfony 5.3 + * + * @return int + */ + public static function strlen(?string $string) + { + trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::width() or Helper::length() instead.', __METHOD__); + + return self::width($string); + } + + /** + * Returns the width of a string, using mb_strwidth if it is available. + * The width is how many characters positions the string will use. + */ + public static function width(?string $string): int + { + $string ?? $string = ''; + + if (preg_match('//u', $string)) { + return (new UnicodeString($string))->width(false); + } + + if (false === $encoding = mb_detect_encoding($string, null, true)) { + return \strlen($string); + } + + return mb_strwidth($string, $encoding); + } + + /** + * Returns the length of a string, using mb_strlen if it is available. + * The length is related to how many bytes the string will use. + */ + public static function length(?string $string): int + { + $string ?? $string = ''; + + if (preg_match('//u', $string)) { + return (new UnicodeString($string))->length(); + } + + if (false === $encoding = mb_detect_encoding($string, null, true)) { + return \strlen($string); + } + + return mb_strlen($string, $encoding); + } + + /** + * Returns the subset of a string, using mb_substr if it is available. + * + * @return string + */ + public static function substr(?string $string, int $from, ?int $length = null) + { + $string ?? $string = ''; + + if (false === $encoding = mb_detect_encoding($string, null, true)) { + return substr($string, $from, $length); + } + + return mb_substr($string, $from, $length, $encoding); + } + + public static function formatTime($secs) + { + static $timeFormats = [ + [0, '< 1 sec'], + [1, '1 sec'], + [2, 'secs', 1], + [60, '1 min'], + [120, 'mins', 60], + [3600, '1 hr'], + [7200, 'hrs', 3600], + [86400, '1 day'], + [172800, 'days', 86400], + ]; + + foreach ($timeFormats as $index => $format) { + if ($secs >= $format[0]) { + if ((isset($timeFormats[$index + 1]) && $secs < $timeFormats[$index + 1][0]) + || $index == \count($timeFormats) - 1 + ) { + if (2 == \count($format)) { + return $format[1]; + } + + return floor($secs / $format[2]).' '.$format[1]; + } + } + } + } + + public static function formatMemory(int $memory) + { + if ($memory >= 1024 * 1024 * 1024) { + return sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); + } + + if ($memory >= 1024 * 1024) { + return sprintf('%.1f MiB', $memory / 1024 / 1024); + } + + if ($memory >= 1024) { + return sprintf('%d KiB', $memory / 1024); + } + + return sprintf('%d B', $memory); + } + + /** + * @deprecated since Symfony 5.3 + */ + public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, ?string $string) + { + trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::removeDecoration() instead.', __METHOD__); + + return self::width(self::removeDecoration($formatter, $string)); + } + + public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) + { + $isDecorated = $formatter->isDecorated(); + $formatter->setDecorated(false); + // remove <...> formatting + $string = $formatter->format($string ?? ''); + // remove already formatted characters + $string = preg_replace("/\033\[[^m]*m/", '', $string ?? ''); + // remove terminal hyperlinks + $string = preg_replace('/\\033]8;[^;]*;[^\\033]*\\033\\\\/', '', $string ?? ''); + $formatter->setDecorated($isDecorated); + + return $string; + } +} diff --git a/trunk/vendor/symfony/console/Helper/HelperInterface.php b/trunk/vendor/symfony/console/Helper/HelperInterface.php new file mode 100644 index 00000000..5bf4d632 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/HelperInterface.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +/** + * HelperInterface is the interface all helpers must implement. + * + * @author Fabien Potencier + */ +interface HelperInterface +{ + /** + * Sets the helper set associated with this helper. + */ + public function setHelperSet(?HelperSet $helperSet = null); + + /** + * Gets the helper set associated with this helper. + * + * @return HelperSet|null + */ + public function getHelperSet(); + + /** + * Returns the canonical name of this helper. + * + * @return string + */ + public function getName(); +} diff --git a/trunk/vendor/symfony/console/Helper/HelperSet.php b/trunk/vendor/symfony/console/Helper/HelperSet.php new file mode 100644 index 00000000..c870ab99 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/HelperSet.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\InvalidArgumentException; + +/** + * HelperSet represents a set of helpers to be used with a command. + * + * @author Fabien Potencier + * + * @implements \IteratorAggregate + */ +class HelperSet implements \IteratorAggregate +{ + /** @var array */ + private $helpers = []; + private $command; + + /** + * @param Helper[] $helpers An array of helper + */ + public function __construct(array $helpers = []) + { + foreach ($helpers as $alias => $helper) { + $this->set($helper, \is_int($alias) ? null : $alias); + } + } + + public function set(HelperInterface $helper, ?string $alias = null) + { + $this->helpers[$helper->getName()] = $helper; + if (null !== $alias) { + $this->helpers[$alias] = $helper; + } + + $helper->setHelperSet($this); + } + + /** + * Returns true if the helper if defined. + * + * @return bool + */ + public function has(string $name) + { + return isset($this->helpers[$name]); + } + + /** + * Gets a helper value. + * + * @return HelperInterface + * + * @throws InvalidArgumentException if the helper is not defined + */ + public function get(string $name) + { + if (!$this->has($name)) { + throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); + } + + return $this->helpers[$name]; + } + + /** + * @deprecated since Symfony 5.4 + */ + public function setCommand(?Command $command = null) + { + trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); + + $this->command = $command; + } + + /** + * Gets the command associated with this helper set. + * + * @return Command + * + * @deprecated since Symfony 5.4 + */ + public function getCommand() + { + trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); + + return $this->command; + } + + /** + * @return \Traversable + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + return new \ArrayIterator($this->helpers); + } +} diff --git a/trunk/vendor/symfony/console/Helper/InputAwareHelper.php b/trunk/vendor/symfony/console/Helper/InputAwareHelper.php new file mode 100644 index 00000000..0d0dba23 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/InputAwareHelper.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Input\InputAwareInterface; +use Symfony\Component\Console\Input\InputInterface; + +/** + * An implementation of InputAwareInterface for Helpers. + * + * @author Wouter J + */ +abstract class InputAwareHelper extends Helper implements InputAwareInterface +{ + protected $input; + + /** + * {@inheritdoc} + */ + public function setInput(InputInterface $input) + { + $this->input = $input; + } +} diff --git a/trunk/vendor/symfony/console/Helper/ProcessHelper.php b/trunk/vendor/symfony/console/Helper/ProcessHelper.php new file mode 100644 index 00000000..86a250b2 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/ProcessHelper.php @@ -0,0 +1,144 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Process\Exception\ProcessFailedException; +use Symfony\Component\Process\Process; + +/** + * The ProcessHelper class provides helpers to run external processes. + * + * @author Fabien Potencier + * + * @final + */ +class ProcessHelper extends Helper +{ + /** + * Runs an external process. + * + * @param array|Process $cmd An instance of Process or an array of the command and arguments + * @param callable|null $callback A PHP callback to run whenever there is some + * output available on STDOUT or STDERR + */ + public function run(OutputInterface $output, $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process + { + if (!class_exists(Process::class)) { + throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); + } + + if ($output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + + $formatter = $this->getHelperSet()->get('debug_formatter'); + + if ($cmd instanceof Process) { + $cmd = [$cmd]; + } + + if (!\is_array($cmd)) { + throw new \TypeError(sprintf('The "command" argument of "%s()" must be an array or a "%s" instance, "%s" given.', __METHOD__, Process::class, get_debug_type($cmd))); + } + + if (\is_string($cmd[0] ?? null)) { + $process = new Process($cmd); + $cmd = []; + } elseif (($cmd[0] ?? null) instanceof Process) { + $process = $cmd[0]; + unset($cmd[0]); + } else { + throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); + } + + if ($verbosity <= $output->getVerbosity()) { + $output->write($formatter->start(spl_object_hash($process), $this->escapeString($process->getCommandLine()))); + } + + if ($output->isDebug()) { + $callback = $this->wrapCallback($output, $process, $callback); + } + + $process->run($callback, $cmd); + + if ($verbosity <= $output->getVerbosity()) { + $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode()); + $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful())); + } + + if (!$process->isSuccessful() && null !== $error) { + $output->writeln(sprintf('%s', $this->escapeString($error))); + } + + return $process; + } + + /** + * Runs the process. + * + * This is identical to run() except that an exception is thrown if the process + * exits with a non-zero exit code. + * + * @param array|Process $cmd An instance of Process or a command to run + * @param callable|null $callback A PHP callback to run whenever there is some + * output available on STDOUT or STDERR + * + * @throws ProcessFailedException + * + * @see run() + */ + public function mustRun(OutputInterface $output, $cmd, ?string $error = null, ?callable $callback = null): Process + { + $process = $this->run($output, $cmd, $error, $callback); + + if (!$process->isSuccessful()) { + throw new ProcessFailedException($process); + } + + return $process; + } + + /** + * Wraps a Process callback to add debugging output. + */ + public function wrapCallback(OutputInterface $output, Process $process, ?callable $callback = null): callable + { + if ($output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + + $formatter = $this->getHelperSet()->get('debug_formatter'); + + return function ($type, $buffer) use ($output, $process, $callback, $formatter) { + $output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type)); + + if (null !== $callback) { + $callback($type, $buffer); + } + }; + } + + private function escapeString(string $str): string + { + return str_replace('<', '\\<', $str); + } + + /** + * {@inheritdoc} + */ + public function getName(): string + { + return 'process'; + } +} diff --git a/trunk/vendor/symfony/console/Helper/ProgressBar.php b/trunk/vendor/symfony/console/Helper/ProgressBar.php new file mode 100644 index 00000000..6250732e --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/ProgressBar.php @@ -0,0 +1,612 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Cursor; +use Symfony\Component\Console\Exception\LogicException; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\ConsoleSectionOutput; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Terminal; + +/** + * The ProgressBar provides helpers to display progress output. + * + * @author Fabien Potencier + * @author Chris Jones + */ +final class ProgressBar +{ + public const FORMAT_VERBOSE = 'verbose'; + public const FORMAT_VERY_VERBOSE = 'very_verbose'; + public const FORMAT_DEBUG = 'debug'; + public const FORMAT_NORMAL = 'normal'; + + private const FORMAT_VERBOSE_NOMAX = 'verbose_nomax'; + private const FORMAT_VERY_VERBOSE_NOMAX = 'very_verbose_nomax'; + private const FORMAT_DEBUG_NOMAX = 'debug_nomax'; + private const FORMAT_NORMAL_NOMAX = 'normal_nomax'; + + private $barWidth = 28; + private $barChar; + private $emptyBarChar = '-'; + private $progressChar = '>'; + private $format; + private $internalFormat; + private $redrawFreq = 1; + private $writeCount; + private $lastWriteTime; + private $minSecondsBetweenRedraws = 0; + private $maxSecondsBetweenRedraws = 1; + private $output; + private $step = 0; + private $max; + private $startTime; + private $stepWidth; + private $percent = 0.0; + private $messages = []; + private $overwrite = true; + private $terminal; + private $previousMessage; + private $cursor; + + private static $formatters; + private static $formats; + + /** + * @param int $max Maximum steps (0 if unknown) + */ + public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 1 / 25) + { + if ($output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + + $this->output = $output; + $this->setMaxSteps($max); + $this->terminal = new Terminal(); + + if (0 < $minSecondsBetweenRedraws) { + $this->redrawFreq = null; + $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws; + } + + if (!$this->output->isDecorated()) { + // disable overwrite when output does not support ANSI codes. + $this->overwrite = false; + + // set a reasonable redraw frequency so output isn't flooded + $this->redrawFreq = null; + } + + $this->startTime = time(); + $this->cursor = new Cursor($output); + } + + /** + * Sets a placeholder formatter for a given name. + * + * This method also allow you to override an existing placeholder. + * + * @param string $name The placeholder name (including the delimiter char like %) + * @param callable $callable A PHP callable + */ + public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void + { + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } + + self::$formatters[$name] = $callable; + } + + /** + * Gets the placeholder formatter for a given name. + * + * @param string $name The placeholder name (including the delimiter char like %) + */ + public static function getPlaceholderFormatterDefinition(string $name): ?callable + { + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } + + return self::$formatters[$name] ?? null; + } + + /** + * Sets a format for a given name. + * + * This method also allow you to override an existing format. + * + * @param string $name The format name + * @param string $format A format string + */ + public static function setFormatDefinition(string $name, string $format): void + { + if (!self::$formats) { + self::$formats = self::initFormats(); + } + + self::$formats[$name] = $format; + } + + /** + * Gets the format for a given name. + * + * @param string $name The format name + */ + public static function getFormatDefinition(string $name): ?string + { + if (!self::$formats) { + self::$formats = self::initFormats(); + } + + return self::$formats[$name] ?? null; + } + + /** + * Associates a text with a named placeholder. + * + * The text is displayed when the progress bar is rendered but only + * when the corresponding placeholder is part of the custom format line + * (by wrapping the name with %). + * + * @param string $message The text to associate with the placeholder + * @param string $name The name of the placeholder + */ + public function setMessage(string $message, string $name = 'message') + { + $this->messages[$name] = $message; + } + + /** + * @return string|null + */ + public function getMessage(string $name = 'message') + { + return $this->messages[$name] ?? null; + } + + public function getStartTime(): int + { + return $this->startTime; + } + + public function getMaxSteps(): int + { + return $this->max; + } + + public function getProgress(): int + { + return $this->step; + } + + private function getStepWidth(): int + { + return $this->stepWidth; + } + + public function getProgressPercent(): float + { + return $this->percent; + } + + public function getBarOffset(): float + { + return floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth); + } + + public function getEstimated(): float + { + if (!$this->step) { + return 0; + } + + return round((time() - $this->startTime) / $this->step * $this->max); + } + + public function getRemaining(): float + { + if (!$this->step) { + return 0; + } + + return round((time() - $this->startTime) / $this->step * ($this->max - $this->step)); + } + + public function setBarWidth(int $size) + { + $this->barWidth = max(1, $size); + } + + public function getBarWidth(): int + { + return $this->barWidth; + } + + public function setBarCharacter(string $char) + { + $this->barChar = $char; + } + + public function getBarCharacter(): string + { + return $this->barChar ?? ($this->max ? '=' : $this->emptyBarChar); + } + + public function setEmptyBarCharacter(string $char) + { + $this->emptyBarChar = $char; + } + + public function getEmptyBarCharacter(): string + { + return $this->emptyBarChar; + } + + public function setProgressCharacter(string $char) + { + $this->progressChar = $char; + } + + public function getProgressCharacter(): string + { + return $this->progressChar; + } + + public function setFormat(string $format) + { + $this->format = null; + $this->internalFormat = $format; + } + + /** + * Sets the redraw frequency. + * + * @param int|null $freq The frequency in steps + */ + public function setRedrawFrequency(?int $freq) + { + $this->redrawFreq = null !== $freq ? max(1, $freq) : null; + } + + public function minSecondsBetweenRedraws(float $seconds): void + { + $this->minSecondsBetweenRedraws = $seconds; + } + + public function maxSecondsBetweenRedraws(float $seconds): void + { + $this->maxSecondsBetweenRedraws = $seconds; + } + + /** + * Returns an iterator that will automatically update the progress bar when iterated. + * + * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable + */ + public function iterate(iterable $iterable, ?int $max = null): iterable + { + $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0)); + + foreach ($iterable as $key => $value) { + yield $key => $value; + + $this->advance(); + } + + $this->finish(); + } + + /** + * Starts the progress output. + * + * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged + */ + public function start(?int $max = null) + { + $this->startTime = time(); + $this->step = 0; + $this->percent = 0.0; + + if (null !== $max) { + $this->setMaxSteps($max); + } + + $this->display(); + } + + /** + * Advances the progress output X steps. + * + * @param int $step Number of steps to advance + */ + public function advance(int $step = 1) + { + $this->setProgress($this->step + $step); + } + + /** + * Sets whether to overwrite the progressbar, false for new line. + */ + public function setOverwrite(bool $overwrite) + { + $this->overwrite = $overwrite; + } + + public function setProgress(int $step) + { + if ($this->max && $step > $this->max) { + $this->max = $step; + } elseif ($step < 0) { + $step = 0; + } + + $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10); + $prevPeriod = (int) ($this->step / $redrawFreq); + $currPeriod = (int) ($step / $redrawFreq); + $this->step = $step; + $this->percent = $this->max ? (float) $this->step / $this->max : 0; + $timeInterval = microtime(true) - $this->lastWriteTime; + + // Draw regardless of other limits + if ($this->max === $step) { + $this->display(); + + return; + } + + // Throttling + if ($timeInterval < $this->minSecondsBetweenRedraws) { + return; + } + + // Draw each step period, but not too late + if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) { + $this->display(); + } + } + + public function setMaxSteps(int $max) + { + $this->format = null; + $this->max = max(0, $max); + $this->stepWidth = $this->max ? Helper::width((string) $this->max) : 4; + } + + /** + * Finishes the progress output. + */ + public function finish(): void + { + if (!$this->max) { + $this->max = $this->step; + } + + if ($this->step === $this->max && !$this->overwrite) { + // prevent double 100% output + return; + } + + $this->setProgress($this->max); + } + + /** + * Outputs the current progress string. + */ + public function display(): void + { + if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { + return; + } + + if (null === $this->format) { + $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); + } + + $this->overwrite($this->buildLine()); + } + + /** + * Removes the progress bar from the current line. + * + * This is useful if you wish to write some output + * while a progress bar is running. + * Call display() to show the progress bar again. + */ + public function clear(): void + { + if (!$this->overwrite) { + return; + } + + if (null === $this->format) { + $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); + } + + $this->overwrite(''); + } + + private function setRealFormat(string $format) + { + // try to use the _nomax variant if available + if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { + $this->format = self::getFormatDefinition($format.'_nomax'); + } elseif (null !== self::getFormatDefinition($format)) { + $this->format = self::getFormatDefinition($format); + } else { + $this->format = $format; + } + } + + /** + * Overwrites a previous message to the output. + */ + private function overwrite(string $message): void + { + if ($this->previousMessage === $message) { + return; + } + + $originalMessage = $message; + + if ($this->overwrite) { + if (null !== $this->previousMessage) { + if ($this->output instanceof ConsoleSectionOutput) { + $messageLines = explode("\n", $this->previousMessage); + $lineCount = \count($messageLines); + foreach ($messageLines as $messageLine) { + $messageLineLength = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $messageLine)); + if ($messageLineLength > $this->terminal->getWidth()) { + $lineCount += floor($messageLineLength / $this->terminal->getWidth()); + } + } + $this->output->clear($lineCount); + } else { + $lineCount = substr_count($this->previousMessage, "\n"); + for ($i = 0; $i < $lineCount; ++$i) { + $this->cursor->moveToColumn(1); + $this->cursor->clearLine(); + $this->cursor->moveUp(); + } + + $this->cursor->moveToColumn(1); + $this->cursor->clearLine(); + } + } + } elseif ($this->step > 0) { + $message = \PHP_EOL.$message; + } + + $this->previousMessage = $originalMessage; + $this->lastWriteTime = microtime(true); + + $this->output->write($message); + ++$this->writeCount; + } + + private function determineBestFormat(): string + { + switch ($this->output->getVerbosity()) { + // OutputInterface::VERBOSITY_QUIET: display is disabled anyway + case OutputInterface::VERBOSITY_VERBOSE: + return $this->max ? self::FORMAT_VERBOSE : self::FORMAT_VERBOSE_NOMAX; + case OutputInterface::VERBOSITY_VERY_VERBOSE: + return $this->max ? self::FORMAT_VERY_VERBOSE : self::FORMAT_VERY_VERBOSE_NOMAX; + case OutputInterface::VERBOSITY_DEBUG: + return $this->max ? self::FORMAT_DEBUG : self::FORMAT_DEBUG_NOMAX; + default: + return $this->max ? self::FORMAT_NORMAL : self::FORMAT_NORMAL_NOMAX; + } + } + + private static function initPlaceholderFormatters(): array + { + return [ + 'bar' => function (self $bar, OutputInterface $output) { + $completeBars = $bar->getBarOffset(); + $display = str_repeat($bar->getBarCharacter(), $completeBars); + if ($completeBars < $bar->getBarWidth()) { + $emptyBars = $bar->getBarWidth() - $completeBars - Helper::length(Helper::removeDecoration($output->getFormatter(), $bar->getProgressCharacter())); + $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars); + } + + return $display; + }, + 'elapsed' => function (self $bar) { + return Helper::formatTime(time() - $bar->getStartTime()); + }, + 'remaining' => function (self $bar) { + if (!$bar->getMaxSteps()) { + throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); + } + + return Helper::formatTime($bar->getRemaining()); + }, + 'estimated' => function (self $bar) { + if (!$bar->getMaxSteps()) { + throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); + } + + return Helper::formatTime($bar->getEstimated()); + }, + 'memory' => function (self $bar) { + return Helper::formatMemory(memory_get_usage(true)); + }, + 'current' => function (self $bar) { + return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT); + }, + 'max' => function (self $bar) { + return $bar->getMaxSteps(); + }, + 'percent' => function (self $bar) { + return floor($bar->getProgressPercent() * 100); + }, + ]; + } + + private static function initFormats(): array + { + return [ + self::FORMAT_NORMAL => ' %current%/%max% [%bar%] %percent:3s%%', + self::FORMAT_NORMAL_NOMAX => ' %current% [%bar%]', + + self::FORMAT_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%', + self::FORMAT_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', + + self::FORMAT_VERY_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%', + self::FORMAT_VERY_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', + + self::FORMAT_DEBUG => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', + self::FORMAT_DEBUG_NOMAX => ' %current% [%bar%] %elapsed:6s% %memory:6s%', + ]; + } + + private function buildLine(): string + { + $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; + $callback = function ($matches) { + if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { + $text = $formatter($this, $this->output); + } elseif (isset($this->messages[$matches[1]])) { + $text = $this->messages[$matches[1]]; + } else { + return $matches[0]; + } + + if (isset($matches[2])) { + $text = sprintf('%'.$matches[2], $text); + } + + return $text; + }; + $line = preg_replace_callback($regex, $callback, $this->format); + + // gets string length for each sub line with multiline format + $linesLength = array_map(function ($subLine) { + return Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))); + }, explode("\n", $line)); + + $linesWidth = max($linesLength); + + $terminalWidth = $this->terminal->getWidth(); + if ($linesWidth <= $terminalWidth) { + return $line; + } + + $this->setBarWidth($this->barWidth - $linesWidth + $terminalWidth); + + return preg_replace_callback($regex, $callback, $this->format); + } +} diff --git a/trunk/vendor/symfony/console/Helper/ProgressIndicator.php b/trunk/vendor/symfony/console/Helper/ProgressIndicator.php new file mode 100644 index 00000000..3cc0e145 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/ProgressIndicator.php @@ -0,0 +1,247 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author Kevin Bond + */ +class ProgressIndicator +{ + private const FORMATS = [ + 'normal' => ' %indicator% %message%', + 'normal_no_ansi' => ' %message%', + + 'verbose' => ' %indicator% %message% (%elapsed:6s%)', + 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', + + 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', + 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', + ]; + + private $output; + private $startTime; + private $format; + private $message; + private $indicatorValues; + private $indicatorCurrent; + private $indicatorChangeInterval; + private $indicatorUpdateTime; + private $started = false; + + /** + * @var array + */ + private static $formatters; + + /** + * @param int $indicatorChangeInterval Change interval in milliseconds + * @param array|null $indicatorValues Animated indicator characters + */ + public function __construct(OutputInterface $output, ?string $format = null, int $indicatorChangeInterval = 100, ?array $indicatorValues = null) + { + $this->output = $output; + + if (null === $format) { + $format = $this->determineBestFormat(); + } + + if (null === $indicatorValues) { + $indicatorValues = ['-', '\\', '|', '/']; + } + + $indicatorValues = array_values($indicatorValues); + + if (2 > \count($indicatorValues)) { + throw new InvalidArgumentException('Must have at least 2 indicator value characters.'); + } + + $this->format = self::getFormatDefinition($format); + $this->indicatorChangeInterval = $indicatorChangeInterval; + $this->indicatorValues = $indicatorValues; + $this->startTime = time(); + } + + /** + * Sets the current indicator message. + */ + public function setMessage(?string $message) + { + $this->message = $message; + + $this->display(); + } + + /** + * Starts the indicator output. + */ + public function start(string $message) + { + if ($this->started) { + throw new LogicException('Progress indicator already started.'); + } + + $this->message = $message; + $this->started = true; + $this->startTime = time(); + $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval; + $this->indicatorCurrent = 0; + + $this->display(); + } + + /** + * Advances the indicator. + */ + public function advance() + { + if (!$this->started) { + throw new LogicException('Progress indicator has not yet been started.'); + } + + if (!$this->output->isDecorated()) { + return; + } + + $currentTime = $this->getCurrentTimeInMilliseconds(); + + if ($currentTime < $this->indicatorUpdateTime) { + return; + } + + $this->indicatorUpdateTime = $currentTime + $this->indicatorChangeInterval; + ++$this->indicatorCurrent; + + $this->display(); + } + + /** + * Finish the indicator with message. + */ + public function finish(string $message) + { + if (!$this->started) { + throw new LogicException('Progress indicator has not yet been started.'); + } + + $this->message = $message; + $this->display(); + $this->output->writeln(''); + $this->started = false; + } + + /** + * Gets the format for a given name. + * + * @return string|null + */ + public static function getFormatDefinition(string $name) + { + return self::FORMATS[$name] ?? null; + } + + /** + * Sets a placeholder formatter for a given name. + * + * This method also allow you to override an existing placeholder. + */ + public static function setPlaceholderFormatterDefinition(string $name, callable $callable) + { + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } + + self::$formatters[$name] = $callable; + } + + /** + * Gets the placeholder formatter for a given name (including the delimiter char like %). + * + * @return callable|null + */ + public static function getPlaceholderFormatterDefinition(string $name) + { + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } + + return self::$formatters[$name] ?? null; + } + + private function display() + { + if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { + return; + } + + $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { + if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { + return $formatter($this); + } + + return $matches[0]; + }, $this->format ?? '')); + } + + private function determineBestFormat(): string + { + switch ($this->output->getVerbosity()) { + // OutputInterface::VERBOSITY_QUIET: display is disabled anyway + case OutputInterface::VERBOSITY_VERBOSE: + return $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi'; + case OutputInterface::VERBOSITY_VERY_VERBOSE: + case OutputInterface::VERBOSITY_DEBUG: + return $this->output->isDecorated() ? 'very_verbose' : 'very_verbose_no_ansi'; + default: + return $this->output->isDecorated() ? 'normal' : 'normal_no_ansi'; + } + } + + /** + * Overwrites a previous message to the output. + */ + private function overwrite(string $message) + { + if ($this->output->isDecorated()) { + $this->output->write("\x0D\x1B[2K"); + $this->output->write($message); + } else { + $this->output->writeln($message); + } + } + + private function getCurrentTimeInMilliseconds(): float + { + return round(microtime(true) * 1000); + } + + private static function initPlaceholderFormatters(): array + { + return [ + 'indicator' => function (self $indicator) { + return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; + }, + 'message' => function (self $indicator) { + return $indicator->message; + }, + 'elapsed' => function (self $indicator) { + return Helper::formatTime(time() - $indicator->startTime); + }, + 'memory' => function () { + return Helper::formatMemory(memory_get_usage(true)); + }, + ]; + } +} diff --git a/trunk/vendor/symfony/console/Helper/QuestionHelper.php b/trunk/vendor/symfony/console/Helper/QuestionHelper.php new file mode 100644 index 00000000..7b9de922 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/QuestionHelper.php @@ -0,0 +1,613 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Cursor; +use Symfony\Component\Console\Exception\MissingInputException; +use Symfony\Component\Console\Exception\RuntimeException; +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Formatter\OutputFormatterStyle; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\StreamableInputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\ConsoleSectionOutput; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\Question; +use Symfony\Component\Console\Terminal; + +use function Symfony\Component\String\s; + +/** + * The QuestionHelper class provides helpers to interact with the user. + * + * @author Fabien Potencier + */ +class QuestionHelper extends Helper +{ + /** + * @var resource|null + */ + private $inputStream; + + private static $stty = true; + private static $stdinIsInteractive; + + /** + * Asks a question to the user. + * + * @return mixed The user answer + * + * @throws RuntimeException If there is no data to read in the input stream + */ + public function ask(InputInterface $input, OutputInterface $output, Question $question) + { + if ($output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + + if (!$input->isInteractive()) { + return $this->getDefaultAnswer($question); + } + + if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) { + $this->inputStream = $stream; + } + + try { + if (!$question->getValidator()) { + return $this->doAsk($output, $question); + } + + $interviewer = function () use ($output, $question) { + return $this->doAsk($output, $question); + }; + + return $this->validateAttempts($interviewer, $output, $question); + } catch (MissingInputException $exception) { + $input->setInteractive(false); + + if (null === $fallbackOutput = $this->getDefaultAnswer($question)) { + throw $exception; + } + + return $fallbackOutput; + } + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'question'; + } + + /** + * Prevents usage of stty. + */ + public static function disableStty() + { + self::$stty = false; + } + + /** + * Asks the question to the user. + * + * @return mixed + * + * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden + */ + private function doAsk(OutputInterface $output, Question $question) + { + $this->writePrompt($output, $question); + + $inputStream = $this->inputStream ?: \STDIN; + $autocomplete = $question->getAutocompleterCallback(); + + if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) { + $ret = false; + if ($question->isHidden()) { + try { + $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable()); + $ret = $question->isTrimmable() ? trim($hiddenResponse) : $hiddenResponse; + } catch (RuntimeException $e) { + if (!$question->isHiddenFallback()) { + throw $e; + } + } + } + + if (false === $ret) { + $isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true; + + if (!$isBlocked) { + stream_set_blocking($inputStream, true); + } + + $ret = $this->readInput($inputStream, $question); + + if (!$isBlocked) { + stream_set_blocking($inputStream, false); + } + + if (false === $ret) { + throw new MissingInputException('Aborted.'); + } + if ($question->isTrimmable()) { + $ret = trim($ret); + } + } + } else { + $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete); + $ret = $question->isTrimmable() ? trim($autocomplete) : $autocomplete; + } + + if ($output instanceof ConsoleSectionOutput) { + $output->addContent($ret); + } + + $ret = \strlen($ret) > 0 ? $ret : $question->getDefault(); + + if ($normalizer = $question->getNormalizer()) { + return $normalizer($ret); + } + + return $ret; + } + + /** + * @return mixed + */ + private function getDefaultAnswer(Question $question) + { + $default = $question->getDefault(); + + if (null === $default) { + return $default; + } + + if ($validator = $question->getValidator()) { + return \call_user_func($question->getValidator(), $default); + } elseif ($question instanceof ChoiceQuestion) { + $choices = $question->getChoices(); + + if (!$question->isMultiselect()) { + return $choices[$default] ?? $default; + } + + $default = explode(',', $default); + foreach ($default as $k => $v) { + $v = $question->isTrimmable() ? trim($v) : $v; + $default[$k] = $choices[$v] ?? $v; + } + } + + return $default; + } + + /** + * Outputs the question prompt. + */ + protected function writePrompt(OutputInterface $output, Question $question) + { + $message = $question->getQuestion(); + + if ($question instanceof ChoiceQuestion) { + $output->writeln(array_merge([ + $question->getQuestion(), + ], $this->formatChoiceQuestionChoices($question, 'info'))); + + $message = $question->getPrompt(); + } + + $output->write($message); + } + + /** + * @return string[] + */ + protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag) + { + $messages = []; + + $maxWidth = max(array_map([__CLASS__, 'width'], array_keys($choices = $question->getChoices()))); + + foreach ($choices as $key => $value) { + $padding = str_repeat(' ', $maxWidth - self::width($key)); + + $messages[] = sprintf(" [<$tag>%s$padding] %s", $key, $value); + } + + return $messages; + } + + /** + * Outputs an error message. + */ + protected function writeError(OutputInterface $output, \Exception $error) + { + if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) { + $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'); + } else { + $message = ''.$error->getMessage().''; + } + + $output->writeln($message); + } + + /** + * Autocompletes a question. + * + * @param resource $inputStream + */ + private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string + { + $cursor = new Cursor($output, $inputStream); + + $fullChoice = ''; + $ret = ''; + + $i = 0; + $ofs = -1; + $matches = $autocomplete($ret); + $numMatches = \count($matches); + + $sttyMode = shell_exec('stty -g'); + $isStdin = 'php://stdin' === (stream_get_meta_data($inputStream)['uri'] ?? null); + $r = [$inputStream]; + $w = []; + + // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) + shell_exec('stty -icanon -echo'); + + // Add highlighted text style + $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white')); + + // Read a keypress + while (!feof($inputStream)) { + while ($isStdin && 0 === @stream_select($r, $w, $w, 0, 100)) { + // Give signal handlers a chance to run + $r = [$inputStream]; + } + $c = fread($inputStream, 1); + + // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. + if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { + shell_exec('stty '.$sttyMode); + throw new MissingInputException('Aborted.'); + } elseif ("\177" === $c) { // Backspace Character + if (0 === $numMatches && 0 !== $i) { + --$i; + $cursor->moveLeft(s($fullChoice)->slice(-1)->width(false)); + + $fullChoice = self::substr($fullChoice, 0, $i); + } + + if (0 === $i) { + $ofs = -1; + $matches = $autocomplete($ret); + $numMatches = \count($matches); + } else { + $numMatches = 0; + } + + // Pop the last character off the end of our string + $ret = self::substr($ret, 0, $i); + } elseif ("\033" === $c) { + // Did we read an escape sequence? + $c .= fread($inputStream, 2); + + // A = Up Arrow. B = Down Arrow + if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) { + if ('A' === $c[2] && -1 === $ofs) { + $ofs = 0; + } + + if (0 === $numMatches) { + continue; + } + + $ofs += ('A' === $c[2]) ? -1 : 1; + $ofs = ($numMatches + $ofs) % $numMatches; + } + } elseif (\ord($c) < 32) { + if ("\t" === $c || "\n" === $c) { + if ($numMatches > 0 && -1 !== $ofs) { + $ret = (string) $matches[$ofs]; + // Echo out remaining chars for current match + $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)))); + $output->write($remainingCharacters); + $fullChoice .= $remainingCharacters; + $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding); + + $matches = array_filter( + $autocomplete($ret), + function ($match) use ($ret) { + return '' === $ret || str_starts_with($match, $ret); + } + ); + $numMatches = \count($matches); + $ofs = -1; + } + + if ("\n" === $c) { + $output->write($c); + break; + } + + $numMatches = 0; + } + + continue; + } else { + if ("\x80" <= $c) { + $c .= fread($inputStream, ["\xC0" => 1, "\xD0" => 1, "\xE0" => 2, "\xF0" => 3][$c & "\xF0"]); + } + + $output->write($c); + $ret .= $c; + $fullChoice .= $c; + ++$i; + + $tempRet = $ret; + + if ($question instanceof ChoiceQuestion && $question->isMultiselect()) { + $tempRet = $this->mostRecentlyEnteredValue($fullChoice); + } + + $numMatches = 0; + $ofs = 0; + + foreach ($autocomplete($ret) as $value) { + // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) + if (str_starts_with($value, $tempRet)) { + $matches[$numMatches++] = $value; + } + } + } + + $cursor->clearLineAfter(); + + if ($numMatches > 0 && -1 !== $ofs) { + $cursor->savePosition(); + // Write highlighted text, complete the partially entered response + $charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))); + $output->write(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).''); + $cursor->restorePosition(); + } + } + + // Reset stty so it behaves normally again + shell_exec('stty '.$sttyMode); + + return $fullChoice; + } + + private function mostRecentlyEnteredValue(string $entered): string + { + // Determine the most recent value that the user entered + if (!str_contains($entered, ',')) { + return $entered; + } + + $choices = explode(',', $entered); + if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) { + return $lastChoice; + } + + return $entered; + } + + /** + * Gets a hidden response from user. + * + * @param resource $inputStream The handler resource + * @param bool $trimmable Is the answer trimmable + * + * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden + */ + private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = true): string + { + if ('\\' === \DIRECTORY_SEPARATOR) { + $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; + + // handle code running from a phar + if ('phar:' === substr(__FILE__, 0, 5)) { + $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; + copy($exe, $tmpExe); + $exe = $tmpExe; + } + + $sExec = shell_exec('"'.$exe.'"'); + $value = $trimmable ? rtrim($sExec) : $sExec; + $output->writeln(''); + + if (isset($tmpExe)) { + unlink($tmpExe); + } + + return $value; + } + + if (self::$stty && Terminal::hasSttyAvailable()) { + $sttyMode = shell_exec('stty -g'); + shell_exec('stty -echo'); + } elseif ($this->isInteractiveInput($inputStream)) { + throw new RuntimeException('Unable to hide the response.'); + } + + $value = fgets($inputStream, 4096); + + if (self::$stty && Terminal::hasSttyAvailable()) { + shell_exec('stty '.$sttyMode); + } + + if (false === $value) { + throw new MissingInputException('Aborted.'); + } + if ($trimmable) { + $value = trim($value); + } + $output->writeln(''); + + return $value; + } + + /** + * Validates an attempt. + * + * @param callable $interviewer A callable that will ask for a question and return the result + * + * @return mixed The validated response + * + * @throws \Exception In case the max number of attempts has been reached and no valid response has been given + */ + private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question) + { + $error = null; + $attempts = $question->getMaxAttempts(); + + while (null === $attempts || $attempts--) { + if (null !== $error) { + $this->writeError($output, $error); + } + + try { + return $question->getValidator()($interviewer()); + } catch (RuntimeException $e) { + throw $e; + } catch (\Exception $error) { + } + } + + throw $error; + } + + private function isInteractiveInput($inputStream): bool + { + if ('php://stdin' !== (stream_get_meta_data($inputStream)['uri'] ?? null)) { + return false; + } + + if (null !== self::$stdinIsInteractive) { + return self::$stdinIsInteractive; + } + + return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); + } + + /** + * Reads one or more lines of input and returns what is read. + * + * @param resource $inputStream The handler resource + * @param Question $question The question being asked + * + * @return string|false The input received, false in case input could not be read + */ + private function readInput($inputStream, Question $question) + { + if (!$question->isMultiline()) { + $cp = $this->setIOCodepage(); + $ret = fgets($inputStream, 4096); + + return $this->resetIOCodepage($cp, $ret); + } + + $multiLineStreamReader = $this->cloneInputStream($inputStream); + if (null === $multiLineStreamReader) { + return false; + } + + $ret = ''; + $cp = $this->setIOCodepage(); + while (false !== ($char = fgetc($multiLineStreamReader))) { + if (\PHP_EOL === "{$ret}{$char}") { + break; + } + $ret .= $char; + } + + return $this->resetIOCodepage($cp, $ret); + } + + /** + * Sets console I/O to the host code page. + * + * @return int Previous code page in IBM/EBCDIC format + */ + private function setIOCodepage(): int + { + if (\function_exists('sapi_windows_cp_set')) { + $cp = sapi_windows_cp_get(); + sapi_windows_cp_set(sapi_windows_cp_get('oem')); + + return $cp; + } + + return 0; + } + + /** + * Sets console I/O to the specified code page and converts the user input. + * + * @param string|false $input + * + * @return string|false + */ + private function resetIOCodepage(int $cp, $input) + { + if (0 !== $cp) { + sapi_windows_cp_set($cp); + + if (false !== $input && '' !== $input) { + $input = sapi_windows_cp_conv(sapi_windows_cp_get('oem'), $cp, $input); + } + } + + return $input; + } + + /** + * Clones an input stream in order to act on one instance of the same + * stream without affecting the other instance. + * + * @param resource $inputStream The handler resource + * + * @return resource|null The cloned resource, null in case it could not be cloned + */ + private function cloneInputStream($inputStream) + { + $streamMetaData = stream_get_meta_data($inputStream); + $seekable = $streamMetaData['seekable'] ?? false; + $mode = $streamMetaData['mode'] ?? 'rb'; + $uri = $streamMetaData['uri'] ?? null; + + if (null === $uri) { + return null; + } + + $cloneStream = fopen($uri, $mode); + + // For seekable and writable streams, add all the same data to the + // cloned stream and then seek to the same offset. + if (true === $seekable && !\in_array($mode, ['r', 'rb', 'rt'])) { + $offset = ftell($inputStream); + rewind($inputStream); + stream_copy_to_stream($inputStream, $cloneStream); + fseek($inputStream, $offset); + fseek($cloneStream, $offset); + } + + return $cloneStream; + } +} diff --git a/trunk/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/trunk/vendor/symfony/console/Helper/SymfonyQuestionHelper.php new file mode 100644 index 00000000..01f94aba --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/SymfonyQuestionHelper.php @@ -0,0 +1,109 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; +use Symfony\Component\Console\Style\SymfonyStyle; + +/** + * Symfony Style Guide compliant question helper. + * + * @author Kevin Bond + */ +class SymfonyQuestionHelper extends QuestionHelper +{ + /** + * {@inheritdoc} + */ + protected function writePrompt(OutputInterface $output, Question $question) + { + $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); + $default = $question->getDefault(); + + if ($question->isMultiline()) { + $text .= sprintf(' (press %s to continue)', $this->getEofShortcut()); + } + + switch (true) { + case null === $default: + $text = sprintf(' %s:', $text); + + break; + + case $question instanceof ConfirmationQuestion: + $text = sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); + + break; + + case $question instanceof ChoiceQuestion && $question->isMultiselect(): + $choices = $question->getChoices(); + $default = explode(',', $default); + + foreach ($default as $key => $value) { + $default[$key] = $choices[trim($value)]; + } + + $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); + + break; + + case $question instanceof ChoiceQuestion: + $choices = $question->getChoices(); + $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); + + break; + + default: + $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); + } + + $output->writeln($text); + + $prompt = ' > '; + + if ($question instanceof ChoiceQuestion) { + $output->writeln($this->formatChoiceQuestionChoices($question, 'comment')); + + $prompt = $question->getPrompt(); + } + + $output->write($prompt); + } + + /** + * {@inheritdoc} + */ + protected function writeError(OutputInterface $output, \Exception $error) + { + if ($output instanceof SymfonyStyle) { + $output->newLine(); + $output->error($error->getMessage()); + + return; + } + + parent::writeError($output, $error); + } + + private function getEofShortcut(): string + { + if ('Windows' === \PHP_OS_FAMILY) { + return 'Ctrl+Z then Enter'; + } + + return 'Ctrl+D'; + } +} diff --git a/trunk/vendor/symfony/console/Helper/Table.php b/trunk/vendor/symfony/console/Helper/Table.php new file mode 100644 index 00000000..698f9693 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/Table.php @@ -0,0 +1,917 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\RuntimeException; +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface; +use Symfony\Component\Console\Output\ConsoleSectionOutput; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Provides helpers to display a table. + * + * @author Fabien Potencier + * @author Саша Стаменковић + * @author Abdellatif Ait boudad + * @author Max Grigorian + * @author Dany Maillard + */ +class Table +{ + private const SEPARATOR_TOP = 0; + private const SEPARATOR_TOP_BOTTOM = 1; + private const SEPARATOR_MID = 2; + private const SEPARATOR_BOTTOM = 3; + private const BORDER_OUTSIDE = 0; + private const BORDER_INSIDE = 1; + + private $headerTitle; + private $footerTitle; + + /** + * Table headers. + */ + private $headers = []; + + /** + * Table rows. + */ + private $rows = []; + private $horizontal = false; + + /** + * Column widths cache. + */ + private $effectiveColumnWidths = []; + + /** + * Number of columns cache. + * + * @var int + */ + private $numberOfColumns; + + /** + * @var OutputInterface + */ + private $output; + + /** + * @var TableStyle + */ + private $style; + + /** + * @var array + */ + private $columnStyles = []; + + /** + * User set column widths. + * + * @var array + */ + private $columnWidths = []; + private $columnMaxWidths = []; + + /** + * @var array|null + */ + private static $styles; + + private $rendered = false; + + public function __construct(OutputInterface $output) + { + $this->output = $output; + + if (!self::$styles) { + self::$styles = self::initStyles(); + } + + $this->setStyle('default'); + } + + /** + * Sets a style definition. + */ + public static function setStyleDefinition(string $name, TableStyle $style) + { + if (!self::$styles) { + self::$styles = self::initStyles(); + } + + self::$styles[$name] = $style; + } + + /** + * Gets a style definition by name. + * + * @return TableStyle + */ + public static function getStyleDefinition(string $name) + { + if (!self::$styles) { + self::$styles = self::initStyles(); + } + + if (isset(self::$styles[$name])) { + return self::$styles[$name]; + } + + throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + } + + /** + * Sets table style. + * + * @param TableStyle|string $name The style name or a TableStyle instance + * + * @return $this + */ + public function setStyle($name) + { + $this->style = $this->resolveStyle($name); + + return $this; + } + + /** + * Gets the current table style. + * + * @return TableStyle + */ + public function getStyle() + { + return $this->style; + } + + /** + * Sets table column style. + * + * @param TableStyle|string $name The style name or a TableStyle instance + * + * @return $this + */ + public function setColumnStyle(int $columnIndex, $name) + { + $this->columnStyles[$columnIndex] = $this->resolveStyle($name); + + return $this; + } + + /** + * Gets the current style for a column. + * + * If style was not set, it returns the global table style. + * + * @return TableStyle + */ + public function getColumnStyle(int $columnIndex) + { + return $this->columnStyles[$columnIndex] ?? $this->getStyle(); + } + + /** + * Sets the minimum width of a column. + * + * @return $this + */ + public function setColumnWidth(int $columnIndex, int $width) + { + $this->columnWidths[$columnIndex] = $width; + + return $this; + } + + /** + * Sets the minimum width of all columns. + * + * @return $this + */ + public function setColumnWidths(array $widths) + { + $this->columnWidths = []; + foreach ($widths as $index => $width) { + $this->setColumnWidth($index, $width); + } + + return $this; + } + + /** + * Sets the maximum width of a column. + * + * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while + * formatted strings are preserved. + * + * @return $this + */ + public function setColumnMaxWidth(int $columnIndex, int $width): self + { + if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { + throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); + } + + $this->columnMaxWidths[$columnIndex] = $width; + + return $this; + } + + /** + * @return $this + */ + public function setHeaders(array $headers) + { + $headers = array_values($headers); + if (!empty($headers) && !\is_array($headers[0])) { + $headers = [$headers]; + } + + $this->headers = $headers; + + return $this; + } + + public function setRows(array $rows) + { + $this->rows = []; + + return $this->addRows($rows); + } + + /** + * @return $this + */ + public function addRows(array $rows) + { + foreach ($rows as $row) { + $this->addRow($row); + } + + return $this; + } + + /** + * @return $this + */ + public function addRow($row) + { + if ($row instanceof TableSeparator) { + $this->rows[] = $row; + + return $this; + } + + if (!\is_array($row)) { + throw new InvalidArgumentException('A row must be an array or a TableSeparator instance.'); + } + + $this->rows[] = array_values($row); + + return $this; + } + + /** + * Adds a row to the table, and re-renders the table. + * + * @return $this + */ + public function appendRow($row): self + { + if (!$this->output instanceof ConsoleSectionOutput) { + throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); + } + + if ($this->rendered) { + $this->output->clear($this->calculateRowCount()); + } + + $this->addRow($row); + $this->render(); + + return $this; + } + + /** + * @return $this + */ + public function setRow($column, array $row) + { + $this->rows[$column] = $row; + + return $this; + } + + /** + * @return $this + */ + public function setHeaderTitle(?string $title): self + { + $this->headerTitle = $title; + + return $this; + } + + /** + * @return $this + */ + public function setFooterTitle(?string $title): self + { + $this->footerTitle = $title; + + return $this; + } + + /** + * @return $this + */ + public function setHorizontal(bool $horizontal = true): self + { + $this->horizontal = $horizontal; + + return $this; + } + + /** + * Renders table to output. + * + * Example: + * + * +---------------+-----------------------+------------------+ + * | ISBN | Title | Author | + * +---------------+-----------------------+------------------+ + * | 99921-58-10-7 | Divine Comedy | Dante Alighieri | + * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | + * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | + * +---------------+-----------------------+------------------+ + */ + public function render() + { + $divider = new TableSeparator(); + if ($this->horizontal) { + $rows = []; + foreach ($this->headers[0] ?? [] as $i => $header) { + $rows[$i] = [$header]; + foreach ($this->rows as $row) { + if ($row instanceof TableSeparator) { + continue; + } + if (isset($row[$i])) { + $rows[$i][] = $row[$i]; + } elseif ($rows[$i][0] instanceof TableCell && $rows[$i][0]->getColspan() >= 2) { + // Noop, there is a "title" + } else { + $rows[$i][] = null; + } + } + } + } else { + $rows = array_merge($this->headers, [$divider], $this->rows); + } + + $this->calculateNumberOfColumns($rows); + + $rowGroups = $this->buildTableRows($rows); + $this->calculateColumnsWidth($rowGroups); + + $isHeader = !$this->horizontal; + $isFirstRow = $this->horizontal; + $hasTitle = (bool) $this->headerTitle; + + foreach ($rowGroups as $rowGroup) { + $isHeaderSeparatorRendered = false; + + foreach ($rowGroup as $row) { + if ($divider === $row) { + $isHeader = false; + $isFirstRow = true; + + continue; + } + + if ($row instanceof TableSeparator) { + $this->renderRowSeparator(); + + continue; + } + + if (!$row) { + continue; + } + + if ($isHeader && !$isHeaderSeparatorRendered) { + $this->renderRowSeparator( + $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, + $hasTitle ? $this->headerTitle : null, + $hasTitle ? $this->style->getHeaderTitleFormat() : null + ); + $hasTitle = false; + $isHeaderSeparatorRendered = true; + } + + if ($isFirstRow) { + $this->renderRowSeparator( + $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, + $hasTitle ? $this->headerTitle : null, + $hasTitle ? $this->style->getHeaderTitleFormat() : null + ); + $isFirstRow = false; + $hasTitle = false; + } + + if ($this->horizontal) { + $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); + } else { + $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); + } + } + } + $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat()); + + $this->cleanup(); + $this->rendered = true; + } + + /** + * Renders horizontal header separator. + * + * Example: + * + * +-----+-----------+-------+ + */ + private function renderRowSeparator(int $type = self::SEPARATOR_MID, ?string $title = null, ?string $titleFormat = null) + { + if (0 === $count = $this->numberOfColumns) { + return; + } + + $borders = $this->style->getBorderChars(); + if (!$borders[0] && !$borders[2] && !$this->style->getCrossingChar()) { + return; + } + + $crossings = $this->style->getCrossingChars(); + if (self::SEPARATOR_MID === $type) { + [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]]; + } elseif (self::SEPARATOR_TOP === $type) { + [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]]; + } elseif (self::SEPARATOR_TOP_BOTTOM === $type) { + [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]]; + } else { + [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]]; + } + + $markup = $leftChar; + for ($column = 0; $column < $count; ++$column) { + $markup .= str_repeat($horizontal, $this->effectiveColumnWidths[$column]); + $markup .= $column === $count - 1 ? $rightChar : $midChar; + } + + if (null !== $title) { + $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title))); + $markupLength = Helper::width($markup); + if ($titleLength > $limit = $markupLength - 4) { + $titleLength = $limit; + $formatLength = Helper::width(Helper::removeDecoration($formatter, sprintf($titleFormat, ''))); + $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); + } + + $titleStart = intdiv($markupLength - $titleLength, 2); + if (false === mb_detect_encoding($markup, null, true)) { + $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength); + } else { + $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength); + } + } + + $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); + } + + /** + * Renders vertical column separator. + */ + private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string + { + $borders = $this->style->getBorderChars(); + + return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); + } + + /** + * Renders table row. + * + * Example: + * + * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | + */ + private function renderRow(array $row, string $cellFormat, ?string $firstCellFormat = null) + { + $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); + $columns = $this->getRowColumns($row); + $last = \count($columns) - 1; + foreach ($columns as $i => $column) { + if ($firstCellFormat && 0 === $i) { + $rowContent .= $this->renderCell($row, $column, $firstCellFormat); + } else { + $rowContent .= $this->renderCell($row, $column, $cellFormat); + } + $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE); + } + $this->output->writeln($rowContent); + } + + /** + * Renders table cell with padding. + */ + private function renderCell(array $row, int $column, string $cellFormat): string + { + $cell = $row[$column] ?? ''; + $width = $this->effectiveColumnWidths[$column]; + if ($cell instanceof TableCell && $cell->getColspan() > 1) { + // add the width of the following columns(numbers of colspan). + foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) { + $width += $this->getColumnSeparatorWidth() + $this->effectiveColumnWidths[$nextColumn]; + } + } + + // str_pad won't work properly with multi-byte strings, we need to fix the padding + if (false !== $encoding = mb_detect_encoding($cell, null, true)) { + $width += \strlen($cell) - mb_strwidth($cell, $encoding); + } + + $style = $this->getColumnStyle($column); + + if ($cell instanceof TableSeparator) { + return sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); + } + + $width += Helper::length($cell) - Helper::length(Helper::removeDecoration($this->output->getFormatter(), $cell)); + $content = sprintf($style->getCellRowContentFormat(), $cell); + + $padType = $style->getPadType(); + if ($cell instanceof TableCell && $cell->getStyle() instanceof TableCellStyle) { + $isNotStyledByTag = !preg_match('/^<(\w+|(\w+=[\w,]+;?)*)>.+<\/(\w+|(\w+=\w+;?)*)?>$/', $cell); + if ($isNotStyledByTag) { + $cellFormat = $cell->getStyle()->getCellFormat(); + if (!\is_string($cellFormat)) { + $tag = http_build_query($cell->getStyle()->getTagOptions(), '', ';'); + $cellFormat = '<'.$tag.'>%s'; + } + + if (strstr($content, '')) { + $content = str_replace('', '', $content); + $width -= 3; + } + if (strstr($content, '')) { + $content = str_replace('', '', $content); + $width -= \strlen(''); + } + } + + $padType = $cell->getStyle()->getPadByAlign(); + } + + return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); + } + + /** + * Calculate number of columns for this table. + */ + private function calculateNumberOfColumns(array $rows) + { + $columns = [0]; + foreach ($rows as $row) { + if ($row instanceof TableSeparator) { + continue; + } + + $columns[] = $this->getNumberOfColumns($row); + } + + $this->numberOfColumns = max($columns); + } + + private function buildTableRows(array $rows): TableRows + { + /** @var WrappableOutputFormatterInterface $formatter */ + $formatter = $this->output->getFormatter(); + $unmergedRows = []; + for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) { + $rows = $this->fillNextRows($rows, $rowKey); + + // Remove any new line breaks and replace it with a new line + foreach ($rows[$rowKey] as $column => $cell) { + $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1; + + if (isset($this->columnMaxWidths[$column]) && Helper::width(Helper::removeDecoration($formatter, $cell)) > $this->columnMaxWidths[$column]) { + $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan); + } + if (!strstr($cell ?? '', "\n")) { + continue; + } + $eol = str_contains($cell ?? '', "\r\n") ? "\r\n" : "\n"; + $escaped = implode($eol, array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode($eol, $cell))); + $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; + $lines = explode($eol, str_replace($eol, ''.$eol, $cell)); + foreach ($lines as $lineKey => $line) { + if ($colspan > 1) { + $line = new TableCell($line, ['colspan' => $colspan]); + } + if (0 === $lineKey) { + $rows[$rowKey][$column] = $line; + } else { + if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) { + $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey); + } + $unmergedRows[$rowKey][$lineKey][$column] = $line; + } + } + } + } + + return new TableRows(function () use ($rows, $unmergedRows): \Traversable { + foreach ($rows as $rowKey => $row) { + $rowGroup = [$row instanceof TableSeparator ? $row : $this->fillCells($row)]; + + if (isset($unmergedRows[$rowKey])) { + foreach ($unmergedRows[$rowKey] as $row) { + $rowGroup[] = $row instanceof TableSeparator ? $row : $this->fillCells($row); + } + } + yield $rowGroup; + } + }); + } + + private function calculateRowCount(): int + { + $numberOfRows = \count(iterator_to_array($this->buildTableRows(array_merge($this->headers, [new TableSeparator()], $this->rows)))); + + if ($this->headers) { + ++$numberOfRows; // Add row for header separator + } + + if (\count($this->rows) > 0) { + ++$numberOfRows; // Add row for footer separator + } + + return $numberOfRows; + } + + /** + * fill rows that contains rowspan > 1. + * + * @throws InvalidArgumentException + */ + private function fillNextRows(array $rows, int $line): array + { + $unmergedRows = []; + foreach ($rows[$line] as $column => $cell) { + if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { + throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); + } + if ($cell instanceof TableCell && $cell->getRowspan() > 1) { + $nbLines = $cell->getRowspan() - 1; + $lines = [$cell]; + if (strstr($cell, "\n")) { + $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; + $lines = explode($eol, str_replace($eol, ''.$eol.'', $cell)); + $nbLines = \count($lines) > $nbLines ? substr_count($cell, $eol) : $nbLines; + + $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); + unset($lines[0]); + } + + // create a two dimensional array (rowspan x colspan) + $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows); + foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { + $value = $lines[$unmergedRowKey - $line] ?? ''; + $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); + if ($nbLines === $unmergedRowKey - $line) { + break; + } + } + } + } + + foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { + // we need to know if $unmergedRow will be merged or inserted into $rows + if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) { + foreach ($unmergedRow as $cellKey => $cell) { + // insert cell into row at cellKey position + array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]); + } + } else { + $row = $this->copyRow($rows, $unmergedRowKey - 1); + foreach ($unmergedRow as $column => $cell) { + if (!empty($cell)) { + $row[$column] = $unmergedRow[$column]; + } + } + array_splice($rows, $unmergedRowKey, 0, [$row]); + } + } + + return $rows; + } + + /** + * fill cells for a row that contains colspan > 1. + */ + private function fillCells(iterable $row) + { + $newRow = []; + + foreach ($row as $column => $cell) { + $newRow[] = $cell; + if ($cell instanceof TableCell && $cell->getColspan() > 1) { + foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) { + // insert empty value at column position + $newRow[] = ''; + } + } + } + + return $newRow ?: $row; + } + + private function copyRow(array $rows, int $line): array + { + $row = $rows[$line]; + foreach ($row as $cellKey => $cellValue) { + $row[$cellKey] = ''; + if ($cellValue instanceof TableCell) { + $row[$cellKey] = new TableCell('', ['colspan' => $cellValue->getColspan()]); + } + } + + return $row; + } + + /** + * Gets number of columns by row. + */ + private function getNumberOfColumns(array $row): int + { + $columns = \count($row); + foreach ($row as $column) { + $columns += $column instanceof TableCell ? ($column->getColspan() - 1) : 0; + } + + return $columns; + } + + /** + * Gets list of columns for the given row. + */ + private function getRowColumns(array $row): array + { + $columns = range(0, $this->numberOfColumns - 1); + foreach ($row as $cellKey => $cell) { + if ($cell instanceof TableCell && $cell->getColspan() > 1) { + // exclude grouped columns. + $columns = array_diff($columns, range($cellKey + 1, $cellKey + $cell->getColspan() - 1)); + } + } + + return $columns; + } + + /** + * Calculates columns widths. + */ + private function calculateColumnsWidth(iterable $groups) + { + for ($column = 0; $column < $this->numberOfColumns; ++$column) { + $lengths = []; + foreach ($groups as $group) { + foreach ($group as $row) { + if ($row instanceof TableSeparator) { + continue; + } + + foreach ($row as $i => $cell) { + if ($cell instanceof TableCell) { + $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); + $textLength = Helper::width($textContent); + if ($textLength > 0) { + $contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan())); + foreach ($contentColumns as $position => $content) { + $row[$i + $position] = $content; + } + } + } + } + + $lengths[] = $this->getCellWidth($row, $column); + } + } + + $this->effectiveColumnWidths[$column] = max($lengths) + Helper::width($this->style->getCellRowContentFormat()) - 2; + } + } + + private function getColumnSeparatorWidth(): int + { + return Helper::width(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); + } + + private function getCellWidth(array $row, int $column): int + { + $cellWidth = 0; + + if (isset($row[$column])) { + $cell = $row[$column]; + $cellWidth = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $cell)); + } + + $columnWidth = $this->columnWidths[$column] ?? 0; + $cellWidth = max($cellWidth, $columnWidth); + + return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth; + } + + /** + * Called after rendering to cleanup cache data. + */ + private function cleanup() + { + $this->effectiveColumnWidths = []; + $this->numberOfColumns = null; + } + + /** + * @return array + */ + private static function initStyles(): array + { + $borderless = new TableStyle(); + $borderless + ->setHorizontalBorderChars('=') + ->setVerticalBorderChars(' ') + ->setDefaultCrossingChar(' ') + ; + + $compact = new TableStyle(); + $compact + ->setHorizontalBorderChars('') + ->setVerticalBorderChars('') + ->setDefaultCrossingChar('') + ->setCellRowContentFormat('%s ') + ; + + $styleGuide = new TableStyle(); + $styleGuide + ->setHorizontalBorderChars('-') + ->setVerticalBorderChars(' ') + ->setDefaultCrossingChar(' ') + ->setCellHeaderFormat('%s') + ; + + $box = (new TableStyle()) + ->setHorizontalBorderChars('─') + ->setVerticalBorderChars('│') + ->setCrossingChars('┼', '┌', '┬', '┐', '┤', '┘', '┴', '└', '├') + ; + + $boxDouble = (new TableStyle()) + ->setHorizontalBorderChars('═', '─') + ->setVerticalBorderChars('║', '│') + ->setCrossingChars('┼', '╔', '╤', '╗', '╢', '╝', '╧', '╚', '╟', '╠', '╪', '╣') + ; + + return [ + 'default' => new TableStyle(), + 'borderless' => $borderless, + 'compact' => $compact, + 'symfony-style-guide' => $styleGuide, + 'box' => $box, + 'box-double' => $boxDouble, + ]; + } + + private function resolveStyle($name): TableStyle + { + if ($name instanceof TableStyle) { + return $name; + } + + if (isset(self::$styles[$name])) { + return self::$styles[$name]; + } + + throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + } +} diff --git a/trunk/vendor/symfony/console/Helper/TableCell.php b/trunk/vendor/symfony/console/Helper/TableCell.php new file mode 100644 index 00000000..1a7bc6ed --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/TableCell.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Exception\InvalidArgumentException; + +/** + * @author Abdellatif Ait boudad + */ +class TableCell +{ + private $value; + private $options = [ + 'rowspan' => 1, + 'colspan' => 1, + 'style' => null, + ]; + + public function __construct(string $value = '', array $options = []) + { + $this->value = $value; + + // check option names + if ($diff = array_diff(array_keys($options), array_keys($this->options))) { + throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); + } + + if (isset($options['style']) && !$options['style'] instanceof TableCellStyle) { + throw new InvalidArgumentException('The style option must be an instance of "TableCellStyle".'); + } + + $this->options = array_merge($this->options, $options); + } + + /** + * Returns the cell value. + * + * @return string + */ + public function __toString() + { + return $this->value; + } + + /** + * Gets number of colspan. + * + * @return int + */ + public function getColspan() + { + return (int) $this->options['colspan']; + } + + /** + * Gets number of rowspan. + * + * @return int + */ + public function getRowspan() + { + return (int) $this->options['rowspan']; + } + + public function getStyle(): ?TableCellStyle + { + return $this->options['style']; + } +} diff --git a/trunk/vendor/symfony/console/Helper/TableCellStyle.php b/trunk/vendor/symfony/console/Helper/TableCellStyle.php new file mode 100644 index 00000000..19cd0ffc --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/TableCellStyle.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Exception\InvalidArgumentException; + +/** + * @author Yewhen Khoptynskyi + */ +class TableCellStyle +{ + public const DEFAULT_ALIGN = 'left'; + + private const TAG_OPTIONS = [ + 'fg', + 'bg', + 'options', + ]; + + private const ALIGN_MAP = [ + 'left' => \STR_PAD_RIGHT, + 'center' => \STR_PAD_BOTH, + 'right' => \STR_PAD_LEFT, + ]; + + private $options = [ + 'fg' => 'default', + 'bg' => 'default', + 'options' => null, + 'align' => self::DEFAULT_ALIGN, + 'cellFormat' => null, + ]; + + public function __construct(array $options = []) + { + if ($diff = array_diff(array_keys($options), array_keys($this->options))) { + throw new InvalidArgumentException(sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); + } + + if (isset($options['align']) && !\array_key_exists($options['align'], self::ALIGN_MAP)) { + throw new InvalidArgumentException(sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); + } + + $this->options = array_merge($this->options, $options); + } + + public function getOptions(): array + { + return $this->options; + } + + /** + * Gets options we need for tag for example fg, bg. + * + * @return string[] + */ + public function getTagOptions() + { + return array_filter( + $this->getOptions(), + function ($key) { + return \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]); + }, + \ARRAY_FILTER_USE_KEY + ); + } + + /** + * @return int + */ + public function getPadByAlign() + { + return self::ALIGN_MAP[$this->getOptions()['align']]; + } + + public function getCellFormat(): ?string + { + return $this->getOptions()['cellFormat']; + } +} diff --git a/trunk/vendor/symfony/console/Helper/TableRows.php b/trunk/vendor/symfony/console/Helper/TableRows.php new file mode 100644 index 00000000..cbc07d29 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/TableRows.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +/** + * @internal + */ +class TableRows implements \IteratorAggregate +{ + private $generator; + + public function __construct(\Closure $generator) + { + $this->generator = $generator; + } + + public function getIterator(): \Traversable + { + return ($this->generator)(); + } +} diff --git a/trunk/vendor/symfony/console/Helper/TableSeparator.php b/trunk/vendor/symfony/console/Helper/TableSeparator.php new file mode 100644 index 00000000..e541c531 --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/TableSeparator.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +/** + * Marks a row as being a separator. + * + * @author Fabien Potencier + */ +class TableSeparator extends TableCell +{ + public function __construct(array $options = []) + { + parent::__construct('', $options); + } +} diff --git a/trunk/vendor/symfony/console/Helper/TableStyle.php b/trunk/vendor/symfony/console/Helper/TableStyle.php new file mode 100644 index 00000000..0643c79e --- /dev/null +++ b/trunk/vendor/symfony/console/Helper/TableStyle.php @@ -0,0 +1,376 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; + +/** + * Defines the styles for a Table. + * + * @author Fabien Potencier + * @author Саша Стаменковић + * @author Dany Maillard + */ +class TableStyle +{ + private $paddingChar = ' '; + private $horizontalOutsideBorderChar = '-'; + private $horizontalInsideBorderChar = '-'; + private $verticalOutsideBorderChar = '|'; + private $verticalInsideBorderChar = '|'; + private $crossingChar = '+'; + private $crossingTopRightChar = '+'; + private $crossingTopMidChar = '+'; + private $crossingTopLeftChar = '+'; + private $crossingMidRightChar = '+'; + private $crossingBottomRightChar = '+'; + private $crossingBottomMidChar = '+'; + private $crossingBottomLeftChar = '+'; + private $crossingMidLeftChar = '+'; + private $crossingTopLeftBottomChar = '+'; + private $crossingTopMidBottomChar = '+'; + private $crossingTopRightBottomChar = '+'; + private $headerTitleFormat = ' %s '; + private $footerTitleFormat = ' %s '; + private $cellHeaderFormat = '%s'; + private $cellRowFormat = '%s'; + private $cellRowContentFormat = ' %s '; + private $borderFormat = '%s'; + private $padType = \STR_PAD_RIGHT; + + /** + * Sets padding character, used for cell padding. + * + * @return $this + */ + public function setPaddingChar(string $paddingChar) + { + if (!$paddingChar) { + throw new LogicException('The padding char must not be empty.'); + } + + $this->paddingChar = $paddingChar; + + return $this; + } + + /** + * Gets padding character, used for cell padding. + * + * @return string + */ + public function getPaddingChar() + { + return $this->paddingChar; + } + + /** + * Sets horizontal border characters. + * + * + * ╔═══════════════╤══════════════════════════╤══════════════════╗ + * 1 ISBN 2 Title │ Author ║ + * ╠═══════════════╪══════════════════════════╪══════════════════╣ + * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ + * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ + * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ + * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ + * ╚═══════════════╧══════════════════════════╧══════════════════╝ + * + * + * @return $this + */ + public function setHorizontalBorderChars(string $outside, ?string $inside = null): self + { + $this->horizontalOutsideBorderChar = $outside; + $this->horizontalInsideBorderChar = $inside ?? $outside; + + return $this; + } + + /** + * Sets vertical border characters. + * + * + * ╔═══════════════╤══════════════════════════╤══════════════════╗ + * ║ ISBN │ Title │ Author ║ + * ╠═══════1═══════╪══════════════════════════╪══════════════════╣ + * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ + * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ + * ╟───────2───────┼──────────────────────────┼──────────────────╢ + * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ + * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ + * ╚═══════════════╧══════════════════════════╧══════════════════╝ + * + * + * @return $this + */ + public function setVerticalBorderChars(string $outside, ?string $inside = null): self + { + $this->verticalOutsideBorderChar = $outside; + $this->verticalInsideBorderChar = $inside ?? $outside; + + return $this; + } + + /** + * Gets border characters. + * + * @internal + */ + public function getBorderChars(): array + { + return [ + $this->horizontalOutsideBorderChar, + $this->verticalOutsideBorderChar, + $this->horizontalInsideBorderChar, + $this->verticalInsideBorderChar, + ]; + } + + /** + * Sets crossing characters. + * + * Example: + * + * 1═══════════════2══════════════════════════2══════════════════3 + * ║ ISBN │ Title │ Author ║ + * 8'══════════════0'═════════════════════════0'═════════════════4' + * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ + * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ + * 8───────────────0──────────────────────────0──────────────────4 + * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ + * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ + * 7═══════════════6══════════════════════════6══════════════════5 + * + * + * @param string $cross Crossing char (see #0 of example) + * @param string $topLeft Top left char (see #1 of example) + * @param string $topMid Top mid char (see #2 of example) + * @param string $topRight Top right char (see #3 of example) + * @param string $midRight Mid right char (see #4 of example) + * @param string $bottomRight Bottom right char (see #5 of example) + * @param string $bottomMid Bottom mid char (see #6 of example) + * @param string $bottomLeft Bottom left char (see #7 of example) + * @param string $midLeft Mid left char (see #8 of example) + * @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null + * @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null + * @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null + * + * @return $this + */ + public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, ?string $topLeftBottom = null, ?string $topMidBottom = null, ?string $topRightBottom = null): self + { + $this->crossingChar = $cross; + $this->crossingTopLeftChar = $topLeft; + $this->crossingTopMidChar = $topMid; + $this->crossingTopRightChar = $topRight; + $this->crossingMidRightChar = $midRight; + $this->crossingBottomRightChar = $bottomRight; + $this->crossingBottomMidChar = $bottomMid; + $this->crossingBottomLeftChar = $bottomLeft; + $this->crossingMidLeftChar = $midLeft; + $this->crossingTopLeftBottomChar = $topLeftBottom ?? $midLeft; + $this->crossingTopMidBottomChar = $topMidBottom ?? $cross; + $this->crossingTopRightBottomChar = $topRightBottom ?? $midRight; + + return $this; + } + + /** + * Sets default crossing character used for each cross. + * + * @see {@link setCrossingChars()} for setting each crossing individually. + */ + public function setDefaultCrossingChar(string $char): self + { + return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char); + } + + /** + * Gets crossing character. + * + * @return string + */ + public function getCrossingChar() + { + return $this->crossingChar; + } + + /** + * Gets crossing characters. + * + * @internal + */ + public function getCrossingChars(): array + { + return [ + $this->crossingChar, + $this->crossingTopLeftChar, + $this->crossingTopMidChar, + $this->crossingTopRightChar, + $this->crossingMidRightChar, + $this->crossingBottomRightChar, + $this->crossingBottomMidChar, + $this->crossingBottomLeftChar, + $this->crossingMidLeftChar, + $this->crossingTopLeftBottomChar, + $this->crossingTopMidBottomChar, + $this->crossingTopRightBottomChar, + ]; + } + + /** + * Sets header cell format. + * + * @return $this + */ + public function setCellHeaderFormat(string $cellHeaderFormat) + { + $this->cellHeaderFormat = $cellHeaderFormat; + + return $this; + } + + /** + * Gets header cell format. + * + * @return string + */ + public function getCellHeaderFormat() + { + return $this->cellHeaderFormat; + } + + /** + * Sets row cell format. + * + * @return $this + */ + public function setCellRowFormat(string $cellRowFormat) + { + $this->cellRowFormat = $cellRowFormat; + + return $this; + } + + /** + * Gets row cell format. + * + * @return string + */ + public function getCellRowFormat() + { + return $this->cellRowFormat; + } + + /** + * Sets row cell content format. + * + * @return $this + */ + public function setCellRowContentFormat(string $cellRowContentFormat) + { + $this->cellRowContentFormat = $cellRowContentFormat; + + return $this; + } + + /** + * Gets row cell content format. + * + * @return string + */ + public function getCellRowContentFormat() + { + return $this->cellRowContentFormat; + } + + /** + * Sets table border format. + * + * @return $this + */ + public function setBorderFormat(string $borderFormat) + { + $this->borderFormat = $borderFormat; + + return $this; + } + + /** + * Gets table border format. + * + * @return string + */ + public function getBorderFormat() + { + return $this->borderFormat; + } + + /** + * Sets cell padding type. + * + * @return $this + */ + public function setPadType(int $padType) + { + if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) { + throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); + } + + $this->padType = $padType; + + return $this; + } + + /** + * Gets cell padding type. + * + * @return int + */ + public function getPadType() + { + return $this->padType; + } + + public function getHeaderTitleFormat(): string + { + return $this->headerTitleFormat; + } + + /** + * @return $this + */ + public function setHeaderTitleFormat(string $format): self + { + $this->headerTitleFormat = $format; + + return $this; + } + + public function getFooterTitleFormat(): string + { + return $this->footerTitleFormat; + } + + /** + * @return $this + */ + public function setFooterTitleFormat(string $format): self + { + $this->footerTitleFormat = $format; + + return $this; + } +} diff --git a/trunk/vendor/symfony/console/Input/ArgvInput.php b/trunk/vendor/symfony/console/Input/ArgvInput.php new file mode 100644 index 00000000..0c4b2d25 --- /dev/null +++ b/trunk/vendor/symfony/console/Input/ArgvInput.php @@ -0,0 +1,378 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +use Symfony\Component\Console\Exception\RuntimeException; + +/** + * ArgvInput represents an input coming from the CLI arguments. + * + * Usage: + * + * $input = new ArgvInput(); + * + * By default, the `$_SERVER['argv']` array is used for the input values. + * + * This can be overridden by explicitly passing the input values in the constructor: + * + * $input = new ArgvInput($_SERVER['argv']); + * + * If you pass it yourself, don't forget that the first element of the array + * is the name of the running application. + * + * When passing an argument to the constructor, be sure that it respects + * the same rules as the argv one. It's almost always better to use the + * `StringInput` when you want to provide your own input. + * + * @author Fabien Potencier + * + * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html + * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 + */ +class ArgvInput extends Input +{ + private $tokens; + private $parsed; + + public function __construct(?array $argv = null, ?InputDefinition $definition = null) + { + $argv = $argv ?? $_SERVER['argv'] ?? []; + + // strip the application name + array_shift($argv); + + $this->tokens = $argv; + + parent::__construct($definition); + } + + protected function setTokens(array $tokens) + { + $this->tokens = $tokens; + } + + /** + * {@inheritdoc} + */ + protected function parse() + { + $parseOptions = true; + $this->parsed = $this->tokens; + while (null !== $token = array_shift($this->parsed)) { + $parseOptions = $this->parseToken($token, $parseOptions); + } + } + + protected function parseToken(string $token, bool $parseOptions): bool + { + if ($parseOptions && '' == $token) { + $this->parseArgument($token); + } elseif ($parseOptions && '--' == $token) { + return false; + } elseif ($parseOptions && str_starts_with($token, '--')) { + $this->parseLongOption($token); + } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { + $this->parseShortOption($token); + } else { + $this->parseArgument($token); + } + + return $parseOptions; + } + + /** + * Parses a short option. + */ + private function parseShortOption(string $token) + { + $name = substr($token, 1); + + if (\strlen($name) > 1) { + if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { + // an option with a value (with no space) + $this->addShortOption($name[0], substr($name, 1)); + } else { + $this->parseShortOptionSet($name); + } + } else { + $this->addShortOption($name, null); + } + } + + /** + * Parses a short option set. + * + * @throws RuntimeException When option given doesn't exist + */ + private function parseShortOptionSet(string $name) + { + $len = \strlen($name); + for ($i = 0; $i < $len; ++$i) { + if (!$this->definition->hasShortcut($name[$i])) { + $encoding = mb_detect_encoding($name, null, true); + throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); + } + + $option = $this->definition->getOptionForShortcut($name[$i]); + if ($option->acceptValue()) { + $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); + + break; + } else { + $this->addLongOption($option->getName(), null); + } + } + } + + /** + * Parses a long option. + */ + private function parseLongOption(string $token) + { + $name = substr($token, 2); + + if (false !== $pos = strpos($name, '=')) { + if ('' === $value = substr($name, $pos + 1)) { + array_unshift($this->parsed, $value); + } + $this->addLongOption(substr($name, 0, $pos), $value); + } else { + $this->addLongOption($name, null); + } + } + + /** + * Parses an argument. + * + * @throws RuntimeException When too many arguments are given + */ + private function parseArgument(string $token) + { + $c = \count($this->arguments); + + // if input is expecting another argument, add it + if ($this->definition->hasArgument($c)) { + $arg = $this->definition->getArgument($c); + $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token; + + // if last argument isArray(), append token to last argument + } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { + $arg = $this->definition->getArgument($c - 1); + $this->arguments[$arg->getName()][] = $token; + + // unexpected argument + } else { + $all = $this->definition->getArguments(); + $symfonyCommandName = null; + if (($inputArgument = $all[$key = array_key_first($all)] ?? null) && 'command' === $inputArgument->getName()) { + $symfonyCommandName = $this->arguments['command'] ?? null; + unset($all[$key]); + } + + if (\count($all)) { + if ($symfonyCommandName) { + $message = sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); + } else { + $message = sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); + } + } elseif ($symfonyCommandName) { + $message = sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); + } else { + $message = sprintf('No arguments expected, got "%s".', $token); + } + + throw new RuntimeException($message); + } + } + + /** + * Adds a short option value. + * + * @throws RuntimeException When option given doesn't exist + */ + private function addShortOption(string $shortcut, $value) + { + if (!$this->definition->hasShortcut($shortcut)) { + throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); + } + + $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); + } + + /** + * Adds a long option value. + * + * @throws RuntimeException When option given doesn't exist + */ + private function addLongOption(string $name, $value) + { + if (!$this->definition->hasOption($name)) { + if (!$this->definition->hasNegation($name)) { + throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); + } + + $optionName = $this->definition->negationToName($name); + if (null !== $value) { + throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); + } + $this->options[$optionName] = false; + + return; + } + + $option = $this->definition->getOption($name); + + if (null !== $value && !$option->acceptValue()) { + throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); + } + + if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) { + // if option accepts an optional or mandatory argument + // let's see if there is one provided + $next = array_shift($this->parsed); + if ((isset($next[0]) && '-' !== $next[0]) || \in_array($next, ['', null], true)) { + $value = $next; + } else { + array_unshift($this->parsed, $next); + } + } + + if (null === $value) { + if ($option->isValueRequired()) { + throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); + } + + if (!$option->isArray() && !$option->isValueOptional()) { + $value = true; + } + } + + if ($option->isArray()) { + $this->options[$name][] = $value; + } else { + $this->options[$name] = $value; + } + } + + /** + * {@inheritdoc} + */ + public function getFirstArgument() + { + $isOption = false; + foreach ($this->tokens as $i => $token) { + if ($token && '-' === $token[0]) { + if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) { + continue; + } + + // If it's a long option, consider that everything after "--" is the option name. + // Otherwise, use the last char (if it's a short option set, only the last one can take a value with space separator) + $name = '-' === $token[1] ? substr($token, 2) : substr($token, -1); + if (!isset($this->options[$name]) && !$this->definition->hasShortcut($name)) { + // noop + } elseif ((isset($this->options[$name]) || isset($this->options[$name = $this->definition->shortcutToName($name)])) && $this->tokens[$i + 1] === $this->options[$name]) { + $isOption = true; + } + + continue; + } + + if ($isOption) { + $isOption = false; + continue; + } + + return $token; + } + + return null; + } + + /** + * {@inheritdoc} + */ + public function hasParameterOption($values, bool $onlyParams = false) + { + $values = (array) $values; + + foreach ($this->tokens as $token) { + if ($onlyParams && '--' === $token) { + return false; + } + foreach ($values as $value) { + // Options with values: + // For long options, test for '--option=' at beginning + // For short options, test for '-o' at beginning + $leading = str_starts_with($value, '--') ? $value.'=' : $value; + if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) { + return true; + } + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function getParameterOption($values, $default = false, bool $onlyParams = false) + { + $values = (array) $values; + $tokens = $this->tokens; + + while (0 < \count($tokens)) { + $token = array_shift($tokens); + if ($onlyParams && '--' === $token) { + return $default; + } + + foreach ($values as $value) { + if ($token === $value) { + return array_shift($tokens); + } + // Options with values: + // For long options, test for '--option=' at beginning + // For short options, test for '-o' at beginning + $leading = str_starts_with($value, '--') ? $value.'=' : $value; + if ('' !== $leading && str_starts_with($token, $leading)) { + return substr($token, \strlen($leading)); + } + } + } + + return $default; + } + + /** + * Returns a stringified representation of the args passed to the command. + * + * @return string + */ + public function __toString() + { + $tokens = array_map(function ($token) { + if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { + return $match[1].$this->escapeToken($match[2]); + } + + if ($token && '-' !== $token[0]) { + return $this->escapeToken($token); + } + + return $token; + }, $this->tokens); + + return implode(' ', $tokens); + } +} diff --git a/trunk/vendor/symfony/console/Input/ArrayInput.php b/trunk/vendor/symfony/console/Input/ArrayInput.php new file mode 100644 index 00000000..21a517cf --- /dev/null +++ b/trunk/vendor/symfony/console/Input/ArrayInput.php @@ -0,0 +1,210 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\InvalidOptionException; + +/** + * ArrayInput represents an input provided as an array. + * + * Usage: + * + * $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']); + * + * @author Fabien Potencier + */ +class ArrayInput extends Input +{ + private $parameters; + + public function __construct(array $parameters, ?InputDefinition $definition = null) + { + $this->parameters = $parameters; + + parent::__construct($definition); + } + + /** + * {@inheritdoc} + */ + public function getFirstArgument() + { + foreach ($this->parameters as $param => $value) { + if ($param && \is_string($param) && '-' === $param[0]) { + continue; + } + + return $value; + } + + return null; + } + + /** + * {@inheritdoc} + */ + public function hasParameterOption($values, bool $onlyParams = false) + { + $values = (array) $values; + + foreach ($this->parameters as $k => $v) { + if (!\is_int($k)) { + $v = $k; + } + + if ($onlyParams && '--' === $v) { + return false; + } + + if (\in_array($v, $values)) { + return true; + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function getParameterOption($values, $default = false, bool $onlyParams = false) + { + $values = (array) $values; + + foreach ($this->parameters as $k => $v) { + if ($onlyParams && ('--' === $k || (\is_int($k) && '--' === $v))) { + return $default; + } + + if (\is_int($k)) { + if (\in_array($v, $values)) { + return true; + } + } elseif (\in_array($k, $values)) { + return $v; + } + } + + return $default; + } + + /** + * Returns a stringified representation of the args passed to the command. + * + * @return string + */ + public function __toString() + { + $params = []; + foreach ($this->parameters as $param => $val) { + if ($param && \is_string($param) && '-' === $param[0]) { + $glue = ('-' === $param[1]) ? '=' : ' '; + if (\is_array($val)) { + foreach ($val as $v) { + $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : ''); + } + } else { + $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : ''); + } + } else { + $params[] = \is_array($val) ? implode(' ', array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val); + } + } + + return implode(' ', $params); + } + + /** + * {@inheritdoc} + */ + protected function parse() + { + foreach ($this->parameters as $key => $value) { + if ('--' === $key) { + return; + } + if (str_starts_with($key, '--')) { + $this->addLongOption(substr($key, 2), $value); + } elseif (str_starts_with($key, '-')) { + $this->addShortOption(substr($key, 1), $value); + } else { + $this->addArgument($key, $value); + } + } + } + + /** + * Adds a short option value. + * + * @throws InvalidOptionException When option given doesn't exist + */ + private function addShortOption(string $shortcut, $value) + { + if (!$this->definition->hasShortcut($shortcut)) { + throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); + } + + $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); + } + + /** + * Adds a long option value. + * + * @throws InvalidOptionException When option given doesn't exist + * @throws InvalidOptionException When a required value is missing + */ + private function addLongOption(string $name, $value) + { + if (!$this->definition->hasOption($name)) { + if (!$this->definition->hasNegation($name)) { + throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); + } + + $optionName = $this->definition->negationToName($name); + $this->options[$optionName] = false; + + return; + } + + $option = $this->definition->getOption($name); + + if (null === $value) { + if ($option->isValueRequired()) { + throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name)); + } + + if (!$option->isValueOptional()) { + $value = true; + } + } + + $this->options[$name] = $value; + } + + /** + * Adds an argument value. + * + * @param string|int $name The argument name + * @param mixed $value The value for the argument + * + * @throws InvalidArgumentException When argument given doesn't exist + */ + private function addArgument($name, $value) + { + if (!$this->definition->hasArgument($name)) { + throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + } + + $this->arguments[$name] = $value; + } +} diff --git a/trunk/vendor/symfony/console/Input/Input.php b/trunk/vendor/symfony/console/Input/Input.php new file mode 100644 index 00000000..0faab2cf --- /dev/null +++ b/trunk/vendor/symfony/console/Input/Input.php @@ -0,0 +1,213 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\RuntimeException; + +/** + * Input is the base class for all concrete Input classes. + * + * Three concrete classes are provided by default: + * + * * `ArgvInput`: The input comes from the CLI arguments (argv) + * * `StringInput`: The input is provided as a string + * * `ArrayInput`: The input is provided as an array + * + * @author Fabien Potencier + */ +abstract class Input implements InputInterface, StreamableInputInterface +{ + protected $definition; + protected $stream; + protected $options = []; + protected $arguments = []; + protected $interactive = true; + + public function __construct(?InputDefinition $definition = null) + { + if (null === $definition) { + $this->definition = new InputDefinition(); + } else { + $this->bind($definition); + $this->validate(); + } + } + + /** + * {@inheritdoc} + */ + public function bind(InputDefinition $definition) + { + $this->arguments = []; + $this->options = []; + $this->definition = $definition; + + $this->parse(); + } + + /** + * Processes command line arguments. + */ + abstract protected function parse(); + + /** + * {@inheritdoc} + */ + public function validate() + { + $definition = $this->definition; + $givenArguments = $this->arguments; + + $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { + return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); + }); + + if (\count($missingArguments) > 0) { + throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); + } + } + + /** + * {@inheritdoc} + */ + public function isInteractive() + { + return $this->interactive; + } + + /** + * {@inheritdoc} + */ + public function setInteractive(bool $interactive) + { + $this->interactive = $interactive; + } + + /** + * {@inheritdoc} + */ + public function getArguments() + { + return array_merge($this->definition->getArgumentDefaults(), $this->arguments); + } + + /** + * {@inheritdoc} + */ + public function getArgument(string $name) + { + if (!$this->definition->hasArgument($name)) { + throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + } + + return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); + } + + /** + * {@inheritdoc} + */ + public function setArgument(string $name, $value) + { + if (!$this->definition->hasArgument($name)) { + throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + } + + $this->arguments[$name] = $value; + } + + /** + * {@inheritdoc} + */ + public function hasArgument(string $name) + { + return $this->definition->hasArgument($name); + } + + /** + * {@inheritdoc} + */ + public function getOptions() + { + return array_merge($this->definition->getOptionDefaults(), $this->options); + } + + /** + * {@inheritdoc} + */ + public function getOption(string $name) + { + if ($this->definition->hasNegation($name)) { + if (null === $value = $this->getOption($this->definition->negationToName($name))) { + return $value; + } + + return !$value; + } + + if (!$this->definition->hasOption($name)) { + throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + } + + return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); + } + + /** + * {@inheritdoc} + */ + public function setOption(string $name, $value) + { + if ($this->definition->hasNegation($name)) { + $this->options[$this->definition->negationToName($name)] = !$value; + + return; + } elseif (!$this->definition->hasOption($name)) { + throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + } + + $this->options[$name] = $value; + } + + /** + * {@inheritdoc} + */ + public function hasOption(string $name) + { + return $this->definition->hasOption($name) || $this->definition->hasNegation($name); + } + + /** + * Escapes a token through escapeshellarg if it contains unsafe chars. + * + * @return string + */ + public function escapeToken(string $token) + { + return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); + } + + /** + * {@inheritdoc} + */ + public function setStream($stream) + { + $this->stream = $stream; + } + + /** + * {@inheritdoc} + */ + public function getStream() + { + return $this->stream; + } +} diff --git a/trunk/vendor/symfony/console/Input/InputArgument.php b/trunk/vendor/symfony/console/Input/InputArgument.php new file mode 100644 index 00000000..1a8bf44b --- /dev/null +++ b/trunk/vendor/symfony/console/Input/InputArgument.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; + +/** + * Represents a command line argument. + * + * @author Fabien Potencier + */ +class InputArgument +{ + public const REQUIRED = 1; + public const OPTIONAL = 2; + public const IS_ARRAY = 4; + + private $name; + private $mode; + private $default; + private $description; + + /** + * @param string $name The argument name + * @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY + * @param string $description A description text + * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) + * + * @throws InvalidArgumentException When argument mode is not valid + */ + public function __construct(string $name, ?int $mode = null, string $description = '', $default = null) + { + if (null === $mode) { + $mode = self::OPTIONAL; + } elseif ($mode > 7 || $mode < 1) { + throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); + } + + $this->name = $name; + $this->mode = $mode; + $this->description = $description; + + $this->setDefault($default); + } + + /** + * Returns the argument name. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Returns true if the argument is required. + * + * @return bool true if parameter mode is self::REQUIRED, false otherwise + */ + public function isRequired() + { + return self::REQUIRED === (self::REQUIRED & $this->mode); + } + + /** + * Returns true if the argument can take multiple values. + * + * @return bool true if mode is self::IS_ARRAY, false otherwise + */ + public function isArray() + { + return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); + } + + /** + * Sets the default value. + * + * @param string|bool|int|float|array|null $default + * + * @throws LogicException When incorrect default value is given + */ + public function setDefault($default = null) + { + if ($this->isRequired() && null !== $default) { + throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); + } + + if ($this->isArray()) { + if (null === $default) { + $default = []; + } elseif (!\is_array($default)) { + throw new LogicException('A default value for an array argument must be an array.'); + } + } + + $this->default = $default; + } + + /** + * Returns the default value. + * + * @return string|bool|int|float|array|null + */ + public function getDefault() + { + return $this->default; + } + + /** + * Returns the description text. + * + * @return string + */ + public function getDescription() + { + return $this->description; + } +} diff --git a/trunk/vendor/symfony/console/Input/InputAwareInterface.php b/trunk/vendor/symfony/console/Input/InputAwareInterface.php new file mode 100644 index 00000000..5a288de5 --- /dev/null +++ b/trunk/vendor/symfony/console/Input/InputAwareInterface.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +/** + * InputAwareInterface should be implemented by classes that depends on the + * Console Input. + * + * @author Wouter J + */ +interface InputAwareInterface +{ + /** + * Sets the Console Input. + */ + public function setInput(InputInterface $input); +} diff --git a/trunk/vendor/symfony/console/Input/InputDefinition.php b/trunk/vendor/symfony/console/Input/InputDefinition.php new file mode 100644 index 00000000..11f704f0 --- /dev/null +++ b/trunk/vendor/symfony/console/Input/InputDefinition.php @@ -0,0 +1,424 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; + +/** + * A InputDefinition represents a set of valid command line arguments and options. + * + * Usage: + * + * $definition = new InputDefinition([ + * new InputArgument('name', InputArgument::REQUIRED), + * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), + * ]); + * + * @author Fabien Potencier + */ +class InputDefinition +{ + private $arguments; + private $requiredCount; + private $lastArrayArgument; + private $lastOptionalArgument; + private $options; + private $negations; + private $shortcuts; + + /** + * @param array $definition An array of InputArgument and InputOption instance + */ + public function __construct(array $definition = []) + { + $this->setDefinition($definition); + } + + /** + * Sets the definition of the input. + */ + public function setDefinition(array $definition) + { + $arguments = []; + $options = []; + foreach ($definition as $item) { + if ($item instanceof InputOption) { + $options[] = $item; + } else { + $arguments[] = $item; + } + } + + $this->setArguments($arguments); + $this->setOptions($options); + } + + /** + * Sets the InputArgument objects. + * + * @param InputArgument[] $arguments An array of InputArgument objects + */ + public function setArguments(array $arguments = []) + { + $this->arguments = []; + $this->requiredCount = 0; + $this->lastOptionalArgument = null; + $this->lastArrayArgument = null; + $this->addArguments($arguments); + } + + /** + * Adds an array of InputArgument objects. + * + * @param InputArgument[] $arguments An array of InputArgument objects + */ + public function addArguments(?array $arguments = []) + { + if (null !== $arguments) { + foreach ($arguments as $argument) { + $this->addArgument($argument); + } + } + } + + /** + * @throws LogicException When incorrect argument is given + */ + public function addArgument(InputArgument $argument) + { + if (isset($this->arguments[$argument->getName()])) { + throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); + } + + if (null !== $this->lastArrayArgument) { + throw new LogicException(sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); + } + + if ($argument->isRequired() && null !== $this->lastOptionalArgument) { + throw new LogicException(sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); + } + + if ($argument->isArray()) { + $this->lastArrayArgument = $argument; + } + + if ($argument->isRequired()) { + ++$this->requiredCount; + } else { + $this->lastOptionalArgument = $argument; + } + + $this->arguments[$argument->getName()] = $argument; + } + + /** + * Returns an InputArgument by name or by position. + * + * @param string|int $name The InputArgument name or position + * + * @return InputArgument + * + * @throws InvalidArgumentException When argument given doesn't exist + */ + public function getArgument($name) + { + if (!$this->hasArgument($name)) { + throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + } + + $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; + + return $arguments[$name]; + } + + /** + * Returns true if an InputArgument object exists by name or position. + * + * @param string|int $name The InputArgument name or position + * + * @return bool + */ + public function hasArgument($name) + { + $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; + + return isset($arguments[$name]); + } + + /** + * Gets the array of InputArgument objects. + * + * @return InputArgument[] + */ + public function getArguments() + { + return $this->arguments; + } + + /** + * Returns the number of InputArguments. + * + * @return int + */ + public function getArgumentCount() + { + return null !== $this->lastArrayArgument ? \PHP_INT_MAX : \count($this->arguments); + } + + /** + * Returns the number of required InputArguments. + * + * @return int + */ + public function getArgumentRequiredCount() + { + return $this->requiredCount; + } + + /** + * @return array + */ + public function getArgumentDefaults() + { + $values = []; + foreach ($this->arguments as $argument) { + $values[$argument->getName()] = $argument->getDefault(); + } + + return $values; + } + + /** + * Sets the InputOption objects. + * + * @param InputOption[] $options An array of InputOption objects + */ + public function setOptions(array $options = []) + { + $this->options = []; + $this->shortcuts = []; + $this->negations = []; + $this->addOptions($options); + } + + /** + * Adds an array of InputOption objects. + * + * @param InputOption[] $options An array of InputOption objects + */ + public function addOptions(array $options = []) + { + foreach ($options as $option) { + $this->addOption($option); + } + } + + /** + * @throws LogicException When option given already exist + */ + public function addOption(InputOption $option) + { + if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { + throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); + } + if (isset($this->negations[$option->getName()])) { + throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); + } + + if ($option->getShortcut()) { + foreach (explode('|', $option->getShortcut()) as $shortcut) { + if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { + throw new LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); + } + } + } + + $this->options[$option->getName()] = $option; + if ($option->getShortcut()) { + foreach (explode('|', $option->getShortcut()) as $shortcut) { + $this->shortcuts[$shortcut] = $option->getName(); + } + } + + if ($option->isNegatable()) { + $negatedName = 'no-'.$option->getName(); + if (isset($this->options[$negatedName])) { + throw new LogicException(sprintf('An option named "%s" already exists.', $negatedName)); + } + $this->negations[$negatedName] = $option->getName(); + } + } + + /** + * Returns an InputOption by name. + * + * @return InputOption + * + * @throws InvalidArgumentException When option given doesn't exist + */ + public function getOption(string $name) + { + if (!$this->hasOption($name)) { + throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); + } + + return $this->options[$name]; + } + + /** + * Returns true if an InputOption object exists by name. + * + * This method can't be used to check if the user included the option when + * executing the command (use getOption() instead). + * + * @return bool + */ + public function hasOption(string $name) + { + return isset($this->options[$name]); + } + + /** + * Gets the array of InputOption objects. + * + * @return InputOption[] + */ + public function getOptions() + { + return $this->options; + } + + /** + * Returns true if an InputOption object exists by shortcut. + * + * @return bool + */ + public function hasShortcut(string $name) + { + return isset($this->shortcuts[$name]); + } + + /** + * Returns true if an InputOption object exists by negated name. + */ + public function hasNegation(string $name): bool + { + return isset($this->negations[$name]); + } + + /** + * Gets an InputOption by shortcut. + * + * @return InputOption + */ + public function getOptionForShortcut(string $shortcut) + { + return $this->getOption($this->shortcutToName($shortcut)); + } + + /** + * @return array + */ + public function getOptionDefaults() + { + $values = []; + foreach ($this->options as $option) { + $values[$option->getName()] = $option->getDefault(); + } + + return $values; + } + + /** + * Returns the InputOption name given a shortcut. + * + * @throws InvalidArgumentException When option given does not exist + * + * @internal + */ + public function shortcutToName(string $shortcut): string + { + if (!isset($this->shortcuts[$shortcut])) { + throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); + } + + return $this->shortcuts[$shortcut]; + } + + /** + * Returns the InputOption name given a negation. + * + * @throws InvalidArgumentException When option given does not exist + * + * @internal + */ + public function negationToName(string $negation): string + { + if (!isset($this->negations[$negation])) { + throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $negation)); + } + + return $this->negations[$negation]; + } + + /** + * Gets the synopsis. + * + * @return string + */ + public function getSynopsis(bool $short = false) + { + $elements = []; + + if ($short && $this->getOptions()) { + $elements[] = '[options]'; + } elseif (!$short) { + foreach ($this->getOptions() as $option) { + $value = ''; + if ($option->acceptValue()) { + $value = sprintf( + ' %s%s%s', + $option->isValueOptional() ? '[' : '', + strtoupper($option->getName()), + $option->isValueOptional() ? ']' : '' + ); + } + + $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; + $negation = $option->isNegatable() ? sprintf('|--no-%s', $option->getName()) : ''; + $elements[] = sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); + } + } + + if (\count($elements) && $this->getArguments()) { + $elements[] = '[--]'; + } + + $tail = ''; + foreach ($this->getArguments() as $argument) { + $element = '<'.$argument->getName().'>'; + if ($argument->isArray()) { + $element .= '...'; + } + + if (!$argument->isRequired()) { + $element = '['.$element; + $tail .= ']'; + } + + $elements[] = $element; + } + + return implode(' ', $elements).$tail; + } +} diff --git a/trunk/vendor/symfony/console/Input/InputInterface.php b/trunk/vendor/symfony/console/Input/InputInterface.php new file mode 100644 index 00000000..628b6037 --- /dev/null +++ b/trunk/vendor/symfony/console/Input/InputInterface.php @@ -0,0 +1,151 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\RuntimeException; + +/** + * InputInterface is the interface implemented by all input classes. + * + * @author Fabien Potencier + */ +interface InputInterface +{ + /** + * Returns the first argument from the raw parameters (not parsed). + * + * @return string|null + */ + public function getFirstArgument(); + + /** + * Returns true if the raw parameters (not parsed) contain a value. + * + * This method is to be used to introspect the input parameters + * before they have been validated. It must be used carefully. + * Does not necessarily return the correct result for short options + * when multiple flags are combined in the same option. + * + * @param string|array $values The values to look for in the raw parameters (can be an array) + * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal + * + * @return bool + */ + public function hasParameterOption($values, bool $onlyParams = false); + + /** + * Returns the value of a raw option (not parsed). + * + * This method is to be used to introspect the input parameters + * before they have been validated. It must be used carefully. + * Does not necessarily return the correct result for short options + * when multiple flags are combined in the same option. + * + * @param string|array $values The value(s) to look for in the raw parameters (can be an array) + * @param string|bool|int|float|array|null $default The default value to return if no result is found + * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal + * + * @return mixed + */ + public function getParameterOption($values, $default = false, bool $onlyParams = false); + + /** + * Binds the current Input instance with the given arguments and options. + * + * @throws RuntimeException + */ + public function bind(InputDefinition $definition); + + /** + * Validates the input. + * + * @throws RuntimeException When not enough arguments are given + */ + public function validate(); + + /** + * Returns all the given arguments merged with the default values. + * + * @return array + */ + public function getArguments(); + + /** + * Returns the argument value for a given argument name. + * + * @return mixed + * + * @throws InvalidArgumentException When argument given doesn't exist + */ + public function getArgument(string $name); + + /** + * Sets an argument value by name. + * + * @param mixed $value The argument value + * + * @throws InvalidArgumentException When argument given doesn't exist + */ + public function setArgument(string $name, $value); + + /** + * Returns true if an InputArgument object exists by name or position. + * + * @return bool + */ + public function hasArgument(string $name); + + /** + * Returns all the given options merged with the default values. + * + * @return array + */ + public function getOptions(); + + /** + * Returns the option value for a given option name. + * + * @return mixed + * + * @throws InvalidArgumentException When option given doesn't exist + */ + public function getOption(string $name); + + /** + * Sets an option value by name. + * + * @param mixed $value The option value + * + * @throws InvalidArgumentException When option given doesn't exist + */ + public function setOption(string $name, $value); + + /** + * Returns true if an InputOption object exists by name. + * + * @return bool + */ + public function hasOption(string $name); + + /** + * Is this input means interactive? + * + * @return bool + */ + public function isInteractive(); + + /** + * Sets the input interactivity. + */ + public function setInteractive(bool $interactive); +} diff --git a/trunk/vendor/symfony/console/Input/InputOption.php b/trunk/vendor/symfony/console/Input/InputOption.php new file mode 100644 index 00000000..99807f59 --- /dev/null +++ b/trunk/vendor/symfony/console/Input/InputOption.php @@ -0,0 +1,231 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; + +/** + * Represents a command line option. + * + * @author Fabien Potencier + */ +class InputOption +{ + /** + * Do not accept input for the option (e.g. --yell). This is the default behavior of options. + */ + public const VALUE_NONE = 1; + + /** + * A value must be passed when the option is used (e.g. --iterations=5 or -i5). + */ + public const VALUE_REQUIRED = 2; + + /** + * The option may or may not have a value (e.g. --yell or --yell=loud). + */ + public const VALUE_OPTIONAL = 4; + + /** + * The option accepts multiple values (e.g. --dir=/foo --dir=/bar). + */ + public const VALUE_IS_ARRAY = 8; + + /** + * The option may have either positive or negative value (e.g. --ansi or --no-ansi). + */ + public const VALUE_NEGATABLE = 16; + + private $name; + private $shortcut; + private $mode; + private $default; + private $description; + + /** + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int|null $mode The option mode: One of the VALUE_* constants + * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) + * + * @throws InvalidArgumentException If option mode is invalid or incompatible + */ + public function __construct(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null) + { + if (str_starts_with($name, '--')) { + $name = substr($name, 2); + } + + if (empty($name)) { + throw new InvalidArgumentException('An option name cannot be empty.'); + } + + if ('' === $shortcut || [] === $shortcut || false === $shortcut) { + $shortcut = null; + } + + if (null !== $shortcut) { + if (\is_array($shortcut)) { + $shortcut = implode('|', $shortcut); + } + $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); + $shortcuts = array_filter($shortcuts, 'strlen'); + $shortcut = implode('|', $shortcuts); + + if ('' === $shortcut) { + throw new InvalidArgumentException('An option shortcut cannot be empty.'); + } + } + + if (null === $mode) { + $mode = self::VALUE_NONE; + } elseif ($mode >= (self::VALUE_NEGATABLE << 1) || $mode < 1) { + throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); + } + + $this->name = $name; + $this->shortcut = $shortcut; + $this->mode = $mode; + $this->description = $description; + + if ($this->isArray() && !$this->acceptValue()) { + throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); + } + if ($this->isNegatable() && $this->acceptValue()) { + throw new InvalidArgumentException('Impossible to have an option mode VALUE_NEGATABLE if the option also accepts a value.'); + } + + $this->setDefault($default); + } + + /** + * Returns the option shortcut. + * + * @return string|null + */ + public function getShortcut() + { + return $this->shortcut; + } + + /** + * Returns the option name. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Returns true if the option accepts a value. + * + * @return bool true if value mode is not self::VALUE_NONE, false otherwise + */ + public function acceptValue() + { + return $this->isValueRequired() || $this->isValueOptional(); + } + + /** + * Returns true if the option requires a value. + * + * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise + */ + public function isValueRequired() + { + return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); + } + + /** + * Returns true if the option takes an optional value. + * + * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise + */ + public function isValueOptional() + { + return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); + } + + /** + * Returns true if the option can take multiple values. + * + * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise + */ + public function isArray() + { + return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); + } + + public function isNegatable(): bool + { + return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); + } + + /** + * @param string|bool|int|float|array|null $default + */ + public function setDefault($default = null) + { + if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { + throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); + } + + if ($this->isArray()) { + if (null === $default) { + $default = []; + } elseif (!\is_array($default)) { + throw new LogicException('A default value for an array option must be an array.'); + } + } + + $this->default = $this->acceptValue() || $this->isNegatable() ? $default : false; + } + + /** + * Returns the default value. + * + * @return string|bool|int|float|array|null + */ + public function getDefault() + { + return $this->default; + } + + /** + * Returns the description text. + * + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Checks whether the given option equals this one. + * + * @return bool + */ + public function equals(self $option) + { + return $option->getName() === $this->getName() + && $option->getShortcut() === $this->getShortcut() + && $option->getDefault() === $this->getDefault() + && $option->isNegatable() === $this->isNegatable() + && $option->isArray() === $this->isArray() + && $option->isValueRequired() === $this->isValueRequired() + && $option->isValueOptional() === $this->isValueOptional() + ; + } +} diff --git a/trunk/vendor/symfony/console/Input/StreamableInputInterface.php b/trunk/vendor/symfony/console/Input/StreamableInputInterface.php new file mode 100644 index 00000000..d7e462f2 --- /dev/null +++ b/trunk/vendor/symfony/console/Input/StreamableInputInterface.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +/** + * StreamableInputInterface is the interface implemented by all input classes + * that have an input stream. + * + * @author Robin Chalas + */ +interface StreamableInputInterface extends InputInterface +{ + /** + * Sets the input stream to read from when interacting with the user. + * + * This is mainly useful for testing purpose. + * + * @param resource $stream The input stream + */ + public function setStream($stream); + + /** + * Returns the input stream. + * + * @return resource|null + */ + public function getStream(); +} diff --git a/trunk/vendor/symfony/console/Input/StringInput.php b/trunk/vendor/symfony/console/Input/StringInput.php new file mode 100644 index 00000000..56bb66cb --- /dev/null +++ b/trunk/vendor/symfony/console/Input/StringInput.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Input; + +use Symfony\Component\Console\Exception\InvalidArgumentException; + +/** + * StringInput represents an input provided as a string. + * + * Usage: + * + * $input = new StringInput('foo --bar="foobar"'); + * + * @author Fabien Potencier + */ +class StringInput extends ArgvInput +{ + public const REGEX_STRING = '([^\s]+?)(?:\s|(?setTokens($this->tokenize($input)); + } + + /** + * Tokenizes a string. + * + * @throws InvalidArgumentException When unable to parse input (should never happen) + */ + private function tokenize(string $input): array + { + $tokens = []; + $length = \strlen($input); + $cursor = 0; + $token = null; + while ($cursor < $length) { + if ('\\' === $input[$cursor]) { + $token .= $input[++$cursor] ?? ''; + ++$cursor; + continue; + } + + if (preg_match('/\s+/A', $input, $match, 0, $cursor)) { + if (null !== $token) { + $tokens[] = $token; + $token = null; + } + } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, 0, $cursor)) { + $token .= $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))); + } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, 0, $cursor)) { + $token .= stripcslashes(substr($match[0], 1, -1)); + } elseif (preg_match('/'.self::REGEX_UNQUOTED_STRING.'/A', $input, $match, 0, $cursor)) { + $token .= $match[1]; + } else { + // should never happen + throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); + } + + $cursor += \strlen($match[0]); + } + + if (null !== $token) { + $tokens[] = $token; + } + + return $tokens; + } +} diff --git a/trunk/vendor/symfony/console/LICENSE b/trunk/vendor/symfony/console/LICENSE new file mode 100644 index 00000000..0138f8f0 --- /dev/null +++ b/trunk/vendor/symfony/console/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/console/Logger/ConsoleLogger.php b/trunk/vendor/symfony/console/Logger/ConsoleLogger.php new file mode 100644 index 00000000..4a10fa17 --- /dev/null +++ b/trunk/vendor/symfony/console/Logger/ConsoleLogger.php @@ -0,0 +1,126 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Logger; + +use Psr\Log\AbstractLogger; +use Psr\Log\InvalidArgumentException; +use Psr\Log\LogLevel; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * PSR-3 compliant console logger. + * + * @author Kévin Dunglas + * + * @see https://www.php-fig.org/psr/psr-3/ + */ +class ConsoleLogger extends AbstractLogger +{ + public const INFO = 'info'; + public const ERROR = 'error'; + + private $output; + private $verbosityLevelMap = [ + LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, + LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, + LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, + LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL, + LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL, + LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE, + LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, + LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, + ]; + private $formatLevelMap = [ + LogLevel::EMERGENCY => self::ERROR, + LogLevel::ALERT => self::ERROR, + LogLevel::CRITICAL => self::ERROR, + LogLevel::ERROR => self::ERROR, + LogLevel::WARNING => self::INFO, + LogLevel::NOTICE => self::INFO, + LogLevel::INFO => self::INFO, + LogLevel::DEBUG => self::INFO, + ]; + private $errored = false; + + public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = []) + { + $this->output = $output; + $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap; + $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap; + } + + /** + * {@inheritdoc} + * + * @return void + */ + public function log($level, $message, array $context = []) + { + if (!isset($this->verbosityLevelMap[$level])) { + throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); + } + + $output = $this->output; + + // Write to the error output if necessary and available + if (self::ERROR === $this->formatLevelMap[$level]) { + if ($this->output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + $this->errored = true; + } + + // the if condition check isn't necessary -- it's the same one that $output will do internally anyway. + // We only do it for efficiency here as the message formatting is relatively expensive. + if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) { + $output->writeln(sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); + } + } + + /** + * Returns true when any messages have been logged at error levels. + * + * @return bool + */ + public function hasErrored() + { + return $this->errored; + } + + /** + * Interpolates context values into the message placeholders. + * + * @author PHP Framework Interoperability Group + */ + private function interpolate(string $message, array $context): string + { + if (!str_contains($message, '{')) { + return $message; + } + + $replacements = []; + foreach ($context as $key => $val) { + if (null === $val || \is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { + $replacements["{{$key}}"] = $val; + } elseif ($val instanceof \DateTimeInterface) { + $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); + } elseif (\is_object($val)) { + $replacements["{{$key}}"] = '[object '.\get_class($val).']'; + } else { + $replacements["{{$key}}"] = '['.\gettype($val).']'; + } + } + + return strtr($message, $replacements); + } +} diff --git a/trunk/vendor/symfony/console/Output/BufferedOutput.php b/trunk/vendor/symfony/console/Output/BufferedOutput.php new file mode 100644 index 00000000..d37c6e32 --- /dev/null +++ b/trunk/vendor/symfony/console/Output/BufferedOutput.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +/** + * @author Jean-François Simon + */ +class BufferedOutput extends Output +{ + private $buffer = ''; + + /** + * Empties buffer and returns its content. + * + * @return string + */ + public function fetch() + { + $content = $this->buffer; + $this->buffer = ''; + + return $content; + } + + /** + * {@inheritdoc} + */ + protected function doWrite(string $message, bool $newline) + { + $this->buffer .= $message; + + if ($newline) { + $this->buffer .= \PHP_EOL; + } + } +} diff --git a/trunk/vendor/symfony/console/Output/ConsoleOutput.php b/trunk/vendor/symfony/console/Output/ConsoleOutput.php new file mode 100644 index 00000000..560aeb58 --- /dev/null +++ b/trunk/vendor/symfony/console/Output/ConsoleOutput.php @@ -0,0 +1,172 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR. + * + * This class is a convenient wrapper around `StreamOutput` for both STDOUT and STDERR. + * + * $output = new ConsoleOutput(); + * + * This is equivalent to: + * + * $output = new StreamOutput(fopen('php://stdout', 'w')); + * $stdErr = new StreamOutput(fopen('php://stderr', 'w')); + * + * @author Fabien Potencier + */ +class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface +{ + private $stderr; + private $consoleSectionOutputs = []; + + /** + * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) + * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) + * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) + */ + public function __construct(int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) + { + parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); + + if (null === $formatter) { + // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter. + $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated); + + return; + } + + $actualDecorated = $this->isDecorated(); + $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter()); + + if (null === $decorated) { + $this->setDecorated($actualDecorated && $this->stderr->isDecorated()); + } + } + + /** + * Creates a new output section. + */ + public function section(): ConsoleSectionOutput + { + return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); + } + + /** + * {@inheritdoc} + */ + public function setDecorated(bool $decorated) + { + parent::setDecorated($decorated); + $this->stderr->setDecorated($decorated); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(OutputFormatterInterface $formatter) + { + parent::setFormatter($formatter); + $this->stderr->setFormatter($formatter); + } + + /** + * {@inheritdoc} + */ + public function setVerbosity(int $level) + { + parent::setVerbosity($level); + $this->stderr->setVerbosity($level); + } + + /** + * {@inheritdoc} + */ + public function getErrorOutput() + { + return $this->stderr; + } + + /** + * {@inheritdoc} + */ + public function setErrorOutput(OutputInterface $error) + { + $this->stderr = $error; + } + + /** + * Returns true if current environment supports writing console output to + * STDOUT. + * + * @return bool + */ + protected function hasStdoutSupport() + { + return false === $this->isRunningOS400(); + } + + /** + * Returns true if current environment supports writing console output to + * STDERR. + * + * @return bool + */ + protected function hasStderrSupport() + { + return false === $this->isRunningOS400(); + } + + /** + * Checks if current executing environment is IBM iSeries (OS400), which + * doesn't properly convert character-encodings between ASCII to EBCDIC. + */ + private function isRunningOS400(): bool + { + $checks = [ + \function_exists('php_uname') ? php_uname('s') : '', + getenv('OSTYPE'), + \PHP_OS, + ]; + + return false !== stripos(implode(';', $checks), 'OS400'); + } + + /** + * @return resource + */ + private function openOutputStream() + { + if (!$this->hasStdoutSupport()) { + return fopen('php://output', 'w'); + } + + // Use STDOUT when possible to prevent from opening too many file descriptors + return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w')); + } + + /** + * @return resource + */ + private function openErrorStream() + { + if (!$this->hasStderrSupport()) { + return fopen('php://output', 'w'); + } + + // Use STDERR when possible to prevent from opening too many file descriptors + return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w')); + } +} diff --git a/trunk/vendor/symfony/console/Output/ConsoleOutputInterface.php b/trunk/vendor/symfony/console/Output/ConsoleOutputInterface.php new file mode 100644 index 00000000..6b6635f5 --- /dev/null +++ b/trunk/vendor/symfony/console/Output/ConsoleOutputInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +/** + * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. + * This adds information about stderr and section output stream. + * + * @author Dariusz Górecki + */ +interface ConsoleOutputInterface extends OutputInterface +{ + /** + * Gets the OutputInterface for errors. + * + * @return OutputInterface + */ + public function getErrorOutput(); + + public function setErrorOutput(OutputInterface $error); + + public function section(): ConsoleSectionOutput; +} diff --git a/trunk/vendor/symfony/console/Output/ConsoleSectionOutput.php b/trunk/vendor/symfony/console/Output/ConsoleSectionOutput.php new file mode 100644 index 00000000..70d70c50 --- /dev/null +++ b/trunk/vendor/symfony/console/Output/ConsoleSectionOutput.php @@ -0,0 +1,143 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Terminal; + +/** + * @author Pierre du Plessis + * @author Gabriel Ostrolucký + */ +class ConsoleSectionOutput extends StreamOutput +{ + private $content = []; + private $lines = 0; + private $sections; + private $terminal; + + /** + * @param resource $stream + * @param ConsoleSectionOutput[] $sections + */ + public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter) + { + parent::__construct($stream, $verbosity, $decorated, $formatter); + array_unshift($sections, $this); + $this->sections = &$sections; + $this->terminal = new Terminal(); + } + + /** + * Clears previous output for this section. + * + * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared + */ + public function clear(?int $lines = null) + { + if (empty($this->content) || !$this->isDecorated()) { + return; + } + + if ($lines) { + array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content + } else { + $lines = $this->lines; + $this->content = []; + } + + $this->lines -= $lines; + + parent::doWrite($this->popStreamContentUntilCurrentSection($lines), false); + } + + /** + * Overwrites the previous output with a new message. + * + * @param array|string $message + */ + public function overwrite($message) + { + $this->clear(); + $this->writeln($message); + } + + public function getContent(): string + { + return implode('', $this->content); + } + + /** + * @internal + */ + public function addContent(string $input) + { + foreach (explode(\PHP_EOL, $input) as $lineContent) { + $this->lines += ceil($this->getDisplayLength($lineContent) / $this->terminal->getWidth()) ?: 1; + $this->content[] = $lineContent; + $this->content[] = \PHP_EOL; + } + } + + /** + * {@inheritdoc} + */ + protected function doWrite(string $message, bool $newline) + { + if (!$this->isDecorated()) { + parent::doWrite($message, $newline); + + return; + } + + $erasedContent = $this->popStreamContentUntilCurrentSection(); + + $this->addContent($message); + + parent::doWrite($message, true); + parent::doWrite($erasedContent, false); + } + + /** + * At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits + * current section. Then it erases content it crawled through. Optionally, it erases part of current section too. + */ + private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string + { + $numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection; + $erasedContent = []; + + foreach ($this->sections as $section) { + if ($section === $this) { + break; + } + + $numberOfLinesToClear += $section->lines; + $erasedContent[] = $section->getContent(); + } + + if ($numberOfLinesToClear > 0) { + // move cursor up n lines + parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false); + // erase to end of screen + parent::doWrite("\x1b[0J", false); + } + + return implode('', array_reverse($erasedContent)); + } + + private function getDisplayLength(string $text): int + { + return Helper::width(Helper::removeDecoration($this->getFormatter(), str_replace("\t", ' ', $text))); + } +} diff --git a/trunk/vendor/symfony/console/Output/NullOutput.php b/trunk/vendor/symfony/console/Output/NullOutput.php new file mode 100644 index 00000000..3bbe63ea --- /dev/null +++ b/trunk/vendor/symfony/console/Output/NullOutput.php @@ -0,0 +1,128 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\NullOutputFormatter; +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * NullOutput suppresses all output. + * + * $output = new NullOutput(); + * + * @author Fabien Potencier + * @author Tobias Schultze + */ +class NullOutput implements OutputInterface +{ + private $formatter; + + /** + * {@inheritdoc} + */ + public function setFormatter(OutputFormatterInterface $formatter) + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + if ($this->formatter) { + return $this->formatter; + } + // to comply with the interface we must return a OutputFormatterInterface + return $this->formatter = new NullOutputFormatter(); + } + + /** + * {@inheritdoc} + */ + public function setDecorated(bool $decorated) + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function isDecorated() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function setVerbosity(int $level) + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function getVerbosity() + { + return self::VERBOSITY_QUIET; + } + + /** + * {@inheritdoc} + */ + public function isQuiet() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function isVerbose() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isVeryVerbose() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isDebug() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function writeln($messages, int $options = self::OUTPUT_NORMAL) + { + // do nothing + } + + /** + * {@inheritdoc} + */ + public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + { + // do nothing + } +} diff --git a/trunk/vendor/symfony/console/Output/Output.php b/trunk/vendor/symfony/console/Output/Output.php new file mode 100644 index 00000000..28c40bb3 --- /dev/null +++ b/trunk/vendor/symfony/console/Output/Output.php @@ -0,0 +1,174 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * Base class for output classes. + * + * There are five levels of verbosity: + * + * * normal: no option passed (normal output) + * * verbose: -v (more output) + * * very verbose: -vv (highly extended output) + * * debug: -vvv (all debug output) + * * quiet: -q (no output) + * + * @author Fabien Potencier + */ +abstract class Output implements OutputInterface +{ + private $verbosity; + private $formatter; + + /** + * @param int|null $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) + * @param bool $decorated Whether to decorate messages + * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) + */ + public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) + { + $this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL; + $this->formatter = $formatter ?? new OutputFormatter(); + $this->formatter->setDecorated($decorated); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(OutputFormatterInterface $formatter) + { + $this->formatter = $formatter; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->formatter; + } + + /** + * {@inheritdoc} + */ + public function setDecorated(bool $decorated) + { + $this->formatter->setDecorated($decorated); + } + + /** + * {@inheritdoc} + */ + public function isDecorated() + { + return $this->formatter->isDecorated(); + } + + /** + * {@inheritdoc} + */ + public function setVerbosity(int $level) + { + $this->verbosity = $level; + } + + /** + * {@inheritdoc} + */ + public function getVerbosity() + { + return $this->verbosity; + } + + /** + * {@inheritdoc} + */ + public function isQuiet() + { + return self::VERBOSITY_QUIET === $this->verbosity; + } + + /** + * {@inheritdoc} + */ + public function isVerbose() + { + return self::VERBOSITY_VERBOSE <= $this->verbosity; + } + + /** + * {@inheritdoc} + */ + public function isVeryVerbose() + { + return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity; + } + + /** + * {@inheritdoc} + */ + public function isDebug() + { + return self::VERBOSITY_DEBUG <= $this->verbosity; + } + + /** + * {@inheritdoc} + */ + public function writeln($messages, int $options = self::OUTPUT_NORMAL) + { + $this->write($messages, true, $options); + } + + /** + * {@inheritdoc} + */ + public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + { + if (!is_iterable($messages)) { + $messages = [$messages]; + } + + $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN; + $type = $types & $options ?: self::OUTPUT_NORMAL; + + $verbosities = self::VERBOSITY_QUIET | self::VERBOSITY_NORMAL | self::VERBOSITY_VERBOSE | self::VERBOSITY_VERY_VERBOSE | self::VERBOSITY_DEBUG; + $verbosity = $verbosities & $options ?: self::VERBOSITY_NORMAL; + + if ($verbosity > $this->getVerbosity()) { + return; + } + + foreach ($messages as $message) { + switch ($type) { + case OutputInterface::OUTPUT_NORMAL: + $message = $this->formatter->format($message); + break; + case OutputInterface::OUTPUT_RAW: + break; + case OutputInterface::OUTPUT_PLAIN: + $message = strip_tags($this->formatter->format($message)); + break; + } + + $this->doWrite($message ?? '', $newline); + } + } + + /** + * Writes a message to the output. + */ + abstract protected function doWrite(string $message, bool $newline); +} diff --git a/trunk/vendor/symfony/console/Output/OutputInterface.php b/trunk/vendor/symfony/console/Output/OutputInterface.php new file mode 100644 index 00000000..55caab80 --- /dev/null +++ b/trunk/vendor/symfony/console/Output/OutputInterface.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * OutputInterface is the interface implemented by all Output classes. + * + * @author Fabien Potencier + */ +interface OutputInterface +{ + public const VERBOSITY_QUIET = 16; + public const VERBOSITY_NORMAL = 32; + public const VERBOSITY_VERBOSE = 64; + public const VERBOSITY_VERY_VERBOSE = 128; + public const VERBOSITY_DEBUG = 256; + + public const OUTPUT_NORMAL = 1; + public const OUTPUT_RAW = 2; + public const OUTPUT_PLAIN = 4; + + /** + * Writes a message to the output. + * + * @param string|iterable $messages The message as an iterable of strings or a single string + * @param bool $newline Whether to add a newline + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + */ + public function write($messages, bool $newline = false, int $options = 0); + + /** + * Writes a message to the output and adds a newline at the end. + * + * @param string|iterable $messages The message as an iterable of strings or a single string + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + */ + public function writeln($messages, int $options = 0); + + /** + * Sets the verbosity of the output. + */ + public function setVerbosity(int $level); + + /** + * Gets the current verbosity of the output. + * + * @return int + */ + public function getVerbosity(); + + /** + * Returns whether verbosity is quiet (-q). + * + * @return bool + */ + public function isQuiet(); + + /** + * Returns whether verbosity is verbose (-v). + * + * @return bool + */ + public function isVerbose(); + + /** + * Returns whether verbosity is very verbose (-vv). + * + * @return bool + */ + public function isVeryVerbose(); + + /** + * Returns whether verbosity is debug (-vvv). + * + * @return bool + */ + public function isDebug(); + + /** + * Sets the decorated flag. + */ + public function setDecorated(bool $decorated); + + /** + * Gets the decorated flag. + * + * @return bool + */ + public function isDecorated(); + + public function setFormatter(OutputFormatterInterface $formatter); + + /** + * Returns current output formatter instance. + * + * @return OutputFormatterInterface + */ + public function getFormatter(); +} diff --git a/trunk/vendor/symfony/console/Output/StreamOutput.php b/trunk/vendor/symfony/console/Output/StreamOutput.php new file mode 100644 index 00000000..72479f8a --- /dev/null +++ b/trunk/vendor/symfony/console/Output/StreamOutput.php @@ -0,0 +1,123 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * StreamOutput writes the output to a given stream. + * + * Usage: + * + * $output = new StreamOutput(fopen('php://stdout', 'w')); + * + * As `StreamOutput` can use any stream, you can also use a file: + * + * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); + * + * @author Fabien Potencier + */ +class StreamOutput extends Output +{ + private $stream; + + /** + * @param resource $stream A stream resource + * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) + * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) + * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) + * + * @throws InvalidArgumentException When first argument is not a real stream + */ + public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) + { + if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { + throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); + } + + $this->stream = $stream; + + if (null === $decorated) { + $decorated = $this->hasColorSupport(); + } + + parent::__construct($verbosity, $decorated, $formatter); + } + + /** + * Gets the stream attached to this StreamOutput instance. + * + * @return resource + */ + public function getStream() + { + return $this->stream; + } + + protected function doWrite(string $message, bool $newline) + { + if ($newline) { + $message .= \PHP_EOL; + } + + @fwrite($this->stream, $message); + + fflush($this->stream); + } + + /** + * Returns true if the stream supports colorization. + * + * Colorization is disabled if not supported by the stream: + * + * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo + * terminals via named pipes, so we can only check the environment. + * + * Reference: Composer\XdebugHandler\Process::supportsColor + * https://github.com/composer/xdebug-handler + * + * @return bool true if the stream supports colorization, false otherwise + */ + protected function hasColorSupport() + { + // Follow https://no-color.org/ + if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) { + return false; + } + + // Detect msysgit/mingw and assume this is a tty because detection + // does not work correctly, see https://github.com/composer/composer/issues/9690 + if (!@stream_isatty($this->stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) { + return false; + } + + if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($this->stream)) { + return true; + } + + if ('Hyper' === getenv('TERM_PROGRAM') + || false !== getenv('COLORTERM') + || false !== getenv('ANSICON') + || 'ON' === getenv('ConEmuANSI') + ) { + return true; + } + + if ('dumb' === $term = (string) getenv('TERM')) { + return false; + } + + // See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157 + return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term); + } +} diff --git a/trunk/vendor/symfony/console/Output/TrimmedBufferOutput.php b/trunk/vendor/symfony/console/Output/TrimmedBufferOutput.php new file mode 100644 index 00000000..b08503b3 --- /dev/null +++ b/trunk/vendor/symfony/console/Output/TrimmedBufferOutput.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Output; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Formatter\OutputFormatterInterface; + +/** + * A BufferedOutput that keeps only the last N chars. + * + * @author Jérémy Derussé + */ +class TrimmedBufferOutput extends Output +{ + private $maxLength; + private $buffer = ''; + + public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) + { + if ($maxLength <= 0) { + throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); + } + + parent::__construct($verbosity, $decorated, $formatter); + $this->maxLength = $maxLength; + } + + /** + * Empties buffer and returns its content. + * + * @return string + */ + public function fetch() + { + $content = $this->buffer; + $this->buffer = ''; + + return $content; + } + + /** + * {@inheritdoc} + */ + protected function doWrite(string $message, bool $newline) + { + $this->buffer .= $message; + + if ($newline) { + $this->buffer .= \PHP_EOL; + } + + $this->buffer = substr($this->buffer, 0 - $this->maxLength); + } +} diff --git a/trunk/vendor/symfony/console/Question/ChoiceQuestion.php b/trunk/vendor/symfony/console/Question/ChoiceQuestion.php new file mode 100644 index 00000000..bf1f9048 --- /dev/null +++ b/trunk/vendor/symfony/console/Question/ChoiceQuestion.php @@ -0,0 +1,183 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Question; + +use Symfony\Component\Console\Exception\InvalidArgumentException; + +/** + * Represents a choice question. + * + * @author Fabien Potencier + */ +class ChoiceQuestion extends Question +{ + private $choices; + private $multiselect = false; + private $prompt = ' > '; + private $errorMessage = 'Value "%s" is invalid'; + + /** + * @param string $question The question to ask to the user + * @param array $choices The list of available choices + * @param mixed $default The default answer to return + */ + public function __construct(string $question, array $choices, $default = null) + { + if (!$choices) { + throw new \LogicException('Choice question must have at least 1 choice available.'); + } + + parent::__construct($question, $default); + + $this->choices = $choices; + $this->setValidator($this->getDefaultValidator()); + $this->setAutocompleterValues($choices); + } + + /** + * Returns available choices. + * + * @return array + */ + public function getChoices() + { + return $this->choices; + } + + /** + * Sets multiselect option. + * + * When multiselect is set to true, multiple choices can be answered. + * + * @return $this + */ + public function setMultiselect(bool $multiselect) + { + $this->multiselect = $multiselect; + $this->setValidator($this->getDefaultValidator()); + + return $this; + } + + /** + * Returns whether the choices are multiselect. + * + * @return bool + */ + public function isMultiselect() + { + return $this->multiselect; + } + + /** + * Gets the prompt for choices. + * + * @return string + */ + public function getPrompt() + { + return $this->prompt; + } + + /** + * Sets the prompt for choices. + * + * @return $this + */ + public function setPrompt(string $prompt) + { + $this->prompt = $prompt; + + return $this; + } + + /** + * Sets the error message for invalid values. + * + * The error message has a string placeholder (%s) for the invalid value. + * + * @return $this + */ + public function setErrorMessage(string $errorMessage) + { + $this->errorMessage = $errorMessage; + $this->setValidator($this->getDefaultValidator()); + + return $this; + } + + private function getDefaultValidator(): callable + { + $choices = $this->choices; + $errorMessage = $this->errorMessage; + $multiselect = $this->multiselect; + $isAssoc = $this->isAssoc($choices); + + return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { + if ($multiselect) { + // Check for a separated comma values + if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) { + throw new InvalidArgumentException(sprintf($errorMessage, $selected)); + } + + $selectedChoices = explode(',', (string) $selected); + } else { + $selectedChoices = [$selected]; + } + + if ($this->isTrimmable()) { + foreach ($selectedChoices as $k => $v) { + $selectedChoices[$k] = trim((string) $v); + } + } + + $multiselectChoices = []; + foreach ($selectedChoices as $value) { + $results = []; + foreach ($choices as $key => $choice) { + if ($choice === $value) { + $results[] = $key; + } + } + + if (\count($results) > 1) { + throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); + } + + $result = array_search($value, $choices); + + if (!$isAssoc) { + if (false !== $result) { + $result = $choices[$result]; + } elseif (isset($choices[$value])) { + $result = $choices[$value]; + } + } elseif (false === $result && isset($choices[$value])) { + $result = $value; + } + + if (false === $result) { + throw new InvalidArgumentException(sprintf($errorMessage, $value)); + } + + // For associative choices, consistently return the key as string: + $multiselectChoices[] = $isAssoc ? (string) $result : $result; + } + + if ($multiselect) { + return $multiselectChoices; + } + + return current($multiselectChoices); + }; + } +} diff --git a/trunk/vendor/symfony/console/Question/ConfirmationQuestion.php b/trunk/vendor/symfony/console/Question/ConfirmationQuestion.php new file mode 100644 index 00000000..4228521b --- /dev/null +++ b/trunk/vendor/symfony/console/Question/ConfirmationQuestion.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Question; + +/** + * Represents a yes/no question. + * + * @author Fabien Potencier + */ +class ConfirmationQuestion extends Question +{ + private $trueAnswerRegex; + + /** + * @param string $question The question to ask to the user + * @param bool $default The default answer to return, true or false + * @param string $trueAnswerRegex A regex to match the "yes" answer + */ + public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i') + { + parent::__construct($question, $default); + + $this->trueAnswerRegex = $trueAnswerRegex; + $this->setNormalizer($this->getDefaultNormalizer()); + } + + /** + * Returns the default answer normalizer. + */ + private function getDefaultNormalizer(): callable + { + $default = $this->getDefault(); + $regex = $this->trueAnswerRegex; + + return function ($answer) use ($default, $regex) { + if (\is_bool($answer)) { + return $answer; + } + + $answerIsTrue = (bool) preg_match($regex, $answer); + if (false === $default) { + return $answer && $answerIsTrue; + } + + return '' === $answer || $answerIsTrue; + }; + } +} diff --git a/trunk/vendor/symfony/console/Question/Question.php b/trunk/vendor/symfony/console/Question/Question.php new file mode 100644 index 00000000..ba574428 --- /dev/null +++ b/trunk/vendor/symfony/console/Question/Question.php @@ -0,0 +1,299 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Question; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; + +/** + * Represents a Question. + * + * @author Fabien Potencier + */ +class Question +{ + private $question; + private $attempts; + private $hidden = false; + private $hiddenFallback = true; + private $autocompleterCallback; + private $validator; + private $default; + private $normalizer; + private $trimmable = true; + private $multiline = false; + + /** + * @param string $question The question to ask to the user + * @param string|bool|int|float|null $default The default answer to return if the user enters nothing + */ + public function __construct(string $question, $default = null) + { + $this->question = $question; + $this->default = $default; + } + + /** + * Returns the question. + * + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * Returns the default answer. + * + * @return string|bool|int|float|null + */ + public function getDefault() + { + return $this->default; + } + + /** + * Returns whether the user response accepts newline characters. + */ + public function isMultiline(): bool + { + return $this->multiline; + } + + /** + * Sets whether the user response should accept newline characters. + * + * @return $this + */ + public function setMultiline(bool $multiline): self + { + $this->multiline = $multiline; + + return $this; + } + + /** + * Returns whether the user response must be hidden. + * + * @return bool + */ + public function isHidden() + { + return $this->hidden; + } + + /** + * Sets whether the user response must be hidden or not. + * + * @return $this + * + * @throws LogicException In case the autocompleter is also used + */ + public function setHidden(bool $hidden) + { + if ($this->autocompleterCallback) { + throw new LogicException('A hidden question cannot use the autocompleter.'); + } + + $this->hidden = $hidden; + + return $this; + } + + /** + * In case the response cannot be hidden, whether to fallback on non-hidden question or not. + * + * @return bool + */ + public function isHiddenFallback() + { + return $this->hiddenFallback; + } + + /** + * Sets whether to fallback on non-hidden question if the response cannot be hidden. + * + * @return $this + */ + public function setHiddenFallback(bool $fallback) + { + $this->hiddenFallback = $fallback; + + return $this; + } + + /** + * Gets values for the autocompleter. + * + * @return iterable|null + */ + public function getAutocompleterValues() + { + $callback = $this->getAutocompleterCallback(); + + return $callback ? $callback('') : null; + } + + /** + * Sets values for the autocompleter. + * + * @return $this + * + * @throws LogicException + */ + public function setAutocompleterValues(?iterable $values) + { + if (\is_array($values)) { + $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); + + $callback = static function () use ($values) { + return $values; + }; + } elseif ($values instanceof \Traversable) { + $valueCache = null; + $callback = static function () use ($values, &$valueCache) { + return $valueCache ?? $valueCache = iterator_to_array($values, false); + }; + } else { + $callback = null; + } + + return $this->setAutocompleterCallback($callback); + } + + /** + * Gets the callback function used for the autocompleter. + */ + public function getAutocompleterCallback(): ?callable + { + return $this->autocompleterCallback; + } + + /** + * Sets the callback function used for the autocompleter. + * + * The callback is passed the user input as argument and should return an iterable of corresponding suggestions. + * + * @return $this + */ + public function setAutocompleterCallback(?callable $callback = null): self + { + if ($this->hidden && null !== $callback) { + throw new LogicException('A hidden question cannot use the autocompleter.'); + } + + $this->autocompleterCallback = $callback; + + return $this; + } + + /** + * Sets a validator for the question. + * + * @return $this + */ + public function setValidator(?callable $validator = null) + { + $this->validator = $validator; + + return $this; + } + + /** + * Gets the validator for the question. + * + * @return callable|null + */ + public function getValidator() + { + return $this->validator; + } + + /** + * Sets the maximum number of attempts. + * + * Null means an unlimited number of attempts. + * + * @return $this + * + * @throws InvalidArgumentException in case the number of attempts is invalid + */ + public function setMaxAttempts(?int $attempts) + { + if (null !== $attempts && $attempts < 1) { + throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); + } + + $this->attempts = $attempts; + + return $this; + } + + /** + * Gets the maximum number of attempts. + * + * Null means an unlimited number of attempts. + * + * @return int|null + */ + public function getMaxAttempts() + { + return $this->attempts; + } + + /** + * Sets a normalizer for the response. + * + * The normalizer can be a callable (a string), a closure or a class implementing __invoke. + * + * @return $this + */ + public function setNormalizer(callable $normalizer) + { + $this->normalizer = $normalizer; + + return $this; + } + + /** + * Gets the normalizer for the response. + * + * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. + * + * @return callable|null + */ + public function getNormalizer() + { + return $this->normalizer; + } + + protected function isAssoc(array $array) + { + return (bool) \count(array_filter(array_keys($array), 'is_string')); + } + + public function isTrimmable(): bool + { + return $this->trimmable; + } + + /** + * @return $this + */ + public function setTrimmable(bool $trimmable): self + { + $this->trimmable = $trimmable; + + return $this; + } +} diff --git a/trunk/vendor/symfony/console/Resources/bin/hiddeninput.exe b/trunk/vendor/symfony/console/Resources/bin/hiddeninput.exe new file mode 100644 index 0000000000000000000000000000000000000000..c8cf65e8d819e6e525121cf6b21f1c2429746038 GIT binary patch literal 9216 zcmeHNe{@sVeZR8hV88~S)=Hp|Mpn({rC^@)BwNOI{ERJXCYlx+k1K6PLHo z_e!z_fhOzeA3JTX&-Z@s{rFOgjEwBlqjr!)9f zjyHz`A+ni`!0Taby{Uj5Y>jQq(k5A+X})PLWAi|{IZbtc8n^^trM{GI=P_15U6d?l zJJ3PW8XjfHpR}6`k{&5@JcEeH_SqQoQbU62o2YS30W)p_t&Fjy*RXQCZt$gCf|ao| zx&3R}m6|-Lfi@pua=$26n(UlnWo$>K67*|+#(qL_An=?l0M02AhOSJDv3;~?1ORfw z76EdK#MpSHqACHLcnJLIYlCSiX4eS@Pr8rN)Xwz0dk7O*y^0_C(Yks2Kvg! z-d-fJ)F9@k?>)m(XqDKIe2OKfhCQde9fpO0ko24yn*4xzX7q+ze`Z*=aJgwV?D?73 zaJ8UkSk|NN>@-|mB*f`EIK7$ElgAB<7p&p`^Vuq$58#;?B^*Bz7&d$B#+AYUC z(^m|`7{lqx&b^5$;i`j|S!+u|lcaQplp_&Nb)!>r>vGh3wb!tW zLq6%bkSt8jO|(vWH>LiPV(Xkp%BiGhl1q!PXXNKVKE!>Y5cHc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OahZ=#yvUixu2-9fD2j$*|YY`F?0wF-{a# ztr<&kZjZ+81}6ZESqtgW)8kP#s@VLTSUR{}6?U^R*x7RE3Rl&n=VnFFqg9Uqz1n@N9N|=9<4} zuJfy^+}|D9X&vm3MAdqmu0&UMd^=K>b1hLAm_E!$rZC2b;;T~Dl zI`Eo_yRY76uM})|6wk9->of(=9&4jLv5#p@OzS~Yl>@pG)^>6`R+KtL{<4ly4o9WiM!%p_pfROU354)e8PIeE z1_s?#;OX6waNvvb&UQRN(WLbR+}&b#jo&WY-LlwCX}Q*$jGuKYuOGoIoyR(>e}}ix z+t}Q^cEcC8Y{@h}>HmJ^gD!l@gzwHmiBKl26x_lZVZG2UY!`w;RJd122;US&geQdW z3Qq}R!gIo5;ka;0I4c-Jq5X6A6?VzK&c4y!ZXdAUYu{r}*!SBXw?Aor+J4-A(*COb zb^CwV-?3k`zi-cX*c`VzL`RLI(b4MgIrGN z%ojf`E*6)Gg1A9!7q^N##2zsss^V9~-Qt7d!{UDNZ^XY9pA^3@9ui*?e=7c5d`nD; z?}~R(p>y1Kw!>|X4ycYEAkcZa*n-R%y! zqi)Up756UpqwfE7=hfigw$k~G@25gaxF9UGTkV>C(7x1Rbx4jb#|}rxq0vQ!n-c#f J0sQ~1{4brj`U(I5 literal 0 HcmV?d00001 diff --git a/trunk/vendor/symfony/console/Resources/completion.bash b/trunk/vendor/symfony/console/Resources/completion.bash new file mode 100644 index 00000000..64b87ccf --- /dev/null +++ b/trunk/vendor/symfony/console/Resources/completion.bash @@ -0,0 +1,84 @@ +# This file is part of the Symfony package. +# +# (c) Fabien Potencier +# +# For the full copyright and license information, please view +# https://symfony.com/doc/current/contributing/code/license.html + +_sf_{{ COMMAND_NAME }}() { + # Use newline as only separator to allow space in completion values + IFS=$'\n' + local sf_cmd="${COMP_WORDS[0]}" + + # for an alias, get the real script behind it + sf_cmd_type=$(type -t $sf_cmd) + if [[ $sf_cmd_type == "alias" ]]; then + sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/") + elif [[ $sf_cmd_type == "file" ]]; then + sf_cmd=$(type -p $sf_cmd) + fi + + if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then + return 1 + fi + + local cur prev words cword + _get_comp_words_by_ref -n := cur prev words cword + + local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-S{{ VERSION }}") + for w in ${words[@]}; do + w=$(printf -- '%b' "$w") + # remove quotes from typed values + quote="${w:0:1}" + if [ "$quote" == \' ]; then + w="${w%\'}" + w="${w#\'}" + elif [ "$quote" == \" ]; then + w="${w%\"}" + w="${w#\"}" + fi + # empty values are ignored + if [ ! -z "$w" ]; then + completecmd+=("-i$w") + fi + done + + local sfcomplete + if sfcomplete=$(${completecmd[@]} 2>&1); then + local quote suggestions + quote=${cur:0:1} + + # Use single quotes by default if suggestions contains backslash (FQCN) + if [ "$quote" == '' ] && [[ "$sfcomplete" =~ \\ ]]; then + quote=\' + fi + + if [ "$quote" == \' ]; then + # single quotes: no additional escaping (does not accept ' in values) + suggestions=$(for s in $sfcomplete; do printf $'%q%q%q\n' "$quote" "$s" "$quote"; done) + elif [ "$quote" == \" ]; then + # double quotes: double escaping for \ $ ` " + suggestions=$(for s in $sfcomplete; do + s=${s//\\/\\\\} + s=${s//\$/\\\$} + s=${s//\`/\\\`} + s=${s//\"/\\\"} + printf $'%q%q%q\n' "$quote" "$s" "$quote"; + done) + else + # no quotes: double escaping + suggestions=$(for s in $sfcomplete; do printf $'%q\n' $(printf '%q' "$s"); done) + fi + COMPREPLY=($(IFS=$'\n' compgen -W "$suggestions" -- $(printf -- "%q" "$cur"))) + __ltrim_colon_completions "$cur" + else + if [[ "$sfcomplete" != *"Command \"_complete\" is not defined."* ]]; then + >&2 echo + >&2 echo $sfcomplete + fi + + return 1 + fi +} + +complete -F _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }} diff --git a/trunk/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/trunk/vendor/symfony/console/SignalRegistry/SignalRegistry.php new file mode 100644 index 00000000..6bee24a4 --- /dev/null +++ b/trunk/vendor/symfony/console/SignalRegistry/SignalRegistry.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\SignalRegistry; + +final class SignalRegistry +{ + private $signalHandlers = []; + + public function __construct() + { + if (\function_exists('pcntl_async_signals')) { + pcntl_async_signals(true); + } + } + + public function register(int $signal, callable $signalHandler): void + { + if (!isset($this->signalHandlers[$signal])) { + $previousCallback = pcntl_signal_get_handler($signal); + + if (\is_callable($previousCallback)) { + $this->signalHandlers[$signal][] = $previousCallback; + } + } + + $this->signalHandlers[$signal][] = $signalHandler; + + pcntl_signal($signal, [$this, 'handle']); + } + + public static function isSupported(): bool + { + if (!\function_exists('pcntl_signal')) { + return false; + } + + if (\in_array('pcntl_signal', explode(',', \ini_get('disable_functions')))) { + return false; + } + + return true; + } + + /** + * @internal + */ + public function handle(int $signal): void + { + $count = \count($this->signalHandlers[$signal]); + + foreach ($this->signalHandlers[$signal] as $i => $signalHandler) { + $hasNext = $i !== $count - 1; + $signalHandler($signal, $hasNext); + } + } +} diff --git a/trunk/vendor/symfony/console/SingleCommandApplication.php b/trunk/vendor/symfony/console/SingleCommandApplication.php new file mode 100644 index 00000000..774e5d8c --- /dev/null +++ b/trunk/vendor/symfony/console/SingleCommandApplication.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author Grégoire Pineau + */ +class SingleCommandApplication extends Command +{ + private $version = 'UNKNOWN'; + private $autoExit = true; + private $running = false; + + /** + * @return $this + */ + public function setVersion(string $version): self + { + $this->version = $version; + + return $this; + } + + /** + * @final + * + * @return $this + */ + public function setAutoExit(bool $autoExit): self + { + $this->autoExit = $autoExit; + + return $this; + } + + public function run(?InputInterface $input = null, ?OutputInterface $output = null): int + { + if ($this->running) { + return parent::run($input, $output); + } + + // We use the command name as the application name + $application = new Application($this->getName() ?: 'UNKNOWN', $this->version); + $application->setAutoExit($this->autoExit); + // Fix the usage of the command displayed with "--help" + $this->setName($_SERVER['argv'][0]); + $application->add($this); + $application->setDefaultCommand($this->getName(), true); + + $this->running = true; + try { + $ret = $application->run($input, $output); + } finally { + $this->running = false; + } + + return $ret ?? 1; + } +} diff --git a/trunk/vendor/symfony/console/Style/OutputStyle.php b/trunk/vendor/symfony/console/Style/OutputStyle.php new file mode 100644 index 00000000..67a98ff0 --- /dev/null +++ b/trunk/vendor/symfony/console/Style/OutputStyle.php @@ -0,0 +1,153 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Style; + +use Symfony\Component\Console\Formatter\OutputFormatterInterface; +use Symfony\Component\Console\Helper\ProgressBar; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Decorates output to add console style guide helpers. + * + * @author Kevin Bond + */ +abstract class OutputStyle implements OutputInterface, StyleInterface +{ + private $output; + + public function __construct(OutputInterface $output) + { + $this->output = $output; + } + + /** + * {@inheritdoc} + */ + public function newLine(int $count = 1) + { + $this->output->write(str_repeat(\PHP_EOL, $count)); + } + + /** + * @return ProgressBar + */ + public function createProgressBar(int $max = 0) + { + return new ProgressBar($this->output, $max); + } + + /** + * {@inheritdoc} + */ + public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + { + $this->output->write($messages, $newline, $type); + } + + /** + * {@inheritdoc} + */ + public function writeln($messages, int $type = self::OUTPUT_NORMAL) + { + $this->output->writeln($messages, $type); + } + + /** + * {@inheritdoc} + */ + public function setVerbosity(int $level) + { + $this->output->setVerbosity($level); + } + + /** + * {@inheritdoc} + */ + public function getVerbosity() + { + return $this->output->getVerbosity(); + } + + /** + * {@inheritdoc} + */ + public function setDecorated(bool $decorated) + { + $this->output->setDecorated($decorated); + } + + /** + * {@inheritdoc} + */ + public function isDecorated() + { + return $this->output->isDecorated(); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(OutputFormatterInterface $formatter) + { + $this->output->setFormatter($formatter); + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->output->getFormatter(); + } + + /** + * {@inheritdoc} + */ + public function isQuiet() + { + return $this->output->isQuiet(); + } + + /** + * {@inheritdoc} + */ + public function isVerbose() + { + return $this->output->isVerbose(); + } + + /** + * {@inheritdoc} + */ + public function isVeryVerbose() + { + return $this->output->isVeryVerbose(); + } + + /** + * {@inheritdoc} + */ + public function isDebug() + { + return $this->output->isDebug(); + } + + protected function getErrorOutput() + { + if (!$this->output instanceof ConsoleOutputInterface) { + return $this->output; + } + + return $this->output->getErrorOutput(); + } +} diff --git a/trunk/vendor/symfony/console/Style/StyleInterface.php b/trunk/vendor/symfony/console/Style/StyleInterface.php new file mode 100644 index 00000000..9f25a43f --- /dev/null +++ b/trunk/vendor/symfony/console/Style/StyleInterface.php @@ -0,0 +1,132 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Style; + +/** + * Output style helpers. + * + * @author Kevin Bond + */ +interface StyleInterface +{ + /** + * Formats a command title. + */ + public function title(string $message); + + /** + * Formats a section title. + */ + public function section(string $message); + + /** + * Formats a list. + */ + public function listing(array $elements); + + /** + * Formats informational text. + * + * @param string|array $message + */ + public function text($message); + + /** + * Formats a success result bar. + * + * @param string|array $message + */ + public function success($message); + + /** + * Formats an error result bar. + * + * @param string|array $message + */ + public function error($message); + + /** + * Formats an warning result bar. + * + * @param string|array $message + */ + public function warning($message); + + /** + * Formats a note admonition. + * + * @param string|array $message + */ + public function note($message); + + /** + * Formats a caution admonition. + * + * @param string|array $message + */ + public function caution($message); + + /** + * Formats a table. + */ + public function table(array $headers, array $rows); + + /** + * Asks a question. + * + * @return mixed + */ + public function ask(string $question, ?string $default = null, ?callable $validator = null); + + /** + * Asks a question with the user input hidden. + * + * @return mixed + */ + public function askHidden(string $question, ?callable $validator = null); + + /** + * Asks for confirmation. + * + * @return bool + */ + public function confirm(string $question, bool $default = true); + + /** + * Asks a choice question. + * + * @param string|int|null $default + * + * @return mixed + */ + public function choice(string $question, array $choices, $default = null); + + /** + * Add newline(s). + */ + public function newLine(int $count = 1); + + /** + * Starts the progress output. + */ + public function progressStart(int $max = 0); + + /** + * Advances the progress output X steps. + */ + public function progressAdvance(int $step = 1); + + /** + * Finishes the progress output. + */ + public function progressFinish(); +} diff --git a/trunk/vendor/symfony/console/Style/SymfonyStyle.php b/trunk/vendor/symfony/console/Style/SymfonyStyle.php new file mode 100644 index 00000000..00edf388 --- /dev/null +++ b/trunk/vendor/symfony/console/Style/SymfonyStyle.php @@ -0,0 +1,518 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Style; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\RuntimeException; +use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Helper\ProgressBar; +use Symfony\Component\Console\Helper\SymfonyQuestionHelper; +use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Helper\TableCell; +use Symfony\Component\Console\Helper\TableSeparator; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\TrimmedBufferOutput; +use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; +use Symfony\Component\Console\Terminal; + +/** + * Output decorator helpers for the Symfony Style Guide. + * + * @author Kevin Bond + */ +class SymfonyStyle extends OutputStyle +{ + public const MAX_LINE_LENGTH = 120; + + private $input; + private $output; + private $questionHelper; + private $progressBar; + private $lineLength; + private $bufferedOutput; + + public function __construct(InputInterface $input, OutputInterface $output) + { + $this->input = $input; + $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter()); + // Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not. + $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; + $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); + + parent::__construct($this->output = $output); + } + + /** + * Formats a message as a block of text. + * + * @param string|array $messages The message to write in the block + */ + public function block($messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) + { + $messages = \is_array($messages) ? array_values($messages) : [$messages]; + + $this->autoPrependBlock(); + $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape)); + $this->newLine(); + } + + /** + * {@inheritdoc} + */ + public function title(string $message) + { + $this->autoPrependBlock(); + $this->writeln([ + sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), + sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), + ]); + $this->newLine(); + } + + /** + * {@inheritdoc} + */ + public function section(string $message) + { + $this->autoPrependBlock(); + $this->writeln([ + sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), + sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), + ]); + $this->newLine(); + } + + /** + * {@inheritdoc} + */ + public function listing(array $elements) + { + $this->autoPrependText(); + $elements = array_map(function ($element) { + return sprintf(' * %s', $element); + }, $elements); + + $this->writeln($elements); + $this->newLine(); + } + + /** + * {@inheritdoc} + */ + public function text($message) + { + $this->autoPrependText(); + + $messages = \is_array($message) ? array_values($message) : [$message]; + foreach ($messages as $message) { + $this->writeln(sprintf(' %s', $message)); + } + } + + /** + * Formats a command comment. + * + * @param string|array $message + */ + public function comment($message) + { + $this->block($message, null, null, ' // ', false, false); + } + + /** + * {@inheritdoc} + */ + public function success($message) + { + $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); + } + + /** + * {@inheritdoc} + */ + public function error($message) + { + $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); + } + + /** + * {@inheritdoc} + */ + public function warning($message) + { + $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); + } + + /** + * {@inheritdoc} + */ + public function note($message) + { + $this->block($message, 'NOTE', 'fg=yellow', ' ! '); + } + + /** + * Formats an info message. + * + * @param string|array $message + */ + public function info($message) + { + $this->block($message, 'INFO', 'fg=green', ' ', true); + } + + /** + * {@inheritdoc} + */ + public function caution($message) + { + $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); + } + + /** + * {@inheritdoc} + */ + public function table(array $headers, array $rows) + { + $this->createTable() + ->setHeaders($headers) + ->setRows($rows) + ->render() + ; + + $this->newLine(); + } + + /** + * Formats a horizontal table. + */ + public function horizontalTable(array $headers, array $rows) + { + $this->createTable() + ->setHorizontal(true) + ->setHeaders($headers) + ->setRows($rows) + ->render() + ; + + $this->newLine(); + } + + /** + * Formats a list of key/value horizontally. + * + * Each row can be one of: + * * 'A title' + * * ['key' => 'value'] + * * new TableSeparator() + * + * @param string|array|TableSeparator ...$list + */ + public function definitionList(...$list) + { + $headers = []; + $row = []; + foreach ($list as $value) { + if ($value instanceof TableSeparator) { + $headers[] = $value; + $row[] = $value; + continue; + } + if (\is_string($value)) { + $headers[] = new TableCell($value, ['colspan' => 2]); + $row[] = null; + continue; + } + if (!\is_array($value)) { + throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.'); + } + $headers[] = key($value); + $row[] = current($value); + } + + $this->horizontalTable($headers, [$row]); + } + + /** + * {@inheritdoc} + */ + public function ask(string $question, ?string $default = null, ?callable $validator = null) + { + $question = new Question($question, $default); + $question->setValidator($validator); + + return $this->askQuestion($question); + } + + /** + * {@inheritdoc} + */ + public function askHidden(string $question, ?callable $validator = null) + { + $question = new Question($question); + + $question->setHidden(true); + $question->setValidator($validator); + + return $this->askQuestion($question); + } + + /** + * {@inheritdoc} + */ + public function confirm(string $question, bool $default = true) + { + return $this->askQuestion(new ConfirmationQuestion($question, $default)); + } + + /** + * {@inheritdoc} + */ + public function choice(string $question, array $choices, $default = null) + { + if (null !== $default) { + $values = array_flip($choices); + $default = $values[$default] ?? $default; + } + + return $this->askQuestion(new ChoiceQuestion($question, $choices, $default)); + } + + /** + * {@inheritdoc} + */ + public function progressStart(int $max = 0) + { + $this->progressBar = $this->createProgressBar($max); + $this->progressBar->start(); + } + + /** + * {@inheritdoc} + */ + public function progressAdvance(int $step = 1) + { + $this->getProgressBar()->advance($step); + } + + /** + * {@inheritdoc} + */ + public function progressFinish() + { + $this->getProgressBar()->finish(); + $this->newLine(2); + $this->progressBar = null; + } + + /** + * {@inheritdoc} + */ + public function createProgressBar(int $max = 0) + { + $progressBar = parent::createProgressBar($max); + + if ('\\' !== \DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { + $progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 + $progressBar->setProgressCharacter(''); + $progressBar->setBarCharacter('▓'); // dark shade character \u2593 + } + + return $progressBar; + } + + /** + * @see ProgressBar::iterate() + */ + public function progressIterate(iterable $iterable, ?int $max = null): iterable + { + yield from $this->createProgressBar()->iterate($iterable, $max); + + $this->newLine(2); + } + + /** + * @return mixed + */ + public function askQuestion(Question $question) + { + if ($this->input->isInteractive()) { + $this->autoPrependBlock(); + } + + if (!$this->questionHelper) { + $this->questionHelper = new SymfonyQuestionHelper(); + } + + $answer = $this->questionHelper->ask($this->input, $this, $question); + + if ($this->input->isInteractive()) { + $this->newLine(); + $this->bufferedOutput->write("\n"); + } + + return $answer; + } + + /** + * {@inheritdoc} + */ + public function writeln($messages, int $type = self::OUTPUT_NORMAL) + { + if (!is_iterable($messages)) { + $messages = [$messages]; + } + + foreach ($messages as $message) { + parent::writeln($message, $type); + $this->writeBuffer($message, true, $type); + } + } + + /** + * {@inheritdoc} + */ + public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + { + if (!is_iterable($messages)) { + $messages = [$messages]; + } + + foreach ($messages as $message) { + parent::write($message, $newline, $type); + $this->writeBuffer($message, $newline, $type); + } + } + + /** + * {@inheritdoc} + */ + public function newLine(int $count = 1) + { + parent::newLine($count); + $this->bufferedOutput->write(str_repeat("\n", $count)); + } + + /** + * Returns a new instance which makes use of stderr if available. + * + * @return self + */ + public function getErrorStyle() + { + return new self($this->input, $this->getErrorOutput()); + } + + public function createTable(): Table + { + $output = $this->output instanceof ConsoleOutputInterface ? $this->output->section() : $this->output; + $style = clone Table::getStyleDefinition('symfony-style-guide'); + $style->setCellHeaderFormat('%s'); + + return (new Table($output))->setStyle($style); + } + + private function getProgressBar(): ProgressBar + { + if (!$this->progressBar) { + throw new RuntimeException('The ProgressBar is not started.'); + } + + return $this->progressBar; + } + + private function autoPrependBlock(): void + { + $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); + + if (!isset($chars[0])) { + $this->newLine(); // empty history, so we should start with a new line. + + return; + } + // Prepend new line for each non LF chars (This means no blank line was output before) + $this->newLine(2 - substr_count($chars, "\n")); + } + + private function autoPrependText(): void + { + $fetched = $this->bufferedOutput->fetch(); + // Prepend new line if last char isn't EOL: + if (!str_ends_with($fetched, "\n")) { + $this->newLine(); + } + } + + private function writeBuffer(string $message, bool $newLine, int $type): void + { + // We need to know if the last chars are PHP_EOL + $this->bufferedOutput->write($message, $newLine, $type); + } + + private function createBlock(iterable $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array + { + $indentLength = 0; + $prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix)); + $lines = []; + + if (null !== $type) { + $type = sprintf('[%s] ', $type); + $indentLength = \strlen($type); + $lineIndentation = str_repeat(' ', $indentLength); + } + + // wrap and add newlines for each element + foreach ($messages as $key => $message) { + if ($escape) { + $message = OutputFormatter::escape($message); + } + + $decorationLength = Helper::width($message) - Helper::width(Helper::removeDecoration($this->getFormatter(), $message)); + $messageLineLength = min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength); + $messageLines = explode(\PHP_EOL, wordwrap($message, $messageLineLength, \PHP_EOL, true)); + foreach ($messageLines as $messageLine) { + $lines[] = $messageLine; + } + + if (\count($messages) > 1 && $key < \count($messages) - 1) { + $lines[] = ''; + } + } + + $firstLineIndex = 0; + if ($padding && $this->isDecorated()) { + $firstLineIndex = 1; + array_unshift($lines, ''); + $lines[] = ''; + } + + foreach ($lines as $i => &$line) { + if (null !== $type) { + $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line; + } + + $line = $prefix.$line; + $line .= str_repeat(' ', max($this->lineLength - Helper::width(Helper::removeDecoration($this->getFormatter(), $line)), 0)); + + if ($style) { + $line = sprintf('<%s>%s', $style, $line); + } + } + + return $lines; + } +} diff --git a/trunk/vendor/symfony/console/Terminal.php b/trunk/vendor/symfony/console/Terminal.php new file mode 100644 index 00000000..b91e8afc --- /dev/null +++ b/trunk/vendor/symfony/console/Terminal.php @@ -0,0 +1,177 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console; + +class Terminal +{ + private static $width; + private static $height; + private static $stty; + + /** + * Gets the terminal width. + * + * @return int + */ + public function getWidth() + { + $width = getenv('COLUMNS'); + if (false !== $width) { + return (int) trim($width); + } + + if (null === self::$width) { + self::initDimensions(); + } + + return self::$width ?: 80; + } + + /** + * Gets the terminal height. + * + * @return int + */ + public function getHeight() + { + $height = getenv('LINES'); + if (false !== $height) { + return (int) trim($height); + } + + if (null === self::$height) { + self::initDimensions(); + } + + return self::$height ?: 50; + } + + /** + * @internal + */ + public static function hasSttyAvailable(): bool + { + if (null !== self::$stty) { + return self::$stty; + } + + // skip check if shell_exec function is disabled + if (!\function_exists('shell_exec')) { + return false; + } + + return self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); + } + + private static function initDimensions() + { + if ('\\' === \DIRECTORY_SEPARATOR) { + $ansicon = getenv('ANSICON'); + if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) { + // extract [w, H] from "wxh (WxH)" + // or [w, h] from "wxh" + self::$width = (int) $matches[1]; + self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2]; + } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) { + // only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash) + // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT + self::initDimensionsUsingStty(); + } elseif (null !== $dimensions = self::getConsoleMode()) { + // extract [w, h] from "wxh" + self::$width = (int) $dimensions[0]; + self::$height = (int) $dimensions[1]; + } + } else { + self::initDimensionsUsingStty(); + } + } + + /** + * Returns whether STDOUT has vt100 support (some Windows 10+ configurations). + */ + private static function hasVt100Support(): bool + { + return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w')); + } + + /** + * Initializes dimensions using the output of an stty columns line. + */ + private static function initDimensionsUsingStty() + { + if ($sttyString = self::getSttyColumns()) { + if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) { + // extract [w, h] from "rows h; columns w;" + self::$width = (int) $matches[2]; + self::$height = (int) $matches[1]; + } elseif (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) { + // extract [w, h] from "; h rows; w columns" + self::$width = (int) $matches[2]; + self::$height = (int) $matches[1]; + } + } + } + + /** + * Runs and parses mode CON if it's available, suppressing any error output. + * + * @return int[]|null An array composed of the width and the height or null if it could not be parsed + */ + private static function getConsoleMode(): ?array + { + $info = self::readFromProcess('mode CON'); + + if (null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { + return null; + } + + return [(int) $matches[2], (int) $matches[1]]; + } + + /** + * Runs and parses stty -a if it's available, suppressing any error output. + */ + private static function getSttyColumns(): ?string + { + return self::readFromProcess('stty -a | grep columns'); + } + + private static function readFromProcess(string $command): ?string + { + if (!\function_exists('proc_open')) { + return null; + } + + $descriptorspec = [ + 1 => ['pipe', 'w'], + 2 => ['pipe', 'w'], + ]; + + $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0; + + $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); + if (!\is_resource($process)) { + return null; + } + + $info = stream_get_contents($pipes[1]); + fclose($pipes[1]); + fclose($pipes[2]); + proc_close($process); + + if ($cp) { + sapi_windows_cp_set($cp); + } + + return $info; + } +} diff --git a/trunk/vendor/symfony/console/Tester/ApplicationTester.php b/trunk/vendor/symfony/console/Tester/ApplicationTester.php new file mode 100644 index 00000000..3a262e81 --- /dev/null +++ b/trunk/vendor/symfony/console/Tester/ApplicationTester.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tester; + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Input\ArrayInput; + +/** + * Eases the testing of console applications. + * + * When testing an application, don't forget to disable the auto exit flag: + * + * $application = new Application(); + * $application->setAutoExit(false); + * + * @author Fabien Potencier + */ +class ApplicationTester +{ + use TesterTrait; + + private $application; + + public function __construct(Application $application) + { + $this->application = $application; + } + + /** + * Executes the application. + * + * Available options: + * + * * interactive: Sets the input interactive flag + * * decorated: Sets the output decorated flag + * * verbosity: Sets the output verbosity flag + * * capture_stderr_separately: Make output of stdOut and stdErr separately available + * + * @return int The command exit code + */ + public function run(array $input, array $options = []) + { + $prevShellVerbosity = getenv('SHELL_VERBOSITY'); + + try { + $this->input = new ArrayInput($input); + if (isset($options['interactive'])) { + $this->input->setInteractive($options['interactive']); + } + + if ($this->inputs) { + $this->input->setStream(self::createStream($this->inputs)); + } + + $this->initOutput($options); + + return $this->statusCode = $this->application->run($this->input, $this->output); + } finally { + // SHELL_VERBOSITY is set by Application::configureIO so we need to unset/reset it + // to its previous value to avoid one test's verbosity to spread to the following tests + if (false === $prevShellVerbosity) { + if (\function_exists('putenv')) { + @putenv('SHELL_VERBOSITY'); + } + unset($_ENV['SHELL_VERBOSITY']); + unset($_SERVER['SHELL_VERBOSITY']); + } else { + if (\function_exists('putenv')) { + @putenv('SHELL_VERBOSITY='.$prevShellVerbosity); + } + $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity; + $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity; + } + } + } +} diff --git a/trunk/vendor/symfony/console/Tester/CommandCompletionTester.php b/trunk/vendor/symfony/console/Tester/CommandCompletionTester.php new file mode 100644 index 00000000..ade73275 --- /dev/null +++ b/trunk/vendor/symfony/console/Tester/CommandCompletionTester.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tester; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; + +/** + * Eases the testing of command completion. + * + * @author Jérôme Tamarelle + */ +class CommandCompletionTester +{ + private $command; + + public function __construct(Command $command) + { + $this->command = $command; + } + + /** + * Create completion suggestions from input tokens. + */ + public function complete(array $input): array + { + $currentIndex = \count($input); + if ('' === end($input)) { + array_pop($input); + } + array_unshift($input, $this->command->getName()); + + $completionInput = CompletionInput::fromTokens($input, $currentIndex); + $completionInput->bind($this->command->getDefinition()); + $suggestions = new CompletionSuggestions(); + + $this->command->complete($completionInput, $suggestions); + + $options = []; + foreach ($suggestions->getOptionSuggestions() as $option) { + $options[] = '--'.$option->getName(); + } + + return array_map('strval', array_merge($options, $suggestions->getValueSuggestions())); + } +} diff --git a/trunk/vendor/symfony/console/Tester/CommandTester.php b/trunk/vendor/symfony/console/Tester/CommandTester.php new file mode 100644 index 00000000..6c15c25f --- /dev/null +++ b/trunk/vendor/symfony/console/Tester/CommandTester.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tester; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\ArrayInput; + +/** + * Eases the testing of console commands. + * + * @author Fabien Potencier + * @author Robin Chalas + */ +class CommandTester +{ + use TesterTrait; + + private $command; + + public function __construct(Command $command) + { + $this->command = $command; + } + + /** + * Executes the command. + * + * Available execution options: + * + * * interactive: Sets the input interactive flag + * * decorated: Sets the output decorated flag + * * verbosity: Sets the output verbosity flag + * * capture_stderr_separately: Make output of stdOut and stdErr separately available + * + * @param array $input An array of command arguments and options + * @param array $options An array of execution options + * + * @return int The command exit code + */ + public function execute(array $input, array $options = []) + { + // set the command name automatically if the application requires + // this argument and no command name was passed + if (!isset($input['command']) + && (null !== $application = $this->command->getApplication()) + && $application->getDefinition()->hasArgument('command') + ) { + $input = array_merge(['command' => $this->command->getName()], $input); + } + + $this->input = new ArrayInput($input); + // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN. + $this->input->setStream(self::createStream($this->inputs)); + + if (isset($options['interactive'])) { + $this->input->setInteractive($options['interactive']); + } + + if (!isset($options['decorated'])) { + $options['decorated'] = false; + } + + $this->initOutput($options); + + return $this->statusCode = $this->command->run($this->input, $this->output); + } +} diff --git a/trunk/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php b/trunk/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php new file mode 100644 index 00000000..a4732423 --- /dev/null +++ b/trunk/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tester\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\Console\Command\Command; + +final class CommandIsSuccessful extends Constraint +{ + /** + * {@inheritdoc} + */ + public function toString(): string + { + return 'is successful'; + } + + /** + * {@inheritdoc} + */ + protected function matches($other): bool + { + return Command::SUCCESS === $other; + } + + /** + * {@inheritdoc} + */ + protected function failureDescription($other): string + { + return 'the command '.$this->toString(); + } + + /** + * {@inheritdoc} + */ + protected function additionalFailureDescription($other): string + { + $mapping = [ + Command::FAILURE => 'Command failed.', + Command::INVALID => 'Command was invalid.', + ]; + + return $mapping[$other] ?? sprintf('Command returned exit status %d.', $other); + } +} diff --git a/trunk/vendor/symfony/console/Tester/TesterTrait.php b/trunk/vendor/symfony/console/Tester/TesterTrait.php new file mode 100644 index 00000000..f454bbf9 --- /dev/null +++ b/trunk/vendor/symfony/console/Tester/TesterTrait.php @@ -0,0 +1,197 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tester; + +use PHPUnit\Framework\Assert; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Output\StreamOutput; +use Symfony\Component\Console\Tester\Constraint\CommandIsSuccessful; + +/** + * @author Amrouche Hamza + */ +trait TesterTrait +{ + /** @var StreamOutput */ + private $output; + private $inputs = []; + private $captureStreamsIndependently = false; + /** @var InputInterface */ + private $input; + /** @var int */ + private $statusCode; + + /** + * Gets the display returned by the last execution of the command or application. + * + * @return string + * + * @throws \RuntimeException If it's called before the execute method + */ + public function getDisplay(bool $normalize = false) + { + if (null === $this->output) { + throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); + } + + rewind($this->output->getStream()); + + $display = stream_get_contents($this->output->getStream()); + + if ($normalize) { + $display = str_replace(\PHP_EOL, "\n", $display); + } + + return $display; + } + + /** + * Gets the output written to STDERR by the application. + * + * @param bool $normalize Whether to normalize end of lines to \n or not + * + * @return string + */ + public function getErrorOutput(bool $normalize = false) + { + if (!$this->captureStreamsIndependently) { + throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); + } + + rewind($this->output->getErrorOutput()->getStream()); + + $display = stream_get_contents($this->output->getErrorOutput()->getStream()); + + if ($normalize) { + $display = str_replace(\PHP_EOL, "\n", $display); + } + + return $display; + } + + /** + * Gets the input instance used by the last execution of the command or application. + * + * @return InputInterface + */ + public function getInput() + { + return $this->input; + } + + /** + * Gets the output instance used by the last execution of the command or application. + * + * @return OutputInterface + */ + public function getOutput() + { + return $this->output; + } + + /** + * Gets the status code returned by the last execution of the command or application. + * + * @return int + * + * @throws \RuntimeException If it's called before the execute method + */ + public function getStatusCode() + { + if (null === $this->statusCode) { + throw new \RuntimeException('Status code not initialized, did you execute the command before requesting the status code?'); + } + + return $this->statusCode; + } + + public function assertCommandIsSuccessful(string $message = ''): void + { + Assert::assertThat($this->statusCode, new CommandIsSuccessful(), $message); + } + + /** + * Sets the user inputs. + * + * @param array $inputs An array of strings representing each input + * passed to the command input stream + * + * @return $this + */ + public function setInputs(array $inputs) + { + $this->inputs = $inputs; + + return $this; + } + + /** + * Initializes the output property. + * + * Available options: + * + * * decorated: Sets the output decorated flag + * * verbosity: Sets the output verbosity flag + * * capture_stderr_separately: Make output of stdOut and stdErr separately available + */ + private function initOutput(array $options) + { + $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; + if (!$this->captureStreamsIndependently) { + $this->output = new StreamOutput(fopen('php://memory', 'w', false)); + if (isset($options['decorated'])) { + $this->output->setDecorated($options['decorated']); + } + if (isset($options['verbosity'])) { + $this->output->setVerbosity($options['verbosity']); + } + } else { + $this->output = new ConsoleOutput( + $options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL, + $options['decorated'] ?? null + ); + + $errorOutput = new StreamOutput(fopen('php://memory', 'w', false)); + $errorOutput->setFormatter($this->output->getFormatter()); + $errorOutput->setVerbosity($this->output->getVerbosity()); + $errorOutput->setDecorated($this->output->isDecorated()); + + $reflectedOutput = new \ReflectionObject($this->output); + $strErrProperty = $reflectedOutput->getProperty('stderr'); + $strErrProperty->setAccessible(true); + $strErrProperty->setValue($this->output, $errorOutput); + + $reflectedParent = $reflectedOutput->getParentClass(); + $streamProperty = $reflectedParent->getProperty('stream'); + $streamProperty->setAccessible(true); + $streamProperty->setValue($this->output, fopen('php://memory', 'w', false)); + } + } + + /** + * @return resource + */ + private static function createStream(array $inputs) + { + $stream = fopen('php://memory', 'r+', false); + + foreach ($inputs as $input) { + fwrite($stream, $input.\PHP_EOL); + } + + rewind($stream); + + return $stream; + } +} diff --git a/trunk/vendor/symfony/deprecation-contracts/CHANGELOG.md b/trunk/vendor/symfony/deprecation-contracts/CHANGELOG.md new file mode 100644 index 00000000..7932e261 --- /dev/null +++ b/trunk/vendor/symfony/deprecation-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/trunk/vendor/symfony/deprecation-contracts/LICENSE b/trunk/vendor/symfony/deprecation-contracts/LICENSE new file mode 100644 index 00000000..406242ff --- /dev/null +++ b/trunk/vendor/symfony/deprecation-contracts/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-2022 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/deprecation-contracts/function.php b/trunk/vendor/symfony/deprecation-contracts/function.php new file mode 100644 index 00000000..2d56512b --- /dev/null +++ b/trunk/vendor/symfony/deprecation-contracts/function.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (!function_exists('trigger_deprecation')) { + /** + * Triggers a silenced deprecation notice. + * + * @param string $package The name of the Composer package that is triggering the deprecation + * @param string $version The version of the package that introduced the deprecation + * @param string $message The message of the deprecation + * @param mixed ...$args Values to insert in the message using printf() formatting + * + * @author Nicolas Grekas + */ + function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void + { + @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); + } +} diff --git a/trunk/vendor/symfony/finder/CHANGELOG.md b/trunk/vendor/symfony/finder/CHANGELOG.md new file mode 100644 index 00000000..6a44e87c --- /dev/null +++ b/trunk/vendor/symfony/finder/CHANGELOG.md @@ -0,0 +1,87 @@ +CHANGELOG +========= + +5.4.0 +----- + + * Deprecate `Comparator::setTarget()` and `Comparator::setOperator()` + * Add a constructor to `Comparator` that allows setting target and operator + * Finder's iterator has now `Symfony\Component\Finder\SplFileInfo` inner type specified + * Add recursive .gitignore files support + +5.0.0 +----- + + * added `$useNaturalSort` argument to `Finder::sortByName()` + +4.3.0 +----- + + * added Finder::ignoreVCSIgnored() to ignore files based on rules listed in .gitignore + +4.2.0 +----- + + * added $useNaturalSort option to Finder::sortByName() method + * the `Finder::sortByName()` method will have a new `$useNaturalSort` + argument in version 5.0, not defining it is deprecated + * added `Finder::reverseSorting()` to reverse the sorting + +4.0.0 +----- + + * removed `ExceptionInterface` + * removed `Symfony\Component\Finder\Iterator\FilterIterator` + +3.4.0 +----- + + * deprecated `Symfony\Component\Finder\Iterator\FilterIterator` + * added Finder::hasResults() method to check if any results were found + +3.3.0 +----- + + * added double-star matching to Glob::toRegex() + +3.0.0 +----- + + * removed deprecated classes + +2.8.0 +----- + + * deprecated adapters and related classes + +2.5.0 +----- + * added support for GLOB_BRACE in the paths passed to Finder::in() + +2.3.0 +----- + + * added a way to ignore unreadable directories (via Finder::ignoreUnreadableDirs()) + * unified the way subfolders that are not executable are handled by always throwing an AccessDeniedException exception + +2.2.0 +----- + + * added Finder::path() and Finder::notPath() methods + * added finder adapters to improve performance on specific platforms + * added support for wildcard characters (glob patterns) in the paths passed + to Finder::in() + +2.1.0 +----- + + * added Finder::sortByAccessedTime(), Finder::sortByChangedTime(), and + Finder::sortByModifiedTime() + * added Countable to Finder + * added support for an array of directories as an argument to + Finder::exclude() + * added searching based on the file content via Finder::contains() and + Finder::notContains() + * added support for the != operator in the Comparator + * [BC BREAK] filter expressions (used for file name and content) are no more + considered as regexps but glob patterns when they are enclosed in '*' or '?' diff --git a/trunk/vendor/symfony/finder/Comparator/Comparator.php b/trunk/vendor/symfony/finder/Comparator/Comparator.php new file mode 100644 index 00000000..23cf94ec --- /dev/null +++ b/trunk/vendor/symfony/finder/Comparator/Comparator.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Comparator; + +/** + * @author Fabien Potencier + */ +class Comparator +{ + private $target; + private $operator = '=='; + + public function __construct(?string $target = null, string $operator = '==') + { + if (null === $target) { + trigger_deprecation('symfony/finder', '5.4', 'Constructing a "%s" without setting "$target" is deprecated.', __CLASS__); + } + + $this->target = $target; + $this->doSetOperator($operator); + } + + /** + * Gets the target value. + * + * @return string + */ + public function getTarget() + { + if (null === $this->target) { + trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); + } + + return $this->target; + } + + /** + * @deprecated set the target via the constructor instead + */ + public function setTarget(string $target) + { + trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the target via the constructor instead.', __METHOD__); + + $this->target = $target; + } + + /** + * Gets the comparison operator. + * + * @return string + */ + public function getOperator() + { + return $this->operator; + } + + /** + * Sets the comparison operator. + * + * @throws \InvalidArgumentException + * + * @deprecated set the operator via the constructor instead + */ + public function setOperator(string $operator) + { + trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the operator via the constructor instead.', __METHOD__); + + $this->doSetOperator('' === $operator ? '==' : $operator); + } + + /** + * Tests against the target. + * + * @param mixed $test A test value + * + * @return bool + */ + public function test($test) + { + if (null === $this->target) { + trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); + } + + switch ($this->operator) { + case '>': + return $test > $this->target; + case '>=': + return $test >= $this->target; + case '<': + return $test < $this->target; + case '<=': + return $test <= $this->target; + case '!=': + return $test != $this->target; + } + + return $test == $this->target; + } + + private function doSetOperator(string $operator): void + { + if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { + throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); + } + + $this->operator = $operator; + } +} diff --git a/trunk/vendor/symfony/finder/Comparator/DateComparator.php b/trunk/vendor/symfony/finder/Comparator/DateComparator.php new file mode 100644 index 00000000..8f651e14 --- /dev/null +++ b/trunk/vendor/symfony/finder/Comparator/DateComparator.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Comparator; + +/** + * DateCompare compiles date comparisons. + * + * @author Fabien Potencier + */ +class DateComparator extends Comparator +{ + /** + * @param string $test A comparison string + * + * @throws \InvalidArgumentException If the test is not understood + */ + public function __construct(string $test) + { + if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { + throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); + } + + try { + $date = new \DateTime($matches[2]); + $target = $date->format('U'); + } catch (\Exception $e) { + throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); + } + + $operator = $matches[1] ?? '=='; + if ('since' === $operator || 'after' === $operator) { + $operator = '>'; + } + + if ('until' === $operator || 'before' === $operator) { + $operator = '<'; + } + + parent::__construct($target, $operator); + } +} diff --git a/trunk/vendor/symfony/finder/Comparator/NumberComparator.php b/trunk/vendor/symfony/finder/Comparator/NumberComparator.php new file mode 100644 index 00000000..dd308207 --- /dev/null +++ b/trunk/vendor/symfony/finder/Comparator/NumberComparator.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Comparator; + +/** + * NumberComparator compiles a simple comparison to an anonymous + * subroutine, which you can call with a value to be tested again. + * + * Now this would be very pointless, if NumberCompare didn't understand + * magnitudes. + * + * The target value may use magnitudes of kilobytes (k, ki), + * megabytes (m, mi), or gigabytes (g, gi). Those suffixed + * with an i use the appropriate 2**n version in accordance with the + * IEC standard: http://physics.nist.gov/cuu/Units/binary.html + * + * Based on the Perl Number::Compare module. + * + * @author Fabien Potencier PHP port + * @author Richard Clamp Perl version + * @copyright 2004-2005 Fabien Potencier + * @copyright 2002 Richard Clamp + * + * @see http://physics.nist.gov/cuu/Units/binary.html + */ +class NumberComparator extends Comparator +{ + /** + * @param string|null $test A comparison string or null + * + * @throws \InvalidArgumentException If the test is not understood + */ + public function __construct(?string $test) + { + if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { + throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null')); + } + + $target = $matches[2]; + if (!is_numeric($target)) { + throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target)); + } + if (isset($matches[3])) { + // magnitude + switch (strtolower($matches[3])) { + case 'k': + $target *= 1000; + break; + case 'ki': + $target *= 1024; + break; + case 'm': + $target *= 1000000; + break; + case 'mi': + $target *= 1024 * 1024; + break; + case 'g': + $target *= 1000000000; + break; + case 'gi': + $target *= 1024 * 1024 * 1024; + break; + } + } + + parent::__construct($target, $matches[1] ?: '=='); + } +} diff --git a/trunk/vendor/symfony/finder/Exception/AccessDeniedException.php b/trunk/vendor/symfony/finder/Exception/AccessDeniedException.php new file mode 100644 index 00000000..ee195ea8 --- /dev/null +++ b/trunk/vendor/symfony/finder/Exception/AccessDeniedException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Exception; + +/** + * @author Jean-François Simon + */ +class AccessDeniedException extends \UnexpectedValueException +{ +} diff --git a/trunk/vendor/symfony/finder/Exception/DirectoryNotFoundException.php b/trunk/vendor/symfony/finder/Exception/DirectoryNotFoundException.php new file mode 100644 index 00000000..c6cc0f27 --- /dev/null +++ b/trunk/vendor/symfony/finder/Exception/DirectoryNotFoundException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Exception; + +/** + * @author Andreas Erhard + */ +class DirectoryNotFoundException extends \InvalidArgumentException +{ +} diff --git a/trunk/vendor/symfony/finder/Finder.php b/trunk/vendor/symfony/finder/Finder.php new file mode 100644 index 00000000..0b569655 --- /dev/null +++ b/trunk/vendor/symfony/finder/Finder.php @@ -0,0 +1,806 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder; + +use Symfony\Component\Finder\Comparator\DateComparator; +use Symfony\Component\Finder\Comparator\NumberComparator; +use Symfony\Component\Finder\Exception\DirectoryNotFoundException; +use Symfony\Component\Finder\Iterator\CustomFilterIterator; +use Symfony\Component\Finder\Iterator\DateRangeFilterIterator; +use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator; +use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator; +use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; +use Symfony\Component\Finder\Iterator\FilenameFilterIterator; +use Symfony\Component\Finder\Iterator\LazyIterator; +use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator; +use Symfony\Component\Finder\Iterator\SortableIterator; + +/** + * Finder allows to build rules to find files and directories. + * + * It is a thin wrapper around several specialized iterator classes. + * + * All rules may be invoked several times. + * + * All methods return the current Finder object to allow chaining: + * + * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); + * + * @author Fabien Potencier + * + * @implements \IteratorAggregate + */ +class Finder implements \IteratorAggregate, \Countable +{ + public const IGNORE_VCS_FILES = 1; + public const IGNORE_DOT_FILES = 2; + public const IGNORE_VCS_IGNORED_FILES = 4; + + private $mode = 0; + private $names = []; + private $notNames = []; + private $exclude = []; + private $filters = []; + private $depths = []; + private $sizes = []; + private $followLinks = false; + private $reverseSorting = false; + private $sort = false; + private $ignore = 0; + private $dirs = []; + private $dates = []; + private $iterators = []; + private $contains = []; + private $notContains = []; + private $paths = []; + private $notPaths = []; + private $ignoreUnreadableDirs = false; + + private static $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; + + public function __construct() + { + $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; + } + + /** + * Creates a new Finder. + * + * @return static + */ + public static function create() + { + return new static(); + } + + /** + * Restricts the matching to directories only. + * + * @return $this + */ + public function directories() + { + $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; + + return $this; + } + + /** + * Restricts the matching to files only. + * + * @return $this + */ + public function files() + { + $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; + + return $this; + } + + /** + * Adds tests for the directory depth. + * + * Usage: + * + * $finder->depth('> 1') // the Finder will start matching at level 1. + * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. + * $finder->depth(['>= 1', '< 3']) + * + * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels + * + * @return $this + * + * @see DepthRangeFilterIterator + * @see NumberComparator + */ + public function depth($levels) + { + foreach ((array) $levels as $level) { + $this->depths[] = new Comparator\NumberComparator($level); + } + + return $this; + } + + /** + * Adds tests for file dates (last modified). + * + * The date must be something that strtotime() is able to parse: + * + * $finder->date('since yesterday'); + * $finder->date('until 2 days ago'); + * $finder->date('> now - 2 hours'); + * $finder->date('>= 2005-10-15'); + * $finder->date(['>= 2005-10-15', '<= 2006-05-27']); + * + * @param string|string[] $dates A date range string or an array of date ranges + * + * @return $this + * + * @see strtotime + * @see DateRangeFilterIterator + * @see DateComparator + */ + public function date($dates) + { + foreach ((array) $dates as $date) { + $this->dates[] = new Comparator\DateComparator($date); + } + + return $this; + } + + /** + * Adds rules that files must match. + * + * You can use patterns (delimited with / sign), globs or simple strings. + * + * $finder->name('/\.php$/') + * $finder->name('*.php') // same as above, without dot files + * $finder->name('test.php') + * $finder->name(['test.py', 'test.php']) + * + * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns + * + * @return $this + * + * @see FilenameFilterIterator + */ + public function name($patterns) + { + $this->names = array_merge($this->names, (array) $patterns); + + return $this; + } + + /** + * Adds rules that files must not match. + * + * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns + * + * @return $this + * + * @see FilenameFilterIterator + */ + public function notName($patterns) + { + $this->notNames = array_merge($this->notNames, (array) $patterns); + + return $this; + } + + /** + * Adds tests that file contents must match. + * + * Strings or PCRE patterns can be used: + * + * $finder->contains('Lorem ipsum') + * $finder->contains('/Lorem ipsum/i') + * $finder->contains(['dolor', '/ipsum/i']) + * + * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns + * + * @return $this + * + * @see FilecontentFilterIterator + */ + public function contains($patterns) + { + $this->contains = array_merge($this->contains, (array) $patterns); + + return $this; + } + + /** + * Adds tests that file contents must not match. + * + * Strings or PCRE patterns can be used: + * + * $finder->notContains('Lorem ipsum') + * $finder->notContains('/Lorem ipsum/i') + * $finder->notContains(['lorem', '/dolor/i']) + * + * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns + * + * @return $this + * + * @see FilecontentFilterIterator + */ + public function notContains($patterns) + { + $this->notContains = array_merge($this->notContains, (array) $patterns); + + return $this; + } + + /** + * Adds rules that filenames must match. + * + * You can use patterns (delimited with / sign) or simple strings. + * + * $finder->path('some/special/dir') + * $finder->path('/some\/special\/dir/') // same as above + * $finder->path(['some dir', 'another/dir']) + * + * Use only / as dirname separator. + * + * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns + * + * @return $this + * + * @see FilenameFilterIterator + */ + public function path($patterns) + { + $this->paths = array_merge($this->paths, (array) $patterns); + + return $this; + } + + /** + * Adds rules that filenames must not match. + * + * You can use patterns (delimited with / sign) or simple strings. + * + * $finder->notPath('some/special/dir') + * $finder->notPath('/some\/special\/dir/') // same as above + * $finder->notPath(['some/file.txt', 'another/file.log']) + * + * Use only / as dirname separator. + * + * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns + * + * @return $this + * + * @see FilenameFilterIterator + */ + public function notPath($patterns) + { + $this->notPaths = array_merge($this->notPaths, (array) $patterns); + + return $this; + } + + /** + * Adds tests for file sizes. + * + * $finder->size('> 10K'); + * $finder->size('<= 1Ki'); + * $finder->size(4); + * $finder->size(['> 10K', '< 20K']) + * + * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges + * + * @return $this + * + * @see SizeRangeFilterIterator + * @see NumberComparator + */ + public function size($sizes) + { + foreach ((array) $sizes as $size) { + $this->sizes[] = new Comparator\NumberComparator($size); + } + + return $this; + } + + /** + * Excludes directories. + * + * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: + * + * $finder->in(__DIR__)->exclude('ruby'); + * + * @param string|array $dirs A directory path or an array of directories + * + * @return $this + * + * @see ExcludeDirectoryFilterIterator + */ + public function exclude($dirs) + { + $this->exclude = array_merge($this->exclude, (array) $dirs); + + return $this; + } + + /** + * Excludes "hidden" directories and files (starting with a dot). + * + * This option is enabled by default. + * + * @return $this + * + * @see ExcludeDirectoryFilterIterator + */ + public function ignoreDotFiles(bool $ignoreDotFiles) + { + if ($ignoreDotFiles) { + $this->ignore |= static::IGNORE_DOT_FILES; + } else { + $this->ignore &= ~static::IGNORE_DOT_FILES; + } + + return $this; + } + + /** + * Forces the finder to ignore version control directories. + * + * This option is enabled by default. + * + * @return $this + * + * @see ExcludeDirectoryFilterIterator + */ + public function ignoreVCS(bool $ignoreVCS) + { + if ($ignoreVCS) { + $this->ignore |= static::IGNORE_VCS_FILES; + } else { + $this->ignore &= ~static::IGNORE_VCS_FILES; + } + + return $this; + } + + /** + * Forces Finder to obey .gitignore and ignore files based on rules listed there. + * + * This option is disabled by default. + * + * @return $this + */ + public function ignoreVCSIgnored(bool $ignoreVCSIgnored) + { + if ($ignoreVCSIgnored) { + $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; + } else { + $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES; + } + + return $this; + } + + /** + * Adds VCS patterns. + * + * @see ignoreVCS() + * + * @param string|string[] $pattern VCS patterns to ignore + */ + public static function addVCSPattern($pattern) + { + foreach ((array) $pattern as $p) { + self::$vcsPatterns[] = $p; + } + + self::$vcsPatterns = array_unique(self::$vcsPatterns); + } + + /** + * Sorts files and directories by an anonymous function. + * + * The anonymous function receives two \SplFileInfo instances to compare. + * + * This can be slow as all the matching files and directories must be retrieved for comparison. + * + * @return $this + * + * @see SortableIterator + */ + public function sort(\Closure $closure) + { + $this->sort = $closure; + + return $this; + } + + /** + * Sorts files and directories by name. + * + * This can be slow as all the matching files and directories must be retrieved for comparison. + * + * @return $this + * + * @see SortableIterator + */ + public function sortByName(bool $useNaturalSort = false) + { + $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; + + return $this; + } + + /** + * Sorts files and directories by type (directories before files), then by name. + * + * This can be slow as all the matching files and directories must be retrieved for comparison. + * + * @return $this + * + * @see SortableIterator + */ + public function sortByType() + { + $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; + + return $this; + } + + /** + * Sorts files and directories by the last accessed time. + * + * This is the time that the file was last accessed, read or written to. + * + * This can be slow as all the matching files and directories must be retrieved for comparison. + * + * @return $this + * + * @see SortableIterator + */ + public function sortByAccessedTime() + { + $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; + + return $this; + } + + /** + * Reverses the sorting. + * + * @return $this + */ + public function reverseSorting() + { + $this->reverseSorting = true; + + return $this; + } + + /** + * Sorts files and directories by the last inode changed time. + * + * This is the time that the inode information was last modified (permissions, owner, group or other metadata). + * + * On Windows, since inode is not available, changed time is actually the file creation time. + * + * This can be slow as all the matching files and directories must be retrieved for comparison. + * + * @return $this + * + * @see SortableIterator + */ + public function sortByChangedTime() + { + $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; + + return $this; + } + + /** + * Sorts files and directories by the last modified time. + * + * This is the last time the actual contents of the file were last modified. + * + * This can be slow as all the matching files and directories must be retrieved for comparison. + * + * @return $this + * + * @see SortableIterator + */ + public function sortByModifiedTime() + { + $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; + + return $this; + } + + /** + * Filters the iterator with an anonymous function. + * + * The anonymous function receives a \SplFileInfo and must return false + * to remove files. + * + * @return $this + * + * @see CustomFilterIterator + */ + public function filter(\Closure $closure) + { + $this->filters[] = $closure; + + return $this; + } + + /** + * Forces the following of symlinks. + * + * @return $this + */ + public function followLinks() + { + $this->followLinks = true; + + return $this; + } + + /** + * Tells finder to ignore unreadable directories. + * + * By default, scanning unreadable directories content throws an AccessDeniedException. + * + * @return $this + */ + public function ignoreUnreadableDirs(bool $ignore = true) + { + $this->ignoreUnreadableDirs = $ignore; + + return $this; + } + + /** + * Searches files and directories which match defined rules. + * + * @param string|string[] $dirs A directory path or an array of directories + * + * @return $this + * + * @throws DirectoryNotFoundException if one of the directories does not exist + */ + public function in($dirs) + { + $resolvedDirs = []; + + foreach ((array) $dirs as $dir) { + if (is_dir($dir)) { + $resolvedDirs[] = [$this->normalizeDir($dir)]; + } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) { + sort($glob); + $resolvedDirs[] = array_map([$this, 'normalizeDir'], $glob); + } else { + throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir)); + } + } + + $this->dirs = array_merge($this->dirs, ...$resolvedDirs); + + return $this; + } + + /** + * Returns an Iterator for the current Finder configuration. + * + * This method implements the IteratorAggregate interface. + * + * @return \Iterator + * + * @throws \LogicException if the in() method has not been called + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { + throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); + } + + if (1 === \count($this->dirs) && 0 === \count($this->iterators)) { + $iterator = $this->searchInDirectory($this->dirs[0]); + + if ($this->sort || $this->reverseSorting) { + $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); + } + + return $iterator; + } + + $iterator = new \AppendIterator(); + foreach ($this->dirs as $dir) { + $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) { + return $this->searchInDirectory($dir); + }))); + } + + foreach ($this->iterators as $it) { + $iterator->append($it); + } + + if ($this->sort || $this->reverseSorting) { + $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); + } + + return $iterator; + } + + /** + * Appends an existing set of files/directories to the finder. + * + * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. + * + * @return $this + * + * @throws \InvalidArgumentException when the given argument is not iterable + */ + public function append(iterable $iterator) + { + if ($iterator instanceof \IteratorAggregate) { + $this->iterators[] = $iterator->getIterator(); + } elseif ($iterator instanceof \Iterator) { + $this->iterators[] = $iterator; + } elseif (is_iterable($iterator)) { + $it = new \ArrayIterator(); + foreach ($iterator as $file) { + $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); + $it[$file->getPathname()] = $file; + } + $this->iterators[] = $it; + } else { + throw new \InvalidArgumentException('Finder::append() method wrong argument type.'); + } + + return $this; + } + + /** + * Check if any results were found. + * + * @return bool + */ + public function hasResults() + { + foreach ($this->getIterator() as $_) { + return true; + } + + return false; + } + + /** + * Counts all the results collected by the iterators. + * + * @return int + */ + #[\ReturnTypeWillChange] + public function count() + { + return iterator_count($this->getIterator()); + } + + private function searchInDirectory(string $dir): \Iterator + { + $exclude = $this->exclude; + $notPaths = $this->notPaths; + + if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { + $exclude = array_merge($exclude, self::$vcsPatterns); + } + + if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { + $notPaths[] = '#(^|/)\..+(/|$)#'; + } + + $minDepth = 0; + $maxDepth = \PHP_INT_MAX; + + foreach ($this->depths as $comparator) { + switch ($comparator->getOperator()) { + case '>': + $minDepth = $comparator->getTarget() + 1; + break; + case '>=': + $minDepth = $comparator->getTarget(); + break; + case '<': + $maxDepth = $comparator->getTarget() - 1; + break; + case '<=': + $maxDepth = $comparator->getTarget(); + break; + default: + $minDepth = $maxDepth = $comparator->getTarget(); + } + } + + $flags = \RecursiveDirectoryIterator::SKIP_DOTS; + + if ($this->followLinks) { + $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; + } + + $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); + + if ($exclude) { + $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude); + } + + $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); + + if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) { + $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); + } + + if ($this->mode) { + $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode); + } + + if ($this->names || $this->notNames) { + $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames); + } + + if ($this->contains || $this->notContains) { + $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains); + } + + if ($this->sizes) { + $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes); + } + + if ($this->dates) { + $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates); + } + + if ($this->filters) { + $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); + } + + if ($this->paths || $notPaths) { + $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths); + } + + if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) { + $iterator = new Iterator\VcsIgnoredFilterIterator($iterator, $dir); + } + + return $iterator; + } + + /** + * Normalizes given directory names by removing trailing slashes. + * + * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper + */ + private function normalizeDir(string $dir): string + { + if ('/' === $dir) { + return $dir; + } + + $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR); + + if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) { + $dir .= '/'; + } + + return $dir; + } +} diff --git a/trunk/vendor/symfony/finder/Gitignore.php b/trunk/vendor/symfony/finder/Gitignore.php new file mode 100644 index 00000000..d42cca1d --- /dev/null +++ b/trunk/vendor/symfony/finder/Gitignore.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder; + +/** + * Gitignore matches against text. + * + * @author Michael Voříšek + * @author Ahmed Abdou + */ +class Gitignore +{ + /** + * Returns a regexp which is the equivalent of the gitignore pattern. + * + * Format specification: https://git-scm.com/docs/gitignore#_pattern_format + */ + public static function toRegex(string $gitignoreFileContent): string + { + return self::buildRegex($gitignoreFileContent, false); + } + + public static function toRegexMatchingNegatedPatterns(string $gitignoreFileContent): string + { + return self::buildRegex($gitignoreFileContent, true); + } + + private static function buildRegex(string $gitignoreFileContent, bool $inverted): string + { + $gitignoreFileContent = preg_replace('~(? + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder; + +/** + * Glob matches globbing patterns against text. + * + * if match_glob("foo.*", "foo.bar") echo "matched\n"; + * + * // prints foo.bar and foo.baz + * $regex = glob_to_regex("foo.*"); + * for (['foo.bar', 'foo.baz', 'foo', 'bar'] as $t) + * { + * if (/$regex/) echo "matched: $car\n"; + * } + * + * Glob implements glob(3) style matching that can be used to match + * against text, rather than fetching names from a filesystem. + * + * Based on the Perl Text::Glob module. + * + * @author Fabien Potencier PHP port + * @author Richard Clamp Perl version + * @copyright 2004-2005 Fabien Potencier + * @copyright 2002 Richard Clamp + */ +class Glob +{ + /** + * Returns a regexp which is the equivalent of the glob pattern. + * + * @return string + */ + public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#') + { + $firstByte = true; + $escaping = false; + $inCurlies = 0; + $regex = ''; + $sizeGlob = \strlen($glob); + for ($i = 0; $i < $sizeGlob; ++$i) { + $car = $glob[$i]; + if ($firstByte && $strictLeadingDot && '.' !== $car) { + $regex .= '(?=[^\.])'; + } + + $firstByte = '/' === $car; + + if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) { + $car = '[^/]++/'; + if (!isset($glob[$i + 3])) { + $car .= '?'; + } + + if ($strictLeadingDot) { + $car = '(?=[^\.])'.$car; + } + + $car = '/(?:'.$car.')*'; + $i += 2 + isset($glob[$i + 3]); + + if ('/' === $delimiter) { + $car = str_replace('/', '\\/', $car); + } + } + + if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { + $regex .= "\\$car"; + } elseif ('*' === $car) { + $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); + } elseif ('?' === $car) { + $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); + } elseif ('{' === $car) { + $regex .= $escaping ? '\\{' : '('; + if (!$escaping) { + ++$inCurlies; + } + } elseif ('}' === $car && $inCurlies) { + $regex .= $escaping ? '}' : ')'; + if (!$escaping) { + --$inCurlies; + } + } elseif (',' === $car && $inCurlies) { + $regex .= $escaping ? ',' : '|'; + } elseif ('\\' === $car) { + if ($escaping) { + $regex .= '\\\\'; + $escaping = false; + } else { + $escaping = true; + } + + continue; + } else { + $regex .= $car; + } + $escaping = false; + } + + return $delimiter.'^'.$regex.'$'.$delimiter; + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/CustomFilterIterator.php new file mode 100644 index 00000000..f7bf19b8 --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/CustomFilterIterator.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +/** + * CustomFilterIterator filters files by applying anonymous functions. + * + * The anonymous function receives a \SplFileInfo and must return false + * to remove files. + * + * @author Fabien Potencier + * + * @extends \FilterIterator + */ +class CustomFilterIterator extends \FilterIterator +{ + private $filters = []; + + /** + * @param \Iterator $iterator The Iterator to filter + * @param callable[] $filters An array of PHP callbacks + * + * @throws \InvalidArgumentException + */ + public function __construct(\Iterator $iterator, array $filters) + { + foreach ($filters as $filter) { + if (!\is_callable($filter)) { + throw new \InvalidArgumentException('Invalid PHP callback.'); + } + } + $this->filters = $filters; + + parent::__construct($iterator); + } + + /** + * Filters the iterator values. + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + $fileinfo = $this->current(); + + foreach ($this->filters as $filter) { + if (false === $filter($fileinfo)) { + return false; + } + } + + return true; + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php new file mode 100644 index 00000000..f592e191 --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +use Symfony\Component\Finder\Comparator\DateComparator; + +/** + * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). + * + * @author Fabien Potencier + * + * @extends \FilterIterator + */ +class DateRangeFilterIterator extends \FilterIterator +{ + private $comparators = []; + + /** + * @param \Iterator $iterator + * @param DateComparator[] $comparators + */ + public function __construct(\Iterator $iterator, array $comparators) + { + $this->comparators = $comparators; + + parent::__construct($iterator); + } + + /** + * Filters the iterator values. + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + $fileinfo = $this->current(); + + if (!file_exists($fileinfo->getPathname())) { + return false; + } + + $filedate = $fileinfo->getMTime(); + foreach ($this->comparators as $compare) { + if (!$compare->test($filedate)) { + return false; + } + } + + return true; + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php new file mode 100644 index 00000000..f593a3f0 --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +/** + * DepthRangeFilterIterator limits the directory depth. + * + * @author Fabien Potencier + * + * @template-covariant TKey + * @template-covariant TValue + * + * @extends \FilterIterator + */ +class DepthRangeFilterIterator extends \FilterIterator +{ + private $minDepth = 0; + + /** + * @param \RecursiveIteratorIterator<\RecursiveIterator> $iterator The Iterator to filter + * @param int $minDepth The min depth + * @param int $maxDepth The max depth + */ + public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX) + { + $this->minDepth = $minDepth; + $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth); + + parent::__construct($iterator); + } + + /** + * Filters the iterator values. + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + return $this->getInnerIterator()->getDepth() >= $this->minDepth; + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php new file mode 100644 index 00000000..39797c82 --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +/** + * ExcludeDirectoryFilterIterator filters out directories. + * + * @author Fabien Potencier + * + * @extends \FilterIterator + * + * @implements \RecursiveIterator + */ +class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator +{ + private $iterator; + private $isRecursive; + private $excludedDirs = []; + private $excludedPattern; + + /** + * @param \Iterator $iterator The Iterator to filter + * @param string[] $directories An array of directories to exclude + */ + public function __construct(\Iterator $iterator, array $directories) + { + $this->iterator = $iterator; + $this->isRecursive = $iterator instanceof \RecursiveIterator; + $patterns = []; + foreach ($directories as $directory) { + $directory = rtrim($directory, '/'); + if (!$this->isRecursive || str_contains($directory, '/')) { + $patterns[] = preg_quote($directory, '#'); + } else { + $this->excludedDirs[$directory] = true; + } + } + if ($patterns) { + $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; + } + + parent::__construct($iterator); + } + + /** + * Filters the iterator values. + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { + return false; + } + + if ($this->excludedPattern) { + $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath(); + $path = str_replace('\\', '/', $path); + + return !preg_match($this->excludedPattern, $path); + } + + return true; + } + + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function hasChildren() + { + return $this->isRecursive && $this->iterator->hasChildren(); + } + + /** + * @return self + */ + #[\ReturnTypeWillChange] + public function getChildren() + { + $children = new self($this->iterator->getChildren(), []); + $children->excludedDirs = $this->excludedDirs; + $children->excludedPattern = $this->excludedPattern; + + return $children; + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php new file mode 100644 index 00000000..793ae350 --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +/** + * FileTypeFilterIterator only keeps files, directories, or both. + * + * @author Fabien Potencier + * + * @extends \FilterIterator + */ +class FileTypeFilterIterator extends \FilterIterator +{ + public const ONLY_FILES = 1; + public const ONLY_DIRECTORIES = 2; + + private $mode; + + /** + * @param \Iterator $iterator The Iterator to filter + * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) + */ + public function __construct(\Iterator $iterator, int $mode) + { + $this->mode = $mode; + + parent::__construct($iterator); + } + + /** + * Filters the iterator values. + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + $fileinfo = $this->current(); + if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { + return false; + } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) { + return false; + } + + return true; + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php new file mode 100644 index 00000000..79f8c29d --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +/** + * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). + * + * @author Fabien Potencier + * @author Włodzimierz Gajda + * + * @extends MultiplePcreFilterIterator + */ +class FilecontentFilterIterator extends MultiplePcreFilterIterator +{ + /** + * Filters the iterator values. + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + if (!$this->matchRegexps && !$this->noMatchRegexps) { + return true; + } + + $fileinfo = $this->current(); + + if ($fileinfo->isDir() || !$fileinfo->isReadable()) { + return false; + } + + $content = $fileinfo->getContents(); + if (!$content) { + return false; + } + + return $this->isAccepted($content); + } + + /** + * Converts string to regexp if necessary. + * + * @param string $str Pattern: string or regexp + * + * @return string + */ + protected function toRegex(string $str) + { + return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/FilenameFilterIterator.php new file mode 100644 index 00000000..77b3b241 --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/FilenameFilterIterator.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +use Symfony\Component\Finder\Glob; + +/** + * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). + * + * @author Fabien Potencier + * + * @extends MultiplePcreFilterIterator + */ +class FilenameFilterIterator extends MultiplePcreFilterIterator +{ + /** + * Filters the iterator values. + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + return $this->isAccepted($this->current()->getFilename()); + } + + /** + * Converts glob to regexp. + * + * PCRE patterns are left unchanged. + * Glob strings are transformed with Glob::toRegex(). + * + * @param string $str Pattern: glob or regexp + * + * @return string + */ + protected function toRegex(string $str) + { + return $this->isRegex($str) ? $str : Glob::toRegex($str); + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/LazyIterator.php b/trunk/vendor/symfony/finder/Iterator/LazyIterator.php new file mode 100644 index 00000000..32cc37ff --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/LazyIterator.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +/** + * @author Jérémy Derussé + * + * @internal + */ +class LazyIterator implements \IteratorAggregate +{ + private $iteratorFactory; + + public function __construct(callable $iteratorFactory) + { + $this->iteratorFactory = $iteratorFactory; + } + + public function getIterator(): \Traversable + { + yield from ($this->iteratorFactory)(); + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php new file mode 100644 index 00000000..564765d8 --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +/** + * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). + * + * @author Fabien Potencier + * + * @template-covariant TKey + * @template-covariant TValue + * + * @extends \FilterIterator + */ +abstract class MultiplePcreFilterIterator extends \FilterIterator +{ + protected $matchRegexps = []; + protected $noMatchRegexps = []; + + /** + * @param \Iterator $iterator The Iterator to filter + * @param string[] $matchPatterns An array of patterns that need to match + * @param string[] $noMatchPatterns An array of patterns that need to not match + */ + public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) + { + foreach ($matchPatterns as $pattern) { + $this->matchRegexps[] = $this->toRegex($pattern); + } + + foreach ($noMatchPatterns as $pattern) { + $this->noMatchRegexps[] = $this->toRegex($pattern); + } + + parent::__construct($iterator); + } + + /** + * Checks whether the string is accepted by the regex filters. + * + * If there is no regexps defined in the class, this method will accept the string. + * Such case can be handled by child classes before calling the method if they want to + * apply a different behavior. + * + * @return bool + */ + protected function isAccepted(string $string) + { + // should at least not match one rule to exclude + foreach ($this->noMatchRegexps as $regex) { + if (preg_match($regex, $string)) { + return false; + } + } + + // should at least match one rule + if ($this->matchRegexps) { + foreach ($this->matchRegexps as $regex) { + if (preg_match($regex, $string)) { + return true; + } + } + + return false; + } + + // If there is no match rules, the file is accepted + return true; + } + + /** + * Checks whether the string is a regex. + * + * @return bool + */ + protected function isRegex(string $str) + { + $availableModifiers = 'imsxuADU'; + + if (\PHP_VERSION_ID >= 80200) { + $availableModifiers .= 'n'; + } + + if (preg_match('/^(.{3,}?)['.$availableModifiers.']*$/', $str, $m)) { + $start = substr($m[1], 0, 1); + $end = substr($m[1], -1); + + if ($start === $end) { + return !preg_match('/[*?[:alnum:] \\\\]/', $start); + } + + foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) { + if ($start === $delimiters[0] && $end === $delimiters[1]) { + return true; + } + } + } + + return false; + } + + /** + * Converts string into regexp. + * + * @return string + */ + abstract protected function toRegex(string $str); +} diff --git a/trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php new file mode 100644 index 00000000..7974c4ee --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +/** + * PathFilterIterator filters files by path patterns (e.g. some/special/dir). + * + * @author Fabien Potencier + * @author Włodzimierz Gajda + * + * @extends MultiplePcreFilterIterator + */ +class PathFilterIterator extends MultiplePcreFilterIterator +{ + /** + * Filters the iterator values. + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + $filename = $this->current()->getRelativePathname(); + + if ('\\' === \DIRECTORY_SEPARATOR) { + $filename = str_replace('\\', '/', $filename); + } + + return $this->isAccepted($filename); + } + + /** + * Converts strings to regexp. + * + * PCRE patterns are left unchanged. + * + * Default conversion: + * 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' + * + * Use only / as directory separator (on Windows also). + * + * @param string $str Pattern: regexp or dirname + * + * @return string + */ + protected function toRegex(string $str) + { + return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/trunk/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php new file mode 100644 index 00000000..886dae58 --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php @@ -0,0 +1,157 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +use Symfony\Component\Finder\Exception\AccessDeniedException; +use Symfony\Component\Finder\SplFileInfo; + +/** + * Extends the \RecursiveDirectoryIterator to support relative paths. + * + * @author Victor Berchet + */ +class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator +{ + /** + * @var bool + */ + private $ignoreUnreadableDirs; + + /** + * @var bool + */ + private $ignoreFirstRewind = true; + + // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations + private $rootPath; + private $subPath; + private $directorySeparator = '/'; + + /** + * @throws \RuntimeException + */ + public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) + { + if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) { + throw new \RuntimeException('This iterator only support returning current as fileinfo.'); + } + + parent::__construct($path, $flags); + $this->ignoreUnreadableDirs = $ignoreUnreadableDirs; + $this->rootPath = $path; + if ('/' !== \DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) { + $this->directorySeparator = \DIRECTORY_SEPARATOR; + } + } + + /** + * Return an instance of SplFileInfo with support for relative paths. + * + * @return SplFileInfo + */ + #[\ReturnTypeWillChange] + public function current() + { + // the logic here avoids redoing the same work in all iterations + + if (null === $subPathname = $this->subPath) { + $subPathname = $this->subPath = $this->getSubPath(); + } + if ('' !== $subPathname) { + $subPathname .= $this->directorySeparator; + } + $subPathname .= $this->getFilename(); + + if ('/' !== $basePath = $this->rootPath) { + $basePath .= $this->directorySeparator; + } + + return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); + } + + /** + * @param bool $allowLinks + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function hasChildren($allowLinks = false) + { + $hasChildren = parent::hasChildren($allowLinks); + + if (!$hasChildren || !$this->ignoreUnreadableDirs) { + return $hasChildren; + } + + try { + parent::getChildren(); + + return true; + } catch (\UnexpectedValueException $e) { + // If directory is unreadable and finder is set to ignore it, skip children + return false; + } + } + + /** + * @return \RecursiveDirectoryIterator + * + * @throws AccessDeniedException + */ + #[\ReturnTypeWillChange] + public function getChildren() + { + try { + $children = parent::getChildren(); + + if ($children instanceof self) { + // parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore + $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; + + // performance optimization to avoid redoing the same work in all children + $children->rootPath = $this->rootPath; + } + + return $children; + } catch (\UnexpectedValueException $e) { + throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e); + } + } + + /** + * @return void + */ + #[\ReturnTypeWillChange] + public function next() + { + $this->ignoreFirstRewind = false; + + parent::next(); + } + + /** + * @return void + */ + #[\ReturnTypeWillChange] + public function rewind() + { + // some streams like FTP are not rewindable, ignore the first rewind after creation, + // as newly created DirectoryIterator does not need to be rewound + if ($this->ignoreFirstRewind) { + $this->ignoreFirstRewind = false; + + return; + } + + parent::rewind(); + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php new file mode 100644 index 00000000..575bf29b --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +use Symfony\Component\Finder\Comparator\NumberComparator; + +/** + * SizeRangeFilterIterator filters out files that are not in the given size range. + * + * @author Fabien Potencier + * + * @extends \FilterIterator + */ +class SizeRangeFilterIterator extends \FilterIterator +{ + private $comparators = []; + + /** + * @param \Iterator $iterator + * @param NumberComparator[] $comparators + */ + public function __construct(\Iterator $iterator, array $comparators) + { + $this->comparators = $comparators; + + parent::__construct($iterator); + } + + /** + * Filters the iterator values. + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function accept() + { + $fileinfo = $this->current(); + if (!$fileinfo->isFile()) { + return true; + } + + $filesize = $fileinfo->getSize(); + foreach ($this->comparators as $compare) { + if (!$compare->test($filesize)) { + return false; + } + } + + return true; + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/SortableIterator.php b/trunk/vendor/symfony/finder/Iterator/SortableIterator.php new file mode 100644 index 00000000..9afde5c2 --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/SortableIterator.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +/** + * SortableIterator applies a sort on a given Iterator. + * + * @author Fabien Potencier + * + * @implements \IteratorAggregate + */ +class SortableIterator implements \IteratorAggregate +{ + public const SORT_BY_NONE = 0; + public const SORT_BY_NAME = 1; + public const SORT_BY_TYPE = 2; + public const SORT_BY_ACCESSED_TIME = 3; + public const SORT_BY_CHANGED_TIME = 4; + public const SORT_BY_MODIFIED_TIME = 5; + public const SORT_BY_NAME_NATURAL = 6; + + private $iterator; + private $sort; + + /** + * @param \Traversable $iterator + * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) + * + * @throws \InvalidArgumentException + */ + public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false) + { + $this->iterator = $iterator; + $order = $reverseOrder ? -1 : 1; + + if (self::SORT_BY_NAME === $sort) { + $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { + return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); + }; + } elseif (self::SORT_BY_NAME_NATURAL === $sort) { + $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { + return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); + }; + } elseif (self::SORT_BY_TYPE === $sort) { + $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { + if ($a->isDir() && $b->isFile()) { + return -$order; + } elseif ($a->isFile() && $b->isDir()) { + return $order; + } + + return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); + }; + } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { + $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { + return $order * ($a->getATime() - $b->getATime()); + }; + } elseif (self::SORT_BY_CHANGED_TIME === $sort) { + $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { + return $order * ($a->getCTime() - $b->getCTime()); + }; + } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { + $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { + return $order * ($a->getMTime() - $b->getMTime()); + }; + } elseif (self::SORT_BY_NONE === $sort) { + $this->sort = $order; + } elseif (\is_callable($sort)) { + $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort; + } else { + throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); + } + } + + /** + * @return \Traversable + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + if (1 === $this->sort) { + return $this->iterator; + } + + $array = iterator_to_array($this->iterator, true); + + if (-1 === $this->sort) { + $array = array_reverse($array); + } else { + uasort($array, $this->sort); + } + + return new \ArrayIterator($array); + } +} diff --git a/trunk/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php new file mode 100644 index 00000000..e27158cb --- /dev/null +++ b/trunk/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php @@ -0,0 +1,151 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Iterator; + +use Symfony\Component\Finder\Gitignore; + +final class VcsIgnoredFilterIterator extends \FilterIterator +{ + /** + * @var string + */ + private $baseDir; + + /** + * @var array + */ + private $gitignoreFilesCache = []; + + /** + * @var array + */ + private $ignoredPathsCache = []; + + public function __construct(\Iterator $iterator, string $baseDir) + { + $this->baseDir = $this->normalizePath($baseDir); + + parent::__construct($iterator); + } + + public function accept(): bool + { + $file = $this->current(); + + $fileRealPath = $this->normalizePath($file->getRealPath()); + + return !$this->isIgnored($fileRealPath); + } + + private function isIgnored(string $fileRealPath): bool + { + if (is_dir($fileRealPath) && !str_ends_with($fileRealPath, '/')) { + $fileRealPath .= '/'; + } + + if (isset($this->ignoredPathsCache[$fileRealPath])) { + return $this->ignoredPathsCache[$fileRealPath]; + } + + $ignored = false; + + foreach ($this->parentsDirectoryDownward($fileRealPath) as $parentDirectory) { + if ($this->isIgnored($parentDirectory)) { + // rules in ignored directories are ignored, no need to check further. + break; + } + + $fileRelativePath = substr($fileRealPath, \strlen($parentDirectory) + 1); + + if (null === $regexps = $this->readGitignoreFile("{$parentDirectory}/.gitignore")) { + continue; + } + + [$exclusionRegex, $inclusionRegex] = $regexps; + + if (preg_match($exclusionRegex, $fileRelativePath)) { + $ignored = true; + + continue; + } + + if (preg_match($inclusionRegex, $fileRelativePath)) { + $ignored = false; + } + } + + return $this->ignoredPathsCache[$fileRealPath] = $ignored; + } + + /** + * @return list + */ + private function parentsDirectoryDownward(string $fileRealPath): array + { + $parentDirectories = []; + + $parentDirectory = $fileRealPath; + + while (true) { + $newParentDirectory = \dirname($parentDirectory); + + // dirname('/') = '/' + if ($newParentDirectory === $parentDirectory) { + break; + } + + $parentDirectory = $newParentDirectory; + + if (0 !== strpos($parentDirectory, $this->baseDir)) { + break; + } + + $parentDirectories[] = $parentDirectory; + } + + return array_reverse($parentDirectories); + } + + /** + * @return array{0: string, 1: string}|null + */ + private function readGitignoreFile(string $path): ?array + { + if (\array_key_exists($path, $this->gitignoreFilesCache)) { + return $this->gitignoreFilesCache[$path]; + } + + if (!file_exists($path)) { + return $this->gitignoreFilesCache[$path] = null; + } + + if (!is_file($path) || !is_readable($path)) { + throw new \RuntimeException("The \"ignoreVCSIgnored\" option cannot be used by the Finder as the \"{$path}\" file is not readable."); + } + + $gitignoreFileContent = file_get_contents($path); + + return $this->gitignoreFilesCache[$path] = [ + Gitignore::toRegex($gitignoreFileContent), + Gitignore::toRegexMatchingNegatedPatterns($gitignoreFileContent), + ]; + } + + private function normalizePath(string $path): string + { + if ('\\' === \DIRECTORY_SEPARATOR) { + return str_replace('\\', '/', $path); + } + + return $path; + } +} diff --git a/trunk/vendor/symfony/finder/LICENSE b/trunk/vendor/symfony/finder/LICENSE new file mode 100644 index 00000000..0138f8f0 --- /dev/null +++ b/trunk/vendor/symfony/finder/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/finder/SplFileInfo.php b/trunk/vendor/symfony/finder/SplFileInfo.php new file mode 100644 index 00000000..11604a2e --- /dev/null +++ b/trunk/vendor/symfony/finder/SplFileInfo.php @@ -0,0 +1,88 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder; + +/** + * Extends \SplFileInfo to support relative paths. + * + * @author Fabien Potencier + */ +class SplFileInfo extends \SplFileInfo +{ + private $relativePath; + private $relativePathname; + + /** + * @param string $file The file name + * @param string $relativePath The relative path + * @param string $relativePathname The relative path name + */ + public function __construct(string $file, string $relativePath, string $relativePathname) + { + parent::__construct($file); + $this->relativePath = $relativePath; + $this->relativePathname = $relativePathname; + } + + /** + * Returns the relative path. + * + * This path does not contain the file name. + * + * @return string + */ + public function getRelativePath() + { + return $this->relativePath; + } + + /** + * Returns the relative path name. + * + * This path contains the file name. + * + * @return string + */ + public function getRelativePathname() + { + return $this->relativePathname; + } + + public function getFilenameWithoutExtension(): string + { + $filename = $this->getFilename(); + + return pathinfo($filename, \PATHINFO_FILENAME); + } + + /** + * Returns the contents of the file. + * + * @return string + * + * @throws \RuntimeException + */ + public function getContents() + { + set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); + try { + $content = file_get_contents($this->getPathname()); + } finally { + restore_error_handler(); + } + if (false === $content) { + throw new \RuntimeException($error); + } + + return $content; + } +} diff --git a/trunk/vendor/symfony/polyfill-ctype/Ctype.php b/trunk/vendor/symfony/polyfill-ctype/Ctype.php new file mode 100644 index 00000000..ba75a2c9 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-ctype/Ctype.php @@ -0,0 +1,232 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Ctype; + +/** + * Ctype implementation through regex. + * + * @internal + * + * @author Gert de Pagter + */ +final class Ctype +{ + /** + * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. + * + * @see https://php.net/ctype-alnum + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_alnum($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); + } + + /** + * Returns TRUE if every character in text is a letter, FALSE otherwise. + * + * @see https://php.net/ctype-alpha + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_alpha($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); + } + + /** + * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. + * + * @see https://php.net/ctype-cntrl + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_cntrl($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); + } + + /** + * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. + * + * @see https://php.net/ctype-digit + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_digit($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); + } + + /** + * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. + * + * @see https://php.net/ctype-graph + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_graph($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); + } + + /** + * Returns TRUE if every character in text is a lowercase letter. + * + * @see https://php.net/ctype-lower + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_lower($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); + } + + /** + * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. + * + * @see https://php.net/ctype-print + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_print($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); + } + + /** + * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. + * + * @see https://php.net/ctype-punct + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_punct($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); + } + + /** + * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. + * + * @see https://php.net/ctype-space + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_space($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); + } + + /** + * Returns TRUE if every character in text is an uppercase letter. + * + * @see https://php.net/ctype-upper + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_upper($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); + } + + /** + * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. + * + * @see https://php.net/ctype-xdigit + * + * @param mixed $text + * + * @return bool + */ + public static function ctype_xdigit($text) + { + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + + return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); + } + + /** + * Converts integers to their char versions according to normal ctype behaviour, if needed. + * + * If an integer between -128 and 255 inclusive is provided, + * it is interpreted as the ASCII value of a single character + * (negative values have 256 added in order to allow characters in the Extended ASCII range). + * Any other integer is interpreted as a string containing the decimal digits of the integer. + * + * @param mixed $int + * @param string $function + * + * @return mixed + */ + private static function convert_int_to_char_for_ctype($int, $function) + { + if (!\is_int($int)) { + return $int; + } + + if ($int < -128 || $int > 255) { + return (string) $int; + } + + if (\PHP_VERSION_ID >= 80100) { + @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); + } + + if ($int < 0) { + $int += 256; + } + + return \chr($int); + } +} diff --git a/trunk/vendor/symfony/polyfill-ctype/LICENSE b/trunk/vendor/symfony/polyfill-ctype/LICENSE new file mode 100644 index 00000000..7536caea --- /dev/null +++ b/trunk/vendor/symfony/polyfill-ctype/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-ctype/bootstrap.php b/trunk/vendor/symfony/polyfill-ctype/bootstrap.php new file mode 100644 index 00000000..d54524b3 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-ctype/bootstrap.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Ctype as p; + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!function_exists('ctype_alnum')) { + function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } +} +if (!function_exists('ctype_alpha')) { + function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } +} +if (!function_exists('ctype_cntrl')) { + function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } +} +if (!function_exists('ctype_digit')) { + function ctype_digit($text) { return p\Ctype::ctype_digit($text); } +} +if (!function_exists('ctype_graph')) { + function ctype_graph($text) { return p\Ctype::ctype_graph($text); } +} +if (!function_exists('ctype_lower')) { + function ctype_lower($text) { return p\Ctype::ctype_lower($text); } +} +if (!function_exists('ctype_print')) { + function ctype_print($text) { return p\Ctype::ctype_print($text); } +} +if (!function_exists('ctype_punct')) { + function ctype_punct($text) { return p\Ctype::ctype_punct($text); } +} +if (!function_exists('ctype_space')) { + function ctype_space($text) { return p\Ctype::ctype_space($text); } +} +if (!function_exists('ctype_upper')) { + function ctype_upper($text) { return p\Ctype::ctype_upper($text); } +} +if (!function_exists('ctype_xdigit')) { + function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } +} diff --git a/trunk/vendor/symfony/polyfill-ctype/bootstrap80.php b/trunk/vendor/symfony/polyfill-ctype/bootstrap80.php new file mode 100644 index 00000000..ab2f8611 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-ctype/bootstrap80.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Ctype as p; + +if (!function_exists('ctype_alnum')) { + function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } +} +if (!function_exists('ctype_alpha')) { + function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } +} +if (!function_exists('ctype_cntrl')) { + function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } +} +if (!function_exists('ctype_digit')) { + function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } +} +if (!function_exists('ctype_graph')) { + function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } +} +if (!function_exists('ctype_lower')) { + function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } +} +if (!function_exists('ctype_print')) { + function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } +} +if (!function_exists('ctype_punct')) { + function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } +} +if (!function_exists('ctype_space')) { + function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } +} +if (!function_exists('ctype_upper')) { + function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } +} +if (!function_exists('ctype_xdigit')) { + function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } +} diff --git a/trunk/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/trunk/vendor/symfony/polyfill-intl-grapheme/Grapheme.php new file mode 100644 index 00000000..5373f168 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-grapheme/Grapheme.php @@ -0,0 +1,247 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Intl\Grapheme; + +\define('SYMFONY_GRAPHEME_CLUSTER_RX', ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39) ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); + +/** + * Partial intl implementation in pure PHP. + * + * Implemented: + * - grapheme_extract - Extract a sequence of grapheme clusters from a text buffer, which must be encoded in UTF-8 + * - grapheme_stripos - Find position (in grapheme units) of first occurrence of a case-insensitive string + * - grapheme_stristr - Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack + * - grapheme_strlen - Get string length in grapheme units + * - grapheme_strpos - Find position (in grapheme units) of first occurrence of a string + * - grapheme_strripos - Find position (in grapheme units) of last occurrence of a case-insensitive string + * - grapheme_strrpos - Find position (in grapheme units) of last occurrence of a string + * - grapheme_strstr - Returns part of haystack string from the first occurrence of needle to the end of haystack + * - grapheme_substr - Return part of a string + * + * @author Nicolas Grekas + * + * @internal + */ +final class Grapheme +{ + // (CRLF|([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*|[Control]) + // This regular expression is a work around for http://bugs.exim.org/1279 + public const GRAPHEME_CLUSTER_RX = '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; + + private const CASE_FOLD = [ + ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], + ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], + ]; + + public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = 0, &$next = 0) + { + if (0 > $start) { + $start = \strlen($s) + $start; + } + + if (!\is_scalar($s)) { + $hasError = false; + set_error_handler(function () use (&$hasError) { $hasError = true; }); + $next = substr($s, $start); + restore_error_handler(); + if ($hasError) { + substr($s, $start); + $s = ''; + } else { + $s = $next; + } + } else { + $s = substr($s, $start); + } + $size = (int) $size; + $type = (int) $type; + $start = (int) $start; + + if (\GRAPHEME_EXTR_COUNT !== $type && \GRAPHEME_EXTR_MAXBYTES !== $type && \GRAPHEME_EXTR_MAXCHARS !== $type) { + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError('grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS'); + } + + if (!isset($s[0]) || 0 > $size || 0 > $start) { + return false; + } + if (0 === $size) { + return ''; + } + + $next = $start; + + $s = preg_split('/('.SYMFONY_GRAPHEME_CLUSTER_RX.')/u', "\r\n".$s, $size + 1, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); + + if (!isset($s[1])) { + return false; + } + + $i = 1; + $ret = ''; + + do { + if (\GRAPHEME_EXTR_COUNT === $type) { + --$size; + } elseif (\GRAPHEME_EXTR_MAXBYTES === $type) { + $size -= \strlen($s[$i]); + } else { + $size -= iconv_strlen($s[$i], 'UTF-8//IGNORE'); + } + + if ($size >= 0) { + $ret .= $s[$i]; + } + } while (isset($s[++$i]) && $size > 0); + + $next += \strlen($ret); + + return $ret; + } + + public static function grapheme_strlen($s) + { + preg_replace('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', '', $s, -1, $len); + + return 0 === $len && '' !== $s ? null : $len; + } + + public static function grapheme_substr($s, $start, $len = null) + { + if (null === $len) { + $len = 2147483647; + } + + preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s, $s); + + $slen = \count($s[0]); + $start = (int) $start; + + if (0 > $start) { + $start += $slen; + } + if (0 > $start) { + if (\PHP_VERSION_ID < 80000) { + return false; + } + + $start = 0; + } + if ($start >= $slen) { + return \PHP_VERSION_ID >= 80000 ? '' : false; + } + + $rem = $slen - $start; + + if (0 > $len) { + $len += $rem; + } + if (0 === $len) { + return ''; + } + if (0 > $len) { + return \PHP_VERSION_ID >= 80000 ? '' : false; + } + if ($len > $rem) { + $len = $rem; + } + + return implode('', \array_slice($s[0], $start, $len)); + } + + public static function grapheme_strpos($s, $needle, $offset = 0) + { + return self::grapheme_position($s, $needle, $offset, 0); + } + + public static function grapheme_stripos($s, $needle, $offset = 0) + { + return self::grapheme_position($s, $needle, $offset, 1); + } + + public static function grapheme_strrpos($s, $needle, $offset = 0) + { + return self::grapheme_position($s, $needle, $offset, 2); + } + + public static function grapheme_strripos($s, $needle, $offset = 0) + { + return self::grapheme_position($s, $needle, $offset, 3); + } + + public static function grapheme_stristr($s, $needle, $beforeNeedle = false) + { + return mb_stristr($s, $needle, $beforeNeedle, 'UTF-8'); + } + + public static function grapheme_strstr($s, $needle, $beforeNeedle = false) + { + return mb_strstr($s, $needle, $beforeNeedle, 'UTF-8'); + } + + private static function grapheme_position($s, $needle, $offset, $mode) + { + $needle = (string) $needle; + if (80000 > \PHP_VERSION_ID && !preg_match('/./us', $needle)) { + return false; + } + $s = (string) $s; + if (!preg_match('/./us', $s)) { + return false; + } + if ($offset > 0) { + $s = self::grapheme_substr($s, $offset); + } elseif ($offset < 0) { + if (2 > $mode) { + $offset += self::grapheme_strlen($s); + $s = self::grapheme_substr($s, $offset); + if (0 > $offset) { + $offset = 0; + } + } elseif (0 > $offset += self::grapheme_strlen($needle)) { + $s = self::grapheme_substr($s, 0, $offset); + $offset = 0; + } else { + $offset = 0; + } + } + + // As UTF-8 is self-synchronizing, and we have ensured the strings are valid UTF-8, + // we can use normal binary string functions here. For case-insensitive searches, + // case fold the strings first. + $caseInsensitive = $mode & 1; + $reverse = $mode & 2; + if ($caseInsensitive) { + // Use the same case folding mode as mbstring does for mb_stripos(). + // Stick to SIMPLE case folding to avoid changing the length of the string, which + // might result in offsets being shifted. + $mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_LOWER; + $s = mb_convert_case($s, $mode, 'UTF-8'); + $needle = mb_convert_case($needle, $mode, 'UTF-8'); + + if (!\defined('MB_CASE_FOLD_SIMPLE')) { + $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); + $needle = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $needle); + } + } + if ($reverse) { + $needlePos = strrpos($s, $needle); + } else { + $needlePos = strpos($s, $needle); + } + + return false !== $needlePos ? self::grapheme_strlen(substr($s, 0, $needlePos)) + $offset : false; + } +} diff --git a/trunk/vendor/symfony/polyfill-intl-grapheme/LICENSE b/trunk/vendor/symfony/polyfill-intl-grapheme/LICENSE new file mode 100644 index 00000000..6e3afce6 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-grapheme/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap.php b/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap.php new file mode 100644 index 00000000..a9ea03c7 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Grapheme as p; + +if (extension_loaded('intl')) { + return; +} + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!defined('GRAPHEME_EXTR_COUNT')) { + define('GRAPHEME_EXTR_COUNT', 0); +} +if (!defined('GRAPHEME_EXTR_MAXBYTES')) { + define('GRAPHEME_EXTR_MAXBYTES', 1); +} +if (!defined('GRAPHEME_EXTR_MAXCHARS')) { + define('GRAPHEME_EXTR_MAXCHARS', 2); +} + +if (!function_exists('grapheme_extract')) { + function grapheme_extract($haystack, $size, $type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($haystack, $size, $type, $start, $next); } +} +if (!function_exists('grapheme_stripos')) { + function grapheme_stripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos($haystack, $needle, $offset); } +} +if (!function_exists('grapheme_stristr')) { + function grapheme_stristr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr($haystack, $needle, $beforeNeedle); } +} +if (!function_exists('grapheme_strlen')) { + function grapheme_strlen($input) { return p\Grapheme::grapheme_strlen($input); } +} +if (!function_exists('grapheme_strpos')) { + function grapheme_strpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos($haystack, $needle, $offset); } +} +if (!function_exists('grapheme_strripos')) { + function grapheme_strripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos($haystack, $needle, $offset); } +} +if (!function_exists('grapheme_strrpos')) { + function grapheme_strrpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos($haystack, $needle, $offset); } +} +if (!function_exists('grapheme_strstr')) { + function grapheme_strstr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr($haystack, $needle, $beforeNeedle); } +} +if (!function_exists('grapheme_substr')) { + function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr($string, $offset, $length); } +} diff --git a/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php b/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php new file mode 100644 index 00000000..b8c07867 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Grapheme as p; + +if (!defined('GRAPHEME_EXTR_COUNT')) { + define('GRAPHEME_EXTR_COUNT', 0); +} +if (!defined('GRAPHEME_EXTR_MAXBYTES')) { + define('GRAPHEME_EXTR_MAXBYTES', 1); +} +if (!defined('GRAPHEME_EXTR_MAXCHARS')) { + define('GRAPHEME_EXTR_MAXCHARS', 2); +} + +if (!function_exists('grapheme_extract')) { + function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); } +} +if (!function_exists('grapheme_stripos')) { + function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); } +} +if (!function_exists('grapheme_stristr')) { + function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } +} +if (!function_exists('grapheme_strlen')) { + function grapheme_strlen(?string $string): int|false|null { return p\Grapheme::grapheme_strlen((string) $string); } +} +if (!function_exists('grapheme_strpos')) { + function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); } +} +if (!function_exists('grapheme_strripos')) { + function grapheme_strripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); } +} +if (!function_exists('grapheme_strrpos')) { + function grapheme_strrpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); } +} +if (!function_exists('grapheme_strstr')) { + function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } +} +if (!function_exists('grapheme_substr')) { + function grapheme_substr(?string $string, ?int $offset, ?int $length = null): string|false { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); } +} diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/LICENSE b/trunk/vendor/symfony/polyfill-intl-normalizer/LICENSE new file mode 100644 index 00000000..6e3afce6 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-normalizer/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Normalizer.php new file mode 100644 index 00000000..81704ab3 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-normalizer/Normalizer.php @@ -0,0 +1,310 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Intl\Normalizer; + +/** + * Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension. + * + * It has been validated with Unicode 6.3 Normalization Conformance Test. + * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. + * + * @author Nicolas Grekas + * + * @internal + */ +class Normalizer +{ + public const FORM_D = \Normalizer::FORM_D; + public const FORM_KD = \Normalizer::FORM_KD; + public const FORM_C = \Normalizer::FORM_C; + public const FORM_KC = \Normalizer::FORM_KC; + public const NFD = \Normalizer::NFD; + public const NFKD = \Normalizer::NFKD; + public const NFC = \Normalizer::NFC; + public const NFKC = \Normalizer::NFKC; + + private static $C; + private static $D; + private static $KD; + private static $cC; + private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; + + public static function isNormalized(string $s, int $form = self::FORM_C) + { + if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { + return false; + } + if (!isset($s[strspn($s, self::$ASCII)])) { + return true; + } + if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { + return true; + } + + return self::normalize($s, $form) === $s; + } + + public static function normalize(string $s, int $form = self::FORM_C) + { + if (!preg_match('//u', $s)) { + return false; + } + + switch ($form) { + case self::NFC: $C = true; $K = false; break; + case self::NFD: $C = false; $K = false; break; + case self::NFKC: $C = true; $K = true; break; + case self::NFKD: $C = false; $K = true; break; + default: + if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { + return $s; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); + } + + if ('' === $s) { + return ''; + } + + if ($K && null === self::$KD) { + self::$KD = self::getData('compatibilityDecomposition'); + } + + if (null === self::$D) { + self::$D = self::getData('canonicalDecomposition'); + self::$cC = self::getData('combiningClass'); + } + + if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { + mb_internal_encoding('8bit'); + } + + $r = self::decompose($s, $K); + + if ($C) { + if (null === self::$C) { + self::$C = self::getData('canonicalComposition'); + } + + $r = self::recompose($r); + } + if (null !== $mbEncoding) { + mb_internal_encoding($mbEncoding); + } + + return $r; + } + + private static function recompose($s) + { + $ASCII = self::$ASCII; + $compMap = self::$C; + $combClass = self::$cC; + $ulenMask = self::$ulenMask; + + $result = $tail = ''; + + $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; + $len = \strlen($s); + + $lastUchr = substr($s, 0, $i); + $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; + + while ($i < $len) { + if ($s[$i] < "\x80") { + // ASCII chars + + if ($tail) { + $lastUchr .= $tail; + $tail = ''; + } + + if ($j = strspn($s, $ASCII, $i + 1)) { + $lastUchr .= substr($s, $i, $j); + $i += $j; + } + + $result .= $lastUchr; + $lastUchr = $s[$i]; + $lastUcls = 0; + ++$i; + continue; + } + + $ulen = $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + + if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr + || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr + || $lastUcls) { + // Table lookup and combining chars composition + + $ucls = $combClass[$uchr] ?? 0; + + if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { + $lastUchr = $compMap[$lastUchr.$uchr]; + } elseif ($lastUcls = $ucls) { + $tail .= $uchr; + } else { + if ($tail) { + $lastUchr .= $tail; + $tail = ''; + } + + $result .= $lastUchr; + $lastUchr = $uchr; + } + } else { + // Hangul chars + + $L = \ord($lastUchr[2]) - 0x80; + $V = \ord($uchr[2]) - 0xA1; + $T = 0; + + $uchr = substr($s, $i + $ulen, 3); + + if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { + $T = \ord($uchr[2]) - 0xA7; + 0 > $T && $T += 0x40; + $ulen += 3; + } + + $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; + $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); + } + + $i += $ulen; + } + + return $result.$lastUchr.$tail; + } + + private static function decompose($s, $c) + { + $result = ''; + + $ASCII = self::$ASCII; + $decompMap = self::$D; + $combClass = self::$cC; + $ulenMask = self::$ulenMask; + if ($c) { + $compatMap = self::$KD; + } + + $c = []; + $i = 0; + $len = \strlen($s); + + while ($i < $len) { + if ($s[$i] < "\x80") { + // ASCII chars + + if ($c) { + ksort($c); + $result .= implode('', $c); + $c = []; + } + + $j = 1 + strspn($s, $ASCII, $i + 1); + $result .= substr($s, $i, $j); + $i += $j; + continue; + } + + $ulen = $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + + if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { + // Table lookup + + if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { + $uchr = $j; + + $j = \strlen($uchr); + $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; + + if ($ulen != $j) { + // Put trailing chars in $s + + $j -= $ulen; + $i -= $j; + + if (0 > $i) { + $s = str_repeat(' ', -$i).$s; + $len -= $i; + $i = 0; + } + + while ($j--) { + $s[$i + $j] = $uchr[$ulen + $j]; + } + + $uchr = substr($uchr, 0, $ulen); + } + } + if (isset($combClass[$uchr])) { + // Combining chars, for sorting + + if (!isset($c[$combClass[$uchr]])) { + $c[$combClass[$uchr]] = ''; + } + $c[$combClass[$uchr]] .= $uchr; + continue; + } + } else { + // Hangul chars + + $uchr = unpack('C*', $uchr); + $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; + + $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) + ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); + + if ($j %= 28) { + $uchr .= $j < 25 + ? ("\xE1\x86".\chr(0xA7 + $j)) + : ("\xE1\x87".\chr(0x67 + $j)); + } + } + if ($c) { + ksort($c); + $result .= implode('', $c); + $c = []; + } + + $result .= $uchr; + } + + if ($c) { + ksort($c); + $result .= implode('', $c); + } + + return $result; + } + + private static function getData($file) + { + if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + return require $file; + } + + return false; + } +} diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php new file mode 100644 index 00000000..0fdfc890 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php @@ -0,0 +1,17 @@ + 'À', + 'Á' => 'Á', + 'Â' => 'Â', + 'Ã' => 'Ã', + 'Ä' => 'Ä', + 'Å' => 'Å', + 'Ç' => 'Ç', + 'È' => 'È', + 'É' => 'É', + 'Ê' => 'Ê', + 'Ë' => 'Ë', + 'Ì' => 'Ì', + 'Í' => 'Í', + 'Î' => 'Î', + 'Ï' => 'Ï', + 'Ñ' => 'Ñ', + 'Ò' => 'Ò', + 'Ó' => 'Ó', + 'Ô' => 'Ô', + 'Õ' => 'Õ', + 'Ö' => 'Ö', + 'Ù' => 'Ù', + 'Ú' => 'Ú', + 'Û' => 'Û', + 'Ü' => 'Ü', + 'Ý' => 'Ý', + 'à' => 'à', + 'á' => 'á', + 'â' => 'â', + 'ã' => 'ã', + 'ä' => 'ä', + 'å' => 'å', + 'ç' => 'ç', + 'è' => 'è', + 'é' => 'é', + 'ê' => 'ê', + 'ë' => 'ë', + 'ì' => 'ì', + 'í' => 'í', + 'î' => 'î', + 'ï' => 'ï', + 'ñ' => 'ñ', + 'ò' => 'ò', + 'ó' => 'ó', + 'ô' => 'ô', + 'õ' => 'õ', + 'ö' => 'ö', + 'ù' => 'ù', + 'ú' => 'ú', + 'û' => 'û', + 'ü' => 'ü', + 'ý' => 'ý', + 'ÿ' => 'ÿ', + 'Ā' => 'Ā', + 'ā' => 'ā', + 'Ă' => 'Ă', + 'ă' => 'ă', + 'Ą' => 'Ą', + 'ą' => 'ą', + 'Ć' => 'Ć', + 'ć' => 'ć', + 'Ĉ' => 'Ĉ', + 'ĉ' => 'ĉ', + 'Ċ' => 'Ċ', + 'ċ' => 'ċ', + 'Č' => 'Č', + 'č' => 'č', + 'Ď' => 'Ď', + 'ď' => 'ď', + 'Ē' => 'Ē', + 'ē' => 'ē', + 'Ĕ' => 'Ĕ', + 'ĕ' => 'ĕ', + 'Ė' => 'Ė', + 'ė' => 'ė', + 'Ę' => 'Ę', + 'ę' => 'ę', + 'Ě' => 'Ě', + 'ě' => 'ě', + 'Ĝ' => 'Ĝ', + 'ĝ' => 'ĝ', + 'Ğ' => 'Ğ', + 'ğ' => 'ğ', + 'Ġ' => 'Ġ', + 'ġ' => 'ġ', + 'Ģ' => 'Ģ', + 'ģ' => 'ģ', + 'Ĥ' => 'Ĥ', + 'ĥ' => 'ĥ', + 'Ĩ' => 'Ĩ', + 'ĩ' => 'ĩ', + 'Ī' => 'Ī', + 'ī' => 'ī', + 'Ĭ' => 'Ĭ', + 'ĭ' => 'ĭ', + 'Į' => 'Į', + 'į' => 'į', + 'İ' => 'İ', + 'Ĵ' => 'Ĵ', + 'ĵ' => 'ĵ', + 'Ķ' => 'Ķ', + 'ķ' => 'ķ', + 'Ĺ' => 'Ĺ', + 'ĺ' => 'ĺ', + 'Ļ' => 'Ļ', + 'ļ' => 'ļ', + 'Ľ' => 'Ľ', + 'ľ' => 'ľ', + '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ᬽ', + 'ᭀ' => 'ᭀ', + 'ᭁ' => 'ᭁ', + 'ᭃ' => 'ᭃ', + 'Ḁ' => 'Ḁ', + 'ḁ' => 'ḁ', + 'Ḃ' => 'Ḃ', + 'ḃ' => 'ḃ', + 'Ḅ' => 'Ḅ', + 'ḅ' => 'ḅ', + 'Ḇ' => 'Ḇ', + 'ḇ' => 'ḇ', + 'Ḉ' => 'Ḉ', + 'ḉ' => 'ḉ', + 'Ḋ' => 'Ḋ', + 'ḋ' => 'ḋ', + 'Ḍ' => 'Ḍ', + 'ḍ' => 'ḍ', + 'Ḏ' => 'Ḏ', + 'ḏ' => 'ḏ', + 'Ḑ' => 'Ḑ', + 'ḑ' => 'ḑ', + 'Ḓ' => 'Ḓ', + 'ḓ' => 'ḓ', + 'Ḕ' => 'Ḕ', + 'ḕ' => 'ḕ', + 'Ḗ' => 'Ḗ', + 'ḗ' => 'ḗ', + 'Ḙ' => 'Ḙ', + 'ḙ' => 'ḙ', + 'Ḛ' => 'Ḛ', + 'ḛ' => 'ḛ', + 'Ḝ' => 'Ḝ', + 'ḝ' => 'ḝ', + 'Ḟ' => 'Ḟ', + 'ḟ' => 'ḟ', + 'Ḡ' => 'Ḡ', + 'ḡ' => 'ḡ', + 'Ḣ' => 'Ḣ', + 'ḣ' => 'ḣ', + 'Ḥ' => 'Ḥ', + 'ḥ' => 'ḥ', + 'Ḧ' => 'Ḧ', + 'ḧ' => 'ḧ', + 'Ḩ' => 'Ḩ', + 'ḩ' => 'ḩ', + 'Ḫ' => 'Ḫ', + 'ḫ' => 'ḫ', + 'Ḭ' => 'Ḭ', + 'ḭ' => 'ḭ', + 'Ḯ' => 'Ḯ', + 'ḯ' => 'ḯ', + 'Ḱ' => 'Ḱ', + 'ḱ' => 'ḱ', + 'Ḳ' => 'Ḳ', + 'ḳ' => 'ḳ', + 'Ḵ' => 'Ḵ', + 'ḵ' => 'ḵ', + 'Ḷ' => 'Ḷ', + 'ḷ' => 'ḷ', + 'Ḹ' => 'Ḹ', + 'ḹ' => 'ḹ', + 'Ḻ' => 'Ḻ', + 'ḻ' => 'ḻ', + 'Ḽ' => 'Ḽ', + 'ḽ' => 'ḽ', + 'Ḿ' => 'Ḿ', + 'ḿ' => 'ḿ', + 'Ṁ' => 'Ṁ', + 'ṁ' => 'ṁ', + 'Ṃ' => 'Ṃ', + 'ṃ' => 'ṃ', + 'Ṅ' => 'Ṅ', + 'ṅ' => 'ṅ', + 'Ṇ' => 'Ṇ', + 'ṇ' => 'ṇ', + 'Ṉ' => 'Ṉ', + 'ṉ' => 'ṉ', + 'Ṋ' => 'Ṋ', + 'ṋ' => 'ṋ', + 'Ṍ' => 'Ṍ', + 'ṍ' => 'ṍ', + 'Ṏ' => 'Ṏ', + 'ṏ' => 'ṏ', + 'Ṑ' => 'Ṑ', + 'ṑ' => 'ṑ', + 'Ṓ' => 'Ṓ', + 'ṓ' => 'ṓ', + 'Ṕ' => 'Ṕ', + 'ṕ' => 'ṕ', + 'Ṗ' => 'Ṗ', + 'ṗ' => 'ṗ', + 'Ṙ' => 'Ṙ', + 'ṙ' => 'ṙ', + 'Ṛ' => 'Ṛ', + 'ṛ' => 'ṛ', + 'Ṝ' => 'Ṝ', + 'ṝ' => 'ṝ', + 'Ṟ' => 'Ṟ', + 'ṟ' => 'ṟ', + 'Ṡ' => 'Ṡ', + 'ṡ' => 'ṡ', + 'Ṣ' => 'Ṣ', + 'ṣ' => 'ṣ', + 'Ṥ' => 'Ṥ', + 'ṥ' => 'ṥ', + 'Ṧ' => 'Ṧ', + 'ṧ' => 'ṧ', + 'Ṩ' => 'Ṩ', + 'ṩ' => 'ṩ', + 'Ṫ' => 'Ṫ', + 'ṫ' => 'ṫ', + 'Ṭ' => 'Ṭ', + 'ṭ' => 'ṭ', + 'Ṯ' => 'Ṯ', + 'ṯ' => 'ṯ', + 'Ṱ' => 'Ṱ', + 'ṱ' => 'ṱ', + 'Ṳ' => 'Ṳ', + 'ṳ' => 'ṳ', + 'Ṵ' => 'Ṵ', + 'ṵ' => 'ṵ', + 'Ṷ' => 'Ṷ', + 'ṷ' => 'ṷ', + 'Ṹ' => 'Ṹ', + 'ṹ' => 'ṹ', + 'Ṻ' => 'Ṻ', + 'ṻ' => 'ṻ', + 'Ṽ' => 'Ṽ', + 'ṽ' => 'ṽ', + 'Ṿ' => 'Ṿ', + 'ṿ' => 'ṿ', + 'Ẁ' => 'Ẁ', + 'ẁ' => 'ẁ', + 'Ẃ' => 'Ẃ', + 'ẃ' => 'ẃ', + 'Ẅ' => 'Ẅ', + 'ẅ' => 'ẅ', + 'Ẇ' => 'Ẇ', + 'ẇ' => 'ẇ', + 'Ẉ' => 'Ẉ', + 'ẉ' => 'ẉ', + 'Ẋ' => 'Ẋ', + 'ẋ' => 'ẋ', + 'Ẍ' => 'Ẍ', + 'ẍ' => 'ẍ', + 'Ẏ' => 'Ẏ', + 'ẏ' => 'ẏ', + 'Ẑ' => 'Ẑ', + 'ẑ' => 'ẑ', + 'Ẓ' => 'Ẓ', + 'ẓ' => 'ẓ', + 'Ẕ' => 'Ẕ', + 'ẕ' => 'ẕ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẛ' => 'ẛ', + 'Ạ' => 'Ạ', + 'ạ' => 'ạ', + 'Ả' => 'Ả', + 'ả' => 'ả', + 'Ấ' => 'Ấ', + 'ấ' => 'ấ', + 'Ầ' => 'Ầ', + 'ầ' => 'ầ', + 'Ẩ' => 'Ẩ', + 'ẩ' => 'ẩ', + 'Ẫ' => 'Ẫ', + 'ẫ' => 'ẫ', + 'Ậ' => 'Ậ', + 'ậ' => 'ậ', + 'Ắ' => 'Ắ', + 'ắ' => 'ắ', + 'Ằ' => 'Ằ', + 'ằ' => 'ằ', + 'Ẳ' => 'Ẳ', + 'ẳ' => 'ẳ', + 'Ẵ' => 'Ẵ', + 'ẵ' => 'ẵ', + 'Ặ' => 'Ặ', + 'ặ' => 'ặ', + 'Ẹ' => 'Ẹ', + 'ẹ' => 'ẹ', + 'Ẻ' => 'Ẻ', + 'ẻ' => 'ẻ', + 'Ẽ' => 'Ẽ', + 'ẽ' => 'ẽ', + 'Ế' => 'Ế', + 'ế' => 'ế', + 'Ề' => 'Ề', + 'ề' => 'ề', + 'Ể' => 'Ể', + 'ể' => 'ể', + 'Ễ' => 'Ễ', + 'ễ' => 'ễ', + 'Ệ' => 'Ệ', + 'ệ' => 'ệ', + 'Ỉ' => 'Ỉ', + 'ỉ' => 'ỉ', + 'Ị' => 'Ị', + 'ị' => 'ị', + 'Ọ' => 'Ọ', + 'ọ' => 'ọ', + 'Ỏ' => 'Ỏ', + 'ỏ' => 'ỏ', + 'Ố' => 'Ố', + 'ố' => 'ố', + 'Ồ' => 'Ồ', + 'ồ' => 'ồ', + 'Ổ' => 'Ổ', + 'ổ' => 'ổ', + 'Ỗ' => 'Ỗ', + 'ỗ' => 'ỗ', + 'Ộ' => 'Ộ', + 'ộ' => 'ộ', + 'Ớ' => 'Ớ', + 'ớ' => 'ớ', + 'Ờ' => 'Ờ', + 'ờ' => 'ờ', + 'Ở' => 'Ở', + 'ở' => 'ở', + 'Ỡ' => 'Ỡ', + 'ỡ' => 'ỡ', + 'Ợ' => 'Ợ', + 'ợ' => 'ợ', + 'Ụ' => 'Ụ', + 'ụ' => 'ụ', + 'Ủ' => 'Ủ', + 'ủ' => 'ủ', + 'Ứ' => 'Ứ', + 'ứ' => 'ứ', + 'Ừ' => 'Ừ', + 'ừ' => 'ừ', + 'Ử' => 'Ử', + 'ử' => 'ử', + 'Ữ' => 'Ữ', + 'ữ' => 'ữ', + 'Ự' => 'Ự', + 'ự' => 'ự', + 'Ỳ' => 'Ỳ', + 'ỳ' => 'ỳ', + 'Ỵ' => 'Ỵ', + 'ỵ' => 'ỵ', + 'Ỷ' => 'Ỷ', + 'ỷ' => 'ỷ', + 'Ỹ' => 'Ỹ', + 'ỹ' => 'ỹ', + 'ἀ' => 'ἀ', + 'ἁ' => 'ἁ', + 'ἂ' => 'ἂ', + 'ἃ' => 'ἃ', + 'ἄ' => 'ἄ', + 'ἅ' => 'ἅ', + 'ἆ' => 'ἆ', + 'ἇ' => 'ἇ', + 'Ἀ' => 'Ἀ', + 'Ἁ' => 'Ἁ', + 'Ἂ' => 'Ἂ', + 'Ἃ' => 'Ἃ', + 'Ἄ' => 'Ἄ', + 'Ἅ' => 'Ἅ', + 'Ἆ' => 'Ἆ', + 'Ἇ' => 'Ἇ', + 'ἐ' => 'ἐ', + 'ἑ' => 'ἑ', + 'ἒ' => 'ἒ', + 'ἓ' => 'ἓ', + 'ἔ' => 'ἔ', + 'ἕ' => 'ἕ', + 'Ἐ' => 'Ἐ', + 'Ἑ' => 'Ἑ', + 'Ἒ' => 'Ἒ', + 'Ἓ' => 'Ἓ', + 'Ἔ' => 'Ἔ', + 'Ἕ' => 'Ἕ', + 'ἠ' => 'ἠ', + 'ἡ' => 'ἡ', + 'ἢ' => 'ἢ', + 'ἣ' => 'ἣ', + 'ἤ' => 'ἤ', + 'ἥ' => 'ἥ', + 'ἦ' => 'ἦ', + 'ἧ' => 'ἧ', + 'Ἠ' => 'Ἠ', + 'Ἡ' => 'Ἡ', + 'Ἢ' => 'Ἢ', + 'Ἣ' => 'Ἣ', + 'Ἤ' => 'Ἤ', + 'Ἥ' => 'Ἥ', + 'Ἦ' => 'Ἦ', + 'Ἧ' => 'Ἧ', + 'ἰ' => 'ἰ', + 'ἱ' => 'ἱ', + 'ἲ' => 'ἲ', + 'ἳ' => 'ἳ', + 'ἴ' => 'ἴ', + 'ἵ' => 'ἵ', + 'ἶ' => 'ἶ', + 'ἷ' => 'ἷ', + 'Ἰ' => 'Ἰ', + 'Ἱ' => 'Ἱ', + 'Ἲ' => 'Ἲ', + 'Ἳ' => 'Ἳ', + 'Ἴ' => 'Ἴ', + 'Ἵ' => 'Ἵ', + 'Ἶ' => 'Ἶ', + 'Ἷ' => 'Ἷ', + 'ὀ' => 'ὀ', + 'ὁ' => 'ὁ', + 'ὂ' => 'ὂ', + 'ὃ' => 'ὃ', + 'ὄ' => 'ὄ', + 'ὅ' => 'ὅ', + 'Ὀ' => 'Ὀ', + 'Ὁ' => 'Ὁ', + 'Ὂ' => 'Ὂ', + 'Ὃ' => 'Ὃ', + 'Ὄ' => 'Ὄ', + 'Ὅ' => 'Ὅ', + 'ὐ' => 'ὐ', + 'ὑ' => 'ὑ', + 'ὒ' => 'ὒ', + 'ὓ' => 'ὓ', + 'ὔ' => 'ὔ', + 'ὕ' => 'ὕ', + 'ὖ' => 'ὖ', + 'ὗ' => 'ὗ', + 'Ὑ' => 'Ὑ', + 'Ὓ' => 'Ὓ', + 'Ὕ' => 'Ὕ', + 'Ὗ' => 'Ὗ', + 'ὠ' => 'ὠ', + 'ὡ' => 'ὡ', + 'ὢ' => 'ὢ', + 'ὣ' => 'ὣ', + 'ὤ' => 'ὤ', + 'ὥ' => 'ὥ', + 'ὦ' => 'ὦ', + 'ὧ' => 'ὧ', + 'Ὠ' => 'Ὠ', + 'Ὡ' => 'Ὡ', + 'Ὢ' => 'Ὢ', + 'Ὣ' => 'Ὣ', + 'Ὤ' => 'Ὤ', + 'Ὥ' => 'Ὥ', + 'Ὦ' => 'Ὦ', + 'Ὧ' => 'Ὧ', + 'ὰ' => 'ὰ', + 'ὲ' => 'ὲ', + 'ὴ' => 'ὴ', + 'ὶ' => 'ὶ', + 'ὸ' => 'ὸ', + 'ὺ' => 'ὺ', + 'ὼ' => 'ὼ', + 'ᾀ' => 'ᾀ', + 'ᾁ' => 'ᾁ', + 'ᾂ' => 'ᾂ', + 'ᾃ' => 'ᾃ', + 'ᾄ' => 'ᾄ', + 'ᾅ' => 'ᾅ', + 'ᾆ' => 'ᾆ', + 'ᾇ' => 'ᾇ', + 'ᾈ' => 'ᾈ', + 'ᾉ' => 'ᾉ', + 'ᾊ' => 'ᾊ', + 'ᾋ' => 'ᾋ', + 'ᾌ' => 'ᾌ', + 'ᾍ' => 'ᾍ', + 'ᾎ' => 'ᾎ', + 'ᾏ' => 'ᾏ', + 'ᾐ' => 'ᾐ', + 'ᾑ' => 'ᾑ', + 'ᾒ' => 'ᾒ', + 'ᾓ' => 'ᾓ', + 'ᾔ' => 'ᾔ', + 'ᾕ' => 'ᾕ', + 'ᾖ' => 'ᾖ', + 'ᾗ' => 'ᾗ', + 'ᾘ' => 'ᾘ', + 'ᾙ' => 'ᾙ', + 'ᾚ' => 'ᾚ', + 'ᾛ' => 'ᾛ', + 'ᾜ' => 'ᾜ', + 'ᾝ' => 'ᾝ', + 'ᾞ' => 'ᾞ', + 'ᾟ' => 'ᾟ', + 'ᾠ' => 'ᾠ', + 'ᾡ' => 'ᾡ', + 'ᾢ' => 'ᾢ', + 'ᾣ' => 'ᾣ', + 'ᾤ' => 'ᾤ', + 'ᾥ' => 'ᾥ', + 'ᾦ' => 'ᾦ', + 'ᾧ' => 'ᾧ', + 'ᾨ' => 'ᾨ', + 'ᾩ' => 'ᾩ', + 'ᾪ' => 'ᾪ', + 'ᾫ' => 'ᾫ', + 'ᾬ' => 'ᾬ', + 'ᾭ' => 'ᾭ', + 'ᾮ' => 'ᾮ', + 'ᾯ' => 'ᾯ', + 'ᾰ' => 'ᾰ', + 'ᾱ' => 'ᾱ', + 'ᾲ' => 'ᾲ', + 'ᾳ' => 'ᾳ', + 'ᾴ' => 'ᾴ', + 'ᾶ' => 'ᾶ', + 'ᾷ' => 'ᾷ', + 'Ᾰ' => 'Ᾰ', + 'Ᾱ' => 'Ᾱ', + 'Ὰ' => 'Ὰ', + 'ᾼ' => 'ᾼ', + '῁' => '῁', + 'ῂ' => 'ῂ', + 'ῃ' => 'ῃ', + 'ῄ' => 'ῄ', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῇ', + 'Ὲ' => 'Ὲ', + 'Ὴ' => 'Ὴ', + 'ῌ' => 'ῌ', + '῍' => '῍', + '῎' => '῎', + '῏' => '῏', + 'ῐ' => 'ῐ', + 'ῑ' => 'ῑ', + 'ῒ' => 'ῒ', + 'ῖ' => 'ῖ', + 'ῗ' => 'ῗ', + 'Ῐ' => 'Ῐ', + 'Ῑ' => 'Ῑ', + 'Ὶ' => 'Ὶ', + '῝' => '῝', + '῞' => '῞', + '῟' => '῟', + 'ῠ' => 'ῠ', + 'ῡ' => 'ῡ', + 'ῢ' => 'ῢ', + 'ῤ' => 'ῤ', + 'ῥ' => 'ῥ', + 'ῦ' => 'ῦ', + 'ῧ' => 'ῧ', + 'Ῠ' => 'Ῠ', + 'Ῡ' => 'Ῡ', + 'Ὺ' => 'Ὺ', + 'Ῥ' => 'Ῥ', + '῭' => '῭', + 'ῲ' => 'ῲ', + 'ῳ' => 'ῳ', + 'ῴ' => 'ῴ', + 'ῶ' => 'ῶ', + 'ῷ' => 'ῷ', + 'Ὸ' => 'Ὸ', + 'Ὼ' => 'Ὼ', + 'ῼ' => 'ῼ', + '↚' => '↚', + '↛' => '↛', + '↮' => '↮', + '⇍' => '⇍', + '⇎' => '⇎', + '⇏' => '⇏', + '∄' => '∄', + '∉' => '∉', + '∌' => '∌', + '∤' => '∤', + '∦' => '∦', + '≁' => '≁', + '≄' => '≄', + '≇' => '≇', + '≉' => '≉', + '≠' => '≠', + '≢' => '≢', + '≭' => '≭', + '≮' => '≮', + '≯' => '≯', + '≰' => '≰', + '≱' => '≱', + '≴' => '≴', + '≵' => '≵', + '≸' => '≸', + '≹' => '≹', + '⊀' => '⊀', + '⊁' => '⊁', + '⊄' => '⊄', + '⊅' => '⊅', + '⊈' => '⊈', + '⊉' => '⊉', + '⊬' => '⊬', + '⊭' => '⊭', + '⊮' => '⊮', + '⊯' => '⊯', + '⋠' => '⋠', + '⋡' => '⋡', + '⋢' => '⋢', + '⋣' => '⋣', + '⋪' => '⋪', + '⋫' => '⋫', + '⋬' => '⋬', + '⋭' => '⋭', + 'が' => 'が', + 'ぎ' => 'ぎ', + 'ぐ' => 'ぐ', + 'げ' => 'げ', + 'ご' => 'ご', + 'ざ' => 'ざ', + 'じ' => 'じ', + 'ず' => 'ず', + 'ぜ' => 'ぜ', + 'ぞ' => 'ぞ', + 'だ' => 'だ', + 'ぢ' => 'ぢ', + 'づ' => 'づ', + 'で' => 'で', + 'ど' => 'ど', + 'ば' => 'ば', + 'ぱ' => 'ぱ', + 'び' => 'び', + 'ぴ' => 'ぴ', + 'ぶ' => 'ぶ', + 'ぷ' => 'ぷ', + 'べ' => 'べ', + 'ぺ' => 'ぺ', + 'ぼ' => 'ぼ', + 'ぽ' => 'ぽ', + 'ゔ' => 'ゔ', + 'ゞ' => 'ゞ', + 'ガ' => 'ガ', + 'ギ' => 'ギ', + 'グ' => 'グ', + 'ゲ' => 'ゲ', + 'ゴ' => 'ゴ', + 'ザ' => 'ザ', + 'ジ' => 'ジ', + 'ズ' => 'ズ', + 'ゼ' => 'ゼ', + 'ゾ' => 'ゾ', + 'ダ' => 'ダ', + 'ヂ' => 'ヂ', + 'ヅ' => 'ヅ', + 'デ' => 'デ', + 'ド' => 'ド', + 'バ' => 'バ', + 'パ' => 'パ', + 'ビ' => 'ビ', + 'ピ' => 'ピ', + 'ブ' => 'ブ', + 'プ' => 'プ', + 'ベ' => 'ベ', + 'ペ' => 'ペ', + 'ボ' => 'ボ', + 'ポ' => 'ポ', + 'ヴ' => 'ヴ', + 'ヷ' => 'ヷ', + 'ヸ' => 'ヸ', + 'ヹ' => 'ヹ', + 'ヺ' => 'ヺ', + 'ヾ' => 'ヾ', + '𑂚' => '𑂚', + '𑂜' => '𑂜', + '𑂫' => '𑂫', + '𑄮' => '𑄮', + '𑄯' => '𑄯', + '𑍋' => '𑍋', + '𑍌' => '𑍌', + '𑒻' => '𑒻', + '𑒼' => '𑒼', + '𑒾' => '𑒾', + '𑖺' => '𑖺', + '𑖻' => '𑖻', + '𑤸' => '𑤸', +); diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php new file mode 100644 index 00000000..5a3e8e09 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php @@ -0,0 +1,2065 @@ + 'À', + 'Á' => 'Á', + 'Â' => 'Â', + 'Ã' => 'Ã', + 'Ä' => 'Ä', + 'Å' => 'Å', + 'Ç' => 'Ç', + 'È' => 'È', + 'É' => 'É', + 'Ê' => 'Ê', + 'Ë' => 'Ë', + 'Ì' => 'Ì', + 'Í' => 'Í', + 'Î' => 'Î', + 'Ï' => 'Ï', + 'Ñ' => 'Ñ', + 'Ò' => 'Ò', + 'Ó' => 'Ó', + 'Ô' => 'Ô', + 'Õ' => 'Õ', + 'Ö' => 'Ö', + 'Ù' => 'Ù', + 'Ú' => 'Ú', + 'Û' => 'Û', + 'Ü' => 'Ü', + 'Ý' => 'Ý', + 'à' => 'à', + 'á' => 'á', + 'â' => 'â', + 'ã' => 'ã', + 'ä' => 'ä', + 'å' => 'å', + 'ç' => 'ç', + 'è' => 'è', + 'é' => 'é', + 'ê' => 'ê', + 'ë' => 'ë', + 'ì' => 'ì', + 'í' => 'í', + 'î' => 'î', + 'ï' => 'ï', + 'ñ' => 'ñ', + 'ò' => 'ò', + 'ó' => 'ó', + 'ô' => 'ô', + 'õ' => 'õ', + 'ö' => 'ö', + 'ù' => 'ù', + 'ú' => 'ú', + 'û' => 'û', + 'ü' => 'ü', + 'ý' => 'ý', + 'ÿ' => 'ÿ', + 'Ā' => 'Ā', + 'ā' => 'ā', + 'Ă' => 'Ă', + 'ă' => 'ă', + 'Ą' => 'Ą', + 'ą' => 'ą', + 'Ć' => 'Ć', + 'ć' => 'ć', + 'Ĉ' => 'Ĉ', + 'ĉ' => 'ĉ', + 'Ċ' => 'Ċ', + 'ċ' => 'ċ', + 'Č' => 'Č', + 'č' => 'č', + 'Ď' => 'Ď', + 'ď' => 'ď', + 'Ē' => 'Ē', + 'ē' => 'ē', + 'Ĕ' => 'Ĕ', + 'ĕ' => 'ĕ', + 'Ė' => 'Ė', + 'ė' => 'ė', + 'Ę' => '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ۂ' => 'ۂ', + 'ۓ' => 'ۓ', + 'ऩ' => 'ऩ', + 'ऱ' => 'ऱ', + 'ऴ' => 'ऴ', + 'क़' => 'क़', + 'ख़' => 'ख़', + 'ग़' => 'ग़', + 'ज़' => 'ज़', + 'ड़' => 'ड़', + 'ढ़' => 'ढ़', + 'फ़' => 'फ़', + 'य़' => 'य़', + 'ো' => 'ো', + 'ৌ' => 'ৌ', + 'ড়' => 'ড়', + 'ঢ়' => 'ঢ়', + 'য়' => 'য়', + 'ਲ਼' => 'ਲ਼', + 'ਸ਼' => 'ਸ਼', + 'ਖ਼' => 'ਖ਼', + 'ਗ਼' => 'ਗ਼', + 'ਜ਼' => 'ਜ਼', + 'ਫ਼' => 'ਫ਼', + 'ୈ' => 'ୈ', + 'ୋ' => 'ୋ', + 'ୌ' => 'ୌ', + 'ଡ଼' => 'ଡ଼', + 'ଢ଼' => 'ଢ଼', + 'ஔ' => 'ஔ', + 'ொ' => 'ொ', + 'ோ' => 'ோ', + 'ௌ' => 'ௌ', + 'ై' => 'ై', + 'ೀ' => 'ೀ', + 'ೇ' => 'ೇ', + 'ೈ' => 'ೈ', + 'ೊ' => 'ೊ', + 'ೋ' => 'ೋ', + 'ൊ' => 'ൊ', + 'ോ' => 'ോ', + 'ൌ' => 'ൌ', + 'ේ' => 'ේ', + 'ො' => 'ො', + 'ෝ' => 'ෝ', + 'ෞ' => 'ෞ', + 'གྷ' => 'གྷ', + 'ཌྷ' => 'ཌྷ', + 'དྷ' => 'དྷ', + 'བྷ' => 'བྷ', + 'ཛྷ' => 'ཛྷ', + 'ཀྵ' => 'ཀྵ', + 'ཱི' => 'ཱི', + 'ཱུ' => 'ཱུ', + 'ྲྀ' => 'ྲྀ', + 'ླྀ' => 'ླྀ', + 'ཱྀ' => 'ཱྀ', + 'ྒྷ' => 'ྒྷ', + 'ྜྷ' => 'ྜྷ', + 'ྡྷ' => 'ྡྷ', + 'ྦྷ' => 'ྦྷ', + 'ྫྷ' => 'ྫྷ', + 'ྐྵ' => 'ྐྵ', + 'ဦ' => 'ဦ', + 'ᬆ' => 'ᬆ', + 'ᬈ' => 'ᬈ', + 'ᬊ' => 'ᬊ', + 'ᬌ' => 'ᬌ', + 'ᬎ' => 'ᬎ', + 'ᬒ' => 'ᬒ', + 'ᬻ' => 'ᬻ', + 'ᬽ' => 'ᬽ', + 'ᭀ' => 'ᭀ', + 'ᭁ' => 'ᭁ', + 'ᭃ' => 'ᭃ', + 'Ḁ' => 'Ḁ', + 'ḁ' => 'ḁ', + 'Ḃ' => 'Ḃ', + 'ḃ' => 'ḃ', + 'Ḅ' => 'Ḅ', + 'ḅ' => 'ḅ', + 'Ḇ' => 'Ḇ', + 'ḇ' => 'ḇ', + 'Ḉ' => 'Ḉ', + 'ḉ' => 'ḉ', + 'Ḋ' => 'Ḋ', + 'ḋ' => 'ḋ', + 'Ḍ' => 'Ḍ', + 'ḍ' => 'ḍ', + 'Ḏ' => 'Ḏ', + 'ḏ' => 'ḏ', + 'Ḑ' => 'Ḑ', + 'ḑ' => 'ḑ', + 'Ḓ' => 'Ḓ', + 'ḓ' => 'ḓ', + 'Ḕ' => 'Ḕ', + 'ḕ' => 'ḕ', + 'Ḗ' => 'Ḗ', + 'ḗ' => 'ḗ', + 'Ḙ' => 'Ḙ', + 'ḙ' => 'ḙ', + 'Ḛ' => 'Ḛ', + 'ḛ' => 'ḛ', + 'Ḝ' => 'Ḝ', + 'ḝ' => 'ḝ', + 'Ḟ' => 'Ḟ', + 'ḟ' => 'ḟ', + 'Ḡ' => 'Ḡ', + 'ḡ' => 'ḡ', + 'Ḣ' => 'Ḣ', + 'ḣ' => 'ḣ', + 'Ḥ' => 'Ḥ', + 'ḥ' => 'ḥ', + 'Ḧ' => 'Ḧ', + 'ḧ' => 'ḧ', + 'Ḩ' => 'Ḩ', + 'ḩ' => 'ḩ', + 'Ḫ' => 'Ḫ', + 'ḫ' => 'ḫ', + 'Ḭ' => 'Ḭ', + 'ḭ' => 'ḭ', + 'Ḯ' => 'Ḯ', + 'ḯ' => 'ḯ', + 'Ḱ' => 'Ḱ', + 'ḱ' => 'ḱ', + 'Ḳ' => 'Ḳ', + 'ḳ' => 'ḳ', + 'Ḵ' => 'Ḵ', + 'ḵ' => 'ḵ', + 'Ḷ' => 'Ḷ', + 'ḷ' => 'ḷ', + 'Ḹ' => 'Ḹ', + 'ḹ' => 'ḹ', + 'Ḻ' => 'Ḻ', + 'ḻ' => 'ḻ', + 'Ḽ' => 'Ḽ', + 'ḽ' => 'ḽ', + 'Ḿ' => 'Ḿ', + 'ḿ' => 'ḿ', + 'Ṁ' => 'Ṁ', + 'ṁ' => 'ṁ', + 'Ṃ' => 'Ṃ', + 'ṃ' => 'ṃ', + 'Ṅ' => 'Ṅ', + 'ṅ' => 'ṅ', + 'Ṇ' => 'Ṇ', + 'ṇ' => 'ṇ', + 'Ṉ' => 'Ṉ', + 'ṉ' => 'ṉ', + 'Ṋ' => 'Ṋ', + 'ṋ' => 'ṋ', + 'Ṍ' => 'Ṍ', + 'ṍ' => 'ṍ', + 'Ṏ' => 'Ṏ', + 'ṏ' => 'ṏ', + 'Ṑ' => 'Ṑ', + 'ṑ' => 'ṑ', + 'Ṓ' => 'Ṓ', + 'ṓ' => 'ṓ', + 'Ṕ' => 'Ṕ', + 'ṕ' => 'ṕ', + 'Ṗ' => 'Ṗ', + 'ṗ' => 'ṗ', + 'Ṙ' => 'Ṙ', + 'ṙ' => 'ṙ', + 'Ṛ' => 'Ṛ', + 'ṛ' => 'ṛ', + 'Ṝ' => 'Ṝ', + 'ṝ' => 'ṝ', + 'Ṟ' => 'Ṟ', + 'ṟ' => 'ṟ', + 'Ṡ' => 'Ṡ', + 'ṡ' => 'ṡ', + 'Ṣ' => 'Ṣ', + 'ṣ' => 'ṣ', + 'Ṥ' => 'Ṥ', + 'ṥ' => 'ṥ', + 'Ṧ' => 'Ṧ', + 'ṧ' => 'ṧ', + 'Ṩ' => 'Ṩ', + 'ṩ' => 'ṩ', + 'Ṫ' => 'Ṫ', + 'ṫ' => 'ṫ', + 'Ṭ' => 'Ṭ', + 'ṭ' => 'ṭ', + 'Ṯ' => 'Ṯ', + 'ṯ' => 'ṯ', + 'Ṱ' => 'Ṱ', + 'ṱ' => 'ṱ', + 'Ṳ' => 'Ṳ', + 'ṳ' => 'ṳ', + 'Ṵ' => 'Ṵ', + 'ṵ' => 'ṵ', + 'Ṷ' => 'Ṷ', + 'ṷ' => 'ṷ', + 'Ṹ' => 'Ṹ', + 'ṹ' => 'ṹ', + 'Ṻ' => 'Ṻ', + 'ṻ' => 'ṻ', + 'Ṽ' => 'Ṽ', + 'ṽ' => 'ṽ', + 'Ṿ' => 'Ṿ', + 'ṿ' => 'ṿ', + 'Ẁ' => 'Ẁ', + 'ẁ' => 'ẁ', + 'Ẃ' => 'Ẃ', + 'ẃ' => 'ẃ', + 'Ẅ' => 'Ẅ', + 'ẅ' => 'ẅ', + 'Ẇ' => 'Ẇ', + 'ẇ' => 'ẇ', + 'Ẉ' => 'Ẉ', + 'ẉ' => 'ẉ', + 'Ẋ' => 'Ẋ', + 'ẋ' => 'ẋ', + 'Ẍ' => 'Ẍ', + 'ẍ' => 'ẍ', + 'Ẏ' => 'Ẏ', + 'ẏ' => 'ẏ', + 'Ẑ' => 'Ẑ', + 'ẑ' => 'ẑ', + 'Ẓ' => 'Ẓ', + 'ẓ' => 'ẓ', + 'Ẕ' => 'Ẕ', + 'ẕ' => 'ẕ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẛ' => 'ẛ', + 'Ạ' => 'Ạ', + 'ạ' => 'ạ', + 'Ả' => 'Ả', + 'ả' => 'ả', + 'Ấ' => 'Ấ', + 'ấ' => 'ấ', + 'Ầ' => 'Ầ', + 'ầ' => 'ầ', + 'Ẩ' => 'Ẩ', + 'ẩ' => 'ẩ', + 'Ẫ' => 'Ẫ', + 'ẫ' => 'ẫ', + 'Ậ' => 'Ậ', + 'ậ' => 'ậ', + 'Ắ' => 'Ắ', + 'ắ' => 'ắ', + 'Ằ' => 'Ằ', + 'ằ' => 'ằ', + 'Ẳ' => 'Ẳ', + 'ẳ' => 'ẳ', + 'Ẵ' => 'Ẵ', + 'ẵ' => 'ẵ', + 'Ặ' => 'Ặ', + 'ặ' => 'ặ', + 'Ẹ' => 'Ẹ', + 'ẹ' => 'ẹ', + 'Ẻ' => 'Ẻ', + 'ẻ' => 'ẻ', + 'Ẽ' => 'Ẽ', + 'ẽ' => 'ẽ', + 'Ế' => 'Ế', + 'ế' => 'ế', + 'Ề' => 'Ề', + 'ề' => 'ề', + 'Ể' => 'Ể', + 'ể' => 'ể', + 'Ễ' => 'Ễ', + 'ễ' => 'ễ', + 'Ệ' => 'Ệ', + 'ệ' => 'ệ', + 'Ỉ' => 'Ỉ', + 'ỉ' => 'ỉ', + 'Ị' => 'Ị', + 'ị' => 'ị', + 'Ọ' => 'Ọ', + 'ọ' => 'ọ', + 'Ỏ' => 'Ỏ', + 'ỏ' => 'ỏ', + 'Ố' => 'Ố', + 'ố' => 'ố', + 'Ồ' => 'Ồ', + 'ồ' => 'ồ', + 'Ổ' => 'Ổ', + 'ổ' => 'ổ', + 'Ỗ' => 'Ỗ', + 'ỗ' => 'ỗ', + 'Ộ' => 'Ộ', + 'ộ' => 'ộ', + 'Ớ' => 'Ớ', + 'ớ' => 'ớ', + 'Ờ' => 'Ờ', + 'ờ' => 'ờ', + 'Ở' => 'Ở', + 'ở' => 'ở', + 'Ỡ' => 'Ỡ', + 'ỡ' => 'ỡ', + 'Ợ' => 'Ợ', + 'ợ' => 'ợ', + 'Ụ' => 'Ụ', + 'ụ' => 'ụ', + 'Ủ' => 'Ủ', + 'ủ' => 'ủ', + 'Ứ' => 'Ứ', + 'ứ' => 'ứ', + 'Ừ' => 'Ừ', + 'ừ' => 'ừ', + 'Ử' => 'Ử', + 'ử' => 'ử', + 'Ữ' => 'Ữ', + 'ữ' => 'ữ', + 'Ự' => 'Ự', + 'ự' => 'ự', + 'Ỳ' => 'Ỳ', + 'ỳ' => 'ỳ', + 'Ỵ' => 'Ỵ', + 'ỵ' => 'ỵ', + 'Ỷ' => 'Ỷ', + 'ỷ' => 'ỷ', + 'Ỹ' => 'Ỹ', + 'ỹ' => 'ỹ', + 'ἀ' => 'ἀ', + 'ἁ' => 'ἁ', + 'ἂ' => 'ἂ', + 'ἃ' => 'ἃ', + 'ἄ' => 'ἄ', + 'ἅ' => 'ἅ', + 'ἆ' => 'ἆ', + 'ἇ' => 'ἇ', + 'Ἀ' => 'Ἀ', + 'Ἁ' => 'Ἁ', + 'Ἂ' => 'Ἂ', + 'Ἃ' => 'Ἃ', + 'Ἄ' => 'Ἄ', + 'Ἅ' => 'Ἅ', + 'Ἆ' => 'Ἆ', + 'Ἇ' => 'Ἇ', + 'ἐ' => 'ἐ', + 'ἑ' => 'ἑ', + 'ἒ' => 'ἒ', + 'ἓ' => 'ἓ', + 'ἔ' => 'ἔ', + 'ἕ' => 'ἕ', + 'Ἐ' => 'Ἐ', + 'Ἑ' => 'Ἑ', + 'Ἒ' => 'Ἒ', + 'Ἓ' => 'Ἓ', + 'Ἔ' => 'Ἔ', + 'Ἕ' => 'Ἕ', + 'ἠ' => 'ἠ', + 'ἡ' => 'ἡ', + 'ἢ' => 'ἢ', + 'ἣ' => 'ἣ', + 'ἤ' => 'ἤ', + 'ἥ' => 'ἥ', + 'ἦ' => 'ἦ', + 'ἧ' => 'ἧ', + 'Ἠ' => 'Ἠ', + 'Ἡ' => 'Ἡ', + 'Ἢ' => 'Ἢ', + 'Ἣ' => 'Ἣ', + 'Ἤ' => 'Ἤ', + 'Ἥ' => 'Ἥ', + 'Ἦ' => 'Ἦ', + 'Ἧ' => 'Ἧ', + 'ἰ' => 'ἰ', + 'ἱ' => 'ἱ', + 'ἲ' => 'ἲ', + 'ἳ' => 'ἳ', + 'ἴ' => 'ἴ', + 'ἵ' => 'ἵ', + 'ἶ' => 'ἶ', + 'ἷ' => 'ἷ', + 'Ἰ' => 'Ἰ', + 'Ἱ' => 'Ἱ', + 'Ἲ' => 'Ἲ', + 'Ἳ' => 'Ἳ', + 'Ἴ' => 'Ἴ', + 'Ἵ' => 'Ἵ', + 'Ἶ' => 'Ἶ', + 'Ἷ' => 'Ἷ', + 'ὀ' => 'ὀ', + 'ὁ' => 'ὁ', + 'ὂ' => 'ὂ', + 'ὃ' => 'ὃ', + 'ὄ' => 'ὄ', + 'ὅ' => 'ὅ', + 'Ὀ' => 'Ὀ', + 'Ὁ' => 'Ὁ', + 'Ὂ' => 'Ὂ', + 'Ὃ' => 'Ὃ', + 'Ὄ' => 'Ὄ', + 'Ὅ' => 'Ὅ', + 'ὐ' => 'ὐ', + 'ὑ' => 'ὑ', + 'ὒ' => 'ὒ', + 'ὓ' => 'ὓ', + 'ὔ' => 'ὔ', + 'ὕ' => 'ὕ', + 'ὖ' => 'ὖ', + 'ὗ' => 'ὗ', + 'Ὑ' => 'Ὑ', + 'Ὓ' => 'Ὓ', + 'Ὕ' => 'Ὕ', + 'Ὗ' => 'Ὗ', + 'ὠ' => 'ὠ', + 'ὡ' => 'ὡ', + 'ὢ' => 'ὢ', + 'ὣ' => 'ὣ', + 'ὤ' => 'ὤ', + 'ὥ' => 'ὥ', + 'ὦ' => 'ὦ', + 'ὧ' => 'ὧ', + 'Ὠ' => 'Ὠ', + 'Ὡ' => 'Ὡ', + 'Ὢ' => 'Ὢ', + 'Ὣ' => 'Ὣ', + 'Ὤ' => 'Ὤ', + 'Ὥ' => 'Ὥ', + 'Ὦ' => 'Ὦ', + 'Ὧ' => 'Ὧ', + 'ὰ' => 'ὰ', + 'ά' => 'ά', + 'ὲ' => 'ὲ', + 'έ' => 'έ', + 'ὴ' => 'ὴ', + 'ή' => 'ή', + 'ὶ' => 'ὶ', + 'ί' => 'ί', + 'ὸ' => 'ὸ', + 'ό' => 'ό', + 'ὺ' => 'ὺ', + 'ύ' => 'ύ', + 'ὼ' => 'ὼ', + 'ώ' => 'ώ', + 'ᾀ' => 'ᾀ', + 'ᾁ' => 'ᾁ', + 'ᾂ' => 'ᾂ', + 'ᾃ' => 'ᾃ', + 'ᾄ' => 'ᾄ', + 'ᾅ' => 'ᾅ', + 'ᾆ' => 'ᾆ', + 'ᾇ' => 'ᾇ', + 'ᾈ' => 'ᾈ', + 'ᾉ' => 'ᾉ', + 'ᾊ' => 'ᾊ', + 'ᾋ' => 'ᾋ', + 'ᾌ' => 'ᾌ', + 'ᾍ' => 'ᾍ', + 'ᾎ' => 'ᾎ', + 'ᾏ' => 'ᾏ', + 'ᾐ' => 'ᾐ', + 'ᾑ' => 'ᾑ', + 'ᾒ' => 'ᾒ', + 'ᾓ' => 'ᾓ', + 'ᾔ' => 'ᾔ', + 'ᾕ' => 'ᾕ', + 'ᾖ' => 'ᾖ', + 'ᾗ' => 'ᾗ', + 'ᾘ' => 'ᾘ', + 'ᾙ' => 'ᾙ', + 'ᾚ' => 'ᾚ', + 'ᾛ' => 'ᾛ', + 'ᾜ' => 'ᾜ', + 'ᾝ' => 'ᾝ', + 'ᾞ' => 'ᾞ', + 'ᾟ' => 'ᾟ', + 'ᾠ' => 'ᾠ', + 'ᾡ' => 'ᾡ', + 'ᾢ' => 'ᾢ', + 'ᾣ' => 'ᾣ', + 'ᾤ' => 'ᾤ', + 'ᾥ' => 'ᾥ', + 'ᾦ' => 'ᾦ', + 'ᾧ' => 'ᾧ', + 'ᾨ' => 'ᾨ', + 'ᾩ' => 'ᾩ', + 'ᾪ' => 'ᾪ', + 'ᾫ' => 'ᾫ', + 'ᾬ' => 'ᾬ', + 'ᾭ' => 'ᾭ', + 'ᾮ' => 'ᾮ', + 'ᾯ' => 'ᾯ', + 'ᾰ' => 'ᾰ', + 'ᾱ' => 'ᾱ', + 'ᾲ' => 'ᾲ', + 'ᾳ' => 'ᾳ', + 'ᾴ' => 'ᾴ', + 'ᾶ' => 'ᾶ', + 'ᾷ' => 'ᾷ', + 'Ᾰ' => 'Ᾰ', + 'Ᾱ' => 'Ᾱ', + 'Ὰ' => 'Ὰ', + 'Ά' => 'Ά', + 'ᾼ' => 'ᾼ', + 'ι' => 'ι', + '῁' => '῁', + 'ῂ' => 'ῂ', + 'ῃ' => 'ῃ', + 'ῄ' => 'ῄ', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῇ', + 'Ὲ' => 'Ὲ', + 'Έ' => 'Έ', + 'Ὴ' => 'Ὴ', + 'Ή' => 'Ή', + 'ῌ' => 'ῌ', + '῍' => '῍', + '῎' => '῎', + '῏' => '῏', + 'ῐ' => 'ῐ', + 'ῑ' => 'ῑ', + 'ῒ' => 'ῒ', + 'ΐ' => 'ΐ', + 'ῖ' => 'ῖ', + 'ῗ' => 'ῗ', + 'Ῐ' => 'Ῐ', + 'Ῑ' => 'Ῑ', + 'Ὶ' => 'Ὶ', + 'Ί' => 'Ί', + '῝' => '῝', + '῞' => '῞', + '῟' => '῟', + 'ῠ' => 'ῠ', + 'ῡ' => 'ῡ', + 'ῢ' => 'ῢ', + 'ΰ' => 'ΰ', + 'ῤ' => 'ῤ', + 'ῥ' => 'ῥ', + 'ῦ' => 'ῦ', + 'ῧ' => 'ῧ', + 'Ῠ' => 'Ῠ', + 'Ῡ' => 'Ῡ', + 'Ὺ' => 'Ὺ', + 'Ύ' => 'Ύ', + 'Ῥ' => 'Ῥ', + '῭' => '῭', + '΅' => '΅', + '`' => '`', + 'ῲ' => 'ῲ', + 'ῳ' => 'ῳ', + 'ῴ' => 'ῴ', + 'ῶ' => 'ῶ', + 'ῷ' => 'ῷ', + 'Ὸ' => 'Ὸ', + 'Ό' => 'Ό', + 'Ὼ' => 'Ὼ', + 'Ώ' => 'Ώ', + 'ῼ' => 'ῼ', + '´' => '´', + ' ' => ' ', + ' ' => ' ', + 'Ω' => 'Ω', + 'K' => 'K', + 'Å' => 'Å', + '↚' => '↚', + '↛' => '↛', + '↮' => '↮', + '⇍' => '⇍', + '⇎' => '⇎', + '⇏' => '⇏', + '∄' => '∄', + '∉' => '∉', + '∌' => '∌', + '∤' => '∤', + '∦' => '∦', + '≁' => '≁', + '≄' => '≄', + '≇' => '≇', + '≉' => '≉', + '≠' => '≠', + '≢' => '≢', + '≭' => '≭', + '≮' => '≮', + '≯' => '≯', + '≰' => '≰', + '≱' => '≱', + '≴' => '≴', + '≵' => '≵', + '≸' => '≸', + '≹' => '≹', + '⊀' => '⊀', + '⊁' => '⊁', + '⊄' => '⊄', + '⊅' => '⊅', + '⊈' => '⊈', + '⊉' => '⊉', + '⊬' => '⊬', + '⊭' => '⊭', + '⊮' => '⊮', + '⊯' => '⊯', + '⋠' => '⋠', + '⋡' => '⋡', + '⋢' => '⋢', + '⋣' => '⋣', + '⋪' => '⋪', + '⋫' => '⋫', + '⋬' => '⋬', + '⋭' => '⋭', + '〈' => '〈', + '〉' => '〉', + '⫝̸' => '⫝̸', + 'が' => 'が', + 'ぎ' => 'ぎ', + 'ぐ' => 'ぐ', + 'げ' => 'げ', + 'ご' => 'ご', + 'ざ' => 'ざ', + 'じ' => 'じ', + 'ず' => 'ず', + 'ぜ' => 'ぜ', + 'ぞ' => 'ぞ', + 'だ' => 'だ', + 'ぢ' => 'ぢ', + 'づ' => 'づ', + 'で' => 'で', + 'ど' => 'ど', + 'ば' => 'ば', + 'ぱ' => 'ぱ', + 'び' => 'び', + 'ぴ' => 'ぴ', + 'ぶ' => 'ぶ', + 'ぷ' => 'ぷ', + 'べ' => 'べ', + 'ぺ' => 'ぺ', + 'ぼ' => 'ぼ', + 'ぽ' => 'ぽ', + 'ゔ' => 'ゔ', + 'ゞ' => 'ゞ', + 'ガ' => 'ガ', + 'ギ' => 'ギ', + 'グ' => 'グ', + 'ゲ' => 'ゲ', + 'ゴ' => 'ゴ', + 'ザ' => 'ザ', + 'ジ' => 'ジ', + 'ズ' => 'ズ', + 'ゼ' => 'ゼ', + 'ゾ' => 'ゾ', + 'ダ' => 'ダ', + 'ヂ' => 'ヂ', + 'ヅ' => 'ヅ', + 'デ' => 'デ', + 'ド' => 'ド', + 'バ' => 'バ', + 'パ' => 'パ', + 'ビ' => 'ビ', + 'ピ' => 'ピ', + 'ブ' => 'ブ', + 'プ' => 'プ', + 'ベ' => 'ベ', + 'ペ' => 'ペ', + 'ボ' => 'ボ', + 'ポ' => 'ポ', + 'ヴ' => 'ヴ', + 'ヷ' => 'ヷ', + 'ヸ' => 'ヸ', + 'ヹ' => 'ヹ', + 'ヺ' => 'ヺ', + 'ヾ' => 'ヾ', + '豈' => '豈', + '更' => '更', + '車' => '車', + '賈' => '賈', + '滑' => '滑', + '串' => '串', + '句' => '句', + '龜' => '龜', + '龜' => '龜', + '契' => '契', + '金' => '金', + '喇' => '喇', + '奈' => '奈', + '懶' => '懶', + '癩' => '癩', + '羅' => '羅', + '蘿' => '蘿', + '螺' => '螺', + '裸' => '裸', + '邏' => '邏', + '樂' => '樂', + '洛' => '洛', + '烙' => '烙', + '珞' => '珞', + '落' => '落', + '酪' => '酪', + '駱' => '駱', + '亂' => '亂', + '卵' => '卵', + '欄' => '欄', + '爛' => '爛', + '蘭' => '蘭', + '鸞' => '鸞', + '嵐' => '嵐', + '濫' => '濫', + '藍' => '藍', + '襤' => '襤', + '拉' => '拉', + '臘' => '臘', + '蠟' => '蠟', + '廊' => '廊', + '朗' => '朗', + '浪' => '浪', + '狼' => '狼', + '郎' => '郎', + '來' => '來', + '冷' => '冷', + '勞' => '勞', + '擄' => '擄', + '櫓' => '櫓', + '爐' => '爐', + '盧' => '盧', + '老' => '老', + '蘆' => '蘆', + '虜' => '虜', + '路' => '路', + '露' => '露', + '魯' => '魯', + '鷺' => '鷺', + '碌' => '碌', + '祿' => '祿', + '綠' => '綠', + '菉' => '菉', + '錄' => '錄', + '鹿' => '鹿', + '論' => '論', + '壟' => '壟', + '弄' => '弄', + '籠' => '籠', + '聾' => '聾', + '牢' => '牢', + '磊' => '磊', + '賂' => '賂', + '雷' => '雷', + '壘' => '壘', + '屢' => '屢', + '樓' => '樓', + '淚' => '淚', + '漏' => '漏', + '累' => '累', + '縷' => '縷', + '陋' => '陋', + '勒' => '勒', + '肋' => '肋', + '凜' => '凜', + '凌' => '凌', + '稜' => '稜', + '綾' => '綾', + '菱' => '菱', + '陵' => '陵', + '讀' => '讀', + '拏' => '拏', + '樂' => '樂', + '諾' => '諾', + '丹' => '丹', + '寧' => '寧', + '怒' => '怒', + '率' => '率', + '異' => '異', + '北' => '北', + '磻' => '磻', + '便' => '便', + '復' => '復', + '不' => '不', + '泌' => '泌', + '數' => '數', + '索' => '索', + '參' => '參', + '塞' => '塞', + '省' => '省', + '葉' => '葉', + '說' => '說', + '殺' => '殺', + '辰' => '辰', + '沈' => '沈', + '拾' => '拾', + '若' => '若', + '掠' => '掠', + '略' => '略', + '亮' => '亮', + '兩' => '兩', + '凉' => '凉', + '梁' => '梁', + '糧' => '糧', + '良' => '良', + '諒' => '諒', + '量' => '量', + '勵' => '勵', + '呂' => '呂', + '女' => '女', + '廬' => '廬', + '旅' => '旅', + '濾' => '濾', + '礪' => '礪', + '閭' => '閭', + '驪' => '驪', + '麗' => '麗', + '黎' => '黎', + '力' => '力', + '曆' => '曆', + '歷' => '歷', + '轢' => '轢', + '年' => '年', + '憐' => '憐', + '戀' => '戀', + '撚' => '撚', + '漣' => '漣', + '煉' => '煉', + '璉' => '璉', + '秊' => '秊', + '練' => '練', + '聯' => '聯', + '輦' => '輦', + '蓮' => '蓮', + '連' => '連', + '鍊' => '鍊', + '列' => '列', + '劣' => '劣', + '咽' => '咽', + '烈' => '烈', + '裂' => '裂', + '說' => '說', + '廉' => '廉', + '念' => '念', + '捻' => '捻', + '殮' => '殮', + '簾' => '簾', + '獵' => '獵', + '令' => '令', + '囹' => '囹', + '寧' => '寧', + '嶺' => '嶺', + '怜' => '怜', + '玲' => '玲', + '瑩' => '瑩', + '羚' => '羚', + '聆' => '聆', + '鈴' => '鈴', + '零' => '零', + '靈' => '靈', + '領' => '領', + '例' => '例', + '禮' => '禮', + '醴' => '醴', + '隸' => '隸', + '惡' => '惡', + '了' => '了', + '僚' => '僚', + '寮' => '寮', + '尿' => '尿', + '料' => '料', + '樂' => '樂', + '燎' => '燎', + '療' => '療', + '蓼' => '蓼', + '遼' => '遼', + '龍' => '龍', + '暈' => '暈', + '阮' => '阮', + '劉' => '劉', + '杻' => '杻', + '柳' => '柳', + '流' => '流', + '溜' => '溜', + '琉' => '琉', + '留' => '留', + '硫' => '硫', + '紐' => '紐', + '類' => '類', + '六' => '六', + '戮' => '戮', + '陸' => '陸', + '倫' => '倫', + '崙' => '崙', + '淪' => '淪', + '輪' => '輪', + '律' => '律', + '慄' => '慄', + '栗' => '栗', + '率' => '率', + '隆' => '隆', + '利' => '利', + '吏' => '吏', + '履' => '履', + '易' => '易', + '李' => '李', + '梨' => '梨', + '泥' => '泥', + '理' => '理', + '痢' => '痢', + '罹' => '罹', + '裏' => '裏', + '裡' => '裡', + '里' => '里', + '離' => '離', + '匿' => '匿', + '溺' => '溺', + '吝' => '吝', + '燐' => '燐', + '璘' => '璘', + '藺' => '藺', + '隣' => '隣', + '鱗' => '鱗', + '麟' => '麟', + '林' => '林', + '淋' => '淋', + '臨' => '臨', + '立' => '立', + '笠' => '笠', + '粒' => '粒', + '狀' => '狀', + '炙' => '炙', + '識' => '識', + '什' => '什', + '茶' => '茶', + '刺' => '刺', + '切' => '切', + '度' => '度', + '拓' => '拓', + '糖' => '糖', + '宅' => '宅', + '洞' => '洞', + '暴' => '暴', + '輻' => '輻', + '行' => '行', + '降' => '降', + '見' => '見', + '廓' => '廓', + '兀' => '兀', + '嗀' => '嗀', + '塚' => '塚', + '晴' => '晴', + '凞' => '凞', + '猪' => '猪', + '益' => '益', + '礼' => '礼', + '神' => '神', + '祥' => '祥', + '福' => '福', + '靖' => '靖', + '精' => '精', + '羽' => '羽', + '蘒' => '蘒', + '諸' => '諸', + '逸' => '逸', + '都' => '都', + '飯' => '飯', + '飼' => '飼', + '館' => '館', + '鶴' => '鶴', + '郞' => '郞', + '隷' => '隷', + '侮' => '侮', + '僧' => '僧', + '免' => '免', + '勉' => '勉', + '勤' => '勤', + '卑' => '卑', + '喝' => '喝', + '嘆' => '嘆', + '器' => '器', + '塀' => '塀', + '墨' => '墨', + '層' => '層', + '屮' => '屮', + '悔' => '悔', + '慨' => '慨', + '憎' => '憎', + '懲' => '懲', + '敏' => '敏', + '既' => '既', + '暑' => '暑', + '梅' => '梅', + '海' => '海', + '渚' => '渚', + '漢' => '漢', + '煮' => '煮', + '爫' => '爫', + '琢' => '琢', + '碑' => '碑', + '社' => '社', + '祉' => '祉', + '祈' => '祈', + '祐' => '祐', + '祖' => '祖', + '祝' => '祝', + '禍' => '禍', + '禎' => '禎', + '穀' => '穀', + '突' => '突', + '節' => '節', + '練' => '練', + '縉' => '縉', + '繁' => '繁', + '署' => '署', + '者' => '者', + '臭' => '臭', + '艹' => '艹', + '艹' => '艹', + '著' => '著', + '褐' => '褐', + '視' => '視', + '謁' => '謁', + '謹' => '謹', + '賓' => '賓', + '贈' => '贈', + '辶' => '辶', + '逸' => '逸', + '難' => '難', + '響' => '響', + '頻' => '頻', + '恵' => '恵', + '𤋮' => '𤋮', + '舘' => '舘', + '並' => '並', + '况' => '况', + '全' => '全', + '侀' => '侀', + '充' => '充', + '冀' => '冀', + '勇' => '勇', + '勺' => '勺', + '喝' => '喝', + '啕' => '啕', + '喙' => '喙', + '嗢' => '嗢', + '塚' => '塚', + '墳' => '墳', + '奄' => '奄', + '奔' => '奔', + '婢' => '婢', + '嬨' => '嬨', + '廒' => '廒', + '廙' => '廙', + '彩' => '彩', + '徭' => '徭', + '惘' => '惘', + '慎' => '慎', + '愈' => '愈', + '憎' => '憎', + '慠' => '慠', + '懲' => '懲', + '戴' => '戴', + '揄' => '揄', + '搜' => '搜', + '摒' => '摒', + '敖' => '敖', + '晴' => '晴', + '朗' => '朗', + '望' => '望', + '杖' => '杖', + '歹' => '歹', + '殺' => '殺', + '流' => '流', + '滛' => '滛', + '滋' => '滋', + '漢' => '漢', + '瀞' => '瀞', + '煮' => '煮', + '瞧' => '瞧', + '爵' => '爵', + '犯' => '犯', + '猪' => '猪', + '瑱' => '瑱', + '甆' => '甆', + '画' => '画', + '瘝' => '瘝', + '瘟' => '瘟', + '益' => '益', + '盛' => '盛', + '直' => '直', + '睊' => '睊', + '着' => '着', + '磌' => '磌', + '窱' => '窱', + '節' => '節', + '类' => '类', + '絛' => '絛', + '練' => '練', + '缾' => '缾', + '者' => '者', + '荒' => '荒', + '華' => '華', + '蝹' => '蝹', + '襁' => '襁', + '覆' => '覆', + '視' => '視', + '調' => '調', + '諸' => '諸', + '請' => '請', + '謁' => '謁', + '諾' => '諾', + '諭' => '諭', + '謹' => '謹', + '變' => '變', + '贈' => '贈', + '輸' => '輸', + '遲' => '遲', + '醙' => '醙', + '鉶' => '鉶', + '陼' => '陼', + '難' => '難', + '靖' => '靖', + '韛' => '韛', + '響' => '響', + '頋' => '頋', + '頻' => '頻', + '鬒' => '鬒', + '龜' => '龜', + '𢡊' => '𢡊', + '𢡄' => '𢡄', + '𣏕' => '𣏕', + '㮝' => '㮝', + '䀘' => '䀘', + '䀹' => '䀹', + '𥉉' => '𥉉', + '𥳐' => '𥳐', + '𧻓' => '𧻓', + '齃' => '齃', + '龎' => '龎', + 'יִ' => 'יִ', + 'ײַ' => 'ײַ', + 'שׁ' => 'שׁ', + 'שׂ' => 'שׂ', + 'שּׁ' => 'שּׁ', + 'שּׂ' => 'שּׂ', + 'אַ' => 'אַ', + 'אָ' => 'אָ', + 'אּ' => 'אּ', + 'בּ' => 'בּ', + 'גּ' => 'גּ', + 'דּ' => 'דּ', + 'הּ' => 'הּ', + 'וּ' => 'וּ', + 'זּ' => 'זּ', + 'טּ' => 'טּ', + 'יּ' => 'יּ', + 'ךּ' => 'ךּ', + 'כּ' => 'כּ', + 'לּ' => 'לּ', + 'מּ' => 'מּ', + 'נּ' => 'נּ', + 'סּ' => 'סּ', + 'ףּ' => 'ףּ', + 'פּ' => 'פּ', + 'צּ' => 'צּ', + 'קּ' => 'קּ', + 'רּ' => 'רּ', + 'שּ' => 'שּ', + 'תּ' => 'תּ', + 'וֹ' => 'וֹ', + 'בֿ' => 'בֿ', + 'כֿ' => 'כֿ', + 'פֿ' => 'פֿ', + '𑂚' => '𑂚', + '𑂜' => '𑂜', + '𑂫' => '𑂫', + '𑄮' => '𑄮', + '𑄯' => '𑄯', + '𑍋' => '𑍋', + '𑍌' => '𑍌', + '𑒻' => '𑒻', + '𑒼' => '𑒼', + '𑒾' => '𑒾', + '𑖺' => '𑖺', + '𑖻' => '𑖻', + '𑤸' => '𑤸', + '𝅗𝅥' => '𝅗𝅥', + '𝅘𝅥' => '𝅘𝅥', + '𝅘𝅥𝅮' => '𝅘𝅥𝅮', + '𝅘𝅥𝅯' => '𝅘𝅥𝅯', + '𝅘𝅥𝅰' => '𝅘𝅥𝅰', + '𝅘𝅥𝅱' => '𝅘𝅥𝅱', + '𝅘𝅥𝅲' => '𝅘𝅥𝅲', + '𝆹𝅥' => '𝆹𝅥', + '𝆺𝅥' => '𝆺𝅥', + '𝆹𝅥𝅮' => '𝆹𝅥𝅮', + '𝆺𝅥𝅮' => '𝆺𝅥𝅮', + '𝆹𝅥𝅯' => '𝆹𝅥𝅯', + '𝆺𝅥𝅯' => '𝆺𝅥𝅯', + '丽' => '丽', + '丸' => '丸', + '乁' => '乁', + '𠄢' => '𠄢', + '你' => '你', + '侮' => '侮', + '侻' => '侻', + '倂' => '倂', + '偺' => '偺', + '備' => '備', + '僧' => '僧', + '像' => '像', + '㒞' => '㒞', + '𠘺' => '𠘺', + '免' => '免', + '兔' => '兔', + '兤' => '兤', + '具' => '具', + '𠔜' => '𠔜', + '㒹' => '㒹', + '內' => '內', + '再' => '再', + '𠕋' => '𠕋', + '冗' => '冗', + '冤' => '冤', + '仌' => '仌', + '冬' => '冬', + '况' => '况', + '𩇟' => '𩇟', + '凵' => '凵', + '刃' => '刃', + '㓟' => '㓟', + '刻' => '刻', + '剆' => '剆', + '割' => '割', + '剷' => '剷', + '㔕' => '㔕', + '勇' => '勇', + '勉' => '勉', + '勤' => '勤', + '勺' => '勺', + '包' => '包', + '匆' => '匆', + '北' => '北', + '卉' => '卉', + '卑' => '卑', + '博' => '博', + '即' => '即', + '卽' => '卽', + '卿' => '卿', + '卿' => '卿', + '卿' => '卿', + '𠨬' => '𠨬', + '灰' => '灰', + '及' => '及', + '叟' => '叟', + '𠭣' => '𠭣', + '叫' => '叫', + '叱' => '叱', + '吆' => '吆', + '咞' => '咞', + '吸' => '吸', + '呈' => '呈', + '周' => '周', + '咢' => '咢', + '哶' => '哶', + '唐' => '唐', + '啓' => '啓', + '啣' => '啣', + '善' => '善', + '善' => '善', + '喙' => '喙', + '喫' => '喫', + '喳' => '喳', + '嗂' => '嗂', + '圖' => '圖', + '嘆' => '嘆', + '圗' => '圗', + '噑' => '噑', + '噴' => '噴', + '切' => '切', + '壮' => '壮', + '城' => '城', + '埴' => '埴', + '堍' => '堍', + '型' => '型', + '堲' => '堲', + '報' => '報', + '墬' => '墬', + '𡓤' => '𡓤', + '売' => '売', + '壷' => '壷', + '夆' => '夆', + '多' => '多', + '夢' => '夢', + '奢' => '奢', + '𡚨' => '𡚨', + '𡛪' => '𡛪', + '姬' => '姬', + '娛' => '娛', + '娧' => '娧', + '姘' => '姘', + '婦' => '婦', + '㛮' => '㛮', + '㛼' => '㛼', + '嬈' => '嬈', + '嬾' => '嬾', + '嬾' => '嬾', + '𡧈' => '𡧈', + '寃' => '寃', + '寘' => '寘', + '寧' => '寧', + '寳' => '寳', + '𡬘' => '𡬘', + '寿' => '寿', + '将' => '将', + '当' => '当', + '尢' => '尢', + '㞁' => '㞁', + '屠' => '屠', + '屮' => '屮', + '峀' => '峀', + '岍' => '岍', + '𡷤' => '𡷤', + '嵃' => '嵃', + '𡷦' => '𡷦', + '嵮' => '嵮', + '嵫' => '嵫', + '嵼' => '嵼', + '巡' => '巡', + '巢' => '巢', + '㠯' => '㠯', + '巽' => '巽', + '帨' => '帨', + '帽' => '帽', + '幩' => '幩', + '㡢' => '㡢', + '𢆃' => '𢆃', + '㡼' => '㡼', + '庰' => '庰', + '庳' => '庳', + '庶' => '庶', + '廊' => '廊', + '𪎒' => '𪎒', + '廾' => '廾', + '𢌱' => '𢌱', + '𢌱' => '𢌱', + '舁' => '舁', + '弢' => '弢', + '弢' => '弢', + '㣇' => '㣇', + '𣊸' => '𣊸', + '𦇚' => '𦇚', + '形' => '形', + '彫' => '彫', + '㣣' => '㣣', + '徚' => '徚', + '忍' => '忍', + '志' => '志', + '忹' => '忹', + '悁' => '悁', + '㤺' => '㤺', + '㤜' => '㤜', + '悔' => '悔', + '𢛔' => '𢛔', + '惇' => '惇', + '慈' => '慈', + '慌' => '慌', + '慎' => '慎', + '慌' => '慌', + '慺' => '慺', + '憎' => '憎', + '憲' => '憲', + '憤' => '憤', + '憯' => '憯', + '懞' => '懞', + '懲' => '懲', + '懶' => '懶', + '成' => '成', + '戛' => '戛', + '扝' => '扝', + '抱' => '抱', + '拔' => '拔', + '捐' => '捐', + '𢬌' => '𢬌', + '挽' => '挽', + '拼' => '拼', + '捨' => '捨', + '掃' => '掃', + '揤' => '揤', + '𢯱' => '𢯱', + '搢' => '搢', + '揅' => '揅', + '掩' => '掩', + '㨮' => '㨮', + '摩' => '摩', + '摾' => '摾', + '撝' => '撝', + '摷' => '摷', + '㩬' => '㩬', + '敏' => '敏', + '敬' => '敬', + '𣀊' => '𣀊', + '旣' => '旣', + '書' => '書', + '晉' => '晉', + '㬙' => '㬙', + '暑' => '暑', + '㬈' => '㬈', + '㫤' => '㫤', + '冒' => '冒', + '冕' => '冕', + '最' => '最', + '暜' => '暜', + '肭' => '肭', + '䏙' => '䏙', + '朗' => '朗', + '望' => '望', + '朡' => '朡', + '杞' => '杞', + '杓' => '杓', + '𣏃' => '𣏃', + '㭉' => '㭉', + '柺' => '柺', + '枅' => '枅', + '桒' => '桒', + '梅' => '梅', + '𣑭' => '𣑭', + '梎' => '梎', + '栟' => '栟', + '椔' => '椔', + '㮝' => '㮝', + '楂' => '楂', + '榣' => '榣', + '槪' => '槪', + '檨' => '檨', + '𣚣' => '𣚣', + '櫛' => '櫛', + '㰘' => '㰘', + '次' => '次', + '𣢧' => '𣢧', + '歔' => '歔', + '㱎' => '㱎', + '歲' => '歲', + '殟' => '殟', + '殺' => '殺', + '殻' => '殻', + '𣪍' => '𣪍', + '𡴋' => '𡴋', + '𣫺' => '𣫺', + '汎' => '汎', + '𣲼' => '𣲼', + '沿' => '沿', + '泍' => '泍', + '汧' => '汧', + '洖' => '洖', + '派' => '派', + '海' => '海', + '流' => '流', + '浩' => '浩', + '浸' => '浸', + '涅' => '涅', + '𣴞' => '𣴞', + '洴' => '洴', + '港' => '港', + '湮' => '湮', + '㴳' => '㴳', + '滋' => '滋', + '滇' => '滇', + '𣻑' => '𣻑', + '淹' => '淹', + '潮' => '潮', + '𣽞' => '𣽞', + '𣾎' => '𣾎', + '濆' => '濆', + '瀹' => '瀹', + '瀞' => '瀞', + '瀛' => '瀛', + '㶖' => '㶖', + '灊' => '灊', + '災' => '災', + '灷' => '灷', + '炭' => '炭', + '𠔥' => '𠔥', + '煅' => '煅', + '𤉣' => '𤉣', + '熜' => '熜', + '𤎫' => '𤎫', + '爨' => '爨', + '爵' => '爵', + '牐' => '牐', + '𤘈' => '𤘈', + '犀' => '犀', + '犕' => '犕', + '𤜵' => '𤜵', + '𤠔' => '𤠔', + '獺' => '獺', + '王' => '王', + '㺬' => '㺬', + '玥' => '玥', + '㺸' => '㺸', + '㺸' => '㺸', + '瑇' => '瑇', + '瑜' => '瑜', + '瑱' => '瑱', + '璅' => '璅', + '瓊' => '瓊', + '㼛' => '㼛', + '甤' => '甤', + '𤰶' => '𤰶', + '甾' => '甾', + '𤲒' => '𤲒', + '異' => '異', + '𢆟' => '𢆟', + '瘐' => '瘐', + '𤾡' => '𤾡', + '𤾸' => '𤾸', + '𥁄' => '𥁄', + '㿼' => '㿼', + '䀈' => '䀈', + '直' => '直', + '𥃳' => '𥃳', + '𥃲' => '𥃲', + '𥄙' => '𥄙', + '𥄳' => '𥄳', + '眞' => '眞', + '真' => '真', + '真' => '真', + '睊' => '睊', + '䀹' => '䀹', + '瞋' => '瞋', + '䁆' => '䁆', + '䂖' => '䂖', + '𥐝' => '𥐝', + '硎' => '硎', + '碌' => '碌', + '磌' => '磌', + '䃣' => '䃣', + '𥘦' => '𥘦', + '祖' => '祖', + '𥚚' => '𥚚', + '𥛅' => '𥛅', + '福' => '福', + '秫' => '秫', + '䄯' => '䄯', + '穀' => '穀', + '穊' => '穊', + '穏' => '穏', + '𥥼' => '𥥼', + '𥪧' => '𥪧', + '𥪧' => '𥪧', + '竮' => '竮', + '䈂' => '䈂', + '𥮫' => '𥮫', + '篆' => '篆', + '築' => '築', + '䈧' => '䈧', + '𥲀' => '𥲀', + '糒' => '糒', + '䊠' => '䊠', + '糨' => '糨', + '糣' => '糣', + '紀' => '紀', + '𥾆' => '𥾆', + '絣' => '絣', + '䌁' => '䌁', + '緇' => '緇', + '縂' => '縂', + '繅' => '繅', + '䌴' => '䌴', + '𦈨' => '𦈨', + '𦉇' => '𦉇', + '䍙' => '䍙', + '𦋙' => '𦋙', + '罺' => '罺', + '𦌾' => '𦌾', + '羕' => '羕', + '翺' => '翺', + '者' => '者', + '𦓚' => '𦓚', + '𦔣' => '𦔣', + '聠' => '聠', + '𦖨' => '𦖨', + '聰' => '聰', + '𣍟' => '𣍟', + '䏕' => '䏕', + '育' => '育', + '脃' => '脃', + '䐋' => '䐋', + '脾' => '脾', + '媵' => '媵', + '𦞧' => '𦞧', + '𦞵' => '𦞵', + '𣎓' => '𣎓', + '𣎜' => '𣎜', + '舁' => '舁', + '舄' => '舄', + '辞' => '辞', + '䑫' => '䑫', + '芑' => '芑', + '芋' => '芋', + '芝' => '芝', + '劳' => '劳', + '花' => '花', + '芳' => '芳', + '芽' => '芽', + '苦' => '苦', + '𦬼' => '𦬼', + '若' => '若', + '茝' => '茝', + '荣' => '荣', + '莭' => '莭', + '茣' => '茣', + '莽' => '莽', + '菧' => '菧', + '著' => '著', + '荓' => '荓', + '菊' => '菊', + '菌' => '菌', + '菜' => '菜', + '𦰶' => '𦰶', + '𦵫' => '𦵫', + '𦳕' => '𦳕', + '䔫' => '䔫', + '蓱' => '蓱', + '蓳' => '蓳', + '蔖' => '蔖', + '𧏊' => '𧏊', + '蕤' => '蕤', + '𦼬' => '𦼬', + '䕝' => '䕝', + '䕡' => '䕡', + '𦾱' => '𦾱', + '𧃒' => '𧃒', + '䕫' => '䕫', + '虐' => '虐', + '虜' => '虜', + '虧' => '虧', + '虩' => '虩', + '蚩' => '蚩', + '蚈' => '蚈', + '蜎' => '蜎', + '蛢' => '蛢', + '蝹' => '蝹', + '蜨' => '蜨', + '蝫' => '蝫', + '螆' => '螆', + '䗗' => '䗗', + '蟡' => '蟡', + '蠁' => '蠁', + '䗹' => '䗹', + '衠' => '衠', + '衣' => '衣', + '𧙧' => '𧙧', + '裗' => '裗', + '裞' => '裞', + '䘵' => '䘵', + '裺' => '裺', + '㒻' => '㒻', + '𧢮' => '𧢮', + '𧥦' => '𧥦', + '䚾' => '䚾', + '䛇' => '䛇', + '誠' => '誠', + '諭' => '諭', + '變' => '變', + '豕' => '豕', + '𧲨' => '𧲨', + '貫' => '貫', + '賁' => '賁', + '贛' => '贛', + '起' => '起', + '𧼯' => '𧼯', + '𠠄' => '𠠄', + '跋' => '跋', + '趼' => '趼', + '跰' => '跰', + '𠣞' => '𠣞', + '軔' => '軔', + '輸' => '輸', + '𨗒' => '𨗒', + '𨗭' => '𨗭', + '邔' => '邔', + '郱' => '郱', + '鄑' => '鄑', + '𨜮' => '𨜮', + '鄛' => '鄛', + '鈸' => '鈸', + '鋗' => '鋗', + '鋘' => '鋘', + '鉼' => '鉼', + '鏹' => '鏹', + '鐕' => '鐕', + '𨯺' => '𨯺', + '開' => '開', + '䦕' => '䦕', + '閷' => '閷', + '𨵷' => '𨵷', + '䧦' => '䧦', + '雃' => '雃', + '嶲' => '嶲', + '霣' => '霣', + '𩅅' => '𩅅', + '𩈚' => '𩈚', + '䩮' => '䩮', + '䩶' => '䩶', + '韠' => '韠', + '𩐊' => '𩐊', + '䪲' => '䪲', + '𩒖' => '𩒖', + '頋' => '頋', + '頋' => '頋', + '頩' => '頩', + '𩖶' => '𩖶', + '飢' => '飢', + '䬳' => '䬳', + '餩' => '餩', + '馧' => '馧', + '駂' => '駂', + '駾' => '駾', + '䯎' => '䯎', + '𩬰' => '𩬰', + '鬒' => '鬒', + '鱀' => '鱀', + '鳽' => '鳽', + '䳎' => '䳎', + '䳭' => '䳭', + '鵧' => '鵧', + '𪃎' => '𪃎', + '䳸' => '䳸', + '𪄅' => '𪄅', + '𪈎' => '𪈎', + '𪊑' => '𪊑', + '麻' => '麻', + '䵖' => '䵖', + '黹' => '黹', + '黾' => '黾', + '鼅' => '鼅', + '鼏' => '鼏', + '鼖' => '鼖', + '鼻' => '鼻', + '𪘀' => '𪘀', +); diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php new file mode 100644 index 00000000..ec90f36e --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php @@ -0,0 +1,876 @@ + 230, + '́' => 230, + '̂' => 230, + '̃' => 230, + '̄' => 230, + '̅' => 230, + '̆' => 230, + '̇' => 230, + '̈' => 230, + '̉' => 230, + '̊' => 230, + '̋' => 230, + '̌' => 230, + '̍' => 230, + '̎' => 230, + '̏' => 230, + '̐' => 230, + '̑' => 230, + '̒' => 230, + '̓' => 230, + '̔' => 230, + '̕' => 232, + '̖' => 220, + '̗' => 220, + '̘' => 220, + '̙' => 220, + '̚' => 232, + '̛' => 216, + '̜' => 220, + '̝' => 220, + '̞' => 220, + '̟' => 220, + '̠' => 220, + '̡' => 202, + '̢' => 202, + '̣' => 220, + '̤' => 220, + '̥' => 220, + '̦' => 220, + '̧' => 202, + '̨' => 202, + '̩' => 220, + '̪' => 220, + '̫' => 220, + '̬' => 220, + '̭' => 220, + '̮' => 220, + '̯' => 220, + '̰' => 220, + '̱' => 220, + '̲' => 220, + '̳' => 220, + '̴' => 1, + '̵' => 1, + '̶' => 1, + '̷' => 1, + '̸' => 1, + '̹' => 220, + '̺' => 220, + '̻' => 220, + '̼' => 220, + '̽' => 230, + '̾' => 230, + '̿' => 230, + '̀' => 230, + '́' => 230, + '͂' => 230, + '̓' => 230, + '̈́' => 230, + 'ͅ' => 240, + '͆' => 230, + '͇' => 220, + '͈' => 220, + '͉' => 220, + '͊' => 230, + '͋' => 230, + '͌' => 230, + '͍' => 220, + '͎' => 220, + '͐' => 230, + '͑' => 230, + '͒' => 230, + '͓' => 220, + '͔' => 220, + '͕' => 220, + '͖' => 220, + '͗' => 230, + '͘' => 232, + '͙' => 220, + '͚' => 220, + '͛' => 230, + '͜' => 233, + '͝' => 234, + '͞' => 234, + '͟' => 233, + '͠' => 234, + '͡' => 234, + '͢' => 233, + 'ͣ' => 230, + 'ͤ' => 230, + 'ͥ' => 230, + 'ͦ' => 230, + 'ͧ' => 230, + 'ͨ' => 230, + 'ͩ' => 230, + 'ͪ' => 230, + 'ͫ' => 230, + 'ͬ' => 230, + 'ͭ' => 230, + 'ͮ' => 230, + 'ͯ' => 230, + '҃' => 230, + '҄' => 230, + '҅' => 230, + '҆' => 230, + '҇' => 230, + '֑' => 220, + '֒' => 230, + '֓' => 230, + '֔' => 230, + '֕' => 230, + '֖' => 220, + '֗' => 230, + '֘' => 230, + '֙' => 230, + '֚' => 222, + '֛' => 220, + '֜' => 230, + '֝' => 230, + '֞' => 230, + '֟' => 230, + '֠' => 230, + '֡' => 230, + '֢' => 220, + '֣' => 220, + '֤' => 220, + '֥' => 220, + '֦' => 220, + '֧' => 220, + '֨' => 230, + '֩' => 230, + '֪' => 220, + '֫' => 230, + '֬' => 230, + '֭' => 222, + '֮' => 228, + '֯' => 230, + 'ְ' => 10, + 'ֱ' => 11, + 'ֲ' => 12, + 'ֳ' => 13, + 'ִ' => 14, + 'ֵ' => 15, + 'ֶ' => 16, + 'ַ' => 17, + 'ָ' => 18, + 'ֹ' => 19, + 'ֺ' => 19, + 'ֻ' => 20, + 'ּ' => 21, + 'ֽ' => 22, + 'ֿ' => 23, + 'ׁ' => 24, + 'ׂ' => 25, + 'ׄ' => 230, + 'ׅ' => 220, + 'ׇ' => 18, + 'ؐ' => 230, + 'ؑ' => 230, + 'ؒ' => 230, + 'ؓ' => 230, + 'ؔ' => 230, + 'ؕ' => 230, + 'ؖ' => 230, + 'ؗ' => 230, + 'ؘ' => 30, + 'ؙ' => 31, + 'ؚ' => 32, + 'ً' => 27, + 'ٌ' => 28, + 'ٍ' => 29, + 'َ' => 30, + 'ُ' => 31, + 'ِ' => 32, + 'ّ' => 33, + 'ْ' => 34, + 'ٓ' => 230, + 'ٔ' => 230, + 'ٕ' => 220, + 'ٖ' => 220, + 'ٗ' => 230, + '٘' => 230, + 'ٙ' => 230, + 'ٚ' => 230, + 'ٛ' => 230, + 'ٜ' => 220, + 'ٝ' => 230, + 'ٞ' => 230, + 'ٟ' => 220, + 'ٰ' => 35, + 'ۖ' => 230, + 'ۗ' => 230, + 'ۘ' => 230, + 'ۙ' => 230, + 'ۚ' => 230, + 'ۛ' => 230, + 'ۜ' => 230, + '۟' => 230, + '۠' => 230, + 'ۡ' => 230, + 'ۢ' => 230, + 'ۣ' => 220, + 'ۤ' => 230, + 'ۧ' => 230, + 'ۨ' => 230, + '۪' => 220, + '۫' => 230, + '۬' => 230, + 'ۭ' => 220, + 'ܑ' => 36, + 'ܰ' => 230, + 'ܱ' => 220, + 'ܲ' => 230, + 'ܳ' => 230, + 'ܴ' => 220, + 'ܵ' => 230, + 'ܶ' => 230, + 'ܷ' => 220, + 'ܸ' => 220, + 'ܹ' => 220, + 'ܺ' => 230, + 'ܻ' => 220, + 'ܼ' => 220, + 'ܽ' => 230, + 'ܾ' => 220, + 'ܿ' => 230, + '݀' => 230, + '݁' => 230, + '݂' => 220, + '݃' => 230, + '݄' => 220, + '݅' => 230, + '݆' => 220, + '݇' => 230, + '݈' => 220, + '݉' => 230, + '݊' => 230, + '߫' => 230, + '߬' => 230, + '߭' => 230, + '߮' => 230, + '߯' => 230, + '߰' => 230, + '߱' => 230, + '߲' => 220, + '߳' => 230, + '߽' => 220, + 'ࠖ' => 230, + 'ࠗ' => 230, + '࠘' => 230, + '࠙' => 230, + 'ࠛ' => 230, + 'ࠜ' => 230, + 'ࠝ' => 230, + 'ࠞ' => 230, + 'ࠟ' => 230, + 'ࠠ' => 230, + 'ࠡ' => 230, + 'ࠢ' => 230, + 'ࠣ' => 230, + 'ࠥ' => 230, + 'ࠦ' => 230, + 'ࠧ' => 230, + 'ࠩ' => 230, + 'ࠪ' => 230, + 'ࠫ' => 230, + 'ࠬ' => 230, + '࠭' => 230, + '࡙' => 220, + '࡚' => 220, + '࡛' => 220, + '࣓' => 220, + 'ࣔ' => 230, + 'ࣕ' => 230, + 'ࣖ' => 230, + 'ࣗ' => 230, + 'ࣘ' => 230, + 'ࣙ' => 230, + 'ࣚ' => 230, + 'ࣛ' => 230, + 'ࣜ' => 230, + 'ࣝ' => 230, + 'ࣞ' => 230, + 'ࣟ' => 230, + '࣠' => 230, + '࣡' => 230, + 'ࣣ' => 220, + 'ࣤ' => 230, + 'ࣥ' => 230, + 'ࣦ' => 220, + 'ࣧ' => 230, + 'ࣨ' => 230, + 'ࣩ' => 220, + '࣪' => 230, + '࣫' => 230, + '࣬' => 230, + '࣭' => 220, + '࣮' => 220, + '࣯' => 220, + 'ࣰ' => 27, + 'ࣱ' => 28, + 'ࣲ' => 29, + 'ࣳ' => 230, + 'ࣴ' => 230, + 'ࣵ' => 230, + 'ࣶ' => 220, + 'ࣷ' => 230, + 'ࣸ' => 230, + 'ࣹ' => 220, + 'ࣺ' => 220, + 'ࣻ' => 230, + 'ࣼ' => 230, + 'ࣽ' => 230, + 'ࣾ' => 230, + 'ࣿ' => 230, + '़' => 7, + '्' => 9, + '॑' => 230, + '॒' => 220, + '॓' => 230, + '॔' => 230, + '়' => 7, + '্' => 9, + '৾' => 230, + '਼' => 7, + '੍' => 9, + '઼' => 7, + '્' => 9, + '଼' => 7, + '୍' => 9, + '்' => 9, + '్' => 9, + 'ౕ' => 84, + 'ౖ' => 91, + '಼' => 7, + '್' => 9, + '഻' => 9, + '഼' => 9, + '്' => 9, + '්' => 9, + 'ุ' => 103, + 'ู' => 103, + 'ฺ' => 9, + '่' => 107, + '้' => 107, + '๊' => 107, + '๋' => 107, + 'ຸ' => 118, + 'ູ' => 118, + '຺' => 9, + '່' => 122, + '້' => 122, + '໊' => 122, + '໋' => 122, + '༘' => 220, + '༙' => 220, + '༵' => 220, + '༷' => 220, + '༹' => 216, + 'ཱ' => 129, + 'ི' => 130, + 'ུ' => 132, + 'ེ' => 130, + 'ཻ' => 130, + 'ོ' => 130, + 'ཽ' => 130, + 'ྀ' => 130, + 'ྂ' => 230, + 'ྃ' => 230, + '྄' => 9, + '྆' => 230, + '྇' => 230, + '࿆' => 220, + '့' => 7, + '္' => 9, + '်' => 9, + 'ႍ' => 220, + '፝' => 230, + '፞' => 230, + '፟' => 230, + '᜔' => 9, + '᜴' => 9, + '្' => 9, + '៝' => 230, + 'ᢩ' => 228, + '᤹' => 222, + '᤺' => 230, + '᤻' => 220, + 'ᨗ' => 230, + 'ᨘ' => 220, + '᩠' => 9, + '᩵' => 230, + '᩶' => 230, + '᩷' => 230, + '᩸' => 230, + '᩹' => 230, + '᩺' => 230, + '᩻' => 230, + '᩼' => 230, + '᩿' => 220, + '᪰' => 230, + '᪱' => 230, + '᪲' => 230, + '᪳' => 230, + '᪴' => 230, + '᪵' => 220, + '᪶' => 220, + '᪷' => 220, + '᪸' => 220, + '᪹' => 220, + '᪺' => 220, + '᪻' => 230, + '᪼' => 230, + '᪽' => 220, + 'ᪿ' => 220, + 'ᫀ' => 220, + '᬴' => 7, + '᭄' => 9, + '᭫' => 230, + '᭬' => 220, + '᭭' => 230, + '᭮' => 230, + '᭯' => 230, + '᭰' => 230, + '᭱' => 230, + '᭲' => 230, + '᭳' => 230, + '᮪' => 9, + '᮫' => 9, + '᯦' => 7, + '᯲' => 9, + '᯳' => 9, + '᰷' => 7, + '᳐' => 230, + '᳑' => 230, + '᳒' => 230, + '᳔' => 1, + '᳕' => 220, + '᳖' => 220, + '᳗' => 220, + '᳘' => 220, + '᳙' => 220, + '᳚' => 230, + '᳛' => 230, + '᳜' => 220, + '᳝' => 220, + '᳞' => 220, + '᳟' => 220, + '᳠' => 230, + '᳢' => 1, + '᳣' => 1, + '᳤' => 1, + '᳥' => 1, + '᳦' => 1, + '᳧' => 1, + '᳨' => 1, + '᳭' => 220, + '᳴' => 230, + '᳸' => 230, + '᳹' => 230, + '᷀' => 230, + '᷁' => 230, + '᷂' => 220, + '᷃' => 230, + '᷄' => 230, + '᷅' => 230, + '᷆' => 230, + '᷇' => 230, + '᷈' => 230, + '᷉' => 230, + '᷊' => 220, + '᷋' => 230, + '᷌' => 230, + '᷍' => 234, + '᷎' => 214, + '᷏' => 220, + '᷐' => 202, + '᷑' => 230, + '᷒' => 230, + 'ᷓ' => 230, + 'ᷔ' => 230, + 'ᷕ' => 230, + 'ᷖ' => 230, + 'ᷗ' => 230, + 'ᷘ' => 230, + 'ᷙ' => 230, + 'ᷚ' => 230, + 'ᷛ' => 230, + 'ᷜ' => 230, + 'ᷝ' => 230, + 'ᷞ' => 230, + 'ᷟ' => 230, + 'ᷠ' => 230, + 'ᷡ' => 230, + 'ᷢ' => 230, + 'ᷣ' => 230, + 'ᷤ' => 230, + 'ᷥ' => 230, + 'ᷦ' => 230, + 'ᷧ' => 230, + 'ᷨ' => 230, + 'ᷩ' => 230, + 'ᷪ' => 230, + 'ᷫ' => 230, + 'ᷬ' => 230, + 'ᷭ' => 230, + 'ᷮ' => 230, + 'ᷯ' => 230, + 'ᷰ' => 230, + 'ᷱ' => 230, + 'ᷲ' => 230, + 'ᷳ' => 230, + 'ᷴ' => 230, + '᷵' => 230, + '᷶' => 232, + '᷷' => 228, + '᷸' => 228, + '᷹' => 220, + '᷻' => 230, + '᷼' => 233, + '᷽' => 220, + '᷾' => 230, + '᷿' => 220, + '⃐' => 230, + '⃑' => 230, + '⃒' => 1, + '⃓' => 1, + '⃔' => 230, + '⃕' => 230, + '⃖' => 230, + '⃗' => 230, + '⃘' => 1, + '⃙' => 1, + '⃚' => 1, + '⃛' => 230, + '⃜' => 230, + '⃡' => 230, + '⃥' => 1, + '⃦' => 1, + '⃧' => 230, + '⃨' => 220, + '⃩' => 230, + '⃪' => 1, + '⃫' => 1, + '⃬' => 220, + '⃭' => 220, + '⃮' => 220, + '⃯' => 220, + '⃰' => 230, + '⳯' => 230, + '⳰' => 230, + '⳱' => 230, + '⵿' => 9, + 'ⷠ' => 230, + 'ⷡ' => 230, + 'ⷢ' => 230, + 'ⷣ' => 230, + 'ⷤ' => 230, + 'ⷥ' => 230, + 'ⷦ' => 230, + 'ⷧ' => 230, + 'ⷨ' => 230, + 'ⷩ' => 230, + 'ⷪ' => 230, + 'ⷫ' => 230, + 'ⷬ' => 230, + 'ⷭ' => 230, + 'ⷮ' => 230, + 'ⷯ' => 230, + 'ⷰ' => 230, + 'ⷱ' => 230, + 'ⷲ' => 230, + 'ⷳ' => 230, + 'ⷴ' => 230, + 'ⷵ' => 230, + 'ⷶ' => 230, + 'ⷷ' => 230, + 'ⷸ' => 230, + 'ⷹ' => 230, + 'ⷺ' => 230, + 'ⷻ' => 230, + 'ⷼ' => 230, + 'ⷽ' => 230, + 'ⷾ' => 230, + 'ⷿ' => 230, + '〪' => 218, + '〫' => 228, + '〬' => 232, + '〭' => 222, + '〮' => 224, + '〯' => 224, + '゙' => 8, + '゚' => 8, + '꙯' => 230, + 'ꙴ' => 230, + 'ꙵ' => 230, + 'ꙶ' => 230, + 'ꙷ' => 230, + 'ꙸ' => 230, + 'ꙹ' => 230, + 'ꙺ' => 230, + 'ꙻ' => 230, + '꙼' => 230, + '꙽' => 230, + 'ꚞ' => 230, + 'ꚟ' => 230, + '꛰' => 230, + '꛱' => 230, + '꠆' => 9, + '꠬' => 9, + '꣄' => 9, + '꣠' => 230, + '꣡' => 230, + '꣢' => 230, + '꣣' => 230, + '꣤' => 230, + '꣥' => 230, + '꣦' => 230, + '꣧' => 230, + '꣨' => 230, + '꣩' => 230, + '꣪' => 230, + '꣫' => 230, + '꣬' => 230, + '꣭' => 230, + '꣮' => 230, + '꣯' => 230, + '꣰' => 230, + '꣱' => 230, + '꤫' => 220, + '꤬' => 220, + '꤭' => 220, + '꥓' => 9, + '꦳' => 7, + '꧀' => 9, + 'ꪰ' => 230, + 'ꪲ' => 230, + 'ꪳ' => 230, + 'ꪴ' => 220, + 'ꪷ' => 230, + 'ꪸ' => 230, + 'ꪾ' => 230, + '꪿' => 230, + '꫁' => 230, + '꫶' => 9, + '꯭' => 9, + 'ﬞ' => 26, + '︠' => 230, + '︡' => 230, + '︢' => 230, + '︣' => 230, + '︤' => 230, + '︥' => 230, + '︦' => 230, + '︧' => 220, + '︨' => 220, + '︩' => 220, + '︪' => 220, + '︫' => 220, + '︬' => 220, + '︭' => 220, + '︮' => 230, + '︯' => 230, + '𐇽' => 220, + '𐋠' => 220, + '𐍶' => 230, + '𐍷' => 230, + '𐍸' => 230, + '𐍹' => 230, + '𐍺' => 230, + '𐨍' => 220, + '𐨏' => 230, + '𐨸' => 230, + '𐨹' => 1, + '𐨺' => 220, + '𐨿' => 9, + '𐫥' => 230, + '𐫦' => 220, + '𐴤' => 230, + '𐴥' => 230, + '𐴦' => 230, + '𐴧' => 230, + '𐺫' => 230, + '𐺬' => 230, + '𐽆' => 220, + '𐽇' => 220, + '𐽈' => 230, + '𐽉' => 230, + '𐽊' => 230, + '𐽋' => 220, + '𐽌' => 230, + '𐽍' => 220, + '𐽎' => 220, + '𐽏' => 220, + '𐽐' => 220, + '𑁆' => 9, + '𑁿' => 9, + '𑂹' => 9, + '𑂺' => 7, + '𑄀' => 230, + '𑄁' => 230, + '𑄂' => 230, + '𑄳' => 9, + '𑄴' => 9, + '𑅳' => 7, + '𑇀' => 9, + '𑇊' => 7, + '𑈵' => 9, + '𑈶' => 7, + '𑋩' => 7, + '𑋪' => 9, + '𑌻' => 7, + '𑌼' => 7, + '𑍍' => 9, + '𑍦' => 230, + '𑍧' => 230, + '𑍨' => 230, + '𑍩' => 230, + '𑍪' => 230, + '𑍫' => 230, + '𑍬' => 230, + '𑍰' => 230, + '𑍱' => 230, + '𑍲' => 230, + '𑍳' => 230, + '𑍴' => 230, + '𑑂' => 9, + '𑑆' => 7, + '𑑞' => 230, + '𑓂' => 9, + '𑓃' => 7, + '𑖿' => 9, + '𑗀' => 7, + '𑘿' => 9, + '𑚶' => 9, + '𑚷' => 7, + '𑜫' => 9, + '𑠹' => 9, + '𑠺' => 7, + '𑤽' => 9, + '𑤾' => 9, + '𑥃' => 7, + '𑧠' => 9, + '𑨴' => 9, + '𑩇' => 9, + '𑪙' => 9, + '𑰿' => 9, + '𑵂' => 7, + '𑵄' => 9, + '𑵅' => 9, + '𑶗' => 9, + '𖫰' => 1, + '𖫱' => 1, + '𖫲' => 1, + '𖫳' => 1, + '𖫴' => 1, + '𖬰' => 230, + '𖬱' => 230, + '𖬲' => 230, + '𖬳' => 230, + '𖬴' => 230, + '𖬵' => 230, + '𖬶' => 230, + '𖿰' => 6, + '𖿱' => 6, + '𛲞' => 1, + '𝅥' => 216, + '𝅦' => 216, + '𝅧' => 1, + '𝅨' => 1, + '𝅩' => 1, + '𝅭' => 226, + '𝅮' => 216, + '𝅯' => 216, + '𝅰' => 216, + '𝅱' => 216, + '𝅲' => 216, + '𝅻' => 220, + '𝅼' => 220, + '𝅽' => 220, + '𝅾' => 220, + '𝅿' => 220, + '𝆀' => 220, + '𝆁' => 220, + '𝆂' => 220, + '𝆅' => 230, + '𝆆' => 230, + '𝆇' => 230, + '𝆈' => 230, + '𝆉' => 230, + '𝆊' => 220, + '𝆋' => 220, + '𝆪' => 230, + '𝆫' => 230, + '𝆬' => 230, + '𝆭' => 230, + '𝉂' => 230, + '𝉃' => 230, + '𝉄' => 230, + '𞀀' => 230, + '𞀁' => 230, + '𞀂' => 230, + '𞀃' => 230, + '𞀄' => 230, + '𞀅' => 230, + '𞀆' => 230, + '𞀈' => 230, + '𞀉' => 230, + '𞀊' => 230, + '𞀋' => 230, + '𞀌' => 230, + '𞀍' => 230, + '𞀎' => 230, + '𞀏' => 230, + '𞀐' => 230, + '𞀑' => 230, + '𞀒' => 230, + '𞀓' => 230, + '𞀔' => 230, + '𞀕' => 230, + '𞀖' => 230, + '𞀗' => 230, + '𞀘' => 230, + '𞀛' => 230, + '𞀜' => 230, + '𞀝' => 230, + '𞀞' => 230, + '𞀟' => 230, + '𞀠' => 230, + '𞀡' => 230, + '𞀣' => 230, + '𞀤' => 230, + '𞀦' => 230, + '𞀧' => 230, + '𞀨' => 230, + '𞀩' => 230, + '𞀪' => 230, + '𞄰' => 230, + '𞄱' => 230, + '𞄲' => 230, + '𞄳' => 230, + '𞄴' => 230, + '𞄵' => 230, + '𞄶' => 230, + '𞋬' => 230, + '𞋭' => 230, + '𞋮' => 230, + '𞋯' => 230, + '𞣐' => 220, + '𞣑' => 220, + '𞣒' => 220, + '𞣓' => 220, + '𞣔' => 220, + '𞣕' => 220, + '𞣖' => 220, + '𞥄' => 230, + '𞥅' => 230, + '𞥆' => 230, + '𞥇' => 230, + '𞥈' => 230, + '𞥉' => 230, + '𞥊' => 7, +); diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php new file mode 100644 index 00000000..15749028 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php @@ -0,0 +1,3695 @@ + ' ', + '¨' => ' ̈', + 'ª' => 'a', + '¯' => ' ̄', + '²' => '2', + '³' => '3', + '´' => ' ́', + 'µ' => 'μ', + '¸' => ' ̧', + '¹' => '1', + 'º' => 'o', + '¼' => '1⁄4', + '½' => '1⁄2', + '¾' => '3⁄4', + 'IJ' => 'IJ', + 'ij' => 'ij', + 'Ŀ' => 'L·', + 'ŀ' => 'l·', + 'ʼn' => 'ʼn', + 'ſ' => 's', + 'DŽ' => 'DŽ', + 'Dž' => 'Dž', + 'dž' => 'dž', + 'LJ' => 'LJ', + 'Lj' => 'Lj', + 'lj' => 'lj', + 'NJ' => 'NJ', + 'Nj' => 'Nj', + 'nj' => 'nj', + 'DZ' => 'DZ', + 'Dz' => 'Dz', + 'dz' => 'dz', + 'ʰ' => 'h', + 'ʱ' => 'ɦ', + 'ʲ' => 'j', + 'ʳ' => 'r', + 'ʴ' => 'ɹ', + 'ʵ' => 'ɻ', + 'ʶ' => 'ʁ', + 'ʷ' => 'w', + 'ʸ' => 'y', + '˘' => ' ̆', + '˙' => ' ̇', + '˚' => ' ̊', + '˛' => ' ̨', + '˜' => ' ̃', + '˝' => ' ̋', + 'ˠ' => 'ɣ', + 'ˡ' => 'l', + 'ˢ' => 's', + 'ˣ' => 'x', + 'ˤ' => 'ʕ', + 'ͺ' => ' ͅ', + '΄' => ' ́', + '΅' => ' ̈́', + 'ϐ' => 'β', + 'ϑ' => 'θ', + 'ϒ' => 'Υ', + 'ϓ' => 'Ύ', + 'ϔ' => 'Ϋ', + 'ϕ' => 'φ', + 'ϖ' => 'π', + 'ϰ' => 'κ', + 'ϱ' => 'ρ', + 'ϲ' => 'ς', + 'ϴ' => 'Θ', + 'ϵ' => 'ε', + 'Ϲ' => 'Σ', + 'և' => 'եւ', + 'ٵ' => 'اٴ', + 'ٶ' => 'وٴ', + 'ٷ' => 'ۇٴ', + 'ٸ' => 'يٴ', + 'ำ' => 'ํา', + 'ຳ' => 'ໍາ', + 'ໜ' => 'ຫນ', + 'ໝ' => 'ຫມ', + '༌' => '་', + 'ཷ' => 'ྲཱྀ', + 'ཹ' => 'ླཱྀ', + 'ჼ' => 'ნ', + 'ᴬ' => 'A', + 'ᴭ' => 'Æ', + 'ᴮ' => 'B', + 'ᴰ' => 'D', + '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=> 'ɩ', + 'ᶦ' => 'ɪ', + 'ᶧ' => 'ᵻ', + 'ᶨ' => 'ʝ', + 'ᶩ' => 'ɭ', + 'ᶪ' => 'ᶅ', + 'ᶫ' => 'ʟ', + 'ᶬ' => 'ɱ', + 'ᶭ' => 'ɰ', + 'ᶮ' => 'ɲ', + 'ᶯ' => 'ɳ', + 'ᶰ' => 'ɴ', + 'ᶱ' => 'ɵ', + 'ᶲ' => 'ɸ', + 'ᶳ' => 'ʂ', + 'ᶴ' => 'ʃ', + 'ᶵ' => 'ƫ', + 'ᶶ' => 'ʉ', + 'ᶷ' => 'ʊ', + 'ᶸ' => 'ᴜ', + 'ᶹ' => 'ʋ', + 'ᶺ' => 'ʌ', + 'ᶻ' => 'z', + 'ᶼ' => 'ʐ', + 'ᶽ' => 'ʑ', + 'ᶾ' => 'ʒ', + 'ᶿ' => 'θ', + 'ẚ' => 'aʾ', + 'ẛ' => 'ṡ', + '᾽' => ' ̓', + '᾿' => ' ̓', + '῀' => ' ͂', + '῁' => ' ̈͂', + '῍' => ' ̓̀', + '῎' => ' ̓́', + '῏' => ' ̓͂', + '῝' => ' ̔̀', + '῞' => ' ̔́', + '῟' => ' ̔͂', + '῭' => ' ̈̀', + '΅' => ' ̈́', + '´' => ' ́', + '῾' => ' ̔', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + '‑' => '‐', + '‗' => ' ̳', + '․' => '.', + '‥' => '..', + '…' => '...', + ' ' => ' ', + '″' => '′′', + '‴' => '′′′', + '‶' => '‵‵', + '‷' => '‵‵‵', + '‼' => '!!', + '‾' => ' ̅', + '⁇' => '??', + '⁈' => '?!', + '⁉' => '!?', + '⁗' => '′′′′', + ' ' => ' ', + '⁰' => '0', + 'ⁱ' => 'i', + '⁴' => '4', + '⁵' => '5', + '⁶' => '6', + '⁷' => '7', + '⁸' => '8', + '⁹' => '9', + '⁺' => '+', + '⁻' => '−', + '⁼' => '=', + '⁽' => '(', + '⁾' => ')', + 'ⁿ' => 'n', + '₀' => '0', + '₁' => '1', + '₂' => '2', + '₃' => '3', + '₄' => '4', + '₅' => '5', + '₆' => '6', + '₇' => '7', + '₈' => '8', + '₉' => '9', + '₊' => '+', + '₋' => '−', + '₌' => '=', + '₍' => '(', + '₎' => ')', + 'ₐ' => 'a', + 'ₑ' => 'e', + 'ₒ' => 'o', + 'ₓ' => 'x', + 'ₔ' => 'ə', + 'ₕ' => 'h', + 'ₖ' => 'k', + 'ₗ' => 'l', + 'ₘ' => 'm', + 'ₙ' => 'n', + 'ₚ' => 'p', + 'ₛ' => 's', + 'ₜ' => 't', + '₨' => 'Rs', + '℀' => 'a/c', + '℁' => 'a/s', + 'ℂ' => 'C', + '℃' => '°C', + '℅' => 'c/o', + '℆' => 'c/u', + 'ℇ' => 'Ɛ', + '℉' => '°F', + 'ℊ' => 'g', + 'ℋ' => 'H', + 'ℌ' => 'H', + 'ℍ' => 'H', + 'ℎ' => 'h', + 'ℏ' => 'ħ', + 'ℐ' => 'I', + 'ℑ' => 'I', + 'ℒ' => 'L', + 'ℓ' => 'l', + 'ℕ' => 'N', + '№' => 'No', + 'ℙ' => 'P', + 'ℚ' => 'Q', + 'ℛ' => 'R', + 'ℜ' => 'R', + 'ℝ' => 'R', + '℠' => 'SM', + '℡' => 'TEL', + '™' => 'TM', + 'ℤ' => 'Z', + 'ℨ' => 'Z', + 'ℬ' => 'B', + 'ℭ' => 'C', + 'ℯ' => 'e', + 'ℰ' => 'E', + 'ℱ' => 'F', + 'ℳ' => 'M', + 'ℴ' => 'o', + 'ℵ' => 'א', + 'ℶ' => 'ב', + 'ℷ' => 'ג', + 'ℸ' => 'ד', + 'ℹ' => 'i', + '℻' => 'FAX', + 'ℼ' => 'π', + 'ℽ' => 'γ', + 'ℾ' => 'Γ', + 'ℿ' => 'Π', + '⅀' => '∑', + 'ⅅ' => 'D', + 'ⅆ' => 'd', + 'ⅇ' => 'e', + 'ⅈ' => 'i', + 'ⅉ' => 'j', + '⅐' => '1⁄7', + '⅑' => '1⁄9', + '⅒' => '1⁄10', + '⅓' => '1⁄3', + '⅔' => '2⁄3', + '⅕' => '1⁄5', + '⅖' => '2⁄5', + '⅗' => '3⁄5', + '⅘' => '4⁄5', + '⅙' => '1⁄6', + '⅚' => '5⁄6', + '⅛' => '1⁄8', + '⅜' => '3⁄8', + '⅝' => '5⁄8', + '⅞' => '7⁄8', + '⅟' => '1⁄', + 'Ⅰ' => 'I', + 'Ⅱ' => 'II', + 'Ⅲ' => 'III', + 'Ⅳ' => 'IV', + 'Ⅴ' => 'V', + 'Ⅵ' => 'VI', + 'Ⅶ' => 'VII', + 'Ⅷ' => 'VIII', + 'Ⅸ' => 'IX', + 'Ⅹ' => 'X', + 'Ⅺ' => 'XI', + 'Ⅻ' => 'XII', + 'Ⅼ' => 'L', + 'Ⅽ' => 'C', + 'Ⅾ' => 'D', + 'Ⅿ' => 'M', + 'ⅰ' => 'i', + 'ⅱ' => 'ii', + 'ⅲ' => 'iii', + 'ⅳ' => 'iv', + 'ⅴ' => 'v', + 'ⅵ' => 'vi', + 'ⅶ' => 'vii', + 'ⅷ' => 'viii', + 'ⅸ' => 'ix', + 'ⅹ' => 'x', + 'ⅺ' => 'xi', + 'ⅻ' => 'xii', + 'ⅼ' => 'l', + 'ⅽ' => 'c', + 'ⅾ' => 'd', + 'ⅿ' => 'm', + '↉' => '0⁄3', + '∬' => '∫∫', + '∭' => '∫∫∫', + '∯' => '∮∮', + '∰' => '∮∮∮', + '①' => '1', + '②' => '2', + '③' => '3', + '④' => '4', + '⑤' => '5', + '⑥' => '6', + '⑦' => '7', + '⑧' => '8', + '⑨' => '9', + '⑩' => '10', + '⑪' => '11', + '⑫' => '12', + '⑬' => '13', + '⑭' => '14', + '⑮' => '15', + '⑯' => '16', + '⑰' => '17', + '⑱' => '18', + '⑲' => '19', + '⑳' => '20', + '⑴' => '(1)', + '⑵' => '(2)', + '⑶' => '(3)', + '⑷' => '(4)', + '⑸' => '(5)', + '⑹' => '(6)', + '⑺' => '(7)', + '⑻' => '(8)', + '⑼' => '(9)', + '⑽' => '(10)', + '⑾' => '(11)', + '⑿' => '(12)', + '⒀' => '(13)', + '⒁' => '(14)', + '⒂' => '(15)', + '⒃' => '(16)', + '⒄' => '(17)', + '⒅' => '(18)', + '⒆' => '(19)', + '⒇' => '(20)', + '⒈' => '1.', + '⒉' => '2.', + '⒊' => '3.', + '⒋' => '4.', + '⒌' => '5.', + '⒍' => '6.', + '⒎' => '7.', + '⒏' => '8.', + '⒐' => '9.', + '⒑' => '10.', + '⒒' => '11.', + '⒓' => '12.', + '⒔' => '13.', + '⒕' => '14.', + '⒖' => '15.', + '⒗' => '16.', + '⒘' => '17.', + '⒙' => '18.', + '⒚' => '19.', + '⒛' => '20.', + '⒜' => '(a)', + '⒝' => '(b)', + '⒞' => '(c)', + '⒟' => '(d)', + '⒠' => '(e)', + '⒡' => '(f)', + '⒢' => '(g)', + '⒣' => '(h)', + '⒤' => '(i)', + '⒥' => '(j)', + '⒦' => '(k)', + '⒧' => '(l)', + '⒨' => '(m)', + '⒩' => '(n)', + '⒪' => '(o)', + '⒫' => '(p)', + '⒬' => '(q)', + '⒭' => '(r)', + '⒮' => '(s)', + '⒯' => '(t)', + '⒰' => '(u)', + '⒱' => '(v)', + '⒲' => '(w)', + '⒳' => '(x)', + '⒴' => '(y)', + '⒵' => '(z)', + 'Ⓐ' => 'A', + 'Ⓑ' => 'B', + 'Ⓒ' => 'C', + 'Ⓓ' => 'D', + 'Ⓔ' => 'E', + 'Ⓕ' => 'F', + 'Ⓖ' => 'G', + 'Ⓗ' => 'H', + 'Ⓘ' => 'I', + 'Ⓙ' => 'J', + 'Ⓚ' => 'K', + 'Ⓛ' => 'L', + 'Ⓜ' => 'M', + 'Ⓝ' => 'N', + 'Ⓞ' => 'O', + 'Ⓟ' => 'P', + 'Ⓠ' => 'Q', + 'Ⓡ' => 'R', + 'Ⓢ' => 'S', + 'Ⓣ' => 'T', + 'Ⓤ' => 'U', + 'Ⓥ' => 'V', + 'Ⓦ' => 'W', + 'Ⓧ' => 'X', + 'Ⓨ' => 'Y', + 'Ⓩ' => 'Z', + 'ⓐ' => 'a', + 'ⓑ' => 'b', + 'ⓒ' => 'c', + 'ⓓ' => 'd', + 'ⓔ' => 'e', + 'ⓕ' => 'f', + 'ⓖ' => 'g', + 'ⓗ' => 'h', + 'ⓘ' => 'i', + 'ⓙ' => 'j', + 'ⓚ' => 'k', + 'ⓛ' => 'l', + 'ⓜ' => 'm', + 'ⓝ' => 'n', + 'ⓞ' => 'o', + 'ⓟ' => 'p', + 'ⓠ' => 'q', + 'ⓡ' => 'r', + 'ⓢ' => 's', + 'ⓣ' => 't', + 'ⓤ' => 'u', + 'ⓥ' => 'v', + 'ⓦ' => 'w', + 'ⓧ' => 'x', + 'ⓨ' => 'y', + 'ⓩ' => 'z', + '⓪' => '0', + '⨌' => '∫∫∫∫', + '⩴' => '::=', + '⩵' => '==', + '⩶' => '===', + 'ⱼ' => 'j', + 'ⱽ' => 'V', + 'ⵯ' => 'ⵡ', + '⺟' => '母', + '⻳' => '龟', + '⼀' => '一', + '⼁' => '丨', + '⼂' => '丶', + '⼃' => '丿', + '⼄' => '乙', + '⼅' => '亅', + '⼆' => '二', + '⼇' => '亠', + '⼈' => '人', + '⼉' => '儿', + '⼊' => '入', + '⼋' => '八', + '⼌' => '冂', + '⼍' => '冖', + '⼎' => '冫', + '⼏' => '几', + '⼐' => '凵', + '⼑' => '刀', + '⼒' => '力', + '⼓' => '勹', + '⼔' => '匕', + '⼕' => '匚', + '⼖' => '匸', + '⼗' => '十', + '⼘' => '卜', + '⼙' => '卩', + '⼚' => '厂', + '⼛' => '厶', + '⼜' => '又', + '⼝' => '口', + '⼞' => '囗', + '⼟' => '土', + '⼠' => '士', + '⼡' => '夂', + '⼢' => '夊', + '⼣' => '夕', + '⼤' => '大', + '⼥' => '女', + '⼦' => '子', + '⼧' => '宀', + '⼨' => '寸', + '⼩' => '小', + '⼪' => '尢', + '⼫' => '尸', + '⼬' => '屮', + '⼭' => '山', + '⼮' => '巛', + '⼯' => '工', + '⼰' => '己', + '⼱' => '巾', + '⼲' => '干', + '⼳' => '幺', + '⼴' => '广', + '⼵' => '廴', + '⼶' => '廾', + '⼷' => '弋', + '⼸' => '弓', + '⼹' => '彐', + '⼺' => '彡', + '⼻' => '彳', + '⼼' => '心', + '⼽' => '戈', + '⼾' => '戶', + '⼿' => '手', + '⽀' => '支', + '⽁' => '攴', + '⽂' => '文', + '⽃' => '斗', + '⽄' => '斤', + '⽅' => '方', + '⽆' => '无', + '⽇' => '日', + '⽈' => '曰', + '⽉' => '月', + '⽊' => '木', + '⽋' => '欠', + '⽌' => '止', + '⽍' => '歹', + '⽎' => '殳', + '⽏' => '毋', + '⽐' => '比', + '⽑' => '毛', + '⽒' => '氏', + '⽓' => '气', + '⽔' => '水', + '⽕' => '火', + '⽖' => '爪', + '⽗' => '父', + '⽘' => '爻', + '⽙' => '爿', + '⽚' => '片', + '⽛' => '牙', + '⽜' => '牛', + '⽝' => '犬', + '⽞' => '玄', + '⽟' => '玉', + '⽠' => '瓜', + '⽡' => '瓦', + '⽢' => '甘', + '⽣' => '生', + '⽤' => '用', + '⽥' => '田', + '⽦' => '疋', + '⽧' => '疒', + '⽨' => '癶', + '⽩' => '白', + '⽪' => '皮', + '⽫' => '皿', + '⽬' => '目', + '⽭' => '矛', + '⽮' => '矢', + '⽯' => '石', + '⽰' => '示', + '⽱' => '禸', + '⽲' => '禾', + '⽳' => '穴', + '⽴' => '立', + '⽵' => '竹', + '⽶' => '米', + '⽷' => '糸', + '⽸' => '缶', + '⽹' => '网', + '⽺' => '羊', + '⽻' => '羽', + '⽼' => '老', + '⽽' => '而', + '⽾' => '耒', + '⽿' => '耳', + '⾀' => '聿', + '⾁' => '肉', + '⾂' => '臣', + '⾃' => '自', + '⾄' => '至', + '⾅' => '臼', + '⾆' => '舌', + '⾇' => '舛', + '⾈' => '舟', + '⾉' => '艮', + '⾊' => '色', + '⾋' => '艸', + '⾌' => '虍', + '⾍' => '虫', + '⾎' => '血', + '⾏' => '行', + '⾐' => '衣', + '⾑' => '襾', + '⾒' => '見', + '⾓' => '角', + '⾔' => '言', + '⾕' => '谷', + '⾖' => '豆', + '⾗' => '豕', + '⾘' => '豸', + '⾙' => '貝', + '⾚' => '赤', + '⾛' => '走', + '⾜' => '足', + '⾝' => '身', + '⾞' => '車', + '⾟' => '辛', + '⾠' => '辰', + '⾡' => '辵', + '⾢' => '邑', + '⾣' => '酉', + '⾤' => '釆', + '⾥' => '里', + '⾦' => '金', + '⾧' => '長', + '⾨' => '門', + '⾩' => '阜', + '⾪' => '隶', + '⾫' => '隹', + '⾬' => '雨', + '⾭' => '靑', + '⾮' => '非', + '⾯' => '面', + '⾰' => '革', + '⾱' => '韋', + '⾲' => '韭', + '⾳' => '音', + '⾴' => '頁', + '⾵' => '風', + '⾶' => '飛', + '⾷' => '食', + '⾸' => '首', + '⾹' => '香', + '⾺' => '馬', + '⾻' => '骨', + '⾼' => '高', + '⾽' => '髟', + '⾾' => '鬥', + '⾿' => '鬯', + '⿀' => '鬲', + '⿁' => '鬼', + '⿂' => '魚', + '⿃' => '鳥', + '⿄' => '鹵', + '⿅' => '鹿', + '⿆' => '麥', + '⿇' => '麻', + '⿈' => '黃', + '⿉' => '黍', + '⿊' => '黑', + '⿋' => '黹', + '⿌' => '黽', + '⿍' => '鼎', + '⿎' => '鼓', + '⿏' => '鼠', + '⿐' => '鼻', + '⿑' => '齊', + '⿒' => '齒', + '⿓' => '龍', + '⿔' => '龜', + '⿕' => '龠', + ' ' => ' ', + '〶' => '〒', + '〸' => '十', + '〹' => '卄', + '〺' => '卅', + '゛' => ' ゙', + '゜' => ' ゚', + 'ゟ' => 'より', + 'ヿ' => 'コト', + 'ㄱ' => 'ᄀ', + 'ㄲ' => 'ᄁ', + 'ㄳ' => 'ᆪ', + 'ㄴ' => 'ᄂ', + 'ㄵ' => 'ᆬ', + 'ㄶ' => 'ᆭ', + 'ㄷ' => 'ᄃ', + 'ㄸ' => 'ᄄ', + 'ㄹ' => 'ᄅ', + 'ㄺ' => 'ᆰ', + 'ㄻ' => 'ᆱ', + 'ㄼ' => 'ᆲ', + 'ㄽ' => 'ᆳ', + 'ㄾ' => 'ᆴ', + 'ㄿ' => 'ᆵ', + 'ㅀ' => 'ᄚ', + 'ㅁ' => 'ᄆ', + 'ㅂ' => 'ᄇ', + 'ㅃ' => 'ᄈ', + 'ㅄ' => 'ᄡ', + 'ㅅ' => 'ᄉ', + 'ㅆ' => 'ᄊ', + 'ㅇ' => 'ᄋ', + 'ㅈ' => 'ᄌ', + 'ㅉ' => 'ᄍ', + 'ㅊ' => 'ᄎ', + 'ㅋ' => 'ᄏ', + 'ㅌ' => 'ᄐ', + 'ㅍ' => 'ᄑ', + 'ㅎ' => 'ᄒ', + 'ㅏ' => 'ᅡ', + 'ㅐ' => 'ᅢ', + 'ㅑ' => 'ᅣ', + 'ㅒ' => 'ᅤ', + 'ㅓ' => 'ᅥ', + 'ㅔ' => 'ᅦ', + 'ㅕ' => 'ᅧ', + 'ㅖ' => 'ᅨ', + 'ㅗ' => 'ᅩ', + 'ㅘ' => 'ᅪ', + 'ㅙ' => 'ᅫ', + 'ㅚ' => 'ᅬ', + 'ㅛ' => 'ᅭ', + 'ㅜ' => 'ᅮ', + 'ㅝ' => 'ᅯ', + 'ㅞ' => 'ᅰ', + 'ㅟ' => 'ᅱ', + 'ㅠ' => 'ᅲ', + 'ㅡ' => 'ᅳ', + 'ㅢ' => 'ᅴ', + 'ㅣ' => 'ᅵ', + 'ㅤ' => 'ᅠ', + 'ㅥ' => 'ᄔ', + 'ㅦ' => 'ᄕ', + 'ㅧ' => 'ᇇ', + 'ㅨ' => 'ᇈ', + 'ㅩ' => 'ᇌ', + 'ㅪ' => 'ᇎ', + 'ㅫ' => 'ᇓ', + 'ㅬ' => 'ᇗ', + 'ㅭ' => 'ᇙ', + 'ㅮ' => 'ᄜ', + 'ㅯ' => 'ᇝ', + 'ㅰ' => 'ᇟ', + 'ㅱ' => 'ᄝ', + 'ㅲ' => 'ᄞ', + 'ㅳ' => 'ᄠ', + 'ㅴ' => 'ᄢ', + 'ㅵ' => 'ᄣ', + 'ㅶ' => 'ᄧ', + 'ㅷ' => 'ᄩ', + 'ㅸ' => 'ᄫ', + 'ㅹ' => 'ᄬ', + 'ㅺ' => 'ᄭ', + 'ㅻ' => 'ᄮ', + 'ㅼ' => 'ᄯ', + 'ㅽ' => 'ᄲ', + 'ㅾ' => 'ᄶ', + 'ㅿ' => 'ᅀ', + 'ㆀ' => 'ᅇ', + 'ㆁ' => 'ᅌ', + 'ㆂ' => 'ᇱ', + 'ㆃ' => 'ᇲ', + 'ㆄ' => 'ᅗ', + 'ㆅ' => 'ᅘ', + 'ㆆ' => 'ᅙ', + 'ㆇ' => 'ᆄ', + 'ㆈ' => 'ᆅ', + 'ㆉ' => 'ᆈ', + 'ㆊ' => 'ᆑ', + 'ㆋ' => 'ᆒ', + 'ㆌ' => 'ᆔ', + 'ㆍ' => 'ᆞ', + 'ㆎ' => 'ᆡ', + '㆒' => '一', + '㆓' => '二', + '㆔' => '三', + '㆕' => '四', + '㆖' => '上', + '㆗' => '中', + '㆘' => '下', + '㆙' => '甲', + '㆚' => '乙', + '㆛' => '丙', + '㆜' => '丁', + '㆝' => '天', + '㆞' => '地', + '㆟' => '人', + '㈀' => '(ᄀ)', + '㈁' => '(ᄂ)', + '㈂' => '(ᄃ)', + '㈃' => '(ᄅ)', + '㈄' => '(ᄆ)', + '㈅' => '(ᄇ)', + '㈆' => '(ᄉ)', + '㈇' => '(ᄋ)', + '㈈' => '(ᄌ)', + '㈉' => '(ᄎ)', + '㈊' => '(ᄏ)', + '㈋' => '(ᄐ)', + '㈌' => '(ᄑ)', + '㈍' => '(ᄒ)', + '㈎' => '(가)', + '㈏' => '(나)', + '㈐' => '(다)', + '㈑' => '(라)', + '㈒' => '(마)', + '㈓' => '(바)', + '㈔' => '(사)', + '㈕' => '(아)', + '㈖' => '(자)', + '㈗' => '(차)', + '㈘' => '(카)', + '㈙' => '(타)', + '㈚' => '(파)', + '㈛' => '(하)', + '㈜' => '(주)', + '㈝' => '(오전)', + '㈞' => '(오후)', + '㈠' => '(一)', + '㈡' => '(二)', + '㈢' => '(三)', + '㈣' => '(四)', + '㈤' => '(五)', + '㈥' => '(六)', + '㈦' => '(七)', + '㈧' => '(八)', + '㈨' => '(九)', + '㈩' => '(十)', + '㈪' => '(月)', + '㈫' => '(火)', + '㈬' => '(水)', + '㈭' => '(木)', + '㈮' => '(金)', + '㈯' => '(土)', + '㈰' => '(日)', + '㈱' => '(株)', + '㈲' => '(有)', + '㈳' => '(社)', + '㈴' => '(名)', + '㈵' => '(特)', + '㈶' => '(財)', + '㈷' => '(祝)', + '㈸' => '(労)', + '㈹' => '(代)', + '㈺' => '(呼)', + '㈻' => '(学)', + '㈼' => '(監)', + '㈽' => '(企)', + '㈾' => '(資)', + '㈿' => '(協)', + '㉀' => '(祭)', + '㉁' => '(休)', + '㉂' => '(自)', + '㉃' => '(至)', + '㉄' => '問', + '㉅' => '幼', + '㉆' => '文', + '㉇' => '箏', + '㉐' => 'PTE', + '㉑' => '21', + '㉒' => '22', + '㉓' => '23', + '㉔' => '24', + '㉕' => '25', + '㉖' => '26', + '㉗' => '27', + '㉘' => '28', + '㉙' => '29', + '㉚' => '30', + '㉛' => '31', + '㉜' => '32', + '㉝' => '33', + '㉞' => '34', + '㉟' => '35', + '㉠' => 'ᄀ', + '㉡' => 'ᄂ', + '㉢' => 'ᄃ', + '㉣' => 'ᄅ', + '㉤' => 'ᄆ', + '㉥' => 'ᄇ', + '㉦' => 'ᄉ', + '㉧' => 'ᄋ', + '㉨' => 'ᄌ', + '㉩' => 'ᄎ', + '㉪' => 'ᄏ', + '㉫' => 'ᄐ', + '㉬' => 'ᄑ', + '㉭' => 'ᄒ', + '㉮' => '가', + '㉯' => '나', + '㉰' => '다', + '㉱' => '라', + '㉲' => '마', + '㉳' => '바', + '㉴' => '사', + '㉵' => '아', + '㉶' => '자', + '㉷' => '차', + '㉸' => '카', + '㉹' => '타', + '㉺' => '파', + '㉻' => '하', + '㉼' => '참고', + '㉽' => '주의', + '㉾' => '우', + '㊀' => '一', + '㊁' => '二', + '㊂' => '三', + '㊃' => '四', + '㊄' => '五', + '㊅' => '六', + '㊆' => '七', + '㊇' => '八', + '㊈' => '九', + '㊉' => '十', + '㊊' => '月', + '㊋' => '火', + '㊌' => '水', + '㊍' => '木', + '㊎' => '金', + '㊏' => '土', + '㊐' => '日', + '㊑' => '株', + '㊒' => '有', + '㊓' => '社', + '㊔' => '名', + '㊕' => '特', + '㊖' => '財', + '㊗' => '祝', + '㊘' => '労', + '㊙' => '秘', + '㊚' => '男', + '㊛' => '女', + '㊜' => '適', + '㊝' => '優', + '㊞' => '印', + '㊟' => '注', + '㊠' => '項', + '㊡' => '休', + '㊢' => '写', + '㊣' => '正', + '㊤' => '上', + '㊥' => '中', + '㊦' => '下', + '㊧' => '左', + '㊨' => '右', + '㊩' => '医', + '㊪' => '宗', + '㊫' => '学', + '㊬' => '監', + '㊭' => '企', + '㊮' => '資', + '㊯' => '協', + '㊰' => '夜', + '㊱' => '36', + '㊲' => '37', + '㊳' => '38', + '㊴' => '39', + '㊵' => '40', + '㊶' => '41', + '㊷' => '42', + '㊸' => '43', + '㊹' => '44', + '㊺' => '45', + '㊻' => '46', + '㊼' => '47', + '㊽' => '48', + '㊾' => '49', + '㊿' => '50', + '㋀' => '1月', + '㋁' => '2月', + '㋂' => '3月', + '㋃' => '4月', + '㋄' => '5月', + '㋅' => '6月', + '㋆' => '7月', + '㋇' => '8月', + '㋈' => '9月', + '㋉' => '10月', + '㋊' => '11月', + '㋋' => '12月', + '㋌' => 'Hg', + '㋍' => 'erg', + '㋎' => 'eV', + '㋏' => 'LTD', + '㋐' => 'ア', + '㋑' => 'イ', + '㋒' => 'ウ', + '㋓' => 'エ', + '㋔' => 'オ', + '㋕' => 'カ', + '㋖' => 'キ', + '㋗' => 'ク', + '㋘' => 'ケ', + '㋙' => 'コ', + '㋚' => 'サ', + '㋛' => 'シ', + '㋜' => 'ス', + '㋝' => 'セ', + '㋞' => 'ソ', + '㋟' => 'タ', + '㋠' => 'チ', + '㋡' => 'ツ', + '㋢' => 'テ', + '㋣' => 'ト', + '㋤' => 'ナ', + '㋥' => 'ニ', + '㋦' => 'ヌ', + '㋧' => 'ネ', + '㋨' => 'ノ', + '㋩' => 'ハ', + '㋪' => 'ヒ', + '㋫' => 'フ', + '㋬' => 'ヘ', + '㋭' => 'ホ', + '㋮' => 'マ', + '㋯' => 'ミ', + '㋰' => 'ム', + '㋱' => 'メ', + '㋲' => 'モ', + '㋳' => 'ヤ', + '㋴' => 'ユ', + '㋵' => 'ヨ', + '㋶' => 'ラ', + '㋷' => 'リ', + '㋸' => 'ル', + '㋹' => 'レ', + '㋺' => 'ロ', + '㋻' => 'ワ', + '㋼' => 'ヰ', + '㋽' => 'ヱ', + '㋾' => 'ヲ', + '㋿' => '令和', + '㌀' => 'アパート', + '㌁' => 'アルファ', + '㌂' => 'アンペア', + '㌃' => 'アール', + '㌄' => 'イニング', + '㌅' => 'インチ', + '㌆' => 'ウォン', + '㌇' => 'エスクード', + '㌈' => 'エーカー', + '㌉' => 'オンス', + '㌊' => 'オーム', + '㌋' => 'カイリ', + '㌌' => 'カラット', + '㌍' => 'カロリー', + '㌎' => 'ガロン', + '㌏' => 'ガンマ', + '㌐' => 'ギガ', + '㌑' => 'ギニー', + '㌒' => 'キュリー', + '㌓' => 'ギルダー', + '㌔' => 'キロ', + '㌕' => 'キログラム', + '㌖' => 'キロメートル', + '㌗' => 'キロワット', + '㌘' => 'グラム', + '㌙' => 'グラムトン', + '㌚' => 'クルゼイロ', + '㌛' => 'クローネ', + '㌜' => 'ケース', + '㌝' => 'コルナ', + '㌞' => 'コーポ', + '㌟' => 'サイクル', + '㌠' => 'サンチーム', + '㌡' => 'シリング', + '㌢' => 'センチ', + '㌣' => 'セント', + '㌤' => 'ダース', + '㌥' => 'デシ', + '㌦' => 'ドル', + '㌧' => 'トン', + '㌨' => 'ナノ', + '㌩' => 'ノット', + '㌪' => 'ハイツ', + '㌫' => 'パーセント', + '㌬' => 'パーツ', + '㌭' => 'バーレル', + '㌮' => 'ピアストル', + '㌯' => 'ピクル', + '㌰' => 'ピコ', + '㌱' => 'ビル', + '㌲' => 'ファラッド', + '㌳' => 'フィート', + '㌴' => 'ブッシェル', + '㌵' => 'フラン', + '㌶' => 'ヘクタール', + '㌷' => 'ペソ', + '㌸' => 'ペニヒ', + '㌹' => 'ヘルツ', + '㌺' => 'ペンス', + '㌻' => 'ページ', + '㌼' => 'ベータ', + '㌽' => 'ポイント', + '㌾' => 'ボルト', + '㌿' => 'ホン', + '㍀' => 'ポンド', + '㍁' => 'ホール', + '㍂' => 'ホーン', + '㍃' => 'マイクロ', + '㍄' => 'マイル', + '㍅' => 'マッハ', + '㍆' => 'マルク', + '㍇' => 'マンション', + '㍈' => 'ミクロン', + '㍉' => 'ミリ', + '㍊' => 'ミリバール', + '㍋' => 'メガ', + '㍌' => 'メガトン', + '㍍' => 'メートル', + '㍎' => 'ヤード', + '㍏' => 'ヤール', + '㍐' => 'ユアン', + '㍑' => 'リットル', + '㍒' => 'リラ', + '㍓' => 'ルピー', + '㍔' => 'ルーブル', + '㍕' => 'レム', + '㍖' => 'レントゲン', + '㍗' => 'ワット', + '㍘' => '0点', + '㍙' => '1点', + '㍚' => '2点', + '㍛' => '3点', + '㍜' => '4点', + '㍝' => '5点', + '㍞' => '6点', + '㍟' => '7点', + '㍠' => '8点', + '㍡' => '9点', + '㍢' => '10点', + '㍣' => '11点', + '㍤' => '12点', + '㍥' => '13点', + '㍦' => '14点', + '㍧' => '15点', + '㍨' => '16点', + '㍩' => '17点', + '㍪' => '18点', + '㍫' => '19点', + '㍬' => '20点', + '㍭' => '21点', + '㍮' => '22点', + '㍯' => '23点', + '㍰' => '24点', + '㍱' => 'hPa', + '㍲' => 'da', + '㍳' => 'AU', + '㍴' => 'bar', + '㍵' => 'oV', + '㍶' => 'pc', + '㍷' => 'dm', + '㍸' => 'dm2', + '㍹' => 'dm3', + '㍺' => 'IU', + '㍻' => '平成', + '㍼' => '昭和', + '㍽' => '大正', + '㍾' => '明治', + '㍿' => '株式会社', + '㎀' => 'pA', + '㎁' => 'nA', + '㎂' => 'μA', + '㎃' => 'mA', + '㎄' => 'kA', + '㎅' => 'KB', + '㎆' => 'MB', + '㎇' => 'GB', + '㎈' => 'cal', + '㎉' => 'kcal', + '㎊' => 'pF', + '㎋' => 'nF', + '㎌' => 'μF', + '㎍' => 'μg', + '㎎' => 'mg', + '㎏' => 'kg', + '㎐' => 'Hz', + '㎑' => 'kHz', + '㎒' => 'MHz', + '㎓' => 'GHz', + '㎔' => 'THz', + '㎕' => 'μl', + '㎖' => 'ml', + '㎗' => 'dl', + '㎘' => 'kl', + '㎙' => 'fm', + '㎚' => 'nm', + '㎛' => 'μm', + '㎜' => 'mm', + '㎝' => 'cm', + '㎞' => 'km', + '㎟' => 'mm2', + '㎠' => 'cm2', + '㎡' => 'm2', + '㎢' => 'km2', + '㎣' => 'mm3', + '㎤' => 'cm3', + '㎥' => 'm3', + '㎦' => 'km3', + '㎧' => 'm∕s', + '㎨' => 'm∕s2', + '㎩' => 'Pa', + '㎪' => 'kPa', + '㎫' => 'MPa', + '㎬' => 'GPa', + '㎭' => 'rad', + '㎮' => 'rad∕s', + '㎯' => 'rad∕s2', + '㎰' => 'ps', + '㎱' => 'ns', + '㎲' => 'μs', + '㎳' => 'ms', + '㎴' => 'pV', + '㎵' => 'nV', + '㎶' => 'μV', + '㎷' => 'mV', + '㎸' => 'kV', + '㎹' => 'MV', + '㎺' => 'pW', + '㎻' => 'nW', + '㎼' => 'μW', + '㎽' => 'mW', + '㎾' => 'kW', + '㎿' => 'MW', + '㏀' => 'kΩ', + '㏁' => 'MΩ', + '㏂' => 'a.m.', + '㏃' => 'Bq', + '㏄' => 'cc', + '㏅' => 'cd', + '㏆' => 'C∕kg', + '㏇' => 'Co.', + '㏈' => 'dB', + '㏉' => 'Gy', + '㏊' => 'ha', + '㏋' => 'HP', + '㏌' => 'in', + '㏍' => 'KK', + '㏎' => 'KM', + '㏏' => 'kt', + '㏐' => 'lm', + '㏑' => 'ln', + '㏒' => 'log', + '㏓' => 'lx', + '㏔' => 'mb', + '㏕' => 'mil', + '㏖' => 'mol', + '㏗' => 'PH', + '㏘' => 'p.m.', + '㏙' => 'PPM', + '㏚' => 'PR', + '㏛' => 'sr', + '㏜' => 'Sv', + '㏝' => 'Wb', + '㏞' => 'V∕m', + '㏟' => 'A∕m', + '㏠' => '1日', + '㏡' => '2日', + '㏢' => '3日', + '㏣' => '4日', + '㏤' => '5日', + '㏥' => '6日', + '㏦' => '7日', + '㏧' => '8日', + '㏨' => '9日', + '㏩' => '10日', + '㏪' => '11日', + '㏫' => '12日', + '㏬' => '13日', + '㏭' => '14日', + '㏮' => '15日', + '㏯' => '16日', + '㏰' => '17日', + '㏱' => '18日', + '㏲' => '19日', + '㏳' => '20日', + '㏴' => '21日', + '㏵' => '22日', + '㏶' => '23日', + '㏷' => '24日', + '㏸' => '25日', + '㏹' => '26日', + '㏺' => '27日', + '㏻' => '28日', + '㏼' => '29日', + '㏽' => '30日', + '㏾' => '31日', + '㏿' => 'gal', + 'ꚜ' => 'ъ', + 'ꚝ' => 'ь', + 'ꝰ' => 'ꝯ', + 'ꟸ' => 'Ħ', + 'ꟹ' => 'œ', + 'ꭜ' => 'ꜧ', + 'ꭝ' => 'ꬷ', + 'ꭞ' => 'ɫ', + 'ꭟ' => 'ꭒ', + 'ꭩ' => 'ʍ', + 'ff' => 'ff', + 'fi' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'մն', + 'ﬔ' => 'մե', + 'ﬕ' => 'մի', + 'ﬖ'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'ۅ', + 'ﯢ' => 'ۉ', + 'ﯣ' => 'ۉ', + 'ﯤ' => 'ې', + 'ﯥ' => 'ې', + 'ﯦ' => 'ې', + 'ﯧ' => 'ې', + 'ﯨ' => 'ى', + 'ﯩ' => 'ى', + 'ﯪ' => 'ئا', + 'ﯫ' => 'ئا', + 'ﯬ' => 'ئە', + 'ﯭ' => 'ئە', + 'ﯮ' => 'ئو', + 'ﯯ' => 'ئو', + 'ﯰ' => 'ئۇ', + 'ﯱ' => 'ئۇ', + 'ﯲ' => 'ئۆ', + 'ﯳ' => 'ئۆ', + 'ﯴ' => 'ئۈ', + 'ﯵ' => 'ئۈ', + 'ﯶ' => 'ئې', + 'ﯷ' => 'ئې', + 'ﯸ' => 'ئې', + 'ﯹ' => 'ئى', + 'ﯺ' => 'ئى', + 'ﯻ' => 'ئى', + 'ﯼ' => 'ی', + 'ﯽ' => 'ی', + 'ﯾ' => 'ی', + 'ﯿ' => 'ی', + 'ﰀ' => 'ئج', + 'ﰁ' => 'ئح', + 'ﰂ' => 'ئم', + 'ﰃ' => 'ئى', + 'ﰄ' => 'ئي', + 'ﰅ' => 'بج', + 'ﰆ' => 'بح', + 'ﰇ' => 'بخ', + 'ﰈ' => 'بم', + 'ﰉ' => 'بى', + 'ﰊ' => 'بي', + 'ﰋ' => 'تج', + 'ﰌ' => 'تح', + 'ﰍ' => 'تخ', + 'ﰎ' => 'تم', + 'ﰏ' => 'تى', + 'ﰐ' => 'تي', + 'ﰑ' => 'ثج', + 'ﰒ' => 'ثم', + 'ﰓ' => 'ثى', + 'ﰔ' => 'ثي', + 'ﰕ' => 'جح', + 'ﰖ' => 'جم', + 'ﰗ' => 'حج', + 'ﰘ' => 'حم', + 'ﰙ' => 'خج', + 'ﰚ' => 'خح', + 'ﰛ' => 'خم', + 'ﰜ' => 'سج', + 'ﰝ' => 'سح', + 'ﰞ' => 'سخ', + 'ﰟ' => 'سم', + 'ﰠ' => 'صح', + 'ﰡ' => 'صم', + 'ﰢ' => 'ضج', + 'ﰣ' => 'ضح', + 'ﰤ' => 'ضخ', + 'ﰥ' => 'ضم', + 'ﰦ' => 'طح', + 'ﰧ' => 'طم', + 'ﰨ' => 'ظم', + 'ﰩ' => 'عج', + 'ﰪ' => 'عم', + 'ﰫ' => 'غج', + 'ﰬ' => 'غم', + 'ﰭ' => 'فج', + 'ﰮ' => 'فح', + 'ﰯ' => 'فخ', + 'ﰰ' => 'فم', + 'ﰱ' => 'فى', + 'ﰲ' => 'في', + 'ﰳ' => 'قح', + 'ﰴ' => 'قم', + 'ﰵ' => 'قى', + 'ﰶ' => 'قي', + 'ﰷ' => 'كا', + 'ﰸ' => 'كج', + 'ﰹ' => 'كح', + 'ﰺ' => 'كخ', + 'ﰻ' => 'كل', + 'ﰼ' => 'كم', + 'ﰽ' => 'كى', + 'ﰾ' => 'كي', + 'ﰿ' => 'لج', + 'ﱀ' => 'لح', + 'ﱁ' => 'لخ', + 'ﱂ' => 'لم', + 'ﱃ' => 'لى', + 'ﱄ' => 'لي', + 'ﱅ' => 'مج', + 'ﱆ' => 'مح', + 'ﱇ' => 'مخ', + 'ﱈ' => 'مم', + 'ﱉ' => 'مى', + 'ﱊ' => 'مي', + 'ﱋ' => 'نج', + 'ﱌ' => 'نح', + 'ﱍ' => 'نخ', + 'ﱎ' => 'نم', + 'ﱏ' => 'نى', + 'ﱐ' => 'ني', + 'ﱑ' => 'هج', + 'ﱒ' => 'هم', + 'ﱓ' => 'هى', + 'ﱔ' => 'هي', + 'ﱕ' => 'يج', + 'ﱖ' => 'يح', + 'ﱗ' => 'يخ', + 'ﱘ' => 'يم', + 'ﱙ' => 'يى', + 'ﱚ' => 'يي', + 'ﱛ' => 'ذٰ', + 'ﱜ' => 'رٰ', + 'ﱝ' => 'ىٰ', + 'ﱞ' => ' ٌّ', + 'ﱟ' => ' ٍّ', + 'ﱠ' => ' َّ', + 'ﱡ' => ' ُّ', + 'ﱢ' => ' ِّ', + 'ﱣ' => ' ّٰ', + 'ﱤ' => 'ئر', + 'ﱥ' => 'ئز', + 'ﱦ' => 'ئم', + 'ﱧ' => 'ئن', + 'ﱨ' => 'ئى', + 'ﱩ' => 'ئي', + 'ﱪ' => 'بر', + 'ﱫ' => 'بز', + 'ﱬ' => 'بم', + 'ﱭ' => 'بن', + 'ﱮ' => 'بى', + 'ﱯ' => 'بي', + 'ﱰ' => 'تر', + 'ﱱ' => 'تز', + 'ﱲ' => 'تم', + 'ﱳ' => 'تن', + 'ﱴ' => 'تى', + 'ﱵ' => 'تي', + 'ﱶ' => 'ثر', + 'ﱷ' => 'ثز', + 'ﱸ' => 'ثم', + 'ﱹ' => 'ثن', + 'ﱺ' => 'ثى', + 'ﱻ' => 'ثي', + 'ﱼ' => 'فى', + 'ﱽ' => 'في', + 'ﱾ' => 'قى', + 'ﱿ' => 'قي', + 'ﲀ' => 'كا', + 'ﲁ' => 'كل', + 'ﲂ' => 'كم', + 'ﲃ' => 'كى', + 'ﲄ' => 'كي', + 'ﲅ' => 'لم', + 'ﲆ' => 'لى', + 'ﲇ' => 'لي', + 'ﲈ' => 'ما', + 'ﲉ' => 'مم', + 'ﲊ' => 'نر', + 'ﲋ' => 'نز', + 'ﲌ' => 'نم', + 'ﲍ' => 'نن', + 'ﲎ' => 'نى', + 'ﲏ' => 'ني', + 'ﲐ' => 'ىٰ', + 'ﲑ' => 'ير', + 'ﲒ' => 'يز', + 'ﲓ' => 'يم', + 'ﲔ' => 'ين', + 'ﲕ' => 'يى', + 'ﲖ' => 'يي', + 'ﲗ' => 'ئج', + 'ﲘ' => 'ئح', + 'ﲙ' => 'ئخ', + 'ﲚ' => 'ئم', + 'ﲛ' => 'ئه', + 'ﲜ' => 'بج', + 'ﲝ' => 'بح', + 'ﲞ' => 'بخ', + 'ﲟ' => 'بم', + 'ﲠ' => 'به', + 'ﲡ' => 'تج', + 'ﲢ' => 'تح', + 'ﲣ' => 'تخ', + 'ﲤ' => 'تم', + 'ﲥ' => 'ته', + 'ﲦ' => 'ثم', + 'ﲧ' => 'جح', + 'ﲨ' => 'جم', + 'ﲩ' => 'حج', + 'ﲪ' => 'حم', + 'ﲫ' => 'خج', + 'ﲬ' => 'خم', + 'ﲭ' => 'سج', + 'ﲮ' => 'سح', + 'ﲯ' => 'سخ', + 'ﲰ' => 'سم', + 'ﲱ' => 'صح', + 'ﲲ' => 'صخ', + 'ﲳ' => 'صم', + 'ﲴ' => 'ضج', + 'ﲵ' => 'ضح', + 'ﲶ' => 'ضخ', + 'ﲷ' => 'ضم', + 'ﲸ' => 'طح', + 'ﲹ' => 'ظم', + 'ﲺ' => 'عج', + 'ﲻ' => 'عم', + 'ﲼ' => 'غج', + 'ﲽ' => 'غم', + 'ﲾ' => 'فج', + 'ﲿ' => 'فح', + 'ﳀ' => 'فخ', + 'ﳁ' => 'فم', + 'ﳂ' => 'قح', + 'ﳃ' => 'قم', + 'ﳄ' => 'كج', + 'ﳅ' => 'كح', + 'ﳆ' => 'كخ', + 'ﳇ' => 'كل', + 'ﳈ' => 'كم', + 'ﳉ' => 'لج', + 'ﳊ' => 'لح', + 'ﳋ' => 'لخ', + 'ﳌ' => 'لم', + 'ﳍ' => 'له', + 'ﳎ' => 'مج', + 'ﳏ' => 'مح', + 'ﳐ' => 'مخ', + 'ﳑ' => 'مم', + 'ﳒ' => 'نج', + 'ﳓ' => 'نح', + 'ﳔ' => 'نخ', + 'ﳕ' => 'نم', + 'ﳖ' => 'نه', + 'ﳗ' => 'هج', + 'ﳘ' => 'هم', + 'ﳙ' => 'هٰ', + 'ﳚ' => 'يج', + 'ﳛ' => 'يح', + 'ﳜ' => 'يخ', + 'ﳝ' => 'يم', + 'ﳞ' => 'يه', + 'ﳟ' => 'ئم', + 'ﳠ' => 'ئه', + 'ﳡ' => 'بم', + 'ﳢ' => 'به', + 'ﳣ' => 'تم', + 'ﳤ' => 'ته', + 'ﳥ' => 'ثم', + 'ﳦ' => 'ثه', + 'ﳧ' => 'سم', + 'ﳨ' => 'سه', + 'ﳩ' => 'شم', + 'ﳪ' => 'شه', + 'ﳫ' => 'كل', + 'ﳬ' => 'كم', + 'ﳭ' => 'لم', + 'ﳮ' => 'نم', + 'ﳯ' => 'نه', + 'ﳰ' => 'يم', + 'ﳱ' => 'يه', + 'ﳲ' => 'ـَّ', + 'ﳳ' => 'ـُّ', + 'ﳴ' => 'ـِّ', + 'ﳵ' => 'طى', + 'ﳶ' => 'طي', + 'ﳷ' => 'عى', + 'ﳸ' => 'عي', + 'ﳹ' => 'غى', + 'ﳺ' => 'غي', + 'ﳻ' => 'سى', + 'ﳼ' => 'سي', + 'ﳽ' => 'شى', + 'ﳾ' => 'شي', + 'ﳿ' => 'حى', + 'ﴀ' => 'حي', + 'ﴁ' => 'جى', + 'ﴂ' => 'جي', + 'ﴃ' => 'خى', + 'ﴄ' => 'خي', + 'ﴅ' => 'صى', + 'ﴆ' => 'صي', + 'ﴇ' => 'ضى', + 'ﴈ' => 'ضي', + 'ﴉ' => 'شج', + 'ﴊ' => 'شح', + 'ﴋ' => 'شخ', + 'ﴌ' => 'شم', + 'ﴍ' => 'شر', + 'ﴎ' => 'سر', + 'ﴏ' => 'صر', + 'ﴐ' => 'ضر', + 'ﴑ' => 'طى', + 'ﴒ' => 'طي', + 'ﴓ' => 'عى', + 'ﴔ' => 'عي', + 'ﴕ' => 'غى', + 'ﴖ' => 'غي', + 'ﴗ' => 'سى', + 'ﴘ' => 'سي', + 'ﴙ' => 'شى', + 'ﴚ' => 'شي', + 'ﴛ' => 'حى', + 'ﴜ' => 'حي', + 'ﴝ' => 'جى', + 'ﴞ' => 'جي', + 'ﴟ' => 'خى', + 'ﴠ' => 'خي', + 'ﴡ' => 'صى', + 'ﴢ' => 'صي', + 'ﴣ' => 'ضى', + 'ﴤ' => 'ضي', + 'ﴥ' => 'شج', + 'ﴦ' => 'شح', + 'ﴧ' => 'شخ', + 'ﴨ' => 'شم', + 'ﴩ' => 'شر', + 'ﴪ' => 'سر', + 'ﴫ' => 'صر', + 'ﴬ' => 'ضر', + 'ﴭ' => 'شج', + 'ﴮ' => 'شح', + 'ﴯ' => 'شخ', + 'ﴰ' => 'شم', + 'ﴱ' => 'سه', + 'ﴲ' => 'شه', + 'ﴳ' => 'طم', + 'ﴴ' => 'سج', + 'ﴵ' => 'سح', + 'ﴶ' => 'سخ', + 'ﴷ' => 'شج', + 'ﴸ' => 'شح', + 'ﴹ' => 'شخ', + 'ﴺ' => 'طم', + 'ﴻ' => 'ظم', + 'ﴼ' => 'اً', + 'ﴽ' => 'اً', + 'ﵐ' => 'تجم', + 'ﵑ' => 'تحج', + 'ﵒ' => 'تحج', + 'ﵓ' => 'تحم', + 'ﵔ' => 'تخم', + 'ﵕ' => 'تمج', + 'ﵖ' => 'تمح', + 'ﵗ' => 'تمخ', + 'ﵘ' => 'جمح', + 'ﵙ' => 'جمح', + 'ﵚ' => 'حمي', + 'ﵛ' => 'حمى', + 'ﵜ' => 'سحج', + 'ﵝ' => 'سجح', + 'ﵞ' => 'سجى', + 'ﵟ' => 'سمح', + 'ﵠ' => 'سمح', + 'ﵡ' => 'سمج', + 'ﵢ' => 'سمم', + 'ﵣ' => 'سمم', + 'ﵤ' => 'صحح', + 'ﵥ' => 'صحح', + 'ﵦ' => 'صمم', + 'ﵧ' => 'شحم', + 'ﵨ' => 'شحم', + 'ﵩ' => 'شجي', + 'ﵪ' => 'شمخ', + 'ﵫ' => 'شمخ', + 'ﵬ' => 'شمم', + 'ﵭ' => 'شمم', + 'ﵮ' => 'ضحى', + 'ﵯ' => 'ضخم', + 'ﵰ' => 'ضخم', + 'ﵱ' => 'طمح', + 'ﵲ' => 'طمح', + 'ﵳ' => 'طمم', + 'ﵴ' => 'طمي', + 'ﵵ' => 'عجم', + 'ﵶ' => 'عمم', + 'ﵷ' => 'عمم', + 'ﵸ' => 'عمى', + 'ﵹ' => 'غمم', + 'ﵺ' => 'غمي', + 'ﵻ' => 'غمى', + 'ﵼ' => 'فخم', + 'ﵽ' => 'فخم', + 'ﵾ' => 'قمح', + 'ﵿ' => 'قمم', + 'ﶀ' => 'لحم', + 'ﶁ' => 'لحي', + 'ﶂ' => 'لحى', + 'ﶃ' => 'لجج', + 'ﶄ' => 'لجج', + 'ﶅ' => 'لخم', + 'ﶆ' => 'لخم', + 'ﶇ' => 'لمح', + 'ﶈ' => 'لمح', + 'ﶉ' => 'محج', + 'ﶊ' => 'محم', + 'ﶋ' => 'محي', + 'ﶌ' => 'مجح', + 'ﶍ' => 'مجم', + 'ﶎ' => 'مخج', + 'ﶏ' => 'مخم', + 'ﶒ' => 'مجخ', + 'ﶓ' => 'همج', + 'ﶔ' => 'همم', + 'ﶕ' => 'نحم', + 'ﶖ' => 'نحى', + 'ﶗ' => 'نجم', + 'ﶘ' => 'نجم', + 'ﶙ' => 'نجى', + 'ﶚ' => 'نمي', + 'ﶛ' => 'نمى', + 'ﶜ' => 'يمم', + 'ﶝ' => 'يمم', + 'ﶞ' => 'بخي', + 'ﶟ' => 'تجي', + 'ﶠ' => 'تجى', + 'ﶡ' => 'تخي', + 'ﶢ' => 'تخى', + 'ﶣ' => 'تمي', + 'ﶤ' => 'تمى', + 'ﶥ' => 'جمي', + 'ﶦ' => 'جحى', + 'ﶧ' => 'جمى', + 'ﶨ' => 'سخى', + 'ﶩ' => 'صحي', + 'ﶪ' => 'شحي', + 'ﶫ' => 'ضحي', + 'ﶬ' => 'لجي', + 'ﶭ' => 'لمي', + 'ﶮ' => 'يحي', + 'ﶯ' => 'يجي', + 'ﶰ' => 'يمي', + 'ﶱ' => 'ممي', + 'ﶲ' => 'قمي', + 'ﶳ' => 'نحي', + 'ﶴ' => 'قمح', + 'ﶵ' => 'لحم', + 'ﶶ' => 'عمي', + 'ﶷ' => 'كمي', + 'ﶸ' => 'نجح', + 'ﶹ' => 'مخي', + 'ﶺ' => 'لجم', + 'ﶻ' => 'كمم', + 'ﶼ' => 'لجم', + 'ﶽ' => 'نجح', + 'ﶾ' => 'جحي', + 'ﶿ' => 'حجي', + 'ﷀ' => 'مجي', + 'ﷁ' => 'فمي', + 'ﷂ' => 'بحي', + 'ﷃ' => 'كمم', + 'ﷄ' => 'عجم', + 'ﷅ' => 'صمم', + 'ﷆ' => 'سخي', + 'ﷇ' => 'نجي', + 'ﷰ' => 'صلے', + 'ﷱ' => 'قلے', + 'ﷲ' => 'الله', + 'ﷳ' => 'اكبر', + 'ﷴ' => 'محمد', + 'ﷵ' => 'صلعم', + 'ﷶ' => 'رسول', + 'ﷷ' => 'عليه', + 'ﷸ' => 'وسلم', + 'ﷹ' => 'صلى', + 'ﷺ' => 'صلى الله عليه وسلم', + 'ﷻ' => 'جل جلاله', + '﷼' => 'ریال', + '︐' => ',', + '︑' => '、', + '︒' => '。', + '︓' => ':', + '︔' => ';', + '︕' => '!', + '︖' => '?', + '︗' => '〖', + '︘' => '〗', + '︙' => '...', + '︰' => '..', + '︱' => '—', + '︲' => '–', + '︳' => '_', + '︴' => '_', + '︵' => '(', + '︶' => ')', + '︷' => '{', + '︸' => '}', + '︹' => '〔', + '︺' => '〕', + '︻' => '【', + '︼' => '】', + '︽' => '《', + '︾' => '》', + '︿' => '〈', + '﹀' => '〉', + '﹁' => '「', + '﹂' => '」', + '﹃' => '『', + '﹄' => '』', + '﹇' => '[', + '﹈' => ']', + '﹉' => ' ̅', + '﹊' => ' ̅', + '﹋' => ' ̅', + '﹌' => ' ̅', + '﹍' => '_', + '﹎' => '_', + '﹏' => '_', + '﹐' => ',', + '﹑' => '、', + '﹒' => '.', + '﹔' => ';', + '﹕' => ':', + '﹖' => '?', + '﹗' => '!', + '﹘' => '—', + '﹙' => '(', + '﹚' => ')', + '﹛' => '{', + '﹜' => '}', + '﹝' => '〔', + '﹞' => '〕', + '﹟' => '#', + '﹠' => '&', + '﹡' => '*', + '﹢' => '+', + '﹣' => '-', + '﹤' => '<', + '﹥' => '>', + '﹦' => '=', + '﹨' => '\\', + '﹩' => '$', + '﹪' => '%', + '﹫' => '@', + 'ﹰ' => ' ً', + 'ﹱ' => 'ـً', + 'ﹲ' => ' ٌ', + 'ﹴ' => ' ٍ', + 'ﹶ' => ' َ', + 'ﹷ' => 'ـَ', + 'ﹸ' => ' ُ', + 'ﹹ' => 'ـُ', + 'ﹺ' => ' ِ', + 'ﹻ' => 'ـِ', + 'ﹼ' => ' ّ', + 'ﹽ' => 'ـّ', + 'ﹾ' => ' ْ', + 'ﹿ' => 'ـْ', + 'ﺀ' => 'ء', + 'ﺁ' => 'آ', + 'ﺂ' => 'آ', + 'ﺃ' => 'أ', + 'ﺄ' => 'أ', + 'ﺅ' => 'ؤ', + 'ﺆ' => 'ؤ', + 'ﺇ' => 'إ', + 'ﺈ' => 'إ', + 'ﺉ' => 'ئ', + 'ﺊ' => 'ئ', + 'ﺋ' => 'ئ', + 'ﺌ' => 'ئ', + 'ﺍ' => 'ا', + 'ﺎ' => 'ا', + 'ﺏ' => 'ب', + 'ﺐ' => 'ب', + 'ﺑ' => 'ب', + 'ﺒ' => 'ب', + 'ﺓ' => 'ة', + 'ﺔ' => 'ة', + 'ﺕ' => 'ت', + 'ﺖ' => 'ت', + 'ﺗ' => 'ت', + 'ﺘ' => 'ت', + 'ﺙ' => 'ث', + 'ﺚ' => 'ث', + 'ﺛ' => 'ث', + 'ﺜ' => 'ث', + 'ﺝ' => 'ج', + 'ﺞ' => 'ج', + 'ﺟ' => 'ج', + 'ﺠ' => 'ج', + 'ﺡ' => 'ح', + 'ﺢ' => 'ح', + 'ﺣ' => 'ح', + 'ﺤ' => 'ح', + 'ﺥ' => 'خ', + 'ﺦ' => 'خ', + 'ﺧ' => 'خ', + 'ﺨ' => 'خ', + 'ﺩ' => 'د', + 'ﺪ' => 'د', + 'ﺫ' => 'ذ', + 'ﺬ' => 'ذ', + 'ﺭ' => 'ر', + 'ﺮ' => 'ر', + 'ﺯ' => 'ز', + 'ﺰ' => 'ز', + 'ﺱ' => 'س', + 'ﺲ' => 'س', + 'ﺳ' => 'س', + 'ﺴ' => 'س', + 'ﺵ' => 'ش', + 'ﺶ' => 'ش', + 'ﺷ' => 'ش', + 'ﺸ' => 'ش', + 'ﺹ' => 'ص', + 'ﺺ' => 'ص', + 'ﺻ' => 'ص', + 'ﺼ' => 'ص', + 'ﺽ' => 'ض', + 'ﺾ' => 'ض', + 'ﺿ' => 'ض', + 'ﻀ' => 'ض', + 'ﻁ' => 'ط', + 'ﻂ' => 'ط', + 'ﻃ' => 'ط', + 'ﻄ' => 'ط', + 'ﻅ' => 'ظ', + 'ﻆ' => 'ظ', + 'ﻇ' => 'ظ', + 'ﻈ' => 'ظ', + 'ﻉ' => 'ع', + 'ﻊ' => 'ع', + 'ﻋ' => 'ع', + 'ﻌ' => 'ع', + 'ﻍ' => 'غ', + 'ﻎ' => 'غ', + 'ﻏ' => 'غ', + 'ﻐ' => 'غ', + 'ﻑ' => 'ف', + 'ﻒ' => 'ف', + 'ﻓ' => 'ف', + 'ﻔ' => 'ف', + 'ﻕ' => 'ق', + 'ﻖ' => 'ق', + 'ﻗ' => 'ق', + 'ﻘ' => 'ق', + 'ﻙ' => 'ك', + 'ﻚ' => 'ك', + 'ﻛ' => 'ك', + 'ﻜ' => 'ك', + 'ﻝ' => 'ل', + 'ﻞ' => 'ل', + 'ﻟ' => 'ل', + 'ﻠ' => 'ل', + 'ﻡ' => 'م', + 'ﻢ' => 'م', + 'ﻣ' => 'م', + 'ﻤ' => 'م', + 'ﻥ' => 'ن', + 'ﻦ' => 'ن', + 'ﻧ' => 'ن', + 'ﻨ' => 'ن', + 'ﻩ' => 'ه', + 'ﻪ' => 'ه', + 'ﻫ' => 'ه', + 'ﻬ' => 'ه', + 'ﻭ' => 'و', + 'ﻮ' => 'و', + 'ﻯ' => 'ى', + 'ﻰ' => 'ى', + 'ﻱ' => 'ي', + 'ﻲ' => 'ي', + 'ﻳ' => 'ي', + 'ﻴ' => 'ي', + 'ﻵ' => 'لآ', + 'ﻶ' => 'لآ', + 'ﻷ' => 'لأ', + 'ﻸ' => 'لأ', + 'ﻹ' => 'لإ', + 'ﻺ' => 'لإ', + 'ﻻ' => 'لا', + 'ﻼ' => 'لا', + '!' => '!', + '"' => '"', + '#' => '#', + '$' => '$', + '%' => '%', + '&' => '&', + ''' => '\'', + '(' => '(', + ')' => ')', + '*' => '*', + '+' => '+', + ',' => ',', + '-' => '-', + '.' => '.', + '/' => '/', + '0' => '0', + '1' => '1', + '2' => '2', + '3' => '3', + '4' => '4', + '5' => '5', + '6' => '6', + '7' => '7', + '8' => '8', + '9' => '9', + ':' => ':', + ';' => ';', + '<' => '<', + '=' => '=', + '>' => '>', + '?' => '?', + '@' => '@', + 'A' => 'A', + 'B' => 'B', + 'C' => 'C', + 'D' => 'D', + 'E' => 'E', + 'F' => 'F', + 'G' => 'G', + 'H' => 'H', + 'I' => 'I', + 'J' => 'J', + 'K' => 'K', + 'L' => 'L', + 'M' => 'M', + 'N' => 'N', + 'O' => 'O', + 'P' => 'P', + 'Q' => 'Q', + 'R' => 'R', + 'S' => 'S', + 'T' => 'T', + 'U' => 'U', + 'V' => 'V', + 'W' => 'W', + 'X' => 'X', + 'Y' => 'Y', + 'Z' => 'Z', + '[' => '[', + '\' => '\\', + ']' => ']', + '^' => '^', + '_' => '_', + '`' => '`', + 'a' => 'a', + 'b' => 'b', + 'c' => 'c', + 'd' => 'd', + 'e' => 'e', + 'f' => 'f', + 'g' => 'g', + 'h' => 'h', + 'i' => 'i', + 'j' => 'j', + 'k' => 'k', + 'l' => 'l', + 'm' => 'm', + 'n' => 'n', + 'o' => 'o', + 'p' => 'p', + 'q' => 'q', + 'r' => 'r', + 's' => 's', + 't' => 't', + 'u' => 'u', + 'v' => 'v', + 'w' => 'w', + 'x' => 'x', + 'y' => 'y', + 'z' => 'z', + '{' => '{', + '|' => '|', + '}' => '}', + '~' => '~', + '⦅' => '⦅', + '⦆' => '⦆', + '。' => '。', + '「' => '「', + '」' => '」', + '、' => '、', + '・' => '・', + 'ヲ' => 'ヲ', + 'ァ' => 'ァ', + 'ィ' => 'ィ', + 'ゥ' => 'ゥ', + 'ェ' => 'ェ', + 'ォ' => 'ォ', + 'ャ' => 'ャ', + 'ュ' => 'ュ', + 'ョ' => 'ョ', + 'ッ' => 'ッ', + 'ー' => 'ー', + 'ア' => 'ア', + 'イ' => 'イ', + 'ウ' => 'ウ', + 'エ' => 'エ', + 'オ' => 'オ', + 'カ' => 'カ', + 'キ' => 'キ', + 'ク' => 'ク', + 'ケ' => 'ケ', + 'コ' => 'コ', + 'サ' => 'サ', + 'シ' => 'シ', + 'ス' => 'ス', + 'セ' => 'セ', + 'ソ' => 'ソ', + 'タ' => 'タ', + 'チ' => 'チ', + 'ツ' => 'ツ', + 'テ' => 'テ', + 'ト' => 'ト', + 'ナ' => 'ナ', + 'ニ' => 'ニ', + 'ヌ' => 'ヌ', + 'ネ' => 'ネ', + 'ノ' => 'ノ', + 'ハ' => 'ハ', + 'ヒ' => 'ヒ', + 'フ' => 'フ', + 'ヘ' => 'ヘ', + 'ホ' => 'ホ', + 'マ' => 'マ', + 'ミ' => 'ミ', + 'ム' => 'ム', + 'メ' => 'メ', + 'モ' => 'モ', + 'ヤ' => 'ヤ', + 'ユ' => 'ユ', + 'ヨ' => 'ヨ', + 'ラ' => 'ラ', + 'リ' => 'リ', + 'ル' => 'ル', + 'レ' => 'レ', + 'ロ' => 'ロ', + 'ワ' => 'ワ', + 'ン' => 'ン', + '゙' => '゙', + '゚' => '゚', + 'ᅠ' => 'ᅠ', + 'ᄀ' => 'ᄀ', + 'ᄁ' => 'ᄁ', + 'ᆪ' => 'ᆪ', + 'ᄂ' => 'ᄂ', + 'ᆬ' => 'ᆬ', + 'ᆭ' => 'ᆭ', + 'ᄃ' => 'ᄃ', + 'ᄄ' => 'ᄄ', + 'ᄅ' => 'ᄅ', + 'ᆰ' => 'ᆰ', + 'ᆱ' => 'ᆱ', + 'ᆲ' => 'ᆲ', + 'ᆳ' => 'ᆳ', + 'ᆴ' => 'ᆴ', + 'ᆵ' => 'ᆵ', + 'ᄚ' => 'ᄚ', + 'ᄆ' => 'ᄆ', + 'ᄇ' => 'ᄇ', + 'ᄈ' => 'ᄈ', + 'ᄡ' => 'ᄡ', + 'ᄉ' => 'ᄉ', + 'ᄊ' => 'ᄊ', + 'ᄋ' => 'ᄋ', + 'ᄌ' => 'ᄌ', + 'ᄍ' => 'ᄍ', + 'ᄎ' => 'ᄎ', + 'ᄏ' => 'ᄏ', + 'ᄐ' => 'ᄐ', + 'ᄑ' => 'ᄑ', + 'ᄒ' => 'ᄒ', + 'ᅡ' => 'ᅡ', + 'ᅢ' => 'ᅢ', + 'ᅣ' => 'ᅣ', + 'ᅤ' => 'ᅤ', + 'ᅥ' => 'ᅥ', + 'ᅦ' => 'ᅦ', + 'ᅧ' => 'ᅧ', + 'ᅨ' => 'ᅨ', + 'ᅩ' => 'ᅩ', + 'ᅪ' => 'ᅪ', + 'ᅫ' => 'ᅫ', + 'ᅬ' => 'ᅬ', + 'ᅭ' => 'ᅭ', + 'ᅮ' => 'ᅮ', + 'ᅯ' => 'ᅯ', + 'ᅰ' => 'ᅰ', + 'ᅱ' => 'ᅱ', + 'ᅲ' => 'ᅲ', + 'ᅳ' => 'ᅳ', + 'ᅴ' => 'ᅴ', + 'ᅵ' => 'ᅵ', + '¢' => '¢', + '£' => '£', + '¬' => '¬', + ' ̄' => ' ̄', + '¦' => '¦', + '¥' => '¥', + '₩' => '₩', + '│' => '│', + '←' => '←', + '↑' => '↑', + '→' => '→', + '↓' => '↓', + '■' => '■', + '○' => '○', + '𝐀' => 'A', + '𝐁' => 'B', + '𝐂' => 'C', + '𝐃' => 'D', + '𝐄' => 'E', + '𝐅' => 'F', + '𝐆' => 'G', + '𝐇' => 'H', + '𝐈' => 'I', + '𝐉' => 'J', + '𝐊' => 'K', + '𝐋' => 'L', + '𝐌' => 'M', + '𝐍' => 'N', + '𝐎' => 'O', + '𝐏' => 'P', + '𝐐' => 'Q', + '𝐑' => 'R', + '𝐒' => 'S', + '𝐓' => 'T', + '𝐔' => 'U', + '𝐕' => 'V', + '𝐖' => 'W', + '𝐗' => 'X', + '𝐘' => 'Y', + '𝐙' => 'Z', + '𝐚' => 'a', + '𝐛' => 'b', + '𝐜' => 'c', + '𝐝' => 'd', + '𝐞' => 'e', + '𝐟' => 'f', + '𝐠' => 'g', + '𝐡' => 'h', + '𝐢' => 'i', + '𝐣' => 'j', + '𝐤' => 'k', + '𝐥' => 'l', + '𝐦' => 'm', + '𝐧' => 'n', + '𝐨' => 'o', + '𝐩' => 'p', + '𝐪' => 'q', + '𝐫' => 'r', + '𝐬' => 's', + '𝐭' => 't', + '𝐮' => 'u', + '𝐯' => 'v', + '𝐰' => 'w', + '𝐱' => 'x', + '𝐲' => 'y', + '𝐳' => 'z', + '𝐴' => 'A', + '𝐵' => 'B', + '𝐶' => 'C', + '𝐷' => 'D', + '𝐸' => 'E', + '𝐹' => 'F', + '𝐺' => 'G', + '𝐻' => 'H', + '𝐼' => 'I', + '𝐽' => 'J', + '𝐾' => 'K', + '𝐿' => 'L', + '𝑀' => 'M', + '𝑁' => 'N', + '𝑂' => 'O', + '𝑃' => 'P', + '𝑄' => 'Q', + '𝑅' => 'R', + '𝑆' => 'S', + '𝑇' => 'T', + '𝑈' => 'U', + '𝑉' => 'V', + '𝑊' => 'W', + '𝑋' => 'X', + '𝑌' => 'Y', + '𝑍' => 'Z', + '𝑎' => 'a', + '𝑏' => 'b', + '𝑐' => 'c', + '𝑑' => 'd', + '𝑒' => 'e', + '𝑓' => 'f', + '𝑔' => 'g', + '𝑖' => 'i', + '𝑗' => 'j', + '𝑘' => 'k', + '𝑙' => 'l', + '𝑚' => 'm', + '𝑛' => 'n', + '𝑜' => 'o', + '𝑝' => 'p', + '𝑞' => 'q', + '𝑟' => 'r', + '𝑠' => 's', + '𝑡' => 't', + '𝑢' => 'u', + '𝑣' => 'v', + '𝑤' => 'w', + '𝑥' => 'x', + '𝑦' => 'y', + '𝑧' => 'z', + '𝑨' => 'A', + '𝑩' => 'B', + '𝑪' => 'C', + '𝑫' => 'D', + '𝑬' => 'E', + '𝑭' => 'F', + '𝑮' => 'G', + '𝑯' => 'H', + '𝑰' => 'I', + '𝑱' => 'J', + '𝑲' => 'K', + '𝑳' => 'L', + '𝑴' => 'M', + '𝑵' => 'N', + '𝑶' => 'O', + '𝑷' => 'P', + '𝑸' => 'Q', + '𝑹' => 'R', + '𝑺' => 'S', + '𝑻' => 'T', + '𝑼' => 'U', + '𝑽' => 'V', + '𝑾' => 'W', + '𝑿' => 'X', + '𝒀' => 'Y', + '𝒁' => 'Z', + '𝒂' => 'a', + '𝒃' => 'b', + '𝒄' => 'c', + '𝒅' => 'd', + '𝒆' => 'e', + '𝒇' => 'f', + '𝒈' => 'g', + '𝒉' => 'h', + '𝒊' => 'i', + '𝒋' => 'j', + '𝒌' => 'k', + '𝒍' => 'l', + '𝒎' => 'm', + '𝒏' => 'n', + '𝒐' => 'o', + '𝒑' => 'p', + '𝒒' => 'q', + '𝒓' => 'r', + '𝒔' => 's', + '𝒕' => 't', + '𝒖' => 'u', + '𝒗' => 'v', + '𝒘' => 'w', + '𝒙' => 'x', + '𝒚' => 'y', + '𝒛' => 'z', + '𝒜' => 'A', + '𝒞' => 'C', + '𝒟' => 'D', + '𝒢' => 'G', + '𝒥' => 'J', + '𝒦' => 'K', + '𝒩' => 'N', + '𝒪' => 'O', + '𝒫' => 'P', + '𝒬' => 'Q', + '𝒮' => 'S', + '𝒯' => 'T', + '𝒰' => 'U', + '𝒱' => 'V', + '𝒲' => 'W', + '𝒳' => 'X', + '𝒴' => 'Y', + '𝒵' => 'Z', + '𝒶' => 'a', + '𝒷' => 'b', + '𝒸' => 'c', + '𝒹' => 'd', + '𝒻' => 'f', + '𝒽' => 'h', + '𝒾' => 'i', + '𝒿' => 'j', + '𝓀' => 'k', + '𝓁' => 'l', + '𝓂' => 'm', + '𝓃' => 'n', + '𝓅' => 'p', + '𝓆' => 'q', + '𝓇' => 'r', + '𝓈' => 's', + '𝓉' => 't', + '𝓊' => 'u', + '𝓋' => 'v', + '𝓌' => 'w', + '𝓍' => 'x', + '𝓎' => 'y', + '𝓏' => 'z', + '𝓐' => 'A', + '𝓑' => 'B', + '𝓒' => 'C', + '𝓓' => 'D', + '𝓔' => 'E', + '𝓕' => 'F', + '𝓖' => 'G', + '𝓗' => 'H', + '𝓘' => 'I', + '𝓙' => 'J', + '𝓚' => 'K', + '𝓛' => 'L', + '𝓜' => 'M', + '𝓝' => 'N', + '𝓞' => 'O', + '𝓟' => 'P', + '𝓠' => 'Q', + '𝓡' => 'R', + '𝓢' => 'S', + '𝓣' => 'T', + '𝓤' => 'U', + '𝓥' => 'V', + '𝓦' => 'W', + '𝓧' => 'X', + '𝓨' => 'Y', + '𝓩' => 'Z', + '𝓪' => 'a', + '𝓫' => 'b', + '𝓬' => 'c', + '𝓭' => 'd', + '𝓮' => 'e', + '𝓯' => 'f', + '𝓰' => 'g', + '𝓱' => 'h', + '𝓲' => 'i', + '𝓳' => 'j', + '𝓴' => 'k', + '𝓵' => 'l', + '𝓶' => 'm', + '𝓷' => 'n', + '𝓸' => 'o', + '𝓹' => 'p', + '𝓺' => 'q', + '𝓻' => 'r', + '𝓼' => 's', + '𝓽' => 't', + '𝓾' => 'u', + '𝓿' => 'v', + '𝔀' => 'w', + '𝔁' => 'x', + '𝔂' => 'y', + '𝔃' => 'z', + '𝔄' => 'A', + '𝔅' => 'B', + '𝔇' => 'D', + '𝔈' => 'E', + '𝔉' => 'F', + '𝔊' => 'G', + '𝔍' => 'J', + '𝔎' => 'K', + '𝔏' => 'L', + '𝔐' => 'M', + '𝔑' => 'N', + '𝔒' => 'O', + '𝔓' => 'P', + '𝔔' => 'Q', + '𝔖' => 'S', + '𝔗' => 'T', + '𝔘' => 'U', + '𝔙' => 'V', + '𝔚' => 'W', + '𝔛' => 'X', + '𝔜' => 'Y', + '𝔞' => 'a', + '𝔟' => 'b', + '𝔠' => 'c', + '𝔡' => 'd', + '𝔢' => 'e', + '𝔣' => 'f', + '𝔤' => 'g', + '𝔥' => 'h', + '𝔦' => 'i', + '𝔧' => 'j', + '𝔨' => 'k', + '𝔩' => 'l', + '𝔪' => 'm', + '𝔫' => 'n', + '𝔬' => 'o', + '𝔭' => 'p', + '𝔮' => 'q', + '𝔯' => 'r', + '𝔰' => 's', + '𝔱' => 't', + '𝔲' => 'u', + '𝔳' => 'v', + '𝔴' => 'w', + '𝔵' => 'x', + '𝔶' => 'y', + '𝔷' => 'z', + '𝔸' => 'A', + '𝔹' => 'B', + '𝔻' => 'D', + '𝔼' => 'E', + '𝔽' => 'F', + '𝔾' => 'G', + '𝕀' => 'I', + '𝕁' => 'J', + '𝕂' => 'K', + '𝕃' => 'L', + '𝕄' => 'M', + '𝕆' => 'O', + '𝕊' => 'S', + '𝕋' => 'T', + '𝕌' => 'U', + '𝕍' => 'V', + '𝕎' => 'W', + '𝕏' => 'X', + '𝕐' => 'Y', + '𝕒' => 'a', + '𝕓' => 'b', + '𝕔' => 'c', + '𝕕' => 'd', + '𝕖' => 'e', + '𝕗' => 'f', + '𝕘' => 'g', + '𝕙' => 'h', + '𝕚' => 'i', + '𝕛' => 'j', + '𝕜' => 'k', + '𝕝' => 'l', + '𝕞' => 'm', + '𝕟' => 'n', + '𝕠' => 'o', + '𝕡' => 'p', + '𝕢' => 'q', + '𝕣' => 'r', + '𝕤' => 's', + '𝕥' => 't', + '𝕦' => 'u', + '𝕧' => 'v', + '𝕨' => 'w', + '𝕩' => 'x', + '𝕪' => 'y', + '𝕫' => 'z', + '𝕬' => 'A', + '𝕭' => 'B', + '𝕮' => 'C', + '𝕯' => 'D', + '𝕰' => 'E', + '𝕱' => 'F', + '𝕲' => 'G', + '𝕳' => 'H', + '𝕴' => 'I', + '𝕵' => 'J', + '𝕶' => 'K', + '𝕷' => 'L', + '𝕸' => 'M', + '𝕹' => 'N', + '𝕺' => 'O', + '𝕻' => 'P', + '𝕼' => 'Q', + '𝕽' => 'R', + '𝕾' => 'S', + '𝕿' => 'T', + '𝖀' => 'U', + '𝖁' => 'V', + '𝖂' => 'W', + '𝖃' => 'X', + '𝖄' => 'Y', + '𝖅' => 'Z', + '𝖆' => 'a', + '𝖇' => 'b', + '𝖈' => 'c', + '𝖉' => 'd', + '𝖊' => 'e', + '𝖋' => 'f', + '𝖌' => 'g', + '𝖍' => 'h', + '𝖎' => 'i', + '𝖏' => 'j', + '𝖐' => 'k', + '𝖑' => 'l', + '𝖒' => 'm', + '𝖓' => 'n', + '𝖔' => 'o', + '𝖕' => 'p', + '𝖖' => 'q', + '𝖗' => 'r', + '𝖘' => 's', + '𝖙' => 't', + '𝖚' => 'u', + '𝖛' => 'v', + '𝖜' => 'w', + '𝖝' => 'x', + '𝖞' => 'y', + '𝖟' => 'z', + '𝖠' => 'A', + '𝖡' => 'B', + '𝖢' => 'C', + '𝖣' => 'D', + '𝖤' => 'E', + '𝖥' => 'F', + '𝖦' => 'G', + '𝖧' => 'H', + '𝖨' => 'I', + '𝖩' => 'J', + '𝖪' => 'K', + '𝖫' => 'L', + '𝖬' => 'M', + '𝖭' => 'N', + '𝖮' => 'O', + '𝖯' => 'P', + '𝖰' => 'Q', + '𝖱' => 'R', + '𝖲' => 'S', + '𝖳' => 'T', + '𝖴' => 'U', + '𝖵' => 'V', + '𝖶' => 'W', + '𝖷' => 'X', + '𝖸' => 'Y', + '𝖹' => 'Z', + '𝖺' => 'a', + '𝖻' => 'b', + '𝖼' => 'c', + '𝖽' => 'd', + '𝖾' => 'e', + '𝖿' => 'f', + '𝗀' => 'g', + '𝗁' => 'h', + '𝗂' => 'i', + '𝗃' => 'j', + '𝗄' => 'k', + '𝗅' => 'l', + '𝗆' => 'm', + '𝗇' => 'n', + '𝗈' => 'o', + '𝗉' => 'p', + '𝗊' => 'q', + '𝗋' => 'r', + '𝗌' => 's', + '𝗍' => 't', + '𝗎' => 'u', + '𝗏' => 'v', + '𝗐' => 'w', + '𝗑' => 'x', + '𝗒' => 'y', + '𝗓' => 'z', + '𝗔' => 'A', + '𝗕' => 'B', + '𝗖' => 'C', + '𝗗' => 'D', + '𝗘' => 'E', + '𝗙' => 'F', + '𝗚' => 'G', + '𝗛' => 'H', + '𝗜' => 'I', + '𝗝' => 'J', + '𝗞' => 'K', + '𝗟' => 'L', + '𝗠' => 'M', + '𝗡' => 'N', + '𝗢' => 'O', + '𝗣' => 'P', + '𝗤' => 'Q', + '𝗥' => 'R', + '𝗦' => 'S', + '𝗧' => 'T', + '𝗨' => 'U', + '𝗩' => 'V', + '𝗪' => 'W', + '𝗫' => 'X', + '𝗬' => 'Y', + '𝗭' => 'Z', + '𝗮' => 'a', + '𝗯' => 'b', + '𝗰' => 'c', + '𝗱' => 'd', + '𝗲' => 'e', + '𝗳' => 'f', + '𝗴' => 'g', + '𝗵' => 'h', + '𝗶' => 'i', + '𝗷' => 'j', + '𝗸' => 'k', + '𝗹' => 'l', + '𝗺' => 'm', + '𝗻' => 'n', + '𝗼' => 'o', + '𝗽' => 'p', + '𝗾' => 'q', + '𝗿' => 'r', + '𝘀' => 's', + '𝘁' => 't', + '𝘂' => 'u', + '𝘃' => 'v', + '𝘄' => 'w', + '𝘅' => 'x', + '𝘆' => 'y', + '𝘇' => 'z', + '𝘈' => 'A', + '𝘉' => 'B', + '𝘊' => 'C', + '𝘋' => 'D', + '𝘌' => 'E', + '𝘍' => 'F', + '𝘎' => 'G', + '𝘏' => 'H', + '𝘐' => 'I', + '𝘑' => 'J', + '𝘒' => 'K', + '𝘓' => 'L', + '𝘔' => 'M', + '𝘕' => 'N', + '𝘖' => 'O', + '𝘗' => 'P', + '𝘘' => 'Q', + '𝘙' => 'R', + '𝘚' => 'S', + '𝘛' => 'T', + '𝘜' => 'U', + '𝘝' => 'V', + '𝘞' => 'W', + '𝘟' => 'X', + '𝘠' => 'Y', + '𝘡' => 'Z', + '𝘢' => 'a', + '𝘣' => 'b', + '𝘤' => 'c', + '𝘥' => 'd', + '𝘦' => 'e', + '𝘧' => 'f', + '𝘨' => 'g', + '𝘩' => 'h', + '𝘪' => 'i', + '𝘫' => 'j', + '𝘬' => 'k', + '𝘭' => 'l', + '𝘮' => 'm', + '𝘯' => 'n', + '𝘰' => 'o', + '𝘱' => 'p', + '𝘲' => 'q', + '𝘳' => 'r', + '𝘴' => 's', + '𝘵' => 't', + '𝘶' => 'u', + '𝘷' => 'v', + '𝘸' => 'w', + '𝘹' => 'x', + '𝘺' => 'y', + '𝘻' => 'z', + '𝘼' => 'A', + '𝘽' => 'B', + '𝘾' => 'C', + '𝘿' => 'D', + '𝙀' => 'E', + '𝙁' => 'F', + '𝙂' => 'G', + '𝙃' => 'H', + '𝙄' => 'I', + '𝙅' => 'J', + '𝙆' => 'K', + '𝙇' => 'L', + '𝙈' => 'M', + '𝙉' => 'N', + '𝙊' => 'O', + '𝙋' => 'P', + '𝙌' => 'Q', + '𝙍' => 'R', + '𝙎' => 'S', + '𝙏' => 'T', + '𝙐' => 'U', + '𝙑' => 'V', + '𝙒' => 'W', + '𝙓' => 'X', + '𝙔' => 'Y', + '𝙕' => 'Z', + '𝙖' => 'a', + '𝙗' => 'b', + '𝙘' => 'c', + '𝙙' => 'd', + '𝙚' => 'e', + '𝙛' => 'f', + '𝙜' => 'g', + '𝙝' => 'h', + '𝙞' => 'i', + '𝙟' => 'j', + '𝙠' => 'k', + '𝙡' => 'l', + '𝙢' => 'm', + '𝙣' => 'n', + '𝙤' => 'o', + '𝙥' => 'p', + '𝙦' => 'q', + '𝙧' => 'r', + '𝙨' => 's', + '𝙩' => 't', + '𝙪' => 'u', + '𝙫' => 'v', + '𝙬' => 'w', + '𝙭' => 'x', + '𝙮' => 'y', + '𝙯' => 'z', + '𝙰' => 'A', + '𝙱' => 'B', + '𝙲' => 'C', + '𝙳' => 'D', + '𝙴' => 'E', + '𝙵' => 'F', + '𝙶' => 'G', + '𝙷' => 'H', + '𝙸' => 'I', + '𝙹' => 'J', + '𝙺' => 'K', + '𝙻' => 'L', + '𝙼' => 'M', + '𝙽' => 'N', + '𝙾' => 'O', + '𝙿' => 'P', + '𝚀' => 'Q', + '𝚁' => 'R', + '𝚂' => 'S', + '𝚃' => 'T', + '𝚄' => 'U', + '𝚅' => 'V', + '𝚆' => 'W', + '𝚇' => 'X', + '𝚈' => 'Y', + '𝚉' => 'Z', + '𝚊' => 'a', + '𝚋' => 'b', + '𝚌' => 'c', + '𝚍' => 'd', + '𝚎' => 'e', + '𝚏' => 'f', + '𝚐' => 'g', + '𝚑' => 'h', + '𝚒' => 'i', + '𝚓' => 'j', + '𝚔' => 'k', + '𝚕' => 'l', + '𝚖' => 'm', + '𝚗' => 'n', + '𝚘' => 'o', + '𝚙' => 'p', + '𝚚' => 'q', + '𝚛' => 'r', + '𝚜' => 's', + '𝚝' => 't', + '𝚞' => 'u', + '𝚟' => 'v', + '𝚠' => 'w', + '𝚡' => 'x', + '𝚢' => 'y', + '𝚣' => 'z', + '𝚤' => 'ı', + '𝚥' => 'ȷ', + '𝚨' => 'Α', + '𝚩' => 'Β', + '𝚪' => 'Γ', + '𝚫' => 'Δ', + '𝚬' => 'Ε', + '𝚭' => 'Ζ', + '𝚮' => 'Η', + '𝚯' => 'Θ', + '𝚰' => 'Ι', + '𝚱' => 'Κ', + '𝚲' => 'Λ', + '𝚳' => 'Μ', + '𝚴' => 'Ν', + '𝚵' => 'Ξ', + '𝚶' => 'Ο', + '𝚷' => 'Π', + '𝚸' => 'Ρ', + '𝚹' => 'Θ', + '𝚺' => 'Σ', + '𝚻' => 'Τ', + '𝚼' => 'Υ', + '𝚽' => 'Φ', + '𝚾' => 'Χ', + '𝚿' => 'Ψ', + '𝛀' => 'Ω', + '𝛁' => '∇', + '𝛂' => 'α', + '𝛃' => 'β', + '𝛄' => 'γ', + '𝛅' => 'δ', + '𝛆' => 'ε', + '𝛇' => 'ζ', + '𝛈' => 'η', + '𝛉' => 'θ', + '𝛊' => 'ι', + '𝛋' => 'κ', + '𝛌' => 'λ', + '𝛍' => 'μ', + '𝛎' => 'ν', + '𝛏' => 'ξ', + '𝛐' => 'ο', + '𝛑' => 'π', + '𝛒' => 'ρ', + '𝛓' => 'ς', + '𝛔' => 'σ', + '𝛕' => 'τ', + '𝛖' => 'υ', + '𝛗' => 'φ', + '𝛘' => 'χ', + '𝛙' => 'ψ', + '𝛚' => 'ω', + '𝛛' => '∂', + '𝛜' => 'ε', + '𝛝' => 'θ', + '𝛞' => 'κ', + '𝛟' => 'φ', + '𝛠' => 'ρ', + '𝛡' => 'π', + '𝛢' => 'Α', + '𝛣' => 'Β', + '𝛤' => 'Γ', + '𝛥' => 'Δ', + '𝛦' => 'Ε', + '𝛧' => 'Ζ', + '𝛨' => 'Η', + '𝛩' => 'Θ', + '𝛪' => 'Ι', + '𝛫' => 'Κ', + '𝛬' => 'Λ', + '𝛭' => 'Μ', + '𝛮' => 'Ν', + '𝛯' => 'Ξ', + '𝛰' => 'Ο', + '𝛱' => 'Π', + '𝛲' => 'Ρ', + '𝛳' => 'Θ', + '𝛴' => 'Σ', + '𝛵' => 'Τ', + '𝛶' => 'Υ', + '𝛷' => 'Φ', + '𝛸' => 'Χ', + '𝛹' => 'Ψ', + '𝛺' => 'Ω', + '𝛻' => '∇', + '𝛼' => 'α', + '𝛽' => 'β', + '𝛾' => 'γ', + '𝛿' => 'δ', + '𝜀' => 'ε', + '𝜁' => 'ζ', + '𝜂' => 'η', + '𝜃' => 'θ', + '𝜄' => 'ι', + '𝜅' => 'κ', + '𝜆' => 'λ', + '𝜇' => 'μ', + '𝜈' => 'ν', + '𝜉' => 'ξ', + '𝜊' => 'ο', + '𝜋' => 'π', + '𝜌' => 'ρ', + '𝜍' => 'ς', + '𝜎' => 'σ', + '𝜏' => 'τ', + '𝜐' => 'υ', + '𝜑' => 'φ', + '𝜒' => 'χ', + '𝜓' => 'ψ', + '𝜔' => 'ω', + '𝜕' => '∂', + '𝜖' => 'ε', + '𝜗' => 'θ', + '𝜘' => 'κ', + '𝜙' => 'φ', + '𝜚' => 'ρ', + '𝜛' => 'π', + '𝜜' => 'Α', + '𝜝' => 'Β', + '𝜞' => 'Γ', + '𝜟' => 'Δ', + '𝜠' => 'Ε', + '𝜡' => 'Ζ', + '𝜢' => 'Η', + '𝜣' => 'Θ', + '𝜤' => 'Ι', + '𝜥' => 'Κ', + '𝜦' => 'Λ', + '𝜧' => 'Μ', + '𝜨' => 'Ν', + '𝜩' => 'Ξ', + '𝜪' => 'Ο', + '𝜫' => 'Π', + '𝜬' => 'Ρ', + '𝜭' => 'Θ', + '𝜮' => 'Σ', + '𝜯' => 'Τ', + '𝜰' => 'Υ', + '𝜱' => 'Φ', + '𝜲' => 'Χ', + '𝜳' => 'Ψ', + '𝜴' => 'Ω', + '𝜵' => '∇', + '𝜶' => 'α', + '𝜷' => 'β', + '𝜸' => 'γ', + '𝜹' => 'δ', + '𝜺' => 'ε', + '𝜻' => 'ζ', + '𝜼' => 'η', + '𝜽' => 'θ', + '𝜾' => 'ι', + '𝜿' => 'κ', + '𝝀' => 'λ', + '𝝁' => 'μ', + '𝝂' => 'ν', + '𝝃' => 'ξ', + '𝝄' => 'ο', + '𝝅' => 'π', + '𝝆' => 'ρ', + '𝝇' => 'ς', + '𝝈' => 'σ', + '𝝉' => 'τ', + '𝝊' => 'υ', + '𝝋' => 'φ', + '𝝌' => 'χ', + '𝝍' => 'ψ', + '𝝎' => 'ω', + '𝝏' => '∂', + '𝝐' => 'ε', + '𝝑' => 'θ', + '𝝒' => 'κ', + '𝝓' => 'φ', + '𝝔' => 'ρ', + '𝝕' => 'π', + '𝝖' => 'Α', + '𝝗' => 'Β', + '𝝘' => 'Γ', + '𝝙' => 'Δ', + '𝝚' => 'Ε', + '𝝛' => 'Ζ', + '𝝜' => 'Η', + '𝝝' => 'Θ', + '𝝞' => 'Ι', + '𝝟' => 'Κ', + '𝝠' => 'Λ', + '𝝡' => 'Μ', + '𝝢' => 'Ν', + '𝝣' => 'Ξ', + '𝝤' => 'Ο', + '𝝥' => 'Π', + '𝝦' => 'Ρ', + '𝝧' => 'Θ', + '𝝨' => 'Σ', + '𝝩' => 'Τ', + '𝝪' => 'Υ', + '𝝫' => 'Φ', + '𝝬' => 'Χ', + '𝝭' => 'Ψ', + '𝝮' => 'Ω', + '𝝯' => '∇', + '𝝰' => 'α', + '𝝱' => 'β', + '𝝲' => 'γ', + '𝝳' => 'δ', + '𝝴' => 'ε', + '𝝵' => 'ζ', + '𝝶' => 'η', + '𝝷' => 'θ', + '𝝸' => 'ι', + '𝝹' => 'κ', + '𝝺' => 'λ', + '𝝻' => 'μ', + '𝝼' => 'ν', + '𝝽' => 'ξ', + '𝝾' => 'ο', + '𝝿' => 'π', + '𝞀' => 'ρ', + '𝞁' => 'ς', + '𝞂' => 'σ', + '𝞃' => 'τ', + '𝞄' => 'υ', + '𝞅' => 'φ', + '𝞆' => 'χ', + '𝞇' => 'ψ', + '𝞈' => 'ω', + '𝞉' => '∂', + '𝞊' => 'ε', + '𝞋' => 'θ', + '𝞌' => 'κ', + '𝞍' => 'φ', + '𝞎' => 'ρ', + '𝞏' => 'π', + '𝞐' => 'Α', + '𝞑' => 'Β', + '𝞒' => 'Γ', + '𝞓' => 'Δ', + '𝞔' => 'Ε', + '𝞕' => 'Ζ', + '𝞖' => 'Η', + '𝞗' => 'Θ', + '𝞘' => 'Ι', + '𝞙' => 'Κ', + '𝞚' => 'Λ', + '𝞛' => 'Μ', + '𝞜' => 'Ν', + '𝞝' => 'Ξ', + '𝞞' => 'Ο', + '𝞟' => 'Π', + '𝞠' => 'Ρ', + '𝞡' => 'Θ', + '𝞢' => 'Σ', + '𝞣' => 'Τ', + '𝞤' => 'Υ', + '𝞥' => 'Φ', + '𝞦' => 'Χ', + '𝞧' => 'Ψ', + '𝞨' => 'Ω', + '𝞩' => '∇', + '𝞪' => 'α', + '𝞫' => 'β', + '𝞬' => 'γ', + '𝞭' => 'δ', + '𝞮' => 'ε', + '𝞯' => 'ζ', + '𝞰' => 'η', + '𝞱' => 'θ', + '𝞲' => 'ι', + '𝞳' => 'κ', + '𝞴' => 'λ', + '𝞵' => 'μ', + '𝞶' => 'ν', + '𝞷' => 'ξ', + '𝞸' => 'ο', + '𝞹' => 'π', + '𝞺' => 'ρ', + '𝞻' => 'ς', + '𝞼' => 'σ', + '𝞽' => 'τ', + '𝞾' => 'υ', + '𝞿' => 'φ', + '𝟀' => 'χ', + '𝟁' => 'ψ', + '𝟂' => 'ω', + '𝟃' => '∂', + '𝟄' => 'ε', + '𝟅' => 'θ', + '𝟆' => 'κ', + '𝟇' => 'φ', + '𝟈' => 'ρ', + '𝟉' => 'π', + '𝟊' => 'Ϝ', + '𝟋' => 'ϝ', + '𝟎' => '0', + '𝟏' => '1', + '𝟐' => '2', + '𝟑' => '3', + '𝟒' => '4', + '𝟓' => '5', + '𝟔' => '6', + '𝟕' => '7', + '𝟖' => '8', + '𝟗' => '9', + '𝟘' => '0', + '𝟙' => '1', + '𝟚' => '2', + '𝟛' => '3', + '𝟜' => '4', + '𝟝' => '5', + '𝟞' => '6', + '𝟟' => '7', + '𝟠' => '8', + '𝟡' => '9', + '𝟢' => '0', + '𝟣' => '1', + '𝟤' => '2', + '𝟥' => '3', + '𝟦' => '4', + '𝟧' => '5', + '𝟨' => '6', + '𝟩' => '7', + '𝟪' => '8', + '𝟫' => '9', + '𝟬' => '0', + '𝟭' => '1', + '𝟮' => '2', + '𝟯' => '3', + '𝟰' => '4', + '𝟱' => '5', + '𝟲' => '6', + '𝟳' => '7', + '𝟴' => '8', + '𝟵' => '9', + '𝟶' => '0', + '𝟷' => '1', + '𝟸' => '2', + '𝟹' => '3', + '𝟺' => '4', + '𝟻' => '5', + '𝟼' => '6', + '𝟽' => '7', + '𝟾' => '8', + '𝟿' => '9', + '𞸀' => 'ا', + '𞸁' => 'ب', + '𞸂' => 'ج', + '𞸃' => 'د', + '𞸅' => 'و', + '𞸆' => 'ز', + '𞸇' => 'ح', + '𞸈' => 'ط', + '𞸉' => 'ي', + '𞸊' => 'ك', + '𞸋' => 'ل', + '𞸌' => 'م', + '𞸍' => 'ن', + '𞸎' => 'س', + '𞸏' => 'ع', + '𞸐' => 'ف', + '𞸑' => 'ص', + '𞸒' => 'ق', + '𞸓' => 'ر', + '𞸔' => 'ش', + '𞸕' => 'ت', + '𞸖' => 'ث', + '𞸗' => 'خ', + '𞸘' => 'ذ', + '𞸙' => 'ض', + '𞸚' => 'ظ', + '𞸛' => 'غ', + '𞸜' => 'ٮ', + '𞸝' => 'ں', + '𞸞' => 'ڡ', + '𞸟' => 'ٯ', + '𞸡' => 'ب', + '𞸢' => 'ج', + '𞸤' => 'ه', + '𞸧' => 'ح', + '𞸩' => 'ي', + '𞸪' => 'ك', + '𞸫' => 'ل', + '𞸬' => 'م', + '𞸭' => 'ن', + '𞸮' => 'س', + '𞸯' => 'ع', + '𞸰' => 'ف', + '𞸱' => 'ص', + '𞸲' => 'ق', + '𞸴' => 'ش', + '𞸵' => 'ت', + '𞸶' => 'ث', + '𞸷' => 'خ', + '𞸹' => 'ض', + '𞸻' => 'غ', + '𞹂' => 'ج', + '𞹇' => 'ح', + '𞹉' => 'ي', + '𞹋' => 'ل', + '𞹍' => 'ن', + '𞹎' => 'س', + '𞹏' => 'ع', + '𞹑' => 'ص', + '𞹒' => 'ق', + '𞹔' => 'ش', + '𞹗' => 'خ', + '𞹙' => 'ض', + '𞹛' => 'غ', + '𞹝' => 'ں', + '𞹟' => 'ٯ', + '𞹡' => 'ب', + '𞹢' => 'ج', + '𞹤' => 'ه', + '𞹧' => 'ح', + '𞹨' => 'ط', + '𞹩' => 'ي', + '𞹪' => 'ك', + '𞹬' => 'م', + '𞹭' => 'ن', + '𞹮' => 'س', + '𞹯' => 'ع', + '𞹰' => 'ف', + '𞹱' => 'ص', + '𞹲' => 'ق', + '𞹴' => 'ش', + '𞹵' => 'ت', + '𞹶' => 'ث', + '𞹷' => 'خ', + '𞹹' => 'ض', + '𞹺' => 'ظ', + '𞹻' => 'غ', + '𞹼' => 'ٮ', + '𞹾' => 'ڡ', + '𞺀' => 'ا', + '𞺁' => 'ب', + '𞺂' => 'ج', + '𞺃' => 'د', + '𞺄' => 'ه', + '𞺅' => 'و', + '𞺆' => 'ز', + '𞺇' => 'ح', + '𞺈' => 'ط', + '𞺉' => 'ي', + '𞺋' => 'ل', + '𞺌' => 'م', + '𞺍' => 'ن', + '𞺎' => 'س', + '𞺏' => 'ع', + '𞺐' => 'ف', + '𞺑' => 'ص', + '𞺒' => 'ق', + '𞺓' => 'ر', + '𞺔' => 'ش', + '𞺕' => 'ت', + '𞺖' => 'ث', + '𞺗' => 'خ', + '𞺘' => 'ذ', + '𞺙' => 'ض', + '𞺚' => 'ظ', + '𞺛' => 'غ', + '𞺡' => 'ب', + '𞺢' => 'ج', + '𞺣' => 'د', + '𞺥' => 'و', + '𞺦' => 'ز', + '𞺧' => 'ح', + '𞺨' => 'ط', + '𞺩' => 'ي', + '𞺫' => 'ل', + '𞺬' => 'م', + '𞺭' => 'ن', + '𞺮' => 'س', + '𞺯' => 'ع', + '𞺰' => 'ف', + '𞺱' => 'ص', + '𞺲' => 'ق', + '𞺳' => 'ر', + '𞺴' => 'ش', + '𞺵' => 'ت', + '𞺶' => 'ث', + '𞺷' => 'خ', + '𞺸' => 'ذ', + '𞺹' => 'ض', + '𞺺' => 'ظ', + '𞺻' => 'غ', + '🄀' => '0.', + '🄁' => '0,', + '🄂' => '1,', + '🄃' => '2,', + '🄄' => '3,', + '🄅' => '4,', + '🄆' => '5,', + '🄇' => '6,', + '🄈' => '7,', + '🄉' => '8,', + '🄊' => '9,', + '🄐' => '(A)', + '🄑' => '(B)', + '🄒' => '(C)', + '🄓' => '(D)', + '🄔' => '(E)', + '🄕' => '(F)', + '🄖' => '(G)', + '🄗' => '(H)', + '🄘' => '(I)', + '🄙' => '(J)', + '🄚' => '(K)', + '🄛' => '(L)', + '🄜' => '(M)', + '🄝' => '(N)', + '🄞' => '(O)', + '🄟' => '(P)', + '🄠' => '(Q)', + '🄡' => '(R)', + '🄢' => '(S)', + '🄣' => '(T)', + '🄤' => '(U)', + '🄥' => '(V)', + '🄦' => '(W)', + '🄧' => '(X)', + '🄨' => '(Y)', + '🄩' => '(Z)', + '🄪' => '〔S〕', + '🄫' => 'C', + '🄬' => 'R', + '🄭' => 'CD', + '🄮' => 'WZ', + '🄰' => 'A', + '🄱' => 'B', + '🄲' => 'C', + '🄳' => 'D', + '🄴' => 'E', + '🄵' => 'F', + '🄶' => 'G', + '🄷' => 'H', + '🄸' => 'I', + '🄹' => 'J', + '🄺' => 'K', + '🄻' => 'L', + '🄼' => 'M', + '🄽' => 'N', + '🄾' => 'O', + '🄿' => 'P', + '🅀' => 'Q', + '🅁' => 'R', + '🅂' => 'S', + '🅃' => 'T', + '🅄' => 'U', + '🅅' => 'V', + '🅆' => 'W', + '🅇' => 'X', + '🅈' => 'Y', + '🅉' => 'Z', + '🅊' => 'HV', + '🅋' => 'MV', + '🅌' => 'SD', + '🅍' => 'SS', + '🅎' => 'PPV', + '🅏' => 'WC', + '🅪' => 'MC', + '🅫' => 'MD', + '🅬' => 'MR', + '🆐' => 'DJ', + '🈀' => 'ほか', + '🈁' => 'ココ', + '🈂' => 'サ', + '🈐' => '手', + '🈑' => '字', + '🈒' => '双', + '🈓' => 'デ', + '🈔' => '二', + '🈕' => '多', + '🈖' => '解', + '🈗' => '天', + '🈘' => '交', + '🈙' => '映', + '🈚' => '無', + '🈛' => '料', + '🈜' => '前', + '🈝' => '後', + '🈞' => '再', + '🈟' => '新', + '🈠' => '初', + '🈡' => '終', + '🈢' => '生', + '🈣' => '販', + '🈤' => '声', + '🈥' => '吹', + '🈦' => '演', + '🈧' => '投', + '🈨' => '捕', + '🈩' => '一', + '🈪' => '三', + '🈫' => '遊', + '🈬' => '左', + '🈭' => '中', + '🈮' => '右', + '🈯' => '指', + '🈰' => '走', + '🈱' => '打', + '🈲' => '禁', + '🈳' => '空', + '🈴' => '合', + '🈵' => '満', + '🈶' => '有', + '🈷' => '月', + '🈸' => '申', + '🈹' => '割', + '🈺' => '営', + '🈻' => '配', + '🉀' => '〔本〕', + '🉁' => '〔三〕', + '🉂' => '〔二〕', + '🉃' => '〔安〕', + '🉄' => '〔点〕', + '🉅' => '〔打〕', + '🉆' => '〔盗〕', + '🉇' => '〔勝〕', + '🉈' => '〔敗〕', + '🉐' => '得', + '🉑' => '可', + '🯰' => '0', + '🯱' => '1', + '🯲' => '2', + '🯳' => '3', + '🯴' => '4', + '🯵' => '5', + '🯶' => '6', + '🯷' => '7', + '🯸' => '8', + '🯹' => '9', +); diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap.php new file mode 100644 index 00000000..3608e5c0 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Normalizer as p; + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!function_exists('normalizer_is_normalized')) { + function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } +} +if (!function_exists('normalizer_normalize')) { + function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } +} diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php new file mode 100644 index 00000000..e36d1a94 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Normalizer as p; + +if (!function_exists('normalizer_is_normalized')) { + function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } +} +if (!function_exists('normalizer_normalize')) { + function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } +} diff --git a/trunk/vendor/symfony/polyfill-mbstring/LICENSE b/trunk/vendor/symfony/polyfill-mbstring/LICENSE new file mode 100644 index 00000000..6e3afce6 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-mbstring/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-mbstring/Mbstring.php b/trunk/vendor/symfony/polyfill-mbstring/Mbstring.php new file mode 100644 index 00000000..1ad33a86 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -0,0 +1,996 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Mbstring; + +/** + * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. + * + * Implemented: + * - mb_chr - Returns a specific character from its Unicode code point + * - mb_convert_encoding - Convert character encoding + * - mb_convert_variables - Convert character code in variable(s) + * - mb_decode_mimeheader - Decode string in MIME header field + * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED + * - mb_decode_numericentity - Decode HTML numeric string reference to character + * - mb_encode_numericentity - Encode character to HTML numeric string reference + * - mb_convert_case - Perform case folding on a string + * - mb_detect_encoding - Detect character encoding + * - mb_get_info - Get internal settings of mbstring + * - mb_http_input - Detect HTTP input character encoding + * - mb_http_output - Set/Get HTTP output character encoding + * - mb_internal_encoding - Set/Get internal character encoding + * - mb_list_encodings - Returns an array of all supported encodings + * - mb_ord - Returns the Unicode code point of a character + * - mb_output_handler - Callback function converts character encoding in output buffer + * - mb_scrub - Replaces ill-formed byte sequences with substitute characters + * - mb_strlen - Get string length + * - mb_strpos - Find position of first occurrence of string in a string + * - mb_strrpos - Find position of last occurrence of a string in a string + * - mb_str_split - Convert a string to an array + * - mb_strtolower - Make a string lowercase + * - mb_strtoupper - Make a string uppercase + * - mb_substitute_character - Set/Get substitution character + * - mb_substr - Get part of string + * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive + * - mb_stristr - Finds first occurrence of a string within another, case insensitive + * - mb_strrchr - Finds the last occurrence of a character in a string within another + * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive + * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive + * - mb_strstr - Finds first occurrence of a string within another + * - mb_strwidth - Return width of string + * - mb_substr_count - Count the number of substring occurrences + * - mb_ucfirst - Make a string's first character uppercase + * - mb_lcfirst - Make a string's first character lowercase + * + * Not implemented: + * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) + * - mb_ereg_* - Regular expression with multibyte support + * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable + * - mb_preferred_mime_name - Get MIME charset string + * - mb_regex_encoding - Returns current encoding for multibyte regex as string + * - mb_regex_set_options - Set/Get the default options for mbregex functions + * - mb_send_mail - Send encoded mail + * - mb_split - Split multibyte string using regular expression + * - mb_strcut - Get part of string + * - mb_strimwidth - Get truncated string with specified width + * + * @author Nicolas Grekas + * + * @internal + */ +final class Mbstring +{ + public const MB_CASE_FOLD = \PHP_INT_MAX; + + private const SIMPLE_CASE_FOLD = [ + ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], + ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], + ]; + + private static $encodingList = ['ASCII', 'UTF-8']; + private static $language = 'neutral'; + private static $internalEncoding = 'UTF-8'; + + public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) + { + if (\is_array($s)) { + if (PHP_VERSION_ID < 70200) { + trigger_error('mb_convert_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); + + return null; + } + + $r = []; + foreach ($s as $str) { + $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); + } + + return $r; + } + + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { + $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); + } else { + $fromEncoding = self::getEncoding($fromEncoding); + } + + $toEncoding = self::getEncoding($toEncoding); + + if ('BASE64' === $fromEncoding) { + $s = base64_decode($s); + $fromEncoding = $toEncoding; + } + + if ('BASE64' === $toEncoding) { + return base64_encode($s); + } + + if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { + if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { + $fromEncoding = 'Windows-1252'; + } + if ('UTF-8' !== $fromEncoding) { + $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); + } + + return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); + } + + if ('HTML-ENTITIES' === $fromEncoding) { + $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); + $fromEncoding = 'UTF-8'; + } + + return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + } + + public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) + { + $ok = true; + array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { + if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + $ok = false; + } + }); + + return $ok ? $fromEncoding : false; + } + + public static function mb_decode_mimeheader($s) + { + return iconv_mime_decode($s, 2, self::$internalEncoding); + } + + public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) + { + trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); + } + + public static function mb_decode_numericentity($s, $convmap, $encoding = null) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return ''; // Instead of null (cf. mb_encode_numericentity). + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $cnt = floor(\count($convmap) / 4) * 4; + + for ($i = 0; $i < $cnt; $i += 4) { + // collector_decode_htmlnumericentity ignores $convmap[$i + 3] + $convmap[$i] += $convmap[$i + 2]; + $convmap[$i + 1] += $convmap[$i + 2]; + } + + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { + $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; + for ($i = 0; $i < $cnt; $i += 4) { + if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { + return self::mb_chr($c - $convmap[$i + 2]); + } + } + + return $m[0]; + }, $s); + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; // Instead of '' (cf. mb_decode_numericentity). + } + + if (null !== $is_hex && !\is_scalar($is_hex)) { + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + + $cnt = floor(\count($convmap) / 4) * 4; + $i = 0; + $len = \strlen($s); + $result = ''; + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + $c = self::mb_ord($uchr); + + for ($j = 0; $j < $cnt; $j += 4) { + if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { + $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; + $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; + continue 2; + } + } + $result .= $uchr; + } + + if (null === $encoding) { + return $result; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $result); + } + + public static function mb_convert_case($s, $mode, $encoding = null) + { + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + if (\MB_CASE_TITLE == $mode) { + static $titleRegexp = null; + if (null === $titleRegexp) { + $titleRegexp = self::getData('titleCaseRegexp'); + } + $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); + } else { + if (\MB_CASE_UPPER == $mode) { + static $upper = null; + if (null === $upper) { + $upper = self::getData('upperCase'); + } + $map = $upper; + } else { + if (self::MB_CASE_FOLD === $mode) { + static $caseFolding = null; + if (null === $caseFolding) { + $caseFolding = self::getData('caseFolding'); + } + $s = strtr($s, $caseFolding); + } + + static $lower = null; + if (null === $lower) { + $lower = self::getData('lowerCase'); + } + $map = $lower; + } + + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + + $i = 0; + $len = \strlen($s); + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + + if (isset($map[$uchr])) { + $uchr = $map[$uchr]; + $nlen = \strlen($uchr); + + if ($nlen == $ulen) { + $nlen = $i; + do { + $s[--$nlen] = $uchr[--$ulen]; + } while ($ulen); + } else { + $s = substr_replace($s, $uchr, $i - $ulen, $ulen); + $len += $nlen - $ulen; + $i += $nlen - $ulen; + } + } + } + } + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_internal_encoding($encoding = null) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + $normalizedEncoding = self::getEncoding($encoding); + + if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { + self::$internalEncoding = $normalizedEncoding; + + return true; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + public static function mb_language($lang = null) + { + if (null === $lang) { + return self::$language; + } + + switch ($normalizedLang = strtolower($lang)) { + case 'uni': + case 'neutral': + self::$language = $normalizedLang; + + return true; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); + } + + public static function mb_list_encodings() + { + return ['UTF-8']; + } + + public static function mb_encoding_aliases($encoding) + { + switch (strtoupper($encoding)) { + case 'UTF8': + case 'UTF-8': + return ['utf8']; + } + + return false; + } + + public static function mb_check_encoding($var = null, $encoding = null) + { + if (\PHP_VERSION_ID < 70200 && \is_array($var)) { + trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); + + return null; + } + + if (null === $encoding) { + if (null === $var) { + return false; + } + $encoding = self::$internalEncoding; + } + + if (!\is_array($var)) { + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + } + + foreach ($var as $key => $value) { + if (!self::mb_check_encoding($key, $encoding)) { + return false; + } + if (!self::mb_check_encoding($value, $encoding)) { + return false; + } + } + + return true; + } + + public static function mb_detect_encoding($str, $encodingList = null, $strict = false) + { + if (null === $encodingList) { + $encodingList = self::$encodingList; + } else { + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + } + + foreach ($encodingList as $enc) { + switch ($enc) { + case 'ASCII': + if (!preg_match('/[\x80-\xFF]/', $str)) { + return $enc; + } + break; + + case 'UTF8': + case 'UTF-8': + if (preg_match('//u', $str)) { + return 'UTF-8'; + } + break; + + default: + if (0 === strncmp($enc, 'ISO-8859-', 9)) { + return $enc; + } + } + } + + return false; + } + + public static function mb_detect_order($encodingList = null) + { + if (null === $encodingList) { + return self::$encodingList; + } + + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + + foreach ($encodingList as $enc) { + switch ($enc) { + default: + if (strncmp($enc, 'ISO-8859-', 9)) { + return false; + } + // no break + case 'ASCII': + case 'UTF8': + case 'UTF-8': + } + } + + self::$encodingList = $encodingList; + + return true; + } + + public static function mb_strlen($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return \strlen($s); + } + + return @iconv_strlen($s, $encoding); + } + + public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strpos($haystack, $needle, $offset); + } + + $needle = (string) $needle; + if ('' === $needle) { + if (80000 > \PHP_VERSION_ID) { + trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); + + return false; + } + + return 0; + } + + return iconv_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strrpos($haystack, $needle, $offset); + } + + if ($offset != (int) $offset) { + $offset = 0; + } elseif ($offset = (int) $offset) { + if ($offset < 0) { + if (0 > $offset += self::mb_strlen($needle)) { + $haystack = self::mb_substr($haystack, 0, $offset, $encoding); + } + $offset = 0; + } else { + $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); + } + } + + $pos = '' !== $needle || 80000 > \PHP_VERSION_ID + ? iconv_strrpos($haystack, $needle, $encoding) + : self::mb_strlen($haystack, $encoding); + + return false !== $pos ? $offset + $pos : false; + } + + public static function mb_str_split($string, $split_length = 1, $encoding = null) + { + if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { + trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); + + return null; + } + + if (1 > $split_length = (int) $split_length) { + if (80000 > \PHP_VERSION_ID) { + trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); + + return false; + } + + throw new \ValueError('Argument #2 ($length) must be greater than 0'); + } + + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + if ('UTF-8' === $encoding = self::getEncoding($encoding)) { + $rx = '/('; + while (65535 < $split_length) { + $rx .= '.{65535}'; + $split_length -= 65535; + } + $rx .= '.{'.$split_length.'})/us'; + + return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); + } + + $result = []; + $length = mb_strlen($string, $encoding); + + for ($i = 0; $i < $length; $i += $split_length) { + $result[] = mb_substr($string, $i, $split_length, $encoding); + } + + return $result; + } + + public static function mb_strtolower($s, $encoding = null) + { + return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); + } + + public static function mb_strtoupper($s, $encoding = null) + { + return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); + } + + public static function mb_substitute_character($c = null) + { + if (null === $c) { + return 'none'; + } + if (0 === strcasecmp($c, 'none')) { + return true; + } + if (80000 > \PHP_VERSION_ID) { + return false; + } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } + + throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); + } + + public static function mb_substr($s, $start, $length = null, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return (string) substr($s, $start, null === $length ? 2147483647 : $length); + } + + if ($start < 0) { + $start = iconv_strlen($s, $encoding) + $start; + if ($start < 0) { + $start = 0; + } + } + + if (null === $length) { + $length = 2147483647; + } elseif ($length < 0) { + $length = iconv_strlen($s, $encoding) + $length - $start; + if ($length < 0) { + return ''; + } + } + + return (string) iconv_substr($s, $start, $length, $encoding); + } + + public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) + { + [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ + self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), + self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), + ]); + + return self::mb_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) + { + $pos = self::mb_stripos($haystack, $needle, 0, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + $pos = strrpos($haystack, $needle); + } else { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); + } + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) + { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = self::mb_strripos($haystack, $needle, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) + { + $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); + $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); + + $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); + $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); + + return self::mb_strrpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) + { + $pos = strpos($haystack, $needle); + if (false === $pos) { + return false; + } + if ($part) { + return substr($haystack, 0, $pos); + } + + return substr($haystack, $pos); + } + + public static function mb_get_info($type = 'all') + { + $info = [ + 'internal_encoding' => self::$internalEncoding, + 'http_output' => 'pass', + 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', + 'func_overload' => 0, + 'func_overload_list' => 'no overload', + 'mail_charset' => 'UTF-8', + 'mail_header_encoding' => 'BASE64', + 'mail_body_encoding' => 'BASE64', + 'illegal_chars' => 0, + 'encoding_translation' => 'Off', + 'language' => self::$language, + 'detect_order' => self::$encodingList, + 'substitute_character' => 'none', + 'strict_detection' => 'Off', + ]; + + if ('all' === $type) { + return $info; + } + if (isset($info[$type])) { + return $info[$type]; + } + + return false; + } + + public static function mb_http_input($type = '') + { + return false; + } + + public static function mb_http_output($encoding = null) + { + return null !== $encoding ? 'pass' === $encoding : 'pass'; + } + + public static function mb_strwidth($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + + if ('UTF-8' !== $encoding) { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); + + return ($wide << 1) + iconv_strlen($s, 'UTF-8'); + } + + public static function mb_substr_count($haystack, $needle, $encoding = null) + { + return substr_count($haystack, $needle); + } + + public static function mb_output_handler($contents, $status) + { + return $contents; + } + + public static function mb_chr($code, $encoding = null) + { + if (0x80 > $code %= 0x200000) { + $s = \chr($code); + } elseif (0x800 > $code) { + $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); + } elseif (0x10000 > $code) { + $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } else { + $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } + + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, $encoding, 'UTF-8'); + } + + return $s; + } + + public static function mb_ord($s, $encoding = null) + { + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, 'UTF-8', $encoding); + } + + if (1 === \strlen($s)) { + return \ord($s); + } + + $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $s[2] - 0x80; + } + + return $code; + } + + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string + { + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); + } + + if (self::mb_strlen($pad_string, $encoding) <= 0) { + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + $paddingRequired = $length - self::mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + + public static function mb_ucfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + public static function mb_lcfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + private static function getSubpart($pos, $part, $haystack, $encoding) + { + if (false === $pos) { + return false; + } + if ($part) { + return self::mb_substr($haystack, 0, $pos, $encoding); + } + + return self::mb_substr($haystack, $pos, null, $encoding); + } + + private static function html_encoding_callback(array $m) + { + $i = 1; + $entities = ''; + $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); + + while (isset($m[$i])) { + if (0x80 > $m[$i]) { + $entities .= \chr($m[$i++]); + continue; + } + if (0xF0 <= $m[$i]) { + $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } elseif (0xE0 <= $m[$i]) { + $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } else { + $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; + } + + $entities .= '&#'.$c.';'; + } + + return $entities; + } + + private static function title_case(array $s) + { + return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); + } + + private static function getData($file) + { + if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + return require $file; + } + + return false; + } + + private static function getEncoding($encoding) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + if ('UTF-8' === $encoding) { + return 'UTF-8'; + } + + $encoding = strtoupper($encoding); + + if ('8BIT' === $encoding || 'BINARY' === $encoding) { + return 'CP850'; + } + + if ('UTF8' === $encoding) { + return 'UTF-8'; + } + + return $encoding; + } + + private static function assertEncoding(string $encoding, string $errorFormat): void + { + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(\sprintf($errorFormat, $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(\sprintf($errorFormat, $encoding)); + } + } +} diff --git a/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php new file mode 100644 index 00000000..512bba0b --- /dev/null +++ b/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php @@ -0,0 +1,119 @@ + 'i̇', + 'µ' => 'μ', + 'ſ' => 's', + 'ͅ' => 'ι', + 'ς' => 'σ', + 'ϐ' => 'β', + 'ϑ' => 'θ', + 'ϕ' => 'φ', + 'ϖ' => 'π', + 'ϰ' => 'κ', + 'ϱ' => 'ρ', + 'ϵ' => 'ε', + 'ẛ' => 'ṡ', + 'ι' => 'ι', + 'ß' => 'ss', + 'ʼn' => 'ʼn', + 'ǰ' => 'ǰ', + 'ΐ' => 'ΐ', + 'ΰ' => 'ΰ', + 'և' => 'եւ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẚ' => 'aʾ', + 'ẞ' => 'ss', + 'ὐ' => 'ὐ', + 'ὒ' => 'ὒ', + 'ὔ' => 'ὔ', + 'ὖ' => 'ὖ', + 'ᾀ' => 'ἀι', + 'ᾁ' => 'ἁι', + 'ᾂ' => 'ἂι', + 'ᾃ' => 'ἃι', + 'ᾄ' => 'ἄι', + 'ᾅ' => 'ἅι', + 'ᾆ' => 'ἆι', + 'ᾇ' => 'ἇι', + 'ᾈ' => 'ἀι', + 'ᾉ' => 'ἁι', + 'ᾊ' => 'ἂι', + 'ᾋ' => 'ἃι', + 'ᾌ' => 'ἄι', + 'ᾍ' => 'ἅι', + 'ᾎ' => 'ἆι', + 'ᾏ' => 'ἇι', + 'ᾐ' => 'ἠι', + 'ᾑ' => 'ἡι', + 'ᾒ' => 'ἢι', + 'ᾓ' => 'ἣι', + 'ᾔ' => 'ἤι', + 'ᾕ' => 'ἥι', + 'ᾖ' => 'ἦι', + 'ᾗ' => 'ἧι', + 'ᾘ' => 'ἠι', + 'ᾙ' => 'ἡι', + 'ᾚ' => 'ἢι', + 'ᾛ' => 'ἣι', + 'ᾜ' => 'ἤι', + 'ᾝ' => 'ἥι', + 'ᾞ' => 'ἦι', + 'ᾟ' => 'ἧι', + 'ᾠ' => 'ὠι', + 'ᾡ' => 'ὡι', + 'ᾢ' => 'ὢι', + 'ᾣ' => 'ὣι', + 'ᾤ' => 'ὤι', + 'ᾥ' => 'ὥι', + 'ᾦ' => 'ὦι', + 'ᾧ' => 'ὧι', + 'ᾨ' => 'ὠι', + 'ᾩ' => 'ὡι', + 'ᾪ' => 'ὢι', + 'ᾫ' => 'ὣι', + 'ᾬ' => 'ὤι', + 'ᾭ' => 'ὥι', + 'ᾮ' => 'ὦι', + 'ᾯ' => 'ὧι', + 'ᾲ' => 'ὰι', + 'ᾳ' => 'αι', + 'ᾴ' => 'άι', + 'ᾶ' => 'ᾶ', + 'ᾷ' => 'ᾶι', + 'ᾼ' => 'αι', + 'ῂ' => 'ὴι', + 'ῃ' => 'ηι', + 'ῄ' => 'ήι', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῆι', + 'ῌ' => 'ηι', + 'ῒ' => 'ῒ', + 'ῖ' => 'ῖ', + 'ῗ' => 'ῗ', + 'ῢ' => 'ῢ', + 'ῤ' => 'ῤ', + 'ῦ' => 'ῦ', + 'ῧ' => 'ῧ', + 'ῲ' => 'ὼι', + 'ῳ' => 'ωι', + 'ῴ' => 'ώι', + 'ῶ' => 'ῶ', + 'ῷ' => 'ῶι', + 'ῼ' => 'ωι', + 'ff' => 'ff', + 'fi' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'մն', + 'ﬔ' => 'մե', + 'ﬕ' => 'մի', + 'ﬖ' => 'վն', + 'ﬗ' => 'մխ', +]; diff --git a/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php new file mode 100644 index 00000000..fac60b08 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -0,0 +1,1397 @@ + 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + 'À' => 'à', + 'Á' => 'á', + 'Â' => 'â', + 'Ã' => 'ã', + 'Ä' => 'ä', + 'Å' => 'å', + 'Æ' => 'æ', + 'Ç' => 'ç', + 'È' => 'è', + 'É' => 'é', + 'Ê' => 'ê', + 'Ë' => 'ë', + 'Ì' => 'ì', + 'Í' => 'í', + 'Î' => 'î', + 'Ï' => 'ï', + 'Ð' => 'ð', + 'Ñ' => 'ñ', + 'Ò' => 'ò', + 'Ó' => 'ó', + 'Ô' => 'ô', + 'Õ' => 'õ', + 'Ö' => 'ö', + 'Ø' => 'ø', + 'Ù' => 'ù', + 'Ú' => 'ú', + 'Û' => 'û', + 'Ü' => 'ü', + 'Ý' => 'ý', + 'Þ' => 'þ', + 'Ā' => 'ā', + 'Ă' => 'ă', + 'Ą' => 'ą', + 'Ć' => 'ć', + 'Ĉ' => 'ĉ', + 'Ċ' => 'ċ', + 'Č' => 'č', + 'Ď' => 'ď', + 'Đ' => 'đ', + 'Ē' => 'ē', + 'Ĕ' => 'ĕ', + 'Ė' => 'ė', + 'Ę' => 'ę', + 'Ě' => 'ě', + 'Ĝ' => 'ĝ', + 'Ğ' => 'ğ', + 'Ġ' => 'ġ', + 'Ģ' => 'ģ', + 'Ĥ' => 'ĥ', + 'Ħ' => 'ħ', + 'Ĩ' => 'ĩ', + 'Ī' => 'ī', + 'Ĭ' => 'ĭ', + 'Į' => 'į', + 'İ' => 'i̇', + 'IJ' => 'ij', + 'Ĵ' => 'ĵ', + 'Ķ' => 'ķ', + 'Ĺ' => 'ĺ', + 'Ļ' => 'ļ', + 'Ľ' => 'ľ', + 'Ŀ' => 'ŀ', + 'Ł' => 'ł', + 'Ń' => 'ń', + 'Ņ' => 'ņ', + 'Ň' => 'ň', + 'Ŋ' => 'ŋ', + 'Ō' => 'ō', + 'Ŏ' => 'ŏ', + 'Ő' => 'ő', + 'Œ' => 'œ', + 'Ŕ' => 'ŕ', + 'Ŗ' => 'ŗ', + 'Ř' => 'ř', + 'Ś' => 'ś', + 'Ŝ' => 'ŝ', + 'Ş' => 'ş', + 'Š' => 'š', + 'Ţ' => 'ţ', + 'Ť' => 'ť', + 'Ŧ' => 'ŧ', + 'Ũ' => 'ũ', + 'Ū' => 'ū', + 'Ŭ' => 'ŭ', + 'Ů' => 'ů', + 'Ű' => 'ű', + 'Ų' => 'ų', + 'Ŵ' => 'ŵ', + 'Ŷ' => 'ŷ', + 'Ÿ' => 'ÿ', + 'Ź' => 'ź', + 'Ż' => 'ż', + 'Ž' => 'ž', + 'Ɓ' => 'ɓ', + 'Ƃ' => 'ƃ', + 'Ƅ' => 'ƅ', + 'Ɔ' =>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' => 'ξ', + 'Ο' => 'ο', + 'Π' => 'π', + 'Ρ' => 'ρ', + 'Σ' => 'σ', + 'Τ' => 'τ', + 'Υ' => 'υ', + 'Φ' => 'φ', + 'Χ' => 'χ', + 'Ψ' => 'ψ', + 'Ω' => 'ω', + 'Ϊ' => 'ϊ', + 'Ϋ' => 'ϋ', + 'Ϗ' => 'ϗ', + 'Ϙ' => 'ϙ', + 'Ϛ' => 'ϛ', + 'Ϝ' => 'ϝ', + 'Ϟ' => 'ϟ', + 'Ϡ' => 'ϡ', + 'Ϣ' => 'ϣ', + 'Ϥ' => 'ϥ', + 'Ϧ' => 'ϧ', + 'Ϩ' => 'ϩ', + 'Ϫ' => 'ϫ', + 'Ϭ' => 'ϭ', + 'Ϯ' => 'ϯ', + 'ϴ' => 'θ', + 'Ϸ' => 'ϸ', + 'Ϲ' => 'ϲ', + 'Ϻ' => 'ϻ', + 'Ͻ' => 'ͻ', + 'Ͼ' => 'ͼ', + 'Ͽ' => 'ͽ', + 'Ѐ' => 'ѐ', + 'Ё' => 'ё', + 'Ђ' => 'ђ', + 'Ѓ' => 'ѓ', + 'Є' => 'є', + 'Ѕ' => 'ѕ', + 'І' => 'і', + 'Ї' => 'ї', + 'Ј' => 'ј', + 'Љ' => 'љ', + 'Њ' => 'њ', + 'Ћ' => 'ћ', + 'Ќ' => 'ќ', + 'Ѝ' => 'ѝ', + 'Ў' => 'ў', + 'Џ' => 'џ', + 'А' => 'а', + 'Б' => 'б', + 'В' => 'в', + 'Г' => 'г', + 'Д' => 'д', + 'Е' => 'е', + 'Ж' => 'ж', + 'З' => 'з', + 'И' => 'и', + 'Й' => 'й', + 'К' => 'к', + 'Л' => 'л', + 'М' => 'м', + 'Н' => 'н', + 'О' => 'о', + 'П' => 'п', + 'Р' => 'р', + 'С' => 'с', + 'Т' => 'т', + 'У' => 'у', + 'Ф' => 'ф', + 'Х' => 'х', + 'Ц' => 'ц', + 'Ч' => 'ч', + 'Ш' => 'ш', + 'Щ' => 'щ',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 'Ꭳ' => 'ꭳ', + 'Ꭴ' => 'ꭴ', + 'Ꭵ' => 'ꭵ', + 'Ꭶ' => 'ꭶ', + 'Ꭷ' => 'ꭷ', + 'Ꭸ' => 'ꭸ', + 'Ꭹ' => 'ꭹ', + 'Ꭺ' => 'ꭺ', + 'Ꭻ' => 'ꭻ', + 'Ꭼ' => 'ꭼ', + 'Ꭽ' => 'ꭽ', + 'Ꭾ' => 'ꭾ', + 'Ꭿ' => 'ꭿ', + 'Ꮀ' => 'ꮀ', + 'Ꮁ' => 'ꮁ', + 'Ꮂ' => 'ꮂ', + 'Ꮃ' => 'ꮃ', + 'Ꮄ' => 'ꮄ', + 'Ꮅ' => 'ꮅ', + 'Ꮆ' => 'ꮆ', + 'Ꮇ' => 'ꮇ', + 'Ꮈ' => 'ꮈ', + 'Ꮉ' => 'ꮉ', + 'Ꮊ' => 'ꮊ', + 'Ꮋ' => 'ꮋ', + 'Ꮌ' => 'ꮌ', + 'Ꮍ' => 'ꮍ', + 'Ꮎ' => 'ꮎ', + 'Ꮏ' => 'ꮏ', + 'Ꮐ' => 'ꮐ', + 'Ꮑ' => 'ꮑ', + 'Ꮒ' => 'ꮒ', + 'Ꮓ' => 'ꮓ', + 'Ꮔ' => 'ꮔ', + 'Ꮕ' => 'ꮕ', + 'Ꮖ' => 'ꮖ', + 'Ꮗ' => 'ꮗ', + 'Ꮘ' => 'ꮘ', + 'Ꮙ' => 'ꮙ', + 'Ꮚ' => 'ꮚ', + 'Ꮛ' => 'ꮛ', + 'Ꮜ' => 'ꮜ', + 'Ꮝ' => 'ꮝ', + 'Ꮞ' => 'ꮞ', + 'Ꮟ' => 'ꮟ', + 'Ꮠ' => 'ꮠ', + 'Ꮡ' => 'ꮡ', + 'Ꮢ' => 'ꮢ', + 'Ꮣ' => 'ꮣ', + 'Ꮤ' => 'ꮤ', + 'Ꮥ' => 'ꮥ', + 'Ꮦ' => 'ꮦ', + 'Ꮧ' => 'ꮧ', + 'Ꮨ' => 'ꮨ', + 'Ꮩ' => 'ꮩ', + 'Ꮪ' => 'ꮪ', + 'Ꮫ' => 'ꮫ', + 'Ꮬ' => 'ꮬ', + 'Ꮭ' => 'ꮭ', + 'Ꮮ' => 'ꮮ', + 'Ꮯ' => 'ꮯ', + 'Ꮰ' => 'ꮰ', + 'Ꮱ' => 'ꮱ', + 'Ꮲ' => 'ꮲ', + 'Ꮳ' => 'ꮳ', + 'Ꮴ' => 'ꮴ', + 'Ꮵ' => 'ꮵ', + 'Ꮶ' => 'ꮶ', + 'Ꮷ' => 'ꮷ', + 'Ꮸ' => 'ꮸ', + 'Ꮹ' => 'ꮹ', + 'Ꮺ' => 'ꮺ', + 'Ꮻ' => 'ꮻ', + 'Ꮼ' => 'ꮼ', + 'Ꮽ' => 'ꮽ', + 'Ꮾ' => 'ꮾ', + 'Ꮿ' => 'ꮿ', + 'Ᏸ' => 'ᏸ', + 'Ᏹ' => 'ᏹ', + 'Ᏺ' => 'ᏺ', + 'Ᏻ' => 'ᏻ', + 'Ᏼ' => 'ᏼ', + 'Ᏽ' => 'ᏽ', + 'Ა' => 'ა', + 'Ბ' => 'ბ', + 'Გ' => 'გ', + 'Დ' => 'დ', + 'Ე' => 'ე', + 'Ვ' => 'ვ', + 'Ზ' => 'ზ', + 'Თ' => 'თ', + 'Ი' => 'ი', + 'Კ' => 'კ', + 'Ლ' => 'ლ', + 'Მ' => 'მ', + 'Ნ' => 'ნ', + 'Ო' => 'ო', + 'Პ' => 'პ', + 'Ჟ' => 'ჟ', + 'Რ' => 'რ', + 'Ს' => 'ს', + 'Ტ' => 'ტ', + 'Უ' => 'უ', + 'Ფ' => 'ფ', + 'Ქ' => 'ქ', + 'Ღ' => 'ღ', + 'Ყ' => 'ყ', + 'Შ' => 'შ', + 'Ჩ' => 'ჩ', + 'Ც' => 'ც', + 'Ძ' => 'ძ', + 'Წ' => 'წ', + 'Ჭ' => 'ჭ', + 'Ხ' => 'ხ', + 'Ჯ' => 'ჯ', + 'Ჰ' => 'ჰ', + 'Ჱ' => 'ჱ', + 'Ჲ' => 'ჲ', + 'Ჳ' => 'ჳ', + 'Ჴ' => 'ჴ', + 'Ჵ' => 'ჵ', + 'Ჶ' => 'ჶ', + 'Ჷ' => 'ჷ', + 'Ჸ' => 'ჸ', + 'Ჹ' => 'ჹ', + 'Ჺ' => 'ჺ', + 'Ჽ' => 'ჽ', + 'Ჾ' => 'ჾ', + 'Ჿ' => 'ჿ', + 'Ḁ' => 'ḁ', + 'Ḃ' => 'ḃ', + 'Ḅ' => 'ḅ', + 'Ḇ' => 'ḇ', + 'Ḉ' => 'ḉ', + 'Ḋ' => 'ḋ', + 'Ḍ' => 'ḍ', + 'Ḏ' => 'ḏ', + 'Ḑ' => 'ḑ', + 'Ḓ' => 'ḓ', + 'Ḕ' => 'ḕ', + 'Ḗ' => 'ḗ', + 'Ḙ' => 'ḙ', + 'Ḛ' => 'ḛ', + 'Ḝ' => 'ḝ', + 'Ḟ' => 'ḟ', + 'Ḡ' => 'ḡ', + 'Ḣ' => 'ḣ', + 'Ḥ' => 'ḥ', + 'Ḧ' => 'ḧ', + 'Ḩ' => 'ḩ', + 'Ḫ' => 'ḫ', + 'Ḭ' => 'ḭ', + 'Ḯ' => 'ḯ', + 'Ḱ' => 'ḱ', + 'Ḳ' => 'ḳ', + 'Ḵ' => 'ḵ', + 'Ḷ' => 'ḷ', + 'Ḹ' => 'ḹ', + 'Ḻ' => 'ḻ', + 'Ḽ' => 'ḽ', + 'Ḿ' => 'ḿ', + 'Ṁ' => 'ṁ', + 'Ṃ' => 'ṃ', + 'Ṅ' => 'ṅ', + 'Ṇ' => 'ṇ', + 'Ṉ' => 'ṉ', + 'Ṋ' => 'ṋ', + 'Ṍ' => 'ṍ', + 'Ṏ' => 'ṏ', + 'Ṑ' => 'ṑ', + 'Ṓ' => 'ṓ', + 'Ṕ' => 'ṕ', + 'Ṗ' => 'ṗ', + 'Ṙ' => 'ṙ', + 'Ṛ' => 'ṛ', + 'Ṝ' => 'ṝ', + 'Ṟ' => 'ṟ', + 'Ṡ' => 'ṡ', + 'Ṣ' => 'ṣ', + 'Ṥ' => 'ṥ', + 'Ṧ' => 'ṧ', + 'Ṩ' => 'ṩ', + 'Ṫ' => 'ṫ', + 'Ṭ' => 'ṭ', + 'Ṯ' => 'ṯ', + 'Ṱ' => 'ṱ', + 'Ṳ' => 'ṳ', + 'Ṵ' => 'ṵ', + 'Ṷ' => 'ṷ', + 'Ṹ' => 'ṹ', + 'Ṻ' => 'ṻ', + 'Ṽ' => 'ṽ', + 'Ṿ' => 'ṿ', + 'Ẁ' => 'ẁ', + 'Ẃ' => 'ẃ', + 'Ẅ' => 'ẅ', + 'Ẇ' => 'ẇ', + 'Ẉ' => 'ẉ', + 'Ẋ' => 'ẋ', + 'Ẍ' => 'ẍ', + 'Ẏ' => 'ẏ', + 'Ẑ' => 'ẑ', + 'Ẓ' => 'ẓ', + 'Ẕ' => 'ẕ', + 'ẞ' => 'ß', + 'Ạ' => 'ạ', + 'Ả' => 'ả', + 'Ấ' => 'ấ', + 'Ầ' => 'ầ', + 'Ẩ' => 'ẩ', + 'Ẫ' => 'ẫ', + 'Ậ' => 'ậ', + 'Ắ' => 'ắ', + 'Ằ' => 'ằ', + 'Ẳ' => 'ẳ', + 'Ẵ' => 'ẵ', + 'Ặ' => 'ặ', + 'Ẹ' => 'ẹ', + 'Ẻ' => 'ẻ', + 'Ẽ' => 'ẽ', + 'Ế' => 'ế', + 'Ề' => 'ề', + 'Ể' => 'ể', + 'Ễ' => 'ễ', + 'Ệ' => 'ệ', + 'Ỉ' => 'ỉ', + 'Ị' => 'ị', + 'Ọ' => 'ọ', + 'Ỏ' => 'ỏ', + 'Ố' => 'ố', + 'Ồ' => 'ồ', + 'Ổ' => 'ổ', + 'Ỗ' => 'ỗ', + 'Ộ' => 'ộ', + 'Ớ' => 'ớ', + 'Ờ' => 'ờ', + 'Ở' => 'ở', + 'Ỡ' => 'ỡ', + 'Ợ' => 'ợ', + 'Ụ' => 'ụ', + 'Ủ' => 'ủ', + 'Ứ' => 'ứ', + 'Ừ' => 'ừ', + 'Ử' => 'ử', + 'Ữ' => 'ữ', + 'Ự' => 'ự', + 'Ỳ' => 'ỳ', + 'Ỵ' => 'ỵ', + 'Ỷ' => 'ỷ', + 'Ỹ' => 'ỹ', + 'Ỻ' => 'ỻ', + 'Ỽ' => 'ỽ', + 'Ỿ' => 'ỿ', + 'Ἀ' => 'ἀ', + 'Ἁ' => 'ἁ', + 'Ἂ' => 'ἂ', + 'Ἃ' => 'ἃ', + 'Ἄ' => 'ἄ', + 'Ἅ' => 'ἅ', + 'Ἆ' => 'ἆ', + 'Ἇ' => 'ἇ', + 'Ἐ' => 'ἐ', + 'Ἑ' => 'ἑ', + 'Ἒ' => 'ἒ', + 'Ἓ' => 'ἓ', + 'Ἔ' => 'ἔ', + 'Ἕ' => 'ἕ', + 'Ἠ' => 'ἠ', + 'Ἡ' => 'ἡ', + 'Ἢ' => 'ἢ', + 'Ἣ' => 'ἣ', + 'Ἤ' => 'ἤ', + 'Ἥ' => 'ἥ', + 'Ἦ' => 'ἦ', + 'Ἧ' => 'ἧ', + 'Ἰ' => 'ἰ', + 'Ἱ' => 'ἱ', + 'Ἲ' => 'ἲ', + 'Ἳ' => 'ἳ', + 'Ἴ' => 'ἴ', + 'Ἵ' => 'ἵ', + 'Ἶ' => 'ἶ', + 'Ἷ' => 'ἷ', + 'Ὀ' => 'ὀ', + 'Ὁ' => 'ὁ', + 'Ὂ' => 'ὂ', + 'Ὃ' => 'ὃ', + 'Ὄ' => 'ὄ', + 'Ὅ' => 'ὅ', + 'Ὑ' => 'ὑ', + 'Ὓ' => 'ὓ', + 'Ὕ' => 'ὕ', + 'Ὗ' => 'ὗ', + 'Ὠ' => 'ὠ', + 'Ὡ' => 'ὡ', + 'Ὢ' => 'ὢ', + 'Ὣ' => 'ὣ', + 'Ὤ' => 'ὤ', + 'Ὥ' => 'ὥ', + 'Ὦ' => 'ὦ', + 'Ὧ' => 'ὧ', + 'ᾈ' => 'ᾀ', + 'ᾉ' => 'ᾁ', + 'ᾊ' => 'ᾂ', + 'ᾋ' => 'ᾃ', + 'ᾌ' => 'ᾄ', + 'ᾍ' => 'ᾅ', + 'ᾎ' => 'ᾆ', + 'ᾏ' => 'ᾇ', + 'ᾘ' => 'ᾐ', + 'ᾙ' => 'ᾑ', + 'ᾚ' => 'ᾒ', + 'ᾛ' => 'ᾓ', + 'ᾜ' => 'ᾔ', + 'ᾝ' => 'ᾕ', + 'ᾞ' => 'ᾖ', + 'ᾟ' => 'ᾗ', + 'ᾨ' => 'ᾠ', + 'ᾩ' => 'ᾡ', + 'ᾪ' => 'ᾢ', + 'ᾫ' => 'ᾣ', + 'ᾬ' => 'ᾤ', + 'ᾭ' => 'ᾥ', + 'ᾮ' => 'ᾦ', + 'ᾯ' => 'ᾧ', + 'Ᾰ' => 'ᾰ', + 'Ᾱ' => 'ᾱ', + 'Ὰ' => 'ὰ', + 'Ά' => 'ά', + 'ᾼ' => 'ᾳ', + 'Ὲ' => 'ὲ', + 'Έ' => 'έ', + 'Ὴ' => 'ὴ', + 'Ή' => 'ή', + 'ῌ' => 'ῃ', + 'Ῐ' => 'ῐ', + 'Ῑ' => 'ῑ', + 'Ὶ' => 'ὶ', + 'Ί' => 'ί', + 'Ῠ' => 'ῠ', + 'Ῡ' => 'ῡ', + 'Ὺ' => 'ὺ', + 'Ύ' => 'ύ', + 'Ῥ' => 'ῥ', + 'Ὸ' => 'ὸ', + 'Ό' => 'ό', + 'Ὼ' => 'ὼ', + 'Ώ' => 'ώ', + 'ῼ' => 'ῳ', + 'Ω' => 'ω', + 'K' => 'k', + 'Å' => 'å', + 'Ⅎ' => 'ⅎ', + 'Ⅰ' => 'ⅰ', + 'Ⅱ' => 'ⅱ', + 'Ⅲ' => 'ⅲ', + 'Ⅳ' => 'ⅳ', + 'Ⅴ' => 'ⅴ', + 'Ⅵ' => 'ⅵ', + 'Ⅶ' => 'ⅶ', + 'Ⅷ' => 'ⅷ', + 'Ⅸ' => 'ⅸ', + 'Ⅹ' => 'ⅹ', + 'Ⅺ' => 'ⅺ', + 'Ⅻ' => 'ⅻ', + 'Ⅼ' => 'ⅼ', + 'Ⅽ' => 'ⅽ', + 'Ⅾ' => 'ⅾ', + 'Ⅿ' => 'ⅿ', + 'Ↄ' => 'ↄ', + 'Ⓐ' => 'ⓐ', + 'Ⓑ' => 'ⓑ', + 'Ⓒ' => 'ⓒ', + 'Ⓓ' => 'ⓓ', + 'Ⓔ' => 'ⓔ', + 'Ⓕ' => 'ⓕ', + 'Ⓖ' => 'ⓖ', + 'Ⓗ' => 'ⓗ', + 'Ⓘ' => 'ⓘ', + 'Ⓙ' => 'ⓙ', + 'Ⓚ' => 'ⓚ', + 'Ⓛ' => 'ⓛ', + 'Ⓜ' => 'ⓜ', + 'Ⓝ' => 'ⓝ', + 'Ⓞ' => 'ⓞ', + 'Ⓟ' => 'ⓟ', + 'Ⓠ' => 'ⓠ', + 'Ⓡ' => 'ⓡ', + 'Ⓢ' => 'ⓢ', + 'Ⓣ' => 'ⓣ', + 'Ⓤ' => 'ⓤ', + 'Ⓥ' => 'ⓥ', + 'Ⓦ' => 'ⓦ', + 'Ⓧ' => 'ⓧ', + 'Ⓨ' => 'ⓨ', + 'Ⓩ' => 'ⓩ', + 'Ⰰ' => 'ⰰ', + 'Ⰱ' => 'ⰱ', + 'Ⰲ' => 'ⰲ', + 'Ⰳ' => 'ⰳ', + 'Ⰴ' => 'ⰴ', + 'Ⰵ' => 'ⰵ', + 'Ⰶ' => 'ⰶ', + 'Ⰷ' => 'ⰷ', + 'Ⰸ' => 'ⰸ', + 'Ⰹ' => 'ⰹ', + 'Ⰺ' => 'ⰺ', + 'Ⰻ' => 'ⰻ', + 'Ⰼ' => 'ⰼ', + 'Ⰽ' => 'ⰽ', + 'Ⰾ' => 'ⰾ', + 'Ⰿ' => 'ⰿ', + 'Ⱀ' => 'ⱀ', + 'Ⱁ' => 'ⱁ', + 'Ⱂ' => 'ⱂ', + 'Ⱃ' => 'ⱃ', + 'Ⱄ' => 'ⱄ', + 'Ⱅ' => 'ⱅ', + 'Ⱆ' => 'ⱆ', + 'Ⱇ' => 'ⱇ', + 'Ⱈ' => 'ⱈ', + 'Ⱉ' => 'ⱉ', + 'Ⱊ' => 'ⱊ', + 'Ⱋ' => 'ⱋ', + 'Ⱌ' => 'ⱌ', + 'Ⱍ' => 'ⱍ', + 'Ⱎ' => 'ⱎ', + 'Ⱏ' => 'ⱏ', + 'Ⱐ' => 'ⱐ', + 'Ⱑ' => 'ⱑ', + 'Ⱒ' => 'ⱒ', + 'Ⱓ' => 'ⱓ', + 'Ⱔ' => 'ⱔ', + 'Ⱕ' => 'ⱕ', + 'Ⱖ' => 'ⱖ', + 'Ⱗ' => 'ⱗ', + 'Ⱘ' => 'ⱘ', + 'Ⱙ' => 'ⱙ', + 'Ⱚ' => 'ⱚ', + 'Ⱛ' => 'ⱛ', + 'Ⱜ' => 'ⱜ', + 'Ⱝ' => 'ⱝ', + 'Ⱞ' => 'ⱞ', + 'Ⱡ' => 'ⱡ', + 'Ɫ' => 'ɫ', + 'Ᵽ' => 'ᵽ', + 'Ɽ' => 'ɽ', + 'Ⱨ' => 'ⱨ', + 'Ⱪ' => 'ⱪ', + 'Ⱬ' => 'ⱬ', + 'Ɑ' => 'ɑ', + 'Ɱ' => 'ɱ', + 'Ɐ' => 'ɐ', + 'Ɒ' => 'ɒ', + 'Ⱳ' => 'ⱳ', + 'Ⱶ' => 'ⱶ', + 'Ȿ' => 'ȿ', + 'Ɀ' => 'ɀ', + 'Ⲁ' => 'ⲁ', + 'Ⲃ' => 'ⲃ', + 'Ⲅ' => 'ⲅ', + 'Ⲇ' => 'ⲇ', + 'Ⲉ' => 'ⲉ', + 'Ⲋ' => 'ⲋ', + 'Ⲍ' => 'ⲍ', + 'Ⲏ' => 'ⲏ', + 'Ⲑ' => 'ⲑ', + 'Ⲓ' => 'ⲓ', + 'Ⲕ' => 'ⲕ', + 'Ⲗ' => 'ⲗ', + 'Ⲙ' => 'ⲙ', + 'Ⲛ' => 'ⲛ', + 'Ⲝ' => 'ⲝ', + 'Ⲟ' => 'ⲟ', + 'Ⲡ' => 'ⲡ', + 'Ⲣ' => 'ⲣ', + 'Ⲥ' => 'ⲥ', + 'Ⲧ' => 'ⲧ', + 'Ⲩ' => 'ⲩ', + 'Ⲫ' => 'ⲫ', + 'Ⲭ' => 'ⲭ', + 'Ⲯ' => 'ⲯ', + 'Ⲱ' => 'ⲱ', + 'Ⲳ' => 'ⲳ', + 'Ⲵ' => 'ⲵ', + 'Ⲷ' => 'ⲷ', + 'Ⲹ' => 'ⲹ', + 'Ⲻ' => 'ⲻ', + 'Ⲽ' => 'ⲽ', + 'Ⲿ' => 'ⲿ', + 'Ⳁ' => 'ⳁ', + 'Ⳃ' => 'ⳃ', + 'Ⳅ' => 'ⳅ', + 'Ⳇ' => 'ⳇ', + 'Ⳉ' => 'ⳉ', + 'Ⳋ' => 'ⳋ', + 'Ⳍ' => 'ⳍ', + 'Ⳏ' => 'ⳏ', + 'Ⳑ' => 'ⳑ', + 'Ⳓ' => 'ⳓ', + 'Ⳕ' => 'ⳕ', + 'Ⳗ' => 'ⳗ', + 'Ⳙ' => 'ⳙ', + 'Ⳛ' => 'ⳛ', + 'Ⳝ' => 'ⳝ', + 'Ⳟ' => 'ⳟ', + 'Ⳡ' => 'ⳡ', + 'Ⳣ' => 'ⳣ', + 'Ⳬ' => 'ⳬ', + 'Ⳮ' => 'ⳮ', + 'Ⳳ' => 'ⳳ', + 'Ꙁ' => 'ꙁ', + 'Ꙃ' => 'ꙃ', + 'Ꙅ' => 'ꙅ', + 'Ꙇ' => 'ꙇ', + 'Ꙉ' => 'ꙉ', + 'Ꙋ' => 'ꙋ', + 'Ꙍ' => 'ꙍ', + 'Ꙏ' => 'ꙏ', + 'Ꙑ' => 'ꙑ', + 'Ꙓ' => 'ꙓ', + 'Ꙕ' => 'ꙕ', + 'Ꙗ' => 'ꙗ', + 'Ꙙ' => 'ꙙ', + 'Ꙛ' => 'ꙛ', + 'Ꙝ' => 'ꙝ', + 'Ꙟ' => 'ꙟ', + 'Ꙡ' => 'ꙡ', + 'Ꙣ' => 'ꙣ', + 'Ꙥ' => 'ꙥ', + 'Ꙧ' => 'ꙧ', + 'Ꙩ' => 'ꙩ', + 'Ꙫ' => 'ꙫ', + 'Ꙭ' => 'ꙭ', + 'Ꚁ' => 'ꚁ', + 'Ꚃ' => 'ꚃ', + 'Ꚅ' => 'ꚅ', + 'Ꚇ' => 'ꚇ', + 'Ꚉ' => 'ꚉ', + 'Ꚋ' => 'ꚋ', + 'Ꚍ' => 'ꚍ', + 'Ꚏ' => 'ꚏ', + 'Ꚑ' => 'ꚑ', + 'Ꚓ' => 'ꚓ', + 'Ꚕ' => 'ꚕ', + 'Ꚗ' => 'ꚗ', + 'Ꚙ' => 'ꚙ', + 'Ꚛ' => 'ꚛ', + 'Ꜣ' => 'ꜣ', + 'Ꜥ' => 'ꜥ', + 'Ꜧ' => 'ꜧ', + 'Ꜩ' => 'ꜩ', + 'Ꜫ' => 'ꜫ', + 'Ꜭ' => 'ꜭ', + 'Ꜯ' => 'ꜯ', + 'Ꜳ' => 'ꜳ', + 'Ꜵ' => 'ꜵ', + 'Ꜷ' => 'ꜷ', + 'Ꜹ' => 'ꜹ', + 'Ꜻ' => 'ꜻ', + 'Ꜽ' => 'ꜽ', + 'Ꜿ' => 'ꜿ', + 'Ꝁ' => 'ꝁ', + 'Ꝃ' => 'ꝃ', + 'Ꝅ' => 'ꝅ', + 'Ꝇ' => 'ꝇ', + 'Ꝉ' => 'ꝉ', + 'Ꝋ' => 'ꝋ', + 'Ꝍ' => 'ꝍ', + 'Ꝏ' => 'ꝏ', + 'Ꝑ' => 'ꝑ', + 'Ꝓ' => 'ꝓ', + 'Ꝕ' => 'ꝕ', + 'Ꝗ' => 'ꝗ', + 'Ꝙ' => 'ꝙ', + 'Ꝛ' => 'ꝛ', + 'Ꝝ' => 'ꝝ', + 'Ꝟ' => 'ꝟ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' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + '𐐀' => '𐐨', + '𐐁' => '𐐩', + '𐐂' => '𐐪', + '𐐃' => '𐐫', + '𐐄' => '𐐬', + '𐐅' => '𐐭', + '𐐆' => '𐐮', + '𐐇' => '𐐯', + '𐐈' => '𐐰', + '𐐉' => '𐐱', + '𐐊' => '𐐲', + '𐐋' => '𐐳', + '𐐌' => '𐐴', + '𐐍' => '𐐵', + '𐐎' => '𐐶', + '𐐏' => '𐐷', + '𐐐' => '𐐸', + '𐐑' => '𐐹', + '𐐒' => '𐐺', + '𐐓' => '𐐻', + '𐐔' => '𐐼', + '𐐕' => '𐐽', + '𐐖' => '𐐾', + '𐐗' => '𐐿', + '𐐘' => '𐑀', + '𐐙' => '𐑁', + '𐐚' => '𐑂', + '𐐛' => '𐑃', + '𐐜' => '𐑄', + '𐐝' => '𐑅', + '𐐞' => '𐑆', + '𐐟' => '𐑇', + '𐐠' => '𐑈', + '𐐡' => '𐑉', + '𐐢' => '𐑊', + '𐐣' => '𐑋', + '𐐤' => '𐑌', + '𐐥' => '𐑍', + '𐐦' => '𐑎', + '𐐧' => '𐑏', + '𐒰' => '𐓘', + '𐒱' => '𐓙', + '𐒲' => '𐓚', + '𐒳' => '𐓛', + '𐒴' => '𐓜', + '𐒵' => '𐓝', + '𐒶' => '𐓞', + '𐒷' => '𐓟', + '𐒸' => '𐓠', + '𐒹' => '𐓡', + '𐒺' => '𐓢', + '𐒻' => '𐓣', + '𐒼' => '𐓤', + '𐒽' => '𐓥', + '𐒾' => '𐓦', + '𐒿' => '𐓧', + '𐓀' => '𐓨', + '𐓁' => '𐓩', + '𐓂' => '𐓪', + '𐓃' => '𐓫', + '𐓄' => '𐓬', + '𐓅' => '𐓭', + '𐓆' => '𐓮', + '𐓇' => '𐓯', + '𐓈' => '𐓰', + '𐓉' => '𐓱', + '𐓊' => '𐓲', + '𐓋' => '𐓳', + '𐓌' => '𐓴', + '𐓍' => '𐓵', + '𐓎' => '𐓶', + '𐓏' => '𐓷', + '𐓐' => '𐓸', + '𐓑' => '𐓹', + '𐓒' => '𐓺', + '𐓓' => '𐓻', + '𐲀' => '𐳀', + '𐲁' => '𐳁', + '𐲂' => '𐳂', + '𐲃' => '𐳃', + '𐲄' => '𐳄', + '𐲅' => '𐳅', + '𐲆' => '𐳆', + '𐲇' => '𐳇', + '𐲈' => '𐳈', + '𐲉' => '𐳉', + '𐲊' => '𐳊', + '𐲋' => '𐳋', + '𐲌' => '𐳌', + '𐲍' => '𐳍', + '𐲎' => '𐳎', + '𐲏' => '𐳏', + '𐲐' => '𐳐', + '𐲑' => '𐳑', + '𐲒' => '𐳒', + '𐲓' => '𐳓', + '𐲔' => '𐳔', + '𐲕' => '𐳕', + '𐲖' => '𐳖', + '𐲗' => '𐳗', + '𐲘' => '𐳘', + '𐲙' => '𐳙', + '𐲚' => '𐳚', + '𐲛' => '𐳛', + '𐲜' => '𐳜', + '𐲝' => '𐳝', + '𐲞' => '𐳞', + '𐲟' => '𐳟', + '𐲠' => '𐳠', + '𐲡' => '𐳡', + '𐲢' => '𐳢', + '𐲣' => '𐳣', + '𐲤' => '𐳤', + '𐲥' => '𐳥', + '𐲦' => '𐳦', + '𐲧' => '𐳧', + '𐲨' => '𐳨', + '𐲩' => '𐳩', + '𐲪' => '𐳪', + '𐲫' => '𐳫', + '𐲬' => '𐳬', + '𐲭' => '𐳭', + '𐲮' => '𐳮', + '𐲯' => '𐳯', + '𐲰' => '𐳰', + '𐲱' => '𐳱', + '𐲲' => '𐳲', + '𑢠' => '𑣀', + '𑢡' => '𑣁', + '𑢢' => '𑣂', + '𑢣' => '𑣃', + '𑢤' => '𑣄', + '𑢥' => '𑣅', + '𑢦' => '𑣆', + '𑢧' => '𑣇', + '𑢨' => '𑣈', + '𑢩' => '𑣉', + '𑢪' => '𑣊', + '𑢫' => '𑣋', + '𑢬' => '𑣌', + '𑢭' => '𑣍', + '𑢮' => '𑣎', + '𑢯' => '𑣏', + '𑢰' => '𑣐', + '𑢱' => '𑣑', + '𑢲' => '𑣒', + '𑢳' => '𑣓', + '𑢴' => '𑣔', + '𑢵' => '𑣕', + '𑢶' => '𑣖', + '𑢷' => '𑣗', + '𑢸' => '𑣘', + '𑢹' => '𑣙', + '𑢺' => '𑣚', + '𑢻' => '𑣛', + '𑢼' => '𑣜', + '𑢽' => '𑣝', + '𑢾' => '𑣞', + '𑢿' => '𑣟', + '𖹀' => '𖹠', + '𖹁' => '𖹡', + '𖹂' => '𖹢', + '𖹃' => '𖹣', + '𖹄' => '𖹤', + '𖹅' => '𖹥', + '𖹆' => '𖹦', + '𖹇' => '𖹧', + '𖹈' => '𖹨', + '𖹉' => '𖹩', + '𖹊' => '𖹪', + '𖹋' => '𖹫', + '𖹌' => '𖹬', + '𖹍' => '𖹭', + '𖹎' => '𖹮', + '𖹏' => '𖹯', + '𖹐' => '𖹰', + '𖹑' => '𖹱', + '𖹒' => '𖹲', + '𖹓' => '𖹳', + '𖹔' => '𖹴', + '𖹕' => '𖹵', + '𖹖' => '𖹶', + '𖹗' => '𖹷', + '𖹘' => '𖹸', + '𖹙' => '𖹹', + '𖹚' => '𖹺', + '𖹛' => '𖹻', + '𖹜' => '𖹼', + '𖹝' => '𖹽', + '𖹞' => '𖹾', + '𖹟' => '𖹿', + '𞤀' => '𞤢', + '𞤁' => '𞤣', + '𞤂' => '𞤤', + '𞤃' => '𞤥', + '𞤄' => '𞤦', + '𞤅' => '𞤧', + '𞤆' => '𞤨', + '𞤇' => '𞤩', + '𞤈' => '𞤪', + '𞤉' => '𞤫', + '𞤊' => '𞤬', + '𞤋' => '𞤭', + '𞤌' => '𞤮', + '𞤍' => '𞤯', + '𞤎' => '𞤰', + '𞤏' => '𞤱', + '𞤐' => '𞤲', + '𞤑' => '𞤳', + '𞤒' => '𞤴', + '𞤓' => '𞤵', + '𞤔' => '𞤶', + '𞤕' => '𞤷', + '𞤖' => '𞤸', + '𞤗' => '𞤹', + '𞤘' => '𞤺', + '𞤙' => '𞤻', + '𞤚' => '𞤼', + '𞤛' => '𞤽', + '𞤜' => '𞤾', + '𞤝' => '𞤿', + '𞤞' => '𞥀', + '𞤟' => '𞥁', + '𞤠' => '𞥂', + '𞤡' => '𞥃', +); diff --git a/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php new file mode 100644 index 00000000..2a8f6e73 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php @@ -0,0 +1,5 @@ + 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + 'µ' => 'Μ', + 'à' => 'À', + 'á' => 'Á', + 'â' => 'Â', + 'ã' => 'Ã', + 'ä' => 'Ä', + 'å' => 'Å', + 'æ' => 'Æ', + 'ç' => 'Ç', + 'è' => 'È', + 'é' => 'É', + 'ê' => 'Ê', + 'ë' => 'Ë', + 'ì' => 'Ì', + 'í' => 'Í', + 'î' => 'Î', + 'ï' => 'Ï', + 'ð' => 'Ð', + 'ñ' => 'Ñ', + 'ò' => 'Ò', + 'ó' => 'Ó', + 'ô' => 'Ô', + 'õ' => 'Õ', + 'ö' => 'Ö', + 'ø' => 'Ø', + 'ù' => 'Ù', + 'ú' => 'Ú', + 'û' => 'Û', + 'ü' => 'Ü', + 'ý' => 'Ý', + 'þ' => 'Þ', + 'ÿ' => 'Ÿ', + 'ā' => 'Ā', + 'ă' => 'Ă', + 'ą' => 'Ą', + 'ć' => 'Ć', + 'ĉ' => 'Ĉ', + 'ċ' => 'Ċ', + 'č' => 'Č', + 'ď' => 'Ď', + 'đ' => 'Đ', + 'ē' => 'Ē', + 'ĕ' => 'Ĕ', + 'ė' => 'Ė', + 'ę' => 'Ę', + 'ě' => 'Ě', + 'ĝ' => 'Ĝ', + 'ğ' => 'Ğ', + 'ġ' => 'Ġ', + 'ģ' => 'Ģ', + 'ĥ' => 'Ĥ', + 'ħ' => 'Ħ', + 'ĩ' => 'Ĩ', + 'ī' => 'Ī', + 'ĭ' => 'Ĭ', + 'į' => 'Į', + 'ı' => 'I', + 'ij' => 'IJ', + 'ĵ' => 'Ĵ', + 'ķ' => 'Ķ', + 'ĺ' => 'Ĺ', + 'ļ' => 'Ļ', + 'ľ' => 'Ľ', + 'ŀ' => 'Ŀ', + 'ł' => 'Ł', + 'ń' => 'Ń', + 'ņ' => 'Ņ', + 'ň' => 'Ň', + 'ŋ' => 'Ŋ', + 'ō' => 'Ō', + 'ŏ' => 'Ŏ', + 'ő' => 'Ő', + 'œ' => 'Œ', + 'ŕ' => 'Ŕ', + 'ŗ' => 'Ŗ', + 'ř' => 'Ř', + 'ś' => 'Ś', + 'ŝ' => 'Ŝ', + 'ş' => 'Ş', + 'š' => 'Š', + 'ţ' => 'Ţ', + 'ť' => 'Ť', + 'ŧ' => 'Ŧ', + 'ũ' => 'Ũ', + 'ū' => 'Ū', + 'ŭ' => 'Ŭ', + 'ů' => 'Ů', + 'ű' => 'Ű', + 'ų' => 'Ų', + 'ŵ' => 'Ŵ', + 'ŷ' => 'Ŷ', + 'ź' => 'Ź', + 'ż' => 'Ż', + 'ž' => 'Ž', + 'ſ' => 'S', + 'ƀ' => 'Ƀ', + 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' => 'Ͱ', + 'ͳ' => 'Ͳ', + 'ͷ' => 'Ͷ', + 'ͻ' => 'Ͻ', + 'ͼ' => 'Ͼ', + 'ͽ' => 'Ͽ', + 'ά' => 'Ά', + 'έ' => 'Έ', + 'ή' => 'Ή', + 'ί' => 'Ί', + 'α' => 'Α', + 'β' => 'Β', + 'γ' => 'Γ', + 'δ' => 'Δ', + 'ε' => 'Ε', + 'ζ' => 'Ζ', + 'η' => 'Η', + 'θ' => 'Θ', + 'ι' => 'Ι', + 'κ' => 'Κ', + 'λ' => 'Λ', + 'μ' => 'Μ', + 'ν' => 'Ν', + 'ξ' => 'Ξ', + 'ο' => 'Ο', + 'π' => 'Π', + 'ρ' => 'Ρ', + 'ς' => 'Σ', + 'σ' => 'Σ', + 'τ' => 'Τ', + 'υ' => 'Υ', + 'φ' => 'Φ', + 'χ' => 'Χ', + 'ψ' => 'Ψ', + 'ω' => 'Ω', + 'ϊ' => 'Ϊ', + 'ϋ' => 'Ϋ', + 'ό' => 'Ό', + 'ύ' => 'Ύ', + 'ώ' => 'Ώ', + 'ϐ' => 'Β', + 'ϑ' => 'Θ', + 'ϕ' => 'Φ', + 'ϖ' => 'Π', + 'ϗ' => 'Ϗ', + 'ϙ' => 'Ϙ', + 'ϛ' => 'Ϛ', + 'ϝ' => 'Ϝ', + 'ϟ' => 'Ϟ', + 'ϡ' => 'Ϡ', + 'ϣ' => 'Ϣ', + 'ϥ' => 'Ϥ', + 'ϧ' => 'Ϧ', + 'ϩ' => 'Ϩ', + 'ϫ' => 'Ϫ', + 'ϭ' => 'Ϭ', + 'ϯ' => 'Ϯ', + 'ϰ' => 'Κ', + 'ϱ' => 'Ρ', + 'ϲ' => 'Ϲ', + 'ϳ' => 'Ϳ', + 'ϵ' => 'Ε', + 'ϸ' => 'Ϸ', + 'ϻ' => 'Ϻ', + 'а' => 'А', + 'б' => 'Б', + 'в' => 'В', + 'г' => 'Г', + 'д' => 'Д', + 'е' => 'Е', + 'ж' => 'Ж', + 'з' => 'З', + 'и' => 'И', + 'й' => 'Й', + 'к' => 'К', + 'л' => 'Л', + 'м' => 'М', + 'н' => 'Н', + 'о' => 'О', + 'п' => 'П', + 'р' => 'Р', + 'с' => 'С', + 'т' => 'Т', + 'у' => 'У', + 'ф' => 'Ф', + 'х' => 'Х', + 'ц' => 'Ц', + 'ч' => 'Ч', + 'ш' => 'Ш', + 'щ' => 'Щ', + 'ъ' => 'Ъ', + 'ы' => 'Ы', + 'ь' => 'Ь', + 'э' => 'Э', + 'ю' => 'Ю', + 'я' => 'Я', + 'ѐ' => 'Ѐ', + 'ё' => 'Ё', + 'ђ' => 'Ђ', + 'ѓ' => 'Ѓ', + 'є' => 'Є', + 'ѕ' => 'Ѕ', + 'і' => 'І', + 'ї' => 'Ї', + 'ј' => 'Ј', + 'љ' => 'Љ', + 'њ' => 'Њ', + 'ћ' => 'Ћ', + 'ќ' => 'Ќ', + 'ѝ' => 'Ѝ', + 'ў' => 'Ў', + 'џ' => 'Џ', + 'ѡ' => 'Ѡ', + 'ѣ' => 'Ѣ', + 'ѥ' => 'Ѥ', + 'ѧ' => 'Ѧ', + 'ѩ' => 'Ѩ', + 'ѫ' => 'Ѫ', + 'ѭ' => 'Ѭ', + 'ѯ' => 'Ѯ', + 'ѱ' => 'Ѱ', + 'ѳ' => 'Ѳ', + 'ѵ' => 'Ѵ', + 'ѷ' => 'Ѷ', + 'ѹ' => 'Ѹ', + 'ѻ' => 'Ѻ', + 'ѽ' => 'Ѽ', + 'ѿ' => 'Ѿ', + 'ҁ' => 'Ҁ', + 'ҋ' => 'Ҋ', + 'ҍ' => 'Ҍ', + 'ҏ' => 'Ҏ', + 'ґ' => 'Ґ', + 'ғ' => 'Ғ', + 'ҕ' => 'Ҕ', + 'җ' => 'Җ', + 'ҙ' => 'Ҙ', + 'қ' => 'Қ', + 'ҝ' => 'Ҝ', + 'ҟ' => 'Ҟ', + 'ҡ' => 'Ҡ', + 'ң' => 'Ң', + 'ҥ' => 'Ҥ', + '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 'Ԡ', + 'ԣ' => 'Ԣ', + 'ԥ' => 'Ԥ', + 'ԧ' => 'Ԧ', + 'ԩ' => 'Ԩ', + 'ԫ' => 'Ԫ', + 'ԭ' => 'Ԭ', + 'ԯ' => 'Ԯ', + 'ա' => 'Ա', + 'բ' => 'Բ', + 'գ' => 'Գ', + 'դ' => 'Դ', + 'ե' => 'Ե', + 'զ' => 'Զ', + 'է' => 'Է', + 'ը' => 'Ը', + 'թ' => 'Թ', + 'ժ' => 'Ժ', + 'ի' => 'Ի', + 'լ' => 'Լ', + 'խ' => 'Խ', + 'ծ' => 'Ծ', + 'կ' => 'Կ', + 'հ' => 'Հ', + 'ձ' => 'Ձ', + 'ղ' => 'Ղ', + 'ճ' => 'Ճ', + 'մ' => 'Մ', + 'յ' => 'Յ', + 'ն' => 'Ն', + 'շ' => 'Շ', + 'ո' => 'Ո', + 'չ' => 'Չ', + 'պ' => 'Պ', + 'ջ' => 'Ջ', + 'ռ' => 'Ռ', + 'ս' => 'Ս', + 'վ' => 'Վ', + 'տ' => 'Տ', + 'ր' => 'Ր', + 'ց' => 'Ց', + 'ւ' => 'Ւ', + 'փ' => 'Փ', + 'ք' => 'Ք', + 'օ' => 'Օ', + 'ֆ' => 'Ֆ', + 'ა' => 'Ა', + 'ბ' => 'Ბ', + 'გ' => 'Გ', + 'დ' => 'Დ', + 'ე' => 'Ე', + 'ვ' => 'Ვ', + 'ზ' => 'Ზ', + 'თ' => 'Თ', + 'ი' => 'Ი', + 'კ' => 'Კ', + 'ლ' => 'Ლ', + 'მ' => 'Მ', + 'ნ' => 'Ნ', + 'ო' => 'Ო', + 'პ' => 'Პ', + 'ჟ' => 'Ჟ', + 'რ' => 'Რ', + 'ს' => 'Ს', + 'ტ' => 'Ტ', + 'უ' => 'Უ', + 'ფ' => 'Ფ', + 'ქ' => 'Ქ', + 'ღ' => 'Ღ', + 'ყ' => 'Ყ', + 'შ' => 'Შ', + 'ჩ' => 'Ჩ', + 'ც' => 'Ც', + 'ძ' => 'Ძ', + 'წ' => 'Წ', + 'ჭ' => 'Ჭ', + 'ხ' => 'Ხ', + 'ჯ' => 'Ჯ', + 'ჰ' => 'Ჰ', + 'ჱ' => 'Ჱ', + 'ჲ' => 'Ჲ', + 'ჳ' => 'Ჳ', + 'ჴ' => 'Ჴ', + 'ჵ' => 'Ჵ', + 'ჶ' => 'Ჶ', + 'ჷ' => 'Ჷ', + 'ჸ' => 'Ჸ', + 'ჹ' => 'Ჹ', + 'ჺ' => 'Ჺ', + 'ჽ' => 'Ჽ', + 'ჾ' => 'Ჾ', + 'ჿ' => 'Ჿ', + 'ᏸ' => 'Ᏸ', + 'ᏹ' => 'Ᏹ', + 'ᏺ' => 'Ᏺ', + 'ᏻ' => 'Ᏻ', + 'ᏼ' => 'Ᏼ', + 'ᏽ' => 'Ᏽ', + 'ᲀ' => 'В', + 'ᲁ' => 'Д', + 'ᲂ' => 'О', + 'ᲃ' => 'С', + 'ᲄ' => 'Т', + 'ᲅ' => 'Т', + 'ᲆ' => 'Ъ', + 'ᲇ' => 'Ѣ', + 'ᲈ' => 'Ꙋ', + 'ᵹ' => 'Ᵹ', + 'ᵽ' => 'Ᵽ', + 'ᶎ' => 'Ᶎ', + 'ḁ' => 'Ḁ', + 'ḃ' => 'Ḃ', + 'ḅ' => 'Ḅ', + 'ḇ' => 'Ḇ', + 'ḉ' => 'Ḉ', + 'ḋ' => 'Ḋ', + 'ḍ' => 'Ḍ', + 'ḏ' => 'Ḏ', + 'ḑ' => 'Ḑ', + 'ḓ' => 'Ḓ', + 'ḕ' => 'Ḕ', + 'ḗ' => 'Ḗ', + 'ḙ' => 'Ḙ', + 'ḛ' => 'Ḛ', + 'ḝ' => 'Ḝ', + 'ḟ' => 'Ḟ', + 'ḡ' => 'Ḡ', + 'ḣ' => 'Ḣ', + 'ḥ' => 'Ḥ', + 'ḧ' => 'Ḧ', + 'ḩ' => 'Ḩ', + 'ḫ' => 'Ḫ', + 'ḭ' => 'Ḭ', + 'ḯ' => 'Ḯ', + 'ḱ' => 'Ḱ', + 'ḳ' => 'Ḳ', + 'ḵ' => 'Ḵ', + 'ḷ' => 'Ḷ', + 'ḹ' => 'Ḹ', + 'ḻ' => 'Ḻ', + 'ḽ' => 'Ḽ', + 'ḿ' => 'Ḿ', + 'ṁ' => 'Ṁ', + 'ṃ' => 'Ṃ', + 'ṅ' => 'Ṅ', + 'ṇ' => 'Ṇ', + 'ṉ' => 'Ṉ', + 'ṋ' => 'Ṋ', + 'ṍ' => 'Ṍ', + 'ṏ' => 'Ṏ', + 'ṑ' => 'Ṑ', + 'ṓ' => 'Ṓ', + 'ṕ' => 'Ṕ', + 'ṗ' => 'Ṗ', + 'ṙ' => 'Ṙ', + 'ṛ' => 'Ṛ', + 'ṝ' => 'Ṝ', + 'ṟ' => 'Ṟ', + 'ṡ' => 'Ṡ', + 'ṣ' => 'Ṣ', + 'ṥ' => 'Ṥ', + 'ṧ' => 'Ṧ', + 'ṩ' => 'Ṩ', + 'ṫ' => 'Ṫ', + 'ṭ' => 'Ṭ', + 'ṯ' => 'Ṯ', + 'ṱ' => 'Ṱ', + 'ṳ' => 'Ṳ', + 'ṵ' => 'Ṵ', + 'ṷ' => 'Ṷ', + 'ṹ' => 'Ṹ', + 'ṻ' => 'Ṻ', + 'ṽ' => 'Ṽ', + 'ṿ' => 'Ṿ', + 'ẁ' => 'Ẁ', + 'ẃ' => 'Ẃ', + 'ẅ' => 'Ẅ', + 'ẇ' => 'Ẇ', + 'ẉ' => 'Ẉ', + 'ẋ' => 'Ẋ', + 'ẍ' => 'Ẍ', + 'ẏ' => 'Ẏ', + 'ẑ' => 'Ẑ', + 'ẓ' => 'Ẓ', + 'ẕ' => 'Ẕ', + 'ẛ' => 'Ṡ', + 'ạ' => 'Ạ', + 'ả' => 'Ả', + 'ấ' => 'Ấ', + 'ầ' => 'Ầ', + 'ẩ' => 'Ẩ', + 'ẫ' => 'Ẫ', + 'ậ' => 'Ậ', + 'ắ' => 'Ắ', + 'ằ' => 'Ằ', + 'ẳ' => 'Ẳ', + 'ẵ' => 'Ẵ', + 'ặ' => 'Ặ', + 'ẹ' => 'Ẹ', + 'ẻ' => 'Ẻ', + 'ẽ' => 'Ẽ', + 'ế' => 'Ế', + 'ề' => 'Ề', + 'ể' => 'Ể', + 'ễ' => 'Ễ', + 'ệ' => 'Ệ', + 'ỉ' => 'Ỉ', + 'ị' => 'Ị', + 'ọ' => 'Ọ', + 'ỏ' => 'Ỏ', + 'ố' => 'Ố', + 'ồ' => 'Ồ', + 'ổ' => 'Ổ', + 'ỗ' => 'Ỗ', + 'ộ' => 'Ộ', + 'ớ' => 'Ớ', + 'ờ' => 'Ờ', + 'ở' => 'Ở', + 'ỡ' => 'Ỡ', + 'ợ' => 'Ợ', + 'ụ' => 'Ụ', + 'ủ' => 'Ủ', + 'ứ' => 'Ứ', + 'ừ' => 'Ừ', + 'ử' => 'Ử', + 'ữ' => 'Ữ', + 'ự' => 'Ự', + 'ỳ' => 'Ỳ', + 'ỵ' => 'Ỵ', + 'ỷ' => 'Ỷ', + 'ỹ' => 'Ỹ', + 'ỻ' => 'Ỻ', + 'ỽ' => 'Ỽ', + 'ỿ' => 'Ỿ', + 'ἀ' => 'Ἀ', + 'ἁ' => 'Ἁ', + 'ἂ' => 'Ἂ', + 'ἃ' => 'Ἃ', + 'ἄ' => 'Ἄ', + 'ἅ' => 'Ἅ', + 'ἆ' => 'Ἆ', + 'ἇ' => 'Ἇ', + 'ἐ' => 'Ἐ', + 'ἑ' => 'Ἑ', + 'ἒ' => 'Ἒ', + 'ἓ' => 'Ἓ', + 'ἔ' => 'Ἔ', + 'ἕ' => 'Ἕ', + 'ἠ' => 'Ἠ', + 'ἡ' => 'Ἡ', + 'ἢ' => 'Ἢ', + 'ἣ' => 'Ἣ', + 'ἤ' => 'Ἤ', + 'ἥ' => 'Ἥ', + 'ἦ' => 'Ἦ', + 'ἧ' => 'Ἧ', + 'ἰ' => 'Ἰ', + 'ἱ' => 'Ἱ', + 'ἲ' => 'Ἲ', + 'ἳ' => 'Ἳ', + 'ἴ' => 'Ἴ', + 'ἵ' => 'Ἵ', + 'ἶ' => 'Ἶ', + 'ἷ' => 'Ἷ', + 'ὀ' => 'Ὀ', + 'ὁ' => 'Ὁ', + 'ὂ' => 'Ὂ', + 'ὃ' => 'Ὃ', + 'ὄ' => 'Ὄ', + 'ὅ' => 'Ὅ', + 'ὑ' => 'Ὑ', + 'ὓ' => 'Ὓ', + 'ὕ' => 'Ὕ', + 'ὗ' => 'Ὗ', + 'ὠ' => 'Ὠ', + 'ὡ' => 'Ὡ', + 'ὢ' => 'Ὢ', + 'ὣ' => 'Ὣ', + 'ὤ' => 'Ὤ', + 'ὥ' => 'Ὥ', + 'ὦ' => 'Ὦ', + 'ὧ' => 'Ὧ', + 'ὰ' => 'Ὰ', + 'ά' => 'Ά', + 'ὲ' => 'Ὲ', + 'έ' => 'Έ', + 'ὴ' => 'Ὴ', + 'ή' => 'Ή', + 'ὶ' => 'Ὶ', + 'ί' => 'Ί', + 'ὸ' => 'Ὸ', + 'ό' => 'Ό', + 'ὺ' => 'Ὺ', + 'ύ' => 'Ύ', + 'ὼ' => 'Ὼ', + 'ώ' => 'Ώ', + 'ᾀ' => 'ἈΙ', + 'ᾁ' => 'ἉΙ', + 'ᾂ' => 'ἊΙ', + 'ᾃ' => 'ἋΙ', + 'ᾄ' => 'ἌΙ', + 'ᾅ' => 'ἍΙ', + 'ᾆ' => 'ἎΙ', + 'ᾇ' => 'ἏΙ', + 'ᾐ' => 'ἨΙ', + 'ᾑ' => 'ἩΙ', + 'ᾒ' => 'ἪΙ', + 'ᾓ' => 'ἫΙ', + 'ᾔ' => 'ἬΙ', + 'ᾕ' => 'ἭΙ', + 'ᾖ' => 'ἮΙ', + 'ᾗ' => 'ἯΙ', + 'ᾠ' => 'ὨΙ', + 'ᾡ' => 'ὩΙ', + 'ᾢ' => 'ὪΙ', + 'ᾣ' => 'ὫΙ', + 'ᾤ' => 'ὬΙ', + 'ᾥ' => 'ὭΙ', + 'ᾦ' => 'ὮΙ', + 'ᾧ' => 'ὯΙ', + 'ᾰ' => 'Ᾰ', + 'ᾱ' => 'Ᾱ', + 'ᾳ' => 'ΑΙ', + 'ι' => 'Ι', + 'ῃ' => 'ΗΙ', + 'ῐ' => 'Ῐ', + 'ῑ' => 'Ῑ', + 'ῠ' => 'Ῠ', + 'ῡ' => 'Ῡ', + 'ῥ' => 'Ῥ', + 'ῳ' => 'ΩΙ', + 'ⅎ' => 'Ⅎ', + 'ⅰ' => 'Ⅰ', + 'ⅱ' => 'Ⅱ', + 'ⅲ' => 'Ⅲ', + 'ⅳ' => 'Ⅳ', + 'ⅴ' => 'Ⅴ', + 'ⅵ' => 'Ⅵ', + 'ⅶ' => 'Ⅶ', + 'ⅷ' => 'Ⅷ', + 'ⅸ' => 'Ⅸ', + 'ⅹ' => 'Ⅹ', + 'ⅺ' => 'Ⅺ', + 'ⅻ' => 'Ⅻ', + 'ⅼ' => 'Ⅼ', + 'ⅽ' => 'Ⅽ', + 'ⅾ' => 'Ⅾ', + 'ⅿ' => 'Ⅿ', + 'ↄ' => 'Ↄ', + 'ⓐ' => 'Ⓐ', + 'ⓑ' => 'Ⓑ', + 'ⓒ' => 'Ⓒ', + 'ⓓ' => 'Ⓓ', + 'ⓔ' => 'Ⓔ', + 'ⓕ' => 'Ⓕ', + 'ⓖ' => 'Ⓖ', + 'ⓗ' => 'Ⓗ', + 'ⓘ' => 'Ⓘ', + 'ⓙ' => 'Ⓙ', + 'ⓚ' => 'Ⓚ', + 'ⓛ' => 'Ⓛ', + 'ⓜ' => 'Ⓜ', + 'ⓝ' => 'Ⓝ', + 'ⓞ' => 'Ⓞ', + 'ⓟ' => 'Ⓟ', + 'ⓠ' => 'Ⓠ', + 'ⓡ' => 'Ⓡ', + 'ⓢ' => 'Ⓢ', + 'ⓣ' => 'Ⓣ', + 'ⓤ' => 'Ⓤ', + 'ⓥ' => 'Ⓥ', + 'ⓦ' => 'Ⓦ', + 'ⓧ' => 'Ⓧ', + 'ⓨ' => 'Ⓨ', + 'ⓩ' => 'Ⓩ', + 'ⰰ' => 'Ⰰ', + 'ⰱ' => 'Ⰱ', + 'ⰲ' => 'Ⰲ', + 'ⰳ' => 'Ⰳ', + 'ⰴ' => 'Ⰴ', + 'ⰵ' => 'Ⰵ', + 'ⰶ' => 'Ⰶ', + 'ⰷ' => 'Ⰷ', + 'ⰸ' => 'Ⰸ', + 'ⰹ' => 'Ⰹ', + 'ⰺ' => 'Ⰺ', + 'ⰻ' => 'Ⰻ', + 'ⰼ' => 'Ⰼ', + 'ⰽ' => 'Ⰽ', + 'ⰾ' => 'Ⰾ', + 'ⰿ' => 'Ⰿ', + 'ⱀ' => 'Ⱀ', + 'ⱁ' => 'Ⱁ', + 'ⱂ' => 'Ⱂ', + 'ⱃ' => 'Ⱃ', + 'ⱄ' => 'Ⱄ', + 'ⱅ' => 'Ⱅ', + 'ⱆ' => 'Ⱆ', + 'ⱇ' => 'Ⱇ', + 'ⱈ' => 'Ⱈ', + 'ⱉ' => 'Ⱉ', + 'ⱊ' => 'Ⱊ', + 'ⱋ' => 'Ⱋ', + 'ⱌ' => 'Ⱌ', + 'ⱍ' => 'Ⱍ', + 'ⱎ' => 'Ⱎ', + 'ⱏ' => 'Ⱏ', + 'ⱐ' => 'Ⱐ', + 'ⱑ' => 'Ⱑ', + 'ⱒ' => 'Ⱒ', + 'ⱓ' => 'Ⱓ', + 'ⱔ' => 'Ⱔ', + 'ⱕ' => 'Ⱕ', + 'ⱖ' => 'Ⱖ', + 'ⱗ' => 'Ⱗ', + 'ⱘ' => 'Ⱘ', + 'ⱙ' => 'Ⱙ', + 'ⱚ' => 'Ⱚ', + 'ⱛ' => 'Ⱛ', + 'ⱜ' => 'Ⱜ', + 'ⱝ' => 'Ⱝ', + 'ⱞ' => 'Ⱞ', + 'ⱡ' => 'Ⱡ', + 'ⱥ' => 'Ⱥ', + 'ⱦ' => 'Ⱦ', + 'ⱨ' => 'Ⱨ', + 'ⱪ' => 'Ⱪ', + 'ⱬ' => 'Ⱬ', + 'ⱳ' => 'Ⱳ', + 'ⱶ' => 'Ⱶ', + 'ⲁ' => 'Ⲁ', + 'ⲃ' => 'Ⲃ', + 'ⲅ' => 'Ⲅ', + 'ⲇ' => 'Ⲇ', + 'ⲉ' => 'Ⲉ', + 'ⲋ' => 'Ⲋ', + 'ⲍ' => 'Ⲍ', + 'ⲏ' => 'Ⲏ', + 'ⲑ' => 'Ⲑ', + 'ⲓ' => 'Ⲓ', + 'ⲕ' => 'Ⲕ', + 'ⲗ' => 'Ⲗ', + 'ⲙ' => 'Ⲙ', + 'ⲛ' => 'Ⲛ', + 'ⲝ' => 'Ⲝ', + 'ⲟ' => 'Ⲟ', + 'ⲡ' => 'Ⲡ', + 'ⲣ' => 'Ⲣ', + 'ⲥ' => 'Ⲥ', + 'ⲧ' => 'Ⲧ', + 'ⲩ' => 'Ⲩ', + 'ⲫ' => 'Ⲫ', + 'ⲭ' => 'Ⲭ', + 'ⲯ' => 'Ⲯ', + 'ⲱ' => 'Ⲱ', + 'ⲳ' => 'Ⲳ', + 'ⲵ' => 'Ⲵ', + 'ⲷ' => 'Ⲷ', + 'ⲹ' => 'Ⲹ', + 'ⲻ' => 'Ⲻ', + 'ⲽ' => 'Ⲽ', + 'ⲿ' => 'Ⲿ', + 'ⳁ' => 'Ⳁ', + 'ⳃ' => 'Ⳃ', + 'ⳅ' => 'Ⳅ', + 'ⳇ' => 'Ⳇ', + 'ⳉ' => 'Ⳉ', + 'ⳋ' => 'Ⳋ', + 'ⳍ' => 'Ⳍ', + 'ⳏ' => 'Ⳏ', + 'ⳑ' => 'Ⳑ', + 'ⳓ' => 'Ⳓ', + 'ⳕ' => 'Ⳕ', + 'ⳗ' => 'Ⳗ', + 'ⳙ' => 'Ⳙ', + 'ⳛ' => 'Ⳛ', + 'ⳝ' => 'Ⳝ', + 'ⳟ' => 'Ⳟ', + 'ⳡ' => 'Ⳡ', + 'ⳣ' => 'Ⳣ', + 'ⳬ' => 'Ⳬ', + 'ⳮ' => 'Ⳮ', + 'ⳳ' => 'Ⳳ', + 'ⴀ' => 'Ⴀ', + 'ⴁ' => 'Ⴁ', + 'ⴂ' => 'Ⴂ', + 'ⴃ' => 'Ⴃ', + 'ⴄ' => 'Ⴄ', + 'ⴅ' => 'Ⴅ', + 'ⴆ' => 'Ⴆ', + 'ⴇ' => 'Ⴇ', + 'ⴈ' => 'Ⴈ', + 'ⴉ' => 'Ⴉ', + 'ⴊ' => 'Ⴊ', + 'ⴋ' => 'Ⴋ', + 'ⴌ' => 'Ⴌ', + 'ⴍ' => 'Ⴍ', + 'ⴎ' => 'Ⴎ', + 'ⴏ' => 'Ⴏ', + 'ⴐ' => 'Ⴐ', + 'ⴑ' => 'Ⴑ', + 'ⴒ' => 'Ⴒ', + 'ⴓ' => 'Ⴓ', + 'ⴔ' => 'Ⴔ', + 'ⴕ' => 'Ⴕ', + 'ⴖ' => 'Ⴖ', + 'ⴗ' => 'Ⴗ', + 'ⴘ' => 'Ⴘ', + 'ⴙ' => 'Ⴙ', + 'ⴚ' => 'Ⴚ', + 'ⴛ' => 'Ⴛ', + 'ⴜ' => 'Ⴜ', + 'ⴝ' => 'Ⴝ', + 'ⴞ' => 'Ⴞ', + 'ⴟ' => 'Ⴟ', + 'ⴠ' => 'Ⴠ', + 'ⴡ' => 'Ⴡ', + 'ⴢ' => 'Ⴢ', + 'ⴣ' => 'Ⴣ', + 'ⴤ' => 'Ⴤ', + 'ⴥ' => 'Ⴥ', + 'ⴧ' => 'Ⴧ', + 'ⴭ' => 'Ⴭ', + 'ꙁ' => 'Ꙁ', + 'ꙃ' => 'Ꙃ', + 'ꙅ' => 'Ꙅ', + 'ꙇ' => 'Ꙇ', + 'ꙉ' => 'Ꙉ', + 'ꙋ' => 'Ꙋ', + 'ꙍ' => 'Ꙍ', + 'ꙏ' => 'Ꙏ', + 'ꙑ' => 'Ꙑ', + 'ꙓ' => 'Ꙓ', + 'ꙕ' => 'Ꙕ', + 'ꙗ' => 'Ꙗ', + 'ꙙ' => 'Ꙙ', + 'ꙛ' => 'Ꙛ', + 'ꙝ' => 'Ꙝ', + 'ꙟ' => 'Ꙟ', + 'ꙡ' => 'Ꙡ', + 'ꙣ' => 'Ꙣ', + 'ꙥ' => 'Ꙥ', + 'ꙧ' => 'Ꙧ', + 'ꙩ' => 'Ꙩ', + 'ꙫ' => 'Ꙫ', + 'ꙭ' => 'Ꙭ', + 'ꚁ' => 'Ꚁ', + 'ꚃ' => 'Ꚃ', + 'ꚅ' => 'Ꚅ', + 'ꚇ' => 'Ꚇ', + 'ꚉ' => 'Ꚉ', + 'ꚋ' => 'Ꚋ', + 'ꚍ' => 'Ꚍ', + 'ꚏ' => 'Ꚏ', + 'ꚑ' => 'Ꚑ', + 'ꚓ' => 'Ꚓ', + 'ꚕ' => 'Ꚕ', + 'ꚗ' => 'Ꚗ', + 'ꚙ' => 'Ꚙ', + 'ꚛ' => 'Ꚛ', + 'ꜣ' => 'Ꜣ', + 'ꜥ' => 'Ꜥ', + 'ꜧ' => 'Ꜧ', + 'ꜩ' => 'Ꜩ', + 'ꜫ' => 'Ꜫ', + 'ꜭ' => 'Ꜭ', + 'ꜯ' => 'Ꜯ', + 'ꜳ' => 'Ꜳ', + 'ꜵ' => 'Ꜵ', + 'ꜷ' => 'Ꜷ', + 'ꜹ' => 'Ꜹ', + 'ꜻ' => 'Ꜻ', + 'ꜽ' => 'Ꜽ', + 'ꜿ' => 'Ꜿ', + 'ꝁ' => 'Ꝁ', + 'ꝃ' => 'Ꝃ', + 'ꝅ' => 'Ꝅ', + 'ꝇ' => 'Ꝇ', + 'ꝉ' => 'Ꝉ', + 'ꝋ' => 'Ꝋ', + 'ꝍ' => 'Ꝍ', + 'ꝏ' => 'Ꝏ', + 'ꝑ' => 'Ꝑ', + 'ꝓ' => 'Ꝓ', + 'ꝕ' => 'Ꝕ', + 'ꝗ' => 'Ꝗ', + 'ꝙ' => 'Ꝙ', + 'ꝛ' => 'Ꝛ', + 'ꝝ' => 'Ꝝ', + 'ꝟ' => 'Ꝟ', + 'ꝡ' => 'Ꝡ', + 'ꝣ' => 'Ꝣ', + 'ꝥ' => 'Ꝥ', + 'ꝧ' => 'Ꝧ', + 'ꝩ' => 'Ꝩ', + 'ꝫ' => 'Ꝫ', + 'ꝭ' => 'Ꝭ', + 'ꝯ' => 'Ꝯ', + 'ꝺ' => 'Ꝺ', + 'ꝼ' => 'Ꝼ', + 'ꝿ' => 'Ꝿ', + 'ꞁ' => 'Ꞁ', + 'ꞃ' => 'Ꞃ', + 'ꞅ' => 'Ꞅ', + 'ꞇ' => 'Ꞇ', + 'ꞌ' => 'Ꞌ', + 'ꞑ' => 'Ꞑ', + 'ꞓ' => 'Ꞓ', + 'ꞔ' => 'Ꞔ', + 'ꞗ' => 'Ꞗ', + 'ꞙ' => 'Ꞙ', + 'ꞛ' => 'Ꞛ', + 'ꞝ' => 'Ꞝ', + 'ꞟ' => 'Ꞟ', + 'ꞡ' => 'Ꞡ', + 'ꞣ' => 'Ꞣ', + 'ꞥ' => 'Ꞥ', + 'ꞧ' => 'Ꞧ', + 'ꞩ' => 'Ꞩ', + 'ꞵ' => 'Ꞵ', + 'ꞷ' => 'Ꞷ', + 'ꞹ' => 'Ꞹ', + 'ꞻ' => 'Ꞻ', + 'ꞽ' => 'Ꞽ', + 'ꞿ' => 'Ꞿ', + 'ꟃ' => 'Ꟃ', + 'ꟈ' => 'Ꟈ', + 'ꟊ' => 'Ꟊ', + 'ꟶ' => 'Ꟶ', + 'ꭓ' => 'Ꭓ', + 'ꭰ' => 'Ꭰ', + 'ꭱ' => 'Ꭱ', + 'ꭲ' => 'Ꭲ', + 'ꭳ' => 'Ꭳ', + 'ꭴ' => 'Ꭴ', + 'ꭵ' => 'Ꭵ', + 'ꭶ' => 'Ꭶ', + 'ꭷ' => 'Ꭷ', + 'ꭸ' => 'Ꭸ', + 'ꭹ' => 'Ꭹ', + 'ꭺ' => 'Ꭺ', + 'ꭻ' => 'Ꭻ', + 'ꭼ' => 'Ꭼ', + 'ꭽ' => 'Ꭽ', + 'ꭾ' => 'Ꭾ', + 'ꭿ' => 'Ꭿ', + 'ꮀ' => 'Ꮀ', + 'ꮁ' => 'Ꮁ', + 'ꮂ' => 'Ꮂ', + 'ꮃ' => 'Ꮃ', + 'ꮄ' => 'Ꮄ', + 'ꮅ' => 'Ꮅ', + 'ꮆ' => 'Ꮆ', + 'ꮇ' => 'Ꮇ', + 'ꮈ' => 'Ꮈ', + 'ꮉ' => 'Ꮉ', + 'ꮊ' => 'Ꮊ', + 'ꮋ' => 'Ꮋ', + 'ꮌ' => 'Ꮌ', + 'ꮍ' => 'Ꮍ', + 'ꮎ' => 'Ꮎ', + 'ꮏ' => 'Ꮏ', + 'ꮐ' => 'Ꮐ', + 'ꮑ' => 'Ꮑ', + 'ꮒ' => 'Ꮒ', + 'ꮓ' => 'Ꮓ', + 'ꮔ' => 'Ꮔ', + 'ꮕ' => 'Ꮕ', + 'ꮖ' => 'Ꮖ', + 'ꮗ' => 'Ꮗ', + 'ꮘ' => 'Ꮘ', + 'ꮙ' => 'Ꮙ', + 'ꮚ' => 'Ꮚ', + 'ꮛ' => 'Ꮛ', + 'ꮜ' => 'Ꮜ', + 'ꮝ' => 'Ꮝ', + 'ꮞ' => 'Ꮞ', + 'ꮟ' => 'Ꮟ', + 'ꮠ' => 'Ꮠ', + 'ꮡ' => 'Ꮡ', + 'ꮢ' => 'Ꮢ', + 'ꮣ' => 'Ꮣ', + 'ꮤ' => 'Ꮤ', + 'ꮥ' => 'Ꮥ', + 'ꮦ' => 'Ꮦ', + 'ꮧ' => 'Ꮧ', + 'ꮨ' => 'Ꮨ', + 'ꮩ' => 'Ꮩ', + 'ꮪ' => 'Ꮪ', + 'ꮫ' => 'Ꮫ', + 'ꮬ' => 'Ꮬ', + 'ꮭ' => 'Ꮭ', + 'ꮮ' => 'Ꮮ', + 'ꮯ' => 'Ꮯ', + 'ꮰ' => 'Ꮰ', + 'ꮱ' => 'Ꮱ', + 'ꮲ' => 'Ꮲ', + 'ꮳ' => 'Ꮳ', + 'ꮴ' => 'Ꮴ', + 'ꮵ' => 'Ꮵ', + 'ꮶ' => 'Ꮶ', + 'ꮷ' => 'Ꮷ', + 'ꮸ' => 'Ꮸ', + 'ꮹ' => 'Ꮹ', + 'ꮺ' => 'Ꮺ', + 'ꮻ' => 'Ꮻ', + 'ꮼ' => 'Ꮼ', + 'ꮽ' => 'Ꮽ', + 'ꮾ' => 'Ꮾ', + 'ꮿ' => 'Ꮿ', + 'a' => 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + '𐐨' => '𐐀', + '𐐩' => '𐐁', + '𐐪' => '𐐂', + '𐐫' => '𐐃', + '𐐬' => '𐐄', + '𐐭' => '𐐅', + '𐐮' => '𐐆', + '𐐯' => '𐐇', + '𐐰' => '𐐈', + '𐐱' => '𐐉', + '𐐲' => '𐐊', + '𐐳' => '𐐋', + '𐐴' => '𐐌', + '𐐵' => '𐐍', + '𐐶' => '𐐎', + '𐐷' => '𐐏', + '𐐸' => '𐐐', + '𐐹' => '𐐑', + '𐐺' => '𐐒', + '𐐻' => '𐐓', + '𐐼' => '𐐔', + '𐐽' => '𐐕', + '𐐾' => '𐐖', + '𐐿' => '𐐗', + '𐑀' => '𐐘', + '𐑁' => '𐐙', + '𐑂' => '𐐚', + '𐑃' => '𐐛', + '𐑄' => '𐐜', + '𐑅' => '𐐝', + '𐑆' => '𐐞', + '𐑇' => '𐐟', + '𐑈' => '𐐠', + '𐑉' => '𐐡', + '𐑊' => '𐐢', + '𐑋' => '𐐣', + '𐑌' => '𐐤', + '𐑍' => '𐐥', + '𐑎' => '𐐦', + '𐑏' => '𐐧', + '𐓘' => '𐒰', + '𐓙' => '𐒱', + '𐓚' => '𐒲', + '𐓛' => '𐒳', + '𐓜' => '𐒴', + '𐓝' => '𐒵', + '𐓞' => '𐒶', + '𐓟' => '𐒷', + '𐓠' => '𐒸', + '𐓡' => '𐒹', + '𐓢' => '𐒺', + '𐓣' => '𐒻', + '𐓤' => '𐒼', + '𐓥' => '𐒽', + '𐓦' => '𐒾', + '𐓧' => '𐒿', + '𐓨' => '𐓀', + '𐓩' => '𐓁', + '𐓪' => '𐓂', + '𐓫' => '𐓃', + '𐓬' => '𐓄', + '𐓭' => '𐓅', + '𐓮' => '𐓆', + '𐓯' => '𐓇', + '𐓰' => '𐓈', + '𐓱' => '𐓉', + '𐓲' => '𐓊', + '𐓳' => '𐓋', + '𐓴' => '𐓌', + '𐓵' => '𐓍', + '𐓶' => '𐓎', + '𐓷' => '𐓏', + '𐓸' => '𐓐', + '𐓹' => '𐓑', + '𐓺' => '𐓒', + '𐓻' => '𐓓', + '𐳀' => '𐲀', + '𐳁' => '𐲁', + '𐳂' => '𐲂', + '𐳃' => '𐲃', + '𐳄' => '𐲄', + '𐳅' => '𐲅', + '𐳆' => '𐲆', + '𐳇' => '𐲇', + '𐳈' => '𐲈', + '𐳉' => '𐲉', + '𐳊' => '𐲊', + '𐳋' => '𐲋', + '𐳌' => '𐲌', + '𐳍' => '𐲍', + '𐳎' => '𐲎', + '𐳏' => '𐲏', + '𐳐' => '𐲐', + '𐳑' => '𐲑', + '𐳒' => '𐲒', + '𐳓' => '𐲓', + '𐳔' => '𐲔', + '𐳕' => '𐲕', + '𐳖' => '𐲖', + '𐳗' => '𐲗', + '𐳘' => '𐲘', + '𐳙' => '𐲙', + '𐳚' => '𐲚', + '𐳛' => '𐲛', + '𐳜' => '𐲜', + '𐳝' => '𐲝', + '𐳞' => '𐲞', + '𐳟' => '𐲟', + '𐳠' => '𐲠', + '𐳡' => '𐲡', + '𐳢' => '𐲢', + '𐳣' => '𐲣', + '𐳤' => '𐲤', + '𐳥' => '𐲥', + '𐳦' => '𐲦', + '𐳧' => '𐲧', + '𐳨' => '𐲨', + '𐳩' => '𐲩', + '𐳪' => '𐲪', + '𐳫' => '𐲫', + '𐳬' => '𐲬', + '𐳭' => '𐲭', + '𐳮' => '𐲮', + '𐳯' => '𐲯', + '𐳰' => '𐲰', + '𐳱' => '𐲱', + '𐳲' => '𐲲', + '𑣀' => '𑢠', + '𑣁' => '𑢡', + '𑣂' => '𑢢', + '𑣃' => '𑢣', + '𑣄' => '𑢤', + '𑣅' => '𑢥', + '𑣆' => '𑢦', + '𑣇' => '𑢧', + '𑣈' => '𑢨', + '𑣉' => '𑢩', + '𑣊' => '𑢪', + '𑣋' => '𑢫', + '𑣌' => '𑢬', + '𑣍' => '𑢭', + '𑣎' => '𑢮', + '𑣏' => '𑢯', + '𑣐' => '𑢰', + '𑣑' => '𑢱', + '𑣒' => '𑢲', + '𑣓' => '𑢳', + '𑣔' => '𑢴', + '𑣕' => '𑢵', + '𑣖' => '𑢶', + '𑣗' => '𑢷', + '𑣘' => '𑢸', + '𑣙' => '𑢹', + '𑣚' => '𑢺', + '𑣛' => '𑢻', + '𑣜' => '𑢼', + '𑣝' => '𑢽', + '𑣞' => '𑢾', + '𑣟' => '𑢿', + '𖹠' => '𖹀', + '𖹡' => '𖹁', + '𖹢' => '𖹂', + '𖹣' => '𖹃', + '𖹤' => '𖹄', + '𖹥' => '𖹅', + '𖹦' => '𖹆', + '𖹧' => '𖹇', + '𖹨' => '𖹈', + '𖹩' => '𖹉', + '𖹪' => '𖹊', + '𖹫' => '𖹋', + '𖹬' => '𖹌', + '𖹭' => '𖹍', + '𖹮' => '𖹎', + '𖹯' => '𖹏', + '𖹰' => '𖹐', + '𖹱' => '𖹑', + '𖹲' => '𖹒', + '𖹳' => '𖹓', + '𖹴' => '𖹔', + '𖹵' => '𖹕', + '𖹶' => '𖹖', + '𖹷' => '𖹗', + '𖹸' => '𖹘', + '𖹹' => '𖹙', + '𖹺' => '𖹚', + '𖹻' => '𖹛', + '𖹼' => '𖹜', + '𖹽' => '𖹝', + '𖹾' => '𖹞', + '𖹿' => '𖹟', + '𞤢' => '𞤀', + '𞤣' => '𞤁', + '𞤤' => '𞤂', + '𞤥' => '𞤃', + '𞤦' => '𞤄', + '𞤧' => '𞤅', + '𞤨' => '𞤆', + '𞤩' => '𞤇', + '𞤪' => '𞤈', + '𞤫' => '𞤉', + '𞤬' => '𞤊', + '𞤭' => '𞤋', + '𞤮' => '𞤌', + '𞤯' => '𞤍', + '𞤰' => '𞤎', + '𞤱' => '𞤏', + '𞤲' => '𞤐', + '𞤳' => '𞤑', + '𞤴' => '𞤒', + '𞤵' => '𞤓', + '𞤶' => '𞤔', + '𞤷' => '𞤕', + '𞤸' => '𞤖', + '𞤹' => '𞤗', + '𞤺' => '𞤘', + '𞤻' => '𞤙', + '𞤼' => '𞤚', + '𞤽' => '𞤛', + '𞤾' => '𞤜', + '𞤿' => '𞤝', + '𞥀' => '𞤞', + '𞥁' => '𞤟', + '𞥂' => '𞤠', + '𞥃' => '𞤡', + 'ß' => 'SS', + 'ff' => 'FF', + 'fi' => 'FI', + 'fl' => 'FL', + 'ffi' => 'FFI', + 'ffl' => 'FFL', + 'ſt' => 'ST', + 'st' => 'ST', + 'և' => 'ԵՒ', + 'ﬓ' => 'ՄՆ', + 'ﬔ' => 'ՄԵ', + 'ﬕ' => 'ՄԻ', + 'ﬖ' => 'ՎՆ', + 'ﬗ' => 'ՄԽ', + 'ʼn' => 'ʼN', + 'ΐ' => 'Ϊ́', + 'ΰ' => 'Ϋ́', + 'ǰ' => 'J̌', + 'ẖ' => 'H̱', + 'ẗ' => 'T̈', + 'ẘ' => 'W̊', + 'ẙ' => 'Y̊', + 'ẚ' => 'Aʾ', + 'ὐ' => 'Υ̓', + 'ὒ' => 'Υ̓̀', + 'ὔ' => 'Υ̓́', + 'ὖ' => 'Υ̓͂', + 'ᾶ' => 'Α͂', + 'ῆ' => 'Η͂', + 'ῒ' => 'Ϊ̀', + 'ΐ' => 'Ϊ́', + 'ῖ' => 'Ι͂', + 'ῗ' => 'Ϊ͂', + 'ῢ' => 'Ϋ̀', + 'ΰ' => 'Ϋ́', + 'ῤ' => 'Ρ̓', + 'ῦ' => 'Υ͂', + 'ῧ' => 'Ϋ͂', + 'ῶ' => 'Ω͂', + 'ᾈ' => 'ἈΙ', + 'ᾉ' => 'ἉΙ', + 'ᾊ' => 'ἊΙ', + 'ᾋ' => 'ἋΙ', + 'ᾌ' => 'ἌΙ', + 'ᾍ' => 'ἍΙ', + 'ᾎ' => 'ἎΙ', + 'ᾏ' => 'ἏΙ', + 'ᾘ' => 'ἨΙ', + 'ᾙ' => 'ἩΙ', + 'ᾚ' => 'ἪΙ', + 'ᾛ' => 'ἫΙ', + 'ᾜ' => 'ἬΙ', + 'ᾝ' => 'ἭΙ', + 'ᾞ' => 'ἮΙ', + 'ᾟ' => 'ἯΙ', + 'ᾨ' => 'ὨΙ', + 'ᾩ' => 'ὩΙ', + 'ᾪ' => 'ὪΙ', + 'ᾫ' => 'ὫΙ', + 'ᾬ' => 'ὬΙ', + 'ᾭ' => 'ὭΙ', + 'ᾮ' => 'ὮΙ', + 'ᾯ' => 'ὯΙ', + 'ᾼ' => 'ΑΙ', + 'ῌ' => 'ΗΙ', + 'ῼ' => 'ΩΙ', + 'ᾲ' => 'ᾺΙ', + 'ᾴ' => 'ΆΙ', + 'ῂ' => 'ῊΙ', + 'ῄ' => 'ΉΙ', + 'ῲ' => 'ῺΙ', + 'ῴ' => 'ΏΙ', + 'ᾷ' => 'Α͂Ι', + 'ῇ' => 'Η͂Ι', + 'ῷ' => 'Ω͂Ι', +); diff --git a/trunk/vendor/symfony/polyfill-mbstring/bootstrap.php b/trunk/vendor/symfony/polyfill-mbstring/bootstrap.php new file mode 100644 index 00000000..6e4b5fce --- /dev/null +++ b/trunk/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -0,0 +1,159 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language($language = null) { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } +} + +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/trunk/vendor/symfony/polyfill-mbstring/bootstrap80.php b/trunk/vendor/symfony/polyfill-mbstring/bootstrap80.php new file mode 100644 index 00000000..ec2ae427 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -0,0 +1,155 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } +} + +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/trunk/vendor/symfony/polyfill-php73/LICENSE b/trunk/vendor/symfony/polyfill-php73/LICENSE new file mode 100644 index 00000000..7536caea --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php73/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-php73/Php73.php b/trunk/vendor/symfony/polyfill-php73/Php73.php new file mode 100644 index 00000000..65c35a6a --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php73/Php73.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php73; + +/** + * @author Gabriel Caruso + * @author Ion Bazan + * + * @internal + */ +final class Php73 +{ + public static $startAt = 1533462603; + + /** + * @param bool $asNum + * + * @return array|float|int + */ + public static function hrtime($asNum = false) + { + $ns = microtime(false); + $s = substr($ns, 11) - self::$startAt; + $ns = 1E9 * (float) $ns; + + if ($asNum) { + $ns += $s * 1E9; + + return \PHP_INT_SIZE === 4 ? $ns : (int) $ns; + } + + return [$s, (int) $ns]; + } +} diff --git a/trunk/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/trunk/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php new file mode 100644 index 00000000..f06d6c26 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 70300) { + class JsonException extends Exception + { + } +} diff --git a/trunk/vendor/symfony/polyfill-php73/bootstrap.php b/trunk/vendor/symfony/polyfill-php73/bootstrap.php new file mode 100644 index 00000000..d6b21538 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php73/bootstrap.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php73 as p; + +if (\PHP_VERSION_ID >= 70300) { + return; +} + +if (!function_exists('is_countable')) { + function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; } +} +if (!function_exists('hrtime')) { + require_once __DIR__.'/Php73.php'; + p\Php73::$startAt = (int) microtime(true); + function hrtime($as_number = false) { return p\Php73::hrtime($as_number); } +} +if (!function_exists('array_key_first')) { + function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } } +} +if (!function_exists('array_key_last')) { + function array_key_last(array $array) { return key(array_slice($array, -1, 1, true)); } +} diff --git a/trunk/vendor/symfony/polyfill-php80/LICENSE b/trunk/vendor/symfony/polyfill-php80/LICENSE new file mode 100644 index 00000000..0ed3a246 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php80/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-php80/Php80.php b/trunk/vendor/symfony/polyfill-php80/Php80.php new file mode 100644 index 00000000..362dd1a9 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php80/Php80.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Ion Bazan + * @author Nico Oelgart + * @author Nicolas Grekas + * + * @internal + */ +final class Php80 +{ + public static function fdiv(float $dividend, float $divisor): float + { + return @($dividend / $divisor); + } + + public static function get_debug_type($value): string + { + switch (true) { + case null === $value: return 'null'; + case \is_bool($value): return 'bool'; + case \is_string($value): return 'string'; + case \is_array($value): return 'array'; + case \is_int($value): return 'int'; + case \is_float($value): return 'float'; + case \is_object($value): break; + case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; + default: + if (null === $type = @get_resource_type($value)) { + return 'unknown'; + } + + if ('Unknown' === $type) { + $type = 'closed'; + } + + return "resource ($type)"; + } + + $class = \get_class($value); + + if (false === strpos($class, '@')) { + return $class; + } + + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; + } + + public static function get_resource_id($res): int + { + if (!\is_resource($res) && null === @get_resource_type($res)) { + throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + } + + return (int) $res; + } + + public static function preg_last_error_msg(): string + { + switch (preg_last_error()) { + case \PREG_INTERNAL_ERROR: + return 'Internal error'; + case \PREG_BAD_UTF8_ERROR: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + case \PREG_BAD_UTF8_OFFSET_ERROR: + return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; + case \PREG_BACKTRACK_LIMIT_ERROR: + return 'Backtrack limit exhausted'; + case \PREG_RECURSION_LIMIT_ERROR: + return 'Recursion limit exhausted'; + case \PREG_JIT_STACKLIMIT_ERROR: + return 'JIT stack limit exhausted'; + case \PREG_NO_ERROR: + return 'No error'; + default: + return 'Unknown error'; + } + } + + public static function str_contains(string $haystack, string $needle): bool + { + return '' === $needle || false !== strpos($haystack, $needle); + } + + public static function str_starts_with(string $haystack, string $needle): bool + { + return 0 === strncmp($haystack, $needle, \strlen($needle)); + } + + public static function str_ends_with(string $haystack, string $needle): bool + { + if ('' === $needle || $needle === $haystack) { + return true; + } + + if ('' === $haystack) { + return false; + } + + $needleLength = \strlen($needle); + + return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); + } +} diff --git a/trunk/vendor/symfony/polyfill-php80/PhpToken.php b/trunk/vendor/symfony/polyfill-php80/PhpToken.php new file mode 100644 index 00000000..fe6e6910 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php80/PhpToken.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton + * + * @internal + */ +class PhpToken implements \Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var int + */ + public $line; + + /** + * @var int + */ + public $pos; + + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php new file mode 100644 index 00000000..2b955423 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#[Attribute(Attribute::TARGET_CLASS)] +final class Attribute +{ + public const TARGET_CLASS = 1; + public const TARGET_FUNCTION = 2; + public const TARGET_METHOD = 4; + public const TARGET_PROPERTY = 8; + public const TARGET_CLASS_CONSTANT = 16; + public const TARGET_PARAMETER = 32; + public const TARGET_ALL = 63; + public const IS_REPEATABLE = 64; + + /** @var int */ + public $flags; + + public function __construct(int $flags = self::TARGET_ALL) + { + $this->flags = $flags; + } +} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 00000000..bd1212f6 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { + class PhpToken extends Symfony\Polyfill\Php80\PhpToken + { + } +} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php new file mode 100644 index 00000000..7c62d750 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + interface Stringable + { + /** + * @return string + */ + public function __toString(); + } +} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php new file mode 100644 index 00000000..01c6c6c8 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class UnhandledMatchError extends Error + { + } +} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php new file mode 100644 index 00000000..783dbc28 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class ValueError extends Error + { + } +} diff --git a/trunk/vendor/symfony/polyfill-php80/bootstrap.php b/trunk/vendor/symfony/polyfill-php80/bootstrap.php new file mode 100644 index 00000000..e5f7dbc1 --- /dev/null +++ b/trunk/vendor/symfony/polyfill-php80/bootstrap.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php80 as p; + +if (\PHP_VERSION_ID >= 80000) { + return; +} + +if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { + define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); +} + +if (!function_exists('fdiv')) { + function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } +} +if (!function_exists('preg_last_error_msg')) { + function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } +} +if (!function_exists('str_contains')) { + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_starts_with')) { + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_ends_with')) { + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('get_debug_type')) { + function get_debug_type($value): string { return p\Php80::get_debug_type($value); } +} +if (!function_exists('get_resource_id')) { + function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } +} diff --git a/trunk/vendor/symfony/service-contracts/Attribute/Required.php b/trunk/vendor/symfony/service-contracts/Attribute/Required.php new file mode 100644 index 00000000..9df85118 --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/Attribute/Required.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service\Attribute; + +/** + * A required dependency. + * + * This attribute indicates that a property holds a required dependency. The annotated property or method should be + * considered during the instantiation process of the containing class. + * + * @author Alexander M. Turek + */ +#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] +final class Required +{ +} diff --git a/trunk/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/trunk/vendor/symfony/service-contracts/Attribute/SubscribedService.php new file mode 100644 index 00000000..10d1bc38 --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/Attribute/SubscribedService.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service\Attribute; + +use Symfony\Contracts\Service\ServiceSubscriberTrait; + +/** + * Use with {@see ServiceSubscriberTrait} to mark a method's return type + * as a subscribed service. + * + * @author Kevin Bond + */ +#[\Attribute(\Attribute::TARGET_METHOD)] +final class SubscribedService +{ + /** + * @param string|null $key The key to use for the service + * If null, use "ClassName::methodName" + */ + public function __construct( + public ?string $key = null + ) { + } +} diff --git a/trunk/vendor/symfony/service-contracts/CHANGELOG.md b/trunk/vendor/symfony/service-contracts/CHANGELOG.md new file mode 100644 index 00000000..7932e261 --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/trunk/vendor/symfony/service-contracts/LICENSE b/trunk/vendor/symfony/service-contracts/LICENSE new file mode 100644 index 00000000..74cdc2db --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2022 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/service-contracts/ResetInterface.php b/trunk/vendor/symfony/service-contracts/ResetInterface.php new file mode 100644 index 00000000..1af1075e --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/ResetInterface.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service; + +/** + * Provides a way to reset an object to its initial state. + * + * When calling the "reset()" method on an object, it should be put back to its + * initial state. This usually means clearing any internal buffers and forwarding + * the call to internal dependencies. All properties of the object should be put + * back to the same state it had when it was first ready to use. + * + * This method could be called, for example, to recycle objects that are used as + * services, so that they can be used to handle several requests in the same + * process loop (note that we advise making your services stateless instead of + * implementing this interface when possible.) + */ +interface ResetInterface +{ + public function reset(); +} diff --git a/trunk/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/trunk/vendor/symfony/service-contracts/ServiceLocatorTrait.php new file mode 100644 index 00000000..19d3e80f --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/ServiceLocatorTrait.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service; + +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; + +// Help opcache.preload discover always-needed symbols +class_exists(ContainerExceptionInterface::class); +class_exists(NotFoundExceptionInterface::class); + +/** + * A trait to help implement ServiceProviderInterface. + * + * @author Robin Chalas + * @author Nicolas Grekas + */ +trait ServiceLocatorTrait +{ + private array $factories; + private array $loading = []; + private array $providedTypes; + + /** + * @param callable[] $factories + */ + public function __construct(array $factories) + { + $this->factories = $factories; + } + + /** + * {@inheritdoc} + */ + public function has(string $id): bool + { + return isset($this->factories[$id]); + } + + /** + * {@inheritdoc} + */ + public function get(string $id): mixed + { + if (!isset($this->factories[$id])) { + throw $this->createNotFoundException($id); + } + + if (isset($this->loading[$id])) { + $ids = array_values($this->loading); + $ids = \array_slice($this->loading, array_search($id, $ids)); + $ids[] = $id; + + throw $this->createCircularReferenceException($id, $ids); + } + + $this->loading[$id] = $id; + try { + return $this->factories[$id]($this); + } finally { + unset($this->loading[$id]); + } + } + + /** + * {@inheritdoc} + */ + public function getProvidedServices(): array + { + if (!isset($this->providedTypes)) { + $this->providedTypes = []; + + foreach ($this->factories as $name => $factory) { + if (!\is_callable($factory)) { + $this->providedTypes[$name] = '?'; + } else { + $type = (new \ReflectionFunction($factory))->getReturnType(); + + $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?'; + } + } + } + + return $this->providedTypes; + } + + private function createNotFoundException(string $id): NotFoundExceptionInterface + { + if (!$alternatives = array_keys($this->factories)) { + $message = 'is empty...'; + } else { + $last = array_pop($alternatives); + if ($alternatives) { + $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last); + } else { + $message = sprintf('only knows about the "%s" service.', $last); + } + } + + if ($this->loading) { + $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message); + } else { + $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message); + } + + return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface { + }; + } + + private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface + { + return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface { + }; + } +} diff --git a/trunk/vendor/symfony/service-contracts/ServiceProviderInterface.php b/trunk/vendor/symfony/service-contracts/ServiceProviderInterface.php new file mode 100644 index 00000000..c60ad0bd --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/ServiceProviderInterface.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service; + +use Psr\Container\ContainerInterface; + +/** + * A ServiceProviderInterface exposes the identifiers and the types of services provided by a container. + * + * @author Nicolas Grekas + * @author Mateusz Sip + */ +interface ServiceProviderInterface extends ContainerInterface +{ + /** + * Returns an associative array of service types keyed by the identifiers provided by the current container. + * + * Examples: + * + * * ['logger' => 'Psr\Log\LoggerInterface'] means the object provides a service named "logger" that implements Psr\Log\LoggerInterface + * * ['foo' => '?'] means the container provides service name "foo" of unspecified type + * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null + * + * @return string[] The provided service types, keyed by service names + */ + public function getProvidedServices(): array; +} diff --git a/trunk/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/trunk/vendor/symfony/service-contracts/ServiceSubscriberInterface.php new file mode 100644 index 00000000..881ab971 --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/ServiceSubscriberInterface.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service; + +/** + * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method. + * + * The getSubscribedServices method returns an array of service types required by such instances, + * optionally keyed by the service names used internally. Service types that start with an interrogation + * mark "?" are optional, while the other ones are mandatory service dependencies. + * + * The injected service locators SHOULD NOT allow access to any other services not specified by the method. + * + * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally. + * This interface does not dictate any injection method for these service locators, although constructor + * injection is recommended. + * + * @author Nicolas Grekas + */ +interface ServiceSubscriberInterface +{ + /** + * Returns an array of service types required by such instances, optionally keyed by the service names used internally. + * + * For mandatory dependencies: + * + * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name + * internally to fetch a service which must implement Psr\Log\LoggerInterface. + * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name + * internally to fetch an iterable of Psr\Log\LoggerInterface instances. + * * ['Psr\Log\LoggerInterface'] is a shortcut for + * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface'] + * + * otherwise: + * + * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency + * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency + * * ['?Psr\Log\LoggerInterface'] is a shortcut for + * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface'] + * + * @return string[] The required service types, optionally keyed by service names + */ + public static function getSubscribedServices(): array; +} diff --git a/trunk/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/trunk/vendor/symfony/service-contracts/ServiceSubscriberTrait.php new file mode 100644 index 00000000..ee9d9d9d --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/ServiceSubscriberTrait.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service; + +use Psr\Container\ContainerInterface; +use Symfony\Contracts\Service\Attribute\SubscribedService; + +/** + * Implementation of ServiceSubscriberInterface that determines subscribed services from + * method return types. Service ids are available as "ClassName::methodName". + * + * @author Kevin Bond + */ +trait ServiceSubscriberTrait +{ + /** @var ContainerInterface */ + protected $container; + + /** + * {@inheritdoc} + */ + public static function getSubscribedServices(): array + { + $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; + + foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { + if (self::class !== $method->getDeclaringClass()->name) { + continue; + } + + if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { + continue; + } + + if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { + throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); + } + + if (!$returnType = $method->getReturnType()) { + throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); + } + + $serviceId = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; + + if ($returnType->allowsNull()) { + $serviceId = '?'.$serviceId; + } + + $services[$attribute->newInstance()->key ?? self::class.'::'.$method->name] = $serviceId; + } + + return $services; + } + + /** + * @required + */ + public function setContainer(ContainerInterface $container): ?ContainerInterface + { + $this->container = $container; + + if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { + return parent::setContainer($container); + } + + return null; + } +} diff --git a/trunk/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/trunk/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php new file mode 100644 index 00000000..88f6a068 --- /dev/null +++ b/trunk/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service\Test; + +use PHPUnit\Framework\TestCase; +use Psr\Container\ContainerInterface; +use Symfony\Contracts\Service\ServiceLocatorTrait; + +abstract class ServiceLocatorTest extends TestCase +{ + protected function getServiceLocator(array $factories): ContainerInterface + { + return new class($factories) implements ContainerInterface { + use ServiceLocatorTrait; + }; + } + + public function testHas() + { + $locator = $this->getServiceLocator([ + 'foo' => function () { return 'bar'; }, + 'bar' => function () { return 'baz'; }, + function () { return 'dummy'; }, + ]); + + $this->assertTrue($locator->has('foo')); + $this->assertTrue($locator->has('bar')); + $this->assertFalse($locator->has('dummy')); + } + + public function testGet() + { + $locator = $this->getServiceLocator([ + 'foo' => function () { return 'bar'; }, + 'bar' => function () { return 'baz'; }, + ]); + + $this->assertSame('bar', $locator->get('foo')); + $this->assertSame('baz', $locator->get('bar')); + } + + public function testGetDoesNotMemoize() + { + $i = 0; + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$i) { + ++$i; + + return 'bar'; + }, + ]); + + $this->assertSame('bar', $locator->get('foo')); + $this->assertSame('bar', $locator->get('foo')); + $this->assertSame(2, $i); + } + + public function testThrowsOnUndefinedInternalService() + { + if (!$this->getExpectedException()) { + $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); + $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); + } + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$locator) { return $locator->get('bar'); }, + ]); + + $locator->get('foo'); + } + + public function testThrowsOnCircularReference() + { + $this->expectException(\Psr\Container\ContainerExceptionInterface::class); + $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$locator) { return $locator->get('bar'); }, + 'bar' => function () use (&$locator) { return $locator->get('baz'); }, + 'baz' => function () use (&$locator) { return $locator->get('bar'); }, + ]); + + $locator->get('foo'); + } +} diff --git a/trunk/vendor/symfony/string/AbstractString.php b/trunk/vendor/symfony/string/AbstractString.php new file mode 100644 index 00000000..cf96a837 --- /dev/null +++ b/trunk/vendor/symfony/string/AbstractString.php @@ -0,0 +1,716 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String; + +use Symfony\Component\String\Exception\ExceptionInterface; +use Symfony\Component\String\Exception\InvalidArgumentException; +use Symfony\Component\String\Exception\RuntimeException; + +/** + * Represents a string of abstract characters. + * + * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). + * This class is the abstract type to use as a type-hint when the logic you want to + * implement doesn't care about the exact variant it deals with. + * + * @author Nicolas Grekas + * @author Hugo Hamon + * + * @throws ExceptionInterface + */ +abstract class AbstractString implements \Stringable, \JsonSerializable +{ + public const PREG_PATTERN_ORDER = \PREG_PATTERN_ORDER; + public const PREG_SET_ORDER = \PREG_SET_ORDER; + public const PREG_OFFSET_CAPTURE = \PREG_OFFSET_CAPTURE; + public const PREG_UNMATCHED_AS_NULL = \PREG_UNMATCHED_AS_NULL; + + public const PREG_SPLIT = 0; + public const PREG_SPLIT_NO_EMPTY = \PREG_SPLIT_NO_EMPTY; + public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE; + public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE; + + protected $string = ''; + protected $ignoreCase = false; + + abstract public function __construct(string $string = ''); + + /** + * Unwraps instances of AbstractString back to strings. + * + * @return string[]|array + */ + public static function unwrap(array $values): array + { + foreach ($values as $k => $v) { + if ($v instanceof self) { + $values[$k] = $v->__toString(); + } elseif (\is_array($v) && $values[$k] !== $v = static::unwrap($v)) { + $values[$k] = $v; + } + } + + return $values; + } + + /** + * Wraps (and normalizes) strings in instances of AbstractString. + * + * @return static[]|array + */ + public static function wrap(array $values): array + { + $i = 0; + $keys = null; + + foreach ($values as $k => $v) { + if (\is_string($k) && '' !== $k && $k !== $j = (string) new static($k)) { + $keys = $keys ?? array_keys($values); + $keys[$i] = $j; + } + + if (\is_string($v)) { + $values[$k] = new static($v); + } elseif (\is_array($v) && $values[$k] !== $v = static::wrap($v)) { + $values[$k] = $v; + } + + ++$i; + } + + return null !== $keys ? array_combine($keys, $values) : $values; + } + + /** + * @param string|string[] $needle + */ + public function after(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static + { + $str = clone $this; + $i = \PHP_INT_MAX; + + if (\is_string($needle)) { + $needle = [$needle]; + } + + foreach ($needle as $n) { + $n = (string) $n; + $j = $this->indexOf($n, $offset); + + if (null !== $j && $j < $i) { + $i = $j; + $str->string = $n; + } + } + + if (\PHP_INT_MAX === $i) { + return $str; + } + + if (!$includeNeedle) { + $i += $str->length(); + } + + return $this->slice($i); + } + + /** + * @param string|string[] $needle + */ + public function afterLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static + { + $str = clone $this; + $i = null; + + if (\is_string($needle)) { + $needle = [$needle]; + } + + foreach ($needle as $n) { + $n = (string) $n; + $j = $this->indexOfLast($n, $offset); + + if (null !== $j && $j >= $i) { + $i = $offset = $j; + $str->string = $n; + } + } + + if (null === $i) { + return $str; + } + + if (!$includeNeedle) { + $i += $str->length(); + } + + return $this->slice($i); + } + + abstract public function append(string ...$suffix): static; + + /** + * @param string|string[] $needle + */ + public function before(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static + { + $str = clone $this; + $i = \PHP_INT_MAX; + + if (\is_string($needle)) { + $needle = [$needle]; + } + + foreach ($needle as $n) { + $n = (string) $n; + $j = $this->indexOf($n, $offset); + + if (null !== $j && $j < $i) { + $i = $j; + $str->string = $n; + } + } + + if (\PHP_INT_MAX === $i) { + return $str; + } + + if ($includeNeedle) { + $i += $str->length(); + } + + return $this->slice(0, $i); + } + + /** + * @param string|string[] $needle + */ + public function beforeLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static + { + $str = clone $this; + $i = null; + + if (\is_string($needle)) { + $needle = [$needle]; + } + + foreach ($needle as $n) { + $n = (string) $n; + $j = $this->indexOfLast($n, $offset); + + if (null !== $j && $j >= $i) { + $i = $offset = $j; + $str->string = $n; + } + } + + if (null === $i) { + return $str; + } + + if ($includeNeedle) { + $i += $str->length(); + } + + return $this->slice(0, $i); + } + + /** + * @return int[] + */ + public function bytesAt(int $offset): array + { + $str = $this->slice($offset, 1); + + return '' === $str->string ? [] : array_values(unpack('C*', $str->string)); + } + + abstract public function camel(): static; + + /** + * @return static[] + */ + abstract public function chunk(int $length = 1): array; + + public function collapseWhitespace(): static + { + $str = clone $this; + $str->string = trim(preg_replace("/(?:[ \n\r\t\x0C]{2,}+|[\n\r\t\x0C])/", ' ', $str->string), " \n\r\t\x0C"); + + return $str; + } + + /** + * @param string|string[] $needle + */ + public function containsAny(string|iterable $needle): bool + { + return null !== $this->indexOf($needle); + } + + /** + * @param string|string[] $suffix + */ + public function endsWith(string|iterable $suffix): bool + { + if (\is_string($suffix)) { + throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + } + + foreach ($suffix as $s) { + if ($this->endsWith((string) $s)) { + return true; + } + } + + return false; + } + + public function ensureEnd(string $suffix): static + { + if (!$this->endsWith($suffix)) { + return $this->append($suffix); + } + + $suffix = preg_quote($suffix); + $regex = '{('.$suffix.')(?:'.$suffix.')++$}D'; + + return $this->replaceMatches($regex.($this->ignoreCase ? 'i' : ''), '$1'); + } + + public function ensureStart(string $prefix): static + { + $prefix = new static($prefix); + + if (!$this->startsWith($prefix)) { + return $this->prepend($prefix); + } + + $str = clone $this; + $i = $prefixLen = $prefix->length(); + + while ($this->indexOf($prefix, $i) === $i) { + $str = $str->slice($prefixLen); + $i += $prefixLen; + } + + return $str; + } + + /** + * @param string|string[] $string + */ + public function equalsTo(string|iterable $string): bool + { + if (\is_string($string)) { + throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + } + + foreach ($string as $s) { + if ($this->equalsTo((string) $s)) { + return true; + } + } + + return false; + } + + abstract public function folded(): static; + + public function ignoreCase(): static + { + $str = clone $this; + $str->ignoreCase = true; + + return $str; + } + + /** + * @param string|string[] $needle + */ + public function indexOf(string|iterable $needle, int $offset = 0): ?int + { + if (\is_string($needle)) { + throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + } + + $i = \PHP_INT_MAX; + + foreach ($needle as $n) { + $j = $this->indexOf((string) $n, $offset); + + if (null !== $j && $j < $i) { + $i = $j; + } + } + + return \PHP_INT_MAX === $i ? null : $i; + } + + /** + * @param string|string[] $needle + */ + public function indexOfLast(string|iterable $needle, int $offset = 0): ?int + { + if (\is_string($needle)) { + throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + } + + $i = null; + + foreach ($needle as $n) { + $j = $this->indexOfLast((string) $n, $offset); + + if (null !== $j && $j >= $i) { + $i = $offset = $j; + } + } + + return $i; + } + + public function isEmpty(): bool + { + return '' === $this->string; + } + + abstract public function join(array $strings, string $lastGlue = null): static; + + public function jsonSerialize(): string + { + return $this->string; + } + + abstract public function length(): int; + + abstract public function lower(): static; + + /** + * Matches the string using a regular expression. + * + * Pass PREG_PATTERN_ORDER or PREG_SET_ORDER as $flags to get all occurrences matching the regular expression. + * + * @return array All matches in a multi-dimensional array ordered according to flags + */ + abstract public function match(string $regexp, int $flags = 0, int $offset = 0): array; + + abstract public function padBoth(int $length, string $padStr = ' '): static; + + abstract public function padEnd(int $length, string $padStr = ' '): static; + + abstract public function padStart(int $length, string $padStr = ' '): static; + + abstract public function prepend(string ...$prefix): static; + + public function repeat(int $multiplier): static + { + if (0 > $multiplier) { + throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier)); + } + + $str = clone $this; + $str->string = str_repeat($str->string, $multiplier); + + return $str; + } + + abstract public function replace(string $from, string $to): static; + + abstract public function replaceMatches(string $fromRegexp, string|callable $to): static; + + abstract public function reverse(): static; + + abstract public function slice(int $start = 0, int $length = null): static; + + abstract public function snake(): static; + + abstract public function splice(string $replacement, int $start = 0, int $length = null): static; + + /** + * @return static[] + */ + public function split(string $delimiter, int $limit = null, int $flags = null): array + { + if (null === $flags) { + throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.'); + } + + if ($this->ignoreCase) { + $delimiter .= 'i'; + } + + set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + + try { + if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) { + $lastError = preg_last_error(); + + foreach (get_defined_constants(true)['pcre'] as $k => $v) { + if ($lastError === $v && '_ERROR' === substr($k, -6)) { + throw new RuntimeException('Splitting failed with '.$k.'.'); + } + } + + throw new RuntimeException('Splitting failed with unknown error code.'); + } + } finally { + restore_error_handler(); + } + + $str = clone $this; + + if (self::PREG_SPLIT_OFFSET_CAPTURE & $flags) { + foreach ($chunks as &$chunk) { + $str->string = $chunk[0]; + $chunk[0] = clone $str; + } + } else { + foreach ($chunks as &$chunk) { + $str->string = $chunk; + $chunk = clone $str; + } + } + + return $chunks; + } + + /** + * @param string|string[] $prefix + */ + public function startsWith(string|iterable $prefix): bool + { + if (\is_string($prefix)) { + throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + } + + foreach ($prefix as $prefix) { + if ($this->startsWith((string) $prefix)) { + return true; + } + } + + return false; + } + + abstract public function title(bool $allWords = false): static; + + public function toByteString(string $toEncoding = null): ByteString + { + $b = new ByteString(); + + $toEncoding = \in_array($toEncoding, ['utf8', 'utf-8', 'UTF8'], true) ? 'UTF-8' : $toEncoding; + + if (null === $toEncoding || $toEncoding === $fromEncoding = $this instanceof AbstractUnicodeString || preg_match('//u', $b->string) ? 'UTF-8' : 'Windows-1252') { + $b->string = $this->string; + + return $b; + } + + set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + + try { + try { + $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); + } catch (InvalidArgumentException $e) { + if (!\function_exists('iconv')) { + throw $e; + } + + $b->string = iconv('UTF-8', $toEncoding, $this->string); + } + } finally { + restore_error_handler(); + } + + return $b; + } + + public function toCodePointString(): CodePointString + { + return new CodePointString($this->string); + } + + public function toString(): string + { + return $this->string; + } + + public function toUnicodeString(): UnicodeString + { + return new UnicodeString($this->string); + } + + abstract public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; + + abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; + + /** + * @param string|string[] $prefix + */ + public function trimPrefix($prefix): static + { + if (\is_array($prefix) || $prefix instanceof \Traversable) { + foreach ($prefix as $s) { + $t = $this->trimPrefix($s); + + if ($t->string !== $this->string) { + return $t; + } + } + + return clone $this; + } + + $str = clone $this; + + if ($prefix instanceof self) { + $prefix = $prefix->string; + } else { + $prefix = (string) $prefix; + } + + if ('' !== $prefix && \strlen($this->string) >= \strlen($prefix) && 0 === substr_compare($this->string, $prefix, 0, \strlen($prefix), $this->ignoreCase)) { + $str->string = substr($this->string, \strlen($prefix)); + } + + return $str; + } + + abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; + + /** + * @param string|string[] $suffix + */ + public function trimSuffix($suffix): static + { + if (\is_array($suffix) || $suffix instanceof \Traversable) { + foreach ($suffix as $s) { + $t = $this->trimSuffix($s); + + if ($t->string !== $this->string) { + return $t; + } + } + + return clone $this; + } + + $str = clone $this; + + if ($suffix instanceof self) { + $suffix = $suffix->string; + } else { + $suffix = (string) $suffix; + } + + if ('' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase)) { + $str->string = substr($this->string, 0, -\strlen($suffix)); + } + + return $str; + } + + public function truncate(int $length, string $ellipsis = '', bool $cut = true): static + { + $stringLength = $this->length(); + + if ($stringLength <= $length) { + return clone $this; + } + + $ellipsisLength = '' !== $ellipsis ? (new static($ellipsis))->length() : 0; + + if ($length < $ellipsisLength) { + $ellipsisLength = 0; + } + + if (!$cut) { + if (null === $length = $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { + return clone $this; + } + + $length += $ellipsisLength; + } + + $str = $this->slice(0, $length - $ellipsisLength); + + return $ellipsisLength ? $str->trimEnd()->append($ellipsis) : $str; + } + + abstract public function upper(): static; + + /** + * Returns the printable length on a terminal. + */ + abstract public function width(bool $ignoreAnsiDecoration = true): int; + + public function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): static + { + $lines = '' !== $break ? $this->split($break) : [clone $this]; + $chars = []; + $mask = ''; + + if (1 === \count($lines) && '' === $lines[0]->string) { + return $lines[0]; + } + + foreach ($lines as $i => $line) { + if ($i) { + $chars[] = $break; + $mask .= '#'; + } + + foreach ($line->chunk() as $char) { + $chars[] = $char->string; + $mask .= ' ' === $char->string ? ' ' : '?'; + } + } + + $string = ''; + $j = 0; + $b = $i = -1; + $mask = wordwrap($mask, $width, '#', $cut); + + while (false !== $b = strpos($mask, '#', $b + 1)) { + for (++$i; $i < $b; ++$i) { + $string .= $chars[$j]; + unset($chars[$j++]); + } + + if ($break === $chars[$j] || ' ' === $chars[$j]) { + unset($chars[$j++]); + } + + $string .= $break; + } + + $str = clone $this; + $str->string = $string.implode('', $chars); + + return $str; + } + + public function __sleep(): array + { + return ['string']; + } + + public function __clone() + { + $this->ignoreCase = false; + } + + public function __toString(): string + { + return $this->string; + } +} diff --git a/trunk/vendor/symfony/string/AbstractUnicodeString.php b/trunk/vendor/symfony/string/AbstractUnicodeString.php new file mode 100644 index 00000000..00096df0 --- /dev/null +++ b/trunk/vendor/symfony/string/AbstractUnicodeString.php @@ -0,0 +1,606 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String; + +use Symfony\Component\String\Exception\ExceptionInterface; +use Symfony\Component\String\Exception\InvalidArgumentException; +use Symfony\Component\String\Exception\RuntimeException; + +/** + * Represents a string of abstract Unicode characters. + * + * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). + * This class is the abstract type to use as a type-hint when the logic you want to + * implement is Unicode-aware but doesn't care about code points vs grapheme clusters. + * + * @author Nicolas Grekas + * + * @throws ExceptionInterface + */ +abstract class AbstractUnicodeString extends AbstractString +{ + public const NFC = \Normalizer::NFC; + public const NFD = \Normalizer::NFD; + public const NFKC = \Normalizer::NFKC; + public const NFKD = \Normalizer::NFKD; + + // all ASCII letters sorted by typical frequency of occurrence + private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; + + // the subset of folded case mappings that is not in lower case mappings + private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'İ', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; + private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'i̇', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; + + // the subset of upper case mappings that map one code point to many code points + private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ']; + private const UPPER_TO = ['SS', 'FF', 'FI', 'FL', 'FFI', 'FFL', 'ST', 'ST', 'ԵՒ', 'ՄՆ', 'ՄԵ', 'ՄԻ', 'ՎՆ', 'ՄԽ', 'ʼN', 'Ϊ́', 'Ϋ́', 'J̌', 'H̱', 'T̈', 'W̊', 'Y̊', 'Aʾ', 'Υ̓', 'Υ̓̀', 'Υ̓́', 'Υ̓͂', 'Α͂', 'Η͂', 'Ϊ̀', 'Ϊ́', 'Ι͂', 'Ϊ͂', 'Ϋ̀', 'Ϋ́', 'Ρ̓', 'Υ͂', 'Ϋ͂', 'Ω͂']; + + // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD + private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; + private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; + + private static $transliterators = []; + private static $tableZero; + private static $tableWide; + + public static function fromCodePoints(int ...$codes): static + { + $string = ''; + + foreach ($codes as $code) { + if (0x80 > $code %= 0x200000) { + $string .= \chr($code); + } elseif (0x800 > $code) { + $string .= \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); + } elseif (0x10000 > $code) { + $string .= \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } else { + $string .= \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } + } + + return new static($string); + } + + /** + * Generic UTF-8 to ASCII transliteration. + * + * Install the intl extension for best results. + * + * @param string[]|\Transliterator[]|\Closure[] $rules See "*-Latin" rules from Transliterator::listIDs() + */ + public function ascii(array $rules = []): self + { + $str = clone $this; + $s = $str->string; + $str->string = ''; + + array_unshift($rules, 'nfd'); + $rules[] = 'latin-ascii'; + + if (\function_exists('transliterator_transliterate')) { + $rules[] = 'any-latin/bgn'; + } + + $rules[] = 'nfkd'; + $rules[] = '[:nonspacing mark:] remove'; + + while (\strlen($s) - 1 > $i = strspn($s, self::ASCII)) { + if (0 < --$i) { + $str->string .= substr($s, 0, $i); + $s = substr($s, $i); + } + + if (!$rule = array_shift($rules)) { + $rules = []; // An empty rule interrupts the next ones + } + + if ($rule instanceof \Transliterator) { + $s = $rule->transliterate($s); + } elseif ($rule instanceof \Closure) { + $s = $rule($s); + } elseif ($rule) { + if ('nfd' === $rule = strtolower($rule)) { + normalizer_is_normalized($s, self::NFD) ?: $s = normalizer_normalize($s, self::NFD); + } elseif ('nfkd' === $rule) { + normalizer_is_normalized($s, self::NFKD) ?: $s = normalizer_normalize($s, self::NFKD); + } elseif ('[:nonspacing mark:] remove' === $rule) { + $s = preg_replace('/\p{Mn}++/u', '', $s); + } elseif ('latin-ascii' === $rule) { + $s = str_replace(self::TRANSLIT_FROM, self::TRANSLIT_TO, $s); + } elseif ('de-ascii' === $rule) { + $s = preg_replace("/([AUO])\u{0308}(?=\p{Ll})/u", '$1e', $s); + $s = str_replace(["a\u{0308}", "o\u{0308}", "u\u{0308}", "A\u{0308}", "O\u{0308}", "U\u{0308}"], ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], $s); + } elseif (\function_exists('transliterator_transliterate')) { + if (null === $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule)) { + if ('any-latin/bgn' === $rule) { + $rule = 'any-latin'; + $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule); + } + + if (null === $transliterator) { + throw new InvalidArgumentException(sprintf('Unknown transliteration rule "%s".', $rule)); + } + + self::$transliterators['any-latin/bgn'] = $transliterator; + } + + $s = $transliterator->transliterate($s); + } + } elseif (!\function_exists('iconv')) { + $s = preg_replace('/[^\x00-\x7F]/u', '?', $s); + } else { + $s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) { + $c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]); + + if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) { + throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); + } + + return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?'); + }, $s); + } + } + + $str->string .= $s; + + return $str; + } + + public function camel(): static + { + $str = clone $this; + $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) use (&$i) { + return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); + }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); + + return $str; + } + + /** + * @return int[] + */ + public function codePointsAt(int $offset): array + { + $str = $this->slice($offset, 1); + + if ('' === $str->string) { + return []; + } + + $codePoints = []; + + foreach (preg_split('//u', $str->string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { + $codePoints[] = mb_ord($c, 'UTF-8'); + } + + return $codePoints; + } + + public function folded(bool $compat = true): static + { + $str = clone $this; + + if (!$compat || !\defined('Normalizer::NFKC_CF')) { + $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); + $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8'); + } else { + $str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF); + } + + return $str; + } + + public function join(array $strings, string $lastGlue = null): static + { + $str = clone $this; + + $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; + $str->string = implode($this->string, $strings).$tail; + + if (!preg_match('//u', $str->string)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + return $str; + } + + public function lower(): static + { + $str = clone $this; + $str->string = mb_strtolower(str_replace('İ', 'i̇', $str->string), 'UTF-8'); + + return $str; + } + + public function match(string $regexp, int $flags = 0, int $offset = 0): array + { + $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; + + if ($this->ignoreCase) { + $regexp .= 'i'; + } + + set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + + try { + if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { + $lastError = preg_last_error(); + + foreach (get_defined_constants(true)['pcre'] as $k => $v) { + if ($lastError === $v && '_ERROR' === substr($k, -6)) { + throw new RuntimeException('Matching failed with '.$k.'.'); + } + } + + throw new RuntimeException('Matching failed with unknown error code.'); + } + } finally { + restore_error_handler(); + } + + return $matches; + } + + public function normalize(int $form = self::NFC): static + { + if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD])) { + throw new InvalidArgumentException('Unsupported normalization form.'); + } + + $str = clone $this; + normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); + + return $str; + } + + public function padBoth(int $length, string $padStr = ' '): static + { + if ('' === $padStr || !preg_match('//u', $padStr)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + $pad = clone $this; + $pad->string = $padStr; + + return $this->pad($length, $pad, \STR_PAD_BOTH); + } + + public function padEnd(int $length, string $padStr = ' '): static + { + if ('' === $padStr || !preg_match('//u', $padStr)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + $pad = clone $this; + $pad->string = $padStr; + + return $this->pad($length, $pad, \STR_PAD_RIGHT); + } + + public function padStart(int $length, string $padStr = ' '): static + { + if ('' === $padStr || !preg_match('//u', $padStr)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + $pad = clone $this; + $pad->string = $padStr; + + return $this->pad($length, $pad, \STR_PAD_LEFT); + } + + public function replaceMatches(string $fromRegexp, string|callable $to): static + { + if ($this->ignoreCase) { + $fromRegexp .= 'i'; + } + + if (\is_array($to) || $to instanceof \Closure) { + $replace = 'preg_replace_callback'; + $to = static function (array $m) use ($to): string { + $to = $to($m); + + if ('' !== $to && (!\is_string($to) || !preg_match('//u', $to))) { + throw new InvalidArgumentException('Replace callback must return a valid UTF-8 string.'); + } + + return $to; + }; + } elseif ('' !== $to && !preg_match('//u', $to)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } else { + $replace = 'preg_replace'; + } + + set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + + try { + if (null === $string = $replace($fromRegexp.'u', $to, $this->string)) { + $lastError = preg_last_error(); + + foreach (get_defined_constants(true)['pcre'] as $k => $v) { + if ($lastError === $v && '_ERROR' === substr($k, -6)) { + throw new RuntimeException('Matching failed with '.$k.'.'); + } + } + + throw new RuntimeException('Matching failed with unknown error code.'); + } + } finally { + restore_error_handler(); + } + + $str = clone $this; + $str->string = $string; + + return $str; + } + + public function reverse(): static + { + $str = clone $this; + $str->string = implode('', array_reverse(preg_split('/(\X)/u', $str->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY))); + + return $str; + } + + public function snake(): static + { + $str = $this->camel(); + $str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8'); + + return $str; + } + + public function title(bool $allWords = false): static + { + $str = clone $this; + + $limit = $allWords ? -1 : 1; + + $str->string = preg_replace_callback('/\b./u', static function (array $m): string { + return mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); + }, $str->string, $limit); + + return $str; + } + + public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static + { + if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { + throw new InvalidArgumentException('Invalid UTF-8 chars.'); + } + $chars = preg_quote($chars); + + $str = clone $this; + $str->string = preg_replace("{^[$chars]++|[$chars]++$}uD", '', $str->string); + + return $str; + } + + public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static + { + if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { + throw new InvalidArgumentException('Invalid UTF-8 chars.'); + } + $chars = preg_quote($chars); + + $str = clone $this; + $str->string = preg_replace("{[$chars]++$}uD", '', $str->string); + + return $str; + } + + public function trimPrefix($prefix): static + { + if (!$this->ignoreCase) { + return parent::trimPrefix($prefix); + } + + $str = clone $this; + + if ($prefix instanceof \Traversable) { + $prefix = iterator_to_array($prefix, false); + } elseif ($prefix instanceof parent) { + $prefix = $prefix->string; + } + + $prefix = implode('|', array_map('preg_quote', (array) $prefix)); + $str->string = preg_replace("{^(?:$prefix)}iuD", '', $this->string); + + return $str; + } + + public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static + { + if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { + throw new InvalidArgumentException('Invalid UTF-8 chars.'); + } + $chars = preg_quote($chars); + + $str = clone $this; + $str->string = preg_replace("{^[$chars]++}uD", '', $str->string); + + return $str; + } + + public function trimSuffix($suffix): static + { + if (!$this->ignoreCase) { + return parent::trimSuffix($suffix); + } + + $str = clone $this; + + if ($suffix instanceof \Traversable) { + $suffix = iterator_to_array($suffix, false); + } elseif ($suffix instanceof parent) { + $suffix = $suffix->string; + } + + $suffix = implode('|', array_map('preg_quote', (array) $suffix)); + $str->string = preg_replace("{(?:$suffix)$}iuD", '', $this->string); + + return $str; + } + + public function upper(): static + { + $str = clone $this; + $str->string = mb_strtoupper($str->string, 'UTF-8'); + + return $str; + } + + public function width(bool $ignoreAnsiDecoration = true): int + { + $width = 0; + $s = str_replace(["\x00", "\x05", "\x07"], '', $this->string); + + if (false !== strpos($s, "\r")) { + $s = str_replace(["\r\n", "\r"], "\n", $s); + } + + if (!$ignoreAnsiDecoration) { + $s = preg_replace('/[\p{Cc}\x7F]++/u', '', $s); + } + + foreach (explode("\n", $s) as $s) { + if ($ignoreAnsiDecoration) { + $s = preg_replace('/(?:\x1B(?: + \[ [\x30-\x3F]*+ [\x20-\x2F]*+ [\x40-\x7E] + | [P\]X^_] .*? \x1B\\\\ + | [\x41-\x7E] + )|[\p{Cc}\x7F]++)/xu', '', $s); + } + + $lineWidth = $this->wcswidth($s); + + if ($lineWidth > $width) { + $width = $lineWidth; + } + } + + return $width; + } + + private function pad(int $len, self $pad, int $type): static + { + $sLen = $this->length(); + + if ($len <= $sLen) { + return clone $this; + } + + $padLen = $pad->length(); + $freeLen = $len - $sLen; + $len = $freeLen % $padLen; + + switch ($type) { + case \STR_PAD_RIGHT: + return $this->append(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); + + case \STR_PAD_LEFT: + return $this->prepend(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); + + case \STR_PAD_BOTH: + $freeLen /= 2; + + $rightLen = ceil($freeLen); + $len = $rightLen % $padLen; + $str = $this->append(str_repeat($pad->string, intdiv($rightLen, $padLen)).($len ? $pad->slice(0, $len) : '')); + + $leftLen = floor($freeLen); + $len = $leftLen % $padLen; + + return $str->prepend(str_repeat($pad->string, intdiv($leftLen, $padLen)).($len ? $pad->slice(0, $len) : '')); + + default: + throw new InvalidArgumentException('Invalid padding type.'); + } + } + + /** + * Based on https://github.com/jquast/wcwidth, a Python implementation of https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c. + */ + private function wcswidth(string $string): int + { + $width = 0; + + foreach (preg_split('//u', $string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { + $codePoint = mb_ord($c, 'UTF-8'); + + if (0 === $codePoint // NULL + || 0x034F === $codePoint // COMBINING GRAPHEME JOINER + || (0x200B <= $codePoint && 0x200F >= $codePoint) // ZERO WIDTH SPACE to RIGHT-TO-LEFT MARK + || 0x2028 === $codePoint // LINE SEPARATOR + || 0x2029 === $codePoint // PARAGRAPH SEPARATOR + || (0x202A <= $codePoint && 0x202E >= $codePoint) // LEFT-TO-RIGHT EMBEDDING to RIGHT-TO-LEFT OVERRIDE + || (0x2060 <= $codePoint && 0x2063 >= $codePoint) // WORD JOINER to INVISIBLE SEPARATOR + ) { + continue; + } + + // Non printable characters + if (32 > $codePoint // C0 control characters + || (0x07F <= $codePoint && 0x0A0 > $codePoint) // C1 control characters and DEL + ) { + return -1; + } + + if (null === self::$tableZero) { + self::$tableZero = require __DIR__.'/Resources/data/wcswidth_table_zero.php'; + } + + if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) { + $lbound = 0; + while ($ubound >= $lbound) { + $mid = floor(($lbound + $ubound) / 2); + + if ($codePoint > self::$tableZero[$mid][1]) { + $lbound = $mid + 1; + } elseif ($codePoint < self::$tableZero[$mid][0]) { + $ubound = $mid - 1; + } else { + continue 2; + } + } + } + + if (null === self::$tableWide) { + self::$tableWide = require __DIR__.'/Resources/data/wcswidth_table_wide.php'; + } + + if ($codePoint >= self::$tableWide[0][0] && $codePoint <= self::$tableWide[$ubound = \count(self::$tableWide) - 1][1]) { + $lbound = 0; + while ($ubound >= $lbound) { + $mid = floor(($lbound + $ubound) / 2); + + if ($codePoint > self::$tableWide[$mid][1]) { + $lbound = $mid + 1; + } elseif ($codePoint < self::$tableWide[$mid][0]) { + $ubound = $mid - 1; + } else { + $width += 2; + + continue 2; + } + } + } + + ++$width; + } + + return $width; + } +} diff --git a/trunk/vendor/symfony/string/ByteString.php b/trunk/vendor/symfony/string/ByteString.php new file mode 100644 index 00000000..639d6435 --- /dev/null +++ b/trunk/vendor/symfony/string/ByteString.php @@ -0,0 +1,493 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String; + +use Symfony\Component\String\Exception\ExceptionInterface; +use Symfony\Component\String\Exception\InvalidArgumentException; +use Symfony\Component\String\Exception\RuntimeException; + +/** + * Represents a binary-safe string of bytes. + * + * @author Nicolas Grekas + * @author Hugo Hamon + * + * @throws ExceptionInterface + */ +class ByteString extends AbstractString +{ + private const ALPHABET_ALPHANUMERIC = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; + + public function __construct(string $string = '') + { + $this->string = $string; + } + + /* + * The following method was derived from code of the Hack Standard Library (v4.40 - 2020-05-03) + * + * https://github.com/hhvm/hsl/blob/80a42c02f036f72a42f0415e80d6b847f4bf62d5/src/random/private.php#L16 + * + * Code subject to the MIT license (https://github.com/hhvm/hsl/blob/master/LICENSE). + * + * Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/) + */ + + public static function fromRandom(int $length = 16, string $alphabet = null): self + { + if ($length <= 0) { + throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length)); + } + + $alphabet = $alphabet ?? self::ALPHABET_ALPHANUMERIC; + $alphabetSize = \strlen($alphabet); + $bits = (int) ceil(log($alphabetSize, 2.0)); + if ($bits <= 0 || $bits > 56) { + throw new InvalidArgumentException('The length of the alphabet must in the [2^1, 2^56] range.'); + } + + $ret = ''; + while ($length > 0) { + $urandomLength = (int) ceil(2 * $length * $bits / 8.0); + $data = random_bytes($urandomLength); + $unpackedData = 0; + $unpackedBits = 0; + for ($i = 0; $i < $urandomLength && $length > 0; ++$i) { + // Unpack 8 bits + $unpackedData = ($unpackedData << 8) | \ord($data[$i]); + $unpackedBits += 8; + + // While we have enough bits to select a character from the alphabet, keep + // consuming the random data + for (; $unpackedBits >= $bits && $length > 0; $unpackedBits -= $bits) { + $index = ($unpackedData & ((1 << $bits) - 1)); + $unpackedData >>= $bits; + // Unfortunately, the alphabet size is not necessarily a power of two. + // Worst case, it is 2^k + 1, which means we need (k+1) bits and we + // have around a 50% chance of missing as k gets larger + if ($index < $alphabetSize) { + $ret .= $alphabet[$index]; + --$length; + } + } + } + } + + return new static($ret); + } + + public function bytesAt(int $offset): array + { + $str = $this->string[$offset] ?? ''; + + return '' === $str ? [] : [\ord($str)]; + } + + public function append(string ...$suffix): static + { + $str = clone $this; + $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); + + return $str; + } + + public function camel(): static + { + $str = clone $this; + + $parts = explode(' ', trim(ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); + $parts[0] = 1 !== \strlen($parts[0]) && ctype_upper($parts[0]) ? $parts[0] : lcfirst($parts[0]); + $str->string = implode('', $parts); + + return $str; + } + + public function chunk(int $length = 1): array + { + if (1 > $length) { + throw new InvalidArgumentException('The chunk length must be greater than zero.'); + } + + if ('' === $this->string) { + return []; + } + + $str = clone $this; + $chunks = []; + + foreach (str_split($this->string, $length) as $chunk) { + $str->string = $chunk; + $chunks[] = clone $str; + } + + return $chunks; + } + + public function endsWith(string|iterable|AbstractString $suffix): bool + { + if ($suffix instanceof AbstractString) { + $suffix = $suffix->string; + } elseif (!\is_string($suffix)) { + return parent::endsWith($suffix); + } + + return '' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase); + } + + public function equalsTo(string|iterable|AbstractString $string): bool + { + if ($string instanceof AbstractString) { + $string = $string->string; + } elseif (!\is_string($string)) { + return parent::equalsTo($string); + } + + if ('' !== $string && $this->ignoreCase) { + return 0 === strcasecmp($string, $this->string); + } + + return $string === $this->string; + } + + public function folded(): static + { + $str = clone $this; + $str->string = strtolower($str->string); + + return $str; + } + + public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int + { + if ($needle instanceof AbstractString) { + $needle = $needle->string; + } elseif (!\is_string($needle)) { + return parent::indexOf($needle, $offset); + } + + if ('' === $needle) { + return null; + } + + $i = $this->ignoreCase ? stripos($this->string, $needle, $offset) : strpos($this->string, $needle, $offset); + + return false === $i ? null : $i; + } + + public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int + { + if ($needle instanceof AbstractString) { + $needle = $needle->string; + } elseif (!\is_string($needle)) { + return parent::indexOfLast($needle, $offset); + } + + if ('' === $needle) { + return null; + } + + $i = $this->ignoreCase ? strripos($this->string, $needle, $offset) : strrpos($this->string, $needle, $offset); + + return false === $i ? null : $i; + } + + public function isUtf8(): bool + { + return '' === $this->string || preg_match('//u', $this->string); + } + + public function join(array $strings, string $lastGlue = null): static + { + $str = clone $this; + + $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; + $str->string = implode($this->string, $strings).$tail; + + return $str; + } + + public function length(): int + { + return \strlen($this->string); + } + + public function lower(): static + { + $str = clone $this; + $str->string = strtolower($str->string); + + return $str; + } + + public function match(string $regexp, int $flags = 0, int $offset = 0): array + { + $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; + + if ($this->ignoreCase) { + $regexp .= 'i'; + } + + set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + + try { + if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { + $lastError = preg_last_error(); + + foreach (get_defined_constants(true)['pcre'] as $k => $v) { + if ($lastError === $v && '_ERROR' === substr($k, -6)) { + throw new RuntimeException('Matching failed with '.$k.'.'); + } + } + + throw new RuntimeException('Matching failed with unknown error code.'); + } + } finally { + restore_error_handler(); + } + + return $matches; + } + + public function padBoth(int $length, string $padStr = ' '): static + { + $str = clone $this; + $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_BOTH); + + return $str; + } + + public function padEnd(int $length, string $padStr = ' '): static + { + $str = clone $this; + $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_RIGHT); + + return $str; + } + + public function padStart(int $length, string $padStr = ' '): static + { + $str = clone $this; + $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_LEFT); + + return $str; + } + + public function prepend(string ...$prefix): static + { + $str = clone $this; + $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$str->string; + + return $str; + } + + public function replace(string $from, string $to): static + { + $str = clone $this; + + if ('' !== $from) { + $str->string = $this->ignoreCase ? str_ireplace($from, $to, $this->string) : str_replace($from, $to, $this->string); + } + + return $str; + } + + public function replaceMatches(string $fromRegexp, string|callable $to): static + { + if ($this->ignoreCase) { + $fromRegexp .= 'i'; + } + + $replace = \is_array($to) || $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; + + set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + + try { + if (null === $string = $replace($fromRegexp, $to, $this->string)) { + $lastError = preg_last_error(); + + foreach (get_defined_constants(true)['pcre'] as $k => $v) { + if ($lastError === $v && '_ERROR' === substr($k, -6)) { + throw new RuntimeException('Matching failed with '.$k.'.'); + } + } + + throw new RuntimeException('Matching failed with unknown error code.'); + } + } finally { + restore_error_handler(); + } + + $str = clone $this; + $str->string = $string; + + return $str; + } + + public function reverse(): static + { + $str = clone $this; + $str->string = strrev($str->string); + + return $str; + } + + public function slice(int $start = 0, int $length = null): static + { + $str = clone $this; + $str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX); + + return $str; + } + + public function snake(): static + { + $str = $this->camel(); + $str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string)); + + return $str; + } + + public function splice(string $replacement, int $start = 0, int $length = null): static + { + $str = clone $this; + $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); + + return $str; + } + + public function split(string $delimiter, int $limit = null, int $flags = null): array + { + if (1 > $limit = $limit ?? \PHP_INT_MAX) { + throw new InvalidArgumentException('Split limit must be a positive integer.'); + } + + if ('' === $delimiter) { + throw new InvalidArgumentException('Split delimiter is empty.'); + } + + if (null !== $flags) { + return parent::split($delimiter, $limit, $flags); + } + + $str = clone $this; + $chunks = $this->ignoreCase + ? preg_split('{'.preg_quote($delimiter).'}iD', $this->string, $limit) + : explode($delimiter, $this->string, $limit); + + foreach ($chunks as &$chunk) { + $str->string = $chunk; + $chunk = clone $str; + } + + return $chunks; + } + + public function startsWith(string|iterable|AbstractString $prefix): bool + { + if ($prefix instanceof AbstractString) { + $prefix = $prefix->string; + } elseif (!\is_string($prefix)) { + return parent::startsWith($prefix); + } + + return '' !== $prefix && 0 === ($this->ignoreCase ? strncasecmp($this->string, $prefix, \strlen($prefix)) : strncmp($this->string, $prefix, \strlen($prefix))); + } + + public function title(bool $allWords = false): static + { + $str = clone $this; + $str->string = $allWords ? ucwords($str->string) : ucfirst($str->string); + + return $str; + } + + public function toUnicodeString(string $fromEncoding = null): UnicodeString + { + return new UnicodeString($this->toCodePointString($fromEncoding)->string); + } + + public function toCodePointString(string $fromEncoding = null): CodePointString + { + $u = new CodePointString(); + + if (\in_array($fromEncoding, [null, 'utf8', 'utf-8', 'UTF8', 'UTF-8'], true) && preg_match('//u', $this->string)) { + $u->string = $this->string; + + return $u; + } + + set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + + try { + try { + $validEncoding = false !== mb_detect_encoding($this->string, $fromEncoding ?? 'Windows-1252', true); + } catch (InvalidArgumentException $e) { + if (!\function_exists('iconv')) { + throw $e; + } + + $u->string = iconv($fromEncoding ?? 'Windows-1252', 'UTF-8', $this->string); + + return $u; + } + } finally { + restore_error_handler(); + } + + if (!$validEncoding) { + throw new InvalidArgumentException(sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); + } + + $u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252'); + + return $u; + } + + public function trim(string $chars = " \t\n\r\0\x0B\x0C"): static + { + $str = clone $this; + $str->string = trim($str->string, $chars); + + return $str; + } + + public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C"): static + { + $str = clone $this; + $str->string = rtrim($str->string, $chars); + + return $str; + } + + public function trimStart(string $chars = " \t\n\r\0\x0B\x0C"): static + { + $str = clone $this; + $str->string = ltrim($str->string, $chars); + + return $str; + } + + public function upper(): static + { + $str = clone $this; + $str->string = strtoupper($str->string); + + return $str; + } + + public function width(bool $ignoreAnsiDecoration = true): int + { + $string = preg_match('//u', $this->string) ? $this->string : preg_replace('/[\x80-\xFF]/', '?', $this->string); + + return (new CodePointString($string))->width($ignoreAnsiDecoration); + } +} diff --git a/trunk/vendor/symfony/string/CHANGELOG.md b/trunk/vendor/symfony/string/CHANGELOG.md new file mode 100644 index 00000000..53af3640 --- /dev/null +++ b/trunk/vendor/symfony/string/CHANGELOG.md @@ -0,0 +1,35 @@ +CHANGELOG +========= + +5.4 +--- + + * Add `trimSuffix()` and `trimPrefix()` methods + +5.3 +--- + + * Made `AsciiSlugger` fallback to parent locale's symbolsMap + +5.2.0 +----- + + * added a `FrenchInflector` class + +5.1.0 +----- + + * added the `AbstractString::reverse()` method + * made `AbstractString::width()` follow POSIX.1-2001 + * added `LazyString` which provides memoizing stringable objects + * The component is not marked as `@experimental` anymore + * added the `s()` helper method to get either an `UnicodeString` or `ByteString` instance, + depending of the input string UTF-8 compliancy + * added `$cut` parameter to `Symfony\Component\String\AbstractString::truncate()` + * added `AbstractString::containsAny()` + * allow passing a string of custom characters to `ByteString::fromRandom()` + +5.0.0 +----- + + * added the component as experimental diff --git a/trunk/vendor/symfony/string/CodePointString.php b/trunk/vendor/symfony/string/CodePointString.php new file mode 100644 index 00000000..926ff798 --- /dev/null +++ b/trunk/vendor/symfony/string/CodePointString.php @@ -0,0 +1,260 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String; + +use Symfony\Component\String\Exception\ExceptionInterface; +use Symfony\Component\String\Exception\InvalidArgumentException; + +/** + * Represents a string of Unicode code points encoded as UTF-8. + * + * @author Nicolas Grekas + * @author Hugo Hamon + * + * @throws ExceptionInterface + */ +class CodePointString extends AbstractUnicodeString +{ + public function __construct(string $string = '') + { + if ('' !== $string && !preg_match('//u', $string)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + $this->string = $string; + } + + public function append(string ...$suffix): static + { + $str = clone $this; + $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); + + if (!preg_match('//u', $str->string)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + return $str; + } + + public function chunk(int $length = 1): array + { + if (1 > $length) { + throw new InvalidArgumentException('The chunk length must be greater than zero.'); + } + + if ('' === $this->string) { + return []; + } + + $rx = '/('; + while (65535 < $length) { + $rx .= '.{65535}'; + $length -= 65535; + } + $rx .= '.{'.$length.'})/us'; + + $str = clone $this; + $chunks = []; + + foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { + $str->string = $chunk; + $chunks[] = clone $str; + } + + return $chunks; + } + + public function codePointsAt(int $offset): array + { + $str = $offset ? $this->slice($offset, 1) : $this; + + return '' === $str->string ? [] : [mb_ord($str->string, 'UTF-8')]; + } + + public function endsWith(string|iterable|AbstractString $suffix): bool + { + if ($suffix instanceof AbstractString) { + $suffix = $suffix->string; + } elseif (!\is_string($suffix)) { + return parent::endsWith($suffix); + } + + if ('' === $suffix || !preg_match('//u', $suffix)) { + return false; + } + + if ($this->ignoreCase) { + return preg_match('{'.preg_quote($suffix).'$}iuD', $this->string); + } + + return \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix)); + } + + public function equalsTo(string|iterable|AbstractString $string): bool + { + if ($string instanceof AbstractString) { + $string = $string->string; + } elseif (!\is_string($string)) { + return parent::equalsTo($string); + } + + if ('' !== $string && $this->ignoreCase) { + return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); + } + + return $string === $this->string; + } + + public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int + { + if ($needle instanceof AbstractString) { + $needle = $needle->string; + } elseif (!\is_string($needle)) { + return parent::indexOf($needle, $offset); + } + + if ('' === $needle) { + return null; + } + + $i = $this->ignoreCase ? mb_stripos($this->string, $needle, $offset, 'UTF-8') : mb_strpos($this->string, $needle, $offset, 'UTF-8'); + + return false === $i ? null : $i; + } + + public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int + { + if ($needle instanceof AbstractString) { + $needle = $needle->string; + } elseif (!\is_string($needle)) { + return parent::indexOfLast($needle, $offset); + } + + if ('' === $needle) { + return null; + } + + $i = $this->ignoreCase ? mb_strripos($this->string, $needle, $offset, 'UTF-8') : mb_strrpos($this->string, $needle, $offset, 'UTF-8'); + + return false === $i ? null : $i; + } + + public function length(): int + { + return mb_strlen($this->string, 'UTF-8'); + } + + public function prepend(string ...$prefix): static + { + $str = clone $this; + $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; + + if (!preg_match('//u', $str->string)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + return $str; + } + + public function replace(string $from, string $to): static + { + $str = clone $this; + + if ('' === $from || !preg_match('//u', $from)) { + return $str; + } + + if ('' !== $to && !preg_match('//u', $to)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + if ($this->ignoreCase) { + $str->string = implode($to, preg_split('{'.preg_quote($from).'}iuD', $this->string)); + } else { + $str->string = str_replace($from, $to, $this->string); + } + + return $str; + } + + public function slice(int $start = 0, int $length = null): static + { + $str = clone $this; + $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); + + return $str; + } + + public function splice(string $replacement, int $start = 0, int $length = null): static + { + if (!preg_match('//u', $replacement)) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + $str = clone $this; + $start = $start ? \strlen(mb_substr($this->string, 0, $start, 'UTF-8')) : 0; + $length = $length ? \strlen(mb_substr($this->string, $start, $length, 'UTF-8')) : $length; + $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); + + return $str; + } + + public function split(string $delimiter, int $limit = null, int $flags = null): array + { + if (1 > $limit = $limit ?? \PHP_INT_MAX) { + throw new InvalidArgumentException('Split limit must be a positive integer.'); + } + + if ('' === $delimiter) { + throw new InvalidArgumentException('Split delimiter is empty.'); + } + + if (null !== $flags) { + return parent::split($delimiter.'u', $limit, $flags); + } + + if (!preg_match('//u', $delimiter)) { + throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); + } + + $str = clone $this; + $chunks = $this->ignoreCase + ? preg_split('{'.preg_quote($delimiter).'}iuD', $this->string, $limit) + : explode($delimiter, $this->string, $limit); + + foreach ($chunks as &$chunk) { + $str->string = $chunk; + $chunk = clone $str; + } + + return $chunks; + } + + public function startsWith(string|iterable|AbstractString $prefix): bool + { + if ($prefix instanceof AbstractString) { + $prefix = $prefix->string; + } elseif (!\is_string($prefix)) { + return parent::startsWith($prefix); + } + + if ('' === $prefix || !preg_match('//u', $prefix)) { + return false; + } + + if ($this->ignoreCase) { + return 0 === mb_stripos($this->string, $prefix, 0, 'UTF-8'); + } + + return 0 === strncmp($this->string, $prefix, \strlen($prefix)); + } +} diff --git a/trunk/vendor/symfony/string/Exception/ExceptionInterface.php b/trunk/vendor/symfony/string/Exception/ExceptionInterface.php new file mode 100644 index 00000000..36197865 --- /dev/null +++ b/trunk/vendor/symfony/string/Exception/ExceptionInterface.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String\Exception; + +interface ExceptionInterface extends \Throwable +{ +} diff --git a/trunk/vendor/symfony/string/Exception/InvalidArgumentException.php b/trunk/vendor/symfony/string/Exception/InvalidArgumentException.php new file mode 100644 index 00000000..6aa586bc --- /dev/null +++ b/trunk/vendor/symfony/string/Exception/InvalidArgumentException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String\Exception; + +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/trunk/vendor/symfony/string/Exception/RuntimeException.php b/trunk/vendor/symfony/string/Exception/RuntimeException.php new file mode 100644 index 00000000..77cb091f --- /dev/null +++ b/trunk/vendor/symfony/string/Exception/RuntimeException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String\Exception; + +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/trunk/vendor/symfony/string/Inflector/EnglishInflector.php b/trunk/vendor/symfony/string/Inflector/EnglishInflector.php new file mode 100644 index 00000000..9f2fac67 --- /dev/null +++ b/trunk/vendor/symfony/string/Inflector/EnglishInflector.php @@ -0,0 +1,511 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String\Inflector; + +final class EnglishInflector implements InflectorInterface +{ + /** + * Map English plural to singular suffixes. + * + * @see http://english-zone.com/spelling/plurals.html + */ + private const PLURAL_MAP = [ + // First entry: plural suffix, reversed + // Second entry: length of plural suffix + // Third entry: Whether the suffix may succeed a vocal + // Fourth entry: Whether the suffix may succeed a consonant + // Fifth entry: singular suffix, normal + + // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) + ['a', 1, true, true, ['on', 'um']], + + // nebulae (nebula) + ['ea', 2, true, true, 'a'], + + // services (service) + ['secivres', 8, true, true, 'service'], + + // mice (mouse), lice (louse) + ['eci', 3, false, true, 'ouse'], + + // geese (goose) + ['esee', 4, false, true, 'oose'], + + // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) + ['i', 1, true, true, 'us'], + + // men (man), women (woman) + ['nem', 3, true, true, 'man'], + + // children (child) + ['nerdlihc', 8, true, true, 'child'], + + // oxen (ox) + ['nexo', 4, false, false, 'ox'], + + // indices (index), appendices (appendix), prices (price) + ['seci', 4, false, true, ['ex', 'ix', 'ice']], + + // selfies (selfie) + ['seifles', 7, true, true, 'selfie'], + + // zombies (zombie) + ['seibmoz', 7, true, true, 'zombie'], + + // movies (movie) + ['seivom', 6, true, true, 'movie'], + + // conspectuses (conspectus), prospectuses (prospectus) + ['sesutcep', 8, true, true, 'pectus'], + + // feet (foot) + ['teef', 4, true, true, 'foot'], + + // geese (goose) + ['eseeg', 5, true, true, 'goose'], + + // teeth (tooth) + ['hteet', 5, true, true, 'tooth'], + + // news (news) + ['swen', 4, true, true, 'news'], + + // series (series) + ['seires', 6, true, true, 'series'], + + // babies (baby) + ['sei', 3, false, true, 'y'], + + // accesses (access), addresses (address), kisses (kiss) + ['sess', 4, true, false, 'ss'], + + // analyses (analysis), ellipses (ellipsis), fungi (fungus), + // neuroses (neurosis), theses (thesis), emphases (emphasis), + // oases (oasis), crises (crisis), houses (house), bases (base), + // atlases (atlas) + ['ses', 3, true, true, ['s', 'se', 'sis']], + + // objectives (objective), alternative (alternatives) + ['sevit', 5, true, true, 'tive'], + + // drives (drive) + ['sevird', 6, false, true, 'drive'], + + // lives (life), wives (wife) + ['sevi', 4, false, true, 'ife'], + + // moves (move) + ['sevom', 5, true, true, 'move'], + + // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf), caves (cave), staves (staff) + ['sev', 3, true, true, ['f', 've', 'ff']], + + // axes (axis), axes (ax), axes (axe) + ['sexa', 4, false, false, ['ax', 'axe', 'axis']], + + // indexes (index), matrixes (matrix) + ['sex', 3, true, false, 'x'], + + // quizzes (quiz) + ['sezz', 4, true, false, 'z'], + + // bureaus (bureau) + ['suae', 4, false, true, 'eau'], + + // fees (fee), trees (tree), employees (employee) + ['see', 3, true, true, 'ee'], + + // edges (edge) + ['segd', 4, true, true, 'dge'], + + // roses (rose), garages (garage), cassettes (cassette), + // waltzes (waltz), heroes (hero), bushes (bush), arches (arch), + // shoes (shoe) + ['se', 2, true, true, ['', 'e']], + + // tags (tag) + ['s', 1, true, true, ''], + + // chateaux (chateau) + ['xuae', 4, false, true, 'eau'], + + // people (person) + ['elpoep', 6, true, true, 'person'], + ]; + + /** + * Map English singular to plural suffixes. + * + * @see http://english-zone.com/spelling/plurals.html + */ + private const SINGULAR_MAP = [ + // First entry: singular suffix, reversed + // Second entry: length of singular suffix + // Third entry: Whether the suffix may succeed a vocal + // Fourth entry: Whether the suffix may succeed a consonant + // Fifth entry: plural suffix, normal + + // criterion (criteria) + ['airetirc', 8, false, false, 'criterion'], + + // nebulae (nebula) + ['aluben', 6, false, false, 'nebulae'], + + // children (child) + ['dlihc', 5, true, true, 'children'], + + // prices (price) + ['eci', 3, false, true, 'ices'], + + // services (service) + ['ecivres', 7, true, true, 'services'], + + // lives (life), wives (wife) + ['efi', 3, false, true, 'ives'], + + // selfies (selfie) + ['eifles', 6, true, true, 'selfies'], + + // movies (movie) + ['eivom', 5, true, true, 'movies'], + + // lice (louse) + ['esuol', 5, false, true, 'lice'], + + // mice (mouse) + ['esuom', 5, false, true, 'mice'], + + // geese (goose) + ['esoo', 4, false, true, 'eese'], + + // houses (house), bases (base) + ['es', 2, true, true, 'ses'], + + // geese (goose) + ['esoog', 5, true, true, 'geese'], + + // caves (cave) + ['ev', 2, true, true, 'ves'], + + // drives (drive) + ['evird', 5, false, true, 'drives'], + + // objectives (objective), alternative (alternatives) + ['evit', 4, true, true, 'tives'], + + // moves (move) + ['evom', 4, true, true, 'moves'], + + // staves (staff) + ['ffats', 5, true, true, 'staves'], + + // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) + ['ff', 2, true, true, 'ffs'], + + // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) + ['f', 1, true, true, ['fs', 'ves']], + + // arches (arch) + ['hc', 2, true, true, 'ches'], + + // bushes (bush) + ['hs', 2, true, true, 'shes'], + + // teeth (tooth) + ['htoot', 5, true, true, 'teeth'], + + // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) + ['mu', 2, true, true, 'a'], + + // men (man), women (woman) + ['nam', 3, true, true, 'men'], + + // people (person) + ['nosrep', 6, true, true, ['persons', 'people']], + + // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) + ['noi', 3, true, true, 'ions'], + + // coupon (coupons) + ['nop', 3, true, true, 'pons'], + + // seasons (season), treasons (treason), poisons (poison), lessons (lesson) + ['nos', 3, true, true, 'sons'], + + // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) + ['no', 2, true, true, 'a'], + + // echoes (echo) + ['ohce', 4, true, true, 'echoes'], + + // heroes (hero) + ['oreh', 4, true, true, 'heroes'], + + // atlases (atlas) + ['salta', 5, true, true, 'atlases'], + + // irises (iris) + ['siri', 4, true, true, 'irises'], + + // analyses (analysis), ellipses (ellipsis), neuroses (neurosis) + // theses (thesis), emphases (emphasis), oases (oasis), + // crises (crisis) + ['sis', 3, true, true, 'ses'], + + // accesses (access), addresses (address), kisses (kiss) + ['ss', 2, true, false, 'sses'], + + // syllabi (syllabus) + ['suballys', 8, true, true, 'syllabi'], + + // buses (bus) + ['sub', 3, true, true, 'buses'], + + // circuses (circus) + ['suc', 3, true, true, 'cuses'], + + // conspectuses (conspectus), prospectuses (prospectus) + ['sutcep', 6, true, true, 'pectuses'], + + // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) + ['su', 2, true, true, 'i'], + + // news (news) + ['swen', 4, true, true, 'news'], + + // feet (foot) + ['toof', 4, true, true, 'feet'], + + // chateaux (chateau), bureaus (bureau) + ['uae', 3, false, true, ['eaus', 'eaux']], + + // oxen (ox) + ['xo', 2, false, false, 'oxen'], + + // hoaxes (hoax) + ['xaoh', 4, true, false, 'hoaxes'], + + // indices (index) + ['xedni', 5, false, true, ['indicies', 'indexes']], + + // boxes (box) + ['xo', 2, false, true, 'oxes'], + + // indexes (index), matrixes (matrix) + ['x', 1, true, false, ['cies', 'xes']], + + // appendices (appendix) + ['xi', 2, false, true, 'ices'], + + // babies (baby) + ['y', 1, false, true, 'ies'], + + // quizzes (quiz) + ['ziuq', 4, true, false, 'quizzes'], + + // waltzes (waltz) + ['z', 1, true, true, 'zes'], + ]; + + /** + * A list of words which should not be inflected, reversed. + */ + private const UNINFLECTED = [ + '', + + // data + 'atad', + + // deer + 'reed', + + // feedback + 'kcabdeef', + + // fish + 'hsif', + + // info + 'ofni', + + // moose + 'esoom', + + // series + 'seires', + + // sheep + 'peehs', + + // species + 'seiceps', + ]; + + /** + * {@inheritdoc} + */ + public function singularize(string $plural): array + { + $pluralRev = strrev($plural); + $lowerPluralRev = strtolower($pluralRev); + $pluralLength = \strlen($lowerPluralRev); + + // Check if the word is one which is not inflected, return early if so + if (\in_array($lowerPluralRev, self::UNINFLECTED, true)) { + return [$plural]; + } + + // The outer loop iterates over the entries of the plural table + // The inner loop $j iterates over the characters of the plural suffix + // in the plural table to compare them with the characters of the actual + // given plural suffix + foreach (self::PLURAL_MAP as $map) { + $suffix = $map[0]; + $suffixLength = $map[1]; + $j = 0; + + // Compare characters in the plural table and of the suffix of the + // given plural one by one + while ($suffix[$j] === $lowerPluralRev[$j]) { + // Let $j point to the next character + ++$j; + + // Successfully compared the last character + // Add an entry with the singular suffix to the singular array + if ($j === $suffixLength) { + // Is there any character preceding the suffix in the plural string? + if ($j < $pluralLength) { + $nextIsVocal = false !== strpos('aeiou', $lowerPluralRev[$j]); + + if (!$map[2] && $nextIsVocal) { + // suffix may not succeed a vocal but next char is one + break; + } + + if (!$map[3] && !$nextIsVocal) { + // suffix may not succeed a consonant but next char is one + break; + } + } + + $newBase = substr($plural, 0, $pluralLength - $suffixLength); + $newSuffix = $map[4]; + + // Check whether the first character in the plural suffix + // is uppercased. If yes, uppercase the first character in + // the singular suffix too + $firstUpper = ctype_upper($pluralRev[$j - 1]); + + if (\is_array($newSuffix)) { + $singulars = []; + + foreach ($newSuffix as $newSuffixEntry) { + $singulars[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); + } + + return $singulars; + } + + return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; + } + + // Suffix is longer than word + if ($j === $pluralLength) { + break; + } + } + } + + // Assume that plural and singular is identical + return [$plural]; + } + + /** + * {@inheritdoc} + */ + public function pluralize(string $singular): array + { + $singularRev = strrev($singular); + $lowerSingularRev = strtolower($singularRev); + $singularLength = \strlen($lowerSingularRev); + + // Check if the word is one which is not inflected, return early if so + if (\in_array($lowerSingularRev, self::UNINFLECTED, true)) { + return [$singular]; + } + + // The outer loop iterates over the entries of the singular table + // The inner loop $j iterates over the characters of the singular suffix + // in the singular table to compare them with the characters of the actual + // given singular suffix + foreach (self::SINGULAR_MAP as $map) { + $suffix = $map[0]; + $suffixLength = $map[1]; + $j = 0; + + // Compare characters in the singular table and of the suffix of the + // given plural one by one + + while ($suffix[$j] === $lowerSingularRev[$j]) { + // Let $j point to the next character + ++$j; + + // Successfully compared the last character + // Add an entry with the plural suffix to the plural array + if ($j === $suffixLength) { + // Is there any character preceding the suffix in the plural string? + if ($j < $singularLength) { + $nextIsVocal = false !== strpos('aeiou', $lowerSingularRev[$j]); + + if (!$map[2] && $nextIsVocal) { + // suffix may not succeed a vocal but next char is one + break; + } + + if (!$map[3] && !$nextIsVocal) { + // suffix may not succeed a consonant but next char is one + break; + } + } + + $newBase = substr($singular, 0, $singularLength - $suffixLength); + $newSuffix = $map[4]; + + // Check whether the first character in the singular suffix + // is uppercased. If yes, uppercase the first character in + // the singular suffix too + $firstUpper = ctype_upper($singularRev[$j - 1]); + + if (\is_array($newSuffix)) { + $plurals = []; + + foreach ($newSuffix as $newSuffixEntry) { + $plurals[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); + } + + return $plurals; + } + + return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; + } + + // Suffix is longer than word + if ($j === $singularLength) { + break; + } + } + } + + // Assume that plural is singular with a trailing `s` + return [$singular.'s']; + } +} diff --git a/trunk/vendor/symfony/string/Inflector/FrenchInflector.php b/trunk/vendor/symfony/string/Inflector/FrenchInflector.php new file mode 100644 index 00000000..612c8f2e --- /dev/null +++ b/trunk/vendor/symfony/string/Inflector/FrenchInflector.php @@ -0,0 +1,157 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String\Inflector; + +/** + * French inflector. + * + * This class does only inflect nouns; not adjectives nor composed words like "soixante-dix". + */ +final class FrenchInflector implements InflectorInterface +{ + /** + * A list of all rules for pluralise. + * + * @see https://la-conjugaison.nouvelobs.com/regles/grammaire/le-pluriel-des-noms-121.php + */ + private const PLURALIZE_REGEXP = [ + // First entry: regexp + // Second entry: replacement + + // Words finishing with "s", "x" or "z" are invariables + // Les mots finissant par "s", "x" ou "z" sont invariables + ['/(s|x|z)$/i', '\1'], + + // Words finishing with "eau" are pluralized with a "x" + // Les mots finissant par "eau" prennent tous un "x" au pluriel + ['/(eau)$/i', '\1x'], + + // Words finishing with "au" are pluralized with a "x" excepted "landau" + // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" + ['/^(landau)$/i', '\1s'], + ['/(au)$/i', '\1x'], + + // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" + // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" + ['/^(pneu|bleu|émeu)$/i', '\1s'], + ['/(eu)$/i', '\1x'], + + // Words finishing with "al" are pluralized with a "aux" excepted + // Les mots finissant en "al" se terminent en "aux" sauf + ['/^(bal|carnaval|caracal|chacal|choral|corral|étal|festival|récital|val)$/i', '\1s'], + ['/al$/i', '\1aux'], + + // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux + ['/^(aspir|b|cor|ém|ferm|soupir|trav|vant|vitr)ail$/i', '\1aux'], + + // Bijou, caillou, chou, genou, hibou, joujou et pou qui prennent un x au pluriel + ['/^(bij|caill|ch|gen|hib|jouj|p)ou$/i', '\1oux'], + + // Invariable words + ['/^(cinquante|soixante|mille)$/i', '\1'], + + // French titles + ['/^(mon|ma)(sieur|dame|demoiselle|seigneur)$/', 'mes\2s'], + ['/^(Mon|Ma)(sieur|dame|demoiselle|seigneur)$/', 'Mes\2s'], + ]; + + /** + * A list of all rules for singularize. + */ + private const SINGULARIZE_REGEXP = [ + // First entry: regexp + // Second entry: replacement + + // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux + ['/((aspir|b|cor|ém|ferm|soupir|trav|vant|vitr))aux$/i', '\1ail'], + + // Words finishing with "eau" are pluralized with a "x" + // Les mots finissant par "eau" prennent tous un "x" au pluriel + ['/(eau)x$/i', '\1'], + + // Words finishing with "al" are pluralized with a "aux" expected + // Les mots finissant en "al" se terminent en "aux" sauf + ['/(amir|anim|arsen|boc|can|capit|capor|chev|crist|génér|hopit|hôpit|idé|journ|littor|loc|m|mét|minér|princip|radic|termin)aux$/i', '\1al'], + + // Words finishing with "au" are pluralized with a "x" excepted "landau" + // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" + ['/(au)x$/i', '\1'], + + // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" + // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" + ['/(eu)x$/i', '\1'], + + // Words finishing with "ou" are pluralized with a "s" excepted bijou, caillou, chou, genou, hibou, joujou, pou + // Les mots finissant par "ou" prennent un "s" sauf bijou, caillou, chou, genou, hibou, joujou, pou + ['/(bij|caill|ch|gen|hib|jouj|p)oux$/i', '\1ou'], + + // French titles + ['/^mes(dame|demoiselle)s$/', 'ma\1'], + ['/^Mes(dame|demoiselle)s$/', 'Ma\1'], + ['/^mes(sieur|seigneur)s$/', 'mon\1'], + ['/^Mes(sieur|seigneur)s$/', 'Mon\1'], + + // Default rule + ['/s$/i', ''], + ]; + + /** + * A list of words which should not be inflected. + * This list is only used by singularize. + */ + private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sans|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i'; + + /** + * {@inheritdoc} + */ + public function singularize(string $plural): array + { + if ($this->isInflectedWord($plural)) { + return [$plural]; + } + + foreach (self::SINGULARIZE_REGEXP as $rule) { + [$regexp, $replace] = $rule; + + if (1 === preg_match($regexp, $plural)) { + return [preg_replace($regexp, $replace, $plural)]; + } + } + + return [$plural]; + } + + /** + * {@inheritdoc} + */ + public function pluralize(string $singular): array + { + if ($this->isInflectedWord($singular)) { + return [$singular]; + } + + foreach (self::PLURALIZE_REGEXP as $rule) { + [$regexp, $replace] = $rule; + + if (1 === preg_match($regexp, $singular)) { + return [preg_replace($regexp, $replace, $singular)]; + } + } + + return [$singular.'s']; + } + + private function isInflectedWord(string $word): bool + { + return 1 === preg_match(self::UNINFLECTED, $word); + } +} diff --git a/trunk/vendor/symfony/string/Inflector/InflectorInterface.php b/trunk/vendor/symfony/string/Inflector/InflectorInterface.php new file mode 100644 index 00000000..67f28340 --- /dev/null +++ b/trunk/vendor/symfony/string/Inflector/InflectorInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String\Inflector; + +interface InflectorInterface +{ + /** + * Returns the singular forms of a string. + * + * If the method can't determine the form with certainty, several possible singulars are returned. + * + * @return string[] + */ + public function singularize(string $plural): array; + + /** + * Returns the plural forms of a string. + * + * If the method can't determine the form with certainty, several possible plurals are returned. + * + * @return string[] + */ + public function pluralize(string $singular): array; +} diff --git a/trunk/vendor/symfony/string/LICENSE b/trunk/vendor/symfony/string/LICENSE new file mode 100644 index 00000000..5c7ba055 --- /dev/null +++ b/trunk/vendor/symfony/string/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2019-2023 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/trunk/vendor/symfony/string/LazyString.php b/trunk/vendor/symfony/string/LazyString.php new file mode 100644 index 00000000..37330782 --- /dev/null +++ b/trunk/vendor/symfony/string/LazyString.php @@ -0,0 +1,143 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String; + +/** + * A string whose value is computed lazily by a callback. + * + * @author Nicolas Grekas + */ +class LazyString implements \Stringable, \JsonSerializable +{ + private \Closure|string $value; + + /** + * @param callable|array $callback A callable or a [Closure, method] lazy-callable + */ + public static function fromCallable(callable|array $callback, mixed ...$arguments): static + { + if (\is_array($callback) && !\is_callable($callback) && !(($callback[0] ?? null) instanceof \Closure || 2 < \count($callback))) { + throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); + } + + $lazyString = new static(); + $lazyString->value = static function () use (&$callback, &$arguments, &$value): string { + if (null !== $arguments) { + if (!\is_callable($callback)) { + $callback[0] = $callback[0](); + $callback[1] = $callback[1] ?? '__invoke'; + } + $value = $callback(...$arguments); + $callback = self::getPrettyName($callback); + $arguments = null; + } + + return $value ?? ''; + }; + + return $lazyString; + } + + public static function fromStringable(string|int|float|bool|\Stringable $value): static + { + if (\is_object($value)) { + return static::fromCallable([$value, '__toString']); + } + + $lazyString = new static(); + $lazyString->value = (string) $value; + + return $lazyString; + } + + /** + * Tells whether the provided value can be cast to string. + */ + final public static function isStringable(mixed $value): bool + { + return \is_string($value) || $value instanceof \Stringable || \is_scalar($value); + } + + /** + * Casts scalars and stringable objects to strings. + * + * @throws \TypeError When the provided value is not stringable + */ + final public static function resolve(\Stringable|string|int|float|bool $value): string + { + return $value; + } + + public function __toString(): string + { + if (\is_string($this->value)) { + return $this->value; + } + + try { + return $this->value = ($this->value)(); + } catch (\Throwable $e) { + if (\TypeError::class === \get_class($e) && __FILE__ === $e->getFile()) { + $type = explode(', ', $e->getMessage()); + $type = substr(array_pop($type), 0, -\strlen(' returned')); + $r = new \ReflectionFunction($this->value); + $callback = $r->getStaticVariables()['callback']; + + $e = new \TypeError(sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); + } + + throw $e; + } + } + + public function __sleep(): array + { + $this->__toString(); + + return ['value']; + } + + public function jsonSerialize(): string + { + return $this->__toString(); + } + + private function __construct() + { + } + + private static function getPrettyName(callable $callback): string + { + if (\is_string($callback)) { + return $callback; + } + + if (\is_array($callback)) { + $class = \is_object($callback[0]) ? get_debug_type($callback[0]) : $callback[0]; + $method = $callback[1]; + } elseif ($callback instanceof \Closure) { + $r = new \ReflectionFunction($callback); + + if (false !== strpos($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { + return $r->name; + } + + $class = $class->name; + $method = $r->name; + } else { + $class = get_debug_type($callback); + $method = '__invoke'; + } + + return $class.'::'.$method; + } +} diff --git a/trunk/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/trunk/vendor/symfony/string/Resources/data/wcswidth_table_wide.php new file mode 100644 index 00000000..5a647e67 --- /dev/null +++ b/trunk/vendor/symfony/string/Resources/data/wcswidth_table_wide.php @@ -0,0 +1,1143 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String; + +if (!\function_exists(u::class)) { + function u(?string $string = ''): UnicodeString + { + return new UnicodeString($string ?? ''); + } +} + +if (!\function_exists(b::class)) { + function b(?string $string = ''): ByteString + { + return new ByteString($string ?? ''); + } +} + +if (!\function_exists(s::class)) { + /** + * @return UnicodeString|ByteString + */ + function s(?string $string = ''): AbstractString + { + $string = $string ?? ''; + + return preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); + } +} diff --git a/trunk/vendor/symfony/string/Slugger/AsciiSlugger.php b/trunk/vendor/symfony/string/Slugger/AsciiSlugger.php new file mode 100644 index 00000000..548a6b93 --- /dev/null +++ b/trunk/vendor/symfony/string/Slugger/AsciiSlugger.php @@ -0,0 +1,176 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String\Slugger; + +use Symfony\Component\String\AbstractUnicodeString; +use Symfony\Component\String\UnicodeString; +use Symfony\Contracts\Translation\LocaleAwareInterface; + +if (!interface_exists(LocaleAwareInterface::class)) { + throw new \LogicException('You cannot use the "Symfony\Component\String\Slugger\AsciiSlugger" as the "symfony/translation-contracts" package is not installed. Try running "composer require symfony/translation-contracts".'); +} + +/** + * @author Titouan Galopin + */ +class AsciiSlugger implements SluggerInterface, LocaleAwareInterface +{ + private const LOCALE_TO_TRANSLITERATOR_ID = [ + 'am' => 'Amharic-Latin', + 'ar' => 'Arabic-Latin', + 'az' => 'Azerbaijani-Latin', + 'be' => 'Belarusian-Latin', + 'bg' => 'Bulgarian-Latin', + 'bn' => 'Bengali-Latin', + 'de' => 'de-ASCII', + 'el' => 'Greek-Latin', + 'fa' => 'Persian-Latin', + 'he' => 'Hebrew-Latin', + 'hy' => 'Armenian-Latin', + 'ka' => 'Georgian-Latin', + 'kk' => 'Kazakh-Latin', + 'ky' => 'Kirghiz-Latin', + 'ko' => 'Korean-Latin', + 'mk' => 'Macedonian-Latin', + 'mn' => 'Mongolian-Latin', + 'or' => 'Oriya-Latin', + 'ps' => 'Pashto-Latin', + 'ru' => 'Russian-Latin', + 'sr' => 'Serbian-Latin', + 'sr_Cyrl' => 'Serbian-Latin', + 'th' => 'Thai-Latin', + 'tk' => 'Turkmen-Latin', + 'uk' => 'Ukrainian-Latin', + 'uz' => 'Uzbek-Latin', + 'zh' => 'Han-Latin', + ]; + + private ?string $defaultLocale; + private \Closure|array $symbolsMap = [ + 'en' => ['@' => 'at', '&' => 'and'], + ]; + + /** + * Cache of transliterators per locale. + * + * @var \Transliterator[] + */ + private array $transliterators = []; + + public function __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null) + { + $this->defaultLocale = $defaultLocale; + $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; + } + + /** + * {@inheritdoc} + */ + public function setLocale(string $locale) + { + $this->defaultLocale = $locale; + } + + /** + * {@inheritdoc} + */ + public function getLocale(): string + { + return $this->defaultLocale; + } + + /** + * {@inheritdoc} + */ + public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString + { + $locale = $locale ?? $this->defaultLocale; + + $transliterator = []; + if ($locale && ('de' === $locale || 0 === strpos($locale, 'de_'))) { + // Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl) + $transliterator = ['de-ASCII']; + } elseif (\function_exists('transliterator_transliterate') && $locale) { + $transliterator = (array) $this->createTransliterator($locale); + } + + if ($this->symbolsMap instanceof \Closure) { + // If the symbols map is passed as a closure, there is no need to fallback to the parent locale + // as the closure can just provide substitutions for all locales of interest. + $symbolsMap = $this->symbolsMap; + array_unshift($transliterator, static function ($s) use ($symbolsMap, $locale) { + return $symbolsMap($s, $locale); + }); + } + + $unicodeString = (new UnicodeString($string))->ascii($transliterator); + + if (\is_array($this->symbolsMap)) { + $map = null; + if (isset($this->symbolsMap[$locale])) { + $map = $this->symbolsMap[$locale]; + } else { + $parent = self::getParentLocale($locale); + if ($parent && isset($this->symbolsMap[$parent])) { + $map = $this->symbolsMap[$parent]; + } + } + if ($map) { + foreach ($map as $char => $replace) { + $unicodeString = $unicodeString->replace($char, ' '.$replace.' '); + } + } + } + + return $unicodeString + ->replaceMatches('/[^A-Za-z0-9]++/', $separator) + ->trim($separator) + ; + } + + private function createTransliterator(string $locale): ?\Transliterator + { + if (\array_key_exists($locale, $this->transliterators)) { + return $this->transliterators[$locale]; + } + + // Exact locale supported, cache and return + if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$locale] ?? null) { + return $this->transliterators[$locale] = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); + } + + // Locale not supported and no parent, fallback to any-latin + if (!$parent = self::getParentLocale($locale)) { + return $this->transliterators[$locale] = null; + } + + // Try to use the parent locale (ie. try "de" for "de_AT") and cache both locales + if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$parent] ?? null) { + $transliterator = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); + } + + return $this->transliterators[$locale] = $this->transliterators[$parent] = $transliterator ?? null; + } + + private static function getParentLocale(?string $locale): ?string + { + if (!$locale) { + return null; + } + if (false === $str = strrchr($locale, '_')) { + // no parent locale + return null; + } + + return substr($locale, 0, -\strlen($str)); + } +} diff --git a/trunk/vendor/symfony/string/Slugger/SluggerInterface.php b/trunk/vendor/symfony/string/Slugger/SluggerInterface.php new file mode 100644 index 00000000..c679ed93 --- /dev/null +++ b/trunk/vendor/symfony/string/Slugger/SluggerInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String\Slugger; + +use Symfony\Component\String\AbstractUnicodeString; + +/** + * Creates a URL-friendly slug from a given string. + * + * @author Titouan Galopin + */ +interface SluggerInterface +{ + /** + * Creates a slug for the given string and locale, using appropriate transliteration when needed. + */ + public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString; +} diff --git a/trunk/vendor/symfony/string/UnicodeString.php b/trunk/vendor/symfony/string/UnicodeString.php new file mode 100644 index 00000000..70cf4c54 --- /dev/null +++ b/trunk/vendor/symfony/string/UnicodeString.php @@ -0,0 +1,358 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\String; + +use Symfony\Component\String\Exception\ExceptionInterface; +use Symfony\Component\String\Exception\InvalidArgumentException; + +/** + * Represents a string of Unicode grapheme clusters encoded as UTF-8. + * + * A letter followed by combining characters (accents typically) form what Unicode defines + * as a grapheme cluster: a character as humans mean it in written texts. This class knows + * about the concept and won't split a letter apart from its combining accents. It also + * ensures all string comparisons happen on their canonically-composed representation, + * ignoring e.g. the order in which accents are listed when a letter has many of them. + * + * @see https://unicode.org/reports/tr15/ + * + * @author Nicolas Grekas + * @author Hugo Hamon + * + * @throws ExceptionInterface + */ +class UnicodeString extends AbstractUnicodeString +{ + public function __construct(string $string = '') + { + $this->string = normalizer_is_normalized($string) ? $string : normalizer_normalize($string); + + if (false === $this->string) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + } + + public function append(string ...$suffix): static + { + $str = clone $this; + $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); + normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); + + if (false === $str->string) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + return $str; + } + + public function chunk(int $length = 1): array + { + if (1 > $length) { + throw new InvalidArgumentException('The chunk length must be greater than zero.'); + } + + if ('' === $this->string) { + return []; + } + + $rx = '/('; + while (65535 < $length) { + $rx .= '\X{65535}'; + $length -= 65535; + } + $rx .= '\X{'.$length.'})/u'; + + $str = clone $this; + $chunks = []; + + foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { + $str->string = $chunk; + $chunks[] = clone $str; + } + + return $chunks; + } + + public function endsWith(string|iterable|AbstractString $suffix): bool + { + if ($suffix instanceof AbstractString) { + $suffix = $suffix->string; + } elseif (!\is_string($suffix)) { + return parent::endsWith($suffix); + } + + $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; + normalizer_is_normalized($suffix, $form) ?: $suffix = normalizer_normalize($suffix, $form); + + if ('' === $suffix || false === $suffix) { + return false; + } + + if ($this->ignoreCase) { + return 0 === mb_stripos(grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)), $suffix, 0, 'UTF-8'); + } + + return $suffix === grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)); + } + + public function equalsTo(string|iterable|AbstractString $string): bool + { + if ($string instanceof AbstractString) { + $string = $string->string; + } elseif (!\is_string($string)) { + return parent::equalsTo($string); + } + + $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; + normalizer_is_normalized($string, $form) ?: $string = normalizer_normalize($string, $form); + + if ('' !== $string && false !== $string && $this->ignoreCase) { + return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); + } + + return $string === $this->string; + } + + public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int + { + if ($needle instanceof AbstractString) { + $needle = $needle->string; + } elseif (!\is_string($needle)) { + return parent::indexOf($needle, $offset); + } + + $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; + normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); + + if ('' === $needle || false === $needle) { + return null; + } + + try { + $i = $this->ignoreCase ? grapheme_stripos($this->string, $needle, $offset) : grapheme_strpos($this->string, $needle, $offset); + } catch (\ValueError $e) { + return null; + } + + return false === $i ? null : $i; + } + + public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int + { + if ($needle instanceof AbstractString) { + $needle = $needle->string; + } elseif (!\is_string($needle)) { + return parent::indexOfLast($needle, $offset); + } + + $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; + normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); + + if ('' === $needle || false === $needle) { + return null; + } + + $string = $this->string; + + if (0 > $offset) { + // workaround https://bugs.php.net/74264 + if (0 > $offset += grapheme_strlen($needle)) { + $string = grapheme_substr($string, 0, $offset); + } + $offset = 0; + } + + $i = $this->ignoreCase ? grapheme_strripos($string, $needle, $offset) : grapheme_strrpos($string, $needle, $offset); + + return false === $i ? null : $i; + } + + public function join(array $strings, string $lastGlue = null): static + { + $str = parent::join($strings, $lastGlue); + normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); + + return $str; + } + + public function length(): int + { + return grapheme_strlen($this->string); + } + + public function normalize(int $form = self::NFC): static + { + $str = clone $this; + + if (\in_array($form, [self::NFC, self::NFKC], true)) { + normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); + } elseif (!\in_array($form, [self::NFD, self::NFKD], true)) { + throw new InvalidArgumentException('Unsupported normalization form.'); + } elseif (!normalizer_is_normalized($str->string, $form)) { + $str->string = normalizer_normalize($str->string, $form); + $str->ignoreCase = null; + } + + return $str; + } + + public function prepend(string ...$prefix): static + { + $str = clone $this; + $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; + normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); + + if (false === $str->string) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + return $str; + } + + public function replace(string $from, string $to): static + { + $str = clone $this; + normalizer_is_normalized($from) ?: $from = normalizer_normalize($from); + + if ('' !== $from && false !== $from) { + $tail = $str->string; + $result = ''; + $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; + + while ('' !== $tail && false !== $i = $indexOf($tail, $from)) { + $slice = grapheme_substr($tail, 0, $i); + $result .= $slice.$to; + $tail = substr($tail, \strlen($slice) + \strlen($from)); + } + + $str->string = $result.$tail; + normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); + + if (false === $str->string) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + } + + return $str; + } + + public function replaceMatches(string $fromRegexp, string|callable $to): static + { + $str = parent::replaceMatches($fromRegexp, $to); + normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); + + return $str; + } + + public function slice(int $start = 0, int $length = null): static + { + $str = clone $this; + + $str->string = (string) grapheme_substr($this->string, $start, $length ?? 2147483647); + + return $str; + } + + public function splice(string $replacement, int $start = 0, int $length = null): static + { + $str = clone $this; + + $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; + $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; + $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); + normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); + + if (false === $str->string) { + throw new InvalidArgumentException('Invalid UTF-8 string.'); + } + + return $str; + } + + public function split(string $delimiter, int $limit = null, int $flags = null): array + { + if (1 > $limit = $limit ?? 2147483647) { + throw new InvalidArgumentException('Split limit must be a positive integer.'); + } + + if ('' === $delimiter) { + throw new InvalidArgumentException('Split delimiter is empty.'); + } + + if (null !== $flags) { + return parent::split($delimiter.'u', $limit, $flags); + } + + normalizer_is_normalized($delimiter) ?: $delimiter = normalizer_normalize($delimiter); + + if (false === $delimiter) { + throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); + } + + $str = clone $this; + $tail = $this->string; + $chunks = []; + $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; + + while (1 < $limit && false !== $i = $indexOf($tail, $delimiter)) { + $str->string = grapheme_substr($tail, 0, $i); + $chunks[] = clone $str; + $tail = substr($tail, \strlen($str->string) + \strlen($delimiter)); + --$limit; + } + + $str->string = $tail; + $chunks[] = clone $str; + + return $chunks; + } + + public function startsWith(string|iterable|AbstractString $prefix): bool + { + if ($prefix instanceof AbstractString) { + $prefix = $prefix->string; + } elseif (!\is_string($prefix)) { + return parent::startsWith($prefix); + } + + $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; + normalizer_is_normalized($prefix, $form) ?: $prefix = normalizer_normalize($prefix, $form); + + if ('' === $prefix || false === $prefix) { + return false; + } + + if ($this->ignoreCase) { + return 0 === mb_stripos(grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES), $prefix, 0, 'UTF-8'); + } + + return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); + } + + public function __wakeup() + { + if (!\is_string($this->string)) { + throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); + } + + normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); + } + + public function __clone() + { + if (null === $this->ignoreCase) { + normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); + } + + $this->ignoreCase = false; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/CHANGELOG.md b/trunk/vendor/wp-coding-standards/wpcs/CHANGELOG.md new file mode 100644 index 00000000..c31047a3 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/CHANGELOG.md @@ -0,0 +1,1654 @@ +# Change Log for WordPress Coding Standards + +All notable changes to this project will be documented in this file. + +This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). + +## [Unreleased] + +_No documentation available about unreleased changes as of yet._ + +## [3.1.0] - 2024-03-25 + +### Added +- WordPress-Core ruleset: now includes the `Universal.PHP.LowercasePHPTag` sniff. +- WordPress-Extra ruleset: now includes the `Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence` and the `Universal.CodeAnalysis.NoDoubleNegative` sniffs. +- The `sanitize_locale_name()` function to the list of known "escaping" functions. Props [@Chouby] +- The `sanitize_locale_name()` function to the list of known "sanitize & unslash" functions. Props [@Chouby] + +### Changed + +- The minimum required `PHP_CodeSniffer` version to 3.9.0 (was 3.7.2). +- The minimum required `PHPCSUtils` version to 1.0.10 (was 1.0.8). +- The minimum required `PHPCSExtra` version to 1.2.1 (was 1.1.0). + Please ensure you run `composer update wp-coding-standards/wpcs --with-dependencies` to benefit from these updates. +- Core ruleset: the spacing after the `use` keyword for closure `use` statements will now consistently be checked. Props [@westonruter] for reporting. +- The default value for `minimum_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#various-sniffs-set-the-minimum-supported-wp-version), has been updated to `6.2`. +- `WordPress.NamingConventions.PrefixAllGlobals` has been updated to recognize pluggable functions introduced in WP 6.4 and 6.5. +- `WordPress.NamingConventions.ValidPostTypeSlug` has been updated to recognize reserved post types introduced in WP 6.4 and 6.5. +- `WordPress.WP.ClassNameCase` has been updated to recognize classes introduced in WP 6.4 and 6.5. +- `WordPress.WP.DeprecatedClasses` now detects classes deprecated in WordPress up to WP 6.5. +- `WordPress.WP.DeprecatedFunctions` now detects functions deprecated in WordPress up to WP 6.5. +- The `IsUnitTestTrait` will now recognize classes which extend the new WP Core `WP_Font_Face_UnitTestCase` class as test classes. +- The test suite can now run on PHPUnit 4.x - 9.x (was 4.x - 7.x), which should make contributing more straight forward. +- Various housekeeping, includes a contribution from [@rodrigoprimo]. + +### Fixed + +- `WordPress.WP.PostsPerPage` could potentially result in an `Internal.Exception` when encountering a query string which doesn't include the value for `posts_per_page` in the query string. Props [@anomiex] for reporting. + + +## [3.0.1] - 2023-09-14 + +### Added + +- In WordPressCS 3.0.0, the functionality of the `WordPress.Security.EscapeOutput` sniff was updated to report unescaped message parameters passed to exceptions created in `throw` statements. This specific violation now has a separate error code: `ExceptionNotEscaped`. This will allow users to ignore or exclude that specific error code. Props [@anomiex]. + The error code(s) for other escaping issues flagged by the sniff remain unchanged. + +### Changed + +- Updated the CI workflow to test the example ruleset for issues. +- Funding files and updates in the Readme about funding the project. + +### Fixed + +- Fixed a sniff name in the `phpcs.xml.dist.sample` file (case-sensitive sniff name). Props [@dawidurbanski]. + + +## [3.0.0] - 2023-08-21 + +### Important information about this release: + +At long last... WordPressCS 3.0.0 is here. + +This is an important release which makes significant changes to improve the accuracy, performance, stability and maintainability of all sniffs, as well as making WordPressCS much better at handling modern PHP. + +WordPressCS 3.0.0 contains breaking changes, both for people using ignore annotations, people maintaining custom rulesets, as well as for sniff developers who maintain a custom PHPCS standard based on WordPressCS. + +If you are an end-user or maintain a custom WordPressCS based ruleset, please start by reading the [Upgrade Guide to WordPressCS 3.0.0 for end-users](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-end-users) which lists the most important changes and contains a step by step guide for upgrading. + +If you are a maintainer of an external standard based on WordPressCS and any of your custom sniffs are based on or extend WordPressCS sniffs, please read the [Upgrade Guide to WordPressCS 3.0.0 for Developers](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards). + +In all cases, please read the complete changelog carefully before you upgrade. + + +### Added + +- Dependencies on the following packages: [PHPCSUtils](https://phpcsutils.com/), [PHPCSExtra](https://github.com/PHPCSStandards/PHPCSExtra) and the [Composer PHPCS plugin]. +- A best effort has been made to add support for the new PHP syntaxes/features to all WordPressCS native sniffs and utility functions (or to verify/improve existing support). + While support in external sniffs used by WordPressCS has not be exhaustively verified, a lot of work has been done to try and add support for new PHP syntaxes to those as well. + WordPressCS native sniffs and utilities have received fixes for the following syntaxes: + * PHP 7.2 + - Keyed lists. + * PHP 7.3 + - Flexible heredoc/nowdoc (providing the PHPCS scan is run on PHP 7.3 or higher). + - Trailing commas in function calls. + * PHP 7.4 + - Arrow functions. + - Array unpacking in array expressions. + - Numeric literals with underscores. + - Typed properties. + - Null coalesce equals operator. + * PHP 8.0 + - Nullsafe object operators. + - Match expressions. + - Named arguments in function calls. + - Attributes. + - Union types // including supporting the `false` and `null` types. + - Constructor property promotion. + - `$object::class` + - Throw as an expression. + * PHP 8.1 + - Enumerations. + - Explicit octal notation. + - Final class constants + - First class callables. + - Intersection types. + * PHP 8.2 + - Constants in traits. +- New `WordPress.CodeAnalysis.AssignmentInTernaryCondition` sniff to the `WordPress-Core` ruleset which partially replaces the removed `WordPress.CodeAnalysis.AssignmentInCondition` sniff. +- New `WordPress.WhiteSpace.ObjectOperatorSpacing` sniff which replaces the use of the `Squiz.WhiteSpace.ObjectOperatorSpacing` sniff in the `WordPress-Core` ruleset. +- New `WordPress.WP.ClassNameCase` sniff to the `WordPress-Core` ruleset, to check that any class name references to WP native classes and classes from external dependencies use the case of the class as per the class declaration. +- New `WordPress.WP.Capabilities` sniff to the `WordPress-Extra` ruleset. This sniff checks that valid capabilities are used, not roles or user levels. Props, amongst others, to [@grappler] and [@khacoder]. + Custom capabilities can be added to the sniff via a `custom_capabilities` ruleset property. + The sniff also supports the `minimum_wp_version` property to allow the sniff to accurately determine how the use of deprecated capabilities should be flagged. +- The `WordPress.WP.CapitalPDangit` sniff contains a new check to verify the correct spelling of `WordPress` in namespace names. +- The `WordPress.WP.I18n` sniff contains a new `EmptyTextDomain` error code for an empty text string being passed as the text domain, which overrules the default value of the parameter and renders a text untranslatable. +- The `WordPress.DB.PreparedSQLPlaceholders` sniff has been expanded with additional checks for the correct use of the `%i` placeholder, which was introduced in WP 6.2. Props [@craigfrancis]. + The sniff now also supports the `minimum_wp_version` ruleset property to determine whether the `%i` placeholder can be used. +- `WordPress-Core`: the following additional sniffs (or select error codes from these sniffs) have been added to the ruleset: `Generic.CodeAnalysis.AssignmentInCondition`, `Generic.CodeAnalysis.EmptyPHPStatement` (replaces the WordPressCS native sniff), `Generic.VersionControl.GitMergeConflict`, `Generic.WhiteSpace.IncrementDecrementSpacing`, `Generic.WhiteSpace.LanguageConstructSpacing`, `Generic.WhiteSpace.SpreadOperatorSpacingAfter`, `PSR2.Classes.ClassDeclaration`, `PSR2.Methods.FunctionClosingBrace`, `PSR12.Classes.ClassInstantiation`, `PSR12.Files.FileHeader` (select error codes only), `PSR12.Functions.NullableTypeDeclaration`, `PSR12.Functions.ReturnTypeDeclaration`, `PSR12.Traits.UseDeclaration`, `Squiz.Functions.MultiLineFunctionDeclaration` (replaces part of the `WordPress.WhiteSpace.ControlStructureSpacing` sniff), `Modernize.FunctionCalls.Dirname`, `NormalizedArrays.Arrays.ArrayBraceSpacing` (replaces part of the `WordPress.Arrays.ArrayDeclarationSpacing` sniff), `NormalizedArrays.Arrays.CommaAfterLast` (replaces the WordPressCS native sniff), `Universal.Classes.ModifierKeywordOrder`, `Universal.Classes.RequireAnonClassParentheses`, `Universal.Constants.LowercaseClassResolutionKeyword`, `Universal.Constants.ModifierKeywordOrder`, `Universal.Constants.UppercaseMagicConstants`, `Universal.Namespaces.DisallowCurlyBraceSyntax`, `Universal.Namespaces.DisallowDeclarationWithoutName`, `Universal.Namespaces.OneDeclarationPerFile`, `Universal.NamingConventions.NoReservedKeywordParameterNames`, `Universal.Operators.DisallowShortTernary` (replaces the WordPressCS native sniff), `Universal.Operators.DisallowStandalonePostIncrementDecrement`, `Universal.Operators.StrictComparisons` (replaces the WordPressCS native sniff), `Universal.Operators.TypeSeparatorSpacing`, `Universal.UseStatements.DisallowMixedGroupUse`, `Universal.UseStatements.KeywordSpacing`, `Universal.UseStatements.LowercaseFunctionConst`, `Universal.UseStatements.NoLeadingBackslash`, `Universal.UseStatements.NoUselessAliases`, `Universal.WhiteSpace.CommaSpacing`, `Universal.WhiteSpace.DisallowInlineTabs` (replaces the WordPressCS native sniff), `Universal.WhiteSpace.PrecisionAlignment` (replaces the WordPressCS native sniff), `Universal.WhiteSpace.AnonClassKeywordSpacing`. +- `WordPress-Extra`: the following additional sniffs have been added to the ruleset: `Generic.CodeAnalysis.UnusedFunctionParameter`, `Universal.Arrays.DuplicateArrayKey`, `Universal.CodeAnalysis.ConstructorDestructorReturn`, `Universal.CodeAnalysis.ForeachUniqueAssignment`, `Universal.CodeAnalysis.NoEchoSprintf`, `Universal.CodeAnalysis.StaticInFinalClass`, `Universal.ControlStructures.DisallowLonelyIf`, `Universal.Files.SeparateFunctionsFromOO`. +- `WordPress.Utils.I18nTextDomainFixer`: the `load_script_textdomain()` function to the functions the sniff looks for. +- `WordPress.WP.AlternativeFunctions`: the following PHP native functions have been added to the sniff and will now be flagged when used: `unlink()` (in a new `unlink` group) , `rename()` (in a new `rename` group), `chgrp()`, `chmod()`, `chown()`, `is_writable()` `is_writeable()`, `mkdir()`, `rmdir()`, `touch()`, `fputs()` (in the existing `file_system_operations` group, which was previously named `file_system_read`). Props [@sandeshjangam] and [@JDGrimes]. +- The `PHPUnit_Adapter_TestCase` class to the list of "known test (case) classes". +- The `antispambot()` function to the list of known "formatting" functions. +- The `esc_xml()` and `wp_kses_one_attr()` functions to the list of known "escaping" functions. +- The `wp_timezone_choice()` and `wp_readonly()` functions to the list of known "auto escaping" functions. +- The `sanitize_url()` and `wp_kses_one_attr()` functions to the list of known "sanitizing" functions. +- Metrics for blank lines at the start/end of a control structure body to the `WordPress.WhiteSpace.ControlStructureSpacing` sniff. These can be displayed using `--report=info` when the `blank_line_check` property has been set to `true`. +- End-user documentation to the following new and pre-existing sniffs: `WordPress.DateTime.RestrictedFunctions`, `WordPress.NamingConventions.PrefixAllGlobals` (props [@Ipstenu]), `WordPress.PHP.StrictInArray` (props [@marconmartins]), `WordPress.PHP.YodaConditions` (props [@Ipstenu]), `WordPress.WhiteSpace.ControlStructureSpacing` (props [@ckanitz]), `WordPress.WhiteSpace.ObjectOperatorSpacing`, `WordPress.WhiteSpace.OperatorSpacing` (props [@ckanitz]), `WordPress.WP.CapitalPDangit` (props [@NielsdeBlaauw]), `WordPress.WP.Capabilities`, `WordPress.WP.ClassNameCase`, `WordPress.WP.EnqueueResourceParameters` (props [@NielsdeBlaauw]). + This documentation can be exposed via the [`PHP_CodeSniffer` `--generator=...` command-line argument](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage). + Note: all sniffs which have been added from PHPCSExtra (Universal, Modernize, NormalizedArrays sniffs) are also fully documented. + +#### Added (internal/dev-only) +- New Helper classes: + - `ArrayWalkingFunctionsHelper` + - `ConstantsHelper` * + - `ContextHelper` * + - `DeprecationHelper` * + - `FormattingFunctionsHelper` + - `ListHelper` * + - `RulesetPropertyHelper` * + - `SnakeCaseHelper` * + - `UnslashingFunctionsHelper` + - `ValidationHelper` + - `VariableHelper` * + - `WPGlobalVariablesHelper` + - `WPHookHelper` +- New Helper traits: + - `EscapingFunctionsTrait` + - `IsUnitTestTrait` + - `MinimumWPVersionTrait` + - `PrintingFunctionsTrait` + - `SanitizationHelperTrait` * + - `WPDBTrait` + +These classes and traits mostly contain pre-existing functionality moved from the `Sniff` class. +The classes marked with an `*` are considered _internal_ and do not have any promise of future backward compatibility. + +More information is available in the [Upgrade Guide to WordPressCS 3.0.0 for Developers](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards). + + +### Changed + +- As of this version, installation via Composer is the only supported manner of installation. + Installing in a different manner (git clone/PEAR/PHAR) is still possible, but no longer supported. +- The minimum required `PHP_CodeSniffer` version to 3.7.2 (was 3.3.1). +- Composer: the package will now identify itself as a static analysis tool. +- The PHP `filter`, `libxml` and `XMLReader` extensions are now explicitly required. + It is recommended to also have the `Mbstring` and `iconv` extensions enabled for the most accurate results. +- The release branch has been renamed from `master` to `main`. +- The following sniffs have been moved from `WordPress-Extra` to `WordPress-Core`: the `Generic.Files.OneObjectStructurePerFile` (also changed from `warning` to `error`), + `Generic.PHP.BacktickOperator`, `PEAR.Files.IncludingFile`, `PSR2.Classes.PropertyDeclaration`, `PSR2.Methods.MethodDeclaration`, `Squiz.Scope.MethodScope`, `Squiz.WhiteSpace.ScopeKeywordSpacing` sniffs. Props, amongst others, to [@desrosj]. +- `WordPress-Core`: The `Generic.Arrays.DisallowShortArraySyntax` sniff has been replaced by the `Universal.Arrays.DisallowShortArraySyntax` sniff. + The new sniff will recognize short lists correctly and ignore them. +- `WordPress-Core`: The `Generic.Files.EndFileNewline` sniff has been replaced by the more comprehensive `PSR2.Files.EndFileNewline` sniff. +- A number of sniffs support setting the minimum WP version for the code being scanned. + This could be done in two different ways: + 1. By setting the `minimum_supported_version` property for each sniff from a ruleset. + 2. By passing `--runtime-set minimum_supported_wp_version #.#` on the command line. + The names of the property and the CLI setting have now been aligned to both use `minimum_wp_version` as the name. + Both ways of passing the value are still supported. +- `WordPress.NamingConventions.PrefixAllGlobals`: the `custom_test_class_whitelist` property has been renamed to `custom_test_classes`. +- `WordPress.NamingConventions.ValidVariableName`: the `customPropertiesWhitelist` property has been renamed to `allowed_custom_properties`. +- `WordPress.PHP.NoSilencedErrors`: the `custom_whitelist` property has been renamed to `customAllowedFunctionsList`. +- `WordPress.PHP.NoSilencedErrors`: the `use_default_whitelist` property has been renamed to `usePHPFunctionsList`. +- `WordPress.WP.GlobalVariablesOverride`: the `custom_test_class_whitelist` property has been renamed to `custom_test_classes`. +- Sniffs are now able to handle fully qualified names for custom test classes provided via a `custom_test_classes` (previously `custom_test_class_whitelist`) ruleset property. +- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `6.0`. +- `WordPress.NamingConventions.PrefixAllGlobals` now takes new pluggable constants into account as introduced in WordPress up to WP 6.3. +- `WordPress.NamingConventions.ValidPostTypeSlug` now takes new reserved post types into account as introduced in WordPress up to WP 6.3. +- `WordPress.WP.DeprecatedClasses` now detects classes deprecated in WordPress up to WP 6.3. +- `WordPress.WP.DeprecatedFunctions` now detects functions deprecated in WordPress up to WP 6.3. +- `WordPress.WP.DeprecatedParameters` now detects parameters deprecated in WordPress up to WP 6.3. +- `WordPress.WP.DeprecatedParameterValues` now detects parameter values deprecated in WordPress up to WP 6.3. +- `WordPress.Utils.I18nTextDomainFixer`: the lists of recognized plugin and theme header tags has been updated based on the current information in the plugin and theme handbooks. +- `WordPress.WP.AlternativeFunctions`: the "group" name `file_system_read`, which can be used with the `exclude` property, has been renamed to `file_system_operations`. + This also means that the error codes for individual functions flagged via that group have changed from `WordPress.WP.AlternativeFunctions.file_system_read_*` to `WordPress.WP.AlternativeFunctions.file_system_operations_*`. +- `WordPress.WP.CapitalPDangit`: the `Misspelled` error code has been split into two error codes - `MisspelledInText` and `MisspelledInComment` - to allow for more modular exclusions/selectively turning off the auto-fixer for the sniff. +- `WordPress.WP.I18n` no longer throws both the `MissingSingularPlaceholder` and the `MismatchedPlaceholders` for the same code, as the errors have an overlap. +- `WordPress-Core`: previously only the spacing around commas in arrays, function declarations and function calls was checked. Now, the spacing around commas will be checked in all contexts. +- `WordPress.Arrays.ArrayKeySpacingRestrictions`: a new `SpacesBetweenBrackets` error code has been introduced for the spacing between square brackets for array assignments without key. Previously, this would throw a `NoSpacesAroundArrayKeys` error with an unclear error message. +- `WordPress.Files.FileName` now recognizes more word separators, meaning that files using other word separators than underscores will now be flagged for not using hyphenation. +- `WordPress.Files.FileName` now checks if a file contains a test class and if so, will bow out. + This change was made to prevent issues with PHPUnit 9.1+, which strongly prefers PSR4-style file names. + Whether something is test class or not is based on a pre-defined list of "known" test case classes which can be extended and, optionally, a list of user provided test case classes provided via setting the `custom_test_classes` property in a custom ruleset or the complete test directory can be excluded via a custom ruleset. +- `WordPress.NamingConventions.PrefixAllGlobals` now allows for pluggable functions and classes, which should not be prefixed when "plugged". +- `WordPress.PHP.NoSilencedErrors`: the metric, which displays in the `info` report, has been renamed from "whitelisted function call" to "silencing allowed function call". +- `WordPress.Security.EscapeOutput` now flags the use of `get_search_query( false )` when generating output (as the `false` turns off the escaping). +- `WordPress.Security.EscapeOutput` now also examines parameters passed for exception creation in `throw` statements and expressions for correct escaping. +- `WordPress.Security.ValidatedSanitizedInput` now examines _all_ superglobal (except for `$GLOBALS`). Previously, the `$_SESSION` and `$_ENV` superglobals would not be flagged as needing validation/sanitization. +- `WordPress.WP.I18n` now recognizes the new PHP 8.0+ `h` and `H` type specifiers. +- `WordPress.WP.PostsPerPage` has improved recognition for numbers prefixed with a unary operator and non-decimal numbers. +- `WordPress.DB.PreparedSQL` will identify more precisely the code which is problematic. +- `WordPress.DB.PreparedSQLPlaceholders` will identify more precisely the code which is problematic. +- `WordPress.DB.SlowDBQuery` will identify more precisely the code which is problematic. +- `WordPress.Security.PluginMenuSlug`: the error will now be thrown more precisely on the code which triggered the error. Depending on code layout, this may mean that an error will now be thrown on a different line. +- `WordPress.WP.DiscouragedConstants`: the error will now be thrown more precisely on the code which triggered the error. Depending on code layout, this may mean that an error will now be thrown on a different line. +- `WordPress.WP.EnqueuedResourceParameters`: the error will now be thrown more precisely on the code which triggered the error. Depending on code layout, this may mean that an error will now be thrown on a different line. +- `WordPress.WP.I18n`: the errors will now be thrown more precisely on the code which triggered the error. Depending on code layout, this may mean that an error will now be thrown on a different line. +- `WordPress.WP.PostsPerPage` will identify more precisely the code which is problematic. +- `WordPress.PHP.TypeCasts.UnsetFound` has been changed from a `warning` to an `error` as the `(unset)` cast is no longer available in PHP 8.0 and higher. +- `WordPress.WP.EnqueuedResourceParameters.MissingVersion` has been changed from an `error` to a `warning`. +- `WordPress.Arrays.ArrayKeySpacingRestrictions`: improved the clarity of the error messages for the `TooMuchSpaceBeforeKey` and `TooMuchSpaceAfterKey` error codes. +- `WordPress.CodeAnalysis.EscapedNotTranslated`: improved the clarity of the error message. +- `WordPress.PHP.IniSet`: improved the clarity of the error messages for the sniff. +- `WordPress.PHP.PregQuoteDelimiter`: improved the clarity of the error message for the `Missing` error code. +- `WordPress.PHP.RestrictedFunctions`: improved the clarity of the error messages for the sniff. +- `WordPress.PHP.RestrictedPHPFunctions`: improved the error message for the `create_function_create_function` error code. +- `WordPress.PHP.TypeCast`: improved the clarity of the error message for the `UnsetFound` error code. It will no longer advise assigning `null`. +- `WordPress.Security.SafeRedirect`: improved the clarity of the error message. (very minor) +- `WordPress.Security.ValidatedSanitizedInput`: improved the clarity of the error messages for the `MissingUnslash` error code. +- `WordPress.WhiteSpace.CastStructureSpacing`: improved the clarity of the error message for the `NoSpaceBeforeOpenParenthesis` error code. +- `WordPress.WP.I18n`: improved the clarity of the error messages for the sniff. +- `WordPress.WP.I18n`: the error messages will now use the correct parameter name. +- The error messages for the `WordPress.CodeAnalysis.EscapedNotTranslated`, `WordPress.NamingConventions.PrefixAllGlobals`, `WordPress.NamingConventions.ValidPostTypeSlug`, `WordPress.PHP.IniSet`, and the `WordPress.PHP.NoSilencedErrors` sniff will now display the code sample found without comments and extranuous whitespace. +- Various updates to the README, the example ruleset and other documentation. Props, amongst others, to [@Luc45], [@slaFFik]. +- Continuous Integration checks are now run via GitHub Actions. Props [@desrosj]. +- Various other CI/QA improvements. +- Code coverage will now be monitored via [CodeCov](https://app.codecov.io/gh/WordPress/WordPress-Coding-Standards). +- All sniffs are now also being tested against PHP 8.0, 8.1, 8.2 and 8.3 for consistent sniff results. + +#### Changed (internal/dev-only) +- All non-abstract classes in WordPressCS are now `final` with the exception of the following four classes which are known to be extended by external PHPCS standards build on top of WordPressCS: `WordPress.NamingConventions.ValidHookName`, `WordPress.Security.EscapeOutput`,`WordPress.Security.NonceVerification`, `WordPress.Security.ValidatedSanitizedInput`. +- Most remaining utility properties and methods, previously contained in the `WordPressCS\WordPress\Sniff` class, have been moved to dedicated Helper classes and traits or, in some cases, to the sniff class using them. + As this change is only relevant for extenders, the full details of these moves are not included in this changelog, but can be found in the [Developers Upgrade Guide to WordPressCS 3.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards) +- A few customizable `public` properties, which were used by multiple sniffs, have been moved from `*Sniff` classes to traits. Again, the full details of these moves are not included in this changelog, but can be found in the [Developers Upgrade Guide to WordPressCS 3.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards) +- A number of non-public properties in sniffs have been renamed. + As this change is only relevant for extenders, the full details of these renames are not included in this changelog, but can be found in the [Developers Upgrade Guide to WordPressCS 3.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards) +- `AbstractFunctionRestrictionsSniff`: The `whitelist` key in the `$groups` array property has been renamed to `allow`. +- The `WordPress.NamingConventions.ValidFunctionName` sniff no longer extends the similar PHPCS native `PEAR` sniff. + + +### Removed + +- Support for the deprecated, old-style WordPressCS native ignore annotations. Use the PHPCS native selective ignore annotations instead. +- The following WordPressCS native sniffs have been removed: + - The `WordPress.Arrays.CommaAfterArrayItem` sniff (replaced by the `NormalizedArrays.Arrays.CommaAfterLast` and the `Universal.WhiteSpace.CommaSpacing` sniffs). + - The `WordPress.Classes.ClassInstantiation` sniff (replaced by the `PSR12.Classes.ClassInstantiation`, `Universal.Classes.RequireAnonClassParentheses` and `Universal.WhiteSpace.AnonClassKeywordSpacing` sniffs). + - The `WordPress.CodeAnalysis.AssignmentInCondition` sniff (replaced by the `Generic.CodeAnalysis.AssignmentInCondition` and the `WordPress.CodeAnalysis.AssignmentInTernaryCondition` sniffs). + - The `WordPress.CodeAnalysis.EmptyStatement` sniff (replaced by the `Generic.CodeAnalysis.EmptyPHPStatement` sniff). + - The `WordPress.PHP.DisallowShortTernary` sniff (replaced by the `Universal.Operators.DisallowShortTernary` sniff). + - The `WordPress.PHP.StrictComparisons` sniff (replaced by the `Universal.Operators.StrictComparisons` sniff). + - The `WordPress.WhiteSpace.DisallowInlineTabs` sniff (replaced by the `Universal.WhiteSpace.DisallowInlineTabs` sniff). + - The `WordPress.WhiteSpace.PrecisionAlignment` sniff (replaced by the `Universal.WhiteSpace.PrecisionAlignment` sniff). + - The `WordPress.WP.TimezoneChange` sniff (replaced by the `WordPress.DateTime.RestrictedFunctions` sniff). This sniff was previously already deprecated. +- `WordPress-Extra`: The `Squiz.WhiteSpace.LanguageConstructSpacing` sniff (replaced by the added, more comprehensive `Generic.WhiteSpace.LanguageConstructSpacing` sniff in the `WordPress-Core` ruleset). +- `WordPress.Arrays.ArrayDeclarationSpacing`: array brace spacing checks (replaced by the `NormalizedArrays.Arrays.ArrayBraceSpacing` sniff). +- `WordPress.WhiteSpace.ControlStructureSpacing`: checks for the spacing for function declarations (replaced by the `Squiz.Functions.MultiLineFunctionDeclaration` sniff). + Includes removal of the `spaces_before_closure_open_paren` property for this sniff. +- `WordPress.WP.I18n`: the `check_translator_comments` property. + Exclude the `WordPress.WP.I18n.MissingTranslatorsComment` and the `WordPress.WP.I18n.TranslatorsCommentWrongStyle` error codes instead. +- WordPressCS will no longer check for assigning the return value of an object instantiation by reference. + This is a PHP parse error since PHP 7.0. Use the `PHPCompatibilityWP` standard to check for PHP cross-version compatibility issues. +- The check for object instantiations will no longer check JavaScript files. +- The `WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser` error code as sniffs should not report on parse errors. +- The `WordPress.CodeAnalysis.AssignmentIn[Ternary]Condition.NonVariableAssignmentFound` error code as sniffs should not report on parse errors. +- The `Block_Supported_Styles_Test` class will no longer incorrectly be recognized as an extendable test case class. + +#### Removed (internal/dev-only) +- `AbstractArrayAssignmentRestrictionsSniff`: support for the optional `'callback'` key in the array returned by `getGroups()`. +- `WordPressCS\WordPress\PHPCSHelper` class (use the `PHPCSUtils\BackCompat\Helper` class instead). +- `WordPressCS\WordPress\Sniff::addMessage()` method (use the `PHPCSUtils\Utils\MessageHelper::addMessage()` method instead). +- `WordPressCS\WordPress\Sniff::addFixableMessage()` method (use the `PHPCSUtils\Utils\MessageHelper::addFixableMessage()` method instead). +- `WordPressCS\WordPress\Sniff::determine_namespace()` method (use the `PHPCSUtils\Utils\Namespaces::determineNamespace()` method instead). +- `WordPressCS\WordPress\Sniff::does_function_call_have_parameters()` method (use the `PHPCSUtils\Utils\PassedParameters::hasParameters()` method instead). +- `WordPressCS\WordPress\Sniff::find_array_open_close()` method (use the `PHPCSUtils\Utils\Arrays::getOpenClose()` method instead). +- `WordPressCS\WordPress\Sniff::find_list_open_close()` method (use the `PHPCSUtils\Utils\Lists::getOpenClose()` method instead). +- `WordPressCS\WordPress\Sniff::get_declared_namespace_name()` method (use the `PHPCSUtils\Utils\Namespaces::getDeclaredName()` method instead). +- `WordPressCS\WordPress\Sniff::get_function_call_parameter_count()` method (use the `PHPCSUtils\Utils\PassedParameters::getParameterCount()` method instead). +- `WordPressCS\WordPress\Sniff::get_function_call_parameters()` method (use the `PHPCSUtils\Utils\PassedParameters::getParameters()` method instead). +- `WordPressCS\WordPress\Sniff::get_function_call_parameter()` method (use the `PHPCSUtils\Utils\PassedParameters::getParameter()` method instead). +- `WordPressCS\WordPress\Sniff::get_interpolated_variables()` method (use the `PHPCSUtils\Utils\TextStrings::getEmbeds()` method instead). +- `WordPressCS\WordPress\Sniff::get_last_ptr_on_line()` method (no replacement available at this time). +- `WordPressCS\WordPress\Sniff::get_use_type()` method (use the `PHPCSUtils\Utils\UseStatements::getType()` method instead). +- `WordPressCS\WordPress\Sniff::has_whitelist_comment()` method (no replacement). +- `WordPressCS\WordPress\Sniff::$hookFunctions` property (no replacement available at this time). +- `WordPressCS\WordPress\Sniff::init()` method (no replacement). +- `WordPressCS\WordPress\Sniff::is_class_constant()` method (use the `PHPCSUtils\Utils\Scopes::isOOConstant()` method instead). +- `WordPressCS\WordPress\Sniff::is_class_property()` method (use the `PHPCSUtils\Utils\Scopes::isOOProperty()` method instead). +- `WordPressCS\WordPress\Sniff::is_foreach_as()` method (use the `PHPCSUtils\Utils\Context::inForeachCondition()` method instead). +- `WordPressCS\WordPress\Sniff::is_short_list()` method (depending on your needs, use the `PHPCSUtils\Utils\Lists::isShortList()` or the `PHPCSUtils\Utils\Arrays::isShortArray()` method instead). +- `WordPressCS\WordPress\Sniff::is_token_in_test_method()` method (no replacement available at this time). +- `WordPressCS\WordPress\Sniff::REGEX_COMPLEX_VARS` constant (use the PHPCSUtils `PHPCSUtils\Utils\TextStrings::stripEmbeds()` and `PHPCSUtils\Utils\TextStrings::getEmbeds()` methods instead). +- `WordPressCS\WordPress\Sniff::string_to_errorcode()` method (use the `PHPCSUtils\Utils\MessageHelper::stringToErrorcode()` method instead). +- `WordPressCS\WordPress\Sniff::strip_interpolated_variables()` method (use the `PHPCSUtils\Utils\TextStrings::stripEmbeds()` method instead). +- `WordPressCS\WordPress\Sniff::strip_quotes()` method (use the `PHPCSUtils\Utils\TextStrings::stripQuotes()` method instead). +- `WordPressCS\WordPress\Sniff::valid_direct_scope()` method (use the `PHPCSUtils\Utils\Scopes::validDirectScope()` method instead). +- Unused dev-only files in the (now removed) `bin` directory. + + +### Fixed + +- All sniffs which, in one way or another, check whether code represents a short list or a short array will now do so more accurately. + This fixes various false positives and false negatives. +- Sniffs supporting the `minimum_wp_version` property (previously `minimum_supported_version`) will no longer throw a "passing null to non-nullable" deprecation notice on PHP 8.1+. +- `WordPress.WhiteSpace.ControlStructureSpacing` no longer throws a `TypeError` on PHP 8.0+. +- `WordPress.NamingConventions.PrefixAllGlobals`no longer throws a "passing null to non-nullable" deprecation notice on PHP 8.1+. +- `WordPress.WP.I18n` no longer throws a "passing null to non-nullable" deprecation notice on PHP 8.1+. +- `VariableHelper::is_comparison()` (previously `Sniff::is_comparison()`): fixed risk of undefined array key notice when scanning code containing parse errors. +- `AbstractArrayAssignmentRestrictionsSniff` could previously get confused when it encountered comments in unexpected places. + This fix has a positive impact on all sniffs which are based on this abstract (2 sniffs). +- `AbstractArrayAssignmentRestrictionsSniff` no longer examines numeric string keys as PHP treats those as integer keys, which were never intended as the target of this abstract. + This fix has a positive impact on all sniffs which are based on this abstract (2 sniffs). +- `AbstractArrayAssignmentRestrictionsSniff` in case of duplicate entries, the sniff will now only examine the last value, as that's the value PHP will see. + This fix has a positive impact on all sniffs which are based on this abstract (2 sniffs). +- `AbstractArrayAssignmentRestrictionsSniff` now determines the assigned value with higher accuracy. + This fix has a positive impact on all sniffs which are based on this abstract (2 sniffs). +- `AbstractClassRestrictionsSniff` now treats the `namespace` keyword when used as an operator case-insensitively. + This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). +- `AbstractClassRestrictionsSniff` now treats the hierarchy keywords (`self`, `parent`, `static`) case-insensitively. + This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). +- `AbstractClassRestrictionsSniff` now limits itself correctly when trying to find a class name before a `::`. + This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). +- `AbstractClassRestrictionsSniff`: false negatives on class instantiation statements ending on a PHP close tag. + This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). +- `AbstractClassRestrictionsSniff`: false negatives on class instantiation statements combined with method chaining. + This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). +- `AbstractFunctionRestrictionsSniff`: false positives on function declarations when the function returns by reference. + This fix has a positive impact on all sniffs which are based on this abstract (nearly half of the WordPressCS sniffs). +- `AbstractFunctionRestrictionsSniff`: false positives on instantiation of a class with the same name as a targetted function. + This fix has a positive impact on all sniffs which are based on this abstract (nearly half of the WordPressCS sniffs). +- `AbstractFunctionRestrictionsSniff` now respects that function names in PHP are case-insensitive in more places. + This fix has a positive impact on all sniffs which are based on this abstract (nearly half of the WordPressCS sniffs). +- Various utility methods in Helper classes/traits have received fixes to correctly treat function and class names as case-insensitive. + These fixes have a positive impact on all sniffs using these methods. +- Version comparisons done by sniffs supporting the `minimum_wp_version` property (previously `minimum_supported_version`) will now be more precise. +- `WordPress.Arrays.ArrayIndentation` now ignores indentation issues for array items which are not the first thing on a line. This fixes a potential fixer conflict. +- `WordPress.Arrays.ArrayKeySpacingRestrictions`: signed positive integer keys will now be treated the same as signed negative integer keys. +- `WordPress.Arrays.ArrayKeySpacingRestrictions`: keys consisting of calculations will now be recognized more accurately. +- `WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys`: now has better protection in case of a fixer conflict. +- `WordPress.Classes.ClassInstantiation` could create parse errors when fixing a class instantiation using variable variables. This has been fixed by replacing the sniff with the `PSR12.Classes.ClassInstantiation` sniff (and some others). +- `WordPress.DB.DirectDatabaseQuery` could previously get confused when it encountered comments in unexpected places. +- `WordPress.DB.DirectDatabaseQuery` now respects that function (method) names in PHP are case-insensitive. +- `WordPress.DB.DirectDatabaseQuery` now only looks at the current statement to find a method call to the `$wpdb` object. +- `WordPress.DB.DirectDatabaseQuery` no longer warns about `TRUNCATE` queries as those cannot be cached and need a direct database query. +- `WordPress.DB.PreparedSQL` could previously get confused when it encountered comments in unexpected places. +- `WordPress.DB.PreparedSQL` now respects that function names in PHP are case-insensitive. +- `WordPress.DB.PreparedSQL` improved recognition of interpolated variables and expressions in the `$text` argument. This fixes both some false negatives as well as some false positives. +- `WordPress.DB.PreparedSQL` stricter recognition of the `$wpdb` variable in double quoted query strings. +- `WordPress.DB.PreparedSQL` false positive for floating point numbers concatenated into an SQL query. +- `WordPress.DB.PreparedSQLPlaceholders` could previously get confused when it encountered comments in unexpected places. +- `WordPress.DB.PreparedSQLPlaceholders` now respects that function names in PHP are case-insensitive. +- `WordPress.DB.PreparedSQLPlaceholders` stricter recognition of the `$wpdb` variable in double quotes query strings. +- `WordPress.DB.PreparedSQLPlaceholders` false positive when a fully qualified function call is encountered in an `implode( ', ', array_fill(...))` pattern. +- `WordPress.Files.FileName` no longer presumes a three character file extension. +- `WordPress.NamingConventions.PrefixAllGlobals` could previously get confused when it encountered comments in unexpected places in function calls which were being examined. +- `WordPress.NamingConventions.PrefixAllGlobals` now respects that function names in PHP are case-insensitive when checking whether a function declaration is polyfilling a PHP native function. +- `WordPress.NamingConventions.PrefixAllGlobals` improved false positive prevention for variable assignments via keyed lists. +- `WordPress.NamingConventions.PrefixAllGlobals` now only looks at the current statement when determining which variables were imported via a `global` statement. This prevents both false positives as well as false negatives. +- `WordPress.NamingConventions.PrefixAllGlobals` no longer gets confused over `global` statements in nested clsure/function declarations. +- `WordPress.NamingConventions.ValidFunctionName` now also checks the names of (global) functions when the declaration is nested within an OO method. +- `WordPress.NamingConventions.ValidFunctionName` no longer throws false positives for triple underscore methods. +- `WordPress.NamingConventions.ValidFunctionName` the suggested replacement names in the error message no longer remove underscores from a name in case of leading or trailing underscores, or multiple underscores in the middle of a name. +- `WordPress.NamingConventions.ValidFunctionName` the determination whether a name is in `snake_case` is now more accurate and has improved handling of non-ascii characters. +- `WordPress.NamingConventions.ValidFunctionName` now correctly recognizes a PHP4-style constructor when the class and the constructor method name contains non-ascii characters. +- `WordPress.NamingConventions.ValidHookName` no longer throws false positives when the hook name is generated via a function call and that function is passed string literals as parameters. +- `WordPress.NamingConventions.ValidHookName` now ignores parameters in a variable function call (like a call to a closure). +- `WordPress.NamingConventions.ValidPostTypeSlug` no longer throws false positives for interpolated text strings with complex embedded variables/expressions. +- `WordPress.NamingConventions.ValidVariableName` the suggested replacement names in the error message will no longer remove underscores from a name in case of leading or trailing underscores, or multiple underscores in the middle of a name. +- `WordPress.NamingConventions.ValidVariableName` the determination whether a name is in `snake_case` is now more accurate and has improved handling of non-ascii characters. +- `WordPress.NamingConventions.ValidVariableName` now examines all variables and variables in expressions in a text string containing interpolation. +- `WordPress.NamingConventions.ValidVariableName` now has improved recognition of variables in complex embedded variables/expressions in interpolated text strings. +- `WordPress.PHP.IniSet` no longer gets confused over comments in the code when determining whether the ini value is an allowed one. +- `WordPress.PHP.NoSilencedErrors` no longer throws an error when error silencing is encountered for function calls to the PHP native `libxml_disable_entity_loader()` and `imagecreatefromwebp()` methods. +- `WordPress.PHP.StrictInArray` no longer gets confused over comments in the code when determining whether the `$strict` parameter is used. +- `WordPress.Security.EscapeOutput` no longer throws a false positive on function calls where the parameters need escaping, when no parameters are being passed. +- `WordPress.Security.EscapeOutput` no longer throws a false positive when a fully qualified function call to the `\basename()` function is encountered within a call to `_deprecated_file()`. +- `WordPress.Security.EscapeOutput` could previously get confused when it encountered comments in the `$file` parameter for `_deprecated_file()`. +- `WordPress.Security.EscapeOutput` now ignores significantly more operators which should yield more accurate results. +- `WordPress.Security.EscapeOutput` now respects that function names in PHP are case-insensitive when checking whether a printing function is being used. +- `WordPress.Security.EscapeOutput` no longer throws an `Internal.Exception` when it encounters a constant or property mirroring the name of one of the printing functions being targetted, nor will it throw false positives for those. +- `WordPress.Security.EscapeOutput` no longer incorrectly handles method calls or calls to namespaced functions mirroring the name of one of the printing functions being targetted. +- `WordPress.Security.EscapeOutput` now ignores `exit`/`die` statements without a status being passed, preventing false positives on code after the statement. +- `WordPress.Security.EscapeOutput` now has improved recognition that `print` can also be used as an expression, not only as a statement. +- `WordPress.Security.EscapeOutput` now has much, much, much more accurate handling of code involving ternary expressions and should now correctly ignore the ternary condition in all long ternaries being examined. +- `WordPress.Security.EscapeOutput` no longer disregards the ternary condition in a short ternary. +- `WordPress.Security.EscapeOutput` no longer skips over a constant or property mirroring the name of one of the (auto-)escaping/formatting functions being targeted. +- `WordPress.Security.EscapeOutput` no longer throws false positives for `*::class`, which will always evaluate to a plain string. +- `WordPress.Security.EscapeOutput` no longer throws false positives on output generating keywords encountered in an inline expression. +- `WordPress.Security.EscapeOutput` no longer throws false positives on parameters passed to `_e()` or `_ex()`, which won't be used in the output. +- `WordPress.Security.EscapeOutput` no longer throws false positives on heredocs not using interpolation. +- `WordPress.Security.NonceVerification` now respects that function names in PHP are case-insensitive when checking whether an array comparison function is being used. +- `WordPress.Security.NonceVerification` now also checks for nonce verification when the `$_FILES` superglobal is being used. +- `WordPress.Security.NonceVerification` now ignores properties named after superglobals. +- `WordPress.Security.NonceVerification` now ignores list assignments to superglobals. +- `WordPress.Security.NonceVerification` now ignores superglobals being unset. +- `WordPress.Security.ValidatedSanitizedInput` now respects that function names in PHP are case-insensitive when checking whether an array comparison function is being used. +- `WordPress.Security.ValidatedSanitizedInput` now respects that function names in PHP are case-insensitive when checking whether a variable is being validated using `[array_]key_exists()`. +- `WordPress.Security.ValidatedSanitizedInput` improved recognition of interpolated variables and expression in the text strings. This fixes some false negatives. +- `WordPress.Security.ValidatedSanitizedInput` no longer incorrectly regards an `unset()` as variable validation. +- `WordPress.Security.ValidatedSanitizedInput` no longer incorrectly regards validation in a nested scope as validation which applies to the superglobal being examined. +- `WordPress.WP.AlternativeFunctions` could previously get confused when it encountered comments in unexpected places. +- `WordPress.WP.AlternativeFunctions` now correctly takes the `minimum_wp_version` into account when determining whether a call to `parse_url()` could switch over to using `wp_parse_url()`. +- `WordPress.WP.CapitalPDangit` now skips (keyed) list assignments to prevent false positives. +- `WordPress.WP.CapitalPDangit` now always skips all array keys, not just plain text array keys. +- `WordPress.WP.CronInterval` no longer throws a `ChangeDetected` warning for interval calculations wrapped in parentheses, but for which the value for the interval is otherwise known. +- `WordPress.WP.CronInterval` no longer throws a `ChangeDetected` warning for interval calculations using fully qualified WP native time constants, but for which the value for the interval is otherwise known. +- `WordPress.WP.DeprecatedParameters` no longer throws a false positive for function calls to `comments_number()` using the fourth parameter (which was deprecated, but has been repurposed since WP 5.4). +- `WordPress.WP.DeprecatedParameters` now looks for the correct parameter in calls to the `unregister_setting()` function. +- `WordPress.WP.DeprecatedParameters` now lists the correct WP version for the deprecation of the third parameter in function calls to `get_user_option()`. +- `WordPress.WP.DiscouragedConstants` could previously get confused when it encountered comments in unexpected places. +- `WordPress.WP.EnqueuedResources` now recognizes enqueuing in a multi-line text string correctly. +- `WordPress.WP.EnqueuedResourceParameters` could previously get confused when it encountered comments in unexpected places. +- `WordPress.WP.GlobalVariablesOverride` improved false positive prevention for variable assignments via keyed lists. +- `WordPress.WP.GlobalVariablesOverride` now only looks at the current statement when determining which variables were imported via a `global` statement. This prevents both false positives as well as false negatives. +- `WordPress.WP.I18n` improved recognition of interpolated variables and expression in the `$text` argument. This fixes some false negatives. +- `WordPress.WP.I18n` no longer potentially creates parse errors when auto-fixing an `UnorderedPlaceholders*` error involving a multi-line text string. +- `WordPress.WP.I18n` no longer throws false positives for compound parameters starting with a text string, which were previously checked as if the parameter only consisted of a text string. +- `WordPress.WP.PostsPerPage` now determines the end of statement with more precision and will no longer throw a false positive for function calls on PHP 8.0+. + + +## [2.3.0] - 2020-05-14 + +### Added +- The `WordPress.WP.I18n` sniff contains a new check for translatable text strings which are wrapped in HTML tags, like `

    Translate me

    `. Those tags should be moved out of the translatable string. + Note: Translatable strings wrapped in `
    ` tags where the URL is intended to be localized will not trigger this check. + +### Changed +- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `5.1`. +- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 5.4. +- Improved grammar of an error message in the `WordPress.WP.DiscouragedFunctions` sniff. +- CI: The codebase is now - preliminary - being tested against the PHPCS 4.x development branch. + +### Fixed +- All function call detection sniffs: fixed a bug where constants with the same name as one of the targeted functions could inadvertently be recognized as if they were a called function. +- `WordPress.DB.PreparedSQL`: fixed a bug where the sniff would trigger on the namespace separator character `\\`. +- `WordPress.Security.EscapeOutput`: fixed a bug with the variable replacement in one of the error messages. + + +## [2.2.1] - 2020-02-04 + +### Added +- Metrics to the `WordPress.Arrays.CommaAfterArrayItem` sniff. These can be displayed using `--report=info`. +- The `sanitize_hex_color()` and the `sanitize_hex_color_no_hash()` functions to the `escapingFunctions` list used by the `WordPress.Security.EscapeOutput` sniff. + +### Changed +- The recommended version of the suggested [Composer PHPCS plugin] is now `^0.6`. + +### Fixed +- `WordPress.PHP.NoSilencedErrors`: depending on the custom properties set, the metrics would be different. +- `WordPress.WhiteSpace.ControlStructureSpacing`: fixed undefined index notice for closures with `use`. +- `WordPress.WP.GlobalVariablesOverride`: fixed undefined offset notice when the `treat_files_as_scoped` property would be set to `true`. +- `WordPress.WP.I18n`: fixed a _Trying to access array offset on value of type null_ error when the sniff was run on PHP 7.4 and would encounter a translation function expecting singular and plural texts for which one of these arguments was missing. + +## [2.2.0] - 2019-11-11 + +Note: The repository has moved. The new URL is https://github.com/WordPress/WordPress-Coding-Standards. +The move does not affect the package name for Packagist. This remains the same: `wp-coding-standards/wpcs`. + +### Added +- New `WordPress.DateTime.CurrentTimeTimestamp` sniff to the `WordPress-Core` ruleset, which checks against the use of the WP native `current_time()` function to retrieve a timestamp as this won't be a _real_ timestamp. Includes an auto-fixer. +- New `WordPress.DateTime.RestrictedFunctions` sniff to the `WordPress-Core` ruleset, which checks for the use of certain date/time related functions. Initially this sniff forbids the use of the PHP native `date_default_timezone_set()` and `date()` functions. +- New `WordPress.PHP.DisallowShortTernary` sniff to the `WordPress-Core` ruleset, which, as the name implies, disallows the use of short ternaries. +- New `WordPress.CodeAnalysis.EscapedNotTranslated` sniff to the `WordPress-Extra` ruleset which will warn when a text string is escaped for output, but not being translated, while the arguments passed to the function call give the impression that translation is intended. +- New `WordPress.NamingConventions.ValidPostTypeSlug` sniff to the `WordPress-Extra` ruleset which will examine calls to `register_post_type()` and throw errors when an invalid post type slug is used. +- `Generic.Arrays.DisallowShortArraySyntax` to the `WordPress-Core` ruleset. +- `WordPress.NamingConventions.PrefixAllGlobals`: the `PHP` prefix has been added to the prefix blacklist as it is reserved by PHP itself. +- The `wp_sanitize_redirect()` function to the `sanitizingFunctions` list used by the `WordPress.Security.NonceVerification`, `WordPress.Security.ValidatedSanitizedInput` and `WordPress.Security.EscapeOutput` sniffs. +- The `sanitize_key()` and the `highlight_string()` functions to the `escapingFunctions` list used by the `WordPress.Security.EscapeOutput` sniff. +- The `RECOVERY_MODE_COOKIE` constant to the list of WP Core constants which may be defined by plugins and themes and therefore don't need to be prefixed (`WordPress.NamingConventions.PrefixAllGlobals`). +- `$content_width`, `$plugin`, `$mu_plugin` and `$network_plugin` to the list of WP globals which is used by both the `WordPress.Variables.GlobalVariables` and the `WordPress.NamingConventions.PrefixAllGlobals` sniffs. +- `Sniff::is_short_list()` utility method to determine whether a _short array_ open/close token actually represents a PHP 7.1+ short list. +- `Sniff::find_list_open_close()` utility method to find the opener and closer for `list()` constructs, including short lists. +- `Sniff::get_list_variables()` utility method which will retrieve an array with the token pointers to the variables which are being assigned to in a `list()` construct. Includes support for short lists. +- `Sniff::is_function_deprecated()` static utility method to determine whether a declared function has been marked as deprecated in the function DocBlock. +- End-user documentation to the following existing sniffs: `WordPress.Arrays.ArrayIndentation`, `WordPress.Arrays.ArrayKeySpacingRestrictions`, `WordPress.Arrays.MultipleStatementAlignment`, `WordPress.Classes.ClassInstantiation`, `WordPress.NamingConventions.ValidHookName`, `WordPress.PHP.IniSet`, `WordPress.Security.SafeRedirect`, `WordPress.WhiteSpace.CastStructureSpacing`, `WordPress.WhiteSpace.DisallowInlineTabs`, `WordPress.WhiteSpace.PrecisionAlignment`, `WordPress.WP.CronInterval`, `WordPress.WP.DeprecatedClasses`, `WordPress.WP.DeprecatedFunctions`, `WordPress.WP.DeprecatedParameters`, `WordPress.WP.DeprecatedParameterValues`, `WordPress.WP.EnqueuedResources`, `WordPress.WP.PostsPerPage`. + This documentation can be exposed via the [`PHP_CodeSniffer` `--generator=...` command-line argument](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage). + +### Changed +- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `5.0`. +- The `WordPress.Arrays.ArrayKeySpacingRestrictions` sniff has two new error codes: `TooMuchSpaceBeforeKey` and `TooMuchSpaceAfterKey`. Both auto-fixable. + The sniff will now check that there is _exactly_ one space on the inside of the square brackets around the array key for non-string, non-numeric array keys. Previously, it only checked that there was whitespace, not how much whitespace. +- `WordPress.Arrays.ArrayKeySpacingRestrictions`: the fixers have been made more efficient and less fixer-conflict prone. +- `WordPress.NamingConventions.PrefixAllGlobals`: plugin/theme prefixes should be at least three characters long. A new `ShortPrefixPassed` error has been added for when the prefix passed does not comply with this rule. +- `WordPress.WhiteSpace.CastStructureSpacing` now allows for no whitespace before a cast when the cast is preceded by the spread `...` operator. This pre-empts a fixer conflict for when the spacing around the spread operator will start to get checked. +- The `WordPress.WP.DeprecatedClasses` sniff will now detect classes deprecated in WP 4.9 and WP 5.3. +- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 5.3. +- `WordPress.NamingConventions.ValidHookName` now has "cleaner" error messages and higher precision for the line on which an error is thrown. +- `WordPress.Security.EscapeOutput`: if an error refers to array access via a variable, the array index key will now be included in the error message. +- The processing of the `WordPress` ruleset by `PHP_CodeSniffer` will now be faster. +- Various minor code tweaks and clean up. +- Various minor documentation fixes. +- Documentation: updated the repo URL in all relevant places. + +### Deprecated +- The `WordPress.WP.TimezoneChange` sniff. Use the `WordPress.DateTime.RestrictedFunctions` instead. + The deprecated sniff will be removed in WPCS 3.0.0. + +### Fixed +- All sniffs in the `WordPress.Arrays` category will no longer treat _short lists_ as if they were a short array. +- The `WordPress.NamingConventions.ValidFunctionName` and the `WordPress.NamingConventions.PrefixAllGlobals` sniff will now ignore functions marked as `@deprecated`. +- Both the `WordPress.NamingConventions.PrefixAllGlobals` sniff as well as the `WordPress.WP.GlobalVariablesOverride` sniff have been updated to recognize variables being declared via (long/short) `list()` constructs and handle them correctly. +- Both the `WordPress.NamingConventions.PrefixAllGlobals` sniff as well as the `WordPress.WP.GlobalVariablesOverride` sniff will now take a limited list of WP global variables _which are intended to be overwritten by plugins/themes_ into account. + Initially this list contains the `$content_width` and the `$wp_cockneyreplace` variables. +- `WordPress.NamingConventions.ValidHookName`: will no longer examine a string array access index key as if it were a part of the hook name. +- `WordPress.Security.EscapeOutput`: will no longer trigger on the typical `basename( __FILE__ )` pattern if found as the first parameter passed to a call to `_deprecated_file()`. +- `WordPress.WP.CapitalPDangit`: now allows for the `.test` TLD in URLs. +- WPCS is now fully compatible with PHP 7.4. + Note: `PHP_CodeSniffer` itself is only compatible with PHP 7.4 from PHPCS 3.5.0 onwards. + + +## [2.1.1] - 2019-05-21 + +### Changed +- The `WordPress.WP.CapitalPDangit` will now ignore misspelled instances of `WordPress` within constant declarations. + This covers both constants declared using `defined()` as well as constants declared using the `const` keyword. +- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `4.9`. + +### Removed +- `paginate_comments_links()` from the list of auto-escaped functions `Sniff::$autoEscapedFunctions`. + This affects the `WordPress.Security.EscapeOutput` sniff. + +### Fixed +- The `$current_blog` and `$tag_ID` variables have been added to the list of WordPress global variables. + This fixes some false positives from the `WordPress.NamingConventions.PrefixAllGlobals` and the `WordPress.WP.GlobalVariablesOverride` sniffs. +- The generic `TestCase` class name has been added to the `$test_class_whitelist`. + This fixes some false positives from the `WordPress.NamingConventions.FileName`, `WordPress.NamingConventions.PrefixAllGlobals` and the `WordPress.WP.GlobalVariablesOverride` sniffs. +- The `WordPress.NamingConventions.ValidVariableName` sniff will now correctly recognize `$tag_ID` as a WordPress native, mixed-case variable. +- The `WordPress.Security.NonceVerification` sniff will now correctly recognize nonce verification within a nested closure or anonymous class. + + +## [2.1.0] - 2019-04-08 + +### Added +- New `WordPress.PHP.IniSet` sniff to the `WordPress-Extra` ruleset. + This sniff will detect calls to `ini_set()` and `ini_alter()` and warn against their use as changing configuration values at runtime leads to an unpredictable runtime environment, which can result in conflicts between core/plugins/themes. + - The sniff will not throw notices about a very limited set of "safe" ini directives. + - For a number of ini directives for which there are alternative, non-conflicting ways to achieve the same available, the sniff will throw an `error` and advise using the alternative. +- `doubleval()`, `count()` and `sizeof()` to `Sniff::$unslashingSanitizingFunctions` property. + While `count()` and its alias `sizeof()`, don't actually unslash or sanitize, the output of these functions is safe to use without unslashing or sanitizing. + This affects the `WordPress.Security.ValidatedSanitizedInput` and the `WordPress.Security.NonceVerification` sniffs. +- The new WP 5.1 `WP_UnitTestCase_Base` class to the `Sniff::$test_class_whitelist` property. +- New `Sniff::get_array_access_keys()` utility method to retrieve all array keys for a variable using multi-level array access. +- New `Sniff::is_class_object_call()`, `Sniff::is_token_namespaced()` utility methods. + These should help make the checking of whether or not a function call is a global function, method call or a namespaced function call more consistent. + This also implements allowing for the [namespace keyword being used as an operator](https://www.php.net/manual/en/language.namespaces.nsconstants.php#example-258). +- New `Sniff::is_in_function_call()` utility method to facilitate checking whether a token is (part of) a parameter passed to a specific (set of) function(s). +- New `Sniff::is_in_type_test()` utility method to determine if a variable is being type tested, along with a `Sniff::$typeTestFunctions` property containing the names of the functions this applies to. +- New `Sniff::is_in_array_comparison()` utility method to determine if a variable is (part of) a parameter in an array-value comparison, along with a `Sniff::$arrayCompareFunctions` property containing the names of the relevant functions. +- New `Sniff::$arrayWalkingFunctions` property containing the names of array functions which apply a callback to the array, but don't change the array by reference. +- New `Sniff::$unslashingFunctions` property containing the names of functions which unslash data passed to them and return the unslashed result. + +### Changed +- Moved the `WordPress.PHP.StrictComparisons`, `WordPress.PHP.StrictInArray` and the `WordPress.CodeAnalysis.AssignmentInCondition` sniff from the `WordPress-Extra` to the `WordPress-Core` ruleset. +- The `Squiz.Commenting.InlineComment.SpacingAfter` error is no longer included in the `WordPress-Docs` ruleset. +- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `4.8`. +- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 5.1. +- The `WordPress.Security.NonceVerification` sniff now allows for variable type testing, comparisons, unslashing and sanitization before the nonce check. A nonce check within the same scope, however, is still required. +- The `WordPress.Security.ValidatedSanitizedInput` sniff now allows for using a superglobal in an array-value comparison without sanitization, same as when the superglobal is used in a scalar value comparison. +- `WordPress.NamingConventions.PrefixAllGlobals`: some of the error messages have been made more explicit. +- The error messages for the `WordPress.Security.ValidatedSanitizedInput` sniff will now contain information on the index keys accessed. +- The error message for the `WordPress.Security.ValidatedSanitizedInput.InputNotValidated` has been reworded to make it more obvious what the actual issue being reported is. +- The error message for the `WordPress.Security.ValidatedSanitizedInput.MissingUnslash` has been reworded. +- The `Sniff::is_comparison()` method now has a new `$include_coalesce` parameter to allow for toggling whether the null coalesce operator should be seen as a comparison operator. Defaults to `true`. +- All sniffs are now also being tested against PHP 7.4 (unstable) for consistent sniff results. +- The recommended version of the suggested [Composer PHPCS plugin] is now `^0.5.0`. +- Various minor code tweaks and clean up. + +### Removed +- `ini_set` and `ini_alter` from the list of functions detected by the `WordPress.PHP.DiscouragedFunctions` sniff. + These are now covered via the new `WordPress.PHP.IniSet` sniff. +- `in_array()` and `array_key_exists()` from the list of `Sniff::$sanitizingFunctions`. These are now handled differently. + +### Fixed +- The `WordPress.NamingConventions.PrefixAllGlobals` sniff would underreport when global functions would be autoloaded via a Composer autoload `files` configuration. +- The `WordPress.Security.EscapeOutput` sniff will now recognize `map_deep()` for escaping the values in an array via a callback to an output escaping function. This should prevent false positives. +- The `WordPress.Security.NonceVerification` sniff will no longer inadvertently allow for a variable to be sanitized without a nonce check within the same scope. +- The `WordPress.Security.ValidatedSanitizedInput` sniff will no longer throw errors when a variable is only being type tested. +- The `WordPress.Security.ValidatedSanitizedInput` sniff will now correctly recognize the null coalesce (PHP 7.0) and null coalesce equal (PHP 7.4) operators and will now throw errors for missing unslashing and sanitization where relevant. +- The `WordPress.WP.AlternativeFunctions` sniff will no longer recommend using the WP_FileSystem when PHP native input streams, like `php://input`, or the PHP input stream constants are being read or written to. +- The `WordPress.WP.AlternativeFunctions` sniff will no longer report on usage of the `curl_version()` function. +- The `WordPress.WP.CronInterval` sniff now has improved function recognition which should lower the chance of false positives. +- The `WordPress.WP.EnqueuedResources` sniff will no longer throw false positives for inline jQuery code trying to access a stylesheet link tag. +- Various bugfixes for the `Sniff::has_nonce_check()` method: + - The method will no longer incorrectly identify methods/namespaced functions mirroring the name of WP native nonce verification functions as if they were the global functions. + This will prevent some false negatives. + - The method will now skip over nested closed scopes, such as closures and anonymous classes. This should prevent some false negatives for nonce verification being done while not in the correct scope. + + These fixes affect the `WordPress.Security.NonceVerification` sniff. +- The `Sniff::is_in_isset_or_empty()` method now also checks for usage of `array_key_exist()` and `key_exists()` and will regard these as correct ways to validate a variable. + This should prevent false positives for the `WordPress.Security.ValidatedSanitizedInput` and the `WordPress.Security.NonceVerification` sniffs. +- Various bugfixes for the `Sniff::is_sanitized()` method: + - The method presumed the WordPress coding style regarding code layout, which could lead to false positives. + - The method will no longer incorrectly identify methods/namespaced functions mirroring the name of WP/PHP native unslashing/sanitization functions as if they were the global functions. + This will prevent some false negatives. + - The method will now recognize `map_deep()` for sanitizing an array via a callback to a sanitization function. This should prevent false positives. + - The method will now recognize `stripslashes_deep()` and `stripslashes_from_strings_only()` as valid unslashing functions. This should prevent false positives. + All these fixes affect both the `WordPress.Security.ValidatedSanitizedInput` and the `WordPress.Security.NonceVerification` sniff. +- Various bugfixes for the `Sniff::is_validated()` method: + - The method did not verify correctly whether a variable being validated was the same variable as later used which could lead to false negatives. + - The method did not verify correctly whether a variable being validated had the same array index keys as the variable as later used which could lead to both false negatives as well as false positives. + - The method now also checks for usage of `array_key_exist()` and `key_exists()` and will regard these as correct ways to validate a variable. This should prevent some false positives. + - The methods will now recognize the null coalesce and the null coalesce equal operators as ways to validate a variable. This prevents some false positives. + The results from the `WordPress.Security.ValidatedSanitizedInput` sniff should be more accurate because of these fixes. +- A potential "Undefined index" notice from the `Sniff::is_assignment()` method. + + +## [2.0.0] - 2019-01-16 + +### Important information about this release: + +WordPressCS 2.0.0 contains breaking changes, both for people using custom rulesets as well as for sniff developers who maintain a custom PHPCS standard based on WordPressCS. + +Support for `PHP_CodeSniffer` 2.x has been dropped, the new minimum `PHP_CodeSniffer` version is 3.3.1. +Also, all previously deprecated sniffs, properties and methods have been removed. + +Please read the complete changelog carefully before you upgrade. + +If you are a maintainer of an external standard based on WordPressCS and any of your custom sniffs are based on or extend WPCS sniffs, please read the [Developers Upgrade Guide to WordPressCS 2.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-2.0.0-for-Developers-of-external-standards). + +### Changes since 2.0.0-RC1 + +#### Fixed + +- `WordPress-Extra`: Reverted back to including the `Squiz.WhiteSpace.LanguageConstructSpacing` sniff instead of the new `Generic.WhiteSpace.LanguageConstructSpacing` sniff as the new sniff is not (yet) available when the PEAR install of PHPCS is used. + +### Changes since 1.2.1 +For a full list of changes from the 1.2.1 version, please review the following changelog: +* https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/2.0.0-RC1 + + +## [2.0.0-RC1] - 2018-12-31 + +### Important information about this release: + +This is the first release candidate for WordPressCS 2.0.0. +WordPressCS 2.0.0 contains breaking changes, both for people using custom rulesets as well as for sniff developers who maintain a custom PHPCS standard based on WordPressCS. + +Support for `PHP_CodeSniffer` 2.x has been dropped, the new minimum `PHP_CodeSniffer` version is 3.3.1. +Also, all previously deprecated sniffs, properties and methods have been removed. + +Please read the complete changelog carefully before you upgrade. + +If you are a maintainer of an external standard based on WordPressCS and any of your custom sniffs are based on or extend WPCS sniffs, please read the [Developers Upgrade Guide to WordPressCS 2.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-2.0.0-for-Developers-of-external-standards). + +### Added +- `Generic.PHP.DiscourageGoto`, `Generic.PHP.LowerCaseType`, `Generic.WhiteSpace.ArbitraryParenthesesSpacing` and `PSR12.Keywords.ShortFormTypeKeywords` to the `WordPress-Core` ruleset. +- Checking the spacing around the `instanceof` operator to the `WordPress.WhiteSpace.OperatorSpacing` sniff. + +### Changed +- The minimum required `PHP_CodeSniffer` version to 3.3.1 (was 2.9.0). +- The namespace used by WordPressCS has been changed from `WordPress` to `WordPressCS\WordPress`. + This was not possible while `PHP_CodeSniffer` 2.x was still supported, but WordPressCS, as a good Open Source citizen, does not want to occupy the `WordPress` namespace and is releasing its use of it now this is viable. +- The `WordPress.DB.PreparedSQL` sniff used the same error code for two different errors. + The `NotPrepared` error code remains, however an additional `InterpolatedNotPrepared` error code has been added for the second error. + If you are referencing the old error code in a ruleset XML file or in inline annotations, you may need to update it. +- The `WordPress.NamingConventions.PrefixAllGlobals` sniff used the same error code for some errors as well as warnings. + The `NonPrefixedConstantFound` error code remains for the related error, but the warning will now use the new `VariableConstantNameFound` error code. + The `NonPrefixedHooknameFound` error code remains for the related error, but the warning will now use the new `DynamicHooknameFound` error code. + If you are referencing the old error codes in a ruleset XML file or in inline annotations, you may need to update these to use the new codes instead. +- `WordPress.NamingConventions.ValidVariableName`: the error messages and error codes used by this sniff have been changed for improved usability and consistency. + - The error messages will now show a suggestion for a valid alternative name for the variable. + - The `NotSnakeCaseMemberVar` error code has been renamed to `UsedPropertyNotSnakeCase`. + - The `NotSnakeCase` error code has been renamed to `VariableNotSnakeCase`. + - The `MemberNotSnakeCase` error code has been renamed to `PropertyNotSnakeCase`. + - The `StringNotSnakeCase` error code has been renamed to `InterpolatedVariableNotSnakeCase`. + If you are referencing the old error codes in a ruleset XML file or in inline annotations, you may need to update these to use the new codes instead. +- The `WordPress.Security.NonceVerification` sniff used the same error code for both an error as well as a warning. + The old error code `NoNonceVerification` is no longer used. + The `error` now uses the `Missing` error code, while the `warning` now uses the `Recommended` error code. + If you are referencing the old error code in a ruleset XML file or in inline annotations, please update these to use the new codes instead. +- The `WordPress.WP.DiscouragedConstants` sniff used to have two error codes `UsageFound` and `DeclarationFound`. + These error codes will now be prefixed by the name of the constant found to allow for more fine-grained excluding/ignoring of warnings generated by this sniff. + If you are referencing the old error codes in a ruleset XML file or in inline annotations, you may need to update these to use the new codes instead. +- The `WordPress.WP.GlobalVariablesOverride.OverrideProhibited` error code has been replaced by the `WordPress.WP.GlobalVariablesOverride.Prohibited` error code. + If you are referencing the old error code in a ruleset XML file or in inline annotations, you may need to update it. +- `WordPress-Extra`: Replaced the inclusion of the `Generic.Files.OneClassPerFile`, `Generic.Files.OneInterfacePerFile` and the `Generic.Files.OneTraitPerFile` sniffs with the new `Generic.Files.OneObjectStructurePerFile` sniff. +- `WordPress-Extra`: Replaced the inclusion of the `Squiz.WhiteSpace.LanguageConstructSpacing` sniff with the new `Generic.WhiteSpace.LanguageConstructSpacing` sniff. +- `WordPress-Extra`: Replaced the inclusion of the `Squiz.Scope.MemberVarScope` sniff with the more comprehensive `PSR2.Classes.PropertyDeclaration` sniff. +- `WordPress.NamingConventions.ValidFunctionName`: Added a unit test confirming support for interfaces extending multiple interfaces. +- `WordPress.NamingConventions.ValidVariableName`: Added unit tests confirming support for multi-variable/property declarations. +- The `get_name_suggestion()` method has been moved from the `WordPress.NamingConventions.ValidFunctionName` sniff to the base `Sniff` class, renamed to `get_snake_case_name_suggestion()` and made static. +- The rulesets are now validated against the `PHP_CodeSniffer` XSD schema. +- Updated the [custom ruleset example](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample) to use the recommended ruleset syntax for `PHP_CodeSniffer` 3.3.1+, including using the new [array property format](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.3.0) which is now supported. +- Dev: The command to run the unit tests has changed. Please see the updated instructions in the [CONTRIBUTING.md](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/.github/CONTRIBUTING.md) file. + The `bin/pre-commit` example git hook has been updated to match. Additionally a `run-tests` script has been added to the `composer.json` file for your convenience. + To facilitate this, PHPUnit has been added to `require-dev`, even though it is strictly speaking a dependency of PHPCS, not of WPCS. +- Dev: The [Composer PHPCS plugin] has been added to `require-dev`. +- Various code tweaks and clean up. +- User facing documentation, including the wiki, as well as inline documentation has been updated for all the changes contained in WordPressCS 2.0 and other recommended best practices for `PHP_CodeSniffer` 3.3.1+. + +### Deprecated +- The use of the [WordPressCS native whitelist comments](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors), which were introduced in WPCS 0.4.0, have been deprecated and support will be removed in WPCS 3.0.0. + The WordPressCS native whitelist comments will continue to work for now, but a deprecation warning will be thrown when they are encountered. + You are encouraged to upgrade our whitelist comment to use the [PHPCS native selective ignore annotations](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.2.0) as introduced in `PHP_CodeSniffer` 3.2.0, as soon as possible. + +### Removed +- Support for PHP 5.3. PHP 5.4 is the minimum requirement for `PHP_CodeSniffer` 3.x. + Includes removing any and all workarounds which were in place to still support PHP 5.3. +- Support for `PHP_CodeSniffer` < 3.3.1. + Includes removing any and all workarounds which were in place for supporting older `PHP_CodeSniffer` versions. +- The `WordPress-VIP` standard which was deprecated since WordPressCS 1.0.0. + For checking a theme/plugin for hosting on the WordPress.com VIP platform, please use the [Automattic VIP coding standards](https://github.com/Automattic/VIP-Coding-Standards) instead. +- Support for array properties set in a custom ruleset without the `type="array"` attribute. + Support for this was deprecated in WPCS 1.0.0. + If in doubt about how properties should be set in your custom ruleset, please refer to the [Customizable sniff properties](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties) wiki page which contains XML code examples for setting each and every WPCS native sniff property. + As the minimum `PHP_CodeSniffer` version is now 3.3.1, you can now also use the [new format for setting array properties](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.3.0), so this would be a great moment to review and update your custom ruleset. + Note: the ability to set select properties from the command-line as comma-delimited strings is _not_ affected by this change. +- The following sniffs have been removed outright without deprecation. + If you are referencing these sniffs in a ruleset XML file or in inline annotations, please update these to reference the replacement sniffs instead. + - `WordPress.Functions.FunctionCallSignatureNoParams` - superseded by a bug fix in the upstream `PEAR.Functions.FunctionCallSignature` sniff. + - `WordPress.PHP.DiscourageGoto` - replaced by the same sniff which is now available upstream: `Generic.PHP.DiscourageGoto`. + - `WordPress.WhiteSpace.SemicolonSpacing` - superseded by a bug fix in the upstream `Squiz.WhiteSpace.SemicolonSpacing` sniff. + - `WordPress.WhiteSpace.ArbitraryParenthesesSpacing` - replaced by the same sniff which is now available upstream: `Generic.WhiteSpace.ArbitraryParenthesesSpacing`. +- The following "base" sniffs which were previously already deprecated and turned into abstract base classes, have been removed: + - `WordPress.Arrays.ArrayAssignmentRestrictions` - use the `AbstractArrayAssignmentRestrictionsSniff` class instead. + - `WordPress.Functions.FunctionRestrictions` - use the `AbstractFunctionRestrictionsSniff` class instead. + - `WordPress.Variables.VariableRestrictions` without replacement. +- The following sniffs which were previously deprecated, have been removed: + - `WordPress.Arrays.ArrayDeclaration` - use the other sniffs in the `WordPress.Arrays` category instead. + - `WordPress.CSRF.NonceVerification` - use `WordPress.Security.NonceVerification` instead. + - `WordPress.Functions.DontExtract` - use `WordPress.PHP.DontExtract` instead. + - `WordPress.Variables.GlobalVariables` - use `WordPress.WP.GlobalVariablesOverride` instead. + - `WordPress.VIP.CronInterval` - use `WordPress.WP.CronInterval` instead. + - `WordPress.VIP.DirectDatabaseQuery` - use `WordPress.DB.DirectDatabaseQuery` instead. + - `WordPress.VIP.PluginMenuSlug` - use `WordPress.Security.PluginMenuSlug` instead. + - `WordPress.VIP.SlowDBQuery` - use `WordPress.DB.SlowDBQuery` instead. + - `WordPress.VIP.TimezoneChange` - use `WordPress.WP.TimezoneChange` instead. + - `WordPress.VIP.ValidatedSanitizedInput` - use `WordPress.Security.ValidatedSanitizedInput` instead. + - `WordPress.WP.PreparedSQL` - use `WordPress.DB.PreparedSQL` instead. + - `WordPress.XSS.EscapeOutput` - use `WordPress.Security.EscapeOutput` instead. + - `WordPress.PHP.DiscouragedFunctions` without direct replacement. + The checks previously contained in this sniff were moved to separate sniffs in WPCS 0.11.0. + - `WordPress.Variables.VariableRestrictions` without replacement. + - `WordPress.VIP.AdminBarRemoval` without replacement. + - `WordPress.VIP.FileSystemWritesDisallow` without replacement. + - `WordPress.VIP.OrderByRand` without replacement. + - `WordPress.VIP.PostsPerPage` without replacement. + Part of the previous functionality was split off in WPCS 1.0.0 to the `WordPress.WP.PostsPerPage` sniff. + - `WordPress.VIP.RestrictedFunctions` without replacement. + - `WordPress.VIP.RestrictedVariables` without replacement. + - `WordPress.VIP.SessionFunctionsUsage` without replacement. + - `WordPress.VIP.SessionVariableUsage` without replacement. + - `WordPress.VIP.SuperGlobalInputUsage` without replacement. +- The `WordPress.DB.SlowDBQuery.DeprecatedWhitelistFlagFound` error code which is superseded by the blanket deprecation warning for using the now deprecated WPCS native whitelist comments. +- The `WordPress.PHP.TypeCasts.NonLowercaseFound` error code which has been replaced by the upstream `Generic.PHP.LowerCaseType` sniff. +- The `WordPress.PHP.TypeCasts.LongBoolFound` and `WordPress.PHP.TypeCasts.LongIntFound` error codes which has been replaced by the new upstream `PSR12.Keywords.ShortFormTypeKeywords` sniff. +- The `WordPress.Security.EscapeOutput.OutputNotEscapedShortEcho` error code which was only ever used if WPCS was run on PHP 5.3 with the `short_open_tag` ini directive set to `off`. +- The following sniff categories which were previously deprecated, have been removed, though select categories may be reinstated in the future: + - `CSRF` + - `Functions` + - `Variables` + - `VIP` + - `XSS` +- `WordPress.NamingConventions.ValidVariableName`: The `customVariableWhitelist` property, which had been deprecated since WordPressCS 0.11.0. Use the `customPropertiesWhitelist` property instead. +- `WordPress.Security.EscapeOutput`: The `customSanitizingFunctions` property, which had been deprecated since WordPressCS 0.5.0. Use the `customEscapingFunctions` property instead. +- `WordPress.Security.NonceVerification`: The `errorForSuperGlobals` and `warnForSuperGlobals` properties, which had been deprecated since WordPressCS 0.12.0. +- The `vip_powered_wpcom` function from the `Sniff::$autoEscapedFunctions` list which is used by the `WordPress.Security.EscapeOutput` sniff. +- The `AbstractVariableRestrictionsSniff` class, which was deprecated since WordPressCS 1.0.0. +- The `Sniff::has_html_open_tag()` utility method, which was deprecated since WordPressCS 1.0.0. +- The internal `$php_reserved_vars` property from the `WordPress.NamingConventions.ValidVariableName` sniff in favour of using a PHPCS native property which is now available. +- The class aliases and WPCS native autoloader used for PHPCS cross-version support. +- The unit test framework workarounds for PHPCS cross-version unit testing. +- Support for the `@codingStandardsChangeSetting` annotation, which is generally only used in unit tests. +- The old generic GitHub issue template which was replaced by more specific issue templates in WPCS 1.2.0. + +### Fixed +- Support for PHP 7.3. + `PHP_CodeSniffer` < 3.3.1 was not fully compatible with PHP 7.3. Now the minimum required PHPCS has been upped to `PHP_CodeSniffer` 3.3.1, WordPressCS will run on PHP 7.3 without issue. +- `WordPress.Arrays.ArrayDeclarationSpacing`: improved fixing of the placement of array items following an array item with a trailing multi-line comment. +- `WordPress.NamingConventions.ValidFunctionName`: the sniff will no longer throw false positives nor duplicate errors for methods declared in nested anonymous classes. + The error message has also been improved for methods in anonymous classes. +- `WordPress.NamingConventions.ValidFunctionName`: the sniff will no longer throw false positives for PHP 4-style class constructors/destructors where the name of the constructor/destructor method did not use the same case as the class name. + + +## [1.2.1] - 2018-12-18 + +Note: This will be the last release supporting PHP_CodeSniffer 2.x. + +### Changed +- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `4.7`. +- The `WordPress.NamingConventions.PrefixAllGlobals` sniff will now report the error for hook names and constant names declared with `define()` on the line containing the parameter for the hook/constant name. Previously, it would report the error on the line containing the function call. +- Various minor housekeeping fixes to inline documentation, rulesets, code. + +### Removed +- `comment_author_email_link()`, `comment_author_email()`, `comment_author_IP()`, `comment_author_link()`, `comment_author_rss()`, `comment_author_url_link()`, `comment_author_url()`, `comment_author()`, `comment_date()`, `comment_excerpt()`, `comment_form_title()`, `comment_form()`, `comment_id_fields()`, `comment_ID()`, `comment_reply_link()`, `comment_text_rss()`, `comment_text()`, `comment_time()`, `comment_type()`, `comments_link()`, `comments_number()`, `comments_popup_link()`, `comments_popup_script()`, `comments_rss_link()`, `delete_get_calendar_cache()`, `edit_bookmark_link()`, `edit_comment_link()`, `edit_post_link()`, `edit_tag_link()`, `get_footer()`, `get_header()`, `get_sidebar()`, `get_the_title()`, `next_comments_link()`, `next_image_link()`, `next_post_link()`, `next_posts_link()`, `permalink_anchor()`, `posts_nav_link()`, `previous_comments_link()`, `previous_image_link()`, `previous_post_link()`, `previous_posts_link()`, `sticky_class()`, `the_attachment_link()`, `the_author_link()`, `the_author_meta()`, `the_author_posts_link()`, `the_author_posts()`, `the_category_rss()`, `the_category()`, `the_content_rss()`, `the_content()`, `the_date_xml()`, `the_excerpt_rss()`, `the_excerpt()`, `the_feed_link()`, `the_ID()`, `the_meta()`, `the_modified_author()`, `the_modified_date()`, `the_modified_time()`, `the_permalink()`, `the_post_thumbnail()`, `the_search_query()`, `the_shortlink()`, `the_tags()`, `the_taxonomies()`, `the_terms()`, `the_time()`, `the_title_rss()`, `the_title()`, `wp_enqueue_script()`, `wp_meta()`, `wp_shortlink_header()` and `wp_shortlink_wp_head()` from the list of auto-escaped functions `Sniff::$autoEscapedFunctions`. This affects the `WordPress.Security.EscapeOutput` sniff. + +### Fixed +- The `WordPress.WhiteSpace.PrecisionAlignment` sniff would loose the value of a custom set `ignoreAlignmentTokens` property when scanning more than one file. + + +## [1.2.0] - 2018-11-12 + +### Added +- New `WordPress.PHP.TypeCasts` sniff to the `WordPress-Core` ruleset. + This new sniff checks that PHP type casts are: + * lowercase; + * short form, i.e. `(bool)` not `(boolean)`; + * normalized, i.e. `(float)` not `(real)`. + Additionally, the new sniff discourages the use of the `(unset)` and `(binary)` type casts. +- New `WordPress.Utils.I18nTextDomainFixer` sniff which can compehensively replace/add `text-domain`s in a plugin or theme. + Important notes: + - This sniff is disabled by default and intended as a utility tool. + - The sniff will fix the text domains in all I18n function calls as well as in a plugin/theme `Text Domain:` header. + - Passing the following properties will activate the sniff: + - `old_text_domain`: an array with one or more (old) text domains which need to be replaced; + - `new_text_domain`: the correct (new) text domain as a string. +- The `WordPress.NamingConventions.PrefixAllGlobals` sniff will now also verify that namespace names use a valid prefix. + * The sniff allows for underscores and (other) non-word characters in a passed prefix to be converted to namespace separators when used in a namespace name. + In other words, if a prefix of `my_plugin` is passed as a value to the `prefixes` property, a namespace name of both `My\Plugin` as well as `My_Plugin\\`, will be accepted automatically. + * Passing a prefix property value containing namespace separators will now also be allowed and will no longer trigger a warning. +- `WordPress` to the prefix blacklist for the `WordPress.NamingConventions.PrefixAllGlobals` sniff. + While the prefix cannot be `WordPress`, a prefix can still _start with_ or _contain_ `WordPress`. +- Additional unit tests covering a change in the tokenizer which will be included in the upcoming `PHP_CodeSniffer` 3.4.0 release. +- A variety of issue templates for use on GitHub. + +### Changed +- The `Sniff::valid_direct_scope()` method will now return the `$stackPtr` to the valid scope if a valid direct scope has been detected. Previously, it would return `true`. +- Minor hardening and efficiency improvements to the `WordPress.NamingConventions.PrefixAllGlobals` sniff. +- The inline documentation of the `WordPress-Core` ruleset has been updated to be in line again with [the handbook](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/). +- The inline links to documentation about the VIP requirements have been updated. +- Updated the [custom ruleset example](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample) to recommend using `PHPCompatibilityWP` rather than `PHPCompatibility`. +- All sniffs are now also being tested against PHP 7.3 for consistent sniff results. + Note: PHP 7.3 is only supported in combination with PHPCS 3.3.1 or higher as `PHP_CodeSniffer` itself has an incompatibility in earlier versions. +- Minor grammar fixes in text strings and documentation. +- Minor consistency improvement for the unit test case files. +- Minor tweaks to the `composer.json` file. +- Updated the PHPCompatibility `dev` dependency. + +### Removed +- The `WordPress.WhiteSpace.CastStructureSpacing.NoSpaceAfterCloseParenthesis` error code as an error for the same issue was already being thrown by an included upstream sniff. + +### Fixed +- The `WordPress.CodeAnalysis.EmptyStatement` would throw a false positive for an empty condition in a `for()` statement. +- The `Sniff::is_class_property()` method could, in certain circumstances, incorrectly recognize parameters in a method declaration as class properties. It would also, incorrectly, fail to recognize class properties when the object they are declared in, was nested in parentheses. + This affected, amongst others, the `GlobalVariablesOverride` sniff. +- The `Sniff::get_declared_namespace_name()` method could get confused over whitespace and comments within a namespace name, which could lead to incorrect results (mostly underreporting). + This affected, amongst others, the `GlobalVariablesOverride` sniff. + The return value of the method will now no longer contain any whitespace or comments encountered. +- The `Sniff::has_whitelist_comment()` method would sometimes incorrectly regard `// phpcs:set` comments as whitelist comments. + +## [1.1.0] - 2018-09-10 + +### Added +- New `WordPress.PHP.NoSilencedErrors` sniff. This sniff replaces the `Generic.PHP.NoSilencedErrors` sniff which was previously used and included in the `WordPress-Core` ruleset. + The WordPress specific version of the sniff differs from the PHPCS version in that it: + * Allows the error control operator `@` if it preceeds a function call to a limited list of PHP functions for which no amount of error checking can prevent a PHP warning from being thrown. + * Allows for a used-defined list of (additional) function names to be passed to the sniff via the `custom_whitelist` property in a custom ruleset, for which - if the error control operator is detected in front of a function call to one of the functions in this whitelist - no warnings will be thrown. + * Displays a brief snippet of code in the `warning` message text to show the context in which the error control operator is being used. The length of the snippet (in tokens) can be customized via the `context_length` property. + * Contains a public `use_default_whitelist` property which can be set from a custom ruleset which regulates whether or not the standard whitelist of PHP functions should be used by the sniff. + The user-defined whitelist will always be respected. + By default, this property is set to `true` for the `WordPress-Core` ruleset and to `false` for the `WordPress-Extra` ruleset (which is stricter regarding these kind of best practices). +- Metrics to the `WordPress.NamingConventions.PrefixAllGlobals` sniff to aid people in determining the most commonly used prefix in a legacy project. + For an example of how to use this feature, please see the detailed explanation in the [pull request](https://github.com/WordPress/WordPress-Coding-Standards/pull/1437). + +### Changed +- The `PEAR.Functions.FunctionCallSignature` sniff, which is part of the `WordPress-Core` ruleset, used to allow multiple function call parameters per line in multi-line function calls. This will no longer be allowed. + As of this release, if a function call is multi-line, each parameter should start on a new line and an `error` will be thrown if the code being analysed does not comply with that rule. + The sniff behaviour for single-line function calls is not affected by this change. +- Moved the `WordPress.CodeAnalysis.EmptyStatement` sniff from the `WordPress-Extra` to the `WordPress-Core` ruleset. +- Moved the `Squiz.PHP.CommentedOutCode` sniff from the `WordPress-Docs` to the `WordPress-Extra` ruleset and lowered the threshold for determining whether or not a comment is commented out code from 45% to 40%. +- The `WordPress.NamingConventions.PrefixAllGlobals` sniff now has improved support for recognizing whether or not (non-prefixed) globals are declared in the context of unit tests. +- The `is_foreach_as()` method has been moved from the `GlobalVariablesOverrideSniff` class to the WordPress `Sniff` base class. +- The `Sniff::is_token_in_test_method()` utility method now has improved support for recognizing test methods in anonymous classes. +- Minor efficiency improvement to the `Sniff::is_safe_casted()` method. +- CI: Minor tweaks to the Travis script. +- CI: Improved Composer scripts for use by WPCS developers. +- Dev: Removed IDE specific files from `.gitignore`. +- Readme: Improved the documentation about the project history and the badge display. + +### Fixed +- The `WordPress.Security.ValidatedSanitizedInput` sniff will now recognize array keys in superglobals independently of the string quote-style used for the array key. +- The `WordPress.WhiteSpace.PrecisionAlignment` sniff will no longer throw false positives for DocBlocks for JavaScript functions within inline HTML. +- `WordPress.WP.DeprecatedClasses`: The error codes for this sniff were unstable as they were based on the code being analysed instead of on fixed values. +- Various bugfixes for the `WordPress.WP.GlobalVariablesOverride` sniff: + - Previously, the sniff only checked variables in the global namespace when a `global` statement would be encountered. As of now, all variable assignments in the global namespace will be checked. + - Nested functions/closures/classes which don't import the global variable will now be skipped over when encountered within another function, preventing false positives. + - Parameters in function declarations will no longer throw false positives. + - The error message for assignments to a subkey of the `$GLOBALS` superglobal has been improved. + - Various efficiency improvements. +- The `Sniff::is_in_isset_or_empty()` method presumed the WordPress coding style regarding code layout, which could lead to incorrect results (mostly underreporting). + This affected, amongst others, the `WordPress.Security.ValidatedSanitizedInput` sniff. +- Broken links in the inline developer documentation. + + +## [1.0.0] - 2018-07-25 + +### Important information about this release: + +If you use the WordPress Coding Standards with a custom ruleset, please be aware that a number of sniffs have been moved between categories and that the old sniff names have been deprecated. +If you selectively include any of these sniffs in your custom ruleset or set custom property values for these sniffs, your custom ruleset will need to be updated. + +The `WordPress-VIP` ruleset has also been deprecated. If you used that ruleset to check your theme/plugin for hosting on the WordPress.com VIP platform, please use the [Automattic VIP coding standards](https://github.com/Automattic/VIP-Coding-Standards) instead. +If you used that ruleset for any other reason, you should probably use the `WordPress-Extra` or `WordPress` ruleset instead. + +These and some related changes have been annotated in detail in the `Deprecated` section of this changelog. + +Please read the complete changelog carefully before you upgrade. + +If you are a maintainer of an external standard based on WPCS and any of your custom sniffs are based on or extend WPCS sniffs, the same applies. + +### Added +- `WordPress.PHP.PregQuoteDelimiter` sniff to the `WordPress-Extra` ruleset to warn about calls to `preg_quote()` which don't pass the `$delimiter` parameter. +- `WordPress.Security.SafeRedirect` sniff to the `WordPress-Extra` ruleset to warn about potential open redirect vulnerabilities. +- `WordPress.WP.DeprecatedParameterValues` sniff to the `WordPress-Extra` ruleset to detect deprecated parameter values being passed to select functions. +- `WordPress.WP.EnqueuedResourceParameters` sniff to the `WordPress-Extra` ruleset to detect: + - Calls to the script/style register/enqueue functions which don't pass a `$version` for the script/style, which can cause issues with browser caching; and/or + - Calls to the register/enqueue script functions which don't pass the `$in_footer` parameter, which causes scripts - by default - to be loaded in the HTML header in a layout rendering blocking manner. +- Detection of calls to `strip_tags()` and various PHP native `..rand()` functions to the `WordPress.WP.AlternativeFunctions` sniff. +- `readonly()` to the list of auto-escaped functions `Sniff::$autoEscapedFunctions`. This affects the `WordPress.Security.EscapeOutput` sniff. +- The `WordPress.Security.PluginMenuSlug`, `WordPress.WP.CronInterval`, `WordPress.WP.PostsPerPage` and `WordPress.WP.TimezoneChange` sniffs are now included in the `WordPress-Extra` ruleset. Previously, they were already included in the `WordPress` and `WordPress-VIP` rulesets. +- New utility method `Sniff::is_use_of_global_constant()`. +- A rationale to the package suggestion made via `composer.json`. +- CI: Validation of the `composer.json` file on each build. +- A wiki page with instructions on how to [set up WordPressCS to run with Eclipse on XAMPP](https://github.com/WordPress/WordPress-Coding-Standards/wiki/How-to-use-WordPressCS-with-Eclipse-and-XAMPP). +- Readme: A link to an external resource with more examples for setting up PHPCS for CI. +- Readme: A badge-based quick overview of the project. + +### Changed +- The `WordPress` ruleset no longer includes the `WordPress-VIP` ruleset, nor does it include any of the (deprecated) `VIP` sniffs anymore. +- The following sniffs have been moved to a new category: + - `CronInterval` from the `VIP` category to the `WP` category. + - `DirectDatabaseQuery` from the `VIP` category to the `DB` category. + - `DontExtract` from the `Functions` category to the `PHP` category. + - `EscapeOutput` from the `XSS` category to the `Security` category. + - `GlobalVariables` from the `Variables` category to the `WP` category. + - `NonceVerification` from the `CSRF` category to the `Security` category. + - `PluginMenuSlug` from the `VIP` category to the `Security` category. + - `PreparedSQL` from the `WP` category to the `DB` category. + - `SlowDBQuery` from the `VIP` category to the `DB` category. + - `TimezoneChange` from the `VIP` category to the `WP` category. + - `ValidatedSanitizedInput` from the `VIP` category to the `Security` category. +- The `WordPress.VIP.PostsPerPage` sniff has been split into two distinct sniffs: + - `WordPress.WP.PostsPerPage` which will check for the use of a high pagination limit and will throw a `warning` when this is encountered. For the `VIP` ruleset, the error level remains `error`. + - `WordPress.VIP.PostsPerPage` wich will check for disabling of pagination. +- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `4.6`. +- The `WordPress.WP.AlternativeFunctions` sniff will now only throw a warning if/when the recommended alternative function is available in the minimum supported WP version of a project. + In addition to this, certain alternatives are only valid alternatives in certain circumstances, like when the WP version only supports the first parameter of the PHP function it is trying to replace. + This will now be taken into account for: + - `wp_strip_all_tags()` is only a valid alternative for the PHP native `strip_tags()` when the second parameter `$allowed_tags` has not been passed. + - `wp_parse_url()` only added support for the second parameter `$component` of the PHP native `parse_url()` function in WP 4.7.0. +- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 4.9. +- The `WordPress.WP.GlobalVariablesOverride` sniff will now display the name of the variable being overridden in the error message. +- The `WordPress.WP.I18n` sniff now extends the `AbstractFunctionRestrictionSniff`. +- Assignments in conditions in ternaries as detected by the `WordPress.CodeAnalysis.AssignmentInCondition` sniff will now be reported under a separate error code `FoundInTernaryCondition`. +- The default error level for the notices from the `WordPress.DB.DirectDatabaseQuery` sniff has been lowered from `error` to `warning`. For the `VIP` ruleset, the error level remains `error`. +- The default error level for the notices from the `WordPress.Security.PluginMenuSlug` sniff has been lowered from `error` to `warning`. For the `VIP` ruleset, the error level remains `error`. +- The default error level for the notices from the `WordPress.WP.CronInterval` sniff has been lowered from `error` to `warning`. For the `VIP` ruleset, the error level remains `error`. +- The `Sniff::get_function_call_parameters()` utility method now has improved handling of closures when passed as function call parameters. +- Rulesets: a number of error codes were previously silenced by explicitly `exclude`-ing them. Now, they will be silenced by setting the `severity` to `0` which makes it more easily discoverable for maintainers of custom rulesets how to enable these error codes again. +- Various performance optimizations which should most notably make a difference when running WPCS on PHP 7. +- References to the WordPress.com VIP platform have been clarified. +- Unit Tests: custom properties set in unit test files are reset after use. +- Various improvements to the ruleset used by the WPCS project itself and minor code clean up related to this. +- CI: Each change will now also be tested against the lowest supported PHPCS 3 version. +- CI: Each change will now also be checked for PHP cross-version compatibility. +- CI: The rulesets will now also be tested on each change to ensure no unexpected messages are thrown. +- CI: Minor changes to the script to make the build testing faster. +- Updated the [custom ruleset example](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample) for the changes contained in this release and to reflect current best practices regarding the PHPCompatibility standard. +- The instructions on how to set up WPCS for various IDEs have been moved from the `README` to the [wiki](https://github.com/WordPress/WordPress-Coding-Standards/wiki). +- Updated output examples in `README.md` and `CONTRIBUTING.md` and other minor changes to these files. +- Updated references to the PHPCompatibility standard to reflect its new location and recommend using PHPCompatibilityWP. + +### Deprecated +- The `WordPress-VIP` ruleset has been deprecated. + For checking a theme/plugin for hosting on the WordPress.com VIP platform, please use the [Automattic VIP coding standards](https://github.com/Automattic/VIP-Coding-Standards) instead. + If you used the `WordPress-VIP` ruleset for any other reason, you should probably use the `WordPress-Extra` or `WordPress` ruleset instead. +- The following sniffs have been deprecated and will be removed in WPCS 2.0.0: + - `WordPress.CSRF.NonceVerification` - use `WordPress.Security.NonceVerification` instead. + - `WordPress.Functions.DontExtract` - use `WordPress.PHP.DontExtract` instead. + - `WordPress.Variables.GlobalVariables` - use `WordPress.WP.GlobalVariablesOverride` instead. + - `WordPress.VIP.CronInterval` - use `WordPress.WP.CronInterval` instead. + - `WordPress.VIP.DirectDatabaseQuery` - use `WordPress.DB.DirectDatabaseQuery` instead. + - `WordPress.VIP.PluginMenuSlug` - use `WordPress.Security.PluginMenuSlug` instead. + - `WordPress.VIP.SlowDBQuery` - use `WordPress.DB.SlowDBQuery` instead. + - `WordPress.VIP.TimezoneChange` - use `WordPress.WP.TimezoneChange` instead. + - `WordPress.VIP.ValidatedSanitizedInput` - use `WordPress.Security.ValidatedSanitizedInput` instead. + - `WordPress.WP.PreparedSQL` - use `WordPress.DB.PreparedSQL` instead. + - `WordPress.XSS.EscapeOutput` - use `WordPress.Security.EscapeOutput` instead. + - `WordPress.VIP.AdminBarRemoval` without replacement. + - `WordPress.VIP.FileSystemWritesDisallow` without replacement. + - `WordPress.VIP.OrderByRand` without replacement. + - `WordPress.VIP.RestrictedFunctions` without replacement. + - `WordPress.VIP.RestrictedVariables` without replacement. + - `WordPress.VIP.SessionFunctionsUsage` without replacement. + - `WordPress.VIP.SessionVariableUsage` without replacement. + - `WordPress.VIP.SuperGlobalInputUsage` without replacement. +- The following sniff categories have been deprecated and will be removed in WPCS 2.0.0: + - `CSRF` + - `Variables` + - `XSS` +- The `posts_per_page` property in the `WordPress.VIP.PostsPerPage` sniff has been deprecated as the related functionality has been moved to the `WordPress.WP.PostsPerPage` sniff. + See [WP PostsPerPage: post limit](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#wp-postsperpage-post-limit) for more information about this property. +- The `exclude` property which is available to most sniffs which extend the `AbstractArrayAssignmentRestrictions`, `AbstractFunctionRestrictions` and `AbstractVariableRestrictions` classes or any of their children, used to be a `string` property and expected a comma-delimited list of groups to exclude. + The type of the property has now been changed to `array`. Custom rulesets which pass this property need to be adjusted to reflect this change. + Support for passing the property as a comma-delimited string has been deprecated and will be removed in WPCS 2.0.0. + See [Excluding a group of checks](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#excluding-a-group-of-checks) for more information about the sniffs affected by this change. +- The `AbstractVariableRestrictionsSniff` class has been deprecated as all sniffs depending on this class have been deprecated. Unless a new sniff is created in the near future which uses this class, the abstract class will be removed in WPCS 2.0.0. +- The `Sniff::has_html_open_tag()` utility method has been deprecated as it is now only used by deprecated sniffs. The method will be removed in WPCS 2.0.0. + +### Removed +- `cancel_comment_reply_link()`, `get_bookmark()`, `get_comment_date()`, `get_comment_time()`, `get_template_part()`, `has_post_thumbnail()`, `is_attachement()`, `post_password_required()` and `wp_attachment_is_image()` from the list of auto-escaped functions `Sniff::$autoEscapedFunctions`. This affects the `WordPress.Security.EscapeOutput` sniff. +- WPCS no longer explicitly supports HHVM and builds are no longer tested against HHVM. + For now, running WPCS on HHVM to test PHP code may still work for a little while, but HHVM has announced they are [dropping PHP support](https://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html). + +### Fixed +- Compatibility with PHP 7.3. A change in PHP 7.3 was causing the `WordPress.DB.RestrictedClasses`, `WordPress.DB.RestrictedFunctions` and the `WordPress.WP.AlternativeFunctions` sniffs to fail to correctly detect issues. +- Compatibility with the latest releases from [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer). + PHPCS 3.2.0 introduced new annotations which can be used inline to selectively disable/ignore certain sniffs. + **Note**: The initial implementation of the new annotations was buggy. If you intend to start using these new style annotations, you are strongly advised to use PHPCS 3.3.0 or higher. + For more information about these annotations, please refer to the [PHPCS Wiki](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file). + - The [WPCS native whitelist comments](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors) can now be combined with the new style PHPCS whitelist annotations in the `-- for reasons` part of the annotation. + - `WordPress.Arrays.ArrayDeclarationSpacing`: the fixer will now handle the new style annotations correctly. + - `WordPress.Arrays.CommaAfterArrayItem`: prevent a fixer loop when new style annotations are encountered. + - `WordPress.Files.FileName`: respect the new style annotations if these would selectively disable this sniff. + - `WordPress.WhiteSpace.ControlStructureSpacing`: handle the new style annotations correctly for the "blank line at the start/end of control structure" checks and prevent a fixer conflict when the new style annotations are encountered. + - `WordPress.WhiteSpace.PrecisionAlignment`: allow for checking of for precision alignment on lines containing new style annotations when `phpcs` is run with `--ignore-annotations`. +- The `Sniff::is_test_class()` method now has improved recognition of namespaced test classes. + This positively affects the `WordPress.Files.FileName`, `WordPress.NamingConventions.PrefixAllGlobals` and `WordPress.WP.GlobalVariablesOverride` sniffs, which each allow for test classes to (partially) not comply with the rules these sniffs check for. + This fixes the following bugs: + - Namespaced classes where the classname was one of the whitelisted global classes would incorrectly be recognized as a test class, even though they were not the same class. + This also happened if a namespaced class `extend`ed one of the whitelisted global classes. + - A namespaced custom test class where the name was split between the namespace declaration and the extended class declaration was not correctly recognized as the whitelisted test class. + - A namespaced test class which extended another class using a FQCN prefixed with a `\\` would not be correctly recognized. + - The `custom_test_class_whitelist` property which is available for each of these sniffs expects to be passed a Fully Qualified Class Name. FQCNs prefixed with a global namespace indicator will now be correctly handled. +- The determination of whether a `T_STRING` is a function call or not has been improved in the `AbstractFunctionRestrictions` class. This improvement benefits all sniffs which extend this abstract and any of its children (> 10 sniffs) and fixes the following false positives: + - Class declarations will no longer be confused with function calls. + - Use statement alias declarations will no longer be confused with function calls. +- Various bugs in the `WordPress.Arrays.ArrayIndentation` sniff: + - The sniff will no longer throw false positives or try to fix multi-line text strings where the closing quote is on a line by itself. + - The sniff would go into a fixer loop when it encountered a multi-line trailing comment after an array item. +- The `WordPress.CodeAnalysis.AssignmentInCondition` was throwing false positives for ternaries in nested, but unrelated, parentheses. +- The `WordPress.CodeAnalysis.EmptyStatement` and `WordPress.Files.FileName` sniffs underreported as they did not take PHP short open echo tags into account. +- Various bugs in the `WordPress.NamingConventions.PrefixAllGlobals` sniff: + - Parameters in a closure declaration were incorrectly being regarded as global variables. + - Non-prefixed variables created by a `foreach()` construct in the global namespace were previously not detected. + - Non-prefixed globals found in namespaced test classes should be ignored by the sniff, but were not. + - Definition of non-prefixed global WP constants which are intended to be overruled, should not trigger an error from this sniff. + - The sniff presumed the WP naming conventions for PHP constructs, while it should check for the construct being prefixed regardless of whether camelCase, PascalCase, snake_case or other naming conventions are used. + - The sniff presumed the WP naming conventions for prefixes used in hook names. The sniff will now be more tolerant when non-conventional word separators are used in prefixes for hooks. +- The `WordPress.NamingConventions.ValidFunctionName` sniff no longer "hides" one message behind another. The sniff will now correctly throw a message about function names not being in `snake_case`, even when the `FunctionDoubleUnderscore` or `MethodDoubleUnderscore` error codes have been excluded. +- The `WordPress.PHP.StrictInArray` sniff will no longer throw an error when `in_array`, `array_search` or `array_keys` are used in a file `use` statement. +- Various bugs in the `WordPress.Security.EscapeOutput` sniff: + - A limited list of native PHP constants which are safe to use, such as `PHP_EOL`, has been added. When any of these constants are encountered, the sniff will no longer demand output escaping for them. + - The sniff was underreporting issues with variables passed to `trigger_error()`. + - While reporting an issue, sometimes the wrong error message was used. The sniff logic has been adjusted to prevent this. + - The sniff will now correctly ignore the open and close brackets of short arrays. + - The sniff would throw false positives when `echo`, `print`, `exit` or `die` were encountered as constants, function or class names. While it may not be a good idea to use PHP keywords in such a way, it is allowed, so the sniff should handle this correctly. +- The `WordPress.WhiteSpace.ControlStructureSpacing` sniff would inadvertently throw an error for the spacing around the colon for a return type in a function declaration. +- The `WordPress.WP.AlternativeFunctions` sniff used to flag all function calls to `file_get_contents()` twice, suggesting to use `wp_remote_get()` - which is only applicable for remote URLs - and the `WP_FileSystem` API - which is not needed when just _reading_ local files. These messages contradicted each other. + The sniff will now try to determine whether the file requested is local or remote and will only throw a `warning` suggesting to use `wp_remote_get()`, if a remote URL is being requested or when it could not be determined if the requested file is local or remote. +- The expected default value for `wp_upload_bits()` in the `WordPress.WP.DeprecatedParameters` sniff. +- The `WordPress.WP.GlobalVariablesOverride` sniff previously did not detect variables created by a `foreach()` construct which would override WP global variables. +- Various bugs in the `WordPress.WP.I18n` sniff: + - The sniff will no longer throw false positives for calls to methods carrying the same name as any of the global WP functions being targeted and has improved handling of parse errors and live coding. + - A numeric `0` would throw a false positive for "no translatable content found". +- The fixer in the `WordPress.WhiteSpace.ControlStructureSpacing` sniff will no longer inadvertently remove return type declarations. +- Various bugs in the `WordPress.WhiteSpace.PrecisionAlignment` sniff: + - Inline HTML before the first PHP open tag was not being examined. + - Files which only contained short open echo tags for PHP were not being examined. + - The last line of inline HTML in a file was not being examined. +- Some best practice sniffs presumed the WordPress coding style regarding code layout, which could lead to incorrect results (mostly underreporting). + The following sniffs have received fixes related to this: + - `WordPress.DB.PreparedSQL` + - `WordPress.NamingConventions.ValidVariableName` + - `WordPress.WP.CronInterval` + - `WordPress.WP.I18n` +- Various minor fixes based on visual inspection and Scrutinizer analysis feedback. +- Typo in the instructions contained in `CONTRIBUTING.md`. +- Broken link in the `README.md` file. + + +## [0.14.1] - 2018-02-15 + +### Fixed +- The `WordPress.NamingConventions.PrefixAllGlobals` sniff contained a bug which could inadvertently trigger class autoloading of the project being sniffed and by extension could cause fatal errors during the PHPCS run. + +## [0.14.0] - 2017-11-01 + +### Added +- `WordPress.Arrays.MultipleStatementAlignment` sniff to the `WordPress-Core` ruleset which will align the array assignment operator for multi-item, multi-line associative arrays. + This new sniff offers four custom properties to customize its behaviour: [`ignoreNewlines`](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-allow-for-new-lines), [`exact`](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-allow-non-exact-alignment), [`maxColumn`](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-maximum-column) and [`alignMultilineItems`](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-dealing-with-multi-line-items). +- `WordPress.DB.PreparedSQLPlaceholders` sniff to the `WordPress-Core` ruleset which will analyse the placeholders passed to `$wpdb->prepare()` for their validity, check whether queries using `IN ()` and `LIKE` statements are created correctly and will check whether a correct number of replacements are passed. + This sniff should help detect queries which are impacted by the security fixes to `$wpdb->prepare()` which shipped with WP 4.8.2 and 4.8.3. + The sniff also adds a new ["PreparedSQLPlaceholders replacement count" whitelist comment](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors#preparedsql-placeholders-vs-replacements) for pertinent replacement count vs placeholder mismatches. Please consider carefully whether something could be a bug when you are tempted to use the whitelist comment and if so, [report it](https://github.com/WordPress/WordPress-Coding-Standards/issues/new). +- `WordPress.PHP.DiscourageGoto` sniff to the `WordPress-Core` ruleset. +- `WordPress.PHP.RestrictedFunctions` sniff to the `WordPress-Core` ruleset which initially forbids the use of `create_function()`. + This was previous only discouraged under certain circumstances. +- `WordPress.WhiteSpace.ArbitraryParenthesesSpacing` sniff to the `WordPress-Core` ruleset which checks the spacing on the inside of arbitrary parentheses. +- `WordPress.WhiteSpace.PrecisionAlignment` sniff to the `WordPress-Core` ruleset which will throw a warning when precision alignment is detected in PHP, JS and CSS files. +- `WordPress.WhiteSpace.SemicolonSpacing` sniff to the `WordPress-Core` ruleset which will throw a (fixable) error when whitespace is found before a semi-colon, except for when the semi-colon denotes an empty `for()` condition. +- `WordPress.CodeAnalysis.AssignmentInCondition` sniff to the `WordPress-Extra` ruleset. +- `WordPress.WP.DiscouragedConstants` sniff to the `WordPress-Extra` and `WordPress-VIP` rulesets to detect usage of deprecated WordPress constants, such as `STYLESHEETPATH` and `HEADER_IMAGE`. +- Ability to pass the `minimum_supported_version` to use for the `DeprecatedFunctions`, `DeprecatedClasses` and `DeprecatedParameters` sniff in one go. You can pass a `minimum_supported_wp_version` runtime variable for this [from the command line or pass it using a `config` directive in a custom ruleset](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#setting-minimum-supported-wp-version-for-all-sniffs-in-one-go-wpcs-0140). +- `Generic.Formatting.MultipleStatementAlignment` - customized to have a `maxPadding` of `40` -, `Generic.Functions.FunctionCallArgumentSpacing` and `Squiz.WhiteSpace.ObjectOperatorSpacing` to the `WordPress-Core` ruleset. +- `Squiz.Scope.MethodScope`, `Squiz.Scope.MemberVarScope`, `Squiz.WhiteSpace.ScopeKeywordSpacing`, `PSR2.Methods.MethodDeclaration`, `Generic.Files.OneClassPerFile`, `Generic.Files.OneInterfacePerFile`, `Generic.Files.OneTraitPerFile`, `PEAR.Files.IncludingFile`, `Squiz.WhiteSpace.LanguageConstructSpacing`, `PSR2.Namespaces.NamespaceDeclaration` to the `WordPress-Extra` ruleset. +- The `is_class_constant()`, `is_class_property` and `valid_direct_scope()` utility methods to the `WordPress\Sniff` class. + +### Changed +- When passing an array property via a custom ruleset to PHP_CodeSniffer, spaces around the key/value are taken as intentional and parsed as part of the array key/value. In practice, this leads to confusion and WPCS does not expect any values which could be preceded/followed by a space, so for the WordPress Coding Standard native array properties, like `customAutoEscapedFunction`, `text_domain`, `prefixes`, WPCS will now trim whitespace from the keys/values received before use. +- The WPCS native whitelist comments used to only work when they were put on the _end of the line_ of the code they applied to. As of now, they will also be recognized when they are be put at the _end of the statement_ they apply to. +- The `WordPress.Arrays.ArrayDeclarationSpacing` sniff used to enforce all associative arrays to be multi-line. The handbook has been updated to only require this for multi-item associative arrays and the sniff has been updated accordingly. + [The original behaviour can still be enforced](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#arrays-forcing-single-item-associative-arrays-to-be-multi-line) by setting the new `allow_single_item_single_line_associative_arrays` property to `false` in a custom ruleset. +- The `WordPress.NamingConventions.PrefixAllGlobals` sniff will now allow for a limited list of WP core hooks which are intended to be called by plugins and themes. +- The `WordPress.PHP.DiscouragedFunctions` sniff used to include `create_function`. This check has been moved to the new `WordPress.PHP.RestrictedFunctions` sniff. +- The `WordPress.PHP.StrictInArray` sniff now has a separate error code `FoundNonStrictFalse` for when the `$strict` parameter has been set to `false`. This allows for excluding the warnings for that particular situation, which will normally be intentional, via a custom ruleset. +- The `WordPress.VIP.CronInterval` sniff now allows for customizing the minimum allowed cron interval by [setting a property in a custom ruleset](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#vip-croninterval-minimum-interval). +- The `WordPress.VIP.RestrictedFunctions` sniff used to prohibit the use of certain WP native functions, recommending the use of `wpcom_vip_get_term_link()`, `wpcom_vip_get_term_by()` and `wpcom_vip_get_category_by_slug()` instead, as the WP native functions were not being cached. As the results of the relevant WP native functions are cached as of WP 4.8, the advice has now been reversed i.e. use the WP native functions instead of `wpcom...` functions. +- The `WordPress.VIP.PostsPerPage` sniff now allows for customizing the `post_per_page` limit for which the sniff will trigger by [setting a property in a custom ruleset](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#vip-postsperpage-post-limit). +- The `WordPress.WP.I18n` sniff will now allow and actively encourage omitting the text domain in I18n function calls if the text domain passed via the `text_domain` property is `default`, i.e. the domain used by Core. + When `default` is one of several text domains passed via the `text_domain` property, the error thrown when the domain is missing has been downgraded to a `warning`. +- The `WordPress.XSS.EscapeOutput` sniff now has a separate error code `OutputNotEscapedShortEcho` and the error message texts have been updated. +- Moved `Squiz.PHP.Eval` from the `WordPress-Extra` and `WordPress-VIP` to the `WordPress-Core` ruleset. +- Removed two sniffs from the `WordPress-VIP` ruleset which were already included via the `WordPress-Core` ruleset. +- The unit test suite is now compatible with PHPCS 3.1.0+ and PHPUnit 6.x. +- Some tidying up of the unit test case files. +- All sniffs are now also being tested against PHP 7.2 for consistent sniff results. +- An attempt is made to detect potential fixer conflicts early via a special build test. +- Various minor documentation fixes. +- Improved the Atom setup instructions in the Readme. +- Updated the unit testing information in Contributing. +- Updated the [custom ruleset example](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample) for the changes contained in this release and to make it more explicit what is recommended versus example code. +- The minimum recommended version for the suggested `DealerDirect/phpcodesniffer-composer-installer` Composer plugin has gone up to `0.4.3`. This patch version fixes support for PHP 5.3. + +### Fixed +- The `WordPress.Arrays.ArrayIndentation` sniff did not correctly handle array items with multi-line strings as a value. +- The `WordPress.Arrays.ArrayIndentation` sniff did not correctly handle array items directly after an array item with a trailing comment. +- The `WordPress.Classes.ClassInstantiation` sniff will now correctly handle detection when using `new $array['key']` or `new $array[0]`. +- The `WordPress.NamingConventions.PrefixAllGlobals` sniff did not allow for arbitrary word separators in hook names. +- The `WordPress.NamingConventions.PrefixAllGlobals` sniff did not correctly recognize namespaced constants as prefixed. +- The `WordPress.PHP.StrictInArray` sniff would erronously trigger if the `true` for `$strict` was passed in uppercase. +- The `WordPress.PHP.YodaConditions` sniff could get confused over complex ternaries containing assignments. This has been remedied. +- The `WordPress.WP.PreparedSQL` sniff would erronously throw errors about comments found within a DB function call. +- The `WordPress.WP.PreparedSQL` sniff would erronously throw errors about `(int)`, `(float)` and `(bool)` casts and would also flag the subsequent variable which had been safe casted. +- The `WordPress.XSS.EscapeOutput` sniff would erronously trigger when using a fully qualified function call - including the global namespace `\` indicator - to one of the escaping functions. +- The lists of WP global variables and WP mixed case variables have been synchronized, which fixes some false positives. + + +## [0.13.1] - 2017-08-07 + +### Fixed +- Fatal error when using PHPCS 3.x with the `installed_paths` config variable set via the ruleset. + +## [0.13.0] - 2017-08-03 + +### Added +- Support for PHP_CodeSniffer 3.0.2+. The minimum required PHPCS version (2.9.0) stays the same. +- Support for the PHPCS 3 `--ignore-annotations` command line option. If you pass this option, both PHPCS native `@ignore ...` annotations as well as the WPCS specific [whitelist flags](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors) will be ignored. + +### Changed +- The minimum required PHP version is now 5.3 when used in combination with PHPCS 2.x and PHP 5.4 when used in combination with PHPCS 3.x. +- The way the unit tests can be run is now slightly different for PHPCS 2.x versus 3.x. For more details, please refer to the updated information in the [Contributing Guidelines](CONTRIBUTING.md). +- Release archives will no longer contain the unit tests and other typical development files. You can still get these by using Composer with `--prefer-source` or by checking out a git clone of the repository. +- Various textual improvements to the Readme. +- Various textual improvements to the Contributing Guidelines. +- Minor internal changes. + +### Removed +- The `WordPress.Arrays.ArrayDeclaration` sniff has been deprecated. The last remaining checks this sniff contained have been moved to the `WordPress.Arrays.ArrayDeclarationSpacing` sniff. +- Work-arounds which were in place to support PHP 5.2. + +### Fixed +- A minor bug where the auto-fixer could accidentally remove a comment near an array opener. + + +## [0.12.0] - 2017-07-21 + +### Added +- A default file encoding setting to the `WordPress-Core` ruleset. All files sniffed will now be regarded as `utf-8` by default. +- `WordPress.Arrays.ArrayIndentation` sniff to the `WordPress-Core` ruleset to verify - and auto-fix - the indentation of array items and the array closer for multi-line arrays. This replaces the (partial) indentation fixing contained within the `WordPress.Array.ArrayDeclarationSpacing` sniff. +- `WordPress.Arrays.CommaAfterArrayItem` sniff to the `WordPress-Core` ruleset to enforce that each array item is followed by a comma - except for the last item in a single-line array - and checks the spacing around the comma. This replaces (and improves) the checks which were previously included in the `WordPress.Arrays.ArrayDeclaration` sniff which were causing incorrect fixes and fixer conflicts. +- `WordPress.Functions.FunctionCallSignatureNoParams` sniff to the `WordPress-Core` ruleset to verify that function calls without parameters do not have any whitespace between the parentheses. +- `WordPress.WhiteSpace.DisallowInlineTabs` to the `WordPress-Core` ruleset to verify - and auto-fix - that spaces are used for mid-line alignment. +- `WordPress.WP.CapitalPDangit` sniff to the `WordPress-Core` ruleset to - where relevant - verify that `WordPress` is spelled correctly. For misspellings in text strings and comment text, the sniff can auto-fix violations. +- `Squiz.Classes.SelfMemberReference` whitespace related checks to the `WordPress-Core` ruleset and the additional check for using `self` rather than a FQN to the `WordPress-Extra` ruleset. +- `Squiz.PHP.EmbeddedPhp` sniff to the `WordPress-Core` ruleset to check PHP code embedded within HTML blocks. +- `PSR2.ControlStructures.SwitchDeclaration` to the `WordPress-Core` ruleset to check for the correct layout of `switch` control structures. +- `WordPress.Classes.ClassInstantion` sniff to the `WordPress-Extra` ruleset to detect - and auto-fix - missing parentheses on object instantiation and superfluous whitespace in PHP and JS files. The sniff will also detect `new` being assigned by reference. +- `WordPress.CodeAnalysis.EmptyStatement` sniff to the `WordPress-Extra` ruleset to detect - and auto-fix - superfluous semi-colons and empty PHP open-close tag combinations. +- `WordPress.NamingConventions.PrefixAllGlobals` sniff to the `WordPress-Extra` ruleset to verify that all functions, classes, interfaces, traits, variables, constants and hook names which are declared/defined in the global namespace are prefixed with one of the prefixes provided via a custom property or via the command line. + To activate this sniff, [one or more allowed prefixes should be provided to the sniff](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace). This can be done using a custom ruleset or via the command line. + PHP superglobals and WP global variables are exempt from variable name prefixing. Deprecated hook names will also be disregarded when non-prefixed. Back-fills for known native PHP functionality is also accounted for. + For verified exceptions, [unprefixed code can be whitelisted](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors#non-prefixed-functionclassvariableconstant-in-the-global-namespace). + Code in unit test files is automatically exempt from this sniff. +- `WordPress.WP.DeprecatedClasses` sniff to the `WordPress-Extra` ruleset to detect usage of deprecated WordPress classes. +- `WordPress.WP.DeprecatedParameters` sniff to the `WordPress-Extra` ruleset to detect deprecated parameters being passed to WordPress functions with a value other than the expected default. +- The `sanitize_textarea_field()` function to the `sanitizingFunctions` list used by the `WordPress.CSRF.NonceVerification`, `WordPress.VIP.ValidatedSanitizedInput` and `WordPress.XSS.EscapeOutput` sniffs. +- The `find_array_open_closer()` utility method to the `WordPress_Sniff` class. +- Information about setting `installed_paths` using a custom ruleset to the Readme. +- Additional support links to the `composer.json` file. +- Support for Composer PHPCS plugins which sort out the `installed_paths` setting. +- Linting and code-style check of the XML ruleset files provided by WPCS. + +### Changed +- The minimum required PHP_CodeSniffer version to 2.9.0 (was 2.8.1). **Take note**: PHPCS 3.x is not (yet) supported. The next release is expected to fix that. +- Improved support for detecting issues in code using heredoc and/or nowdoc syntax. +- Improved sniff efficiency, precision and performance for a number of sniffs. +- Updated a few sniffs to take advantage of new features and fixes which are included in PHP_CodeSniffer 2.9.0. +- `WordPress.Files.Filename`: The "file name mirrors the class name prefixed with 'class'" check for PHP files containing a class will no longer be applied to typical unit test classes, i.e. for classes which extend `WP_UnitTestCase`, `PHPUnit_Framework_TestCase` and `PHPUnit\Framework\TestCase`. Additional test case base classes can be passed to the sniff using the new [`custom_test_class_whitelist` property](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#custom-unit-test-classes). +- The `WordPress.Files.FileName` sniff allows now for more theme-specific template hierarchy based file name exceptions. +- The whitelist flag for the `WordPress.VIP.SlowQuery` sniff was `tax_query` which was unintuitive. This has now been changed to `slow query` to be in line with other whitelist flags. +- The `WordPress.WhiteSpace.OperatorSpacing` sniff will now ignore operator spacing within `declare()` statements. +- The `WordPress.WhiteSpace.OperatorSpacing` sniff now extends the upstream `Squiz.WhiteSpace.OperatorSpacing` sniff for improved results and will now also examine the spacing around ternary operators and logical (`&&`, `||`) operators. +- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 4.7 and 4.8. Additionally, a number of other deprecated functions which were previously not being detected have been added to the sniff and for a number of functions the "alternative" for the deprecated function has been added/improved. +- The `WordPress.XSS.EscapeOutput` sniff will now also detect unescaped output when the short open echo tags `` PHP open tags. +- `WordPress.Classes.ClassOpeningStatement` sniff to the `WordPress-Core` ruleset to flag - and fix - class opening brace placement. +- `WordPress.NamingConventions.ValidHookName` sniff to the `WordPress-Core` ruleset to flag filter and action hooks which don't comply with the guideline of lowercase letters and underscores. For maintaining backward-compatibility of hook names an `additionalWordDelimiters` property can be added via a custom ruleset. +- `WordPress.Functions.DontExtract` sniff to the `WordPress-Core` ruleset to flag usage of the `extract()` function. +- `WordPress.PHP.POSIXFunctions` sniff to the `WordPress-Core` ruleset to flag usage of regex functions from the POSIX PHP extension which was deprecated since PHP 5.3 and removed in PHP 7. +- `WordPress.DB.RestrictedFunctions` and `WordPress.DB.RestrictedClasses` sniffs to the `WordPress-Core` ruleset to flag usage of direct database calls using PHP functions and classes rather than the WP functions for the same. +- Abstract `AbstractClassRestrictions` parent class to allow for easier sniffing for usage of specific classes. +- `Squiz.Strings.ConcatenationSpacing`, `PSR2.ControlStructures.ElseIfDeclaration`, `PSR2.Files.ClosingTag`, `Generic.NamingConventions.UpperCaseConstantName` to the `WordPress-Core` ruleset. +- Ability to add arbitrary variables to the whitelist via a custom ruleset property for the `WordPress.NamingConventions.ValidVariableName` sniff. +- Ability to use a whitelist comment for tax queries for the `WordPress.VIP.SlowDBQuery` sniff. +- Instructions on how to use WPCS with Atom and SublimeLinter to the Readme. +- Reference to the [wiki](https://github.com/WordPress/WordPress-Coding-Standards/wiki) to the Readme. +- Recommendation to also use the [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) ruleset to the Readme. + +### Changed +- The minimum required PHP_CodeSniffer version to 2.6.0. +- Moved the `WordPress.WP.PreparedSQL` sniff from `WordPress-Extra` to `WordPress-Core`. +- `WordPress.PHP.StrictInArray` will now also flag non-strict usage of `array_keys()` and `array_search()`. +- Added `_deprecated_constructor()` and `_deprecated_hook()` to the list of printing functions. +- Added numerous additional functions to sniff for to the `WordPress.VIP.RestrictedFunctions` sniff as per the VIP guidelines. +- Upped the `posts_per_page` limit from 50 to 100 in `WordPress.VIP.PostsPerPage` sniff as per the VIP guidelines. +- Added `cat_ID` to the whitelisted exceptions for the `WordPress.NamingConventions.ValidVariableName` sniff. +- Added `__debugInfo` to the magic method whitelist for class methods starting with double underscore in the `WordPress.NamingConventions.ValidFunctionName` sniff. +- An error will now also be thrown for non-magic _functions_ using a double underscore prefix - `WordPress.NamingConventions.ValidFunctionName` sniff. +- The `WordPress.Arrays.ArrayAssignmentRestrictions`, `WordPress.Functions.FunctionRestrictions`, `WordPress.Variables.VariableRestrictions` sniffs weren't in actual fact sniffs, but parent classes for child sniffs. These have now all been turned into proper abstract parent classes and moved to the main `WordPress` directory. +- The array provided to `AbstractFunctionRestrictions` can now take a `whitelist` key to whitelist select functions when blocking a group of functions by function prefix. +- Updated installation instructions in the readme. +- The `WordPress-Core` ruleset is now ordered according to the handbook +- The WPCS code base itself now complies with the WordPress-Core, -Extra and -Docs coding standards. +- Various other code quality and code consistency improvements under the hood. + +### Removed +- `Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose` from the `WordPress-Core` standard (was causing duplicate messages for the same issue). +- `Squiz.Commenting.FunctionComment.ScalarTypeHintMissing`, `Squiz.Commenting.InlineComment.NotCapital` from the `WordPress-Docs` standard. +- Removed the sniffing for `get_pages()` from the `WordPress.VIP.RestrictedFunctions` sniff as per the VIP guidelines. +- Removed the sniffing for `extract()` from the `WordPress.VIP.RestrictedFunctions` sniff as it's now covered in a separate sniff. +- Removed the sniffing for the POSIX functions from the `WordPress.PHP.DiscouragedFunctions` sniff as it's now covered in a separate sniff. + +### Fixed +- Error message precision for the `WordPress.NamingConventions.ValidVariableName` sniff. +- Bug in the `WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd` sniff which was incorrectly being triggered on last method of class. +- Function name sniffs based on the `AbstractFunctionRestrictions` parent class will now do a case-insensitive function name comparison. +- Function name sniffs in the `WordPress.PHP.DiscouragedFunctions` sniff will now do a case-insensitive function name comparison. +- Whitelist comments directly followed by a PHP closing tag were not being recognized. +- Some PHP Magic constants were not recognized by the `WordPress.XSS.EscapeOutput` sniff. +- An error message suggesting camel caps rather than the intended snake case format in the `WordPress.NamingConventions.ValidFunctionName` sniff. +- `WordPress.WhiteSpace.ControlStructureSpacing` should no longer throw error notices during live code review. +- Errors will be no longer be thrown for methods not complying with the naming conventions when the class extends a parent class or implements an interface - `WordPress.NamingConventions.ValidFunctionName` sniff. + + +## [0.9.0] - 2016-02-01 + +### Added +- `count()` to the list of auto-escaped functions. +- `Squiz.PHP.CommentedOutCode` sniff to `WordPress-VIP` ruleset. +- Support for PHP 5.2. +- `attachment_url_to_postid()` and `parse_url()` to the restricted functions for `WordPress-VIP`. +- `WordPress.VIP.OrderByRand` sniff. +- `WordPress.PHP.StrictInArray` sniff for `WordPress-VIP` and `WordPress-Extra`. +- `get_tag_link()`, `get_category_link()`, `get_cat_ID()`, `url_to_post_id()`, `attachment_url_to_postid()` +`get_posts()`, `wp_get_recent_posts()`, `get_pages()`, `get_children()`, `wp_get_post_terms()` +`wp_get_post_categories()`, `wp_get_post_tags()`, `wp_get_object_terms()`, `term_exists()`, +`count_user_posts()`, `wp_old_slug_redirect()`, `get_adjacent_post()`, `get_previous_post()`, +`get_next_post()` to uncached functions in `WordPress.VIP.RestrictedFunctions` sniff. +- `wp_handle_upload()` and `array_key_exists()` to the list of sanitizing functions. +- Checking for object properties in `WordPress.PHP.YodaConditions` sniff. +- `WordPress.NamingConventions.ValidVariableName` sniff. +- Flagging of function calls incorporated into database queries in `WordPress.WP.PreparedSQL`. +- Recognition of escaping and auto-escaped functions in `WordPress.WP.PreparedSQL`. +- `true`, `false`, and `null` to the tokens ignored in `WordPress.XSS.EscapeOutput`. + +### Fixed +- Incorrect ternary detection in `WordPress.XSS.EscapeOutput` sniff. +- False positives when detecting variables interpolated into strings in the +`WordPress.WP.PreparedSQL` and `WordPress.VIP.ValidatedSanitizedInput` sniffs. +- False positives in `WordPress.PHP.YodaConditions` when the variable is being casted. +- `$wpdb` properties being flagged in `WordPress.WP.PreparedSQL` sniff. +- False positive in `WordPress.PHP.YodaConditions` when the a string is on the left side of the +comparison. + +## [0.8.0] - 2015-10-02 + +### Added +- `implode()` and `join()` to the list of formatting functions in the `WordPress.XSS.EscapeOutput` +sniff. This is useful when you need to have HTML in the `$glue` parameter. +- Support in the `WordPress.XSS.EscapeOutput` sniff for escaping an array of values +using `array_map()`. (Otherwise the support for `implode()` isn't of much use :) +- Docs for running WPCS in Sublime Text. +- `nl2br()` to the list of formatting functions. +- `wp_dropdown_pages()` to the list of printing functions. +- Error codes to all error/warning messages. +- `WordPress.WP.PreparedSQL` sniff for flagging unprepared SQL queries. + +### Removed +- Sniffing for the number of spaces before a closure's opening parenthesis from the +default configuration of the `WordPress.WhiteSpace.ControlStructureSpacing` sniff. It +can be re-enabled per-project as desired. + +### Fixed +- The `WordPress.XSS.EscapeOutput` sniff giving error messages with the closing +parenthesis in them instead of the offending function's name. + +## [0.7.1] - 2015-08-31 + +### Changed +- The default number of spaces before a closure's opening parenthesis from 1 to 0. + +## [0.7.0] - 2015-08-30 + +### Added +- Automatic error fixing to the `WordPress.Arrays.ArrayKeySpacingRestrictions` sniff. +- Functions and closures to the control structures checked by the `WordPress.WhiteSpace.ControlStructureSpacing` +sniff. +- Sniffing and fixing for extra spacing in the `WordPress.WhiteSpace.ControlStructureSpacing` +sniff. (Previously it only checked for insufficient spacing.) +- `.twig` files to the default ignored files. +- `esc_url_raw()` and `hash_equals()` to the list of sanitizing functions. +- `intval()` and `boolval()` to list of unslashing functions. +- `do_shortcode()` to the list of auto-escaped functions. + +### Removed +- `WordPress.Functions.FunctionDeclarationArgumentSpacing` in favor of the upstream +sniff `Squiz.Functions.FunctionDeclarationArgumentSpacing`. + +### Fixed +- Reference to incorrect issue in the inline docs of the `WordPress.VIP.SessionVariableUsage` +sniff. +- `WordPress.XSS.EscapeOutput` sniff incorrectly handling ternary conditions in +`echo` statements without parentheses in some cases. + +## [0.6.0] - 2015-06-30 + +### Added +- Support for `wp_cache_add()` and `wp_cache_delete()`, as well as custom cache +functions,in the `WordPress.VIP.DirectDatabaseQuery` sniff. + +### Removed +- `WordPress.Functions.FunctionRestrictions` and `WordPress.Variables.VariableRestrictions` +from the `WordPress-VIP` standard, since they are just parents for other sniffs. + +## [0.5.0] - 2015-06-01 + +### Added +- `WordPress.CSRF.NonceVerification` sniff to flag form processing without nonce verification. +- `in_array()` and `is_array()` to the list of sanitizing functions. +- Support for automatic error fixing to the `WordPress.Arrays.ArrayDeclaration` sniff. +- `WordPress.PHP.StrictComparisions` to the `WordPress-VIP` and `WordPress-Extra` rulesets. +- `WordPress-Docs` ruleset to sniff for proper commenting. +- `Generic.PHP.LowerCaseKeyword`, `Generic.Files.EndFileNewline`, `Generic.Files.LowercasedFilename`, +`Generic.Formatting.SpaceAfterCast`, and `Generic.Functions.OpeningFunctionBraceKernighanRitchie` to the `WordPress-Core` ruleset. +- `Generic.PHP.DeprecatedFunctions`, `Generic.PHP.ForbiddenFunctions`, `Generic.Functions.CallTimePassByReference`, +`Generic.Formatting.DisallowMultipleStatements`, `Generic.CodeAnalysis.EmptyStatement`, +`Generic.CodeAnalysis.ForLoopShouldBeWhileLoop`, `Generic.CodeAnalysis.ForLoopWithTestFunctionCall`, +`Generic.CodeAnalysis.JumbledIncrementer`, `Generic.CodeAnalysis.UnconditionalIfStatement`, +`Generic.CodeAnalysis.UnnecessaryFinalModifier`, `Generic.CodeAnalysis.UselessOverridingMethod`, +`Generic.Classes.DuplicateClassName`, and `Generic.Strings.UnnecessaryStringConcat` to the `WordPress-Extra` ruleset. +- Error for missing use of `wp_unslash()` on superglobal data to the `WordPress.VIP.ValidatedSanitizedInput` sniff. + +### Changed +- The `WordPress.VIP.ValidatedSanitizedInput` sniff to require sanitization of input even when it is being directly escaped and output. +- The minimum required PHP_CodeSniffer version to 2.2.0. +- The `WordPress.VIP.ValidatedSanitizedInput` and `WordPress.XSS.EscapeOutput` sniffs: +the list of escaping functions was split from the list of sanitizing functions. The `customSanitizingFunctions` +property has been moved to the `ValidatedSanitizedInput` sniff, and the `customEscapingFunctions` +property should now be used instead for the `EscapeOutput` sniff. +- The `WordPress.Arrays.ArrayDeclaration` sniff to give errors for `NoSpaceAfterOpenParenthesis`, `SpaceAfterArrayOpener`, and `SpaceAfterArrayCloser`, instead of warnings. +- The `WordPress.NamingConventions.ValidFunctionName` sniff to allow camelCase method names in classes that implement interfaces. + +### Fixed +- The `WordPress.VIP.ValidatedSanitizedInput` sniff not reporting missing validation when reporting missing sanitization. +- The `WordPress.VIP.ValidatedSanitizedInput` sniff flagging superglobals as needing sanitization when they were only being used in a comparison using `if` or `switch`, etc. + +## [0.4.0] - 2015-05-01 + +### Added +- Change log file. +- Handling for string-interpolated input variables in the `WordPress.VIP.ValidatedSanitizedInput` sniff. +- Errors for using uncached functions when cached equivalents exist. +- `space_before_colon` setting for the `WordPress.WhiteSpace.ControlStructureSpacing` sniff, for control structures using alternative syntax. Possible values: `'required'`, `'optional'`, `'forbidden'`. +- Support for `sanitization` whitelisting comments for the `WordPress.VIP.ValidatedSanitizedInput` sniff. +- Granular error/warning names for all errors and warnings. +- Handling for ternary conditions in the `WordPress.XSS.EscapeOutput` sniff. +- `die`, `exit`, `printf`, `vprintf`, `wp_die`, `_deprecated_argument`, `_deprecated_function`, `_deprecated_file`, `_doing_it_wrong`, `trigger_error`, and `user_error` to the list of printing functions in the `WordPress.XSS.EscapeOutput` sniff. +- `customPrintingFunctions` setting for the `WordPress.XSS.EscapeOutput` sniff. +- `rawurlencode()` and `wp_parse_id_list()` to the list of "sanitizing" functions in the `WordPress.XSS.EscapeOutput` sniff. +- `json_encode()` to the list of discouraged functions in the `WordPress.PHP.DiscouragedFunctions` sniff, in favor of `wp_json_encode()`. +- `vip_powered_wpcom()` to the list of auto-escaped functions in the `WordPress.XSS.EscapeOutput` sniff. +- `debug_print_backtrace()` and `var_export()` to the list of discouraged functions in the `WordPress.PHP.DiscouragedFunctions` sniff. +- Smart handling for formatting functions (`sprintf()` and `wp_sprintf()`) in the `WordPress.XSS.EscapeOutput` sniff. +- `WordPress.PHP.StrictComparisons` sniff. +- Correct handling of `array_map()` in the `WordPress.VIP.ValidatedSanitizedInput` sniff. +- `$_COOKIE` and `$_FILE` to the list of superglobals flagged by the `WordPress.VIP.ValidatedSanitizedInput` and `WordPress.VIP.SuperGlobalInputUsage` sniffs. +- `$_SERVER` to the list of superglobals flagged by the `WordPress.VIP.SuperGlobalInputUsage` sniff. +- `Squiz.ControlStructures.ControlSignature` sniff to the rulesets. + +### Changed +- `WordPress.Arrays.ArrayKeySpacingRestrictions` sniff to give errors for `NoSpacesAroundArrayKeys` and `SpacesAroundArrayKeys` instead of just warnings. +- `WordPress.NamingConventions.ValidFunctionName` sniff to allow for camel caps method names in child classes. +- `WordPress.XSS.EscapeOutput` sniff to allow for integers (e.g. `echo 5` and `print( -1 )`). + +### Removed +- Errors for mixed key/keyless array elements in the `WordPress.Arrays.ArrayDeclaration` sniff. +- BOM from `WordPress.WhiteSpace.OperatorSpacing` sniff file. +- `$content_width` from the list of non-overwritable globals in the `WordPress.Variables.GlobalVariables` sniff. +- `WordPress.Arrays.ArrayAssignmentRestrictions` sniff from the `WordPress-VIP` ruleset. + +### Fixed +- Incorrect errors for `else` statements using alternative syntax. +- `WordPress.VIP.ValidatedSanitizedInput` sniff not always treating casting as sanitization. +- `WordPress.XSS.EscapeOutput` sniff flagging comments as needing to be escaped. +- `WordPress.XSS.EscapeOutput` sniff not sniffing comma-delimited `echo` arguments after encountering the first escaping function in the statement. +- `WordPress.PHP.YodaConditions` sniff not flagging comparisons to constants or function calls. +- `WordPress.Arrays.ArrayDeclaration` sniff not ignoring doc comments. +- Link to phpStorm instructions in `README.md`. +- Poor performance of the `WordPress.Arrays.ArrayAssignmentRestrictions` sniff. +- Poor performance of the `WordPress.Files.FileName` sniff. + +## [0.3.0] - 2014-12-11 + +See the comparison for full list. + +### Changed +- Use semantic version tags for releases. + +## [2013-10-06] + +See the comparison for full list. + +## 2013-06-11 + +Initial tagged release. + +[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer +[PHP_CodeSniffer]: https://github.com/PHPCSStandards/PHP_CodeSniffer + +[Unreleased]: https://github.com/WordPress/WordPress-Coding-Standards/compare/main...HEAD +[3.1.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/3.0.1...3.1.0 +[3.0.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/3.0.0...3.0.1 +[3.0.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.3.0...3.0.0 +[2.3.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.2.1...2.3.0 +[2.2.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.2.0...2.2.1 +[2.2.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.1.1...2.2.0 +[2.1.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.1.0...2.1.1 +[2.1.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.0.0...2.1.0 +[2.0.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.0.0-RC1...2.0.0 +[2.0.0-RC1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/1.2.1...2.0.0-RC1 +[1.2.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.14.1...1.0.0 +[0.14.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.14.0...0.14.1 +[0.14.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.13.1...0.14.0 +[0.13.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.13.0...0.13.1 +[0.13.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.12.0...0.13.0 +[0.12.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.11.0...0.12.0 +[0.11.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.10.0...0.11.0 +[0.10.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.9.0...0.10.0 +[0.9.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.8.0...0.9.0 +[0.8.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.7.1...0.8.0 +[0.7.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.7.0...0.7.1 +[0.7.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.6.0...0.7.0 +[0.6.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.5.0...0.6.0 +[0.5.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.4.0...0.5.0 +[0.4.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.3.0...0.4.0 +[0.3.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2013-10-06...0.3.0 +[2013-10-06]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2013-06-11...2013-10-06 + +[@anomiex]: https://github.com/anomiex +[@Chouby]: https://github.com/Chouby +[@ckanitz]: https://github.com/ckanitz +[@craigfrancis]: https://github.com/craigfrancis +[@dawidurbanski]: https://github.com/dawidurbanski +[@desrosj]: https://github.com/desrosj +[@grappler]: https://github.com/grappler +[@Ipstenu]: https://github.com/Ipstenu +[@JDGrimes]: https://github.com/JDGrimes +[@khacoder]: https://github.com/khacoder +[@Luc45]: https://github.com/Luc45 +[@marconmartins]: https://github.com/marconmartins +[@NielsdeBlaauw]: https://github.com/NielsdeBlaauw +[@rodrigoprimo]: https://github.com/rodrigoprimo +[@slaFFik]: https://github.com/slaFFik +[@sandeshjangam]: https://github.com/sandeshjangam +[@westonruter]: https://github.com/westonruter diff --git a/trunk/vendor/wp-coding-standards/wpcs/LICENSE b/trunk/vendor/wp-coding-standards/wpcs/LICENSE new file mode 100644 index 00000000..359e1a72 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2009 John Godley and contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml new file mode 100644 index 00000000..12c928bf --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml @@ -0,0 +1,948 @@ + + + + Non-controversial generally-agreed upon WordPress Coding Standards + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + warning + + + warning + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + warning + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + warning + + + + + + + + + + + + + error + The "goto" language construct should not be used. + + + + + error + eval() is a security risk so not allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml new file mode 100644 index 00000000..c8b5969a --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml @@ -0,0 +1,109 @@ + + + + WordPress Coding Standards for Inline Documentation and Comments + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml new file mode 100644 index 00000000..ab0e8db3 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml @@ -0,0 +1,199 @@ + + + + Best practices beyond core WordPress Coding Standards + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + + 5 + + + + + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + error + + + error + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php new file mode 100644 index 00000000..c72fdd91 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php @@ -0,0 +1,261 @@ + + */ + public static $groups = array(); + + /** + * Cache for the excluded groups information. + * + * @since 0.11.0 + * + * @var array + */ + protected $excluded_groups = array(); + + /** + * Cache for the group information. + * + * @since 0.13.0 + * + * @var array + */ + protected $groups_cache = array(); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() { + // Retrieve the groups only once and don't set up a listener if there are no groups. + if ( false === $this->setup_groups() ) { + return array(); + } + + return array( + \T_DOUBLE_ARROW, + \T_CLOSE_SQUARE_BRACKET, + \T_CONSTANT_ENCAPSED_STRING, + \T_DOUBLE_QUOTED_STRING, + ); + } + + /** + * Groups of variables to restrict. + * + * This method should be overridden in extending classes. + * + * Example: groups => array( + * 'groupname' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Descriptive error message. The error message will be passed the $key and $val of the current array assignment.', + * 'keys' => array( 'key1', 'another_key' ), + * ) + * ) + * + * @return array + */ + abstract public function getGroups(); + + /** + * Cache the groups. + * + * @since 0.13.0 + * + * @return bool True if the groups were setup. False if not. + */ + protected function setup_groups() { + $this->groups_cache = $this->getGroups(); + + if ( empty( $this->groups_cache ) && empty( self::$groups ) ) { + return false; + } + + // Allow for adding extra unit tests. + if ( ! empty( self::$groups ) ) { + $this->groups_cache = array_merge( $this->groups_cache, self::$groups ); + } + + return true; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function process_token( $stackPtr ) { + + $this->excluded_groups = RulesetPropertyHelper::merge_custom_array( $this->exclude ); + if ( array_diff_key( $this->groups_cache, $this->excluded_groups ) === array() ) { + // All groups have been excluded. + // Don't remove the listener as the exclude property can be changed inline. + return; + } + + $token = $this->tokens[ $stackPtr ]; + + if ( \T_CLOSE_SQUARE_BRACKET === $token['code'] ) { + $equalPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( \T_EQUAL !== $this->tokens[ $equalPtr ]['code'] + && \T_COALESCE_EQUAL !== $this->tokens[ $equalPtr ]['code'] + ) { + // This is not an assignment. Bow out. + return; + } + } + + // Instances: Multi-dimensional array. + $inst = array(); + + /* + * Covers array assignments: + * `$foo = array( 'bar' => 'taz' );` + * `$foo['bar'] = $taz;` + */ + if ( \T_CLOSE_SQUARE_BRACKET === $token['code'] || \T_DOUBLE_ARROW === $token['code'] ) { + $operator = $stackPtr; // T_DOUBLE_ARROW. + if ( \T_CLOSE_SQUARE_BRACKET === $token['code'] ) { + $operator = $equalPtr; + } + + $keyIdx = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); + if ( isset( Tokens::$stringTokens[ $this->tokens[ $keyIdx ]['code'] ] ) + && ! is_numeric( $this->tokens[ $keyIdx ]['content'] ) + ) { + $key = TextStrings::stripQuotes( $this->tokens[ $keyIdx ]['content'] ); + $valStart = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $operator + 1 ), null, true ); + $valEnd = BCFile::findEndOfStatement( $this->phpcsFile, $valStart, \T_COLON ); + if ( \T_COMMA === $this->tokens[ $valEnd ]['code'] + || \T_SEMICOLON === $this->tokens[ $valEnd ]['code'] + ) { + // FindEndOfStatement includes the comma/semi-colon if that's the end of the statement. + // That's not what we want (and inconsistent), so remove it. + --$valEnd; + } + + $val = trim( GetTokensAsString::compact( $this->phpcsFile, $valStart, $valEnd, true ) ); + $inst[ $key ] = array( + 'value' => $val, + 'line' => $token['line'], + 'keyptr' => $keyIdx, + ); + } + } elseif ( isset( Tokens::$stringTokens[ $token['code'] ] ) ) { + /* + * Covers assignments via query parameters: `$foo = 'bar=taz&other=thing';`. + */ + if ( preg_match_all( '#(?:^|&)([a-z_]+)=([^&]*)#i', TextStrings::stripQuotes( $token['content'] ), $matches ) <= 0 ) { + return; // No assignments here, nothing to check. + } + + foreach ( $matches[1] as $match_nr => $key ) { + $inst[ $key ] = array( + 'value' => $matches[2][ $match_nr ], + 'line' => $token['line'], + 'keyptr' => $stackPtr, + ); + } + } + + if ( empty( $inst ) ) { + return; + } + + foreach ( $this->groups_cache as $groupName => $group ) { + + if ( isset( $this->excluded_groups[ $groupName ] ) ) { + continue; + } + + foreach ( $inst as $key => $assignment ) { + if ( ! \in_array( $key, $group['keys'], true ) ) { + continue; + } + + $output = \call_user_func( array( $this, 'callback' ), $key, $assignment['value'], $assignment['line'], $group ); + + if ( ! isset( $output ) || false === $output ) { + continue; + } elseif ( true === $output ) { + $message = $group['message']; + } else { + $message = $output; + } + + MessageHelper::addMessage( + $this->phpcsFile, + $message, + $assignment['keyptr'], + ( 'error' === $group['type'] ), + MessageHelper::stringToErrorcode( $groupName . '_' . $key ), + array( $key, $assignment['value'] ) + ); + } + } + } + + /** + * Callback to process each confirmed key, to check value. + * + * This method must be extended to add the logic to check assignment value. + * + * @param string $key Array index / key. + * @param mixed $val Assigned value. + * @param int $line Token line. + * @param array $group Group definition. + * + * @return mixed FALSE if no match, TRUE if matches, STRING if matches + * with custom error message passed to ->process(). + */ + abstract public function callback( $key, $val, $line, $group ); +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php new file mode 100644 index 00000000..fbc18af3 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php @@ -0,0 +1,257 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Avoid direct calls to the database.', + * 'classes' => array( 'PDO', '\Namespace\Classname' ), + * ) + * ) + * + * You can use * wildcards to target a group of (namespaced) classes. + * Aliased namespaces (use ..) are currently not supported. + * + * Documented here for clarity. Not (re)defined as it is already defined in the parent class. + * + * @return array + * + abstract public function getGroups(); + */ + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() { + // Prepare the function group regular expressions only once. + if ( false === $this->setup_groups( 'classes' ) ) { + return array(); + } + + return array( + \T_DOUBLE_COLON, + \T_NEW, + \T_EXTENDS, + \T_IMPLEMENTS, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * {@internal Unlike in the `AbstractFunctionRestrictionsSniff`, + * we can't do a preliminary check on classes as at this point + * we don't know the class name yet.}} + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + // Reset the temporary storage before processing the token. + unset( $this->classname ); + + $this->excluded_groups = RulesetPropertyHelper::merge_custom_array( $this->exclude ); + if ( array_diff_key( $this->groups, $this->excluded_groups ) === array() ) { + // All groups have been excluded. + // Don't remove the listener as the exclude property can be changed inline. + return; + } + + if ( true === $this->is_targetted_token( $stackPtr ) ) { + return $this->check_for_matches( $stackPtr ); + } + } + + /** + * Determine if we have a valid classname for the target token. + * + * @since 0.11.0 This logic was originally contained in the `process()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return bool + */ + public function is_targetted_token( $stackPtr ) { + + $token = $this->tokens[ $stackPtr ]; + $classname = ''; + + if ( \in_array( $token['code'], array( \T_NEW, \T_EXTENDS, \T_IMPLEMENTS ), true ) ) { + if ( \T_NEW === $token['code'] ) { + $nameEnd = ( $this->phpcsFile->findNext( array( \T_OPEN_PARENTHESIS, \T_WHITESPACE, \T_SEMICOLON, \T_CLOSE_PARENTHESIS, \T_CLOSE_TAG ), ( $stackPtr + 2 ) ) - 1 ); + } else { + $nameEnd = ( $this->phpcsFile->findNext( array( \T_CLOSE_CURLY_BRACKET, \T_WHITESPACE ), ( $stackPtr + 2 ) ) - 1 ); + } + + $classname = GetTokensAsString::noEmpties( $this->phpcsFile, ( $stackPtr + 2 ), $nameEnd ); + $classname = $this->get_namespaced_classname( $classname, ( $stackPtr - 1 ) ); + } + + if ( \T_DOUBLE_COLON === $token['code'] ) { + $nameEnd = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); + if ( \T_STRING !== $this->tokens[ $nameEnd ]['code'] ) { + // Hierarchy keyword or object stored in variable. + return false; + } + + $nameStart = ( $this->phpcsFile->findPrevious( Collections::namespacedNameTokens(), ( $nameEnd - 1 ), null, true ) + 1 ); + $classname = GetTokensAsString::noEmpties( $this->phpcsFile, $nameStart, $nameEnd ); + $classname = $this->get_namespaced_classname( $classname, ( $nameStart - 1 ) ); + } + + // Stop if we couldn't determine a classname. + if ( empty( $classname ) ) { + return false; + } + + // Nothing to do if one of the hierarchy keywords - 'parent', 'self' or 'static' - is used. + if ( \in_array( strtolower( $classname ), array( '\parent', '\self', '\static' ), true ) ) { + return false; + } + + $this->classname = $classname; + return true; + } + + /** + * Verify if the current token is one of the targetted classes. + * + * @since 0.11.0 Split out from the `process()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function check_for_matches( $stackPtr ) { + $skip_to = array(); + + foreach ( $this->groups as $groupName => $group ) { + + if ( isset( $this->excluded_groups[ $groupName ] ) ) { + continue; + } + + if ( preg_match( $group['regex'], $this->classname ) === 1 ) { + $skip_to[] = $this->process_matched_token( $stackPtr, $groupName, $this->classname ); + } + } + + if ( empty( $skip_to ) || min( $skip_to ) === 0 ) { + return; + } + + return min( $skip_to ); + } + + /** + * Process a matched token. + * + * @since 0.11.0 Split out from the `process()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in it original case. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + * + * @phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod.Found + */ + public function process_matched_token( $stackPtr, $group_name, $matched_content ) { + parent::process_matched_token( $stackPtr, $group_name, $matched_content ); + } + // phpcs:enable + + /** + * Prepare the class name for use in a regular expression. + * + * The getGroups() method allows for providing class names with a wildcard * to target + * a group of classes within a namespace. It also allows for providing class names as + * 'ordinary' names or prefixed with one or more namespaces. + * This prepare routine takes that into account while still safely escaping the + * class name for use in a regular expression. + * + * @param string $classname Class name, potentially prefixed with namespaces. + * @return string Regex escaped class name. + */ + protected function prepare_name_for_regex( $classname ) { + $classname = trim( $classname, '\\' ); // Make sure all classnames have a \ prefix, but only one. + return parent::prepare_name_for_regex( $classname ); + } + + /** + * See if the classname was found in a namespaced file and if so, add the namespace to the classname. + * + * @param string $classname The full classname as found. + * @param int $search_from The token position to search up from. + * @return string Classname, potentially prefixed with the namespace. + */ + protected function get_namespaced_classname( $classname, $search_from ) { + // Don't do anything if this is already a fully qualified classname. + if ( empty( $classname ) || '\\' === $classname[0] ) { + return $classname; + } + + // Remove the namespace keyword if used. + if ( 0 === stripos( $classname, 'namespace\\' ) ) { + $classname = substr( $classname, 10 ); + } + + $namespace = Namespaces::determineNamespace( $this->phpcsFile, $search_from ); + if ( '' === $namespace ) { + // No namespace keyword found at all, so global namespace. + $classname = '\\' . $classname; + } else { + $classname = '\\' . $namespace . '\\' . $classname; + } + + return $classname; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php new file mode 100644 index 00000000..c6395a70 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php @@ -0,0 +1,111 @@ +target_functions ) ) { + return array(); + } + + return array( + $this->group_name => array( + 'functions' => array_keys( $this->target_functions ), + ), + ); + } + + /** + * Process a matched token. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_matched_token( $stackPtr, $group_name, $matched_content ) { + + $parameters = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); + + if ( empty( $parameters ) ) { + return $this->process_no_parameters( $stackPtr, $group_name, $matched_content ); + } else { + return $this->process_parameters( $stackPtr, $group_name, $matched_content, $parameters ); + } + } + + /** + * Process the parameters of a matched function. + * + * This method has to be made concrete in child classes. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + abstract public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ); + + /** + * Process the function if no parameters were found. + * + * Defaults to doing nothing. Can be overloaded in child classes to handle functions + * were parameters are expected, but none found. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_no_parameters( $stackPtr, $group_name, $matched_content ) {} +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php new file mode 100644 index 00000000..dfa97b5a --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php @@ -0,0 +1,358 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function', 'mysql_*' ), + * // Only useful when using wildcards: + * 'allow' => array( 'mysql_to_rfc3339' => true, ), + * ) + * ) + * + * You can use * wildcards to target a group of functions. + * When you use * wildcards, you may inadvertently restrict too many + * functions. In that case you can add the `allow` key to + * safe list individual functions to prevent false positives. + * + * @return array + */ + abstract public function getGroups(); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() { + // Prepare the function group regular expressions only once. + if ( false === $this->setup_groups( 'functions' ) ) { + return array(); + } + + return array( + \T_STRING, + ); + } + + /** + * Set up the regular expressions for each group. + * + * @since 0.10.0 + * + * @param string $key The group array index key where the input for the regular expression can be found. + * @return bool True if the groups were setup. False if not. + */ + protected function setup_groups( $key ) { + // Prepare the function group regular expressions only once. + $this->groups = $this->getGroups(); + + if ( empty( $this->groups ) && empty( self::$unittest_groups ) ) { + return false; + } + + // Allow for adding extra unit tests. + if ( ! empty( self::$unittest_groups ) ) { + $this->groups = array_merge( $this->groups, self::$unittest_groups ); + } + + $all_items = array(); + foreach ( $this->groups as $groupName => $group ) { + if ( empty( $group[ $key ] ) ) { + unset( $this->groups[ $groupName ] ); + continue; + } + + // Lowercase the items and potential allows as the comparisons should be done case-insensitively. + // Note: this disregards non-ascii names, but as we don't have any of those, that is okay for now. + $items = array_map( 'strtolower', $group[ $key ] ); + $this->groups[ $groupName ][ $key ] = $items; + + if ( ! empty( $group['allow'] ) ) { + $this->groups[ $groupName ]['allow'] = array_change_key_case( $group['allow'], \CASE_LOWER ); + } + + $items = array_map( array( $this, 'prepare_name_for_regex' ), $items ); + $all_items[] = $items; + $items = implode( '|', $items ); + + $this->groups[ $groupName ]['regex'] = sprintf( $this->regex_pattern, $items ); + } + + if ( empty( $this->groups ) ) { + return false; + } + + // Create one "super-regex" to allow for initial filtering. + $all_items = \call_user_func_array( 'array_merge', $all_items ); + $all_items = implode( '|', array_unique( $all_items ) ); + $this->prelim_check_regex = sprintf( $this->regex_pattern, $all_items ); + + return true; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + + $this->excluded_groups = RulesetPropertyHelper::merge_custom_array( $this->exclude ); + if ( array_diff_key( $this->groups, $this->excluded_groups ) === array() ) { + // All groups have been excluded. + // Don't remove the listener as the exclude property can be changed inline. + return; + } + + // Preliminary check. If the content of the T_STRING is not one of the functions we're + // looking for, we can bow out before doing the heavy lifting of checking whether + // this is a function call. + if ( preg_match( $this->prelim_check_regex, $this->tokens[ $stackPtr ]['content'] ) !== 1 ) { + return; + } + + if ( true === $this->is_targetted_token( $stackPtr ) ) { + return $this->check_for_matches( $stackPtr ); + } + } + + /** + * Verify is the current token is a function call. + * + * @since 0.11.0 Split out from the `process()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return bool + */ + public function is_targetted_token( $stackPtr ) { + // Exclude function definitions, class methods, and namespaced calls. + if ( ContextHelper::has_object_operator_before( $this->phpcsFile, $stackPtr ) === true ) { + return false; + } + + if ( ContextHelper::is_token_namespaced( $this->phpcsFile, $stackPtr ) === true ) { + return false; + } + + if ( Context::inAttribute( $this->phpcsFile, $stackPtr ) ) { + // Class instantiation or constant in attribute, not function call. + return false; + } + + $search = Tokens::$emptyTokens; + $search[ \T_BITWISE_AND ] = \T_BITWISE_AND; + + $prev = $this->phpcsFile->findPrevious( $search, ( $stackPtr - 1 ), null, true ); + + // Skip sniffing on function, OO definitions or for function aliases in use statements. + $invalid_tokens = Tokens::$ooScopeTokens; + $invalid_tokens += array( + \T_FUNCTION => \T_FUNCTION, + \T_NEW => \T_NEW, + \T_AS => \T_AS, // Use declaration alias. + ); + + if ( isset( $invalid_tokens[ $this->tokens[ $prev ]['code'] ] ) ) { + return false; + } + + // Check if this could even be a function call. + $next = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( false === $next ) { + return false; + } + + // Check for `use function ... (as|;)`. + if ( ( \T_STRING === $this->tokens[ $prev ]['code'] && 'function' === $this->tokens[ $prev ]['content'] ) + && ( \T_AS === $this->tokens[ $next ]['code'] || \T_SEMICOLON === $this->tokens[ $next ]['code'] ) + ) { + return true; + } + + // If it's not a `use` statement, there should be parenthesis. + if ( \T_OPEN_PARENTHESIS !== $this->tokens[ $next ]['code'] ) { + return false; + } + + return true; + } + + /** + * Verify if the current token is one of the targetted functions. + * + * @since 0.11.0 Split out from the `process()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function check_for_matches( $stackPtr ) { + $token_content = strtolower( $this->tokens[ $stackPtr ]['content'] ); + $skip_to = array(); + + foreach ( $this->groups as $groupName => $group ) { + + if ( isset( $this->excluded_groups[ $groupName ] ) ) { + continue; + } + + if ( isset( $group['allow'][ $token_content ] ) ) { + continue; + } + + if ( preg_match( $group['regex'], $token_content ) === 1 ) { + $skip_to[] = $this->process_matched_token( $stackPtr, $groupName, $token_content ); + } + } + + if ( empty( $skip_to ) || min( $skip_to ) === 0 ) { + return; + } + + return min( $skip_to ); + } + + /** + * Process a matched token. + * + * @since 0.11.0 Split out from the `process()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_matched_token( $stackPtr, $group_name, $matched_content ) { + + MessageHelper::addMessage( + $this->phpcsFile, + $this->groups[ $group_name ]['message'], + $stackPtr, + ( 'error' === $this->groups[ $group_name ]['type'] ), + MessageHelper::stringToErrorcode( $group_name . '_' . $matched_content ), + array( $matched_content ) + ); + } + + /** + * Prepare the function name for use in a regular expression. + * + * The getGroups() method allows for providing function names with a wildcard * to target + * a group of functions. This prepare routine takes that into account while still safely + * escaping the function name for use in a regular expression. + * + * @since 0.10.0 + * + * @param string $function_name Function name. + * @return string Regex escaped function name. + */ + protected function prepare_name_for_regex( $function_name ) { + $function_name = str_replace( array( '.*', '*' ), '@@', $function_name ); // Replace wildcards with placeholder. + $function_name = preg_quote( $function_name, '`' ); + $function_name = str_replace( '@@', '.*', $function_name ); // Replace placeholder with regex wildcard. + + return $function_name; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml new file mode 100644 index 00000000..0833cce3 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml @@ -0,0 +1,116 @@ + + + + + + + + 22, +); + ]]> + + + 22, + ); + ]]> + + + + + + + + 22, + 'comment_count' => array( + 'value' => 25, + 'compare' => '>=', + ), + 'post_type' => array( + 'post', + 'page', + ), +); + ]]> + + + 22, + 'comment_count' => array( + 'value' => 25, + 'compare' => '>=', + ), + 'post_type' => array( + 'post', + 'page', + ), +); + ]]> + + + + + + + + 'start of phrase' + . 'concatented additional phrase' + . 'more text', +); + ]]> + + + 'start of phrase' +. 'concatented additional phrase' +. 'more text', +); + ]]> + + + + + + + + << + start of phrase + concatented additional phrase + more text +EOD +, +); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml new file mode 100644 index 00000000..b42ca4cf --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml @@ -0,0 +1,31 @@ + + + + + + + + [ $post_id ]; +$post_title = $post[ 'concatenated' . $title ]; +$post = $posts[ HOME_PAGE ]; +$post = $posts[123]; +$post_title = $post['post_title']; + ]]> + + + [$post_id]; +$post_title = $post['concatenated' . $title ]; +$post = $posts[HOME_PAGE]; +$post = $posts[ 123 ]; +$post_title = $post[ 'post_title' ]; + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml new file mode 100644 index 00000000..e5c85676 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml @@ -0,0 +1,50 @@ + + + + + + + + => 22 ); +$bar = array( 'year' => $current_year ); + ]]> + + + =>22 ); +$bar = array( 'year'=> $current_year ); + ]]> + + + + + + + + => 22, + 'year' => $current_year, + 'monthnum' => $current_month, +); + ]]> + + + => 22, + 'year' => $current_year, + 'monthnum' => $current_month, +); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml new file mode 100644 index 00000000..43950a09 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml @@ -0,0 +1,24 @@ + + + + + + + + esc_html__( 'text', 'domain' ); + ]]> + + + esc_html( 'text', 'domain' ); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml new file mode 100644 index 00000000..e5a2c1bc --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml @@ -0,0 +1,35 @@ + + + + + + + + time(); + ]]> + + + current_time( 'timestamp', true ); + ]]> + + + + + 'Y-m-d' ); + ]]> + + + current_time( 'U', false ); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml new file mode 100644 index 00000000..845869d0 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + DateTime(); +$date->setTimezone( + new DateTimeZone( 'Europe/Amsterdam' ) +); + ]]> + + + date_default_timezone_set( 'Europe/Amsterdam' ); + ]]> + + + + + + + + gmdate( + 'Y-m-d\TH:i:s', + strtotime( $plugin['last_updated'] ) +); + ]]> + + + date( + 'Y-m-d\TH:i:s', + strtotime( $plugin['last_updated'] ) +); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml new file mode 100644 index 00000000..a97d1394 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml @@ -0,0 +1,119 @@ + + + + + + + + 'ECPT_VERSION', '1.0' ); + +$ecpt_admin = new ECPT_Admin_Page(); + +class ECPT_Admin_Page {} + +apply_filter( + 'ecpt_modify_content', + $ecpt_content +); + ]]> + + + 'PLUGIN_VERSION', '1.0' ); + +$admin = new Admin_Page(); + +class Admin_Page {} + +apply_filter( + 'modify_content', + $content +); + ]]> + + + + + ECPT_Plugin\Admin; + +// Constants declared using `const` will +// be namespaced and therefore prefixed. +const VERSION = 1.0; + +// A class declared in a (prefixed) namespace +// is automatically prefixed. +class Admin_Page {} + +// Variables in a namespaced file are not +// namespaced, so still need prefixing. +$ecpt_admin = new Admin_Page(); + +// Hook names are not subject to namespacing. +apply_filter( + 'ecpt_modify_content', + $ecpt_content +); + ]]> + + + Admin; + +// As the namespace is not prefixed, this +// is still bad. +const VERSION = 1.0; + +// As the namespace is not prefixed, this +// is still bad. +class Admin_Page {} + ]]> + + + + + + + + mycoolplugin_save_post() {} + ]]> + + + wp_save_post() {} + ]]> + + + + + + + + MyPluginIsCool {} + ]]> + + + My {} + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml new file mode 100644 index 00000000..387769d9 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml @@ -0,0 +1,35 @@ + + + + + + + + 'prefix_hook_name', $var ); + ]]> + + + 'Prefix_Hook_NAME', $var ); + ]]> + + + + + 'prefix_hook_name', $var ); + ]]> + + + 'prefix\hook-name', $var ); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml new file mode 100644 index 00000000..fe88dfd6 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml @@ -0,0 +1,121 @@ + + + + + + + + 'my_short_slug', + array() +); + ]]> + + + 'my_own_post_type_too_long', + array() +); + ]]> + + + + + + + + 'my_post_type_slug', + array() +); + ]]> + + + 'my/post/type/slug', + array() +); + ]]> + + + + + + + + 'my_post_active', + array() +); + ]]> + + + "my_post_{$status}", + array() +); + ]]> + + + + + + + + 'prefixed_author', + array() +); + ]]> + + + 'author', + array() +); + ]]> + + + + + + + + 'prefixed_author', + array() +); + ]]> + + + 'wp_author', + array() +); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml new file mode 100644 index 00000000..91c73c58 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + 'short_open_tag', 'off' ); + ]]> + + + + + + + + wp_raise_memory_limit(); + ]]> + + + 'memory_limit', '256M' ); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml new file mode 100644 index 00000000..744ec9ed --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml @@ -0,0 +1,53 @@ + + + + + + + + true ) ) {} + ]]> + + + ) ) {} + ]]> + + + + + + true ); + ]]> + + + ); + ]]> + + + + + + true ); + ]]> + + + ); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml new file mode 100644 index 00000000..cb2aa366 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + true === $the_force ) { + $victorious = you_will( $be ); +} + ]]> + + + $the_force === false ) { + $victorious = you_will_not( $be ); +} + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml new file mode 100644 index 00000000..aee63a62 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + wp_safe_redirect( $location ); + ]]> + + + wp_redirect( $location ); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml new file mode 100644 index 00000000..a65848e8 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml @@ -0,0 +1,69 @@ + + + + + + + + 'manage_sites' ) ) { } + ]]> + + + 'manage_site', $user->ID ); + ]]> + + + + + + + + 'manage_options', + 'options_page_slug', + 'project_options_page_cb' +); + ]]> + + + 'author', + 'options_page_slug', + 'project_options_page_cb' +); + ]]> + + + + + + + + 'read' ) ) { } + ]]> + + + 'level_6' ) ) { } + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml new file mode 100644 index 00000000..8df7940f --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml @@ -0,0 +1,43 @@ + + + + + + + + WordPress_Example { + + /** + * This function is about WordPress. + */ + public function explain() { + echo 'This is an explanation + about WordPress.'; + } +} + ]]> + + + Wordpress_Example { + + /** + * This function is about Wordpress. + */ + public function explain() { + echo 'This is an explanation + about wordpress.'; + } +} + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml new file mode 100644 index 00000000..b17ec3f9 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml new file mode 100644 index 00000000..03c75b8a --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml @@ -0,0 +1,45 @@ + + + + + + + + HOUR_IN_SECONDS, + 'display' => __( 'Every hour' ) + ); + return $schedules; +} + +add_filter( + 'cron_schedules', + 'adjust_schedules' +); + ]]> + + + 9 * 60, + 'display' => __( 'Every 9 minutes' ) + ); + return $schedules; +} + +add_filter( + 'cron_schedules', + 'adjust_schedules' +); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml new file mode 100644 index 00000000..2de4e18e --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + WP_User_Query(); + ]]> + + + WP_User_Search(); // Deprecated WP 3.1. + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml new file mode 100644 index 00000000..7bb63d8b --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + get_sites(); + ]]> + + + wp_get_sites(); // Deprecated WP 4.6. + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml new file mode 100644 index 00000000..de9164c3 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml @@ -0,0 +1,23 @@ + + + + + + + + 'url' ); + ]]> + + + 'home' ); // Deprecated WP 2.2.0. + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml new file mode 100644 index 00000000..195e2709 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml @@ -0,0 +1,40 @@ + + + + after the deprecated parameter, only ever pass the default value. + ]]> + + + + + + + $string ); + ]]> + + + + + '', 'yes' ); + ]]> + + + 'oops', 'yes' ); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml new file mode 100644 index 00000000..4060d79e --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml @@ -0,0 +1,92 @@ + + + + + + + + '1.0.0' +); + ]]> + + + + + + + + + + + '1.0.0', + true +); + ]]> + + + false, + true +); + ]]> + + + + + + + + true +); + ]]> + + + + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml new file mode 100644 index 00000000..1f701306 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml @@ -0,0 +1,57 @@ + + + + + + + + wp_enqueue_script( + 'someScript-js', + $path_to_file, + array( 'jquery' ), + '1.0.0', + true +); + ]]> + + + ', + esc_url( $path_to_file ) +); + ]]> + + + + + + + + wp_enqueue_style( + 'style-name', + $path_to_file, + array(), + '1.0.0' +); + ]]> + + + ', + esc_url( $path_to_file ) +); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml new file mode 100644 index 00000000..55715ca8 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml @@ -0,0 +1,73 @@ + + + + + + + + -1, +); +$args = array( + 'posts_per_page' => 100, +); +$args = array( + 'posts_per_page' => '10', +); + +$query_args['posts_per_page'] = 100; + +_query_posts( 'nopaging=1&posts_per_page=50' ); + ]]> + + + 101, +); + +$query_args['posts_per_page'] = 200; + +_query_posts( 'nopaging=1&posts_per_page=999' ); + ]]> + + + + + -1, +); +$args = array( + 'numberposts' => 100, +); +$args = array( + 'numberposts' => '10', +); + +$query_args['numberposts'] = '-1'; + +_query_posts( 'numberposts=50' ); + ]]> + + + 101, +); + +$query_args['numberposts'] = '200'; + +_query_posts( 'numberposts=999' ); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml new file mode 100644 index 00000000..a087dd54 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml @@ -0,0 +1,27 @@ + + + + + + + + (int) '420'; + +// No space between spread operator and cast. +$a = function_call( ...(array) $mixed ); + ]]> + + + =(int) '420'; + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml new file mode 100644 index 00000000..943967a6 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml @@ -0,0 +1,150 @@ + + + + + + + + ( have_posts() ) {} + +// For multi-line conditions, +// a new line is also accepted. +if ( true === $condition + && $count > 10 +) {} + ]]> + + + (have_posts()){} + +// Too much space. +while ( have_posts() ) {} + ]]> + + + + + + + + { + // Do something. +} catch ( + ExceptionA | ExceptionB $e +) { +} + ]]> + + + { + // Do something. +} catch ( Exception $e ) +( +} + ]]> + + + + + { + // Do something. +} + ]]> + + + { + // Do something. +} + ]]> + + + + + + + + : + // Do something. +endforeach; + ]]> + + + : + // Do something. +endforeach; + ]]> + + + + + + + + + + + + + +} + ]]> + + + + + + + + + + + + + echo $a; + + +} + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml new file mode 100644 index 00000000..47ffb1e8 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml @@ -0,0 +1,19 @@ + + + , ?->, ::) should not have any spaces around them, though new lines are allowed except for use with the `::class` constant. + ]]> + + + + ->bar(); + ]]> + + + ?-> bar(); + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml new file mode 100644 index 00000000..f9e0719f --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml @@ -0,0 +1,61 @@ + + + + + + + + === $b && $b === $c ) {} +if ( ! $var ) {} + ]]> + + + && $b === $c ) {} +if ( ! $var ) {} + +// Too little space. +if ( $a===$b &&$b ===$c ) {} +if ( !$var ) {} + ]]> + + + + + + && $b === $c +) {} + ]]> + + + + && $b === $c +) {} + ]]> + + + + + = 'foo'; +$all = 'foobar'; + ]]> + + + = 'foo'; +$all ='foobar'; + ]]> + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php new file mode 100644 index 00000000..76623d7d --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php @@ -0,0 +1,108 @@ + + */ + private static $arrayWalkingFunctions = array( + 'array_map' => array( + 'position' => 1, + 'name' => 'callback', + ), + 'map_deep' => array( + 'position' => 2, + 'name' => 'callback', + ), + ); + + /** + * Retrieve a list of the supported "array walking" functions. + * + * @since 3.0.0 + * + * @return array + */ + public static function get_functions() { + return \array_fill_keys( \array_keys( self::$arrayWalkingFunctions ), true ); + } + + /** + * Check if a particular function is an "array walking" function. + * + * @since 3.0.0 + * + * @param string $functionName The name of the function to check. + * + * @return bool + */ + public static function is_array_walking_function( $functionName ) { + return isset( self::$arrayWalkingFunctions[ strtolower( $functionName ) ] ); + } + + /** + * Retrieve the parameter information for the callback parameter for an array walking function. + * + * @since 3.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. + * @param int $stackPtr The position of function call name token. + * + * @return array|false Array with information on the callback parameter. + * Or `FALSE` if the parameter is not found. + * See the PHPCSUtils PassedParameters::getParameters() documentation + * for the format of the returned (single-dimensional) array. + */ + public static function get_callback_parameter( File $phpcsFile, $stackPtr ) { + $tokens = $phpcsFile->getTokens(); + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + $functionName = strtolower( $tokens[ $stackPtr ]['content'] ); + if ( isset( self::$arrayWalkingFunctions[ $functionName ] ) === false ) { + return false; + } + + return PassedParameters::getParameter( + $phpcsFile, + $stackPtr, + self::$arrayWalkingFunctions[ $functionName ]['position'], + self::$arrayWalkingFunctions[ $functionName ]['name'] + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php new file mode 100644 index 00000000..080f3cf2 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php @@ -0,0 +1,135 @@ +getTokens(); + + // Check for the existence of the token. + if ( ! isset( $tokens[ $stackPtr ] ) ) { + return false; + } + + // Is this one of the tokens this function handles ? + if ( \T_STRING !== $tokens[ $stackPtr ]['code'] ) { + return false; + } + + $next = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( false !== $next + && ( \T_OPEN_PARENTHESIS === $tokens[ $next ]['code'] + || \T_DOUBLE_COLON === $tokens[ $next ]['code'] ) + ) { + // Function call or declaration. + return false; + } + + // Array of tokens which if found preceding the $stackPtr indicate that a T_STRING is not a global constant. + $tokens_to_ignore = array( + \T_NAMESPACE => true, + \T_USE => true, + \T_EXTENDS => true, + \T_IMPLEMENTS => true, + \T_NEW => true, + \T_FUNCTION => true, + \T_INSTANCEOF => true, + \T_INSTEADOF => true, + \T_GOTO => true, + ); + $tokens_to_ignore += Tokens::$ooScopeTokens; + $tokens_to_ignore += Collections::objectOperators(); + $tokens_to_ignore += Tokens::$scopeModifiers; + + $prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); + if ( isset( $tokens_to_ignore[ $tokens[ $prev ]['code'] ] ) ) { + // Not the use of a constant. + return false; + } + + if ( ContextHelper::is_token_namespaced( $phpcsFile, $stackPtr ) === true ) { + // Namespaced constant of the same name. + return false; + } + + if ( \T_CONST === $tokens[ $prev ]['code'] + && Scopes::isOOConstant( $phpcsFile, $prev ) + ) { + // Class constant declaration of the same name. + return false; + } + + /* + * Deal with a number of variations of use statements. + */ + for ( $i = $stackPtr; $i > 0; $i-- ) { + if ( $tokens[ $i ]['line'] !== $tokens[ $stackPtr ]['line'] ) { + break; + } + } + + $firstOnLine = $phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); + if ( false !== $firstOnLine && \T_USE === $tokens[ $firstOnLine ]['code'] ) { + $nextOnLine = $phpcsFile->findNext( Tokens::$emptyTokens, ( $firstOnLine + 1 ), null, true ); + if ( false !== $nextOnLine ) { + if ( \T_STRING === $tokens[ $nextOnLine ]['code'] + && 'const' === $tokens[ $nextOnLine ]['content'] + ) { + $hasNsSep = $phpcsFile->findNext( \T_NS_SEPARATOR, ( $nextOnLine + 1 ), $stackPtr ); + if ( false !== $hasNsSep ) { + // Namespaced const (group) use statement. + return false; + } + } else { + // Not a const use statement. + return false; + } + } + } + + return true; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php new file mode 100644 index 00000000..8b5c1786 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php @@ -0,0 +1,394 @@ + Key is token constant, value irrelevant. + */ + private static $safe_casts = array( + \T_INT_CAST => true, + \T_DOUBLE_CAST => true, + \T_BOOL_CAST => true, + \T_UNSET_CAST => true, + ); + + /** + * List of PHP native functions to test the type of a variable. + * + * Using these functions is safe in combination with superglobals without + * unslashing or sanitization. + * + * They should, however, not be regarded as unslashing or sanitization functions. + * + * @since 2.1.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The property visibility was changed from `protected` to `private static`. + * + * @var array Key is function name, value irrelevant. + */ + private static $typeTestFunctions = array( + 'is_array' => true, + 'is_bool' => true, + 'is_callable' => true, + 'is_countable' => true, + 'is_double' => true, + 'is_float' => true, + 'is_int' => true, + 'is_integer' => true, + 'is_iterable' => true, + 'is_long' => true, + 'is_null' => true, + 'is_numeric' => true, + 'is_object' => true, + 'is_real' => true, + 'is_resource' => true, + 'is_scalar' => true, + 'is_string' => true, + ); + + /** + * List of PHP native functions to check if an array index exists. + * + * @since 3.0.0 + * + * @var array Key is function name, value irrelevant. + */ + private static $key_exists_functions = array( + 'array_key_exists' => true, + 'key_exists' => true, // Alias. + ); + + /** + * Array functions to compare a $needle to a predefined set of values. + * + * If the value is set to an array, the parameter specified in the array is + * required for the function call to be considered as a comparison. + * + * @since 2.1.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The property visibility was changed from `protected` to `private static`. + * + * @var array + */ + private static $arrayCompareFunctions = array( + 'in_array' => true, + 'array_search' => true, + 'array_keys' => array( + 'position' => 2, + 'name' => 'filter_value', + ), + ); + + /** + * Check if a particular token acts - statically or non-statically - on an object. + * + * {@internal Note: this may still mistake a namespaced function imported via a `use` statement for + * a global function!} + * + * @since 2.1.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method was renamed from `is_class_object_call() to `has_object_operator_before()`. + * - The method visibility was changed from `protected` to `public static`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * + * @return bool + */ + public static function has_object_operator_before( File $phpcsFile, $stackPtr ) { + $tokens = $phpcsFile->getTokens(); + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + $before = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); + + return isset( Collections::objectOperators()[ $tokens[ $before ]['code'] ] ); + } + + /** + * Check if a particular token is prefixed with a namespace. + * + * {@internal This will give a false positive if the file is not namespaced and the token is prefixed + * with `namespace\`.} + * + * @since 2.1.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method visibility was changed from `protected` to `public static`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * + * @return bool + */ + public static function is_token_namespaced( File $phpcsFile, $stackPtr ) { + $tokens = $phpcsFile->getTokens(); + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + $prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); + + if ( \T_NS_SEPARATOR !== $tokens[ $prev ]['code'] ) { + return false; + } + + $before_prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $prev - 1 ), null, true ); + if ( \T_STRING !== $tokens[ $before_prev ]['code'] + && \T_NAMESPACE !== $tokens[ $before_prev ]['code'] + ) { + return false; + } + + return true; + } + + /** + * Check if a token is (part of) a parameter for a function call to a select list of functions. + * + * This is useful, for instance, when trying to determine the context a variable is used in. + * + * For example: this function could be used to determine if the variable `$foo` is used + * in a global function call to the function `is_foo()`. + * In that case, a call to this function would return the stackPtr to the T_STRING `is_foo` + * for code like: `is_foo( $foo, 'some_other_param' )`, while it would return `false` for + * the following code `is_bar( $foo, 'some_other_param' )`. + * + * @since 2.1.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method visibility was changed from `protected` to `public static`. + * - The `$phpcsFile` parameter was added. + * - The `$global` parameter was renamed to `$global_function`. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * @param array $valid_functions List of valid function names. + * Note: The keys to this array should be the function names + * in lowercase. Values are irrelevant. + * @param bool $global_function Optional. Whether to make sure that the function call is + * to a global function. If `false`, calls to methods, be it static + * `Class::method()` or via an object `$obj->method()`, and + * namespaced function calls, like `MyNS\function_name()` will + * also be accepted. + * Defaults to `true`. + * @param bool $allow_nested Optional. Whether to allow for nested function calls within the + * call to this function. + * I.e. when checking whether a token is within a function call + * to `strtolower()`, whether to accept `strtolower( trim( $var ) )` + * or only `strtolower( $var )`. + * Defaults to `false`. + * + * @return int|bool Stack pointer to the function call T_STRING token or false otherwise. + */ + public static function is_in_function_call( File $phpcsFile, $stackPtr, array $valid_functions, $global_function = true, $allow_nested = false ) { + $tokens = $phpcsFile->getTokens(); + if ( ! isset( $tokens[ $stackPtr ]['nested_parenthesis'] ) ) { + return false; + } + + $nested_parenthesis = $tokens[ $stackPtr ]['nested_parenthesis']; + if ( false === $allow_nested ) { + $nested_parenthesis = array_reverse( $nested_parenthesis, true ); + } + + foreach ( $nested_parenthesis as $open => $close ) { + $prev_non_empty = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $open - 1 ), null, true ); + if ( false === $prev_non_empty || \T_STRING !== $tokens[ $prev_non_empty ]['code'] ) { + continue; + } + + if ( isset( $valid_functions[ strtolower( $tokens[ $prev_non_empty ]['content'] ) ] ) === false ) { + if ( false === $allow_nested ) { + // Function call encountered, but not to one of the allowed functions. + return false; + } + + continue; + } + + if ( false === $global_function ) { + return $prev_non_empty; + } + + /* + * Now, make sure it is a global function. + */ + if ( self::has_object_operator_before( $phpcsFile, $prev_non_empty ) === true ) { + continue; + } + + if ( self::is_token_namespaced( $phpcsFile, $prev_non_empty ) === true ) { + continue; + } + + return $prev_non_empty; + } + + return false; + } + + /** + * Check if a token is inside of an is_...() statement. + * + * @since 2.1.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method visibility was changed from `protected` to `public static`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * + * @return bool Whether the token is being type tested. + */ + public static function is_in_type_test( File $phpcsFile, $stackPtr ) { + /* + * Casting the potential integer stack pointer return value to boolean here is fine. + * The return can never be `0` as there will always be a PHP open tag before the + * function call. + */ + return (bool) self::is_in_function_call( $phpcsFile, $stackPtr, self::$typeTestFunctions ); + } + + /** + * Check if a token is inside of an isset(), empty() or array_key_exists() statement. + * + * @since 0.5.0 + * @since 2.1.0 Now checks for the token being used as the array parameter + * in function calls to array_key_exists() and key_exists() as well. + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method visibility was changed from `protected` to `public static`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * + * @return bool Whether the token is inside an isset() or empty() statement. + */ + public static function is_in_isset_or_empty( File $phpcsFile, $stackPtr ) { + if ( Parentheses::lastOwnerIn( $phpcsFile, $stackPtr, array( \T_ISSET, \T_EMPTY ) ) !== false ) { + return true; + } + + $functionPtr = self::is_in_function_call( $phpcsFile, $stackPtr, self::$key_exists_functions ); + if ( false !== $functionPtr ) { + /* + * Both functions being checked have the same parameters. If the function list would + * be expanded, this needs to be revisited. + */ + $array_param = PassedParameters::getParameter( $phpcsFile, $functionPtr, 2, 'array' ); + if ( false !== $array_param + && ( $stackPtr >= $array_param['start'] && $stackPtr <= $array_param['end'] ) + ) { + return true; + } + } + + return false; + } + + /** + * Retrieve a list of the tokens which are regarded as "safe casts". + * + * @since 3.0.0 + * + * @return array + */ + public static function get_safe_cast_tokens() { + return self::$safe_casts; + } + + /** + * Check if something is being casted to a safe value. + * + * @since 0.5.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method visibility was changed from `protected` to `public static`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * + * @return bool Whether the token being casted. + */ + public static function is_safe_casted( File $phpcsFile, $stackPtr ) { + $tokens = $phpcsFile->getTokens(); + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + $prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); + + return isset( self::$safe_casts[ $tokens[ $prev ]['code'] ] ); + } + + /** + * Check if a token is inside of an array-value comparison function. + * + * @since 2.1.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method visibility was changed from `protected` to `public static`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * + * @return bool Whether the token is (part of) a parameter to an + * array-value comparison function. + */ + public static function is_in_array_comparison( File $phpcsFile, $stackPtr ) { + $function_ptr = self::is_in_function_call( $phpcsFile, $stackPtr, self::$arrayCompareFunctions, true, true ); + if ( false === $function_ptr ) { + return false; + } + + $tokens = $phpcsFile->getTokens(); + $function_name = strtolower( $tokens[ $function_ptr ]['content'] ); + if ( true === self::$arrayCompareFunctions[ $function_name ] ) { + return true; + } + + $target_param = self::$arrayCompareFunctions[ $function_name ]; + $found_param = PassedParameters::getParameter( $phpcsFile, $function_ptr, $target_param['position'], $target_param['name'] ); + if ( false !== $found_param ) { + return true; + } + + return false; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php new file mode 100644 index 00000000..13273496 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php @@ -0,0 +1,84 @@ +getTokens(); + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + $ignore = Tokens::$methodPrefixes; + $ignore[ \T_WHITESPACE ] = \T_WHITESPACE; + + for ( $comment_end = ( $stackPtr - 1 ); $comment_end >= 0; $comment_end-- ) { + if ( isset( $ignore[ $tokens[ $comment_end ]['code'] ] ) === true ) { + continue; + } + + if ( \T_ATTRIBUTE_END === $tokens[ $comment_end ]['code'] + && isset( $tokens[ $comment_end ]['attribute_opener'] ) === true + ) { + $comment_end = $tokens[ $comment_end ]['attribute_opener']; + continue; + } + + break; + } + + if ( \T_DOC_COMMENT_CLOSE_TAG !== $tokens[ $comment_end ]['code'] ) { + // Function doesn't have a doc comment or is using the wrong type of comment. + return false; + } + + $comment_start = $tokens[ $comment_end ]['comment_opener']; + foreach ( $tokens[ $comment_start ]['comment_tags'] as $tag ) { + if ( '@deprecated' === $tokens[ $tag ]['content'] ) { + return true; + } + } + + return false; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php new file mode 100644 index 00000000..3df484ff --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php @@ -0,0 +1,256 @@ + + */ + private $escapingFunctions = array( + 'absint' => true, + 'esc_attr__' => true, + 'esc_attr_e' => true, + 'esc_attr_x' => true, + 'esc_attr' => true, + 'esc_html__' => true, + 'esc_html_e' => true, + 'esc_html_x' => true, + 'esc_html' => true, + 'esc_js' => true, + 'esc_sql' => true, + 'esc_textarea' => true, + 'esc_url_raw' => true, + 'esc_url' => true, + 'esc_xml' => true, + 'filter_input' => true, + 'filter_var' => true, + 'floatval' => true, + 'highlight_string' => true, + 'intval' => true, + 'json_encode' => true, + 'like_escape' => true, + 'number_format' => true, + 'rawurlencode' => true, + 'sanitize_hex_color' => true, + 'sanitize_hex_color_no_hash' => true, + 'sanitize_html_class' => true, + 'sanitize_key' => true, + 'sanitize_locale_name' => true, + 'sanitize_user_field' => true, + 'tag_escape' => true, + 'urlencode_deep' => true, + 'urlencode' => true, + 'wp_json_encode' => true, + 'wp_kses_allowed_html' => true, + 'wp_kses_data' => true, + 'wp_kses_one_attr' => true, + 'wp_kses_post' => true, + 'wp_kses' => true, + ); + + /** + * Functions whose output is automatically escaped for display. + * + * @since 0.5.0 + * @since 0.11.0 Changed from public static to protected non-static. + * @since 3.0.0 - Moved from the Sniff class to this trait. + * - Visibility changed from protected to private. + * + * @var array + */ + private $autoEscapedFunctions = array( + 'allowed_tags' => true, + 'bloginfo' => true, + 'body_class' => true, + 'calendar_week_mod' => true, + 'category_description' => true, + 'checked' => true, + 'comment_class' => true, + 'count' => true, + 'disabled' => true, + 'do_shortcode' => true, + 'do_shortcode_tag' => true, + 'get_archives_link' => true, + 'get_attachment_link' => true, + 'get_avatar' => true, + 'get_bookmark_field' => true, + 'get_calendar' => true, + 'get_comment_author_link' => true, + 'get_current_blog_id' => true, + 'get_delete_post_link' => true, + 'get_search_form' => true, + 'get_search_query' => true, + 'get_the_author_link' => true, + 'get_the_author' => true, + 'get_the_date' => true, + 'get_the_ID' => true, + 'get_the_post_thumbnail' => true, + 'get_the_term_list' => true, + 'post_type_archive_title' => true, + 'readonly' => true, + 'selected' => true, + 'single_cat_title' => true, + 'single_month_title' => true, + 'single_post_title' => true, + 'single_tag_title' => true, + 'single_term_title' => true, + 'tag_description' => true, + 'term_description' => true, + 'the_author' => true, + 'the_date' => true, + 'the_title_attribute' => true, + 'walk_nav_menu_tree' => true, + 'wp_dropdown_categories' => true, + 'wp_dropdown_users' => true, + 'wp_generate_tag_cloud' => true, + 'wp_get_archives' => true, + 'wp_get_attachment_image' => true, + 'wp_get_attachment_link' => true, + 'wp_link_pages' => true, + 'wp_list_authors' => true, + 'wp_list_bookmarks' => true, + 'wp_list_categories' => true, + 'wp_list_comments' => true, + 'wp_login_form' => true, + 'wp_loginout' => true, + 'wp_nav_menu' => true, + 'wp_readonly' => true, + 'wp_register' => true, + 'wp_tag_cloud' => true, + 'wp_timezone_choice' => true, + 'wp_title' => true, + ); + + /** + * Cache of previously added custom functions. + * + * Prevents having to do the same merges over and over again. + * + * @since 0.4.0 + * @since 0.11.0 - Changed from public static to protected non-static. + * - Changed the format from simple bool to array. + * @since 3.0.0 - Moved from the EscapeOutput Sniff class to this trait. + * - Visibility changed from protected to private. + * + * @var array + */ + private $addedCustomEscapingFunctions = array( + 'escape' => array(), + 'autoescape' => array(), + ); + + /** + * Combined list of WP native and custom escaping functions. + * + * @since 3.0.0 + * + * @var array + */ + private $allEscapingFunctions = array(); + + /** + * Combined list of WP native and custom auto-escaping functions. + * + * @since 3.0.0 + * + * @var array + */ + private $allAutoEscapedFunctions = array(); + + /** + * Check if a particular function is regarded as an escaping function. + * + * @since 3.0.0 + * + * @param string $functionName The name of the function to check. + * + * @return bool + */ + final public function is_escaping_function( $functionName ) { + if ( array() === $this->allEscapingFunctions + || $this->customEscapingFunctions !== $this->addedCustomEscapingFunctions['escape'] + ) { + $this->allEscapingFunctions = RulesetPropertyHelper::merge_custom_array( + $this->customEscapingFunctions, + $this->escapingFunctions + ); + + $this->addedCustomEscapingFunctions['escape'] = $this->customEscapingFunctions; + } + + return isset( $this->allEscapingFunctions[ strtolower( $functionName ) ] ); + } + + /** + * Check if a particular function is regarded as an auto-escaped function. + * + * @since 3.0.0 + * + * @param string $functionName The name of the function to check. + * + * @return bool + */ + final public function is_auto_escaped_function( $functionName ) { + if ( array() === $this->allAutoEscapedFunctions + || $this->customAutoEscapedFunctions !== $this->addedCustomEscapingFunctions['autoescape'] + ) { + $this->allAutoEscapedFunctions = RulesetPropertyHelper::merge_custom_array( + $this->customAutoEscapedFunctions, + $this->autoEscapedFunctions + ); + + $this->addedCustomEscapingFunctions['autoescape'] = $this->customAutoEscapedFunctions; + } + + return isset( $this->allAutoEscapedFunctions[ strtolower( $functionName ) ] ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php new file mode 100644 index 00000000..e04298ab --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php @@ -0,0 +1,60 @@ + + */ + private static $formattingFunctions = array( + 'antispambot' => true, + 'array_fill' => true, + 'ent2ncr' => true, + 'implode' => true, + 'join' => true, + 'nl2br' => true, + 'sprintf' => true, + 'vsprintf' => true, + 'wp_sprintf' => true, + ); + + /** + * Check if a particular function is regarded as a formatting function. + * + * @since 3.0.0 + * + * @param string $functionName The name of the function to check. + * + * @return bool + */ + public static function is_formatting_function( $functionName ) { + return isset( self::$formattingFunctions[ strtolower( $functionName ) ] ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php new file mode 100644 index 00000000..0c9c77db --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php @@ -0,0 +1,238 @@ + + * + * + * + * + * + * + * + * ``` + * + * Note: it is strongly _recommended_ to exclude your test directories for + * select error codes of those particular sniffs instead of relying on this + * property/trait. + * + * @since 0.11.0 + * @since 3.0.0 Moved from the Sniff class to this dedicated Trait. + * Renamed from `$custom_test_class_whitelist` to `$custom_test_classes`. + * + * @var string[] + */ + public $custom_test_classes = array(); + + /** + * List of PHPUnit and WP native classes which test classes can extend. + * + * {internal These are the test cases provided in the `/tests/phpunit/includes/` + * directory of WP Core.} + * + * @since 0.11.0 + * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait. + * - Renamed from `$test_class_whitelist` to `$known_test_classes`. + * - Visibility changed from protected to private. + * + * @var array Key is class name, value irrelevant. + */ + private $known_test_classes = array( + // Base test cases. + 'WP_UnitTestCase' => true, + 'WP_UnitTestCase_Base' => true, + 'PHPUnit_Adapter_TestCase' => true, + + // Domain specific base test cases. + 'WP_Ajax_UnitTestCase' => true, + 'WP_Canonical_UnitTestCase' => true, + 'WP_Font_Face_UnitTestCase' => true, + 'WP_Test_REST_Controller_Testcase' => true, + 'WP_Test_REST_Post_Type_Controller_Testcase' => true, + 'WP_Test_REST_TestCase' => true, + 'WP_Test_XML_TestCase' => true, + 'WP_XMLRPC_UnitTestCase' => true, + + // PHPUnit native test cases. + 'PHPUnit_Framework_TestCase' => true, + 'PHPUnit\\Framework\\TestCase' => true, + // PHPUnit native TestCase class when imported via use statement. + 'TestCase' => true, + ); + + /** + * Cache of previously added custom test classes. + * + * Prevents having to do the same merges over and over again. + * + * @since 3.0.0 + * + * @var string[] + */ + private $added_custom_test_classes = array(); + + /** + * Combined list of WP/PHPUnit native and custom test classes. + * + * @since 3.0.0 + * + * @var array + */ + private $all_test_classes = array(); + + /** + * Retrieve a list of all registered test classes, both WP/PHPUnit native as well as custom. + * + * @since 3.0.0 + * + * @return array + */ + final protected function get_all_test_classes() { + if ( array() === $this->all_test_classes + || $this->custom_test_classes !== $this->added_custom_test_classes + ) { + /* + * Show some tolerance for user input. + * The custom test class names should be passed as FQN without a prefixing `\`. + */ + $custom_test_classes = array(); + if ( ! empty( $this->custom_test_classes ) ) { + foreach ( $this->custom_test_classes as $v ) { + $custom_test_classes[] = ltrim( $v, '\\' ); + } + } + + /* + * Lowercase all names, both custom as well as "known", as PHP treats namespaced names case-insensitively. + */ + $custom_test_classes = array_map( 'strtolower', $custom_test_classes ); + $known_test_classes = array_change_key_case( $this->known_test_classes, \CASE_LOWER ); + + $this->all_test_classes = RulesetPropertyHelper::merge_custom_array( + $custom_test_classes, + $known_test_classes + ); + + // Store the original value so the comparison can succeed. + $this->added_custom_test_classes = $this->custom_test_classes; + } + + return $this->all_test_classes; + } + + /** + * Check if a class token is part of a unit test suite. + * + * Unit test classes are identified as such: + * - Class which either extends one of the known test cases, such as `WP_UnitTestCase` + * or `PHPUnit_Framework_TestCase` or extends a custom unit test class as listed in the + * `custom_test_classes` property. + * + * @since 0.12.0 Split off from the `is_token_in_test_method()` method. + * @since 1.0.0 Improved recognition of namespaced class names. + * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the token to be examined. + * This should be a class, anonymous class or trait token. + * + * @return bool True if the class is a unit test class, false otherwise. + */ + final protected function is_test_class( File $phpcsFile, $stackPtr ) { + + $tokens = $phpcsFile->getTokens(); + + if ( isset( $tokens[ $stackPtr ], Tokens::$ooScopeTokens[ $tokens[ $stackPtr ]['code'] ] ) === false ) { + return false; + } + + // Add any potentially extra custom test classes to the known test classes list. + $known_test_classes = $this->get_all_test_classes(); + + $namespace = strtolower( Namespaces::determineNamespace( $phpcsFile, $stackPtr ) ); + + // Is the class/trait one of the known test classes ? + $className = ObjectDeclarations::getName( $phpcsFile, $stackPtr ); + if ( empty( $className ) === false ) { + $className = strtolower( $className ); + if ( '' !== $namespace ) { + if ( isset( $known_test_classes[ $namespace . '\\' . $className ] ) ) { + return true; + } + } elseif ( isset( $known_test_classes[ $className ] ) ) { + return true; + } + } + + // Does the class/trait extend one of the known test classes ? + $extendedClassName = ObjectDeclarations::findExtendedClassName( $phpcsFile, $stackPtr ); + if ( false === $extendedClassName ) { + return false; + } + + $extendedClassName = strtolower( $extendedClassName ); + + if ( '\\' === $extendedClassName[0] ) { + if ( isset( $known_test_classes[ substr( $extendedClassName, 1 ) ] ) ) { + return true; + } + } elseif ( '' !== $namespace ) { + if ( isset( $known_test_classes[ $namespace . '\\' . $extendedClassName ] ) ) { + return true; + } + } elseif ( isset( $known_test_classes[ $extendedClassName ] ) ) { + return true; + } + + /* + * Not examining imported classes via `use` statements as with the variety of syntaxes, + * this would get very complicated. + * After all, users can add an `` for a particular sniff to their + * custom ruleset to selectively exclude the test directory. + */ + + return false; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php new file mode 100644 index 00000000..aa1e2247 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php @@ -0,0 +1,101 @@ +getTokens(); + + // Is this one of the tokens this function handles ? + if ( isset( $tokens[ $stackPtr ], Collections::listOpenTokensBC()[ $tokens[ $stackPtr ]['code'] ] ) === false ) { + return array(); + } + + if ( isset( Collections::shortArrayListOpenTokensBC()[ $tokens[ $stackPtr ]['code'] ] ) + && Lists::isShortList( $phpcsFile, $stackPtr ) === false + ) { + return array(); + } + + try { + $assignments = Lists::getAssignments( $phpcsFile, $stackPtr ); + } catch ( RuntimeException $e ) { + // Parse error/live coding. + return array(); + } + + $var_pointers = array(); + + foreach ( $assignments as $assign ) { + if ( true === $assign['is_empty'] ) { + continue; + } + + if ( true === $assign['is_nested_list'] ) { + /* + * Recurse into the nested list and get the variables. + * No need to `catch` any errors as only lists can be nested in lists. + */ + $var_pointers += self::get_list_variables( $phpcsFile, $assign['assignment_token'] ); + continue; + } + + /* + * Ok, so this must be a "normal" assignment in the list. + * Set the variable pointer both as the key as well as the value, so we can use array join + * for nested lists (above). + */ + $var_pointers[ $assign['assignment_token'] ] = $assign['assignment_token']; + } + + return $var_pointers; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php new file mode 100644 index 00000000..15679337 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php @@ -0,0 +1,159 @@ + + * + * + * + * + * + * Alternatively, the value can be passed in one go for all sniffs using it via + * the command line or by setting a `` value in a custom phpcs.xml ruleset. + * + * CL: `phpcs --runtime-set minimum_wp_version 5.7` + * Ruleset: `` + * + * @since 0.14.0 Previously the individual sniffs each contained this property. + * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait. + * - The property has been renamed from `$minimum_supported_version` to `$minimum_wp_version`. + * - The CLI option has been renamed from `minimum_supported_wp_version` to `minimum_wp_version`. + * + * @var string WordPress version. + */ + public $minimum_wp_version; + + /** + * Default minimum supported WordPress version. + * + * By default, the minimum_wp_version presumes that a project will support the current + * WP version and up to three releases before. + * + * {@internal This should be a constant, but constants in traits are not supported + * until PHP 8.2.}} + * + * @since 3.0.0 + * + * @var string WordPress version. + */ + private $default_minimum_wp_version = '6.2'; + + /** + * Overrule the minimum supported WordPress version with a command-line/config value. + * + * Handle setting the minimum supported WP version in one go for all sniffs which + * expect it via the command line or via a `` variable in a ruleset. + * The config variable overrules the default `$minimum_wp_version` and/or a + * `$minimum_wp_version` set for individual sniffs through the ruleset. + * + * @since 0.14.0 + * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait. + * - Renamed from `get_wp_version_from_cl()` to `set_minimum_wp_version()`. + * + * @return void + */ + final protected function set_minimum_wp_version() { + $minimum_wp_version = ''; + + // Use a ruleset provided value if available. + if ( ! empty( $this->minimum_wp_version ) ) { + $minimum_wp_version = $this->minimum_wp_version; + } + + // A CLI provided value overrules a ruleset provided value. + $cli_supported_version = Helper::getConfigData( 'minimum_wp_version' ); + if ( ! empty( $cli_supported_version ) ) { + $minimum_wp_version = $cli_supported_version; + } + + // If no valid value was provided, use the default. + if ( filter_var( $minimum_wp_version, \FILTER_VALIDATE_FLOAT ) === false ) { + $minimum_wp_version = $this->default_minimum_wp_version; + } + + $this->minimum_wp_version = $minimum_wp_version; + } + + /** + * Compares two version numbers. + * + * @since 3.0.0 + * + * @param string $version1 First version number. + * @param string $version2 Second version number. + * @param string $operator Comparison operator. + * + * @return bool + */ + final protected function wp_version_compare( $version1, $version2, $operator ) { + $version1 = $this->normalize_version_number( $version1 ); + $version2 = $this->normalize_version_number( $version2 ); + + return version_compare( $version1, $version2, $operator ); + } + + /** + * Normalize a version number. + * + * Ensures that a version number is comparable via the PHP version_compare() function + * by making sure it complies with the minimum "PHP-standardized" version number requirements. + * + * Presumes the input is a numeric version number string. The behaviour with other input is undefined. + * + * @since 3.0.0 + * + * @param string $version Version number. + * + * @return string + */ + private function normalize_version_number( $version ) { + if ( preg_match( '`^\d+\.\d+$`', $version ) ) { + $version .= '.0'; + } + + return $version; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php new file mode 100644 index 00000000..edd6dbe2 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php @@ -0,0 +1,122 @@ + + */ + private $printingFunctions = array( + '_deprecated_argument' => true, + '_deprecated_constructor' => true, + '_deprecated_file' => true, + '_deprecated_function' => true, + '_deprecated_hook' => true, + '_doing_it_wrong' => true, + '_e' => true, + '_ex' => true, + 'printf' => true, + 'trigger_error' => true, + 'user_error' => true, + 'vprintf' => true, + 'wp_die' => true, + 'wp_dropdown_pages' => true, + ); + + /** + * Cache of previously added custom functions. + * + * Prevents having to do the same merges over and over again. + * + * @since 0.4.0 + * @since 0.11.0 - Changed from public static to protected non-static. + * - Changed the format from simple bool to array. + * @since 3.0.0 - Moved from the EscapeOutput Sniff class to this trait. + * - Visibility changed from protected to private. + * + * @var string[] + */ + private $addedCustomPrintingFunctions = array(); + + /** + * Combined list of WP/PHP native and custom printing functions. + * + * @since 3.0.0 + * + * @var array + */ + private $allPrintingFunctions = array(); + + /** + * Retrieve a list of all known printing functions. + * + * @since 3.0.0 + * + * @return array + */ + final public function get_printing_functions() { + if ( array() === $this->allPrintingFunctions + || $this->customPrintingFunctions !== $this->addedCustomPrintingFunctions + ) { + $this->allPrintingFunctions = RulesetPropertyHelper::merge_custom_array( + $this->customPrintingFunctions, + $this->printingFunctions + ); + + $this->addedCustomPrintingFunctions = $this->customPrintingFunctions; + } + + return $this->allPrintingFunctions; + } + + /** + * Check if a particular function is regarded as a printing function. + * + * @since 3.0.0 + * + * @param string $functionName The name of the function to check. + * + * @return bool + */ + final public function is_printing_function( $functionName ) { + return isset( $this->get_printing_functions()[ strtolower( $functionName ) ] ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php new file mode 100644 index 00000000..b20c6ed3 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php @@ -0,0 +1,73 @@ + true` format. + * * Any custom items will be given the value `false` to be able to + * distinguish them from pre-set (base array) values. + * * Will filter previously added custom items out from the base array + * before merging/returning to allow for resetting to the base array. + * + * {@internal Function is static as it doesn't use any of the properties or others + * methods anyway.} + * + * @since 0.11.0 + * @since 2.0.0 No longer supports custom array properties which were incorrectly + * passed as a string. + * @since 3.0.0 Moved from the Sniff class to this class. + * + * @param array $custom Custom list as provided via a ruleset. + * @param array $base Optional. Base list. Defaults to an empty array. + * Expects `value => true` format when `$flip` is true. + * @param bool $flip Optional. Whether or not to flip the custom list. + * Defaults to true. + * @return array + */ + public static function merge_custom_array( $custom, array $base = array(), $flip = true ) { + if ( true === $flip ) { + $base = array_filter( $base ); + } + + if ( empty( $custom ) || ! \is_array( $custom ) ) { + return $base; + } + + if ( true === $flip ) { + $custom = array_fill_keys( $custom, false ); + } + + if ( empty( $base ) ) { + return $custom; + } + + return array_merge( $base, $custom ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php new file mode 100644 index 00000000..18769f2b --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php @@ -0,0 +1,418 @@ + + */ + private $sanitizingFunctions = array( + '_wp_handle_upload' => true, + 'esc_url_raw' => true, + 'filter_input' => true, + 'filter_var' => true, + 'hash_equals' => true, + 'is_email' => true, + 'number_format' => true, + 'sanitize_bookmark_field' => true, + 'sanitize_bookmark' => true, + 'sanitize_email' => true, + 'sanitize_file_name' => true, + 'sanitize_hex_color_no_hash' => true, + 'sanitize_hex_color' => true, + 'sanitize_html_class' => true, + 'sanitize_meta' => true, + 'sanitize_mime_type' => true, + 'sanitize_option' => true, + 'sanitize_sql_orderby' => true, + 'sanitize_term_field' => true, + 'sanitize_term' => true, + 'sanitize_text_field' => true, + 'sanitize_textarea_field' => true, + 'sanitize_title_for_query' => true, + 'sanitize_title_with_dashes' => true, + 'sanitize_title' => true, + 'sanitize_url' => true, + 'sanitize_user_field' => true, + 'sanitize_user' => true, + 'validate_file' => true, + 'wp_handle_sideload' => true, + 'wp_handle_upload' => true, + 'wp_kses_allowed_html' => true, + 'wp_kses_data' => true, + 'wp_kses_one_attr' => true, + 'wp_kses_post' => true, + 'wp_kses' => true, + 'wp_parse_id_list' => true, + 'wp_redirect' => true, + 'wp_safe_redirect' => true, + 'wp_sanitize_redirect' => true, + 'wp_strip_all_tags' => true, + ); + + /** + * Sanitizing functions that implicitly unslash the data passed to them. + * + * This list is complementary to the `$sanitizingFunctions` list. + * Sanitizing functions should be added to this list if they also + * implicitely unslash data and to the `$sanitizingFunctions` list + * if they don't. + * + * @since 0.5.0 + * @since 0.11.0 Changed from public static to protected non-static. + * @since 3.0.0 - Moved from the Sniff class to this trait. + * - Visibility changed from protected to private. + * + * @var array + */ + private $unslashingSanitizingFunctions = array( + 'absint' => true, + 'boolval' => true, + 'count' => true, + 'doubleval' => true, + 'floatval' => true, + 'intval' => true, + 'sanitize_key' => true, + 'sanitize_locale_name' => true, + 'sizeof' => true, + ); + + /** + * Cache of previously added custom functions. + * + * Prevents having to do the same merges over and over again. + * + * @since 0.4.0 + * @since 0.11.0 - Changed from public static to protected non-static. + * - Changed the format from simple bool to array. + * @since 3.0.0 - Moved from the NonceVerification and the ValidatedSanitizedInput sniff classes to this class. + * - Visibility changed from protected to private. + * + * @var array + */ + private $addedCustomSanitizingFunctions = array( + 'sanitize' => array(), + 'unslashsanitize' => array(), + ); + + /** + * Combined list of WP/PHP native and custom sanitizing functions. + * + * @since 3.0.0 + * + * @var array + */ + private $allSanitizingFunctions = array(); + + /** + * Combined list of WP/PHP native and custom sanitizing and unslashing functions. + * + * @since 3.0.0 + * + * @var array + */ + private $allUnslashingSanitizingFunctions = array(); + + /** + * Retrieve a list of all known sanitizing functions. + * + * @since 3.0.0 + * + * @return array + */ + final public function get_sanitizing_functions() { + if ( array() === $this->allSanitizingFunctions + || $this->customSanitizingFunctions !== $this->addedCustomSanitizingFunctions['sanitize'] + ) { + $this->allSanitizingFunctions = RulesetPropertyHelper::merge_custom_array( + $this->customSanitizingFunctions, + $this->sanitizingFunctions + ); + + $this->addedCustomSanitizingFunctions['sanitize'] = $this->customSanitizingFunctions; + } + + return $this->allSanitizingFunctions; + } + + /** + * Retrieve a list of all known sanitizing and unslashing functions. + * + * @since 3.0.0 + * + * @return array + */ + final public function get_sanitizing_and_unslashing_functions() { + if ( array() === $this->allUnslashingSanitizingFunctions + || $this->customUnslashingSanitizingFunctions !== $this->addedCustomSanitizingFunctions['unslashsanitize'] + ) { + $this->allUnslashingSanitizingFunctions = RulesetPropertyHelper::merge_custom_array( + $this->customUnslashingSanitizingFunctions, + $this->unslashingSanitizingFunctions + ); + + $this->addedCustomSanitizingFunctions['unslashsanitize'] = $this->customUnslashingSanitizingFunctions; + } + + return $this->allUnslashingSanitizingFunctions; + } + + /** + * Check if a particular function is regarded as a sanitizing function. + * + * @since 3.0.0 + * + * @param string $functionName The name of the function to check. + * + * @return bool + */ + final public function is_sanitizing_function( $functionName ) { + return isset( $this->get_sanitizing_functions()[ strtolower( $functionName ) ] ); + } + + /** + * Check if a particular function is regarded as a sanitizing and unslashing function. + * + * @since 3.0.0 + * + * @param string $functionName The name of the function to check. + * + * @return bool + */ + final public function is_sanitizing_and_unslashing_function( $functionName ) { + return isset( $this->get_sanitizing_and_unslashing_functions()[ strtolower( $functionName ) ] ); + } + + /** + * Check if something is only being sanitized. + * + * @since 0.5.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method visibility was changed from `protected` to `public`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * + * @return bool Whether the token is only within a sanitization. + */ + final public function is_only_sanitized( File $phpcsFile, $stackPtr ) { + $tokens = $phpcsFile->getTokens(); + + // If it isn't being sanitized at all. + if ( ! $this->is_sanitized( $phpcsFile, $stackPtr ) ) { + return false; + } + + // If the token isn't in parentheses, we know the value must have only been casted, because + // is_sanitized() would have returned `false` otherwise. + if ( ! isset( $tokens[ $stackPtr ]['nested_parenthesis'] ) ) { + return true; + } + + // At this point we're expecting the value to have not been casted. If it + // was, it wasn't *only* casted, because it's also in a function. + if ( ContextHelper::is_safe_casted( $phpcsFile, $stackPtr ) ) { + return false; + } + + // The only parentheses should belong to the sanitizing function. If there's + // more than one set, this isn't *only* sanitization. + return ( \count( $tokens[ $stackPtr ]['nested_parenthesis'] ) === 1 ); + } + + /** + * Check if something is being sanitized. + * + * @since 0.5.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method visibility was changed from `protected` to `public`. + * - The `$phpcsFile` parameter was added. + * - The $require_unslash parameter has been changed from + * a boolean toggle to a ?callable $unslash_callback parameter to + * allow a sniff calling this method to handle their "unslashing" + * related messaging itself. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * @param callable|null $unslash_callback Optional. When passed, this method will check if + * an unslashing function is used on the variable before + * sanitization and if not, the callback will be called + * to handle the missing unslashing. + * The callback will receive the $phpcsFile object and + * the $stackPtr. + * When not passed or `null`, this method will **not** + * check for unslashing issues. + * Defaults to `null` (skip unslashing checks). + * + * @return bool Whether the token is being sanitized. + */ + final public function is_sanitized( File $phpcsFile, $stackPtr, $unslash_callback = null ) { + $tokens = $phpcsFile->getTokens(); + $require_unslash = is_callable( $unslash_callback ); + + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + // If the variable is just being unset, the value isn't used at all, so it's safe. + if ( Context::inUnset( $phpcsFile, $stackPtr ) ) { + return true; + } + + // First we check if it is being casted to a safe value. + if ( ContextHelper::is_safe_casted( $phpcsFile, $stackPtr ) ) { + return true; + } + + // If this isn't within a function call, we know already that it's not safe. + if ( ! isset( $tokens[ $stackPtr ]['nested_parenthesis'] ) ) { + if ( $require_unslash ) { + call_user_func( $unslash_callback, $phpcsFile, $stackPtr ); + } + + return false; + } + + $sanitizing_functions = $this->get_sanitizing_functions(); + $sanitizing_functions += $this->get_sanitizing_and_unslashing_functions(); + $sanitizing_functions += ArrayWalkingFunctionsHelper::get_functions(); + $valid_functions = $sanitizing_functions + UnslashingFunctionsHelper::get_functions(); + + // Get the function that it's in. + $functionPtr = ContextHelper::is_in_function_call( $phpcsFile, $stackPtr, $valid_functions ); + + // If this isn't a call to one of the valid functions, it sure isn't a sanitizing function. + if ( false === $functionPtr ) { + if ( true === $require_unslash ) { + call_user_func( $unslash_callback, $phpcsFile, $stackPtr ); + } + + return false; + } + + $functionName = $tokens[ $functionPtr ]['content']; + + // Check if an unslashing function is being used. + $is_unslashed = false; + if ( UnslashingFunctionsHelper::is_unslashing_function( $functionName ) ) { + $is_unslashed = true; + + // Check whether this function call is wrapped within a sanitizing function. + $higherFunctionPtr = ContextHelper::is_in_function_call( $phpcsFile, $functionPtr, $sanitizing_functions ); + + // If there is no other valid function being used, this value is unsanitized. + if ( false === $higherFunctionPtr ) { + return false; + } + + $functionPtr = $higherFunctionPtr; + $functionName = $tokens[ $functionPtr ]['content']; + } + + // Arrays might be sanitized via an array walking function using a callback. + if ( ArrayWalkingFunctionsHelper::is_array_walking_function( $functionName ) ) { + // Get the callback parameter. + $callback = ArrayWalkingFunctionsHelper::get_callback_parameter( $phpcsFile, $functionPtr ); + + if ( ! empty( $callback ) ) { + /* + * If this is a function callback (not a method callback array) and we're able + * to resolve the function name, do so. + */ + $first_non_empty = $phpcsFile->findNext( + Tokens::$emptyTokens, + $callback['start'], + ( $callback['end'] + 1 ), + true + ); + + if ( false !== $first_non_empty && \T_CONSTANT_ENCAPSED_STRING === $tokens[ $first_non_empty ]['code'] ) { + $functionName = TextStrings::stripQuotes( $tokens[ $first_non_empty ]['content'] ); + } + } + } + + // If slashing is required, give an error. + if ( false === $is_unslashed + && true === $require_unslash + && ! $this->is_sanitizing_and_unslashing_function( $functionName ) + ) { + call_user_func( $unslash_callback, $phpcsFile, $stackPtr ); + } + + // Check if this is a sanitizing function. + return ( $this->is_sanitizing_function( $functionName ) || $this->is_sanitizing_and_unslashing_function( $functionName ) ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php new file mode 100644 index 00000000..9937e5e2 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php @@ -0,0 +1,60 @@ + + */ + private static $unslashingFunctions = array( + 'stripslashes_deep' => true, + 'stripslashes_from_strings_only' => true, + 'wp_unslash' => true, + ); + + /** + * Retrieve a list of the unslashing functions. + * + * @since 3.0.0 + * + * @return array + */ + public static function get_functions() { + return self::$unslashingFunctions; + } + + /** + * Check if a particular function is regarded as a unslashing function. + * + * @since 3.0.0 + * + * @param string $functionName The name of the function to check. + * + * @return bool + */ + public static function is_unslashing_function( $functionName ) { + return isset( self::$unslashingFunctions[ strtolower( $functionName ) ] ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php new file mode 100644 index 00000000..d5a22d7d --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php @@ -0,0 +1,349 @@ + + */ + private static $targets = array( + \T_ISSET => 'construct', + \T_EMPTY => 'construct', + \T_STRING => 'function_call', + \T_COALESCE => 'coalesce', + \T_COALESCE_EQUAL => 'coalesce', + ); + + /** + * List of PHP native functions to check if an array index exists. + * + * @since 3.0.0 + * + * @var array + */ + private static $key_exists_functions = array( + 'array_key_exists' => true, + 'key_exists' => true, // Alias. + ); + + /** + * Check if the existence of a variable is validated with isset(), empty(), array_key_exists() + * or key_exists(). + * + * When $in_condition_only is `false`, (which is the default), this is considered + * valid: + * + * ```php + * if ( isset( $var ) ) { + * // Do stuff, like maybe return or exit (but could be anything) + * } + * + * foo( $var ); + * ``` + * + * When it is `true`, that would be invalid; the use of the variable must be within + * the scope of the validating condition, like this: + * + * ```php + * if ( isset( $var ) ) { + * foo( $var ); + * } + * ``` + * + * @since 0.5.0 + * @since 2.1.0 Now recognizes array_key_exists() and key_exists() as validation functions. + * @since 2.1.0 Stricter check on whether the correct variable and the correct + * array keys are being validated. + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The method visibility was changed from `protected` to `public static`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of this token in the stack. + * @param array|string $array_keys An array key to check for ("bar" in $foo['bar']) + * or an array of keys for multi-level array access. + * @param bool $in_condition_only Whether to require that this use of the + * variable occurs within the scope of the + * validating condition, or just in the same + * scope (default). + * + * @return bool Whether the var is validated. + */ + public static function is_validated( File $phpcsFile, $stackPtr, $array_keys = array(), $in_condition_only = false ) { + $tokens = $phpcsFile->getTokens(); + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + if ( $in_condition_only ) { + /* + * This is a stricter check, requiring the variable to be used only + * within the validation condition. + */ + $conditionPtr = Conditions::getLastCondition( $phpcsFile, $stackPtr ); + if ( false === $conditionPtr ) { + // If there are no conditions, there's no validation. + return false; + } + + $condition = $tokens[ $conditionPtr ]; + if ( ! isset( $condition['parenthesis_opener'] ) ) { + // Live coding or parse error. + return false; + } + + $scope_start = $condition['parenthesis_opener']; + $scope_end = $condition['parenthesis_closer']; + + } else { + /* + * We are more loose, requiring only that the variable be validated + * in the same function/file scope as it is used. + */ + $scope_start = 0; + + /* + * Check if we are in a function. + * + * Note: PHP 7.4+ arrow functions are not taken into account as those are not + * included in the "conditions" array. Additionally, arrow functions have + * access to variables outside their direct scope. + */ + $function = Conditions::getLastCondition( $phpcsFile, $stackPtr, array( \T_FUNCTION, \T_CLOSURE ) ); + + // If so, we check only within the function, otherwise the whole file. + if ( false !== $function ) { + $scope_start = $tokens[ $function ]['scope_opener']; + } + + $scope_end = $stackPtr; + } + + if ( ! empty( $array_keys ) && ! is_array( $array_keys ) ) { + $array_keys = (array) $array_keys; + } + + $bare_array_keys = self::strip_quotes_from_array_values( $array_keys ); + + // phpcs:ignore Generic.CodeAnalysis.JumbledIncrementer.Found -- On purpose, see below. + for ( $i = ( $scope_start + 1 ); $i < $scope_end; $i++ ) { + + if ( isset( Collections::closedScopes()[ $tokens[ $i ]['code'] ] ) + && isset( $tokens[ $i ]['scope_closer'] ) + ) { + // Jump over nested closed scopes as validation done within those does not apply. + $i = $tokens[ $i ]['scope_closer']; + continue; + } + + if ( \T_FN === $tokens[ $i ]['code'] + && isset( $tokens[ $i ]['scope_closer'] ) + && $tokens[ $i ]['scope_closer'] < $scope_end + ) { + // Jump over nested arrow functions as long as the current variable isn't *in* the arrow function. + $i = $tokens[ $i ]['scope_closer']; + continue; + } + + if ( isset( self::$targets[ $tokens[ $i ]['code'] ] ) === false ) { + continue; + } + + switch ( self::$targets[ $tokens[ $i ]['code'] ] ) { + case 'construct': + $issetOpener = $phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); + if ( false === $issetOpener + || \T_OPEN_PARENTHESIS !== $tokens[ $issetOpener ]['code'] + || isset( $tokens[ $issetOpener ]['parenthesis_closer'] ) === false + ) { + // Parse error or live coding. + continue 2; + } + + $issetCloser = $tokens[ $issetOpener ]['parenthesis_closer']; + + // Look for this variable. We purposely stomp $i from the parent loop. + for ( $i = ( $issetOpener + 1 ); $i < $issetCloser; $i++ ) { + + if ( \T_VARIABLE !== $tokens[ $i ]['code'] ) { + continue; + } + + if ( $tokens[ $stackPtr ]['content'] !== $tokens[ $i ]['content'] ) { + continue; + } + + // If we're checking for specific array keys (ex: 'hello' in + // $_POST['hello']), that must match too. Quote-style, however, doesn't matter. + if ( ! empty( $bare_array_keys ) ) { + $found_keys = VariableHelper::get_array_access_keys( $phpcsFile, $i ); + $found_keys = self::strip_quotes_from_array_values( $found_keys ); + $diff = array_diff_assoc( $bare_array_keys, $found_keys ); + if ( ! empty( $diff ) ) { + continue; + } + } + + return true; + } + + break; + + case 'function_call': + // Only check calls to array_key_exists() and key_exists(). + if ( isset( self::$key_exists_functions[ strtolower( $tokens[ $i ]['content'] ) ] ) === false ) { + continue 2; + } + + $next_non_empty = $phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); + if ( false === $next_non_empty || \T_OPEN_PARENTHESIS !== $tokens[ $next_non_empty ]['code'] ) { + // Not a function call. + continue 2; + } + + if ( Context::inAttribute( $phpcsFile, $i ) === true ) { + // Definitely not the function call as those are not allowed in attributes. + continue 2; + } + + if ( ContextHelper::has_object_operator_before( $phpcsFile, $i ) === true ) { + // Method call. + continue 2; + } + + if ( ContextHelper::is_token_namespaced( $phpcsFile, $i ) === true ) { + // Namespaced function call. + continue 2; + } + + $params = PassedParameters::getParameters( $phpcsFile, $i ); + + // As `key_exists()` is an alias of `array_key_exists()`, the param positions and names are the same. + $array_param = PassedParameters::getParameterFromStack( $params, 2, 'array' ); + if ( false === $array_param ) { + continue 2; + } + + $array_param_first_token = $phpcsFile->findNext( Tokens::$emptyTokens, $array_param['start'], ( $array_param['end'] + 1 ), true ); + if ( false === $array_param_first_token + || \T_VARIABLE !== $tokens[ $array_param_first_token ]['code'] + || $tokens[ $array_param_first_token ]['content'] !== $tokens[ $stackPtr ]['content'] + ) { + continue 2; + } + + if ( ! empty( $bare_array_keys ) ) { + // Prevent the original array from being altered. + $bare_keys = $bare_array_keys; + $last_key = array_pop( $bare_keys ); + + /* + * For multi-level array access, the complete set of keys could be split between + * the $key and the $array parameter, but could also be completely in the $array + * parameter, so we need to check both options. + */ + $found_keys = VariableHelper::get_array_access_keys( $phpcsFile, $array_param_first_token ); + $found_keys = self::strip_quotes_from_array_values( $found_keys ); + + // First try matching the complete set against the array parameter. + $diff = array_diff_assoc( $bare_array_keys, $found_keys ); + if ( empty( $diff ) ) { + return true; + } + + // If that failed, try getting an exact match for the subset against the + // $array parameter and the last key against the first. + $key_param = PassedParameters::getParameterFromStack( $params, 1, 'key' ); + if ( false !== $key_param + && $bare_keys === $found_keys + && TextStrings::stripQuotes( $key_param['raw'] ) === $last_key + ) { + return true; + } + + // Didn't find the correct array keys. + continue 2; + } + + return true; + + case 'coalesce': + $prev = $i; + do { + $prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $prev - 1 ), null, true ); + // Skip over array keys, like `$_GET['key']['subkey']`. + if ( \T_CLOSE_SQUARE_BRACKET === $tokens[ $prev ]['code'] ) { + $prev = $tokens[ $prev ]['bracket_opener']; + continue; + } + + break; + } while ( $prev >= ( $scope_start + 1 ) ); + + // We should now have reached the variable. + if ( \T_VARIABLE !== $tokens[ $prev ]['code'] ) { + continue 2; + } + + if ( $tokens[ $prev ]['content'] !== $tokens[ $stackPtr ]['content'] ) { + continue 2; + } + + if ( ! empty( $bare_array_keys ) ) { + $found_keys = VariableHelper::get_array_access_keys( $phpcsFile, $prev ); + $found_keys = self::strip_quotes_from_array_values( $found_keys ); + $diff = array_diff_assoc( $bare_array_keys, $found_keys ); + if ( ! empty( $diff ) ) { + continue 2; + } + } + + // Right variable, correct key. + return true; + } + } + + return false; + } + + /** + * Strip quotes of all the values in an array containing only text strings. + * + * @since 3.0.0 + * + * @param string[] $text_strings The input array. + * + * @return string[] + */ + private static function strip_quotes_from_array_values( array $text_strings ) { + return array_map( array( 'PHPCSUtils\Utils\TextStrings', 'stripQuotes' ), $text_strings ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php new file mode 100644 index 00000000..e1076ee4 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php @@ -0,0 +1,262 @@ +getTokens(); + $keys = array(); + + if ( isset( $tokens[ $stackPtr ] ) === false + || \T_VARIABLE !== $tokens[ $stackPtr ]['code'] + ) { + return $keys; + } + + $current = $stackPtr; + + do { + // Find the next non-empty token. + $open_bracket = $phpcsFile->findNext( + Tokens::$emptyTokens, + ( $current + 1 ), + null, + true + ); + + // If it isn't a bracket, this isn't an array-access. + if ( false === $open_bracket + || \T_OPEN_SQUARE_BRACKET !== $tokens[ $open_bracket ]['code'] + || ! isset( $tokens[ $open_bracket ]['bracket_closer'] ) + ) { + break; + } + + $key = GetTokensAsString::compact( + $phpcsFile, + ( $open_bracket + 1 ), + ( $tokens[ $open_bracket ]['bracket_closer'] - 1 ), + true + ); + + $keys[] = trim( $key ); + $current = $tokens[ $open_bracket ]['bracket_closer']; + } while ( isset( $tokens[ $current ] ) && true === $all ); + + return $keys; + } + + /** + * Get the index key of an array variable. + * + * E.g., "bar" in $foo['bar']. + * + * @since 0.5.0 + * @since 2.1.0 Now uses get_array_access_keys() under the hood. + * @since 3.0.0 - Moved from the Sniff class to this class. + * - Visibility is now `public` (was `protected`) and the method `static`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the variable token in the stack. + * + * @return string|false The array index key whose value is being accessed. + */ + public static function get_array_access_key( File $phpcsFile, $stackPtr ) { + $keys = self::get_array_access_keys( $phpcsFile, $stackPtr, false ); + if ( isset( $keys[0] ) ) { + return $keys[0]; + } + + return false; + } + + /** + * Check whether a variable is being compared to another value. + * + * E.g., $var === 'foo', 1 <= $var, etc. + * + * Also recognizes `switch ( $var )` and `match ( $var )`. + * + * @since 0.5.0 + * @since 2.1.0 Added the $include_coalesce parameter. + * @since 3.0.0 - Moved from the Sniff class to this class. + * - Visibility is now `public` (was `protected`) and the method `static`. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of this token in the stack. + * @param bool $include_coalesce Optional. Whether or not to regard the null + * coalesce operator - ?? - as a comparison operator. + * Defaults to true. + * Null coalesce is a special comparison operator in this + * sense as it doesn't compare a variable to whatever is + * on the other side of the comparison operator. + * + * @return bool Whether this is a comparison. + */ + public static function is_comparison( File $phpcsFile, $stackPtr, $include_coalesce = true ) { + $tokens = $phpcsFile->getTokens(); + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + $comparisonTokens = Tokens::$comparisonTokens; + if ( false === $include_coalesce ) { + unset( $comparisonTokens[ \T_COALESCE ] ); + } + + // We first check if this is a switch or match statement (switch ( $var )). + if ( Parentheses::lastOwnerIn( $phpcsFile, $stackPtr, array( \T_SWITCH, \T_MATCH ) ) !== false ) { + return true; + } + + // Find the previous non-empty token. We check before the var first because + // yoda conditions are usually expected. + $previous_token = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); + + if ( isset( $comparisonTokens[ $tokens[ $previous_token ]['code'] ] ) ) { + return true; + } + + // Maybe the comparison operator is after this. + $next_token = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + + // This might be an opening square bracket in the case of arrays ($var['a']). + while ( false !== $next_token + && \T_OPEN_SQUARE_BRACKET === $tokens[ $next_token ]['code'] + && isset( $tokens[ $next_token ]['bracket_closer'] ) + ) { + $next_token = $phpcsFile->findNext( + Tokens::$emptyTokens, + ( $tokens[ $next_token ]['bracket_closer'] + 1 ), + null, + true + ); + } + + if ( false !== $next_token && isset( $comparisonTokens[ $tokens[ $next_token ]['code'] ] ) ) { + return true; + } + + return false; + } + + /** + * Check if this variable is being assigned a value. + * + * E.g., $var = 'foo'; + * + * Also handles array assignments to arbitrary depth: + * + * $array['key'][ $foo ][ something() ] = $bar; + * + * @since 0.5.0 + * @since 3.0.0 - Moved from the Sniff class to this class. + * - Visibility is now `public` (was `protected`) and the method `static`. + * - The `$phpcsFile` parameter was added. + * - The `$include_coalesce` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack. + * This must point to either a T_VARIABLE or + * T_CLOSE_SQUARE_BRACKET token. + * @param bool $include_coalesce Optional. Whether or not to regard the null + * coalesce operator - ?? - as a comparison operator. + * Defaults to true. + * Null coalesce is a special comparison operator in this + * sense as it doesn't compare a variable to whatever is + * on the other side of the comparison operator. + * + * @return bool Whether the token is a variable being assigned a value. + */ + public static function is_assignment( File $phpcsFile, $stackPtr, $include_coalesce = true ) { + $tokens = $phpcsFile->getTokens(); + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + static $valid = array( + \T_VARIABLE => true, + \T_CLOSE_SQUARE_BRACKET => true, + ); + + // Must be a variable or closing square bracket (see below). + if ( ! isset( $valid[ $tokens[ $stackPtr ]['code'] ] ) ) { + return false; + } + + $next_non_empty = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true, null, true ); + + // No token found. + if ( false === $next_non_empty ) { + return false; + } + + $assignmentTokens = Tokens::$assignmentTokens; + if ( false === $include_coalesce ) { + unset( $assignmentTokens[ \T_COALESCE_EQUAL ] ); + } + + // If the next token is an assignment, that's all we need to know. + if ( isset( $assignmentTokens[ $tokens[ $next_non_empty ]['code'] ] ) ) { + return true; + } + + // Check if this is an array assignment, e.g., `$var['key'] = 'val';` . + if ( \T_OPEN_SQUARE_BRACKET === $tokens[ $next_non_empty ]['code'] + && isset( $tokens[ $next_non_empty ]['bracket_closer'] ) + ) { + return self::is_assignment( $phpcsFile, $tokens[ $next_non_empty ]['bracket_closer'], $include_coalesce ); + } + + return false; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php new file mode 100644 index 00000000..1f325eff --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php @@ -0,0 +1,115 @@ +getTokens(); + if ( isset( $tokens[ $stackPtr ] ) === false ) { + return false; + } + + // Check for wpdb. + if ( ( \T_VARIABLE === $tokens[ $stackPtr ]['code'] && '$wpdb' !== $tokens[ $stackPtr ]['content'] ) + || ( \T_STRING === $tokens[ $stackPtr ]['code'] && 'wpdb' !== strtolower( $tokens[ $stackPtr ]['content'] ) ) + ) { + return false; + } + + // Check that this is a method call. + $is_object_call = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( false === $is_object_call + || isset( Collections::objectOperators()[ $tokens[ $is_object_call ]['code'] ] ) === false + ) { + return false; + } + + $methodPtr = $phpcsFile->findNext( Tokens::$emptyTokens, ( $is_object_call + 1 ), null, true, null, true ); + if ( false === $methodPtr ) { + return false; + } + + if ( \T_STRING === $tokens[ $methodPtr ]['code'] && property_exists( $this, 'methodPtr' ) ) { + $this->methodPtr = $methodPtr; + } + + // Find the opening parenthesis. + $opening_paren = $phpcsFile->findNext( Tokens::$emptyTokens, ( $methodPtr + 1 ), null, true, null, true ); + + if ( false === $opening_paren ) { + return false; + } + + if ( property_exists( $this, 'i' ) ) { + $this->i = $opening_paren; + } + + if ( \T_OPEN_PARENTHESIS !== $tokens[ $opening_paren ]['code'] + || ! isset( $tokens[ $opening_paren ]['parenthesis_closer'] ) + ) { + return false; + } + + // Check that this is one of the methods that we are interested in. + if ( ! isset( $target_methods[ strtolower( $tokens[ $methodPtr ]['content'] ) ] ) ) { + return false; + } + + // Find the end of the first parameter. + $end = BCFile::findEndOfStatement( $phpcsFile, $opening_paren + 1 ); + + if ( \T_COMMA !== $tokens[ $end ]['code'] ) { + ++$end; + } + + if ( property_exists( $this, 'end' ) ) { + $this->end = $end; + } + + return true; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php new file mode 100644 index 00000000..b5097931 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php @@ -0,0 +1,312 @@ + The key is the name of a WP global variable, the value is irrelevant. + */ + private static $wp_globals = array( + '_links_add_base' => true, + '_links_add_target' => true, + '_menu_item_sort_prop' => true, + '_nav_menu_placeholder' => true, + '_new_bundled_files' => true, + '_old_files' => true, + '_parent_pages' => true, + '_registered_pages' => true, + '_updated_user_settings' => true, + '_wp_additional_image_sizes' => true, + '_wp_admin_css_colors' => true, + '_wp_default_headers' => true, + '_wp_deprecated_widgets_callbacks' => true, + '_wp_last_object_menu' => true, + '_wp_last_utility_menu' => true, + '_wp_menu_nopriv' => true, + '_wp_nav_menu_max_depth' => true, + '_wp_post_type_features' => true, + '_wp_real_parent_file' => true, + '_wp_registered_nav_menus' => true, + '_wp_sidebars_widgets' => true, + '_wp_submenu_nopriv' => true, + '_wp_suspend_cache_invalidation' => true, + '_wp_theme_features' => true, + '_wp_using_ext_object_cache' => true, + 'action' => true, + 'active_signup' => true, + 'admin_body_class' => true, + 'admin_page_hooks' => true, + 'all_links' => true, + 'allowedentitynames' => true, + 'allowedposttags' => true, + 'allowedtags' => true, + 'auth_secure_cookie' => true, + 'authordata' => true, + 'avail_post_mime_types' => true, + 'avail_post_stati' => true, + 'blog_id' => true, + 'blog_title' => true, + 'blogname' => true, + 'cat' => true, + 'cat_id' => true, + 'charset_collate' => true, + 'comment' => true, + 'comment_alt' => true, + 'comment_depth' => true, + 'comment_status' => true, + 'comment_thread_alt' => true, + 'comment_type' => true, + 'comments' => true, + 'compress_css' => true, + 'compress_scripts' => true, + 'concatenate_scripts' => true, + 'content_width' => true, + 'current_blog' => true, + 'current_screen' => true, + 'current_site' => true, + 'current_user' => true, + 'currentcat' => true, + 'currentday' => true, + 'currentmonth' => true, + 'custom_background' => true, + 'custom_image_header' => true, + 'default_menu_order' => true, + 'descriptions' => true, + 'domain' => true, + 'editor_styles' => true, + 'error' => true, + 'errors' => true, + 'EZSQL_ERROR' => true, + 'feeds' => true, + 'GETID3_ERRORARRAY' => true, + 'hook_suffix' => true, + 'HTTP_RAW_POST_DATA' => true, + 'id' => true, + 'in_comment_loop' => true, + 'interim_login' => true, + 'is_apache' => true, + 'is_chrome' => true, + 'is_gecko' => true, + 'is_IE' => true, + 'is_IIS' => true, + 'is_iis7' => true, + 'is_macIE' => true, + 'is_NS4' => true, + 'is_opera' => true, + 'is_safari' => true, + 'is_winIE' => true, + 'l10n' => true, + 'link' => true, + 'link_id' => true, + 'locale' => true, + 'locked_post_status' => true, + 'lost' => true, + 'm' => true, + 'map' => true, + 'menu' => true, + 'menu_order' => true, + 'merged_filters' => true, + 'mode' => true, + 'monthnum' => true, + 'more' => true, + 'mu_plugin' => true, + 'multipage' => true, + 'names' => true, + 'nav_menu_selected_id' => true, + 'network_plugin' => true, + 'new_whitelist_options' => true, + 'numpages' => true, + 'one_theme_location_no_menus' => true, + 'opml' => true, + 'order' => true, + 'orderby' => true, + 'overridden_cpage' => true, + 'page' => true, + 'paged' => true, + 'pagenow' => true, + 'pages' => true, + 'parent_file' => true, + 'pass_allowed_html' => true, + 'pass_allowed_protocols' => true, + 'path' => true, + 'per_page' => true, + 'PHP_SELF' => true, + 'phpmailer' => true, + 'plugin_page' => true, + 'plugin' => true, + 'plugins' => true, + 'post' => true, + 'post_default_category' => true, + 'post_default_title' => true, + 'post_ID' => true, + 'post_id' => true, + 'post_mime_types' => true, + 'post_type' => true, + 'post_type_object' => true, + 'posts' => true, + 'preview' => true, + 'previouscat' => true, + 'previousday' => true, + 'previousweekday' => true, + 'redir_tab' => true, + 'required_mysql_version' => true, + 'required_php_version' => true, + 'rnd_value' => true, + 'role' => true, + 's' => true, + 'search' => true, + 'self' => true, + 'shortcode_tags' => true, + 'show_admin_bar' => true, + 'sidebars_widgets' => true, + 'status' => true, + 'submenu' => true, + 'submenu_file' => true, + 'super_admins' => true, + 'tab' => true, + 'table_prefix' => true, + 'tabs' => true, + 'tag' => true, + 'tag_ID' => true, + 'targets' => true, + 'tax' => true, + 'taxnow' => true, + 'taxonomy' => true, + 'term' => true, + 'text_direction' => true, + 'theme_field_defaults' => true, + 'themes_allowedtags' => true, + 'timeend' => true, + 'timestart' => true, + 'tinymce_version' => true, + 'title' => true, + 'totals' => true, + 'type' => true, + 'typenow' => true, + 'updated_timestamp' => true, + 'upgrading' => true, + 'urls' => true, + 'user_email' => true, + 'user_ID' => true, + 'user_identity' => true, + 'user_level' => true, + 'user_login' => true, + 'user_url' => true, + 'userdata' => true, + 'usersearch' => true, + 'whitelist_options' => true, + 'withcomments' => true, + 'wp' => true, + 'wp_actions' => true, + 'wp_admin_bar' => true, + 'wp_cockneyreplace' => true, + 'wp_current_db_version' => true, + 'wp_current_filter' => true, + 'wp_customize' => true, + 'wp_dashboard_control_callbacks' => true, + 'wp_db_version' => true, + 'wp_did_header' => true, + 'wp_embed' => true, + 'wp_file_descriptions' => true, + 'wp_filesystem' => true, + 'wp_filter' => true, + 'wp_hasher' => true, + 'wp_header_to_desc' => true, + 'wp_importers' => true, + 'wp_json' => true, + 'wp_list_table' => true, + 'wp_local_package' => true, + 'wp_locale' => true, + 'wp_meta_boxes' => true, + 'wp_object_cache' => true, + 'wp_plugin_paths' => true, + 'wp_post_statuses' => true, + 'wp_post_types' => true, + 'wp_queries' => true, + 'wp_query' => true, + 'wp_registered_sidebars' => true, + 'wp_registered_widget_controls' => true, + 'wp_registered_widget_updates' => true, + 'wp_registered_widgets' => true, + 'wp_rewrite' => true, + 'wp_rich_edit' => true, + 'wp_rich_edit_exists' => true, + 'wp_roles' => true, + 'wp_scripts' => true, + 'wp_settings_errors' => true, + 'wp_settings_fields' => true, + 'wp_settings_sections' => true, + 'wp_smiliessearch' => true, + 'wp_styles' => true, + 'wp_taxonomies' => true, + 'wp_the_query' => true, + 'wp_theme_directories' => true, + 'wp_themes' => true, + 'wp_user_roles' => true, + 'wp_version' => true, + 'wp_widget_factory' => true, + 'wp_xmlrpc_server' => true, + 'wpcommentsjavascript' => true, + 'wpcommentspopupfile' => true, + 'wpdb' => true, + 'wpsmiliestrans' => true, + 'year' => true, + ); + + /** + * Retrieve a list with the names of global WP variables. + * + * @since 3.0.0 + * + * @return array Array with the variables names as keys. The value is irrelevant. + */ + public static function get_names() { + return self::$wp_globals; + } + + /** + * Verify if a given variable name is the name of a WP global variable. + * + * @since 3.0.0 + * + * @param string $name The full variable name with or without leading dollar sign. + * This allows for passing an array key variable name, such as + * `'_GET'` retrieved from `$GLOBALS['_GET']`. + * > Note: when passing an array key, string quotes are expected + * to have been stripped already. + * + * @return bool + */ + public static function is_wp_global( $name ) { + if ( strpos( $name, '$' ) === 0 ) { + $name = substr( $name, 1 ); + } + + return isset( self::$wp_globals[ $name ] ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php new file mode 100644 index 00000000..b5b4f4a1 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php @@ -0,0 +1,113 @@ +> Function name as key, array with target + * parameter position and name(s) as value. + */ + private static $hookInvokeFunctions = array( + 'do_action' => array( + 'position' => 1, + 'name' => 'hook_name', + ), + 'do_action_ref_array' => array( + 'position' => 1, + 'name' => 'hook_name', + ), + 'do_action_deprecated' => array( + 'position' => 1, + 'name' => 'hook_name', + ), + 'apply_filters' => array( + 'position' => 1, + 'name' => 'hook_name', + ), + 'apply_filters_ref_array' => array( + 'position' => 1, + 'name' => 'hook_name', + ), + 'apply_filters_deprecated' => array( + 'position' => 1, + 'name' => 'hook_name', + ), + ); + + /** + * Retrieve a list of the WordPress functions which invoke hooks. + * + * @since 3.0.0 + * + * @param bool $include_deprecated Whether to include the names of functions + * which are used to invoke deprecated hooks. + * Defaults to `true`. + * + * @return array Array with the function names as keys. The value is irrelevant. + */ + public static function get_functions( $include_deprecated = true ) { + $hooks = array_fill_keys( array_keys( self::$hookInvokeFunctions ), true ); + if ( false === $include_deprecated ) { + unset( + $hooks['do_action_deprecated'], + $hooks['apply_filters_deprecated'] + ); + } + + return $hooks; + } + + /** + * Retrieve the parameter information for the hook name parameter from a stack of parameters + * passed to one of the WP hook functions. + * + * @since 3.0.0 + * + * @param string $function_name The name of the WP hook function which the parameters were passed to. + * @param array $parameters The output of a previous call to PassedParameters::getParameters(). + * + * @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 the PHPCSUtils PassedParameters::getParameters() documentation + * for the format of the returned (single-dimensional) array. + */ + public static function get_hook_name_param( $function_name, array $parameters ) { + $function_lc = strtolower( $function_name ); + if ( isset( self::$hookInvokeFunctions[ $function_lc ] ) === false ) { + return false; + } + + return PassedParameters::getParameterFromStack( + $parameters, + self::$hookInvokeFunctions[ $function_lc ]['position'], + self::$hookInvokeFunctions[ $function_lc ]['name'] + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php new file mode 100644 index 00000000..eaa7c22b --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php @@ -0,0 +1,72 @@ +phpcsFile = $phpcsFile; + $this->tokens = $phpcsFile->getTokens(); + + return $this->process_token( $stackPtr ); + } + + /** + * Processes a sniff when one of its tokens is encountered. + * + * @since 0.11.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + abstract public function process_token( $stackPtr ); +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php new file mode 100644 index 00000000..de35bdff --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php @@ -0,0 +1,252 @@ +tokens[ $stackPtr ]['code'] ] ) + && Arrays::isShortArray( $this->phpcsFile, $stackPtr ) === false + ) { + // Short list, not short array. + return; + } + + /* + * Determine the array opener & closer. + */ + $array_open_close = Arrays::getOpenClose( $this->phpcsFile, $stackPtr ); + if ( false === $array_open_close ) { + // Array open/close could not be determined. + return; + } + + $opener = $array_open_close['opener']; + $closer = $array_open_close['closer']; + unset( $array_open_close ); + + // Pass off to either the single line or multi-line array analysis. + if ( $this->tokens[ $opener ]['line'] === $this->tokens[ $closer ]['line'] ) { + $this->process_single_line_array( $stackPtr, $opener, $closer ); + } else { + $this->process_multi_line_array( $stackPtr, $opener ); + } + } + + /** + * Check that associative arrays are always multi-line. + * + * @since 0.13.0 The actual checks contained in this method used to + * be in the `process()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * @param int $opener The position of the array opener. + * @param int $closer The position of the array closer. + * + * @return void + */ + protected function process_single_line_array( $stackPtr, $opener, $closer ) { + $array_items = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); + if ( ( false === $this->allow_single_item_single_line_associative_arrays + && empty( $array_items ) ) + || ( true === $this->allow_single_item_single_line_associative_arrays + && \count( $array_items ) === 1 ) + ) { + return; + } + + /* + * Make sure the double arrow is for *this* array, not for a nested one. + */ + $array_has_keys = false; + foreach ( $array_items as $item ) { + if ( Arrays::getDoubleArrowPtr( $this->phpcsFile, $item['start'], $item['end'] ) !== false ) { + $array_has_keys = true; + break; + } + } + + if ( false === $array_has_keys ) { + return; + } + $error = 'When an array uses associative keys, each value should start on %s.'; + if ( true === $this->allow_single_item_single_line_associative_arrays ) { + $error = 'When a multi-item array uses associative keys, each value should start on %s.'; + } + + /* + * Just add a new line before the array closer. + * The multi-line array fixer will then fix the individual array items in the next fixer loop. + */ + SpacesFixer::checkAndFix( + $this->phpcsFile, + $closer, + $this->phpcsFile->findPrevious( \T_WHITESPACE, ( $closer - 1 ), null, true ), + 'newline', + $error, + 'AssociativeArrayFound', + 'error' + ); + } + + /** + * Process a multi-line array. + * + * @since 0.13.0 The actual checks contained in this method used to + * be in the `ArrayDeclaration` sniff. + * @since 3.0.0 Removed the `$closer` parameter. + * + * @param int $stackPtr The position of the current token in the stack. + * @param int $opener The position of the array opener. + * + * @return void + */ + protected function process_multi_line_array( $stackPtr, $opener ) { + /* + * Check that each array item starts on a new line. + */ + $array_items = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); + $end_of_last_item = $opener; + + foreach ( $array_items as $item ) { + $end_of_this_item = ( $item['end'] + 1 ); + + // Find the line on which the item starts. + $first_content = $this->phpcsFile->findNext( + array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), + $item['start'], + $end_of_this_item, + true + ); + + // Ignore comments after array items if the next real content starts on a new line. + if ( $this->tokens[ $first_content ]['line'] === $this->tokens[ $end_of_last_item ]['line'] + && ( \T_COMMENT === $this->tokens[ $first_content ]['code'] + || isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $first_content ]['code'] ] ) ) + ) { + $end_of_comment = $first_content; + + // Find the end of (multi-line) /* */- style trailing comments. + if ( substr( ltrim( $this->tokens[ $end_of_comment ]['content'] ), 0, 2 ) === '/*' ) { + while ( ( \T_COMMENT === $this->tokens[ $end_of_comment ]['code'] + || isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $end_of_comment ]['code'] ] ) ) + && substr( rtrim( $this->tokens[ $end_of_comment ]['content'] ), -2 ) !== '*/' + && ( $end_of_comment + 1 ) < $end_of_this_item + ) { + ++$end_of_comment; + } + + if ( $this->tokens[ $end_of_comment ]['line'] !== $this->tokens[ $end_of_last_item ]['line'] ) { + // Multi-line trailing comment. + $end_of_last_item = $end_of_comment; + } + } + + $next = $this->phpcsFile->findNext( + array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), + ( $end_of_comment + 1 ), + $end_of_this_item, + true + ); + + if ( false === $next ) { + // Shouldn't happen, but just in case. + $end_of_last_item = $end_of_this_item; // @codeCoverageIgnore + continue; // @codeCoverageIgnore + } + + if ( $this->tokens[ $next ]['line'] !== $this->tokens[ $first_content ]['line'] ) { + $first_content = $next; + } + } + + if ( false === $first_content ) { + // Shouldn't happen, but just in case. + $end_of_last_item = $end_of_this_item; // @codeCoverageIgnore + continue; // @codeCoverageIgnore + } + + if ( $this->tokens[ $end_of_last_item ]['line'] === $this->tokens[ $first_content ]['line'] ) { + SpacesFixer::checkAndFix( + $this->phpcsFile, + $first_content, + $end_of_last_item, + 'newline', + 'Each item in a multi-line array must be on %s. Found: %s', + 'ArrayItemNoNewLine', + 'error' + ); + } + + $end_of_last_item = $end_of_this_item; + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php new file mode 100644 index 00000000..76bcda60 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php @@ -0,0 +1,550 @@ +ignore_tokens = Tokens::$heredocTokens; + unset( $this->ignore_tokens[ \T_START_HEREDOC ], $this->ignore_tokens[ \T_START_NOWDOC ] ); + $this->ignore_tokens[ \T_INLINE_HTML ] = \T_INLINE_HTML; + + return Collections::arrayOpenTokensBC(); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + if ( ! isset( $this->tab_width ) ) { + $this->tab_width = Helper::getTabWidth( $this->phpcsFile ); + } + + if ( isset( Collections::shortArrayListOpenTokensBC()[ $this->tokens[ $stackPtr ]['code'] ] ) + && Arrays::isShortArray( $this->phpcsFile, $stackPtr ) === false + ) { + // Short list, not short array. + return; + } + + /* + * Determine the array opener & closer. + */ + $array_open_close = Arrays::getOpenClose( $this->phpcsFile, $stackPtr ); + if ( false === $array_open_close ) { + // Array open/close could not be determined. + return; + } + + $opener = $array_open_close['opener']; + $closer = $array_open_close['closer']; + + if ( $this->tokens[ $opener ]['line'] === $this->tokens[ $closer ]['line'] ) { + // Not interested in single line arrays. + return; + } + + /* + * Check the closing bracket is lined up with the start of the content on the line + * containing the array opener. + */ + $opener_line_spaces = $this->get_indentation_size( $opener ); + $closer_line_spaces = ( $this->tokens[ $closer ]['column'] - 1 ); + + if ( $closer_line_spaces !== $opener_line_spaces ) { + $error = 'Array closer not aligned correctly; expected %s space(s) but found %s'; + $error_code = 'CloseBraceNotAligned'; + + /* + * Report & fix the issue if the close brace is on its own line with + * nothing or only indentation whitespace before it. + */ + if ( 0 === $closer_line_spaces + || ( \T_WHITESPACE === $this->tokens[ ( $closer - 1 ) ]['code'] + && 1 === $this->tokens[ ( $closer - 1 ) ]['column'] ) + ) { + $this->add_array_alignment_error( + $closer, + $error, + $error_code, + $opener_line_spaces, + $closer_line_spaces, + $this->get_indentation_string( $opener_line_spaces ) + ); + } else { + /* + * Otherwise, only report the error, don't try and fix it (yet). + * + * It will get corrected in a future loop of the fixer once the closer + * has been moved to its own line by the `ArrayDeclarationSpacing` sniff. + */ + $this->phpcsFile->addError( + $error, + $closer, + $error_code, + array( $opener_line_spaces, $closer_line_spaces ) + ); + } + + unset( $error, $error_code ); + } + + /* + * Verify & correct the array item indentation. + */ + $array_items = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); + if ( empty( $array_items ) ) { + // Strange, no array items found. + return; + } + + $expected_spaces = ( $opener_line_spaces + $this->tab_width ); + $expected_indent = $this->get_indentation_string( $expected_spaces ); + $end_of_previous_item = $opener; + + foreach ( $array_items as $item ) { + $end_of_this_item = ( $item['end'] + 1 ); + + // Find the line on which the item starts. + $first_content = $this->phpcsFile->findNext( + array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), + $item['start'], + $end_of_this_item, + true + ); + + // Deal with trailing comments. + if ( false !== $first_content + && \T_COMMENT === $this->tokens[ $first_content ]['code'] + && $this->tokens[ $first_content ]['line'] === $this->tokens[ $end_of_previous_item ]['line'] + ) { + $first_content = $this->phpcsFile->findNext( + array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE, \T_COMMENT ), + ( $first_content + 1 ), + $end_of_this_item, + true + ); + } + + if ( false === $first_content ) { + $end_of_previous_item = $end_of_this_item; + continue; + } + + // Bow out from reporting and fixing mixed multi-line/single-line arrays. + // That is handled by the ArrayDeclarationSpacingSniff. + if ( $this->tokens[ $first_content ]['line'] === $this->tokens[ $end_of_previous_item ]['line'] ) { + return $closer; + } + + // Ignore this item if there is anything but whitespace before the start of the next item. + if ( 1 !== $this->tokens[ $first_content ]['column'] ) { + // Go to the start of the line. + $i = $first_content; + while ( 1 !== $this->tokens[ --$i ]['column'] ); + + if ( \T_WHITESPACE !== $this->tokens[ $i ]['code'] ) { + $end_of_previous_item = $end_of_this_item; + continue; + } + } + + $found_spaces = ( $this->tokens[ $first_content ]['column'] - 1 ); + + if ( $found_spaces !== $expected_spaces ) { + $this->add_array_alignment_error( + $first_content, + 'Array item not aligned correctly; expected %s spaces but found %s', + 'ItemNotAligned', + $expected_spaces, + $found_spaces, + $expected_indent + ); + } + + // No need for further checking if this is a one-line array item. + if ( $this->tokens[ $first_content ]['line'] === $this->tokens[ $item['end'] ]['line'] ) { + $end_of_previous_item = $end_of_this_item; + continue; + } + + /* + * Multi-line array items. + * + * Verify & if needed, correct the indentation of subsequent lines. + * Subsequent lines may be indented more or less than the mimimum expected indent, + * but the "first line after" should be indented - at least - as much as the very first line + * of the array item. + * Indentation correction for subsequent lines will be based on that diff. + */ + + // Find first token on second line of the array item. + // If the second line is a heredoc/nowdoc, continue on until we find a line with a different token. + // Same for the second line of a multi-line text string. + for ( $ptr = ( $first_content + 1 ); $ptr <= $item['end']; $ptr++ ) { + if ( $this->tokens[ $first_content ]['line'] !== $this->tokens[ $ptr ]['line'] + && 1 === $this->tokens[ $ptr ]['column'] + && false === $this->ignore_token( $ptr ) + ) { + break; + } + } + + $first_content_on_line2 = $this->phpcsFile->findNext( + array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), + $ptr, + $end_of_this_item, + true + ); + + if ( false === $first_content_on_line2 ) { + /* + * Apparently there were only tokens in the ignore list on subsequent lines. + * + * In that case, the comma after the array item might be on a line by itself, + * so check its placement. + */ + if ( $this->tokens[ $item['end'] ]['line'] !== $this->tokens[ $end_of_this_item ]['line'] + && \T_COMMA === $this->tokens[ $end_of_this_item ]['code'] + && ( $this->tokens[ $end_of_this_item ]['column'] - 1 ) !== $expected_spaces + ) { + $this->add_array_alignment_error( + $end_of_this_item, + 'Comma after multi-line array item not aligned correctly; expected %s spaces, but found %s', + 'MultiLineArrayItemCommaNotAligned', + $expected_spaces, + ( $this->tokens[ $end_of_this_item ]['column'] - 1 ), + $expected_indent + ); + } + + $end_of_previous_item = $end_of_this_item; + continue; + } + + $found_spaces_on_line2 = $this->get_indentation_size( $first_content_on_line2 ); + $expected_spaces_on_line2 = $expected_spaces; + + if ( $found_spaces < $found_spaces_on_line2 ) { + $expected_spaces_on_line2 += ( $found_spaces_on_line2 - $found_spaces ); + } + + if ( $found_spaces_on_line2 !== $expected_spaces_on_line2 ) { + + $fix = $this->phpcsFile->addFixableError( + 'Multi-line array item not aligned correctly; expected %s spaces, but found %s', + $first_content_on_line2, + 'MultiLineArrayItemNotAligned', + array( + $expected_spaces_on_line2, + $found_spaces_on_line2, + ) + ); + + if ( true === $fix ) { + $expected_indent_on_line2 = $this->get_indentation_string( $expected_spaces_on_line2 ); + + $this->phpcsFile->fixer->beginChangeset(); + + // Fix second line for the array item. + if ( 1 === $this->tokens[ $first_content_on_line2 ]['column'] + && \T_COMMENT === $this->tokens[ $first_content_on_line2 ]['code'] + ) { + $actual_comment = ltrim( $this->tokens[ $first_content_on_line2 ]['content'] ); + $replacement = $expected_indent_on_line2 . $actual_comment; + + $this->phpcsFile->fixer->replaceToken( $first_content_on_line2, $replacement ); + + } else { + $this->fix_alignment_error( $first_content_on_line2, $expected_indent_on_line2 ); + } + + // Fix subsequent lines. + for ( $i = ( $first_content_on_line2 + 1 ); $i <= $item['end']; $i++ ) { + // We're only interested in the first token on each line. + if ( 1 !== $this->tokens[ $i ]['column'] ) { + if ( $this->tokens[ $i ]['line'] === $this->tokens[ $item['end'] ]['line'] ) { + // We might as well quit if we're past the first token on the last line. + break; + } + continue; + } + + $first_content_on_line = $this->phpcsFile->findNext( + array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), + $i, + $end_of_this_item, + true + ); + + if ( false === $first_content_on_line ) { + break; + } + + // Ignore lines with heredoc and nowdoc tokens and subsequent lines in multi-line strings. + if ( true === $this->ignore_token( $first_content_on_line ) ) { + $i = $first_content_on_line; + continue; + } + + $found_spaces_on_line = $this->get_indentation_size( $first_content_on_line ); + $expected_spaces_on_line = ( $expected_spaces_on_line2 + ( $found_spaces_on_line - $found_spaces_on_line2 ) ); + $expected_spaces_on_line = max( $expected_spaces_on_line, 0 ); // Can't be below 0. + $expected_indent_on_line = $this->get_indentation_string( $expected_spaces_on_line ); + + if ( $found_spaces_on_line !== $expected_spaces_on_line ) { + if ( 1 === $this->tokens[ $first_content_on_line ]['column'] + && \T_COMMENT === $this->tokens[ $first_content_on_line ]['code'] + ) { + $actual_comment = ltrim( $this->tokens[ $first_content_on_line ]['content'] ); + $replacement = $expected_indent_on_line . $actual_comment; + + $this->phpcsFile->fixer->replaceToken( $first_content_on_line, $replacement ); + } else { + $this->fix_alignment_error( $first_content_on_line, $expected_indent_on_line ); + } + } + + // Move past any potential empty lines between the previous non-empty line and this one. + // No need to do the fixes twice. + $i = $first_content_on_line; + } + + /* + * Check the placement of the comma after the array item as it might be on a line by itself. + */ + if ( $this->tokens[ $item['end'] ]['line'] !== $this->tokens[ $end_of_this_item ]['line'] + && \T_COMMA === $this->tokens[ $end_of_this_item ]['code'] + && ( $this->tokens[ $end_of_this_item ]['column'] - 1 ) !== $expected_spaces + ) { + $this->add_array_alignment_error( + $end_of_this_item, + 'Comma after array item not aligned correctly; expected %s spaces, but found %s', + 'MultiLineArrayItemCommaNotAligned', + $expected_spaces, + ( $this->tokens[ $end_of_this_item ]['column'] - 1 ), + $expected_indent + ); + } + + $this->phpcsFile->fixer->endChangeset(); + } + } + + $end_of_previous_item = $end_of_this_item; + } + } + + /** + * Should the token be ignored ? + * + * This method is only intended to be used with the first token on a line + * for subsequent lines in an multi-line array item. + * + * @param int $ptr Stack pointer to the first token on a line. + * + * @return bool + */ + protected function ignore_token( $ptr ) { + $token_code = $this->tokens[ $ptr ]['code']; + + if ( isset( $this->ignore_tokens[ $token_code ] ) ) { + return true; + } + + /* + * If it's a subsequent line of a multi-line sting, it will not start with a quote + * character, nor just *be* a quote character. + */ + if ( isset( Tokens::$stringTokens[ $token_code ] ) === true ) { + // Deal with closing quote of a multi-line string being on its own line. + if ( "'" === $this->tokens[ $ptr ]['content'] + || '"' === $this->tokens[ $ptr ]['content'] + ) { + return true; + } + + // Deal with subsequent lines of a multi-line string where the token is broken up per line. + if ( "'" !== $this->tokens[ $ptr ]['content'][0] + && '"' !== $this->tokens[ $ptr ]['content'][0] + ) { + return true; + } + } + + return false; + } + + /** + * Determine the line indentation whitespace. + * + * @param int $ptr Stack pointer to an arbitrary token on a line. + * + * @return int Nr of spaces found. Where necessary, tabs are translated to spaces. + */ + protected function get_indentation_size( $ptr ) { + + // Find the first token on the line. + for ( ; $ptr >= 0; $ptr-- ) { + if ( 1 === $this->tokens[ $ptr ]['column'] ) { + break; + } + } + + $whitespace = ''; + + if ( \T_WHITESPACE === $this->tokens[ $ptr ]['code'] + || \T_DOC_COMMENT_WHITESPACE === $this->tokens[ $ptr ]['code'] + ) { + return $this->tokens[ $ptr ]['length']; + } + + /* + * Special case for multi-line, non-docblock comments. + * Only applicable for subsequent lines in an array item. + * + * First/Single line is tokenized as T_WHITESPACE + T_COMMENT + * Subsequent lines are tokenized as T_COMMENT including the indentation whitespace. + */ + if ( \T_COMMENT === $this->tokens[ $ptr ]['code'] ) { + $content = $this->tokens[ $ptr ]['content']; + $actual_comment = ltrim( $content ); + $whitespace = str_replace( $actual_comment, '', $content ); + } + + return \strlen( $whitespace ); + } + + /** + * Create an indentation string. + * + * @param int $nr Number of spaces the indentation should be. + * + * @return string + */ + protected function get_indentation_string( $nr ) { + if ( 0 >= $nr ) { + return ''; + } + + // Space-based indentation. + if ( false === $this->tabIndent ) { + return str_repeat( ' ', $nr ); + } + + // Tab-based indentation. + $num_tabs = (int) floor( $nr / $this->tab_width ); + $remaining = ( $nr % $this->tab_width ); + $tab_indent = str_repeat( "\t", $num_tabs ); + $tab_indent .= str_repeat( ' ', $remaining ); + + return $tab_indent; + } + + /** + * Throw an error and fix incorrect array alignment. + * + * @param int $ptr Stack pointer to the first content on the line. + * @param string $error Error message. + * @param string $error_code Error code. + * @param int $expected Expected nr of spaces (tabs translated to space value). + * @param int $found Found nr of spaces (tabs translated to space value). + * @param string $new_indent Whitespace indent replacement content. + * + * @return void + */ + protected function add_array_alignment_error( $ptr, $error, $error_code, $expected, $found, $new_indent ) { + + $fix = $this->phpcsFile->addFixableError( $error, $ptr, $error_code, array( $expected, $found ) ); + if ( true === $fix ) { + $this->fix_alignment_error( $ptr, $new_indent ); + } + } + + /** + * Fix incorrect array alignment. + * + * @param int $ptr Stack pointer to the first content on the line. + * @param string $new_indent Whitespace indent replacement content. + * + * @return void + */ + protected function fix_alignment_error( $ptr, $new_indent ) { + if ( 1 === $this->tokens[ $ptr ]['column'] ) { + $this->phpcsFile->fixer->addContentBefore( $ptr, $new_indent ); + } else { + $this->phpcsFile->fixer->replaceToken( ( $ptr - 1 ), $new_indent ); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php new file mode 100644 index 00000000..b32fb26a --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php @@ -0,0 +1,174 @@ +tokens[ $stackPtr ]; + if ( ! isset( $token['bracket_closer'] ) ) { + return; + } + + /* + * Handle square brackets without a key (array assignments) first. + */ + $first_non_ws = $this->phpcsFile->findNext( \T_WHITESPACE, ( $stackPtr + 1 ), null, true ); + if ( $first_non_ws === $token['bracket_closer'] ) { + $error = 'There should be %1$s between the square brackets for an array assignment without an explicit key. Found: %2$s'; + SpacesFixer::checkAndFix( + $this->phpcsFile, + $stackPtr, + $token['bracket_closer'], + 0, + $error, + 'SpacesBetweenBrackets' + ); + + return; + } + + /* + * Handle the spaces around explicit array keys. + */ + $needs_spaces = true; + + // Skip over a potential plus/minus sign for integers. + $first_effective = $first_non_ws; + if ( \T_MINUS === $this->tokens[ $first_effective ]['code'] || \T_PLUS === $this->tokens[ $first_effective ]['code'] ) { + $first_effective = $this->phpcsFile->findNext( \T_WHITESPACE, ( $first_effective + 1 ), null, true ); + } + + $next_non_ws = $this->phpcsFile->findNext( \T_WHITESPACE, ( $first_effective + 1 ), null, true ); + if ( ( \T_CONSTANT_ENCAPSED_STRING === $this->tokens[ $first_effective ]['code'] + || \T_LNUMBER === $this->tokens[ $first_effective ]['code'] ) + && $next_non_ws === $token['bracket_closer'] + ) { + $needs_spaces = false; + } + + $has_space_after_opener = ( \T_WHITESPACE === $this->tokens[ ( $stackPtr + 1 ) ]['code'] ); + $has_space_before_close = ( \T_WHITESPACE === $this->tokens[ ( $token['bracket_closer'] - 1 ) ]['code'] ); + + // The array key should be surrounded by spaces unless the key only consists of a string or an integer. + if ( true === $needs_spaces + && ( false === $has_space_after_opener || false === $has_space_before_close ) + ) { + $error = 'Array keys must be surrounded by spaces unless they contain a string or an integer.'; + $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpacesAroundArrayKeys' ); + if ( true === $fix ) { + $this->phpcsFile->fixer->beginChangeset(); + + if ( false === $has_space_after_opener ) { + $this->phpcsFile->fixer->addContent( $stackPtr, ' ' ); + } + + if ( false === $has_space_before_close ) { + $this->phpcsFile->fixer->addContentBefore( $token['bracket_closer'], ' ' ); + } + + $this->phpcsFile->fixer->endChangeset(); + } + } elseif ( false === $needs_spaces && ( $has_space_after_opener || $has_space_before_close ) ) { + $error = 'Array keys must NOT be surrounded by spaces if they only contain a string or an integer.'; + $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'SpacesAroundArrayKeys' ); + if ( true === $fix ) { + if ( $has_space_after_opener ) { + $this->phpcsFile->fixer->beginChangeset(); + + for ( $i = ( $stackPtr + 1 ); $i < $token['bracket_closer']; $i++ ) { + if ( \T_WHITESPACE !== $this->tokens[ $i ]['code'] ) { + break; + } + + $this->phpcsFile->fixer->replaceToken( $i, '' ); + } + + $this->phpcsFile->fixer->endChangeset(); + } + + if ( $has_space_before_close ) { + $this->phpcsFile->fixer->beginChangeset(); + + for ( $i = ( $token['bracket_closer'] - 1 ); $i > $stackPtr; $i-- ) { + if ( \T_WHITESPACE !== $this->tokens[ $i ]['code'] ) { + break; + } + + $this->phpcsFile->fixer->replaceToken( $i, '' ); + } + + $this->phpcsFile->fixer->endChangeset(); + } + } + } + + // If spaces are needed, check that there is only one space. + if ( true === $needs_spaces ) { + if ( $has_space_after_opener ) { + $error = 'There should be exactly %1$s before the array key. Found: %2$s'; + SpacesFixer::checkAndFix( + $this->phpcsFile, + $stackPtr, + $first_non_ws, + 1, + $error, + 'TooMuchSpaceBeforeKey' + ); + } + + if ( $has_space_before_close ) { + $last_non_ws = $this->phpcsFile->findPrevious( \T_WHITESPACE, ( $token['bracket_closer'] - 1 ), null, true ); + $error = 'There should be exactly %1$s after the array key. Found: %2$s'; + SpacesFixer::checkAndFix( + $this->phpcsFile, + $last_non_ws, + $token['bracket_closer'], + 1, + $error, + 'TooMuchSpaceAfterKey' + ); + } + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php new file mode 100644 index 00000000..87630c86 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php @@ -0,0 +1,583 @@ += 60, align at column 60. + * - for the outliers, i.e. the array indexes where the end position + * goes past column 60, it will not align the arrow, the sniff will + * just make sure there is only one space between the end of the + * array index and the double arrow. + * + * The column value is regarded as a hard value, i.e. includes indentation, + * so setting it very low is not a good idea. + * + * @since 0.14.0 + * + * @var int + */ + public $maxColumn = 1000; + + /** + * Whether or not to align the arrow operator for multi-line array items. + * + * Whether or not an item is regarded as multi-line is based on the **value** + * of the item, not the key. + * + * Valid values are: + * - 'always': Default. Align all arrays items regardless of single/multi-line. + * - 'never': Never align array items which span multiple lines. + * This will enforce one space between the array index and the + * double arrow operator for multi-line array items, independently + * of the alignment of the rest of the array items. + * Multi-line items where the arrow is already aligned with the + * "expected" alignment, however, will be left alone. + * - operator : Only align the operator for multi-line arrays items if the + * + number percentage of multi-line items passes the comparison. + * - As it is a percentage, the number has to be between 0 and 100. + * - Supported operators: <, <=, >, >=, ==, =, !=, <> + * - The percentage is calculated against all array items + * (with and without assignment operator). + * - The (new) expected alignment will be calculated based only + * on the items being aligned. + * - Multi-line items where the arrow is already aligned with the + * (new) "expected" alignment, however, will be left alone. + * Examples: + * * Setting this to `!=100` or `<100` means that alignment will + * be enforced, unless *all* array items are multi-line. + * This is probably the most commonly desired situation. + * * Setting this to `=100` means that alignment will only + * be enforced, if *all* array items are multi-line. + * * Setting this to `<50` means that the majority of array items + * need to be single line before alignment is enforced for + * multi-line items in the array. + * * Setting this to `=0` is useless as in that case there are + * no multi-line items in the array anyway. + * + * This setting will respect the `ignoreNewlines` and `maxColumnn` settings. + * + * @since 0.14.0 + * + * @var string|int + */ + public $alignMultilineItems = 'always'; + + /** + * Storage for parsed $alignMultilineItems operator part. + * + * @since 0.14.0 + * + * @var string + */ + private $operator; + + /** + * Storage for parsed $alignMultilineItems numeric part. + * + * Stored as a string as the comparison will be done string based. + * + * @since 0.14.0 + * + * @var string + */ + private $number; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 0.14.0 + * + * @return array + */ + public function register() { + return Collections::arrayOpenTokensBC(); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 0.14.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + + if ( isset( Collections::shortArrayListOpenTokensBC()[ $this->tokens[ $stackPtr ]['code'] ] ) + && Arrays::isShortArray( $this->phpcsFile, $stackPtr ) === false + ) { + // Short list, not short array. + return; + } + + /* + * Determine the array opener & closer. + */ + $array_open_close = Arrays::getOpenClose( $this->phpcsFile, $stackPtr ); + if ( false === $array_open_close ) { + // Array open/close could not be determined. + return; + } + + $opener = $array_open_close['opener']; + $closer = $array_open_close['closer']; + + $array_items = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); + if ( empty( $array_items ) ) { + return; + } + + // Pass off to either the single line or multi-line array analysis. + if ( $this->tokens[ $opener ]['line'] === $this->tokens[ $closer ]['line'] ) { + return $this->process_single_line_array( $stackPtr, $array_items, $opener, $closer ); + } else { + return $this->process_multi_line_array( $stackPtr, $array_items, $opener, $closer ); + } + } + + /** + * Process a single-line array. + * + * While the WP standard does not allow single line multi-item associative arrays, + * this sniff should function independently of that. + * + * The `WordPress.WhiteSpace.OperatorSpacing` sniff already covers checking that + * there is a space between the array key and the double arrow, but doesn't + * enforce it to be exactly one space for single line arrays. + * That is what this method covers. + * + * @since 0.14.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param array $items Info array containing information on each array item. + * @param int $opener The position of the array opener. + * @param int $closer The position of the array closer. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + protected function process_single_line_array( $stackPtr, $items, $opener, $closer ) { + /* + * For single line arrays, we don't care about what level the arrow is from. + * Just find and fix them all. + */ + $next_arrow = $this->phpcsFile->findNext( + \T_DOUBLE_ARROW, + ( $opener + 1 ), + $closer + ); + + while ( false !== $next_arrow ) { + if ( \T_WHITESPACE === $this->tokens[ ( $next_arrow - 1 ) ]['code'] ) { + $space_length = $this->tokens[ ( $next_arrow - 1 ) ]['length']; + if ( 1 !== $space_length ) { + $error = 'Expected 1 space between "%s" and double arrow; %s found'; + $data = array( + $this->tokens[ ( $next_arrow - 2 ) ]['content'], + $space_length, + ); + + $fix = $this->phpcsFile->addFixableWarning( $error, $next_arrow, 'SpaceBeforeDoubleArrow', $data ); + if ( true === $fix ) { + $this->phpcsFile->fixer->replaceToken( ( $next_arrow - 1 ), ' ' ); + } + } + } + + // Find the position of the next double arrow. + $next_arrow = $this->phpcsFile->findNext( + \T_DOUBLE_ARROW, + ( $next_arrow + 1 ), + $closer + ); + } + + // Ignore any child-arrays as the double arrows in these will already have been handled. + return ( $closer + 1 ); + } + + /** + * Process a multi-line array. + * + * @since 0.14.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param array $items Info array containing information on each array item. + * @param int $opener The position of the array opener. + * @param int $closer The position of the array closer. + * + * @return void + */ + protected function process_multi_line_array( $stackPtr, $items, $opener, $closer ) { + + $this->maxColumn = (int) $this->maxColumn; + $this->validate_align_multiline_items(); + + /* + * Determine what the spacing before the arrow should be. + * + * Will unset any array items without double arrow and with new line whitespace + * if newlines are to be ignored, so the second foreach loop only has to deal + * with items which need attention. + * + * This sniff does not take incorrect indentation of array keys into account. + * That's for the `WordPress.Arrays.ArrayIndentation` sniff to fix. + * If that would affect the alignment, a second (or third) loop of the fixer + * will correct it (again) after the indentation has been fixed. + */ + $index_end_cols = array(); // Keep track of the end column position of index keys. + $double_arrow_cols = array(); // Keep track of arrow column position and count. + $multi_line_count = 0; + $total_items = \count( $items ); + + foreach ( $items as $key => $item ) { + // Find the double arrow if there is one. + $double_arrow = Arrays::getDoubleArrowPtr( $this->phpcsFile, $item['start'], $item['end'] ); + if ( false === $double_arrow ) { + unset( $items[ $key ] ); + continue; + } + + // Find the end of the array key. + $last_index_token = $this->phpcsFile->findPrevious( + \T_WHITESPACE, + ( $double_arrow - 1 ), + $item['start'], + true + ); + + if ( true === $this->ignoreNewlines + && $this->tokens[ $last_index_token ]['line'] !== $this->tokens[ $double_arrow ]['line'] + ) { + // Ignore this item as it has a new line between the item key and the double arrow. + unset( $items[ $key ] ); + continue; + } + + $index_end_position = ( $this->tokens[ $last_index_token ]['column'] + ( $this->tokens[ $last_index_token ]['length'] - 1 ) ); + $items[ $key ]['operatorPtr'] = $double_arrow; + $items[ $key ]['last_index_token'] = $last_index_token; + $items[ $key ]['last_index_col'] = $index_end_position; + + if ( $this->tokens[ $last_index_token ]['line'] === $this->tokens[ $item['end'] ]['line'] ) { + $items[ $key ]['single_line'] = true; + } else { + $items[ $key ]['single_line'] = false; + ++$multi_line_count; + } + + if ( ( $index_end_position + 2 ) <= $this->maxColumn ) { + $index_end_cols[] = $index_end_position; + } + + if ( ! isset( $double_arrow_cols[ $this->tokens[ $double_arrow ]['column'] ] ) ) { + $double_arrow_cols[ $this->tokens[ $double_arrow ]['column'] ] = 1; + } else { + ++$double_arrow_cols[ $this->tokens[ $double_arrow ]['column'] ]; + } + } + unset( $key, $item, $double_arrow, $last_index_token ); + + if ( empty( $items ) || empty( $index_end_cols ) ) { + // No actionable array items found. + return; + } + + /* + * Determine whether the operators for multi-line items should be aligned. + */ + if ( 'always' === $this->alignMultilineItems ) { + $alignMultilineItems = true; + } elseif ( 'never' === $this->alignMultilineItems ) { + $alignMultilineItems = false; + } else { + $percentage = (string) round( ( $multi_line_count / $total_items ) * 100, 0 ); + + // Bit hacky, but this is the only comparison function in PHP which allows to + // pass the comparison operator. And hey, it works ;-). + $alignMultilineItems = version_compare( $percentage, $this->number, $this->operator ); + } + + /* + * If necessary, rebuild the $index_end_cols and $double_arrow_cols arrays + * excluding multi-line items. + */ + if ( false === $alignMultilineItems ) { + $select_index_end_cols = array(); + $double_arrow_cols = array(); + + foreach ( $items as $item ) { + if ( false === $item['single_line'] ) { + continue; + } + + if ( ( $item['last_index_col'] + 2 ) <= $this->maxColumn ) { + $select_index_end_cols[] = $item['last_index_col']; + } + + if ( ! isset( $double_arrow_cols[ $this->tokens[ $item['operatorPtr'] ]['column'] ] ) ) { + $double_arrow_cols[ $this->tokens[ $item['operatorPtr'] ]['column'] ] = 1; + } else { + ++$double_arrow_cols[ $this->tokens[ $item['operatorPtr'] ]['column'] ]; + } + } + } + + /* + * Determine the expected position of the double arrows. + */ + if ( ! empty( $select_index_end_cols ) ) { + $max_index_width = max( $select_index_end_cols ); + } else { + $max_index_width = max( $index_end_cols ); + } + + $expected_col = ( $max_index_width + 2 ); + + if ( false === $this->exact && ! empty( $double_arrow_cols ) ) { + /* + * If the alignment does not have to be exact, see if a majority + * group of the arrows is already at an acceptable position. + */ + arsort( $double_arrow_cols, \SORT_NUMERIC ); + reset( $double_arrow_cols ); + $count = current( $double_arrow_cols ); + + if ( $count > 1 || ( 1 === $count && \count( $items ) === 1 ) ) { + // Allow for several groups of arrows having the same $count. + $filtered_double_arrow_cols = array_keys( $double_arrow_cols, $count, true ); + + foreach ( $filtered_double_arrow_cols as $col ) { + if ( $col > $expected_col && $col <= $this->maxColumn ) { + $expected_col = $col; + break; + } + } + } + } + unset( $max_index_width, $count, $filtered_double_arrow_cols, $col ); + + /* + * Verify and correct the spacing around the double arrows. + */ + foreach ( $items as $item ) { + if ( $this->tokens[ $item['operatorPtr'] ]['column'] === $expected_col + && $this->tokens[ $item['operatorPtr'] ]['line'] === $this->tokens[ $item['last_index_token'] ]['line'] + ) { + // Already correctly aligned. + continue; + } + + if ( \T_WHITESPACE !== $this->tokens[ ( $item['operatorPtr'] - 1 ) ]['code'] ) { + $before = 0; + } elseif ( $this->tokens[ $item['last_index_token'] ]['line'] !== $this->tokens[ $item['operatorPtr'] ]['line'] ) { + $before = 'newline'; + } else { + $before = $this->tokens[ ( $item['operatorPtr'] - 1 ) ]['length']; + } + + /* + * Deal with index sizes larger than maxColumn and with multi-line + * array items which should not be aligned. + */ + if ( ( $item['last_index_col'] + 2 ) > $this->maxColumn + || ( false === $alignMultilineItems && false === $item['single_line'] ) + ) { + + if ( ( $item['last_index_col'] + 2 ) === $this->tokens[ $item['operatorPtr'] ]['column'] + && $this->tokens[ $item['operatorPtr'] ]['line'] === $this->tokens[ $item['last_index_token'] ]['line'] + ) { + // MaxColumn/Multi-line item exception, already correctly aligned. + continue; + } + + $prefix = 'LongIndex'; + if ( false === $alignMultilineItems && false === $item['single_line'] ) { + $prefix = 'MultilineItem'; + } + + $error_code = $prefix . 'SpaceBeforeDoubleArrow'; + if ( 0 === $before ) { + $error_code = $prefix . 'NoSpaceBeforeDoubleArrow'; + } + + $fix = $this->phpcsFile->addFixableWarning( + 'Expected 1 space between "%s" and double arrow; %s found.', + $item['operatorPtr'], + $error_code, + array( + $this->tokens[ $item['last_index_token'] ]['content'], + $before, + ) + ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->beginChangeset(); + + // Remove whitespace tokens between the end of the index and the arrow, if any. + for ( $i = ( $item['last_index_token'] + 1 ); $i < $item['operatorPtr']; $i++ ) { + $this->phpcsFile->fixer->replaceToken( $i, '' ); + } + + // Add the correct whitespace. + $this->phpcsFile->fixer->addContent( $item['last_index_token'], ' ' ); + + $this->phpcsFile->fixer->endChangeset(); + } + continue; + } + + /* + * Deal with the space before double arrows in all other cases. + */ + $expected_whitespace = $expected_col - ( $this->tokens[ $item['last_index_token'] ]['column'] + $this->tokens[ $item['last_index_token'] ]['length'] ); + + $fix = $this->phpcsFile->addFixableWarning( + 'Array double arrow not aligned correctly; expected %s space(s) between "%s" and double arrow, but found %s.', + $item['operatorPtr'], + 'DoubleArrowNotAligned', + array( + $expected_whitespace, + $this->tokens[ $item['last_index_token'] ]['content'], + $before, + ) + ); + + if ( true === $fix ) { + if ( 0 === $before || 'newline' === $before ) { + $this->phpcsFile->fixer->beginChangeset(); + + // Remove whitespace tokens between the end of the index and the arrow, if any. + for ( $i = ( $item['last_index_token'] + 1 ); $i < $item['operatorPtr']; $i++ ) { + $this->phpcsFile->fixer->replaceToken( $i, '' ); + } + + // Add the correct whitespace. + $this->phpcsFile->fixer->addContent( + $item['last_index_token'], + str_repeat( ' ', $expected_whitespace ) + ); + + $this->phpcsFile->fixer->endChangeset(); + } elseif ( $expected_whitespace > $before ) { + // Add to the existing whitespace to prevent replacing tabs with spaces. + // That's the concern of another sniff. + $this->phpcsFile->fixer->addContent( + ( $item['operatorPtr'] - 1 ), + str_repeat( ' ', ( $expected_whitespace - $before ) ) + ); + } else { + // Too much whitespace found. + $this->phpcsFile->fixer->replaceToken( + ( $item['operatorPtr'] - 1 ), + str_repeat( ' ', $expected_whitespace ) + ); + } + } + } + } + + /** + * Validate that a valid value has been received for the alignMultilineItems property. + * + * This message may be thrown more than once if the property is being changed inline in a file. + * + * @since 0.14.0 + * + * @return void + */ + protected function validate_align_multiline_items() { + $alignMultilineItems = $this->alignMultilineItems; + + if ( 'always' === $alignMultilineItems || 'never' === $alignMultilineItems ) { + return; + } else { + // Correct for a potentially added % sign. + $alignMultilineItems = rtrim( $alignMultilineItems, '%' ); + + if ( preg_match( '`^([=<>!]{1,2})(100|[0-9]{1,2})$`', $alignMultilineItems, $matches ) > 0 ) { + $operator = $matches[1]; + $number = (int) $matches[2]; + + if ( \in_array( $operator, array( '<', '<=', '>', '>=', '==', '=', '!=', '<>' ), true ) === true + && ( $number >= 0 && $number <= 100 ) + ) { + $this->alignMultilineItems = $alignMultilineItems; + $this->number = (string) $number; + $this->operator = $operator; + return; + } + } + } + + $this->phpcsFile->addError( + 'Invalid property value passed: "%s". The value for the "alignMultilineItems" property for the "WordPress.Arrays.MultipleStatementAlignment" sniff should be either "always", "never" or an comparison operator + a number between 0 and 100.', + 0, + 'InvalidPropertyPassed', + array( $this->alignMultilineItems ) + ); + + // Reset to the default if an invalid value was received. + $this->alignMultilineItems = 'always'; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php new file mode 100644 index 00000000..a74b5f29 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php @@ -0,0 +1,173 @@ +assignment_tokens = Tokens::$assignmentTokens; + unset( $this->assignment_tokens[ \T_DOUBLE_ARROW ] ); + + $starters = Tokens::$booleanOperators; + $starters[ \T_SEMICOLON ] = \T_SEMICOLON; + $starters[ \T_OPEN_PARENTHESIS ] = \T_OPEN_PARENTHESIS; + $starters[ \T_INLINE_ELSE ] = \T_INLINE_ELSE; + + $this->condition_start_tokens = $starters; + + return array( + \T_INLINE_THEN, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 0.14.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function process_token( $stackPtr ) { + + $token = $this->tokens[ $stackPtr ]; + + // Check if the condition for the ternary is bracketed. + $prev = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); + if ( \T_CLOSE_PARENTHESIS === $this->tokens[ $prev ]['code'] ) { + if ( ! isset( $this->tokens[ $prev ]['parenthesis_opener'] ) ) { + return; + } + + $opener = $this->tokens[ $prev ]['parenthesis_opener']; + $closer = $prev; + } elseif ( isset( $token['nested_parenthesis'] ) ) { + $opener = Parentheses::getLastOpener( $this->phpcsFile, $stackPtr ); + $closer = Parentheses::getLastCloser( $this->phpcsFile, $stackPtr ); + + $next_statement_closer = BCFile::findEndOfStatement( $this->phpcsFile, $stackPtr, array( \T_COLON, \T_CLOSE_PARENTHESIS, \T_CLOSE_SQUARE_BRACKET ) ); + if ( false !== $next_statement_closer && $next_statement_closer < $closer ) { + // Parentheses are unrelated to the ternary. + return; + } + + $prev_statement_closer = BCFile::findStartOfStatement( $this->phpcsFile, $stackPtr, array( \T_COLON, \T_OPEN_PARENTHESIS, \T_OPEN_SQUARE_BRACKET ) ); + if ( false !== $prev_statement_closer && $opener < $prev_statement_closer ) { + // Parentheses are unrelated to the ternary. + return; + } + + if ( $closer > $stackPtr ) { + $closer = $stackPtr; + } + } else { + // No parenthesis found, can't determine where the conditional part of the ternary starts. + return; + } + + $startPos = $opener; + + do { + $hasAssignment = $this->phpcsFile->findNext( $this->assignment_tokens, ( $startPos + 1 ), $closer ); + if ( false === $hasAssignment ) { + return; + } + + // Examine whether the left side is a variable. + $hasVariable = false; + $conditionStart = $startPos; + $altConditionStart = $this->phpcsFile->findPrevious( + $this->condition_start_tokens, + ( $hasAssignment - 1 ), + $startPos + ); + if ( false !== $altConditionStart ) { + $conditionStart = $altConditionStart; + } + + for ( $i = $hasAssignment; $i > $conditionStart; $i-- ) { + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + // If this is a variable or array, we've seen all we need to see. + if ( \T_VARIABLE === $this->tokens[ $i ]['code'] + || \T_CLOSE_SQUARE_BRACKET === $this->tokens[ $i ]['code'] + ) { + $hasVariable = true; + break; + } + + // If this is a function call or something, we are OK. + if ( \T_CLOSE_PARENTHESIS === $this->tokens[ $i ]['code'] ) { + break; + } + } + + if ( true === $hasVariable ) { + $this->phpcsFile->addWarning( + 'Variable assignment found within a condition. Did you mean to do a comparison?', + $hasAssignment, + 'FoundInTernaryCondition' + ); + } + + $startPos = $hasAssignment; + + } while ( $startPos < $closer ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php new file mode 100644 index 00000000..45084498 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php @@ -0,0 +1,89 @@ + Key is the name of the function being matched, value the alternative to use. + */ + protected $target_functions = array( + 'esc_html' => 'esc_html__', + 'esc_attr' => 'esc_attr__', + ); + + /** + * Process the parameters of a matched function. + * + * @since 2.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + if ( \count( $parameters ) === 1 ) { + return; + } + + /* + * We already know that there will be a valid open+close parenthesis, otherwise the sniff + * would have bowed out long before. + */ + $opener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + $closer = $this->tokens[ $opener ]['parenthesis_closer']; + + $data = array( + $matched_content, + $this->target_functions[ $matched_content ], + GetTokensAsString::compact( $this->phpcsFile, $stackPtr, $closer, true ), + ); + + $this->phpcsFile->addWarning( + '%s() expects only a $text parameter. Did you mean to use %s() ? Found: %s', + $stackPtr, + 'Found', + $data + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php new file mode 100644 index 00000000..590f6478 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php @@ -0,0 +1,301 @@ + array(), + 'cacheset' => array(), + 'cachedelete' => array(), + ); + + /** + * A list of functions that get data from the cache. + * + * @since 0.6.0 + * @since 0.11.0 Changed from public static to protected non-static. + * @since 3.0.0 Moved from the generic `Sniff` class to this class. + * + * @var array + */ + protected $cacheGetFunctions = array( + 'wp_cache_get' => true, + ); + + /** + * A list of functions that set data in the cache. + * + * @since 0.6.0 + * @since 0.11.0 Changed from public static to protected non-static. + * @since 3.0.0 Moved from the generic `Sniff` class to this class. + * + * @var array + */ + protected $cacheSetFunctions = array( + 'wp_cache_set' => true, + 'wp_cache_add' => true, + ); + + /** + * A list of functions that delete data from the cache. + * + * @since 0.6.0 + * @since 0.11.0 Changed from public static to protected non-static. + * @since 3.0.0 Moved from the generic `Sniff` class to this class. + * + * @var array + */ + protected $cacheDeleteFunctions = array( + 'wp_cache_delete' => true, + 'clean_attachment_cache' => true, + 'clean_blog_cache' => true, + 'clean_bookmark_cache' => true, + 'clean_category_cache' => true, + 'clean_comment_cache' => true, + 'clean_network_cache' => true, + 'clean_object_term_cache' => true, + 'clean_page_cache' => true, + 'clean_post_cache' => true, + 'clean_term_cache' => true, + 'clean_user_cache' => true, + ); + + /** + * The lists of $wpdb methods. + * + * @since 0.6.0 + * @since 0.11.0 Changed from static to non-static. + * + * @var array[] + */ + protected $methods = array( + 'cachable' => array( + 'delete' => true, + 'get_var' => true, + 'get_col' => true, + 'get_row' => true, + 'get_results' => true, + 'query' => true, + 'replace' => true, + 'update' => true, + ), + 'noncachable' => array( + 'insert' => true, + ), + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() { + return array( + \T_VARIABLE, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + + // Check for $wpdb variable. + if ( '$wpdb' !== $this->tokens[ $stackPtr ]['content'] ) { + return; + } + + $is_object_call = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( false === $is_object_call + || ( \T_OBJECT_OPERATOR !== $this->tokens[ $is_object_call ]['code'] + && \T_NULLSAFE_OBJECT_OPERATOR !== $this->tokens[ $is_object_call ]['code'] ) + ) { + // This is not a call to the wpdb object. + return; + } + + $methodPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $is_object_call + 1 ), null, true ); + $method = strtolower( $this->tokens[ $methodPtr ]['content'] ); + + $this->mergeFunctionLists(); + + if ( ! isset( $this->methods['all'][ $method ] ) ) { + return; + } + + $endOfStatement = $this->phpcsFile->findNext( array( \T_SEMICOLON, \T_CLOSE_TAG ), ( $stackPtr + 1 ) ); + if ( false === $endOfStatement ) { + return; + } + + // Check for Database Schema Changes/ table truncation. + for ( $_pos = ( $stackPtr + 1 ); $_pos < $endOfStatement; $_pos++ ) { + $_pos = $this->phpcsFile->findNext( Tokens::$textStringTokens, $_pos, $endOfStatement ); + if ( false === $_pos ) { + break; + } + + if ( strpos( strtoupper( TextStrings::stripQuotes( $this->tokens[ $_pos ]['content'] ) ), 'TRUNCATE ' ) === 0 ) { + // Ignore queries to truncate the database as caching those is irrelevant and they need a direct db query. + return; + } + + if ( preg_match( '#\b(?:ALTER|CREATE|DROP)\b#i', $this->tokens[ $_pos ]['content'] ) > 0 ) { + $this->phpcsFile->addWarning( 'Attempting a database schema change is discouraged.', $_pos, 'SchemaChange' ); + } + } + + $this->phpcsFile->addWarning( 'Use of a direct database call is discouraged.', $stackPtr, 'DirectQuery' ); + + if ( ! isset( $this->methods['cachable'][ $method ] ) ) { + return $endOfStatement; + } + + $cached = false; + $wp_cache_get = false; + + $scope_function = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); + if ( false !== $scope_function ) { + $scopeStart = $this->tokens[ $scope_function ]['scope_opener']; + $scopeEnd = $this->tokens[ $scope_function ]['scope_closer']; + + for ( $i = ( $scopeStart + 1 ); $i < $scopeEnd; $i++ ) { + if ( \T_STRING === $this->tokens[ $i ]['code'] ) { + + if ( isset( $this->cacheDeleteFunctions[ $this->tokens[ $i ]['content'] ] ) ) { + + if ( \in_array( $method, array( 'query', 'update', 'replace', 'delete' ), true ) ) { + $cached = true; + break; + } + } elseif ( isset( $this->cacheGetFunctions[ $this->tokens[ $i ]['content'] ] ) ) { + + $wp_cache_get = true; + + } elseif ( isset( $this->cacheSetFunctions[ $this->tokens[ $i ]['content'] ] ) ) { + + if ( $wp_cache_get ) { + $cached = true; + break; + } + } + } + } + } + + if ( ! $cached ) { + $message = 'Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().'; + $this->phpcsFile->addWarning( $message, $stackPtr, 'NoCaching' ); + } + + return $endOfStatement; + } + + /** + * Merge custom functions provided via a custom ruleset with the defaults, if we haven't already. + * + * @since 0.11.0 Split out from the `process()` method. + * + * @return void + */ + protected function mergeFunctionLists() { + if ( ! isset( $this->methods['all'] ) ) { + $this->methods['all'] = array_merge( $this->methods['cachable'], $this->methods['noncachable'] ); + } + + if ( $this->customCacheGetFunctions !== $this->addedCustomFunctions['cacheget'] ) { + $this->cacheGetFunctions = RulesetPropertyHelper::merge_custom_array( + $this->customCacheGetFunctions, + $this->cacheGetFunctions + ); + + $this->addedCustomFunctions['cacheget'] = $this->customCacheGetFunctions; + } + + if ( $this->customCacheSetFunctions !== $this->addedCustomFunctions['cacheset'] ) { + $this->cacheSetFunctions = RulesetPropertyHelper::merge_custom_array( + $this->customCacheSetFunctions, + $this->cacheSetFunctions + ); + + $this->addedCustomFunctions['cacheset'] = $this->customCacheSetFunctions; + } + + if ( $this->customCacheDeleteFunctions !== $this->addedCustomFunctions['cachedelete'] ) { + $this->cacheDeleteFunctions = RulesetPropertyHelper::merge_custom_array( + $this->customCacheDeleteFunctions, + $this->cacheDeleteFunctions + ); + + $this->addedCustomFunctions['cachedelete'] = $this->customCacheDeleteFunctions; + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php new file mode 100644 index 00000000..043175d8 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php @@ -0,0 +1,761 @@ +prepare method. + * + * Checks the following issues: + * - The only placeholders supported are: %d, %f (%F), %s, %i, and their variations. + * - Literal % signs need to be properly escaped as `%%`. + * - Simple placeholders (%d, %f, %F, %s, %i) should be left unquoted in the query string. + * - Complex placeholders - numbered and formatted variants - will not be quoted + * automagically by $wpdb->prepare(), so if used for values, should be quoted in + * the query string. + * The only exception to this is complex placeholders for %i. In that case, the + * replacement *will* still be backtick-quoted. + * - Either an array of replacements should be passed matching the number of + * placeholders found or individual parameters for each placeholder should + * be passed. + * - Wildcards for LIKE compare values should be passed in via a replacement parameter. + * + * The sniff allows for a specific pattern with a variable number of placeholders + * created using code along the lines of: + * `sprintf( 'query .... IN (%s) ...', implode( ',', array_fill( 0, count( $something ), '%s' ) ) )`. + * + * @link https://developer.wordpress.org/reference/classes/wpdb/prepare/ + * @link https://core.trac.wordpress.org/changeset/41496 + * @link https://core.trac.wordpress.org/changeset/41471 + * @link https://core.trac.wordpress.org/changeset/55151 + * + * @since 0.14.0 + * @since 3.0.0 Support for the %i placeholder has been added + * + * @uses \WordPressCS\WordPress\Helpers\MinimumWPVersionTrait::$minimum_wp_version + */ +final class PreparedSQLPlaceholdersSniff extends Sniff { + + use MinimumWPVersionTrait; + use WPDBTrait; + + /** + * These regexes were originally copied from https://www.php.net/function.sprintf#93552 + * and adjusted for limitations in `$wpdb->prepare()`. + * + * Near duplicate of the one used in the WP.I18n sniff, but with fewer types allowed. + * + * Note: The regex delimiters and modifiers are not included to allow this regex to be + * concatenated together with other regex partials. + * + * @since 0.14.0 + * + * @var string + */ + const PREPARE_PLACEHOLDER_REGEX = '(?: + (? true, + ); + + /** + * Storage for the stack pointer to the method call token. + * + * @since 0.14.0 + * + * @var int + */ + protected $methodPtr; + + /** + * Simple regex snippet to recognize and remember quotes. + * + * @since 0.14.0 + * + * @var string + */ + private $regex_quote = '["\']'; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 0.14.0 + * + * @return array + */ + public function register() { + return array( + \T_VARIABLE, + \T_STRING, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 0.14.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function process_token( $stackPtr ) { + + $this->set_minimum_wp_version(); + + if ( ! $this->is_wpdb_method_call( $this->phpcsFile, $stackPtr, $this->target_methods ) ) { + return; + } + + $parameters = PassedParameters::getParameters( $this->phpcsFile, $this->methodPtr ); + if ( empty( $parameters ) ) { + return; + } + + $query = PassedParameters::getParameterFromStack( $parameters, 1, 'query' ); + if ( false === $query ) { + return; + } + + $text_string_tokens_found = false; + $variable_found = false; + $sql_wildcard_found = false; + $total_placeholders = 0; + $total_parameters = \count( $parameters ); + $valid_in_clauses = array( + 'uses_in' => 0, + 'implode_fill' => 0, + 'adjustment_count' => 0, + ); + $skip_from = null; + $skip_to = null; + + for ( $i = $query['start']; $i <= $query['end']; $i++ ) { + // Skip over groups of tokens if they are part of an inline function call. + if ( isset( $skip_from, $skip_to ) && $i >= $skip_from && $i <= $skip_to ) { + $i = $skip_to; + continue; + } + + if ( ! isset( Tokens::$textStringTokens[ $this->tokens[ $i ]['code'] ] ) ) { + if ( \T_VARIABLE === $this->tokens[ $i ]['code'] ) { + if ( '$wpdb' !== $this->tokens[ $i ]['content'] ) { + $variable_found = true; + } + continue; + } + + // Detect a specific pattern for variable replacements in combination with `IN`. + if ( \T_STRING === $this->tokens[ $i ]['code'] ) { + + if ( 'sprintf' === strtolower( $this->tokens[ $i ]['content'] ) ) { + $sprintf_parameters = PassedParameters::getParameters( $this->phpcsFile, $i ); + + if ( ! empty( $sprintf_parameters ) ) { + /* + * Check for named params. sprintf() does not support this due to its variadic nature, + * and we cannot analyse the code correctly if it is used, so skip the whole sprintf() + * in that case. + */ + $valid_sprintf = true; + foreach ( $sprintf_parameters as $param ) { + if ( isset( $param['name'] ) ) { + $valid_sprintf = false; + break; + } + } + + if ( false === $valid_sprintf ) { + $next = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); + if ( \T_OPEN_PARENTHESIS === $this->tokens[ $next ]['code'] + && isset( $this->tokens[ $next ]['parenthesis_closer'] ) + ) { + $skip_from = ( $i + 1 ); + $skip_to = $this->tokens[ $next ]['parenthesis_closer']; + } + + continue; + } + + // We know for sure this sprintf() uses positional parameters, so this will be fine. + $skip_from = ( $sprintf_parameters[1]['end'] + 1 ); + $last_param = end( $sprintf_parameters ); + $skip_to = ( $last_param['end'] + 1 ); + + $valid_in_clauses['implode_fill'] += $this->analyse_sprintf( $sprintf_parameters ); + $valid_in_clauses['adjustment_count'] += ( \count( $sprintf_parameters ) - 1 ); + } + unset( $sprintf_parameters, $valid_sprintf, $last_param ); + + } elseif ( 'implode' === strtolower( $this->tokens[ $i ]['content'] ) ) { + $prev = $this->phpcsFile->findPrevious( + Tokens::$emptyTokens + array( \T_STRING_CONCAT => \T_STRING_CONCAT ), + ( $i - 1 ), + $query['start'], + true + ); + + if ( isset( Tokens::$textStringTokens[ $this->tokens[ $prev ]['code'] ] ) ) { + $prev_content = TextStrings::stripQuotes( $this->tokens[ $prev ]['content'] ); + $regex_quote = $this->get_regex_quote_snippet( $prev_content, $this->tokens[ $prev ]['content'] ); + + // Only examine the implode if preceded by an ` IN (`. + if ( preg_match( '`\s+IN\s*\(\s*(' . $regex_quote . ')?$`i', $prev_content, $match ) > 0 ) { + + if ( isset( $match[1] ) && $regex_quote !== $this->regex_quote ) { + $this->phpcsFile->addError( + 'Dynamic placeholder generation should not have surrounding quotes.', + $prev, + 'QuotedDynamicPlaceholderGeneration' + ); + } + + if ( $this->analyse_implode( $i ) === true ) { + ++$valid_in_clauses['uses_in']; + ++$valid_in_clauses['implode_fill']; + + $next = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); + if ( \T_OPEN_PARENTHESIS === $this->tokens[ $next ]['code'] + && isset( $this->tokens[ $next ]['parenthesis_closer'] ) + ) { + $skip_from = ( $i + 1 ); + $skip_to = $this->tokens[ $next ]['parenthesis_closer']; + } + } + } + unset( $next, $prev_content, $regex_quote, $match ); + } + unset( $prev ); + } + } + + continue; + } + + $text_string_tokens_found = true; + $content = $this->tokens[ $i ]['content']; + + $regex_quote = $this->regex_quote; + if ( isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) ) { + $content = TextStrings::stripQuotes( $content ); + $regex_quote = $this->get_regex_quote_snippet( $content, $this->tokens[ $i ]['content'] ); + } + + if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $i ]['code'] + || \T_HEREDOC === $this->tokens[ $i ]['code'] + ) { + // Only interested in actual query text, so strip out variables. + $stripped_content = TextStrings::stripEmbeds( $content ); + if ( $stripped_content !== $content ) { + $vars_without_wpdb = array_filter( + TextStrings::getEmbeds( $content ), + static function ( $symbol ) { + return preg_match( '`^\{?\$\{?wpdb\??->`', $symbol ) !== 1; + } + ); + + $content = $stripped_content; + + if ( ! empty( $vars_without_wpdb ) ) { + $variable_found = true; + } + } + unset( $stripped_content, $vars_without_wpdb ); + } + + $placeholders = preg_match_all( '`' . self::PREPARE_PLACEHOLDER_REGEX . '`x', $content, $matches ); + if ( $placeholders > 0 ) { + $total_placeholders += $placeholders; + } + + /* + * Analyse the query for incorrect LIKE queries. + * + * - `LIKE %s` is the only correct one. + * - `LIKE '%s'` or `LIKE "%s"` will not be reported here, but in the quote check. + * - Any other `LIKE` statement should be reported, either for using `LIKE` without + * SQL wildcards or for not passing the SQL wildcards via the replacement. + */ + $regex = '`\s+LIKE\s*(?:(' . $regex_quote . ')(?!%s(?:\1|$))(?P.*?)(?:\1|$)|(?:concat\((?![^\)]*%s[^\)]*\))(?P[^\)]*))\))`i'; + if ( preg_match_all( $regex, $content, $matches ) > 0 ) { + $walk = array(); + if ( ! empty( $matches['content'] ) ) { + $matches['content'] = array_filter( $matches['content'] ); + if ( ! empty( $matches['content'] ) ) { + $walk[] = 'content'; + } + } + if ( ! empty( $matches['concat'] ) ) { + $matches['concat'] = array_filter( $matches['concat'] ); + if ( ! empty( $matches['concat'] ) ) { + $walk[] = 'concat'; + } + } + + if ( ! empty( $walk ) ) { + foreach ( $walk as $match_key ) { + foreach ( $matches[ $match_key ] as $index => $match ) { + $data = array( $matches[0][ $index ] ); + + // Both a `%` as well as a `_` are wildcards in SQL. + if ( strpos( $match, '%' ) === false && strpos( $match, '_' ) === false ) { + $this->phpcsFile->addWarning( + 'Unless you are using SQL wildcards, using LIKE is inefficient. Use a straight compare instead. Found: %s.', + $i, + 'LikeWithoutWildcards', + $data + ); + } else { + $sql_wildcard_found = true; + + if ( strpos( $match, '%s' ) === false ) { + $this->phpcsFile->addError( + 'SQL wildcards for a LIKE query should be passed in through a replacement parameter. Found: %s.', + $i, + 'LikeWildcardsInQuery', + $data + ); + } else { + $this->phpcsFile->addError( + 'SQL wildcards for a LIKE query should be passed in through a replacement parameter and the variable part of the replacement should be escaped using "esc_like()". Found: %s.', + $i, + 'LikeWildcardsInQueryWithPlaceholder', + $data + ); + } + } + + /* + * Don't throw `UnescapedLiteral`, `UnsupportedPlaceholder` or `QuotedPlaceholder` + * for this part of the SQL query. + */ + $content = preg_replace( '`' . preg_quote( $match, '`' ) . '`', '', $content, 1 ); + } + } + } + unset( $matches, $index, $match, $data ); + } + + if ( strpos( $content, '%' ) === false ) { + continue; + } + + /* + * Analyse the query for unsupported placeholders. + */ + if ( preg_match_all( self::UNSUPPORTED_PLACEHOLDER_REGEX, $content, $matches ) > 0 ) { + if ( ! empty( $matches[0] ) ) { + foreach ( $matches[0] as $match ) { + if ( '%' === $match ) { + $this->phpcsFile->addError( + 'Found unescaped literal "%%" character.', + $i, + 'UnescapedLiteral', + array( $match ) + ); + } else { + $this->phpcsFile->addError( + 'Unsupported placeholder used in $wpdb->prepare(). Found: "%s".', + $i, + 'UnsupportedPlaceholder', + array( $match ) + ); + } + } + } + unset( $match, $matches ); + } + + if ( $this->wp_version_compare( $this->minimum_wp_version, '6.2', '<' ) ) { + if ( preg_match_all( '`' . self::PREPARE_PLACEHOLDER_REGEX . '`x', $content, $matches ) > 0 ) { + if ( ! empty( $matches[0] ) ) { + foreach ( $matches[0] as $match ) { + if ( 'i' === substr( $match, -1 ) ) { + $this->phpcsFile->addError( + 'The %%i modifier is only supported in WP 6.2 or higher. Found: "%s".', + $i, + 'UnsupportedIdentifierPlaceholder', + array( $match ) + ); + } + } + } + } + unset( $match, $matches ); + } + + /* + * Analyse the query for single/double quoted simple value placeholders + * Identifiers are checked separately. + */ + $regex = '`(' . $regex_quote . ')%[dfFs]\1`'; + if ( preg_match_all( $regex, $content, $matches ) > 0 ) { + if ( ! empty( $matches[0] ) ) { + foreach ( $matches[0] as $match ) { + $this->phpcsFile->addError( + 'Simple placeholders should not be quoted in the query string in $wpdb->prepare(). Found: %s.', + $i, + 'QuotedSimplePlaceholder', + array( $match ) + ); + } + } + unset( $match, $matches ); + } + + /* + * Analyse the query for quoted identifier placeholders. + */ + $regex = '/(' . $regex_quote . '|`)(?' . self::PREPARE_PLACEHOLDER_REGEX . ')\1/x'; + if ( preg_match_all( $regex, $content, $matches ) > 0 ) { + if ( ! empty( $matches ) ) { + foreach ( $matches['placeholder'] as $index => $match ) { + if ( 'i' === substr( $match, -1 ) ) { + $this->phpcsFile->addError( + 'Placeholders used for identifiers (%%i) in the query string in $wpdb->prepare() are always quoted automagically. Please remove the surrounding quotes. Found: %s', + $i, + 'QuotedIdentifierPlaceholder', + array( $matches[0][ $index ] ) + ); + } + } + } + unset( $index, $match, $matches ); + } + + /* + * Analyse the query for unquoted complex placeholders. + */ + $regex = '`(? 0 ) { + if ( ! empty( $matches[0] ) ) { + foreach ( $matches[0] as $match ) { + if ( substr( $match, -1 ) !== 'i' && preg_match( '`^%[dfFsi]$`', $match ) !== 1 ) { // Identifiers must always be unquoted. + $this->phpcsFile->addWarning( + 'Complex placeholders used for values in the query string in $wpdb->prepare() will NOT be quoted automagically. Found: %s.', + $i, + 'UnquotedComplexPlaceholder', + array( $match ) + ); + } + } + } + unset( $match, $matches ); + } + + /* + * Check for an ` IN (%s)` clause. + */ + $found_in = preg_match_all( '`\s+IN\s*\(\s*%s\s*\)`i', $content, $matches ); + if ( $found_in > 0 ) { + $valid_in_clauses['uses_in'] += $found_in; + } + unset( $found_in ); + } + + if ( false === $text_string_tokens_found ) { + // Query string passed in as a variable or function call, nothing to examine. + return; + } + + if ( 0 === $total_placeholders ) { + if ( 1 === $total_parameters ) { + if ( false === $variable_found && false === $sql_wildcard_found ) { + /* + * Only throw this warning if the PreparedSQL sniff won't throw one about + * variables being found. + * Also don't throw it if we just advised to use a replacement variable to pass a + * string containing an SQL wildcard. + */ + $this->phpcsFile->addWarning( + 'It is not necessary to prepare a query which doesn\'t use variable replacement.', + $i, + 'UnnecessaryPrepare' + ); + } + } elseif ( 0 === $valid_in_clauses['uses_in'] ) { + $this->phpcsFile->addWarning( + 'Replacement variables found, but no valid placeholders found in the query.', + $i, + 'UnfinishedPrepare' + ); + } + + return; + } + + if ( 1 === $total_parameters ) { + $this->phpcsFile->addError( + 'Placeholders found in the query passed to $wpdb->prepare(), but no replacements found. Expected %d replacement(s) parameters.', + $stackPtr, + 'MissingReplacements', + array( $total_placeholders ) + ); + return; + } + + $replacements = $parameters; + unset( $replacements['query'], $replacements[1] ); // Remove the query param, whether passed positionally or named. + + // The parameters may have been passed as an array in the variadic $args parameter. + $args_param = PassedParameters::getParameterFromStack( $parameters, 2, 'args' ); + if ( false !== $args_param && 2 === $total_parameters ) { + $next = $this->phpcsFile->findNext( + Tokens::$emptyTokens, + $args_param['start'], + ( $args_param['end'] + 1 ), + true + ); + + if ( false !== $next + && ( \T_ARRAY === $this->tokens[ $next ]['code'] + || ( isset( Collections::shortArrayListOpenTokensBC()[ $this->tokens[ $next ]['code'] ] ) + && Arrays::isShortArray( $this->phpcsFile, $next ) === true ) ) + ) { + $replacements = PassedParameters::getParameters( $this->phpcsFile, $next ); + } + } + + $total_replacements = \count( $replacements ); + $total_placeholders -= $valid_in_clauses['adjustment_count']; + + // Bow out when `IN` clauses have been used which appear to be correct. + if ( $valid_in_clauses['uses_in'] > 0 + && $valid_in_clauses['uses_in'] === $valid_in_clauses['implode_fill'] + && 1 === $total_replacements + ) { + return; + } + + /* + * Verify that the correct amount of replacements have been passed. + */ + if ( $total_replacements !== $total_placeholders ) { + $this->phpcsFile->addWarning( + 'Incorrect number of replacements passed to $wpdb->prepare(). Found %d replacement parameters, expected %d.', + $stackPtr, + 'ReplacementsWrongNumber', + array( $total_replacements, $total_placeholders ) + ); + } + } + + /** + * Retrieve a regex snippet to recognize and remember quotes based on the quote style + * used in the original string (if any). + * + * This allows for recognizing `"` and `\'` in single quoted strings, + * recognizing `'` and `\"` in double quotes strings and `'` and `"`when the quote + * style is unknown or it is a non-quoted string (heredoc/nowdoc and such). + * + * @since 0.14.0 + * + * @param string $stripped_content Text string content without surrounding quotes. + * @param string $original_content Original content for the same text string. + * + * @return string + */ + protected function get_regex_quote_snippet( $stripped_content, $original_content ) { + $regex_quote = $this->regex_quote; + + if ( $original_content !== $stripped_content ) { + $quote_style = $original_content[0]; + + if ( '"' === $quote_style ) { + $regex_quote = '\\\\"|\''; + } elseif ( "'" === $quote_style ) { + $regex_quote = '"|\\\\\''; + } + } + + return $regex_quote; + } + + /** + * Analyse a sprintf() query wrapper to see if it contains a specific code pattern + * to deal correctly with `IN` queries. + * + * The pattern we are searching for is: + * `sprintf( 'query ....', implode( ',', array_fill( 0, count( $something ), '%s' ) ) )` + * + * @since 0.14.0 + * + * @param array $sprintf_params Parameters details for the sprintf call. + * + * @return int The number of times the pattern was found in the replacements. + */ + protected function analyse_sprintf( $sprintf_params ) { + $found = 0; + + unset( $sprintf_params[1] ); // Remove the positionally passed $format param. + + foreach ( $sprintf_params as $sprintf_param ) { + $implode = $this->phpcsFile->findNext( + Tokens::$emptyTokens + array( \T_NS_SEPARATOR => \T_NS_SEPARATOR ), + $sprintf_param['start'], + $sprintf_param['end'], + true + ); + if ( \T_STRING === $this->tokens[ $implode ]['code'] + && 'implode' === strtolower( $this->tokens[ $implode ]['content'] ) + ) { + if ( $this->analyse_implode( $implode ) === true ) { + ++$found; + } + } + } + + return $found; + } + + /** + * Analyse an implode() function call to see if it contains a specific code pattern + * to dynamically create placeholders. + * + * The pattern we are searching for is: + * `implode( ',', array_fill( 0, count( $something ), '%s' ) )` + * + * This pattern presumes unquoted placeholders! + * + * Identifiers (%i) are not supported, as this function is designed to work + * with `IN()`, which contains a list of values. In the future, it should + * be possible to simplify code using the implode/array_fill pattern to + * use a variable number of identifiers, e.g. `CONCAT(%...i)`, + * https://core.trac.wordpress.org/ticket/54042 + * + * @since 0.14.0 + * + * @param int $implode_token The stackPtr to the implode function call. + * + * @return bool True if the pattern is found, false otherwise. + */ + protected function analyse_implode( $implode_token ) { + $implode_params = PassedParameters::getParameters( $this->phpcsFile, $implode_token ); + if ( empty( $implode_params ) || \count( $implode_params ) !== 2 ) { + return false; + } + + $implode_separator_param = PassedParameters::getParameterFromStack( $implode_params, 1, 'separator' ); + if ( false === $implode_separator_param + || preg_match( '`^(["\']), ?\1$`', $implode_separator_param['clean'] ) !== 1 + ) { + return false; + } + + $implode_array_param = PassedParameters::getParameterFromStack( $implode_params, 2, 'array' ); + if ( false === $implode_array_param ) { + return false; + } + + $array_fill = $this->phpcsFile->findNext( + Tokens::$emptyTokens + array( \T_NS_SEPARATOR => \T_NS_SEPARATOR ), + $implode_array_param['start'], + $implode_array_param['end'], + true + ); + + if ( \T_STRING !== $this->tokens[ $array_fill ]['code'] + || 'array_fill' !== strtolower( $this->tokens[ $array_fill ]['content'] ) + ) { + return false; + } + + $array_fill_value_param = PassedParameters::getParameter( $this->phpcsFile, $array_fill, 3, 'value' ); + if ( false === $array_fill_value_param ) { + return false; + } + + if ( "'%i'" === $array_fill_value_param['clean'] + || '"%i"' === $array_fill_value_param['clean'] + ) { + $firstNonEmpty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $array_fill_value_param['start'], $array_fill_value_param['end'], true ); + + $this->phpcsFile->addError( + 'The %i placeholder cannot be used within SQL `IN()` clauses.', + $firstNonEmpty, + 'IdentifierWithinIN' + ); + return false; + } + + return (bool) preg_match( '`^(["\'])%[dfFs]\1$`', $array_fill_value_param['clean'] ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php new file mode 100644 index 00000000..7b6529ef --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php @@ -0,0 +1,242 @@ + + */ + protected $methods = array( + 'get_var' => true, + 'get_col' => true, + 'get_row' => true, + 'get_results' => true, + 'prepare' => true, + 'query' => true, + ); + + /** + * Functions that escape values for use in SQL queries. + * + * @since 0.9.0 + * @since 0.11.0 Changed from public static to protected non-static. + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The property visibility has changed from `protected` to `private`. + * + * @var array + */ + private $SQLEscapingFunctions = array( + 'absint' => true, + 'esc_sql' => true, + 'floatval' => true, + 'intval' => true, + 'like_escape' => true, + ); + + /** + * Functions whose output is automatically escaped for use in SQL queries. + * + * @since 0.9.0 + * @since 0.11.0 Changed from public static to protected non-static. + * @since 3.0.0 - Moved from the Sniff class to this class. + * - The property visibility has changed from `protected` to `private`. + * + * @var array + */ + private $SQLAutoEscapedFunctions = array( + 'count' => true, + ); + + /** + * Tokens that we don't flag when they are found in a $wpdb method call. + * + * This token array is augmented from within the register() method. + * + * @since 0.9.0 + * @since 3.0.0 The property visibility has changed from `protected` to `private`. + * + * @var array + */ + private $ignored_tokens = array( + \T_STRING_CONCAT => true, + \T_CONSTANT_ENCAPSED_STRING => true, + \T_COMMA => true, + \T_LNUMBER => true, + \T_DNUMBER => true, + \T_NS_SEPARATOR => true, + ); + + /** + * A loop pointer. + * + * It is a property so that we can access it in all of our methods. + * + * @since 0.9.0 + * + * @var int + */ + protected $i; + + /** + * The loop end marker. + * + * It is a property so that we can access it in all of our methods. + * + * @since 0.9.0 + * + * @var int + */ + protected $end; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 0.8.0 + * + * @return array + */ + public function register() { + // Enrich the array of tokens which can be safely ignored. + $this->ignored_tokens += Tokens::$bracketTokens; + $this->ignored_tokens += Tokens::$heredocTokens; + $this->ignored_tokens += Tokens::$castTokens; + $this->ignored_tokens += Tokens::$arithmeticTokens; + $this->ignored_tokens += Collections::incrementDecrementOperators(); + $this->ignored_tokens += Collections::objectOperators(); + $this->ignored_tokens += Tokens::$emptyTokens; + + // The contents of heredoc tokens needs to be examined. + unset( $this->ignored_tokens[ \T_HEREDOC ] ); + + return array( + \T_VARIABLE, + \T_STRING, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 0.8.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + + if ( ! $this->is_wpdb_method_call( $this->phpcsFile, $stackPtr, $this->methods ) ) { + return; + } + + for ( $this->i; $this->i < $this->end; $this->i++ ) { + + if ( isset( $this->ignored_tokens[ $this->tokens[ $this->i ]['code'] ] ) ) { + continue; + } + + if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $this->i ]['code'] + || \T_HEREDOC === $this->tokens[ $this->i ]['code'] + ) { + + $bad_variables = array_filter( + TextStrings::getEmbeds( $this->tokens[ $this->i ]['content'] ), + static function ( $symbol ) { + return preg_match( '`^\{?\$\{?wpdb\??->`', $symbol ) !== 1; + } + ); + + foreach ( $bad_variables as $bad_variable ) { + $this->phpcsFile->addError( + 'Use placeholders and $wpdb->prepare(); found interpolated variable %s at %s', + $this->i, + 'InterpolatedNotPrepared', + array( + $bad_variable, + $this->tokens[ $this->i ]['content'], + ) + ); + } + continue; + } + + if ( \T_VARIABLE === $this->tokens[ $this->i ]['code'] ) { + if ( '$wpdb' === $this->tokens[ $this->i ]['content'] ) { + $this->is_wpdb_method_call( $this->phpcsFile, $this->i, $this->methods ); + continue; + } + + if ( ContextHelper::is_safe_casted( $this->phpcsFile, $this->i ) ) { + continue; + } + } + + if ( \T_STRING === $this->tokens[ $this->i ]['code'] ) { + + if ( + isset( $this->SQLEscapingFunctions[ $this->tokens[ $this->i ]['content'] ] ) + || isset( $this->SQLAutoEscapedFunctions[ $this->tokens[ $this->i ]['content'] ] ) + ) { + + // Find the opening parenthesis. + $opening_paren = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $this->i + 1 ), null, true ); + + if ( false !== $opening_paren + && \T_OPEN_PARENTHESIS === $this->tokens[ $opening_paren ]['code'] + && isset( $this->tokens[ $opening_paren ]['parenthesis_closer'] ) + ) { + // Skip past to the end of the function call. + $this->i = $this->tokens[ $opening_paren ]['parenthesis_closer']; + continue; + } + } elseif ( FormattingFunctionsHelper::is_formatting_function( $this->tokens[ $this->i ]['content'] ) ) { + continue; + } + } + + $this->phpcsFile->addError( + 'Use placeholders and $wpdb->prepare(); found %s', + $this->i, + 'NotPrepared', + array( $this->tokens[ $this->i ]['content'] ) + ); + } + + return $this->end; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php new file mode 100644 index 00000000..4262889a --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php @@ -0,0 +1,57 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Avoid direct calls to the database.', + * 'classes' => array( 'PDO', '\Namespace\Classname' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + + 'mysql' => array( + 'type' => 'error', + 'message' => 'Accessing the database directly should be avoided. Please use the $wpdb object and associated functions instead. Found: %s.', + 'classes' => array( + 'mysqli', + 'PDO', + 'PDOStatement', + ), + ), + + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php new file mode 100644 index 00000000..7d23adaa --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php @@ -0,0 +1,63 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + + 'mysql' => array( + 'type' => 'error', + 'message' => 'Accessing the database directly should be avoided. Please use the $wpdb object and associated functions instead. Found: %s.', + 'functions' => array( + 'mysql_*', + 'mysqli_*', + 'mysqlnd_ms_*', + 'mysqlnd_qc_*', + 'mysqlnd_uh_*', + 'mysqlnd_memcache_*', + 'maxdb_*', + ), + 'allow' => array( + 'mysql_to_rfc3339' => true, + ), + ), + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php new file mode 100644 index 00000000..5cbd99ac --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php @@ -0,0 +1,58 @@ + array( + 'type' => 'warning', + 'message' => 'Detected usage of %s, possible slow query.', + 'keys' => array( + 'tax_query', + 'meta_query', + 'meta_key', + 'meta_value', + ), + ), + ); + } + + /** + * Callback to process each confirmed key, to check value. + * + * @param string $key Array index / key. + * @param mixed $val Assigned value. + * @param int $line Token line. + * @param array $group Group definition. + * + * @return bool Always returns TRUE as the value is irrelevant. + */ + public function callback( $key, $val, $line, $group ) { + return true; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php new file mode 100644 index 00000000..34bfe514 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php @@ -0,0 +1,168 @@ + Key is function name, value irrelevant. + */ + protected $target_functions = array( + 'current_time' => true, + ); + + /** + * Process the parameters of a matched function. + * + * @since 2.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + /* + * We already know there will be valid open & close parentheses as otherwise the parameter + * retrieval function call would have returned an empty array, so no additional checks needed. + */ + $open_parens = $this->phpcsFile->findNext( \T_OPEN_PARENTHESIS, $stackPtr ); + $close_parens = $this->tokens[ $open_parens ]['parenthesis_closer']; + + /* + * Check whether the first parameter is a timestamp format. + */ + $type_param = PassedParameters::getParameterFromStack( $parameters, 1, 'type' ); + if ( false === $type_param ) { + // Type parameter not found. Bow out. + return; + } + + $content_type = ''; + for ( $i = $type_param['start']; $i <= $type_param['end']; $i++ ) { + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + if ( isset( Tokens::$textStringTokens[ $this->tokens[ $i ]['code'] ] ) ) { + $content_type = trim( TextStrings::stripQuotes( $this->tokens[ $i ]['content'] ) ); + if ( 'U' !== $content_type && 'timestamp' !== $content_type ) { + // Most likely valid use of current_time(). + return; + } + + continue; + } + + if ( isset( Tokens::$heredocTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + /* + * If we're still here, we've encountered an unexpected token, like a variable or + * function call. Bow out as we can't determine the runtime value. + */ + return; + } + + $gmt_true = false; + + /* + * Check whether the second parameter, $gmt, is a set to `true` or `1`. + */ + $gmt_param = PassedParameters::getParameterFromStack( $parameters, 2, 'gmt' ); + if ( is_array( $gmt_param ) ) { + $content_gmt = ''; + if ( 'true' === $gmt_param['clean'] || '1' === $gmt_param['clean'] ) { + $content_gmt = $gmt_param['clean']; + $gmt_true = true; + } + } + + /* + * Non-UTC timestamp requested. + */ + if ( false === $gmt_true ) { + $this->phpcsFile->addWarning( + 'Calling current_time() with a $type of "timestamp" or "U" is strongly discouraged as it will not return a Unix (UTC) timestamp. Please consider using a non-timestamp format or otherwise refactoring this code.', + $stackPtr, + 'Requested' + ); + + return; + } + + /* + * UTC timestamp requested. Should use time() instead. + */ + $has_comment = $this->phpcsFile->findNext( Tokens::$commentTokens, ( $stackPtr + 1 ), ( $close_parens + 1 ) ); + $error = 'Don\'t use current_time() for retrieving a Unix (UTC) timestamp. Use time() instead. Found: %s'; + $error_code = 'RequestedUTC'; + + $code_snippet = "current_time( '" . $content_type . "'"; + if ( isset( $content_gmt ) ) { + $code_snippet .= ', ' . $content_gmt; + } + $code_snippet .= ' )'; + + if ( false !== $has_comment ) { + // If there are comments, we don't auto-fix as it would remove those comments. + $this->phpcsFile->addError( $error, $stackPtr, $error_code, array( $code_snippet ) ); + return; + } + + $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, $error_code, array( $code_snippet ) ); + if ( true === $fix ) { + $this->phpcsFile->fixer->beginChangeset(); + + for ( $i = ( $stackPtr + 1 ); $i < $close_parens; $i++ ) { + $this->phpcsFile->fixer->replaceToken( $i, '' ); + } + + $this->phpcsFile->fixer->replaceToken( $stackPtr, 'time(' ); + $this->phpcsFile->fixer->endChangeset(); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php new file mode 100644 index 00000000..279da573 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php @@ -0,0 +1,59 @@ + array( + 'type' => 'error', + 'message' => 'Using %s() and similar isn\'t allowed, instead use WP internal timezone support.', + 'functions' => array( + 'date_default_timezone_set', + ), + ), + + /* + * Use gmdate(), not date(). + * Don't rely on the current PHP time zone as it might have been changed by third party code. + * + * @link https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/ + * @link https://core.trac.wordpress.org/ticket/46438 + * @link https://github.com/WordPress/WordPress-Coding-Standards/issues/1713 + */ + 'date' => array( + 'type' => 'error', + 'message' => '%s() is affected by runtime timezone changes which can cause date/time to be incorrectly displayed. Use gmdate() instead.', + 'functions' => array( + 'date', + ), + ), + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php new file mode 100644 index 00000000..63fc9174 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php @@ -0,0 +1,313 @@ + true, + 'class.wp-scripts.php' => true, + 'class.wp-styles.php' => true, + 'functions.wp-scripts.php' => true, + 'functions.wp-styles.php' => true, + ); + + /** + * Unit test version of the historical exceptions in WP core. + * + * @since 0.11.0 + * @since 3.0.0 Property has been renamed from `$unittest_class_exceptions` to `$unittest_hyphenation_exceptions`, + * + * @var array + */ + private $unittest_hyphenation_exceptions = array( + 'class.wp-dependencies.inc' => true, + 'class.wp-scripts.inc' => true, + 'class.wp-styles.inc' => true, + 'functions.wp-scripts.inc' => true, + 'functions.wp-styles.inc' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() { + if ( \defined( '\PHP_CODESNIFFER_IN_TESTS' ) ) { + $this->hyphenation_exceptions += $this->unittest_hyphenation_exceptions; + } + + return Collections::phpOpenTags(); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + // Usage of `stripQuotes` is to ensure `stdin_path` passed by IDEs does not include quotes. + $file = TextStrings::stripQuotes( $this->phpcsFile->getFileName() ); + if ( 'STDIN' === $file ) { + return; + } + + $class_ptr = $this->phpcsFile->findNext( \T_CLASS, $stackPtr ); + if ( false !== $class_ptr && $this->is_test_class( $this->phpcsFile, $class_ptr ) ) { + /* + * This rule should not be applied to test classes (at all). + * @link https://github.com/WordPress/WordPress-Coding-Standards/issues/1995 + */ + return; + } + + // Respect phpcs:disable comments as long as they are not accompanied by an enable. + $i = -1; + while ( $i = $this->phpcsFile->findNext( \T_PHPCS_DISABLE, ( $i + 1 ) ) ) { + if ( empty( $this->tokens[ $i ]['sniffCodes'] ) + || isset( $this->tokens[ $i ]['sniffCodes']['WordPress'] ) + || isset( $this->tokens[ $i ]['sniffCodes']['WordPress.Files'] ) + || isset( $this->tokens[ $i ]['sniffCodes']['WordPress.Files.FileName'] ) + ) { + do { + $i = $this->phpcsFile->findNext( \T_PHPCS_ENABLE, ( $i + 1 ) ); + } while ( false !== $i + && ! empty( $this->tokens[ $i ]['sniffCodes'] ) + && ! isset( $this->tokens[ $i ]['sniffCodes']['WordPress'] ) + && ! isset( $this->tokens[ $i ]['sniffCodes']['WordPress.Files'] ) + && ! isset( $this->tokens[ $i ]['sniffCodes']['WordPress.Files.FileName'] ) ); + + if ( false === $i ) { + // The entire (rest of the) file is disabled. + return; + } + } + } + + $file_name = basename( $file ); + + $this->check_filename_is_hyphenated( $file_name ); + + if ( true === $this->strict_class_file_names && false !== $class_ptr ) { + $this->check_filename_has_class_prefix( $class_ptr, $file_name ); + } + + if ( false !== strpos( $file, \DIRECTORY_SEPARATOR . 'wp-includes' . \DIRECTORY_SEPARATOR ) + && false === $class_ptr + ) { + $this->check_filename_for_template_suffix( $stackPtr, $file_name ); + } + + // Only run this sniff once per file, no need to run it again. + return ( $this->phpcsFile->numTokens + 1 ); + } + + /** + * Generic check for lowercase hyphenated file names. + * + * @since 3.0.0 + * + * @param string $file_name The name of the current file. + * + * @return void + */ + protected function check_filename_is_hyphenated( $file_name ) { + $extension = strrchr( $file_name, '.' ); + $name = substr( $file_name, 0, ( strlen( $file_name ) - strlen( $extension ) ) ); + + $expected = strtolower( preg_replace( '`[[:punct:]]`', '-', $name ) ) . $extension; + if ( $file_name === $expected + || isset( $this->hyphenation_exceptions[ $file_name ] ) + ) { + return; + } + + if ( true === $this->is_theme && 1 === preg_match( self::THEME_EXCEPTIONS_REGEX, $file_name ) ) { + return; + } + + $this->phpcsFile->addError( + 'Filenames should be all lowercase with hyphens as word separators. Expected %s, but found %s.', + 0, + 'NotHyphenatedLowercase', + array( $expected, $file_name ) + ); + } + + + /** + * Check files containing a class for the "class-" prefix and that the rest of + * the file name reflects the class name. + * + * @since 3.0.0 + * + * @param int $class_ptr Stack pointer to the first T_CLASS in the file. + * @param string $file_name The name of the current file. + * + * @return void + */ + protected function check_filename_has_class_prefix( $class_ptr, $file_name ) { + $extension = strrchr( $file_name, '.' ); + $class_name = ObjectDeclarations::getName( $this->phpcsFile, $class_ptr ); + $expected = 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . $extension; + + if ( $file_name === $expected ) { + return; + } + + $this->phpcsFile->addError( + 'Class file names should be based on the class name with "class-" prepended. Expected %s, but found %s.', + 0, + 'InvalidClassFileName', + array( + $expected, + $file_name, + ) + ); + } + + /** + * Check non-class files in "wp-includes" with a "@subpackage Template" tag for a "-template" suffix. + * + * @since 3.0.0 + * + * @param int $stackPtr Stack pointer to the first PHP open tag in the file. + * @param string $file_name The name of the current file. + * + * @return void + */ + protected function check_filename_for_template_suffix( $stackPtr, $file_name ) { + $subpackage_tag = $this->phpcsFile->findNext( \T_DOC_COMMENT_TAG, $stackPtr, null, false, '@subpackage' ); + if ( false === $subpackage_tag ) { + return; + } + + $subpackage = $this->phpcsFile->findNext( \T_DOC_COMMENT_STRING, $subpackage_tag ); + if ( false === $subpackage ) { + return; + } + + $fileName_end = substr( $file_name, -13 ); + + if ( ( 'Template' === trim( $this->tokens[ $subpackage ]['content'] ) + && $this->tokens[ $subpackage_tag ]['line'] === $this->tokens[ $subpackage ]['line'] ) + && ( ( ! \defined( '\PHP_CODESNIFFER_IN_TESTS' ) && '-template.php' !== $fileName_end ) + || ( \defined( '\PHP_CODESNIFFER_IN_TESTS' ) && '-template.inc' !== $fileName_end ) ) + ) { + $this->phpcsFile->addError( + 'Files containing template tags should have "-template" appended to the end of the file name. Expected %s, but found %s.', + 0, + 'InvalidTemplateTagFileName', + array( + substr( $file_name, 0, -4 ) . '-template.php', + $file_name, + ) + ); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php new file mode 100644 index 00000000..dd3aec69 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php @@ -0,0 +1,1297 @@ + Key is prefix, value irrelevant. + */ + protected $prefix_blocklist = array( + 'wordpress' => true, + 'wp' => true, + '_' => true, + 'php' => true, // See #1728, the 'php' prefix is reserved by PHP itself. + ); + + /** + * Target prefixes after validation. + * + * All prefixes are lowercased for case-insensitive compare. + * + * @since 0.12.0 + * + * @var array + */ + private $validated_prefixes = array(); + + /** + * Target namespace prefixes after validation with regex indicator. + * + * All prefixes are lowercased for case-insensitive compare. + * If the prefix doesn't already contain a namespace separator, but does contain + * non-word characters, these will have been replaced with regex syntax to allow + * for namespace separators and the `is_regex` indicator will have been set to `true`. + * + * @since 1.2.0 + * + * @var array> + */ + private $validated_namespace_prefixes = array(); + + /** + * Cache of previously set prefixes. + * + * Prevents having to do the same prefix validation over and over again. + * + * @since 0.12.0 + * + * @var string[] + */ + private $previous_prefixes = array(); + + /** + * A list of core hooks that are allowed to be called by plugins and themes. + * + * @since 0.14.0 + * @since 3.0.0 Renamed from `$whitelisted_core_hooks` to `$allowed_core_hooks`. + * + * @var array Key is hook name, value irrelevant. + */ + protected $allowed_core_hooks = array( + 'widget_title' => true, + 'add_meta_boxes' => true, + ); + + /** + * A list of core constants that are allowed to be defined by plugins and themes. + * + * Source: {@link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/default-constants.php#L0} + * The constants are listed in alphabetic order. + * Only overrulable constants are listed, i.e. those defined within core within + * a `if ( ! defined() ) {}` wrapper. + * + * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} + * + * @since 1.0.0 + * @since 3.0.0 Renamed from `$whitelisted_core_constants` to `$allowed_core_constants`. + * + * @var array Key is constant name, value irrelevant. + */ + protected $allowed_core_constants = array( + 'ADMIN_COOKIE_PATH' => true, + 'AUTH_COOKIE' => true, + 'AUTOSAVE_INTERVAL' => true, + 'COOKIEHASH' => true, + 'COOKIEPATH' => true, + 'COOKIE_DOMAIN' => true, + 'EMPTY_TRASH_DAYS' => true, + 'FORCE_SSL_ADMIN' => true, + 'FORCE_SSL_LOGIN' => true, // Deprecated. + 'LOGGED_IN_COOKIE' => true, + 'MEDIA_TRASH' => true, + 'MUPLUGINDIR' => true, // Deprecated. + 'PASS_COOKIE' => true, + 'PLUGINDIR' => true, // Deprecated. + 'PLUGINS_COOKIE_PATH' => true, + 'RECOVERY_MODE_COOKIE' => true, + 'SCRIPT_DEBUG' => true, + 'SECURE_AUTH_COOKIE' => true, + 'SHORTINIT' => true, + 'SITECOOKIEPATH' => true, + 'TEST_COOKIE' => true, + 'USER_COOKIE' => true, + 'WPMU_PLUGIN_DIR' => true, + 'WPMU_PLUGIN_URL' => true, + 'WP_CACHE' => true, + 'WP_CONTENT_DIR' => true, + 'WP_CONTENT_URL' => true, + 'WP_CRON_LOCK_TIMEOUT' => true, + 'WP_DEBUG' => true, + 'WP_DEBUG_DISPLAY' => true, + 'WP_DEBUG_LOG' => true, + 'WP_DEFAULT_THEME' => true, + 'WP_DEVELOPMENT_MODE' => true, + 'WP_MAX_MEMORY_LIMIT' => true, + 'WP_MEMORY_LIMIT' => true, + 'WP_PLUGIN_DIR' => true, + 'WP_PLUGIN_URL' => true, + 'WP_POST_REVISIONS' => true, + 'WP_START_TIMESTAMP' => true, + ); + + /** + * A list of functions declared in WP core as "Pluggable", i.e. overloadable from a plugin. + * + * Note: deprecated functions should still be included in this list as plugins may support older WP versions. + * + * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} + * + * @since 3.0.0. + * + * @var array Key is function name, value irrelevant. + */ + protected $pluggable_functions = array( + 'auth_redirect' => true, + 'cache_users' => true, + 'check_admin_referer' => true, + 'check_ajax_referer' => true, + 'get_avatar' => true, + 'get_currentuserinfo' => true, // Deprecated. + 'get_user_by' => true, + 'get_user_by_email' => true, // Deprecated. + 'get_userdata' => true, + 'get_userdatabylogin' => true, // Deprecated. + 'graceful_fail' => true, + 'install_global_terms' => true, + 'install_network' => true, + 'is_user_logged_in' => true, + // 'lowercase_octets' => true, => unclear if this function is meant to be publicly pluggable. + 'maybe_add_column' => true, + 'maybe_create_table' => true, + 'set_current_user' => true, // Deprecated. + 'twenty_twenty_one_entry_meta_footer' => true, + 'twenty_twenty_one_post_thumbnail' => true, + 'twenty_twenty_one_post_title' => true, + 'twenty_twenty_one_posted_by' => true, + 'twenty_twenty_one_posted_on' => true, + 'twenty_twenty_one_setup' => true, + 'twenty_twenty_one_the_posts_navigation' => true, + 'twentyeleven_admin_header_image' => true, + 'twentyeleven_admin_header_style' => true, + 'twentyeleven_comment' => true, + 'twentyeleven_content_nav' => true, + 'twentyeleven_continue_reading_link' => true, + 'twentyeleven_header_image' => true, + 'twentyeleven_header_style' => true, + 'twentyeleven_posted_on' => true, + 'twentyeleven_setup' => true, + 'twentyfifteen_comment_nav' => true, + 'twentyfifteen_entry_meta' => true, + 'twentyfifteen_excerpt_more' => true, + 'twentyfifteen_fonts_url' => true, + 'twentyfifteen_get_color_scheme' => true, + 'twentyfifteen_get_color_scheme_choices' => true, + 'twentyfifteen_get_link_url' => true, + 'twentyfifteen_header_style' => true, + 'twentyfifteen_post_thumbnail' => true, + 'twentyfifteen_sanitize_color_scheme' => true, + 'twentyfifteen_setup' => true, + 'twentyfifteen_the_custom_logo' => true, + 'twentyfourteen_admin_header_image' => true, + 'twentyfourteen_admin_header_style' => true, + 'twentyfourteen_excerpt_more' => true, + 'twentyfourteen_font_url' => true, + 'twentyfourteen_header_image' => true, + 'twentyfourteen_header_style' => true, + 'twentyfourteen_list_authors' => true, + 'twentyfourteen_paging_nav' => true, + 'twentyfourteen_post_nav' => true, + 'twentyfourteen_post_thumbnail' => true, + 'twentyfourteen_posted_on' => true, + 'twentyfourteen_setup' => true, + 'twentyfourteen_the_attached_image' => true, + 'twentynineteen_comment_count' => true, + 'twentynineteen_comment_form' => true, + 'twentynineteen_discussion_avatars_list' => true, + 'twentynineteen_entry_footer' => true, + 'twentynineteen_get_user_avatar_markup' => true, + 'twentynineteen_post_thumbnail' => true, + 'twentynineteen_posted_by' => true, + 'twentynineteen_posted_on' => true, + 'twentynineteen_setup' => true, + 'twentynineteen_the_posts_navigation' => true, + 'twentyseventeen_edit_link' => true, + 'twentyseventeen_entry_footer' => true, + 'twentyseventeen_fonts_url' => true, + 'twentyseventeen_header_style' => true, + 'twentyseventeen_posted_on' => true, + 'twentyseventeen_time_link' => true, + 'twentysixteen_categorized_blog' => true, + 'twentysixteen_entry_date' => true, + 'twentysixteen_entry_meta' => true, + 'twentysixteen_entry_taxonomies' => true, + 'twentysixteen_excerpt' => true, + 'twentysixteen_excerpt_more' => true, + 'twentysixteen_fonts_url' => true, + 'twentysixteen_get_color_scheme' => true, + 'twentysixteen_get_color_scheme_choices' => true, + 'twentysixteen_header_style' => true, + 'twentysixteen_post_thumbnail' => true, + 'twentysixteen_sanitize_color_scheme' => true, + 'twentysixteen_setup' => true, + 'twentysixteen_the_custom_logo' => true, + 'twentyten_admin_header_style' => true, + 'twentyten_comment' => true, + 'twentyten_continue_reading_link' => true, + 'twentyten_header_image' => true, + 'twentyten_posted_in' => true, + 'twentyten_posted_on' => true, + 'twentyten_setup' => true, + 'twentythirteen_entry_date' => true, + 'twentythirteen_entry_meta' => true, + 'twentythirteen_excerpt_more' => true, + 'twentythirteen_fonts_url' => true, + 'twentythirteen_paging_nav' => true, + 'twentythirteen_post_nav' => true, + 'twentythirteen_the_attached_image' => true, + 'twentytwelve_comment' => true, + 'twentytwelve_content_nav' => true, + 'twentytwelve_entry_meta' => true, + 'twentytwelve_get_font_url' => true, + 'twentytwenty_customize_partial_blogdescription' => true, + 'twentytwenty_customize_partial_blogname' => true, + 'twentytwenty_customize_partial_site_logo' => true, + 'twentytwenty_generate_css' => true, + 'twentytwenty_get_customizer_css' => true, + 'twentytwenty_get_theme_svg' => true, + 'twentytwenty_the_theme_svg' => true, + 'twentytwentyfour_block_styles' => true, + 'twentytwentyfour_block_stylesheets' => true, + 'twentytwentyfour_pattern_categories' => true, + 'twentytwentytwo_styles' => true, + 'twentytwentytwo_support' => true, + 'wp_authenticate' => true, + 'wp_cache_add_multiple' => true, + 'wp_cache_delete_multiple' => true, + 'wp_cache_flush_group' => true, + 'wp_cache_flush_runtime' => true, + 'wp_cache_get_multiple' => true, + 'wp_cache_set_multiple' => true, + 'wp_cache_supports' => true, + 'wp_check_password' => true, + 'wp_clear_auth_cookie' => true, + 'wp_clearcookie' => true, // Deprecated. + 'wp_create_nonce' => true, + 'wp_generate_auth_cookie' => true, + 'wp_generate_password' => true, + 'wp_get_cookie_login' => true, // Deprecated. + 'wp_get_current_user' => true, + // 'wp_handle_upload_error' => true, => unclear if this function is meant to be publicly pluggable. + 'wp_hash' => true, + 'wp_hash_password' => true, + 'wp_install' => true, + 'wp_install_defaults' => true, + 'wp_login' => true, // Deprecated. + 'wp_logout' => true, + 'wp_mail' => true, + 'wp_new_blog_notification' => true, + 'wp_new_user_notification' => true, + 'wp_nonce_tick' => true, + 'wp_notify_moderator' => true, + 'wp_notify_postauthor' => true, + 'wp_parse_auth_cookie' => true, + 'wp_password_change_notification' => true, + 'wp_rand' => true, + 'wp_redirect' => true, + 'wp_safe_redirect' => true, + 'wp_salt' => true, + 'wp_sanitize_redirect' => true, + 'wp_set_auth_cookie' => true, + 'wp_set_current_user' => true, + 'wp_set_password' => true, + 'wp_setcookie' => true, // Deprecated. + 'wp_text_diff' => true, + 'wp_upgrade' => true, + 'wp_validate_auth_cookie' => true, + 'wp_validate_redirect' => true, + 'wp_verify_nonce' => true, + ); + + /** + * A list of classes declared in WP core as "Pluggable", i.e. overloadable from a plugin. + * + * Source: {@link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/pluggable.php} + * and {@link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/pluggable-deprecated.php} + * + * Note: deprecated classes should still be included in this list as plugins may support older WP versions. + * + * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} + * + * @since 3.0.0. + * + * @var array Key is class name, value irrelevant. + */ + protected $pluggable_classes = array( + 'TwentyTwenty_Customize' => true, + 'TwentyTwenty_Non_Latin_Languages' => true, + 'TwentyTwenty_SVG_Icons' => true, + 'TwentyTwenty_Script_Loader' => true, + 'TwentyTwenty_Separator_Control' => true, + 'TwentyTwenty_Walker_Comment' => true, + 'TwentyTwenty_Walker_Page' => true, + 'Twenty_Twenty_One_Customize' => true, + 'WP_User_Search' => true, + 'wp_atom_server' => true, // Deprecated. + ); + + /** + * List of all PHP native functions. + * + * Using this list rather than a call to `function_exists()` prevents + * false negatives from user-defined functions when those would be + * autoloaded via a Composer autoload files directives. + * + * @var array + */ + private $built_in_functions; + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 0.12.0 + * + * @return array + */ + public function register() { + // Get a list of all PHP native functions. + $all_functions = get_defined_functions(); + $this->built_in_functions = array_flip( $all_functions['internal'] ); + $this->built_in_functions = array_change_key_case( $this->built_in_functions, \CASE_LOWER ); + + // Make sure the pluggable functions and classes list can be easily compared. + $this->pluggable_functions = array_change_key_case( $this->pluggable_functions, \CASE_LOWER ); + $this->pluggable_classes = array_change_key_case( $this->pluggable_classes, \CASE_LOWER ); + + // Set the sniff targets. + $targets = array( + \T_NAMESPACE => \T_NAMESPACE, + \T_FUNCTION => \T_FUNCTION, + \T_CONST => \T_CONST, + \T_VARIABLE => \T_VARIABLE, + \T_DOLLAR => \T_DOLLAR, // Variable variables. + \T_FN_ARROW => \T_FN_ARROW, // T_FN_ARROW is only used for skipping over (for now). + ); + $targets += Tokens::$ooScopeTokens; // T_ANON_CLASS is only used for skipping over test classes. + $targets += Collections::listOpenTokensBC(); + + // Add function call target for hook names and constants defined using define(). + $parent = parent::register(); + if ( ! empty( $parent ) ) { + $targets[] = \T_STRING; + } + + return $targets; + } + + /** + * Groups of functions to restrict. + * + * @since 0.12.0 + * + * @return array + */ + public function getGroups() { + // Only retrieve functions which are not used for deprecated hooks. + $this->target_functions = WPHookHelper::get_functions( false ); + $this->target_functions['define'] = true; + + return parent::getGroups(); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 0.12.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + + // Allow overruling the prefixes set in a ruleset via the command line. + $cl_prefixes = Helper::getConfigData( 'prefixes' ); + if ( ! empty( $cl_prefixes ) ) { + $cl_prefixes = trim( $cl_prefixes ); + if ( '' !== $cl_prefixes ) { + $this->prefixes = array_filter( array_map( 'trim', explode( ',', $cl_prefixes ) ) ); + } + } + + $this->prefixes = RulesetPropertyHelper::merge_custom_array( $this->prefixes, array(), false ); + if ( empty( $this->prefixes ) ) { + // No prefixes passed, nothing to do. + return; + } + + $this->validate_prefixes(); + if ( empty( $this->validated_prefixes ) ) { + // No _valid_ prefixes passed, nothing to do. + return; + } + + // Ignore test classes. + if ( isset( Tokens::$ooScopeTokens[ $this->tokens[ $stackPtr ]['code'] ] ) + && true === $this->is_test_class( $this->phpcsFile, $stackPtr ) + ) { + if ( $this->tokens[ $stackPtr ]['scope_condition'] === $stackPtr && isset( $this->tokens[ $stackPtr ]['scope_closer'] ) ) { + // Skip forward to end of test class. + return $this->tokens[ $stackPtr ]['scope_closer']; + } + return; + } + + if ( \T_ANON_CLASS === $this->tokens[ $stackPtr ]['code'] ) { + // Token was only registered to allow skipping over test classes. + return; + } + + /* + * Ignore the contents of arrow functions which do not declare closures. + * + * - Parameters declared by arrow functions do not need to be prefixed (handled elsewhere). + * - New variables declared within an arrow function are local to the arrow function, so can be ignored. + * - A `global` statement is not allowed within an arrow function. + * + * Note: this does mean some convoluted code may get ignored (false negatives), but this is currently + * not reliably solvable as PHPCS does not add arrow functions to the 'conditions' array. + */ + if ( \T_FN_ARROW === $this->tokens[ $stackPtr ]['code'] + && isset( $this->tokens[ $stackPtr ]['scope_closer'] ) + ) { + $has_closure = $this->phpcsFile->findNext( \T_CLOSURE, ( $stackPtr + 1 ), $this->tokens[ $stackPtr ]['scope_closer'] ); + if ( false !== $has_closure ) { + // Skip to the start of the closure. + return $has_closure; + } + + // Skip the arrow function completely. + return $this->tokens[ $stackPtr ]['scope_closer']; + } + + if ( \T_STRING === $this->tokens[ $stackPtr ]['code'] ) { + // Disallow excluding function groups for this sniff. + $this->exclude = array(); + + return parent::process_token( $stackPtr ); + + } elseif ( \T_DOLLAR === $this->tokens[ $stackPtr ]['code'] ) { + + return $this->process_variable_variable( $stackPtr ); + + } elseif ( \T_VARIABLE === $this->tokens[ $stackPtr ]['code'] ) { + + return $this->process_variable_assignment( $stackPtr ); + + } elseif ( isset( Collections::listOpenTokensBC()[ $this->tokens[ $stackPtr ]['code'] ] ) ) { + return $this->process_list_assignment( $stackPtr ); + + } elseif ( \T_NAMESPACE === $this->tokens[ $stackPtr ]['code'] ) { + $namespace_name = Namespaces::getDeclaredName( $this->phpcsFile, $stackPtr ); + + if ( false === $namespace_name || '' === $namespace_name || '\\' === $namespace_name ) { + return; + } + + foreach ( $this->validated_namespace_prefixes as $key => $prefix_info ) { + if ( false === $prefix_info['is_regex'] ) { + if ( stripos( $namespace_name, $prefix_info['prefix'] ) === 0 ) { + $this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: allowed prefixes', $key ); + return; + } + } else { + // Ok, so this prefix should be used as a regex. + $regex = '`^' . $prefix_info['prefix'] . '`i'; + if ( preg_match( $regex, $namespace_name ) > 0 ) { + $this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: allowed prefixes', $key ); + return; + } + } + } + + // Still here ? In that case, we have a non-prefixed namespace name. + $recorded = $this->phpcsFile->addError( + self::ERROR_MSG, + $stackPtr, + 'NonPrefixedNamespaceFound', + array( + 'Namespaces declared', + $namespace_name, + ) + ); + + if ( true === $recorded ) { + $this->record_potential_prefix_metric( $stackPtr, $namespace_name ); + } + + return; + + } else { + + // Namespaced methods, classes and constants do not need to be prefixed. + $namespace = Namespaces::determineNamespace( $this->phpcsFile, $stackPtr ); + if ( '' !== $namespace && '\\' !== $namespace ) { + return; + } + + $item_name = ''; + $error_text = 'Unknown syntax used'; + $error_code = 'NonPrefixedSyntaxFound'; + + switch ( $this->tokens[ $stackPtr ]['code'] ) { + case \T_FUNCTION: + // Methods in a class do not need to be prefixed. + if ( Scopes::isOOMethod( $this->phpcsFile, $stackPtr ) === true ) { + return; + } + + if ( DeprecationHelper::is_function_deprecated( $this->phpcsFile, $stackPtr ) === true ) { + /* + * Deprecated functions don't have to comply with the naming conventions, + * otherwise functions deprecated in favour of a function with a compliant + * name would still trigger an error. + */ + return; + } + + $item_name = FunctionDeclarations::getName( $this->phpcsFile, $stackPtr ); + $item_lc = strtolower( $item_name ); + if ( isset( $this->built_in_functions[ $item_lc ] ) ) { + // Backfill for PHP native function. + return; + } + + if ( isset( $this->pluggable_functions[ $item_lc ] ) ) { + // Pluggable function should not be prefixed. + return; + } + + $error_text = 'Functions declared in the global namespace'; + $error_code = 'NonPrefixedFunctionFound'; + break; + + case \T_CLASS: + case \T_INTERFACE: + case \T_TRAIT: + case \T_ENUM: + $item_name = ObjectDeclarations::getName( $this->phpcsFile, $stackPtr ); + $error_text = 'Classes declared'; + $error_code = 'NonPrefixedClassFound'; + + switch ( $this->tokens[ $stackPtr ]['code'] ) { + case \T_CLASS: + if ( isset( $this->pluggable_classes[ strtolower( $item_name ) ] ) ) { + // Pluggable class should not be prefixed. + return; + } + + if ( class_exists( '\\' . $item_name, false ) ) { + // Backfill for PHP native class. + return; + } + break; + + case \T_INTERFACE: + if ( interface_exists( '\\' . $item_name, false ) ) { + // Backfill for PHP native interface. + return; + } + + $error_text = 'Interfaces declared'; + $error_code = 'NonPrefixedInterfaceFound'; + break; + + case \T_TRAIT: + // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.trait_existsFound + if ( function_exists( '\trait_exists' ) && trait_exists( '\\' . $item_name, false ) ) { + // Backfill for PHP native trait. + return; + } + + $error_text = 'Traits declared'; + $error_code = 'NonPrefixedTraitFound'; + break; + + case \T_ENUM: + // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.enum_existsFound + if ( function_exists( '\enum_exists' ) && enum_exists( '\\' . $item_name, false ) ) { + // Backfill for PHP native enum. + return; + } + + $error_text = 'Enums declared'; + $error_code = 'NonPrefixedEnumFound'; + break; + } + + break; + + case \T_CONST: + // Constants in an OO construct do not need to be prefixed. + if ( true === Scopes::isOOConstant( $this->phpcsFile, $stackPtr ) ) { + return; + } + + $constant_name_ptr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true, null, true ); + if ( false === $constant_name_ptr ) { + // Live coding. + return; + } + + $item_name = $this->tokens[ $constant_name_ptr ]['content']; + if ( \defined( '\\' . $item_name ) ) { + // Backfill for PHP native constant. + return; + } + + if ( isset( $this->allowed_core_constants[ $item_name ] ) ) { + // Defining a WP Core constant intended for overruling. + return; + } + + $error_text = 'Global constants defined'; + $error_code = 'NonPrefixedConstantFound'; + break; + + default: + // Left empty on purpose. + break; + + } + + if ( empty( $item_name ) || $this->is_prefixed( $stackPtr, $item_name ) === true ) { + return; + } + + $recorded = $this->phpcsFile->addError( + self::ERROR_MSG, + $stackPtr, + $error_code, + array( + $error_text, + $item_name, + ) + ); + + if ( true === $recorded ) { + $this->record_potential_prefix_metric( $stackPtr, $item_name ); + } + } + } + + /** + * Handle variable variables defined in the global namespace. + * + * @since 0.12.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + protected function process_variable_variable( $stackPtr ) { + static $indicators = array( + \T_OPEN_CURLY_BRACKET => true, + \T_VARIABLE => true, + ); + + // Is this a variable variable ? + // Not concerned with nested ones as those will be recognized on their own token. + $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true, null, true ); + if ( false === $next_non_empty || ! isset( $indicators[ $this->tokens[ $next_non_empty ]['code'] ] ) ) { + return; + } + + if ( \T_OPEN_CURLY_BRACKET === $this->tokens[ $next_non_empty ]['code'] + && isset( $this->tokens[ $next_non_empty ]['bracket_closer'] ) + ) { + // Skip over the variable part. + $next_non_empty = $this->tokens[ $next_non_empty ]['bracket_closer']; + } + + $maybe_assignment = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $next_non_empty + 1 ), null, true, null, true ); + + while ( false !== $maybe_assignment + && \T_OPEN_SQUARE_BRACKET === $this->tokens[ $maybe_assignment ]['code'] + && isset( $this->tokens[ $maybe_assignment ]['bracket_closer'] ) + ) { + $maybe_assignment = $this->phpcsFile->findNext( + Tokens::$emptyTokens, + ( $this->tokens[ $maybe_assignment ]['bracket_closer'] + 1 ), + null, + true, + null, + true + ); + } + + if ( false === $maybe_assignment ) { + return; + } + + if ( ! isset( Tokens::$assignmentTokens[ $this->tokens[ $maybe_assignment ]['code'] ] ) ) { + // Not an assignment. + return; + } + + $error = self::ERROR_MSG; + + /* + * Local variable variables in a function do not need to be prefixed. + * But a variable variable could evaluate to the name of an imported global + * variable. + * Not concerned with imported variable variables (global.. ) as that has been + * forbidden since PHP 7.0. Presuming cross-version code and if not, that + * is for the PHPCompatibility standard to detect. + */ + $functionPtr = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); + if ( false !== $functionPtr ) { + $has_global = $this->phpcsFile->findPrevious( \T_GLOBAL, ( $stackPtr - 1 ), $this->tokens[ $functionPtr ]['scope_opener'] ); + if ( false === $has_global ) { + // No variable import happening. + return; + } + + $error = 'Variable variable which could potentially override an imported global variable detected. ' . $error; + } + + $variable_name = $this->phpcsFile->getTokensAsString( $stackPtr, ( ( $next_non_empty - $stackPtr ) + 1 ) ); + + // Still here ? In that case, the variable name should be prefixed. + $recorded = $this->phpcsFile->addWarning( + $error, + $stackPtr, + 'NonPrefixedVariableFound', + array( + 'Global variables defined', + $variable_name, + ) + ); + + if ( true === $recorded ) { + $this->record_potential_prefix_metric( $stackPtr, $variable_name ); + } + + // Skip over the variable part of the variable. + return ( $next_non_empty + 1 ); + } + + /** + * Check that defined global variables are prefixed. + * + * @since 0.12.0 + * @since 2.2.0 Added $in_list parameter. + * + * @param int $stackPtr The position of the current token in the stack. + * @param bool $in_list Whether or not this is a variable in a list assignment. + * Defaults to false. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + protected function process_variable_assignment( $stackPtr, $in_list = false ) { + /* + * We're only concerned with variables which are being defined. + * `is_assigment()` will not recognize property assignments, which is good in this case. + * However it will also not recognize $b in `foreach( $a as $b )` as an assignment, so + * we need a separate check for that. + */ + if ( false === $in_list + && false === VariableHelper::is_assignment( $this->phpcsFile, $stackPtr ) + && Context::inForeachCondition( $this->phpcsFile, $stackPtr ) !== 'afterAs' + ) { + return; + } + + $is_error = true; + $variable_name = substr( $this->tokens[ $stackPtr ]['content'], 1 ); // Strip the dollar sign. + + // Bow out early if we know for certain no prefix is needed. + if ( 'GLOBALS' !== $variable_name + && $this->variable_prefixed_or_allowed( $stackPtr, $variable_name ) === true + ) { + return; + } + + if ( 'GLOBALS' === $variable_name ) { + $array_open = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true, null, true ); + if ( false === $array_open || \T_OPEN_SQUARE_BRACKET !== $this->tokens[ $array_open ]['code'] ) { + // Live coding or something very silly. + return; + } + + $array_key = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $array_open + 1 ), null, true, null, true ); + if ( false === $array_key ) { + // No key found, nothing to do. + return; + } + + $stackPtr = $array_key; + $variable_name = TextStrings::stripQuotes( $this->tokens[ $array_key ]['content'] ); + + // Check whether a prefix is needed. + if ( isset( Tokens::$stringTokens[ $this->tokens[ $array_key ]['code'] ] ) + && $this->variable_prefixed_or_allowed( $stackPtr, $variable_name ) === true + ) { + return; + } + + if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $array_key ]['code'] ) { + // If the array key is a double quoted string, try again with only + // the part before the first variable (if any). + $exploded = explode( '$', $variable_name ); + $first = rtrim( $exploded[0], '{' ); + if ( '' !== $first ) { + if ( $this->variable_prefixed_or_allowed( $array_key, $first ) === true ) { + return; + } + } else { + // If the first part was dynamic, throw a warning. + $is_error = false; + } + } elseif ( ! isset( Tokens::$stringTokens[ $this->tokens[ $array_key ]['code'] ] ) ) { + // Dynamic array key, throw a warning. + $is_error = false; + } + } else { + // Function parameters do not need to be prefixed. + if ( false === $in_list ) { + $functionPtr = Parentheses::getLastOwner( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); + if ( false !== $functionPtr ) { + return; + } + unset( $functionPtr ); + } + + // Properties in a class do not need to be prefixed. + if ( false === $in_list && true === Scopes::isOOProperty( $this->phpcsFile, $stackPtr ) ) { + return; + } + + // Local variables in a function do not need to be prefixed unless they are being imported. + $functionPtr = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); + if ( false !== $functionPtr ) { + $has_global = $this->phpcsFile->findPrevious( \T_GLOBAL, ( $stackPtr - 1 ), $this->tokens[ $functionPtr ]['scope_opener'] ); + if ( false === $has_global + || Conditions::getLastCondition( $this->phpcsFile, $has_global, Collections::functionDeclarationTokens() ) !== $functionPtr + ) { + // No variable import happening in the current scope. + return; + } + + // Ok, this may be an imported global variable. + $end_of_statement = $this->phpcsFile->findNext( array( \T_SEMICOLON, \T_CLOSE_TAG ), ( $has_global + 1 ) ); + if ( false === $end_of_statement ) { + // No semi-colon - live coding. + return; + } + + for ( $ptr = ( $has_global + 1 ); $ptr <= $end_of_statement; $ptr++ ) { + // Move the stack pointer to the next variable. + $ptr = $this->phpcsFile->findNext( \T_VARIABLE, $ptr, $end_of_statement, false, null, true ); + + if ( false === $ptr ) { + // Reached the end of the global statement without finding the variable, + // so this must be a local variable. + return; + } + + if ( substr( $this->tokens[ $ptr ]['content'], 1 ) === $variable_name ) { + break; + } + } + + unset( $has_global, $end_of_statement, $ptr ); + } + } + + // Still here ? In that case, the variable name should be prefixed. + $recorded = MessageHelper::addMessage( + $this->phpcsFile, + self::ERROR_MSG, + $stackPtr, + $is_error, + 'NonPrefixedVariableFound', + array( + 'Global variables defined', + '$' . $variable_name, + ) + ); + + if ( true === $recorded ) { + $this->record_potential_prefix_metric( $stackPtr, $variable_name ); + } + } + + /** + * Check that global variables declared via a list construct are prefixed. + * + * {@internal No need to take special measures for nested lists. Nested or not, + * each list part can only contain one variable being written to.} + * + * @since 2.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + protected function process_list_assignment( $stackPtr ) { + $list_open_close = Lists::getOpenClose( $this->phpcsFile, $stackPtr ); + if ( false === $list_open_close ) { + // Short array, not short list. + return; + } + + $var_pointers = ListHelper::get_list_variables( $this->phpcsFile, $stackPtr ); + foreach ( $var_pointers as $ptr ) { + $this->process_variable_assignment( $ptr, true ); + } + + // No need to re-examine these variables. + return $list_open_close['closer']; + } + + /** + * Process the parameters of a matched function. + * + * @since 0.12.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + if ( 'define' === $matched_content ) { + $target_param = PassedParameters::getParameterFromStack( $parameters, 1, 'constant_name' ); + + } else { + $target_param = WPHookHelper::get_hook_name_param( $matched_content, $parameters ); + } + + if ( false === $target_param ) { + return; + } + + $is_error = true; + $clean_content = TextStrings::stripQuotes( $target_param['clean'] ); + + if ( ( 'define' !== $matched_content + && isset( $this->allowed_core_hooks[ $clean_content ] ) ) + || ( 'define' === $matched_content + && isset( $this->allowed_core_constants[ $clean_content ] ) ) + ) { + return; + } + + if ( $this->is_prefixed( $target_param['start'], $clean_content ) === true ) { + return; + } else { + // This may be a dynamic hook/constant name. + $first_non_empty = $this->phpcsFile->findNext( + Tokens::$emptyTokens, + $target_param['start'], + ( $target_param['end'] + 1 ), + true + ); + + if ( false === $first_non_empty ) { + return; + } + + $first_non_empty_content = TextStrings::stripQuotes( $this->tokens[ $first_non_empty ]['content'] ); + + // Try again with just the first token if it's a text string. + if ( isset( Tokens::$stringTokens[ $this->tokens[ $first_non_empty ]['code'] ] ) + && $this->is_prefixed( $target_param['start'], $first_non_empty_content ) === true + ) { + return; + } + + if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $first_non_empty ]['code'] ) { + // If the first part of the parameter is a double quoted string, try again with only + // the part before the first variable (if any). + $exploded = explode( '$', $first_non_empty_content ); + $first = rtrim( $exploded[0], '{' ); + if ( '' !== $first ) { + if ( $this->is_prefixed( $target_param['start'], $first ) === true ) { + return; + } + } else { + // Start of hook/constant name is dynamic, throw a warning. + $is_error = false; + } + } elseif ( ! isset( Tokens::$stringTokens[ $this->tokens[ $first_non_empty ]['code'] ] ) ) { + // Dynamic hook/constant name, throw a warning. + $is_error = false; + } + } + + if ( 'define' === $matched_content ) { + if ( \defined( '\\' . $clean_content ) ) { + // Backfill for PHP native constant. + return; + } + + if ( strpos( $clean_content, '\\' ) !== false ) { + // Namespaced or unreachable constant. + return; + } + + $data = array( 'Global constants defined' ); + $error_code = 'NonPrefixedConstantFound'; + if ( false === $is_error ) { + $error_code = 'VariableConstantNameFound'; + } + } else { + $data = array( 'Hook names invoked' ); + $error_code = 'NonPrefixedHooknameFound'; + if ( false === $is_error ) { + $error_code = 'DynamicHooknameFound'; + } + } + + $data[] = $clean_content; + + $recorded = MessageHelper::addMessage( $this->phpcsFile, self::ERROR_MSG, $first_non_empty, $is_error, $error_code, $data ); + + if ( true === $recorded ) { + $this->record_potential_prefix_metric( $stackPtr, $clean_content ); + } + } + + /** + * Check if a function/class/constant/variable name is prefixed with one of the expected prefixes. + * + * @since 0.12.0 + * @since 0.14.0 Allows for other non-word characters as well as underscores to better support hook names. + * @since 1.0.0 Does not require a word seperator anymore after a prefix. + * This allows for improved code style independent checking, + * i.e. allows for camelCase naming and the likes. + * @since 1.0.1 - Added $stackPtr parameter. + * - The function now also records metrics about the prefixes encountered. + * + * @param int $stackPtr The position of the token to record the metric against. + * @param string $name Name to check for a prefix. + * + * @return bool True when the name is one of the prefixes or starts with an allowed prefix. + * False otherwise. + */ + private function is_prefixed( $stackPtr, $name ) { + foreach ( $this->validated_prefixes as $prefix ) { + if ( stripos( $name, $prefix ) === 0 ) { + $this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: allowed prefixes', $prefix ); + return true; + } + } + + return false; + } + + /** + * Check if a variable name might need a prefix. + * + * Prefix is not needed for: + * - superglobals, + * - WP native globals, + * - variables which are already prefixed. + * + * @since 0.12.0 + * @since 1.0.1 Added $stackPtr parameter. + * @since 3.0.0 Renamed from `variable_prefixed_or_whitelisted()` to `variable_prefixed_or_allowed()`. + * + * @param int $stackPtr The position of the token to record the metric against. + * @param string $name Variable name without the dollar sign. + * + * @return bool True if the variable name is allowed or already prefixed. + * False otherwise. + */ + private function variable_prefixed_or_allowed( $stackPtr, $name ) { + // Ignore superglobals and WP global variables. + if ( Variables::isSuperglobalName( $name ) || WPGlobalVariablesHelper::is_wp_global( $name ) ) { + return true; + } + + return $this->is_prefixed( $stackPtr, $name ); + } + + /** + * Validate an array of prefixes as passed through a custom property or via the command line. + * + * Checks that the prefix: + * - is not one of the blocked ones. + * - complies with the PHP rules for valid function, class, variable, constant names. + * + * @since 0.12.0 + * + * @return void + */ + private function validate_prefixes() { + if ( $this->previous_prefixes === $this->prefixes ) { + return; + } + + // Set the cache *before* validation so as to not break the above compare. + $this->previous_prefixes = $this->prefixes; + + // Validate the passed prefix(es). + $prefixes = array(); + $ns_prefixes = array(); + foreach ( $this->prefixes as $key => $prefix ) { + $prefixLC = strtolower( $prefix ); + + if ( isset( $this->prefix_blocklist[ $prefixLC ] ) ) { + $this->phpcsFile->addError( + 'The "%s" prefix is not allowed.', + 0, + 'ForbiddenPrefixPassed', + array( $prefix ) + ); + continue; + } + + $prefix_length = strlen( $prefix ); + if ( function_exists( 'iconv_strlen' ) ) { + $prefix_length = iconv_strlen( $prefix, Helper::getEncoding( $this->phpcsFile ) ); + } + + if ( $prefix_length < self::MIN_PREFIX_LENGTH ) { + $this->phpcsFile->addError( + 'The "%s" prefix is too short. Short prefixes are not unique enough and may cause name collisions with other code.', + 0, + 'ShortPrefixPassed', + array( $prefix ) + ); + continue; + } + + /* + * Validate the prefix against characters allowed for function, class, constant names etc. + * Note: this does not use the PHPCSUtils `NamingConventions::isValidIdentifierName()` method + * as we want to allow namespace separators in the prefixes. + */ + if ( preg_match( '`^[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff\\\\]*$`', $prefix ) !== 1 ) { + + $this->phpcsFile->addWarning( + 'The "%s" prefix is not a valid namespace/function/class/variable/constant prefix in PHP.', + 0, + 'InvalidPrefixPassed', + array( $prefix ) + ); + } + + // Lowercase the prefix to allow for direct compare. + $prefixes[ $key ] = $prefixLC; + + /* + * Replace non-word characters in the prefix with a regex snippet, but only if the + * string doesn't already contain namespace separators. + */ + $is_regex = false; + if ( strpos( $prefix, '\\' ) === false && preg_match( '`[_\W]`', $prefix ) > 0 ) { + $prefix = preg_replace( '`([_\W])`', '[\\\\\\\\$1]', $prefixLC ); + $is_regex = true; + } + + $ns_prefixes[ $prefixLC ] = array( + 'prefix' => $prefix, + 'is_regex' => $is_regex, + ); + } + + // Set the validated prefixes caches. + $this->validated_prefixes = $prefixes; + $this->validated_namespace_prefixes = $ns_prefixes; + } + + /** + * Record the "potential prefix" metric. + * + * @since 1.0.1 + * + * @param int $stackPtr The position of the token to record the metric against. + * @param string $construct_name Name of the global construct to try and distill a potential prefix from. + * + * @return void + */ + private function record_potential_prefix_metric( $stackPtr, $construct_name ) { + if ( preg_match( '`^([A-Z]*[a-z0-9]*+)`', ltrim( $construct_name, '\$_' ), $matches ) > 0 + && isset( $matches[1] ) && '' !== $matches[1] + ) { + $this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: potential prefixes - start of non-prefixed construct', strtolower( $matches[1] ) ); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php new file mode 100644 index 00000000..a925de6f --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php @@ -0,0 +1,188 @@ +phpcsFile, $stackPtr ) === true ) { + /* + * Deprecated functions don't have to comply with the naming conventions, + * otherwise functions deprecated in favour of a function with a compliant + * name would still trigger an error. + */ + return; + } + + $name = FunctionDeclarations::getName( $this->phpcsFile, $stackPtr ); + if ( empty( $name ) === true ) { + // Live coding or parse error. + return; + } + + if ( '' === ltrim( $name, '_' ) ) { + // Ignore special functions, like __(). + return; + } + + $ooPtr = Scopes::validDirectScope( $this->phpcsFile, $stackPtr, Tokens::$ooScopeTokens ); + if ( false === $ooPtr ) { + $this->process_function_declaration( $stackPtr, $name ); + } else { + $this->process_method_declaration( $stackPtr, $name, $ooPtr ); + } + } + + /** + * Processes a function declaration for a function in the global namespace. + * + * @since 0.1.0 + * @since 3.0.0 Renamed from `processTokenOutsideScope()` to `process_function_declaration()`. + * Method signature has been changed as well as this method no longer overloads + * a method from the PEAR sniff which was previously the sniff parent. + * + * @param int $stackPtr The position where this token was found. + * @param string $functionName The name of the function. + * + * @return void + */ + protected function process_function_declaration( $stackPtr, $functionName ) { + // PHP magic functions are exempt from our rules. + if ( FunctionDeclarations::isMagicFunctionName( $functionName ) === true ) { + return; + } + + // Is the function name prefixed with "__" ? + if ( preg_match( '`^__[^_]`', $functionName ) === 1 ) { + $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; + $errorData = array( $functionName ); + $this->phpcsFile->addError( $error, $stackPtr, 'FunctionDoubleUnderscore', $errorData ); + } + + $suggested_name = SnakeCaseHelper::get_suggestion( $functionName ); + if ( $suggested_name !== $functionName ) { + $error = 'Function name "%s" is not in snake case format, try "%s"'; + $errorData = array( + $functionName, + $suggested_name, + ); + $this->phpcsFile->addError( $error, $stackPtr, 'FunctionNameInvalid', $errorData ); + } + } + + /** + * Processes a method declaration. + * + * @since 0.1.0 + * @since 3.0.0 Renamed from `processTokenWithinScope()` to `process_method_declaration()`. + * Method signature has been changed as well, as this method no longer overloads + * a method from the PEAR sniff which was previously the sniff parent. + * + * @param int $stackPtr The position where this token was found. + * @param string $methodName The name of the method. + * @param int $currScope The position of the current scope. + * + * @return void + */ + protected function process_method_declaration( $stackPtr, $methodName, $currScope ) { + + if ( \T_ANON_CLASS === $this->tokens[ $currScope ]['code'] ) { + $className = '[Anonymous Class]'; + } else { + $className = ObjectDeclarations::getName( $this->phpcsFile, $currScope ); + + // PHP4 constructors are allowed to break our rules. + if ( NamingConventions::isEqual( $methodName, $className ) === true ) { + return; + } + + // PHP4 destructors are allowed to break our rules. + if ( NamingConventions::isEqual( $methodName, '_' . $className ) === true ) { + return; + } + } + + // PHP magic methods are exempt from our rules. + if ( FunctionDeclarations::isMagicMethodName( $methodName ) === true ) { + return; + } + + $extended = ObjectDeclarations::findExtendedClassName( $this->phpcsFile, $currScope ); + $interfaces = ObjectDeclarations::findImplementedInterfaceNames( $this->phpcsFile, $currScope ); + + // If this is a child class or interface implementation, it may have to use camelCase or double underscores. + if ( ! empty( $extended ) || ! empty( $interfaces ) ) { + return; + } + + // Is the method name prefixed with "__" ? + if ( preg_match( '`^__[^_]`', $methodName ) === 1 ) { + $error = 'Method name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; + $errorData = array( $className . '::' . $methodName ); + $this->phpcsFile->addError( $error, $stackPtr, 'MethodDoubleUnderscore', $errorData ); + } + + // Check for all lowercase. + $suggested_name = SnakeCaseHelper::get_suggestion( $methodName ); + if ( $suggested_name !== $methodName ) { + $error = 'Method name "%s" in class %s is not in snake case format, try "%s"'; + $errorData = array( + $methodName, + $className, + $suggested_name, + ); + $this->phpcsFile->addError( $error, $stackPtr, 'MethodNameInvalid', $errorData ); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php new file mode 100644 index 00000000..57ce7046 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php @@ -0,0 +1,277 @@ + + * + * + * + * + * + * Provide several extra delimiters as one string: + * + * + * + * + * + * + * @var string + */ + public $additionalWordDelimiters = ''; + + /** + * Regular expression to test for correct punctuation of a hook name. + * + * The placeholder will be replaced by potentially provided additional + * word delimiters in the `prepare_regex()` method. + * + * @var string + */ + protected $punctuation_regex = '`[^\w%s]`'; + + /** + * Groups of functions to restrict. + * + * @since 0.11.0 + * + * @return array + */ + public function getGroups() { + // Only retrieve functions which are not used for deprecated hooks. + $this->target_functions = WPHookHelper::get_functions( false ); + + return parent::getGroups(); + } + + /** + * Process the parameters of a matched function. + * + * @since 0.11.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + + $hook_name_param = WPHookHelper::get_hook_name_param( $matched_content, $parameters ); + if ( false === $hook_name_param ) { + return; + } + + $regex = $this->prepare_regex(); + + $case_errors = 0; + $underscores = 0; + $content = array(); + $expected = array(); + $last_non_empty = null; + + for ( $i = $hook_name_param['start']; $i <= $hook_name_param['end']; $i++ ) { + // Skip past comment tokens. + if ( isset( Tokens::$commentTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + $content[ $i ] = $this->tokens[ $i ]['content']; + $expected[ $i ] = $this->tokens[ $i ]['content']; + + // Skip past potential variable array access: `$var['key']`. + if ( \T_VARIABLE === $this->tokens[ $i ]['code'] ) { + do { + $open_bracket = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); + if ( false === $open_bracket + || \T_OPEN_SQUARE_BRACKET !== $this->tokens[ $open_bracket ]['code'] + || ! isset( $this->tokens[ $open_bracket ]['bracket_closer'] ) + ) { + $last_non_empty = $i; + continue 2; + } + + $i = $this->tokens[ $open_bracket ]['bracket_closer']; + + } while ( isset( $this->tokens[ $i ] ) && $i <= $hook_name_param['end'] ); + + $last_non_empty = $i; + continue; + } + + // Skip over parameters passed to function calls. + if ( \T_OPEN_PARENTHESIS === $this->tokens[ $i ]['code'] + && ( \T_STRING === $this->tokens[ $last_non_empty ]['code'] + || \T_VARIABLE === $this->tokens[ $last_non_empty ]['code'] ) + && isset( $this->tokens[ $i ]['parenthesis_closer'] ) + ) { + $i = $this->tokens[ $i ]['parenthesis_closer']; + $last_non_empty = $i; + continue; + } + + // Skip past non text string tokens. + if ( isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) === false ) { + $last_non_empty = $i; + continue; + } + + $last_non_empty = $i; + $string = TextStrings::stripQuotes( $this->tokens[ $i ]['content'] ); + + /* + * Here be dragons - a double quoted string can contain extrapolated variables + * which don't have to comply with these rules. + */ + if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $i ]['code'] ) { + $transform = $this->transform_complex_string( $string, $regex ); + $case_transform = $this->transform_complex_string( $string, $regex, 'case' ); + $punct_transform = $this->transform_complex_string( $string, $regex, 'punctuation' ); + } else { + $transform = $this->transform( $string, $regex ); + $case_transform = $this->transform( $string, $regex, 'case' ); + $punct_transform = $this->transform( $string, $regex, 'punctuation' ); + } + + if ( $string === $transform ) { + continue; + } + + if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $i ]['code'] ) { + $expected[ $i ] = '"' . $transform . '"'; + } else { + $expected[ $i ] = '\'' . $transform . '\''; + } + + if ( $string !== $case_transform ) { + ++$case_errors; + } + if ( $string !== $punct_transform ) { + ++$underscores; + } + } + + $first_non_empty = $this->phpcsFile->findNext( + Tokens::$emptyTokens, + $hook_name_param['start'], + ( $hook_name_param['end'] + 1 ), + true + ); + + $data = array( + trim( implode( '', $expected ) ), + trim( implode( '', $content ) ), + ); + + if ( $case_errors > 0 ) { + $error = 'Hook names should be lowercase. Expected: %s, but found: %s.'; + $this->phpcsFile->addError( $error, $first_non_empty, 'NotLowercase', $data ); + } + + if ( $underscores > 0 ) { + $error = 'Words in hook names should be separated using underscores. Expected: %s, but found: %s.'; + $this->phpcsFile->addWarning( $error, $first_non_empty, 'UseUnderscores', $data ); + } + } + + /** + * Prepare the punctuation regular expression. + * + * Merges the existing regular expression with potentially provided extra word delimiters to allow. + * This is done 'late' and for each found token as otherwise inline `phpcs:set` directives + * would be ignored. + * + * @return string + */ + protected function prepare_regex() { + $extra = ''; + if ( '' !== $this->additionalWordDelimiters && \is_string( $this->additionalWordDelimiters ) ) { + $extra = preg_quote( $this->additionalWordDelimiters, '`' ); + } + + return sprintf( $this->punctuation_regex, $extra ); + } + + /** + * Transform an arbitrary string to lowercase and replace punctuation and spaces with underscores. + * + * @param string $text_string The target string. + * @param string $regex The punctuation regular expression to use. + * @param string $transform_type Whether to do a partial or complete transform. + * Valid values are: 'full', 'case', 'punctuation'. + * @return string + */ + protected function transform( $text_string, $regex, $transform_type = 'full' ) { + + switch ( $transform_type ) { + case 'case': + return strtolower( $text_string ); + + case 'punctuation': + return preg_replace( $regex, '_', $text_string ); + + case 'full': + default: + return preg_replace( $regex, '_', strtolower( $text_string ) ); + } + } + + /** + * Transform a complex string which may contain variable extrapolation. + * + * @param string $text_string The target string. + * @param string $regex The punctuation regular expression to use. + * @param string $transform_type Whether to do a partial or complete transform. + * Valid values are: 'full', 'case', 'punctuation'. + * @return string + */ + protected function transform_complex_string( $text_string, $regex, $transform_type = 'full' ) { + $plain_text = TextStrings::stripEmbeds( $text_string ); + $embeds = TextStrings::getEmbeds( $text_string ); + + $transformed_text = $this->transform( $plain_text, $regex, $transform_type ); + + // Inject the embeds back into the text string. + foreach ( $embeds as $offset => $embed ) { + $transformed_text = substr_replace( $transformed_text, $embed, $offset, 0 ); + } + + return $transformed_text; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php new file mode 100644 index 00000000..9b3d3db4 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php @@ -0,0 +1,230 @@ + Key is function name, value irrelevant. + */ + protected $target_functions = array( + 'register_post_type' => true, + ); + + /** + * Array of reserved post type names which can not be used by themes and plugins. + * + * Source: {@link https://developer.wordpress.org/reference/functions/register_post_type/#reserved-post-types} + * + * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} + * + * @since 2.2.0 + * + * @var array Key is reserved post type name, value irrelevant. + */ + protected $reserved_names = array( + 'action' => true, // Not a WP post type, but prevents other problems. + 'attachment' => true, + 'author' => true, // Not a WP post type, but prevents other problems. + 'custom_css' => true, + 'customize_changeset' => true, + 'nav_menu_item' => true, + 'oembed_cache' => true, + 'order' => true, // Not a WP post type, but prevents other problems. + 'page' => true, + 'post' => true, + 'revision' => true, + 'theme' => true, // Not a WP post type, but prevents other problems. + 'user_request' => true, + 'wp_block' => true, + 'wp_font_face' => true, + 'wp_font_family' => true, + 'wp_global_styles' => true, + 'wp_navigation' => true, + 'wp_template' => true, + 'wp_template_part' => true, + ); + + /** + * All valid tokens for in the first parameter of register_post_type(). + * + * Set in `register()`. + * + * @since 2.2.0 + * + * @var array + */ + private $valid_tokens = array(); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 2.2.0 + * + * @return array + */ + public function register() { + $this->valid_tokens = Tokens::$textStringTokens + Tokens::$heredocTokens + Tokens::$emptyTokens; + return parent::register(); + } + + /** + * Process the parameter of a matched function. + * + * Errors on invalid post type names when reserved keywords are used, + * the post type is too long, or contains invalid characters. + * + * @since 2.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + $post_type_param = PassedParameters::getParameterFromStack( $parameters, 1, 'post_type' ); + if ( false === $post_type_param || '' === $post_type_param['clean'] ) { + // Error for using empty slug. + $this->phpcsFile->addError( + 'register_post_type() called without a post type slug. The slug must be a non-empty string.', + false === $post_type_param ? $stackPtr : $post_type_param['start'], + 'Empty' + ); + return; + } + + $string_start = $this->phpcsFile->findNext( Collections::textStringStartTokens(), $post_type_param['start'], ( $post_type_param['end'] + 1 ) ); + $string_pos = $this->phpcsFile->findNext( Tokens::$textStringTokens, $post_type_param['start'], ( $post_type_param['end'] + 1 ) ); + + $has_invalid_tokens = $this->phpcsFile->findNext( $this->valid_tokens, $post_type_param['start'], ( $post_type_param['end'] + 1 ), true ); + if ( false !== $has_invalid_tokens || false === $string_pos ) { + // Check for non string based slug parameter (we cannot determine if this is valid). + $this->phpcsFile->addWarning( + 'The post type slug is not a string literal. It is not possible to automatically determine the validity of this slug. Found: %s.', + $stackPtr, + 'NotStringLiteral', + array( + $post_type_param['clean'], + ), + 3 + ); + return; + } + + $post_type = TextStrings::getCompleteTextString( $this->phpcsFile, $string_start ); + if ( isset( Tokens::$heredocTokens[ $this->tokens[ $string_start ]['code'] ] ) ) { + // Trim off potential indentation from PHP 7.3 flexible heredoc/nowdoc content. + $post_type = ltrim( $post_type ); + } + + $data = array( + $post_type, + ); + + // Warn for dynamic parts in the slug parameter. + if ( 'T_DOUBLE_QUOTED_STRING' === $this->tokens[ $string_pos ]['type'] + || ( 'T_HEREDOC' === $this->tokens[ $string_pos ]['type'] + && strpos( $this->tokens[ $string_pos ]['content'], '$' ) !== false ) + ) { + $this->phpcsFile->addWarning( + 'The post type slug may, or may not, get too long with dynamic contents and could contain invalid characters. Found: "%s".', + $string_pos, + 'PartiallyDynamic', + $data + ); + $post_type = TextStrings::stripEmbeds( $post_type ); + } + + if ( preg_match( self::VALID_POST_TYPE_CHARACTERS, $post_type ) === 0 ) { + // Error for invalid characters. + $this->phpcsFile->addError( + 'register_post_type() called with invalid post type "%s". Post type contains invalid characters. Only lowercase alphanumeric characters, dashes, and underscores are allowed.', + $string_pos, + 'InvalidCharacters', + $data + ); + } + + if ( isset( $this->reserved_names[ $post_type ] ) ) { + // Error for using reserved slug names. + $this->phpcsFile->addError( + 'register_post_type() called with reserved post type "%s". Reserved post types should not be used as they interfere with the functioning of WordPress itself.', + $string_pos, + 'Reserved', + $data + ); + } elseif ( stripos( $post_type, 'wp_' ) === 0 ) { + // Error for using reserved slug prefix. + $this->phpcsFile->addError( + 'The post type passed to register_post_type() uses a prefix reserved for WordPress itself. Found: "%s".', + $string_pos, + 'ReservedPrefix', + $data + ); + } + + // Error for slugs that are too long. + if ( strlen( $post_type ) > self::POST_TYPE_MAX_LENGTH ) { + $this->phpcsFile->addError( + 'A post type slug must not exceed %d characters. Found: "%s" (%d characters).', + $string_pos, + 'TooLong', + array( + self::POST_TYPE_MAX_LENGTH, + $post_type, + strlen( $post_type ), + ) + ); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php new file mode 100644 index 00000000..6202f2b5 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php @@ -0,0 +1,289 @@ + true, + 'GETID3_ERRORARRAY' => true, + 'is_IE' => true, + 'is_IIS' => true, + 'is_macIE' => true, + 'is_NS4' => true, + 'is_winIE' => true, + 'PHP_SELF' => true, + 'post_ID' => true, + 'tag_ID' => true, + 'user_ID' => true, + ); + + /** + * List of member variables that can have mixed case. + * + * @since 0.9.0 + * @since 0.11.0 Changed from public to protected. + * @since 3.0.0 Renamed from `$whitelisted_mixed_case_member_var_names` to `$allowed_mixed_case_member_var_names`. + * + * @var array + */ + protected $allowed_mixed_case_member_var_names = array( + 'cat_ID' => true, + 'comment_ID' => true, + 'comment_author_IP' => true, + 'comment_post_ID' => true, + 'ID' => true, + 'post_ID' => true, + ); + + /** + * Custom list of properties which can have mixed case. + * + * @since 0.11.0 + * @since 3.0.0 Renamed from `$customPropertiesWhitelist` to `$allowed_custom_properties`. + * + * @var string[] + */ + public $allowed_custom_properties = array(); + + /** + * Cache of previously added custom functions. + * + * Prevents having to do the same merges over and over again. + * + * @since 0.10.0 + * @since 0.11.0 - Name changed from $addedCustomVariables. + * - Changed the format from simple bool to array. + * + * @var array + */ + protected $addedCustomProperties = array( + 'properties' => null, + ); + + /** + * Processes this test, when one of its tokens is encountered. + * + * @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 + */ + protected function processVariable( File $phpcsFile, $stackPtr ) { + $tokens = $phpcsFile->getTokens(); + + // If it's a php reserved var, then its ok. + if ( Variables::isPHPReservedVarName( $tokens[ $stackPtr ]['content'] ) ) { + return; + } + + // Merge any custom variables with the defaults. + $this->merge_allow_lists(); + + $var_name = ltrim( $tokens[ $stackPtr ]['content'], '$' ); + + // Likewise if it is a mixed-case var used by WordPress core. + if ( isset( $this->wordpress_mixed_case_vars[ $var_name ] ) ) { + return; + } + + $obj_operator = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( \T_OBJECT_OPERATOR === $tokens[ $obj_operator ]['code'] + || \T_NULLSAFE_OBJECT_OPERATOR === $tokens[ $obj_operator ]['code'] + ) { + // Check to see if we are using a variable from an object. + $var = $phpcsFile->findNext( Tokens::$emptyTokens, ( $obj_operator + 1 ), null, true ); + if ( \T_STRING === $tokens[ $var ]['code'] ) { + $bracket = $phpcsFile->findNext( Tokens::$emptyTokens, ( $var + 1 ), null, true ); + if ( \T_OPEN_PARENTHESIS !== $tokens[ $bracket ]['code'] ) { + $obj_var_name = $tokens[ $var ]['content']; + + if ( isset( $this->allowed_mixed_case_member_var_names[ $obj_var_name ] ) ) { + return; + } + + $suggested_name = SnakeCaseHelper::get_suggestion( $obj_var_name ); + if ( $suggested_name !== $obj_var_name ) { + $error = 'Object property "$%s" is not in valid snake_case format, try "$%s"'; + $data = array( + $obj_var_name, + $suggested_name, + ); + $phpcsFile->addError( $error, $var, 'UsedPropertyNotSnakeCase', $data ); + } + } + } + } + + $in_class = false; + if ( ContextHelper::has_object_operator_before( $phpcsFile, $stackPtr ) === true ) { + // The variable lives within a class, and is referenced like + // this: MyClass::$_variable or $class->variable. + $in_class = true; + } + + $suggested_name = SnakeCaseHelper::get_suggestion( $var_name ); + if ( $suggested_name !== $var_name ) { + if ( $in_class && ! isset( $this->allowed_mixed_case_member_var_names[ $var_name ] ) ) { + $error = 'Object property "$%s" is not in valid snake_case format, try "$%s"'; + $error_name = 'UsedPropertyNotSnakeCase'; + } elseif ( ! $in_class ) { + $error = 'Variable "$%s" is not in valid snake_case format, try "$%s"'; + $error_name = 'VariableNotSnakeCase'; + } + + if ( isset( $error, $error_name ) ) { + $data = array( + $var_name, + $suggested_name, + ); + $phpcsFile->addError( $error, $stackPtr, $error_name, $data ); + } + } + } + + /** + * Processes class member variables. + * + * @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 + */ + protected function processMemberVar( File $phpcsFile, $stackPtr ) { + // Make sure this is actually an OO property and not an OO method parameter or illegal property declaration. + if ( Scopes::isOOProperty( $phpcsFile, $stackPtr ) === false ) { + return; + } + + // Merge any custom variables with the defaults. + $this->merge_allow_lists(); + + $tokens = $phpcsFile->getTokens(); + $var_name = ltrim( $tokens[ $stackPtr ]['content'], '$' ); + + if ( isset( $this->allowed_mixed_case_member_var_names[ $var_name ] ) ) { + return; + } + + $suggested_name = SnakeCaseHelper::get_suggestion( $var_name ); + if ( $suggested_name !== $var_name ) { + $error = 'Member variable "$%s" is not in valid snake_case format, try "$%s"'; + $data = array( + $var_name, + $suggested_name, + ); + $phpcsFile->addError( $error, $stackPtr, 'PropertyNotSnakeCase', $data ); + } + } + + /** + * Processes the variables found within a double quoted string. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the double quoted + * string. + * + * @return void + */ + protected function processVariableInString( File $phpcsFile, $stackPtr ) { + $tokens = $phpcsFile->getTokens(); + + // There will always be embeds if the processVariableInString() was called. + $embeds = TextStrings::getEmbeds( $tokens[ $stackPtr ]['content'] ); + + // Merge any custom variables with the defaults. + $this->merge_allow_lists(); + + foreach ( $embeds as $embed ) { + // Grab any variables contained in the embed. + if ( preg_match_all( '`\$(\{)?(?[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)(?(1)\})`', $embed, $matches ) === 0 ) { + continue; + } + + foreach ( $matches['name'] as $var_name ) { + // If it's a php reserved var, then its ok. + if ( Variables::isPHPReservedVarName( $var_name ) ) { + continue; + } + + // Likewise if it is a mixed-case var used by WordPress core. + if ( isset( $this->wordpress_mixed_case_vars[ $var_name ] ) ) { + continue; + } + + $suggested_name = SnakeCaseHelper::get_suggestion( $var_name ); + if ( $suggested_name !== $var_name ) { + $error = 'Variable "$%s" is not in valid snake_case format, try "$%s"'; + $data = array( + $var_name, + $suggested_name, + ); + $phpcsFile->addError( $error, $stackPtr, 'InterpolatedVariableNotSnakeCase', $data ); + } + } + } + } + + /** + * Merge a custom allow list provided via a custom ruleset with the predefined allow list, + * if we haven't already. + * + * @since 0.10.0 + * @since 2.0.0 Removed unused $phpcs_file parameter. + * @since 3.0.0 Renamed from `mergeWhiteList()` to `merge_allow_lists()`. + * + * @return void + */ + protected function merge_allow_lists() { + if ( $this->allowed_custom_properties !== $this->addedCustomProperties['properties'] ) { + // Fix property potentially passed as comma-delimited string. + $customProperties = RulesetPropertyHelper::merge_custom_array( $this->allowed_custom_properties, array(), false ); + + $this->allowed_mixed_case_member_var_names = RulesetPropertyHelper::merge_custom_array( + $customProperties, + $this->allowed_mixed_case_member_var_names + ); + + $this->addedCustomProperties['properties'] = $this->allowed_custom_properties; + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php new file mode 100644 index 00000000..af1c2ebf --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php @@ -0,0 +1,63 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + 'error_log' => array( + 'type' => 'warning', + 'message' => '%s() found. Debug code should not normally be used in production.', + 'functions' => array( + 'error_log', + 'var_dump', + 'var_export', + 'print_r', + 'trigger_error', + 'set_error_handler', + 'debug_backtrace', + 'debug_print_backtrace', + 'wp_debug_backtrace_summary', + ), + ), + + 'prevent_path_disclosure' => array( + 'type' => 'warning', + 'message' => '%s() can lead to full path disclosure.', + 'functions' => array( + 'error_reporting', + 'phpinfo', + ), + ), + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php new file mode 100644 index 00000000..058fa0d3 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php @@ -0,0 +1,100 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + 'serialize' => array( + 'type' => 'warning', + 'message' => '%s() found. Serialized data has known vulnerability problems with Object Injection. JSON is generally a better approach for serializing data. See https://www.owasp.org/index.php/PHP_Object_Injection', + 'functions' => array( + 'serialize', + 'unserialize', + ), + ), + + 'urlencode' => array( + 'type' => 'warning', + 'message' => '%s() should only be used when dealing with legacy applications rawurlencode() should now be used instead. See https://www.php.net/function.rawurlencode and http://www.faqs.org/rfcs/rfc3986.html', + 'functions' => array( + 'urlencode', + ), + ), + + 'runtime_configuration' => array( + 'type' => 'warning', + 'message' => '%s() found. Changing configuration values at runtime is strongly discouraged.', + 'functions' => array( + 'error_reporting', + 'ini_restore', + 'apache_setenv', + 'putenv', + 'set_include_path', + 'restore_include_path', + // This alias was DEPRECATED in PHP 5.3.0, and REMOVED as of PHP 7.0.0. + 'magic_quotes_runtime', + // Warning This function was DEPRECATED in PHP 5.3.0, and REMOVED as of PHP 7.0.0. + 'set_magic_quotes_runtime', + // Warning This function was removed from most SAPIs in PHP 5.3.0, and was removed from PHP-FPM in PHP 7.0.0. + 'dl', + ), + ), + + 'system_calls' => array( + 'type' => 'warning', + 'message' => '%s() found. PHP system calls are often disabled by server admins.', + 'functions' => array( + 'exec', + 'passthru', + 'proc_open', + 'shell_exec', + 'system', + 'popen', + ), + ), + + 'obfuscation' => array( + 'type' => 'warning', + 'message' => '%s() can be used to obfuscate code which is strongly discouraged. Please verify that the function is used for benign reasons.', + 'functions' => array( + 'base64_decode', + 'base64_encode', + 'convert_uudecode', + 'convert_uuencode', + 'str_rot13', + ), + ), + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php new file mode 100644 index 00000000..0d942527 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php @@ -0,0 +1,52 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + + 'extract' => array( + 'type' => 'error', + 'message' => '%s() usage is highly discouraged, due to the complexity and unintended issues it might cause.', + 'functions' => array( + 'extract', + ), + ), + + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php new file mode 100644 index 00000000..b393fbc1 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php @@ -0,0 +1,193 @@ + true, + 'ini_alter' => true, // Alias function name. + ); + + /** + * Array of PHP configuration options that are safe to be manipulated, as changing + * the value of these, won't cause interoperability issues between WP/plugins/themes. + * + * @since 2.1.0 + * @since 3.0.0 Renamed from `$whitelisted_options` to `$safe_options`. + * + * @var array Multidimensional array with parameter details. + * $safe_options = array( + * (string) option name. = array( + * (string[]) 'valid_values' = array() + * ) + * ); + */ + protected $safe_options = array( + 'auto_detect_line_endings' => array(), + 'highlight.bg' => array(), + 'highlight.comment' => array(), + 'highlight.default' => array(), + 'highlight.html' => array(), + 'highlight.keyword' => array(), + 'highlight.string' => array(), + 'short_open_tag' => array( + 'valid_values' => array( 'true', '1', 'on' ), + ), + ); + + /** + * Array of PHP configuration options that are not allowed to be manipulated, as changing + * the value of these, will be problematic for interoperability between WP/plugins/themes. + * + * @since 2.1.0 + * @since 3.0.0 Renamed from `$blacklisted_options` to `$disallowed_options`. + * + * @var array Multidimensional array with parameter details. + * $disallowed_options = array( + * (string) option name. = array( + * (string[]) 'invalid_values' = array() + * (string) 'message' + * ) + * ); + */ + protected $disallowed_options = array( + 'bcmath.scale' => array( + 'message' => 'Use `bcscale()` instead.', + ), + 'display_errors' => array( + 'message' => 'Use `WP_DEBUG_DISPLAY` instead.', + ), + 'error_reporting' => array( + 'message' => 'Use `WP_DEBUG` instead.', + ), + 'filter.default' => array( + 'message' => 'Changing the option value can break other plugins. Use the filter flag constants when calling the Filter functions instead.', + ), + 'filter.default_flags' => array( + 'message' => 'Changing the option value can break other plugins. Use the filter flag constants when calling the Filter functions instead.', + ), + 'iconv.input_encoding' => array( + 'message' => 'This option is not supported since PHP 5.6 - use `iconv_set_encoding()` instead.', + ), + 'iconv.internal_encoding' => array( + 'message' => 'This option is not supported since PHP 5.6 - use `iconv_set_encoding()` instead.', + ), + 'iconv.output_encoding' => array( + 'message' => 'This option is not supported since PHP 5.6 - use `iconv_set_encoding()` instead.', + ), + 'ignore_user_abort' => array( + 'message' => 'Use `ignore_user_abort()` instead.', + ), + 'log_errors' => array( + 'message' => 'Use `WP_DEBUG_LOG` instead.', + ), + 'max_execution_time' => array( + 'message' => 'Use `set_time_limit()` instead.', + ), + 'memory_limit' => array( + 'message' => 'Use `wp_raise_memory_limit()` or hook into the filters in that function.', + ), + 'short_open_tag' => array( + 'invalid_values' => array( 'false', '0', 'off' ), + 'message' => 'Turning off short_open_tag is prohibited as it can break other plugins.', + ), + ); + + /** + * Process the parameter of a matched function. + * + * Errors if an option is found in the disallow-list. Warns as + * 'risky' when the option is not found in the safe-list. + * + * @since 2.1.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + $option_param = PassedParameters::getParameterFromStack( $parameters, 1, 'option' ); + $value_param = PassedParameters::getParameterFromStack( $parameters, 2, 'value' ); + + if ( false === $option_param || false === $value_param ) { + // Missing required param. Not the concern of this sniff. Bow out. + return; + } + + $option_name = TextStrings::stripQuotes( $option_param['clean'] ); + $option_value = TextStrings::stripQuotes( $value_param['clean'] ); + if ( isset( $this->safe_options[ $option_name ] ) ) { + $safe_option = $this->safe_options[ $option_name ]; + if ( empty( $safe_option['valid_values'] ) || in_array( strtolower( $option_value ), $safe_option['valid_values'], true ) ) { + return; + } + } + + if ( isset( $this->disallowed_options[ $option_name ] ) ) { + $disallowed_option = $this->disallowed_options[ $option_name ]; + if ( empty( $disallowed_option['invalid_values'] ) + || in_array( strtolower( $option_value ), $disallowed_option['invalid_values'], true ) + ) { + $this->phpcsFile->addError( + 'Found: %s(%s, %s). %s', + $stackPtr, + MessageHelper::stringToErrorcode( $option_name . '_Disallowed' ), + array( + $matched_content, + $option_param['clean'], + $value_param['clean'], + $disallowed_option['message'], + ) + ); + return; + } + } + + $this->phpcsFile->addWarning( + 'Changing configuration values at runtime is strongly discouraged. Found: %s(%s, %s)', + $stackPtr, + 'Risky', + array( + $matched_content, + $option_param['clean'], + $value_param['clean'], + ) + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php new file mode 100644 index 00000000..4817f826 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php @@ -0,0 +1,245 @@ + Key is function name, value irrelevant. + */ + protected $allowedFunctionsList = array( + // Directory extension. + 'chdir' => true, + 'opendir' => true, + 'scandir' => true, + + // File extension. + 'file_exists' => true, + 'file_get_contents' => true, + 'file' => true, + 'fileatime' => true, + 'filectime' => true, + 'filegroup' => true, + 'fileinode' => true, + 'filemtime' => true, + 'fileowner' => true, + 'fileperms' => true, + 'filesize' => true, + 'filetype' => true, + 'fopen' => true, + 'is_dir' => true, + 'is_executable' => true, + 'is_file' => true, + 'is_link' => true, + 'is_readable' => true, + 'is_writable' => true, + 'is_writeable' => true, + 'lstat' => true, + 'mkdir' => true, + 'move_uploaded_file' => true, + 'readfile' => true, + 'readlink' => true, + 'rename' => true, + 'rmdir' => true, + 'stat' => true, + 'unlink' => true, + + // FTP extension. + 'ftp_chdir' => true, + 'ftp_login' => true, + 'ftp_rename' => true, + + // Stream extension. + 'stream_select' => true, + 'stream_set_chunk_size' => true, + + // Zlib extension. + 'deflate_add' => true, + 'deflate_init' => true, + 'inflate_add' => true, + 'inflate_init' => true, + 'readgzfile' => true, + + // LibXML extension. + 'libxml_disable_entity_loader' => true, // PHP 8.0 deprecation warning, but function call still needed in select cases. + + // Miscellaneous other functions. + 'imagecreatefromstring' => true, + 'imagecreatefromwebp' => true, + 'parse_url' => true, // Pre-PHP 5.3.3 an E_WARNING was thrown when URL parsing failed. + 'unserialize' => true, + ); + + /** + * Tokens which are regarded as empty for the purpose of determining + * the name of the called function. + * + * This property is set from within the register() method. + * + * @since 1.1.0 + * + * @var array + */ + private $empty_tokens = array(); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.1.0 + * + * @return array + */ + public function register() { + $this->empty_tokens = Tokens::$emptyTokens; + $this->empty_tokens[ \T_NS_SEPARATOR ] = \T_NS_SEPARATOR; + $this->empty_tokens[ \T_BITWISE_AND ] = \T_BITWISE_AND; + + return array( + \T_ASPERAND, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.1.0 + * + * @param int $stackPtr The position of the current token in the stack. + */ + public function process_token( $stackPtr ) { + // Handle the user-defined custom function list. + $this->customAllowedFunctionsList = RulesetPropertyHelper::merge_custom_array( $this->customAllowedFunctionsList, array(), false ); + $this->customAllowedFunctionsList = array_map( 'strtolower', $this->customAllowedFunctionsList ); + + /* + * Check if the error silencing is done for one of the allowed functions. + * + * @internal The function call name determination is done even when there is no allow list active + * to allow the metrics to be more informative. + */ + $next_non_empty = $this->phpcsFile->findNext( $this->empty_tokens, ( $stackPtr + 1 ), null, true, null, true ); + if ( false !== $next_non_empty && \T_STRING === $this->tokens[ $next_non_empty ]['code'] ) { + $has_parenthesis = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $next_non_empty + 1 ), null, true, null, true ); + if ( false !== $has_parenthesis && \T_OPEN_PARENTHESIS === $this->tokens[ $has_parenthesis ]['code'] ) { + $function_name = strtolower( $this->tokens[ $next_non_empty ]['content'] ); + if ( ( true === $this->usePHPFunctionsList + && isset( $this->allowedFunctionsList[ $function_name ] ) === true ) + || ( ! empty( $this->customAllowedFunctionsList ) + && in_array( $function_name, $this->customAllowedFunctionsList, true ) === true ) + ) { + $this->phpcsFile->recordMetric( $stackPtr, 'Error silencing', 'silencing allowed function call: ' . $function_name ); + return; + } + } + } + + $this->context_length = (int) $this->context_length; + $context_length = $this->context_length; + if ( $this->context_length <= 0 ) { + $context_length = 2; + } + + // Prepare the "Found" string to display. + $end_of_statement = BCFile::findEndOfStatement( $this->phpcsFile, $stackPtr, \T_COMMA ); + if ( ( $end_of_statement - $stackPtr ) < $context_length ) { + $context_length = ( $end_of_statement - $stackPtr ); + } + + $found = GetTokensAsString::compact( $this->phpcsFile, $stackPtr, ( $stackPtr + $context_length - 1 ), true ) . '...'; + $error_msg = 'Silencing errors is strongly discouraged. Use proper error checking instead.'; + $data = array(); + if ( $this->context_length > 0 ) { + $error_msg .= ' Found: %s'; + $data[] = $found; + } + + $this->phpcsFile->addWarning( + $error_msg, + $stackPtr, + 'Discouraged', + $data + ); + + if ( isset( $function_name ) ) { + $this->phpcsFile->recordMetric( $stackPtr, 'Error silencing', '@' . $function_name ); + } else { + $this->phpcsFile->recordMetric( $stackPtr, 'Error silencing', $found ); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php new file mode 100644 index 00000000..72f77ad5 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php @@ -0,0 +1,73 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + 'ereg' => array( + 'type' => 'error', + 'message' => '%s() has been deprecated since PHP 5.3 and removed in PHP 7.0, please use preg_match() instead.', + 'functions' => array( + 'ereg', + 'eregi', + 'sql_regcase', + ), + ), + + 'ereg_replace' => array( + 'type' => 'error', + 'message' => '%s() has been deprecated since PHP 5.3 and removed in PHP 7.0, please use preg_replace() instead.', + 'functions' => array( + 'ereg_replace', + 'eregi_replace', + ), + ), + + 'split' => array( + 'type' => 'error', + 'message' => '%s() has been deprecated since PHP 5.3 and removed in PHP 7.0, please use explode(), str_split() or preg_split() instead.', + 'functions' => array( + 'split', + 'spliti', + ), + ), + + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php new file mode 100644 index 00000000..3a1ab1ea --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php @@ -0,0 +1,70 @@ + Key is function name, value irrelevant. + */ + protected $target_functions = array( + 'preg_quote' => true, + ); + + /** + * Process the parameters of a matched function. + * + * @since 1.0.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + + $delimiter = PassedParameters::getParameterFromStack( $parameters, 2, 'delimiter' ); + if ( false !== $delimiter ) { + return; + } + + $this->phpcsFile->addWarning( + 'Passing the $delimiter parameter to preg_quote() is strongly recommended.', + $stackPtr, + 'Missing' + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php new file mode 100644 index 00000000..f3102e33 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php @@ -0,0 +1,45 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + 'create_function' => array( + 'type' => 'error', + 'message' => '%s() is deprecated as of PHP 7.2 and removed in PHP 8.0. Please use declared named or anonymous functions instead.', + 'functions' => array( + 'create_function', + ), + ), + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php new file mode 100644 index 00000000..dc7aa7aa --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php @@ -0,0 +1,122 @@ + Key is the function name. + */ + protected $target_functions = array( + 'in_array' => array( + 'param_position' => 3, + 'param_name' => 'strict', + 'always_needed' => true, + ), + 'array_search' => array( + 'param_position' => 3, + 'param_name' => 'strict', + 'always_needed' => true, + ), + 'array_keys' => array( + 'param_position' => 3, + 'param_name' => 'strict', + 'always_needed' => false, + ), + ); + + /** + * Process the parameters of a matched function. + * + * @since 0.11.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + $param_info = $this->target_functions[ $matched_content ]; + + /* + * Check if the strict check is actually needed. + * + * Important! This check only applies to array_keys() in the current form of the sniff + * and has been written to be specific to that function. + * If more functions would be added with 'always_needed' set to `false`, + * this code will need to be adjusted to handle those. + */ + if ( false === $param_info['always_needed'] ) { + $has_filter_value = PassedParameters::getParameterFromStack( $parameters, 2, 'filter_value' ); + if ( false === $has_filter_value ) { + return; + } + } + + $found_parameter = PassedParameters::getParameterFromStack( $parameters, $param_info['param_position'], $param_info['param_name'] ); + if ( false === $found_parameter || 'true' !== strtolower( $found_parameter['clean'] ) ) { + $errorcode = 'MissingTrueStrict'; + + /* + * Use a different error code when `false` is found to allow for excluding + * the warning as this will be a conscious choice made by the dev. + */ + if ( is_array( $found_parameter ) && 'false' === strtolower( $found_parameter['clean'] ) ) { + $errorcode = 'FoundNonStrictFalse'; + } + + $this->phpcsFile->addWarning( + 'Not using strict comparison for %s; supply true for $%s argument.', + ( isset( $found_parameter['start'] ) ? $found_parameter['start'] : $stackPtr ), + $errorcode, + array( $matched_content, $param_info['param_name'] ) + ); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php new file mode 100644 index 00000000..3e07c7fb --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php @@ -0,0 +1,90 @@ +tokens[ $stackPtr ]['code']; + $typecast = str_replace( ' ', '', $this->tokens[ $stackPtr ]['content'] ); + $typecast_lc = strtolower( $typecast ); + + switch ( $token_code ) { + case \T_DOUBLE_CAST: + if ( '(float)' !== $typecast_lc ) { + $fix = $this->phpcsFile->addFixableError( + 'Normalized type keywords must be used; expected "(float)" but found "%s"', + $stackPtr, + 'DoubleRealFound', + array( $typecast ) + ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->replaceToken( $stackPtr, '(float)' ); + } + } + break; + + case \T_UNSET_CAST: + $this->phpcsFile->addError( + 'Using the "(unset)" cast is forbidden as the type cast is removed in PHP 8.0. Use the "unset()" language construct instead.', + $stackPtr, + 'UnsetFound' + ); + break; + + case \T_BINARY_CAST: + $this->phpcsFile->addWarning( + 'Using binary casting is strongly discouraged. Found: "%s"', + $stackPtr, + 'BinaryFound', + array( $typecast ) + ); + break; + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php new file mode 100644 index 00000000..150993c6 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php @@ -0,0 +1,124 @@ +condition_start_tokens = $starters; + + return array( + \T_IS_EQUAL, + \T_IS_NOT_EQUAL, + \T_IS_IDENTICAL, + \T_IS_NOT_IDENTICAL, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function process_token( $stackPtr ) { + + $start = $this->phpcsFile->findPrevious( $this->condition_start_tokens, $stackPtr, null, false, null, true ); + + $needs_yoda = false; + + // Note: going backwards! + for ( $i = $stackPtr; $i > $start; $i-- ) { + + // Ignore whitespace. + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + // If this is a variable or array assignment, we've seen all we need to see. + if ( \T_VARIABLE === $this->tokens[ $i ]['code'] + || \T_CLOSE_SQUARE_BRACKET === $this->tokens[ $i ]['code'] + ) { + $needs_yoda = true; + break; + } + + // If this is a function call or something, we are OK. + if ( \T_CLOSE_PARENTHESIS === $this->tokens[ $i ]['code'] ) { + return; + } + } + + if ( ! $needs_yoda ) { + return; + } + + // Check if this is a var to var comparison, e.g.: if ( $var1 == $var2 ). + $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + + if ( isset( Tokens::$castTokens[ $this->tokens[ $next_non_empty ]['code'] ] ) ) { + $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $next_non_empty + 1 ), null, true ); + } + + if ( isset( Collections::ooHierarchyKeywords()[ $this->tokens[ $next_non_empty ]['code'] ] ) === true ) { + $next_non_empty = $this->phpcsFile->findNext( + ( Tokens::$emptyTokens + array( \T_DOUBLE_COLON => \T_DOUBLE_COLON ) ), + ( $next_non_empty + 1 ), + null, + true + ); + } + + if ( \T_VARIABLE === $this->tokens[ $next_non_empty ]['code'] ) { + return; + } + + $this->phpcsFile->addError( 'Use Yoda Condition checks, you must.', $stackPtr, 'NotYoda' ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php new file mode 100644 index 00000000..92c1b2ef --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php @@ -0,0 +1,903 @@ + + */ + protected $unsafePrintingFunctions = array( + '_e' => array( + 'alternative' => 'esc_html_e() or esc_attr_e()', + 'params' => array( + 1 => 'text', + ), + ), + '_ex' => array( + 'alternative' => 'echo esc_html_x() or echo esc_attr_x()', + 'params' => array( + 1 => 'text', + ), + ), + ); + + /** + * List of names of the native PHP constants which can be considered safe. + * + * @since 1.0.0 + * + * @var array + */ + private $safe_php_constants = array( + 'PHP_EOL' => true, // String. + 'PHP_VERSION' => true, // Integer. + 'PHP_MAJOR_VERSION' => true, // Integer. + 'PHP_MINOR_VERSION' => true, // Integer. + 'PHP_RELEASE_VERSION' => true, // Integer. + 'PHP_VERSION_ID' => true, // Integer. + 'PHP_EXTRA_VERSION' => true, // String. + 'PHP_DEBUG' => true, // Integer. + ); + + /** + * List of tokens which can be considered as safe when directly part of the output. + * + * This list is enhanced with additional tokens in the `register()` method. + * + * @since 0.12.0 + * + * @var array + */ + private $safe_components = array( + \T_LNUMBER => \T_LNUMBER, + \T_DNUMBER => \T_DNUMBER, + \T_TRUE => \T_TRUE, + \T_FALSE => \T_FALSE, + \T_NULL => \T_NULL, + \T_CONSTANT_ENCAPSED_STRING => \T_CONSTANT_ENCAPSED_STRING, + \T_START_NOWDOC => \T_START_NOWDOC, + \T_NOWDOC => \T_NOWDOC, + \T_END_NOWDOC => \T_END_NOWDOC, + \T_BOOLEAN_NOT => \T_BOOLEAN_NOT, + ); + + /** + * List of keyword tokens this sniff listens for, which can also be used as an inline expression. + * + * @since 3.0.0 + * + * @var array + */ + private $target_keywords = array( + \T_EXIT => \T_EXIT, + \T_PRINT => \T_PRINT, + \T_THROW => \T_THROW, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return string|int[] + */ + public function register() { + // Enrich the list of "safe components" tokens. + $this->safe_components += Tokens::$comparisonTokens; + $this->safe_components += Tokens::$operators; + $this->safe_components += Tokens::$booleanOperators; + $this->safe_components += Collections::incrementDecrementOperators(); + + // Set up the tokens the sniff should listen to. + $targets = array_merge( parent::register(), $this->target_keywords ); + $targets[] = \T_ECHO; + $targets[] = \T_OPEN_TAG_WITH_ECHO; + + return $targets; + } + + /** + * Groups of functions this sniff is looking for. + * + * @since 3.0.0 + * + * @return array + */ + public function getGroups() { + // Make sure all array keys are lowercase (could contain user-provided function names). + $printing_functions = array_change_key_case( $this->get_printing_functions(), \CASE_LOWER ); + + // Remove the unsafe printing functions to prevent duplicate notices. + $printing_functions = array_diff_key( $printing_functions, $this->unsafePrintingFunctions ); + + return array( + 'unsafe_printing_functions' => array( + 'functions' => array_keys( $this->unsafePrintingFunctions ), + ), + 'printing_functions' => array( + 'functions' => array_keys( $printing_functions ), + ), + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 3.0.0 This method has been split up. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + $start = ( $stackPtr + 1 ); + $end = $start; + + switch ( $this->tokens[ $stackPtr ]['code'] ) { + case \T_STRING: + // Prevent exclusion of any of the function groups. + $this->exclude = array(); + + // In the tests, custom printing functions may be added/removed on the fly. + if ( defined( 'PHP_CODESNIFFER_IN_TESTS' ) ) { + $this->setup_groups( 'functions' ); + } + + // Let the abstract parent class handle the initial function call check. + return parent::process_token( $stackPtr ); + + case \T_EXIT: + $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( false === $next_non_empty + || \T_OPEN_PARENTHESIS !== $this->tokens[ $next_non_empty ]['code'] + || isset( $this->tokens[ $next_non_empty ]['parenthesis_closer'] ) === false + ) { + // Live coding/parse error or an exit/die which doesn't pass a status code. Ignore. + return; + } + + // $end is not examined, so make sure the parentheses are balanced. + $start = $next_non_empty; + $end = ( $this->tokens[ $next_non_empty ]['parenthesis_closer'] + 1 ); + break; + + case \T_THROW: + // Find the open parentheses, while stepping over the exception creation tokens. + $ignore = Tokens::$emptyTokens; + $ignore += Collections::namespacedNameTokens(); + $ignore += Collections::functionCallTokens(); + $ignore += Collections::objectOperators(); + + $next_relevant = $this->phpcsFile->findNext( $ignore, ( $stackPtr + 1 ), null, true ); + if ( false === $next_relevant ) { + return; + } + + if ( \T_NEW === $this->tokens[ $next_relevant ]['code'] ) { + $next_relevant = $this->phpcsFile->findNext( $ignore, ( $next_relevant + 1 ), null, true ); + if ( false === $next_relevant ) { + return; + } + } + + if ( \T_OPEN_PARENTHESIS !== $this->tokens[ $next_relevant ]['code'] + || isset( $this->tokens[ $next_relevant ]['parenthesis_closer'] ) === false + ) { + // Live coding/parse error or a pre-created exception. Nothing to do for us. + return; + } + + $end = $this->tokens[ $next_relevant ]['parenthesis_closer']; + + // Check if the throw is within a `try-catch`. + // Doing this here (instead of earlier) to allow skipping to the end of the statement. + $search_for = Collections::closedScopes(); + $search_for[ \T_TRY ] = \T_TRY; + + $last_condition = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, $search_for ); + if ( false !== $last_condition && \T_TRY === $this->tokens[ $last_condition ]['code'] ) { + // This exception will (probably) be caught, so ignore it. + return $end; + } + + $call_token = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $next_relevant - 1 ), null, true ); + $params = PassedParameters::getParameters( $this->phpcsFile, $call_token ); + if ( empty( $params ) ) { + // No parameters passed, nothing to do. + return $end; + } + + // Examine each parameter individually. + foreach ( $params as $param ) { + $this->check_code_is_escaped( $param['start'], ( $param['end'] + 1 ), 'ExceptionNotEscaped' ); + } + + return $end; + + case \T_PRINT: + $end = BCFile::findEndOfStatement( $this->phpcsFile, $stackPtr ); + if ( \T_COMMA !== $this->tokens[ $end ]['code'] + && \T_SEMICOLON !== $this->tokens[ $end ]['code'] + && \T_COLON !== $this->tokens[ $end ]['code'] + && \T_DOUBLE_ARROW !== $this->tokens[ $end ]['code'] + && isset( $this->tokens[ ( $end + 1 ) ] ) + ) { + /* + * FindEndOfStatement includes a comma/(semi-)colon/double arrow if that's the end of + * the statement, but for everything else, it returns the last non-empty token _before_ + * the end, which would mean the last non-empty token in the statement would not + * be examined. Let's fix that. + */ + ++$end; + } + + // Note: no need to check for close tag as close tag will have the token before the tag as the $end. + if ( $end >= ( $this->phpcsFile->numTokens - 1 ) ) { + $last_non_empty = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, $end, null, true ); + if ( \T_SEMICOLON !== $this->tokens[ $last_non_empty ]['code'] ) { + // Live coding/parse error at end of file. Ignore. + return; + } + } + + // Special case for a print statement *within* a ternary, where we need to find the "inline else" as the end token. + $prev_non_empty = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); + if ( \T_INLINE_THEN === $this->tokens[ $prev_non_empty ]['code'] ) { + $target_nesting_level = 0; + if ( empty( $this->tokens[ $stackPtr ]['nested_parenthesis'] ) === false ) { + $target_nesting_level = \count( $this->tokens[ $stackPtr ]['nested_parenthesis'] ); + } + + $inline_else = false; + for ( $i = ( $stackPtr + 1 ); $i < $end; $i++ ) { + if ( \T_INLINE_ELSE !== $this->tokens[ $i ]['code'] ) { + continue; + } + + if ( empty( $this->tokens[ $i ]['nested_parenthesis'] ) + && 0 === $target_nesting_level + ) { + $inline_else = $i; + break; + } + + if ( empty( $this->tokens[ $i ]['nested_parenthesis'] ) === false + && \count( $this->tokens[ $i ]['nested_parenthesis'] ) === $target_nesting_level + ) { + $inline_else = $i; + break; + } + } + + if ( false === $inline_else ) { + // Live coding/parse error. Bow out. + return; + } + + $end = $inline_else; + } + + break; + + // Echo, open tag with echo. + default: + $end = $this->phpcsFile->findNext( array( \T_SEMICOLON, \T_CLOSE_TAG ), $stackPtr ); + if ( false === $end ) { + // Live coding/parse error. Bow out. + return; + } + + break; + } + + return $this->check_code_is_escaped( $start, $end ); + } + + /** + * Process a matched function call token. + * + * @since 3.0.0 Split off from the process_token() method. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_matched_token( $stackPtr, $group_name, $matched_content ) { + // Make sure we only deal with actual function calls, not function import use statements. + $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( false === $next_non_empty + || \T_OPEN_PARENTHESIS !== $this->tokens[ $next_non_empty ]['code'] + || isset( $this->tokens[ $next_non_empty ]['parenthesis_closer'] ) === false + ) { + // Live coding, parse error or not a function _call_. + return; + } + + $end = $this->tokens[ $next_non_empty ]['parenthesis_closer']; + + if ( 'unsafe_printing_functions' === $group_name ) { + $error = $this->phpcsFile->addError( + "All output should be run through an escaping function (like %s), found '%s'.", + $stackPtr, + 'UnsafePrintingFunction', + array( $this->unsafePrintingFunctions[ $matched_content ]['alternative'], $matched_content ) + ); + + // If the error was reported, don't bother checking the function's arguments. + if ( $error || empty( $this->unsafePrintingFunctions[ $matched_content ]['params'] ) ) { + return $end; + } + + // If the function was not reported for being unsafe, examine the relevant parameters. + $params = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); + foreach ( $this->unsafePrintingFunctions[ $matched_content ]['params'] as $position => $name ) { + $param = PassedParameters::getParameterFromStack( $params, $position, $name ); + if ( false === $param ) { + // Parameter doesn't exist. Nothing to do. + continue; + } + + $this->check_code_is_escaped( $param['start'], ( $param['end'] + 1 ) ); + } + + return $end; + } + + $params = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); + + /* + * These functions only need to have their first argument - `$message` - escaped. + * Note: user_error() is an alias for trigger_error(), so the param names are the same. + */ + if ( 'trigger_error' === $matched_content || 'user_error' === $matched_content ) { + $message_param = PassedParameters::getParameterFromStack( $params, 1, 'message' ); + if ( false === $message_param ) { + // Message parameter doesn't exist. Nothing to do. + return $end; + } + + return $this->check_code_is_escaped( $message_param['start'], ( $message_param['end'] + 1 ) ); + } + + /* + * If the first param to `_deprecated_file()` - `$file` - follows the typical `basename( __FILE__ )` + * pattern, it doesn't need to be escaped. + */ + if ( '_deprecated_file' === $matched_content ) { + $file_param = PassedParameters::getParameterFromStack( $params, 1, 'file' ); + + if ( false !== $file_param ) { + // Check for a particular code pattern which can safely be ignored. + if ( preg_match( '`^[\\\\]?basename\s*\(\s*__FILE__\s*\)$`', $file_param['clean'] ) === 1 ) { + unset( $params[1], $params['file'] ); // Remove the param, whether passed positionally or named. + } + } + unset( $file_param ); + } + + // Examine each parameter individually. + foreach ( $params as $param ) { + $this->check_code_is_escaped( $param['start'], ( $param['end'] + 1 ) ); + } + + return $end; + } + + /** + * Check whether each relevant part of an arbitrary group of token is output escaped. + * + * @since 3.0.0 Split off from the process_token() method. + * + * @param int $start The position to start checking from. + * @param int $end The position to stop the check at. + * @param string $code Code to use for the PHPCS error. + * + * @return int Integer stack pointer to skip forward. + */ + protected function check_code_is_escaped( $start, $end, $code = 'OutputNotEscaped' ) { + /* + * Check for a ternary operator. + * We only need to do this here if this statement is lacking parenthesis. + * Otherwise it will be handled in the below loop. + */ + $ternary = false; + $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $start + 1 ), null, true ); + $last_non_empty = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $end - 1 ), null, true ); + + if ( \T_OPEN_PARENTHESIS !== $this->tokens[ $next_non_empty ]['code'] + || \T_CLOSE_PARENTHESIS !== $this->tokens[ $last_non_empty ]['code'] + || ( \T_OPEN_PARENTHESIS === $this->tokens[ $next_non_empty ]['code'] + && \T_CLOSE_PARENTHESIS === $this->tokens[ $last_non_empty ]['code'] + && isset( $this->tokens[ $next_non_empty ]['parenthesis_closer'] ) + && $this->tokens[ $next_non_empty ]['parenthesis_closer'] !== $last_non_empty + ) + ) { + // If there is a (long) ternary, skip over the part before the ?. + $ternary = $this->find_long_ternary( $start, $end ); + if ( false !== $ternary ) { + $start = ( $ternary + 1 ); + } + } + + $in_cast = false; + $watch = true; + + // Looping through echo'd components. + for ( $i = $start; $i < $end; $i++ ) { + // Ignore whitespaces and comments. + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + // Skip over irrelevant tokens. + if ( isset( Tokens::$magicConstants[ $this->tokens[ $i ]['code'] ] ) // Magic constants for debug functions. + || \T_NS_SEPARATOR === $this->tokens[ $i ]['code'] + || \T_DOUBLE_ARROW === $this->tokens[ $i ]['code'] + || \T_CLOSE_PARENTHESIS === $this->tokens[ $i ]['code'] + ) { + continue; + } + + if ( \T_OPEN_PARENTHESIS === $this->tokens[ $i ]['code'] ) { + if ( ! isset( $this->tokens[ $i ]['parenthesis_closer'] ) ) { + // Live coding or parse error. + break; + } + + if ( $in_cast ) { + // Skip to the end of a function call if it has been cast to a safe value. + $i = $this->tokens[ $i ]['parenthesis_closer']; + $in_cast = false; + + } else { + // Skip over the condition part of a (long) ternary (i.e., to after the ?). + $ternary = $this->find_long_ternary( ( $i + 1 ), $this->tokens[ $i ]['parenthesis_closer'] ); + if ( false !== $ternary ) { + $i = $ternary; + } + } + + continue; + } + + /* + * If a keyword is encountered in an inline expression and the keyword is one + * this sniff listens to, recurse into the sniff, handle the expression + * based on the keyword and skip over the code examined. + */ + if ( isset( $this->target_keywords[ $this->tokens[ $i ]['code'] ] ) ) { + $return_value = $this->process_token( $i ); + if ( isset( $return_value ) ) { + $i = $return_value; + } + continue; + } + + // Handle PHP 8.0+ match expressions. + if ( \T_MATCH === $this->tokens[ $i ]['code'] ) { + $match_valid = $this->walk_match_expression( $i, $code ); + if ( false === $match_valid ) { + // Live coding or parse error. Shouldn't be possible as PHP[CS] will tokenize the keyword as `T_STRING` in that case. + break; // @codeCoverageIgnore + } + + $i = $match_valid; + continue; + } + + // Examine the items in an array individually for array parameters. + if ( isset( Collections::arrayOpenTokensBC()[ $this->tokens[ $i ]['code'] ] ) ) { + $array_open_close = Arrays::getOpenClose( $this->phpcsFile, $i ); + if ( false === $array_open_close ) { + // Short list or misidentified short array token. + continue; + } + + $array_items = PassedParameters::getParameters( $this->phpcsFile, $i, 0, true ); + if ( ! empty( $array_items ) ) { + foreach ( $array_items as $array_item ) { + $this->check_code_is_escaped( $array_item['start'], ( $array_item['end'] + 1 ), $code ); + } + } + + $i = $array_open_close['closer']; + continue; + } + + // Ignore safe PHP native constants. + if ( \T_STRING === $this->tokens[ $i ]['code'] + && isset( $this->safe_php_constants[ $this->tokens[ $i ]['content'] ] ) + && ConstantsHelper::is_use_of_global_constant( $this->phpcsFile, $i ) + ) { + continue; + } + + // Wake up on concatenation characters, another part to check. + if ( \T_STRING_CONCAT === $this->tokens[ $i ]['code'] ) { + $watch = true; + continue; + } + + // Wake up after a ternary else (:). + if ( false !== $ternary && \T_INLINE_ELSE === $this->tokens[ $i ]['code'] ) { + $watch = true; + continue; + } + + // Wake up for commas. + if ( \T_COMMA === $this->tokens[ $i ]['code'] ) { + $in_cast = false; + $watch = true; + continue; + } + + if ( false === $watch ) { + continue; + } + + // Allow T_CONSTANT_ENCAPSED_STRING eg: echo 'Some String'; + // Also T_LNUMBER, e.g.: echo 45; exit -1; and booleans. + if ( isset( $this->safe_components[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + // Check for use of *::class. + if ( \T_STRING === $this->tokens[ $i ]['code'] + || \T_VARIABLE === $this->tokens[ $i ]['code'] + || isset( Collections::ooHierarchyKeywords()[ $this->tokens[ $i ]['code'] ] ) + ) { + $double_colon = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), $end, true ); + if ( false !== $double_colon + && \T_DOUBLE_COLON === $this->tokens[ $double_colon ]['code'] + ) { + $class_keyword = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $double_colon + 1 ), $end, true ); + if ( false !== $class_keyword + && \T_STRING === $this->tokens[ $class_keyword ]['code'] + && 'class' === strtolower( $this->tokens[ $class_keyword ]['content'] ) + ) { + $i = $class_keyword; + continue; + } + } + } + + $watch = false; + + // Allow int/double/bool casted variables. + if ( isset( ContextHelper::get_safe_cast_tokens()[ $this->tokens[ $i ]['code'] ] ) ) { + /* + * If the next thing is a match expression, skip over it as whatever is + * being returned will be safely cast. + * Do not set `$in_cast` to `true`. + */ + $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), $end, true ); + if ( false !== $next_non_empty + && \T_MATCH === $this->tokens[ $next_non_empty ]['code'] + && isset( $this->tokens[ $next_non_empty ]['scope_closer'] ) + ) { + $i = $this->tokens[ $next_non_empty ]['scope_closer']; + continue; + } + + $in_cast = true; + continue; + } + + // Handle heredocs separately as they only need escaping when interpolation is used. + if ( \T_START_HEREDOC === $this->tokens[ $i ]['code'] ) { + $current = ( $i + 1 ); + while ( isset( $this->tokens[ $current ] ) && \T_HEREDOC === $this->tokens[ $current ]['code'] ) { + $embeds = TextStrings::getEmbeds( $this->tokens[ $current ]['content'] ); + if ( ! empty( $embeds ) ) { + $this->phpcsFile->addError( + 'All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found interpolation in unescaped heredoc.', + $current, + 'HeredocOutputNotEscaped' + ); + } + ++$current; + } + + $i = $current; + continue; + } + + // Now check that the next token is a function call. + if ( \T_STRING === $this->tokens[ $i ]['code'] ) { + $ptr = $i; + $functionName = $this->tokens[ $i ]['content']; + $function_opener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); + $is_formatting_function = FormattingFunctionsHelper::is_formatting_function( $functionName ); + + if ( false !== $function_opener + && \T_OPEN_PARENTHESIS === $this->tokens[ $function_opener ]['code'] + ) { + if ( ArrayWalkingFunctionsHelper::is_array_walking_function( $functionName ) ) { + // Get the callback parameter. + $callback = ArrayWalkingFunctionsHelper::get_callback_parameter( $this->phpcsFile, $ptr ); + + if ( ! empty( $callback ) ) { + /* + * If this is a function callback (not a method callback array) and we're able + * to resolve the function name, do so. + */ + $mapped_function = $this->phpcsFile->findNext( + Tokens::$emptyTokens, + $callback['start'], + ( $callback['end'] + 1 ), + true + ); + + if ( false !== $mapped_function + && \T_CONSTANT_ENCAPSED_STRING === $this->tokens[ $mapped_function ]['code'] + ) { + $functionName = TextStrings::stripQuotes( $this->tokens[ $mapped_function ]['content'] ); + $ptr = $mapped_function; + } + } + } + + // If this is a formatting function, we examine the parameters individually. + if ( $is_formatting_function ) { + $formatting_params = PassedParameters::getParameters( $this->phpcsFile, $i ); + if ( ! empty( $formatting_params ) ) { + foreach ( $formatting_params as $format_param ) { + $this->check_code_is_escaped( $format_param['start'], ( $format_param['end'] + 1 ), $code ); + } + } + + $watch = true; + } + + // Skip pointer to after the function. + if ( isset( $this->tokens[ $function_opener ]['parenthesis_closer'] ) ) { + $i = $this->tokens[ $function_opener ]['parenthesis_closer']; + } else { + // Live coding or parse error. + break; + } + } + + // If this is a safe function, we don't flag it. + if ( $is_formatting_function + || $this->is_escaping_function( $functionName ) + || $this->is_auto_escaped_function( $functionName ) + ) { + // Special case get_search_query() which is unsafe if $escaped = false. + if ( 'get_search_query' === strtolower( $functionName ) ) { + $escaped_param = PassedParameters::getParameter( $this->phpcsFile, $ptr, 1, 'escaped' ); + if ( false !== $escaped_param && 'true' !== $escaped_param['clean'] ) { + $this->phpcsFile->addError( + 'Output from get_search_query() is unsafe due to $escaped parameter being set to "false".', + $ptr, + 'UnsafeSearchQuery' + ); + } + } + + continue; + } + + $content = $functionName; + + } else { + $content = $this->tokens[ $i ]['content']; + $ptr = $i; + } + + // Make the error message a little more informative for array access variables. + if ( \T_VARIABLE === $this->tokens[ $ptr ]['code'] ) { + $array_keys = VariableHelper::get_array_access_keys( $this->phpcsFile, $ptr ); + + if ( ! empty( $array_keys ) ) { + $content .= '[' . implode( '][', $array_keys ) . ']'; + } + } + + $this->phpcsFile->addError( + "All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '%s'.", + $ptr, + $code, + array( $content ) + ); + } + + return $end; + } + + /** + * Check whether there is a ternary token at the right nesting level in an arbitrary set of tokens. + * + * @since 3.0.0 Split off from the process_token() method. + * + * @param int $start The position to start checking from. + * @param int $end The position to stop the check at. + * + * @return int|false Stack pointer to the ternary or FALSE if no ternary was found or + * if this is a short ternary. + */ + private function find_long_ternary( $start, $end ) { + for ( $i = $start; $i < $end; $i++ ) { + // Ignore anything within square brackets. + if ( isset( $this->tokens[ $i ]['bracket_opener'], $this->tokens[ $i ]['bracket_closer'] ) + && $i === $this->tokens[ $i ]['bracket_opener'] + ) { + $i = $this->tokens[ $i ]['bracket_closer']; + continue; + } + + // Skip past nested arrays, function calls and arbitrary groupings. + if ( \T_OPEN_PARENTHESIS === $this->tokens[ $i ]['code'] + && isset( $this->tokens[ $i ]['parenthesis_closer'] ) + ) { + $i = $this->tokens[ $i ]['parenthesis_closer']; + continue; + } + + // Skip past closures, anonymous classes and anything else scope related. + if ( isset( $this->tokens[ $i ]['scope_condition'], $this->tokens[ $i ]['scope_closer'] ) + && $this->tokens[ $i ]['scope_condition'] === $i + ) { + $i = $this->tokens[ $i ]['scope_closer']; + continue; + } + + if ( \T_INLINE_THEN !== $this->tokens[ $i ]['code'] ) { + continue; + } + + /* + * Okay, we found a ternary and it should be at the correct nesting level. + * If this is a short ternary, it shouldn't be ignored though. + */ + if ( Operators::isShortTernary( $this->phpcsFile, $i ) === true ) { + return false; + } + + return $i; + } + + return false; + } + + /** + * Examine a match expression and only check for escaping in the "returned" parts of the match expression. + * + * {@internal PHPCSUtils will likely contain a utility for parsing match expressions in the future. + * Ref: https://github.com/PHPCSStandards/PHPCSUtils/issues/497} + * + * @since 3.0.0 + * + * @param int $stackPtr Pointer to a T_MATCH token. + * @param string $code Code to use for the PHPCS error. + * + * @return int|false Stack pointer to skip to or FALSE if the match expression contained a parse error. + */ + private function walk_match_expression( $stackPtr, $code ) { + if ( ! isset( $this->tokens[ $stackPtr ]['scope_opener'], $this->tokens[ $stackPtr ]['scope_closer'] ) ) { + // Parse error/live coding. Shouldn't be possible as PHP[CS] will tokenize the keyword as `T_STRING` in that case. + return false; // @codeCoverageIgnore + } + + $current = $this->tokens[ $stackPtr ]['scope_opener']; + $end = $this->tokens[ $stackPtr ]['scope_closer']; + do { + $current = $this->phpcsFile->findNext( \T_MATCH_ARROW, ( $current + 1 ), $end ); + if ( false === $current ) { + // We must have reached the last match item (or there is a parse error). + break; + } + + $item_start = ( $current + 1 ); + $item_end = false; + + // Find the first comma at the same level. + for ( $i = $item_start; $i <= $end; $i++ ) { + // Ignore anything within square brackets. + if ( isset( $this->tokens[ $i ]['bracket_opener'], $this->tokens[ $i ]['bracket_closer'] ) + && $i === $this->tokens[ $i ]['bracket_opener'] + ) { + $i = $this->tokens[ $i ]['bracket_closer']; + continue; + } + + // Skip past nested arrays, function calls and arbitrary groupings. + if ( \T_OPEN_PARENTHESIS === $this->tokens[ $i ]['code'] + && isset( $this->tokens[ $i ]['parenthesis_closer'] ) + ) { + $i = $this->tokens[ $i ]['parenthesis_closer']; + continue; + } + + // Skip past closures, anonymous classes and anything else scope related. + if ( isset( $this->tokens[ $i ]['scope_condition'], $this->tokens[ $i ]['scope_closer'] ) + && $this->tokens[ $i ]['scope_condition'] === $i + ) { + $i = $this->tokens[ $i ]['scope_closer']; + continue; + } + + if ( \T_COMMA !== $this->tokens[ $i ]['code'] + && $i !== $end + ) { + continue; + } + + $item_end = $i; + break; + } + + if ( false === $item_end ) { + // Parse error/live coding. Shouldn't be possible. + return false; // @codeCoverageIgnore + } + + // Now check that the value returned by this match "leaf" is correctly escaped. + $this->check_code_is_escaped( $item_start, $item_end, $code ); + + // Independently of whether or not the check was successful or ran into (parse error) problems, + // always skip to the identified end of the item. + $current = $item_end; + } while ( $current < $end ); + + return $end; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php new file mode 100644 index 00000000..02411473 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php @@ -0,0 +1,422 @@ + true, + '$_FILES' => true, + '$_GET' => false, + '$_REQUEST' => false, + ); + + /** + * Custom list of functions which verify nonces. + * + * @since 0.5.0 + * + * @var string[] + */ + public $customNonceVerificationFunctions = array(); + + /** + * List of the functions which verify nonces. + * + * @since 0.5.0 + * @since 0.11.0 Changed from public static to protected non-static. + * @since 3.0.0 - Moved from the generic `Sniff` class to this class. + * - Visibility changed from `protected` to `private. + * + * @var array + */ + private $nonceVerificationFunctions = array( + 'wp_verify_nonce' => true, + 'check_admin_referer' => true, + 'check_ajax_referer' => true, + ); + + /** + * Cache of previously added custom functions. + * + * Prevents having to do the same merges over and over again. + * + * @since 0.5.0 + * @since 0.11.0 - Changed from public static to protected non-static. + * - Changed the format from simple bool to array. + * @since 3.0.0 - Property rename from `$addedCustomFunctions` to `$addedCustomNonceFunctions`. + * - Visibility changed from `protected` to `private. + * - Format changed from a multi-dimensional array to a single-dimensional array. + * + * @var array + */ + private $addedCustomNonceFunctions = array(); + + /** + * Information on the all scopes that were checked to find a nonce verification in a particular file. + * + * The array will be in the following format: + * ``` + * array( + * 'file' => (string) The name of the file. + * 'cache' => (array) array( + * # => array( The key is the token pointer to the "start" position. + * 'end' => (int) The token pointer to the "end" position. + * 'nonce' => (int|bool) The token pointer where n nonce check + * was found, or false if none was found. + * ) + * ) + * ) + * ``` + * + * @since 3.0.0 + * + * @var array + */ + private $cached_results; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() { + $targets = array( \T_VARIABLE => \T_VARIABLE ); + $targets += Collections::listOpenTokensBC(); // We need to skip over lists. + + return $targets; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + // Skip over lists as whatever is in those will always be assignments. + if ( isset( Collections::listOpenTokensBC()[ $this->tokens[ $stackPtr ]['code'] ] ) ) { + $open_close = Lists::getOpenClose( $this->phpcsFile, $stackPtr ); + $skip_to = $stackPtr; + if ( false !== $open_close ) { + $skip_to = $open_close['closer']; + } + + return $skip_to; + } + + if ( ! isset( $this->superglobals[ $this->tokens[ $stackPtr ]['content'] ] ) ) { + return; + } + + if ( Scopes::isOOProperty( $this->phpcsFile, $stackPtr ) ) { + // Property with the same name as a superglobal. Not our target. + return; + } + + // Determine the cache keys for this item. + $cache_keys = array( + 'file' => $this->phpcsFile->getFilename(), + 'start' => 0, + 'end' => $stackPtr, + ); + + // If we're in a function, only look inside of it. + // This doesn't take arrow functions into account as those are "open". + $functionPtr = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, array( \T_FUNCTION, \T_CLOSURE ) ); + if ( false !== $functionPtr ) { + $cache_keys['start'] = $this->tokens[ $functionPtr ]['scope_opener']; + } + + $this->mergeFunctionLists(); + + $needs_nonce = $this->needs_nonce_check( $stackPtr, $cache_keys ); + if ( false === $needs_nonce ) { + return; + } + + if ( $this->has_nonce_check( $stackPtr, $cache_keys, ( 'after' === $needs_nonce ) ) ) { + return; + } + + // If we're still here, no nonce-verification function was found. + $error_code = 'Missing'; + if ( false === $this->superglobals[ $this->tokens[ $stackPtr ]['content'] ] ) { + $error_code = 'Recommended'; + } + + MessageHelper::addMessage( + $this->phpcsFile, + 'Processing form data without nonce verification.', + $stackPtr, + $this->superglobals[ $this->tokens[ $stackPtr ]['content'] ], + $error_code + ); + } + + /** + * Determine whether or not a nonce check is needed for the current superglobal. + * + * @since 3.0.0 + * + * @param int $stackPtr The position of the current token in the stack of tokens. + * @param array $cache_keys The keys for the applicable cache (to potentially set). + * + * @return string|false String "before" or "after" if a nonce check is needed. + * FALSE when no nonce check is needed. + */ + protected function needs_nonce_check( $stackPtr, array $cache_keys ) { + $in_nonce_check = ContextHelper::is_in_function_call( $this->phpcsFile, $stackPtr, $this->nonceVerificationFunctions ); + if ( false !== $in_nonce_check ) { + // This *is* the nonce check, so bow out, but do store to cache. + // @todo Change to use arg unpacking once PHP < 5.6 has been dropped. + $this->set_cache( $cache_keys['file'], $cache_keys['start'], $cache_keys['end'], $in_nonce_check ); + return false; + } + + if ( Context::inUnset( $this->phpcsFile, $stackPtr ) ) { + // Variable is only being unset, no nonce check needed. + return false; + } + + if ( VariableHelper::is_assignment( $this->phpcsFile, $stackPtr, false ) ) { + // Overwriting the value of a superglobal. + return false; + } + + $needs_nonce = 'before'; + if ( ContextHelper::is_in_isset_or_empty( $this->phpcsFile, $stackPtr ) + || ContextHelper::is_in_type_test( $this->phpcsFile, $stackPtr ) + || VariableHelper::is_comparison( $this->phpcsFile, $stackPtr ) + || VariableHelper::is_assignment( $this->phpcsFile, $stackPtr, true ) + || ContextHelper::is_in_array_comparison( $this->phpcsFile, $stackPtr ) + || ContextHelper::is_in_function_call( $this->phpcsFile, $stackPtr, UnslashingFunctionsHelper::get_functions() ) !== false + || $this->is_only_sanitized( $this->phpcsFile, $stackPtr ) + ) { + $needs_nonce = 'after'; + } + + return $needs_nonce; + } + + /** + * Check if this token has an associated nonce check. + * + * @since 0.5.0 + * @since 3.0.0 - Moved from the generic `Sniff` class to this class. + * - Visibility changed from `protected` to `private. + * - New `$cache_keys` parameter. + * - New `$allow_nonce_after` parameter. + * + * @param int $stackPtr The position of the current token in the stack of tokens. + * @param array $cache_keys The keys for the applicable cache. + * @param bool $allow_nonce_after Whether the nonce check _must_ be before the $stackPtr or + * is allowed _after_ the $stackPtr. + * + * @return bool + */ + private function has_nonce_check( $stackPtr, array $cache_keys, $allow_nonce_after = false ) { + $start = $cache_keys['start']; + $end = $cache_keys['end']; + + // We allow for certain actions, such as an isset() check to come before the nonce check. + // If this superglobal is inside such a check, look for the nonce after it as well, + // all the way to the end of the scope. + if ( true === $allow_nonce_after ) { + $end = ( 0 === $start ) ? $this->phpcsFile->numTokens : $this->tokens[ $start ]['scope_closer']; + } + + // Check against the cache. + $current_cache = $this->get_cache( $cache_keys['file'], $start ); + if ( false !== $current_cache['nonce'] ) { + // If we have already found a nonce check in this scope, we just + // need to check whether it comes before this token. It is OK if the + // check is after the token though, if this was only an isset() check. + return ( true === $allow_nonce_after || $current_cache['nonce'] < $stackPtr ); + } elseif ( $end <= $current_cache['end'] ) { + // If not, we can still go ahead and return false if we've already + // checked to the end of the search area. + return false; + } + + $search_start = $start; + if ( $current_cache['end'] > $start ) { + // We haven't checked this far yet, but we can still save work by + // skipping over the part we've already checked. + $search_start = $this->cached_results['cache'][ $start ]['end']; + } + + // Loop through the tokens looking for nonce verification functions. + for ( $i = $search_start; $i < $end; $i++ ) { + // Skip over nested closed scope constructs. + if ( isset( Collections::closedScopes()[ $this->tokens[ $i ]['code'] ] ) + || \T_FN === $this->tokens[ $i ]['code'] + ) { + if ( isset( $this->tokens[ $i ]['scope_closer'] ) ) { + $i = $this->tokens[ $i ]['scope_closer']; + } + continue; + } + + // If this isn't a function name, skip it. + if ( \T_STRING !== $this->tokens[ $i ]['code'] ) { + continue; + } + + // If this is one of the nonce verification functions, we can bail out. + if ( isset( $this->nonceVerificationFunctions[ $this->tokens[ $i ]['content'] ] ) ) { + /* + * Now, make sure it is a call to a global function. + */ + if ( ContextHelper::has_object_operator_before( $this->phpcsFile, $i ) === true ) { + continue; + } + + if ( ContextHelper::is_token_namespaced( $this->phpcsFile, $i ) === true ) { + continue; + } + + $this->set_cache( $cache_keys['file'], $start, $end, $i ); + return true; + } + } + + // We're still here, so no luck. + $this->set_cache( $cache_keys['file'], $start, $end, false ); + + return false; + } + + /** + * Helper function to retrieve results from the cache. + * + * @since 3.0.0 + * + * @param string $filename The name of the current file. + * @param int $start The stack pointer searches started from. + * + * @return array + */ + private function get_cache( $filename, $start ) { + if ( is_array( $this->cached_results ) + && $filename === $this->cached_results['file'] + && isset( $this->cached_results['cache'][ $start ] ) + ) { + return $this->cached_results['cache'][ $start ]; + } + + return array( + 'end' => 0, + 'nonce' => false, + ); + } + + /** + * Helper function to store results to the cache. + * + * @since 3.0.0 + * + * @param string $filename The name of the current file. + * @param int $start The stack pointer searches started from. + * @param int $end The stack pointer searched stopped at. + * @param int|bool $nonce Stack pointer to the nonce verification function call or false if none was found. + * + * @return void + */ + private function set_cache( $filename, $start, $end, $nonce ) { + if ( is_array( $this->cached_results ) === false + || $filename !== $this->cached_results['file'] + ) { + $this->cached_results = array( + 'file' => $filename, + 'cache' => array( + $start => array( + 'end' => $end, + 'nonce' => $nonce, + ), + ), + ); + return; + } + + // Okay, so we know the current cache is for the current file. Check if we've seen this start pointer before. + if ( isset( $this->cached_results['cache'][ $start ] ) === false ) { + $this->cached_results['cache'][ $start ] = array( + 'end' => $end, + 'nonce' => $nonce, + ); + return; + } + + // Update existing entry. + if ( $end > $this->cached_results['cache'][ $start ]['end'] ) { + $this->cached_results['cache'][ $start ]['end'] = $end; + } + + $this->cached_results['cache'][ $start ]['nonce'] = $nonce; + } + + /** + * Merge custom functions provided via a custom ruleset with the defaults, if we haven't already. + * + * @since 0.11.0 Split out from the `process()` method. + * + * @return void + */ + protected function mergeFunctionLists() { + if ( $this->customNonceVerificationFunctions !== $this->addedCustomNonceFunctions ) { + $this->nonceVerificationFunctions = RulesetPropertyHelper::merge_custom_array( + $this->customNonceVerificationFunctions, + $this->nonceVerificationFunctions + ); + + $this->addedCustomNonceFunctions = $this->customNonceVerificationFunctions; + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php new file mode 100644 index 00000000..64711da2 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php @@ -0,0 +1,126 @@ +> Key is the name of the functions being targetted. + * Value is an array with parameter positions as the + * keys and parameter names as the values + */ + protected $target_functions = array( + 'add_comments_page' => array( + 4 => 'menu_slug', + ), + 'add_dashboard_page' => array( + 4 => 'menu_slug', + ), + 'add_links_page' => array( + 4 => 'menu_slug', + ), + 'add_management_page' => array( + 4 => 'menu_slug', + ), + 'add_media_page' => array( + 4 => 'menu_slug', + ), + 'add_menu_page' => array( + 4 => 'menu_slug', + ), + 'add_object_page' => array( + 4 => 'menu_slug', + ), + 'add_options_page' => array( + 4 => 'menu_slug', + ), + 'add_pages_page' => array( + 4 => 'menu_slug', + ), + 'add_plugins_page' => array( + 4 => 'menu_slug', + ), + 'add_posts_page' => array( + 4 => 'menu_slug', + ), + 'add_submenu_page' => array( + 1 => 'parent_slug', + 5 => 'menu_slug', + ), + 'add_theme_page' => array( + 4 => 'menu_slug', + ), + 'add_users_page' => array( + 4 => 'menu_slug', + ), + 'add_utility_page' => array( + 4 => 'menu_slug', + ), + ); + + /** + * Process the parameters of a matched function. + * + * @since 0.11.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + foreach ( $this->target_functions[ $matched_content ] as $position => $param_name ) { + $found_param = PassedParameters::getParameterFromStack( $parameters, $position, $param_name ); + if ( false === $found_param ) { + continue; + } + + $file_constant = $this->phpcsFile->findNext( \T_FILE, $found_param['start'], ( $found_param['end'] + 1 ) ); + if ( false !== $file_constant ) { + $this->phpcsFile->addWarning( 'Using __FILE__ for menu slugs risks exposing filesystem structure.', $file_constant, 'Using__FILE__' ); + } + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php new file mode 100644 index 00000000..88a08313 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php @@ -0,0 +1,45 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + 'wp_redirect' => array( + 'type' => 'warning', + 'message' => '%s() found. Using wp_safe_redirect(), along with the "allowed_redirect_hosts" filter if needed, can help avoid any chances of malicious redirects within code. It is also important to remember to call exit() after a redirect so that no other unwanted code is executed.', + 'functions' => array( + 'wp_redirect', + ), + ), + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php new file mode 100644 index 00000000..6f46261b --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php @@ -0,0 +1,244 @@ + + */ + private $slashed_superglobals = array( + '$_COOKIE' => true, + '$_GET' => true, + '$_POST' => true, + '$_REQUEST' => true, + '$_SERVER' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() { + return array( + \T_VARIABLE, + \T_DOUBLE_QUOTED_STRING, + \T_HEREDOC, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function process_token( $stackPtr ) { + + // Handling string interpolation. + if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $stackPtr ]['code'] + || \T_HEREDOC === $this->tokens[ $stackPtr ]['code'] + ) { + // Retrieve all embeds, but use only the initial variable name part. + $interpolated_variables = array_map( + static function ( $embed ) { + return preg_replace( '`^(\{?\$\{?\(?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)(.*)$`', '$2', $embed ); + }, + TextStrings::getEmbeds( $this->tokens[ $stackPtr ]['content'] ) + ); + + // Filter the embeds down to superglobals only. + $interpolated_superglobals = array_filter( + $interpolated_variables, + static function ( $var_name ) { + return ( 'GLOBALS' !== $var_name && Variables::isSuperglobalName( $var_name ) ); + } + ); + + foreach ( $interpolated_superglobals as $bad_variable ) { + $this->phpcsFile->addError( 'Detected usage of a non-sanitized, non-validated input variable %s: %s', $stackPtr, 'InputNotValidatedNotSanitized', array( $bad_variable, $this->tokens[ $stackPtr ]['content'] ) ); + } + + return; + } + + /* Handle variables */ + + // Check if this is a superglobal we want to examine. + if ( '$GLOBALS' === $this->tokens[ $stackPtr ]['content'] + || Variables::isSuperglobalName( $this->tokens[ $stackPtr ]['content'] ) === false + ) { + return; + } + + // If the variable is being unset, we don't care about it. + if ( Context::inUnset( $this->phpcsFile, $stackPtr ) ) { + return; + } + + // If we're overriding a superglobal with an assignment, no need to test. + if ( VariableHelper::is_assignment( $this->phpcsFile, $stackPtr ) ) { + return; + } + + // This superglobal is being validated. + if ( ContextHelper::is_in_isset_or_empty( $this->phpcsFile, $stackPtr ) ) { + return; + } + + $array_keys = VariableHelper::get_array_access_keys( $this->phpcsFile, $stackPtr ); + + if ( empty( $array_keys ) ) { + return; + } + + $error_data = array( $this->tokens[ $stackPtr ]['content'] . '[' . implode( '][', $array_keys ) . ']' ); + + /* + * Check for validation first. + */ + $validated = false; + + for ( $i = ( $stackPtr + 1 ); $i < $this->phpcsFile->numTokens; $i++ ) { + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + if ( \T_OPEN_SQUARE_BRACKET === $this->tokens[ $i ]['code'] + && isset( $this->tokens[ $i ]['bracket_closer'] ) + ) { + // Skip over array keys. + $i = $this->tokens[ $i ]['bracket_closer']; + continue; + } + + if ( \T_COALESCE === $this->tokens[ $i ]['code'] ) { + $validated = true; + } + + // Anything else means this is not a validation coalesce. + break; + } + + if ( false === $validated ) { + $validated = ValidationHelper::is_validated( $this->phpcsFile, $stackPtr, $array_keys, $this->check_validation_in_scope_only ); + } + + if ( false === $validated ) { + $this->phpcsFile->addError( + 'Detected usage of a possibly undefined superglobal array index: %s. Use isset() or empty() to check the index exists before using it', + $stackPtr, + 'InputNotValidated', + $error_data + ); + } + + // If this variable is being tested with one of the `is_..()` functions, sanitization isn't needed. + if ( ContextHelper::is_in_type_test( $this->phpcsFile, $stackPtr ) ) { + return; + } + + // If this is a comparison ('a' == $_POST['foo']), sanitization isn't needed. + if ( VariableHelper::is_comparison( $this->phpcsFile, $stackPtr, false ) ) { + return; + } + + // If this is a comparison using the array comparison functions, sanitization isn't needed. + if ( ContextHelper::is_in_array_comparison( $this->phpcsFile, $stackPtr ) ) { + return; + } + + // Now look for sanitizing functions. + if ( ! $this->is_sanitized( $this->phpcsFile, $stackPtr, array( $this, 'add_unslash_error' ) ) ) { + $this->phpcsFile->addError( + 'Detected usage of a non-sanitized input variable: %s', + $stackPtr, + 'InputNotSanitized', + $error_data + ); + } + } + + /** + * Add an error for missing use of unslashing. + * + * @since 0.5.0 + * @since 3.0.0 - Moved from the `Sniff` class to this class. + * - The `$phpcsFile` parameter was added. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The index of the token in the stack + * which is missing unslashing. + * + * @return void + */ + public function add_unslash_error( File $phpcsFile, $stackPtr ) { + $tokens = $phpcsFile->getTokens(); + $var_name = $tokens[ $stackPtr ]['content']; + + if ( isset( $this->slashed_superglobals[ $var_name ] ) === false ) { + // WP doesn't slash these, so they don't need unslashing. + return; + } + + // We know there will be array keys as that's checked in the process_token() method. + $array_keys = VariableHelper::get_array_access_keys( $phpcsFile, $stackPtr ); + $error_data = array( $var_name . '[' . implode( '][', $array_keys ) . ']' ); + + $phpcsFile->addError( + '%s not unslashed before sanitization. Use wp_unslash() or similar', + $stackPtr, + 'MissingUnslash', + $error_data + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php new file mode 100644 index 00000000..d87f338d --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php @@ -0,0 +1,862 @@ +> Function name as key, array with target + * parameter and name as value. + */ + protected $target_functions = array( + 'load_textdomain' => array( + 'position' => 1, + 'name' => 'domain', + ), + 'load_plugin_textdomain' => array( + 'position' => 1, + 'name' => 'domain', + ), + 'load_muplugin_textdomain' => array( + 'position' => 1, + 'name' => 'domain', + ), + 'load_theme_textdomain' => array( + 'position' => 1, + 'name' => 'domain', + ), + 'load_child_theme_textdomain' => array( + 'position' => 1, + 'name' => 'domain', + ), + 'load_script_textdomain' => array( + 'position' => 2, + 'name' => 'domain', + ), + 'unload_textdomain' => array( + 'position' => 1, + 'name' => 'domain', + ), + + '__' => array( + 'position' => 2, + 'name' => 'domain', + ), + '_e' => array( + 'position' => 2, + 'name' => 'domain', + ), + '_x' => array( + 'position' => 3, + 'name' => 'domain', + ), + '_ex' => array( + 'position' => 3, + 'name' => 'domain', + ), + '_n' => array( + 'position' => 4, + 'name' => 'domain', + ), + '_nx' => array( + 'position' => 5, + 'name' => 'domain', + ), + '_n_noop' => array( + 'position' => 3, + 'name' => 'domain', + ), + '_nx_noop' => array( + 'position' => 4, + 'name' => 'domain', + ), + 'translate_nooped_plural' => array( + 'position' => 3, + 'name' => 'domain', + ), + + 'esc_html__' => array( + 'position' => 2, + 'name' => 'domain', + ), + 'esc_html_e' => array( + 'position' => 2, + 'name' => 'domain', + ), + 'esc_html_x' => array( + 'position' => 3, + 'name' => 'domain', + ), + 'esc_attr__' => array( + 'position' => 2, + 'name' => 'domain', + ), + 'esc_attr_e' => array( + 'position' => 2, + 'name' => 'domain', + ), + 'esc_attr_x' => array( + 'position' => 3, + 'name' => 'domain', + ), + + 'is_textdomain_loaded' => array( + 'position' => 1, + 'name' => 'domain', + ), + 'get_translations_for_domain' => array( + 'position' => 1, + 'name' => 'domain', + ), + + // Deprecated functions. + '_c' => array( + 'position' => 2, + 'name' => 'domain', + ), + '_nc' => array( + 'position' => 4, + 'name' => 'domain', + ), + '__ngettext' => array( + 'position' => 4, + 'name' => 'domain', + ), + '__ngettext_noop' => array( + 'position' => 3, + 'name' => 'domain', + ), + 'translate_with_context' => array( + 'position' => 2, + 'name' => 'domain', + ), + + // Shouldn't be used by plugins/themes. + 'translate' => array( + 'position' => 2, + 'name' => 'domain', + ), + 'translate_with_gettext_context' => array( + 'position' => 3, + 'name' => 'domain', + ), + + // WP private functions. Shouldn't be used by plugins/themes. + '_load_textdomain_just_in_time' => array( + 'position' => 1, + 'name' => 'domain', + ), + '_get_path_to_translation_from_lang_dir' => array( + 'position' => 1, + 'name' => 'domain', + ), + '_get_path_to_translation' => array( + 'position' => 1, + 'name' => 'domain', + ), + ); + + /** + * Whether a valid new text domain was found. + * + * @since 1.2.0 + * + * @var bool + */ + private $is_valid = false; + + /** + * The new text domain as validated. + * + * @since 1.2.0 + * + * @var string + */ + private $validated_textdomain = ''; + + /** + * Whether the plugin/theme header has been seen and fixed yet. + * + * @since 1.2.0 + * + * @var bool + */ + private $header_found = false; + + /** + * Possible headers for a theme. + * + * @link https://developer.wordpress.org/themes/basics/main-stylesheet-style-css/ + * + * @since 1.2.0 + * + * @var array Array key is the header name, the value indicated whether it is a + * required (true) or optional (false) header. + */ + private $theme_headers = array( + 'Theme Name' => true, + 'Theme URI' => false, + 'Author' => true, + 'Author URI' => false, + 'Description' => true, + 'Version' => true, + 'Requires at least' => true, + 'Tested up to' => true, + 'Requires PHP' => true, + 'License' => true, + 'License URI' => true, + 'Text Domain' => true, + 'Tags' => false, + 'Domain Path' => false, + ); + + /** + * Possible headers for a plugin. + * + * @link https://developer.wordpress.org/plugins/plugin-basics/header-requirements/ + * + * @since 1.2.0 + * + * @var array Array key is the header name, the value indicated whether it is a + * required (true) or optional (false) header. + */ + private $plugin_headers = array( + 'Plugin Name' => true, + 'Plugin URI' => false, + 'Description' => false, + 'Version' => false, + 'Requires at least' => false, + 'Requires PHP' => false, + 'Author' => false, + 'Author URI' => false, + 'License' => false, + 'License URI' => false, + 'Text Domain' => false, + 'Domain Path' => false, + 'Network' => false, + 'Update URI' => false, + ); + + /** + * Regex template to match theme/plugin headers. + * + * @since 1.2.0 + * + * @var string + */ + private $header_regex_template = '`^(?:\s*(?:(?:\*|//)\s*)?)?(%s)\s*:\s*([^\r\n]+)`'; + + /** + * Regex to match theme headers. + * + * Set from within the register() method. + * + * @since 1.2.0 + * + * @var string + */ + private $theme_header_regex; + + /** + * Regex to match plugin headers. + * + * Set from within the register() method. + * + * @since 1.2.0 + * + * @var string + */ + private $plugin_header_regex; + + /** + * The --tab-width CLI value that is being used. + * + * @since 1.2.0 + * + * @var int + */ + private $tab_width = null; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 1.2.0 + * + * @return array + */ + public function register() { + $headers = array_map( + 'preg_quote', + array_keys( $this->theme_headers ), + array_fill( 0, \count( $this->theme_headers ), '`' ) + ); + $this->theme_header_regex = sprintf( $this->header_regex_template, implode( '|', $headers ) ); + + $headers = array_map( + 'preg_quote', + array_keys( $this->plugin_headers ), + array_fill( 0, \count( $this->plugin_headers ), '`' ) + ); + $this->plugin_header_regex = sprintf( $this->header_regex_template, implode( '|', $headers ) ); + + $targets = parent::register(); + + $targets[] = \T_DOC_COMMENT_OPEN_TAG; + $targets[] = \T_COMMENT; + + return $targets; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + // Check if the old/new properties are correctly set. If not, bow out. + if ( ! is_string( $this->new_text_domain ) + || '' === $this->new_text_domain + ) { + return ( $this->phpcsFile->numTokens + 1 ); + } + + if ( isset( $this->old_text_domain ) ) { + $this->old_text_domain = RulesetPropertyHelper::merge_custom_array( $this->old_text_domain, array(), false ); + + if ( ! is_array( $this->old_text_domain ) + || array() === $this->old_text_domain + ) { + return ( $this->phpcsFile->numTokens + 1 ); + } + } + + // Only validate and throw warning about the text domain once. + if ( $this->new_text_domain !== $this->validated_textdomain ) { + $this->is_valid = false; + $this->validated_textdomain = $this->new_text_domain; + $this->header_found = false; + + if ( 'default' === $this->new_text_domain ) { + $this->phpcsFile->addWarning( + 'The "default" text domain is reserved for WordPress core use and should not be used by plugins or themes', + 0, + 'ReservedNewDomain', + array( $this->new_text_domain ) + ); + + return ( $this->phpcsFile->numTokens + 1 ); + } + + if ( preg_match( '`^[a-z0-9-]+$`', $this->new_text_domain ) !== 1 ) { + $this->phpcsFile->addWarning( + 'The text domain should be a simple lowercase text string with words separated by dashes. "%s" appears invalid', + 0, + 'InvalidNewDomain', + array( $this->new_text_domain ) + ); + + return ( $this->phpcsFile->numTokens + 1 ); + } + + // If the text domain passed both validations, it should be considered valid. + $this->is_valid = true; + + } elseif ( false === $this->is_valid ) { + return ( $this->phpcsFile->numTokens + 1 ); + } + + if ( isset( $this->tab_width ) === false ) { + $this->tab_width = Helper::getTabWidth( $this->phpcsFile ); + } + + if ( \T_DOC_COMMENT_OPEN_TAG === $this->tokens[ $stackPtr ]['code'] + || \T_COMMENT === $this->tokens[ $stackPtr ]['code'] + ) { + // Examine for plugin/theme file header. + return $this->process_comments( $stackPtr ); + + } elseif ( isset( $this->phpcsFile->tokenizerType ) === false || 'CSS' !== $this->phpcsFile->tokenizerType ) { + // Examine a T_STRING token in a PHP file as a function call. + return parent::process_token( $stackPtr ); + } + } + + + /** + * Process the parameters of a matched function. + * + * @since 1.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + $target_param_specs = $this->target_functions[ $matched_content ]; + $found_param = PassedParameters::getParameterFromStack( $parameters, $target_param_specs['position'], $target_param_specs['name'] ); + + if ( false === $found_param && 1 !== $target_param_specs['position'] ) { + $error_msg = 'Missing $domain arg'; + $error_code = 'MissingArgDomain'; + + $has_named_params = false; + foreach ( $parameters as $param ) { + if ( isset( $param['name'] ) ) { + $has_named_params = true; + break; + } + } + + if ( false === $has_named_params && isset( $parameters[ ( $target_param_specs['position'] - 1 ) ] ) ) { + $fix = $this->phpcsFile->addFixableError( $error_msg, $stackPtr, $error_code ); + + if ( true === $fix ) { + $start_previous = $parameters[ ( $target_param_specs['position'] - 1 ) ]['start']; + $end_previous = $parameters[ ( $target_param_specs['position'] - 1 ) ]['end']; + if ( \T_WHITESPACE === $this->tokens[ $start_previous ]['code'] + && $this->tokens[ $start_previous ]['content'] === $this->phpcsFile->eolChar + ) { + // Replicate the new line + indentation of the previous item. + $replacement = ','; + for ( $i = $start_previous; $i <= $end_previous; $i++ ) { + if ( \T_WHITESPACE !== $this->tokens[ $i ]['code'] ) { + break; + } + + if ( isset( $this->tokens[ $i ]['orig_content'] ) ) { + $replacement .= $this->tokens[ $i ]['orig_content']; + } else { + $replacement .= $this->tokens[ $i ]['content']; + } + } + + $replacement .= "'{$this->new_text_domain}'"; + } else { + $replacement = ", '{$this->new_text_domain}'"; + } + + if ( \T_WHITESPACE === $this->tokens[ $end_previous ]['code'] ) { + $this->phpcsFile->fixer->addContentBefore( $end_previous, $replacement ); + } else { + $this->phpcsFile->fixer->addContent( $end_previous, $replacement ); + } + } + } elseif ( true === $has_named_params ) { + /* + * Function call using named arguments. For now, we will not auto-fix this. + * + * {@internal If we don't bother with indentation and such, this can be made + * auto-fixable by getting the 'end' of the last seen parameter and adding the + * domain parameter, with the 'domain: ' parameter label, after the last + * seen parameter.} + */ + $this->phpcsFile->addError( $error_msg, $stackPtr, $error_code ); + } else { + $error_msg .= ' and preceding argument(s)'; + $error_code = 'MissingArgs'; + + // Expected preceeding param also missing, just throw the warning. + $this->phpcsFile->addWarning( $error_msg, $stackPtr, $error_code ); + } + + return; + } + + // Target parameter found. Let's examine it. + $domain_param_start = $found_param['start']; + $domain_param_end = $found_param['end']; + $domain_token = null; + + for ( $i = $domain_param_start; $i <= $domain_param_end; $i++ ) { + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + if ( \T_CONSTANT_ENCAPSED_STRING !== $this->tokens[ $i ]['code'] ) { + // Unexpected token found, not our concern. This is handled by the I18n sniff. + return; + } + + if ( isset( $domain_token ) ) { + // More than one T_CONSTANT_ENCAPSED_STRING found, not our concern. This is handled by the I18n sniff. + return; + } + + $domain_token = $i; + } + + // If we're still here, this means only one T_CONSTANT_ENCAPSED_STRING was found. + $old_domain = TextStrings::stripQuotes( $this->tokens[ $domain_token ]['content'] ); + + if ( ! \in_array( $old_domain, $this->old_text_domain, true ) ) { + // Not a text domain targetted for replacement, ignore. + return; + } + + $fix = $this->phpcsFile->addFixableError( + 'Mismatched text domain. Expected \'%s\' but found \'%s\'', + $domain_token, + 'TextDomainMismatch', + array( $this->new_text_domain, $old_domain ) + ); + + if ( true === $fix ) { + $replacement = str_replace( $old_domain, $this->new_text_domain, $this->tokens[ $domain_token ]['content'] ); + $this->phpcsFile->fixer->replaceToken( $domain_token, $replacement ); + } + } + + /** + * Process the function if no parameters were found. + * + * @since 1.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * + * @return void + */ + public function process_no_parameters( $stackPtr, $group_name, $matched_content ) { + $target_param = $this->target_functions[ $matched_content ]; + + if ( 1 !== $target_param['position'] ) { + // Only process the no param case as fixable if the text domain is expected to be the first parameter. + $this->phpcsFile->addWarning( 'Missing $domain arg and preceding argument(s)', $stackPtr, 'MissingArgs' ); + return; + } + + $opener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( \T_OPEN_PARENTHESIS !== $this->tokens[ $opener ]['code'] + || isset( $this->tokens[ $opener ]['parenthesis_closer'] ) === false + ) { + // Parse error or live coding. + return; + } + + $fix = $this->phpcsFile->addFixableError( 'Missing $domain arg', $stackPtr, 'MissingArgDomain' ); + if ( true === $fix ) { + $closer = $this->tokens[ $opener ]['parenthesis_closer']; + $replacement = " '{$this->new_text_domain}' "; + + if ( $this->tokens[ $opener ]['line'] !== $this->tokens[ $closer ]['line'] ) { + $replacement = trim( $replacement ); + $addBefore = ( $closer - 1 ); + if ( \T_WHITESPACE === $this->tokens[ ( $closer - 1 ) ]['code'] + && $this->tokens[ $closer - 1 ]['line'] === $this->tokens[ $closer ]['line'] + ) { + if ( isset( $this->tokens[ ( $closer - 1 ) ]['orig_content'] ) ) { + $replacement = $this->tokens[ ( $closer - 1 ) ]['orig_content'] + . "\t" + . $replacement; + } else { + $replacement = $this->tokens[ ( $closer - 1 ) ]['content'] + . str_repeat( ' ', $this->tab_width ) + . $replacement; + } + + --$addBefore; + } else { + // We don't know whether the code uses tabs or spaces, so presume WPCS, i.e. tabs. + $replacement = "\t" . $replacement; + } + + $replacement = $this->phpcsFile->eolChar . $replacement; + + $this->phpcsFile->fixer->addContentBefore( $addBefore, $replacement ); + + } elseif ( \T_WHITESPACE === $this->tokens[ ( $closer - 1 ) ]['code'] ) { + $this->phpcsFile->fixer->replaceToken( ( $closer - 1 ), $replacement ); + } else { + $this->phpcsFile->fixer->addContentBefore( $closer, $replacement ); + } + } + } + + + /** + * Process comments to find the plugin/theme headers. + * + * @since 1.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_comments( $stackPtr ) { + if ( true === $this->header_found && ! defined( 'PHP_CODESNIFFER_IN_TESTS' ) ) { + return; + } + + $regex = $this->plugin_header_regex; + $headers = $this->plugin_headers; + $type = 'plugin'; + $skip_to = $stackPtr; + + $file = TextStrings::stripQuotes( $this->phpcsFile->getFileName() ); + if ( 'STDIN' === $file ) { + return; + } + + $file_name = basename( $file ); + if ( isset( $this->phpcsFile->tokenizerType ) && 'CSS' === $this->phpcsFile->tokenizerType ) { + if ( 'style.css' !== $file_name && ! defined( 'PHP_CODESNIFFER_IN_TESTS' ) ) { + // CSS files only need to be examined for the file header. + return ( $this->phpcsFile->numTokens + 1 ); + } + + $regex = $this->theme_header_regex; + $headers = $this->theme_headers; + $type = 'theme'; + } + + $comment_details = array( + 'required_header_found' => false, + 'headers_found' => 0, + 'text_domain_ptr' => false, + 'text_domain_found' => '', + 'last_header_ptr' => false, + 'last_header_matches' => array(), + ); + + if ( \T_COMMENT === $this->tokens[ $stackPtr ]['code'] ) { + $block_comment = false; + if ( substr( $this->tokens[ $stackPtr ]['content'], 0, 2 ) === '/*' ) { + $block_comment = true; + } + + $current = $stackPtr; + do { + if ( false === $comment_details['text_domain_ptr'] + || false === $comment_details['required_header_found'] + || $comment_details['headers_found'] < 3 + ) { + $comment_details = $this->examine_comment_line( $current, $regex, $headers, $comment_details ); + } + + if ( true === $block_comment && substr( $this->tokens[ $current ]['content'], -2 ) === '*/' ) { + ++$current; + break; + } + + ++$current; + } while ( isset( $this->tokens[ $current ] ) && \T_COMMENT === $this->tokens[ $current ]['code'] ); + + $skip_to = $current; + + } else { + if ( ! isset( $this->tokens[ $stackPtr ]['comment_closer'] ) ) { + return; + } + + $closer = $this->tokens[ $stackPtr ]['comment_closer']; + $current = $stackPtr; + + while ( ( $current = $this->phpcsFile->findNext( \T_DOC_COMMENT_STRING, ( $current + 1 ), $closer ) ) !== false ) { + $comment_details = $this->examine_comment_line( $current, $regex, $headers, $comment_details ); + + if ( false !== $comment_details['text_domain_ptr'] + && true === $comment_details['required_header_found'] + && $comment_details['headers_found'] >= 3 + ) { + // No need to look at the rest of the docblock. + break; + } + } + + $skip_to = $closer; + } + + // So, was this the plugin/theme header ? + if ( true === $comment_details['required_header_found'] + && $comment_details['headers_found'] >= 3 + ) { + $this->header_found = true; + + $text_domain_ptr = $comment_details['text_domain_ptr']; + $text_domain_found = $comment_details['text_domain_found']; + + if ( false !== $text_domain_ptr ) { + if ( $this->new_text_domain !== $text_domain_found + && ( \in_array( $text_domain_found, $this->old_text_domain, true ) ) + ) { + $fix = $this->phpcsFile->addFixableError( + 'Mismatched text domain in %s header. Expected \'%s\' but found \'%s\'', + $text_domain_ptr, + 'TextDomainHeaderMismatch', + array( + $type, + $this->new_text_domain, + $text_domain_found, + ) + ); + + if ( true === $fix ) { + if ( isset( $this->tokens[ $text_domain_ptr ]['orig_content'] ) ) { + $replacement = $this->tokens[ $text_domain_ptr ]['orig_content']; + } else { + $replacement = $this->tokens[ $text_domain_ptr ]['content']; + } + + $replacement = str_replace( $text_domain_found, $this->new_text_domain, $replacement ); + + $this->phpcsFile->fixer->replaceToken( $text_domain_ptr, $replacement ); + } + } + } else { + $last_header_ptr = $comment_details['last_header_ptr']; + $last_header_matches = $comment_details['last_header_matches']; + + $fix = $this->phpcsFile->addFixableError( + 'Missing "Text Domain" in %s header', + $last_header_ptr, + 'MissingTextDomainHeader', + array( $type ) + ); + + if ( true === $fix ) { + if ( isset( $this->tokens[ $last_header_ptr ]['orig_content'] ) ) { + $replacement = $this->tokens[ $last_header_ptr ]['orig_content']; + } else { + $replacement = $this->tokens[ $last_header_ptr ]['content']; + } + + $replacement = str_replace( $last_header_matches[1], 'Text Domain', $replacement ); + $replacement = str_replace( $last_header_matches[2], $this->new_text_domain, $replacement ); + + if ( \T_DOC_COMMENT_OPEN_TAG === $this->tokens[ $stackPtr ]['code'] ) { + for ( $i = ( $last_header_ptr - 1 ); ; $i-- ) { + if ( $this->tokens[ $i ]['line'] !== $this->tokens[ $last_header_ptr ]['line'] ) { + ++$i; + break; + } + } + + $replacement = $this->phpcsFile->eolChar + . GetTokensAsString::origContent( $this->phpcsFile, $i, ( $last_header_ptr - 1 ) ) + . $replacement; + } + + $this->phpcsFile->fixer->addContent( $comment_details['last_header_ptr'], $replacement ); + } + } + } + + return $skip_to; + } + + /** + * Examine an individual token in a larger comment for plugin/theme headers. + * + * @since 1.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $regex The regex to use to examine the comment line. + * @param array $headers Valid headers for a plugin or theme. + * @param array $comment_details The information collected so far. + * + * @return array Adjusted $comment_details array + */ + protected function examine_comment_line( $stackPtr, $regex, $headers, $comment_details ) { + if ( preg_match( $regex, $this->tokens[ $stackPtr ]['content'], $matches ) === 1 ) { + ++$comment_details['headers_found']; + + if ( true === $headers[ $matches[1] ] ) { + $comment_details['required_header_found'] = true; + } + + if ( 'Text Domain' === $matches[1] ) { + $comment_details['text_domain_ptr'] = $stackPtr; + $comment_details['text_domain_found'] = trim( $matches[2] ); + } + + $comment_details['last_header_ptr'] = $stackPtr; + $comment_details['last_header_matches'] = $matches; + } + + return $comment_details; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php new file mode 100644 index 00000000..afd98fd2 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php @@ -0,0 +1,371 @@ + true, + 'php://output' => true, + 'php://stdin' => true, + 'php://stdout' => true, + 'php://stderr' => true, + ); + + /** + * Local input streams which should not be flagged for the file system function checks if + * the $filename starts with them. + * + * @link https://www.php.net/wrappers.php + * + * @since 2.1.0 + * @since 3.0.0 The visibility was changed from `protected` to `private`. + * + * @var array + */ + private $allowed_local_stream_partials = array( + 'php://temp/', + 'php://fd/', + ); + + /** + * Local input stream constants which should not be flagged for the file system function checks. + * + * @link https://www.php.net/wrappers.php + * + * @since 2.1.0 + * @since 3.0.0 The visibility was changed from `protected` to `private`. + * + * @var array + */ + private $allowed_local_stream_constants = array( + 'STDIN' => true, + 'STDOUT' => true, + 'STDERR' => true, + ); + + /** + * Groups of functions to restrict. + * + * Example: groups => array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'since' => '4.9.0', //=> the WP version in which the alternative became available. + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + 'curl' => array( + 'type' => 'warning', + 'message' => 'Using cURL functions is highly discouraged. Use wp_remote_get() instead.', + 'since' => '2.7.0', + 'functions' => array( + 'curl_*', + ), + 'allow' => array( + 'curl_version' => true, + ), + ), + + 'parse_url' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged because of inconsistency in the output across PHP versions; use wp_parse_url() instead.', + 'since' => '4.4.0', + 'functions' => array( + 'parse_url', + ), + ), + + 'json_encode' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged. Use wp_json_encode() instead.', + 'since' => '4.1.0', + 'functions' => array( + 'json_encode', + ), + ), + + 'file_get_contents' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged. Use wp_remote_get() for remote URLs instead.', + 'since' => '2.7.0', + 'functions' => array( + 'file_get_contents', + ), + ), + + 'unlink' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged. Use wp_delete_file() to delete a file.', + 'since' => '4.2.0', + 'functions' => array( + 'unlink', + ), + ), + + 'rename' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged. Use WP_Filesystem::move() to rename a file.', + 'since' => '2.5.0', + 'functions' => array( + 'rename', + ), + ), + + 'file_system_operations' => array( + 'type' => 'warning', + 'message' => 'File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: %s().', + 'since' => '2.5.0', + 'functions' => array( + 'chgrp', + 'chmod', + 'chown', + 'fclose', + 'file_put_contents', + 'fopen', + 'fputs', + 'fread', + 'fsockopen', + 'fwrite', + 'is_writable', + 'is_writeable', + 'mkdir', + 'pfsockopen', + 'readfile', + 'rmdir', + 'touch', + ), + ), + + 'strip_tags' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged. Use the more comprehensive wp_strip_all_tags() instead.', + 'since' => '2.9.0', + 'functions' => array( + 'strip_tags', + ), + ), + + 'rand_seeding' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged. Rand seeding is not necessary when using the wp_rand() function (as you should).', + 'since' => '2.6.2', + 'functions' => array( + 'mt_srand', + 'srand', + ), + ), + + 'rand' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged. Use the far less predictable wp_rand() instead.', + 'since' => '2.6.2', + 'functions' => array( + 'mt_rand', + 'rand', + ), + ), + ); + } + + /** + * Process a matched token. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_matched_token( $stackPtr, $group_name, $matched_content ) { + + $this->set_minimum_wp_version(); + + /* + * Deal with exceptions. + */ + switch ( $matched_content ) { + case 'strip_tags': + /* + * The function `wp_strip_all_tags()` is only a valid alternative when + * only the first parameter, `$string`, is passed to `strip_tags()`. + */ + $has_allowed_tags = PassedParameters::getParameter( $this->phpcsFile, $stackPtr, 2, 'allowed_tags' ); + if ( false !== $has_allowed_tags ) { + return; + } + + unset( $has_allowed_tags ); + break; + + case 'parse_url': + /* + * Before WP 4.7.0, the function `wp_parse_url()` was only a valid alternative + * if the second param - `$component` - was not passed to `parse_url()`. + * + * @see https://developer.wordpress.org/reference/functions/wp_parse_url/#changelog + */ + $has_component = PassedParameters::getParameter( $this->phpcsFile, $stackPtr, 2, 'component' ); + if ( false !== $has_component + && $this->wp_version_compare( $this->minimum_wp_version, '4.7.0', '<' ) + ) { + return; + } + + unset( $has_component ); + break; + + case 'file_get_contents': + /* + * Using `wp_remote_get()` will only work for remote URLs. + * See if we can determine is this function call is for a local file and if so, bow out. + */ + $params = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); + + $use_include_path_param = PassedParameters::getParameterFromStack( $params, 2, 'use_include_path' ); + if ( false !== $use_include_path_param && 'true' === $use_include_path_param['clean'] ) { + // Setting `$use_include_path` to `true` is only relevant for local files. + return; + } + + $filename_param = PassedParameters::getParameterFromStack( $params, 1, 'filename' ); + if ( false === $filename_param ) { + // If the file to get is not set, this is a non-issue anyway. + return; + } + + if ( strpos( $filename_param['clean'], 'http:' ) !== false + || strpos( $filename_param['clean'], 'https:' ) !== false + ) { + // Definitely a URL, throw notice. + break; + } + + $contains_wp_path_constant = preg_match( + '`\b(?:ABSPATH|WP_(?:CONTENT|PLUGIN)_DIR|WPMU_PLUGIN_DIR|TEMPLATEPATH|STYLESHEETPATH|(?:MU)?PLUGINDIR)\b`', + $filename_param['clean'] + ); + if ( 1 === $contains_wp_path_constant ) { + // Using any of the constants matched in this regex is an indicator of a local file. + return; + } + + $contains_wp_path_function_call = preg_match( + '`(?:get_home_path|plugin_dir_path|get_(?:stylesheet|template)_directory|wp_upload_dir)\s*\(`i', + $filename_param['clean'] + ); + if ( 1 === $contains_wp_path_function_call ) { + // Using any of the functions matched in the regex is an indicator of a local file. + return; + } + + if ( $this->is_local_data_stream( $filename_param['clean'] ) === true ) { + // Local data stream. + return; + } + + unset( $params, $use_include_path_param, $filename_param, $contains_wp_path_constant, $contains_wp_path_function_call ); + break; + + case 'file_put_contents': + case 'fopen': + case 'readfile': + /* + * Allow for handling raw data streams from the request body. + * + * Note: at this time (December 2022) these three functions use the same parameter name for their + * first parameter. If this would change at any point in the future, this code will need to + * be made more modular and will need to pass the parameter name based on the function call detected. + */ + $filename_param = PassedParameters::getParameter( $this->phpcsFile, $stackPtr, 1, 'filename' ); + if ( false === $filename_param ) { + // If the file to work with is not set, local data streams don't come into play. + break; + } + + if ( $this->is_local_data_stream( $filename_param['clean'] ) === true ) { + // Local data stream. + return; + } + + unset( $filename_param ); + break; + } + + if ( ! isset( $this->groups[ $group_name ]['since'] ) ) { + return parent::process_matched_token( $stackPtr, $group_name, $matched_content ); + } + + // Verify if the alternative is available in the minimum supported WP version. + if ( $this->wp_version_compare( $this->groups[ $group_name ]['since'], $this->minimum_wp_version, '<=' ) ) { + return parent::process_matched_token( $stackPtr, $group_name, $matched_content ); + } + } + + /** + * Determine based on the "clean" parameter value, whether a file parameter points to + * a local data stream. + * + * @param string $clean_param_value Parameter value without comments. + * + * @return bool True if this is a local data stream. False otherwise. + */ + protected function is_local_data_stream( $clean_param_value ) { + + $stripped = TextStrings::stripQuotes( $clean_param_value ); + if ( isset( $this->allowed_local_streams[ $stripped ] ) + || isset( $this->allowed_local_stream_constants[ $clean_param_value ] ) + ) { + return true; + } + + foreach ( $this->allowed_local_stream_partials as $partial ) { + if ( strpos( $stripped, $partial ) === 0 ) { + return true; + } + } + + return false; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php new file mode 100644 index 00000000..3a86562d --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php @@ -0,0 +1,478 @@ + The key is the name of a function we're targetting, + * the value is an array containing the 1-based parameter position + * of the "capability" parameter within the function, as well as + * the name of the parameter as declared in the function. + * If the parameter name has been renamed since the release of PHP 8.0, + * the parameter can be set as an array. + */ + protected $target_functions = array( + 'add_comments_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_dashboard_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_links_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_management_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_media_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_menu_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_object_page' => array( // Deprecated since WP 4.5.0. + 'position' => 3, + 'name' => 'capability', + ), + 'add_options_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_pages_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_plugins_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_posts_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_submenu_page' => array( + 'position' => 4, + 'name' => 'capability', + ), + 'add_theme_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_users_page' => array( + 'position' => 3, + 'name' => 'capability', + ), + 'add_utility_page' => array( // Deprecated since WP 4.5.0. + 'position' => 3, + 'name' => 'capability', + ), + 'author_can' => array( + 'position' => 2, + 'name' => 'capability', + ), + 'current_user_can' => array( + 'position' => 1, + 'name' => 'capability', + ), + 'current_user_can_for_blog' => array( + 'position' => 2, + 'name' => 'capability', + ), + 'map_meta_cap' => array( + 'position' => 1, + 'name' => 'cap', + ), + 'user_can' => array( + 'position' => 2, + 'name' => 'capability', + ), + ); + + /** + * List of core roles which should not to be used directly. + * + * @since 3.0.0 + * + * @var array Key is role available in WP Core, value irrelevant. + */ + private $core_roles = array( + 'super_admin' => true, + 'administrator' => true, + 'editor' => true, + 'author' => true, + 'contributor' => true, + 'subscriber' => true, + ); + + /** + * List of known primitive and meta core capabilities. + * + * Sources: + * - {@link https://wordpress.org/support/article/roles-and-capabilities/ Roles and Capabilities handbook page} + * - The `map_meta_cap()` function in the `src/wp-includes/capabilities.php` file. + * - The tests in the `tests/phpunit/tests/user/capabilities.php` file. + * + * List is sorted alphabetically. + * + * {@internal To be updated after every major release. Last updated for WordPress 6.1.0.} + * + * @since 3.0.0 + * + * @var array All capabilities available in core. + */ + private $core_capabilities = array( + 'activate_plugin' => true, + 'activate_plugins' => true, + 'add_comment_meta' => true, + 'add_post_meta' => true, + 'add_term_meta' => true, + 'add_user_meta' => true, + 'add_users' => true, + 'assign_categories' => true, + 'assign_post_tags' => true, + 'assign_term' => true, + 'create_app_password' => true, + 'create_sites' => true, + 'create_users' => true, + 'customize' => true, + 'deactivate_plugin' => true, + 'deactivate_plugins' => true, + 'delete_app_password' => true, + 'delete_app_passwords' => true, + 'delete_block' => true, // Only seen in tests. + 'delete_blocks' => true, // Alias for 'delete_posts', but supported. + 'delete_categories' => true, + 'delete_comment_meta' => true, + 'delete_others_blocks' => true, // Alias for 'delete_others_posts', but supported. + 'delete_others_pages' => true, + 'delete_others_posts' => true, + 'delete_page' => true, // Alias, but supported. + 'delete_pages' => true, + 'delete_plugins' => true, + 'delete_post_tags' => true, + 'delete_post' => true, // Alias, but supported. + 'delete_post_meta' => true, + 'delete_posts' => true, + 'delete_private_blocks' => true, // Alias for 'delete_private_posts', but supported. + 'delete_private_pages' => true, + 'delete_private_posts' => true, + 'delete_published_blocks' => true, // Alias for 'delete_published_posts', but supported. + 'delete_published_pages' => true, + 'delete_published_posts' => true, + 'delete_site' => true, + 'delete_sites' => true, + 'delete_term' => true, + 'delete_term_meta' => true, + 'delete_themes' => true, + 'delete_user' => true, // Alias for 'delete_users', but supported. + 'delete_user_meta' => true, + 'delete_users' => true, + 'edit_app_password' => true, + 'edit_categories' => true, + 'edit_block' => true, // Only seen in tests. + 'edit_blocks' => true, // Alias for 'edit_posts', but supported. + 'edit_comment' => true, // Alias, but supported. + 'edit_comment_meta' => true, + 'edit_css' => true, + 'edit_dashboard' => true, + 'edit_files' => true, + 'edit_others_blocks' => true, // Alias for 'edit_others_posts', but supported. + 'edit_others_pages' => true, + 'edit_others_posts' => true, + 'edit_page' => true, // Alias, but supported. + 'edit_pages' => true, + 'edit_plugins' => true, + 'edit_post_tags' => true, + 'edit_post' => true, // Alias, but supported. + 'edit_post_meta' => true, + 'edit_posts' => true, + 'edit_private_blocks' => true, // Alias for 'edit_private_posts', but supported. + 'edit_private_pages' => true, + 'edit_private_posts' => true, + 'edit_published_blocks' => true, // Alias for 'edit_published_posts', but supported. + 'edit_published_pages' => true, + 'edit_published_posts' => true, + 'edit_term' => true, + 'edit_term_meta' => true, + 'edit_theme_options' => true, + 'edit_themes' => true, + 'edit_user' => true, // Alias for 'edit_users', but supported. + 'edit_user_meta' => true, + 'edit_users' => true, + 'erase_others_personal_data' => true, + 'export' => true, + 'export_others_personal_data' => true, + 'import' => true, + 'install_languages' => true, + 'install_plugins' => true, + 'install_themes' => true, + 'list_app_passwords' => true, + 'list_users' => true, + 'manage_categories' => true, + 'manage_links' => true, + 'manage_network' => true, + 'manage_network_options' => true, + 'manage_network_plugins' => true, + 'manage_network_themes' => true, + 'manage_network_users' => true, + 'manage_options' => true, + 'manage_post_tags' => true, + 'manage_privacy_options' => true, + 'manage_sites' => true, + 'moderate_comments' => true, + 'publish_blocks' => true, // Alias for 'publish_posts', but supported. + 'publish_pages' => true, + 'publish_post' => true, // Alias, but supported. + 'publish_posts' => true, + 'promote_user' => true, + 'promote_users' => true, + 'read' => true, + 'read_block' => true, // Only seen in tests. + 'read_post' => true, // Alias, but supported. + 'read_page' => true, // Alias, but supported. + 'read_app_password' => true, + 'read_private_blocks' => true, // Alias for 'read_private_posts', but supported. + 'read_private_pages' => true, + 'read_private_posts' => true, + 'remove_user' => true, // Alias for 'remove_users', but supported. + 'remove_users' => true, + 'resume_plugin' => true, // Alias for 'resume_plugins', but supported. + 'resume_plugins' => true, + 'resume_theme' => true, // Alias for 'resume_themes', but supported. + 'resume_themes' => true, + 'setup_network' => true, + 'switch_themes' => true, + 'unfiltered_html' => true, + 'unfiltered_upload' => true, + 'update_core' => true, + 'update_https' => true, + 'update_languages' => true, + 'update_plugins' => true, + 'update_php' => true, + 'update_themes' => true, + 'upgrade_network' => true, + 'upload_files' => true, + 'upload_plugins' => true, + 'upload_themes' => true, + 'view_site_health_checks' => true, + ); + + /** + * List of deprecated core capabilities. + * + * User Levels were deprecated in version 3.0. + * + * {@internal To be updated after every major release. Last updated for WordPress 6.1.0.} + * + * @link https://github.com/WordPress/wordpress-develop/blob/master/tests/phpunit/tests/user/capabilities.php + * + * @since 3.0.0 + * + * @var array All deprecated capabilities in core. + */ + private $deprecated_capabilities = array( + 'level_10' => '3.0.0', + 'level_9' => '3.0.0', + 'level_8' => '3.0.0', + 'level_7' => '3.0.0', + 'level_6' => '3.0.0', + 'level_5' => '3.0.0', + 'level_4' => '3.0.0', + 'level_3' => '3.0.0', + 'level_2' => '3.0.0', + 'level_1' => '3.0.0', + 'level_0' => '3.0.0', + ); + + /** + * Process the parameters of a matched function. + * + * @since 3.0.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + $function_details = $this->target_functions[ $matched_content ]; + + $parameter = PassedParameters::getParameterFromStack( + $parameters, + $function_details['position'], + $function_details['name'] + ); + + if ( false === $parameter ) { + return; + } + + // If the parameter is anything other than T_CONSTANT_ENCAPSED_STRING throw a warning and bow out. + $first_non_empty = null; + for ( $i = $parameter['start']; $i <= $parameter['end']; $i++ ) { + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + if ( \T_CONSTANT_ENCAPSED_STRING !== $this->tokens[ $i ]['code'] + || null !== $first_non_empty + ) { + // Throw warning at low severity. + $this->phpcsFile->addWarning( + 'Couldn\'t determine the value passed to the $%s parameter in function call to %s(). Please check if it matches a valid capability. Found: %s', + $i, + 'Undetermined', + array( + $function_details['name'], + $matched_content, + $parameter['clean'], + ), + 3 // Message severity set to below default. + ); + return; + } + + $first_non_empty = $i; + } + + if ( null === $first_non_empty ) { + // Parse error. Bow out. + return; + } + + /* + * As of this point we know that the `$capabilities` parameter only contains the one token + * and that that token is a `T_CONSTANT_ENCAPSED_STRING`. + */ + $matched_parameter = TextStrings::stripQuotes( $this->tokens[ $first_non_empty ]['content'] ); + + if ( isset( $this->core_capabilities[ $matched_parameter ] ) ) { + return; + } + + if ( empty( $matched_parameter ) ) { + $this->phpcsFile->addError( + 'An empty string is not a valid capability. Empty string found as the $%s parameter in a function call to %s()"', + $first_non_empty, + 'Invalid', + array( + $function_details['name'], + $matched_content, + ) + ); + return; + } + + // Check if additional capabilities were registered via the ruleset and if the found capability matches any of those. + $custom_capabilities = RulesetPropertyHelper::merge_custom_array( $this->custom_capabilities, array() ); + if ( isset( $custom_capabilities[ $matched_parameter ] ) ) { + return; + } + + if ( isset( $this->deprecated_capabilities[ $matched_parameter ] ) ) { + $this->set_minimum_wp_version(); + $is_error = $this->wp_version_compare( $this->deprecated_capabilities[ $matched_parameter ], $this->minimum_wp_version, '<' ); + + $data = array( + $matched_parameter, + $matched_content, + $this->deprecated_capabilities[ $matched_parameter ], + ); + + MessageHelper::addMessage( + $this->phpcsFile, + 'The capability "%s", found in the function call to %s(), has been deprecated since WordPress version %s.', + $first_non_empty, + $is_error, + 'Deprecated', + $data + ); + return; + } + + if ( isset( $this->core_roles[ $matched_parameter ] ) ) { + $this->phpcsFile->addError( + 'Capabilities should be used instead of roles. Found "%s" in function call to %s()', + $first_non_empty, + 'RoleFound', + array( + $matched_parameter, + $matched_content, + ) + ); + return; + } + + $this->phpcsFile->addWarning( + 'Found unknown capability "%s" in function call to %s(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap().' . \PHP_EOL . 'Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.', + $first_non_empty, + 'Unknown', + array( + $matched_parameter, + $matched_content, + ) + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php new file mode 100644 index 00000000..c183f156 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php @@ -0,0 +1,315 @@ +\'"()]*?\.(?:php|js|css|png|j[e]?pg|gif|pot))#i'; + + /** + * Regex to match a large number or spelling variations of WordPress in class names. + * + * @var string + */ + const WP_CLASSNAME_REGEX = '`(?:^|_)(Word[_]*Pres+)(?:_|$)`i'; + + /** + * Comment tokens we want to listen for as they contain text strings. + * + * @var array + */ + private $comment_text_tokens = array( + \T_DOC_COMMENT => \T_DOC_COMMENT, + \T_DOC_COMMENT_STRING => \T_DOC_COMMENT_STRING, + \T_COMMENT => \T_COMMENT, + ); + + /** + * Combined text string and comment tokens array. + * + * This property is set in the register() method and used for lookups. + * + * @var array + */ + private $text_and_comment_tokens = array(); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 0.12.0 + * + * @return array + */ + public function register() { + // Union the arrays - keeps the array keys. + $this->text_and_comment_tokens = ( Tokens::$textStringTokens + $this->comment_text_tokens ); + + $targets = $this->text_and_comment_tokens; + $targets += Tokens::$ooScopeTokens; + $targets[ \T_NAMESPACE ] = \T_NAMESPACE; + + // Also sniff for array tokens to make skipping anything within those more efficient. + $targets += Collections::arrayOpenTokensBC(); + $targets += Collections::listTokens(); + $targets[ \T_OPEN_SQUARE_BRACKET ] = \T_OPEN_SQUARE_BRACKET; + + return $targets; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 0.12.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + /* + * Ignore tokens within array and list definitions as well as within + * array keys as this is a false positive in 80% of all cases. + * + * The return values skip to the end of the array. + * This prevents the sniff "hanging" on very long configuration arrays. + */ + if ( ( \T_ARRAY === $this->tokens[ $stackPtr ]['code'] + || \T_LIST === $this->tokens[ $stackPtr ]['code'] ) + && isset( $this->tokens[ $stackPtr ]['parenthesis_closer'] ) + ) { + return $this->tokens[ $stackPtr ]['parenthesis_closer']; + } + + if ( ( \T_OPEN_SHORT_ARRAY === $this->tokens[ $stackPtr ]['code'] + || \T_OPEN_SQUARE_BRACKET === $this->tokens[ $stackPtr ]['code'] ) + && isset( $this->tokens[ $stackPtr ]['bracket_closer'] ) + ) { + return $this->tokens[ $stackPtr ]['bracket_closer']; + } + + /* + * Deal with misspellings in namespace names. + * These are not auto-fixable, but need the attention of a developer. + */ + if ( \T_NAMESPACE === $this->tokens[ $stackPtr ]['code'] ) { + $ns_name = Namespaces::getDeclaredName( $this->phpcsFile, $stackPtr ); + if ( empty( $ns_name ) ) { + // Namespace operator or declaration without name. + return; + } + + $levels = explode( '\\', $ns_name ); + foreach ( $levels as $level ) { + if ( preg_match_all( self::WP_CLASSNAME_REGEX, $level, $matches, \PREG_PATTERN_ORDER ) > 0 ) { + $misspelled = $this->retrieve_misspellings( $matches[1] ); + + if ( ! empty( $misspelled ) ) { + $this->phpcsFile->addWarning( + 'Please spell "WordPress" correctly. Found: "%s" as part of the namespace name.', + $stackPtr, + 'MisspelledNamespaceName', + array( implode( ', ', $misspelled ) ) + ); + } + } + } + + return; + } + + /* + * Deal with misspellings in class/interface/trait/enum names. + * These are not auto-fixable, but need the attention of a developer. + */ + if ( isset( Tokens::$ooScopeTokens[ $this->tokens[ $stackPtr ]['code'] ] ) ) { + $classname = ObjectDeclarations::getName( $this->phpcsFile, $stackPtr ); + if ( empty( $classname ) ) { + return; + } + + if ( preg_match_all( self::WP_CLASSNAME_REGEX, $classname, $matches, \PREG_PATTERN_ORDER ) > 0 ) { + $misspelled = $this->retrieve_misspellings( $matches[1] ); + + if ( ! empty( $misspelled ) ) { + $this->phpcsFile->addWarning( + 'Please spell "WordPress" correctly. Found: "%s" as part of the class/interface/trait/enum name.', + $stackPtr, + 'MisspelledClassName', + array( implode( ', ', $misspelled ) ) + ); + } + } + + return; + } + + /* + * Deal with misspellings in text strings and documentation. + */ + + // Ignore content of docblock @link tags. + if ( \T_DOC_COMMENT_STRING === $this->tokens[ $stackPtr ]['code'] + || \T_DOC_COMMENT === $this->tokens[ $stackPtr ]['code'] + ) { + + $comment_tag = $this->phpcsFile->findPrevious( + array( \T_DOC_COMMENT_TAG, \T_DOC_COMMENT_OPEN_TAG ), + ( $stackPtr - 1 ) + ); + if ( false !== $comment_tag + && \T_DOC_COMMENT_TAG === $this->tokens[ $comment_tag ]['code'] + && '@link' === $this->tokens[ $comment_tag ]['content'] + ) { + // @link tag, so ignore. + return; + } + } + + // Ignore constant declarations via define(). + if ( ContextHelper::is_in_function_call( $this->phpcsFile, $stackPtr, array( 'define' => true ), true, true ) ) { + return; + } + + // Ignore constant declarations using the const keyword. + $stop_points = array( + \T_CONST, + \T_SEMICOLON, + \T_OPEN_TAG, + \T_CLOSE_TAG, + \T_OPEN_CURLY_BRACKET, + ); + $maybe_const = $this->phpcsFile->findPrevious( $stop_points, ( $stackPtr - 1 ) ); + if ( false !== $maybe_const && \T_CONST === $this->tokens[ $maybe_const ]['code'] ) { + return; + } + + $content = $this->tokens[ $stackPtr ]['content']; + + if ( preg_match_all( self::WP_REGEX, $content, $matches, ( \PREG_PATTERN_ORDER | \PREG_OFFSET_CAPTURE ) ) > 0 ) { + /* + * Prevent some typical false positives. + */ + if ( isset( $this->text_and_comment_tokens[ $this->tokens[ $stackPtr ]['code'] ] ) ) { + $offset = 0; + foreach ( $matches[1] as $key => $match_data ) { + $next_offset = ( $match_data[1] + \strlen( $match_data[0] ) ); + + // Prevent matches on part of a URL. + if ( preg_match( '`http[s]?://[^\s<>\'"()]*' . preg_quote( $match_data[0], '`' ) . '`', $content, $discard, 0, $offset ) === 1 ) { + unset( $matches[1][ $key ] ); + } elseif ( preg_match( '`[a-z]+=(["\'])' . preg_quote( $match_data[0], '`' ) . '\1`', $content, $discard, 0, $offset ) === 1 ) { + // Prevent matches on html attributes like: `value="wordpress"`. + unset( $matches[1][ $key ] ); + } elseif ( preg_match( '`\\\\\'' . preg_quote( $match_data[0], '`' ) . '\\\\\'`', $content, $discard, 0, $offset ) === 1 ) { + // Prevent matches on xpath queries and such: `\'wordpress\'`. + unset( $matches[1][ $key ] ); + } elseif ( preg_match( '`(?:\?|&|&)[a-z0-9_]+=' . preg_quote( $match_data[0], '`' ) . '(?:&|$)`', $content, $discard, 0, $offset ) === 1 ) { + // Prevent matches on url query strings: `?something=wordpress`. + unset( $matches[1][ $key ] ); + } + + $offset = $next_offset; + } + + if ( empty( $matches[1] ) ) { + return; + } + } + + $misspelled = $this->retrieve_misspellings( $matches[1] ); + + if ( empty( $misspelled ) ) { + return; + } + + $code = 'MisspelledInText'; + if ( isset( Tokens::$commentTokens[ $this->tokens[ $stackPtr ]['code'] ] ) ) { + $code = 'MisspelledInComment'; + } + + $fix = $this->phpcsFile->addFixableWarning( + 'Please spell "WordPress" correctly. Found %s misspelling(s): %s', + $stackPtr, + $code, + array( + \count( $misspelled ), + implode( ', ', $misspelled ), + ) + ); + + if ( true === $fix ) { + // Apply fixes based on offset to ensure we don't replace false positives. + $replacement = $content; + foreach ( $matches[1] as $match ) { + $replacement = substr_replace( $replacement, 'WordPress', $match[1], \strlen( $match[0] ) ); + } + + $this->phpcsFile->fixer->replaceToken( $stackPtr, $replacement ); + } + } + } + + /** + * Retrieve a list of misspellings based on an array of matched variations on the target word. + * + * @param array $match_stack Array of matched variations of the target word. + * @return array Array containing only the misspelled variants. + */ + protected function retrieve_misspellings( $match_stack ) { + $misspelled = array(); + foreach ( $match_stack as $match ) { + // Deal with multi-dimensional arrays when capturing offset. + if ( \is_array( $match ) ) { + $match = $match[0]; + } + + if ( 'WordPress' !== $match ) { + $misspelled[] = $match; + } + } + + return $misspelled; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php new file mode 100644 index 00000000..7de22afd --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php @@ -0,0 +1,897 @@ +class_groups as $name ) { + $name_lc = $name . '_lc'; + $this->$name_lc = array_map( 'strtolower', $this->$name ); + $this->$name = array_combine( $this->$name_lc, $this->$name ); + } + } + + /** + * Groups of classes to restrict. + * + * @since 3.0.0 + * + * @return array + */ + public function getGroups() { + $groups = array(); + foreach ( $this->class_groups as $name ) { + $name_lc = $name . '_lc'; + $groups[ $name ] = array( + 'classes' => $this->$name_lc, + ); + } + + return $groups; + } + + /** + * Process a matched token. + * + * @since 3.0.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. Will + * always be 'wp_classes'. + * @param string $matched_content The token content (class name) which was matched. + * in its original case. + * + * @return void + */ + public function process_matched_token( $stackPtr, $group_name, $matched_content ) { + + $matched_unqualified = ltrim( $matched_content, '\\' ); + $matched_lowercase = strtolower( $matched_unqualified ); + $matched_proper_case = $this->get_proper_case( $matched_lowercase ); + + if ( $matched_unqualified === $matched_proper_case ) { + // Already using proper case, nothing to do. + return; + } + + $warning = 'It is strongly recommended to refer to classes by their properly cased name. Expected: %s Found: %s'; + $data = array( + $matched_proper_case, + $matched_unqualified, + ); + + $this->phpcsFile->addWarning( $warning, $stackPtr, 'Incorrect', $data ); + } + + /** + * Match a lowercase class name to its proper cased name. + * + * @since 3.0.0 + * + * @param string $matched_lc Lowercase class name. + * + * @return string + */ + private function get_proper_case( $matched_lc ) { + foreach ( $this->class_groups as $name ) { + $current = $this->$name; // Needed to prevent issues with PHP < 7.0. + if ( isset( $current[ $matched_lc ] ) ) { + return $current[ $matched_lc ]; + } + } + + // Shouldn't be possible. + return ''; // @codeCoverageIgnore + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php new file mode 100644 index 00000000..fd48e1a2 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php @@ -0,0 +1,321 @@ + 60, + 'HOUR_IN_SECONDS' => 3600, + 'DAY_IN_SECONDS' => 86400, + 'WEEK_IN_SECONDS' => 604800, + 'MONTH_IN_SECONDS' => 2592000, + 'YEAR_IN_SECONDS' => 31536000, + ); + + /** + * Function within which the hook should be found. + * + * @var array + */ + protected $valid_functions = array( + 'add_filter' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() { + return Tokens::$stringTokens; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function process_token( $stackPtr ) { + $token = $this->tokens[ $stackPtr ]; + + if ( 'cron_schedules' !== TextStrings::stripQuotes( $token['content'] ) ) { + return; + } + + // Check if the text was found within a function call to add_filter(). + $functionPtr = ContextHelper::is_in_function_call( $this->phpcsFile, $stackPtr, $this->valid_functions ); + if ( false === $functionPtr ) { + return; + } + + $callback = PassedParameters::getParameter( $this->phpcsFile, $functionPtr, 2, 'callback' ); + if ( false === $callback ) { + return; + } + + if ( $stackPtr >= $callback['start'] && $stackPtr <= $callback['end'] ) { + // "cron_schedules" found in the second parameter, not the first. + return; + } + + // Detect callback function name. + $callbackArrayPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, $callback['start'], ( $callback['end'] + 1 ), true ); + + // If callback is array, get second element. + if ( false !== $callbackArrayPtr + && ( \T_ARRAY === $this->tokens[ $callbackArrayPtr ]['code'] + || ( isset( Collections::shortArrayListOpenTokensBC()[ $this->tokens[ $callbackArrayPtr ]['code'] ] ) + && Arrays::isShortArray( $this->phpcsFile, $callbackArrayPtr ) === true ) + ) + ) { + $callback = PassedParameters::getParameter( $this->phpcsFile, $callbackArrayPtr, 2 ); + + if ( false === $callback ) { + $this->confused( $stackPtr ); + return; + } + } + + unset( $functionPtr ); + + // Search for the function in tokens. + $search = Tokens::$stringTokens; + $search[ \T_CLOSURE ] = \T_CLOSURE; + $search[ \T_FN ] = \T_FN; + $search[ \T_ELLIPSIS ] = \T_ELLIPSIS; + $callbackFunctionPtr = $this->phpcsFile->findNext( $search, $callback['start'], ( $callback['end'] + 1 ) ); + + if ( false === $callbackFunctionPtr ) { + $this->confused( $stackPtr ); + return; + } + + if ( \T_CLOSURE === $this->tokens[ $callbackFunctionPtr ]['code'] + || \T_FN === $this->tokens[ $callbackFunctionPtr ]['code'] + ) { + $functionPtr = $callbackFunctionPtr; + } elseif ( \T_ELLIPSIS === $this->tokens[ $callbackFunctionPtr ]['code'] ) { + // Check if this is a PHP 8.1 first class callable. + $before = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $callbackFunctionPtr - 1 ), null, true ); + $after = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $callbackFunctionPtr + 1 ), null, true ); + if ( ( false !== $before && \T_OPEN_PARENTHESIS === $this->tokens[ $before ]['code'] ) + && ( false !== $after && \T_CLOSE_PARENTHESIS === $this->tokens[ $after ]['code'] ) + ) { + // Ok, now see if we can find the function name. + $beforeOpen = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $before - 1 ), null, true ); + if ( false !== $beforeOpen && \T_STRING === $this->tokens[ $beforeOpen ]['code'] ) { + $found_function = $this->find_function_by_name( $this->tokens[ $beforeOpen ]['content'] ); + if ( false !== $found_function ) { + $functionPtr = $found_function; + } + } + } + unset( $before, $after, $beforeOpen ); + } else { + $functionName = TextStrings::stripQuotes( $this->tokens[ $callbackFunctionPtr ]['content'] ); + $found_function = $this->find_function_by_name( $functionName ); + if ( false !== $found_function ) { + $functionPtr = $found_function; + } + } + + if ( ! isset( $functionPtr ) ) { + $this->confused( $stackPtr ); + return; + } + + if ( ! isset( $this->tokens[ $functionPtr ]['scope_opener'], $this->tokens[ $functionPtr ]['scope_closer'] ) ) { + return; + } + + $opening = $this->tokens[ $functionPtr ]['scope_opener']; + $closing = $this->tokens[ $functionPtr ]['scope_closer']; + for ( $i = $opening; $i <= $closing; $i++ ) { + + if ( isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) === true ) { + if ( 'interval' === TextStrings::stripQuotes( $this->tokens[ $i ]['content'] ) ) { + $operator = $this->phpcsFile->findNext( \T_DOUBLE_ARROW, $i, null, false, null, true ); + if ( false === $operator ) { + $this->confused( $stackPtr ); + return; + } + + $valueStart = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $operator + 1 ), null, true, null, true ); + $valueEnd = $this->phpcsFile->findNext( array( \T_COMMA, \T_CLOSE_PARENTHESIS ), ( $valueStart + 1 ) ); + $value = ''; + $parentheses_count = 0; + for ( $j = $valueStart; $j <= $valueEnd; $j++ ) { + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $j ]['code'] ] ) ) { + continue; + } + + if ( \T_NS_SEPARATOR === $this->tokens[ $j ]['code'] ) { + $value .= ' '; + continue; + } + + if ( $j === $valueEnd && \T_COMMA === $this->tokens[ $j ]['code'] ) { + break; + } + + // Make sure that PHP 7.4 numeric literals and PHP 8.1 explicit octals don't cause problems. + if ( \T_LNUMBER === $this->tokens[ $j ]['code'] + || \T_DNUMBER === $this->tokens[ $j ]['code'] + ) { + $number_info = Numbers::getCompleteNumber( $this->phpcsFile, $j ); + $value .= $number_info['decimal']; + $j = $number_info['last_token']; + continue; + } + + if ( \T_OPEN_PARENTHESIS === $this->tokens[ $j ]['code'] ) { + $value .= $this->tokens[ $j ]['content']; + ++$parentheses_count; + continue; + } + + if ( \T_CLOSE_PARENTHESIS === $this->tokens[ $j ]['code'] ) { + // Only add a close parenthesis if there are open parentheses. + if ( $parentheses_count > 0 ) { + $value .= $this->tokens[ $j ]['content']; + --$parentheses_count; + } + continue; + } + + $value .= $this->tokens[ $j ]['content']; + } + + if ( $parentheses_count > 0 ) { + // Make sure all open parenthesis are closed. + $value .= str_repeat( ')', $parentheses_count ); + } + + if ( is_numeric( $value ) ) { + $interval = $value; + break; + } + + // Deal correctly with WP time constants. + $value = str_replace( array_keys( $this->wp_time_constants ), array_values( $this->wp_time_constants ), $value ); + + // If all parentheses, digits and operators, eval! + if ( preg_match( '#^[\s\d()+*/-]+$#', $value ) > 0 ) { + $interval = eval( "return ( $value );" ); // phpcs:ignore Squiz.PHP.Eval -- No harm here. + break; + } + + $this->confused( $stackPtr ); + return; + } + } + } + + $this->min_interval = (int) $this->min_interval; + + if ( isset( $interval ) && $interval < $this->min_interval ) { + $minutes = round( ( $this->min_interval / 60 ), 1 ); + $this->phpcsFile->addWarning( + 'Scheduling crons at %s sec ( less than %s minutes ) is discouraged.', + $stackPtr, + 'CronSchedulesInterval', + array( + $interval, + $minutes, + ) + ); + return; + } + } + + /** + * Find a declared function in a file based on the function name. + * + * @param string $functionName The name of the function to find. + * + * @return int|false Integer stack pointer to the function keyword token or + * false if not found. + */ + private function find_function_by_name( $functionName ) { + $functionPtr = false; + for ( $ptr = 0; $ptr < $this->phpcsFile->numTokens; $ptr++ ) { + if ( \T_FUNCTION === $this->tokens[ $ptr ]['code'] ) { + $foundName = FunctionDeclarations::getName( $this->phpcsFile, $ptr ); + if ( $foundName === $functionName ) { + $functionPtr = $ptr; + break; + } elseif ( isset( $this->tokens[ $ptr ]['scope_closer'] ) ) { + // Skip to the end of the function definition. + $ptr = $this->tokens[ $ptr ]['scope_closer']; + } + } + } + + return $functionPtr; + } + + /** + * Add warning about unclear cron schedule change. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function confused( $stackPtr ) { + $this->phpcsFile->addWarning( + 'Detected changing of cron_schedules, but could not detect the interval value.', + $stackPtr, + 'ChangeDetected' + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php new file mode 100644 index 00000000..dc512c20 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php @@ -0,0 +1,152 @@ + value + * in a custom ruleset. + * + * @uses \WordPressCS\WordPress\Helpers\MinimumWPVersionTrait::$minimum_wp_version + */ +final class DeprecatedClassesSniff extends AbstractClassRestrictionsSniff { + + use MinimumWPVersionTrait; + + /** + * List of deprecated classes with alternative when available. + * + * To be updated after every major release. + * + * Version numbers should be fully qualified. + * + * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} + * + * @var array + */ + private $deprecated_classes = array( + + // WP 3.1.0. + 'WP_User_Search' => array( + 'alt' => 'WP_User_Query', + 'version' => '3.1.0', + ), + + // WP 3.7.0. + 'WP_HTTP_Fsockopen' => array( + 'alt' => 'WP_HTTP::request()', + 'version' => '3.7.0', + ), + + // WP 4.9.0. + 'WP_Customize_New_Menu_Section' => array( + 'version' => '4.9.0', + ), + 'WP_Customize_New_Menu_Control' => array( + 'version' => '4.9.0', + ), + + // WP 5.3.0. + 'WP_Privacy_Data_Export_Requests_Table' => array( + 'alt' => 'WP_Privacy_Data_Export_Requests_List_Table', + 'version' => '5.3.0', + ), + 'WP_Privacy_Data_Removal_Requests_Table' => array( + 'alt' => 'WP_Privacy_Data_Removal_Requests_List_Table', + 'version' => '5.3.0', + ), + 'Services_JSON' => array( + 'alt' => 'The PHP native JSON extension', + 'version' => '5.3.0', + ), + 'Services_JSON_Error' => array( + 'alt' => 'The PHP native JSON extension', + 'version' => '5.3.0', + ), + + // WP 6.4.0. + 'WP_Http_Curl' => array( + 'alt' => 'WP_Http', + 'version' => '6.4.0', + ), + 'WP_Http_Streams' => array( + 'alt' => 'WP_Http', + 'version' => '6.4.0', + ), + ); + + /** + * Groups of classes to restrict. + * + * @return array + */ + public function getGroups() { + // Make sure all array keys are lowercase. + $this->deprecated_classes = array_change_key_case( $this->deprecated_classes, \CASE_LOWER ); + + return array( + 'deprecated_classes' => array( + 'classes' => array_keys( $this->deprecated_classes ), + ), + ); + } + + /** + * Process a matched token. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. Will + * always be 'deprecated_classes'. + * @param string $matched_content The token content (class name) which was matched + * in its original case. + * + * @return void + */ + public function process_matched_token( $stackPtr, $group_name, $matched_content ) { + + $this->set_minimum_wp_version(); + + $class_name = ltrim( strtolower( $matched_content ), '\\' ); + + $message = 'The %s class has been deprecated since WordPress version %s.'; + $data = array( + ltrim( $matched_content, '\\' ), + $this->deprecated_classes[ $class_name ]['version'], + ); + + if ( ! empty( $this->deprecated_classes[ $class_name ]['alt'] ) ) { + $message .= ' Use %s instead.'; + $data[] = $this->deprecated_classes[ $class_name ]['alt']; + } + + MessageHelper::addMessage( + $this->phpcsFile, + $message, + $stackPtr, + ( $this->wp_version_compare( $this->deprecated_classes[ $class_name ]['version'], $this->minimum_wp_version, '<' ) ), + MessageHelper::stringToErrorcode( $class_name . 'Found' ), + $data + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php new file mode 100644 index 00000000..1b55b919 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php @@ -0,0 +1,1708 @@ + value + * in a custom ruleset. + * + * @uses \WordPressCS\WordPress\Helpers\MinimumWPVersionTrait::$minimum_wp_version + */ +final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff { + + use MinimumWPVersionTrait; + + /** + * List of deprecated functions with alternative when available. + * + * Version numbers should be fully qualified. + * Replacement functions should have parentheses. + * + * To retrieve a function list for comparison, the following tool is available: + * https://github.com/JDGrimes/wp-deprecated-code-scanner + * + * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} + * + * @var array + */ + private $deprecated_functions = array( + // WP 0.71. + 'the_category_head' => array( + 'alt' => 'get_the_category_by_ID()', + 'version' => '0.71', + ), + 'the_category_ID' => array( + 'alt' => 'get_the_category()', + 'version' => '0.71', + ), + + // WP 1.2.0. + 'permalink_link' => array( + 'alt' => 'the_permalink()', + 'version' => '1.2.0', + ), + + // WP 1.5.0. + 'start_wp' => array( + // Verified correct alternative. + 'alt' => 'the Loop', + 'version' => '1.5.0', + ), + + // WP 1.5.1. + 'get_postdata' => array( + 'alt' => 'get_post()', + 'version' => '1.5.1', + ), + + // WP 2.0.0. + 'create_user' => array( + 'alt' => 'wp_create_user()', + 'version' => '2.0.0', + ), + 'next_post' => array( + 'alt' => 'next_post_link()', + 'version' => '2.0.0', + ), + 'previous_post' => array( + 'alt' => 'previous_post_link()', + 'version' => '2.0.0', + ), + 'user_can_create_draft' => array( + 'alt' => 'current_user_can()', + 'version' => '2.0.0', + ), + 'user_can_create_post' => array( + 'alt' => 'current_user_can()', + 'version' => '2.0.0', + ), + 'user_can_delete_post' => array( + 'alt' => 'current_user_can()', + 'version' => '2.0.0', + ), + 'user_can_delete_post_comments' => array( + 'alt' => 'current_user_can()', + 'version' => '2.0.0', + ), + 'user_can_edit_post' => array( + 'alt' => 'current_user_can()', + 'version' => '2.0.0', + ), + 'user_can_edit_post_comments' => array( + 'alt' => 'current_user_can()', + 'version' => '2.0.0', + ), + 'user_can_edit_post_date' => array( + 'alt' => 'current_user_can()', + 'version' => '2.0.0', + ), + 'user_can_edit_user' => array( + 'alt' => 'current_user_can()', + 'version' => '2.0.0', + ), + 'user_can_set_post_date' => array( + 'alt' => 'current_user_can()', + 'version' => '2.0.0', + ), + + // WP 2.1.0. + 'dropdown_cats' => array( + 'alt' => 'wp_dropdown_categories()', + 'version' => '2.1.0', + ), + 'get_archives' => array( + 'alt' => 'wp_get_archives()', + 'version' => '2.1.0', + ), + 'get_author_link' => array( + 'alt' => 'get_author_posts_url()', + 'version' => '2.1.0', + ), + 'get_autotoggle' => array( + 'alt' => '', + 'version' => '2.1.0', + ), + 'get_link' => array( + 'alt' => 'get_bookmark()', + 'version' => '2.1.0', + ), + 'get_linkcatname' => array( + 'alt' => 'get_category()', + 'version' => '2.1.0', + ), + 'get_linkobjects' => array( + 'alt' => 'get_bookmarks()', + 'version' => '2.1.0', + ), + 'get_linkobjectsbyname' => array( + 'alt' => 'get_bookmarks()', + 'version' => '2.1.0', + ), + 'get_linkrating' => array( + 'alt' => 'sanitize_bookmark_field()', + 'version' => '2.1.0', + ), + 'get_links' => array( + 'alt' => 'get_bookmarks()', + 'version' => '2.1.0', + ), + 'get_links_list' => array( + 'alt' => 'wp_list_bookmarks()', + 'version' => '2.1.0', + ), + 'get_links_withrating' => array( + 'alt' => 'get_bookmarks()', + 'version' => '2.1.0', + ), + 'get_linksbyname' => array( + 'alt' => 'get_bookmarks()', + 'version' => '2.1.0', + ), + 'get_linksbyname_withrating' => array( + 'alt' => 'get_bookmarks()', + 'version' => '2.1.0', + ), + 'get_settings' => array( + 'alt' => 'get_option()', + 'version' => '2.1.0', + ), + 'link_pages' => array( + 'alt' => 'wp_link_pages()', + 'version' => '2.1.0', + ), + 'links_popup_script' => array( + 'alt' => '', + 'version' => '2.1.0', + ), + 'list_authors' => array( + 'alt' => 'wp_list_authors()', + 'version' => '2.1.0', + ), + 'list_cats' => array( + 'alt' => 'wp_list_categories()', + 'version' => '2.1.0', + ), + 'tinymce_include' => array( + 'alt' => 'wp_editor()', + 'version' => '2.1.0', + ), + 'wp_get_links' => array( + 'alt' => 'wp_list_bookmarks()', + 'version' => '2.1.0', + ), + 'wp_get_linksbyname' => array( + 'alt' => 'wp_list_bookmarks()', + 'version' => '2.1.0', + ), + 'wp_get_post_cats' => array( + 'alt' => 'wp_get_post_categories()', + 'version' => '2.1.0', + ), + 'wp_list_cats' => array( + 'alt' => 'wp_list_categories()', + 'version' => '2.1.0', + ), + 'wp_set_post_cats' => array( + 'alt' => 'wp_set_post_categories()', + 'version' => '2.1.0', + ), + + // WP 2.2.0. + 'comments_rss' => array( + 'alt' => 'get_post_comments_feed_link()', + 'version' => '2.2.0', + ), + + // WP 2.3.0. + 'permalink_single_rss' => array( + 'alt' => 'the_permalink_rss()', + 'version' => '2.3.0', + ), + + // WP 2.5.0. + 'comments_rss_link' => array( + 'alt' => 'post_comments_feed_link()', + 'version' => '2.5.0', + ), + 'documentation_link' => array( + 'alt' => '', + 'version' => '2.5.0', + ), + 'get_attachment_icon' => array( + 'alt' => 'wp_get_attachment_image()', + 'version' => '2.5.0', + ), + 'get_attachment_icon_src' => array( + 'alt' => 'wp_get_attachment_image_src()', + 'version' => '2.5.0', + ), + 'get_attachment_innerHTML' => array( + 'alt' => 'wp_get_attachment_image()', + 'version' => '2.5.0', + ), + 'get_author_rss_link' => array( + 'alt' => 'get_author_feed_link()', + 'version' => '2.5.0', + ), + 'get_category_rss_link' => array( + 'alt' => 'get_category_feed_link()', + 'version' => '2.5.0', + ), + 'get_the_attachment_link' => array( + 'alt' => 'wp_get_attachment_link()', + 'version' => '2.5.0', + ), + 'gzip_compression' => array( + 'alt' => '', + 'version' => '2.5.0', + ), + 'wp_clearcookie' => array( + 'alt' => 'wp_clear_auth_cookie()', + 'version' => '2.5.0', + ), + 'wp_get_cookie_login' => array( + 'alt' => '', + 'version' => '2.5.0', + ), + 'wp_login' => array( + 'alt' => 'wp_signon()', + 'version' => '2.5.0', + ), + 'wp_setcookie' => array( + 'alt' => 'wp_set_auth_cookie()', + 'version' => '2.5.0', + ), + + // WP 2.6.0. + 'dropdown_categories' => array( + 'alt' => 'wp_category_checklist()', + 'version' => '2.6.0', + ), + 'dropdown_link_categories' => array( + 'alt' => 'wp_link_category_checklist()', + 'version' => '2.6.0', + ), + + // WP 2.7.0. + 'get_commentdata' => array( + 'alt' => 'get_comment()', + 'version' => '2.7.0', + ), + // This is a method i.e. WP_Filesystem_Base::find_base_dir() See #731. + 'find_base_dir' => array( + 'alt' => 'WP_Filesystem::abspath()', + 'version' => '2.7.0', + ), + // This is a method i.e. WP_Filesystem_Base::get_base_dir() See #731. + 'get_base_dir' => array( + 'alt' => 'WP_Filesystem::abspath()', + 'version' => '2.7.0', + ), + + // WP 2.8.0. + '__ngettext' => array( + 'alt' => '_n()', + 'version' => '2.8.0', + ), + '__ngettext_noop' => array( + 'alt' => '_n_noop()', + 'version' => '2.8.0', + ), + 'attribute_escape' => array( + 'alt' => 'esc_attr()', + 'version' => '2.8.0', + ), + 'get_author_name' => array( + 'alt' => 'get_the_author_meta(\'display_name\')', + 'version' => '2.8.0', + ), + 'get_category_children' => array( + 'alt' => 'get_term_children()', + 'version' => '2.8.0', + ), + 'get_catname' => array( + 'alt' => 'get_cat_name()', + 'version' => '2.8.0', + ), + 'get_the_author_aim' => array( + 'alt' => 'get_the_author_meta(\'aim\')', + 'version' => '2.8.0', + ), + 'get_the_author_description' => array( + 'alt' => 'get_the_author_meta(\'description\')', + 'version' => '2.8.0', + ), + 'get_the_author_email' => array( + 'alt' => 'get_the_author_meta(\'email\')', + 'version' => '2.8.0', + ), + 'get_the_author_firstname' => array( + 'alt' => 'get_the_author_meta(\'first_name\')', + 'version' => '2.8.0', + ), + 'get_the_author_icq' => array( + 'alt' => 'get_the_author_meta(\'icq\')', + 'version' => '2.8.0', + ), + 'get_the_author_ID' => array( + 'alt' => 'get_the_author_meta(\'ID\')', + 'version' => '2.8.0', + ), + 'get_the_author_lastname' => array( + 'alt' => 'get_the_author_meta(\'last_name\')', + 'version' => '2.8.0', + ), + 'get_the_author_login' => array( + 'alt' => 'get_the_author_meta(\'login\')', + 'version' => '2.8.0', + ), + 'get_the_author_msn' => array( + 'alt' => 'get_the_author_meta(\'msn\')', + 'version' => '2.8.0', + ), + 'get_the_author_nickname' => array( + 'alt' => 'get_the_author_meta(\'nickname\')', + 'version' => '2.8.0', + ), + 'get_the_author_url' => array( + 'alt' => 'get_the_author_meta(\'url\')', + 'version' => '2.8.0', + ), + 'get_the_author_yim' => array( + 'alt' => 'get_the_author_meta(\'yim\')', + 'version' => '2.8.0', + ), + 'js_escape' => array( + 'alt' => 'esc_js()', + 'version' => '2.8.0', + ), + 'register_sidebar_widget' => array( + 'alt' => 'wp_register_sidebar_widget()', + 'version' => '2.8.0', + ), + 'register_widget_control' => array( + 'alt' => 'wp_register_widget_control()', + 'version' => '2.8.0', + ), + 'the_author_aim' => array( + 'alt' => 'the_author_meta(\'aim\')', + 'version' => '2.8.0', + ), + 'the_author_description' => array( + 'alt' => 'the_author_meta(\'description\')', + 'version' => '2.8.0', + ), + 'the_author_email' => array( + 'alt' => 'the_author_meta(\'email\')', + 'version' => '2.8.0', + ), + 'the_author_firstname' => array( + 'alt' => 'the_author_meta(\'first_name\')', + 'version' => '2.8.0', + ), + 'the_author_icq' => array( + 'alt' => 'the_author_meta(\'icq\')', + 'version' => '2.8.0', + ), + 'the_author_ID' => array( + 'alt' => 'the_author_meta(\'ID\')', + 'version' => '2.8.0', + ), + 'the_author_lastname' => array( + 'alt' => 'the_author_meta(\'last_name\')', + 'version' => '2.8.0', + ), + 'the_author_login' => array( + 'alt' => 'the_author_meta(\'login\')', + 'version' => '2.8.0', + ), + 'the_author_msn' => array( + 'alt' => 'the_author_meta(\'msn\')', + 'version' => '2.8.0', + ), + 'the_author_nickname' => array( + 'alt' => 'the_author_meta(\'nickname\')', + 'version' => '2.8.0', + ), + 'the_author_url' => array( + 'alt' => 'the_author_meta(\'url\')', + 'version' => '2.8.0', + ), + 'the_author_yim' => array( + 'alt' => 'the_author_meta(\'yim\')', + 'version' => '2.8.0', + ), + 'unregister_sidebar_widget' => array( + 'alt' => 'wp_unregister_sidebar_widget()', + 'version' => '2.8.0', + ), + 'unregister_widget_control' => array( + 'alt' => 'wp_unregister_widget_control()', + 'version' => '2.8.0', + ), + 'wp_specialchars' => array( + 'alt' => 'esc_html()', + 'version' => '2.8.0', + ), + + // WP 2.9.0. + '_c' => array( + 'alt' => '_x()', + 'version' => '2.9.0', + ), + '_nc' => array( + 'alt' => '_nx()', + 'version' => '2.9.0', + ), + 'get_real_file_to_edit' => array( + 'alt' => '', + 'version' => '2.9.0', + ), + 'make_url_footnote' => array( + 'alt' => '', + 'version' => '2.9.0', + ), + 'the_content_rss' => array( + 'alt' => 'the_content_feed()', + 'version' => '2.9.0', + ), + 'translate_with_context' => array( + 'alt' => '_x()', + 'version' => '2.9.0', + ), + + // WP 3.0.0. + 'activate_sitewide_plugin' => array( + 'alt' => 'activate_plugin()', + 'version' => '3.0.0', + ), + 'add_option_update_handler' => array( + 'alt' => 'register_setting()', + 'version' => '3.0.0', + ), + 'automatic_feed_links' => array( + 'alt' => 'add_theme_support( \'automatic-feed-links\' )', + 'version' => '3.0.0', + ), + 'clean_url' => array( + 'alt' => 'esc_url()', + 'version' => '3.0.0', + ), + 'clear_global_post_cache' => array( + 'alt' => 'clean_post_cache()', + 'version' => '3.0.0', + ), + 'codepress_footer_js' => array( + 'alt' => '', + 'version' => '3.0.0', + ), + 'codepress_get_lang' => array( + 'alt' => '', + 'version' => '3.0.0', + ), + 'deactivate_sitewide_plugin' => array( + 'alt' => 'deactivate_plugin()', + 'version' => '3.0.0', + ), + 'delete_usermeta' => array( + 'alt' => 'delete_user_meta()', + 'version' => '3.0.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'funky_javascript_callback' => array( + 'alt' => '', + 'version' => '3.0.0', + ), + 'funky_javascript_fix' => array( + 'alt' => '', + 'version' => '3.0.0', + ), + 'generate_random_password' => array( + 'alt' => 'wp_generate_password()', + 'version' => '3.0.0', + ), + 'get_alloptions' => array( + 'alt' => 'wp_load_alloptions()', + 'version' => '3.0.0', + ), + 'get_blog_list' => array( + 'alt' => 'wp_get_sites()', + 'version' => '3.0.0', + ), + 'get_most_active_blogs' => array( + 'alt' => '', + 'version' => '3.0.0', + ), + 'get_profile' => array( + 'alt' => 'get_the_author_meta()', + 'version' => '3.0.0', + ), + 'get_user_details' => array( + 'alt' => 'get_user_by()', + 'version' => '3.0.0', + ), + 'get_usermeta' => array( + 'alt' => 'get_user_meta()', + 'version' => '3.0.0', + ), + 'get_usernumposts' => array( + 'alt' => 'count_user_posts()', + 'version' => '3.0.0', + ), + 'graceful_fail' => array( + 'alt' => 'wp_die()', + 'version' => '3.0.0', + ), + // Verified version & alternative. + 'install_blog_defaults' => array( + 'alt' => 'wp_install_defaults', + 'version' => '3.0.0', + ), + 'is_main_blog' => array( + 'alt' => 'is_main_site()', + 'version' => '3.0.0', + ), + 'is_site_admin' => array( + 'alt' => 'is_super_admin()', + 'version' => '3.0.0', + ), + 'is_taxonomy' => array( + 'alt' => 'taxonomy_exists()', + 'version' => '3.0.0', + ), + 'is_term' => array( + 'alt' => 'term_exists()', + 'version' => '3.0.0', + ), + 'is_wpmu_sitewide_plugin' => array( + 'alt' => 'is_network_only_plugin()', + 'version' => '3.0.0', + ), + 'mu_options' => array( + 'alt' => '', + 'version' => '3.0.0', + ), + 'remove_option_update_handler' => array( + 'alt' => 'unregister_setting()', + 'version' => '3.0.0', + ), + 'set_current_user' => array( + 'alt' => 'wp_set_current_user()', + 'version' => '3.0.0', + ), + 'update_usermeta' => array( + 'alt' => 'update_user_meta()', + 'version' => '3.0.0', + ), + 'use_codepress' => array( + 'alt' => '', + 'version' => '3.0.0', + ), + 'validate_email' => array( + 'alt' => 'is_email()', + 'version' => '3.0.0', + ), + 'wp_dropdown_cats' => array( + 'alt' => 'wp_dropdown_categories()', + 'version' => '3.0.0', + ), + 'wp_shrink_dimensions' => array( + 'alt' => 'wp_constrain_dimensions()', + 'version' => '3.0.0', + ), + 'wpmu_checkAvailableSpace' => array( + 'alt' => 'is_upload_space_available()', + 'version' => '3.0.0', + ), + 'wpmu_menu' => array( + 'alt' => '', + 'version' => '3.0.0', + ), + + // WP 3.1.0. + 'get_author_user_ids' => array( + 'alt' => 'get_users()', + 'version' => '3.1.0', + ), + 'get_dashboard_blog' => array( + 'alt' => 'get_site()', + 'version' => '3.1.0', + ), + 'get_editable_authors' => array( + 'alt' => 'get_users()', + 'version' => '3.1.0', + ), + 'get_editable_user_ids' => array( + 'alt' => 'get_users()', + 'version' => '3.1.0', + ), + 'get_nonauthor_user_ids' => array( + 'alt' => 'get_users()', + 'version' => '3.1.0', + ), + 'get_others_drafts' => array( + 'alt' => '', + 'version' => '3.1.0', + ), + 'get_others_pending' => array( + 'alt' => '', + 'version' => '3.1.0', + ), + 'get_others_unpublished_posts' => array( + 'alt' => '', + 'version' => '3.1.0', + ), + 'get_users_of_blog' => array( + 'alt' => 'get_users()', + 'version' => '3.1.0', + ), + 'install_themes_feature_list' => array( + 'alt' => 'get_theme_feature_list()', + 'version' => '3.1.0', + ), + 'is_plugin_page' => array( + // Verified correct alternative. + 'alt' => 'global $plugin_page and/or get_plugin_page_hookname() hooks', + 'version' => '3.1.0', + ), + 'update_category_cache' => array( + 'alt' => '', + 'version' => '3.1.0', + ), + + // WP 3.2.0. + 'favorite_actions' => array( + 'alt' => 'WP_Admin_Bar', + 'version' => '3.2.0', + ), + 'wp_dashboard_quick_press_output' => array( + 'alt' => 'wp_dashboard_quick_press()', + 'version' => '3.2.0', + ), + 'wp_timezone_supported' => array( + 'alt' => '', + 'version' => '3.2.0', + ), + + // WP 3.3.0. + 'add_contextual_help' => array( + 'alt' => 'get_current_screen()->add_help_tab()', + 'version' => '3.3.0', + ), + 'get_boundary_post_rel_link' => array( + 'alt' => '', + 'version' => '3.3.0', + ), + 'get_index_rel_link' => array( + 'alt' => '', + 'version' => '3.3.0', + ), + 'get_parent_post_rel_link' => array( + 'alt' => '', + 'version' => '3.3.0', + ), + 'get_user_by_email' => array( + 'alt' => 'get_user_by(\'email\')', + 'version' => '3.3.0', + ), + 'get_user_metavalues' => array( + 'alt' => '', + 'version' => '3.3.0', + ), + 'get_userdatabylogin' => array( + 'alt' => 'get_user_by(\'login\')', + 'version' => '3.3.0', + ), + 'index_rel_link' => array( + 'alt' => '', + 'version' => '3.3.0', + ), + 'is_blog_user' => array( + 'alt' => 'is_user_member_of_blog()', + 'version' => '3.3.0', + ), + 'media_upload_audio' => array( + 'alt' => 'wp_media_upload_handler()', + 'version' => '3.3.0', + ), + 'media_upload_file' => array( + 'alt' => 'wp_media_upload_handler()', + 'version' => '3.3.0', + ), + 'media_upload_image' => array( + 'alt' => 'wp_media_upload_handler()', + 'version' => '3.3.0', + ), + 'media_upload_video' => array( + 'alt' => 'wp_media_upload_handler()', + 'version' => '3.3.0', + ), + 'parent_post_rel_link' => array( + 'alt' => '', + 'version' => '3.3.0', + ), + 'sanitize_user_object' => array( + 'alt' => '', + 'version' => '3.3.0', + ), + 'screen_layout' => array( + 'alt' => '$current_screen->render_screen_layout()', + 'version' => '3.3.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'screen_meta' => array( + 'alt' => '$current_screen->render_screen_meta()', + 'version' => '3.3.0', + ), + 'screen_options' => array( + 'alt' => '$current_screen->render_per_page_options()', + 'version' => '3.3.0', + ), + 'start_post_rel_link' => array( + 'alt' => '', + 'version' => '3.3.0', + ), + 'the_editor' => array( + 'alt' => 'wp_editor()', + 'version' => '3.3.0', + ), + 'type_url_form_audio' => array( + 'alt' => 'wp_media_insert_url_form(\'audio\')', + 'version' => '3.3.0', + ), + 'type_url_form_file' => array( + 'alt' => 'wp_media_insert_url_form(\'file\')', + 'version' => '3.3.0', + ), + 'type_url_form_image' => array( + 'alt' => 'wp_media_insert_url_form(\'image\')', + 'version' => '3.3.0', + ), + 'type_url_form_video' => array( + 'alt' => 'wp_media_insert_url_form(\'video\')', + 'version' => '3.3.0', + ), + 'wp_admin_bar_dashboard_view_site_menu' => array( + 'alt' => '', + 'version' => '3.3.0', + ), + 'wp_preload_dialogs' => array( + 'alt' => 'wp_editor()', + 'version' => '3.3.0', + ), + 'wp_print_editor_js' => array( + 'alt' => 'wp_editor()', + 'version' => '3.3.0', + ), + 'wp_quicktags' => array( + 'alt' => 'wp_editor()', + 'version' => '3.3.0', + ), + 'wp_tiny_mce' => array( + 'alt' => 'wp_editor()', + 'version' => '3.3.0', + ), + 'wpmu_admin_do_redirect' => array( + 'alt' => 'wp_redirect()', + 'version' => '3.3.0', + ), + 'wpmu_admin_redirect_add_updated_param' => array( + 'alt' => 'add_query_arg()', + 'version' => '3.3.0', + ), + + // WP 3.4.0. + 'add_custom_background' => array( + 'alt' => 'add_theme_support( \'custom-background\', $args )', + 'version' => '3.4.0', + ), + 'add_custom_image_header' => array( + 'alt' => 'add_theme_support( \'custom-header\', $args )', + 'version' => '3.4.0', + ), + 'clean_page_cache' => array( + 'alt' => 'clean_post_cache()', + 'version' => '3.4.0', + ), + 'clean_pre' => array( + 'alt' => '', + 'version' => '3.4.0', + ), + 'current_theme_info' => array( + 'alt' => 'wp_get_theme()', + 'version' => '3.4.0', + ), + 'debug_fclose' => array( + 'alt' => 'error_log()', + 'version' => '3.4.0', + ), + 'debug_fopen' => array( + 'alt' => 'error_log()', + 'version' => '3.4.0', + ), + 'debug_fwrite' => array( + 'alt' => 'error_log()', + 'version' => '3.4.0', + ), + 'display_theme' => array( + 'alt' => '', + 'version' => '3.4.0', + ), + 'get_allowed_themes' => array( + 'alt' => 'wp_get_themes( array( \'allowed\' => true ) )', + 'version' => '3.4.0', + ), + 'get_broken_themes' => array( + 'alt' => 'wp_get_themes( array( \'errors\' => true )', + 'version' => '3.4.0', + ), + 'get_current_theme' => array( + 'alt' => 'wp_get_theme()', + 'version' => '3.4.0', + ), + 'get_site_allowed_themes' => array( + 'alt' => 'WP_Theme::get_allowed_on_network()', + 'version' => '3.4.0', + ), + 'get_theme' => array( + 'alt' => 'wp_get_theme( $stylesheet )', + 'version' => '3.4.0', + ), + 'get_theme_data' => array( + 'alt' => 'wp_get_theme()', + 'version' => '3.4.0', + ), + 'get_themes' => array( + 'alt' => 'wp_get_themes()', + 'version' => '3.4.0', + ), + 'logIO' => array( + 'alt' => 'error_log()', + 'version' => '3.4.0', + ), + 'remove_custom_background' => array( + 'alt' => 'remove_theme_support( \'custom-background\' )', + 'version' => '3.4.0', + ), + 'remove_custom_image_header' => array( + 'alt' => 'remove_theme_support( \'custom-header\' )', + 'version' => '3.4.0', + ), + 'update_page_cache' => array( + 'alt' => 'update_post_cache()', + 'version' => '3.4.0', + ), + 'wpmu_get_blog_allowedthemes' => array( + 'alt' => 'WP_Theme::get_allowed_on_site()', + 'version' => '3.4.0', + ), + + // WP 3.4.1. + 'wp_explain_nonce' => array( + 'alt' => 'wp_nonce_ays()', + 'version' => '3.4.1', + ), + + // WP 3.5.0. + '_flip_image_resource' => array( + 'alt' => 'WP_Image_Editor::flip()', + 'version' => '3.5.0', + ), + '_get_post_ancestors' => array( + 'alt' => '', + 'version' => '3.5.0', + ), + '_insert_into_post_button' => array( + 'alt' => '', + 'version' => '3.5.0', + ), + '_media_button' => array( + 'alt' => '', + 'version' => '3.5.0', + ), + '_rotate_image_resource' => array( + 'alt' => 'WP_Image_Editor::rotate()', + 'version' => '3.5.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + '_save_post_hook' => array( + 'alt' => '', + 'version' => '3.5.0', + ), + 'gd_edit_image_support' => array( + 'alt' => 'wp_image_editor_supports()', + 'version' => '3.5.0', + ), + 'get_default_page_to_edit' => array( + 'alt' => 'get_default_post_to_edit( \'page\' )', + 'version' => '3.5.0', + ), + 'get_post_to_edit' => array( + 'alt' => 'get_post()', + 'version' => '3.5.0', + ), + 'get_udims' => array( + 'alt' => 'wp_constrain_dimensions()', + 'version' => '3.5.0', + ), + 'image_resize' => array( + 'alt' => 'wp_get_image_editor()', + 'version' => '3.5.0', + ), + 'sticky_class' => array( + 'alt' => 'post_class()', + 'version' => '3.5.0', + ), + 'user_pass_ok' => array( + 'alt' => 'wp_authenticate()', + 'version' => '3.5.0', + ), + 'wp_cache_reset' => array( + 'alt' => 'wp_cache_switch_to_blog()', + 'version' => '3.5.0', + ), + 'wp_create_thumbnail' => array( + 'alt' => 'image_resize()', + 'version' => '3.5.0', + ), + 'wp_get_single_post' => array( + 'alt' => 'get_post()', + 'version' => '3.5.0', + ), + 'wp_load_image' => array( + 'alt' => 'wp_get_image_editor()', + 'version' => '3.5.0', + ), + + // WP 3.6.0. + 'get_user_id_from_string' => array( + 'alt' => 'get_user_by()', + 'version' => '3.6.0', + ), + 'wp_convert_bytes_to_hr' => array( + 'alt' => 'size_format()', + 'version' => '3.6.0', + ), + 'wp_nav_menu_locations_meta_box' => array( + 'alt' => '', + 'version' => '3.6.0', + ), + + // WP 3.7.0. + '_search_terms_tidy' => array( + 'alt' => '', + 'version' => '3.7.0', + ), + 'get_blogaddress_by_domain' => array( + 'alt' => '', + 'version' => '3.7.0', + ), + 'the_attachment_links' => array( + 'alt' => '', + 'version' => '3.7.0', + ), + 'wp_update_core' => array( + 'alt' => 'new Core_Upgrader();', + 'version' => '3.7.0', + ), + 'wp_update_plugin' => array( + 'alt' => 'new Plugin_Upgrader();', + 'version' => '3.7.0', + ), + 'wp_update_theme' => array( + 'alt' => 'new Theme_Upgrader();', + 'version' => '3.7.0', + ), + + // WP 3.8.0. + 'get_screen_icon' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + 'screen_icon' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_dashboard_incoming_links' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_dashboard_incoming_links_control' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_dashboard_incoming_links_output' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_dashboard_plugins' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_dashboard_primary_control' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_dashboard_recent_comments_control' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_dashboard_secondary' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_dashboard_secondary_control' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_dashboard_secondary_output' => array( + 'alt' => '', + 'version' => '3.8.0', + ), + + // WP 3.9.0. + '_relocate_children' => array( + 'alt' => '', + 'version' => '3.9.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'default_topic_count_text' => array( + 'alt' => '', + 'version' => '3.9.0', + ), + 'format_to_post' => array( + 'alt' => '', + 'version' => '3.9.0', + ), + 'get_current_site_name' => array( + 'alt' => 'get_current_site()', + 'version' => '3.9.0', + ), + 'rich_edit_exists' => array( + 'alt' => '', + 'version' => '3.9.0', + ), + 'wpmu_current_site' => array( + 'alt' => '', + 'version' => '3.9.0', + ), + + // WP 4.0.0. + 'get_all_category_ids' => array( + 'alt' => 'get_terms()', + 'version' => '4.0.0', + ), + 'like_escape' => array( + 'alt' => 'wpdb::esc_like()', + 'version' => '4.0.0', + ), + 'url_is_accessable_via_ssl' => array( + 'alt' => '', + 'version' => '4.0.0', + ), + + // WP 4.1.0. + // This is a method from the WP_Customize_Image_Control class. See #731. + 'add_tab' => array( + 'alt' => '', + 'version' => '4.1.0', + ), + // This is a method from the WP_Customize_Image_Control class. See #731. + 'prepare_control' => array( + 'alt' => '', + 'version' => '4.1.0', + ), + // This is a method from the WP_Customize_Image_Control class. See #731. + 'print_tab_image' => array( + 'alt' => '', + 'version' => '4.1.0', + ), + // This is a method from the WP_Customize_Image_Control class. See #731. + 'remove_tab' => array( + 'alt' => '', + 'version' => '4.1.0', + ), + + // WP 4.2.0. + // This is a method from the WP_Customize_Widgets class. See #731. + 'prepreview_added_sidebars_widgets' => array( + 'alt' => 'the \'customize_dynamic_setting_args\' filter', + 'version' => '4.2.0', + ), + // This is a method from the WP_Customize_Widgets class. See #731. + 'prepreview_added_widget_instance' => array( + 'alt' => 'the \'customize_dynamic_setting_args\' filter', + 'version' => '4.2.0', + ), + // This is a method from the WP_Customize_Widgets class. See #731. + 'remove_prepreview_filters' => array( + 'alt' => 'the \'customize_dynamic_setting_args\' filter', + 'version' => '4.2.0', + ), + // This is a method from the WP_Customize_Widgets class. See #731. + 'setup_widget_addition_previews' => array( + 'alt' => 'the \'customize_dynamic_setting_args\' filter', + 'version' => '4.2.0', + ), + + // WP 4.3.0. + '_preview_theme_stylesheet_filter' => array( + 'alt' => '', + 'version' => '4.3.0', + ), + '_preview_theme_template_filter' => array( + 'alt' => '', + 'version' => '4.3.0', + ), + 'preview_theme' => array( + 'alt' => '', + 'version' => '4.3.0', + ), + 'preview_theme_ob_filter' => array( + 'alt' => '', + 'version' => '4.3.0', + ), + 'preview_theme_ob_filter_callback' => array( + 'alt' => '', + 'version' => '4.3.0', + ), + // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. + 'wp_ajax_wp_fullscreen_save_post' => array( + 'alt' => '', + 'version' => '4.3.0', + ), + 'wp_htmledit_pre' => array( + 'alt' => 'format_for_editor()', + 'version' => '4.3.0', + ), + 'wp_richedit_pre' => array( + 'alt' => 'format_for_editor()', + 'version' => '4.3.0', + ), + + // WP 4.4.0. + 'create_empty_blog' => array( + 'alt' => '', + 'version' => '4.4.0', + ), + 'force_ssl_login' => array( + 'alt' => 'force_ssl_admin()', + 'version' => '4.4.0', + ), + 'get_admin_users_for_domain' => array( + 'alt' => '', + 'version' => '4.4.0', + ), + 'post_permalink' => array( + 'alt' => 'get_permalink()', + 'version' => '4.4.0', + ), + 'wp_get_http' => array( + 'alt' => 'the WP_Http class', + 'version' => '4.4.0', + ), + // This is a method i.e. WP_Widget_Recent_Comments::flush_widget_cache() See #731. + 'flush_widget_cache' => array( + 'alt' => '', + 'version' => '4.4.0', + ), + + // WP 4.5.0. + 'add_object_page' => array( + 'alt' => 'add_menu_page()', + 'version' => '4.5.0', + ), + 'add_utility_page' => array( + 'alt' => 'add_menu_page()', + 'version' => '4.5.0', + ), + 'comments_popup_script' => array( + 'alt' => '', + 'version' => '4.5.0', + ), + 'get_comments_popup_template' => array( + 'alt' => '', + 'version' => '4.5.0', + ), + 'get_currentuserinfo' => array( + 'alt' => 'wp_get_current_user()', + 'version' => '4.5.0', + ), + 'is_comments_popup' => array( + 'alt' => '', + 'version' => '4.5.0', + ), + 'popuplinks' => array( + 'alt' => '', + 'version' => '4.5.0', + ), + + // WP 4.6.0. + 'post_form_autocomplete_off' => array( + 'alt' => '', + 'version' => '4.6.0', + ), + 'wp_embed_handler_googlevideo' => array( + 'alt' => '', + 'version' => '4.6.0', + ), + 'wp_get_sites' => array( + 'alt' => 'get_sites()', + 'version' => '4.6.0', + ), + + // WP 4.7.0. + '_sort_nav_menu_items' => array( + 'alt' => 'wp_list_sort()', + 'version' => '4.7.0', + ), + '_usort_terms_by_ID' => array( + 'alt' => 'wp_list_sort()', + 'version' => '4.7.0', + ), + '_usort_terms_by_name' => array( + 'alt' => 'wp_list_sort()', + 'version' => '4.7.0', + ), + 'get_paged_template' => array( + 'alt' => '', + 'version' => '4.7.0', + ), + 'wp_get_network' => array( + 'alt' => 'get_network()', + 'version' => '4.7.0', + ), + 'wp_kses_js_entities' => array( + 'alt' => '', + 'version' => '4.7.0', + ), + + // WP 4.8.0. + 'wp_dashboard_plugins_output' => array( + 'alt' => '', + 'version' => '4.8.0', + ), + + // WP 4.9.0. + 'get_shortcut_link' => array( + 'alt' => '', + 'version' => '4.9.0', + ), + 'is_user_option_local' => array( + 'alt' => '', + 'version' => '4.9.0', + ), + 'wp_ajax_press_this_add_category' => array( + 'alt' => '', + 'version' => '4.9.0', + ), + 'wp_ajax_press_this_save_post' => array( + 'alt' => '', + 'version' => '4.9.0', + ), + + // WP 5.1.0. + 'insert_blog' => array( + 'alt' => 'wp_insert_site()', + 'version' => '5.1.0', + ), + 'install_blog' => array( + 'alt' => '', + 'version' => '5.1.0', + ), + + // WP 5.3.0. + '_wp_json_prepare_data' => array( + 'alt' => '', + 'version' => '5.3.0', + ), + '_wp_privacy_requests_screen_options' => array( + 'alt' => '', + 'version' => '5.3.0', + ), + 'update_user_status' => array( + 'alt' => 'wp_update_user()', + 'version' => '5.3.0', + ), + + // WP 5.4.0. + 'wp_get_user_request_data' => array( + 'alt' => 'wp_get_user_request()', + 'version' => '5.4.0', + ), + + // WP 5.5.0. + '_wp_register_meta_args_whitelist' => array( + 'alt' => '_wp_register_meta_args_allowed_list()', + 'version' => '5.5.0', + ), + 'add_option_whitelist' => array( + 'alt' => 'add_allowed_options()', + 'version' => '5.5.0', + ), + 'remove_option_whitelist' => array( + 'alt' => 'remove_allowed_options()', + 'version' => '5.5.0', + ), + 'wp_blacklist_check' => array( + 'alt' => 'wp_check_comment_disallowed_list()', + 'version' => '5.5.0', + ), + 'wp_make_content_images_responsive' => array( + 'alt' => 'wp_filter_content_tags()', + 'version' => '5.5.0', + ), + 'wp_unregister_GLOBALS' => array( + 'alt' => '', + 'version' => '5.5.0', + ), + + // WP 5.7.0. + 'noindex' => array( + 'alt' => 'wp_robots_noindex()', + 'version' => '5.7.0', + ), + 'wp_no_robots' => array( + 'alt' => 'wp_robots_no_robots()', + 'version' => '5.7.0', + ), + 'wp_sensitive_page_meta' => array( + 'alt' => 'wp_robots_sensitive_page()', + 'version' => '5.7.0', + ), + + // WP 5.8.0. + '_excerpt_render_inner_columns_blocks' => array( + 'alt' => '_excerpt_render_inner_blocks()', + 'version' => '5.8.0', + ), + + // WP 5.9.0. + 'readonly' => array( + 'alt' => 'wp_readonly()', + 'version' => '5.9.0', + ), + + // WP 5.9.1. + 'wp_render_duotone_filter_preset' => array( + 'alt' => 'wp_get_duotone_filter_property()', + 'version' => '5.9.1', + ), + + // WP 6.0.0. + 'image_attachment_fields_to_save' => array( + 'alt' => '', + 'version' => '6.0.0', + ), + 'wp_add_iframed_editor_assets_html' => array( + 'alt' => '', + 'version' => '6.0.0', + ), + 'wp_skip_border_serialization' => array( + 'alt' => 'wp_should_skip_block_supports_serialization()', + 'version' => '6.0.0', + ), + 'wp_skip_dimensions_serialization' => array( + 'alt' => 'wp_should_skip_block_supports_serialization()', + 'version' => '6.0.0', + ), + 'wp_skip_spacing_serialization' => array( + 'alt' => 'wp_should_skip_block_supports_serialization()', + 'version' => '6.0.0', + ), + + // WP 6.0.2. + 'the_meta' => array( + 'alt' => 'get_post_meta()', + 'version' => '6.0.2', + ), + + // WP 6.0.3. + // Verified; see https://core.trac.wordpress.org/ticket/56791#comment:10. + '_filter_query_attachment_filenames' => array( + 'alt' => 'add_filter( "wp_allow_query_attachment_by_filename", "__return_true" )', + 'version' => '6.0.3', + ), + + // WP 6.1.0. + '_get_path_to_translation' => array( + 'alt' => 'WP_Textdomain_Registry', + 'version' => '6.1.0', + ), + '_get_path_to_translation_from_lang_dir' => array( + 'alt' => 'WP_Textdomain_Registry', + 'version' => '6.1.0', + ), + '_wp_multiple_block_styles' => array( + 'alt' => '', + 'version' => '6.1.0', + ), + 'global_terms' => array( + 'alt' => '', + 'version' => '6.1.0', + ), + 'global_terms_enabled' => array( + 'alt' => '', + 'version' => '6.1.0', + ), + 'install_global_terms' => array( + 'alt' => '', + 'version' => '6.1.0', + ), + 'sync_category_tag_slugs' => array( + 'alt' => '', + 'version' => '6.1.0', + ), + 'wp_get_attachment_thumb_file' => array( + 'alt' => '', + 'version' => '6.1.0', + ), + 'wp_typography_get_css_variable_inline_style' => array( + 'alt' => 'wp_style_engine_get_styles()', + 'version' => '6.1.0', + ), + + // WP 6.2.0. + '_resolve_home_block_template' => array( + 'alt' => '', + 'version' => '6.2.0', + ), + 'get_page_by_title' => array( + 'alt' => 'WP_Query', + 'version' => '6.2.0', + ), + + // WP 6.3.0. + '_wp_tinycolor_bound_alpha' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'block_core_navigation_get_classic_menu_fallback' => array( + 'alt' => 'WP_Navigation_Fallback::get_classic_menu_fallback', + 'version' => '6.3.0', + ), + 'block_core_navigation_get_classic_menu_fallback_blocks' => array( + 'alt' => 'WP_Navigation_Fallback::get_classic_menu_fallback_blocks', + 'version' => '6.3.0', + ), + 'block_core_navigation_get_most_recently_published_navigation' => array( + 'alt' => 'WP_Navigation_Fallback::get_most_recently_published_navigation', + 'version' => '6.3.0', + ), + 'block_core_navigation_maybe_use_classic_menu_fallback' => array( + 'alt' => 'WP_Navigation_Fallback::create_classic_menu_fallback', + 'version' => '6.3.0', + ), + 'block_core_navigation_parse_blocks_from_menu_items' => array( + 'alt' => 'WP_Navigation_Fallback::parse_blocks_from_menu_items', + 'version' => '6.3.0', + ), + 'block_core_navigation_submenu_build_css_colors' => array( + 'alt' => 'wp_apply_colors_support()', + 'version' => '6.3.0', + ), + 'wlwmanifest_link' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_get_duotone_filter_id' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_get_duotone_filter_property' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_get_duotone_filter_svg' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_get_global_styles_svg_filters' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_get_loading_attr_default' => array( + 'alt' => 'wp_get_loading_optimization_attributes()', + 'version' => '6.3.0', + ), + 'wp_global_styles_render_svg_filters' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_img_tag_add_loading_attr' => array( + 'alt' => 'wp_img_tag_add_loading_optimization_attrs()', + 'version' => '6.3.0', + ), + 'wp_queue_comments_for_comment_meta_lazyload' => array( + 'alt' => 'wp_lazyload_comment_meta()', + 'version' => '6.3.0', + ), + 'wp_register_duotone_support' => array( + 'alt' => 'WP_Duotone::register_duotone_support()', + 'version' => '6.3.0', + ), + 'wp_render_duotone_support' => array( + 'alt' => 'WP_Duotone::render_duotone_support()', + 'version' => '6.3.0', + ), + 'wp_tinycolor_bound01' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_tinycolor_hsl_to_rgb' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_tinycolor_hue_to_rgb' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_tinycolor_rgb_to_rgb' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + 'wp_tinycolor_string_to_rgb' => array( + 'alt' => '', + 'version' => '6.3.0', + ), + + // WP 6.4.0. + '_admin_bar_bump_cb' => array( + 'alt' => 'wp_enqueue_admin_bar_bump_styles()', + 'version' => '6.4.0', + ), + '_inject_theme_attribute_in_block_template_content' => array( + 'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), \'_inject_theme_attribute_in_template_part_block\' )', + 'version' => '6.4.0', + ), + '_remove_theme_attribute_in_block_template_content' => array( + 'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), \'_remove_theme_attribute_from_template_part_block\' )', + 'version' => '6.4.0', + ), + '_wp_theme_json_webfonts_handler' => array( + 'alt' => 'wp_print_font_faces()', + 'version' => '6.4.0', + ), + 'print_embed_styles' => array( + 'alt' => 'wp_enqueue_embed_styles()', + 'version' => '6.4.0', + ), + 'print_emoji_styles' => array( + 'alt' => 'wp_enqueue_emoji_styles()', + 'version' => '6.4.0', + ), + 'the_block_template_skip_link' => array( + 'alt' => 'wp_enqueue_block_template_skip_link()', + 'version' => '6.4.0', + ), + 'wp_admin_bar_header' => array( + 'alt' => 'wp_enqueue_admin_bar_header_styles()', + 'version' => '6.4.0', + ), + 'wp_img_tag_add_decoding_attr' => array( + 'alt' => 'wp_img_tag_add_loading_optimization_attrs()', + 'version' => '6.4.0', + ), + 'wp_update_https_detection_errors' => array( + 'alt' => 'wp_get_https_detection_errors()', + 'version' => '6.4.0', + ), + + // WP 6.5.0. + 'block_core_file_ensure_interactivity_dependency' => array( + 'alt' => 'wp_register_script_module()', + 'version' => '6.5.0', + ), + 'block_core_image_ensure_interactivity_dependency' => array( + 'alt' => 'wp_register_script_module()', + 'version' => '6.5.0', + ), + 'block_core_query_ensure_interactivity_dependency' => array( + 'alt' => 'wp_register_script_module()', + 'version' => '6.5.0', + ), + ); + + /** + * Groups of functions to restrict. + * + * @return array + */ + public function getGroups() { + // Make sure all array keys are lowercase. + $this->deprecated_functions = array_change_key_case( $this->deprecated_functions, \CASE_LOWER ); + + return array( + 'deprecated_functions' => array( + 'functions' => array_keys( $this->deprecated_functions ), + ), + ); + } + + /** + * Process a matched token. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. Will + * always be 'deprecated_functions'. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * + * @return void + */ + public function process_matched_token( $stackPtr, $group_name, $matched_content ) { + + $this->set_minimum_wp_version(); + + $message = '%s() has been deprecated since WordPress version %s.'; + $data = array( + $this->tokens[ $stackPtr ]['content'], + $this->deprecated_functions[ $matched_content ]['version'], + ); + + if ( ! empty( $this->deprecated_functions[ $matched_content ]['alt'] ) ) { + $message .= ' Use %s instead.'; + $data[] = $this->deprecated_functions[ $matched_content ]['alt']; + } + + MessageHelper::addMessage( + $this->phpcsFile, + $message, + $stackPtr, + ( $this->wp_version_compare( $this->deprecated_functions[ $matched_content ]['version'], $this->minimum_wp_version, '<' ) ), + MessageHelper::stringToErrorcode( $matched_content . 'Found' ), + $data + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php new file mode 100644 index 00000000..0806772b --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php @@ -0,0 +1,291 @@ + array( + * (int) Target parameter position, 1-based. => array( + * (string) 'name' => (string|array) Parameter name(s), + * (string) 'values' => array( + * (string) Parameter value. => array( + * 'alt' => (string) Suggested alternative. + * 'version' => (int) The WordPress version when deprecated. + * ) + * ) + * ) + * ) + * ); + */ + protected $target_functions = array( + 'add_option' => array( + 1 => array( + 'name' => 'option', + 'values' => array( + 'blacklist_keys' => array( + 'alt' => 'disallowed_keys', + 'version' => '5.5.0', + ), + 'comment_whitelist' => array( + 'alt' => 'comment_previously_approved', + 'version' => '5.5.0', + ), + ), + ), + ), + 'add_settings_field' => array( + 4 => array( + 'name' => 'page', + 'values' => array( + 'misc' => array( + 'alt' => 'another settings group', + 'version' => '3.0.0', + ), + 'privacy' => array( + 'alt' => 'another settings group', + 'version' => '3.5.0', + ), + ), + ), + ), + 'add_settings_section' => array( + 4 => array( + 'name' => 'page', + 'values' => array( + 'misc' => array( + 'alt' => 'another settings group', + 'version' => '3.0.0', + ), + 'privacy' => array( + 'alt' => 'another settings group', + 'version' => '3.5.0', + ), + ), + ), + ), + 'bloginfo' => array( + 1 => array( + 'name' => 'show', + 'values' => array( + 'home' => array( + 'alt' => 'the "url" argument', + 'version' => '2.2.0', + ), + 'siteurl' => array( + 'alt' => 'the "url" argument', + 'version' => '2.2.0', + ), + 'text_direction' => array( + 'alt' => 'is_rtl()', + 'version' => '2.2.0', + ), + ), + ), + ), + 'get_bloginfo' => array( + 1 => array( + 'name' => 'show', + 'values' => array( + 'home' => array( + 'alt' => 'the "url" argument', + 'version' => '2.2.0', + ), + 'siteurl' => array( + 'alt' => 'the "url" argument', + 'version' => '2.2.0', + ), + 'text_direction' => array( + 'alt' => 'is_rtl()', + 'version' => '2.2.0', + ), + ), + ), + ), + 'get_option' => array( + 1 => array( + 'name' => 'option', + 'values' => array( + 'blacklist_keys' => array( + 'alt' => 'disallowed_keys', + 'version' => '5.5.0', + ), + 'comment_whitelist' => array( + 'alt' => 'comment_previously_approved', + 'version' => '5.5.0', + ), + ), + ), + ), + 'register_setting' => array( + 1 => array( + 'name' => 'option_group', + 'values' => array( + 'misc' => array( + 'alt' => 'another settings group', + 'version' => '3.0.0', + ), + 'privacy' => array( + 'alt' => 'another settings group', + 'version' => '3.5.0', + ), + ), + ), + ), + 'unregister_setting' => array( + 1 => array( + 'name' => 'option_group', + 'values' => array( + 'misc' => array( + 'alt' => 'another settings group', + 'version' => '3.0.0', + ), + 'privacy' => array( + 'alt' => 'another settings group', + 'version' => '3.5.0', + ), + ), + ), + ), + 'update_option' => array( + 1 => array( + 'name' => 'option', + 'values' => array( + 'blacklist_keys' => array( + 'alt' => 'disallowed_keys', + 'version' => '5.5.0', + ), + 'comment_whitelist' => array( + 'alt' => 'comment_previously_approved', + 'version' => '5.5.0', + ), + ), + ), + ), + ); + + /** + * Process the parameters of a matched function. + * + * @since 1.0.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + $this->set_minimum_wp_version(); + + foreach ( $this->target_functions[ $matched_content ] as $position => $parameter_args ) { + $found_param = PassedParameters::getParameterFromStack( $parameters, $position, $parameter_args['name'] ); + + // Skip if the parameter was not found. + if ( false === $found_param ) { + continue; + } + + $this->process_parameter( $matched_content, $found_param, $parameter_args['values'] ); + } + } + + /** + * Process the parameter of a matched function. + * + * @since 1.0.0 + * + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameter Array with start and end token positon of the parameter. + * @param array $parameter_args Array with alternative and WordPress deprecation version of the parameter. + * + * @return void + */ + protected function process_parameter( $matched_content, $parameter, $parameter_args ) { + + $parameter_position = $this->phpcsFile->findNext( + Tokens::$emptyTokens, + $parameter['start'], + $parameter['end'] + 1, + true + ); + + if ( false === $parameter_position ) { + return; + } + + $matched_parameter = TextStrings::stripQuotes( $this->tokens[ $parameter_position ]['content'] ); + if ( ! isset( $parameter_args[ $matched_parameter ] ) ) { + return; + } + + $message = 'The parameter value "%s" has been deprecated since WordPress version %s.'; + $data = array( + $matched_parameter, + $parameter_args[ $matched_parameter ]['version'], + ); + + if ( ! empty( $parameter_args[ $matched_parameter ]['alt'] ) ) { + $message .= ' Use %s instead.'; + $data[] = $parameter_args[ $matched_parameter ]['alt']; + } + + $is_error = $this->wp_version_compare( $parameter_args[ $matched_parameter ]['version'], $this->minimum_wp_version, '<' ); + MessageHelper::addMessage( + $this->phpcsFile, + $message, + $parameter_position, + $is_error, + 'Found', + $data + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php new file mode 100644 index 00000000..2675ecfa --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php @@ -0,0 +1,509 @@ + value + * in a custom ruleset. + * + * @uses \WordPressCS\WordPress\Helpers\MinimumWPVersionTrait::$minimum_wp_version + */ +final class DeprecatedParametersSniff extends AbstractFunctionParameterSniff { + + use MinimumWPVersionTrait; + + /** + * The group name for this group of functions. + * + * @since 0.12.0 + * + * @var string + */ + protected $group_name = 'wp_deprecated_parameters'; + + /** + * Array of function, argument, and default value for deprecated argument. + * + * The functions are ordered alphabetically. + * Last updated for WordPress 6.3. + * + * @since 0.12.0 + * + * @var array Multidimensional array with parameter details. + * $target_functions = array( + * (string) Function name. => array( + * (int) Target parameter position, 1-based. => array( + * 'name' => (string|array) Parameter name or list of names if the parameter + * was renamed since the release of PHP 8.0. + * 'value' => (mixed) Expected default value for the deprecated parameter. + * Currently the default values: true, false, null, empty arrays + * and both empty and non-empty strings can be handled correctly + * by the process_parameters() method. + * When an additional default value is added, the relevant code + * in the process_parameters() method will need to be adjusted. + * 'version' => (int) The WordPress version when deprecated. + * ) + * ) + * ); + */ + protected $target_functions = array( + '_future_post_hook' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '2.3.0', + ), + ), + '_load_remote_block_patterns' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '5.9.0', + ), + ), + '_wp_post_revision_fields' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => false, + 'version' => '4.5.0', + ), + ), + 'add_option' => array( + 3 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.3.0', + ), + ), + 'comments_link' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '0.72', + ), + 2 => array( + 'name' => 'deprecated_2', + 'value' => '', + 'version' => '1.3.0', + ), + ), + 'convert_chars' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '0.71', + ), + ), + 'delete_plugins' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '4.0.0', + ), + ), + 'discover_pingback_server_uri' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.7.0', + ), + ), + 'get_blog_list' => array( + 3 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '3.0.0', // Was previously part of MU. + ), + ), + 'get_category_parents' => array( + 5 => array( + 'name' => 'deprecated', + 'value' => array(), + 'version' => '4.8.0', + ), + ), + 'get_delete_post_link' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '3.0.0', + ), + ), + 'get_last_updated' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '3.0.0', // Was previously part of MU. + ), + ), + 'get_site_option' => array( + 3 => array( + 'name' => 'deprecated', + 'value' => true, + 'version' => '4.4.0', + ), + ), + 'get_terms' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '4.5.0', + ), + ), + 'get_the_author' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.1.0', + ), + ), + 'get_user_option' => array( + 3 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '3.0.0', + ), + ), + 'get_wp_title_rss' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '–', + 'version' => '4.4.0', + ), + ), + 'global_terms' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '6.1.0', + ), + ), + 'iframe_header' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => false, + 'version' => '4.2.0', + ), + ), + 'install_search_form' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => true, + 'version' => '4.6.0', + ), + ), + 'is_email' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => false, + 'version' => '3.0.0', + ), + ), + 'load_plugin_textdomain' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => false, + 'version' => '2.7.0', + ), + ), + 'newblog_notify_siteadmin' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '3.0.0', + ), + ), + 'permalink_single_rss' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.3.0', + ), + ), + 'redirect_this_site' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '3.0.0', + ), + ), + 'register_meta' => array( + 4 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '4.6.0', + ), + ), + 'safecss_filter_attr' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.8.1', + ), + ), + 'switch_to_blog' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '3.5.0', // Was previously part of MU. + ), + ), + 'term_description' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '4.9.2', + ), + ), + 'the_attachment_link' => array( + 3 => array( + 'name' => 'deprecated', + 'value' => false, + 'version' => '2.5.0', + ), + ), + 'the_author' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.1.0', + ), + 2 => array( + 'name' => 'deprecated_echo', + 'value' => true, + 'version' => '1.5.0', + ), + ), + 'the_author_posts_link' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.1.0', + ), + ), + 'trackback_rdf' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.5.0', + ), + ), + 'trackback_url' => array( + 1 => array( + 'name' => 'deprecated_echo', + 'value' => true, + 'version' => '2.5.0', + ), + ), + 'unregister_setting' => array( + 3 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '4.7.0', + ), + ), + 'update_blog_option' => array( + 4 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '3.1.0', + ), + ), + 'update_blog_status' => array( + 4 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '3.1.0', + ), + ), + 'update_posts_count' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '3.0.0', + ), + ), + 'update_user_status' => array( + 4 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '3.0.2', + ), + ), + 'wp_count_terms' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '5.6.0', + ), + ), + 'wp_create_thumbnail' => array( + 3 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '3.5.0', + ), + ), + 'wp_get_http_headers' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => false, + 'version' => '2.7.0', + ), + ), + 'wp_get_sidebars_widgets' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => true, + 'version' => '2.8.1', + ), + ), + 'wp_install' => array( + 5 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.6.0', + ), + ), + 'wp_login' => array( + 3 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.5.0', + ), + ), + 'wp_new_user_notification' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '4.3.1', + ), + ), + 'wp_notify_postauthor' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '3.8.0', + ), + ), + 'wp_title_rss' => array( + 1 => array( + 'name' => 'deprecated', + 'value' => '–', + 'version' => '4.4.0', + ), + ), + 'wp_upload_bits' => array( + 2 => array( + 'name' => 'deprecated', + 'value' => null, + 'version' => '2.0.0', + ), + ), + 'xfn_check' => array( + 3 => array( + 'name' => 'deprecated', + 'value' => '', + 'version' => '2.5.0', + ), + ), + ); + + /** + * Process the parameters of a matched function. + * + * @since 0.12.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + + $this->set_minimum_wp_version(); + + $paramCount = \count( $parameters ); + foreach ( $this->target_functions[ $matched_content ] as $position => $parameter_args ) { + + $found_param = PassedParameters::getParameterFromStack( $parameters, $position, $parameter_args['name'] ); + if ( false === $found_param ) { + continue; + } + + // The list will need to updated if the default value is not supported. + switch ( $found_param['raw'] ) { + case 'true': + $matched_parameter = true; + break; + case 'false': + $matched_parameter = false; + break; + case 'null': + $matched_parameter = null; + break; + case 'array()': + case '[]': + $matched_parameter = array(); + break; + default: + $matched_parameter = TextStrings::stripQuotes( $found_param['raw'] ); + break; + } + + if ( $parameter_args['value'] === $matched_parameter ) { + continue; + } + + $message = 'The parameter "%s" at position #%s of %s() has been deprecated since WordPress version %s.'; + $is_error = $this->wp_version_compare( $parameter_args['version'], $this->minimum_wp_version, '<' ); + $code = MessageHelper::stringToErrorcode( ucfirst( $matched_content ) . 'Param' . $position . 'Found' ); + + $data = array( + $found_param['raw'], + $position, + $matched_content, + $parameter_args['version'], + ); + + if ( isset( $parameter_args['value'] ) + && isset( $found_param['name'] ) === false + && $position < $paramCount + ) { + $message .= ' Use "%s" instead.'; + $data[] = (string) $parameter_args['value']; + } else { + $message .= ' Instead do not pass the parameter.'; + } + + MessageHelper::addMessage( $this->phpcsFile, $message, $stackPtr, $is_error, $code, $data, 0 ); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php new file mode 100644 index 00000000..7db5a378 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php @@ -0,0 +1,160 @@ + 'get_stylesheet_directory()', + 'TEMPLATEPATH' => 'get_template_directory()', + 'PLUGINDIR' => 'WP_PLUGIN_DIR', + 'MUPLUGINDIR' => 'WPMU_PLUGIN_DIR', + 'HEADER_IMAGE' => 'add_theme_support( \'custom-header\' )', + 'NO_HEADER_TEXT' => 'add_theme_support( \'custom-header\' )', + 'HEADER_TEXTCOLOR' => 'add_theme_support( \'custom-header\' )', + 'HEADER_IMAGE_WIDTH' => 'add_theme_support( \'custom-header\' )', + 'HEADER_IMAGE_HEIGHT' => 'add_theme_support( \'custom-header\' )', + 'BACKGROUND_COLOR' => 'add_theme_support( \'custom-background\' )', + 'BACKGROUND_IMAGE' => 'add_theme_support( \'custom-background\' )', + ); + + /** + * Array of functions to check. + * + * @since 0.14.0 + * @since 3.0.0 The format of the value has changed from an integer parameter + * position to an array with the parameter position and name. + * + * @var array> Function name as key, array with target + * parameter and name as value. + */ + protected $target_functions = array( + 'define' => array( + 'position' => 1, + 'name' => 'constant_name', + ), + ); + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 0.14.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + if ( isset( $this->target_functions[ strtolower( $this->tokens[ $stackPtr ]['content'] ) ] ) ) { + // Disallow excluding function groups for this sniff. + $this->exclude = array(); + + return parent::process_token( $stackPtr ); + + } else { + return $this->process_arbitrary_tstring( $stackPtr ); + } + } + + /** + * Process an arbitrary T_STRING token to determine whether it is one of the target constants. + * + * @since 0.14.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function process_arbitrary_tstring( $stackPtr ) { + $content = $this->tokens[ $stackPtr ]['content']; + + if ( ! isset( $this->discouraged_constants[ $content ] ) ) { + return; + } + + if ( ConstantsHelper::is_use_of_global_constant( $this->phpcsFile, $stackPtr ) === false ) { + return; + } + + $this->phpcsFile->addWarning( + 'Found usage of constant "%s". Use %s instead.', + $stackPtr, + MessageHelper::stringToErrorcode( $content . 'UsageFound' ), + array( + $content, + $this->discouraged_constants[ $content ], + ) + ); + } + + /** + * Process the parameters of a matched `define` function call. + * + * @since 0.14.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + $target_param = $this->target_functions[ $matched_content ]; + + // Was the target parameter passed ? + $found_param = PassedParameters::getParameterFromStack( $parameters, $target_param['position'], $target_param['name'] ); + if ( false === $found_param ) { + return; + } + + $clean_content = TextStrings::stripQuotes( $found_param['clean'] ); + + if ( isset( $this->discouraged_constants[ $clean_content ] ) ) { + $first_non_empty = $this->phpcsFile->findNext( + Tokens::$emptyTokens, + $found_param['start'], + ( $found_param['end'] + 1 ), + true + ); + + $this->phpcsFile->addWarning( + 'Found declaration of constant "%s". Use %s instead.', + $first_non_empty, + MessageHelper::stringToErrorcode( $clean_content . 'DeclarationFound' ), + array( + $clean_content, + $this->discouraged_constants[ $clean_content ], + ) + ); + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php new file mode 100644 index 00000000..941b992b --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php @@ -0,0 +1,54 @@ + array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + 'query_posts' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged. Use WP_Query instead.', + 'functions' => array( + 'query_posts', + ), + ), + + 'wp_reset_query' => array( + 'type' => 'warning', + 'message' => '%s() is discouraged. Use wp_reset_postdata() instead.', + 'functions' => array( + 'wp_reset_query', + ), + ), + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php new file mode 100644 index 00000000..6e4385a9 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php @@ -0,0 +1,241 @@ + Key is function name, value irrelevant. + */ + protected $target_functions = array( + 'wp_register_script' => true, + 'wp_enqueue_script' => true, + 'wp_register_style' => true, + 'wp_enqueue_style' => true, + ); + + /** + * False + the empty tokens array. + * + * This array is enriched with the $emptyTokens array in the register() method. + * + * @var array + */ + private $false_tokens = array( + \T_FALSE => \T_FALSE, + ); + + /** + * Token codes which are "safe" to accept to determine whether a version would evaluate to `false`. + * + * This array is enriched with the several of the PHPCS token arrays in the register() method. + * + * @var array + */ + private $safe_tokens = array( + \T_NULL => \T_NULL, + \T_FALSE => \T_FALSE, + \T_TRUE => \T_TRUE, + \T_LNUMBER => \T_LNUMBER, + \T_DNUMBER => \T_DNUMBER, + \T_CONSTANT_ENCAPSED_STRING => \T_CONSTANT_ENCAPSED_STRING, + \T_START_NOWDOC => \T_START_NOWDOC, + \T_NOWDOC => \T_NOWDOC, + \T_END_NOWDOC => \T_END_NOWDOC, + \T_OPEN_PARENTHESIS => \T_OPEN_PARENTHESIS, + \T_CLOSE_PARENTHESIS => \T_CLOSE_PARENTHESIS, + \T_STRING_CONCAT => \T_STRING_CONCAT, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * Overloads and calls the parent method to allow for adding additional tokens to the $safe_tokens property. + * + * @return array + */ + public function register() { + $this->false_tokens += Tokens::$emptyTokens; + + $this->safe_tokens += Tokens::$emptyTokens; + $this->safe_tokens += Tokens::$assignmentTokens; + $this->safe_tokens += Tokens::$comparisonTokens; + $this->safe_tokens += Tokens::$operators; + $this->safe_tokens += Tokens::$booleanOperators; + $this->safe_tokens += Tokens::$castTokens; + + return parent::register(); + } + + /** + * Process the parameters of a matched function. + * + * @since 1.0.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + // Check to see if a source ($src) is specified. + $src_param = PassedParameters::getParameterFromStack( $parameters, 2, 'src' ); + if ( false === $src_param ) { + return; + } + + /* + * Version Check: Check to make sure the version is set explicitly. + */ + + $version_param = PassedParameters::getParameterFromStack( $parameters, 4, 'ver' ); + + $error_ptr = $stackPtr; + if ( false !== $version_param ) { + $error_ptr = $this->phpcsFile->findNext( Tokens::$emptyTokens, $version_param['start'], ( $version_param['end'] + 1 ), true ); + if ( false === $error_ptr ) { + $error_ptr = $version_param['start']; + } + } + + if ( false === $version_param || 'null' === $version_param['clean'] ) { + $type = 'script'; + if ( strpos( $matched_content, '_style' ) !== false ) { + $type = 'style'; + } + + $this->phpcsFile->addWarning( + 'Resource version not set in call to %s(). This means new versions of the %s may not always be loaded due to browser caching.', + $error_ptr, + 'MissingVersion', + array( $matched_content, $type ) + ); + // The version argument should have a non-false value. + } elseif ( $this->is_falsy( $version_param['start'], $version_param['end'] ) ) { + $this->phpcsFile->addError( + 'Version parameter is not explicitly set or has been set to an equivalent of "false" for %s; ' . + 'This means that the WordPress core version will be used which is not recommended for plugin or theme development.', + $error_ptr, + 'NoExplicitVersion', + array( $matched_content ) + ); + } + + /* + * In footer Check + * + * Check to make sure that $in_footer is set to true. + * It will warn the user to make sure it is intended. + * + * Only wp_register_script and wp_enqueue_script need this check, + * as this parameter is not available to wp_register_style and wp_enqueue_style. + */ + if ( 'wp_register_script' !== $matched_content && 'wp_enqueue_script' !== $matched_content ) { + return; + } + + $infooter_param = PassedParameters::getParameterFromStack( $parameters, 5, 'in_footer' ); + if ( false === $infooter_param ) { + // If in footer is not set, throw a warning about the default. + $this->phpcsFile->addWarning( + 'In footer ($in_footer) is not set explicitly %s; ' . + 'It is recommended to load scripts in the footer. Please set this value to `true` to load it in the footer, or explicitly `false` if it should be loaded in the header.', + $stackPtr, + 'NotInFooter', + array( $matched_content ) + ); + } + } + + /** + * Determine if a range has a falsy value. + * + * @param int $start The position to start looking from. + * @param int $end The position to stop looking (inclusive). + * + * @return bool True if the parameter is falsy. + * False if the parameter is not falsy or when it + * couldn't be reliably determined. + */ + protected function is_falsy( $start, $end ) { + + // Find anything excluding the false tokens. + $has_non_false = $this->phpcsFile->findNext( $this->false_tokens, $start, ( $end + 1 ), true ); + // If no non-false tokens are found, we are good. + if ( false === $has_non_false ) { + return true; + } + + $code_string = ''; + for ( $i = $start; $i <= $end; $i++ ) { + if ( isset( $this->safe_tokens[ $this->tokens[ $i ]['code'] ] ) === false ) { + // Function call/variable or other token which makes it neigh impossible + // to determine whether the actual value would evaluate to false. + return false; + } + + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) === true ) { + continue; + } + + // Make sure that PHP 7.4 numeric literals and PHP 8.1 explicit octals don't cause problems. + if ( \T_LNUMBER === $this->tokens[ $i ]['code'] || \T_DNUMBER === $this->tokens[ $i ]['code'] ) { + $number_info = Numbers::getCompleteNumber( $this->phpcsFile, $i ); + $code_string .= $number_info['decimal']; + $i = $number_info['last_token']; + continue; + } + + $code_string .= $this->tokens[ $i ]['content']; + } + + if ( '' === $code_string ) { + return false; + } + + // Evaluate the argument to figure out the outcome is false or not. + // phpcs:ignore Squiz.PHP.Eval -- No harm here. + return ( false === eval( "return (bool) $code_string;" ) ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php new file mode 100644 index 00000000..c7ed63c3 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php @@ -0,0 +1,108 @@ +tokens[ $stackPtr ]['content']; + if ( \T_INLINE_HTML !== $this->tokens[ $stackPtr ]['code'] ) { + try { + $end_ptr = TextStrings::getEndOfCompleteTextString( $this->phpcsFile, $stackPtr ); + $content = TextStrings::getCompleteTextString( $this->phpcsFile, $stackPtr ); + } catch ( RuntimeException $e ) { + // Parse error/live coding. + return; + } + } + + if ( preg_match_all( '# rel=\\\\?[\'"]?stylesheet\\\\?[\'"]?#', $content, $matches, \PREG_OFFSET_CAPTURE ) > 0 ) { + foreach ( $matches[0] as $match ) { + $this->phpcsFile->addError( + 'Stylesheets must be registered/enqueued via wp_enqueue_style()', + $this->find_token_in_multiline_string( $stackPtr, $content, $match[1] ), + 'NonEnqueuedStylesheet' + ); + } + } + + if ( preg_match_all( '#]*(?<=src=)#', $content, $matches, \PREG_OFFSET_CAPTURE ) > 0 ) { + foreach ( $matches[0] as $match ) { + $this->phpcsFile->addError( + 'Scripts must be registered/enqueued via wp_enqueue_script()', + $this->find_token_in_multiline_string( $stackPtr, $content, $match[1] ), + 'NonEnqueuedScript' + ); + } + } + + return ( $end_ptr + 1 ); + } + + /** + * Find the exact token on which the error should be reported for multi-line strings. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $content The complete, potentially multi-line, text string. + * @param int $match_offset The offset within the content at which the match was found. + * + * @return int The stack pointer to the token containing the start of the match. + */ + private function find_token_in_multiline_string( $stackPtr, $content, $match_offset ) { + $newline_count = 0; + if ( $match_offset > 0 ) { + $newline_count = substr_count( $content, "\n", 0, $match_offset ); + } + + // Account for heredoc/nowdoc text starting at the token *after* the opener. + if ( isset( Tokens::$heredocTokens[ $this->tokens[ $stackPtr ]['code'] ] ) === true ) { + ++$newline_count; + } + + return ( $stackPtr + $newline_count ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php new file mode 100644 index 00000000..038aba6a --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php @@ -0,0 +1,436 @@ + Key is variable name, value irrelevant. + */ + protected $override_allowed = array( + 'content_width' => true, + 'wp_cockneyreplace' => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 0.3.0 + * @since 1.1.0 Added class tokens for improved test classes skipping. + * + * @return array + */ + public function register() { + $targets = array( + \T_GLOBAL, + \T_VARIABLE, + ); + $targets += Collections::listOpenTokensBC(); + + // Only used to skip over test classes. + $targets += Tokens::$ooScopeTokens; + + return $targets; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 0.3.0 + * @since 1.1.0 Split the token specific logic off into separate methods. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + public function process_token( $stackPtr ) { + + $token = $this->tokens[ $stackPtr ]; + + // Ignore variable overrides in test classes. + if ( isset( Tokens::$ooScopeTokens[ $token['code'] ] ) ) { + + if ( true === $this->is_test_class( $this->phpcsFile, $stackPtr ) + && $token['scope_condition'] === $stackPtr + && isset( $token['scope_closer'] ) + ) { + // Skip forward to end of test class. + return $token['scope_closer']; + } + + // Otherwise ignore the tokens as they were only registered to enable skipping over test classes. + return; + } + + /* + * Examine variables within a function scope based on a `global` statement in the + * function. + * Examine variables not within a function scope, but within a list construct, based + * on that. + * Examine variables not within a function scope and access to the `$GLOBALS` + * variable based on the variable token. + * + * Note: No special handling here for code found within PHP 7.4+ arrow functions. + * Arrow functions are "open", i.e. they have by value access to variables in the + * surrounding scope, but they cannot modify the value. + * Additionally, as they can only have one statement, a `global` statement _within_ + * an arrow function declaration will lead to a parse error as the result is + * not a returnable value. + */ + $in_function_scope = Conditions::hasCondition( $this->phpcsFile, $stackPtr, array( \T_FUNCTION, \T_CLOSURE ) ); + + if ( isset( Collections::listOpenTokensBC()[ $token['code'] ] ) + && false === $in_function_scope + && false === $this->treat_files_as_scoped + ) { + return $this->process_list_assignment( $stackPtr ); + } elseif ( \T_VARIABLE === $token['code'] + && ( '$GLOBALS' === $token['content'] + || ( false === $in_function_scope && false === $this->treat_files_as_scoped ) ) + ) { + return $this->process_variable_assignment( $stackPtr ); + } elseif ( \T_GLOBAL === $token['code'] + && ( true === $in_function_scope || true === $this->treat_files_as_scoped ) + ) { + return $this->process_global_statement( $stackPtr, $in_function_scope ); + } + } + + /** + * Check that global variables declared via a list construct are prefixed. + * + * {@internal No need to take special measures for nested lists. Nested or not, + * each list part can only contain one variable being written to.} + * + * @since 2.2.0 + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return int|void Integer stack pointer to skip forward or void to continue + * normal file processing. + */ + protected function process_list_assignment( $stackPtr ) { + $list_open_close = Lists::getOpenClose( $this->phpcsFile, $stackPtr ); + if ( false === $list_open_close ) { + // Short array, not short list. + return; + } + + $var_pointers = ListHelper::get_list_variables( $this->phpcsFile, $stackPtr ); + foreach ( $var_pointers as $ptr ) { + $this->process_variable_assignment( $ptr, true ); + } + + // No need to re-examine these variables. + return $list_open_close['closer']; + } + + /** + * Check that defined global variables are prefixed. + * + * @since 1.1.0 Logic was previously contained in the process_token() method. + * + * @param int $stackPtr The position of the current token in the stack. + * @param bool $in_list Whether or not this is a variable in a list assignment. + * Defaults to false. + * + * @return void + */ + protected function process_variable_assignment( $stackPtr, $in_list = false ) { + + $token = $this->tokens[ $stackPtr ]; + $var_name = substr( $token['content'], 1 ); // Strip the dollar sign. + $data = array(); + + // Determine the variable name for `$GLOBALS['array_key']`. + if ( 'GLOBALS' === $var_name ) { + $bracketPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + + if ( false === $bracketPtr + || \T_OPEN_SQUARE_BRACKET !== $this->tokens[ $bracketPtr ]['code'] + || ! isset( $this->tokens[ $bracketPtr ]['bracket_closer'] ) + ) { + return; + } + + // Retrieve the array key and avoid getting tripped up by some simple obfuscation. + $var_name = ''; + $start = ( $bracketPtr + 1 ); + for ( $ptr = $start; $ptr < $this->tokens[ $bracketPtr ]['bracket_closer']; $ptr++ ) { + /* + * If the globals array key contains a variable, constant, function call + * or interpolated variable, bow out. + */ + if ( \T_VARIABLE === $this->tokens[ $ptr ]['code'] + || \T_STRING === $this->tokens[ $ptr ]['code'] + || \T_DOUBLE_QUOTED_STRING === $this->tokens[ $ptr ]['code'] + ) { + return; + } + + if ( \T_CONSTANT_ENCAPSED_STRING === $this->tokens[ $ptr ]['code'] ) { + $var_name .= TextStrings::stripQuotes( $this->tokens[ $ptr ]['content'] ); + } + } + + if ( '' === $var_name ) { + // Shouldn't happen, but just in case. + return; + } + + // Set up the data for the error message. + $data[] = '$GLOBALS[\'' . $var_name . '\']'; + } + + /* + * Is this one of the WP global variables ? + */ + if ( WPGlobalVariablesHelper::is_wp_global( $var_name ) === false ) { + return; + } + + /* + * Is this one of the WP global variables which are allowed to be overwritten ? + */ + if ( isset( $this->override_allowed[ $var_name ] ) === true ) { + return; + } + + /* + * Check if the variable value is being changed. + */ + if ( false === $in_list + && false === VariableHelper::is_assignment( $this->phpcsFile, $stackPtr ) + && Context::inForeachCondition( $this->phpcsFile, $stackPtr ) !== 'afterAs' + ) { + return; + } + + /* + * Function parameters with the same name as a WP global variable are fine, + * including when they are being assigned a default value. + */ + if ( false === $in_list ) { + $functionPtr = Parentheses::getLastOwner( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); + if ( false !== $functionPtr ) { + return; + } + + unset( $functionPtr ); + } + + /* + * Class property declarations with the same name as WP global variables are fine. + */ + if ( false === $in_list && true === Scopes::isOOProperty( $this->phpcsFile, $stackPtr ) ) { + return; + } + + // Still here ? In that case, the WP global variable is being tampered with. + $this->add_error( $stackPtr, $data ); + } + + /** + * Check that global variables imported into a function scope using a global statement + * are not being overruled. + * + * @since 1.1.0 Logic was previously contained in the process_token() method. + * + * @param int $stackPtr The position of the current token in the stack. + * @param bool $in_function_scope Whether the global statement is within a scoped function/closure. + * + * @return void + */ + protected function process_global_statement( $stackPtr, $in_function_scope ) { + /* + * Collect the variables to watch for. + */ + $search = array(); + $ptr = ( $stackPtr + 1 ); + $end_of_statement = $this->phpcsFile->findNext( array( \T_SEMICOLON, \T_CLOSE_TAG ), $ptr ); + + while ( isset( $this->tokens[ $ptr ] ) && $ptr < $end_of_statement ) { + if ( \T_VARIABLE === $this->tokens[ $ptr ]['code'] ) { + $var_name = substr( $this->tokens[ $ptr ]['content'], 1 ); + if ( WPGlobalVariablesHelper::is_wp_global( $var_name ) + && isset( $this->override_allowed[ $var_name ] ) === false + ) { + $search[ $this->tokens[ $ptr ]['content'] ] = true; + } + } + + ++$ptr; + } + + if ( empty( $search ) ) { + return; + } + + /* + * Search for assignments to the imported global variables within the relevant scope. + */ + $start = $ptr; + if ( true === $in_function_scope ) { + $functionPtr = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); + if ( isset( $this->tokens[ $functionPtr ]['scope_closer'] ) === false ) { + // Live coding or parse error. + return; + } + $end = $this->tokens[ $functionPtr ]['scope_closer']; + } else { + // Global statement in the global namespace in a file which is being treated as scoped. + $end = $this->phpcsFile->numTokens; + } + + for ( $ptr = $start; $ptr < $end; $ptr++ ) { + + // Skip over nested functions, classes and the likes. + if ( isset( Collections::closedScopes()[ $this->tokens[ $ptr ]['code'] ] ) ) { + if ( ! isset( $this->tokens[ $ptr ]['scope_closer'] ) ) { + // Live coding or parse error. + break; + } + + $ptr = $this->tokens[ $ptr ]['scope_closer']; + continue; + } + + // Make sure to recognize assignments to variables in a list construct. + if ( isset( Collections::listOpenTokensBC()[ $this->tokens[ $ptr ]['code'] ] ) ) { + $list_open_close = Lists::getOpenClose( $this->phpcsFile, $ptr ); + + if ( false === $list_open_close ) { + // Short array, not short list. + continue; + } + + $var_pointers = ListHelper::get_list_variables( $this->phpcsFile, $ptr ); + foreach ( $var_pointers as $ptr ) { + $var_name = $this->tokens[ $ptr ]['content']; + if ( '$GLOBALS' === $var_name ) { + $var_name = '$' . TextStrings::stripQuotes( VariableHelper::get_array_access_key( $this->phpcsFile, $ptr ) ); + } + + if ( isset( $search[ $var_name ] ) ) { + $this->process_variable_assignment( $ptr, true ); + } + } + + // No need to re-examine these variables. + $ptr = $list_open_close['closer']; + continue; + } + + if ( \T_VARIABLE !== $this->tokens[ $ptr ]['code'] ) { + continue; + } + + if ( isset( $search[ $this->tokens[ $ptr ]['content'] ] ) === false ) { + // Not one of the variables we're interested in. + continue; + } + + // Don't throw false positives for static class properties. + if ( ContextHelper::has_object_operator_before( $this->phpcsFile, $ptr ) === true ) { + continue; + } + + if ( true === VariableHelper::is_assignment( $this->phpcsFile, $ptr ) ) { + $this->add_error( $ptr ); + continue; + } + + // Check if this is a variable assignment within a `foreach()` declaration. + if ( Context::inForeachCondition( $this->phpcsFile, $ptr ) === 'afterAs' ) { + $this->add_error( $ptr ); + } + } + } + + /** + * Add the error. + * + * @since 1.1.0 + * + * @param int $stackPtr The position of the token to throw the error for. + * @param array $data Optional. Array containing one entry holding the + * name of the variable being overruled. + * Defaults to the 'content' of the $stackPtr token. + * + * @return void + */ + protected function add_error( $stackPtr, $data = array() ) { + if ( empty( $data ) ) { + $data[] = $this->tokens[ $stackPtr ]['content']; + } + + $this->phpcsFile->addError( + 'Overriding WordPress globals is prohibited. Found assignment to %s', + $stackPtr, + 'Prohibited', + $data + ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php new file mode 100644 index 00000000..ab857bec --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php @@ -0,0 +1,977 @@ + Key is function name, value is the function type. + */ + protected $i18n_functions = array( + 'translate' => 'simple', + '__' => 'simple', + 'esc_attr__' => 'simple', + 'esc_html__' => 'simple', + '_e' => 'simple', + 'esc_attr_e' => 'simple', + 'esc_html_e' => 'simple', + 'translate_with_gettext_context' => 'context', + '_x' => 'context', + '_ex' => 'context', + 'esc_attr_x' => 'context', + 'esc_html_x' => 'context', + '_n' => 'number', + '_nx' => 'number_context', + '_n_noop' => 'noopnumber', + '_nx_noop' => 'noopnumber_context', + ); + + /** + * Whether or not the `default` text domain is one of the allowed text domains. + * + * @since 0.14.0 + * + * @var bool + */ + private $text_domain_contains_default = false; + + /** + * Whether or not the `default` text domain is the only allowed text domain. + * + * @since 0.14.0 + * + * @var bool + */ + private $text_domain_is_default = false; + + /** + * Parameter specifications for the functions in each group. + * + * {@internal Even when not all parameters will be examined, the parameter list should still + * be complete in the below array to allow for a correct "total parameters" calculation.} + * + * @since 3.0.0 + * + * @var array Array of the parameter positions and names. + */ + private $parameter_specs = array( + 'simple' => array( + 1 => 'text', + 2 => 'domain', + ), + 'context' => array( + 1 => 'text', + 2 => 'context', + 3 => 'domain', + ), + 'number' => array( + 1 => 'single', + 2 => 'plural', + 3 => 'number', + 4 => 'domain', + ), + 'number_context' => array( + 1 => 'single', + 2 => 'plural', + 3 => 'number', + 4 => 'context', + 5 => 'domain', + ), + 'noopnumber' => array( + 1 => 'singular', + 2 => 'plural', + 3 => 'domain', + ), + 'noopnumber_context' => array( + 1 => 'singular', + 2 => 'plural', + 3 => 'context', + 4 => 'domain', + ), + ); + + /** + * Groups of functions to restrict. + * + * Example: groups => array( + * 'lambda' => array( + * 'type' => 'error' | 'warning', + * 'message' => 'Use anonymous functions instead please!', + * 'functions' => array( 'file_get_contents', 'create_function' ), + * ) + * ) + * + * @return array + */ + public function getGroups() { + return array( + 'i18n' => array( + 'functions' => array_keys( $this->i18n_functions ), + ), + 'typos' => array( + 'functions' => array( + '_', + ), + ), + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 1.0.0 Defers to the abstractFunctionRestriction sniff for determining + * whether something is a function call. The logic after that has + * been split off to the `process_matched_token()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function process_token( $stackPtr ) { + + // Reset defaults. + $this->text_domain_contains_default = false; + $this->text_domain_is_default = false; + + // Allow overruling the text_domain set in a ruleset via the command line. + $cl_text_domain = Helper::getConfigData( 'text_domain' ); + if ( ! empty( $cl_text_domain ) ) { + $cl_text_domain = trim( $cl_text_domain ); + if ( '' !== $cl_text_domain ) { + $this->text_domain = array_filter( array_map( 'trim', explode( ',', $cl_text_domain ) ) ); + } + } + + $this->text_domain = RulesetPropertyHelper::merge_custom_array( $this->text_domain, array(), false ); + + if ( ! empty( $this->text_domain ) ) { + if ( \in_array( 'default', $this->text_domain, true ) ) { + $this->text_domain_contains_default = true; + if ( \count( $this->text_domain ) === 1 ) { + $this->text_domain_is_default = true; + } + } + } + + // Prevent exclusion of the i18n group. + $this->exclude = array(); + + parent::process_token( $stackPtr ); + } + + /** + * Process a matched token. + * + * @since 1.0.0 Logic split off from the `process_token()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * + * @return void + */ + public function process_matched_token( $stackPtr, $group_name, $matched_content ) { + + $func_open_paren_token = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( ! isset( $this->tokens[ $func_open_paren_token ]['parenthesis_closer'] ) ) { + // Live coding, parse error or not a function call. + return; + } + + if ( 'typos' === $group_name && '_' === $matched_content ) { + $this->phpcsFile->addError( + 'Found single-underscore "_()" function when double-underscore expected.', + $stackPtr, + 'SingleUnderscoreGetTextFunction' + ); + return; + } + + if ( 'translate' === $matched_content || 'translate_with_gettext_context' === $matched_content ) { + $this->phpcsFile->addWarning( + 'Use of the "%s()" function is reserved for low-level API usage.', + $stackPtr, + 'LowLevelTranslationFunction', + array( $matched_content ) + ); + } + + parent::process_matched_token( $stackPtr, $group_name, $matched_content ); + } + + /** + * Process the function if no parameters were found. + * + * @since 3.0.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * + * @return void + */ + public function process_no_parameters( $stackPtr, $group_name, $matched_content ) { + $function_param_specs = $this->parameter_specs[ $this->i18n_functions[ $matched_content ] ]; + + foreach ( $function_param_specs as $param_name ) { + $error_code = MessageHelper::stringToErrorcode( 'MissingArg' . ucfirst( $param_name ) ); + $this->phpcsFile->addError( + 'Missing $%s parameter in function call to %s().', + $stackPtr, + $error_code, + array( $param_name, $matched_content ) + ); + } + } + + /** + * Process the parameters of a matched function. + * + * @since 3.0.0 + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $group_name The name of the group which was matched. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { + /* + * Retrieve the individual parameters from the array in a way that we know which is which. + */ + $parameter_details = array(); + + $function_param_specs = $this->parameter_specs[ $this->i18n_functions[ $matched_content ] ]; + $expected_args = count( $function_param_specs ); + + foreach ( $function_param_specs as $position => $name ) { + if ( 'number' === $name ) { + // This sniff does not examine the $number parameter. + continue; + } + + $parameter_details[ $name ] = PassedParameters::getParameterFromStack( $parameters, $position, $name ); + } + + /* + * Examine the individual parameters. + */ + $this->check_argument_count( $stackPtr, $matched_content, $parameters, $expected_args ); + + foreach ( $parameter_details as $param_name => $param_info ) { + $is_string_literal = $this->check_argument_is_string_literal( $stackPtr, $matched_content, $param_name, $param_info ); + + /* + * If the parameter exists, remember whether the argument was a valid string literal. + * This is used in a few places to determine whether the checks which examine a text string should run. + */ + if ( false !== $param_info ) { + $parameter_details[ $param_name ]['is_string_literal'] = $is_string_literal; + } + + if ( false === $is_string_literal ) { + continue; + } + + if ( 'domain' === $param_name ) { + $this->check_textdomain_matches( $matched_content, $param_name, $param_info ); + } + + if ( \in_array( $param_name, array( 'text', 'single', 'singular', 'plural' ), true ) ) { + $this->check_placeholders_in_string( $matched_content, $param_name, $param_info ); + $has_content = $this->check_string_has_translatable_content( $matched_content, $param_name, $param_info ); + if ( true === $has_content ) { + $this->check_string_has_no_html_wrapper( $matched_content, $param_name, $param_info ); + } + } + } + + /* + * For _n*() calls, compare the singular and plural strings. + * + * If either of the arguments is missing, empty or has more than 1 token, skip out. + * An error for that will already have been reported via the `check_argument_is_string_literal()` method. + */ + $single_details = null; + if ( isset( $parameter_details['single'] ) ) { + $single_details = $parameter_details['single']; + } elseif ( isset( $parameter_details['singular'] ) ) { + $single_details = $parameter_details['singular']; + } + + if ( isset( $single_details, $parameter_details['plural'] ) + && false !== $single_details + && false !== $parameter_details['plural'] + && true === $single_details['is_string_literal'] + && true === $parameter_details['plural']['is_string_literal'] + ) { + $this->compare_single_and_plural_arguments( $stackPtr, $single_details, $parameter_details['plural'] ); + } + + /* + * Check if a translators comments is necessary and if so, if it exists. + */ + $this->check_for_translator_comment( $stackPtr, $matched_content, $parameter_details ); + } + + /** + * Verify that there are no superfluous function arguments. + * + * @since 3.0.0 Check moved from the `process_matched_token()` method to this method. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters The parameters array. + * @param int $expected_count The expected number of passed arguments. + * + * @return void + */ + private function check_argument_count( $stackPtr, $matched_content, $parameters, $expected_count ) { + $actual_count = count( $parameters ); + if ( $actual_count > $expected_count ) { + $this->phpcsFile->addError( + 'Too many parameters passed to function "%s()". Expected: %s parameters, received: %s', + $stackPtr, + 'TooManyFunctionArgs', + array( $matched_content, $expected_count, $actual_count ) + ); + } + } + + /** + * Check if an arbitrary function call parameter is a text string literal suitable for use in the translation functions. + * + * Will also check and warn about missing parameters. + * + * @since 3.0.0 Most of the logic in this method used to be contained in the, now removed, `check_argument_tokens()` method. + * + * @param int $stackPtr The position of the current token in the stack. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param string $param_name The name of the parameter being examined. + * @param array|false $param_info Parameter info array for an individual parameter, + * as received from the PassedParemeters class. + * + * @return bool Whether or not the argument is a string literal. + */ + private function check_argument_is_string_literal( $stackPtr, $matched_content, $param_name, $param_info ) { + /* + * Check if the parameter was supplied. + */ + if ( false === $param_info || '' === $param_info['clean'] ) { + $error_code = MessageHelper::stringToErrorcode( 'MissingArg' . ucfirst( $param_name ) ); + + /* + * Special case the text domain parameter, which is allowed to be "missing" + * when set to `default` (= WP Core translation). + */ + if ( 'domain' === $param_name ) { + if ( empty( $this->text_domain ) ) { + // If no text domain is passed, presume WP Core. + return false; + } + + if ( true === $this->text_domain_is_default ) { + return false; + } + + if ( true === $this->text_domain_contains_default ) { + $this->phpcsFile->addWarning( + 'Missing $%s parameter in function call to %s(). If this text string is supposed to use a WP Core translation, use the "default" text domain.', + $stackPtr, + $error_code . 'Default', + array( $param_name, $matched_content ) + ); + return false; + } + } + + $this->phpcsFile->addError( + 'Missing $%s parameter in function call to %s().', + $stackPtr, + $error_code, + array( $param_name, $matched_content ) + ); + + return false; + } + + /* + * Check if the parameter consists of one singular text string literal. + * Heredoc/nowdocs not allowed. Multi-line single/double quoted strings are allowed. + */ + $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); + for ( $i = $first_non_empty; $i <= $param_info['end']; $i++ ) { + if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { + continue; + } + + if ( isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) === false ) { + $error_code = MessageHelper::stringToErrorcode( 'NonSingularStringLiteral' . ucfirst( $param_name ) ); + $this->phpcsFile->addError( + 'The $%s parameter must be a single text string literal. Found: %s', + $first_non_empty, + $error_code, + array( $param_name, $param_info['clean'] ) + ); + return false; + } + } + + /* + * Make sure the text string does not contain any interpolated variable. + */ + if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $first_non_empty ]['code'] ) { + $error_code = MessageHelper::stringToErrorcode( 'InterpolatedVariable' . ucfirst( $param_name ) ); + + $interpolated_variables = TextStrings::getEmbeds( $param_info['clean'] ); + foreach ( $interpolated_variables as $interpolated_variable ) { + $this->phpcsFile->addError( + 'The $%s parameter must not contain interpolated variables or expressions. Found: %s', + $first_non_empty, + $error_code, + array( $param_name, $interpolated_variable ) + ); + } + + if ( ! empty( $interpolated_variables ) ) { + return false; + } + } + + return true; + } + + /** + * Check the correct text domain is being used. + * + * @since 3.0.0 The logic in this method used to be contained in the, now removed, `check_argument_tokens()` method. + * + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param string $param_name The name of the parameter being examined. + * @param array|false $param_info Parameter info array for an individual parameter, + * as received from the PassedParemeters class. + * + * @return void + */ + private function check_textdomain_matches( $matched_content, $param_name, $param_info ) { + $stripped_content = TextStrings::stripQuotes( $param_info['clean'] ); + + if ( empty( $this->text_domain ) && '' === $stripped_content ) { + $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); + + $this->phpcsFile->addError( + 'The passed $domain should never be an empty string. Either pass a text domain or remove the parameter.', + $first_non_empty, + 'EmptyTextDomain' + ); + } + + if ( empty( $this->text_domain ) ) { + // Nothing more to do, the other checks all depend on a text domain being known. + return; + } + + if ( ! \in_array( $stripped_content, $this->text_domain, true ) ) { + $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); + + $this->phpcsFile->addError( + 'Mismatched text domain. Expected \'%s\' but got %s.', + $first_non_empty, + 'TextDomainMismatch', + array( implode( "' or '", $this->text_domain ), $param_info['clean'] ) + ); + return; + } + + if ( true === $this->text_domain_is_default && 'default' === $stripped_content ) { + $fixable = false; + $error = 'No need to supply the text domain in function call to %s() when the only accepted text domain is "default".'; + $error_code = 'SuperfluousDefaultTextDomain'; + $data = array( $matched_content ); + + $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); + + // Prevent removing comments when auto-fixing. + $remove_from = ( $param_info['start'] - 1 ); + $remove_to = $first_non_empty; + + if ( isset( $param_info['name_token'] ) ) { + $remove_from = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $param_info['name_token'] - 1 ), null, true ); + if ( \T_OPEN_PARENTHESIS === $this->tokens[ $remove_from ]['code'] ) { + ++$remove_from; // Don't remove the open parenthesis. + + /* + * Named param as first param in the function call, if we fix this, we need to + * remove the comma _after_ the parameter as well to prevent creating a parse error. + */ + $remove_to = $param_info['end']; + if ( \T_COMMA === $this->tokens[ ( $param_info['end'] + 1 ) ]['code'] ) { + ++$remove_to; // Include the comma. + } + } + } + + // Now, make sure there are no comments in the tokens we want to remove. + if ( $this->phpcsFile->findNext( Tokens::$commentTokens, $remove_from, ( $remove_to + 1 ) ) === false ) { + $fixable = true; + } + + if ( false === $fixable ) { + $this->phpcsFile->addWarning( $error, $first_non_empty, $error_code, $data ); + return; + } + + $fix = $this->phpcsFile->addFixableWarning( $error, $first_non_empty, $error_code, $data ); + if ( true === $fix ) { + $this->phpcsFile->fixer->beginChangeset(); + for ( $i = $remove_from; $i <= $remove_to; $i++ ) { + $this->phpcsFile->fixer->replaceToken( $i, '' ); + } + $this->phpcsFile->fixer->endChangeset(); + } + } + } + + /** + * Check the placeholders used in translatable text for common problems. + * + * @since 3.0.0 The logic in this method used to be contained in the, now removed, `check_text()` method. + * + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param string $param_name The name of the parameter being examined. + * @param array|false $param_info Parameter info array for an individual parameter, + * as received from the PassedParemeters class. + * + * @return void + */ + private function check_placeholders_in_string( $matched_content, $param_name, $param_info ) { + $content = $param_info['clean']; + + // UnorderedPlaceholders: Check for multiple unordered placeholders. + $unordered_matches_count = preg_match_all( self::UNORDERED_SPRINTF_PLACEHOLDER_REGEX, $content, $unordered_matches ); + $unordered_matches = $unordered_matches[0]; + $all_matches_count = preg_match_all( self::SPRINTF_PLACEHOLDER_REGEX, $content, $all_matches ); + + if ( $unordered_matches_count > 0 + && $unordered_matches_count !== $all_matches_count + && $all_matches_count > 1 + ) { + $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); + $error_code = MessageHelper::stringToErrorcode( 'MixedOrderedPlaceholders' . ucfirst( $param_name ) ); + + $this->phpcsFile->addError( + 'Multiple placeholders in translatable strings should be ordered. Mix of ordered and non-ordered placeholders found. Found: "%s" in %s.', + $first_non_empty, + $error_code, + array( implode( ', ', $all_matches[0] ), $param_info['clean'] ) + ); + return; + } + + if ( $unordered_matches_count >= 2 ) { + $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); + $error_code = MessageHelper::stringToErrorcode( 'UnorderedPlaceholders' . ucfirst( $param_name ) ); + + $suggestions = array(); + $replace_regexes = array(); + $replacements = array(); + for ( $i = 0; $i < $unordered_matches_count; $i++ ) { + $to_insert = ( $i + 1 ); + $to_insert .= ( '"' !== $content[0] ) ? '$' : '\$'; + $suggestions[ $i ] = substr_replace( $unordered_matches[ $i ], $to_insert, 1, 0 ); + + // Prepare the strings for use in a regex. + $replace_regexes[ $i ] = '`\Q' . $unordered_matches[ $i ] . '\E`'; + // Note: the initial \\ is a literal \, the four \ in the replacement translate also to a literal \. + $replacements[ $i ] = str_replace( '\\', '\\\\', $suggestions[ $i ] ); + // Note: the $ needs escaping to prevent numeric sequences after the $ being interpreted as match replacements. + $replacements[ $i ] = str_replace( '$', '\\$', $replacements[ $i ] ); + } + + $fix = $this->phpcsFile->addFixableError( + 'Multiple placeholders in translatable strings should be ordered. Expected "%s", but got "%s" in %s.', + $first_non_empty, + $error_code, + array( implode( ', ', $suggestions ), implode( ', ', $unordered_matches ), $param_info['clean'] ) + ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->beginChangeset(); + + $fixed_str = preg_replace( $replace_regexes, $replacements, $content, 1 ); + + $this->phpcsFile->fixer->replaceToken( $first_non_empty, $fixed_str ); + + $i = ( $first_non_empty + 1 ); + while ( $i <= $param_info['end'] && isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) ) { + $this->phpcsFile->fixer->replaceToken( $i, '' ); + ++$i; + } + + $this->phpcsFile->fixer->endChangeset(); + } + } + } + + /** + * Check if a parameter which is supposed to hold translatable text actually has translatable text. + * + * @since 3.0.0 The logic in this method used to be contained in the, now removed, `check_text()` method. + * + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param string $param_name The name of the parameter being examined. + * @param array|false $param_info Parameter info array for an individual parameter, + * as received from the PassedParemeters class. + * + * @return bool Whether or not the text string has translatable content. + */ + private function check_string_has_translatable_content( $matched_content, $param_name, $param_info ) { + // Strip placeholders and surrounding quotes. + $content_without_quotes = trim( TextStrings::stripQuotes( $param_info['clean'] ) ); + $non_placeholder_content = preg_replace( self::SPRINTF_PLACEHOLDER_REGEX, '', $content_without_quotes ); + + if ( '' === $non_placeholder_content ) { + $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); + + $this->phpcsFile->addError( + 'The $%s text string should have translatable content. Found: %s', + $first_non_empty, + 'NoEmptyStrings', + array( $param_name, $param_info['clean'] ) + ); + return false; + } + + return true; + } + + /** + * Ensure that a translatable text string is not wrapped in HTML code. + * + * If the text is wrapped in HTML, the HTML should be moved out of the translatable text string. + * + * @since 3.0.0 The logic in this method used to be contained in the, now removed, `check_text()` method. + * + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param string $param_name The name of the parameter being examined. + * @param array|false $param_info Parameter info array for an individual parameter, + * as received from the PassedParemeters class. + * + * @return void + */ + private function check_string_has_no_html_wrapper( $matched_content, $param_name, $param_info ) { + // Strip surrounding quotes. + $content_without_quotes = trim( TextStrings::stripQuotes( $param_info['clean'] ) ); + + $reader = new XMLReader(); + $reader->XML( $content_without_quotes, 'UTF-8', \LIBXML_NOERROR | \LIBXML_ERR_NONE | \LIBXML_NOWARNING ); + + // Is the first node an HTML element? + if ( ! $reader->read() || XMLReader::ELEMENT !== $reader->nodeType ) { + return; + } + + // If the opening HTML element includes placeholders in its attributes, we don't warn. + // E.g. ''. + $i = 0; + while ( $attr = $reader->getAttributeNo( $i ) ) { + if ( preg_match( self::SPRINTF_PLACEHOLDER_REGEX, $attr ) === 1 ) { + return; + } + + ++$i; + } + + // We don't flag strings wrapped in `...`, as the link target might actually need localization. + if ( 'a' === $reader->name && $reader->getAttribute( 'href' ) ) { + return; + } + + // Does the entire string only consist of this HTML node? + if ( $reader->readOuterXml() === $content_without_quotes ) { + $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); + + $this->phpcsFile->addWarning( + 'Translatable string should not be wrapped in HTML. Found: %s', + $first_non_empty, + 'NoHtmlWrappedStrings', + array( $param_info['clean'] ) + ); + } + } + + /** + * Check for inconsistencies in the placeholders between single and plural form of the translatable text string. + * + * @since 3.0.0 - The parameter names and expected format for the $param_info_single + * and the $param_info_plural parameters has changed. + * - The method visibility has been changed from `protected` to `private`. + * + * @param int $stackPtr The position of the function call token in the stack. + * @param array $param_info_single Parameter info array for the `$single` parameter, + * as received from the PassedParemeters class. + * @param array $param_info_plural Parameter info array for the `$plural` parameter, + * as received from the PassedParemeters class. + * + * @return void + */ + private function compare_single_and_plural_arguments( $stackPtr, $param_info_single, $param_info_plural ) { + $single_content = $param_info_single['clean']; + $plural_content = $param_info_plural['clean']; + + preg_match_all( self::SPRINTF_PLACEHOLDER_REGEX, $single_content, $single_placeholders ); + $single_placeholders = $single_placeholders[0]; + + preg_match_all( self::SPRINTF_PLACEHOLDER_REGEX, $plural_content, $plural_placeholders ); + $plural_placeholders = $plural_placeholders[0]; + + // English conflates "singular" with "only one", described in the codex: + // https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals . + if ( \count( $single_placeholders ) < \count( $plural_placeholders ) ) { + $error_string = 'Missing singular placeholder, needed for some languages. See https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals'; + $first_non_empty_single = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info_single['start'], ( $param_info_single['end'] + 1 ), true ); + + $this->phpcsFile->addError( $error_string, $first_non_empty_single, 'MissingSingularPlaceholder' ); + return; + } + + // Reordering is fine, but mismatched placeholders is probably wrong. + sort( $single_placeholders, \SORT_NATURAL ); + sort( $plural_placeholders, \SORT_NATURAL ); + + if ( $single_placeholders !== $plural_placeholders ) { + $this->phpcsFile->addWarning( 'Mismatched placeholders is probably an error', $stackPtr, 'MismatchedPlaceholders' ); + } + } + + /** + * Check for the presence of a translators comment if one of the text strings contains a placeholder. + * + * @since 3.0.0 - The parameter names and expected format for the $parameters parameter has changed. + * - The method visibility has been changed from `protected` to `private`. + * + * @param int $stackPtr The position of the gettext call token in the stack. + * @param string $matched_content The token content (function name) which was matched + * in lowercase. + * @param array $parameters Array with information about the parameters. + * + * @return void + */ + private function check_for_translator_comment( $stackPtr, $matched_content, $parameters ) { + $needs_translators_comment = false; + + foreach ( $parameters as $param_name => $param_info ) { + if ( false === \in_array( $param_name, array( 'text', 'single', 'singular', 'plural' ), true ) ) { + continue; + } + + if ( false === $param_info || false === $param_info['is_string_literal'] ) { + continue; + } + + if ( preg_match( self::SPRINTF_PLACEHOLDER_REGEX, $param_info['clean'], $placeholders ) === 1 ) { + $needs_translators_comment = true; + break; + } + } + + if ( false === $needs_translators_comment ) { + // No text string with placeholders found, no translation comment needed. + return; + } + + $previous_comment = $this->phpcsFile->findPrevious( Tokens::$commentTokens, ( $stackPtr - 1 ) ); + + if ( false !== $previous_comment ) { + /* + * Check that the comment is either on the line before the gettext call or + * if it's not, that there is only whitespace between. + */ + $correctly_placed = false; + + if ( ( $this->tokens[ $previous_comment ]['line'] + 1 ) === $this->tokens[ $stackPtr ]['line'] ) { + $correctly_placed = true; + } else { + $next_non_whitespace = $this->phpcsFile->findNext( \T_WHITESPACE, ( $previous_comment + 1 ), $stackPtr, true ); + if ( false === $next_non_whitespace || $this->tokens[ $next_non_whitespace ]['line'] === $this->tokens[ $stackPtr ]['line'] ) { + // No non-whitespace found or next non-whitespace is on same line as gettext call. + $correctly_placed = true; + } + unset( $next_non_whitespace ); + } + + /* + * Check that the comment starts with 'translators:'. + */ + if ( true === $correctly_placed ) { + if ( \T_COMMENT === $this->tokens[ $previous_comment ]['code'] ) { + $comment_text = trim( $this->tokens[ $previous_comment ]['content'] ); + + // If it's multi-line /* */ comment, collect all the parts. + if ( '*/' === substr( $comment_text, -2 ) && '/*' !== substr( $comment_text, 0, 2 ) ) { + for ( $i = ( $previous_comment - 1 ); 0 <= $i; $i-- ) { + if ( \T_COMMENT !== $this->tokens[ $i ]['code'] ) { + break; + } + + $comment_text = trim( $this->tokens[ $i ]['content'] ) . $comment_text; + } + } + + if ( true === $this->is_translators_comment( $comment_text ) ) { + // Comment is ok. + return; + } + } + + if ( \T_DOC_COMMENT_CLOSE_TAG === $this->tokens[ $previous_comment ]['code'] ) { + // If it's docblock comment (wrong style) make sure that it's a translators comment. + if ( isset( $this->tokens[ $previous_comment ]['comment_opener'] ) ) { + $db_start = $this->tokens[ $previous_comment ]['comment_opener']; + } else { + $db_start = $this->phpcsFile->findPrevious( \T_DOC_COMMENT_OPEN_TAG, ( $previous_comment - 1 ) ); + } + + $db_first_text = $this->phpcsFile->findNext( \T_DOC_COMMENT_STRING, ( $db_start + 1 ), $previous_comment ); + + if ( true === $this->is_translators_comment( $this->tokens[ $db_first_text ]['content'] ) ) { + $this->phpcsFile->addWarning( + 'A "translators:" comment must be a "/* */" style comment. Docblock comments will not be picked up by the tools to generate a ".pot" file.', + $stackPtr, + 'TranslatorsCommentWrongStyle' + ); + return; + } + } + } + } + + // Found placeholders but no translators comment. + $this->phpcsFile->addWarning( + 'A function call to %s() with texts containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.', + $stackPtr, + 'MissingTranslatorsComment', + array( $matched_content ) + ); + } + + /** + * Check if a (collated) comment string starts with 'translators:'. + * + * @since 0.11.0 + * + * @param string $content Comment string content. + * + * @return bool + */ + private function is_translators_comment( $content ) { + if ( preg_match( '`^(?:(?://|/\*{1,2}) )?translators:`i', $content, $matches ) === 1 ) { + return true; + } + return false; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php new file mode 100644 index 00000000..e2575cbd --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php @@ -0,0 +1,102 @@ + array( + 'type' => 'warning', + 'message' => 'Detected high pagination limit, `%s` is set to `%s`', + 'keys' => array( + 'posts_per_page', + 'numberposts', + ), + ), + ); + } + + /** + * Callback to process each confirmed key, to check value. + * + * @param string $key Array index / key. + * @param mixed $val Assigned value. + * @param int $line Token line. + * @param array $group Group definition. + * + * @return bool FALSE if no match, TRUE if matches. + */ + public function callback( $key, $val, $line, $group ) { + $stripped_val = TextStrings::stripQuotes( $val ); + + if ( '' === $stripped_val ) { + return false; + } + + if ( $val !== $stripped_val ) { + // The value was a text string. For text strings, we only accept purely numeric values. + if ( preg_match( '`^[0-9]+$`', $stripped_val ) !== 1 ) { + // Not a purely numeric value, so any comparison would be a false comparison. + return false; + } + + // Purely numeric string, treat it as an integer from here on out. + $val = $stripped_val; + } + + $first_char = $val[0]; + if ( '-' === $first_char || '+' === $first_char ) { + $val = ltrim( $val, '-+' ); + } else { + $first_char = ''; + } + + $real_value = Numbers::getDecimalValue( $val ); + if ( false === $real_value ) { + // This wasn't a purely numeric value, so any comparison would be a false comparison. + return false; + } + + $val = $first_char . $real_value; + + return ( (int) $val > (int) $this->posts_per_page ); + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php new file mode 100755 index 00000000..b00303ed --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php @@ -0,0 +1,59 @@ +tokens[ ( $stackPtr - 1 ) ]['code'] + && \T_ELLIPSIS !== $this->tokens[ ( $stackPtr - 1 ) ]['code'] + ) { + $error = 'Expected a space before the type cast open parenthesis; none found'; + $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpaceBeforeOpenParenthesis' ); + if ( true === $fix ) { + $this->phpcsFile->fixer->addContentBefore( $stackPtr, ' ' ); + } + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php new file mode 100644 index 00000000..995216a5 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php @@ -0,0 +1,486 @@ + true, + \T_ELSE => true, + \T_TRY => true, + \T_FINALLY => true, + ); + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() { + return array( + \T_IF, + \T_WHILE, + \T_FOREACH, + \T_FOR, + \T_SWITCH, + \T_DO, + \T_ELSE, + \T_ELSEIF, + \T_TRY, + \T_CATCH, + \T_FINALLY, + \T_MATCH, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param int $stackPtr The position of the current token in the stack. + * + * @return void + */ + public function process_token( $stackPtr ) { + if ( isset( $this->tokens[ ( $stackPtr + 1 ) ] ) && \T_WHITESPACE !== $this->tokens[ ( $stackPtr + 1 ) ]['code'] + && ! ( \T_ELSE === $this->tokens[ $stackPtr ]['code'] && \T_COLON === $this->tokens[ ( $stackPtr + 1 ) ]['code'] ) + ) { + $error = 'Space after opening control structure is required'; + $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpaceAfterStructureOpen' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->addContent( $stackPtr, ' ' ); + } + } + + if ( ! isset( $this->tokens[ $stackPtr ]['scope_opener'], $this->tokens[ $stackPtr ]['scope_closer'] ) ) { + if ( \T_WHILE !== $this->tokens[ $stackPtr ]['code'] ) { + return; + } + } else { + $scopeOpener = $this->tokens[ $stackPtr ]['scope_opener']; + $scopeCloser = $this->tokens[ $stackPtr ]['scope_closer']; + } + + // Alternative syntax. + if ( isset( $scopeOpener ) && \T_COLON === $this->tokens[ $scopeOpener ]['code'] ) { + + if ( 'required' === $this->space_before_colon ) { + + if ( \T_WHITESPACE !== $this->tokens[ ( $scopeOpener - 1 ) ]['code'] ) { + $error = 'Space between opening control structure and T_COLON is required'; + $fix = $this->phpcsFile->addFixableError( $error, $scopeOpener, 'NoSpaceBetweenStructureColon' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->addContentBefore( $scopeOpener, ' ' ); + } + } + } elseif ( 'forbidden' === $this->space_before_colon ) { + + if ( \T_WHITESPACE === $this->tokens[ ( $scopeOpener - 1 ) ]['code'] ) { + $error = 'Extra space between opening control structure and T_COLON found'; + $fix = $this->phpcsFile->addFixableError( $error, ( $scopeOpener - 1 ), 'SpaceBetweenStructureColon' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->replaceToken( ( $scopeOpener - 1 ), '' ); + } + } + } + } + + $parenthesisOpener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + + if ( \T_COLON !== $this->tokens[ $parenthesisOpener ]['code'] + && ( $stackPtr + 1 ) === $parenthesisOpener + ) { + // Checking space between keyword and open parenthesis, i.e. `if[*](...) {}`. + $error = 'No space before opening parenthesis is prohibited'; + $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpaceBeforeOpenParenthesis' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->addContent( $stackPtr, ' ' ); + } + } + + if ( \T_WHITESPACE === $this->tokens[ ( $stackPtr + 1 ) ]['code'] + && ' ' !== $this->tokens[ ( $stackPtr + 1 ) ]['content'] + ) { + // Checking (too much) space between keyword and open parenthesis, i.e. `if [*](...) {}`. + $error = 'Expected exactly one space before opening parenthesis; "%s" found.'; + $fix = $this->phpcsFile->addFixableError( + $error, + $stackPtr, + 'ExtraSpaceBeforeOpenParenthesis', + array( $this->tokens[ ( $stackPtr + 1 ) ]['content'] ) + ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->replaceToken( ( $stackPtr + 1 ), ' ' ); + } + } + + if ( \T_CLOSE_PARENTHESIS !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['code'] ) { + if ( \T_WHITESPACE !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['code'] ) { + // Checking space directly after the open parenthesis, i.e. `if ([*]...) {}`. + $error = 'No space after opening parenthesis is prohibited'; + $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpaceAfterOpenParenthesis' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->addContent( $parenthesisOpener, ' ' ); + } + } elseif ( ( ' ' !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] + && "\n" !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] + && "\r\n" !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] ) + && ! isset( $this->ignore_extra_space_after_open_paren[ $this->tokens[ $stackPtr ]['code'] ] ) + ) { + // Checking (too much) space directly after the open parenthesis, i.e. `if ([*]...) {}`. + $error = 'Expected exactly one space after opening parenthesis; "%s" found.'; + $fix = $this->phpcsFile->addFixableError( + $error, + $stackPtr, + 'ExtraSpaceAfterOpenParenthesis', + array( $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] ) + ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->replaceToken( ( $parenthesisOpener + 1 ), ' ' ); + } + } + } + + if ( isset( $this->tokens[ $parenthesisOpener ]['parenthesis_closer'] ) ) { + + $parenthesisCloser = $this->tokens[ $parenthesisOpener ]['parenthesis_closer']; + + if ( \T_CLOSE_PARENTHESIS !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['code'] ) { + + // Checking space directly before the close parenthesis, i.e. `if (...[*]) {}`. + if ( \T_WHITESPACE !== $this->tokens[ ( $parenthesisCloser - 1 ) ]['code'] ) { + $error = 'No space before closing parenthesis is prohibited'; + $fix = $this->phpcsFile->addFixableError( $error, $parenthesisCloser, 'NoSpaceBeforeCloseParenthesis' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->addContentBefore( $parenthesisCloser, ' ' ); + } + } elseif ( ' ' !== $this->tokens[ ( $parenthesisCloser - 1 ) ]['content'] ) { + $prevNonEmpty = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $parenthesisCloser - 1 ), null, true ); + if ( $this->tokens[ ( $parenthesisCloser ) ]['line'] === $this->tokens[ ( $prevNonEmpty + 1 ) ]['line'] ) { + $error = 'Expected exactly one space before closing parenthesis; "%s" found.'; + $fix = $this->phpcsFile->addFixableError( + $error, + $stackPtr, + 'ExtraSpaceBeforeCloseParenthesis', + array( $this->tokens[ ( $parenthesisCloser - 1 ) ]['content'] ) + ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->replaceToken( ( $parenthesisCloser - 1 ), ' ' ); + } + } + } + + if ( \T_WHITESPACE !== $this->tokens[ ( $parenthesisCloser + 1 ) ]['code'] + && ( isset( $scopeOpener ) && \T_COLON !== $this->tokens[ $scopeOpener ]['code'] ) + ) { + $error = 'Space between opening control structure and closing parenthesis is required'; + $fix = $this->phpcsFile->addFixableError( $error, $scopeOpener, 'NoSpaceAfterCloseParenthesis' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->addContentBefore( $scopeOpener, ' ' ); + } + } + } + + if ( isset( $this->tokens[ $parenthesisOpener ]['parenthesis_owner'] ) + && ( isset( $scopeOpener ) + && $this->tokens[ $parenthesisCloser ]['line'] !== $this->tokens[ $scopeOpener ]['line'] ) + ) { + $error = 'Opening brace should be on the same line as the declaration'; + $fix = $this->phpcsFile->addFixableError( $error, $parenthesisOpener, 'OpenBraceNotSameLine' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->beginChangeset(); + + for ( $i = ( $parenthesisCloser + 1 ); $i < $scopeOpener; $i++ ) { + $this->phpcsFile->fixer->replaceToken( $i, '' ); + } + + $this->phpcsFile->fixer->addContent( $parenthesisCloser, ' ' ); + $this->phpcsFile->fixer->endChangeset(); + } + return; + + } elseif ( \T_WHITESPACE === $this->tokens[ ( $parenthesisCloser + 1 ) ]['code'] + && ' ' !== $this->tokens[ ( $parenthesisCloser + 1 ) ]['content'] + ) { + // Checking space between the close parenthesis and the open brace, i.e. `if (...) [*]{}`. + $error = 'Expected exactly one space between closing parenthesis and opening control structure; "%s" found.'; + $fix = $this->phpcsFile->addFixableError( + $error, + $stackPtr, + 'ExtraSpaceAfterCloseParenthesis', + array( $this->tokens[ ( $parenthesisCloser + 1 ) ]['content'] ) + ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->replaceToken( ( $parenthesisCloser + 1 ), ' ' ); + } + } + } + + if ( false !== $this->blank_line_check && isset( $scopeOpener ) ) { + $firstContent = $this->phpcsFile->findNext( \T_WHITESPACE, ( $scopeOpener + 1 ), null, true ); + + // We ignore spacing for some structures that tend to have their own rules. + $ignore = array( + \T_DOC_COMMENT_OPEN_TAG => true, + \T_CLOSE_TAG => true, + \T_COMMENT => true, + ); + $ignore += Collections::closedScopes(); + + if ( ! isset( $ignore[ $this->tokens[ $firstContent ]['code'] ] ) + && $this->tokens[ $firstContent ]['line'] > ( $this->tokens[ $scopeOpener ]['line'] + 1 ) + ) { + $gap = ( $this->tokens[ $firstContent ]['line'] - $this->tokens[ $scopeOpener ]['line'] - 1 ); + $this->phpcsFile->recordMetric( $stackPtr, 'Blank lines at start of control structure', $gap ); + + $error = 'Blank line found at start of control structure'; + $fix = $this->phpcsFile->addFixableError( $error, $scopeOpener, 'BlankLineAfterStart' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->beginChangeset(); + + for ( $i = ( $scopeOpener + 1 ); $i < $firstContent; $i++ ) { + if ( $this->tokens[ $i ]['line'] === $this->tokens[ $firstContent ]['line'] ) { + break; + } + $this->phpcsFile->fixer->replaceToken( $i, '' ); + } + + $this->phpcsFile->fixer->addNewline( $scopeOpener ); + $this->phpcsFile->fixer->endChangeset(); + } + } else { + $this->phpcsFile->recordMetric( $stackPtr, 'Blank lines at start of control structure', 0 ); + } + + if ( isset( $scopeCloser ) && $firstContent !== $scopeCloser ) { + $lastContent = $this->phpcsFile->findPrevious( \T_WHITESPACE, ( $scopeCloser - 1 ), null, true ); + + $lastNonEmptyContent = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $scopeCloser - 1 ), null, true ); + + $checkToken = $lastContent; + if ( isset( $this->tokens[ $lastNonEmptyContent ]['scope_condition'] ) ) { + $checkToken = $this->tokens[ $lastNonEmptyContent ]['scope_condition']; + } + + if ( ! isset( $ignore[ $this->tokens[ $checkToken ]['code'] ] ) + && $this->tokens[ $lastContent ]['line'] <= ( $this->tokens[ $scopeCloser ]['line'] - 2 ) + ) { + $gap = ( $this->tokens[ $scopeCloser ]['line'] - $this->tokens[ $lastContent ]['line'] - 1 ); + $this->phpcsFile->recordMetric( $stackPtr, 'Blank lines at end of control structure', $gap ); + + for ( $i = ( $scopeCloser - 1 ); $i > $lastContent; $i-- ) { + if ( $this->tokens[ $i ]['line'] < $this->tokens[ $scopeCloser ]['line'] + && \T_OPEN_TAG !== $this->tokens[ $firstContent ]['code'] + ) { + // TODO: Reporting error at empty line won't highlight it in IDE. + $error = 'Blank line found at end of control structure'; + $fix = $this->phpcsFile->addFixableError( $error, $i, 'BlankLineBeforeEnd' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->beginChangeset(); + + for ( $j = ( $lastContent + 1 ); $j < $scopeCloser; $j++ ) { + if ( $this->tokens[ $j ]['line'] === $this->tokens[ $scopeCloser ]['line'] ) { + break; + } + $this->phpcsFile->fixer->replaceToken( $j, '' ); + } + + /* + * PHPCS annotations, like normal inline comments, are tokenized including + * the new line at the end, so don't add any extra as it would cause a fixer + * conflict. + */ + if ( \T_COMMENT !== $this->tokens[ $lastContent ]['code'] + && ! isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $lastContent ]['code'] ] ) ) { + $this->phpcsFile->fixer->addNewlineBefore( $j ); + } + + $this->phpcsFile->fixer->endChangeset(); + } + break; + } + } + } else { + $this->phpcsFile->recordMetric( $stackPtr, 'Blank lines at end of control structure', 0 ); + } + } + unset( $ignore ); + } + + if ( ! isset( $scopeCloser ) || true !== $this->blank_line_after_check ) { + return; + } + + if ( \T_MATCH === $this->tokens[ $stackPtr ]['code'] ) { + // Move the scope closer to the semicolon/comma. + $next = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $scopeCloser + 1 ), null, true ); + if ( false !== $next + && ( \T_SEMICOLON === $this->tokens[ $next ]['code'] || \T_COMMA === $this->tokens[ $next ]['code'] ) + ) { + $scopeCloser = $next; + } + } + + // {@internal This is just for the blank line check. Only whitespace should be considered, + // not "other" empty tokens.}} + $trailingContent = $this->phpcsFile->findNext( \T_WHITESPACE, ( $scopeCloser + 1 ), null, true ); + if ( false === $trailingContent ) { + return; + } + + if ( \T_COMMENT === $this->tokens[ $trailingContent ]['code'] + || isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $trailingContent ]['code'] ] ) + ) { + // Special exception for code where the comment about + // an ELSE or ELSEIF is written between the control structures. + $nextCode = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $scopeCloser + 1 ), null, true ); + + if ( \T_ELSE === $this->tokens[ $nextCode ]['code'] || \T_ELSEIF === $this->tokens[ $nextCode ]['code'] ) { + $trailingContent = $nextCode; + } + + // Move past end comments. + if ( $this->tokens[ $trailingContent ]['line'] === $this->tokens[ $scopeCloser ]['line'] ) { + if ( preg_match( '`^//[ ]?end`i', $this->tokens[ $trailingContent ]['content'], $matches ) > 0 ) { + $scopeCloser = $trailingContent; + $trailingContent = $this->phpcsFile->findNext( \T_WHITESPACE, ( $trailingContent + 1 ), null, true ); + } + } + } + + if ( \T_ELSE === $this->tokens[ $trailingContent ]['code'] && \T_IF === $this->tokens[ $stackPtr ]['code'] ) { + // IF with ELSE. + return; + } + + if ( \T_WHILE === $this->tokens[ $trailingContent ]['code'] && \T_DO === $this->tokens[ $stackPtr ]['code'] ) { + // DO with WHILE. + return; + } + + if ( \T_CATCH === $this->tokens[ $trailingContent ]['code'] && \T_TRY === $this->tokens[ $stackPtr ]['code'] ) { + // TRY with CATCH. + return; + } + + if ( \T_FINALLY === $this->tokens[ $trailingContent ]['code'] && \T_CATCH === $this->tokens[ $stackPtr ]['code'] ) { + // CATCH with FINALLY. + return; + } + + if ( \T_FINALLY === $this->tokens[ $trailingContent ]['code'] && \T_TRY === $this->tokens[ $stackPtr ]['code'] ) { + // TRY with FINALLY. + return; + } + + if ( \T_CLOSE_TAG === $this->tokens[ $trailingContent ]['code'] ) { + // At the end of the script or embedded code. + return; + } + + if ( isset( $this->tokens[ $trailingContent ]['scope_condition'] ) + && \T_CLOSE_CURLY_BRACKET === $this->tokens[ $trailingContent ]['code'] + ) { + // Another control structure's closing brace. + $owner = $this->tokens[ $trailingContent ]['scope_condition']; + if ( isset( Collections::closedScopes()[ $this->tokens[ $owner ]['code'] ] ) === true ) { + // The next content is the closing brace of a function, class, interface or trait + // so normal function/class rules apply and we can ignore it. + return; + } + + if ( ( $this->tokens[ $scopeCloser ]['line'] + 1 ) !== $this->tokens[ $trailingContent ]['line'] ) { + // TODO: Won't cover following case: "} echo 'OK';". + $error = 'Blank line found after control structure'; + $fix = $this->phpcsFile->addFixableError( $error, $scopeCloser, 'BlankLineAfterEnd' ); + + if ( true === $fix ) { + $this->phpcsFile->fixer->beginChangeset(); + + $i = ( $scopeCloser + 1 ); + while ( $this->tokens[ $i ]['line'] !== $this->tokens[ $trailingContent ]['line'] ) { + $this->phpcsFile->fixer->replaceToken( $i, '' ); + ++$i; + } + + // TODO: Instead a separate error should be triggered when content comes right after closing brace. + if ( \T_COMMENT !== $this->tokens[ $scopeCloser ]['code'] + && isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $scopeCloser ]['code'] ] ) === false + ) { + $this->phpcsFile->fixer->addNewlineBefore( $trailingContent ); + } + $this->phpcsFile->fixer->endChangeset(); + } + } + } + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php new file mode 100644 index 00000000..a832b4f2 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php @@ -0,0 +1,63 @@ +getTokens(); + $property_adjusted = false; + + // Check for `::class` and don't ignore new lines in that case. + if ( true === $this->ignoreNewlines + && \T_DOUBLE_COLON === $tokens[ $stackPtr ]['code'] + ) { + $next_non_empty = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); + if ( \T_STRING === $tokens[ $next_non_empty ]['code'] + && 'class' === strtolower( $tokens[ $next_non_empty ]['content'] ) + ) { + $property_adjusted = true; + $this->ignoreNewlines = false; + } + } + + $return = parent::process( $phpcsFile, $stackPtr ); + + if ( true === $property_adjusted ) { + $this->ignoreNewlines = true; + } + + return $return; + } +} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php new file mode 100644 index 00000000..2caa937d --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php @@ -0,0 +1,60 @@ + + + + WordPress Coding Standards + + + + + + diff --git a/trunk/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample b/trunk/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample new file mode 100644 index 00000000..fa456b58 --- /dev/null +++ b/trunk/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample @@ -0,0 +1,153 @@ + + + + A custom set of rules to check for a WPized WordPress project + + + + . + + + /docroot/wp-admin/* + /docroot/wp-includes/* + /docroot/wp-*.php + /docroot/index.php + /docroot/xmlrpc.php + /docroot/wp-content/plugins/* + + + /vendor/* + + + /node_modules/* + + + *.min.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /path/to/Tests/*Test\.php + + + /path/to/Tests/*Test\.php + + + diff --git a/trunk/wc-serial-numbers.php b/trunk/wc-serial-numbers.php new file mode 100644 index 00000000..e2e0a758 --- /dev/null +++ b/trunk/wc-serial-numbers.php @@ -0,0 +1,72 @@ + __FILE__, + 'settings_url' => admin_url( 'admin.php?page=wc-serial-numbers-settings' ), + 'support_url' => 'https://pluginever.com/support/', + 'docs_url' => 'https://pluginever.com/docs/wocommerce-serial-numbers/', + 'premium_url' => 'https://pluginever.com/plugins/woocommerce-serial-numbers-pro/', + 'premium_basename' => 'wc-serial-numbers-pro', + 'review_url' => 'https://wordpress.org/support/plugin/wc-serial-numbers/reviews/?filter=5#new-post', + ); + + return Plugin::create( $data ); +} + +/** + * Alias of WCSN(). + * + * @since 1.5.6 + * @return Plugin + * @deprecated 1.5.6 + */ +function wc_serial_numbers() { + return WCSN(); +} + +// Initialize the plugin. +WCSN(); From 4415f5cd0b5c76bad44cae583e5542c5fb71a5f5 Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Wed, 31 Jul 2024 15:52:12 +0600 Subject: [PATCH 5/5] Update readme file --- trunk/assets/blocks/index.js | 0 trunk/assets/dist/blocks/blocks.asset.php | 1 - trunk/assets/dist/blocks/blocks.js | 0 trunk/assets/dist/css/admin-style.asset.php | 1 - trunk/assets/dist/css/admin-style.css | 1 - .../assets/dist/css/frontend-style.asset.php | 1 - trunk/assets/dist/css/frontend-style.css | 1 - trunk/assets/dist/images/add-generator.png | Bin 82665 -> 0 bytes trunk/assets/dist/images/csv-export.png | Bin 70115 -> 0 bytes trunk/assets/dist/images/csv-import.png | Bin 57578 -> 0 bytes trunk/assets/dist/images/txt-import.png | Bin 79528 -> 0 bytes trunk/assets/dist/js/admin-script.asset.php | 1 - trunk/assets/dist/js/admin-script.js | 1 - .../assets/dist/js/frontend-script.asset.php | 1 - trunk/assets/dist/js/frontend-script.js | 1 - trunk/assets/images/add-generator.png | Bin 82665 -> 0 bytes trunk/assets/images/csv-export.png | Bin 70115 -> 0 bytes trunk/assets/images/csv-import.png | Bin 57578 -> 0 bytes trunk/assets/images/txt-import.png | Bin 79528 -> 0 bytes trunk/examples/api-test.txt | 96 - trunk/languages/wc-serial-numbers.pot | 1543 ---- trunk/readme.txt | 534 -- trunk/src/API.php | 90 - trunk/src/Actions.php | 129 - trunk/src/Admin/Actions.php | 253 - trunk/src/Admin/Admin.php | 186 - .../src/Admin/ListTables/ActivationsTable.php | 289 - trunk/src/Admin/ListTables/KeysTable.php | 559 -- trunk/src/Admin/ListTables/ListTable.php | 208 - trunk/src/Admin/ListTables/StockTable.php | 197 - trunk/src/Admin/Menus.php | 518 -- trunk/src/Admin/Metaboxes.php | 283 - trunk/src/Admin/Notices.php | 166 - trunk/src/Admin/Orders.php | 280 - trunk/src/Admin/Products.php | 76 - trunk/src/Admin/Settings.php | 193 - trunk/src/Admin/views/html-add-key.php | 199 - trunk/src/Admin/views/html-api-actions.php | 201 - trunk/src/Admin/views/html-api-validation.php | 170 - trunk/src/Admin/views/html-edit-key.php | 198 - .../src/Admin/views/html-list-activations.php | 32 - trunk/src/Admin/views/html-list-keys.php | 51 - trunk/src/Admin/views/html-list-stock.php | 21 - trunk/src/Admin/views/html-reports.php | 25 - trunk/src/Admin/views/html-tools.php | 25 - trunk/src/Ajax.php | 233 - trunk/src/Cache.php | 37 - trunk/src/Compat.php | 82 - trunk/src/Cron.php | 73 - trunk/src/Deprecated/Functions.php | 440 - trunk/src/Encryption.php | 220 - trunk/src/Frontend/Frontend.php | 62 - trunk/src/Frontend/Shortcodes.php | 315 - trunk/src/Functions/Template.php | 312 - trunk/src/Installer.php | 386 - trunk/src/Models/Activation.php | 298 - trunk/src/Models/Key.php | 855 -- trunk/src/Models/Model.php | 21 - trunk/src/Orders.php | 178 - trunk/src/Plugin.php | 177 - trunk/src/RestAPI.php | 411 - trunk/src/Stocks.php | 43 - trunk/src/Utilities/Utilities.php | 31 - trunk/src/functions.php | 1062 --- trunk/templates/email-stock-notification.php | 42 - trunk/uninstall.php | 11 - trunk/vendor/autoload.php | 25 - trunk/vendor/bin/mozart | 119 - trunk/vendor/bin/phpcbf | 119 - trunk/vendor/bin/phpcs | 119 - .../byteever/byteever-sniffs/renovate.json | 5 - .../src/ByteEver-Default/ruleset.xml | 108 - trunk/vendor/coenjacobs/mozart/Dockerfile | 17 - trunk/vendor/coenjacobs/mozart/LICENSE | 21 - trunk/vendor/coenjacobs/mozart/bin/mozart | 29 - trunk/vendor/coenjacobs/mozart/psalm.xml | 15 - .../src/Composer/Autoload/Autoloader.php | 9 - .../mozart/src/Composer/Autoload/Classmap.php | 36 - .../Composer/Autoload/NamespaceAutoloader.php | 49 - .../mozart/src/Composer/Autoload/Psr0.php | 7 - .../mozart/src/Composer/Autoload/Psr4.php | 22 - .../mozart/src/Composer/Package.php | 69 - .../mozart/src/Console/Application.php | 20 - .../mozart/src/Console/Commands/Compose.php | 243 - trunk/vendor/coenjacobs/mozart/src/Mover.php | 243 - .../mozart/src/Replace/BaseReplacer.php | 20 - .../mozart/src/Replace/ClassmapReplacer.php | 64 - .../mozart/src/Replace/NamespaceReplacer.php | 43 - .../mozart/src/Replace/Replacer.php | 11 - .../vendor/coenjacobs/mozart/src/Replacer.php | 223 - trunk/vendor/composer/ClassLoader.php | 579 -- trunk/vendor/composer/InstalledVersions.php | 359 - trunk/vendor/composer/LICENSE | 21 - trunk/vendor/composer/autoload_classmap.php | 323 - trunk/vendor/composer/autoload_files.php | 17 - trunk/vendor/composer/autoload_namespaces.php | 9 - trunk/vendor/composer/autoload_psr4.php | 25 - trunk/vendor/composer/autoload_real.php | 50 - trunk/vendor/composer/autoload_static.php | 451 - trunk/vendor/composer/installed.json | 2036 ----- trunk/vendor/composer/installed.php | 278 - trunk/vendor/composer/platform_check.php | 26 - .../CODE_OF_CONDUCT.md | 129 - .../LICENSE.md | 21 - .../src/Plugin.php | 621 -- .../league/flysystem/CODE_OF_CONDUCT.md | 76 - trunk/vendor/league/flysystem/LICENSE | 19 - trunk/vendor/league/flysystem/SECURITY.md | 16 - trunk/vendor/league/flysystem/deprecations.md | 19 - .../flysystem/src/Adapter/AbstractAdapter.php | 72 - .../src/Adapter/AbstractFtpAdapter.php | 705 -- .../src/Adapter/CanOverwriteFiles.php | 12 - .../league/flysystem/src/Adapter/Ftp.php | 584 -- .../league/flysystem/src/Adapter/Ftpd.php | 48 - .../league/flysystem/src/Adapter/Local.php | 533 -- .../flysystem/src/Adapter/NullAdapter.php | 144 - .../Polyfill/NotSupportingVisibilityTrait.php | 33 - .../Adapter/Polyfill/StreamedCopyTrait.php | 51 - .../Adapter/Polyfill/StreamedReadingTrait.php | 44 - .../src/Adapter/Polyfill/StreamedTrait.php | 9 - .../Adapter/Polyfill/StreamedWritingTrait.php | 60 - .../flysystem/src/Adapter/SynologyFtp.php | 8 - .../league/flysystem/src/AdapterInterface.php | 118 - trunk/vendor/league/flysystem/src/Config.php | 107 - .../league/flysystem/src/ConfigAwareTrait.php | 49 - .../src/ConnectionErrorException.php | 9 - .../src/ConnectionRuntimeException.php | 9 - .../flysystem/src/CorruptedPathDetected.php | 17 - .../vendor/league/flysystem/src/Directory.php | 31 - .../vendor/league/flysystem/src/Exception.php | 8 - trunk/vendor/league/flysystem/src/File.php | 205 - .../flysystem/src/FileExistsException.php | 37 - .../flysystem/src/FileNotFoundException.php | 37 - .../league/flysystem/src/Filesystem.php | 409 - .../flysystem/src/FilesystemException.php | 7 - .../flysystem/src/FilesystemInterface.php | 284 - .../src/FilesystemNotFoundException.php | 12 - trunk/vendor/league/flysystem/src/Handler.php | 137 - .../flysystem/src/InvalidRootException.php | 9 - .../league/flysystem/src/MountManager.php | 648 -- .../flysystem/src/NotSupportedException.php | 37 - .../flysystem/src/Plugin/AbstractPlugin.php | 24 - .../league/flysystem/src/Plugin/EmptyDir.php | 34 - .../flysystem/src/Plugin/ForcedCopy.php | 44 - .../flysystem/src/Plugin/ForcedRename.php | 44 - .../flysystem/src/Plugin/GetWithMetadata.php | 51 - .../league/flysystem/src/Plugin/ListFiles.php | 35 - .../league/flysystem/src/Plugin/ListPaths.php | 36 - .../league/flysystem/src/Plugin/ListWith.php | 60 - .../flysystem/src/Plugin/PluggableTrait.php | 97 - .../src/Plugin/PluginNotFoundException.php | 10 - .../league/flysystem/src/PluginInterface.php | 20 - .../league/flysystem/src/ReadInterface.php | 88 - .../flysystem/src/RootViolationException.php | 10 - .../league/flysystem/src/SafeStorage.php | 39 - .../flysystem/src/UnreadableFileException.php | 18 - trunk/vendor/league/flysystem/src/Util.php | 354 - .../src/Util/ContentListingFormatter.php | 122 - .../league/flysystem/src/Util/MimeType.php | 80 - .../flysystem/src/Util/StreamHasher.php | 36 - .../league/mime-type-detection/CHANGELOG.md | 59 - .../vendor/league/mime-type-detection/LICENSE | 19 - .../src/EmptyExtensionToMimeTypeMap.php | 13 - .../src/ExtensionLookup.php | 14 - .../src/ExtensionMimeTypeDetector.php | 56 - .../src/ExtensionToMimeTypeMap.php | 10 - .../src/FinfoMimeTypeDetector.php | 106 - .../src/GeneratedExtensionToMimeTypeMap.php | 2298 ------ .../src/MimeTypeDetector.php | 19 - .../src/OverridingExtensionToMimeTypeMap.php | 30 - .../php-compatibility/CHANGELOG.md | 1488 ---- .../php-compatibility/LICENSE | 165 - .../php-compatibility/PHPCSAliases.php | 73 - .../AbstractComplexVersionSniff.php | 147 - .../AbstractFunctionCallParameterSniff.php | 193 - .../AbstractNewFeatureSniff.php | 115 - .../AbstractRemovedFeatureSniff.php | 156 - .../ComplexVersionInterface.php | 84 - .../PHPCompatibility/PHPCSHelper.php | 678 -- .../PHPCompatibility/Sniff.php | 2267 ----- .../ForbiddenAbstractPrivateMethodsSniff.php | 90 - .../Classes/NewAnonymousClassesSniff.php | 91 - .../Sniffs/Classes/NewClassesSniff.php | 913 -- .../Classes/NewConstVisibilitySniff.php | 80 - .../Classes/NewLateStaticBindingSniff.php | 88 - .../Classes/NewTypedPropertiesSniff.php | 132 - .../Classes/RemovedOrphanedParentSniff.php | 115 - .../Sniffs/Constants/NewConstantsSniff.php | 3756 --------- .../Constants/NewMagicClassConstantSniff.php | 80 - .../Constants/RemovedConstantsSniff.php | 574 -- .../DiscouragedSwitchContinueSniff.php | 238 - ...ForbiddenBreakContinueOutsideLoopSniff.php | 116 - ...denBreakContinueVariableArgumentsSniff.php | 110 - ...enSwitchWithMultipleDefaultBlocksSniff.php | 81 - .../NewExecutionDirectivesSniff.php | 378 - .../NewForeachExpressionReferencingSniff.php | 99 - .../NewListInForeachSniff.php | 84 - .../ControlStructures/NewMultiCatchSniff.php | 78 - .../Extensions/RemovedExtensionsSniff.php | 346 - ...biddenParameterShadowSuperGlobalsSniff.php | 79 - .../ForbiddenParametersWithSameNameSniff.php | 88 - .../ForbiddenToStringParametersSniff.php | 99 - ...orbiddenVariableNamesInClosureUseSniff.php | 122 - .../FunctionDeclarations/NewClosureSniff.php | 264 - .../NewExceptionsFromToStringSniff.php | 171 - .../NewNullableTypesSniff.php | 169 - .../NewParamTypeDeclarationsSniff.php | 237 - .../NewReturnTypeDeclarationsSniff.php | 194 - .../NonStaticMagicMethodsSniff.php | 216 - .../NewMagicMethodsSniff.php | 231 - .../RemovedMagicAutoloadSniff.php | 92 - .../RemovedNamespacedAssertSniff.php | 101 - .../RemovedPHP4StyleConstructorsSniff.php | 158 - .../ReservedFunctionNamesSniff.php | 205 - ...gumentFunctionsReportCurrentValueSniff.php | 455 - .../ArgumentFunctionsUsageSniff.php | 169 - .../NewFunctionParametersSniff.php | 1109 --- .../Sniffs/FunctionUse/NewFunctionsSniff.php | 2008 ----- ...ionalToRequiredFunctionParametersSniff.php | 173 - .../RemovedFunctionParametersSniff.php | 292 - .../FunctionUse/RemovedFunctionsSniff.php | 1104 --- ...uiredToOptionalFunctionParametersSniff.php | 350 - .../Generators/NewGeneratorReturnSniff.php | 158 - .../IniDirectives/NewIniDirectivesSniff.php | 855 -- .../RemovedIniDirectivesSniff.php | 424 - .../NewConstantArraysUsingConstSniff.php | 82 - .../NewConstantArraysUsingDefineSniff.php | 101 - .../NewConstantScalarExpressionsSniff.php | 556 -- .../Sniffs/InitialValue/NewHeredocSniff.php | 100 - .../Interfaces/InternalInterfacesSniff.php | 103 - .../Sniffs/Interfaces/NewInterfacesSniff.php | 362 - .../Keywords/CaseSensitiveKeywordsSniff.php | 76 - .../ForbiddenNamesAsDeclaredSniff.php | 259 - .../ForbiddenNamesAsInvokedFunctionsSniff.php | 188 - .../Sniffs/Keywords/ForbiddenNamesSniff.php | 442 - .../Sniffs/Keywords/NewKeywordsSniff.php | 391 - .../NewEmptyNonVariableSniff.php | 91 - .../NewLanguageConstructsSniff.php | 159 - .../Sniffs/Lists/AssignmentOrderSniff.php | 188 - .../ForbiddenEmptyListAssignmentSniff.php | 116 - .../Sniffs/Lists/NewKeyedListSniff.php | 227 - .../Lists/NewListReferenceAssignmentSniff.php | 74 - .../Sniffs/Lists/NewShortListSniff.php | 84 - .../ForbiddenToStringParametersSniff.php | 103 - .../MethodUse/NewDirectCallsToCloneSniff.php | 117 - .../Miscellaneous/NewPHPOpenTagEOFSniff.php | 147 - .../RemovedAlternativePHPTagsSniff.php | 172 - .../Miscellaneous/ValidIntegersSniff.php | 250 - .../ChangedConcatOperatorPrecedenceSniff.php | 199 - .../ForbiddenNegativeBitshiftSniff.php | 109 - .../Sniffs/Operators/NewOperatorsSniff.php | 317 - .../Sniffs/Operators/NewShortTernarySniff.php | 73 - .../RemovedTernaryAssociativitySniff.php | 157 - .../ForbiddenGetClassNullSniff.php | 84 - ...orbiddenStripTagsSelfClosingXHTMLSniff.php | 113 - .../NewArrayReduceInitialTypeSniff.php | 116 - .../ParameterValues/NewFopenModesSniff.php | 119 - .../NewHTMLEntitiesEncodingDefaultSniff.php | 92 - .../NewHashAlgorithmsSniff.php | 185 - .../NewIDNVariantDefaultSniff.php | 91 - .../NewIconvMbstringCharsetDefaultSniff.php | 231 - .../NewNegativeStringOffsetSniff.php | 129 - .../ParameterValues/NewPCREModifiersSniff.php | 127 - .../ParameterValues/NewPackFormatSniff.php | 132 - .../NewPasswordAlgoConstantValuesSniff.php | 125 - .../NewProcOpenCmdArraySniff.php | 136 - .../NewStripTagsAllowableTagsArraySniff.php | 152 - .../RemovedHashAlgorithmsSniff.php | 117 - .../RemovedIconvEncodingSniff.php | 86 - .../RemovedImplodeFlexibleParamOrderSniff.php | 323 - ...emovedMbStrrposEncodingThirdParamSniff.php | 149 - .../RemovedMbstringModifiersSniff.php | 135 - .../RemovedNonCryptoHashSniff.php | 121 - .../RemovedPCREModifiersSniff.php | 241 - .../RemovedSetlocaleStringSniff.php | 104 - .../ForbiddenCallTimePassByReferenceSniff.php | 259 - .../NewArrayStringDereferencingSniff.php | 199 - .../Sniffs/Syntax/NewArrayUnpackingSniff.php | 142 - .../Syntax/NewClassMemberAccessSniff.php | 192 - .../Syntax/NewDynamicAccessToStaticSniff.php | 89 - .../Syntax/NewFlexibleHeredocNowdocSniff.php | 255 - .../NewFunctionArrayDereferencingSniff.php | 187 - .../NewFunctionCallTrailingCommaSniff.php | 120 - .../Sniffs/Syntax/NewShortArraySniff.php | 77 - .../RemovedCurlyBraceArrayAccessSniff.php | 362 - .../Syntax/RemovedNewReferenceSniff.php | 80 - .../NewUnicodeEscapeSequenceSniff.php | 162 - .../Sniffs/TypeCasts/NewTypeCastsSniff.php | 222 - .../TypeCasts/RemovedTypeCastsSniff.php | 158 - .../Sniffs/Upgrade/LowPHPCSSniff.php | 187 - .../Sniffs/Upgrade/LowPHPSniff.php | 182 - .../NewGroupUseDeclarationsSniff.php | 118 - .../NewUseConstFunctionSniff.php | 109 - .../ForbiddenGlobalVariableVariableSniff.php | 125 - .../ForbiddenThisUseContextsSniff.php | 425 - .../NewUniformVariableSyntaxSniff.php | 114 - .../RemovedPredefinedGlobalVariablesSniff.php | 318 - .../PHPCompatibility/ruleset.xml | 7 - .../php-compatibility/phpunit-bootstrap.php | 86 - .../phpcompatibility-paragonie/LICENSE | 165 - .../ruleset.xml | 40 - .../ruleset.xml | 245 - .../phpcompatibility-wp/LICENSE | 165 - .../PHPCompatibilityWP/ruleset.xml | 85 - .../phpcsstandards/phpcsextra/CHANGELOG.md | 590 -- .../vendor/phpcsstandards/phpcsextra/LICENSE | 165 - .../Docs/FunctionCalls/DirnameStandard.xml | 40 - .../Sniffs/FunctionCalls/DirnameSniff.php | 382 - .../phpcsextra/Modernize/ruleset.xml | 5 - .../Docs/Arrays/ArrayBraceSpacingStandard.xml | 94 - .../Docs/Arrays/CommaAfterLastStandard.xml | 43 - .../Sniffs/Arrays/ArrayBraceSpacingSniff.php | 305 - .../Sniffs/Arrays/CommaAfterLastSniff.php | 226 - .../phpcsextra/NormalizedArrays/ruleset.xml | 5 - .../DisallowShortArraySyntaxStandard.xml | 27 - .../Docs/Arrays/DuplicateArrayKeyStandard.xml | 44 - .../Arrays/MixedArrayKeyTypesStandard.xml | 40 - .../Arrays/MixedKeyedUnkeyedArrayStandard.xml | 31 - .../DisallowAnonClassParenthesesStandard.xml | 24 - .../Classes/DisallowFinalClassStandard.xml | 25 - .../Classes/ModifierKeywordOrderStandard.xml | 27 - .../RequireAnonClassParenthesesStandard.xml | 23 - .../Classes/RequireFinalClassStandard.xml | 25 - .../ConstructorDestructorReturnStandard.xml | 64 - .../ForeachUniqueAssignmentStandard.xml | 26 - .../CodeAnalysis/NoDoubleNegativeStandard.xml | 27 - .../CodeAnalysis/NoEchoSprintfStandard.xml | 25 - .../StaticInFinalClassStandard.xml | 43 - ...owercaseClassResolutionKeywordStandard.xml | 23 - .../ModifierKeywordOrderStandard.xml | 30 - .../UppercaseMagicConstantsStandard.xml | 25 - .../DisallowAlternativeSyntaxStandard.xml | 35 - .../DisallowLonelyIfStandard.xml | 49 - .../IfElseDeclarationStandard.xml | 37 - .../Files/SeparateFunctionsFromOOStandard.xml | 45 - .../NoLongClosuresStandard.xml | 42 - .../RequireFinalMethodsInTraitsStandard.xml | 33 - .../Lists/DisallowLongListSyntaxStandard.xml | 23 - .../Lists/DisallowShortListSyntaxStandard.xml | 23 - .../DisallowCurlyBraceSyntaxStandard.xml | 27 - ...DisallowDeclarationWithoutNameStandard.xml | 25 - .../EnforceCurlyBraceSyntaxStandard.xml | 27 - .../OneDeclarationPerFileStandard.xml | 27 - ...oReservedKeywordParameterNamesStandard.xml | 23 - .../AlphabeticExtendsImplementsStandard.xml | 27 - .../Docs/Operators/ConcatPositionStandard.xml | 31 - .../DisallowLogicalAndOrStandard.xml | 30 - .../DisallowShortTernaryStandard.xml | 26 - ...andalonePostIncrementDecrementStandard.xml | 44 - .../Operators/StrictComparisonsStandard.xml | 29 - .../TypeSeparatorSpacingStandard.xml | 33 - .../Docs/PHP/LowercasePHPTagStandard.xml | 25 - .../OneStatementInShortEchoTagStandard.xml | 41 - .../DisallowMixedGroupUseStandard.xml | 39 - .../DisallowUseClassStandard.xml | 25 - .../DisallowUseConstStandard.xml | 25 - .../DisallowUseFunctionStandard.xml | 25 - .../UseStatements/KeywordSpacingStandard.xml | 29 - .../LowercaseFunctionConstStandard.xml | 25 - .../NoLeadingBackslashStandard.xml | 23 - .../NoUselessAliasesStandard.xml | 30 - .../AnonClassKeywordSpacingStandard.xml | 31 - .../Docs/WhiteSpace/CommaSpacingStandard.xml | 94 - .../WhiteSpace/DisallowInlineTabsStandard.xml | 25 - .../WhiteSpace/PrecisionAlignmentStandard.xml | 29 - .../Universal/Helpers/DummyTokenizer.php | 60 - .../Arrays/DisallowShortArraySyntaxSniff.php | 89 - .../Sniffs/Arrays/DuplicateArrayKeySniff.php | 297 - .../Sniffs/Arrays/MixedArrayKeyTypesSniff.php | 174 - .../Arrays/MixedKeyedUnkeyedArraySniff.php | 134 - .../DisallowAnonClassParenthesesSniff.php | 112 - .../Classes/DisallowFinalClassSniff.php | 116 - .../Classes/ModifierKeywordOrderSniff.php | 188 - .../RequireAnonClassParenthesesSniff.php | 81 - .../Sniffs/Classes/RequireFinalClassSniff.php | 102 - .../ConstructorDestructorReturnSniff.php | 211 - .../ForeachUniqueAssignmentSniff.php | 153 - .../CodeAnalysis/NoDoubleNegativeSniff.php | 269 - .../CodeAnalysis/NoEchoSprintfSniff.php | 131 - .../CodeAnalysis/StaticInFinalClassSniff.php | 216 - .../LowercaseClassResolutionKeywordSniff.php | 106 - .../Constants/ModifierKeywordOrderSniff.php | 199 - .../UppercaseMagicConstantsSniff.php | 89 - .../DisallowAlternativeSyntaxSniff.php | 216 - .../DisallowLonelyIfSniff.php | 348 - .../IfElseDeclarationSniff.php | 164 - .../Files/SeparateFunctionsFromOOSniff.php | 190 - .../NoLongClosuresSniff.php | 233 - .../RequireFinalMethodsInTraitsSniff.php | 120 - .../Lists/DisallowLongListSyntaxSniff.php | 71 - .../Lists/DisallowShortListSyntaxSniff.php | 86 - .../DisallowCurlyBraceSyntaxSniff.php | 81 - .../DisallowDeclarationWithoutNameSniff.php | 80 - .../EnforceCurlyBraceSyntaxSniff.php | 81 - .../Namespaces/OneDeclarationPerFileSniff.php | 96 - .../NoReservedKeywordParameterNamesSniff.php | 190 - .../AlphabeticExtendsImplementsSniff.php | 275 - .../Sniffs/Operators/ConcatPositionSniff.php | 204 - .../Operators/DisallowLogicalAndOrSniff.php | 112 - .../Operators/DisallowShortTernarySniff.php | 76 - ...wStandalonePostIncrementDecrementSniff.php | 197 - .../Operators/StrictComparisonsSniff.php | 116 - .../Operators/TypeSeparatorSpacingSniff.php | 85 - .../Sniffs/PHP/LowercasePHPTagSniff.php | 87 - .../PHP/OneStatementInShortEchoTagSniff.php | 101 - .../DisallowMixedGroupUseSniff.php | 248 - .../UseStatements/DisallowUseClassSniff.php | 211 - .../UseStatements/DisallowUseConstSniff.php | 211 - .../DisallowUseFunctionSniff.php | 211 - .../UseStatements/KeywordSpacingSniff.php | 207 - .../LowercaseFunctionConstSniff.php | 156 - .../UseStatements/NoLeadingBackslashSniff.php | 170 - .../UseStatements/NoUselessAliasesSniff.php | 155 - .../AnonClassKeywordSpacingSniff.php | 79 - .../Sniffs/WhiteSpace/CommaSpacingSniff.php | 408 - .../WhiteSpace/DisallowInlineTabsSniff.php | 173 - .../WhiteSpace/PrecisionAlignmentSniff.php | 445 - .../phpcsextra/Universal/ruleset.xml | 5 - .../phpcsstandards/phpcsutils/CHANGELOG.md | 1106 --- .../vendor/phpcsstandards/phpcsutils/LICENSE | 165 - .../AbstractArrayDeclarationSniff.php | 551 -- .../PHPCSUtils/BackCompat/BCFile.php | 781 -- .../PHPCSUtils/BackCompat/BCTokens.php | 123 - .../PHPCSUtils/BackCompat/Helper.php | 202 - .../Exceptions/InvalidTokenArray.php | 44 - .../Exceptions/TestFileNotFound.php | 47 - .../Exceptions/TestMarkerNotFound.php | 43 - .../Exceptions/TestTargetNotFound.php | 50 - .../PHPCSUtils/Fixers/SpacesFixer.php | 246 - .../phpcsutils/PHPCSUtils/Internal/Cache.php | 218 - .../Internal/IsShortArrayOrList.php | 687 -- .../Internal/IsShortArrayOrListWithCache.php | 269 - .../PHPCSUtils/Internal/NoFileCache.php | 164 - .../PHPCSUtils/Internal/StableCollections.php | 75 - .../TestUtils/UtilityMethodTestCase.php | 459 - .../PHPCSUtils/Tokens/Collections.php | 837 -- .../PHPCSUtils/Tokens/TokenHelper.php | 55 - .../phpcsutils/PHPCSUtils/Utils/Arrays.php | 227 - .../PHPCSUtils/Utils/Conditions.php | 156 - .../phpcsutils/PHPCSUtils/Utils/Context.php | 232 - .../PHPCSUtils/Utils/ControlStructures.php | 276 - .../PHPCSUtils/Utils/FunctionDeclarations.php | 828 -- .../PHPCSUtils/Utils/GetTokensAsString.php | 262 - .../phpcsutils/PHPCSUtils/Utils/Lists.php | 359 - .../PHPCSUtils/Utils/MessageHelper.php | 145 - .../PHPCSUtils/Utils/Namespaces.php | 389 - .../PHPCSUtils/Utils/NamingConventions.php | 116 - .../phpcsutils/PHPCSUtils/Utils/Numbers.php | 322 - .../PHPCSUtils/Utils/ObjectDeclarations.php | 359 - .../phpcsutils/PHPCSUtils/Utils/Operators.php | 252 - .../PHPCSUtils/Utils/Orthography.php | 120 - .../PHPCSUtils/Utils/Parentheses.php | 419 - .../PHPCSUtils/Utils/PassedParameters.php | 510 -- .../phpcsutils/PHPCSUtils/Utils/Scopes.php | 143 - .../PHPCSUtils/Utils/TextStrings.php | 331 - .../PHPCSUtils/Utils/UseStatements.php | 432 - .../phpcsutils/PHPCSUtils/Utils/Variables.php | 333 - .../phpcsutils/PHPCSUtils/ruleset.xml | 4 - .../phpcsutils/phpcsutils-autoload.php | 68 - trunk/vendor/psr/container/LICENSE | 21 - .../src/ContainerExceptionInterface.php | 12 - .../psr/container/src/ContainerInterface.php | 36 - .../src/NotFoundExceptionInterface.php | 10 - .../squizlabs/php_codesniffer/CHANGELOG.md | 7346 ----------------- .../php_codesniffer/CodeSniffer.conf | 5 - .../php_codesniffer/CodeSniffer.conf.dist | 9 - .../squizlabs/php_codesniffer/autoload.php | 345 - .../squizlabs/php_codesniffer/bin/phpcbf | 15 - .../squizlabs/php_codesniffer/bin/phpcbf.bat | 10 - .../squizlabs/php_codesniffer/bin/phpcs | 15 - .../squizlabs/php_codesniffer/bin/phpcs.bat | 10 - .../squizlabs/php_codesniffer/licence.txt | 24 - .../squizlabs/php_codesniffer/phpcs.xsd | 136 - .../squizlabs/php_codesniffer/src/Config.php | 1661 ---- .../src/Exceptions/DeepExitException.php | 20 - .../src/Exceptions/RuntimeException.php | 17 - .../src/Exceptions/TokenizerException.php | 17 - .../php_codesniffer/src/Files/DummyFile.php | 82 - .../php_codesniffer/src/Files/File.php | 2950 ------- .../php_codesniffer/src/Files/FileList.php | 261 - .../php_codesniffer/src/Files/LocalFile.php | 219 - .../src/Filters/ExactMatch.php | 156 - .../php_codesniffer/src/Filters/Filter.php | 288 - .../src/Filters/GitModified.php | 124 - .../php_codesniffer/src/Filters/GitStaged.php | 126 - .../squizlabs/php_codesniffer/src/Fixer.php | 846 -- .../src/Generators/Generator.php | 119 - .../php_codesniffer/src/Generators/HTML.php | 272 - .../src/Generators/Markdown.php | 163 - .../php_codesniffer/src/Generators/Text.php | 255 - .../php_codesniffer/src/Reporter.php | 445 - .../php_codesniffer/src/Reports/Cbf.php | 254 - .../src/Reports/Checkstyle.php | 111 - .../php_codesniffer/src/Reports/Code.php | 365 - .../php_codesniffer/src/Reports/Csv.php | 92 - .../php_codesniffer/src/Reports/Diff.php | 131 - .../php_codesniffer/src/Reports/Emacs.php | 91 - .../php_codesniffer/src/Reports/Full.php | 260 - .../php_codesniffer/src/Reports/Gitblame.php | 91 - .../php_codesniffer/src/Reports/Hgblame.php | 110 - .../php_codesniffer/src/Reports/Info.php | 173 - .../php_codesniffer/src/Reports/Json.php | 107 - .../php_codesniffer/src/Reports/Junit.php | 133 - .../src/Reports/Notifysend.php | 243 - .../src/Reports/Performance.php | 161 - .../php_codesniffer/src/Reports/Report.php | 87 - .../php_codesniffer/src/Reports/Source.php | 337 - .../php_codesniffer/src/Reports/Summary.php | 184 - .../php_codesniffer/src/Reports/Svnblame.php | 73 - .../src/Reports/VersionControl.php | 377 - .../php_codesniffer/src/Reports/Xml.php | 128 - .../squizlabs/php_codesniffer/src/Ruleset.php | 1623 ---- .../squizlabs/php_codesniffer/src/Runner.php | 984 --- .../src/Sniffs/AbstractArraySniff.php | 172 - .../src/Sniffs/AbstractPatternSniff.php | 936 --- .../src/Sniffs/AbstractScopeSniff.php | 189 - .../src/Sniffs/AbstractVariableSniff.php | 230 - .../src/Sniffs/DeprecatedSniff.php | 63 - .../php_codesniffer/src/Sniffs/Sniff.php | 80 - .../DisallowLongArraySyntaxStandard.xml | 23 - .../DisallowShortArraySyntaxStandard.xml | 23 - .../Classes/DuplicateClassNameStandard.xml | 27 - .../Classes/OpeningBraceSameLineStandard.xml | 36 - .../AssignmentInConditionStandard.xml | 23 - .../EmptyPHPStatementStandard.xml | 44 - .../CodeAnalysis/EmptyStatementStandard.xml | 23 - .../ForLoopShouldBeWhileLoopStandard.xml | 23 - .../ForLoopWithTestFunctionCallStandard.xml | 24 - .../JumbledIncrementerStandard.xml | 25 - ...licitBooleanOperatorPrecedenceStandard.xml | 44 - .../UnconditionalIfStatementStandard.xml | 39 - .../UnnecessaryFinalModifierStandard.xml | 29 - .../UnusedFunctionParameterStandard.xml | 25 - .../UselessOverridingMethodStandard.xml | 32 - .../Docs/Commenting/DocCommentStandard.xml | 269 - .../Generic/Docs/Commenting/FixmeStandard.xml | 25 - .../Generic/Docs/Commenting/TodoStandard.xml | 25 - .../DisallowYodaConditionsStandard.xml | 23 - .../InlineControlStructureStandard.xml | 22 - .../Generic/Docs/Debug/CSSLintStandard.xml | 19 - .../Docs/Debug/ClosureLinterStandard.xml | 19 - .../Generic/Docs/Debug/JSHintStandard.xml | 19 - .../Docs/Files/ByteOrderMarkStandard.xml | 7 - .../Docs/Files/EndFileNewlineStandard.xml | 7 - .../Docs/Files/EndFileNoNewlineStandard.xml | 7 - .../Docs/Files/ExecutableFileStandard.xml | 7 - .../Generic/Docs/Files/InlineHTMLStandard.xml | 24 - .../Docs/Files/LineEndingsStandard.xml | 7 - .../Generic/Docs/Files/LineLengthStandard.xml | 7 - .../Docs/Files/LowercasedFilenameStandard.xml | 7 - .../Docs/Files/OneClassPerFileStandard.xml | 29 - .../Files/OneInterfacePerFileStandard.xml | 29 - .../OneObjectStructurePerFileStandard.xml | 29 - .../Docs/Files/OneTraitPerFileStandard.xml | 29 - .../DisallowMultipleStatementsStandard.xml | 20 - .../MultipleStatementAlignmentStandard.xml | 56 - .../Formatting/NoSpaceAfterCastStandard.xml | 19 - .../Formatting/SpaceAfterCastStandard.xml | 19 - .../Docs/Formatting/SpaceAfterNotStandard.xml | 22 - .../Formatting/SpaceBeforeCastStandard.xml | 21 - .../CallTimePassByReferenceStandard.xml | 31 - .../FunctionCallArgumentSpacingStandard.xml | 39 - .../OpeningFunctionBraceBsdAllmanStandard.xml | 24 - ...gFunctionBraceKernighanRitchieStandard.xml | 24 - .../Metrics/CyclomaticComplexityStandard.xml | 7 - .../Docs/Metrics/NestingLevelStandard.xml | 7 - .../AbstractClassNamePrefixStandard.xml | 23 - .../CamelCapsFunctionNameStandard.xml | 23 - .../ConstructorNameStandard.xml | 29 - .../InterfaceNameSuffixStandard.xml | 23 - .../TraitNameSuffixStandard.xml | 23 - .../UpperCaseConstantNameStandard.xml | 29 - .../Docs/PHP/BacktickOperatorStandard.xml | 7 - .../CharacterBeforePHPOpeningTagStandard.xml | 22 - .../Docs/PHP/ClosingPHPTagStandard.xml | 22 - .../Docs/PHP/DeprecatedFunctionsStandard.xml | 19 - .../DisallowAlternativePHPTagsStandard.xml | 7 - .../DisallowRequestSuperglobalStandard.xml | 7 - .../Docs/PHP/DisallowShortOpenTagStandard.xml | 7 - .../Docs/PHP/DiscourageGotoStandard.xml | 7 - .../Docs/PHP/ForbiddenFunctionsStandard.xml | 19 - .../Docs/PHP/LowerCaseConstantStandard.xml | 23 - .../Docs/PHP/LowerCaseKeywordStandard.xml | 19 - .../Docs/PHP/LowerCaseTypeStandard.xml | 38 - .../Docs/PHP/NoSilencedErrorsStandard.xml | 23 - .../Docs/PHP/RequireStrictTypesStandard.xml | 38 - .../Generic/Docs/PHP/SAPIUsageStandard.xml | 23 - .../Generic/Docs/PHP/SyntaxStandard.xml | 21 - .../Docs/PHP/UpperCaseConstantStandard.xml | 23 - .../UnnecessaryStringConcatStandard.xml | 19 - .../SubversionPropertiesStandard.xml | 7 - .../ArbitraryParenthesesSpacingStandard.xml | 23 - .../DisallowSpaceIndentStandard.xml | 7 - .../WhiteSpace/DisallowTabIndentStandard.xml | 7 - .../IncrementDecrementSpacingStandard.xml | 26 - .../LanguageConstructSpacingStandard.xml | 44 - .../Docs/WhiteSpace/ScopeIndentStandard.xml | 23 - .../SpreadOperatorSpacingAfterStandard.xml | 34 - .../Sniffs/Arrays/ArrayIndentSniff.php | 193 - .../Arrays/DisallowLongArraySyntaxSniff.php | 72 - .../Arrays/DisallowShortArraySyntaxSniff.php | 61 - .../Classes/DuplicateClassNameSniff.php | 118 - .../Classes/OpeningBraceSameLineSniff.php | 124 - .../AssignmentInConditionSniff.php | 171 - .../CodeAnalysis/EmptyPHPStatementSniff.php | 162 - .../CodeAnalysis/EmptyStatementSniff.php | 97 - .../ForLoopShouldBeWhileLoopSniff.php | 91 - .../ForLoopWithTestFunctionCallSniff.php | 101 - .../CodeAnalysis/JumbledIncrementerSniff.php | 134 - ...ExplicitBooleanOperatorPrecedenceSniff.php | 119 - .../UnconditionalIfStatementSniff.php | 93 - .../UnnecessaryFinalModifierSniff.php | 88 - .../UnusedFunctionParameterSniff.php | 307 - .../UselessOverridingMethodSniff.php | 184 - .../Sniffs/Commenting/DocCommentSniff.php | 357 - .../Generic/Sniffs/Commenting/FixmeSniff.php | 78 - .../Generic/Sniffs/Commenting/TodoSniff.php | 77 - .../DisallowYodaConditionsSniff.php | 185 - .../InlineControlStructureSniff.php | 381 - .../Generic/Sniffs/Debug/CSSLintSniff.php | 98 - .../Sniffs/Debug/ClosureLinterSniff.php | 119 - .../Generic/Sniffs/Debug/ESLintSniff.php | 115 - .../Generic/Sniffs/Debug/JSHintSniff.php | 97 - .../Sniffs/Files/ByteOrderMarkSniff.php | 82 - .../Sniffs/Files/EndFileNewlineSniff.php | 84 - .../Sniffs/Files/EndFileNoNewlineSniff.php | 91 - .../Sniffs/Files/ExecutableFileSniff.php | 62 - .../Generic/Sniffs/Files/InlineHTMLSniff.php | 79 - .../Generic/Sniffs/Files/LineEndingsSniff.php | 148 - .../Generic/Sniffs/Files/LineLengthSniff.php | 201 - .../Sniffs/Files/LowercasedFilenameSniff.php | 70 - .../Sniffs/Files/OneClassPerFileSniff.php | 57 - .../Sniffs/Files/OneInterfacePerFileSniff.php | 57 - .../Files/OneObjectStructurePerFileSniff.php | 62 - .../Sniffs/Files/OneTraitPerFileSniff.php | 57 - .../DisallowMultipleStatementsSniff.php | 105 - .../MultipleStatementAlignmentSniff.php | 426 - .../Formatting/NoSpaceAfterCastSniff.php | 61 - .../Sniffs/Formatting/SpaceAfterCastSniff.php | 161 - .../Sniffs/Formatting/SpaceAfterNotSniff.php | 143 - .../Formatting/SpaceBeforeCastSniff.php | 73 - .../CallTimePassByReferenceSniff.php | 141 - .../FunctionCallArgumentSpacingSniff.php | 197 - .../OpeningFunctionBraceBsdAllmanSniff.php | 225 - ...ningFunctionBraceKernighanRitchieSniff.php | 182 - .../Metrics/CyclomaticComplexitySniff.php | 117 - .../Sniffs/Metrics/NestingLevelSniff.php | 100 - .../AbstractClassNamePrefixSniff.php | 60 - .../CamelCapsFunctionNameSniff.php | 223 - .../ConstructorNameSniff.php | 163 - .../InterfaceNameSuffixSniff.php | 54 - .../TraitNameSuffixSniff.php | 54 - .../UpperCaseConstantNameSniff.php | 149 - .../Sniffs/PHP/BacktickOperatorSniff.php | 48 - .../PHP/CharacterBeforePHPOpeningTagSniff.php | 86 - .../Generic/Sniffs/PHP/ClosingPHPTagSniff.php | 54 - .../Sniffs/PHP/DeprecatedFunctionsSniff.php | 75 - .../PHP/DisallowAlternativePHPTagsSniff.php | 253 - .../PHP/DisallowRequestSuperglobalSniff.php | 55 - .../Sniffs/PHP/DisallowShortOpenTagSniff.php | 168 - .../Sniffs/PHP/DiscourageGotoSniff.php | 50 - .../Sniffs/PHP/ForbiddenFunctionsSniff.php | 245 - .../Sniffs/PHP/LowerCaseConstantSniff.php | 244 - .../Sniffs/PHP/LowerCaseKeywordSniff.php | 85 - .../Generic/Sniffs/PHP/LowerCaseTypeSniff.php | 364 - .../Sniffs/PHP/NoSilencedErrorsSniff.php | 77 - .../Sniffs/PHP/RequireStrictTypesSniff.php | 108 - .../Generic/Sniffs/PHP/SAPIUsageSniff.php | 67 - .../Generic/Sniffs/PHP/SyntaxSniff.php | 75 - .../Sniffs/PHP/UpperCaseConstantSniff.php | 57 - .../Strings/UnnecessaryStringConcatSniff.php | 129 - .../VersionControl/GitMergeConflictSniff.php | 228 - .../SubversionPropertiesSniff.php | 186 - .../ArbitraryParenthesesSpacingSniff.php | 239 - .../WhiteSpace/DisallowSpaceIndentSniff.php | 232 - .../WhiteSpace/DisallowTabIndentSniff.php | 200 - .../IncrementDecrementSpacingSniff.php | 174 - .../LanguageConstructSpacingSniff.php | 146 - .../Sniffs/WhiteSpace/ScopeIndentSniff.php | 1591 ---- .../SpreadOperatorSpacingAfterSniff.php | 159 - .../Tests/Arrays/ArrayIndentUnitTest.inc | 154 - .../Arrays/ArrayIndentUnitTest.inc.fixed | 155 - .../Tests/Arrays/ArrayIndentUnitTest.php | 81 - .../DisallowLongArraySyntaxUnitTest.1.inc | 33 - ...isallowLongArraySyntaxUnitTest.1.inc.fixed | 33 - .../DisallowLongArraySyntaxUnitTest.2.inc | 17 - ...isallowLongArraySyntaxUnitTest.2.inc.fixed | 17 - .../DisallowLongArraySyntaxUnitTest.3.inc | 7 - .../DisallowLongArraySyntaxUnitTest.php | 75 - .../DisallowShortArraySyntaxUnitTest.inc | 12 - ...DisallowShortArraySyntaxUnitTest.inc.fixed | 12 - .../DisallowShortArraySyntaxUnitTest.php | 58 - .../Classes/DuplicateClassNameUnitTest.1.inc | 14 - .../Classes/DuplicateClassNameUnitTest.2.inc | 6 - .../Classes/DuplicateClassNameUnitTest.3.inc | 10 - .../Classes/DuplicateClassNameUnitTest.4.inc | 5 - .../Classes/DuplicateClassNameUnitTest.5.inc | 8 - .../Classes/DuplicateClassNameUnitTest.6.inc | 12 - .../Classes/DuplicateClassNameUnitTest.php | 83 - .../Classes/OpeningBraceSameLineUnitTest.inc | 100 - .../OpeningBraceSameLineUnitTest.inc.fixed | 100 - .../Classes/OpeningBraceSameLineUnitTest.php | 68 - .../AssignmentInConditionUnitTest.1.inc | 95 - .../AssignmentInConditionUnitTest.2.inc | 4 - .../AssignmentInConditionUnitTest.3.inc | 4 - .../AssignmentInConditionUnitTest.4.inc | 6 - .../AssignmentInConditionUnitTest.5.inc | 6 - .../AssignmentInConditionUnitTest.6.inc | 5 - .../AssignmentInConditionUnitTest.php | 96 - .../EmptyPHPStatementUnitTest.inc | 86 - .../EmptyPHPStatementUnitTest.inc.fixed | 80 - .../EmptyPHPStatementUnitTest.php | 73 - .../CodeAnalysis/EmptyStatementUnitTest.inc | 74 - .../CodeAnalysis/EmptyStatementUnitTest.php | 68 - .../ForLoopShouldBeWhileLoopUnitTest.1.inc | 37 - .../ForLoopShouldBeWhileLoopUnitTest.2.inc | 4 - .../ForLoopShouldBeWhileLoopUnitTest.3.inc | 6 - .../ForLoopShouldBeWhileLoopUnitTest.php | 64 - .../ForLoopWithTestFunctionCallUnitTest.1.inc | 95 - .../ForLoopWithTestFunctionCallUnitTest.2.inc | 5 - .../ForLoopWithTestFunctionCallUnitTest.3.inc | 6 - .../ForLoopWithTestFunctionCallUnitTest.php | 75 - .../JumbledIncrementerUnitTest.1.inc | 89 - .../JumbledIncrementerUnitTest.2.inc | 8 - .../JumbledIncrementerUnitTest.3.inc | 6 - .../JumbledIncrementerUnitTest.4.inc | 8 - .../JumbledIncrementerUnitTest.php | 72 - ...licitBooleanOperatorPrecedenceUnitTest.inc | 131 - ...licitBooleanOperatorPrecedenceUnitTest.php | 91 - .../UnconditionalIfStatementUnitTest.1.inc | 13 - .../UnconditionalIfStatementUnitTest.2.inc | 4 - .../UnconditionalIfStatementUnitTest.php | 65 - .../UnnecessaryFinalModifierUnitTest.1.inc | 56 - .../UnnecessaryFinalModifierUnitTest.2.inc | 5 - .../UnnecessaryFinalModifierUnitTest.php | 69 - .../UnusedFunctionParameterUnitTest.1.inc | 274 - .../UnusedFunctionParameterUnitTest.2.inc | 5 - .../UnusedFunctionParameterUnitTest.3.inc | 5 - .../UnusedFunctionParameterUnitTest.php | 78 - .../UselessOverridingMethodUnitTest.1.inc | 173 - .../UselessOverridingMethodUnitTest.2.inc | 7 - .../UselessOverridingMethodUnitTest.3.inc | 10 - .../UselessOverridingMethodUnitTest.4.inc | 10 - .../UselessOverridingMethodUnitTest.5.inc | 10 - .../UselessOverridingMethodUnitTest.6.inc | 10 - .../UselessOverridingMethodUnitTest.php | 72 - .../Tests/Commenting/DocCommentUnitTest.1.inc | 270 - .../Commenting/DocCommentUnitTest.1.inc.fixed | 275 - .../Tests/Commenting/DocCommentUnitTest.1.js | 270 - .../Commenting/DocCommentUnitTest.1.js.fixed | 275 - .../Tests/Commenting/DocCommentUnitTest.2.inc | 6 - .../Tests/Commenting/DocCommentUnitTest.2.js | 4 - .../Tests/Commenting/DocCommentUnitTest.php | 127 - .../Tests/Commenting/FixmeUnitTest.inc | 23 - .../Generic/Tests/Commenting/FixmeUnitTest.js | 23 - .../Tests/Commenting/FixmeUnitTest.php | 63 - .../Generic/Tests/Commenting/TodoUnitTest.inc | 23 - .../Generic/Tests/Commenting/TodoUnitTest.js | 23 - .../Generic/Tests/Commenting/TodoUnitTest.php | 62 - .../DisallowYodaConditionsUnitTest.inc | 187 - .../DisallowYodaConditionsUnitTest.php | 95 - .../InlineControlStructureUnitTest.1.inc | 278 - ...InlineControlStructureUnitTest.1.inc.fixed | 314 - .../InlineControlStructureUnitTest.2.inc | 8 - .../InlineControlStructureUnitTest.3.inc | 4 - .../InlineControlStructureUnitTest.4.inc | 5 - .../InlineControlStructureUnitTest.5.inc | 4 - .../InlineControlStructureUnitTest.6.inc | 6 - .../InlineControlStructureUnitTest.7.inc | 16 - .../InlineControlStructureUnitTest.js | 35 - .../InlineControlStructureUnitTest.js.fixed | 44 - .../InlineControlStructureUnitTest.php | 119 - .../Generic/Tests/Debug/CSSLintUnitTest.css | 6 - .../Generic/Tests/Debug/CSSLintUnitTest.php | 75 - .../Tests/Debug/ClosureLinterUnitTest.js | 6 - .../Tests/Debug/ClosureLinterUnitTest.php | 74 - .../Generic/Tests/Debug/ESLintUnitTest.js | 1 - .../Generic/Tests/Debug/ESLintUnitTest.php | 122 - .../Generic/Tests/Debug/JSHintUnitTest.js | 3 - .../Generic/Tests/Debug/JSHintUnitTest.php | 71 - .../Tests/Files/ByteOrderMarkUnitTest.1.inc | 4 - .../Tests/Files/ByteOrderMarkUnitTest.2.inc | 3 - .../Tests/Files/ByteOrderMarkUnitTest.3.inc | 1 - .../Tests/Files/ByteOrderMarkUnitTest.4.inc | Bin 208 -> 0 bytes .../Tests/Files/ByteOrderMarkUnitTest.5.inc | Bin 202 -> 0 bytes .../Tests/Files/ByteOrderMarkUnitTest.php | 63 - .../Tests/Files/EndFileNewlineUnitTest.1.css | 3 - .../Tests/Files/EndFileNewlineUnitTest.1.inc | 3 - .../Tests/Files/EndFileNewlineUnitTest.1.js | 3 - .../Tests/Files/EndFileNewlineUnitTest.2.css | 2 - .../Tests/Files/EndFileNewlineUnitTest.2.inc | 2 - .../Tests/Files/EndFileNewlineUnitTest.2.js | 2 - .../Tests/Files/EndFileNewlineUnitTest.3.css | 2 - .../Files/EndFileNewlineUnitTest.3.css.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.3.inc | 2 - .../Files/EndFileNewlineUnitTest.3.inc.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.3.js | 2 - .../Files/EndFileNewlineUnitTest.3.js.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.4.inc | 2 - .../Files/EndFileNewlineUnitTest.4.inc.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.5.inc | 2 - .../Tests/Files/EndFileNewlineUnitTest.6.inc | 1 - .../Files/EndFileNewlineUnitTest.6.inc.fixed | 1 - .../Tests/Files/EndFileNewlineUnitTest.7.inc | 1 - .../Files/EndFileNewlineUnitTest.7.inc.fixed | 1 - .../Tests/Files/EndFileNewlineUnitTest.8.inc | 1 - .../Tests/Files/EndFileNewlineUnitTest.php | 68 - .../Files/EndFileNoNewlineUnitTest.1.css | 3 - .../EndFileNoNewlineUnitTest.1.css.fixed | 2 - .../Files/EndFileNoNewlineUnitTest.1.inc | 3 - .../EndFileNoNewlineUnitTest.1.inc.fixed | 2 - .../Tests/Files/EndFileNoNewlineUnitTest.1.js | 3 - .../Files/EndFileNoNewlineUnitTest.1.js.fixed | 2 - .../Files/EndFileNoNewlineUnitTest.10.inc | 1 - .../Files/EndFileNoNewlineUnitTest.2.css | 2 - .../EndFileNoNewlineUnitTest.2.css.fixed | 2 - .../Files/EndFileNoNewlineUnitTest.2.inc | 3 - .../EndFileNoNewlineUnitTest.2.inc.fixed | 3 - .../Tests/Files/EndFileNoNewlineUnitTest.2.js | 2 - .../Files/EndFileNoNewlineUnitTest.2.js.fixed | 2 - .../Files/EndFileNoNewlineUnitTest.3.css | 2 - .../Files/EndFileNoNewlineUnitTest.3.inc | 2 - .../Tests/Files/EndFileNoNewlineUnitTest.3.js | 2 - .../Files/EndFileNoNewlineUnitTest.4.inc | 3 - .../Files/EndFileNoNewlineUnitTest.5.inc | 2 - .../Files/EndFileNoNewlineUnitTest.6.inc | 2 - .../EndFileNoNewlineUnitTest.6.inc.fixed | 2 - .../Files/EndFileNoNewlineUnitTest.7.inc | 6 - .../Files/EndFileNoNewlineUnitTest.8.inc | 1 - .../EndFileNoNewlineUnitTest.8.inc.fixed | 1 - .../Files/EndFileNoNewlineUnitTest.9.inc | 1 - .../EndFileNoNewlineUnitTest.9.inc.fixed | 1 - .../Tests/Files/EndFileNoNewlineUnitTest.php | 72 - .../Tests/Files/ExecutableFileUnitTest.1.inc | 1 - .../Tests/Files/ExecutableFileUnitTest.2.inc | 1 - .../Tests/Files/ExecutableFileUnitTest.3.inc | 1 - .../Tests/Files/ExecutableFileUnitTest.4.inc | 1 - .../Tests/Files/ExecutableFileUnitTest.php | 76 - .../Tests/Files/InlineHTMLUnitTest.1.inc | 3 - .../Tests/Files/InlineHTMLUnitTest.2.inc | 3 - .../Tests/Files/InlineHTMLUnitTest.3.inc | 6 - .../Tests/Files/InlineHTMLUnitTest.4.inc | 3 - .../Tests/Files/InlineHTMLUnitTest.5.inc | 3 - .../Tests/Files/InlineHTMLUnitTest.6.inc | 2 - .../Tests/Files/InlineHTMLUnitTest.7.inc | 2 - .../Tests/Files/InlineHTMLUnitTest.php | 69 - .../Tests/Files/LineEndingsUnitTest.1.inc | 18 - .../Files/LineEndingsUnitTest.1.inc.fixed | 18 - .../Tests/Files/LineEndingsUnitTest.2.inc | 5 - .../Files/LineEndingsUnitTest.2.inc.fixed | 5 - .../Tests/Files/LineEndingsUnitTest.css | 3 - .../Tests/Files/LineEndingsUnitTest.css.fixed | 3 - .../Tests/Files/LineEndingsUnitTest.js | 2 - .../Tests/Files/LineEndingsUnitTest.js.fixed | 2 - .../Tests/Files/LineEndingsUnitTest.php | 68 - .../Tests/Files/LineLengthUnitTest.1.inc | 84 - .../Tests/Files/LineLengthUnitTest.2.inc | 7 - .../Tests/Files/LineLengthUnitTest.3.inc | 16 - .../Tests/Files/LineLengthUnitTest.4.inc | 16 - .../Tests/Files/LineLengthUnitTest.php | 114 - .../Files/LowercasedFilenameUnitTest.1.inc | 7 - .../Files/LowercasedFilenameUnitTest.2.inc | 7 - .../Files/LowercasedFilenameUnitTest.php | 61 - .../Tests/Files/OneClassPerFileUnitTest.inc | 13 - .../Tests/Files/OneClassPerFileUnitTest.php | 56 - .../Files/OneInterfacePerFileUnitTest.inc | 13 - .../Files/OneInterfacePerFileUnitTest.php | 56 - .../OneObjectStructurePerFileUnitTest.inc | 26 - .../OneObjectStructurePerFileUnitTest.php | 59 - .../Tests/Files/OneTraitPerFileUnitTest.inc | 17 - .../Tests/Files/OneTraitPerFileUnitTest.php | 56 - .../DisallowMultipleStatementsUnitTest.inc | 20 - ...sallowMultipleStatementsUnitTest.inc.fixed | 25 - .../DisallowMultipleStatementsUnitTest.php | 59 - .../MultipleStatementAlignmentUnitTest.inc | 504 -- ...ltipleStatementAlignmentUnitTest.inc.fixed | 504 -- .../MultipleStatementAlignmentUnitTest.js | 118 - ...ultipleStatementAlignmentUnitTest.js.fixed | 118 - .../MultipleStatementAlignmentUnitTest.php | 170 - .../Formatting/NoSpaceAfterCastUnitTest.inc | 51 - .../NoSpaceAfterCastUnitTest.inc.fixed | 51 - .../Formatting/NoSpaceAfterCastUnitTest.php | 77 - .../Formatting/SpaceAfterCastUnitTest.1.inc | 100 - .../SpaceAfterCastUnitTest.1.inc.fixed | 97 - .../Formatting/SpaceAfterCastUnitTest.2.inc | 3 - .../Formatting/SpaceAfterCastUnitTest.php | 103 - .../Formatting/SpaceAfterNotUnitTest.1.inc | 86 - .../SpaceAfterNotUnitTest.1.inc.fixed | 83 - .../Formatting/SpaceAfterNotUnitTest.2.inc | 7 - .../Tests/Formatting/SpaceAfterNotUnitTest.js | 5 - .../Formatting/SpaceAfterNotUnitTest.js.fixed | 5 - .../Formatting/SpaceAfterNotUnitTest.php | 96 - .../Formatting/SpaceBeforeCastUnitTest.inc | 65 - .../SpaceBeforeCastUnitTest.inc.fixed | 65 - .../Formatting/SpaceBeforeCastUnitTest.php | 83 - .../CallTimePassByReferenceUnitTest.1.inc | 66 - .../CallTimePassByReferenceUnitTest.2.inc | 7 - .../CallTimePassByReferenceUnitTest.3.inc | 7 - .../CallTimePassByReferenceUnitTest.php | 75 - .../FunctionCallArgumentSpacingUnitTest.1.inc | 199 - ...ionCallArgumentSpacingUnitTest.1.inc.fixed | 199 - .../FunctionCallArgumentSpacingUnitTest.2.inc | 7 - .../FunctionCallArgumentSpacingUnitTest.php | 96 - .../OpeningFunctionBraceBsdAllmanUnitTest.inc | 270 - ...ngFunctionBraceBsdAllmanUnitTest.inc.fixed | 287 - .../OpeningFunctionBraceBsdAllmanUnitTest.php | 91 - ...gFunctionBraceKernighanRitchieUnitTest.inc | 214 - ...ionBraceKernighanRitchieUnitTest.inc.fixed | 202 - ...gFunctionBraceKernighanRitchieUnitTest.php | 82 - .../Metrics/CyclomaticComplexityUnitTest.inc | 454 - .../Metrics/CyclomaticComplexityUnitTest.php | 63 - .../Tests/Metrics/NestingLevelUnitTest.inc | 102 - .../Tests/Metrics/NestingLevelUnitTest.php | 56 - .../AbstractClassNamePrefixUnitTest.inc | 59 - .../AbstractClassNamePrefixUnitTest.php | 58 - .../CamelCapsFunctionNameUnitTest.inc | 185 - .../CamelCapsFunctionNameUnitTest.php | 97 - .../ConstructorNameUnitTest.inc | 97 - .../ConstructorNameUnitTest.php | 59 - .../InterfaceNameSuffixUnitTest.inc | 27 - .../InterfaceNameSuffixUnitTest.php | 52 - .../TraitNameSuffixUnitTest.inc | 13 - .../TraitNameSuffixUnitTest.php | 55 - .../UpperCaseConstantNameUnitTest.inc | 43 - .../UpperCaseConstantNameUnitTest.php | 63 - .../Tests/PHP/BacktickOperatorUnitTest.inc | 9 - .../Tests/PHP/BacktickOperatorUnitTest.php | 57 - ...CharacterBeforePHPOpeningTagUnitTest.1.inc | 9 - ...CharacterBeforePHPOpeningTagUnitTest.2.inc | 4 - ...CharacterBeforePHPOpeningTagUnitTest.3.inc | 3 - .../CharacterBeforePHPOpeningTagUnitTest.php | 61 - .../Tests/PHP/ClosingPHPTagUnitTest.1.inc | 10 - .../Tests/PHP/ClosingPHPTagUnitTest.2.inc | 5 - .../Tests/PHP/ClosingPHPTagUnitTest.php | 64 - .../Tests/PHP/DeprecatedFunctionsUnitTest.inc | 4 - .../Tests/PHP/DeprecatedFunctionsUnitTest.php | 63 - .../DisallowAlternativePHPTagsUnitTest.1.inc | 14 - ...llowAlternativePHPTagsUnitTest.1.inc.fixed | 14 - .../DisallowAlternativePHPTagsUnitTest.2.inc | 6 - ...llowAlternativePHPTagsUnitTest.2.inc.fixed | 6 - .../DisallowAlternativePHPTagsUnitTest.3.inc | 7 - .../DisallowAlternativePHPTagsUnitTest.php | 110 - .../DisallowRequestSuperglobalUnitTest.inc | 16 - .../DisallowRequestSuperglobalUnitTest.php | 56 - .../PHP/DisallowShortOpenTagUnitTest.1.inc | 11 - .../DisallowShortOpenTagUnitTest.1.inc.fixed | 11 - .../PHP/DisallowShortOpenTagUnitTest.2.inc | 8 - .../DisallowShortOpenTagUnitTest.2.inc.fixed | 8 - .../PHP/DisallowShortOpenTagUnitTest.3.inc | 16 - .../PHP/DisallowShortOpenTagUnitTest.php | 108 - .../Tests/PHP/DiscourageGotoUnitTest.inc | 18 - .../Tests/PHP/DiscourageGotoUnitTest.php | 58 - .../Tests/PHP/ForbiddenFunctionsUnitTest.inc | 60 - .../Tests/PHP/ForbiddenFunctionsUnitTest.php | 59 - .../Tests/PHP/LowerCaseConstantUnitTest.1.inc | 153 - .../PHP/LowerCaseConstantUnitTest.1.inc.fixed | 153 - .../Tests/PHP/LowerCaseConstantUnitTest.2.inc | 4 - .../Tests/PHP/LowerCaseConstantUnitTest.js | 14 - .../PHP/LowerCaseConstantUnitTest.js.fixed | 14 - .../Tests/PHP/LowerCaseConstantUnitTest.php | 105 - .../Tests/PHP/LowerCaseKeywordUnitTest.inc | 48 - .../PHP/LowerCaseKeywordUnitTest.inc.fixed | 48 - .../Tests/PHP/LowerCaseKeywordUnitTest.php | 71 - .../Tests/PHP/LowerCaseTypeUnitTest.inc | 145 - .../Tests/PHP/LowerCaseTypeUnitTest.inc.fixed | 145 - .../Tests/PHP/LowerCaseTypeUnitTest.php | 117 - .../Tests/PHP/NoSilencedErrorsUnitTest.inc | 16 - .../Tests/PHP/NoSilencedErrorsUnitTest.php | 57 - .../PHP/RequireStrictTypesUnitTest.1.inc | 8 - .../PHP/RequireStrictTypesUnitTest.10.inc | 5 - .../PHP/RequireStrictTypesUnitTest.11.inc | 5 - .../RequireStrictTypesUnitTest.11.inc.fixed | 5 - .../PHP/RequireStrictTypesUnitTest.12.inc | 5 - .../RequireStrictTypesUnitTest.12.inc.fixed | 5 - .../PHP/RequireStrictTypesUnitTest.13.inc | 3 - .../PHP/RequireStrictTypesUnitTest.14.inc | 5 - .../RequireStrictTypesUnitTest.14.inc.fixed | 5 - .../PHP/RequireStrictTypesUnitTest.15.inc | 5 - .../RequireStrictTypesUnitTest.15.inc.fixed | 5 - .../PHP/RequireStrictTypesUnitTest.2.inc | 2 - .../PHP/RequireStrictTypesUnitTest.3.inc | 5 - .../PHP/RequireStrictTypesUnitTest.4.inc | 10 - .../PHP/RequireStrictTypesUnitTest.5.inc | 6 - .../PHP/RequireStrictTypesUnitTest.6.inc | 4 - .../PHP/RequireStrictTypesUnitTest.7.inc | 4 - .../PHP/RequireStrictTypesUnitTest.8.inc | 5 - .../PHP/RequireStrictTypesUnitTest.9.inc | 5 - .../Tests/PHP/RequireStrictTypesUnitTest.php | 72 - .../Generic/Tests/PHP/SAPIUsageUnitTest.inc | 5 - .../Generic/Tests/PHP/SAPIUsageUnitTest.php | 53 - .../Generic/Tests/PHP/SyntaxUnitTest.1.inc | 4 - .../Generic/Tests/PHP/SyntaxUnitTest.2.inc | 3 - .../Generic/Tests/PHP/SyntaxUnitTest.php | 63 - .../Tests/PHP/UpperCaseConstantUnitTest.inc | 98 - .../PHP/UpperCaseConstantUnitTest.inc.fixed | 98 - .../Tests/PHP/UpperCaseConstantUnitTest.php | 75 - .../UnnecessaryStringConcatUnitTest.1.inc | 34 - .../UnnecessaryStringConcatUnitTest.2.inc | 7 - .../UnnecessaryStringConcatUnitTest.js | 15 - .../UnnecessaryStringConcatUnitTest.php | 87 - .../GitMergeConflictUnitTest.1.css | 35 - .../GitMergeConflictUnitTest.1.inc | 61 - .../GitMergeConflictUnitTest.2.css | 32 - .../GitMergeConflictUnitTest.2.inc | 31 - .../GitMergeConflictUnitTest.3.inc | 43 - .../GitMergeConflictUnitTest.4.inc | 71 - .../GitMergeConflictUnitTest.5.inc | 34 - .../GitMergeConflictUnitTest.6.inc | 34 - .../GitMergeConflictUnitTest.7.inc | 19 - .../GitMergeConflictUnitTest.js | 33 - .../GitMergeConflictUnitTest.php | 175 - .../SubversionPropertiesUnitTest.inc | 3 - .../SubversionPropertiesUnitTest.php | 66 - .../ArbitraryParenthesesSpacingUnitTest.1.inc | 192 - ...raryParenthesesSpacingUnitTest.1.inc.fixed | 180 - .../ArbitraryParenthesesSpacingUnitTest.2.inc | 4 - .../ArbitraryParenthesesSpacingUnitTest.php | 106 - .../DisallowSpaceIndentUnitTest.1.inc | 118 - .../DisallowSpaceIndentUnitTest.1.inc.fixed | 118 - .../DisallowSpaceIndentUnitTest.2.inc | 118 - .../DisallowSpaceIndentUnitTest.2.inc.fixed | 118 - .../DisallowSpaceIndentUnitTest.3.inc | 19 - .../DisallowSpaceIndentUnitTest.3.inc.fixed | 19 - .../DisallowSpaceIndentUnitTest.4.inc | 13 - .../DisallowSpaceIndentUnitTest.css | 4 - .../DisallowSpaceIndentUnitTest.css.fixed | 4 - .../WhiteSpace/DisallowSpaceIndentUnitTest.js | 9 - .../DisallowSpaceIndentUnitTest.js.fixed | 9 - .../DisallowSpaceIndentUnitTest.php | 144 - .../DisallowTabIndentUnitTest.1.inc | 93 - .../DisallowTabIndentUnitTest.1.inc.fixed | 93 - .../DisallowTabIndentUnitTest.2.inc | 19 - .../DisallowTabIndentUnitTest.2.inc.fixed | 19 - .../DisallowTabIndentUnitTest.3.inc | 13 - .../WhiteSpace/DisallowTabIndentUnitTest.css | 5 - .../DisallowTabIndentUnitTest.css.fixed | 5 - .../WhiteSpace/DisallowTabIndentUnitTest.js | 9 - .../DisallowTabIndentUnitTest.js.fixed | 9 - .../WhiteSpace/DisallowTabIndentUnitTest.php | 151 - .../IncrementDecrementSpacingUnitTest.inc | 43 - ...ncrementDecrementSpacingUnitTest.inc.fixed | 41 - .../IncrementDecrementSpacingUnitTest.js | 17 - ...IncrementDecrementSpacingUnitTest.js.fixed | 16 - .../IncrementDecrementSpacingUnitTest.php | 86 - .../LanguageConstructSpacingUnitTest.1.inc | 91 - ...nguageConstructSpacingUnitTest.1.inc.fixed | 85 - .../LanguageConstructSpacingUnitTest.2.inc | 4 - .../LanguageConstructSpacingUnitTest.php | 98 - .../WhiteSpace/ScopeIndentUnitTest.1.inc | 1653 ---- .../ScopeIndentUnitTest.1.inc.fixed | 1653 ---- .../Tests/WhiteSpace/ScopeIndentUnitTest.1.js | 239 - .../WhiteSpace/ScopeIndentUnitTest.1.js.fixed | 239 - .../WhiteSpace/ScopeIndentUnitTest.2.inc | 1653 ---- .../ScopeIndentUnitTest.2.inc.fixed | 1653 ---- .../WhiteSpace/ScopeIndentUnitTest.3.inc | 28 - .../ScopeIndentUnitTest.3.inc.fixed | 28 - .../WhiteSpace/ScopeIndentUnitTest.4.inc | 6 - .../Tests/WhiteSpace/ScopeIndentUnitTest.php | 219 - .../SpreadOperatorSpacingAfterUnitTest.1.inc | 76 - ...adOperatorSpacingAfterUnitTest.1.inc.fixed | 71 - .../SpreadOperatorSpacingAfterUnitTest.2.inc | 4 - .../SpreadOperatorSpacingAfterUnitTest.php | 71 - .../src/Standards/Generic/ruleset.xml | 4 - .../Sniffs/CSS/BrowserSpecificStylesSniff.php | 89 - .../Channels/DisallowSelfActionsSniff.php | 127 - .../Sniffs/Channels/IncludeOwnSystemSniff.php | 100 - .../Sniffs/Channels/IncludeSystemSniff.php | 316 - .../Sniffs/Channels/UnusedSystemSniff.php | 143 - .../Commenting/FunctionCommentSniff.php | 86 - .../MySource/Sniffs/Debug/DebugCodeSniff.php | 57 - .../Sniffs/Debug/FirebugConsoleSniff.php | 66 - .../Sniffs/Objects/AssignThisSniff.php | 83 - .../Objects/CreateWidgetTypeCallbackSniff.php | 220 - .../Sniffs/Objects/DisallowNewWidgetSniff.php | 61 - .../Sniffs/PHP/AjaxNullComparisonSniff.php | 105 - .../Sniffs/PHP/EvalObjectFactorySniff.php | 116 - .../Sniffs/PHP/GetRequestDataSniff.php | 108 - .../Sniffs/PHP/ReturnFunctionValueSniff.php | 65 - .../Sniffs/Strings/JoinStringsSniff.php | 78 - .../CSS/BrowserSpecificStylesUnitTest.css | 13 - .../CSS/BrowserSpecificStylesUnitTest.php | 53 - .../Channels/DisallowSelfActionsUnitTest.inc | 51 - .../Channels/DisallowSelfActionsUnitTest.php | 58 - .../Tests/Channels/IncludeSystemUnitTest.inc | 112 - .../Tests/Channels/IncludeSystemUnitTest.php | 65 - .../Tests/Channels/UnusedSystemUnitTest.inc | 67 - .../Tests/Channels/UnusedSystemUnitTest.php | 60 - .../Commenting/FunctionCommentUnitTest.inc | 101 - .../Commenting/FunctionCommentUnitTest.php | 59 - .../Tests/Debug/DebugCodeUnitTest.inc | 4 - .../Tests/Debug/DebugCodeUnitTest.php | 56 - .../Tests/Debug/FirebugConsoleUnitTest.js | 8 - .../Tests/Debug/FirebugConsoleUnitTest.php | 66 - .../Tests/Objects/AssignThisUnitTest.js | 20 - .../Tests/Objects/AssignThisUnitTest.php | 63 - .../CreateWidgetTypeCallbackUnitTest.js | 186 - .../CreateWidgetTypeCallbackUnitTest.php | 62 - .../Objects/DisallowNewWidgetUnitTest.inc | 6 - .../Objects/DisallowNewWidgetUnitTest.php | 53 - .../Tests/PHP/AjaxNullComparisonUnitTest.inc | 182 - .../Tests/PHP/AjaxNullComparisonUnitTest.php | 60 - .../Tests/PHP/EvalObjectFactoryUnitTest.inc | 26 - .../Tests/PHP/EvalObjectFactoryUnitTest.php | 57 - .../Tests/PHP/GetRequestDataUnitTest.inc | 30 - .../Tests/PHP/GetRequestDataUnitTest.php | 61 - .../Tests/PHP/ReturnFunctionValueUnitTest.inc | 9 - .../Tests/PHP/ReturnFunctionValueUnitTest.php | 57 - .../Tests/Strings/JoinStringsUnitTest.js | 18 - .../Tests/Strings/JoinStringsUnitTest.php | 67 - .../src/Standards/MySource/ruleset.xml | 18 - .../Docs/Classes/ClassDeclarationStandard.xml | 22 - .../Docs/Commenting/ClassCommentStandard.xml | 177 - .../Docs/Commenting/FileCommentStandard.xml | 286 - .../Commenting/FunctionCommentStandard.xml | 230 - .../Docs/Commenting/InlineCommentStandard.xml | 19 - .../ControlSignatureStandard.xml | 36 - .../MultiLineConditionStandard.xml | 60 - .../PEAR/Docs/Files/IncludingFileStandard.xml | 24 - .../PEAR/Docs/Files/LineLengthStandard.xml | 7 - .../MultiLineAssignmentStandard.xml | 35 - .../FunctionCallSignatureStandard.xml | 19 - .../Functions/FunctionDeclarationStandard.xml | 41 - .../Functions/ValidDefaultValueStandard.xml | 25 - .../ValidClassNameStandard.xml | 23 - .../ValidFunctionNameStandard.xml | 23 - .../ValidVariableNameStandard.xml | 29 - .../ObjectOperatorIndentStandard.xml | 39 - .../WhiteSpace/ScopeClosingBraceStandard.xml | 23 - .../Docs/WhiteSpace/ScopeIndentStandard.xml | 29 - .../Sniffs/Classes/ClassDeclarationSniff.php | 150 - .../Sniffs/Commenting/ClassCommentSniff.php | 122 - .../Sniffs/Commenting/FileCommentSniff.php | 583 -- .../Commenting/FunctionCommentSniff.php | 539 -- .../Sniffs/Commenting/InlineCommentSniff.php | 68 - .../ControlSignatureSniff.php | 48 - .../MultiLineConditionSniff.php | 283 - .../PEAR/Sniffs/Files/IncludingFileSniff.php | 136 - .../Formatting/MultiLineAssignmentSniff.php | 106 - .../Functions/FunctionCallSignatureSniff.php | 634 -- .../Functions/FunctionDeclarationSniff.php | 549 -- .../Functions/ValidDefaultValueSniff.php | 78 - .../NamingConventions/ValidClassNameSniff.php | 98 - .../ValidFunctionNameSniff.php | 284 - .../ValidVariableNameSniff.php | 103 - .../WhiteSpace/ObjectOperatorIndentSniff.php | 204 - .../WhiteSpace/ScopeClosingBraceSniff.php | 182 - .../Sniffs/WhiteSpace/ScopeIndentSniff.php | 24 - .../Classes/ClassDeclarationUnitTest.1.inc | 114 - .../ClassDeclarationUnitTest.1.inc.fixed | 125 - .../Classes/ClassDeclarationUnitTest.2.inc | 11 - .../Classes/ClassDeclarationUnitTest.php | 100 - .../Tests/Commenting/ClassCommentUnitTest.inc | 163 - .../Tests/Commenting/ClassCommentUnitTest.php | 78 - .../Commenting/FileCommentUnitTest.1.inc | 53 - .../Commenting/FileCommentUnitTest.2.inc | 9 - .../Commenting/FileCommentUnitTest.3.inc | 8 - .../Commenting/FileCommentUnitTest.4.inc | 7 - .../Tests/Commenting/FileCommentUnitTest.php | 95 - .../Commenting/FunctionCommentUnitTest.inc | 512 -- .../FunctionCommentUnitTest.inc.fixed | 491 -- .../Commenting/FunctionCommentUnitTest.php | 103 - .../Commenting/InlineCommentUnitTest.inc | 29 - .../InlineCommentUnitTest.inc.fixed | 29 - .../Commenting/InlineCommentUnitTest.php | 60 - .../ControlSignatureUnitTest.inc | 165 - .../ControlSignatureUnitTest.php | 77 - .../MultiLineConditionUnitTest.inc | 251 - .../MultiLineConditionUnitTest.inc.fixed | 247 - .../MultiLineConditionUnitTest.js | 251 - .../MultiLineConditionUnitTest.js.fixed | 247 - .../MultiLineConditionUnitTest.php | 96 - .../Tests/Files/IncludingFileUnitTest.inc | 99 - .../Files/IncludingFileUnitTest.inc.fixed | 99 - .../Tests/Files/IncludingFileUnitTest.php | 72 - .../MultiLineAssignmentUnitTest.inc | 22 - .../MultiLineAssignmentUnitTest.php | 57 - .../FunctionCallSignatureUnitTest.inc | 576 -- .../FunctionCallSignatureUnitTest.inc.fixed | 591 -- .../FunctionCallSignatureUnitTest.js | 80 - .../FunctionCallSignatureUnitTest.js.fixed | 84 - .../FunctionCallSignatureUnitTest.php | 164 - .../FunctionDeclarationUnitTest.1.inc | 490 -- .../FunctionDeclarationUnitTest.1.inc.fixed | 487 -- .../FunctionDeclarationUnitTest.2.inc | 7 - .../Functions/FunctionDeclarationUnitTest.js | 59 - .../FunctionDeclarationUnitTest.js.fixed | 60 - .../Functions/FunctionDeclarationUnitTest.php | 149 - .../Functions/ValidDefaultValueUnitTest.1.inc | 116 - .../Functions/ValidDefaultValueUnitTest.2.inc | 7 - .../Functions/ValidDefaultValueUnitTest.php | 73 - .../ValidClassNameUnitTest.inc | 90 - .../ValidClassNameUnitTest.php | 78 - .../ValidFunctionNameUnitTest.inc | 243 - .../ValidFunctionNameUnitTest.php | 154 - .../ValidVariableNameUnitTest.inc | 101 - .../ValidVariableNameUnitTest.php | 61 - .../ObjectOperatorIndentUnitTest.inc | 142 - .../ObjectOperatorIndentUnitTest.inc.fixed | 142 - .../ObjectOperatorIndentUnitTest.php | 79 - .../WhiteSpace/ScopeClosingBraceUnitTest.inc | 170 - .../ScopeClosingBraceUnitTest.inc.fixed | 177 - .../WhiteSpace/ScopeClosingBraceUnitTest.php | 73 - .../Tests/WhiteSpace/ScopeIndentUnitTest.inc | 314 - .../WhiteSpace/ScopeIndentUnitTest.inc.fixed | 314 - .../Tests/WhiteSpace/ScopeIndentUnitTest.php | 71 - .../src/Standards/PEAR/ruleset.xml | 41 - .../Docs/Classes/ClassDeclarationStandard.xml | 48 - .../PSR1/Docs/Files/SideEffectsStandard.xml | 27 - .../Methods/CamelCapsMethodNameStandard.xml | 29 - .../Sniffs/Classes/ClassDeclarationSniff.php | 75 - .../PSR1/Sniffs/Files/SideEffectsSniff.php | 303 - .../Methods/CamelCapsMethodNameSniff.php | 91 - .../Classes/ClassDeclarationUnitTest.1.inc | 3 - .../Classes/ClassDeclarationUnitTest.2.inc | 4 - .../Classes/ClassDeclarationUnitTest.3.inc | 3 - .../Classes/ClassDeclarationUnitTest.php | 62 - .../Tests/Files/SideEffectsUnitTest.1.inc | 87 - .../Tests/Files/SideEffectsUnitTest.10.inc | 8 - .../Tests/Files/SideEffectsUnitTest.11.inc | 11 - .../Tests/Files/SideEffectsUnitTest.12.inc | 8 - .../Tests/Files/SideEffectsUnitTest.13.inc | 2 - .../Tests/Files/SideEffectsUnitTest.14.inc | 2 - .../Tests/Files/SideEffectsUnitTest.15.inc | 2 - .../Tests/Files/SideEffectsUnitTest.16.inc | 2 - .../Tests/Files/SideEffectsUnitTest.17.inc | 8 - .../Tests/Files/SideEffectsUnitTest.2.inc | 24 - .../Tests/Files/SideEffectsUnitTest.3.inc | 6 - .../Tests/Files/SideEffectsUnitTest.4.inc | 10 - .../Tests/Files/SideEffectsUnitTest.5.inc | 2 - .../Tests/Files/SideEffectsUnitTest.6.inc | 9 - .../Tests/Files/SideEffectsUnitTest.7.inc | 8 - .../Tests/Files/SideEffectsUnitTest.8.inc | 8 - .../Tests/Files/SideEffectsUnitTest.9.inc | 8 - .../PSR1/Tests/Files/SideEffectsUnitTest.php | 85 - .../Methods/CamelCapsMethodNameUnitTest.inc | 81 - .../Methods/CamelCapsMethodNameUnitTest.php | 64 - .../src/Standards/PSR1/ruleset.xml | 47 - .../Classes/ClassInstantiationStandard.xml | 19 - .../Docs/Classes/ClosingBraceStandard.xml | 35 - .../Classes/OpeningBraceSpaceStandard.xml | 32 - .../BooleanOperatorPlacementStandard.xml | 59 - .../ControlStructureSpacingStandard.xml | 124 - .../Docs/Files/ImportStatementStandard.xml | 33 - .../PSR12/Docs/Files/OpenTagStandard.xml | 40 - .../NullableTypeDeclarationStandard.xml | 45 - .../ReturnTypeDeclarationStandard.xml | 41 - .../ShortFormTypeKeywordsStandard.xml | 19 - .../CompoundNamespaceDepthStandard.xml | 28 - .../Operators/OperatorSpacingStandard.xml | 27 - .../Properties/ConstantVisibilityStandard.xml | 27 - .../Classes/AnonClassDeclarationSniff.php | 246 - .../Classes/ClassInstantiationSniff.php | 112 - .../Sniffs/Classes/ClosingBraceSniff.php | 67 - .../Sniffs/Classes/OpeningBraceSpaceSniff.php | 80 - .../BooleanOperatorPlacementSniff.php | 229 - .../ControlStructureSpacingSniff.php | 207 - .../Sniffs/Files/DeclareStatementSniff.php | 262 - .../PSR12/Sniffs/Files/FileHeaderSniff.php | 429 - .../Sniffs/Files/ImportStatementSniff.php | 77 - .../PSR12/Sniffs/Files/OpenTagSniff.php | 76 - .../NullableTypeDeclarationSniff.php | 94 - .../Functions/ReturnTypeDeclarationSniff.php | 110 - .../Keywords/ShortFormTypeKeywordsSniff.php | 75 - .../CompoundNamespaceDepthSniff.php | 80 - .../Sniffs/Operators/OperatorSpacingSniff.php | 128 - .../Properties/ConstantVisibilitySniff.php | 64 - .../Sniffs/Traits/UseDeclarationSniff.php | 700 -- .../Classes/AnonClassDeclarationUnitTest.inc | 96 - .../AnonClassDeclarationUnitTest.inc.fixed | 98 - .../Classes/AnonClassDeclarationUnitTest.php | 80 - .../Classes/ClassInstantiationUnitTest.inc | 51 - .../ClassInstantiationUnitTest.inc.fixed | 51 - .../Classes/ClassInstantiationUnitTest.php | 72 - .../Tests/Classes/ClosingBraceUnitTest.inc | 52 - .../Tests/Classes/ClosingBraceUnitTest.php | 60 - .../Classes/OpeningBraceSpaceUnitTest.inc | 57 - .../OpeningBraceSpaceUnitTest.inc.fixed | 48 - .../Classes/OpeningBraceSpaceUnitTest.php | 60 - .../BooleanOperatorPlacementUnitTest.inc | 131 - ...BooleanOperatorPlacementUnitTest.inc.fixed | 141 - .../BooleanOperatorPlacementUnitTest.php | 64 - .../ControlStructureSpacingUnitTest.inc | 100 - .../ControlStructureSpacingUnitTest.inc.fixed | 103 - .../ControlStructureSpacingUnitTest.php | 73 - .../Files/DeclareStatementUnitTest.1.inc | 50 - .../DeclareStatementUnitTest.1.inc.fixed | 54 - .../Files/DeclareStatementUnitTest.2.inc | 3 - .../Tests/Files/DeclareStatementUnitTest.php | 84 - .../Tests/Files/FileHeaderUnitTest.1.inc | 29 - .../Tests/Files/FileHeaderUnitTest.10.inc | 4 - .../Files/FileHeaderUnitTest.10.inc.fixed | 5 - .../Tests/Files/FileHeaderUnitTest.11.inc | 21 - .../Files/FileHeaderUnitTest.11.inc.fixed | 22 - .../Tests/Files/FileHeaderUnitTest.12.inc | 17 - .../Files/FileHeaderUnitTest.12.inc.fixed | 18 - .../Tests/Files/FileHeaderUnitTest.13.inc | 24 - .../Tests/Files/FileHeaderUnitTest.14.inc | 7 - .../Tests/Files/FileHeaderUnitTest.15.inc | 5 - .../Tests/Files/FileHeaderUnitTest.16.inc | 13 - .../Tests/Files/FileHeaderUnitTest.17.inc | 13 - .../Tests/Files/FileHeaderUnitTest.18.inc | 16 - .../Tests/Files/FileHeaderUnitTest.2.inc | 33 - .../Files/FileHeaderUnitTest.2.inc.fixed | 29 - .../Tests/Files/FileHeaderUnitTest.3.inc | 27 - .../Tests/Files/FileHeaderUnitTest.4.inc | 15 - .../Files/FileHeaderUnitTest.4.inc.fixed | 19 - .../Tests/Files/FileHeaderUnitTest.5.inc | 18 - .../Tests/Files/FileHeaderUnitTest.6.inc | 13 - .../Tests/Files/FileHeaderUnitTest.7.inc | 2 - .../Files/FileHeaderUnitTest.7.inc.fixed | 3 - .../Tests/Files/FileHeaderUnitTest.8.inc | 5 - .../Tests/Files/FileHeaderUnitTest.9.inc | 7 - .../PSR12/Tests/Files/FileHeaderUnitTest.php | 87 - .../Tests/Files/ImportStatementUnitTest.inc | 26 - .../Files/ImportStatementUnitTest.inc.fixed | 26 - .../Tests/Files/ImportStatementUnitTest.php | 57 - .../PSR12/Tests/Files/OpenTagUnitTest.1.inc | 3 - .../PSR12/Tests/Files/OpenTagUnitTest.2.inc | 1 - .../Tests/Files/OpenTagUnitTest.2.inc.fixed | 2 - .../PSR12/Tests/Files/OpenTagUnitTest.3.inc | 3 - .../PSR12/Tests/Files/OpenTagUnitTest.4.inc | 2 - .../PSR12/Tests/Files/OpenTagUnitTest.5.inc | 1 - .../PSR12/Tests/Files/OpenTagUnitTest.php | 60 - .../NullableTypeDeclarationUnitTest.inc | 95 - .../NullableTypeDeclarationUnitTest.inc.fixed | 92 - .../NullableTypeDeclarationUnitTest.php | 72 - .../ReturnTypeDeclarationUnitTest.inc | 66 - .../ReturnTypeDeclarationUnitTest.inc.fixed | 62 - .../ReturnTypeDeclarationUnitTest.php | 66 - .../ShortFormTypeKeywordsUnitTest.inc | 14 - .../ShortFormTypeKeywordsUnitTest.inc.fixed | 14 - .../ShortFormTypeKeywordsUnitTest.php | 59 - .../CompoundNamespaceDepthUnitTest.inc | 31 - .../CompoundNamespaceDepthUnitTest.php | 57 - .../Operators/OperatorSpacingUnitTest.1.inc | 79 - .../OperatorSpacingUnitTest.1.inc.fixed | 79 - .../Operators/OperatorSpacingUnitTest.2.inc | 3 - .../Operators/OperatorSpacingUnitTest.3.inc | 6 - .../Operators/OperatorSpacingUnitTest.php | 81 - .../Properties/ConstantVisibilityUnitTest.inc | 22 - .../Properties/ConstantVisibilityUnitTest.php | 57 - .../Tests/Traits/UseDeclarationUnitTest.inc | 221 - .../Traits/UseDeclarationUnitTest.inc.fixed | 213 - .../Tests/Traits/UseDeclarationUnitTest.php | 76 - .../src/Standards/PSR12/ruleset.xml | 348 - .../Docs/Classes/ClassDeclarationStandard.xml | 23 - .../Classes/PropertyDeclarationStandard.xml | 81 - .../ControlStructureSpacingStandard.xml | 23 - .../ElseIfDeclarationStandard.xml | 27 - .../SwitchDeclarationStandard.xml | 104 - .../PSR2/Docs/Files/ClosingTagStandard.xml | 23 - .../Docs/Files/EndFileNewlineStandard.xml | 7 - .../Methods/FunctionCallSignatureStandard.xml | 107 - .../Methods/FunctionClosingBraceStandard.xml | 26 - .../Methods/MethodDeclarationStandard.xml | 51 - .../NamespaceDeclarationStandard.xml | 22 - .../Namespaces/UseDeclarationStandard.xml | 57 - .../Sniffs/Classes/ClassDeclarationSniff.php | 540 -- .../Classes/PropertyDeclarationSniff.php | 226 - .../ControlStructureSpacingSniff.php | 141 - .../ElseIfDeclarationSniff.php | 72 - .../SwitchDeclarationSniff.php | 396 - .../PSR2/Sniffs/Files/ClosingTagSniff.php | 89 - .../PSR2/Sniffs/Files/EndFileNewlineSniff.php | 107 - .../Methods/FunctionCallSignatureSniff.php | 79 - .../Methods/FunctionClosingBraceSniff.php | 91 - .../Sniffs/Methods/MethodDeclarationSniff.php | 162 - .../Namespaces/NamespaceDeclarationSniff.php | 100 - .../Sniffs/Namespaces/UseDeclarationSniff.php | 297 - .../Classes/ClassDeclarationUnitTest.inc | 346 - .../ClassDeclarationUnitTest.inc.fixed | 335 - .../Classes/ClassDeclarationUnitTest.php | 103 - .../Classes/PropertyDeclarationUnitTest.inc | 87 - .../PropertyDeclarationUnitTest.inc.fixed | 84 - .../Classes/PropertyDeclarationUnitTest.php | 84 - .../ControlStructureSpacingUnitTest.inc | 81 - .../ControlStructureSpacingUnitTest.inc.fixed | 80 - .../ControlStructureSpacingUnitTest.php | 67 - .../ElseIfDeclarationUnitTest.inc | 17 - .../ElseIfDeclarationUnitTest.inc.fixed | 17 - .../ElseIfDeclarationUnitTest.php | 56 - .../SwitchDeclarationUnitTest.inc | 598 -- .../SwitchDeclarationUnitTest.inc.fixed | 593 -- .../SwitchDeclarationUnitTest.php | 86 - .../PSR2/Tests/Files/ClosingTagUnitTest.1.inc | 12 - .../Files/ClosingTagUnitTest.1.inc.fixed | 12 - .../PSR2/Tests/Files/ClosingTagUnitTest.2.inc | 3 - .../PSR2/Tests/Files/ClosingTagUnitTest.3.inc | 7 - .../PSR2/Tests/Files/ClosingTagUnitTest.4.inc | 1 - .../Files/ClosingTagUnitTest.4.inc.fixed | 1 - .../PSR2/Tests/Files/ClosingTagUnitTest.5.inc | 1 - .../Files/ClosingTagUnitTest.5.inc.fixed | 1 - .../PSR2/Tests/Files/ClosingTagUnitTest.6.inc | 5 - .../Files/ClosingTagUnitTest.6.inc.fixed | 5 - .../PSR2/Tests/Files/ClosingTagUnitTest.7.inc | 5 - .../Files/ClosingTagUnitTest.7.inc.fixed | 5 - .../PSR2/Tests/Files/ClosingTagUnitTest.php | 69 - .../Tests/Files/EndFileNewlineUnitTest.1.inc | 3 - .../Files/EndFileNewlineUnitTest.1.inc.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.10.inc | 3 - .../Files/EndFileNewlineUnitTest.10.inc.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.11.inc | 1 - .../Files/EndFileNewlineUnitTest.11.inc.fixed | 1 - .../Tests/Files/EndFileNewlineUnitTest.12.inc | 1 - .../Files/EndFileNewlineUnitTest.12.inc.fixed | 1 - .../Tests/Files/EndFileNewlineUnitTest.13.inc | 5 - .../Files/EndFileNewlineUnitTest.13.inc.fixed | 1 - .../Tests/Files/EndFileNewlineUnitTest.14.inc | 1 - .../Tests/Files/EndFileNewlineUnitTest.2.inc | 2 - .../Tests/Files/EndFileNewlineUnitTest.3.inc | 2 - .../Files/EndFileNewlineUnitTest.3.inc.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.4.inc | 4 - .../Tests/Files/EndFileNewlineUnitTest.5.inc | 6 - .../Tests/Files/EndFileNewlineUnitTest.6.inc | 2 - .../Files/EndFileNewlineUnitTest.6.inc.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.7.inc | 11 - .../Files/EndFileNewlineUnitTest.7.inc.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.8.inc | 2 - .../Tests/Files/EndFileNewlineUnitTest.9.inc | 2 - .../Files/EndFileNewlineUnitTest.9.inc.fixed | 2 - .../Tests/Files/EndFileNewlineUnitTest.php | 71 - .../Methods/FunctionCallSignatureUnitTest.inc | 267 - .../FunctionCallSignatureUnitTest.inc.fixed | 283 - .../Methods/FunctionCallSignatureUnitTest.php | 99 - .../Methods/FunctionClosingBraceUnitTest.inc | 70 - .../FunctionClosingBraceUnitTest.inc.fixed | 61 - .../Methods/FunctionClosingBraceUnitTest.php | 60 - .../Methods/MethodDeclarationUnitTest.inc | 75 - .../MethodDeclarationUnitTest.inc.fixed | 75 - .../Methods/MethodDeclarationUnitTest.php | 76 - .../NamespaceDeclarationUnitTest.inc | 26 - .../NamespaceDeclarationUnitTest.inc.fixed | 28 - .../NamespaceDeclarationUnitTest.php | 58 - .../Namespaces/UseDeclarationUnitTest.1.inc | 40 - .../Namespaces/UseDeclarationUnitTest.10.inc | 8 - .../UseDeclarationUnitTest.10.inc.fixed | 9 - .../Namespaces/UseDeclarationUnitTest.11.inc | 2 - .../UseDeclarationUnitTest.11.inc.fixed | 4 - .../Namespaces/UseDeclarationUnitTest.12.inc | 9 - .../UseDeclarationUnitTest.12.inc.fixed | 11 - .../Namespaces/UseDeclarationUnitTest.13.inc | 10 - .../UseDeclarationUnitTest.13.inc.fixed | 11 - .../Namespaces/UseDeclarationUnitTest.14.inc | 8 - .../UseDeclarationUnitTest.14.inc.fixed | 9 - .../Namespaces/UseDeclarationUnitTest.15.inc | 10 - .../Namespaces/UseDeclarationUnitTest.16.inc | 11 - .../UseDeclarationUnitTest.16.inc.fixed | 9 - .../Namespaces/UseDeclarationUnitTest.17.inc | 3 - .../Namespaces/UseDeclarationUnitTest.18.inc | 4 - .../Namespaces/UseDeclarationUnitTest.2.inc | 21 - .../UseDeclarationUnitTest.2.inc.fixed | 27 - .../Namespaces/UseDeclarationUnitTest.3.inc | 16 - .../UseDeclarationUnitTest.3.inc.fixed | 16 - .../Namespaces/UseDeclarationUnitTest.4.inc | 4 - .../Namespaces/UseDeclarationUnitTest.5.inc | 47 - .../UseDeclarationUnitTest.5.inc.fixed | 56 - .../Namespaces/UseDeclarationUnitTest.6.inc | 1 - .../Namespaces/UseDeclarationUnitTest.7.inc | 1 - .../Namespaces/UseDeclarationUnitTest.8.inc | 8 - .../Namespaces/UseDeclarationUnitTest.9.inc | 8 - .../Namespaces/UseDeclarationUnitTest.php | 102 - .../src/Standards/PSR2/ruleset.xml | 218 - .../Arrays/ArrayBracketSpacingStandard.xml | 19 - .../Docs/Arrays/ArrayDeclarationStandard.xml | 117 - .../LowercaseClassKeywordsStandard.xml | 23 - .../Classes/SelfMemberReferenceStandard.xml | 63 - .../DocCommentAlignmentStandard.xml | 39 - .../FunctionCommentThrowTagStandard.xml | 32 - .../ForEachLoopDeclarationStandard.xml | 39 - .../ForLoopDeclarationStandard.xml | 55 - .../LowercaseDeclarationStandard.xml | 23 - .../FunctionDuplicateArgumentStandard.xml | 23 - .../LowercaseFunctionKeywordsStandard.xml | 25 - .../Docs/Scope/StaticThisUsageStandard.xml | 31 - .../Docs/Strings/EchoedStringsStandard.xml | 19 - .../Docs/WhiteSpace/CastSpacingStandard.xml | 19 - .../FunctionClosingBraceSpaceStandard.xml | 73 - .../FunctionOpeningBraceStandard.xml | 41 - .../LanguageConstructSpacingStandard.xml | 19 - .../WhiteSpace/MemberVarSpacingStandard.xml | 91 - .../ObjectOperatorSpacingStandard.xml | 19 - .../WhiteSpace/ScopeClosingBraceStandard.xml | 59 - .../ScopeKeywordSpacingStandard.xml | 23 - .../WhiteSpace/SemicolonSpacingStandard.xml | 19 - .../SuperfluousWhitespaceStandard.xml | 98 - .../Arrays/ArrayBracketSpacingSniff.php | 95 - .../Sniffs/Arrays/ArrayDeclarationSniff.php | 942 --- .../ClassDefinitionClosingBraceSpaceSniff.php | 136 - .../CSS/ClassDefinitionNameSpacingSniff.php | 113 - .../ClassDefinitionOpeningBraceSpaceSniff.php | 178 - .../Squiz/Sniffs/CSS/ColonSpacingSniff.php | 109 - .../Sniffs/CSS/ColourDefinitionSniff.php | 90 - .../DisallowMultipleStyleDefinitionsSniff.php | 73 - .../CSS/DuplicateClassDefinitionSniff.php | 118 - .../CSS/DuplicateStyleDefinitionSniff.php | 90 - .../Sniffs/CSS/EmptyClassDefinitionSniff.php | 63 - .../Sniffs/CSS/EmptyStyleDefinitionSniff.php | 66 - .../Squiz/Sniffs/CSS/ForbiddenStylesSniff.php | 179 - .../Squiz/Sniffs/CSS/IndentationSniff.php | 152 - .../CSS/LowercaseStyleDefinitionSniff.php | 99 - .../Squiz/Sniffs/CSS/MissingColonSniff.php | 93 - .../Squiz/Sniffs/CSS/NamedColoursSniff.php | 95 - .../Squiz/Sniffs/CSS/OpacitySniff.php | 103 - .../Sniffs/CSS/SemicolonSpacingSniff.php | 105 - .../Squiz/Sniffs/CSS/ShorthandSizeSniff.php | 183 - .../Sniffs/Classes/ClassDeclarationSniff.php | 207 - .../Sniffs/Classes/ClassFileNameSniff.php | 70 - .../Sniffs/Classes/DuplicatePropertySniff.php | 84 - .../Classes/LowercaseClassKeywordsSniff.php | 73 - .../Classes/SelfMemberReferenceSniff.php | 240 - .../Sniffs/Classes/ValidClassNameSniff.php | 87 - .../Sniffs/Commenting/BlockCommentSniff.php | 401 - .../Sniffs/Commenting/ClassCommentSniff.php | 109 - .../ClosingDeclarationCommentSniff.php | 130 - .../Commenting/DocCommentAlignmentSniff.php | 167 - .../Commenting/EmptyCatchCommentSniff.php | 55 - .../Sniffs/Commenting/FileCommentSniff.php | 228 - .../Commenting/FunctionCommentSniff.php | 800 -- .../FunctionCommentThrowTagSniff.php | 233 - .../Sniffs/Commenting/InlineCommentSniff.php | 349 - .../LongConditionClosingCommentSniff.php | 218 - .../Commenting/PostStatementCommentSniff.php | 121 - .../Commenting/VariableCommentSniff.php | 201 - .../ControlSignatureSniff.php | 337 - .../ElseIfDeclarationSniff.php | 51 - .../ForEachLoopDeclarationSniff.php | 236 - .../ForLoopDeclarationSniff.php | 316 - .../InlineIfDeclarationSniff.php | 155 - .../LowercaseDeclarationSniff.php | 75 - .../SwitchDeclarationSniff.php | 304 - .../Squiz/Sniffs/Debug/JSLintSniff.php | 88 - .../Sniffs/Debug/JavaScriptLintSniff.php | 91 - .../Squiz/Sniffs/Files/FileExtensionSniff.php | 68 - .../Formatting/OperatorBracketSniff.php | 395 - ...unctionDeclarationArgumentSpacingSniff.php | 398 - .../Functions/FunctionDeclarationSniff.php | 34 - .../FunctionDuplicateArgumentSniff.php | 64 - .../Sniffs/Functions/GlobalFunctionSniff.php | 61 - .../LowercaseFunctionKeywordsSniff.php | 69 - .../MultiLineFunctionDeclarationSniff.php | 257 - .../ValidFunctionNameSniff.php | 54 - .../ValidVariableNameSniff.php | 190 - .../DisallowObjectStringIndexSniff.php | 87 - .../Objects/ObjectInstantiationSniff.php | 85 - .../Sniffs/Objects/ObjectMemberCommaSniff.php | 66 - .../ComparisonOperatorUsageSniff.php | 235 - .../IncrementDecrementUsageSniff.php | 231 - .../Operators/ValidLogicalOperatorsSniff.php | 67 - .../Sniffs/PHP/CommentedOutCodeSniff.php | 283 - .../PHP/DisallowBooleanStatementSniff.php | 59 - .../PHP/DisallowComparisonAssignmentSniff.php | 112 - .../Sniffs/PHP/DisallowInlineIfSniff.php | 57 - .../PHP/DisallowMultipleAssignmentsSniff.php | 190 - .../PHP/DisallowSizeFunctionsInLoopsSniff.php | 116 - .../Sniffs/PHP/DiscouragedFunctionsSniff.php | 38 - .../Squiz/Sniffs/PHP/EmbeddedPhpSniff.php | 512 -- .../Standards/Squiz/Sniffs/PHP/EvalSniff.php | 48 - .../Squiz/Sniffs/PHP/GlobalKeywordSniff.php | 53 - .../Squiz/Sniffs/PHP/HeredocSniff.php | 51 - .../Squiz/Sniffs/PHP/InnerFunctionsSniff.php | 76 - .../Sniffs/PHP/LowercasePHPFunctionsSniff.php | 167 - .../Sniffs/PHP/NonExecutableCodeSniff.php | 303 - .../Sniffs/Scope/MemberVarScopeSniff.php | 77 - .../Squiz/Sniffs/Scope/MethodScopeSniff.php | 83 - .../Sniffs/Scope/StaticThisUsageSniff.php | 128 - .../Strings/ConcatenationSpacingSniff.php | 164 - .../Sniffs/Strings/DoubleQuoteUsageSniff.php | 144 - .../Sniffs/Strings/EchoedStringsSniff.php | 88 - .../Sniffs/WhiteSpace/CastSpacingSniff.php | 65 - .../ControlStructureSpacingSniff.php | 359 - .../FunctionClosingBraceSpaceSniff.php | 164 - .../FunctionOpeningBraceSpaceSniff.php | 98 - .../WhiteSpace/FunctionSpacingSniff.php | 366 - .../LanguageConstructSpacingSniff.php | 91 - .../LogicalOperatorSpacingSniff.php | 102 - .../WhiteSpace/MemberVarSpacingSniff.php | 252 - .../WhiteSpace/ObjectOperatorSpacingSniff.php | 167 - .../WhiteSpace/OperatorSpacingSniff.php | 409 - .../WhiteSpace/PropertyLabelSpacingSniff.php | 81 - .../WhiteSpace/ScopeClosingBraceSniff.php | 114 - .../WhiteSpace/ScopeKeywordSpacingSniff.php | 172 - .../WhiteSpace/SemicolonSpacingSniff.php | 116 - .../WhiteSpace/SuperfluousWhitespaceSniff.php | 265 - .../Arrays/ArrayBracketSpacingUnitTest.inc | 31 - .../ArrayBracketSpacingUnitTest.inc.fixed | 31 - .../Arrays/ArrayBracketSpacingUnitTest.php | 62 - .../Arrays/ArrayDeclarationUnitTest.1.inc | 549 -- .../ArrayDeclarationUnitTest.1.inc.fixed | 588 -- .../Arrays/ArrayDeclarationUnitTest.2.inc | 538 -- .../ArrayDeclarationUnitTest.2.inc.fixed | 575 -- .../Tests/Arrays/ArrayDeclarationUnitTest.php | 255 - ...assDefinitionClosingBraceSpaceUnitTest.css | 81 - ...initionClosingBraceSpaceUnitTest.css.fixed | 85 - ...assDefinitionClosingBraceSpaceUnitTest.php | 65 - .../ClassDefinitionNameSpacingUnitTest.css | 66 - .../ClassDefinitionNameSpacingUnitTest.php | 56 - ...assDefinitionOpeningBraceSpaceUnitTest.css | 108 - ...initionOpeningBraceSpaceUnitTest.css.fixed | 106 - ...assDefinitionOpeningBraceSpaceUnitTest.php | 69 - .../Squiz/Tests/CSS/ColonSpacingUnitTest.css | 42 - .../Tests/CSS/ColonSpacingUnitTest.css.fixed | 40 - .../Squiz/Tests/CSS/ColonSpacingUnitTest.php | 65 - .../Tests/CSS/ColourDefinitionUnitTest.css | 16 - .../CSS/ColourDefinitionUnitTest.css.fixed | 16 - .../Tests/CSS/ColourDefinitionUnitTest.php | 57 - ...sallowMultipleStyleDefinitionsUnitTest.css | 17 - ...MultipleStyleDefinitionsUnitTest.css.fixed | 27 - ...sallowMultipleStyleDefinitionsUnitTest.php | 59 - .../CSS/DuplicateClassDefinitionUnitTest.css | 103 - .../CSS/DuplicateClassDefinitionUnitTest.php | 59 - .../CSS/DuplicateStyleDefinitionUnitTest.css | 27 - .../CSS/DuplicateStyleDefinitionUnitTest.php | 53 - .../CSS/EmptyClassDefinitionUnitTest.css | 15 - .../CSS/EmptyClassDefinitionUnitTest.php | 59 - .../CSS/EmptyStyleDefinitionUnitTest.css | 11 - .../CSS/EmptyStyleDefinitionUnitTest.php | 58 - .../Tests/CSS/ForbiddenStylesUnitTest.css | 18 - .../CSS/ForbiddenStylesUnitTest.css.fixed | 18 - .../Tests/CSS/ForbiddenStylesUnitTest.php | 62 - .../Squiz/Tests/CSS/IndentationUnitTest.1.css | 79 - .../Tests/CSS/IndentationUnitTest.1.css.fixed | 73 - .../Squiz/Tests/CSS/IndentationUnitTest.2.css | 3 - .../Squiz/Tests/CSS/IndentationUnitTest.php | 80 - .../CSS/LowercaseStyleDefinitionUnitTest.css | 14 - .../CSS/LowercaseStyleDefinitionUnitTest.php | 58 - .../Squiz/Tests/CSS/MissingColonUnitTest.css | 21 - .../Squiz/Tests/CSS/MissingColonUnitTest.php | 58 - .../Squiz/Tests/CSS/NamedColoursUnitTest.css | 25 - .../Squiz/Tests/CSS/NamedColoursUnitTest.php | 59 - .../Squiz/Tests/CSS/OpacityUnitTest.css | 35 - .../Squiz/Tests/CSS/OpacityUnitTest.css.fixed | 35 - .../Squiz/Tests/CSS/OpacityUnitTest.php | 65 - .../Tests/CSS/SemicolonSpacingUnitTest.css | 61 - .../CSS/SemicolonSpacingUnitTest.css.fixed | 58 - .../Tests/CSS/SemicolonSpacingUnitTest.php | 63 - .../Tests/CSS/ShorthandSizeUnitTest.1.css | 41 - .../CSS/ShorthandSizeUnitTest.1.css.fixed | 37 - .../Tests/CSS/ShorthandSizeUnitTest.2.css | 3 - .../Squiz/Tests/CSS/ShorthandSizeUnitTest.php | 72 - .../Classes/ClassDeclarationUnitTest.inc | 130 - .../ClassDeclarationUnitTest.inc.fixed | 140 - .../Classes/ClassDeclarationUnitTest.php | 91 - .../Tests/Classes/ClassFileNameUnitTest.inc | 45 - .../Tests/Classes/ClassFileNameUnitTest.php | 82 - .../Classes/DuplicatePropertyUnitTest.js | 45 - .../Classes/DuplicatePropertyUnitTest.php | 57 - .../LowercaseClassKeywordsUnitTest.inc | 16 - .../LowercaseClassKeywordsUnitTest.inc.fixed | 16 - .../LowercaseClassKeywordsUnitTest.php | 66 - .../Classes/SelfMemberReferenceUnitTest.inc | 185 - .../SelfMemberReferenceUnitTest.inc.fixed | 173 - .../Classes/SelfMemberReferenceUnitTest.php | 70 - .../Tests/Classes/ValidClassNameUnitTest.inc | 191 - .../Tests/Classes/ValidClassNameUnitTest.php | 80 - .../Tests/Commenting/BlockCommentUnitTest.inc | 309 - .../Commenting/BlockCommentUnitTest.inc.fixed | 311 - .../Tests/Commenting/BlockCommentUnitTest.php | 109 - .../Tests/Commenting/ClassCommentUnitTest.inc | 145 - .../Tests/Commenting/ClassCommentUnitTest.php | 66 - .../ClosingDeclarationCommentUnitTest.1.inc | 124 - ...singDeclarationCommentUnitTest.1.inc.fixed | 117 - .../ClosingDeclarationCommentUnitTest.2.inc | 7 - .../ClosingDeclarationCommentUnitTest.3.inc | 7 - .../ClosingDeclarationCommentUnitTest.4.inc | 8 - ...singDeclarationCommentUnitTest.4.inc.fixed | 8 - .../ClosingDeclarationCommentUnitTest.5.inc | 11 - ...singDeclarationCommentUnitTest.5.inc.fixed | 11 - .../ClosingDeclarationCommentUnitTest.php | 96 - .../DocCommentAlignmentUnitTest.inc | 103 - .../DocCommentAlignmentUnitTest.inc.fixed | 103 - .../Commenting/DocCommentAlignmentUnitTest.js | 76 - .../DocCommentAlignmentUnitTest.js.fixed | 76 - .../DocCommentAlignmentUnitTest.php | 81 - .../Commenting/EmptyCatchCommentUnitTest.inc | 55 - .../Commenting/EmptyCatchCommentUnitTest.php | 60 - .../Commenting/FileCommentUnitTest.1.inc | 43 - .../FileCommentUnitTest.1.inc.fixed | 43 - .../Tests/Commenting/FileCommentUnitTest.1.js | 40 - .../Commenting/FileCommentUnitTest.1.js.fixed | 40 - .../Commenting/FileCommentUnitTest.10.inc | 12 - .../Commenting/FileCommentUnitTest.2.inc | 11 - .../Tests/Commenting/FileCommentUnitTest.2.js | 10 - .../Commenting/FileCommentUnitTest.3.inc | 9 - .../Commenting/FileCommentUnitTest.4.inc | 3 - .../Commenting/FileCommentUnitTest.5.inc | 4 - .../Commenting/FileCommentUnitTest.6.inc | 12 - .../Commenting/FileCommentUnitTest.7.inc | 12 - .../Commenting/FileCommentUnitTest.8.inc | 9 - .../Commenting/FileCommentUnitTest.9.inc | 12 - .../Tests/Commenting/FileCommentUnitTest.php | 82 - .../FunctionCommentThrowTagUnitTest.inc | 511 -- .../FunctionCommentThrowTagUnitTest.php | 65 - .../Commenting/FunctionCommentUnitTest.inc | 1160 --- .../FunctionCommentUnitTest.inc.fixed | 1160 --- .../Commenting/FunctionCommentUnitTest.php | 208 - .../Commenting/InlineCommentUnitTest.inc | 196 - .../InlineCommentUnitTest.inc.fixed | 189 - .../Tests/Commenting/InlineCommentUnitTest.js | 129 - .../Commenting/InlineCommentUnitTest.js.fixed | 125 - .../Commenting/InlineCommentUnitTest.php | 96 - .../LongConditionClosingCommentUnitTest.inc | 1033 --- ...gConditionClosingCommentUnitTest.inc.fixed | 1033 --- .../LongConditionClosingCommentUnitTest.js | 444 - ...ngConditionClosingCommentUnitTest.js.fixed | 444 - .../LongConditionClosingCommentUnitTest.php | 107 - .../PostStatementCommentUnitTest.1.js | 36 - .../PostStatementCommentUnitTest.1.js.fixed | 39 - .../PostStatementCommentUnitTest.2.js | 2 - .../PostStatementCommentUnitTest.inc | 54 - .../PostStatementCommentUnitTest.inc.fixed | 59 - .../PostStatementCommentUnitTest.php | 74 - .../Commenting/VariableCommentUnitTest.inc | 456 - .../VariableCommentUnitTest.inc.fixed | 456 - .../Commenting/VariableCommentUnitTest.php | 88 - .../ControlSignatureUnitTest.1.inc | 320 - .../ControlSignatureUnitTest.1.inc.fixed | 324 - .../ControlSignatureUnitTest.2.inc | 5 - .../ControlSignatureUnitTest.js | 135 - .../ControlSignatureUnitTest.js.fixed | 141 - .../ControlSignatureUnitTest.php | 115 - .../ElseIfDeclarationUnitTest.inc | 14 - .../ElseIfDeclarationUnitTest.inc.fixed | 14 - .../ElseIfDeclarationUnitTest.php | 56 - .../ForEachLoopDeclarationUnitTest.inc | 36 - .../ForEachLoopDeclarationUnitTest.inc.fixed | 36 - .../ForEachLoopDeclarationUnitTest.php | 61 - .../ForLoopDeclarationUnitTest.1.inc | 126 - .../ForLoopDeclarationUnitTest.1.inc.fixed | 92 - .../ForLoopDeclarationUnitTest.1.js | 122 - .../ForLoopDeclarationUnitTest.1.js.fixed | 88 - .../ForLoopDeclarationUnitTest.2.inc | 6 - .../ForLoopDeclarationUnitTest.2.js | 2 - .../ForLoopDeclarationUnitTest.3.inc | 6 - .../ForLoopDeclarationUnitTest.php | 138 - .../InlineIfDeclarationUnitTest.inc | 48 - .../InlineIfDeclarationUnitTest.inc.fixed | 48 - .../InlineIfDeclarationUnitTest.php | 80 - .../LowercaseDeclarationUnitTest.inc | 24 - .../LowercaseDeclarationUnitTest.inc.fixed | 24 - .../LowercaseDeclarationUnitTest.php | 66 - .../SwitchDeclarationUnitTest.inc | 333 - .../SwitchDeclarationUnitTest.inc.fixed | 342 - .../SwitchDeclarationUnitTest.js | 287 - .../SwitchDeclarationUnitTest.php | 157 - .../Squiz/Tests/Debug/JSLintUnitTest.js | 2 - .../Squiz/Tests/Debug/JSLintUnitTest.php | 74 - .../Tests/Debug/JavaScriptLintUnitTest.js | 2 - .../Tests/Debug/JavaScriptLintUnitTest.php | 71 - .../Tests/Files/FileExtensionUnitTest.1.inc | 3 - .../Tests/Files/FileExtensionUnitTest.2.inc | 3 - .../Tests/Files/FileExtensionUnitTest.3.inc | 3 - .../Tests/Files/FileExtensionUnitTest.4.inc | 3 - .../Tests/Files/FileExtensionUnitTest.5.inc | 3 - .../Tests/Files/FileExtensionUnitTest.php | 60 - .../Formatting/OperatorBracketUnitTest.inc | 203 - .../OperatorBracketUnitTest.inc.fixed | 203 - .../Formatting/OperatorBracketUnitTest.js | 118 - .../OperatorBracketUnitTest.js.fixed | 118 - .../Formatting/OperatorBracketUnitTest.php | 121 - ...tionDeclarationArgumentSpacingUnitTest.inc | 111 - ...clarationArgumentSpacingUnitTest.inc.fixed | 111 - ...tionDeclarationArgumentSpacingUnitTest.php | 91 - .../Functions/FunctionDeclarationUnitTest.inc | 75 - .../Functions/FunctionDeclarationUnitTest.php | 56 - .../FunctionDuplicateArgumentUnitTest.inc | 6 - .../FunctionDuplicateArgumentUnitTest.php | 57 - .../Functions/GlobalFunctionUnitTest.inc | 17 - .../Functions/GlobalFunctionUnitTest.php | 53 - .../LowercaseFunctionKeywordsUnitTest.inc | 28 - ...owercaseFunctionKeywordsUnitTest.inc.fixed | 28 - .../LowercaseFunctionKeywordsUnitTest.php | 63 - .../MultiLineFunctionDeclarationUnitTest.inc | 304 - ...iLineFunctionDeclarationUnitTest.inc.fixed | 316 - .../MultiLineFunctionDeclarationUnitTest.js | 73 - ...tiLineFunctionDeclarationUnitTest.js.fixed | 81 - .../MultiLineFunctionDeclarationUnitTest.php | 118 - .../ValidFunctionNameUnitTest.inc | 27 - .../ValidFunctionNameUnitTest.php | 64 - .../ValidVariableNameUnitTest.inc | 157 - .../ValidVariableNameUnitTest.php | 93 - .../DisallowObjectStringIndexUnitTest.js | 37 - .../DisallowObjectStringIndexUnitTest.php | 64 - .../Objects/ObjectInstantiationUnitTest.inc | 49 - .../Objects/ObjectInstantiationUnitTest.php | 58 - .../Objects/ObjectMemberCommaUnitTest.js | 47 - .../ObjectMemberCommaUnitTest.js.fixed | 47 - .../Objects/ObjectMemberCommaUnitTest.php | 58 - .../ComparisonOperatorUsageUnitTest.inc | 138 - .../ComparisonOperatorUsageUnitTest.js | 71 - .../ComparisonOperatorUsageUnitTest.php | 105 - .../IncrementDecrementUsageUnitTest.inc | 56 - .../IncrementDecrementUsageUnitTest.php | 73 - .../ValidLogicalOperatorsUnitTest.inc | 28 - .../ValidLogicalOperatorsUnitTest.php | 57 - .../Tests/PHP/CommentedOutCodeUnitTest.css | 23 - .../Tests/PHP/CommentedOutCodeUnitTest.inc | 158 - .../Tests/PHP/CommentedOutCodeUnitTest.php | 80 - .../PHP/DisallowBooleanStatementUnitTest.inc | 27 - .../PHP/DisallowBooleanStatementUnitTest.php | 58 - .../DisallowComparisonAssignmentUnitTest.inc | 83 - .../DisallowComparisonAssignmentUnitTest.php | 64 - .../Tests/PHP/DisallowInlineIfUnitTest.inc | 18 - .../Tests/PHP/DisallowInlineIfUnitTest.js | 2 - .../Tests/PHP/DisallowInlineIfUnitTest.php | 67 - .../DisallowMultipleAssignmentsUnitTest.1.inc | 136 - .../DisallowMultipleAssignmentsUnitTest.2.inc | 7 - .../DisallowMultipleAssignmentsUnitTest.php | 71 - .../DisallowSizeFunctionsInLoopsUnitTest.inc | 58 - .../DisallowSizeFunctionsInLoopsUnitTest.js | 13 - .../DisallowSizeFunctionsInLoopsUnitTest.php | 77 - .../PHP/DiscouragedFunctionsUnitTest.inc | 7 - .../PHP/DiscouragedFunctionsUnitTest.php | 57 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc | 271 - .../Tests/PHP/EmbeddedPhpUnitTest.1.inc.fixed | 283 - .../Tests/PHP/EmbeddedPhpUnitTest.10.inc | 16 - .../Tests/PHP/EmbeddedPhpUnitTest.11.inc | 14 - .../Tests/PHP/EmbeddedPhpUnitTest.12.inc | 12 - .../PHP/EmbeddedPhpUnitTest.12.inc.fixed | 10 - .../Tests/PHP/EmbeddedPhpUnitTest.13.inc | 12 - .../PHP/EmbeddedPhpUnitTest.13.inc.fixed | 10 - .../Tests/PHP/EmbeddedPhpUnitTest.14.inc | 8 - .../Tests/PHP/EmbeddedPhpUnitTest.15.inc | 9 - .../Tests/PHP/EmbeddedPhpUnitTest.16.inc | 8 - .../Tests/PHP/EmbeddedPhpUnitTest.17.inc | 8 - .../Tests/PHP/EmbeddedPhpUnitTest.18.inc | 15 - .../PHP/EmbeddedPhpUnitTest.18.inc.fixed | 13 - .../Tests/PHP/EmbeddedPhpUnitTest.19.inc | 17 - .../PHP/EmbeddedPhpUnitTest.19.inc.fixed | 15 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc | 7 - .../Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed | 7 - .../Tests/PHP/EmbeddedPhpUnitTest.20.inc | 15 - .../PHP/EmbeddedPhpUnitTest.20.inc.fixed | 16 - .../Tests/PHP/EmbeddedPhpUnitTest.21.inc | 15 - .../PHP/EmbeddedPhpUnitTest.21.inc.fixed | 16 - .../Tests/PHP/EmbeddedPhpUnitTest.22.inc | 30 - .../PHP/EmbeddedPhpUnitTest.22.inc.fixed | 31 - .../Tests/PHP/EmbeddedPhpUnitTest.23.inc | 23 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc | 123 - .../Tests/PHP/EmbeddedPhpUnitTest.3.inc.fixed | 132 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc | 7 - .../Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed | 7 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc | 48 - .../Tests/PHP/EmbeddedPhpUnitTest.5.inc.fixed | 39 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.6.inc | 8 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.7.inc | 8 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.8.inc | 10 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.9.inc | 10 - .../Squiz/Tests/PHP/EmbeddedPhpUnitTest.php | 215 - .../Squiz/Tests/PHP/EvalUnitTest.inc | 5 - .../Squiz/Tests/PHP/EvalUnitTest.php | 56 - .../Squiz/Tests/PHP/GlobalKeywordUnitTest.inc | 13 - .../Squiz/Tests/PHP/GlobalKeywordUnitTest.php | 56 - .../Squiz/Tests/PHP/HeredocUnitTest.1.inc | 12 - .../Squiz/Tests/PHP/HeredocUnitTest.2.inc | 17 - .../Squiz/Tests/PHP/HeredocUnitTest.php | 64 - .../Tests/PHP/InnerFunctionsUnitTest.inc | 87 - .../Tests/PHP/InnerFunctionsUnitTest.php | 58 - .../PHP/LowercasePHPFunctionsUnitTest.inc | 50 - .../LowercasePHPFunctionsUnitTest.inc.fixed | 50 - .../PHP/LowercasePHPFunctionsUnitTest.php | 60 - .../Tests/PHP/NonExecutableCodeUnitTest.1.inc | 420 - .../Tests/PHP/NonExecutableCodeUnitTest.2.inc | 73 - .../Tests/PHP/NonExecutableCodeUnitTest.3.inc | 64 - .../Tests/PHP/NonExecutableCodeUnitTest.4.inc | 6 - .../Tests/PHP/NonExecutableCodeUnitTest.php | 124 - .../Tests/Scope/MemberVarScopeUnitTest.inc | 72 - .../Tests/Scope/MemberVarScopeUnitTest.php | 63 - .../Squiz/Tests/Scope/MethodScopeUnitTest.inc | 57 - .../Squiz/Tests/Scope/MethodScopeUnitTest.php | 58 - .../Tests/Scope/StaticThisUsageUnitTest.inc | 127 - .../Tests/Scope/StaticThisUsageUnitTest.php | 67 - .../Strings/ConcatenationSpacingUnitTest.inc | 49 - .../ConcatenationSpacingUnitTest.inc.fixed | 47 - .../Strings/ConcatenationSpacingUnitTest.php | 71 - .../Strings/DoubleQuoteUsageUnitTest.inc | 37 - .../DoubleQuoteUsageUnitTest.inc.fixed | 37 - .../Strings/DoubleQuoteUsageUnitTest.php | 67 - .../Tests/Strings/EchoedStringsUnitTest.inc | 13 - .../Strings/EchoedStringsUnitTest.inc.fixed | 13 - .../Tests/Strings/EchoedStringsUnitTest.php | 60 - .../Tests/WhiteSpace/CastSpacingUnitTest.inc | 9 - .../WhiteSpace/CastSpacingUnitTest.inc.fixed | 9 - .../Tests/WhiteSpace/CastSpacingUnitTest.php | 59 - .../ControlStructureSpacingUnitTest.inc | 269 - .../ControlStructureSpacingUnitTest.inc.fixed | 261 - .../ControlStructureSpacingUnitTest.js | 93 - .../ControlStructureSpacingUnitTest.js.fixed | 93 - .../ControlStructureSpacingUnitTest.php | 107 - .../FunctionClosingBraceSpaceUnitTest.inc | 39 - ...unctionClosingBraceSpaceUnitTest.inc.fixed | 45 - .../FunctionClosingBraceSpaceUnitTest.js | 132 - ...FunctionClosingBraceSpaceUnitTest.js.fixed | 133 - .../FunctionClosingBraceSpaceUnitTest.php | 80 - .../FunctionOpeningBraceSpaceUnitTest.inc | 54 - ...unctionOpeningBraceSpaceUnitTest.inc.fixed | 49 - .../FunctionOpeningBraceSpaceUnitTest.js | 115 - ...FunctionOpeningBraceSpaceUnitTest.js.fixed | 109 - .../FunctionOpeningBraceSpaceUnitTest.php | 73 - .../WhiteSpace/FunctionSpacingUnitTest.1.inc | 584 -- .../FunctionSpacingUnitTest.1.inc.fixed | 673 -- .../WhiteSpace/FunctionSpacingUnitTest.2.inc | 5 - .../FunctionSpacingUnitTest.2.inc.fixed | 7 - .../WhiteSpace/FunctionSpacingUnitTest.3.inc | 10 - .../FunctionSpacingUnitTest.3.inc.fixed | 7 - .../WhiteSpace/FunctionSpacingUnitTest.4.inc | 7 - .../WhiteSpace/FunctionSpacingUnitTest.5.inc | 8 - .../FunctionSpacingUnitTest.5.inc.fixed | 10 - .../WhiteSpace/FunctionSpacingUnitTest.6.inc | 13 - .../FunctionSpacingUnitTest.6.inc.fixed | 10 - .../WhiteSpace/FunctionSpacingUnitTest.7.inc | 10 - .../WhiteSpace/FunctionSpacingUnitTest.php | 141 - .../LanguageConstructSpacingUnitTest.inc | 43 - ...LanguageConstructSpacingUnitTest.inc.fixed | 41 - .../LanguageConstructSpacingUnitTest.php | 65 - .../LogicalOperatorSpacingUnitTest.inc | 19 - .../LogicalOperatorSpacingUnitTest.inc.fixed | 19 - .../LogicalOperatorSpacingUnitTest.js | 19 - .../LogicalOperatorSpacingUnitTest.js.fixed | 19 - .../LogicalOperatorSpacingUnitTest.php | 59 - .../WhiteSpace/MemberVarSpacingUnitTest.inc | 374 - .../MemberVarSpacingUnitTest.inc.fixed | 359 - .../WhiteSpace/MemberVarSpacingUnitTest.php | 90 - .../ObjectOperatorSpacingUnitTest.inc | 52 - .../ObjectOperatorSpacingUnitTest.inc.fixed | 48 - .../ObjectOperatorSpacingUnitTest.php | 73 - .../WhiteSpace/OperatorSpacingUnitTest.1.inc | 510 -- .../OperatorSpacingUnitTest.1.inc.fixed | 502 -- .../WhiteSpace/OperatorSpacingUnitTest.2.inc | 3 - .../WhiteSpace/OperatorSpacingUnitTest.3.inc | 6 - .../WhiteSpace/OperatorSpacingUnitTest.js | 104 - .../OperatorSpacingUnitTest.js.fixed | 98 - .../WhiteSpace/OperatorSpacingUnitTest.php | 180 - .../PropertyLabelSpacingUnitTest.js | 40 - .../PropertyLabelSpacingUnitTest.js.fixed | 39 - .../PropertyLabelSpacingUnitTest.php | 60 - .../WhiteSpace/ScopeClosingBraceUnitTest.inc | 134 - .../ScopeClosingBraceUnitTest.inc.fixed | 138 - .../WhiteSpace/ScopeClosingBraceUnitTest.php | 64 - .../ScopeKeywordSpacingUnitTest.1.inc | 149 - .../ScopeKeywordSpacingUnitTest.1.inc.fixed | 143 - .../ScopeKeywordSpacingUnitTest.2.inc | 6 - .../ScopeKeywordSpacingUnitTest.3.inc | 6 - .../ScopeKeywordSpacingUnitTest.3.inc.fixed | 6 - .../ScopeKeywordSpacingUnitTest.php | 88 - .../WhiteSpace/SemicolonSpacingUnitTest.inc | 42 - .../SemicolonSpacingUnitTest.inc.fixed | 41 - .../WhiteSpace/SemicolonSpacingUnitTest.js | 25 - .../SemicolonSpacingUnitTest.js.fixed | 25 - .../WhiteSpace/SemicolonSpacingUnitTest.php | 87 - .../SuperfluousWhitespaceUnitTest.1.css | 32 - .../SuperfluousWhitespaceUnitTest.1.css.fixed | 30 - .../SuperfluousWhitespaceUnitTest.1.inc | 74 - .../SuperfluousWhitespaceUnitTest.1.inc.fixed | 68 - .../SuperfluousWhitespaceUnitTest.1.js | 56 - .../SuperfluousWhitespaceUnitTest.1.js.fixed | 50 - .../SuperfluousWhitespaceUnitTest.2.css | 3 - .../SuperfluousWhitespaceUnitTest.2.css.fixed | 3 - .../SuperfluousWhitespaceUnitTest.2.inc | 9 - .../SuperfluousWhitespaceUnitTest.2.inc.fixed | 7 - .../SuperfluousWhitespaceUnitTest.2.js | 1 - .../SuperfluousWhitespaceUnitTest.2.js.fixed | 1 - .../SuperfluousWhitespaceUnitTest.3.css | 3 - .../SuperfluousWhitespaceUnitTest.3.css.fixed | 3 - .../SuperfluousWhitespaceUnitTest.3.inc | 14 - .../SuperfluousWhitespaceUnitTest.3.inc.fixed | 5 - .../SuperfluousWhitespaceUnitTest.3.js | 1 - .../SuperfluousWhitespaceUnitTest.3.js.fixed | 1 - .../SuperfluousWhitespaceUnitTest.4.inc | 4 - .../SuperfluousWhitespaceUnitTest.4.inc.fixed | 4 - .../SuperfluousWhitespaceUnitTest.5.inc | 5 - .../SuperfluousWhitespaceUnitTest.5.inc.fixed | 4 - .../SuperfluousWhitespaceUnitTest.php | 117 - .../src/Standards/Squiz/ruleset.xml | 132 - .../Zend/Docs/Debug/CodeAnalyzerStandard.xml | 25 - .../Zend/Docs/Files/ClosingTagStandard.xml | 22 - .../ValidVariableNameStandard.xml | 37 - .../Zend/Sniffs/Debug/CodeAnalyzerSniff.php | 100 - .../Zend/Sniffs/Files/ClosingTagSniff.php | 79 - .../ValidVariableNameSniff.php | 196 - .../Zend/Tests/Debug/CodeAnalyzerUnitTest.inc | 6 - .../Zend/Tests/Debug/CodeAnalyzerUnitTest.php | 71 - .../Zend/Tests/Files/ClosingTagUnitTest.1.inc | 12 - .../Files/ClosingTagUnitTest.1.inc.fixed | 12 - .../Zend/Tests/Files/ClosingTagUnitTest.2.inc | 3 - .../Zend/Tests/Files/ClosingTagUnitTest.3.inc | 1 - .../Files/ClosingTagUnitTest.3.inc.fixed | 1 - .../Zend/Tests/Files/ClosingTagUnitTest.4.inc | 1 - .../Files/ClosingTagUnitTest.4.inc.fixed | 1 - .../Zend/Tests/Files/ClosingTagUnitTest.5.inc | 1 - .../Files/ClosingTagUnitTest.5.inc.fixed | 1 - .../Zend/Tests/Files/ClosingTagUnitTest.6.inc | 3 - .../Files/ClosingTagUnitTest.6.inc.fixed | 3 - .../Zend/Tests/Files/ClosingTagUnitTest.7.inc | 1 - .../Files/ClosingTagUnitTest.7.inc.fixed | 1 - .../Zend/Tests/Files/ClosingTagUnitTest.php | 70 - .../ValidVariableNameUnitTest.inc | 131 - .../ValidVariableNameUnitTest.php | 102 - .../src/Standards/Zend/ruleset.xml | 32 - .../php_codesniffer/src/Tokenizers/CSS.php | 541 -- .../src/Tokenizers/Comment.php | 283 - .../php_codesniffer/src/Tokenizers/JS.php | 1256 --- .../php_codesniffer/src/Tokenizers/PHP.php | 3875 --------- .../src/Tokenizers/Tokenizer.php | 1735 ---- .../php_codesniffer/src/Util/Cache.php | 355 - .../php_codesniffer/src/Util/Common.php | 586 -- .../php_codesniffer/src/Util/Help.php | 626 -- .../php_codesniffer/src/Util/Standards.php | 340 - .../php_codesniffer/src/Util/Timing.php | 119 - .../php_codesniffer/src/Util/Tokens.php | 812 -- trunk/vendor/symfony/console/Application.php | 1301 --- .../symfony/console/Attribute/AsCommand.php | 39 - trunk/vendor/symfony/console/CHANGELOG.md | 217 - .../console/CI/GithubActionReporter.php | 99 - trunk/vendor/symfony/console/Color.php | 180 - .../symfony/console/Command/Command.php | 710 -- .../console/Command/CompleteCommand.php | 205 - .../console/Command/DumpCompletionCommand.php | 145 - .../symfony/console/Command/HelpCommand.php | 101 - .../symfony/console/Command/LazyCommand.php | 218 - .../symfony/console/Command/ListCommand.php | 95 - .../symfony/console/Command/LockableTrait.php | 69 - .../Command/SignalableCommandInterface.php | 30 - .../CommandLoader/CommandLoaderInterface.php | 42 - .../CommandLoader/ContainerCommandLoader.php | 63 - .../CommandLoader/FactoryCommandLoader.php | 62 - .../console/Completion/CompletionInput.php | 249 - .../Completion/CompletionSuggestions.php | 99 - .../Output/BashCompletionOutput.php | 33 - .../Output/CompletionOutputInterface.php | 25 - .../symfony/console/Completion/Suggestion.php | 37 - .../vendor/symfony/console/ConsoleEvents.php | 72 - trunk/vendor/symfony/console/Cursor.php | 207 - .../AddConsoleCommandPass.php | 148 - .../Descriptor/ApplicationDescription.php | 143 - .../symfony/console/Descriptor/Descriptor.php | 94 - .../Descriptor/DescriptorInterface.php | 24 - .../console/Descriptor/JsonDescriptor.php | 181 - .../console/Descriptor/MarkdownDescriptor.php | 206 - .../console/Descriptor/TextDescriptor.php | 341 - .../console/Descriptor/XmlDescriptor.php | 247 - .../console/Event/ConsoleCommandEvent.php | 54 - .../console/Event/ConsoleErrorEvent.php | 58 - .../symfony/console/Event/ConsoleEvent.php | 67 - .../console/Event/ConsoleSignalEvent.php | 35 - .../console/Event/ConsoleTerminateEvent.php | 43 - .../console/EventListener/ErrorListener.php | 95 - .../Exception/CommandNotFoundException.php | 43 - .../console/Exception/ExceptionInterface.php | 21 - .../Exception/InvalidArgumentException.php | 19 - .../Exception/InvalidOptionException.php | 21 - .../console/Exception/LogicException.php | 19 - .../Exception/MissingInputException.php | 21 - .../Exception/NamespaceNotFoundException.php | 21 - .../console/Exception/RuntimeException.php | 19 - .../console/Formatter/NullOutputFormatter.php | 69 - .../Formatter/NullOutputFormatterStyle.php | 66 - .../console/Formatter/OutputFormatter.php | 294 - .../Formatter/OutputFormatterInterface.php | 60 - .../Formatter/OutputFormatterStyle.php | 109 - .../OutputFormatterStyleInterface.php | 52 - .../Formatter/OutputFormatterStyleStack.php | 110 - .../WrappableOutputFormatterInterface.php | 25 - .../console/Helper/DebugFormatterHelper.php | 107 - .../console/Helper/DescriptorHelper.php | 92 - .../vendor/symfony/console/Helper/Dumper.php | 64 - .../console/Helper/FormatterHelper.php | 92 - .../vendor/symfony/console/Helper/Helper.php | 180 - .../console/Helper/HelperInterface.php | 39 - .../symfony/console/Helper/HelperSet.php | 108 - .../console/Helper/InputAwareHelper.php | 33 - .../symfony/console/Helper/ProcessHelper.php | 144 - .../symfony/console/Helper/ProgressBar.php | 612 -- .../console/Helper/ProgressIndicator.php | 247 - .../symfony/console/Helper/QuestionHelper.php | 613 -- .../console/Helper/SymfonyQuestionHelper.php | 109 - trunk/vendor/symfony/console/Helper/Table.php | 917 -- .../symfony/console/Helper/TableCell.php | 78 - .../symfony/console/Helper/TableCellStyle.php | 89 - .../symfony/console/Helper/TableRows.php | 30 - .../symfony/console/Helper/TableSeparator.php | 25 - .../symfony/console/Helper/TableStyle.php | 376 - .../symfony/console/Input/ArgvInput.php | 378 - .../symfony/console/Input/ArrayInput.php | 210 - trunk/vendor/symfony/console/Input/Input.php | 213 - .../symfony/console/Input/InputArgument.php | 129 - .../console/Input/InputAwareInterface.php | 26 - .../symfony/console/Input/InputDefinition.php | 424 - .../symfony/console/Input/InputInterface.php | 151 - .../symfony/console/Input/InputOption.php | 231 - .../Input/StreamableInputInterface.php | 37 - .../symfony/console/Input/StringInput.php | 84 - trunk/vendor/symfony/console/LICENSE | 19 - .../symfony/console/Logger/ConsoleLogger.php | 126 - .../symfony/console/Output/BufferedOutput.php | 45 - .../symfony/console/Output/ConsoleOutput.php | 172 - .../console/Output/ConsoleOutputInterface.php | 32 - .../console/Output/ConsoleSectionOutput.php | 143 - .../symfony/console/Output/NullOutput.php | 128 - .../vendor/symfony/console/Output/Output.php | 174 - .../console/Output/OutputInterface.php | 110 - .../symfony/console/Output/StreamOutput.php | 123 - .../console/Output/TrimmedBufferOutput.php | 63 - .../console/Question/ChoiceQuestion.php | 183 - .../console/Question/ConfirmationQuestion.php | 57 - .../symfony/console/Question/Question.php | 299 - .../console/Resources/bin/hiddeninput.exe | Bin 9216 -> 0 bytes .../symfony/console/Resources/completion.bash | 84 - .../console/SignalRegistry/SignalRegistry.php | 65 - .../console/SingleCommandApplication.php | 72 - .../symfony/console/Style/OutputStyle.php | 153 - .../symfony/console/Style/StyleInterface.php | 132 - .../symfony/console/Style/SymfonyStyle.php | 518 -- trunk/vendor/symfony/console/Terminal.php | 177 - .../console/Tester/ApplicationTester.php | 85 - .../Tester/CommandCompletionTester.php | 56 - .../symfony/console/Tester/CommandTester.php | 76 - .../Tester/Constraint/CommandIsSuccessful.php | 55 - .../symfony/console/Tester/TesterTrait.php | 197 - .../deprecation-contracts/CHANGELOG.md | 5 - .../symfony/deprecation-contracts/LICENSE | 19 - .../deprecation-contracts/function.php | 27 - trunk/vendor/symfony/finder/CHANGELOG.md | 87 - .../symfony/finder/Comparator/Comparator.php | 117 - .../finder/Comparator/DateComparator.php | 50 - .../finder/Comparator/NumberComparator.php | 78 - .../Exception/AccessDeniedException.php | 19 - .../Exception/DirectoryNotFoundException.php | 19 - trunk/vendor/symfony/finder/Finder.php | 806 -- trunk/vendor/symfony/finder/Gitignore.php | 93 - trunk/vendor/symfony/finder/Glob.php | 111 - .../finder/Iterator/CustomFilterIterator.php | 64 - .../Iterator/DateRangeFilterIterator.php | 61 - .../Iterator/DepthRangeFilterIterator.php | 51 - .../ExcludeDirectoryFilterIterator.php | 97 - .../Iterator/FileTypeFilterIterator.php | 56 - .../Iterator/FilecontentFilterIterator.php | 61 - .../Iterator/FilenameFilterIterator.php | 50 - .../symfony/finder/Iterator/LazyIterator.php | 32 - .../Iterator/MultiplePcreFilterIterator.php | 117 - .../finder/Iterator/PathFilterIterator.php | 59 - .../Iterator/RecursiveDirectoryIterator.php | 157 - .../Iterator/SizeRangeFilterIterator.php | 60 - .../finder/Iterator/SortableIterator.php | 104 - .../Iterator/VcsIgnoredFilterIterator.php | 151 - trunk/vendor/symfony/finder/LICENSE | 19 - trunk/vendor/symfony/finder/SplFileInfo.php | 88 - trunk/vendor/symfony/polyfill-ctype/Ctype.php | 232 - trunk/vendor/symfony/polyfill-ctype/LICENSE | 19 - .../symfony/polyfill-ctype/bootstrap.php | 50 - .../symfony/polyfill-ctype/bootstrap80.php | 46 - .../polyfill-intl-grapheme/Grapheme.php | 247 - .../symfony/polyfill-intl-grapheme/LICENSE | 19 - .../polyfill-intl-grapheme/bootstrap.php | 58 - .../polyfill-intl-grapheme/bootstrap80.php | 50 - .../symfony/polyfill-intl-normalizer/LICENSE | 19 - .../polyfill-intl-normalizer/Normalizer.php | 310 - .../Resources/stubs/Normalizer.php | 17 - .../unidata/canonicalComposition.php | 945 --- .../unidata/canonicalDecomposition.php | 2065 ----- .../Resources/unidata/combiningClass.php | 876 -- .../unidata/compatibilityDecomposition.php | 3695 --------- .../polyfill-intl-normalizer/bootstrap.php | 23 - .../polyfill-intl-normalizer/bootstrap80.php | 19 - .../vendor/symfony/polyfill-mbstring/LICENSE | 19 - .../symfony/polyfill-mbstring/Mbstring.php | 996 --- .../Resources/unidata/caseFolding.php | 119 - .../Resources/unidata/lowerCase.php | 1397 ---- .../Resources/unidata/titleCaseRegexp.php | 5 - .../Resources/unidata/upperCase.php | 1489 ---- .../symfony/polyfill-mbstring/bootstrap.php | 159 - .../symfony/polyfill-mbstring/bootstrap80.php | 155 - trunk/vendor/symfony/polyfill-php73/LICENSE | 19 - trunk/vendor/symfony/polyfill-php73/Php73.php | 43 - .../Resources/stubs/JsonException.php | 16 - .../symfony/polyfill-php73/bootstrap.php | 31 - trunk/vendor/symfony/polyfill-php80/LICENSE | 19 - trunk/vendor/symfony/polyfill-php80/Php80.php | 115 - .../symfony/polyfill-php80/PhpToken.php | 103 - .../Resources/stubs/Attribute.php | 31 - .../Resources/stubs/PhpToken.php | 16 - .../Resources/stubs/Stringable.php | 20 - .../Resources/stubs/UnhandledMatchError.php | 16 - .../Resources/stubs/ValueError.php | 16 - .../symfony/polyfill-php80/bootstrap.php | 42 - .../service-contracts/Attribute/Required.php | 25 - .../Attribute/SubscribedService.php | 33 - .../symfony/service-contracts/CHANGELOG.md | 5 - .../vendor/symfony/service-contracts/LICENSE | 19 - .../service-contracts/ResetInterface.php | 30 - .../service-contracts/ServiceLocatorTrait.php | 124 - .../ServiceProviderInterface.php | 36 - .../ServiceSubscriberInterface.php | 53 - .../ServiceSubscriberTrait.php | 77 - .../Test/ServiceLocatorTest.php | 92 - .../vendor/symfony/string/AbstractString.php | 716 -- .../symfony/string/AbstractUnicodeString.php | 606 -- trunk/vendor/symfony/string/ByteString.php | 493 -- trunk/vendor/symfony/string/CHANGELOG.md | 35 - .../vendor/symfony/string/CodePointString.php | 260 - .../string/Exception/ExceptionInterface.php | 16 - .../Exception/InvalidArgumentException.php | 16 - .../string/Exception/RuntimeException.php | 16 - .../string/Inflector/EnglishInflector.php | 511 -- .../string/Inflector/FrenchInflector.php | 157 - .../string/Inflector/InflectorInterface.php | 33 - trunk/vendor/symfony/string/LICENSE | 19 - trunk/vendor/symfony/string/LazyString.php | 143 - .../Resources/data/wcswidth_table_wide.php | 1143 --- .../Resources/data/wcswidth_table_zero.php | 1415 ---- .../symfony/string/Resources/functions.php | 38 - .../symfony/string/Slugger/AsciiSlugger.php | 176 - .../string/Slugger/SluggerInterface.php | 27 - trunk/vendor/symfony/string/UnicodeString.php | 358 - .../wp-coding-standards/wpcs/CHANGELOG.md | 1654 ---- trunk/vendor/wp-coding-standards/wpcs/LICENSE | 21 - .../wpcs/WordPress-Core/ruleset.xml | 948 --- .../wpcs/WordPress-Docs/ruleset.xml | 109 - .../wpcs/WordPress-Extra/ruleset.xml | 199 - ...stractArrayAssignmentRestrictionsSniff.php | 261 - .../AbstractClassRestrictionsSniff.php | 257 - .../AbstractFunctionParameterSniff.php | 111 - .../AbstractFunctionRestrictionsSniff.php | 358 - .../Docs/Arrays/ArrayIndentationStandard.xml | 116 - .../ArrayKeySpacingRestrictionsStandard.xml | 31 - .../MultipleStatementAlignmentStandard.xml | 50 - .../EscapedNotTranslatedStandard.xml | 24 - .../DateTime/CurrentTimeTimestampStandard.xml | 35 - .../DateTime/RestrictedFunctionsStandard.xml | 54 - .../PrefixAllGlobalsStandard.xml | 119 - .../ValidHookNameStandard.xml | 35 - .../ValidPostTypeSlugStandard.xml | 121 - .../WordPress/Docs/PHP/IniSetStandard.xml | 40 - .../Docs/PHP/StrictInArrayStandard.xml | 53 - .../Docs/PHP/YodaConditionsStandard.xml | 27 - .../Docs/Security/SafeRedirectStandard.xml | 23 - .../Docs/WP/CapabilitiesStandard.xml | 69 - .../Docs/WP/CapitalPDangitStandard.xml | 43 - .../Docs/WP/ClassNameCaseStandard.xml | 23 - .../Docs/WP/CronIntervalStandard.xml | 45 - .../Docs/WP/DeprecatedClassesStandard.xml | 23 - .../Docs/WP/DeprecatedFunctionsStandard.xml | 23 - .../WP/DeprecatedParameterValuesStandard.xml | 23 - .../Docs/WP/DeprecatedParametersStandard.xml | 40 - .../WP/EnqueuedResourceParametersStandard.xml | 92 - .../Docs/WP/EnqueuedResourcesStandard.xml | 57 - .../Docs/WP/PostsPerPageStandard.xml | 73 - .../CastStructureSpacingStandard.xml | 27 - .../ControlStructureSpacingStandard.xml | 150 - .../ObjectOperatorSpacingStandard.xml | 19 - .../WhiteSpace/OperatorSpacingStandard.xml | 61 - .../Helpers/ArrayWalkingFunctionsHelper.php | 108 - .../WordPress/Helpers/ConstantsHelper.php | 135 - .../wpcs/WordPress/Helpers/ContextHelper.php | 394 - .../WordPress/Helpers/DeprecationHelper.php | 84 - .../Helpers/EscapingFunctionsTrait.php | 256 - .../Helpers/FormattingFunctionsHelper.php | 60 - .../WordPress/Helpers/IsUnitTestTrait.php | 238 - .../wpcs/WordPress/Helpers/ListHelper.php | 101 - .../Helpers/MinimumWPVersionTrait.php | 159 - .../Helpers/PrintingFunctionsTrait.php | 122 - .../Helpers/RulesetPropertyHelper.php | 73 - .../Helpers/SanitizationHelperTrait.php | 418 - .../WordPress/Helpers/SnakeCaseHelper.php | 60 - .../Helpers/UnslashingFunctionsHelper.php | 59 - .../WordPress/Helpers/ValidationHelper.php | 349 - .../wpcs/WordPress/Helpers/VariableHelper.php | 262 - .../wpcs/WordPress/Helpers/WPDBTrait.php | 115 - .../Helpers/WPGlobalVariablesHelper.php | 312 - .../wpcs/WordPress/Helpers/WPHookHelper.php | 113 - .../wpcs/WordPress/Sniff.php | 72 - .../Arrays/ArrayDeclarationSpacingSniff.php | 252 - .../Sniffs/Arrays/ArrayIndentationSniff.php | 550 -- .../ArrayKeySpacingRestrictionsSniff.php | 174 - .../MultipleStatementAlignmentSniff.php | 583 -- .../AssignmentInTernaryConditionSniff.php | 173 - .../EscapedNotTranslatedSniff.php | 89 - .../Sniffs/DB/DirectDatabaseQuerySniff.php | 301 - .../DB/PreparedSQLPlaceholdersSniff.php | 761 -- .../WordPress/Sniffs/DB/PreparedSQLSniff.php | 242 - .../Sniffs/DB/RestrictedClassesSniff.php | 57 - .../Sniffs/DB/RestrictedFunctionsSniff.php | 63 - .../WordPress/Sniffs/DB/SlowDBQuerySniff.php | 58 - .../DateTime/CurrentTimeTimestampSniff.php | 168 - .../DateTime/RestrictedFunctionsSniff.php | 59 - .../WordPress/Sniffs/Files/FileNameSniff.php | 313 - .../PrefixAllGlobalsSniff.php | 1297 --- .../ValidFunctionNameSniff.php | 188 - .../NamingConventions/ValidHookNameSniff.php | 277 - .../ValidPostTypeSlugSniff.php | 230 - .../ValidVariableNameSniff.php | 289 - .../Sniffs/PHP/DevelopmentFunctionsSniff.php | 63 - .../PHP/DiscouragedPHPFunctionsSniff.php | 100 - .../WordPress/Sniffs/PHP/DontExtractSniff.php | 52 - .../wpcs/WordPress/Sniffs/PHP/IniSetSniff.php | 193 - .../Sniffs/PHP/NoSilencedErrorsSniff.php | 245 - .../Sniffs/PHP/POSIXFunctionsSniff.php | 73 - .../Sniffs/PHP/PregQuoteDelimiterSniff.php | 70 - .../PHP/RestrictedPHPFunctionsSniff.php | 45 - .../Sniffs/PHP/StrictInArraySniff.php | 122 - .../WordPress/Sniffs/PHP/TypeCastsSniff.php | 90 - .../Sniffs/PHP/YodaConditionsSniff.php | 124 - .../Sniffs/Security/EscapeOutputSniff.php | 903 -- .../Security/NonceVerificationSniff.php | 422 - .../Sniffs/Security/PluginMenuSlugSniff.php | 126 - .../Sniffs/Security/SafeRedirectSniff.php | 45 - .../Security/ValidatedSanitizedInputSniff.php | 244 - .../Sniffs/Utils/I18nTextDomainFixerSniff.php | 862 -- .../Sniffs/WP/AlternativeFunctionsSniff.php | 371 - .../WordPress/Sniffs/WP/CapabilitiesSniff.php | 478 -- .../Sniffs/WP/CapitalPDangitSniff.php | 315 - .../Sniffs/WP/ClassNameCaseSniff.php | 897 -- .../WordPress/Sniffs/WP/CronIntervalSniff.php | 321 - .../Sniffs/WP/DeprecatedClassesSniff.php | 152 - .../Sniffs/WP/DeprecatedFunctionsSniff.php | 1708 ---- .../WP/DeprecatedParameterValuesSniff.php | 291 - .../Sniffs/WP/DeprecatedParametersSniff.php | 509 -- .../Sniffs/WP/DiscouragedConstantsSniff.php | 160 - .../Sniffs/WP/DiscouragedFunctionsSniff.php | 54 - .../WP/EnqueuedResourceParametersSniff.php | 241 - .../Sniffs/WP/EnqueuedResourcesSniff.php | 108 - .../WP/GlobalVariablesOverrideSniff.php | 436 - .../wpcs/WordPress/Sniffs/WP/I18nSniff.php | 977 --- .../WordPress/Sniffs/WP/PostsPerPageSniff.php | 102 - .../WhiteSpace/CastStructureSpacingSniff.php | 59 - .../ControlStructureSpacingSniff.php | 486 -- .../WhiteSpace/ObjectOperatorSpacingSniff.php | 63 - .../WhiteSpace/OperatorSpacingSniff.php | 60 - .../wpcs/WordPress/ruleset.xml | 13 - .../wpcs/phpcs.xml.dist.sample | 153 - trunk/wc-serial-numbers.php | 72 - 2330 files changed, 316279 deletions(-) delete mode 100644 trunk/assets/blocks/index.js delete mode 100644 trunk/assets/dist/blocks/blocks.asset.php delete mode 100644 trunk/assets/dist/blocks/blocks.js delete mode 100644 trunk/assets/dist/css/admin-style.asset.php delete mode 100644 trunk/assets/dist/css/admin-style.css delete mode 100644 trunk/assets/dist/css/frontend-style.asset.php delete mode 100644 trunk/assets/dist/css/frontend-style.css delete mode 100644 trunk/assets/dist/images/add-generator.png delete mode 100644 trunk/assets/dist/images/csv-export.png delete mode 100644 trunk/assets/dist/images/csv-import.png delete mode 100644 trunk/assets/dist/images/txt-import.png delete mode 100644 trunk/assets/dist/js/admin-script.asset.php delete mode 100644 trunk/assets/dist/js/admin-script.js delete mode 100644 trunk/assets/dist/js/frontend-script.asset.php delete mode 100644 trunk/assets/dist/js/frontend-script.js delete mode 100644 trunk/assets/images/add-generator.png delete mode 100644 trunk/assets/images/csv-export.png delete mode 100644 trunk/assets/images/csv-import.png delete mode 100644 trunk/assets/images/txt-import.png delete mode 100644 trunk/examples/api-test.txt delete mode 100644 trunk/languages/wc-serial-numbers.pot delete mode 100644 trunk/readme.txt delete mode 100644 trunk/src/API.php delete mode 100644 trunk/src/Actions.php delete mode 100644 trunk/src/Admin/Actions.php delete mode 100644 trunk/src/Admin/Admin.php delete mode 100644 trunk/src/Admin/ListTables/ActivationsTable.php delete mode 100644 trunk/src/Admin/ListTables/KeysTable.php delete mode 100644 trunk/src/Admin/ListTables/ListTable.php delete mode 100644 trunk/src/Admin/ListTables/StockTable.php delete mode 100644 trunk/src/Admin/Menus.php delete mode 100644 trunk/src/Admin/Metaboxes.php delete mode 100644 trunk/src/Admin/Notices.php delete mode 100644 trunk/src/Admin/Orders.php delete mode 100644 trunk/src/Admin/Products.php delete mode 100644 trunk/src/Admin/Settings.php delete mode 100644 trunk/src/Admin/views/html-add-key.php delete mode 100644 trunk/src/Admin/views/html-api-actions.php delete mode 100644 trunk/src/Admin/views/html-api-validation.php delete mode 100644 trunk/src/Admin/views/html-edit-key.php delete mode 100644 trunk/src/Admin/views/html-list-activations.php delete mode 100644 trunk/src/Admin/views/html-list-keys.php delete mode 100644 trunk/src/Admin/views/html-list-stock.php delete mode 100644 trunk/src/Admin/views/html-reports.php delete mode 100644 trunk/src/Admin/views/html-tools.php delete mode 100644 trunk/src/Ajax.php delete mode 100644 trunk/src/Cache.php delete mode 100644 trunk/src/Compat.php delete mode 100644 trunk/src/Cron.php delete mode 100644 trunk/src/Deprecated/Functions.php delete mode 100644 trunk/src/Encryption.php delete mode 100644 trunk/src/Frontend/Frontend.php delete mode 100644 trunk/src/Frontend/Shortcodes.php delete mode 100644 trunk/src/Functions/Template.php delete mode 100644 trunk/src/Installer.php delete mode 100644 trunk/src/Models/Activation.php delete mode 100644 trunk/src/Models/Key.php delete mode 100644 trunk/src/Models/Model.php delete mode 100644 trunk/src/Orders.php delete mode 100644 trunk/src/Plugin.php delete mode 100644 trunk/src/RestAPI.php delete mode 100644 trunk/src/Stocks.php delete mode 100644 trunk/src/Utilities/Utilities.php delete mode 100644 trunk/src/functions.php delete mode 100644 trunk/templates/email-stock-notification.php delete mode 100644 trunk/uninstall.php delete mode 100644 trunk/vendor/autoload.php delete mode 100755 trunk/vendor/bin/mozart delete mode 100755 trunk/vendor/bin/phpcbf delete mode 100755 trunk/vendor/bin/phpcs delete mode 100644 trunk/vendor/byteever/byteever-sniffs/renovate.json delete mode 100644 trunk/vendor/byteever/byteever-sniffs/src/ByteEver-Default/ruleset.xml delete mode 100644 trunk/vendor/coenjacobs/mozart/Dockerfile delete mode 100644 trunk/vendor/coenjacobs/mozart/LICENSE delete mode 100755 trunk/vendor/coenjacobs/mozart/bin/mozart delete mode 100644 trunk/vendor/coenjacobs/mozart/psalm.xml delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Classmap.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr4.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Composer/Package.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Console/Application.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Mover.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Replace/Replacer.php delete mode 100644 trunk/vendor/coenjacobs/mozart/src/Replacer.php delete mode 100644 trunk/vendor/composer/ClassLoader.php delete mode 100644 trunk/vendor/composer/InstalledVersions.php delete mode 100644 trunk/vendor/composer/LICENSE delete mode 100644 trunk/vendor/composer/autoload_classmap.php delete mode 100644 trunk/vendor/composer/autoload_files.php delete mode 100644 trunk/vendor/composer/autoload_namespaces.php delete mode 100644 trunk/vendor/composer/autoload_psr4.php delete mode 100644 trunk/vendor/composer/autoload_real.php delete mode 100644 trunk/vendor/composer/autoload_static.php delete mode 100644 trunk/vendor/composer/installed.json delete mode 100644 trunk/vendor/composer/installed.php delete mode 100644 trunk/vendor/composer/platform_check.php delete mode 100644 trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/CODE_OF_CONDUCT.md delete mode 100644 trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md delete mode 100644 trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php delete mode 100644 trunk/vendor/league/flysystem/CODE_OF_CONDUCT.md delete mode 100644 trunk/vendor/league/flysystem/LICENSE delete mode 100644 trunk/vendor/league/flysystem/SECURITY.md delete mode 100644 trunk/vendor/league/flysystem/deprecations.md delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/AbstractAdapter.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/Ftp.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/Ftpd.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/Local.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/NullAdapter.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedCopyTrait.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedWritingTrait.php delete mode 100644 trunk/vendor/league/flysystem/src/Adapter/SynologyFtp.php delete mode 100644 trunk/vendor/league/flysystem/src/AdapterInterface.php delete mode 100644 trunk/vendor/league/flysystem/src/Config.php delete mode 100644 trunk/vendor/league/flysystem/src/ConfigAwareTrait.php delete mode 100644 trunk/vendor/league/flysystem/src/ConnectionErrorException.php delete mode 100644 trunk/vendor/league/flysystem/src/ConnectionRuntimeException.php delete mode 100644 trunk/vendor/league/flysystem/src/CorruptedPathDetected.php delete mode 100644 trunk/vendor/league/flysystem/src/Directory.php delete mode 100644 trunk/vendor/league/flysystem/src/Exception.php delete mode 100644 trunk/vendor/league/flysystem/src/File.php delete mode 100644 trunk/vendor/league/flysystem/src/FileExistsException.php delete mode 100644 trunk/vendor/league/flysystem/src/FileNotFoundException.php delete mode 100644 trunk/vendor/league/flysystem/src/Filesystem.php delete mode 100644 trunk/vendor/league/flysystem/src/FilesystemException.php delete mode 100644 trunk/vendor/league/flysystem/src/FilesystemInterface.php delete mode 100644 trunk/vendor/league/flysystem/src/FilesystemNotFoundException.php delete mode 100644 trunk/vendor/league/flysystem/src/Handler.php delete mode 100644 trunk/vendor/league/flysystem/src/InvalidRootException.php delete mode 100644 trunk/vendor/league/flysystem/src/MountManager.php delete mode 100644 trunk/vendor/league/flysystem/src/NotSupportedException.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/AbstractPlugin.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/EmptyDir.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/ForcedCopy.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/ForcedRename.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/GetWithMetadata.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/ListFiles.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/ListPaths.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/ListWith.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/PluggableTrait.php delete mode 100644 trunk/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php delete mode 100644 trunk/vendor/league/flysystem/src/PluginInterface.php delete mode 100644 trunk/vendor/league/flysystem/src/ReadInterface.php delete mode 100644 trunk/vendor/league/flysystem/src/RootViolationException.php delete mode 100644 trunk/vendor/league/flysystem/src/SafeStorage.php delete mode 100644 trunk/vendor/league/flysystem/src/UnreadableFileException.php delete mode 100644 trunk/vendor/league/flysystem/src/Util.php delete mode 100644 trunk/vendor/league/flysystem/src/Util/ContentListingFormatter.php delete mode 100644 trunk/vendor/league/flysystem/src/Util/MimeType.php delete mode 100644 trunk/vendor/league/flysystem/src/Util/StreamHasher.php delete mode 100644 trunk/vendor/league/mime-type-detection/CHANGELOG.md delete mode 100644 trunk/vendor/league/mime-type-detection/LICENSE delete mode 100644 trunk/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php delete mode 100644 trunk/vendor/league/mime-type-detection/src/ExtensionLookup.php delete mode 100644 trunk/vendor/league/mime-type-detection/src/ExtensionMimeTypeDetector.php delete mode 100644 trunk/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php delete mode 100644 trunk/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php delete mode 100644 trunk/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php delete mode 100644 trunk/vendor/league/mime-type-detection/src/MimeTypeDetector.php delete mode 100644 trunk/vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/CHANGELOG.md delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/LICENSE delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractComplexVersionSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractNewFeatureSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractRemovedFeatureSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ComplexVersionInterface.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/PHPCSHelper.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenAbstractPrivateMethodsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsInvokedFunctionsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/ValidIntegersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml delete mode 100644 trunk/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php delete mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-paragonie/LICENSE delete mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat/ruleset.xml delete mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieSodiumCompat/ruleset.xml delete mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-wp/LICENSE delete mode 100644 trunk/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/CHANGELOG.md delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/LICENSE delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/CHANGELOG.md delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/LICENSE delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml delete mode 100644 trunk/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php delete mode 100644 trunk/vendor/psr/container/LICENSE delete mode 100644 trunk/vendor/psr/container/src/ContainerExceptionInterface.php delete mode 100644 trunk/vendor/psr/container/src/ContainerInterface.php delete mode 100644 trunk/vendor/psr/container/src/NotFoundExceptionInterface.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/CHANGELOG.md delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/CodeSniffer.conf delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/CodeSniffer.conf.dist delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/autoload.php delete mode 100755 trunk/vendor/squizlabs/php_codesniffer/bin/phpcbf delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat delete mode 100755 trunk/vendor/squizlabs/php_codesniffer/bin/phpcs delete mode 100755 trunk/vendor/squizlabs/php_codesniffer/bin/phpcs.bat delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/licence.txt delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/phpcs.xsd delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Config.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Exceptions/DeepExitException.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Exceptions/RuntimeException.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Exceptions/TokenizerException.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Files/DummyFile.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Files/File.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Files/FileList.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Filters/ExactMatch.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Filters/Filter.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Filters/GitModified.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Filters/GitStaged.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Fixer.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Generators/Generator.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Generators/HTML.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Generators/Markdown.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Generators/Text.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reporter.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Checkstyle.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Code.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Csv.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Diff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Emacs.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Full.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Gitblame.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Hgblame.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Info.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Json.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Junit.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Performance.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Report.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Source.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Summary.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Svnblame.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Reports/Xml.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Ruleset.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Runner.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractArraySniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractScopeSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractVariableSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/DeprecatedSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Sniffs/Sniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowLongArraySyntaxStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/DisallowShortArraySyntaxStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/DuplicateClassNameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Classes/OpeningBraceSameLineStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/AssignmentInConditionStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/EmptyPHPStatementStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/EmptyStatementStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopShouldBeWhileLoopStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopWithTestFunctionCallStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/JumbledIncrementerStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnconditionalIfStatementStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnnecessaryFinalModifierStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UnusedFunctionParameterStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/UselessOverridingMethodStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/DocCommentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/FixmeStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Commenting/TodoStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/DisallowYodaConditionsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/InlineControlStructureStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/CSSLintStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/ClosureLinterStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Debug/JSHintStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ByteOrderMarkStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNewlineStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/EndFileNoNewlineStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/ExecutableFileStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/InlineHTMLStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineEndingsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LineLengthStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/LowercasedFilenameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneClassPerFileStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneInterfacePerFileStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneObjectStructurePerFileStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Files/OneTraitPerFileStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/DisallowMultipleStatementsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/MultipleStatementAlignmentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/NoSpaceAfterCastStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterCastStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceAfterNotStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Formatting/SpaceBeforeCastStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/CallTimePassByReferenceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/FunctionCallArgumentSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceBsdAllmanStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Functions/OpeningFunctionBraceKernighanRitchieStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/CyclomaticComplexityStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Metrics/NestingLevelStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/AbstractClassNamePrefixStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/CamelCapsFunctionNameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/ConstructorNameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/InterfaceNameSuffixStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/TraitNameSuffixStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/NamingConventions/UpperCaseConstantNameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/BacktickOperatorStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/CharacterBeforePHPOpeningTagStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ClosingPHPTagStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DeprecatedFunctionsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowAlternativePHPTagsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/RequireStrictTypesStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SyntaxStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/IncrementDecrementSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowRequestSuperglobalSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DiscourageGotoSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/NoSilencedErrorsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/RequireStrictTypesSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SAPIUsageSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowShortArraySyntaxUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/OpeningBraceSameLineUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyStatementUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnnecessaryFinalModifierUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UselessOverridingMethodUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.1.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.1.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.2.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/DisallowYodaConditionsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ClosureLinterUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/ESLintUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Debug/JSHintUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.1.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.1.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.2.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.2.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.3.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.4.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.6.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.7.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.8.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.10.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.3.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.3.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.6.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.8.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.8.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.9.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.9.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.1.inc delete mode 100755 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.3.inc delete mode 100755 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/ExecutableFileUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/LowercasedFilenameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneClassPerFileUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneClassPerFileUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneInterfacePerFileUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneInterfacePerFileUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneObjectStructurePerFileUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneObjectStructurePerFileUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/OneTraitPerFileUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/DisallowMultipleStatementsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceAfterNotUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/FunctionCallArgumentSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceBsdAllmanUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/ConstructorNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DeprecatedFunctionsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.10.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.11.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.11.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.12.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.12.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.13.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.14.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.14.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.15.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.15.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.8.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.9.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.11.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.12.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.13.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.8.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.9.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClosingBraceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/OpeningBraceSpaceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/BooleanOperatorPlacementStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/ControlStructureSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/ImportStatementStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/OpenTagStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/ReturnTypeDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.10.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.10.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.11.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.11.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.12.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.12.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.13.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.14.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.17.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.18.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.4.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.7.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.8.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.9.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.10.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.10.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.11.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.11.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.14.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.6.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.7.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.8.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.9.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.9.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.10.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.10.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.11.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.11.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.12.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.12.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.13.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.13.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.14.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.14.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.15.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.16.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.16.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.17.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.18.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.8.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.9.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionClosingBraceSpaceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/MemberVarSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SuperfluousWhitespaceStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.4.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.5.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.9.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.10.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.11.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.12.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.12.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.13.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.13.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.14.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.15.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.16.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.17.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.23.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.8.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.9.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.5.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.6.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.2.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Cache.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Common.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Help.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Standards.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Timing.php delete mode 100644 trunk/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php delete mode 100644 trunk/vendor/symfony/console/Application.php delete mode 100644 trunk/vendor/symfony/console/Attribute/AsCommand.php delete mode 100644 trunk/vendor/symfony/console/CHANGELOG.md delete mode 100644 trunk/vendor/symfony/console/CI/GithubActionReporter.php delete mode 100644 trunk/vendor/symfony/console/Color.php delete mode 100644 trunk/vendor/symfony/console/Command/Command.php delete mode 100644 trunk/vendor/symfony/console/Command/CompleteCommand.php delete mode 100644 trunk/vendor/symfony/console/Command/DumpCompletionCommand.php delete mode 100644 trunk/vendor/symfony/console/Command/HelpCommand.php delete mode 100644 trunk/vendor/symfony/console/Command/LazyCommand.php delete mode 100644 trunk/vendor/symfony/console/Command/ListCommand.php delete mode 100644 trunk/vendor/symfony/console/Command/LockableTrait.php delete mode 100644 trunk/vendor/symfony/console/Command/SignalableCommandInterface.php delete mode 100644 trunk/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php delete mode 100644 trunk/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php delete mode 100644 trunk/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php delete mode 100644 trunk/vendor/symfony/console/Completion/CompletionInput.php delete mode 100644 trunk/vendor/symfony/console/Completion/CompletionSuggestions.php delete mode 100644 trunk/vendor/symfony/console/Completion/Output/BashCompletionOutput.php delete mode 100644 trunk/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php delete mode 100644 trunk/vendor/symfony/console/Completion/Suggestion.php delete mode 100644 trunk/vendor/symfony/console/ConsoleEvents.php delete mode 100644 trunk/vendor/symfony/console/Cursor.php delete mode 100644 trunk/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php delete mode 100644 trunk/vendor/symfony/console/Descriptor/ApplicationDescription.php delete mode 100644 trunk/vendor/symfony/console/Descriptor/Descriptor.php delete mode 100644 trunk/vendor/symfony/console/Descriptor/DescriptorInterface.php delete mode 100644 trunk/vendor/symfony/console/Descriptor/JsonDescriptor.php delete mode 100644 trunk/vendor/symfony/console/Descriptor/MarkdownDescriptor.php delete mode 100644 trunk/vendor/symfony/console/Descriptor/TextDescriptor.php delete mode 100644 trunk/vendor/symfony/console/Descriptor/XmlDescriptor.php delete mode 100644 trunk/vendor/symfony/console/Event/ConsoleCommandEvent.php delete mode 100644 trunk/vendor/symfony/console/Event/ConsoleErrorEvent.php delete mode 100644 trunk/vendor/symfony/console/Event/ConsoleEvent.php delete mode 100644 trunk/vendor/symfony/console/Event/ConsoleSignalEvent.php delete mode 100644 trunk/vendor/symfony/console/Event/ConsoleTerminateEvent.php delete mode 100644 trunk/vendor/symfony/console/EventListener/ErrorListener.php delete mode 100644 trunk/vendor/symfony/console/Exception/CommandNotFoundException.php delete mode 100644 trunk/vendor/symfony/console/Exception/ExceptionInterface.php delete mode 100644 trunk/vendor/symfony/console/Exception/InvalidArgumentException.php delete mode 100644 trunk/vendor/symfony/console/Exception/InvalidOptionException.php delete mode 100644 trunk/vendor/symfony/console/Exception/LogicException.php delete mode 100644 trunk/vendor/symfony/console/Exception/MissingInputException.php delete mode 100644 trunk/vendor/symfony/console/Exception/NamespaceNotFoundException.php delete mode 100644 trunk/vendor/symfony/console/Exception/RuntimeException.php delete mode 100644 trunk/vendor/symfony/console/Formatter/NullOutputFormatter.php delete mode 100644 trunk/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php delete mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatter.php delete mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatterInterface.php delete mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatterStyle.php delete mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php delete mode 100644 trunk/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php delete mode 100644 trunk/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php delete mode 100644 trunk/vendor/symfony/console/Helper/DebugFormatterHelper.php delete mode 100644 trunk/vendor/symfony/console/Helper/DescriptorHelper.php delete mode 100644 trunk/vendor/symfony/console/Helper/Dumper.php delete mode 100644 trunk/vendor/symfony/console/Helper/FormatterHelper.php delete mode 100644 trunk/vendor/symfony/console/Helper/Helper.php delete mode 100644 trunk/vendor/symfony/console/Helper/HelperInterface.php delete mode 100644 trunk/vendor/symfony/console/Helper/HelperSet.php delete mode 100644 trunk/vendor/symfony/console/Helper/InputAwareHelper.php delete mode 100644 trunk/vendor/symfony/console/Helper/ProcessHelper.php delete mode 100644 trunk/vendor/symfony/console/Helper/ProgressBar.php delete mode 100644 trunk/vendor/symfony/console/Helper/ProgressIndicator.php delete mode 100644 trunk/vendor/symfony/console/Helper/QuestionHelper.php delete mode 100644 trunk/vendor/symfony/console/Helper/SymfonyQuestionHelper.php delete mode 100644 trunk/vendor/symfony/console/Helper/Table.php delete mode 100644 trunk/vendor/symfony/console/Helper/TableCell.php delete mode 100644 trunk/vendor/symfony/console/Helper/TableCellStyle.php delete mode 100644 trunk/vendor/symfony/console/Helper/TableRows.php delete mode 100644 trunk/vendor/symfony/console/Helper/TableSeparator.php delete mode 100644 trunk/vendor/symfony/console/Helper/TableStyle.php delete mode 100644 trunk/vendor/symfony/console/Input/ArgvInput.php delete mode 100644 trunk/vendor/symfony/console/Input/ArrayInput.php delete mode 100644 trunk/vendor/symfony/console/Input/Input.php delete mode 100644 trunk/vendor/symfony/console/Input/InputArgument.php delete mode 100644 trunk/vendor/symfony/console/Input/InputAwareInterface.php delete mode 100644 trunk/vendor/symfony/console/Input/InputDefinition.php delete mode 100644 trunk/vendor/symfony/console/Input/InputInterface.php delete mode 100644 trunk/vendor/symfony/console/Input/InputOption.php delete mode 100644 trunk/vendor/symfony/console/Input/StreamableInputInterface.php delete mode 100644 trunk/vendor/symfony/console/Input/StringInput.php delete mode 100644 trunk/vendor/symfony/console/LICENSE delete mode 100644 trunk/vendor/symfony/console/Logger/ConsoleLogger.php delete mode 100644 trunk/vendor/symfony/console/Output/BufferedOutput.php delete mode 100644 trunk/vendor/symfony/console/Output/ConsoleOutput.php delete mode 100644 trunk/vendor/symfony/console/Output/ConsoleOutputInterface.php delete mode 100644 trunk/vendor/symfony/console/Output/ConsoleSectionOutput.php delete mode 100644 trunk/vendor/symfony/console/Output/NullOutput.php delete mode 100644 trunk/vendor/symfony/console/Output/Output.php delete mode 100644 trunk/vendor/symfony/console/Output/OutputInterface.php delete mode 100644 trunk/vendor/symfony/console/Output/StreamOutput.php delete mode 100644 trunk/vendor/symfony/console/Output/TrimmedBufferOutput.php delete mode 100644 trunk/vendor/symfony/console/Question/ChoiceQuestion.php delete mode 100644 trunk/vendor/symfony/console/Question/ConfirmationQuestion.php delete mode 100644 trunk/vendor/symfony/console/Question/Question.php delete mode 100644 trunk/vendor/symfony/console/Resources/bin/hiddeninput.exe delete mode 100644 trunk/vendor/symfony/console/Resources/completion.bash delete mode 100644 trunk/vendor/symfony/console/SignalRegistry/SignalRegistry.php delete mode 100644 trunk/vendor/symfony/console/SingleCommandApplication.php delete mode 100644 trunk/vendor/symfony/console/Style/OutputStyle.php delete mode 100644 trunk/vendor/symfony/console/Style/StyleInterface.php delete mode 100644 trunk/vendor/symfony/console/Style/SymfonyStyle.php delete mode 100644 trunk/vendor/symfony/console/Terminal.php delete mode 100644 trunk/vendor/symfony/console/Tester/ApplicationTester.php delete mode 100644 trunk/vendor/symfony/console/Tester/CommandCompletionTester.php delete mode 100644 trunk/vendor/symfony/console/Tester/CommandTester.php delete mode 100644 trunk/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php delete mode 100644 trunk/vendor/symfony/console/Tester/TesterTrait.php delete mode 100644 trunk/vendor/symfony/deprecation-contracts/CHANGELOG.md delete mode 100644 trunk/vendor/symfony/deprecation-contracts/LICENSE delete mode 100644 trunk/vendor/symfony/deprecation-contracts/function.php delete mode 100644 trunk/vendor/symfony/finder/CHANGELOG.md delete mode 100644 trunk/vendor/symfony/finder/Comparator/Comparator.php delete mode 100644 trunk/vendor/symfony/finder/Comparator/DateComparator.php delete mode 100644 trunk/vendor/symfony/finder/Comparator/NumberComparator.php delete mode 100644 trunk/vendor/symfony/finder/Exception/AccessDeniedException.php delete mode 100644 trunk/vendor/symfony/finder/Exception/DirectoryNotFoundException.php delete mode 100644 trunk/vendor/symfony/finder/Finder.php delete mode 100644 trunk/vendor/symfony/finder/Gitignore.php delete mode 100644 trunk/vendor/symfony/finder/Glob.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/CustomFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/FilenameFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/LazyIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/SortableIterator.php delete mode 100644 trunk/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php delete mode 100644 trunk/vendor/symfony/finder/LICENSE delete mode 100644 trunk/vendor/symfony/finder/SplFileInfo.php delete mode 100644 trunk/vendor/symfony/polyfill-ctype/Ctype.php delete mode 100644 trunk/vendor/symfony/polyfill-ctype/LICENSE delete mode 100644 trunk/vendor/symfony/polyfill-ctype/bootstrap.php delete mode 100644 trunk/vendor/symfony/polyfill-ctype/bootstrap80.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-grapheme/Grapheme.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-grapheme/LICENSE delete mode 100644 trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/LICENSE delete mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Normalizer.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap.php delete mode 100644 trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php delete mode 100644 trunk/vendor/symfony/polyfill-mbstring/LICENSE delete mode 100644 trunk/vendor/symfony/polyfill-mbstring/Mbstring.php delete mode 100644 trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php delete mode 100644 trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php delete mode 100644 trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php delete mode 100644 trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php delete mode 100644 trunk/vendor/symfony/polyfill-mbstring/bootstrap.php delete mode 100644 trunk/vendor/symfony/polyfill-mbstring/bootstrap80.php delete mode 100644 trunk/vendor/symfony/polyfill-php73/LICENSE delete mode 100644 trunk/vendor/symfony/polyfill-php73/Php73.php delete mode 100644 trunk/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php delete mode 100644 trunk/vendor/symfony/polyfill-php73/bootstrap.php delete mode 100644 trunk/vendor/symfony/polyfill-php80/LICENSE delete mode 100644 trunk/vendor/symfony/polyfill-php80/Php80.php delete mode 100644 trunk/vendor/symfony/polyfill-php80/PhpToken.php delete mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php delete mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php delete mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php delete mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php delete mode 100644 trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php delete mode 100644 trunk/vendor/symfony/polyfill-php80/bootstrap.php delete mode 100644 trunk/vendor/symfony/service-contracts/Attribute/Required.php delete mode 100644 trunk/vendor/symfony/service-contracts/Attribute/SubscribedService.php delete mode 100644 trunk/vendor/symfony/service-contracts/CHANGELOG.md delete mode 100644 trunk/vendor/symfony/service-contracts/LICENSE delete mode 100644 trunk/vendor/symfony/service-contracts/ResetInterface.php delete mode 100644 trunk/vendor/symfony/service-contracts/ServiceLocatorTrait.php delete mode 100644 trunk/vendor/symfony/service-contracts/ServiceProviderInterface.php delete mode 100644 trunk/vendor/symfony/service-contracts/ServiceSubscriberInterface.php delete mode 100644 trunk/vendor/symfony/service-contracts/ServiceSubscriberTrait.php delete mode 100644 trunk/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php delete mode 100644 trunk/vendor/symfony/string/AbstractString.php delete mode 100644 trunk/vendor/symfony/string/AbstractUnicodeString.php delete mode 100644 trunk/vendor/symfony/string/ByteString.php delete mode 100644 trunk/vendor/symfony/string/CHANGELOG.md delete mode 100644 trunk/vendor/symfony/string/CodePointString.php delete mode 100644 trunk/vendor/symfony/string/Exception/ExceptionInterface.php delete mode 100644 trunk/vendor/symfony/string/Exception/InvalidArgumentException.php delete mode 100644 trunk/vendor/symfony/string/Exception/RuntimeException.php delete mode 100644 trunk/vendor/symfony/string/Inflector/EnglishInflector.php delete mode 100644 trunk/vendor/symfony/string/Inflector/FrenchInflector.php delete mode 100644 trunk/vendor/symfony/string/Inflector/InflectorInterface.php delete mode 100644 trunk/vendor/symfony/string/LICENSE delete mode 100644 trunk/vendor/symfony/string/LazyString.php delete mode 100644 trunk/vendor/symfony/string/Resources/data/wcswidth_table_wide.php delete mode 100644 trunk/vendor/symfony/string/Resources/data/wcswidth_table_zero.php delete mode 100644 trunk/vendor/symfony/string/Resources/functions.php delete mode 100644 trunk/vendor/symfony/string/Slugger/AsciiSlugger.php delete mode 100644 trunk/vendor/symfony/string/Slugger/SluggerInterface.php delete mode 100644 trunk/vendor/symfony/string/UnicodeString.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/CHANGELOG.md delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/LICENSE delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/UnslashingFunctionsHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php delete mode 100755 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/WordPress/ruleset.xml delete mode 100644 trunk/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample delete mode 100644 trunk/wc-serial-numbers.php diff --git a/trunk/assets/blocks/index.js b/trunk/assets/blocks/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/trunk/assets/dist/blocks/blocks.asset.php b/trunk/assets/dist/blocks/blocks.asset.php deleted file mode 100644 index f5345333..00000000 --- a/trunk/assets/dist/blocks/blocks.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => '31d6cfe0d16ae931b73c'); diff --git a/trunk/assets/dist/blocks/blocks.js b/trunk/assets/dist/blocks/blocks.js deleted file mode 100644 index e69de29b..00000000 diff --git a/trunk/assets/dist/css/admin-style.asset.php b/trunk/assets/dist/css/admin-style.asset.php deleted file mode 100644 index 39a03212..00000000 --- a/trunk/assets/dist/css/admin-style.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => '857b6146e419226c7061'); diff --git a/trunk/assets/dist/css/admin-style.css b/trunk/assets/dist/css/admin-style.css deleted file mode 100644 index c949891a..00000000 --- a/trunk/assets/dist/css/admin-style.css +++ /dev/null @@ -1 +0,0 @@ -.pev-wrap{margin-left:auto;margin-right:auto;max-width:1400px;padding-right:20px}.pev-navbar{margin:0 0 1em}.pev-navbar+.subsubsub{margin:-8px 0 0}.pev-poststuff{margin-right:340px;margin-top:10px}.pev-poststuff .column-1{float:left;min-width:463px;width:100%}.pev-poststuff .column-2{float:right;margin-right:-340px;width:320px}@media only screen and (max-width:850px){.pev-poststuff{margin-right:0}.pev-poststuff .column-1,.pev-poststuff .column-2{float:none;margin-right:0;min-width:0;width:100%}}.pev-card,.pev-panel{background:#fff;border:1px solid #e1e2e2;box-sizing:border-box;display:block;font-size:13px;line-height:1.5;margin:0 auto 1.5em;max-width:none;min-height:1px;min-width:auto;position:relative;width:100%}.pev-card [class*=pev],.pev-panel [class*=pev]{box-sizing:inherit}.pev-card:after,.pev-card:before,.pev-panel:after,.pev-panel:before{box-sizing:inherit;content:"";display:table}.pev-card h2,.pev-card h3,.pev-card h4,.pev-card h5,.pev-card h6,.pev-panel h2,.pev-panel h3,.pev-panel h4,.pev-panel h5,.pev-panel h6{margin-top:0;padding-top:0}.pev-card ol li,.pev-card ul li,.pev-panel ol li,.pev-panel ul li{line-height:1.7;margin-bottom:.5em}.pev-card>.pev-card__body,.pev-panel{color:#555;position:relative}.pev-card>.pev-card__body h2,.pev-card>.pev-card__body h3,.pev-card>.pev-card__body h4,.pev-panel h2,.pev-panel h3,.pev-panel h4{color:inherit}.pev-card>.pev-card__body>:first-child,.pev-panel>:first-child{margin-top:0}.pev-card>.pev-card__body table:not(.widefat),.pev-panel table:not(.widefat){width:100%}.pev-card>.pev-card__body table:not(.widefat) td,.pev-card>.pev-card__body table:not(.widefat) th,.pev-panel table:not(.widefat) td,.pev-panel table:not(.widefat) th{text-align:left;vertical-align:top}.pev-card>.pev-card__body table:not(.widefat) th,.pev-panel table:not(.widefat) th{padding:0 6px 6px 0}.pev-card>.pev-card__body table:not(.widefat) td,.pev-panel table:not(.widefat) td{padding:0 0 6px}.pev-card>.pev-card__body a:active,.pev-card>.pev-card__body a:focus,.pev-panel a:active,.pev-panel a:focus{box-shadow:none;outline:none}.pev-card__group,.pev-panel__group{align-items:center;box-sizing:border-box;display:flex;flex-wrap:nowrap;gap:10px;justify-content:space-between;margin-bottom:1em;min-height:25px}.pev-card__group>.icon,.pev-card__group>img,.pev-panel__group>.icon,.pev-panel__group>img{border-radius:6px;height:54px;-o-object-fit:cover;object-fit:cover;width:54px}.pev-card__group>.icon,.pev-panel__group>.icon{align-items:center;background-color:#f5f5f5;color:#777;display:flex;font-size:50px;justify-content:center;line-height:54px}.pev-card__group>div,.pev-panel__group>div{align-items:center;display:flex;gap:10px}.pev-card h2,.pev-card h3,.pev-card__title{color:inherit;font-size:14px;font-weight:600;margin:0;padding:0}.pev-card__subtitle{color:#777;font-size:13px;font-weight:400}.pev-card>.pev-card__footer,.pev-card>.pev-card__header{align-items:center;display:flex;flex-direction:row;justify-content:space-between}.pev-card>.pev-card__footer h2,.pev-card>.pev-card__footer h3,.pev-card>.pev-card__footer p,.pev-card>.pev-card__header h2,.pev-card>.pev-card__header h3,.pev-card>.pev-card__header p{margin:0;padding:0}.pev-card>.pev-card__footer .select2,.pev-card>.pev-card__footer button,.pev-card>.pev-card__footer input,.pev-card>.pev-card__footer select,.pev-card>.pev-card__header .select2,.pev-card>.pev-card__header button,.pev-card>.pev-card__header input,.pev-card>.pev-card__header select{margin-right:5px}.pev-card>.pev-card__footer .select2:last-child,.pev-card>.pev-card__footer button:last-child,.pev-card>.pev-card__footer input:last-child,.pev-card>.pev-card__footer select:last-child,.pev-card>.pev-card__header .select2:last-child,.pev-card>.pev-card__header button:last-child,.pev-card>.pev-card__header input:last-child,.pev-card>.pev-card__header select:last-child{margin-right:0}.pev-card>[class*=pev-card]:not([class*=wide]){padding:8px 10px}.pev-card>[class*=pev-card__]:not(:last-child){border-bottom:1px solid #e1e2e2}.pev-panel{padding:8px 10px}.pev-panel__title{font-size:18px;line-height:1.2;padding:0}.pev-panel__subtitle,.pev-panel__title{font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,sans-serif;font-weight:400;margin:0}.pev-panel__subtitle{color:#777;font-size:13px;line-height:1.6em}.pev-panel__legend{background-color:rgba(0,0,0,0);border-bottom-left-radius:8px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #e5e5e5 #e5e5e5;border-style:solid;border-width:1px;color:#aaa;font-size:11px;line-height:1em;padding:3px 2px 4px 7px;position:absolute;right:-1px;top:-1px;z-index:11}.promo-panel .pev-panel__legend{border-color:rgba(0,0,0,0) rgba(0,0,0,0) currentColor currentColor;color:#fff}.pev-panel:has(.pev-panel__legend){padding-top:20px}.pev-panel.promo-panel{background-color:#482ac9;border-color:#482ac9;color:#fff}.pev-panel.promo-panel a:not(.button){color:#fff}.pev-panel.promo-panel .button{color:#482ac9;display:block;font-weight:700;margin-top:20px;text-align:center;text-transform:uppercase}.pev-form-field{box-sizing:border-box;display:flex;flex-direction:column;margin:1em 0;min-height:32px;min-width:0;position:relative;vertical-align:top;width:100%}.pev-form-field label{-ms-grid-row-align:self-start;align-items:center;align-self:self-start;display:flex;gap:5px;justify-content:flex-start;margin:0 0 3px}.pev-form-field label abbr[title=required]{color:red;text-decoration:none}.pev-form-field label abbr[title=required]:after{content:"*"}.pev-form-field p{margin-bottom:0}.pev-form-field textarea{resize:none}.pev-form-field input:not([type=checkbox]):not([type=radio]):not(.addon),.pev-form-field select:not(.addon),.pev-form-field textarea:not(.addon){flex:1 1 auto;margin:0;max-width:unset;min-width:0;position:relative}.pev-form-field input:not([type=checkbox]):not([type=radio]):not(.addon):focus,.pev-form-field select:not(.addon):focus,.pev-form-field textarea:not(.addon):focus{z-index:3}.pev-form-field__group{-ms-grid-row-align:center;align-items:stretch;align-self:center;display:flex;flex-wrap:nowrap;position:relative;width:100%}.pev-form-field__group .button,.pev-form-field__group button{align-items:center;border-width:1px;display:flex;margin:0;position:relative;z-index:2}.pev-form-field__group .button:focus,.pev-form-field__group button:focus{z-index:3}.pev-form-field__group .addon{align-items:center;background-color:#eee;border:1px solid #8c8f94;border-radius:4px;display:flex;padding:0 8px;text-align:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.pev-form-field__group>:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.pev-form-field__group>:not(:last-child) .select2-selection{border-bottom-right-radius:0;border-top-right-radius:0}.pev-form-field__group>:nth-last-child(n+3){border-bottom-right-radius:0;border-top-right-radius:0}.pev-form-field__group>:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px!important}.pev-form-field__group>:not(:first-child) .select2-selection{border-bottom-left-radius:0;border-top-left-radius:0}.pev-form-field__group>:nth-child(2) .select2-selection{border-bottom-left-radius:4px;border-top-left-radius:4px}@media screen and (min-width:850px){.form-inline .pev-form-field{-ms-grid-rows:1fr;-ms-grid-columns:150px 1fr;display:-ms-grid;display:grid;grid-template-columns:150px 1fr;grid-template-rows:1fr}.form-inline .pev-form-field .label,.form-inline .pev-form-field>label:first-child{-ms-grid-column:1;grid-column:1;min-width:150px;padding-right:10px;width:150px}.form-inline .pev-form-field>:not(:first-child){-ms-grid-column:2;grid-column:2}}.wcsn-card{box-sizing:border-box;margin-top:20px}.wcsn-card__body,.wcsn-card__header{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;padding:1em 2em;position:relative;width:100%}.wcsn-card__header{align-items:center;border-bottom:0;display:flex;justify-content:space-between}.wcsn-card__header h2,.wcsn-card__header h3{margin:0}.wcsn-feature-promo-banner{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin-top:20px;max-width:800px;position:relative}.wcsn-feature-promo-banner>img{height:auto;width:100%}.wcsn-feature-promo-banner__content{align-items:center;background:hsla(0,0%,100%,.7);bottom:0;display:flex;flex-direction:column;justify-content:center;left:0;position:absolute;right:0;top:0;transition:opacity .3s ease-in-out}.wcsn-feature-promo-banner__content h3{color:red;font-size:1.5em;margin:0 0 1em;text-align:center}.wcsn-key{background:#f0f0f1;background:rgba(0,0,0,.07);border-radius:3px;color:rgba(0,0,0,.4);cursor:pointer;display:inline-block;font-family:Consolas,monospace;font-weight:400;line-height:20px;min-height:20px;padding:3px 10px 2px;position:relative;text-align:left;width:90%}.wcsn-key.copying{color:#155724}.wcsn-nav-tabs{margin-bottom:20px!important}.wp-list-table.keys .column-key{width:15%}.wp-list-table.keys .wcsn-key-status{background-color:silver;border:1px solid rgba(0,0,0,0);border-radius:3px;color:#fff;font-size:14px;line-height:1;padding:3px 10px;white-space:nowrap}.wp-list-table.keys .wcsn-key-status.available{background-color:#d4edda;border-color:#c3e6cb;color:#155724}.wp-list-table.keys .wcsn-key-status.pending{background-color:#fff3cd;border-color:#ffeeba;color:#856404}.wp-list-table.keys .wcsn-key-status.sold{background:#cce5ff;border-color:#b8daff;color:#004085}.wp-list-table.keys .wcsn-key-status.cancelled{background-color:#d6d8d9;border-color:#c6c8ca;color:#1b1e21}.wp-list-table.stocks .column-action,.wp-list-table.stocks .column-stock{width:10%}.wp-list-table.stocks .column-source{width:20%}.wp-list-table.stocks .column-sku{width:25%}.tablenav .wcsn_search_customer+.select2-container,.tablenav .wcsn_search_order+.select2-container,.tablenav .wcsn_search_product+.select2-container{font-size:14px;margin:1px 6px 4px 1px;min-width:200px!important;vertical-align:middle}._serial_key_source_field label{margin:0;width:100%}.wcsn-tools-tab-status table h2{font-size:14px;margin:0}.wcsn-tools-tab-status table tbody tr td:first-child{font-size:1.1em;font-weight:400;width:33%}.wcsn-tools-tab-status table tbody tr td:nth-child(2){width:1em} diff --git a/trunk/assets/dist/css/frontend-style.asset.php b/trunk/assets/dist/css/frontend-style.asset.php deleted file mode 100644 index 14341f63..00000000 --- a/trunk/assets/dist/css/frontend-style.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => '630a7ef02a321c38e3ae'); diff --git a/trunk/assets/dist/css/frontend-style.css b/trunk/assets/dist/css/frontend-style.css deleted file mode 100644 index 48a25ce8..00000000 --- a/trunk/assets/dist/css/frontend-style.css +++ /dev/null @@ -1 +0,0 @@ -.wcsn-api-form input[type=email],.wcsn-api-form input[type=text],.wcsn-api-form select{box-sizing:border-box;display:block;width:100%}.wcsn-api-form .required{border-bottom:0!important;color:#e2401c} diff --git a/trunk/assets/dist/images/add-generator.png b/trunk/assets/dist/images/add-generator.png deleted file mode 100644 index e0c4fcfafe182e3959d8d02606312efa2deb449a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 82665 zcmeFYc~nws_&L(gseN11l|k4?fYXLhUZzND;lPT8tO zbJd!^_Qn|P@lIH`t|IZpnP$hoPWU+3hq-?|({ZLupK~M5;_1E%Zv&sQHe{}lpY z3;!R5FruXh0>wx2DjAOqqo?DW;|&{5*3Y!-HM=#;r1qkDi(G;ZOTrSDupskIDw|DN z5n~+7d<76F#Ka3RsSn(Y-fk@_$caV?8xoakhVS(_G~=sTwWzfq(8$!5khP$`T;> z<@vGBOH<6JBa*Ce7I-j>83f!3iaRi}8T4W8GqZ_jw%YxuGZM{J0^qV=Y>YXmG3hK+ zq+BI{U6#C1uCX2Q$__7aRk57=`onnI;_o_sZ2$-qgZcIKGAKrCamo*3ZZZ97YmqA7 z4$UXBU3ED+QNNmcn_a)(ImTAo7ko|u^udV@AVb*b0y{@X8$DGTtHg9kc%Q5)0-kuJ zOF0~v=kcj<3r(b#(I1x1o}b<^BU;1<^&W_(m%Hr@^|N0BcgJ)p*C>LfPW?!N`rSlN zJZqTD&)APkRONPA%yu01+9W3)Cnr8FJ9=@lKldw432o6gmt@Z0Ik7mh7IHFbbZgGl z)jxBhX1-kE>;i^UwZVf5psFqRMFrWYJM^+=#uLjDfwx{ClzFGx+8aQW;t#yday-Jw~Nu8f1npak;r;&zFSiN2&bUfPL)JQ~X$^-M(h=|Ilp zD1c6GmlLY-(!5r>v@okt@a*=JwI%#x$!MkF8^fcRB<0UTfa2xmVP<|(O_&@t$8E2$ z$Wy*!C7CKOT1#=XtTEAc)-Z)kSQLkOmGWv7W^PmOgGDGd*@BBLe-kG5xW^OU!AITTbpIjJ^#>+`jZwQxjk z!GWX}KdagFUSbVp&V>{-{&VqAK^ja4R4CN`txgf<__HlaT4XK0{>jEw}pj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UQ2i z3}+ueo>5$VfALhr7Uv<{W|dU`2}z0g_7N|%;4Jhddc~DIcnN%UI!~g&M&?O+dzQpj_CqRn^T3~cEyf=*_bqmKlznU*n^jLFhzAVWj%wy?1 z^?B0cBjX&qH}0`+{#L}Rzb&w_4;KA8U%7Z{$=d(VKQ!wyJ@AG9mq?%E9_!w3qj%B1 I`Qgm}0x7}*DF6Tf diff --git a/trunk/assets/dist/images/csv-export.png b/trunk/assets/dist/images/csv-export.png deleted file mode 100644 index 7337d35a07c14e1510fbb2de7e59ad36def73765..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 70115 zcmeFZc~nws{5NVxQya{zPJ?6RDKn?EoJA`uD>F(<3#W|C6cLA<0L7+bqjt(PCumYL zMKc9Q)Y76fB_~i&&pp{B1v=UAnIdm>z#nh1h6g)WDK=gUVmlX`b z<>xm0U*8G|kALyZKO{2DWaR*1=e12fH@$0D2*2E{-)z2f$FbU%M`{oGb^jA>sc!sk z_)FNKlck$Bv5&g`Rln}9Z6$X?orw0>ZPm(8zdszY!$$6D;yH(41$mr{+yQA5m2SZi z{3Bc7lSD`scR(J~$Q@|n)M+{&07wLmkm!hiPdZNxuUkIbzrIFUanih2WqSFCeabf+ zmruSQ{69nf_mN9Ykdji$#+j)~$~r{TlIRy&)9H6}Bm-WZAF5}a?joB9bm~{H&~e^F zTV}#*6H^SIB<^egtRUsd6RZDJ4;oxCtSzAWBH+m10X3090z2da6)9jMx%gaME}}89 zW=X`bW!p~IjHU%?RJfFrM09Uyf^1RJA^V*CMF4NL`5CgV!iB^!PBTf1Sr^Yto*0-1QeI1Rc(ep zm<6<`jHtx1?2yeS?pkDhTb-Xq5$jr$JI}}6=@EW4Ob;*n*09*^$x~NSvNQW5Udhf< zYwfYSdWS}|cRqhOYj_s2vn^>(^jEs1X_0NA3A?AG+_m3D6orS(=@xBO+nzkz{TCP{ z>egD-gWYY@w1gmMXm~>{`$mMR~1`64!ZqM1&?fiL0er9bPNY~OA;3*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C1FiOk(ADHrZ zb#xVy^FF|t$+3;3e*;Cwb;k6FE>m>}dV^v%yXqr;v=YM?F|ON4SD}KV;-GL@sFm@V z?KYtbo>rNX$8btO359nh303Wq^iB9Xo&JKW2;cdmGe2ByLaN9ihO0H`dgeW8$~P&8 z?~FZF#Y)0TON?(#3Qw0jr6h68_J;M`=BD%o`~PKQMAm#GfoFdqMn6{%I}XFJCq*2P!&49q>Sy7YHrD)yb~ zHC}(Z-9qcZ;*avLb8`iJLdL+(xJl&?zM^84GSG)ED9aJ*(YayLC`0qDN)qSW9!AoC zDAIdsi{ycPq^W9h1m7sPR4K&XUel`}@GlcuQrH`9=X^kIY#v~1IIc!nJX)Vt>n;ul z1IwQ_7$bd`6{)fL35oWovH4S&O}hqBLG!c)gk4qCbn4B{r8RRZ#cJo9Ib-@=DR#4_ zQ;Hw#=1l9|_09NVS|F%(*5YXsflT}F`=+wIb`B^0A75w^QHyr?L9_Bn7nGm-`NzOr KRX?1#@IL?rTGg%q diff --git a/trunk/assets/dist/images/csv-import.png b/trunk/assets/dist/images/csv-import.png deleted file mode 100644 index eead52175b5a0e13dfee3dd50f3a56b7c98f0192..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57578 zcmeFZc~p|y`!`I(X*Q1yr@`rzm32xj%UQI+GIJ_DIiO-?=72cn1S*x4c}neMil#z? zL*_u1;D}h7l%!ZHC@7eQq==*lh=4pd_Wl0Wde?g2=f8J7|2%gq!Ta9#-q*f{&vjjU zU)%KaF7|5ccCG_~Kxz(W?c6}1--bY-6>e)*0e4XT8^plJ+Q_rsF(An&xY?fsRd;Jm0KcpZI^lc*1ggneFTea72sDCnusiX0!m=ra>*uSSBK>)tO-U8+ z{4S22n`H3}_XfU#w7&OPzwpY@^Jz%`^3rX3@BH@NCmb4(zTf!HP*ZUJ95FbYe>O45 z)WGlIG+fkLidd)bwT*uTKZjBD70(l7AEMi zsP^klw@Xnj?VH!Kh0P>xrcnwUpb)rRz5_E;U4?nA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6{#d(;w$PH+k?_OLAu2QdIfWtA%V-l&O3|%zOQnBmtYt^lCN>j55ceR zGD8+&;SCO!)KJ3oR@df>HWRj{95y8oT^phVL7&_$q>li5#K8R?)zJGw$)LbY&x3`D zI#A`7k4A0!%B+)tsc+fX-iOhP7DS+=J0KDFzd-QHWYzmWV+lYFR| zac+tcRZYu0yJUZq;L(|!d8&XgFhfdgyY_yTn*g3j6CA3v)4V+9Lq-gkaIr~3Jf?cd*>-PUY)zxkg1yvpd+x%~#`gulg6Of{&%Iywy@`&0R6Kv{`>gt<346<9LF*2aJ&AXN>p*?a28{(lxgSJz*AynnmDUEIHOCu(!7_nqI|d>*o= zpyBg_2gZ;UoDXaSpkl@f55O}-4CxLBK$E(_H9ZXt;8{+FIgE^uYdb8M!E@cf8CEtH ksD2*ki0T2!fi~!0ebvJi=5~S(;8XEDUHx3vIVCg!096k&CIA2c diff --git a/trunk/assets/dist/images/txt-import.png b/trunk/assets/dist/images/txt-import.png deleted file mode 100644 index d65f68d48dd019f968ec5fe692012215070ac0eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 79528 zcmeFZdsLEJ^fpR&_bxSSm!+n=+GS-%S!$_BcXyex(@OJ3<~CDQOv4MHbhn#QX;n--kUwphdkP(84`>i-9Nqp5{Y=m*1lPJ{to9EnTVmHxHDR zvj%uLFUG^=AgHX}Yy^0-Fyw&S0T8GHzjQWm5on$royK*h!kp=?> z)pZr7vnRqu16Af01Q+qhe&I2zn12-BMkhKUD?YtM?vDvNP=+4ZVDzq4e|@X|!B+k2 z=}R}dl8k!2cmKKR%;G;j-1*Z3IJ%+#?^YgbKg3*bm6$}0jPY@{J6QB?)m?JH~)v|=2{70(0dQEoK<5# zzq*3m+T-M7J%emtB;<=j*m$j|Y_QoBX$DL?Ga0amD|u6+C1e9IeOB@v8`7S$Z_*)* zpQI84c2HfvW$T<>fP9}NJA%xv{0KJ1ABt+yw_j%8ce&#xhu5p{MwZftWgK{awWXvp z_C=B89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!H$JU)MXFC2WB20bo(06)P z`$-$WT`;=dfhXVEZ}2wpQ{HUi(cnX$ow;>#6uvCkFr+8^aI8*8m3UIz>eo*fh@lwAQu62={i!z)tZ$k z(aV`x9V9vqg8g%Veuo3q>rRT;fPUCGGY&uPB5tn$fMK`_TV~z`%~MLJjbt`=lqEmq zbtG22weV$9!nZ*mMpQzrcvYTclosYjp_ zK3-pJj`HUO_tahOVPBO(!pnsh%(IcxAD}<=p_5(*)r~-o5^q!a6_2na z3K^N0ub;FhFs^YJGh4A}05GoKWA|cpo3Pc;)nl9Zwr7E|jkG-hpg;`ZjQ>3>i1!QQ z702>CZZb4>jwS%T?g!HrKbeoudK-^kg!(GNz!z9<7`W?RF6hdHYYHAA>W4lh~S&@ zL;Vy0N=1DcsldL%_u2T=FtjU}UqC(bQG5 z6(~*RD`1>Ny=0uqEHJ-;?!TS*+E}Qt^1evo3B{fFs5s54_rxGrMgc@#>FtSf{YXDfQV z6%@H--5Hiq!YbFa4j<>+5;Z>$47w)#S;hfR@llSLE)WTrXg!^C$7_vt|KXZQUR_Nk z78!hGhu^Dw2}AymaX6TirY??+_ADXgvxS|T>=paa8si;!@d#rO7iYT_Vchwr(mW#i zGj}P7E_3&e8;adu)zIxBAa7Ac-~G|z26kvI$y@9oJUaXAVcfOR#gxV84$9BYr}s0y z^ls895VSqqkphktuQX~w=Ho9rK@2W%Vf$U`9$3NvTZhs*rx<5)fg^8 array(), 'version' => '8220dccf5702b2fb7fb8'); diff --git a/trunk/assets/dist/js/admin-script.js b/trunk/assets/dist/js/admin-script.js deleted file mode 100644 index 07b5f249..00000000 --- a/trunk/assets/dist/js/admin-script.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";function e(a){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(a)}!function(a,r){if("undefined"==typeof wc_serial_numbers_vars)return!1;a(document).ready((function(){a(document).on("click",".wcsn-key",(function(){var e=a(this);if(!e.hasClass("copying")){var r=a("");a("body").append(r),r.val(e.data("unmasked")).select(),document.execCommand("copy"),r.remove(),e.text(wc_serial_numbers_vars.i18n.copied).addClass("copying"),setTimeout((function(){e.text(e.data("masked")).removeClass("copying")}),1e3)}})).on("mouseenter mouseleave",".wcsn-key:not(.copying)",(function(e){var r=a(this);"mouseenter"===e.type?r.text(r.data("unmasked")):r.text(r.data("masked"))})).on("submit",".wcsn-api-form",(function(e){e.preventDefault();var r=a(this);a.ajax({url:wc_serial_numbers_vars.apiurl,method:"POST",data:r.serialize(),dataType:"json",beforeSend:function(){r.addClass("loading"),r.find(".wcsn-api-response").text("Loading...")},success:function(e){r.find(".wcsn-api-response").text(JSON.stringify(e,null,2))},error:function(e){r.find(".wcsn-api-response").text(JSON.stringify(e,null,2))},always:function(){r.removeClass("loading")}})})),a(".wcsn_search_product, .wc-serial-numbers-select-product").select2({ajax:{cache:!0,delay:500,url:wc_serial_numbers_vars.ajaxurl,method:"POST",dataType:"json",data:function(e){return{action:"wc_serial_numbers_search_product",nonce:wc_serial_numbers_vars.search_nonce,search:e.term,page:e.page||1}},processResults:function(e,a){return!1===e.success&&alert(e.data.message),a.page=a.page||1,{results:e.results,pagination:{more:e.pagination.more}}}},placeholder:wc_serial_numbers_vars.i18n.search_product,minimumInputLength:1,allowClear:!0}),a(".wcsn_search_order").select2({ajax:{cache:!0,delay:500,url:wc_serial_numbers_vars.ajaxurl,method:"POST",dataType:"json",data:function(e){return{action:"wc_serial_numbers_search_orders",nonce:wc_serial_numbers_vars.search_nonce,search:e.term,page:e.page}},processResults:function(e,a){return!1===e.success&&alert(e.data.message),a.page=a.page||1,{results:e.results,pagination:{more:e.pagination.more}}}},placeholder:wc_serial_numbers_vars.i18n.search_order,minimumInputLength:1,allowClear:!0}),a(".wcsn_search_customer").select2({ajax:{cache:!0,delay:500,url:wc_serial_numbers_vars.ajaxurl,method:"POST",dataType:"json",data:function(e){return{action:"wc_serial_numbers_search_customers",nonce:wc_serial_numbers_vars.search_nonce,search:e.term,page:e.page}},processResults:function(e,a){return!1===e.success&&alert(e.data.message),a.page=a.page||1,{results:e.results,pagination:{more:e.pagination.more}}}},placeholder:wc_serial_numbers_vars.i18n.search_customer,minimumInputLength:1,allowClear:!0}),void 0!==a.fn.datepicker&&a(".wc-serial-numbers-select-date").datepicker({changeMonth:!0,changeYear:!0,dateFormat:"yy-mm-dd",firstDay:7,minDate:new Date}),void 0!==e(a.fn.select2)&&a(":input.wcsn-select2").filter(":not(.enhanced)").each((function(){var e=a(this),r={allowClear:e.data("allow_clear")&&!e.prop("multiple")||!0,placeholder:e.data("placeholder")||e.attr("placeholder")||"",minimumInputLength:e.data("minimum_input_length")?e.data("minimum_input_length"):0,ajax:{url:wc_serial_numbers_vars.ajaxurl,dataType:"json",delay:250,method:"POST",data:function(a){return{term:a.term,action:e.data("action"),type:e.data("type"),_wpnonce:e.data("nonce")||wc_serial_numbers_vars.ajax_nonce,exclude:e.data("exclude"),include:e.data("include"),limit:e.data("limit"),page:a.page||1}},processResults:function(e){return e.page=e.page||1,e},cache:!0}};e.data("action")||delete r.ajax,e.select2(r).addClass("enhanced")})),a('#wcsn-add-key-form :input[name="status"]').on("change",(function(){var e=a(this),r=e.closest("form"),n=r.find(':input[name="customer_id"]'),t=r.find(':input[name="order_id"]');if(!a(this).is(":checked")||!a(this).val())return!1;"create_order"===e.val()?(n.prop("required",!0).closest("tr").show(),t.prop("required",!1).closest("tr").hide()):"existing_order"===e.val()?(n.prop("required",!1).closest("tr").hide(),t.prop("required",!0).closest("tr").show()):(n.prop("required",!1).closest("tr").hide(),t.prop("required",!1).closest("tr").hide())})).trigger("change")}))}(jQuery,window)}(); \ No newline at end of file diff --git a/trunk/assets/dist/js/frontend-script.asset.php b/trunk/assets/dist/js/frontend-script.asset.php deleted file mode 100644 index 9a49bf5f..00000000 --- a/trunk/assets/dist/js/frontend-script.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => 'fade3928866aae61465a'); diff --git a/trunk/assets/dist/js/frontend-script.js b/trunk/assets/dist/js/frontend-script.js deleted file mode 100644 index 7b9a4842..00000000 --- a/trunk/assets/dist/js/frontend-script.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){"use strict";a(document).ready((function(){a(document).on("submit",".wcsn-api-form",(function(e){e.preventDefault();var t=a(this),n=t.find('input[type="submit"]');if(t.hasClass("loading"))return!1;a.ajax({url:wc_serial_numbers_frontend_vars.ajax_url,method:"POST",data:t.serialize(),dataType:"json",beforeSend:function(){t.addClass("loading"),n.attr("data-label",n.val()).attr("disabled","disabled").val(wc_serial_numbers_frontend_vars.i18n.loading)},complete:function(a){var e=a.responseJSON;e&&e.message&&window.alert(e.message),n.removeAttr("disabled").val(n.attr("data-label")),t.removeClass("loading")}})}))}))}(jQuery); \ No newline at end of file diff --git a/trunk/assets/images/add-generator.png b/trunk/assets/images/add-generator.png deleted file mode 100644 index e0c4fcfafe182e3959d8d02606312efa2deb449a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 82665 zcmeFYc~nws_&L(gseN11l|k4?fYXLhUZzND;lPT8tO zbJd!^_Qn|P@lIH`t|IZpnP$hoPWU+3hq-?|({ZLupK~M5;_1E%Zv&sQHe{}lpY z3;!R5FruXh0>wx2DjAOqqo?DW;|&{5*3Y!-HM=#;r1qkDi(G;ZOTrSDupskIDw|DN z5n~+7d<76F#Ka3RsSn(Y-fk@_$caV?8xoakhVS(_G~=sTwWzfq(8$!5khP$`T;> z<@vGBOH<6JBa*Ce7I-j>83f!3iaRi}8T4W8GqZ_jw%YxuGZM{J0^qV=Y>YXmG3hK+ zq+BI{U6#C1uCX2Q$__7aRk57=`onnI;_o_sZ2$-qgZcIKGAKrCamo*3ZZZ97YmqA7 z4$UXBU3ED+QNNmcn_a)(ImTAo7ko|u^udV@AVb*b0y{@X8$DGTtHg9kc%Q5)0-kuJ zOF0~v=kcj<3r(b#(I1x1o}b<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fr%3XxTS3_`oCUd zT`WcNsKe=gKVe^ECyFPJH~BrW((psIM@rT2_E5dGs)~_KdrSpH+rVLC0owR-Gt{`TP1htMiz_~xx-AVoZ=@d z21)pem>_3*Ha`I^vG!lkN4BcDB057F@EWG|uWkzcn`VzC{BKbILoq7V^&M~{Oh;aU zB7E`oU!`TrP1+oagYviB6>!~}mgAVOn{jxD{(!f=8@NvHOF<7n#;2Tx1|bQ`bxl*o&& zx)m-2DU++2y`^Xs?kGUg36H|_Ldru?sjVx?iBpWrKVr`+6=YwbzGbVe`jOZgXKxgn zjD>ju3cRj@pKfRT07vOYMn;}*Q*e4%ayi$;Na2SrSB5gMz1jj5ezrI|d2_E}V*8d+ z(M)Tdr}DxS$k>FJfamBS@rl4`02NJj!+J{{SpF<|ssK9&^4aNp?d%aa7&49!+UQ2i z3}+ueo>5$VfALhr7Uv<{W|dU`2}z0g_7N|%;4Jhddc~DIcnN%UI!~g&M&?O+dzQpj_CqRn^T3~cEyf=*_bqmKlznU*n^jLFhzAVWj%wy?1 z^?B0cBjX&qH}0`+{#L}Rzb&w_4;KA8U%7Z{$=d(VKQ!wyJ@AG9mq?%E9_!w3qj%B1 I`Qgm}0x7}*DF6Tf diff --git a/trunk/assets/images/csv-export.png b/trunk/assets/images/csv-export.png deleted file mode 100644 index 7337d35a07c14e1510fbb2de7e59ad36def73765..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 70115 zcmeFZc~nws{5NVxQya{zPJ?6RDKn?EoJA`uD>F(<3#W|C6cLA<0L7+bqjt(PCumYL zMKc9Q)Y76fB_~i&&pp{B1v=UAnIdm>z#nh1h6g)WDK=gUVmlX`b z<>xm0U*8G|kALyZKO{2DWaR*1=e12fH@$0D2*2E{-)z2f$FbU%M`{oGb^jA>sc!sk z_)FNKlck$Bv5&g`Rln}9Z6$X?orw0>ZPm(8zdszY!$$6D;yH(41$mr{+yQA5m2SZi z{3Bc7lSD`scR(J~$Q@|n)M+{&07wLmkm!hiPd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hsF*7ldG~#f z-0SYP&!}^EJKmY}jb|jC6V3ZaG2p%Ik2m4g>&3#^a7{nO5^{z~IHKz^<(c!jUG>Uh zzw+Qvw3H`db-MOR%$vmo`30ES)Acmnp}D%kyqs!6bD;1 z4t#QfYJ4A9fgB-C$_Q)L+bnwM4yJlX=sBkWTYC-sy;5gCu}0=%^hY|k~<795vpCN{q>@HWkdy&d0SQQV@{CZHEJPmvo{x0ab8{n zy1~J#yUlbv8pF3MA?47KI_%0!H25iUHoOe zq~~aWpCl7dJzZUwU*(nRszU|% zKP&XQSOn5SE8!4us`IKNoHFLk4$}hji#mbsEH*Yd*IYraV)e?aP{Az{x;~S5M3oxa#4u}29TtI8O+36Jd z&SCv|^VSk17HN?*Hu!z}tEBoC*-_%2BMvq*Os(y@0Togs?y7$8YNcC1FiOk(ADHrZ zb#xVy^FF|t$+3;3e*;Cwb;k6FE>m>}dV^v%yXqr;v=YM?F|ON4SD}KV;-GL@sFm@V z?KYtbo>rNX$8btO359nh303Wq^iB9Xo&JKW2;cdmGe2ByLaN9ihO0H`dgeW8$~P&8 z?~FZF#Y)0TON?(#3Qw0jr6h68_J;M`=BD%o`~PKQMAm#GfoFdqMn6{%I}XFJCq*2P!&49q>Sy7YHrD)yb~ zHC}(Z-9qcZ;*avLb8`iJLdL+(xJl&?zM^84GSG)ED9aJ*(YayLC`0qDN)qSW9!AoC zDAIdsi{ycPq^W9h1m7sPR4K&XUel`}@GlcuQrH`9=X^kIY#v~1IIc!nJX)Vt>n;ul z1IwQ_7$bd`6{)fL35oWovH4S&O}hqBLG!c)gk4qCbn4B{r8RRZ#cJo9Ib-@=DR#4_ zQ;Hw#=1l9|_09NVS|F%(*5YXsflT}F`=+wIb`B^0A75w^QHyr?L9_Bn7nGm-`NzOr KRX?1#@IL?rTGg%q diff --git a/trunk/assets/images/csv-import.png b/trunk/assets/images/csv-import.png deleted file mode 100644 index eead52175b5a0e13dfee3dd50f3a56b7c98f0192..0000000000000000000000000000000000000000 GIT binary pat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wep1}%Sy3r@{SH>DjvI-+~8U783#Y$LDs9R6`EZ69s${6N~@ZgVzt_fZ-Z zonHL{af9~QScK5w%xlBv*pAd1LFC>(a=0PzDu@m& zJ?2%g@Tmhl+SpLQ!rc$dH()Dz4Jki>*A{NGlw5|PFgi98LH5H*%ZZ}yutp>3AQ8?M z5ZigBb3=dj1?EDA_@1IWXkZ7n+lA?veh=qjgMJ|)HDiR#un@G4)#j+PIPwQjvzp#Rs?Tz z+qXk$5=uM$5m+Q((3SBM?%@B0J+wiW)8OF!s7z9T7_WDWQXv3SQ5%35z&W$S;rMnM z^jDACty)T(1iP*VXJ3}s&kVmr611c6GVbw|tbN51B1%zer5oEBeIzZ*3Vzy$OrY=^ zSqRo?9#i(L7|)xalUVK)^HUE+qW2pLQ-#9#`DK@6{#d(;w$PH+k?_OLAu2QdIfWtA%V-l&O3|%zOQnBmtYt^lCN>j55ceR zGD8+&;SCO!)KJ3oR@df>HWRj{95y8oT^phVL7&_$q>li5#K8R?)zJGw$)LbY&x3`D zI#A`7k4A0!%B+)tsc+fX-iOhP7DS+=J0KDFzd-QHWYzmWV+lYFR| zac+tcRZYu0yJUZq;L(|!d8&XgFhfdgyY_yTn*g3j6CA3v)4V+9Lq-gkaIr~3Jf?cd*>-PUY)zxkg1yvpd+x%~#`gulg6Of{&%Iywy@`&0R6Kv{`>gt<346<9LF*2aJ&AXN>p*?a28{(lxgSJz*AynnmDUEIHOCu(!7_nqI|d>*o= zpyBg_2gZ;UoDXaSpkl@f55O}-4CxLBK$E(_H9ZXt;8{+FIgE^uYdb8M!E@cf8CEtH ksD2*ki0T2!fi~!0ebvJi=5~S(;8XEDUHx3vIVCg!096k&CIA2c diff --git a/trunk/assets/images/txt-import.png b/trunk/assets/images/txt-import.png deleted file mode 100644 index d65f68d48dd019f968ec5fe692012215070ac0eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 79528 zcmeFZdsLEJ^fpR&_bxSSm!+n=+GS-%S!$_BcXyex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7E_3&e8;adu)zIxBAa7Ac-~G|z26kvI$y@9oJUaXAVcfOR#gxV84$9BYr}s0y z^ls895VSqqkphktuQX~w=Ho9rK@2W%Vf$U`9$3NvTZhs*rx<5)fg^8'; - print_r( $data['body'] ); - echo ''; -} - -$links = array( - 'check' => 'Check request', - 'activation' => 'Activation request', - 'deactivation' => 'Deactivation', - 'version_check' => 'Version Check', -); - -foreach ( $links as $key => $value ) { - echo '' . $value . ' | '; -} - -// Valid check request -if ( $request == 'check' ) { - $args = array( - 'wc-api' => 'serial-numbers-api', - 'request' => 'check', - 'email' => $email, - 'serial_key' => $license_key, - 'product_id' => $product_id, - ); - echo '
    '; - echo '
    '; - echo 'Valid check request:
    '; - execute_request( $args ); -} - -// Valid activation request -if ( $request == 'activation' ) { - $args = array( - 'wc-api' => 'serial-numbers-api', - 'request' => 'activate', - 'email' => $email, - 'serial_key' => $license_key, - 'product_id' => $product_id, - 'instance' => $instance, - ); - - echo 'Valid activation request:
    '; - execute_request( $args ); -} - - -// Valid deactivation reset request -if ( $request == 'deactivation' ) { - $args = array( - 'wc-api' => 'serial-numbers-api', - 'request' => 'deactivate', - 'email' => $email, - 'serial_key' => $license_key, - 'product_id' => $product_id, - 'instance' => $instance, - ); - - echo 'Valid deactivation request:
    '; - execute_request( $args ); -} - -// Version check -if ( $request == 'version_check' ) { - $args = array( - 'wc-api' => 'serial-numbers-api', - 'request' => 'version_check', - 'email' => $email, - 'serial_key' => $license_key, - 'product_id' => $product_id, - 'instance' => $instance, - ); - - echo 'Valid Version check request:
    '; - execute_request( $args ); -} diff --git a/trunk/languages/wc-serial-numbers.pot b/trunk/languages/wc-serial-numbers.pot deleted file mode 100644 index f2292502..00000000 --- a/trunk/languages/wc-serial-numbers.pot +++ /dev/null @@ -1,1543 +0,0 @@ -# Copyright (C) 2024 PluginEver -# This file is distributed under the GPL v2 or later. -msgid "" -msgstr "" -"Project-Id-Version: WC Serial Numbers 1.7.6\n" -"Report-Msgid-Bugs-To: https://pluginever.com/support\n" -"POT-Creation-Date: 2024-07-30 09:41:06+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2024-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: en\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-Country: United States\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-KeywordsList: " -"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_" -"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n" -"X-Poedit-Basepath: ../\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-Bookmarks: \n" -"X-Textdomain-Support: yes\n" -"X-Generator: grunt-wp-i18n 1.0.3\n" - -#: lib/Lib/Model.php:424 -#. translators: %s: database error message. -msgid "Could not insert item into the database error %s" -msgstr "" - -#: lib/Lib/Model.php:489 -msgid "Could not update item in the database." -msgstr "" - -#: lib/Lib/Plugin.php:309 -msgid "Go Pro" -msgstr "" - -#: lib/Lib/Plugin.php:655 src/Admin/Settings.php:190 -msgid "Documentation" -msgstr "" - -#: lib/Lib/Plugin.php:662 -msgid "Support" -msgstr "" - -#: lib/Lib/Plugin.php:669 -msgid "Review" -msgstr "" - -#: lib/Lib/Plugin.php:675 -msgid "More Plugins" -msgstr "" - -#: lib/Lib/Plugin.php:692 src/Admin/Menus.php:171 src/Admin/Menus.php:172 -msgid "Settings" -msgstr "" - -#: lib/Lib/Settings.php:97 -msgid "Settings saved." -msgstr "" - -#: lib/Lib/Settings.php:236 lib/Lib/Settings.php:324 -msgid "Recommended" -msgstr "" - -#: lib/Lib/Settings.php:237 lib/Lib/Settings.php:325 -msgid "Install Now" -msgstr "" - -#: lib/Lib/Settings.php:296 -msgid "Need Help?" -msgstr "" - -#: lib/Lib/Settings.php:339 -msgid "Join our Community" -msgstr "" - -#: lib/Lib/Settings.php:343 -msgid "Request a Feature" -msgstr "" - -#: lib/Lib/Settings.php:347 -msgid "Report a Bug" -msgstr "" - -#: src/API.php:68 -msgid "Missing data." -msgstr "" - -#: src/Admin/Actions.php:39 src/Ajax.php:37 src/Ajax.php:100 src/Ajax.php:175 -msgid "You do not have permission to access this endpoint." -msgstr "" - -#: src/Admin/Actions.php:193 src/Admin/Actions.php:224 -msgid "You do not have permission to perform this action." -msgstr "" - -#: src/Admin/Actions.php:244 -msgid "Key added successfully." -msgstr "" - -#: src/Admin/Actions.php:246 -msgid "Key updated successfully." -msgstr "" - -#: src/Admin/Admin.php:65 -msgid "Search by product" -msgstr "" - -#: src/Admin/Admin.php:66 -msgid "Search by order" -msgstr "" - -#: src/Admin/Admin.php:67 -msgid "Search by customer" -msgstr "" - -#: src/Admin/Admin.php:68 -msgid "Show" -msgstr "" - -#: src/Admin/Admin.php:69 -msgid "Hide" -msgstr "" - -#: src/Admin/Admin.php:70 src/Frontend/Frontend.php:56 -msgid "Copied" -msgstr "" - -#: src/Admin/Admin.php:108 -#. translators: 1: Plugin name 2: WordPress -msgid "" -"Thank you for using %1$s! Share your appreciation with a five-star review " -"%2$s." -msgstr "" - -#: src/Admin/Admin.php:110 -msgid "Thanks :)" -msgstr "" - -#: src/Admin/Admin.php:128 -#. translators: 1: Plugin version -msgid "Version %s" -msgstr "" - -#: src/Admin/Admin.php:141 src/Admin/Menus.php:54 src/Admin/Menus.php:89 -#: src/Admin/Menus.php:90 src/Admin/Menus.php:435 src/Admin/Metaboxes.php:36 -#: src/Admin/Metaboxes.php:257 src/Functions/Template.php:226 -msgid "Serial Numbers" -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:39 -#: src/Admin/ListTables/KeysTable.php:356 -msgid "Activation" -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:40 src/Admin/Menus.php:120 -#: src/Admin/Menus.php:121 src/Admin/views/html-list-activations.php:18 -msgid "Activations" -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:100 -msgid "No activations found. Once a serial key is activated, it will appear here." -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:113 -#: src/Admin/ListTables/KeysTable.php:281 -#: src/Admin/ListTables/StockTable.php:82 -msgid "Filter" -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:164 -#: src/Admin/ListTables/ActivationsTable.php:239 -#: src/Admin/ListTables/KeysTable.php:336 -#: src/Admin/ListTables/KeysTable.php:428 src/Admin/views/html-edit-key.php:130 -msgid "Delete" -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:176 -#: src/Admin/views/html-api-actions.php:141 src/Frontend/Shortcodes.php:146 -msgid "Instance" -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:177 -#: src/Admin/ListTables/KeysTable.php:350 -#: src/Admin/ListTables/StockTable.php:95 src/Admin/views/html-add-key.php:33 -#: src/Admin/views/html-api-actions.php:118 -#: src/Admin/views/html-api-validation.php:121 -#: src/Admin/views/html-edit-key.php:37 src/Deprecated/Functions.php:358 -#: src/Frontend/Shortcodes.php:44 src/Frontend/Shortcodes.php:141 -msgid "Product" -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:178 -#: src/Admin/ListTables/KeysTable.php:349 src/Admin/Orders.php:233 -#: src/Admin/views/html-api-actions.php:131 -#: src/Admin/views/html-api-validation.php:134 src/Functions/Template.php:42 -#: src/functions.php:1009 -msgid "Key" -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:179 -#: src/Admin/views/html-api-actions.php:152 src/Frontend/Shortcodes.php:148 -msgid "Platform" -msgstr "" - -#: src/Admin/ListTables/ActivationsTable.php:180 -msgid "Activation Time" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:78 -msgid "key" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:79 -msgid "keys" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:170 -msgid "No keys found." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:170 -msgid "Add new key" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:174 -msgid "Keys can have one of the following statuses:" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:178 -#: src/Admin/ListTables/KeysTable.php:235 src/functions.php:46 -msgid "Available" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:180 -msgid "This means the key is available for purchase." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:183 -#: src/Admin/ListTables/KeysTable.php:242 src/functions.php:47 -msgid "Pending" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:185 -msgid "This means the key has been sold, but the order has not been completed yet." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:188 -#: src/Admin/ListTables/KeysTable.php:249 -#: src/Admin/ListTables/StockTable.php:97 src/functions.php:48 -msgid "Sold" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:190 -msgid "This means the key has been sold, and the order has been completed." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:193 -#: src/Admin/ListTables/KeysTable.php:256 src/Functions/Template.php:72 -#: src/functions.php:49 -msgid "Expired" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:195 -msgid "This means the key has expired and is no longer valid." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:198 -#: src/Admin/ListTables/KeysTable.php:263 src/functions.php:50 -msgid "Cancelled" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:200 -msgid "" -"This means the key has been cancelled and is no longer available for " -"purchase or use." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:226 -msgid "All keys." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:228 -msgid "All" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:233 -msgid "Available for sell." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:240 -msgid "Pending payment." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:247 -msgid "Sold keys." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:254 -msgid "Expired keys." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:261 -msgid "Cancelled keys." -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:337 -msgid "Reset Activations" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:351 src/Admin/views/html-add-key.php:120 -msgid "Order" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:352 -msgid "Validity" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:359 -msgid "Order Date" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:360 src/Admin/Menus.php:322 -#: src/Admin/Orders.php:245 src/Admin/views/html-add-key.php:91 -#: src/Admin/views/html-edit-key.php:92 src/Functions/Template.php:78 -#: src/functions.php:1034 -msgid "Status" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:426 -#. translators: %d: key id. -msgid "ID: %d" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:427 -#: src/Admin/ListTables/StockTable.php:143 -msgid "Edit" -msgstr "" - -#: src/Admin/ListTables/KeysTable.php:522 -#. translators: %1$s: validity, %2$s: validity. -msgid "%s Day
    After purchase" -msgid_plural "%s Days
    After purchase" -msgstr[0] "" -msgstr[1] "" - -#: src/Admin/ListTables/KeysTable.php:532 src/Admin/Orders.php:238 -#: src/Functions/Template.php:63 src/functions.php:1030 -msgid "Lifetime" -msgstr "" - -#: src/Admin/ListTables/ListTable.php:140 -#: src/Admin/ListTables/ListTable.php:142 -msgid "Filter by order" -msgstr "" - -#: src/Admin/ListTables/ListTable.php:163 -msgid "Filter by product" -msgstr "" - -#: src/Admin/ListTables/ListTable.php:186 -msgid "Filter by customer" -msgstr "" - -#: src/Admin/ListTables/StockTable.php:20 -msgid "stock" -msgstr "" - -#: src/Admin/ListTables/StockTable.php:21 -msgid "stocks" -msgstr "" - -#: src/Admin/ListTables/StockTable.php:70 -msgid "No products selling serial keys from \"stock\" found." -msgstr "" - -#: src/Admin/ListTables/StockTable.php:96 -msgid "Source" -msgstr "" - -#: src/Admin/ListTables/StockTable.php:98 src/Admin/Menus.php:282 -msgid "Stock" -msgstr "" - -#: src/Admin/ListTables/StockTable.php:172 -msgid "Manual" -msgstr "" - -#: src/Admin/ListTables/StockTable.php:174 -msgid "Generator Rule" -msgstr "" - -#: src/Admin/ListTables/StockTable.php:176 -msgid "Auto Generated" -msgstr "" - -#: src/Admin/ListTables/StockTable.php:178 -msgid "Unknown" -msgstr "" - -#: src/Admin/Menus.php:100 src/Admin/Menus.php:101 -#: src/Admin/views/html-list-keys.php:18 -msgid "Serial Keys" -msgstr "" - -#: src/Admin/Menus.php:137 src/Admin/Menus.php:138 -msgid "Tools" -msgstr "" - -#: src/Admin/Menus.php:154 src/Admin/Menus.php:155 -msgid "Reports" -msgstr "" - -#: src/Admin/Menus.php:191 src/Admin/Metaboxes.php:136 -#: src/Admin/Metaboxes.php:157 -msgid "Upgrade to Pro" -msgstr "" - -#: src/Admin/Menus.php:247 src/Admin/Menus.php:383 -msgid "Generators" -msgstr "" - -#: src/Admin/Menus.php:248 -msgid "API Toolkit" -msgstr "" - -#: src/Admin/Menus.php:249 src/Admin/views/html-list-keys.php:25 -msgid "Import" -msgstr "" - -#: src/Admin/Menus.php:250 src/Admin/views/html-list-keys.php:29 -msgid "Export" -msgstr "" - -#: src/Admin/Menus.php:337 src/Admin/Menus.php:344 src/Admin/Menus.php:362 -#: src/Admin/Menus.php:380 -msgid "Available in Pro Version" -msgstr "" - -#: src/Admin/Menus.php:338 src/Admin/Menus.php:345 src/Admin/Menus.php:363 -#: src/Admin/Menus.php:381 -msgid "Upgrade to Pro Now" -msgstr "" - -#: src/Admin/Menus.php:340 src/Admin/Menus.php:347 -msgid "Import Serial Numbers" -msgstr "" - -#: src/Admin/Menus.php:365 -msgid "Export Serial Numbers" -msgstr "" - -#: src/Admin/Menus.php:410 -msgid "Table exists" -msgstr "" - -#: src/Admin/Menus.php:412 -msgid "Table does not exist" -msgstr "" - -#: src/Admin/Menus.php:418 -msgid "Hourly cron" -msgstr "" - -#: src/Admin/Menus.php:419 -msgid "Daily cron" -msgstr "" - -#: src/Admin/Menus.php:425 -#. translators: %s: Next scheduled time. -msgid "Next run: %s" -msgstr "" - -#: src/Admin/Menus.php:427 -msgid "Not scheduled" -msgstr "" - -#: src/Admin/Metaboxes.php:57 -msgid "Sell keys" -msgstr "" - -#: src/Admin/Metaboxes.php:58 -msgid "Enable this if you are selling keys or licensing this product." -msgstr "" - -#: src/Admin/Metaboxes.php:71 -msgid "Delivery quantity" -msgstr "" - -#: src/Admin/Metaboxes.php:72 -msgid "Number of key(s) will be delivered per item. Available in PRO." -msgstr "" - -#: src/Admin/Metaboxes.php:92 src/Admin/Metaboxes.php:124 -msgid "Key source" -msgstr "" - -#: src/Admin/Metaboxes.php:110 -msgid "Software version" -msgstr "" - -#: src/Admin/Metaboxes.php:111 -msgid "Version number for the software. Ignore if it's not a software." -msgstr "" - -#: src/Admin/Metaboxes.php:112 -msgid "e.g. 1.0" -msgstr "" - -#: src/Admin/Metaboxes.php:126 -msgid "key available." -msgid_plural "keys available." -msgstr[0] "" -msgstr[1] "" - -#: src/Admin/Metaboxes.php:134 -msgid "Want to sell keys for variable products?" -msgstr "" - -#: src/Admin/Metaboxes.php:155 -msgid "" -"The free version of Serial Numbers for WooCommerce does not support product " -"variation." -msgstr "" - -#: src/Admin/Metaboxes.php:239 -msgid "Order missing serial numbers for this item." -msgstr "" - -#: src/Admin/Notices.php:49 -#. translators: %1$s: link to the plugin page, %2$s: link to the plugin page -msgid "" -"%s is not functional because you are using outdated version of the plugin, " -"please update to the version 1.2.1 or higher." -msgstr "" - -#: src/Admin/Notices.php:63 -#. translators: %1$s: link to the plugin page, %2$s: link to the plugin page -msgid "" -"Upgrade to %6$s to unlock the full potential of %5$s and avail a %1$s " -"discount by using the promo code %2$s. %3$s Upgrade Now%4$s." -msgstr "" - -#: src/Admin/Orders.php:53 src/Admin/Orders.php:166 -msgid "Add serial keys" -msgstr "" - -#: src/Admin/Orders.php:54 src/Admin/Orders.php:167 -msgid "Remove serial keys" -msgstr "" - -#: src/Admin/Orders.php:73 -msgid "Serial keys added successfully to the order." -msgstr "" - -#: src/Admin/Orders.php:77 -msgid "Serial keys removed successfully from the order." -msgstr "" - -#: src/Admin/Orders.php:114 src/Admin/Orders.php:146 -msgid "Order is fullfilled." -msgstr "" - -#: src/Admin/Orders.php:117 src/Admin/Orders.php:149 -msgid "Order is not fullfilled." -msgstr "" - -#: src/Admin/Orders.php:195 -#. Translators: %d: number of orders. -msgid "%d orders updated successfully." -msgstr "" - -#: src/Admin/Orders.php:228 -msgid "Serial keys sold with this product:" -msgstr "" - -#: src/Admin/Orders.php:237 -msgid "Expire date" -msgstr "" - -#: src/Admin/Orders.php:241 src/Admin/views/html-add-key.php:65 -#: src/Admin/views/html-edit-key.php:67 -msgid "Activation limit" -msgstr "" - -#: src/Admin/Orders.php:242 -msgid "Unlimited" -msgstr "" - -#: src/Admin/Orders.php:272 -#. translators: %s is the item number. -msgid "View Details" -msgstr "" - -#: src/Admin/Settings.php:25 -msgid "General" -msgstr "" - -#: src/Admin/Settings.php:46 -msgid "General Settings" -msgstr "" - -#: src/Admin/Settings.php:48 -msgid "These options determine the behavior and operation of the plugin." -msgstr "" - -#: src/Admin/Settings.php:52 -msgid "Auto-complete orders" -msgstr "" - -#: src/Admin/Settings.php:54 -msgid "Automatically completes orders after successful payments." -msgstr "" - -#: src/Admin/Settings.php:59 -msgid "Reuse keys" -msgstr "" - -#: src/Admin/Settings.php:61 -msgid "Recover failed, refunded keys for selling again." -msgstr "" - -#: src/Admin/Settings.php:62 -msgid "" -"If you enable this option, the keys will be available for selling again if " -"the order is refunded or failed." -msgstr "" - -#: src/Admin/Settings.php:68 -msgid "Revoke keys" -msgstr "" - -#: src/Admin/Settings.php:70 -msgid "Revoke keys when the order status changes to cancelled or refunded." -msgstr "" - -#: src/Admin/Settings.php:71 -msgid "" -"If you enable this option, the keys will be revoked when the order status " -"changes to cancelled or refunded." -msgstr "" - -#: src/Admin/Settings.php:76 -msgid "Hide keys" -msgstr "" - -#: src/Admin/Settings.php:78 -msgid "Keys will be masked in the list table." -msgstr "" - -#: src/Admin/Settings.php:83 -msgid "Disable software support" -msgstr "" - -#: src/Admin/Settings.php:85 -msgid "Disable Software Licensing support & API functionalities." -msgstr "" - -#: src/Admin/Settings.php:86 -msgid "" -"If you enable this option, the activation menu and it’s functionality will " -"be turned off." -msgstr "" - -#: src/Admin/Settings.php:95 -msgid "Stock Notification" -msgstr "" - -#: src/Admin/Settings.php:97 -msgid "These options determine the operation of the key's stock notification." -msgstr "" - -#: src/Admin/Settings.php:101 -msgid "Stock notification email" -msgstr "" - -#: src/Admin/Settings.php:103 -msgid "Sends notification emails when key stock is low." -msgstr "" - -#: src/Admin/Settings.php:109 -msgid "Stock threshold" -msgstr "" - -#: src/Admin/Settings.php:111 -msgid "" -"An email notification will be sent when the key stock falls below the " -"specified number." -msgstr "" - -#: src/Admin/Settings.php:116 -msgid "Notification recipient email" -msgstr "" - -#: src/Admin/Settings.php:118 -msgid "The email address which will be used to send email notifications." -msgstr "" - -#: src/Admin/Settings.php:152 -msgid "Create and assign keys for WooCommerce variable products." -msgstr "" - -#: src/Admin/Settings.php:153 -msgid "Generate bulk keys with your custom key generator rule." -msgstr "" - -#: src/Admin/Settings.php:154 src/Admin/views/html-add-key.php:172 -msgid "Random & sequential key order for the generator rules." -msgstr "" - -#: src/Admin/Settings.php:155 -msgid "Automatic key generator to auto-create & assign keys with orders." -msgstr "" - -#: src/Admin/Settings.php:156 src/Admin/views/html-add-key.php:174 -msgid "License key management option from the order page with required actions." -msgstr "" - -#: src/Admin/Settings.php:157 -msgid "Support for bulk import/export of keys from/to CSV." -msgstr "" - -#: src/Admin/Settings.php:158 -msgid "Send keys via SMS with Twilio." -msgstr "" - -#: src/Admin/Settings.php:159 -msgid "Option to sell keys even if there are no available keys in the stock." -msgstr "" - -#: src/Admin/Settings.php:160 src/Admin/views/html-add-key.php:178 -msgid "Custom deliverable quantity to deliver multiple keys with a single product." -msgstr "" - -#: src/Admin/Settings.php:161 src/Admin/views/html-add-key.php:179 -msgid "" -"Manual delivery option to manually deliver license keys instead of " -"automatic." -msgstr "" - -#: src/Admin/Settings.php:162 -msgid "" -"Email template to easily and quickly customize the order confirmation & low " -"stock alert email." -msgstr "" - -#: src/Admin/Settings.php:163 src/Admin/views/html-add-key.php:181 -msgid "Many more ..." -msgstr "" - -#: src/Admin/Settings.php:167 src/Admin/views/html-add-key.php:185 -msgid "Want More?" -msgstr "" - -#: src/Admin/Settings.php:168 src/Admin/views/html-add-key.php:186 -msgid "" -"This plugin offers a premium version which comes with the following " -"features:" -msgstr "" - -#: src/Admin/Settings.php:174 src/Admin/views/html-add-key.php:192 -msgid "Upgrade to PRO" -msgstr "" - -#: src/Admin/views/html-add-key.php:15 -msgid "Add Serial Key" -msgstr "" - -#: src/Admin/views/html-add-key.php:17 src/Admin/views/html-edit-key.php:22 -msgid "Go Back" -msgstr "" - -#: src/Admin/views/html-add-key.php:22 -msgid "" -"This section allows you to add a new key that can be sold to customers. " -"Additionally, you can choose to associate this key with either a new order " -"or an existing order." -msgstr "" - -#: src/Admin/views/html-add-key.php:38 src/Admin/views/html-add-key.php:39 -#: src/Admin/views/html-edit-key.php:40 -msgid "Select Product" -msgstr "" - -#: src/Admin/views/html-add-key.php:42 -msgid "" -"Choose the product to which this key is applicable. The key will be " -"associated with this product for sale." -msgstr "" - -#: src/Admin/views/html-add-key.php:50 src/Admin/views/html-edit-key.php:56 -msgid "Serial key" -msgstr "" - -#: src/Admin/views/html-add-key.php:57 -msgid "" -"Enter the unique serial key you want to sell. This key will be sent to the " -"customer after the order status is marked as complete. e.g. " -"4CE0460D0G-4CE0460D1G-4CE0460D2G" -msgstr "" - -#: src/Admin/views/html-add-key.php:68 -msgid "e.g. 5" -msgstr "" - -#: src/Admin/views/html-add-key.php:70 -msgid "" -"For software products, specify the maximum number of times the key can be " -"used to activate the software. If the product is not software, you can " -"leave this field blank." -msgstr "" - -#: src/Admin/views/html-add-key.php:78 -msgid "Valid for (days)" -msgstr "" - -#: src/Admin/views/html-add-key.php:82 -msgid "e.g. 365" -msgstr "" - -#: src/Admin/views/html-add-key.php:83 -msgid "" -"For software products, enter the number of days the key will be valid from " -"the purchase date. If the key should have a lifetime validity, leave this " -"field blank." -msgstr "" - -#: src/Admin/views/html-add-key.php:99 -msgid "" -"Set as available for selling: The key will be available for purchase by " -"customers." -msgstr "" - -#: src/Admin/views/html-add-key.php:105 -msgid "" -"Create a new corresponding order for this key: This option generates a new " -"order specifically for this key." -msgstr "" - -#: src/Admin/views/html-add-key.php:111 -msgid "" -"Associate this key with an existing order: If the customer has already made " -"a purchase and wants to associate this key with that order, select this " -"option." -msgstr "" - -#: src/Admin/views/html-add-key.php:125 src/Admin/views/html-add-key.php:126 -#: src/Admin/views/html-edit-key.php:106 -msgid "Select Order" -msgstr "" - -#: src/Admin/views/html-add-key.php:129 -msgid "" -"Select the order to which this key should be associated. The key will be " -"sent to the customer after the order status is marked as complete." -msgstr "" - -#: src/Admin/views/html-add-key.php:138 -msgid "Customer" -msgstr "" - -#: src/Admin/views/html-add-key.php:143 src/Admin/views/html-add-key.php:144 -msgid "Select Customer" -msgstr "" - -#: src/Admin/views/html-add-key.php:147 -msgid "" -"Select the customer to which this key should be associated. The key will be " -"sent to the customer after the order status is marked as complete." -msgstr "" - -#: src/Admin/views/html-add-key.php:158 -msgid "Add Key" -msgstr "" - -#: src/Admin/views/html-add-key.php:170 -msgid "Create and assign license keys for WooCommerce variable products." -msgstr "" - -#: src/Admin/views/html-add-key.php:171 -msgid "Generate bulk license keys with your custom key generator rule." -msgstr "" - -#: src/Admin/views/html-add-key.php:173 -msgid "Automatic license key generator to auto-create & assign keys with orders." -msgstr "" - -#: src/Admin/views/html-add-key.php:175 -msgid "Support for bulk import/export of license keys from/to CSV." -msgstr "" - -#: src/Admin/views/html-add-key.php:176 -msgid "Send Serial Keys via SMS with Twilio." -msgstr "" - -#: src/Admin/views/html-add-key.php:177 -msgid "" -"Option to sell license keys even if there are no available keys in the " -"stock." -msgstr "" - -#: src/Admin/views/html-add-key.php:180 -msgid "" -"Email Template to easily and quickly customize the order confirmation & low " -"stock alert email." -msgstr "" - -#: src/Admin/views/html-api-actions.php:21 -msgid "API Actions" -msgstr "" - -#: src/Admin/views/html-api-actions.php:26 -msgid "" -"You can use the API to perform actions on your website or on another " -"website." -msgstr "" - -#: src/Admin/views/html-api-actions.php:29 -msgid "To perform an action, you need to send a POST request to the following URL:" -msgstr "" - -#: src/Admin/views/html-api-actions.php:33 -#: src/Admin/views/html-api-validation.php:46 -msgid "The request must contain the following parameters:" -msgstr "" - -#: src/Admin/views/html-api-actions.php:37 -#: src/Admin/views/html-api-actions.php:104 -#: src/Admin/views/html-api-validation.php:50 -#: src/Admin/views/html-api-validation.php:105 -msgid "The ID of the product for which the serial key is valid." -msgstr "" - -#: src/Admin/views/html-api-actions.php:40 -#: src/Admin/views/html-api-validation.php:53 -msgid "The serial key to validate." -msgstr "" - -#: src/Admin/views/html-api-actions.php:43 -msgid "The request type. Must be set to \"activate\" or \"deactivate\"." -msgstr "" - -#: src/Admin/views/html-api-actions.php:46 -msgid "" -"Instance is the base of activation and deactivation. It is a unique " -"identifier for the installation. For example, you can use the domain name " -"of the website." -msgstr "" - -#: src/Admin/views/html-api-actions.php:49 -msgid "" -"Optional. The platform on which the serial key is used. For example, " -"\"Windows\" or \"Mac\"." -msgstr "" - -#: src/Admin/views/html-api-actions.php:52 -#: src/Admin/views/html-api-validation.php:59 -msgid "" -"Using email is completely voluntary. The API will verify that the serial " -"number is associated with the given email address." -msgstr "" - -#: src/Admin/views/html-api-actions.php:57 -#: src/Admin/views/html-api-validation.php:63 -msgid "Example:" -msgstr "" - -#: src/Admin/views/html-api-actions.php:75 -#: src/Admin/views/html-api-validation.php:80 -msgid "The API will return a JSON response with the following parameters:" -msgstr "" - -#: src/Admin/views/html-api-actions.php:80 -msgid "" -"The response code. \"key_activated\" or \"key_deactivated\" if the request " -"was successful. \"invalid_key\" or \"invalid_request\" if the request was " -"not successful." -msgstr "" - -#: src/Admin/views/html-api-actions.php:83 -#: src/Admin/views/html-api-validation.php:87 -msgid "" -"The response message. If the serial key is valid, the message will be " -"\"Serial key is valid\"." -msgstr "" - -#: src/Admin/views/html-api-actions.php:86 -msgid "Activated or deactivated when the request is successful." -msgstr "" - -#: src/Admin/views/html-api-actions.php:89 -#: src/Admin/views/html-api-validation.php:90 -msgid "The activation limit for the serial key." -msgstr "" - -#: src/Admin/views/html-api-actions.php:92 -#: src/Admin/views/html-api-validation.php:93 -msgid "The number of activations for the serial key." -msgstr "" - -#: src/Admin/views/html-api-actions.php:95 -#: src/Admin/views/html-api-validation.php:96 -msgid "The number of activations left for the serial key." -msgstr "" - -#: src/Admin/views/html-api-actions.php:98 -#: src/Admin/views/html-api-validation.php:99 -msgid "The expiration date for the serial key." -msgstr "" - -#: src/Admin/views/html-api-actions.php:101 -msgid "The expiration date for the serial key in Unix timestamp format." -msgstr "" - -#: src/Admin/views/html-api-actions.php:107 -#: src/Admin/views/html-api-validation.php:108 -msgid "The name of the product for which the serial key is valid." -msgstr "" - -#: src/Admin/views/html-api-actions.php:110 -#: src/Admin/views/html-api-validation.php:111 -msgid "The list of activations for the serial key." -msgstr "" - -#: src/Admin/views/html-api-actions.php:113 -msgid "You can use the form below to test the API activation/deactivation." -msgstr "" - -#: src/Admin/views/html-api-actions.php:126 -msgid "Select a product to activate/deactivate serial key for." -msgstr "" - -#: src/Admin/views/html-api-actions.php:133 -msgid "Please enter serial key to activate/deactivate" -msgstr "" - -#: src/Admin/views/html-api-actions.php:135 -msgid "Required field. Enter serial key to activate/deactivate." -msgstr "" - -#: src/Admin/views/html-api-actions.php:143 -msgid "Please enter a unique instance" -msgstr "" - -#: src/Admin/views/html-api-actions.php:145 -msgid "" -"Required field. Instance is the unique identifier of the activation record. " -"It is used to identify the activation when activating/deactivating serial " -"key." -msgstr "" - -#: src/Admin/views/html-api-actions.php:154 -msgid "Please enter a platform. e.g. Windows" -msgstr "" - -#: src/Admin/views/html-api-actions.php:156 -msgid "" -"Optional field. Platform is the extra information of the activation record. " -"You can use it to identify the platform of the activation." -msgstr "" - -#: src/Admin/views/html-api-actions.php:162 -#: src/Admin/views/html-api-validation.php:144 -#: src/Admin/views/html-edit-key.php:154 src/Deprecated/Functions.php:360 -#: src/Frontend/Shortcodes.php:47 src/Frontend/Shortcodes.php:144 -msgid "Email" -msgstr "" - -#: src/Admin/views/html-api-actions.php:164 -#: src/Admin/views/html-api-validation.php:146 -msgid "Please enter a valid email address" -msgstr "" - -#: src/Admin/views/html-api-actions.php:166 -msgid "" -"Optional field when duplicate key is off. If email is provided, only serial " -"key that are assigned to the email will be activated/deactivated otherwise " -"ignored." -msgstr "" - -#: src/Admin/views/html-api-actions.php:172 src/Frontend/Shortcodes.php:150 -msgid "Action" -msgstr "" - -#: src/Admin/views/html-api-actions.php:175 src/Frontend/Shortcodes.php:157 -msgid "Activate" -msgstr "" - -#: src/Admin/views/html-api-actions.php:176 src/Frontend/Shortcodes.php:158 -msgid "Deactivate" -msgstr "" - -#: src/Admin/views/html-api-actions.php:179 -msgid "Select an action to perform on the serial key." -msgstr "" - -#: src/Admin/views/html-api-actions.php:185 -#: src/Admin/views/html-api-validation.php:153 -msgid "API response" -msgstr "" - -#: src/Admin/views/html-api-actions.php:195 src/Frontend/Shortcodes.php:151 -msgid "Submit" -msgstr "" - -#: src/Admin/views/html-api-validation.php:20 -msgid "API Validation" -msgstr "" - -#: src/Admin/views/html-api-validation.php:30 -#. translators: %s: link to the pro version -msgid "" -"You are using the free version of Serial Numbers for WooCommerce. Upgrade to Pro to get more features." -msgstr "" - -#: src/Admin/views/html-api-validation.php:39 -msgid "" -"You can use the API to validate serial keys on your website or on another " -"website." -msgstr "" - -#: src/Admin/views/html-api-validation.php:42 -msgid "" -"To validate a serial key, you need to send a GET request to the following " -"URL:" -msgstr "" - -#: src/Admin/views/html-api-validation.php:56 -msgid "The request type. Must be set to \"validate\"." -msgstr "" - -#: src/Admin/views/html-api-validation.php:84 -msgid "" -"The response code. If the serial key is valid, the code will be " -"\"key_valid\"." -msgstr "" - -#: src/Admin/views/html-api-validation.php:102 -msgid "The status of the serial key." -msgstr "" - -#: src/Admin/views/html-api-validation.php:115 -msgid "You can test the API using the form below." -msgstr "" - -#: src/Admin/views/html-api-validation.php:129 -msgid "Select a product to validate serial key for." -msgstr "" - -#: src/Admin/views/html-api-validation.php:136 -msgid "Please enter serial key to validate" -msgstr "" - -#: src/Admin/views/html-api-validation.php:138 -msgid "Required field. Enter serial key to validate." -msgstr "" - -#: src/Admin/views/html-api-validation.php:148 -msgid "" -"Optional field. If email is provided, only serial key that are assigned to " -"the email will be validated otherwise ignored." -msgstr "" - -#: src/Admin/views/html-api-validation.php:164 src/Frontend/Shortcodes.php:49 -msgid "Validate" -msgstr "" - -#: src/Admin/views/html-edit-key.php:16 -msgid "Edit Serial Key" -msgstr "" - -#: src/Admin/views/html-edit-key.php:18 -msgid "Add Another" -msgstr "" - -#: src/Admin/views/html-edit-key.php:31 -msgid "Key Details" -msgstr "" - -#: src/Admin/views/html-edit-key.php:50 -msgid "Select the product for which this key is applicable." -msgstr "" - -#: src/Admin/views/html-edit-key.php:61 -msgid "" -"Enter your serial key, also supports multiline. For example: " -"4CE0460D0G-4CE0460D1G-4CE0460D2G" -msgstr "" - -#: src/Admin/views/html-edit-key.php:71 -msgid "" -"Maximum number of times the key can be used to activate the software. If " -"the product is not software, keep it blank." -msgstr "" - -#: src/Admin/views/html-edit-key.php:77 -msgid "Valid for" -msgstr "" - -#: src/Admin/views/html-edit-key.php:82 -msgid "Days" -msgstr "" - -#: src/Admin/views/html-edit-key.php:85 -msgid "" -"Number of days the key will be valid from the purchase date. Leave it blank " -"for lifetime validity." -msgstr "" - -#: src/Admin/views/html-edit-key.php:99 -msgid "Serial key status auto-updates with order status. Avoid manual changes." -msgstr "" - -#: src/Admin/views/html-edit-key.php:104 -msgid "Order ID" -msgstr "" - -#: src/Admin/views/html-edit-key.php:115 -msgid "The order to which the serial number will be assigned." -msgstr "" - -#: src/Admin/views/html-edit-key.php:126 -msgid "Actions" -msgstr "" - -#: src/Admin/views/html-edit-key.php:132 -msgid "Save Key" -msgstr "" - -#: src/Admin/views/html-edit-key.php:139 -msgid "Customer details" -msgstr "" - -#: src/Admin/views/html-edit-key.php:146 -msgid "Name" -msgstr "" - -#: src/Admin/views/html-edit-key.php:162 -msgid "Address" -msgstr "" - -#: src/Admin/views/html-edit-key.php:171 -msgid "Phone" -msgstr "" - -#: src/Admin/views/html-edit-key.php:181 -msgid "View Order" -msgstr "" - -#: src/Admin/views/html-list-activations.php:26 -msgid "Search activation" -msgstr "" - -#: src/Admin/views/html-list-keys.php:21 -msgid "Add New" -msgstr "" - -#: src/Admin/views/html-list-keys.php:33 -msgid "Generate" -msgstr "" - -#: src/Admin/views/html-list-keys.php:44 -msgid "Search key" -msgstr "" - -#: src/Admin/views/html-list-stock.php:16 -msgid "Search" -msgstr "" - -#: src/Ajax.php:211 -#. translators: $1: customer name, $2 customer id, $3: customer email -msgid "%1$s (#%2$s - %3$s)" -msgstr "" - -#: src/Cron.php:57 -msgid "Serial Numbers stock running low" -msgstr "" - -#: src/Deprecated/Functions.php:154 -msgid "Serial number not found." -msgstr "" - -#: src/Deprecated/Functions.php:359 -msgid "Serial Number" -msgstr "" - -#: src/Deprecated/Functions.php:361 src/Functions/Template.php:52 -#: src/functions.php:1019 -msgid "Activation Limit" -msgstr "" - -#: src/Deprecated/Functions.php:362 -msgid "Expires" -msgstr "" - -#: src/Frontend/Frontend.php:57 -msgid "Loading" -msgstr "" - -#: src/Frontend/Shortcodes.php:43 -msgid "Serial Key Validation" -msgstr "" - -#: src/Frontend/Shortcodes.php:45 src/Frontend/Shortcodes.php:142 -msgid "Serial Key" -msgstr "" - -#: src/Frontend/Shortcodes.php:46 src/Frontend/Shortcodes.php:143 -msgid "Enter your serial key" -msgstr "" - -#: src/Frontend/Shortcodes.php:48 src/Frontend/Shortcodes.php:109 -#: src/Frontend/Shortcodes.php:145 src/Frontend/Shortcodes.php:221 -msgid "Enter your email" -msgstr "" - -#: src/Frontend/Shortcodes.php:80 -msgid "No products found." -msgstr "" - -#: src/Frontend/Shortcodes.php:94 src/Frontend/Shortcodes.php:205 -msgid "Select a product" -msgstr "" - -#: src/Frontend/Shortcodes.php:140 -msgid "Activate/Deactivate Serial Key" -msgstr "" - -#: src/Frontend/Shortcodes.php:147 -msgid "Enter your instance" -msgstr "" - -#: src/Frontend/Shortcodes.php:149 -msgid "Enter platform" -msgstr "" - -#: src/Frontend/Shortcodes.php:191 -msgid "Could not find any products with serial numbers enabled." -msgstr "" - -#: src/Frontend/Shortcodes.php:270 src/Frontend/Shortcodes.php:286 -msgid "Invalid request." -msgstr "" - -#: src/Functions/Template.php:47 src/functions.php:1014 -msgid "Activation Email" -msgstr "" - -#: src/Functions/Template.php:53 src/Functions/Template.php:58 -#: src/functions.php:1020 src/functions.php:1025 -msgid "None" -msgstr "" - -#: src/Functions/Template.php:57 src/functions.php:1024 -msgid "Activation Count" -msgstr "" - -#: src/Functions/Template.php:62 src/functions.php:1029 -msgid "Expire Date" -msgstr "" - -#: src/Functions/Template.php:70 -msgid "Active" -msgstr "" - -#: src/Functions/Template.php:305 -msgid "Order is waiting for serial numbers to be assigned." -msgstr "" - -#: src/Installer.php:50 -msgid "Once a Minute" -msgstr "" - -#: src/Installer.php:101 -#. translators: 1: plugin name 2: version number -msgid "%1$s updated to version %2$s successfully." -msgstr "" - -#: src/Models/Activation.php:245 -msgid "Serial id is required." -msgstr "" - -#: src/Models/Activation.php:250 -msgid "Instance is required." -msgstr "" - -#: src/Models/Key.php:484 -msgid "Product id is required." -msgstr "" - -#: src/Models/Key.php:489 -msgid "Product id is invalid." -msgstr "" - -#: src/Models/Key.php:494 src/RestAPI.php:148 -msgid "Serial key is required." -msgstr "" - -#: src/Models/Key.php:506 -msgid "Serial key already exists. Duplicate serial keys are not allowed." -msgstr "" - -#: src/Models/Key.php:512 -msgid "Order id is invalid." -msgstr "" - -#: src/Orders.php:67 -#. translators: %1$s: product title, %2$s: stock quantity. -msgid "" -"Sorry, there aren’t enough Serial Keys for %1$s. Please remove this item or " -"lower the quantity. For now, we have %2$s Serial Keys for this product." -msgstr "" - -#: src/Orders.php:110 -msgid "Order automatically completed by the Serial Numbers for WooCommerce." -msgstr "" - -#: src/Plugin.php:63 -#. translators: 1: plugin name 2: WooCommerce -msgid "%1$s requires %2$s to be installed and active." -msgstr "" - -#: src/Plugin.php:65 -msgid "WooCommerce" -msgstr "" - -#: src/RestAPI.php:144 -msgid "Invalid product ID." -msgstr "" - -#: src/RestAPI.php:159 -msgid "Serial key is invalid." -msgstr "" - -#: src/RestAPI.php:164 -msgid "Serial key is not authorized to use." -msgstr "" - -#: src/RestAPI.php:170 -msgid "Please complete your order to activate the serial key." -msgstr "" - -#: src/RestAPI.php:175 -msgid "Serial key is not valid for this product." -msgstr "" - -#: src/RestAPI.php:180 -msgid "Invalid email address." -msgstr "" - -#: src/RestAPI.php:185 -msgid "Serial key is expired." -msgstr "" - -#: src/RestAPI.php:187 -msgid "Serial key is cancelled." -msgstr "" - -#: src/RestAPI.php:190 -msgid "Invalid serial key." -msgstr "" - -#: src/RestAPI.php:216 -msgid "Serial key is valid." -msgstr "" - -#: src/RestAPI.php:274 -msgid "Instance is already activated." -msgstr "" - -#: src/RestAPI.php:279 -msgid "Activation limit reached." -msgstr "" - -#: src/RestAPI.php:295 -msgid "Serial key is activated." -msgstr "" - -#: src/RestAPI.php:333 -msgid "Instance is missing, You must provide an instance to deactivate license." -msgstr "" - -#: src/RestAPI.php:351 -msgid "Instance not found." -msgstr "" - -#: src/RestAPI.php:359 -msgid "Serial key is deactivated." -msgstr "" - -#: src/functions.php:91 -msgid "Manually added" -msgstr "" - -#: src/functions.php:533 -#. translators: 1: product title 2: source and 3: Quantity -msgid "" -"There is not enough serial numbers for the product %1$s from selected " -"source %2$s, needed total %3$d." -msgstr "" - -#: templates/email-stock-notification.php:14 -msgid "Hi There," -msgstr "" - -#: templates/email-stock-notification.php:15 -msgid "" -"There are few products stock running low, please add serial numbers for " -"these products" -msgstr "" - -#: templates/email-stock-notification.php:37 -#. translators: %s: plugin url. -msgid "" -"The email is sent by Serial Numbers for " -"WooCommerce" -msgstr "" - -#. Plugin Name of the plugin/theme -msgid "WC Serial Numbers" -msgstr "" - -#. Plugin URI of the plugin/theme -msgid "https://www.pluginever.com/plugins/wocommerce-serial-numbers-pro/" -msgstr "" - -#. Description of the plugin/theme -msgid "" -"Sell and manage license keys/ serial numbers/ secret keys easily within " -"your WooCommerce store." -msgstr "" - -#. Author of the plugin/theme -msgid "PluginEver" -msgstr "" - -#. Author URI of the plugin/theme -msgid "http://pluginever.com" -msgstr "" \ No newline at end of file diff --git a/trunk/readme.txt b/trunk/readme.txt deleted file mode 100644 index bc60b408..00000000 --- a/trunk/readme.txt +++ /dev/null @@ -1,534 +0,0 @@ -=== WC Serial Numbers - Ultimate License Manager for Selling, Licensing & Securely Delivering Digital Content with WooCommerce === -Contributors: pluginever, manikmist09 -Tags: license manager, license, license number, serial number, activation number, key, serial key, license key, activation key, product key, serial code, license code, activation code, digital, digital downloads, digital product key, digital license, product license, software license, software license key, software activation, license key for digital products, digital product license, virtual product key, virtual product license, subscription product license, license key generator, woocommerce -Requires at least: 5.0 -Tested up to: 6.6 -Requires PHP: 7.4 -Stable tag: 1.7.7 -License: GPLv2 or later -License URI: http://www.gnu.org/licenses/gpl-2.0.html - -The easiest way to sell digital products and manage licenses with WooCommerce. - -== Description == - -= Ultimate Solution for Selling Digital Products and Content with WooCommerce = -**[WC Serial Numbers](https://pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=product-page-wordpress.org&utm_medium=product-page-wordpress.org&utm_campaign=product-page-wordpress.org)** is the most powerful WordPress license manager plugin created for WooCommerce store owners. Sell keys, manage licenses, assign serial keys to products, and keep track of customer activations, all without leaving the WooCommerce dashboard. - -WooCommerce is the best eCommerce platform out there, but lacks key features for selling digital products. WC Serial Numbers plugin bridges this gap by seamlessly integrating all the necessary functionalities. Transform your WooCommerce store into a complete digital marketplace by incorporating license management, secured and authorized distribution. - -=== 👨‍💻 This Plugin is Ideal for: === - -* Content Creators -* Developers and Digital Agencies -* Event Organizers -* License Key/Product Key Resellers -* Any Kind of Digital Product Sellers - -=== 💵 With WC Serial Numbers You Can Sell: === - -* Digital Assets (Themes, Plugins, Digital Arts, Photos, Videos, Music, NFTs, Templates) -* Digital Tools (Software, Apps, Games, Mockup) -* Digital Entries (Event Tickets, Entry Pass for Conferences, or Workshops) -* Digital Gifts (Gift Cards, Lottery, and Secret Number-based Products) -* Custom Activation Codes, License Keys, Secret Codes, Usernames & Passwords -* Online Courses & Professional Services (Tutorials, Coaching, Consultations) -* eBooks and Audiobooks -* And many more. - -Despite being the ultimate license manager for WooCommerce, Serial Numbers is versatile when it comes to use cases. For authenticating your physical products, private label them, or stop the spread of counterfeits, you can apply this technology to any tangible products. - -[**💻 Live Demo Site**](https://demo.pluginever.com/serial-numbers) | [**📄 Plugin Documentation**](https://pluginever.com/docs/woocommerce-serial-numbers) - -=== ✨ How You can benefit from using WC Serial Numbers for your businesses: === - -- **Generate Fast Revenue:** Stop worrying about the licensing management system and put all of your energy into creating and improving your products. - -- **Self-Hosted, No Platform Fees:** This allows you comprehensive control over the selling process. You are not required to pay a percentage of your earnings to the platform regardless of how many digital products you sell. - -- **Streamlined Order Fulfilment:** Automate the delivery process by generating and sending keys to customers after successful payment. This eliminates the need for manual intervention, saves time, and reduces errors. - -- **Customizable and Scalable:** Customize the format and appearance of keys to align with your brand. Additionally, the plugin is scalable and can handle a large volume of orders, ensuring smooth operations even during peak periods. - -- **Increased Customer Satisfaction:** Instant delivery of keys after purchase enhances the customer experience. Customers can immediately access and activate their products, resulting in higher satisfaction and reduced support requests. - -- **Prevent Counterfeiting and Piracy:** The plugin is capable of avoiding piracy and fraud. It's a safety net since WooCommerce store owners can verify the product is authentic and hasn't been tampered with. Those who have bought a product online can check to see if it is a legitimate copy or a fake. - - - -=== ✨ WC Serial Numbers Features: === - -- **Add Keys Manually:** You can manually enter as many keys as you wish, or you can use our powerful built-in bulk importer to do the work for you. - -- **Deliver Keys Automatically:** You have the option to auto-complete any order to send and show keys to your customer’s order details page after successful payment. This ensures a seamless and hassle-free purchase experience for your customers. - -- **Detailed Reporting:** The plugin provides comprehensive reporting and logging features, allowing you to track the usage and activation of the keys. This helps you monitor and analyze the performance of your products. - -- **Self-service:** Customers can manage their license keys and downloads for all of their associated orders at any time by logging into their accounts on the "My Account" page of your store. - -- **License Key Encryption:** To guarantee your security, the keys kept in the database are encrypted. With this plugin, you may avoid headaches and second thoughts by knowing that your license keys are secure. - -- **Key Generator (PRO):** You can control how your keys will be generated. Using the built-in license generator, you can customize your key interface rule to generate keys. The generator will allow you to generate both sequential and random keys. - -- **Automatically Generate Keys (PRO):** You can use the automatic key generation rule for a license-enabled product, our plugin will automatically generate and deliver a key to the customers whenever they purchase that product. - -- **Flexible Activation Options:** You can choose to require customers to activate their keys before accessing or using your digital products. This allows you to control access and prevent unauthorized usage. - -- **API Form for Validation, Activation, Deactivation:** Serial Numbers includes a built-in license key validator API form to validate, activate and deactivate keys without any complexity. You can also show an API form for your customers anywhere on your website using our predefined shortcode for the form. -You can also use different methods that allow you to validate, activate, and deactivate license keys as well as access the software's current version number using HTTP requests. - -- **Reuse Keys:** When a sold key is refunded or an order fails, activating this option allows you to reuse the refunded or failed keys. You don't have to be concerned about which keys are refunded or failed. - -- **Revoke Keys:** When an order is canceled or reimbursed, the key can be revoked. The key will be invalidated if the order is canceled or refunded. - -- **Simple Product Support:** Create and assign keys for simple products. You can sell keys for any of your products that fall into the group of "simple products.” - -- **Variable Product Support (PRO):** This functionality allows you to generate and assign keys for product variations of your variable products. As a result, it avoids the issue of selling license-enabled variable products. - -- **Backorder Support (PRO):** You can sell keys even when the product is out of stock, and you can assign keys to orders with a single click when they become available. - -- **Support for Expiry Dates:** For products that require time-limited access or subscription-based licensing, this plugin allows you to set expiry dates for keys. This ensures that customers cannot use the keys beyond the specified period. - -- **Bulk Import (PRO):** You may use our bulk import license for product update the serial key table with pre-existing or new keys. The bulk importer accepts CSV and TXT files. CSV importer works when you import several items at once, whereas TXT works when you import a single product with many product keys. - -- **Bulk Export (PRO):**You can export specific orders by entering Order IDs. You will be able to export keys from products based on their status, such as **Available, Sold, Refunded**, etc. You will also have options to export from fields such as product ID, and activation limit. - -- **Keys For Older Orders:** Keys can be added to previous orders by simply assigning them, and activation settings can be applied if necessary. This will assist in delivering instant updates to existing customers. - -- **Assign Keys Manually (PRO):** You can stop assigning keys automatically with the orders and you can assign them manually. This way you can control the key delivery system on your own when you'll have to assign it manually. - -- **Automated Email Delivery:** You can automatically send an email containing the assigned key to the customer after a successful purchase. This eliminates the need for manual key distribution and ensures a smooth customer experience. - -- **Twilio SMS (PRO):** Your keys can be automatically sent to your customers via SMS, courtesy of the amazing Twilio API. No more dependency on emails and no more delayed responses! Your customers will receive instant notifications with their product keys as soon as they make a purchase. - -- **Allow Duplicate Keys (PRO):** You can add and sell duplicate keys depending on your use case. This will allow you to sell the same keys with different orders from the key database. - -- **Translation (PRO):** You can translate the notification texts and warning labels as you wish. This gives you the freedom to communicate and guide your customers to proceed with operating their orders in your direction. - -- **License Key Stock Notification:** You can enable this option to receive an email notification when your stock is about to expire. You must configure your stock limit so that you receive notifications anytime a product drops below that quantity. - -- **Order Table Key Properties (PRO):** When an order is completed, your customer will receive a key both on the order page and via mail. The order details page and email both include a table with the keys and other required data. You can decide which key fields to display and you can edit each field from the order table settings menu. - -- **Powered by WooCommerce:** Enjoy the power of WooCommerce to use any payment gateway and manage orders natively. There's no need for third-party plugins, making it a seamless addition to your WooCommerce ecosystem. - -- **Useful Integrations:** Enjoy compatibility with popular plugins like WPML for multilingual support, PDF Invoice & Packing Slips for easy documentation, and multivendor sites. This plugin is designed to integrate smoothly with a wide variety of tools and platforms to enhance your store experience. - -> Maximize the potential of WC Serial Numbers plugin by unlocking all its advanced features. Get The PRO Version. - - -=== ⚡ More Upcoming Features: === - -We are constantly improving our plugin and bringing new enhancements for your connivance. We’re currently working on some exclusive features and will release them periodically. Have a look at what’s in our pipeline. - -- **Subscription Support:** You’ll have the option to sell your subscription products with the WooCommerce subscription feature. It will give you all the features and functionalities to sell keys by managing subscriptions efficiently. - -- **Rest API:** You’ll be able to operate a set of standard rules and conventions for communicating with other web-based applications and services. REST API treats everything as a resource, including a WooCommerce product. License keys are managed as resources and are accessed through endpoints that are also resources. - -- **Fast Checkout:** You’ll have the option to let your customers go through a fast checkout process if they only add digital products to their cart. With this option, customers won't have to worry about filling out fields they don't need to. - -- **Custom Emails:** You’ll have the full option to take control over sending emails to your customers. You’ll have options to disable sending emails and also you can send custom emails instead of sending default emails sent via WooCommerce itself. - -- **Key Placements:** You’ll have the option to display keys for your customers depending on your preferences. On that note, you don’t have to stick with the default key placements by the plugin. You can also choose file formats for showing your keys. - -- **Barcode Integration:** You’ll have the option to create fully functional barcodes as you know that a barcode is a visual representation of the ‘serial number’ that is located beneath it. You can input product-related data or information using available formats of barcodes. - - -== 💚 Why Creators and Digital Product Sellers Love WC Serial Numbers: == - -- **Unparalleled Features:** Serial Numbers plugin is second to none when it comes to generating serial numbers and managing licenses for your WooCommerce products. This license manager plugin is a powerhouse on its own, with features like auto-generating unique keys, integration with the REST API, and so on. - -- **Regular Updates:** The plugin is constantly being improved, and we make those improvements available to our customers at no extra cost. We release updates to ensure compatibility with WooCommerce as well as the latest version of PHP. - -- **Fast and Friendly Support:** The constant availability of our help desk and positive feedback on the reviews page for the plugin says a lot. We’re constantly working on new innovative features to give you more power. Whether you have a question or want to request a new feature, we’re just a quick message away. - - [Free support (forum)](https://wordpress.org/support/plugin/wc-serial-numbers/) - - [Premium & pre-sales support (email)](https://pluginever.com/support/) - -=== 💝 User Reviews and Testimonials: === - -WC Serial Numbers is helping tens of thousands of store owners sell and manage keys and they just love it! See all the 5-star reviews from our users [here](https://wordpress.org/support/plugin/wc-serial-numbers/reviews/?filter=5). - -=== 💢 Supercharge Your Store with Our Other WooCommerce Plugins: === - -- **[Min Max Quantities for WooCommerce](https://wordpress.org/plugins/wc-min-max-quantities "Min Max Quantities for WooCommerce")** -- **[Product Category Slider for WooCommerce](https://wordpress.org/plugins/woo-category-slider-by-pluginever "Product Category Slider for WooCommerce")** -- **[Product Category Showcase for WooCommerce](https://wordpress.org/plugins/wc-category-showcase "Product Category Showcase for WooCommerce")** -- **[Product Variation Swatches for WooCommerce](https://wordpress.org/plugins/wc-variation-swatches "Product Variation Swatches for WooCommerce")** - -Visit [PluginEver](https://pluginever.com) to learn from our WooCommerce tutorials and find out about other [WooCommerce plugins](https://pluginever.com/plugins). - -== Installation == - -= Minimum requirements = - -* WordPress 5.0 or greater -* WooCommerce 5.0 or greater -* PHP version 7.4 or greater -* MySQL version 5.6 or greater -* MariaDB version 10 or later - -= Automatic installation = - -Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't need to leave your web browser. To do an automatic install of Serial Numbers, log in to your WordPress dashboard, navigate to the Plugins menu, and click "Add New". - -In the search field type "Serial Numbers" and click Search Plugins. Once you have found the plugin you can view details about it such as the point release, rating, and description. Most importantly, of course, you can install it by simply clicking "Install Now". - -= Manual installation = - -1. Upload the plugin files to the `/wp-content/plugins/wc-serial-numbers` directory, or install the plugin through the WordPress plugins screen directly. -1. Activate the plugin through the 'Plugins' screen in WordPress - -= Updating = - -Automatic updates should work like a charm; as always though, ensure you backup your site just in case. - -== Frequently Asked Questions == - -= What is the difference between Serial Numbers and License Keys? = - -Serial Numbers can be used as product labels or product identifiers. It helps to prevent product theft and ensures complete control over your products. License Keys can be used for digital products and software activation purposes. It grants access to authorized users and makes products usable. You can even set the validity date for limit usage and set the activation limit. - -= Do I need any coding skills to operate this plugin? = - -No, you don’t need any coding or programming skills to manage the plugin. It's made to be simple and effective for your use. - -= What file types I can sell? = - -Well, there is no restrictions, and any file type can be sold with this plugin. You can sell .PDF,.DOC,.MP3,.MOV,.EPUB,.PSD,.MP4,.JPG, and any other extension that exists are supported. - -= How the keys are delivered? = - -The keys are primarily delivered to the order details page of the customer's account and to their emails. Also, you can deliver keys through SMS directly to your customer's phone numbers through the [Twilio SMS](https://pluginever.com/docs/wocommerce-serial-numbers/sms-integration-with-woocommerce-serial-numbers-pro/) feature. - -= Where can customers see their purchase history? = - -Your customers can see their purchase history within the my account section’s “Orders” menu. You can also show your users the order details and license keys available for both activation and download. - -= Can I import my own custom keys? = - -Yes, with this plugin you can sell your own custom keys and you can also bulk import your custom keys via CSV and TXT file format. - -= Can I use this plugin to provide a licensing system for my own software? = - -Yes, this plugin comes with HTTP based API integration and also has REST API functionality. You can easily integrate the license validation function in any of your software. Our plugin has a dedicated page for Software API. You can learn more from our [documentation](https://pluginever.com/docs/wocommerce-serial-numbers/woocommerce-serial-numbers-api-docs/) about how it works. - -= Does this plugin works with variable products? = - -Yes, the plugin supports variable products. You can add keys to each and every specific variation of a product. - -= Can I customize emails? = - -Yes, check out the [helpful guide](https://pluginever.com/docs/wocommerce-serial-numbers/) that we've put up on how to personalize emails. - -= What payment processors are supported? = - -WC Serial Numbers is powered by WooCommerce and it supports all the payment processors/gateways available within WooCommerce like Stripe, PayPal, Square, etc. - -= Does this plugin supports subscription/recurring payments? = - -Yes, with [WooCommerce subscription](https://woocommerce.com/products/woocommerce-subscriptions/) feature, you can create subscriptions so that customers continue paying you over time. This is great for selling memberships, courses, access passes, software licenses, and other products which require ongoing payments. - -= Is this plugin translatable? = - -Yes, all the strings in this plugin can be translated and over time we hope to offer many translations out of the box. - -= How do I upgrade to the Pro version to get access to the advanced features? = - -You can purchase the premium version of the plugin from our [website](https://pluginever.com/plugins/woocommerce-serial-numbers-pro/). - -= Can I request/suggest a new feature? = - -Yes, you are always welcome to [provide suggestions](https://github.com/pluginever/wc-serial-numbers/issues) for new features and enhancements. - -== Screenshots == -1. Serial Keys List -2. Add New Key -3. Validation Form -4. Activation Log -5. Reports Page -6. Settings Page -7. Product Page Options -8. Order Complete Email with Keys -9. Thank You Page with Keys - -== Changelog == -= 1.7.7 (31 Jul 2024) = -Enhance: Enhance optimized code for better autoload classes. -Enhance: Enhanced security. -Update: Update the WooCommence HPOS support -Fix: Few known issues. - -= 1.7.6 (30 Jul 2024) = -Enhance: Enhanced security to handle form actions. -Enhance: Enhanced security to handle Ajax search. -Enhance: Enhanced security to handle the GET & POST supper global variables. -Fix: Vulnerability security issue. -Fix: Few other known issues. - -= 1.7.5 (01 Jul 2024) = -Enhance: Enhanced security to handle form actions. -Enhance: Enhanced security to handle Ajax search. -Fix: Few known issues fixed. - -= 1.7.4 (11 Jun 2024) = -Fix: Vulnerability issue. -Fix: Shortcode permission issue. - -= 1.7.3 (12 May 2024) = -Enhance: Move query arg based API to REST API -Fix: Few known issues fixed. - -= 1.7.2 (19 Apr 2024) = -* Fix: Text domain issue fixed. - -= 1.7.1 (15 Mar 2024) = -* Fix: Few known issues fixed. - -= 1.7.0 (7 Mar 2024) = -* Fix: Few known issues fixed. - -= 1.6.9 (28 Feb 2024) = -* Fix: The keys column is missing on the order table. -* Fix: Add serial keys, Remove serial keys actions missing on the order table. - -= 1.6.8 (18 Feb 2024) = -* Fix: Compatibility with WooCommerce 8.6 - -= 1.6.7 (23 Jan 2024) = -* Fix: Compatibility with WooCommerce 8.5 - -= 1.6.6 (13 Nov 2023) = -* Fix: Compatibility with WordPress 6.4 - -= 1.6.5 (25 Oct 2023) = -* Fix: API request is not working. - -= 1.6.4 (25 Oct 2023) = -* Enhance: Optimize and improve code for better performance & security. - -= 1.6.3 (8 Oct 2023) = -* Fix: Dropdown active color is not working. -* Enhance: Allow keys to be sold without checking key source. - -= 1.6.2 (27 Sep 2023) = -* Enhance: Add compatibility with WooCommerce HPOS. - -= 1.6.1 (11 Sep 2023) = -* Fix: Conflict PHP Autoloader with other plugins. - -= 1.6.0 (28 Aug 2023) = -* Fix: Product dropdown showing HTML tags. -* Fix: Fix typo. -* Enhance: Improve `wc_serial_numbers_allow_backorder` filter. - -= 1.5.9 (16 Aug 2023) = -* Fix: Email validation is not working when email contains uppercase letters. -* Fix: Reset activations showing wrong activation count. - -= 1.5.8 (10 Aug 2023) = -* Fix: Reset activation is not showing correct activation count. -* Fix: API email validation ignore the email case sensitivity. - -= 1.5.7 (2 Aug 2023) = -* Fix: Keys page showing blank page. - -= 1.5.6 (2 Aug 2023) = -* Enhance: Key edit page UI improvement. -* Fix: Search by order ID not working in the serial numbers list page. - -= 1.5.4 (18 Jun 2023) = -* Enhance: Labels and notice texts. -* Fix: Sequential pointers with manual assigning not working properly. -* Fix: Reports filter not working. - -= 1.5.3 (14 Jun 2023) = -* Enhance: Added bulk reset action for serial keys. -* Enhance: Added product ID and Sold count in the stock report. -* Fix: API response is not showing activations. - -= 1.5.2 (24 May 2023) = -* Fix : Key properties is not sorting properly. -* Fix : Optimized the code for better performance. - -= 1.5.1 (11 April 2023) = -* Fix : Admin order details showing only 20 serial keys when bought more than 20 serial keys. -* Fix : When order status is changed from 'completed' to 'on-hold' to 'completed' serial keys added twice. - -= 1.5.0 (9 April 2023) = -* Fix : Serial keys list table not working when filter by status. -* Fix : Stock report product link not working when variable product. - -= 1.4.9 (8 April 2023) = -* Fix : Serial keys list table not showing pagination when status is sold. -* Enhance: Enhance the UI of sold serial keys in the order details page and order complete email. - -= 1.4.8 (6 April 2023) = -* Fix : Only 20 records are showing when bought more than 20 serial keys. -* Fix : Serial keys assigned only for first 2 products when bought more than 2 products. -* Fix : Action 'Edit' is not working for variable products on Report menu. -* Enhance: Add search option for serial number in the stock report table. -* Enhance: Fix duplicate key issue when importing. -* Enhance: UI improvements. - -= 1.4.7 (3 April 2023) = -* Fix : Search key by customer name is not working. -* Fix : Stock report is showing only 20 records. -* Enhance: Order table add bulk action to add/remove serial keys. -* Enhance : Add product filter in the stock report table. - -= 1.4.6 (1 April 2023) = -* Enhance: Enhanced API implementation. -* Enhance: Update Serial Number statues. -* Enhance: Add shortcodes for serial number verification and activation/deactivation. -* Enhance: Add admin tools to verify and activate/deactivate serial numbers. -* Enhance: Add plugin status page. -* Enhance: Admin support clicking to copy serial number. -* Enhance: UI improvements. -* Deprecated: Duplicate serial number feature removed. -* Fix: Few known issues fixed. - -= 1.4.5 (30 January 2023) = -* Fix: Few known issues fixed. -* Enhance: Framework updated. - -= 1.4.4 (16 January 2023) = -* Fix: Product select dropdown not working for non english languages. -* Fix: Product select dropdown search limit increased to 100. - -= 1.4.3 (15 January 2023) = -* Fix: Translation breaking page -* Fix: Reuse license key not working - -= 1.4.2 (15 January 2023 )= -* Enhancement: New settings UI with performance improvements. -* Enhancement: Optimized plugin assets. - -= 1.2.10 (20 May, 2022) = -Fix - Compatibility with WP 6.1 -Fix - Compatibility with WC 71. - -= 1.2.10 (17 May, 2022) = -Fix - Compatibility with WC v6.5.1 -Fix - Fix typo -Enhance - Enhance simple product metabox styles - -= 1.2.9 (19 December, 2021) = -* Fix - Compatibility with WP v5.8.2 -* Fix - Compatibility with WC v6.0.0 - -= 1.2.8 (27 May, 2021) = -* Fix - Compatibility with WP v5.7.2 -* Fix - Compatibility with WC v5.3.0 - -= 1.2.7 (8 September, 2020) = -* Fix - Shop manager User level: Search products do not show and decrypting key failed -* Fix - Notification email conflict -* Fix - Stock notification need to skip private products -* Fix - Activation list table serial number column is not working - -= 1.2.6 (24 August, 2020) = -* Fix - Unicode character not showing on PDF -* Fix - Translate path not found -* Enhance - Ordered serial numbers in dedicated metabox on order edit page - -= 1.2.5 (12 August, 2020) = -* Fix - Error on order edit page when contains non serial numbers - -= 1.2.4 (9 August, 2020) = -* Fix - Serial numbers are not showing in order edit page - -= 1.2.3 (3 August, 2020) = -* Fix - Order status changed on pending status -* Fix - Order edit throwing error not found order_id - -= 1.2.2 (28 July, 2020) = -* Fix - Can't add manually order - -= 1.2.1 (25 July, 2020) = -* Fix - Order email showing wrong when order contains non serial items -* Fix - Can not add manual serial numbers - -= 1.2.0 (23 July, 2020) = -* Enhance - Full rewritten plugin -* Enhance - Product tab for serial numbers -* Enhance - Serial Key list table with status, order date and expire date -* Enhance - All Settings are in one place -* Enhance - API response -* Fix - Order confirmation page needs reload -* Remove - The notification tab from admin bar - -= 1.1.3 (24 November, 2019) = -* Enhance - Improve API response -* Fix - Added compatibility with Product Input Fields -* Fix - Option to modify license validity -* Fix - WP Compatibility v5.3 - -= 1.1.2 (11 November, 2019) = -* New - Obscure serial keys in dashboard -* Enhance - Change API response -* Fix - Indexing serial number table -* Fix - WC Compatibility v3.8.0 - -= 1.1.1 (16 October, 2019) = -* New - Built-in support for leading PDF Invoice & Packing Slip plugins. -* Fix - Show auto draft products while creating serial numbers. -* Fix - Admin panel notification update latency. -* Fix - WP Compatibility v5.2.4 -* Fix - WC Compatibility v3.7.1 - -= 1.1.0 (22 September, 2019) = -* Fix - Serial number reuse is not working on paypal gateway - -= 1.0.9 (25 August, 2019) = -* Fix - WPML Support -* Fix - WP Compatibility -* Fix - WC Compatibility - -= 1.0.8 (6 July, 2019) = -* Fix - Table create failed below mysql v5.6 -* Fix - Serial number label chancing is not working on order complete page -* Fix - Creating multiple serial number for a single product when order failed - -= 1.0.7 (24 June, 2019) = -* Fix - Compatibly with WP v5.2.2 - -= 1.0.6 (18 June, 2019) = -* Fix - Plugin translation issue -* Fix - Product order page serial number limitation -* Fix - Unwanted notification for the serial number -* Fix - Empty email notification -* New - Encryption - all serial number at DB is encrypted -* Tweak - Notification moved to the background process. No more failed check. - -= 1.0.5 (24 April, 2019) = -* Fix - Serial number table not generating in sql version lower than 5.5 [#31] -* Confirm compatibility with WC 3.6.1 - -= 1.0.4 (1 April, 2019) = -* Fix - Email notification stop is not working -* Fix - Notification is showing for normal products too -* Fix - Validity takes negative value as input -* Fix - Sending serial numbers table even when order does not contains serial enabled products -* Fix - Serial number search is not working -* Enhance - Add serial number search filter -* Confirm compatibility with WC 3.5.7 - -= 1.0.3 (18 March, 2019) = -* Fix - Aroken style -* Fix - Auto-complete order -* Conditional styles/script loading - -= 1.0.2 (15 March, 2019) = -* Fix - Link from product page to add new serial number page -* Fix - Conflict with Divi theme admin design -* Fix - Compatibly with WP v5.1.1 -* Fix - Compatibly with WC v3.5.6 - -= 1.0.1 (6 March, 2019) = -* Rewrite - Key generation process -* Add - Software API -* Update - Settings -* Improve - Notification -* Fix - Bug - -= 1.0 (21 January, 2019) = -Initial release diff --git a/trunk/src/API.php b/trunk/src/API.php deleted file mode 100644 index d76cf426..00000000 --- a/trunk/src/API.php +++ /dev/null @@ -1,90 +0,0 @@ -query_vars['request'] ) ? sanitize_key( $wp->query_vars['request'] ) : ''; - $product_id = isset( $wp->query_vars['product_id'] ) ? absint( $wp->query_vars['product_id'] ) : ''; - $serial_key = isset( $wp->query_vars['serial_key'] ) ? sanitize_text_field( $wp->query_vars['serial_key'] ) : ''; - $email = isset( $wp->query_vars['email'] ) ? strtolower( sanitize_email( $wp->query_vars['email'] ) ) : ''; - $instance = isset( $wp->query_vars['instance'] ) ? sanitize_text_field( $wp->query_vars['instance'] ) : ''; - $platform = isset( $wp->query_vars['platform'] ) ? sanitize_text_field( $wp->query_vars['platform'] ) : ''; - - // if key, action or product id is missing, return error. - if ( empty( $action ) || empty( $product_id ) || empty( $serial_key ) ) { - wp_send_json_error( - array( - 'code' => 'missing_data', - 'message' => __( 'Missing data.', 'wc-serial-numbers' ), - ) - ); - } - - // end rest api base url. - $end_point = rest_url( 'wcsn/' . $action ); - $redirect_url = add_query_arg( - array( - 'product_id' => $product_id, - 'serial_key' => $serial_key, - 'request' => $action, - 'email' => $email, - 'instance' => $instance, - 'platform' => $platform, - ), - $end_point - ); - - wp_safe_redirect( $redirect_url ); - exit(); - } -} diff --git a/trunk/src/Actions.php b/trunk/src/Actions.php deleted file mode 100644 index b26fe1f2..00000000 --- a/trunk/src/Actions.php +++ /dev/null @@ -1,129 +0,0 @@ -get_product_id(); - - if ( $product_id ) { - update_post_meta( $product_id, '_is_serial_number', 'yes' ); - } - } - } - - /** - * Delete activations. - * - * @param Key $key The key object. - * - * @since 1.4.6 - */ - public static function delete_activations( $key ) { - $activations = $key->get_activations(); - if ( $activations ) { - foreach ( $activations as $activation ) { - $activation->delete(); - } - } - } - - /** - * Revoke order item keys. - * - * @param bool $revoke The revoke flag. - * - * @since 1.4.6 - */ - public static function revoke_order_item_keys( $revoke ) { - if ( 'yes' !== get_option( 'wc_serial_numbers_revoke_keys', 'yes' ) ) { - $revoke = false; - } - - return $revoke; - } - - - /** - * Update activation count. - * - * @param Activation $activation The activation object. - * - * @since 1.0.0 - */ - public static function update_activation_count( $activation ) { - $key = Key::get( $activation->get_serial_id() ); - if ( $key ) { - $key->recount_remaining_activation(); - } - } -} diff --git a/trunk/src/Admin/Actions.php b/trunk/src/Admin/Actions.php deleted file mode 100644 index 22ecbbef..00000000 --- a/trunk/src/Admin/Actions.php +++ /dev/null @@ -1,253 +0,0 @@ - esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) ); - } - - $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : ''; - $term = isset( $_POST['term'] ) ? sanitize_text_field( wp_unslash( $_POST['term'] ) ) : ''; - $limit = isset( $_POST['limit'] ) ? absint( $_POST['limit'] ) : 20; - $page = isset( $_POST['page'] ) ? absint( $_POST['page'] ) : 1; - $results = array(); - $total = 0; - $offset = ( $page - 1 ) * $limit; - - switch ( $type ) { - case 'product': - $args = array_merge( - wcsn_get_products_query_args(), - array( - 'paged' => $page, - 'posts_per_page' => $limit, - 's' => $term, - 'fields' => 'ids', - ) - ); - // if the term is numeric then search by product id. - if ( is_numeric( $term ) ) { - $args['post__in'] = array( $term ); - unset( $args['s'] ); - } - - $the_query = new \WP_Query( $args ); - $product_ids = $the_query->get_posts(); - $total = $the_query->found_posts; - foreach ( $product_ids as $product_id ) { - $product = wc_get_product( $product_id ); - - if ( ! $product ) { - continue; - } - - $text = sprintf( - '(#%1$s) %2$s', - $product->get_id(), - wp_strip_all_tags( $product->get_formatted_name() ) - ); - - $results[] = array( - 'id' => $product->get_id(), - 'text' => $text, - ); - } - break; - case 'order': - $args = array( - 'paged' => $page, - 'posts_per_page' => $limit, - 's' => $term, - 'fields' => 'ids', - 'post_type' => 'shop_order', - 'post_status' => array_keys( wc_get_order_statuses() ), - ); - // if the term is numeric then search by order id. - if ( is_numeric( $term ) ) { - $args['post__in'] = array( $term ); - unset( $args['s'] ); - } - - $the_query = new \WP_Query( $args ); - $order_ids = $the_query->get_posts(); - $total = $the_query->found_posts; - foreach ( $order_ids as $order_id ) { - $order = wc_get_order( $order_id ); - - if ( ! $order ) { - continue; - } - - $text = sprintf( - '(#%1$s) %2$s - %3$s', - $order->get_id(), - wp_strip_all_tags( $order->get_formatted_billing_full_name() ), - wp_strip_all_tags( wc_format_datetime( $order->get_date_created() ) ) - ); - - $results[] = array( - 'id' => $order->get_id(), - 'text' => $text, - ); - } - break; - - case 'customer': - case 'user': - // query wp users. - $args = array( - 'paged' => $page, - 'number' => $limit, - 'search' => '*' . $term . '*', - 'search_columns' => array( 'user_login', 'user_email', 'user_nicename' ), - 'fields' => 'ID', - ); - // if the term is numeric then search by user id. - if ( is_numeric( $term ) ) { - $args['include'] = array( $term ); - unset( $args['search'] ); - } - - $user_query = new \WP_User_Query( $args ); - $user_ids = $user_query->get_results(); - $total = $user_query->get_total(); - - foreach ( $user_ids as $user_id ) { - $user = get_user_by( 'id', $user_id ); - - if ( ! $user ) { - continue; - } - - $text = sprintf( - '(#%1$s) %2$s - %3$s', - $user->ID, - wp_strip_all_tags( $user->display_name ), - wp_strip_all_tags( $user->user_email ) - ); - - $results[] = array( - 'id' => $user->ID, - 'text' => $text, - ); - } - - break; - } - - wp_send_json( - array( - 'page' => $page, - 'results' => $results, - 'pagination' => array( - 'more' => $total > ( $offset + $limit ), - ), - ) - ); - } - - /** - * Handle add key. - * - * @since 1.0.0 - * @return void - */ - public static function handle_add_key() { - check_admin_referer( 'wcsn_add_key' ); - - // Must have WC Serial Numbers manager role to access this endpoint. - if ( ! current_user_can( wcsn_get_manager_role() ) ) { - WCSN()->add_notice( __( 'You do not have permission to perform this action.', 'wc-serial-numbers' ), 'error' ); - wp_safe_redirect( wp_get_referer() ); - exit; - } - - $data = wc_clean( wp_unslash( $_POST ) ); - $key = Key::insert( $data ); - if ( is_wp_error( $key ) ) { - WCSN()->add_notice( $key->get_error_message(), 'error' ); - // redirect to referrer. - wp_safe_redirect( wp_get_referer() ); - exit(); - } - // Adding manually so let's enable to product and set the source. - $product_id = $key->get_product_id(); - update_post_meta( $product_id, '_is_serial_number', 'yes' ); - update_post_meta( $product_id, '_serial_key_source', 'custom_source' ); - $status = isset( $data['status'] ) ? $data['status'] : ''; - } - - /** - * Handle edit key. - * - * @since 1.0.0 - * @return void - */ - public static function handle_edit_key() { - check_admin_referer( 'wcsn_edit_key' ); - - // Must have WC Serial Numbers manager role to access this endpoint. - if ( ! current_user_can( wcsn_get_manager_role() ) ) { - WCSN()->add_notice( __( 'You do not have permission to perform this action.', 'wc-serial-numbers' ), 'error' ); - wp_safe_redirect( wp_get_referer() ); - exit; - } - - $data = wc_clean( wp_unslash( $_POST ) ); - $key = Key::insert( $data ); - if ( is_wp_error( $key ) ) { - WCSN()->add_notice( $key->get_error_message(), 'error' ); - // redirect to referrer. - wp_safe_redirect( wp_get_referer() ); - exit(); - } - $add = empty( $data['id'] ) ? true : false; - if ( $add ) { - // Adding manually so let's enable to product and set the source. - $product_id = $key->get_product_id(); - update_post_meta( $product_id, '_is_serial_number', 'yes' ); - update_post_meta( $product_id, '_serial_key_source', 'custom_source' ); - - WCSN()->add_notice( __( 'Key added successfully.', 'wc-serial-numbers' ) ); - } else { - WCSN()->add_notice( __( 'Key updated successfully.', 'wc-serial-numbers' ) ); - } - - $redirect_to = admin_url( 'admin.php?page=wc-serial-numbers&edit=' . $key->get_id() ); - wp_safe_redirect( $redirect_to ); - exit; - } -} diff --git a/trunk/src/Admin/Admin.php b/trunk/src/Admin/Admin.php deleted file mode 100644 index 9d10ad4c..00000000 --- a/trunk/src/Admin/Admin.php +++ /dev/null @@ -1,186 +0,0 @@ -services['admin/settings'] = Settings::instance(); - WCSN()->services['admin/menus'] = new Menus(); - WCSN()->services['admin/notices'] = new Notices(); - WCSN()->services['admin/actions'] = new Actions(); - WCSN()->services['admin/metaboxes'] = new Metaboxes(); - WCSN()->services['admin/orders'] = new Orders(); - WCSN()->services['admin/products'] = new Products(); - } - - /** - * Enqueue admin scripts. - * - * @param string $hook Hook name. - * - * @since 1.0.0 - */ - public function enqueue_scripts( $hook ) { - if ( ! in_array( $hook, self::get_screen_ids(), true ) ) { - return; - } - wp_enqueue_style( 'jquery-ui-style' ); - wp_enqueue_style( 'select2' ); - wp_enqueue_script( 'jquery-ui-datepicker' ); - - WCSN()->enqueue_style( 'wc-serial-numbers-admin', 'css/admin-style.css' ); - WCSN()->enqueue_script( 'wc-serial-numbers-admin', 'js/admin-script.js', array( 'jquery', 'jquery-ui-datepicker', 'select2', 'wp-util' ) ); - wp_localize_script( - 'wc-serial-numbers-admin', - 'wc_serial_numbers_vars', - array( - 'i18n' => array( - 'search_product' => __( 'Search by product', 'wc-serial-numbers' ), - 'search_order' => __( 'Search by order', 'wc-serial-numbers' ), - 'search_customer' => __( 'Search by customer', 'wc-serial-numbers' ), - 'show' => __( 'Show', 'wc-serial-numbers' ), - 'hide' => __( 'Hide', 'wc-serial-numbers' ), - 'copied' => __( 'Copied', 'wc-serial-numbers' ), - ), - 'search_nonce' => wp_create_nonce( 'wc_serial_numbers_search_nonce' ), - 'ajax_nonce' => wp_create_nonce( 'wcsn_ajax_search' ), - 'ajaxurl' => admin_url( 'admin-ajax.php' ), - 'apiurl' => site_url( '?wc-api=serial-numbers-api' ), - ) - ); - - // add inline style for select2 --wp-admin-theme-color. - wp_add_inline_style( 'common', ':root{--wp-admin-theme-color:#0073aa;}' ); - } - - - /** - * Add the plugin screens to the WooCommerce screens. - * This will load the WooCommerce admin styles and scripts. - * - * @param array $ids Screen ids. - * - * @return array - */ - public function screen_ids( $ids ) { - return array_merge( $ids, self::get_screen_ids() ); - } - - /** - * Admin footer text. - * - * @param string $footer_text Footer text. - * - * @since 1.0.0 - * @return string - */ - public function admin_footer_text( $footer_text ) { - if ( WCSN()->get_review_url() && in_array( get_current_screen()->id, self::get_screen_ids(), true ) ) { - $footer_text = sprintf( - /* translators: 1: Plugin name 2: WordPress */ - __( 'Thank you for using %1$s! Share your appreciation with a five-star review %2$s.', 'wc-serial-numbers' ), - '' . esc_html( WCSN()->get_name() ) . '', - 'here' - ); - } - - return $footer_text; - } - - /** - * Update footer. - * - * @param string $footer_text Footer text. - * - * @since 1.0.0 - * @return string - */ - public function update_footer( $footer_text ) { - if ( in_array( get_current_screen()->id, self::get_screen_ids(), true ) ) { - /* translators: 1: Plugin version */ - $footer_text = sprintf( esc_html__( 'Version %s', 'wc-serial-numbers' ), WCSN()->get_version() ); - } - - return $footer_text; - } - - /** - * Get screen ids. - * - * @since 1.0.0 - * @return array - */ - public static function get_screen_ids() { - $screen_id = sanitize_title( __( 'Serial Numbers', 'wc-serial-numbers' ) ); - $screen_ids = array( - 'toplevel_page_' . $screen_id, - 'toplevel_page_wc-serial-numbers', - $screen_id . '_page_wc-serial-numbers-activations', - $screen_id . '_page_wc-serial-numbers-products', - $screen_id . '_page_wc-serial-numbers-tools', - $screen_id . '_page_wc-serial-numbers-reports', - $screen_id . '_page_wc-serial-numbers-settings', - ); - - return apply_filters( 'wc_serial_numbers_screen_ids', $screen_ids ); - } - - /** - * Render a view. - * - * @param string $view The name of the view to render. - * @param array $args The arguments to pass to the view. - * @param string $path The path to the view file. - * - * @since 1.0.0 - * @return void - */ - public static function view( $view, $args = array(), $path = '' ) { - if ( empty( $path ) ) { - $path = __DIR__ . '/views/'; - } - // replace .php extension if it was added. - $view = str_replace( '.php', '', $view ); - $view = ltrim( $view, '/' ); - $path = rtrim( $path, '/' ); - - $file = $path . '/' . $view . '.php'; - - if ( ! file_exists( $file ) ) { - return; - } - - if ( $args && is_array( $args ) ) { - extract( $args ); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract - } - - include $file; - } -} diff --git a/trunk/src/Admin/ListTables/ActivationsTable.php b/trunk/src/Admin/ListTables/ActivationsTable.php deleted file mode 100644 index 6fa0d673..00000000 --- a/trunk/src/Admin/ListTables/ActivationsTable.php +++ /dev/null @@ -1,289 +0,0 @@ - __( 'Activation', 'wc-serial-numbers' ), - 'plural' => __( 'Activations', 'wc-serial-numbers' ), - 'ajax' => false, - ) - ); - } - - /** - * Prepare table data. - * - * @since 1.4.6 - */ - public function prepare_items() { - $per_page = $this->get_items_per_page( 'wcsn_activations_per_page' ); - $columns = $this->get_columns(); - $hidden = array(); - $sortable = $this->get_sortable_columns(); - $this->_column_headers = array( $columns, $hidden, $sortable ); - $current_page = $this->get_pagenum(); - $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_SPECIAL_CHARS ); - $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_SPECIAL_CHARS ); - $search = filter_input( INPUT_GET, 's', FILTER_SANITIZE_SPECIAL_CHARS ); - $product_id = filter_input( INPUT_GET, 'product_id', FILTER_SANITIZE_NUMBER_INT ); - $order_id = filter_input( INPUT_GET, 'order_id', FILTER_SANITIZE_NUMBER_INT ); - $customer_id = filter_input( INPUT_GET, 'customer_id', FILTER_SANITIZE_NUMBER_INT ); - $id = filter_input( INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT ); - $serial_id = filter_input( INPUT_GET, 'serial_id', FILTER_SANITIZE_NUMBER_INT ); - - if ( array_key_exists( $orderby, $this->get_sortable_columns() ) && 'order_date' !== $orderby ) { - $args['orderby'] = $orderby; - } - - $args = array( - 'per_page' => $per_page, - 'paged' => $current_page, - 'orderby' => $orderby, - 'order' => $order, - 'product_id' => $product_id, - 'order_id' => $order_id, - 'customer_id' => $customer_id, - 'include' => $id, - 'search' => $search, - 'serial_id' => $serial_id, - ); - - $this->items = Activation::query( $args ); - $this->total_count = Activation::count( $args ); - - $this->set_pagination_args( - array( - 'total_items' => $this->total_count, - 'per_page' => $per_page, - 'total_pages' => $this->total_count > 0 ? ceil( $this->total_count / $per_page ) : 0, - ) - ); - } - - /** - * No items found text. - */ - public function no_items() { - esc_html_e( 'No activations found. Once a serial key is activated, it will appear here.', 'wc-serial-numbers' ); - } - - /** - * Adds the order and product filters to the licenses list. - * - * @param string $which Which nav. - */ - protected function extra_tablenav( $which ) { - if ( 'top' === $which ) { - echo '

    '; - $this->order_dropdown(); - $this->product_dropdown(); - submit_button( __( 'Filter', 'wc-serial-numbers' ), '', 'filter-action', false ); - echo '
    '; - } - } - - /** - * Process bulk action. - * - * @param string $doaction Action name. - * - * @since 1.4.6 - */ - public function process_bulk_actions( $doaction ) { - if ( $doaction && check_ajax_referer( 'bulk-activations' ) && current_user_can( wcsn_get_manager_role() ) ) { - if ( isset( $_REQUEST['id'] ) ) { - $ids = wp_parse_id_list( wp_unslash( $_REQUEST['id'] ) ); - } elseif ( isset( $_REQUEST['ids'] ) ) { - $ids = array_map( 'absint', $_REQUEST['ids'] ); - } elseif ( wp_get_referer() ) { - wp_safe_redirect( wp_get_referer() ); - exit; - } - - foreach ( $ids as $id ) { // Check the permissions on each. - $key = Activation::get( $id ); - if ( ! $key ) { - continue; - } - switch ( $doaction ) { - case 'delete': - $key->delete(); - break; - } - } - - wp_safe_redirect( wp_get_referer() ); - exit; - } - - parent::process_bulk_actions( $doaction ); - } - - /** - * Get bulk actions - * - * since 1.0.0 - * - * @return array - */ - public function get_bulk_actions() { - return array( - 'delete' => __( 'Delete', 'wc-serial-numbers' ), - ); - } - - /** - * since 1.0.0 - * - * @return array - */ - public function get_columns() { - $columns = array( - 'cb' => '', - 'instance' => __( 'Instance', 'wc-serial-numbers' ), - 'product' => __( 'Product', 'wc-serial-numbers' ), - 'serial_id' => __( 'Key', 'wc-serial-numbers' ), - 'platform' => __( 'Platform', 'wc-serial-numbers' ), - 'activation_time' => __( 'Activation Time', 'wc-serial-numbers' ), - ); - - return apply_filters( 'wc_serial_numbers_activations_table_columns', $columns ); - } - - /** - * since 1.0.0 - * - * @return array - */ - public function get_sortable_columns() { - $sortable_columns = array( - 'instance' => array( 'instance', false ), - 'serial_id' => array( 'serial_id', false ), - 'platform' => array( 'platform', false ), - 'activation_time' => array( 'activation_time', false ), - ); - - return apply_filters( 'wc_serial_numbers_activations_table_sortable_columns', $sortable_columns ); - } - - /** - * Gets the name of the primary column. - * - * @since 1.0.0 - * @access protected - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'instance'; - } - - /** - * since 1.0.0 - * - * @param object $item Item. - * - * @return string|void - */ - protected function column_cb( $item ) { - return ""; - } - - /** - * Display key. - * - * @param Activation $activation Activation. - * - * @since 1.4.6 - */ - protected function column_instance( $activation ) { - $delete_url = add_query_arg( - array( - 'id' => $activation->id, - 'action' => 'delete', - ), - admin_url( 'admin.php?page=wc-serial-numbers-activations' ) - ); - $actions['delete'] = sprintf( '%2$s', wp_nonce_url( $delete_url, 'bulk-activations' ), __( 'Delete', 'wc-serial-numbers' ) ); - - return sprintf( '%1$s %2$s', esc_html( $activation->get_instance() ), $this->row_actions( $actions ) ); - } - - /** - * Display product column. - * - * @param Activation $activation Activation. - * - * @since 1.4.6 - */ - protected function column_product( $activation ) { - return esc_html( $activation->get_product_title() ); - } - - /** - * Display key. - * - * @param Activation $activation Activation. - * - * @since 1.4.6 - */ - protected function column_serial_id( $activation ) { - $edit_url = admin_url( 'admin.php?page=wc-serial-numbers&id=' . $activation->get_serial_id() ); - - return sprintf( '#%2$s', esc_url( $edit_url ), esc_html( $activation->get_serial_id() ) ); - } - - /** - * Display platform. - * - * @param Activation $activation Activation. - * - * @since 1.4.6 - */ - protected function column_platform( $activation ) { - return empty( $activation->get_platform() ) ? '—' : esc_html( $activation->get_platform() ); - } - - /** - * Display activation time. - * - * @param Activation $activation Activation. - * - * @since 1.4.6 - */ - protected function column_activation_time( $activation ) { - return empty( $activation->get_activation_time() ) ? '—' : esc_html( $activation->get_activation_time() ); - } -} diff --git a/trunk/src/Admin/ListTables/KeysTable.php b/trunk/src/Admin/ListTables/KeysTable.php deleted file mode 100644 index 9ab8eaac..00000000 --- a/trunk/src/Admin/ListTables/KeysTable.php +++ /dev/null @@ -1,559 +0,0 @@ - __( 'key', 'wc-serial-numbers' ), - 'plural' => __( 'keys', 'wc-serial-numbers' ), - 'ajax' => false, - ) - ); - } - - /** - * Prepare table data. - * - * @since 1.4.6 - */ - public function prepare_items() { - $per_page = $this->get_items_per_page( 'wc_serial_numbers_keys_per_page' ); - $columns = $this->get_columns(); - $hidden = array(); - $sortable = $this->get_sortable_columns(); - $this->_column_headers = array( $columns, $hidden, $sortable ); - $current_page = $this->get_pagenum(); - $status = filter_input( INPUT_GET, 'status', FILTER_SANITIZE_SPECIAL_CHARS ); - $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_SPECIAL_CHARS ); - $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_SPECIAL_CHARS ); - $search = filter_input( INPUT_GET, 's', FILTER_SANITIZE_SPECIAL_CHARS ); - $product_id = filter_input( INPUT_GET, 'product_id', FILTER_SANITIZE_NUMBER_INT ); - $order_id = filter_input( INPUT_GET, 'order_id', FILTER_SANITIZE_NUMBER_INT ); - $customer_id = filter_input( INPUT_GET, 'customer_id', FILTER_SANITIZE_NUMBER_INT ); - $id = filter_input( INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT ); - - if ( ! empty( $status ) && ! array_key_exists( $status, wcsn_get_key_statuses() ) ) { - $status = 'available'; - } - - if ( array_key_exists( $orderby, $this->get_sortable_columns() ) && 'order_date' !== $orderby ) { - $args['orderby'] = $orderby; - } - - $args = array( - 'per_page' => $per_page, - 'paged' => $current_page, - 'orderby' => $orderby, - 'order' => $order, - 'status' => $status, - 'product_id' => $product_id, - 'order_id' => $order_id, - 'customer_id' => $customer_id, - 'include' => $id, - 'search' => $search, - ); - - $this->items = Key::query( $args ); - $this->available_count = Key::count( array_merge( $args, array( 'status' => 'available' ) ) ); - $this->pending_count = Key::count( array_merge( $args, array( 'status' => 'pending' ) ) ); - $this->sold_count = Key::count( array_merge( $args, array( 'status' => 'sold' ) ) ); - $this->expired_count = Key::count( array_merge( $args, array( 'status' => 'expired' ) ) ); - $this->cancelled_count = Key::count( array_merge( $args, array( 'status' => 'cancelled' ) ) ); - $this->total_count = array_sum( array( $this->available_count, $this->sold_count, $this->pending_count, $this->expired_count, $this->cancelled_count ) ); - - switch ( $status ) { - case 'available': - $total_items = $this->available_count; - break; - case 'pending': - $total_items = $this->pending_count; - break; - case 'sold': - $total_items = $this->sold_count; - break; - case 'expired': - $total_items = $this->expired_count; - break; - case 'cancelled': - $total_items = $this->cancelled_count; - break; - case 'any': - default: - $total_items = $this->total_count; - break; - } - - $this->set_pagination_args( - array( - 'total_items' => $total_items, - 'per_page' => get_user_option( 'serials_per_page' ), - 'total_pages' => $total_items > 0 ? ceil( $total_items / $per_page ) : 0, - ) - ); - } - - /** - * No items found text. - */ - public function no_items() { - printf( '%s %s', esc_html__( 'No keys found.', 'wc-serial-numbers' ), '' . esc_html__( 'Add new key', 'wc-serial-numbers' ) . '' ); - // Show a documentation about key's statuses. - ?> -

    - -

    -
      -
    • - - ‐ - -
    • -
    • - - ‐ - -
    • -
    • - - ‐ - -
    • -
    • - - ‐ - -
    • -
    • - - ‐ - -
    • -
    - (' . $this->available_count . ')'; - $pending_count = ' (' . $this->pending_count . ')'; - $sold_count = ' (' . $this->sold_count . ')'; - $expired_count = ' (' . $this->expired_count . ')'; - $cancelled_count = ' (' . $this->cancelled_count . ')'; - $total_count = ' (' . $this->total_count . ')'; - $url = admin_url( 'admin.php?page=wc-serial-numbers' ); - $views = array( - 'all' => sprintf( - '%s', - remove_query_arg( 'status', $url ), - __( 'All keys.', 'wc-serial-numbers' ), - 'all' === $current || '' === $current ? ' class="current"' : '', - __( 'All', 'wc-serial-numbers' ) . $total_count - ), - 'available' => sprintf( - '%s', - add_query_arg( 'status', 'available', $url ), - __( 'Available for sell.', 'wc-serial-numbers' ), - 'available' === $current ? ' class="current"' : '', - __( 'Available', 'wc-serial-numbers' ) . $available_count - ), - 'pending' => sprintf( - '%s', - add_query_arg( 'status', 'pending', $url ), - __( 'Pending payment.', 'wc-serial-numbers' ), - 'pending' === $current ? ' class="current"' : '', - __( 'Pending', 'wc-serial-numbers' ) . $pending_count - ), - 'sold' => sprintf( - '%s', - add_query_arg( 'status', 'sold', $url ), - __( 'Sold keys.', 'wc-serial-numbers' ), - 'sold' === $current ? ' class="current"' : '', - __( 'Sold', 'wc-serial-numbers' ) . $sold_count - ), - 'expired' => sprintf( - '%s', - add_query_arg( 'status', 'expired', $url ), - __( 'Expired keys.', 'wc-serial-numbers' ), - 'expired' === $current ? ' class="current"' : '', - __( 'Expired', 'wc-serial-numbers' ) . $expired_count - ), - 'cancelled' => sprintf( - '%s', - add_query_arg( 'status', 'cancelled', $url ), - __( 'Cancelled keys.', 'wc-serial-numbers' ), - 'cancelled' === $current ? ' class="current"' : '', - __( 'Cancelled', 'wc-serial-numbers' ) . $cancelled_count - ), - ); - - return $views; - } - - /** - * Adds the order and product filters to the licenses list. - * - * @param string $which The location of the extra table nav markup: 'top' or 'bottom'. - */ - protected function extra_tablenav( $which ) { - if ( 'top' === $which ) { - echo '
    '; - $this->order_dropdown(); - $this->product_dropdown(); - $this->customer_dropdown(); - submit_button( __( 'Filter', 'wc-serial-numbers' ), '', 'filter-action', false ); - - echo '
    '; - } - } - - /** - * Process bulk action. - * - * @param string $doaction Action name. - * - * @since 1.4.6 - */ - public function process_bulk_actions( $doaction ) { - if ( $doaction && check_ajax_referer( 'bulk-' . $this->_args['plural'] ) && current_user_can( wcsn_get_manager_role() ) ) { - if ( wp_unslash( isset( $_REQUEST['id'] ) ) ) { - $ids = wp_parse_id_list( wp_unslash( $_REQUEST['id'] ) ); - } elseif ( isset( $_REQUEST['ids'] ) ) { - $ids = array_map( 'absint', $_REQUEST['ids'] ); - } elseif ( wp_get_referer() ) { - wp_safe_redirect( wp_get_referer() ); - exit; - } - - foreach ( $ids as $id ) { // Check the permissions on each. - $key = Key::get( $id ); - if ( ! $key ) { - continue; - } - switch ( $doaction ) { - case 'delete': - $key->delete(); - break; - case 'reset_activations': - $key->reset_activations(); - break; - } - } - - wp_safe_redirect( wp_get_referer() ); - exit; - } - - parent::process_bulk_actions( $doaction ); - } - - /** - * Get bulk actions - * - * since 1.0.0 - * - * @return array - */ - public function get_bulk_actions() { - return array( - 'delete' => __( 'Delete', 'wc-serial-numbers' ), - 'reset_activations' => __( 'Reset Activations', 'wc-serial-numbers' ), - ); - } - - /** - * since 1.0.0 - * - * @return array - */ - public function get_columns() { - $columns = array( - 'cb' => '', - 'key' => __( 'Key', 'wc-serial-numbers' ), - 'product' => __( 'Product', 'wc-serial-numbers' ), - 'order' => __( 'Order', 'wc-serial-numbers' ), - 'valid_for' => __( 'Validity', 'wc-serial-numbers' ), - ); - - if ( wcsn_is_software_support_enabled() ) { - $columns['activation'] = __( 'Activation', 'wc-serial-numbers' ); - } - - $columns['order_date'] = __( 'Order Date', 'wc-serial-numbers' ); - $columns['status'] = __( 'Status', 'wc-serial-numbers' ); - - return apply_filters( 'wc_serial_numbers_keys_table_columns', $columns ); - } - - /** - * since 1.0.0 - * - * @return array - */ - public function get_sortable_columns() { - $sortable_columns = array( - 'key' => array( 'serial_key', false ), - 'product' => array( 'product_id', false ), - 'order' => array( 'order_id', false ), - 'customer' => array( 'customer', false ), - 'activation' => array( 'activation_limit', false ), - 'expire_date' => array( 'expire_date', false ), - 'valid_for' => array( 'valid_for', false ), - 'status' => array( 'status', false ), - 'order_date' => array( 'order_date', false ), - ); - - return apply_filters( 'wc_serial_numbers_keys_table_sortable_columns', $sortable_columns ); - } - - /** - * Gets the name of the primary column. - * - * @since 1.0.0 - * @access protected - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'key'; - } - - /** - * since 1.0.0 - * - * @param \StdClass $item Item. - * - * @return string|void - */ - protected function column_cb( $item ) { - return ""; - } - - /** - * Display key. - * - * @param Key $item Item. - * - * @since 1.4.6 - */ - protected function column_key( $item ) { - $is_hidden = 'yes' === get_option( 'wc_serial_numbers_hide_serial_number', 'yes' ); - $edit_url = add_query_arg( array( 'edit' => $item->id ), admin_url( 'admin.php?page=wc-serial-numbers' ) ); - $delete_url = add_query_arg( - array( - 'id' => $item->id, - 'action' => 'delete', - ), - admin_url( 'admin.php?page=wc-serial-numbers' ) - ); - // translators: %d: key id. - $actions['id'] = sprintf( __( 'ID: %d', 'wc-serial-numbers' ), esc_html( $item->id ) ); - $actions['edit'] = sprintf( '%2$s', $edit_url, __( 'Edit', 'wc-serial-numbers' ) ); - $actions['delete'] = sprintf( '%2$s', wp_nonce_url( $delete_url, 'bulk-keys' ), __( 'Delete', 'wc-serial-numbers' ) ); - - return sprintf( '%1$s %2$s', $item->print_key( $is_hidden ), $this->row_actions( $actions ) ); - } - - /** - * Display column product. - * - * @param Key $item Item. - * - * @since 1.4.6 - */ - protected function column_product( $item ) { - $product = wc_get_product( $item->product_id ); - - return empty( $item->product_id ) || empty( $product ) ? '—' : sprintf( '#%d - %s', wcsn_get_edit_product_link( $product->get_id() ), $product->get_id(), $product->get_formatted_name() ); - } - - /** - * Display column order. - * - * @param Key $item Item. - * - * @since 1.4.6 - */ - protected function column_order( $item ) { - $order = $item->get_order(); - if ( empty( $order ) ) { - return '—'; - } - - return sprintf( '#%d - %s', get_edit_post_link( $order->get_id() ), $order->get_id(), $order->get_formatted_billing_full_name() ); - } - - /** - * Display column customer. - * - * @param \StdClass $item Item. - * - * @since 1.4.6 - */ - protected function column_customer( $item ) { - if ( empty( $item->order_id ) ) { - return '—'; - } - $order = wc_get_order( $item->order_id ); - if ( empty( $order ) || empty( $order->get_id() ) ) { - return '—'; - } - - return sprintf( - '%s (#%d - %s)', - get_edit_user_link( $order->get_customer_id() ), - $order->get_formatted_billing_full_name(), - $order->get_customer_id(), - $order->get_billing_email() - ); - } - - /** - * Display column activation. - * - * @param Key $key Key object. - * - * @since 1.4.6 - */ - protected function column_activation( $key ) { - $limit = ! empty( $key->activation_limit ) ? $key->activation_limit : '∞'; - $count = (int) $key->activation_count; - $link = add_query_arg( - array( - 'serial_id' => $key->id, - 'page' => 'wc-serial-numbers-activations', - ), - admin_url( 'admin.php' ) - ); - - $activated = sprintf( '%s', $link, $count ); - - return sprintf( '%s / %s', $activated, $limit ); - } - - /** - * Display column valid for. - * - * @param Key $key Key object. - * - * @since 1.4.6 - */ - protected function column_valid_for( $key ) { - if ( ! empty( $key->get_validity() ) ) { - return wp_kses_post( - sprintf( - // translators: %1$s: validity, %2$s: validity. - _n( - '%s Day
    After purchase', - '%s Days
    After purchase', - $key->get_validity(), - 'wc-serial-numbers' - ), - number_format_i18n( $key->get_validity() ) - ) - ); - } - return __( 'Lifetime', 'wc-serial-numbers' ); - } - - /** - * Display column order date. - * - * @param Key $key Key object. - * - * @since 1.4.6 - */ - protected function column_order_date( $key ) { - if ( ! empty( $key->order_date ) && '0000-00-00 00:00:00' !== $key->order_date ) { - return wp_date( get_option( 'date_format' ), strtotime( $key->order_date ) ); - } - return '—'; - } - - /** - * Display column status. - * - * @param Key $key Key object. - * - * @since 1.4.6 - */ - protected function column_status( $key ) { - return sprintf( "%s", sanitize_html_class( $key->status ), ucfirst( $key->status ) ); - } -} diff --git a/trunk/src/Admin/ListTables/ListTable.php b/trunk/src/Admin/ListTables/ListTable.php deleted file mode 100644 index 1c527375..00000000 --- a/trunk/src/Admin/ListTables/ListTable.php +++ /dev/null @@ -1,208 +0,0 @@ -get_request_var( 's', '' ); - } - - /** - * Retrieve the order query string. - * - * @since 1.4.6 - * @return string Order query. - */ - protected function get_order() { - return $this->get_request_var( 'order', 'DESC' ); - } - - /** - * Retrieve the orderby query string. - * - * @since 1.4.6 - * @return string Orderby query. - */ - protected function get_orderby() { - return $this->get_request_var( 'orderby', 'date' ); - } - - /** - * Retrieve the page query string. - * - * @since 1.4.6 - * @return string Page query. - */ - protected function get_page() { - return $this->get_request_var( 'page', '' ); - } - - /** - * Retrieve the current page URL. - * - * @since 1.4.6 - * @return string Current page URL. - */ - protected function get_current_page_url() { - $page = $this->get_page(); - - // Build the base URL. - return add_query_arg( 'page', $page, admin_url( 'admin.php' ) ); - } - - /** - * Show the search field - * - * @param string $text Label for the search box. - * @param string $input_id ID of the search box. - * - * @since 1.4.6 - * @return void - */ - public function search_box( $text, $input_id ) { - if ( empty( $this->get_search() ) && ! $this->has_items() ) { - return; - } - - $input_id = $input_id . '-search-input'; - $orderby = $this->get_orderby(); - $order = $this->get_order(); - - if ( ! empty( $orderby ) ) { - echo ''; - } - if ( ! empty( $order ) ) { - echo ''; - } - ?> - - - - - - - - - - - __( 'stock', 'wc-serial-numbers' ), - 'plural' => __( 'stocks', 'wc-serial-numbers' ), - 'ajax' => false, - ) - ); - } - - /** - * Prepare table data. - * - * @since 1.4.6 - */ - public function prepare_items() { - $per_page = 20; - $columns = $this->get_columns(); - $hidden = array(); - $sortable = $this->get_sortable_columns(); - $this->_column_headers = array( $columns, $hidden, $sortable ); - $current_page = $this->get_pagenum(); - $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_SPECIAL_CHARS ); - $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_SPECIAL_CHARS ); - $search = filter_input( INPUT_GET, 's', FILTER_SANITIZE_SPECIAL_CHARS ); - $product_id = filter_input( INPUT_GET, 'product_id', FILTER_SANITIZE_NUMBER_INT ); - - $query_args = array( - 'posts_per_page' => $per_page, - 'fields' => 'ids', - 's' => $search, - 'paged' => $current_page, - 'orderby' => $orderby, - 'order' => $order, - 'post__in' => $product_id ? wp_parse_id_list( $product_id ) : array(), - ); - $post_ids = wcsn_get_products( $query_args ); - - $this->items = array_map( 'wc_get_product', $post_ids ); - $this->total_count = wcsn_get_products( array_merge( $query_args, array( 'count' => true ) ) ); - $this->set_pagination_args( - array( - 'total_items' => $this->total_count, - 'per_page' => $per_page, - 'total_pages' => $this->total_count > 0 ? ceil( $this->total_count / $per_page ) : 0, - ) - ); - } - - /** - * No items found text. - */ - public function no_items() { - esc_html_e( 'No products selling serial keys from "stock" found.', 'wc-serial-numbers' ); - } - - /** - * Adds the order and product filters to the licenses list. - * - * @param string $which The location of the extra table nav markup: 'top' or 'bottom'. - */ - protected function extra_tablenav( $which ) { - if ( 'top' === $which ) { - echo '
    '; - $this->product_dropdown(); - submit_button( __( 'Filter', 'wc-serial-numbers' ), '', 'filter-action', false ); - - echo '
    '; - } - } - - /** - * since 1.0.0 - * - * @return array - */ - public function get_columns() { - $columns = array( - 'product' => __( 'Product', 'wc-serial-numbers' ), - 'source' => __( 'Source', 'wc-serial-numbers' ), - 'sold' => __( 'Sold', 'wc-serial-numbers' ), - 'stock' => __( 'Stock', 'wc-serial-numbers' ), - ); - - return apply_filters( 'wc_serial_numbers_stock_table_columns', $columns ); - } - - /** - * since 1.0.0 - * - * @return array - */ - public function get_sortable_columns() { - $columns = array( - 'product' => array( 'product_id', false ), - ); - - return apply_filters( 'wc_serial_numbers_stock_table_sortable_columns', $columns ); - } - - /** - * Gets the name of the primary column. - * - * @since 1.0.0 - * @access protected - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'product'; - } - - /** - * since 1.0.0 - * - * @param \WC_Product $item The current item. - * - * @return string - */ - public function column_product( $item ) { - $product_id = $item->get_id(); - $product = wc_get_product( $product_id ); - $title = $product->get_formatted_name(); - $edit_link = wcsn_get_edit_product_link( $product_id ); - - $actions = array( - 'id' => sprintf( 'ID: %d', esc_attr( $item->get_id() ) ), - 'edit' => sprintf( '%s', esc_url( $edit_link ), esc_html__( 'Edit', 'wc-serial-numbers' ) ), - ); - - return sprintf( '%s %s', esc_url( $edit_link ), wp_kses_post( $title ), $this->row_actions( $actions ) ); - } - - /** - * since 1.0.0 - * - * @param \WC_Product $item The current item. - * @param string $column_name The current column name. - * - * @return string - */ - public function column_default( $item, $column_name ) { - switch ( $column_name ) { - case 'sold': - $sold_count = wcsn_get_keys( - array( - 'status__in' => array( 'sold', 'expired' ), - 'product_id' => $item->get_id(), - 'count' => true, - ) - ); - - return number_format_i18n( $sold_count ); - case 'source': - $source = get_post_meta( $item->get_id(), '_serial_key_source', true ); - if ( 'custom_source' === $source ) { - $label = esc_html__( 'Manual', 'wc-serial-numbers' ); - } elseif ( 'generator_rule' === $source ) { - $label = esc_html__( 'Generator Rule', 'wc-serial-numbers' ); - } elseif ( 'auto_generated' === $source ) { - $label = esc_html__( 'Auto Generated', 'wc-serial-numbers' ); - } else { - $label = esc_html__( 'Unknown', 'wc-serial-numbers' ); - } - - return $label; - - case 'stock': - $stocks = wcsn_get_stocks_count(); - if ( array_key_exists( $item->get_id(), $stocks ) ) { - $stock = number_format_i18n( $stocks[ $item->get_id() ] ); - $link = admin_url( 'admin.php?page=wc-serial-numbers&status=available&product_id=' . $item->get_id() ); - - return sprintf( '%s', esc_url( $link ), $stock ); - } else { - return '—'; - } - default: - return apply_filters( 'wc_serial_numbers_stock_table_column_content', '', $item, $column_name ); - } - } -} diff --git a/trunk/src/Admin/Menus.php b/trunk/src/Admin/Menus.php deleted file mode 100644 index e97ae3d0..00000000 --- a/trunk/src/Admin/Menus.php +++ /dev/null @@ -1,518 +0,0 @@ -id ) ? $screen->id : ''; - } - - // Ensure the table handler is only loaded once. Prevents multiple loads if a plugin calls check_ajax_referer many times. - remove_action( 'current_screen', array( $this, 'setup_screen' ) ); - remove_action( 'check_ajax_referer', array( $this, 'setup_screen' ) ); - } - - /** - * Validate screen options on update. - * - * @param bool|int $status Screen option value. Default false to skip. - * @param string $option The option name. - * @param int $value The number of rows to use. - */ - public function save_screen_options( $status, $option, $value ) { - if ( in_array( $option, array( 'wsn_keys_per_page', 'wsn_generators_per_page', 'wsn_activations_per_page' ), true ) ) { - return $value; - } - - return $status; - } - - /** - * Add menu. - * - * @since 1.0.0 - * @return void - */ - public function main_menu() { - $role = wcsn_get_manager_role(); - add_menu_page( - __( 'Serial Numbers', 'wc-serial-numbers' ), - __( 'Serial Numbers', 'wc-serial-numbers' ), - $role, - 'wc-serial-numbers', - null, - 'dashicons-lock', - '55.9' - ); - - add_submenu_page( - 'wc-serial-numbers', - __( 'Serial Keys', 'wc-serial-numbers' ), - __( 'Serial Keys', 'wc-serial-numbers' ), - $role, - 'wc-serial-numbers', - array( $this, 'output_main_page' ) - ); - } - - /** - * Add activations menu. - * - * @since 1.0.0 - * @return void - */ - public function activations_menu() { - if ( ! wcsn_is_software_support_enabled() ) { - return; - } - add_submenu_page( - 'wc-serial-numbers', - __( 'Activations', 'wc-serial-numbers' ), - __( 'Activations', 'wc-serial-numbers' ), - wcsn_get_manager_role(), - 'wc-serial-numbers-activations', - array( $this, 'output_activations_page' ) - ); - } - - /** - * Add tools menu. - * - * @since 1.0.0 - * @return void - */ - public function tools_menu() { - add_submenu_page( - 'wc-serial-numbers', - __( 'Tools', 'wc-serial-numbers' ), - __( 'Tools', 'wc-serial-numbers' ), - wcsn_get_manager_role(), - 'wc-serial-numbers-tools', - array( $this, 'output_tools_page' ) - ); - } - - /** - * Add reports menu. - * - * @since 1.0.0 - * @return void - */ - public function reports_menu() { - add_submenu_page( - 'wc-serial-numbers', - __( 'Reports', 'wc-serial-numbers' ), - __( 'Reports', 'wc-serial-numbers' ), - wcsn_get_manager_role(), - 'wc-serial-numbers-reports', - array( $this, 'output_reports_page' ) - ); - } - - /** - * Settings menu. - * - * @since 1.0.0 - * @return void - */ - public function settings_menu() { - add_submenu_page( - 'wc-serial-numbers', - __( 'Settings', 'wc-serial-numbers' ), - __( 'Settings', 'wc-serial-numbers' ), - wcsn_get_manager_role(), - 'wc-serial-numbers-settings', - array( Settings::class, 'output' ) - ); - } - - /** - * Add promo Menu. - * - * @since 1.0.0 - * @return void - */ - public function promo_menu() { - $role = wcsn_get_manager_role(); - if ( ! WCSN()->is_premium_active() ) { - add_submenu_page( - 'wc-serial-numbers', - '', - ' ' . __( 'Upgrade to Pro', 'wc-serial-numbers' ) . '', - $role, - 'go_wcsn_pro', - array( $this, 'go_pro_redirect' ) - ); - } - } - - /** - * Output keys page. - * - * @since 1.0.0 - * @return void - */ - public function output_main_page() { - wp_verify_nonce( '_nonce' ); - $add = isset( $_GET['add'] ) ? true : false; - $edit = isset( $_GET['edit'] ) ? absint( $_GET['edit'] ) : 0; - if ( $edit ) { - $key = new Key( $edit ); - if ( ! $key->exists() ) { - wp_safe_redirect( remove_query_arg( 'edit' ) ); - exit(); - } - } - - if ( $add ) { - $key = new Key(); - include __DIR__ . '/views/html-edit-key.php'; - } elseif ( $edit ) { - include __DIR__ . '/views/html-edit-key.php'; - } else { - include __DIR__ . '/views/html-list-keys.php'; - } - } - - /** - * Output activations page. - * - * @since 1.0.0 - * @return void - */ - public function output_activations_page() { - Admin::view( 'html-list-activations.php' ); - } - - - /** - * Output tools page. - * - * @since 1.0.0 - * @return void - */ - public function output_tools_page() { - wp_verify_nonce( '_nonce' ); - $tabs = array( - 'generators' => __( 'Generators', 'wc-serial-numbers' ), - 'api' => __( 'API Toolkit', 'wc-serial-numbers' ), - 'import' => __( 'Import', 'wc-serial-numbers' ), - 'export' => __( 'Export', 'wc-serial-numbers' ), - ); - - // If software support is disabled, remove the activations tab. - if ( ! wcsn_is_software_support_enabled() ) { - unset( $tabs['api'] ); - } - - $tabs = apply_filters( 'wc_serial_numbers_tools_tabs', $tabs ); - $tab_ids = array_keys( $tabs ); - $current_tab = isset( $_GET['tab'] ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : reset( $tab_ids ); - $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; - - Admin::view( - 'html-tools.php', - array( - 'tabs' => $tabs, - 'current_tab' => $current_tab, - 'page' => $page, - ) - ); - } - - /** - * Output reports page. - * - * @since 1.0.0 - * @return void - */ - public function output_reports_page() { - wp_verify_nonce( '_nonce' ); - $tabs = array( - 'stock' => __( 'Stock', 'wc-serial-numbers' ), - ); - - $tabs = apply_filters( 'wc_serial_numbers_reports_tabs', $tabs ); - $tab_ids = array_keys( $tabs ); - $current_tab = isset( $_GET['tab'] ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : reset( $tab_ids ); - $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; - - Admin::view( - 'html-reports.php', - array( - 'tabs' => $tabs, - 'current_tab' => $current_tab, - 'page' => $page, - ) - ); - } - - /** - * Redirect to pro page. - * - * @since 1.0.0 - * @return void - */ - public function go_pro_redirect() { - wp_verify_nonce( '_nonce' ); - if ( isset( $_GET['page'] ) && 'go_wcsn_pro' === $_GET['page'] ) { - wp_safe_redirect( 'https://pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=admin-menu&utm_medium=link&utm_campaign=upgrade&utm_id=wc-serial-numbers' ); - die; - } - } - - /** - * Add status tab. - * - * @param array $tabs Tabs. - * - * @return array - */ - public static function add_tools_status_tab( $tabs ) { - $tabs['status'] = __( 'Status', 'wc-serial-numbers' ); - - return $tabs; - } - - /** - * Import tab content. - * - * @since 1.0.0 - * @return void - */ - public static function import_tab() { - ?> -
    -
    -

    - -
    - <?php esc_attr_e( 'Import Serial Numbers', 'wc-serial-numbers' ); ?> -
    -
    -
    -

    - -
    - <?php esc_attr_e( 'Import Serial Numbers', 'wc-serial-numbers' ); ?> -
    - -
    -
    -

    - -
    - <?php esc_attr_e( 'Export Serial Numbers', 'wc-serial-numbers' ); ?> -
    - -
    -
    -

    - -
    - <?php esc_attr_e( 'Generators', 'wc-serial-numbers' ); ?> -
    - WCSN()->get_version(), - ); - if ( WCSN()->is_premium_active() && function_exists( 'wc_serial_numbers_pro' ) ) { - $statuses['Serial Numbers Pro version'] = WCSN_PRO()->get_version(); - } - - // Check if required tables exist. - $required_tables = array( - 'serial_numbers', - 'serial_numbers_activations', - ); - foreach ( $required_tables as $table ) { - $exists = $GLOBALS['wpdb']->get_var( $GLOBALS['wpdb']->prepare( 'SHOW TABLES LIKE %s', $GLOBALS['wpdb']->prefix . $table ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared - if ( $exists ) { - $statuses[ $table ] = __( 'Table exists', 'wc-serial-numbers' ); - } else { - $statuses[ $table ] = __( 'Table does not exist', 'wc-serial-numbers' ); - } - } - - // Cron jobs. - $cron_jobs = array( - 'wc_serial_numbers_hourly_event' => __( 'Hourly cron', 'wc-serial-numbers' ), - 'wc_serial_numbers_daily_event' => __( 'Daily cron', 'wc-serial-numbers' ), - ); - foreach ( $cron_jobs as $cron_job => $cron_job_name ) { - $next_scheduled = wp_next_scheduled( $cron_job ); - if ( $next_scheduled ) { - // translators: %s: Next scheduled time. - $statuses[ $cron_job_name ] = sprintf( __( 'Next run: %s', 'wc-serial-numbers' ), esc_html( date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $next_scheduled ) ) ); - } else { - $statuses[ $cron_job_name ] = __( 'Not scheduled', 'wc-serial-numbers' ); - } - } - $statuses = apply_filters( 'wc_serial_numbers_plugin_statuses', $statuses ); - ?> - - - - - - - - $value ) : ?> - - - - - - - - -

    - - - 1, - 'fields' => 'ids', - ) - ); - $the_query = new \WP_Query( $args ); - $product_ids = $the_query->get_posts(); - $products = array(); - foreach ( $product_ids as $product_id ) { - $product = wc_get_product( $product_id ); - if ( ! $product ) { - continue; - } - $products[ $product->get_id() ] = sprintf( '%s (#%d)', $product->get_name(), $product->get_id() ); - } - - Admin::view( 'html-api-validation', array( 'products' => $products ) ); - } - - /** - * Activation deactivation section. - * - * @since 1.4.6 - * @return void - */ - public static function api_activation_deactivation_section() { - $args = array_merge( - wcsn_get_products_query_args(), - array( - 'posts_per_page' => - 1, - 'fields' => 'ids', - ) - ); - $the_query = new \WP_Query( $args ); - $product_ids = $the_query->get_posts(); - $products = array(); - foreach ( $product_ids as $product_id ) { - $product = wc_get_product( $product_id ); - if ( ! $product ) { - continue; - } - $products[ $product->get_id() ] = sprintf( '%s (#%d)', $product->get_name(), $product->get_id() ); - } - - Admin::view( 'html-api-actions', array( 'products' => $products ) ); - } - - /** - * Stock section. - * - * @since 1.4.6 - * @return void - */ - public static function reports_stock_tab() { - Admin::view( 'html-list-stock' ); - } -} diff --git a/trunk/src/Admin/Metaboxes.php b/trunk/src/Admin/Metaboxes.php deleted file mode 100644 index bbaa3558..00000000 --- a/trunk/src/Admin/Metaboxes.php +++ /dev/null @@ -1,283 +0,0 @@ - __( 'Serial Numbers', 'wc-serial-numbers' ), - 'target' => 'wc_serial_numbers_data', - 'class' => array( 'show_if_simple' ), - 'priority' => 11, - ); - - return $tabs; - } - - /** - * since 1.0.0 - */ - public static function product_write_panel() { - global $post, $woocommerce; - ?> - - is_premium_active() ) { - echo wp_kses_post( - sprintf( - '

    %s %s

    ', - __( 'The free version of Serial Numbers for WooCommerce does not support product variation.', 'wc-serial-numbers' ), - 'https://www.pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=product_page_license_area&utm_medium=link&utm_campaign=wc-serial-numbers&utm_content=Upgrade%20to%20Pro', - __( 'Upgrade to Pro', 'wc-serial-numbers' ) - ) - ); - } - } - - /** - * since 1.0.0 - */ - public static function product_save_data() { - global $post; - if ( ! isset( $_POST['woocommerce_meta_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['woocommerce_meta_nonce'] ) ), 'woocommerce_save_data' ) ) { - return; - } - - // Must have WC Serial Numbers manager role to access this endpoint. - if ( ! current_user_can( wcsn_get_manager_role() ) ) { - return; - } - - $status = isset( $_POST['_is_serial_number'] ) ? 'yes' : 'no'; - $source = isset( $_POST['_serial_key_source'] ) ? sanitize_text_field( wp_unslash( $_POST['_serial_key_source'] ) ) : 'custom_source'; - update_post_meta( $post->ID, '_is_serial_number', $status ); - update_post_meta( $post->ID, '_serial_key_source', $source ); - // save only if software licensing enabled. - if ( wcsn_is_software_support_enabled() ) { - $software_version = isset( $_POST['_software_version'] ) ? sanitize_text_field( wp_unslash( $_POST['_software_version'] ) ) : ''; - update_post_meta( $post->ID, '_software_version', $software_version ); - } - - do_action( 'wcsn_save_simple_product_meta', $post ); - } - - - /** - * Display serial numbers in order item meta. - * - * @param int $o_item_id order item id. - * @param \WC_Order_Item $o_item order item object. - * @param \WC_Product $product product object. - * - * @since 1.1.6 - * - * @return void - */ - public function order_itemmeta( $o_item_id, $o_item, $product ) { - global $post; - if ( ! is_object( $post ) || ! isset( $post->ID ) ) { - return; - } - - $order = wc_get_order( $post->ID ); - - // bail for no order. - if ( ! $order ) { - return; - } - - if ( 'completed' !== $order->get_status( 'edit' ) ) { - return; - } - - // if this is not product then no need to process. - if ( empty( $product ) ) { - return; - } - - if ( 'yes' !== get_post_meta( $product->get_id(), '_is_serial_number', true ) ) { - return; - } - - $items = wcsn_get_keys( - array( - 'order_id' => $post->ID, - 'product_id' => $product->get_id(), - ) - ); - - if ( empty( $items ) && $order ) { - echo wp_kses_post( - sprintf( - '
    %s
    ', - __( 'Order missing serial numbers for this item.', 'wc-serial-numbers' ) - ) - ); - return; - } - - $url = admin_url( 'admin.php?page=wc-serial-numbers' ); - printf( - '
    %s→', - esc_url( - add_query_arg( - array( - 'order_id' => $post->ID, - 'product_id' => $product->get_id(), - ), - $url - ) - ), - esc_html__( 'Serial Numbers', 'wc-serial-numbers' ) - ); - - $url = admin_url( 'admin.php?page=wc-serial-numbers' ); - - $li = ''; - - foreach ( $items as $item ) { - $li .= sprintf( - '
  •  %s
  • ', - add_query_arg( - array( - 'edit' => $item->id, - ), - $url - ), - wcsn_decrypt_key( $item->serial_key ) - ); - } - echo wp_kses_post( - sprintf( - '
      %s
    ', - $li - ) - ); - } -} diff --git a/trunk/src/Admin/Notices.php b/trunk/src/Admin/Notices.php deleted file mode 100644 index 0e71a552..00000000 --- a/trunk/src/Admin/Notices.php +++ /dev/null @@ -1,166 +0,0 @@ -get_version() && version_compare( wc_serial_numbers_pro()->get_version(), '1.2.1', '<' ); - } - if ( $is_outdated_pro ) { - $this->notices[] = array( - 'type' => 'error', // add notice-alt and notice-large class. - 'message' => sprintf( - /* translators: %1$s: link to the plugin page, %2$s: link to the plugin page */ - __( '%s is not functional because you are using outdated version of the plugin, please update to the version 1.2.1 or higher.', 'wc-serial-numbers' ), - 'WC Serial Numbers Pro' - ), - ); - } - - if ( ! $this->is_notice_dismissed( 'wc_serial_numbers_upgrade_to_pro_wcsnpro10' ) && ! function_exists( 'wc_serial_numbers_pro' ) ) { - $this->notices[] = array( - 'type' => 'info', - 'classes' => 'notice-alt notice-large', - 'dismissible' => true, - 'id' => 'wc_serial_numbers_upgrade_to_pro_wcsnpro10', - 'message' => sprintf( - /* translators: %1$s: link to the plugin page, %2$s: link to the plugin page */ - __( 'Upgrade to %6$s to unlock the full potential of %5$s and avail a %1$s discount by using the promo code %2$s. %3$s Upgrade Now%4$s.', 'wc-serial-numbers' ), - '10%', - 'WCSNPRO10', - '', - '', - '' . WCSN()->get_name() . '', - 'PRO' - ), - ); - } - } - - /** - * Admin notices. - * - * @since 1.0.0 - */ - public function output_notices() { - foreach ( $this->notices as $notice ) { - $notice = wp_parse_args( - $notice, - array( - 'id' => wp_generate_password( 12, false ), - 'type' => 'info', - 'classes' => '', - 'message' => '', - 'dismissible' => false, - ) - ); - - $notice_classes = array( 'notice', 'notice-' . $notice['type'] ); - if ( $notice['dismissible'] ) { - $notice_classes[] = 'is-dismissible'; - } - if ( $notice['classes'] ) { - $notice_classes[] = $notice['classes']; - } - ?> -
    -

    -
    - - - get_id(); - $action = current_action(); - $action = str_replace( 'woocommerce_order_action_', '', $action ); - if ( 'wcsn_add_keys' === $action ) { - wcsn_order_update_keys( $order_id ); - // add a notice. - WCSN()->add_notice( __( 'Serial keys added successfully to the order.', 'wc-serial-numbers' ) ); - } elseif ( 'wcsn_remove_keys' === $action ) { - wcsn_order_remove_keys( $order_id ); - // add a notice. - WCSN()->add_notice( __( 'Serial keys removed successfully from the order.', 'wc-serial-numbers' ) ); - } - } - - /** - * Add order serial column. - * - * @param array $columns Order columns. - * - * @since 1.2.0 - * @return array|string[] - */ - public static function add_order_serial_column( $columns ) { - $position = 3; - $new = array_slice( $columns, 0, $position, true ) + array( 'order_serials' => '' ) + array_slice( $columns, $position, count( $columns ) - $position, true ); - - return $new; - } - - /** - * Add order serial column content. - * - * @param string $column Column name. - * @param int $order_id Order ID. - * - * @since 1.2.0 - */ - public static function add_order_serial_column_content( $column, $order_id ) { - - $order_status = wc_get_order( $order_id )->get_status(); - - if ( 'order_serials' === $column ) { - if ( ! wcsn_order_has_products( $order_id ) || ! in_array( $order_status, array( 'completed', 'processing' ), true ) ) { - echo '—'; - } else { - if ( wcsn_order_is_fullfilled( $order_id ) ) { - $style = 'color:green'; - $title = __( 'Order is fullfilled.', 'wc-serial-numbers' ); - } else { - $style = 'color:red'; - $title = __( 'Order is not fullfilled.', 'wc-serial-numbers' ); - } - $url = add_query_arg( array( 'order_id' => $order_id ), admin_url( 'admin.php?page=wc-serial-numbers' ) ); - printf( '', esc_url( $url ), esc_html( $title ), esc_attr( $style ) ); - } - } - } - - /** - * HPOS Add order serial column content. - * - * @param string $column Column name. - * @param int $order_id Order ID. - * - * @since 1.6.9 - */ - public static function hpos_add_order_serial_column_content( $column, $order_id ) { - - $order = wc_get_order( $order_id ); - - $order_id = $order->get_id(); - $order_status = $order->get_status(); - - if ( 'order_serials' === $column ) { - if ( ! wcsn_order_has_products( $order_id ) || ! in_array( $order_status, array( 'completed', 'processing' ), true ) ) { - echo '—'; - } else { - if ( wcsn_order_is_fullfilled( $order_id ) ) { - $style = 'color:green'; - $title = __( 'Order is fullfilled.', 'wc-serial-numbers' ); - } else { - $style = 'color:red'; - $title = __( 'Order is not fullfilled.', 'wc-serial-numbers' ); - } - $url = add_query_arg( array( 'order_id' => $order_id ), admin_url( 'admin.php?page=wc-serial-numbers' ) ); - printf( '', esc_url( $url ), esc_html( $title ), esc_attr( $style ) ); - } - } - } - - /** - * Add order bulk action. - * - * @param array $actions Order actions. - * - * @since 1.2.0 - * @return array - */ - public function add_order_bulk_action( $actions ) { - $actions['wcsn_add_keys'] = __( 'Add serial keys', 'wc-serial-numbers' ); - $actions['wcsn_remove_keys'] = __( 'Remove serial keys', 'wc-serial-numbers' ); - - return $actions; - } - - /** - * Handle order bulk action. - * - * @param string $redirect_to Redirect URL. - * @param string $action Action name. - * @param array $order_ids Order IDs. - * - * @since 1.2.0 - * @return string - */ - public function handle_order_bulk_action( $redirect_to, $action, $order_ids ) { - if ( in_array( $action, array( 'wcsn_add_keys', 'wcsn_remove_keys' ), true ) ) { - foreach ( $order_ids as $order_id ) { - switch ( $action ) { - case 'wcsn_add_keys': - wcsn_order_update_keys( $order_id ); - break; - case 'wcsn_remove_keys': - wcsn_order_remove_keys( $order_id ); - break; - } - } - // Translators: %d: number of orders. - WCSN()->add_notice( sprintf( __( '%d orders updated successfully.', 'wc-serial-numbers' ), count( $order_ids ) ) ); - $redirect_to = add_query_arg( 'bulk_action', $action, $redirect_to ); - } - - return $redirect_to; - } - - /** - * Show order item meta. - * - * @param int $item_id Item ID. - * @param \WC_Order_Item $item Item. - * @param \WC_Product $product Product. - * - * @since 1.0.0 - */ - public static function display_order_item_meta( $item_id, $item, $product ) { - $order_id = wc_get_order_id_by_order_item_id( $item_id ); - if ( ! $order_id || ! $product || ! wcsn_is_product_enabled( $product->get_id() ) ) { - return; - } - $keys = wcsn_get_keys( - array( - 'order_id' => $order_id, - 'product_id' => $product->get_id(), - 'limit' => - 1, - ) - ); - - if ( empty( $keys ) ) { - return; - } - - echo '

    ' . esc_html__( 'Serial keys sold with this product:', 'wc-serial-numbers' ) . '

    '; - - foreach ( $keys as $index => $key ) { - $data = array( - 'key' => array( - 'label' => __( 'Key', 'wc-serial-numbers' ), - 'value' => '' . $key->get_key() . '', - ), - 'expire_date' => array( - 'label' => __( 'Expire date', 'wc-serial-numbers' ), - 'value' => $key->get_expire_date() ? $key->get_expire_date() : __( 'Lifetime', 'wc-serial-numbers' ), - ), - 'activation_limit' => array( - 'label' => __( 'Activation limit', 'wc-serial-numbers' ), - 'value' => $key->get_activation_limit() ? $key->get_activation_limit() : __( 'Unlimited', 'wc-serial-numbers' ), - ), - 'status' => array( - 'label' => __( 'Status', 'wc-serial-numbers' ), - 'value' => $key->get_status_label(), - ), - ); - - $data = apply_filters( 'wc_serial_numbers_admin_order_item_data', $data, $key, $item, $product, $order_id ); - if ( empty( $data ) ) { - continue; - } - - ?> - - - - - - $field ) : ?> - - - - - - - - - -
    - - -
    :
    - -
    - - - __( 'General', 'wc-serial-numbers' ), - ); - - return apply_filters( 'wc_serial_numbers_settings_tabs', $tabs ); - } - - /** - * Get settings. - * - * @param string $tab Current tab. - * - * @since 1.0.0 - * @return array - */ - public function get_settings( $tab ) { - $settings = array(); - - switch ( $tab ) { - case 'general': - $settings = array( - array( - 'title' => __( 'General Settings', 'wc-serial-numbers' ), - 'type' => 'title', - 'desc' => __( 'These options determine the behavior and operation of the plugin.', 'wc-serial-numbers' ), - 'id' => 'section_serial_numbers', - ), - array( - 'title' => __( 'Auto-complete orders', 'wc-serial-numbers' ), - 'id' => 'wc_serial_numbers_autocomplete_order', - 'desc' => __( 'Automatically completes orders after successful payments.', 'wc-serial-numbers' ), - 'type' => 'checkbox', - 'default' => 'no', - ), - array( - 'title' => __( 'Reuse keys', 'wc-serial-numbers' ), - 'id' => 'wc_serial_numbers_reuse_serial_number', - 'desc' => __( 'Recover failed, refunded keys for selling again.', 'wc-serial-numbers' ), - 'desc_tip' => __( 'If you enable this option, the keys will be available for selling again if the order is refunded or failed.', 'wc-serial-numbers' ), - 'type' => 'checkbox', - 'default' => 'no', - ), - // Revoke serial keys. - array( - 'title' => __( 'Revoke keys', 'wc-serial-numbers' ), - 'id' => 'wc_serial_numbers_revoke_keys', - 'desc' => __( 'Revoke keys when the order status changes to cancelled or refunded.', 'wc-serial-numbers' ), - 'desc_tip' => __( 'If you enable this option, the keys will be revoked when the order status changes to cancelled or refunded.', 'wc-serial-numbers' ), - 'type' => 'checkbox', - 'default' => 'no', - ), - array( - 'title' => __( 'Hide keys', 'wc-serial-numbers' ), - 'id' => 'wc_serial_numbers_hide_serial_number', - 'desc' => __( 'Keys will be masked in the list table.', 'wc-serial-numbers' ), - 'default' => 'yes', - 'type' => 'checkbox', - ), - array( - 'title' => __( 'Disable software support', 'wc-serial-numbers' ), - 'id' => 'wc_serial_numbers_disable_software_support', - 'desc' => __( 'Disable Software Licensing support & API functionalities.', 'wc-serial-numbers' ), - 'desc_tip' => __( 'If you enable this option, the activation menu and it’s functionality will be turned off.', 'wc-serial-numbers' ), - 'default' => 'no', - 'type' => 'checkbox', - ), - array( - 'type' => 'sectionend', - 'id' => 'section_serial_numbers', - ), - array( - 'title' => __( 'Stock Notification', 'wc-serial-numbers' ), - 'type' => 'title', - 'desc' => __( 'These options determine the operation of the key\'s stock notification.', 'wc-serial-numbers' ), - 'id' => 'stock_section', - ), - array( - 'title' => __( 'Stock notification email', 'wc-serial-numbers' ), - 'id' => 'wc_serial_numbers_enable_stock_notification', - 'desc' => __( 'Sends notification emails when key stock is low.', 'wc-serial-numbers' ), - 'type' => 'checkbox', - 'sanitize_callback' => 'intval', - 'default' => 'yes', - ), - array( - 'title' => __( 'Stock threshold', 'wc-serial-numbers' ), - 'id' => 'wc_serial_numbers_stock_threshold', - 'desc' => __( 'An email notification will be sent when the key stock falls below the specified number.', 'wc-serial-numbers' ), - 'type' => 'number', - 'default' => '5', - ), - array( - 'title' => __( 'Notification recipient email', 'wc-serial-numbers' ), - 'id' => 'wc_serial_numbers_notification_recipient', - 'desc' => __( 'The email address which will be used to send email notifications.', 'wc-serial-numbers' ), - 'type' => 'text', - 'default' => get_option( 'admin_email' ), - ), - array( - 'type' => 'sectionend', - 'id' => 'stock_section', - ), - ); - break; - } - /** - * Filter the settings for the plugin. - * - * @param array $settings The settings. - * - * @deprecated 1.4.1 - */ - $settings = apply_filters( 'wc_serial_numbers_' . $tab . '_settings_fields', $settings ); - - return apply_filters( 'wc_serial_numbers_get_settings_' . $tab, $settings ); - } - - /** - * Output premium widget. - * - * @since 1.0.0 - * @return void - */ - protected function output_premium_widget() { - if ( WCSN()->is_premium_active() ) { - return; - } - $features = array( - __( 'Create and assign keys for WooCommerce variable products.', 'wc-serial-numbers' ), - __( 'Generate bulk keys with your custom key generator rule.', 'wc-serial-numbers' ), - __( 'Random & sequential key order for the generator rules.', 'wc-serial-numbers' ), - __( 'Automatic key generator to auto-create & assign keys with orders.', 'wc-serial-numbers' ), - __( 'License key management option from the order page with required actions.', 'wc-serial-numbers' ), - __( 'Support for bulk import/export of keys from/to CSV.', 'wc-serial-numbers' ), - __( 'Send keys via SMS with Twilio.', 'wc-serial-numbers' ), - __( 'Option to sell keys even if there are no available keys in the stock.', 'wc-serial-numbers' ), - __( 'Custom deliverable quantity to deliver multiple keys with a single product.', 'wc-serial-numbers' ), - __( 'Manual delivery option to manually deliver license keys instead of automatic.', 'wc-serial-numbers' ), - __( 'Email template to easily and quickly customize the order confirmation & low stock alert email.', 'wc-serial-numbers' ), - __( 'Many more ...', 'wc-serial-numbers' ), - ); - ?> -
    -

    -

    -
      - -
    • -
    • - -
    - -
    - get_docs_url() ) { - printf( '%s', esc_url( WCSN()->get_docs_url() ), esc_html__( 'Documentation', 'wc-serial-numbers' ) ); - } - } -} diff --git a/trunk/src/Admin/views/html-add-key.php b/trunk/src/Admin/views/html-add-key.php deleted file mode 100644 index a6f321ff..00000000 --- a/trunk/src/Admin/views/html-add-key.php +++ /dev/null @@ -1,199 +0,0 @@ - - -
    -

    - - - - -

    - -

    - -

    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -

    - -

    -
    - - - -

    - -

    -
    - - - -

    - -

    -
    - - - -

    -
    - - -

    - -

    -

    - -

    -

    - -

    -
    - - - -

    - -

    -
    - - - -

    - -

    -
    - - - - -
    -
    -
    - is_premium_active() ) : ?> - -
    -

    -

    -
      - -
    • -
    • - -
    - -
    - -
    - -
    -
    -
    diff --git a/trunk/src/Admin/views/html-api-actions.php b/trunk/src/Admin/views/html-api-actions.php deleted file mode 100644 index c84d7433..00000000 --- a/trunk/src/Admin/views/html-api-actions.php +++ /dev/null @@ -1,201 +0,0 @@ - 'serial-numbers-api', - ), - home_url( '/' ) -); - -?> -
    -
    -

    -
    - -
    -

    - -

    -

    - -

    -
    -

    - -

    -
      -
    1. - product_id - -
    2. -
    3. - serial_key - -
    4. -
    5. - request - -
    6. -
    7. - instance - -
    8. -
    9. - platform - -
    10. -
    11. - email - -
    12. -
    - -

    - - - 123, - 'serial_key' => '123456789', - 'request' => 'activate', - 'instance' => 'example.com', - ), - $api_url - ) - ); - ?> - -

    -

    - -

    - -
      -
    1. - code - -
    2. -
    3. - message - -
    4. -
    5. - activated/deactivated - -
    6. -
    7. - activation_limit - -
    8. -
    9. - activation_count - -
    10. -
    11. - activations_left - -
    12. -
    13. - expire_date - -
    14. -
    15. - expires_at - -
    16. -
    17. - product_id - -
    18. -
    19. - product - -
    20. -
    21. - activations - -
    22. -
    -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -

    - -

    -
    - -

    - -

    -
    - -

    - -

    -
    - -

    - -

    -
    - -

    - -

    -
    - -

    - -

    -
    -
    -
    - -
    -
    -
    -
    diff --git a/trunk/src/Admin/views/html-api-validation.php b/trunk/src/Admin/views/html-api-validation.php deleted file mode 100644 index 15af4f6a..00000000 --- a/trunk/src/Admin/views/html-api-validation.php +++ /dev/null @@ -1,170 +0,0 @@ - 'serial-numbers-api', - ), - home_url( '/' ) -); -?> -
    -
    -

    -
    -
    - is_premium_active() ) : ?> -
    -

    - Upgrade to Pro to get more features.', 'wc-serial-numbers' ), - esc_url( WCSN()->get_premium_url() . '?utm_source=create_serial_page&utm_medium=button&utm_campaign=wc-serial-numbers&utm_content=View%20Details' ) - ) - ); - ?> -

    -
    - -

    - -

    -

    - -

    -
    -

    - -

    -
      -
    1. - product_id - -
    2. -
    3. - serial_key - -
    4. -
    5. - request - -
    6. -
    7. - email - -
    8. -
    -

    - - - 1, - 'serial_key' => '123456789', - 'request' => 'validate', - ), - $api_url - ) - ); - ?> - -

    -

    - -

    -
      -
    1. - code - -
    2. -
    3. - message - -
    4. -
    5. - activation_limit - -
    6. -
    7. - activation_count - -
    8. -
    9. - activations_left - -
    10. -
    11. - expire_date - -
    12. -
    13. - status - -
    14. -
    15. - product_id - -
    16. -
    17. - product - -
    18. -
    19. - activations - -
    20. -
    - -

    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -

    - -

    -
    - -

    - -

    -
    - -

    - -

    -
    -
    -
    - - -
    -
    -
    -
    diff --git a/trunk/src/Admin/views/html-edit-key.php b/trunk/src/Admin/views/html-edit-key.php deleted file mode 100644 index e018c16a..00000000 --- a/trunk/src/Admin/views/html-edit-key.php +++ /dev/null @@ -1,198 +0,0 @@ - -
    -

    - exists() ) : ?> - - - - - - - - -

    - -
    -
    -
    -
    -
    -

    -
    -
    - -
    - - -

    - -

    -
    - -
    - - -

    - -

    -
    - - -
    - - - -

    - -

    -
    - -
    - -
    - -
    - -
    -
    -

    -
    - - - -
    - - -

    -
    - -
    - - -

    -
    - -
    -
    - -
    - -
    -
    -
    -

    -
    - -
    - - get_order() ) : ?> -
    -
    -

    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - get_order()->get_formatted_billing_full_name() ); ?> -
    - - - get_order()->get_billing_email() ); ?> -
    - - - get_order()->get_formatted_billing_address() ); ?> -
    - - - get_order()->get_billing_phone() ); ?> -
      - - - -
    -
    -
    - - -
    -
    - - - - -
    -
    diff --git a/trunk/src/Admin/views/html-list-activations.php b/trunk/src/Admin/views/html-list-activations.php deleted file mode 100644 index c4dcaaa0..00000000 --- a/trunk/src/Admin/views/html-list-activations.php +++ /dev/null @@ -1,32 +0,0 @@ -current_action(); -$list_table->process_bulk_actions( $doaction ); -?> - -
    -

    - -

    - -
    -
    - prepare_items(); - $list_table->views(); - $list_table->search_box( __( 'Search activation', 'wc-serial-numbers' ), 'activation' ); - $list_table->display(); - ?> - -
    -
    -current_action(); -$list_table->process_bulk_actions( $doaction ); -?> - -
    -

    - -

    - - - - - - - - - - - - - - - - -
    - -
    - prepare_items(); - $list_table->views(); - $list_table->search_box( __( 'Search key', 'wc-serial-numbers' ), 'key' ); - $list_table->display(); - ?> - - -
    -
    - diff --git a/trunk/src/Admin/views/html-list-stock.php b/trunk/src/Admin/views/html-list-stock.php deleted file mode 100644 index 9b7cd740..00000000 --- a/trunk/src/Admin/views/html-list-stock.php +++ /dev/null @@ -1,21 +0,0 @@ - - -
    - prepare_items(); - $list_table->views(); - $list_table->search_box( __( 'Search', 'wc-serial-numbers' ), 'key' ); - $list_table->display(); - ?> - - -
    diff --git a/trunk/src/Admin/views/html-reports.php b/trunk/src/Admin/views/html-reports.php deleted file mode 100644 index 23365141..00000000 --- a/trunk/src/Admin/views/html-reports.php +++ /dev/null @@ -1,25 +0,0 @@ - -
    - - - -
    -
    - -
    -
    diff --git a/trunk/src/Admin/views/html-tools.php b/trunk/src/Admin/views/html-tools.php deleted file mode 100644 index fe4d7704..00000000 --- a/trunk/src/Admin/views/html-tools.php +++ /dev/null @@ -1,25 +0,0 @@ - -
    - - - -
    -
    - -
    -
    diff --git a/trunk/src/Ajax.php b/trunk/src/Ajax.php deleted file mode 100644 index a23e2e18..00000000 --- a/trunk/src/Ajax.php +++ /dev/null @@ -1,233 +0,0 @@ - esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) ); - wp_die(); - } - - $search = isset( $_REQUEST['search'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['search'] ) ) : ''; - $page = isset( $_REQUEST['page'] ) ? absint( $_REQUEST['page'] ) : 1; - $per_page = absint( 100 ); - $args = array_merge( - wcsn_get_products_query_args(), - array( - 'posts_per_page' => $per_page, - 's' => $search, - 'fields' => 'ids', - ) - ); - $the_query = new \WP_Query( $args ); - $product_ids = $the_query->get_posts(); - $results = array(); - foreach ( $product_ids as $product_id ) { - $product = wc_get_product( $product_id ); - - if ( ! $product ) { - continue; - } - - $text = sprintf( - '(#%1$s) %2$s', - $product->get_id(), - wp_strip_all_tags( $product->get_formatted_name() ) - ); - - $results[] = array( - 'id' => $product->get_id(), - 'text' => $text, - ); - } - $more = false; - if ( $the_query->found_posts > ( $per_page * $page ) ) { - $more = true; - } - wp_send_json( - array( - 'page' => $page, - 'results' => $results, - 'pagination' => array( - 'more' => $more, - ), - ) - ); - wp_die(); - } - - /** - * Search orders. - * - * @since 1.3.1 - * @return void - */ - public static function search_orders() { - check_ajax_referer( 'wc_serial_numbers_search_nonce', 'nonce' ); - - // Must have WC Serial Numbers manager role to access this endpoint. - if ( ! current_user_can( wcsn_get_manager_role() ) ) { - wp_send_json_error( array( 'message' => esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) ); - wp_die(); - } - - $search = isset( $_REQUEST['search'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['search'] ) ) : ''; - $page = isset( $_REQUEST['page'] ) ? absint( $_REQUEST['page'] ) : 1; - $per_page = absint( 100 ); - - $ids = array(); - if ( is_numeric( $search ) ) { - $order = wc_get_order( intval( $search ) ); - - // Order does exist. - if ( $order && 0 !== $order->get_id() ) { - $ids[] = $order->get_id(); - } - } - - if ( empty( $ids ) && ! is_numeric( $search ) ) { - $data_store = \WC_Data_Store::load( 'order' ); - if ( 3 > strlen( $search ) ) { - $per_page = 20; - } - $ids = $data_store->search_orders( - $search, - array( - 'limit' => $per_page, - 'page' => $page, - ) - ); - } - - $results = array(); - foreach ( $ids as $order_id ) { - $order = wc_get_order( $order_id ); - - if ( ! $order ) { - continue; - } - - $text = sprintf( - '(#%1$s) %2$s', - $order->get_id(), - wp_strip_all_tags( $order->get_formatted_billing_full_name() ) - ); - - $results[] = array( - 'id' => $order->get_id(), - 'text' => $text, - ); - } - - wp_send_json( - array( - 'page' => $page, - 'results' => $results, - 'pagination' => array( - 'more' => false, - ), - ) - ); - wp_die(); - } - - /** - * Search customers. - * - * @since 1.3.1 - * @return void - */ - public static function search_customers() { - check_ajax_referer( 'wc_serial_numbers_search_nonce', 'nonce' ); - - // Must have WC Serial Numbers manager role to access this endpoint. - if ( ! current_user_can( wcsn_get_manager_role() ) ) { - wp_send_json_error( array( 'message' => esc_html__( 'You do not have permission to access this endpoint.', 'wc-serial-numbers' ) ) ); - wp_die(); - } - - $search = isset( $_REQUEST['search'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['search'] ) ) : ''; - $page = isset( $_REQUEST['page'] ) ? absint( $_REQUEST['page'] ) : 1; - $per_page = absint( 100 ); - - $ids = array(); - // Search by ID. - if ( is_numeric( $search ) ) { - $customer = new \WC_Customer( intval( $search ) ); - - // Customer does not exists. - if ( $customer && 0 !== $customer->get_id() ) { - $ids = array( $customer->get_id() ); - } - } - - // Usernames can be numeric so we first check that no users was found by ID before searching for numeric username, this prevents performance issues with ID lookups. - if ( empty( $ids ) ) { - $data_store = \WC_Data_Store::load( 'customer' ); - - // If search is smaller than 3 characters, limit result set to avoid - // too many rows being returned. - if ( 3 > strlen( $search ) ) { - $per_page = 20; - } - $ids = $data_store->search_customers( $search, $per_page ); - } - - $results = array(); - foreach ( $ids as $id ) { - $customer = new \WC_Customer( $id ); - $text = sprintf( - /* translators: $1: customer name, $2 customer id, $3: customer email */ - esc_html__( '%1$s (#%2$s - %3$s)', 'wc-serial-numbers' ), - $customer->get_first_name() . ' ' . $customer->get_last_name(), - $customer->get_id(), - $customer->get_email() - ); - - $results[] = array( - 'id' => $id, - 'text' => $text, - ); - } - - wp_send_json( - array( - 'page' => $page, - 'results' => $results, - 'pagination' => array( - 'more' => false, - ), - ) - ); - } -} diff --git a/trunk/src/Cache.php b/trunk/src/Cache.php deleted file mode 100644 index 5321afdd..00000000 --- a/trunk/src/Cache.php +++ /dev/null @@ -1,37 +0,0 @@ - - - query( "update {$wpdb->prefix}serial_numbers set status='expired' where validity !='0' AND (order_date + INTERVAL validity DAY ) < NOW()" ); - } - - /** - * Send low stock email notification. - * - * @since 1.2.0 - * @return bool - */ - public static function send_stock_alert_email() { - if ( 'yes' !== get_option( 'wc_serial_numbers_enable_stock_notification' ) ) { - return false; - } - - $stock_threshold = get_option( 'wc_serial_numbers_stock_threshold', 5 ); - $to = get_option( 'wc_serial_numbers_notification_recipient', get_option( 'admin_email' ) ); - if ( empty( $to ) ) { - return false; - } - - $low_stock_products = wcsn_get_stocks_count( $stock_threshold ); - if ( empty( $low_stock_products ) ) { - return false; - } - - $subject = __( 'Serial Numbers stock running low', 'wc-serial-numbers' ); - /** $woocommerce WooCommerce */ - global $woocommerce; - $mailer = $woocommerce->mailer(); - - ob_start(); - wcsn_get_template( 'email-stock-notification.php', array( 'low_stock_products' => $low_stock_products ) ); - $message = ob_get_contents(); - ob_get_clean(); - - $message = $mailer->wrap_message( $subject, $message ); - $headers = apply_filters( 'woocommerce_email_headers', '', 'wc_serial_numbers_low_stock_notification', $mailer ); - $mailer->send( $to, $subject, $message, $headers, array() ); - - exit(); - } -} diff --git a/trunk/src/Deprecated/Functions.php b/trunk/src/Deprecated/Functions.php deleted file mode 100644 index 9d1317cf..00000000 --- a/trunk/src/Deprecated/Functions.php +++ /dev/null @@ -1,440 +0,0 @@ -set_status( $status ); - - return $key->save(); -} - -/** - * Delete serial number. - * - * @param $id - * - * @since 1.2.0 - * @return bool - * @deprecated 1.4.6 - */ -function wc_serial_numbers_delete_serial_number( $id ) { - wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_delete_key' ); - - return wcsn_delete_key( $id ); -} - -/** - * @param $id - * - * @since 1.2.0 - * @return mixed - * @deprecated 1.4.6 - */ -function wc_serial_numbers_get_serial_number( $id ) { - wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_get_key' ); - - return wcsn_get_key( $id ); -} - -/** - * Get activation - * - * @param $args - * - * @since 1.2.0 - * @deprecated 1.4.6 - */ -function wc_serial_numbers_get_activation( $activation_id ) { - wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_get_activation' ); - - return wcsn_get_activation( $activation_id ); -} - -/** - * @param $args - * - * @since 1.2.0 - * @return int|WP_Error - * @deprecated 1.4.6 - */ -function wc_serial_numbers_insert_activation( $args ) { - wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_insert_activation' ); - - return wcsn_insert_activation( $args ); -} - -/** - * @param $args - * - * @since 1.2.0 - * @return int|WP_Error - * @deprecated 1.4.6 - */ -function wc_serial_numbers_update_activation( $args ) { - wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_insert_activation' ); - - return wcsn_insert_activation( $args ); -} - -/** - * @param $id - * - * @since 1.2.0 - * @return bool - * @deprecated 1.4.6 - */ -function wc_serial_numbers_delete_activation( $id ) { - wc_deprecated_function( __FUNCTION__, '1.4.6', 'wcsn_delete_activation' ); - - return wcsn_delete_activation( $id ); -} - -/** - * @param $id - * @param int $status - * - * @since 1.2.0 - * @return int|WP_Error - * @deprecated 1.4.6 - */ -function wc_serial_numbers_update_activation_status( $id, $status = 1 ) { - // Do nothing. -} - -/** - * Encrypt serial number. - * - * @param string $key Serial number. - * - * @since 1.2.0 - * @return false|string - * @deprecated 1.4.6 - */ -function wc_serial_numbers_encrypt_key( $key ) { - return wcsn_encrypt_key( $key ); -} - -/** - * Decrypt number. - * - * @param string $key Serial number. - * - * @since 1.2.0 - * @return false|string - * @deprecated 1.4.6 - */ -function wc_serial_numbers_decrypt_key( $key ) { - return wcsn_decrypt_key( $key ); -} - -/** - * Get Low stock products. - * - * @param int $stock - * - * @since 1.0.0 - * @return array - * @deprecated 1.4.6 - */ -function wc_serial_numbers_get_low_stock_products( $force = false, $stock = 10 ) { - return wcsn_get_stocks_count( $stock, $force ); -} - -/** - * Check if software disabled. - * - * @since 1.2.0 - * @return bool - * @deprecated 1.4.6 - */ -function wc_serial_numbers_software_support_disabled() { - return ! wcsn_is_software_support_enabled(); -} - -/** - * Get refund statuses. - * - * @since 1.2.0 - * @return array|bool|mixed - * @deprecated 1.4.6 - */ -function wc_serial_numbers_get_revoke_statuses() { - return wcsn_get_revoke_statuses(); -} - -/** - * Get serial number user role. - * - * @since 1.2.0 - * @return mixed|void - * @deprecated 1.4.6 - */ -function wc_serial_numbers_get_user_role() { - return wcsn_get_manager_role(); -} - -/** - * Get key sources. - * - * @since 1.2.0 - * @return mixed|void - * @deprecated 1.4.6 - */ -function wc_serial_numbers_get_key_sources() { - return wcsn_get_key_sources(); -} - -/** - * Check if order contains serial numbers. - * - * @param $order - * - * @since 1.2.0 - * @return bool|int - * @deprecated 1.4.6 - */ -function wc_serial_numbers_order_has_serial_numbers( $order ) { - return wcsn_order_has_products( $order ); -} - -/** - * Serial number order table get columns. - * - * @since 1.2.0 - * @return mixed|void - */ -function wc_serial_numbers_get_order_table_columns() { - $columns = array( - 'product' => __( 'Product', 'wc-serial-numbers' ), - 'serial_key' => __( 'Serial Number', 'wc-serial-numbers' ), - 'activation_email' => __( 'Email', 'wc-serial-numbers' ), - 'activation_limit' => __( 'Activation Limit', 'wc-serial-numbers' ), - 'expire_date' => __( 'Expires', 'wc-serial-numbers' ), - ); - - return apply_filters( 'wc_serial_numbers_order_table_columns', $columns ); -} - -/** - * Get product stock - * - * @param $product_id - * - * @since 1.2.0 - * @return int - * @deprecated 1.4.6 - */ -function wc_serial_numbers_get_stock_quantity( $product_id ) { - $source = get_post_meta( $product_id, '_serial_key_source', true ); - if ( 'custom_source' == get_post_meta( $product_id, '_serial_key_source', true ) || empty( $source ) ) { - $stocks = wcsn_get_stocks_count(); - if ( isset( $stocks[ $product_id ] ) ) { - return absint( $stocks[ $product_id ] ); - } - - return 0; - } - - return 9999; -} - -/** - * Get order table. - * - * @param bool $return - * - * @param $order - * - * @since 1.2.0 - * - * @return false|string|void - */ -function wc_serial_numbers_get_order_table( $order, $return = false ) { - wcsn_display_order_keys( $order, $return ); -} - -/** - * Control software related columns - * - * @param $columns - * - * @since 1.2.0 - * @return mixed - */ -function wc_serial_numbers_control_order_table_columns( $columns ) { - if ( wc_serial_numbers_software_support_disabled() ) { - $software_columns = array( 'activation_email', 'activation_limit', 'expire_date' ); - foreach ( $columns as $key => $label ) { - if ( in_array( $key, $software_columns ) ) { - unset( $columns[ $key ] ); - } - } - } - - return $columns; -} - -add_filter( 'wc_serial_numbers_order_table_columns', 'wc_serial_numbers_control_order_table_columns', 99 ); - - -/** - * Sanitize boolean - * - * @param $string - * - * @since 1.2.0 - * @return mixed - */ -function wc_serial_numbers_validate_boolean( $string ) { - return filter_var( $string, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE ); -} diff --git a/trunk/src/Encryption.php b/trunk/src/Encryption.php deleted file mode 100644 index 94c253b1..00000000 --- a/trunk/src/Encryption.php +++ /dev/null @@ -1,220 +0,0 @@ -services['frontend/my-account'] = new MyAccount(); - * - * @since 1.5.6 - * @return void - */ - public function init() { - WCSN()->services['frontend/shortcodes'] = new Shortcodes(); - } - - /** - * Enqueue frontend scripts. - * - * @since 1.5.6 - * @return void - */ - public function enqueue_scripts() { - WCSN()->enqueue_style( 'wc-serial-numbers-frontend', 'css/frontend-style.css' ); - WCSN()->enqueue_script( 'wc-serial-numbers-frontend', 'js/frontend-script.js', array( 'jquery' ) ); - wp_localize_script( - 'wc-serial-numbers-frontend', - 'wc_serial_numbers_frontend_vars', - array( - 'ajax_url' => admin_url( 'admin-ajax.php' ), - 'i18n' => array( - 'copied' => __( 'Copied', 'wc-serial-numbers' ), - 'loading' => __( 'Loading', 'wc-serial-numbers' ), - ), - ) - ); - } -} diff --git a/trunk/src/Frontend/Shortcodes.php b/trunk/src/Frontend/Shortcodes.php deleted file mode 100644 index 2dcb10c5..00000000 --- a/trunk/src/Frontend/Shortcodes.php +++ /dev/null @@ -1,315 +0,0 @@ - 0, - 'email_field' => 'yes', - 'title' => __( 'Serial Key Validation', 'wc-serial-numbers' ), - 'product_field_label' => __( 'Product', 'wc-serial-numbers' ), - 'key_field_label' => __( 'Serial Key', 'wc-serial-numbers' ), - 'key_field_placeholder' => __( 'Enter your serial key', 'wc-serial-numbers' ), - 'email_field_label' => __( 'Email', 'wc-serial-numbers' ), - 'email_field_placeholder' => __( 'Enter your email', 'wc-serial-numbers' ), - 'button_label' => __( 'Validate', 'wc-serial-numbers' ), - ), - $atts, - 'wc_serial_numbers_validation_form' - ); - - // If product ID is not set, get all enabled products and make a dropdown. - $products = array(); - if ( empty( $atts['product_id'] ) ) { - $args = array_merge( - wcsn_get_products_query_args(), - array( - 'posts_per_page' => - 1, - 'fields' => 'ids', - ) - ); - $the_query = new \WP_Query( $args ); - $product_ids = $the_query->get_posts(); - foreach ( $product_ids as $product_id ) { - $product = wc_get_product( $product_id ); - if ( ! $product ) { - continue; - } - $products[ $product->get_id() ] = $product->get_name(); - } - } - - ob_start(); - - // If product ID is not set and no products found, return with error message. - if ( empty( $atts['product_id'] ) && empty( $products ) ) { - return '

    ' . __( 'No products found.', 'wc-serial-numbers' ) . '

    '; - } - - ?> -
    - -

    - - - - -

    - - -

    - -

    - - -

    - - -

    - - -

    - - -

    - - -

    - -
    - 0, - 'action' => '', - 'email_field' => 'yes', - 'platform_field' => 'yes', - 'title' => __( 'Activate/Deactivate Serial Key', 'wc-serial-numbers' ), - 'product_field_label' => __( 'Product', 'wc-serial-numbers' ), - 'key_field_label' => __( 'Serial Key', 'wc-serial-numbers' ), - 'key_field_placeholder' => __( 'Enter your serial key', 'wc-serial-numbers' ), - 'email_field_label' => __( 'Email', 'wc-serial-numbers' ), - 'email_field_placeholder' => __( 'Enter your email', 'wc-serial-numbers' ), - 'instance_field_label' => __( 'Instance', 'wc-serial-numbers' ), - 'instance_field_placeholder' => __( 'Enter your instance', 'wc-serial-numbers' ), - 'platform_field_label' => __( 'Platform', 'wc-serial-numbers' ), - 'platform_field_placeholder' => __( 'Enter platform', 'wc-serial-numbers' ), - 'action_field_label' => __( 'Action', 'wc-serial-numbers' ), - 'button_label' => __( 'Submit', 'wc-serial-numbers' ), - ), - $atts, - 'wc_serial_numbers_activation_form' - ); - $actions = array( - 'activate' => esc_html__( 'Activate', 'wc-serial-numbers' ), - 'deactivate' => esc_html__( 'Deactivate', 'wc-serial-numbers' ), - ); - $products = array(); - if ( empty( $atts['product_id'] ) ) { - $args = array_merge( - wcsn_get_products_query_args(), - array( - 'posts_per_page' => - 1, - 'fields' => 'ids', - 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - array( - 'key' => '_is_serial_number', - 'value' => 'yes', - 'compare' => '=', - ), - ), - ) - ); - $the_query = new \WP_Query( $args ); - $product_ids = $the_query->get_posts(); - foreach ( $product_ids as $product_id ) { - $product = wc_get_product( $product_id ); - if ( ! $product ) { - continue; - } - $products[ $product->get_id() ] = $product->get_name(); - } - } - - ob_start(); - - // If product ID is not set and no products found, return with error message. - if ( empty( $atts['product_id'] ) && empty( $products ) ) { - return esc_html__( 'Could not find any products with serial numbers enabled.', 'wc-serial-numbers' ); - } - ?> -
    - -

    - - - - - -

    - - -

    - -

    - - -

    - - - -

    - - -

    - - -

    - - -

    - - -

    - - -

    - - - - - -

    - - -

    - - -

    - -

    - - -
    - __( 'Invalid request.', 'wc-serial-numbers' ) ) ); - } - - // perform a rest api request internally. - wp_send_json( $this->rest_api_request( 'validate', $_POST ) ); - } - - /** - * Activate serial key. - * - * @since 1.0.0 - * - * @return void - */ - public function activate_serial_key() { - if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['_wpnonce'] ), 'wcsn_user_action' ) ) { - wp_send_json_error( array( 'message' => __( 'Invalid request.', 'wc-serial-numbers' ) ) ); - } - - $request = isset( $_POST['request'] ) ? sanitize_text_field( wp_unslash( $_POST['request'] ) ) : 'activate'; - - // perform a rest api request internally. - wp_send_json( $this->rest_api_request( $request, $_POST ) ); - } - - /** - * Perform a rest API request. - * - * @param string $route The route to request. - * @param array $params The request parameters. - * - * @since 1.0.0 - * @return array - */ - public function rest_api_request( $route, $params ) { - $namespace = '/wcsn/'; - $endpoint = wp_normalize_path( $namespace . '/' . $route ); - $request = new \WP_REST_Request( 'GET', $endpoint ); - $request->set_query_params( $params ); - $response = rest_do_request( $request ); - $server = rest_get_server(); - $json = $server->response_to_data( $response, false ); - - return $json; - } -} diff --git a/trunk/src/Functions/Template.php b/trunk/src/Functions/Template.php deleted file mode 100644 index 87831583..00000000 --- a/trunk/src/Functions/Template.php +++ /dev/null @@ -1,312 +0,0 @@ -get_template_path() ); -} - -/** - * output key properties. - * - * @param Key $key Key object. - * @param bool $output Echo or return. - * - * @since 1.4.9 - * @return void|string Return html if $output is false. - */ -function wcsn_display_key_html( $key, $output = true ) { - $text_align = is_rtl() ? 'right' : 'left'; - $margin_side = is_rtl() ? 'left' : 'right'; - - $properties = array( - 'key' => array( - 'label' => __( 'Key', 'wc-serial-numbers' ), - 'value' => '' . $key->get_key() . '', - 'priority' => 10, - ), - 'activation_email' => array( - 'label' => __( 'Activation Email', 'wc-serial-numbers' ), - 'value' => $key->get_customer_email(), - 'priority' => 20, - ), - 'activation_limit' => array( - 'label' => __( 'Activation Limit', 'wc-serial-numbers' ), - 'value' => ! empty( $key->get_activation_limit() ) ? number_format_i18n( $key->get_activation_limit() ) : __( 'None', 'wc-serial-numbers' ), - 'priority' => 30, - ), - 'activation_count' => array( - 'label' => __( 'Activation Count', 'wc-serial-numbers' ), - 'value' => ! empty( $key->get_activation_count() ) ? number_format_i18n( $key->get_activation_count() ) : __( 'None', 'wc-serial-numbers' ), - 'priority' => 40, - ), - 'expire_date' => array( - 'label' => __( 'Expire Date', 'wc-serial-numbers' ), - 'value' => ! empty( $key->get_expire_date() ) ? $key->get_expire_date() : __( 'Lifetime', 'wc-serial-numbers' ), - 'priority' => 50, - ), - ); - - $status = $key->get_status(); - if ( 'sold' === $status ) { - $status = '' . __( 'Active', 'wc-serial-numbers' ) . ''; - } elseif ( 'expired' === $status ) { - $status = '' . __( 'Expired', 'wc-serial-numbers' ) . ''; - } else { - $status = ' '; - } - - $properties['status'] = array( - 'label' => __( 'Status', 'wc-serial-numbers' ), - 'value' => $status, - 'priority' => 60, - ); - - /** - * Filter key properties. - * - * @param array $props Key properties. - * @param Key $key Key object. - * - * @since 1.4.9 - */ - $properties = apply_filters( 'wc_serial_numbers_display_key_props', $properties, $key ); - - usort( - $properties, - function ( $a, $b ) { - return $a['priority'] - $b['priority']; - } - ); - - ob_start(); - - ?> -
      - $prop_data ) : ?> -
    • - - : - - -
    • - - -
    - get_id() ); - if ( empty( $line_items ) ) { - return; - } - - ?> -
    - - - - - - - -
    - ' . esc_html( $title ) . ''; -} - - -/** - * Display order keys table. - * - * @param \WC_Order $order The order object. - * @param array $line_items The line items data. - * - * @since 1.4.6 - * @return void - */ -function wcsn_display_order_keys_table( $order, $line_items ) { - foreach ( $line_items as $line_item ) { - /** - * Filters the query arguments for getting keys. - * - * @param array $args The query arguments. - * @param \WC_Order $order The order object. - * @param array $line_item The line item data. - * - * @since 1.4.6 - */ - $args = apply_filters( - 'wc_serial_numbers_display_order_keys_table_query_args', - array( - 'order_id' => $order->get_id(), - 'product_id' => $line_item['product_id'], - 'status__in' => array( 'sold', 'expired' ), - 'limit' => - 1, - ) - ); - - $keys = wcsn_get_keys( $args ); - ?> - - - - - - - - - - - - - - - - - - -
    %s', esc_url( get_permalink( $line_item['product_id'] ) ), esc_html( get_the_title( $line_item['product_id'] ) ) ); ?> -
    - - - - - -
    %s

    ', esc_html( apply_filters( 'wc_serial_numbers_pending_notice', __( 'Order is waiting for serial numbers to be assigned.', 'wc-serial-numbers' ) ) ) ); ?>
    - 'update_112', - '1.2.0' => 'update_120', - '1.2.1' => 'update_121', - '1.4.6' => 'update_146', - '1.5.6' => 'update_156', - ); - - /** - * Installer constructor. - * - * @since 1.4.2 - */ - public function __construct() { - add_filter( 'cron_schedules', array( __CLASS__, 'custom_cron_schedules' ), 20 ); // phpcs:ignore WordPress.WP.CronInterval.CronSchedulesInterval - add_action( 'init', array( $this, 'check_update' ), 0 ); - } - - /** - * Add custom cron schedule - * - * @param array $schedules list of cron schedules. - * - * @since 1.0.0 - * @return array - */ - public static function custom_cron_schedules( $schedules ) { - $schedules ['once_a_minute'] = array( - 'interval' => 60, - 'display' => esc_html__( 'Once a Minute', 'wc-serial-numbers' ), - ); - - return $schedules; - } - - /** - * Check the plugin version and run the updater if necessary. - * - * This check is done on all requests and runs if the versions do not match. - * - * @since 1.4.2 - * @return void - */ - public function check_update() { - $db_version = WCSN()->get_db_version(); - $current_version = WCSN()->get_version(); - $requires_update = version_compare( $db_version, $current_version, '<' ); - $can_install = ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && ! defined( 'IFRAME_REQUEST' ); - if ( $can_install && $requires_update ) { - static::install(); - - $update_versions = array_keys( $this->updates ); - usort( $update_versions, 'version_compare' ); - if ( ! is_null( $db_version ) && version_compare( $db_version, end( $update_versions ), '<' ) ) { - $this->update(); - } else { - WCSN()->update_db_version( $current_version ); - } - } - } - - /** - * Update the plugin. - * - * @since 1.4.2 - * @return void - */ - public function update() { - $db_version = WCSN()->get_db_version(); - foreach ( $this->updates as $version => $callbacks ) { - $callbacks = (array) $callbacks; - if ( version_compare( $db_version, $version, '<' ) ) { - foreach ( $callbacks as $callback ) { - WCSN()->log( sprintf( 'Updating to %s from %s', $version, $db_version ) ); - // if the callback return false then we need to update the db version. - $continue = call_user_func( array( $this, $callback ) ); - if ( ! $continue ) { - WCSN()->update_db_version( $version ); - $notice = sprintf( - /* translators: 1: plugin name 2: version number */ - __( '%1$s updated to version %2$s successfully.', 'wc-serial-numbers' ), - 'Serial Numbers for WooCommerce', - '' . $version . '' - ); - WCSN()->add_notice( $notice, 'success' ); - } - } - } - } - } - - /** - * Install the plugin. - * - * @since 1.4.2 - * @return void - */ - public static function install() { - if ( ! is_blog_installed() ) { - return; - } - - self::create_tables(); - self::create_cron_jobs(); - Admin\Settings::instance()->save_defaults(); - WCSN()->update_db_version( WCSN()->get_version(), false ); - add_option( 'wc_serial_numbers_install_date', current_time( 'mysql' ) ); - set_transient( 'wc_serial_numbers_activated', true, 30 ); - set_transient( 'wc_serial_numbers_activation_redirect', true, 30 ); - } - - /** - * Create tables. - * - * @return void - */ - public static function create_tables() { - global $wpdb; - $wpdb->hide_errors(); - // todo rename table names to wcsn_keys and wcsn_activations. - $tables = array( - "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}serial_numbers( - id bigint(20) NOT NULL AUTO_INCREMENT, - serial_key longtext DEFAULT NULL, - product_id bigint(20) NOT NULL, - activation_limit int(9) NOT NULL DEFAULT 0, - activation_count int(9) NOT NULL DEFAULT 0, - order_id bigint(20) DEFAULT NULL, - order_item_id bigint(20) DEFAULT NULL, - vendor_id bigint(20) DEFAULT NULL, - status varchar(50) DEFAULT 'available', - validity varchar(200) DEFAULT NULL, - expire_date DATETIME NULL DEFAULT NULL, - order_date DATETIME NULL DEFAULT NULL, - uuid varchar(50) DEFAULT NULL, - source varchar(50) DEFAULT 'custom_source', - created_date DATETIME NULL DEFAULT NULL, - PRIMARY KEY (id), - key product_id (product_id), - key order_id (order_id), - key vendor_id (vendor_id), - key activation_limit (activation_limit), - KEY order_item_id (order_item_id), - UNIQUE KEY uuid (uuid), - key status (status) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ", - "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}serial_numbers_activations( - id bigint(20) NOT NULL auto_increment, - serial_id bigint(20) NOT NULL, - instance varchar(200) NOT NULL, - platform varchar(200) DEFAULT NULL, - activation_time DATETIME NULL DEFAULT NULL, - PRIMARY KEY (id), - key serial_id (serial_id) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8;", - ); - - require_once ABSPATH . 'wp-admin/includes/upgrade.php'; - foreach ( $tables as $table ) { - dbDelta( $table ); - } - } - - /** - * Create cron jobs (clear them first). - * - * @since 1.0.0 - * @return void - */ - public static function create_cron_jobs() { - // setup transient actions. - if ( false === wp_next_scheduled( 'wc_serial_numbers_hourly_event' ) ) { - wp_schedule_event( time(), 'hourly', 'wc_serial_numbers_hourly_event' ); - } - - if ( false === wp_next_scheduled( 'wc_serial_numbers_daily_event' ) ) { - wp_schedule_event( time(), 'daily', 'wc_serial_numbers_daily_event' ); - } - } - - /** - * Update to version 1.1.2 - * - * @since 1.1.2 - * @return void - */ - protected function update_112() { - global $wpdb; - $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers ADD KEY product_id(`product_id`)" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers ADD KEY order_id (`order_id`)" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers ADD KEY status (`status`)" ); - - $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers CHANGE expire_date expire_date DATETIME DEFAULT NULL" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_serial_numbers CHANGE order_date order_date DATETIME DEFAULT NULL" ); - $wpdb->query( "UPDATE {$wpdb->prefix}wcsn_serial_numbers set expire_date=NULL WHERE expire_date='0000-00-00 00:00:00'" ); - $wpdb->query( "UPDATE {$wpdb->prefix}wcsn_serial_numbers set order_date=NULL WHERE order_date='0000-00-00 00:00:00'" ); - - $wpdb->query( "ALTER TABLE {$wpdb->prefix}wcsn_activations ADD KEY serial_id (`serial_id`)" ); - } - - /** - * Update to version 1.2.0 - * - * @since 1.2.0 - * @return void - */ - protected function update_120() { - wp_clear_scheduled_hook( 'wcsn_per_minute_event' ); - wp_clear_scheduled_hook( 'wcsn_daily_event' ); - wp_clear_scheduled_hook( 'wcsn_hourly_event' ); - - if ( ! wp_next_scheduled( 'wc_serial_numbers_hourly_event' ) ) { - wp_schedule_event( time(), 'hourly', 'wc_serial_numbers_hourly_event' ); - } - - if ( ! wp_next_scheduled( 'wc_serial_numbers_daily_event' ) ) { - wp_schedule_event( time(), 'daily', 'wc_serial_numbers_daily_event' ); - } - - global $wpdb; - $wpdb->query( "RENAME TABLE `{$wpdb->prefix}wcsn_serial_numbers` TO `{$wpdb->prefix}serial_numbers`" ); - $wpdb->query( "RENAME TABLE `{$wpdb->prefix}wcsn_activations` TO `{$wpdb->prefix}serial_numbers_activations`" ); - - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers DROP COLUMN `serial_image`;" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers DROP COLUMN `activation_email`;" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers CHANGE `created` `created_date` DATETIME NULL DEFAULT NULL;" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD vendor_id bigint(20) NOT NULL DEFAULT 0" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD activation_count int(9) NOT NULL DEFAULT 0" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD KEY vendor_id(`vendor_id`)" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD source varchar(200) NOT NULL default 'custom_source'" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers_activations CHANGE platform platform varchar(200) DEFAULT NULL" ); - // status update. - $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set status=%s WHERE status=%s AND order_id=0", 'available', 'new' ) ); - $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set status=%s WHERE status=%s AND order_id != 0", 'sold', 'active' ) ); - $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set status=%s WHERE status=%s", 'cancelled', 'pending' ) ); - $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set status=%s WHERE status=%s", 'cancelled', 'rejected' ) ); - global $current_user; - if ( ! empty( $current_user->ID ) && current_user_can( 'manage_options' ) ) { - $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers set vendor_id=%d", $current_user->ID ) ); - } - - $activations = $wpdb->get_results( "select serial_id, count(id) as active_count from {$wpdb->prefix}serial_numbers_activations where active='1' GROUP BY serial_id" ); - foreach ( $activations as $activation ) { - global $wpdb; - $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers SET activation_count = %d WHERE id=%d", intval( $activation->active_count ), intval( $activation->serial_id ) ) ); - } - - $wpdb->query( "UPDATE {$wpdb->prefix}serial_numbers set status='available', order_date='0000-00-00 00:00:00', order_id='0' WHERE status !='available' AND order_id='0' AND expire_date='0000-00-00 00:00:00'" ); - - // settings update. - $heading_text = $this->update_1_2_0_get_option( 'heading_text', 'Serial Numbers', 'wsn_delivery_settings' ); - $serial_col_heading = $this->update_1_2_0_get_option( 'table_column_heading', 'Serial Number', 'wsn_delivery_settings' ); - $serial_key_label = $this->update_1_2_0_get_option( 'serial_key_label', 'Serial Number', 'wsn_delivery_settings' ); - $serial_email_label = $this->update_1_2_0_get_option( 'serial_email_label', 'Activation Email', 'wsn_delivery_settings' ); - $show_validity = 'yes' === $this->update_1_2_0_get_option( 'show_validity', 'yes', 'wsn_delivery_settings' ); - $show_activation_limit = 'yes' === $this->update_1_2_0_get_option( 'show_activation_limit', 'yes', 'wsn_delivery_settings' ); - $license = get_option( 'woocommerce_serial_numbers_pro_pluginever_license' ); - $options = array( - 'wc_serial_numbers_autocomplete_order' => $this->update_1_2_0_get_option( 'wsn_auto_complete_order', 'yes', 'wsn_delivery_settings' ), - 'wc_serial_numbers_reuse_serial_number' => $this->update_1_2_0_get_option( 'wsn_re_use_serial', 'no', 'wsn_delivery_settings' ), - 'wc_serial_numbers_disable_software_support' => 'no', - 'wc_serial_numbers_manual_delivery' => 'no', - 'wc_serial_numbers_hide_serial_number' => 'yes', - 'wc_serial_numbers_revoke_status_cancelled' => in_array( 'cancelled', $this->update_1_2_0_get_option( 'wsn_revoke_serial_number', array(), 'wsn_delivery_settings' ), true ) ? 'yes' : 'no', - 'wc_serial_numbers_revoke_status_refunded' => in_array( 'refunded', $this->update_1_2_0_get_option( 'wsn_revoke_serial_number', array(), 'wsn_delivery_settings' ), true ) ? 'yes' : 'no', - 'wc_serial_numbers_revoke_status_failed' => in_array( 'failed', $this->update_1_2_0_get_option( 'wsn_revoke_serial_number', array(), 'wsn_delivery_settings' ), true ) ? 'yes' : 'no', - 'wc_serial_numbers_enable_stock_notification' => $this->update_1_2_0_get_option( 'wsn_admin_bar_notification_send_email', 'yes', 'wsn_notification_settings' ), - 'wc_serial_numbers_stock_threshold' => $this->update_1_2_0_get_option( 'wsn_admin_bar_notification_number', '5', 'wsn_notification_settings' ), - 'wc_serial_numbers_notification_recipient' => $this->update_1_2_0_get_option( 'wsn_admin_bar_notification_email', get_option( 'admin_email' ), 'wsn_notification_settings' ), - 'wc_serial_numbers_order_table_heading' => $heading_text, - 'wc_serial_numbers_order_table_col_product_label' => 'Product', - 'wc_serial_numbers_order_table_col_key_label' => $serial_key_label, - 'wc_serial_numbers_order_table_col_email_label' => $serial_email_label, - 'wc_serial_numbers_order_table_col_limit_label' => 'Activation Limit', - 'wc_serial_numbers_order_table_col_expires_label' => 'Expire Date', - 'wc_serial_numbers_order_table_col_product' => 'yes', - 'wc_serial_numbers_order_table_col_key' => 'yes', - 'wc_serial_numbers_order_table_col_email' => 'no', - 'wc_serial_numbers_order_table_col_limit' => $show_activation_limit ? 'yes' : 'no', - 'wc_serial_numbers_order_table_col_expires' => $show_validity ? 'yes' : 'no', - 'wc_serial_numbers_install_time' => get_option( 'woocommerceserialnumbers_install_time' ), - 'woocommerce-serial-numbers-pro_license_key' => array_key_exists( 'key', $license ) ? $license['key'] : '', - 'woocommerce-serial-numbers-pro_license_status' => array_key_exists( 'license', $license ) ? $license['license'] : '', - ); - foreach ( $options as $key => $option ) { - add_option( $key, $option ); - } - } - - /** - * Get option from old settings. - * - * @param string $option_name Option name. - * @param string $default_value Default value. - * @param string $section Section name. - * - * @return string - */ - protected function update_1_2_0_get_option( $option_name, $default_value, $section = 'serial_numbers_settings' ) { - $settings = get_option( $section, array() ); - - return ! empty( $settings[ $option_name ] ) ? $settings[ $option_name ] : $default_value; - } - - /** - * Update to version 1.2.1 - * - * @since 1.2.1 - * @return void - */ - protected function update_121() { - global $wpdb; - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers CHANGE order_id order_id bigint(20) DEFAULT NULL" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers CHANGE vendor_id vendor_id bigint(20) DEFAULT NULL" ); - } - - /** - * Update to version 1.4.6 - * - * @since 1.4.6 - * @return void - */ - protected function update_146() { - global $wpdb; - // Update key status default value to 'available'. - // Change key status. - // Drop expired column. - $statuses_map = array( - 'refunded' => 'cancelled', - 'expired' => 'expired', - 'failed' => 'cancelled', - 'inactive' => 'sold', - ); - - foreach ( $statuses_map as $old_status => $new_status ) { - $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}serial_numbers SET status = %s WHERE status = %s", $new_status, $old_status ) ); - } - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers DROP expire_date" ); - - // Remove all inactive activations. - $wpdb->query( "DELETE FROM {$wpdb->prefix}serial_numbers_activations WHERE active = 0" ); - // Drop active column. - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers_activations DROP active" ); - } - - /** - * Update to version 1.5.6 - * - * @since 1.5.6 - */ - protected function update_156() { - global $wpdb; - // if order_item_id column not exist then add it. - if ( ! $wpdb->get_var( "SHOW COLUMNS FROM {$wpdb->prefix}serial_numbers LIKE 'order_item_id'" ) ) { - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD order_item_id bigint(20) DEFAULT NULL AFTER order_id" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD KEY order_item_id (order_item_id)" ); - } - - // if uuid column not exist then add it. - if ( ! $wpdb->get_var( "SHOW COLUMNS FROM {$wpdb->prefix}serial_numbers LIKE 'uuid'" ) ) { - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD uuid varchar(50) DEFAULT NULL AFTER order_item_id" ); - $wpdb->query( "ALTER TABLE {$wpdb->prefix}serial_numbers ADD UNIQUE KEY uuid (uuid)" ); - $wpdb->query( "UPDATE {$wpdb->prefix}serial_numbers SET uuid = UUID()" ); - } - } -} diff --git a/trunk/src/Models/Activation.php b/trunk/src/Models/Activation.php deleted file mode 100644 index b4328b24..00000000 --- a/trunk/src/Models/Activation.php +++ /dev/null @@ -1,298 +0,0 @@ - 0, - 'serial_id' => '', - 'instance' => '', - 'platform' => '', - 'activation_time' => '', - // todo add ip address support. - ); - - /* - |-------------------------------------------------------------------------- - | Getters and Setters - |-------------------------------------------------------------------------- - | - | Methods for getting and setting data. - | - */ - /** - * Get the key. - * - * @since 1.4.6 - * - * @return string - */ - public function get_id() { - return $this->get_prop( 'id' ); - } - - /** - * Set the key. - * - * @param string $id Key. - * - * @since 1.4.6 - * - * @return void - */ - public function set_id( $id ) { - $this->set_prop( 'id', absint( $id ) ); - } - - /** - * Get the serial id - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return int - */ - public function get_serial_id( $context = 'view' ) { - return $this->get_prop( 'serial_id', $context ); - } - - /** - * Get the key object. - * - * @since 1.4.6 - * - * @return Key - */ - public function get_key() { - if ( empty( $this->get_serial_id() ) ) { - return null; - } - - return Key::get( $this->get_serial_id() ); - } - - /** - * Get the product id. - * - * @since 1.4.6 - * - * @return int - */ - public function get_product_id() { - if ( empty( $this->get_key() ) ) { - return null; - } - - return $this->get_key()->get_product_id(); - } - - /** - * Get the product title. - * - * @since 1.4.6 - * - * @return string - */ - public function get_product_title() { - if ( empty( $this->get_key() ) ) { - return null; - } - - return $this->get_key()->get_product_title(); - } - - /** - * Set the serial id - * - * @param int $serial_id The serial id. - * - * @since 1.4.6 - * - * @return void - */ - public function set_serial_id( $serial_id ) { - $this->set_prop( 'serial_id', absint( $serial_id ) ); - } - - /** - * Get the instance - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return string - */ - public function get_instance( $context = 'view' ) { - return $this->get_prop( 'instance', $context ); - } - - /** - * Set the instance - * - * @param string $instance The instance. - * - * @since 1.4.6 - * - * @return void - */ - public function set_instance( $instance ) { - $this->set_prop( 'instance', sanitize_text_field( $instance ) ); - } - - /** - * Get the platform - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return string - */ - public function get_platform( $context = 'view' ) { - return $this->get_prop( 'platform', $context ); - } - - /** - * Set the platform - * - * @param string $platform The platform. - * - * @since 1.4.6 - * - * @return void - */ - public function set_platform( $platform ) { - $this->set_prop( 'platform', sanitize_text_field( $platform ) ); - } - - /** - * Get the activation time - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return string - */ - public function get_activation_time( $context = 'view' ) { - return $this->get_prop( 'activation_time', $context ); - } - - /** - * Set the activation time - * - * @param string $activation_time The activation time. - * - * @since 1.4.6 - * - * @return void - */ - public function set_activation_time( $activation_time ) { - $this->set_prop( 'activation_time', sanitize_text_field( $activation_time ) ); - } - - /* - |-------------------------------------------------------------------------- - | CRUD methods - |-------------------------------------------------------------------------- - | - | Methods which create, read, update and delete discounts from the database. - | - */ - /** - * Saves an object in the database. - * - * @since 1.0.0 - * @return true|\WP_Error True on success, WP_Error on failure. - */ - public function save() { - // Serial id is required. - if ( empty( $this->get_serial_id() ) ) { - return new \WP_Error( 'missing_required', __( 'Serial id is required.', 'wc-serial-numbers' ) ); - } - - // Instance is required. - if ( empty( $this->get_instance() ) ) { - return new \WP_Error( 'missing_required', __( 'Instance is required.', 'wc-serial-numbers' ) ); - } - - // If the activation time is empty, set it to now. - if ( empty( $this->get_activation_time() ) ) { - $this->set_activation_time( current_time( 'mysql' ) ); - } - - return parent::save(); - } - - /* - |-------------------------------------------------------------------------- - | Query Methods - |-------------------------------------------------------------------------- - | - | Methods for reading and manipulating the object properties. - | - */ - - /** - * Prepare where query. - * - * @param array $clauses Query clauses. - * @param array $args Array of args to pass to the query method. - * - * @since 1.0.0 - * @return array - */ - protected function prepare_where_query( $clauses, $args = array() ) { - global $wpdb; - $clauses = parent::prepare_where_query( $clauses, $args ); - // If order_id or product_id is set, we need to join with the key table and filter by those. - if ( ! empty( $args['order_id'] ) || ! empty( $args['product_id'] ) ) { - $key_table = ( new Key() )->get_table_name(); - $clauses['join'] .= " INNER JOIN {$wpdb->prefix}" . $key_table . " AS serial_numbers ON {$this->table_name}.serial_id = serial_numbers.id"; - } - - if ( ! empty( $args['order_id'] ) ) { - $clauses['where'] .= $wpdb->prepare( ' AND serial_numbers.order_id = %d', $args['order_id'] ); - } - - if ( ! empty( $args['product_id'] ) ) { - $clauses['where'] .= $wpdb->prepare( ' AND serial_numbers.product_id = %d', $args['product_id'] ); - } - - return $clauses; - } -} diff --git a/trunk/src/Models/Key.php b/trunk/src/Models/Key.php deleted file mode 100644 index 77c09881..00000000 --- a/trunk/src/Models/Key.php +++ /dev/null @@ -1,855 +0,0 @@ - 0, - 'serial_key' => '', - 'product_id' => 0, - 'activation_limit' => 0, - 'activation_count' => 0, - 'order_id' => 0, - 'vendor_id' => 0, - 'status' => 'available', - 'validity' => 0, - 'order_date' => '', - 'source' => 'custom_source', - 'created_date' => '', - ); - - /* - |-------------------------------------------------------------------------- - | Getters and Setters - |-------------------------------------------------------------------------- - | - | Methods for getting and setting data. - | - */ - /** - * Get the key. - * - * @since 1.4.6 - * - * @return string - */ - public function get_id() { - return $this->get_prop( 'id' ); - } - - /** - * Set the key. - * - * @param string $id Key. - * - * @since 1.4.6 - * - * @return void - */ - public function set_id( $id ) { - $this->set_prop( 'id', absint( $id ) ); - } - - /** - * Get the serial key. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return string - */ - public function get_serial_key( $context = 'edit' ) { - return $this->get_prop( 'serial_key', $context ); - } - - /** - * Get the key. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return string - */ - public function get_key( $context = 'edit' ) { - return $this->get_serial_key( $context ); - } - - /** - * Set the serial key. - * - * @param string $serial_key Serial key. - * - * @since 1.4.6 - * - * @return void - */ - public function set_serial_key( $serial_key ) { - $this->set_prop( 'serial_key', sanitize_textarea_field( $serial_key ) ); - } - - /** - * Get the product id. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return int - */ - public function get_product_id( $context = 'edit' ) { - return $this->get_prop( 'product_id', $context ); - } - - /** - * Get product. - * - * @since 1.4.6 - * - * @return \WC_Product|null Product object or null if not found. - */ - public function get_product() { - $product_id = $this->get_product_id(); - - if ( $product_id ) { - return wc_get_product( $product_id ); - } - - return null; - } - - /** - * Get product name. - * - * @since 1.4.6 - * - * @return string Product name. - */ - public function get_product_title() { - return wcsn_get_product_title( $this->get_product_id() ); - } - - /** - * Set the product id. - * - * @param int $product_id Product id. - * - * @since 1.4.6 - * - * @return void - */ - public function set_product_id( $product_id ) { - $this->set_prop( 'product_id', absint( $product_id ) ); - } - - /** - * Get the activation limit. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return int - */ - public function get_activation_limit( $context = 'edit' ) { - return $this->get_prop( 'activation_limit', $context ); - } - - /** - * Set the activation limit. - * - * @param int $activation_limit Activation limit. - * - * @since 1.4.6 - * - * @return void - */ - public function set_activation_limit( $activation_limit ) { - $this->set_prop( 'activation_limit', absint( $activation_limit ) ); - } - - /** - * Get the activation count. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return int - */ - public function get_activation_count( $context = 'edit' ) { - return $this->get_prop( 'activation_count', $context ); - } - - /** - * Set the activation count. - * - * @param int $activation_count Activation count. - * - * @since 1.4.6 - * - * @return void - */ - public function set_activation_count( $activation_count ) { - $this->set_prop( 'activation_count', absint( $activation_count ) ); - } - - /** - * Get the order id. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return int - */ - public function get_order_id( $context = 'edit' ) { - return $this->get_prop( 'order_id', $context ); - } - - /** - * Get order. - * - * @since 1.4.6 - * - * @return \WC_Order|null Order object or null if not found. - */ - public function get_order() { - $order_id = $this->get_order_id(); - - if ( $order_id ) { - return wc_get_order( $order_id ); - } - - return null; - } - - /** - * Get order title. - * - * @since 1.4.6 - * - * @return string Order title. - */ - public function get_order_title() { - if ( ! $this->get_order() ) { - return ''; - } - - return sprintf( - '(#%1$s) %2$s', - $this->get_order()->get_id(), - wp_strip_all_tags( $this->get_order()->get_formatted_billing_full_name() ) - ); - } - - /** - * Set the order id. - * - * @param int $order_id Order id. - * - * @since 1.4.6 - * - * @return void - */ - public function set_order_id( $order_id ) { - $this->set_prop( 'order_id', absint( $order_id ) ); - } - - /** - * Get the vendor id. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return int - */ - public function get_vendor_id( $context = 'edit' ) { - return $this->get_prop( 'vendor_id', $context ); - } - - /** - * Get vendor. - * - * @since 1.4.6 - * - * @return \WP_User|null Vendor object or null if not found. - */ - public function get_vendor() { - $vendor_id = $this->get_vendor_id(); - - if ( $vendor_id ) { - return get_user_by( 'id', $vendor_id ); - } - - return null; - } - - /** - * Set the vendor id. - * - * @param int $vendor_id Vendor id. - * - * @since 1.4.6 - * - * @return void - */ - public function set_vendor_id( $vendor_id ) { - $this->set_prop( 'vendor_id', absint( $vendor_id ) ); - } - - /** - * Get the status. - * Possible values: 'active', 'inactive', 'expired', 'cancelled', 'pending', 'failed', 'refunded', 'deleted'. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return string - */ - public function get_status( $context = 'edit' ) { - return $this->get_prop( 'status', $context ); - } - - /** - * Set the status. - * Possible values: 'active', 'inactive', 'expired', 'cancelled', 'pending', 'failed', 'refunded', 'deleted'. - * - * @param string $status Status. - * - * @since 1.4.6 - * - * @return void - */ - public function set_status( $status ) { - if ( array_key_exists( $status, wcsn_get_key_statuses() ) ) { - $this->set_prop( 'status', $status ); - } - } - - /** - * Get the validity. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return string - */ - public function get_validity( $context = 'edit' ) { - return $this->get_prop( 'validity', $context ); - } - - /** - * Set the validity. - * - * @param string $validity Validity. - * - * @since 1.4.6 - * - * @return void - */ - public function set_validity( $validity ) { - $this->set_prop( 'validity', absint( $validity ) ); - } - - /** - * Get the order date. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return string - */ - public function get_order_date( $context = 'edit' ) { - return $this->get_prop( 'order_date', $context ); - } - - /** - * Set the order date. - * - * @param string $order_date Order date. - * - * @since 1.4.6 - * - * @return void - */ - public function set_order_date( $order_date ) { - $this->set_date_prop( 'order_date', $order_date ); - } - - /** - * Get the source. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return string - */ - public function get_source( $context = 'edit' ) { - return $this->get_prop( 'source', $context ); - } - - /** - * Set the source. - * - * @param string $source Source. - * - * @since 1.4.6 - * - * @return void - */ - public function set_source( $source ) { - $this->set_prop( 'source', sanitize_text_field( $source ) ); - } - - /** - * Get the created date. - * - * @param string $context What the value is for. Valid values are 'view' and 'edit'. - * - * @since 1.4.6 - * - * @return int - */ - public function get_created_date( $context = 'edit' ) { - return $this->get_prop( 'created_date', $context ); - } - - /** - * Set the created date. - * - * @param string $created_date Created date. - * - * @since 1.4.6 - * - * @return void - */ - public function set_created_date( $created_date ) { - $this->set_date_prop( 'created_date', $created_date ); - } - - /* - |-------------------------------------------------------------------------- - | CRUD methods - |-------------------------------------------------------------------------- - | - | Methods which create, read, update and delete discounts from the database. - | - */ - /** - * Saves an object in the database. - * - * @since 1.0.0 - * @return true|\WP_Error True on success, WP_Error on failure. - */ - public function save() { - // Product id is required. - if ( ! $this->get_product_id() ) { - return new \WP_Error( 'missing-required', __( 'Product id is required.', 'wc-serial-numbers' ) ); - } - - // Check if product id is valid. - if ( empty( wc_get_product( $this->get_product_id() ) ) ) { - return new \WP_Error( 'invalid-data', __( 'Product id is invalid.', 'wc-serial-numbers' ) ); - } - - // Serial key is required. - if ( ! $this->get_serial_key() ) { - return new \WP_Error( 'missing-required', __( 'Serial key is required.', 'wc-serial-numbers' ) ); - } - - // Duplicate serial key is not allowed. - if ( ! wcsn_is_duplicate_key_allowed() ) { - $existing = self::get( - array( - 'serial_key' => $this->get_serial_key(), - ) - ); - - if ( $existing && $existing->get_id() !== $this->get_id() ) { - return new \WP_Error( 'invalid-data', __( 'Serial key already exists. Duplicate serial keys are not allowed.', 'wc-serial-numbers' ) ); - } - } - - // If order id is set, check if it is valid. - if ( $this->get_order_id() && empty( wc_get_order( $this->get_order_id() ) ) ) { - return new \WP_Error( 'invalid-data', __( 'Order id is invalid.', 'wc-serial-numbers' ) ); - } - - // If status is available, order date should not be set. - if ( 'available' === $this->get_status() ) { - $this->set_order_id( 0 ); - $this->set_order_date( null ); - $this->set_activation_count( 0 ); - } - - // If order is set, order date should be set. - if ( $this->get_order_id() && ! $this->get_order_date() ) { - $order = wc_get_order( $this->get_order_id() ); - // Get order confirmed date. - $order_date = $order->get_date_completed() ? $order->get_date_completed()->getTimestamp() : wp_date( 'Y-m-d H:i:s' ); - $this->set_date_prop( 'order_date', $order_date ); - } - - // If key is not created yet, set created date. - if ( ! $this->get_created_date() ) { - $this->set_date_prop( 'created_date', wp_date( 'Y-m-d H:i:s' ) ); - } - - return parent::save(); - } - - /* - |-------------------------------------------------------------------------- - | Query Methods - |-------------------------------------------------------------------------- - | - | Methods for reading and manipulating the object properties. - | - */ - - /** - * Retrieve the object instance. - * - * @param int|array|static $data Object ID or array of arguments. - * - * @since 1.0.0 - * - * @return static|false Object instance on success, false on failure. - */ - public static function get( $data ) { - // If by is set to serial key, encrypt it. - if ( is_array( $data ) && array_key_exists( 'serial_key', $data ) ) { - $data['serial_key'] = wcsn_encrypt_key( $data['serial_key'] ); - } - - return parent::get( $data ); - } - - /** - * Prepare where query. - * - * @param array $clauses Query clauses. - * @param array $args Array of args to pass to the query method. - * - * @since 1.0.0 - * @return array - */ - protected function prepare_where_query( $clauses, $args = array() ) { - global $wpdb; - $clauses = parent::prepare_where_query( $clauses, $args ); - - // If customer id is set, find the orders having that customer id and limit the results to those orders. - if ( ! empty( $args['customer_id'] ) ) { - $customer_id = absint( $args['customer_id'] ); - $order_ids = wc_get_orders( - array( - 'customer_id' => $customer_id, - 'limit' => - 1, - 'return' => 'ids', - ) - ); - - if ( ! empty( $order_ids ) ) { - $clauses['where'] .= " AND {$this->table_name}.order_id IN (" . implode( ',', $order_ids ) . ')'; - } else { - $clauses['where'] .= ' AND 0'; - } - } - - return $clauses; - } - - /** - * Prepare search query. - * - * @param array $clauses Query clauses. - * @param array $args Array of args to pass to the query method. - * - * @since 1.0.0 - * @return array - */ - protected function prepare_search_query( $clauses, $args = array() ) { - global $wpdb; - /** - * Filter the search query before setting up the query. - * - * @param array $clauses Query clauses. - * @param array $args Query arguments. - * @param static $this Current instance of the class. - * - * @return array - * @since 1.0.0 - */ - $clauses = apply_filters( $this->get_hook_prefix() . '_pre_setup_search_query', $clauses, $args, $this ); - - if ( ! empty( $args['search'] ) ) { - $search = $args['search']; - if ( ! empty( $args['search_columns'] ) ) { - $search_columns = wp_parse_list( $args['search_columns'] ); - } else { - /** - * Filter the columns to search in when performing a search query. - * - * @param array $search_columns Array of columns to search in. - * @param array $args Query arguments. - * @param static $object Current instance of the class. - * - * @return array - * @since 1.0.0 - */ - $search_columns = apply_filters( $this->get_hook_prefix() . '_search_columns', $this->get_searchable_keys(), $args, $this ); - } - $search_columns = array_filter( array_unique( $search_columns ) ); - $like = '%' . $wpdb->esc_like( $search ) . '%'; - - $search_clauses = array(); - foreach ( $search_columns as $column ) { - if ( 'serial_key' === $column ) { - $like = '%' . $wpdb->esc_like( wcsn_encrypt_key( $search ) ) . '%'; - } - $search_clauses[] = $wpdb->prepare( $this->table_name . '.' . $column . ' LIKE %s', $like ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared - } - - if ( ! empty( $search_clauses ) ) { - $clauses['where'] .= 'AND (' . implode( ' OR ', $search_clauses ) . ')'; - } - } - - /** - * Filter the search query after setting up the query. - * - * @param array $clauses Query clauses. - * @param array $args Query arguments. - * @param static $this Current instance of the class. - * - * @return array - * @since 1.0.0 - */ - return apply_filters( $this->get_hook_prefix() . '_setup_search_query', $clauses, $args, $this ); - } - - /* - |-------------------------------------------------------------------------- - | Helpers Methods - |-------------------------------------------------------------------------- - | - | Common methods used by the class. - | - */ - /** - * Get status label. - * - * @since 1.5.6 - * @return string - */ - public function get_status_label() { - $statuses = wcsn_get_key_statuses(); - if ( array_key_exists( $this->get_status(), $statuses ) ) { - return $statuses[ $this->get_status() ]; - } - - return '—'; - } - - /** - * Reset activations. - * - * @since 1.0.0 - */ - public function reset_activations() { - $activations = $this->get_activations(); - foreach ( $activations as $activation ) { - $activation->delete(); - } - } - /** - * Get customer id. - * - * @since 1.0.0 - * - * @return int - */ - public function get_customer_id() { - if ( ! $this->get_order() ) { - return 0; - } - - return $this->get_order()->get_customer_id(); - } - - /** - * Get customer email. - * - * @since 1.0.0 - * - * @return string - */ - public function get_customer_email() { - if ( ! $this->get_order() ) { - return ''; - } - - return $this->get_order()->get_billing_email(); - } - - /** - * Get customer name. - * - * @since 1.0.0 - * - * @return string - */ - public function get_customer_name() { - if ( ! $this->get_order() ) { - return ''; - } - - return $this->get_order()->get_formatted_billing_full_name(); - } - - /** - * Get the expiry date. - * - * @since 1.4.6 - * - * @return string - */ - public function get_expire_date() { - // If order date is not set or validity is not set, return empty string. - if ( ! $this->get_order_date() || ! $this->get_validity() ) { - return ''; - } - $order_date = $this->get_order_date(); - $validity = $this->get_validity(); - - $expiry_date = strtotime( "+{$validity} days", strtotime( $order_date ) ); - - return wp_date( 'Y-m-d H:i:s', $expiry_date ); - } - - /** - * Recount activations. - * - * @since 1.0.0 - * - * @return int - */ - public function recount_remaining_activation() { - $count = $this->get_activations( array( 'count' => true ) ); - $this->set_activation_count( $count ); - $this->save(); - - return $count; - } - - /** - * Check if the key is expired. - * - * @since 1.0.0 - * @return bool - */ - public function is_expired() { - if ( ! $this->get_order_date() || ! $this->get_validity() ) { - return false; - } - - return strtotime( $this->get_expire_date() ) < time(); - } - - /** - * Get remaining activations. - * - * @since 1.0.0 - * @return int - */ - public function get_activations_left() { - $activation_count = $this->get_activation_count(); - $activation_limit = $this->get_activation_limit(); - if ( ! $activation_limit ) { - return 9999; - } - - return $activation_limit - $activation_count; - } - - /** - * Get activations. - * - * @param array $args Array of args to pass to the query method. - * - * @since 1.0.0 - * - * @return array|int Array of activations or count. - */ - public function get_activations( $args = array() ) { - $args = wp_parse_args( - $args, - array( - 'serial_id' => $this->get_id(), - ) - ); - - return Activation::query( $args ); - } - - /** - * Display the serial key. - * - * @param bool $masked Whether to mask the key or not. - * - * @since 1.5.0 - * @return string - */ - public function print_key( $masked = false ) { - $key = $this->get_serial_key(); - if ( $masked ) { - // Divide the length of the key by 3 and round up. Then mask the middle part of the key. - $mask_length = ceil( strlen( $key ) / 3 ); - $mask_start = ceil( ( strlen( $key ) - $mask_length ) / 2 ); - $mask_end = $mask_start + $mask_length; - $masked_key = substr( $key, 0, $mask_start ) . str_repeat( '*', $mask_length ) . substr( $key, $mask_end ); - $key = sprintf( '%s', esc_attr( $masked_key ), esc_attr( $key ), $masked_key ); - } else { - $key = sprintf( '%s', esc_attr( $key ), esc_attr( $key ), $key ); - } - - return apply_filters( $this->get_hook_prefix() . '_display_key', $key, $this ); - } -} diff --git a/trunk/src/Models/Model.php b/trunk/src/Models/Model.php deleted file mode 100644 index 5d1bcf9a..00000000 --- a/trunk/src/Models/Model.php +++ /dev/null @@ -1,21 +0,0 @@ -cart->get_cart_contents(); - foreach ( $cart_products as $id => $cart_product ) { - // @var \WC_Product $product Product object. - $product = $cart_product['data']; - $product_id = $product->get_id(); - $quantity = $cart_product['quantity']; - $allow_backorder = apply_filters( 'wc_serial_numbers_allow_backorder', false, $product_id, $cart_product ); - - if ( wcsn_is_product_enabled( $product_id ) && ! $allow_backorder ) { - $per_item_quantity = absint( apply_filters( 'wc_serial_numbers_per_product_delivery_qty', 1, $product_id ) ); - $needed_quantity = $quantity * ( empty( $per_item_quantity ) ? 1 : absint( $per_item_quantity ) ); - $source = apply_filters( 'wc_serial_numbers_product_serial_source', 'custom_source', $product_id, $needed_quantity ); - if ( 'custom_source' === $source ) { - $args = array( - 'product_id' => $product_id, - 'status' => 'available', - ); - $total_found = Key::count( $args ); - if ( $total_found < $needed_quantity ) { - $stock = floor( $total_found / $per_item_quantity ); - // translators: %1$s: product title, %2$s: stock quantity. - $message = sprintf( esc_html__( 'Sorry, there aren’t enough Serial Keys for %1$s. Please remove this item or lower the quantity. For now, we have %2$s Serial Keys for this product.', 'wc-serial-numbers' ), '{product_title}', '{stock_quantity}' ); - $notice = apply_filters( 'wc_serial_numbers_low_stock_message', $message ); - $notice = str_replace( '{product_title}', $product->get_title(), $notice ); - $notice = str_replace( '{stock_quantity}', $stock, $notice ); - - wc_add_notice( $notice, 'error' ); - - return; - } - } - } - - do_action( 'wc_serial_number_product_cart_validation_complete', $product_id, $cart_product ); - } - } - - /** - * Automatically set the order's status to complete. - * - * @param string $new_order_status The new order status. - * @param int $order_id The order ID. - * @param \WC_Order $order The order object. - * - * @since 1.4.6 - * @return string $new_order_status - */ - public static function maybe_autocomplete_order( $new_order_status, $order_id, $order = null ) { - // Exit early if the order has no ID, or if the new order status is not 'processing'. - if ( 'yes' !== get_option( 'wc_serial_numbers_autocomplete_order' ) || 0 === $order_id || 'processing' !== $new_order_status ) { - return $new_order_status; - } - if ( null === $order ) { - remove_filter( 'woocommerce_payment_complete_order_status', __METHOD__, 10 ); - $order = wc_get_order( $order_id ); - add_filter( 'woocommerce_payment_complete_order_status', __METHOD__, 10, 3 ); - } - - if ( wcsn_order_has_products( $order ) ) { - $new_order_status = 'completed'; - // Add a note to the order mentioning that the order has been automatically completed by the plugin. - $order->add_order_note( - apply_filters( - 'wc_serial_numbers_autocomplete_order_note', - __( 'Order automatically completed by the Serial Numbers for WooCommerce.', 'wc-serial-numbers' ), - $order - ) - ); - } - - return $new_order_status; - } - - /** - * Handle order status changed. - * - * @param int|\WC_Order $order_id The order ID or WC_Order object. - * - * @since 1.4.6 - */ - public static function handle_order_status_changed( $order_id ) { - if ( apply_filters( 'wc_serial_numbers_maybe_manual_delivery', false, $order_id ) ) { - return; - } - wcsn_order_update_keys( $order_id ); - } - - /** - * Print ordered serials - * - * @param \WC_Order $order The order object. - * - * @since 1.2.0 - */ - public static function order_display_keys( $order ) { - /** - * Filter to allow or disallow displaying keys in order details. - * - * @param bool $allow Whether to allow or disallow displaying serial numbers in order details. - * @param \WC_Order $order The order object. - */ - $allow = apply_filters( 'wc_serial_numbers_allow_order_display_keys', $order->has_status( 'completed' ), $order ); - - if ( ! $allow || ! wcsn_order_has_products( $order ) ) { - return; - } - - wcsn_display_order_keys( $order ); - } - - /** - * Order email keys. - * - * @param \WC_Order $order The order object. - * - * @since 1.2.0 - */ - public static function order_email_keys( $order ) { - /** - * Filter to allow or disallow sending serial numbers in order emails. - * - * @param bool $allow Whether to allow or disallow sending serial numbers in order emails. - * @param \WC_Order $order The order object. - */ - $allow = apply_filters( 'wc_serial_numbers_allow_order_email_keys', $order->has_status( 'completed' ), $order ); - - if ( ! $allow || ! wcsn_order_has_products( $order ) ) { - return; - } - - wcsn_display_order_keys( $order ); - } -} diff --git a/trunk/src/Plugin.php b/trunk/src/Plugin.php deleted file mode 100644 index bd870ff8..00000000 --- a/trunk/src/Plugin.php +++ /dev/null @@ -1,177 +0,0 @@ -includes(); - $this->init_hooks(); - } - - /** - * Include required files. - * - * @since 1.0.0 - * @return void - */ - public function includes() { - require_once __DIR__ . '/functions.php'; - require_once __DIR__ . '/Deprecated/Functions.php'; - } - - /** - * Hook into actions and filters. - * - * @since 1.0.0 - * @return void - */ - public function init_hooks() { - register_activation_hook( $this->get_file(), array( Installer::class, 'install' ) ); - add_action( 'admin_notices', array( $this, 'dependencies_notices' ) ); - add_action( 'before_woocommerce_init', array( $this, 'on_before_woocommerce_init' ) ); - add_action( 'woocommerce_loaded', array( $this, 'init' ), 0 ); - } - - /** - * Run on before WooCommerce init. - * - * @since 1.0.0 - * @return void - */ - public function on_before_woocommerce_init() { - if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { - \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', $this->get_file(), true ); - } - } - - /** - * Missing dependencies notice. - * - * @since 1.0.0 - * @return void - */ - public function dependencies_notices() { - if ( $this->is_plugin_active( 'woocommerce' ) ) { - return; - } - $notice = sprintf( - /* translators: 1: plugin name 2: WooCommerce */ - __( '%1$s requires %2$s to be installed and active.', 'wc-serial-numbers' ), - '' . esc_html( $this->get_name() ) . '', - '' . esc_html__( 'WooCommerce', 'wc-serial-numbers' ) . '' - ); - - echo '

    ' . wp_kses_post( $notice ) . '

    '; - } - - /** - * Init the plugin after plugins_loaded so environment variables are set. - * - * @since 1.0.0 - * @return void - */ - public function init() { - $this->services['installer'] = new Installer(); - $this->services['cron'] = new Cron(); - $this->services['cache'] = new Cache(); - $this->services['encryption'] = new Encryption(); - $this->services['orders'] = new Orders(); - $this->services['stocks'] = new Stocks(); - $this->services['ajax'] = new Ajax(); - $this->services['actions'] = new Actions(); - $this->services['restapi'] = new RestAPI(); - $this->services['utilities'] = new Utilities\Utilities(); - $this->services['frontend'] = new Frontend\Frontend(); - - if ( wcsn_is_software_support_enabled() ) { - $this->services['api'] = new API(); - } - - if ( self::is_request( 'admin' ) ) { - $this->services['admin'] = new Admin\Admin(); - } - - // Init action. - do_action( 'wc_serial_numbers_loaded' ); - } - - /** - * Determines if the pro version active. - * - * @since 1.0.0 - * @return bool - * @deprecated 1.4.0 - */ - public static function is_pro_active() { - _deprecated_function( __METHOD__, '1.4.0', 'Plugin::is_premium_active()' ); - - return self::$instance->is_premium_active(); - } - - /** - * Determines if the wc is active. - * - * @since 1.0.0 - * @return bool - * @deprecated 1.4.0 - */ - public function is_wc_active() { - return $this->is_plugin_active( 'woocommerce/woocommerce.php' ); - } - - /** - * Plugin URL getter. - * - * @since 1.2.0 - * @return string - * @deprecated 1.4.0 - */ - public function plugin_url() { - _deprecated_function( __METHOD__, '1.4.0', 'Plugin::get_url()' ); - - return $this->get_url(); - } - - /** - * Plugin path getter. - * - * @since 1.2.0 - * @return string - * @deprecated 1.4.0 - */ - public function plugin_path() { - _deprecated_function( __METHOD__, '1.4.0', 'Plugin::get_path()' ); - - return $this->get_path(); - } - - /** - * Plugin base path name getter. - * - * @since 1.2.0 - * @return string - * @deprecated 1.4.2 - */ - public function plugin_basename() { - _deprecated_function( __METHOD__, '1.4.2', 'Plugin::get_basename()' ); - - return $this->get_basename(); - } -} diff --git a/trunk/src/RestAPI.php b/trunk/src/RestAPI.php deleted file mode 100644 index c2f7d497..00000000 --- a/trunk/src/RestAPI.php +++ /dev/null @@ -1,411 +0,0 @@ - 'GET', - 'permission_callback' => array( $this, 'validate_request' ), - 'callback' => array( $this, 'validate_key' ), - 'args' => array( - 'product_id' => array( - 'required' => true, - 'type' => array( 'string', 'integer' ), - ), - 'serial_key' => array( - 'required' => true, - 'type' => 'string', - ), - 'email' => array( - 'required' => false, - 'type' => 'email', - ), - ), - ) - ); - - // activate key. - register_rest_route( - 'wcsn', - '/activate', - array( - 'methods' => 'GET', - 'permission_callback' => array( $this, 'validate_request' ), - 'callback' => array( $this, 'activate_key' ), - 'args' => array( - 'product_id' => array( - 'required' => true, - 'type' => 'string', - ), - 'serial_key' => array( - 'required' => true, - 'type' => 'string', - ), - 'email' => array( - 'required' => false, - 'type' => 'email', - ), - ), - ) - ); - - // deactivate key. - register_rest_route( - 'wcsn', - '/deactivate', - array( - 'methods' => 'GET', - 'permission_callback' => array( $this, 'validate_request' ), - 'callback' => array( $this, 'deactivate_key' ), - 'args' => array( - 'product_id' => array( - 'required' => true, - 'type' => 'string', - ), - 'serial_key' => array( - 'required' => true, - 'type' => 'string', - ), - 'email' => array( - 'required' => false, - 'type' => 'email', - ), - ), - ) - ); - - // Check version. - register_rest_route( - 'wcsn', - '/version_check', - array( - 'methods' => 'GET', - 'permission_callback' => array( $this, 'validate_request' ), - 'callback' => array( $this, 'version_check' ), - array( - 'product_id' => array( - 'required' => true, - 'type' => 'string', - ), - 'serial_key' => array( - 'required' => true, - 'type' => 'string', - ), - 'email' => array( - 'required' => false, - 'type' => 'email', - ), - ), - ) - ); - } - - /** - * Check if a given request has access to create an item. - * - * @param \WP_REST_Request $request Full details about the request. - * - * @return \WP_Error|boolean - */ - public function validate_request( $request ) { - $product_id = absint( $request->get_param( 'product_id' ) ); - $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); - $email = sanitize_email( $request->get_param( 'email' ) ); - - // Check if product ID is valid. - if ( ! $product_id || ! get_post( $product_id ) ) { - return new \WP_Error( 'invalid_product_id', __( 'Invalid product ID.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - // Check if key is valid. - if ( empty( $key ) ) { - return new \WP_Error( 'missing_key', __( 'Serial key is required.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - // Check if key exists. - $serial_key = Key::get( - array( - 'serial_key' => $key, - 'product_id' => $product_id, - ) - ); - if ( ! $serial_key ) { - return new \WP_Error( 'invalid_key', __( 'Serial key is invalid.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - // Check if the key has order ID. - if ( empty( $serial_key->get_order_id() ) || ( $serial_key->get_order_id() && ! get_post( $serial_key->get_order_id() ) ) ) { - return new \WP_Error( 'invalid_key', __( 'Serial key is not authorized to use.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - // Check if order status is completed. - $order = wc_get_order( $serial_key->get_order_id() ); - if ( ! $order || ! apply_filters( 'wc_serial_numbers_api_validate_order_status', 'completed' === $order->get_status(), $order ) ) { - return new \WP_Error( 'invalid_order', __( 'Please complete your order to activate the serial key.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - // Check if key is valid for the product. - if ( $serial_key->get_product_id() !== $product_id ) { - return new \WP_Error( 'invalid_product_key', __( 'Serial key is not valid for this product.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - // If email is provided, check if it is valid. - if ( ( $email || wcsn_is_duplicate_key_allowed() ) && strtolower( $order->get_billing_email() ) !== $email ) { - return new \WP_Error( 'invalid_email', __( 'Invalid email address.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - // based on key status send response. - if ( 'expired' === $serial_key->get_status() ) { - return new \WP_Error( 'expired_key', __( 'Serial key is expired.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } elseif ( 'cancelled' === $serial_key->get_status() ) { - return new \WP_Error( 'key_cancelled', __( 'Serial key is cancelled.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - - } elseif ( 'sold' !== $serial_key->get_status() ) { - return new \WP_Error( 'invalid_key_status', __( 'Invalid serial key.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - return true; - } - - /** - * Validate key. - * - * @param \WP_REST_Request $request Full details about the request. - * - * @return \WP_REST_Response - */ - public function validate_key( $request ) { - $product_id = absint( $request->get_param( 'product_id' ) ); - $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); - - $serial_key = Key::get( - array( - 'serial_key' => $key, - 'product_id' => $product_id, - ) - ); - - $response = array( - 'code' => 'key_valid', - 'message' => __( 'Serial key is valid.', 'wc-serial-numbers' ), - 'activation_limit' => $serial_key->get_activation_limit(), - 'activation_count' => $serial_key->get_activation_count(), - 'activations_left' => $serial_key->get_activations_left(), - 'expire_date' => $serial_key->get_expire_date(), - 'status' => 'sold' === $serial_key->get_status() ? 'active' : $serial_key->get_status(), - 'product_id' => $serial_key->get_product_id(), - 'product' => $serial_key->get_product_title(), - 'activations' => $serial_key->get_activations( - array( - 'limit' => - 1, - 'output' => ARRAY_A, - ) - ), - - // Deprecated. - 'remaining' => $serial_key->get_activations_left(), - ); - - // send response. - return rest_ensure_response( apply_filters( 'wc_serial_numbers_api_validate_response', $response, $serial_key ) ); - } - - /** - * Activate key. - * - * @param \WP_REST_Request $request Full details about the request. - * - * @return \WP_REST_Response|\WP_Error Activation response. - */ - public function activate_key( $request ) { - $product_id = absint( $request->get_param( 'product_id' ) ); - $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); - $email = sanitize_email( $request->get_param( 'email' ) ); - $instance = sanitize_text_field( $request->get_param( 'instance' ) ); - $platform = sanitize_text_field( $request->get_param( 'platform' ) ); - - // if instance is not provided, create a new instance based on the request. - if ( empty( $instance ) ) { - $instance = md5( $email . $platform . time() ); - } - - $serial_key = Key::get( - array( - 'serial_key' => $key, - 'product_id' => $product_id, - ) - ); - - // Check if instance is already activated. - $activation = Activation::get( - array( - 'serial_id' => $serial_key->get_id(), - 'instance' => $instance, - ) - ); - - if ( $activation ) { - return new \WP_Error( 'instance_already_activated', __( 'Instance is already activated.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - // Check if key is already activated. - if ( $serial_key->get_activations_left() <= 0 ) { - return new \WP_Error( 'no_activations_left', __( 'Activation limit reached.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - // Create activation. - $activation = Activation::insert( - array( - 'serial_id' => $serial_key->get_id(), - 'instance' => $instance, - 'platform' => $platform, - ) - ); - - $serial_key->recount_remaining_activation(); - - $response = array( - 'code' => 'key_activated', - 'message' => __( 'Serial key is activated.', 'wc-serial-numbers' ), - 'activated' => true, - 'instance' => $activation->get_instance(), - 'platform' => $activation->get_platform(), - 'activation_limit' => $serial_key->get_activation_limit(), - 'activation_count' => $serial_key->get_activation_count(), - 'activations_left' => $serial_key->get_activations_left(), - 'expires_at' => $serial_key->get_expire_date(), - 'product_id' => $serial_key->get_product_id(), - 'product' => $serial_key->get_product_title(), - 'activations' => $serial_key->get_activations( - array( - 'limit' => - 1, - 'output' => ARRAY_A, - ) - ), - - // Deprecated. - 'remaining' => $serial_key->get_activations_left(), - ); - - // send response. - return rest_ensure_response( apply_filters( 'wc_serial_numbers_api_activate_response', $response, $activation, $serial_key ) ); - } - - /** - * Deactivate key. - * - * @param \WP_REST_Request $request Full details about the request. - * - * @return \WP_REST_Response|\WP_Error Deactivation response. - */ - public function deactivate_key( $request ) { - $product_id = absint( $request->get_param( 'product_id' ) ); - $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); - $instance = sanitize_text_field( $request->get_param( 'instance' ) ); - - if ( empty( $instance ) ) { - return new \WP_Error( 'missing_instance', __( 'Instance is missing, You must provide an instance to deactivate license.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - $serial_key = Key::get( - array( - 'serial_key' => $key, - 'product_id' => $product_id, - ) - ); - - $activation = Activation::get( - array( - 'serial_id' => $serial_key->get_id(), - 'instance' => $instance, - ) - ); - - if ( ! $activation ) { - return new \WP_Error( 'instance_not_found', __( 'Instance not found.', 'wc-serial-numbers' ), array( 'status' => 400 ) ); - } - - $activation->delete(); - $serial_key->recount_remaining_activation(); - - $response = array( - 'code' => 'key_deactivated', - 'message' => __( 'Serial key is deactivated.', 'wc-serial-numbers' ), - 'deactivated' => true, - 'instance' => $activation->get_instance(), - 'activation_limit' => $serial_key->get_activation_limit(), - 'activation_count' => $serial_key->get_activation_count(), - 'activations_left' => $serial_key->get_activations_left(), - 'expires_at' => $serial_key->get_expire_date(), - 'product_id' => $serial_key->get_product_id(), - 'product' => $serial_key->get_product_title(), - 'activations' => $serial_key->get_activations( - array( - 'limit' => - 1, - 'output' => ARRAY_A, - ) - ), - - // Deprecated. - 'remaining' => $serial_key->get_activations_left(), - ); - - // send response. - return rest_ensure_response( apply_filters( 'wc_serial_numbers_api_deactivate_response', $response, $activation, $serial_key ) ); - } - - /** - * Check version. - * - * @param \WP_REST_Request $request Full details about the request. - * - * @return \WP_REST_Response|\WP_Error Version check response. - */ - public function version_check( $request ) { - $product_id = absint( $request->get_param( 'product_id' ) ); - $key = sanitize_text_field( $request->get_param( 'serial_key' ) ); - - $serial_key = Key::get( - array( - 'serial_key' => $key, - 'product_id' => $product_id, - ) - ); - - $response = array( - 'code' => 'version_checked', - 'product_id' => $serial_key->get_product_id(), - 'product' => $serial_key->get_product_title(), - 'version' => get_post_meta( $serial_key->get_product_id(), '_software_version', true ), - ); - - // send response. - return rest_ensure_response( $response ); - } -} diff --git a/trunk/src/Stocks.php b/trunk/src/Stocks.php deleted file mode 100644 index 0f358e14..00000000 --- a/trunk/src/Stocks.php +++ /dev/null @@ -1,43 +0,0 @@ -get_id() ) ) { - $stocks = wcsn_get_stocks_count(); - if ( isset( $stocks[ $product->get_id() ] ) ) { - $quantity = $stocks[ $product->get_id() ]; - } - } - - return $quantity; - } -} diff --git a/trunk/src/Utilities/Utilities.php b/trunk/src/Utilities/Utilities.php deleted file mode 100644 index 4dff1c35..00000000 --- a/trunk/src/Utilities/Utilities.php +++ /dev/null @@ -1,31 +0,0 @@ - __( 'Available', 'wc-serial-numbers' ), // when ready for selling. - 'pending' => __( 'Pending', 'wc-serial-numbers' ), // Assigned to an order but not paid yet. - 'sold' => __( 'Sold', 'wc-serial-numbers' ), // Assigned to an order and paid. - 'expired' => __( 'Expired', 'wc-serial-numbers' ), // when expired. - 'cancelled' => __( 'Cancelled', 'wc-serial-numbers' ), // when cancelled. - ); - - return apply_filters( 'wc_serial_numbers_key_statuses', $statuses ); -} - -/** - * Check if serial number is reusing. - * - * @since 1.2.0 - * @return bool - */ -function wcsn_is_reusing_keys() { - return 'yes' === get_option( 'wc_serial_numbers_reuse_serial_number', 'no' ); -} - -/** - * Get order revoke statuses. - * - * @since 1.4.6 - * @return array - */ -function wcsn_get_revoke_statuses() { - $statues = array( - 'cancelled', - 'refunded', - 'failed', - 'pending', - ); - - return apply_filters( 'wc_serial_numbers_revoke_statuses', $statues ); -} - -/** - * Get key sources. - * - * @since 1.2.0 - * @return mixed|void - */ -function wcsn_get_key_sources() { - $sources = array( - 'custom_source' => __( 'Manually added', 'wc-serial-numbers' ), - ); - - return apply_filters( 'wc_serial_numbers_key_sources', $sources ); -} - -/** - * Return true if pre argument version is older than the current version. - * - * @param string $version WC version. - * - * @since 1.4.6 - * - * @return bool - */ -function wcsn_is_woocommerce_pre( $version ) { - return defined( 'WC_VERSION' ) && version_compare( WC_VERSION, $version, '<' ); -} - -/** - * Return the product object. - * - * @param int|mixed $product WC_Product or order ID. - * - * @since 1.4.6 - * - * @return null|\WC_Product object or null if not found. - */ -function wcsn_get_product_object( $product ) { - return is_object( $product ) ? $product : wc_get_product( $product ); -} - -/** - * Return the customer/user ID. - * - * @param int|mixed $order WC_Order or order ID. - * - * @since 1.4.6 - * - * @return bool|int|mixed false if not found. - */ -function wcsn_get_customer_id( $order ) { - $order = wcsn_get_order_object( $order ); - - if ( $order && ! ( $order instanceof \WC_Order_Refund ) ) { - return wcsn_is_woocommerce_pre( '3.0' ) ? $order->get_user_id() : $order->get_customer_id(); - } - - return false; -} - -/** - * Return the order object. - * - * @param int|mixed $order WC_Order or order ID. - * - * @since 1.4.6 - * - * @return bool|\WC_Order - */ -function wcsn_get_order_object( $order ) { - return is_object( $order ) ? $order : wc_get_order( $order ); -} - -/** - * Insert key. - * - * @param array $args Key arguments. - * @param boolean $wp_error Optional. Whether to return a WP_Error on failure. Default false. - * - * @since 1.4.6 - * @return Key|WP_Error object on success, WP_Error object on failure. - */ -function wcsn_insert_key( $args, $wp_error = true ) { - return Key::insert( $args, $wp_error ); -} - -/** - * Query keys. - * - * @param array $args Query arguments. - * @param bool $count Optional. Whether to return only the total found count. Default false. - * - * @since 1.4.6 - * @return Key[]|array|int Keys array or count of keys. - */ -function wcsn_get_keys( $args = array(), $count = false ) { - $defaults = array( - 'limit' => 20, - 'offset' => 0, - 'orderby' => 'id', - 'order' => 'DESC', - 'fields' => 'all', - ); - $args = wp_parse_args( $args, $defaults ); - if ( $count ) { - return Key::count( $args ); - } - - return Key::query( $args ); -} - -/** - * Get key. - * - * @param mixed $key Key ID. - * - * @since 1.4.6 - * @return Key|false - */ -function wcsn_get_key( $key ) { - return Key::get( $key ); -} - -/** - * Delete key. - * - * @param int $key_id Key ID. - * - * @since 1.4.6 - * @return bool True on success, false on failure. - */ -function wcsn_delete_key( $key_id ) { - $key = wcsn_get_key( $key_id ); - if ( ! $key ) { - return false; - } - - return $key->delete(); -} - -/** - * Insert activation. - * - * @param array $args Activation arguments. - * - * @since 1.4.6 - * @return Activation|WP_Error object on success, WP_Error object on failure. - */ -function wcsn_insert_activation( $args ) { - return Activation::insert( $args ); -} - -/** - * Query activations. - * - * @param array $args Query arguments. - * @param bool $count Optional. Whether to return only the total found count. Default false. - * - * @since 1.4.6 - * @return Activation[]|array|int Activations array or count of activations. - */ -function wcsn_get_activations( $args = array(), $count = false ) { - $defaults = array( - 'limit' => 20, - 'offset' => 0, - 'orderby' => 'id', - 'order' => 'DESC', - 'fields' => 'all', - ); - $args = wp_parse_args( $args, $defaults ); - if ( $count ) { - return Activation::count( $args ); - } - - return Activation::query( $args ); -} - -/** - * Get activation. - * - * @param mixed $activation Activation ID. - * - * @since 1.4.6 - * @return Activation|false - */ -function wcsn_get_activation( $activation ) { - return Activation::get( $activation ); -} - -/** - * Delete activation. - * - * @param int $activation_id Activation ID. - * - * @since 1.4.6 - * @return bool True on success, false on failure. - */ -function wcsn_delete_activation( $activation_id ) { - $activation = wcsn_get_activation( $activation_id ); - if ( ! $activation ) { - return false; - } - - return $activation->delete(); -} - -/** - * Check if product enabled for selling serial numbers. - * - * @param int $product_id Product ID. - * - * @since 1.2.0 - * @return bool True if enabled, false otherwise. - */ -function wcsn_is_product_enabled( $product_id ) { - return 'yes' === get_post_meta( $product_id, '_is_serial_number', true ); -} - -/** - * Get order items. - * - * @param int $order_id Order ID. - * @param int $order_item_id Order item ID. If not provided it will return all order items. - * - * @since 1.2.0 - * @return array - */ -function wcsn_get_order_line_items_data( $order_id, $order_item_id = null ) { - // Cache the line items. - $line_items = array(); - $order = wcsn_get_order_object( $order_id ); - $items = $order->get_items(); - if ( is_object( $order ) && count( $items ) > 0 ) { - foreach ( $items as $item_id => $item ) { - $product = $item->get_product(); - if ( ! $product ) { - continue; - } - $product_id = $product->get_id(); - if ( ! wcsn_is_product_enabled( $product_id ) ) { - continue; - } - if ( $order_item_id && absint( $order_item_id ) !== absint( $item_id ) ) { - continue; - } - $quantity = ! empty( $item->get_quantity() ) ? $item->get_quantity() : 0; - $refund_qty = $order->get_qty_refunded_for_item( $item_id ); - // Deprecated filter. - // todo: remove this filter in the future. - $sources = apply_filters( 'wc_serial_numbers_product_serial_source', 'custom_source', $product_id ); - $quantity = $quantity * apply_filters( 'wc_serial_numbers_per_product_delivery_qty', 1, $product_id, $order_id ); - - $data = array( - 'product_id' => $product_id, - 'order_item_id' => ! empty( $item_id ) ? (int) $item_id : 0, - 'refunded_qty' => $refund_qty, - 'quantity' => apply_filters( 'wc_serial_numbers_order_item_quantity', $quantity, $product_id, $order_id ), - 'key_source' => $sources, - ); - - $line_items[] = $data; - } - } - - return apply_filters( 'wc_serial_numbers_order_line_items_data', $line_items, $order_id ); -} - -/** - * Determine if the order contains product that enabled for selling serial numbers. - * - * @param int|WC_Order $order_id Order ID. - * - * @since 1.2.0 - * @return bool True if order contains product that enabled for selling serial numbers, false otherwise. - */ -function wcsn_order_has_products( $order_id ) { - return ! empty( wcsn_get_order_line_items_data( $order_id ) ); -} - -/** - * Get order keys. - * - * @param int $order_id Order ID. - * - * @since 1.0.0 - * @return Key[] - */ -function wcsn_order_get_keys( $order_id ) { - if ( ! wcsn_order_has_products( $order_id ) ) { - return array(); - } - - return Key::query( - array( - 'order_id' => $order_id, - 'limit' => - 1, - ) - ); -} - -/** - * Determine if the order is fullfilled. - * - * @param int $order_id Order ID. - * - * @since 1.2.0 - * @return bool True if order is fullfilled, false otherwise. - */ -function wcsn_order_is_fullfilled( $order_id ) { - if ( ! wcsn_order_has_products( $order_id ) ) { - return true; - } - - $keys = wcsn_order_get_keys( $order_id ); - $line_items = wcsn_get_order_line_items_data( $order_id ); - $total_qty = 0; - foreach ( $line_items as $line_item ) { - $total_qty += $line_item['quantity']; - } - - return count( $keys ) >= $total_qty; -} - -/** - * Order get unfulfilled items. - * - * @param int $order_id Order ID. - * - * @since 1.2.0 - * @return array - */ -function wcsn_order_get_unfulfilled_items( $order_id ) { - if ( ! wcsn_order_has_products( $order_id ) ) { - return array(); - } - - $line_items = wcsn_get_order_line_items_data( $order_id ); - $keys = wcsn_order_get_keys( $order_id ); - $items = array(); - - foreach ( $line_items as $line_item ) { - $qty = $line_item['quantity']; - foreach ( $keys as $key ) { - if ( $key->get_product_id() !== $line_item['product_id'] ) { - continue; - } - // todo uncomment this when we will support for order item id. - - --$qty; - } - if ( $qty > 0 ) { - $items[] = array_merge( $line_item, array( 'quantity' => $qty ) ); - } - } - - return $items; -} - -/** - * Update order keys. - * - * @param int $order_id Order ID. - * - * @since 1.4.6 - * @return void - */ -function wcsn_order_update_keys( $order_id ) { - $order = wcsn_get_order_object( $order_id ); - $customer_id = $order->get_customer_id(); - $line_items = wcsn_get_order_line_items_data( $order ); - $revoke_statues = wcsn_get_revoke_statuses(); - $order_status = $order->get_status( 'edit' ); - if ( empty( $line_items ) ) { - return; - } - - if ( ! apply_filters( 'wc_serial_numbers_update_order_keys', true, $order_id, $line_items, $order_status ) ) { - return; - } - - /** - * Action hook to pre update order keys. - * - * @param int $order_id Order ID. - * @param array $line_items Order line items. - * - * @since 1.4.6 - */ - do_action( 'wc_serial_numbers_pre_update_order_keys', $order_id, $line_items ); - - $do_add = apply_filters( 'wc_serial_numbers_add_order_keys', true, $order_id, $line_items, $order_status ); - - if ( in_array( $order_status, array( 'processing', 'completed' ), true ) && ! wcsn_order_is_fullfilled( $order_id ) && $do_add ) { - - /** - * Action hook to pre add order keys. - * - * @param int $order_id Order ID. - * @param array $line_items Order line items. - * @param string $order_status Order status. - * - * @since 1.4.6 - */ - do_action( 'wc_serial_numbers_pre_add_order_keys', $order_id, $line_items, $order_status ); - $added = 0; - foreach ( $line_items as $k => $item ) { - if ( ! apply_filters( 'wc_serial_numbers_add_order_item_keys', true, $item, $order_id ) ) { - continue; - } - - $delivered_qty = Key::count( - array( - 'order_id' => $order_id, - 'product_id' => $item['product_id'], - 'status__not_in' => array( 'cancelled' ), - ) - ); - if ( $item['refunded_qty'] >= $item['quantity'] ) { - continue; - } - $needed_count = $item['quantity'] - $delivered_qty - $item['refunded_qty']; - if ( $delivered_qty >= $needed_count || empty( $needed_count ) ) { - continue; - } - - /** - * Action hook to pre add keys to order item. - * - * @param array $line_item Order line item. - * @param int $order_id Order ID. - * @param int $needed_count Needed count. - */ - do_action( 'wc_serial_numbers_pre_add_order_item_keys', $item, $order_id, $needed_count ); - - // Deprecated. use wc_serial_numbers_pre_order_add_keys instead. Will be removed in 1.5.0. - apply_filters( 'wc_serial_numbers_pre_order_item_connect_serial_numbers', $item['product_id'], $needed_count, $item['key_source'], $order_id ); - - // Get new keys. - $keys = Key::query( - array( - 'product_id' => $item['product_id'], - 'status' => 'available', - 'limit' => $needed_count, - 'orderby' => 'id', - 'order' => 'ASC', - ) - ); - if ( count( $keys ) < $needed_count ) { - $order->add_order_note( - sprintf( - /* translators: 1: product title 2: source and 3: Quantity */ - esc_html__( 'There is not enough serial numbers for the product %1$s from selected source %2$s, needed total %3$d.', 'wc-serial-numbers' ), - wcsn_get_product_title( $item['product_id'] ), - $item['key_source'], - $needed_count - ), - false - ); - - continue; - } - - // Assign keys to order. - foreach ( $keys as $key ) { - $key->set_data( - array( - 'order_id' => $order_id, - 'order_item_id' => $item['order_item_id'], - 'order_date' => $order->get_date_created() ? $order->get_date_created()->format( 'Y-m-d H:i:s' ) : current_time( 'mysql' ), - 'customer_id' => $customer_id, - 'status' => 'sold', - ) - ); - if ( ! is_wp_error( $key->save() ) ) { - ++$added; - } - } - - /** - * Action hook to post add keys to order item. - * - * @param array $line_item Order line item. - * @param int $order_id Order ID. - * @param int $needed_count Needed count. - */ - do_action( 'wc_serial_numbers_added_order_item_keys', $item, $order_id, $needed_count ); - - // Deprecated. use wc_serial_numbers_pre_order_add_keys instead. Will be removed in 1.5.0. - do_action( 'wc_serial_numbers_order_connect_serial_numbers', $order_id, count( $keys ) ); - } - - if ( $added > 0 ) { - /** - * Action hook to post add order keys. - * - * @param int $order_id Order ID. - * @param array $line_items Order line items. - * @param string $order_status Order status. - * - * @since 1.4.6 - */ - do_action( 'wc_serial_numbers_add_order_keys', $order_id, $line_items, $order_status ); - } - } - - // Revoke keys. - $keys = Key::query( - array( - 'order_id' => $order_id, - 'limit' => - 1, - ) - ); - - foreach ( $keys as $key ) { - $is_expired = $key->is_expired(); - if ( $is_expired && 'expired' !== $key->get_status() ) { - $key->set_status( 'expired' ); - $key->save(); - } elseif ( ! $is_expired && in_array( - $order_status, - array( - 'processing', - 'complete', - ), - true - ) && 'sold' !== $key->get_status() ) { - $key->set_status( 'sold' ); - $key->save(); - } elseif ( 'on-hold' === $order_status && ! $is_expired && 'pending' !== $key->get_status() ) { - $key->set_status( 'pending' ); - $key->save(); - } elseif ( in_array( $order_status, $revoke_statues, true ) && ! $is_expired && apply_filters( 'wc_serial_numbers_revoke_order_item_keys', true, $line_items, $order_id ) ) { - wcsn_order_remove_keys( $order_id ); - } - } - - /** - * Action hook to post add keys to order item. - * - * @param int $order_id Order ID. - * @param array $line_items Order line items. - * - * @since 1.4.6 - */ - do_action( 'wc_serial_numbers_order_update_keys', $order_id, $line_items ); -} - -/** - * Order remove keys. - * - * @param int $order_id Order ID. - * @param int $product_id Product ID. - * - * @since 1.4.6 - * - * @return array|false Array of keys or false if no keys found. - */ -function wcsn_order_remove_keys( $order_id, $product_id = null ) { - $is_reusing = wcsn_is_reusing_keys(); - $args = array( - 'order_id' => $order_id, - 'limit' => - 1, - ); - - if ( ! empty( $product_id ) ) { - $args['product_id'] = $product_id; - } - - $keys = Key::query( $args ); - - if ( ! $keys ) { - return false; - } - - /** - * Action hook to pre revoke keys from order item. - * - * @param int $order_id Order ID. - * @param int $product_id Product ID. - * @param array $keys Order keys. - * - * @since 1.4.6 - */ - do_action( 'wc_serial_numbers_pre_revoke_order_keys', $order_id, $product_id, $keys ); - - foreach ( $keys as $key ) { - $props = array( - 'status' => $is_reusing ? 'available' : 'cancelled', - ); - if ( ! $is_reusing ) { - $props['order_id'] = 0; - $props['order_item_id'] = 0; - $props['order_date'] = null; - } - $key->set_data( $props ); - $key->save(); - } - - /** - * Action hook to post revoke keys from order item. - * - * @param int $order_id Order ID. - * @param int $product_id Product ID. - * @param array $keys Order keys. - * - * @since 1.4.6 - */ - do_action( 'wc_serial_numbers_revoke_order_keys', $order_id, $product_id, $keys ); - - return $keys; -} - -/** - * Replace keys. - * - * @param int $order_id Order ID. - * @param int $product_id Product ID. - * @param int $key_id Key ID. - * - * @since 1.4.7 - * - * @return bool - */ -function wcsn_order_replace_key( $order_id, $product_id = null, $key_id = null ) { - $is_reusing = wcsn_is_reusing_keys(); - $args = array( - 'order_id' => $order_id, - 'limit' => - 1, - 'no_count' => true, - ); - - if ( ! empty( $product_id ) ) { - $args['product_id'] = $product_id; - } - - if ( ! empty( $key_id ) ) { - $args['include'] = $key_id; - } - - $keys = Key::query( $args ); - - if ( ! $keys ) { - return false; - } - - /** - * Action hook to pre replace keys from order item. - * - * @param int $order_id Order ID. - * @param int $product_id Product ID. - * @param array $keys Order keys. - * - * @since 1.4.7 - */ - do_action( 'wc_serial_numbers_pre_replace_order_keys', $order_id, $product_id, $keys ); - - $replaced = 0; - - foreach ( $keys as $key ) { - $props = array( - 'status' => $is_reusing ? 'available' : 'cancelled', - ); - if ( ! $is_reusing ) { - $props['order_id'] = 0; - $props['order_item_id'] = 0; - $props['order_date'] = null; - } - $key->set_data( $props ); - if ( $key->save() ) { - ++$replaced; - } - } - - if ( $replaced > 0 ) { - wcsn_order_update_keys( $order_id ); - - /** - * Action hook to post replace keys from order item. - * - * @param int $order_id Order ID. - * @param int $product_id Product ID. - * @param array $keys Order keys. - * - * @since 1.4.7 - */ - do_action( 'wc_serial_numbers_replace_order_keys', $order_id, $product_id, $keys ); - - return true; - } - - return false; -} - -/** - * Get product title. - * - * @param \WC_Product| int $product Product title. - * - * @since 1.2.0 - * - * @return string - */ -function wcsn_get_product_title( $product ) { - $product = wcsn_get_product_object( $product ); - if ( $product && ! empty( $product->get_id() ) ) { - return sprintf( - '(#%1$s) %2$s', - $product->get_id(), - wp_strip_all_tags( $product->get_formatted_name() ) - ); - } - - return ''; -} - -/** - * Get enabled products query args. - * - * @since 1.4.6 - * - * @return array - */ -function wcsn_get_products_query_args() { - $args = array( - 'post_type' => array( 'product' ), - 'tax_query' => array( // @codingStandardsIgnoreLine - 'relation' => 'OR', - array( - 'taxonomy' => 'product_type', - 'field' => 'slug', - 'terms' => array( 'simple' ), - 'operator' => 'IN', - ), - ), - ); - - return apply_filters( 'wc_serial_numbers_products_query_args', $args ); -} - -/** - * Get enabled products. - * - * @param array $args Query args. - * - * @since 1.4.6 - * @return array|int List of products or number of products. - */ -function wcsn_get_products( $args = array() ) { - $args = wp_parse_args( $args, wcsn_get_products_query_args() ); - if ( empty( $args['meta_query'] ) ) { - $args['meta_query'] = array(); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query - } - $args['meta_query'][] = array( - 'key' => '_is_serial_number', - 'value' => 'yes', - 'compare' => '=', - ); - - $is_count = isset( $args['count'] ) && $args['count']; - unset( $args['count'] ); - $query = new \WP_Query( $args ); - if ( $is_count ) { - return $query->found_posts; - } - - return $query->posts; -} - -/** - * Encrypt serial number. - * - * @param string $key Key. - * - * @since 1.2.0 - * @return false|string - */ -function wcsn_encrypt_key( $key ) { - return Encryption::maybeEncrypt( $key ); -} - -/** - * Decrypt number. - * - * @param string $key Key. - * - * @since 1.2.0 - * @return false|string - */ -function wcsn_decrypt_key( $key ) { - return Encryption::maybeDecrypt( $key ); -} - -/** - * Get product stocks - * - * @param int $stock_limit Stock limit. - * @param bool $force Force. - * - * @since 1.4.6 - * - * @return array - */ -function wcsn_get_stocks_count( $stock_limit = null, $force = true ) { - $transient_key = 'wcsn_products_stock_count'; - $counts = get_transient( $transient_key ); - - if ( $force || false === $counts ) { - $counts = array(); - $post_ids = wcsn_get_products( - array( - 'posts_per_page' => - 1, - 'fields' => 'ids', - 'meta_query' => array( // @codingStandardsIgnoreLine - 'relation' => 'AND', - array( - 'key' => '_serial_key_source', - 'value' => 'custom_source', - 'compare' => '=', - ), - ), - ) - ); - - foreach ( $post_ids as $post_id ) { - $counts[ $post_id ] = wcsn_get_keys( - array( - 'product_id' => $post_id, - 'status' => 'available', - 'count' => true, - ) - ); - } - - set_transient( $transient_key, $counts, 60 * 60 ); - } - if ( $stock_limit > 0 ) { - // get the results where value is equal or less than max. - $counts = array_filter( - $counts, - function ( $value ) use ( $stock_limit ) { - return $value <= $stock_limit; - } - ); - } - - return $counts; -} - -/** - * Get stock of product. - * - * @param int $product_id Product ID. - * - * @since 1.4.6 - * @retun int - */ -function wcsn_get_product_stock( $product_id ) { - $counts = wcsn_get_stocks_count(); - if ( isset( $counts[ $product_id ] ) ) { - return $counts[ $product_id ]; - } - - return 0; -} - -/** - * Get product edit link. - * - * @param int $product_id Product ID. - * - * @since 1.4.8 - * @retun string - */ -function wcsn_get_edit_product_link( $product_id ) { - // If the product is a variation, get the parent product. - - $product = wc_get_product( $product_id ); - if ( $product && $product->is_type( 'variation' ) ) { - $product_id = $product->get_parent_id(); - } - - return get_edit_post_link( $product_id ); -} - -/** - * Is duplicate serial key allowed. - * - * @since 1.4.8 - * @return bool - */ -function wcsn_is_duplicate_key_allowed() { - return apply_filters( 'wc_serial_numbers_allow_duplicate_key', false ); -} - -/** - * Get product link. - * - * @param int $product_id Product ID. - * - * @since 1.4.8 - * @retun string - */ -function wcsn_get_product_link( $product_id ) { - // If the product is a variation, get the parent product. - $product = wc_get_product( $product_id ); - if ( $product && $product->is_type( 'variation' ) ) { - $product_id = $product->get_parent_id(); - } - - return get_permalink( $product_id ); -} - -/** - * Get product display properties. - * - * @param Key $key Key object. - * @param string $context Context. - * - * @since 1.5.6 - * @return array - */ -function wcsn_get_key_display_properties( $key, $context = 'order_details' ) { - if ( empty( $key ) || ! $key instanceof Key ) { - return array(); - } - $properties = array( - 'key' => array( - 'label' => __( 'Key', 'wc-serial-numbers' ), - 'value' => '' . $key->get_key() . '', - 'priority' => 10, - ), - 'activation_email' => array( - 'label' => __( 'Activation Email', 'wc-serial-numbers' ), - 'value' => $key->get_customer_email(), - 'priority' => 20, - ), - 'activation_limit' => array( - 'label' => __( 'Activation Limit', 'wc-serial-numbers' ), - 'value' => ! empty( $key->get_activation_limit() ) ? number_format_i18n( $key->get_activation_limit() ) : __( 'None', 'wc-serial-numbers' ), - 'priority' => 30, - ), - 'activation_count' => array( - 'label' => __( 'Activation Count', 'wc-serial-numbers' ), - 'value' => ! empty( $key->get_activation_count() ) ? number_format_i18n( $key->get_activation_count() ) : __( 'None', 'wc-serial-numbers' ), - 'priority' => 40, - ), - 'expire_date' => array( - 'label' => __( 'Expire Date', 'wc-serial-numbers' ), - 'value' => ! empty( $key->get_expire_date() ) ? $key->get_expire_date() : __( 'Lifetime', 'wc-serial-numbers' ), - 'priority' => 50, - ), - 'status' => array( - 'label' => __( 'Status', 'wc-serial-numbers' ), - 'value' => $key->get_status(), - 'priority' => 100, - ), - ); - - /** - * Filter key properties. - * - * @param array $props Key properties. - * @param Key $key Key object. - * @param string $context Context. - * - * @since 1.4.9 - */ - $properties = apply_filters( 'wc_serial_numbers_display_key_props', $properties, $key, $context ); - - usort( - $properties, - function ( $a, $b ) { - $a_priority = isset( $a['priority'] ) ? $a['priority'] : 10; - $b_priority = isset( $b['priority'] ) ? $b['priority'] : 10; - - return $a_priority - $b_priority; - } - ); - - return $properties; -} diff --git a/trunk/templates/email-stock-notification.php b/trunk/templates/email-stock-notification.php deleted file mode 100644 index 47126236..00000000 --- a/trunk/templates/email-stock-notification.php +++ /dev/null @@ -1,42 +0,0 @@ - - - - -

    -

    -
      - $stock ) { - $product_id = absint( $product_id ); - if ( ! $product_id ) { - continue; - } - $product = wc_get_product( $product_id ); - - printf( "
    • %s - Stock %s
    • ", esc_url( get_edit_post_link( $product->get_id() ) ), esc_html( $product->get_formatted_name() ), esc_html( $stock ) ); - } - ?> -
    - -
    -
    -

    - Serial Numbers for WooCommerce', 'wc-serial-numbers' ), - 'https://pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=serialnumberemail&utm_medium=email&utm_campaign=lowstocknotification' - ) - ); - ?> -

    diff --git a/trunk/uninstall.php b/trunk/uninstall.php deleted file mode 100644 index 1a4873ef..00000000 --- a/trunk/uninstall.php +++ /dev/null @@ -1,11 +0,0 @@ -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - return include("phpvfscomposer://" . __DIR__ . '/..'.'/coenjacobs/mozart/bin/mozart'); - } -} - -return include __DIR__ . '/..'.'/coenjacobs/mozart/bin/mozart'; diff --git a/trunk/vendor/bin/phpcbf b/trunk/vendor/bin/phpcbf deleted file mode 100755 index 1c0c79c4..00000000 --- a/trunk/vendor/bin/phpcbf +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - return include("phpvfscomposer://" . __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'); - } -} - -return include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcbf'; diff --git a/trunk/vendor/bin/phpcs b/trunk/vendor/bin/phpcs deleted file mode 100755 index 04e658cf..00000000 --- a/trunk/vendor/bin/phpcs +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - return include("phpvfscomposer://" . __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'); - } -} - -return include __DIR__ . '/..'.'/squizlabs/php_codesniffer/bin/phpcs'; diff --git a/trunk/vendor/byteever/byteever-sniffs/renovate.json b/trunk/vendor/byteever/byteever-sniffs/renovate.json deleted file mode 100644 index ee8c906b..00000000 --- a/trunk/vendor/byteever/byteever-sniffs/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": [ - "config:base" - ] -} diff --git a/trunk/vendor/byteever/byteever-sniffs/src/ByteEver-Default/ruleset.xml b/trunk/vendor/byteever/byteever-sniffs/src/ByteEver-Default/ruleset.xml deleted file mode 100644 index dc4c80af..00000000 --- a/trunk/vendor/byteever/byteever-sniffs/src/ByteEver-Default/ruleset.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - A base ruleset that all other ByteEver rules should extend. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - 0 - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - warning - - - - - warning - - - diff --git a/trunk/vendor/coenjacobs/mozart/Dockerfile b/trunk/vendor/coenjacobs/mozart/Dockerfile deleted file mode 100644 index 240bd4c5..00000000 --- a/trunk/vendor/coenjacobs/mozart/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM composer:2.0.8 - -FROM php:8.0.1-cli-alpine AS base - -FROM base as builder -RUN apk update && apk add git -COPY --from=composer /usr/bin/composer /usr/bin/composer -COPY ./composer.json /mozart/ -WORKDIR /mozart/ -RUN composer install --no-dev -o - -FROM base AS application -RUN mkdir project -WORKDIR /project/ -COPY --from=builder /mozart/ /mozart/ -COPY ./bin/ /mozart/bin/ -COPY ./src/ /mozart/src/ diff --git a/trunk/vendor/coenjacobs/mozart/LICENSE b/trunk/vendor/coenjacobs/mozart/LICENSE deleted file mode 100644 index 2f9c2570..00000000 --- a/trunk/vendor/coenjacobs/mozart/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Coen Jacobs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/trunk/vendor/coenjacobs/mozart/bin/mozart b/trunk/vendor/coenjacobs/mozart/bin/mozart deleted file mode 100755 index ef2e21ff..00000000 --- a/trunk/vendor/coenjacobs/mozart/bin/mozart +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env php -run(); -}, '0.7.1'); diff --git a/trunk/vendor/coenjacobs/mozart/psalm.xml b/trunk/vendor/coenjacobs/mozart/psalm.xml deleted file mode 100644 index 30258a70..00000000 --- a/trunk/vendor/coenjacobs/mozart/psalm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php b/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php deleted file mode 100644 index 9aa6b218..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php +++ /dev/null @@ -1,9 +0,0 @@ -files, $value); - } else { - array_push($this->paths, $value); - } - } - } - - /** - * @throws \Exception - * - * @return void - */ - public function getSearchNamespace() - { - throw new \Exception('Classmap autoloaders do not contain a namespace and this method can not be used.'); - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php b/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php deleted file mode 100644 index f8393995..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php +++ /dev/null @@ -1,49 +0,0 @@ - $value) { - $this->namespace = $key; - array_push($this->paths, $value); - } - } - - /** - * @return string - */ - public function getSearchNamespace() - { - return $this->namespace; - } - - /** - * @return string - */ - public function getNamespacePath() - { - return ''; - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php b/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php deleted file mode 100644 index 2a009821..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php +++ /dev/null @@ -1,7 +0,0 @@ -namespace, '\\'); - } - - /** - * @return string - */ - public function getNamespacePath() - { - return str_replace('\\', DIRECTORY_SEPARATOR, $this->namespace); - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Composer/Package.php b/trunk/vendor/coenjacobs/mozart/src/Composer/Package.php deleted file mode 100644 index 78800fe8..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Composer/Package.php +++ /dev/null @@ -1,69 +0,0 @@ -path = $path; - $this->config = json_decode(file_get_contents($this->path . '/composer.json')); - - if (isset($overrideAutoload)) { - $this->config->autoload = $overrideAutoload; - } - } - - /** - * @return void - */ - public function findAutoloaders() - { - $namespace_autoloaders = array( - 'psr-0' => 'CoenJacobs\Mozart\Composer\Autoload\Psr0', - 'psr-4' => 'CoenJacobs\Mozart\Composer\Autoload\Psr4', - 'classmap' => 'CoenJacobs\Mozart\Composer\Autoload\Classmap', - ); - - if (! isset($this->config->autoload)) { - return; - } - - foreach ($namespace_autoloaders as $key => $value) { - if (! isset($this->config->autoload->$key)) { - continue; - } - - $autoloadConfig = (array)$this->config->autoload->$key; - - /** @var Autoloader $autoloader */ - $autoloader = new $value(); - $autoloader->processConfig($autoloadConfig); - - array_push($this->autoloaders, $autoloader); - } - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Console/Application.php b/trunk/vendor/coenjacobs/mozart/src/Console/Application.php deleted file mode 100644 index caa82dd3..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Console/Application.php +++ /dev/null @@ -1,20 +0,0 @@ -add($composeCommand); - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php b/trunk/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php deleted file mode 100644 index ced06a51..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php +++ /dev/null @@ -1,243 +0,0 @@ -setName('compose'); - $this->setDescription('Composes all dependencies as a package inside a WordPress plugin.'); - $this->setHelp(''); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $workingDir = getcwd(); - $this->workingDir = $workingDir; - - $composerFile = $workingDir . DIRECTORY_SEPARATOR. 'composer.json'; - if (!file_exists($composerFile)) { - $output->write('No composer.json found at current directory: ' . $workingDir); - return 1; - } - - $composer = json_decode(file_get_contents($composerFile)); - // If the json was malformed. - if (!is_object($composer)) { - $output->write('Unable to parse composer.json read at: ' . $workingDir); - return 1; - } - - // if `extra` is missing or not an object or if it does not have a `mozart` key which is an object. - if (!isset($composer->extra) || !is_object($composer->extra) - || !isset($composer->extra->mozart) || !is_object($composer->extra->mozart)) { - $output->write('Mozart config not readable in composer.json at extra->mozart'); - return 1; - } - $config = $composer->extra->mozart; - - $config->dep_namespace = preg_replace("/\\\{2,}$/", "\\", "$config->dep_namespace\\"); - - $this->config = $config; - - $require = array(); - if (isset($config->packages) && is_array($config->packages)) { - $require = $config->packages; - } elseif (isset($composer->require) && is_object($composer->require)) { - $require = array_keys(get_object_vars($composer->require)); - } - - $packagesByName = $this->findPackages($require); - $excludedPackagesNames = isset($config->excluded_packages) ? $config->excluded_packages : []; - $packagesToMoveByName = array_diff_key($packagesByName, array_flip($excludedPackagesNames)); - $packages = array_values($packagesToMoveByName); - - foreach ($packages as $package) { - $package->dependencies = array_diff_key($package->dependencies, array_flip($excludedPackagesNames)); - } - - $this->mover = new Mover($workingDir, $config); - $this->replacer = new Replacer($workingDir, $config); - - $this->mover->deleteTargetDirs($packages); - $this->movePackages($packages); - $this->replacePackages($packages); - $this->replaceParentInTree($packages); - $this->replacer->replaceParentClassesInDirectory($this->config->classmap_directory); - - return 0; - } - - /** - * @param $workingDir - * @param $config - * @param array $packages - * - * @return void - */ - protected function movePackages($packages): void - { - foreach ($packages as $package) { - $this->movePackage($package); - } - - $this->mover->deleteEmptyDirs(); - } - - /** - * @param $workingDir - * @param $config - * @param array $packages - * - * @return void - */ - protected function replacePackages($packages): void - { - foreach ($packages as $package) { - $this->replacePackage($package); - } - } - - /** - * Move all the packages over, one by one, starting on the deepest level of dependencies. - * - * @return void - */ - public function movePackage($package): void - { - if (! empty($package->dependencies)) { - foreach ($package->dependencies as $dependency) { - $this->movePackage($dependency); - } - } - - $this->mover->movePackage($package); - } - - /** - * Replace contents of all the packages, one by one, starting on the deepest level of dependencies. - * - * @return void - */ - public function replacePackage($package): void - { - if (! empty($package->dependencies)) { - foreach ($package->dependencies as $dependency) { - $this->replacePackage($dependency); - } - } - - $this->replacer->replacePackage($package); - } - - /** - * Loops through all dependencies and their dependencies and so on... - * will eventually return a list of all packages required by the full tree. - * - * @param ((int|string)|mixed)[] $slugs - * - * @return Package[] - * - * @psalm-return array - */ - private function findPackages(array $slugs): array - { - $packages = []; - - foreach ($slugs as $package_slug) { - $packageDir = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' - . DIRECTORY_SEPARATOR . $package_slug . DIRECTORY_SEPARATOR; - - if (! is_dir($packageDir)) { - continue; - } - - $autoloaders = null; - if (isset($this->config->override_autoload) && isset($this->config->override_autoload->$package_slug)) { - $autoloaders = $this->config->override_autoload->$package_slug; - } - - $package = new Package($packageDir, $autoloaders); - $package->findAutoloaders(); - - $config = json_decode(file_get_contents($packageDir . 'composer.json')); - - $dependencies = []; - if (isset($config->require)) { - $dependencies = array_keys((array)$config->require); - } - - $package->dependencies = $this->findPackages($dependencies); - $packages[$package_slug] = $package; - } - - return $packages; - } - - /** - * Get an array containing all the dependencies and dependencies - * @param Package $package - * @param array $dependencies - * @return array - */ - private function getAllDependenciesOfPackage(Package $package, $dependencies = []): array - { - if (empty($package->dependencies)) { - return $dependencies; - } - - /** @var Package $dependency */ - foreach ($package->dependencies as $dependency) { - $dependencies[] = $dependency; - } - - foreach ($package->dependencies as $dependency) { - $dependencies = $this->getAllDependenciesOfPackage($dependency, $dependencies); - } - - return $dependencies; - } - - /** - * @param array $packages - */ - private function replaceParentInTree(array $packages): void - { - /** @var Package $package */ - foreach ($packages as $package) { - $dependencies = $this->getAllDependenciesOfPackage($package); - - /** @var Package $dependency */ - foreach ($dependencies as $dependency) { - $this->replacer->replaceParentPackage($dependency, $package); - } - - $this->replaceParentInTree($package->dependencies); - } - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Mover.php b/trunk/vendor/coenjacobs/mozart/src/Mover.php deleted file mode 100644 index 6106bf6c..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Mover.php +++ /dev/null @@ -1,243 +0,0 @@ -workingDir = $workingDir; - $this->targetDir = $config->dep_directory; - $this->config = $config; - - $this->filesystem = new Filesystem(new Local($this->workingDir)); - } - - /** - * Create the required `dep_directory` and `classmap_directory` and delete targetDirs of packages about to be moved. - * - * @param Package[] $packages The packages that, in the next step, will be moved. - * - * @return void - */ - public function deleteTargetDirs($packages): void - { - $this->filesystem->createDir($this->config->dep_directory); - - $this->filesystem->createDir($this->config->classmap_directory); - - foreach ($packages as $package) { - $this->deleteDepTargetDirs($package); - } - } - - /** - * Delete the directories about to be used for packages earmarked for Mozart namespacing. - * - * @visibility private to allow recursion through packages and subpackages. - * - * @param Package $package - * - * @return void - */ - private function deleteDepTargetDirs($package): void - { - foreach ($package->autoloaders as $packageAutoloader) { - $autoloaderType = get_class($packageAutoloader); - - switch ($autoloaderType) { - case Psr0::class: - case Psr4::class: - $outputDir = $this->config->dep_directory . $packageAutoloader->namespace; - $outputDir = str_replace('\\', DIRECTORY_SEPARATOR, $outputDir); - $this->filesystem->deleteDir($outputDir); - break; - case Classmap::class: - $outputDir = $this->config->classmap_directory . $package->config->name; - $outputDir = str_replace('\\', DIRECTORY_SEPARATOR, $outputDir); - $this->filesystem->deleteDir($outputDir); - break; - } - } - - foreach ($package->dependencies as $subPackage) { - $this->deleteDepTargetDirs($subPackage); - } - } - - public function deleteEmptyDirs(): void - { - if (count($this->filesystem->listContents($this->config->dep_directory, true)) === 0) { - $this->filesystem->deleteDir($this->config->dep_directory); - } - - if (count($this->filesystem->listContents($this->config->classmap_directory, true)) === 0) { - $this->filesystem->deleteDir($this->config->classmap_directory); - } - } - - /** - * @return void - */ - public function movePackage(Package $package) - { - if (in_array($package->config->name, $this->movedPackages)) { - return; - } - - foreach ($package->autoloaders as $autoloader) { - if ($autoloader instanceof NamespaceAutoloader) { - $finder = new Finder(); - - foreach ($autoloader->paths as $path) { - $source_path = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR - . $package->config->name . DIRECTORY_SEPARATOR . $path; - - $source_path = str_replace('/', DIRECTORY_SEPARATOR, $source_path); - - $finder->files()->in($source_path); - - foreach ($finder as $file) { - $this->moveFile($package, $autoloader, $file, $path); - } - } - } elseif ($autoloader instanceof Classmap) { - $finder = new Finder(); - - $files_to_move = array(); - - foreach ($autoloader->files as $file) { - $source_path = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' - . DIRECTORY_SEPARATOR . $package->config->name; - $finder->files()->name($file)->in($source_path); - - foreach ($finder as $foundFile) { - $filePath = $foundFile->getRealPath(); - $files_to_move[ $filePath ] = $foundFile; - } - } - - $finder = new Finder(); - - foreach ($autoloader->paths as $path) { - $source_path = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' - . DIRECTORY_SEPARATOR . $package->config->name . DIRECTORY_SEPARATOR . $path; - - $finder->files()->in($source_path); - - foreach ($finder as $foundFile) { - $filePath = $foundFile->getRealPath(); - $files_to_move[ $filePath ] = $foundFile; - } - } - - foreach ($files_to_move as $foundFile) { - $this->moveFile($package, $autoloader, $foundFile); - } - } - - if (!in_array($package->config->name, $this->movedPackages)) { - $this->movedPackages[] = $package->config->name; - } - } - - if (!isset($this->config->delete_vendor_directories) || $this->config->delete_vendor_directories === true) { - $this->deletePackageVendorDirectories(); - } - } - - /** - * @param Package $package - * @param Autoloader $autoloader - * @param SplFileInfo $file - * @param string $path - * @return string - */ - public function moveFile(Package $package, $autoloader, $file, $path = '') - { - if ($autoloader instanceof NamespaceAutoloader) { - $namespacePath = $autoloader->getNamespacePath(); - $replaceWith = $this->config->dep_directory . $namespacePath; - $targetFile = str_replace($this->workingDir, $replaceWith, $file->getPathname()); - - $packageVendorPath = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package->config->name - . DIRECTORY_SEPARATOR . $path; - $packageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath); - $targetFile = str_replace($packageVendorPath, '', $targetFile); - } else { - $namespacePath = $package->config->name; - $replaceWith = $this->config->classmap_directory . DIRECTORY_SEPARATOR . $namespacePath; - $targetFile = str_replace($this->workingDir, $replaceWith, $file->getPathname()); - - $packageVendorPath = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package->config->name - . DIRECTORY_SEPARATOR; - $packageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath); - $targetFile = str_replace($packageVendorPath, DIRECTORY_SEPARATOR, $targetFile); - } - - $this->filesystem->copy( - str_replace($this->workingDir, '', $file->getPathname()), - $targetFile - ); - - return $targetFile; - } - - /** - * Deletes all the packages that are moved from the /vendor/ directory to - * prevent packages that are prefixed/namespaced from being used or - * influencing the output of the code. They just need to be gone. - * - * @return void - */ - protected function deletePackageVendorDirectories(): void - { - foreach ($this->movedPackages as $movedPackage) { - $packageDir = 'vendor' . DIRECTORY_SEPARATOR . $movedPackage; - if (!is_dir($packageDir) || is_link($packageDir)) { - continue; - } - - $this->filesystem->deleteDir($packageDir); - - //Delete parent directory too if it became empty - //(because that package was the only one from that vendor) - $parentDir = dirname($packageDir); - if ($this->dirIsEmpty($parentDir)) { - $this->filesystem->deleteDir($parentDir); - } - } - } - - private function dirIsEmpty(string $dir): bool - { - $di = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS); - return iterator_count($di) === 0; - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php b/trunk/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php deleted file mode 100644 index 442551e8..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php +++ /dev/null @@ -1,20 +0,0 @@ -autoloader = $autoloader; - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php b/trunk/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php deleted file mode 100644 index 2cc297ed..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php +++ /dev/null @@ -1,64 +0,0 @@ -classmap_prefix . $matches[1]; - $this->saveReplacedClass($matches[1], $replace); - return str_replace($matches[1], $replace, $matches[0]); - }, - $contents - ); - } - - public function saveReplacedClass($classname, string $replacedName): void - { - $this->replacedClasses[ $classname ] = $replacedName; - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php b/trunk/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php deleted file mode 100644 index 711ec086..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php +++ /dev/null @@ -1,43 +0,0 @@ -autoloader->getSearchNamespace(), '/'); - $dependencyNamespace = preg_quote($this->dep_namespace, '/'); - - return preg_replace_callback( - " - / # Start the pattern - ([^a-zA-Z0-9_\x7f-\xff]) # Match the non-class character before the namespace - ( # Start the namespace matcher - (?dep_namespace . $matches[2]; - }, - $contents - ); - } -} diff --git a/trunk/vendor/coenjacobs/mozart/src/Replace/Replacer.php b/trunk/vendor/coenjacobs/mozart/src/Replace/Replacer.php deleted file mode 100644 index 33b1a150..00000000 --- a/trunk/vendor/coenjacobs/mozart/src/Replace/Replacer.php +++ /dev/null @@ -1,11 +0,0 @@ -workingDir = $workingDir; - $this->targetDir = $config->dep_directory; - $this->config = $config; - - $this->filesystem = new Filesystem(new Local($this->workingDir)); - } - - public function replacePackage(Package $package): void - { - foreach ($package->autoloaders as $autoloader) { - $this->replacePackageByAutoloader($package, $autoloader); - } - } - - /** - * @param $targetFile - * @param $autoloader - * - * @return void - */ - public function replaceInFile($targetFile, Autoloader $autoloader): void - { - $targetFile = str_replace($this->workingDir, '', $targetFile); - try { - $contents = $this->filesystem->read($targetFile); - } catch (FileNotFoundException $e) { - return; - } - - if (empty($contents) || false === $contents) { - return; - } - - if ($autoloader instanceof NamespaceAutoloader) { - $replacer = new NamespaceReplacer(); - $replacer->dep_namespace = $this->config->dep_namespace; - } else { - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = $this->config->classmap_prefix; - } - - $replacer->setAutoloader($autoloader); - $contents = $replacer->replace($contents); - - if ($replacer instanceof ClassmapReplacer) { - $this->replacedClasses = array_merge($this->replacedClasses, $replacer->replacedClasses); - } - - $this->filesystem->put($targetFile, $contents); - } - - /** - * @param Package $package - * @param $autoloader - * - * @return void - */ - public function replacePackageByAutoloader(Package $package, Composer\Autoload\Autoloader $autoloader): void - { - if ($autoloader instanceof NamespaceAutoloader) { - $source_path = $this->workingDir . $this->targetDir - . str_replace('\\', DIRECTORY_SEPARATOR, $autoloader->namespace) - . DIRECTORY_SEPARATOR; - $this->replaceInDirectory($autoloader, $source_path); - } elseif ($autoloader instanceof Classmap) { - $finder = new Finder(); - $source_path = $this->workingDir . $this->config->classmap_directory . DIRECTORY_SEPARATOR - . $package->config->name; - $finder->files()->in($source_path); - - foreach ($finder as $foundFile) { - $targetFile = $foundFile->getRealPath(); - - if ('.php' == substr($targetFile, -4, 4)) { - $this->replaceInFile($targetFile, $autoloader); - } - } - } - } - - /** - * @param $autoloader - * @param $directory - * - * @return void - */ - public function replaceParentClassesInDirectory(string $directory): void - { - if (count($this->replacedClasses)===0) { - return; - } - - $directory = trim($directory, '//'); - $finder = new Finder(); - $finder->files()->in($directory); - - $replacedClasses = $this->replacedClasses; - - foreach ($finder as $file) { - $targetFile = $file->getPathName(); - - if ('.php' == substr($targetFile, -4, 4)) { - try { - $contents = $this->filesystem->read($targetFile); - } catch (FileNotFoundException $e) { - continue; - } - - if (empty($contents) || false === $contents) { - continue; - } - - foreach ($replacedClasses as $original => $replacement) { - $contents = preg_replace_callback( - '/(.*)([^a-zA-Z0-9_\x7f-\xff])'. $original . '([^a-zA-Z0-9_\x7f-\xff])/U', - function ($matches) use ($replacement) { - if (preg_match('/(include|require)/', $matches[0], $output_array)) { - return $matches[0]; - } - return $matches[1] . $matches[2] . $replacement . $matches[3]; - }, - $contents - ); - } - - $this->filesystem->put($targetFile, $contents); - } - } - } - - /** - * @param $autoloader - * @param $directory - * - * @return void - */ - public function replaceInDirectory(NamespaceAutoloader $autoloader, string $directory): void - { - $finder = new Finder(); - $finder->files()->in($directory); - - foreach ($finder as $file) { - $targetFile = $file->getPathName(); - - if ('.php' == substr($targetFile, -4, 4)) { - $this->replaceInFile($targetFile, $autoloader); - } - } - } - - /** - * Replace everything in parent package, based on the dependency package. - * This is done to ensure that package A (which requires package B), is also - * updated with the replacements being made in package B. - * - * @param Package $package - * @param Package $parent - * - * @return void - */ - public function replaceParentPackage(Package $package, Package $parent): void - { - foreach ($parent->autoloaders as $parentAutoloader) { - foreach ($package->autoloaders as $autoloader) { - if ($parentAutoloader instanceof NamespaceAutoloader) { - $namespace = str_replace('\\', DIRECTORY_SEPARATOR, $parentAutoloader->namespace); - $directory = $this->workingDir . $this->config->dep_directory . $namespace - . DIRECTORY_SEPARATOR; - - if ($autoloader instanceof NamespaceAutoloader) { - $this->replaceInDirectory($autoloader, $directory); - } else { - $directory = str_replace($this->workingDir, '', $directory); - $this->replaceParentClassesInDirectory($directory); - } - } else { - $directory = $this->workingDir . $this->config->classmap_directory . $parent->config->name; - - if ($autoloader instanceof NamespaceAutoloader) { - $this->replaceInDirectory($autoloader, $directory); - } else { - $directory = str_replace($this->workingDir, '', $directory); - $this->replaceParentClassesInDirectory($directory); - } - } - } - } - } -} diff --git a/trunk/vendor/composer/ClassLoader.php b/trunk/vendor/composer/ClassLoader.php deleted file mode 100644 index 7824d8f7..00000000 --- a/trunk/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,579 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var \Closure(string):void */ - private static $includeFile; - - /** @var string|null */ - private $vendorDir; - - // PSR-4 - /** - * @var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var list - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * List of PSR-0 prefixes - * - * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) - * - * @var array>> - */ - private $prefixesPsr0 = array(); - /** - * @var list - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var array - */ - private $missingClasses = array(); - - /** @var string|null */ - private $apcuPrefix; - - /** - * @var array - */ - private static $registeredLoaders = array(); - - /** - * @param string|null $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); - } - - /** - * @return array> - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return list - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return list - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return array Array of classname => path - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders keyed by their corresponding vendor directories. - * - * @return array - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } - - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } -} diff --git a/trunk/vendor/composer/InstalledVersions.php b/trunk/vendor/composer/InstalledVersions.php deleted file mode 100644 index 51e734a7..00000000 --- a/trunk/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,359 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints((string) $constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require $vendorDir.'/composer/installed.php'; - $installed[] = self::$installedByVendor[$vendorDir] = $required; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require __DIR__ . '/installed.php'; - self::$installed = $required; - } else { - self::$installed = array(); - } - } - - if (self::$installed !== array()) { - $installed[] = self::$installed; - } - - return $installed; - } -} diff --git a/trunk/vendor/composer/LICENSE b/trunk/vendor/composer/LICENSE deleted file mode 100644 index f27399a0..00000000 --- a/trunk/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/trunk/vendor/composer/autoload_classmap.php b/trunk/vendor/composer/autoload_classmap.php deleted file mode 100644 index 4ddc75d4..00000000 --- a/trunk/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,323 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\Autoloader' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\Classmap' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/Classmap.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\NamespaceAutoloader' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\Psr0' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/Psr0.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\Psr4' => $vendorDir . '/coenjacobs/mozart/src/Composer/Autoload/Psr4.php', - 'CoenJacobs\\Mozart\\Composer\\Package' => $vendorDir . '/coenjacobs/mozart/src/Composer/Package.php', - 'CoenJacobs\\Mozart\\Console\\Application' => $vendorDir . '/coenjacobs/mozart/src/Console/Application.php', - 'CoenJacobs\\Mozart\\Console\\Commands\\Compose' => $vendorDir . '/coenjacobs/mozart/src/Console/Commands/Compose.php', - 'CoenJacobs\\Mozart\\Mover' => $vendorDir . '/coenjacobs/mozart/src/Mover.php', - 'CoenJacobs\\Mozart\\Replace\\BaseReplacer' => $vendorDir . '/coenjacobs/mozart/src/Replace/BaseReplacer.php', - 'CoenJacobs\\Mozart\\Replace\\ClassmapReplacer' => $vendorDir . '/coenjacobs/mozart/src/Replace/ClassmapReplacer.php', - 'CoenJacobs\\Mozart\\Replace\\NamespaceReplacer' => $vendorDir . '/coenjacobs/mozart/src/Replace/NamespaceReplacer.php', - 'CoenJacobs\\Mozart\\Replace\\Replacer' => $vendorDir . '/coenjacobs/mozart/src/Replace/Replacer.php', - 'CoenJacobs\\Mozart\\Replacer' => $vendorDir . '/coenjacobs/mozart/src/Replacer.php', - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin' => $vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php', - 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', - 'League\\Flysystem\\AdapterInterface' => $vendorDir . '/league/flysystem/src/AdapterInterface.php', - 'League\\Flysystem\\Adapter\\AbstractAdapter' => $vendorDir . '/league/flysystem/src/Adapter/AbstractAdapter.php', - 'League\\Flysystem\\Adapter\\AbstractFtpAdapter' => $vendorDir . '/league/flysystem/src/Adapter/AbstractFtpAdapter.php', - 'League\\Flysystem\\Adapter\\CanOverwriteFiles' => $vendorDir . '/league/flysystem/src/Adapter/CanOverwriteFiles.php', - 'League\\Flysystem\\Adapter\\Ftp' => $vendorDir . '/league/flysystem/src/Adapter/Ftp.php', - 'League\\Flysystem\\Adapter\\Ftpd' => $vendorDir . '/league/flysystem/src/Adapter/Ftpd.php', - 'League\\Flysystem\\Adapter\\Local' => $vendorDir . '/league/flysystem/src/Adapter/Local.php', - 'League\\Flysystem\\Adapter\\NullAdapter' => $vendorDir . '/league/flysystem/src/Adapter/NullAdapter.php', - 'League\\Flysystem\\Adapter\\Polyfill\\NotSupportingVisibilityTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php', - 'League\\Flysystem\\Adapter\\Polyfill\\StreamedCopyTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/StreamedCopyTrait.php', - 'League\\Flysystem\\Adapter\\Polyfill\\StreamedReadingTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php', - 'League\\Flysystem\\Adapter\\Polyfill\\StreamedTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php', - 'League\\Flysystem\\Adapter\\Polyfill\\StreamedWritingTrait' => $vendorDir . '/league/flysystem/src/Adapter/Polyfill/StreamedWritingTrait.php', - 'League\\Flysystem\\Adapter\\SynologyFtp' => $vendorDir . '/league/flysystem/src/Adapter/SynologyFtp.php', - 'League\\Flysystem\\Config' => $vendorDir . '/league/flysystem/src/Config.php', - 'League\\Flysystem\\ConfigAwareTrait' => $vendorDir . '/league/flysystem/src/ConfigAwareTrait.php', - 'League\\Flysystem\\ConnectionErrorException' => $vendorDir . '/league/flysystem/src/ConnectionErrorException.php', - 'League\\Flysystem\\ConnectionRuntimeException' => $vendorDir . '/league/flysystem/src/ConnectionRuntimeException.php', - 'League\\Flysystem\\CorruptedPathDetected' => $vendorDir . '/league/flysystem/src/CorruptedPathDetected.php', - 'League\\Flysystem\\Directory' => $vendorDir . '/league/flysystem/src/Directory.php', - 'League\\Flysystem\\Exception' => $vendorDir . '/league/flysystem/src/Exception.php', - 'League\\Flysystem\\File' => $vendorDir . '/league/flysystem/src/File.php', - 'League\\Flysystem\\FileExistsException' => $vendorDir . '/league/flysystem/src/FileExistsException.php', - 'League\\Flysystem\\FileNotFoundException' => $vendorDir . '/league/flysystem/src/FileNotFoundException.php', - 'League\\Flysystem\\Filesystem' => $vendorDir . '/league/flysystem/src/Filesystem.php', - 'League\\Flysystem\\FilesystemException' => $vendorDir . '/league/flysystem/src/FilesystemException.php', - 'League\\Flysystem\\FilesystemInterface' => $vendorDir . '/league/flysystem/src/FilesystemInterface.php', - 'League\\Flysystem\\FilesystemNotFoundException' => $vendorDir . '/league/flysystem/src/FilesystemNotFoundException.php', - 'League\\Flysystem\\Handler' => $vendorDir . '/league/flysystem/src/Handler.php', - 'League\\Flysystem\\InvalidRootException' => $vendorDir . '/league/flysystem/src/InvalidRootException.php', - 'League\\Flysystem\\MountManager' => $vendorDir . '/league/flysystem/src/MountManager.php', - 'League\\Flysystem\\NotSupportedException' => $vendorDir . '/league/flysystem/src/NotSupportedException.php', - 'League\\Flysystem\\PluginInterface' => $vendorDir . '/league/flysystem/src/PluginInterface.php', - 'League\\Flysystem\\Plugin\\AbstractPlugin' => $vendorDir . '/league/flysystem/src/Plugin/AbstractPlugin.php', - 'League\\Flysystem\\Plugin\\EmptyDir' => $vendorDir . '/league/flysystem/src/Plugin/EmptyDir.php', - 'League\\Flysystem\\Plugin\\ForcedCopy' => $vendorDir . '/league/flysystem/src/Plugin/ForcedCopy.php', - 'League\\Flysystem\\Plugin\\ForcedRename' => $vendorDir . '/league/flysystem/src/Plugin/ForcedRename.php', - 'League\\Flysystem\\Plugin\\GetWithMetadata' => $vendorDir . '/league/flysystem/src/Plugin/GetWithMetadata.php', - 'League\\Flysystem\\Plugin\\ListFiles' => $vendorDir . '/league/flysystem/src/Plugin/ListFiles.php', - 'League\\Flysystem\\Plugin\\ListPaths' => $vendorDir . '/league/flysystem/src/Plugin/ListPaths.php', - 'League\\Flysystem\\Plugin\\ListWith' => $vendorDir . '/league/flysystem/src/Plugin/ListWith.php', - 'League\\Flysystem\\Plugin\\PluggableTrait' => $vendorDir . '/league/flysystem/src/Plugin/PluggableTrait.php', - 'League\\Flysystem\\Plugin\\PluginNotFoundException' => $vendorDir . '/league/flysystem/src/Plugin/PluginNotFoundException.php', - 'League\\Flysystem\\ReadInterface' => $vendorDir . '/league/flysystem/src/ReadInterface.php', - 'League\\Flysystem\\RootViolationException' => $vendorDir . '/league/flysystem/src/RootViolationException.php', - 'League\\Flysystem\\SafeStorage' => $vendorDir . '/league/flysystem/src/SafeStorage.php', - 'League\\Flysystem\\UnreadableFileException' => $vendorDir . '/league/flysystem/src/UnreadableFileException.php', - 'League\\Flysystem\\Util' => $vendorDir . '/league/flysystem/src/Util.php', - 'League\\Flysystem\\Util\\ContentListingFormatter' => $vendorDir . '/league/flysystem/src/Util/ContentListingFormatter.php', - 'League\\Flysystem\\Util\\MimeType' => $vendorDir . '/league/flysystem/src/Util/MimeType.php', - 'League\\Flysystem\\Util\\StreamHasher' => $vendorDir . '/league/flysystem/src/Util/StreamHasher.php', - 'League\\MimeTypeDetection\\EmptyExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php', - 'League\\MimeTypeDetection\\ExtensionLookup' => $vendorDir . '/league/mime-type-detection/src/ExtensionLookup.php', - 'League\\MimeTypeDetection\\ExtensionMimeTypeDetector' => $vendorDir . '/league/mime-type-detection/src/ExtensionMimeTypeDetector.php', - 'League\\MimeTypeDetection\\ExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/ExtensionToMimeTypeMap.php', - 'League\\MimeTypeDetection\\FinfoMimeTypeDetector' => $vendorDir . '/league/mime-type-detection/src/FinfoMimeTypeDetector.php', - 'League\\MimeTypeDetection\\GeneratedExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php', - 'League\\MimeTypeDetection\\MimeTypeDetector' => $vendorDir . '/league/mime-type-detection/src/MimeTypeDetector.php', - 'League\\MimeTypeDetection\\OverridingExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php', - 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'PHPCSUtils\\AbstractSniffs\\AbstractArrayDeclarationSniff' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php', - 'PHPCSUtils\\BackCompat\\BCFile' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php', - 'PHPCSUtils\\BackCompat\\BCTokens' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php', - 'PHPCSUtils\\BackCompat\\Helper' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php', - 'PHPCSUtils\\Exceptions\\InvalidTokenArray' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php', - 'PHPCSUtils\\Exceptions\\TestFileNotFound' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php', - 'PHPCSUtils\\Exceptions\\TestMarkerNotFound' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php', - 'PHPCSUtils\\Exceptions\\TestTargetNotFound' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php', - 'PHPCSUtils\\Fixers\\SpacesFixer' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php', - 'PHPCSUtils\\Internal\\Cache' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php', - 'PHPCSUtils\\Internal\\IsShortArrayOrList' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php', - 'PHPCSUtils\\Internal\\IsShortArrayOrListWithCache' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php', - 'PHPCSUtils\\Internal\\NoFileCache' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php', - 'PHPCSUtils\\Internal\\StableCollections' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php', - 'PHPCSUtils\\TestUtils\\UtilityMethodTestCase' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php', - 'PHPCSUtils\\Tokens\\Collections' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php', - 'PHPCSUtils\\Tokens\\TokenHelper' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php', - 'PHPCSUtils\\Utils\\Arrays' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php', - 'PHPCSUtils\\Utils\\Conditions' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php', - 'PHPCSUtils\\Utils\\Context' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php', - 'PHPCSUtils\\Utils\\ControlStructures' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php', - 'PHPCSUtils\\Utils\\FunctionDeclarations' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php', - 'PHPCSUtils\\Utils\\GetTokensAsString' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php', - 'PHPCSUtils\\Utils\\Lists' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php', - 'PHPCSUtils\\Utils\\MessageHelper' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php', - 'PHPCSUtils\\Utils\\Namespaces' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php', - 'PHPCSUtils\\Utils\\NamingConventions' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php', - 'PHPCSUtils\\Utils\\Numbers' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php', - 'PHPCSUtils\\Utils\\ObjectDeclarations' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php', - 'PHPCSUtils\\Utils\\Operators' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php', - 'PHPCSUtils\\Utils\\Orthography' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php', - 'PHPCSUtils\\Utils\\Parentheses' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php', - 'PHPCSUtils\\Utils\\PassedParameters' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php', - 'PHPCSUtils\\Utils\\Scopes' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php', - 'PHPCSUtils\\Utils\\TextStrings' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php', - 'PHPCSUtils\\Utils\\UseStatements' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php', - 'PHPCSUtils\\Utils\\Variables' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php', - 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php', - 'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php', - 'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'Symfony\\Component\\Console\\Application' => $vendorDir . '/symfony/console/Application.php', - 'Symfony\\Component\\Console\\Attribute\\AsCommand' => $vendorDir . '/symfony/console/Attribute/AsCommand.php', - 'Symfony\\Component\\Console\\CI\\GithubActionReporter' => $vendorDir . '/symfony/console/CI/GithubActionReporter.php', - 'Symfony\\Component\\Console\\Color' => $vendorDir . '/symfony/console/Color.php', - 'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => $vendorDir . '/symfony/console/CommandLoader/CommandLoaderInterface.php', - 'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/ContainerCommandLoader.php', - 'Symfony\\Component\\Console\\CommandLoader\\FactoryCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/FactoryCommandLoader.php', - 'Symfony\\Component\\Console\\Command\\Command' => $vendorDir . '/symfony/console/Command/Command.php', - 'Symfony\\Component\\Console\\Command\\CompleteCommand' => $vendorDir . '/symfony/console/Command/CompleteCommand.php', - 'Symfony\\Component\\Console\\Command\\DumpCompletionCommand' => $vendorDir . '/symfony/console/Command/DumpCompletionCommand.php', - 'Symfony\\Component\\Console\\Command\\HelpCommand' => $vendorDir . '/symfony/console/Command/HelpCommand.php', - 'Symfony\\Component\\Console\\Command\\LazyCommand' => $vendorDir . '/symfony/console/Command/LazyCommand.php', - 'Symfony\\Component\\Console\\Command\\ListCommand' => $vendorDir . '/symfony/console/Command/ListCommand.php', - 'Symfony\\Component\\Console\\Command\\LockableTrait' => $vendorDir . '/symfony/console/Command/LockableTrait.php', - 'Symfony\\Component\\Console\\Command\\SignalableCommandInterface' => $vendorDir . '/symfony/console/Command/SignalableCommandInterface.php', - 'Symfony\\Component\\Console\\Completion\\CompletionInput' => $vendorDir . '/symfony/console/Completion/CompletionInput.php', - 'Symfony\\Component\\Console\\Completion\\CompletionSuggestions' => $vendorDir . '/symfony/console/Completion/CompletionSuggestions.php', - 'Symfony\\Component\\Console\\Completion\\Output\\BashCompletionOutput' => $vendorDir . '/symfony/console/Completion/Output/BashCompletionOutput.php', - 'Symfony\\Component\\Console\\Completion\\Output\\CompletionOutputInterface' => $vendorDir . '/symfony/console/Completion/Output/CompletionOutputInterface.php', - 'Symfony\\Component\\Console\\Completion\\Suggestion' => $vendorDir . '/symfony/console/Completion/Suggestion.php', - 'Symfony\\Component\\Console\\ConsoleEvents' => $vendorDir . '/symfony/console/ConsoleEvents.php', - 'Symfony\\Component\\Console\\Cursor' => $vendorDir . '/symfony/console/Cursor.php', - 'Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => $vendorDir . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php', - 'Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => $vendorDir . '/symfony/console/Descriptor/ApplicationDescription.php', - 'Symfony\\Component\\Console\\Descriptor\\Descriptor' => $vendorDir . '/symfony/console/Descriptor/Descriptor.php', - 'Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => $vendorDir . '/symfony/console/Descriptor/DescriptorInterface.php', - 'Symfony\\Component\\Console\\Descriptor\\JsonDescriptor' => $vendorDir . '/symfony/console/Descriptor/JsonDescriptor.php', - 'Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => $vendorDir . '/symfony/console/Descriptor/MarkdownDescriptor.php', - 'Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => $vendorDir . '/symfony/console/Descriptor/TextDescriptor.php', - 'Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => $vendorDir . '/symfony/console/Descriptor/XmlDescriptor.php', - 'Symfony\\Component\\Console\\EventListener\\ErrorListener' => $vendorDir . '/symfony/console/EventListener/ErrorListener.php', - 'Symfony\\Component\\Console\\Event\\ConsoleCommandEvent' => $vendorDir . '/symfony/console/Event/ConsoleCommandEvent.php', - 'Symfony\\Component\\Console\\Event\\ConsoleErrorEvent' => $vendorDir . '/symfony/console/Event/ConsoleErrorEvent.php', - 'Symfony\\Component\\Console\\Event\\ConsoleEvent' => $vendorDir . '/symfony/console/Event/ConsoleEvent.php', - 'Symfony\\Component\\Console\\Event\\ConsoleSignalEvent' => $vendorDir . '/symfony/console/Event/ConsoleSignalEvent.php', - 'Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => $vendorDir . '/symfony/console/Event/ConsoleTerminateEvent.php', - 'Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => $vendorDir . '/symfony/console/Exception/CommandNotFoundException.php', - 'Symfony\\Component\\Console\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/console/Exception/ExceptionInterface.php', - 'Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/console/Exception/InvalidArgumentException.php', - 'Symfony\\Component\\Console\\Exception\\InvalidOptionException' => $vendorDir . '/symfony/console/Exception/InvalidOptionException.php', - 'Symfony\\Component\\Console\\Exception\\LogicException' => $vendorDir . '/symfony/console/Exception/LogicException.php', - 'Symfony\\Component\\Console\\Exception\\MissingInputException' => $vendorDir . '/symfony/console/Exception/MissingInputException.php', - 'Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => $vendorDir . '/symfony/console/Exception/NamespaceNotFoundException.php', - 'Symfony\\Component\\Console\\Exception\\RuntimeException' => $vendorDir . '/symfony/console/Exception/RuntimeException.php', - 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatter' => $vendorDir . '/symfony/console/Formatter/NullOutputFormatter.php', - 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatterStyle' => $vendorDir . '/symfony/console/Formatter/NullOutputFormatterStyle.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => $vendorDir . '/symfony/console/Formatter/OutputFormatter.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => $vendorDir . '/symfony/console/Formatter/OutputFormatterInterface.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyle.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyleInterface.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyleStack.php', - 'Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' => $vendorDir . '/symfony/console/Formatter/WrappableOutputFormatterInterface.php', - 'Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => $vendorDir . '/symfony/console/Helper/DebugFormatterHelper.php', - 'Symfony\\Component\\Console\\Helper\\DescriptorHelper' => $vendorDir . '/symfony/console/Helper/DescriptorHelper.php', - 'Symfony\\Component\\Console\\Helper\\Dumper' => $vendorDir . '/symfony/console/Helper/Dumper.php', - 'Symfony\\Component\\Console\\Helper\\FormatterHelper' => $vendorDir . '/symfony/console/Helper/FormatterHelper.php', - 'Symfony\\Component\\Console\\Helper\\Helper' => $vendorDir . '/symfony/console/Helper/Helper.php', - 'Symfony\\Component\\Console\\Helper\\HelperInterface' => $vendorDir . '/symfony/console/Helper/HelperInterface.php', - 'Symfony\\Component\\Console\\Helper\\HelperSet' => $vendorDir . '/symfony/console/Helper/HelperSet.php', - 'Symfony\\Component\\Console\\Helper\\InputAwareHelper' => $vendorDir . '/symfony/console/Helper/InputAwareHelper.php', - 'Symfony\\Component\\Console\\Helper\\ProcessHelper' => $vendorDir . '/symfony/console/Helper/ProcessHelper.php', - 'Symfony\\Component\\Console\\Helper\\ProgressBar' => $vendorDir . '/symfony/console/Helper/ProgressBar.php', - 'Symfony\\Component\\Console\\Helper\\ProgressIndicator' => $vendorDir . '/symfony/console/Helper/ProgressIndicator.php', - 'Symfony\\Component\\Console\\Helper\\QuestionHelper' => $vendorDir . '/symfony/console/Helper/QuestionHelper.php', - 'Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => $vendorDir . '/symfony/console/Helper/SymfonyQuestionHelper.php', - 'Symfony\\Component\\Console\\Helper\\Table' => $vendorDir . '/symfony/console/Helper/Table.php', - 'Symfony\\Component\\Console\\Helper\\TableCell' => $vendorDir . '/symfony/console/Helper/TableCell.php', - 'Symfony\\Component\\Console\\Helper\\TableCellStyle' => $vendorDir . '/symfony/console/Helper/TableCellStyle.php', - 'Symfony\\Component\\Console\\Helper\\TableRows' => $vendorDir . '/symfony/console/Helper/TableRows.php', - 'Symfony\\Component\\Console\\Helper\\TableSeparator' => $vendorDir . '/symfony/console/Helper/TableSeparator.php', - 'Symfony\\Component\\Console\\Helper\\TableStyle' => $vendorDir . '/symfony/console/Helper/TableStyle.php', - 'Symfony\\Component\\Console\\Input\\ArgvInput' => $vendorDir . '/symfony/console/Input/ArgvInput.php', - 'Symfony\\Component\\Console\\Input\\ArrayInput' => $vendorDir . '/symfony/console/Input/ArrayInput.php', - 'Symfony\\Component\\Console\\Input\\Input' => $vendorDir . '/symfony/console/Input/Input.php', - 'Symfony\\Component\\Console\\Input\\InputArgument' => $vendorDir . '/symfony/console/Input/InputArgument.php', - 'Symfony\\Component\\Console\\Input\\InputAwareInterface' => $vendorDir . '/symfony/console/Input/InputAwareInterface.php', - 'Symfony\\Component\\Console\\Input\\InputDefinition' => $vendorDir . '/symfony/console/Input/InputDefinition.php', - 'Symfony\\Component\\Console\\Input\\InputInterface' => $vendorDir . '/symfony/console/Input/InputInterface.php', - 'Symfony\\Component\\Console\\Input\\InputOption' => $vendorDir . '/symfony/console/Input/InputOption.php', - 'Symfony\\Component\\Console\\Input\\StreamableInputInterface' => $vendorDir . '/symfony/console/Input/StreamableInputInterface.php', - 'Symfony\\Component\\Console\\Input\\StringInput' => $vendorDir . '/symfony/console/Input/StringInput.php', - 'Symfony\\Component\\Console\\Logger\\ConsoleLogger' => $vendorDir . '/symfony/console/Logger/ConsoleLogger.php', - 'Symfony\\Component\\Console\\Output\\BufferedOutput' => $vendorDir . '/symfony/console/Output/BufferedOutput.php', - 'Symfony\\Component\\Console\\Output\\ConsoleOutput' => $vendorDir . '/symfony/console/Output/ConsoleOutput.php', - 'Symfony\\Component\\Console\\Output\\ConsoleOutputInterface' => $vendorDir . '/symfony/console/Output/ConsoleOutputInterface.php', - 'Symfony\\Component\\Console\\Output\\ConsoleSectionOutput' => $vendorDir . '/symfony/console/Output/ConsoleSectionOutput.php', - 'Symfony\\Component\\Console\\Output\\NullOutput' => $vendorDir . '/symfony/console/Output/NullOutput.php', - 'Symfony\\Component\\Console\\Output\\Output' => $vendorDir . '/symfony/console/Output/Output.php', - 'Symfony\\Component\\Console\\Output\\OutputInterface' => $vendorDir . '/symfony/console/Output/OutputInterface.php', - 'Symfony\\Component\\Console\\Output\\StreamOutput' => $vendorDir . '/symfony/console/Output/StreamOutput.php', - 'Symfony\\Component\\Console\\Output\\TrimmedBufferOutput' => $vendorDir . '/symfony/console/Output/TrimmedBufferOutput.php', - 'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => $vendorDir . '/symfony/console/Question/ChoiceQuestion.php', - 'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => $vendorDir . '/symfony/console/Question/ConfirmationQuestion.php', - 'Symfony\\Component\\Console\\Question\\Question' => $vendorDir . '/symfony/console/Question/Question.php', - 'Symfony\\Component\\Console\\SignalRegistry\\SignalRegistry' => $vendorDir . '/symfony/console/SignalRegistry/SignalRegistry.php', - 'Symfony\\Component\\Console\\SingleCommandApplication' => $vendorDir . '/symfony/console/SingleCommandApplication.php', - 'Symfony\\Component\\Console\\Style\\OutputStyle' => $vendorDir . '/symfony/console/Style/OutputStyle.php', - 'Symfony\\Component\\Console\\Style\\StyleInterface' => $vendorDir . '/symfony/console/Style/StyleInterface.php', - 'Symfony\\Component\\Console\\Style\\SymfonyStyle' => $vendorDir . '/symfony/console/Style/SymfonyStyle.php', - 'Symfony\\Component\\Console\\Terminal' => $vendorDir . '/symfony/console/Terminal.php', - 'Symfony\\Component\\Console\\Tester\\ApplicationTester' => $vendorDir . '/symfony/console/Tester/ApplicationTester.php', - 'Symfony\\Component\\Console\\Tester\\CommandCompletionTester' => $vendorDir . '/symfony/console/Tester/CommandCompletionTester.php', - 'Symfony\\Component\\Console\\Tester\\CommandTester' => $vendorDir . '/symfony/console/Tester/CommandTester.php', - 'Symfony\\Component\\Console\\Tester\\Constraint\\CommandIsSuccessful' => $vendorDir . '/symfony/console/Tester/Constraint/CommandIsSuccessful.php', - 'Symfony\\Component\\Console\\Tester\\TesterTrait' => $vendorDir . '/symfony/console/Tester/TesterTrait.php', - 'Symfony\\Component\\Finder\\Comparator\\Comparator' => $vendorDir . '/symfony/finder/Comparator/Comparator.php', - 'Symfony\\Component\\Finder\\Comparator\\DateComparator' => $vendorDir . '/symfony/finder/Comparator/DateComparator.php', - 'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => $vendorDir . '/symfony/finder/Comparator/NumberComparator.php', - 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => $vendorDir . '/symfony/finder/Exception/AccessDeniedException.php', - 'Symfony\\Component\\Finder\\Exception\\DirectoryNotFoundException' => $vendorDir . '/symfony/finder/Exception/DirectoryNotFoundException.php', - 'Symfony\\Component\\Finder\\Finder' => $vendorDir . '/symfony/finder/Finder.php', - 'Symfony\\Component\\Finder\\Gitignore' => $vendorDir . '/symfony/finder/Gitignore.php', - 'Symfony\\Component\\Finder\\Glob' => $vendorDir . '/symfony/finder/Glob.php', - 'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => $vendorDir . '/symfony/finder/Iterator/CustomFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DateRangeFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\DepthRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DepthRangeFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator' => $vendorDir . '/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FileTypeFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilecontentFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilenameFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\LazyIterator' => $vendorDir . '/symfony/finder/Iterator/LazyIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' => $vendorDir . '/symfony/finder/Iterator/MultiplePcreFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\PathFilterIterator' => $vendorDir . '/symfony/finder/Iterator/PathFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => $vendorDir . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\SizeRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/SizeRangeFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\SortableIterator' => $vendorDir . '/symfony/finder/Iterator/SortableIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\VcsIgnoredFilterIterator' => $vendorDir . '/symfony/finder/Iterator/VcsIgnoredFilterIterator.php', - 'Symfony\\Component\\Finder\\SplFileInfo' => $vendorDir . '/symfony/finder/SplFileInfo.php', - 'Symfony\\Component\\String\\AbstractString' => $vendorDir . '/symfony/string/AbstractString.php', - 'Symfony\\Component\\String\\AbstractUnicodeString' => $vendorDir . '/symfony/string/AbstractUnicodeString.php', - 'Symfony\\Component\\String\\ByteString' => $vendorDir . '/symfony/string/ByteString.php', - 'Symfony\\Component\\String\\CodePointString' => $vendorDir . '/symfony/string/CodePointString.php', - 'Symfony\\Component\\String\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/string/Exception/ExceptionInterface.php', - 'Symfony\\Component\\String\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/string/Exception/InvalidArgumentException.php', - 'Symfony\\Component\\String\\Exception\\RuntimeException' => $vendorDir . '/symfony/string/Exception/RuntimeException.php', - 'Symfony\\Component\\String\\Inflector\\EnglishInflector' => $vendorDir . '/symfony/string/Inflector/EnglishInflector.php', - 'Symfony\\Component\\String\\Inflector\\FrenchInflector' => $vendorDir . '/symfony/string/Inflector/FrenchInflector.php', - 'Symfony\\Component\\String\\Inflector\\InflectorInterface' => $vendorDir . '/symfony/string/Inflector/InflectorInterface.php', - 'Symfony\\Component\\String\\LazyString' => $vendorDir . '/symfony/string/LazyString.php', - 'Symfony\\Component\\String\\Slugger\\AsciiSlugger' => $vendorDir . '/symfony/string/Slugger/AsciiSlugger.php', - 'Symfony\\Component\\String\\Slugger\\SluggerInterface' => $vendorDir . '/symfony/string/Slugger/SluggerInterface.php', - 'Symfony\\Component\\String\\UnicodeString' => $vendorDir . '/symfony/string/UnicodeString.php', - 'Symfony\\Contracts\\Service\\Attribute\\Required' => $vendorDir . '/symfony/service-contracts/Attribute/Required.php', - 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => $vendorDir . '/symfony/service-contracts/Attribute/SubscribedService.php', - 'Symfony\\Contracts\\Service\\ResetInterface' => $vendorDir . '/symfony/service-contracts/ResetInterface.php', - 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => $vendorDir . '/symfony/service-contracts/ServiceLocatorTrait.php', - 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => $vendorDir . '/symfony/service-contracts/ServiceProviderInterface.php', - 'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberInterface.php', - 'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberTrait.php', - 'Symfony\\Contracts\\Service\\Test\\ServiceLocatorTest' => $vendorDir . '/symfony/service-contracts/Test/ServiceLocatorTest.php', - 'Symfony\\Polyfill\\Ctype\\Ctype' => $vendorDir . '/symfony/polyfill-ctype/Ctype.php', - 'Symfony\\Polyfill\\Intl\\Grapheme\\Grapheme' => $vendorDir . '/symfony/polyfill-intl-grapheme/Grapheme.php', - 'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Normalizer.php', - 'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php', - 'Symfony\\Polyfill\\Php73\\Php73' => $vendorDir . '/symfony/polyfill-php73/Php73.php', - 'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php', - 'Symfony\\Polyfill\\Php80\\PhpToken' => $vendorDir . '/symfony/polyfill-php80/PhpToken.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - 'WooCommerceSerialNumbers\\API' => $baseDir . '/src/API.php', - 'WooCommerceSerialNumbers\\Actions' => $baseDir . '/src/Actions.php', - 'WooCommerceSerialNumbers\\Admin\\Actions' => $baseDir . '/src/Admin/Actions.php', - 'WooCommerceSerialNumbers\\Admin\\Admin' => $baseDir . '/src/Admin/Admin.php', - 'WooCommerceSerialNumbers\\Admin\\ListTables\\ActivationsTable' => $baseDir . '/src/Admin/ListTables/ActivationsTable.php', - 'WooCommerceSerialNumbers\\Admin\\ListTables\\KeysTable' => $baseDir . '/src/Admin/ListTables/KeysTable.php', - 'WooCommerceSerialNumbers\\Admin\\ListTables\\ListTable' => $baseDir . '/src/Admin/ListTables/ListTable.php', - 'WooCommerceSerialNumbers\\Admin\\ListTables\\StockTable' => $baseDir . '/src/Admin/ListTables/StockTable.php', - 'WooCommerceSerialNumbers\\Admin\\Menus' => $baseDir . '/src/Admin/Menus.php', - 'WooCommerceSerialNumbers\\Admin\\Metaboxes' => $baseDir . '/src/Admin/Metaboxes.php', - 'WooCommerceSerialNumbers\\Admin\\Notices' => $baseDir . '/src/Admin/Notices.php', - 'WooCommerceSerialNumbers\\Admin\\Orders' => $baseDir . '/src/Admin/Orders.php', - 'WooCommerceSerialNumbers\\Admin\\Products' => $baseDir . '/src/Admin/Products.php', - 'WooCommerceSerialNumbers\\Admin\\Settings' => $baseDir . '/src/Admin/Settings.php', - 'WooCommerceSerialNumbers\\Ajax' => $baseDir . '/src/Ajax.php', - 'WooCommerceSerialNumbers\\Cache' => $baseDir . '/src/Cache.php', - 'WooCommerceSerialNumbers\\Compat' => $baseDir . '/src/Compat.php', - 'WooCommerceSerialNumbers\\Cron' => $baseDir . '/src/Cron.php', - 'WooCommerceSerialNumbers\\Encryption' => $baseDir . '/src/Encryption.php', - 'WooCommerceSerialNumbers\\Frontend\\Frontend' => $baseDir . '/src/Frontend/Frontend.php', - 'WooCommerceSerialNumbers\\Frontend\\Shortcodes' => $baseDir . '/src/Frontend/Shortcodes.php', - 'WooCommerceSerialNumbers\\Installer' => $baseDir . '/src/Installer.php', - 'WooCommerceSerialNumbers\\Lib\\Container' => $baseDir . '/lib/Lib/Container.php', - 'WooCommerceSerialNumbers\\Lib\\Model' => $baseDir . '/lib/Lib/Model.php', - 'WooCommerceSerialNumbers\\Lib\\Plugin' => $baseDir . '/lib/Lib/Plugin.php', - 'WooCommerceSerialNumbers\\Lib\\PluginInterface' => $baseDir . '/lib/Lib/PluginInterface.php', - 'WooCommerceSerialNumbers\\Lib\\Settings' => $baseDir . '/lib/Lib/Settings.php', - 'WooCommerceSerialNumbers\\Models\\Activation' => $baseDir . '/src/Models/Activation.php', - 'WooCommerceSerialNumbers\\Models\\Key' => $baseDir . '/src/Models/Key.php', - 'WooCommerceSerialNumbers\\Models\\Model' => $baseDir . '/src/Models/Model.php', - 'WooCommerceSerialNumbers\\Orders' => $baseDir . '/src/Orders.php', - 'WooCommerceSerialNumbers\\Plugin' => $baseDir . '/src/Plugin.php', - 'WooCommerceSerialNumbers\\RestAPI' => $baseDir . '/src/RestAPI.php', - 'WooCommerceSerialNumbers\\Stocks' => $baseDir . '/src/Stocks.php', - 'WooCommerceSerialNumbers\\Utilities\\Utilities' => $baseDir . '/src/Utilities/Utilities.php', -); diff --git a/trunk/vendor/composer/autoload_files.php b/trunk/vendor/composer/autoload_files.php deleted file mode 100644 index e7095988..00000000 --- a/trunk/vendor/composer/autoload_files.php +++ /dev/null @@ -1,17 +0,0 @@ - $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', -); diff --git a/trunk/vendor/composer/autoload_namespaces.php b/trunk/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 15a2ff3a..00000000 --- a/trunk/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($baseDir . '/src', $baseDir . '/lib'), - 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), - 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'), - 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'), - 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'), - 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), - 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), - 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'), - 'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'), - 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => array($vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src'), - 'CoenJacobs\\Mozart\\' => array($vendorDir . '/coenjacobs/mozart/src'), -); diff --git a/trunk/vendor/composer/autoload_real.php b/trunk/vendor/composer/autoload_real.php deleted file mode 100644 index 0a80273a..00000000 --- a/trunk/vendor/composer/autoload_real.php +++ /dev/null @@ -1,50 +0,0 @@ -register(true); - - $filesToLoad = \Composer\Autoload\ComposerStaticInit1708bb6e2309c5b3f2b0c1d7ea103daf::$files; - $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } - }, null, null); - foreach ($filesToLoad as $fileIdentifier => $file) { - $requireFile($fileIdentifier, $file); - } - - return $loader; - } -} diff --git a/trunk/vendor/composer/autoload_static.php b/trunk/vendor/composer/autoload_static.php deleted file mode 100644 index d0745bd8..00000000 --- a/trunk/vendor/composer/autoload_static.php +++ /dev/null @@ -1,451 +0,0 @@ - __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'W' => - array ( - 'WooCommerceSerialNumbers\\' => 25, - ), - 'S' => - array ( - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Php73\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31, - 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Contracts\\Service\\' => 26, - 'Symfony\\Component\\String\\' => 25, - 'Symfony\\Component\\Finder\\' => 25, - 'Symfony\\Component\\Console\\' => 26, - ), - 'P' => - array ( - 'Psr\\Container\\' => 14, - ), - 'L' => - array ( - 'League\\MimeTypeDetection\\' => 25, - 'League\\Flysystem\\' => 17, - ), - 'D' => - array ( - 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => 55, - ), - 'C' => - array ( - 'CoenJacobs\\Mozart\\' => 18, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'WooCommerceSerialNumbers\\' => - array ( - 0 => __DIR__ . '/../..' . '/src', - 1 => __DIR__ . '/../..' . '/lib', - ), - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Php73\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', - ), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme', - ), - 'Symfony\\Polyfill\\Ctype\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', - ), - 'Symfony\\Contracts\\Service\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/service-contracts', - ), - 'Symfony\\Component\\String\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/string', - ), - 'Symfony\\Component\\Finder\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/finder', - ), - 'Symfony\\Component\\Console\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/console', - ), - 'Psr\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/container/src', - ), - 'League\\MimeTypeDetection\\' => - array ( - 0 => __DIR__ . '/..' . '/league/mime-type-detection/src', - ), - 'League\\Flysystem\\' => - array ( - 0 => __DIR__ . '/..' . '/league/flysystem/src', - ), - 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => - array ( - 0 => __DIR__ . '/..' . '/dealerdirect/phpcodesniffer-composer-installer/src', - ), - 'CoenJacobs\\Mozart\\' => - array ( - 0 => __DIR__ . '/..' . '/coenjacobs/mozart/src', - ), - ); - - public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\Autoloader' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\Classmap' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/Classmap.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\NamespaceAutoloader' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\Psr0' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/Psr0.php', - 'CoenJacobs\\Mozart\\Composer\\Autoload\\Psr4' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Autoload/Psr4.php', - 'CoenJacobs\\Mozart\\Composer\\Package' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Composer/Package.php', - 'CoenJacobs\\Mozart\\Console\\Application' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Console/Application.php', - 'CoenJacobs\\Mozart\\Console\\Commands\\Compose' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Console/Commands/Compose.php', - 'CoenJacobs\\Mozart\\Mover' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Mover.php', - 'CoenJacobs\\Mozart\\Replace\\BaseReplacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replace/BaseReplacer.php', - 'CoenJacobs\\Mozart\\Replace\\ClassmapReplacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replace/ClassmapReplacer.php', - 'CoenJacobs\\Mozart\\Replace\\NamespaceReplacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replace/NamespaceReplacer.php', - 'CoenJacobs\\Mozart\\Replace\\Replacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replace/Replacer.php', - 'CoenJacobs\\Mozart\\Replacer' => __DIR__ . '/..' . '/coenjacobs/mozart/src/Replacer.php', - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin' => __DIR__ . '/..' . '/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php', - 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', - 'League\\Flysystem\\AdapterInterface' => __DIR__ . '/..' . '/league/flysystem/src/AdapterInterface.php', - 'League\\Flysystem\\Adapter\\AbstractAdapter' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/AbstractAdapter.php', - 'League\\Flysystem\\Adapter\\AbstractFtpAdapter' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/AbstractFtpAdapter.php', - 'League\\Flysystem\\Adapter\\CanOverwriteFiles' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/CanOverwriteFiles.php', - 'League\\Flysystem\\Adapter\\Ftp' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Ftp.php', - 'League\\Flysystem\\Adapter\\Ftpd' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Ftpd.php', - 'League\\Flysystem\\Adapter\\Local' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Local.php', - 'League\\Flysystem\\Adapter\\NullAdapter' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/NullAdapter.php', - 'League\\Flysystem\\Adapter\\Polyfill\\NotSupportingVisibilityTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php', - 'League\\Flysystem\\Adapter\\Polyfill\\StreamedCopyTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/StreamedCopyTrait.php', - 'League\\Flysystem\\Adapter\\Polyfill\\StreamedReadingTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php', - 'League\\Flysystem\\Adapter\\Polyfill\\StreamedTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php', - 'League\\Flysystem\\Adapter\\Polyfill\\StreamedWritingTrait' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/Polyfill/StreamedWritingTrait.php', - 'League\\Flysystem\\Adapter\\SynologyFtp' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/SynologyFtp.php', - 'League\\Flysystem\\Config' => __DIR__ . '/..' . '/league/flysystem/src/Config.php', - 'League\\Flysystem\\ConfigAwareTrait' => __DIR__ . '/..' . '/league/flysystem/src/ConfigAwareTrait.php', - 'League\\Flysystem\\ConnectionErrorException' => __DIR__ . '/..' . '/league/flysystem/src/ConnectionErrorException.php', - 'League\\Flysystem\\ConnectionRuntimeException' => __DIR__ . '/..' . '/league/flysystem/src/ConnectionRuntimeException.php', - 'League\\Flysystem\\CorruptedPathDetected' => __DIR__ . '/..' . '/league/flysystem/src/CorruptedPathDetected.php', - 'League\\Flysystem\\Directory' => __DIR__ . '/..' . '/league/flysystem/src/Directory.php', - 'League\\Flysystem\\Exception' => __DIR__ . '/..' . '/league/flysystem/src/Exception.php', - 'League\\Flysystem\\File' => __DIR__ . '/..' . '/league/flysystem/src/File.php', - 'League\\Flysystem\\FileExistsException' => __DIR__ . '/..' . '/league/flysystem/src/FileExistsException.php', - 'League\\Flysystem\\FileNotFoundException' => __DIR__ . '/..' . '/league/flysystem/src/FileNotFoundException.php', - 'League\\Flysystem\\Filesystem' => __DIR__ . '/..' . '/league/flysystem/src/Filesystem.php', - 'League\\Flysystem\\FilesystemException' => __DIR__ . '/..' . '/league/flysystem/src/FilesystemException.php', - 'League\\Flysystem\\FilesystemInterface' => __DIR__ . '/..' . '/league/flysystem/src/FilesystemInterface.php', - 'League\\Flysystem\\FilesystemNotFoundException' => __DIR__ . '/..' . '/league/flysystem/src/FilesystemNotFoundException.php', - 'League\\Flysystem\\Handler' => __DIR__ . '/..' . '/league/flysystem/src/Handler.php', - 'League\\Flysystem\\InvalidRootException' => __DIR__ . '/..' . '/league/flysystem/src/InvalidRootException.php', - 'League\\Flysystem\\MountManager' => __DIR__ . '/..' . '/league/flysystem/src/MountManager.php', - 'League\\Flysystem\\NotSupportedException' => __DIR__ . '/..' . '/league/flysystem/src/NotSupportedException.php', - 'League\\Flysystem\\PluginInterface' => __DIR__ . '/..' . '/league/flysystem/src/PluginInterface.php', - 'League\\Flysystem\\Plugin\\AbstractPlugin' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/AbstractPlugin.php', - 'League\\Flysystem\\Plugin\\EmptyDir' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/EmptyDir.php', - 'League\\Flysystem\\Plugin\\ForcedCopy' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ForcedCopy.php', - 'League\\Flysystem\\Plugin\\ForcedRename' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ForcedRename.php', - 'League\\Flysystem\\Plugin\\GetWithMetadata' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/GetWithMetadata.php', - 'League\\Flysystem\\Plugin\\ListFiles' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ListFiles.php', - 'League\\Flysystem\\Plugin\\ListPaths' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ListPaths.php', - 'League\\Flysystem\\Plugin\\ListWith' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/ListWith.php', - 'League\\Flysystem\\Plugin\\PluggableTrait' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/PluggableTrait.php', - 'League\\Flysystem\\Plugin\\PluginNotFoundException' => __DIR__ . '/..' . '/league/flysystem/src/Plugin/PluginNotFoundException.php', - 'League\\Flysystem\\ReadInterface' => __DIR__ . '/..' . '/league/flysystem/src/ReadInterface.php', - 'League\\Flysystem\\RootViolationException' => __DIR__ . '/..' . '/league/flysystem/src/RootViolationException.php', - 'League\\Flysystem\\SafeStorage' => __DIR__ . '/..' . '/league/flysystem/src/SafeStorage.php', - 'League\\Flysystem\\UnreadableFileException' => __DIR__ . '/..' . '/league/flysystem/src/UnreadableFileException.php', - 'League\\Flysystem\\Util' => __DIR__ . '/..' . '/league/flysystem/src/Util.php', - 'League\\Flysystem\\Util\\ContentListingFormatter' => __DIR__ . '/..' . '/league/flysystem/src/Util/ContentListingFormatter.php', - 'League\\Flysystem\\Util\\MimeType' => __DIR__ . '/..' . '/league/flysystem/src/Util/MimeType.php', - 'League\\Flysystem\\Util\\StreamHasher' => __DIR__ . '/..' . '/league/flysystem/src/Util/StreamHasher.php', - 'League\\MimeTypeDetection\\EmptyExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php', - 'League\\MimeTypeDetection\\ExtensionLookup' => __DIR__ . '/..' . '/league/mime-type-detection/src/ExtensionLookup.php', - 'League\\MimeTypeDetection\\ExtensionMimeTypeDetector' => __DIR__ . '/..' . '/league/mime-type-detection/src/ExtensionMimeTypeDetector.php', - 'League\\MimeTypeDetection\\ExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/ExtensionToMimeTypeMap.php', - 'League\\MimeTypeDetection\\FinfoMimeTypeDetector' => __DIR__ . '/..' . '/league/mime-type-detection/src/FinfoMimeTypeDetector.php', - 'League\\MimeTypeDetection\\GeneratedExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php', - 'League\\MimeTypeDetection\\MimeTypeDetector' => __DIR__ . '/..' . '/league/mime-type-detection/src/MimeTypeDetector.php', - 'League\\MimeTypeDetection\\OverridingExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php', - 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'PHPCSUtils\\AbstractSniffs\\AbstractArrayDeclarationSniff' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php', - 'PHPCSUtils\\BackCompat\\BCFile' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php', - 'PHPCSUtils\\BackCompat\\BCTokens' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php', - 'PHPCSUtils\\BackCompat\\Helper' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php', - 'PHPCSUtils\\Exceptions\\InvalidTokenArray' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php', - 'PHPCSUtils\\Exceptions\\TestFileNotFound' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php', - 'PHPCSUtils\\Exceptions\\TestMarkerNotFound' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php', - 'PHPCSUtils\\Exceptions\\TestTargetNotFound' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php', - 'PHPCSUtils\\Fixers\\SpacesFixer' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php', - 'PHPCSUtils\\Internal\\Cache' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php', - 'PHPCSUtils\\Internal\\IsShortArrayOrList' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php', - 'PHPCSUtils\\Internal\\IsShortArrayOrListWithCache' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php', - 'PHPCSUtils\\Internal\\NoFileCache' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php', - 'PHPCSUtils\\Internal\\StableCollections' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php', - 'PHPCSUtils\\TestUtils\\UtilityMethodTestCase' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php', - 'PHPCSUtils\\Tokens\\Collections' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php', - 'PHPCSUtils\\Tokens\\TokenHelper' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php', - 'PHPCSUtils\\Utils\\Arrays' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php', - 'PHPCSUtils\\Utils\\Conditions' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php', - 'PHPCSUtils\\Utils\\Context' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php', - 'PHPCSUtils\\Utils\\ControlStructures' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php', - 'PHPCSUtils\\Utils\\FunctionDeclarations' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php', - 'PHPCSUtils\\Utils\\GetTokensAsString' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php', - 'PHPCSUtils\\Utils\\Lists' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php', - 'PHPCSUtils\\Utils\\MessageHelper' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php', - 'PHPCSUtils\\Utils\\Namespaces' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php', - 'PHPCSUtils\\Utils\\NamingConventions' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php', - 'PHPCSUtils\\Utils\\Numbers' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php', - 'PHPCSUtils\\Utils\\ObjectDeclarations' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php', - 'PHPCSUtils\\Utils\\Operators' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php', - 'PHPCSUtils\\Utils\\Orthography' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php', - 'PHPCSUtils\\Utils\\Parentheses' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php', - 'PHPCSUtils\\Utils\\PassedParameters' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php', - 'PHPCSUtils\\Utils\\Scopes' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php', - 'PHPCSUtils\\Utils\\TextStrings' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php', - 'PHPCSUtils\\Utils\\UseStatements' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php', - 'PHPCSUtils\\Utils\\Variables' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php', - 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php', - 'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php', - 'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'Symfony\\Component\\Console\\Application' => __DIR__ . '/..' . '/symfony/console/Application.php', - 'Symfony\\Component\\Console\\Attribute\\AsCommand' => __DIR__ . '/..' . '/symfony/console/Attribute/AsCommand.php', - 'Symfony\\Component\\Console\\CI\\GithubActionReporter' => __DIR__ . '/..' . '/symfony/console/CI/GithubActionReporter.php', - 'Symfony\\Component\\Console\\Color' => __DIR__ . '/..' . '/symfony/console/Color.php', - 'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => __DIR__ . '/..' . '/symfony/console/CommandLoader/CommandLoaderInterface.php', - 'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/ContainerCommandLoader.php', - 'Symfony\\Component\\Console\\CommandLoader\\FactoryCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/FactoryCommandLoader.php', - 'Symfony\\Component\\Console\\Command\\Command' => __DIR__ . '/..' . '/symfony/console/Command/Command.php', - 'Symfony\\Component\\Console\\Command\\CompleteCommand' => __DIR__ . '/..' . '/symfony/console/Command/CompleteCommand.php', - 'Symfony\\Component\\Console\\Command\\DumpCompletionCommand' => __DIR__ . '/..' . '/symfony/console/Command/DumpCompletionCommand.php', - 'Symfony\\Component\\Console\\Command\\HelpCommand' => __DIR__ . '/..' . '/symfony/console/Command/HelpCommand.php', - 'Symfony\\Component\\Console\\Command\\LazyCommand' => __DIR__ . '/..' . '/symfony/console/Command/LazyCommand.php', - 'Symfony\\Component\\Console\\Command\\ListCommand' => __DIR__ . '/..' . '/symfony/console/Command/ListCommand.php', - 'Symfony\\Component\\Console\\Command\\LockableTrait' => __DIR__ . '/..' . '/symfony/console/Command/LockableTrait.php', - 'Symfony\\Component\\Console\\Command\\SignalableCommandInterface' => __DIR__ . '/..' . '/symfony/console/Command/SignalableCommandInterface.php', - 'Symfony\\Component\\Console\\Completion\\CompletionInput' => __DIR__ . '/..' . '/symfony/console/Completion/CompletionInput.php', - 'Symfony\\Component\\Console\\Completion\\CompletionSuggestions' => __DIR__ . '/..' . '/symfony/console/Completion/CompletionSuggestions.php', - 'Symfony\\Component\\Console\\Completion\\Output\\BashCompletionOutput' => __DIR__ . '/..' . '/symfony/console/Completion/Output/BashCompletionOutput.php', - 'Symfony\\Component\\Console\\Completion\\Output\\CompletionOutputInterface' => __DIR__ . '/..' . '/symfony/console/Completion/Output/CompletionOutputInterface.php', - 'Symfony\\Component\\Console\\Completion\\Suggestion' => __DIR__ . '/..' . '/symfony/console/Completion/Suggestion.php', - 'Symfony\\Component\\Console\\ConsoleEvents' => __DIR__ . '/..' . '/symfony/console/ConsoleEvents.php', - 'Symfony\\Component\\Console\\Cursor' => __DIR__ . '/..' . '/symfony/console/Cursor.php', - 'Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => __DIR__ . '/..' . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php', - 'Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => __DIR__ . '/..' . '/symfony/console/Descriptor/ApplicationDescription.php', - 'Symfony\\Component\\Console\\Descriptor\\Descriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/Descriptor.php', - 'Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => __DIR__ . '/..' . '/symfony/console/Descriptor/DescriptorInterface.php', - 'Symfony\\Component\\Console\\Descriptor\\JsonDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/JsonDescriptor.php', - 'Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/MarkdownDescriptor.php', - 'Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/TextDescriptor.php', - 'Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/XmlDescriptor.php', - 'Symfony\\Component\\Console\\EventListener\\ErrorListener' => __DIR__ . '/..' . '/symfony/console/EventListener/ErrorListener.php', - 'Symfony\\Component\\Console\\Event\\ConsoleCommandEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleCommandEvent.php', - 'Symfony\\Component\\Console\\Event\\ConsoleErrorEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleErrorEvent.php', - 'Symfony\\Component\\Console\\Event\\ConsoleEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleEvent.php', - 'Symfony\\Component\\Console\\Event\\ConsoleSignalEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleSignalEvent.php', - 'Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleTerminateEvent.php', - 'Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/CommandNotFoundException.php', - 'Symfony\\Component\\Console\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/console/Exception/ExceptionInterface.php', - 'Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidArgumentException.php', - 'Symfony\\Component\\Console\\Exception\\InvalidOptionException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidOptionException.php', - 'Symfony\\Component\\Console\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/console/Exception/LogicException.php', - 'Symfony\\Component\\Console\\Exception\\MissingInputException' => __DIR__ . '/..' . '/symfony/console/Exception/MissingInputException.php', - 'Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/NamespaceNotFoundException.php', - 'Symfony\\Component\\Console\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/console/Exception/RuntimeException.php', - 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatter' => __DIR__ . '/..' . '/symfony/console/Formatter/NullOutputFormatter.php', - 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatterStyle' => __DIR__ . '/..' . '/symfony/console/Formatter/NullOutputFormatterStyle.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatter.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterInterface.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyle.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyleInterface.php', - 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyleStack.php', - 'Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/WrappableOutputFormatterInterface.php', - 'Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DebugFormatterHelper.php', - 'Symfony\\Component\\Console\\Helper\\DescriptorHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DescriptorHelper.php', - 'Symfony\\Component\\Console\\Helper\\Dumper' => __DIR__ . '/..' . '/symfony/console/Helper/Dumper.php', - 'Symfony\\Component\\Console\\Helper\\FormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/FormatterHelper.php', - 'Symfony\\Component\\Console\\Helper\\Helper' => __DIR__ . '/..' . '/symfony/console/Helper/Helper.php', - 'Symfony\\Component\\Console\\Helper\\HelperInterface' => __DIR__ . '/..' . '/symfony/console/Helper/HelperInterface.php', - 'Symfony\\Component\\Console\\Helper\\HelperSet' => __DIR__ . '/..' . '/symfony/console/Helper/HelperSet.php', - 'Symfony\\Component\\Console\\Helper\\InputAwareHelper' => __DIR__ . '/..' . '/symfony/console/Helper/InputAwareHelper.php', - 'Symfony\\Component\\Console\\Helper\\ProcessHelper' => __DIR__ . '/..' . '/symfony/console/Helper/ProcessHelper.php', - 'Symfony\\Component\\Console\\Helper\\ProgressBar' => __DIR__ . '/..' . '/symfony/console/Helper/ProgressBar.php', - 'Symfony\\Component\\Console\\Helper\\ProgressIndicator' => __DIR__ . '/..' . '/symfony/console/Helper/ProgressIndicator.php', - 'Symfony\\Component\\Console\\Helper\\QuestionHelper' => __DIR__ . '/..' . '/symfony/console/Helper/QuestionHelper.php', - 'Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => __DIR__ . '/..' . '/symfony/console/Helper/SymfonyQuestionHelper.php', - 'Symfony\\Component\\Console\\Helper\\Table' => __DIR__ . '/..' . '/symfony/console/Helper/Table.php', - 'Symfony\\Component\\Console\\Helper\\TableCell' => __DIR__ . '/..' . '/symfony/console/Helper/TableCell.php', - 'Symfony\\Component\\Console\\Helper\\TableCellStyle' => __DIR__ . '/..' . '/symfony/console/Helper/TableCellStyle.php', - 'Symfony\\Component\\Console\\Helper\\TableRows' => __DIR__ . '/..' . '/symfony/console/Helper/TableRows.php', - 'Symfony\\Component\\Console\\Helper\\TableSeparator' => __DIR__ . '/..' . '/symfony/console/Helper/TableSeparator.php', - 'Symfony\\Component\\Console\\Helper\\TableStyle' => __DIR__ . '/..' . '/symfony/console/Helper/TableStyle.php', - 'Symfony\\Component\\Console\\Input\\ArgvInput' => __DIR__ . '/..' . '/symfony/console/Input/ArgvInput.php', - 'Symfony\\Component\\Console\\Input\\ArrayInput' => __DIR__ . '/..' . '/symfony/console/Input/ArrayInput.php', - 'Symfony\\Component\\Console\\Input\\Input' => __DIR__ . '/..' . '/symfony/console/Input/Input.php', - 'Symfony\\Component\\Console\\Input\\InputArgument' => __DIR__ . '/..' . '/symfony/console/Input/InputArgument.php', - 'Symfony\\Component\\Console\\Input\\InputAwareInterface' => __DIR__ . '/..' . '/symfony/console/Input/InputAwareInterface.php', - 'Symfony\\Component\\Console\\Input\\InputDefinition' => __DIR__ . '/..' . '/symfony/console/Input/InputDefinition.php', - 'Symfony\\Component\\Console\\Input\\InputInterface' => __DIR__ . '/..' . '/symfony/console/Input/InputInterface.php', - 'Symfony\\Component\\Console\\Input\\InputOption' => __DIR__ . '/..' . '/symfony/console/Input/InputOption.php', - 'Symfony\\Component\\Console\\Input\\StreamableInputInterface' => __DIR__ . '/..' . '/symfony/console/Input/StreamableInputInterface.php', - 'Symfony\\Component\\Console\\Input\\StringInput' => __DIR__ . '/..' . '/symfony/console/Input/StringInput.php', - 'Symfony\\Component\\Console\\Logger\\ConsoleLogger' => __DIR__ . '/..' . '/symfony/console/Logger/ConsoleLogger.php', - 'Symfony\\Component\\Console\\Output\\BufferedOutput' => __DIR__ . '/..' . '/symfony/console/Output/BufferedOutput.php', - 'Symfony\\Component\\Console\\Output\\ConsoleOutput' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleOutput.php', - 'Symfony\\Component\\Console\\Output\\ConsoleOutputInterface' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleOutputInterface.php', - 'Symfony\\Component\\Console\\Output\\ConsoleSectionOutput' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleSectionOutput.php', - 'Symfony\\Component\\Console\\Output\\NullOutput' => __DIR__ . '/..' . '/symfony/console/Output/NullOutput.php', - 'Symfony\\Component\\Console\\Output\\Output' => __DIR__ . '/..' . '/symfony/console/Output/Output.php', - 'Symfony\\Component\\Console\\Output\\OutputInterface' => __DIR__ . '/..' . '/symfony/console/Output/OutputInterface.php', - 'Symfony\\Component\\Console\\Output\\StreamOutput' => __DIR__ . '/..' . '/symfony/console/Output/StreamOutput.php', - 'Symfony\\Component\\Console\\Output\\TrimmedBufferOutput' => __DIR__ . '/..' . '/symfony/console/Output/TrimmedBufferOutput.php', - 'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ChoiceQuestion.php', - 'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ConfirmationQuestion.php', - 'Symfony\\Component\\Console\\Question\\Question' => __DIR__ . '/..' . '/symfony/console/Question/Question.php', - 'Symfony\\Component\\Console\\SignalRegistry\\SignalRegistry' => __DIR__ . '/..' . '/symfony/console/SignalRegistry/SignalRegistry.php', - 'Symfony\\Component\\Console\\SingleCommandApplication' => __DIR__ . '/..' . '/symfony/console/SingleCommandApplication.php', - 'Symfony\\Component\\Console\\Style\\OutputStyle' => __DIR__ . '/..' . '/symfony/console/Style/OutputStyle.php', - 'Symfony\\Component\\Console\\Style\\StyleInterface' => __DIR__ . '/..' . '/symfony/console/Style/StyleInterface.php', - 'Symfony\\Component\\Console\\Style\\SymfonyStyle' => __DIR__ . '/..' . '/symfony/console/Style/SymfonyStyle.php', - 'Symfony\\Component\\Console\\Terminal' => __DIR__ . '/..' . '/symfony/console/Terminal.php', - 'Symfony\\Component\\Console\\Tester\\ApplicationTester' => __DIR__ . '/..' . '/symfony/console/Tester/ApplicationTester.php', - 'Symfony\\Component\\Console\\Tester\\CommandCompletionTester' => __DIR__ . '/..' . '/symfony/console/Tester/CommandCompletionTester.php', - 'Symfony\\Component\\Console\\Tester\\CommandTester' => __DIR__ . '/..' . '/symfony/console/Tester/CommandTester.php', - 'Symfony\\Component\\Console\\Tester\\Constraint\\CommandIsSuccessful' => __DIR__ . '/..' . '/symfony/console/Tester/Constraint/CommandIsSuccessful.php', - 'Symfony\\Component\\Console\\Tester\\TesterTrait' => __DIR__ . '/..' . '/symfony/console/Tester/TesterTrait.php', - 'Symfony\\Component\\Finder\\Comparator\\Comparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/Comparator.php', - 'Symfony\\Component\\Finder\\Comparator\\DateComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/DateComparator.php', - 'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/NumberComparator.php', - 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => __DIR__ . '/..' . '/symfony/finder/Exception/AccessDeniedException.php', - 'Symfony\\Component\\Finder\\Exception\\DirectoryNotFoundException' => __DIR__ . '/..' . '/symfony/finder/Exception/DirectoryNotFoundException.php', - 'Symfony\\Component\\Finder\\Finder' => __DIR__ . '/..' . '/symfony/finder/Finder.php', - 'Symfony\\Component\\Finder\\Gitignore' => __DIR__ . '/..' . '/symfony/finder/Gitignore.php', - 'Symfony\\Component\\Finder\\Glob' => __DIR__ . '/..' . '/symfony/finder/Glob.php', - 'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/CustomFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/DateRangeFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\DepthRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/DepthRangeFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FileTypeFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilecontentFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilenameFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\LazyIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/LazyIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/MultiplePcreFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\PathFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/PathFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\SizeRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/SizeRangeFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\SortableIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/SortableIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\VcsIgnoredFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/VcsIgnoredFilterIterator.php', - 'Symfony\\Component\\Finder\\SplFileInfo' => __DIR__ . '/..' . '/symfony/finder/SplFileInfo.php', - 'Symfony\\Component\\String\\AbstractString' => __DIR__ . '/..' . '/symfony/string/AbstractString.php', - 'Symfony\\Component\\String\\AbstractUnicodeString' => __DIR__ . '/..' . '/symfony/string/AbstractUnicodeString.php', - 'Symfony\\Component\\String\\ByteString' => __DIR__ . '/..' . '/symfony/string/ByteString.php', - 'Symfony\\Component\\String\\CodePointString' => __DIR__ . '/..' . '/symfony/string/CodePointString.php', - 'Symfony\\Component\\String\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/string/Exception/ExceptionInterface.php', - 'Symfony\\Component\\String\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/string/Exception/InvalidArgumentException.php', - 'Symfony\\Component\\String\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/string/Exception/RuntimeException.php', - 'Symfony\\Component\\String\\Inflector\\EnglishInflector' => __DIR__ . '/..' . '/symfony/string/Inflector/EnglishInflector.php', - 'Symfony\\Component\\String\\Inflector\\FrenchInflector' => __DIR__ . '/..' . '/symfony/string/Inflector/FrenchInflector.php', - 'Symfony\\Component\\String\\Inflector\\InflectorInterface' => __DIR__ . '/..' . '/symfony/string/Inflector/InflectorInterface.php', - 'Symfony\\Component\\String\\LazyString' => __DIR__ . '/..' . '/symfony/string/LazyString.php', - 'Symfony\\Component\\String\\Slugger\\AsciiSlugger' => __DIR__ . '/..' . '/symfony/string/Slugger/AsciiSlugger.php', - 'Symfony\\Component\\String\\Slugger\\SluggerInterface' => __DIR__ . '/..' . '/symfony/string/Slugger/SluggerInterface.php', - 'Symfony\\Component\\String\\UnicodeString' => __DIR__ . '/..' . '/symfony/string/UnicodeString.php', - 'Symfony\\Contracts\\Service\\Attribute\\Required' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/Required.php', - 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/SubscribedService.php', - 'Symfony\\Contracts\\Service\\ResetInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ResetInterface.php', - 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceLocatorTrait.php', - 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceProviderInterface.php', - 'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberInterface.php', - 'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberTrait.php', - 'Symfony\\Contracts\\Service\\Test\\ServiceLocatorTest' => __DIR__ . '/..' . '/symfony/service-contracts/Test/ServiceLocatorTest.php', - 'Symfony\\Polyfill\\Ctype\\Ctype' => __DIR__ . '/..' . '/symfony/polyfill-ctype/Ctype.php', - 'Symfony\\Polyfill\\Intl\\Grapheme\\Grapheme' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/Grapheme.php', - 'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Normalizer.php', - 'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php', - 'Symfony\\Polyfill\\Php73\\Php73' => __DIR__ . '/..' . '/symfony/polyfill-php73/Php73.php', - 'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php', - 'Symfony\\Polyfill\\Php80\\PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/PhpToken.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - 'WooCommerceSerialNumbers\\API' => __DIR__ . '/../..' . '/src/API.php', - 'WooCommerceSerialNumbers\\Actions' => __DIR__ . '/../..' . '/src/Actions.php', - 'WooCommerceSerialNumbers\\Admin\\Actions' => __DIR__ . '/../..' . '/src/Admin/Actions.php', - 'WooCommerceSerialNumbers\\Admin\\Admin' => __DIR__ . '/../..' . '/src/Admin/Admin.php', - 'WooCommerceSerialNumbers\\Admin\\ListTables\\ActivationsTable' => __DIR__ . '/../..' . '/src/Admin/ListTables/ActivationsTable.php', - 'WooCommerceSerialNumbers\\Admin\\ListTables\\KeysTable' => __DIR__ . '/../..' . '/src/Admin/ListTables/KeysTable.php', - 'WooCommerceSerialNumbers\\Admin\\ListTables\\ListTable' => __DIR__ . '/../..' . '/src/Admin/ListTables/ListTable.php', - 'WooCommerceSerialNumbers\\Admin\\ListTables\\StockTable' => __DIR__ . '/../..' . '/src/Admin/ListTables/StockTable.php', - 'WooCommerceSerialNumbers\\Admin\\Menus' => __DIR__ . '/../..' . '/src/Admin/Menus.php', - 'WooCommerceSerialNumbers\\Admin\\Metaboxes' => __DIR__ . '/../..' . '/src/Admin/Metaboxes.php', - 'WooCommerceSerialNumbers\\Admin\\Notices' => __DIR__ . '/../..' . '/src/Admin/Notices.php', - 'WooCommerceSerialNumbers\\Admin\\Orders' => __DIR__ . '/../..' . '/src/Admin/Orders.php', - 'WooCommerceSerialNumbers\\Admin\\Products' => __DIR__ . '/../..' . '/src/Admin/Products.php', - 'WooCommerceSerialNumbers\\Admin\\Settings' => __DIR__ . '/../..' . '/src/Admin/Settings.php', - 'WooCommerceSerialNumbers\\Ajax' => __DIR__ . '/../..' . '/src/Ajax.php', - 'WooCommerceSerialNumbers\\Cache' => __DIR__ . '/../..' . '/src/Cache.php', - 'WooCommerceSerialNumbers\\Compat' => __DIR__ . '/../..' . '/src/Compat.php', - 'WooCommerceSerialNumbers\\Cron' => __DIR__ . '/../..' . '/src/Cron.php', - 'WooCommerceSerialNumbers\\Encryption' => __DIR__ . '/../..' . '/src/Encryption.php', - 'WooCommerceSerialNumbers\\Frontend\\Frontend' => __DIR__ . '/../..' . '/src/Frontend/Frontend.php', - 'WooCommerceSerialNumbers\\Frontend\\Shortcodes' => __DIR__ . '/../..' . '/src/Frontend/Shortcodes.php', - 'WooCommerceSerialNumbers\\Installer' => __DIR__ . '/../..' . '/src/Installer.php', - 'WooCommerceSerialNumbers\\Lib\\Container' => __DIR__ . '/../..' . '/lib/Lib/Container.php', - 'WooCommerceSerialNumbers\\Lib\\Model' => __DIR__ . '/../..' . '/lib/Lib/Model.php', - 'WooCommerceSerialNumbers\\Lib\\Plugin' => __DIR__ . '/../..' . '/lib/Lib/Plugin.php', - 'WooCommerceSerialNumbers\\Lib\\PluginInterface' => __DIR__ . '/../..' . '/lib/Lib/PluginInterface.php', - 'WooCommerceSerialNumbers\\Lib\\Settings' => __DIR__ . '/../..' . '/lib/Lib/Settings.php', - 'WooCommerceSerialNumbers\\Models\\Activation' => __DIR__ . '/../..' . '/src/Models/Activation.php', - 'WooCommerceSerialNumbers\\Models\\Key' => __DIR__ . '/../..' . '/src/Models/Key.php', - 'WooCommerceSerialNumbers\\Models\\Model' => __DIR__ . '/../..' . '/src/Models/Model.php', - 'WooCommerceSerialNumbers\\Orders' => __DIR__ . '/../..' . '/src/Orders.php', - 'WooCommerceSerialNumbers\\Plugin' => __DIR__ . '/../..' . '/src/Plugin.php', - 'WooCommerceSerialNumbers\\RestAPI' => __DIR__ . '/../..' . '/src/RestAPI.php', - 'WooCommerceSerialNumbers\\Stocks' => __DIR__ . '/../..' . '/src/Stocks.php', - 'WooCommerceSerialNumbers\\Utilities\\Utilities' => __DIR__ . '/../..' . '/src/Utilities/Utilities.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit1708bb6e2309c5b3f2b0c1d7ea103daf::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit1708bb6e2309c5b3f2b0c1d7ea103daf::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit1708bb6e2309c5b3f2b0c1d7ea103daf::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/trunk/vendor/composer/installed.json b/trunk/vendor/composer/installed.json deleted file mode 100644 index cf3fd131..00000000 --- a/trunk/vendor/composer/installed.json +++ /dev/null @@ -1,2036 +0,0 @@ -{ - "packages": [ - { - "name": "byteever/byteever-sniffs", - "version": "v1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/byteever/byteever-sniffs.git", - "reference": "7a62a7c8aa62fcc67a0d19ed0af2df05b103042d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/byteever/byteever-sniffs/zipball/7a62a7c8aa62fcc67a0d19ed0af2df05b103042d", - "reference": "7a62a7c8aa62fcc67a0d19ed0af2df05b103042d", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", - "phpcompatibility/phpcompatibility-wp": "^2.1", - "wp-coding-standards/wpcs": "^3.1" - }, - "require-dev": { - "roave/security-advisories": "dev-latest" - }, - "time": "2024-06-28T06:59:58+00:00", - "type": "phpcodesniffer-standard", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-only" - ], - "authors": [ - { - "name": "Sultan Nasir Uddin", - "email": "sultan@byteever.com" - } - ], - "description": "ByteEver PHP Coding Standards", - "keywords": [ - "byteever", - "phpcs", - "standards", - "wordpress" - ], - "support": { - "issues": "https://github.com/byteever/byteever-sniffs/issues", - "source": "https://github.com/byteever/byteever-sniffs/tree/v1.0.2" - }, - "install-path": "../byteever/byteever-sniffs" - }, - { - "name": "coenjacobs/mozart", - "version": "0.7.1", - "version_normalized": "0.7.1.0", - "source": { - "type": "git", - "url": "https://github.com/coenjacobs/mozart.git", - "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/dbcdeb992d20d9c8914eef090f9a0d684bb1102c", - "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c", - "shasum": "" - }, - "require": { - "league/flysystem": "^1.0", - "php": "^7.3|^8.0", - "symfony/console": "^4|^5", - "symfony/finder": "^4|^5" - }, - "require-dev": { - "mheap/phpunit-github-actions-printer": "^1.4", - "phpunit/phpunit": "^8.5", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" - }, - "time": "2021-02-02T21:37:03+00:00", - "bin": [ - "bin/mozart" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "CoenJacobs\\Mozart\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Coen Jacobs", - "email": "coenjacobs@gmail.com" - } - ], - "description": "Composes all dependencies as a package inside a WordPress plugin", - "support": { - "issues": "https://github.com/coenjacobs/mozart/issues", - "source": "https://github.com/coenjacobs/mozart/tree/0.7.1" - }, - "funding": [ - { - "url": "https://github.com/coenjacobs", - "type": "github" - } - ], - "install-path": "../coenjacobs/mozart" - }, - { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", - "version_normalized": "0.7.2.0", - "source": { - "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" - }, - "require-dev": { - "composer/composer": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" - }, - "time": "2022-02-04T12:51:07+00:00", - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - }, - { - "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "install-path": "../dealerdirect/phpcodesniffer-composer-installer" - }, - { - "name": "league/flysystem", - "version": "1.1.10", - "version_normalized": "1.1.10.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "time": "2022-10-04T09:16:37+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "support": { - "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" - }, - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "install-path": "../league/flysystem" - }, - { - "name": "league/mime-type-detection", - "version": "1.15.0", - "version_normalized": "1.15.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", - "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.2", - "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" - }, - "time": "2024-01-28T23:22:08+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "description": "Mime-type detection for Flysystem", - "support": { - "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" - }, - "funding": [ - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], - "install-path": "../league/mime-type-detection" - }, - { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", - "version_normalized": "9.3.5.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "time": "2019-12-27T09:44:58+00:00", - "type": "phpcodesniffer-standard", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, - "install-path": "../phpcompatibility/php-compatibility" - }, - { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.3", - "version_normalized": "1.3.3.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "time": "2024-04-24T21:30:46+00:00", - "type": "phpcodesniffer-standard", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "paragonie", - "phpcs", - "polyfill", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" - }, - "funding": [ - { - "url": "https://github.com/PHPCompatibility", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", - "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - } - ], - "install-path": "../phpcompatibility/phpcompatibility-paragonie" - }, - { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.5", - "version_normalized": "2.1.5.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "time": "2024-04-24T21:37:59+00:00", - "type": "phpcodesniffer-standard", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "phpcs", - "standards", - "static analysis", - "wordpress" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" - }, - "funding": [ - { - "url": "https://github.com/PHPCompatibility", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", - "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - } - ], - "install-path": "../phpcompatibility/phpcompatibility-wp" - }, - { - "name": "phpcsstandards/phpcsextra", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", - "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "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 || ^8.0 || ^9.0" - }, - "time": "2023-12-08T16:49:07+00:00", - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" - } - }, - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" - } - ], - "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", - "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", - "phpcs", - "standards", - "static analysis" - ], - "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.12", - "version_normalized": "1.0.12.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", - "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", - "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.10.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.1.0 || ^2.0.0" - }, - "time": "2024-05-20T13:34:27+00:00", - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "PHPCSUtils/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" - } - ], - "description": "A suite of utility functions for use with PHP_CodeSniffer", - "homepage": "https://phpcsutils.com/", - "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", - "phpcs", - "phpcs3", - "standards", - "static analysis", - "tokens", - "utility" - ], - "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": "pluginever/framework-model", - "version": "dev-master", - "version_normalized": "dev-master", - "source": { - "type": "git", - "url": "git@github.com:pluginever/framework-model.git", - "reference": "df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pluginever/framework-model/zipball/df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e", - "reference": "df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "byteever/byteever-sniffs": "dev-master" - }, - "time": "2024-03-10T05:53:38+00:00", - "default-branch": true, - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Lib\\": "src" - } - }, - "scripts": { - "phpcs": [ - "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" - ], - "phpcbf": [ - "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" - ] - }, - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Sultan Nasir Uddin", - "email": "manikdrmc@gmail.com" - } - ], - "description": "Model for the framework", - "support": { - "source": "https://github.com/pluginever/framework-model/tree/v1.0.9", - "issues": "https://github.com/pluginever/framework-model/issues" - }, - "install-path": "../pluginever/framework-model" - }, - { - "name": "pluginever/framework-plugin", - "version": "dev-master", - "version_normalized": "dev-master", - "source": { - "type": "git", - "url": "git@github.com:pluginever/framework-plugin.git", - "reference": "dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pluginever/framework-plugin/zipball/dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0", - "reference": "dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "byteever/byteever-sniffs": "dev-master" - }, - "time": "2023-10-25T08:44:40+00:00", - "default-branch": true, - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Lib\\": "src" - } - }, - "scripts": { - "phpcs": [ - "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" - ], - "phpcbf": [ - "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" - ] - }, - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Sultan Nasir Uddin", - "email": "manikdrmc@gmail.com" - } - ], - "description": "A set of related classes to kick start WordPress plugin development.", - "support": { - "source": "https://github.com/pluginever/framework-plugin/tree/v1.0.8", - "issues": "https://github.com/pluginever/framework-plugin/issues" - }, - "install-path": "../pluginever/framework-plugin" - }, - { - "name": "pluginever/framework-settings", - "version": "dev-master", - "version_normalized": "dev-master", - "source": { - "type": "git", - "url": "git@github.com:pluginever/framework-settings.git", - "reference": "5a1718ada466a9e58a55827d77257ad237c9f0bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pluginever/framework-settings/zipball/5a1718ada466a9e58a55827d77257ad237c9f0bd", - "reference": "5a1718ada466a9e58a55827d77257ad237c9f0bd", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "byteever/byteever-sniffs": "dev-master" - }, - "time": "2024-02-27T06:05:22+00:00", - "default-branch": true, - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Lib\\": "src" - } - }, - "scripts": { - "phpcs": [ - "@php ./vendor/bin/phpcs --standard=phpcs.xml -s -v" - ], - "phpcbf": [ - "@php ./vendor/bin/phpcbf --standard=phpcs.xml -v" - ] - }, - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Sultan Nasir Uddin", - "email": "manikdrmc@gmail.com" - } - ], - "description": "A set of related classes to kick start WordPress plugin development.", - "support": { - "source": "https://github.com/pluginever/framework-settings/tree/v1.0.7", - "issues": "https://github.com/pluginever/framework-settings/issues" - }, - "install-path": "../pluginever/framework-settings" - }, - { - "name": "psr/container", - "version": "2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "time": "2021-11-05T16:47:00+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "install-path": "../psr/container" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.10.2", - "version_normalized": "3.10.2.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" - }, - "time": "2024-07-21T23:26:44+00:00", - "bin": [ - "bin/phpcbf", - "bin/phpcs" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "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/PHPCSStandards/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], - "support": { - "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" - }, - { - "name": "symfony/console", - "version": "v5.4.42", - "version_normalized": "5.4.42.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "time": "2024-07-26T12:21:55+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v5.4.42" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/console" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "time": "2022-01-02T09:55:41+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, - { - "name": "symfony/finder", - "version": "v5.4.42", - "version_normalized": "5.4.42.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "0724c51fa067b198e36506d2864e09a52180998a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", - "reference": "0724c51fa067b198e36506d2864e09a52180998a", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "time": "2024-07-22T08:53:29+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.42" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/finder" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.30.0", - "version_normalized": "1.30.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2024-05-31T15:07:36+00:00", - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-ctype" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.30.0", - "version_normalized": "1.30.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2024-05-31T15:07:36+00:00", - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-grapheme" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.30.0", - "version_normalized": "1.30.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2024-05-31T15:07:36+00:00", - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-normalizer" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.30.0", - "version_normalized": "1.30.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2024-06-19T12:30:46+00:00", - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-mbstring" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.30.0", - "version_normalized": "1.30.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2024-05-31T15:07:36+00:00", - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php73" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.30.0", - "version_normalized": "1.30.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2024-05-31T15:07:36+00:00", - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php80" - }, - { - "name": "symfony/service-contracts", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66", - "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "time": "2022-05-30T19:17:58+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.0.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/service-contracts" - }, - { - "name": "symfony/string", - "version": "v6.0.19", - "version_normalized": "6.0.19.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.0" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "time": "2023-01-01T08:36:10+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v6.0.19" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/string" - }, - { - "name": "wp-coding-standards/wpcs", - "version": "3.1.0", - "version_normalized": "3.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", - "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "ext-libxml": "*", - "ext-tokenizer": "*", - "ext-xmlreader": "*", - "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.2.1", - "phpcsstandards/phpcsutils": "^1.0.10", - "squizlabs/php_codesniffer": "^3.9.0" - }, - "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" - }, - "suggest": { - "ext-iconv": "For improved results", - "ext-mbstring": "For improved results" - }, - "time": "2024-03-25T16:39:00+00:00", - "type": "phpcodesniffer-standard", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Contributors", - "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", - "keywords": [ - "phpcs", - "standards", - "static analysis", - "wordpress" - ], - "support": { - "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", - "source": "https://github.com/WordPress/WordPress-Coding-Standards", - "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" - }, - "funding": [ - { - "url": "https://opencollective.com/php_codesniffer", - "type": "custom" - } - ], - "install-path": "../wp-coding-standards/wpcs" - } - ], - "dev": true, - "dev-package-names": [ - "byteever/byteever-sniffs", - "coenjacobs/mozart", - "dealerdirect/phpcodesniffer-composer-installer", - "league/flysystem", - "league/mime-type-detection", - "phpcompatibility/php-compatibility", - "phpcompatibility/phpcompatibility-paragonie", - "phpcompatibility/phpcompatibility-wp", - "phpcsstandards/phpcsextra", - "phpcsstandards/phpcsutils", - "pluginever/framework-model", - "pluginever/framework-plugin", - "pluginever/framework-settings", - "psr/container", - "squizlabs/php_codesniffer", - "symfony/console", - "symfony/deprecation-contracts", - "symfony/finder", - "symfony/polyfill-ctype", - "symfony/polyfill-intl-grapheme", - "symfony/polyfill-intl-normalizer", - "symfony/polyfill-mbstring", - "symfony/polyfill-php73", - "symfony/polyfill-php80", - "symfony/service-contracts", - "symfony/string", - "wp-coding-standards/wpcs" - ] -} diff --git a/trunk/vendor/composer/installed.php b/trunk/vendor/composer/installed.php deleted file mode 100644 index 8d86c747..00000000 --- a/trunk/vendor/composer/installed.php +++ /dev/null @@ -1,278 +0,0 @@ - array( - 'name' => 'pluginever/wc-serial-numbers', - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'reference' => 'da424e6c693e67e72637453ce6b98e48516884ae', - 'type' => 'wordpress-plugin', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev' => true, - ), - 'versions' => array( - 'byteever/byteever-sniffs' => array( - 'pretty_version' => 'v1.0.2', - 'version' => '1.0.2.0', - 'reference' => '7a62a7c8aa62fcc67a0d19ed0af2df05b103042d', - 'type' => 'phpcodesniffer-standard', - 'install_path' => __DIR__ . '/../byteever/byteever-sniffs', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'coenjacobs/mozart' => array( - 'pretty_version' => '0.7.1', - 'version' => '0.7.1.0', - 'reference' => 'dbcdeb992d20d9c8914eef090f9a0d684bb1102c', - 'type' => 'library', - 'install_path' => __DIR__ . '/../coenjacobs/mozart', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'dealerdirect/phpcodesniffer-composer-installer' => array( - 'pretty_version' => 'v0.7.2', - 'version' => '0.7.2.0', - 'reference' => '1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db', - 'type' => 'composer-plugin', - 'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'league/flysystem' => array( - 'pretty_version' => '1.1.10', - 'version' => '1.1.10.0', - 'reference' => '3239285c825c152bcc315fe0e87d6b55f5972ed1', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/flysystem', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'league/mime-type-detection' => array( - 'pretty_version' => '1.15.0', - 'version' => '1.15.0.0', - 'reference' => 'ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/mime-type-detection', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpcompatibility/php-compatibility' => array( - 'pretty_version' => '9.3.5', - 'version' => '9.3.5.0', - 'reference' => '9fb324479acf6f39452e0655d2429cc0d3914243', - 'type' => 'phpcodesniffer-standard', - 'install_path' => __DIR__ . '/../phpcompatibility/php-compatibility', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpcompatibility/phpcompatibility-paragonie' => array( - 'pretty_version' => '1.3.3', - 'version' => '1.3.3.0', - 'reference' => '293975b465e0e709b571cbf0c957c6c0a7b9a2ac', - 'type' => 'phpcodesniffer-standard', - 'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-paragonie', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpcompatibility/phpcompatibility-wp' => array( - 'pretty_version' => '2.1.5', - 'version' => '2.1.5.0', - 'reference' => '01c1ff2704a58e46f0cb1ca9d06aee07b3589082', - 'type' => 'phpcodesniffer-standard', - 'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-wp', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpcsstandards/phpcsextra' => array( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'reference' => '11d387c6642b6e4acaf0bd9bf5203b8cca1ec489', - 'type' => 'phpcodesniffer-standard', - 'install_path' => __DIR__ . '/../phpcsstandards/phpcsextra', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'phpcsstandards/phpcsutils' => array( - 'pretty_version' => '1.0.12', - 'version' => '1.0.12.0', - 'reference' => '87b233b00daf83fb70f40c9a28692be017ea7c6c', - 'type' => 'phpcodesniffer-standard', - 'install_path' => __DIR__ . '/../phpcsstandards/phpcsutils', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'pluginever/framework-model' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'reference' => 'df8eb4363fd1e09ae7eae3b58d1e0e1c8c6b674e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../pluginever/framework-model', - 'aliases' => array( - 0 => '9999999-dev', - ), - 'dev_requirement' => true, - ), - 'pluginever/framework-plugin' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'reference' => 'dd76127abd4a0c6dd8253fe6b885a807dfe8e4e0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../pluginever/framework-plugin', - 'aliases' => array( - 0 => '9999999-dev', - ), - 'dev_requirement' => true, - ), - 'pluginever/framework-settings' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'reference' => '5a1718ada466a9e58a55827d77257ad237c9f0bd', - 'type' => 'library', - 'install_path' => __DIR__ . '/../pluginever/framework-settings', - 'aliases' => array( - 0 => '9999999-dev', - ), - 'dev_requirement' => true, - ), - 'pluginever/wc-serial-numbers' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'reference' => 'da424e6c693e67e72637453ce6b98e48516884ae', - 'type' => 'wordpress-plugin', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'psr/container' => array( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', - 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/container', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'psr/log-implementation' => array( - 'dev_requirement' => true, - 'provided' => array( - 0 => '1.0|2.0', - ), - ), - 'squizlabs/php_codesniffer' => array( - 'pretty_version' => '3.10.2', - 'version' => '3.10.2.0', - 'reference' => '86e5f5dd9a840c46810ebe5ff1885581c42a3017', - 'type' => 'library', - 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/console' => array( - 'pretty_version' => 'v5.4.42', - 'version' => '5.4.42.0', - 'reference' => 'cef62396a0477e94fc52e87a17c6e5c32e226b7f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/console', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.0.2', - 'version' => '3.0.2.0', - 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/finder' => array( - 'pretty_version' => 'v5.4.42', - 'version' => '5.4.42.0', - 'reference' => '0724c51fa067b198e36506d2864e09a52180998a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/finder', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.30.0', - 'version' => '1.30.0.0', - 'reference' => '0424dff1c58f028c451efff2045f5d92410bd540', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.30.0', - 'version' => '1.30.0.0', - 'reference' => '64647a7c30b2283f5d49b874d84a18fc22054b7a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.30.0', - 'version' => '1.30.0.0', - 'reference' => 'a95281b0be0d9ab48050ebd988b967875cdb9fdb', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.30.0', - 'version' => '1.30.0.0', - 'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-php73' => array( - 'pretty_version' => 'v1.30.0', - 'version' => '1.30.0.0', - 'reference' => 'ec444d3f3f6505bb28d11afa41e75faadebc10a1', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php73', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.30.0', - 'version' => '1.30.0.0', - 'reference' => '77fa7995ac1b21ab60769b7323d600a991a90433', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.0.2', - 'version' => '3.0.2.0', - 'reference' => 'd78d39c1599bd1188b8e26bb341da52c3c6d8a66', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/service-contracts', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/string' => array( - 'pretty_version' => 'v6.0.19', - 'version' => '6.0.19.0', - 'reference' => 'd9e72497367c23e08bf94176d2be45b00a9d232a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/string', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'wp-coding-standards/wpcs' => array( - 'pretty_version' => '3.1.0', - 'version' => '3.1.0.0', - 'reference' => '9333efcbff231f10dfd9c56bb7b65818b4733ca7', - 'type' => 'phpcodesniffer-standard', - 'install_path' => __DIR__ . '/../wp-coding-standards/wpcs', - 'aliases' => array(), - 'dev_requirement' => true, - ), - ), -); diff --git a/trunk/vendor/composer/platform_check.php b/trunk/vendor/composer/platform_check.php deleted file mode 100644 index 580fa960..00000000 --- a/trunk/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 70400)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/CODE_OF_CONDUCT.md b/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/CODE_OF_CONDUCT.md deleted file mode 100644 index a408703d..00000000 --- a/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,129 +0,0 @@ - -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md b/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md deleted file mode 100644 index 893aafb7..00000000 --- a/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016-2022 Dealerdirect B.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php b/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php deleted file mode 100644 index 75653e49..00000000 --- a/trunk/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php +++ /dev/null @@ -1,621 +0,0 @@ - - */ -class Plugin implements PluginInterface, EventSubscriberInterface -{ - const KEY_MAX_DEPTH = 'phpcodesniffer-search-depth'; - - const MESSAGE_ERROR_WRONG_MAX_DEPTH = - 'The value of "%s" (in the composer.json "extra".section) must be an integer larger then %d, %s given.'; - - const MESSAGE_NOT_INSTALLED = 'PHPCodeSniffer is not installed'; - const MESSAGE_NOTHING_TO_INSTALL = 'Nothing to install or update'; - const MESSAGE_PLUGIN_UNINSTALLED = 'PHPCodeSniffer Composer Installer is uninstalled'; - const MESSAGE_RUNNING_INSTALLER = 'Running PHPCodeSniffer Composer Installer'; - - const PACKAGE_NAME = 'squizlabs/php_codesniffer'; - const PACKAGE_TYPE = 'phpcodesniffer-standard'; - - const PHPCS_CONFIG_REGEX = '`%s:[^\r\n]+`'; - const PHPCS_CONFIG_KEY = 'installed_paths'; - - const PLUGIN_NAME = 'dealerdirect/phpcodesniffer-composer-installer'; - - /** - * @var Composer - */ - private $composer; - - /** - * @var string - */ - private $cwd; - - /** - * @var Filesystem - */ - private $filesystem; - - /** - * @var array - */ - private $installedPaths; - - /** - * @var IOInterface - */ - private $io; - - /** - * @var ProcessExecutor - */ - private $processExecutor; - - /** - * Triggers the plugin's main functionality. - * - * Makes it possible to run the plugin as a custom command. - * - * @param Event $event - * - * @throws \InvalidArgumentException - * @throws \RuntimeException - * @throws LogicException - * @throws ProcessFailedException - * @throws RuntimeException - */ - public static function run(Event $event) - { - $io = $event->getIO(); - $composer = $event->getComposer(); - - $instance = new static(); - - $instance->io = $io; - $instance->composer = $composer; - $instance->init(); - $instance->onDependenciesChangedEvent(); - } - - /** - * {@inheritDoc} - * - * @throws \RuntimeException - * @throws LogicException - * @throws ProcessFailedException - * @throws RuntimeException - */ - public function activate(Composer $composer, IOInterface $io) - { - $this->composer = $composer; - $this->io = $io; - - $this->init(); - } - - /** - * {@inheritDoc} - */ - public function deactivate(Composer $composer, IOInterface $io) - { - } - - /** - * {@inheritDoc} - */ - public function uninstall(Composer $composer, IOInterface $io) - { - } - - /** - * Prepares the plugin so it's main functionality can be run. - * - * @throws \RuntimeException - * @throws LogicException - * @throws ProcessFailedException - * @throws RuntimeException - */ - private function init() - { - $this->cwd = getcwd(); - $this->installedPaths = array(); - - $this->processExecutor = new ProcessExecutor($this->io); - $this->filesystem = new Filesystem($this->processExecutor); - } - - /** - * {@inheritDoc} - */ - public static function getSubscribedEvents() - { - return array( - ScriptEvents::POST_INSTALL_CMD => array( - array('onDependenciesChangedEvent', 0), - ), - ScriptEvents::POST_UPDATE_CMD => array( - array('onDependenciesChangedEvent', 0), - ), - ); - } - - /** - * Entry point for post install and post update events. - * - * @throws \InvalidArgumentException - * @throws LogicException - * @throws ProcessFailedException - * @throws RuntimeException - */ - public function onDependenciesChangedEvent() - { - $io = $this->io; - $isVerbose = $io->isVerbose(); - $exitCode = 0; - - if ($isVerbose) { - $io->write(sprintf('%s', self::MESSAGE_RUNNING_INSTALLER)); - } - - if ($this->isPHPCodeSnifferInstalled() === true) { - $this->loadInstalledPaths(); - $installPathCleaned = $this->cleanInstalledPaths(); - $installPathUpdated = $this->updateInstalledPaths(); - - if ($installPathCleaned === true || $installPathUpdated === true) { - $exitCode = $this->saveInstalledPaths(); - } elseif ($isVerbose) { - $io->write(sprintf('%s', self::MESSAGE_NOTHING_TO_INSTALL)); - } - } else { - $pluginPackage = $this - ->composer - ->getRepositoryManager() - ->getLocalRepository() - ->findPackages(self::PLUGIN_NAME) - ; - - $isPluginUninstalled = count($pluginPackage) === 0; - - if ($isPluginUninstalled) { - if ($isVerbose) { - $io->write(sprintf('%s', self::MESSAGE_PLUGIN_UNINSTALLED)); - } - } else { - $exitCode = 1; - if ($isVerbose) { - $io->write(sprintf('%s', self::MESSAGE_NOT_INSTALLED)); - } - } - } - - return $exitCode; - } - - /** - * Load all paths from PHP_CodeSniffer into an array. - * - * @throws LogicException - * @throws ProcessFailedException - * @throws RuntimeException - */ - private function loadInstalledPaths() - { - if ($this->isPHPCodeSnifferInstalled() === true) { - $this->processExecutor->execute( - 'phpcs --config-show', - $output, - $this->composer->getConfig()->get('bin-dir') - ); - - $regex = sprintf(self::PHPCS_CONFIG_REGEX, self::PHPCS_CONFIG_KEY); - if (preg_match($regex, $output, $match) === 1) { - $phpcsInstalledPaths = str_replace(self::PHPCS_CONFIG_KEY . ': ', '', $match[0]); - $phpcsInstalledPaths = trim($phpcsInstalledPaths); - - if ($phpcsInstalledPaths !== '') { - $this->installedPaths = explode(',', $phpcsInstalledPaths); - } - } - } - } - - /** - * Save all coding standard paths back into PHP_CodeSniffer - * - * @throws LogicException - * @throws ProcessFailedException - * @throws RuntimeException - * - * @return int Exit code. 0 for success, 1 or higher for failure. - */ - private function saveInstalledPaths() - { - // Check if we found installed paths to set. - if (count($this->installedPaths) !== 0) { - sort($this->installedPaths); - $paths = implode(',', $this->installedPaths); - $arguments = array('--config-set', self::PHPCS_CONFIG_KEY, $paths); - $configMessage = sprintf( - 'PHP CodeSniffer Config %s set to %s', - self::PHPCS_CONFIG_KEY, - $paths - ); - } else { - // Delete the installed paths if none were found. - $arguments = array('--config-delete', self::PHPCS_CONFIG_KEY); - $configMessage = sprintf( - 'PHP CodeSniffer Config %s delete', - self::PHPCS_CONFIG_KEY - ); - } - - // Prepare message in case of failure - $failMessage = sprintf( - 'Failed to set PHP CodeSniffer %s Config', - self::PHPCS_CONFIG_KEY - ); - - // Determine the path to the main PHPCS file. - $phpcsPath = $this->getPHPCodeSnifferInstallPath(); - if (file_exists($phpcsPath . '/bin/phpcs') === true) { - // PHPCS 3.x. - $phpcsExecutable = './bin/phpcs'; - } else { - // PHPCS 2.x. - $phpcsExecutable = './scripts/phpcs'; - } - - // Okay, lets rock! - $command = vsprintf( - '%s %s %s', - array( - 'php executable' => $this->getPhpExecCommand(), - 'phpcs executable' => $phpcsExecutable, - 'arguments' => implode(' ', $arguments), - ) - ); - - $exitCode = $this->processExecutor->execute($command, $configResult, $phpcsPath); - if ($exitCode === 0) { - $exitCode = $this->verifySaveSuccess(); - } - - if ($exitCode === 0) { - $this->io->write($configMessage); - } else { - $this->io->write($failMessage); - } - - if ($this->io->isVerbose() && !empty($configResult)) { - $this->io->write(sprintf('%s', $configResult)); - } - - return $exitCode; - } - - /** - * Verify that the paths which were expected to be saved, have been. - * - * @return int Exit code. 0 for success, 1 for failure. - */ - private function verifySaveSuccess() - { - $exitCode = 1; - $expectedPaths = $this->installedPaths; - - // Request the currently set installed paths after the save. - $this->loadInstalledPaths(); - - $registeredPaths = array_intersect($this->installedPaths, $expectedPaths); - $registeredCount = count($registeredPaths); - $expectedCount = count($expectedPaths); - - if ($expectedCount === $registeredCount) { - $exitCode = 0; - } - - if ($exitCode === 1 && $this->io->isVerbose()) { - $verificationMessage = sprintf( - "Paths to external standards found by the plugin: %s\n" - . 'Actual paths registered with PHPCS: %s', - implode(', ', $expectedPaths), - implode(', ', $this->installedPaths) - ); - $this->io->write($verificationMessage); - } - - return $exitCode; - } - - /** - * Get the path to the current PHP version being used. - * - * Duplicate of the same in the EventDispatcher class in Composer itself. - */ - protected function getPhpExecCommand() - { - $finder = new PhpExecutableFinder(); - - $phpPath = $finder->find(false); - - if ($phpPath === false) { - throw new \RuntimeException('Failed to locate PHP binary to execute ' . $phpPath); - } - - $phpArgs = $finder->findArguments(); - $phpArgs = $phpArgs - ? ' ' . implode(' ', $phpArgs) - : '' - ; - - $command = ProcessExecutor::escape($phpPath) . - $phpArgs . - ' -d allow_url_fopen=' . ProcessExecutor::escape(ini_get('allow_url_fopen')) . - ' -d disable_functions=' . ProcessExecutor::escape(ini_get('disable_functions')) . - ' -d memory_limit=' . ProcessExecutor::escape(ini_get('memory_limit')) - ; - - return $command; - } - - /** - * Iterate trough all known paths and check if they are still valid. - * - * If path does not exists, is not an directory or isn't readable, the path - * is removed from the list. - * - * @return bool True if changes where made, false otherwise - */ - private function cleanInstalledPaths() - { - $changes = false; - foreach ($this->installedPaths as $key => $path) { - // This might be a relative path as well - $alternativePath = realpath($this->getPHPCodeSnifferInstallPath() . \DIRECTORY_SEPARATOR . $path); - - if ( - (is_dir($path) === false || is_readable($path) === false) && - ( - $alternativePath === false || - is_dir($alternativePath) === false || - is_readable($alternativePath) === false - ) - ) { - unset($this->installedPaths[$key]); - $changes = true; - } - } - return $changes; - } - - /** - * Check all installed packages (including the root package) against - * the installed paths from PHP_CodeSniffer and add the missing ones. - * - * @return bool True if changes where made, false otherwise - * - * @throws \InvalidArgumentException - * @throws \RuntimeException - */ - private function updateInstalledPaths() - { - $changes = false; - - $searchPaths = array($this->cwd); - $codingStandardPackages = $this->getPHPCodingStandardPackages(); - foreach ($codingStandardPackages as $package) { - $installPath = $this->composer->getInstallationManager()->getInstallPath($package); - if ($this->filesystem->isAbsolutePath($installPath) === false) { - $installPath = $this->filesystem->normalizePath( - $this->cwd . \DIRECTORY_SEPARATOR . $installPath - ); - } - $searchPaths[] = $installPath; - } - - $finder = new Finder(); - $finder->files() - ->depth('<= ' . $this->getMaxDepth()) - ->depth('>= ' . $this->getMinDepth()) - ->ignoreUnreadableDirs() - ->ignoreVCS(true) - ->in($searchPaths) - ->name('ruleset.xml'); - - // Process each found possible ruleset. - foreach ($finder as $ruleset) { - $standardsPath = $ruleset->getPath(); - - // Pick the directory above the directory containing the standard, unless this is the project root. - if ($standardsPath !== $this->cwd) { - $standardsPath = dirname($standardsPath); - } - - // Use relative paths for local project repositories. - if ($this->isRunningGlobally() === false) { - $standardsPath = $this->filesystem->findShortestPath( - $this->getPHPCodeSnifferInstallPath(), - $standardsPath, - true - ); - } - - // De-duplicate and add when directory is not configured. - if (in_array($standardsPath, $this->installedPaths, true) === false) { - $this->installedPaths[] = $standardsPath; - $changes = true; - } - } - - return $changes; - } - - /** - * Iterates through Composers' local repository looking for valid Coding - * Standard packages. - * - * If the package is the RootPackage (the one the plugin is installed into), - * the package is ignored for now since it needs a different install path logic. - * - * @return array Composer packages containing coding standard(s) - */ - private function getPHPCodingStandardPackages() - { - $codingStandardPackages = array_filter( - $this->composer->getRepositoryManager()->getLocalRepository()->getPackages(), - function (PackageInterface $package) { - if ($package instanceof AliasPackage) { - return false; - } - return $package->getType() === Plugin::PACKAGE_TYPE; - } - ); - - if ( - ! $this->composer->getPackage() instanceof RootPackageInterface - && $this->composer->getPackage()->getType() === self::PACKAGE_TYPE - ) { - $codingStandardPackages[] = $this->composer->getPackage(); - } - - return $codingStandardPackages; - } - - /** - * Searches for the installed PHP_CodeSniffer Composer package - * - * @param null|string|\Composer\Semver\Constraint\ConstraintInterface $versionConstraint to match against - * - * @return PackageInterface|null - */ - private function getPHPCodeSnifferPackage($versionConstraint = null) - { - $packages = $this - ->composer - ->getRepositoryManager() - ->getLocalRepository() - ->findPackages(self::PACKAGE_NAME, $versionConstraint); - - return array_shift($packages); - } - - /** - * Returns the path to the PHP_CodeSniffer package installation location - * - * @return string - */ - private function getPHPCodeSnifferInstallPath() - { - return $this->composer->getInstallationManager()->getInstallPath($this->getPHPCodeSnifferPackage()); - } - - /** - * Simple check if PHP_CodeSniffer is installed. - * - * @param null|string|\Composer\Semver\Constraint\ConstraintInterface $versionConstraint to match against - * - * @return bool Whether PHP_CodeSniffer is installed - */ - private function isPHPCodeSnifferInstalled($versionConstraint = null) - { - return ($this->getPHPCodeSnifferPackage($versionConstraint) !== null); - } - - /** - * Test if composer is running "global" - * This check kinda dirty, but it is the "Composer Way" - * - * @return bool Whether Composer is running "globally" - * - * @throws \RuntimeException - */ - private function isRunningGlobally() - { - return ($this->composer->getConfig()->get('home') === $this->cwd); - } - - /** - * Determines the maximum search depth when searching for Coding Standards. - * - * @return int - * - * @throws \InvalidArgumentException - */ - private function getMaxDepth() - { - $maxDepth = 3; - - $extra = $this->composer->getPackage()->getExtra(); - - if (array_key_exists(self::KEY_MAX_DEPTH, $extra)) { - $maxDepth = $extra[self::KEY_MAX_DEPTH]; - $minDepth = $this->getMinDepth(); - - if ( - (string) (int) $maxDepth !== (string) $maxDepth /* Must be an integer or cleanly castable to one */ - || $maxDepth <= $minDepth /* Larger than the minimum */ - || is_float($maxDepth) === true /* Within the boundaries of integer */ - ) { - $message = vsprintf( - self::MESSAGE_ERROR_WRONG_MAX_DEPTH, - array( - 'key' => self::KEY_MAX_DEPTH, - 'min' => $minDepth, - 'given' => var_export($maxDepth, true), - ) - ); - - throw new \InvalidArgumentException($message); - } - } - - return (int) $maxDepth; - } - - /** - * Returns the minimal search depth for Coding Standard packages. - * - * Usually this is 0, unless PHP_CodeSniffer >= 3 is used. - * - * @return int - */ - private function getMinDepth() - { - if ($this->isPHPCodeSnifferInstalled('>= 3.0.0') !== true) { - return 1; - } - return 0; - } -} diff --git a/trunk/vendor/league/flysystem/CODE_OF_CONDUCT.md b/trunk/vendor/league/flysystem/CODE_OF_CONDUCT.md deleted file mode 100644 index 89569c01..00000000 --- a/trunk/vendor/league/flysystem/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at info+flysystem@frankdejonge.nl. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/trunk/vendor/league/flysystem/LICENSE b/trunk/vendor/league/flysystem/LICENSE deleted file mode 100644 index f2684c84..00000000 --- a/trunk/vendor/league/flysystem/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2019 Frank de Jonge - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/league/flysystem/SECURITY.md b/trunk/vendor/league/flysystem/SECURITY.md deleted file mode 100644 index f5b205ed..00000000 --- a/trunk/vendor/league/flysystem/SECURITY.md +++ /dev/null @@ -1,16 +0,0 @@ -# Security Policy - -## Supported Versions - -| Version | Supported | -| ------- | ------------------ | -| 1.0.x | :white_check_mark: | -| 2.0.x | :x: | - -## Reporting a Vulnerability - -When you've encountered a security vulnerability, please disclose it securely. - -The security process is described at: -[https://flysystem.thephpleague.com/docs/security/](https://flysystem.thephpleague.com/docs/security/) - diff --git a/trunk/vendor/league/flysystem/deprecations.md b/trunk/vendor/league/flysystem/deprecations.md deleted file mode 100644 index c336a425..00000000 --- a/trunk/vendor/league/flysystem/deprecations.md +++ /dev/null @@ -1,19 +0,0 @@ -# Deprecations - -This document lists all the planned deprecations. - -## Handlers will be removed in 2.0 - -The `Handler` type and associated calls will be removed in version 2.0. - -### Upgrade path - -You should create your own implementation for handling OOP usage, -but it's recommended to move away from using an OOP-style wrapper entirely. - -The reason for this is that it's too easy for implementation details (for -your application this is Flysystem) to leak into the application. The most -important part for Flysystem is that it improves portability and creates a -solid boundary between your application core and the infrastructure you use. -The OOP-style handling breaks this principle, therefore I want to stop -promoting it. diff --git a/trunk/vendor/league/flysystem/src/Adapter/AbstractAdapter.php b/trunk/vendor/league/flysystem/src/Adapter/AbstractAdapter.php deleted file mode 100644 index a6a8ed02..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/AbstractAdapter.php +++ /dev/null @@ -1,72 +0,0 @@ -pathPrefix = null; - - return; - } - - $this->pathPrefix = rtrim($prefix, '\\/') . $this->pathSeparator; - } - - /** - * Get the path prefix. - * - * @return string|null path prefix or null if pathPrefix is empty - */ - public function getPathPrefix() - { - return $this->pathPrefix; - } - - /** - * Prefix a path. - * - * @param string $path - * - * @return string prefixed path - */ - public function applyPathPrefix($path) - { - return $this->getPathPrefix() . ltrim($path, '\\/'); - } - - /** - * Remove a path prefix. - * - * @param string $path - * - * @return string path without the prefix - */ - public function removePathPrefix($path) - { - return substr($path, strlen((string) $this->getPathPrefix())); - } -} diff --git a/trunk/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php b/trunk/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php deleted file mode 100644 index 25d949ea..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php +++ /dev/null @@ -1,705 +0,0 @@ -safeStorage = new SafeStorage(); - $this->setConfig($config); - } - - /** - * Set the config. - * - * @param array $config - * - * @return $this - */ - public function setConfig(array $config) - { - foreach ($this->configurable as $setting) { - if ( ! isset($config[$setting])) { - continue; - } - - $method = 'set' . ucfirst($setting); - - if (method_exists($this, $method)) { - $this->$method($config[$setting]); - } - } - - return $this; - } - - /** - * Returns the host. - * - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Set the host. - * - * @param string $host - * - * @return $this - */ - public function setHost($host) - { - $this->host = $host; - - return $this; - } - - /** - * Set the public permission value. - * - * @param int $permPublic - * - * @return $this - */ - public function setPermPublic($permPublic) - { - $this->permPublic = $permPublic; - - return $this; - } - - /** - * Set the private permission value. - * - * @param int $permPrivate - * - * @return $this - */ - public function setPermPrivate($permPrivate) - { - $this->permPrivate = $permPrivate; - - return $this; - } - - /** - * Returns the ftp port. - * - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Returns the root folder to work from. - * - * @return string - */ - public function getRoot() - { - return $this->root; - } - - /** - * Set the ftp port. - * - * @param int|string $port - * - * @return $this - */ - public function setPort($port) - { - $this->port = (int) $port; - - return $this; - } - - /** - * Set the root folder to work from. - * - * @param string $root - * - * @return $this - */ - public function setRoot($root) - { - $this->root = rtrim($root, '\\/') . $this->separator; - - return $this; - } - - /** - * Returns the ftp username. - * - * @return string username - */ - public function getUsername() - { - $username = $this->safeStorage->retrieveSafely('username'); - - return $username !== null ? $username : 'anonymous'; - } - - /** - * Set ftp username. - * - * @param string $username - * - * @return $this - */ - public function setUsername($username) - { - $this->safeStorage->storeSafely('username', $username); - - return $this; - } - - /** - * Returns the password. - * - * @return string password - */ - public function getPassword() - { - return $this->safeStorage->retrieveSafely('password'); - } - - /** - * Set the ftp password. - * - * @param string $password - * - * @return $this - */ - public function setPassword($password) - { - $this->safeStorage->storeSafely('password', $password); - - return $this; - } - - /** - * Returns the amount of seconds before the connection will timeout. - * - * @return int - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * Set the amount of seconds before the connection should timeout. - * - * @param int $timeout - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->timeout = (int) $timeout; - - return $this; - } - - /** - * Return the FTP system type. - * - * @return string - */ - public function getSystemType() - { - return $this->systemType; - } - - /** - * Set the FTP system type (windows or unix). - * - * @param string $systemType - * - * @return $this - */ - public function setSystemType($systemType) - { - $this->systemType = strtolower($systemType); - - return $this; - } - - /** - * True to enable timestamps for FTP servers that return unix-style listings. - * - * @param bool $bool - * - * @return $this - */ - public function setEnableTimestampsOnUnixListings($bool = false) - { - $this->enableTimestampsOnUnixListings = $bool; - - return $this; - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - return $this->listDirectoryContents($directory, $recursive); - } - - abstract protected function listDirectoryContents($directory, $recursive = false); - - /** - * Normalize a directory listing. - * - * @param array $listing - * @param string $prefix - * - * @return array directory listing - */ - protected function normalizeListing(array $listing, $prefix = '') - { - $base = $prefix; - $result = []; - $listing = $this->removeDotDirectories($listing); - - while ($item = array_shift($listing)) { - if (preg_match('#^.*:$#', $item)) { - $base = preg_replace('~^\./*|:$~', '', $item); - continue; - } - - $result[] = $this->normalizeObject($item, $base); - } - - return $this->sortListing($result); - } - - /** - * Sort a directory listing. - * - * @param array $result - * - * @return array sorted listing - */ - protected function sortListing(array $result) - { - $compare = function ($one, $two) { - return strnatcmp($one['path'], $two['path']); - }; - - usort($result, $compare); - - return $result; - } - - /** - * Normalize a file entry. - * - * @param string $item - * @param string $base - * - * @return array normalized file array - * - * @throws NotSupportedException - */ - protected function normalizeObject($item, $base) - { - $systemType = $this->systemType ?: $this->detectSystemType($item); - - if ($systemType === 'unix') { - return $this->normalizeUnixObject($item, $base); - } elseif ($systemType === 'windows') { - return $this->normalizeWindowsObject($item, $base); - } - - throw NotSupportedException::forFtpSystemType($systemType); - } - - /** - * Normalize a Unix file entry. - * - * Given $item contains: - * '-rw-r--r-- 1 ftp ftp 409 Aug 19 09:01 file1.txt' - * - * This function will return: - * [ - * 'type' => 'file', - * 'path' => 'file1.txt', - * 'visibility' => 'public', - * 'size' => 409, - * 'timestamp' => 1566205260 - * ] - * - * @param string $item - * @param string $base - * - * @return array normalized file array - */ - protected function normalizeUnixObject($item, $base) - { - $item = preg_replace('#\s+#', ' ', trim($item), 7); - - if (count(explode(' ', $item, 9)) !== 9) { - throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); - } - - list($permissions, /* $number */, /* $owner */, /* $group */, $size, $month, $day, $timeOrYear, $name) = explode(' ', $item, 9); - $type = $this->detectType($permissions); - $path = $base === '' ? $name : $base . $this->separator . $name; - - if ($type === 'dir') { - $result = compact('type', 'path'); - if ($this->enableTimestampsOnUnixListings) { - $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); - $result += compact('timestamp'); - } - - return $result; - } - - $permissions = $this->normalizePermissions($permissions); - $visibility = $permissions & 0044 ? AdapterInterface::VISIBILITY_PUBLIC : AdapterInterface::VISIBILITY_PRIVATE; - $size = (int) $size; - - $result = compact('type', 'path', 'visibility', 'size'); - if ($this->enableTimestampsOnUnixListings) { - $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); - $result += compact('timestamp'); - } - - return $result; - } - - /** - * Only accurate to the minute (current year), or to the day. - * - * Inadequacies in timestamp accuracy are due to limitations of the FTP 'LIST' command - * - * Note: The 'MLSD' command is a machine-readable replacement for 'LIST' - * but many FTP servers do not support it :( - * - * @param string $month e.g. 'Aug' - * @param string $day e.g. '19' - * @param string $timeOrYear e.g. '09:01' OR '2015' - * - * @return int - */ - protected function normalizeUnixTimestamp($month, $day, $timeOrYear) - { - if (is_numeric($timeOrYear)) { - $year = $timeOrYear; - $hour = '00'; - $minute = '00'; - $seconds = '00'; - } else { - $year = date('Y'); - list($hour, $minute) = explode(':', $timeOrYear); - $seconds = '00'; - } - $dateTime = DateTime::createFromFormat('Y-M-j-G:i:s', "{$year}-{$month}-{$day}-{$hour}:{$minute}:{$seconds}"); - - return $dateTime->getTimestamp(); - } - - /** - * Normalize a Windows/DOS file entry. - * - * @param string $item - * @param string $base - * - * @return array normalized file array - */ - protected function normalizeWindowsObject($item, $base) - { - $item = preg_replace('#\s+#', ' ', trim($item), 3); - - if (count(explode(' ', $item, 4)) !== 4) { - throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); - } - - list($date, $time, $size, $name) = explode(' ', $item, 4); - $path = $base === '' ? $name : $base . $this->separator . $name; - - // Check for the correct date/time format - $format = strlen($date) === 8 ? 'm-d-yH:iA' : 'Y-m-dH:i'; - $dt = DateTime::createFromFormat($format, $date . $time); - $timestamp = $dt ? $dt->getTimestamp() : (int) strtotime("$date $time"); - - if ($size === '') { - $type = 'dir'; - - return compact('type', 'path', 'timestamp'); - } - - $type = 'file'; - $visibility = AdapterInterface::VISIBILITY_PUBLIC; - $size = (int) $size; - - return compact('type', 'path', 'visibility', 'size', 'timestamp'); - } - - /** - * Get the system type from a listing item. - * - * @param string $item - * - * @return string the system type - */ - protected function detectSystemType($item) - { - return preg_match('/^[0-9]{2,4}-[0-9]{2}-[0-9]{2}/', trim($item)) ? 'windows' : 'unix'; - } - - /** - * Get the file type from the permissions. - * - * @param string $permissions - * - * @return string file type - */ - protected function detectType($permissions) - { - return substr($permissions, 0, 1) === 'd' ? 'dir' : 'file'; - } - - /** - * Normalize a permissions string. - * - * @param string $permissions - * - * @return int - */ - protected function normalizePermissions($permissions) - { - if (is_numeric($permissions)) { - return ((int) $permissions) & 0777; - } - - // remove the type identifier - $permissions = substr($permissions, 1); - - // map the string rights to the numeric counterparts - $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1']; - $permissions = strtr($permissions, $map); - - // split up the permission groups - $parts = str_split($permissions, 3); - - // convert the groups - $mapper = function ($part) { - return array_sum(str_split($part)); - }; - - // converts to decimal number - return octdec(implode('', array_map($mapper, $parts))); - } - - /** - * Filter out dot-directories. - * - * @param array $list - * - * @return array - */ - public function removeDotDirectories(array $list) - { - $filter = function ($line) { - return $line !== '' && ! preg_match('#.* \.(\.)?$|^total#', $line); - }; - - return array_filter($list, $filter); - } - - /** - * @inheritdoc - */ - public function has($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - return $this->getMetadata($path); - } - - /** - * Ensure a directory exists. - * - * @param string $dirname - */ - public function ensureDirectory($dirname) - { - $dirname = (string) $dirname; - - if ($dirname !== '' && ! $this->has($dirname)) { - $this->createDir($dirname, new Config()); - } - } - - /** - * @return mixed - */ - public function getConnection() - { - if ( ! $this->isConnected()) { - $this->disconnect(); - $this->connect(); - } - - return $this->connection; - } - - /** - * Get the public permission value. - * - * @return int - */ - public function getPermPublic() - { - return $this->permPublic; - } - - /** - * Get the private permission value. - * - * @return int - */ - public function getPermPrivate() - { - return $this->permPrivate; - } - - /** - * Disconnect on destruction. - */ - public function __destruct() - { - $this->disconnect(); - } - - /** - * Establish a connection. - */ - abstract public function connect(); - - /** - * Close the connection. - */ - abstract public function disconnect(); - - /** - * Check if a connection is active. - * - * @return bool - */ - abstract public function isConnected(); - - protected function escapePath($path) - { - return str_replace(['*', '[', ']'], ['\\*', '\\[', '\\]'], $path); - } -} diff --git a/trunk/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php b/trunk/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php deleted file mode 100644 index fd8d2161..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php +++ /dev/null @@ -1,12 +0,0 @@ -transferMode = $mode; - - return $this; - } - - /** - * Set if Ssl is enabled. - * - * @param bool $ssl - * - * @return $this - */ - public function setSsl($ssl) - { - $this->ssl = (bool) $ssl; - - return $this; - } - - /** - * Set if passive mode should be used. - * - * @param bool $passive - */ - public function setPassive($passive = true) - { - $this->passive = $passive; - } - - /** - * @param bool $ignorePassiveAddress - */ - public function setIgnorePassiveAddress($ignorePassiveAddress) - { - $this->ignorePassiveAddress = $ignorePassiveAddress; - } - - /** - * @param bool $recurseManually - */ - public function setRecurseManually($recurseManually) - { - $this->recurseManually = $recurseManually; - } - - /** - * @param bool $utf8 - */ - public function setUtf8($utf8) - { - $this->utf8 = (bool) $utf8; - } - - /** - * Connect to the FTP server. - */ - public function connect() - { - $tries = 3; - start_connecting: - - if ($this->ssl) { - $this->connection = @ftp_ssl_connect($this->getHost(), $this->getPort(), $this->getTimeout()); - } else { - $this->connection = @ftp_connect($this->getHost(), $this->getPort(), $this->getTimeout()); - } - - if ( ! $this->connection) { - $tries--; - - if ($tries > 0) goto start_connecting; - - throw new ConnectionRuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); - } - - $this->login(); - $this->setUtf8Mode(); - $this->setConnectionPassiveMode(); - $this->setConnectionRoot(); - $this->isPureFtpd = $this->isPureFtpdServer(); - } - - /** - * Set the connection to UTF-8 mode. - */ - protected function setUtf8Mode() - { - if ($this->utf8) { - $response = ftp_raw($this->connection, "OPTS UTF8 ON"); - if (!in_array(substr($response[0], 0, 3), ['200', '202'])) { - throw new ConnectionRuntimeException( - 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort() - ); - } - } - } - - /** - * Set the connections to passive mode. - * - * @throws ConnectionRuntimeException - */ - protected function setConnectionPassiveMode() - { - if (is_bool($this->ignorePassiveAddress) && defined('FTP_USEPASVADDRESS')) { - ftp_set_option($this->connection, FTP_USEPASVADDRESS, ! $this->ignorePassiveAddress); - } - - if ( ! ftp_pasv($this->connection, $this->passive)) { - throw new ConnectionRuntimeException( - 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort() - ); - } - } - - /** - * Set the connection root. - */ - protected function setConnectionRoot() - { - $root = $this->getRoot(); - $connection = $this->connection; - - if ($root && ! ftp_chdir($connection, $root)) { - throw new InvalidRootException('Root is invalid or does not exist: ' . $this->getRoot()); - } - - // Store absolute path for further reference. - // This is needed when creating directories and - // initial root was a relative path, else the root - // would be relative to the chdir'd path. - $this->root = ftp_pwd($connection); - } - - /** - * Login. - * - * @throws ConnectionRuntimeException - */ - protected function login() - { - set_error_handler(function () { - }); - $isLoggedIn = ftp_login( - $this->connection, - $this->getUsername(), - $this->getPassword() - ); - restore_error_handler(); - - if ( ! $isLoggedIn) { - $this->disconnect(); - throw new ConnectionRuntimeException( - 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort( - ) . ', username: ' . $this->getUsername() - ); - } - } - - /** - * Disconnect from the FTP server. - */ - public function disconnect() - { - if ($this->hasFtpConnection()) { - @ftp_close($this->connection); - } - - $this->connection = null; - } - - /** - * @inheritdoc - */ - public function write($path, $contents, Config $config) - { - $stream = fopen('php://temp', 'w+b'); - fwrite($stream, $contents); - rewind($stream); - $result = $this->writeStream($path, $stream, $config); - fclose($stream); - - if ($result === false) { - return false; - } - - $result['contents'] = $contents; - $result['mimetype'] = $config->get('mimetype') ?: Util::guessMimeType($path, $contents); - - return $result; - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, Config $config) - { - $this->ensureDirectory(Util::dirname($path)); - - if ( ! ftp_fput($this->getConnection(), $path, $resource, $this->transferMode)) { - return false; - } - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - } - - $type = 'file'; - - return compact('type', 'path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - return $this->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, Config $config) - { - return $this->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - return ftp_rename($this->getConnection(), $path, $newpath); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - return ftp_delete($this->getConnection(), $path); - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $connection = $this->getConnection(); - $contents = array_reverse($this->listDirectoryContents($dirname, false)); - - foreach ($contents as $object) { - if ($object['type'] === 'file') { - if ( ! ftp_delete($connection, $object['path'])) { - return false; - } - } elseif ( ! $this->deleteDir($object['path'])) { - return false; - } - } - - return ftp_rmdir($connection, $dirname); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - $connection = $this->getConnection(); - $directories = explode('/', $dirname); - - foreach ($directories as $directory) { - if (false === $this->createActualDirectory($directory, $connection)) { - $this->setConnectionRoot(); - - return false; - } - - ftp_chdir($connection, $directory); - } - - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $dirname]; - } - - /** - * Create a directory. - * - * @param string $directory - * @param resource $connection - * - * @return bool - */ - protected function createActualDirectory($directory, $connection) - { - // List the current directory - $listing = ftp_nlist($connection, '.') ?: []; - - foreach ($listing as $key => $item) { - if (preg_match('~^\./.*~', $item)) { - $listing[$key] = substr($item, 2); - } - } - - if (in_array($directory, $listing, true)) { - return true; - } - - return (boolean) ftp_mkdir($connection, $directory); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - if ($path === '') { - return ['type' => 'dir', 'path' => '']; - } - - if (@ftp_chdir($this->getConnection(), $path) === true) { - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $path]; - } - - $listing = $this->ftpRawlist('-A', $path); - - if (empty($listing) || in_array('total 0', $listing, true)) { - return false; - } - - if (preg_match('/.* not found/', $listing[0])) { - return false; - } - - if (preg_match('/^total [0-9]*$/', $listing[0])) { - array_shift($listing); - } - - return $this->normalizeObject($listing[0], ''); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - if ( ! $metadata = $this->getMetadata($path)) { - return false; - } - - $metadata['mimetype'] = MimeType::detectByFilename($path); - - return $metadata; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - $timestamp = ftp_mdtm($this->getConnection(), $path); - - return ($timestamp !== -1) ? ['path' => $path, 'timestamp' => $timestamp] : false; - } - - /** - * @inheritdoc - */ - public function read($path) - { - if ( ! $object = $this->readStream($path)) { - return false; - } - - $object['contents'] = stream_get_contents($object['stream']); - fclose($object['stream']); - unset($object['stream']); - - return $object; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $stream = fopen('php://temp', 'w+b'); - $result = ftp_fget($this->getConnection(), $stream, $path, $this->transferMode); - rewind($stream); - - if ( ! $result) { - fclose($stream); - - return false; - } - - return ['type' => 'file', 'path' => $path, 'stream' => $stream]; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $mode = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? $this->getPermPublic() : $this->getPermPrivate(); - - if ( ! ftp_chmod($this->getConnection(), $mode, $path)) { - return false; - } - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - * - * @param string $directory - */ - protected function listDirectoryContents($directory, $recursive = true) - { - if ($recursive && $this->recurseManually) { - return $this->listDirectoryContentsRecursive($directory); - } - - $options = $recursive ? '-alnR' : '-aln'; - $listing = $this->ftpRawlist($options, $directory); - - return $listing ? $this->normalizeListing($listing, $directory) : []; - } - - /** - * @inheritdoc - * - * @param string $directory - */ - protected function listDirectoryContentsRecursive($directory) - { - $listing = $this->normalizeListing($this->ftpRawlist('-aln', $directory) ?: [], $directory); - $output = []; - - foreach ($listing as $item) { - $output[] = $item; - if ($item['type'] !== 'dir') { - continue; - } - $output = array_merge($output, $this->listDirectoryContentsRecursive($item['path'])); - } - - return $output; - } - - /** - * Check if the connection is open. - * - * @return bool - * - * @throws ConnectionErrorException - */ - public function isConnected() - { - return $this->hasFtpConnection() && $this->getRawExecResponseCode('NOOP') === 200; - } - - /** - * @return bool - */ - protected function isPureFtpdServer() - { - $response = ftp_raw($this->connection, 'HELP'); - - return stripos(implode(' ', $response), 'Pure-FTPd') !== false; - } - - /** - * The ftp_rawlist function with optional escaping. - * - * @param string $options - * @param string $path - * - * @return array - */ - protected function ftpRawlist($options, $path) - { - $connection = $this->getConnection(); - - if ($this->isPureFtpd) { - $path = str_replace([' ', '[', ']'], ['\ ', '\\[', '\\]'], $path); - } - - return ftp_rawlist($connection, $options . ' ' . $this->escapePath($path)); - } - - private function getRawExecResponseCode($command) - { - $response = @ftp_raw($this->connection, trim($command)) ?: []; - - return (int) preg_replace('/\D/', '', implode(' ', (array) $response)); - } - - private function hasFtpConnection(): bool - { - return is_resource($this->connection) || $this->connection instanceof \FTP\Connection; - } -} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Ftpd.php b/trunk/vendor/league/flysystem/src/Adapter/Ftpd.php deleted file mode 100644 index 7e71d19f..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/Ftpd.php +++ /dev/null @@ -1,48 +0,0 @@ - 'dir', 'path' => '']; - } - - if (@ftp_chdir($this->getConnection(), $path) === true) { - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $path]; - } - - $object = ftp_raw($this->getConnection(), 'STAT ' . $this->escapePath($path)); - - if ( ! $object || count($object) < 3) { - return false; - } - - if (substr($object[1], 0, 5) === "ftpd:") { - return false; - } - - return $this->normalizeObject($object[1], ''); - } - - /** - * @inheritdoc - */ - protected function listDirectoryContents($directory, $recursive = true) - { - $listing = ftp_rawlist($this->getConnection(), $this->escapePath($directory), $recursive); - - if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) { - return []; - } - - return $this->normalizeListing($listing, $directory); - } -} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Local.php b/trunk/vendor/league/flysystem/src/Adapter/Local.php deleted file mode 100644 index 747c463e..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/Local.php +++ /dev/null @@ -1,533 +0,0 @@ - [ - 'public' => 0644, - 'private' => 0600, - ], - 'dir' => [ - 'public' => 0755, - 'private' => 0700, - ], - ]; - - /** - * @var string - */ - protected $pathSeparator = DIRECTORY_SEPARATOR; - - /** - * @var array - */ - protected $permissionMap; - - /** - * @var int - */ - protected $writeFlags; - - /** - * @var int - */ - private $linkHandling; - - /** - * Constructor. - * - * @param string $root - * @param int $writeFlags - * @param int $linkHandling - * @param array $permissions - * - * @throws LogicException - */ - public function __construct($root, $writeFlags = LOCK_EX, $linkHandling = self::DISALLOW_LINKS, array $permissions = []) - { - $root = is_link($root) ? realpath($root) : $root; - $this->permissionMap = array_replace_recursive(static::$permissions, $permissions); - $this->ensureDirectory($root); - - if ( ! is_dir($root) || ! is_readable($root)) { - throw new LogicException('The root path ' . $root . ' is not readable.'); - } - - $this->setPathPrefix($root); - $this->writeFlags = $writeFlags; - $this->linkHandling = $linkHandling; - } - - /** - * Ensure the root directory exists. - * - * @param string $root root directory path - * - * @return void - * - * @throws Exception in case the root directory can not be created - */ - protected function ensureDirectory($root) - { - if ( ! is_dir($root)) { - $umask = umask(0); - - if ( ! @mkdir($root, $this->permissionMap['dir']['public'], true)) { - $mkdirError = error_get_last(); - } - - umask($umask); - clearstatcache(false, $root); - - if ( ! is_dir($root)) { - $errorMessage = isset($mkdirError['message']) ? $mkdirError['message'] : ''; - throw new Exception(sprintf('Impossible to create the root directory "%s". %s', $root, $errorMessage)); - } - } - } - - /** - * @inheritdoc - */ - public function has($path) - { - $location = $this->applyPathPrefix($path); - - return file_exists($location); - } - - /** - * @inheritdoc - */ - public function write($path, $contents, Config $config) - { - $location = $this->applyPathPrefix($path); - $this->ensureDirectory(dirname($location)); - - if (($size = file_put_contents($location, $contents, $this->writeFlags)) === false) { - return false; - } - - $type = 'file'; - $result = compact('contents', 'type', 'size', 'path'); - - if ($visibility = $config->get('visibility')) { - $result['visibility'] = $visibility; - $this->setVisibility($path, $visibility); - } - - return $result; - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, Config $config) - { - $location = $this->applyPathPrefix($path); - $this->ensureDirectory(dirname($location)); - $stream = fopen($location, 'w+b'); - - if ( ! $stream || stream_copy_to_stream($resource, $stream) === false || ! fclose($stream)) { - return false; - } - - $type = 'file'; - $result = compact('type', 'path'); - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $location = $this->applyPathPrefix($path); - $stream = fopen($location, 'rb'); - - return ['type' => 'file', 'path' => $path, 'stream' => $stream]; - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, Config $config) - { - return $this->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - $location = $this->applyPathPrefix($path); - $size = file_put_contents($location, $contents, $this->writeFlags); - - if ($size === false) { - return false; - } - - $type = 'file'; - - $result = compact('type', 'path', 'size', 'contents'); - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function read($path) - { - $location = $this->applyPathPrefix($path); - $contents = @file_get_contents($location); - - if ($contents === false) { - return false; - } - - return ['type' => 'file', 'path' => $path, 'contents' => $contents]; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - $location = $this->applyPathPrefix($path); - $destination = $this->applyPathPrefix($newpath); - $parentDirectory = $this->applyPathPrefix(Util::dirname($newpath)); - $this->ensureDirectory($parentDirectory); - - return rename($location, $destination); - } - - /** - * @inheritdoc - */ - public function copy($path, $newpath) - { - $location = $this->applyPathPrefix($path); - $destination = $this->applyPathPrefix($newpath); - $this->ensureDirectory(dirname($destination)); - - return copy($location, $destination); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - $location = $this->applyPathPrefix($path); - - return @unlink($location); - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - $result = []; - $location = $this->applyPathPrefix($directory); - - if ( ! is_dir($location)) { - return []; - } - - $iterator = $recursive ? $this->getRecursiveDirectoryIterator($location) : $this->getDirectoryIterator($location); - - foreach ($iterator as $file) { - $path = $this->getFilePath($file); - - if (preg_match('#(^|/|\\\\)\.{1,2}$#', $path)) { - continue; - } - - $result[] = $this->normalizeFileInfo($file); - } - - unset($iterator); - - return array_filter($result); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - $location = $this->applyPathPrefix($path); - clearstatcache(false, $location); - $info = new SplFileInfo($location); - - return $this->normalizeFileInfo($info); - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - $location = $this->applyPathPrefix($path); - $finfo = new Finfo(FILEINFO_MIME_TYPE); - $mimetype = $finfo->file($location); - - if (in_array($mimetype, ['application/octet-stream', 'inode/x-empty', 'application/x-empty'])) { - $mimetype = Util\MimeType::detectByFilename($location); - } - - return ['path' => $path, 'type' => 'file', 'mimetype' => $mimetype]; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - $location = $this->applyPathPrefix($path); - clearstatcache(false, $location); - $permissions = octdec(substr(sprintf('%o', fileperms($location)), -4)); - $type = is_dir($location) ? 'dir' : 'file'; - - foreach ($this->permissionMap[$type] as $visibility => $visibilityPermissions) { - if ($visibilityPermissions == $permissions) { - return compact('path', 'visibility'); - } - } - - $visibility = substr(sprintf('%o', fileperms($location)), -4); - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $location = $this->applyPathPrefix($path); - $type = is_dir($location) ? 'dir' : 'file'; - $success = chmod($location, $this->permissionMap[$type][$visibility]); - - if ($success === false) { - return false; - } - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - $location = $this->applyPathPrefix($dirname); - $umask = umask(0); - $visibility = $config->get('visibility', 'public'); - $return = ['path' => $dirname, 'type' => 'dir']; - - if ( ! is_dir($location)) { - if (false === @mkdir($location, $this->permissionMap['dir'][$visibility], true) - || false === is_dir($location)) { - $return = false; - } - } - - umask($umask); - - return $return; - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $location = $this->applyPathPrefix($dirname); - - if ( ! is_dir($location)) { - return false; - } - - $contents = $this->getRecursiveDirectoryIterator($location, RecursiveIteratorIterator::CHILD_FIRST); - - /** @var SplFileInfo $file */ - foreach ($contents as $file) { - $this->guardAgainstUnreadableFileInfo($file); - $this->deleteFileInfoObject($file); - } - - unset($contents); - - return rmdir($location); - } - - /** - * @param SplFileInfo $file - */ - protected function deleteFileInfoObject(SplFileInfo $file) - { - switch ($file->getType()) { - case 'dir': - rmdir($file->getRealPath()); - break; - case 'link': - unlink($file->getPathname()); - break; - default: - unlink($file->getRealPath()); - } - } - - /** - * Normalize the file info. - * - * @param SplFileInfo $file - * - * @return array|void - * - * @throws NotSupportedException - */ - protected function normalizeFileInfo(SplFileInfo $file) - { - if ( ! $file->isLink()) { - return $this->mapFileInfo($file); - } - - if ($this->linkHandling & self::DISALLOW_LINKS) { - throw NotSupportedException::forLink($file); - } - } - - /** - * Get the normalized path from a SplFileInfo object. - * - * @param SplFileInfo $file - * - * @return string - */ - protected function getFilePath(SplFileInfo $file) - { - $location = $file->getPathname(); - $path = $this->removePathPrefix($location); - - return trim(str_replace('\\', '/', $path), '/'); - } - - /** - * @param string $path - * @param int $mode - * - * @return RecursiveIteratorIterator - */ - protected function getRecursiveDirectoryIterator($path, $mode = RecursiveIteratorIterator::SELF_FIRST) - { - return new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), - $mode - ); - } - - /** - * @param string $path - * - * @return DirectoryIterator - */ - protected function getDirectoryIterator($path) - { - $iterator = new DirectoryIterator($path); - - return $iterator; - } - - /** - * @param SplFileInfo $file - * - * @return array - */ - protected function mapFileInfo(SplFileInfo $file) - { - $normalized = [ - 'type' => $file->getType(), - 'path' => $this->getFilePath($file), - ]; - - $normalized['timestamp'] = $file->getMTime(); - - if ($normalized['type'] === 'file') { - $normalized['size'] = $file->getSize(); - } - - return $normalized; - } - - /** - * @param SplFileInfo $file - * - * @throws UnreadableFileException - */ - protected function guardAgainstUnreadableFileInfo(SplFileInfo $file) - { - if ( ! $file->isReadable()) { - throw UnreadableFileException::forFileInfo($file); - } - } -} diff --git a/trunk/vendor/league/flysystem/src/Adapter/NullAdapter.php b/trunk/vendor/league/flysystem/src/Adapter/NullAdapter.php deleted file mode 100644 index 2527087f..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/NullAdapter.php +++ /dev/null @@ -1,144 +0,0 @@ -get('visibility')) { - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - return false; - } - - /** - * @inheritdoc - */ - public function read($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - return false; - } - - /** - * @inheritdoc - */ - public function delete($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - return []; - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - return compact('visibility'); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - return ['path' => $dirname, 'type' => 'dir']; - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - return false; - } -} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php b/trunk/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php deleted file mode 100644 index fc0a747a..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php +++ /dev/null @@ -1,33 +0,0 @@ -readStream($path); - - if ($response === false || ! is_resource($response['stream'])) { - return false; - } - - $result = $this->writeStream($newpath, $response['stream'], new Config()); - - if ($result !== false && is_resource($response['stream'])) { - fclose($response['stream']); - } - - return $result !== false; - } - - // Required abstract method - - /** - * @param string $path - * - * @return resource - */ - abstract public function readStream($path); - - /** - * @param string $path - * @param resource $resource - * @param Config $config - * - * @return resource - */ - abstract public function writeStream($path, $resource, Config $config); -} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php b/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php deleted file mode 100644 index 2b31c01d..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php +++ /dev/null @@ -1,44 +0,0 @@ -read($path)) { - return false; - } - - $stream = fopen('php://temp', 'w+b'); - fwrite($stream, $data['contents']); - rewind($stream); - $data['stream'] = $stream; - unset($data['contents']); - - return $data; - } - - /** - * Reads a file. - * - * @param string $path - * - * @return array|false - * - * @see League\Flysystem\ReadInterface::read() - */ - abstract public function read($path); -} diff --git a/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php b/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php deleted file mode 100644 index 80424960..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php +++ /dev/null @@ -1,9 +0,0 @@ -stream($path, $resource, $config, 'write'); - } - - /** - * Update a file using a stream. - * - * @param string $path - * @param resource $resource - * @param Config $config Config object or visibility setting - * - * @return mixed false of file metadata - */ - public function updateStream($path, $resource, Config $config) - { - return $this->stream($path, $resource, $config, 'update'); - } - - // Required abstract methods - abstract public function write($pash, $contents, Config $config); - abstract public function update($pash, $contents, Config $config); -} diff --git a/trunk/vendor/league/flysystem/src/Adapter/SynologyFtp.php b/trunk/vendor/league/flysystem/src/Adapter/SynologyFtp.php deleted file mode 100644 index fe0d344c..00000000 --- a/trunk/vendor/league/flysystem/src/Adapter/SynologyFtp.php +++ /dev/null @@ -1,8 +0,0 @@ -settings = $settings; - } - - /** - * Get a setting. - * - * @param string $key - * @param mixed $default - * - * @return mixed config setting or default when not found - */ - public function get($key, $default = null) - { - if ( ! array_key_exists($key, $this->settings)) { - return $this->getDefault($key, $default); - } - - return $this->settings[$key]; - } - - /** - * Check if an item exists by key. - * - * @param string $key - * - * @return bool - */ - public function has($key) - { - if (array_key_exists($key, $this->settings)) { - return true; - } - - return $this->fallback instanceof Config - ? $this->fallback->has($key) - : false; - } - - /** - * Try to retrieve a default setting from a config fallback. - * - * @param string $key - * @param mixed $default - * - * @return mixed config setting or default when not found - */ - protected function getDefault($key, $default) - { - if ( ! $this->fallback) { - return $default; - } - - return $this->fallback->get($key, $default); - } - - /** - * Set a setting. - * - * @param string $key - * @param mixed $value - * - * @return $this - */ - public function set($key, $value) - { - $this->settings[$key] = $value; - - return $this; - } - - /** - * Set the fallback. - * - * @param Config $fallback - * - * @return $this - */ - public function setFallback(Config $fallback) - { - $this->fallback = $fallback; - - return $this; - } -} diff --git a/trunk/vendor/league/flysystem/src/ConfigAwareTrait.php b/trunk/vendor/league/flysystem/src/ConfigAwareTrait.php deleted file mode 100644 index 202d605d..00000000 --- a/trunk/vendor/league/flysystem/src/ConfigAwareTrait.php +++ /dev/null @@ -1,49 +0,0 @@ -config = $config ? Util::ensureConfig($config) : new Config; - } - - /** - * Get the Config. - * - * @return Config config object - */ - public function getConfig() - { - return $this->config; - } - - /** - * Convert a config array to a Config object with the correct fallback. - * - * @param array $config - * - * @return Config - */ - protected function prepareConfig(array $config) - { - $config = new Config($config); - $config->setFallback($this->getConfig()); - - return $config; - } -} diff --git a/trunk/vendor/league/flysystem/src/ConnectionErrorException.php b/trunk/vendor/league/flysystem/src/ConnectionErrorException.php deleted file mode 100644 index adb651d3..00000000 --- a/trunk/vendor/league/flysystem/src/ConnectionErrorException.php +++ /dev/null @@ -1,9 +0,0 @@ -filesystem->deleteDir($this->path); - } - - /** - * List the directory contents. - * - * @param bool $recursive - * - * @return array|bool directory contents or false - */ - public function getContents($recursive = false) - { - return $this->filesystem->listContents($this->path, $recursive); - } -} diff --git a/trunk/vendor/league/flysystem/src/Exception.php b/trunk/vendor/league/flysystem/src/Exception.php deleted file mode 100644 index 4596c0a9..00000000 --- a/trunk/vendor/league/flysystem/src/Exception.php +++ /dev/null @@ -1,8 +0,0 @@ -filesystem->has($this->path); - } - - /** - * Read the file. - * - * @return string|false file contents - */ - public function read() - { - return $this->filesystem->read($this->path); - } - - /** - * Read the file as a stream. - * - * @return resource|false file stream - */ - public function readStream() - { - return $this->filesystem->readStream($this->path); - } - - /** - * Write the new file. - * - * @param string $content - * - * @return bool success boolean - */ - public function write($content) - { - return $this->filesystem->write($this->path, $content); - } - - /** - * Write the new file using a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function writeStream($resource) - { - return $this->filesystem->writeStream($this->path, $resource); - } - - /** - * Update the file contents. - * - * @param string $content - * - * @return bool success boolean - */ - public function update($content) - { - return $this->filesystem->update($this->path, $content); - } - - /** - * Update the file contents with a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function updateStream($resource) - { - return $this->filesystem->updateStream($this->path, $resource); - } - - /** - * Create the file or update if exists. - * - * @param string $content - * - * @return bool success boolean - */ - public function put($content) - { - return $this->filesystem->put($this->path, $content); - } - - /** - * Create the file or update if exists using a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function putStream($resource) - { - return $this->filesystem->putStream($this->path, $resource); - } - - /** - * Rename the file. - * - * @param string $newpath - * - * @return bool success boolean - */ - public function rename($newpath) - { - if ($this->filesystem->rename($this->path, $newpath)) { - $this->path = $newpath; - - return true; - } - - return false; - } - - /** - * Copy the file. - * - * @param string $newpath - * - * @return File|false new file or false - */ - public function copy($newpath) - { - if ($this->filesystem->copy($this->path, $newpath)) { - return new File($this->filesystem, $newpath); - } - - return false; - } - - /** - * Get the file's timestamp. - * - * @return string|false The timestamp or false on failure. - */ - public function getTimestamp() - { - return $this->filesystem->getTimestamp($this->path); - } - - /** - * Get the file's mimetype. - * - * @return string|false The file mime-type or false on failure. - */ - public function getMimetype() - { - return $this->filesystem->getMimetype($this->path); - } - - /** - * Get the file's visibility. - * - * @return string|false The visibility (public|private) or false on failure. - */ - public function getVisibility() - { - return $this->filesystem->getVisibility($this->path); - } - - /** - * Get the file's metadata. - * - * @return array|false The file metadata or false on failure. - */ - public function getMetadata() - { - return $this->filesystem->getMetadata($this->path); - } - - /** - * Get the file size. - * - * @return int|false The file size or false on failure. - */ - public function getSize() - { - return $this->filesystem->getSize($this->path); - } - - /** - * Delete the file. - * - * @return bool success boolean - */ - public function delete() - { - return $this->filesystem->delete($this->path); - } -} diff --git a/trunk/vendor/league/flysystem/src/FileExistsException.php b/trunk/vendor/league/flysystem/src/FileExistsException.php deleted file mode 100644 index c82e20c1..00000000 --- a/trunk/vendor/league/flysystem/src/FileExistsException.php +++ /dev/null @@ -1,37 +0,0 @@ -path = $path; - - parent::__construct('File already exists at path: ' . $this->getPath(), $code, $previous); - } - - /** - * Get the path which was found. - * - * @return string - */ - public function getPath() - { - return $this->path; - } -} diff --git a/trunk/vendor/league/flysystem/src/FileNotFoundException.php b/trunk/vendor/league/flysystem/src/FileNotFoundException.php deleted file mode 100644 index 989df69b..00000000 --- a/trunk/vendor/league/flysystem/src/FileNotFoundException.php +++ /dev/null @@ -1,37 +0,0 @@ -path = $path; - - parent::__construct('File not found at path: ' . $this->getPath(), $code, $previous); - } - - /** - * Get the path which was not found. - * - * @return string - */ - public function getPath() - { - return $this->path; - } -} diff --git a/trunk/vendor/league/flysystem/src/Filesystem.php b/trunk/vendor/league/flysystem/src/Filesystem.php deleted file mode 100644 index c4eaf278..00000000 --- a/trunk/vendor/league/flysystem/src/Filesystem.php +++ /dev/null @@ -1,409 +0,0 @@ -adapter = $adapter; - $this->setConfig($config); - } - - /** - * Get the Adapter. - * - * @return AdapterInterface adapter - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * @inheritdoc - */ - public function has($path) - { - $path = Util::normalizePath($path); - - return strlen($path) === 0 ? false : (bool) $this->getAdapter()->has($path); - } - - /** - * @inheritdoc - */ - public function write($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $this->assertAbsent($path); - $config = $this->prepareConfig($config); - - return (bool) $this->getAdapter()->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $this->assertAbsent($path); - $config = $this->prepareConfig($config); - - Util::rewindStream($resource); - - return (bool) $this->getAdapter()->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function put($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - - if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { - return (bool) $this->getAdapter()->update($path, $contents, $config); - } - - return (bool) $this->getAdapter()->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function putStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - Util::rewindStream($resource); - - if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { - return (bool) $this->getAdapter()->updateStream($path, $resource, $config); - } - - return (bool) $this->getAdapter()->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function readAndDelete($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - $contents = $this->read($path); - - if ($contents === false) { - return false; - } - - $this->delete($path); - - return $contents; - } - - /** - * @inheritdoc - */ - public function update($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - - $this->assertPresent($path); - - return (bool) $this->getAdapter()->update($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - $this->assertPresent($path); - Util::rewindStream($resource); - - return (bool) $this->getAdapter()->updateStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function read($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if ( ! ($object = $this->getAdapter()->read($path))) { - return false; - } - - return $object['contents']; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if ( ! $object = $this->getAdapter()->readStream($path)) { - return false; - } - - return $object['stream']; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - $path = Util::normalizePath($path); - $newpath = Util::normalizePath($newpath); - $this->assertPresent($path); - $this->assertAbsent($newpath); - - return (bool) $this->getAdapter()->rename($path, $newpath); - } - - /** - * @inheritdoc - */ - public function copy($path, $newpath) - { - $path = Util::normalizePath($path); - $newpath = Util::normalizePath($newpath); - $this->assertPresent($path); - $this->assertAbsent($newpath); - - return $this->getAdapter()->copy($path, $newpath); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return $this->getAdapter()->delete($path); - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $dirname = Util::normalizePath($dirname); - - if ($dirname === '') { - throw new RootViolationException('Root directories can not be deleted.'); - } - - return (bool) $this->getAdapter()->deleteDir($dirname); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, array $config = []) - { - $dirname = Util::normalizePath($dirname); - $config = $this->prepareConfig($config); - - return (bool) $this->getAdapter()->createDir($dirname, $config); - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - $directory = Util::normalizePath($directory); - $contents = $this->getAdapter()->listContents($directory, $recursive); - - return (new ContentListingFormatter($directory, $recursive, $this->config->get('case_sensitive', true))) - ->formatListing($contents); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getMimetype($path)) || ! array_key_exists('mimetype', $object)) { - return false; - } - - return $object['mimetype']; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getTimestamp($path)) || ! array_key_exists('timestamp', $object)) { - return false; - } - - return (int) $object['timestamp']; - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getVisibility($path)) || ! array_key_exists('visibility', $object)) { - return false; - } - - return $object['visibility']; - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getSize($path)) || ! array_key_exists('size', $object)) { - return false; - } - - return (int) $object['size']; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return (bool) $this->getAdapter()->setVisibility($path, $visibility); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return $this->getAdapter()->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function get($path, Handler $handler = null) - { - $path = Util::normalizePath($path); - - if ( ! $handler) { - $metadata = $this->getMetadata($path); - $handler = ($metadata && $metadata['type'] === 'file') ? new File($this, $path) : new Directory($this, $path); - } - - $handler->setPath($path); - $handler->setFilesystem($this); - - return $handler; - } - - /** - * Assert a file is present. - * - * @param string $path path to file - * - * @throws FileNotFoundException - * - * @return void - */ - public function assertPresent($path) - { - if ($this->config->get('disable_asserts', false) === false && ! $this->has($path)) { - throw new FileNotFoundException($path); - } - } - - /** - * Assert a file is absent. - * - * @param string $path path to file - * - * @throws FileExistsException - * - * @return void - */ - public function assertAbsent($path) - { - if ($this->config->get('disable_asserts', false) === false && $this->has($path)) { - throw new FileExistsException($path); - } - } -} diff --git a/trunk/vendor/league/flysystem/src/FilesystemException.php b/trunk/vendor/league/flysystem/src/FilesystemException.php deleted file mode 100644 index 3121e533..00000000 --- a/trunk/vendor/league/flysystem/src/FilesystemException.php +++ /dev/null @@ -1,7 +0,0 @@ -path = $path; - $this->filesystem = $filesystem; - } - - /** - * Check whether the entree is a directory. - * - * @return bool - */ - public function isDir() - { - return $this->getType() === 'dir'; - } - - /** - * Check whether the entree is a file. - * - * @return bool - */ - public function isFile() - { - return $this->getType() === 'file'; - } - - /** - * Retrieve the entree type (file|dir). - * - * @return string file or dir - */ - public function getType() - { - $metadata = $this->filesystem->getMetadata($this->path); - - return $metadata ? $metadata['type'] : 'dir'; - } - - /** - * Set the Filesystem object. - * - * @param FilesystemInterface $filesystem - * - * @return $this - */ - public function setFilesystem(FilesystemInterface $filesystem) - { - $this->filesystem = $filesystem; - - return $this; - } - - /** - * Retrieve the Filesystem object. - * - * @return FilesystemInterface - */ - public function getFilesystem() - { - return $this->filesystem; - } - - /** - * Set the entree path. - * - * @param string $path - * - * @return $this - */ - public function setPath($path) - { - $this->path = $path; - - return $this; - } - - /** - * Retrieve the entree path. - * - * @return string path - */ - public function getPath() - { - return $this->path; - } - - /** - * Plugins pass-through. - * - * @param string $method - * @param array $arguments - * - * @return mixed - */ - public function __call($method, array $arguments) - { - array_unshift($arguments, $this->path); - $callback = [$this->filesystem, $method]; - - try { - return call_user_func_array($callback, $arguments); - } catch (BadMethodCallException $e) { - throw new BadMethodCallException( - 'Call to undefined method ' - . get_called_class() - . '::' . $method - ); - } - } -} diff --git a/trunk/vendor/league/flysystem/src/InvalidRootException.php b/trunk/vendor/league/flysystem/src/InvalidRootException.php deleted file mode 100644 index 468d1d58..00000000 --- a/trunk/vendor/league/flysystem/src/InvalidRootException.php +++ /dev/null @@ -1,9 +0,0 @@ - Filesystem,] - * - * @throws InvalidArgumentException - */ - public function __construct(array $filesystems = []) - { - $this->mountFilesystems($filesystems); - } - - /** - * Mount filesystems. - * - * @param FilesystemInterface[] $filesystems [:prefix => Filesystem,] - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function mountFilesystems(array $filesystems) - { - foreach ($filesystems as $prefix => $filesystem) { - $this->mountFilesystem($prefix, $filesystem); - } - - return $this; - } - - /** - * Mount filesystems. - * - * @param string $prefix - * @param FilesystemInterface $filesystem - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function mountFilesystem($prefix, FilesystemInterface $filesystem) - { - if ( ! is_string($prefix)) { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #1 to be a string.'); - } - - $this->filesystems[$prefix] = $filesystem; - - return $this; - } - - /** - * Get the filesystem with the corresponding prefix. - * - * @param string $prefix - * - * @throws FilesystemNotFoundException - * - * @return FilesystemInterface - */ - public function getFilesystem($prefix) - { - if ( ! isset($this->filesystems[$prefix])) { - throw new FilesystemNotFoundException('No filesystem mounted with prefix ' . $prefix); - } - - return $this->filesystems[$prefix]; - } - - /** - * Retrieve the prefix from an arguments array. - * - * @param array $arguments - * - * @throws InvalidArgumentException - * - * @return array [:prefix, :arguments] - */ - public function filterPrefix(array $arguments) - { - if (empty($arguments)) { - throw new InvalidArgumentException('At least one argument needed'); - } - - $path = array_shift($arguments); - - if ( ! is_string($path)) { - throw new InvalidArgumentException('First argument should be a string'); - } - - list($prefix, $path) = $this->getPrefixAndPath($path); - array_unshift($arguments, $path); - - return [$prefix, $arguments]; - } - - /** - * @param string $directory - * @param bool $recursive - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return array - */ - public function listContents($directory = '', $recursive = false) - { - list($prefix, $directory) = $this->getPrefixAndPath($directory); - $filesystem = $this->getFilesystem($prefix); - $result = $filesystem->listContents($directory, $recursive); - - foreach ($result as &$file) { - $file['filesystem'] = $prefix; - } - - return $result; - } - - /** - * Call forwarder. - * - * @param string $method - * @param array $arguments - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return mixed - */ - public function __call($method, $arguments) - { - list($prefix, $arguments) = $this->filterPrefix($arguments); - - return $this->invokePluginOnFilesystem($method, $arguments, $prefix); - } - - /** - * @param string $from - * @param string $to - * @param array $config - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * @throws FileExistsException - * - * @return bool - */ - public function copy($from, $to, array $config = []) - { - list($prefixFrom, $from) = $this->getPrefixAndPath($from); - - $buffer = $this->getFilesystem($prefixFrom)->readStream($from); - - if ($buffer === false) { - return false; - } - - list($prefixTo, $to) = $this->getPrefixAndPath($to); - - $result = $this->getFilesystem($prefixTo)->writeStream($to, $buffer, $config); - - if (is_resource($buffer)) { - fclose($buffer); - } - - return $result; - } - - /** - * List with plugin adapter. - * - * @param array $keys - * @param string $directory - * @param bool $recursive - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return array - */ - public function listWith(array $keys = [], $directory = '', $recursive = false) - { - list($prefix, $directory) = $this->getPrefixAndPath($directory); - $arguments = [$keys, $directory, $recursive]; - - return $this->invokePluginOnFilesystem('listWith', $arguments, $prefix); - } - - /** - * Move a file. - * - * @param string $from - * @param string $to - * @param array $config - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return bool - */ - public function move($from, $to, array $config = []) - { - list($prefixFrom, $pathFrom) = $this->getPrefixAndPath($from); - list($prefixTo, $pathTo) = $this->getPrefixAndPath($to); - - if ($prefixFrom === $prefixTo) { - $filesystem = $this->getFilesystem($prefixFrom); - $renamed = $filesystem->rename($pathFrom, $pathTo); - - if ($renamed && isset($config['visibility'])) { - return $filesystem->setVisibility($pathTo, $config['visibility']); - } - - return $renamed; - } - - $copied = $this->copy($from, $to, $config); - - if ($copied) { - return $this->delete($from); - } - - return false; - } - - /** - * Invoke a plugin on a filesystem mounted on a given prefix. - * - * @param string $method - * @param array $arguments - * @param string $prefix - * - * @throws FilesystemNotFoundException - * - * @return mixed - */ - public function invokePluginOnFilesystem($method, $arguments, $prefix) - { - $filesystem = $this->getFilesystem($prefix); - - try { - return $this->invokePlugin($method, $arguments, $filesystem); - } catch (PluginNotFoundException $e) { - // Let it pass, it's ok, don't panic. - } - - $callback = [$filesystem, $method]; - - return call_user_func_array($callback, $arguments); - } - - /** - * @param string $path - * - * @throws InvalidArgumentException - * - * @return string[] [:prefix, :path] - */ - protected function getPrefixAndPath($path) - { - if (strpos($path, '://') < 1) { - throw new InvalidArgumentException('No prefix detected in path: ' . $path); - } - - return explode('://', $path, 2); - } - - /** - * Check whether a file exists. - * - * @param string $path - * - * @return bool - */ - public function has($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->has($path); - } - - /** - * Read a file. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file contents or false on failure. - */ - public function read($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->read($path); - } - - /** - * Retrieves a read-stream for a path. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return resource|false The path resource or false on failure. - */ - public function readStream($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->readStream($path); - } - - /** - * Get a file's metadata. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return array|false The file metadata or false on failure. - */ - public function getMetadata($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getMetadata($path); - } - - /** - * Get a file's size. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return int|false The file size or false on failure. - */ - public function getSize($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getSize($path); - } - - /** - * Get a file's mime-type. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file mime-type or false on failure. - */ - public function getMimetype($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getMimetype($path); - } - - /** - * Get a file's timestamp. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The timestamp or false on failure. - */ - public function getTimestamp($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getTimestamp($path); - } - - /** - * Get a file's visibility. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The visibility (public|private) or false on failure. - */ - public function getVisibility($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getVisibility($path); - } - - /** - * Write a new file. - * - * @param string $path The path of the new file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @throws FileExistsException - * - * @return bool True on success, false on failure. - */ - public function write($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->write($path, $contents, $config); - } - - /** - * Write a new file using a stream. - * - * @param string $path The path of the new file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException If $resource is not a file handle. - * @throws FileExistsException - * - * @return bool True on success, false on failure. - */ - public function writeStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->writeStream($path, $resource, $config); - } - - /** - * Update an existing file. - * - * @param string $path The path of the existing file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function update($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->update($path, $contents, $config); - } - - /** - * Update an existing file using a stream. - * - * @param string $path The path of the existing file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException If $resource is not a file handle. - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function updateStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->updateStream($path, $resource, $config); - } - - /** - * Rename a file. - * - * @param string $path Path to the existing file. - * @param string $newpath The new path of the file. - * - * @throws FileExistsException Thrown if $newpath exists. - * @throws FileNotFoundException Thrown if $path does not exist. - * - * @return bool True on success, false on failure. - */ - public function rename($path, $newpath) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->rename($path, $newpath); - } - - /** - * Delete a file. - * - * @param string $path - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function delete($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->delete($path); - } - - /** - * Delete a directory. - * - * @param string $dirname - * - * @throws RootViolationException Thrown if $dirname is empty. - * - * @return bool True on success, false on failure. - */ - public function deleteDir($dirname) - { - list($prefix, $dirname) = $this->getPrefixAndPath($dirname); - - return $this->getFilesystem($prefix)->deleteDir($dirname); - } - - /** - * Create a directory. - * - * @param string $dirname The name of the new directory. - * @param array $config An optional configuration array. - * - * @return bool True on success, false on failure. - */ - public function createDir($dirname, array $config = []) - { - list($prefix, $dirname) = $this->getPrefixAndPath($dirname); - - return $this->getFilesystem($prefix)->createDir($dirname); - } - - /** - * Set the visibility for a file. - * - * @param string $path The path to the file. - * @param string $visibility One of 'public' or 'private'. - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function setVisibility($path, $visibility) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->setVisibility($path, $visibility); - } - - /** - * Create a file or update if exists. - * - * @param string $path The path to the file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @return bool True on success, false on failure. - */ - public function put($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->put($path, $contents, $config); - } - - /** - * Create a file or update if exists. - * - * @param string $path The path to the file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException Thrown if $resource is not a resource. - * - * @return bool True on success, false on failure. - */ - public function putStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->putStream($path, $resource, $config); - } - - /** - * Read and delete a file. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file contents, or false on failure. - */ - public function readAndDelete($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->readAndDelete($path); - } - - /** - * Get a file/directory handler. - * - * @deprecated - * - * @param string $path The path to the file. - * @param Handler $handler An optional existing handler to populate. - * - * @return Handler Either a file or directory handler. - */ - public function get($path, Handler $handler = null) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->get($path); - } -} diff --git a/trunk/vendor/league/flysystem/src/NotSupportedException.php b/trunk/vendor/league/flysystem/src/NotSupportedException.php deleted file mode 100644 index e0a989b2..00000000 --- a/trunk/vendor/league/flysystem/src/NotSupportedException.php +++ /dev/null @@ -1,37 +0,0 @@ -getPathname()); - } - - /** - * Create a new exception for a link. - * - * @param string $systemType - * - * @return static - */ - public static function forFtpSystemType($systemType) - { - $message = "The FTP system type '$systemType' is currently not supported."; - - return new static($message); - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/AbstractPlugin.php b/trunk/vendor/league/flysystem/src/Plugin/AbstractPlugin.php deleted file mode 100644 index 0d567897..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/AbstractPlugin.php +++ /dev/null @@ -1,24 +0,0 @@ -filesystem = $filesystem; - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/EmptyDir.php b/trunk/vendor/league/flysystem/src/Plugin/EmptyDir.php deleted file mode 100644 index b5ae7f58..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/EmptyDir.php +++ /dev/null @@ -1,34 +0,0 @@ -filesystem->listContents($dirname, false); - - foreach ($listing as $item) { - if ($item['type'] === 'dir') { - $this->filesystem->deleteDir($item['path']); - } else { - $this->filesystem->delete($item['path']); - } - } - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ForcedCopy.php b/trunk/vendor/league/flysystem/src/Plugin/ForcedCopy.php deleted file mode 100644 index a41e9f3a..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/ForcedCopy.php +++ /dev/null @@ -1,44 +0,0 @@ -filesystem->delete($newpath); - } catch (FileNotFoundException $e) { - // The destination path does not exist. That's ok. - $deleted = true; - } - - if ($deleted) { - return $this->filesystem->copy($path, $newpath); - } - - return false; - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ForcedRename.php b/trunk/vendor/league/flysystem/src/Plugin/ForcedRename.php deleted file mode 100644 index 3f51cd60..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/ForcedRename.php +++ /dev/null @@ -1,44 +0,0 @@ -filesystem->delete($newpath); - } catch (FileNotFoundException $e) { - // The destination path does not exist. That's ok. - $deleted = true; - } - - if ($deleted) { - return $this->filesystem->rename($path, $newpath); - } - - return false; - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/GetWithMetadata.php b/trunk/vendor/league/flysystem/src/Plugin/GetWithMetadata.php deleted file mode 100644 index 2f13d2fd..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/GetWithMetadata.php +++ /dev/null @@ -1,51 +0,0 @@ -filesystem->getMetadata($path); - - if ( ! $object) { - return false; - } - - $keys = array_diff($metadata, array_keys($object)); - - foreach ($keys as $key) { - if ( ! method_exists($this->filesystem, $method = 'get' . ucfirst($key))) { - throw new InvalidArgumentException('Could not fetch metadata: ' . $key); - } - - $object[$key] = $this->filesystem->{$method}($path); - } - - return $object; - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ListFiles.php b/trunk/vendor/league/flysystem/src/Plugin/ListFiles.php deleted file mode 100644 index 9669fe7e..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/ListFiles.php +++ /dev/null @@ -1,35 +0,0 @@ -filesystem->listContents($directory, $recursive); - - $filter = function ($object) { - return $object['type'] === 'file'; - }; - - return array_values(array_filter($contents, $filter)); - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ListPaths.php b/trunk/vendor/league/flysystem/src/Plugin/ListPaths.php deleted file mode 100644 index 0889d1f8..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/ListPaths.php +++ /dev/null @@ -1,36 +0,0 @@ -filesystem->listContents($directory, $recursive); - - foreach ($contents as $object) { - $result[] = $object['path']; - } - - return $result; - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/ListWith.php b/trunk/vendor/league/flysystem/src/Plugin/ListWith.php deleted file mode 100644 index d64debec..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/ListWith.php +++ /dev/null @@ -1,60 +0,0 @@ -filesystem->listContents($directory, $recursive); - - foreach ($contents as $index => $object) { - if ($object['type'] === 'file') { - $missingKeys = array_diff($keys, array_keys($object)); - $contents[$index] = array_reduce($missingKeys, [$this, 'getMetadataByName'], $object); - } - } - - return $contents; - } - - /** - * Get a meta-data value by key name. - * - * @param array $object - * @param string $key - * - * @return array - */ - protected function getMetadataByName(array $object, $key) - { - $method = 'get' . ucfirst($key); - - if ( ! method_exists($this->filesystem, $method)) { - throw new \InvalidArgumentException('Could not get meta-data for key: ' . $key); - } - - $object[$key] = $this->filesystem->{$method}($object['path']); - - return $object; - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/PluggableTrait.php b/trunk/vendor/league/flysystem/src/Plugin/PluggableTrait.php deleted file mode 100644 index 922edfe5..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/PluggableTrait.php +++ /dev/null @@ -1,97 +0,0 @@ -plugins[$plugin->getMethod()] = $plugin; - - return $this; - } - - /** - * Find a specific plugin. - * - * @param string $method - * - * @throws PluginNotFoundException - * - * @return PluginInterface - */ - protected function findPlugin($method) - { - if ( ! isset($this->plugins[$method])) { - throw new PluginNotFoundException('Plugin not found for method: ' . $method); - } - - return $this->plugins[$method]; - } - - /** - * Invoke a plugin by method name. - * - * @param string $method - * @param array $arguments - * @param FilesystemInterface $filesystem - * - * @throws PluginNotFoundException - * - * @return mixed - */ - protected function invokePlugin($method, array $arguments, FilesystemInterface $filesystem) - { - $plugin = $this->findPlugin($method); - $plugin->setFilesystem($filesystem); - $callback = [$plugin, 'handle']; - - return call_user_func_array($callback, $arguments); - } - - /** - * Plugins pass-through. - * - * @param string $method - * @param array $arguments - * - * @throws BadMethodCallException - * - * @return mixed - */ - public function __call($method, array $arguments) - { - try { - return $this->invokePlugin($method, $arguments, $this); - } catch (PluginNotFoundException $e) { - throw new BadMethodCallException( - 'Call to undefined method ' - . get_class($this) - . '::' . $method - ); - } - } -} diff --git a/trunk/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php b/trunk/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php deleted file mode 100644 index fd1d7e7e..00000000 --- a/trunk/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php +++ /dev/null @@ -1,10 +0,0 @@ -hash = spl_object_hash($this); - static::$safeStorage[$this->hash] = []; - } - - public function storeSafely($key, $value) - { - static::$safeStorage[$this->hash][$key] = $value; - } - - public function retrieveSafely($key) - { - if (array_key_exists($key, static::$safeStorage[$this->hash])) { - return static::$safeStorage[$this->hash][$key]; - } - } - - public function __destruct() - { - unset(static::$safeStorage[$this->hash]); - } -} diff --git a/trunk/vendor/league/flysystem/src/UnreadableFileException.php b/trunk/vendor/league/flysystem/src/UnreadableFileException.php deleted file mode 100644 index e6680338..00000000 --- a/trunk/vendor/league/flysystem/src/UnreadableFileException.php +++ /dev/null @@ -1,18 +0,0 @@ -getRealPath() - ) - ); - } -} diff --git a/trunk/vendor/league/flysystem/src/Util.php b/trunk/vendor/league/flysystem/src/Util.php deleted file mode 100644 index 1a2db718..00000000 --- a/trunk/vendor/league/flysystem/src/Util.php +++ /dev/null @@ -1,354 +0,0 @@ - '']; - } - - /** - * Normalize a dirname return value. - * - * @param string $dirname - * - * @return string normalized dirname - */ - public static function normalizeDirname($dirname) - { - return $dirname === '.' ? '' : $dirname; - } - - /** - * Get a normalized dirname from a path. - * - * @param string $path - * - * @return string dirname - */ - public static function dirname($path) - { - return static::normalizeDirname(dirname($path)); - } - - /** - * Map result arrays. - * - * @param array $object - * @param array $map - * - * @return array mapped result - */ - public static function map(array $object, array $map) - { - $result = []; - - foreach ($map as $from => $to) { - if ( ! isset($object[$from])) { - continue; - } - - $result[$to] = $object[$from]; - } - - return $result; - } - - /** - * Normalize path. - * - * @param string $path - * - * @throws LogicException - * - * @return string - */ - public static function normalizePath($path) - { - return static::normalizeRelativePath($path); - } - - /** - * Normalize relative directories in a path. - * - * @param string $path - * - * @throws LogicException - * - * @return string - */ - public static function normalizeRelativePath($path) - { - $path = str_replace('\\', '/', $path); - $path = static::removeFunkyWhiteSpace($path); - $parts = []; - - foreach (explode('/', $path) as $part) { - switch ($part) { - case '': - case '.': - break; - - case '..': - if (empty($parts)) { - throw new LogicException( - 'Path is outside of the defined root, path: [' . $path . ']' - ); - } - array_pop($parts); - break; - - default: - $parts[] = $part; - break; - } - } - - $path = implode('/', $parts); - - return $path; - } - - /** - * Rejects unprintable characters and invalid unicode characters. - * - * @param string $path - * - * @return string $path - */ - protected static function removeFunkyWhiteSpace($path) - { - if (preg_match('#\p{C}+#u', $path)) { - throw CorruptedPathDetected::forPath($path); - } - - return $path; - } - - /** - * Normalize prefix. - * - * @param string $prefix - * @param string $separator - * - * @return string normalized path - */ - public static function normalizePrefix($prefix, $separator) - { - return rtrim($prefix, $separator) . $separator; - } - - /** - * Get content size. - * - * @param string $contents - * - * @return int content size - */ - public static function contentSize($contents) - { - return defined('MB_OVERLOAD_STRING') ? mb_strlen($contents, '8bit') : strlen($contents); - } - - /** - * Guess MIME Type based on the path of the file and it's content. - * - * @param string $path - * @param string|resource $content - * - * @return string|null MIME Type or NULL if no extension detected - */ - public static function guessMimeType($path, $content) - { - $mimeType = MimeType::detectByContent($content); - - if ( ! (empty($mimeType) || in_array($mimeType, ['application/x-empty', 'text/plain', 'text/x-asm']))) { - return $mimeType; - } - - return MimeType::detectByFilename($path); - } - - /** - * Emulate directories. - * - * @param array $listing - * - * @return array listing with emulated directories - */ - public static function emulateDirectories(array $listing) - { - $directories = []; - $listedDirectories = []; - - foreach ($listing as $object) { - [$directories, $listedDirectories] = static::emulateObjectDirectories($object, $directories, $listedDirectories); - } - - $directories = array_diff(array_unique($directories), array_unique($listedDirectories)); - - foreach ($directories as $directory) { - $listing[] = static::pathinfo($directory) + ['type' => 'dir']; - } - - return $listing; - } - - /** - * Ensure a Config instance. - * - * @param null|array|Config $config - * - * @return Config config instance - * - * @throw LogicException - */ - public static function ensureConfig($config) - { - if ($config === null) { - return new Config(); - } - - if ($config instanceof Config) { - return $config; - } - - if (is_array($config)) { - return new Config($config); - } - - throw new LogicException('A config should either be an array or a Flysystem\Config object.'); - } - - /** - * Rewind a stream. - * - * @param resource $resource - */ - public static function rewindStream($resource) - { - if (ftell($resource) !== 0 && static::isSeekableStream($resource)) { - rewind($resource); - } - } - - public static function isSeekableStream($resource) - { - $metadata = stream_get_meta_data($resource); - - return $metadata['seekable']; - } - - /** - * Get the size of a stream. - * - * @param resource $resource - * - * @return int|null stream size - */ - public static function getStreamSize($resource) - { - $stat = fstat($resource); - - if ( ! is_array($stat) || ! isset($stat['size'])) { - return null; - } - - return $stat['size']; - } - - /** - * Emulate the directories of a single object. - * - * @param array $object - * @param array $directories - * @param array $listedDirectories - * - * @return array - */ - protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories) - { - if ($object['type'] === 'dir') { - $listedDirectories[] = $object['path']; - } - - if ( ! isset($object['dirname']) || trim($object['dirname']) === '') { - return [$directories, $listedDirectories]; - } - - $parent = $object['dirname']; - - while (isset($parent) && trim($parent) !== '' && ! in_array($parent, $directories)) { - $directories[] = $parent; - $parent = static::dirname($parent); - } - - if (isset($object['type']) && $object['type'] === 'dir') { - $listedDirectories[] = $object['path']; - - return [$directories, $listedDirectories]; - } - - return [$directories, $listedDirectories]; - } - - /** - * Returns the trailing name component of the path. - * - * @param string $path - * - * @return string - */ - private static function basename($path) - { - $separators = DIRECTORY_SEPARATOR === '/' ? '/' : '\/'; - - $path = rtrim($path, $separators); - - $basename = preg_replace('#.*?([^' . preg_quote($separators, '#') . ']+$)#', '$1', $path); - - if (DIRECTORY_SEPARATOR === '/') { - return $basename; - } - // @codeCoverageIgnoreStart - // Extra Windows path munging. This is tested via AppVeyor, but code - // coverage is not reported. - - // Handle relative paths with drive letters. c:file.txt. - while (preg_match('#^[a-zA-Z]{1}:[^\\\/]#', $basename)) { - $basename = substr($basename, 2); - } - - // Remove colon for standalone drive letter names. - if (preg_match('#^[a-zA-Z]{1}:$#', $basename)) { - $basename = rtrim($basename, ':'); - } - - return $basename; - // @codeCoverageIgnoreEnd - } -} diff --git a/trunk/vendor/league/flysystem/src/Util/ContentListingFormatter.php b/trunk/vendor/league/flysystem/src/Util/ContentListingFormatter.php deleted file mode 100644 index ae0d3b91..00000000 --- a/trunk/vendor/league/flysystem/src/Util/ContentListingFormatter.php +++ /dev/null @@ -1,122 +0,0 @@ -directory = rtrim($directory, '/'); - $this->recursive = $recursive; - $this->caseSensitive = $caseSensitive; - } - - /** - * Format contents listing. - * - * @param array $listing - * - * @return array - */ - public function formatListing(array $listing) - { - $listing = array_filter(array_map([$this, 'addPathInfo'], $listing), [$this, 'isEntryOutOfScope']); - - return $this->sortListing(array_values($listing)); - } - - private function addPathInfo(array $entry) - { - return $entry + Util::pathinfo($entry['path']); - } - - /** - * Determine if the entry is out of scope. - * - * @param array $entry - * - * @return bool - */ - private function isEntryOutOfScope(array $entry) - { - if (empty($entry['path']) && $entry['path'] !== '0') { - return false; - } - - if ($this->recursive) { - return $this->residesInDirectory($entry); - } - - return $this->isDirectChild($entry); - } - - /** - * Check if the entry resides within the parent directory. - * - * @param array $entry - * - * @return bool - */ - private function residesInDirectory(array $entry) - { - if ($this->directory === '') { - return true; - } - - return $this->caseSensitive - ? strpos($entry['path'], $this->directory . '/') === 0 - : stripos($entry['path'], $this->directory . '/') === 0; - } - - /** - * Check if the entry is a direct child of the directory. - * - * @param array $entry - * - * @return bool - */ - private function isDirectChild(array $entry) - { - return $this->caseSensitive - ? $entry['dirname'] === $this->directory - : strcasecmp($this->directory, $entry['dirname']) === 0; - } - - /** - * @param array $listing - * - * @return array - */ - private function sortListing(array $listing) - { - usort($listing, function ($a, $b) { - return strcasecmp($a['path'], $b['path']); - }); - - return $listing; - } -} diff --git a/trunk/vendor/league/flysystem/src/Util/MimeType.php b/trunk/vendor/league/flysystem/src/Util/MimeType.php deleted file mode 100644 index 35cba3fb..00000000 --- a/trunk/vendor/league/flysystem/src/Util/MimeType.php +++ /dev/null @@ -1,80 +0,0 @@ -detectMimeTypeFromBuffer($content); - } - - return 'text/plain'; - } - - /** - * Detects MIME Type based on file extension. - * - * @param string $extension - * - * @return string MIME Type - */ - public static function detectByFileExtension($extension) - { - return static::detector()->detectMimeTypeFromPath('artificial.' . $extension) ?: 'text/plain'; - } - - /** - * @param string $filename - * - * @return string MIME Type - */ - public static function detectByFilename($filename) - { - return static::detector()->detectMimeTypeFromPath($filename) ?: 'text/plain'; - } - - /** - * @return array Map of file extension to MIME Type - */ - public static function getExtensionToMimeTypeMap() - { - return static::$extensionToMimeTypeMap; - } -} diff --git a/trunk/vendor/league/flysystem/src/Util/StreamHasher.php b/trunk/vendor/league/flysystem/src/Util/StreamHasher.php deleted file mode 100644 index 938ec5db..00000000 --- a/trunk/vendor/league/flysystem/src/Util/StreamHasher.php +++ /dev/null @@ -1,36 +0,0 @@ -algo = $algo; - } - - /** - * @param resource $resource - * - * @return string - */ - public function hash($resource) - { - rewind($resource); - $context = hash_init($this->algo); - hash_update_stream($context, $resource); - fclose($resource); - - return hash_final($context); - } -} diff --git a/trunk/vendor/league/mime-type-detection/CHANGELOG.md b/trunk/vendor/league/mime-type-detection/CHANGELOG.md deleted file mode 100644 index a45872a9..00000000 --- a/trunk/vendor/league/mime-type-detection/CHANGELOG.md +++ /dev/null @@ -1,59 +0,0 @@ -# Changelog - -## 1.15.0 - 2024-01-28 - -- Updated lookup - -## 1.14.0 - 2022-10-17 - -### Updated - -- Updated lookup - -## 1.13.0 - 2023-08-05 - -### Added - -- A reverse lookup mechanism to fetch one or all extensions for a given mimetype - -## 1.12.0 - 2023-08-03 - -### Updated - -- Updated lookup - -## 1.11.0 - 2023-04-17 - -### Updated - -- Updated lookup - -## 1.10.0 - 2022-04-11 - -### Fixed - -- Added Flysystem v1 inconclusive mime-types and made it configurable as a constructor parameter. - -## 1.9.0 - 2021-11-21 - -### Updated - -- Updated lookup - -## 1.8.0 - 2021-09-25 - -### Added - -- Added the decorator `OverridingExtensionToMimeTypeMap` which allows you to override values. - -## 1.7.0 - 2021-01-18 - -### Added - -- Added a `bufferSampleSize` parameter to the `FinfoMimeTypeDetector` class that allows you to send a reduced content sample which costs less memory. - -## 1.6.0 - 2021-01-18 - -### Changes - -- Updated generated mime-type map diff --git a/trunk/vendor/league/mime-type-detection/LICENSE b/trunk/vendor/league/mime-type-detection/LICENSE deleted file mode 100644 index 39d50b5e..00000000 --- a/trunk/vendor/league/mime-type-detection/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2023 Frank de Jonge - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php b/trunk/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php deleted file mode 100644 index fc042416..00000000 --- a/trunk/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php +++ /dev/null @@ -1,13 +0,0 @@ -extensions = $extensions ?: new GeneratedExtensionToMimeTypeMap(); - } - - public function detectMimeType(string $path, $contents): ?string - { - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromPath(string $path): ?string - { - $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); - - return $this->extensions->lookupMimeType($extension); - } - - public function detectMimeTypeFromFile(string $path): ?string - { - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromBuffer(string $contents): ?string - { - return null; - } - - public function lookupExtension(string $mimetype): ?string - { - return $this->extensions instanceof ExtensionLookup - ? $this->extensions->lookupExtension($mimetype) - : null; - } - - public function lookupAllExtensions(string $mimetype): array - { - return $this->extensions instanceof ExtensionLookup - ? $this->extensions->lookupAllExtensions($mimetype) - : []; - } -} diff --git a/trunk/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php b/trunk/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php deleted file mode 100644 index 1dad7bc1..00000000 --- a/trunk/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php +++ /dev/null @@ -1,10 +0,0 @@ - - */ - private $inconclusiveMimetypes; - - public function __construct( - string $magicFile = '', - ExtensionToMimeTypeMap $extensionMap = null, - ?int $bufferSampleSize = null, - array $inconclusiveMimetypes = self::INCONCLUSIVE_MIME_TYPES - ) { - $this->finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile); - $this->extensionMap = $extensionMap ?: new GeneratedExtensionToMimeTypeMap(); - $this->bufferSampleSize = $bufferSampleSize; - $this->inconclusiveMimetypes = $inconclusiveMimetypes; - } - - public function detectMimeType(string $path, $contents): ?string - { - $mimeType = is_string($contents) - ? (@$this->finfo->buffer($this->takeSample($contents)) ?: null) - : null; - - if ($mimeType !== null && ! in_array($mimeType, $this->inconclusiveMimetypes)) { - return $mimeType; - } - - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromPath(string $path): ?string - { - $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); - - return $this->extensionMap->lookupMimeType($extension); - } - - public function detectMimeTypeFromFile(string $path): ?string - { - return @$this->finfo->file($path) ?: null; - } - - public function detectMimeTypeFromBuffer(string $contents): ?string - { - return @$this->finfo->buffer($this->takeSample($contents)) ?: null; - } - - private function takeSample(string $contents): string - { - if ($this->bufferSampleSize === null) { - return $contents; - } - - return (string) substr($contents, 0, $this->bufferSampleSize); - } - - public function lookupExtension(string $mimetype): ?string - { - return $this->extensionMap instanceof ExtensionLookup - ? $this->extensionMap->lookupExtension($mimetype) - : null; - } - - public function lookupAllExtensions(string $mimetype): array - { - return $this->extensionMap instanceof ExtensionLookup - ? $this->extensionMap->lookupAllExtensions($mimetype) - : []; - } -} diff --git a/trunk/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php b/trunk/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php deleted file mode 100644 index 1ce17911..00000000 --- a/trunk/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php +++ /dev/null @@ -1,2298 +0,0 @@ - - * - * @internal - */ - public const MIME_TYPES_FOR_EXTENSIONS = [ - '1km' => 'application/vnd.1000minds.decision-model+xml', - '3dml' => 'text/vnd.in3d.3dml', - '3ds' => 'image/x-3ds', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gp', - '3gpp' => 'video/3gpp', - '3mf' => 'model/3mf', - '7z' => 'application/x-7z-compressed', - '7zip' => 'application/x-7z-compressed', - '123' => 'application/vnd.lotus-1-2-3', - 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/acc', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abw' => 'application/x-abiword', - 'ac' => 'application/vnd.nokia.n-gage.ac+xml', - 'ac3' => 'audio/ac3', - 'acc' => 'application/vnd.americandynamics.acc', - 'ace' => 'application/x-ace-compressed', - 'acu' => 'application/vnd.acucobol', - 'acutc' => 'application/vnd.acucorp', - 'adp' => 'audio/adpcm', - 'adts' => 'audio/aac', - 'aep' => 'application/vnd.audiograph', - 'afm' => 'application/x-font-type1', - 'afp' => 'application/vnd.ibm.modcap', - 'age' => 'application/vnd.age', - 'ahead' => 'application/vnd.ahead.space', - 'ai' => 'application/pdf', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'air' => 'application/vnd.adobe.air-application-installer-package+zip', - 'ait' => 'application/vnd.dvb.ait', - 'ami' => 'application/vnd.amiga.ami', - 'aml' => 'application/automationml-aml+xml', - 'amlx' => 'application/automationml-amlx+zip', - 'amr' => 'audio/amr', - 'apk' => 'application/vnd.android.package-archive', - 'apng' => 'image/apng', - 'appcache' => 'text/cache-manifest', - 'appinstaller' => 'application/appinstaller', - 'application' => 'application/x-ms-application', - 'appx' => 'application/appx', - 'appxbundle' => 'application/appxbundle', - 'apr' => 'application/vnd.lotus-approach', - 'arc' => 'application/x-freearc', - 'arj' => 'application/x-arj', - 'asc' => 'application/pgp-signature', - 'asf' => 'video/x-ms-asf', - 'asm' => 'text/x-asm', - 'aso' => 'application/vnd.accpac.simply.aso', - 'asx' => 'video/x-ms-asf', - 'atc' => 'application/vnd.acucorp', - 'atom' => 'application/atom+xml', - 'atomcat' => 'application/atomcat+xml', - 'atomdeleted' => 'application/atomdeleted+xml', - 'atomsvc' => 'application/atomsvc+xml', - 'atx' => 'application/vnd.antix.game-component', - 'au' => 'audio/x-au', - 'avci' => 'image/avci', - 'avcs' => 'image/avcs', - 'avi' => 'video/x-msvideo', - 'avif' => 'image/avif', - 'aw' => 'application/applixware', - 'azf' => 'application/vnd.airzip.filesecure.azf', - 'azs' => 'application/vnd.airzip.filesecure.azs', - 'azv' => 'image/vnd.airzip.accelerator.azv', - 'azw' => 'application/vnd.amazon.ebook', - 'b16' => 'image/vnd.pco.b16', - 'bat' => 'application/x-msdownload', - 'bcpio' => 'application/x-bcpio', - 'bdf' => 'application/x-font-bdf', - 'bdm' => 'application/vnd.syncml.dm+wbxml', - 'bdoc' => 'application/x-bdoc', - 'bed' => 'application/vnd.realvnc.bed', - 'bh2' => 'application/vnd.fujitsu.oasysprs', - 'bin' => 'application/octet-stream', - 'blb' => 'application/x-blorb', - 'blorb' => 'application/x-blorb', - 'bmi' => 'application/vnd.bmi', - 'bmml' => 'application/vnd.balsamiq.bmml+xml', - 'bmp' => 'image/bmp', - 'book' => 'application/vnd.framemaker', - 'box' => 'application/vnd.previewsystems.box', - 'boz' => 'application/x-bzip2', - 'bpk' => 'application/octet-stream', - 'bpmn' => 'application/octet-stream', - 'brf' => 'application/braille', - 'bsp' => 'model/vnd.valve.source.compiled-map', - 'btf' => 'image/prs.btif', - 'btif' => 'image/prs.btif', - 'buffer' => 'application/octet-stream', - 'bz' => 'application/x-bzip', - 'bz2' => 'application/x-bzip2', - 'c' => 'text/x-c', - 'c4d' => 'application/vnd.clonk.c4group', - 'c4f' => 'application/vnd.clonk.c4group', - 'c4g' => 'application/vnd.clonk.c4group', - 'c4p' => 'application/vnd.clonk.c4group', - 'c4u' => 'application/vnd.clonk.c4group', - 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', - 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', - 'cab' => 'application/vnd.ms-cab-compressed', - 'caf' => 'audio/x-caf', - 'cap' => 'application/vnd.tcpdump.pcap', - 'car' => 'application/vnd.curl.car', - 'cat' => 'application/vnd.ms-pki.seccat', - 'cb7' => 'application/x-cbr', - 'cba' => 'application/x-cbr', - 'cbr' => 'application/x-cbr', - 'cbt' => 'application/x-cbr', - 'cbz' => 'application/x-cbr', - 'cc' => 'text/x-c', - 'cco' => 'application/x-cocoa', - 'cct' => 'application/x-director', - 'ccxml' => 'application/ccxml+xml', - 'cdbcmsg' => 'application/vnd.contact.cmsg', - 'cdf' => 'application/x-netcdf', - 'cdfx' => 'application/cdfx+xml', - 'cdkey' => 'application/vnd.mediastation.cdkey', - 'cdmia' => 'application/cdmi-capability', - 'cdmic' => 'application/cdmi-container', - 'cdmid' => 'application/cdmi-domain', - 'cdmio' => 'application/cdmi-object', - 'cdmiq' => 'application/cdmi-queue', - 'cdr' => 'application/cdr', - 'cdx' => 'chemical/x-cdx', - 'cdxml' => 'application/vnd.chemdraw+xml', - 'cdy' => 'application/vnd.cinderella', - 'cer' => 'application/pkix-cert', - 'cfs' => 'application/x-cfs-compressed', - 'cgm' => 'image/cgm', - 'chat' => 'application/x-chat', - 'chm' => 'application/vnd.ms-htmlhelp', - 'chrt' => 'application/vnd.kde.kchart', - 'cif' => 'chemical/x-cif', - 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', - 'cil' => 'application/vnd.ms-artgalry', - 'cjs' => 'application/node', - 'cla' => 'application/vnd.claymore', - 'class' => 'application/octet-stream', - 'cld' => 'model/vnd.cld', - 'clkk' => 'application/vnd.crick.clicker.keyboard', - 'clkp' => 'application/vnd.crick.clicker.palette', - 'clkt' => 'application/vnd.crick.clicker.template', - 'clkw' => 'application/vnd.crick.clicker.wordbank', - 'clkx' => 'application/vnd.crick.clicker', - 'clp' => 'application/x-msclip', - 'cmc' => 'application/vnd.cosmocaller', - 'cmdf' => 'chemical/x-cmdf', - 'cml' => 'chemical/x-cml', - 'cmp' => 'application/vnd.yellowriver-custom-menu', - 'cmx' => 'image/x-cmx', - 'cod' => 'application/vnd.rim.cod', - 'coffee' => 'text/coffeescript', - 'com' => 'application/x-msdownload', - 'conf' => 'text/plain', - 'cpio' => 'application/x-cpio', - 'cpl' => 'application/cpl+xml', - 'cpp' => 'text/x-c', - 'cpt' => 'application/mac-compactpro', - 'crd' => 'application/x-mscardfile', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'crx' => 'application/x-chrome-extension', - 'cryptonote' => 'application/vnd.rig.cryptonote', - 'csh' => 'application/x-csh', - 'csl' => 'application/vnd.citationstyles.style+xml', - 'csml' => 'chemical/x-csml', - 'csp' => 'application/vnd.commonspace', - 'csr' => 'application/octet-stream', - 'css' => 'text/css', - 'cst' => 'application/x-director', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'curl' => 'text/vnd.curl', - 'cwl' => 'application/cwl', - 'cww' => 'application/prs.cww', - 'cxt' => 'application/x-director', - 'cxx' => 'text/x-c', - 'dae' => 'model/vnd.collada+xml', - 'daf' => 'application/vnd.mobius.daf', - 'dart' => 'application/vnd.dart', - 'dataless' => 'application/vnd.fdsn.seed', - 'davmount' => 'application/davmount+xml', - 'dbf' => 'application/vnd.dbf', - 'dbk' => 'application/docbook+xml', - 'dcr' => 'application/x-director', - 'dcurl' => 'text/vnd.curl.dcurl', - 'dd2' => 'application/vnd.oma.dd2+xml', - 'ddd' => 'application/vnd.fujixerox.ddd', - 'ddf' => 'application/vnd.syncml.dmddf+xml', - 'dds' => 'image/vnd.ms-dds', - 'deb' => 'application/x-debian-package', - 'def' => 'text/plain', - 'deploy' => 'application/octet-stream', - 'der' => 'application/x-x509-ca-cert', - 'dfac' => 'application/vnd.dreamfactory', - 'dgc' => 'application/x-dgc-compressed', - 'dib' => 'image/bmp', - 'dic' => 'text/x-c', - 'dir' => 'application/x-director', - 'dis' => 'application/vnd.mobius.dis', - 'disposition-notification' => 'message/disposition-notification', - 'dist' => 'application/octet-stream', - 'distz' => 'application/octet-stream', - 'djv' => 'image/vnd.djvu', - 'djvu' => 'image/vnd.djvu', - 'dll' => 'application/octet-stream', - 'dmg' => 'application/x-apple-diskimage', - 'dmn' => 'application/octet-stream', - 'dmp' => 'application/vnd.tcpdump.pcap', - 'dms' => 'application/octet-stream', - 'dna' => 'application/vnd.dna', - 'doc' => 'application/msword', - 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dot' => 'application/msword', - 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dp' => 'application/vnd.osgi.dp', - 'dpg' => 'application/vnd.dpgraph', - 'dpx' => 'image/dpx', - 'dra' => 'audio/vnd.dra', - 'drle' => 'image/dicom-rle', - 'dsc' => 'text/prs.lines.tag', - 'dssc' => 'application/dssc+der', - 'dst' => 'application/octet-stream', - 'dtb' => 'application/x-dtbook+xml', - 'dtd' => 'application/xml-dtd', - 'dts' => 'audio/vnd.dts', - 'dtshd' => 'audio/vnd.dts.hd', - 'dump' => 'application/octet-stream', - 'dvb' => 'video/vnd.dvb.file', - 'dvi' => 'application/x-dvi', - 'dwd' => 'application/atsc-dwd+xml', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/vnd.dwg', - 'dxf' => 'image/vnd.dxf', - 'dxp' => 'application/vnd.spotfire.dxp', - 'dxr' => 'application/x-director', - 'ear' => 'application/java-archive', - 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', - 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', - 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', - 'ecma' => 'application/ecmascript', - 'edm' => 'application/vnd.novadigm.edm', - 'edx' => 'application/vnd.novadigm.edx', - 'efif' => 'application/vnd.picsel', - 'ei6' => 'application/vnd.pg.osasli', - 'elc' => 'application/octet-stream', - 'emf' => 'image/emf', - 'eml' => 'message/rfc822', - 'emma' => 'application/emma+xml', - 'emotionml' => 'application/emotionml+xml', - 'emz' => 'application/x-msmetafile', - 'eol' => 'audio/vnd.digital-winds', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'es3' => 'application/vnd.eszigno3+xml', - 'esa' => 'application/vnd.osgi.subsystem', - 'esf' => 'application/vnd.epson.esf', - 'et3' => 'application/vnd.eszigno3+xml', - 'etx' => 'text/x-setext', - 'eva' => 'application/x-eva', - 'evy' => 'application/x-envoy', - 'exe' => 'application/octet-stream', - 'exi' => 'application/exi', - 'exp' => 'application/express', - 'exr' => 'image/aces', - 'ext' => 'application/vnd.novadigm.ext', - 'ez' => 'application/andrew-inset', - 'ez2' => 'application/vnd.ezpix-album', - 'ez3' => 'application/vnd.ezpix-package', - 'f' => 'text/x-fortran', - 'f4v' => 'video/mp4', - 'f77' => 'text/x-fortran', - 'f90' => 'text/x-fortran', - 'fbs' => 'image/vnd.fastbidsheet', - 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', - 'fcs' => 'application/vnd.isac.fcs', - 'fdf' => 'application/vnd.fdf', - 'fdt' => 'application/fdt+xml', - 'fe_launch' => 'application/vnd.denovo.fcselayout-link', - 'fg5' => 'application/vnd.fujitsu.oasysgp', - 'fgd' => 'application/x-director', - 'fh' => 'image/x-freehand', - 'fh4' => 'image/x-freehand', - 'fh5' => 'image/x-freehand', - 'fh7' => 'image/x-freehand', - 'fhc' => 'image/x-freehand', - 'fig' => 'application/x-xfig', - 'fits' => 'image/fits', - 'flac' => 'audio/x-flac', - 'fli' => 'video/x-fli', - 'flo' => 'application/vnd.micrografx.flo', - 'flv' => 'video/x-flv', - 'flw' => 'application/vnd.kde.kivio', - 'flx' => 'text/vnd.fmi.flexstor', - 'fly' => 'text/vnd.fly', - 'fm' => 'application/vnd.framemaker', - 'fnc' => 'application/vnd.frogans.fnc', - 'fo' => 'application/vnd.software602.filler.form+xml', - 'for' => 'text/x-fortran', - 'fpx' => 'image/vnd.fpx', - 'frame' => 'application/vnd.framemaker', - 'fsc' => 'application/vnd.fsc.weblaunch', - 'fst' => 'image/vnd.fst', - 'ftc' => 'application/vnd.fluxtime.clip', - 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', - 'fvt' => 'video/vnd.fvt', - 'fxp' => 'application/vnd.adobe.fxp', - 'fxpl' => 'application/vnd.adobe.fxp', - 'fzs' => 'application/vnd.fuzzysheet', - 'g2w' => 'application/vnd.geoplan', - 'g3' => 'image/g3fax', - 'g3w' => 'application/vnd.geospace', - 'gac' => 'application/vnd.groove-account', - 'gam' => 'application/x-tads', - 'gbr' => 'application/rpki-ghostbusters', - 'gca' => 'application/x-gca-compressed', - 'gdl' => 'model/vnd.gdl', - 'gdoc' => 'application/vnd.google-apps.document', - 'ged' => 'text/vnd.familysearch.gedcom', - 'geo' => 'application/vnd.dynageo', - 'geojson' => 'application/geo+json', - 'gex' => 'application/vnd.geometry-explorer', - 'ggb' => 'application/vnd.geogebra.file', - 'ggt' => 'application/vnd.geogebra.tool', - 'ghf' => 'application/vnd.groove-help', - 'gif' => 'image/gif', - 'gim' => 'application/vnd.groove-identity-message', - 'glb' => 'model/gltf-binary', - 'gltf' => 'model/gltf+json', - 'gml' => 'application/gml+xml', - 'gmx' => 'application/vnd.gmx', - 'gnumeric' => 'application/x-gnumeric', - 'gpg' => 'application/gpg-keys', - 'gph' => 'application/vnd.flographit', - 'gpx' => 'application/gpx+xml', - 'gqf' => 'application/vnd.grafeq', - 'gqs' => 'application/vnd.grafeq', - 'gram' => 'application/srgs', - 'gramps' => 'application/x-gramps-xml', - 'gre' => 'application/vnd.geometry-explorer', - 'grv' => 'application/vnd.groove-injector', - 'grxml' => 'application/srgs+xml', - 'gsf' => 'application/x-font-ghostscript', - 'gsheet' => 'application/vnd.google-apps.spreadsheet', - 'gslides' => 'application/vnd.google-apps.presentation', - 'gtar' => 'application/x-gtar', - 'gtm' => 'application/vnd.groove-tool-message', - 'gtw' => 'model/vnd.gtw', - 'gv' => 'text/vnd.graphviz', - 'gxf' => 'application/gxf', - 'gxt' => 'application/vnd.geonext', - 'gz' => 'application/gzip', - 'gzip' => 'application/gzip', - 'h' => 'text/x-c', - 'h261' => 'video/h261', - 'h263' => 'video/h263', - 'h264' => 'video/h264', - 'hal' => 'application/vnd.hal+xml', - 'hbci' => 'application/vnd.hbci', - 'hbs' => 'text/x-handlebars-template', - 'hdd' => 'application/x-virtualbox-hdd', - 'hdf' => 'application/x-hdf', - 'heic' => 'image/heic', - 'heics' => 'image/heic-sequence', - 'heif' => 'image/heif', - 'heifs' => 'image/heif-sequence', - 'hej2' => 'image/hej2k', - 'held' => 'application/atsc-held+xml', - 'hh' => 'text/x-c', - 'hjson' => 'application/hjson', - 'hlp' => 'application/winhlp', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hpid' => 'application/vnd.hp-hpid', - 'hps' => 'application/vnd.hp-hps', - 'hqx' => 'application/mac-binhex40', - 'hsj2' => 'image/hsj2', - 'htc' => 'text/x-component', - 'htke' => 'application/vnd.kenameaapp', - 'htm' => 'text/html', - 'html' => 'text/html', - 'hvd' => 'application/vnd.yamaha.hv-dic', - 'hvp' => 'application/vnd.yamaha.hv-voice', - 'hvs' => 'application/vnd.yamaha.hv-script', - 'i2g' => 'application/vnd.intergeo', - 'icc' => 'application/vnd.iccprofile', - 'ice' => 'x-conference/x-cooltalk', - 'icm' => 'application/vnd.iccprofile', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ief' => 'image/ief', - 'ifb' => 'text/calendar', - 'ifm' => 'application/vnd.shana.informed.formdata', - 'iges' => 'model/iges', - 'igl' => 'application/vnd.igloader', - 'igm' => 'application/vnd.insors.igm', - 'igs' => 'model/iges', - 'igx' => 'application/vnd.micrografx.igx', - 'iif' => 'application/vnd.shana.informed.interchange', - 'img' => 'application/octet-stream', - 'imp' => 'application/vnd.accpac.simply.imp', - 'ims' => 'application/vnd.ms-ims', - 'in' => 'text/plain', - 'ini' => 'text/plain', - 'ink' => 'application/inkml+xml', - 'inkml' => 'application/inkml+xml', - 'install' => 'application/x-install-instructions', - 'iota' => 'application/vnd.astraea-software.iota', - 'ipfix' => 'application/ipfix', - 'ipk' => 'application/vnd.shana.informed.package', - 'irm' => 'application/vnd.ibm.rights-management', - 'irp' => 'application/vnd.irepository.package+xml', - 'iso' => 'application/x-iso9660-image', - 'itp' => 'application/vnd.shana.informed.formtemplate', - 'its' => 'application/its+xml', - 'ivp' => 'application/vnd.immervision-ivp', - 'ivu' => 'application/vnd.immervision-ivu', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'jade' => 'text/jade', - 'jam' => 'application/vnd.jam', - 'jar' => 'application/java-archive', - 'jardiff' => 'application/x-java-archive-diff', - 'java' => 'text/x-java-source', - 'jhc' => 'image/jphc', - 'jisp' => 'application/vnd.jisp', - 'jls' => 'image/jls', - 'jlt' => 'application/vnd.hp-jlyt', - 'jng' => 'image/x-jng', - 'jnlp' => 'application/x-java-jnlp-file', - 'joda' => 'application/vnd.joost.joda-archive', - 'jp2' => 'image/jp2', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpf' => 'image/jpx', - 'jpg' => 'image/jpeg', - 'jpg2' => 'image/jp2', - 'jpgm' => 'video/jpm', - 'jpgv' => 'video/jpeg', - 'jph' => 'image/jph', - 'jpm' => 'video/jpm', - 'jpx' => 'image/jpx', - 'js' => 'application/javascript', - 'json' => 'application/json', - 'json5' => 'application/json5', - 'jsonld' => 'application/ld+json', - 'jsonml' => 'application/jsonml+json', - 'jsx' => 'text/jsx', - 'jt' => 'model/jt', - 'jxr' => 'image/jxr', - 'jxra' => 'image/jxra', - 'jxrs' => 'image/jxrs', - 'jxs' => 'image/jxs', - 'jxsc' => 'image/jxsc', - 'jxsi' => 'image/jxsi', - 'jxss' => 'image/jxss', - 'kar' => 'audio/midi', - 'karbon' => 'application/vnd.kde.karbon', - 'kdb' => 'application/octet-stream', - 'kdbx' => 'application/x-keepass2', - 'key' => 'application/x-iwork-keynote-sffkey', - 'kfo' => 'application/vnd.kde.kformula', - 'kia' => 'application/vnd.kidspiration', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kne' => 'application/vnd.kinar', - 'knp' => 'application/vnd.kinar', - 'kon' => 'application/vnd.kde.kontour', - 'kpr' => 'application/vnd.kde.kpresenter', - 'kpt' => 'application/vnd.kde.kpresenter', - 'kpxx' => 'application/vnd.ds-keypoint', - 'ksp' => 'application/vnd.kde.kspread', - 'ktr' => 'application/vnd.kahootz', - 'ktx' => 'image/ktx', - 'ktx2' => 'image/ktx2', - 'ktz' => 'application/vnd.kahootz', - 'kwd' => 'application/vnd.kde.kword', - 'kwt' => 'application/vnd.kde.kword', - 'lasxml' => 'application/vnd.las.las+xml', - 'latex' => 'application/x-latex', - 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', - 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', - 'les' => 'application/vnd.hhe.lesson-player', - 'less' => 'text/less', - 'lgr' => 'application/lgr+xml', - 'lha' => 'application/octet-stream', - 'link66' => 'application/vnd.route66.link66+xml', - 'list' => 'text/plain', - 'list3820' => 'application/vnd.ibm.modcap', - 'listafp' => 'application/vnd.ibm.modcap', - 'litcoffee' => 'text/coffeescript', - 'lnk' => 'application/x-ms-shortcut', - 'log' => 'text/plain', - 'lostxml' => 'application/lost+xml', - 'lrf' => 'application/octet-stream', - 'lrm' => 'application/vnd.ms-lrm', - 'ltf' => 'application/vnd.frogans.ltf', - 'lua' => 'text/x-lua', - 'luac' => 'application/x-lua-bytecode', - 'lvp' => 'audio/vnd.lucent.voice', - 'lwp' => 'application/vnd.lotus-wordpro', - 'lzh' => 'application/octet-stream', - 'm1v' => 'video/mpeg', - 'm2a' => 'audio/mpeg', - 'm2v' => 'video/mpeg', - 'm3a' => 'audio/mpeg', - 'm3u' => 'text/plain', - 'm3u8' => 'application/vnd.apple.mpegurl', - 'm4a' => 'audio/x-m4a', - 'm4p' => 'application/mp4', - 'm4s' => 'video/iso.segment', - 'm4u' => 'application/vnd.mpegurl', - 'm4v' => 'video/x-m4v', - 'm13' => 'application/x-msmediaview', - 'm14' => 'application/x-msmediaview', - 'm21' => 'application/mp21', - 'ma' => 'application/mathematica', - 'mads' => 'application/mads+xml', - 'maei' => 'application/mmt-aei+xml', - 'mag' => 'application/vnd.ecowin.chart', - 'maker' => 'application/vnd.framemaker', - 'man' => 'text/troff', - 'manifest' => 'text/cache-manifest', - 'map' => 'application/json', - 'mar' => 'application/octet-stream', - 'markdown' => 'text/markdown', - 'mathml' => 'application/mathml+xml', - 'mb' => 'application/mathematica', - 'mbk' => 'application/vnd.mobius.mbk', - 'mbox' => 'application/mbox', - 'mc1' => 'application/vnd.medcalcdata', - 'mcd' => 'application/vnd.mcd', - 'mcurl' => 'text/vnd.curl.mcurl', - 'md' => 'text/markdown', - 'mdb' => 'application/x-msaccess', - 'mdi' => 'image/vnd.ms-modi', - 'mdx' => 'text/mdx', - 'me' => 'text/troff', - 'mesh' => 'model/mesh', - 'meta4' => 'application/metalink4+xml', - 'metalink' => 'application/metalink+xml', - 'mets' => 'application/mets+xml', - 'mfm' => 'application/vnd.mfmp', - 'mft' => 'application/rpki-manifest', - 'mgp' => 'application/vnd.osgeo.mapguide.package', - 'mgz' => 'application/vnd.proteus.magazine', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mie' => 'application/x-mie', - 'mif' => 'application/vnd.mif', - 'mime' => 'message/rfc822', - 'mj2' => 'video/mj2', - 'mjp2' => 'video/mj2', - 'mjs' => 'text/javascript', - 'mk3d' => 'video/x-matroska', - 'mka' => 'audio/x-matroska', - 'mkd' => 'text/x-markdown', - 'mks' => 'video/x-matroska', - 'mkv' => 'video/x-matroska', - 'mlp' => 'application/vnd.dolby.mlp', - 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', - 'mmf' => 'application/vnd.smaf', - 'mml' => 'text/mathml', - 'mmr' => 'image/vnd.fujixerox.edmics-mmr', - 'mng' => 'video/x-mng', - 'mny' => 'application/x-msmoney', - 'mobi' => 'application/x-mobipocket-ebook', - 'mods' => 'application/mods+xml', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp2a' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4s' => 'application/mp4', - 'mp4v' => 'video/mp4', - 'mp21' => 'application/mp21', - 'mpc' => 'application/vnd.mophun.certificate', - 'mpd' => 'application/dash+xml', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpf' => 'application/media-policy-dataset+xml', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'mpga' => 'audio/mpeg', - 'mpkg' => 'application/vnd.apple.installer+xml', - 'mpm' => 'application/vnd.blueice.multipass', - 'mpn' => 'application/vnd.mophun.application', - 'mpp' => 'application/vnd.ms-project', - 'mpt' => 'application/vnd.ms-project', - 'mpy' => 'application/vnd.ibm.minipay', - 'mqy' => 'application/vnd.mobius.mqy', - 'mrc' => 'application/marc', - 'mrcx' => 'application/marcxml+xml', - 'ms' => 'text/troff', - 'mscml' => 'application/mediaservercontrol+xml', - 'mseed' => 'application/vnd.fdsn.mseed', - 'mseq' => 'application/vnd.mseq', - 'msf' => 'application/vnd.epson.msf', - 'msg' => 'application/vnd.ms-outlook', - 'msh' => 'model/mesh', - 'msi' => 'application/x-msdownload', - 'msix' => 'application/msix', - 'msixbundle' => 'application/msixbundle', - 'msl' => 'application/vnd.mobius.msl', - 'msm' => 'application/octet-stream', - 'msp' => 'application/octet-stream', - 'msty' => 'application/vnd.muvee.style', - 'mtl' => 'model/mtl', - 'mts' => 'model/vnd.mts', - 'mus' => 'application/vnd.musician', - 'musd' => 'application/mmt-usd+xml', - 'musicxml' => 'application/vnd.recordare.musicxml+xml', - 'mvb' => 'application/x-msmediaview', - 'mvt' => 'application/vnd.mapbox-vector-tile', - 'mwf' => 'application/vnd.mfer', - 'mxf' => 'application/mxf', - 'mxl' => 'application/vnd.recordare.musicxml', - 'mxmf' => 'audio/mobile-xmf', - 'mxml' => 'application/xv+xml', - 'mxs' => 'application/vnd.triscape.mxs', - 'mxu' => 'video/vnd.mpegurl', - 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', - 'n3' => 'text/n3', - 'nb' => 'application/mathematica', - 'nbp' => 'application/vnd.wolfram.player', - 'nc' => 'application/x-netcdf', - 'ncx' => 'application/x-dtbncx+xml', - 'ndjson' => 'application/x-ndjson', - 'nfo' => 'text/x-nfo', - 'ngdat' => 'application/vnd.nokia.n-gage.data', - 'nitf' => 'application/vnd.nitf', - 'nlu' => 'application/vnd.neurolanguage.nlu', - 'nml' => 'application/vnd.enliven', - 'nnd' => 'application/vnd.noblenet-directory', - 'nns' => 'application/vnd.noblenet-sealer', - 'nnw' => 'application/vnd.noblenet-web', - 'npx' => 'image/vnd.net-fpx', - 'nq' => 'application/n-quads', - 'nsc' => 'application/x-conference', - 'nsf' => 'application/vnd.lotus-notes', - 'nt' => 'application/n-triples', - 'ntf' => 'application/vnd.nitf', - 'numbers' => 'application/x-iwork-numbers-sffnumbers', - 'nzb' => 'application/x-nzb', - 'oa2' => 'application/vnd.fujitsu.oasys2', - 'oa3' => 'application/vnd.fujitsu.oasys3', - 'oas' => 'application/vnd.fujitsu.oasys', - 'obd' => 'application/x-msbinder', - 'obgx' => 'application/vnd.openblox.game+xml', - 'obj' => 'model/obj', - 'oda' => 'application/oda', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odft' => 'application/vnd.oasis.opendocument.formula-template', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'oga' => 'audio/ogg', - 'ogex' => 'model/vnd.opengex', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'omdoc' => 'application/omdoc+xml', - 'onepkg' => 'application/onenote', - 'onetmp' => 'application/onenote', - 'onetoc' => 'application/onenote', - 'onetoc2' => 'application/onenote', - 'opf' => 'application/oebps-package+xml', - 'opml' => 'text/x-opml', - 'oprc' => 'application/vnd.palm', - 'opus' => 'audio/ogg', - 'org' => 'text/x-org', - 'osf' => 'application/vnd.yamaha.openscoreformat', - 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', - 'osm' => 'application/vnd.openstreetmap.data+xml', - 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => 'font/otf', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'oti' => 'application/vnd.oasis.opendocument.image-template', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'ova' => 'application/x-virtualbox-ova', - 'ovf' => 'application/x-virtualbox-ovf', - 'owl' => 'application/rdf+xml', - 'oxps' => 'application/oxps', - 'oxt' => 'application/vnd.openofficeorg.extension', - 'p' => 'text/x-pascal', - 'p7a' => 'application/x-pkcs7-signature', - 'p7b' => 'application/x-pkcs7-certificates', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'p8' => 'application/pkcs8', - 'p10' => 'application/x-pkcs10', - 'p12' => 'application/x-pkcs12', - 'pac' => 'application/x-ns-proxy-autoconfig', - 'pages' => 'application/x-iwork-pages-sffpages', - 'pas' => 'text/x-pascal', - 'paw' => 'application/vnd.pawaafile', - 'pbd' => 'application/vnd.powerbuilder6', - 'pbm' => 'image/x-portable-bitmap', - 'pcap' => 'application/vnd.tcpdump.pcap', - 'pcf' => 'application/x-font-pcf', - 'pcl' => 'application/vnd.hp-pcl', - 'pclxl' => 'application/vnd.hp-pclxl', - 'pct' => 'image/x-pict', - 'pcurl' => 'application/vnd.curl.pcurl', - 'pcx' => 'image/x-pcx', - 'pdb' => 'application/x-pilot', - 'pde' => 'text/x-processing', - 'pdf' => 'application/pdf', - 'pem' => 'application/x-x509-user-cert', - 'pfa' => 'application/x-font-type1', - 'pfb' => 'application/x-font-type1', - 'pfm' => 'application/x-font-type1', - 'pfr' => 'application/font-tdpfr', - 'pfx' => 'application/x-pkcs12', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pgp' => 'application/pgp', - 'phar' => 'application/octet-stream', - 'php' => 'application/x-httpd-php', - 'php3' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'phtml' => 'application/x-httpd-php', - 'pic' => 'image/x-pict', - 'pkg' => 'application/octet-stream', - 'pki' => 'application/pkixcmp', - 'pkipath' => 'application/pkix-pkipath', - 'pkpass' => 'application/vnd.apple.pkpass', - 'pl' => 'application/x-perl', - 'plb' => 'application/vnd.3gpp.pic-bw-large', - 'plc' => 'application/vnd.mobius.plc', - 'plf' => 'application/vnd.pocketlearn', - 'pls' => 'application/pls+xml', - 'pm' => 'application/x-perl', - 'pml' => 'application/vnd.ctc-posml', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'portpkg' => 'application/vnd.macports.portpkg', - 'pot' => 'application/vnd.ms-powerpoint', - 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppa' => 'application/vnd.ms-powerpoint', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', - 'ppd' => 'application/vnd.cups-ppd', - 'ppm' => 'image/x-portable-pixmap', - 'pps' => 'application/vnd.ms-powerpoint', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppt' => 'application/powerpoint', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pqa' => 'application/vnd.palm', - 'prc' => 'model/prc', - 'pre' => 'application/vnd.lotus-freelance', - 'prf' => 'application/pics-rules', - 'provx' => 'application/provenance+xml', - 'ps' => 'application/postscript', - 'psb' => 'application/vnd.3gpp.pic-bw-small', - 'psd' => 'application/x-photoshop', - 'psf' => 'application/x-font-linux-psf', - 'pskcxml' => 'application/pskc+xml', - 'pti' => 'image/prs.pti', - 'ptid' => 'application/vnd.pvi.ptid1', - 'pub' => 'application/x-mspublisher', - 'pv' => 'application/octet-stream', - 'pvb' => 'application/vnd.3gpp.pic-bw-var', - 'pwn' => 'application/vnd.3m.post-it-notes', - 'pxf' => 'application/octet-stream', - 'pya' => 'audio/vnd.ms-playready.media.pya', - 'pyo' => 'model/vnd.pytha.pyox', - 'pyox' => 'model/vnd.pytha.pyox', - 'pyv' => 'video/vnd.ms-playready.media.pyv', - 'qam' => 'application/vnd.epson.quickanime', - 'qbo' => 'application/vnd.intu.qbo', - 'qfx' => 'application/vnd.intu.qfx', - 'qps' => 'application/vnd.publishare-delta-tree', - 'qt' => 'video/quicktime', - 'qwd' => 'application/vnd.quark.quarkxpress', - 'qwt' => 'application/vnd.quark.quarkxpress', - 'qxb' => 'application/vnd.quark.quarkxpress', - 'qxd' => 'application/vnd.quark.quarkxpress', - 'qxl' => 'application/vnd.quark.quarkxpress', - 'qxt' => 'application/vnd.quark.quarkxpress', - 'ra' => 'audio/x-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'raml' => 'application/raml+yaml', - 'rapd' => 'application/route-apd+xml', - 'rar' => 'application/x-rar', - 'ras' => 'image/x-cmu-raster', - 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', - 'rdf' => 'application/rdf+xml', - 'rdz' => 'application/vnd.data-vision.rdz', - 'relo' => 'application/p2p-overlay+xml', - 'rep' => 'application/vnd.businessobjects', - 'res' => 'application/x-dtbresource+xml', - 'rgb' => 'image/x-rgb', - 'rif' => 'application/reginfo+xml', - 'rip' => 'audio/vnd.rip', - 'ris' => 'application/x-research-info-systems', - 'rl' => 'application/resource-lists+xml', - 'rlc' => 'image/vnd.fujixerox.edmics-rlc', - 'rld' => 'application/resource-lists-diff+xml', - 'rm' => 'audio/x-pn-realaudio', - 'rmi' => 'audio/midi', - 'rmp' => 'audio/x-pn-realaudio-plugin', - 'rms' => 'application/vnd.jcp.javame.midlet-rms', - 'rmvb' => 'application/vnd.rn-realmedia-vbr', - 'rnc' => 'application/relax-ng-compact-syntax', - 'rng' => 'application/xml', - 'roa' => 'application/rpki-roa', - 'roff' => 'text/troff', - 'rp9' => 'application/vnd.cloanto.rp9', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'rpss' => 'application/vnd.nokia.radio-presets', - 'rpst' => 'application/vnd.nokia.radio-preset', - 'rq' => 'application/sparql-query', - 'rs' => 'application/rls-services+xml', - 'rsa' => 'application/x-pkcs7', - 'rsat' => 'application/atsc-rsat+xml', - 'rsd' => 'application/rsd+xml', - 'rsheet' => 'application/urc-ressheet+xml', - 'rss' => 'application/rss+xml', - 'rtf' => 'text/rtf', - 'rtx' => 'text/richtext', - 'run' => 'application/x-makeself', - 'rusd' => 'application/route-usd+xml', - 'rv' => 'video/vnd.rn-realvideo', - 's' => 'text/x-asm', - 's3m' => 'audio/s3m', - 'saf' => 'application/vnd.yamaha.smaf-audio', - 'sass' => 'text/x-sass', - 'sbml' => 'application/sbml+xml', - 'sc' => 'application/vnd.ibm.secure-container', - 'scd' => 'application/x-msschedule', - 'scm' => 'application/vnd.lotus-screencam', - 'scq' => 'application/scvp-cv-request', - 'scs' => 'application/scvp-cv-response', - 'scss' => 'text/x-scss', - 'scurl' => 'text/vnd.curl.scurl', - 'sda' => 'application/vnd.stardivision.draw', - 'sdc' => 'application/vnd.stardivision.calc', - 'sdd' => 'application/vnd.stardivision.impress', - 'sdkd' => 'application/vnd.solent.sdkm+xml', - 'sdkm' => 'application/vnd.solent.sdkm+xml', - 'sdp' => 'application/sdp', - 'sdw' => 'application/vnd.stardivision.writer', - 'sea' => 'application/octet-stream', - 'see' => 'application/vnd.seemail', - 'seed' => 'application/vnd.fdsn.seed', - 'sema' => 'application/vnd.sema', - 'semd' => 'application/vnd.semd', - 'semf' => 'application/vnd.semf', - 'senmlx' => 'application/senml+xml', - 'sensmlx' => 'application/sensml+xml', - 'ser' => 'application/java-serialized-object', - 'setpay' => 'application/set-payment-initiation', - 'setreg' => 'application/set-registration-initiation', - 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', - 'sfs' => 'application/vnd.spotfire.sfs', - 'sfv' => 'text/x-sfv', - 'sgi' => 'image/sgi', - 'sgl' => 'application/vnd.stardivision.writer-global', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'shex' => 'text/shex', - 'shf' => 'application/shf+xml', - 'shtml' => 'text/html', - 'sid' => 'image/x-mrsid-image', - 'sieve' => 'application/sieve', - 'sig' => 'application/pgp-signature', - 'sil' => 'audio/silk', - 'silo' => 'model/mesh', - 'sis' => 'application/vnd.symbian.install', - 'sisx' => 'application/vnd.symbian.install', - 'sit' => 'application/x-stuffit', - 'sitx' => 'application/x-stuffitx', - 'siv' => 'application/sieve', - 'skd' => 'application/vnd.koan', - 'skm' => 'application/vnd.koan', - 'skp' => 'application/vnd.koan', - 'skt' => 'application/vnd.koan', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'slim' => 'text/slim', - 'slm' => 'text/slim', - 'sls' => 'application/route-s-tsid+xml', - 'slt' => 'application/vnd.epson.salt', - 'sm' => 'application/vnd.stepmania.stepchart', - 'smf' => 'application/vnd.stardivision.math', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'smv' => 'video/x-smv', - 'smzip' => 'application/vnd.stepmania.package', - 'snd' => 'audio/basic', - 'snf' => 'application/x-font-snf', - 'so' => 'application/octet-stream', - 'spc' => 'application/x-pkcs7-certificates', - 'spdx' => 'text/spdx', - 'spf' => 'application/vnd.yamaha.smaf-phrase', - 'spl' => 'application/x-futuresplash', - 'spot' => 'text/vnd.in3d.spot', - 'spp' => 'application/scvp-vp-response', - 'spq' => 'application/scvp-vp-request', - 'spx' => 'audio/ogg', - 'sql' => 'application/x-sql', - 'src' => 'application/x-wais-source', - 'srt' => 'application/x-subrip', - 'sru' => 'application/sru+xml', - 'srx' => 'application/sparql-results+xml', - 'ssdl' => 'application/ssdl+xml', - 'sse' => 'application/vnd.kodak-descriptor', - 'ssf' => 'application/vnd.epson.ssf', - 'ssml' => 'application/ssml+xml', - 'sst' => 'application/octet-stream', - 'st' => 'application/vnd.sailingtracker.track', - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'step' => 'application/STEP', - 'stf' => 'application/vnd.wt.stf', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stk' => 'application/hyperstudio', - 'stl' => 'model/stl', - 'stp' => 'application/STEP', - 'stpx' => 'model/step+xml', - 'stpxz' => 'model/step-xml+zip', - 'stpz' => 'model/step+zip', - 'str' => 'application/vnd.pg.format', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'styl' => 'text/stylus', - 'stylus' => 'text/stylus', - 'sub' => 'text/vnd.dvb.subtitle', - 'sus' => 'application/vnd.sus-calendar', - 'susp' => 'application/vnd.sus-calendar', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svc' => 'application/vnd.dvb.service', - 'svd' => 'application/vnd.svd', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - 'swa' => 'application/x-director', - 'swf' => 'application/x-shockwave-flash', - 'swi' => 'application/vnd.aristanetworks.swi', - 'swidtag' => 'application/swid+xml', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', - 't' => 'text/troff', - 't3' => 'application/x-t3vm-image', - 't38' => 'image/t38', - 'taglet' => 'application/vnd.mynfc', - 'tao' => 'application/vnd.tao.intent-module-archive', - 'tap' => 'image/vnd.tencent.tap', - 'tar' => 'application/x-tar', - 'tcap' => 'application/vnd.3gpp2.tcap', - 'tcl' => 'application/x-tcl', - 'td' => 'application/urc-targetdesc+xml', - 'teacher' => 'application/vnd.smart.teacher', - 'tei' => 'application/tei+xml', - 'teicorpus' => 'application/tei+xml', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'text' => 'text/plain', - 'tfi' => 'application/thraud+xml', - 'tfm' => 'application/x-tex-tfm', - 'tfx' => 'image/tiff-fx', - 'tga' => 'image/x-tga', - 'tgz' => 'application/x-tar', - 'thmx' => 'application/vnd.ms-officetheme', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'tk' => 'application/x-tcl', - 'tmo' => 'application/vnd.tmobile-livetv', - 'toml' => 'application/toml', - 'torrent' => 'application/x-bittorrent', - 'tpl' => 'application/vnd.groove-tool-template', - 'tpt' => 'application/vnd.trid.tpt', - 'tr' => 'text/troff', - 'tra' => 'application/vnd.trueapp', - 'trig' => 'application/trig', - 'trm' => 'application/x-msterminal', - 'ts' => 'video/mp2t', - 'tsd' => 'application/timestamped-data', - 'tsv' => 'text/tab-separated-values', - 'ttc' => 'font/collection', - 'ttf' => 'font/ttf', - 'ttl' => 'text/turtle', - 'ttml' => 'application/ttml+xml', - 'twd' => 'application/vnd.simtech-mindmapper', - 'twds' => 'application/vnd.simtech-mindmapper', - 'txd' => 'application/vnd.genomatix.tuxedo', - 'txf' => 'application/vnd.mobius.txf', - 'txt' => 'text/plain', - 'u3d' => 'model/u3d', - 'u8dsn' => 'message/global-delivery-status', - 'u8hdr' => 'message/global-headers', - 'u8mdn' => 'message/global-disposition-notification', - 'u8msg' => 'message/global', - 'u32' => 'application/x-authorware-bin', - 'ubj' => 'application/ubjson', - 'udeb' => 'application/x-debian-package', - 'ufd' => 'application/vnd.ufdl', - 'ufdl' => 'application/vnd.ufdl', - 'ulx' => 'application/x-glulx', - 'umj' => 'application/vnd.umajin', - 'unityweb' => 'application/vnd.unity', - 'uo' => 'application/vnd.uoml+xml', - 'uoml' => 'application/vnd.uoml+xml', - 'uri' => 'text/uri-list', - 'uris' => 'text/uri-list', - 'urls' => 'text/uri-list', - 'usda' => 'model/vnd.usda', - 'usdz' => 'model/vnd.usdz+zip', - 'ustar' => 'application/x-ustar', - 'utz' => 'application/vnd.uiq.theme', - 'uu' => 'text/x-uuencode', - 'uva' => 'audio/vnd.dece.audio', - 'uvd' => 'application/vnd.dece.data', - 'uvf' => 'application/vnd.dece.data', - 'uvg' => 'image/vnd.dece.graphic', - 'uvh' => 'video/vnd.dece.hd', - 'uvi' => 'image/vnd.dece.graphic', - 'uvm' => 'video/vnd.dece.mobile', - 'uvp' => 'video/vnd.dece.pd', - 'uvs' => 'video/vnd.dece.sd', - 'uvt' => 'application/vnd.dece.ttml+xml', - 'uvu' => 'video/vnd.uvvu.mp4', - 'uvv' => 'video/vnd.dece.video', - 'uvva' => 'audio/vnd.dece.audio', - 'uvvd' => 'application/vnd.dece.data', - 'uvvf' => 'application/vnd.dece.data', - 'uvvg' => 'image/vnd.dece.graphic', - 'uvvh' => 'video/vnd.dece.hd', - 'uvvi' => 'image/vnd.dece.graphic', - 'uvvm' => 'video/vnd.dece.mobile', - 'uvvp' => 'video/vnd.dece.pd', - 'uvvs' => 'video/vnd.dece.sd', - 'uvvt' => 'application/vnd.dece.ttml+xml', - 'uvvu' => 'video/vnd.uvvu.mp4', - 'uvvv' => 'video/vnd.dece.video', - 'uvvx' => 'application/vnd.dece.unspecified', - 'uvvz' => 'application/vnd.dece.zip', - 'uvx' => 'application/vnd.dece.unspecified', - 'uvz' => 'application/vnd.dece.zip', - 'vbox' => 'application/x-virtualbox-vbox', - 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack', - 'vcard' => 'text/vcard', - 'vcd' => 'application/x-cdlink', - 'vcf' => 'text/x-vcard', - 'vcg' => 'application/vnd.groove-vcard', - 'vcs' => 'text/x-vcalendar', - 'vcx' => 'application/vnd.vcx', - 'vdi' => 'application/x-virtualbox-vdi', - 'vds' => 'model/vnd.sap.vds', - 'vhd' => 'application/x-virtualbox-vhd', - 'vis' => 'application/vnd.visionary', - 'viv' => 'video/vnd.vivo', - 'vlc' => 'application/videolan', - 'vmdk' => 'application/x-virtualbox-vmdk', - 'vob' => 'video/x-ms-vob', - 'vor' => 'application/vnd.stardivision.writer', - 'vox' => 'application/x-authorware-bin', - 'vrml' => 'model/vrml', - 'vsd' => 'application/vnd.visio', - 'vsf' => 'application/vnd.vsf', - 'vss' => 'application/vnd.visio', - 'vst' => 'application/vnd.visio', - 'vsw' => 'application/vnd.visio', - 'vtf' => 'image/vnd.valve.source.texture', - 'vtt' => 'text/vtt', - 'vtu' => 'model/vnd.vtu', - 'vxml' => 'application/voicexml+xml', - 'w3d' => 'application/x-director', - 'wad' => 'application/x-doom', - 'wadl' => 'application/vnd.sun.wadl+xml', - 'war' => 'application/java-archive', - 'wasm' => 'application/wasm', - 'wav' => 'audio/x-wav', - 'wax' => 'audio/x-ms-wax', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbs' => 'application/vnd.criticaltools.wbs+xml', - 'wbxml' => 'application/wbxml', - 'wcm' => 'application/vnd.ms-works', - 'wdb' => 'application/vnd.ms-works', - 'wdp' => 'image/vnd.ms-photo', - 'weba' => 'audio/webm', - 'webapp' => 'application/x-web-app-manifest+json', - 'webm' => 'video/webm', - 'webmanifest' => 'application/manifest+json', - 'webp' => 'image/webp', - 'wg' => 'application/vnd.pmi.widget', - 'wgsl' => 'text/wgsl', - 'wgt' => 'application/widget', - 'wif' => 'application/watcherinfo+xml', - 'wks' => 'application/vnd.ms-works', - 'wm' => 'video/x-ms-wm', - 'wma' => 'audio/x-ms-wma', - 'wmd' => 'application/x-ms-wmd', - 'wmf' => 'image/wmf', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wmv' => 'video/x-ms-wmv', - 'wmx' => 'video/x-ms-wmx', - 'wmz' => 'application/x-msmetafile', - 'woff' => 'font/woff', - 'woff2' => 'font/woff2', - 'word' => 'application/msword', - 'wpd' => 'application/vnd.wordperfect', - 'wpl' => 'application/vnd.ms-wpl', - 'wps' => 'application/vnd.ms-works', - 'wqd' => 'application/vnd.wqd', - 'wri' => 'application/x-mswrite', - 'wrl' => 'model/vrml', - 'wsc' => 'message/vnd.wfa.wsc', - 'wsdl' => 'application/wsdl+xml', - 'wspolicy' => 'application/wspolicy+xml', - 'wtb' => 'application/vnd.webturbo', - 'wvx' => 'video/x-ms-wvx', - 'x3d' => 'model/x3d+xml', - 'x3db' => 'model/x3d+fastinfoset', - 'x3dbz' => 'model/x3d+binary', - 'x3dv' => 'model/x3d-vrml', - 'x3dvz' => 'model/x3d+vrml', - 'x3dz' => 'model/x3d+xml', - 'x32' => 'application/x-authorware-bin', - 'x_b' => 'model/vnd.parasolid.transmit.binary', - 'x_t' => 'model/vnd.parasolid.transmit.text', - 'xaml' => 'application/xaml+xml', - 'xap' => 'application/x-silverlight-app', - 'xar' => 'application/vnd.xara', - 'xav' => 'application/xcap-att+xml', - 'xbap' => 'application/x-ms-xbap', - 'xbd' => 'application/vnd.fujixerox.docuworks.binder', - 'xbm' => 'image/x-xbitmap', - 'xca' => 'application/xcap-caps+xml', - 'xcs' => 'application/calendar+xml', - 'xdf' => 'application/xcap-diff+xml', - 'xdm' => 'application/vnd.syncml.dm+xml', - 'xdp' => 'application/vnd.adobe.xdp+xml', - 'xdssc' => 'application/dssc+xml', - 'xdw' => 'application/vnd.fujixerox.docuworks', - 'xel' => 'application/xcap-el+xml', - 'xenc' => 'application/xenc+xml', - 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/xfdf', - 'xfdl' => 'application/vnd.xfdl', - 'xht' => 'application/xhtml+xml', - 'xhtm' => 'application/vnd.pwg-xhtml-print+xml', - 'xhtml' => 'application/xhtml+xml', - 'xhvml' => 'application/xv+xml', - 'xif' => 'image/vnd.xiff', - 'xl' => 'application/excel', - 'xla' => 'application/vnd.ms-excel', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'xlc' => 'application/vnd.ms-excel', - 'xlf' => 'application/xliff+xml', - 'xlm' => 'application/vnd.ms-excel', - 'xls' => 'application/vnd.ms-excel', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlt' => 'application/vnd.ms-excel', - 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xlw' => 'application/vnd.ms-excel', - 'xm' => 'audio/xm', - 'xml' => 'application/xml', - 'xns' => 'application/xcap-ns+xml', - 'xo' => 'application/vnd.olpc-sugar', - 'xop' => 'application/xop+xml', - 'xpi' => 'application/x-xpinstall', - 'xpl' => 'application/xproc+xml', - 'xpm' => 'image/x-xpixmap', - 'xpr' => 'application/vnd.is-xpr', - 'xps' => 'application/vnd.ms-xpsdocument', - 'xpw' => 'application/vnd.intercon.formnet', - 'xpx' => 'application/vnd.intercon.formnet', - 'xsd' => 'application/xml', - 'xsf' => 'application/prs.xsf+xml', - 'xsl' => 'application/xml', - 'xslt' => 'application/xslt+xml', - 'xsm' => 'application/vnd.syncml+xml', - 'xspf' => 'application/xspf+xml', - 'xul' => 'application/vnd.mozilla.xul+xml', - 'xvm' => 'application/xv+xml', - 'xvml' => 'application/xv+xml', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-xyz', - 'xz' => 'application/x-xz', - 'yaml' => 'text/yaml', - 'yang' => 'application/yang', - 'yin' => 'application/yin+xml', - 'yml' => 'text/yaml', - 'ymp' => 'text/x-suse-ymp', - 'z' => 'application/x-compress', - 'z1' => 'application/x-zmachine', - 'z2' => 'application/x-zmachine', - 'z3' => 'application/x-zmachine', - 'z4' => 'application/x-zmachine', - 'z5' => 'application/x-zmachine', - 'z6' => 'application/x-zmachine', - 'z7' => 'application/x-zmachine', - 'z8' => 'application/x-zmachine', - 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/zip', - 'zir' => 'application/vnd.zul', - 'zirz' => 'application/vnd.zul', - 'zmm' => 'application/vnd.handheld-entertainment+xml', - 'zsh' => 'text/x-scriptzsh', - ]; - - /** - * @var array - * - * @internal - */ - public const EXTENSIONS_FOR_MIME_TIMES = [ - 'application/andrew-inset' => ['ez'], - 'application/appinstaller' => ['appinstaller'], - 'application/applixware' => ['aw'], - 'application/appx' => ['appx'], - 'application/appxbundle' => ['appxbundle'], - 'application/atom+xml' => ['atom'], - 'application/atomcat+xml' => ['atomcat'], - 'application/atomdeleted+xml' => ['atomdeleted'], - 'application/atomsvc+xml' => ['atomsvc'], - 'application/atsc-dwd+xml' => ['dwd'], - 'application/atsc-held+xml' => ['held'], - 'application/atsc-rsat+xml' => ['rsat'], - 'application/automationml-aml+xml' => ['aml'], - 'application/automationml-amlx+zip' => ['amlx'], - 'application/bdoc' => ['bdoc'], - 'application/calendar+xml' => ['xcs'], - 'application/ccxml+xml' => ['ccxml'], - 'application/cdfx+xml' => ['cdfx'], - 'application/cdmi-capability' => ['cdmia'], - 'application/cdmi-container' => ['cdmic'], - 'application/cdmi-domain' => ['cdmid'], - 'application/cdmi-object' => ['cdmio'], - 'application/cdmi-queue' => ['cdmiq'], - 'application/cpl+xml' => ['cpl'], - 'application/cu-seeme' => ['cu'], - 'application/cwl' => ['cwl'], - 'application/dash+xml' => ['mpd'], - 'application/dash-patch+xml' => ['mpp'], - 'application/davmount+xml' => ['davmount'], - 'application/docbook+xml' => ['dbk'], - 'application/dssc+der' => ['dssc'], - 'application/dssc+xml' => ['xdssc'], - 'application/ecmascript' => ['ecma'], - 'application/emma+xml' => ['emma'], - 'application/emotionml+xml' => ['emotionml'], - 'application/epub+zip' => ['epub'], - 'application/exi' => ['exi'], - 'application/express' => ['exp'], - 'application/fdf' => ['fdf'], - 'application/fdt+xml' => ['fdt'], - 'application/font-tdpfr' => ['pfr'], - 'application/geo+json' => ['geojson'], - 'application/gml+xml' => ['gml'], - 'application/gpx+xml' => ['gpx'], - 'application/gxf' => ['gxf'], - 'application/gzip' => ['gz', 'gzip'], - 'application/hjson' => ['hjson'], - 'application/hyperstudio' => ['stk'], - 'application/inkml+xml' => ['ink', 'inkml'], - 'application/ipfix' => ['ipfix'], - 'application/its+xml' => ['its'], - 'application/java-archive' => ['jar', 'war', 'ear'], - 'application/java-serialized-object' => ['ser'], - 'application/java-vm' => ['class'], - 'application/javascript' => ['js'], - 'application/json' => ['json', 'map'], - 'application/json5' => ['json5'], - 'application/jsonml+json' => ['jsonml'], - 'application/ld+json' => ['jsonld'], - 'application/lgr+xml' => ['lgr'], - 'application/lost+xml' => ['lostxml'], - 'application/mac-binhex40' => ['hqx'], - 'application/mac-compactpro' => ['cpt'], - 'application/mads+xml' => ['mads'], - 'application/manifest+json' => ['webmanifest'], - 'application/marc' => ['mrc'], - 'application/marcxml+xml' => ['mrcx'], - 'application/mathematica' => ['ma', 'nb', 'mb'], - 'application/mathml+xml' => ['mathml'], - 'application/mbox' => ['mbox'], - 'application/media-policy-dataset+xml' => ['mpf'], - 'application/mediaservercontrol+xml' => ['mscml'], - 'application/metalink+xml' => ['metalink'], - 'application/metalink4+xml' => ['meta4'], - 'application/mets+xml' => ['mets'], - 'application/mmt-aei+xml' => ['maei'], - 'application/mmt-usd+xml' => ['musd'], - 'application/mods+xml' => ['mods'], - 'application/mp21' => ['m21', 'mp21'], - 'application/mp4' => ['mp4', 'mpg4', 'mp4s', 'm4p'], - 'application/msix' => ['msix'], - 'application/msixbundle' => ['msixbundle'], - 'application/msword' => ['doc', 'dot', 'word'], - 'application/mxf' => ['mxf'], - 'application/n-quads' => ['nq'], - 'application/n-triples' => ['nt'], - 'application/node' => ['cjs'], - 'application/octet-stream' => ['bin', 'dms', 'lrf', 'mar', 'so', 'dist', 'distz', 'pkg', 'bpk', 'dump', 'elc', 'deploy', 'exe', 'dll', 'deb', 'dmg', 'iso', 'img', 'msi', 'msp', 'msm', 'buffer', 'phar', 'lha', 'lzh', 'class', 'sea', 'dmn', 'bpmn', 'kdb', 'sst', 'csr', 'dst', 'pv', 'pxf'], - 'application/oda' => ['oda'], - 'application/oebps-package+xml' => ['opf'], - 'application/ogg' => ['ogx'], - 'application/omdoc+xml' => ['omdoc'], - 'application/onenote' => ['onetoc', 'onetoc2', 'onetmp', 'onepkg'], - 'application/oxps' => ['oxps'], - 'application/p2p-overlay+xml' => ['relo'], - 'application/patch-ops-error+xml' => ['xer'], - 'application/pdf' => ['pdf', 'ai'], - 'application/pgp-encrypted' => ['pgp'], - 'application/pgp-keys' => ['asc'], - 'application/pgp-signature' => ['sig', 'asc'], - 'application/pics-rules' => ['prf'], - 'application/pkcs10' => ['p10'], - 'application/pkcs7-mime' => ['p7m', 'p7c'], - 'application/pkcs7-signature' => ['p7s'], - 'application/pkcs8' => ['p8'], - 'application/pkix-attr-cert' => ['ac'], - 'application/pkix-cert' => ['cer'], - 'application/pkix-crl' => ['crl'], - 'application/pkix-pkipath' => ['pkipath'], - 'application/pkixcmp' => ['pki'], - 'application/pls+xml' => ['pls'], - 'application/postscript' => ['ai', 'eps', 'ps'], - 'application/provenance+xml' => ['provx'], - 'application/prs.cww' => ['cww'], - 'application/prs.xsf+xml' => ['xsf'], - 'application/pskc+xml' => ['pskcxml'], - 'application/raml+yaml' => ['raml'], - 'application/rdf+xml' => ['rdf', 'owl'], - 'application/reginfo+xml' => ['rif'], - 'application/relax-ng-compact-syntax' => ['rnc'], - 'application/resource-lists+xml' => ['rl'], - 'application/resource-lists-diff+xml' => ['rld'], - 'application/rls-services+xml' => ['rs'], - 'application/route-apd+xml' => ['rapd'], - 'application/route-s-tsid+xml' => ['sls'], - 'application/route-usd+xml' => ['rusd'], - 'application/rpki-ghostbusters' => ['gbr'], - 'application/rpki-manifest' => ['mft'], - 'application/rpki-roa' => ['roa'], - 'application/rsd+xml' => ['rsd'], - 'application/rss+xml' => ['rss'], - 'application/rtf' => ['rtf'], - 'application/sbml+xml' => ['sbml'], - 'application/scvp-cv-request' => ['scq'], - 'application/scvp-cv-response' => ['scs'], - 'application/scvp-vp-request' => ['spq'], - 'application/scvp-vp-response' => ['spp'], - 'application/sdp' => ['sdp'], - 'application/senml+xml' => ['senmlx'], - 'application/sensml+xml' => ['sensmlx'], - 'application/set-payment-initiation' => ['setpay'], - 'application/set-registration-initiation' => ['setreg'], - 'application/shf+xml' => ['shf'], - 'application/sieve' => ['siv', 'sieve'], - 'application/smil+xml' => ['smi', 'smil'], - 'application/sparql-query' => ['rq'], - 'application/sparql-results+xml' => ['srx'], - 'application/sql' => ['sql'], - 'application/srgs' => ['gram'], - 'application/srgs+xml' => ['grxml'], - 'application/sru+xml' => ['sru'], - 'application/ssdl+xml' => ['ssdl'], - 'application/ssml+xml' => ['ssml'], - 'application/swid+xml' => ['swidtag'], - 'application/tei+xml' => ['tei', 'teicorpus'], - 'application/thraud+xml' => ['tfi'], - 'application/timestamped-data' => ['tsd'], - 'application/toml' => ['toml'], - 'application/trig' => ['trig'], - 'application/ttml+xml' => ['ttml'], - 'application/ubjson' => ['ubj'], - 'application/urc-ressheet+xml' => ['rsheet'], - 'application/urc-targetdesc+xml' => ['td'], - 'application/vnd.1000minds.decision-model+xml' => ['1km'], - 'application/vnd.3gpp.pic-bw-large' => ['plb'], - 'application/vnd.3gpp.pic-bw-small' => ['psb'], - 'application/vnd.3gpp.pic-bw-var' => ['pvb'], - 'application/vnd.3gpp2.tcap' => ['tcap'], - 'application/vnd.3m.post-it-notes' => ['pwn'], - 'application/vnd.accpac.simply.aso' => ['aso'], - 'application/vnd.accpac.simply.imp' => ['imp'], - 'application/vnd.acucobol' => ['acu'], - 'application/vnd.acucorp' => ['atc', 'acutc'], - 'application/vnd.adobe.air-application-installer-package+zip' => ['air'], - 'application/vnd.adobe.formscentral.fcdt' => ['fcdt'], - 'application/vnd.adobe.fxp' => ['fxp', 'fxpl'], - 'application/vnd.adobe.xdp+xml' => ['xdp'], - 'application/vnd.adobe.xfdf' => ['xfdf'], - 'application/vnd.age' => ['age'], - 'application/vnd.ahead.space' => ['ahead'], - 'application/vnd.airzip.filesecure.azf' => ['azf'], - 'application/vnd.airzip.filesecure.azs' => ['azs'], - 'application/vnd.amazon.ebook' => ['azw'], - 'application/vnd.americandynamics.acc' => ['acc'], - 'application/vnd.amiga.ami' => ['ami'], - 'application/vnd.android.package-archive' => ['apk'], - 'application/vnd.anser-web-certificate-issue-initiation' => ['cii'], - 'application/vnd.anser-web-funds-transfer-initiation' => ['fti'], - 'application/vnd.antix.game-component' => ['atx'], - 'application/vnd.apple.installer+xml' => ['mpkg'], - 'application/vnd.apple.keynote' => ['key'], - 'application/vnd.apple.mpegurl' => ['m3u8'], - 'application/vnd.apple.numbers' => ['numbers'], - 'application/vnd.apple.pages' => ['pages'], - 'application/vnd.apple.pkpass' => ['pkpass'], - 'application/vnd.aristanetworks.swi' => ['swi'], - 'application/vnd.astraea-software.iota' => ['iota'], - 'application/vnd.audiograph' => ['aep'], - 'application/vnd.balsamiq.bmml+xml' => ['bmml'], - 'application/vnd.blueice.multipass' => ['mpm'], - 'application/vnd.bmi' => ['bmi'], - 'application/vnd.businessobjects' => ['rep'], - 'application/vnd.chemdraw+xml' => ['cdxml'], - 'application/vnd.chipnuts.karaoke-mmd' => ['mmd'], - 'application/vnd.cinderella' => ['cdy'], - 'application/vnd.citationstyles.style+xml' => ['csl'], - 'application/vnd.claymore' => ['cla'], - 'application/vnd.cloanto.rp9' => ['rp9'], - 'application/vnd.clonk.c4group' => ['c4g', 'c4d', 'c4f', 'c4p', 'c4u'], - 'application/vnd.cluetrust.cartomobile-config' => ['c11amc'], - 'application/vnd.cluetrust.cartomobile-config-pkg' => ['c11amz'], - 'application/vnd.commonspace' => ['csp'], - 'application/vnd.contact.cmsg' => ['cdbcmsg'], - 'application/vnd.cosmocaller' => ['cmc'], - 'application/vnd.crick.clicker' => ['clkx'], - 'application/vnd.crick.clicker.keyboard' => ['clkk'], - 'application/vnd.crick.clicker.palette' => ['clkp'], - 'application/vnd.crick.clicker.template' => ['clkt'], - 'application/vnd.crick.clicker.wordbank' => ['clkw'], - 'application/vnd.criticaltools.wbs+xml' => ['wbs'], - 'application/vnd.ctc-posml' => ['pml'], - 'application/vnd.cups-ppd' => ['ppd'], - 'application/vnd.curl.car' => ['car'], - 'application/vnd.curl.pcurl' => ['pcurl'], - 'application/vnd.dart' => ['dart'], - 'application/vnd.data-vision.rdz' => ['rdz'], - 'application/vnd.dbf' => ['dbf'], - 'application/vnd.dece.data' => ['uvf', 'uvvf', 'uvd', 'uvvd'], - 'application/vnd.dece.ttml+xml' => ['uvt', 'uvvt'], - 'application/vnd.dece.unspecified' => ['uvx', 'uvvx'], - 'application/vnd.dece.zip' => ['uvz', 'uvvz'], - 'application/vnd.denovo.fcselayout-link' => ['fe_launch'], - 'application/vnd.dna' => ['dna'], - 'application/vnd.dolby.mlp' => ['mlp'], - 'application/vnd.dpgraph' => ['dpg'], - 'application/vnd.dreamfactory' => ['dfac'], - 'application/vnd.ds-keypoint' => ['kpxx'], - 'application/vnd.dvb.ait' => ['ait'], - 'application/vnd.dvb.service' => ['svc'], - 'application/vnd.dynageo' => ['geo'], - 'application/vnd.ecowin.chart' => ['mag'], - 'application/vnd.enliven' => ['nml'], - 'application/vnd.epson.esf' => ['esf'], - 'application/vnd.epson.msf' => ['msf'], - 'application/vnd.epson.quickanime' => ['qam'], - 'application/vnd.epson.salt' => ['slt'], - 'application/vnd.epson.ssf' => ['ssf'], - 'application/vnd.eszigno3+xml' => ['es3', 'et3'], - 'application/vnd.ezpix-album' => ['ez2'], - 'application/vnd.ezpix-package' => ['ez3'], - 'application/vnd.fdf' => ['fdf'], - 'application/vnd.fdsn.mseed' => ['mseed'], - 'application/vnd.fdsn.seed' => ['seed', 'dataless'], - 'application/vnd.flographit' => ['gph'], - 'application/vnd.fluxtime.clip' => ['ftc'], - 'application/vnd.framemaker' => ['fm', 'frame', 'maker', 'book'], - 'application/vnd.frogans.fnc' => ['fnc'], - 'application/vnd.frogans.ltf' => ['ltf'], - 'application/vnd.fsc.weblaunch' => ['fsc'], - 'application/vnd.fujitsu.oasys' => ['oas'], - 'application/vnd.fujitsu.oasys2' => ['oa2'], - 'application/vnd.fujitsu.oasys3' => ['oa3'], - 'application/vnd.fujitsu.oasysgp' => ['fg5'], - 'application/vnd.fujitsu.oasysprs' => ['bh2'], - 'application/vnd.fujixerox.ddd' => ['ddd'], - 'application/vnd.fujixerox.docuworks' => ['xdw'], - 'application/vnd.fujixerox.docuworks.binder' => ['xbd'], - 'application/vnd.fuzzysheet' => ['fzs'], - 'application/vnd.genomatix.tuxedo' => ['txd'], - 'application/vnd.geogebra.file' => ['ggb'], - 'application/vnd.geogebra.tool' => ['ggt'], - 'application/vnd.geometry-explorer' => ['gex', 'gre'], - 'application/vnd.geonext' => ['gxt'], - 'application/vnd.geoplan' => ['g2w'], - 'application/vnd.geospace' => ['g3w'], - 'application/vnd.gmx' => ['gmx'], - 'application/vnd.google-apps.document' => ['gdoc'], - 'application/vnd.google-apps.presentation' => ['gslides'], - 'application/vnd.google-apps.spreadsheet' => ['gsheet'], - 'application/vnd.google-earth.kml+xml' => ['kml'], - 'application/vnd.google-earth.kmz' => ['kmz'], - 'application/vnd.grafeq' => ['gqf', 'gqs'], - 'application/vnd.groove-account' => ['gac'], - 'application/vnd.groove-help' => ['ghf'], - 'application/vnd.groove-identity-message' => ['gim'], - 'application/vnd.groove-injector' => ['grv'], - 'application/vnd.groove-tool-message' => ['gtm'], - 'application/vnd.groove-tool-template' => ['tpl'], - 'application/vnd.groove-vcard' => ['vcg'], - 'application/vnd.hal+xml' => ['hal'], - 'application/vnd.handheld-entertainment+xml' => ['zmm'], - 'application/vnd.hbci' => ['hbci'], - 'application/vnd.hhe.lesson-player' => ['les'], - 'application/vnd.hp-hpgl' => ['hpgl'], - 'application/vnd.hp-hpid' => ['hpid'], - 'application/vnd.hp-hps' => ['hps'], - 'application/vnd.hp-jlyt' => ['jlt'], - 'application/vnd.hp-pcl' => ['pcl'], - 'application/vnd.hp-pclxl' => ['pclxl'], - 'application/vnd.hydrostatix.sof-data' => ['sfd-hdstx'], - 'application/vnd.ibm.minipay' => ['mpy'], - 'application/vnd.ibm.modcap' => ['afp', 'listafp', 'list3820'], - 'application/vnd.ibm.rights-management' => ['irm'], - 'application/vnd.ibm.secure-container' => ['sc'], - 'application/vnd.iccprofile' => ['icc', 'icm'], - 'application/vnd.igloader' => ['igl'], - 'application/vnd.immervision-ivp' => ['ivp'], - 'application/vnd.immervision-ivu' => ['ivu'], - 'application/vnd.insors.igm' => ['igm'], - 'application/vnd.intercon.formnet' => ['xpw', 'xpx'], - 'application/vnd.intergeo' => ['i2g'], - 'application/vnd.intu.qbo' => ['qbo'], - 'application/vnd.intu.qfx' => ['qfx'], - 'application/vnd.ipunplugged.rcprofile' => ['rcprofile'], - 'application/vnd.irepository.package+xml' => ['irp'], - 'application/vnd.is-xpr' => ['xpr'], - 'application/vnd.isac.fcs' => ['fcs'], - 'application/vnd.jam' => ['jam'], - 'application/vnd.jcp.javame.midlet-rms' => ['rms'], - 'application/vnd.jisp' => ['jisp'], - 'application/vnd.joost.joda-archive' => ['joda'], - 'application/vnd.kahootz' => ['ktz', 'ktr'], - 'application/vnd.kde.karbon' => ['karbon'], - 'application/vnd.kde.kchart' => ['chrt'], - 'application/vnd.kde.kformula' => ['kfo'], - 'application/vnd.kde.kivio' => ['flw'], - 'application/vnd.kde.kontour' => ['kon'], - 'application/vnd.kde.kpresenter' => ['kpr', 'kpt'], - 'application/vnd.kde.kspread' => ['ksp'], - 'application/vnd.kde.kword' => ['kwd', 'kwt'], - 'application/vnd.kenameaapp' => ['htke'], - 'application/vnd.kidspiration' => ['kia'], - 'application/vnd.kinar' => ['kne', 'knp'], - 'application/vnd.koan' => ['skp', 'skd', 'skt', 'skm'], - 'application/vnd.kodak-descriptor' => ['sse'], - 'application/vnd.las.las+xml' => ['lasxml'], - 'application/vnd.llamagraphics.life-balance.desktop' => ['lbd'], - 'application/vnd.llamagraphics.life-balance.exchange+xml' => ['lbe'], - 'application/vnd.lotus-1-2-3' => ['123'], - 'application/vnd.lotus-approach' => ['apr'], - 'application/vnd.lotus-freelance' => ['pre'], - 'application/vnd.lotus-notes' => ['nsf'], - 'application/vnd.lotus-organizer' => ['org'], - 'application/vnd.lotus-screencam' => ['scm'], - 'application/vnd.lotus-wordpro' => ['lwp'], - 'application/vnd.macports.portpkg' => ['portpkg'], - 'application/vnd.mapbox-vector-tile' => ['mvt'], - 'application/vnd.mcd' => ['mcd'], - 'application/vnd.medcalcdata' => ['mc1'], - 'application/vnd.mediastation.cdkey' => ['cdkey'], - 'application/vnd.mfer' => ['mwf'], - 'application/vnd.mfmp' => ['mfm'], - 'application/vnd.micrografx.flo' => ['flo'], - 'application/vnd.micrografx.igx' => ['igx'], - 'application/vnd.mif' => ['mif'], - 'application/vnd.mobius.daf' => ['daf'], - 'application/vnd.mobius.dis' => ['dis'], - 'application/vnd.mobius.mbk' => ['mbk'], - 'application/vnd.mobius.mqy' => ['mqy'], - 'application/vnd.mobius.msl' => ['msl'], - 'application/vnd.mobius.plc' => ['plc'], - 'application/vnd.mobius.txf' => ['txf'], - 'application/vnd.mophun.application' => ['mpn'], - 'application/vnd.mophun.certificate' => ['mpc'], - 'application/vnd.mozilla.xul+xml' => ['xul'], - 'application/vnd.ms-artgalry' => ['cil'], - 'application/vnd.ms-cab-compressed' => ['cab'], - 'application/vnd.ms-excel' => ['xls', 'xlm', 'xla', 'xlc', 'xlt', 'xlw'], - 'application/vnd.ms-excel.addin.macroenabled.12' => ['xlam'], - 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => ['xlsb'], - 'application/vnd.ms-excel.sheet.macroenabled.12' => ['xlsm'], - 'application/vnd.ms-excel.template.macroenabled.12' => ['xltm'], - 'application/vnd.ms-fontobject' => ['eot'], - 'application/vnd.ms-htmlhelp' => ['chm'], - 'application/vnd.ms-ims' => ['ims'], - 'application/vnd.ms-lrm' => ['lrm'], - 'application/vnd.ms-officetheme' => ['thmx'], - 'application/vnd.ms-outlook' => ['msg'], - 'application/vnd.ms-pki.seccat' => ['cat'], - 'application/vnd.ms-pki.stl' => ['stl'], - 'application/vnd.ms-powerpoint' => ['ppt', 'pps', 'pot', 'ppa'], - 'application/vnd.ms-powerpoint.addin.macroenabled.12' => ['ppam'], - 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => ['pptm'], - 'application/vnd.ms-powerpoint.slide.macroenabled.12' => ['sldm'], - 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => ['ppsm'], - 'application/vnd.ms-powerpoint.template.macroenabled.12' => ['potm'], - 'application/vnd.ms-project' => ['mpp', 'mpt'], - 'application/vnd.ms-word.document.macroenabled.12' => ['docm'], - 'application/vnd.ms-word.template.macroenabled.12' => ['dotm'], - 'application/vnd.ms-works' => ['wps', 'wks', 'wcm', 'wdb'], - 'application/vnd.ms-wpl' => ['wpl'], - 'application/vnd.ms-xpsdocument' => ['xps'], - 'application/vnd.mseq' => ['mseq'], - 'application/vnd.musician' => ['mus'], - 'application/vnd.muvee.style' => ['msty'], - 'application/vnd.mynfc' => ['taglet'], - 'application/vnd.neurolanguage.nlu' => ['nlu'], - 'application/vnd.nitf' => ['ntf', 'nitf'], - 'application/vnd.noblenet-directory' => ['nnd'], - 'application/vnd.noblenet-sealer' => ['nns'], - 'application/vnd.noblenet-web' => ['nnw'], - 'application/vnd.nokia.n-gage.ac+xml' => ['ac'], - 'application/vnd.nokia.n-gage.data' => ['ngdat'], - 'application/vnd.nokia.n-gage.symbian.install' => ['n-gage'], - 'application/vnd.nokia.radio-preset' => ['rpst'], - 'application/vnd.nokia.radio-presets' => ['rpss'], - 'application/vnd.novadigm.edm' => ['edm'], - 'application/vnd.novadigm.edx' => ['edx'], - 'application/vnd.novadigm.ext' => ['ext'], - 'application/vnd.oasis.opendocument.chart' => ['odc'], - 'application/vnd.oasis.opendocument.chart-template' => ['otc'], - 'application/vnd.oasis.opendocument.database' => ['odb'], - 'application/vnd.oasis.opendocument.formula' => ['odf'], - 'application/vnd.oasis.opendocument.formula-template' => ['odft'], - 'application/vnd.oasis.opendocument.graphics' => ['odg'], - 'application/vnd.oasis.opendocument.graphics-template' => ['otg'], - 'application/vnd.oasis.opendocument.image' => ['odi'], - 'application/vnd.oasis.opendocument.image-template' => ['oti'], - 'application/vnd.oasis.opendocument.presentation' => ['odp'], - 'application/vnd.oasis.opendocument.presentation-template' => ['otp'], - 'application/vnd.oasis.opendocument.spreadsheet' => ['ods'], - 'application/vnd.oasis.opendocument.spreadsheet-template' => ['ots'], - 'application/vnd.oasis.opendocument.text' => ['odt'], - 'application/vnd.oasis.opendocument.text-master' => ['odm'], - 'application/vnd.oasis.opendocument.text-template' => ['ott'], - 'application/vnd.oasis.opendocument.text-web' => ['oth'], - 'application/vnd.olpc-sugar' => ['xo'], - 'application/vnd.oma.dd2+xml' => ['dd2'], - 'application/vnd.openblox.game+xml' => ['obgx'], - 'application/vnd.openofficeorg.extension' => ['oxt'], - 'application/vnd.openstreetmap.data+xml' => ['osm'], - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => ['pptx'], - 'application/vnd.openxmlformats-officedocument.presentationml.slide' => ['sldx'], - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => ['ppsx'], - 'application/vnd.openxmlformats-officedocument.presentationml.template' => ['potx'], - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => ['xlsx'], - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => ['xltx'], - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => ['docx'], - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => ['dotx'], - 'application/vnd.osgeo.mapguide.package' => ['mgp'], - 'application/vnd.osgi.dp' => ['dp'], - 'application/vnd.osgi.subsystem' => ['esa'], - 'application/vnd.palm' => ['pdb', 'pqa', 'oprc'], - 'application/vnd.pawaafile' => ['paw'], - 'application/vnd.pg.format' => ['str'], - 'application/vnd.pg.osasli' => ['ei6'], - 'application/vnd.picsel' => ['efif'], - 'application/vnd.pmi.widget' => ['wg'], - 'application/vnd.pocketlearn' => ['plf'], - 'application/vnd.powerbuilder6' => ['pbd'], - 'application/vnd.previewsystems.box' => ['box'], - 'application/vnd.proteus.magazine' => ['mgz'], - 'application/vnd.publishare-delta-tree' => ['qps'], - 'application/vnd.pvi.ptid1' => ['ptid'], - 'application/vnd.pwg-xhtml-print+xml' => ['xhtm'], - 'application/vnd.quark.quarkxpress' => ['qxd', 'qxt', 'qwd', 'qwt', 'qxl', 'qxb'], - 'application/vnd.rar' => ['rar'], - 'application/vnd.realvnc.bed' => ['bed'], - 'application/vnd.recordare.musicxml' => ['mxl'], - 'application/vnd.recordare.musicxml+xml' => ['musicxml'], - 'application/vnd.rig.cryptonote' => ['cryptonote'], - 'application/vnd.rim.cod' => ['cod'], - 'application/vnd.rn-realmedia' => ['rm'], - 'application/vnd.rn-realmedia-vbr' => ['rmvb'], - 'application/vnd.route66.link66+xml' => ['link66'], - 'application/vnd.sailingtracker.track' => ['st'], - 'application/vnd.seemail' => ['see'], - 'application/vnd.sema' => ['sema'], - 'application/vnd.semd' => ['semd'], - 'application/vnd.semf' => ['semf'], - 'application/vnd.shana.informed.formdata' => ['ifm'], - 'application/vnd.shana.informed.formtemplate' => ['itp'], - 'application/vnd.shana.informed.interchange' => ['iif'], - 'application/vnd.shana.informed.package' => ['ipk'], - 'application/vnd.simtech-mindmapper' => ['twd', 'twds'], - 'application/vnd.smaf' => ['mmf'], - 'application/vnd.smart.teacher' => ['teacher'], - 'application/vnd.software602.filler.form+xml' => ['fo'], - 'application/vnd.solent.sdkm+xml' => ['sdkm', 'sdkd'], - 'application/vnd.spotfire.dxp' => ['dxp'], - 'application/vnd.spotfire.sfs' => ['sfs'], - 'application/vnd.stardivision.calc' => ['sdc'], - 'application/vnd.stardivision.draw' => ['sda'], - 'application/vnd.stardivision.impress' => ['sdd'], - 'application/vnd.stardivision.math' => ['smf'], - 'application/vnd.stardivision.writer' => ['sdw', 'vor'], - 'application/vnd.stardivision.writer-global' => ['sgl'], - 'application/vnd.stepmania.package' => ['smzip'], - 'application/vnd.stepmania.stepchart' => ['sm'], - 'application/vnd.sun.wadl+xml' => ['wadl'], - 'application/vnd.sun.xml.calc' => ['sxc'], - 'application/vnd.sun.xml.calc.template' => ['stc'], - 'application/vnd.sun.xml.draw' => ['sxd'], - 'application/vnd.sun.xml.draw.template' => ['std'], - 'application/vnd.sun.xml.impress' => ['sxi'], - 'application/vnd.sun.xml.impress.template' => ['sti'], - 'application/vnd.sun.xml.math' => ['sxm'], - 'application/vnd.sun.xml.writer' => ['sxw'], - 'application/vnd.sun.xml.writer.global' => ['sxg'], - 'application/vnd.sun.xml.writer.template' => ['stw'], - 'application/vnd.sus-calendar' => ['sus', 'susp'], - 'application/vnd.svd' => ['svd'], - 'application/vnd.symbian.install' => ['sis', 'sisx'], - 'application/vnd.syncml+xml' => ['xsm'], - 'application/vnd.syncml.dm+wbxml' => ['bdm'], - 'application/vnd.syncml.dm+xml' => ['xdm'], - 'application/vnd.syncml.dmddf+xml' => ['ddf'], - 'application/vnd.tao.intent-module-archive' => ['tao'], - 'application/vnd.tcpdump.pcap' => ['pcap', 'cap', 'dmp'], - 'application/vnd.tmobile-livetv' => ['tmo'], - 'application/vnd.trid.tpt' => ['tpt'], - 'application/vnd.triscape.mxs' => ['mxs'], - 'application/vnd.trueapp' => ['tra'], - 'application/vnd.ufdl' => ['ufd', 'ufdl'], - 'application/vnd.uiq.theme' => ['utz'], - 'application/vnd.umajin' => ['umj'], - 'application/vnd.unity' => ['unityweb'], - 'application/vnd.uoml+xml' => ['uoml', 'uo'], - 'application/vnd.vcx' => ['vcx'], - 'application/vnd.visio' => ['vsd', 'vst', 'vss', 'vsw'], - 'application/vnd.visionary' => ['vis'], - 'application/vnd.vsf' => ['vsf'], - 'application/vnd.wap.wbxml' => ['wbxml'], - 'application/vnd.wap.wmlc' => ['wmlc'], - 'application/vnd.wap.wmlscriptc' => ['wmlsc'], - 'application/vnd.webturbo' => ['wtb'], - 'application/vnd.wolfram.player' => ['nbp'], - 'application/vnd.wordperfect' => ['wpd'], - 'application/vnd.wqd' => ['wqd'], - 'application/vnd.wt.stf' => ['stf'], - 'application/vnd.xara' => ['xar'], - 'application/vnd.xfdl' => ['xfdl'], - 'application/vnd.yamaha.hv-dic' => ['hvd'], - 'application/vnd.yamaha.hv-script' => ['hvs'], - 'application/vnd.yamaha.hv-voice' => ['hvp'], - 'application/vnd.yamaha.openscoreformat' => ['osf'], - 'application/vnd.yamaha.openscoreformat.osfpvg+xml' => ['osfpvg'], - 'application/vnd.yamaha.smaf-audio' => ['saf'], - 'application/vnd.yamaha.smaf-phrase' => ['spf'], - 'application/vnd.yellowriver-custom-menu' => ['cmp'], - 'application/vnd.zul' => ['zir', 'zirz'], - 'application/vnd.zzazz.deck+xml' => ['zaz'], - 'application/voicexml+xml' => ['vxml'], - 'application/wasm' => ['wasm'], - 'application/watcherinfo+xml' => ['wif'], - 'application/widget' => ['wgt'], - 'application/winhlp' => ['hlp'], - 'application/wsdl+xml' => ['wsdl'], - 'application/wspolicy+xml' => ['wspolicy'], - 'application/x-7z-compressed' => ['7z', '7zip'], - 'application/x-abiword' => ['abw'], - 'application/x-ace-compressed' => ['ace'], - 'application/x-apple-diskimage' => ['dmg'], - 'application/x-arj' => ['arj'], - 'application/x-authorware-bin' => ['aab', 'x32', 'u32', 'vox'], - 'application/x-authorware-map' => ['aam'], - 'application/x-authorware-seg' => ['aas'], - 'application/x-bcpio' => ['bcpio'], - 'application/x-bdoc' => ['bdoc'], - 'application/x-bittorrent' => ['torrent'], - 'application/x-blorb' => ['blb', 'blorb'], - 'application/x-bzip' => ['bz'], - 'application/x-bzip2' => ['bz2', 'boz'], - 'application/x-cbr' => ['cbr', 'cba', 'cbt', 'cbz', 'cb7'], - 'application/x-cdlink' => ['vcd'], - 'application/x-cfs-compressed' => ['cfs'], - 'application/x-chat' => ['chat'], - 'application/x-chess-pgn' => ['pgn'], - 'application/x-chrome-extension' => ['crx'], - 'application/x-cocoa' => ['cco'], - 'application/x-conference' => ['nsc'], - 'application/x-cpio' => ['cpio'], - 'application/x-csh' => ['csh'], - 'application/x-debian-package' => ['deb', 'udeb'], - 'application/x-dgc-compressed' => ['dgc'], - 'application/x-director' => ['dir', 'dcr', 'dxr', 'cst', 'cct', 'cxt', 'w3d', 'fgd', 'swa'], - 'application/x-doom' => ['wad'], - 'application/x-dtbncx+xml' => ['ncx'], - 'application/x-dtbook+xml' => ['dtb'], - 'application/x-dtbresource+xml' => ['res'], - 'application/x-dvi' => ['dvi'], - 'application/x-envoy' => ['evy'], - 'application/x-eva' => ['eva'], - 'application/x-font-bdf' => ['bdf'], - 'application/x-font-ghostscript' => ['gsf'], - 'application/x-font-linux-psf' => ['psf'], - 'application/x-font-pcf' => ['pcf'], - 'application/x-font-snf' => ['snf'], - 'application/x-font-type1' => ['pfa', 'pfb', 'pfm', 'afm'], - 'application/x-freearc' => ['arc'], - 'application/x-futuresplash' => ['spl'], - 'application/x-gca-compressed' => ['gca'], - 'application/x-glulx' => ['ulx'], - 'application/x-gnumeric' => ['gnumeric'], - 'application/x-gramps-xml' => ['gramps'], - 'application/x-gtar' => ['gtar'], - 'application/x-hdf' => ['hdf'], - 'application/x-httpd-php' => ['php', 'php4', 'php3', 'phtml'], - 'application/x-install-instructions' => ['install'], - 'application/x-iso9660-image' => ['iso'], - 'application/x-iwork-keynote-sffkey' => ['key'], - 'application/x-iwork-numbers-sffnumbers' => ['numbers'], - 'application/x-iwork-pages-sffpages' => ['pages'], - 'application/x-java-archive-diff' => ['jardiff'], - 'application/x-java-jnlp-file' => ['jnlp'], - 'application/x-keepass2' => ['kdbx'], - 'application/x-latex' => ['latex'], - 'application/x-lua-bytecode' => ['luac'], - 'application/x-lzh-compressed' => ['lzh', 'lha'], - 'application/x-makeself' => ['run'], - 'application/x-mie' => ['mie'], - 'application/x-mobipocket-ebook' => ['prc', 'mobi'], - 'application/x-ms-application' => ['application'], - 'application/x-ms-shortcut' => ['lnk'], - 'application/x-ms-wmd' => ['wmd'], - 'application/x-ms-wmz' => ['wmz'], - 'application/x-ms-xbap' => ['xbap'], - 'application/x-msaccess' => ['mdb'], - 'application/x-msbinder' => ['obd'], - 'application/x-mscardfile' => ['crd'], - 'application/x-msclip' => ['clp'], - 'application/x-msdos-program' => ['exe'], - 'application/x-msdownload' => ['exe', 'dll', 'com', 'bat', 'msi'], - 'application/x-msmediaview' => ['mvb', 'm13', 'm14'], - 'application/x-msmetafile' => ['wmf', 'wmz', 'emf', 'emz'], - 'application/x-msmoney' => ['mny'], - 'application/x-mspublisher' => ['pub'], - 'application/x-msschedule' => ['scd'], - 'application/x-msterminal' => ['trm'], - 'application/x-mswrite' => ['wri'], - 'application/x-netcdf' => ['nc', 'cdf'], - 'application/x-ns-proxy-autoconfig' => ['pac'], - 'application/x-nzb' => ['nzb'], - 'application/x-perl' => ['pl', 'pm'], - 'application/x-pilot' => ['prc', 'pdb'], - 'application/x-pkcs12' => ['p12', 'pfx'], - 'application/x-pkcs7-certificates' => ['p7b', 'spc'], - 'application/x-pkcs7-certreqresp' => ['p7r'], - 'application/x-rar-compressed' => ['rar'], - 'application/x-redhat-package-manager' => ['rpm'], - 'application/x-research-info-systems' => ['ris'], - 'application/x-sea' => ['sea'], - 'application/x-sh' => ['sh'], - 'application/x-shar' => ['shar'], - 'application/x-shockwave-flash' => ['swf'], - 'application/x-silverlight-app' => ['xap'], - 'application/x-sql' => ['sql'], - 'application/x-stuffit' => ['sit'], - 'application/x-stuffitx' => ['sitx'], - 'application/x-subrip' => ['srt'], - 'application/x-sv4cpio' => ['sv4cpio'], - 'application/x-sv4crc' => ['sv4crc'], - 'application/x-t3vm-image' => ['t3'], - 'application/x-tads' => ['gam'], - 'application/x-tar' => ['tar', 'tgz'], - 'application/x-tcl' => ['tcl', 'tk'], - 'application/x-tex' => ['tex'], - 'application/x-tex-tfm' => ['tfm'], - 'application/x-texinfo' => ['texinfo', 'texi'], - 'application/x-tgif' => ['obj'], - 'application/x-ustar' => ['ustar'], - 'application/x-virtualbox-hdd' => ['hdd'], - 'application/x-virtualbox-ova' => ['ova'], - 'application/x-virtualbox-ovf' => ['ovf'], - 'application/x-virtualbox-vbox' => ['vbox'], - 'application/x-virtualbox-vbox-extpack' => ['vbox-extpack'], - 'application/x-virtualbox-vdi' => ['vdi'], - 'application/x-virtualbox-vhd' => ['vhd'], - 'application/x-virtualbox-vmdk' => ['vmdk'], - 'application/x-wais-source' => ['src'], - 'application/x-web-app-manifest+json' => ['webapp'], - 'application/x-x509-ca-cert' => ['der', 'crt', 'pem'], - 'application/x-xfig' => ['fig'], - 'application/x-xliff+xml' => ['xlf'], - 'application/x-xpinstall' => ['xpi'], - 'application/x-xz' => ['xz'], - 'application/x-zmachine' => ['z1', 'z2', 'z3', 'z4', 'z5', 'z6', 'z7', 'z8'], - 'application/xaml+xml' => ['xaml'], - 'application/xcap-att+xml' => ['xav'], - 'application/xcap-caps+xml' => ['xca'], - 'application/xcap-diff+xml' => ['xdf'], - 'application/xcap-el+xml' => ['xel'], - 'application/xcap-ns+xml' => ['xns'], - 'application/xenc+xml' => ['xenc'], - 'application/xfdf' => ['xfdf'], - 'application/xhtml+xml' => ['xhtml', 'xht'], - 'application/xliff+xml' => ['xlf'], - 'application/xml' => ['xml', 'xsl', 'xsd', 'rng'], - 'application/xml-dtd' => ['dtd'], - 'application/xop+xml' => ['xop'], - 'application/xproc+xml' => ['xpl'], - 'application/xslt+xml' => ['xsl', 'xslt'], - 'application/xspf+xml' => ['xspf'], - 'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'], - 'application/yang' => ['yang'], - 'application/yin+xml' => ['yin'], - 'application/zip' => ['zip'], - 'audio/3gpp' => ['3gpp'], - 'audio/aac' => ['adts', 'aac'], - 'audio/adpcm' => ['adp'], - 'audio/amr' => ['amr'], - 'audio/basic' => ['au', 'snd'], - 'audio/midi' => ['mid', 'midi', 'kar', 'rmi'], - 'audio/mobile-xmf' => ['mxmf'], - 'audio/mp3' => ['mp3'], - 'audio/mp4' => ['m4a', 'mp4a'], - 'audio/mpeg' => ['mpga', 'mp2', 'mp2a', 'mp3', 'm2a', 'm3a'], - 'audio/ogg' => ['oga', 'ogg', 'spx', 'opus'], - 'audio/s3m' => ['s3m'], - 'audio/silk' => ['sil'], - 'audio/vnd.dece.audio' => ['uva', 'uvva'], - 'audio/vnd.digital-winds' => ['eol'], - 'audio/vnd.dra' => ['dra'], - 'audio/vnd.dts' => ['dts'], - 'audio/vnd.dts.hd' => ['dtshd'], - 'audio/vnd.lucent.voice' => ['lvp'], - 'audio/vnd.ms-playready.media.pya' => ['pya'], - 'audio/vnd.nuera.ecelp4800' => ['ecelp4800'], - 'audio/vnd.nuera.ecelp7470' => ['ecelp7470'], - 'audio/vnd.nuera.ecelp9600' => ['ecelp9600'], - 'audio/vnd.rip' => ['rip'], - 'audio/wav' => ['wav'], - 'audio/wave' => ['wav'], - 'audio/webm' => ['weba'], - 'audio/x-aac' => ['aac'], - 'audio/x-aiff' => ['aif', 'aiff', 'aifc'], - 'audio/x-caf' => ['caf'], - 'audio/x-flac' => ['flac'], - 'audio/x-m4a' => ['m4a'], - 'audio/x-matroska' => ['mka'], - 'audio/x-mpegurl' => ['m3u'], - 'audio/x-ms-wax' => ['wax'], - 'audio/x-ms-wma' => ['wma'], - 'audio/x-pn-realaudio' => ['ram', 'ra', 'rm'], - 'audio/x-pn-realaudio-plugin' => ['rmp', 'rpm'], - 'audio/x-realaudio' => ['ra'], - 'audio/x-wav' => ['wav'], - 'audio/xm' => ['xm'], - 'chemical/x-cdx' => ['cdx'], - 'chemical/x-cif' => ['cif'], - 'chemical/x-cmdf' => ['cmdf'], - 'chemical/x-cml' => ['cml'], - 'chemical/x-csml' => ['csml'], - 'chemical/x-xyz' => ['xyz'], - 'font/collection' => ['ttc'], - 'font/otf' => ['otf'], - 'font/ttf' => ['ttf'], - 'font/woff' => ['woff'], - 'font/woff2' => ['woff2'], - 'image/aces' => ['exr'], - 'image/apng' => ['apng'], - 'image/avci' => ['avci'], - 'image/avcs' => ['avcs'], - 'image/avif' => ['avif'], - 'image/bmp' => ['bmp', 'dib'], - 'image/cgm' => ['cgm'], - 'image/dicom-rle' => ['drle'], - 'image/dpx' => ['dpx'], - 'image/emf' => ['emf'], - 'image/fits' => ['fits'], - 'image/g3fax' => ['g3'], - 'image/gif' => ['gif'], - 'image/heic' => ['heic'], - 'image/heic-sequence' => ['heics'], - 'image/heif' => ['heif'], - 'image/heif-sequence' => ['heifs'], - 'image/hej2k' => ['hej2'], - 'image/hsj2' => ['hsj2'], - 'image/ief' => ['ief'], - 'image/jls' => ['jls'], - 'image/jp2' => ['jp2', 'jpg2'], - 'image/jpeg' => ['jpeg', 'jpg', 'jpe'], - 'image/jph' => ['jph'], - 'image/jphc' => ['jhc'], - 'image/jpm' => ['jpm', 'jpgm'], - 'image/jpx' => ['jpx', 'jpf'], - 'image/jxr' => ['jxr'], - 'image/jxra' => ['jxra'], - 'image/jxrs' => ['jxrs'], - 'image/jxs' => ['jxs'], - 'image/jxsc' => ['jxsc'], - 'image/jxsi' => ['jxsi'], - 'image/jxss' => ['jxss'], - 'image/ktx' => ['ktx'], - 'image/ktx2' => ['ktx2'], - 'image/png' => ['png'], - 'image/prs.btif' => ['btif', 'btf'], - 'image/prs.pti' => ['pti'], - 'image/sgi' => ['sgi'], - 'image/svg+xml' => ['svg', 'svgz'], - 'image/t38' => ['t38'], - 'image/tiff' => ['tif', 'tiff'], - 'image/tiff-fx' => ['tfx'], - 'image/vnd.adobe.photoshop' => ['psd'], - 'image/vnd.airzip.accelerator.azv' => ['azv'], - 'image/vnd.dece.graphic' => ['uvi', 'uvvi', 'uvg', 'uvvg'], - 'image/vnd.djvu' => ['djvu', 'djv'], - 'image/vnd.dvb.subtitle' => ['sub'], - 'image/vnd.dwg' => ['dwg'], - 'image/vnd.dxf' => ['dxf'], - 'image/vnd.fastbidsheet' => ['fbs'], - 'image/vnd.fpx' => ['fpx'], - 'image/vnd.fst' => ['fst'], - 'image/vnd.fujixerox.edmics-mmr' => ['mmr'], - 'image/vnd.fujixerox.edmics-rlc' => ['rlc'], - 'image/vnd.microsoft.icon' => ['ico'], - 'image/vnd.ms-dds' => ['dds'], - 'image/vnd.ms-modi' => ['mdi'], - 'image/vnd.ms-photo' => ['wdp'], - 'image/vnd.net-fpx' => ['npx'], - 'image/vnd.pco.b16' => ['b16'], - 'image/vnd.tencent.tap' => ['tap'], - 'image/vnd.valve.source.texture' => ['vtf'], - 'image/vnd.wap.wbmp' => ['wbmp'], - 'image/vnd.xiff' => ['xif'], - 'image/vnd.zbrush.pcx' => ['pcx'], - 'image/webp' => ['webp'], - 'image/wmf' => ['wmf'], - 'image/x-3ds' => ['3ds'], - 'image/x-cmu-raster' => ['ras'], - 'image/x-cmx' => ['cmx'], - 'image/x-freehand' => ['fh', 'fhc', 'fh4', 'fh5', 'fh7'], - 'image/x-icon' => ['ico'], - 'image/x-jng' => ['jng'], - 'image/x-mrsid-image' => ['sid'], - 'image/x-ms-bmp' => ['bmp'], - 'image/x-pcx' => ['pcx'], - 'image/x-pict' => ['pic', 'pct'], - 'image/x-portable-anymap' => ['pnm'], - 'image/x-portable-bitmap' => ['pbm'], - 'image/x-portable-graymap' => ['pgm'], - 'image/x-portable-pixmap' => ['ppm'], - 'image/x-rgb' => ['rgb'], - 'image/x-tga' => ['tga'], - 'image/x-xbitmap' => ['xbm'], - 'image/x-xpixmap' => ['xpm'], - 'image/x-xwindowdump' => ['xwd'], - 'message/disposition-notification' => ['disposition-notification'], - 'message/global' => ['u8msg'], - 'message/global-delivery-status' => ['u8dsn'], - 'message/global-disposition-notification' => ['u8mdn'], - 'message/global-headers' => ['u8hdr'], - 'message/rfc822' => ['eml', 'mime'], - 'message/vnd.wfa.wsc' => ['wsc'], - 'model/3mf' => ['3mf'], - 'model/gltf+json' => ['gltf'], - 'model/gltf-binary' => ['glb'], - 'model/iges' => ['igs', 'iges'], - 'model/jt' => ['jt'], - 'model/mesh' => ['msh', 'mesh', 'silo'], - 'model/mtl' => ['mtl'], - 'model/obj' => ['obj'], - 'model/prc' => ['prc'], - 'model/step+xml' => ['stpx'], - 'model/step+zip' => ['stpz'], - 'model/step-xml+zip' => ['stpxz'], - 'model/stl' => ['stl'], - 'model/u3d' => ['u3d'], - 'model/vnd.cld' => ['cld'], - 'model/vnd.collada+xml' => ['dae'], - 'model/vnd.dwf' => ['dwf'], - 'model/vnd.gdl' => ['gdl'], - 'model/vnd.gtw' => ['gtw'], - 'model/vnd.mts' => ['mts'], - 'model/vnd.opengex' => ['ogex'], - 'model/vnd.parasolid.transmit.binary' => ['x_b'], - 'model/vnd.parasolid.transmit.text' => ['x_t'], - 'model/vnd.pytha.pyox' => ['pyo', 'pyox'], - 'model/vnd.sap.vds' => ['vds'], - 'model/vnd.usda' => ['usda'], - 'model/vnd.usdz+zip' => ['usdz'], - 'model/vnd.valve.source.compiled-map' => ['bsp'], - 'model/vnd.vtu' => ['vtu'], - 'model/vrml' => ['wrl', 'vrml'], - 'model/x3d+binary' => ['x3db', 'x3dbz'], - 'model/x3d+fastinfoset' => ['x3db'], - 'model/x3d+vrml' => ['x3dv', 'x3dvz'], - 'model/x3d+xml' => ['x3d', 'x3dz'], - 'model/x3d-vrml' => ['x3dv'], - 'text/cache-manifest' => ['appcache', 'manifest'], - 'text/calendar' => ['ics', 'ifb'], - 'text/coffeescript' => ['coffee', 'litcoffee'], - 'text/css' => ['css'], - 'text/csv' => ['csv'], - 'text/html' => ['html', 'htm', 'shtml'], - 'text/jade' => ['jade'], - 'text/javascript' => ['js', 'mjs'], - 'text/jsx' => ['jsx'], - 'text/less' => ['less'], - 'text/markdown' => ['md', 'markdown'], - 'text/mathml' => ['mml'], - 'text/mdx' => ['mdx'], - 'text/n3' => ['n3'], - 'text/plain' => ['txt', 'text', 'conf', 'def', 'list', 'log', 'in', 'ini', 'm3u'], - 'text/prs.lines.tag' => ['dsc'], - 'text/richtext' => ['rtx'], - 'text/rtf' => ['rtf'], - 'text/sgml' => ['sgml', 'sgm'], - 'text/shex' => ['shex'], - 'text/slim' => ['slim', 'slm'], - 'text/spdx' => ['spdx'], - 'text/stylus' => ['stylus', 'styl'], - 'text/tab-separated-values' => ['tsv'], - 'text/troff' => ['t', 'tr', 'roff', 'man', 'me', 'ms'], - 'text/turtle' => ['ttl'], - 'text/uri-list' => ['uri', 'uris', 'urls'], - 'text/vcard' => ['vcard'], - 'text/vnd.curl' => ['curl'], - 'text/vnd.curl.dcurl' => ['dcurl'], - 'text/vnd.curl.mcurl' => ['mcurl'], - 'text/vnd.curl.scurl' => ['scurl'], - 'text/vnd.dvb.subtitle' => ['sub'], - 'text/vnd.familysearch.gedcom' => ['ged'], - 'text/vnd.fly' => ['fly'], - 'text/vnd.fmi.flexstor' => ['flx'], - 'text/vnd.graphviz' => ['gv'], - 'text/vnd.in3d.3dml' => ['3dml'], - 'text/vnd.in3d.spot' => ['spot'], - 'text/vnd.sun.j2me.app-descriptor' => ['jad'], - 'text/vnd.wap.wml' => ['wml'], - 'text/vnd.wap.wmlscript' => ['wmls'], - 'text/vtt' => ['vtt'], - 'text/wgsl' => ['wgsl'], - 'text/x-asm' => ['s', 'asm'], - 'text/x-c' => ['c', 'cc', 'cxx', 'cpp', 'h', 'hh', 'dic'], - 'text/x-component' => ['htc'], - 'text/x-fortran' => ['f', 'for', 'f77', 'f90'], - 'text/x-handlebars-template' => ['hbs'], - 'text/x-java-source' => ['java'], - 'text/x-lua' => ['lua'], - 'text/x-markdown' => ['mkd'], - 'text/x-nfo' => ['nfo'], - 'text/x-opml' => ['opml'], - 'text/x-org' => ['org'], - 'text/x-pascal' => ['p', 'pas'], - 'text/x-processing' => ['pde'], - 'text/x-sass' => ['sass'], - 'text/x-scss' => ['scss'], - 'text/x-setext' => ['etx'], - 'text/x-sfv' => ['sfv'], - 'text/x-suse-ymp' => ['ymp'], - 'text/x-uuencode' => ['uu'], - 'text/x-vcalendar' => ['vcs'], - 'text/x-vcard' => ['vcf'], - 'text/xml' => ['xml'], - 'text/yaml' => ['yaml', 'yml'], - 'video/3gpp' => ['3gp', '3gpp'], - 'video/3gpp2' => ['3g2'], - 'video/h261' => ['h261'], - 'video/h263' => ['h263'], - 'video/h264' => ['h264'], - 'video/iso.segment' => ['m4s'], - 'video/jpeg' => ['jpgv'], - 'video/jpm' => ['jpm', 'jpgm'], - 'video/mj2' => ['mj2', 'mjp2'], - 'video/mp2t' => ['ts'], - 'video/mp4' => ['mp4', 'mp4v', 'mpg4', 'f4v'], - 'video/mpeg' => ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v'], - 'video/ogg' => ['ogv'], - 'video/quicktime' => ['qt', 'mov'], - 'video/vnd.dece.hd' => ['uvh', 'uvvh'], - 'video/vnd.dece.mobile' => ['uvm', 'uvvm'], - 'video/vnd.dece.pd' => ['uvp', 'uvvp'], - 'video/vnd.dece.sd' => ['uvs', 'uvvs'], - 'video/vnd.dece.video' => ['uvv', 'uvvv'], - 'video/vnd.dvb.file' => ['dvb'], - 'video/vnd.fvt' => ['fvt'], - 'video/vnd.mpegurl' => ['mxu', 'm4u'], - 'video/vnd.ms-playready.media.pyv' => ['pyv'], - 'video/vnd.uvvu.mp4' => ['uvu', 'uvvu'], - 'video/vnd.vivo' => ['viv'], - 'video/webm' => ['webm'], - 'video/x-f4v' => ['f4v'], - 'video/x-fli' => ['fli'], - 'video/x-flv' => ['flv'], - 'video/x-m4v' => ['m4v'], - 'video/x-matroska' => ['mkv', 'mk3d', 'mks'], - 'video/x-mng' => ['mng'], - 'video/x-ms-asf' => ['asf', 'asx'], - 'video/x-ms-vob' => ['vob'], - 'video/x-ms-wm' => ['wm'], - 'video/x-ms-wmv' => ['wmv'], - 'video/x-ms-wmx' => ['wmx'], - 'video/x-ms-wvx' => ['wvx'], - 'video/x-msvideo' => ['avi'], - 'video/x-sgi-movie' => ['movie'], - 'video/x-smv' => ['smv'], - 'x-conference/x-cooltalk' => ['ice'], - 'application/x-photoshop' => ['psd'], - 'application/smil' => ['smi', 'smil'], - 'application/powerpoint' => ['ppt'], - 'application/vnd.ms-powerpoint.addin.macroEnabled.12' => ['ppam'], - 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' => ['pptm', 'potm'], - 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' => ['ppsm'], - 'application/wbxml' => ['wbxml'], - 'application/wmlc' => ['wmlc'], - 'application/x-httpd-php-source' => ['phps'], - 'application/x-compress' => ['z'], - 'application/x-rar' => ['rar'], - 'video/vnd.rn-realvideo' => ['rv'], - 'application/vnd.ms-word.template.macroEnabled.12' => ['docm', 'dotm'], - 'application/vnd.ms-excel.sheet.macroEnabled.12' => ['xlsm'], - 'application/vnd.ms-excel.template.macroEnabled.12' => ['xltm'], - 'application/vnd.ms-excel.addin.macroEnabled.12' => ['xlam'], - 'application/vnd.ms-excel.sheet.binary.macroEnabled.12' => ['xlsb'], - 'application/excel' => ['xl'], - 'application/x-x509-user-cert' => ['pem'], - 'application/x-pkcs10' => ['p10'], - 'application/x-pkcs7-signature' => ['p7a'], - 'application/pgp' => ['pgp'], - 'application/gpg-keys' => ['gpg'], - 'application/x-pkcs7' => ['rsa'], - 'video/3gp' => ['3gp'], - 'audio/acc' => ['aac'], - 'application/vnd.mpegurl' => ['m4u'], - 'application/videolan' => ['vlc'], - 'audio/x-au' => ['au'], - 'audio/ac3' => ['ac3'], - 'text/x-scriptzsh' => ['zsh'], - 'application/cdr' => ['cdr'], - 'application/STEP' => ['step', 'stp'], - 'application/x-ndjson' => ['ndjson'], - 'application/braille' => ['brf'], - ]; - - public function lookupMimeType(string $extension): ?string - { - return self::MIME_TYPES_FOR_EXTENSIONS[$extension] ?? null; - } - - public function lookupExtension(string $mimetype): ?string - { - return self::EXTENSIONS_FOR_MIME_TIMES[$mimetype][0] ?? null; - } - - /** - * @return string[] - */ - public function lookupAllExtensions(string $mimetype): array - { - return self::EXTENSIONS_FOR_MIME_TIMES[$mimetype] ?? []; - } -} diff --git a/trunk/vendor/league/mime-type-detection/src/MimeTypeDetector.php b/trunk/vendor/league/mime-type-detection/src/MimeTypeDetector.php deleted file mode 100644 index 5d799d2a..00000000 --- a/trunk/vendor/league/mime-type-detection/src/MimeTypeDetector.php +++ /dev/null @@ -1,19 +0,0 @@ - $overrides - */ - public function __construct(ExtensionToMimeTypeMap $innerMap, array $overrides) - { - $this->innerMap = $innerMap; - $this->overrides = $overrides; - } - - public function lookupMimeType(string $extension): ?string - { - return $this->overrides[$extension] ?? $this->innerMap->lookupMimeType($extension); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/CHANGELOG.md b/trunk/vendor/phpcompatibility/php-compatibility/CHANGELOG.md deleted file mode 100644 index b92ae254..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/CHANGELOG.md +++ /dev/null @@ -1,1488 +0,0 @@ -# Change Log for the PHPCompatibility standard for PHP Codesniffer - -All notable changes to this project will be documented in this file. - -This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/). - -Up to version 8.0.0, the `major.minor` version numbers were based on the PHP version for which compatibility check support was added, with `patch` version numbers being specific to this library. -From version 8.0.0 onwards, [Semantic Versioning](http://semver.org/) is used. - - - - -## [Unreleased] - -_Nothing yet._ - -## [9.3.5] - 2019-12-27 - -See all related issues and PRs in the [9.3.5 milestone]. - -### Added -- :star: `PHPCompatibility.Classes.NewClasses` sniff: recognize the new `FFI` extension related classes as introduced in PHP 7.4. [#949](https://github.com/PHPCompatibility/PHPCompatibility/pull/949) -- :star: `PHPCompatibility.IniDirectives.NewIniDirectives` sniff: detect use of the new `FFI` extension related ini directives as introduced in PHP 7.4. [#949](https://github.com/PHPCompatibility/PHPCompatibility/pull/949) - -### Changed -- :pencil: `PHPCompatibility.Syntax.NewShortArray`: improved clarity of the error message and made it consistent with other error messages in this standard. [#934](https://github.com/PHPCompatibility/PHPCompatibility/pull/934) -- :pencil: `PHPCompatibility.Interfaces.NewInterfaces`: updated the URL which is mentioned in select error messages. [#942](https://github.com/PHPCompatibility/PHPCompatibility/pull/942) -- :recycle: Another slew of code documentation fixes. [#937](https://github.com/PHPCompatibility/PHPCompatibility/pull/937), [#939](https://github.com/PHPCompatibility/PHPCompatibility/pull/939), [#940](https://github.com/PHPCompatibility/PHPCompatibility/pull/940), [#941](https://github.com/PHPCompatibility/PHPCompatibility/pull/941), [#943](https://github.com/PHPCompatibility/PHPCompatibility/pull/943), [#944](https://github.com/PHPCompatibility/PHPCompatibility/pull/944), [#951](https://github.com/PHPCompatibility/PHPCompatibility/pull/951), [#950](https://github.com/PHPCompatibility/PHPCompatibility/pull/950). Fixes [#734](https://github.com/PHPCompatibility/PHPCompatibility/issues/734). -- :green_heart: Travis: various tweaks. The builds against PHP 7.4 are no longer allowed to fail. [#935](https://github.com/PHPCompatibility/PHPCompatibility/pull/935), [#938](https://github.com/PHPCompatibility/PHPCompatibility/pull/938) - For running the sniffs on PHP 7.4, it is recommended to use PHP_CodeSniffer 3.5.0+ as PHP_CodeSniffer itself is - not compatible with PHP 7.4 until version 3.5.0. - -### Fixed -- :bug: `PHPCompatibility.Classes.NewClasses`: two new PHP 7.4 classes were being checked as if they were Exceptions. [#945](https://github.com/PHPCompatibility/PHPCompatibility/pull/945) - -### Credits -Thanks go out to [William Entriken] for their contribution to this version. :clap: - - -## [9.3.4] - 2019-11-15 - -See all related issues and PRs in the [9.3.4 milestone]. - -### Fixed -- :bug: `PHPCompatibility.Keywords.ForbiddenNames`: false positive for list when used in a `foreach()` condition. [#930](https://github.com/PHPCompatibility/PHPCompatibility/pull/930). Fixes [#928](https://github.com/PHPCompatibility/PHPCompatibility/issues/928), [#929](https://github.com/PHPCompatibility/PHPCompatibility/pull/929) - -### Credits -Thanks go out to [Sergii Bondarenko] for their contribution to this version. :clap: - - -## [9.3.3] - 2019-11-11 - -See all related issues and PRs in the [9.3.3 milestone]. - -### Added -- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of yet more (undocumented) PHP 7.2 Sodium constants. [#924](https://github.com/PHPCompatibility/PHPCompatibility/pull/924) -- :star: `PHPCompatibility.Keywords.ForbiddenNames` sniff: detect the use of more reserved keywords which are not allowed to be used to name certain constructs. [#923](https://github.com/PHPCompatibility/PHPCompatibility/pull/923). Fixes [#922](https://github.com/PHPCompatibility/PHPCompatibility/issues/922) - -### Fixed -- :bug: `PHPCompatibility.FunctionNameRestrictions.RemovedPHP4StyleConstructors`: false positive detecting PHP4-style constructors when declared in interfaces. The class implementing the interface will not have the same name as the interface, so the actual method would not be regarded as a PHP4 style constructor. [#921](https://github.com/PHPCompatibility/PHPCompatibility/pull/921) - -### Credits -Thanks go out to [Nikhil] for their contribution to this version. :clap: - - -## [9.3.2] - 2019-10-16 - -See all related issues and PRs in the [9.3.2 milestone]. - -### Added -- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of the PHP 7.2 `SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13` constant. [#915](https://github.com/PHPCompatibility/PHPCompatibility/pull/915) -- :books: Readme: a list of projects which are build upon or extend PHPCompatibility. [#904](https://github.com/PHPCompatibility/PHPCompatibility/pull/904) - -### Changed -- :pushpin: `PHPCompatibility.FunctionNameRestrictions.RemovedPHP4StyleConstructors`: minor efficiency fix to make the sniff faster. [#912](https://github.com/PHPCompatibility/PHPCompatibility/pull/912) -- :pushpin: `PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames`: functions marked as `@deprecated` in the function docblock will now be ignored by this sniff. [#917](https://github.com/PHPCompatibility/PHPCompatibility/pull/917). Fixes [#911](https://github.com/PHPCompatibility/PHPCompatibility/issues/911) -- :pencil: `PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters`: the `$ooScopeTokens` property is now `protected`, it should never have been `public` in the first place. [#907](https://github.com/PHPCompatibility/PHPCompatibility/pull/907) -- :recycle: More code documentation fixes. [#903](https://github.com/PHPCompatibility/PHPCompatibility/pull/903), [#916](https://github.com/PHPCompatibility/PHPCompatibility/pull/916) -- :books: Readme/Contributing: various tweaks. [#904](https://github.com/PHPCompatibility/PHPCompatibility/pull/904), [#905](https://github.com/PHPCompatibility/PHPCompatibility/pull/905) - -### Fixed -- :bug: `PHPCompatibility.FunctionUse.OptionalToRequiredFunctionParameters`: false positive when a class is instantiated which has the same name as one of the affected functions. [#914](https://github.com/PHPCompatibility/PHPCompatibility/pull/914). Fixes [#913](https://github.com/PHPCompatibility/PHPCompatibility/issues/913) -- :bug: `PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters`: false positive when a class is instantiated which has the same name as one of the affected functions. [#914](https://github.com/PHPCompatibility/PHPCompatibility/pull/914) -- :bug: `PHPCompatibility.MethodUse.NewDirectCallsToClone`: false positive on calling `__clone()` from within the class being cloned [#910](https://github.com/PHPCompatibility/PHPCompatibility/pull/910). Fixes [#629 (comment)](https://github.com/PHPCompatibility/PHPCompatibility/issues/629#issuecomment-532607809) -- :bug: `PHPCompatibility.Miscellaneous.ValidIntegers`: binary numbers using an uppercase `B` were not always recognized correctly. [#909](https://github.com/PHPCompatibility/PHPCompatibility/pull/909) - - -## [9.3.1] - 2019-09-06 - -See all related issues and PRs in the [9.3.1 milestone]. - -### Changed -- :recycle: A whole slew of code documentation fixes. [#892](https://github.com/PHPCompatibility/PHPCompatibility/pull/892), [#895](https://github.com/PHPCompatibility/PHPCompatibility/pull/895), [#896](https://github.com/PHPCompatibility/PHPCompatibility/pull/896), [#897](https://github.com/PHPCompatibility/PHPCompatibility/pull/897), [#898](https://github.com/PHPCompatibility/PHPCompatibility/pull/898), [#899](https://github.com/PHPCompatibility/PHPCompatibility/pull/899), [#900](https://github.com/PHPCompatibility/PHPCompatibility/pull/900) -- :wrench: Travis: minor tweaks to the build script. [#893](https://github.com/PHPCompatibility/PHPCompatibility/pull/893) - -### Fixed -- :bug: `PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder`: false positive when an array item in the second parameter contained a ternary. [#891](https://github.com/PHPCompatibility/PHPCompatibility/pull/891). Fixes [#890](https://github.com/PHPCompatibility/PHPCompatibility/issues/890) -- :bug: `PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder`: will now take array casts into account when determining which parameter is `$pieces`. [#891](https://github.com/PHPCompatibility/PHPCompatibility/pull/891). -- :bug: `PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder`: hardening of the logic to not examine the second parameter when the first is just and only a text string (`$glue`). [#891](https://github.com/PHPCompatibility/PHPCompatibility/pull/891). - - -## [9.3.0] - 2019-08-29 - -See all related issues and PRs in the [9.3.0 milestone]. - -To keep informed of the progress of covering "_everything PHP 7.4_" in PHPCompatibility, please subscribe to issue [#808](https://github.com/PHPCompatibility/PHPCompatibility/issues/808). - -### Changes expected in PHPCompatibility 10.0.0 -The next version of PHPCompatibility is expected to include a new external dependency. - -In this same release, support for PHP < 5.4 and PHP_CodeSniffer < 2.6.0 will be dropped. - -The `10.0.0` release is expected around the same time as the release of PHP 7.4 - end of November/beginning of December 2019. - -### Added -- :star2: New `PHPCompatibility.Miscellaneous.NewPHPOpenTagEOF` sniff to detect a stand-alone PHP open tag at the end of a file, without trailing newline, as will be supported as of PHP 7.4. [#843](https://github.com/PHPCompatibility/PHPCompatibility/pull/846) -- :star2: New `PHPCompatibility.ParameterValues.ForbiddenStripTagsSelfClosingXHTML` sniff to detect calls to `strip_tags()` passing self-closing XHTML tags in the `$allowable_tags` parameter. This has not been supported since PHP 5.3.4. [#866](https://github.com/PHPCompatibility/PHPCompatibility/pull/866) -- :star2: New `PHPCompatibility.ParameterValues.NewHTMLEntitiesEncodingDefault` sniff to detect calls to `html_entity_decode()`, `htmlentities()` and `htmlspecialchars()` which are impacted by the change to the default value of the `$encoding` parameter in PHP 5.4. [#862](https://github.com/PHPCompatibility/PHPCompatibility/pull/862) -- :star2: New `PHPCompatibility.ParameterValues.NewIconvMbstringCharsetDefault` sniff to detect code impacted by the change in the `default_charset` value in PHP 5.6. [#864](https://github.com/PHPCompatibility/PHPCompatibility/pull/864) Fixes [#839](https://github.com/PHPCompatibility/PHPCompatibility/issues/839) -- :star2: New `PHPCompatibility.ParameterValues.NewIDNVariantDefault` sniff to detect calls to `idn_to_ascii()` and `idn_to_utf8()` impacted by the PHP 7.4 change in the default value for the `$variant` parameter. [#861](https://github.com/PHPCompatibility/PHPCompatibility/pull/861) -- :star2: New `PHPCompatibility.ParameterValues.NewPasswordAlgoConstantValues` sniff to detect calls to `password_hash()` and `password_needs_rehash()` impacted by the changed value of the `PASSWORD_DEFAULT`, `PASSWORD_BCRYPT`, `PASSWORD_ARGON2I` and `PASSWORD_ARGON2ID` constants in PHP 7.4. [#865](https://github.com/PHPCompatibility/PHPCompatibility/pull/865) -- :star2: New `PHPCompatibility.ParameterValues.NewProcOpenCmdArray` sniff to detect calls to `proc_open()` passing an array for the `$cmd` parameter as supported as of PHP 7.4. [#869](https://github.com/PHPCompatibility/PHPCompatibility/pull/869) -- :star2: New `PHPCompatibility.ParameterValues.NewStripTagsAllowableTagsArray` sniff to detect calls to `strip_tags()` passing an array for the `$allowable_tags` parameter as will be supported as of PHP 7.4. [#867](https://github.com/PHPCompatibility/PHPCompatibility/pull/867) -- :star2: New `PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder` sniff to detect `implode()` being called with `$glue` and `$pieces` in reverse order from the documented argument order. This was previously allowed for historical reasons, but will be deprecated in PHP 7.4. [#846](https://github.com/PHPCompatibility/PHPCompatibility/pull/846) -- :star2: New `PHPCompatibility.ParameterValues.RemovedMbStrrposEncodingThirdParam` sniff to detect the `$encoding` being passed as the third, instead of the fourth parameter, to `mb_strrpos()` as has been soft deprecated since PHP 5.2 and will be hard deprecated as of PHP 7.4. [#860](https://github.com/PHPCompatibility/PHPCompatibility/pull/860) -- :star2: New `PHPCompatibility.Syntax.RemovedCurlyBraceArrayAccess` sniff to detect array and string offset access using curly braces as will be deprecated as of PHP 7.4. [#855](https://github.com/PHPCompatibility/PHPCompatibility/pull/855) - - In contrast to any other sniff in the PHPCompatibility standard, this sniff contains an auto-fixer. -- :star2: New `PHPCompatibility.TextStrings.NewUnicodeEscapeSequence` sniff to detect use of the PHP 7.0+ unicode codepoint escape sequences and issues with invalid sequences. [#856](https://github.com/PHPCompatibility/PHPCompatibility/pull/856) -- :star2: New `PHPCompatibility.Upgrade.LowPHP` sniff to give users of old PHP versions advance warning when support will be dropped in the near future. [#838](https://github.com/PHPCompatibility/PHPCompatibility/pull/838) - At this moment, the intention is to drop support for PHP 5.3 by the end of this year. -- :star: `PHPCompatibility.Classes.NewClasses` sniff: recognize the new `WeakReference` class as introduced in PHP 7.4. [#857](https://github.com/PHPCompatibility/PHPCompatibility/pull/857) -- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of new Curl constants as introduced in PHP 7.3.5. [#878](https://github.com/PHPCompatibility/PHPCompatibility/pull/878) -- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of the revived `T_BAD_CHARACTER` constant as re-introduced in PHP 7.4. [#882](https://github.com/PHPCompatibility/PHPCompatibility/pull/882) -- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of the new `IMG_FILTER_SCATTER` and `PASSWORD_ARGON2_PROVIDER` constants as introduced in PHP 7.4. [#887](https://github.com/PHPCompatibility/PHPCompatibility/pull/887) -- :star: `PHPCompatibility.Constants.RemovedConstants` sniff: detection of use of the `CURLPIPE_HTTP1` constant which will be deprecated in PHP 7.4. [#879](https://github.com/PHPCompatibility/PHPCompatibility/pull/879) -- :star: `PHPCompatibility.Constants.RemovedConstants` sniff: detection of use of the `FILTER_SANITIZE_MAGIC_QUOTES` constant which will be deprecated in PHP 7.4. [#845](https://github.com/PHPCompatibility/PHPCompatibility/pull/845) -- :star: `PHPCompatibility.Constants.RemovedConstants` sniff: detection of use of the `T_CHARACTER` and `T_BAD_CHARACTER` constants which were removed in PHP 7.0. [#882](https://github.com/PHPCompatibility/PHPCompatibility/pull/882) -- :star: `PHPCompatibility.FunctionDeclarations.NewMagicMethods` sniff: recognize the new `__serialize()` and `__unserialize()` magic methods as introduced in PHP 7.4. [#868](https://github.com/PHPCompatibility/PHPCompatibility/pull/868) -- :star: `PHPCompatibility.FunctionDeclarations.NewMagicMethods` sniff: recognize the PHP 5.0 `__construct()` and `__destruct()` magic methods. [#884](https://github.com/PHPCompatibility/PHPCompatibility/pull/884) -- :star: `PHPCompatibility.FunctionDeclarations.NonStaticMagicMethods` sniff: recognize the new `__serialize()` and `__unserialize()` magic methods as introduced in PHP 7.4. [#868](https://github.com/PHPCompatibility/PHPCompatibility/pull/868) -- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: recognize the new PHP 7.4 function `imagecreatefromtga()`. [#873](https://github.com/PHPCompatibility/PHPCompatibility/pull/873) -- :star: `PHPCompatibility.FunctionUse.RemovedFunctionParameters` sniff: recognize the deprecation of the `$age` parameter of the `curl_version()` function. [#874](https://github.com/PHPCompatibility/PHPCompatibility/pull/874) -- :star: `PHPCompatibility.FunctionUse.RemovedFunctions` sniff: recognize the PHP 7.4 deprecated `convert_cyr_string()()`, `ezmlm_hash()`, `get_magic_quotes_gpc()`, `get_magic_quotes_runtime()`, `hebrevc()`, `is_real()`, `money_format()` and `restore_include_path()` functions. [#847](https://github.com/PHPCompatibility/PHPCompatibility/pull/847) -- :star: `PHPCompatibility.IniDirectives.NewIniDirectives` sniff: detect use of the new PHP 7.4 `zend.exception_ignore_args` ini directive. [#871](https://github.com/PHPCompatibility/PHPCompatibility/pull/871) -- :star: `PHPCompatibility.IniDirectives.RemovedIniDirectives` sniff: detect use of the `allow_url_include` ini directive which is deprecated as of PHP 7.4. [#870](https://github.com/PHPCompatibility/PHPCompatibility/pull/870) -- :star: `PHPCompatibility.IniDirectives.RemovedIniDirectives` sniff: detection of use of the `opcache.load_comments` directive which was removed in PHP 7.0. [#883](https://github.com/PHPCompatibility/PHPCompatibility/pull/883) -- :star: `PHPCompatibility.ParameterValues.NewHashAlgorithms`: recognize use of the new PHP 7.4 `crc32c` hash algorithm. [#872](https://github.com/PHPCompatibility/PHPCompatibility/pull/872) -- :star: `PHPCompatibility.TypeCasts.RemovedTypeCasts` sniff: detect usage of the `(real)` type cast which will be deprecated in PHP 7.4. [#844](https://github.com/PHPCompatibility/PHPCompatibility/pull/844) -- :star: Recognize the `recode` extension functionality which will be removed in PHP 7.4 (moved to PECL) in the `RemovedExtensions` and `RemovedFunctions` sniffs. [#841](https://github.com/PHPCompatibility/PHPCompatibility/pull/841) -- :star: Recognize the `OPcache` extension functionality which was be introduced in PHP 5.5, but not yet fully accounted for in the `NewFunctions` and `NewIniDirectives` sniffs. [#883](https://github.com/PHPCompatibility/PHPCompatibility/pull/883) -- :star: New `getCompleteTextString()` utility method to the `PHPCompatibility\Sniff` class. [#856](https://github.com/PHPCompatibility/PHPCompatibility/pull/856) -- :umbrella: Unit test for the `PHPCompatibility.Upgrade.LowPHPCS` sniff. -- :umbrella: Some extra unit tests for the `PHPCompatibility.ParameterValues.NewNegativeStringOffset`, `PHPCompatibility.ParameterValues.RemovedMbStringModifiers` and sniffs. [#876](https://github.com/PHPCompatibility/PHPCompatibility/pull/876), [#877](https://github.com/PHPCompatibility/PHPCompatibility/pull/877) -- :books: `CONTRIBUTING.md`: Added a list of typical sources for information about changes to PHP. [#875](https://github.com/PHPCompatibility/PHPCompatibility/pull/875) - -### Changed -- :pushpin: `PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString` sniff: the sniff will now also examine the function docblock, if available, and will throw an error when a `@throws` tag is found in the docblock. [#880](https://github.com/PHPCompatibility/PHPCompatibility/pull/880). Fixes [#863](https://github.com/PHPCompatibility/PHPCompatibility/issues/863) -- :pushpin: `PHPCompatibility.FunctionDeclarations.NonStaticMagicMethods` sniff: will now also check the visibility and `static` (or not) requirements of the magic `__construct()`, `__destruct()`, `__clone()`, `__debugInfo()`, `__invoke()` and `__set_state()` methods. [#885](https://github.com/PHPCompatibility/PHPCompatibility/pull/885) -- :pushpin: `PHPCompatibility.Syntax.NewArrayStringDereferencing` sniff: the sniff will now also recognize array string dereferencing using curly braces as was (silently) supported since PHP 7.0. [#851](https://github.com/PHPCompatibility/PHPCompatibility/pull/851) - - The sniff will now also throw errors for each dereference found on the array/string, not just the first one. -- :pushpin: `PHPCompatibility.Syntax.NewClassMemberAccess` sniff: the sniff will now also recognize class member access on instantiation and cloning using curly braces as was (silently) supported since PHP 7.0. [#852](https://github.com/PHPCompatibility/PHPCompatibility/pull/852) - - The sniff will now also throw errors for each access detected, not just the first one. - - The line number on which the error is thrown in now set more precisely. -- :pushpin: `PHPCompatibility.Syntax.NewFunctionArrayDereferencing` sniff: the sniff will now also recognize function array dereferencing using curly braces as was (silently) supported since PHP 7.0. [#853](https://github.com/PHPCompatibility/PHPCompatibility/pull/853) - - The sniff will now also throw errors for each access detected, not just the first one. - - The line number on which the error is thrown in now set more precisely. -- :recycle: Various code clean-up and improvements. [#849](https://github.com/PHPCompatibility/PHPCompatibility/pull/849), [#850](https://github.com/PHPCompatibility/PHPCompatibility/pull/850) -- :recycle: Various minor inline documentation fixes. [#854](https://github.com/PHPCompatibility/PHPCompatibility/pull/854), [#886](https://github.com/PHPCompatibility/PHPCompatibility/pull/886) -- :wrench: Travis: various tweaks to the build script. [#834](https://github.com/PHPCompatibility/PHPCompatibility/pull/834), [#842](https://github.com/PHPCompatibility/PHPCompatibility/pull/842) - -### Fixed -- :bug: `PHPCompatibility.FunctionDeclarations.ForbiddenParametersWithSameName` sniff: variable names are case-sensitive, so recognition of same named parameters should be done in a case-sensitive manner. [#848](https://github.com/PHPCompatibility/PHPCompatibility/pull/848) -- :bug: `PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString` sniff: Exceptions thrown within a `try` should not trigger the sniff. [#880](https://github.com/PHPCompatibility/PHPCompatibility/pull/880). Fixes [#863](https://github.com/PHPCompatibility/PHPCompatibility/issues/863) -- :bug: `PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString` sniff: the `$ooScopeTokens` property should never have been a public property. [#880](https://github.com/PHPCompatibility/PHPCompatibility/pull/880). -- :umbrella: Some of the unit tests for the `PHPCompatibility.Operators.RemovedTernaryAssociativity` sniff were not being run. [#836](https://github.com/PHPCompatibility/PHPCompatibility/pull/836) - - -## [9.2.0] - 2019-06-28 - -See all related issues and PRs in the [9.2.0 milestone]. - -To keep informed of the progress of covering "_everything PHP 7.4_" in PHPCompatibility, please subscribe to issue [#808](https://github.com/PHPCompatibility/PHPCompatibility/issues/808). - -### Added -- :star2: New `PHPCompatibility.Classes.ForbiddenAbstractPrivateMethods` sniff to detect methods declared as both `private` as well as `abstract`. This was allowed between PHP 5.0.0 and 5.0.4, but disallowed in PHP 5.1 as the behaviour of `private` and `abstract` are mutually exclusive. [#822](https://github.com/PHPCompatibility/PHPCompatibility/pull/822) -- :star2: New `PHPCompatibility.Classes.NewTypedProperties` sniff to detect PHP 7.4 typed property declarations. [#801](https://github.com/PHPCompatibility/PHPCompatibility/pull/801), [#829](https://github.com/PHPCompatibility/PHPCompatibility/pull/829) -- :star2: New `PHPCompatibility.Classes.RemovedOrphanedParent` sniff to detect the use of the `parent` keyword in classes without a parent (non-extended classes). This code pattern is deprecated in PHP 7.4 and will become a compile-error in PHP 8.0. [#818](https://github.com/PHPCompatibility/PHPCompatibility/pull/818) -- :star2: New `PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString` sniff to detect throwing exceptions from `__toString()` methods. This would previously result in a fatal error, but will be allowed as of PHP 7.4. [#814](https://github.com/PHPCompatibility/PHPCompatibility/pull/814) -- :star2: New `PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters` sniff to detect `__toString()` function declarations expecting parameters. This was disallowed in PHP 5.3. [#815](https://github.com/PHPCompatibility/PHPCompatibility/pull/815) -- :star2: New `PHPCompatibility.MethodUse.ForbiddenToStringParameters` sniff to detect direct calls to `__toString()` magic methods passing parameters. This was disallowed in PHP 5.3. [#830](https://github.com/PHPCompatibility/PHPCompatibility/pull/830) -- :star2: New `PHPCompatibility.Operators.ChangedConcatOperatorPrecedence` sniff to detect code affected by the upcoming change in operator precedence for the concatenation operator. The concatenation operator precedence will be lowered in PHP 8.0, with deprecation notices for code affected being thrown in PHP 7.4. [#805](https://github.com/PHPCompatibility/PHPCompatibility/pull/805) -- :star2: New `PHPCompatibility.Operators.RemovedTernaryAssociativity` sniff to detect code relying on left-associativity of the ternary operator. This behaviour will be deprecated in PHP 7.4 and removed in PHP 8.0. [#810](https://github.com/PHPCompatibility/PHPCompatibility/pull/810) -- :star2: New `PHPCompatibility.Syntax.NewArrayUnpacking` sniff to detect the use of the spread operator to unpack arrays when declaring a new array, as introduced in PHP 7.4. [#804](https://github.com/PHPCompatibility/PHPCompatibility/pull/804) -- :star: `PHPCompatibility.Classes.NewClasses` sniff: recognize the new `ReflectionReference` class as introduced in PHP 7.4. [#820](https://github.com/PHPCompatibility/PHPCompatibility/pull/820) -- :star: `PHPCompatibility.Constants.NewConstants` sniff: detection of the new PHP 7.4 Core (Standard), MBString, Socket and Tidy constants. [#821](https://github.com/PHPCompatibility/PHPCompatibility/pull/821) -- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: detect usage of the new PHP 7.4 `get_mangled_object_vars()`, `mb_str_split()`, `openssl_x509_verify()`, `password_algos()`, `pcntl_unshare()`, `sapi_windows_set_ctrl_handler()` and `sapi_windows_generate_ctrl_event()` functions. [#811](https://github.com/PHPCompatibility/PHPCompatibility/pull/811), [#819](https://github.com/PHPCompatibility/PHPCompatibility/pull/819), [#827](https://github.com/PHPCompatibility/PHPCompatibility/pull/827) -- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: recognize the new OCI functions as introduced in PHP 7.2.14 and PHP 7.3.1. [#786](https://github.com/PHPCompatibility/PHPCompatibility/pull/786) -- :star: `PHPCompatibility.FunctionUse.RemovedFunctions` sniff: recognize the PHP 7.4 deprecated `ldap_control_paged_result_response()` and `ldap_control_paged_result()` functions. [#831](https://github.com/PHPCompatibility/PHPCompatibility/pull/831) -- :star: `PHPCompatibility.FunctionUse.RemovedFunctions` sniff: recognize the `Payflow Pro/pfpro` functions as removed in PHP 5.1. [#823](https://github.com/PHPCompatibility/PHPCompatibility/pull/823) -- :star: `PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters` sniff: account for the parameters for `array_merge()` and `array_merge_recursive()` becoming optional in PHP 7.4. [#817](https://github.com/PHPCompatibility/PHPCompatibility/pull/817) -- :star: `PHPCompatibility.IniDirectives.RemovedIniDirectives` sniff: recognize the `Payflow Pro/pfpro` ini directives as removed in PHP 5.1. [#823](https://github.com/PHPCompatibility/PHPCompatibility/pull/823) -- :star: Recognize the `interbase/Firebird` extension functionality which will be removed in PHP 7.4 (moved to PECL) in the `RemovedConstants`, `RemovedExtensions`, `RemovedFunctions` and `RemovedIniDirectives` sniffs. [#807](https://github.com/PHPCompatibility/PHPCompatibility/pull/807) -- :star: Recognize the `wddx` extension functionality which will be removed in PHP 7.4 (moved to PECL) in the `RemovedExtensions` and `RemovedFunctions` sniffs. [#826](https://github.com/PHPCompatibility/PHPCompatibility/pull/826) -- :star: New `isShortTernary()` and `isUnaryPlusMinus()` utility methods to the `PHPCompatibility\Sniff` class. [#810](https://github.com/PHPCompatibility/PHPCompatibility/pull/810), [#805](https://github.com/PHPCompatibility/PHPCompatibility/pull/805) - -### Changed -- :pencil2: The `PHPCompatibility.Extensions.RemovedExtensions` sniff will now only report on the removed `Payflow Pro` extension when a function uses `pfpro_` as a prefix. Previously, it used the `pfpro` prefix (without underscore) for detection. [#812](https://github.com/PHPCompatibility/PHPCompatibility/pull/812) -- :pencil2: The error message thrown when the `T_ELLIPSIS` token, i.e. the spread operator, is detected. [#803](https://github.com/PHPCompatibility/PHPCompatibility/pull/803) - PHP 7.4 adds a third use-case for the spread operator. The adjusted error message accounts for this. -- :umbrella: `PHPCompatibility.FunctionDeclarations.NewParamTypeDeclarations` is now also tested with parameters using the splat operator. [#802](https://github.com/PHPCompatibility/PHPCompatibility/pull/802) -- :books: The documentation now uses the GitHub repo of `PHP_CodeSniffer` as the canonical entry point for `PHP_CodeSniffer`. Previously, it would point to the PEAR package. [#788](https://github.com/PHPCompatibility/PHPCompatibility/pull/788) -- :books: The links in the changelog now all point to the `PHPCompatibility/PHPCompatibility` repo and no longer to the (deprecated) `wimg/PHPCompatibility` repo. [#828](https://github.com/PHPCompatibility/PHPCompatibility/pull/828) -- :recycle: Various minor inline documentation improvements. [#825](https://github.com/PHPCompatibility/PHPCompatibility/pull/825) -- :wrench: Various performance optimizations and code simplifications. [#783](https://github.com/PHPCompatibility/PHPCompatibility/pull/783), [#784](https://github.com/PHPCompatibility/PHPCompatibility/pull/784), [#795](https://github.com/PHPCompatibility/PHPCompatibility/pull/795), [#813](https://github.com/PHPCompatibility/PHPCompatibility/pull/813) -- :green_heart: Travis: build tests are now being run against PHP 7.4 (unstable) as well. [#790](https://github.com/PHPCompatibility/PHPCompatibility/pull/790) - Note: the builds are currently not (yet) tested against PHP 8.0 (unstable) as there is no compatible PHPUnit version available (yet). -- :wrench: Travis: The build script has been refactored to use [stages](https://docs.travis-ci.com/user/build-stages/) to get the most relevant results faster. Additionally some more tweaks have been made to improve and/or simplify the build script. [#798](https://github.com/PHPCompatibility/PHPCompatibility/pull/798) -- :wrench: Build/PHPCS: warnings are no longer allowed for the PHPCompatibility native code. [#800](https://github.com/PHPCompatibility/PHPCompatibility/pull/800) -- :wrench: Build/PHPCS: added variable assignment alignment check and file include check to the PHPCompatibility native CS configuration. [#824](https://github.com/PHPCompatibility/PHPCompatibility/pull/824) -- :wrench: The minimum version for the recommended `DealerDirect/phpcodesniffer-composer-installer` Composer plugin has been upped to `0.5.0`. [#791](https://github.com/PHPCompatibility/PHPCompatibility/pull/791) - -### Fixed -- :bug: The `PHPCompatibility.Extensions.RemovedExtensions` sniff contained a typo in the alternative recommended for the removed `mcve` extension. [#806](https://github.com/PHPCompatibility/PHPCompatibility/pull/806) -- :bug: The `PHPCompatibility.Extensions.RemovedExtensions` sniff listed the wrong removal version number for the `Payflow Pro/pfpro` extension (PHP 5.3 instead of the correct 5.1). [#823](https://github.com/PHPCompatibility/PHPCompatibility/pull/823) - -### Credits -Thanks go out to [Yılmaz] and [Tim Millwood] for their contribution to this version. :clap: - - -## [9.1.1] - 2018-12-31 - -See all related issues and PRs in the [9.1.1 milestone]. - -### Fixed -- :bug: `ForbiddenThisUseContexts`: false positive for unsetting `$this['key']` on objects implementing `ArrayAccess`. [#781](https://github.com/PHPCompatibility/PHPCompatibility/pull/781). Fixes [#780](https://github.com/PHPCompatibility/PHPCompatibility/issues/780) - -## [9.1.0] - 2018-12-16 - -See all related issues and PRs in the [9.1.0 milestone]. - -### Added -- :star2: New `PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue` sniff to detect code which could be affected by the PHP 7.0 change in the values reported by `func_get_arg()`, `func_get_args()`, `debug_backtrace()` and exception backtraces. [#750](https://github.com/PHPCompatibility/PHPCompatibility/pull/750). Fixes [#585](https://github.com/PHPCompatibility/PHPCompatibility/pull/585). -- :star2: New `PHPCompatibility.MethodUse.NewDirectCallsToClone` sniff to detect direct call to a `__clone()` magic method which wasn't allowed prior to PHP 7.0. [#743](https://github.com/PHPCompatibility/PHPCompatibility/pull/743). Fixes [#629](https://github.com/PHPCompatibility/PHPCompatibility/issues/629). -- :star2: New `PHPCompatibility.Variables.ForbiddenThisUseContext` sniff to detect most of the inconsistencies surrounding the use of the `$this` variable, which were removed in PHP 7.1. [#762](https://github.com/PHPCompatibility/PHPCompatibility/pull/762), [#771](https://github.com/PHPCompatibility/PHPCompatibility/pull/771). Fixes [#262](https://github.com/PHPCompatibility/PHPCompatibility/issues/262) and [#740](https://github.com/PHPCompatibility/PHPCompatibility/issues/740). -- :star: `NewClasses`: detection of more native PHP Exceptions. [#743](https://github.com/PHPCompatibility/PHPCompatibility/pull/743), [#753](https://github.com/PHPCompatibility/PHPCompatibility/pull/753) -- :star: `NewConstants` : detection of the new PHP 7.3 Curl, Stream Crypto and LDAP constants and some more PHP 7.0 Tokenizer constants. [#752](https://github.com/PHPCompatibility/PHPCompatibility/pull/752), [#767](https://github.com/PHPCompatibility/PHPCompatibility/pull/767), [#778](https://github.com/PHPCompatibility/PHPCompatibility/pull/778) -- :star: `NewFunctions` sniff: recognize (more) new LDAP functions as introduced in PHP 7.3. [#768](https://github.com/PHPCompatibility/PHPCompatibility/pull/768) -- :star: `NewFunctionParameters` sniff: recognize the new `$serverctrls` parameter which was added to a number of LDAP functions in PHP 7.3. [#769](https://github.com/PHPCompatibility/PHPCompatibility/pull/769) -- :star: `NewIniDirectives` sniff: recognize the new `imap.enable_insecure_rsh` ini directive as introduced in PHP 7.1.25, 7.2.13 and 7.3.0. [#770](https://github.com/PHPCompatibility/PHPCompatibility/pull/770) -- :star: `NewInterfaces` sniff: recognize two more Session related interfaces which were introduced in PHP 5.5.1 and 7.0 respectively. [#748](https://github.com/PHPCompatibility/PHPCompatibility/pull/748) -- :star: Duplicate of upstream `findStartOfStatement()` method to the `PHPCompatibility\PHPCSHelper` class to allow for PHPCS cross-version usage of that method. [#750](https://github.com/PHPCompatibility/PHPCompatibility/pull/750) - -### Changed -- :pushpin: `RemovedPHP4StyleConstructors`: will now also detect PHP4-style constructors when declared in interfaces. [#751](https://github.com/PHPCompatibility/PHPCompatibility/pull/751) -- :pushpin: `Sniff::validDirectScope()`: the return value of this method has changed. Previously it would always be a boolean. It will stil return `false` when no valid direct scope has been found, but it will now return the `stackPtr` to the scope token if a _valid_ direct scope was encountered. [#758](https://github.com/PHPCompatibility/PHPCompatibility/pull/758) -- :rewind: `NewOperators` : updated the version number for `T_COALESCE_EQUAL`. [#746](https://github.com/PHPCompatibility/PHPCompatibility/pull/746) -- :pencil: Minor improvement to an error message in the unit test suite. [#742](https://github.com/PHPCompatibility/PHPCompatibility/pull/742) -- :recycle: Various code clean-up and improvements. [#745](https://github.com/PHPCompatibility/PHPCompatibility/pull/745), [#756](https://github.com/PHPCompatibility/PHPCompatibility/pull/756), [#774](https://github.com/PHPCompatibility/PHPCompatibility/pull/774) -- :recycle: Various minor inline documentation fixes. [#749](https://github.com/PHPCompatibility/PHPCompatibility/pull/749), [#757](https://github.com/PHPCompatibility/PHPCompatibility/pull/757) -- :umbrella: Improved code coverage recording. [#744](https://github.com/PHPCompatibility/PHPCompatibility/pull/744), [#776](https://github.com/PHPCompatibility/PHPCompatibility/pull/776) -- :green_heart: Travis: build tests are now being run against PHP 7.3 as well. [#511](https://github.com/PHPCompatibility/PHPCompatibility/pull/511) - Note: full PHP 7.3 support is only available in combination with PHP_CodeSniffer 2.9.2 or 3.3.1+ due to an incompatibility within PHP_CodeSniffer itself. - -### Fixed -- :white_check_mark: Compatibility with the upcoming release of PHPCS 3.4.0. Deal with changed behaviour of the PHPCS `Tokenizer` regarding binary type casts. [#760](https://github.com/PHPCompatibility/PHPCompatibility/pull/760) -- :bug: `InternalInterfaces`: false negative for implemented/extended interfaces prefixed with a namespace separator. [#775](https://github.com/PHPCompatibility/PHPCompatibility/pull/775) -- :bug: `NewClasses`: the introduction version of various native PHP Exceptions has been corrected. [#743](https://github.com/PHPCompatibility/PHPCompatibility/pull/743), [#753](https://github.com/PHPCompatibility/PHPCompatibility/pull/753) -- :bug: `NewInterfaces`: false negative for implemented/extended interfaces prefixed with a namespace separator. [#775](https://github.com/PHPCompatibility/PHPCompatibility/pull/775) -- :bug: `RemovedPHP4StyleConstructors`: the sniff would examine methods in nested anonymous classes as if they were methods of the higher level class. [#751](https://github.com/PHPCompatibility/PHPCompatibility/pull/751) -- :rewind: `RemovedPHP4StyleConstructors`: the sniff will no longer throw false positives for the first method in an anonymous class when used in combination with PHPCS 2.3.x. [#751](https://github.com/PHPCompatibility/PHPCompatibility/pull/751) -- :rewind: `ReservedFunctionNames`: fixed incorrect error message text for methods in anonymous classes when used in combination with PHPCS 2.3.x. [#755](https://github.com/PHPCompatibility/PHPCompatibility/pull/755) -- :bug: `ReservedFunctionNames`: prevent duplicate errors being thrown for methods in nested anonymous classes. [#755](https://github.com/PHPCompatibility/PHPCompatibility/pull/755) -- :bug: `PHPCSHelper::findEndOfStatement()`: minor bug fix. [#749](https://github.com/PHPCompatibility/PHPCompatibility/pull/749) -- :bug: `Sniff::isClassProperty()`: class properties for classes nested in conditions or function calls were not always recognized as class properties. [#758](https://github.com/PHPCompatibility/PHPCompatibility/pull/758) - -### Credits -Thanks go out to [Jonathan Champ] for his contribution to this version. :clap: - - -## [9.0.0] - 2018-10-07 - -**IMPORTANT**: This release contains **breaking changes**. Please read the below information carefully before upgrading! - -All sniffs have been placed in meaningful categories and a number of sniffs have been renamed to have more consistent, meaningful and future-proof names. - -Both the `PHPCompatibilityJoomla` [[GH](https://github.com/PHPCompatibility/PHPCompatibilityJoomla) | [Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-joomla)] as well as the `PHPCompatibilityWP` [[GH](https://github.com/PHPCompatibility/PHPCompatibilityWP)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp)] rulesets have already been adjusted for this change and have released a new version which is compatible with this version of PHPCompatibility. - -Aside from those CMS-based rulesets, this project now also offers a number of polyfill-library specific rulesets, such as `PHPCompatibilityPasswordCompat` [[GH](https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat) | [Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-passwordcompat)] for @ircmaxell's [`password_compat`](https://github.com/ircmaxell/password_compat) libary, `PHPCompatibilityParagonieRandomCompat` and `PHPCompatibilityParagonieSodiumCompat` [[GH](https://github.com/PHPCompatibility/PHPCompatibilityParagonie)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-paragonie)] for the [Paragonie polyfills](https://github.com/paragonie?utf8=?&q=polyfill) and a number of rulesets related to various [polyfills offered by the Symfony project](https://github.com/symfony?utf8=?&q=polyfill) [[GH](https://github.com/PHPCompatibility/PHPCompatibilitySymfony)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-symfony)]. - -If your project uses one of these polyfills, please consider using these special polyfill rulesets to prevent false positives. - -Also as of this version, [Juliette Reinders Folmer] is now officially a co-maintainer of this package. - -### Upgrade instructions - -* If you have `` directives in your own project's custom ruleset which relate to sniffs from the PHPCompatibility library, you will need to update your ruleset to use the new sniff names. -* If you use the new [PHPCS 3.2+ inline annotations](https://github.com/squizlabs/PHP_CodeSniffer/releases/3.2.0), i.e. `// phpcs:ignore Standard.Category.SniffName`, in combination with PHPCompatibility sniff names, you will need to update these annotations. -* If you use neither of the above, you should be fine and upgrading should be painless. - -### Overview of all the sniff renames: - -Old Category.SniffName | New Category.SniffName ---- | --- -**PHP**.ArgumentFunctionsUsage | **FunctionUse**.ArgumentFunctionsUsage -**PHP**.CaseSensitiveKeywords | **Keywords**.CaseSensitiveKeywords -**PHP**.ConstantArraysUsingConst | **InitialValue**.**New**ConstantArraysUsingConst -**PHP**.ConstantArraysUsingDefine | **InitialValue**.**New**ConstantArraysUsingDefine -**PHP**.**Deprecated**Functions | **FunctionUse**.**Removed**Functions -**PHP**.**Deprecated**IniDirectives | **IniDirectives**.**Removed**IniDirectives -**PHP**.**Deprecated**MagicAutoload | **FunctionNameRestrictions**.**Removed**MagicAutoload -**PHP**.**Deprecated**NewReference | **Syntax**.**Removed**NewReference -**PHP**.**Deprecated**PHP4StyleConstructors | **FunctionNameRestrictions**.**Removed**PHP4StyleConstructors -**PHP**.**Deprecated**TypeCasts | **TypeCasts**.**Removed**TypeCasts -**PHP**.DiscouragedSwitchContinue | **ControlStructures**.DiscouragedSwitchContinue -**PHP**.DynamicAccessToStatic | **Syntax**.**New**DynamicAccessToStatic -**PHP**.EmptyNonVariable | **LanguageConstructs**.**New**EmptyNonVariable -**PHP**.ForbiddenBreakContinueOutsideLoop | **ControlStructures**.ForbiddenBreakContinueOutsideLoop -**PHP**.ForbiddenBreakContinueVariableArguments | **ControlStructures**.ForbiddenBreakContinueVariableArguments -**PHP**.ForbiddenCallTimePassByReference | **Syntax**.ForbiddenCallTimePassByReference -**PHP**.Forbidden**ClosureUseVariableNames** | **FunctionDeclarations**.Forbidden**VariableNamesInClosureUse** -**PHP**.ForbiddenEmptyListAssignment | **Lists**.ForbiddenEmptyListAssignment -**PHP**.Forbidden**Function**ParametersWithSameName | **FunctionDeclarations**.ForbiddenParametersWithSameName -**PHP**.ForbiddenGlobalVariableVariable | **Variables**.ForbiddenGlobalVariableVariable -**PHP**.ForbiddenNames | **Keywords**.ForbiddenNames -**PHP**.ForbiddenNamesAsDeclared | **Keywords**.ForbiddenNamesAsDeclared -**PHP**.ForbiddenNamesAsInvokedFunctions | **Keywords**.ForbiddenNamesAsInvokedFunctions -**PHP**.ForbiddenNegativeBitshift | **Operators**.ForbiddenNegativeBitshift -**PHP**.ForbiddenSwitchWithMultipleDefaultBlocks | **ControlStructures**.ForbiddenSwitchWithMultipleDefaultBlocks -**PHP**.InternalInterfaces | **Interfaces**.InternalInterfaces -**PHP**.LateStaticBinding | **Classes**.**New**LateStaticBinding -**PHP**.**MbstringReplaceE**Modifier | **ParameterValues**.**RemovedMbstring**Modifier**s** -**PHP**.NewAnonymousClasses | **Classes**.NewAnonymousClasses -**PHP**.NewArrayStringDereferencing | **Syntax**.NewArrayStringDereferencing -**PHP**.NewClasses | **Classes**.NewClasses -**PHP**.NewClassMemberAccess | **Syntax**.NewClassMemberAccess -**PHP**.NewClosure | **FunctionDeclarations**.NewClosure -**PHP**.NewConstants | **Constants**.NewConstants -**PHP**.NewConstantScalarExpressions | **InitialValue**.NewConstantScalarExpressions -**PHP**.NewConstVisibility | **Classes**.NewConstVisibility -**PHP**.NewExecutionDirectives | **ControlStructures**.NewExecutionDirectives -**PHP**.NewFunctionArrayDereferencing | **Syntax**.NewFunctionArrayDereferencing -**PHP**.NewFunctionParameters | **FunctionUse**.NewFunctionParameters -**PHP**.NewFunctions | **FunctionUse**.NewFunctions -**PHP**.NewGeneratorReturn | **Generators**.NewGeneratorReturn -**PHP**.NewGroupUseDeclarations | **UseDeclarations**.NewGroupUseDeclarations -**PHP**.NewHashAlgorithms | **ParameterValues**.NewHashAlgorithms -**PHP**.NewHeredoc**Initialize** | **InitialValue**.NewHeredoc -**PHP**.NewIniDirectives | **IniDirectives**.NewIniDirectives -**PHP**.NewInterfaces | **Interfaces**.NewInterfaces -**PHP**.NewKeywords | **Keywords**.NewKeywords -**PHP**.NewLanguageConstructs | **LanguageConstructs**.NewLanguageConstructs -**PHP**.NewMagicClassConstant | **Constants**.NewMagicClassConstant -**PHP**.NewMagicMethods | **FunctionNameRestrictions**.NewMagicMethods -**PHP**.NewMultiCatch | **ControlStructures**.NewMultiCatch -**PHP**.NewNullableTypes | **FunctionDeclarations**.NewNullableTypes -**PHP**.NewReturnTypeDeclarations | **FunctionDeclarations**.NewReturnTypeDeclarations -**PHP**.New**Scalar**TypeDeclarations | **FunctionDeclarations**.New**Param**TypeDeclarations -**PHP**.NewTrailingComma | **Syntax**.New**FunctionCall**TrailingComma -**PHP**.NewTypeCasts | **TypeCasts**.NewTypeCasts -**PHP**.NewUseConstFunction | **UseDeclarations**.NewUseConstFunction -**PHP**.NonStaticMagicMethods | **FunctionDeclarations**.NonStaticMagicMethods -**PHP**.OptionalRequiredFunctionParameters | **FunctionUse**.Optional**To**RequiredFunctionParameters -**PHP**.ParameterShadowSuperGlobals | **FunctionDeclarations**.**Forbidden**ParameterShadowSuperGlobals -**PHP**.**PCRENew**Modifiers | **ParameterValues**.**NewPCRE**Modifiers -**PHP**.**PregReplaceE**Modifier | **ParameterValues**.**RemovedPCRE**Modifier**s** -**PHP**.RemovedAlternativePHPTags | **Miscellaneous**.RemovedAlternativePHPTags -**PHP**.RemovedConstants | **Constants**.RemovedConstants -**PHP**.RemovedExtensions | **Extensions**.RemovedExtensions -**PHP**.RemovedFunctionParameters | **FunctionUse**.RemovedFunctionParameters -**PHP**.RemovedGlobalVariables | **Variables**.Removed**Predefined**GlobalVariables -**PHP**.RemovedHashAlgorithms | **ParameterValues**.RemovedHashAlgorithms -**PHP**.ReservedFunctionNames | **FunctionNameRestrictions**.ReservedFunctionNames -**PHP**.RequiredOptionalFunctionParameters | **FunctionUse**.Required**To**OptionalFunctionParameters -**PHP**.ShortArray | **Syntax**.**New**ShortArray -**PHP**.Ternary**Operators** | **Operators**.**NewShort**Ternary -**PHP**.ValidIntegers | **Miscellaneous**.ValidIntegers -**PHP**.**VariableVariables** | **Variables**.**NewUniformVariableSyntax** - -### Changelog for version 9.0.0 - -See all related issues and PRs in the [9.0.0 milestone]. - -### Added -- :star2: New `PHPCompatibility.ControlStructures.NewForeachExpressionReferencing` sniff to detect referencing of `$value` within a `foreach()` when the iterated array is not a variable. This was not supported prior to PHP 5.5. [#664](https://github.com/PHPCompatibility/PHPCompatibility/pull/664) -- :star2: New `PHPCompatibility.ControlStructures.NewListInForeach` sniff to detect unpacking nested arrays into separate variables via the `list()` construct in a `foreach()` statement. This was not supported prior to PHP 5.5. [#657](https://github.com/PHPCompatibility/PHPCompatibility/pull/657) -- :star2: New `PHPCompatibility.FunctionNameRestrictions.RemovedNamespacedAssert` sniff to detect declaring a function called `assert()` within a namespace. This has been deprecated as of PHP 7.3. [#735](https://github.com/PHPCompatibility/PHPCompatibility/pull/735). Partially fixes [#718](https://github.com/PHPCompatibility/PHPCompatibility/issues/718). -- :star2: New `PHPCompatibility.Lists.AssignmentOrder` sniff to detect `list()` constructs affected by the change in assignment order in PHP 7.0. [#656](https://github.com/PHPCompatibility/PHPCompatibility/pull/656) -- :star2: New `PHPCompatibility.Lists.NewKeyedList` sniff to detect usage of keys in `list()`, support for which was added in PHP 7.1. [#655](https://github.com/PHPCompatibility/PHPCompatibility/pull/655). Fixes [#252](https://github.com/PHPCompatibility/PHPCompatibility/issues/252). -- :star2: New `PHPCompatibility.Lists.NewListReferenceAssignment` sniff to detect reference assignments being used in `list()` constructs, support for which has been added in PHP 7.3. [#731](https://github.com/PHPCompatibility/PHPCompatibility/pull/731) -- :star2: New `PHPCompatibility.Lists.NewShortList` sniff to detect the shorthand array syntax `[]` being used for symmetric array destructuring as introduced in PHP 7.1. [#654](https://github.com/PHPCompatibility/PHPCompatibility/pull/654). Fixes [#248](https://github.com/PHPCompatibility/PHPCompatibility/issues/248). -- :star2: New `PHPCompatibility.Operators.NewOperators` sniff which checks for usage of the pow, pow equals, spaceship and coalesce (equals) operators. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) - These checks were previously contained within the `PHPCompatibility.LanguageConstructs.NewLanguageConstructs` sniff. -- :star2: New `PHPCompatibility.ParameterValues.ForbiddenGetClassNull` sniff to detect `null` being passed to `get_class()`, support for which has been removed in PHP 7.2 [#659](https://github.com/PHPCompatibility/PHPCompatibility/pull/659). Fixes [#557](https://github.com/PHPCompatibility/PHPCompatibility/issues/557). -- :star2: New `PHPCompatibility.ParameterValues.NewArrayReduceInitialType` sniff to detect non-integers being passed as the `$initial` parameter to the `array_reduce()` function, which was not supported before PHP 5.3. [#666](https://github.com/PHPCompatibility/PHPCompatibility/pull/666). Fixes [#649](https://github.com/PHPCompatibility/PHPCompatibility/issues/649) -- :star2: New `PHPCompatibility.ParameterValues.NewFopenModes` sniff to examine the `$mode` parameter passed to `fopen()` for modes not available in older PHP versions. [#658](https://github.com/PHPCompatibility/PHPCompatibility/pull/658) -- :star2: New `PHPCompatibility.ParameterValues.NewNegativeStringOffset` sniff to detect negative string offsets being passed to string manipulation functions which was not supported before PHP 7.1. [#662](https://github.com/PHPCompatibility/PHPCompatibility/pull/662). Partially fixes [#253](https://github.com/PHPCompatibility/PHPCompatibility/issues/253). -- :star2: New `PHPCompatibility.ParameterValues.NewPackFormats` sniff to examine the `$format` parameter passed to `pack()` for formats not available in older PHP versions. [#665](https://github.com/PHPCompatibility/PHPCompatibility/pull/665) -- :star2: New `PHPCompatibility.ParameterValues.RemovedIconvEncoding` sniff to detect the PHP 5.6 deprecated encoding `$type`s being passed to `iconv_set_encoding()`. [#660](https://github.com/PHPCompatibility/PHPCompatibility/pull/660). Fixes [#475](https://github.com/PHPCompatibility/PHPCompatibility/issues/475). -- :star2: New `PHPCompatibility.ParameterValues.RemovedNonCryptoHashes` sniff to detect non-cryptographic hash algorithms being passed to various `hash_*()` functions. This is no longer accepted as of PHP 7.2. [#663](https://github.com/PHPCompatibility/PHPCompatibility/pull/663). Fixes [#559](https://github.com/PHPCompatibility/PHPCompatibility/issues/559) -- :star2: New `PHPCompatibility.ParameterValues.RemovedSetlocaleString` sniff to detect string literals being passed to the `$category` parameter of the `setlocale()` function. This behaviour was deprecated in PHP 4.2 and support has been removed in PHP 7.0. [#661](https://github.com/PHPCompatibility/PHPCompatibility/pull/661) -- :star2: New `PHPCompatibility.Syntax.NewFlexibleHeredocNowdoc` sniff to detect the new heredoc/nowdoc format as allowed as of PHP 7.3. [#736](https://github.com/PHPCompatibility/PHPCompatibility/pull/736). Fixes [#705](https://github.com/PHPCompatibility/PHPCompatibility/issues/705). - Note: This sniff is only supported in combination with PHP_CodeSniffer 2.6.0 and higher. -- :star: `PHPCompatibility.Classes.NewClasses` sniff: recognize the new `CompileError` and `JsonException` classes as introduced in PHP 7.3. [#676](https://github.com/PHPCompatibility/PHPCompatibility/pull/676) -- :star: `PHPCompatibility.Constants.NewConstants` sniff: recognize new constants which are being introduced in PHP 7.3. [#678](https://github.com/PHPCompatibility/PHPCompatibility/pull/678) -- :star: `PHPCompatibility.Constants.RemovedConstants` sniff: recognize constants which have been deprecated or removed in PHP 7.3. [#710](https://github.com/PHPCompatibility/PHPCompatibility/pull/710). Partially fixes [#718](https://github.com/PHPCompatibility/PHPCompatibility/issues/718). -- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: recognize various new functions being introduced in PHP 7.3. [#679](https://github.com/PHPCompatibility/PHPCompatibility/pull/679) -- :star: `PHPCompatibility.FunctionUse.NewFunctions` sniff: recognize the `sapi_windows_*()`, `hash_hkdf()` and `pcntl_signal_get_handler()` functions as introduced in PHP 7.1. [#728](https://github.com/PHPCompatibility/PHPCompatibility/pull/728) -- :star: `PHPCompatibility.FunctionUse.RemovedFunctionParameters` sniff: recognize the deprecation of the `$case_insensitive` parameter for the `define()` function in PHP 7.3. [#706](https://github.com/PHPCompatibility/PHPCompatibility/pull/706) -- :star: `PHPCompatibility.FunctionUse.RemovedFunctions` sniff: recognize the PHP 7.3 deprecation of the `image2wbmp()`, `fgetss()` and `gzgetss()` functions, as well as the deprecation of undocumented Mbstring function aliases. [#681](https://github.com/PHPCompatibility/PHPCompatibility/pull/681), [#714](https://github.com/PHPCompatibility/PHPCompatibility/pull/714), [#720](https://github.com/PHPCompatibility/PHPCompatibility/pull/720). Partially fixes [#718](https://github.com/PHPCompatibility/PHPCompatibility/issues/718). -- :star: `PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters` sniff: account for the second parameter for `array_push()` and `array_unshift()` becoming optional in PHP 7.3, as well as for the `$mode` parameter for a range of `ftp_*()` functions becoming optional. [#680](https://github.com/PHPCompatibility/PHPCompatibility/pull/680) -- :star: `PHPCompatibility.IniDirectives.NewIniDirectives` sniff: recognize new `syslog` and `session` ini directives as introduced in PHP 7.3. [#702](https://github.com/PHPCompatibility/PHPCompatibility/pull/702), [#719](https://github.com/PHPCompatibility/PHPCompatibility/pull/719), [#730](https://github.com/PHPCompatibility/PHPCompatibility/pull/730) -- :star: `PHPCompatibility.IniDirectives.NewIniDirectives` sniff: recognize some more ini directives which were introduced in PHP 7.1. [#727](https://github.com/PHPCompatibility/PHPCompatibility/pull/727) -- :star: `PHPCompatibility.IniDirectives.RemovedIniDirectived` sniff: recognize ini directives removed in PHP 7.3. [#677](https://github.com/PHPCompatibility/PHPCompatibility/pull/677), [#717](https://github.com/PHPCompatibility/PHPCompatibility/pull/717). Partially fixes [#718](https://github.com/PHPCompatibility/PHPCompatibility/issues/718). -- :star: New `isNumericCalculation()` and `isVariable()` utility methods to the `PHPCompatibility\Sniff` class. [#664](https://github.com/PHPCompatibility/PHPCompatibility/pull/664), [#666](https://github.com/PHPCompatibility/PHPCompatibility/pull/666) -- :books: A section about the new sniff naming conventions to the `Contributing` file. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) - -### Changed -- :fire: All sniffs have been placed in meaningful categories and a number of sniffs have been renamed to have more consistent, meaningful and future-proof names. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738). Fixes [#601](https://github.com/PHPCompatibility/PHPCompatibility/issues/601), [#692](https://github.com/PHPCompatibility/PHPCompatibility/issues/692) - See the table at the top of this changelog for details of all the file renames. -- :umbrella: The unit test files have been moved about as well. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) - * The directory structure for these now mirrors the default directory structure used by PHPCS itself. - * The file names of the unit test files have been adjusted for the changes made in the sniffs. - * The unit test case files have been renamed and moved to the same directory as the actual test file they apply to. - * The `BaseSniffTest::sniffFile()` method has been adjusted to match. The signature of this method has changed. Where it previously expected a relative path to the unit test case file, it now expects an absolute path. - * The unit tests for the utility methods in the `PHPCompatibility\Sniff` class have been moved to a new `PHPCompatibility\Util\Tests\Core` subdirectory. - * The bootstrap file used for PHPUnit has been moved to the project root directory and renamed `phpunit-bootstrap.php`. -- :twisted_rightwards_arrows: The `PHPCompatibility.LanguageConstructs.NewLanguageConstructs` sniff has been split into two sniffs. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) - The `PHPCompatibility.LanguageConstructs.NewLanguageConstructs` sniff now contains just the checks for the namespace separator and the ellipsis. - The new `PHPCompatibility.Operators.NewOperators` sniff now contains the checks regarding the pow, pow equals, spaceship and coalesce (equals) operators. -- :pushpin: The `PHPCompatibility.ParameterValues.RemovedMbstringModifiers` sniff will now also recognize removed regex modifiers when used within a function call to one of the undocumented Mbstring function aliases for the Mbstring regex functions. [#715](https://github.com/PHPCompatibility/PHPCompatibility/pull/715) -- :pushpin: The `PHPCompatibility\Sniff::getFunctionCallParameter()` utility method now allows for closures called via a variable. [#723](https://github.com/PHPCompatibility/PHPCompatibility/pull/723) -- :pencil2: `PHPCompatibility.Upgrade.LowPHPCS`: the minimum supported PHPCS version is now 2.3.0. [#699](https://github.com/PHPCompatibility/PHPCompatibility/pull/699) -- :pencil2: Minor inline documentation improvements. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738) -- :umbrella: Minor improvements to the unit tests for the `PHPCompatibility.FunctionNameRestrctions.RemovedMagicAutoload` sniff. [#716](https://github.com/PHPCompatibility/PHPCompatibility/pull/716) -- :recycle: Minor other optimizations. [#698](https://github.com/PHPCompatibility/PHPCompatibility/pull/698), [#697](https://github.com/PHPCompatibility/PHPCompatibility/pull/697) -- :wrench: Minor improvements to the build tools. [#701](https://github.com/PHPCompatibility/PHPCompatibility/pull/701) -- :wrench: Removed some unnecessary inline annotations. [#700](https://github.com/PHPCompatibility/PHPCompatibility/pull/700) -- :books: Replaced some of the badges in the Readme file. [#721](https://github.com/PHPCompatibility/PHPCompatibility/pull/721), [#722](https://github.com/PHPCompatibility/PHPCompatibility/pull/722) -- :books: Composer: updated the list of package authors. [#739](https://github.com/PHPCompatibility/PHPCompatibility/pull/739) - -### Removed -- :no_entry_sign: Support for PHP_CodeSniffer 1.x and low 2.x versions. The new minimum version of PHP_CodeSniffer to be able to use this library is 2.3.0. [#699](https://github.com/PHPCompatibility/PHPCompatibility/pull/699). Fixes [#691](https://github.com/PHPCompatibility/PHPCompatibility/issues/691). - The minimum _recommended_ version of PHP_CodeSniffer remains the same, i.e. 2.6.0. -- :no_entry_sign: The `\PHPCompatibility\Sniff::inUseScope()` method has been removed as it is no longer needed now support for PHPCS 1.x has been dropped. [#699](https://github.com/PHPCompatibility/PHPCompatibility/pull/699) -- :no_entry_sign: Composer: The `autoload` section has been removed from the `composer.json` file. [#738](https://github.com/PHPCompatibility/PHPCompatibility/pull/738). Fixes [#568](https://github.com/PHPCompatibility/PHPCompatibility/issues/568). - Autoloading for this library is done via the PHP_CodeSniffer default mechanism, enhanced with our own autoloader, so the Composer autoloader shouldn't be needed and was causing issues in a particular use-case. - -### Fixed -- :bug: `PHPCompatibility.FunctionUse.NewFunctionParameters` sniff: The new `$mode` parameter of the `php_uname()` function was added in PHP 4.3, not in PHP 7.0 as was previously being reported. - The previous implementation of this check was based on an error in the PHP documentation. The error in the PHP documentation has been rectified and the sniff has followed suit. [#711](https://github.com/PHPCompatibility/PHPCompatibility/pull/711) -- :bug: `PHPCompatibility.Generators.NewGeneratorReturn` sniff: The sniff would throw false positives for `return` statements in nested constructs and did not correctly detect the scope which should be examined. [#725](https://github.com/PHPCompatibility/PHPCompatibility/pull/725). Fixes [#724](https://github.com/PHPCompatibility/PHPCompatibility/pull/724). -- :bug: `PHPCompatibility.Keywords.NewKeywords` sniff: PHP magic constants are case _in_sensitive. This sniff now accounts for this. [#707](https://github.com/PHPCompatibility/PHPCompatibility/pull/707) -- :bug: Various bugs in the `PHPCompatibility.Syntax.ForbiddenCallTimePassByReference` sniff [#723](https://github.com/PHPCompatibility/PHPCompatibility/pull/723): - - Closures called via a variable will now also be examined. (false negative) - - References within arrays/closures passed as function call parameters would incorrectly trigger an error. (false positive) -- :green_heart: Compatibility with PHPUnit 7.2. [#712](https://github.com/PHPCompatibility/PHPCompatibility/pull/712) - -### Credits -Thanks go out to [Jonathan Champ] for his contribution to this version. :clap: - - -## [8.2.0] - 2018-07-17 - -See all related issues and PRs in the [8.2.0 milestone]. - -### Important changes - -#### The repository has moved -As of July 13 2018, the PHPCompatibility repository has moved from the personal account of Wim Godden `wimg` to its own organization `PHPCompatibility`. -Composer users are advised to update their `composer.json`. The dependency is now called `phpcompatibility/php-compatibility`. - -#### Framework/CMS specific PHPCompatibility rulesets -Within this new organization, hosting will be offered for framework/CMS specific PHPCompatibility rulesets. - -The first two such repositories have been created and are now available for use: -* PHPCompatibilityJoomla [GitHub](https://github.com/PHPCompatibility/PHPCompatibilityJoomla)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-joomla) -* PHPCompatibilityWP [GitHub](https://github.com/PHPCompatibility/PHPCompatibilityWP)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp) - -If you want to make sure you have all PHPCompatibility rulesets available at any time, you can use the PHPCompatibilityAll package [GitHub](https://github.com/PHPCompatibility/PHPCompatibilityAll)|[Packagist](https://packagist.org/packages/phpcompatibility/phpcompatibility-all). - -For more information, see the [Readme](https://github.com/PHPCompatibility/PHPCompatibility#using-a-frameworkcms-specific-ruleset) and [Contributing guidelines](https://github.com/PHPCompatibility/PHPCompatibility/blob/master/.github/CONTRIBUTING.md#frameworkcms-specific-rulesets). - -#### Changes expected in PHPCompatibility 9.0.0 -The next version of PHPCompatibility will include a major directory layout restructuring which means that the sniff codes of all sniffs will change. - -In this same release, support for PHP_CodeSniffer 1.5.x will be dropped. The new minimum supported PHPCS version will be 2.3.0. - -For more information about these upcoming changes, please read the [announcement](https://github.com/PHPCompatibility/PHPCompatibility/issues/688). - -The `9.0.0` release is expected to be ready later this summer. - - -### Added -- :star2: New `ArgumentFunctionsUsage` sniff to detect usage of the `func_get_args()`, `func_get_arg()` and `func_num_args()` functions and the changes regarding these functions introduced in PHP 5.3. [#596](https://github.com/PHPCompatibility/PHPCompatibility/pull/596). Fixes [#372](https://github.com/PHPCompatibility/PHPCompatibility/issues/372). -- :star2: New `DiscouragedSwitchContinue` sniff to detect `continue` targetting a `switch` control structure for which `E_WARNINGS` will be thrown as of PHP 7.3. [#687](https://github.com/PHPCompatibility/PHPCompatibility/pull/687) -- :star2: New `NewClassMemberAccess` sniff to detect class member access on instantiation as added in PHP 5.4 and class member access on cloning as added in PHP 7.0. [#619](https://github.com/PHPCompatibility/PHPCompatibility/pull/619). Fixes [#53](https://github.com/PHPCompatibility/PHPCompatibility/issues/53). -- :star2: New `NewConstantScalarExpressions` sniff to detect PHP 5.6 scalar expression in contexts where PHP previously only allowed static values. [#617](https://github.com/PHPCompatibility/PHPCompatibility/pull/617). Fixes [#399](https://github.com/PHPCompatibility/PHPCompatibility/issues/399). -- :star2: New `NewGeneratorReturn` sniff to detect `return` statements within generators as introduced in PHP 7.0. [#618](https://github.com/PHPCompatibility/PHPCompatibility/pull/618) -- :star2: New `PCRENewModifiers` sniff to initially detect the new `J` regex modifier as introduced in PHP 7.2. [#600](https://github.com/PHPCompatibility/PHPCompatibility/pull/600). Fixes [#556](https://github.com/PHPCompatibility/PHPCompatibility/issues/556). -- :star2: New `ReservedFunctionNames` sniff to report on double underscore prefixed functions and methods. This was previously reported via an upstream sniff. [#581](https://github.com/PHPCompatibility/PHPCompatibility/pull/581) -- :star2: New `NewTrailingComma` sniff to detect trailing comma's in function calls, method calls, `isset()` and `unset()` as will be introduced in PHP 7.3. [#632](https://github.com/PHPCompatibility/PHPCompatibility/pull/632) -- :star2: New `Upgrade/LowPHPCS` sniff to give users of old PHP_CodeSniffer versions advance warning when support will be dropped in the near future. [#693](https://github.com/PHPCompatibility/PHPCompatibility/pull/693) -- :star: `NewClasses` sniff: check for some 40+ additional PHP native classes added in various PHP versions. [#573](https://github.com/PHPCompatibility/PHPCompatibility/pull/573) -- :star: `NewClosure` sniff: check for usage of `self`/`parent`/`static::` being used within closures, support for which was only added in PHP 5.4. [#669](https://github.com/PHPCompatibility/PHPCompatibility/pull/669). Fixes [#668](https://github.com/PHPCompatibility/PHPCompatibility/pull/668). -- :star: `NewConstants` sniff: recognize constants added by the PHP 5.5+ password extension. [#626](https://github.com/PHPCompatibility/PHPCompatibility/pull/626) -- :star: `NewFunctionParameters` sniff: recognize a number of additional function parameters added in PHP 7.0, 7.1 and 7.2. [#602](https://github.com/PHPCompatibility/PHPCompatibility/pull/602) -- :star: `NewFunctions` sniff: recognize the PHP 5.1 SPL extension functions, the PHP 5.1.1 `hash_hmac()` function, the PHP 5.6 `pg_lo_truncate()` function, more PHP 7.2 Sodium functions and the new PHP 7.3 `is_countable()` function. [#606](https://github.com/PHPCompatibility/PHPCompatibility/pull/606), [#625](https://github.com/PHPCompatibility/PHPCompatibility/pull/625), [#640](https://github.com/PHPCompatibility/PHPCompatibility/pull/640), [#651](https://github.com/PHPCompatibility/PHPCompatibility/pull/651) -- :star: `NewHashAlgorithms` sniff: recognize the new hash algorithms which were added in PHP 7.1. [#599](https://github.com/PHPCompatibility/PHPCompatibility/pull/599) -- :star: `NewInterfaces` sniff: check for the PHP 5.0 `Reflector` interface. [#572](https://github.com/PHPCompatibility/PHPCompatibility/pull/572) -- :star: `OptionalRequiredFunctionParameters` sniff: detect missing `$salt` parameter in calls to the `crypt()` function (PHP 5.6+). [#605](https://github.com/PHPCompatibility/PHPCompatibility/pull/605) -- :star: `RequiredOptionalFunctionParameters` sniff: recognize that the `$varname` parameter of `getenv()` and the `$scale` parameter of `bcscale()` have become optional as of PHP 7.1 and 7.3 respectively. [#598](https://github.com/PHPCompatibility/PHPCompatibility/pull/598), [#612](https://github.com/PHPCompatibility/PHPCompatibility/pull/612) -- :star: New `AbstractFunctionCallParameterSniff` to be used as a basis for sniffs examining function call parameters. [#636](https://github.com/PHPCompatibility/PHPCompatibility/pull/636) -- :star: New `getReturnTypeHintName()` utility method to the `PHPCompatibility\Sniff` class. [#578](https://github.com/PHPCompatibility/PHPCompatibility/pull/578), [#642](https://github.com/PHPCompatibility/PHPCompatibility/pull/642) -- :star: New `isNumber()`, `isPositiveNumber()` and `isNegativeNumber()` utility methods to the `PHPCompatibility\Sniff` class. [#610](https://github.com/PHPCompatibility/PHPCompatibility/pull/610), [#650](https://github.com/PHPCompatibility/PHPCompatibility/pull/650) -- :star: New `isShortList()` utility method to the `PHPCompatibility\Sniff` class. [#635](https://github.com/PHPCompatibility/PHPCompatibility/pull/635) -- :star: New `getCommandLineData()` method to the `PHPCompatibility\PHPCSHelper` class to provide PHPCS cross-version compatible access to command line info at run time. [#693](https://github.com/PHPCompatibility/PHPCompatibility/pull/693) -- :star: Duplicate of upstream `findEndOfStatement()` method to the `PHPCompatibility\PHPCSHelper` class to allow for PHPCS cross-version usage of that method. [#614](https://github.com/PHPCompatibility/PHPCompatibility/pull/614) -- :umbrella: additional unit test to confirm that the `PHPCompatibility\Sniff::isUseOfGlobalConstant()` method handles multi-constant declarations correctly. [#587](https://github.com/PHPCompatibility/PHPCompatibility/pull/587) -- :umbrella: additional unit tests to confirm that the `PHPCompatibility\Sniff::isClassProperty()` method handles multi-property declarations correctly. [#583](https://github.com/PHPCompatibility/PHPCompatibility/pull/583) -- :books: [Readme](https://github.com/PHPCompatibility/PHPCompatibility#using-a-frameworkcms-specific-ruleset) & [Contributing](https://github.com/PHPCompatibility/PHPCompatibility/blob/master/.github/CONTRIBUTING.md#frameworkcms-specific-rulesets): add information about the framework/CMS specific rulesets. Related PRs: [#615](https://github.com/PHPCompatibility/PHPCompatibility/pull/615), [#624](https://github.com/PHPCompatibility/PHPCompatibility/pull/624), [#648](https://github.com/PHPCompatibility/PHPCompatibility/pull/648), [#674](https://github.com/PHPCompatibility/PHPCompatibility/pull/674), [#685](https://github.com/PHPCompatibility/PHPCompatibility/pull/685), [#694](https://github.com/PHPCompatibility/PHPCompatibility/pull/694). Related to issue [#530](https://github.com/PHPCompatibility/PHPCompatibility/issues/530). -- :books: Readme: information about the PHPCS 3.3.0 change which allows for a `testVersion` in a custom ruleset to be overruled by the command-line. [#607](https://github.com/PHPCompatibility/PHPCompatibility/pull/607) - -### Changed -- :books: Adjusted references to the old repository location throughout the codebase to reflect the move to a GitHub organization. [#689](https://github.com/PHPCompatibility/PHPCompatibility/pull/689) - This repository will now live in [https://github.com/PHPCompatibility/PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) and the Packagist reference will now be `phpcompatibility/php-compatibility`. -- :white_check_mark: The `getReturnTypeHintToken()` utility method has been made compatible with the changes in the PHPCS tokenizer which were introduced in PHP_CodeSniffer 3.3.0. [#642](https://github.com/PHPCompatibility/PHPCompatibility/pull/642). Fixes [#639](https://github.com/PHPCompatibility/PHPCompatibility/issues/639). -- :pushpin: `ConstantArrayUsingConst`: improved handling of multi-constant declarations. [#593](https://github.com/PHPCompatibility/PHPCompatibility/pull/593) -- :pushpin: `NewHeredocInitialize`: improved handling of constant declarations using the `const` keyword. - The sniff will now also report on multi-declarations for variables, constants and class properties and on using heredoc as a function parameter default. [#641](https://github.com/PHPCompatibility/PHPCompatibility/pull/641) -- :pushpin: `ForbiddenEmptyListAssignment`: this sniff will now also report on empty list assignments when the PHP 7.1 short list syntax is used. [#653](https://github.com/PHPCompatibility/PHPCompatibility/pull/653) -- :pushpin: The `ForbiddenNegativeBitshift` sniff would previously only report on "bitshift right". As of this version, "bitshift left" and bitshift assignments will also be recognized. [#614](https://github.com/PHPCompatibility/PHPCompatibility/pull/614) -- :pushpin: The `NewClasses` and `NewInterfaces` sniffs will now also report on new classes/interfaces when used as _return type_ declarations. [#578](https://github.com/PHPCompatibility/PHPCompatibility/pull/578) -- :pushpin: The `NewScalarTypeDeclarations` sniff will now recognize `parent` as a valid type declaration. - The sniff will now also throw an error about using `self` and `parent` when PHP < 5.2 needs to be supported as PHP 5.1 and lower would presume these to be class names instead of keywords. [#595](https://github.com/PHPCompatibility/PHPCompatibility/pull/595) -- :pushpin: The `PregReplaceEModifier` sniff - and the `PCRENewModifiers` sniff by extension - will now correctly examine and report on modifiers in regexes passed via calls to `preg_replace_callback_array()`. [#600](https://github.com/PHPCompatibility/PHPCompatibility/pull/600), [#636](https://github.com/PHPCompatibility/PHPCompatibility/pull/636) -- :pushpin: `getReturnTypeHintToken()` utility method: improved support for interface methods and abstract function declarations. [#652](https://github.com/PHPCompatibility/PHPCompatibility/pull/652) -- :pushpin: The `findExtendedClassName()`, `findImplementedInterfaceNames()`, `getMethodParameters()` utility methods which are duplicates of upstream PHPCS methods, have been moved from the `PHPCompatibility\Sniff` class to the `PHPCompatibility\PHPCSHelper` class and have become static methods. [#613](https://github.com/PHPCompatibility/PHPCompatibility/pull/613) -- :white_check_mark: `getReturnTypeHintToken()` utility method: align returned `$stackPtr` with native PHPCS behaviour by returning the last token of the type declaration. [#575](https://github.com/PHPCompatibility/PHPCompatibility/pull/575) -- :white_check_mark: PHPCS cross-version compatibility: sync `getMethodParameters()` method with improved upstream version. [#643](https://github.com/PHPCompatibility/PHPCompatibility/pull/643) -- :pencil2: The `MbstringReplaceEModifier`, `PregReplaceEModifier` and the `PregReplaceEModifier` sniffs now `extend` the new `AbstractFunctionCallParameterSniff` class. This should yield more accurate results when checking whether one of the target PHP functions was called. [#636](https://github.com/PHPCompatibility/PHPCompatibility/pull/636) -- :pencil2: `DeprecatedNewReference` sniff: minor change to the error text and code - was `Forbidden`, now `Removed` -. Custom rulesets which explicitly excluded this error code will need to be updated. [#594](https://github.com/PHPCompatibility/PHPCompatibility/pull/594) -- :pencil2: `NewScalarTypeDeclarations` sniff: minor change to the error message text.[#644](https://github.com/PHPCompatibility/PHPCompatibility/pull/644) -- :umbrella: The unit test framework now allows for sniffs in categories other than `PHP`. [#634](https://github.com/PHPCompatibility/PHPCompatibility/pull/634) -- :umbrella: Boyscouting: fixed up some (non-relevant) parse errors in a unit test case file. [#576](https://github.com/PHPCompatibility/PHPCompatibility/pull/576) -- :green_heart: Travis: build tests are now also being run against the lowest supported PHPCS 3.x version. Previously only the highest supported PHPCS 3.x version was tested against. [#633](https://github.com/PHPCompatibility/PHPCompatibility/pull/633) -- :books: Readme: Improved Composer install instructions. [#690](https://github.com/PHPCompatibility/PHPCompatibility/pull/690) -- :books: Minor documentation fixes. [#672](https://github.com/PHPCompatibility/PHPCompatibility/pull/672) -- :wrench: Minor performance optimizations and code simplifications. [#592](https://github.com/PHPCompatibility/PHPCompatibility/pull/592), [#630](https://github.com/PHPCompatibility/PHPCompatibility/pull/630), [#671](https://github.com/PHPCompatibility/PHPCompatibility/pull/671) -- :wrench: Composer: Various improvements, including improved information about the suggested packages, suggesting `roave/security-advisories`, allowing for PHPUnit 7.x. [#604](https://github.com/PHPCompatibility/PHPCompatibility/pull/604/files), [#616](https://github.com/PHPCompatibility/PHPCompatibility/pull/616), [#622](https://github.com/PHPCompatibility/PHPCompatibility/pull/622), [#646](https://github.com/PHPCompatibility/PHPCompatibility/pull/646) -- :wrench: Various Travis build script improvements, including tweaks for faster build time, validation of the `composer.json` file, validation of the framework specific rulesets. [#570](https://github.com/PHPCompatibility/PHPCompatibility/pull/570), [#571](https://github.com/PHPCompatibility/PHPCompatibility/pull/571), [#579](https://github.com/PHPCompatibility/PHPCompatibility/pull/579), [#621](https://github.com/PHPCompatibility/PHPCompatibility/pull/621), [#631](https://github.com/PHPCompatibility/PHPCompatibility/pull/631) -- :wrench: Build/PHPCS: made some more CS conventions explicit and start using PHPCS 3.x options for the PHPCompatibility native ruleset. [#586](https://github.com/PHPCompatibility/PHPCompatibility/pull/586), [#667](https://github.com/PHPCompatibility/PHPCompatibility/pull/667), [#673](https://github.com/PHPCompatibility/PHPCompatibility/pull/673) -- :wrench: Some code style clean up and start using the new inline PHPCS 3.2+ annotations where applicable. [#586](https://github.com/PHPCompatibility/PHPCompatibility/pull/586), [#591](https://github.com/PHPCompatibility/PHPCompatibility/pull/591), [#620](https://github.com/PHPCompatibility/PHPCompatibility/pull/620), [#673](https://github.com/PHPCompatibility/PHPCompatibility/pull/673) - -### Removed -- :no_entry_sign: PHPCompatibility no longer explicitly supports PHP_CodeSniffer 2.2.0. [#687](https://github.com/PHPCompatibility/PHPCompatibility/pull/687), [#690](https://github.com/PHPCompatibility/PHPCompatibility/pull/690) -- :no_entry_sign: The PHPCompatibility ruleset no longer includes the PHPCS native `Generic.NamingConventions.CamelCapsFunctionName`. Double underscore prefixed function names are now being reported on by a new dedicated sniff. [#581](https://github.com/PHPCompatibility/PHPCompatibility/pull/581) -- :no_entry_sign: PHPCompatibility no longer explicitly supports HHVM and builds are no longer tested against HHVM. - For now, running PHPCompatibility on HHVM to test PHP code may still work for a little while, but HHVM has announced they are [dropping PHP support](https://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html). [#623](https://github.com/PHPCompatibility/PHPCompatibility/pull/623). Fixes [#603](https://github.com/PHPCompatibility/PHPCompatibility/issues/603). -- :books: Readme: badges from services which are no longer supported or inaccurate. [#609](https://github.com/PHPCompatibility/PHPCompatibility/pull/609), [#628](https://github.com/PHPCompatibility/PHPCompatibility/pull/628) - -### Fixed -- :bug: Previously, the PHPCS native `Generic.NamingConventions.CamelCapsFunctionName` sniff was included in PHPCompatibility. Some error codes of this sniff were excluded, as well as some error messages changed (via the ruleset). - If/when PHPCompatibility would be used in combination with a code style-type ruleset, this could inadvertently lead to underreporting of issues which the CS-type ruleset intends to have reported - i.e. the error codes excluded by PHPCompatibility -. This has now been fixed. [#581](https://github.com/PHPCompatibility/PHPCompatibility/pull/581) -- :bug: The `ForbiddenNegativeBitshift` sniff would incorrectly throw an error when a bitshift was based on a calculation which included a negative number, but would not necessarily result in a negative number. [#614](https://github.com/PHPCompatibility/PHPCompatibility/pull/614). Fixes [#294](https://github.com/PHPCompatibility/PHPCompatibility/issues/294), [#466](https://github.com/PHPCompatibility/PHPCompatibility/issues/466). -- :bug: The `NewClosure` sniff would report the same issue twice when the issue was encountered in a nested closure. [#669](https://github.com/PHPCompatibility/PHPCompatibility/pull/669) -- :bug: The `NewKeywords` sniff would underreport on non-lowercase keywords. [#627](https://github.com/PHPCompatibility/PHPCompatibility/pull/627) -- :bug: The `NewKeywords` sniff would incorrectly report on the use of class constants and class properties using the same name as a keyword. [#627](https://github.com/PHPCompatibility/PHPCompatibility/pull/627) -- :bug: The `NewNullableTypes` sniff would potentially underreport when comments where interspersed in the (return) type declarations. [#577](https://github.com/PHPCompatibility/PHPCompatibility/pull/577) -- :bug: The `Sniff::getFunctionCallParameters()` utility method would in rare cases return incorrect results when it encountered a closure as a parameter. [#682](https://github.com/PHPCompatibility/PHPCompatibility/pull/682) -- :bug: The `Sniff::getReturnTypeHintToken()` utility method would not always return a `$stackPtr`. [#645](https://github.com/PHPCompatibility/PHPCompatibility/pull/645) -- :bug: Minor miscellanous other bugfixes. [#670](https://github.com/PHPCompatibility/PHPCompatibility/pull/670) -- :umbrella: `PHPCompatibility\Tests\BaseClass\MethodTestFrame::getTargetToken()` could potentially not find the correct token to run a test against. [#588](https://github.com/PHPCompatibility/PHPCompatibility/pull/588) - -### Credits -Thanks go out to [Michael Babker] and [Juliette Reinders Folmer] for their contributions to this version. :clap: - - -## [8.1.0] - 2017-12-27 - -See all related issues and PRs in the [8.1.0 milestone]. - -### Added -- :star2: New `NewConstants` and `RemovedConstants` sniffs to detect usage of new/removed PHP constants for all PHP versions from PHP 5 up. [#526](https://github.com/PHPCompatibility/PHPCompatibility/pull/525), [#551](https://github.com/PHPCompatibility/PHPCompatibility/pull/551), [#566](https://github.com/PHPCompatibility/PHPCompatibility/pull/566). Fixes [#263](https://github.com/PHPCompatibility/PHPCompatibility/issues/263). -- :star2: New `MagicAutoloadDeprecation` sniff to detect deprecated `__autoload()` functions as deprecated in PHP 7.2. [#540](https://github.com/PHPCompatibility/PHPCompatibility/pull/540) -- :star2: New `OptionalRequiredFunctionParameter` sniff to check for missing function call parameters which were required and only became optional in a later PHP version. [#524](https://github.com/PHPCompatibility/PHPCompatibility/pull/524) -- :star2: New `DynamicAccessToStatic` sniff to detect dynamic access to static methods and properties, as well as class constants, prior to PHP 5.3. [#535](https://github.com/PHPCompatibility/PHPCompatibility/pull/535). Fixes [#534](https://github.com/PHPCompatibility/PHPCompatibility/issues/534). -- :star: `DeprecatedFunctions` sniff: recognize yet more PHP 7.2 deprecated functions. [#561](https://github.com/PHPCompatibility/PHPCompatibility/pull/561), [#566](https://github.com/PHPCompatibility/PHPCompatibility/pull/566) -- :star: `DeprecatedIniDirectives` sniff: recognize the last of the PHP 7.2 deprecated ini directives. [#566](https://github.com/PHPCompatibility/PHPCompatibility/pull/566), [#567](https://github.com/PHPCompatibility/PHPCompatibility/pull/567) -- :star: `NewFunctions` : detection of all new PHP 7.2 functions added. [#522](https://github.com/PHPCompatibility/PHPCompatibility/pull/522), [#545](https://github.com/PHPCompatibility/PHPCompatibility/pull/545), [#551](https://github.com/PHPCompatibility/PHPCompatibility/pull/551), [#565](https://github.com/PHPCompatibility/PHPCompatibility/pull/565) -- :star: `RemovedExtensions` : report on usage of the `mcrypt` extension which has been removed in PHP 7.2. [#566](https://github.com/PHPCompatibility/PHPCompatibility/pull/566) -- :star: `RemovedGlobalVariables` : detection of the use of `$php_errormsg` with `track_errors` which has been deprecated in PHP 7.2. [#528](https://github.com/PHPCompatibility/PHPCompatibility/pull/528) -- :books: Documentation : added reporting usage instructions. [#533](https://github.com/PHPCompatibility/PHPCompatibility/pull/533), [#552](https://github.com/PHPCompatibility/PHPCompatibility/pull/552) - -### Changed -- :pushpin: `NewClosures` : downgraded "$this found in closure outside class" to warning. [#536](https://github.com/PHPCompatibility/PHPCompatibility/pull/535). Fixes [#527](https://github.com/PHPCompatibility/PHPCompatibility/issues/527). -- :pushpin: `ForbiddenGlobalVariableVariable` : the sniff will now throw an error for each variable in a `global` statement which is no longer supported and show the variable found to make it easier to fix this. Previously only one error would be thrown per `global` statement. [#564](https://github.com/PHPCompatibility/PHPCompatibility/pull/564) -- :pushpin: `ForbiddenGlobalVariableVariable` : the sniff will now throw `warning`s for non-bare variables used in a `global` statement as those are discouraged since PHP 7.0. [#564](https://github.com/PHPCompatibility/PHPCompatibility/pull/564) -- :rewind: `NewLanguageConstructs` : updated the version number for `T_COALESCE_EQUAL`. [#523](https://github.com/PHPCompatibility/PHPCompatibility/pull/523) -- :pencil2: `Sniff::getTestVersion()` : simplified regex logic. [#520](https://github.com/PHPCompatibility/PHPCompatibility/pull/520) -- :green_heart: Travis : build tests are now being run against PHP 7.2 as well. [#511](https://github.com/PHPCompatibility/PHPCompatibility/pull/511) -- :wrench: Improved check for superfluous whitespaces in files. [#542](https://github.com/PHPCompatibility/PHPCompatibility/pull/542) -- :wrench: Build/PHPCS : stabilized the exclude patterns. [#529](https://github.com/PHPCompatibility/PHPCompatibility/pull/529) -- :wrench: Build/PHPCS : added array indentation check. [#538](https://github.com/PHPCompatibility/PHPCompatibility/pull/538) -- :white_check_mark: PHPCS cross-version compatibility : sync `FindExtendedClassname()` method with upstream. [#507](https://github.com/PHPCompatibility/PHPCompatibility/pull/507) -- :wrench: The minimum version for the recommended `DealerDirect/phpcodesniffer-composer-installer` Composer plugin has been upped to `0.4.3`. [#548](https://github.com/PHPCompatibility/PHPCompatibility/pull/548) - -### Fixed -- :bug: `ForbiddenCallTimePassByReference` : a false positive was being thrown when a global constant was followed by a _bitwise and_. [#562](https://github.com/PHPCompatibility/PHPCompatibility/pull/562). Fixes [#39](https://github.com/PHPCompatibility/PHPCompatibility/issues/39). -- :bug: `ForbiddenGlobalVariableVariable` : the sniff was overzealous and would also report on `global` in combination with variable variables which are still supported. [#564](https://github.com/PHPCompatibility/PHPCompatibility/pull/564). Fixes [#537](https://github.com/PHPCompatibility/PHPCompatibility/issues/537). -- :bug: `ForbiddenGlobalVariableVariable` : variables interspersed with whitespace and/or comments were not being reported. [#564](https://github.com/PHPCompatibility/PHPCompatibility/pull/564) -- :rewind: `ForbiddenNamesAsInvokedFunctions` : improved recognition of function invocations using forbidden words and prevent warnings for keywords which are no longer forbidden as method names in PHP 7.0+. [#516](https://github.com/PHPCompatibility/PHPCompatibility/pull/516). Fixes [#515](https://github.com/PHPCompatibility/PHPCompatibility/issues/515) -- :bug: `VariableVariables` : variables interspersed with whitespace and/or comments were not being reported. [#563](https://github.com/PHPCompatibility/PHPCompatibility/pull/563) -- :umbrella: Fixed some unintentional syntax errors in test files. [#539](https://github.com/PHPCompatibility/PHPCompatibility/pull/539) -- :umbrella: Tests : fixed case numbering error. [#525](https://github.com/PHPCompatibility/PHPCompatibility/pull/525) -- :books: Tests : added missing test skip explanation. [#521](https://github.com/PHPCompatibility/PHPCompatibility/pull/521) -- :wrench: Fixed PHPCS whitespaces. [#543](https://github.com/PHPCompatibility/PHPCompatibility/pull/543) -- :wrench: Fixed code test coverage verification. [#550](https://github.com/PHPCompatibility/PHPCompatibility/pull/550). Fixes [#549](https://github.com/PHPCompatibility/PHPCompatibility/issues/549). - -### Credits -Thanks go out to [Juliette Reinders Folmer] and [Jonathan Van Belle] for their contributions to this version. :clap: - - -## [8.0.1] - 2017-08-07 - -See all related issues and PRs in the [8.0.1 milestone]. - -### Added -- :star2: New `DeprecatedTypeCasts` sniff to detect deprecated and removed type casts, such as the `(unset)` type cast as deprecated in PHP 7.2. [#498](https://github.com/PHPCompatibility/PHPCompatibility/pull/498) -- :star2: New `NewTypeCasts` sniff to detect type casts not present in older PHP versions such as the `(binary)` type cast as added in PHP 5.2.1. [#497](https://github.com/PHPCompatibility/PHPCompatibility/pull/497) -- :star: `NewGroupUseDeclaration`: Detection of PHP 7.2 trailing comma's in group use statements. [#504](https://github.com/PHPCompatibility/PHPCompatibility/pull/504) -- :star: `DeprecatedFunctions` sniff: recognize some more PHP 7.2 deprecated functions. [#501](https://github.com/PHPCompatibility/PHPCompatibility/pull/501) -- :star: `DeprecatedIniDirectives` sniff: recognize more PHP 7.2 deprecated ini directives. [#500](https://github.com/PHPCompatibility/PHPCompatibility/pull/500) -- :star: `ForbiddenNames` sniff: recognize `object` as a forbidden keyword since PHP 7.2. [#499](https://github.com/PHPCompatibility/PHPCompatibility/pull/499) -- :star: `NewReturnTypeDeclarations` sniff: recognize generic `parent`, PHP 7.1 `iterable` and PHP 7.2 `object` return type declarations. [#505](https://github.com/PHPCompatibility/PHPCompatibility/pull/505), [#499](https://github.com/PHPCompatibility/PHPCompatibility/pull/499) -- :star: `NewScalarTypeDeclarations` sniff: recognize PHP 7.2 `object` type declarion. [#499](https://github.com/PHPCompatibility/PHPCompatibility/pull/499) - -### Changed -- :pencil2: Improved clarity of the deprecated functions alternative in the error message. [#502](https://github.com/PHPCompatibility/PHPCompatibility/pull/502) - -### Fixed -- :fire_engine: Temporary hotfix for installed_paths (pending [upstream fix](https://github.com/squizlabs/PHP_CodeSniffer/issues/1591).) [#503](https://github.com/PHPCompatibility/PHPCompatibility/pull/503) - -### Credits -Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: - - - -## [8.0.0] - 2017-08-03 - -**IMPORTANT**: This release contains a **breaking change**. Please read the below information carefully before upgrading! - -The directory layout of the PHPCompatibility standard has been changed for improved compatibility with Composer. -This means that the PHPCompatibility standard no longer extends from the root directory of the repository, but now lives in its own subdirectory `/PHPCompatibility`. - -This release also bring compatibility with PHPCS 3.x to the PHPCompatibility standard. - -There are two things you will need to be aware of: -* The path to the PHPCompatibility standard has changed. -* If you intend to upgrade to PHPCS 3.x, the path to the `phpcs` script has changed (upstream change). - -Please follow the below upgrade instructions carefully. This should be a one-time only action. - -### Upgrade instructions - -### Before upgrading - -If you had previously made accommodations for the old directory layout, you should remove any such _"hacks"_ (meant in the kindest of ways) now. - -By this we mean: symlinks for the PHPCompatibility install to the `PHP_CodeSniffer/CodeSniffer/Standards` directory, scripts to move the sniffs files to the PHPCS directory, scripts which made symlinks etc. - -So, please remove those first. - -> **Side-note**: -> -> If you had previously forked this repository to solve this issue, please consider reverting your fork to the official version or removing it all together. - -### Upgrading: re-registering PHPCompatibility with PHP CodeSniffer - -External PHP CodeSniffer standards need to be registered with PHP CodeSniffer. You have probably done this the first time you used PHPCompatibility or have a script or Composer plugin in place to do this for you. - -As the directory layout of PHPCompatibility has changed, the path previously registered with PHP CodeSniffer will no longer work and running `phpcs -i` will **_not_** list PHPCompatibility as one of the registered standards. - -#### Using a Composer plugin - -If you use Composer, we recommend you use a Composer plugin to sort this out. In previous install instructions we recommended the SimplyAdmin plugin for this. This plugin has since been abandoned. We now recommend the DealerDirect plugin. -```bash -composer remove --dev simplyadmire/composer-plugins -composer require --dev dealerdirect/phpcodesniffer-composer-installer:^0.4.3 -composer install -composer update phpcompatibility/php-compatibility squizlabs/php_codesniffer -vendor/bin/phpcs -i -``` -If all went well, you should now see PHPCompatibility listed again in the list of installed standards. - -#### Manually re-registering PHPCompatibility - -1. First run `phpcs --config-show` to check which path(s) are currently registered with PHP CodeSniffer for external standards. -2. Check in the below table what the new path for PHPCompatibility will be - the path should point to the root directory of your PHPCompatibility install (not to the sub-directory of the same name): - - Install type | Old path | New path - ------------ | -------- | --------- - Composer | `vendor/wimg` | `vendor/phpcompatibility/php-compatibility` - Unzipped release to arbitrary directory | `path/to/dir/abovePHPCompatibility` | `path/to/dir/abovePHPCompatibility/PHPCompatibility` - Git checkout | `path/to/dir/abovePHPCompatibility` | `path/to/dir/abovePHPCompatibility/PHPCompatibility` - PEAR | If the old install instruction has been followed, not registered. | `path/to/PHPCompatibility` - - > **Side-note**: - > - > If you used the old install instructions for a PEAR install, i.e. checking out the latest release to the `PHP/CodeSniffer/Standards/PHPCompatibility` directory, and you intend to upgrade to PHP CodeSniffer 3.x, it is recommended you move the PHPCompatibility folder out of the PEAR directory now, as the layout of the PHPCS directory has changed with PHPCS 3.x and you may otherwise lose your PHPCompatibility install when you upgrade PHP CodeSniffer via PEAR. - -3. There are two ways in which you can register the new `installed_paths` value with PHP CodeSniffer. Choose your preferred method: - * Run `phpcs --config-set installed_paths ...` and include all previously installed paths including the _adjusted_ path for the PHPCompatibility standard. - - For example, if the previous value of `installed_paths` was - - `/path/to/MyStandard,/path/to/dir/abovePHPCompatibility` - - you should now set it using - - `phpcs --config-set installed_paths /path/to/MyStandard,/path/to/PHPCompatibility` - - * If you use a custom ruleset in combination with PHPCS 2.6.0 or higher, you can pass the value to PHPCS from your custom ruleset: - ```xml - - ``` -4. Run `phpcs -i` to verify that the PHPCompatibility standard is now listed again in the list of installed standards. - - -### Upgrading to PHPCS 3.x - -The path to the `phpcs` script has changed in PHPCS 3.x which will impact how you call PHPCS. - -Version | PHPCS 2.x | PHPCS 3.x -------- | --------- | --------- -Generic `phpcs` Command | `path/to/PHP_CodeSniffer/scripts/phpcs ....` | `path/to/PHP_CodeSniffer/bin/phpcs ....` -Composer command | `vendor/bin/phpcs ...` | `vendor/bin/phpcs ...` - -So, for Composer users, nothing changes. For everyone else, you may want to add the `path/to/PHP_CodeSniffer/bin/phpcs` path to your PATH environment variable or adjust any scripts - like build scripts - which call PHPCS. - - -### Upgrading a Travis build script - -If you run PHPCompatibility against your code as part of your Travis build: -* If you use Composer to install PHP CodeSniffer and PHPCompatibility on the travis image and you've made the above mentioned changes, your build should pass again. -* If you use `git clone` to install PHP CodeSniffer and PHPCompatibility on the travis image, your build will fail until you make the following changes: - 1. Check which branch of PHPCS is being checked out. If you previously fixed this to a pre-PHPCS 3.x branch or tag, you can now change this (back) to `master` or a PHPCS 3 tag. - 2. Check to which path PHPCompatibility is being cloned and adjust the path if necessary. - 3. Adjust the `phpcs --config-set installed_paths` command as described above to point to the root of the cloned PHPCompatibility repo. - 4. If you switched to using PHPCS 3.x, adjust the call to PHPCS. - - - -### Changelog for version 8.0.0 - -See all related issues and PRs in the [8.0.0 milestone]. - -### Added -- :two_hearts: Support for PHP CodeSniffer 3.x. [#482](https://github.com/PHPCompatibility/PHPCompatibility/pull/482), [#481](https://github.com/PHPCompatibility/PHPCompatibility/pull/481), [#480](https://github.com/PHPCompatibility/PHPCompatibility/pull/480), [#488](https://github.com/PHPCompatibility/PHPCompatibility/pull/488), [#489](https://github.com/PHPCompatibility/PHPCompatibility/pull/489), [#495](https://github.com/PHPCompatibility/PHPCompatibility/pull/495) - -### Changed -- :gift: As of this version PHPCompatibility will use semantic versioning. -- :fire: The directory structure of the repository has changed for better compatibility with installation via Composer. [#446](https://github.com/PHPCompatibility/PHPCompatibility/pull/446). Fixes [#102](https://github.com/PHPCompatibility/PHPCompatibility/issues/102), [#107](https://github.com/PHPCompatibility/PHPCompatibility/issues/107) -- :pencil2: The custom `functionWhitelist` property for the `PHPCompatibility.PHP.RemovedExtensions` sniff is now only supported in combination with PHP CodeSniffer 2.6.0 or higher (due to an upstream bug which was fixed in PHPCS 2.6.0). [#482](https://github.com/PHPCompatibility/PHPCompatibility/pull/482) -- :wrench: Improved the information provided to Composer from the `composer.json` file. [#446](https://github.com/PHPCompatibility/PHPCompatibility/pull/446), [#482](https://github.com/PHPCompatibility/PHPCompatibility/pull/482), [#486](https://github.com/PHPCompatibility/PHPCompatibility/pull/486) -- :wrench: Release archives will no longer contain the unit tests and other typical development files. You can still get these by using Composer with `--prefer-source` or by checking out a git clone of the repository. [#494](https://github.com/PHPCompatibility/PHPCompatibility/pull/494) -- :wrench: A variety of minor improvements to the build process. [#485](https://github.com/PHPCompatibility/PHPCompatibility/pull/485), [#486](https://github.com/PHPCompatibility/PHPCompatibility/pull/486), [#487](https://github.com/PHPCompatibility/PHPCompatibility/pull/487) -- :wrench: Some files for use by contributors have been renamed to use `.dist` extensions or moved for easier access. [#478](https://github.com/PHPCompatibility/PHPCompatibility/pull/478), [#479](https://github.com/PHPCompatibility/PHPCompatibility/pull/479), [#483](https://github.com/PHPCompatibility/PHPCompatibility/pull/483), [#493](https://github.com/PHPCompatibility/PHPCompatibility/pull/493) -- :books: The installation instructions in the Readme. [#496](https://github.com/PHPCompatibility/PHPCompatibility/pull/496) -- :books: The unit test instructions in the Contributing file. [#496](https://github.com/PHPCompatibility/PHPCompatibility/pull/496) -- :books: Improved the example code in the Readme. [#490](https://github.com/PHPCompatibility/PHPCompatibility/pull/490) - -### Removed -- :no_entry_sign: Support for PHP 5.1 and 5.2. - - The sniffs can now only be run on PHP 5.3 or higher in combination with PHPCS 1.5.6 or 2.x and on PHP 5.4 or higher in combination with PHPCS 3.x. [#484](https://github.com/PHPCompatibility/PHPCompatibility/pull/484), [#482](https://github.com/PHPCompatibility/PHPCompatibility/pull/482) - -### Credits -Thanks go out to [Gary Jones] and [Juliette Reinders Folmer] for their contributions to this version. :clap: - - -## [7.1.5] - 2017-07-17 - -See all related issues and PRs in the [7.1.5 milestone]. - -### Added -- :star: The `NewKeywords` sniff will now also sniff for `yield from` which was introduced in PHP 7.0. [#477](https://github.com/PHPCompatibility/PHPCompatibility/pull/477). Fixes [#476](https://github.com/PHPCompatibility/PHPCompatibility/issues/476) -- :books: The LGPL-3.0 license. [#447](https://github.com/PHPCompatibility/PHPCompatibility/pull/447) - -### Changed -- :rewind: The `NewExecutionDirectives` sniff will now also report on execution directives when used in combination with PHPCS 2.0.0-2.3.3. [#451](https://github.com/PHPCompatibility/PHPCompatibility/pull/451) -- :rewind: The `getMethodParameters()` utility method will no longer break when used with PHPCS 1.5.x < 1.5.6. This affected a number of sniffs. [#452](https://github.com/PHPCompatibility/PHPCompatibility/pull/452) -- :rewind: The `inUseScope()` utility method will no longer break when used with PHPCS 2.0.0 - 2.2.0. This affected a number of sniffs. [#454](https://github.com/PHPCompatibility/PHPCompatibility/pull/454) -- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#443](https://github.com/PHPCompatibility/PHPCompatibility/pull/443), [#474](https://github.com/PHPCompatibility/PHPCompatibility/pull/474) -- :pencil2: Renamed a test file for consistency. [#453](https://github.com/PHPCompatibility/PHPCompatibility/pull/453) -- :wrench: Code style clean up. [#429](https://github.com/PHPCompatibility/PHPCompatibility/pull/429) -- :wrench: Prevent Composer installing PHPCS 3.x. **_PHPCS 3.x is not (yet) supported by the PHPCompatibility standard, but will be in the near future._** [#444](https://github.com/PHPCompatibility/PHPCompatibility/pull/444) -- :green_heart: The code base will now be checked for consistent code style during build testing. [#429](https://github.com/PHPCompatibility/PHPCompatibility/pull/429) -- :green_heart: The sniffs are now also tested against HHVM for consistent results. _Note: the sniffs do not contain any HHVM specific checks nor is there any intention to add them at this time._ [#450](https://github.com/PHPCompatibility/PHPCompatibility/pull/450) -- :books: Made it explicit that - at this moment - PHPCS 3.x is not (yet) supported. [#444](https://github.com/PHPCompatibility/PHPCompatibility/pull/444) -- :books: Minor improvements to the Readme. [#448](https://github.com/PHPCompatibility/PHPCompatibility/pull/448), [#449](https://github.com/PHPCompatibility/PHPCompatibility/pull/449), [#468](https://github.com/PHPCompatibility/PHPCompatibility/pull/468) -- :books: Minor improvements to the Contributing guidelines. [#467](https://github.com/PHPCompatibility/PHPCompatibility/pull/467) - -### Removed -- :no_entry_sign: The `DefaultTimeZoneRequired` sniff. This sniff was checking server settings rather than code. [#458](https://github.com/PHPCompatibility/PHPCompatibility/pull/458). Fixes [#457](https://github.com/PHPCompatibility/PHPCompatibility/issues/457) -- :no_entry_sign: The `NewMagicClassConstant` sniff as introduced in v 7.1.4 contained two additional checks for not strictly compatibility related issues. One of these was plainly wrong, the other opinionated. Both have been removed. [#442](https://github.com/PHPCompatibility/PHPCompatibility/pull/442). Fixes [#436](https://github.com/PHPCompatibility/PHPCompatibility/issues/436) - -### Fixed -- :bug: `NewClass` sniff: was reporting an incorrect introduction version number for a few of the Exception classes. [#441](https://github.com/PHPCompatibility/PHPCompatibility/pull/441). Fixes [#440](https://github.com/PHPCompatibility/PHPCompatibility/issues/440). -- :bug: `ForbiddenBreakContinueVariableArguments` sniff: was incorrectly reporting an error if the `break` or `continue` was followed by a PHP closing tag (breaking out of PHP). [#462](https://github.com/PHPCompatibility/PHPCompatibility/pull/462). Fixes [#460](https://github.com/PHPCompatibility/PHPCompatibility/issues/460) -- :bug: `ForbiddenGlobalVariableVariable` sniff: was incorrectly reporting an error if the `global` statement was followed by a PHP closing tag (breaking out of PHP). [#463](https://github.com/PHPCompatibility/PHPCompatibility/pull/463). -- :bug: `DeprecatedFunctions` sniff: was reporting false positives for classes using the same name as a deprecated function. [#465](https://github.com/PHPCompatibility/PHPCompatibility/pull/465). Fixes [#464](https://github.com/PHPCompatibility/PHPCompatibility/issues/464) - -### Credits -Thanks go out to [Juliette Reinders Folmer] and [Mark Clements] for their contributions to this version. :clap: - - -## [7.1.4] - 2017-05-06 - -See all related issues and PRs in the [7.1.4 milestone]. - -### Added -- :star2: New `CaseSensitiveKeywords` sniff to detect use of non-lowercase `self`, `static` and `parent` keywords which could cause compatibility issues pre-PHP 5.5. [#382](https://github.com/PHPCompatibility/PHPCompatibility/pull/382) -- :star2: New `ConstantArraysUsingConst` sniff to detect constants defined using the `const` keyword being assigned an array value which was not supported prior to PHP 5.6. [#397](https://github.com/PHPCompatibility/PHPCompatibility/pull/397) -- :star2: New `ForbiddenClosureUseVariableNames` sniff to detect PHP 7.1 forbidden variable names in closure use statements. [#386](https://github.com/PHPCompatibility/PHPCompatibility/pull/386). Fixes [#374](https://github.com/PHPCompatibility/PHPCompatibility/issues/374) -- :star2: New `NewArrayStringDereferencing` sniff to detect array and string literal dereferencing as introduced in PHP 5.5. [#388](https://github.com/PHPCompatibility/PHPCompatibility/pull/388) -- :star2: New `NewHeredocInitialize` sniff to detect initialization of static variables and class properties/constants using the heredoc syntax which is supported since PHP 5.3. [#391](https://github.com/PHPCompatibility/PHPCompatibility/pull/391). Fixes [#51](https://github.com/PHPCompatibility/PHPCompatibility/issues/51) -- :star2: New `NewMagicClassConstant` sniff to detect use of the magic `::class` constant as introduced in PHP 5.5. [#403](https://github.com/PHPCompatibility/PHPCompatibility/pull/403). Fixes [#364](https://github.com/PHPCompatibility/PHPCompatibility/issues/364). -- :star2: New `NewUseConstFunction` sniff to detect use statements importing constants and functions as introduced in PHP 5.6. [#401](https://github.com/PHPCompatibility/PHPCompatibility/pull/401) -- :star: `DeprecatedFunctions` sniff: recognize PHP 7.2 deprecated GD functions. [#392](https://github.com/PHPCompatibility/PHPCompatibility/pull/392) -- :star: `DeprecatedIniDirectives` sniff: recognize PHP 7.2 deprecated `mbstring.func_overload` directive. [#377](https://github.com/PHPCompatibility/PHPCompatibility/pull/377) -- :star: `NewClasses` sniff: check for the PHP 5.1 `libXMLError` class. [#412](https://github.com/PHPCompatibility/PHPCompatibility/pull/412) -- :star: `NewClasses` sniff: recognize all native PHP Exception classes. [#418](https://github.com/PHPCompatibility/PHPCompatibility/pull/418) -- :star: `NewClosure` sniff: check for closures being declared as static and closures using `$this`. Both of which was not supported pre-PHP 5.4. [#389](https://github.com/PHPCompatibility/PHPCompatibility/pull/389). Fixes [#24](https://github.com/PHPCompatibility/PHPCompatibility/issues/24). -- :star: `NewFunctionParameters` sniff: recognize new `exclude_disabled` parameter for the `get_defined_functions()` function as introduced in PHP 7.0.15. [#375](https://github.com/PHPCompatibility/PHPCompatibility/pull/375) -- :star: `NewFunctions` sniff: recognize new PHP 7.2 socket related functions. [#376](https://github.com/PHPCompatibility/PHPCompatibility/pull/376) -- :star: `NewInterfaces` sniff: check for some more PHP native interfaces. [#411](https://github.com/PHPCompatibility/PHPCompatibility/pull/411) -- :star: New `isClassProperty()`, `isClassConstant()` and `validDirectScope()` utility methods to the `PHPCompatibility_Sniff` class. [#393](https://github.com/PHPCompatibility/PHPCompatibility/pull/393), [#391](https://github.com/PHPCompatibility/PHPCompatibility/pull/391). -- :star: New `getTypeHintsFromFunctionDeclaration()` utility method to the `PHPCompatibility_Sniff` class. [#414](https://github.com/PHPCompatibility/PHPCompatibility/pull/414). -- :umbrella: Unit tests against false positives for the `NewMagicMethods` sniff. [#381](https://github.com/PHPCompatibility/PHPCompatibility/pull/381) -- :umbrella: More unit tests for the `getTestVersion()` utility method. [#405](https://github.com/PHPCompatibility/PHPCompatibility/pull/405), [#430](https://github.com/PHPCompatibility/PHPCompatibility/pull/430) -- :green_heart: The XML of the ruleset will now be validated and checked for consistent code style during the build testing by Travis. [#433](https://github.com/PHPCompatibility/PHPCompatibility/pull/433) -- :books: Readme: information about setting `installed_paths` via a custom ruleset. [#407](https://github.com/PHPCompatibility/PHPCompatibility/pull/407) -- :books: `Changelog.md` file containing a record of notable changes since the first tagged release. [#421](https://github.com/PHPCompatibility/PHPCompatibility/pull/421) - -### Changed -- :pushpin: The `ForbiddenNamesAsDeclared` sniff will now emit `warning`s for soft reserved keywords. [#406](https://github.com/PHPCompatibility/PHPCompatibility/pull/406), [#370](https://github.com/PHPCompatibility/PHPCompatibility/pull/370). -- :pushpin: The `ForbiddenNames` sniff will now allow for the more liberal rules for usage of reserved keywords as of PHP 7.0. [#417](https://github.com/PHPCompatibility/PHPCompatibility/pull/417) -- :pushpin: The `InternalInterfaces`, `NewClasses`, `NewConstVisibility`, `NewInterfaces`, `NewMagicMethods`, `NonStaticMagicMethods` and `RemovedGlobalVariables` sniffs will now also sniff for and correctly report violations in combination with anonymous classes. [#378](https://github.com/PHPCompatibility/PHPCompatibility/pull/378), [#383](https://github.com/PHPCompatibility/PHPCompatibility/pull/383), [#393](https://github.com/PHPCompatibility/PHPCompatibility/pull/393), [#394](https://github.com/PHPCompatibility/PHPCompatibility/pull/394), [#395](https://github.com/PHPCompatibility/PHPCompatibility/pull/395), [#396](https://github.com/PHPCompatibility/PHPCompatibility/pull/396). Fixes [#351](https://github.com/PHPCompatibility/PHPCompatibility/issues/351) and [#333](https://github.com/PHPCompatibility/PHPCompatibility/issues/333). -- :pushpin: The `NewClasses` and `NewInterfaces` sniffs will now also report on new classes/interfaces when used as type hints. [#414](https://github.com/PHPCompatibility/PHPCompatibility/pull/414), [#416](https://github.com/PHPCompatibility/PHPCompatibility/pull/416). Fixes [#352](https://github.com/PHPCompatibility/PHPCompatibility/issues/352) -- :pushpin: The `NewClasses` sniff will now also report on Exception classes when used in (multi-)`catch` statements. [#418](https://github.com/PHPCompatibility/PHPCompatibility/pull/418). Fixes [#373](https://github.com/PHPCompatibility/PHPCompatibility/issues/373). -- :pushpin: The `NewScalarTypeDeclarations` sniff will now report on new type hints even when the type hint is nullable. [#379](https://github.com/PHPCompatibility/PHPCompatibility/pull/379) -- :twisted_rightwards_arrows: The `NewNowdoc` sniff has been renamed to `NewNowdocQuotedHeredoc` and will now also check for double quoted heredoc identifiers as introduced in PHP 5.3. [#390](https://github.com/PHPCompatibility/PHPCompatibility/pull/390) -- :rewind: The `NewClasses` sniff will now also report anonymous classes which `extend` a new sniff when used in combination with PHPCS 2.4.0-2.8.0. [#432](https://github.com/PHPCompatibility/PHPCompatibility/pull/432). Fixes [#334](https://github.com/PHPCompatibility/PHPCompatibility/issues/334). -- :pencil2: `NewFunctionParameter` sniff: version number precision for two parameters. [#384](https://github.com/PHPCompatibility/PHPCompatibility/pull/384), [#428](https://github.com/PHPCompatibility/PHPCompatibility/pull/428) -- :umbrella: Skipping two unit tests for the `ForbiddenClosureUseVariable` sniff when run on PHPCS 2.5.1 as these cause an infinite loop due to an upstream bug. [#408](https://github.com/PHPCompatibility/PHPCompatibility/pull/408) -- :umbrella: Skipping unit tests involving `trait`s in combination with PHP < 5.4 and PHPCS < 2.4.0 as `trait`s are not recognized in those circumstances. [#431](https://github.com/PHPCompatibility/PHPCompatibility/pull/431) -- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#385](https://github.com/PHPCompatibility/PHPCompatibility/pull/385), [#387](https://github.com/PHPCompatibility/PHPCompatibility/pull/387), [#415](https://github.com/PHPCompatibility/PHPCompatibility/pull/415), [#423](https://github.com/PHPCompatibility/PHPCompatibility/pull/423), [#424](https://github.com/PHPCompatibility/PHPCompatibility/pull/424) -- :recycle: Minor simplification of the PHPUnit 6 compatibility layer and other test code. [#426](https://github.com/PHPCompatibility/PHPCompatibility/pull/426), [#425](https://github.com/PHPCompatibility/PHPCompatibility/pull/425) -- General housekeeping. [#398](https://github.com/PHPCompatibility/PHPCompatibility/pull/398), [#400](https://github.com/PHPCompatibility/PHPCompatibility/pull/400) -- :wrench: Minor tweaks to the Travis build script. [#409](https://github.com/PHPCompatibility/PHPCompatibility/pull/409) -- :green_heart: The sniffs are now also tested against PHP nightly for consistent results. [#380](https://github.com/PHPCompatibility/PHPCompatibility/pull/380) - -### Fixed -- :fire: Using unbounded ranges in `testVersion` resulted in unreported errors when used with sniffs using the `supportsBelow()` method. This affected the results of approximately half the sniffs. [#430](https://github.com/PHPCompatibility/PHPCompatibility/pull/430) -- :bug: The `ForbiddenNames` sniff would throw false positives for `use` statements with the `final` modifier in traits. [#402](https://github.com/PHPCompatibility/PHPCompatibility/pull/402). -- :bug: The `ForbiddenNames` sniff would fail to report on functions declared to return by reference using a reserved keyword as the function name. [#413](https://github.com/PHPCompatibility/PHPCompatibility/pull/413) -- :bug: The `ForbiddenNames` sniff would only examine the first part of a namespace and not report on reserved keywords used in subsequent parts of a nested namespace. [#419](https://github.com/PHPCompatibility/PHPCompatibility/pull/419) -- :bug: The `ForbiddenNames` sniff would not always correctly report on use statements importing constants or functions using reserved keywords. [#420](https://github.com/PHPCompatibility/PHPCompatibility/pull/420) -- :bug: The `NewKeywords` sniff would sometimes fail to report on the `const` keyword when used in a class, but not for a class constant. [#424](https://github.com/PHPCompatibility/PHPCompatibility/pull/424) -- :green_heart: PHPCS has released version 3.0 and updated the `master` branch to reflect this. This was causing the builds to fail. [#422](https://github.com/PHPCompatibility/PHPCompatibility/pull/422) - -### Credits -Thanks go out to [Juliette Reinders Folmer] and [Mark Clements] for their contributions to this version. :clap: - - -## [7.1.3] - 2017-04-02 - -See all related issues and PRs in the [7.1.3 milestone]. - -### Added -- :zap: The `testVersion` config parameter now allows for specifying unbounded ranges. - For example: specifying `-5.6` means: check for compatibility with all PHP versions up to and including PHP 5.6; - Specifying `7.0-` means: check for compatibility with all PHP versions from PHP 7.0 upwards. - For more information about setting the `testVersion`, see [Using the compatibility sniffs](https://github.com/PHPCompatibility/PHPCompatibility#using-the-compatibility-sniffs) in the readme. -- :umbrella: Unit test for multi-line short arrays for the `ShortArray` sniff. [#347](https://github.com/PHPCompatibility/PHPCompatibility/pull/347) -- :umbrella: Various additional unit tests against false positives. [#345](https://github.com/PHPCompatibility/PHPCompatibility/pull/345), [#369](https://github.com/PHPCompatibility/PHPCompatibility/pull/369) -- :umbrella: Unit tests for the `supportsBelow()`, `supportsAbove()` and `getTestVersion()` utility methods. [#363](https://github.com/PHPCompatibility/PHPCompatibility/pull/363) -- :books: Readme: information about installation of the standard using git check-out. [#349](https://github.com/PHPCompatibility/PHPCompatibility/pull/349) -- :books: `Contributing.md` file with information about reporting bugs, requesting features, making pull requests and running the unit tests. [#350](https://github.com/PHPCompatibility/PHPCompatibility/pull/350) - -### Changed -- :pushpin: The `ForbiddenFunctionParametersWithSameName`, `NewScalarTypeDeclarations`, `ParameterShadowSuperGlobals` sniff will now also sniff for and report violations in closures. [#331](https://github.com/PHPCompatibility/PHPCompatibility/pull/331) -- :twisted_rightwards_arrows: :rewind: The check for the PHP 5.3 `nowdoc` structure has been moved from the `NewKeywords` sniff to a new stand-alone `NewNowdoc` sniff which will now also recognize this structure when the sniffs are run on PHP 5.2. [#335](https://github.com/PHPCompatibility/PHPCompatibility/pull/335) -- :rewind: The `ForbiddenNames` sniff will now also correctly recognize reserved keywords used in a declared namespace when run on PHP 5.2. [#362](https://github.com/PHPCompatibility/PHPCompatibility/pull/362) -- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#360](https://github.com/PHPCompatibility/PHPCompatibility/pull/360) -- :recycle: The unit tests would previously run each test case file against all PHPCompatibility sniffs. Now, they will only be tested against the sniff which the test case file is intended to test. This allows for more test cases to be tested, more precise testing in combination with `testVersion` settings and makes the unit tests run ~6 x faster. - Relevant additional unit tests have been added and others adjusted. [#369](https://github.com/PHPCompatibility/PHPCompatibility/pull/369) -- :recycle: Refactoring/tidying up of some unit test code. [#343](https://github.com/PHPCompatibility/PHPCompatibility/pull/343), [#345](https://github.com/PHPCompatibility/PHPCompatibility/pull/345), [#356](https://github.com/PHPCompatibility/PHPCompatibility/pull/356), [#355](https://github.com/PHPCompatibility/PHPCompatibility/pull/355), [#359](https://github.com/PHPCompatibility/PHPCompatibility/pull/359) -- General housekeeping. [#346](https://github.com/PHPCompatibility/PHPCompatibility/pull/346) -- :books: Readme: Clarify minimum requirements and influence on the results. [#348](https://github.com/PHPCompatibility/PHPCompatibility/pull/348) - -### Removed -- :twisted_rightwards_arrows: Removed the `LongArrays` sniff. The checks it contained have been moved into the `RemovedGlobalVariables` sniff. Both sniffs essentially did the same thing, just for different PHP native superglobals. [#354](https://github.com/PHPCompatibility/PHPCompatibility/pull/354) - -### Fixed -- :bug: The `PregReplaceEModifier` sniff would throw a false positive if a quote character was used as the regex delimiter. [#357](https://github.com/PHPCompatibility/PHPCompatibility/pull/357) -- :bug: `RemovedGlobalVariables` sniff would report false positives for class properties shadowing the removed `$HTTP_RAW_POST_DATA` variables. [#354](https://github.com/PHPCompatibility/PHPCompatibility/pull/354). -- :bug: The `getFQClassNameFromNewToken()` utility function could go into an infinite loop causing PHP to run out of memory when examining unfinished code (examination during live coding). [#338](https://github.com/PHPCompatibility/PHPCompatibility/pull/338), [#342](https://github.com/PHPCompatibility/PHPCompatibility/pull/342) -- :bug: The `determineNamespace()` utility method would in certain cases not break out a loop. [#358](https://github.com/PHPCompatibility/PHPCompatibility/pull/358) -- :wrench: Travis script: Minor tweak for PHP 5.2 compatibility. [#341](https://github.com/PHPCompatibility/PHPCompatibility/pull/341) -- :wrench: The unit test suite is now also compatible with PHPUnit 6. [#365](https://github.com/PHPCompatibility/PHPCompatibility/pull/365) -- :books: Readme: Typo in the composer instructions. [#344](https://github.com/PHPCompatibility/PHPCompatibility/pull/344) - -### Credits -Thanks go out to [Arthur Edamov], [Juliette Reinders Folmer], [Mark Clements] and [Tadas Juozapaitis] for their contributions to this version. :clap: - - -## [7.1.2] - 2017-02-17 - -See all related issues and PRs in the [7.1.2 milestone]. - -### Added -- :star2: New `VariableVariables` sniff to detect variables variables for which the behaviour has changed in PHP 7.0. [#310](https://github.com/PHPCompatibility/PHPCompatibility/pull/310) Fixes [#309](https://github.com/PHPCompatibility/PHPCompatibility/issues/309). -- :star: The `NewReturnTypeDeclarations` sniff will now also sniff for non-scalar return type declarations, i.e. `array`, `callable`, `self` or a class name. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) -- :star: The `NewLanguageConstructs` sniff will now also sniff for the null coalesce equal operator `??=`. This operator is slated to be introduced in PHP 7.2 and PHPCS already accounts for it. [#340](https://github.com/PHPCompatibility/PHPCompatibility/pull/340) -- :star: New `getReturnTypeHintToken()` utility method to the `PHPCompatibility_Sniff` class to retrieve return type hints from function declarations in a cross-PHPCS-version compatible way. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323). -- :star: New `stripVariables()` utility method to the `PHPCompatibility_Sniff` class to strip variables from interpolated text strings. [#341](https://github.com/PHPCompatibility/PHPCompatibility/pull/314). -- :umbrella: Additional unit tests covering previously uncovered code. [#308](https://github.com/PHPCompatibility/PHPCompatibility/pull/308) - -### Changed -- :pushpin: The `MbstringReplaceEModifier`, `PregReplaceEModifier` and `NewExecutionDirectives` sniffs will now also correctly interpret double quoted text strings with interpolated variables. [#341](https://github.com/PHPCompatibility/PHPCompatibility/pull/314), [#324](https://github.com/PHPCompatibility/PHPCompatibility/pull/324). -- :pushpin: The `NewNullableTypes` sniff will now also report on nullable (return) type hints when used with closures. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) -- :pushpin: The `NewReturnTypeDeclarations` sniff will now also report on return type hints when used with closures. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) -- :pushpin: Allow for anonymous classes in the `inClassScope()` utility method. [#315](https://github.com/PHPCompatibility/PHPCompatibility/pull/315) -- :pushpin: The function call parameter related utility functions can now also be used to get the individual items from an array declaration. [#300](https://github.com/PHPCompatibility/PHPCompatibility/pull/300) -- :twisted_rightwards_arrows: The `NewScalarReturnTypeDeclarations` sniff has been renamed to `NewReturnTypeDeclarations`. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) -- :rewind: The `ForbiddenNames` sniff will now also correctly ignore anonymous classes when used in combination with PHPCS < 2.3.4. [#319](https://github.com/PHPCompatibility/PHPCompatibility/pull/319) -- :rewind: The `NewAnonymousClasses` sniff will now correctly recognize and report on anonymous classes when used in combination with PHPCS < 2.5.2. [#325](https://github.com/PHPCompatibility/PHPCompatibility/pull/325) -- :rewind: The `NewGroupUseDeclarations` sniff will now correctly recognize and report on group use statements when used in combination with PHPCS < 2.6.0. [#320](https://github.com/PHPCompatibility/PHPCompatibility/pull/320) -- :rewind: The `NewNullableTypes` sniff will now correctly recognize and report on nullable return types when used in combination with PHPCS < 2.6.0. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) -- :rewind: The `NewReturnTypeDeclarations` sniff will now correctly recognize and report on new return types when used in combination with PHPCS < 2.6.0. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) -- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#317](https://github.com/PHPCompatibility/PHPCompatibility/pull/317) -- :recycle: Defer to upstream `hasCondition()` utility method where appropriate. [#315](https://github.com/PHPCompatibility/PHPCompatibility/pull/315) -- :recycle: Minor refactoring of some unit test code. [#304](https://github.com/PHPCompatibility/PHPCompatibility/pull/304), [#303](https://github.com/PHPCompatibility/PHPCompatibility/pull/303), [#318](https://github.com/PHPCompatibility/PHPCompatibility/pull/318) -- :wrench: All unit tests now have appropriate `@group` annotations allowing for quicker/easier testing of a select group of tests/sniffs. [#305](https://github.com/PHPCompatibility/PHPCompatibility/pull/305) -- :wrench: All unit tests now have appropriate `@covers` annotations to improve code coverage reporting and remove bleed through of accidental coverage. [#307](https://github.com/PHPCompatibility/PHPCompatibility/pull/307) -- :wrench: Minor tweaks to the travis script. [#322](https://github.com/PHPCompatibility/PHPCompatibility/pull/322) -- :green_heart: The PHPCompatibility code base itself will now be checked for cross-version compatibility during build testing. [#322](https://github.com/PHPCompatibility/PHPCompatibility/pull/322) - -### Fixed -- :bug: The `ConstantArraysUsingDefine` sniff would throw false positives if the value of the `define()` was retrieved via a function call and an array parameter was passed. [#327](https://github.com/PHPCompatibility/PHPCompatibility/pull/327) -- :bug: The `ForbiddenCallTimePassByReference` sniff would throw false positives on assign by reference within function calls or conditions. [#302](https://github.com/PHPCompatibility/PHPCompatibility/pull/302) Fixes the last two cases reported in [#68](https://github.com/PHPCompatibility/PHPCompatibility/issues/68#issuecomment-231366445) -- :bug: The `ForbiddenGlobalVariableVariableSniff` sniff would only examine the first variable in a `global ...` statement causing unreported issues if subsequent variables were variable variables. [#316](https://github.com/PHPCompatibility/PHPCompatibility/pull/316) -- :bug: The `NewKeywords` sniff would throw a false positive for the `const` keyword when encountered in an interface. [#312](https://github.com/PHPCompatibility/PHPCompatibility/pull/312) -- :bug: The `NewNullableTypes` sniff would not report on nullable return types for namespaced classnames used as a type hint. [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323) -- :bug: The `PregReplaceEModifier` sniff would always consider the first parameter passed as a single regex, while it could also be an array of regexes. This led to false positives and potentially unreported use of the `e` modifier when an array of regexes was passed. [#300](https://github.com/PHPCompatibility/PHPCompatibility/pull/300) -- :bug: The `PregReplaceEModifier` sniff could misidentify the regex delimiter when the regex to be examined was concatenated together from various text strings taken from a compound parameter leading to false positives. [#300](https://github.com/PHPCompatibility/PHPCompatibility/pull/300) -- :white_check_mark: Compatibility with PHPCS 2.7.x. Deal with changed behaviour of the upstream PHP tokenizer and utility function(s). [#313](https://github.com/PHPCompatibility/PHPCompatibility/pull/313), [#323](https://github.com/PHPCompatibility/PHPCompatibility/pull/323), [#326](https://github.com/PHPCompatibility/PHPCompatibility/pull/326), [#340](https://github.com/PHPCompatibility/PHPCompatibility/pull/340) - -### Credits -Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: - - -## [7.1.1] - 2016-12-14 - -See all related issues and PRs in the [7.1.1 milestone]. - -### Added -- :star: `ForbiddenNamesAsDeclared` sniff: detection of the PHP 7.1 `iterable` and `void` reserved keywords when used to name classes, interfaces or traits. [#298](https://github.com/PHPCompatibility/PHPCompatibility/pull/298) - -### Fixed -- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff would incorrectly throw an error if the `clone` keyword was used with parenthesis. [#299](https://github.com/PHPCompatibility/PHPCompatibility/pull/299). Fixes [#284](https://github.com/PHPCompatibility/PHPCompatibility/issues/284) - -### Credits -Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: - - -## [7.1.0] - 2016-12-14 - -See all related issues and PRs in the [7.1.0 milestone]. - -### Added -- :star: New `stringToErrorCode()`, `arrayKeysToLowercase()` and `addMessage()` utility methods to the `PHPCompatibility_Sniff` class. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291). - -### Changed -- :pushpin: All sniff error messages now have modular error codes allowing for selectively disabling individual checks - and even selectively disabling individual sniff for specific files - without disabling the complete sniff. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) -- :pencil2: Minor changes to some of the error message texts for consistency across sniffs. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) -- :recycle: Refactored the complex version sniffs to reduce code duplication. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) -- :recycle: Miscellaneous other refactoring for improved performance and sniff accuracy. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) -- :umbrella: The unit tests for the `RemovedExtensions` sniff now verify that the correct alternative extension is being suggested. [#291](https://github.com/PHPCompatibility/PHPCompatibility/pull/291) - -### Credits -Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: - - -## [7.0.8] - 2016-10-31 - :ghost: Spooky! :jack_o_lantern: - -See all related issues and PRs in the [7.0.8 milestone]. - -### Added -- :star2: New `ForbiddenNamesAsDeclared` sniff: detection of the [other reserved keywords](http://php.net/manual/en/reserved.other-reserved-words.php) which are reserved as of PHP 7.0 (or higher). [#287](https://github.com/PHPCompatibility/PHPCompatibility/pull/287). Fixes [#115](https://github.com/PHPCompatibility/PHPCompatibility/issues/115). - These were previously sniffed for by the `ForbiddenNames` and `ForbiddenNamesAsInvokedFunctions` sniffs causing false positives as the rules for their reservation are different from the rules for "normal" [reserved keywords](http://php.net/manual/en/reserved.keywords.php). -- :star: New `inUseScope()` utility method to the `PHPCompatibility_Sniff` class which handles PHPCS cross-version compatibility when determining the scope of a `use` statement. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). -- :umbrella: More unit tests for the `ForbiddenNames` sniff. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). - -### Changed -- :pushpin: _Deprecated_ functionality should throw a `warning`. _Removed_ or otherwise unavailable functionality should throw an `error`. This distinction was previously not consistently applied everywhere. [#286](https://github.com/PHPCompatibility/PHPCompatibility/pull/286) - This change affects the following sniffs: - * `DeprecatedPHP4StyleConstructors` will now throw a `warning` instead of an `error` for deprecated PHP4 style class constructors. - * `ForbiddenCallTimePassByReference` will now throw a `warning` if the `testVersion` is `5.3` and an `error` if the `testVersion` if `5.4` or higher. - * `MbstringReplaceEModifier` will now throw a `warning` instead of an `error` for usage of the deprecated `e` modifier. - * `PregReplaceEModifier` will now throw a `warning` if the `testVersion` is `5.5` or `5.6` and an `error` if the `testVersion` if `7.0` or higher. Fixes [#290](https://github.com/PHPCompatibility/PHPCompatibility/issues/290). - * `TernaryOperators` will now throw an `error` when the `testVersion` < `5.3` and the middle part has been omitted. - * `ValidIntegers` will now throw a `warning` when an invalid binary integer is detected. -- :pencil2: `DeprecatedFunctions` and `DeprecatedIniDirectives` sniffs: minor change in the sniff error message text. Use _"removed"_ rather than the ominous _"forbidden"_. [#285](https://github.com/PHPCompatibility/PHPCompatibility/pull/285) - Also updated relevant internal variable names and documentation to match. - -### Fixed -- :bug: `ForbiddenNames` sniff would throw false positives for `use` statements which changed the visibility of methods in traits. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). -- :bug: `ForbiddenNames` sniff would not report reserved keywords when used in combination with `use function` or `use const`. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). -- :bug: `ForbiddenNames` sniff would potentially - unintentionally - skip over tokens, thereby - potentially - not reporting all errors. [#271](https://github.com/PHPCompatibility/PHPCompatibility/pull/271). -- :wrench: Composer config: `prefer-stable` should be a root element of the json file. Fixes [#277](https://github.com/PHPCompatibility/PHPCompatibility/issues/277). - -### Credits -Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: - - -## [7.0.7] - 2016-10-20 - -See all related issues and PRs in the [7.0.7 milestone]. - -### Added -- :star2: New `ForbiddenBreakContinueOutsideLoop` sniff: verify that `break`/`continue` is not used outside of a loop structure. This will cause fatal errors since PHP 7.0. [#278](https://github.com/PHPCompatibility/PHPCompatibility/pull/278). Fixes [#275](https://github.com/PHPCompatibility/PHPCompatibility/issues/275) -- :star2: New `NewConstVisibility` sniff: detect visibility indicators for `class` and `interface` constants as introduced in PHP 7.1. [#280](https://github.com/PHPCompatibility/PHPCompatibility/pull/280). Fixes [#249](https://github.com/PHPCompatibility/PHPCompatibility/issues/249) -- :star2: New `NewHashAlgorithms` sniff to check used hash algorithms against the PHP version in which they were introduced. [#242](https://github.com/PHPCompatibility/PHPCompatibility/pull/242) -- :star2: New `NewMultiCatch` sniff: detect catch statements catching multiple Exceptions as introduced in PHP 7.1. [#281](https://github.com/PHPCompatibility/PHPCompatibility/pull/281). Fixes [#251](https://github.com/PHPCompatibility/PHPCompatibility/issues/251) -- :star2: New `NewNullableTypes` sniff: detect nullable parameter and return type hints (only supported in PHPCS >= 2.3.4) as introduced in PHP 7.1. [#282](https://github.com/PHPCompatibility/PHPCompatibility/pull/282). Fixes [#247](https://github.com/PHPCompatibility/PHPCompatibility/issues/247) -- :star: `DeprecatedIniDirectives` sniff: recognize PHP 7.1 removed `session` ini directives. [#256](https://github.com/PHPCompatibility/PHPCompatibility/pull/256) -- :star: `NewFunctions` sniff: recognize new `socket_export_stream()` function as introduced in PHP 7.0.7. [#264](https://github.com/PHPCompatibility/PHPCompatibility/pull/264) -- :star: `NewFunctions` sniff: recognize new `curl_...()`, `is_iterable()`, `pcntl_async_signals()`, `session_create_id()`, `session_gc()` functions as introduced in PHP 7.1. [#273](https://github.com/PHPCompatibility/PHPCompatibility/pull/273) -- :star: `NewFunctionParameters` sniff: recognize new OpenSSL function parameters as introduced in PHP 7.1. [#258](https://github.com/PHPCompatibility/PHPCompatibility/pull/258) -- :star: `NewIniDirectives` sniff: recognize new `session` ini directives as introduced in PHP 7.1. [#259](https://github.com/PHPCompatibility/PHPCompatibility/pull/259) -- :star: `NewScalarReturnTypeDeclarations` sniff: recognize PHP 7.1 `void` return type hint. [#250](https://github.com/PHPCompatibility/PHPCompatibility/pull/250) -- :star: `NewScalarTypeDeclarations` sniff: recognize PHP 7.1 `iterable` type hint. [#255](https://github.com/PHPCompatibility/PHPCompatibility/pull/255) -- :star: Recognize the PHP 7.1 deprecated `mcrypt` functionality in the `RemovedExtensions`, `DeprecatedFunctions` and `DeprecatedIniDirectives` sniffs. [#257](https://github.com/PHPCompatibility/PHPCompatibility/pull/257) - -### Changed -- :pushpin: `LongArrays` sniff used to only throw `warning`s. It will now throw `error`s for PHP versions in which the long superglobals have been removed. [#270](https://github.com/PHPCompatibility/PHPCompatibility/pull/270) -- :pushpin: The `NewIniDirectives` sniff used to always throw an `warning`. Now it will throw an `error` when a new ini directive is used in combination with `ini_set()`. [#246](https://github.com/PHPCompatibility/PHPCompatibility/pull/246). -- :pushpin: `RemovedHashAlgorithms` sniff: also recognize removed algorithms when used with the PHP 5.5+ `hash_pbkdf2()` function. [#240](https://github.com/PHPCompatibility/PHPCompatibility/pull/240) -- :pushpin: Properly recognize nullable type hints in the `getMethodParameters()` utility method. [#282](https://github.com/PHPCompatibility/PHPCompatibility/pull/282) -- :pencil2: `DeprecatedPHP4StyleConstructors` sniff: minor error message text fix. [#236](https://github.com/PHPCompatibility/PHPCompatibility/pull/236) -- :pencil2: `NewIniDirectives` sniff: improved precision for the introduction version numbers being reported. [#246](https://github.com/PHPCompatibility/PHPCompatibility/pull/246) -- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#238](https://github.com/PHPCompatibility/PHPCompatibility/pull/238), [#244](https://github.com/PHPCompatibility/PHPCompatibility/pull/244), [#240](https://github.com/PHPCompatibility/PHPCompatibility/pull/240), [#276](https://github.com/PHPCompatibility/PHPCompatibility/pull/276) -- :umbrella: Re-activate the unit tests for the `NewScalarReturnTypeDeclarations` sniff. [#250](https://github.com/PHPCompatibility/PHPCompatibility/pull/250) - -### Fixed -- :bug: The `DeprecatedPHP4StyleConstructors` sniff would not report errors when the case of the class name and the PHP4 constructor function name did not match. [#236](https://github.com/PHPCompatibility/PHPCompatibility/pull/236) -- :bug: `LongArrays` sniff would report false positives for class properties shadowing removed PHP superglobals. [#270](https://github.com/PHPCompatibility/PHPCompatibility/pull/270). Fixes [#268](https://github.com/PHPCompatibility/PHPCompatibility/issues/268). -- :bug: The `NewClasses` sniff would not report errors when the case of the class name used and "official" class name did not match. [#237](https://github.com/PHPCompatibility/PHPCompatibility/pull/237) -- :bug: The `NewIniDirectives` sniff would report violations against the PHP version in which the ini directive was introduced. This should be the version below it. [#246](https://github.com/PHPCompatibility/PHPCompatibility/pull/246) -- :bug: `PregReplaceEModifier` sniff would report false positives for compound regex parameters with different quote types. [#266](https://github.com/PHPCompatibility/PHPCompatibility/pull/266). Fixes [#265](https://github.com/PHPCompatibility/PHPCompatibility/issues/265). -- :bug: `RemovedGlobalVariables` sniff would report false positives for lowercase/mixed cased variables shadowing superglobals. [#245](https://github.com/PHPCompatibility/PHPCompatibility/pull/245). -- :bug: The `RemovedHashAlgorithms` sniff would not report errors when the case of the hash function name used and "official" class name did not match. [#240](https://github.com/PHPCompatibility/PHPCompatibility/pull/240) -- :bug: The `ShortArray` sniff would report all violations on the line of the PHP open tag, not on the lines of the short array open/close tags. [#238](https://github.com/PHPCompatibility/PHPCompatibility/pull/238) - -### Credits -Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: - - -## [7.0.6] - 2016-09-23 - -See all related issues and PRs in the [7.0.6 milestone]. - -### Added -- :star: New `stripQuotes()` utility method in the `PHPCompatibility_Sniff` base class to strip quotes which surround text strings in a consistent manner. [#224](https://github.com/PHPCompatibility/PHPCompatibility/pull/224) -- :books: Readme: Add _PHP Version Support_ section. [#225](https://github.com/PHPCompatibility/PHPCompatibility/pull/225) - -### Changed -- :pushpin: The `ForbiddenCallTimePassByReference` sniff will now also report the deprecation as of PHP 5.3, not just its removal as of PHP 5.4. [#203](https://github.com/PHPCompatibility/PHPCompatibility/pull/203) -- :pushpin: The `NewFunctionArrayDereferencing` sniff will now also check _method_ calls for array dereferencing, not just function calls. [#229](https://github.com/PHPCompatibility/PHPCompatibility/pull/229). Fixes [#227](https://github.com/PHPCompatibility/PHPCompatibility/issues/227). -- :pencil2: The `NewExecutionDirectives` sniff will now throw `warning`s instead of `error`s for invalid values encountered in execution directives. [#223](https://github.com/PHPCompatibility/PHPCompatibility/pull/223) -- :pencil2: Minor miscellaneous fixes. [#231](https://github.com/PHPCompatibility/PHPCompatibility/pull/231) -- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#219](https://github.com/PHPCompatibility/PHPCompatibility/pull/219), [#203](https://github.com/PHPCompatibility/PHPCompatibility/pull/203) -- :recycle: Defer to upstream `findImplementedInterfaceNames()` utility method when it exists. [#222](https://github.com/PHPCompatibility/PHPCompatibility/pull/222) -- :wrench: Exclude the test files from analysis by Scrutinizer CI. [#230](https://github.com/PHPCompatibility/PHPCompatibility/pull/230) - -### Removed -- :no_entry_sign: Some redundant code. [#232](https://github.com/PHPCompatibility/PHPCompatibility/pull/232) - -### Fixed -- :bug: The `EmptyNonVariable` sniff would throw false positives for variable variables and for array access with a (partially) variable array index. [#212](https://github.com/PHPCompatibility/PHPCompatibility/pull/212). Fixes [#210](https://github.com/PHPCompatibility/PHPCompatibility/issues/210). -- :bug: The `NewFunctionArrayDereferencing` sniff would throw false positives for lines of code containing both a function call as well as square brackets, even when they were unrelated. [#228](https://github.com/PHPCompatibility/PHPCompatibility/pull/228). Fixes [#226](https://github.com/PHPCompatibility/PHPCompatibility/issues/226). -- :bug: `ParameterShadowSuperGlobals` sniff would report false positives for lowercase/mixed cased variables shadowing superglobals. [#218](https://github.com/PHPCompatibility/PHPCompatibility/pull/218). Fixes [#214](https://github.com/PHPCompatibility/PHPCompatibility/issues/214). -- :bug: The `determineNamespace()` utility method now accounts properly for namespaces within scoped `declare()` statements. [#221](https://github.com/PHPCompatibility/PHPCompatibility/pull/221) -- :books: Readme: Logo alignment in the Credits section. [#233](https://github.com/PHPCompatibility/PHPCompatibility/pull/233) - -### Credits -Thanks go out to [Jason Stallings], [Juliette Reinders Folmer] and [Mark Clements] for their contributions to this version. :clap: - - -## [7.0.5] - 2016-09-08 - -See all related issues and PRs in the [7.0.5 milestone]. - -### Added -- :star2: New `MbstringReplaceEModifier` sniff to detect the use of the PHP 7.1 deprecated `e` modifier in Mbstring regex functions. [#202](https://github.com/PHPCompatibility/PHPCompatibility/pull/202) -- :star: The `ForbiddenBreakContinueVariableArguments` sniff will now also report on `break 0`/`continue 0` which is not allowed since PHP 5.4. [#209](https://github.com/PHPCompatibility/PHPCompatibility/pull/209) -- :star: New `getFunctionCallParameters()`, `getFunctionCallParameter()` utility methods in the `PHPCompatibility_Sniff` base class. [#170](https://github.com/PHPCompatibility/PHPCompatibility/pull/170) -- :star: New `tokenHasScope()` utility method in the `PHPCompatibility_Sniff` base class. [#189](https://github.com/PHPCompatibility/PHPCompatibility/pull/189) -- :umbrella: Unit test for `goto` and `callable` detection and some other miscellanous extra unit tests for the `NewKeywords` sniff. [#189](https://github.com/PHPCompatibility/PHPCompatibility/pull/189) -- :books: Readme: Information for sniff developers about running unit tests for _other_ sniff libraries using the PHPCS native test framework without running into conflicts with the PHPCompatibility specific unit test framework. [#217](https://github.com/PHPCompatibility/PHPCompatibility/pull/217) - -### Changed -- :pushpin: The `ForbiddenNames` sniff will now also check interface declarations for usage of reserved keywords. [#200](https://github.com/PHPCompatibility/PHPCompatibility/pull/200) -- :pushpin: `PregReplaceEModifier` sniff: improved handling of regexes build up of a combination of variables, function calls and/or text strings. [#201](https://github.com/PHPCompatibility/PHPCompatibility/pull/201) -- :rewind: The `NewKeywords` sniff will now also correctly recognize new keywords when used in combination with older PHPCS versions and/or run on older PHP versions. [#189](https://github.com/PHPCompatibility/PHPCompatibility/pull/189) -- :pencil2: `PregReplaceEModifier` sniff: minor improvement to the error message text. [#201](https://github.com/PHPCompatibility/PHPCompatibility/pull/201) -- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#170](https://github.com/PHPCompatibility/PHPCompatibility/pull/170), [#188](https://github.com/PHPCompatibility/PHPCompatibility/pull/188), [#189](https://github.com/PHPCompatibility/PHPCompatibility/pull/189), [#199](https://github.com/PHPCompatibility/PHPCompatibility/pull/199), [#200](https://github.com/PHPCompatibility/PHPCompatibility/pull/200), [#201](https://github.com/PHPCompatibility/PHPCompatibility/pull/201), [#208](https://github.com/PHPCompatibility/PHPCompatibility/pull/208) -- :wrench: The unit tests for the utility methods have been moved to their own subdirectory within `Tests`. [#215](https://github.com/PHPCompatibility/PHPCompatibility/pull/215) -- :green_heart: The sniffs are now also tested against PHP 7.1 for consistent results. [#216](https://github.com/PHPCompatibility/PHPCompatibility/pull/216) - -### Removed -- :no_entry_sign: Some redundant code. [26d0b6](https://github.com/PHPCompatibility/PHPCompatibility/commit/26d0b6cf0921f75d93a4faaf09c390f386dde9ff) and [841616](https://github.com/PHPCompatibility/PHPCompatibility/commit/8416162ea81f4067226324f5948f4a50f7958a9b) - -### Fixed -- :bug: `ConstantArraysUsingDefine` sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. [#199](https://github.com/PHPCompatibility/PHPCompatibility/pull/199) -- :bug: The `DeprecatedIniDirectives` and `NewIniDirectives` sniffs could potentially trigger on the ini value instead of the ini directive name. [#170](https://github.com/PHPCompatibility/PHPCompatibility/pull/170) -- :bug: `ForbiddenNames` sniff: Reserved keywords when used as the name of a constant declared using `define()` would always be reported independently of the `testVersion` set. [#200](https://github.com/PHPCompatibility/PHPCompatibility/pull/200) -- :bug: `PregReplaceEModifier` sniff would not report errors when the function name used was not in lowercase. [#201](https://github.com/PHPCompatibility/PHPCompatibility/pull/201) -- :bug: `TernaryOperators` sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. [#188](https://github.com/PHPCompatibility/PHPCompatibility/pull/188) -- :bug: The `getFQClassNameFromNewToken()` and `getFQClassNameFromDoubleColonToken()` utility methods would get confused when the class name was a variable instead of being hard-coded, resulting in a PHP warning being thown. [#206](https://github.com/PHPCompatibility/PHPCompatibility/pull/206). Fixes [#205](https://github.com/PHPCompatibility/PHPCompatibility/issues/205). -- :bug: The `getFunctionCallParameters()` utility method would incorrectly identify an extra parameter if the last parameter passed to a function would have an - unnecessary - comma after it. The `getFunctionCallParameters()` utility method also did not handle parameters passed as short arrays correctly. [#213](https://github.com/PHPCompatibility/PHPCompatibility/pull/213). Fixes [#211](https://github.com/PHPCompatibility/PHPCompatibility/issues/211). -- :umbrella: Unit tests for the `NewFunctionArrayDereferencing` sniff were not being run due to a naming error. [#208](https://github.com/PHPCompatibility/PHPCompatibility/pull/208) -- :books: Readme: Information about setting the `testVersion` from a custom ruleset was incorrect. [#204](https://github.com/PHPCompatibility/PHPCompatibility/pull/204) -- :wrench: Path to PHPCS in the unit tests breaking for non-Composer installs. [#198](https://github.com/PHPCompatibility/PHPCompatibility/pull/198) - -### Credits -Thanks go out to [Juliette Reinders Folmer] and [Yoshiaki Yoshida] for their contributions to this version. :clap: - - -## [7.0.4] - 2016-08-20 - -See all related issues and PRs in the [7.0.4 milestone]. - -### Added -- :star2: New `EmptyNonVariable` sniff: detection of empty being used on non-variables for PHP < 5.5. [#187](https://github.com/PHPCompatibility/PHPCompatibility/pull/187) -- :star2: New `NewMagicMethods` sniff: detection of declaration of magic methods before the method became "magic". Includes a check for the changed behaviour for the `__toString()` magic method in PHP 5.2. [#176](https://github.com/PHPCompatibility/PHPCompatibility/pull/176). Fixes [#64](https://github.com/PHPCompatibility/PHPCompatibility/issues/64). -- :star2: New `RemovedAlternativePHPTags` sniff: detection of ASP and script open tags for which support was removed in PHP 7.0. [#184](https://github.com/PHPCompatibility/PHPCompatibility/pull/184), [#193](https://github.com/PHPCompatibility/PHPCompatibility/pull/193). Fixes [#127](https://github.com/PHPCompatibility/PHPCompatibility/issues/127). -- :star: `NonStaticMagicMethods` sniff: detection of the `__callStatic()`, `__sleep()`, `__toString()` and `__set_state()` magic methods. -- :green_heart: Lint all non-test case files for syntax errors during the build testing by Travis. [#192](https://github.com/PHPCompatibility/PHPCompatibility/pull/192) - -### Changed -- :pushpin: `NonStaticMagicMethods` sniff: will now also sniff `trait`s for magic methods. [#174](https://github.com/PHPCompatibility/PHPCompatibility/pull/174) -- :pushpin: `NonStaticMagicMethods` sniff: will now also check for magic methods which should be declared as `static`. [#174](https://github.com/PHPCompatibility/PHPCompatibility/pull/174) -- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#178](https://github.com/PHPCompatibility/PHPCompatibility/pull/178), [#179](https://github.com/PHPCompatibility/PHPCompatibility/pull/179), [#174](https://github.com/PHPCompatibility/PHPCompatibility/pull/174), [#171](https://github.com/PHPCompatibility/PHPCompatibility/pull/171) -- :recycle: The unit test suite now internally caches PHPCS run results in combination with a set `testVersion` to speed up the running of the unit tests. These are now ~3 x faster. [#148](https://github.com/PHPCompatibility/PHPCompatibility/pull/148) -- :books: Readme: Minor clarification of the minimum requirements. -- :books: Readme: Advise to use the latest stable version of this repository. -- :wrench: The unit tests can now be run with PHPCS installed in an arbitrary location by passing the location through an environment option. [#191](https://github.com/PHPCompatibility/PHPCompatibility/pull/191). -- :wrench: Improved coveralls configuration and compatibility. [#194](https://github.com/PHPCompatibility/PHPCompatibility/pull/194) -- :green_heart: The sniffs are now also tested against PHP 5.2 for consistent results. Except for namespace, trait and group use related errors, most sniffs work as intended on PHP 5.2. [#196](https://github.com/PHPCompatibility/PHPCompatibility/pull/196) - -### Fixed -- :bug: The `ForbiddenBreakContinueVariableArguments` sniff would not report on `break`/`continue` with a closure as an argument. [#171](https://github.com/PHPCompatibility/PHPCompatibility/pull/171) -- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff would not report on reserved keywords which were not lowercase. [#186](https://github.com/PHPCompatibility/PHPCompatibility/pull/186) -- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff would not report on the `goto` and `namespace` keywords when run on PHP 5.2. [#193](https://github.com/PHPCompatibility/PHPCompatibility/pull/193) -- :bug: `NewAnonymousClasses` sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. [#195](https://github.com/PHPCompatibility/PHPCompatibility/pull/195). -- :bug: `NewGroupUseDeclarations` sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. [#190](https://github.com/PHPCompatibility/PHPCompatibility/pull/190). -- :bug: The `NonStaticMagicMethods` sniff would not report on magic methods when the function name as declared was not in the same case as used in the PHP manual. [#174](https://github.com/PHPCompatibility/PHPCompatibility/pull/174) -- :wrench: The unit tests would exit with `0` if PHPCS could not be found. [#191](https://github.com/PHPCompatibility/PHPCompatibility/pull/191) -- :green_heart: The PHPCompatibility library itself was not fully compatible with PHP 5.2. [#193](https://github.com/PHPCompatibility/PHPCompatibility/pull/193) - -### Credits -Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: - - -## [7.0.3] - 2016-08-18 - -See all related issues and PRs in the [7.0.3 milestone]. - -### Added -- :star2: New `InternalInterfaces` sniff: detection of internal PHP interfaces being which should not be implemented by user land classes. [#144](https://github.com/PHPCompatibility/PHPCompatibility/pull/144) -- :star2: New `LateStaticBinding` sniff: detection of PHP 5.3 late static binding. [#177](https://github.com/PHPCompatibility/PHPCompatibility/pull/177) -- :star2: New `NewExecutionDirectives` sniff: verify execution directives set with `declare()`. [#169](https://github.com/PHPCompatibility/PHPCompatibility/pull/169) -- :star2: New `NewInterfaces` sniff: detection of the use of newly introduced PHP native interfaces. This sniff will also detect unsupported methods when a class implements the `Serializable` interface. [#144](https://github.com/PHPCompatibility/PHPCompatibility/pull/144) -- :star2: New `RequiredOptionalFunctionParameters` sniff: detection of missing function parameters which were required in earlier PHP versions only to become optional in later versions. [#165](https://github.com/PHPCompatibility/PHPCompatibility/pull/165) -- :star2: New `ValidIntegers` sniff: detection of binary integers for PHP < 5.4, detection of hexademical numeric strings for which recognition as hex integers was removed in PHP 7.0, detection of invalid binary and octal integers. [#160](https://github.com/PHPCompatibility/PHPCompatibility/pull/160). Fixes [#55](https://github.com/PHPCompatibility/PHPCompatibility/issues/55). -- :star: `DeprecatedExtensions` sniff: detect removal of the `ereg` extension in PHP 7. [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) -- :star: `DeprecatedFunctions` sniff: detection of the PHP 5.0.5 deprecated `php_check_syntax()` and PHP 5.4 deprecated `mysqli_get_cache_stats()` functions. [#155](https://github.com/PHPCompatibility/PHPCompatibility/pull/155). -- :star: `DeprecatedFunctions` sniff: detect deprecation of a number of the `mysqli` functions in PHP 5.3. [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) -- :star: `DeprecatedFunctions` sniff: detect removal of the `call_user_method()`, `ldap_sort()`, `ereg_*()` and `mysql_*()` functions in PHP 7.0. [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) -- :star: `DeprecatedIniDirectives` sniff: detection of a _lot_ more deprecated/removed ini directives. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) -- :star: `NewFunctionParameters` sniff: detection of a _lot_ more new function parameters. [#164](https://github.com/PHPCompatibility/PHPCompatibility/pull/164) -- :star: `NewFunctions` sniff: detection of numerous extra new functions. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/161) -- :star: `NewIniDirectives` sniff: detection of a _lot_ more new ini directives. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) -- :star: `NewLanguageConstructs` sniff: detection of the PHP 5.6 ellipsis `...` construct. [#175](https://github.com/PHPCompatibility/PHPCompatibility/pull/175) -- :star: `NewScalarTypeDeclarations` sniff: detection of PHP 5.1 `array` and PHP 5.4 `callable` type hints. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) -- :star: `RemovedFunctionParameters` sniff: detection of a few extra removed function parameters. [#163](https://github.com/PHPCompatibility/PHPCompatibility/pull/163) -- :star: Detection of functions and methods with a double underscore prefix as these are reserved by PHP for future use. The existing upstream `Generic.NamingConventions.CamelCapsFunctionName` sniff is re-used for this with some customization. [#173](https://github.com/PHPCompatibility/PHPCompatibility/pull/173) -- :star: New `getFQClassNameFromNewToken()`, `getFQExtendedClassName()`, `getFQClassNameFromDoubleColonToken()`, `getFQName()`, `isNamespaced()`, `determineNamespace()` and `getDeclaredNamespaceName()` utility methods in the `PHPCompatibility_Sniff` base class for namespace determination. [#162](https://github.com/PHPCompatibility/PHPCompatibility/pull/162) -- :recycle: New `inClassScope()` utility method in the `PHPCompatibility_Sniff` base class. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) -- :recycle: New `doesFunctionCallHaveParameters()` and `getFunctionCallParameterCount()` utility methods in the `PHPCompatibility_Sniff` base class. [#153](https://github.com/PHPCompatibility/PHPCompatibility/pull/153) -- :umbrella: Unit test for `__halt_compiler()` detection by the `NewKeywords` sniff. -- :umbrella: Unit tests for the `NewFunctions` sniff. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/161) -- :umbrella: Unit tests for the `ParameterShadowSuperGlobals` sniff. [#180](https://github.com/PHPCompatibility/PHPCompatibility/pull/180) -- :wrench: Minimal config for Scrutinizer CI. [#145](https://github.com/PHPCompatibility/PHPCompatibility/pull/145). - -### Changed -- :pushpin: The `DeprecatedIniDirectives` and the `NewIniDirectives` sniffs will now indicate an alternative ini directive in case the directive has been renamed. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) -- :pushpin: The `NewClasses` sniff will now also report on new classes being extended by child classes. [#140](https://github.com/PHPCompatibility/PHPCompatibility/pull/140). -- :pushpin: The `NewClasses` sniff will now also report on static use of new classes. [#162](https://github.com/PHPCompatibility/PHPCompatibility/pull/162). -- :pushpin: The `NewScalarTypeDeclarations` sniff will now throw an error on use of type hints pre-PHP 5.0. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) -- :pushpin: The `NewScalarTypeDeclarations` sniff will now verify type hints used against typical mistakes. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) -- :pushpin: The `ParameterShadowSuperGlobals` sniff will now do a case-insensitive variable name compare. [#180](https://github.com/PHPCompatibility/PHPCompatibility/pull/180) -- :pushpin: The `RemovedFunctionParameters` sniff will now also report `warning`s on deprecation of function parameters. [#163](https://github.com/PHPCompatibility/PHPCompatibility/pull/163) -- :twisted_rightwards_arrows: The check for `JsonSerializable` has been moved from the `NewClasses` sniff to the `NewInterfaces` sniff. [#162](https://github.com/PHPCompatibility/PHPCompatibility/pull/162) -- :rewind: The `NewLanguageConstructs` sniff will now also recognize new language constructs when used in combination with PHPCS 1.5.x. [#175](https://github.com/PHPCompatibility/PHPCompatibility/pull/175) -- :pencil2: `NewFunctionParameters` sniff: use correct name for the new parameter for the `dirname()` function. [#164](https://github.com/PHPCompatibility/PHPCompatibility/pull/164) -- :pencil2: `NewScalarTypeDeclarations` sniff: minor change in the sniff error message text. [#168](https://github.com/PHPCompatibility/PHPCompatibility/pull/168) -- :pencil2: `RemovedFunctionParameters` sniff: minor change in the sniff error message text. [#163](https://github.com/PHPCompatibility/PHPCompatibility/pull/163) -- :pencil2: The `ParameterShadowSuperGlobals` sniff now extends the `PHPCompatibility_Sniff` class. [#180](https://github.com/PHPCompatibility/PHPCompatibility/pull/180) -- :recycle: Various (minor) refactoring for improved performance and sniff accuracy. [#181](https://github.com/PHPCompatibility/PHPCompatibility/pull/181), [#182](https://github.com/PHPCompatibility/PHPCompatibility/pull/182), [#166](https://github.com/PHPCompatibility/PHPCompatibility/pull/166), [#167](https://github.com/PHPCompatibility/PHPCompatibility/pull/167), [#172](https://github.com/PHPCompatibility/PHPCompatibility/pull/172), [#180](https://github.com/PHPCompatibility/PHPCompatibility/pull/180), [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146), [#138](https://github.com/PHPCompatibility/PHPCompatibility/pull/138) -- :recycle: Various refactoring to remove code duplication in the unit tests and add proper test skip notifications where relevant. [#139](https://github.com/PHPCompatibility/PHPCompatibility/pull/139), [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) - -### Fixed -- :bug: The `DeprecatedFunctions` sniff was reporting an incorrect deprecation/removal version number for a few functions. [#149](https://github.com/PHPCompatibility/PHPCompatibility/pull/149) -- :bug: The `DeprecatedIniDirectives` sniff was in select cases reporting deprecation of an ini directive prior to removal, while the ini directive was never deprecated prior to its removal. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) -- :bug: The `DeprecatedPHP4StyleConstructors` sniff would cause false positives for methods with the same name as the class in namespaced classes. [#167](https://github.com/PHPCompatibility/PHPCompatibility/pull/167) -- :bug: The `ForbiddenEmptyListAssignment` sniff did not report errors when there were only comments or parentheses between the list parentheses. [#166](https://github.com/PHPCompatibility/PHPCompatibility/pull/166) -- :bug: The `ForbiddenEmptyListAssignment` sniff will no longer cause false positives during live coding. [#166](https://github.com/PHPCompatibility/PHPCompatibility/pull/166) -- :bug: The `NewClasses` sniff would potentially misidentify namespaced classes as PHP native classes. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/162) -- :bug: The `NewFunctions` sniff would fail to identify called functions when the function call was not lowercase. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/161) -- :bug: The `NewFunctions` sniff would potentially misidentify namespaced userland functions as new functions. [#161](https://github.com/PHPCompatibility/PHPCompatibility/pull/161) -- :bug: The `NewIniDirectives` sniff was reporting an incorrect introduction version number for a few ini directives. [#146](https://github.com/PHPCompatibility/PHPCompatibility/pull/146) -- :bug: `NewKeywords` sniff: the use of the `const` keyword should only be reported when used outside of a class for PHP < 5.3. [#147](https://github.com/PHPCompatibility/PHPCompatibility/pull/147). Fixes [#129](https://github.com/PHPCompatibility/PHPCompatibility/issues/129). -- :bug: The `RemovedExtensions` sniff was incorrectly reporting a number of extensions as being removed in PHP 5.3 while they were actually removed in PHP 5.1. [#156](https://github.com/PHPCompatibility/PHPCompatibility/pull/156) -- :bug: :recycle: The `NewFunctionParameters` and `RemovedFunctionParameters` now use the new `doesFunctionCallHaveParameters()` and `getFunctionCallParameterCount()` utility methods for improved accuracy in identifying function parameters. This fixes several false positives. [#153](https://github.com/PHPCompatibility/PHPCompatibility/pull/153) Fixes [#120](https://github.com/PHPCompatibility/PHPCompatibility/issues/120), [#151](https://github.com/PHPCompatibility/PHPCompatibility/issues/151), [#152](https://github.com/PHPCompatibility/PHPCompatibility/issues/152). -- :bug: A number of sniffs would return `false` if the examined construct was not found. This could potentially cause race conditions/infinite sniff loops. [#138](https://github.com/PHPCompatibility/PHPCompatibility/pull/138) -- :wrench: The unit tests would fail to run when used in combination with a PEAR install of PHPCS. [#157](https://github.com/PHPCompatibility/PHPCompatibility/pull/157). -- :green_heart: Unit tests failing against PHPCS 2.6.1. [#158](https://github.com/PHPCompatibility/PHPCompatibility/pull/158) - The unit tests *will* still fail against PHPCS 2.6.2 due to a bug in PHPCS itself. This bug does not affect the running of the sniffs outside of a unit test context. - -### Credits -Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: - - -## [7.0.2] - 2016-08-03 - -See all related issues and PRs in the [7.0.2 milestone]. - -### Added -- :star: `RemovedExtensions` sniff: ability to whitelist userland functions for which the function prefix overlaps with a prefix of a deprecated/removed extension. [#130](https://github.com/PHPCompatibility/PHPCompatibility/pull/130). Fixes [#123](https://github.com/PHPCompatibility/PHPCompatibility/issues/123). - To use this feature, add the `functionWhitelist` property in your custom ruleset. For more information, see the [README](https://github.com/PHPCompatibility/PHPCompatibility#phpcompatibility-specific-options). - -### Changed -- :pencil2: A number of sniffs contained `public` class properties. Within PHPCS, `public` properties can be overruled via a custom ruleset. This was not the intention, so the visibility of these properties has been changed to `protected`. [#135](https://github.com/PHPCompatibility/PHPCompatibility/pull/135) -- :wrench: Composer config: Stable packages are preferred over unstable/dev. -- :pencil2: Ruleset name. [#134](https://github.com/PHPCompatibility/PHPCompatibility/pull/134) - -### Credits -Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap: - - -## [7.0.1] - 2016-08-02 - -See all related issues and PRs in the [7.0.1 milestone]. - -### Changed -- :pushpin: The `DeprecatedIniDirectives` sniff used to throw an `error` when a deprecated ini directive was used in combination with `ini_get()`. It will now throw a `warning` instead. [#122](https://github.com/PHPCompatibility/PHPCompatibility/pull/122) Fixes [#119](https://github.com/PHPCompatibility/PHPCompatibility/issues/119). - Usage of deprecated ini directives in combination with `ini_set()` will still throw an `error`. -- :pushpin: The `PregReplaceEModifier` sniff now also detects the `e` modifier when used with the `preg_filter()` function. While this is undocumented, the `e` modifier was supported by the `preg_filter()` function as well. [#128](https://github.com/PHPCompatibility/PHPCompatibility/pull/128) -- :pencil2: The `RemovedExtensions` sniff contained superfluous deprecation information in the error message. [#131](https://github.com/PHPCompatibility/PHPCompatibility/pull/131) - -### Removed -- :wrench: Duplicate builds from the Travis CI build matrix. [#132](https://github.com/PHPCompatibility/PHPCompatibility/pull/132) - -### Fixed -- :bug: The `ForbiddenNames` sniff did not allow for the PHP 5.6 `use function ...` and `use const ...` syntax. [#126](https://github.com/PHPCompatibility/PHPCompatibility/pull/126) Fixes [#124](https://github.com/PHPCompatibility/PHPCompatibility/issues/124). -- :bug: The `NewClasses` sniff failed to detect new classes when the class was instantiated without parenthesis, i.e. `new NewClass;`. [#121](https://github.com/PHPCompatibility/PHPCompatibility/pull/121) -- :bug: The `PregReplaceEModifier` sniff failed to detect the `e` modifier when using bracket delimiters for the regex other than the `{}` brackets. [#128](https://github.com/PHPCompatibility/PHPCompatibility/pull/128) -- :green_heart: Unit tests failing against PHPCS 2.6.1. - -### Credits -Thanks go out to [Jason Stallings], [Juliette Reinders Folmer] and [Ryan Neufeld] for their contributions to this version. :clap: - - -## [7.0] - 2016-07-02 - -See all related issues and PRs in the [7.0 milestone]. - -### Added -- :zap: Ability to specify a range of PHP versions against which to test your code base for compatibility, i.e. `--runtime-set testVersion 5.0-5.4` will now test your code for compatibility with PHP 5.0 up to PHP 5.4. [#99](https://github.com/PHPCompatibility/PHPCompatibility/pull/99) -- :star2: New `NewFunctionArrayDereferencing` sniff to detect function array dereferencing as introduced in PHP 5.4. Fixes [#52](https://github.com/PHPCompatibility/PHPCompatibility/issues/52). -- :star2: New `ShortArray` sniff to detect short array syntax as introduced in PHP 5.4. [#97](https://github.com/PHPCompatibility/PHPCompatibility/pull/97). Fixes [#47](https://github.com/PHPCompatibility/PHPCompatibility/issues/47). -- :star2: New `TernaryOperators` sniff to detect ternaries without the middle part (`elvis` operator) as introduced in PHP 5.3. [#101](https://github.com/PHPCompatibility/PHPCompatibility/pull/101), [#103](https://github.com/PHPCompatibility/PHPCompatibility/pull/103). Fixes [#49](https://github.com/PHPCompatibility/PHPCompatibility/issues/49). -- :star2: New `ConstantArraysUsingDefine` sniff to detect constants declared using `define()` being assigned an `array` value which was not allowed prior to PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `DeprecatedPHP4StyleConstructors` sniff to detect PHP 4 style class constructor methods which are deprecated as of PHP 7. [#109](https://github.com/PHPCompatibility/PHPCompatibility/pull/109). -- :star2: New `ForbiddenEmptyListAssignment` sniff to detect empty list() assignments which have been removed in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `ForbiddenFunctionParametersWithSameName` sniff to detect functions declared with multiple same-named parameters which is no longer accepted since PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `ForbiddenGlobalVariableVariable` sniff to detect variable variables being made `global` which is not allowed since PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `ForbiddenNegativeBitshift` sniff to detect bitwise shifts by negative number which will throw an ArithmeticError in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `ForbiddenSwitchWithMultipleDefaultBlocks` sniff to detect switch statements with multiple default blocks which is not allowed since PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `NewAnonymousClasses` sniff to detect anonymous classes as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `NewClosure` sniff to detect anonymous functions as introduced in PHP 5.3. Fixes [#35](https://github.com/PHPCompatibility/PHPCompatibility/issues/35) -- :star2: New `NewFunctionParameters` sniff to detect use of new parameters in build-in PHP functions. Initially only sniffing for the new PHP 7.0 function parameters and the new PHP 5.3+ `before_needle` parameter for the `strstr()` function. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110), [#112](https://github.com/PHPCompatibility/PHPCompatibility/pull/112). Fixes [#27](https://github.com/PHPCompatibility/PHPCompatibility/issues/27). -- :star2: New `NewGroupUseDeclarations` sniff to detect group use declarations as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `NewScalarReturnTypeDeclarations` sniff to detect scalar return type hints as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `NewScalarTypeDeclarations` sniff to detect scalar function parameter type hints as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `RemovedFunctionParameters` sniff to detect use of removed parameters in build-in PHP functions. Initially only sniffing for the function parameters removed in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star2: New `RemovedGlobalVariables` sniff to detect the PHP 7.0 removed `$HTTP_RAW_POST_DATA` superglobal. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star: `DeprecatedFunctions` sniff: detection of the PHP 5.4 deprecated OCI8 functions. [#93](https://github.com/PHPCompatibility/PHPCompatibility/pull/93) -- :star: `ForbiddenNamesAsInvokedFunctions` sniff: recognize PHP 5.5 `finally` as a reserved keywords when invoked as a function. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star: `NewKeywords` sniff: detection of the use of the PHP 5.1+ `__halt_compiler` keyword. Fixes [#50](https://github.com/PHPCompatibility/PHPCompatibility/issues/50). -- :star: `NewKeywords` sniff: detection of the PHP 5.3+ `nowdoc` syntax. Fixes [#48](https://github.com/PHPCompatibility/PHPCompatibility/issues/48). -- :star: `NewKeywords` sniff: detection of the use of the `const` keyword outside of a class for PHP < 5.3. Fixes [#50](https://github.com/PHPCompatibility/PHPCompatibility/issues/50). -- :star: `DeprecatedFunctions` sniff: recognize PHP 7.0 deprecated and removed functions. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star: `DeprecatedIniDirectives` sniff: recognize PHP 7.0 removed ini directives. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star: `ForbiddenNamesAsInvokedFunctions` sniff: recognize new PHP 7.0 reserved keywords when invoked as functions. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star: `ForbiddenNames` sniff: recognize new PHP 7.0 reserved keywords. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star: `NewFunctions` sniff: recognize new functions as introduced in PHP 7.0. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star: `NewLanguageConstructs` sniff: recognize new PHP 7.0 `<=>` "spaceship" and `??` null coalescing operators. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :star: `RemovedExtensions` sniff: recognize PHP 7.0 removed `ereg`, `mssql`, `mysql` and `sybase_ct` extensions. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :umbrella: Additional unit tests for the `NewLanguageConstructs` sniff. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :books: Readme: New section containing information about the use of the `testVersion` config variable. -- :books: Readme: Sponsor credits. - -### Changed -- :pushpin: The `DeprecatedIniDirectives` sniff used to always throw an `warning`. Now it will throw an `error` when a removed ini directive is used. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110). -- :pushpin: The `DeprecatedNewReference` sniff will now throw an error when the `testVersion` includes PHP 7.0 or higher. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :pushpin: The `ForbiddenNames` sniff now supports detection of reserved keywords when used in combination with PHP 7 anonymous classes. [#108](https://github.com/PHPCompatibility/PHPCompatibility/pull/108), [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110). -- :pushpin: The `PregReplaceEModifier` sniff will now throw an error when the `testVersion` includes PHP 7.0 or higher. [#110](https://github.com/PHPCompatibility/PHPCompatibility/pull/110) -- :pencil2: `NewKeywords` sniff: clarified the error message text for the `use` keyword. Fixes [#46](https://github.com/PHPCompatibility/PHPCompatibility/issues/46). -- :recycle: Minor refactor of the `testVersion` related utility functions. [#98](https://github.com/PHPCompatibility/PHPCompatibility/pull/98) -- :wrench: Add autoload to the `composer.json` file. [#96](https://github.com/PHPCompatibility/PHPCompatibility/pull/96) Fixes [#67](https://github.com/PHPCompatibility/PHPCompatibility/issues/67). -- :wrench: Minor other updates to the `composer.json` file. [#75](https://github.com/PHPCompatibility/PHPCompatibility/pull/75) -- :wrench: Improved creation of the code coverage reports needed by coveralls via Travis. -- :green_heart: The sniffs are now also tested against PHP 7.0 for consistent results. - -### Fixed -- :bug: The `ForbiddenCallTimePassByReference` sniff was throwing `Undefined index` notices when used in combination with PHPCS 2.2.0. [#100](https://github.com/PHPCompatibility/PHPCompatibility/pull/100). Fixes [#42](https://github.com/PHPCompatibility/PHPCompatibility/issues/42). -- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff would incorrectly throw an error if the `throw` keyword was used with parenthesis. Fixes [#118](https://github.com/PHPCompatibility/PHPCompatibility/issues/118). -- :bug: The `PregReplaceEModifier` sniff incorrectly identified `e`'s in the pattern as the `e` modifier when using `{}` bracket delimiters for the regex. [#94](https://github.com/PHPCompatibility/PHPCompatibility/pull/94) -- :bug: The `RemovedExtensions` sniff was throwing an `error` instead of a `warning` for deprecated, but not (yet) removed extensions. Fixes [#62](https://github.com/PHPCompatibility/PHPCompatibility/issues/62). - -### Credits -Thanks go out to AlexMiroshnikov, [Chris Abernethy], [dgudgeon], [djaenecke], [Eugene Maslovich], [Ken Guest], Koen Eelen, [Komarov Alexey], [Mark Clements] and [Remko van Bezooijen] for their contributions to this version. :clap: - - -## [5.6] - 2015-09-14 - -See all related issues and PRs in the [5.6 milestone]. - -### Added -- :star2: New: `NewLanguageConstructs` sniff. The initial version of this sniff checks for the PHP 5.6 `**` power operator and the `**=` power assignment operator. [#87](https://github.com/PHPCompatibility/PHPCompatibility/pull/87). Fixes [#60](https://github.com/PHPCompatibility/PHPCompatibility/issues/60). -- :star2: New: `ParameterShadowSuperGlobals` sniff which covers the PHP 5.4 change _Parameter names that shadow super globals now cause a fatal error.`_. [#74](https://github.com/PHPCompatibility/PHPCompatibility/pull/74) -- :star2: New: `PregReplaceEModifier` sniff which detects usage of the `e` modifier in literal regular expressions used with `preg_replace()`. The `e` modifier will not (yet) be detected when the regex passed is a variable or constant. [#81](https://github.com/PHPCompatibility/PHPCompatibility/pull/81), [#84](https://github.com/PHPCompatibility/PHPCompatibility/pull/84). Fixes [#71](https://github.com/PHPCompatibility/PHPCompatibility/issues/71), [#83](https://github.com/PHPCompatibility/PHPCompatibility/issues/83). -- :star: `DeprecatedIniDirectives` sniff: PHP 5.6 deprecated ini directives. -- :star: `NewKeywords` sniff: detection of the `goto` keyword introduced in PHP 5.3 and the `callable` keyword introduced in PHP 5.4. [#57](https://github.com/PHPCompatibility/PHPCompatibility/pull/57) -- :recycle: `PHPCompatibility_Sniff` base class initially containing the `supportsAbove()` and `supportsBelow()` utility methods. (Nearly) All sniffs now extend this base class and use these methods to determine whether or not violations should be reported for a set `testVersion`. [#77](https://github.com/PHPCompatibility/PHPCompatibility/pull/77) -- :books: Readme: Composer installation instructions. [#32](https://github.com/PHPCompatibility/PHPCompatibility/pull/32), [#61](https://github.com/PHPCompatibility/PHPCompatibility/pull/61) -- :wrench: `.gitignore` to ignore vendor and IDE related directories. [#78](https://github.com/PHPCompatibility/PHPCompatibility/pull/78) -- :green_heart: Code coverage checking via coveralls. - -### Changed -- :twisted_rightwards_arrows: The check for the `\` namespace separator has been moved from the `NewKeywords` sniff to the `NewLanguageConstructs` sniff. [#88](https://github.com/PHPCompatibility/PHPCompatibility/pull/88) -- :pencil2: `DeprecatedIniDirectives` sniff: minor change in the sniff error message text. -- :pencil2: `DeprecatedFunctions` sniff: minor change in the sniff error message text. -- :wrench: Minor updates to the `composer.json` file. [#31](https://github.com/PHPCompatibility/PHPCompatibility/pull/31), [34](https://github.com/PHPCompatibility/PHPCompatibility/pull/34), [#70](https://github.com/PHPCompatibility/PHPCompatibility/pull/70) -- :wrench: Tests: The unit tests can now be run without configuration. -- :wrench: Tests: Skipped unit tests will now be annotated as such. [#85](https://github.com/PHPCompatibility/PHPCompatibility/pull/85) -- :green_heart: The sniffs are now also tested against PHP 5.6 for consistent results. -- :green_heart: The sniffs are now also tested against PHPCS 2.0+. -- :green_heart: The sniffs are now tested using the new container-based infrastructure in Travis CI. [#37](https://github.com/PHPCompatibility/PHPCompatibility/pull/37) - -### Fixed -- :bug: The `ForbiddenCallTimePassByReference` sniff was throwing false positives when a bitwise and `&` was used in combination with class constants and class properties within function calls. [#44](https://github.com/PHPCompatibility/PHPCompatibility/pull/44). Fixes [#39](https://github.com/PHPCompatibility/PHPCompatibility/issues/39). -- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff was throwing false positives in certain cases when a comment separated a `try` from the `catch` block. [#29](https://github.com/PHPCompatibility/PHPCompatibility/pull/29) -- :bug: The `ForbiddenNamesAsInvokedFunctions` sniff was incorrectly reporting `instanceof` as being introduced in PHP 5.4 while it has been around since PHP 5.0. [#80](https://github.com/PHPCompatibility/PHPCompatibility/pull/80) -- :white_check_mark: Compatibility with PHPCS 2.0 - 2.3. [#63](https://github.com/PHPCompatibility/PHPCompatibility/pull/63), [#65](https://github.com/PHPCompatibility/PHPCompatibility/pull/65) - -### Credits -Thanks go out to Daniel Jänecke, [Declan Kelly], [Dominic], [Jaap van Otterdijk], [Marin Crnkovic], [Mark Clements], [Nick Pack], [Oliver Klee], [Rowan Collins] and [Sam Van der Borght] for their contributions to this version. :clap: - - -## 5.5 - 2014-04-04 - -First tagged release. - -See all related issues and PRs in the [5.5 milestone]. - - - -[Unreleased]: https://github.com/PHPCompatibility/PHPCompatibility/compare/master...HEAD -[9.3.5]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.4...9.3.5 -[9.3.4]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.3...9.3.4 -[9.3.3]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.2...9.3.3 -[9.3.2]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.1...9.3.2 -[9.3.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.3.0...9.3.1 -[9.3.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.2.0...9.3.0 -[9.2.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.1.1...9.2.0 -[9.1.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.1.0...9.1.1 -[9.1.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/9.0.0...9.1.0 -[9.0.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/8.2.0...9.0.0 -[8.2.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/8.1.0...8.2.0 -[8.1.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/8.0.1...8.1.0 -[8.0.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/8.0.0...8.0.1 -[8.0.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.5...8.0.0 -[7.1.5]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.4...7.1.5 -[7.1.4]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.3...7.1.4 -[7.1.3]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.2...7.1.3 -[7.1.2]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.1...7.1.2 -[7.1.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.1.0...7.1.1 -[7.1.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.8...7.1.0 -[7.0.8]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.7...7.0.8 -[7.0.7]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.6...7.0.7 -[7.0.6]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.5...7.0.6 -[7.0.5]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.4...7.0.5 -[7.0.4]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.3...7.0.4 -[7.0.3]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.2...7.0.3 -[7.0.2]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0.1...7.0.2 -[7.0.1]: https://github.com/PHPCompatibility/PHPCompatibility/compare/7.0...7.0.1 -[7.0]: https://github.com/PHPCompatibility/PHPCompatibility/compare/5.6...7.0 -[5.6]: https://github.com/PHPCompatibility/PHPCompatibility/compare/5.5...5.6 - -[9.3.5 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/34 -[9.3.4 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/33 -[9.3.3 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/32 -[9.3.2 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/31 -[9.3.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/30 -[9.3.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/29 -[9.2.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/28 -[9.1.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/27 -[9.1.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/25 -[9.0.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/24 -[8.2.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/22 -[8.1.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/21 -[8.0.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/20 -[8.0.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/19 -[7.1.5 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/17 -[7.1.4 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/15 -[7.1.3 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/14 -[7.1.2 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/13 -[7.1.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/12 -[7.1.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/11 -[7.0.8 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/10 -[7.0.7 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/9 -[7.0.6 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/8 -[7.0.5 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/7 -[7.0.4 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/6 -[7.0.3 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/5 -[7.0.2 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/4 -[7.0.1 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/3 -[7.0 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/2 -[5.6 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/1 -[5.5 milestone]: https://github.com/PHPCompatibility/PHPCompatibility/milestone/16 - -[Arthur Edamov]: https://github.com/edamov -[Chris Abernethy]: https://github.com/cabernet-zerve -[Declan Kelly]: https://github.com/declank -[dgudgeon]: https://github.com/dgudgeon -[djaenecke]: https://github.com/djaenecke -[Dominic]: https://github.com/dol -[Eugene Maslovich]: https://github.com/ehpc -[Gary Jones]: https://github.com/GaryJones -[Jaap van Otterdijk]: https://github.com/jaapio -[Jason Stallings]: https://github.com/octalmage -[Jonathan Champ]: https://github.com/jrchamp -[Jonathan Van Belle]: https://github.com/Grummfy -[Juliette Reinders Folmer]: https://github.com/jrfnl -[Ken Guest]: https://github.com/kenguest -[Komarov Alexey]: https://github.com/erdraug -[Marin Crnkovic]: https://github.com/anorgan -[Mark Clements]: https://github.com/MarkMaldaba -[Michael Babker]: https://github.com/mbabker -[Nick Pack]: https://github.com/nickpack -[Nikhil]: https://github.com/Nikschavan -[Oliver Klee]: https://github.com/oliverklee -[Remko van Bezooijen]: https://github.com/emkookmer -[Rowan Collins]: https://github.com/IMSoP -[Ryan Neufeld]: https://github.com/ryanneufeld -[Sam Van der Borght]: https://github.com/samvdb -[Sergii Bondarenko]: https://github.com/BR0kEN- -[Tadas Juozapaitis]: https://github.com/kasp3r -[Tim Millwood]: https://github.com/timmillwood -[William Entriken]: https://github.com/fulldecent -[Yılmaz]: https://github.com/edigu -[Yoshiaki Yoshida]: https://github.com/kakakakakku diff --git a/trunk/vendor/phpcompatibility/php-compatibility/LICENSE b/trunk/vendor/phpcompatibility/php-compatibility/LICENSE deleted file mode 100644 index 65c5ca88..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php deleted file mode 100644 index 97591a3f..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php +++ /dev/null @@ -1,73 +0,0 @@ -` ruleset directive. - * - * {@internal The PHPCS file have been reorganized in PHPCS 3.x, quite - * a few "old" classes have been split and spread out over several "new" - * classes. In other words, this will only work for a limited number - * of classes.} - * - * {@internal The `class_exists` wrappers are needed to play nice with other - * external PHPCS standards creating cross-version compatibility in the same - * manner.} - */ -if (defined('PHPCOMPATIBILITY_PHPCS_ALIASES_SET') === false) { - if (interface_exists('\PHP_CodeSniffer_Sniff') === false) { - class_alias('PHP_CodeSniffer\Sniffs\Sniff', '\PHP_CodeSniffer_Sniff'); - } - if (class_exists('\PHP_CodeSniffer_File') === false) { - class_alias('PHP_CodeSniffer\Files\File', '\PHP_CodeSniffer_File'); - } - if (class_exists('\PHP_CodeSniffer_Tokens') === false) { - class_alias('PHP_CodeSniffer\Util\Tokens', '\PHP_CodeSniffer_Tokens'); - } - if (class_exists('\PHP_CodeSniffer_Exception') === false) { - class_alias('PHP_CodeSniffer\Exceptions\RuntimeException', '\PHP_CodeSniffer_Exception'); - } - if (class_exists('\PHP_CodeSniffer_Standards_AbstractScopeSniff') === false) { - class_alias('PHP_CodeSniffer\Sniffs\AbstractScopeSniff', '\PHP_CodeSniffer_Standards_AbstractScopeSniff'); - } - if (class_exists('\Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff') === false) { - class_alias('PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff', '\Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff'); - } - - define('PHPCOMPATIBILITY_PHPCS_ALIASES_SET', true); - - /* - * Register an autoloader. - * - * {@internal When `installed_paths` is set via the ruleset, this autoloader - * is needed to run the sniffs. - * Upstream issue: {@link https://github.com/squizlabs/PHP_CodeSniffer/issues/1591} } - * - * @since 8.0.0 - */ - spl_autoload_register(function ($class) { - // Only try & load our own classes. - if (stripos($class, 'PHPCompatibility') !== 0) { - return; - } - - $file = realpath(__DIR__) . DIRECTORY_SEPARATOR . strtr($class, '\\', DIRECTORY_SEPARATOR) . '.php'; - - if (file_exists($file)) { - include_once $file; - } - }); -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractComplexVersionSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractComplexVersionSniff.php deleted file mode 100644 index 95245b6a..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractComplexVersionSniff.php +++ /dev/null @@ -1,147 +0,0 @@ -getItemArray($itemInfo); - $errorInfo = $this->getErrorInfo($itemArray, $itemInfo); - - if ($this->shouldThrowError($errorInfo) === true) { - $this->addError($phpcsFile, $stackPtr, $itemInfo, $errorInfo); - } - } - - - /** - * Determine whether an error/warning should be thrown for an item based on collected information. - * - * @since 7.1.0 - * - * @param array $errorInfo Detail information about an item. - * - * @return bool - */ - abstract protected function shouldThrowError(array $errorInfo); - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array(); - } - - - /** - * Retrieve a subset of an item array containing only the array keys which - * contain PHP version information. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about an item. - * - * @return array Array with only the version information. - */ - protected function getVersionArray(array $itemArray) - { - return array_diff_key($itemArray, array_flip($this->getNonVersionArrayKeys())); - } - - - /** - * Get the item name to be used for the creation of the error code and in the error message. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * @param array $errorInfo Detail information about an item. - * - * @return string - */ - protected function getItemName(array $itemInfo, array $errorInfo) - { - return $itemInfo['name']; - } - - - /** - * Get the error message template for a specific sniff. - * - * @since 7.1.0 - * - * @return string - */ - abstract protected function getErrorMsgTemplate(); - - - /** - * Allow for concrete child classes to filter the error message before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param string $error The error message which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return string - */ - protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) - { - return $error; - } - - - /** - * Allow for concrete child classes to filter the error data before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param array $data The error data array which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return array - */ - protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) - { - return $data; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php deleted file mode 100644 index 6db8cd08..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractFunctionCallParameterSniff.php +++ /dev/null @@ -1,193 +0,0 @@ - true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_NEW => true, - \T_CONST => true, - \T_USE => true, - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.2.0 - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of function names. - $this->targetFunctions = $this->arrayKeysToLowercase($this->targetFunctions); - - return array(\T_STRING); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->bowOutEarly() === true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $function = $tokens[$stackPtr]['content']; - $functionLc = strtolower($function); - - if (isset($this->targetFunctions[$functionLc]) === false) { - return; - } - - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - if ($this->isMethod === true) { - if ($tokens[$prevNonEmpty]['code'] !== \T_DOUBLE_COLON - && $tokens[$prevNonEmpty]['code'] !== \T_OBJECT_OPERATOR - ) { - // Not a call to a PHP method. - return; - } - } else { - if (isset($this->ignoreTokens[$tokens[$prevNonEmpty]['code']]) === true) { - // Not a call to a PHP function. - return; - } - - if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR - && $tokens[$prevNonEmpty - 1]['code'] === \T_STRING - ) { - // Namespaced function. - return; - } - } - - $parameters = $this->getFunctionCallParameters($phpcsFile, $stackPtr); - - if (empty($parameters)) { - return $this->processNoParameters($phpcsFile, $stackPtr, $function); - } else { - return $this->processParameters($phpcsFile, $stackPtr, $function, $parameters); - } - } - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 8.2.0 - * - * If the check done in a child class is not specific to one PHP version, - * this function should return `false`. - * - * @return bool - */ - abstract protected function bowOutEarly(); - - - /** - * Process the parameters of a matched function. - * - * This method has to be made concrete in child classes. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - abstract public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters); - - - /** - * Process the function if no parameters were found. - * - * Defaults to doing nothing. Can be overloaded in child classes to handle functions - * were parameters are expected, but none found. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processNoParameters(File $phpcsFile, $stackPtr, $functionName) - { - return; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractNewFeatureSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractNewFeatureSniff.php deleted file mode 100644 index 25406fda..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractNewFeatureSniff.php +++ /dev/null @@ -1,115 +0,0 @@ - '', - 'error' => true, - ); - - $versionArray = $this->getVersionArray($itemArray); - - if (empty($versionArray) === false) { - foreach ($versionArray as $version => $present) { - if ($errorInfo['not_in_version'] === '' && $present === false - && $this->supportsBelow($version) === true - ) { - $errorInfo['not_in_version'] = $version; - } - } - } - - return $errorInfo; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return '%s is not present in PHP version %s or earlier'; - } - - - /** - * Generates the error or warning for this item. - * - * @since 7.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the relevant token in - * the stack. - * @param array $itemInfo Base information about the item. - * @param array $errorInfo Array with detail (version) information - * relevant to the item. - * - * @return void - */ - public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) - { - $itemName = $this->getItemName($itemInfo, $errorInfo); - $error = $this->getErrorMsgTemplate(); - - $errorCode = $this->stringToErrorCode($itemName) . 'Found'; - $data = array( - $itemName, - $errorInfo['not_in_version'], - ); - - $error = $this->filterErrorMsg($error, $itemInfo, $errorInfo); - $data = $this->filterErrorData($data, $itemInfo, $errorInfo); - - $this->addMessage($phpcsFile, $error, $stackPtr, $errorInfo['error'], $errorCode, $data); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractRemovedFeatureSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractRemovedFeatureSniff.php deleted file mode 100644 index 94103922..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/AbstractRemovedFeatureSniff.php +++ /dev/null @@ -1,156 +0,0 @@ - '', - 'removed' => '', - 'alternative' => '', - 'error' => false, - ); - - $versionArray = $this->getVersionArray($itemArray); - - if (empty($versionArray) === false) { - foreach ($versionArray as $version => $removed) { - if ($this->supportsAbove($version) === true) { - if ($removed === true && $errorInfo['removed'] === '') { - $errorInfo['removed'] = $version; - $errorInfo['error'] = true; - } elseif ($errorInfo['deprecated'] === '') { - $errorInfo['deprecated'] = $version; - } - } - } - } - - if (isset($itemArray['alternative']) === true) { - $errorInfo['alternative'] = $itemArray['alternative']; - } - - return $errorInfo; - } - - - /** - * Get the error message template for suggesting an alternative for a specific sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getAlternativeOptionTemplate() - { - return '; Use %s instead'; - } - - - /** - * Generates the error or warning for this item. - * - * @since 7.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the relevant token in - * the stack. - * @param array $itemInfo Base information about the item. - * @param array $errorInfo Array with detail (version) information - * relevant to the item. - * - * @return void - */ - public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) - { - $itemName = $this->getItemName($itemInfo, $errorInfo); - $error = $this->getErrorMsgTemplate(); - - $errorCode = $this->stringToErrorCode($itemName); - $data = array($itemName); - - if ($errorInfo['deprecated'] !== '') { - $error .= 'deprecated since PHP %s and '; - $errorCode .= 'Deprecated'; - $data[] = $errorInfo['deprecated']; - } - - if ($errorInfo['removed'] !== '') { - $error .= 'removed since PHP %s and '; - $errorCode .= 'Removed'; - $data[] = $errorInfo['removed']; - } - - // Remove the last 'and' from the message. - $error = substr($error, 0, (\strlen($error) - 5)); - - if ($errorInfo['alternative'] !== '') { - $error .= $this->getAlternativeOptionTemplate(); - $data[] = $errorInfo['alternative']; - } - - $error = $this->filterErrorMsg($error, $itemInfo, $errorInfo); - $data = $this->filterErrorData($data, $itemInfo, $errorInfo); - - $this->addMessage($phpcsFile, $error, $stackPtr, $errorInfo['error'], $errorCode, $data); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ComplexVersionInterface.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ComplexVersionInterface.php deleted file mode 100644 index f5f63bbf..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ComplexVersionInterface.php +++ /dev/null @@ -1,84 +0,0 @@ -config; - if (isset($config->{$key})) { - return $config->{$key}; - } - } else { - // PHPCS 2.x. - $config = $phpcsFile->phpcs->cli->getCommandLineValues(); - if (isset($config[$key])) { - return $config[$key]; - } - } - - return null; - } - - - /** - * Returns the position of the first non-whitespace token in a statement. - * - * {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` - * class and introduced in PHPCS 2.1.0 and improved in PHPCS 2.7.1. - * - * Once the minimum supported PHPCS version for this standard goes beyond - * that, this method can be removed and calls to it replaced with - * `$phpcsFile->findStartOfStatement($start, $ignore)` calls. - * - * Last synced with PHPCS version: PHPCS 3.3.2 at commit 6ad28354c04b364c3c71a34e4a18b629cc3b231e} - * - * @since 9.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int $start The position to start searching from in the token stack. - * @param int|array $ignore Token types that should not be considered stop points. - * - * @return int - */ - public static function findStartOfStatement(File $phpcsFile, $start, $ignore = null) - { - if (version_compare(self::getVersion(), '2.7.1', '>=') === true) { - return $phpcsFile->findStartOfStatement($start, $ignore); - } - - $tokens = $phpcsFile->getTokens(); - $endTokens = Tokens::$blockOpeners; - - $endTokens[\T_COLON] = true; - $endTokens[\T_COMMA] = true; - $endTokens[\T_DOUBLE_ARROW] = true; - $endTokens[\T_SEMICOLON] = true; - $endTokens[\T_OPEN_TAG] = true; - $endTokens[\T_CLOSE_TAG] = true; - $endTokens[\T_OPEN_SHORT_ARRAY] = true; - - if ($ignore !== null) { - $ignore = (array) $ignore; - foreach ($ignore as $code) { - if (isset($endTokens[$code]) === true) { - unset($endTokens[$code]); - } - } - } - - $lastNotEmpty = $start; - - for ($i = $start; $i >= 0; $i--) { - if (isset($endTokens[$tokens[$i]['code']]) === true) { - // Found the end of the previous statement. - return $lastNotEmpty; - } - - if (isset($tokens[$i]['scope_opener']) === true - && $i === $tokens[$i]['scope_closer'] - ) { - // Found the end of the previous scope block. - return $lastNotEmpty; - } - - // Skip nested statements. - if (isset($tokens[$i]['bracket_opener']) === true - && $i === $tokens[$i]['bracket_closer'] - ) { - $i = $tokens[$i]['bracket_opener']; - } elseif (isset($tokens[$i]['parenthesis_opener']) === true - && $i === $tokens[$i]['parenthesis_closer'] - ) { - $i = $tokens[$i]['parenthesis_opener']; - } - - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { - $lastNotEmpty = $i; - } - }//end for - - return 0; - } - - - /** - * Returns the position of the last non-whitespace token in a statement. - * - * {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` - * class and introduced in PHPCS 2.1.0 and improved in PHPCS 2.7.1 and 3.3.0. - * - * Once the minimum supported PHPCS version for this standard goes beyond - * that, this method can be removed and calls to it replaced with - * `$phpcsFile->findEndOfStatement($start, $ignore)` calls. - * - * Last synced with PHPCS version: PHPCS 3.3.0-alpha at commit f5d899dcb5c534a1c3cca34668624517856ba823} - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int $start The position to start searching from in the token stack. - * @param int|array $ignore Token types that should not be considered stop points. - * - * @return int - */ - public static function findEndOfStatement(File $phpcsFile, $start, $ignore = null) - { - if (version_compare(self::getVersion(), '3.3.0', '>=') === true) { - return $phpcsFile->findEndOfStatement($start, $ignore); - } - - $tokens = $phpcsFile->getTokens(); - $endTokens = array( - \T_COLON => true, - \T_COMMA => true, - \T_DOUBLE_ARROW => true, - \T_SEMICOLON => true, - \T_CLOSE_PARENTHESIS => true, - \T_CLOSE_SQUARE_BRACKET => true, - \T_CLOSE_CURLY_BRACKET => true, - \T_CLOSE_SHORT_ARRAY => true, - \T_OPEN_TAG => true, - \T_CLOSE_TAG => true, - ); - - if ($ignore !== null) { - $ignore = (array) $ignore; - foreach ($ignore as $code) { - if (isset($endTokens[$code]) === true) { - unset($endTokens[$code]); - } - } - } - - $lastNotEmpty = $start; - - for ($i = $start; $i < $phpcsFile->numTokens; $i++) { - if ($i !== $start && isset($endTokens[$tokens[$i]['code']]) === true) { - // Found the end of the statement. - if ($tokens[$i]['code'] === \T_CLOSE_PARENTHESIS - || $tokens[$i]['code'] === \T_CLOSE_SQUARE_BRACKET - || $tokens[$i]['code'] === \T_CLOSE_CURLY_BRACKET - || $tokens[$i]['code'] === \T_CLOSE_SHORT_ARRAY - || $tokens[$i]['code'] === \T_OPEN_TAG - || $tokens[$i]['code'] === \T_CLOSE_TAG - ) { - return $lastNotEmpty; - } - - return $i; - } - - // Skip nested statements. - if (isset($tokens[$i]['scope_closer']) === true - && ($i === $tokens[$i]['scope_opener'] - || $i === $tokens[$i]['scope_condition']) - ) { - if ($i === $start && isset(Tokens::$scopeOpeners[$tokens[$i]['code']]) === true) { - return $tokens[$i]['scope_closer']; - } - - $i = $tokens[$i]['scope_closer']; - } elseif (isset($tokens[$i]['bracket_closer']) === true - && $i === $tokens[$i]['bracket_opener'] - ) { - $i = $tokens[$i]['bracket_closer']; - } elseif (isset($tokens[$i]['parenthesis_closer']) === true - && $i === $tokens[$i]['parenthesis_opener'] - ) { - $i = $tokens[$i]['parenthesis_closer']; - } - - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { - $lastNotEmpty = $i; - } - }//end for - - return ($phpcsFile->numTokens - 1); - } - - - /** - * Returns the name of the class that the specified class extends - * (works for classes, anonymous classes and interfaces). - * - * Returns FALSE on error or if there is no extended class name. - * - * {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` - * class, but with some improvements which have been introduced in - * PHPCS 2.8.0. - * {@link https://github.com/squizlabs/PHP_CodeSniffer/commit/0011d448119d4c568e3ac1f825ae78815bf2cc34}. - * - * Once the minimum supported PHPCS version for this standard goes beyond - * that, this method can be removed and calls to it replaced with - * `$phpcsFile->findExtendedClassName($stackPtr)` calls. - * - * Last synced with PHPCS version: PHPCS 3.1.0-alpha at commit a9efcc9b0703f3f9f4a900623d4e97128a6aafc6} - * - * @since 7.1.4 - * @since 8.2.0 Moved from the `Sniff` class to this class. - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int $stackPtr The position of the class token in the stack. - * - * @return string|false - */ - public static function findExtendedClassName(File $phpcsFile, $stackPtr) - { - if (version_compare(self::getVersion(), '3.1.0', '>=') === true) { - return $phpcsFile->findExtendedClassName($stackPtr); - } - - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - if ($tokens[$stackPtr]['code'] !== \T_CLASS - && $tokens[$stackPtr]['type'] !== 'T_ANON_CLASS' - && $tokens[$stackPtr]['type'] !== 'T_INTERFACE' - ) { - return false; - } - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return false; - } - - $classCloserIndex = $tokens[$stackPtr]['scope_closer']; - $extendsIndex = $phpcsFile->findNext(\T_EXTENDS, $stackPtr, $classCloserIndex); - if ($extendsIndex === false) { - return false; - } - - $find = array( - \T_NS_SEPARATOR, - \T_STRING, - \T_WHITESPACE, - ); - - $end = $phpcsFile->findNext($find, ($extendsIndex + 1), $classCloserIndex, true); - $name = $phpcsFile->getTokensAsString(($extendsIndex + 1), ($end - $extendsIndex - 1)); - $name = trim($name); - - if ($name === '') { - return false; - } - - return $name; - } - - - /** - * Returns the name(s) of the interface(s) that the specified class implements. - * - * Returns FALSE on error or if there are no implemented interface names. - * - * {@internal Duplicate of same method as introduced in PHPCS 2.7. - * This method also includes an improvement we use which was only introduced - * in PHPCS 2.8.0, so only defer to upstream for higher versions. - * Once the minimum supported PHPCS version for this sniff library goes beyond - * that, this method can be removed and calls to it replaced with - * `$phpcsFile->findImplementedInterfaceNames($stackPtr)` calls.} - * - * @since 7.0.3 - * @since 8.2.0 Moved from the `Sniff` class to this class. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the class token. - * - * @return array|false - */ - public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr) - { - if (version_compare(self::getVersion(), '2.7.1', '>') === true) { - return $phpcsFile->findImplementedInterfaceNames($stackPtr); - } - - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - if ($tokens[$stackPtr]['code'] !== \T_CLASS - && $tokens[$stackPtr]['type'] !== 'T_ANON_CLASS' - ) { - return false; - } - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return false; - } - - $classOpenerIndex = $tokens[$stackPtr]['scope_opener']; - $implementsIndex = $phpcsFile->findNext(\T_IMPLEMENTS, $stackPtr, $classOpenerIndex); - if ($implementsIndex === false) { - return false; - } - - $find = array( - \T_NS_SEPARATOR, - \T_STRING, - \T_WHITESPACE, - \T_COMMA, - ); - - $end = $phpcsFile->findNext($find, ($implementsIndex + 1), ($classOpenerIndex + 1), true); - $name = $phpcsFile->getTokensAsString(($implementsIndex + 1), ($end - $implementsIndex - 1)); - $name = trim($name); - - if ($name === '') { - return false; - } else { - $names = explode(',', $name); - $names = array_map('trim', $names); - return $names; - } - } - - - /** - * Returns the method parameters for the specified function token. - * - * Each parameter is in the following format: - * - * - * 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. - * 'pass_by_reference' => boolean, // Is the variable passed by reference? - * 'variable_length' => boolean, // Is the param of variable length through use of `...` ? - * 'type_hint' => string, // The type hint for the variable. - * 'type_hint_token' => integer, // The stack pointer to the type hint - * // or false if there is no type hint. - * 'nullable_type' => boolean, // Is the variable using a nullable type? - * ) - * - * - * Parameters with default values have an additional array index of - * 'default' with the value of the default as a string. - * - * {@internal Duplicate of same method as contained in the `\PHP_CodeSniffer_File` - * class. - * - * Last synced with PHPCS version: PHPCS 3.3.0-alpha at commit 53a28408d345044c0360c2c1b4a2aaebf4a3b8c9} - * - * @since 7.0.3 - * @since 8.2.0 Moved from the `Sniff` class to this class. - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int $stackPtr The position in the stack of the - * function token to acquire the - * parameters for. - * - * @return array|false - * @throws \PHP_CodeSniffer_Exception If the specified $stackPtr is not of - * type T_FUNCTION or T_CLOSURE. - */ - public static function getMethodParameters(File $phpcsFile, $stackPtr) - { - if (version_compare(self::getVersion(), '3.3.0', '>=') === true) { - return $phpcsFile->getMethodParameters($stackPtr); - } - - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - if ($tokens[$stackPtr]['code'] !== \T_FUNCTION - && $tokens[$stackPtr]['code'] !== \T_CLOSURE - ) { - throw new PHPCS_Exception('$stackPtr must be of type T_FUNCTION or T_CLOSURE'); - } - - $opener = $tokens[$stackPtr]['parenthesis_opener']; - $closer = $tokens[$stackPtr]['parenthesis_closer']; - - $vars = array(); - $currVar = null; - $paramStart = ($opener + 1); - $defaultStart = null; - $paramCount = 0; - $passByReference = false; - $variableLength = false; - $typeHint = ''; - $typeHintToken = false; - $nullableType = false; - - for ($i = $paramStart; $i <= $closer; $i++) { - // Check to see if this token has a parenthesis or bracket opener. If it does - // it's likely to be an array which might have arguments in it. This - // could cause problems in our parsing below, so lets just skip to the - // end of it. - if (isset($tokens[$i]['parenthesis_opener']) === true) { - // Don't do this if it's the close parenthesis for the method. - if ($i !== $tokens[$i]['parenthesis_closer']) { - $i = ($tokens[$i]['parenthesis_closer'] + 1); - } - } - - if (isset($tokens[$i]['bracket_opener']) === true) { - // Don't do this if it's the close parenthesis for the method. - if ($i !== $tokens[$i]['bracket_closer']) { - $i = ($tokens[$i]['bracket_closer'] + 1); - } - } - - switch ($tokens[$i]['type']) { - case 'T_BITWISE_AND': - if ($defaultStart === null) { - $passByReference = true; - } - break; - case 'T_VARIABLE': - $currVar = $i; - break; - case 'T_ELLIPSIS': - $variableLength = true; - break; - case 'T_ARRAY_HINT': // Pre-PHPCS 3.3.0. - case 'T_CALLABLE': - if ($typeHintToken === false) { - $typeHintToken = $i; - } - - $typeHint .= $tokens[$i]['content']; - break; - case 'T_SELF': - case 'T_PARENT': - case 'T_STATIC': - // Self and parent are valid, static invalid, but was probably intended as type hint. - if (isset($defaultStart) === false) { - if ($typeHintToken === false) { - $typeHintToken = $i; - } - - $typeHint .= $tokens[$i]['content']; - } - break; - case 'T_STRING': - // This is a string, so it may be a type hint, but it could - // also be a constant used as a default value. - $prevComma = false; - for ($t = $i; $t >= $opener; $t--) { - if ($tokens[$t]['code'] === \T_COMMA) { - $prevComma = $t; - break; - } - } - - if ($prevComma !== false) { - $nextEquals = false; - for ($t = $prevComma; $t < $i; $t++) { - if ($tokens[$t]['code'] === \T_EQUAL) { - $nextEquals = $t; - break; - } - } - - if ($nextEquals !== false) { - break; - } - } - - if ($defaultStart === null) { - if ($typeHintToken === false) { - $typeHintToken = $i; - } - - $typeHint .= $tokens[$i]['content']; - } - break; - case 'T_NS_SEPARATOR': - // Part of a type hint or default value. - if ($defaultStart === null) { - if ($typeHintToken === false) { - $typeHintToken = $i; - } - - $typeHint .= $tokens[$i]['content']; - } - break; - case 'T_NULLABLE': - case 'T_INLINE_THEN': // Pre-PHPCS 2.8.0. - if ($defaultStart === null) { - $nullableType = true; - $typeHint .= $tokens[$i]['content']; - } - break; - case 'T_CLOSE_PARENTHESIS': - case 'T_COMMA': - // If it's null, then there must be no parameters for this - // method. - if ($currVar === null) { - break; - } - - $vars[$paramCount] = array(); - $vars[$paramCount]['token'] = $currVar; - $vars[$paramCount]['name'] = $tokens[$currVar]['content']; - $vars[$paramCount]['content'] = trim($phpcsFile->getTokensAsString($paramStart, ($i - $paramStart))); - - if ($defaultStart !== null) { - $vars[$paramCount]['default'] = trim( - $phpcsFile->getTokensAsString( - $defaultStart, - ($i - $defaultStart) - ) - ); - } - - $vars[$paramCount]['pass_by_reference'] = $passByReference; - $vars[$paramCount]['variable_length'] = $variableLength; - $vars[$paramCount]['type_hint'] = $typeHint; - $vars[$paramCount]['type_hint_token'] = $typeHintToken; - $vars[$paramCount]['nullable_type'] = $nullableType; - - // Reset the vars, as we are about to process the next parameter. - $defaultStart = null; - $paramStart = ($i + 1); - $passByReference = false; - $variableLength = false; - $typeHint = ''; - $typeHintToken = false; - $nullableType = false; - - $paramCount++; - break; - case 'T_EQUAL': - $defaultStart = ($i + 1); - break; - }//end switch - }//end for - - return $vars; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniff.php deleted file mode 100644 index 38fb7092..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniff.php +++ /dev/null @@ -1,2267 +0,0 @@ -prop, self::prop and $var[]. - * - * @since 7.1.2 - * - * @var string - */ - const REGEX_COMPLEX_VARS = '`(?:(\{)?(?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)(?:->\$?(?P>varname)|\[[^\]]+\]|::\$?(?P>varname)|\([^\)]*\))*(?(3)\}|)(?(2)\}|)(?(1)\}|)`'; - - /** - * List of superglobals as an array of strings. - * - * Used by the ForbiddenParameterShadowSuperGlobals and ForbiddenClosureUseVariableNames sniffs. - * - * @since 7.0.0 - * @since 7.1.4 Moved from the `ForbiddenParameterShadowSuperGlobals` sniff to the base `Sniff` class. - * - * @var array - */ - protected $superglobals = array( - '$GLOBALS' => true, - '$_SERVER' => true, - '$_GET' => true, - '$_POST' => true, - '$_FILES' => true, - '$_COOKIE' => true, - '$_SESSION' => true, - '$_REQUEST' => true, - '$_ENV' => true, - ); - - /** - * List of functions using hash algorithm as parameter (always the first parameter). - * - * Used by the new/removed hash algorithm sniffs. - * Key is the function name, value is the 1-based parameter position in the function call. - * - * @since 5.5 - * @since 7.0.7 Moved from the `RemovedHashAlgorithms` sniff to the base `Sniff` class. - * - * @var array - */ - protected $hashAlgoFunctions = array( - 'hash_file' => 1, - 'hash_hmac_file' => 1, - 'hash_hmac' => 1, - 'hash_init' => 1, - 'hash_pbkdf2' => 1, - 'hash' => 1, - ); - - - /** - * List of functions which take an ini directive as parameter (always the first parameter). - * - * Used by the new/removed ini directives sniffs. - * Key is the function name, value is the 1-based parameter position in the function call. - * - * @since 7.1.0 - * - * @var array - */ - protected $iniFunctions = array( - 'ini_get' => 1, - 'ini_set' => 1, - ); - - - /** - * Get the testVersion configuration variable. - * - * The testVersion configuration variable may be in any of the following formats: - * 1) Omitted/empty, in which case no version is specified. This effectively - * disables all the checks for new PHP features provided by this standard. - * 2) A single PHP version number, e.g. "5.4" in which case the standard checks that - * the code will run on that version of PHP (no deprecated features or newer - * features being used). - * 3) A range, e.g. "5.0-5.5", in which case the standard checks the code will run - * on all PHP versions in that range, and that it doesn't use any features that - * were deprecated by the final version in the list, or which were not available - * for the first version in the list. - * We accept ranges where one of the components is missing, e.g. "-5.6" means - * all versions up to PHP 5.6, and "7.0-" means all versions above PHP 7.0. - * PHP version numbers should always be in Major.Minor format. Both "5", "5.3.2" - * would be treated as invalid, and ignored. - * - * @since 7.0.0 - * @since 7.1.3 Now allows for partial ranges such as `5.2-`. - * - * @return array $arrTestVersions will hold 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 \PHP_CodeSniffer_Exception If testVersion is invalid. - */ - private function getTestVersion() - { - static $arrTestVersions = array(); - - $default = array(null, null); - $testVersion = trim(PHPCSHelper::getConfigData('testVersion')); - - if (empty($testVersion) === false && isset($arrTestVersions[$testVersion]) === false) { - - $arrTestVersions[$testVersion] = $default; - - if (preg_match('`^\d+\.\d+$`', $testVersion)) { - $arrTestVersions[$testVersion] = array($testVersion, $testVersion); - return $arrTestVersions[$testVersion]; - } - - if (preg_match('`^(\d+\.\d+)?\s*-\s*(\d+\.\d+)?$`', $testVersion, $matches)) { - if (empty($matches[1]) === false || empty($matches[2]) === false) { - // If no lower-limit is set, we set the min version to 4.0. - // Whilst development focuses on PHP 5 and above, we also accept - // sniffs for PHP 4, so we include that as the minimum. - // (It makes no sense to support PHP 3 as this was effectively a - // different language). - $min = empty($matches[1]) ? '4.0' : $matches[1]; - - // If no upper-limit is set, we set the max version to 99.9. - $max = empty($matches[2]) ? '99.9' : $matches[2]; - - if (version_compare($min, $max, '>')) { - trigger_error( - "Invalid range in testVersion setting: '" . $testVersion . "'", - \E_USER_WARNING - ); - return $default; - } else { - $arrTestVersions[$testVersion] = array($min, $max); - return $arrTestVersions[$testVersion]; - } - } - } - - trigger_error( - "Invalid testVersion setting: '" . $testVersion . "'", - \E_USER_WARNING - ); - return $default; - } - - if (isset($arrTestVersions[$testVersion])) { - return $arrTestVersions[$testVersion]; - } - - return $default; - } - - - /** - * Check whether a specific PHP version is equal to or higher than the maximum - * supported PHP version as provided by the user in `testVersion`. - * - * Should be used when sniffing for *old* PHP features (deprecated/removed). - * - * @since 5.6 - * - * @param string $phpVersion A PHP version number in 'major.minor' format. - * - * @return bool True if testVersion has not been provided or if the PHP version - * is equal to or higher than the highest supported PHP version - * in testVersion. False otherwise. - */ - public function supportsAbove($phpVersion) - { - $testVersion = $this->getTestVersion(); - $testVersion = $testVersion[1]; - - if (\is_null($testVersion) - || version_compare($testVersion, $phpVersion) >= 0 - ) { - return true; - } else { - return false; - } - } - - - /** - * Check whether a specific PHP version is equal to or lower than the minimum - * supported PHP version as provided by the user in `testVersion`. - * - * Should be used when sniffing for *new* PHP features. - * - * @since 5.6 - * - * @param string $phpVersion A PHP version number in 'major.minor' format. - * - * @return bool True if the PHP version is equal to or lower than the lowest - * supported PHP version in testVersion. - * False otherwise or if no testVersion is provided. - */ - public function supportsBelow($phpVersion) - { - $testVersion = $this->getTestVersion(); - $testVersion = $testVersion[0]; - - if (\is_null($testVersion) === false - && version_compare($testVersion, $phpVersion) <= 0 - ) { - return true; - } else { - return false; - } - } - - - /** - * Add a PHPCS message to the output stack as either a warning or an error. - * - * @since 7.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file the message applies to. - * @param string $message The message. - * @param int $stackPtr The position of the token - * the message relates to. - * @param bool $isError Whether to report the message as an - * 'error' or 'warning'. - * 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. - * - * @return void - */ - public function addMessage(File $phpcsFile, $message, $stackPtr, $isError, $code = 'Found', $data = array()) - { - if ($isError === true) { - $phpcsFile->addError($message, $stackPtr, $code, $data); - } else { - $phpcsFile->addWarning($message, $stackPtr, $code, $data); - } - } - - - /** - * Convert an arbitrary string to an alphanumeric string with underscores. - * - * Pre-empt issues with arbitrary strings being used as error codes in XML and PHP. - * - * @since 7.1.0 - * - * @param string $baseString Arbitrary string. - * - * @return string - */ - public function stringToErrorCode($baseString) - { - return preg_replace('`[^a-z0-9_]`i', '_', strtolower($baseString)); - } - - - /** - * Strip quotes surrounding an arbitrary string. - * - * Intended for use with the contents of a T_CONSTANT_ENCAPSED_STRING / T_DOUBLE_QUOTED_STRING. - * - * @since 7.0.6 - * - * @param string $string The raw string. - * - * @return string String without quotes around it. - */ - public function stripQuotes($string) - { - return preg_replace('`^([\'"])(.*)\1$`Ds', '$2', $string); - } - - - /** - * Strip variables from an arbitrary double quoted string. - * - * Intended for use with the contents of a T_DOUBLE_QUOTED_STRING. - * - * @since 7.1.2 - * - * @param string $string The raw string. - * - * @return string String without variables in it. - */ - public function stripVariables($string) - { - if (strpos($string, '$') === false) { - return $string; - } - - return preg_replace(self::REGEX_COMPLEX_VARS, '', $string); - } - - - /** - * Make all top level array keys in an array lowercase. - * - * @since 7.1.0 - * - * @param array $array Initial array. - * - * @return array Same array, but with all lowercase top level keys. - */ - public function arrayKeysToLowercase($array) - { - return array_change_key_case($array, \CASE_LOWER); - } - - - /** - * Checks if a function call has parameters. - * - * Expects to be passed the T_STRING or T_VARIABLE stack pointer for the function call. - * If passed a T_STRING which is *not* a function call, the behaviour is unreliable. - * - * Extra feature: If passed an T_ARRAY or T_OPEN_SHORT_ARRAY stack pointer, it - * will detect whether the array has values or is empty. - * - * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/120 - * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/152 - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the function call token. - * - * @return bool - */ - public function doesFunctionCallHaveParameters(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - // Is this one of the tokens this function handles ? - if (\in_array($tokens[$stackPtr]['code'], array(\T_STRING, \T_ARRAY, \T_OPEN_SHORT_ARRAY, \T_VARIABLE), true) === false) { - return false; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); - - // Deal with short array syntax. - if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - return false; - } - - if ($nextNonEmpty === $tokens[$stackPtr]['bracket_closer']) { - // No parameters. - return false; - } else { - return true; - } - } - - // Deal with function calls & long arrays. - // Next non-empty token should be the open parenthesis. - if ($nextNonEmpty === false && $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { - return false; - } - - if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) { - return false; - } - - $closeParenthesis = $tokens[$nextNonEmpty]['parenthesis_closer']; - $nextNextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $nextNonEmpty + 1, $closeParenthesis + 1, true); - - if ($nextNextNonEmpty === $closeParenthesis) { - // No parameters. - return false; - } - - return true; - } - - - /** - * Count the number of parameters a function call has been passed. - * - * Expects to be passed the T_STRING or T_VARIABLE stack pointer for the function call. - * If passed a T_STRING which is *not* a function call, the behaviour is unreliable. - * - * Extra feature: If passed an T_ARRAY or T_OPEN_SHORT_ARRAY stack pointer, - * it will return the number of values in the array. - * - * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/111 - * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/114 - * @link https://github.com/PHPCompatibility/PHPCompatibility/issues/151 - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the function call token. - * - * @return int - */ - public function getFunctionCallParameterCount(File $phpcsFile, $stackPtr) - { - if ($this->doesFunctionCallHaveParameters($phpcsFile, $stackPtr) === false) { - return 0; - } - - return \count($this->getFunctionCallParameters($phpcsFile, $stackPtr)); - } - - - /** - * Get information on all parameters passed to a function call. - * - * Expects to be passed the T_STRING or T_VARIABLE stack pointer for the function call. - * If passed a T_STRING which is *not* a function call, the behaviour is unreliable. - * - * Will return an multi-dimentional array with the start token pointer, end token - * pointer and raw parameter value for all parameters. Index will be 1-based. - * If no parameters are found, will return an empty array. - * - * Extra feature: If passed an T_ARRAY or T_OPEN_SHORT_ARRAY stack pointer, - * it will tokenize the values / key/value pairs contained in the array call. - * - * @since 7.0.5 Split off from the `getFunctionCallParameterCount()` method. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the function call token. - * - * @return array - */ - public function getFunctionCallParameters(File $phpcsFile, $stackPtr) - { - if ($this->doesFunctionCallHaveParameters($phpcsFile, $stackPtr) === false) { - return array(); - } - - // Ok, we know we have a T_STRING, T_VARIABLE, T_ARRAY or T_OPEN_SHORT_ARRAY with parameters - // and valid open & close brackets/parenthesis. - $tokens = $phpcsFile->getTokens(); - - // Mark the beginning and end tokens. - if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { - $opener = $stackPtr; - $closer = $tokens[$stackPtr]['bracket_closer']; - - $nestedParenthesisCount = 0; - - } else { - $opener = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); - $closer = $tokens[$opener]['parenthesis_closer']; - - $nestedParenthesisCount = 1; - } - - // Which nesting level is the one we are interested in ? - if (isset($tokens[$opener]['nested_parenthesis'])) { - $nestedParenthesisCount += \count($tokens[$opener]['nested_parenthesis']); - } - - $parameters = array(); - $nextComma = $opener; - $paramStart = $opener + 1; - $cnt = 1; - while (($nextComma = $phpcsFile->findNext(array(\T_COMMA, $tokens[$closer]['code'], \T_OPEN_SHORT_ARRAY, \T_CLOSURE), $nextComma + 1, $closer + 1)) !== false) { - // Ignore anything within short array definition brackets. - if ($tokens[$nextComma]['type'] === 'T_OPEN_SHORT_ARRAY' - && (isset($tokens[$nextComma]['bracket_opener']) - && $tokens[$nextComma]['bracket_opener'] === $nextComma) - && isset($tokens[$nextComma]['bracket_closer']) - ) { - // Skip forward to the end of the short array definition. - $nextComma = $tokens[$nextComma]['bracket_closer']; - continue; - } - - // Skip past closures passed as function parameters. - if ($tokens[$nextComma]['type'] === 'T_CLOSURE' - && (isset($tokens[$nextComma]['scope_condition']) - && $tokens[$nextComma]['scope_condition'] === $nextComma) - && isset($tokens[$nextComma]['scope_closer']) - ) { - // Skip forward to the end of the closure declaration. - $nextComma = $tokens[$nextComma]['scope_closer']; - continue; - } - - // Ignore comma's at a lower nesting level. - if ($tokens[$nextComma]['type'] === 'T_COMMA' - && isset($tokens[$nextComma]['nested_parenthesis']) - && \count($tokens[$nextComma]['nested_parenthesis']) !== $nestedParenthesisCount - ) { - continue; - } - - // Ignore closing parenthesis/bracket if not 'ours'. - if ($tokens[$nextComma]['type'] === $tokens[$closer]['type'] && $nextComma !== $closer) { - continue; - } - - // Ok, we've reached the end of the parameter. - $parameters[$cnt]['start'] = $paramStart; - $parameters[$cnt]['end'] = $nextComma - 1; - $parameters[$cnt]['raw'] = trim($phpcsFile->getTokensAsString($paramStart, ($nextComma - $paramStart))); - - /* - * Check if there are more tokens before the closing parenthesis. - * Prevents code like the following from setting a third parameter: - * `functionCall( $param1, $param2, );`. - */ - $hasNextParam = $phpcsFile->findNext(Tokens::$emptyTokens, $nextComma + 1, $closer, true, null, true); - if ($hasNextParam === false) { - break; - } - - // Prepare for the next parameter. - $paramStart = $nextComma + 1; - $cnt++; - } - - return $parameters; - } - - - /** - * Get information on a specific parameter passed to a function call. - * - * Expects to be passed the T_STRING or T_VARIABLE stack pointer for the function call. - * If passed a T_STRING which is *not* a function call, the behaviour is unreliable. - * - * Will return a array with the start token pointer, end token pointer and the raw value - * of the parameter at a specific offset. - * If the specified parameter is not found, will return false. - * - * @since 7.0.5 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the function call token. - * @param int $paramOffset The 1-based index position of the parameter to retrieve. - * - * @return array|false - */ - public function getFunctionCallParameter(File $phpcsFile, $stackPtr, $paramOffset) - { - $parameters = $this->getFunctionCallParameters($phpcsFile, $stackPtr); - - if (isset($parameters[$paramOffset]) === false) { - return false; - } else { - return $parameters[$paramOffset]; - } - } - - - /** - * Verify whether a token is within a scoped condition. - * - * If the optional $validScopes parameter has been passed, the function - * will check that the token has at least one condition which is of a - * type defined in $validScopes. - * - * @since 7.0.5 Largely split off from the `inClassScope()` method. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token. - * @param array|int $validScopes Optional. Array of valid scopes - * or int value of a valid scope. - * Pass the T_.. constant(s) for the - * desired scope to this parameter. - * - * @return bool Without the optional $scopeTypes: True if within a scope, false otherwise. - * If the $scopeTypes are set: True if *one* of the conditions is a - * valid scope, false otherwise. - */ - public function tokenHasScope(File $phpcsFile, $stackPtr, $validScopes = null) - { - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - // No conditions = no scope. - if (empty($tokens[$stackPtr]['conditions'])) { - return false; - } - - // Ok, there are conditions, do we have to check for specific ones ? - if (isset($validScopes) === false) { - return true; - } - - return $phpcsFile->hasCondition($stackPtr, $validScopes); - } - - - /** - * Verify whether a token is within a class scope. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token. - * @param bool $strict Whether to strictly check for the T_CLASS - * scope or also accept interfaces and traits - * as scope. - * - * @return bool True if within class scope, false otherwise. - */ - public function inClassScope(File $phpcsFile, $stackPtr, $strict = true) - { - $validScopes = array(\T_CLASS); - if (\defined('T_ANON_CLASS') === true) { - $validScopes[] = \T_ANON_CLASS; - } - - if ($strict === false) { - $validScopes[] = \T_INTERFACE; - $validScopes[] = \T_TRAIT; - } - - return $phpcsFile->hasCondition($stackPtr, $validScopes); - } - - - /** - * Returns the fully qualified class name for a new class instantiation. - * - * Returns an empty string if the class name could not be reliably inferred. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of a T_NEW token. - * - * @return string - */ - public function getFQClassNameFromNewToken(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return ''; - } - - if ($tokens[$stackPtr]['code'] !== \T_NEW) { - return ''; - } - - $start = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); - if ($start === false) { - return ''; - } - - // Bow out if the next token is a variable as we don't know where it was defined. - if ($tokens[$start]['code'] === \T_VARIABLE) { - return ''; - } - - // Bow out if the next token is the class keyword. - if ($tokens[$start]['type'] === 'T_ANON_CLASS' || $tokens[$start]['code'] === \T_CLASS) { - return ''; - } - - $find = array( - \T_NS_SEPARATOR, - \T_STRING, - \T_NAMESPACE, - \T_WHITESPACE, - ); - - $end = $phpcsFile->findNext($find, ($start + 1), null, true, null, true); - $className = $phpcsFile->getTokensAsString($start, ($end - $start)); - $className = trim($className); - - return $this->getFQName($phpcsFile, $stackPtr, $className); - } - - - /** - * Returns the fully qualified name of the class that the specified class extends. - * - * Returns an empty string if the class does not extend another class or if - * the class name could not be reliably inferred. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of a T_CLASS token. - * - * @return string - */ - public function getFQExtendedClassName(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return ''; - } - - if ($tokens[$stackPtr]['code'] !== \T_CLASS - && $tokens[$stackPtr]['type'] !== 'T_ANON_CLASS' - && $tokens[$stackPtr]['type'] !== 'T_INTERFACE' - ) { - return ''; - } - - $extends = PHPCSHelper::findExtendedClassName($phpcsFile, $stackPtr); - if (empty($extends) || \is_string($extends) === false) { - return ''; - } - - return $this->getFQName($phpcsFile, $stackPtr, $extends); - } - - - /** - * Returns the class name for the static usage of a class. - * This can be a call to a method, the use of a property or constant. - * - * Returns an empty string if the class name could not be reliably inferred. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of a T_NEW token. - * - * @return string - */ - public function getFQClassNameFromDoubleColonToken(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return ''; - } - - if ($tokens[$stackPtr]['code'] !== \T_DOUBLE_COLON) { - return ''; - } - - // Nothing to do if previous token is a variable as we don't know where it was defined. - if ($tokens[$stackPtr - 1]['code'] === \T_VARIABLE) { - return ''; - } - - // Nothing to do if 'parent' or 'static' as we don't know how far the class tree extends. - if (\in_array($tokens[$stackPtr - 1]['code'], array(\T_PARENT, \T_STATIC), true)) { - return ''; - } - - // Get the classname from the class declaration if self is used. - if ($tokens[$stackPtr - 1]['code'] === \T_SELF) { - $classDeclarationPtr = $phpcsFile->findPrevious(\T_CLASS, $stackPtr - 1); - if ($classDeclarationPtr === false) { - return ''; - } - $className = $phpcsFile->getDeclarationName($classDeclarationPtr); - return $this->getFQName($phpcsFile, $classDeclarationPtr, $className); - } - - $find = array( - \T_NS_SEPARATOR, - \T_STRING, - \T_NAMESPACE, - \T_WHITESPACE, - ); - - $start = $phpcsFile->findPrevious($find, $stackPtr - 1, null, true, null, true); - if ($start === false || isset($tokens[($start + 1)]) === false) { - return ''; - } - - $start = ($start + 1); - $className = $phpcsFile->getTokensAsString($start, ($stackPtr - $start)); - $className = trim($className); - - return $this->getFQName($phpcsFile, $stackPtr, $className); - } - - - /** - * Get the Fully Qualified name for a class/function/constant etc. - * - * Checks if a class/function/constant name is already fully qualified and - * if not, enrich it with the relevant namespace information. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token. - * @param string $name The class / function / constant name. - * - * @return string - */ - public function getFQName(File $phpcsFile, $stackPtr, $name) - { - if (strpos($name, '\\') === 0) { - // Already fully qualified. - return $name; - } - - // Remove the namespace keyword if used. - if (strpos($name, 'namespace\\') === 0) { - $name = substr($name, 10); - } - - $namespace = $this->determineNamespace($phpcsFile, $stackPtr); - - if ($namespace === '') { - return '\\' . $name; - } else { - return '\\' . $namespace . '\\' . $name; - } - } - - - /** - * Is the class/function/constant name namespaced or global ? - * - * @since 7.0.3 - * - * @param string $FQName Fully Qualified name of a class, function etc. - * I.e. should always start with a `\`. - * - * @return bool True if namespaced, false if global. - * - * @throws \PHP_CodeSniffer_Exception If the name in the passed parameter - * is not fully qualified. - */ - public function isNamespaced($FQName) - { - if (strpos($FQName, '\\') !== 0) { - throw new PHPCS_Exception('$FQName must be a fully qualified name'); - } - - return (strpos(substr($FQName, 1), '\\') !== false); - } - - - /** - * Determine the namespace name an arbitrary token lives in. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int $stackPtr The token position for which to determine the namespace. - * - * @return string Namespace name or empty string if it couldn't be determined or no namespace applies. - */ - public function determineNamespace(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return ''; - } - - // Check for scoped namespace {}. - if (empty($tokens[$stackPtr]['conditions']) === false) { - $namespacePtr = $phpcsFile->getCondition($stackPtr, \T_NAMESPACE); - if ($namespacePtr !== false) { - $namespace = $this->getDeclaredNamespaceName($phpcsFile, $namespacePtr); - if ($namespace !== false) { - return $namespace; - } - - // We are in a scoped namespace, but couldn't determine the name. Searching for a global namespace is futile. - return ''; - } - } - - /* - * Not in a scoped namespace, so let's see if we can find a non-scoped namespace instead. - * Keeping in mind that: - * - there can be multiple non-scoped namespaces in a file (bad practice, but it happens). - * - the namespace keyword can also be used as part of a function/method call and such. - * - that a non-named namespace resolves to the global namespace. - */ - $previousNSToken = $stackPtr; - $namespace = false; - do { - $previousNSToken = $phpcsFile->findPrevious(\T_NAMESPACE, ($previousNSToken - 1)); - - // Stop if we encounter a scoped namespace declaration as we already know we're not in one. - if (empty($tokens[$previousNSToken]['scope_condition']) === false && $tokens[$previousNSToken]['scope_condition'] === $previousNSToken) { - break; - } - - $namespace = $this->getDeclaredNamespaceName($phpcsFile, $previousNSToken); - - } while ($namespace === false && $previousNSToken !== false); - - // If we still haven't got a namespace, return an empty string. - if ($namespace === false) { - return ''; - } else { - return $namespace; - } - } - - /** - * Get the complete namespace name for a namespace declaration. - * - * For hierarchical namespaces, the name will be composed of several tokens, - * i.e. MyProject\Sub\Level which will be returned together as one string. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int|bool $stackPtr The position of a T_NAMESPACE token. - * - * @return string|false Namespace name or false if not a namespace declaration. - * Namespace name can be an empty string for global namespace declaration. - */ - public function getDeclaredNamespaceName(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if ($stackPtr === false || isset($tokens[$stackPtr]) === false) { - return false; - } - - if ($tokens[$stackPtr]['code'] !== \T_NAMESPACE) { - return false; - } - - if ($tokens[($stackPtr + 1)]['code'] === \T_NS_SEPARATOR) { - // Not a namespace declaration, but use of, i.e. `namespace\someFunction();`. - return false; - } - - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); - if ($tokens[$nextToken]['code'] === \T_OPEN_CURLY_BRACKET) { - /* - * Declaration for global namespace when using multiple namespaces in a file. - * I.e.: `namespace {}`. - */ - return ''; - } - - // Ok, this should be a namespace declaration, so get all the parts together. - $validTokens = array( - \T_STRING => true, - \T_NS_SEPARATOR => true, - \T_WHITESPACE => true, - ); - - $namespaceName = ''; - while (isset($validTokens[$tokens[$nextToken]['code']]) === true) { - $namespaceName .= trim($tokens[$nextToken]['content']); - $nextToken++; - } - - return $namespaceName; - } - - - /** - * Get the stack pointer for a return type token for a given function. - * - * Compatible layer for older PHPCS versions which don't recognize - * return type hints correctly. - * - * Expects to be passed T_RETURN_TYPE, T_FUNCTION or T_CLOSURE token. - * - * @since 7.1.2 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token. - * - * @return int|false Stack pointer to the return type token or false if - * no return type was found or the passed token was - * not of the correct type. - */ - public function getReturnTypeHintToken(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (\defined('T_RETURN_TYPE') && $tokens[$stackPtr]['code'] === \T_RETURN_TYPE) { - return $stackPtr; - } - - if ($tokens[$stackPtr]['code'] !== \T_FUNCTION && $tokens[$stackPtr]['code'] !== \T_CLOSURE) { - return false; - } - - if (isset($tokens[$stackPtr]['parenthesis_closer']) === false) { - return false; - } - - // Allow for interface and abstract method declarations. - $endOfFunctionDeclaration = null; - if (isset($tokens[$stackPtr]['scope_opener'])) { - $endOfFunctionDeclaration = $tokens[$stackPtr]['scope_opener']; - } else { - $nextSemiColon = $phpcsFile->findNext(\T_SEMICOLON, ($tokens[$stackPtr]['parenthesis_closer'] + 1), null, false, null, true); - if ($nextSemiColon !== false) { - $endOfFunctionDeclaration = $nextSemiColon; - } - } - - if (isset($endOfFunctionDeclaration) === false) { - return false; - } - - $hasColon = $phpcsFile->findNext( - array(\T_COLON, \T_INLINE_ELSE), - ($tokens[$stackPtr]['parenthesis_closer'] + 1), - $endOfFunctionDeclaration - ); - if ($hasColon === false) { - return false; - } - - /* - * - `self`, `parent` and `callable` are not being recognized as return types in PHPCS < 2.6.0. - * - Return types are not recognized at all in PHPCS < 2.4.0. - * - The T_RETURN_TYPE token is defined, but no longer in use since PHPCS 3.3.0+. - * The token will now be tokenized as T_STRING. - * - An `array` (return) type declaration was tokenized as `T_ARRAY_HINT` in PHPCS 2.3.3 - 3.2.3 - * to prevent confusing sniffs looking for array declarations. - * As of PHPCS 3.3.0 `array` as a type declaration will be tokenized as `T_STRING`. - */ - $unrecognizedTypes = array( - \T_CALLABLE, - \T_SELF, - \T_PARENT, - \T_ARRAY, // PHPCS < 2.4.0. - \T_STRING, - ); - - return $phpcsFile->findPrevious($unrecognizedTypes, ($endOfFunctionDeclaration - 1), $hasColon); - } - - - /** - * Get the complete return type declaration for a given function. - * - * Cross-version compatible way to retrieve the complete return type declaration. - * - * For a classname-based return type, PHPCS, as well as the Sniff::getReturnTypeHintToken() - * method will mark the classname as the return type token. - * This method will find preceeding namespaces and namespace separators and will return a - * string containing the qualified return type declaration. - * - * Expects to be passed a T_RETURN_TYPE token or the return value from a call to - * the Sniff::getReturnTypeHintToken() method. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the return type token. - * - * @return string The name of the return type token. - */ - public function getReturnTypeHintName(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // In older PHPCS versions, the nullable indicator will turn a return type colon into a T_INLINE_ELSE. - $colon = $phpcsFile->findPrevious(array(\T_COLON, \T_INLINE_ELSE, \T_FUNCTION, \T_CLOSE_PARENTHESIS), ($stackPtr - 1)); - if ($colon === false - || ($tokens[$colon]['code'] !== \T_COLON && $tokens[$colon]['code'] !== \T_INLINE_ELSE) - ) { - // Shouldn't happen, just in case. - return ''; - } - - $returnTypeHint = ''; - for ($i = ($colon + 1); $i <= $stackPtr; $i++) { - // As of PHPCS 3.3.0+, all tokens are tokenized as "normal", so T_CALLABLE, T_SELF etc are - // all possible, just exclude anything that's regarded as empty and the nullable indicator. - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']])) { - continue; - } - - if ($tokens[$i]['type'] === 'T_NULLABLE') { - continue; - } - - if (\defined('T_NULLABLE') === false && $tokens[$i]['code'] === \T_INLINE_THEN) { - // Old PHPCS. - continue; - } - - $returnTypeHint .= $tokens[$i]['content']; - } - - return $returnTypeHint; - } - - - /** - * Check whether a T_VARIABLE token is a class property declaration. - * - * Compatibility layer for PHPCS cross-version compatibility - * as PHPCS 2.4.0 - 2.7.1 does not have good enough support for - * anonymous classes. Along the same lines, the`getMemberProperties()` - * method does not support the `var` prefix. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int $stackPtr The position in the stack of the - * T_VARIABLE token to verify. - * - * @return bool - */ - public function isClassProperty(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_VARIABLE) { - return false; - } - - // Note: interfaces can not declare properties. - $validScopes = array( - 'T_CLASS' => true, - 'T_ANON_CLASS' => true, - 'T_TRAIT' => true, - ); - - $scopePtr = $this->validDirectScope($phpcsFile, $stackPtr, $validScopes); - if ($scopePtr !== false) { - // Make sure it's not a method parameter. - if (empty($tokens[$stackPtr]['nested_parenthesis']) === true) { - return true; - } else { - $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']); - $deepestOpen = array_pop($parenthesis); - if ($deepestOpen < $scopePtr - || isset($tokens[$deepestOpen]['parenthesis_owner']) === false - || $tokens[$tokens[$deepestOpen]['parenthesis_owner']]['code'] !== \T_FUNCTION - ) { - return true; - } - } - } - - return false; - } - - - /** - * Check whether a T_CONST token is a class constant declaration. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int $stackPtr The position in the stack of the - * T_CONST token to verify. - * - * @return bool - */ - public function isClassConstant(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_CONST) { - return false; - } - - // Note: traits can not declare constants. - $validScopes = array( - 'T_CLASS' => true, - 'T_ANON_CLASS' => true, - 'T_INTERFACE' => true, - ); - if ($this->validDirectScope($phpcsFile, $stackPtr, $validScopes) !== false) { - return true; - } - - return false; - } - - - /** - * Check whether the direct wrapping scope of a token is within a limited set of - * acceptable tokens. - * - * Used to check, for instance, if a T_CONST is a class constant. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int $stackPtr The position in the stack of the - * token to verify. - * @param array $validScopes Array of token types. - * Keys should be the token types in string - * format to allow for newer token types. - * Value is irrelevant. - * - * @return int|bool StackPtr to the scope if valid, false otherwise. - */ - protected function validDirectScope(File $phpcsFile, $stackPtr, $validScopes) - { - $tokens = $phpcsFile->getTokens(); - - if (empty($tokens[$stackPtr]['conditions']) === true) { - return false; - } - - /* - * Check only the direct wrapping scope of the token. - */ - $conditions = array_keys($tokens[$stackPtr]['conditions']); - $ptr = array_pop($conditions); - - if (isset($tokens[$ptr]) === false) { - return false; - } - - if (isset($validScopes[$tokens[$ptr]['type']]) === true) { - return $ptr; - } - - return false; - } - - - /** - * Get an array of just the type hints from a function declaration. - * - * Expects to be passed T_FUNCTION or T_CLOSURE token. - * - * Strips potential nullable indicator and potential global namespace - * indicator from the type hints before returning them. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token. - * - * @return array Array with type hints or an empty array if - * - the function does not have any parameters - * - no type hints were found - * - or the passed token was not of the correct type. - */ - public function getTypeHintsFromFunctionDeclaration(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] !== \T_FUNCTION && $tokens[$stackPtr]['code'] !== \T_CLOSURE) { - return array(); - } - - $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); - if (empty($parameters) || \is_array($parameters) === false) { - return array(); - } - - $typeHints = array(); - - foreach ($parameters as $param) { - if ($param['type_hint'] === '') { - continue; - } - - // Strip off potential nullable indication. - $typeHint = ltrim($param['type_hint'], '?'); - - // Strip off potential (global) namespace indication. - $typeHint = ltrim($typeHint, '\\'); - - if ($typeHint !== '') { - $typeHints[] = $typeHint; - } - } - - return $typeHints; - } - - - /** - * Get the hash algorithm name from the parameter in a hash function call. - * - * @since 7.0.7 Logic was originally contained in the `RemovedHashAlgorithms` sniff. - * - * @param \PHP_CodeSniffer_File $phpcsFile Instance of phpcsFile. - * @param int $stackPtr The position of the T_STRING function token. - * - * @return string|false The algorithm name without quotes if this was a relevant hash - * function call or false if it was not. - */ - public function getHashAlgorithmParameter(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - if ($tokens[$stackPtr]['code'] !== \T_STRING) { - return false; - } - - $functionName = $tokens[$stackPtr]['content']; - $functionNameLc = strtolower($functionName); - - // Bow out if not one of the functions we're targetting. - if (isset($this->hashAlgoFunctions[$functionNameLc]) === false) { - return false; - } - - // Get the parameter from the function call which should contain the algorithm name. - $algoParam = $this->getFunctionCallParameter($phpcsFile, $stackPtr, $this->hashAlgoFunctions[$functionNameLc]); - if ($algoParam === false) { - return false; - } - - // Algorithm is a text string, so we need to remove the quotes. - $algo = strtolower(trim($algoParam['raw'])); - $algo = $this->stripQuotes($algo); - - return $algo; - } - - - /** - * Determine whether an arbitrary T_STRING token is the use of a global constant. - * - * @since 8.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the T_STRING token. - * - * @return bool - */ - public function isUseOfGlobalConstant(File $phpcsFile, $stackPtr) - { - static $isLowPHPCS, $isLowPHP; - - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - // Is this one of the tokens this function handles ? - if ($tokens[$stackPtr]['code'] !== \T_STRING) { - return false; - } - - // Check for older PHP, PHPCS version so we can compensate for misidentified tokens. - if (isset($isLowPHPCS, $isLowPHP) === false) { - $isLowPHP = false; - $isLowPHPCS = false; - if (version_compare(\PHP_VERSION_ID, '50400', '<')) { - $isLowPHP = true; - $isLowPHPCS = version_compare(PHPCSHelper::getVersion(), '2.4.0', '<'); - } - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next !== false - && ($tokens[$next]['code'] === \T_OPEN_PARENTHESIS - || $tokens[$next]['code'] === \T_DOUBLE_COLON) - ) { - // Function call or declaration. - return false; - } - - // Array of tokens which if found preceding the $stackPtr indicate that a T_STRING is not a global constant. - $tokensToIgnore = array( - 'T_NAMESPACE' => true, - 'T_USE' => true, - 'T_CLASS' => true, - 'T_TRAIT' => true, - 'T_INTERFACE' => true, - 'T_EXTENDS' => true, - 'T_IMPLEMENTS' => true, - 'T_NEW' => true, - 'T_FUNCTION' => true, - 'T_DOUBLE_COLON' => true, - 'T_OBJECT_OPERATOR' => true, - 'T_INSTANCEOF' => true, - 'T_INSTEADOF' => true, - 'T_GOTO' => true, - 'T_AS' => true, - 'T_PUBLIC' => true, - 'T_PROTECTED' => true, - 'T_PRIVATE' => true, - ); - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prev !== false - && (isset($tokensToIgnore[$tokens[$prev]['type']]) === true - || ($tokens[$prev]['code'] === \T_STRING - && (($isLowPHPCS === true - && $tokens[$prev]['content'] === 'trait') - || ($isLowPHP === true - && $tokens[$prev]['content'] === 'insteadof')))) - ) { - // Not the use of a constant. - return false; - } - - if ($prev !== false - && $tokens[$prev]['code'] === \T_NS_SEPARATOR - && $tokens[($prev - 1)]['code'] === \T_STRING - ) { - // Namespaced constant of the same name. - return false; - } - - if ($prev !== false - && $tokens[$prev]['code'] === \T_CONST - && $this->isClassConstant($phpcsFile, $prev) === true - ) { - // Class constant declaration of the same name. - return false; - } - - /* - * Deal with a number of variations of use statements. - */ - for ($i = $stackPtr; $i > 0; $i--) { - if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) { - break; - } - } - - $firstOnLine = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - if ($firstOnLine !== false && $tokens[$firstOnLine]['code'] === \T_USE) { - $nextOnLine = $phpcsFile->findNext(Tokens::$emptyTokens, ($firstOnLine + 1), null, true); - if ($nextOnLine !== false) { - if (($tokens[$nextOnLine]['code'] === \T_STRING && $tokens[$nextOnLine]['content'] === 'const') - || $tokens[$nextOnLine]['code'] === \T_CONST // Happens in some PHPCS versions. - ) { - $hasNsSep = $phpcsFile->findNext(\T_NS_SEPARATOR, ($nextOnLine + 1), $stackPtr); - if ($hasNsSep !== false) { - // Namespaced const (group) use statement. - return false; - } - } else { - // Not a const use statement. - return false; - } - } - } - - return true; - } - - - /** - * Determine whether the tokens between $start and $end together form a positive number - * as recognized by PHP. - * - * The outcome of this function is reliable for `true`, `false` should be regarded as - * "undetermined". - * - * Note: Zero is *not* regarded as a positive number. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $start Start of the snippet (inclusive), i.e. this - * token will be examined as part of the snippet. - * @param int $end End of the snippet (inclusive), i.e. this - * token will be examined as part of the snippet. - * @param bool $allowFloats Whether to only consider integers, or also floats. - * - * @return bool True if PHP would evaluate the snippet as a positive number. - * False if not or if it could not be reliably determined - * (variable or calculations and such). - */ - public function isPositiveNumber(File $phpcsFile, $start, $end, $allowFloats = false) - { - $number = $this->isNumber($phpcsFile, $start, $end, $allowFloats); - - if ($number === false) { - return false; - } - - return ($number > 0); - } - - - /** - * Determine whether the tokens between $start and $end together form a negative number - * as recognized by PHP. - * - * The outcome of this function is reliable for `true`, `false` should be regarded as - * "undetermined". - * - * Note: Zero is *not* regarded as a negative number. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $start Start of the snippet (inclusive), i.e. this - * token will be examined as part of the snippet. - * @param int $end End of the snippet (inclusive), i.e. this - * token will be examined as part of the snippet. - * @param bool $allowFloats Whether to only consider integers, or also floats. - * - * @return bool True if PHP would evaluate the snippet as a negative number. - * False if not or if it could not be reliably determined - * (variable or calculations and such). - */ - public function isNegativeNumber(File $phpcsFile, $start, $end, $allowFloats = false) - { - $number = $this->isNumber($phpcsFile, $start, $end, $allowFloats); - - if ($number === false) { - return false; - } - - return ($number < 0); - } - - /** - * Determine whether the tokens between $start and $end together form a number - * as recognized by PHP. - * - * The outcome of this function is reliable for "true-ish" values, `false` should - * be regarded as "undetermined". - * - * @link https://3v4l.org/npTeM - * - * Mainly intended for examining variable assignments, function call parameters, array values - * where the start and end of the snippet to examine is very clear. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $start Start of the snippet (inclusive), i.e. this - * token will be examined as part of the snippet. - * @param int $end End of the snippet (inclusive), i.e. this - * token will be examined as part of the snippet. - * @param bool $allowFloats Whether to only consider integers, or also floats. - * - * @return int|float|bool The number found if PHP would evaluate the snippet as a number. - * The return type will be int if $allowFloats is false, if - * $allowFloats is true, the return type will be float. - * False will be returned when the snippet does not evaluate to a - * number or if it could not be reliably determined - * (variable or calculations and such). - */ - protected function isNumber(File $phpcsFile, $start, $end, $allowFloats = false) - { - $stringTokens = Tokens::$heredocTokens + Tokens::$stringTokens; - - $validTokens = array(); - $validTokens[\T_LNUMBER] = true; - $validTokens[\T_TRUE] = true; // Evaluates to int 1. - $validTokens[\T_FALSE] = true; // Evaluates to int 0. - $validTokens[\T_NULL] = true; // Evaluates to int 0. - - if ($allowFloats === true) { - $validTokens[\T_DNUMBER] = true; - } - - $maybeValidTokens = $stringTokens + $validTokens; - - $tokens = $phpcsFile->getTokens(); - $searchEnd = ($end + 1); - $negativeNumber = false; - - if (isset($tokens[$start], $tokens[$searchEnd]) === false) { - return false; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $start, $searchEnd, true); - while ($nextNonEmpty !== false - && ($tokens[$nextNonEmpty]['code'] === \T_PLUS - || $tokens[$nextNonEmpty]['code'] === \T_MINUS) - ) { - - if ($tokens[$nextNonEmpty]['code'] === \T_MINUS) { - $negativeNumber = ($negativeNumber === false) ? true : false; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), $searchEnd, true); - } - - if ($nextNonEmpty === false || isset($maybeValidTokens[$tokens[$nextNonEmpty]['code']]) === false) { - return false; - } - - $content = false; - if ($tokens[$nextNonEmpty]['code'] === \T_LNUMBER - || $tokens[$nextNonEmpty]['code'] === \T_DNUMBER - ) { - $content = (float) $tokens[$nextNonEmpty]['content']; - } elseif ($tokens[$nextNonEmpty]['code'] === \T_TRUE) { - $content = 1.0; - } elseif ($tokens[$nextNonEmpty]['code'] === \T_FALSE - || $tokens[$nextNonEmpty]['code'] === \T_NULL - ) { - $content = 0.0; - } elseif (isset($stringTokens[$tokens[$nextNonEmpty]['code']]) === true) { - - if ($tokens[$nextNonEmpty]['code'] === \T_START_HEREDOC - || $tokens[$nextNonEmpty]['code'] === \T_START_NOWDOC - ) { - // Skip past heredoc/nowdoc opener to the first content. - $firstDocToken = $phpcsFile->findNext(array(\T_HEREDOC, \T_NOWDOC), ($nextNonEmpty + 1), $searchEnd); - if ($firstDocToken === false) { - // Live coding or parse error. - return false; - } - - $stringContent = $content = $tokens[$firstDocToken]['content']; - - // Skip forward to the end in preparation for the next part of the examination. - $nextNonEmpty = $phpcsFile->findNext(array(\T_END_HEREDOC, \T_END_NOWDOC), ($nextNonEmpty + 1), $searchEnd); - if ($nextNonEmpty === false) { - // Live coding or parse error. - return false; - } - } else { - // Gather subsequent lines for a multi-line string. - for ($i = $nextNonEmpty; $i < $searchEnd; $i++) { - if ($tokens[$i]['code'] !== $tokens[$nextNonEmpty]['code']) { - break; - } - $content .= $tokens[$i]['content']; - } - - $nextNonEmpty = --$i; - $content = $this->stripQuotes($content); - $stringContent = $content; - } - - /* - * Regexes based on the formats outlined in the manual, created by JRF. - * @link https://www.php.net/manual/en/language.types.float.php - */ - $regexInt = '`^\s*[0-9]+`'; - $regexFloat = '`^\s*(?:[+-]?(?:(?:(?P[0-9]+)|(?P([0-9]*\.(?P>LNUM)|(?P>LNUM)\.[0-9]*)))[eE][+-]?(?P>LNUM))|(?P>DNUM))`'; - - $intString = preg_match($regexInt, $content, $intMatch); - $floatString = preg_match($regexFloat, $content, $floatMatch); - - // Does the text string start with a number ? If so, PHP would juggle it and use it as a number. - if ($allowFloats === false) { - if ($intString !== 1 || $floatString === 1) { - if ($floatString === 1) { - // Found float. Only integers targetted. - return false; - } - - $content = 0.0; - } else { - $content = (float) trim($intMatch[0]); - } - } else { - if ($intString !== 1 && $floatString !== 1) { - $content = 0.0; - } else { - $content = ($floatString === 1) ? (float) trim($floatMatch[0]) : (float) trim($intMatch[0]); - } - } - - // Allow for different behaviour for hex numeric strings between PHP 5 vs PHP 7. - if ($intString === 1 && trim($intMatch[0]) === '0' - && preg_match('`^\s*(0x[A-Fa-f0-9]+)`', $stringContent, $hexNumberString) === 1 - && $this->supportsBelow('5.6') === true - ) { - // The filter extension still allows for hex numeric strings in PHP 7, so - // use that to get the numeric value if possible. - // If the filter extension is not available, the value will be zero, but so be it. - if (function_exists('filter_var')) { - $filtered = filter_var($hexNumberString[1], \FILTER_VALIDATE_INT, \FILTER_FLAG_ALLOW_HEX); - if ($filtered !== false) { - $content = $filtered; - } - } - } - } - - // OK, so we have a number, now is there still more code after it ? - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), $searchEnd, true); - if ($nextNonEmpty !== false) { - return false; - } - - if ($negativeNumber === true) { - $content = -$content; - } - - if ($allowFloats === false) { - return (int) $content; - } - - return $content; - } - - - /** - * Determine whether the tokens between $start and $end together form a numberic calculation - * as recognized by PHP. - * - * The outcome of this function is reliable for `true`, `false` should be regarded as "undetermined". - * - * Mainly intended for examining variable assignments, function call parameters, array values - * where the start and end of the snippet to examine is very clear. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $start Start of the snippet (inclusive), i.e. this - * token will be examined as part of the snippet. - * @param int $end End of the snippet (inclusive), i.e. this - * token will be examined as part of the snippet. - * - * @return bool - */ - protected function isNumericCalculation(File $phpcsFile, $start, $end) - { - $arithmeticTokens = Tokens::$arithmeticTokens; - - // phpcs:disable PHPCompatibility.Constants.NewConstants.t_powFound - if (\defined('T_POW') && isset($arithmeticTokens[\T_POW]) === false) { - // T_POW was not added to the arithmetic array until PHPCS 2.9.0. - $arithmeticTokens[\T_POW] = \T_POW; - } - // phpcs:enable - - $skipTokens = Tokens::$emptyTokens; - $skipTokens[] = \T_MINUS; - $skipTokens[] = \T_PLUS; - - // Find the first arithmetic operator, but skip past +/- signs before numbers. - $nextNonEmpty = ($start - 1); - do { - $nextNonEmpty = $phpcsFile->findNext($skipTokens, ($nextNonEmpty + 1), ($end + 1), true); - $arithmeticOperator = $phpcsFile->findNext($arithmeticTokens, ($nextNonEmpty + 1), ($end + 1)); - } while ($nextNonEmpty !== false && $arithmeticOperator !== false && $nextNonEmpty === $arithmeticOperator); - - if ($arithmeticOperator === false) { - return false; - } - - $tokens = $phpcsFile->getTokens(); - $subsetStart = $start; - $subsetEnd = ($arithmeticOperator - 1); - - while ($this->isNumber($phpcsFile, $subsetStart, $subsetEnd, true) !== false - && isset($tokens[($arithmeticOperator + 1)]) === true - ) { - // Recognize T_POW for PHPCS < 2.4.0 on low PHP versions. - if (\defined('T_POW') === false - && $tokens[$arithmeticOperator]['code'] === \T_MULTIPLY - && $tokens[($arithmeticOperator + 1)]['code'] === \T_MULTIPLY - && isset($tokens[$arithmeticOperator + 2]) === true - ) { - // Move operator one forward to the second * in T_POW. - ++$arithmeticOperator; - } - - $subsetStart = ($arithmeticOperator + 1); - $nextNonEmpty = $arithmeticOperator; - do { - $nextNonEmpty = $phpcsFile->findNext($skipTokens, ($nextNonEmpty + 1), ($end + 1), true); - $arithmeticOperator = $phpcsFile->findNext($arithmeticTokens, ($nextNonEmpty + 1), ($end + 1)); - } while ($nextNonEmpty !== false && $arithmeticOperator !== false && $nextNonEmpty === $arithmeticOperator); - - if ($arithmeticOperator === false) { - // Last calculation operator already reached. - if ($this->isNumber($phpcsFile, $subsetStart, $end, true) !== false) { - return true; - } - - return false; - } - - $subsetEnd = ($arithmeticOperator - 1); - } - - return false; - } - - - - /** - * Determine whether a ternary is a short ternary, i.e. without "middle". - * - * N.B.: This is a back-fill for a new method which is expected to go into - * PHP_CodeSniffer 3.5.0. - * Once that method has been merged into PHPCS, this one should be moved - * to the PHPCSHelper.php file. - * - * @since 9.2.0 - * - * @codeCoverageIgnore Method as pulled upstream is accompanied by unit tests. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the ternary operator - * in the stack. - * - * @return bool True if short ternary, or false otherwise. - */ - public function isShortTernary(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]) === false - || $tokens[$stackPtr]['code'] !== \T_INLINE_THEN - ) { - return false; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - // Live coding or parse error. - return false; - } - - if ($tokens[$nextNonEmpty]['code'] === \T_INLINE_ELSE) { - return true; - } - - return false; - } - - - /** - * Determine whether a T_OPEN/CLOSE_SHORT_ARRAY token is a list() construct. - * - * Note: A variety of PHPCS versions have bugs in the tokenizing of short arrays. - * In that case, the tokens are identified as T_OPEN/CLOSE_SQUARE_BRACKET. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the function call token. - * - * @return bool - */ - public function isShortList(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - // Is this one of the tokens this function handles ? - if ($tokens[$stackPtr]['code'] !== \T_OPEN_SHORT_ARRAY - && $tokens[$stackPtr]['code'] !== \T_CLOSE_SHORT_ARRAY - ) { - return false; - } - - switch ($tokens[$stackPtr]['code']) { - case \T_OPEN_SHORT_ARRAY: - if (isset($tokens[$stackPtr]['bracket_closer']) === true) { - $opener = $stackPtr; - $closer = $tokens[$stackPtr]['bracket_closer']; - } - break; - - case \T_CLOSE_SHORT_ARRAY: - if (isset($tokens[$stackPtr]['bracket_opener']) === true) { - $opener = $tokens[$stackPtr]['bracket_opener']; - $closer = $stackPtr; - } - break; - } - - if (isset($opener, $closer) === false) { - // Parse error, live coding or real square bracket. - return false; - } - - /* - * PHPCS cross-version compatibility: work around for square brackets misidentified - * as short array when preceded by a variable variable in older PHPCS versions. - */ - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), null, true, null, true); - - if ($prevNonEmpty !== false - && $tokens[$prevNonEmpty]['code'] === \T_CLOSE_CURLY_BRACKET - && isset($tokens[$prevNonEmpty]['bracket_opener']) === true - ) { - $maybeVariableVariable = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($tokens[$prevNonEmpty]['bracket_opener'] - 1), - null, - true, - null, - true - ); - - if ($tokens[$maybeVariableVariable]['code'] === \T_VARIABLE - || $tokens[$maybeVariableVariable]['code'] === \T_DOLLAR - ) { - return false; - } - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($closer + 1), null, true, null, true); - - if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === \T_EQUAL) { - return true; - } - - if ($prevNonEmpty !== false - && $tokens[$prevNonEmpty]['code'] === \T_AS - && isset($tokens[$prevNonEmpty]['nested_parenthesis']) === true - ) { - $parentheses = array_reverse($tokens[$prevNonEmpty]['nested_parenthesis'], true); - foreach ($parentheses as $open => $close) { - if (isset($tokens[$open]['parenthesis_owner']) - && $tokens[$tokens[$open]['parenthesis_owner']]['code'] === \T_FOREACH - ) { - return true; - } - } - } - - // Maybe this is a short list syntax nested inside another short list syntax ? - $parentOpener = $opener; - do { - $parentOpener = $phpcsFile->findPrevious( - array(\T_OPEN_SHORT_ARRAY, \T_OPEN_SQUARE_BRACKET), - ($parentOpener - 1), - null, - false, - null, - true - ); - - if ($parentOpener === false) { - return false; - } - - } while (isset($tokens[$parentOpener]['bracket_closer']) === true - && $tokens[$parentOpener]['bracket_closer'] < $opener - ); - - if (isset($tokens[$parentOpener]['bracket_closer']) === true - && $tokens[$parentOpener]['bracket_closer'] > $closer - ) { - // Work around tokenizer issue in PHPCS 2.0 - 2.7. - $phpcsVersion = PHPCSHelper::getVersion(); - if ((version_compare($phpcsVersion, '2.0', '>') === true - && version_compare($phpcsVersion, '2.8', '<') === true) - && $tokens[$parentOpener]['code'] === \T_OPEN_SQUARE_BRACKET - ) { - $nextNonEmpty = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($tokens[$parentOpener]['bracket_closer'] + 1), - null, - true, - null, - true - ); - - if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === \T_EQUAL) { - return true; - } - - return false; - } - - return $this->isShortList($phpcsFile, $parentOpener); - } - - return false; - } - - - /** - * Determine whether the tokens between $start and $end could together represent a variable. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $start Starting point stack pointer. Inclusive. - * I.e. this token should be taken into account. - * @param int $end End point stack pointer. Exclusive. - * I.e. this token should not be taken into account. - * @param int $targetNestingLevel The nesting level the variable should be at. - * - * @return bool - */ - public function isVariable(File $phpcsFile, $start, $end, $targetNestingLevel) - { - static $tokenBlackList, $bracketTokens; - - // Create the token arrays only once. - if (isset($tokenBlackList, $bracketTokens) === false) { - - $tokenBlackList = array( - \T_OPEN_PARENTHESIS => \T_OPEN_PARENTHESIS, - \T_STRING_CONCAT => \T_STRING_CONCAT, - ); - $tokenBlackList += Tokens::$assignmentTokens; - $tokenBlackList += Tokens::$equalityTokens; - $tokenBlackList += Tokens::$comparisonTokens; - $tokenBlackList += Tokens::$operators; - $tokenBlackList += Tokens::$booleanOperators; - $tokenBlackList += Tokens::$castTokens; - - /* - * List of brackets which can be part of a variable variable. - * - * Key is the open bracket token, value the close bracket token. - */ - $bracketTokens = array( - \T_OPEN_CURLY_BRACKET => \T_CLOSE_CURLY_BRACKET, - \T_OPEN_SQUARE_BRACKET => \T_CLOSE_SQUARE_BRACKET, - ); - } - - $tokens = $phpcsFile->getTokens(); - - // If no variable at all was found, then it's definitely a no-no. - $hasVariable = $phpcsFile->findNext(\T_VARIABLE, $start, $end); - if ($hasVariable === false) { - return false; - } - - // Check if the variable found is at the right level. Deeper levels are always an error. - if (isset($tokens[$hasVariable]['nested_parenthesis']) - && \count($tokens[$hasVariable]['nested_parenthesis']) !== $targetNestingLevel - ) { - return false; - } - - // Ok, so the first variable is at the right level, now are there any - // blacklisted tokens within the empty() ? - $hasBadToken = $phpcsFile->findNext($tokenBlackList, $start, $end); - if ($hasBadToken === false) { - return true; - } - - // If there are also bracket tokens, the blacklisted token might be part of a variable - // variable, but if there are no bracket tokens, we know we have an error. - $hasBrackets = $phpcsFile->findNext($bracketTokens, $start, $end); - if ($hasBrackets === false) { - return false; - } - - // Ok, we have both a blacklisted token as well as brackets, so we need to walk - // the tokens of the variable variable. - for ($i = $start; $i < $end; $i++) { - // If this is a bracket token, skip to the end of the bracketed expression. - if (isset($bracketTokens[$tokens[$i]['code']], $tokens[$i]['bracket_closer'])) { - $i = $tokens[$i]['bracket_closer']; - continue; - } - - // If it's a blacklisted token, not within brackets, we have an error. - if (isset($tokenBlackList[$tokens[$i]['code']])) { - return false; - } - } - - return true; - } - - /** - * Determine whether a T_MINUS/T_PLUS token is a unary operator. - * - * N.B.: This is a back-fill for a new method which is expected to go into - * PHP_CodeSniffer 3.5.0. - * Once that method has been merged into PHPCS, this one should be moved - * to the PHPCSHelper.php file. - * - * @since 9.2.0 - * - * @codeCoverageIgnore Method as pulled upstream is accompanied by unit tests. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the plus/minus token. - * - * @return bool True if the token passed is a unary operator. - * False otherwise or if the token is not a T_PLUS/T_MINUS token. - */ - public static function isUnaryPlusMinus(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]) === false - || ($tokens[$stackPtr]['code'] !== \T_PLUS - && $tokens[$stackPtr]['code'] !== \T_MINUS) - ) { - return false; - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next === false) { - // Live coding or parse error. - return false; - } - - if (isset(Tokens::$operators[$tokens[$next]['code']]) === true) { - // Next token is an operator, so this is not a unary. - return false; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - if ($tokens[$prev]['code'] === \T_RETURN) { - // Just returning a positive/negative value; eg. (return -1). - return true; - } - - if (isset(Tokens::$operators[$tokens[$prev]['code']]) === true) { - // Just trying to operate on a positive/negative value; eg. ($var * -1). - return true; - } - - if (isset(Tokens::$comparisonTokens[$tokens[$prev]['code']]) === true) { - // Just trying to compare a positive/negative value; eg. ($var === -1). - return true; - } - - if (isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === true) { - // Just trying to compare a positive/negative value; eg. ($var || -1 === $b). - return true; - } - - if (isset(Tokens::$assignmentTokens[$tokens[$prev]['code']]) === true) { - // Just trying to assign a positive/negative value; eg. ($var = -1). - return true; - } - - if (isset(Tokens::$castTokens[$tokens[$prev]['code']]) === true) { - // Just casting a positive/negative value; eg. (string) -$var. - return true; - } - - // Other indicators that a plus/minus sign is a unary operator. - $invalidTokens = array( - \T_COMMA => true, - \T_OPEN_PARENTHESIS => true, - \T_OPEN_SQUARE_BRACKET => true, - \T_OPEN_SHORT_ARRAY => true, - \T_COLON => true, - \T_INLINE_THEN => true, - \T_INLINE_ELSE => true, - \T_CASE => true, - \T_OPEN_CURLY_BRACKET => true, - \T_STRING_CONCAT => true, - ); - - if (isset($invalidTokens[$tokens[$prev]['code']]) === true) { - // Just trying to use a positive/negative value; eg. myFunction($var, -2). - return true; - } - - return false; - } - - /** - * Get the complete contents of a multi-line text string. - * - * N.B.: This is a back-fill for a new method which is expected to go into - * PHP_CodeSniffer 3.5.0. - * Once that method has been merged into PHPCS, this one should be moved - * to the PHPCSHelper.php file. - * - * @since 9.3.0 - * - * @codeCoverageIgnore Method as pulled upstream is accompanied by unit tests. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr Pointer to the first text string token - * of a multi-line text string or to a - * Nowdoc/Heredoc opener. - * @param bool $stripQuotes Optional. Whether to strip text delimiter - * quotes off the resulting text string. - * Defaults to true. - * - * @return string - * - * @throws \PHP_CodeSniffer_Exception If the specified position is not a - * valid text string token or if the - * token is not the first text string token. - */ - public function getCompleteTextString(File $phpcsFile, $stackPtr, $stripQuotes = true) - { - $tokens = $phpcsFile->getTokens(); - - // Must be the start of a text string token. - if ($tokens[$stackPtr]['code'] !== \T_START_HEREDOC - && $tokens[$stackPtr]['code'] !== \T_START_NOWDOC - && $tokens[$stackPtr]['code'] !== \T_CONSTANT_ENCAPSED_STRING - && $tokens[$stackPtr]['code'] !== \T_DOUBLE_QUOTED_STRING - ) { - throw new PHPCS_Exception('$stackPtr must be of type T_START_HEREDOC, T_START_NOWDOC, T_CONSTANT_ENCAPSED_STRING or T_DOUBLE_QUOTED_STRING'); - } - - if ($tokens[$stackPtr]['code'] === \T_CONSTANT_ENCAPSED_STRING - || $tokens[$stackPtr]['code'] === \T_DOUBLE_QUOTED_STRING - ) { - $prev = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$stackPtr]['code'] === $tokens[$prev]['code']) { - throw new PHPCS_Exception('$stackPtr must be the start of the text string'); - } - } - - switch ($tokens[$stackPtr]['code']) { - case \T_START_HEREDOC: - $stripQuotes = false; - $targetType = \T_HEREDOC; - $current = ($stackPtr + 1); - break; - - case \T_START_NOWDOC: - $stripQuotes = false; - $targetType = \T_NOWDOC; - $current = ($stackPtr + 1); - break; - - default: - $targetType = $tokens[$stackPtr]['code']; - $current = $stackPtr; - break; - } - - $string = ''; - do { - $string .= $tokens[$current]['content']; - ++$current; - } while ($tokens[$current]['code'] === $targetType); - - if ($stripQuotes === true) { - return $this->stripQuotes($string); - } - - return $string; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenAbstractPrivateMethodsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenAbstractPrivateMethodsSniff.php deleted file mode 100644 index d0d74dfe..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/ForbiddenAbstractPrivateMethodsSniff.php +++ /dev/null @@ -1,90 +0,0 @@ - true, - 'T_TRAIT' => true, - 'T_ANON_CLASS' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.2.0 - * - * @return array - */ - public function register() - { - return array(\T_FUNCTION); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('5.1') === false) { - return; - } - - if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) === false) { - // Function, not method. - return; - } - - $properties = $phpcsFile->getMethodProperties($stackPtr); - if ($properties['scope'] !== 'private' || $properties['is_abstract'] !== true) { - return; - } - - $phpcsFile->addError( - 'Abstract methods cannot be declared as private since PHP 5.1', - $stackPtr, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php deleted file mode 100644 index 572b6fcc..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewAnonymousClassesSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - \T_CLASS, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.0 - * - * @return array - */ - public function register() - { - if (\defined('T_ANON_CLASS')) { - $this->indicators[\T_ANON_CLASS] = \T_ANON_CLASS; - } - - return array(\T_NEW); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsBelow('5.6') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); - if ($nextNonEmpty === false || isset($this->indicators[$tokens[$nextNonEmpty]['code']]) === false) { - return; - } - - // Still here ? In that case, it is an anonymous class. - $phpcsFile->addError( - 'Anonymous classes are not supported in PHP 5.6 or earlier', - $stackPtr, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php deleted file mode 100644 index 19e5e439..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewClassesSniff.php +++ /dev/null @@ -1,913 +0,0 @@ - array(string => bool)) - */ - protected $newClasses = array( - 'ArrayObject' => array( - '4.4' => false, - '5.0' => true, - ), - 'ArrayIterator' => array( - '4.4' => false, - '5.0' => true, - ), - 'CachingIterator' => array( - '4.4' => false, - '5.0' => true, - ), - 'DirectoryIterator' => array( - '4.4' => false, - '5.0' => true, - ), - 'RecursiveDirectoryIterator' => array( - '4.4' => false, - '5.0' => true, - ), - 'RecursiveIteratorIterator' => array( - '4.4' => false, - '5.0' => true, - ), - 'php_user_filter' => array( - '4.4' => false, - '5.0' => true, - ), - 'tidy' => array( - '4.4' => false, - '5.0' => true, - ), - - 'SimpleXMLElement' => array( - '5.0.0' => false, - '5.0.1' => true, - ), - 'tidyNode' => array( - '5.0.0' => false, - '5.0.1' => true, - ), - - 'libXMLError' => array( - '5.0' => false, - '5.1' => true, - ), - 'PDO' => array( - '5.0' => false, - '5.1' => true, - ), - 'PDOStatement' => array( - '5.0' => false, - '5.1' => true, - ), - 'AppendIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'EmptyIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'FilterIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'InfiniteIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'IteratorIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'LimitIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'NoRewindIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'ParentIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'RecursiveArrayIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'RecursiveCachingIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'RecursiveFilterIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'SimpleXMLIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'SplFileObject' => array( - '5.0' => false, - '5.1' => true, - ), - 'XMLReader' => array( - '5.0' => false, - '5.1' => true, - ), - - 'SplFileInfo' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'SplTempFileObject' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'XMLWriter' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - - 'DateTime' => array( - '5.1' => false, - '5.2' => true, - ), - 'DateTimeZone' => array( - '5.1' => false, - '5.2' => true, - ), - 'RegexIterator' => array( - '5.1' => false, - '5.2' => true, - ), - 'RecursiveRegexIterator' => array( - '5.1' => false, - '5.2' => true, - ), - 'ReflectionFunctionAbstract' => array( - '5.1' => false, - '5.2' => true, - ), - 'ZipArchive' => array( - '5.1' => false, - '5.2' => true, - ), - - 'Closure' => array( - '5.2' => false, - '5.3' => true, - ), - 'DateInterval' => array( - '5.2' => false, - '5.3' => true, - ), - 'DatePeriod' => array( - '5.2' => false, - '5.3' => true, - ), - 'finfo' => array( - '5.2' => false, - '5.3' => true, - ), - 'Collator' => array( - '5.2' => false, - '5.3' => true, - ), - 'NumberFormatter' => array( - '5.2' => false, - '5.3' => true, - ), - 'Locale' => array( - '5.2' => false, - '5.3' => true, - ), - 'Normalizer' => array( - '5.2' => false, - '5.3' => true, - ), - 'MessageFormatter' => array( - '5.2' => false, - '5.3' => true, - ), - 'IntlDateFormatter' => array( - '5.2' => false, - '5.3' => true, - ), - 'Phar' => array( - '5.2' => false, - '5.3' => true, - ), - 'PharData' => array( - '5.2' => false, - '5.3' => true, - ), - 'PharFileInfo' => array( - '5.2' => false, - '5.3' => true, - ), - 'FilesystemIterator' => array( - '5.2' => false, - '5.3' => true, - ), - 'GlobIterator' => array( - '5.2' => false, - '5.3' => true, - ), - 'MultipleIterator' => array( - '5.2' => false, - '5.3' => true, - ), - 'RecursiveTreeIterator' => array( - '5.2' => false, - '5.3' => true, - ), - 'SplDoublyLinkedList' => array( - '5.2' => false, - '5.3' => true, - ), - 'SplFixedArray' => array( - '5.2' => false, - '5.3' => true, - ), - 'SplHeap' => array( - '5.2' => false, - '5.3' => true, - ), - 'SplMaxHeap' => array( - '5.2' => false, - '5.3' => true, - ), - 'SplMinHeap' => array( - '5.2' => false, - '5.3' => true, - ), - 'SplObjectStorage' => array( - '5.2' => false, - '5.3' => true, - ), - 'SplPriorityQueue' => array( - '5.2' => false, - '5.3' => true, - ), - 'SplQueue' => array( - '5.2' => false, - '5.3' => true, - ), - 'SplStack' => array( - '5.2' => false, - '5.3' => true, - ), - - 'ResourceBundle' => array( - '5.3.1' => false, - '5.3.2' => true, - ), - - 'CallbackFilterIterator' => array( - '5.3' => false, - '5.4' => true, - ), - 'RecursiveCallbackFilterIterator' => array( - '5.3' => false, - '5.4' => true, - ), - 'ReflectionZendExtension' => array( - '5.3' => false, - '5.4' => true, - ), - 'SessionHandler' => array( - '5.3' => false, - '5.4' => true, - ), - 'SNMP' => array( - '5.3' => false, - '5.4' => true, - ), - 'Transliterator' => array( - '5.3' => false, - '5.4' => true, - ), - 'Spoofchecker' => array( - '5.3' => false, - '5.4' => true, - ), - - 'Generator' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLFile' => array( - '5.4' => false, - '5.5' => true, - ), - 'DateTimeImmutable' => array( - '5.4' => false, - '5.5' => true, - ), - 'IntlCalendar' => array( - '5.4' => false, - '5.5' => true, - ), - 'IntlGregorianCalendar' => array( - '5.4' => false, - '5.5' => true, - ), - 'IntlTimeZone' => array( - '5.4' => false, - '5.5' => true, - ), - 'IntlBreakIterator' => array( - '5.4' => false, - '5.5' => true, - ), - 'IntlRuleBasedBreakIterator' => array( - '5.4' => false, - '5.5' => true, - ), - 'IntlCodePointBreakIterator' => array( - '5.4' => false, - '5.5' => true, - ), - 'UConverter' => array( - '5.4' => false, - '5.5' => true, - ), - - 'GMP' => array( - '5.5' => false, - '5.6' => true, - ), - - 'IntlChar' => array( - '5.6' => false, - '7.0' => true, - ), - 'ReflectionType' => array( - '5.6' => false, - '7.0' => true, - ), - 'ReflectionGenerator' => array( - '5.6' => false, - '7.0' => true, - ), - - 'ReflectionClassConstant' => array( - '7.0' => false, - '7.1' => true, - ), - - 'FFI' => array( - '7.3' => false, - '7.4' => true, - ), - 'FFI\CData' => array( - '7.3' => false, - '7.4' => true, - ), - 'FFI\CType' => array( - '7.3' => false, - '7.4' => true, - ), - 'ReflectionReference' => array( - '7.3' => false, - '7.4' => true, - ), - 'WeakReference' => array( - '7.3' => false, - '7.4' => true, - ), - ); - - /** - * A list of new Exception classes, not present in older versions. - * - * The array lists : version number with false (not present) or true (present). - * If's sufficient to list the first version where the class appears. - * - * {@internal Classes listed here do not need to be added to the $newClasses - * property as well. - * This list is automatically added to the $newClasses property - * in the `register()` method.} - * - * {@internal Helper to update this list: https://3v4l.org/MhlUp} - * - * @since 7.1.4 - * - * @var array(string => array(string => bool)) - */ - protected $newExceptions = array( - 'com_exception' => array( - '4.4' => false, - '5.0' => true, - ), - 'DOMException' => array( - '4.4' => false, - '5.0' => true, - ), - 'Exception' => array( - // According to the docs introduced in PHP 5.1, but this appears to be. - // an error. Class was introduced with try/catch keywords in PHP 5.0. - '4.4' => false, - '5.0' => true, - ), - 'ReflectionException' => array( - '4.4' => false, - '5.0' => true, - ), - 'SoapFault' => array( - '4.4' => false, - '5.0' => true, - ), - 'SQLiteException' => array( - '4.4' => false, - '5.0' => true, - ), - - 'ErrorException' => array( - '5.0' => false, - '5.1' => true, - ), - 'BadFunctionCallException' => array( - '5.0' => false, - '5.1' => true, - ), - 'BadMethodCallException' => array( - '5.0' => false, - '5.1' => true, - ), - 'DomainException' => array( - '5.0' => false, - '5.1' => true, - ), - 'InvalidArgumentException' => array( - '5.0' => false, - '5.1' => true, - ), - 'LengthException' => array( - '5.0' => false, - '5.1' => true, - ), - 'LogicException' => array( - '5.0' => false, - '5.1' => true, - ), - 'mysqli_sql_exception' => array( - '5.0' => false, - '5.1' => true, - ), - 'OutOfBoundsException' => array( - '5.0' => false, - '5.1' => true, - ), - 'OutOfRangeException' => array( - '5.0' => false, - '5.1' => true, - ), - 'OverflowException' => array( - '5.0' => false, - '5.1' => true, - ), - 'PDOException' => array( - '5.0' => false, - '5.1' => true, - ), - 'RangeException' => array( - '5.0' => false, - '5.1' => true, - ), - 'RuntimeException' => array( - '5.0' => false, - '5.1' => true, - ), - 'UnderflowException' => array( - '5.0' => false, - '5.1' => true, - ), - 'UnexpectedValueException' => array( - '5.0' => false, - '5.1' => true, - ), - - 'PharException' => array( - '5.2' => false, - '5.3' => true, - ), - - 'SNMPException' => array( - '5.3' => false, - '5.4' => true, - ), - - 'IntlException' => array( - '5.4' => false, - '5.5' => true, - ), - - 'Error' => array( - '5.6' => false, - '7.0' => true, - ), - 'ArithmeticError' => array( - '5.6' => false, - '7.0' => true, - ), - 'AssertionError' => array( - '5.6' => false, - '7.0' => true, - ), - 'DivisionByZeroError' => array( - '5.6' => false, - '7.0' => true, - ), - 'ParseError' => array( - '5.6' => false, - '7.0' => true, - ), - 'TypeError' => array( - '5.6' => false, - '7.0' => true, - ), - 'ClosedGeneratorException' => array( - '5.6' => false, - '7.0' => true, - ), - 'UI\Exception\InvalidArgumentException' => array( - '5.6' => false, - '7.0' => true, - ), - 'UI\Exception\RuntimeException' => array( - '5.6' => false, - '7.0' => true, - ), - - 'ArgumentCountError' => array( - '7.0' => false, - '7.1' => true, - ), - - 'SodiumException' => array( - '7.1' => false, - '7.2' => true, - ), - - 'CompileError' => array( - '7.2' => false, - '7.3' => true, - ), - 'JsonException' => array( - '7.2' => false, - '7.3' => true, - ), - - 'FFI\Exception' => array( - '7.3' => false, - '7.4' => true, - ), - 'FFI\ParserException' => array( - '7.3' => false, - '7.4' => true, - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * @since 7.0.3 - Now also targets the `class` keyword to detect extended classes. - * - Now also targets double colons to detect static class use. - * @since 7.1.4 - Now also targets anonymous classes to detect extended classes. - * - Now also targets functions/closures to detect new classes used - * as parameter type declarations. - * - Now also targets the `catch` control structure to detect new - * exception classes being caught. - * @since 8.2.0 Now also targets the `T_RETURN_TYPE` token to detect new classes used - * as return type declarations. - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of class names. - $this->newClasses = $this->arrayKeysToLowercase($this->newClasses); - $this->newExceptions = $this->arrayKeysToLowercase($this->newExceptions); - - // Add the Exception classes to the Classes list. - $this->newClasses = array_merge($this->newClasses, $this->newExceptions); - - $targets = array( - \T_NEW, - \T_CLASS, - \T_DOUBLE_COLON, - \T_FUNCTION, - \T_CLOSURE, - \T_CATCH, - ); - - if (\defined('T_ANON_CLASS')) { - $targets[] = \T_ANON_CLASS; - } - - if (\defined('T_RETURN_TYPE')) { - $targets[] = \T_RETURN_TYPE; - } - - return $targets; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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(); - - switch ($tokens[$stackPtr]['type']) { - case 'T_FUNCTION': - case 'T_CLOSURE': - $this->processFunctionToken($phpcsFile, $stackPtr); - - // Deal with older PHPCS version which don't recognize return type hints - // as well as newer PHPCS versions (3.3.0+) where the tokenization has changed. - $returnTypeHint = $this->getReturnTypeHintToken($phpcsFile, $stackPtr); - if ($returnTypeHint !== false) { - $this->processReturnTypeToken($phpcsFile, $returnTypeHint); - } - break; - - case 'T_CATCH': - $this->processCatchToken($phpcsFile, $stackPtr); - break; - - case 'T_RETURN_TYPE': - $this->processReturnTypeToken($phpcsFile, $stackPtr); - break; - - default: - $this->processSingularToken($phpcsFile, $stackPtr); - break; - } - } - - - /** - * Processes this test for when a token resulting in a singular class name is encountered. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - private function processSingularToken(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $FQClassName = ''; - - if ($tokens[$stackPtr]['type'] === 'T_NEW') { - $FQClassName = $this->getFQClassNameFromNewToken($phpcsFile, $stackPtr); - - } elseif ($tokens[$stackPtr]['type'] === 'T_CLASS' || $tokens[$stackPtr]['type'] === 'T_ANON_CLASS') { - $FQClassName = $this->getFQExtendedClassName($phpcsFile, $stackPtr); - - } elseif ($tokens[$stackPtr]['type'] === 'T_DOUBLE_COLON') { - $FQClassName = $this->getFQClassNameFromDoubleColonToken($phpcsFile, $stackPtr); - } - - if ($FQClassName === '') { - return; - } - - $className = substr($FQClassName, 1); // Remove global namespace indicator. - $classNameLc = strtolower($className); - - if (isset($this->newClasses[$classNameLc]) === false) { - return; - } - - $itemInfo = array( - 'name' => $className, - 'nameLc' => $classNameLc, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Processes this test for when a function token is encountered. - * - * - Detect new classes when used as a parameter type declaration. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - private function processFunctionToken(File $phpcsFile, $stackPtr) - { - // Retrieve typehints stripped of global NS indicator and/or nullable indicator. - $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); - if (empty($typeHints) || \is_array($typeHints) === false) { - return; - } - - foreach ($typeHints as $hint) { - - $typeHintLc = strtolower($hint); - - if (isset($this->newClasses[$typeHintLc]) === true) { - $itemInfo = array( - 'name' => $hint, - 'nameLc' => $typeHintLc, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - } - } - - - /** - * Processes this test for when a catch token is encountered. - * - * - Detect exceptions when used in a catch statement. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - private function processCatchToken(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Bow out during live coding. - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { - return; - } - - $opener = $tokens[$stackPtr]['parenthesis_opener']; - $closer = ($tokens[$stackPtr]['parenthesis_closer'] + 1); - $name = ''; - $listen = array( - // Parts of a (namespaced) class name. - \T_STRING => true, - \T_NS_SEPARATOR => true, - // End/split tokens. - \T_VARIABLE => false, - \T_BITWISE_OR => false, - \T_CLOSE_CURLY_BRACKET => false, // Shouldn't be needed as we expect a var before this. - ); - - for ($i = ($opener + 1); $i < $closer; $i++) { - if (isset($listen[$tokens[$i]['code']]) === false) { - continue; - } - - if ($listen[$tokens[$i]['code']] === true) { - $name .= $tokens[$i]['content']; - continue; - } else { - if (empty($name) === true) { - // Weird, we should have a name by the time we encounter a variable or |. - // So this may be the closer. - continue; - } - - $name = ltrim($name, '\\'); - $nameLC = strtolower($name); - - if (isset($this->newExceptions[$nameLC]) === true) { - $itemInfo = array( - 'name' => $name, - 'nameLc' => $nameLC, - ); - $this->handleFeature($phpcsFile, $i, $itemInfo); - } - - // Reset for a potential multi-catch. - $name = ''; - } - } - } - - - /** - * Processes this test for when a return type token is encountered. - * - * - Detect new classes when used as a return type declaration. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - private function processReturnTypeToken(File $phpcsFile, $stackPtr) - { - $returnTypeHint = $this->getReturnTypeHintName($phpcsFile, $stackPtr); - if (empty($returnTypeHint)) { - return; - } - - $returnTypeHint = ltrim($returnTypeHint, '\\'); - $returnTypeHintLc = strtolower($returnTypeHint); - - if (isset($this->newClasses[$returnTypeHintLc]) === false) { - return; - } - - // Still here ? Then this is a return type declaration using a new class. - $itemInfo = array( - 'name' => $returnTypeHint, - 'nameLc' => $returnTypeHintLc, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newClasses[$itemInfo['nameLc']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The built-in class ' . parent::getErrorMsgTemplate(); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php deleted file mode 100644 index d2cb3feb..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewConstVisibilitySniff.php +++ /dev/null @@ -1,80 +0,0 @@ -supportsBelow('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); - - // Is the previous token a visibility indicator ? - if ($prevToken === false || isset(Tokens::$scopeModifiers[$tokens[$prevToken]['code']]) === false) { - return; - } - - // Is this a class constant ? - if ($this->isClassConstant($phpcsFile, $stackPtr) === false) { - // This may be a constant declaration in the global namespace with visibility, - // but that would throw a parse error, i.e. not our concern. - return; - } - - $phpcsFile->addError( - 'Visibility indicators for class constants are not supported in PHP 7.0 or earlier. Found "%s const"', - $stackPtr, - 'Found', - array($tokens[$prevToken]['content']) - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php deleted file mode 100644 index 9658a76f..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php +++ /dev/null @@ -1,88 +0,0 @@ -findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); - if ($nextNonEmpty === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - if ($tokens[$nextNonEmpty]['code'] !== \T_DOUBLE_COLON) { - return; - } - - $inClass = $this->inClassScope($phpcsFile, $stackPtr, false); - - if ($inClass === true && $this->supportsBelow('5.2') === true) { - $phpcsFile->addError( - 'Late static binding is not supported in PHP 5.2 or earlier.', - $stackPtr, - 'Found' - ); - } - - if ($inClass === false) { - $phpcsFile->addError( - 'Late static binding is not supported outside of class scope.', - $stackPtr, - 'OutsideClassScope' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php deleted file mode 100644 index a609acc1..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewTypedPropertiesSniff.php +++ /dev/null @@ -1,132 +0,0 @@ - \T_PRIVATE, - \T_PROTECTED => \T_PROTECTED, - \T_PUBLIC => \T_PUBLIC, - \T_STATIC => \T_STATIC, - \T_VAR => \T_VAR, - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.2.0 - * - * @return array - */ - public function register() - { - return array(\T_VARIABLE); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->isClassProperty($phpcsFile, $stackPtr) === false) { - return; - } - - $find = $this->modifierKeywords; - $find += array( - \T_SEMICOLON => \T_SEMICOLON, - \T_OPEN_CURLY_BRACKET => \T_OPEN_CURLY_BRACKET, - ); - - $tokens = $phpcsFile->getTokens(); - $modifier = $phpcsFile->findPrevious($find, ($stackPtr - 1)); - if ($modifier === false - || $tokens[$modifier]['code'] === \T_SEMICOLON - || $tokens[$modifier]['code'] === \T_OPEN_CURLY_BRACKET - ) { - // Parse error. Ignore. - return; - } - - $type = $phpcsFile->findNext(Tokens::$emptyTokens, ($modifier + 1), null, true); - if ($tokens[$type]['code'] === \T_VARIABLE) { - return; - } - - // Still here ? In that case, this will be a typed property. - if ($this->supportsBelow('7.3') === true) { - $phpcsFile->addError( - 'Typed properties are not supported in PHP 7.3 or earlier', - $type, - 'Found' - ); - } - - if ($this->supportsAbove('7.4') === true) { - // Examine the type to verify it's valid. - if ($tokens[$type]['type'] === 'T_NULLABLE' - // Needed to support PHPCS < 3.5.0 which doesn't correct to the nullable token type yet. - || $tokens[$type]['code'] === \T_INLINE_THEN - ) { - $type = $phpcsFile->findNext(Tokens::$emptyTokens, ($type + 1), null, true); - } - - $content = $tokens[$type]['content']; - if ($content === 'void' || $content === 'callable') { - $phpcsFile->addError( - '%s is not supported as a type declaration for properties', - $type, - 'InvalidType', - array($content) - ); - } - } - - $endOfStatement = $phpcsFile->findNext(\T_SEMICOLON, ($stackPtr + 1)); - if ($endOfStatement !== false) { - // Don't throw the same error multiple times for multi-property declarations. - return ($endOfStatement + 1); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php deleted file mode 100644 index 7ecfd6ca..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/RemovedOrphanedParentSniff.php +++ /dev/null @@ -1,115 +0,0 @@ - true, - 'T_ANON_CLASS' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.2.0 - * - * @return array - */ - public function register() - { - return array(\T_PARENT); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.4') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (empty($tokens[$stackPtr]['conditions']) === true) { - // Use within the global namespace. Not our concern. - return; - } - - /* - * Find the class within which this parent keyword is used. - */ - $conditions = $tokens[$stackPtr]['conditions']; - $conditions = array_reverse($conditions, true); - $classPtr = false; - - foreach ($conditions as $ptr => $type) { - if (isset($this->classScopeTokens[$tokens[$ptr]['type']])) { - $classPtr = $ptr; - break; - } - } - - if ($classPtr === false) { - // Use outside of a class scope. Not our concern. - return; - } - - if (isset($tokens[$classPtr]['scope_opener']) === false) { - // No scope opener known. Probably a parse error. - return; - } - - $extends = $phpcsFile->findNext(\T_EXTENDS, ($classPtr + 1), $tokens[$classPtr]['scope_opener']); - if ($extends !== false) { - // Class has a parent. - return; - } - - $phpcsFile->addError( - 'Using "parent" inside a class without parent is deprecated since PHP 7.4', - $stackPtr, - 'Deprecated' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php deleted file mode 100644 index 27ec4217..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewConstantsSniff.php +++ /dev/null @@ -1,3756 +0,0 @@ - array(string => bool)) - */ - protected $newConstants = array( - 'E_STRICT' => array( - '4.4' => false, - '5.0' => true, - ), - // Curl: - 'CURLOPT_FTP_USE_EPRT' => array( - '4.4' => false, - '5.0' => true, - ), - 'CURLOPT_NOSIGNAL' => array( - '4.4' => false, - '5.0' => true, - ), - 'CURLOPT_UNRESTRICTED_AUTH' => array( - '4.4' => false, - '5.0' => true, - ), - 'CURLOPT_BUFFERSIZE' => array( - '4.4' => false, - '5.0' => true, - ), - 'CURLOPT_HTTPAUTH' => array( - '4.4' => false, - '5.0' => true, - ), - 'CURLOPT_PROXYPORT' => array( - '4.4' => false, - '5.0' => true, - ), - 'CURLOPT_PROXYTYPE' => array( - '4.4' => false, - '5.0' => true, - ), - 'CURLOPT_SSLCERTTYPE' => array( - '4.4' => false, - '5.0' => true, - ), - 'CURLOPT_HTTP200ALIASES' => array( - '4.4' => false, - '5.0' => true, - ), - // OpenSSL: - 'OPENSSL_ALGO_MD2' => array( - '4.4' => false, - '5.0' => true, - ), - 'OPENSSL_ALGO_MD4' => array( - '4.4' => false, - '5.0' => true, - ), - 'OPENSSL_ALGO_MD5' => array( - '4.4' => false, - '5.0' => true, - ), - 'OPENSSL_ALGO_SHA1' => array( - '4.4' => false, - '5.0' => true, - ), - 'OPENSSL_ALGO_DSS1' => array( - '4.4' => false, - '5.0' => true, - ), - // Tokenizer: - 'T_ABSTRACT' => array( - '4.4' => false, - '5.0' => true, - ), - 'T_CATCH' => array( - '4.4' => false, - '5.0' => true, - ), - - 'SORT_LOCALE_STRING' => array( - '5.0.1' => false, - '5.0.2' => true, - ), - 'PHP_EOL' => array( - '5.0.1' => false, - '5.0.2' => true, - ), - - 'PHP_INT_MAX' => array( - '5.0.4' => false, - '5.0.5' => true, - ), - 'PHP_INT_SIZE' => array( - '5.0.4' => false, - '5.0.5' => true, - ), - - '__COMPILER_HALT_OFFSET__' => array( - '5.0' => false, - '5.1' => true, - ), - 'GLOB_ERR' => array( - '5.0' => false, - '5.1' => true, - ), - // Curl: - 'CURLOPT_AUTOREFERER' => array( - '5.0' => false, - '5.1' => true, - ), - 'CURLOPT_BINARYTRANSFER' => array( - '5.0' => false, - '5.1' => true, - ), - 'CURLOPT_COOKIESESSION' => array( - '5.0' => false, - '5.1' => true, - ), - 'CURLOPT_FTPSSLAUTH' => array( - '5.0' => false, - '5.1' => true, - ), - 'CURLOPT_PROXYAUTH' => array( - '5.0' => false, - '5.1' => true, - ), - 'CURLOPT_TIMECONDITION' => array( - '5.0' => false, - '5.1' => true, - ), - // POSIX: - 'POSIX_F_OK' => array( - '5.0' => false, - '5.1' => true, - ), - 'POSIX_R_OK' => array( - '5.0' => false, - '5.1' => true, - ), - 'POSIX_W_OK' => array( - '5.0' => false, - '5.1' => true, - ), - 'POSIX_X_OK' => array( - '5.0' => false, - '5.1' => true, - ), - 'POSIX_S_IFBLK' => array( - '5.0' => false, - '5.1' => true, - ), - 'POSIX_S_IFCHR' => array( - '5.0' => false, - '5.1' => true, - ), - 'POSIX_S_IFIFO' => array( - '5.0' => false, - '5.1' => true, - ), - 'POSIX_S_IFREG' => array( - '5.0' => false, - '5.1' => true, - ), - 'POSIX_S_IFSOCK' => array( - '5.0' => false, - '5.1' => true, - ), - // Streams: - 'STREAM_IPPROTO_ICMP' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_IPPROTO_IP' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_IPPROTO_RAW' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_IPPROTO_TCP' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_IPPROTO_UDP' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_PF_INET' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_PF_INET6' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_PF_UNIX' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_SOCK_DGRAM' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_SOCK_RAW' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_SOCK_RDM' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_SOCK_SEQPACKET' => array( - '5.0' => false, - '5.1' => true, - ), - 'STREAM_SOCK_STREAM' => array( - '5.0' => false, - '5.1' => true, - ), - // Tokenizer: - 'T_HALT_COMPILER' => array( - '5.0' => false, - '5.1' => true, - ), - - // Date/Time: - 'DATE_ATOM' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_COOKIE' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_ISO8601' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_RFC822' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_RFC850' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_RFC1036' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_RFC1123' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_RFC2822' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_RFC3339' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_RSS' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - 'DATE_W3C' => array( - '5.1.0' => false, - '5.1.1' => true, - ), - - // Date/Time: - 'SUNFUNCS_RET_TIMESTAMP' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'SUNFUNCS_RET_STRING' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'SUNFUNCS_RET_DOUBLE' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - // XSL: - 'LIBXSLT_VERSION' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'LIBXSLT_DOTTED_VERSION' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'LIBEXSLT_VERSION' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'LIBEXSLT_DOTTED_VERSION' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - // URL: - 'PHP_URL_SCHEME' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'PHP_URL_HOST' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'PHP_URL_PORT' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'PHP_URL_USER' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'PHP_URL_PASS' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'PHP_URL_PATH' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'PHP_URL_QUERY' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'PHP_URL_FRAGMENT' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'PHP_QUERY_RFC1738' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'PHP_QUERY_RFC3986' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - - // Curl: - 'CURLINFO_HEADER_OUT' => array( - '5.1.2' => false, - '5.1.3' => true, - ), - - // Core: - 'E_RECOVERABLE_ERROR' => array( - '5.1' => false, - '5.2' => true, - ), - // Math: - 'M_EULER' => array( - '5.1' => false, - '5.2' => true, - ), - 'M_LNPI' => array( - '5.1' => false, - '5.2' => true, - ), - 'M_SQRT3' => array( - '5.1' => false, - '5.2' => true, - ), - 'M_SQRTPI' => array( - '5.1' => false, - '5.2' => true, - ), - 'PATHINFO_FILENAME' => array( - '5.1' => false, - '5.2' => true, - ), - 'UPLOAD_ERR_EXTENSION' => array( - '5.1' => false, - '5.2' => true, - ), - // Curl: - 'CURLE_FILESIZE_EXCEEDED' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLE_FTP_SSL_FAILED' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLE_LDAP_INVALID_URL' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLFTPAUTH_DEFAULT' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLFTPAUTH_SSL' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLFTPAUTH_TLS' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLFTPSSL_ALL' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLFTPSSL_CONTROL' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLFTPSSL_NONE' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLFTPSSL_TRY' => array( - '5.1' => false, - '5.2' => true, - ), - 'CURLOPT_FTP_SSL' => array( - '5.1' => false, - '5.2' => true, - ), - // Ming: - 'SWFTEXTFIELD_USEFONT' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWFTEXTFIELD_AUTOSIZE' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_NOT_COMPRESSED' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_ADPCM_COMPRESSED' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_MP3_COMPRESSED' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_NOT_COMPRESSED_LE' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_NELLY_COMPRESSED' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_5KHZ' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_11KHZ' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_22KHZ' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_44KHZ' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_8BITS' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_16BITS' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_MONO' => array( - '5.1' => false, - '5.2' => true, - ), - 'SWF_SOUND_STEREO' => array( - '5.1' => false, - '5.2' => true, - ), - // OpenSSL: - 'OPENSSL_KEYTYPE_EC' => array( - '5.1' => false, - '5.2' => true, - ), - 'OPENSSL_VERSION_NUMBER' => array( - '5.1' => false, - '5.2' => true, - ), - 'OPENSSL_VERSION_TEXT' => array( - '5.1' => false, - '5.2' => true, - ), - // PCRE: - 'PREG_BACKTRACK_LIMIT_ERROR' => array( - '5.1' => false, - '5.2' => true, - ), - 'PREG_BAD_UTF8_ERROR' => array( - '5.1' => false, - '5.2' => true, - ), - 'PREG_INTERNAL_ERROR' => array( - '5.1' => false, - '5.2' => true, - ), - 'PREG_NO_ERROR' => array( - '5.1' => false, - '5.2' => true, - ), - 'PREG_RECURSION_LIMIT_ERROR' => array( - '5.1' => false, - '5.2' => true, - ), - // Snmp: - 'SNMP_OID_OUTPUT_FULL' => array( - '5.1' => false, - '5.2' => true, - ), - 'SNMP_OID_OUTPUT_NUMERIC' => array( - '5.1' => false, - '5.2' => true, - ), - // Semaphore: - 'MSG_EAGAIN' => array( - '5.1' => false, - '5.2' => true, - ), - 'MSG_ENOMSG' => array( - '5.1' => false, - '5.2' => true, - ), - - // Curl: - 'CURLOPT_TCP_NODELAY' => array( - '5.2.0' => false, - '5.2.1' => true, - ), - - // Stream: - 'STREAM_SHUT_RD' => array( - '5.2.0' => false, - '5.2.1' => true, - ), - 'STREAM_SHUT_WR' => array( - '5.2.0' => false, - '5.2.1' => true, - ), - 'STREAM_SHUT_RDWR' => array( - '5.2.0' => false, - '5.2.1' => true, - ), - - 'GMP_VERSION' => array( - '5.2.1' => false, - '5.2.2' => true, - ), - - // Curl: - 'CURLOPT_TIMEOUT_MS' => array( - '5.2.2' => false, - '5.2.3' => true, - ), - 'CURLOPT_CONNECTTIMEOUT_MS' => array( - '5.2.2' => false, - '5.2.3' => true, - ), - - // Curl: - 'CURLOPT_PRIVATE' => array( - '5.2.3' => false, - '5.2.4' => true, - ), - 'CURLINFO_PRIVATE' => array( - '5.2.3' => false, - '5.2.4' => true, - ), - // GD: - 'GD_VERSION' => array( - '5.2.3' => false, - '5.2.4' => true, - ), - 'GD_MAJOR_VERSION' => array( - '5.2.3' => false, - '5.2.4' => true, - ), - 'GD_MINOR_VERSION' => array( - '5.2.3' => false, - '5.2.4' => true, - ), - 'GD_RELEASE_VERSION' => array( - '5.2.3' => false, - '5.2.4' => true, - ), - 'GD_EXTRA_VERSION' => array( - '5.2.3' => false, - '5.2.4' => true, - ), - // PCRE: - 'PCRE_VERSION' => array( - '5.2.3' => false, - '5.2.4' => true, - ), - - 'PHP_MAJOR_VERSION' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - 'PHP_MINOR_VERSION' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - 'PHP_RELEASE_VERSION' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - 'PHP_VERSION_ID' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - 'PHP_EXTRA_VERSION' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - 'PHP_ZTS' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - 'PHP_DEBUG' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - 'FILE_BINARY' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - 'FILE_TEXT' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - // Sockets: - 'TCP_NODELAY' => array( - '5.2.6' => false, - '5.2.7' => true, - ), - - // Curl: - 'CURLOPT_PROTOCOLS' => array( - '5.2.9' => false, - '5.2.10' => true, - ), - 'CURLOPT_REDIR_PROTOCOLS' => array( - '5.2.9' => false, - '5.2.10' => true, - ), - 'CURLPROXY_SOCKS4' => array( - '5.2.9' => false, - '5.2.10' => true, - ), - - // Libxml: - 'LIBXML_PARSEHUGE' => array( - '5.2.11' => false, - '5.2.12' => true, - ), - - // Core: - 'ENT_IGNORE' => array( - '5.2' => false, - '5.3' => true, - ), - 'E_DEPRECATED' => array( - '5.2' => false, - '5.3' => true, - ), - 'E_USER_DEPRECATED' => array( - '5.2' => false, - '5.3' => true, - ), - 'INI_SCANNER_NORMAL' => array( - '5.2' => false, - '5.3' => true, - ), - 'INI_SCANNER_RAW' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_MAXPATHLEN' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_NT_DOMAIN_CONTROLLER' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_NT_SERVER' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_NT_WORKSTATION' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_VERSION_BUILD' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_VERSION_MAJOR' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_VERSION_MINOR' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_VERSION_PLATFORM' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_VERSION_PRODUCTTYPE' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_VERSION_SP_MAJOR' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_VERSION_SP_MINOR' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_WINDOWS_VERSION_SUITEMASK' => array( - '5.2' => false, - '5.3' => true, - ), - // Curl: - 'CURLINFO_CERTINFO' => array( - '5.2' => false, - '5.3' => true, - ), - 'CURLOPT_PROGRESSFUNCTION' => array( - '5.2' => false, - '5.3' => true, - ), - 'CURLE_SSH' => array( - '5.2' => false, - '5.3' => true, - ), - // GD: - 'IMG_FILTER_PIXELATE' => array( - '5.2' => false, - '5.3' => true, - ), - 'IMAGETYPE_ICO' => array( - '5.2' => false, - '5.3' => true, - ), - // Fileinfo: - 'FILEINFO_MIME_TYPE' => array( - '5.2' => false, - '5.3' => true, - ), - 'FILEINFO_MIME_ENCODING' => array( - '5.2' => false, - '5.3' => true, - ), - // JSON: - 'JSON_ERROR_CTRL_CHAR' => array( - '5.2' => false, - '5.3' => true, - ), - 'JSON_ERROR_DEPTH' => array( - '5.2' => false, - '5.3' => true, - ), - 'JSON_ERROR_NONE' => array( - '5.2' => false, - '5.3' => true, - ), - 'JSON_ERROR_STATE_MISMATCH' => array( - '5.2' => false, - '5.3' => true, - ), - 'JSON_ERROR_SYNTAX' => array( - '5.2' => false, - '5.3' => true, - ), - 'JSON_FORCE_OBJECT' => array( - '5.2' => false, - '5.3' => true, - ), - 'JSON_HEX_TAG' => array( - '5.2' => false, - '5.3' => true, - ), - 'JSON_HEX_AMP' => array( - '5.2' => false, - '5.3' => true, - ), - 'JSON_HEX_APOS' => array( - '5.2' => false, - '5.3' => true, - ), - 'JSON_HEX_QUOT' => array( - '5.2' => false, - '5.3' => true, - ), - // LDAP: - 'LDAP_OPT_NETWORK_TIMEOUT' => array( - '5.2' => false, - '5.3' => true, - ), - // Libxml: - 'LIBXML_LOADED_VERSION' => array( - '5.2' => false, - '5.3' => true, - ), - // Math: - 'PHP_ROUND_HALF_UP' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_ROUND_HALF_DOWN' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_ROUND_HALF_EVEN' => array( - '5.2' => false, - '5.3' => true, - ), - 'PHP_ROUND_HALF_ODD' => array( - '5.2' => false, - '5.3' => true, - ), - // Mysqli - 'MYSQLI_OPT_INT_AND_FLOAT_NATIVE' => array( - '5.2' => false, - '5.3' => true, - ), - 'MYSQLI_OPT_NET_CMD_BUFFER_SIZE' => array( - '5.2' => false, - '5.3' => true, - ), - 'MYSQLI_OPT_NET_READ_BUFFER_SIZE' => array( - '5.2' => false, - '5.3' => true, - ), - 'MYSQLI_OPT_SSL_VERIFY_SERVER_CERT' => array( - '5.2' => false, - '5.3' => true, - ), - // OCI8: - 'OCI_CRED_EXT' => array( - '5.2' => false, - '5.3' => true, - ), - // PCRE: - 'PREG_BAD_UTF8_OFFSET_ERROR' => array( - '5.2' => false, - '5.3' => true, - ), - // PCNTL: - 'BUS_ADRALN' => array( - '5.2' => false, - '5.3' => true, - ), - 'BUS_ADRERR' => array( - '5.2' => false, - '5.3' => true, - ), - 'BUS_OBJERR' => array( - '5.2' => false, - '5.3' => true, - ), - 'CLD_CONTIUNED' => array( - '5.2' => false, - '5.3' => true, - ), - 'CLD_DUMPED' => array( - '5.2' => false, - '5.3' => true, - ), - 'CLD_EXITED' => array( - '5.2' => false, - '5.3' => true, - ), - 'CLD_KILLED' => array( - '5.2' => false, - '5.3' => true, - ), - 'CLD_STOPPED' => array( - '5.2' => false, - '5.3' => true, - ), - 'CLD_TRAPPED' => array( - '5.2' => false, - '5.3' => true, - ), - 'FPE_FLTDIV' => array( - '5.2' => false, - '5.3' => true, - ), - 'FPE_FLTINV' => array( - '5.2' => false, - '5.3' => true, - ), - 'FPE_FLTOVF' => array( - '5.2' => false, - '5.3' => true, - ), - 'FPE_FLTRES' => array( - '5.2' => false, - '5.3' => true, - ), - 'FPE_FLTSUB' => array( - '5.2' => false, - '5.3' => true, - ), - 'FPE_FLTUND' => array( - '5.2' => false, - '5.3' => true, - ), - 'FPE_INTDIV' => array( - '5.2' => false, - '5.3' => true, - ), - 'FPE_INTOVF' => array( - '5.2' => false, - '5.3' => true, - ), - 'ILL_BADSTK' => array( - '5.2' => false, - '5.3' => true, - ), - 'ILL_COPROC' => array( - '5.2' => false, - '5.3' => true, - ), - 'ILL_ILLADR' => array( - '5.2' => false, - '5.3' => true, - ), - 'ILL_ILLOPC' => array( - '5.2' => false, - '5.3' => true, - ), - 'ILL_ILLOPN' => array( - '5.2' => false, - '5.3' => true, - ), - 'ILL_ILLTRP' => array( - '5.2' => false, - '5.3' => true, - ), - 'ILL_PRVOPC' => array( - '5.2' => false, - '5.3' => true, - ), - 'ILL_PRVREG' => array( - '5.2' => false, - '5.3' => true, - ), - 'POLL_ERR' => array( - '5.2' => false, - '5.3' => true, - ), - 'POLL_HUP' => array( - '5.2' => false, - '5.3' => true, - ), - 'POLL_IN' => array( - '5.2' => false, - '5.3' => true, - ), - 'POLL_MSG' => array( - '5.2' => false, - '5.3' => true, - ), - 'POLL_OUT' => array( - '5.2' => false, - '5.3' => true, - ), - 'POLL_PRI' => array( - '5.2' => false, - '5.3' => true, - ), - 'SEGV_ACCERR' => array( - '5.2' => false, - '5.3' => true, - ), - 'SEGV_MAPERR' => array( - '5.2' => false, - '5.3' => true, - ), - 'SI_ASYNCIO' => array( - '5.2' => false, - '5.3' => true, - ), - 'SI_KERNEL' => array( - '5.2' => false, - '5.3' => true, - ), - 'SI_MSGGQ' => array( - '5.2' => false, - '5.3' => true, - ), - 'SI_NOINFO' => array( - '5.2' => false, - '5.3' => true, - ), - 'SI_QUEUE' => array( - '5.2' => false, - '5.3' => true, - ), - 'SI_SIGIO' => array( - '5.2' => false, - '5.3' => true, - ), - 'SI_TIMER' => array( - '5.2' => false, - '5.3' => true, - ), - 'SI_TKILL' => array( - '5.2' => false, - '5.3' => true, - ), - 'SI_USER' => array( - '5.2' => false, - '5.3' => true, - ), - 'SIG_BLOCK' => array( - '5.2' => false, - '5.3' => true, - ), - 'SIG_SETMASK' => array( - '5.2' => false, - '5.3' => true, - ), - 'SIG_UNBLOCK' => array( - '5.2' => false, - '5.3' => true, - ), - 'TRAP_BRKPT' => array( - '5.2' => false, - '5.3' => true, - ), - 'TRAP_TRACE' => array( - '5.2' => false, - '5.3' => true, - ), - // Tokenizer: - 'T_DIR' => array( - '5.2' => false, - '5.3' => true, - ), - 'T_GOTO' => array( - '5.2' => false, - '5.3' => true, - ), - 'T_NAMESPACE' => array( - '5.2' => false, - '5.3' => true, - ), - 'T_NS_C' => array( - '5.2' => false, - '5.3' => true, - ), - 'T_NS_SEPARATOR' => array( - '5.2' => false, - '5.3' => true, - ), - 'T_USE' => array( - '5.2' => false, - '5.3' => true, - ), - - // OCI8: - 'OCI_NO_AUTO_COMMIT' => array( - '5.3.1' => false, - '5.3.2' => true, - ), - // OpenSSL: - 'OPENSSL_TLSEXT_SERVER_NAME' => array( - '5.3.1' => false, - '5.3.2' => true, - ), - - // JSON: - 'JSON_ERROR_UTF8' => array( - '5.3.2' => false, - '5.3.3' => true, - ), - 'JSON_NUMERIC_CHECK' => array( - '5.3.2' => false, - '5.3.3' => true, - ), - - 'DEBUG_BACKTRACE_IGNORE_ARGS' => array( - '5.3.5' => false, - '5.3.6' => true, - ), - - 'CURLINFO_REDIRECT_URL' => array( - '5.3.6' => false, - '5.3.7' => true, - ), - 'PHP_MANDIR' => array( - '5.3.6' => false, - '5.3.7' => true, - ), - - 'PHP_BINARY' => array( - '5.3' => false, - '5.4' => true, - ), - 'SORT_NATURAL' => array( - '5.3' => false, - '5.4' => true, - ), - 'SORT_FLAG_CASE' => array( - '5.3' => false, - '5.4' => true, - ), - 'ENT_HTML401' => array( - '5.3' => false, - '5.4' => true, - ), - 'ENT_XML1' => array( - '5.3' => false, - '5.4' => true, - ), - 'ENT_XHTML' => array( - '5.3' => false, - '5.4' => true, - ), - 'ENT_HTML5' => array( - '5.3' => false, - '5.4' => true, - ), - 'ENT_SUBSTITUTE' => array( - '5.3' => false, - '5.4' => true, - ), - 'ENT_DISALLOWED' => array( - '5.3' => false, - '5.4' => true, - ), - 'IPPROTO_IP' => array( - '5.3' => false, - '5.4' => true, - ), - 'IPPROTO_IPV6' => array( - '5.3' => false, - '5.4' => true, - ), - 'IPV6_MULTICAST_HOPS' => array( - '5.3' => false, - '5.4' => true, - ), - 'IPV6_MULTICAST_IF' => array( - '5.3' => false, - '5.4' => true, - ), - 'IPV6_MULTICAST_LOOP' => array( - '5.3' => false, - '5.4' => true, - ), - 'IP_MULTICAST_IF' => array( - '5.3' => false, - '5.4' => true, - ), - 'IP_MULTICAST_LOOP' => array( - '5.3' => false, - '5.4' => true, - ), - 'IP_MULTICAST_TTL' => array( - '5.3' => false, - '5.4' => true, - ), - 'MCAST_JOIN_GROUP' => array( - '5.3' => false, - '5.4' => true, - ), - 'MCAST_LEAVE_GROUP' => array( - '5.3' => false, - '5.4' => true, - ), - 'MCAST_BLOCK_SOURCE' => array( - '5.3' => false, - '5.4' => true, - ), - 'MCAST_UNBLOCK_SOURCE' => array( - '5.3' => false, - '5.4' => true, - ), - 'MCAST_JOIN_SOURCE_GROUP' => array( - '5.3' => false, - '5.4' => true, - ), - 'MCAST_LEAVE_SOURCE_GROUP' => array( - '5.3' => false, - '5.4' => true, - ), - // Curl: - 'CURLOPT_MAX_RECV_SPEED_LARGE' => array( - '5.3' => false, - '5.4' => true, - ), - 'CURLOPT_MAX_SEND_SPEED_LARGE' => array( - '5.3' => false, - '5.4' => true, - ), - // Directories: - 'SCANDIR_SORT_ASCENDING' => array( - '5.3' => false, - '5.4' => true, - ), - 'SCANDIR_SORT_DESCENDING' => array( - '5.3' => false, - '5.4' => true, - ), - 'SCANDIR_SORT_NONE' => array( - '5.3' => false, - '5.4' => true, - ), - // LibXML: - 'LIBXML_HTML_NODEFDTD' => array( - '5.3' => false, - '5.4' => true, - ), - 'LIBXML_HTML_NOIMPLIED' => array( - '5.3' => false, - '5.4' => true, - ), - 'LIBXML_PEDANTIC' => array( - '5.3' => false, - '5.4' => true, - ), - // OpenSSL: - 'OPENSSL_CIPHER_AES_128_CBC' => array( - '5.3' => false, - '5.4' => true, - ), - 'OPENSSL_CIPHER_AES_192_CBC' => array( - '5.3' => false, - '5.4' => true, - ), - 'OPENSSL_CIPHER_AES_256_CBC' => array( - '5.3' => false, - '5.4' => true, - ), - 'OPENSSL_RAW_DATA' => array( - '5.3' => false, - '5.4' => true, - ), - 'OPENSSL_ZERO_PADDING' => array( - '5.3' => false, - '5.4' => true, - ), - // Output buffering: - 'PHP_OUTPUT_HANDLER_CLEAN' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_OUTPUT_HANDLER_CLEANABLE' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_OUTPUT_HANDLER_DISABLED' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_OUTPUT_HANDLER_FINAL' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_OUTPUT_HANDLER_FLUSH' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_OUTPUT_HANDLER_FLUSHABLE' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_OUTPUT_HANDLER_REMOVABLE' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_OUTPUT_HANDLER_STARTED' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_OUTPUT_HANDLER_STDFLAGS' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_OUTPUT_HANDLER_WRITE' => array( - '5.3' => false, - '5.4' => true, - ), - // Sessions: - 'PHP_SESSION_ACTIVE' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_SESSION_DISABLED' => array( - '5.3' => false, - '5.4' => true, - ), - 'PHP_SESSION_NONE' => array( - '5.3' => false, - '5.4' => true, - ), - // Streams: - 'STREAM_META_ACCESS' => array( - '5.3' => false, - '5.4' => true, - ), - 'STREAM_META_GROUP' => array( - '5.3' => false, - '5.4' => true, - ), - 'STREAM_META_GROUP_NAME' => array( - '5.3' => false, - '5.4' => true, - ), - 'STREAM_META_OWNER' => array( - '5.3' => false, - '5.4' => true, - ), - 'STREAM_META_OWNER_NAME' => array( - '5.3' => false, - '5.4' => true, - ), - 'STREAM_META_TOUCH' => array( - '5.3' => false, - '5.4' => true, - ), - // Intl: - 'U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_CHECK_BIDI' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_CHECK_CONTEXTJ' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_NONTRANSITIONAL_TO_ASCII' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_NONTRANSITIONAL_TO_UNICODE' => array( - '5.3' => false, - '5.4' => true, - ), - 'INTL_IDNA_VARIANT_2003' => array( - '5.3' => false, - '5.4' => true, - ), - 'INTL_IDNA_VARIANT_UTS46' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_EMPTY_LABEL' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_LABEL_TOO_LONG' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_DOMAIN_NAME_TOO_LONG' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_LEADING_HYPHEN' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_TRAILING_HYPHEN' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_HYPHEN_3_4' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_LEADING_COMBINING_MARK' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_DISALLOWED' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_PUNYCODE' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_LABEL_HAS_DOT' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_INVALID_ACE_LABEL' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_BIDI' => array( - '5.3' => false, - '5.4' => true, - ), - 'IDNA_ERROR_CONTEXTJ' => array( - '5.3' => false, - '5.4' => true, - ), - // Json: - 'JSON_PRETTY_PRINT' => array( - '5.3' => false, - '5.4' => true, - ), - 'JSON_UNESCAPED_SLASHES' => array( - '5.3' => false, - '5.4' => true, - ), - 'JSON_UNESCAPED_UNICODE' => array( - '5.3' => false, - '5.4' => true, - ), - 'JSON_BIGINT_AS_STRING' => array( - '5.3' => false, - '5.4' => true, - ), - 'JSON_OBJECT_AS_ARRAY' => array( - '5.3' => false, - '5.4' => true, - ), - // Snmp: - 'SNMP_OID_OUTPUT_SUFFIX' => array( - '5.3' => false, - '5.4' => true, - ), - 'SNMP_OID_OUTPUT_MODULE' => array( - '5.3' => false, - '5.4' => true, - ), - 'SNMP_OID_OUTPUT_UCD' => array( - '5.3' => false, - '5.4' => true, - ), - 'SNMP_OID_OUTPUT_NONE' => array( - '5.3' => false, - '5.4' => true, - ), - // Tokenizer: - 'T_INSTEADOF' => array( - '5.3' => false, - '5.4' => true, - ), - 'T_TRAIT' => array( - '5.3' => false, - '5.4' => true, - ), - 'T_TRAIT_C' => array( - '5.3' => false, - '5.4' => true, - ), - - // Curl: - 'CURLINFO_PRIMARY_IP' => array( - '5.4.6' => false, - '5.4.7' => true, - ), - 'CURLINFO_PRIMARY_PORT' => array( - '5.4.6' => false, - '5.4.7' => true, - ), - 'CURLINFO_LOCAL_IP' => array( - '5.4.6' => false, - '5.4.7' => true, - ), - 'CURLINFO_LOCAL_PORT' => array( - '5.4.6' => false, - '5.4.7' => true, - ), - - // OpenSSL: - 'OPENSSL_ALGO_RMD160' => array( - '5.4.7' => false, - '5.4.8' => true, - ), - 'OPENSSL_ALGO_SHA224' => array( - '5.4.7' => false, - '5.4.8' => true, - ), - 'OPENSSL_ALGO_SHA256' => array( - '5.4.7' => false, - '5.4.8' => true, - ), - 'OPENSSL_ALGO_SHA384' => array( - '5.4.7' => false, - '5.4.8' => true, - ), - 'OPENSSL_ALGO_SHA512' => array( - '5.4.7' => false, - '5.4.8' => true, - ), - - // Filter: - 'FILTER_VALIDATE_MAC' => array( - '5.4' => false, - '5.5' => true, - ), - // GD - 'IMG_AFFINE_TRANSLATE' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_AFFINE_SCALE' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_AFFINE_ROTATE' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_AFFINE_SHEAR_HORIZONTAL' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_AFFINE_SHEAR_VERTICAL' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_CROP_DEFAULT' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_CROP_TRANSPARENT' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_CROP_BLACK' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_CROP_WHITE' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_CROP_SIDES' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_FLIP_BOTH' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_FLIP_HORIZONTAL' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_FLIP_VERTICAL' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_BELL' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_BESSEL' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_BILINEAR_FIXED' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_BICUBIC' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_BICUBIC_FIXED' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_BLACKMAN' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_BOX' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_BSPLINE' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_CATMULLROM' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_GAUSSIAN' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_GENERALIZED_CUBIC' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_HERMITE' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_HAMMING' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_HANNING' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_MITCHELL' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_POWER' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_QUADRATIC' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_SINC' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_NEAREST_NEIGHBOUR' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_WEIGHTED4' => array( - '5.4' => false, - '5.5' => true, - ), - 'IMG_TRIANGLE' => array( - '5.4' => false, - '5.5' => true, - ), - // JSON: - 'JSON_ERROR_RECURSION' => array( - '5.4' => false, - '5.5' => true, - ), - 'JSON_ERROR_INF_OR_NAN' => array( - '5.4' => false, - '5.5' => true, - ), - 'JSON_ERROR_UNSUPPORTED_TYPE' => array( - '5.4' => false, - '5.5' => true, - ), - 'JSON_PARTIAL_OUTPUT_ON_ERROR' => array( - '5.4' => false, - '5.5' => true, - ), - // MySQLi - 'MYSQLI_SERVER_PUBLIC_KEY' => array( - '5.4' => false, - '5.5' => true, - ), - // Curl: - 'CURLOPT_SHARE' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLOPT_SSL_OPTIONS' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLSSLOPT_ALLOW_BEAST' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLOPT_USERNAME' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_RESPONSE_CODE' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_HTTP_CONNECTCODE' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_HTTPAUTH_AVAIL' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_PROXYAUTH_AVAIL' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_OS_ERRNO' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_NUM_CONNECTS' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_SSL_ENGINES' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_COOKIELIST' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_FTP_ENTRY_PATH' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_APPCONNECT_TIME' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_CONDITION_UNMET' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_RTSP_CLIENT_CSEQ' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_RTSP_CSEQ_RECV' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_RTSP_SERVER_CSEQ' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLINFO_RTSP_SESSION_ID' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLMOPT_PIPELINING' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLMOPT_MAXCONNECTS' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLPAUSE_ALL' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLPAUSE_CONT' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLPAUSE_RECV' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLPAUSE_RECV_CONT' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLPAUSE_SEND' => array( - '5.4' => false, - '5.5' => true, - ), - 'CURLPAUSE_SEND_CONT' => array( - '5.4' => false, - '5.5' => true, - ), - // Soap: - 'SOAP_SSL_METHOD_TLS' => array( - '5.4' => false, - '5.5' => true, - ), - 'SOAP_SSL_METHOD_SSLv2' => array( - '5.4' => false, - '5.5' => true, - ), - 'SOAP_SSL_METHOD_SSLv3' => array( - '5.4' => false, - '5.5' => true, - ), - 'SOAP_SSL_METHOD_SSLv23' => array( - '5.4' => false, - '5.5' => true, - ), - // Tokenizer: - 'T_FINALLY' => array( - '5.4' => false, - '5.5' => true, - ), - 'T_YIELD' => array( - '5.4' => false, - '5.5' => true, - ), - // Core/Password Hashing: - 'PASSWORD_BCRYPT' => array( - '5.4' => false, - '5.5' => true, - ), - 'PASSWORD_DEFAULT' => array( - '5.4' => false, - '5.5' => true, - ), - 'PASSWORD_BCRYPT_DEFAULT_COST' => array( - '5.4' => false, - '5.5' => true, - ), - - - // Libxml: - 'LIBXML_SCHEMA_CREATE' => array( - '5.5.1' => false, - '5.5.2' => true, - ), - - // Curl: - 'CURL_SSLVERSION_TLSv1_0' => array( - '5.5.18' => false, - '5.5.19' => true, - ), - 'CURL_SSLVERSION_TLSv1_1' => array( - '5.5.18' => false, - '5.5.19' => true, - ), - 'CURL_SSLVERSION_TLSv1_2' => array( - '5.5.18' => false, - '5.5.19' => true, - ), - - 'CURLPROXY_SOCKS4A' => array( - '5.5.22' => false, - '5.5.23' => true, - ), - 'CURLPROXY_SOCKS5_HOSTNAME' => array( - '5.5.22' => false, - '5.5.23' => true, - ), - - 'CURL_VERSION_HTTP2' => array( - '5.5.23' => false, - '5.5.24' => true, - ), - - 'ARRAY_FILTER_USE_KEY' => array( - '5.5' => false, - '5.6' => true, - ), - 'ARRAY_FILTER_USE_BOTH' => array( - '5.5' => false, - '5.6' => true, - ), - // LDAP: - 'LDAP_ESCAPE_DN' => array( - '5.5' => false, - '5.6' => true, - ), - 'LDAP_ESCAPE_FILTER' => array( - '5.5' => false, - '5.6' => true, - ), - // OpenSSL: - 'OPENSSL_DEFAULT_STREAM_CIPHERS' => array( - '5.5' => false, - '5.6' => true, - ), - 'STREAM_CRYPTO_METHOD_ANY_CLIENT' => array( - '5.5' => false, - '5.6' => true, - ), - 'STREAM_CRYPTO_METHOD_ANY_SERVER' => array( - '5.5' => false, - '5.6' => true, - ), - 'STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT' => array( - '5.5' => false, - '5.6' => true, - ), - 'STREAM_CRYPTO_METHOD_TLSv1_0_SERVER' => array( - '5.5' => false, - '5.6' => true, - ), - 'STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT' => array( - '5.5' => false, - '5.6' => true, - ), - 'STREAM_CRYPTO_METHOD_TLSv1_1_SERVER' => array( - '5.5' => false, - '5.6' => true, - ), - 'STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT' => array( - '5.5' => false, - '5.6' => true, - ), - 'STREAM_CRYPTO_METHOD_TLSv1_2_SERVER' => array( - '5.5' => false, - '5.6' => true, - ), - // PostgreSQL: - 'PGSQL_CONNECT_ASYNC' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_CONNECTION_AUTH_OK' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_CONNECTION_AWAITING_RESPONSE' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_CONNECTION_MADE' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_CONNECTION_SETENV' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_CONNECTION_SSL_STARTUP' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_CONNECTION_STARTED' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_DML_ESCAPE' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_POLLING_ACTIVE' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_POLLING_FAILED' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_POLLING_OK' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_POLLING_READING' => array( - '5.5' => false, - '5.6' => true, - ), - 'PGSQL_POLLING_WRITING' => array( - '5.5' => false, - '5.6' => true, - ), - // Tokenizer: - 'T_ELLIPSIS' => array( - '5.5' => false, - '5.6' => true, - ), - 'T_POW' => array( - '5.5' => false, - '5.6' => true, - ), - 'T_POW_EQUAL' => array( - '5.5' => false, - '5.6' => true, - ), - - 'INI_SCANNER_TYPED' => array( - '5.6.0' => false, - '5.6.1' => true, - ), - - 'JSON_PRESERVE_ZERO_FRACTION' => array( - '5.6.5' => false, - '5.6.6' => true, - ), - - 'MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT' => array( - '5.6.15' => false, - '5.6.16' => true, - ), - - // GD: - // Also introduced in 7.0.10. - 'IMG_WEBP' => array( - '5.6.24' => false, - '5.6.25' => true, - ), - - - 'TOKEN_PARSE' => array( - '5.6' => false, - '7.0' => true, - ), - 'FILTER_VALIDATE_DOMAIN' => array( - '5.6' => false, - '7.0' => true, - ), - 'PHP_INT_MIN' => array( - '5.6' => false, - '7.0' => true, - ), - // Curl: - 'CURLPIPE_NOTHING' => array( - '5.6' => false, - '7.0' => true, - ), - 'CURLPIPE_HTTP1' => array( - '5.6' => false, - '7.0' => true, - ), - 'CURLPIPE_MULTIPLEX' => array( - '5.6' => false, - '7.0' => true, - ), - // JSON: - 'JSON_ERROR_INVALID_PROPERTY_NAME' => array( - '5.6' => false, - '7.0' => true, - ), - 'JSON_ERROR_UTF16' => array( - '5.6' => false, - '7.0' => true, - ), - // LibXML: - 'LIBXML_BIGLINES' => array( - '5.6' => false, - '7.0' => true, - ), - // PCRE: - 'PREG_JIT_STACKLIMIT_ERROR' => array( - '5.6' => false, - '7.0' => true, - ), - // POSIX: - 'POSIX_RLIMIT_AS' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_CORE' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_CPU' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_DATA' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_FSIZE' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_LOCKS' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_MEMLOCK' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_MSGQUEUE' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_NICE' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_NOFILE' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_NPROC' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_RSS' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_RTPRIO' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_RTTIME' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_SIGPENDING' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_STACK' => array( - '5.6' => false, - '7.0' => true, - ), - 'POSIX_RLIMIT_INFINITY' => array( - '5.6' => false, - '7.0' => true, - ), - // Tokenizer: - 'T_COALESCE' => array( - '5.6' => false, - '7.0' => true, - ), - 'T_SPACESHIP' => array( - '5.6' => false, - '7.0' => true, - ), - 'T_YIELD_FROM' => array( - '5.6' => false, - '7.0' => true, - ), - - // Zlib: - // The first three are in the PHP 5.4 changelog, but the Extension constant page says 7.0. - 'ZLIB_ENCODING_RAW' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_ENCODING_DEFLATE' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_ENCODING_GZIP' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_FILTERED' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_HUFFMAN_ONLY' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_FIXED' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_RLE' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_DEFAULT_STRATEGY' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_BLOCK' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_FINISH' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_FULL_FLUSH' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_NO_FLUSH' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_PARTIAL_FLUSH' => array( - '5.6' => false, - '7.0' => true, - ), - 'ZLIB_SYNC_FLUSH' => array( - '5.6' => false, - '7.0' => true, - ), - - 'CURL_HTTP_VERSION_2' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURL_HTTP_VERSION_2TLS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURL_REDIR_POST_301' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURL_REDIR_POST_302' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURL_REDIR_POST_303' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURL_REDIR_POST_ALL' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURL_VERSION_KERBEROS5' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURL_VERSION_PSL' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURL_VERSION_UNIX_SOCKETS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLAUTH_NEGOTIATE' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLAUTH_NTLM_WB' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLFTP_CREATE_DIR' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLFTP_CREATE_DIR_NONE' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLFTP_CREATE_DIR_RETRY' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLHEADER_SEPARATE' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLHEADER_UNIFIED' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLMOPT_MAX_HOST_CONNECTIONS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLMOPT_MAX_PIPELINE_LENGTH' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLMOPT_MAX_TOTAL_CONNECTIONS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_CONNECT_TO' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_DEFAULT_PROTOCOL' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_DNS_INTERFACE' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_DNS_LOCAL_IP4' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_DNS_LOCAL_IP6' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_EXPECT_100_TIMEOUT_MS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_HEADEROPT' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_LOGIN_OPTIONS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_PATH_AS_IS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_PINNEDPUBLICKEY' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_PIPEWAIT' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_PROXY_SERVICE_NAME' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_PROXYHEADER' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_SASL_IR' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_SERVICE_NAME' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_SSL_ENABLE_ALPN' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_SSL_ENABLE_NPN' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_SSL_FALSESTART' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_SSL_VERIFYSTATUS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_STREAM_WEIGHT' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_TCP_FASTOPEN' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_TFTP_NO_OPTIONS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_UNIX_SOCKET_PATH' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLOPT_XOAUTH2_BEARER' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLPROTO_SMB' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLPROTO_SMBS' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLPROXY_HTTP_1_0' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLSSH_AUTH_AGENT' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - 'CURLSSLOPT_NO_REVOKE' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - - 'PHP_FD_SETSIZE' => array( - '7.0' => false, - '7.1' => true, - ), - // Curl: - 'CURLMOPT_PUSHFUNCTION' => array( - '7.0' => false, - '7.1' => true, - ), - 'CURL_PUSH_OK' => array( - '7.0' => false, - '7.1' => true, - ), - 'CURL_PUSH_DENY' => array( - '7.0' => false, - '7.1' => true, - ), - // Filter: - 'FILTER_FLAG_EMAIL_UNICODE' => array( - '7.0' => false, - '7.1' => true, - ), - // GD: - 'IMAGETYPE_WEBP' => array( - '7.0' => false, - '7.1' => true, - ), - // Json: - 'JSON_UNESCAPED_LINE_TERMINATORS' => array( - '7.0' => false, - '7.1' => true, - ), - // LDAP: - 'LDAP_OPT_X_SASL_NOCANON' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_SASL_USERNAME' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_CACERTDIR' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_CACERTFILE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_CERTFILE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_CIPHER_SUITE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_KEYFILE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_RANDOM_FILE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_CRLCHECK' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_CRL_NONE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_CRL_PEER' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_CRL_ALL' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_DHFILE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_CRLFILE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_PROTOCOL_MIN' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_PROTOCOL_SSL2' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_PROTOCOL_SSL3' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_PROTOCOL_TLS1_0' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_PROTOCOL_TLS1_1' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_PROTOCOL_TLS1_2' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_TLS_PACKAGE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_KEEPALIVE_IDLE' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_KEEPALIVE_PROBES' => array( - '7.0' => false, - '7.1' => true, - ), - 'LDAP_OPT_X_KEEPALIVE_INTERVAL' => array( - '7.0' => false, - '7.1' => true, - ), - // PostgreSQL: - 'PGSQL_NOTICE_LAST' => array( - '7.0' => false, - '7.1' => true, - ), - 'PGSQL_NOTICE_ALL' => array( - '7.0' => false, - '7.1' => true, - ), - 'PGSQL_NOTICE_CLEAR' => array( - '7.0' => false, - '7.1' => true, - ), - // SPL: - 'MT_RAND_PHP' => array( - '7.0' => false, - '7.1' => true, - ), - - // SQLite3: - 'SQLITE3_DETERMINISTIC' => array( - '7.1.3' => false, - '7.1.4' => true, - ), - - // Core: - 'PHP_OS_FAMILY' => array( - '7.1' => false, - '7.2' => true, - ), - 'PHP_FLOAT_DIG' => array( - '7.1' => false, - '7.2' => true, - ), - 'PHP_FLOAT_EPSILON' => array( - '7.1' => false, - '7.2' => true, - ), - 'PHP_FLOAT_MIN' => array( - '7.1' => false, - '7.2' => true, - ), - 'PHP_FLOAT_MAX' => array( - '7.1' => false, - '7.2' => true, - ), - - // Core/Password Hashing: - 'PASSWORD_ARGON2I' => array( - '7.1' => false, - '7.2' => true, - ), - 'PASSWORD_ARGON2_DEFAULT_MEMORY_COST' => array( - '7.1' => false, - '7.2' => true, - ), - 'PASSWORD_ARGON2_DEFAULT_TIME_COST' => array( - '7.1' => false, - '7.2' => true, - ), - 'PASSWORD_ARGON2_DEFAULT_THREADS' => array( - '7.1' => false, - '7.2' => true, - ), - - // Fileinfo: - 'FILEINFO_EXTENSION' => array( - '7.1' => false, - '7.2' => true, - ), - - // GD: - 'IMG_EFFECT_MULTIPLY' => array( - '7.1' => false, - '7.2' => true, - ), - 'IMG_BMP' => array( - '7.1' => false, - '7.2' => true, - ), - - // JSON: - 'JSON_INVALID_UTF8_IGNORE' => array( - '7.1' => false, - '7.2' => true, - ), - 'JSON_INVALID_UTF8_SUBSTITUTE' => array( - '7.1' => false, - '7.2' => true, - ), - - // LDAP: - 'LDAP_EXOP_START_TLS' => array( - '7.1' => false, - '7.2' => true, - ), - 'LDAP_EXOP_MODIFY_PASSWD' => array( - '7.1' => false, - '7.2' => true, - ), - 'LDAP_EXOP_REFRESH' => array( - '7.1' => false, - '7.2' => true, - ), - 'LDAP_EXOP_WHO_AM_I' => array( - '7.1' => false, - '7.2' => true, - ), - 'LDAP_EXOP_TURN' => array( - '7.1' => false, - '7.2' => true, - ), - - // PCRE: - 'PREG_UNMATCHED_AS_NULL' => array( - '7.1' => false, - '7.2' => true, - ), - - // Sodium: - 'SODIUM_LIBRARY_VERSION' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_LIBRARY_MAJOR_VERSION' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_LIBRARY_MINOR_VERSION' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_BASE64_VARIANT_ORIGINAL' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_BASE64_VARIANT_URLSAFE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_AES256GCM_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_AES256GCM_NSECBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_AES256GCM_NPUBBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_AES256GCM_ABYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_ABYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AUTH_BYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_AUTH_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_BOX_SEALBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_BOX_SECRETKEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_BOX_PUBLICKEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_BOX_KEYPAIRBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_BOX_MACBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_BOX_NONCEBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_BOX_SEEDBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_KDF_BYTES_MIN' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_KDF_BYTES_MAX' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_KDF_CONTEXTBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_KDF_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_KX_SEEDBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_KX_SESSIONKEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_KX_PUBLICKEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_KX_SECRETKEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_KX_KEYPAIRBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_GENERICHASH_BYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_GENERICHASH_BYTES_MIN' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_GENERICHASH_BYTES_MAX' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_GENERICHASH_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MIN' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MAX' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_ALG_DEFAULT' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_SALTBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_STRPREFIX' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_MEMLIMIT_SENSITIVE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SCALARMULT_BYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SCALARMULT_SCALARBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SHORTHASH_BYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SHORTHASH_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETBOX_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETBOX_MACBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETBOX_NONCEBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SIGN_BYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SIGN_SEEDBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SIGN_SECRETKEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_SIGN_KEYPAIRBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_STREAM_NONCEBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - 'SODIUM_CRYPTO_STREAM_KEYBYTES' => array( - '7.1' => false, - '7.2' => true, - ), - - 'CURLAUTH_BEARER' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLAUTH_GSSAPI' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLE_WEIRD_SERVER_REPLY' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_APPCONNECT_TIME_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_CONNECT_TIME_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_CONTENT_LENGTH_DOWNLOAD_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_CONTENT_LENGTH_UPLOAD_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_FILETIME_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_HTTP_VERSION' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_NAMELOOKUP_TIME_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_PRETRANSFER_TIME_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_PROTOCOL' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_PROXY_SSL_VERIFYRESULT' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_REDIRECT_TIME_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_SCHEME' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_SIZE_DOWNLOAD_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_SIZE_UPLOAD_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_SPEED_DOWNLOAD_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_SPEED_UPLOAD_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_STARTTRANSFER_TIME_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLINFO_TOTAL_TIME_T' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_LOCK_DATA_CONNECT' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_LOCK_DATA_PSL' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_MAX_READ_SIZE' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_ABSTRACT_UNIX_SOCKET' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_DISALLOW_USERNAME_IN_URL' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_DNS_SHUFFLE_ADDRESSES' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_HAPROXYPROTOCOL' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_KEEP_SENDING_ON_ERROR' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PRE_PROXY' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_CAINFO' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_CAPATH' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_CRLFILE' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_KEYPASSWD' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_PINNEDPUBLICKEY' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_SSLCERT' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_SSLCERTTYPE' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_SSL_CIPHER_LIST' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_SSLKEY' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_SSLKEYTYPE' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_SSL_OPTIONS' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_SSL_VERIFYHOST' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_SSL_VERIFYPEER' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_SSLVERSION' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_TLS13_CIPHERS' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_TLSAUTH_PASSWORD' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_TLSAUTH_TYPE' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_PROXY_TLSAUTH_USERNAME' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_REQUEST_TARGET' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_SOCKS5_AUTH' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_SSH_COMPRESSION' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_SUPPRESS_CONNECT_HEADERS' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_TIMEVALUE_LARGE' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLOPT_TLS13_CIPHERS' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLPROXY_HTTPS' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURLSSH_AUTH_GSSAPI' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_SSLVERSION_MAX_DEFAULT' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_SSLVERSION_MAX_NONE' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_SSLVERSION_MAX_TLSv1_0' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_SSLVERSION_MAX_TLSv1_1' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_SSLVERSION_MAX_TLSv1_2' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_SSLVERSION_MAX_TLSv1_3' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_SSLVERSION_TLSv1_3' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_ASYNCHDNS' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_BROTLI' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_CONV' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_DEBUG' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_GSSAPI' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_GSSNEGOTIATE' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_HTTPS_PROXY' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_IDN' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_LARGEFILE' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_MULTI_SSL' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_NTLM' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_NTLM_WB' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_SPNEGO' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_SSPI' => array( - '7.2' => false, - '7.3' => true, - ), - 'CURL_VERSION_TLSAUTH_SRP' => array( - '7.2' => false, - '7.3' => true, - ), - 'FILTER_SANITIZE_ADD_SLASHES' => array( - '7.2' => false, - '7.3' => true, - ), - 'JSON_THROW_ON_ERROR' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_MANAGEDSAIT' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_PROXY_AUTHZ' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_SUBENTRIES' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_VALUESRETURNFILTER' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_ASSERT' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_PRE_READ' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_POST_READ' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_SORTREQUEST' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_SORTRESPONSE' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_PAGEDRESULTS' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_AUTHZID_REQUEST' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_AUTHZID_RESPONSE' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_SYNC' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_SYNC_STATE' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_SYNC_DONE' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_DONTUSECOPY' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_PASSWORDPOLICYREQUEST' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_PASSWORDPOLICYRESPONSE' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_X_INCREMENTAL_VALUES' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_X_DOMAIN_SCOPE' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_X_PERMISSIVE_MODIFY' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_X_SEARCH_OPTIONS' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_X_TREE_DELETE' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_X_EXTENDED_DN' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_VLVREQUEST' => array( - '7.2' => false, - '7.3' => true, - ), - 'LDAP_CONTROL_VLVRESPONSE' => array( - '7.2' => false, - '7.3' => true, - ), - 'MB_CASE_FOLD' => array( - '7.2' => false, - '7.3' => true, - ), - 'MB_CASE_UPPER_SIMPLE' => array( - '7.2' => false, - '7.3' => true, - ), - 'MB_CASE_LOWER_SIMPLE' => array( - '7.2' => false, - '7.3' => true, - ), - 'MB_CASE_TITLE_SIMPLE' => array( - '7.2' => false, - '7.3' => true, - ), - 'MB_CASE_FOLD_SIMPLE' => array( - '7.2' => false, - '7.3' => true, - ), - 'PGSQL_DIAG_SCHEMA_NAME' => array( - '7.2' => false, - '7.3' => true, - ), - 'PGSQL_DIAG_TABLE_NAME' => array( - '7.2' => false, - '7.3' => true, - ), - 'PGSQL_DIAG_COLUMN_NAME' => array( - '7.2' => false, - '7.3' => true, - ), - 'PGSQL_DIAG_DATATYPE_NAME' => array( - '7.2' => false, - '7.3' => true, - ), - 'PGSQL_DIAG_CONSTRAINT_NAME' => array( - '7.2' => false, - '7.3' => true, - ), - 'PGSQL_DIAG_SEVERITY_NONLOCALIZED' => array( - '7.2' => false, - '7.3' => true, - ), - 'PASSWORD_ARGON2ID' => array( - '7.2' => false, - '7.3' => true, - ), - 'STREAM_CRYPTO_PROTO_SSLv3' => array( - '7.2' => false, - '7.3' => true, - ), - 'STREAM_CRYPTO_PROTO_TLSv1_0' => array( - '7.2' => false, - '7.3' => true, - ), - 'STREAM_CRYPTO_PROTO_TLSv1_1' => array( - '7.2' => false, - '7.3' => true, - ), - 'STREAM_CRYPTO_PROTO_TLSv1_2' => array( - '7.2' => false, - '7.3' => true, - ), - - 'CURL_VERSION_ALTSVC' => array( - '7.3.5' => false, - '7.3.6' => true, - ), - 'CURL_VERSION_CURLDEBUG' => array( - '7.3.5' => false, - '7.3.6' => true, - ), - - 'IMG_FILTER_SCATTER' => array( - '7.3' => false, - '7.4' => true, - ), - 'MB_ONIGURUMA_VERSION' => array( - '7.3' => false, - '7.4' => true, - ), - 'SO_LABEL' => array( - '7.3' => false, - '7.4' => true, - ), - 'SO_PEERLABEL' => array( - '7.3' => false, - '7.4' => true, - ), - 'SO_LISTENQLIMIT' => array( - '7.3' => false, - '7.4' => true, - ), - 'SO_LISTENQLEN' => array( - '7.3' => false, - '7.4' => true, - ), - 'SO_USER_COOKIE' => array( - '7.3' => false, - '7.4' => true, - ), - 'PASSWORD_ARGON2_PROVIDER' => array( - '7.3' => false, - '7.4' => true, - ), - 'PHP_WINDOWS_EVENT_CTRL_C' => array( - '7.3' => false, - '7.4' => true, - ), - 'PHP_WINDOWS_EVENT_CTRL_BREAK' => array( - '7.3' => false, - '7.4' => true, - ), - 'T_BAD_CHARACTER' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_ARTICLE' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_ASIDE' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_AUDIO' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_BDI' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_CANVAS' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_COMMAND' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_DATALIST' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_DETAILS' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_DIALOG' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_FIGCAPTION' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_FIGURE' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_FOOTER' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_HEADER' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_HGROUP' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_MAIN' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_MARK' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_MENUITEM' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_METER' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_NAV' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_OUTPUT' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_PROGRESS' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_SECTION' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_SOURCE' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_SUMMARY' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_TEMPLATE' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_TIME' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_TRACK' => array( - '7.3' => false, - '7.4' => true, - ), - 'TIDY_TAG_VIDEO' => array( - '7.3' => false, - '7.4' => true, - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.1.0 - * - * @return array - */ - public function register() - { - return array(\T_STRING); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.1.0 - * - * @param \PHP_CodeSniffer_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(); - $constantName = $tokens[$stackPtr]['content']; - - if (isset($this->newConstants[$constantName]) === false) { - return; - } - - if ($this->isUseOfGlobalConstant($phpcsFile, $stackPtr) === false) { - return; - } - - $itemInfo = array( - 'name' => $constantName, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 8.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newConstants[$itemInfo['name']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 8.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The constant "%s" is not present in PHP version %s or earlier'; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php deleted file mode 100644 index ccd58641..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/NewMagicClassConstantSniff.php +++ /dev/null @@ -1,80 +0,0 @@ -supportsBelow('5.4') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (strtolower($tokens[$stackPtr]['content']) !== 'class') { - return; - } - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); - if ($prevToken === false || $tokens[$prevToken]['code'] !== \T_DOUBLE_COLON) { - return; - } - - $phpcsFile->addError( - 'The magic class constant ClassName::class was not available in PHP 5.4 or earlier', - $stackPtr, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php deleted file mode 100644 index b6c8f8d7..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Constants/RemovedConstantsSniff.php +++ /dev/null @@ -1,574 +0,0 @@ - array(string => bool|string)) - */ - protected $removedConstants = array( - // Disabled since PHP 5.3.0 due to thread safety issues. - 'FILEINFO_COMPRESS' => array( - '5.3' => true, - ), - - 'CURLOPT_CLOSEPOLICY' => array( - '5.6' => true, - ), - 'CURLCLOSEPOLICY_LEAST_RECENTLY_USED' => array( - '5.6' => true, - ), - 'CURLCLOSEPOLICY_LEAST_TRAFFIC' => array( - '5.6' => true, - ), - 'CURLCLOSEPOLICY_SLOWEST' => array( - '5.6' => true, - ), - 'CURLCLOSEPOLICY_CALLBACK' => array( - '5.6' => true, - ), - 'CURLCLOSEPOLICY_OLDEST' => array( - '5.6' => true, - ), - - 'PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT' => array( - '7.0' => true, - ), - 'T_CHARACTER' => array( - '7.0' => true, - ), - 'T_BAD_CHARACTER' => array( - '7.0' => true, - ), - - 'INTL_IDNA_VARIANT_2003' => array( - '7.2' => false, - ), - - 'MCRYPT_MODE_ECB' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_MODE_CBC' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_MODE_CFB' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_MODE_OFB' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_MODE_NOFB' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_MODE_STREAM' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_ENCRYPT' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_DECRYPT' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_DEV_RANDOM' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_DEV_URANDOM' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RAND' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_3DES' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_ARCFOUR_IV' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_ARCFOUR' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_BLOWFISH' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_CAST_128' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_CAST_256' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_CRYPT' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_DES' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_DES_COMPAT' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_ENIGMA' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_GOST' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_IDEA' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_LOKI97' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_MARS' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_PANAMA' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RIJNDAEL_128' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RIJNDAEL_192' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RIJNDAEL_256' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RC2' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RC4' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RC6' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RC6_128' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RC6_192' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_RC6_256' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_SAFER64' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_SAFER128' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_SAFERPLUS' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_SERPENT' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_SERPENT_128' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_SERPENT_192' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_SERPENT_256' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_SKIPJACK' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_TEAN' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_THREEWAY' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_TRIPLEDES' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_TWOFISH' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_TWOFISH128' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_TWOFISH192' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_TWOFISH256' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_WAKE' => array( - '7.1' => false, - '7.2' => true, - ), - 'MCRYPT_XTEA' => array( - '7.1' => false, - '7.2' => true, - ), - - 'PHPDBG_FILE' => array( - '7.3' => true, - ), - 'PHPDBG_METHOD' => array( - '7.3' => true, - ), - 'PHPDBG_LINENO' => array( - '7.3' => true, - ), - 'PHPDBG_FUNC' => array( - '7.3' => true, - ), - 'FILTER_FLAG_SCHEME_REQUIRED' => array( - '7.3' => false, - ), - 'FILTER_FLAG_HOST_REQUIRED' => array( - '7.3' => false, - ), - - 'CURLPIPE_HTTP1' => array( - '7.4' => false, - ), - 'FILTER_SANITIZE_MAGIC_QUOTES' => array( - '7.4' => false, - 'alternative' => 'FILTER_SANITIZE_ADD_SLASHES', - ), - 'IBASE_BKP_CONVERT' => array( - '7.4' => true, - ), - 'IBASE_BKP_IGNORE_CHECKSUMS' => array( - '7.4' => true, - ), - 'IBASE_BKP_IGNORE_LIMBO' => array( - '7.4' => true, - ), - 'IBASE_BKP_METADATA_ONLY' => array( - '7.4' => true, - ), - 'IBASE_BKP_NO_GARBAGE_COLLECT' => array( - '7.4' => true, - ), - 'IBASE_BKP_NON_TRANSPORTABLE' => array( - '7.4' => true, - ), - 'IBASE_BKP_OLD_DESCRIPTIONS' => array( - '7.4' => true, - ), - 'IBASE_COMMITTED' => array( - '7.4' => true, - ), - 'IBASE_CONCURRENCY' => array( - '7.4' => true, - ), - 'IBASE_CONSISTENCY' => array( - '7.4' => true, - ), - 'IBASE_DEFAULT' => array( - '7.4' => true, - ), - 'IBASE_FETCH_ARRAYS' => array( - '7.4' => true, - ), - 'IBASE_FETCH_BLOBS' => array( - '7.4' => true, - ), - 'IBASE_NOWAIT' => array( - '7.4' => true, - ), - 'IBASE_PRP_ACCESS_MODE' => array( - '7.4' => true, - ), - 'IBASE_PRP_ACTIVATE' => array( - '7.4' => true, - ), - 'IBASE_PRP_AM_READONLY' => array( - '7.4' => true, - ), - 'IBASE_PRP_AM_READWRITE' => array( - '7.4' => true, - ), - 'IBASE_PRP_DENY_NEW_ATTACHMENTS' => array( - '7.4' => true, - ), - 'IBASE_PRP_DENY_NEW_TRANSACTIONS' => array( - '7.4' => true, - ), - 'IBASE_PRP_DB_ONLINE' => array( - '7.4' => true, - ), - 'IBASE_PRP_PAGE_BUFFERS' => array( - '7.4' => true, - ), - 'IBASE_PRP_RES' => array( - '7.4' => true, - ), - 'IBASE_PRP_RES_USE_FULL' => array( - '7.4' => true, - ), - 'IBASE_PRP_RESERVE_SPACE' => array( - '7.4' => true, - ), - 'IBASE_PRP_SET_SQL_DIALECT' => array( - '7.4' => true, - ), - 'IBASE_PRP_SHUTDOWN_DB' => array( - '7.4' => true, - ), - 'IBASE_PRP_SWEEP_INTERVAL' => array( - '7.4' => true, - ), - 'IBASE_PRP_WM_ASYNC' => array( - '7.4' => true, - ), - 'IBASE_PRP_WM_SYNC' => array( - '7.4' => true, - ), - 'IBASE_PRP_WRITE_MODE' => array( - '7.4' => true, - ), - 'IBASE_READ' => array( - '7.4' => true, - ), - 'IBASE_RES_CREATE' => array( - '7.4' => true, - ), - 'IBASE_RES_DEACTIVATE_IDX' => array( - '7.4' => true, - ), - 'IBASE_RES_NO_SHADOW' => array( - '7.4' => true, - ), - 'IBASE_RES_NO_VALIDITY' => array( - '7.4' => true, - ), - 'IBASE_RES_ONE_AT_A_TIME' => array( - '7.4' => true, - ), - 'IBASE_RES_REPLACE' => array( - '7.4' => true, - ), - 'IBASE_RES_USE_ALL_SPACE' => array( - '7.4' => true, - ), - 'IBASE_RPR_CHECK_DB' => array( - '7.4' => true, - ), - 'IBASE_RPR_FULL' => array( - '7.4' => true, - ), - 'IBASE_RPR_IGNORE_CHECKSUM' => array( - '7.4' => true, - ), - 'IBASE_RPR_KILL_SHADOWS' => array( - '7.4' => true, - ), - 'IBASE_RPR_MEND_DB' => array( - '7.4' => true, - ), - 'IBASE_RPR_SWEEP_DB' => array( - '7.4' => true, - ), - 'IBASE_RPR_VALIDATE_DB' => array( - '7.4' => true, - ), - 'IBASE_STS_DATA_PAGES' => array( - '7.4' => true, - ), - 'IBASE_STS_DB_LOG' => array( - '7.4' => true, - ), - 'IBASE_STS_HDR_PAGES' => array( - '7.4' => true, - ), - 'IBASE_STS_IDX_PAGES' => array( - '7.4' => true, - ), - 'IBASE_STS_SYS_RELATIONS' => array( - '7.4' => true, - ), - 'IBASE_SVC_GET_ENV' => array( - '7.4' => true, - ), - 'IBASE_SVC_GET_ENV_LOCK' => array( - '7.4' => true, - ), - 'IBASE_SVC_GET_ENV_MSG' => array( - '7.4' => true, - ), - 'IBASE_SVC_GET_USERS' => array( - '7.4' => true, - ), - 'IBASE_SVC_IMPLEMENTATION' => array( - '7.4' => true, - ), - 'IBASE_SVC_SERVER_VERSION' => array( - '7.4' => true, - ), - 'IBASE_SVC_SVR_DB_INFO' => array( - '7.4' => true, - ), - 'IBASE_SVC_USER_DBPATH' => array( - '7.4' => true, - ), - 'IBASE_UNIXTIME' => array( - '7.4' => true, - ), - 'IBASE_WAIT' => array( - '7.4' => true, - ), - 'IBASE_WRITE' => array( - '7.4' => true, - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.1.0 - * - * @return array - */ - public function register() - { - return array(\T_STRING); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.1.0 - * - * @param \PHP_CodeSniffer_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(); - $constantName = $tokens[$stackPtr]['content']; - - if (isset($this->removedConstants[$constantName]) === false) { - return; - } - - if ($this->isUseOfGlobalConstant($phpcsFile, $stackPtr) === false) { - return; - } - - $itemInfo = array( - 'name' => $constantName, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 8.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->removedConstants[$itemInfo['name']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 8.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The constant "%s" is '; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php deleted file mode 100644 index 8d56b93a..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/DiscouragedSwitchContinueSniff.php +++ /dev/null @@ -1,238 +0,0 @@ - \T_FOR, - \T_FOREACH => \T_FOREACH, - \T_WHILE => \T_WHILE, - \T_DO => \T_DO, - \T_SWITCH => \T_SWITCH, - ); - - /** - * Tokens which start a new case within a switch. - * - * @since 8.2.0 - * - * @var array - */ - protected $caseTokens = array( - \T_CASE => \T_CASE, - \T_DEFAULT => \T_DEFAULT, - ); - - /** - * Token codes which are accepted to determine the level for the continue. - * - * This array is enriched with the arithmetic operators in the register() method. - * - * @since 8.2.0 - * - * @var array - */ - protected $acceptedLevelTokens = array( - \T_LNUMBER => \T_LNUMBER, - \T_OPEN_PARENTHESIS => \T_OPEN_PARENTHESIS, - \T_CLOSE_PARENTHESIS => \T_CLOSE_PARENTHESIS, - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.2.0 - * - * @return array - */ - public function register() - { - $this->acceptedLevelTokens += Tokens::$arithmeticTokens; - $this->acceptedLevelTokens += Tokens::$emptyTokens; - - return array(\T_SWITCH); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.3') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $switchOpener = $tokens[$stackPtr]['scope_opener']; - $switchCloser = $tokens[$stackPtr]['scope_closer']; - - // Quick check whether we need to bother with the more complex logic. - $hasContinue = $phpcsFile->findNext(\T_CONTINUE, ($switchOpener + 1), $switchCloser); - if ($hasContinue === false) { - return; - } - - $caseDefault = $switchOpener; - - do { - $caseDefault = $phpcsFile->findNext($this->caseTokens, ($caseDefault + 1), $switchCloser); - if ($caseDefault === false) { - break; - } - - if (isset($tokens[$caseDefault]['scope_opener']) === false) { - // Unknown start of the case, skip. - continue; - } - - $caseOpener = $tokens[$caseDefault]['scope_opener']; - $nextCaseDefault = $phpcsFile->findNext($this->caseTokens, ($caseDefault + 1), $switchCloser); - if ($nextCaseDefault === false) { - $caseCloser = $switchCloser; - } else { - $caseCloser = $nextCaseDefault; - } - - // Check for unscoped control structures within the case. - $controlStructure = $caseOpener; - $doCount = 0; - while (($controlStructure = $phpcsFile->findNext($this->loopStructures, ($controlStructure + 1), $caseCloser)) !== false) { - if ($tokens[$controlStructure]['code'] === \T_DO) { - $doCount++; - } - - if (isset($tokens[$controlStructure]['scope_opener'], $tokens[$controlStructure]['scope_closer']) === false) { - if ($tokens[$controlStructure]['code'] === \T_WHILE && $doCount > 0) { - // While in a do-while construct. - $doCount--; - continue; - } - - // Control structure without braces found within the case, ignore this case. - continue 2; - } - } - - // Examine the contents of the case. - $continue = $caseOpener; - - do { - $continue = $phpcsFile->findNext(\T_CONTINUE, ($continue + 1), $caseCloser); - if ($continue === false) { - break; - } - - $nextSemicolon = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($continue + 1), $caseCloser); - $codeString = ''; - for ($i = ($continue + 1); $i < $nextSemicolon; $i++) { - if (isset($this->acceptedLevelTokens[$tokens[$i]['code']]) === false) { - // Function call/variable or other token which make numeric level impossible to determine. - continue 2; - } - - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - $codeString .= $tokens[$i]['content']; - } - - $level = null; - if ($codeString !== '') { - if (is_numeric($codeString)) { - $level = (int) $codeString; - } else { - // With the above logic, the string can only contain digits and operators, eval! - $level = eval("return ( $codeString );"); - } - } - - if (isset($level) === false || $level === 0) { - $level = 1; - } - - // Examine which control structure is being targeted by the continue statement. - if (isset($tokens[$continue]['conditions']) === false) { - continue; - } - - $conditions = array_reverse($tokens[$continue]['conditions'], true); - // PHPCS adds more structures to the conditions array than we want to take into - // consideration, so clean up the array. - foreach ($conditions as $tokenPtr => $tokenCode) { - if (isset($this->loopStructures[$tokenCode]) === false) { - unset($conditions[$tokenPtr]); - } - } - - $targetCondition = \array_slice($conditions, ($level - 1), 1, true); - if (empty($targetCondition)) { - continue; - } - - $conditionToken = key($targetCondition); - if ($conditionToken === $stackPtr) { - $phpcsFile->addWarning( - "Targeting a 'switch' control structure with a 'continue' statement is strongly discouraged and will throw a warning as of PHP 7.3.", - $continue, - 'Found' - ); - } - - } while ($continue < $caseCloser); - - } while ($caseDefault < $switchCloser); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php deleted file mode 100644 index 2cfbcc53..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueOutsideLoopSniff.php +++ /dev/null @@ -1,116 +0,0 @@ - true, - \T_FOREACH => true, - \T_WHILE => true, - \T_DO => true, - \T_SWITCH => true, - ); - - /** - * Token codes which did not correctly get a condition assigned in older PHPCS versions. - * - * @since 7.0.7 - * - * @var array - */ - protected $backCompat = array( - \T_CASE => true, - \T_DEFAULT => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.7 - * - * @return array - */ - public function register() - { - return array( - \T_BREAK, - \T_CONTINUE, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.7 - * - * @param \PHP_CodeSniffer_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(); - $token = $tokens[$stackPtr]; - - // Check if the break/continue is within a valid loop structure. - if (empty($token['conditions']) === false) { - foreach ($token['conditions'] as $tokenCode) { - if (isset($this->validLoopStructures[$tokenCode]) === true) { - return; - } - } - } else { - // Deal with older PHPCS versions. - if (isset($token['scope_condition']) === true && isset($this->backCompat[$tokens[$token['scope_condition']]['code']]) === true) { - return; - } - } - - // If we're still here, no valid loop structure container has been found, so throw an error. - $error = "Using '%s' outside of a loop or switch structure is invalid"; - $isError = false; - $errorCode = 'Found'; - $data = array($token['content']); - - if ($this->supportsAbove('7.0')) { - $error .= ' and will throw a fatal error since PHP 7.0'; - $isError = true; - $errorCode = 'FatalError'; - } - - $this->addMessage($phpcsFile, $error, $stackPtr, $isError, $errorCode, $data); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php deleted file mode 100644 index f63c8488..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenBreakContinueVariableArgumentsSniff.php +++ /dev/null @@ -1,110 +0,0 @@ - 'a variable argument', - 'zeroArgument' => '0 as an argument', - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * - * @return array - */ - public function register() - { - return array(\T_BREAK, \T_CONTINUE); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('5.4') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $nextSemicolonToken = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($stackPtr), null, false); - $errorType = ''; - for ($curToken = $stackPtr + 1; $curToken < $nextSemicolonToken; $curToken++) { - if ($tokens[$curToken]['type'] === 'T_STRING') { - // If the next non-whitespace token after the string - // is an opening parenthesis then it's a function call. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, $curToken + 1, null, true); - if ($tokens[$openBracket]['code'] === \T_OPEN_PARENTHESIS) { - $errorType = 'variableArgument'; - break; - } - - } elseif (\in_array($tokens[$curToken]['type'], array('T_VARIABLE', 'T_FUNCTION', 'T_CLOSURE'), true)) { - $errorType = 'variableArgument'; - break; - - } elseif ($tokens[$curToken]['type'] === 'T_LNUMBER' && $tokens[$curToken]['content'] === '0') { - $errorType = 'zeroArgument'; - break; - } - } - - if ($errorType !== '') { - $error = 'Using %s on break or continue is forbidden since PHP 5.4'; - $errorCode = $errorType . 'Found'; - $data = array($this->errorTypes[$errorType]); - - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php deleted file mode 100644 index 26f41c07..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/ForbiddenSwitchWithMultipleDefaultBlocksSniff.php +++ /dev/null @@ -1,81 +0,0 @@ -supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $defaultToken = $stackPtr; - $defaultCount = 0; - $targetLevel = $tokens[$stackPtr]['level'] + 1; - while ($defaultCount < 2 && ($defaultToken = $phpcsFile->findNext(array(\T_DEFAULT), $defaultToken + 1, $tokens[$stackPtr]['scope_closer'])) !== false) { - // Same level or one below (= two default cases after each other). - if ($tokens[$defaultToken]['level'] === $targetLevel || $tokens[$defaultToken]['level'] === ($targetLevel + 1)) { - $defaultCount++; - } - } - - if ($defaultCount > 1) { - $phpcsFile->addError( - 'Switch statements can not have multiple default blocks since PHP 7.0', - $stackPtr, - 'Found' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php deleted file mode 100644 index 0e71a261..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewExecutionDirectivesSniff.php +++ /dev/null @@ -1,378 +0,0 @@ - array(string => bool|string|array)) - */ - protected $newDirectives = array( - 'ticks' => array( - '3.1' => false, - '4.0' => true, - 'valid_value_callback' => 'isNumeric', - ), - 'encoding' => array( - '5.2' => false, - '5.3' => '--enable-zend-multibyte', // Directive ignored unless. - '5.4' => true, - 'valid_value_callback' => 'validEncoding', - ), - 'strict_types' => array( - '5.6' => false, - '7.0' => true, - 'valid_values' => array(1), - ), - ); - - - /** - * Tokens to ignore when trying to find the value for the directive. - * - * @since 7.0.3 - * - * @var array - */ - protected $ignoreTokens = array(); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.3 - * - * @return array - */ - public function register() - { - $this->ignoreTokens = Tokens::$emptyTokens; - $this->ignoreTokens[\T_EQUAL] = \T_EQUAL; - - return array(\T_DECLARE); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_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(); - - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === true) { - $openParenthesis = $tokens[$stackPtr]['parenthesis_opener']; - $closeParenthesis = $tokens[$stackPtr]['parenthesis_closer']; - } else { - if (version_compare(PHPCSHelper::getVersion(), '2.3.4', '>=')) { - return; - } - - // Deal with PHPCS 2.3.0-2.3.3 which do not yet set the parenthesis properly for declare statements. - $openParenthesis = $phpcsFile->findNext(\T_OPEN_PARENTHESIS, ($stackPtr + 1), null, false, null, true); - if ($openParenthesis === false || isset($tokens[$openParenthesis]['parenthesis_closer']) === false) { - return; - } - $closeParenthesis = $tokens[$openParenthesis]['parenthesis_closer']; - } - - $directivePtr = $phpcsFile->findNext(\T_STRING, ($openParenthesis + 1), $closeParenthesis, false); - if ($directivePtr === false) { - return; - } - - $directiveContent = $tokens[$directivePtr]['content']; - - if (isset($this->newDirectives[$directiveContent]) === false) { - $error = 'Declare can only be used with the directives %s. Found: %s'; - $data = array( - implode(', ', array_keys($this->newDirectives)), - $directiveContent, - ); - - $phpcsFile->addError($error, $stackPtr, 'InvalidDirectiveFound', $data); - - } else { - // Check for valid directive for version. - $itemInfo = array( - 'name' => $directiveContent, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - - // Check for valid directive value. - $valuePtr = $phpcsFile->findNext($this->ignoreTokens, $directivePtr + 1, $closeParenthesis, true); - if ($valuePtr === false) { - return; - } - - $this->addWarningOnInvalidValue($phpcsFile, $valuePtr, $directiveContent); - } - } - - - /** - * Determine whether an error/warning should be thrown for an item based on collected information. - * - * @since 7.1.0 - * - * @param array $errorInfo Detail information about an item. - * - * @return bool - */ - protected function shouldThrowError(array $errorInfo) - { - return ($errorInfo['not_in_version'] !== '' || $errorInfo['conditional_version'] !== ''); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newDirectives[$itemInfo['name']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array( - 'valid_value_callback', - 'valid_values', - ); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - $errorInfo['conditional_version'] = ''; - $errorInfo['condition'] = ''; - - $versionArray = $this->getVersionArray($itemArray); - - if (empty($versionArray) === false) { - foreach ($versionArray as $version => $present) { - if (\is_string($present) === true && $this->supportsBelow($version) === true) { - // We cannot test for compilation option (ok, except by scraping the output of phpinfo...). - $errorInfo['conditional_version'] = $version; - $errorInfo['condition'] = $present; - } - } - } - - return $errorInfo; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'Directive ' . parent::getErrorMsgTemplate(); - } - - - /** - * Generates the error or warning for this item. - * - * @since 7.0.3 - * @since 7.1.0 This method now overloads the method from the `AbstractNewFeatureSniff` class. - * - Renamed from `maybeAddError()` to `addError()`. - * - Changed visibility from `protected` to `public`. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the relevant token in - * the stack. - * @param array $itemInfo Base information about the item. - * @param array $errorInfo Array with detail (version) information - * relevant to the item. - * - * @return void - */ - public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) - { - if ($errorInfo['not_in_version'] !== '') { - parent::addError($phpcsFile, $stackPtr, $itemInfo, $errorInfo); - } elseif ($errorInfo['conditional_version'] !== '') { - $error = 'Directive %s is present in PHP version %s but will be disregarded unless PHP is compiled with %s'; - $errorCode = $this->stringToErrorCode($itemInfo['name']) . 'WithConditionFound'; - $data = array( - $itemInfo['name'], - $errorInfo['conditional_version'], - $errorInfo['condition'], - ); - - $phpcsFile->addWarning($error, $stackPtr, $errorCode, $data); - } - } - - - /** - * Generates a error or warning for this sniff. - * - * @since 7.0.3 - * @since 7.0.6 Renamed from `addErrorOnInvalidValue()` to `addWarningOnInvalidValue()`. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the execution directive value - * in the token array. - * @param string $directive The directive. - * - * @return void - */ - protected function addWarningOnInvalidValue(File $phpcsFile, $stackPtr, $directive) - { - $tokens = $phpcsFile->getTokens(); - - $value = $tokens[$stackPtr]['content']; - if (isset(Tokens::$stringTokens[$tokens[$stackPtr]['code']]) === true) { - $value = $this->stripQuotes($value); - } - - $isError = false; - if (isset($this->newDirectives[$directive]['valid_values'])) { - if (\in_array($value, $this->newDirectives[$directive]['valid_values']) === false) { - $isError = true; - } - } elseif (isset($this->newDirectives[$directive]['valid_value_callback'])) { - $valid = \call_user_func(array($this, $this->newDirectives[$directive]['valid_value_callback']), $value); - if ($valid === false) { - $isError = true; - } - } - - if ($isError === true) { - $error = 'The execution directive %s does not seem to have a valid value. Please review. Found: %s'; - $errorCode = $this->stringToErrorCode($directive) . 'InvalidValueFound'; - $data = array( - $directive, - $value, - ); - - $phpcsFile->addWarning($error, $stackPtr, $errorCode, $data); - } - } - - - /** - * Check whether a value is numeric. - * - * Callback function to test whether the value for an execution directive is valid. - * - * @since 7.0.3 - * - * @param mixed $value The value to test. - * - * @return bool - */ - protected function isNumeric($value) - { - return is_numeric($value); - } - - - /** - * Check whether a value is a valid encoding. - * - * Callback function to test whether the value for an execution directive is valid. - * - * @since 7.0.3 - * - * @param mixed $value The value to test. - * - * @return bool - */ - protected function validEncoding($value) - { - static $encodings; - if (isset($encodings) === false && function_exists('mb_list_encodings')) { - $encodings = mb_list_encodings(); - } - - if (empty($encodings) || \is_array($encodings) === false) { - // If we can't test the encoding, let it pass through. - return true; - } - - return \in_array($value, $encodings, true); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php deleted file mode 100644 index a2227692..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewForeachExpressionReferencingSniff.php +++ /dev/null @@ -1,99 +0,0 @@ -supportsBelow('5.4') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { - return; - } - - $opener = $tokens[$stackPtr]['parenthesis_opener']; - $closer = $tokens[$stackPtr]['parenthesis_closer']; - - $asToken = $phpcsFile->findNext(\T_AS, ($opener + 1), $closer); - if ($asToken === false) { - return; - } - - /* - * Note: referencing $key is not allowed in any version, so this should only find referenced $values. - * If it does find a referenced key, it would be a parse error anyway. - */ - $hasReference = $phpcsFile->findNext(\T_BITWISE_AND, ($asToken + 1), $closer); - if ($hasReference === false) { - return; - } - - $nestingLevel = 0; - if ($asToken !== ($opener + 1) && isset($tokens[$opener + 1]['nested_parenthesis'])) { - $nestingLevel = \count($tokens[$opener + 1]['nested_parenthesis']); - } - - if ($this->isVariable($phpcsFile, ($opener + 1), $asToken, $nestingLevel) === true) { - return; - } - - // Non-variable detected before the `as` keyword. - $phpcsFile->addError( - 'Referencing $value is only possible if the iterated array is a variable in PHP 5.4 or earlier.', - $hasReference, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php deleted file mode 100644 index 2398cf17..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewListInForeachSniff.php +++ /dev/null @@ -1,84 +0,0 @@ -supportsBelow('5.4') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { - return; - } - - $opener = $tokens[$stackPtr]['parenthesis_opener']; - $closer = $tokens[$stackPtr]['parenthesis_closer']; - - $asToken = $phpcsFile->findNext(\T_AS, ($opener + 1), $closer); - if ($asToken === false) { - return; - } - - $hasList = $phpcsFile->findNext(array(\T_LIST, \T_OPEN_SHORT_ARRAY), ($asToken + 1), $closer); - if ($hasList === false) { - return; - } - - $phpcsFile->addError( - 'Unpacking nested arrays with list() in a foreach is not supported in PHP 5.4 or earlier.', - $hasList, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php deleted file mode 100644 index 256f37ff..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ControlStructures/NewMultiCatchSniff.php +++ /dev/null @@ -1,78 +0,0 @@ -supportsBelow('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Bow out during live coding. - if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { - return; - } - - $hasBitwiseOr = $phpcsFile->findNext(\T_BITWISE_OR, $token['parenthesis_opener'], $token['parenthesis_closer']); - - if ($hasBitwiseOr === false) { - return; - } - - $phpcsFile->addError( - 'Catching multiple exceptions within one statement is not supported in PHP 7.0 or earlier.', - $hasBitwiseOr, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php deleted file mode 100644 index 13f5dfce..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Extensions/RemovedExtensionsSniff.php +++ /dev/null @@ -1,346 +0,0 @@ - - * - * - * - * - * - * @since 7.0.2 - * - * @var array - */ - public $functionWhitelist; - - /** - * A list of removed extensions with their alternative, if any. - * - * The array lists : version number with false (deprecated) and true (removed). - * If's sufficient to list the first version where the extension was deprecated/removed. - * - * @since 5.5 - * - * @var array(string => array(string => bool|string|null)) - */ - protected $removedExtensions = array( - 'activescript' => array( - '5.1' => true, - 'alternative' => 'pecl/activescript', - ), - 'cpdf' => array( - '5.1' => true, - 'alternative' => 'pecl/pdflib', - ), - 'dbase' => array( - '5.3' => true, - 'alternative' => null, - ), - 'dbx' => array( - '5.1' => true, - 'alternative' => 'pecl/dbx', - ), - 'dio' => array( - '5.1' => true, - 'alternative' => 'pecl/dio', - ), - 'ereg' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'pcre', - ), - 'fam' => array( - '5.1' => true, - 'alternative' => null, - ), - 'fbsql' => array( - '5.3' => true, - 'alternative' => null, - ), - 'fdf' => array( - '5.3' => true, - 'alternative' => 'pecl/fdf', - ), - 'filepro' => array( - '5.2' => true, - 'alternative' => null, - ), - 'hw_api' => array( - '5.2' => true, - 'alternative' => null, - ), - 'ibase' => array( - '7.4' => true, - 'alternative' => 'pecl/ibase', - ), - 'ingres' => array( - '5.1' => true, - 'alternative' => 'pecl/ingres', - ), - 'ircg' => array( - '5.1' => true, - 'alternative' => null, - ), - 'mcrypt' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'openssl (preferred) or pecl/mcrypt once available', - ), - 'mcve' => array( - '5.1' => true, - 'alternative' => 'pecl/mcve', - ), - 'ming' => array( - '5.3' => true, - 'alternative' => 'pecl/ming', - ), - 'mnogosearch' => array( - '5.1' => true, - 'alternative' => null, - ), - 'msql' => array( - '5.3' => true, - 'alternative' => null, - ), - 'mssql' => array( - '7.0' => true, - 'alternative' => null, - ), - 'mysql_' => array( - '5.5' => false, - '7.0' => true, - 'alternative' => 'mysqli', - ), - 'ncurses' => array( - '5.3' => true, - 'alternative' => 'pecl/ncurses', - ), - 'oracle' => array( - '5.1' => true, - 'alternative' => 'oci8 or pdo_oci', - ), - 'ovrimos' => array( - '5.1' => true, - 'alternative' => null, - ), - 'pfpro_' => array( - '5.1' => true, - 'alternative' => null, - ), - 'recode' => array( - '7.4' => true, - 'alternative' => 'iconv or mbstring', - ), - 'sqlite' => array( - '5.4' => true, - 'alternative' => null, - ), - // Has to be before `sybase` as otherwise it will never match. - 'sybase_ct' => array( - '7.0' => true, - 'alternative' => null, - ), - 'sybase' => array( - '5.3' => true, - 'alternative' => 'sybase_ct', - ), - 'w32api' => array( - '5.1' => true, - 'alternative' => 'pecl/ffi', - ), - 'wddx' => array( - '7.4' => true, - 'alternative' => 'pecl/wddx', - ), - 'yp' => array( - '5.1' => true, - 'alternative' => null, - ), - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of function names. - $this->removedExtensions = $this->arrayKeysToLowercase($this->removedExtensions); - - return array(\T_STRING); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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(); - - // Find the next non-empty token. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($tokens[$openBracket]['code'] !== \T_OPEN_PARENTHESIS) { - // Not a function call. - return; - } - - if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { - // Not a function call. - return; - } - - // Find the previous non-empty token. - $search = Tokens::$emptyTokens; - $search[] = \T_BITWISE_AND; - $previous = $phpcsFile->findPrevious($search, ($stackPtr - 1), null, true); - if ($tokens[$previous]['code'] === \T_FUNCTION) { - // It's a function definition, not a function call. - return; - } - - if ($tokens[$previous]['code'] === \T_NEW) { - // We are creating an object, not calling a function. - return; - } - - if ($tokens[$previous]['code'] === \T_OBJECT_OPERATOR) { - // We are calling a method of an object. - return; - } - - $function = $tokens[$stackPtr]['content']; - $functionLc = strtolower($function); - - if ($this->isWhiteListed($functionLc) === true) { - // Function is whitelisted. - return; - } - - foreach ($this->removedExtensions as $extension => $versionList) { - if (strpos($functionLc, $extension) === 0) { - $itemInfo = array( - 'name' => $extension, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - break; - } - } - } - - - /** - * Is the current function being checked whitelisted ? - * - * Parsing the list late as it may be provided as a property, but also inline. - * - * @since 7.0.2 - * - * @param string $content Content of the current token. - * - * @return bool - */ - protected function isWhiteListed($content) - { - if (isset($this->functionWhitelist) === false) { - return false; - } - - if (\is_string($this->functionWhitelist) === true) { - if (strpos($this->functionWhitelist, ',') !== false) { - $this->functionWhitelist = explode(',', $this->functionWhitelist); - } else { - $this->functionWhitelist = (array) $this->functionWhitelist; - } - } - - if (\is_array($this->functionWhitelist) === true) { - $this->functionWhitelist = array_map('strtolower', $this->functionWhitelist); - return \in_array($content, $this->functionWhitelist, true); - } - - return false; - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->removedExtensions[$itemInfo['name']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return "Extension '%s' is "; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php deleted file mode 100644 index 0f52af71..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParameterShadowSuperGlobalsSniff.php +++ /dev/null @@ -1,79 +0,0 @@ -supportsAbove('5.4') === false) { - return; - } - - // Get all parameters from function signature. - $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); - if (empty($parameters) || \is_array($parameters) === false) { - return; - } - - foreach ($parameters as $param) { - if (isset($this->superglobals[$param['name']]) === true) { - $error = 'Parameter shadowing super global (%s) causes fatal error since PHP 5.4'; - $errorCode = $this->stringToErrorCode(substr($param['name'], 1)) . 'Found'; - $data = array($param['name']); - - $phpcsFile->addError($error, $param['token'], $errorCode, $data); - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php deleted file mode 100644 index e94461ca..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenParametersWithSameNameSniff.php +++ /dev/null @@ -1,88 +0,0 @@ -supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - // Skip function without body. - if (isset($token['scope_opener']) === false) { - return; - } - - // Get all parameters from method signature. - $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); - if (empty($parameters) || \is_array($parameters) === false) { - return; - } - - $paramNames = array(); - foreach ($parameters as $param) { - $paramNames[] = $param['name']; - } - - if (\count($paramNames) !== \count(array_unique($paramNames))) { - $phpcsFile->addError( - 'Functions can not have multiple parameters with the same name since PHP 7.0', - $stackPtr, - 'Found' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php deleted file mode 100644 index 1625a4fa..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenToStringParametersSniff.php +++ /dev/null @@ -1,99 +0,0 @@ - true, - 'T_INTERFACE' => true, - 'T_TRAIT' => true, - 'T_ANON_CLASS' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.2.0 - * - * @return array - */ - public function register() - { - return array(\T_FUNCTION); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('5.3') === false) { - return; - } - - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if (strtolower($functionName) !== '__tostring') { - // Not the right function. - return; - } - - if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) === false) { - // Function, not method. - return; - } - - $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); - if (empty($params)) { - // Function declared without parameters. - return; - } - - $phpcsFile->addError( - 'The __toString() magic method can no longer accept arguments since PHP 5.3', - $stackPtr, - 'Declared' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php deleted file mode 100644 index 2e72c05e..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenVariableNamesInClosureUseSniff.php +++ /dev/null @@ -1,122 +0,0 @@ -supportsAbove('7.1') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - // Verify this use statement is used with a closure - if so, it has to have parenthesis before it. - $previousNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); - if ($previousNonEmpty === false || $tokens[$previousNonEmpty]['code'] !== \T_CLOSE_PARENTHESIS - || isset($tokens[$previousNonEmpty]['parenthesis_opener']) === false - ) { - return; - } - - // ... and (a variable within) parenthesis after it. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { - return; - } - - if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) { - // Live coding. - return; - } - - $closurePtr = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($tokens[$previousNonEmpty]['parenthesis_opener'] - 1), null, true); - if ($closurePtr === false || $tokens[$closurePtr]['code'] !== \T_CLOSURE) { - return; - } - - // Get the parameters declared by the closure. - $closureParams = PHPCSHelper::getMethodParameters($phpcsFile, $closurePtr); - - $errorMsg = 'Variables bound to a closure via the use construct cannot use the same name as superglobals, $this, or a declared parameter since PHP 7.1. Found: %s'; - - for ($i = ($nextNonEmpty + 1); $i < $tokens[$nextNonEmpty]['parenthesis_closer']; $i++) { - if ($tokens[$i]['code'] !== \T_VARIABLE) { - continue; - } - - $variableName = $tokens[$i]['content']; - - if ($variableName === '$this') { - $phpcsFile->addError($errorMsg, $i, 'FoundThis', array($variableName)); - continue; - } - - if (isset($this->superglobals[$variableName]) === true) { - $phpcsFile->addError($errorMsg, $i, 'FoundSuperglobal', array($variableName)); - continue; - } - - // Check whether it is one of the parameters declared by the closure. - if (empty($closureParams) === false) { - foreach ($closureParams as $param) { - if ($param['name'] === $variableName) { - $phpcsFile->addError($errorMsg, $i, 'FoundShadowParam', array($variableName)); - continue 2; - } - } - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php deleted file mode 100644 index b71bb320..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewClosureSniff.php +++ /dev/null @@ -1,264 +0,0 @@ -supportsBelow('5.2')) { - $phpcsFile->addError( - 'Closures / anonymous functions are not available in PHP 5.2 or earlier', - $stackPtr, - 'Found' - ); - } - - /* - * Closures can only be declared as static since PHP 5.4. - */ - $isStatic = $this->isClosureStatic($phpcsFile, $stackPtr); - if ($this->supportsBelow('5.3') && $isStatic === true) { - $phpcsFile->addError( - 'Closures / anonymous functions could not be declared as static in PHP 5.3 or earlier', - $stackPtr, - 'StaticFound' - ); - } - - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { - // Live coding or parse error. - return; - } - - $scopeStart = ($tokens[$stackPtr]['scope_opener'] + 1); - $scopeEnd = $tokens[$stackPtr]['scope_closer']; - $usesThis = $this->findThisUsageInClosure($phpcsFile, $scopeStart, $scopeEnd); - - if ($this->supportsBelow('5.3')) { - /* - * Closures declared within classes only have access to $this since PHP 5.4. - */ - if ($usesThis !== false) { - $thisFound = $usesThis; - do { - $phpcsFile->addError( - 'Closures / anonymous functions did not have access to $this in PHP 5.3 or earlier', - $thisFound, - 'ThisFound' - ); - - $thisFound = $this->findThisUsageInClosure($phpcsFile, ($thisFound + 1), $scopeEnd); - - } while ($thisFound !== false); - } - - /* - * Closures declared within classes only have access to self/parent/static since PHP 5.4. - */ - $usesClassRef = $this->findClassRefUsageInClosure($phpcsFile, $scopeStart, $scopeEnd); - - if ($usesClassRef !== false) { - do { - $phpcsFile->addError( - 'Closures / anonymous functions could not use "%s::" in PHP 5.3 or earlier', - $usesClassRef, - 'ClassRefFound', - array(strtolower($tokens[$usesClassRef]['content'])) - ); - - $usesClassRef = $this->findClassRefUsageInClosure($phpcsFile, ($usesClassRef + 1), $scopeEnd); - - } while ($usesClassRef !== false); - } - } - - /* - * Check for correct usage. - */ - if ($this->supportsAbove('5.4') && $usesThis !== false) { - - $thisFound = $usesThis; - - do { - /* - * Closures only have access to $this if not declared as static. - */ - if ($isStatic === true) { - $phpcsFile->addError( - 'Closures / anonymous functions declared as static do not have access to $this', - $thisFound, - 'ThisFoundInStatic' - ); - } - - /* - * Closures only have access to $this if used within a class context. - */ - elseif ($this->inClassScope($phpcsFile, $stackPtr, false) === false) { - $phpcsFile->addWarning( - 'Closures / anonymous functions only have access to $this if used within a class or when bound to an object using bindTo(). Please verify.', - $thisFound, - 'ThisFoundOutsideClass' - ); - } - - $thisFound = $this->findThisUsageInClosure($phpcsFile, ($thisFound + 1), $scopeEnd); - - } while ($thisFound !== false); - } - - // Prevent double reporting for nested closures. - return $scopeEnd; - } - - - /** - * Check whether the closure is declared as static. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return bool - */ - protected function isClosureStatic(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); - - return ($prevToken !== false && $tokens[$prevToken]['code'] === \T_STATIC); - } - - - /** - * Check if the code within a closure uses the $this variable. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $startToken The position within the closure to continue searching from. - * @param int $endToken The closure scope closer to stop searching at. - * - * @return int|false The stackPtr to the first $this usage if found or false if - * $this is not used. - */ - protected function findThisUsageInClosure(File $phpcsFile, $startToken, $endToken) - { - // Make sure the $startToken is valid. - if ($startToken >= $endToken) { - return false; - } - - return $phpcsFile->findNext( - \T_VARIABLE, - $startToken, - $endToken, - false, - '$this' - ); - } - - /** - * Check if the code within a closure uses "self/parent/static". - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $startToken The position within the closure to continue searching from. - * @param int $endToken The closure scope closer to stop searching at. - * - * @return int|false The stackPtr to the first classRef usage if found or false if - * they are not used. - */ - protected function findClassRefUsageInClosure(File $phpcsFile, $startToken, $endToken) - { - // Make sure the $startToken is valid. - if ($startToken >= $endToken) { - return false; - } - - $tokens = $phpcsFile->getTokens(); - $classRef = $phpcsFile->findNext(array(\T_SELF, \T_PARENT, \T_STATIC), $startToken, $endToken); - - if ($classRef === false || $tokens[$classRef]['code'] !== \T_STATIC) { - return $classRef; - } - - // T_STATIC, make sure it is used as a class reference. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($classRef + 1), $endToken, true); - if ($next === false || $tokens[$next]['code'] !== \T_DOUBLE_COLON) { - return false; - } - - return $classRef; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php deleted file mode 100644 index 05648961..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewExceptionsFromToStringSniff.php +++ /dev/null @@ -1,171 +0,0 @@ - true, - 'T_TRAIT' => true, - 'T_ANON_CLASS' => true, - ); - - /** - * Tokens which should be ignored when they preface a function declaration - * when trying to find the docblock (if any). - * - * Array will be added to in the register() method. - * - * @since 9.3.0 - * - * @var array - */ - private $docblockIgnoreTokens = array( - \T_WHITESPACE => \T_WHITESPACE, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.2.0 - * - * @return array - */ - public function register() - { - // Enhance the array of tokens to ignore for finding the docblock. - $this->docblockIgnoreTokens += Tokens::$methodPrefixes; - if (isset(Tokens::$phpcsCommentTokens)) { - $this->docblockIgnoreTokens += Tokens::$phpcsCommentTokens; - } - - return array(\T_FUNCTION); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsBelow('7.3') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { - // Abstract function, interface function, live coding or parse error. - return; - } - - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if (strtolower($functionName) !== '__tostring') { - // Not the right function. - return; - } - - if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) === false) { - // Function, not method. - return; - } - - /* - * Examine the content of the function. - */ - $error = 'Throwing exceptions from __toString() was not allowed prior to PHP 7.4'; - $throwPtr = $tokens[$stackPtr]['scope_opener']; - $errorThrown = false; - - do { - $throwPtr = $phpcsFile->findNext(\T_THROW, ($throwPtr + 1), $tokens[$stackPtr]['scope_closer']); - if ($throwPtr === false) { - break; - } - - $conditions = $tokens[$throwPtr]['conditions']; - $conditions = array_reverse($conditions, true); - $inTryCatch = false; - foreach ($conditions as $ptr => $type) { - if ($type === \T_TRY) { - $inTryCatch = true; - break; - } - - if ($ptr === $stackPtr) { - // Don't check the conditions outside the function scope. - break; - } - } - - if ($inTryCatch === false) { - $phpcsFile->addError($error, $throwPtr, 'Found'); - $errorThrown = true; - } - } while (true); - - if ($errorThrown === true) { - // We've already thrown an error for this method, no need to examine the docblock. - return; - } - - /* - * Check whether the function has a docblock and if so, whether it contains a @throws tag. - * - * {@internal This can be partially replaced by the findCommentAboveFunction() - * utility function in due time.} - */ - $commentEnd = $phpcsFile->findPrevious($this->docblockIgnoreTokens, ($stackPtr - 1), null, true); - if ($commentEnd === false || $tokens[$commentEnd]['code'] !== \T_DOC_COMMENT_CLOSE_TAG) { - return; - } - - $commentStart = $tokens[$commentEnd]['comment_opener']; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] !== '@throws') { - continue; - } - - // Found a throws tag. - $phpcsFile->addError($error, $stackPtr, 'ThrowsTagFoundInDocblock'); - break; - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php deleted file mode 100644 index 8dc0c416..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php +++ /dev/null @@ -1,169 +0,0 @@ -supportsBelow('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $tokenCode = $tokens[$stackPtr]['code']; - - if ($tokenCode === \T_FUNCTION || $tokenCode === \T_CLOSURE) { - $this->processFunctionDeclaration($phpcsFile, $stackPtr); - - // Deal with older PHPCS version which don't recognize return type hints - // as well as newer PHPCS versions (3.3.0+) where the tokenization has changed. - $returnTypeHint = $this->getReturnTypeHintToken($phpcsFile, $stackPtr); - if ($returnTypeHint !== false) { - $this->processReturnType($phpcsFile, $returnTypeHint); - } - } else { - $this->processReturnType($phpcsFile, $stackPtr); - } - } - - - /** - * Process this test for function tokens. - * - * @since 7.0.7 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - protected function processFunctionDeclaration(File $phpcsFile, $stackPtr) - { - $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); - - if (empty($params) === false && \is_array($params)) { - foreach ($params as $param) { - if ($param['nullable_type'] === true) { - $phpcsFile->addError( - 'Nullable type declarations are not supported in PHP 7.0 or earlier. Found: %s', - $param['token'], - 'typeDeclarationFound', - array($param['type_hint']) - ); - } - } - } - } - - - /** - * Process this test for return type tokens. - * - * @since 7.0.7 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - protected function processReturnType(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[($stackPtr - 1)]['code']) === false) { - return; - } - - $previous = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - // Deal with namespaced class names. - if ($tokens[$previous]['code'] === \T_NS_SEPARATOR) { - $validTokens = Tokens::$emptyTokens; - $validTokens[\T_STRING] = true; - $validTokens[\T_NS_SEPARATOR] = true; - - $stackPtr--; - - while (isset($validTokens[$tokens[($stackPtr - 1)]['code']]) === true) { - $stackPtr--; - } - - $previous = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - } - - // T_NULLABLE token was introduced in PHPCS 2.7.2. Before that it identified as T_INLINE_THEN. - if ((\defined('T_NULLABLE') === true && $tokens[$previous]['type'] === 'T_NULLABLE') - || (\defined('T_NULLABLE') === false && $tokens[$previous]['code'] === \T_INLINE_THEN) - ) { - $phpcsFile->addError( - 'Nullable return types are not supported in PHP 7.0 or earlier.', - $stackPtr, - 'returnTypeFound' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php deleted file mode 100644 index 6ad98b6a..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewParamTypeDeclarationsSniff.php +++ /dev/null @@ -1,237 +0,0 @@ - array(string => bool)) - */ - protected $newTypes = array( - 'array' => array( - '5.0' => false, - '5.1' => true, - ), - 'self' => array( - '5.1' => false, - '5.2' => true, - ), - 'parent' => array( - '5.1' => false, - '5.2' => true, - ), - 'callable' => array( - '5.3' => false, - '5.4' => true, - ), - 'int' => array( - '5.6' => false, - '7.0' => true, - ), - 'float' => array( - '5.6' => false, - '7.0' => true, - ), - 'bool' => array( - '5.6' => false, - '7.0' => true, - ), - 'string' => array( - '5.6' => false, - '7.0' => true, - ), - 'iterable' => array( - '7.0' => false, - '7.1' => true, - ), - 'object' => array( - '7.1' => false, - '7.2' => true, - ), - ); - - - /** - * Invalid types - * - * The array lists : the invalid type hint => what was probably intended/alternative. - * - * @since 7.0.3 - * - * @var array(string => string) - */ - protected $invalidTypes = array( - 'static' => 'self', - 'boolean' => 'bool', - 'integer' => 'int', - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.0 - * @since 7.1.3 Now also checks closures. - * - * @return array - */ - public function register() - { - return array( - \T_FUNCTION, - \T_CLOSURE, - ); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.0 - * @since 7.0.3 - Added check for non-scalar type declarations. - * - Added check for invalid type declarations. - * - Added check for usage of `self` type declaration outside - * class scope. - * @since 8.2.0 Added check for `parent` type declaration outside class scope. - * - * @param \PHP_CodeSniffer_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) - { - // Get all parameters from method signature. - $paramNames = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); - if (empty($paramNames)) { - return; - } - - $supportsPHP4 = $this->supportsBelow('4.4'); - - foreach ($paramNames as $param) { - if ($param['type_hint'] === '') { - continue; - } - - // Strip off potential nullable indication. - $typeHint = ltrim($param['type_hint'], '?'); - - if ($supportsPHP4 === true) { - $phpcsFile->addError( - 'Type declarations were not present in PHP 4.4 or earlier.', - $param['token'], - 'TypeHintFound' - ); - - } elseif (isset($this->newTypes[$typeHint])) { - $itemInfo = array( - 'name' => $typeHint, - ); - $this->handleFeature($phpcsFile, $param['token'], $itemInfo); - - // As of PHP 7.0, using `self` or `parent` outside class scope throws a fatal error. - // Only throw this error for PHP 5.2+ as before that the "type hint not supported" error - // will be thrown. - if (($typeHint === 'self' || $typeHint === 'parent') - && $this->inClassScope($phpcsFile, $stackPtr, false) === false - && $this->supportsAbove('5.2') !== false - ) { - $phpcsFile->addError( - "'%s' type cannot be used outside of class scope", - $param['token'], - ucfirst($typeHint) . 'OutsideClassScopeFound', - array($typeHint) - ); - } - } elseif (isset($this->invalidTypes[$typeHint])) { - $error = "'%s' is not a valid type declaration. Did you mean %s ?"; - $data = array( - $typeHint, - $this->invalidTypes[$typeHint], - ); - - $phpcsFile->addError($error, $param['token'], 'InvalidTypeHintFound', $data); - } - } - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newTypes[$itemInfo['name']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return "'%s' type declaration is not present in PHP version %s or earlier"; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php deleted file mode 100644 index 3e225616..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewReturnTypeDeclarationsSniff.php +++ /dev/null @@ -1,194 +0,0 @@ - array(string => bool)) - */ - protected $newTypes = array( - 'int' => array( - '5.6' => false, - '7.0' => true, - ), - 'float' => array( - '5.6' => false, - '7.0' => true, - ), - 'bool' => array( - '5.6' => false, - '7.0' => true, - ), - 'string' => array( - '5.6' => false, - '7.0' => true, - ), - 'array' => array( - '5.6' => false, - '7.0' => true, - ), - 'callable' => array( - '5.6' => false, - '7.0' => true, - ), - 'parent' => array( - '5.6' => false, - '7.0' => true, - ), - 'self' => array( - '5.6' => false, - '7.0' => true, - ), - 'Class name' => array( - '5.6' => false, - '7.0' => true, - ), - - 'iterable' => array( - '7.0' => false, - '7.1' => true, - ), - 'void' => array( - '7.0' => false, - '7.1' => true, - ), - - 'object' => array( - '7.1' => false, - '7.2' => true, - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.0 - * @since 7.1.2 Now also checks based on the function and closure keywords. - * - * @return array - */ - public function register() - { - $tokens = array( - \T_FUNCTION, - \T_CLOSURE, - ); - - if (\defined('T_RETURN_TYPE')) { - $tokens[] = \T_RETURN_TYPE; - } - - return $tokens; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.0 - * - * @param \PHP_CodeSniffer_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(); - - // Deal with older PHPCS version which don't recognize return type hints - // as well as newer PHPCS versions (3.3.0+) where the tokenization has changed. - if ($tokens[$stackPtr]['code'] === \T_FUNCTION || $tokens[$stackPtr]['code'] === \T_CLOSURE) { - $returnTypeHint = $this->getReturnTypeHintToken($phpcsFile, $stackPtr); - if ($returnTypeHint !== false) { - $stackPtr = $returnTypeHint; - } - } - - if (isset($this->newTypes[$tokens[$stackPtr]['content']]) === true) { - $itemInfo = array( - 'name' => $tokens[$stackPtr]['content'], - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - // Handle class name based return types. - elseif ($tokens[$stackPtr]['code'] === \T_STRING - || (\defined('T_RETURN_TYPE') && $tokens[$stackPtr]['code'] === \T_RETURN_TYPE) - ) { - $itemInfo = array( - 'name' => 'Class name', - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newTypes[$itemInfo['name']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return '%s return type is not present in PHP version %s or earlier'; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php deleted file mode 100644 index a86d56ef..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php +++ /dev/null @@ -1,216 +0,0 @@ - array( - 'static' => false, - ), - '__destruct' => array( - 'visibility' => 'public', - 'static' => false, - ), - '__clone' => array( - 'static' => false, - ), - '__get' => array( - 'visibility' => 'public', - 'static' => false, - ), - '__set' => array( - 'visibility' => 'public', - 'static' => false, - ), - '__isset' => array( - 'visibility' => 'public', - 'static' => false, - ), - '__unset' => array( - 'visibility' => 'public', - 'static' => false, - ), - '__call' => array( - 'visibility' => 'public', - 'static' => false, - ), - '__callstatic' => array( - 'visibility' => 'public', - 'static' => true, - ), - '__sleep' => array( - 'visibility' => 'public', - ), - '__tostring' => array( - 'visibility' => 'public', - ), - '__set_state' => array( - 'visibility' => 'public', - 'static' => true, - ), - '__debuginfo' => array( - 'visibility' => 'public', - 'static' => false, - ), - '__invoke' => array( - 'visibility' => 'public', - 'static' => false, - ), - '__serialize' => array( - 'visibility' => 'public', - 'static' => false, - ), - '__unserialize' => array( - 'visibility' => 'public', - 'static' => false, - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * @since 5.6 Now also checks traits. - * @since 7.1.4 Now also checks anonymous classes. - * - * @return array - */ - public function register() - { - $targets = array( - \T_CLASS, - \T_INTERFACE, - \T_TRAIT, - ); - - if (\defined('T_ANON_CLASS')) { - $targets[] = \T_ANON_CLASS; - } - - return $targets; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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) - { - // Should be removed, the requirement was previously also there, 5.3 just started throwing a warning about it. - if ($this->supportsAbove('5.3') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $classScopeCloser = $tokens[$stackPtr]['scope_closer']; - $functionPtr = $stackPtr; - - // Find all the functions in this class or interface. - while (($functionToken = $phpcsFile->findNext(\T_FUNCTION, $functionPtr, $classScopeCloser)) !== false) { - /* - * Get the scope closer for this function in order to know how - * to advance to the next function. - * If no body of function (e.g. for interfaces), there is - * no closing curly brace; advance the pointer differently. - */ - if (isset($tokens[$functionToken]['scope_closer'])) { - $scopeCloser = $tokens[$functionToken]['scope_closer']; - } else { - $scopeCloser = ($functionToken + 1); - } - - $methodName = $phpcsFile->getDeclarationName($functionToken); - $methodNameLc = strtolower($methodName); - if (isset($this->magicMethods[$methodNameLc]) === false) { - $functionPtr = $scopeCloser; - continue; - } - - $methodProperties = $phpcsFile->getMethodProperties($functionToken); - $errorCodeBase = $this->stringToErrorCode($methodNameLc); - - if (isset($this->magicMethods[$methodNameLc]['visibility']) && $this->magicMethods[$methodNameLc]['visibility'] !== $methodProperties['scope']) { - $error = 'Visibility for magic method %s must be %s. Found: %s'; - $errorCode = $errorCodeBase . 'MethodVisibility'; - $data = array( - $methodName, - $this->magicMethods[$methodNameLc]['visibility'], - $methodProperties['scope'], - ); - - $phpcsFile->addError($error, $functionToken, $errorCode, $data); - } - - if (isset($this->magicMethods[$methodNameLc]['static']) && $this->magicMethods[$methodNameLc]['static'] !== $methodProperties['is_static']) { - $error = 'Magic method %s cannot be defined as static.'; - $errorCode = $errorCodeBase . 'MethodStatic'; - $data = array($methodName); - - if ($this->magicMethods[$methodNameLc]['static'] === true) { - $error = 'Magic method %s must be defined as static.'; - $errorCode = $errorCodeBase . 'MethodNonStatic'; - } - - $phpcsFile->addError($error, $functionToken, $errorCode, $data); - } - - // Advance to next function. - $functionPtr = $scopeCloser; - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php deleted file mode 100644 index 4dc08f88..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/NewMagicMethodsSniff.php +++ /dev/null @@ -1,231 +0,0 @@ - array(string => bool|string)) - */ - protected $newMagicMethods = array( - '__construct' => array( - '4.4' => false, - '5.0' => true, - ), - '__destruct' => array( - '4.4' => false, - '5.0' => true, - ), - '__get' => array( - '4.4' => false, - '5.0' => true, - ), - - '__isset' => array( - '5.0' => false, - '5.1' => true, - ), - '__unset' => array( - '5.0' => false, - '5.1' => true, - ), - '__set_state' => array( - '5.0' => false, - '5.1' => true, - ), - - '__callstatic' => array( - '5.2' => false, - '5.3' => true, - ), - '__invoke' => array( - '5.2' => false, - '5.3' => true, - ), - - '__debuginfo' => array( - '5.5' => false, - '5.6' => true, - ), - - // Special case - only became properly magical in 5.2.0, - // before that it was only called for echo and print. - '__tostring' => array( - '5.1' => false, - '5.2' => true, - 'message' => 'The method %s() was not truly magical in PHP version %s and earlier. The associated magic functionality will only be called when directly combined with echo or print.', - ), - - '__serialize' => array( - '7.3' => false, - '7.4' => true, - ), - '__unserialize' => array( - '7.3' => false, - '7.4' => true, - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.4 - * - * @return array - */ - public function register() - { - return array(\T_FUNCTION); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.4 - * - * @param \PHP_CodeSniffer_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) - { - $functionName = $phpcsFile->getDeclarationName($stackPtr); - $functionNameLc = strtolower($functionName); - - if (isset($this->newMagicMethods[$functionNameLc]) === false) { - return; - } - - if ($this->inClassScope($phpcsFile, $stackPtr, false) === false) { - return; - } - - $itemInfo = array( - 'name' => $functionName, - 'nameLc' => $functionNameLc, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newMagicMethods[$itemInfo['nameLc']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array('message'); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - $errorInfo['error'] = false; // Warning, not error. - $errorInfo['message'] = ''; - - if (empty($itemArray['message']) === false) { - $errorInfo['message'] = $itemArray['message']; - } - - return $errorInfo; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The method %s() was not magical in PHP version %s and earlier. The associated magic functionality will not be invoked.'; - } - - - /** - * Allow for concrete child classes to filter the error message before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param string $error The error message which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return string - */ - protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) - { - if ($errorInfo['message'] !== '') { - $error = $errorInfo['message']; - } - - return $error; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php deleted file mode 100644 index 0ea5b0d6..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedMagicAutoloadSniff.php +++ /dev/null @@ -1,92 +0,0 @@ - true, - 'T_ANON_CLASS' => true, - 'T_INTERFACE' => true, - 'T_TRAIT' => true, - 'T_NAMESPACE' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.1.0 - * - * @return array - */ - public function register() - { - return array(\T_FUNCTION); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.1.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.2') === false) { - return; - } - - $funcName = $phpcsFile->getDeclarationName($stackPtr); - - if (strtolower($funcName) !== '__autoload') { - return; - } - - if ($this->validDirectScope($phpcsFile, $stackPtr, $this->checkForScopes) !== false) { - return; - } - - if ($this->determineNamespace($phpcsFile, $stackPtr) !== '') { - return; - } - - $phpcsFile->addWarning('Use of __autoload() function is deprecated since PHP 7.2', $stackPtr, 'Found'); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php deleted file mode 100644 index 3c3feadc..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedNamespacedAssertSniff.php +++ /dev/null @@ -1,101 +0,0 @@ -scopes[] = \T_ANON_CLASS; - } - - return array(\T_FUNCTION); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.3') === false) { - return; - } - - $funcName = $phpcsFile->getDeclarationName($stackPtr); - - if (strtolower($funcName) !== 'assert') { - return; - } - - if ($phpcsFile->hasCondition($stackPtr, $this->scopes) === true) { - return; - } - - if ($this->determineNamespace($phpcsFile, $stackPtr) === '') { - // Not a namespaced function declaration. This may be a parse error, but not our concern. - return; - } - - $phpcsFile->addWarning('Declaring a free-standing function called assert() is deprecated since PHP 7.3.', $stackPtr, 'Found'); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php deleted file mode 100644 index a888f51d..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/RemovedPHP4StyleConstructorsSniff.php +++ /dev/null @@ -1,158 +0,0 @@ -supportsAbove('7.0') === false) { - return; - } - - if ($this->determineNamespace($phpcsFile, $stackPtr) !== '') { - /* - * Namespaced methods with the same name as the class are treated as - * regular methods, so we can bow out if we're in a namespace. - * - * Note: the exception to this is PHP 5.3.0-5.3.2. This is currently - * not dealt with. - */ - return; - } - - $tokens = $phpcsFile->getTokens(); - - $class = $tokens[$stackPtr]; - - if (isset($class['scope_closer']) === false) { - return; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { - // Anonymous class in combination with PHPCS 2.3.x. - return; - } - - $scopeCloser = $class['scope_closer']; - $className = $tokens[$nextNonEmpty]['content']; - - if (empty($className) || \is_string($className) === false) { - return; - } - - $nextFunc = $stackPtr; - $classNameLc = strtolower($className); - $newConstructorFound = false; - $oldConstructorFound = false; - $oldConstructorPos = -1; - while (($nextFunc = $phpcsFile->findNext(array(\T_FUNCTION, \T_DOC_COMMENT_OPEN_TAG), ($nextFunc + 1), $scopeCloser)) !== false) { - // Skip over docblocks. - if ($tokens[$nextFunc]['code'] === \T_DOC_COMMENT_OPEN_TAG) { - $nextFunc = $tokens[$nextFunc]['comment_closer']; - continue; - } - - $functionScopeCloser = $nextFunc; - if (isset($tokens[$nextFunc]['scope_closer'])) { - // Normal (non-interface, non-abstract) method. - $functionScopeCloser = $tokens[$nextFunc]['scope_closer']; - } - - $funcName = $phpcsFile->getDeclarationName($nextFunc); - if (empty($funcName) || \is_string($funcName) === false) { - $nextFunc = $functionScopeCloser; - continue; - } - - $funcNameLc = strtolower($funcName); - - if ($funcNameLc === '__construct') { - $newConstructorFound = true; - } - - if ($funcNameLc === $classNameLc) { - $oldConstructorFound = true; - $oldConstructorPos = $nextFunc; - } - - // If both have been found, no need to continue looping through the functions. - if ($newConstructorFound === true && $oldConstructorFound === true) { - break; - } - - $nextFunc = $functionScopeCloser; - } - - if ($newConstructorFound === false && $oldConstructorFound === true) { - $phpcsFile->addWarning( - 'Use of deprecated PHP4 style class constructor is not supported since PHP 7.', - $oldConstructorPos, - 'Found' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php deleted file mode 100644 index 9ddb9e96..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionNameRestrictions/ReservedFunctionNamesSniff.php +++ /dev/null @@ -1,205 +0,0 @@ -magicMethods['debuginfo'] = true; - } - - - /** - * Processes the tokens within the scope. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * @param int $currScope The position of the current scope. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - /* - * Determine if this is a function which needs to be examined. - * The `processTokenWithinScope()` is called for each valid scope a method is in, - * so for nested classes, we need to make sure we only examine the token for - * the lowest level valid scope. - */ - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - if ($this->isFunctionDeprecated($phpcsFile, $stackPtr) === true) { - /* - * Deprecated functions don't have to comply with the naming conventions, - * otherwise functions deprecated in favour of a function with a compliant - * name would still trigger an error. - */ - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - // Is this a magic method. i.e., is prefixed with "__" ? - if (preg_match('|^__[^_]|', $methodName) > 0) { - $magicPart = strtolower(substr($methodName, 2)); - if (isset($this->magicMethods[$magicPart]) === false - && isset($this->methodsDoubleUnderscore[$magicPart]) === false - ) { - $className = '[anonymous class]'; - $scopeNextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($currScope + 1), null, true); - if ($scopeNextNonEmpty !== false && $tokens[$scopeNextNonEmpty]['code'] === \T_STRING) { - $className = $tokens[$scopeNextNonEmpty]['content']; - } - - $phpcsFile->addWarning( - 'Method name "%s" is discouraged; PHP has reserved all method names with a double underscore prefix for future use.', - $stackPtr, - 'MethodDoubleUnderscore', - array($className . '::' . $methodName) - ); - } - } - } - - - /** - * Processes the tokens outside the scope. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - if ($this->isFunctionDeprecated($phpcsFile, $stackPtr) === true) { - /* - * Deprecated functions don't have to comply with the naming conventions, - * otherwise functions deprecated in favour of a function with a compliant - * name would still trigger an error. - */ - return; - } - - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if ($functionName === null) { - // Ignore closures. - return; - } - - // Is this a magic function. i.e., it is prefixed with "__". - if (preg_match('|^__[^_]|', $functionName) > 0) { - $magicPart = strtolower(substr($functionName, 2)); - if (isset($this->magicFunctions[$magicPart]) === false) { - $phpcsFile->addWarning( - 'Function name "%s" is discouraged; PHP has reserved all method names with a double underscore prefix for future use.', - $stackPtr, - 'FunctionDoubleUnderscore', - array($functionName) - ); - } - } - } - - - /** - * Check whether a function has been marked as deprecated via a @deprecated tag - * in the function docblock. - * - * @since 9.3.2 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of a T_FUNCTION - * token in the stack. - * - * @return bool - */ - private function isFunctionDeprecated(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $find = Tokens::$methodPrefixes; - $find[] = \T_WHITESPACE; - - $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); - if ($tokens[$commentEnd]['code'] !== \T_DOC_COMMENT_CLOSE_TAG) { - // Function doesn't have a doc comment or is using the wrong type of comment. - return false; - } - - $commentStart = $tokens[$commentEnd]['comment_opener']; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@deprecated') { - return true; - } - } - - return false; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php deleted file mode 100644 index 4e904dea..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsReportCurrentValueSniff.php +++ /dev/null @@ -1,455 +0,0 @@ - true, - 'func_get_args' => true, - 'debug_backtrace' => true, - 'debug_print_backtrace' => true, - ); - - /** - * Tokens to look out for to allow us to skip past nested scoped structures. - * - * @since 9.1.0 - * - * @var array - */ - private $skipPastNested = array( - 'T_CLASS' => true, - 'T_ANON_CLASS' => true, - 'T_INTERFACE' => true, - 'T_TRAIT' => true, - 'T_FUNCTION' => true, - 'T_CLOSURE' => true, - ); - - /** - * List of tokens which when they preceed a T_STRING *within a function* indicate - * this is not a call to a PHP native function. - * - * This list already takes into account that nested scoped structures are being - * skipped over, so doesn't check for those again. - * Similarly, as constants won't have parentheses, those don't need to be checked - * for either. - * - * @since 9.1.0 - * - * @var array - */ - private $noneFunctionCallIndicators = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - ); - - /** - * The tokens for variable incrementing/decrementing. - * - * @since 9.1.0 - * - * @var array - */ - private $plusPlusMinusMinus = array( - \T_DEC => true, - \T_INC => true, - ); - - /** - * Tokens to ignore when determining the start of a statement. - * - * @since 9.1.0 - * - * @var array - */ - private $ignoreForStartOfStatement = array( - \T_COMMA, - \T_DOUBLE_ARROW, - \T_OPEN_SQUARE_BRACKET, - \T_OPEN_PARENTHESIS, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.1.0 - * - * @return array - */ - public function register() - { - return array( - \T_FUNCTION, - \T_CLOSURE, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.1.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { - // Abstract function, interface function, live coding or parse error. - return; - } - - $scopeOpener = $tokens[$stackPtr]['scope_opener']; - $scopeCloser = $tokens[$stackPtr]['scope_closer']; - - // Does the function declaration have parameters ? - $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); - if (empty($params)) { - // No named arguments found, so no risk of them being changed. - return; - } - - $paramNames = array(); - foreach ($params as $param) { - $paramNames[] = $param['name']; - } - - for ($i = ($scopeOpener + 1); $i < $scopeCloser; $i++) { - if (isset($this->skipPastNested[$tokens[$i]['type']]) && isset($tokens[$i]['scope_closer'])) { - // Skip past nested structures. - $i = $tokens[$i]['scope_closer']; - continue; - } - - if ($tokens[$i]['code'] !== \T_STRING) { - continue; - } - - $foundFunctionName = strtolower($tokens[$i]['content']); - - if (isset($this->changedFunctions[$foundFunctionName]) === false) { - // Not one of the target functions. - continue; - } - - /* - * Ok, so is this really a function call to one of the PHP native functions ? - */ - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - if ($next === false || $tokens[$next]['code'] !== \T_OPEN_PARENTHESIS) { - // Live coding, parse error or not a function call. - continue; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), null, true); - if ($prev !== false) { - if (isset($this->noneFunctionCallIndicators[$tokens[$prev]['code']])) { - continue; - } - - // Check for namespaced functions, ie: \foo\bar() not \bar(). - if ($tokens[ $prev ]['code'] === \T_NS_SEPARATOR) { - $pprev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - if ($pprev !== false && $tokens[ $pprev ]['code'] === \T_STRING) { - continue; - } - } - } - - /* - * Address some special cases. - */ - if ($foundFunctionName !== 'func_get_args') { - $paramOne = $this->getFunctionCallParameter($phpcsFile, $i, 1); - if ($paramOne !== false) { - switch ($foundFunctionName) { - /* - * Check if `debug_(print_)backtrace()` is called with the - * `DEBUG_BACKTRACE_IGNORE_ARGS` option. - */ - case 'debug_backtrace': - case 'debug_print_backtrace': - $hasIgnoreArgs = $phpcsFile->findNext( - \T_STRING, - $paramOne['start'], - ($paramOne['end'] + 1), - false, - 'DEBUG_BACKTRACE_IGNORE_ARGS' - ); - - if ($hasIgnoreArgs !== false) { - // Debug_backtrace() called with ignore args option. - continue 2; - } - break; - - /* - * Collect the necessary information to only throw a notice if the argument - * touched/changed is in line with the passed $arg_num. - * - * Also, we can ignore `func_get_arg()` if the argument offset passed is - * higher than the number of named parameters. - * - * {@internal Note: This does not take calculations into account! - * Should be exceptionally rare and can - if needs be - be addressed at a later stage.} - */ - case 'func_get_arg': - $number = $phpcsFile->findNext(\T_LNUMBER, $paramOne['start'], ($paramOne['end'] + 1)); - if ($number !== false) { - $argNumber = $tokens[$number]['content']; - - if (isset($paramNames[$argNumber]) === false) { - // Requesting a non-named additional parameter. Ignore. - continue 2; - } - } - break; - } - } - } else { - /* - * Check if the call to func_get_args() happens to be in an array_slice() or - * array_splice() with an $offset higher than the number of named parameters. - * In that case, we can ignore it. - * - * {@internal Note: This does not take offset calculations into account! - * Should be exceptionally rare and can - if needs be - be addressed at a later stage.} - */ - if ($prev !== false && $tokens[$prev]['code'] === \T_OPEN_PARENTHESIS) { - - $maybeFunctionCall = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - if ($maybeFunctionCall !== false - && $tokens[$maybeFunctionCall]['code'] === \T_STRING - && ($tokens[$maybeFunctionCall]['content'] === 'array_slice' - || $tokens[$maybeFunctionCall]['content'] === 'array_splice') - ) { - $parentFuncParamTwo = $this->getFunctionCallParameter($phpcsFile, $maybeFunctionCall, 2); - $number = $phpcsFile->findNext( - \T_LNUMBER, - $parentFuncParamTwo['start'], - ($parentFuncParamTwo['end'] + 1) - ); - - if ($number !== false && isset($paramNames[$tokens[$number]['content']]) === false) { - // Requesting non-named additional parameters. Ignore. - continue ; - } - - // Slice starts at a named argument, but we know which params are being accessed. - $paramNamesSubset = \array_slice($paramNames, $tokens[$number]['content']); - } - } - } - - /* - * For debug_backtrace(), check if the result is being dereferenced and if so, - * whether the `args` index is used. - * I.e. whether `$index` in `debug_backtrace()[$stackFrame][$index]` is a string - * with the content `args`. - * - * Note: We already know that $next is the open parenthesis of the function call. - */ - if ($foundFunctionName === 'debug_backtrace' && isset($tokens[$next]['parenthesis_closer'])) { - $afterParenthesis = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($tokens[$next]['parenthesis_closer'] + 1), - null, - true - ); - - if ($tokens[$afterParenthesis]['code'] === \T_OPEN_SQUARE_BRACKET - && isset($tokens[$afterParenthesis]['bracket_closer']) - ) { - $afterStackFrame = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($tokens[$afterParenthesis]['bracket_closer'] + 1), - null, - true - ); - - if ($tokens[$afterStackFrame]['code'] === \T_OPEN_SQUARE_BRACKET - && isset($tokens[$afterStackFrame]['bracket_closer']) - ) { - $arrayIndex = $phpcsFile->findNext( - \T_CONSTANT_ENCAPSED_STRING, - ($afterStackFrame + 1), - $tokens[$afterStackFrame]['bracket_closer'] - ); - - if ($arrayIndex !== false && $this->stripQuotes($tokens[$arrayIndex]['content']) !== 'args') { - continue; - } - } - } - } - - /* - * Only check for variables before the start of the statement to - * prevent false positives on the return value of the function call - * being assigned to one of the parameters, i.e.: - * `$param = func_get_args();`. - */ - $startOfStatement = PHPCSHelper::findStartOfStatement($phpcsFile, $i, $this->ignoreForStartOfStatement); - - /* - * Ok, so we've found one of the target functions in the right scope. - * Now, let's check if any of the passed parameters were touched. - */ - $scanResult = 'clean'; - for ($j = ($scopeOpener + 1); $j < $startOfStatement; $j++) { - if (isset($this->skipPastNested[$tokens[$j]['type']]) - && isset($tokens[$j]['scope_closer']) - ) { - // Skip past nested structures. - $j = $tokens[$j]['scope_closer']; - continue; - } - - if ($tokens[$j]['code'] !== \T_VARIABLE) { - continue; - } - - if ($foundFunctionName === 'func_get_arg' && isset($argNumber)) { - if (isset($paramNames[$argNumber]) - && $tokens[$j]['content'] !== $paramNames[$argNumber] - ) { - // Different param than the one requested by func_get_arg(). - continue; - } - } elseif ($foundFunctionName === 'func_get_args' && isset($paramNamesSubset)) { - if (\in_array($tokens[$j]['content'], $paramNamesSubset, true) === false) { - // Different param than the ones requested by func_get_args(). - continue; - } - } elseif (\in_array($tokens[$j]['content'], $paramNames, true) === false) { - // Variable is not one of the function parameters. - continue; - } - - /* - * Ok, so we've found a variable which was passed as one of the parameters. - * Now, is this variable being changed, i.e. incremented, decremented or - * assigned something ? - */ - $scanResult = 'warning'; - if (isset($variableToken) === false) { - $variableToken = $j; - } - - $beforeVar = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($j - 1), null, true); - if ($beforeVar !== false && isset($this->plusPlusMinusMinus[$tokens[$beforeVar]['code']])) { - // Variable is being (pre-)incremented/decremented. - $scanResult = 'error'; - $variableToken = $j; - break; - } - - $afterVar = $phpcsFile->findNext(Tokens::$emptyTokens, ($j + 1), null, true); - if ($afterVar === false) { - // Shouldn't be possible, but just in case. - continue; - } - - if (isset($this->plusPlusMinusMinus[$tokens[$afterVar]['code']])) { - // Variable is being (post-)incremented/decremented. - $scanResult = 'error'; - $variableToken = $j; - break; - } - - if ($tokens[$afterVar]['code'] === \T_OPEN_SQUARE_BRACKET - && isset($tokens[$afterVar]['bracket_closer']) - ) { - // Skip past array access on the variable. - while (($afterVar = $phpcsFile->findNext(Tokens::$emptyTokens, ($tokens[$afterVar]['bracket_closer'] + 1), null, true)) !== false) { - if ($tokens[$afterVar]['code'] !== \T_OPEN_SQUARE_BRACKET - || isset($tokens[$afterVar]['bracket_closer']) === false - ) { - break; - } - } - } - - if ($afterVar !== false - && isset(Tokens::$assignmentTokens[$tokens[$afterVar]['code']]) - ) { - // Variable is being assigned something. - $scanResult = 'error'; - $variableToken = $j; - break; - } - } - - unset($argNumber, $paramNamesSubset); - - if ($scanResult === 'clean') { - continue; - } - - $error = 'Since PHP 7.0, functions inspecting arguments, like %1$s(), no longer report the original value as passed to a parameter, but will instead provide the current value. The parameter "%2$s" was %4$s on line %3$s.'; - $data = array( - $foundFunctionName, - $tokens[$variableToken]['content'], - $tokens[$variableToken]['line'], - ); - - if ($scanResult === 'error') { - $data[] = 'changed'; - $phpcsFile->addError($error, $i, 'Changed', $data); - - } elseif ($scanResult === 'warning') { - $data[] = 'used, and possibly changed (by reference),'; - $phpcsFile->addWarning($error, $i, 'NeedsInspection', $data); - } - - unset($variableToken); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php deleted file mode 100644 index 7c251119..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/ArgumentFunctionsUsageSniff.php +++ /dev/null @@ -1,169 +0,0 @@ - true, - 'func_get_arg' => true, - 'func_num_args' => true, - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.2.0 - * - * @return array - */ - public function register() - { - return array(\T_STRING); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_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(); - $functionLc = strtolower($tokens[$stackPtr]['content']); - if (isset($this->targetFunctions[$functionLc]) === false) { - return; - } - - // Next non-empty token should be the open parenthesis. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { - return; - } - - $ignore = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_NEW => true, - ); - - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevNonEmpty]['code']]) === true) { - // Not a call to a PHP function. - return; - } elseif ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR && $tokens[$prevNonEmpty - 1]['code'] === \T_STRING) { - // Namespaced function. - return; - } - - $data = $tokens[$stackPtr]['content']; - - /* - * Check for use of the functions in the global scope. - * - * As PHPCS can not determine whether a file is included from within a function in - * another file, so always throw a warning/error. - */ - if ($phpcsFile->hasCondition($stackPtr, array(\T_FUNCTION, \T_CLOSURE)) === false) { - $isError = false; - $message = 'Use of %s() outside of a user-defined function is only supported if the file is included from within a user-defined function in another file prior to PHP 5.3.'; - - if ($this->supportsAbove('5.3') === true) { - $isError = true; - $message .= ' As of PHP 5.3, it is no longer supported at all.'; - } - - $this->addMessage($phpcsFile, $message, $stackPtr, $isError, 'OutsideFunctionScope', $data); - } - - /* - * Check for use of the functions as a parameter in a function call. - */ - if ($this->supportsBelow('5.2') === false) { - return; - } - - if (isset($tokens[$stackPtr]['nested_parenthesis']) === false) { - return; - } - - $throwError = false; - - $closer = end($tokens[$stackPtr]['nested_parenthesis']); - if (isset($tokens[$closer]['parenthesis_owner']) - && $tokens[$tokens[$closer]['parenthesis_owner']]['type'] === 'T_CLOSURE' - ) { - $throwError = true; - } else { - $opener = key($tokens[$stackPtr]['nested_parenthesis']); - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), null, true); - if ($tokens[$prevNonEmpty]['code'] !== \T_STRING) { - return; - } - - $prevPrevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true); - if ($tokens[$prevPrevNonEmpty]['code'] === \T_FUNCTION) { - return; - } - - $throwError = true; - } - - if ($throwError === false) { - return; - } - - $phpcsFile->addError( - '%s() could not be used in parameter lists prior to PHP 5.3.', - $stackPtr, - 'InParameterList', - $data - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php deleted file mode 100644 index 7b0d60bd..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionParametersSniff.php +++ /dev/null @@ -1,1109 +0,0 @@ - array( - 2 => array( - 'name' => 'flag', - '5.5' => false, - '5.6' => true, - ), - ), - 'array_slice' => array( - 1 => array( - 'name' => 'preserve_keys', - '5.0.1' => false, - '5.0.2' => true, - ), - ), - 'array_unique' => array( - 1 => array( - 'name' => 'sort_flags', - '5.2.8' => false, - '5.2.9' => true, - ), - ), - 'assert' => array( - 1 => array( - 'name' => 'description', - '5.4.7' => false, - '5.4.8' => true, - ), - ), - 'base64_decode' => array( - 1 => array( - 'name' => 'strict', - '5.1' => false, - '5.2' => true, - ), - ), - 'bcmod' => array( - 2 => array( - 'name' => 'scale', - '7.1' => false, - '7.2' => true, - ), - ), - 'class_implements' => array( - 1 => array( - 'name' => 'autoload', - '5.0' => false, - '5.1' => true, - ), - ), - 'class_parents' => array( - 1 => array( - 'name' => 'autoload', - '5.0' => false, - '5.1' => true, - ), - ), - 'clearstatcache' => array( - 0 => array( - 'name' => 'clear_realpath_cache', - '5.2' => false, - '5.3' => true, - ), - 1 => array( - 'name' => 'filename', - '5.2' => false, - '5.3' => true, - ), - ), - 'copy' => array( - 2 => array( - 'name' => 'context', - '5.2' => false, - '5.3' => true, - ), - ), - 'curl_multi_info_read' => array( - 1 => array( - 'name' => 'msgs_in_queue', - '5.1' => false, - '5.2' => true, - ), - ), - 'debug_backtrace' => array( - 0 => array( - 'name' => 'options', - '5.2.4' => false, - '5.2.5' => true, - ), - 1 => array( - 'name' => 'limit', - '5.3' => false, - '5.4' => true, - ), - ), - 'debug_print_backtrace' => array( - 0 => array( - 'name' => 'options', - '5.3.5' => false, - '5.3.6' => true, - ), - 1 => array( - 'name' => 'limit', - '5.3' => false, - '5.4' => true, - ), - ), - 'dirname' => array( - 1 => array( - 'name' => 'levels', - '5.6' => false, - '7.0' => true, - ), - ), - 'dns_get_record' => array( - 4 => array( - 'name' => 'raw', - '5.3' => false, - '5.4' => true, - ), - ), - 'fgetcsv' => array( - 4 => array( - 'name' => 'escape', - '5.2' => false, - '5.3' => true, - ), - ), - 'fputcsv' => array( - 4 => array( - 'name' => 'escape_char', - '5.5.3' => false, - '5.5.4' => true, - ), - ), - 'file_get_contents' => array( - 3 => array( - 'name' => 'offset', - '5.0' => false, - '5.1' => true, - ), - 4 => array( - 'name' => 'maxlen', - '5.0' => false, - '5.1' => true, - ), - ), - 'filter_input_array' => array( - 2 => array( - 'name' => 'add_empty', - '5.3' => false, - '5.4' => true, - ), - ), - 'filter_var_array' => array( - 2 => array( - 'name' => 'add_empty', - '5.3' => false, - '5.4' => true, - ), - ), - 'getenv' => array( - 1 => array( - 'name' => 'local_only', - '5.5.37' => false, - '5.5.38' => true, // Also introduced in PHP 5.6.24 and 7.0.9. - ), - ), - 'getopt' => array( - 2 => array( - 'name' => 'optind', - '7.0' => false, - '7.1' => true, - ), - ), - 'gettimeofday' => array( - 0 => array( - 'name' => 'return_float', - '5.0' => false, - '5.1' => true, - ), - ), - 'get_defined_functions' => array( - 0 => array( - 'name' => 'exclude_disabled', - '7.0.14' => false, - '7.0.15' => true, - ), - ), - 'get_headers' => array( - 2 => array( - 'name' => 'context', - '7.0' => false, - '7.1' => true, - ), - ), - 'get_html_translation_table' => array( - 2 => array( - 'name' => 'encoding', - '5.3.3' => false, - '5.3.4' => true, - ), - ), - 'get_loaded_extensions' => array( - 0 => array( - 'name' => 'zend_extensions', - '5.2.3' => false, - '5.2.4' => true, - ), - ), - 'gzcompress' => array( - 2 => array( - 'name' => 'encoding', - '5.3' => false, - '5.4' => true, - ), - ), - 'gzdeflate' => array( - 2 => array( - 'name' => 'encoding', - '5.3' => false, - '5.4' => true, - ), - ), - 'htmlentities' => array( - 3 => array( - 'name' => 'double_encode', - '5.2.2' => false, - '5.2.3' => true, - ), - ), - 'htmlspecialchars' => array( - 3 => array( - 'name' => 'double_encode', - '5.2.2' => false, - '5.2.3' => true, - ), - ), - 'http_build_query' => array( - 2 => array( - 'name' => 'arg_separator', - '5.1.1' => false, - '5.1.2' => true, - ), - 3 => array( - 'name' => 'enc_type', - '5.3' => false, - '5.4' => true, - ), - ), - 'idn_to_ascii' => array( - 2 => array( - 'name' => 'variant', - '5.3' => false, - '5.4' => true, - ), - 3 => array( - 'name' => 'idna_info', - '5.3' => false, - '5.4' => true, - ), - ), - 'idn_to_utf8' => array( - 2 => array( - 'name' => 'variant', - '5.3' => false, - '5.4' => true, - ), - 3 => array( - 'name' => 'idna_info', - '5.3' => false, - '5.4' => true, - ), - ), - 'imagecolorset' => array( - 5 => array( - 'name' => 'alpha', - '5.3' => false, - '5.4' => true, - ), - ), - 'imagepng' => array( - 2 => array( - 'name' => 'quality', - '5.1.1' => false, - '5.1.2' => true, - ), - 3 => array( - 'name' => 'filters', - '5.1.2' => false, - '5.1.3' => true, - ), - ), - 'imagerotate' => array( - 3 => array( - 'name' => 'ignore_transparent', - '5.0' => false, - '5.1' => true, - ), - ), - 'imap_open' => array( - 4 => array( - 'name' => 'n_retries', - '5.1' => false, - '5.2' => true, - ), - 5 => array( - 'name' => 'params', - '5.3.1' => false, - '5.3.2' => true, - ), - ), - 'imap_reopen' => array( - 3 => array( - 'name' => 'n_retries', - '5.1' => false, - '5.2' => true, - ), - ), - 'ini_get_all' => array( - 1 => array( - 'name' => 'details', - '5.2' => false, - '5.3' => true, - ), - ), - 'is_a' => array( - 2 => array( - 'name' => 'allow_string', - '5.3.8' => false, - '5.3.9' => true, - ), - ), - 'is_subclass_of' => array( - 2 => array( - 'name' => 'allow_string', - '5.3.8' => false, - '5.3.9' => true, - ), - ), - 'iterator_to_array' => array( - 1 => array( - 'name' => 'use_keys', - '5.2.0' => false, - '5.2.1' => true, - ), - ), - 'json_decode' => array( - 2 => array( - 'name' => 'depth', - '5.2' => false, - '5.3' => true, - ), - 3 => array( - 'name' => 'options', - '5.3' => false, - '5.4' => true, - ), - ), - 'json_encode' => array( - 1 => array( - 'name' => 'options', - '5.2' => false, - '5.3' => true, - ), - 2 => array( - 'name' => 'depth', - '5.4' => false, - '5.5' => true, - ), - ), - 'ldap_add' => array( - 3 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_compare' => array( - 4 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_delete' => array( - 2 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_list' => array( - 8 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_mod_add' => array( - 3 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_mod_del' => array( - 3 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_mod_replace' => array( - 3 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_modify_batch' => array( - 3 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_parse_result' => array( - 6 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_read' => array( - 8 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_rename' => array( - 5 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'ldap_search' => array( - 8 => array( - 'name' => 'serverctrls', - '7.2' => false, - '7.3' => true, - ), - ), - 'memory_get_peak_usage' => array( - 0 => array( - 'name' => 'real_usage', - '5.1' => false, - '5.2' => true, - ), - ), - 'memory_get_usage' => array( - 0 => array( - 'name' => 'real_usage', - '5.1' => false, - '5.2' => true, - ), - ), - 'mb_encode_numericentity' => array( - 3 => array( - 'name' => 'is_hex', - '5.3' => false, - '5.4' => true, - ), - ), - 'mb_strrpos' => array( - /* - * Note: the actual position is 2, but the original 3rd - * parameter 'encoding' was moved to the 4th position. - * So the only way to detect if offset is used is when - * both offset and encoding are set. - */ - 3 => array( - 'name' => 'offset', - '5.1' => false, - '5.2' => true, - ), - ), - 'mssql_connect' => array( - 3 => array( - 'name' => 'new_link', - '5.0' => false, - '5.1' => true, - ), - ), - 'mysqli_commit' => array( - 1 => array( - 'name' => 'flags', - '5.4' => false, - '5.5' => true, - ), - 2 => array( - 'name' => 'name', - '5.4' => false, - '5.5' => true, - ), - ), - 'mysqli_rollback' => array( - 1 => array( - 'name' => 'flags', - '5.4' => false, - '5.5' => true, - ), - 2 => array( - 'name' => 'name', - '5.4' => false, - '5.5' => true, - ), - ), - 'nl2br' => array( - 1 => array( - 'name' => 'is_xhtml', - '5.2' => false, - '5.3' => true, - ), - ), - 'openssl_decrypt' => array( - 4 => array( - 'name' => 'iv', - '5.3.2' => false, - '5.3.3' => true, - ), - 5 => array( - 'name' => 'tag', - '7.0' => false, - '7.1' => true, - ), - 6 => array( - 'name' => 'aad', - '7.0' => false, - '7.1' => true, - ), - ), - 'openssl_encrypt' => array( - 4 => array( - 'name' => 'iv', - '5.3.2' => false, - '5.3.3' => true, - ), - 5 => array( - 'name' => 'tag', - '7.0' => false, - '7.1' => true, - ), - 6 => array( - 'name' => 'aad', - '7.0' => false, - '7.1' => true, - ), - 7 => array( - 'name' => 'tag_length', - '7.0' => false, - '7.1' => true, - ), - ), - 'openssl_open' => array( - 4 => array( - 'name' => 'method', - '5.2' => false, - '5.3' => true, - ), - 5 => array( - 'name' => 'iv', - '5.6' => false, - '7.0' => true, - ), - ), - 'openssl_pkcs7_verify' => array( - 5 => array( - 'name' => 'content', - '5.0' => false, - '5.1' => true, - ), - 6 => array( - 'name' => 'p7bfilename', - '7.1' => false, - '7.2' => true, - ), - ), - 'openssl_seal' => array( - 4 => array( - 'name' => 'method', - '5.2' => false, - '5.3' => true, - ), - 5 => array( - 'name' => 'iv', - '5.6' => false, - '7.0' => true, - ), - ), - 'openssl_verify' => array( - 3 => array( - 'name' => 'signature_alg', - '5.1' => false, - '5.2' => true, - ), - ), - 'parse_ini_file' => array( - 2 => array( - 'name' => 'scanner_mode', - '5.2' => false, - '5.3' => true, - ), - ), - 'parse_url' => array( - 1 => array( - 'name' => 'component', - '5.1.1' => false, - '5.1.2' => true, - ), - ), - 'pg_fetch_all' => array( - 1 => array( - 'name' => 'result_type', - '7.0' => false, - '7.1' => true, - ), - ), - 'pg_last_notice' => array( - 1 => array( - 'name' => 'option', - '7.0' => false, - '7.1' => true, - ), - ), - 'pg_lo_create' => array( - 1 => array( - 'name' => 'object_id', - '5.2' => false, - '5.3' => true, - ), - ), - 'pg_lo_import' => array( - 2 => array( - 'name' => 'object_id', - '5.2' => false, - '5.3' => true, - ), - ), - 'pg_select' => array( - 4 => array( - 'name' => 'result_type', - '7.0' => false, - '7.1' => true, - ), - ), - 'php_uname' => array( - 0 => array( - 'name' => 'mode', - '4.2' => false, - '4.3' => true, - ), - ), - 'preg_replace' => array( - 4 => array( - 'name' => 'count', - '5.0' => false, - '5.1' => true, - ), - ), - 'preg_replace_callback' => array( - 4 => array( - 'name' => 'count', - '5.0' => false, - '5.1' => true, - ), - 5 => array( - 'name' => 'flags', - '7.3' => false, - '7.4' => true, - ), - ), - 'preg_replace_callback_array' => array( - 4 => array( - 'name' => 'flags', - '7.3' => false, - '7.4' => true, - ), - ), - 'round' => array( - 2 => array( - 'name' => 'mode', - '5.2' => false, - '5.3' => true, - ), - ), - 'sem_acquire' => array( - 1 => array( - 'name' => 'nowait', - '5.6' => false, - '5.6.1' => true, - ), - ), - 'session_regenerate_id' => array( - 0 => array( - 'name' => 'delete_old_session', - '5.0' => false, - '5.1' => true, - ), - ), - 'session_set_cookie_params' => array( - 4 => array( - 'name' => 'httponly', - '5.1' => false, - '5.2' => true, - ), - ), - 'session_set_save_handler' => array( - 6 => array( - 'name' => 'create_sid', - '5.5.0' => false, - '5.5.1' => true, - ), - 7 => array( - 'name' => 'validate_sid', - '5.6' => false, - '7.0' => true, - ), - 8 => array( - 'name' => 'update_timestamp', - '5.6' => false, - '7.0' => true, - ), - ), - 'session_start' => array( - 0 => array( - 'name' => 'options', - '5.6' => false, - '7.0' => true, - ), - ), - 'setcookie' => array( - 6 => array( - 'name' => 'httponly', - '5.1' => false, - '5.2' => true, - ), - ), - 'setrawcookie' => array( - 6 => array( - 'name' => 'httponly', - '5.1' => false, - '5.2' => true, - ), - ), - 'simplexml_load_file' => array( - 4 => array( - 'name' => 'is_prefix', - '5.1' => false, - '5.2' => true, - ), - ), - 'simplexml_load_string' => array( - 4 => array( - 'name' => 'is_prefix', - '5.1' => false, - '5.2' => true, - ), - ), - 'spl_autoload_register' => array( - 2 => array( - 'name' => 'prepend', - '5.2' => false, - '5.3' => true, - ), - ), - 'stream_context_create' => array( - 1 => array( - 'name' => 'params', - '5.2' => false, - '5.3' => true, - ), - ), - 'stream_copy_to_stream' => array( - 3 => array( - 'name' => 'offset', - '5.0' => false, - '5.1' => true, - ), - ), - 'stream_get_contents' => array( - 2 => array( - 'name' => 'offset', - '5.0' => false, - '5.1' => true, - ), - ), - 'stream_wrapper_register' => array( - 2 => array( - 'name' => 'flags', - '5.2.3' => false, - '5.2.4' => true, - ), - ), - 'stristr' => array( - 2 => array( - 'name' => 'before_needle', - '5.2' => false, - '5.3' => true, - ), - ), - 'strstr' => array( - 2 => array( - 'name' => 'before_needle', - '5.2' => false, - '5.3' => true, - ), - ), - 'str_word_count' => array( - 2 => array( - 'name' => 'charlist', - '5.0' => false, - '5.1' => true, - ), - ), - 'substr_count' => array( - 2 => array( - 'name' => 'offset', - '5.0' => false, - '5.1' => true, - ), - 3 => array( - 'name' => 'length', - '5.0' => false, - '5.1' => true, - ), - ), - 'sybase_connect' => array( - 5 => array( - 'name' => 'new', - '5.2' => false, - '5.3' => true, - ), - ), - 'timezone_transitions_get' => array( - 1 => array( - 'name' => 'timestamp_begin', - '5.2' => false, - '5.3' => true, - ), - 2 => array( - 'name' => 'timestamp_end', - '5.2' => false, - '5.3' => true, - ), - ), - 'timezone_identifiers_list' => array( - 0 => array( - 'name' => 'what', - '5.2' => false, - '5.3' => true, - ), - 1 => array( - 'name' => 'country', - '5.2' => false, - '5.3' => true, - ), - ), - 'token_get_all' => array( - 1 => array( - 'name' => 'flags', - '5.6' => false, - '7.0' => true, - ), - ), - 'ucwords' => array( - 1 => array( - 'name' => 'delimiters', - '5.4.31' => false, - '5.5.15' => false, - '5.4.32' => true, - '5.5.16' => true, - ), - ), - 'unpack' => array( - 2 => array( - 'name' => 'offset', - '7.0' => false, - '7.1' => true, - ), - ), - 'unserialize' => array( - 1 => array( - 'name' => 'options', - '5.6' => false, - '7.0' => true, - ), - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.0 - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of function names. - $this->newFunctionParameters = $this->arrayKeysToLowercase($this->newFunctionParameters); - - return array(\T_STRING); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.0 - * - * @param \PHP_CodeSniffer_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(); - - $ignore = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_CONST => true, - ); - - $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevToken]['code']]) === true) { - // Not a call to a PHP function. - return; - } - - $function = $tokens[$stackPtr]['content']; - $functionLc = strtolower($function); - - if (isset($this->newFunctionParameters[$functionLc]) === false) { - return; - } - - $parameterCount = $this->getFunctionCallParameterCount($phpcsFile, $stackPtr); - if ($parameterCount === 0) { - return; - } - - // If the parameter count returned > 0, we know there will be valid open parenthesis. - $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); - $parameterOffsetFound = $parameterCount - 1; - - foreach ($this->newFunctionParameters[$functionLc] as $offset => $parameterDetails) { - if ($offset <= $parameterOffsetFound) { - $itemInfo = array( - 'name' => $function, - 'nameLc' => $functionLc, - 'offset' => $offset, - ); - $this->handleFeature($phpcsFile, $openParenthesis, $itemInfo); - } - } - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newFunctionParameters[$itemInfo['nameLc']][$itemInfo['offset']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array('name'); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - $errorInfo['paramName'] = $itemArray['name']; - - return $errorInfo; - } - - - /** - * Get the item name to be used for the creation of the error code. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * @param array $errorInfo Detail information about an item. - * - * @return string - */ - protected function getItemName(array $itemInfo, array $errorInfo) - { - return $itemInfo['name'] . '_' . $errorInfo['paramName']; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The function %s() does not have a parameter "%s" in PHP version %s or earlier'; - } - - - /** - * Allow for concrete child classes to filter the error data before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param array $data The error data array which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return array - */ - protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) - { - array_shift($data); - array_unshift($data, $itemInfo['name'], $errorInfo['paramName']); - return $data; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php deleted file mode 100644 index c1a0ec4e..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/NewFunctionsSniff.php +++ /dev/null @@ -1,2008 +0,0 @@ - array(string => bool)) - */ - protected $newFunctions = array( - 'iterator_count' => array( - '5.0' => false, - '5.1' => true, - ), - 'iterator_to_array' => array( - '5.0' => false, - '5.1' => true, - ), - 'spl_autoload_call' => array( - '5.0' => false, - '5.1' => true, - ), - 'spl_autoload_extensions' => array( - '5.0' => false, - '5.1' => true, - ), - 'spl_autoload_functions' => array( - '5.0' => false, - '5.1' => true, - ), - 'spl_autoload_register' => array( - '5.0' => false, - '5.1' => true, - ), - 'spl_autoload_unregister' => array( - '5.0' => false, - '5.1' => true, - ), - 'spl_autoload' => array( - '5.0' => false, - '5.1' => true, - ), - 'hash_hmac' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'array_fill_keys' => array( - '5.1' => false, - '5.2' => true, - ), - 'error_get_last' => array( - '5.1' => false, - '5.2' => true, - ), - 'image_type_to_extension' => array( - '5.1' => false, - '5.2' => true, - ), - 'memory_get_peak_usage' => array( - '5.1' => false, - '5.2' => true, - ), - 'sys_get_temp_dir' => array( - '5.1' => false, - '5.2' => true, - ), - 'timezone_abbreviations_list' => array( - '5.1' => false, - '5.2' => true, - ), - 'timezone_identifiers_list' => array( - '5.1' => false, - '5.2' => true, - ), - 'timezone_name_from_abbr' => array( - '5.1' => false, - '5.2' => true, - ), - 'stream_socket_shutdown' => array( - '5.1' => false, - '5.2' => true, - ), - 'imagegrabscreen' => array( - '5.1' => false, - '5.2' => true, - ), - 'imagegrabwindow' => array( - '5.1' => false, - '5.2' => true, - ), - 'libxml_disable_entity_loader' => array( - '5.1' => false, - '5.2' => true, - ), - 'mb_stripos' => array( - '5.1' => false, - '5.2' => true, - ), - 'mb_stristr' => array( - '5.1' => false, - '5.2' => true, - ), - 'mb_strrchr' => array( - '5.1' => false, - '5.2' => true, - ), - 'mb_strrichr' => array( - '5.1' => false, - '5.2' => true, - ), - 'mb_strripos' => array( - '5.1' => false, - '5.2' => true, - ), - 'ming_setSWFCompression' => array( - '5.1' => false, - '5.2' => true, - ), - 'openssl_csr_get_public_key' => array( - '5.1' => false, - '5.2' => true, - ), - 'openssl_csr_get_subject' => array( - '5.1' => false, - '5.2' => true, - ), - 'openssl_pkey_get_details' => array( - '5.1' => false, - '5.2' => true, - ), - 'spl_object_hash' => array( - '5.1' => false, - '5.2' => true, - ), - 'iterator_apply' => array( - '5.1' => false, - '5.2' => true, - ), - 'preg_last_error' => array( - '5.1' => false, - '5.2' => true, - ), - 'pg_field_table' => array( - '5.1' => false, - '5.2' => true, - ), - 'posix_initgroups' => array( - '5.1' => false, - '5.2' => true, - ), - 'gmp_nextprime' => array( - '5.1' => false, - '5.2' => true, - ), - 'xmlwriter_full_end_element' => array( - '5.1' => false, - '5.2' => true, - ), - 'xmlwriter_write_raw' => array( - '5.1' => false, - '5.2' => true, - ), - 'xmlwriter_start_dtd_entity' => array( - '5.1' => false, - '5.2' => true, - ), - 'xmlwriter_end_dtd_entity' => array( - '5.1' => false, - '5.2' => true, - ), - 'xmlwriter_write_dtd_entity' => array( - '5.1' => false, - '5.2' => true, - ), - 'filter_has_var' => array( - '5.1' => false, - '5.2' => true, - ), - 'filter_id' => array( - '5.1' => false, - '5.2' => true, - ), - 'filter_input_array' => array( - '5.1' => false, - '5.2' => true, - ), - 'filter_input' => array( - '5.1' => false, - '5.2' => true, - ), - 'filter_list' => array( - '5.1' => false, - '5.2' => true, - ), - 'filter_var_array' => array( - '5.1' => false, - '5.2' => true, - ), - 'filter_var' => array( - '5.1' => false, - '5.2' => true, - ), - 'json_decode' => array( - '5.1' => false, - '5.2' => true, - ), - 'json_encode' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_close' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_entry_close' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_entry_compressedsize' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_entry_compressionmethod' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_entry_filesize' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_entry_name' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_entry_open' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_entry_read' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_open' => array( - '5.1' => false, - '5.2' => true, - ), - 'zip_read' => array( - '5.1' => false, - '5.2' => true, - ), - - 'array_replace' => array( - '5.2' => false, - '5.3' => true, - ), - 'array_replace_recursive' => array( - '5.2' => false, - '5.3' => true, - ), - 'class_alias' => array( - '5.2' => false, - '5.3' => true, - ), - 'forward_static_call' => array( - '5.2' => false, - '5.3' => true, - ), - 'forward_static_call_array' => array( - '5.2' => false, - '5.3' => true, - ), - 'gc_collect_cycles' => array( - '5.2' => false, - '5.3' => true, - ), - 'gc_disable' => array( - '5.2' => false, - '5.3' => true, - ), - 'gc_enable' => array( - '5.2' => false, - '5.3' => true, - ), - 'gc_enabled' => array( - '5.2' => false, - '5.3' => true, - ), - 'get_called_class' => array( - '5.2' => false, - '5.3' => true, - ), - 'gethostname' => array( - '5.2' => false, - '5.3' => true, - ), - 'header_remove' => array( - '5.2' => false, - '5.3' => true, - ), - 'lcfirst' => array( - '5.2' => false, - '5.3' => true, - ), - 'parse_ini_string' => array( - '5.2' => false, - '5.3' => true, - ), - 'quoted_printable_encode' => array( - '5.2' => false, - '5.3' => true, - ), - 'str_getcsv' => array( - '5.2' => false, - '5.3' => true, - ), - 'stream_context_set_default' => array( - '5.2' => false, - '5.3' => true, - ), - 'stream_supports_lock' => array( - '5.2' => false, - '5.3' => true, - ), - 'stream_context_get_params' => array( - '5.2' => false, - '5.3' => true, - ), - 'date_add' => array( - '5.2' => false, - '5.3' => true, - ), - 'date_create_from_format' => array( - '5.2' => false, - '5.3' => true, - ), - 'date_diff' => array( - '5.2' => false, - '5.3' => true, - ), - 'date_get_last_errors' => array( - '5.2' => false, - '5.3' => true, - ), - 'date_parse_from_format' => array( - '5.2' => false, - '5.3' => true, - ), - 'date_sub' => array( - '5.2' => false, - '5.3' => true, - ), - 'timezone_version_get' => array( - '5.2' => false, - '5.3' => true, - ), - 'gmp_testbit' => array( - '5.2' => false, - '5.3' => true, - ), - 'hash_copy' => array( - '5.2' => false, - '5.3' => true, - ), - 'imap_gc' => array( - '5.2' => false, - '5.3' => true, - ), - 'imap_utf8_to_mutf7' => array( - '5.2' => false, - '5.3' => true, - ), - 'imap_mutf7_to_utf8' => array( - '5.2' => false, - '5.3' => true, - ), - 'json_last_error' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqli_get_cache_stats' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqli_fetch_all' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqli_get_connection_status' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqli_poll' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqli_read_async_query' => array( - '5.2' => false, - '5.3' => true, - ), - 'openssl_random_pseudo_bytes' => array( - '5.2' => false, - '5.3' => true, - ), - 'pcntl_signal_dispatch' => array( - '5.2' => false, - '5.3' => true, - ), - 'pcntl_sigprocmask' => array( - '5.2' => false, - '5.3' => true, - ), - 'pcntl_sigtimedwait' => array( - '5.2' => false, - '5.3' => true, - ), - 'pcntl_sigwaitinfo' => array( - '5.2' => false, - '5.3' => true, - ), - 'preg_filter' => array( - '5.2' => false, - '5.3' => true, - ), - 'msg_queue_exists' => array( - '5.2' => false, - '5.3' => true, - ), - 'shm_has_vars' => array( - '5.2' => false, - '5.3' => true, - ), - 'acosh' => array( - '5.2' => false, - '5.3' => true, - ), - 'asinh' => array( - '5.2' => false, - '5.3' => true, - ), - 'atanh' => array( - '5.2' => false, - '5.3' => true, - ), - 'expm1' => array( - '5.2' => false, - '5.3' => true, - ), - 'log1p' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_describe' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_dict_exists' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_free_dict' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_free' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_get_error' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_init' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_list_dicts' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_request_dict' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_request_pwl_dict' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_broker_set_ordering' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_dict_add_to_personal' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_dict_add_to_session' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_dict_check' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_dict_describe' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_dict_get_error' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_dict_is_in_session' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_dict_quick_check' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_dict_store_replacement' => array( - '5.2' => false, - '5.3' => true, - ), - 'enchant_dict_suggest' => array( - '5.2' => false, - '5.3' => true, - ), - 'finfo_buffer' => array( - '5.2' => false, - '5.3' => true, - ), - 'finfo_close' => array( - '5.2' => false, - '5.3' => true, - ), - 'finfo_file' => array( - '5.2' => false, - '5.3' => true, - ), - 'finfo_open' => array( - '5.2' => false, - '5.3' => true, - ), - 'finfo_set_flags' => array( - '5.2' => false, - '5.3' => true, - ), - 'intl_error_name' => array( - '5.2' => false, - '5.3' => true, - ), - 'intl_get_error_code' => array( - '5.2' => false, - '5.3' => true, - ), - 'intl_get_error_message' => array( - '5.2' => false, - '5.3' => true, - ), - 'intl_is_failure' => array( - '5.2' => false, - '5.3' => true, - ), - - 'hex2bin' => array( - '5.3' => false, - '5.4' => true, - ), - 'http_response_code' => array( - '5.3' => false, - '5.4' => true, - ), - 'get_declared_traits' => array( - '5.3' => false, - '5.4' => true, - ), - 'getimagesizefromstring' => array( - '5.3' => false, - '5.4' => true, - ), - 'stream_set_chunk_size' => array( - '5.3' => false, - '5.4' => true, - ), - 'socket_import_stream' => array( - '5.3' => false, - '5.4' => true, - ), - 'trait_exists' => array( - '5.3' => false, - '5.4' => true, - ), - 'header_register_callback' => array( - '5.3' => false, - '5.4' => true, - ), - 'class_uses' => array( - '5.3' => false, - '5.4' => true, - ), - 'session_status' => array( - '5.3' => false, - '5.4' => true, - ), - 'session_register_shutdown' => array( - '5.3' => false, - '5.4' => true, - ), - 'mysqli_error_list' => array( - '5.3' => false, - '5.4' => true, - ), - 'mysqli_stmt_error_list' => array( - '5.3' => false, - '5.4' => true, - ), - 'libxml_set_external_entity_loader' => array( - '5.3' => false, - '5.4' => true, - ), - 'ldap_control_paged_result' => array( - '5.3' => false, - '5.4' => true, - ), - 'ldap_control_paged_result_response' => array( - '5.3' => false, - '5.4' => true, - ), - 'transliteral_create' => array( - '5.3' => false, - '5.4' => true, - ), - 'transliteral_create_from_rules' => array( - '5.3' => false, - '5.4' => true, - ), - 'transliteral_create_inverse' => array( - '5.3' => false, - '5.4' => true, - ), - 'transliteral_get_error_code' => array( - '5.3' => false, - '5.4' => true, - ), - 'transliteral_get_error_message' => array( - '5.3' => false, - '5.4' => true, - ), - 'transliteral_list_ids' => array( - '5.3' => false, - '5.4' => true, - ), - 'transliteral_transliterate' => array( - '5.3' => false, - '5.4' => true, - ), - 'zlib_decode' => array( - '5.3' => false, - '5.4' => true, - ), - 'zlib_encode' => array( - '5.3' => false, - '5.4' => true, - ), - - 'array_column' => array( - '5.4' => false, - '5.5' => true, - ), - 'boolval' => array( - '5.4' => false, - '5.5' => true, - ), - 'json_last_error_msg' => array( - '5.4' => false, - '5.5' => true, - ), - 'password_get_info' => array( - '5.4' => false, - '5.5' => true, - ), - 'password_hash' => array( - '5.4' => false, - '5.5' => true, - ), - 'password_needs_rehash' => array( - '5.4' => false, - '5.5' => true, - ), - 'password_verify' => array( - '5.4' => false, - '5.5' => true, - ), - 'hash_pbkdf2' => array( - '5.4' => false, - '5.5' => true, - ), - 'openssl_pbkdf2' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_escape' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_file_create' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_multi_setopt' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_multi_strerror' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_pause' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_reset' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_share_close' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_share_init' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_share_setopt' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_strerror' => array( - '5.4' => false, - '5.5' => true, - ), - 'curl_unescape' => array( - '5.4' => false, - '5.5' => true, - ), - 'imageaffinematrixconcat' => array( - '5.4' => false, - '5.5' => true, - ), - 'imageaffinematrixget' => array( - '5.4' => false, - '5.5' => true, - ), - 'imagecrop' => array( - '5.4' => false, - '5.5' => true, - ), - 'imagecropauto' => array( - '5.4' => false, - '5.5' => true, - ), - 'imageflip' => array( - '5.4' => false, - '5.5' => true, - ), - 'imagepalettetotruecolor' => array( - '5.4' => false, - '5.5' => true, - ), - 'imagescale' => array( - '5.4' => false, - '5.5' => true, - ), - 'mysqli_begin_transaction' => array( - '5.4' => false, - '5.5' => true, - ), - 'mysqli_release_savepoint' => array( - '5.4' => false, - '5.5' => true, - ), - 'mysqli_savepoint' => array( - '5.4' => false, - '5.5' => true, - ), - 'pg_escape_literal' => array( - '5.4' => false, - '5.5' => true, - ), - 'pg_escape_identifier' => array( - '5.4' => false, - '5.5' => true, - ), - 'socket_sendmsg' => array( - '5.4' => false, - '5.5' => true, - ), - 'socket_recvmsg' => array( - '5.4' => false, - '5.5' => true, - ), - 'socket_cmsg_space' => array( - '5.4' => false, - '5.5' => true, - ), - 'cli_get_process_title' => array( - '5.4' => false, - '5.5' => true, - ), - 'cli_set_process_title' => array( - '5.4' => false, - '5.5' => true, - ), - 'datefmt_format_object' => array( - '5.4' => false, - '5.5' => true, - ), - 'datefmt_get_calendar_object' => array( - '5.4' => false, - '5.5' => true, - ), - 'datefmt_get_timezone' => array( - '5.4' => false, - '5.5' => true, - ), - 'datefmt_set_timezone' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_create_instance' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_keyword_values_for_locale' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_now' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_available_locales' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_time' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_set_time' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_add' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_set_time_zone' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_after' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_before' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_set' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_roll' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_clear' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_field_difference' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_actual_maximum' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_actual_minumum' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_day_of_week_type' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_first_day_of_week' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_greatest_minimum' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_least_maximum' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_locale' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_maximum' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_minimal_days_in_first_week' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_minimum' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_time_zone' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_type' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_weekend_transition' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_in_daylight_time' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_is_equivalent_to' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_is_lenient' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_equals' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_repeated_wall_time_option' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_skipped_wall_time_option' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_set_repeated_wall_time_option' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_set_skipped_wall_time_option' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_from_date_time' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_to_date_time' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_error_code' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlcal_get_error_message' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlgregcal_create_instance' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlgregcal_set_gregorian_change' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlgregcal_get_gregorian_change' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlgregcal_is_leap_year' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_create_time_zone' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_create_default' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_id' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_gmt' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_unknown' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_create_enumeration' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_count_equivalent_ids' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_create_time_zone_id_enumeration' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_canonical_id' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_region' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_tz_data_version' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_equivalent_id' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_use_daylight_time' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_offset' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_raw_offset' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_has_same_rules' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_display_name' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_dst_savings' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_from_date_time_zone' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_to_date_time_zone' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_error_code' => array( - '5.4' => false, - '5.5' => true, - ), - 'intlz_get_error_message' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache_compile_file' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache_get_configuration' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache_get_status' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache_invalidate' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache_reset' => array( - '5.4' => false, - '5.5' => true, - ), - - 'opcache_is_script_cached' => array( - '5.5.10' => false, - '5.5.11' => true, - ), - - 'gmp_root' => array( - '5.5' => false, - '5.6' => true, - ), - 'gmp_rootrem' => array( - '5.5' => false, - '5.6' => true, - ), - 'hash_equals' => array( - '5.5' => false, - '5.6' => true, - ), - 'ldap_escape' => array( - '5.5' => false, - '5.6' => true, - ), - 'ldap_modify_batch' => array( - '5.4.25' => false, - '5.5.9' => false, - '5.4.26' => true, - '5.5.10' => true, - '5.6.0' => true, - ), - 'mysqli_get_links_stats' => array( - '5.5' => false, - '5.6' => true, - ), - 'openssl_get_cert_locations' => array( - '5.5' => false, - '5.6' => true, - ), - 'openssl_x509_fingerprint' => array( - '5.5' => false, - '5.6' => true, - ), - 'openssl_spki_new' => array( - '5.5' => false, - '5.6' => true, - ), - 'openssl_spki_verify' => array( - '5.5' => false, - '5.6' => true, - ), - 'openssl_spki_export_challenge' => array( - '5.5' => false, - '5.6' => true, - ), - 'openssl_spki_export' => array( - '5.5' => false, - '5.6' => true, - ), - 'pg_connect_poll' => array( - '5.5' => false, - '5.6' => true, - ), - 'pg_consume_input' => array( - '5.5' => false, - '5.6' => true, - ), - 'pg_flush' => array( - '5.5' => false, - '5.6' => true, - ), - 'pg_lo_truncate' => array( - '5.5' => false, - '5.6' => true, - ), - 'pg_socket' => array( - '5.5' => false, - '5.6' => true, - ), - 'session_abort' => array( - '5.5' => false, - '5.6' => true, - ), - 'session_reset' => array( - '5.5' => false, - '5.6' => true, - ), - - 'random_bytes' => array( - '5.6' => false, - '7.0' => true, - ), - 'random_int' => array( - '5.6' => false, - '7.0' => true, - ), - 'error_clear_last' => array( - '5.6' => false, - '7.0' => true, - ), - 'gmp_random_seed' => array( - '5.6' => false, - '7.0' => true, - ), - 'intdiv' => array( - '5.6' => false, - '7.0' => true, - ), - 'preg_replace_callback_array' => array( - '5.6' => false, - '7.0' => true, - ), - 'gc_mem_caches' => array( - '5.6' => false, - '7.0' => true, - ), - 'get_resources' => array( - '5.6' => false, - '7.0' => true, - ), - 'posix_setrlimit' => array( - '5.6' => false, - '7.0' => true, - ), - 'inflate_add' => array( - '5.6' => false, - '7.0' => true, - ), - 'deflate_add' => array( - '5.6' => false, - '7.0' => true, - ), - 'inflate_init' => array( - '5.6' => false, - '7.0' => true, - ), - 'deflate_init' => array( - '5.6' => false, - '7.0' => true, - ), - - 'socket_export_stream' => array( - '7.0.6' => false, - '7.0.7' => true, - ), - - 'curl_multi_errno' => array( - '7.0' => false, - '7.1' => true, - ), - 'curl_share_errno' => array( - '7.0' => false, - '7.1' => true, - ), - 'curl_share_strerror' => array( - '7.0' => false, - '7.1' => true, - ), - 'is_iterable' => array( - '7.0' => false, - '7.1' => true, - ), - 'pcntl_async_signals' => array( - '7.0' => false, - '7.1' => true, - ), - 'pcntl_signal_get_handler' => array( - '7.0' => false, - '7.1' => true, - ), - 'session_create_id' => array( - '7.0' => false, - '7.1' => true, - ), - 'session_gc' => array( - '7.0' => false, - '7.1' => true, - ), - 'sapi_windows_cp_set' => array( - '7.0' => false, - '7.1' => true, - ), - 'sapi_windows_cp_get' => array( - '7.0' => false, - '7.1' => true, - ), - 'sapi_windows_cp_is_utf8' => array( - '7.0' => false, - '7.1' => true, - ), - 'sapi_windows_cp_conv' => array( - '7.0' => false, - '7.1' => true, - ), - - 'hash_hkdf' => array( - '7.1.1' => false, - '7.1.2' => true, - ), - 'oci_register_taf_callback' => array( - '7.1.6' => false, - '7.1.7' => true, - ), - 'oci_unregister_taf_callback' => array( - '7.1.8' => false, - '7.1.9' => true, - ), - - 'stream_isatty' => array( - '7.1' => false, - '7.2' => true, - ), - 'sapi_windows_vt100_support' => array( - '7.1' => false, - '7.2' => true, - ), - 'ftp_append' => array( - '7.1' => false, - '7.2' => true, - ), - 'hash_hmac_algos' => array( - '7.1' => false, - '7.2' => true, - ), - 'imagebmp' => array( - '7.1' => false, - '7.2' => true, - ), - 'imagecreatefrombmp' => array( - '7.1' => false, - '7.2' => true, - ), - 'imagegetclip' => array( - '7.1' => false, - '7.2' => true, - ), - 'imageopenpolygon' => array( - '7.1' => false, - '7.2' => true, - ), - 'imageresolution' => array( - '7.1' => false, - '7.2' => true, - ), - 'imagesetclip' => array( - '7.1' => false, - '7.2' => true, - ), - 'ldap_exop' => array( - '7.1' => false, - '7.2' => true, - ), - 'ldap_exop_passwd' => array( - '7.1' => false, - '7.2' => true, - ), - 'ldap_exop_whoami' => array( - '7.1' => false, - '7.2' => true, - ), - 'ldap_parse_exop' => array( - '7.1' => false, - '7.2' => true, - ), - 'mb_chr' => array( - '7.1' => false, - '7.2' => true, - ), - 'mb_ord' => array( - '7.1' => false, - '7.2' => true, - ), - 'mb_scrub' => array( - '7.1' => false, - '7.2' => true, - ), - 'socket_addrinfo_lookup' => array( - '7.1' => false, - '7.2' => true, - ), - 'socket_addrinfo_connect' => array( - '7.1' => false, - '7.2' => true, - ), - 'socket_addrinfo_bind' => array( - '7.1' => false, - '7.2' => true, - ), - 'socket_addrinfo_explain' => array( - '7.1' => false, - '7.2' => true, - ), - 'spl_object_id' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_add' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_base642bin' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_bin2base64' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_bin2hex' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_compare' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_aes256gcm_decrypt' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_aes256gcm_encrypt' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_aes256gcm_is_available' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_aes256gcm_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_chacha20poly1305_decrypt' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_chacha20poly1305_encrypt' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_chacha20poly1305_ietf_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_chacha20poly1305_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_aead_xchacha20poly1305_ietf_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_auth_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_auth_verify' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_auth' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box_keypair_from_secretkey_and_publickey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box_keypair' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box_open' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box_publickey_from_secretkey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box_publickey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box_seal_open' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box_seal' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box_secretkey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box_seed_keypair' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_box' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_generichash_final' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_generichash_init' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_generichash_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_generichash_update' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_generichash' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_kdf_derive_from_key' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_kdf_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_kx_client_session_keys' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_kx_keypair' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_kx_publickey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_kx_secretkey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_kx_seed_keypair' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_kx_server_session_keys' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_pwhash_scryptsalsa208sha256_str_verify' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_pwhash_scryptsalsa208sha256_str' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_pwhash_scryptsalsa208sha256' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_pwhash_str_needs_rehash' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_pwhash_str_verify' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_pwhash_str' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_pwhash' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_scalarmult_base' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_scalarmult' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_secretbox_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_secretbox_open' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_secretbox' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_secretstream_xchacha20poly1305_init_pull' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_secretstream_xchacha20poly1305_init_push' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_secretstream_xchacha20poly1305_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_secretstream_xchacha20poly1305_pull' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_secretstream_xchacha20poly1305_push' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_secretstream_xchacha20poly1305_rekey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_shorthash_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_shorthash' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_detached' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_ed25519_pk_to_curve25519' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_ed25519_sk_to_curve25519' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_keypair_from_secretkey_and_publickey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_keypair' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_open' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_publickey_from_secretkey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_publickey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_secretkey' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_seed_keypair' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign_verify_detached' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_sign' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_stream_keygen' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_stream_xor' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_crypto_stream' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_hex2bin' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_increment' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_memcmp' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_memzero' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_pad' => array( - '7.1' => false, - '7.2' => true, - ), - 'sodium_unpad' => array( - '7.1' => false, - '7.2' => true, - ), - // Introduced in 7.2.14 and 7.3.1 simultanously. - 'oci_set_call_timeout' => array( - '7.2.13' => false, - '7.2.14' => true, - ), - // Introduced in 7.2.14 and 7.3.1 simultanously. - 'oci_set_db_operation' => array( - '7.2.13' => false, - '7.2.14' => true, - ), - - 'hrtime' => array( - '7.2' => false, - '7.3' => true, - ), - 'is_countable' => array( - '7.2' => false, - '7.3' => true, - ), - 'array_key_first' => array( - '7.2' => false, - '7.3' => true, - ), - 'array_key_last' => array( - '7.2' => false, - '7.3' => true, - ), - 'fpm_get_status' => array( - '7.2' => false, - '7.3' => true, - ), - 'net_get_interfaces' => array( - '7.2' => false, - '7.3' => true, - ), - 'gmp_binomial' => array( - '7.2' => false, - '7.3' => true, - ), - 'gmp_lcm' => array( - '7.2' => false, - '7.3' => true, - ), - 'gmp_perfect_power' => array( - '7.2' => false, - '7.3' => true, - ), - 'gmp_kronecker' => array( - '7.2' => false, - '7.3' => true, - ), - 'ldap_add_ext' => array( - '7.2' => false, - '7.3' => true, - ), - 'ldap_bind_ext' => array( - '7.2' => false, - '7.3' => true, - ), - 'ldap_delete_ext' => array( - '7.2' => false, - '7.3' => true, - ), - 'ldap_exop_refresh' => array( - '7.2' => false, - '7.3' => true, - ), - 'ldap_mod_add_ext' => array( - '7.2' => false, - '7.3' => true, - ), - 'ldap_mod_replace_ext' => array( - '7.2' => false, - '7.3' => true, - ), - 'ldap_mod_del_ext' => array( - '7.2' => false, - '7.3' => true, - ), - 'ldap_rename_ext' => array( - '7.2' => false, - '7.3' => true, - ), - 'normalizer_get_raw_decomposition' => array( - '7.2' => false, - '7.3' => true, - ), - 'openssl_pkey_derive' => array( - '7.2' => false, - '7.3' => true, - ), - 'socket_wsaprotocol_info_export' => array( - '7.2' => false, - '7.3' => true, - ), - 'socket_wsaprotocol_info_import' => array( - '7.2' => false, - '7.3' => true, - ), - 'socket_wsaprotocol_info_release' => array( - '7.2' => false, - '7.3' => true, - ), - - 'get_mangled_object_vars' => array( - '7.3' => false, - '7.4' => true, - ), - 'imagecreatefromtga' => array( - '7.3' => false, - '7.4' => true, - ), - 'mb_str_split' => array( - '7.3' => false, - '7.4' => true, - ), - 'openssl_x509_verify' => array( - '7.3' => false, - '7.4' => true, - ), - 'password_algos' => array( - '7.3' => false, - '7.4' => true, - ), - 'pcntl_unshare' => array( - '7.3' => false, - '7.4' => true, - ), - 'sapi_windows_set_ctrl_handler' => array( - '7.3' => false, - '7.4' => true, - ), - 'sapi_windows_generate_ctrl_event' => array( - '7.3' => false, - '7.4' => true, - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.6 - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of function names. - $this->newFunctions = $this->arrayKeysToLowercase($this->newFunctions); - - return array(\T_STRING); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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(); - - $ignore = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_CONST => true, - ); - - $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevToken]['code']]) === true) { - // Not a call to a PHP function. - return; - - } elseif ($tokens[$prevToken]['code'] === \T_NS_SEPARATOR && $tokens[$prevToken - 1]['code'] === \T_STRING) { - // Namespaced function. - return; - } - - $function = $tokens[$stackPtr]['content']; - $functionLc = strtolower($function); - - if (isset($this->newFunctions[$functionLc]) === false) { - return; - } - - $itemInfo = array( - 'name' => $function, - 'nameLc' => $functionLc, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newFunctions[$itemInfo['nameLc']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The function %s() is not present in PHP version %s or earlier'; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php deleted file mode 100644 index 301e5e07..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/OptionalToRequiredFunctionParametersSniff.php +++ /dev/null @@ -1,173 +0,0 @@ - array( - 1 => array( - 'name' => 'salt', - '5.6' => 'recommended', - ), - ), - 'parse_str' => array( - 1 => array( - 'name' => 'result', - '7.2' => false, - ), - ), - ); - - - /** - * Determine whether an error/warning should be thrown for an item based on collected information. - * - * @since 8.1.0 - * - * @param array $errorInfo Detail information about an item. - * - * @return bool - */ - protected function shouldThrowError(array $errorInfo) - { - return ($errorInfo['optionalDeprecated'] !== '' - || $errorInfo['optionalRemoved'] !== '' - || $errorInfo['optionalRecommended'] !== ''); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 8.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = array( - 'paramName' => '', - 'optionalRecommended' => '', - 'optionalDeprecated' => '', - 'optionalRemoved' => '', - 'error' => false, - ); - - $versionArray = $this->getVersionArray($itemArray); - - if (empty($versionArray) === false) { - foreach ($versionArray as $version => $required) { - if ($this->supportsAbove($version) === true) { - if ($required === true && $errorInfo['optionalRemoved'] === '') { - $errorInfo['optionalRemoved'] = $version; - $errorInfo['error'] = true; - } elseif ($required === 'recommended' && $errorInfo['optionalRecommended'] === '') { - $errorInfo['optionalRecommended'] = $version; - } elseif ($errorInfo['optionalDeprecated'] === '') { - $errorInfo['optionalDeprecated'] = $version; - } - } - } - } - - $errorInfo['paramName'] = $itemArray['name']; - - return $errorInfo; - } - - - /** - * Generates the error or warning for this item. - * - * @since 8.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the relevant token in - * the stack. - * @param array $itemInfo Base information about the item. - * @param array $errorInfo Array with detail (version) information - * relevant to the item. - * - * @return void - */ - public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) - { - $error = 'The "%s" parameter for function %s() is missing. Passing this parameter is '; - if ($errorInfo['optionalRecommended'] === '') { - $error .= 'no longer optional. The optional nature of the parameter is '; - } else { - $error .= 'strongly recommended '; - } - - $errorCode = $this->stringToErrorCode($itemInfo['name'] . '_' . $errorInfo['paramName']); - $data = array( - $errorInfo['paramName'], - $itemInfo['name'], - ); - - if ($errorInfo['optionalRecommended'] !== '') { - $error .= 'since PHP %s '; - $errorCode .= 'SoftRecommended'; - $data[] = $errorInfo['optionalRecommended']; - } else { - if ($errorInfo['optionalDeprecated'] !== '') { - $error .= 'deprecated since PHP %s and '; - $errorCode .= 'SoftRequired'; - $data[] = $errorInfo['optionalDeprecated']; - } - - if ($errorInfo['optionalRemoved'] !== '') { - $error .= 'removed since PHP %s and '; - $errorCode .= 'HardRequired'; - $data[] = $errorInfo['optionalRemoved']; - } - - // Remove the last 'and' from the message. - $error = substr($error, 0, (\strlen($error) - 5)); - } - - $this->addMessage($phpcsFile, $error, $stackPtr, $errorInfo['error'], $errorCode, $data); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php deleted file mode 100644 index b4cad10b..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionParametersSniff.php +++ /dev/null @@ -1,292 +0,0 @@ - array( - 0 => array( - 'name' => 'age', - '7.4' => false, - 'callback' => 'curlVersionInvalidValue', - ), - ), - 'define' => array( - 2 => array( - 'name' => 'case_insensitive', - '7.3' => false, // Slated for removal in PHP 8.0.0. - ), - ), - 'gmmktime' => array( - 6 => array( - 'name' => 'is_dst', - '5.1' => false, - '7.0' => true, - ), - ), - 'ldap_first_attribute' => array( - 2 => array( - 'name' => 'ber_identifier', - '5.2.4' => true, - ), - ), - 'ldap_next_attribute' => array( - 2 => array( - 'name' => 'ber_identifier', - '5.2.4' => true, - ), - ), - 'mktime' => array( - 6 => array( - 'name' => 'is_dst', - '5.1' => false, - '7.0' => true, - ), - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.0 - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of function names. - $this->removedFunctionParameters = $this->arrayKeysToLowercase($this->removedFunctionParameters); - - return array(\T_STRING); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.0 - * - * @param \PHP_CodeSniffer_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(); - - $ignore = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_CONST => true, - ); - - $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevToken]['code']]) === true) { - // Not a call to a PHP function. - return; - } - - $function = $tokens[$stackPtr]['content']; - $functionLc = strtolower($function); - - if (isset($this->removedFunctionParameters[$functionLc]) === false) { - return; - } - - $parameters = $this->getFunctionCallParameters($phpcsFile, $stackPtr); - $parameterCount = \count($parameters); - if ($parameterCount === 0) { - return; - } - - // If the parameter count returned > 0, we know there will be valid open parenthesis. - $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); - $parameterOffsetFound = $parameterCount - 1; - - foreach ($this->removedFunctionParameters[$functionLc] as $offset => $parameterDetails) { - if ($offset <= $parameterOffsetFound) { - if (isset($parameterDetails['callback']) && method_exists($this, $parameterDetails['callback'])) { - if ($this->{$parameterDetails['callback']}($phpcsFile, $parameters[($offset + 1)]) === false) { - continue; - } - } - - $itemInfo = array( - 'name' => $function, - 'nameLc' => $functionLc, - 'offset' => $offset, - ); - $this->handleFeature($phpcsFile, $openParenthesis, $itemInfo); - } - } - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->removedFunctionParameters[$itemInfo['nameLc']][$itemInfo['offset']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array('name', 'callback'); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - $errorInfo['paramName'] = $itemArray['name']; - - return $errorInfo; - } - - - /** - * Get the item name to be used for the creation of the error code. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * @param array $errorInfo Detail information about an item. - * - * @return string - */ - protected function getItemName(array $itemInfo, array $errorInfo) - { - return $itemInfo['name'] . '_' . $errorInfo['paramName']; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The "%s" parameter for function %s() is '; - } - - - /** - * Filter the error data before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param array $data The error data array which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return array - */ - protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) - { - array_shift($data); - array_unshift($data, $errorInfo['paramName'], $itemInfo['name']); - return $data; - } - - /** - * Check whether curl_version() was passed the default CURLVERSION_NOW. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param array $parameter Parameter info array. - * - * @return bool True if the value was not CURLVERSION_NOW, false otherwise. - */ - protected function curlVersionInvalidValue(File $phpcsFile, array $parameter) - { - $tokens = $phpcsFile->getTokens(); - $raw = ''; - for ($i = $parameter['start']; $i <= $parameter['end']; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']])) { - continue; - } - - $raw .= $tokens[$i]['content']; - } - - if ($raw !== 'CURLVERSION_NOW' - && $raw !== (string) \CURLVERSION_NOW - ) { - return true; - } - - return false; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php deleted file mode 100644 index 33f3d393..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RemovedFunctionsSniff.php +++ /dev/null @@ -1,1104 +0,0 @@ - array(string => bool|string|null)) - */ - protected $removedFunctions = array( - 'php_check_syntax' => array( - '5.0.5' => true, - 'alternative' => null, - ), - - 'pfpro_cleanup' => array( - '5.1' => true, - 'alternative' => null, - ), - 'pfpro_init' => array( - '5.1' => true, - 'alternative' => null, - ), - 'pfpro_process_raw' => array( - '5.1' => true, - 'alternative' => null, - ), - 'pfpro_process' => array( - '5.1' => true, - 'alternative' => null, - ), - 'pfpro_version' => array( - '5.1' => true, - 'alternative' => null, - ), - - 'call_user_method' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'call_user_func()', - ), - 'call_user_method_array' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'call_user_func_array()', - ), - 'define_syslog_variables' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => null, - ), - 'dl' => array( - '5.3' => false, - 'alternative' => null, - ), - 'ereg' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'preg_match()', - ), - 'ereg_replace' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'preg_replace()', - ), - 'eregi' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'preg_match()', - ), - 'eregi_replace' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'preg_replace()', - ), - 'imagepsbbox' => array( - '7.0' => true, - 'alternative' => null, - ), - 'imagepsencodefont' => array( - '7.0' => true, - 'alternative' => null, - ), - 'imagepsextendfont' => array( - '7.0' => true, - 'alternative' => null, - ), - 'imagepsfreefont' => array( - '7.0' => true, - 'alternative' => null, - ), - 'imagepsloadfont' => array( - '7.0' => true, - 'alternative' => null, - ), - 'imagepsslantfont' => array( - '7.0' => true, - 'alternative' => null, - ), - 'imagepstext' => array( - '7.0' => true, - 'alternative' => null, - ), - 'import_request_variables' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => null, - ), - 'ldap_sort' => array( - '7.0' => false, - 'alternative' => null, - ), - 'mcrypt_generic_end' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'mcrypt_generic_deinit()', - ), - 'mysql_db_query' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'mysqli::select_db() and mysqli::query()', - ), - 'mysql_escape_string' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'mysqli::real_escape_string()', - ), - 'mysql_list_dbs' => array( - '5.4' => false, - '7.0' => true, - 'alternative' => null, - ), - 'mysqli_bind_param' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => 'mysqli_stmt::bind_param()', - ), - 'mysqli_bind_result' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => 'mysqli_stmt::bind_result()', - ), - 'mysqli_client_encoding' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => 'mysqli::character_set_name()', - ), - 'mysqli_fetch' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => 'mysqli_stmt::fetch()', - ), - 'mysqli_param_count' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => 'mysqli_stmt_param_count()', - ), - 'mysqli_get_metadata' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => 'mysqli_stmt::result_metadata()', - ), - 'mysqli_send_long_data' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => 'mysqli_stmt::send_long_data()', - ), - 'magic_quotes_runtime' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => null, - ), - 'session_register' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_SESSION', - ), - 'session_unregister' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_SESSION', - ), - 'session_is_registered' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_SESSION', - ), - 'set_magic_quotes_runtime' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => null, - ), - 'set_socket_blocking' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'stream_set_blocking()', - ), - 'split' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'preg_split()', - ), - 'spliti' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => 'preg_split()', - ), - 'sql_regcase' => array( - '5.3' => false, - '7.0' => true, - 'alternative' => null, - ), - 'php_logo_guid' => array( - '5.5' => true, - 'alternative' => null, - ), - 'php_egg_logo_guid' => array( - '5.5' => true, - 'alternative' => null, - ), - 'php_real_logo_guid' => array( - '5.5' => true, - 'alternative' => null, - ), - 'zend_logo_guid' => array( - '5.5' => true, - 'alternative' => null, - ), - 'datefmt_set_timezone_id' => array( - '5.5' => false, - '7.0' => true, - 'alternative' => 'IntlDateFormatter::setTimeZone()', - ), - 'mcrypt_ecb' => array( - '5.5' => false, - '7.0' => true, - 'alternative' => null, - ), - 'mcrypt_cbc' => array( - '5.5' => false, - '7.0' => true, - 'alternative' => null, - ), - 'mcrypt_cfb' => array( - '5.5' => false, - '7.0' => true, - 'alternative' => null, - ), - 'mcrypt_ofb' => array( - '5.5' => false, - '7.0' => true, - 'alternative' => null, - ), - 'ocibindbyname' => array( - '5.4' => false, - 'alternative' => 'oci_bind_by_name()', - ), - 'ocicancel' => array( - '5.4' => false, - 'alternative' => 'oci_cancel()', - ), - 'ocicloselob' => array( - '5.4' => false, - 'alternative' => 'OCI-Lob::close()', - ), - 'ocicollappend' => array( - '5.4' => false, - 'alternative' => 'OCI-Collection::append()', - ), - 'ocicollassign' => array( - '5.4' => false, - 'alternative' => 'OCI-Collection::assign()', - ), - 'ocicollassignelem' => array( - '5.4' => false, - 'alternative' => 'OCI-Collection::assignElem()', - ), - 'ocicollgetelem' => array( - '5.4' => false, - 'alternative' => 'OCI-Collection::getElem()', - ), - 'ocicollmax' => array( - '5.4' => false, - 'alternative' => 'OCI-Collection::max()', - ), - 'ocicollsize' => array( - '5.4' => false, - 'alternative' => 'OCI-Collection::size()', - ), - 'ocicolltrim' => array( - '5.4' => false, - 'alternative' => 'OCI-Collection::trim()', - ), - 'ocicolumnisnull' => array( - '5.4' => false, - 'alternative' => 'oci_field_is_null()', - ), - 'ocicolumnname' => array( - '5.4' => false, - 'alternative' => 'oci_field_name()', - ), - 'ocicolumnprecision' => array( - '5.4' => false, - 'alternative' => 'oci_field_precision()', - ), - 'ocicolumnscale' => array( - '5.4' => false, - 'alternative' => 'oci_field_scale()', - ), - 'ocicolumnsize' => array( - '5.4' => false, - 'alternative' => 'oci_field_size()', - ), - 'ocicolumntype' => array( - '5.4' => false, - 'alternative' => 'oci_field_type()', - ), - 'ocicolumntyperaw' => array( - '5.4' => false, - 'alternative' => 'oci_field_type_raw()', - ), - 'ocicommit' => array( - '5.4' => false, - 'alternative' => 'oci_commit()', - ), - 'ocidefinebyname' => array( - '5.4' => false, - 'alternative' => 'oci_define_by_name()', - ), - 'ocierror' => array( - '5.4' => false, - 'alternative' => 'oci_error()', - ), - 'ociexecute' => array( - '5.4' => false, - 'alternative' => 'oci_execute()', - ), - 'ocifetch' => array( - '5.4' => false, - 'alternative' => 'oci_fetch()', - ), - 'ocifetchinto' => array( - '5.4' => false, - 'alternative' => null, - ), - 'ocifetchstatement' => array( - '5.4' => false, - 'alternative' => 'oci_fetch_all()', - ), - 'ocifreecollection' => array( - '5.4' => false, - 'alternative' => 'OCI-Collection::free()', - ), - 'ocifreecursor' => array( - '5.4' => false, - 'alternative' => 'oci_free_statement()', - ), - 'ocifreedesc' => array( - '5.4' => false, - 'alternative' => 'OCI-Lob::free()', - ), - 'ocifreestatement' => array( - '5.4' => false, - 'alternative' => 'oci_free_statement()', - ), - 'ociinternaldebug' => array( - '5.4' => false, - 'alternative' => 'oci_internal_debug()', - ), - 'ociloadlob' => array( - '5.4' => false, - 'alternative' => 'OCI-Lob::load()', - ), - 'ocilogoff' => array( - '5.4' => false, - 'alternative' => 'oci_close()', - ), - 'ocilogon' => array( - '5.4' => false, - 'alternative' => 'oci_connect()', - ), - 'ocinewcollection' => array( - '5.4' => false, - 'alternative' => 'oci_new_collection()', - ), - 'ocinewcursor' => array( - '5.4' => false, - 'alternative' => 'oci_new_cursor()', - ), - 'ocinewdescriptor' => array( - '5.4' => false, - 'alternative' => 'oci_new_descriptor()', - ), - 'ocinlogon' => array( - '5.4' => false, - 'alternative' => 'oci_new_connect()', - ), - 'ocinumcols' => array( - '5.4' => false, - 'alternative' => 'oci_num_fields()', - ), - 'ociparse' => array( - '5.4' => false, - 'alternative' => 'oci_parse()', - ), - 'ociplogon' => array( - '5.4' => false, - 'alternative' => 'oci_pconnect()', - ), - 'ociresult' => array( - '5.4' => false, - 'alternative' => 'oci_result()', - ), - 'ocirollback' => array( - '5.4' => false, - 'alternative' => 'oci_rollback()', - ), - 'ocirowcount' => array( - '5.4' => false, - 'alternative' => 'oci_num_rows()', - ), - 'ocisavelob' => array( - '5.4' => false, - 'alternative' => 'OCI-Lob::save()', - ), - 'ocisavelobfile' => array( - '5.4' => false, - 'alternative' => 'OCI-Lob::import()', - ), - 'ociserverversion' => array( - '5.4' => false, - 'alternative' => 'oci_server_version()', - ), - 'ocisetprefetch' => array( - '5.4' => false, - 'alternative' => 'oci_set_prefetch()', - ), - 'ocistatementtype' => array( - '5.4' => false, - 'alternative' => 'oci_statement_type()', - ), - 'ociwritelobtofile' => array( - '5.4' => false, - 'alternative' => 'OCI-Lob::export()', - ), - 'ociwritetemporarylob' => array( - '5.4' => false, - 'alternative' => 'OCI-Lob::writeTemporary()', - ), - 'mysqli_get_cache_stats' => array( - '5.4' => true, - 'alternative' => null, - ), - - 'mcrypt_create_iv' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'random_bytes() or OpenSSL', - ), - 'mcrypt_decrypt' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_get_algorithms_name' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_get_block_size' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_get_iv_size' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_get_key_size' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_get_modes_name' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_get_supported_key_sizes' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_is_block_algorithm_mode' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_is_block_algorithm' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_is_block_mode' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_enc_self_test' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_encrypt' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_generic_deinit' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_generic_init' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_generic' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_get_block_size' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_get_cipher_name' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_get_iv_size' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_get_key_size' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_list_algorithms' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_list_modes' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_module_close' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_module_get_algo_block_size' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_module_get_algo_key_size' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_module_get_supported_key_sizes' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_module_is_block_algorithm_mode' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_module_is_block_algorithm' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_module_is_block_mode' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_module_open' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mcrypt_module_self_test' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'mdecrypt_generic' => array( - '7.1' => false, - '7.2' => true, - 'alternative' => 'OpenSSL', - ), - 'jpeg2wbmp' => array( - '7.2' => false, - 'alternative' => 'imagecreatefromjpeg() and imagewbmp()', - ), - 'png2wbmp' => array( - '7.2' => false, - 'alternative' => 'imagecreatefrompng() or imagewbmp()', - ), - 'create_function' => array( - '7.2' => false, - 'alternative' => 'an anonymous function', - ), - 'each' => array( - '7.2' => false, - 'alternative' => 'a foreach loop', - ), - 'gmp_random' => array( - '7.2' => false, - 'alternative' => 'gmp_random_bits() or gmp_random_range()', - ), - 'read_exif_data' => array( - '7.2' => false, - 'alternative' => 'exif_read_data()', - ), - - 'image2wbmp' => array( - '7.3' => false, - 'alternative' => 'imagewbmp()', - ), - 'mbregex_encoding' => array( - '7.3' => false, - 'alternative' => 'mb_regex_encoding()', - ), - 'mbereg' => array( - '7.3' => false, - 'alternative' => 'mb_ereg()', - ), - 'mberegi' => array( - '7.3' => false, - 'alternative' => 'mb_eregi()', - ), - 'mbereg_replace' => array( - '7.3' => false, - 'alternative' => 'mb_ereg_replace()', - ), - 'mberegi_replace' => array( - '7.3' => false, - 'alternative' => 'mb_eregi_replace()', - ), - 'mbsplit' => array( - '7.3' => false, - 'alternative' => 'mb_split()', - ), - 'mbereg_match' => array( - '7.3' => false, - 'alternative' => 'mb_ereg_match()', - ), - 'mbereg_search' => array( - '7.3' => false, - 'alternative' => 'mb_ereg_search()', - ), - 'mbereg_search_pos' => array( - '7.3' => false, - 'alternative' => 'mb_ereg_search_pos()', - ), - 'mbereg_search_regs' => array( - '7.3' => false, - 'alternative' => 'mb_ereg_search_regs()', - ), - 'mbereg_search_init' => array( - '7.3' => false, - 'alternative' => 'mb_ereg_search_init()', - ), - 'mbereg_search_getregs' => array( - '7.3' => false, - 'alternative' => 'mb_ereg_search_getregs()', - ), - 'mbereg_search_getpos' => array( - '7.3' => false, - 'alternative' => 'mb_ereg_search_getpos()', - ), - 'mbereg_search_setpos' => array( - '7.3' => false, - 'alternative' => 'mb_ereg_search_setpos()', - ), - 'fgetss' => array( - '7.3' => false, - 'alternative' => null, - ), - 'gzgetss' => array( - '7.3' => false, - 'alternative' => null, - ), - - 'convert_cyr_string' => array( - '7.4' => false, - 'alternative' => 'mb_convert_encoding(), iconv() or UConverter', - ), - 'ezmlm_hash' => array( - '7.4' => false, - 'alternative' => null, - ), - 'get_magic_quotes_gpc' => array( - '7.4' => false, - 'alternative' => null, - ), - 'get_magic_quotes_runtime' => array( - '7.4' => false, - 'alternative' => null, - ), - 'hebrevc' => array( - '7.4' => false, - 'alternative' => null, - ), - 'is_real' => array( - '7.4' => false, - 'alternative' => 'is_float()', - ), - 'money_format' => array( - '7.4' => false, - 'alternative' => 'NumberFormatter::formatCurrency()', - ), - 'restore_include_path' => array( - '7.4' => false, - 'alternative' => "ini_restore('include_path')", - ), - 'ibase_add_user' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_affected_rows' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_backup' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_blob_add' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_blob_cancel' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_blob_close' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_blob_create' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_blob_echo' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_blob_get' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_blob_import' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_blob_info' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_blob_open' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_close' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_commit_ret' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_commit' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_connect' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_db_info' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_delete_user' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_drop_db' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_errcode' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_errmsg' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_execute' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_fetch_assoc' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_fetch_object' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_fetch_row' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_field_info' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_free_event_handler' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_free_query' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_free_result' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_gen_id' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_maintain_db' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_modify_user' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_name_result' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_num_fields' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_num_params' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_param_info' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_pconnect' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_prepare' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_query' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_restore' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_rollback_ret' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_rollback' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_server_info' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_service_attach' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_service_detach' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_set_event_handler' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_trans' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ibase_wait_event' => array( - '7.4' => true, - 'alternative' => null, - ), - 'ldap_control_paged_result_response' => array( - '7.4' => false, - 'alternative' => 'ldap_search()', - ), - 'ldap_control_paged_result' => array( - '7.4' => false, - 'alternative' => 'ldap_search()', - ), - 'recode_file' => array( - '7.4' => true, - 'alternative' => 'the iconv or mbstring extension', - ), - 'recode_string' => array( - '7.4' => true, - 'alternative' => 'the iconv or mbstring extension', - ), - 'recode' => array( - '7.4' => true, - 'alternative' => 'the iconv or mbstring extension', - ), - 'wddx_add_vars' => array( - '7.4' => true, - 'alternative' => null, - ), - 'wddx_deserialize' => array( - '7.4' => true, - 'alternative' => null, - ), - 'wddx_packet_end' => array( - '7.4' => true, - 'alternative' => null, - ), - 'wddx_packet_start' => array( - '7.4' => true, - 'alternative' => null, - ), - 'wddx_serialize_value' => array( - '7.4' => true, - 'alternative' => null, - ), - 'wddx_serialize_vars' => array( - '7.4' => true, - 'alternative' => null, - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.6 - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of function names. - $this->removedFunctions = $this->arrayKeysToLowercase($this->removedFunctions); - - return array(\T_STRING); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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(); - - $ignore = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_CLASS => true, - \T_CONST => true, - \T_USE => true, - \T_NS_SEPARATOR => true, - ); - - $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevToken]['code']]) === true) { - // Not a call to a PHP function. - return; - } - - $function = $tokens[$stackPtr]['content']; - $functionLc = strtolower($function); - - if (isset($this->removedFunctions[$functionLc]) === false) { - return; - } - - $itemInfo = array( - 'name' => $function, - 'nameLc' => $functionLc, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->removedFunctions[$itemInfo['nameLc']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'Function %s() is '; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php deleted file mode 100644 index 9c32ccca..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionUse/RequiredToOptionalFunctionParametersSniff.php +++ /dev/null @@ -1,350 +0,0 @@ - array( - 0 => array( - 'name' => 'array(s) to merge', - '7.3' => true, - '7.4' => false, - ), - ), - 'array_merge_recursive' => array( - 0 => array( - 'name' => 'array(s) to merge', - '7.3' => true, - '7.4' => false, - ), - ), - 'array_push' => array( - 1 => array( - 'name' => 'element to push', - '7.2' => true, - '7.3' => false, - ), - ), - 'array_unshift' => array( - 1 => array( - 'name' => 'element to prepend', - '7.2' => true, - '7.3' => false, - ), - ), - 'bcscale' => array( - 0 => array( - 'name' => 'scale', - '7.2' => true, - '7.3' => false, - ), - ), - 'ftp_fget' => array( - 3 => array( - 'name' => 'mode', - '7.2' => true, - '7.3' => false, - ), - ), - 'ftp_fput' => array( - 3 => array( - 'name' => 'mode', - '7.2' => true, - '7.3' => false, - ), - ), - 'ftp_get' => array( - 3 => array( - 'name' => 'mode', - '7.2' => true, - '7.3' => false, - ), - ), - 'ftp_nb_fget' => array( - 3 => array( - 'name' => 'mode', - '7.2' => true, - '7.3' => false, - ), - ), - 'ftp_nb_fput' => array( - 3 => array( - 'name' => 'mode', - '7.2' => true, - '7.3' => false, - ), - ), - 'ftp_nb_get' => array( - 3 => array( - 'name' => 'mode', - '7.2' => true, - '7.3' => false, - ), - ), - 'ftp_nb_put' => array( - 3 => array( - 'name' => 'mode', - '7.2' => true, - '7.3' => false, - ), - ), - 'ftp_put' => array( - 3 => array( - 'name' => 'mode', - '7.2' => true, - '7.3' => false, - ), - ), - 'getenv' => array( - 0 => array( - 'name' => 'varname', - '7.0' => true, - '7.1' => false, - ), - ), - 'preg_match_all' => array( - 2 => array( - 'name' => 'matches', - '5.3' => true, - '5.4' => false, - ), - ), - 'stream_socket_enable_crypto' => array( - 2 => array( - 'name' => 'crypto_type', - '5.5' => true, - '5.6' => false, - ), - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.3 - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of function names. - $this->functionParameters = $this->arrayKeysToLowercase($this->functionParameters); - - return array(\T_STRING); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_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(); - - $ignore = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_CONST => true, - \T_NEW => true, - ); - - $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevToken]['code']]) === true) { - // Not a call to a PHP function. - return; - } - - $function = $tokens[$stackPtr]['content']; - $functionLc = strtolower($function); - - if (isset($this->functionParameters[$functionLc]) === false) { - return; - } - - $parameterCount = $this->getFunctionCallParameterCount($phpcsFile, $stackPtr); - $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true, null, true); - - // If the parameter count returned > 0, we know there will be valid open parenthesis. - if ($parameterCount === 0 && $tokens[$openParenthesis]['code'] !== \T_OPEN_PARENTHESIS) { - return; - } - - $parameterOffsetFound = $parameterCount - 1; - - foreach ($this->functionParameters[$functionLc] as $offset => $parameterDetails) { - if ($offset > $parameterOffsetFound) { - $itemInfo = array( - 'name' => $function, - 'nameLc' => $functionLc, - 'offset' => $offset, - ); - $this->handleFeature($phpcsFile, $openParenthesis, $itemInfo); - } - } - } - - - /** - * Determine whether an error/warning should be thrown for an item based on collected information. - * - * @since 7.1.0 - * - * @param array $errorInfo Detail information about an item. - * - * @return bool - */ - protected function shouldThrowError(array $errorInfo) - { - return ($errorInfo['requiredVersion'] !== ''); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->functionParameters[$itemInfo['nameLc']][$itemInfo['offset']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array('name'); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = array( - 'paramName' => '', - 'requiredVersion' => '', - ); - - $versionArray = $this->getVersionArray($itemArray); - - if (empty($versionArray) === false) { - foreach ($versionArray as $version => $required) { - if ($required === true && $this->supportsBelow($version) === true) { - $errorInfo['requiredVersion'] = $version; - } - } - } - - $errorInfo['paramName'] = $itemArray['name']; - - return $errorInfo; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The "%s" parameter for function %s() is missing, but was required for PHP version %s and lower'; - } - - - /** - * Generates the error or warning for this item. - * - * @since 7.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the relevant token in - * the stack. - * @param array $itemInfo Base information about the item. - * @param array $errorInfo Array with detail (version) information - * relevant to the item. - * - * @return void - */ - public function addError(File $phpcsFile, $stackPtr, array $itemInfo, array $errorInfo) - { - $error = $this->getErrorMsgTemplate(); - $errorCode = $this->stringToErrorCode($itemInfo['name'] . '_' . $errorInfo['paramName']) . 'Missing'; - $data = array( - $errorInfo['paramName'], - $itemInfo['name'], - $errorInfo['requiredVersion'], - ); - - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php deleted file mode 100644 index 98ca2461..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Generators/NewGeneratorReturnSniff.php +++ /dev/null @@ -1,158 +0,0 @@ - \T_FUNCTION, - \T_CLOSURE => \T_CLOSURE, - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.2.0 - * - * @return array - */ - public function register() - { - $targets = array( - \T_YIELD, - ); - - /* - * The `yield` keyword was introduced in PHP 5.5 with the token T_YIELD. - * The `yield from` keyword was introduced in PHP 7.0 and tokenizes as - * "T_YIELD T_WHITESPACE T_STRING". - * - * Pre-PHPCS 3.1.0, the T_YIELD token was not correctly back-filled for PHP < 5.5. - * Also, as of PHPCS 3.1.0, the PHPCS tokenizer adds a new T_YIELD_FROM - * token. - * - * So for PHP 5.3-5.4 icw PHPCS < 3.1.0, we need to look for T_STRING with content "yield". - * For PHP 5.5+ we need to look for T_YIELD. - * For PHPCS 3.1.0+, we also need to look for T_YIELD_FROM. - */ - if (version_compare(\PHP_VERSION_ID, '50500', '<') === true - && version_compare(PHPCSHelper::getVersion(), '3.1.0', '<') === true - ) { - $targets[] = \T_STRING; - } - - if (\defined('T_YIELD_FROM')) { - $targets[] = \T_YIELD_FROM; - } - - return $targets; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void|int Void or a stack pointer to skip forward. - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($this->supportsBelow('5.6') !== true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === \T_STRING - && $tokens[$stackPtr]['content'] !== 'yield' - ) { - return; - } - - if (empty($tokens[$stackPtr]['conditions']) === true) { - return; - } - - // Walk the condition from inner to outer to see if we can find a valid function/closure scope. - $conditions = array_reverse($tokens[$stackPtr]['conditions'], true); - foreach ($conditions as $ptr => $type) { - if (isset($this->validConditions[$type]) === true) { - $function = $ptr; - break; - } - } - - if (isset($function) === false) { - // Yield outside function scope, fatal error, but not our concern. - return; - } - - if (isset($tokens[$function]['scope_opener'], $tokens[$function]['scope_closer']) === false) { - // Can't reliably determine start/end of function scope. - return; - } - - $targets = array(\T_RETURN, \T_CLOSURE, \T_FUNCTION, \T_CLASS); - if (\defined('T_ANON_CLASS')) { - $targets[] = \T_ANON_CLASS; - } - - $current = $tokens[$function]['scope_opener']; - - while (($current = $phpcsFile->findNext($targets, ($current + 1), $tokens[$function]['scope_closer'])) !== false) { - if ($tokens[$current]['code'] === \T_RETURN) { - $phpcsFile->addError( - 'Returning a final expression from a generator was not supported in PHP 5.6 or earlier', - $current, - 'ReturnFound' - ); - - return $tokens[$function]['scope_closer']; - } - - // Found a nested scope in which return can exist without problems. - if (isset($tokens[$current]['scope_closer'])) { - // Skip past the nested scope. - $current = $tokens[$current]['scope_closer']; - } - } - - // Don't examine this function again. - return $tokens[$function]['scope_closer']; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php deleted file mode 100644 index cd40fa68..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/NewIniDirectivesSniff.php +++ /dev/null @@ -1,855 +0,0 @@ - array( - '4.4' => false, - '5.0' => true, - ), - 'com.code_page' => array( - '4.4' => false, - '5.0' => true, - ), - 'date.default_latitude' => array( - '4.4' => false, - '5.0' => true, - ), - 'date.default_longitude' => array( - '4.4' => false, - '5.0' => true, - ), - 'date.sunrise_zenith' => array( - '4.4' => false, - '5.0' => true, - ), - 'date.sunset_zenith' => array( - '4.4' => false, - '5.0' => true, - ), - 'ibase.default_charset' => array( - '4.4' => false, - '5.0' => true, - ), - 'ibase.default_db' => array( - '4.4' => false, - '5.0' => true, - ), - 'mail.force_extra_parameters' => array( - '4.4' => false, - '5.0' => true, - ), - 'mime_magic.debug' => array( - '4.4' => false, - '5.0' => true, - ), - 'mysqli.max_links' => array( - '4.4' => false, - '5.0' => true, - ), - 'mysqli.default_port' => array( - '4.4' => false, - '5.0' => true, - ), - 'mysqli.default_socket' => array( - '4.4' => false, - '5.0' => true, - ), - 'mysqli.default_host' => array( - '4.4' => false, - '5.0' => true, - ), - 'mysqli.default_user' => array( - '4.4' => false, - '5.0' => true, - ), - 'mysqli.default_pw' => array( - '4.4' => false, - '5.0' => true, - ), - 'report_zend_debug' => array( - '4.4' => false, - '5.0' => true, - ), - 'session.hash_bits_per_character' => array( - '4.4' => false, - '5.0' => true, - ), - 'session.hash_function' => array( - '4.4' => false, - '5.0' => true, - ), - 'soap.wsdl_cache_dir' => array( - '4.4' => false, - '5.0' => true, - ), - 'soap.wsdl_cache_enabled' => array( - '4.4' => false, - '5.0' => true, - ), - 'soap.wsdl_cache_ttl' => array( - '4.4' => false, - '5.0' => true, - ), - 'sqlite.assoc_case' => array( - '4.4' => false, - '5.0' => true, - ), - 'tidy.clean_output' => array( - '4.4' => false, - '5.0' => true, - ), - 'tidy.default_config' => array( - '4.4' => false, - '5.0' => true, - ), - 'zend.ze1_compatibility_mode' => array( - '4.4' => false, - '5.0' => true, - ), - - 'date.timezone' => array( - '5.0' => false, - '5.1' => true, - ), - 'detect_unicode' => array( - '5.0' => false, - '5.1' => true, - ), - 'fbsql.batchsize' => array( - '5.0' => false, - '5.1' => true, - 'alternative' => 'fbsql.batchSize', - ), - 'realpath_cache_size' => array( - '5.0' => false, - '5.1' => true, - ), - 'realpath_cache_ttl' => array( - '5.0' => false, - '5.1' => true, - ), - - 'mbstring.strict_detection' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - 'mssql.charset' => array( - '5.1.1' => false, - '5.1.2' => true, - ), - - 'gd.jpeg_ignore_warning' => array( - '5.1.2' => false, - '5.1.3' => true, - ), - - 'fbsql.show_timestamp_decimals' => array( - '5.1.4' => false, - '5.1.5' => true, - ), - 'soap.wsdl_cache' => array( - '5.1.4' => false, - '5.1.5' => true, - ), - 'soap.wsdl_cache_limit' => array( - '5.1.4' => false, - '5.1.5' => true, - ), - - 'allow_url_include' => array( - '5.1' => false, - '5.2' => true, - ), - 'filter.default' => array( - '5.1' => false, - '5.2' => true, - ), - 'filter.default_flags' => array( - '5.1' => false, - '5.2' => true, - ), - 'pcre.backtrack_limit' => array( - '5.1' => false, - '5.2' => true, - ), - 'pcre.recursion_limit' => array( - '5.1' => false, - '5.2' => true, - ), - 'session.cookie_httponly' => array( - '5.1' => false, - '5.2' => true, - ), - - 'cgi.check_shebang_line' => array( - '5.2.0' => false, - '5.2.1' => true, - ), - - 'max_input_nesting_level' => array( - '5.2.2' => false, - '5.2.3' => true, - ), - - 'mysqli.allow_local_infile' => array( - '5.2.3' => false, - '5.2.4' => true, - ), - - 'max_file_uploads' => array( - '5.2.11' => false, - '5.2.12' => true, - ), - - 'cgi.discard_path' => array( - '5.2' => false, - '5.3' => true, - ), - 'exit_on_timeout' => array( - '5.2' => false, - '5.3' => true, - ), - 'intl.default_locale' => array( - '5.2' => false, - '5.3' => true, - ), - 'intl.error_level' => array( - '5.2' => false, - '5.3' => true, - ), - 'mail.add_x_header' => array( - '5.2' => false, - '5.3' => true, - ), - 'mail.log' => array( - '5.2' => false, - '5.3' => true, - ), - 'mbstring.http_output_conv_mimetype' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqli.allow_persistent' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqli.cache_size' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqli.max_persistent' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqlnd.collect_memory_statistics' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqlnd.collect_statistics' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqlnd.debug' => array( - '5.2' => false, - '5.3' => true, - ), - 'mysqlnd.net_read_buffer_size' => array( - '5.2' => false, - '5.3' => true, - ), - 'odbc.default_cursortype' => array( - '5.2' => false, - '5.3' => true, - ), - 'request_order' => array( - '5.2' => false, - '5.3' => true, - ), - 'user_ini.cache_ttl' => array( - '5.2' => false, - '5.3' => true, - ), - 'user_ini.filename' => array( - '5.2' => false, - '5.3' => true, - ), - 'zend.enable_gc' => array( - '5.2' => false, - '5.3' => true, - ), - - 'curl.cainfo' => array( - '5.3.6' => false, - '5.3.7' => true, - ), - - 'max_input_vars' => array( - '5.3.8' => false, - '5.3.9' => true, - ), - - 'sqlite3.extension_dir' => array( - '5.3.10' => false, - '5.3.11' => true, - ), - - 'cli.pager' => array( - '5.3' => false, - '5.4' => true, - ), - 'cli.prompt' => array( - '5.3' => false, - '5.4' => true, - ), - 'cli_server.color' => array( - '5.3' => false, - '5.4' => true, - ), - 'enable_post_data_reading' => array( - '5.3' => false, - '5.4' => true, - ), - 'mysqlnd.mempool_default_size' => array( - '5.3' => false, - '5.4' => true, - ), - 'mysqlnd.net_cmd_buffer_size' => array( - '5.3' => false, - '5.4' => true, - ), - 'mysqlnd.net_read_timeout' => array( - '5.3' => false, - '5.4' => true, - ), - 'phar.cache_list' => array( - '5.3' => false, - '5.4' => true, - ), - 'session.upload_progress.enabled' => array( - '5.3' => false, - '5.4' => true, - ), - 'session.upload_progress.cleanup' => array( - '5.3' => false, - '5.4' => true, - ), - 'session.upload_progress.name' => array( - '5.3' => false, - '5.4' => true, - ), - 'session.upload_progress.freq' => array( - '5.3' => false, - '5.4' => true, - ), - 'session.upload_progress.min_freq' => array( - '5.3' => false, - '5.4' => true, - ), - 'session.upload_progress.prefix' => array( - '5.3' => false, - '5.4' => true, - ), - 'windows_show_crt_warning' => array( - '5.3' => false, - '5.4' => true, - ), - 'zend.detect_unicode' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => 'detect_unicode', - ), - 'zend.multibyte' => array( - '5.3' => false, - '5.4' => true, - ), - 'zend.script_encoding' => array( - '5.3' => false, - '5.4' => true, - ), - 'zend.signal_check' => array( - '5.3' => false, - '5.4' => true, - ), - 'mysqlnd.log_mask' => array( - '5.3' => false, - '5.4' => true, - ), - - 'intl.use_exceptions' => array( - '5.4' => false, - '5.5' => true, - ), - 'mysqlnd.sha256_server_public_key' => array( - '5.4' => false, - '5.5' => true, - ), - 'mysqlnd.trace_alloc' => array( - '5.4' => false, - '5.5' => true, - ), - 'sys_temp_dir' => array( - '5.4' => false, - '5.5' => true, - ), - 'xsl.security_prefs' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.enable' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.enable_cli' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.memory_consumption' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.interned_strings_buffer' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.max_accelerated_files' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.max_wasted_percentage' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.use_cwd' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.validate_timestamps' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.revalidate_freq' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.revalidate_path' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.save_comments' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.load_comments' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.fast_shutdown' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.enable_file_override' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.optimization_level' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.inherited_hack' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.dups_fix' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.blacklist_filename' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.max_file_size' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.consistency_checks' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.force_restart_timeout' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.error_log' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.log_verbosity_level' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.preferred_memory_model' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.protect_memory' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.mmap_base' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.restrict_api' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.file_update_protection' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.huge_code_pages' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.lockfile_path' => array( - '5.4' => false, - '5.5' => true, - ), - 'opcache.opt_debug_level' => array( - '5.4' => false, - '5.5' => true, - ), - - 'session.use_strict_mode' => array( - '5.5.1' => false, - '5.5.2' => true, - ), - - 'mysqli.rollback_on_cached_plink' => array( - '5.5' => false, - '5.6' => true, - ), - - 'assert.exception' => array( - '5.6' => false, - '7.0' => true, - ), - 'pcre.jit' => array( - '5.6' => false, - '7.0' => true, - ), - 'session.lazy_write' => array( - '5.6' => false, - '7.0' => true, - ), - 'zend.assertions' => array( - '5.6' => false, - '7.0' => true, - ), - 'opcache.file_cache' => array( - '5.6' => false, - '7.0' => true, - ), - 'opcache.file_cache_only' => array( - '5.6' => false, - '7.0' => true, - ), - 'opcache.file_cache_consistency_checks' => array( - '5.6' => false, - '7.0' => true, - ), - 'opcache.file_cache_fallback' => array( - '5.6' => false, - '7.0' => true, - ), // Windows only. - - 'opcache.validate_permission' => array( - '7.0.13' => false, - '7.0.14' => true, - ), - 'opcache.validate_root' => array( - '7.0.13' => false, - '7.0.14' => true, - ), - - 'hard_timeout' => array( - '7.0' => false, - '7.1' => true, - ), - 'session.sid_length' => array( - '7.0' => false, - '7.1' => true, - ), - 'session.sid_bits_per_character' => array( - '7.0' => false, - '7.1' => true, - ), - 'session.trans_sid_hosts' => array( - '7.0' => false, - '7.1' => true, - ), - 'session.trans_sid_tags' => array( - '7.0' => false, - '7.1' => true, - ), - 'url_rewriter.hosts' => array( - '7.0' => false, - '7.1' => true, - ), - - // Introduced in PHP 7.1.25, 7.2.13, 7.3.0. - 'imap.enable_insecure_rsh' => array( - '7.1.24' => false, - '7.1.25' => true, - ), - - 'syslog.facility' => array( - '7.2' => false, - '7.3' => true, - ), - 'syslog.filter' => array( - '7.2' => false, - '7.3' => true, - ), - 'syslog.ident' => array( - '7.2' => false, - '7.3' => true, - ), - 'session.cookie_samesite' => array( - '7.2' => false, - '7.3' => true, - ), - - 'ffi.enable' => array( - '7.3' => false, - '7.4' => true, - ), - 'ffi.preload' => array( - '7.3' => false, - '7.4' => true, - ), - 'opcache.cache_id' => array( - '7.3' => false, - '7.4' => true, - ), - 'opcache.preload' => array( - '7.3' => false, - '7.4' => true, - ), - 'zend.exception_ignore_args' => array( - '7.3' => false, - '7.4' => true, - ), - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * - * @return array - */ - public function register() - { - return array(\T_STRING); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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(); - - $ignore = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_CONST => true, - ); - - $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevToken]['code']]) === true) { - // Not a call to a PHP function. - return; - } - - $functionLc = strtolower($tokens[$stackPtr]['content']); - if (isset($this->iniFunctions[$functionLc]) === false) { - return; - } - - $iniToken = $this->getFunctionCallParameter($phpcsFile, $stackPtr, $this->iniFunctions[$functionLc]); - if ($iniToken === false) { - return; - } - - $filteredToken = $this->stripQuotes($iniToken['raw']); - if (isset($this->newIniDirectives[$filteredToken]) === false) { - return; - } - - $itemInfo = array( - 'name' => $filteredToken, - 'functionLc' => $functionLc, - ); - $this->handleFeature($phpcsFile, $iniToken['end'], $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newIniDirectives[$itemInfo['name']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array('alternative'); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - $errorInfo['alternative'] = ''; - - if (isset($itemArray['alternative']) === true) { - $errorInfo['alternative'] = $itemArray['alternative']; - } - - // Lower error level to warning if the function used was ini_get. - if ($errorInfo['error'] === true && $itemInfo['functionLc'] === 'ini_get') { - $errorInfo['error'] = false; - } - - return $errorInfo; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return "INI directive '%s' is not present in PHP version %s or earlier"; - } - - - /** - * Allow for concrete child classes to filter the error message before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param string $error The error message which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return string - */ - protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) - { - if ($errorInfo['alternative'] !== '') { - $error .= ". This directive was previously called '%s'."; - } - - return $error; - } - - - /** - * Allow for concrete child classes to filter the error data before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param array $data The error data array which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return array - */ - protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) - { - if ($errorInfo['alternative'] !== '') { - $data[] = $errorInfo['alternative']; - } - - return $data; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php deleted file mode 100644 index a6928ae0..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/IniDirectives/RemovedIniDirectivesSniff.php +++ /dev/null @@ -1,424 +0,0 @@ - array( - '5.1' => true, - 'alternative' => 'fbsql.batchsize', - ), - 'pfpro.defaulthost' => array( - '5.1' => true, - ), - 'pfpro.defaultport' => array( - '5.1' => true, - ), - 'pfpro.defaulttimeout' => array( - '5.1' => true, - ), - 'pfpro.proxyaddress' => array( - '5.1' => true, - ), - 'pfpro.proxyport' => array( - '5.1' => true, - ), - 'pfpro.proxylogon' => array( - '5.1' => true, - ), - 'pfpro.proxypassword' => array( - '5.1' => true, - ), - - 'ifx.allow_persistent' => array( - '5.2.1' => true, - ), - 'ifx.blobinfile' => array( - '5.2.1' => true, - ), - 'ifx.byteasvarchar' => array( - '5.2.1' => true, - ), - 'ifx.charasvarchar' => array( - '5.2.1' => true, - ), - 'ifx.default_host' => array( - '5.2.1' => true, - ), - 'ifx.default_password' => array( - '5.2.1' => true, - ), - 'ifx.default_user' => array( - '5.2.1' => true, - ), - 'ifx.max_links' => array( - '5.2.1' => true, - ), - 'ifx.max_persistent' => array( - '5.2.1' => true, - ), - 'ifx.nullformat' => array( - '5.2.1' => true, - ), - 'ifx.textasvarchar' => array( - '5.2.1' => true, - ), - - 'zend.ze1_compatibility_mode' => array( - '5.3' => true, - ), - - 'allow_call_time_pass_reference' => array( - '5.3' => false, - '5.4' => true, - ), - 'define_syslog_variables' => array( - '5.3' => false, - '5.4' => true, - ), - 'detect_unicode' => array( - '5.4' => true, - 'alternative' => 'zend.detect_unicode', - ), - 'highlight.bg' => array( - '5.3' => false, - '5.4' => true, - ), - 'magic_quotes_gpc' => array( - '5.3' => false, - '5.4' => true, - ), - 'magic_quotes_runtime' => array( - '5.3' => false, - '5.4' => true, - ), - 'magic_quotes_sybase' => array( - '5.3' => false, - '5.4' => true, - ), - 'mbstring.script_encoding' => array( - '5.4' => true, - 'alternative' => 'zend.script_encoding', - ), - 'register_globals' => array( - '5.3' => false, - '5.4' => true, - ), - 'register_long_arrays' => array( - '5.3' => false, - '5.4' => true, - ), - 'safe_mode' => array( - '5.3' => false, - '5.4' => true, - ), - 'safe_mode_allowed_env_vars' => array( - '5.3' => false, - '5.4' => true, - ), - 'safe_mode_exec_dir' => array( - '5.3' => false, - '5.4' => true, - ), - 'safe_mode_gid' => array( - '5.3' => false, - '5.4' => true, - ), - 'safe_mode_include_dir' => array( - '5.3' => false, - '5.4' => true, - ), - 'safe_mode_protected_env_vars' => array( - '5.3' => false, - '5.4' => true, - ), - 'session.bug_compat_42' => array( - '5.3' => false, - '5.4' => true, - ), - 'session.bug_compat_warn' => array( - '5.3' => false, - '5.4' => true, - ), - 'y2k_compliance' => array( - '5.3' => false, - '5.4' => true, - ), - - 'always_populate_raw_post_data' => array( - '5.6' => false, - '7.0' => true, - ), - 'iconv.input_encoding' => array( - '5.6' => false, - ), - 'iconv.output_encoding' => array( - '5.6' => false, - ), - 'iconv.internal_encoding' => array( - '5.6' => false, - ), - 'mbstring.http_input' => array( - '5.6' => false, - ), - 'mbstring.http_output' => array( - '5.6' => false, - ), - 'mbstring.internal_encoding' => array( - '5.6' => false, - ), - - 'asp_tags' => array( - '7.0' => true, - ), - 'xsl.security_prefs' => array( - '7.0' => true, - ), - 'opcache.load_comments' => array( - '7.0' => true, - ), - - 'mcrypt.algorithms_dir' => array( - '7.1' => false, - '7.2' => true, - ), - 'mcrypt.modes_dir' => array( - '7.1' => false, - '7.2' => true, - ), - 'session.entropy_file' => array( - '7.1' => true, - ), - 'session.entropy_length' => array( - '7.1' => true, - ), - 'session.hash_function' => array( - '7.1' => true, - ), - 'session.hash_bits_per_character' => array( - '7.1' => true, - ), - - 'mbstring.func_overload' => array( - '7.2' => false, - ), - 'sql.safe_mode' => array( - '7.2' => true, - ), - 'track_errors' => array( - '7.2' => false, - ), - 'opcache.fast_shutdown' => array( - '7.2' => true, - ), - - 'birdstep.max_links' => array( - '7.3' => true, - ), - 'opcache.inherited_hack' => array( - '5.3' => false, // Soft deprecated, i.e. ignored. - '7.3' => true, - ), - 'pdo_odbc.db2_instance_name' => array( - '7.3' => false, // Has been marked as deprecated in the manual from before this time. Now hard-deprecated. - ), - - 'allow_url_include' => array( - '7.4' => false, - ), - 'ibase.allow_persistent' => array( - '7.4' => true, - ), - 'ibase.max_persistent' => array( - '7.4' => true, - ), - 'ibase.max_links' => array( - '7.4' => true, - ), - 'ibase.default_db' => array( - '7.4' => true, - ), - 'ibase.default_user' => array( - '7.4' => true, - ), - 'ibase.default_password' => array( - '7.4' => true, - ), - 'ibase.default_charset' => array( - '7.4' => true, - ), - 'ibase.timestampformat' => array( - '7.4' => true, - ), - 'ibase.dateformat' => array( - '7.4' => true, - ), - 'ibase.timeformat' => array( - '7.4' => true, - ), - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * - * @return array - */ - public function register() - { - return array(\T_STRING); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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(); - - $ignore = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_CONST => true, - ); - - $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevToken]['code']]) === true) { - // Not a call to a PHP function. - return; - } - - $functionLc = strtolower($tokens[$stackPtr]['content']); - if (isset($this->iniFunctions[$functionLc]) === false) { - return; - } - - $iniToken = $this->getFunctionCallParameter($phpcsFile, $stackPtr, $this->iniFunctions[$functionLc]); - if ($iniToken === false) { - return; - } - - $filteredToken = $this->stripQuotes($iniToken['raw']); - if (isset($this->deprecatedIniDirectives[$filteredToken]) === false) { - return; - } - - $itemInfo = array( - 'name' => $filteredToken, - 'functionLc' => $functionLc, - ); - $this->handleFeature($phpcsFile, $iniToken['end'], $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->deprecatedIniDirectives[$itemInfo['name']]; - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - - // Lower error level to warning if the function used was ini_get. - if ($errorInfo['error'] === true && $itemInfo['functionLc'] === 'ini_get') { - $errorInfo['error'] = false; - } - - return $errorInfo; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return "INI directive '%s' is "; - } - - - /** - * Get the error message template for suggesting an alternative for a specific sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getAlternativeOptionTemplate() - { - return str_replace('%s', "'%s'", parent::getAlternativeOptionTemplate()); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php deleted file mode 100644 index c9c2225f..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingConstSniff.php +++ /dev/null @@ -1,82 +0,0 @@ -supportsBelow('5.5') !== true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $find = array( - \T_ARRAY => \T_ARRAY, - \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, - ); - - while (($hasArray = $phpcsFile->findNext($find, ($stackPtr + 1), null, false, null, true)) !== false) { - $phpcsFile->addError( - 'Constant arrays using the "const" keyword are not allowed in PHP 5.5 or earlier', - $hasArray, - 'Found' - ); - - // Skip past the content of the array. - $stackPtr = $hasArray; - if ($tokens[$hasArray]['code'] === \T_OPEN_SHORT_ARRAY && isset($tokens[$hasArray]['bracket_closer'])) { - $stackPtr = $tokens[$hasArray]['bracket_closer']; - } elseif ($tokens[$hasArray]['code'] === \T_ARRAY && isset($tokens[$hasArray]['parenthesis_closer'])) { - $stackPtr = $tokens[$hasArray]['parenthesis_closer']; - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php deleted file mode 100644 index 7b996728..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantArraysUsingDefineSniff.php +++ /dev/null @@ -1,101 +0,0 @@ -supportsBelow('5.6') !== true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - $ignore = array( - \T_DOUBLE_COLON => true, - \T_OBJECT_OPERATOR => true, - \T_FUNCTION => true, - \T_CONST => true, - ); - - $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevToken]['code']]) === true) { - // Not a call to a PHP function. - return; - } - - $functionLc = strtolower($tokens[$stackPtr]['content']); - if ($functionLc !== 'define') { - return; - } - - $secondParam = $this->getFunctionCallParameter($phpcsFile, $stackPtr, 2); - if (isset($secondParam['start'], $secondParam['end']) === false) { - return; - } - - $targetNestingLevel = 0; - if (isset($tokens[$secondParam['start']]['nested_parenthesis'])) { - $targetNestingLevel = \count($tokens[$secondParam['start']]['nested_parenthesis']); - } - - $array = $phpcsFile->findNext(array(\T_ARRAY, \T_OPEN_SHORT_ARRAY), $secondParam['start'], ($secondParam['end'] + 1)); - if ($array !== false) { - if ((isset($tokens[$array]['nested_parenthesis']) === false && $targetNestingLevel === 0) || \count($tokens[$array]['nested_parenthesis']) === $targetNestingLevel) { - $phpcsFile->addError( - 'Constant arrays using define are not allowed in PHP 5.6 or earlier', - $array, - 'Found' - ); - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php deleted file mode 100644 index 8e1cddca..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewConstantScalarExpressionsSniff.php +++ /dev/null @@ -1,556 +0,0 @@ - 'when defining constants using the const keyword', - 'property' => 'in property declarations', - 'staticvar' => 'in static variable declarations', - 'default' => 'in default function arguments', - ); - - /** - * Tokens which were allowed to be used in these declarations prior to PHP 5.6. - * - * This list will be enriched in the setProperties() method. - * - * @since 8.2.0 - * - * @var array - */ - protected $safeOperands = array( - \T_LNUMBER => \T_LNUMBER, - \T_DNUMBER => \T_DNUMBER, - \T_CONSTANT_ENCAPSED_STRING => \T_CONSTANT_ENCAPSED_STRING, - \T_TRUE => \T_TRUE, - \T_FALSE => \T_FALSE, - \T_NULL => \T_NULL, - - \T_LINE => \T_LINE, - \T_FILE => \T_FILE, - \T_DIR => \T_DIR, - \T_FUNC_C => \T_FUNC_C, - \T_CLASS_C => \T_CLASS_C, - \T_TRAIT_C => \T_TRAIT_C, - \T_METHOD_C => \T_METHOD_C, - \T_NS_C => \T_NS_C, - - // Special cases: - \T_NS_SEPARATOR => \T_NS_SEPARATOR, - /* - * This can be neigh anything, but for any usage except constants, - * the T_STRING will be combined with non-allowed tokens, so we should be good. - */ - \T_STRING => \T_STRING, - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.2.0 - * - * @return array - */ - public function register() - { - // Set the properties up only once. - $this->setProperties(); - - return array( - \T_CONST, - \T_VARIABLE, - \T_FUNCTION, - \T_CLOSURE, - \T_STATIC, - ); - } - - - /** - * Make some adjustments to the $safeOperands property. - * - * @since 8.2.0 - * - * @return void - */ - public function setProperties() - { - $this->safeOperands += Tokens::$heredocTokens; - $this->safeOperands += Tokens::$emptyTokens; - } - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 8.2.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('5.5') !== true); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void|int Null or integer stack pointer to skip forward. - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($this->bowOutEarly() === true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - switch ($tokens[$stackPtr]['type']) { - case 'T_FUNCTION': - case 'T_CLOSURE': - $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); - if (empty($params)) { - // No parameters. - return; - } - - $funcToken = $tokens[$stackPtr]; - - if (isset($funcToken['parenthesis_owner'], $funcToken['parenthesis_opener'], $funcToken['parenthesis_closer']) === false - || $funcToken['parenthesis_owner'] !== $stackPtr - || isset($tokens[$funcToken['parenthesis_opener']], $tokens[$funcToken['parenthesis_closer']]) === false - ) { - // Hmm.. something is going wrong as these should all be available & valid. - return; - } - - $opener = $funcToken['parenthesis_opener']; - $closer = $funcToken['parenthesis_closer']; - - // Which nesting level is the one we are interested in ? - $nestedParenthesisCount = 1; - if (isset($tokens[$opener]['nested_parenthesis'])) { - $nestedParenthesisCount += \count($tokens[$opener]['nested_parenthesis']); - } - - foreach ($params as $param) { - if (isset($param['default']) === false) { - continue; - } - - $end = $param['token']; - while (($end = $phpcsFile->findNext(array(\T_COMMA, \T_CLOSE_PARENTHESIS), ($end + 1), ($closer + 1))) !== false) { - $maybeSkipTo = $this->isRealEndOfDeclaration($tokens, $end, $nestedParenthesisCount); - if ($maybeSkipTo !== true) { - $end = $maybeSkipTo; - continue; - } - - // Ignore closing parenthesis/bracket if not 'ours'. - if ($tokens[$end]['code'] === \T_CLOSE_PARENTHESIS && $end !== $closer) { - continue; - } - - // Ok, we've found the end of the param default value declaration. - break; - } - - if ($this->isValidAssignment($phpcsFile, $param['token'], $end) === false) { - $this->throwError($phpcsFile, $param['token'], 'default', $param['content']); - } - } - - /* - * No need for the sniff to be triggered by the T_VARIABLEs in the function - * definition as we've already examined them above, so let's skip over them. - */ - return $closer; - - case 'T_VARIABLE': - case 'T_STATIC': - case 'T_CONST': - $type = 'const'; - - // Filter out non-property declarations. - if ($tokens[$stackPtr]['code'] === \T_VARIABLE) { - if ($this->isClassProperty($phpcsFile, $stackPtr) === false) { - return; - } - - $type = 'property'; - - // Move back one token to have the same starting point as the others. - $stackPtr = ($stackPtr - 1); - } - - // Filter out late static binding and class properties. - if ($tokens[$stackPtr]['code'] === \T_STATIC) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); - if ($next === false || $tokens[$next]['code'] !== \T_VARIABLE) { - // Late static binding. - return; - } - - if ($this->isClassProperty($phpcsFile, $next) === true) { - // Class properties are examined based on the T_VARIABLE token. - return; - } - unset($next); - - $type = 'staticvar'; - } - - $endOfStatement = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($stackPtr + 1)); - if ($endOfStatement === false) { - // No semi-colon - live coding. - return; - } - - $targetNestingLevel = 0; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $targetNestingLevel = \count($tokens[$stackPtr]['nested_parenthesis']); - } - - // Examine each variable/constant in multi-declarations. - $start = $stackPtr; - $end = $stackPtr; - while (($end = $phpcsFile->findNext(array(\T_COMMA, \T_SEMICOLON, \T_OPEN_SHORT_ARRAY, \T_CLOSE_TAG), ($end + 1), ($endOfStatement + 1))) !== false) { - - $maybeSkipTo = $this->isRealEndOfDeclaration($tokens, $end, $targetNestingLevel); - if ($maybeSkipTo !== true) { - $end = $maybeSkipTo; - continue; - } - - $start = $phpcsFile->findNext(Tokens::$emptyTokens, ($start + 1), $end, true); - if ($start === false - || ($tokens[$stackPtr]['code'] === \T_CONST && $tokens[$start]['code'] !== \T_STRING) - || ($tokens[$stackPtr]['code'] !== \T_CONST && $tokens[$start]['code'] !== \T_VARIABLE) - ) { - // Shouldn't be possible. - continue; - } - - if ($this->isValidAssignment($phpcsFile, $start, $end) === false) { - // Create the "found" snippet. - $content = ''; - $tokenCount = ($end - $start); - if ($tokenCount < 20) { - // Prevent large arrays from being added to the error message. - $content = $phpcsFile->getTokensAsString($start, ($tokenCount + 1)); - } - - $this->throwError($phpcsFile, $start, $type, $content); - } - - $start = $end; - } - - // Skip to the end of the statement to prevent duplicate messages for multi-declarations. - return $endOfStatement; - } - } - - - /** - * Is a value declared and is the value declared valid pre-PHP 5.6 ? - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param int $end The end of the value definition. - * This will normally be a comma or semi-colon. - * - * @return bool - */ - protected function isValidAssignment(File $phpcsFile, $stackPtr, $end) - { - $tokens = $phpcsFile->getTokens(); - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), $end, true); - if ($next === false || $tokens[$next]['code'] !== \T_EQUAL) { - // No value assigned. - return true; - } - - return $this->isStaticValue($phpcsFile, $tokens, ($next + 1), ($end - 1)); - } - - - /** - * Is a value declared and is the value declared constant as accepted in PHP 5.5 and lower ? - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param array $tokens The token stack of the current file. - * @param int $start The stackPtr from which to start examining. - * @param int $end The end of the value definition (inclusive), - * i.e. this token will be examined as part of - * the snippet. - * @param int $nestedArrays Optional. Array nesting level when examining - * the content of an array. - * - * @return bool - */ - protected function isStaticValue(File $phpcsFile, $tokens, $start, $end, $nestedArrays = 0) - { - $nextNonSimple = $phpcsFile->findNext($this->safeOperands, $start, ($end + 1), true); - if ($nextNonSimple === false) { - return true; - } - - /* - * OK, so we have at least one token which needs extra examination. - */ - switch ($tokens[$nextNonSimple]['code']) { - case \T_MINUS: - case \T_PLUS: - if ($this->isNumber($phpcsFile, $start, $end, true) !== false) { - // Int or float with sign. - return true; - } - - return false; - - case \T_NAMESPACE: - case \T_PARENT: - case \T_SELF: - case \T_DOUBLE_COLON: - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonSimple + 1), ($end + 1), true); - - if ($tokens[$nextNonSimple]['code'] === \T_NAMESPACE) { - // Allow only `namespace\...`. - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_NS_SEPARATOR) { - return false; - } - } elseif ($tokens[$nextNonSimple]['code'] === \T_PARENT - || $tokens[$nextNonSimple]['code'] === \T_SELF - ) { - // Allow only `parent::` and `self::`. - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_DOUBLE_COLON) { - return false; - } - } elseif ($tokens[$nextNonSimple]['code'] === \T_DOUBLE_COLON) { - // Allow only `T_STRING::T_STRING`. - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { - return false; - } - - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextNonSimple - 1), null, true); - // No need to worry about parent/self, that's handled above and - // the double colon is skipped over in that case. - if ($prevNonEmpty === false || $tokens[$prevNonEmpty]['code'] !== \T_STRING) { - return false; - } - } - - // Examine what comes after the namespace/parent/self/double colon, if anything. - return $this->isStaticValue($phpcsFile, $tokens, ($nextNonEmpty + 1), $end, $nestedArrays); - - case \T_ARRAY: - case \T_OPEN_SHORT_ARRAY: - ++$nestedArrays; - - $arrayItems = $this->getFunctionCallParameters($phpcsFile, $nextNonSimple); - if (empty($arrayItems) === false) { - foreach ($arrayItems as $item) { - // Check for a double arrow, but only if it's for this array item, not for a nested array. - $doubleArrow = false; - - $maybeDoubleArrow = $phpcsFile->findNext( - array(\T_DOUBLE_ARROW, \T_ARRAY, \T_OPEN_SHORT_ARRAY), - $item['start'], - ($item['end'] + 1) - ); - if ($maybeDoubleArrow !== false && $tokens[$maybeDoubleArrow]['code'] === \T_DOUBLE_ARROW) { - // Double arrow is for this nesting level. - $doubleArrow = $maybeDoubleArrow; - } - - if ($doubleArrow === false) { - if ($this->isStaticValue($phpcsFile, $tokens, $item['start'], $item['end'], $nestedArrays) === false) { - return false; - } - - } else { - // Examine array key. - if ($this->isStaticValue($phpcsFile, $tokens, $item['start'], ($doubleArrow - 1), $nestedArrays) === false) { - return false; - } - - // Examine array value. - if ($this->isStaticValue($phpcsFile, $tokens, ($doubleArrow + 1), $item['end'], $nestedArrays) === false) { - return false; - } - } - } - } - - --$nestedArrays; - - /* - * Find the end of the array. - * We already know we will have a valid closer as otherwise we wouldn't have been - * able to get the array items. - */ - $closer = ($nextNonSimple + 1); - if ($tokens[$nextNonSimple]['code'] === \T_OPEN_SHORT_ARRAY - && isset($tokens[$nextNonSimple]['bracket_closer']) === true - ) { - $closer = $tokens[$nextNonSimple]['bracket_closer']; - } else { - $maybeOpener = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonSimple + 1), ($end + 1), true); - if ($tokens[$maybeOpener]['code'] === \T_OPEN_PARENTHESIS) { - $opener = $maybeOpener; - if (isset($tokens[$opener]['parenthesis_closer']) === true) { - $closer = $tokens[$opener]['parenthesis_closer']; - } - } - } - - if ($closer === $end) { - return true; - } - - // Examine what comes after the array, if anything. - return $this->isStaticValue($phpcsFile, $tokens, ($closer + 1), $end, $nestedArrays); - - } - - // Ok, so this unsafe token was not one of the exceptions, i.e. this is a PHP 5.6+ syntax. - return false; - } - - - /** - * Throw an error if a scalar expression is found. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token to link the error to. - * @param string $type Type of usage found. - * @param string $content Optional. The value for the declaration as found. - * - * @return void - */ - protected function throwError(File $phpcsFile, $stackPtr, $type, $content = '') - { - $error = static::ERROR_PHRASE; - $phrase = ''; - $errorCode = 'Found'; - - if (isset($this->errorPhrases[$type]) === true) { - $errorCode = $this->stringToErrorCode($type) . 'Found'; - $phrase = $this->errorPhrases[$type]; - } - - $data = array($phrase); - - if (empty($content) === false) { - $error .= ' Found: %s'; - $data[] = $content; - } - - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } - - - /** - * Helper function to find the end of multi variable/constant declarations. - * - * Checks whether a certain part of a declaration needs to be skipped over or - * if it is the real end of the declaration. - * - * @since 8.2.0 - * - * @param array $tokens Token stack of the current file. - * @param int $endPtr The token to examine as a candidate end pointer. - * @param int $targetLevel Target nesting level. - * - * @return bool|int True if this is the real end. Int stackPtr to skip to if not. - */ - private function isRealEndOfDeclaration($tokens, $endPtr, $targetLevel) - { - // Ignore anything within short array definition brackets for now. - if ($tokens[$endPtr]['code'] === \T_OPEN_SHORT_ARRAY - && (isset($tokens[$endPtr]['bracket_opener']) - && $tokens[$endPtr]['bracket_opener'] === $endPtr) - && isset($tokens[$endPtr]['bracket_closer']) - ) { - // Skip forward to the end of the short array definition. - return $tokens[$endPtr]['bracket_closer']; - } - - // Skip past comma's at a lower nesting level. - if ($tokens[$endPtr]['code'] === \T_COMMA) { - // Check if a comma is at the nesting level we're targetting. - $nestingLevel = 0; - if (isset($tokens[$endPtr]['nested_parenthesis']) === true) { - $nestingLevel = \count($tokens[$endPtr]['nested_parenthesis']); - } - if ($nestingLevel > $targetLevel) { - return $endPtr; - } - } - - return true; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php deleted file mode 100644 index 406237a5..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php +++ /dev/null @@ -1,100 +0,0 @@ - 'constants', - 'property' => 'class properties', - 'staticvar' => 'static variables', - 'default' => 'default parameter values', - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 8.2.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('5.2') !== true); - } - - - /** - * Is a value declared and does the declared value not contain an heredoc ? - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param int $end The end of the value definition. - * - * @return bool True if no heredoc (or assignment) is found, false otherwise. - */ - protected function isValidAssignment(File $phpcsFile, $stackPtr, $end) - { - $tokens = $phpcsFile->getTokens(); - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), $end, true); - if ($next === false || $tokens[$next]['code'] !== \T_EQUAL) { - // No value assigned. - return true; - } - - return ($phpcsFile->findNext(\T_START_HEREDOC, ($next + 1), $end, false, null, true) === false); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php deleted file mode 100644 index e154a603..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/InternalInterfacesSniff.php +++ /dev/null @@ -1,103 +0,0 @@ - string) - */ - protected $internalInterfaces = array( - 'Traversable' => 'shouldn\'t be implemented directly, implement the Iterator or IteratorAggregate interface instead.', - 'DateTimeInterface' => 'is intended for type hints only and is not implementable.', - 'Throwable' => 'cannot be implemented directly, extend the Exception class instead.', - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.3 - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of interface names. - $this->internalInterfaces = $this->arrayKeysToLowercase($this->internalInterfaces); - - $targets = array(\T_CLASS); - - if (\defined('T_ANON_CLASS')) { - $targets[] = \T_ANON_CLASS; - } - - return $targets; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_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) - { - $interfaces = PHPCSHelper::findImplementedInterfaceNames($phpcsFile, $stackPtr); - - if (\is_array($interfaces) === false || $interfaces === array()) { - return; - } - - foreach ($interfaces as $interface) { - $interface = ltrim($interface, '\\'); - $interfaceLc = strtolower($interface); - if (isset($this->internalInterfaces[$interfaceLc]) === true) { - $error = 'The interface %s %s'; - $errorCode = $this->stringToErrorCode($interfaceLc) . 'Found'; - $data = array( - $interface, - $this->internalInterfaces[$interfaceLc], - ); - - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php deleted file mode 100644 index 35c5939b..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php +++ /dev/null @@ -1,362 +0,0 @@ - array(string => bool)) - */ - protected $newInterfaces = array( - 'Traversable' => array( - '4.4' => false, - '5.0' => true, - ), - 'Reflector' => array( - '4.4' => false, - '5.0' => true, - ), - - 'Countable' => array( - '5.0' => false, - '5.1' => true, - ), - 'OuterIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'RecursiveIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'SeekableIterator' => array( - '5.0' => false, - '5.1' => true, - ), - 'Serializable' => array( - '5.0' => false, - '5.1' => true, - ), - 'SplObserver' => array( - '5.0' => false, - '5.1' => true, - ), - 'SplSubject' => array( - '5.0' => false, - '5.1' => true, - ), - - 'JsonSerializable' => array( - '5.3' => false, - '5.4' => true, - ), - 'SessionHandlerInterface' => array( - '5.3' => false, - '5.4' => true, - ), - - 'DateTimeInterface' => array( - '5.4' => false, - '5.5' => true, - ), - - 'SessionIdInterface' => array( - '5.5.0' => false, - '5.5.1' => true, - ), - - 'Throwable' => array( - '5.6' => false, - '7.0' => true, - ), - 'SessionUpdateTimestampHandlerInterface' => array( - '5.6' => false, - '7.0' => true, - ), - ); - - /** - * A list of methods which cannot be used in combination with particular interfaces. - * - * @since 7.0.3 - * - * @var array(string => array(string => string)) - */ - protected $unsupportedMethods = array( - 'Serializable' => array( - '__sleep' => 'https://www.php.net/serializable', - '__wakeup' => 'https://www.php.net/serializable', - ), - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.3 - * - * @return array - */ - public function register() - { - // Handle case-insensitivity of interface names. - $this->newInterfaces = $this->arrayKeysToLowercase($this->newInterfaces); - $this->unsupportedMethods = $this->arrayKeysToLowercase($this->unsupportedMethods); - - $targets = array( - \T_CLASS, - \T_FUNCTION, - \T_CLOSURE, - ); - - if (\defined('T_ANON_CLASS')) { - $targets[] = \T_ANON_CLASS; - } - - if (\defined('T_RETURN_TYPE')) { - $targets[] = \T_RETURN_TYPE; - } - - return $targets; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_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(); - - switch ($tokens[$stackPtr]['type']) { - case 'T_CLASS': - case 'T_ANON_CLASS': - $this->processClassToken($phpcsFile, $stackPtr); - break; - - case 'T_FUNCTION': - case 'T_CLOSURE': - $this->processFunctionToken($phpcsFile, $stackPtr); - - // Deal with older PHPCS versions which don't recognize return type hints - // as well as newer PHPCS versions (3.3.0+) where the tokenization has changed. - $returnTypeHint = $this->getReturnTypeHintToken($phpcsFile, $stackPtr); - if ($returnTypeHint !== false) { - $this->processReturnTypeToken($phpcsFile, $returnTypeHint); - } - break; - - case 'T_RETURN_TYPE': - $this->processReturnTypeToken($phpcsFile, $stackPtr); - break; - - default: - // Deliberately left empty. - break; - } - } - - - /** - * Processes this test for when a class token is encountered. - * - * - Detect classes implementing the new interfaces. - * - Detect classes implementing the new interfaces with unsupported functions. - * - * @since 7.1.4 Split off from the `process()` method. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - private function processClassToken(File $phpcsFile, $stackPtr) - { - $interfaces = PHPCSHelper::findImplementedInterfaceNames($phpcsFile, $stackPtr); - - if (\is_array($interfaces) === false || $interfaces === array()) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $checkMethods = false; - - if (isset($tokens[$stackPtr]['scope_closer'])) { - $checkMethods = true; - $scopeCloser = $tokens[$stackPtr]['scope_closer']; - } - - foreach ($interfaces as $interface) { - $interface = ltrim($interface, '\\'); - $interfaceLc = strtolower($interface); - - if (isset($this->newInterfaces[$interfaceLc]) === true) { - $itemInfo = array( - 'name' => $interface, - 'nameLc' => $interfaceLc, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - if ($checkMethods === true && isset($this->unsupportedMethods[$interfaceLc]) === true) { - $nextFunc = $stackPtr; - while (($nextFunc = $phpcsFile->findNext(\T_FUNCTION, ($nextFunc + 1), $scopeCloser)) !== false) { - $funcName = $phpcsFile->getDeclarationName($nextFunc); - $funcNameLc = strtolower($funcName); - if ($funcNameLc === '') { - continue; - } - - if (isset($this->unsupportedMethods[$interfaceLc][$funcNameLc]) === true) { - $error = 'Classes that implement interface %s do not support the method %s(). See %s'; - $errorCode = $this->stringToErrorCode($interface) . 'UnsupportedMethod'; - $data = array( - $interface, - $funcName, - $this->unsupportedMethods[$interfaceLc][$funcNameLc], - ); - - $phpcsFile->addError($error, $nextFunc, $errorCode, $data); - } - } - } - } - } - - - /** - * Processes this test for when a function token is encountered. - * - * - Detect new interfaces when used as a type hint. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - private function processFunctionToken(File $phpcsFile, $stackPtr) - { - $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr); - if (empty($typeHints) || \is_array($typeHints) === false) { - return; - } - - foreach ($typeHints as $hint) { - - $typeHintLc = strtolower($hint); - - if (isset($this->newInterfaces[$typeHintLc]) === true) { - $itemInfo = array( - 'name' => $hint, - 'nameLc' => $typeHintLc, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - } - } - - - /** - * Processes this test for when a return type token is encountered. - * - * - Detect new interfaces when used as a return type declaration. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - private function processReturnTypeToken(File $phpcsFile, $stackPtr) - { - $returnTypeHint = $this->getReturnTypeHintName($phpcsFile, $stackPtr); - if (empty($returnTypeHint)) { - return; - } - - $returnTypeHint = ltrim($returnTypeHint, '\\'); - $returnTypeHintLc = strtolower($returnTypeHint); - - if (isset($this->newInterfaces[$returnTypeHintLc]) === false) { - return; - } - - // Still here ? Then this is a return type declaration using a new interface. - $itemInfo = array( - 'name' => $returnTypeHint, - 'nameLc' => $returnTypeHintLc, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newInterfaces[$itemInfo['nameLc']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The built-in interface ' . parent::getErrorMsgTemplate(); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php deleted file mode 100644 index 64002b4d..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/CaseSensitiveKeywordsSniff.php +++ /dev/null @@ -1,76 +0,0 @@ -supportsBelow('5.4') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $tokenContentLC = strtolower($tokens[$stackPtr]['content']); - - if ($tokenContentLC !== $tokens[$stackPtr]['content']) { - $phpcsFile->addError( - 'The keyword \'%s\' was treated in a case-sensitive fashion in certain cases in PHP 5.4 or earlier. Use the lowercase version for consistent support.', - $stackPtr, - 'NonLowercaseFound', - array($tokenContentLC) - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php deleted file mode 100644 index 7f4411bc..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsDeclaredSniff.php +++ /dev/null @@ -1,259 +0,0 @@ - '7.0', - \T_TRUE => '7.0', - \T_FALSE => '7.0', - ); - - /** - * T_STRING keywords to recognize as forbidden names. - * - * @since 7.0.8 - * - * @var array - */ - protected $forbiddenNames = array( - 'null' => '7.0', - 'true' => '7.0', - 'false' => '7.0', - 'bool' => '7.0', - 'int' => '7.0', - 'float' => '7.0', - 'string' => '7.0', - 'iterable' => '7.1', - 'void' => '7.1', - 'object' => '7.2', - ); - - /** - * T_STRING keywords to recognize as soft reserved names. - * - * Using any of these keywords to name a class, interface, trait or namespace - * is highly discouraged since they may be used in future versions of PHP. - * - * @since 7.0.8 - * - * @var array - */ - protected $softReservedNames = array( - 'resource' => '7.0', - 'object' => '7.0', - 'mixed' => '7.0', - 'numeric' => '7.0', - ); - - /** - * Combined list of the two lists above. - * - * Used for quick check whether or not something is a reserved - * word. - * Set from the `register()` method. - * - * @since 7.0.8 - * - * @var array - */ - private $allForbiddenNames = array(); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.8 - * - * @return array - */ - public function register() - { - // Do the list merge only once. - $this->allForbiddenNames = array_merge($this->forbiddenNames, $this->softReservedNames); - - $targets = array( - \T_CLASS, - \T_INTERFACE, - \T_TRAIT, - \T_NAMESPACE, - \T_STRING, // Compat for PHPCS < 2.4.0 and PHP < 5.3. - ); - - return $targets; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.8 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $tokenCode = $tokens[$stackPtr]['code']; - $tokenType = $tokens[$stackPtr]['type']; - $tokenContentLc = strtolower($tokens[$stackPtr]['content']); - - // For string tokens we only care about 'trait' as that is the only one - // which may not be correctly recognized as it's own token. - // This only happens in older versions of PHP where the token doesn't exist yet as a keyword. - if ($tokenCode === \T_STRING && $tokenContentLc !== 'trait') { - return; - } - - if (\in_array($tokenType, array('T_CLASS', 'T_INTERFACE', 'T_TRAIT'), true)) { - // Check for the declared name being a name which is not tokenized as T_STRING. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty !== false && isset($this->forbiddenTokens[$tokens[$nextNonEmpty]['code']]) === true) { - $name = $tokens[$nextNonEmpty]['content']; - } else { - // Get the declared name if it's a T_STRING. - $name = $phpcsFile->getDeclarationName($stackPtr); - } - unset($nextNonEmpty); - - if (isset($name) === false || \is_string($name) === false || $name === '') { - return; - } - - $nameLc = strtolower($name); - if (isset($this->allForbiddenNames[$nameLc]) === false) { - return; - } - - } elseif ($tokenCode === \T_NAMESPACE) { - $namespaceName = $this->getDeclaredNamespaceName($phpcsFile, $stackPtr); - - if ($namespaceName === false || $namespaceName === '') { - return; - } - - $namespaceParts = explode('\\', $namespaceName); - foreach ($namespaceParts as $namespacePart) { - $partLc = strtolower($namespacePart); - if (isset($this->allForbiddenNames[$partLc]) === true) { - $name = $namespacePart; - $nameLc = $partLc; - break; - } - } - } elseif ($tokenCode === \T_STRING) { - // Traits which are not yet tokenized as T_TRAIT. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - $nextNonEmptyCode = $tokens[$nextNonEmpty]['code']; - - if ($nextNonEmptyCode !== \T_STRING && isset($this->forbiddenTokens[$nextNonEmptyCode]) === true) { - $name = $tokens[$nextNonEmpty]['content']; - $nameLc = strtolower($tokens[$nextNonEmpty]['content']); - } elseif ($nextNonEmptyCode === \T_STRING) { - $endOfStatement = $phpcsFile->findNext(array(\T_SEMICOLON, \T_OPEN_CURLY_BRACKET), ($stackPtr + 1)); - if ($endOfStatement === false) { - return; - } - - do { - $nextNonEmptyLc = strtolower($tokens[$nextNonEmpty]['content']); - - if (isset($this->allForbiddenNames[$nextNonEmptyLc]) === true) { - $name = $tokens[$nextNonEmpty]['content']; - $nameLc = $nextNonEmptyLc; - break; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), $endOfStatement, true); - } while ($nextNonEmpty !== false); - } - unset($nextNonEmptyCode, $nextNonEmptyLc, $endOfStatement); - } - - if (isset($name, $nameLc) === false) { - return; - } - - // Still here, so this is one of the reserved words. - // Build up the error message. - $error = "'%s' is a"; - $isError = null; - $errorCode = $this->stringToErrorCode($nameLc) . 'Found'; - $data = array( - $nameLc, - ); - - if (isset($this->softReservedNames[$nameLc]) === true - && $this->supportsAbove($this->softReservedNames[$nameLc]) === true - ) { - $error .= ' soft reserved keyword as of PHP version %s'; - $isError = false; - $data[] = $this->softReservedNames[$nameLc]; - } - - if (isset($this->forbiddenNames[$nameLc]) === true - && $this->supportsAbove($this->forbiddenNames[$nameLc]) === true - ) { - if (isset($isError) === true) { - $error .= ' and a'; - } - $error .= ' reserved keyword as of PHP version %s'; - $isError = true; - $data[] = $this->forbiddenNames[$nameLc]; - } - - if (isset($isError) === true) { - $error .= ' and should not be used to name a class, interface or trait or as part of a namespace (%s)'; - $data[] = $tokens[$stackPtr]['type']; - - $this->addMessage($phpcsFile, $error, $stackPtr, $isError, $errorCode, $data); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsInvokedFunctionsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsInvokedFunctionsSniff.php deleted file mode 100644 index c1c38281..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesAsInvokedFunctionsSniff.php +++ /dev/null @@ -1,188 +0,0 @@ - '5.0', - \T_CALLABLE => '5.4', - \T_CATCH => '5.0', - \T_FINAL => '5.0', - \T_FINALLY => '5.5', - \T_GOTO => '5.3', - \T_IMPLEMENTS => '5.0', - \T_INTERFACE => '5.0', - \T_INSTANCEOF => '5.0', - \T_INSTEADOF => '5.4', - \T_NAMESPACE => '5.3', - \T_PRIVATE => '5.0', - \T_PROTECTED => '5.0', - \T_PUBLIC => '5.0', - \T_TRAIT => '5.4', - \T_TRY => '5.0', - - ); - - /** - * T_STRING keywords to recognize as targetted tokens. - * - * Compatibility for PHP versions where the keyword is not yet recognized - * as its own token and for PHPCS versions which change the token to - * T_STRING when used in a method call. - * - * @since 5.5 - * - * @var array - */ - protected $targetedStringTokens = array( - 'abstract' => '5.0', - 'callable' => '5.4', - 'catch' => '5.0', - 'final' => '5.0', - 'finally' => '5.5', - 'goto' => '5.3', - 'implements' => '5.0', - 'interface' => '5.0', - 'instanceof' => '5.0', - 'insteadof' => '5.4', - 'namespace' => '5.3', - 'private' => '5.0', - 'protected' => '5.0', - 'public' => '5.0', - 'trait' => '5.4', - 'try' => '5.0', - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * - * @return array - */ - public function register() - { - $tokens = array_keys($this->targetedTokens); - $tokens[] = \T_STRING; - - return $tokens; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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(); - $tokenCode = $tokens[$stackPtr]['code']; - $tokenContentLc = strtolower($tokens[$stackPtr]['content']); - $isString = false; - - /* - * For string tokens we only care if the string is a reserved word used - * as a function. This only happens in older versions of PHP where the - * token doesn't exist yet for that keyword or in later versions when the - * token is used in a method invocation. - */ - if ($tokenCode === \T_STRING - && (isset($this->targetedStringTokens[$tokenContentLc]) === false) - ) { - return; - } - - if ($tokenCode === \T_STRING) { - $isString = true; - } - - // Make sure this is a function call. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next === false || $tokens[$next]['code'] !== \T_OPEN_PARENTHESIS) { - // Not a function call. - return; - } - - // This sniff isn't concerned about function declarations. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prev !== false && $tokens[$prev]['code'] === \T_FUNCTION) { - 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...", i.e. they can be invoked as a method call. - * - * Only needed for those keywords which we sniff out via T_STRING. - */ - if (($tokens[$prev]['code'] === \T_OBJECT_OPERATOR || $tokens[$prev]['code'] === \T_DOUBLE_COLON) - && $this->supportsBelow('5.6') === false - ) { - return; - } - - // For the word catch, it is valid to have an open parenthesis - // after it, but only if it is preceded by a right curly brace. - if ($tokenCode === \T_CATCH) { - if ($prev !== false && $tokens[$prev]['code'] === \T_CLOSE_CURLY_BRACKET) { - // Ok, it's fine. - return; - } - } - - if ($isString === true) { - $version = $this->targetedStringTokens[$tokenContentLc]; - } else { - $version = $this->targetedTokens[$tokenCode]; - } - - if ($this->supportsAbove($version)) { - $error = "'%s' is a reserved keyword introduced in PHP version %s and cannot be invoked as a function (%s)"; - $errorCode = $this->stringToErrorCode($tokenContentLc) . 'Found'; - $data = array( - $tokenContentLc, - $version, - $tokens[$stackPtr]['type'], - ); - - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php deleted file mode 100644 index 6be1de4f..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/ForbiddenNamesSniff.php +++ /dev/null @@ -1,442 +0,0 @@ - string) - */ - protected $invalidNames = array( - 'abstract' => '5.0', - 'and' => 'all', - 'array' => 'all', - 'as' => 'all', - 'break' => 'all', - 'callable' => '5.4', - 'case' => 'all', - 'catch' => '5.0', - 'class' => 'all', - 'clone' => '5.0', - 'const' => 'all', - 'continue' => 'all', - 'declare' => 'all', - 'default' => 'all', - 'die' => 'all', - 'do' => 'all', - 'echo' => 'all', - 'else' => 'all', - 'elseif' => 'all', - 'empty' => 'all', - 'enddeclare' => 'all', - 'endfor' => 'all', - 'endforeach' => 'all', - 'endif' => 'all', - 'endswitch' => 'all', - 'endwhile' => 'all', - 'eval' => 'all', - 'exit' => 'all', - 'extends' => 'all', - 'final' => '5.0', - 'finally' => '5.5', - 'for' => 'all', - 'foreach' => 'all', - 'function' => 'all', - 'global' => 'all', - 'goto' => '5.3', - 'if' => 'all', - 'implements' => '5.0', - 'include' => 'all', - 'include_once' => 'all', - 'instanceof' => '5.0', - 'insteadof' => '5.4', - 'interface' => '5.0', - 'isset' => 'all', - 'list' => 'all', - 'namespace' => '5.3', - 'new' => 'all', - 'or' => 'all', - 'print' => 'all', - 'private' => '5.0', - 'protected' => '5.0', - 'public' => '5.0', - 'require' => 'all', - 'require_once' => 'all', - 'return' => 'all', - 'static' => 'all', - 'switch' => 'all', - 'throw' => '5.0', - 'trait' => '5.4', - 'try' => '5.0', - 'unset' => 'all', - 'use' => 'all', - 'var' => 'all', - 'while' => 'all', - 'xor' => 'all', - 'yield' => '5.5', - '__class__' => 'all', - '__dir__' => '5.3', - '__file__' => 'all', - '__function__' => 'all', - '__method__' => 'all', - '__namespace__' => '5.3', - ); - - /** - * A list of keywords that can follow use statements. - * - * @since 7.0.1 - * - * @var array(string => string) - */ - protected $validUseNames = array( - 'const' => true, - 'function' => true, - ); - - /** - * Scope modifiers and other keywords allowed in trait use statements. - * - * @since 7.1.4 - * - * @var array - */ - private $allowedModifiers = array(); - - /** - * Targeted tokens. - * - * @since 5.5 - * - * @var array - */ - protected $targetedTokens = array( - \T_CLASS, - \T_FUNCTION, - \T_NAMESPACE, - \T_STRING, - \T_CONST, - \T_USE, - \T_AS, - \T_EXTENDS, - \T_INTERFACE, - \T_TRAIT, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * - * @return array - */ - public function register() - { - $this->allowedModifiers = Tokens::$scopeModifiers; - $this->allowedModifiers[\T_FINAL] = \T_FINAL; - - $tokens = $this->targetedTokens; - - if (\defined('T_ANON_CLASS')) { - $tokens[] = \T_ANON_CLASS; - } - - return $tokens; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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(); - - /* - * We distinguish between the class, function and namespace names vs the define statements. - */ - if ($tokens[$stackPtr]['type'] === 'T_STRING') { - $this->processString($phpcsFile, $stackPtr, $tokens); - } else { - $this->processNonString($phpcsFile, $stackPtr, $tokens); - } - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processNonString(File $phpcsFile, $stackPtr, $tokens) - { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - /* - * Deal with anonymous classes - `class` before a reserved keyword is sometimes - * misidentified as `T_ANON_CLASS`. - * In PHPCS < 2.3.4 these were tokenized as T_CLASS no matter what. - */ - if ($tokens[$stackPtr]['type'] === 'T_ANON_CLASS' || $tokens[$stackPtr]['type'] === 'T_CLASS') { - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prevNonEmpty !== false && $tokens[$prevNonEmpty]['type'] === 'T_NEW') { - return; - } - } - - /* - * PHP 5.6 allows for use const and use function, but only if followed by the function/constant name. - * - `use function HelloWorld` => move to the next token (HelloWorld) to verify. - * - `use const HelloWorld` => move to the next token (HelloWorld) to verify. - */ - elseif ($tokens[$stackPtr]['type'] === 'T_USE' - && isset($this->validUseNames[strtolower($tokens[$nextNonEmpty]['content'])]) === true - ) { - $maybeUseNext = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true, null, true); - if ($maybeUseNext !== false && $this->isEndOfUseStatement($tokens[$maybeUseNext]) === false) { - $nextNonEmpty = $maybeUseNext; - } - } - - /* - * Deal with visibility modifiers. - * - `use HelloWorld { sayHello as protected; }` => valid, bow out. - * - `use HelloWorld { sayHello as private myPrivateHello; }` => move to the next token to verify. - */ - elseif ($tokens[$stackPtr]['type'] === 'T_AS' - && isset($this->allowedModifiers[$tokens[$nextNonEmpty]['code']]) === true - && $phpcsFile->hasCondition($stackPtr, \T_USE) === true - ) { - $maybeUseNext = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true, null, true); - if ($maybeUseNext === false || $this->isEndOfUseStatement($tokens[$maybeUseNext]) === true) { - return; - } - - $nextNonEmpty = $maybeUseNext; - } - - /* - * Deal with foreach ( ... as list() ). - */ - elseif ($tokens[$stackPtr]['type'] === 'T_AS' - && isset($tokens[$stackPtr]['nested_parenthesis']) === true - && $tokens[$nextNonEmpty]['code'] === \T_LIST - ) { - $parentheses = array_reverse($tokens[$stackPtr]['nested_parenthesis'], true); - foreach ($parentheses as $open => $close) { - if (isset($tokens[$open]['parenthesis_owner']) - && $tokens[$tokens[$open]['parenthesis_owner']]['code'] === \T_FOREACH - ) { - return; - } - } - } - - /* - * Deal with functions declared to return by reference. - */ - elseif ($tokens[$stackPtr]['type'] === 'T_FUNCTION' - && $tokens[$nextNonEmpty]['type'] === 'T_BITWISE_AND' - ) { - $maybeUseNext = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true, null, true); - if ($maybeUseNext === false) { - // Live coding. - return; - } - - $nextNonEmpty = $maybeUseNext; - } - - /* - * Deal with nested namespaces. - */ - elseif ($tokens[$stackPtr]['type'] === 'T_NAMESPACE') { - if ($tokens[$stackPtr + 1]['code'] === \T_NS_SEPARATOR) { - // Not a namespace declaration, but use of, i.e. `namespace\someFunction();`. - return; - } - - $endToken = $phpcsFile->findNext(array(\T_SEMICOLON, \T_OPEN_CURLY_BRACKET), ($stackPtr + 1), null, false, null, true); - $namespaceName = trim($phpcsFile->getTokensAsString(($stackPtr + 1), ($endToken - $stackPtr - 1))); - if (empty($namespaceName) === true) { - return; - } - - $namespaceParts = explode('\\', $namespaceName); - foreach ($namespaceParts as $namespacePart) { - $partLc = strtolower($namespacePart); - if (isset($this->invalidNames[$partLc]) === false) { - continue; - } - - // Find the token position of the part which matched. - for ($i = ($stackPtr + 1); $i < $endToken; $i++) { - if ($tokens[$i]['content'] === $namespacePart) { - $nextNonEmpty = $i; - break; - } - } - } - unset($i, $namespacePart, $partLc); - } - - $nextContentLc = strtolower($tokens[$nextNonEmpty]['content']); - if (isset($this->invalidNames[$nextContentLc]) === 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, except that class may not be used as constant name." - */ - if ((($tokens[$stackPtr]['type'] === 'T_FUNCTION' - && $this->inClassScope($phpcsFile, $stackPtr, false) === true) - || ($tokens[$stackPtr]['type'] === 'T_CONST' - && $this->isClassConstant($phpcsFile, $stackPtr) === true - && $nextContentLc !== 'class')) - && $this->supportsBelow('5.6') === false - ) { - return; - } - - if ($this->supportsAbove($this->invalidNames[$nextContentLc])) { - $data = array( - $tokens[$nextNonEmpty]['content'], - $this->invalidNames[$nextContentLc], - ); - $this->addError($phpcsFile, $stackPtr, $tokens[$nextNonEmpty]['content'], $data); - } - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processString(File $phpcsFile, $stackPtr, $tokens) - { - $tokenContentLc = strtolower($tokens[$stackPtr]['content']); - - /* - * Special case for PHP versions where the target is not yet identified as - * its own token, but presents as T_STRING. - * - trait keyword in PHP < 5.4 - */ - if (version_compare(\PHP_VERSION_ID, '50400', '<') && $tokenContentLc === 'trait') { - $this->processNonString($phpcsFile, $stackPtr, $tokens); - return; - } - - // Look for any define/defined tokens (both T_STRING ones, blame Tokenizer). - if ($tokenContentLc !== 'define' && $tokenContentLc !== 'defined') { - return; - } - - // Retrieve the define(d) constant name. - $firstParam = $this->getFunctionCallParameter($phpcsFile, $stackPtr, 1); - if ($firstParam === false) { - return; - } - - $defineName = $this->stripQuotes($firstParam['raw']); - $defineNameLc = strtolower($defineName); - - if (isset($this->invalidNames[$defineNameLc]) && $this->supportsAbove($this->invalidNames[$defineNameLc])) { - $data = array( - $defineName, - $this->invalidNames[$defineNameLc], - ); - $this->addError($phpcsFile, $stackPtr, $defineNameLc, $data); - } - } - - - /** - * Add the error message. - * - * @since 7.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param string $content The token content found. - * @param array $data The data to pass into the error message. - * - * @return void - */ - protected function addError(File $phpcsFile, $stackPtr, $content, $data) - { - $error = "Function name, class name, namespace name or constant name can not be reserved keyword '%s' (since version %s)"; - $errorCode = $this->stringToErrorCode($content) . 'Found'; - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } - - - /** - * Check if the current token code is for a token which can be considered - * the end of a (partial) use statement. - * - * @since 7.0.8 - * - * @param int $token The current token information. - * - * @return bool - */ - protected function isEndOfUseStatement($token) - { - return \in_array($token['code'], array(\T_CLOSE_CURLY_BRACKET, \T_SEMICOLON, \T_COMMA), true); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php deleted file mode 100644 index 61f79aa5..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Keywords/NewKeywordsSniff.php +++ /dev/null @@ -1,391 +0,0 @@ - array(string => bool|string)) - */ - protected $newKeywords = array( - 'T_HALT_COMPILER' => array( - '5.0' => false, - '5.1' => true, - 'description' => '"__halt_compiler" keyword', - ), - 'T_CONST' => array( - '5.2' => false, - '5.3' => true, - 'description' => '"const" keyword', - 'condition' => 'isClassConstant', // Keyword is only new when not in class context. - ), - 'T_CALLABLE' => array( - '5.3' => false, - '5.4' => true, - 'description' => '"callable" keyword', - 'content' => 'callable', - ), - 'T_DIR' => array( - '5.2' => false, - '5.3' => true, - 'description' => '__DIR__ magic constant', - 'content' => '__DIR__', - ), - 'T_GOTO' => array( - '5.2' => false, - '5.3' => true, - 'description' => '"goto" keyword', - 'content' => 'goto', - ), - 'T_INSTEADOF' => array( - '5.3' => false, - '5.4' => true, - 'description' => '"insteadof" keyword (for traits)', - 'content' => 'insteadof', - ), - 'T_NAMESPACE' => array( - '5.2' => false, - '5.3' => true, - 'description' => '"namespace" keyword', - 'content' => 'namespace', - ), - 'T_NS_C' => array( - '5.2' => false, - '5.3' => true, - 'description' => '__NAMESPACE__ magic constant', - 'content' => '__NAMESPACE__', - ), - 'T_USE' => array( - '5.2' => false, - '5.3' => true, - 'description' => '"use" keyword (for traits/namespaces/anonymous functions)', - ), - 'T_START_NOWDOC' => array( - '5.2' => false, - '5.3' => true, - 'description' => 'nowdoc functionality', - ), - 'T_END_NOWDOC' => array( - '5.2' => false, - '5.3' => true, - 'description' => 'nowdoc functionality', - ), - 'T_START_HEREDOC' => array( - '5.2' => false, - '5.3' => true, - 'description' => '(Double) quoted Heredoc identifier', - 'condition' => 'isNotQuoted', // Heredoc is only new with quoted identifier. - ), - 'T_TRAIT' => array( - '5.3' => false, - '5.4' => true, - 'description' => '"trait" keyword', - 'content' => 'trait', - ), - 'T_TRAIT_C' => array( - '5.3' => false, - '5.4' => true, - 'description' => '__TRAIT__ magic constant', - 'content' => '__TRAIT__', - ), - // The specifics for distinguishing between 'yield' and 'yield from' are dealt - // with in the translation logic. - // This token has to be placed above the `T_YIELD` token in this array to allow for this. - 'T_YIELD_FROM' => array( - '5.6' => false, - '7.0' => true, - 'description' => '"yield from" keyword (for generators)', - 'content' => 'yield', - ), - 'T_YIELD' => array( - '5.4' => false, - '5.5' => true, - 'description' => '"yield" keyword (for generators)', - 'content' => 'yield', - ), - 'T_FINALLY' => array( - '5.4' => false, - '5.5' => true, - 'description' => '"finally" keyword (in exception handling)', - 'content' => 'finally', - ), - ); - - /** - * Translation table for T_STRING tokens. - * - * Will be set up from the register() method. - * - * @since 7.0.5 - * - * @var array(string => string) - */ - protected $translateContentToToken = array(); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * - * @return array - */ - public function register() - { - $tokens = array(); - $translate = array(); - foreach ($this->newKeywords as $token => $versions) { - if (\defined($token)) { - $tokens[] = constant($token); - } - if (isset($versions['content'])) { - $translate[strtolower($versions['content'])] = $token; - } - } - - /* - * Deal with tokens not recognized by the PHP version the sniffer is run - * under and (not correctly) compensated for by PHPCS. - */ - if (empty($translate) === false) { - $this->translateContentToToken = $translate; - $tokens[] = \T_STRING; - } - - return $tokens; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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(); - $tokenType = $tokens[$stackPtr]['type']; - - // Allow for dealing with multi-token keywords, like "yield from". - $end = $stackPtr; - - // Translate T_STRING token if necessary. - if ($tokens[$stackPtr]['type'] === 'T_STRING') { - $content = strtolower($tokens[$stackPtr]['content']); - - if (isset($this->translateContentToToken[$content]) === false) { - // Not one of the tokens we're looking for. - return; - } - - $tokenType = $this->translateContentToToken[$content]; - } - - /* - * Special case: distinguish between `yield` and `yield from`. - * - * PHPCS currently (at least up to v 3.0.1) does not backfill for the - * `yield` nor the `yield from` keywords. - * See: https://github.com/squizlabs/PHP_CodeSniffer/issues/1524 - * - * In PHP < 5.5, both `yield` as well as `from` are tokenized as T_STRING. - * In PHP 5.5 - 5.6, `yield` is tokenized as T_YIELD and `from` as T_STRING, - * but the `T_YIELD_FROM` token *is* defined in PHP. - * In PHP 7.0+ both are tokenized as their respective token, however, - * a multi-line "yield from" is tokenized as two tokens. - */ - if ($tokenType === 'T_YIELD') { - $nextToken = $phpcsFile->findNext(\T_WHITESPACE, ($end + 1), null, true); - if ($tokens[$nextToken]['code'] === \T_STRING - && $tokens[$nextToken]['content'] === 'from' - ) { - $tokenType = 'T_YIELD_FROM'; - $end = $nextToken; - } - unset($nextToken); - } - - if ($tokenType === 'T_YIELD_FROM' && $tokens[($stackPtr - 1)]['type'] === 'T_YIELD_FROM') { - // Multi-line "yield from", no need to report it twice. - return; - } - - if (isset($this->newKeywords[$tokenType]) === false) { - return; - } - - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - if ($prevToken !== false - && ($tokens[$prevToken]['code'] === \T_DOUBLE_COLON - || $tokens[$prevToken]['code'] === \T_OBJECT_OPERATOR) - ) { - // Class property of the same name as one of the keywords. Ignore. - return; - } - - // Skip attempts to use keywords as functions or class names - the former - // will be reported by ForbiddenNamesAsInvokedFunctionsSniff, whilst the - // latter will be (partially) reported by the ForbiddenNames sniff. - // Either type will result in false-positives when targetting lower versions - // of PHP where the name was not reserved, unless we explicitly check for - // them. - if (($nextToken === false - || $tokens[$nextToken]['type'] !== 'T_OPEN_PARENTHESIS') - && ($prevToken === false - || $tokens[$prevToken]['type'] !== 'T_CLASS' - || $tokens[$prevToken]['type'] !== 'T_INTERFACE') - ) { - // Skip based on token scope condition. - if (isset($this->newKeywords[$tokenType]['condition']) - && \call_user_func(array($this, $this->newKeywords[$tokenType]['condition']), $phpcsFile, $stackPtr) === true - ) { - return; - } - - $itemInfo = array( - 'name' => $tokenType, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newKeywords[$itemInfo['name']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array( - 'description', - 'condition', - 'content', - ); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - $errorInfo['description'] = $itemArray['description']; - - return $errorInfo; - } - - - /** - * Allow for concrete child classes to filter the error data before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param array $data The error data array which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return array - */ - protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) - { - $data[0] = $errorInfo['description']; - return $data; - } - - - /** - * Callback for the quoted heredoc identifier condition. - * - * A double quoted identifier will have the opening quote on position 3 - * in the string: `<<<"ID"`. - * - * @since 8.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return bool - */ - public function isNotQuoted(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - return ($tokens[$stackPtr]['content'][3] !== '"'); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php deleted file mode 100644 index ffb9ef28..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewEmptyNonVariableSniff.php +++ /dev/null @@ -1,91 +0,0 @@ -supportsBelow('5.4') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - $open = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); - if ($open === false - || $tokens[$open]['code'] !== \T_OPEN_PARENTHESIS - || isset($tokens[$open]['parenthesis_closer']) === false - ) { - return; - } - - $close = $tokens[$open]['parenthesis_closer']; - - $nestingLevel = 0; - if ($close !== ($open + 1) && isset($tokens[$open + 1]['nested_parenthesis'])) { - $nestingLevel = \count($tokens[$open + 1]['nested_parenthesis']); - } - - if ($this->isVariable($phpcsFile, ($open + 1), $close, $nestingLevel) === true) { - return; - } - - $phpcsFile->addError( - 'Only variables can be passed to empty() prior to PHP 5.5.', - $stackPtr, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php deleted file mode 100644 index 44488ed0..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php +++ /dev/null @@ -1,159 +0,0 @@ - array(string => bool|string)) - */ - protected $newConstructs = array( - 'T_NS_SEPARATOR' => array( - '5.2' => false, - '5.3' => true, - 'description' => 'the \ operator (for namespaces)', - ), - 'T_ELLIPSIS' => array( - '5.5' => false, - '5.6' => true, - 'description' => 'the ... spread operator', - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.6 - * - * @return array - */ - public function register() - { - $tokens = array(); - foreach ($this->newConstructs as $token => $versions) { - $tokens[] = constant($token); - } - return $tokens; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.6 - * - * @param \PHP_CodeSniffer_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(); - $tokenType = $tokens[$stackPtr]['type']; - - $itemInfo = array( - 'name' => $tokenType, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newConstructs[$itemInfo['name']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array('description'); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - $errorInfo['description'] = $itemArray['description']; - - return $errorInfo; - } - - - /** - * Allow for concrete child classes to filter the error data before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param array $data The error data array which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return array - */ - protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) - { - $data[0] = $errorInfo['description']; - return $data; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php deleted file mode 100644 index f5ba4772..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/AssignmentOrderSniff.php +++ /dev/null @@ -1,188 +0,0 @@ -supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY - && $this->isShortList($phpcsFile, $stackPtr) === false - ) { - // Short array, not short list. - return; - } - - if ($tokens[$stackPtr]['code'] === \T_LIST) { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false - || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS - || isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false - ) { - // Parse error or live coding. - return; - } - - $opener = $nextNonEmpty; - $closer = $tokens[$nextNonEmpty]['parenthesis_closer']; - } else { - // Short list syntax. - $opener = $stackPtr; - - if (isset($tokens[$stackPtr]['bracket_closer'])) { - $closer = $tokens[$stackPtr]['bracket_closer']; - } - } - - if (isset($opener, $closer) === false) { - return; - } - - /* - * OK, so we have the opener & closer, now we need to check all the variables in the - * list() to see if there are duplicates as that's the problem. - */ - $hasVars = $phpcsFile->findNext(array(\T_VARIABLE, \T_DOLLAR), ($opener + 1), $closer); - if ($hasVars === false) { - // Empty list, not our concern. - return ($closer + 1); - } - - // Set the variable delimiters based on the list type being examined. - $stopPoints = array(\T_COMMA); - if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { - $stopPoints[] = \T_CLOSE_SHORT_ARRAY; - } else { - $stopPoints[] = \T_CLOSE_PARENTHESIS; - } - - $listVars = array(); - $lastStopPoint = $opener; - - /* - * Create a list of all variables used within the `list()` construct. - * We're not concerned with whether these are nested or not, as any duplicate - * variable name used will be problematic, independent of nesting. - */ - do { - $nextStopPoint = $phpcsFile->findNext($stopPoints, ($lastStopPoint + 1), $closer); - if ($nextStopPoint === false) { - $nextStopPoint = $closer; - } - - // Also detect this in PHP 7.1 keyed lists. - $hasDoubleArrow = $phpcsFile->findNext(\T_DOUBLE_ARROW, ($lastStopPoint + 1), $nextStopPoint); - if ($hasDoubleArrow !== false) { - $lastStopPoint = $hasDoubleArrow; - } - - // Find the start of the variable, allowing for variable variables. - $nextStartPoint = $phpcsFile->findNext(array(\T_VARIABLE, \T_DOLLAR), ($lastStopPoint + 1), $nextStopPoint); - if ($nextStartPoint === false) { - // Skip past empty bits in the list, i.e. `list( $a, , ,)`. - $lastStopPoint = $nextStopPoint; - continue; - } - - /* - * Gather the content of all non-empty tokens to determine the "variable name". - * Variable name in this context includes array or object property syntaxes, such - * as `$a['name']` and `$b->property`. - */ - $varContent = ''; - - for ($i = $nextStartPoint; $i < $nextStopPoint; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']])) { - continue; - } - - $varContent .= $tokens[$i]['content']; - } - - if ($varContent !== '') { - $listVars[] = $varContent; - } - - $lastStopPoint = $nextStopPoint; - - } while ($lastStopPoint < $closer); - - if (empty($listVars)) { - // Shouldn't be possible, but just in case. - return ($closer + 1); - } - - // Verify that all variables used in the list() construct are unique. - if (\count($listVars) !== \count(array_unique($listVars))) { - $phpcsFile->addError( - 'list() will assign variable from left-to-right since PHP 7.0. Ensure all variables in list() are unique to prevent unexpected results.', - $stackPtr, - 'Affected' - ); - } - - return ($closer + 1); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php deleted file mode 100644 index b9d4b7b0..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/ForbiddenEmptyListAssignmentSniff.php +++ /dev/null @@ -1,116 +0,0 @@ -ignoreTokens = Tokens::$emptyTokens; - $this->ignoreTokens[\T_COMMA] = \T_COMMA; - $this->ignoreTokens[\T_OPEN_PARENTHESIS] = \T_OPEN_PARENTHESIS; - $this->ignoreTokens[\T_CLOSE_PARENTHESIS] = \T_CLOSE_PARENTHESIS; - - return array( - \T_LIST, - \T_OPEN_SHORT_ARRAY, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY) { - if ($this->isShortList($phpcsFile, $stackPtr) === false) { - return; - } - - $open = $stackPtr; - $close = $tokens[$stackPtr]['bracket_closer']; - } else { - // T_LIST. - $open = $phpcsFile->findNext(\T_OPEN_PARENTHESIS, $stackPtr, null, false, null, true); - if ($open === false || isset($tokens[$open]['parenthesis_closer']) === false) { - return; - } - - $close = $tokens[$open]['parenthesis_closer']; - } - - $error = true; - if (($close - $open) > 1) { - for ($cnt = $open + 1; $cnt < $close; $cnt++) { - if (isset($this->ignoreTokens[$tokens[$cnt]['code']]) === false) { - $error = false; - break; - } - } - } - - if ($error === true) { - $phpcsFile->addError( - 'Empty list() assignments are not allowed since PHP 7.0', - $stackPtr, - 'Found' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php deleted file mode 100644 index 7111b125..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewKeyedListSniff.php +++ /dev/null @@ -1,227 +0,0 @@ - \T_LIST, - \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, - ); - - /** - * The token(s) within the list construct which is being targeted. - * - * @since 9.0.0 - * - * @var array - */ - protected $targetsInList = array( - \T_DOUBLE_ARROW => \T_DOUBLE_ARROW, - ); - - /** - * All tokens needed to walk through the list construct and - * determine whether the target token is contained within. - * - * Set by the setUpAllTargets() method which is called from within register(). - * - * @since 9.0.0 - * - * @var array - */ - protected $allTargets; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.0.0 - * - * @return array - */ - public function register() - { - $this->setUpAllTargets(); - - return $this->sniffTargets; - } - - /** - * Prepare the $allTargets array only once. - * - * @since 9.0.0 - * - * @return void - */ - public function setUpAllTargets() - { - $this->allTargets = $this->sniffTargets + $this->targetsInList; - } - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('7.0') === false); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->bowOutEarly() === true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === \T_OPEN_SHORT_ARRAY - && $this->isShortList($phpcsFile, $stackPtr) === false - ) { - // Short array, not short list. - return; - } - - if ($tokens[$stackPtr]['code'] === \T_LIST) { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false - || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS - || isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false - ) { - // Parse error or live coding. - return; - } - - $opener = $nextNonEmpty; - $closer = $tokens[$nextNonEmpty]['parenthesis_closer']; - } else { - // Short list syntax. - $opener = $stackPtr; - - if (isset($tokens[$stackPtr]['bracket_closer'])) { - $closer = $tokens[$stackPtr]['bracket_closer']; - } - } - - if (isset($opener, $closer) === false) { - return; - } - - $this->examineList($phpcsFile, $opener, $closer); - } - - - /** - * Examine the contents of a list construct to determine whether an error needs to be thrown. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $opener The position of the list open token. - * @param int $closer The position of the list close token. - * - * @return void - */ - protected function examineList(File $phpcsFile, $opener, $closer) - { - $start = $opener; - while (($start = $this->hasTargetInList($phpcsFile, $start, $closer)) !== false) { - $phpcsFile->addError( - 'Specifying keys in list constructs is not supported in PHP 7.0 or earlier.', - $start, - 'Found' - ); - } - } - - - /** - * Check whether a certain target token exists within a list construct. - * - * Skips past nested list constructs, so these can be examined based on their own token. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $start The position of the list open token or a token - * within the list to start (resume) the examination from. - * @param int $closer The position of the list close token. - * - * @return int|bool Stack pointer to the target token if encountered. False otherwise. - */ - protected function hasTargetInList(File $phpcsFile, $start, $closer) - { - $tokens = $phpcsFile->getTokens(); - - for ($i = ($start + 1); $i < $closer; $i++) { - if (isset($this->allTargets[$tokens[$i]['code']]) === false) { - continue; - } - - if (isset($this->targetsInList[$tokens[$i]['code']]) === true) { - return $i; - } - - // Skip past nested list constructs. - if ($tokens[$i]['code'] === \T_LIST) { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - if ($nextNonEmpty !== false - && $tokens[$nextNonEmpty]['code'] === \T_OPEN_PARENTHESIS - && isset($tokens[$nextNonEmpty]['parenthesis_closer']) === true - ) { - $i = $tokens[$nextNonEmpty]['parenthesis_closer']; - } - } elseif ($tokens[$i]['code'] === \T_OPEN_SHORT_ARRAY - && isset($tokens[$i]['bracket_closer']) - ) { - $i = $tokens[$i]['bracket_closer']; - } - } - - return false; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php deleted file mode 100644 index ebcd7c8e..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewListReferenceAssignmentSniff.php +++ /dev/null @@ -1,74 +0,0 @@ - \T_BITWISE_AND, - ); - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('7.2') === false); - } - - /** - * Examine the contents of a list construct to determine whether an error needs to be thrown. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $opener The position of the list open token. - * @param int $closer The position of the list close token. - * - * @return void - */ - protected function examineList(File $phpcsFile, $opener, $closer) - { - $start = $opener; - while (($start = $this->hasTargetInList($phpcsFile, $start, $closer)) !== false) { - $phpcsFile->addError( - 'Reference assignments within list constructs are not supported in PHP 7.2 or earlier.', - $start, - 'Found' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php deleted file mode 100644 index ee100fbe..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Lists/NewShortListSniff.php +++ /dev/null @@ -1,84 +0,0 @@ -supportsBelow('7.0') === false) { - return; - } - - if ($this->isShortList($phpcsFile, $stackPtr) === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $closer = $tokens[$stackPtr]['bracket_closer']; - - $hasVariable = $phpcsFile->findNext(\T_VARIABLE, ($stackPtr + 1), $closer); - if ($hasVariable === false) { - // List syntax is only valid if there are variables in it. - return; - } - - $phpcsFile->addError( - 'The shorthand list syntax "[]" to destructure arrays is not available in PHP 7.0 or earlier.', - $stackPtr, - 'Found' - ); - - return ($closer + 1); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php deleted file mode 100644 index d580bac7..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/ForbiddenToStringParametersSniff.php +++ /dev/null @@ -1,103 +0,0 @@ -supportsAbove('5.3') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { - /* - * Not a method call. - * - * Note: This disregards method calls with the method name in a variable, like: - * $method = '__toString'; - * $obj->$method(); - * However, that would be very hard to examine reliably anyway. - */ - return; - } - - if (strtolower($tokens[$nextNonEmpty]['content']) !== '__tostring') { - // Not a call to the __toString() method. - return; - } - - $openParens = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true); - if ($openParens === false || $tokens[$openParens]['code'] !== \T_OPEN_PARENTHESIS) { - // Not a method call. - return; - } - - $closeParens = $phpcsFile->findNext(Tokens::$emptyTokens, ($openParens + 1), null, true); - if ($closeParens === false || $tokens[$closeParens]['code'] === \T_CLOSE_PARENTHESIS) { - // Not a method call. - return; - } - - // If we're still here, then this is a call to the __toString() magic method passing parameters. - $phpcsFile->addError( - 'The __toString() magic method will no longer accept passed arguments since PHP 5.3', - $stackPtr, - 'Passed' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php deleted file mode 100644 index 873ef1d2..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/MethodUse/NewDirectCallsToCloneSniff.php +++ /dev/null @@ -1,117 +0,0 @@ -__clone()` is now allowed. This was the only magic method - * that had a compile-time check preventing some calls to it, which doesn't make sense. - * If we allow all other magic methods to be called, there's no reason to forbid this one." - * - * PHP version 7.0 - * - * @link https://wiki.php.net/rfc/abstract_syntax_tree#directly_calling_clone_is_allowed - * @link https://www.php.net/manual/en/language.oop5.cloning.php - * - * @since 9.1.0 - */ -class NewDirectCallsToCloneSniff extends Sniff -{ - - /** - * Tokens which indicate class internal use. - * - * @since 9.3.2 - * - * @var array - */ - protected $classInternal = array( - \T_PARENT => true, - \T_SELF => true, - \T_STATIC => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.1.0 - * - * @return array - */ - public function register() - { - return array( - \T_DOUBLE_COLON, - \T_OBJECT_OPERATOR, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.1.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsBelow('5.6') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { - /* - * Not a method call. - * - * Note: This disregards method calls with the method name in a variable, like: - * $method = '__clone'; - * $obj->$method(); - * However, that would be very hard to examine reliably anyway. - */ - return; - } - - if (strtolower($tokens[$nextNonEmpty]['content']) !== '__clone') { - // Not a call to the __clone() method. - return; - } - - $nextNextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true); - if ($nextNextNonEmpty === false || $tokens[$nextNextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { - // Not a method call. - return; - } - - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prevNonEmpty === false || isset($this->classInternal[$tokens[$prevNonEmpty]['code']])) { - // Class internal call to __clone(). - return; - } - - $phpcsFile->addError( - 'Direct calls to the __clone() magic method are not allowed in PHP 5.6 or earlier.', - $nextNonEmpty, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php deleted file mode 100644 index 85e10bcf..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/NewPHPOpenTagEOFSniff.php +++ /dev/null @@ -1,147 +0,0 @@ - ` interpreted as an opening PHP tag. Previously it was interpreted either as - * > ` interpreted as a literal `shortOpenTags = (bool) ini_get('short_open_tag'); - if ($this->shortOpenTags === false) { - $targets[] = \T_INLINE_HTML; - } else { - $targets[] = \T_STRING; - } - - if (version_compare(\PHP_VERSION_ID, '70399', '>')) { - $targets[] = \T_OPEN_TAG; - } - - return $targets; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsBelow('7.3') === false) { - return; - } - - if ($stackPtr !== ($phpcsFile->numTokens - 1)) { - // We're only interested in the last token in the file. - return; - } - - $tokens = $phpcsFile->getTokens(); - $contents = $tokens[$stackPtr]['content']; - $error = false; - - switch ($tokens[$stackPtr]['code']) { - case \T_INLINE_HTML: - // PHP < 7.4 with short open tags off. - if ($contents === 'addError( - 'A PHP open tag at the end of a file, without trailing newline, was not supported in PHP 7.3 or earlier and would result in a syntax error or be interpreted as a literal string', - $stackPtr, - 'Found' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php deleted file mode 100644 index 47143a3d..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php +++ /dev/null @@ -1,172 +0,0 @@ -aspTags = (bool) ini_get('asp_tags'); - } - - return array( - \T_OPEN_TAG, - \T_OPEN_TAG_WITH_ECHO, - \T_INLINE_HTML, - ); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.4 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $openTag = $tokens[$stackPtr]; - $content = trim($openTag['content']); - - if ($content === '' || $content === ']+)?language=[\'"]?php[\'"]?(?:[^>]+)?>)`i', $content, $match) === 1 - ) { - $found = $match[1]; - $data = array( - 'Script', - $found, - ); - $errorCode = 'ScriptOpenTagFound'; - } - - if (isset($errorCode, $data)) { - $phpcsFile->addError( - '%s style opening tags have been removed in PHP 7.0. Found "%s"', - $stackPtr, - $errorCode, - $data - ); - return; - } - - // If we're still here, we can't be sure if what we found was really intended as ASP open tags. - if ($openTag['code'] === \T_INLINE_HTML && $this->aspTags === false) { - if (strpos($content, '<%') !== false) { - $error = 'Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found: %s'; - $snippet = $this->getSnippet($content, '<%'); - $data = array('<%' . $snippet); - - $phpcsFile->addWarning($error, $stackPtr, 'MaybeASPOpenTagFound', $data); - } - } - } - - - /** - * Get a snippet from a HTML token. - * - * @since 7.0.4 - * - * @param string $content The content of the HTML token. - * @param string $startAt Partial string to use as a starting point for the snippet. - * @param int $length The target length of the snippet to get. Defaults to 25. - * - * @return string - */ - protected function getSnippet($content, $startAt = '', $length = 25) - { - $startPos = 0; - - if ($startAt !== '') { - $startPos = strpos($content, $startAt); - if ($startPos !== false) { - $startPos += \strlen($startAt); - } - } - - $snippet = substr($content, $startPos, $length); - if ((\strlen($content) - $startPos) > $length) { - $snippet .= '...'; - } - - return $snippet; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/ValidIntegersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/ValidIntegersSniff.php deleted file mode 100644 index 53dce438..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/ValidIntegersSniff.php +++ /dev/null @@ -1,250 +0,0 @@ -isLowPHPVersion = version_compare(\PHP_VERSION_ID, '50400', '<'); - - return array( - \T_LNUMBER, // Binary, octal integers. - \T_CONSTANT_ENCAPSED_STRING, // Hex numeric string. - ); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - if ($this->couldBeBinaryInteger($tokens, $stackPtr) === true) { - if ($this->supportsBelow('5.3')) { - $error = 'Binary integer literals were not present in PHP version 5.3 or earlier. Found: %s'; - if ($this->isLowPHPVersion === false) { - $data = array($token['content']); - } else { - $data = array($this->getBinaryInteger($phpcsFile, $tokens, $stackPtr)); - } - $phpcsFile->addError($error, $stackPtr, 'BinaryIntegerFound', $data); - } - - if ($this->isInvalidBinaryInteger($tokens, $stackPtr) === true) { - $error = 'Invalid binary integer detected. Found: %s'; - $data = array($this->getBinaryInteger($phpcsFile, $tokens, $stackPtr)); - $phpcsFile->addWarning($error, $stackPtr, 'InvalidBinaryIntegerFound', $data); - } - return; - } - - $isError = $this->supportsAbove('7.0'); - $data = array( $token['content'] ); - - if ($this->isInvalidOctalInteger($tokens, $stackPtr) === true) { - $this->addMessage( - $phpcsFile, - 'Invalid octal integer detected. Prior to PHP 7 this would lead to a truncated number. From PHP 7 onwards this causes a parse error. Found: %s', - $stackPtr, - $isError, - 'InvalidOctalIntegerFound', - $data - ); - return; - } - - if ($this->isHexidecimalNumericString($tokens, $stackPtr) === true) { - $this->addMessage( - $phpcsFile, - 'The behaviour of hexadecimal numeric strings was inconsistent prior to PHP 7 and support has been removed in PHP 7. Found: %s', - $stackPtr, - $isError, - 'HexNumericStringFound', - $data - ); - return; - } - } - - - /** - * Could the current token potentially be a binary integer ? - * - * @since 7.0.3 - * - * @param array $tokens Token stack. - * @param int $stackPtr The current position in the token stack. - * - * @return bool - */ - private function couldBeBinaryInteger($tokens, $stackPtr) - { - $token = $tokens[$stackPtr]; - - if ($token['code'] !== \T_LNUMBER) { - return false; - } - - if ($this->isLowPHPVersion === false) { - return (preg_match('`^0b[0-1]+$`iD', $token['content']) === 1); - } - // Pre-5.4, binary strings are tokenized as T_LNUMBER (0) + T_STRING ("b01010101"). - // At this point, we don't yet care whether it's a valid binary int, that's a separate check. - else { - return($token['content'] === '0' && $tokens[$stackPtr + 1]['code'] === \T_STRING && preg_match('`^b[0-9]+$`iD', $tokens[$stackPtr + 1]['content']) === 1); - } - } - - /** - * Is the current token an invalid binary integer ? - * - * @since 7.0.3 - * - * @param array $tokens Token stack. - * @param int $stackPtr The current position in the token stack. - * - * @return bool - */ - private function isInvalidBinaryInteger($tokens, $stackPtr) - { - if ($this->couldBeBinaryInteger($tokens, $stackPtr) === false) { - return false; - } - - if ($this->isLowPHPVersion === false) { - // If it's an invalid binary int, the token will be split into two T_LNUMBER tokens. - return ($tokens[$stackPtr + 1]['code'] === \T_LNUMBER); - } else { - return (preg_match('`^b[0-1]+$`iD', $tokens[$stackPtr + 1]['content']) === 0); - } - } - - /** - * Retrieve the content of the tokens which together look like a binary integer. - * - * @since 7.0.3 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param array $tokens Token stack. - * @param int $stackPtr The position of the current token in - * the stack. - * - * @return string - */ - private function getBinaryInteger(File $phpcsFile, $tokens, $stackPtr) - { - $length = 2; // PHP < 5.4 T_LNUMBER + T_STRING. - - if ($this->isLowPHPVersion === false) { - $i = $stackPtr; - while ($tokens[$i]['code'] === \T_LNUMBER) { - $i++; - } - $length = ($i - $stackPtr); - } - - return $phpcsFile->getTokensAsString($stackPtr, $length); - } - - /** - * Is the current token an invalid octal integer ? - * - * @since 7.0.3 - * - * @param array $tokens Token stack. - * @param int $stackPtr The current position in the token stack. - * - * @return bool - */ - private function isInvalidOctalInteger($tokens, $stackPtr) - { - $token = $tokens[$stackPtr]; - - if ($token['code'] === \T_LNUMBER && preg_match('`^0[0-7]*[8-9]+[0-9]*$`D', $token['content']) === 1) { - return true; - } - - return false; - } - - /** - * Is the current token a hexidecimal numeric string ? - * - * @since 7.0.3 - * - * @param array $tokens Token stack. - * @param int $stackPtr The current position in the token stack. - * - * @return bool - */ - private function isHexidecimalNumericString($tokens, $stackPtr) - { - $token = $tokens[$stackPtr]; - - if ($token['code'] === \T_CONSTANT_ENCAPSED_STRING && preg_match('`^0x[a-f0-9]+$`iD', $this->stripQuotes($token['content'])) === 1) { - return true; - } - - return false; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php deleted file mode 100644 index 3dfe738c..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ChangedConcatOperatorPrecedenceSniff.php +++ /dev/null @@ -1,199 +0,0 @@ ->` operators. - * - * As of PHP 7.4, a deprecation warning will be thrown upon encountering an - * unparenthesized expression containing an `.` before a `+` or `-`. - * - * PHP version 7.4 - * PHP version 8.0 - * - * @link https://wiki.php.net/rfc/concatenation_precedence - * @link https://www.php.net/manual/en/language.operators.precedence.php - * - * @since 9.2.0 - */ -class ChangedConcatOperatorPrecedenceSniff extends Sniff -{ - - /** - * List of tokens with a lower operator precedence than concatenation in PHP >= 8.0. - * - * @since 9.2.0 - * - * @var array - */ - private $tokensWithLowerPrecedence = array( - 'T_BITWISE_AND' => true, - 'T_BITWISE_XOR' => true, - 'T_BITWISE_OR' => true, - 'T_COALESCE' => true, - 'T_INLINE_THEN' => true, - 'T_INLINE_ELSE' => true, - 'T_YIELD_FROM' => true, - 'T_YIELD' => true, - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.2.0 - * - * @return array - */ - public function register() - { - return array( - \T_PLUS, - \T_MINUS, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.4') === false) { - return; - } - - if ($this->isUnaryPlusMinus($phpcsFile, $stackPtr) === true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - for ($i = ($stackPtr - 1); $stackPtr >= 0; $i--) { - if ($tokens[$i]['code'] === \T_STRING_CONCAT) { - // Found one. - break; - } - - if ($tokens[$i]['code'] === \T_SEMICOLON - || $tokens[$i]['code'] === \T_OPEN_CURLY_BRACKET - || $tokens[$i]['code'] === \T_OPEN_TAG - || $tokens[$i]['code'] === \T_OPEN_TAG_WITH_ECHO - || $tokens[$i]['code'] === \T_COMMA - || $tokens[$i]['code'] === \T_COLON - || $tokens[$i]['code'] === \T_CASE - ) { - // If we reached any of the above tokens, we've reached the end of - // the statement without encountering a concatenation operator. - return; - } - - if ($tokens[$i]['code'] === \T_OPEN_CURLY_BRACKET - && isset($tokens[$i]['bracket_closer']) - && $tokens[$i]['bracket_closer'] > $stackPtr - ) { - // No need to look any further, this is plus/minus within curly braces - // and we've reached the open curly. - return; - } - - if ($tokens[$i]['code'] === \T_OPEN_PARENTHESIS - && isset($tokens[$i]['parenthesis_closer']) - && $tokens[$i]['parenthesis_closer'] > $stackPtr - ) { - // No need to look any further, this is plus/minus within parenthesis - // and we've reached the open parenthesis. - return; - } - - if (($tokens[$i]['code'] === \T_OPEN_SHORT_ARRAY - || $tokens[$i]['code'] === \T_OPEN_SQUARE_BRACKET) - && isset($tokens[$i]['bracket_closer']) - && $tokens[$i]['bracket_closer'] > $stackPtr - ) { - // No need to look any further, this is plus/minus within a short array - // or array key square brackets and we've reached the opener. - return; - } - - if ($tokens[$i]['code'] === \T_CLOSE_CURLY_BRACKET) { - if (isset($tokens[$i]['scope_owner'])) { - // Different scope, we've passed the start of the statement. - return; - } - - if (isset($tokens[$i]['bracket_opener'])) { - $i = $tokens[$i]['bracket_opener']; - } - - continue; - } - - if ($tokens[$i]['code'] === \T_CLOSE_PARENTHESIS - && isset($tokens[$i]['parenthesis_opener']) - ) { - // Skip over statements in parenthesis, including long arrays. - $i = $tokens[$i]['parenthesis_opener']; - continue; - } - - if (($tokens[$i]['code'] === \T_CLOSE_SQUARE_BRACKET - || $tokens[$i]['code'] === \T_CLOSE_SHORT_ARRAY) - && isset($tokens[$i]['bracket_opener']) - ) { - // Skip over array keys and short arrays. - $i = $tokens[$i]['bracket_opener']; - continue; - } - - // Check for chain being broken by a token with a lower precedence. - if (isset(Tokens::$booleanOperators[$tokens[$i]['code']]) === true - || isset(Tokens::$assignmentTokens[$tokens[$i]['code']]) === true - ) { - return; - } - - if (isset($this->tokensWithLowerPrecedence[$tokens[$i]['type']]) === true) { - if ($tokens[$i]['code'] === \T_BITWISE_AND - && $phpcsFile->isReference($i) === true - ) { - continue; - } - - return; - } - } - - $message = 'Using an unparenthesized expression containing a "." before a "+" or "-" has been deprecated in PHP 7.4'; - $isError = false; - if ($this->supportsAbove('8.0') === true) { - $message .= ' and removed in PHP 8.0'; - $isError = true; - } - - $this->addMessage($phpcsFile, $message, $i, $isError); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php deleted file mode 100644 index 740e7dfd..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/ForbiddenNegativeBitshiftSniff.php +++ /dev/null @@ -1,109 +0,0 @@ - true, - \T_COMMA => true, - \T_DOUBLE_ARROW => true, - \T_SEMICOLON => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.0 - * @since 8.2.0 Now registers all bitshift tokens, not just bitshift right (`T_SR`). - * - * @return array - */ - public function register() - { - return array( - \T_SL, - \T_SL_EQUAL, - \T_SR, - \T_SR_EQUAL, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - // Determine the start and end of the part of the statement we need to examine. - $start = ($stackPtr + 1); - $next = $phpcsFile->findNext(Tokens::$emptyTokens, $start, null, true); - if ($next !== false && $tokens[$next]['code'] === \T_OPEN_PARENTHESIS) { - $start = ($next + 1); - } - - $end = PHPCSHelper::findEndOfStatement($phpcsFile, $start); - if (isset($this->inclusiveStopPoints[$tokens[$end]['code']]) === true) { - --$end; - } - - if ($this->isNegativeNumber($phpcsFile, $start, $end, true) !== true) { - // Not a negative number or undetermined. - return; - } - - $phpcsFile->addError( - 'Bitwise shifts by negative number will throw an ArithmeticError in PHP 7.0. Found: %s', - $stackPtr, - 'Found', - array($phpcsFile->getTokensAsString($start, ($end - $start + 1))) - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php deleted file mode 100644 index 7c50ad86..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewOperatorsSniff.php +++ /dev/null @@ -1,317 +0,0 @@ - array(string => bool|string)) - */ - protected $newOperators = array( - 'T_POW' => array( - '5.5' => false, - '5.6' => true, - 'description' => 'power operator (**)', - ), // Identified in PHP < 5.6 icw PHPCS < 2.4.0 as T_MULTIPLY + T_MULTIPLY. - 'T_POW_EQUAL' => array( - '5.5' => false, - '5.6' => true, - 'description' => 'power assignment operator (**=)', - ), // Identified in PHP < 5.6 icw PHPCS < 2.6.0 as T_MULTIPLY + T_MUL_EQUAL. - 'T_SPACESHIP' => array( - '5.6' => false, - '7.0' => true, - 'description' => 'spaceship operator (<=>)', - ), // Identified in PHP < 7.0 icw PHPCS < 2.5.1 as T_IS_SMALLER_OR_EQUAL + T_GREATER_THAN. - 'T_COALESCE' => array( - '5.6' => false, - '7.0' => true, - 'description' => 'null coalescing operator (??)', - ), // Identified in PHP < 7.0 icw PHPCS < 2.6.2 as T_INLINE_THEN + T_INLINE_THEN. - 'T_COALESCE_EQUAL' => array( - '7.3' => false, - '7.4' => true, - 'description' => 'null coalesce equal operator (??=)', - ), // Identified in PHP < 7.0 icw PHPCS < 2.6.2 as T_INLINE_THEN + T_INLINE_THEN + T_EQUAL and between PHPCS 2.6.2 and PHPCS 2.8.1 as T_COALESCE + T_EQUAL. - ); - - - /** - * A list of new operators which are not recognized in older PHPCS versions. - * - * The array lists an alternative token to listen for. - * - * @since 7.0.3 - * - * @var array(string => int) - */ - protected $newOperatorsPHPCSCompat = array( - 'T_POW' => \T_MULTIPLY, - 'T_POW_EQUAL' => \T_MUL_EQUAL, - 'T_SPACESHIP' => \T_GREATER_THAN, - 'T_COALESCE' => \T_INLINE_THEN, - 'T_COALESCE_EQUAL' => \T_EQUAL, - ); - - /** - * Token translation table for older PHPCS versions. - * - * The 'before' index lists the token which would have to be directly before the - * token found for it to be one of the new operators. - * The 'real_token' index indicates which operator was found in that case. - * - * If the token combination has multi-layer complexity, such as is the case - * with T_COALESCE(_EQUAL), a 'callback' index is added instead pointing to a - * separate function which can determine whether this is the targetted token across - * PHP and PHPCS versions. - * - * {@internal 'before' was chosen rather than 'after' as that allowed for a 1-on-1 - * translation list with the current tokens.} - * - * @since 7.0.3 - * - * @var array(string => array(string => string)) - */ - protected $PHPCSCompatTranslate = array( - 'T_MULTIPLY' => array( - 'before' => 'T_MULTIPLY', - 'real_token' => 'T_POW', - ), - 'T_MUL_EQUAL' => array( - 'before' => 'T_MULTIPLY', - 'real_token' => 'T_POW_EQUAL', - ), - 'T_GREATER_THAN' => array( - 'before' => 'T_IS_SMALLER_OR_EQUAL', - 'real_token' => 'T_SPACESHIP', - ), - 'T_INLINE_THEN' => array( - 'callback' => 'isTCoalesce', - 'real_token' => 'T_COALESCE', - ), - 'T_EQUAL' => array( - 'callback' => 'isTCoalesceEqual', - 'real_token' => 'T_COALESCE_EQUAL', - ), - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.6 - * - * @return array - */ - public function register() - { - $tokens = array(); - foreach ($this->newOperators as $token => $versions) { - if (\defined($token)) { - $tokens[] = constant($token); - } elseif (isset($this->newOperatorsPHPCSCompat[$token])) { - $tokens[] = $this->newOperatorsPHPCSCompat[$token]; - } - } - return $tokens; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.6 - * - * @param \PHP_CodeSniffer_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(); - $tokenType = $tokens[$stackPtr]['type']; - - // Translate older PHPCS token combis for new operators to the actual operator. - if (isset($this->newOperators[$tokenType]) === false) { - if (isset($this->PHPCSCompatTranslate[$tokenType]) - && ((isset($this->PHPCSCompatTranslate[$tokenType]['before'], $tokens[$stackPtr - 1]) === true - && $tokens[$stackPtr - 1]['type'] === $this->PHPCSCompatTranslate[$tokenType]['before']) - || (isset($this->PHPCSCompatTranslate[$tokenType]['callback']) === true - && \call_user_func(array($this, $this->PHPCSCompatTranslate[$tokenType]['callback']), $tokens, $stackPtr) === true)) - ) { - $tokenType = $this->PHPCSCompatTranslate[$tokenType]['real_token']; - } - } elseif ($tokenType === 'T_COALESCE') { - // Make sure that T_COALESCE is not confused with T_COALESCE_EQUAL. - if (isset($tokens[($stackPtr + 1)]) !== false && $tokens[($stackPtr + 1)]['code'] === \T_EQUAL) { - // Ignore as will be dealt with via the T_EQUAL token. - return; - } - } - - // If the translation did not yield one of the tokens we are looking for, bow out. - if (isset($this->newOperators[$tokenType]) === false) { - return; - } - - $itemInfo = array( - 'name' => $tokenType, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newOperators[$itemInfo['name']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 7.1.0 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array('description'); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 7.1.0 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - $errorInfo['description'] = $itemArray['description']; - - return $errorInfo; - } - - - /** - * Filter the error data before it's passed to PHPCS. - * - * @since 7.1.0 - * - * @param array $data The error data array which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return array - */ - protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) - { - $data[0] = $errorInfo['description']; - return $data; - } - - - /** - * Callback function to determine whether a T_EQUAL token is really a T_COALESCE_EQUAL token. - * - * @since 7.1.2 - * - * @param array $tokens The token stack. - * @param int $stackPtr The current position in the token stack. - * - * @return bool - */ - private function isTCoalesceEqual($tokens, $stackPtr) - { - if ($tokens[$stackPtr]['code'] !== \T_EQUAL || isset($tokens[($stackPtr - 1)]) === false) { - // Function called for wrong token or token has no predecessor. - return false; - } - - if ($tokens[($stackPtr - 1)]['type'] === 'T_COALESCE') { - return true; - } - if ($tokens[($stackPtr - 1)]['type'] === 'T_INLINE_THEN' - && (isset($tokens[($stackPtr - 2)]) && $tokens[($stackPtr - 2)]['type'] === 'T_INLINE_THEN') - ) { - return true; - } - - return false; - } - - /** - * Callback function to determine whether a T_INLINE_THEN token is really a T_COALESCE token. - * - * @since 7.1.2 - * - * @param array $tokens The token stack. - * @param int $stackPtr The current position in the token stack. - * - * @return bool - */ - private function isTCoalesce($tokens, $stackPtr) - { - if ($tokens[$stackPtr]['code'] !== \T_INLINE_THEN || isset($tokens[($stackPtr - 1)]) === false) { - // Function called for wrong token or token has no predecessor. - return false; - } - - if ($tokens[($stackPtr - 1)]['code'] === \T_INLINE_THEN) { - // Make sure not to confuse it with the T_COALESCE_EQUAL token. - if (isset($tokens[($stackPtr + 1)]) === false || $tokens[($stackPtr + 1)]['code'] !== \T_EQUAL) { - return true; - } - } - - return false; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php deleted file mode 100644 index b65da597..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/NewShortTernarySniff.php +++ /dev/null @@ -1,73 +0,0 @@ -supportsBelow('5.2') === false) { - return; - } - - if ($this->isShortTernary($phpcsFile, $stackPtr) === false) { - return; - } - - $phpcsFile->addError( - 'Middle may not be omitted from ternary operators in PHP < 5.3', - $stackPtr, - 'MiddleMissing' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php deleted file mode 100644 index 21eca02b..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Operators/RemovedTernaryAssociativitySniff.php +++ /dev/null @@ -1,157 +0,0 @@ - true, - 'T_YIELD' => true, - 'T_LOGICAL_AND' => true, - 'T_LOGICAL_OR' => true, - 'T_LOGICAL_XOR' => true, - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.2.0 - * - * @return array - */ - public function register() - { - return array(\T_INLINE_THEN); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.4') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $endOfStatement = PHPCSHelper::findEndOfStatement($phpcsFile, $stackPtr); - if ($tokens[$endOfStatement]['code'] !== \T_SEMICOLON - && $tokens[$endOfStatement]['code'] !== \T_COLON - && $tokens[$endOfStatement]['code'] !== \T_COMMA - && $tokens[$endOfStatement]['code'] !== \T_DOUBLE_ARROW - && $tokens[$endOfStatement]['code'] !== \T_OPEN_TAG - && $tokens[$endOfStatement]['code'] !== \T_CLOSE_TAG - ) { - // End of statement is last non-empty before close brace, so make sure we examine that token too. - ++$endOfStatement; - } - - $ternaryCount = 0; - $elseCount = 0; - $shortTernaryCount = 0; - - // Start at $stackPtr so we don't need duplicate code for short ternary determination. - for ($i = $stackPtr; $i < $endOfStatement; $i++) { - if (($tokens[$i]['code'] === \T_OPEN_SHORT_ARRAY - || $tokens[$i]['code'] === \T_OPEN_SQUARE_BRACKET - || $tokens[$i]['code'] === \T_OPEN_CURLY_BRACKET) - && isset($tokens[$i]['bracket_closer']) - ) { - // Skip over short arrays, array access keys and curlies. - $i = $tokens[$i]['bracket_closer']; - continue; - } - - if ($tokens[$i]['code'] === \T_OPEN_PARENTHESIS - && isset($tokens[$i]['parenthesis_closer']) - ) { - // Skip over anything between parentheses. - $i = $tokens[$i]['parenthesis_closer']; - continue; - } - - // Check for operators with lower operator precedence. - if (isset(Tokens::$assignmentTokens[$tokens[$i]['code']]) - || isset($this->tokensWithLowerPrecedence[$tokens[$i]['code']]) - ) { - break; - } - - if ($tokens[$i]['code'] === \T_INLINE_THEN) { - ++$ternaryCount; - - if ($this->isShortTernary($phpcsFile, $i) === true) { - ++$shortTernaryCount; - } - - continue; - } - - if ($tokens[$i]['code'] === \T_INLINE_ELSE) { - if (($ternaryCount - $elseCount) >= 2) { - // This is the `else` for a ternary in the middle part of a previous ternary. - --$ternaryCount; - } else { - ++$elseCount; - } - continue; - } - } - - if ($ternaryCount > 1 && $ternaryCount === $elseCount && $ternaryCount > $shortTernaryCount) { - $message = 'The left-associativity of the ternary operator has been deprecated in PHP 7.4'; - $isError = false; - if ($this->supportsAbove('8.0') === true) { - $message .= ' and removed in PHP 8.0'; - $isError = true; - } - - $message .= '. Multiple consecutive ternaries detected. Use parenthesis to clarify the order in which the operations should be executed'; - - $this->addMessage($phpcsFile, $message, $stackPtr, $isError); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php deleted file mode 100644 index 30452a09..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenGetClassNullSniff.php +++ /dev/null @@ -1,84 +0,0 @@ - true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('7.2') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[1]) === false) { - return; - } - - if ($parameters[1]['raw'] !== 'null') { - return; - } - - $phpcsFile->addError( - 'Passing "null" as the $object to get_class() is not allowed since PHP 7.2.', - $parameters[1]['start'], - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php deleted file mode 100644 index 9ecae5c8..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/ForbiddenStripTagsSelfClosingXHTMLSniff.php +++ /dev/null @@ -1,113 +0,0 @@ - true, - ); - - /** - * Text string tokens to examine. - * - * @since 9.3.0 - * - * @var array - */ - private $textStringTokens = array( - \T_CONSTANT_ENCAPSED_STRING => true, - \T_DOUBLE_QUOTED_STRING => true, - \T_INLINE_HTML => true, - \T_HEREDOC => true, - \T_NOWDOC => true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.3.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('5.4') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[2]) === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $targetParam = $parameters[2]; - for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { - if ($tokens[$i]['code'] === \T_STRING - || $tokens[$i]['code'] === \T_VARIABLE - ) { - // Variable, constant, function call. Ignore as undetermined. - return; - } - - if (isset($this->textStringTokens[$tokens[$i]['code']]) === true - && strpos($tokens[$i]['content'], '/>') !== false - ) { - - $phpcsFile->addError( - 'Self-closing XHTML tags are ignored. Only non-self-closing tags should be used in the strip_tags() $allowable_tags parameter since PHP 5.3.4. Found: %s', - $i, - 'Found', - array($targetParam['raw']) - ); - - // Only throw one error per function call. - return; - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php deleted file mode 100644 index 8045ac8a..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewArrayReduceInitialTypeSniff.php +++ /dev/null @@ -1,116 +0,0 @@ - true, - ); - - /** - * Tokens which, for the purposes of this sniff, indicate that there is - * a variable element to the value passed. - * - * @since 9.0.0 - * - * @var array - */ - private $variableValueTokens = array( - \T_VARIABLE, - \T_STRING, - \T_SELF, - \T_PARENT, - \T_STATIC, - \T_DOUBLE_QUOTED_STRING, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('5.2') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[3]) === false) { - return; - } - - $targetParam = $parameters[3]; - if ($this->isNumber($phpcsFile, $targetParam['start'], $targetParam['end'], true) !== false) { - return; - } - - if ($this->isNumericCalculation($phpcsFile, $targetParam['start'], $targetParam['end']) === true) { - return; - } - - $error = 'Passing a non-integer as the value for $initial to array_reduce() is not supported in PHP 5.2 or lower.'; - if ($phpcsFile->findNext($this->variableValueTokens, $targetParam['start'], ($targetParam['end'] + 1)) === false) { - $phpcsFile->addError( - $error . ' Found %s', - $targetParam['start'], - 'InvalidTypeFound', - array($targetParam['raw']) - ); - } else { - $phpcsFile->addWarning( - $error . ' Variable value found. Found %s', - $targetParam['start'], - 'VariableFound', - array($targetParam['raw']) - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php deleted file mode 100644 index 83299822..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewFopenModesSniff.php +++ /dev/null @@ -1,119 +0,0 @@ - true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - // Version used here should be (above) the highest version from the `newModes` control, - // structure below, i.e. the last PHP version in which a new mode was introduced. - return ($this->supportsBelow('7.1') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[2]) === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $targetParam = $parameters[2]; - $errors = array(); - - for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { - if ($tokens[$i]['code'] !== \T_CONSTANT_ENCAPSED_STRING) { - continue; - } - - if (strpos($tokens[$i]['content'], 'c+') !== false && $this->supportsBelow('5.2.5')) { - $errors['cplusFound'] = array( - 'c+', - '5.2.5', - $targetParam['raw'], - ); - } elseif (strpos($tokens[$i]['content'], 'c') !== false && $this->supportsBelow('5.2.5')) { - $errors['cFound'] = array( - 'c', - '5.2.5', - $targetParam['raw'], - ); - } - - if (strpos($tokens[$i]['content'], 'e') !== false && $this->supportsBelow('7.0.15')) { - $errors['eFound'] = array( - 'e', - '7.0.15', - $targetParam['raw'], - ); - } - } - - if (empty($errors) === true) { - return; - } - - foreach ($errors as $errorCode => $errorData) { - $phpcsFile->addError( - 'Passing "%s" as the $mode to fopen() is not supported in PHP %s or lower. Found %s', - $targetParam['start'], - $errorCode, - $errorData - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php deleted file mode 100644 index 18895565..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHTMLEntitiesEncodingDefaultSniff.php +++ /dev/null @@ -1,92 +0,0 @@ - 3, - 'htmlentities' => 3, - 'htmlspecialchars' => 3, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * Note: This sniff should only trigger errors when both PHP 5.3 or lower, - * as well as PHP 5.4 or higher need to be supported within the application. - * - * @since 9.3.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('5.3') === false || $this->supportsAbove('5.4') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - $functionLC = strtolower($functionName); - if (isset($parameters[$this->targetFunctions[$functionLC]]) === true) { - return; - } - - $phpcsFile->addError( - 'The default value of the $encoding parameter for %s() was changed from ISO-8859-1 to UTF-8 in PHP 5.4. For cross-version compatibility, the $encoding parameter should be explicitly set.', - $stackPtr, - 'NotSet', - array($functionName) - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php deleted file mode 100644 index 297f84ec..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewHashAlgorithmsSniff.php +++ /dev/null @@ -1,185 +0,0 @@ - array(string => bool)) - */ - protected $newAlgorithms = array( - 'md2' => array( - '5.2' => false, - '5.3' => true, - ), - 'ripemd256' => array( - '5.2' => false, - '5.3' => true, - ), - 'ripemd320' => array( - '5.2' => false, - '5.3' => true, - ), - 'salsa10' => array( - '5.2' => false, - '5.3' => true, - ), - 'salsa20' => array( - '5.2' => false, - '5.3' => true, - ), - 'snefru256' => array( - '5.2' => false, - '5.3' => true, - ), - 'sha224' => array( - '5.2' => false, - '5.3' => true, - ), - 'joaat' => array( - '5.3' => false, - '5.4' => true, - ), - 'fnv132' => array( - '5.3' => false, - '5.4' => true, - ), - 'fnv164' => array( - '5.3' => false, - '5.4' => true, - ), - 'gost-crypto' => array( - '5.5' => false, - '5.6' => true, - ), - - 'sha512/224' => array( - '7.0' => false, - '7.1' => true, - ), - 'sha512/256' => array( - '7.0' => false, - '7.1' => true, - ), - 'sha3-224' => array( - '7.0' => false, - '7.1' => true, - ), - 'sha3-256' => array( - '7.0' => false, - '7.1' => true, - ), - 'sha3-384' => array( - '7.0' => false, - '7.1' => true, - ), - 'sha3-512' => array( - '7.0' => false, - '7.1' => true, - ), - 'crc32c' => array( - '7.3' => false, - '7.4' => true, - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.0.7 - * - * @return array - */ - public function register() - { - return array(\T_STRING); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.0.7 - * - * @param \PHP_CodeSniffer_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) - { - $algo = $this->getHashAlgorithmParameter($phpcsFile, $stackPtr); - if (empty($algo) || \is_string($algo) === false) { - return; - } - - // Bow out if not one of the algorithms we're targetting. - if (isset($this->newAlgorithms[$algo]) === false) { - return; - } - - // Check if the algorithm used is new. - $itemInfo = array( - 'name' => $algo, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newAlgorithms[$itemInfo['name']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The %s hash algorithm is not present in PHP version %s or earlier'; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php deleted file mode 100644 index 2c9748ca..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIDNVariantDefaultSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - 3, - 'idn_to_utf8' => 3, - ); - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * Note: This sniff should only trigger errors when both PHP 7.3 or lower, - * as well as PHP 7.4 or higher need to be supported within the application. - * - * @since 9.3.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('7.3') === false || $this->supportsAbove('7.4') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - $functionLC = strtolower($functionName); - if (isset($parameters[$this->targetFunctions[$functionLC]]) === true) { - return; - } - - $error = 'The default value of the %s() $variant parameter has changed from INTL_IDNA_VARIANT_2003 to INTL_IDNA_VARIANT_UTS46 in PHP 7.4. For optimal cross-version compatibility, the $variant parameter should be explicitly set.'; - $phpcsFile->addError( - $error, - $stackPtr, - 'NotSet', - array($functionName) - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php deleted file mode 100644 index 51cc894e..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewIconvMbstringCharsetDefaultSniff.php +++ /dev/null @@ -1,231 +0,0 @@ - 3, - 'iconv_mime_decode' => 3, - 'iconv_mime_encode' => 3, // Special case. - 'iconv_strlen' => 2, - 'iconv_strpos' => 4, - 'iconv_strrpos' => 3, - 'iconv_substr' => 4, - - 'mb_check_encoding' => 2, - 'mb_chr' => 2, - 'mb_convert_case' => 3, - 'mb_convert_encoding' => 3, - 'mb_convert_kana' => 3, - 'mb_decode_numericentity' => 3, - 'mb_encode_numericentity' => 3, - 'mb_ord' => 2, - 'mb_scrub' => 2, - 'mb_strcut' => 4, - 'mb_stripos' => 4, - 'mb_stristr' => 4, - 'mb_strlen' => 2, - 'mb_strpos' => 4, - 'mb_strrchr' => 4, - 'mb_strrichr' => 4, - 'mb_strripos' => 4, - 'mb_strrpos' => 4, - 'mb_strstr' => 4, - 'mb_strtolower' => 2, - 'mb_strtoupper' => 2, - 'mb_strwidth' => 2, - 'mb_substr_count' => 3, - 'mb_substr' => 4, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * Note: This sniff should only trigger errors when both PHP 5.5 or lower, - * as well as PHP 5.6 or higher need to be supported within the application. - * - * @since 9.3.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('5.5') === false || $this->supportsAbove('5.6') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - $functionLC = strtolower($functionName); - if ($functionLC === 'iconv_mime_encode') { - // Special case the iconv_mime_encode() function. - return $this->processIconvMimeEncode($phpcsFile, $stackPtr, $functionName, $parameters); - } - - if (isset($parameters[$this->targetFunctions[$functionLC]]) === true) { - return; - } - - $paramName = '$encoding'; - if (strpos($functionLC, 'iconv_') === 0) { - $paramName = '$charset'; - } elseif ($functionLC === 'mb_convert_encoding') { - $paramName = '$from_encoding'; - } - - $error = 'The default value of the %1$s parameter for %2$s() was changed from ISO-8859-1 to UTF-8 in PHP 5.6. For cross-version compatibility, the %1$s parameter should be explicitly set.'; - $data = array( - $paramName, - $functionName, - ); - - $phpcsFile->addError($error, $stackPtr, 'NotSet', $data); - } - - /** - * Process the parameters of a matched call to the iconv_mime_encode() function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processIconvMimeEncode(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - $error = 'The default value of the %s parameter index for iconv_mime_encode() was changed from ISO-8859-1 to UTF-8 in PHP 5.6. For cross-version compatibility, the %s should be explicitly set.'; - - $functionLC = strtolower($functionName); - if (isset($parameters[$this->targetFunctions[$functionLC]]) === false) { - $phpcsFile->addError( - $error, - $stackPtr, - 'PreferencesNotSet', - array( - '$preferences[\'input/output-charset\']', - '$preferences[\'input-charset\'] and $preferences[\'output-charset\'] indexes', - ) - ); - - return; - } - - $tokens = $phpcsFile->getTokens(); - $targetParam = $parameters[$this->targetFunctions[$functionLC]]; - $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $targetParam['start'], ($targetParam['end'] + 1), true); - if ($firstNonEmpty === false) { - // Parse error or live coding. - return; - } - - if ($tokens[$firstNonEmpty]['code'] === \T_ARRAY - || $tokens[$firstNonEmpty]['code'] === \T_OPEN_SHORT_ARRAY - ) { - $hasInputCharset = preg_match('`([\'"])input-charset\1\s*=>`', $targetParam['raw']); - $hasOutputCharset = preg_match('`([\'"])output-charset\1\s*=>`', $targetParam['raw']); - if ($hasInputCharset === 1 && $hasOutputCharset === 1) { - // Both input as well as output charset are set. - return; - } - - if ($hasInputCharset !== 1) { - $phpcsFile->addError( - $error, - $firstNonEmpty, - 'InputPreferenceNotSet', - array( - '$preferences[\'input-charset\']', - '$preferences[\'input-charset\'] index', - ) - ); - } - - if ($hasOutputCharset !== 1) { - $phpcsFile->addError( - $error, - $firstNonEmpty, - 'OutputPreferenceNotSet', - array( - '$preferences[\'output-charset\']', - '$preferences[\'output-charset\'] index', - ) - ); - } - - return; - } - - // The $preferences parameter was passed, but it was a variable/constant/output of a function call. - $phpcsFile->addWarning( - $error, - $firstNonEmpty, - 'Undetermined', - array( - '$preferences[\'input/output-charset\']', - '$preferences[\'input-charset\'] and $preferences[\'output-charset\'] indexes', - ) - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php deleted file mode 100644 index f2aea60e..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewNegativeStringOffsetSniff.php +++ /dev/null @@ -1,129 +0,0 @@ - 1-based parameter offset of the affected parameters => parameter name. - */ - protected $targetFunctions = array( - 'file_get_contents' => array( - 4 => 'offset', - ), - 'grapheme_extract' => array( - 4 => 'start', - ), - 'grapheme_stripos' => array( - 3 => 'offset', - ), - 'grapheme_strpos' => array( - 3 => 'offset', - ), - 'iconv_strpos' => array( - 3 => 'offset', - ), - 'mb_ereg_search_setpos' => array( - 1 => 'position', - ), - 'mb_strimwidth' => array( - 2 => 'start', - 3 => 'width', - ), - 'mb_stripos' => array( - 3 => 'offset', - ), - 'mb_strpos' => array( - 3 => 'offset', - ), - 'stripos' => array( - 3 => 'offset', - ), - 'strpos' => array( - 3 => 'offset', - ), - 'substr_count' => array( - 3 => 'offset', - 4 => 'length', - ), - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('7.0') === false); - } - - /** - * Process the parameters of a matched function. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - $functionLC = strtolower($functionName); - foreach ($this->targetFunctions[$functionLC] as $pos => $name) { - if (isset($parameters[$pos]) === false) { - continue; - } - - $targetParam = $parameters[$pos]; - - if ($this->isNegativeNumber($phpcsFile, $targetParam['start'], $targetParam['end']) === false) { - continue; - } - - $phpcsFile->addError( - 'Negative string offsets were not supported for the $%s parameter in %s() in PHP 7.0 or lower. Found %s', - $targetParam['start'], - 'Found', - array( - $name, - $functionName, - $targetParam['raw'], - ) - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php deleted file mode 100644 index 65339e50..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPCREModifiersSniff.php +++ /dev/null @@ -1,127 +0,0 @@ - true, - 'preg_grep' => true, - 'preg_match_all' => true, - 'preg_match' => true, - 'preg_replace_callback_array' => true, - 'preg_replace_callback' => true, - 'preg_replace' => true, - 'preg_split' => true, - ); - - /** - * Array listing newly introduced regex modifiers. - * - * The key should be the modifier (case-sensitive!). - * The value should be the PHP version in which the modifier was introduced. - * - * @since 8.2.0 - * - * @var array - */ - protected $newModifiers = array( - 'J' => array( - '7.1' => false, - '7.2' => true, - ), - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 8.2.0 - * - * @return bool - */ - protected function bowOutEarly() - { - // Version used here should be the highest version from the `$newModifiers` array, - // i.e. the last PHP version in which a new modifier was introduced. - return ($this->supportsBelow('7.2') === false); - } - - - /** - * Examine the regex modifier string. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param string $functionName The function which contained the pattern. - * @param string $modifiers The regex modifiers found. - * - * @return void - */ - protected function examineModifiers(File $phpcsFile, $stackPtr, $functionName, $modifiers) - { - $error = 'The PCRE regex modifier "%s" is not present in PHP version %s or earlier'; - - foreach ($this->newModifiers as $modifier => $versionArray) { - if (strpos($modifiers, $modifier) === false) { - continue; - } - - $notInVersion = ''; - foreach ($versionArray as $version => $present) { - if ($notInVersion === '' && $present === false - && $this->supportsBelow($version) === true - ) { - $notInVersion = $version; - } - } - - if ($notInVersion === '') { - continue; - } - - $errorCode = $modifier . 'ModifierFound'; - $data = array( - $modifier, - $notInVersion, - ); - - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php deleted file mode 100644 index 7e42f3e9..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPackFormatSniff.php +++ /dev/null @@ -1,132 +0,0 @@ - true, - ); - - /** - * List of new format character codes added to pack(). - * - * @since 9.0.0 - * - * @var array Regex pattern => Version array. - */ - protected $newFormats = array( - '`([Z])`' => array( - '5.4' => false, - '5.5' => true, - ), - '`([qQJP])`' => array( - '5.6.2' => false, - '5.6.3' => true, - ), - '`([eEgG])`' => array( - '7.0.14' => false, - '7.0.15' => true, // And 7.1.1. - ), - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsBelow('7.1') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[1]) === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $targetParam = $parameters[1]; - - for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { - if ($tokens[$i]['code'] !== \T_CONSTANT_ENCAPSED_STRING - && $tokens[$i]['code'] !== \T_DOUBLE_QUOTED_STRING - ) { - continue; - } - - $content = $tokens[$i]['content']; - if ($tokens[$i]['code'] === \T_DOUBLE_QUOTED_STRING) { - $content = $this->stripVariables($content); - } - - foreach ($this->newFormats as $pattern => $versionArray) { - if (preg_match($pattern, $content, $matches) !== 1) { - continue; - } - - foreach ($versionArray as $version => $present) { - if ($present === false && $this->supportsBelow($version) === true) { - $phpcsFile->addError( - 'Passing the $format(s) "%s" to pack() is not supported in PHP %s or lower. Found %s', - $targetParam['start'], - 'NewFormatFound', - array( - $matches[1], - $version, - $targetParam['raw'], - ) - ); - continue 2; - } - } - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php deleted file mode 100644 index 94a1360d..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewPasswordAlgoConstantValuesSniff.php +++ /dev/null @@ -1,125 +0,0 @@ - 2, - 'password_needs_rehash' => 2, - ); - - /** - * Tokens types which indicate that the parameter passed is not the PHP native constant. - * - * @since 9.3.0 - * - * @var array - */ - private $invalidTokenTypes = array( - \T_NULL => true, - \T_TRUE => true, - \T_FALSE => true, - \T_LNUMBER => true, - \T_DNUMBER => true, - \T_CONSTANT_ENCAPSED_STRING => true, - \T_DOUBLE_QUOTED_STRING => true, - \T_HEREDOC => true, - \T_NOWDOC => true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.3.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('7.4') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - $functionLC = strtolower($functionName); - if (isset($parameters[$this->targetFunctions[$functionLC]]) === false) { - return; - } - - $targetParam = $parameters[$this->targetFunctions[$functionLC]]; - $tokens = $phpcsFile->getTokens(); - - for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - if (isset($this->invalidTokenTypes[$tokens[$i]['code']]) === true) { - $phpcsFile->addWarning( - 'The value of the password hash algorithm constants has changed in PHP 7.4. Pass a PHP native constant to the %s() function instead of using the value of the constant. Found: %s', - $stackPtr, - 'NotAlgoConstant', - array( - $functionName, - $targetParam['raw'], - ) - ); - - break; - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php deleted file mode 100644 index 4e9f1500..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewProcOpenCmdArraySniff.php +++ /dev/null @@ -1,136 +0,0 @@ - true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.3.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return false; - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[1]) === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $targetParam = $parameters[1]; - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $targetParam['start'], $targetParam['end'], true); - - if ($nextNonEmpty === false) { - // Shouldn't be possible. - return; - } - - if ($tokens[$nextNonEmpty]['code'] !== \T_ARRAY - && $tokens[$nextNonEmpty]['code'] !== \T_OPEN_SHORT_ARRAY - ) { - // Not passed as an array. - return; - } - - if ($this->supportsBelow('7.3') === true) { - $phpcsFile->addError( - 'The proc_open() function did not accept $cmd to be passed in array format in PHP 7.3 and earlier.', - $nextNonEmpty, - 'Found' - ); - } - - if ($this->supportsAbove('7.4') === true) { - if (strpos($targetParam['raw'], 'escapeshellarg(') === false) { - // Efficiency: prevent needlessly walking the array. - return; - } - - $items = $this->getFunctionCallParameters($phpcsFile, $nextNonEmpty); - - if (empty($items)) { - return; - } - - foreach ($items as $item) { - for ($i = $item['start']; $i <= $item['end']; $i++) { - if ($tokens[$i]['code'] !== \T_STRING - || $tokens[$i]['content'] !== 'escapeshellarg' - ) { - continue; - } - - // @todo Potential future enhancement: check if it's a call to the PHP native function. - - $phpcsFile->addWarning( - 'When passing proc_open() the $cmd parameter as an array, PHP will take care of any necessary argument escaping. Found: %s', - $i, - 'Invalid', - array($item['raw']) - ); - - // Only throw one error per array item. - break; - } - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php deleted file mode 100644 index 9d9ede05..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/NewStripTagsAllowableTagsArraySniff.php +++ /dev/null @@ -1,152 +0,0 @@ - true, - ); - - /** - * Text string tokens to examine. - * - * @since 9.3.0 - * - * @var array - */ - private $textStringTokens = array( - \T_CONSTANT_ENCAPSED_STRING => true, - \T_DOUBLE_QUOTED_STRING => true, - \T_INLINE_HTML => true, - \T_HEREDOC => true, - \T_NOWDOC => true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.3.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return false; - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[2]) === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $targetParam = $parameters[2]; - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $targetParam['start'], $targetParam['end'], true); - - if ($nextNonEmpty === false) { - // Shouldn't be possible. - return; - } - - if ($tokens[$nextNonEmpty]['code'] !== \T_ARRAY - && $tokens[$nextNonEmpty]['code'] !== \T_OPEN_SHORT_ARRAY - ) { - // Not passed as a hard-coded array. - return; - } - - if ($this->supportsBelow('7.3') === true) { - $phpcsFile->addError( - 'The strip_tags() function did not accept $allowable_tags to be passed in array format in PHP 7.3 and earlier.', - $nextNonEmpty, - 'Found' - ); - } - - if ($this->supportsAbove('7.4') === true) { - if (strpos($targetParam['raw'], '>') === false) { - // Efficiency: prevent needlessly walking the array. - return; - } - - $items = $this->getFunctionCallParameters($phpcsFile, $nextNonEmpty); - - if (empty($items)) { - return; - } - - foreach ($items as $item) { - for ($i = $item['start']; $i <= $item['end']; $i++) { - if ($tokens[$i]['code'] === \T_STRING - || $tokens[$i]['code'] === \T_VARIABLE - ) { - // Variable, constant, function call. Ignore complete item as undetermined. - break; - } - - if (isset($this->textStringTokens[$tokens[$i]['code']]) === true - && strpos($tokens[$i]['content'], '>') !== false - ) { - - $phpcsFile->addWarning( - 'When passing strip_tags() the $allowable_tags parameter as an array, the tags should not be enclosed in <> brackets. Found: %s', - $i, - 'Invalid', - array($item['raw']) - ); - - // Only throw one error per array item. - break; - } - } - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php deleted file mode 100644 index 83d4b8b3..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedHashAlgorithmsSniff.php +++ /dev/null @@ -1,117 +0,0 @@ - array(string => bool)) - */ - protected $removedAlgorithms = array( - 'salsa10' => array( - '5.4' => true, - ), - 'salsa20' => array( - '5.4' => true, - ), - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * - * @return array - */ - public function register() - { - return array(\T_STRING); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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) - { - $algo = $this->getHashAlgorithmParameter($phpcsFile, $stackPtr); - if (empty($algo) || \is_string($algo) === false) { - return; - } - - // Bow out if not one of the algorithms we're targetting. - if (isset($this->removedAlgorithms[$algo]) === false) { - return; - } - - $itemInfo = array( - 'name' => $algo, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->removedAlgorithms[$itemInfo['name']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The %s hash algorithm is '; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php deleted file mode 100644 index d7c7c663..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedIconvEncodingSniff.php +++ /dev/null @@ -1,86 +0,0 @@ - true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('5.6') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[1]) === false) { - return; - } - - $phpcsFile->addWarning( - 'All previously accepted values for the $type parameter of iconv_set_encoding() have been deprecated since PHP 5.6. Found %s', - $parameters[1]['start'], - 'DeprecatedValueFound', - $parameters[1]['raw'] - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php deleted file mode 100644 index 1ff0f90f..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedImplodeFlexibleParamOrderSniff.php +++ /dev/null @@ -1,323 +0,0 @@ - true, - 'join' => true, - ); - - /** - * List of PHP native constants which should be recognized as text strings. - * - * @since 9.3.0 - * - * @var array - */ - private $constantStrings = array( - 'DIRECTORY_SEPARATOR' => true, - 'PHP_EOL' => true, - ); - - /** - * List of PHP native functions which should be recognized as returning an array. - * - * Note: The array_*() functions will always be taken into account. - * - * @since 9.3.0 - * - * @var array - */ - private $arrayFunctions = array( - 'compact' => true, - 'explode' => true, - 'range' => true, - ); - - /** - * List of PHP native array functions which should *not* be recognized as returning an array. - * - * @since 9.3.0 - * - * @var array - */ - private $arrayFunctionExceptions = array( - 'array_key_exists' => true, - 'array_key_first' => true, - 'array_key_last' => true, - 'array_multisort' => true, - 'array_pop' => true, - 'array_product' => true, - 'array_push' => true, - 'array_search' => true, - 'array_shift' => true, - 'array_sum' => true, - 'array_unshift' => true, - 'array_walk_recursive' => true, - 'array_walk' => true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.3.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('7.4') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[2]) === false) { - // Only one parameter, this must be $pieces. Bow out. - return; - } - - $tokens = $phpcsFile->getTokens(); - - /* - * Examine the first parameter. - * If there is any indication that this is an array declaration, we have an error. - */ - - $targetParam = $parameters[1]; - $start = $targetParam['start']; - $end = ($targetParam['end'] + 1); - $isOnlyText = true; - - $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $start, $end, true); - if ($firstNonEmpty === false) { - // Parse error. Shouldn't be possible. - return; - } - - if ($tokens[$firstNonEmpty]['code'] === \T_OPEN_PARENTHESIS) { - $start = ($firstNonEmpty + 1); - $end = $tokens[$firstNonEmpty]['parenthesis_closer']; - } - - $hasTernary = $phpcsFile->findNext(\T_INLINE_THEN, $start, $end); - if ($hasTernary !== false - && isset($tokens[$start]['nested_parenthesis'], $tokens[$hasTernary]['nested_parenthesis']) - && count($tokens[$start]['nested_parenthesis']) === count($tokens[$hasTernary]['nested_parenthesis']) - ) { - $start = ($hasTernary + 1); - } - - for ($i = $start; $i < $end; $i++) { - $tokenCode = $tokens[$i]['code']; - - if (isset(Tokens::$emptyTokens[$tokenCode])) { - continue; - } - - if ($tokenCode === \T_STRING && isset($this->constantStrings[$tokens[$i]['content']])) { - continue; - } - - if ($hasTernary !== false && $tokenCode === \T_INLINE_ELSE) { - continue; - } - - if (isset(Tokens::$stringTokens[$tokenCode]) === false) { - $isOnlyText = false; - } - - if ($tokenCode === \T_ARRAY || $tokenCode === \T_OPEN_SHORT_ARRAY || $tokenCode === \T_ARRAY_CAST) { - $this->throwNotice($phpcsFile, $stackPtr, $functionName); - return; - } - - if ($tokenCode === \T_STRING) { - /* - * Check for specific functions which return an array (i.e. $pieces). - */ - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $end, true); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { - continue; - } - - $nameLc = strtolower($tokens[$i]['content']); - if (isset($this->arrayFunctions[$nameLc]) === false - && (strpos($nameLc, 'array_') !== 0 - || isset($this->arrayFunctionExceptions[$nameLc]) === true) - ) { - continue; - } - - // Now make sure it's the PHP native function being called. - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $start, true); - if ($tokens[$prevNonEmpty]['code'] === \T_DOUBLE_COLON - || $tokens[$prevNonEmpty]['code'] === \T_OBJECT_OPERATOR - ) { - // Method call, not a call to the PHP native function. - continue; - } - - if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR - && $tokens[$prevNonEmpty - 1]['code'] === \T_STRING - ) { - // Namespaced function. - continue; - } - - // Ok, so we know that there is an array function in the first param. - // 99.9% chance that this is $pieces, not $glue. - $this->throwNotice($phpcsFile, $stackPtr, $functionName); - return; - } - } - - if ($isOnlyText === true) { - // First parameter only contained text string tokens, i.e. glue. - return; - } - - /* - * Examine the second parameter. - */ - - $targetParam = $parameters[2]; - $start = $targetParam['start']; - $end = ($targetParam['end'] + 1); - - $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $start, $end, true); - if ($firstNonEmpty === false) { - // Parse error. Shouldn't be possible. - return; - } - - if ($tokens[$firstNonEmpty]['code'] === \T_OPEN_PARENTHESIS) { - $start = ($firstNonEmpty + 1); - $end = $tokens[$firstNonEmpty]['parenthesis_closer']; - } - - $hasTernary = $phpcsFile->findNext(\T_INLINE_THEN, $start, $end); - if ($hasTernary !== false - && isset($tokens[$start]['nested_parenthesis'], $tokens[$hasTernary]['nested_parenthesis']) - && count($tokens[$start]['nested_parenthesis']) === count($tokens[$hasTernary]['nested_parenthesis']) - ) { - $start = ($hasTernary + 1); - } - - for ($i = $start; $i < $end; $i++) { - $tokenCode = $tokens[$i]['code']; - - if (isset(Tokens::$emptyTokens[$tokenCode])) { - continue; - } - - if ($tokenCode === \T_ARRAY || $tokenCode === \T_OPEN_SHORT_ARRAY || $tokenCode === \T_ARRAY_CAST) { - // Found an array, $pieces is second. - return; - } - - if ($tokenCode === \T_STRING && isset($this->constantStrings[$tokens[$i]['content']])) { - // One of the special cased, PHP native string constants found. - $this->throwNotice($phpcsFile, $stackPtr, $functionName); - return; - } - - if ($tokenCode === \T_STRING || $tokenCode === \T_VARIABLE) { - // Function call, constant or variable encountered. - // No matter what this is combined with, we won't be able to reliably determine the value. - return; - } - - if ($tokenCode === \T_CONSTANT_ENCAPSED_STRING - || $tokenCode === \T_DOUBLE_QUOTED_STRING - || $tokenCode === \T_HEREDOC - || $tokenCode === \T_NOWDOC - ) { - $this->throwNotice($phpcsFile, $stackPtr, $functionName); - return; - } - } - } - - - /** - * Throw the error/warning. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * - * @return void - */ - protected function throwNotice(File $phpcsFile, $stackPtr, $functionName) - { - $message = 'Passing the $glue and $pieces parameters in reverse order to %s has been deprecated since PHP 7.4'; - $isError = false; - $errorCode = 'Deprecated'; - $data = array($functionName); - - /* - Support for the deprecated behaviour is expected to be removed in PHP 8.0. - Once this has been implemented, this section should be uncommented. - if ($this->supportsAbove('8.0') === true) { - $message .= ' and is removed since PHP 8.0'; - $isError = true; - $errorCode = 'Removed'; - } - */ - - $message .= '; $glue should be the first parameter and $pieces the second'; - - $this->addMessage($phpcsFile, $message, $stackPtr, $isError, $errorCode, $data); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php deleted file mode 100644 index 7406d9a8..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbStrrposEncodingThirdParamSniff.php +++ /dev/null @@ -1,149 +0,0 @@ - true, - ); - - /** - * Tokens which should be recognized as text. - * - * @since 9.3.0 - * - * @var array - */ - private $textStringTokens = array( - \T_CONSTANT_ENCAPSED_STRING, - \T_DOUBLE_QUOTED_STRING, - \T_HEREDOC, - \T_NOWDOC, - ); - - /** - * Tokens which should be recognized as numbers. - * - * @since 9.3.0 - * - * @var array - */ - private $numberTokens = array( - \T_LNUMBER => \T_LNUMBER, - \T_DNUMBER => \T_DNUMBER, - \T_MINUS => \T_MINUS, - \T_PLUS => \T_PLUS, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.3.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return $this->supportsAbove('5.2') === false; - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[3]) === false) { - // Optional third parameter not set. - return; - } - - if (isset($parameters[4]) === true) { - // Encoding set as fourth parameter. - return; - } - - $targetParam = $parameters[3]; - $targets = $this->numberTokens + Tokens::$emptyTokens; - $nonNumber = $phpcsFile->findNext($targets, $targetParam['start'], ($targetParam['end'] + 1), true); - if ($nonNumber === false) { - return; - } - - if ($this->isNumericCalculation($phpcsFile, $targetParam['start'], $targetParam['end']) === true) { - return; - } - - $hasString = $phpcsFile->findNext($this->textStringTokens, $targetParam['start'], ($targetParam['end'] + 1)); - if ($hasString === false) { - // No text strings found. Undetermined. - return; - } - - $error = 'Passing the encoding to mb_strrpos() as third parameter is soft deprecated since PHP 5.2'; - if ($this->supportsAbove('7.4') === true) { - $error .= ' and hard deprecated since PHP 7.4'; - } - - $error .= '. Use an explicit 0 as the offset in the third parameter.'; - - $phpcsFile->addWarning( - $error, - $targetParam['start'], - 'Deprecated' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php deleted file mode 100644 index 83e4de97..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedMbstringModifiersSniff.php +++ /dev/null @@ -1,135 +0,0 @@ - 4, - 'mb_eregi_replace' => 4, - 'mb_regex_set_options' => 1, - 'mbereg_replace' => 4, // Undocumented, but valid function alias. - 'mberegi_replace' => 4, // Undocumented, but valid function alias. - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 8.2.0 - * - * @return bool - */ - protected function bowOutEarly() - { - // Version used here should be the highest version from the `$newModifiers` array, - // i.e. the last PHP version in which a new modifier was introduced. - return ($this->supportsAbove('7.1') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 7.0.5 - * @since 8.2.0 Renamed from `process()` to `processParameters()` and removed - * logic superfluous now the sniff extends the abstract. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - $tokens = $phpcsFile->getTokens(); - $functionNameLc = strtolower($functionName); - - // Check whether the options parameter in the function call is passed. - if (isset($parameters[$this->targetFunctions[$functionNameLc]]) === false) { - return; - } - - $optionsParam = $parameters[$this->targetFunctions[$functionNameLc]]; - - $stringToken = $phpcsFile->findNext(Tokens::$stringTokens, $optionsParam['start'], $optionsParam['end'] + 1); - if ($stringToken === false) { - // No string token found in the options parameter, so skip it (e.g. variable passed in). - return; - } - - $options = ''; - - /* - * Get the content of any string tokens in the options parameter and remove the quotes and variables. - */ - for ($i = $stringToken; $i <= $optionsParam['end']; $i++) { - if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === false) { - continue; - } - - $content = $this->stripQuotes($tokens[$i]['content']); - if ($tokens[$i]['code'] === \T_DOUBLE_QUOTED_STRING) { - $content = $this->stripVariables($content); - } - $content = trim($content); - - if (empty($content) === false) { - $options .= $content; - } - } - - if (strpos($options, 'e') !== false) { - $error = 'The Mbstring regex "e" modifier is deprecated since PHP 7.1.'; - - // The alternative mb_ereg_replace_callback() function is only available since 5.4.1. - if ($this->supportsBelow('5.4.1') === false) { - $error .= ' Use mb_ereg_replace_callback() instead (PHP 5.4.1+).'; - } - - $phpcsFile->addWarning($error, $stackPtr, 'Deprecated'); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php deleted file mode 100644 index 832a1f62..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedNonCryptoHashSniff.php +++ /dev/null @@ -1,121 +0,0 @@ - true, - 'hash_hmac_file' => true, - 'hash_init' => true, - 'hash_pbkdf2' => true, - ); - - /** - * List of the non-cryptographic hashes. - * - * @since 9.0.0 - * - * @var array - */ - protected $disabledCryptos = array( - 'adler32' => true, - 'crc32' => true, - 'crc32b' => true, - 'fnv132' => true, - 'fnv1a32' => true, - 'fnv164' => true, - 'fnv1a64' => true, - 'joaat' => true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('7.2') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[1]) === false) { - return; - } - - $targetParam = $parameters[1]; - - if (isset($this->disabledCryptos[$this->stripQuotes($targetParam['raw'])]) === false) { - return; - } - - if (strtolower($functionName) === 'hash_init' - && (isset($parameters[2]) === false - || ($parameters[2]['raw'] !== 'HASH_HMAC' - && $parameters[2]['raw'] !== (string) \HASH_HMAC)) - ) { - // For hash_init(), these hashes are only disabled with HASH_HMAC set. - return; - } - - $phpcsFile->addError( - 'Non-cryptographic hashes are no longer accepted by function %s() since PHP 7.2. Found: %s', - $targetParam['start'], - $this->stringToErrorCode($functionName), - array( - $functionName, - $targetParam['raw'], - ) - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php deleted file mode 100644 index 377ed79f..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedPCREModifiersSniff.php +++ /dev/null @@ -1,241 +0,0 @@ - true, - 'preg_filter' => true, - ); - - /** - * Regex bracket delimiters. - * - * @since 7.0.5 This array was originally contained within the `process()` method. - * - * @var array - */ - protected $doublesSeparators = array( - '{' => '}', - '[' => ']', - '(' => ')', - '<' => '>', - ); - - - /** - * Process the parameters of a matched function. - * - * @since 5.6 - * @since 8.2.0 Renamed from `process()` to `processParameters()` and removed - * logic superfluous now the sniff extends the abstract. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - // Check the first parameter in the function call as that should contain the regex(es). - if (isset($parameters[1]) === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $functionNameLc = strtolower($functionName); - $firstParam = $parameters[1]; - - // Differentiate between an array of patterns passed and a single pattern. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $firstParam['start'], ($firstParam['end'] + 1), true); - if ($nextNonEmpty !== false && ($tokens[$nextNonEmpty]['code'] === \T_ARRAY || $tokens[$nextNonEmpty]['code'] === \T_OPEN_SHORT_ARRAY)) { - $arrayValues = $this->getFunctionCallParameters($phpcsFile, $nextNonEmpty); - if ($functionNameLc === 'preg_replace_callback_array') { - // For preg_replace_callback_array(), the patterns will be in the array keys. - foreach ($arrayValues as $value) { - $hasKey = $phpcsFile->findNext(\T_DOUBLE_ARROW, $value['start'], ($value['end'] + 1)); - if ($hasKey === false) { - continue; - } - - $value['end'] = ($hasKey - 1); - $value['raw'] = trim($phpcsFile->getTokensAsString($value['start'], ($hasKey - $value['start']))); - $this->processRegexPattern($value, $phpcsFile, $value['end'], $functionName); - } - - } else { - // Otherwise, the patterns will be in the array values. - foreach ($arrayValues as $value) { - $hasKey = $phpcsFile->findNext(\T_DOUBLE_ARROW, $value['start'], ($value['end'] + 1)); - if ($hasKey !== false) { - $value['start'] = ($hasKey + 1); - $value['raw'] = trim($phpcsFile->getTokensAsString($value['start'], (($value['end'] + 1) - $value['start']))); - } - - $this->processRegexPattern($value, $phpcsFile, $value['end'], $functionName); - } - } - - } else { - $this->processRegexPattern($firstParam, $phpcsFile, $stackPtr, $functionName); - } - } - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 8.2.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('5.5') === false); - } - - - /** - * Analyse a potential regex pattern for use of the /e modifier. - * - * @since 7.1.2 This logic was originally contained within the `process()` method. - * - * @param array $pattern Array containing the start and end token - * pointer of the potential regex pattern and - * the raw string value of the pattern. - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param string $functionName The function which contained the pattern. - * - * @return void - */ - protected function processRegexPattern($pattern, File $phpcsFile, $stackPtr, $functionName) - { - $tokens = $phpcsFile->getTokens(); - - /* - * The pattern might be build up of a combination of strings, variables - * and function calls. We are only concerned with the strings. - */ - $regex = ''; - for ($i = $pattern['start']; $i <= $pattern['end']; $i++) { - if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true) { - $content = $this->stripQuotes($tokens[$i]['content']); - if ($tokens[$i]['code'] === \T_DOUBLE_QUOTED_STRING) { - $content = $this->stripVariables($content); - } - - $regex .= trim($content); - } - } - - // Deal with multi-line regexes which were broken up in several string tokens. - if ($tokens[$pattern['start']]['line'] !== $tokens[$pattern['end']]['line']) { - $regex = $this->stripQuotes($regex); - } - - if ($regex === '') { - // No string token found in the first parameter, so skip it (e.g. if variable passed in). - return; - } - - $regexFirstChar = substr($regex, 0, 1); - - // Make sure that the character identified as the delimiter is valid. - // Otherwise, it is a false positive caused by the string concatenation. - if (preg_match('`[a-z0-9\\\\ ]`i', $regexFirstChar) === 1) { - return; - } - - if (isset($this->doublesSeparators[$regexFirstChar])) { - $regexEndPos = strrpos($regex, $this->doublesSeparators[$regexFirstChar]); - } else { - $regexEndPos = strrpos($regex, $regexFirstChar); - } - - if ($regexEndPos !== false) { - $modifiers = substr($regex, $regexEndPos + 1); - $this->examineModifiers($phpcsFile, $stackPtr, $functionName, $modifiers); - } - } - - - /** - * Examine the regex modifier string. - * - * @since 8.2.0 Split off from the `processRegexPattern()` method. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param string $functionName The function which contained the pattern. - * @param string $modifiers The regex modifiers found. - * - * @return void - */ - protected function examineModifiers(File $phpcsFile, $stackPtr, $functionName, $modifiers) - { - if (strpos($modifiers, 'e') !== false) { - $error = '%s() - /e modifier is deprecated since PHP 5.5'; - $isError = false; - $errorCode = 'Deprecated'; - $data = array($functionName); - - if ($this->supportsAbove('7.0')) { - $error .= ' and removed since PHP 7.0'; - $isError = true; - $errorCode = 'Removed'; - } - - $this->addMessage($phpcsFile, $error, $stackPtr, $isError, $errorCode, $data); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php deleted file mode 100644 index 6f1eced1..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/ParameterValues/RemovedSetlocaleStringSniff.php +++ /dev/null @@ -1,104 +0,0 @@ - true, - ); - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 9.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('4.2') === false); - } - - - /** - * Process the parameters of a matched function. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[1]) === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $targetParam = $parameters[1]; - - for ($i = $targetParam['start']; $i <= $targetParam['end']; $i++) { - if ($tokens[$i]['code'] !== \T_CONSTANT_ENCAPSED_STRING - && $tokens[$i]['code'] !== \T_DOUBLE_QUOTED_STRING - ) { - continue; - } - - $message = 'Passing the $category as a string to setlocale() has been deprecated since PHP 4.2'; - $isError = false; - $errorCode = 'Deprecated'; - $data = array($targetParam['raw']); - - if ($this->supportsAbove('7.0') === true) { - $message .= ' and is removed since PHP 7.0'; - $isError = true; - $errorCode = 'Removed'; - } - - $message .= '; Pass one of the LC_* constants instead. Found: %s'; - - $this->addMessage($phpcsFile, $message, $i, $isError, $errorCode, $data); - break; - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php deleted file mode 100644 index 96b49827..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/ForbiddenCallTimePassByReferenceSniff.php +++ /dev/null @@ -1,259 +0,0 @@ - true, - 'T_IS_NOT_EQUAL' => true, - 'T_IS_IDENTICAL' => true, - 'T_IS_NOT_IDENTICAL' => true, - 'T_IS_SMALLER_OR_EQUAL' => true, - 'T_IS_GREATER_OR_EQUAL' => true, - - // Assignment tokens. - 'T_EQUAL' => true, - 'T_AND_EQUAL' => true, - 'T_OR_EQUAL' => true, - 'T_CONCAT_EQUAL' => true, - 'T_DIV_EQUAL' => true, - 'T_MINUS_EQUAL' => true, - 'T_POW_EQUAL' => true, - 'T_MOD_EQUAL' => true, - 'T_MUL_EQUAL' => true, - 'T_PLUS_EQUAL' => true, - 'T_XOR_EQUAL' => true, - 'T_DOUBLE_ARROW' => true, - 'T_SL_EQUAL' => true, - 'T_SR_EQUAL' => true, - 'T_COALESCE_EQUAL' => true, - 'T_ZSR_EQUAL' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * - * @return array - */ - public function register() - { - return array( - \T_STRING, - \T_VARIABLE, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('5.3') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - // Skip tokens that are the names of functions or classes - // within their definitions. For example: function myFunction... - // "myFunction" is T_STRING but we should skip because it is not a - // function or method *call*. - $findTokens = Tokens::$emptyTokens; - $findTokens[] = \T_BITWISE_AND; - - $prevNonEmpty = $phpcsFile->findPrevious( - $findTokens, - ($stackPtr - 1), - null, - true - ); - - if ($prevNonEmpty !== false && \in_array($tokens[$prevNonEmpty]['type'], array('T_FUNCTION', 'T_CLASS', 'T_INTERFACE', 'T_TRAIT'), true)) { - return; - } - - // If the next non-whitespace token after the function or method call - // is not an opening parenthesis then it can't really be a *call*. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($openBracket === false || $tokens[$openBracket]['code'] !== \T_OPEN_PARENTHESIS - || isset($tokens[$openBracket]['parenthesis_closer']) === false - ) { - return; - } - - // Get the function call parameters. - $parameters = $this->getFunctionCallParameters($phpcsFile, $stackPtr); - if (\count($parameters) === 0) { - return; - } - - // Which nesting level is the one we are interested in ? - $nestedParenthesisCount = 1; - if (isset($tokens[$openBracket]['nested_parenthesis'])) { - $nestedParenthesisCount = \count($tokens[$openBracket]['nested_parenthesis']) + 1; - } - - foreach ($parameters as $parameter) { - if ($this->isCallTimePassByReferenceParam($phpcsFile, $parameter, $nestedParenthesisCount) === true) { - // T_BITWISE_AND represents a pass-by-reference. - $error = 'Using a call-time pass-by-reference is deprecated since PHP 5.3'; - $isError = false; - $errorCode = 'Deprecated'; - - if ($this->supportsAbove('5.4')) { - $error .= ' and prohibited since PHP 5.4'; - $isError = true; - $errorCode = 'NotAllowed'; - } - - $this->addMessage($phpcsFile, $error, $parameter['start'], $isError, $errorCode); - } - } - } - - - /** - * Determine whether a parameter is passed by reference. - * - * @since 7.0.6 Split off from the `process()` method. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param array $parameter Information on the current parameter - * to be examined. - * @param int $nestingLevel Target nesting level. - * - * @return bool - */ - protected function isCallTimePassByReferenceParam(File $phpcsFile, $parameter, $nestingLevel) - { - $tokens = $phpcsFile->getTokens(); - - $searchStartToken = $parameter['start'] - 1; - $searchEndToken = $parameter['end'] + 1; - $nextVariable = $searchStartToken; - do { - $nextVariable = $phpcsFile->findNext(array(\T_VARIABLE, \T_OPEN_SHORT_ARRAY, \T_CLOSURE), ($nextVariable + 1), $searchEndToken); - if ($nextVariable === false) { - return false; - } - - // Ignore anything within short array definition brackets. - if ($tokens[$nextVariable]['type'] === 'T_OPEN_SHORT_ARRAY' - && (isset($tokens[$nextVariable]['bracket_opener']) - && $tokens[$nextVariable]['bracket_opener'] === $nextVariable) - && isset($tokens[$nextVariable]['bracket_closer']) - ) { - // Skip forward to the end of the short array definition. - $nextVariable = $tokens[$nextVariable]['bracket_closer']; - continue; - } - - // Skip past closures passed as function parameters. - if ($tokens[$nextVariable]['type'] === 'T_CLOSURE' - && (isset($tokens[$nextVariable]['scope_condition']) - && $tokens[$nextVariable]['scope_condition'] === $nextVariable) - && isset($tokens[$nextVariable]['scope_closer']) - ) { - // Skip forward to the end of the closure declaration. - $nextVariable = $tokens[$nextVariable]['scope_closer']; - continue; - } - - // Make sure the variable belongs directly to this function call - // and is not inside a nested function call or array. - if (isset($tokens[$nextVariable]['nested_parenthesis']) === false - || (\count($tokens[$nextVariable]['nested_parenthesis']) !== $nestingLevel) - ) { - continue; - } - - // Checking this: $value = my_function(...[*]$arg...). - $tokenBefore = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($nextVariable - 1), - $searchStartToken, - true - ); - - if ($tokenBefore === false || $tokens[$tokenBefore]['code'] !== \T_BITWISE_AND) { - // Nothing before the token or no &. - continue; - } - - if ($phpcsFile->isReference($tokenBefore) === false) { - continue; - } - - // Checking this: $value = my_function(...[*]&$arg...). - $tokenBefore = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($tokenBefore - 1), - $searchStartToken, - true - ); - - // Prevent false positive on assign by reference and compare with reference - // within function call parameters. - if (isset($this->assignOrCompare[$tokens[$tokenBefore]['type']])) { - continue; - } - - // The found T_BITWISE_AND represents a pass-by-reference. - return true; - - } while ($nextVariable < $searchEndToken); - - // This code should never be reached, but here in case of weird bugs. - return false; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php deleted file mode 100644 index 2cc1e551..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayStringDereferencingSniff.php +++ /dev/null @@ -1,199 +0,0 @@ -supportsBelow('5.6') === false) { - return; - } - - $dereferencing = $this->isArrayStringDereferencing($phpcsFile, $stackPtr); - if (empty($dereferencing)) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $supports54 = $this->supportsBelow('5.4'); - - foreach ($dereferencing['braces'] as $openBrace => $closeBrace) { - if ($supports54 === true - && ($tokens[$openBrace]['type'] === 'T_OPEN_SQUARE_BRACKET' - || $tokens[$openBrace]['type'] === 'T_OPEN_SHORT_ARRAY') // Work around bug #1381 in PHPCS 2.8.1 and lower. - ) { - $phpcsFile->addError( - 'Direct array dereferencing of %s is not present in PHP version 5.4 or earlier', - $openBrace, - 'Found', - array($dereferencing['type']) - ); - - continue; - } - - // PHP 7.0 Array/string dereferencing using curly braces. - if ($tokens[$openBrace]['type'] === 'T_OPEN_CURLY_BRACKET') { - $phpcsFile->addError( - 'Direct array dereferencing of %s using curly braces is not present in PHP version 5.6 or earlier', - $openBrace, - 'FoundUsingCurlies', - array($dereferencing['type']) - ); - } - } - } - - - /** - * Check if this string/array is being dereferenced. - * - * @since 9.3.0 Logic split off from the process method. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return array Array containing the type of access and stack pointers to the - * open/close braces involved in the array/string dereferencing; - * or an empty array if no array/string dereferencing was detected. - */ - public function isArrayStringDereferencing(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - switch ($tokens[$stackPtr]['code']) { - case \T_CONSTANT_ENCAPSED_STRING: - $type = 'string literals'; - $end = $stackPtr; - break; - - case \T_ARRAY: - if (isset($tokens[$stackPtr]['parenthesis_closer']) === false) { - // Live coding. - return array(); - } else { - $type = 'arrays'; - $end = $tokens[$stackPtr]['parenthesis_closer']; - } - break; - - case \T_OPEN_SHORT_ARRAY: - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - // Live coding. - return array(); - } else { - $type = 'arrays'; - $end = $tokens[$stackPtr]['bracket_closer']; - } - break; - } - - if (isset($type, $end) === false) { - // Shouldn't happen, but for some reason did. - return array(); - } - - $braces = array(); - - do { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true, null, true); - if ($nextNonEmpty === false) { - break; - } - - if ($tokens[$nextNonEmpty]['type'] === 'T_OPEN_SQUARE_BRACKET' - || $tokens[$nextNonEmpty]['type'] === 'T_OPEN_CURLY_BRACKET' // PHP 7.0+. - || $tokens[$nextNonEmpty]['type'] === 'T_OPEN_SHORT_ARRAY' // Work around bug #1381 in PHPCS 2.8.1 and lower. - ) { - if (isset($tokens[$nextNonEmpty]['bracket_closer']) === false) { - // Live coding or parse error. - break; - } - - $braces[$nextNonEmpty] = $tokens[$nextNonEmpty]['bracket_closer']; - - // Continue, just in case there is nested array access, i.e. `array(1, 2, 3)[$i][$j];`. - $end = $tokens[$nextNonEmpty]['bracket_closer']; - continue; - } - - // If we're still here, we've reached the end of the variable. - break; - - } while (true); - - if (empty($braces)) { - return array(); - } - - return array( - 'type' => $type, - 'braces' => $braces, - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php deleted file mode 100644 index f0f66b86..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewArrayUnpackingSniff.php +++ /dev/null @@ -1,142 +0,0 @@ -supportsBelow('7.3') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - /* - * Determine the array opener & closer. - */ - $closer = $phpcsFile->numTokens; - if ($tokens[$stackPtr]['code'] === \T_ARRAY) { - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { - return; - } - - $opener = $tokens[$stackPtr]['parenthesis_opener']; - - if (isset($tokens[$opener]['parenthesis_closer'])) { - $closer = $tokens[$opener]['parenthesis_closer']; - } - } else { - // Short array syntax. - $opener = $stackPtr; - - if (isset($tokens[$stackPtr]['bracket_closer'])) { - $closer = $tokens[$stackPtr]['bracket_closer']; - } - } - - $nestingLevel = 0; - if (isset($tokens[($opener + 1)]['nested_parenthesis'])) { - $nestingLevel = count($tokens[($opener + 1)]['nested_parenthesis']); - } - - for ($i = $opener; $i < $closer;) { - $i = $phpcsFile->findNext(array(\T_ELLIPSIS, \T_OPEN_SHORT_ARRAY, \T_ARRAY), ($i + 1), $closer); - if ($i === false) { - return; - } - - if ($tokens[$i]['code'] === \T_OPEN_SHORT_ARRAY) { - if (isset($tokens[$i]['bracket_closer']) === false) { - // Live coding, unfinished nested array, handle this when the array opener - // of the nested array is passed. - return; - } - - // Skip over nested short arrays. These will be handled when the array opener - // of the nested array is passed. - $i = $tokens[$i]['bracket_closer']; - continue; - } - - if ($tokens[$i]['code'] === \T_ARRAY) { - if (isset($tokens[$i]['parenthesis_closer']) === false) { - // Live coding, unfinished nested array, handle this when the array opener - // of the nested array is passed. - return; - } - - // Skip over nested long arrays. These will be handled when the array opener - // of the nested array is passed. - $i = $tokens[$i]['parenthesis_closer']; - continue; - } - - // Ensure this is not function call variable unpacking. - if (isset($tokens[$i]['nested_parenthesis']) - && count($tokens[$i]['nested_parenthesis']) > $nestingLevel - ) { - continue; - } - - // Ok, found one. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - $snippet = trim($phpcsFile->getTokensAsString($i, (($nextNonEmpty - $i) + 1))); - $phpcsFile->addError( - 'Array unpacking within array declarations using the spread operator is not supported in PHP 7.3 or earlier. Found: %s', - $i, - 'Found', - array($snippet) - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php deleted file mode 100644 index 218f0c9f..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewClassMemberAccessSniff.php +++ /dev/null @@ -1,192 +0,0 @@ -bar()`. - * PHP 7.0: Class member access on cloning has been added, e.g. `(clone $foo)->bar()`. - * - * As of PHP 7.0, class member access on instantiation also works when using curly braces. - * While unclear, this most likely has to do with the Uniform Variable Syntax changes. - * - * PHP version 5.4 - * PHP version 7.0 - * - * @link https://www.php.net/manual/en/language.oop5.basic.php#example-177 - * @link https://www.php.net/manual/en/language.oop5.cloning.php#language.oop5.traits.properties.example - * @link https://www.php.net/manual/en/migration54.new-features.php - * @link https://wiki.php.net/rfc/instance-method-call - * @link https://wiki.php.net/rfc/uniform_variable_syntax - * - * {@internal The reason for splitting the logic of this sniff into different methods is - * to allow re-use of the logic by the PHP 7.4 `RemovedCurlyBraceArrayAccess` sniff.} - * - * @since 8.2.0 - * @since 9.3.0 Now also detects class member access on instantiation using curly braces. - */ -class NewClassMemberAccessSniff extends Sniff -{ - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.2.0 - * - * @return array - */ - public function register() - { - return array( - \T_NEW, - \T_CLONE, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsBelow('5.6') === false) { - return; - } - - $pointers = $this->isClassMemberAccess($phpcsFile, $stackPtr); - if (empty($pointers)) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $supports53 = $this->supportsBelow('5.3'); - - $error = 'Class member access on object %s was not supported in PHP %s or earlier'; - $data = array('instantiation', '5.3'); - $errorCode = 'OnNewFound'; - - if ($tokens[$stackPtr]['code'] === \T_CLONE) { - $data = array('cloning', '5.6'); - $errorCode = 'OnCloneFound'; - } - - foreach ($pointers as $open => $close) { - $itemData = $data; - $itemErrorCode = $errorCode; - - if ($tokens[$stackPtr]['code'] === \T_NEW - && $tokens[$open]['code'] !== \T_OPEN_CURLY_BRACKET - ) { - if ($supports53 === true) { - $phpcsFile->addError($error, $open, $itemErrorCode, $itemData); - } - continue; - } - - if ($tokens[$stackPtr]['code'] === \T_NEW - && $tokens[$open]['code'] === \T_OPEN_CURLY_BRACKET - ) { - // Non-curlies was already handled above. - $itemData = array('instantiation using curly braces', '5.6'); - $itemErrorCode = 'OnNewFoundUsingCurlies'; - } - - $phpcsFile->addError($error, $open, $itemErrorCode, $itemData); - } - } - - - /** - * Check if the class being instantiated/cloned is being dereferenced. - * - * @since 9.3.0 Logic split off from the process method. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return array Array containing the stack pointers to the object operator or - * the open/close braces involved in the class member access; - * or an empty array if no class member access was detected. - */ - public function isClassMemberAccess(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['nested_parenthesis']) === false) { - // The `new className/clone $a` has to be in parentheses, without is not supported. - return array(); - } - - $parenthesisCloser = end($tokens[$stackPtr]['nested_parenthesis']); - $parenthesisOpener = key($tokens[$stackPtr]['nested_parenthesis']); - - if (isset($tokens[$parenthesisOpener]['parenthesis_owner']) === true) { - // If there is an owner, these parentheses are for a different purpose. - return array(); - } - - $prevBeforeParenthesis = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($parenthesisOpener - 1), null, true); - if ($prevBeforeParenthesis !== false && $tokens[$prevBeforeParenthesis]['code'] === \T_STRING) { - // This is most likely a function call with the new/cloned object as a parameter. - return array(); - } - - $braces = array(); - $end = $parenthesisCloser; - - do { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true, null, true); - if ($nextNonEmpty === false) { - break; - } - - if ($tokens[$nextNonEmpty]['code'] === \T_OBJECT_OPERATOR) { - // No need to walk any further if this is object access. - $braces[$nextNonEmpty] = true; - break; - } - - if ($tokens[$nextNonEmpty]['code'] === \T_OPEN_SQUARE_BRACKET - || $tokens[$nextNonEmpty]['code'] === \T_OPEN_CURLY_BRACKET // PHP 7.0+. - ) { - if (isset($tokens[$nextNonEmpty]['bracket_closer']) === false) { - // Live coding or parse error. - break; - } - - $braces[$nextNonEmpty] = $tokens[$nextNonEmpty]['bracket_closer']; - - // Continue, just in case there is nested array access, i.e. `(new Foo())[1][0];`. - $end = $tokens[$nextNonEmpty]['bracket_closer']; - continue; - } - - // If we're still here, we've reached the end. - break; - - } while (true); - - return $braces; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php deleted file mode 100644 index 4fd3b2fa..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewDynamicAccessToStaticSniff.php +++ /dev/null @@ -1,89 +0,0 @@ -supportsBelow('5.2') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - // Disregard `static::` as well. Late static binding is reported by another sniff. - if ($tokens[$prevNonEmpty]['code'] === \T_SELF - || $tokens[$prevNonEmpty]['code'] === \T_PARENT - || $tokens[$prevNonEmpty]['code'] === \T_STATIC - ) { - return; - } - - if ($tokens[$prevNonEmpty]['code'] === \T_STRING) { - $prevPrevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true); - - if ($tokens[$prevPrevNonEmpty]['code'] !== \T_OBJECT_OPERATOR) { - return; - } - } - - $phpcsFile->addError( - 'Static class properties and methods, as well as class constants, could not be accessed using a dynamic (variable) classname in PHP 5.2 or earlier.', - $stackPtr, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php deleted file mode 100644 index b24590a6..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFlexibleHeredocNowdocSniff.php +++ /dev/null @@ -1,255 +0,0 @@ -') === false) { - // Start identifier of a PHP 7.3 flexible heredoc/nowdoc. - $targets[] = \T_STRING; - } - - return $targets; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_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) - { - /* - * Due to a tokenizer bug which gets hit when the PHP 7.3 heredoc/nowdoc syntax - * is used, this part of the sniff cannot possibly work on PHPCS < 2.6.0. - * See upstream issue #928. - */ - if ($this->supportsBelow('7.2') === true && version_compare(PHPCSHelper::getVersion(), '2.6.0', '>=')) { - $this->detectIndentedNonStandAloneClosingMarker($phpcsFile, $stackPtr); - } - - $tokens = $phpcsFile->getTokens(); - if ($this->supportsAbove('7.3') === true && $tokens[$stackPtr]['code'] !== \T_STRING) { - $this->detectClosingMarkerInBody($phpcsFile, $stackPtr); - } - } - - - /** - * Detect indented and/or non-stand alone closing markers. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - protected function detectIndentedNonStandAloneClosingMarker(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $indentError = 'Heredoc/nowdoc with an indented closing marker is not supported in PHP 7.2 or earlier.'; - $indentErrorCode = 'IndentedClosingMarker'; - $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) { - - /* - * Check for indented closing marker. - */ - if (ltrim($tokens[$stackPtr]['content']) !== $tokens[$stackPtr]['content']) { - $phpcsFile->addError($indentError, $stackPtr, $indentErrorCode); - } - - /* - * Check for tokens after the closing marker. - */ - $nextNonWhitespace = $phpcsFile->findNext(array(\T_WHITESPACE, \T_SEMICOLON), ($stackPtr + 1), null, true); - if ($tokens[$stackPtr]['line'] === $tokens[$nextNonWhitespace]['line']) { - $phpcsFile->addError($trailingError, $stackPtr, $trailingErrorCode); - } - } else { - // For PHP < 7.3, we're only interested in T_STRING tokens. - if ($tokens[$stackPtr]['code'] !== \T_STRING) { - return; - } - - if (preg_match('`^<<<([\'"]?)([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\1[\r\n]+`', $tokens[$stackPtr]['content'], $matches) !== 1) { - // Not the start of a PHP 7.3 flexible heredoc/nowdoc. - return; - } - - $identifier = $matches[2]; - - for ($i = ($stackPtr + 1); $i <= $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['code'] !== \T_ENCAPSED_AND_WHITESPACE) { - continue; - } - - $trimmed = ltrim($tokens[$i]['content']); - - if (strpos($trimmed, $identifier) !== 0) { - continue; - } - - // OK, we've found the PHP 7.3 flexible heredoc/nowdoc closing marker. - - /* - * Check for indented closing marker. - */ - if ($trimmed !== $tokens[$i]['content']) { - // Indent found before closing marker. - $phpcsFile->addError($indentError, $i, $indentErrorCode); - } - - /* - * Check for tokens after the closing marker. - */ - // Remove the identifier. - $afterMarker = substr($trimmed, \strlen($identifier)); - // Remove a potential semi-colon at the beginning of what's left of the string. - $afterMarker = ltrim($afterMarker, ';'); - // Remove new line characters at the end of the string. - $afterMarker = rtrim($afterMarker, "\r\n"); - - if ($afterMarker !== '') { - $phpcsFile->addError($trailingError, $i, $trailingErrorCode); - } - - break; - } - } - } - - - /** - * Detect heredoc/nowdoc identifiers at the start of lines in the heredoc/nowdoc body. - * - * @since 9.0.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - protected function detectClosingMarkerInBody(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $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) { - $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($stackPtr + 1), null, true, null, true); - if ($nextNonWhitespace === false - || $tokens[$nextNonWhitespace]['code'] === \T_SEMICOLON - || (($tokens[$nextNonWhitespace]['code'] === \T_COMMA - || $tokens[$nextNonWhitespace]['code'] === \T_STRING_CONCAT) - && $tokens[$nextNonWhitespace]['line'] !== $tokens[$stackPtr]['line']) - ) { - // This is most likely a correctly identified closing marker. - return; - } - - // The real closing tag has to be before the next heredoc/nowdoc. - $nextHereNowDoc = $phpcsFile->findNext(array(\T_START_HEREDOC, \T_START_NOWDOC), ($stackPtr + 1)); - if ($nextHereNowDoc === false) { - $nextHereNowDoc = null; - } - - $identifier = trim($tokens[$stackPtr]['content']); - $realClosingMarker = $stackPtr; - - while (($realClosingMarker = $phpcsFile->findNext(\T_STRING, ($realClosingMarker + 1), $nextHereNowDoc, false, $identifier)) !== false) { - - $prevNonWhitespace = $phpcsFile->findPrevious(\T_WHITESPACE, ($realClosingMarker - 1), null, true); - if ($prevNonWhitespace === false - || $tokens[$prevNonWhitespace]['line'] === $tokens[$realClosingMarker]['line'] - ) { - // Marker text found, but not at the start of the line. - continue; - } - - // The original T_END_HEREDOC/T_END_NOWDOC was most likely incorrect as we've found - // a possible alternative closing marker. - $phpcsFile->addError($error, $stackPtr, $errorCode); - - break; - } - - } else { - if (isset($tokens[$stackPtr]['scope_closer'], $tokens[$stackPtr]['scope_opener']) === true - && $tokens[$stackPtr]['scope_closer'] === $stackPtr - ) { - $opener = $tokens[$stackPtr]['scope_opener']; - } else { - // PHPCS < 3.0.2 did not add scope_* values for Nowdocs. - $opener = $phpcsFile->findPrevious(\T_START_NOWDOC, ($stackPtr - 1)); - if ($opener === false) { - return; - } - } - - $quotedIdentifier = preg_quote($tokens[$stackPtr]['content'], '`'); - - // Throw an error for each line in the body which starts with the identifier. - for ($i = ($opener + 1); $i < $stackPtr; $i++) { - if (preg_match('`^[ \t]*' . $quotedIdentifier . '\b`', $tokens[$i]['content']) === 1) { - $phpcsFile->addError($error, $i, $errorCode); - } - } - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php deleted file mode 100644 index ac5e6b72..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionArrayDereferencingSniff.php +++ /dev/null @@ -1,187 +0,0 @@ -supportsBelow('5.6') === false) { - return; - } - - $dereferencing = $this->isFunctionArrayDereferencing($phpcsFile, $stackPtr); - if (empty($dereferencing)) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $supports53 = $this->supportsBelow('5.3'); - - foreach ($dereferencing as $openBrace => $closeBrace) { - if ($supports53 === true - && $tokens[$openBrace]['type'] === 'T_OPEN_SQUARE_BRACKET' - ) { - $phpcsFile->addError( - 'Function array dereferencing is not present in PHP version 5.3 or earlier', - $openBrace, - 'Found' - ); - - continue; - } - - // PHP 7.0 function array dereferencing using curly braces. - if ($tokens[$openBrace]['type'] === 'T_OPEN_CURLY_BRACKET') { - $phpcsFile->addError( - 'Function array dereferencing using curly braces is not present in PHP version 5.6 or earlier', - $openBrace, - 'FoundUsingCurlies' - ); - } - } - } - - - /** - * Check if the return of a function/method call is being dereferenced. - * - * @since 9.3.0 Logic split off from the process method. - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return array Array containing stack pointers to the open/close braces - * involved in the function dereferencing; - * or an empty array if no function dereferencing was detected. - */ - public function isFunctionArrayDereferencing(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Next non-empty token should be the open parenthesis. - $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); - if ($openParenthesis === false || $tokens[$openParenthesis]['code'] !== \T_OPEN_PARENTHESIS) { - return array(); - } - - // Don't throw errors during live coding. - if (isset($tokens[$openParenthesis]['parenthesis_closer']) === false) { - return array(); - } - - // Is this T_STRING really a function or method call ? - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prevToken !== false - && \in_array($tokens[$prevToken]['code'], array(\T_DOUBLE_COLON, \T_OBJECT_OPERATOR), true) === false - ) { - if ($tokens[$prevToken]['code'] === \T_BITWISE_AND) { - // This may be a function declared by reference. - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), null, true); - } - - $ignore = array( - \T_FUNCTION => true, - \T_CONST => true, - \T_USE => true, - \T_NEW => true, - \T_CLASS => true, - \T_INTERFACE => true, - ); - - if (isset($ignore[$tokens[$prevToken]['code']]) === true) { - // Not a call to a PHP function or method. - return array(); - } - } - - $current = $tokens[$openParenthesis]['parenthesis_closer']; - $braces = array(); - - do { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), null, true, null, true); - if ($nextNonEmpty === false) { - break; - } - - if ($tokens[$nextNonEmpty]['type'] === 'T_OPEN_SQUARE_BRACKET' - || $tokens[$nextNonEmpty]['type'] === 'T_OPEN_CURLY_BRACKET' // PHP 7.0+. - ) { - if (isset($tokens[$nextNonEmpty]['bracket_closer']) === false) { - // Live coding or parse error. - break; - } - - $braces[$nextNonEmpty] = $tokens[$nextNonEmpty]['bracket_closer']; - - // Continue, just in case there is nested array access, i.e. `echo $foo->bar()[0][2];`. - $current = $tokens[$nextNonEmpty]['bracket_closer']; - continue; - } - - // If we're still here, we've reached the end of the function call. - break; - - } while (true); - - return $braces; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php deleted file mode 100644 index 39208b35..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewFunctionCallTrailingCommaSniff.php +++ /dev/null @@ -1,120 +0,0 @@ -supportsBelow('7.2') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS - || isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false - ) { - return; - } - - if ($tokens[$stackPtr]['code'] === \T_STRING) { - $ignore = array( - \T_FUNCTION => true, - \T_CONST => true, - \T_USE => true, - ); - - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if (isset($ignore[$tokens[$prevNonEmpty]['code']]) === true) { - // Not a function call. - return; - } - } - - $closer = $tokens[$nextNonEmpty]['parenthesis_closer']; - $lastInParenthesis = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closer - 1), $nextNonEmpty, true); - - if ($tokens[$lastInParenthesis]['code'] !== \T_COMMA) { - return; - } - - $data = array(); - switch ($tokens[$stackPtr]['code']) { - case \T_ISSET: - $data[] = 'calls to isset()'; - $errorCode = 'FoundInIsset'; - break; - - case \T_UNSET: - $data[] = 'calls to unset()'; - $errorCode = 'FoundInUnset'; - break; - - default: - $data[] = 'function calls'; - $errorCode = 'FoundInFunctionCall'; - break; - } - - $phpcsFile->addError( - 'Trailing comma\'s are not allowed in %s in PHP 7.2 or earlier', - $lastInParenthesis, - $errorCode, - $data - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php deleted file mode 100644 index c60ba5c3..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/NewShortArraySniff.php +++ /dev/null @@ -1,77 +0,0 @@ -supportsBelow('5.3') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - $error = '%s is not supported in PHP 5.3 or lower'; - $data = array(); - - if ($token['type'] === 'T_OPEN_SHORT_ARRAY') { - $data[] = 'Short array syntax (open)'; - } elseif ($token['type'] === 'T_CLOSE_SHORT_ARRAY') { - $data[] = 'Short array syntax (close)'; - } - - $phpcsFile->addError($error, $stackPtr, 'Found', $data); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php deleted file mode 100644 index b2c29e5f..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedCurlyBraceArrayAccessSniff.php +++ /dev/null @@ -1,362 +0,0 @@ -newArrayStringDereferencing = new NewArrayStringDereferencingSniff(); - $this->newClassMemberAccess = new NewClassMemberAccessSniff(); - $this->newFunctionArrayDereferencing = new NewFunctionArrayDereferencingSniff(); - } - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.3.0 - * - * @return array - */ - public function register() - { - $targets = array( - array( - \T_VARIABLE, - \T_STRING, // Constants. - ), - ); - - // Registers T_ARRAY, T_OPEN_SHORT_ARRAY and T_CONSTANT_ENCAPSED_STRING. - $additionalTargets = $this->newArrayStringDereferencing->register(); - $this->newArrayStringDereferencingTargets = array_flip($additionalTargets); - $targets[] = $additionalTargets; - - // Registers T_NEW and T_CLONE. - $additionalTargets = $this->newClassMemberAccess->register(); - $this->newClassMemberAccessTargets = array_flip($additionalTargets); - $targets[] = $additionalTargets; - - // Registers T_STRING. - $additionalTargets = $this->newFunctionArrayDereferencing->register(); - $this->newFunctionArrayDereferencingTargets = array_flip($additionalTargets); - $targets[] = $additionalTargets; - - return call_user_func_array('array_merge', $targets); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.4') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $braces = array(); - - // Note: Overwriting braces in each `if` is fine as only one will match anyway. - if ($tokens[$stackPtr]['code'] === \T_VARIABLE) { - $braces = $this->isVariableArrayAccess($phpcsFile, $stackPtr); - } - - if (isset($this->newArrayStringDereferencingTargets[$tokens[$stackPtr]['code']])) { - $dereferencing = $this->newArrayStringDereferencing->isArrayStringDereferencing($phpcsFile, $stackPtr); - if (isset($dereferencing['braces'])) { - $braces = $dereferencing['braces']; - } - } - - if (isset($this->newClassMemberAccessTargets[$tokens[$stackPtr]['code']])) { - $braces = $this->newClassMemberAccess->isClassMemberAccess($phpcsFile, $stackPtr); - } - - if (isset($this->newFunctionArrayDereferencingTargets[$tokens[$stackPtr]['code']])) { - $braces = $this->newFunctionArrayDereferencing->isFunctionArrayDereferencing($phpcsFile, $stackPtr); - } - - if (empty($braces) && $tokens[$stackPtr]['code'] === \T_STRING) { - $braces = $this->isConstantArrayAccess($phpcsFile, $stackPtr); - } - - if (empty($braces)) { - return; - } - - foreach ($braces as $open => $close) { - // Some of the functions will sniff for both curlies as well as square braces. - if ($tokens[$open]['code'] !== \T_OPEN_CURLY_BRACKET) { - continue; - } - - // Make sure there is something between the braces, otherwise it's still not curly brace array access. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($open + 1), $close, true); - if ($nextNonEmpty === false) { - // Nothing between the brackets. Parse error. Ignore. - continue; - } - - // OK, so we've found curly brace array access. - $snippet = $phpcsFile->getTokensAsString($stackPtr, (($close - $stackPtr) + 1)); - $fix = $phpcsFile->addFixableWarning( - 'Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4. Found: %s', - $open, - 'Found', - array($snippet) - ); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($open, '['); - $phpcsFile->fixer->replaceToken($close, ']'); - $phpcsFile->fixer->endChangeset(); - } - } - } - - - /** - * Determine whether a variable is being dereferenced using curly brace syntax. - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return array An array with the stack pointers to the open/close braces of - * the curly brace array access, or an empty array if no curly - * brace array access was detected. - */ - protected function isVariableArrayAccess(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $current = $stackPtr; - $braces = array(); - - do { - $current = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), null, true); - if ($current === false) { - break; - } - - // Skip over square bracket array access. Bracket styles can be mixed. - if ($tokens[$current]['code'] === \T_OPEN_SQUARE_BRACKET - && isset($tokens[$current]['bracket_closer']) === true - && $current === $tokens[$current]['bracket_opener'] - ) { - $current = $tokens[$current]['bracket_closer']; - continue; - } - - // Handle property access. - if ($tokens[$current]['code'] === \T_OBJECT_OPERATOR) { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), null, true); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_STRING) { - // Live coding or parse error. - break; - } - - $current = $nextNonEmpty; - continue; - } - - if ($tokens[$current]['code'] === \T_OPEN_CURLY_BRACKET) { - if (isset($tokens[$current]['bracket_closer']) === false) { - // Live coding or parse error. - break; - } - - $braces[$current] = $tokens[$current]['bracket_closer']; - - // Continue, just in case there is nested access using curly braces, i.e. `$a{$i}{$j};`. - $current = $tokens[$current]['bracket_closer']; - continue; - } - - // If we're still here, we've reached the end of the variable. - break; - - } while (true); - - return $braces; - } - - - /** - * Determine whether a T_STRING is a constant being dereferenced using curly brace syntax. - * - * {@internal Note: the first braces for array access to a constant, for some unknown reason, - * can never be curlies, but have to be square brackets. - * Subsequent braces can be curlies.} - * - * @since 9.3.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return array An array with the stack pointers to the open/close braces of - * the curly brace array access, or an empty array if no curly - * brace array access was detected. - */ - protected function isConstantArrayAccess(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - if ($this->isUseOfGlobalConstant($phpcsFile, $stackPtr) === false - && $tokens[$prevNonEmpty]['code'] !== \T_DOUBLE_COLON // Class constant access. - ) { - return array(); - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return array(); - } - - if ($tokens[$nextNonEmpty]['code'] !== \T_OPEN_SQUARE_BRACKET - || isset($tokens[$nextNonEmpty]['bracket_closer']) === false - ) { - // Array access for constants must start with square brackets. - return array(); - } - - $current = $tokens[$nextNonEmpty]['bracket_closer']; - $braces = array(); - - do { - $current = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), null, true); - if ($current === false) { - break; - } - - // Skip over square bracket array access. Bracket styles can be mixed. - if ($tokens[$current]['code'] === \T_OPEN_SQUARE_BRACKET - && isset($tokens[$current]['bracket_closer']) === true - && $current === $tokens[$current]['bracket_opener'] - ) { - $current = $tokens[$current]['bracket_closer']; - continue; - } - - if ($tokens[$current]['code'] === \T_OPEN_CURLY_BRACKET) { - if (isset($tokens[$current]['bracket_closer']) === false) { - // Live coding or parse error. - break; - } - - $braces[$current] = $tokens[$current]['bracket_closer']; - - // Continue, just in case there is nested access using curly braces, i.e. `$a{$i}{$j};`. - $current = $tokens[$current]['bracket_closer']; - continue; - } - - // If we're still here, we've reached the end of the variable. - break; - - } while (true); - - return $braces; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php deleted file mode 100644 index ad76828c..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/RemovedNewReferenceSniff.php +++ /dev/null @@ -1,80 +0,0 @@ -supportsAbove('5.3') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prevNonEmpty === false || $tokens[$prevNonEmpty]['type'] !== 'T_BITWISE_AND') { - return; - } - - $error = 'Assigning the return value of new by reference is deprecated in PHP 5.3'; - $isError = false; - $errorCode = 'Deprecated'; - - if ($this->supportsAbove('7.0') === true) { - $error .= ' and has been removed in PHP 7.0'; - $isError = true; - $errorCode = 'Removed'; - } - - $this->addMessage($phpcsFile, $error, $stackPtr, $isError, $errorCode); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php deleted file mode 100644 index aa5a39a3..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TextStrings/NewUnicodeEscapeSequenceSniff.php +++ /dev/null @@ -1,162 +0,0 @@ -getTokens(); - - // Check whether this is a single quoted or double quoted string. - if ($tokens[$stackPtr]['code'] === \T_CONSTANT_ENCAPSED_STRING) { - - // Find the start of the - potentially multi-line - text string. - $start = $stackPtr; - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - if ($tokens[$i]['code'] === \T_WHITESPACE) { - continue; - } - - if ($tokens[$i]['code'] === \T_CONSTANT_ENCAPSED_STRING) { - $start = $i; - continue; - } - - break; - } - - try { - $textString = $this->getCompleteTextString($phpcsFile, $start, false); - } catch (PHPCS_Exception $e) { - // Something went wrong determining the start of the text string. - return; - } - - $startQuote = $textString[0]; - $endQuote = substr($textString, -1); - if (($startQuote === "'" && $endQuote === "'") - || $startQuote !== $endQuote - ) { - // Single quoted string, not our concern. - return; - } - } - - $content = $this->stripQuotes($tokens[$stackPtr]['content']); - $count = preg_match_all('`(?isValidUnicodeEscapeSequence($match[1]); - } - - if ($this->supportsBelow('5.6') === true && $valid === true) { - $phpcsFile->addError( - 'Unicode codepoint escape sequences are not supported in PHP 5.6 or earlier. Found: %s', - $stackPtr, - 'Found', - array($match[0]) - ); - } - - if ($this->supportsAbove('7.0') === true && $valid === false) { - $phpcsFile->addError( - 'Strings containing a literal \u{ followed by an invalid unicode codepoint escape sequence will cause a fatal error in PHP 7.0 and above. Escape the leading backslash to prevent this. Found: %s', - $stackPtr, - 'Invalid', - array($match[0]) - ); - } - } - } - - - /** - * Verify if the codepoint in a unicode escape sequence is valid. - * - * @since 9.3.0 - * - * @param string $codepoint The codepoint as a string. - * - * @return bool - */ - protected function isValidUnicodeEscapeSequence($codepoint) - { - if (trim($codepoint) === '') { - return false; - } - - // Check if it's a valid hex codepoint. - if (preg_match('`^[0-9A-F]+$`iD', $codepoint, $match) !== 1) { - return false; - } - - if (hexdec($codepoint) > 1114111) { - // Outside of the maximum permissable range. - return false; - } - - return true; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php deleted file mode 100644 index 12e47318..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/NewTypeCastsSniff.php +++ /dev/null @@ -1,222 +0,0 @@ - array(string => bool|string)) - */ - protected $newTypeCasts = array( - 'T_UNSET_CAST' => array( - '4.4' => false, - '5.0' => true, - 'description' => 'The unset cast', - ), - 'T_BINARY_CAST' => array( - '5.2.0' => false, - '5.2.1' => true, - 'description' => 'The binary cast', - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.0.1 - * - * @return array - */ - public function register() - { - $tokens = array(); - foreach ($this->newTypeCasts as $token => $versions) { - if (\defined($token)) { - $tokens[] = constant($token); - } - } - - /* - * Work around tokenizer issues. - * - * - (binary) cast is incorrectly tokenized as T_STRING_CAST by PHP and PHPCS. - * - b"something" binary cast is incorrectly tokenized as T_CONSTANT_ENCAPSED_STRING by PHP and PHPCS. - * - Since PHPCS 3.4.0, PHPCS *will* tokenize these correctly. - * - * @link https://github.com/squizlabs/PHP_CodeSniffer/issues/1574 - */ - if (version_compare(PHPCSHelper::getVersion(), '3.4.0', '<') === true) { - $tokens[] = \T_STRING_CAST; - $tokens[] = \T_CONSTANT_ENCAPSED_STRING; - } - - return $tokens; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.0.1 - * - * @param \PHP_CodeSniffer_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(); - $tokenType = $tokens[$stackPtr]['type']; - - // Detect incorrectly tokenized binary casts. - if (isset($this->newTypeCasts[$tokenType]) === false) { - $tokenContent = $tokens[$stackPtr]['content']; - switch ($tokenType) { - case 'T_STRING_CAST': - if (preg_match('`^\(\s*binary\s*\)$`i', $tokenContent) !== 1) { - return; - } - - $tokenType = 'T_BINARY_CAST'; - break; - - case 'T_CONSTANT_ENCAPSED_STRING': - if ((strpos($tokenContent, 'b"') === 0 && substr($tokenContent, -1) === '"') - || (strpos($tokenContent, "b'") === 0 && substr($tokenContent, -1) === "'") - ) { - $tokenType = 'T_BINARY_CAST'; - } else { - return; - } - break; - - } - } - - // If the translation did not yield one of the tokens we are looking for, bow out. - if (isset($this->newTypeCasts[$tokenType]) === false) { - return; - } - - $itemInfo = array( - 'name' => $tokenType, - 'content' => $tokens[$stackPtr]['content'], - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 8.0.1 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->newTypeCasts[$itemInfo['name']]; - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 8.0.1 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array('description'); - } - - - /** - * Retrieve the relevant detail (version) information for use in an error message. - * - * @since 8.0.1 - * - * @param array $itemArray Version and other information about the item. - * @param array $itemInfo Base information about the item. - * - * @return array - */ - public function getErrorInfo(array $itemArray, array $itemInfo) - { - $errorInfo = parent::getErrorInfo($itemArray, $itemInfo); - $errorInfo['description'] = $itemArray['description']; - - return $errorInfo; - } - - - /** - * Filter the error message before it's passed to PHPCS. - * - * @since 8.0.1 - * - * @param string $error The error message which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return string - */ - protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) - { - return $error . '. Found: %s'; - } - - - /** - * Filter the error data before it's passed to PHPCS. - * - * @since 8.0.1 - * - * @param array $data The error data array which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return array - */ - protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) - { - $data[0] = $errorInfo['description']; - $data[] = $itemInfo['content']; - return $data; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php deleted file mode 100644 index 3791f0b5..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/TypeCasts/RemovedTypeCastsSniff.php +++ /dev/null @@ -1,158 +0,0 @@ - array(string => bool|string)) - */ - protected $deprecatedTypeCasts = array( - 'T_UNSET_CAST' => array( - '7.2' => false, - 'alternative' => 'unset()', - 'description' => 'unset', - ), - 'T_DOUBLE_CAST' => array( - '7.4' => false, - 'alternative' => '(float)', - 'description' => 'real', - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.0.1 - * - * @return array - */ - public function register() - { - $tokens = array(); - foreach ($this->deprecatedTypeCasts as $token => $versions) { - $tokens[] = constant($token); - } - - return $tokens; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.0.1 - * - * @param \PHP_CodeSniffer_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(); - $tokenType = $tokens[$stackPtr]['type']; - - // Special case `T_DOUBLE_CAST` as the same token is used for (float) and (double) casts. - if ($tokenType === 'T_DOUBLE_CAST' && strpos($tokens[$stackPtr]['content'], 'real') === false) { - // Float/double casts, not (real) cast. - return; - } - - $itemInfo = array( - 'name' => $tokenType, - 'description' => $this->deprecatedTypeCasts[$tokenType]['description'], - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get an array of the non-PHP-version array keys used in a sub-array. - * - * @since 8.0.1 - * - * @return array - */ - protected function getNonVersionArrayKeys() - { - return array('description', 'alternative'); - } - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 8.0.1 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->deprecatedTypeCasts[$itemInfo['name']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 8.0.1 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return 'The %s cast is '; - } - - - /** - * Filter the error data before it's passed to PHPCS. - * - * @since 8.0.1 - * - * @param array $data The error data array which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return array - */ - protected function filterErrorData(array $data, array $itemInfo, array $errorInfo) - { - $data[0] = $itemInfo['description']; - return $data; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php deleted file mode 100644 index 1e79873c..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPCSSniff.php +++ /dev/null @@ -1,187 +0,0 @@ -examine === false) { - return ($phpcsFile->numTokens + 1); - } - - $phpcsVersion = PHPCSHelper::getVersion(); - - // Don't do anything if the PHPCS version used is above the minimum recommended version. - if (version_compare($phpcsVersion, self::MIN_RECOMMENDED_VERSION, '>=')) { - $this->examine = false; - return ($phpcsFile->numTokens + 1); - } - - if (version_compare($phpcsVersion, self::MIN_SUPPORTED_VERSION, '<')) { - $isError = true; - $message = 'IMPORTANT: Please be advised that the minimum PHP_CodeSniffer version the PHPCompatibility standard supports is %s. You are currently using PHP_CodeSniffer %s. Please upgrade your PHP_CodeSniffer installation. The recommended version of PHP_CodeSniffer for PHPCompatibility is %s or higher.'; - $errorCode = 'Unsupported_' . $this->stringToErrorCode(self::MIN_SUPPORTED_VERSION); - $replacements = array( - self::MIN_SUPPORTED_VERSION, - $phpcsVersion, - self::MIN_RECOMMENDED_VERSION, - $errorCode, - ); - } else { - $isError = false; - $message = 'IMPORTANT: Please be advised that for the most reliable PHPCompatibility results, PHP_CodeSniffer %s or higher should be used. Support for lower versions will be dropped in the foreseeable future. You are currently using PHP_CodeSniffer %s. Please upgrade your PHP_CodeSniffer installation to version %s or higher.'; - $errorCode = 'BelowRecommended_' . $this->stringToErrorCode(self::MIN_RECOMMENDED_VERSION); - $replacements = array( - self::MIN_RECOMMENDED_VERSION, - $phpcsVersion, - self::MIN_RECOMMENDED_VERSION, - $errorCode, - ); - } - - /* - * Figure out the report width to determine how long the delimiter lines should be. - * - * This is not an exact calculation as there are a number of unknowns at the time the - * notice is thrown (whether there are other notices for the file, whether those are - * warnings or errors, whether there are auto-fixable issues etc). - * - * In other words, this is just an approximation to get a reasonably stable and - * readable message layout format. - * - * {@internal - * PHPCS has had some changes as to how the messages display over the years. - * Most significantly in 2.4.0 it was attempted to solve an issue with messages - * containing new lines. Unfortunately, that solution is buggy. - * An improved version has been pulled upstream and will hopefully make it - * into PHPCS 3.3.1/3.4.0. - * - * Anyway, this means that instead of new lines, delimiter lines will be used to improved - * the readability of the (long) message. - * - * Also, as of PHPCS 2.2.0, the report width when using the `-s` option is 8 wider than - * it should be. A patch for that is included in the same upstream PR. - * - * If/when the upstream PR has been merged and the minimum supported/recommended version - * of PHPCompatibility would go beyond that, the below code should be adjusted.} - */ - $reportWidth = PHPCSHelper::getCommandLineData($phpcsFile, 'reportWidth'); - if (empty($reportWidth)) { - $reportWidth = 80; - } - $showSources = PHPCSHelper::getCommandLineData($phpcsFile, 'showSources'); - if ($showSources === true) { - $reportWidth += 6; - } - - $messageWidth = ($reportWidth - 15); // 15 is length of " # | WARNING | ". - $delimiterLine = str_repeat('-', ($messageWidth)); - $disableNotice = 'To disable this notice, add --exclude=PHPCompatibility.Upgrade.LowPHPCS to your command or add to your custom ruleset. '; - $thankYou = 'Thank you for using PHPCompatibility!'; - - $message .= ' ' . $delimiterLine; - $message .= ' ' . $disableNotice; - $message .= ' ' . $delimiterLine; - $message .= ' ' . $thankYou; - - $this->addMessage($phpcsFile, $message, 0, $isError, $errorCode, $replacements); - - $this->examine = false; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php deleted file mode 100644 index 7a171633..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Upgrade/LowPHPSniff.php +++ /dev/null @@ -1,182 +0,0 @@ -examine === false) { - return ($phpcsFile->numTokens + 1); - } - - $phpVersion = phpversion(); - - // Don't do anything if the PHPCS version used is above the minimum recommended version. - if (version_compare($phpVersion, self::MIN_RECOMMENDED_VERSION, '>=')) { - $this->examine = false; - return ($phpcsFile->numTokens + 1); - } - - if (version_compare($phpVersion, self::MIN_SUPPORTED_VERSION, '<')) { - $isError = true; - $message = 'IMPORTANT: Please be advised that the minimum PHP version the PHPCompatibility standard supports is %s. You are currently using PHP %s. Please upgrade your PHP installation. The recommended version of PHP for PHPCompatibility is %s or higher.'; - $errorCode = 'Unsupported_' . $this->stringToErrorCode(self::MIN_SUPPORTED_VERSION); - $replacements = array( - self::MIN_SUPPORTED_VERSION, - $phpVersion, - self::MIN_RECOMMENDED_VERSION, - $errorCode, - ); - } else { - $isError = false; - $message = 'IMPORTANT: Please be advised that for the most reliable PHPCompatibility results, PHP %s or higher should be used. Support for lower versions will be dropped in the foreseeable future. You are currently using PHP %s. Please upgrade your PHP installation to version %s or higher.'; - $errorCode = 'BelowRecommended_' . $this->stringToErrorCode(self::MIN_RECOMMENDED_VERSION); - $replacements = array( - self::MIN_RECOMMENDED_VERSION, - $phpVersion, - self::MIN_RECOMMENDED_VERSION, - $errorCode, - ); - } - - /* - * Figure out the report width to determine how long the delimiter lines should be. - * - * This is not an exact calculation as there are a number of unknowns at the time the - * notice is thrown (whether there are other notices for the file, whether those are - * warnings or errors, whether there are auto-fixable issues etc). - * - * In other words, this is just an approximation to get a reasonably stable and - * readable message layout format. - * - * {@internal - * PHPCS has had some changes as to how the messages display over the years. - * Most significantly in 2.4.0 it was attempted to solve an issue with messages - * containing new lines. Unfortunately, that solution is buggy. - * An improved version has been pulled upstream and will hopefully make it - * into PHPCS 3.3.1/3.4.0. - * - * Anyway, this means that instead of new lines, delimiter lines will be used to improved - * the readability of the (long) message. - * - * Also, as of PHPCS 2.2.0, the report width when using the `-s` option is 8 wider than - * it should be. A patch for that is included in the same upstream PR. - * - * If/when the upstream PR has been merged and the minimum supported/recommended version - * of PHPCompatibility would go beyond that, the below code should be adjusted.} - */ - $reportWidth = PHPCSHelper::getCommandLineData($phpcsFile, 'reportWidth'); - if (empty($reportWidth)) { - $reportWidth = 80; - } - $showSources = PHPCSHelper::getCommandLineData($phpcsFile, 'showSources'); - if ($showSources === true) { - $reportWidth += 6; - } - - $messageWidth = ($reportWidth - 15); // 15 is length of " # | WARNING | ". - $delimiterLine = str_repeat('-', ($messageWidth)); - $disableNotice = 'To disable this notice, add --exclude=PHPCompatibility.Upgrade.LowPHP to your command or add to your custom ruleset. '; - $thankYou = 'Thank you for using PHPCompatibility!'; - - $message .= ' ' . $delimiterLine; - $message .= ' ' . $disableNotice; - $message .= ' ' . $delimiterLine; - $message .= ' ' . $thankYou; - - $this->addMessage($phpcsFile, $message, 0, $isError, $errorCode, $replacements); - - $this->examine = false; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php deleted file mode 100644 index a681a4a3..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewGroupUseDeclarationsSniff.php +++ /dev/null @@ -1,118 +0,0 @@ -supportsBelow('7.1') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $token = $tokens[$stackPtr]; - - // Deal with PHPCS pre-2.6.0. - if ($token['code'] === \T_USE) { - $hasCurlyBrace = $phpcsFile->findNext(\T_OPEN_CURLY_BRACKET, ($stackPtr + 1), null, false, null, true); - if ($hasCurlyBrace === false) { - return; - } - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($hasCurlyBrace - 1), null, true); - if ($prevToken === false || $tokens[$prevToken]['code'] !== \T_NS_SEPARATOR) { - return; - } - - $stackPtr = $hasCurlyBrace; - } - - // Still here ? In that case, it is a group use statement. - if ($this->supportsBelow('5.6') === true) { - $phpcsFile->addError( - 'Group use declarations are not allowed in PHP 5.6 or earlier', - $stackPtr, - 'Found' - ); - } - - $closers = array(\T_CLOSE_CURLY_BRACKET); - if (\defined('T_CLOSE_USE_GROUP')) { - $closers[] = \T_CLOSE_USE_GROUP; - } - - $closeCurly = $phpcsFile->findNext($closers, ($stackPtr + 1), null, false, null, true); - if ($closeCurly === false) { - return; - } - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closeCurly - 1), null, true); - if ($tokens[$prevToken]['code'] === \T_COMMA) { - $phpcsFile->addError( - 'Trailing comma\'s are not allowed in group use statements in PHP 7.1 or earlier', - $prevToken, - 'TrailingCommaFound' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php deleted file mode 100644 index 2d166fb5..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/UseDeclarations/NewUseConstFunctionSniff.php +++ /dev/null @@ -1,109 +0,0 @@ - string) - */ - protected $validUseNames = array( - 'const' => true, - 'function' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 7.1.4 - * - * @return array - */ - public function register() - { - return array(\T_USE); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 7.1.4 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsBelow('5.5') !== true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - // Live coding. - return; - } - - if (isset($this->validUseNames[strtolower($tokens[$nextNonEmpty]['content'])]) === false) { - // Not a `use const` or `use function` statement. - return; - } - - // `use const` and `use function` have to be followed by the function/constant name. - $functionOrConstName = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true); - if ($functionOrConstName === false - // Identifies as T_AS or T_STRING, this covers both. - || ($tokens[$functionOrConstName]['content'] === 'as' - || $tokens[$functionOrConstName]['code'] === \T_COMMA) - ) { - // Live coding or incorrect use of reserved keyword, but that is - // covered by the ForbiddenNames sniff. - return; - } - - // Still here ? In that case we have encountered a `use const` or `use function` statement. - $phpcsFile->addError( - 'Importing functions and constants through a "use" statement is not supported in PHP 5.5 or lower.', - $nextNonEmpty, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php deleted file mode 100644 index c7f715d2..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenGlobalVariableVariableSniff.php +++ /dev/null @@ -1,125 +0,0 @@ -supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $endOfStatement = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($stackPtr + 1)); - if ($endOfStatement === false) { - // No semi-colon - live coding. - return; - } - - for ($ptr = ($stackPtr + 1); $ptr <= $endOfStatement; $ptr++) { - $errorThrown = false; - $nextComma = $phpcsFile->findNext(\T_COMMA, $ptr, $endOfStatement, false, null, true); - $varEnd = ($nextComma === false) ? $endOfStatement : $nextComma; - $variable = $phpcsFile->findNext(\T_VARIABLE, $ptr, $varEnd); - $varString = trim($phpcsFile->getTokensAsString($ptr, ($varEnd - $ptr))); - $data = array($varString); - - if ($variable !== false) { - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($variable - 1), $ptr, true); - - if ($prev !== false && $tokens[$prev]['type'] === 'T_DOLLAR') { - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($variable + 1), $varEnd, true); - - if ($next !== false - && \in_array($tokens[$next]['code'], array(\T_OPEN_SQUARE_BRACKET, \T_OBJECT_OPERATOR, \T_DOUBLE_COLON), true) === true - ) { - $phpcsFile->addError( - 'Global with variable variables is not allowed since PHP 7.0. Found %s', - $variable, - 'Found', - $data - ); - $errorThrown = true; - } else { - $phpcsFile->addWarning( - 'Global with anything other than bare variables is discouraged since PHP 7.0. Found %s', - $variable, - 'NonBareVariableFound', - $data - ); - $errorThrown = true; - } - } - } - - if ($errorThrown === false) { - $dollar = $phpcsFile->findNext(\T_DOLLAR, $ptr, $varEnd); - if ($dollar !== false) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($dollar + 1), $varEnd, true); - if ($tokens[$next]['code'] === \T_OPEN_CURLY_BRACKET) { - $phpcsFile->addWarning( - 'Global with anything other than bare variables is discouraged since PHP 7.0. Found %s', - $dollar, - 'NonBareVariableFound', - $data - ); - } - } - } - - // Move the stack pointer forward to the next variable for multi-variable statements. - if ($nextComma === false) { - break; - } - $ptr = $nextComma; - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php deleted file mode 100644 index fc0ddc65..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/ForbiddenThisUseContextsSniff.php +++ /dev/null @@ -1,425 +0,0 @@ - \T_CLASS, - 'T_INTERFACE' => \T_INTERFACE, - 'T_TRAIT' => \T_TRAIT, - ); - - /** - * Scopes to skip over when examining the contents of functions. - * - * @since 9.1.0 - * - * @var array - */ - private $skipOverScopes = array( - 'T_FUNCTION' => true, - 'T_CLOSURE' => true, - ); - - /** - * Valid uses of $this in plain functions or methods outside object context. - * - * @since 9.1.0 - * - * @var array - */ - private $validUseOutsideObject = array( - \T_ISSET => true, - \T_EMPTY => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 9.1.0 - * - * @return array - */ - public function register() - { - if (\defined('T_ANON_CLASS')) { - $this->ooScopeTokens['T_ANON_CLASS'] = \T_ANON_CLASS; - } - - $this->skipOverScopes += $this->ooScopeTokens; - - return array( - \T_FUNCTION, - \T_CLOSURE, - \T_GLOBAL, - \T_CATCH, - \T_FOREACH, - \T_UNSET, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 9.1.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('7.1') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - switch ($tokens[$stackPtr]['code']) { - case \T_FUNCTION: - $this->isThisUsedAsParameter($phpcsFile, $stackPtr); - $this->isThisUsedOutsideObjectContext($phpcsFile, $stackPtr); - break; - - case \T_CLOSURE: - $this->isThisUsedAsParameter($phpcsFile, $stackPtr); - break; - - case \T_GLOBAL: - /* - * $this can no longer be imported using the `global` keyword. - * This worked in PHP 7.0, though in PHP 5.x, it would throw a - * fatal "Cannot re-assign $this" error. - */ - $endOfStatement = $phpcsFile->findNext(array(\T_SEMICOLON, \T_CLOSE_TAG), ($stackPtr + 1)); - if ($endOfStatement === false) { - // No semi-colon - live coding. - return; - } - - for ($i = ($stackPtr + 1); $i < $endOfStatement; $i++) { - if ($tokens[$i]['code'] !== \T_VARIABLE || $tokens[$i]['content'] !== '$this') { - continue; - } - - $phpcsFile->addError( - '"$this" can no longer be used with the "global" keyword since PHP 7.1.', - $i, - 'Global' - ); - } - - break; - - case \T_CATCH: - /* - * $this can no longer be used as a catch variable. - */ - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { - return; - } - - $varPtr = $phpcsFile->findNext( - \T_VARIABLE, - ($tokens[$stackPtr]['parenthesis_opener'] + 1), - $tokens[$stackPtr]['parenthesis_closer'] - ); - - if ($varPtr === false || $tokens[$varPtr]['content'] !== '$this') { - return; - } - - $phpcsFile->addError( - '"$this" can no longer be used as a catch variable since PHP 7.1.', - $varPtr, - 'Catch' - ); - - break; - - case \T_FOREACH: - /* - * $this can no longer be used as a foreach *value* variable. - * This worked in PHP 7.0, though in PHP 5.x, it would throw a - * fatal "Cannot re-assign $this" error. - */ - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { - return; - } - - $stopPtr = $phpcsFile->findPrevious( - array(\T_AS, \T_DOUBLE_ARROW), - ($tokens[$stackPtr]['parenthesis_closer'] - 1), - $tokens[$stackPtr]['parenthesis_opener'] - ); - if ($stopPtr === false) { - return; - } - - $valueVarPtr = $phpcsFile->findNext( - \T_VARIABLE, - ($stopPtr + 1), - $tokens[$stackPtr]['parenthesis_closer'] - ); - if ($valueVarPtr === false || $tokens[$valueVarPtr]['content'] !== '$this') { - return; - } - - $afterThis = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($valueVarPtr + 1), - $tokens[$stackPtr]['parenthesis_closer'], - true - ); - - if ($afterThis !== false - && ($tokens[$afterThis]['code'] === \T_OBJECT_OPERATOR - || $tokens[$afterThis]['code'] === \T_DOUBLE_COLON) - ) { - return; - } - - $phpcsFile->addError( - '"$this" can no longer be used as value variable in a foreach control structure since PHP 7.1.', - $valueVarPtr, - 'ForeachValueVar' - ); - - break; - - case \T_UNSET: - /* - * $this can no longer be unset. - */ - $openParenthesis = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($openParenthesis === false - || $tokens[$openParenthesis]['code'] !== \T_OPEN_PARENTHESIS - || isset($tokens[$openParenthesis]['parenthesis_closer']) === false - ) { - return; - } - - for ($i = ($openParenthesis + 1); $i < $tokens[$openParenthesis]['parenthesis_closer']; $i++) { - if ($tokens[$i]['code'] !== \T_VARIABLE || $tokens[$i]['content'] !== '$this') { - continue; - } - - $afterThis = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($i + 1), - $tokens[$openParenthesis]['parenthesis_closer'], - true - ); - - if ($afterThis !== false - && ($tokens[$afterThis]['code'] === \T_OBJECT_OPERATOR - || $tokens[$afterThis]['code'] === \T_DOUBLE_COLON - || $tokens[$afterThis]['code'] === \T_OPEN_SQUARE_BRACKET) - ) { - $i = $afterThis; - continue; - } - - $phpcsFile->addError( - '"$this" can no longer be unset since PHP 7.1.', - $i, - 'Unset' - ); - } - - break; - } - } - - /** - * Check if $this is used as a parameter in a function declaration. - * - * $this can no longer be used as a parameter in a *global* function. - * Use as a parameter in a method was already an error prior to PHP 7.1. - * - * @since 9.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - protected function isThisUsedAsParameter(File $phpcsFile, $stackPtr) - { - if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) !== false) { - return; - } - - $params = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr); - if (empty($params)) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - foreach ($params as $param) { - if ($param['name'] !== '$this') { - continue; - } - - if ($tokens[$stackPtr]['code'] === \T_FUNCTION) { - $phpcsFile->addError( - '"$this" can no longer be used as a parameter since PHP 7.1.', - $param['token'], - 'FunctionParam' - ); - } else { - $phpcsFile->addError( - '"$this" can no longer be used as a closure parameter since PHP 7.0.7.', - $param['token'], - 'ClosureParam' - ); - } - } - } - - /** - * Check if $this is used in a plain function or method. - * - * Prior to PHP 7.1, this would result in an "undefined variable" notice - * and execution would continue with $this regarded as `null`. - * As of PHP 7.1, this throws an exception. - * - * Note: use within isset() and empty() to check object context is still allowed. - * Note: $this can still be used within a closure. - * - * @since 9.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - protected function isThisUsedOutsideObjectContext(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - if ($this->validDirectScope($phpcsFile, $stackPtr, $this->ooScopeTokens) !== false) { - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - if ($methodProps['is_static'] === false) { - return; - } else { - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === '__call') { - /* - * This is an exception. - * @link https://wiki.php.net/rfc/this_var#always_show_true_this_value_in_magic_method_call - */ - return; - } - } - } - - for ($i = ($tokens[$stackPtr]['scope_opener'] + 1); $i < $tokens[$stackPtr]['scope_closer']; $i++) { - if (isset($this->skipOverScopes[$tokens[$i]['type']])) { - if (isset($tokens[$i]['scope_closer']) === false) { - // Live coding or parse error, will only lead to inaccurate results. - return; - } - - // Skip over nested structures. - $i = $tokens[$i]['scope_closer']; - continue; - } - - if ($tokens[$i]['code'] !== \T_VARIABLE || $tokens[$i]['content'] !== '$this') { - continue; - } - - if (isset($tokens[$i]['nested_parenthesis']) === true) { - $nestedParenthesis = $tokens[$i]['nested_parenthesis']; - $nestedOpenParenthesis = array_keys($nestedParenthesis); - $lastOpenParenthesis = array_pop($nestedOpenParenthesis); - - $previousNonEmpty = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($lastOpenParenthesis - 1), - null, - true, - null, - true - ); - - if (isset($this->validUseOutsideObject[$tokens[$previousNonEmpty]['code']])) { - continue; - } - } - - $phpcsFile->addError( - '"$this" can no longer be used in a plain function or method since PHP 7.1.', - $i, - 'OutsideObjectContext' - ); - } - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php deleted file mode 100644 index f7948079..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/NewUniformVariableSyntaxSniff.php +++ /dev/null @@ -1,114 +0,0 @@ -supportsAbove('7.0') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - // Verify that the next token is a square open bracket. If not, bow out. - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true, null, true); - - if ($nextToken === false || $tokens[$nextToken]['code'] !== \T_OPEN_SQUARE_BRACKET || isset($tokens[$nextToken]['bracket_closer']) === false) { - return; - } - - // The previous non-empty token has to be a $, -> or ::. - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); - if ($prevToken === false || \in_array($tokens[$prevToken]['code'], array(\T_DOLLAR, \T_OBJECT_OPERATOR, \T_DOUBLE_COLON), true) === false) { - return; - } - - // For static object calls, it only applies when this is a function call. - if ($tokens[$prevToken]['code'] === \T_DOUBLE_COLON) { - $hasBrackets = $tokens[$nextToken]['bracket_closer']; - while (($hasBrackets = $phpcsFile->findNext(Tokens::$emptyTokens, ($hasBrackets + 1), null, true, null, true)) !== false) { - if ($tokens[$hasBrackets]['code'] === \T_OPEN_SQUARE_BRACKET) { - if (isset($tokens[$hasBrackets]['bracket_closer'])) { - $hasBrackets = $tokens[$hasBrackets]['bracket_closer']; - continue; - } else { - // Live coding. - return; - } - - } elseif ($tokens[$hasBrackets]['code'] === \T_OPEN_PARENTHESIS) { - // Caught! - break; - - } else { - // Not a function call, so bow out. - return; - } - } - - // Now let's also prevent false positives when used with self and static which still work fine. - $classToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), null, true, null, true); - if ($classToken !== false) { - if ($tokens[$classToken]['code'] === \T_STATIC || $tokens[$classToken]['code'] === \T_SELF) { - return; - } elseif ($tokens[$classToken]['code'] === \T_STRING && $tokens[$classToken]['content'] === 'self') { - return; - } - } - } - - $phpcsFile->addError( - 'Indirect access to variables, properties and methods will be evaluated strictly in left-to-right order since PHP 7.0. Use curly braces to remove ambiguity.', - $stackPtr, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php deleted file mode 100644 index c814e7dc..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Variables/RemovedPredefinedGlobalVariablesSniff.php +++ /dev/null @@ -1,318 +0,0 @@ - array(string => bool|string)) - */ - protected $removedGlobalVariables = array( - 'HTTP_POST_VARS' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_POST', - ), - 'HTTP_GET_VARS' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_GET', - ), - 'HTTP_ENV_VARS' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_ENV', - ), - 'HTTP_SERVER_VARS' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_SERVER', - ), - 'HTTP_COOKIE_VARS' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_COOKIE', - ), - 'HTTP_SESSION_VARS' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_SESSION', - ), - 'HTTP_POST_FILES' => array( - '5.3' => false, - '5.4' => true, - 'alternative' => '$_FILES', - ), - - 'HTTP_RAW_POST_DATA' => array( - '5.6' => false, - '7.0' => true, - 'alternative' => 'php://input', - ), - - 'php_errormsg' => array( - '7.2' => false, - 'alternative' => 'error_get_last()', - ), - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 5.5 - * @since 7.0 - * - * @return array - */ - public function register() - { - return array(\T_VARIABLE); - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 5.5 - * @since 7.0 - * - * @param \PHP_CodeSniffer_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) - { - if ($this->supportsAbove('5.3') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $varName = substr($tokens[$stackPtr]['content'], 1); - - if (isset($this->removedGlobalVariables[$varName]) === false) { - return; - } - - if ($this->isClassProperty($phpcsFile, $stackPtr) === true) { - // Ok, so this was a class property declaration, not our concern. - return; - } - - // Check for static usage of class properties shadowing the removed global variables. - if ($this->inClassScope($phpcsFile, $stackPtr, false) === true) { - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true); - if ($prevToken !== false && $tokens[$prevToken]['code'] === \T_DOUBLE_COLON) { - return; - } - } - - // Do some additional checks for the $php_errormsg variable. - if ($varName === 'php_errormsg' - && $this->isTargetPHPErrormsgVar($phpcsFile, $stackPtr, $tokens) === false - ) { - return; - } - - // Still here, so throw an error/warning. - $itemInfo = array( - 'name' => $varName, - ); - $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); - } - - - /** - * Get the relevant sub-array for a specific item from a multi-dimensional array. - * - * @since 7.1.0 - * - * @param array $itemInfo Base information about the item. - * - * @return array Version and other information about the item. - */ - public function getItemArray(array $itemInfo) - { - return $this->removedGlobalVariables[$itemInfo['name']]; - } - - - /** - * Get the error message template for this sniff. - * - * @since 7.1.0 - * - * @return string - */ - protected function getErrorMsgTemplate() - { - return "Global variable '\$%s' is "; - } - - - /** - * Filter the error message before it's passed to PHPCS. - * - * @since 8.1.0 - * - * @param string $error The error message which was created. - * @param array $itemInfo Base information about the item this error message applies to. - * @param array $errorInfo Detail information about an item this error message applies to. - * - * @return string - */ - protected function filterErrorMsg($error, array $itemInfo, array $errorInfo) - { - if ($itemInfo['name'] === 'php_errormsg') { - $error = str_replace('Global', 'The', $error); - } - return $error; - } - - /** - * Run some additional checks for the `$php_errormsg` variable. - * - * @since 8.1.0 - * - * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param array $tokens Token array of the current file. - * - * @return bool - */ - private function isTargetPHPErrormsgVar(File $phpcsFile, $stackPtr, array $tokens) - { - $scopeStart = 0; - - /* - * If the variable is detected within the scope of a function/closure, limit the checking. - */ - $function = $phpcsFile->getCondition($stackPtr, \T_CLOSURE); - if ($function === false) { - $function = $phpcsFile->getCondition($stackPtr, \T_FUNCTION); - } - - // It could also be a function param, which is not in the function scope. - if ($function === false && isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nestedParentheses = $tokens[$stackPtr]['nested_parenthesis']; - $parenthesisCloser = end($nestedParentheses); - if (isset($tokens[$parenthesisCloser]['parenthesis_owner']) - && ($tokens[$tokens[$parenthesisCloser]['parenthesis_owner']]['code'] === \T_FUNCTION - || $tokens[$tokens[$parenthesisCloser]['parenthesis_owner']]['code'] === \T_CLOSURE) - ) { - $function = $tokens[$parenthesisCloser]['parenthesis_owner']; - } - } - - if ($function !== false) { - $scopeStart = $tokens[$function]['scope_opener']; - } - - /* - * Now, let's do some additional checks. - */ - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - // Is the variable being used as an array ? - if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === \T_OPEN_SQUARE_BRACKET) { - // The PHP native variable is a string, so this is probably not it - // (except for array access to string, but why would you in this case ?). - return false; - } - - // Is this a variable assignment ? - if ($nextNonEmpty !== false - && isset(Tokens::$assignmentTokens[$tokens[$nextNonEmpty]['code']]) === true - ) { - return false; - } - - // Is this a function param shadowing the PHP native one ? - if ($function !== false) { - $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $function); - if (\is_array($parameters) === true && empty($parameters) === false) { - foreach ($parameters as $param) { - if ($param['name'] === '$php_errormsg') { - return false; - } - } - } - } - - $skipPast = array( - 'T_CLASS' => true, - 'T_ANON_CLASS' => true, - 'T_INTERFACE' => true, - 'T_TRAIT' => true, - 'T_FUNCTION' => true, - 'T_CLOSURE' => true, - ); - - // Walk back and see if there is an assignment to the variable within the same scope. - for ($i = ($stackPtr - 1); $i >= $scopeStart; $i--) { - if ($tokens[$i]['code'] === \T_CLOSE_CURLY_BRACKET - && isset($tokens[$i]['scope_condition']) - && isset($skipPast[$tokens[$tokens[$i]['scope_condition']]['type']]) - ) { - // Skip past functions, classes etc. - $i = $tokens[$i]['scope_condition']; - continue; - } - - if ($tokens[$i]['code'] !== \T_VARIABLE || $tokens[$i]['content'] !== '$php_errormsg') { - continue; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - - if ($nextNonEmpty !== false - && isset(Tokens::$assignmentTokens[$tokens[$nextNonEmpty]['code']]) === true - ) { - return false; - } - } - - return true; - } -} diff --git a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml b/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml deleted file mode 100644 index 3eb0b673..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/PHPCompatibility/ruleset.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - Coding Standard that checks for PHP version compatibility. - - ./../PHPCSAliases.php - - diff --git a/trunk/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php b/trunk/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php deleted file mode 100644 index f66ec0cf..00000000 --- a/trunk/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php +++ /dev/null @@ -1,86 +0,0 @@ -=') - && class_exists('PHPUnit_Framework_TestCase') === false -) { - class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase'); -} - -require_once __DIR__ . $ds . 'PHPCompatibility' . $ds . 'Tests' . $ds . 'BaseSniffTest.php'; -require_once __DIR__ . $ds . 'PHPCompatibility' . $ds . 'Util' . $ds . 'Tests' . $ds . 'CoreMethodTestFrame.php'; -unset($ds, $phpcsDir, $vendorDir); diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/LICENSE b/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/LICENSE deleted file mode 100644 index 65c5ca88..00000000 --- a/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat/ruleset.xml b/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat/ruleset.xml deleted file mode 100644 index e67a12e0..00000000 --- a/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieRandomCompat/ruleset.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Paragonie random_compat library. - - - - - - - - - - - - - - - - - - - /random_compat/lib/byte_safe_strings\.php$ - - - /random_compat/lib/random_bytes_dev_urandom\.php$ - - - /random_compat/lib/random_bytes_mcrypt\.php$ - - - /random_compat/lib/random_bytes_mcrypt\.php$ - - - /random_compat/lib/random_bytes_mcrypt\.php$ - - - /random_compat/lib/random_bytes_libsodium\.php$ - - - diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieSodiumCompat/ruleset.xml b/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieSodiumCompat/ruleset.xml deleted file mode 100644 index ee1f6ab5..00000000 --- a/trunk/vendor/phpcompatibility/phpcompatibility-paragonie/PHPCompatibilityParagonieSodiumCompat/ruleset.xml +++ /dev/null @@ -1,245 +0,0 @@ - - - PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Paragonie sodium_compat library. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /sodium_compat/autoload\.php$ - - - /sodium_compat/src/Core(32)?/Curve25519/Fe\.php$ - /sodium_compat/src/Core/AES/Block\.php$ - - - /sodium_compat/src/Core/Util\.php$ - - - /sodium_compat/src/Core/Util\.php$ - - - /sodium_compat/src/Compat\.php$ - - - /sodium_compat/src/Compat\.php$ - - - /sodium_compat/src/Compat\.php$ - - - /sodium_compat/src/Compat\.php$ - - - /sodium_compat/src/Compat\.php$ - - - /sodium_compat/src/Compat\.php$ - - - /sodium_compat/src/Compat\.php$ - - - /sodium_compat/src/Compat\.php$ - - - /sodium_compat/src/Compat\.php$ - - - /sodium_compat/src/Core/Util\.php$ - - - diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-wp/LICENSE b/trunk/vendor/phpcompatibility/phpcompatibility-wp/LICENSE deleted file mode 100644 index 65c5ca88..00000000 --- a/trunk/vendor/phpcompatibility/phpcompatibility-wp/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/trunk/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml b/trunk/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml deleted file mode 100644 index 7f797a19..00000000 --- a/trunk/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - WordPress specific ruleset which checks for PHP cross version compatibility. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/CHANGELOG.md b/trunk/vendor/phpcsstandards/phpcsextra/CHANGELOG.md deleted file mode 100644 index 3ee3258b..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/CHANGELOG.md +++ /dev/null @@ -1,590 +0,0 @@ -# Change Log for the PHPCSExtra standard for PHP CodeSniffer - -All notable changes to this project will be documented in this file. - -This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses [Semantic Versioning](http://semver.org/). - -**Legend**: -:wrench: = Includes auto-fixer. -:bar_chart: = Includes metrics. -:books: = Includes CLI documentation. - - -## [Unreleased] - -_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 - -#### Other - -* Various housekeeping. - -### Fixed - -#### Universal - -* `Universal.CodeAnalysis.ConstructorDestructorReturn`: the sniff will now correctly ignore methods mirroring the class name (PHP-4 style constructors) in namespaced code. [#207], [#272] - -[#272]: https://github.com/PHPCSStandards/PHPCSExtra/pull/272 - - -## [1.1.1] - 2023-08-26 - -### Changed - -#### Modernize - -* `Modernize.FunctionCalls.Dirname`: the sniff will now respect a potentially set [`php_version` configuration option][php_version-config] and only report on modernizations which are possible on the configured `php_version`. [#261] - If the `php_version` is not set, the sniff will continue to report on all modernization options. - -#### Other - -* Various documentation improvements. Props in part to [@szepeviktor]. -* Improved defensive coding in select places. -* Various housekeeping. - -[#261]: https://github.com/PHPCSStandards/PHPCSExtra/pull/261 - - -## [1.1.0] - 2023-07-19 - -### Added - -#### Universal - -* :wrench: :books: New `Universal.CodeAnalysis.NoEchoSprintf` sniff to detect use of the inefficient `echo [v]sprintf(...);` combi and recommends using `[v]printf()` instead. [#242] -* :bar_chart: :books: New `Universal.FunctionDeclarations.NoLongClosures` sniff to detect "long" closures and recommend using a named function instead. [#240] - The sniff offers the following properties to influence its behaviour: `recommendedLines` (defaults to `5`), `maxLines` (defaults to `8`), `ignoreCommentLines` (defaults to `true`) and `ignoreEmptyLines` (defaults to `true`). -* :wrench: :bar_chart: :books: New `Universal.FunctionDeclarations.RequireFinalMethodsInTraits` sniff to enforce non-private, non-abstract methods in traits to be declared as `final`. [#243], [#245] - There is a separate `NonFinalMagicMethodFound` error code for magic methods to allow those to be excluded from the check. -* :wrench: :bar_chart: :books: New `Universal.UseStatements.DisallowMixedGroupUse` sniff to disallow group use statements which import a combination of namespace/OO construct, functions and/or constants in one statement. [#241], [#246] - Note: the fixer will use a semi-standardized format for group use statements. If there are more specific requirements for the formatting of group use statements, the ruleset configurator should ensure that additional sniffs are included in the ruleset to enforce the required format. -* :wrench: :bar_chart: :books: New `Universal.UseStatements.KeywordSpacing` sniff to enforce the use of a single space after the `use`, `function`, `const` keywords and both before and after the `as` keyword in import `use` statements. [#247] - The sniff has modular error codes to allow for disabling individual checks. -* :wrench: :books: New `Universal.UseStatements.NoUselessAliases` sniff to detect useless aliases (aliasing something to its original name) in import use statements. [#244] - Note: as OO and function names in PHP are case-insensitive, aliasing to the same name, using a different case is also considered useless. -* :wrench: :bar_chart: :books: New `Universal.WhiteSpace.CommaSpacing` sniff to enforce that there is no space before a comma and exactly one space, or a new line, after a comma. [#254] - Additionally, the sniff also enforces that the comma should follow the code and not be placed after a trailing comment. - The sniff has modular error codes to allow for disabling individual checks and checks in certain contexts. - The sniff will respect a potentially set [`php_version` configuration option][php_version-config] when deciding how to handle the spacing after a heredoc/nowdoc closer. - -### Changed - -#### Universal - -* Minor performance improvements for the `Universal.Arrays.DuplicateArrayKey` and the `Universal.CodeAnalysis.ConstructorDestructorReturn` sniffs. [#251], [#252] - -#### Other - -* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.8` (was `^1.0.6`). [#249], [#254] -* Various housekeeping. - -[#240]: https://github.com/PHPCSStandards/PHPCSExtra/pull/240 -[#241]: https://github.com/PHPCSStandards/PHPCSExtra/pull/241 -[#242]: https://github.com/PHPCSStandards/PHPCSExtra/pull/242 -[#243]: https://github.com/PHPCSStandards/PHPCSExtra/pull/243 -[#244]: https://github.com/PHPCSStandards/PHPCSExtra/pull/244 -[#245]: https://github.com/PHPCSStandards/PHPCSExtra/pull/245 -[#246]: https://github.com/PHPCSStandards/PHPCSExtra/pull/246 -[#247]: https://github.com/PHPCSStandards/PHPCSExtra/pull/247 -[#249]: https://github.com/PHPCSStandards/PHPCSExtra/pull/249 -[#251]: https://github.com/PHPCSStandards/PHPCSExtra/pull/251 -[#252]: https://github.com/PHPCSStandards/PHPCSExtra/pull/252 -[#254]: https://github.com/PHPCSStandards/PHPCSExtra/pull/254 - - -## [1.0.4] - 2023-06-18 - -### Changed - -#### Other - -* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.6` (was `^1.0.0`). [#237] -* Various housekeeping. - -### Fixed - -#### Universal - -* `Universal.Constants.LowercaseClassResolutionKeyword`: prevent false positives for function calls to methods called `class`. [#226] - -[#226]: https://github.com/PHPCSStandards/PHPCSExtra/pull/226 -[#237]: https://github.com/PHPCSStandards/PHPCSExtra/pull/237 - - -## [1.0.3] - 2023-03-28 - -### Changed - -#### Universal - -* `Universal.WhiteSpace.DisallowInlineTabs`: significant performance improvement. [#216], [#217] - -#### Other - -* Various housekeeping. - -### Fixed - -#### Modernize - -* `Modernize.FunctionCalls.Dirname`: prevent false positives for attribute classes called `dirname`. [#211], [#213] - -[#211]: https://github.com/PHPCSStandards/PHPCSExtra/pull/211 -[#213]: https://github.com/PHPCSStandards/PHPCSExtra/pull/213 -[#216]: https://github.com/PHPCSStandards/PHPCSExtra/pull/216 -[#217]: https://github.com/PHPCSStandards/PHPCSExtra/pull/217 - - -## [1.0.2] - 2023-01-10 - -### Changed - -#### Universal - -* `Universal.CodeAnalysis.ConstructorDestructorReturn`: the sniff will now respect a potentially set [`php_version` configuration option][php_version-config] and only report on PHP4-style constructors when the `php_version` is below `'80000'`. Thanks [@anomiex] for reporting! [#207], [#208] - -[#207]: https://github.com/PHPCSStandards/PHPCSExtra/issues/207 -[#208]: https://github.com/PHPCSStandards/PHPCSExtra/pull/208 - - -## [1.0.1] - 2023-01-05 - -### Fixed - -#### Universal - -* `Universal.CodeAnalysis.ConstructorDestructorReturn`: fixed false positive for return statements in nested functions/closures declared within constructor/destructor methods. Thanks [@anomiex] for reporting! [#201], [#202] - -[#201]: https://github.com/PHPCSStandards/PHPCSExtra/issues/201 -[#202]: https://github.com/PHPCSStandards/PHPCSExtra/pull/202 - - -## [1.0.0] - 2023-01-04 - -:warning: Important: this package now requires [PHPCSUtils 1.0.0]. Please make sure you use `--with-[all-]dependencies` when running `composer update`. :exclamation: - -For the full list of features, please see the changelogs of the alpha/rc releases: -* [1.0.0-rc1](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-rc1) -* [1.0.0-alpha3](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-alpha3) -* [1.0.0-alpha2](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-alpha2) -* [1.0.0-alpha1](https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.0.0-alpha1) - -### Changed - -#### Other - -* Updated various sniffs to take advantage of PHPCSUtils 1.0.0(-rc1). [#193], [#194], [#195] -* Minor documentation improvements. -* Various housekeeping. - -### Fixed - -#### Modernize - -* `Modernize.FunctionCalls.Dirname`: the sniff will now correctly recognize magic constants in a case-insensitive manner. [#187] - -[PHPCSUtils 1.0.0]: https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.0 - -[#187]: https://github.com/PHPCSStandards/PHPCSExtra/pull/187 -[#193]: https://github.com/PHPCSStandards/PHPCSExtra/pull/193 -[#194]: https://github.com/PHPCSStandards/PHPCSExtra/pull/194 -[#195]: https://github.com/PHPCSStandards/PHPCSExtra/pull/195 - - -## [1.0.0-RC1] - 2022-12-07 - -:warning: Important: this package now requires [PHPCSUtils 1.0.0-alpha4]. Please make sure you use `--with-[all-]dependencies` when running `composer update`. :exclamation: - -### Added - -#### Modernize - -* This is a new standard with one sniff to start with. -* :wrench: :books: New `Modernize.FunctionCalls.Dirname` sniff to detect and auto-fix two typical code modernizations which can be made related to the [`dirname()`][php-manual-dirname] function. [#172] - -#### Universal - -* :wrench: :bar_chart: :books: New `Universal.Classes.DisallowAnonClassParentheses` sniff to disallow the use of parentheses when declaring an anonymous class without passing parameters. [#76], [#162] -* :wrench: :bar_chart: :books: New `Universal.Classes.RequireAnonClassParentheses` sniff to require the use of parentheses when declaring an anonymous class, whether parameters are passed or not. [#76], [#166] -* :wrench: :bar_chart: :books: New `Universal.Classes.DisallowFinalClass` sniff to disallow classes being declared `final`. [#108], [#114], [#148], [#163] -* :wrench: :bar_chart: :books: New `Universal.Classes.RequireFinalClass` sniff to require all non-`abstract` classes to be declared `final`. [#109], [#148], [#164] - Warning: the auto-fixer for this sniff _may_ have unintended side-effects for applications and should be used with care! This is considered a _risky_ fixer. -* :wrench: :bar_chart: :books: New `Universal.Classes.ModifierKeywordOrder` sniff to standardize the modifier keyword order for class declarations. [#142] - The sniff offers an `order` property to specify the preferred order. -* :wrench: :books: New `Universal.CodeAnalysis.ConstructorDestructorReturn` sniff to verify that class constructor/destructor methods 1) do not have a return type declaration and 2) do not return a value. [#137], [#140], [#146] Inspired by [@derickr]. -* :wrench: :books: New `Universal.CodeAnalysis.ForeachUniqueAssignment` sniff to detect `foreach` control structures which use the same variable for both the key as well as the value assignment as this will lead to unexpected - and most likely unintended - behaviour. [#110], [#175] - The fixer will maintain the existing behaviour of the code. Mind: this may not be the _intended_ behaviour. -* :wrench: :books: New `Universal.CodeAnalysis.StaticInFinalClass` sniff to detect using `static` instead of `self` in OO constructs which are `final`. [#116], [#180] - The sniff has modular error codes to allow for making exceptions based on the type of use for `static`. -* :wrench: :bar_chart: :books: New `Universal.Constants.LowercaseClassResolutionKeyword` sniff to enforce that the `class` keyword when used for class name resolution, i.e. `::class`, is in lowercase. [#72] -* :wrench: :bar_chart: :books: New `Universal.Constants.ModifierKeywordOrder` sniff to standardize the modifier keyword order for OO constant declarations. [#143] - The sniff offers an `order` property to specify the preferred order. -* :wrench: :books: New `Universal.ControlStructures.DisallowLonelyIf` sniff to disallow `if` statements as the only statement in an `else` block. [#85], [#168], [#169] - Inspired by the [ESLint "no lonely if"] rule. - Note: This sniff will not fix the indentation of the "inner" code. It is strongly recommended to run this sniff together with the `Generic.WhiteSpace.ScopeIndent` sniff to get the correct indentation. -* :bar_chart: :books: New `Universal.Files.SeparateFunctionsFromOO` sniff to enforce that a file should either declare (global/namespaced) functions or declare OO structures, but not both. [#95], [#170], [#171] - Nested function declarations, i.e. functions declared within a function/method will be disregarded for the purposes of this sniff. - The same goes for anonymous classes, closures and arrow functions. -* :books: New `Universal.NamingConventions.NoReservedKeywordParameterNames` sniff to verify that function parameters do not use reserved keywords as names, as this can quickly become confusing when people use them in function calls using named parameters. [#80], [#81], [#106], [#107], [#173] - The sniff has modular error codes to allow for making exceptions for specific keywords. -* :wrench: :bar_chart: :books: New `Universal.Operators.TypeSeparatorSpacing` sniff to enforce no spaces around union type and intersection type separators. [#117] -* :wrench: :books: New `Universal.PHP.OneStatementInShortEchoTag` sniff to disallow short open echo tags `= 8.0][php-rfc-negative_array_index]. [#177], [#178] - If a [`php_version` configuration option][php_version-config] has been passed to PHPCS, it will be respected by the sniff and only report duplicate keys for the configured PHP version. -* `Universal.ControlStructures.DisallowAlternativeSyntax`: the sniff will now also record a metric when single-line (no body) control structures are encountered. [#158] -* `Universal.ControlStructures.DisallowAlternativeSyntax`: the error message thrown by the sniff is now more descriptive. [#159] -* `Universal.ControlStructures.DisallowAlternativeSyntax`: metrics will no longer be recorded for `elseif` and `else` keywords, but only on the `if` keyword as the type of syntax used has to be the same for the whole "chain". [#161] -* `Universal.Lists.DisallowLongListSyntax`: the sniff will no longer record (incomplete) metrics about long vs short list usage. [#155] -* `Universal.Lists.DisallowShortListSyntax`: the sniff will now record (complete) metrics about long vs short list usage. [#155] -* `Universal.OOStructures.AlphabeticExtendsImplements`: documented support for `enum ... implements`. [#150] -* `Universal.UseStatements.DisallowUseClass`: updated error message and metric name to take PHP 8.1 `enum`s into account. [#149] -* `Universal.UseStatements.NoLeadingBackslash`: the sniff will now also flag and auto-fix leading backslashes in group use statements. [#167] - -#### Other -* Updated the sniffs for compatibility with PHPCSUtils 1.0.0-alpha4. [#134] -* Updated the sniffs to correctly handle PHP 8.0/8.1/8.2 features whenever relevant. -* Readme: Updated installation instructions for compatibility with Composer 2.2+. [#101] -* Composer: The minimum `PHP_CodeSniffer` requirement has been updated to `^3.7.1` (was `^3.3.1`). [#115], [#130] -* Composer: The package will now identify itself as a static analysis tool. Thanks [@GaryJones]! [#126] -* All non-`abstract` classes in this package are now `final`. [#121] -* All XML documentation now has a schema annotation. [#128] -* Various housekeeping. - -### Fixed - -The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which potentially could have affected sniffs in this package. - -#### NormalizedArrays -* `NormalizedArrays.Arrays.ArrayBraceSpacing`: the sniff now allows for trailing comments after the array opener in multi-line arrays. [#118] -* `NormalizedArrays.Arrays.ArrayBraceSpacing`: trailing comments at the end of an array, but before the closer, in multi-line arrays will no longer confuse the sniff. [#135] -* `NormalizedArrays.Arrays.CommaAfterLast`: the fixer will now recognize PHP 7.3+ flexible heredoc/nowdocs and in that case, will add the comma on the same line as the heredoc/nowdoc closer. [#144] - -#### Universal -* `Universal.Arrays.DisallowShortArraySyntax`: nested short arrays in short lists will now be detected and fixed correctly. [#153] -* `Universal.ControlStructures.DisallowAlternativeSyntax`: the sniff will no longer bow out indiscriminately when the `allowWithInlineHTML` property is set to `true`. [#90], [#161] -* `Universal.ControlStructures.DisallowAlternativeSyntax`: when alternative control structure syntax is allowed in combination with inline HTML (`allowWithInlineHTML` property set to `true`), inline HTML in functions declared within the control structure body will no longer be taken into account for determining whether or not the control structure contains inline HTML. [#160] -* `Universal.Lists.DisallowShortListSyntax`: the sniff will work around a tokenizer bug in PHPCS 3.7.1, which previously could lead to false negatives. [#151]. -* `Universal.Lists.DisallowShortListSyntax`: nested short lists in short arrays will now be detected and fixed correctly. [#152] -* `Universal.Operators.DisallowStandalonePostIncrementDecrement`: the sniff will now correctly recognize stand-alone statements which end on a PHP close tag. [#176] - -[#72]: https://github.com/PHPCSStandards/PHPCSExtra/pull/72 -[#76]: https://github.com/PHPCSStandards/PHPCSExtra/pull/76 -[#80]: https://github.com/PHPCSStandards/PHPCSExtra/pull/80 -[#81]: https://github.com/PHPCSStandards/PHPCSExtra/pull/81 -[#85]: https://github.com/PHPCSStandards/PHPCSExtra/pull/85 -[#89]: https://github.com/PHPCSStandards/PHPCSExtra/pull/89 -[#90]: https://github.com/PHPCSStandards/PHPCSExtra/pull/90 -[#95]: https://github.com/PHPCSStandards/PHPCSExtra/pull/95 -[#101]: https://github.com/PHPCSStandards/PHPCSExtra/pull/101 -[#106]: https://github.com/PHPCSStandards/PHPCSExtra/pull/106 -[#107]: https://github.com/PHPCSStandards/PHPCSExtra/pull/107 -[#108]: https://github.com/PHPCSStandards/PHPCSExtra/pull/108 -[#109]: https://github.com/PHPCSStandards/PHPCSExtra/pull/109 -[#110]: https://github.com/PHPCSStandards/PHPCSExtra/pull/110 -[#114]: https://github.com/PHPCSStandards/PHPCSExtra/pull/114 -[#115]: https://github.com/PHPCSStandards/PHPCSExtra/pull/115 -[#116]: https://github.com/PHPCSStandards/PHPCSExtra/pull/116 -[#117]: https://github.com/PHPCSStandards/PHPCSExtra/pull/117 -[#118]: https://github.com/PHPCSStandards/PHPCSExtra/pull/118 -[#119]: https://github.com/PHPCSStandards/PHPCSExtra/pull/119 -[#120]: https://github.com/PHPCSStandards/PHPCSExtra/pull/120 -[#121]: https://github.com/PHPCSStandards/PHPCSExtra/pull/121 -[#122]: https://github.com/PHPCSStandards/PHPCSExtra/pull/122 -[#123]: https://github.com/PHPCSStandards/PHPCSExtra/pull/123 -[#124]: https://github.com/PHPCSStandards/PHPCSExtra/pull/124 -[#126]: https://github.com/PHPCSStandards/PHPCSExtra/pull/126 -[#128]: https://github.com/PHPCSStandards/PHPCSExtra/pull/128 -[#130]: https://github.com/PHPCSStandards/PHPCSExtra/pull/130 -[#134]: https://github.com/PHPCSStandards/PHPCSExtra/pull/134 -[#135]: https://github.com/PHPCSStandards/PHPCSExtra/pull/135 -[#137]: https://github.com/PHPCSStandards/PHPCSExtra/pull/137 -[#140]: https://github.com/PHPCSStandards/PHPCSExtra/pull/140 -[#142]: https://github.com/PHPCSStandards/PHPCSExtra/pull/142 -[#143]: https://github.com/PHPCSStandards/PHPCSExtra/pull/143 -[#144]: https://github.com/PHPCSStandards/PHPCSExtra/pull/144 -[#146]: https://github.com/PHPCSStandards/PHPCSExtra/pull/146 -[#147]: https://github.com/PHPCSStandards/PHPCSExtra/pull/147 -[#148]: https://github.com/PHPCSStandards/PHPCSExtra/pull/148 -[#149]: https://github.com/PHPCSStandards/PHPCSExtra/pull/149 -[#150]: https://github.com/PHPCSStandards/PHPCSExtra/pull/150 -[#151]: https://github.com/PHPCSStandards/PHPCSExtra/pull/151 -[#152]: https://github.com/PHPCSStandards/PHPCSExtra/pull/152 -[#153]: https://github.com/PHPCSStandards/PHPCSExtra/pull/153 -[#154]: https://github.com/PHPCSStandards/PHPCSExtra/pull/154 -[#155]: https://github.com/PHPCSStandards/PHPCSExtra/pull/155 -[#158]: https://github.com/PHPCSStandards/PHPCSExtra/pull/158 -[#159]: https://github.com/PHPCSStandards/PHPCSExtra/pull/159 -[#160]: https://github.com/PHPCSStandards/PHPCSExtra/pull/160 -[#161]: https://github.com/PHPCSStandards/PHPCSExtra/pull/161 -[#162]: https://github.com/PHPCSStandards/PHPCSExtra/pull/162 -[#163]: https://github.com/PHPCSStandards/PHPCSExtra/pull/163 -[#164]: https://github.com/PHPCSStandards/PHPCSExtra/pull/164 -[#165]: https://github.com/PHPCSStandards/PHPCSExtra/pull/165 -[#166]: https://github.com/PHPCSStandards/PHPCSExtra/pull/166 -[#167]: https://github.com/PHPCSStandards/PHPCSExtra/pull/167 -[#168]: https://github.com/PHPCSStandards/PHPCSExtra/pull/168 -[#169]: https://github.com/PHPCSStandards/PHPCSExtra/pull/169 -[#170]: https://github.com/PHPCSStandards/PHPCSExtra/pull/170 -[#171]: https://github.com/PHPCSStandards/PHPCSExtra/pull/171 -[#172]: https://github.com/PHPCSStandards/PHPCSExtra/pull/172 -[#173]: https://github.com/PHPCSStandards/PHPCSExtra/pull/173 -[#175]: https://github.com/PHPCSStandards/PHPCSExtra/pull/175 -[#176]: https://github.com/PHPCSStandards/PHPCSExtra/pull/176 -[#177]: https://github.com/PHPCSStandards/PHPCSExtra/pull/177 -[#178]: https://github.com/PHPCSStandards/PHPCSExtra/pull/178 -[#180]: https://github.com/PHPCSStandards/PHPCSExtra/pull/180 - -[php-manual-dirname]: https://www.php.net/function.dirname -[php-rfc-negative_array_index]: https://wiki.php.net/rfc/negative_array_index -[ESLint "no lonely if"]: https://eslint.org/docs/rules/no-lonely-if -[PHPCSUtils 1.0.0-alpha4]: https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.0-alpha4 - - -## [1.0.0-alpha3] - 2020-06-29 - -### Added - -#### Universal - -* :wrench: :books: New `Universal.Arrays.DisallowShortArraySyntax` sniff to disallow short array syntax. [#40] - In contrast to the PHPCS native `Generic.Arrays.DisallowShortArraySyntax` sniff, this sniff will ignore short list syntax and not cause parse errors when the fixer is used. -* :wrench: :bar_chart: :books: New `Universal.Constants.UppercaseMagicConstants` sniff to enforce that PHP native magic constants are in uppercase. [#64] -* :bar_chart: :books: New `Universal.Namespaces.DisallowDeclarationWithoutName` sniff to disallow namespace declarations without a namespace name. [#50] -* :bar_chart: :books: New `Universal.Operators.DisallowLogicalAndOr` sniff to enforce the use of the boolean `&&` and `||` operators instead of the logical `and`/`or` operators. [#52] - Note: as the [operator precedence] of the logical operators is significantly lower than the operator precedence of boolean operators, this sniff does not contain an auto-fixer. -* :bar_chart: :books: New `Universal.Operators.DisallowShortTernary` sniff to disallow the use of short ternaries `?:`. [#42] - While short ternaries are useful when used correctly, the principle of them is often misunderstood and they are more often than not used incorrectly, leading to hard to debug issues and/or PHP warnings/notices. -* :wrench: :bar_chart: :books: New `Universal.Operators.DisallowStandalonePostIncrementDecrement` sniff disallow the use of post-in/decrements in stand-alone statements and discourage the use of multiple increment/decrement operators in a stand-alone statement. [#65] -* :wrench: :bar_chart: :books: New `Universal.Operators.StrictComparisons` sniff to enforce the use of strict comparisons. [#48] - Warning: the auto-fixer for this sniff _may_ cause bugs in applications and should be used with care! This is considered a _risky_ fixer. -* :wrench: :bar_chart: :books: New `Universal.OOStructures.AlphabeticExtendsImplements` sniff to verify that the names used in a class "implements" statement or an interface "extends" statement are listed in alphabetic order. [#55] - * This sniff contains a public `orderby` property to determine the sort order to use for the statement. - If all names used are unqualified, the sort order won't make a difference. - However, if one or more of the names are partially or fully qualified, the chosen sort order will determine how the sorting between unqualified, partially and fully qualified names is handled. - The sniff supports two sort order options: - - _'name'_ : sort by the interface name only (default); - - _'full'_ : sort by the full name as used in the statement (without leading backslash). - In both cases, the sorting will be done using natural sort, case-insensitive. - * The sniff has modular error codes to allow for selective inclusion/exclusion: - - `ImplementsWrongOrder` - for "class implements" statements. - - `ImplementsWrongOrderWithComments` - for "class implements" statements interlaced with comments. These will not be auto-fixed. - - `ExtendsWrongOrder` - for "interface extends" statements. - - `ExtendsWrongOrderWithComments` - for "interface extends" statements interlaced with comments. These will not be auto-fixed. - * When fixing, the existing spacing between the names in an `implements`/`extends` statement will not be maintained. - 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. -* :wrench: :bar_chart: :books: New `Universal.UseStatements.LowercaseFunctionConst` sniff to enforce that `function` and `const` keywords when used in an import `use` statement are always lowercase. [#58] -* :wrench: :bar_chart: :books: New `Universal.UseStatements.NoLeadingBackslash` sniff to verify that a name being imported in an import `use` statement does not start with a leading backslash. [#46] - Names in import `use` statements should always be fully qualified, so a leading backslash is not needed and it is strongly recommended not to use one. - This sniff handles all types of import use statements supported by PHP, in contrast to other sniffs for the same in, for instance, the PSR12 or the Slevomat standard, which are incomplete. -* :wrench: :books: New `Universal.WhiteSpace.DisallowInlineTabs` sniff to enforce using spaces for mid-line alignment. [#43] - -### Changed - -#### Other -* The `master` branch has been renamed to `stable`. -* Composer: The version requirements for the [Composer PHPCS plugin] have been widened to allow for version 0.7.0 which supports Composer 2.0.0. [#62] -* Various housekeeping. - -[#40]: https://github.com/PHPCSStandards/PHPCSExtra/pull/40 -[#42]: https://github.com/PHPCSStandards/PHPCSExtra/pull/42 -[#43]: https://github.com/PHPCSStandards/PHPCSExtra/pull/43 -[#46]: https://github.com/PHPCSStandards/PHPCSExtra/pull/46 -[#48]: https://github.com/PHPCSStandards/PHPCSExtra/pull/48 -[#50]: https://github.com/PHPCSStandards/PHPCSExtra/pull/50 -[#52]: https://github.com/PHPCSStandards/PHPCSExtra/pull/52 -[#55]: https://github.com/PHPCSStandards/PHPCSExtra/pull/55 -[#58]: https://github.com/PHPCSStandards/PHPCSExtra/pull/58 -[#62]: https://github.com/PHPCSStandards/PHPCSExtra/pull/62 -[#64]: https://github.com/PHPCSStandards/PHPCSExtra/pull/64 -[#65]: https://github.com/PHPCSStandards/PHPCSExtra/pull/65 - -[operator precedence]: https://www.php.net/language.operators.precedence - - -## [1.0.0-alpha2] - 2020-02-18 - -### Added - -#### Universal -* :wrench: :bar_chart: :books: New `Universal.ControlStructures.DisallowAlternativeSyntax` sniff to disallow using the alternative syntax for control structures. [#23] - - This sniff contains a `allowWithInlineHTML` property to allow alternative syntax when inline HTML is used within the control structure. In all other cases, the use of the alternative syntax will still be disallowed. - - The sniff has modular error codes to allow for making exceptions based on specific control structures and/or specific control structures in combination with inline HTML. -* :bar_chart: `Universal.UseStatements.DisallowUseClass/Function/Const`: new, additional metrics about the import source will be shown in the `info` report. [#25] - -#### Other -* Readme: installation instructions and sniff list. [#26] - -### Changed - -#### Universal -* `Universal.Arrays.DuplicateArrayKey`: wording of the error message. [#18] -* `Universal.UseStatements.DisallowUseClass/Function/Const`: the error codes have been made more modular. [#25] - Each of these sniffs now has four additional error codes: -
      -
    • FoundSameNamespace, FoundSameNamespaceWithAlias for use statements importing from the same namespace;
    • -
    • FoundGlobalNamespace, FoundGlobalNamespaceWithAlias for use statements importing from the global namespace, like import statements for PHP native classes, functions and constants.
    • -
    - In all other circumstances, the existing error codes FoundWithAlias and FoundWithoutAlias will continue to be used. - -#### Other -* Improved formatting of the CLI documentation which can be viewed using `--generator=text`. [#17] -* Various housekeeping. - -### Fixed - -#### Universal -* `Universal.Arrays.DuplicateArrayKey`: improved handling of parse errors. [#34] -* `Universal.ControlStructures.IfElseDeclaration`: the fixer will now respect tab indentation. [#19] -* `Universal.UseStatements.DisallowUseClass/Function/Const`: the determination of whether a import is aliased in now done in a case-insensitive manner. [#25] -* `Universal.UseStatements.DisallowUseClass/Function/Const`: an import from the global namespace would previously always be seen as non-aliased, even when it was aliased. [#25] -* `Universal.UseStatements.DisallowUseClass/Function/Const`: improved tolerance for `use` import statements with leading backslashes. [#25] - -[#17]: https://github.com/PHPCSStandards/PHPCSExtra/pull/17 -[#18]: https://github.com/PHPCSStandards/PHPCSExtra/pull/18 -[#19]: https://github.com/PHPCSStandards/PHPCSExtra/pull/19 -[#23]: https://github.com/PHPCSStandards/PHPCSExtra/pull/23 -[#25]: https://github.com/PHPCSStandards/PHPCSExtra/pull/25 -[#26]: https://github.com/PHPCSStandards/PHPCSExtra/pull/26 -[#34]: https://github.com/PHPCSStandards/PHPCSExtra/pull/34 - - -## 1.0.0-alpha1 - 2020-01-23 - -Initial alpha release containing: -* A `NormalizedArrays` standard which will contain a full set of sniffs to check the formatting of array declarations. -* A `Universal` standard which will contain a collection of universal sniffs. - DO NOT INCLUDE THIS AS A STANDARD. - `Universal`, like the upstream PHPCS `Generic` standard, contains sniffs which contradict each other. - Include individual sniffs from this standard in a custom project/company ruleset to use them. - -This initial alpha release contains the following sniffs: - -### NormalizedArrays -* :wrench: :bar_chart: :books: `NormalizedArrays.Arrays.ArrayBraceSpacing`: enforce consistent spacing for the open/close braces of array declarations. - The sniff allows for having different settings for: - - Space between the array keyword and the open parenthesis for long arrays via the `keywordSpacing` property. - Accepted values: (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces. - - Spaces on the inside of the braces for empty arrays via the `spacesWhenEmpty` property. - Accepted values: (string) `newline`, (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces. - - Spaces on the inside of the braces for single-line arrays via the `spacesSingleLine` property; - Accepted values: (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces. - - Spaces on the inside of the braces for multi-line arrays via the `spacesMultiLine` property. - Accepted values: (string) `newline`, (int) number of spaces or `false` to turn this check off. Defaults to `newline`. - Note: if any of the above properties are set to `newline`, it is recommended to also include an array indentation sniff. This sniff will not handle the indentation. -* :wrench: :bar_chart: :books: `NormalizedArrays.Arrays.CommaAfterLast`: enforce/forbid a comma after the last item in an array declaration. - By default, this sniff will: -
      -
    • forbid a comma after the last array item for single-line arrays.
    • -
    • enforce a comma after the last array item for multi-line arrays.
    • -
    - This can be changed for each type or array individually by setting the singleLine or multiLine properties in a custom ruleset. - The valid values are: enforce, forbid or skip to not check the comma after the last array item for a particular type of array. - -### Universal -* :books: `Universal.Arrays.DuplicateArrayKey`: detects duplicate array keys in array declarations. -* :books: `Universal.Arrays.MixedArrayKeyTypes`: best practice sniff: don't use a mix of integer and numeric keys for array items. -* :books: `Universal.Arrays.MixedKeyedUnkeyedArray`: best practice sniff: don't use a mix of keyed and unkeyed array items. -* :wrench: :bar_chart: :books: `Universal.ControlStructures.IfElseDeclaration`: verify that else(if) statements with braces are on a new line. -* :wrench: :bar_chart: :books: `Universal.Lists.DisallowLongListSyntax`: disallow the use of long `list`s. -* :wrench: :bar_chart: :books: `Universal.Lists.DisallowShortListSyntax`: disallow the use of short lists. -* :bar_chart: :books: `Universal.Namespaces.DisallowCurlyBraceSyntax`: disallow the use of the alternative namespace declaration syntax using curly braces. -* :bar_chart: :books: `Universal.Namespaces.EnforceCurlyBraceSyntax`: enforce the use of the alternative namespace syntax using curly braces. -* :books: `Universal.Namespaces.OneDeclarationPerFile`: disallow the use of multiple namespaces within a file. -* :bar_chart: :books: `Universal.UseStatements.DisallowUseClass`: forbid using import use statements for classes/traits/interfaces. - Individual sub-types can be allowed by excluding specific error codes. -* :bar_chart: :books: `Universal.UseStatements.DisallowUseConst`: forbid using import use statements for constants. - Individual sub-types can be allowed by excluding specific error codes. -* :bar_chart: :books: `Universal.UseStatements.DisallowUseFunction`: forbid using import use statements for functions. - 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/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 -[1.0.4]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.3...1.0.4 -[1.0.3]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.2...1.0.3 -[1.0.2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.1...1.0.2 -[1.0.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0...1.0.1 -[1.0.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-rc1...1.0.0 -[1.0.0-RC1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha3...1.0.0-rc1 -[1.0.0-alpha3]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha2...1.0.0-alpha3 -[1.0.0-alpha2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha1...1.0.0-alpha2 - -[@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/trunk/vendor/phpcsstandards/phpcsextra/LICENSE b/trunk/vendor/phpcsstandards/phpcsextra/LICENSE deleted file mode 100644 index 0a041280..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml deleted file mode 100644 index 5f486646..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - = 5.3: Usage of dirname(__FILE__) can be replaced with __DIR__. - ]]> - - - - __DIR__; - ]]> - - - dirname(__FILE__); - ]]> - - - - = 7.0: Nested calls to dirname() can be replaced by using dirname() with the $levels parameter. - ]]> - - - - dirname($file, 3); - ]]> - - - dirname(dirname(dirname($file))); - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php deleted file mode 100644 index b064b264..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php +++ /dev/null @@ -1,382 +0,0 @@ - - */ - public function register() - { - return [\T_STRING]; - } - - /** - * 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) - { - if (isset($this->phpVersion) === false || \defined('PHP_CODESNIFFER_IN_TESTS')) { - // Set default value to prevent this code from running every time the sniff is triggered. - $this->phpVersion = 0; - - $phpVersion = Helper::getConfigData('php_version'); - if ($phpVersion !== null) { - $this->phpVersion = (int) $phpVersion; - } - } - - if ($this->phpVersion !== 0 && $this->phpVersion < 50300) { - // PHP version too low, nothing to do. - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (\strtolower($tokens[$stackPtr]['content']) !== 'dirname') { - // Not our target. - return; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false - || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS - || isset($tokens[$nextNonEmpty]['parenthesis_owner']) === true - ) { - // Not our target. - return; - } - - if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) { - // Live coding or parse error, ignore. - return; - } - - if (Context::inAttribute($phpcsFile, $stackPtr) === true) { - // Class instantiation in attribute, not function call. - return; - } - - // Check if it is really a function call to the global function. - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - if (isset(Collections::objectOperators()[$tokens[$prevNonEmpty]['code']]) === true - || $tokens[$prevNonEmpty]['code'] === \T_NEW - ) { - // Method call, class instantiation or other "not our target". - return; - } - - if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR) { - $prevPrevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true); - if ($tokens[$prevPrevToken]['code'] === \T_STRING - || $tokens[$prevPrevToken]['code'] === \T_NAMESPACE - ) { - // Namespaced function. - return; - } - } - - /* - * As of here, we can be pretty sure this is a function call to the global function. - */ - $opener = $nextNonEmpty; - $closer = $tokens[$nextNonEmpty]['parenthesis_closer']; - - $parameters = PassedParameters::getParameters($phpcsFile, $stackPtr); - $paramCount = \count($parameters); - if (empty($parameters) || $paramCount > 2) { - // No parameters or too many parameter. - return; - } - - $pathParam = PassedParameters::getParameterFromStack($parameters, 1, 'path'); - if ($pathParam === false) { - // If the path parameter doesn't exist, there's nothing to do. - return; - } - - $levelsParam = PassedParameters::getParameterFromStack($parameters, 2, 'levels'); - if ($levelsParam === false && $paramCount === 2) { - // There must be a typo in the param name or an otherwise stray parameter. Ignore. - return; - } - - /* - * PHP 5.3+: Detect use of dirname(__FILE__). - */ - if (\strtoupper($pathParam['clean']) === '__FILE__') { - $levelsValue = false; - - // Determine if the issue is auto-fixable. - $hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($opener + 1), $closer); - $fixable = ($hasComment === false); - - if ($fixable === true) { - $levelsValue = $this->getLevelsValue($phpcsFile, $levelsParam); - if ($levelsParam !== false && $levelsValue === false) { - // Can't autofix if we don't know the value of the $levels parameter. - $fixable = false; - } - } - - $error = 'Use the __DIR__ constant instead of calling dirname(__FILE__) (PHP >= 5.3)'; - $code = 'FileConstant'; - - // Throw the error. - if ($fixable === false) { - $phpcsFile->addError($error, $stackPtr, $code); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); - if ($fix === true) { - if ($levelsParam === false || $levelsValue === 1) { - // No $levels or $levels set to 1: we can replace the complete function call. - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken($stackPtr, '__DIR__'); - - for ($i = ($stackPtr + 1); $i <= $closer; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Remove potential leading \. - if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR) { - $phpcsFile->fixer->replaceToken($prevNonEmpty, ''); - } - - $phpcsFile->fixer->endChangeset(); - } else { - // We can replace the $path parameter and will need to adjust the $levels parameter. - $filePtr = $phpcsFile->findNext(\T_FILE, $pathParam['start'], ($pathParam['end'] + 1)); - $levelsPtr = $phpcsFile->findNext(\T_LNUMBER, $levelsParam['start'], ($levelsParam['end'] + 1)); - - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($filePtr, '__DIR__'); - $phpcsFile->fixer->replaceToken($levelsPtr, ($levelsValue - 1)); - $phpcsFile->fixer->endChangeset(); - } - } - - return; - } - - /* - * PHP 7.0+: Detect use of nested calls to dirname(). - */ - if ($this->phpVersion !== 0 && $this->phpVersion < 70000) { - // No need to check for this issue if the PHP version would not allow for it anyway. - return; - } - - if (\preg_match('`^\s*\\\\?dirname\s*\(`i', $pathParam['clean']) !== 1) { - return; - } - - /* - * Check if there is something _behind_ the nested dirname() call within the same parameter. - * - * Note: the findNext() calls are safe and will always match the dirname() function call - * as otherwise the above regex wouldn't have matched. - */ - $innerDirnamePtr = $phpcsFile->findNext(\T_STRING, $pathParam['start'], ($pathParam['end'] + 1)); - $innerOpener = $phpcsFile->findNext(\T_OPEN_PARENTHESIS, ($innerDirnamePtr + 1), ($pathParam['end'] + 1)); - if (isset($tokens[$innerOpener]['parenthesis_closer']) === false) { - // Shouldn't be possible. - return; // @codeCoverageIgnore - } - - $innerCloser = $tokens[$innerOpener]['parenthesis_closer']; - if ($innerCloser !== $pathParam['end']) { - $hasContentAfter = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($innerCloser + 1), - ($pathParam['end'] + 1), - true - ); - if ($hasContentAfter !== false) { - // Matched code like: `dirname(dirname($file) . 'something')`. Ignore. - return; - } - } - - /* - * Determine if this is an auto-fixable error. - */ - - // Step 1: Are there comments ? If so, not auto-fixable as we don't want to remove comments. - $fixable = true; - $outerLevelsValue = false; - $innerParameters = []; - $innerLevelsParam = false; - $innerLevelsValue = false; - - for ($i = ($opener + 1); $i < $closer; $i++) { - if (isset(Tokens::$commentTokens[$tokens[$i]['code']])) { - $fixable = false; - break; - } - - if ($tokens[$i]['code'] === \T_OPEN_PARENTHESIS - && isset($tokens[$i]['parenthesis_closer']) - ) { - // Skip over everything within the nested dirname() function call. - $i = $tokens[$i]['parenthesis_closer']; - } - } - - // Step 2: Does the `$levels` parameter exist for the outer dirname() call and if so, is it usable ? - if ($fixable === true) { - $outerLevelsValue = $this->getLevelsValue($phpcsFile, $levelsParam); - if ($levelsParam !== false && $outerLevelsValue === false) { - // Can't autofix if we don't know the value of the $levels parameter. - $fixable = false; - } - } - - // Step 3: Does the `$levels` parameter exist for the inner dirname() call and if so, is it usable ? - if ($fixable === true) { - $innerParameters = PassedParameters::getParameters($phpcsFile, $innerDirnamePtr); - $innerLevelsParam = PassedParameters::getParameterFromStack($innerParameters, 2, 'levels'); - $innerLevelsValue = $this->getLevelsValue($phpcsFile, $innerLevelsParam); - if ($innerLevelsParam !== false && $innerLevelsValue === false) { - // Can't autofix if we don't know the value of the $levels parameter. - $fixable = false; - } - } - - /* - * Throw the error. - */ - $error = 'Pass the $levels parameter to the dirname() call instead of using nested dirname() calls'; - $error .= ' (PHP >= 7.0)'; - $code = 'Nested'; - - if ($fixable === false) { - $phpcsFile->addError($error, $stackPtr, $code); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); - if ($fix === false) { - return; - } - - /* - * Fix the error. - */ - $phpcsFile->fixer->beginChangeset(); - - // Remove the info in the _outer_ param call. - for ($i = $opener; $i < $innerOpener; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - for ($i = ($innerCloser + 1); $i <= $closer; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - if ($innerLevelsParam !== false) { - // Inner $levels parameter already exists, just adjust the value. - $innerLevelsPtr = $phpcsFile->findNext( - \T_LNUMBER, - $innerLevelsParam['start'], - ($innerLevelsParam['end'] + 1) - ); - $phpcsFile->fixer->replaceToken($innerLevelsPtr, ($innerLevelsValue + $outerLevelsValue)); - } else { - // Inner $levels parameter does not exist yet. We need to add it. - $content = ', '; - - $prevBeforeCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($innerCloser - 1), null, true); - if ($tokens[$prevBeforeCloser]['code'] === \T_COMMA) { - // Trailing comma found, no need to add the comma. - $content = ' '; - } - - $innerPathParam = PassedParameters::getParameterFromStack($innerParameters, 1, 'path'); - if (isset($innerPathParam['name_token']) === true) { - // Non-named param cannot follow named param, so add param name. - $content .= 'levels: '; - } - - $content .= ($innerLevelsValue + $outerLevelsValue); - $phpcsFile->fixer->addContentBefore($innerCloser, $content); - } - - $phpcsFile->fixer->endChangeset(); - } - - /** - * Determine the value of the $levels parameter passed to dirname(). - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array|false $levelsParam The information about the parameter as retrieved - * via PassedParameters::getParameterFromStack(). - * - * @return int|false Integer levels value or FALSE if the levels value couldn't be determined. - */ - private function getLevelsValue($phpcsFile, $levelsParam) - { - if ($levelsParam === false) { - return 1; - } - - $ignore = Tokens::$emptyTokens; - $ignore[] = \T_LNUMBER; - - $hasNonNumber = $phpcsFile->findNext($ignore, $levelsParam['start'], ($levelsParam['end'] + 1), true); - if ($hasNonNumber !== false) { - return false; - } - - return (int) $levelsParam['clean']; - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml b/trunk/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml deleted file mode 100644 index c30d745d..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - A collection of sniffs to detect code modernization opportunities. - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml deleted file mode 100644 index e8a006f0..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - (1, 2); - ]]> - - - - - - - - - - - ); - -$args = [ ]; - ]]> - - - - - - - - - - - 1, 2 ); - -$args = [ 1, 2 ]; - ]]> - - - - - - - - - 1, - 2 -); - -$args = [ - 1, - 2 -]; - ]]> - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml deleted file mode 100644 index c5094c5c..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - no comma after the last array item. - - However, for multi-line arrays, there should be a comma after the last array item. - ]]> - - - - - - - , ); - ]]> - - - - - 'foo', - 2 => 'bar', -]; - ]]> - - - 'foo', - 2 => 'bar' -]; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php deleted file mode 100644 index b6317707..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php +++ /dev/null @@ -1,305 +0,0 @@ - - */ - 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 PHP_CodeSniffer file where the - * token was found. - * @param int $stackPtr The position in the PHP_CodeSniffer - * file's token stack where the token - * was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - /* - * Normalize the public settings. - */ - if ($this->keywordSpacing !== false) { - $this->keywordSpacing = \max((int) $this->keywordSpacing, 0); - } - - if ($this->spacesSingleLine !== false) { - $this->spacesSingleLine = \max((int) $this->spacesSingleLine, 0); - } - - if ($this->spacesMultiLine !== false && $this->spacesMultiLine !== 'newline') { - $this->spacesMultiLine = \max((int) $this->spacesMultiLine, 0); - } - - if ($this->spacesWhenEmpty !== false && $this->spacesWhenEmpty !== 'newline') { - $this->spacesWhenEmpty = \max((int) $this->spacesWhenEmpty, 0); - } - - if ($this->keywordSpacing === false - && $this->spacesSingleLine === false - && $this->spacesMultiLine === false - && $this->spacesWhenEmpty === false - ) { - // Nothing to do. Why was the sniff turned on at all ? - return; - } - - $openClose = Arrays::getOpenClose($phpcsFile, $stackPtr); - if ($openClose === false) { - // Live coding, short list or real square brackets. - return; - } - - $tokens = $phpcsFile->getTokens(); - $opener = $openClose['opener']; - $closer = $openClose['closer']; - - /* - * Check the spacing between the array keyword and the open parenthesis for long arrays. - */ - if ($tokens[$stackPtr]['code'] === \T_ARRAY && $this->keywordSpacing !== false) { - $error = 'There should be %s between the "array" keyword and the open parenthesis. Found: %s'; - $code = 'SpaceAfterKeyword'; - - SpacesFixer::checkAndFix( - $phpcsFile, - $stackPtr, - $opener, - $this->keywordSpacing, - $error, - $code, - 'error', - 0, - 'Space between array keyword and open brace' - ); - } - - /* - * Check for empty arrays. - */ - $nextNonWhiteSpace = $phpcsFile->findNext(\T_WHITESPACE, ($opener + 1), null, true); - if ($nextNonWhiteSpace === $closer) { - if ($this->spacesWhenEmpty === false) { - // Check was turned off. - return; - } - - $error = 'There should be %s between the array opener and closer for an empty array. Found: %s'; - $code = 'EmptyArraySpacing'; - - SpacesFixer::checkAndFix( - $phpcsFile, - $opener, - $closer, - $this->spacesWhenEmpty, - $error, - $code, - 'error', - 0, - 'Space between open and close brace for an empty array' - ); - - return; - } - - /* - * Check non-empty arrays. - */ - if ($tokens[$opener]['line'] === $tokens[$closer]['line']) { - // Single line array. - if ($this->spacesSingleLine === false) { - // Check was turned off. - return; - } - - $error = 'Expected %s after the array opener in a single line array. Found: %s'; - $code = 'SpaceAfterArrayOpenerSingleLine'; - - SpacesFixer::checkAndFix( - $phpcsFile, - $opener, - $phpcsFile->findNext(\T_WHITESPACE, ($opener + 1), null, true), - $this->spacesSingleLine, - $error, - $code, - 'error', - 0, - 'Space after array opener, single line array' - ); - - $error = 'Expected %s before the array closer in a single line array. Found: %s'; - $code = 'SpaceBeforeArrayCloserSingleLine'; - - SpacesFixer::checkAndFix( - $phpcsFile, - $closer, - $phpcsFile->findPrevious(\T_WHITESPACE, ($closer - 1), null, true), - $this->spacesSingleLine, - $error, - $code, - 'error', - 0, - 'Space before array closer, single line array' - ); - - return; - } - - // Multi-line array. - if ($this->spacesMultiLine === false) { - // Check was turned off. - return; - } - - $error = 'Expected %s after the array opener in a multi line array. Found: %s'; - $code = 'SpaceAfterArrayOpenerMultiLine'; - - $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($opener + 1), null, true); - if ($this->spacesMultiLine === 'newline') { - // Check for a trailing comment after the array opener and allow for it. - if (($tokens[$nextNonWhitespace]['code'] === \T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$nextNonWhitespace]['code']]) === true) - && $tokens[$nextNonWhitespace]['line'] === $tokens[$opener]['line'] - ) { - // We found a trailing comment after array opener. Treat that as the opener instead. - $opener = $nextNonWhitespace; - $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($opener + 1), null, true); - } - } - - SpacesFixer::checkAndFix( - $phpcsFile, - $opener, - $nextNonWhitespace, - $this->spacesMultiLine, - $error, - $code, - 'error', - 0, - 'Space after array opener, multi-line array' - ); - - $error = 'Expected %s before the array closer in a multi line array. Found: %s'; - $code = 'SpaceBeforeArrayCloserMultiLine'; - - SpacesFixer::checkAndFix( - $phpcsFile, - $closer, - $phpcsFile->findPrevious(\T_WHITESPACE, ($closer - 1), null, true), - $this->spacesMultiLine, - $error, - $code, - 'error', - 0, - 'Space before array closer, multi-line array' - ); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php deleted file mode 100644 index 7384421d..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/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/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml b/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml deleted file mode 100644 index 69c54a8e..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - A ruleset for PHP_CodeSniffer to check arrays for normalized format. - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml deleted file mode 100644 index 4a84b536..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - array( - 'foo' => 'bar', -); - ]]> - - - [ - 'foo' => 'bar', -]; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml deleted file mode 100644 index 00f9b7bb..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - 'foo' => 22, - 'bar' => 25, - 'baz' => 28, -); - -$args = array( - 22, - 25, - 2 => 28, -); - ]]> - - - 'foo' => 22, - 'bar' => 25, - 'bar' => 28, -); - -$args = array( - 22, - 25, - 1 => 28, -); - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml deleted file mode 100644 index f7efdda1..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - 'foo' => 22, - 'bar' => 25, -); - -$args = array( - 0 => 22, - 1 => 25, -); - ]]> - - - 22, - 25, -); - -$args = array( - 'foo' => 22, - 12 => 25, -); - - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml deleted file mode 100644 index 79897c19..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - 'foo' => 22, - 'bar' => 25, -); - -$args = array(22, 25); - ]]> - - - 22, - 25, -); - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml deleted file mode 100644 index ebfd7c6c..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - {}; -$anon = new class($param) {}; - ]]> - - - () {}; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml deleted file mode 100644 index fd7ddb67..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - class Foo {} -abstract class Bar implements MyInterface {} - ]]> - - - final class Foo {} -final class Bar extends MyAbstract {} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml deleted file mode 100644 index a80ae0da..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - final readonly class Foo {} -abstract readonly class Bar {} - ]]> - - - readonly final class Foo {} -readonly abstract class Bar {} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml deleted file mode 100644 index 48fa148e..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - () {}; - ]]> - - - {}; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml deleted file mode 100644 index 107b8f41..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - final class Foo {} -final class Bar extends MyAbstract {} - ]]> - - - class Foo {} -abstract class Bar implements MyInterface {} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml deleted file mode 100644 index b44b4777..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - : int {} -} - ]]> - - - - - - - - - - - - $this; - } - - public function __destruct() { - // Do something. - return false; - } -} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml deleted file mode 100644 index 6f9676ee..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - $v ) {} - ]]> - - - $k ) {} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml deleted file mode 100644 index 953149b7..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - ! $b; - -if((bool) callMe($a)) {} - ]]> - - - ! ! $b; - -if(! ! ! callMe($a)) {} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml deleted file mode 100644 index 914eb65d..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - printf('text %s text', $var); -echo callMe('text %s text', $var); - ]]> - - - echo sprintf('text %s text', $var); -echo vsprintf('text %s text', [$var]); - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml deleted file mode 100644 index 5f9f45bd..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - self - { - $var = self::functionCall(); - $var = $obj instanceof self; - $var = new self; - } -} - ]]> - - - static|false { - $var = static::$prop; - $var = $obj instanceof static; - $var = new static(); - } -}; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml deleted file mode 100644 index 7b61c8fa..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - MyClass::CLASS; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml deleted file mode 100644 index f42483a0..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - final public const FOO = 'foo'; -} - ]]> - - - protected final const BAR = 'foo'; -} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml deleted file mode 100644 index 2a9583fa..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - __LINE__; -include __DIR__ . '/file.php'; - ]]> - - - __NameSpace__; -include dirname(__file__) . '/file.php'; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml deleted file mode 100644 index 4be7e6df..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - { - $var = 1; -} - -while (++$i < 10) { - echo $i; -} - ]]> - - - : - $var = 1; -endif; - -while (++$i < 10): - echo $i; -endwhile; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml deleted file mode 100644 index 88d09228..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - elseif ($bar) { - // ... -} - -if ($foo) { - // ... -} else { - if ($bar) { - // ... - } - - doSomethingElse(); - -} - - ]]> - - - if ($bar) { - // ... - } else { - // ... - } -} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml deleted file mode 100644 index b1506f64..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - -elseif ($bar) { - $var = 2; -} -else { - $var = 3; -} - ]]> - - - elseif ($bar) { - $var = 2; -} else { - $var = 3; -} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml deleted file mode 100644 index db0a2671..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml deleted file mode 100644 index dc84e0b1..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml deleted file mode 100644 index 4b2622de..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - final public function bar() {} - final public static function baz() {} - - // Also valid (out of scope): - protected abstract function overload() {} - private function okay() {} -} - ]]> - - - public function bar() {} - protected static function baz() {} -} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml deleted file mode 100644 index 35475eab..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - [$a, $b] = $array; - ]]> - - - list($a, $b) = $array; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml deleted file mode 100644 index 214b6862..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - list($a, $b) = $array; - ]]> - - - [$a, $b] = $array; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml deleted file mode 100644 index 95174d73..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - ; - -// Code - ]]> - - - { - // Code. -} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml deleted file mode 100644 index 465ea556..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - Vendor\Name { -} - ]]> - - - { -} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml deleted file mode 100644 index 8e1892ca..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - { - // Code. -} - ]]> - - - ; - -// Code - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml deleted file mode 100644 index 6aa0f15c..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - namespace Vendor\Project\Sub\B { -} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml deleted file mode 100644 index d44935cf..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml deleted file mode 100644 index f22a7193..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - Bar, Foo -{ -} - ]]> - - - Foo, Bar -{ -} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml deleted file mode 100644 index 4d2761af..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - . $b . 'text' - . $c; - ]]> - - - . - $b . 'text' - . $c; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml deleted file mode 100644 index 4e398784..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - && $var > 10) {} - -if (empty($var) || $var < 0) {} - ]]> - - - and $var > 10) {} - -if (empty($var) or $var < 0) {} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml deleted file mode 100644 index 0ef2ea31..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - ? $a : 'default'; - ]]> - - - ?: 'default'; -echo $a ? : 'default'; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml deleted file mode 100644 index 06780034..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - ++$i; ---$j; - ]]> - - - ++; -$j--; - ]]> - - - - - - - - ++$i; - ]]> - - - --$i++++; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml deleted file mode 100644 index b4507ede..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - === 'text') {} - -if ($var !== true) {} - ]]> - - - == 'text') {} - -if ($var != true) {} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml deleted file mode 100644 index 3d3c328e..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - |string $paramA, - TypeA&TypeB $paramB -): int|false {} - ]]> - - - | string $paramA, - TypeA & TypeB $paramB -): int - | - false {} - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml deleted file mode 100644 index 261f93cd..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml deleted file mode 100644 index 103ca13e..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -
    - ]]> - - - $text; echo $moreText; ?>
    - ]]> - - - - - -echo $text; -echo $moreText; -?>
    - ]]> - - - $text; -echo $moreText; -?>
    - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml deleted file mode 100644 index 2b930f27..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml deleted file mode 100644 index 1699d9db..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml deleted file mode 100644 index 0dbec70b..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml deleted file mode 100644 index f3cb1f67..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml deleted file mode 100644 index 55d430e2..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - function strpos; -use const PHP_EOL as MY_EOL; - ]]> - - - function strpos; -use - const - PHP_EOL - as - MY_EOL; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml deleted file mode 100644 index 66acd83b..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - function strpos; -use const PHP_EOL; - ]]> - - - Function strpos; -use CONST PHP_EOL; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml deleted file mode 100644 index ff0b786c..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - use Package\ClassName; - ]]> - - - \Package\ClassName; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml deleted file mode 100644 index 39bb90d1..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml deleted file mode 100644 index 1770f747..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - class($param) -{ - public function __construct($p) {} -}; - ]]> - - - class ($param) -{ - public function __construct($p) {} -}; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml deleted file mode 100644 index 503ae6f7..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - , $param2, $param3); - -function_call( - $param1, - $param2, - $param3 -); - -$array = array($item1, $item2, $item3); -$array = [ - $item1, - $item2, -]; - -list(, $a, $b,,) = $array; -list( - , - $a, - $b, -) = $array; - ]]> - - - , $param2,$param3); - -function_call( - $a - ,$b - ,$c -); - -$array = array($item1,$item2 , $item3); -$array = [ - $item1, - $item2 , -]; - -list( ,$a, $b ,,) = $array; -list( - , - $a, - $b , -) = $array; - ]]> - - - - - - - - , // Comment. - $param2, /* Comment. */ -); - ]]> - - - , - $param2 /* Comment. */, -); - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml deleted file mode 100644 index b259ab40..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - [space]= 'text'; -$text[space][space]= 'more text'; - ]]> - - - [tab]= 'text'; -$text[tab]= 'more text'; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml deleted file mode 100644 index cde20f25..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - [space][space][space][space]$foo = 'bar'; - -[tab]$foo = 'bar'; - ]]> - - - [space][space]$foo = 'bar'; - -[tab][space]$foo = 'bar'; - ]]> - - - diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php deleted file mode 100644 index 7c172e34..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php +++ /dev/null @@ -1,60 +0,0 @@ -eolChar = $eolChar; - $this->config = $config; - } - - /** - * Creates an array of tokens when given some content. - * - * @param string $string The string to tokenize. - * - * @return array> - */ - protected function tokenize($string) - { - return []; - } - - /** - * Performs additional processing after main tokenizing. - * - * @return void - */ - protected function processAdditional() - { - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php deleted file mode 100644 index 829daaa9..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php +++ /dev/null @@ -1,89 +0,0 @@ - - */ - 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) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === \T_ARRAY) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); - return; - } - - if (Arrays::isShortArray($phpcsFile, $stackPtr) === false) { - // Square brackets, but not a short array. Probably short list or real square brackets. - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); - - $error = 'Short array syntax is not allowed'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($tokens[$stackPtr]['bracket_opener'], 'array('); - $phpcsFile->fixer->replaceToken($tokens[$stackPtr]['bracket_closer'], ')'); - $phpcsFile->fixer->endChangeset(); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php deleted file mode 100644 index 7097fad7..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php +++ /dev/null @@ -1,297 +0,0 @@ -> - */ - private $keysSeenLt8 = []; - - /** - * Keep track of which array keys have been seen already on PHP >= 8.0. - * - * @since 1.0.0 - * - * @var array> - */ - private $keysSeenGt8 = []; - - /** - * Keep track of the maximum seen integer key to know what the next value will be for - * array items without a key on PHP < 8.0. - * - * @since 1.0.0 - * - * @var int - */ - private $currentMaxIntKeyLt8; - - /** - * Keep track of the maximum seen integer key to know what the next value will be for - * array items without a key on PHP >= 8.0. - * - * @since 1.0.0 - * - * @var int - */ - private $currentMaxIntKeyGt8; - - /** - * PHP version as configured or -1 if unknown. - * - * @since 1.0.0 - * - * @var int - */ - private $phpVersion; - - /** - * Process every part of the array declaration. - * - * This contains the default logic for the sniff, but can be overloaded in a concrete child class - * if needed. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token was found. - * - * @return void - */ - public function processArray(File $phpcsFile) - { - // Reset properties before processing this array. - $this->keysSeenLt8 = []; - $this->keysSeenGt8 = []; - - if (isset($this->phpVersion) === false) { - // Set default value to prevent this code from running every time the sniff is triggered. - $this->phpVersion = -1; - - $phpVersion = Helper::getConfigData('php_version'); - if ($phpVersion !== null) { - $this->phpVersion = (int) $phpVersion; - } - } - - unset($this->currentMaxIntKeyLt8, $this->currentMaxIntKeyGt8); - - parent::processArray($phpcsFile); - } - - /** - * Process the tokens in an array key. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token was found. - * @param int $startPtr The stack pointer to the first token in the "key" part of - * an array item. - * @param int $endPtr The stack pointer to the last token in the "key" part of - * an array item. - * @param int $itemNr Which item in the array is being handled. - * - * @return void - */ - public function processKey(File $phpcsFile, $startPtr, $endPtr, $itemNr) - { - $key = $this->getActualArrayKey($phpcsFile, $startPtr, $endPtr); - - if (isset($key) === false) { - // Key could not be determined. - return; - } - - $integerKey = \is_int($key); - - $errorMsg = 'Duplicate array key found. The value will be overwritten%s.' - . ' The %s array key "%s" was first seen on line %d'; - $errorCode = 'Found'; - $errors = []; - $baseData = [ - ($integerKey === true) ? 'integer' : 'string', - $key, - ]; - - /* - * Check if we've seen the key before. - */ - if (($this->phpVersion === -1 || $this->phpVersion < 80000) - && isset($this->keysSeenLt8[$key]) === true - ) { - $errors['phplt8'] = [ - 'data_subset' => $baseData, - 'error_suffix' => '', - 'code_suffix' => '', - ]; - - if ($integerKey === true) { - $errors['phplt8']['error_suffix'] = ' when using PHP < 8.0'; - $errors['phplt8']['code_suffix'] = 'ForPHPlt80'; - } - - $firstSeen = $this->keysSeenLt8[$key]; - $firstNonEmptyFirstSeen = $phpcsFile->findNext(Tokens::$emptyTokens, $firstSeen['ptr'], null, true); - - $errors['phplt8']['data_subset'][] = $this->tokens[$firstNonEmptyFirstSeen]['line']; - } - - if (($this->phpVersion === -1 || $this->phpVersion >= 80000) - && isset($this->keysSeenGt8[$key]) === true - ) { - $errors['phpgt8'] = [ - 'data_subset' => $baseData, - 'error_suffix' => '', - 'code_suffix' => '', - ]; - - if ($integerKey === true) { - $errors['phpgt8']['error_suffix'] = ' when using PHP >= 8.0'; - $errors['phpgt8']['code_suffix'] = 'ForPHPgte80'; - } - - $firstSeen = $this->keysSeenGt8[$key]; - $firstNonEmptyFirstSeen = $phpcsFile->findNext(Tokens::$emptyTokens, $firstSeen['ptr'], null, true); - - $errors['phpgt8']['data_subset'][] = $this->tokens[$firstNonEmptyFirstSeen]['line']; - } - - /* - * Throw the error(s). - * - * If no PHP version was passed, throw errors both for PHP < 8.0 and PHP >= 8.0. - * If a PHP version was set, only throw the error appropriate for the selected PHP version. - * If both errors would effectively be the same, only throw one. - */ - if ($errors !== []) { - $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); - - if (isset($errors['phplt8'], $errors['phpgt8']) - && $errors['phplt8']['data_subset'] === $errors['phpgt8']['data_subset'] - ) { - // Only throw the error once if it would be the same for PHP < 8.0 and PHP >= 8.0. - $data = $errors['phplt8']['data_subset']; - \array_unshift($data, ''); - - $phpcsFile->addError($errorMsg, $firstNonEmpty, $errorCode, $data); - return; - } - - if (isset($errors['phplt8'])) { - $code = $errorCode . $errors['phplt8']['code_suffix']; - $data = $errors['phplt8']['data_subset']; - \array_unshift($data, $errors['phplt8']['error_suffix']); - - $phpcsFile->addError($errorMsg, $firstNonEmpty, $code, $data); - } - - if (isset($errors['phpgt8'])) { - $code = $errorCode . $errors['phpgt8']['code_suffix']; - $data = $errors['phpgt8']['data_subset']; - \array_unshift($data, $errors['phpgt8']['error_suffix']); - - $phpcsFile->addError($errorMsg, $firstNonEmpty, $code, $data); - } - - return; - } - - /* - * Key not seen before. Add to arrays. - */ - $this->keysSeenLt8[$key] = [ - 'item' => $itemNr, - 'ptr' => $startPtr, - ]; - $this->keysSeenGt8[$key] = [ - 'item' => $itemNr, - 'ptr' => $startPtr, - ]; - - if ($integerKey === true) { - if ((isset($this->currentMaxIntKeyLt8) === false && $key > -1) - || (isset($this->currentMaxIntKeyLt8) === true && $key > $this->currentMaxIntKeyLt8) - ) { - $this->currentMaxIntKeyLt8 = $key; - } - - if (isset($this->currentMaxIntKeyGt8) === false - || $key > $this->currentMaxIntKeyGt8 - ) { - $this->currentMaxIntKeyGt8 = $key; - } - } - } - - /** - * Process an array item without an array key. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token was found. - * @param int $startPtr The stack pointer to the first token in the array item, - * which in this case will be the first token of the array - * value part of the array item. - * @param int $itemNr Which item in the array is being handled. - * - * @return void - */ - public function processNoKey(File $phpcsFile, $startPtr, $itemNr) - { - // Track the key for PHP < 8.0. - if (isset($this->currentMaxIntKeyLt8) === false) { - $this->currentMaxIntKeyLt8 = -1; - } - - ++$this->currentMaxIntKeyLt8; - $this->keysSeenLt8[$this->currentMaxIntKeyLt8] = [ - 'item' => $itemNr, - 'ptr' => $startPtr, - ]; - - // Track the key for PHP 8.0+. - if (isset($this->currentMaxIntKeyGt8) === false) { - $this->currentMaxIntKeyGt8 = -1; - } - - ++$this->currentMaxIntKeyGt8; - $this->keysSeenGt8[$this->currentMaxIntKeyGt8] = [ - 'item' => $itemNr, - 'ptr' => $startPtr, - ]; - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php deleted file mode 100644 index 49d9260b..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php +++ /dev/null @@ -1,174 +0,0 @@ -seenStringKey = false; - $this->seenNumericKey = false; - - parent::processArray($phpcsFile); - } - - /** - * Process the tokens in an array key. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token was found. - * @param int $startPtr The stack pointer to the first token in the "key" part of - * an array item. - * @param int $endPtr The stack pointer to the last token in the "key" part of - * an array item. - * @param int $itemNr Which item in the array is being handled. - * - * @return true|void Returning `TRUE` will short-circuit the array item loop and stop processing. - * In effect, this means that the sniff will not examine the double arrow, the array - * value or comma for this array item and will not process any array items after this one. - */ - public function processKey(File $phpcsFile, $startPtr, $endPtr, $itemNr) - { - $key = $this->getActualArrayKey($phpcsFile, $startPtr, $endPtr); - if (isset($key) === false) { - // Key could not be determined. - return; - } - - $integerKey = \is_int($key); - - // Handle integer key. - if ($integerKey === true) { - if ($this->seenStringKey === false) { - if ($this->seenNumericKey !== false) { - // Already seen a numeric key before. - return; - } - - $this->seenNumericKey = true; - return; - } - - // Ok, so we've seen a string key before and now see an explicit numeric key. - $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); - $phpcsFile->addError( - 'Arrays should have either numeric keys or string keys. Explicit numeric key detected,' - . ' while all previous keys in this array were string keys.', - $firstNonEmpty, - 'ExplicitNumericKey' - ); - - // Stop the loop. - return true; - } - - // Handle string key. - if ($this->seenNumericKey === false) { - if ($this->seenStringKey !== false) { - // Already seen a string key before. - return; - } - - $this->seenStringKey = true; - return; - } - - // Ok, so we've seen a numeric key before and now see a string key. - $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); - $phpcsFile->addError( - 'Arrays should have either numeric keys or string keys. String key detected,' - . ' while all previous keys in this array were integer based keys.', - $firstNonEmpty, - 'StringKey' - ); - - // Stop the loop. - return true; - } - - /** - * Process an array item without an array key. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token was found. - * @param int $startPtr The stack pointer to the first token in the array item, - * which in this case will be the first token of the array - * value part of the array item. - * @param int $itemNr Which item in the array is being handled. - * - * @return true|void Returning `TRUE` will short-circuit the array item loop and stop processing. - * In effect, this means that the sniff will not examine the array value or - * comma for this array item and will not process any array items after this one. - */ - public function processNoKey(File $phpcsFile, $startPtr, $itemNr) - { - if ($this->seenStringKey === false) { - if ($this->seenNumericKey !== false) { - // Already seen a numeric key before. - return; - } - - $this->seenNumericKey = true; - return; - } - - // Ok, so we've seen a string key before and now see an implicit numeric key. - $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); - $phpcsFile->addError( - 'Arrays should have either numeric keys or string keys. Implicit numeric key detected,' - . ' while all previous keys in this array were string keys.', - $firstNonEmpty, - 'ImplicitNumericKey' - ); - - // Stop the loop. - return true; - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php deleted file mode 100644 index c47f217f..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php +++ /dev/null @@ -1,134 +0,0 @@ - Key is the item number; value the stack point to the first non empty token in the item. - */ - private $itemsWithoutKey = []; - - /** - * Process the array declaration. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token was found. - * - * @return void - */ - public function processArray(File $phpcsFile) - { - // Reset properties before processing this array. - $this->hasKeys = false; - $this->itemsWithoutKey = []; - - parent::processArray($phpcsFile); - } - - /** - * Process the tokens in an array key. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token was found. - * @param int $startPtr The stack pointer to the first token in the "key" part of - * an array item. - * @param int $endPtr The stack pointer to the last token in the "key" part of - * an array item. - * @param int $itemNr Which item in the array is being handled. - * - * @return void - */ - public function processKey(File $phpcsFile, $startPtr, $endPtr, $itemNr) - { - $this->hasKeys = true; - - // Process any previously encountered items without keys. - if (empty($this->itemsWithoutKey) === false) { - foreach ($this->itemsWithoutKey as $itemNr => $stackPtr) { - $phpcsFile->addError( - 'Inconsistent array detected. A mix of keyed and unkeyed array items is not allowed.' - . ' The array item in position %d does not have an array key.', - $stackPtr, - 'Found', - [$itemNr] - ); - } - - // No need to do this again. - $this->itemsWithoutKey = []; - } - } - - /** - * Process an array item without an array key. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token was found. - * @param int $startPtr The stack pointer to the first token in the array item, - * which in this case will be the first token of the array - * value part of the array item. - * @param int $itemNr Which item in the array is being handled. - * - * @return void - */ - public function processNoKey(File $phpcsFile, $startPtr, $itemNr) - { - $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, $startPtr, null, true); - if ($firstNonEmpty === false || $this->tokens[$firstNonEmpty]['code'] === \T_COMMA) { - // Shouldn't really be possible, but this must be a parse error (empty array item). - return; - } - - // If we already know there are keys in the array, throw an error message straight away. - if ($this->hasKeys === true) { - $phpcsFile->addError( - 'Inconsistent array detected. A mix of keyed and unkeyed array items is not allowed.' - . ' The array item in position %d does not have an array key.', - $firstNonEmpty, - 'Found', - [$itemNr] - ); - } else { - // Save the array item info for later in case we do encounter an array key later on in the array. - $this->itemsWithoutKey[$itemNr] = $firstNonEmpty; - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php deleted file mode 100644 index dae01252..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php +++ /dev/null @@ -1,112 +0,0 @@ - - */ - public function register() - { - return [\T_ANON_CLASS]; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - // Note: no need to check for `false` as PHPCS won't retokenize `class` to `T_ANON_CLASS` in that case. - if ($tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { - // No parentheses found. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); - return; - } - - if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) { - /* - * Incomplete set of parentheses. Ignore. - * Shouldn't be possible as PHPCS won't retokenize `class` to `T_ANON_CLASS` in that case. - */ - // @codeCoverageIgnoreStart - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); - return; - // @codeCoverageIgnoreEnd - } - - $opener = $nextNonEmpty; - $closer = $tokens[$opener]['parenthesis_closer']; - $hasParams = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), $closer, true); - if ($hasParams !== false) { - // There is something between the parentheses. Ignore. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes, with parameter(s)'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); - - $fix = $phpcsFile->addFixableError( - 'Parenthesis not allowed when creating a new anonymous class without passing parameters', - $stackPtr, - 'Found' - ); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = $opener; $i <= $closer; $i++) { - if (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php deleted file mode 100644 index 4e3f4719..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php +++ /dev/null @@ -1,116 +0,0 @@ - - */ - public function register() - { - return [\T_CLASS]; - } - - /** - * 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) - { - $classProp = ObjectDeclarations::getClassProperties($phpcsFile, $stackPtr); - if ($classProp['is_final'] === false) { - if ($classProp['is_abstract'] === true) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'abstract'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'not abstract, not final'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'final'); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - // Live coding or parse error. - return; - } - - // No extra safeguards needed, we know the keyword will exist based on the check above. - $finalKeyword = $phpcsFile->findPrevious(\T_FINAL, ($stackPtr - 1)); - $snippetEnd = $nextNonEmpty; - $classCloser = ''; - - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $snippetEnd = $tokens[$stackPtr]['scope_opener']; - $classCloser = '}'; - } - - $snippet = GetTokensAsString::compact($phpcsFile, $finalKeyword, $snippetEnd, true); - $fix = $phpcsFile->addFixableError( - 'Declaring a class as final is not allowed. Found: %s%s', - $finalKeyword, - 'FinalClassFound', - [$snippet, $classCloser] - ); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($finalKeyword, ''); - - // Remove redundant whitespace. - for ($i = ($finalKeyword + 1); $i < $stackPtr; $i++) { - if ($tokens[$i]['code'] === \T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($i, ''); - continue; - } - - break; - } - - $phpcsFile->fixer->endChangeset(); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php deleted file mode 100644 index 88fdfe20..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php +++ /dev/null @@ -1,188 +0,0 @@ - - */ - public function register() - { - return [\T_CLASS]; - } - - /** - * 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) - { - $classProp = ObjectDeclarations::getClassProperties($phpcsFile, $stackPtr); - - if ($classProp['readonly_token'] === false - || ($classProp['final_token'] === false && $classProp['abstract_token'] === false) - ) { - /* - * Either no modifier keywords found at all; or only one type of modifier - * keyword (abstract/final or readonly) declared, but not both. No ordering needed. - */ - return; - } - - if ($classProp['final_token'] !== false && $classProp['abstract_token'] !== false) { - // Parse error. Ignore. - return; - } - - $readonly = $classProp['readonly_token']; - - if ($classProp['final_token'] !== false) { - $extendability = $classProp['final_token']; - } else { - $extendability = $classProp['abstract_token']; - } - - if ($readonly < $extendability) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::READONLY_EXTEND); - } else { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::EXTEND_READONLY); - } - - $message = 'Class modifier keywords are not in the correct order. Expected: "%s", found: "%s"'; - - switch ($this->order) { - case self::READONLY_EXTEND: - if ($readonly < $extendability) { - // Order is correct. Nothing to do. - return; - } - - $this->handleError($phpcsFile, $extendability, $readonly); - break; - - case self::EXTEND_READONLY: - default: - if ($extendability < $readonly) { - // Order is correct. Nothing to do. - return; - } - - $this->handleError($phpcsFile, $readonly, $extendability); - break; - } - } - - /** - * Throw the error and potentially fix it. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $firstKeyword The position of the first keyword found. - * @param int $secondKeyword The position of the second keyword token. - * - * @return void - */ - private function handleError(File $phpcsFile, $firstKeyword, $secondKeyword) - { - $tokens = $phpcsFile->getTokens(); - - $message = 'Class modifier keywords are not in the correct order. Expected: "%s", found: "%s"'; - $data = [ - $tokens[$secondKeyword]['content'] . ' ' . $tokens[$firstKeyword]['content'], - $tokens[$firstKeyword]['content'] . ' ' . $tokens[$secondKeyword]['content'], - ]; - - $fix = $phpcsFile->addFixableError($message, $firstKeyword, 'Incorrect', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken($secondKeyword, ''); - - // Prevent leaving behind trailing whitespace. - $i = ($secondKeyword + 1); - while ($tokens[$i]['code'] === \T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($i, ''); - ++$i; - } - - // Use the original token content as the case used for keywords is not the concern of this sniff. - $phpcsFile->fixer->addContentBefore($firstKeyword, $tokens[$secondKeyword]['content'] . ' '); - - $phpcsFile->fixer->endChangeset(); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php deleted file mode 100644 index 2715b392..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ - public function register() - { - return [\T_ANON_CLASS]; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - // Note: no need to check for `false` as PHPCS won't retokenize `class` to `T_ANON_CLASS` in that case. - if ($tokens[$nextNonEmpty]['code'] === \T_OPEN_PARENTHESIS) { - // Parentheses found. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); - - $fix = $phpcsFile->addFixableError( - 'Parenthesis required when creating a new anonymous class.', - $stackPtr, - 'Missing' - ); - - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, '()'); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php deleted file mode 100644 index 843f1add..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php +++ /dev/null @@ -1,102 +0,0 @@ - - */ - public function register() - { - return [\T_CLASS]; - } - - /** - * 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) - { - $classProp = ObjectDeclarations::getClassProperties($phpcsFile, $stackPtr); - if ($classProp['is_final'] === true) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'final'); - return; - } - - if ($classProp['is_abstract'] === true) { - // Abstract classes can't be final. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'abstract'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'not abstract, not final'); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - // Live coding or parse error. - return; - } - - $snippetEnd = $nextNonEmpty; - $classCloser = ''; - - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $snippetEnd = $tokens[$stackPtr]['scope_opener']; - $classCloser = '}'; - } - - $snippet = GetTokensAsString::compact($phpcsFile, $stackPtr, $snippetEnd, true); - $fix = $phpcsFile->addFixableError( - 'A non-abstract class should be declared as final. Found: %s%s', - $stackPtr, - 'NonFinalClassFound', - [$snippet, $classCloser] - ); - - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, 'final '); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php deleted file mode 100644 index 6f78cb66..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php +++ /dev/null @@ -1,211 +0,0 @@ - - */ - public function register() - { - return [\T_FUNCTION]; - } - - /** - * 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) - { - if (isset($this->phpVersion) === false || \defined('PHP_CODESNIFFER_IN_TESTS')) { - // Set default value to prevent this code from running every time the sniff is triggered. - $this->phpVersion = 0; - - $phpVersion = Helper::getConfigData('php_version'); - if ($phpVersion !== null) { - $this->phpVersion = (int) $phpVersion; - } - } - - $scopePtr = Scopes::validDirectScope($phpcsFile, $stackPtr, Tokens::$ooScopeTokens); - if ($scopePtr === false) { - // Not an OO method. - return; - } - - $functionName = FunctionDeclarations::getName($phpcsFile, $stackPtr); - $functionNameLC = \strtolower($functionName); - - if ($functionNameLC === '__construct' || $functionNameLC === '__destruct') { - $functionType = \sprintf('A "%s()" magic method', $functionNameLC); - } else { - // If the PHP version is explicitly set to PHP 8.0 or higher, ignore PHP 4-style constructors. - if ($this->phpVersion >= 80000) { - return; - } - - // This may be a PHP 4-style constructor which should be handled. - $OOName = ObjectDeclarations::getName($phpcsFile, $scopePtr); - - if (empty($OOName) === true) { - // Anonymous class or parse error. The function can't be a PHP 4-style constructor. - return; - } - - if (NamingConventions::isEqual($functionName, $OOName) === false) { - // Class and function name not the same, so not a PHP 4-style constructor. - return; - } - - if (Namespaces::determineNamespace($phpcsFile, $stackPtr) !== '') { - /* - * Namespaced methods with the same name as the class are treated as - * regular methods, so we can bow out if we're in a namespace. - * - * Note: the exception to this is PHP 5.3.0-5.3.2. This is currently - * not dealt with. - */ - return; - } - - $functionType = 'A PHP 4-style constructor'; - } - - /* - * OK, so now we know for sure that this is a constructor/destructor method. - */ - - // Check for a return type. - $tokens = $phpcsFile->getTokens(); - $properties = FunctionDeclarations::getProperties($phpcsFile, $stackPtr); - if ($properties['return_type'] !== '' && $properties['return_type_token'] !== false) { - $data = [ - $functionType, - $properties['return_type'], - ]; - - $fix = $phpcsFile->addFixableError( - '%s can not declare a return type. Found: %s', - $properties['return_type_token'], - 'ReturnTypeFound', - $data - ); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $parensCloser = $tokens[$stackPtr]['parenthesis_closer']; - for ($i = ($parensCloser + 1); $i <= $properties['return_type_end_token']; $i++) { - if (isset(Tokens::$commentTokens[$tokens[$i]['code']])) { - // Ignore comments and leave them be. - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { - // Abstract/interface method, live coding or parse error. - return; - } - - // Check for a value being returned. - $current = $tokens[$stackPtr]['scope_opener']; - $end = $tokens[$stackPtr]['scope_closer']; - - // Not searching for arrow functions as those have an implicit return, so no - $search = Collections::functionDeclarationTokens(); - $search[\T_RETURN] = \T_RETURN; - - do { - $current = $phpcsFile->findNext($search, ($current + 1), $end); - if ($current === false) { - break; - } - - if (isset(Collections::functionDeclarationTokens()[$tokens[$current]['code']]) - && isset($tokens[$current]['scope_closer']) - ) { - // Skip over nested function/closure declarations. - $current = $tokens[$current]['scope_closer']; - continue; - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), $end, true); - if ($next === false - || $tokens[$next]['code'] === \T_SEMICOLON - || $tokens[$next]['code'] === \T_CLOSE_TAG - ) { - // Return statement without value. - continue; - } - - $endOfStatement = BCFile::findEndOfStatement($phpcsFile, $next); - - $data = [ - $functionType, - GetTokensAsString::compact($phpcsFile, $current, $endOfStatement, true), - ]; - - $phpcsFile->addWarning( - '%s can not return a value. Found: "%s"', - $current, - 'ReturnValueFound', - $data - ); - } while ($current < $end); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php deleted file mode 100644 index 8895c56c..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php +++ /dev/null @@ -1,153 +0,0 @@ - - */ - public function register() - { - return [\T_FOREACH]; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { - // Parse error or live coding, not our concern. - return; - } - - $opener = $tokens[$stackPtr]['parenthesis_opener']; - $closer = $tokens[$stackPtr]['parenthesis_closer']; - - $asPtr = $phpcsFile->findNext(\T_AS, ($opener + 1), $closer); - if ($asPtr === false) { - // Parse error or live coding, not our concern. - return; - } - - // Real target. - $find = [\T_DOUBLE_ARROW]; - // Prevent matching on double arrows within a list assignment. - $find += Collections::listTokens(); - - $doubleArrowPtr = $phpcsFile->findNext($find, ($asPtr + 1), $closer); - if ($doubleArrowPtr === false - || $tokens[$doubleArrowPtr]['code'] !== \T_DOUBLE_ARROW - ) { - // No key assignment. - return; - } - - $isListAssignment = $phpcsFile->findNext(Tokens::$emptyTokens, ($doubleArrowPtr + 1), $closer, true); - if ($isListAssignment === false) { - // Parse error or live coding, not our concern. - } - - $keyAsString = \ltrim(GetTokensAsString::noEmpties($phpcsFile, ($asPtr + 1), ($doubleArrowPtr - 1)), '&'); - $valueAssignments = []; - if (isset(Collections::listTokens()[$tokens[$isListAssignment]['code']]) === false) { - // Single value assignment. - $valueAssignments[] = GetTokensAsString::noEmpties($phpcsFile, ($doubleArrowPtr + 1), ($closer - 1)); - } else { - // List assignment. - $assignments = Lists::getAssignments($phpcsFile, $isListAssignment); - foreach ($assignments as $listItem) { - if ($listItem['assignment'] === '') { - // Ignore empty list assignments. - continue; - } - - // Note: this doesn't take nested lists into account (yet). - $valueAssignments[] = $listItem['assignment']; - } - } - - if (empty($valueAssignments)) { - // No assignments found. - return; - } - - foreach ($valueAssignments as $valueAsString) { - $valueAsString = \ltrim($valueAsString, '&'); - - if ($keyAsString !== $valueAsString) { - // Key and value not the same. - continue; - } - - $error = 'The variables used for the key and the value in a foreach assignment should be unique.'; - $error .= 'Both the key and the value will currently be assigned to: "%s"'; - - $fix = $phpcsFile->addFixableError($error, $doubleArrowPtr, 'NotUnique', [$valueAsString]); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - // Remove the key. - for ($i = ($asPtr + 1); $i < ($doubleArrowPtr + 1); $i++) { - if ($tokens[$i]['code'] === \T_WHITESPACE - && isset(Tokens::$commentTokens[$tokens[($i + 1)]['code']]) - ) { - // Don't remove whitespace when followed directly by a comment. - continue; - } - - if (isset(Tokens::$commentTokens[$tokens[$i]['code']])) { - // Don't remove comments. - continue; - } - - // Remove everything else. - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - break; - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php deleted file mode 100644 index 549c8cd3..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php +++ /dev/null @@ -1,269 +0,0 @@ - - */ - 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/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php deleted file mode 100644 index 67035f2a..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php +++ /dev/null @@ -1,131 +0,0 @@ - - */ - private $targetFunctions = [ - 'sprintf' => 'printf', - 'vsprintf' => 'vprintf', - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.1.0 - * - * @return array - */ - public function register() - { - return [\T_ECHO]; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.1.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(); - - $skip = Tokens::$emptyTokens; - $skip[] = \T_NS_SEPARATOR; - - $next = $phpcsFile->findNext($skip, ($stackPtr + 1), null, true); - if ($next === false - || $tokens[$next]['code'] !== \T_STRING - || isset($this->targetFunctions[\strtolower($tokens[$next]['content'])]) === false - ) { - // Not our target. - return; - } - - $detectedFunction = \strtolower($tokens[$next]['content']); - - $openParens = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - if ($openParens === false - || $tokens[$openParens]['code'] !== \T_OPEN_PARENTHESIS - || isset($tokens[$openParens]['parenthesis_closer']) === false - ) { - // Live coding/parse error. - return; - } - - $closeParens = $tokens[$openParens]['parenthesis_closer']; - $afterFunctionCall = $phpcsFile->findNext(Tokens::$emptyTokens, ($closeParens + 1), null, true); - if ($afterFunctionCall === false - || ($tokens[$afterFunctionCall]['code'] !== \T_SEMICOLON - && $tokens[$afterFunctionCall]['code'] !== \T_CLOSE_TAG) - ) { - // Live coding/parse error or compound echo statement. - return; - } - - $fix = $phpcsFile->addFixableError( - 'Unnecessary "echo %s(...)" found. Use "%s(...)" instead.', - $next, - 'Found', - [ - $tokens[$next]['content'], - $this->targetFunctions[$detectedFunction], - ] - ); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - // Remove echo and whitespace. - $phpcsFile->fixer->replaceToken($stackPtr, ''); - - for ($i = ($stackPtr + 1); $i < $next; $i++) { - if ($tokens[$i]['code'] !== \T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken($next, $this->targetFunctions[$detectedFunction]); - - $phpcsFile->fixer->endChangeset(); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php deleted file mode 100644 index 2136bcdb..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php +++ /dev/null @@ -1,216 +0,0 @@ - - */ - private $validOOScopes = [ - \T_CLASS, // Only if final. - \T_ANON_CLASS, // Final by nature. - \T_ENUM, // Final by design. - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - return [ - // These tokens are used to retrieve return types reliably. - \T_FUNCTION, - \T_FN, - // While this is our "real" target. - \T_STATIC, - // But we also need this as after "instanceof", `static` is tokenized as `T_STRING in PHPCS < 4.0.0. - // See: https://github.com/squizlabs/PHP_CodeSniffer/pull/3121 - \T_STRING, - ]; - } - - /** - * 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 int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === \T_STRING - && \strtolower($tokens[$stackPtr]['content']) !== 'static' - ) { - return; - } - - if ($tokens[$stackPtr]['code'] === \T_FUNCTION - || $tokens[$stackPtr]['code'] === \T_FN - ) { - /* - * Check return types for methods in final classes, anon classes and enums. - * - * Will return the scope opener of the function to prevent potential duplicate notifications. - */ - $scopeOpener = $stackPtr; - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $scopeOpener = $tokens[$stackPtr]['scope_opener']; - } - - if ($tokens[$stackPtr]['code'] === \T_FUNCTION) { - $ooPtr = Scopes::validDirectScope($phpcsFile, $stackPtr, $this->validOOScopes); - if ($ooPtr === false) { - // Method in a trait (not known where it is used), interface (never final) or not in an OO scope. - return $scopeOpener; - } - } else { - $ooPtr = Conditions::getLastCondition($phpcsFile, $stackPtr, $this->validOOScopes); - if ($ooPtr === false) { - // Arrow function outside of OO. - return $scopeOpener; - } - } - - if ($tokens[$ooPtr]['code'] === \T_CLASS) { - $classProps = ObjectDeclarations::getClassProperties($phpcsFile, $ooPtr); - if ($classProps['is_final'] === false) { - // Method in a non-final class. - return $scopeOpener; - } - } - - $functionProps = FunctionDeclarations::getProperties($phpcsFile, $stackPtr); - if ($functionProps['return_type'] === '') { - return $scopeOpener; - } - - $staticPtr = $phpcsFile->findNext( - \T_STATIC, - $functionProps['return_type_token'], - ($functionProps['return_type_end_token'] + 1) - ); - - if ($staticPtr === false) { - return $scopeOpener; - } - - // Found a return type containing the `static` type. - $this->handleError($phpcsFile, $staticPtr, 'ReturnType', '"static" return type'); - - return $scopeOpener; - } - - /* - * Check other uses of static. - */ - $functionPtr = Conditions::getLastCondition($phpcsFile, $stackPtr, [\T_FUNCTION, \T_CLOSURE]); - if ($functionPtr === false || $tokens[$functionPtr]['code'] === \T_CLOSURE) { - /* - * When `false`, this code is absolutely invalid, but not something to be addressed via this sniff. - * When a closure, we're not interested in it. The closure class is final, but closures - * can be bound to other classes. This needs further research and should maybe get its own sniff. - */ - return; - } - - $ooPtr = Scopes::validDirectScope($phpcsFile, $functionPtr, $this->validOOScopes); - if ($ooPtr === false) { - // Not in an OO context. - return; - } - - if ($tokens[$ooPtr]['code'] === \T_CLASS) { - $classProps = ObjectDeclarations::getClassProperties($phpcsFile, $ooPtr); - if ($classProps['is_final'] === false) { - // Token in a non-final class. - return; - } - } - - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prevNonEmpty !== false) { - if ($tokens[$prevNonEmpty]['code'] === \T_INSTANCEOF) { - $prevPrevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true); - $extraMsg = GetTokensAsString::compact($phpcsFile, $prevPrevNonEmpty, $stackPtr, true); - $this->handleError($phpcsFile, $stackPtr, 'InstanceOf', '"' . $extraMsg . '"'); - return; - } - - if ($tokens[$prevNonEmpty]['code'] === \T_NEW) { - $this->handleError($phpcsFile, $stackPtr, 'NewInstance', '"new static"'); - return; - } - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === \T_DOUBLE_COLON) { - $nextNextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), null, true); - $extraMsg = GetTokensAsString::compact($phpcsFile, $stackPtr, $nextNextNonEmpty, true); - $this->handleError($phpcsFile, $stackPtr, 'ScopeResolution', '"' . $extraMsg . '"'); - return; - } - } - - /** - * Throw and potentially fix the error. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of erroneous `T_STATIC` token. - * @param string $errorCode The error code for the message. - * @param string $extraMsg Addition to the error message. - * - * @return void - */ - private function handleError($phpcsFile, $stackPtr, $errorCode, $extraMsg) - { - $fix = $phpcsFile->addFixableError( - 'Use "self" instead of "static" when using late static binding in a final OO construct. Found: %s', - $stackPtr, - $errorCode, - [$extraMsg] - ); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'self'); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php deleted file mode 100644 index 7a67e479..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php +++ /dev/null @@ -1,106 +0,0 @@ - - */ - public function register() - { - return [\T_STRING]; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - $content = $tokens[$stackPtr]['content']; - $contentLC = \strtolower($content); - - if ($contentLC !== 'class') { - return; - } - - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextToken !== false && $tokens[$nextToken]['code'] === \T_OPEN_PARENTHESIS) { - // Function call or declaration for a function called "class". - return; - } - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prevToken === false || $tokens[$prevToken]['code'] !== \T_DOUBLE_COLON) { - return; - } - - if ($contentLC === $content) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'lowercase'); - return; - } - - $error = "The ::class keyword for class name resolution must be in lowercase. Expected: '::%s'; found: '::%s'"; - $data = [ - $contentLC, - $content, - ]; - - $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($error, $stackPtr, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLC); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php deleted file mode 100644 index 4b2e7183..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php +++ /dev/null @@ -1,199 +0,0 @@ - - */ - public function register() - { - return [\T_CONST]; - } - - /** - * 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) - { - if (Scopes::isOOConstant($phpcsFile, $stackPtr) === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $valid = Collections::constantModifierKeywords() + Tokens::$emptyTokens; - - $finalPtr = false; - $visibilityPtr = false; - - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if (isset($valid[$tokens[$i]['code']]) === false) { - break; - } - - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - if ($tokens[$i]['code'] === \T_FINAL) { - $finalPtr = $i; - } else { - $visibilityPtr = $i; - } - } - - if ($finalPtr === false || $visibilityPtr === false) { - /* - * Either no modifier keywords found at all; or only one type of modifier - * keyword (final or visibility) declared, but not both. No ordering needed. - */ - return; - } - - if ($visibilityPtr < $finalPtr) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::VISIBILITY_FINAL); - } else { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, self::FINAL_VISIBILITY); - } - - $message = 'OO constant modifier keywords are not in the correct order. Expected: "%s", found: "%s"'; - - switch ($this->order) { - case self::VISIBILITY_FINAL: - if ($visibilityPtr < $finalPtr) { - // Order is correct. Nothing to do. - return; - } - - $this->handleError($phpcsFile, $finalPtr, $visibilityPtr); - break; - - case self::FINAL_VISIBILITY: - default: - if ($finalPtr < $visibilityPtr) { - // Order is correct. Nothing to do. - return; - } - - $this->handleError($phpcsFile, $visibilityPtr, $finalPtr); - break; - } - } - - /** - * Throw the error and potentially fix it. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $firstKeyword The position of the first keyword found. - * @param int $secondKeyword The position of the second keyword token. - * - * @return void - */ - private function handleError(File $phpcsFile, $firstKeyword, $secondKeyword) - { - $tokens = $phpcsFile->getTokens(); - - $message = 'Constant modifier keywords are not in the correct order. Expected: "%s", found: "%s"'; - $data = [ - $tokens[$secondKeyword]['content'] . ' ' . $tokens[$firstKeyword]['content'], - $tokens[$firstKeyword]['content'] . ' ' . $tokens[$secondKeyword]['content'], - ]; - - $fix = $phpcsFile->addFixableError($message, $firstKeyword, 'Incorrect', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken($secondKeyword, ''); - - // Prevent leaving behind trailing whitespace. - $i = ($secondKeyword + 1); - while ($tokens[$i]['code'] === \T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($i, ''); - ++$i; - } - - // Use the original token content as the case used for keywords is not the concern of this sniff. - $phpcsFile->fixer->addContentBefore($firstKeyword, $tokens[$secondKeyword]['content'] . ' '); - - $phpcsFile->fixer->endChangeset(); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php deleted file mode 100644 index 348cf65e..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php +++ /dev/null @@ -1,89 +0,0 @@ - - */ - public function register() - { - return Tokens::$magicConstants; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - $content = $tokens[$stackPtr]['content']; - $contentUC = \strtoupper($content); - if ($contentUC === $content) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'uppercase'); - return; - } - - $error = 'Magic constants should be in uppercase. Expected: %s; found: %s'; - $errorCode = ''; - $data = [ - $contentUC, - $content, - ]; - - if (\strtolower($content) === $content) { - $errorCode = 'Lowercase'; - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'lowercase'); - } else { - $errorCode = 'Mixedcase'; - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'mixed case'); - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentUC); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php deleted file mode 100644 index ab78a70a..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php +++ /dev/null @@ -1,216 +0,0 @@ - - */ - public function register() - { - $targets = Collections::alternativeControlStructureSyntaxes(); - - // Don't look for elseif/else as they need to be dealt with in one go with the if. - unset($targets[\T_ELSEIF], $targets[\T_ELSE]); - - return $targets; - } - - /** - * 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) - { - /* - * Ignore control structures without body (i.e. single line control structures). - * This doesn't ignore _empty_ bodies. - */ - if (ControlStructures::hasBody($phpcsFile, $stackPtr, true) === false) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'single line (without body)'); - return; - } - - $tokens = $phpcsFile->getTokens(); - - /* - * Check if the control structure uses alternative syntax. - */ - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { - // No scope opener found: inline control structure or parse error. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'inline'); - return; - } - - $opener = $tokens[$stackPtr]['scope_opener']; - $closer = $tokens[$stackPtr]['scope_closer']; - - if ($tokens[$opener]['code'] !== \T_COLON) { - // Curly brace syntax (not our concern). - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'curly braces'); - return; - } - - /* - * As of here, we *know* the control structure must be using alternative syntax and - * must have all scope openers/closers set as, in case of parse errors, PHPCS wouldn't - * have set the scope opener, even for the first `if`. - * - * Also note that alternative syntax cannot be used with `else if`, so we don't need to take that - * into account. - */ - - /* - * Determine whether there is inline HTML. - * - * For "chained" control structures (if - elseif - else), the complete control structure - * needs to be examined in one go as these cannot be changed individually, only as a complete group. - */ - $closedScopes = Collections::closedScopes(); - $find = $closedScopes; - $find[\T_INLINE_HTML] = \T_INLINE_HTML; - - $chainedIssues = []; - $hasInlineHTML = false; - $currentPtr = $stackPtr; - - do { - $opener = $tokens[$currentPtr]['scope_opener']; - $closer = $tokens[$currentPtr]['scope_closer']; - $chainedIssues[$opener] = $closer; - - if ($hasInlineHTML === true) { - // No need to search the contents, we already know there is inline HTML. - $currentPtr = $closer; - continue; - } - - $inlineHTMLPtr = $opener; - - do { - $inlineHTMLPtr = $phpcsFile->findNext($find, ($inlineHTMLPtr + 1), $closer); - if ($tokens[$inlineHTMLPtr]['code'] === \T_INLINE_HTML) { - $hasInlineHTML = true; - break; - } - - if (isset($closedScopes[$tokens[$inlineHTMLPtr]['code']], $tokens[$inlineHTMLPtr]['scope_closer'])) { - $inlineHTMLPtr = $tokens[$inlineHTMLPtr]['scope_closer']; - } - } while ($inlineHTMLPtr !== false && $inlineHTMLPtr < $closer); - - $currentPtr = $closer; - } while (isset(Collections::alternativeControlStructureSyntaxes()[$tokens[$closer]['code']]) === true); - - if ($hasInlineHTML === true) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'alternative syntax with inline HTML'); - } else { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'alternative syntax'); - } - - if ($hasInlineHTML === true && $this->allowWithInlineHTML === true) { - return; - } - - $error = 'Using control structures with the alternative syntax is not allowed'; - if ($this->allowWithInlineHTML === true) { - $error .= ' unless the control structure contains inline HTML'; - } - $error .= '. Found: %1$s(): ... end%1$s;'; - - $code = 'Found' . \ucfirst($tokens[$stackPtr]['content']); - if ($hasInlineHTML === true) { - $code .= 'WithInlineHTML'; - } - - $data = [$tokens[$stackPtr]['content']]; - - foreach ($chainedIssues as $opener => $closer) { - $fix = $phpcsFile->addFixableError($error, $opener, $code, $data); - } - - if ($fix === false) { - return; - } - - /* - * Fix all issues for this chain in one go to diminish the chance of conflicts. - */ - $phpcsFile->fixer->beginChangeset(); - - foreach ($chainedIssues as $opener => $closer) { - $phpcsFile->fixer->replaceToken($opener, '{'); - - if (isset(Collections::alternativeControlStructureSyntaxClosers()[$tokens[$closer]['code']]) === true) { - $phpcsFile->fixer->replaceToken($closer, '}'); - - $semicolon = $phpcsFile->findNext(Tokens::$emptyTokens, ($closer + 1), null, true); - if ($semicolon !== false && $tokens[$semicolon]['code'] === \T_SEMICOLON) { - $phpcsFile->fixer->replaceToken($semicolon, ''); - } - } else { - /* - * This must be an if/else using alternative syntax. - * The closer will be the next control structure keyword. - */ - $phpcsFile->fixer->addContentBefore($closer, '} '); - } - } - - $phpcsFile->fixer->endChangeset(); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php deleted file mode 100644 index 58c81ae1..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php +++ /dev/null @@ -1,348 +0,0 @@ - - */ - public function register() - { - return [\T_ELSE]; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - - /* - * Deal with `else if`. - */ - if (ControlStructures::isElseIf($phpcsFile, $stackPtr) === true) { - // Ignore, not our real target. - return; - } - - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { - // Either an else without curly braces or a parse error. Ignore. - return; - } - - $outerScopeOpener = $tokens[$stackPtr]['scope_opener']; - $outerScopeCloser = $tokens[$stackPtr]['scope_closer']; - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($outerScopeOpener + 1), $outerScopeCloser, true); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_IF) { - // Definitely not a lonely if statement. - return; - } - - if (isset($tokens[$nextNonEmpty]['scope_closer']) === false) { - // Either a control structure without curly braces or a parse error. Ignore. - return; - } - - /* - * Find the end of an if - else chain. - */ - - $innerIfPtr = $nextNonEmpty; - $innerIfToken = $tokens[$innerIfPtr]; - $autoFixable = true; - $innerScopeCloser = $innerIfToken['scope_closer']; - - // For alternative syntax fixer only. - // Remember the individual inner scope opener and closers so the fixer doesn't need - // to do the same walking over the if/else chain again. - $innerScopes = [ - $innerIfToken['scope_opener'] => $innerScopeCloser, - ]; - - do { - /* - * Handle control structures using alternative syntax. - */ - if ($tokens[$innerScopeCloser]['code'] !== \T_CLOSE_CURLY_BRACKET) { - if ($tokens[$innerScopeCloser]['code'] === \T_ENDIF) { - $nextAfter = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($innerScopeCloser + 1), - $outerScopeCloser, - true - ); - - if ($tokens[$nextAfter]['code'] === \T_CLOSE_TAG) { - // Not "lonely" as at the very least there must be a PHP open tag before the outer closer. - return; - } - - if ($tokens[$nextAfter]['code'] === \T_SEMICOLON) { - $innerScopeCloser = $nextAfter; - } else { - // Missing semi-colon. Report, but don't auto-fix. - $autoFixable = false; - } - } else { - // This must be an else[if]. - --$innerScopeCloser; - } - } - - $innerNextNonEmpty = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($innerScopeCloser + 1), - $outerScopeCloser, - true - ); - if ($innerNextNonEmpty === false) { - // This was the last closer. - break; - } - - if ($tokens[$innerNextNonEmpty]['code'] !== \T_ELSE - && $tokens[$innerNextNonEmpty]['code'] !== \T_ELSEIF - ) { - // Found another statement after the control structure. The "if" is not lonely. - return; - } - - if (isset($tokens[$innerNextNonEmpty]['scope_closer']) === false) { - // This may still be an "else if"... - $nextAfter = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($innerNextNonEmpty + 1), - $outerScopeCloser, - true - ); - - if ($nextAfter === false - || $tokens[$nextAfter]['code'] !== \T_IF - || isset($tokens[$nextAfter]['scope_closer']) === false - ) { - // Defense in depth. Either a control structure without curly braces or a parse error. Ignore. - return; - } - - $innerNextNonEmpty = $nextAfter; - } - - $innerScopeCloser = $tokens[$innerNextNonEmpty]['scope_closer']; - $innerScopes[$tokens[$innerNextNonEmpty]['scope_opener']] = $innerScopeCloser; - } while (true); - - /* - * As of now, we know we have an error. Check if it can be auto-fixed. - */ - if ($phpcsFile->findNext(\T_WHITESPACE, ($innerScopeCloser + 1), $outerScopeCloser, true) !== false) { - // Comment between the inner and outer closers. - $autoFixable = false; - } - - if ($tokens[$innerScopeCloser]['code'] === \T_SEMICOLON) { - $hasComment = $phpcsFile->findPrevious(\T_WHITESPACE, ($innerScopeCloser - 1), null, true); - if ($tokens[$hasComment]['code'] !== \T_ENDIF) { - // Comment between the "endif" and the semi-colon. - $autoFixable = false; - } - } - - if ($tokens[$outerScopeOpener]['line'] !== $innerIfToken['line']) { - for ($startOfNextLine = ($outerScopeOpener + 1); $startOfNextLine < $innerIfPtr; $startOfNextLine++) { - if ($tokens[$outerScopeOpener]['line'] !== $tokens[$startOfNextLine]['line']) { - break; - } - } - - if ($phpcsFile->findNext(\T_WHITESPACE, $startOfNextLine, $innerIfPtr, true) !== false) { - // Comment between the inner and outer openers. - $autoFixable = false; - } - } - - if (isset($innerIfToken['parenthesis_opener'], $innerIfToken['parenthesis_closer']) === false) { - // Start/end of the condition of the if unclear. Most likely a parse error. - $autoFixable = false; - } - - /* - * Throw the error and potentially fix it. - */ - $error = 'If control structure block found as the only statement within an "else" block. Use elseif instead.'; - $code = 'Found'; - - if ($autoFixable === false) { - $phpcsFile->addError($error, $stackPtr, $code); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); - if ($fix === false) { - return; - } - - /* - * Fix it. - */ - $outerInnerSameType = false; - if (($tokens[$outerScopeCloser]['code'] === \T_CLOSE_CURLY_BRACKET - && $tokens[$innerScopeCloser]['code'] === \T_CLOSE_CURLY_BRACKET) - || ($tokens[$outerScopeCloser]['code'] === \T_ENDIF - && $tokens[$innerScopeCloser]['code'] === \T_SEMICOLON) - ) { - $outerInnerSameType = true; - } - - $targetIsCurly = ($tokens[$outerScopeCloser]['code'] === \T_CLOSE_CURLY_BRACKET); - - $innerScopeCount = \count($innerScopes); - - $condition = GetTokensAsString::origContent($phpcsFile, ($innerIfPtr + 1), ($innerIfToken['scope_opener'] - 1)); - if ($targetIsCurly === true) { - $condition = \rtrim($condition) . ' '; - } - - $phpcsFile->fixer->beginChangeset(); - - // Remove the inner if + condition up to and including the scope opener. - for ($i = $innerIfPtr; $i <= $innerIfToken['scope_opener']; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Potentially remove trailing whitespace/new line if there is no comment after the inner condition. - while ($tokens[$i]['line'] === $innerIfToken['line'] - && $tokens[$i]['code'] === \T_WHITESPACE - ) { - $phpcsFile->fixer->replaceToken($i, ''); - ++$i; - } - - // Remove any potential indentation whitespace for the inner if. - if ($tokens[$outerScopeOpener]['line'] !== $innerIfToken['line'] - && $tokens[$i]['line'] !== $innerIfToken['line'] - ) { - $i = ($nextNonEmpty - 1); - while ($tokens[$i]['line'] === $innerIfToken['line'] - && $tokens[$i]['code'] === \T_WHITESPACE - ) { - $phpcsFile->fixer->replaceToken($i, ''); - --$i; - } - } - - // Remove the inner scope closer. - $phpcsFile->fixer->replaceToken($innerScopeCloser, ''); - $i = ($innerScopeCloser - 1); - - // Handle alternative syntax for the closer. - if ($tokens[$innerScopeCloser]['code'] === \T_SEMICOLON) { - // Remove potential whitespace between the "endif" and the semicolon. - while ($tokens[$i]['code'] === \T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($i, ''); - --$i; - } - - // Remove the "endif". - $phpcsFile->fixer->replaceToken($i, ''); - --$i; - } - - // Remove superfluous whitespace before the inner scope closer. - while ($tokens[$i]['code'] === \T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($i, ''); - --$i; - } - - // Replace the else. - $phpcsFile->fixer->replaceToken($stackPtr, 'elseif' . $condition); - - // Remove potential superfluous whitespace between the new condition and the scope opener. - $i = ($stackPtr + 1); - while ($tokens[$i]['line'] === $tokens[$stackPtr]['line'] - && $tokens[$i]['code'] === \T_WHITESPACE - ) { - $phpcsFile->fixer->replaceToken($i, ''); - ++$i; - } - - if ($outerInnerSameType === false - && $innerScopeCount > 1 - ) { - $loop = 1; - foreach ($innerScopes as $opener => $closer) { - if ($targetIsCurly === true) { - if ($loop !== 1) { - // Only handle the opener when it's not the first of the chain as that's already handled above. - $phpcsFile->fixer->replaceToken($opener, ' {'); - } - - if ($loop !== $innerScopeCount) { - // Only handle the closer when it's not the last of the chain as that's already handled above. - $phpcsFile->fixer->addContentBefore($closer, '} '); - } - } else { - if ($loop !== 1) { - // Only handle the opener when it's not the first of the chain as that's already handled above. - $phpcsFile->fixer->replaceToken($opener, ':'); - } - - if ($loop !== $innerScopeCount) { - // Only handle the closer when it's not the last of the chain as that's already handled above. - $phpcsFile->fixer->replaceToken($closer, ''); - - $j = ($closer + 1); - while ($tokens[$j]['code'] === \T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($j, ''); - ++$j; - } - } - } - - ++$loop; - } - } - - $phpcsFile->fixer->endChangeset(); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php deleted file mode 100644 index fb2c39d4..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php +++ /dev/null @@ -1,164 +0,0 @@ - - */ - public function register() - { - return [ - \T_ELSE, - \T_ELSEIF, - ]; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - - /* - * Check for control structures without braces and alternative syntax. - */ - $scopePtr = $stackPtr; - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - // Deal with "else if". - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === \T_IF) { - $scopePtr = $next; - } - } - - if (isset($tokens[$scopePtr]['scope_opener']) === false - || $tokens[$tokens[$scopePtr]['scope_opener']]['code'] === \T_COLON - ) { - // No scope opener found or alternative syntax (not our concern). - return; - } - - /* - * Check whether the else(if) is on a new line. - */ - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prevNonEmpty === false || $tokens[$prevNonEmpty]['code'] !== \T_CLOSE_CURLY_BRACKET) { - // Parse error or mixing braced and non-braced. Not our concern. - return; - } - - if ($tokens[$prevNonEmpty]['line'] !== $tokens[$stackPtr]['line']) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); - - $errorBase = \strtoupper($tokens[$stackPtr]['content']); - $error = $errorBase . ' statement must be on a new line.'; - - $prevNonWhitespace = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - - if ($prevNonWhitespace !== $prevNonEmpty) { - // Comment found between previous scope closer and the keyword. - $fix = $phpcsFile->addError($error, $stackPtr, 'NoNewLine'); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoNewLine'); - if ($fix === false) { - return; - } - - /* - * Fix it. - */ - - // Figure out the indentation for the else(if). - $indentBase = $prevNonEmpty; - if (isset($tokens[$prevNonEmpty]['scope_condition']) === true - && ($tokens[$tokens[$prevNonEmpty]['scope_condition']]['column'] === 1 - || ($tokens[($tokens[$prevNonEmpty]['scope_condition'] - 1)]['code'] === \T_WHITESPACE - && $tokens[($tokens[$prevNonEmpty]['scope_condition'] - 1)]['column'] === 1)) - ) { - // Base the indentation off the previous if/elseif if on a line by itself. - $indentBase = $tokens[$prevNonEmpty]['scope_condition']; - } - - $indent = ''; - $firstOnIndentLine = $indentBase; - if ($tokens[$firstOnIndentLine]['column'] !== 1) { - while (isset($tokens[($firstOnIndentLine - 1)]) && $tokens[--$firstOnIndentLine]['column'] !== 1); - - if ($tokens[$firstOnIndentLine]['code'] === \T_WHITESPACE) { - $indent = $tokens[$firstOnIndentLine]['content']; - - // If tabs were replaced, use the original content. - if (isset($tokens[$firstOnIndentLine]['orig_content']) === true) { - $indent = $tokens[$firstOnIndentLine]['orig_content']; - } - } - } - - $phpcsFile->fixer->beginChangeset(); - - // Remove any whitespace between the previous scope closer and the else(if). - for ($i = ($prevNonEmpty + 1); $i < $stackPtr; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContent($prevNonEmpty, $phpcsFile->eolChar . $indent); - $phpcsFile->fixer->endChangeset(); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php deleted file mode 100644 index c274e751..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php +++ /dev/null @@ -1,190 +0,0 @@ - - */ - private $search = [ - // Some tokens to help skip over structures we're not interested in. - \T_START_HEREDOC => \T_START_HEREDOC, - \T_START_NOWDOC => \T_START_NOWDOC, - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - $this->search += Tokens::$ooScopeTokens; - $this->search += Collections::functionDeclarationTokens(); - - return Collections::phpOpenTags(); - } - - /** - * 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 int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $firstOO = null; - $firstFunction = null; - $functionCount = 0; - $OOCount = 0; - - for ($i = 0; $i < $phpcsFile->numTokens; $i++) { - // Ignore anything within square brackets. - if ($tokens[$i]['code'] !== \T_OPEN_CURLY_BRACKET - && isset($tokens[$i]['bracket_opener'], $tokens[$i]['bracket_closer']) - && $i === $tokens[$i]['bracket_opener'] - ) { - $i = $tokens[$i]['bracket_closer']; - continue; - } - - // Skip past nested arrays, function calls and arbitrary groupings. - if ($tokens[$i]['code'] === \T_OPEN_PARENTHESIS - && isset($tokens[$i]['parenthesis_closer']) - ) { - $i = $tokens[$i]['parenthesis_closer']; - continue; - } - - // Skip over potentially large docblocks. - if ($tokens[$i]['code'] === \T_DOC_COMMENT_OPEN_TAG - && isset($tokens[$i]['comment_closer']) - ) { - $i = $tokens[$i]['comment_closer']; - continue; - } - - // Ignore everything else we're not interested in. - if (isset($this->search[$tokens[$i]['code']]) === false) { - continue; - } - - // Skip over structures which won't contain anything we're interested in. - if (($tokens[$i]['code'] === \T_START_HEREDOC - || $tokens[$i]['code'] === \T_START_NOWDOC - || $tokens[$i]['code'] === \T_ANON_CLASS - || $tokens[$i]['code'] === \T_CLOSURE - || $tokens[$i]['code'] === \T_FN) - && isset($tokens[$i]['scope_condition'], $tokens[$i]['scope_closer']) - && $tokens[$i]['scope_condition'] === $i - ) { - $i = $tokens[$i]['scope_closer']; - continue; - } - - // This will be either a function declaration or an OO declaration token. - if ($tokens[$i]['code'] === \T_FUNCTION) { - if (isset($firstFunction) === false) { - $firstFunction = $i; - } - - ++$functionCount; - } else { - if (isset($firstOO) === false) { - $firstOO = $i; - } - - ++$OOCount; - } - - if (isset($tokens[$i]['scope_closer']) === true) { - $i = $tokens[$i]['scope_closer']; - } - } - - if ($functionCount > 0 && $OOCount > 0) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'Both function and OO declarations'); - - $reportToken = \max($firstFunction, $firstOO); - - $phpcsFile->addError( - 'A file should either contain function declarations or OO structure declarations, but not both.' - . ' Found %d function declaration(s) and %d OO structure declaration(s).' - . ' The first function declaration was found on line %d;' - . ' the first OO declaration was found on line %d', - $reportToken, - 'Mixed', - [ - $functionCount, - $OOCount, - $tokens[$firstFunction]['line'], - $tokens[$firstOO]['line'], - ] - ); - } elseif ($functionCount > 0) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'Only function(s)'); - } elseif ($OOCount > 0) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'Only OO structure(s)'); - } else { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'Neither'); - } - - // Ignore the rest of the file. - return ($phpcsFile->numTokens + 1); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php deleted file mode 100644 index a9ccf78b..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php +++ /dev/null @@ -1,233 +0,0 @@ - - */ - public function register() - { - return [\T_CLOSURE]; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.1.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) - { - $this->recommendedLines = (int) $this->recommendedLines; - $this->maxLines = (int) $this->maxLines; - - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) { - // Live coding/parse error. Shouldn't be possible as in that case tokenizer won't retokenize to T_CLOSURE. - return; // @codeCoverageIgnore - } - - $opener = $tokens[$stackPtr]['scope_opener']; - $closer = $tokens[$stackPtr]['scope_closer']; - - $currentLine = $tokens[$opener]['line']; - $closerLine = $tokens[$closer]['line']; - - $codeLines = 0; - $commentLines = 0; - $blankLines = 0; - - // Check whether the line of the scope opener needs to be counted, but ignore trailing comments on that line. - $firstNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), $closer, true); - if ($firstNonEmpty !== false && $tokens[$firstNonEmpty]['line'] === $currentLine) { - ++$codeLines; - } - - // Check whether the line of the scope closer needs to be counted. - if ($closerLine !== $currentLine) { - $hasCommentTokens = false; - $hasCodeTokens = false; - for ($i = ($closer - 1); $tokens[$i]['line'] === $closerLine && $i > $opener; $i--) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { - $hasCodeTokens = true; - } elseif (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { - $hasCommentTokens = true; - } - } - - if ($hasCodeTokens === true) { - ++$codeLines; - } elseif ($hasCommentTokens === true) { - ++$commentLines; - } - } - - // We've already examined the opener line, so move to the next line. - for ($i = ($opener + 1); $tokens[$i]['line'] === $currentLine && $i < $closer; $i++); - $currentLine = $tokens[$i]['line']; - - // Walk tokens. - while ($currentLine !== $closerLine) { - $hasCommentTokens = false; - $hasCodeTokens = false; - - while ($tokens[$i]['line'] === $currentLine) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { - $hasCodeTokens = true; - } elseif (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { - $hasCommentTokens = true; - } - - ++$i; - } - - if ($hasCodeTokens === true) { - ++$codeLines; - } elseif ($hasCommentTokens === true) { - ++$commentLines; - } else { - // Only option left is that this is an empty line. - ++$blankLines; - } - - $currentLine = $tokens[$i]['line']; - } - - $nonBlankLines = ($codeLines + $commentLines); - $totalLines = ($codeLines + $commentLines + $blankLines); - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_CODE, $codeLines . ' lines'); - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_COMMENTS, $nonBlankLines . ' lines'); - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_ALL, $totalLines . ' lines'); - - $lines = $codeLines; - if ($this->ignoreCommentLines === false) { - $lines += $commentLines; - } - if ($this->ignoreEmptyLines === false) { - $lines += $blankLines; - } - - $errorSuffix = ' Declare a named function instead. Found closure containing %s lines'; - - if ($lines > $this->maxLines) { - $phpcsFile->addError( - 'Closures which are longer than %s lines are forbidden.' . $errorSuffix, - $stackPtr, - 'ExceedsMaximum', - [$this->maxLines, $lines] - ); - - return; - } - - if ($lines > $this->recommendedLines) { - $phpcsFile->addWarning( - 'It is recommended for closures to contain %s lines or less.' . $errorSuffix, - $stackPtr, - 'ExceedsRecommended', - [$this->recommendedLines, $lines] - ); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php deleted file mode 100644 index 505c19b3..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php +++ /dev/null @@ -1,120 +0,0 @@ - - */ - public function register() - { - return [\T_FUNCTION]; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.1.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(); - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { - // Parse error/live coding. - return; - } - - $scopePtr = Scopes::validDirectScope($phpcsFile, $stackPtr, \T_TRAIT); - if ($scopePtr === false) { - // Not a trait method. - return; - } - - $methodProps = FunctionDeclarations::getProperties($phpcsFile, $stackPtr); - if ($methodProps['scope'] === 'private') { - // Private methods can't be final. - return; - } - - if ($methodProps['is_final'] === true) { - // Already final, nothing to do. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'final'); - return; - } - - if ($methodProps['is_abstract'] === true) { - // Abstract classes can't be final. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'abstract'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'not abstract, not final'); - - $methodName = FunctionDeclarations::getName($phpcsFile, $stackPtr); - $magic = ''; - $code = 'NonFinalMethodFound'; - if (FunctionDeclarations::isMagicMethodName($methodName) === true) { - // Use separate error code for magic methods. - $magic = 'magic '; - $code = 'NonFinalMagicMethodFound'; - } - - $data = [ - $methodProps['scope'], - $magic, - $methodName, - ObjectDeclarations::getName($phpcsFile, $scopePtr), - ]; - - $fix = $phpcsFile->addFixableError( - 'The non-abstract, %s %smethod "%s()" in trait %s should be declared as final.', - $stackPtr, - $code, - $data - ); - - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, 'final '); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php deleted file mode 100644 index de7447e0..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php +++ /dev/null @@ -1,71 +0,0 @@ - - */ - public function register() - { - return [\T_LIST]; - } - - /** - * 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) - { - $openClose = Lists::getOpenClose($phpcsFile, $stackPtr); - if ($openClose === false) { - // Live coding or parse error. - return; - } - - $fix = $phpcsFile->addFixableError('Long list syntax is not allowed', $stackPtr, 'Found'); - - if ($fix === true) { - $opener = $openClose['opener']; - $closer = $openClose['closer']; - - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken($stackPtr, ''); - $phpcsFile->fixer->replaceToken($opener, '['); - $phpcsFile->fixer->replaceToken($closer, ']'); - - $phpcsFile->fixer->endChangeset(); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php deleted file mode 100644 index af2a9489..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php +++ /dev/null @@ -1,86 +0,0 @@ - - */ - public function register() - { - return Collections::listOpenTokensBC(); - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === \T_LIST) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); - return; - } - - $openClose = Lists::getOpenClose($phpcsFile, $stackPtr); - - if ($openClose === false) { - // Not a short list, live coding or parse error. - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); - - $fix = $phpcsFile->addFixableError('Short list syntax is not allowed', $stackPtr, 'Found'); - - if ($fix === true) { - $opener = $openClose['opener']; - $closer = $openClose['closer']; - - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($opener, 'list('); - $phpcsFile->fixer->replaceToken($closer, ')'); - $phpcsFile->fixer->endChangeset(); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php deleted file mode 100644 index 3b6ad982..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ - public function register() - { - return [\T_NAMESPACE]; - } - - /** - * 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) - { - if (Namespaces::isDeclaration($phpcsFile, $stackPtr) === false) { - // Namespace operator, not a declaration; or live coding/parse error. - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_condition']) === false - || $tokens[$stackPtr]['scope_condition'] !== $stackPtr - ) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); - - $phpcsFile->addError( - 'Namespace declarations using the curly brace syntax are not allowed.', - $stackPtr, - 'Forbidden' - ); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php deleted file mode 100644 index 5348e707..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php +++ /dev/null @@ -1,80 +0,0 @@ - - */ - public function register() - { - return [\T_NAMESPACE]; - } - - /** - * 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) - { - $name = Namespaces::getDeclaredName($phpcsFile, $stackPtr); - if ($name === false) { - // Use of the namespace keyword as an operator or live coding/parse error. - return; - } - - if ($name !== '') { - // Named namespace. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); - - // Namespace declaration without namespace name (= global namespace). - $phpcsFile->addError( - 'Namespace declarations without a namespace name are not allowed.', - $stackPtr, - 'Forbidden' - ); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php deleted file mode 100644 index 78fa3261..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ - public function register() - { - return [\T_NAMESPACE]; - } - - /** - * 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) - { - if (Namespaces::isDeclaration($phpcsFile, $stackPtr) === false) { - // Namespace operator, not a declaration; or live coding/parse error. - return; - } - - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_condition']) === true - && $tokens[$stackPtr]['scope_condition'] === $stackPtr - ) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'yes'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'no'); - - $phpcsFile->addError( - 'Namespace declarations without curly braces are not allowed.', - $stackPtr, - 'Forbidden' - ); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php deleted file mode 100644 index 65f3e589..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php +++ /dev/null @@ -1,96 +0,0 @@ - - */ - public function register() - { - return [\T_NAMESPACE]; - } - - /** - * 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) - { - $fileName = $phpcsFile->getFilename(); - if ($this->currentFile !== $fileName) { - // Reset the properties for each new file. - $this->currentFile = $fileName; - $this->declarationSeen = false; - } - - if (Namespaces::isDeclaration($phpcsFile, $stackPtr) === false) { - // Namespace operator, not a declaration; or live coding/parse error. - return; - } - - if ($this->declarationSeen === false) { - // This is the first namespace declaration in the file. - $this->declarationSeen = $stackPtr; - return; - } - - $tokens = $phpcsFile->getTokens(); - - // OK, so this is a file with multiple namespace declarations. - $phpcsFile->addError( - 'There should be only one namespace declaration per file. The first declaration was found on line %d', - $stackPtr, - 'MultipleFound', - [$tokens[$this->declarationSeen]['line']] - ); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php deleted file mode 100644 index 7815e7e0..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php +++ /dev/null @@ -1,190 +0,0 @@ - Key is the lowercased keyword, value the "proper" cased keyword. - */ - private $reservedNames = [ - 'abstract' => 'abstract', - 'and' => 'and', - 'array' => 'array', - 'as' => 'as', - 'break' => 'break', - 'callable' => 'callable', - 'case' => 'case', - 'catch' => 'catch', - 'class' => 'class', - 'clone' => 'clone', - 'const' => 'const', - 'continue' => 'continue', - 'declare' => 'declare', - 'default' => 'default', - 'die' => 'die', - 'do' => 'do', - 'echo' => 'echo', - 'else' => 'else', - 'elseif' => 'elseif', - 'empty' => 'empty', - 'enddeclare' => 'enddeclare', - 'endfor' => 'endfor', - 'endforeach' => 'endforeach', - 'endif' => 'endif', - 'endswitch' => 'endswitch', - 'endwhile' => 'endwhile', - 'enum' => 'enum', - 'eval' => 'eval', - 'exit' => 'exit', - 'extends' => 'extends', - 'final' => 'final', - 'finally' => 'finally', - 'fn' => 'fn', - 'for' => 'for', - 'foreach' => 'foreach', - 'function' => 'function', - 'global' => 'global', - 'goto' => 'goto', - 'if' => 'if', - 'implements' => 'implements', - 'include' => 'include', - 'include_once' => 'include_once', - 'instanceof' => 'instanceof', - 'insteadof' => 'insteadof', - 'interface' => 'interface', - 'isset' => 'isset', - 'list' => 'list', - 'match' => 'match', - 'namespace' => 'namespace', - 'new' => 'new', - 'or' => 'or', - 'print' => 'print', - 'private' => 'private', - 'protected' => 'protected', - 'public' => 'public', - 'readonly' => 'readonly', - 'require' => 'require', - 'require_once' => 'require_once', - 'return' => 'return', - 'static' => 'static', - 'switch' => 'switch', - 'throw' => 'throw', - 'trait' => 'trait', - 'try' => 'try', - 'unset' => 'unset', - 'use' => 'use', - 'var' => 'var', - 'while' => 'while', - 'xor' => 'xor', - 'yield' => 'yield', - '__class__' => '__CLASS__', - '__dir__' => '__DIR__', - '__file__' => '__FILE__', - '__function__' => '__FUNCTION__', - '__line__' => '__LINE__', - '__method__' => '__METHOD__', - '__namespace__' => '__NAMESPACE__', - '__trait__' => '__TRAIT__', - 'int' => 'int', - 'float' => 'float', - 'bool' => 'bool', - 'string' => 'string', - 'true' => 'true', - 'false' => 'false', - 'null' => 'null', - 'void' => 'void', - 'iterable' => 'iterable', - 'object' => 'object', - 'resource' => 'resource', - 'mixed' => 'mixed', - 'numeric' => 'numeric', - 'never' => 'never', - - /* - * Not reserved keywords, but equally confusing when used in the context of function calls - * with named parameters. - */ - 'parent' => 'parent', - 'self' => 'self', - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - return Collections::functionDeclarationTokens(); - } - - /** - * 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) - { - // Get all parameters from method signature. - $parameters = FunctionDeclarations::getParameters($phpcsFile, $stackPtr); - if (empty($parameters)) { - return; - } - - $message = 'It is recommended not to use reserved keyword "%s" as function parameter name. Found: %s'; - - foreach ($parameters as $param) { - $name = \ltrim($param['name'], '$'); - $nameLC = \strtolower($name); - if (isset($this->reservedNames[$nameLC]) === true) { - $errorCode = $nameLC . 'Found'; - $data = [ - $this->reservedNames[$nameLC], - $param['name'], - ]; - - $phpcsFile->addWarning($message, $param['token'], $errorCode, $data); - } - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php deleted file mode 100644 index 4d765c2c..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php +++ /dev/null @@ -1,275 +0,0 @@ - - * class Foo implements \Vendor\DiffIterator, My\Count, DateTimeInterface {} - * - * - * If sorted using the "name" sort-order, the sniff looks just at the interface name, i.e. - * `DiffIterator`, `Count` and `DateTimeInterface`, which for this example would mean - * the correct order would be `My\Count, DateTimeInterface, \Vendor\DiffIterator`. - * - * If sorted using the "full" sort-order, the sniff will look at the full name as used - * in the `implements` statement, without leading backslashes. - * For the example above, this would mean that the correct order would be: - * `DateTimeInterface, My\Count, \Vendor\DiffIterator`. - * - * @since 1.0.0 - * - * @var string - */ - public $orderby = 'name'; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - return (Collections::ooCanExtend() + Collections::ooCanImplement()); - } - - /** - * 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 setting. - */ - if ($this->orderby !== 'full') { - // Use the default. - $this->orderby = 'name'; - } - $metricNameAlpha = \sprintf(self::METRIC_NAME_ALPHA, $this->orderby); - - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - // Parse error or live coding. Ignore. - return; - } - - $scopeOpener = $tokens[$stackPtr]['scope_opener']; - - /* - * Get the names. - */ - if (isset(Collections::ooCanImplement()[$tokens[$stackPtr]['code']]) === true) { - $names = ObjectDeclarations::findImplementedInterfaceNames($phpcsFile, $stackPtr); - } else { - $names = ObjectDeclarations::findExtendedInterfaceNames($phpcsFile, $stackPtr); - } - - if (\is_array($names) === false) { - // Class/interface/enum doesn't extend or implement. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_COUNT, 0); - $phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'n/a'); - return; - } - - $count = \count($names); - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_COUNT, $count); - - if ($count < 2) { - // Nothing to sort. - $phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'n/a'); - return; - } - - /* - * Check the order. - */ - if ($this->orderby === 'name') { - $sorted = $this->sortByName($names); - } else { - $sorted = $this->sortByFull($names); - } - - if ($sorted === $names) { - // Order is already correct. - $phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'yes'); - return; - } - - $phpcsFile->recordMetric($stackPtr, $metricNameAlpha, 'no'); - - /* - * Throw the error. - */ - $keyword = \T_IMPLEMENTS; - if (isset(Collections::ooCanImplement()[$tokens[$stackPtr]['code']]) === false) { - $keyword = \T_EXTENDS; - } - - $fixable = true; - $keywordPtr = $phpcsFile->findNext($keyword, ($stackPtr + 1), $scopeOpener); - $hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($keywordPtr + 1), $scopeOpener); - if ($hasComment !== false) { - $fixable = false; - } - - $error = "The interface names in a \"%s %s\" statement should be ordered alphabetically.\n"; - $error .= 'Expected: %s; Found: %s'; - $code = \ucfirst(\strtolower($tokens[$keywordPtr]['content'])) . 'WrongOrder'; - $data = [ - $tokens[$stackPtr]['content'], - $tokens[$keywordPtr]['content'], - \implode(', ', $names), - \implode(', ', $sorted), - ]; - - if ($fixable === false) { - $code .= 'WithComments'; - $phpcsFile->addError($error, $keywordPtr, $code, $data); - return; - } - - // OK, so we appear to have a fixable error. - $fix = $phpcsFile->addFixableError($error, $keywordPtr, $code, $data); - if ($fix === false) { - return; - } - - $phpcsFile->fixer->beginChangeset(); - - // Remove the complete previous extends/implements part. - for ($i = ($keywordPtr + 1); $i < $scopeOpener; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContent($keywordPtr, ' ' . \implode(', ', $sorted) . ' '); - - $phpcsFile->fixer->endChangeset(); - } - - /** - * Sort an array of potentially mixed qualified and unqualified names by the interface name. - * - * @since 1.0.0 - * - * @param string[] $names Interface names, potentially mixed qualified and unqualified. - * - * @return string[] - */ - protected function sortByName(array $names) - { - $getLastName = function ($name) { - $last = \strrchr($name, '\\'); - if ($last === false) { - $last = $name; - } else { - $last = \substr($last, 1); - } - - return $last; - }; - - return $this->sortNames($names, $getLastName); - } - - /** - * Sort an array of potentially mixed qualified and unqualified names by the full name. - * - * @since 1.0.0 - * - * @param string[] $names Interface names, potentially mixed qualified and unqualified. - * - * @return string[] - */ - protected function sortByFull(array $names) - { - $trimLeadingBackslash = function ($name) { - return \ltrim($name, '\\'); - }; - - return $this->sortNames($names, $trimLeadingBackslash); - } - - /** - * Sort an array of names. - * - * @since 1.0.0 - * - * @param string[] $names Interface names, potentially mixed qualified and unqualified. - * @param callable $prepareNames Function to call to prepare the names before sorting. - * - * @return string[] - */ - private function sortNames(array $names, callable $prepareNames) - { - $preppedNames = \array_map($prepareNames, $names); - $names = \array_combine($names, $preppedNames); - - \natcasesort($names); - - return \array_keys($names); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php deleted file mode 100644 index 093785ad..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php +++ /dev/null @@ -1,204 +0,0 @@ - - */ - 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/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php deleted file mode 100644 index 19e49717..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php +++ /dev/null @@ -1,112 +0,0 @@ - - */ - private $metricType = [ - \T_LOGICAL_AND => 'logical (and/or)', - \T_LOGICAL_OR => 'logical (and/or)', - \T_BOOLEAN_AND => 'boolean (&&/||)', - \T_BOOLEAN_OR => 'boolean (&&/||)', - ]; - - /** - * The tokens this sniff targets with error code and replacements. - * - * @since 1.0.0 - * - * @var array> - */ - private $targetTokenInfo = [ - \T_LOGICAL_AND => [ - 'error_code' => 'LogicalAnd', - 'replacement' => '&&', - ], - \T_LOGICAL_OR => [ - 'error_code' => 'LogicalOr', - 'replacement' => '||', - ], - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - return \array_keys($this->metricType); - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - $tokenCode = $tokens[$stackPtr]['code']; - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, $this->metricType[$tokenCode]); - - if (isset($this->targetTokenInfo[$tokenCode]) === false) { - // Already using boolean operator. - return; - } - - $error = 'Using logical operators is not allowed. Expected: "%s"; Found: "%s"'; - $data = [ - $this->targetTokenInfo[$tokenCode]['replacement'], - $tokens[ $stackPtr ]['content'], - ]; - - $phpcsFile->addError($error, $stackPtr, $this->targetTokenInfo[$tokenCode]['error_code'], $data); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php deleted file mode 100644 index 37a39a18..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ - public function register() - { - return [\T_INLINE_THEN]; - } - - /** - * 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) - { - if (Operators::isShortTernary($phpcsFile, $stackPtr) === false) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'long'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'short'); - - $phpcsFile->addError( - 'Using short ternaries is not allowed as they are rarely used correctly', - $stackPtr, - 'Found' - ); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php deleted file mode 100644 index b8538882..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php +++ /dev/null @@ -1,197 +0,0 @@ - - */ - private $allowedTokens = [ - \T_VARIABLE => \T_VARIABLE, - ]; - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - $this->allowedTokens += Collections::ooHierarchyKeywords(); - $this->allowedTokens += Collections::objectOperators(); - $this->allowedTokens += Collections::namespacedNameTokens(); - - /* - * Remove nullsafe object operator. In/decrement not allowed in write context, - * so ignore. - */ - unset($this->allowedTokens[\T_NULLSAFE_OBJECT_OPERATOR]); - - return Collections::incrementDecrementOperators(); - } - - /** - * 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 int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (empty($tokens[$stackPtr]['nested_parenthesis']) === false) { - // Not a stand-alone statement. - return; - } - - $start = BCFile::findStartOfStatement($phpcsFile, $stackPtr); - $end = BCFile::findEndOfStatement($phpcsFile, $stackPtr); - - if (isset(Collections::incrementDecrementOperators()[$tokens[$end]['code']])) { - // Statement ends on a PHP close tag, set the end pointer to the close tag. - $end = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - } - - if ($tokens[$end]['code'] !== \T_SEMICOLON - && $tokens[$end]['code'] !== \T_CLOSE_TAG - ) { - // Not a stand-alone statement. - return $end; - } - - $counter = 0; - $lastCode = null; - $operators = Collections::incrementDecrementOperators(); - for ($i = $start; $i < $end; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - if (isset($operators[$tokens[$i]['code']]) === true) { - $lastCode = $tokens[$i]['code']; - ++$counter; - continue; - } - - if (isset($this->allowedTokens[$tokens[$i]['code']]) === true) { - $lastCode = $tokens[$i]['code']; - continue; - } - - if ($tokens[$i]['code'] === \T_OPEN_SQUARE_BRACKET - && isset($tokens[$i]['bracket_closer']) - && ($lastCode === \T_VARIABLE || $lastCode === \T_STRING) - ) { - // Array access. - $i = $tokens[$i]['bracket_closer']; - continue; - } - - // Came across an unexpected token. This is (probably) not a stand-alone statement. - return $end; - } - - if ($counter > 1) { - $phpcsFile->addWarning( - 'Using multiple increment/decrement operators in a stand-alone statement is strongly discouraged.' - . ' Found: %s', - $stackPtr, - 'MultipleOperatorsFound', - [GetTokensAsString::compact($phpcsFile, $start, ($end - 1), true)] - ); - - return $end; - } - - $type = 'increment'; - if ($tokens[$stackPtr]['code'] === \T_DEC) { - $type = 'decrement'; - } - - $lastNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($end - 1), $start, true); - if ($start === $stackPtr && $lastNonEmpty !== $stackPtr) { - // This is already pre-in/decrement. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'pre-' . $type); - return $end; - } - - if ($lastNonEmpty === false || $lastNonEmpty === $start || $lastNonEmpty !== $stackPtr) { - // Parse error or otherwise unsupported syntax. Ignore. - return $end; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'post-' . $type); - - $error = 'Stand-alone post-%1$s statement found. Use pre-%1$s instead: %2$s.'; - $errorCode = 'Post' . \ucfirst($type) . 'Found'; - $replacement = $tokens[$stackPtr]['content']; - $replacement .= GetTokensAsString::compact($phpcsFile, $start, ($lastNonEmpty - 1), true); - $data = [ - $type, - $replacement, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($stackPtr, ''); - $phpcsFile->fixer->addContentBefore($start, $tokens[$stackPtr]['content']); - $phpcsFile->fixer->endChangeset(); - } - - return $end; - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php deleted file mode 100644 index c828df9e..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php +++ /dev/null @@ -1,116 +0,0 @@ - - */ - private $metricType = [ - \T_IS_EQUAL => 'loose', - \T_IS_NOT_EQUAL => 'loose', - \T_IS_IDENTICAL => 'strict', - \T_IS_NOT_IDENTICAL => 'strict', - ]; - - /** - * The tokens this sniff targets with error code and replacements. - * - * @since 1.0.0 - * - * @var array> - */ - private $targetTokenInfo = [ - \T_IS_EQUAL => [ - 'error_code' => 'LooseEqual', - 'replacement' => '===', - ], - \T_IS_NOT_EQUAL => [ - 'error_code' => 'LooseNotEqual', - 'replacement' => '!==', - ], - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - return \array_keys($this->metricType); - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - $tokenCode = $tokens[$stackPtr]['code']; - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, $this->metricType[$tokenCode]); - - if (isset($this->targetTokenInfo[$tokenCode]) === false) { - // Already using strict comparison operator. - return; - } - - $error = 'Loose comparisons are not allowed. Expected: "%s"; Found: "%s"'; - $data = [ - $this->targetTokenInfo[$tokenCode]['replacement'], - $tokens[ $stackPtr ]['content'], - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $this->targetTokenInfo[$tokenCode]['error_code'], $data); - if ($fix === false) { - return; - } - - $phpcsFile->fixer->replaceToken($stackPtr, $this->targetTokenInfo[$tokenCode]['replacement']); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php deleted file mode 100644 index 440ecc86..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php +++ /dev/null @@ -1,85 +0,0 @@ - - */ - public function register() - { - return [ - \T_TYPE_UNION, - \T_TYPE_INTERSECTION, - ]; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - - $type = ($tokens[$stackPtr]['code'] === \T_TYPE_UNION) ? 'union' : 'intersection'; - $code = \ucfirst($type) . 'Type'; - - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - SpacesFixer::checkAndFix( - $phpcsFile, - $stackPtr, - $prevNonEmpty, - 0, // Expected spaces. - 'Expected %s before the ' . $type . ' type separator. Found: %s', - $code . 'SpacesBefore', - 'error', - 0, // Severity. - 'Space before ' . $type . ' type separator' - ); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - SpacesFixer::checkAndFix( - $phpcsFile, - $stackPtr, - $nextNonEmpty, - 0, // Expected spaces. - 'Expected %s after the ' . $type . ' type separator. Found: %s', - $code . 'SpacesAfter', - 'error', - 0, // Severity. - 'Space after ' . $type . ' type separator' - ); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php deleted file mode 100644 index b231b225..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php +++ /dev/null @@ -1,87 +0,0 @@ - - */ - 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/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php deleted file mode 100644 index cbccb4c6..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php +++ /dev/null @@ -1,101 +0,0 @@ - - */ - public function register() - { - return [\T_OPEN_TAG_WITH_ECHO]; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - - for ($endOfStatement = ($stackPtr + 1); $endOfStatement < $phpcsFile->numTokens; $endOfStatement++) { - if ($tokens[$endOfStatement]['code'] === \T_CLOSE_TAG - || $tokens[$endOfStatement]['code'] === \T_SEMICOLON - ) { - break; - } - - // Skip over anything within parenthesis. - if ($tokens[$endOfStatement]['code'] === \T_OPEN_PARENTHESIS - && isset($tokens[$endOfStatement]['parenthesis_closer']) - ) { - $endOfStatement = $tokens[$endOfStatement]['parenthesis_closer']; - } - } - - if ($endOfStatement === $phpcsFile->numTokens - || $tokens[$endOfStatement]['code'] === \T_CLOSE_TAG - ) { - return; - } - - // Semi-colon, so check for any code between it and the close tag. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($endOfStatement + 1), null, true); - if ($nextNonEmpty === false - || $tokens[$nextNonEmpty]['code'] === \T_CLOSE_TAG - ) { - return; - } - - $fix = $phpcsFile->addFixableError( - 'Only one statement is allowed when using short open echo PHP tags.' - . ' Use the "fixer->replaceToken($stackPtr, 'fixer->replaceToken($stackPtr, ' - */ - public function register() - { - return [\T_USE]; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.1.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) - { - if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { - // Closure or trait use statement. Bow out. - return; - } - - $useStatements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); - - $ooCount = \count($useStatements['name']); - $functionCount = \count($useStatements['function']); - $constantCount = \count($useStatements['const']); - $totalCount = $ooCount + $functionCount + $constantCount; - - if ($totalCount === 0) { - // There must have been a parse error. Bow out. - return; - } - - // End of statement will always be found, otherwise the import statement parsing would have failed. - $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); - $groupStart = $phpcsFile->findNext(\T_OPEN_USE_GROUP, ($stackPtr + 1), $endOfStatement); - - if ($groupStart === false) { - // Not a group use statement. Just record the metric. - if ($totalCount === 1) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'single import'); - } else { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'multi import'); - } - - return; - } - - if ($totalCount === 1 - || ($ooCount !== 0 && $functionCount === 0 && $constantCount === 0) - || ($ooCount === 0 && $functionCount !== 0 && $constantCount === 0) - || ($ooCount === 0 && $functionCount === 0 && $constantCount !== 0) - ) { - // Not a *mixed* group use statement. - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'group use, single type'); - return; - } - - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME, 'group use, multi type'); - - // Build up the error message. - $foundPhrases = []; - if ($ooCount > 1) { - $foundPhrases[] = \sprintf('%d namespaces/OO names', $ooCount); - } elseif ($ooCount === 1) { - $foundPhrases[] = \sprintf('%d namespace/OO name', $ooCount); - } - - if ($functionCount > 1) { - $foundPhrases[] = \sprintf('%d functions', $functionCount); - } elseif ($functionCount === 1) { - $foundPhrases[] = \sprintf('%d function', $functionCount); - } - - if ($constantCount > 1) { - $foundPhrases[] = \sprintf('%d constants', $constantCount); - } elseif ($constantCount === 1) { - $foundPhrases[] = \sprintf('%d constant', $constantCount); - } - - if (\count($foundPhrases) === 2) { - $found = \implode(' and ', $foundPhrases); - } else { - $found = \array_shift($foundPhrases) . ', '; - $found .= \implode(' and ', $foundPhrases); - } - - $error = 'Group use statements should import one type of construct.' - . ' Mixed group use statement found importing %s.'; - $code = 'Found'; - $data = [$found]; - - $hasComment = $phpcsFile->findNext(Tokens::$commentTokens, ($stackPtr + 1), $endOfStatement); - if ($hasComment !== false) { - // Don't attempt to auto-fix is there are comments or PHPCS annotations in the statement. - $phpcsFile->addError($error, $stackPtr, $code, $data); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $code, $data); - - if ($fix === false) { - return; - } - - /* - * Fix it. - * - * This fixer complies with the following (arbitrary) requirements: - * - It will re-use the original base "group" name, i.e. the part before \{. - * - It take take aliases into account, but only when something is aliased to a different name. - * Aliases re-using the original name will be removed. - * - The fix will not add a trailing comma after the last group use sub-statement. - * This is a PHP 7.2+ feature. - * If a standard wants to enforce trailing commas, they should use a separate sniff for that. - * - If there is only 1 statement of a certain type, the replacement will be a single - * import use statement, not a group use statement. - */ - - $phpcsFile->fixer->beginChangeset(); - - // Ensure that a potential close PHP tag ending the statement is not removed. - $tokens = $phpcsFile->getTokens(); - $endRemoval = $endOfStatement; - if ($tokens[$endOfStatement]['code'] !== \T_SEMICOLON) { - $endRemoval = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($endOfStatement - 1), null, true); - } - - // Remove old statement with the exception of the `use` keyword. - for ($i = ($stackPtr + 1); $i <= $endRemoval; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Build up the new use import statements. - $newStatements = []; - - $useIndent = \str_repeat(' ', ($tokens[$stackPtr]['column'] - 1)); - $insideIndent = $useIndent . \str_repeat(' ', 4); - - $baseGroupName = GetTokensAsString::noEmpties($phpcsFile, ($stackPtr + 1), ($groupStart - 1)); - - foreach ($useStatements as $type => $statements) { - $count = \count($statements); - if ($count === 0) { - continue; - } - - $typeName = $type . ' '; - if ($type === 'name') { - $typeName = ''; - } - - if ($count === 1) { - $fqName = \reset($statements); - $alias = \key($statements); - - $newStatement = 'use ' . $typeName . $fqName; - - $unqualifiedName = \ltrim(\substr($fqName, \strrpos($fqName, '\\')), '\\'); - if ($unqualifiedName !== $alias) { - $newStatement .= ' as ' . $alias; - } - - $newStatement .= ';'; - - $newStatements[] = $newStatement; - continue; - } - - // Multiple statements, add a single-type group use statement. - $newStatement = 'use ' . $typeName . $baseGroupName . '{' . $phpcsFile->eolChar; - - foreach ($statements as $alias => $fqName) { - $partialName = \str_replace($baseGroupName, '', $fqName); - $newStatement .= $insideIndent . $partialName; - - $unqualifiedName = \ltrim(\substr($partialName, \strrpos($partialName, '\\')), '\\'); - if ($unqualifiedName !== $alias) { - $newStatement .= ' as ' . $alias; - } - - $newStatement .= ',' . $phpcsFile->eolChar; - } - - // Remove trailing comma after last statement as that's PHP 7.2+. - $newStatement = \rtrim($newStatement, ',' . $phpcsFile->eolChar); - - $newStatement .= $phpcsFile->eolChar . $useIndent . '};'; - $newStatements[] = $newStatement; - } - - $replacement = \implode($phpcsFile->eolChar . $useIndent, $newStatements); - - $phpcsFile->fixer->replaceToken($stackPtr, $replacement); - - $phpcsFile->fixer->endChangeset(); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php deleted file mode 100644 index 8dcf8ddb..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php +++ /dev/null @@ -1,211 +0,0 @@ - - */ - public function register() - { - return [ - \T_USE, - \T_NAMESPACE, - ]; - } - - /** - * 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) - { - $file = $phpcsFile->getFilename(); - if ($file !== $this->currentFile) { - // Reset the current namespace for each new file. - $this->currentFile = $file; - $this->currentNamespace = ''; - } - - $tokens = $phpcsFile->getTokens(); - - // Get the name of the current namespace. - if ($tokens[$stackPtr]['code'] === \T_NAMESPACE) { - $namespaceName = Namespaces::getDeclaredName($phpcsFile, $stackPtr); - if ($namespaceName !== false) { - $this->currentNamespace = $namespaceName; - } - - return; - } - - // Ok, so this is a T_USE token. - try { - $statements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); - } catch (RuntimeException $e) { - // Not an import use statement. Bow out. - return; - } - - if (empty($statements['name'])) { - // No class/trait/interface/enum import statements found. - return; - } - - $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); - - foreach ($statements['name'] as $alias => $fullName) { - $reportPtr = $stackPtr; - do { - $reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias); - if ($reportPtr === false) { - // Shouldn't be possible. - continue 2; // @codeCoverageIgnore - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($reportPtr + 1), $endOfStatement, true); - if ($next !== false && $tokens[$next]['code'] === \T_NS_SEPARATOR) { - // Namespace level with same name. Continue searching. - continue; - } - - break; - } while (true); - - /* - * Build the error message and code. - * - * Check whether this is a non-namespaced (global) import and check whether this is an - * import from within the same namespace. - * - * Takes incorrect use statements with leading backslash into account. - * Takes case-INsensitivity of namespaces names into account. - * - * The "GlobalNamespace" error code takes precedence over the "SameNamespace" error code - * in case this is a non-namespaced file. - */ - - $error = 'Use import statements for class/interface/trait/enum%s are not allowed.'; - $error .= ' Found import statement for: "%s"'; - $errorCode = 'Found'; - $data = [ - '', - $fullName, - ]; - - $globalNamespace = false; - $sameNamespace = false; - if (\strpos($fullName, '\\', 1) === false) { - $globalNamespace = true; - $errorCode = 'FromGlobalNamespace'; - $data[0] = ' from the global namespace'; - - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace'); - } elseif ($this->currentNamespace !== '' - && (\stripos($fullName, $this->currentNamespace . '\\') === 0 - || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0) - ) { - $sameNamespace = true; - $errorCode = 'FromSameNamespace'; - $data[0] = ' from the same namespace'; - - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'same namespace'); - } else { - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'different namespace'); - } - - $hasAlias = false; - $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1))); - $aliasLC = \strtolower($alias); - if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) { - $hasAlias = true; - $error .= ' with alias: "%s"'; - $errorCode .= 'WithAlias'; - $data[] = $alias; - - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'with alias'); - } else { - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'without alias'); - } - - if ($errorCode === 'Found') { - $errorCode = 'FoundWithoutAlias'; - } - - $phpcsFile->addError($error, $reportPtr, $errorCode, $data); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php deleted file mode 100644 index 44388f6a..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php +++ /dev/null @@ -1,211 +0,0 @@ - - */ - public function register() - { - return [ - \T_USE, - \T_NAMESPACE, - ]; - } - - /** - * 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) - { - $file = $phpcsFile->getFilename(); - if ($file !== $this->currentFile) { - // Reset the current namespace for each new file. - $this->currentFile = $file; - $this->currentNamespace = ''; - } - - $tokens = $phpcsFile->getTokens(); - - // Get the name of the current namespace. - if ($tokens[$stackPtr]['code'] === \T_NAMESPACE) { - $namespaceName = Namespaces::getDeclaredName($phpcsFile, $stackPtr); - if ($namespaceName !== false) { - $this->currentNamespace = $namespaceName; - } - - return; - } - - // Ok, so this is a T_USE token. - try { - $statements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); - } catch (RuntimeException $e) { - // Not an import use statement. Bow out. - return; - } - - if (empty($statements['const'])) { - // No import statements for constants found. - return; - } - - $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); - - foreach ($statements['const'] as $alias => $fullName) { - $reportPtr = $stackPtr; - do { - $reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias); - if ($reportPtr === false) { - // Shouldn't be possible. - continue 2; // @codeCoverageIgnore - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($reportPtr + 1), $endOfStatement, true); - if ($next !== false && $tokens[$next]['code'] === \T_NS_SEPARATOR) { - // Namespace level with same name. Continue searching. - continue; - } - - break; - } while (true); - - /* - * Build the error message and code. - * - * Check whether this is a non-namespaced (global) import and check whether this is an - * import from within the same namespace. - * - * Takes incorrect use statements with leading backslash into account. - * Takes case-INsensitivity of namespaces names into account. - * - * The "GlobalNamespace" error code takes precedence over the "SameNamespace" error code - * in case this is a non-namespaced file. - */ - - $error = 'Use import statements for constants%s are not allowed.'; - $error .= ' Found import statement for: "%s"'; - $errorCode = 'Found'; - $data = [ - '', - $fullName, - ]; - - $globalNamespace = false; - $sameNamespace = false; - if (\strpos($fullName, '\\', 1) === false) { - $globalNamespace = true; - $errorCode = 'FromGlobalNamespace'; - $data[0] = ' from the global namespace'; - - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace'); - } elseif ($this->currentNamespace !== '' - && (\stripos($fullName, $this->currentNamespace . '\\') === 0 - || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0) - ) { - $sameNamespace = true; - $errorCode = 'FromSameNamespace'; - $data[0] = ' from the same namespace'; - - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'same namespace'); - } else { - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'different namespace'); - } - - $hasAlias = false; - $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1))); - $aliasLC = \strtolower($alias); - if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) { - $hasAlias = true; - $error .= ' with alias: "%s"'; - $errorCode .= 'WithAlias'; - $data[] = $alias; - - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'with alias'); - } else { - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'without alias'); - } - - if ($errorCode === 'Found') { - $errorCode = 'FoundWithoutAlias'; - } - - $phpcsFile->addError($error, $reportPtr, $errorCode, $data); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php deleted file mode 100644 index 46a39edb..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php +++ /dev/null @@ -1,211 +0,0 @@ - - */ - public function register() - { - return [ - \T_USE, - \T_NAMESPACE, - ]; - } - - /** - * 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) - { - $file = $phpcsFile->getFilename(); - if ($file !== $this->currentFile) { - // Reset the current namespace for each new file. - $this->currentFile = $file; - $this->currentNamespace = ''; - } - - $tokens = $phpcsFile->getTokens(); - - // Get the name of the current namespace. - if ($tokens[$stackPtr]['code'] === \T_NAMESPACE) { - $namespaceName = Namespaces::getDeclaredName($phpcsFile, $stackPtr); - if ($namespaceName !== false) { - $this->currentNamespace = $namespaceName; - } - - return; - } - - // Ok, so this is a T_USE token. - try { - $statements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); - } catch (RuntimeException $e) { - // Not an import use statement. Bow out. - return; - } - - if (empty($statements['function'])) { - // No import statements for functions found. - return; - } - - $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); - - foreach ($statements['function'] as $alias => $fullName) { - $reportPtr = $stackPtr; - do { - $reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias); - if ($reportPtr === false) { - // Shouldn't be possible. - continue 2; // @codeCoverageIgnore - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($reportPtr + 1), $endOfStatement, true); - if ($next !== false && $tokens[$next]['code'] === \T_NS_SEPARATOR) { - // Namespace level with same name. Continue searching. - continue; - } - - break; - } while (true); - - /* - * Build the error message and code. - * - * Check whether this is a non-namespaced (global) import and check whether this is an - * import from within the same namespace. - * - * Takes incorrect use statements with leading backslash into account. - * Takes case-INsensitivity of namespaces names into account. - * - * The "GlobalNamespace" error code takes precedence over the "SameNamespace" error code - * in case this is a non-namespaced file. - */ - - $error = 'Use import statements for functions%s are not allowed.'; - $error .= ' Found import statement for: "%s"'; - $errorCode = 'Found'; - $data = [ - '', - $fullName, - ]; - - $globalNamespace = false; - $sameNamespace = false; - if (\strpos($fullName, '\\', 1) === false) { - $globalNamespace = true; - $errorCode = 'FromGlobalNamespace'; - $data[0] = ' from the global namespace'; - - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace'); - } elseif ($this->currentNamespace !== '' - && (\stripos($fullName, $this->currentNamespace . '\\') === 0 - || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0) - ) { - $sameNamespace = true; - $errorCode = 'FromSameNamespace'; - $data[0] = ' from the same namespace'; - - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'same namespace'); - } else { - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'different namespace'); - } - - $hasAlias = false; - $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1))); - $aliasLC = \strtolower($alias); - if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) { - $hasAlias = true; - $error .= ' with alias: "%s"'; - $errorCode .= 'WithAlias'; - $data[] = $alias; - - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'with alias'); - } else { - $phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_ALIAS, 'without alias'); - } - - if ($errorCode === 'Found') { - $errorCode = 'FoundWithoutAlias'; - } - - $phpcsFile->addError($error, $reportPtr, $errorCode, $data); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php deleted file mode 100644 index 3dd47c03..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php +++ /dev/null @@ -1,207 +0,0 @@ - - */ - protected $keywords = [ - 'const' => true, - 'function' => true, - ]; - - /** - * Returns an array of tokens this sniff wants to listen for. - * - * @since 1.1.0 - * - * @return array - */ - public function register() - { - return [\T_USE]; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.1.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) - { - if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { - // Trait or closure use statement. - return; - } - - $tokens = $phpcsFile->getTokens(); - $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); - if ($endOfStatement === false) { - // Live coding or parse error. - return; - } - - // Check the spacing after the `use` keyword. - $this->checkSpacingAfterKeyword($phpcsFile, $stackPtr, $tokens[$stackPtr]['content']); - - // Check the spacing before and after each `as` keyword. - $current = $stackPtr; - do { - $current = $phpcsFile->findNext(\T_AS, ($current + 1), $endOfStatement); - if ($current === false) { - break; - } - - // Prevent false positives when "as" is used within a "name". - if (isset(Tokens::$emptyTokens[$tokens[($current - 1)]['code']]) === true) { - $this->checkSpacingBeforeKeyword($phpcsFile, $current, $tokens[$current]['content']); - $this->checkSpacingAfterKeyword($phpcsFile, $current, $tokens[$current]['content']); - } - } while (true); - - /* - * Check the spacing after `function` and `const` keywords. - */ - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if (isset($this->keywords[\strtolower($tokens[$nextNonEmpty]['content'])]) === true) { - // Keyword found at start of statement, applies to whole statement. - $this->checkSpacingAfterKeyword($phpcsFile, $nextNonEmpty, $tokens[$nextNonEmpty]['content']); - return; - } - - // This may still be a group use statement with function/const substatements. - $openGroup = $phpcsFile->findNext(\T_OPEN_USE_GROUP, ($stackPtr + 1), $endOfStatement); - if ($openGroup === false) { - // Not a group use statement. - return; - } - - $closeGroup = $phpcsFile->findNext(\T_CLOSE_USE_GROUP, ($openGroup + 1), $endOfStatement); - - $current = $openGroup; - do { - $current = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), $closeGroup, true); - if ($current === false) { - return; - } - - if (isset($this->keywords[\strtolower($tokens[$current]['content'])]) === true) { - $this->checkSpacingAfterKeyword($phpcsFile, $current, $tokens[$current]['content']); - } - - // We're within the use group, so find the next comma. - $current = $phpcsFile->findNext(\T_COMMA, ($current + 1), $closeGroup); - } while ($current !== false); - } - - /** - * Check the spacing before a found keyword. - * - * @since 1.1.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the keyword in the token stack. - * @param string $content The keyword as found. - * - * @return void - */ - public function checkSpacingBeforeKeyword(File $phpcsFile, $stackPtr, $content) - { - $contentLC = \strtolower($content); - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - SpacesFixer::checkAndFix( - $phpcsFile, - $stackPtr, - $prevNonEmpty, - 1, // Expected spaces. - 'Expected %s before the "' . $contentLC . '" keyword. Found: %s', - 'SpaceBefore' . \ucfirst($contentLC), - 'error', - 0, // Severity. - \sprintf(self::METRIC_NAME_BEFORE, $contentLC) - ); - } - - /** - * Check the spacing after a found keyword. - * - * @since 1.1.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the keyword in the token stack. - * @param string $content The keyword as found. - * - * @return void - */ - public function checkSpacingAfterKeyword(File $phpcsFile, $stackPtr, $content) - { - $contentLC = \strtolower($content); - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - SpacesFixer::checkAndFix( - $phpcsFile, - $stackPtr, - $nextNonEmpty, - 1, // Expected spaces. - 'Expected %s after the "' . $contentLC . '" keyword. Found: %s', - 'SpaceAfter' . \ucfirst($contentLC), - 'error', - 0, // Severity. - \sprintf(self::METRIC_NAME_AFTER, $contentLC) - ); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php deleted file mode 100644 index b9f87f24..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php +++ /dev/null @@ -1,156 +0,0 @@ - - */ - protected $keywords = [ - 'const' => true, - 'function' => true, - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - return [\T_USE]; - } - - /** - * 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) - { - if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { - // Trait or closure use statement. - return; - } - - $tokens = $phpcsFile->getTokens(); - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - // Live coding or parse error. - return; - } - - if (isset($this->keywords[\strtolower($tokens[$nextNonEmpty]['content'])]) === true) { - // Keyword found at start of statement, applies to whole statement. - $this->processKeyword($phpcsFile, $nextNonEmpty, $tokens[$nextNonEmpty]['content']); - return; - } - - // This may still be a group use statement with function/const substatements. - $openGroup = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG, \T_OPEN_USE_GROUP], ($stackPtr + 1)); - if ($openGroup === false || $tokens[$openGroup]['code'] !== \T_OPEN_USE_GROUP) { - // Not a group use statement. - return; - } - - $closeGroup = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG, \T_CLOSE_USE_GROUP], ($openGroup + 1)); - if ($closeGroup === false || $tokens[$closeGroup]['code'] !== \T_CLOSE_USE_GROUP) { - // Live coding or parse error. - return; - } - - $current = $openGroup; - do { - $current = $phpcsFile->findNext(Tokens::$emptyTokens, ($current + 1), $closeGroup, true); - if ($current === false) { - return; - } - - if (isset($this->keywords[\strtolower($tokens[$current]['content'])]) === true) { - $this->processKeyword($phpcsFile, $current, $tokens[$current]['content']); - } - - // We're within the use group, so find the next comma. - $current = $phpcsFile->findNext(\T_COMMA, ($current + 1), $closeGroup); - } while ($current !== false); - } - - /** - * Processes a found keyword. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the keyword in the token stack. - * @param string $content The keyword as found. - * - * @return void - */ - public function processKeyword(File $phpcsFile, $stackPtr, $content) - { - $contentLC = \strtolower($content); - $metricName = \sprintf(self::METRIC_NAME, $contentLC); - if ($contentLC === $content) { - // Already lowercase. Bow out. - $phpcsFile->recordMetric($stackPtr, $metricName, 'lowercase'); - return; - } - - if (\strtoupper($content) === $content) { - $phpcsFile->recordMetric($stackPtr, $metricName, 'uppercase'); - } else { - $phpcsFile->recordMetric($stackPtr, $metricName, 'mixed case'); - } - - $error = 'The "%s" keyword when used in an import use statements must be lowercase.'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotLowercase', [$contentLC]); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLC); - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php deleted file mode 100644 index 1fccc828..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php +++ /dev/null @@ -1,170 +0,0 @@ - - */ - public function register() - { - return [\T_USE]; - } - - /** - * 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) - { - if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { - // Trait or closure use statement. - return; - } - - $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG, \T_OPEN_USE_GROUP], ($stackPtr + 1)); - if ($endOfStatement === false) { - // Live coding or parse error. - return; - } - - $tokens = $phpcsFile->getTokens(); - $current = $stackPtr; - - do { - $continue = $this->processImport($phpcsFile, $current, $endOfStatement); - if ($continue === false) { - break; - } - - // Move the stackPtr forward to the next part of the use statement, if any. - $current = $phpcsFile->findNext(\T_COMMA, ($current + 1), $endOfStatement); - } while ($current !== false); - - if ($tokens[$endOfStatement]['code'] !== \T_OPEN_USE_GROUP) { - // Finished the statement. - return; - } - - $current = $endOfStatement; // Group open brace. - $endOfStatement = $phpcsFile->findNext([\T_CLOSE_USE_GROUP], ($endOfStatement + 1)); - if ($endOfStatement === false) { - // Live coding or parse error. - return; - } - - do { - $continue = $this->processImport($phpcsFile, $current, $endOfStatement, true); - if ($continue === false) { - break; - } - - // Move the stackPtr forward to the next part of the use statement, if any. - $current = $phpcsFile->findNext(\T_COMMA, ($current + 1), $endOfStatement); - } while ($current !== false); - } - - /** - * Examine an individual import statement. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token. - * @param int $endOfStatement End token for the current import statement. - * @param bool $groupUse Whether the current statement is a partial one - * within a group use statement. - * - * @return bool Whether or not to continue examining this import use statement. - */ - private function processImport(File $phpcsFile, $stackPtr, $endOfStatement, $groupUse = false) - { - $tokens = $phpcsFile->getTokens(); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), $endOfStatement, true); - if ($nextNonEmpty === false) { - // Reached the end of the statement. - return false; - } - - // Skip past 'function'/'const' keyword. - $contentLC = \strtolower($tokens[$nextNonEmpty]['content']); - if ($tokens[$nextNonEmpty]['code'] === \T_STRING - && ($contentLC === 'function' || $contentLC === 'const') - ) { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextNonEmpty + 1), $endOfStatement, true); - if ($nextNonEmpty === false) { - // Reached the end of the statement. - return false; - } - } - - if ($tokens[$nextNonEmpty]['code'] === \T_NS_SEPARATOR) { - $phpcsFile->recordMetric($nextNonEmpty, self::METRIC_NAME, 'yes'); - - $error = 'An import use statement should never start with a leading backslash'; - $code = 'LeadingBackslashFound'; - - if ($groupUse === true) { - $error = 'Parse error: partial import use statement in a use group starting with a leading backslash'; - $code = 'LeadingBackslashFoundInGroup'; - } - - $fix = $phpcsFile->addFixableError($error, $nextNonEmpty, $code); - - if ($fix === true) { - if ($tokens[$nextNonEmpty - 1]['code'] !== \T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($nextNonEmpty, ' '); - } else { - $phpcsFile->fixer->replaceToken($nextNonEmpty, ''); - } - } - } else { - $phpcsFile->recordMetric($nextNonEmpty, self::METRIC_NAME, 'no'); - } - - return true; - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php deleted file mode 100644 index 93de596c..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php +++ /dev/null @@ -1,155 +0,0 @@ - - */ - public function register() - { - return [\T_USE]; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.1.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) - { - if (UseStatements::isImportUse($phpcsFile, $stackPtr) === false) { - // Closure or trait use statement. Bow out. - return; - } - - $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); - if ($endOfStatement === false) { - // Parse error or live coding. - return; - } - - $hasAliases = $phpcsFile->findNext(\T_AS, ($stackPtr + 1), $endOfStatement); - if ($hasAliases === false) { - // This use import statement does not alias anything, bow out. - return; - } - - $useStatements = UseStatements::splitImportUseStatement($phpcsFile, $stackPtr); - if (\count($useStatements, \COUNT_RECURSIVE) <= 3) { - // No statements found. Shouldn't be possible, but still. Bow out. - return; - } - - $tokens = $phpcsFile->getTokens(); - - // Collect all places where aliases are used in this use statement. - $aliasPtrs = []; - $currentAs = $hasAliases; - do { - $aliasPtr = $phpcsFile->findNext(Tokens::$emptyTokens, ($currentAs + 1), null, true); - if ($aliasPtr !== false && $tokens[$aliasPtr]['code'] === \T_STRING) { - $aliasPtrs[$currentAs] = $aliasPtr; - } - - $currentAs = $phpcsFile->findNext(\T_AS, ($currentAs + 1), $endOfStatement); - } while ($currentAs !== false); - - // Now check the names in each use statement for useless aliases. - foreach ($useStatements as $type => $statements) { - foreach ($statements as $alias => $fqName) { - $unqualifiedName = \ltrim(\substr($fqName, \strrpos($fqName, '\\')), '\\'); - - $uselessAlias = false; - if ($type === 'const') { - // Do a case-sensitive comparison for constants. - if ($unqualifiedName === $alias) { - $uselessAlias = true; - } - } elseif (NamingConventions::isEqual($unqualifiedName, $alias)) { - $uselessAlias = true; - } - - if ($uselessAlias === false) { - continue; - } - - // Now check if this is actually used as an alias or just the actual name. - foreach ($aliasPtrs as $asPtr => $aliasPtr) { - if ($tokens[$aliasPtr]['content'] !== $alias) { - continue; - } - - // Make sure this is really the right one. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($asPtr - 1), null, true); - if ($tokens[$prev]['code'] !== \T_STRING - || $tokens[$prev]['content'] !== $unqualifiedName - ) { - continue; - } - - $error = 'Useless alias "%s" found for import of "%s"'; - $code = 'Found'; - $data = [$alias, $fqName]; - - // Okay, so this is the one which should be flagged. - $hasComments = $phpcsFile->findNext(Tokens::$commentTokens, ($prev + 1), $aliasPtr); - if ($hasComments !== false) { - // Don't auto-fix if there are comments. - $phpcsFile->addError($error, $aliasPtr, $code, $data); - break; - } - - $fix = $phpcsFile->addFixableError($error, $aliasPtr, $code, $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($prev + 1); $i <= $aliasPtr; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - break; - } - } - } - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php deleted file mode 100644 index 31163165..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php +++ /dev/null @@ -1,79 +0,0 @@ - - */ - public function register() - { - return [\T_ANON_CLASS]; - } - - /** - * 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) - { - $tokens = $phpcsFile->getTokens(); - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { - // No parentheses, nothing to do. - return; - } - - SpacesFixer::checkAndFix( - $phpcsFile, - $stackPtr, - $nextNonEmpty, - (int) $this->spacing, - 'There must be %1$s between the class keyword and the open parenthesis for an anonymous class. Found: %2$s', - 'Incorrect', - 'error', - 0, - 'Anon class: space between keyword and open parenthesis' - ); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php deleted file mode 100644 index 376e9046..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php +++ /dev/null @@ -1,408 +0,0 @@ - - */ - public function register() - { - return [\T_COMMA]; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.1.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) - { - if (isset($this->phpVersion) === false || \defined('PHP_CODESNIFFER_IN_TESTS')) { - // Set default value to prevent this code from running every time the sniff is triggered. - $this->phpVersion = 0; - - $phpVersion = Helper::getConfigData('php_version'); - if ($phpVersion !== null) { - $this->phpVersion = (int) $phpVersion; - } - } - - $this->processSpacingBefore($phpcsFile, $stackPtr); - $this->processSpacingAfter($phpcsFile, $stackPtr); - } - - /** - * Check the spacing before the comma. - * - * @since 1.1.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 - */ - protected function processSpacingBefore(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $prevNonWhitespace = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($prevNonWhitespace !== $prevNonEmpty - && $tokens[$prevNonEmpty]['code'] !== \T_COMMA - && $tokens[$prevNonEmpty]['line'] !== $tokens[$nextNonEmpty]['line'] - ) { - // Special case: comma after a trailing comment - the comma should be moved to before the comment. - $fix = $phpcsFile->addFixableError( - 'Comma found after comment, expected the comma after the end of the code', - $stackPtr, - 'CommaAfterComment' - ); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken($stackPtr, ''); - $phpcsFile->fixer->addContent($prevNonEmpty, ','); - - // Clean up potential trailing whitespace left behind, but don't remove blank lines. - $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[($stackPtr - 1)]['code'] === \T_WHITESPACE - && $tokens[($stackPtr - 1)]['line'] === $tokens[$stackPtr]['line'] - && $tokens[$stackPtr]['line'] !== $tokens[$nextNonWhitespace]['line'] - ) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - } - return; - } - - if ($tokens[$prevNonWhitespace]['code'] === \T_COMMA) { - // This must be a list assignment with ignored items. Ignore. - return; - } - - if (isset(Tokens::$blockOpeners[$tokens[$prevNonWhitespace]['code']]) === true - || $tokens[$prevNonWhitespace]['code'] === \T_OPEN_SHORT_ARRAY - || $tokens[$prevNonWhitespace]['code'] === \T_OPEN_USE_GROUP - ) { - // Should only realistically be possible for lists. Leave for a block brace spacing sniff to sort out. - return; - } - - $expectedSpaces = 0; - - if ($tokens[$prevNonEmpty]['code'] === \T_END_HEREDOC - || $tokens[$prevNonEmpty]['code'] === \T_END_NOWDOC - ) { - /* - * If php_version is explicitly set to PHP < 7.3, enforce a new line between the closer and the comma. - * - * If php_version is *not* explicitly set, let the indent be leading and only enforce - * a new line between the closer and the comma when this is an old-style heredoc/nowdoc. - */ - if ($this->phpVersion !== 0 && $this->phpVersion < 70300) { - $expectedSpaces = 'newline'; - } - - if ($this->phpVersion === 0 - && \ltrim($tokens[$prevNonEmpty]['content']) === $tokens[$prevNonEmpty]['content'] - ) { - $expectedSpaces = 'newline'; - } - } - - $error = 'Expected %1$s between "' . $this->escapePlaceholders($tokens[$prevNonWhitespace]['content']) - . '" and the comma. Found: %2$s'; - $codeSuffix = $this->getSuffix($phpcsFile, $stackPtr); - $metricSuffix = $this->codeSuffixToMetric($codeSuffix); - - SpacesFixer::checkAndFix( - $phpcsFile, - $stackPtr, - $prevNonWhitespace, - $expectedSpaces, - $error, - 'SpaceBefore' . $codeSuffix, - 'error', - 0, - self::METRIC_NAME_BEFORE . $metricSuffix - ); - } - - /** - * Check the spacing after the comma. - * - * @since 1.1.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 - */ - protected function processSpacingAfter(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $nextNonWhitespace = $phpcsFile->findNext(\T_WHITESPACE, ($stackPtr + 1), null, true); - if ($nextNonWhitespace === false) { - // Live coding/parse error. Ignore. - return; - } - - if ($tokens[$nextNonWhitespace]['code'] === \T_COMMA) { - // This must be a list assignment with ignored items. Ignore. - return; - } - - if ($tokens[$nextNonWhitespace]['code'] === \T_CLOSE_CURLY_BRACKET - || $tokens[$nextNonWhitespace]['code'] === \T_CLOSE_SQUARE_BRACKET - || $tokens[$nextNonWhitespace]['code'] === \T_CLOSE_PARENTHESIS - || $tokens[$nextNonWhitespace]['code'] === \T_CLOSE_SHORT_ARRAY - || $tokens[$nextNonWhitespace]['code'] === \T_CLOSE_USE_GROUP - ) { - // Ignore. Leave for a block spacing sniff to sort out. - return; - } - - $nextToken = $tokens[($stackPtr + 1)]; - - $error = 'Expected %1$s between the comma and "' - . $this->escapePlaceholders($tokens[$nextNonWhitespace]['content']) . '". Found: %2$s'; - - $codeSuffix = $this->getSuffix($phpcsFile, $stackPtr); - $metricSuffix = $this->codeSuffixToMetric($codeSuffix); - - if ($nextToken['code'] === \T_WHITESPACE) { - if ($nextToken['content'] === ' ') { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_AFTER . $metricSuffix, '1 space'); - return; - } - - // Note: this check allows for trailing whitespace between the comma and a new line char. - // The trailing whitespace is not the concern of this sniff. - if (\ltrim($nextToken['content'], ' ') === $phpcsFile->eolChar) { - $phpcsFile->recordMetric($stackPtr, self::METRIC_NAME_AFTER . $metricSuffix, 'a new line'); - return; - } - - $errorCode = 'TooMuchSpaceAfter' . $codeSuffix; - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if (isset(Tokens::$commentTokens[$tokens[$nextNonWhitespace]['code']]) === true - && ($nextNonEmpty === false || $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) - ) { - // Separate error code to allow for aligning trailing comments. - $errorCode = 'TooMuchSpaceAfterCommaBeforeTrailingComment'; - } - - SpacesFixer::checkAndFix( - $phpcsFile, - $stackPtr, - $nextNonWhitespace, - 1, - $error, - $errorCode, - 'error', - 0, - self::METRIC_NAME_AFTER . $metricSuffix - ); - return; - } - - SpacesFixer::checkAndFix( - $phpcsFile, - $stackPtr, - $nextNonWhitespace, - 1, - $error, - 'NoSpaceAfter' . $codeSuffix, - 'error', - 0, - self::METRIC_NAME_AFTER . $metricSuffix - ); - } - - /** - * Escape arbitrary token content for *printf() placeholders. - * - * @since 1.1.0 - * - * @param string $text Arbitrary text string. - * - * @return string - */ - private function escapePlaceholders($text) - { - return \preg_replace('`(?:^|[^%])(%)(?:[^%]|$)`', '%%', \trim($text)); - } - - /** - * Retrieve a text string for use as a suffix to an error code. - * - * This allows for modular error codes, which in turn allow for selectively excluding - * error codes. - * - * {@internal Closure use will be parentheses owner in PHPCS 4.x, this code will - * need an update for that in due time.} - * - * @since 1.1.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 string - */ - private function getSuffix($phpcsFile, $stackPtr) - { - $opener = Parentheses::getLastOpener($phpcsFile, $stackPtr); - if ($opener === false) { - return ''; - } - - $tokens = $phpcsFile->getTokens(); - - $owner = Parentheses::getOwner($phpcsFile, $opener); - if ($owner !== false) { - switch ($tokens[$owner]['code']) { - case \T_FUNCTION: - case \T_CLOSURE: - case \T_FN: - return 'InFunctionDeclaration'; - - case \T_DECLARE: - return 'InDeclare'; - - case \T_ANON_CLASS: - case \T_ISSET: - case \T_UNSET: - return 'InFunctionCall'; - - // Long array, long list, isset, unset, empty, exit, eval, control structures. - default: - return ''; - } - } - - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), null, true); - - if (isset(Collections::nameTokens()[$tokens[$prevNonEmpty]['code']]) === true) { - return 'InFunctionCall'; - } - - switch ($tokens[$prevNonEmpty]['code']) { - case \T_USE: - return 'InClosureUse'; - - case \T_VARIABLE: - case \T_SELF: - case \T_STATIC: - case \T_PARENT: - return 'InFunctionCall'; - - default: - return ''; - } - } - - /** - * Transform a suffix for an error code into a suffix for a metric. - * - * @since 1.1.0 - * - * @param string $suffix Error code suffix. - * - * @return string - */ - private function codeSuffixToMetric($suffix) - { - return \strtolower(\preg_replace('`([A-Z])`', ' $1', $suffix)); - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php deleted file mode 100644 index 817a44e1..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * - * - * The PHPCS native `Generic.Whitespace.DisallowTabIndent` sniff oversteps its reach and silently - * does mid-line tab to space replacements as well. - * However, the sister-sniff `Generic.Whitespace.DisallowSpaceIndent` leaves mid-line tabs/spaces alone. - * This sniff fills that gap. - * - * @since 1.0.0 - */ -final class DisallowInlineTabsSniff implements Sniff -{ - - /** - * The --tab-width CLI value that is being used. - * - * @since 1.0.0 - * - * @var int - */ - private $tabWidth; - - /** - * Tokens to check for mid-line tabs. - * - * @since 1.0.0 - * - * @var array - */ - private $find = [ - \T_WHITESPACE => true, - \T_DOC_COMMENT_WHITESPACE => true, - \T_DOC_COMMENT_STRING => true, - \T_COMMENT => true, - ]; - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - return Collections::phpOpenTags(); - } - - /** - * 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 int Integer stack pointer to skip the rest of the file. - */ - public function process(File $phpcsFile, $stackPtr) - { - if (isset($this->tabWidth) === false) { - $this->tabWidth = (int) Helper::getTabWidth($phpcsFile); - } - - if (\defined('PHP_CODESNIFFER_IN_TESTS')) { - $this->tabWidth = (int) Helper::getCommandLineData($phpcsFile, 'tabWidth'); - } - - $tokens = $phpcsFile->getTokens(); - $dummy = new DummyTokenizer('', $phpcsFile->config); - - for ($i = 0; $i < $phpcsFile->numTokens; $i++) { - // Skip all non-whitespace tokens and skip whitespace at the start of a new line. - if (isset($this->find[$tokens[$i]['code']]) === false - || (($tokens[$i]['code'] === \T_WHITESPACE - || $tokens[$i]['code'] === \T_DOC_COMMENT_WHITESPACE) - && $tokens[$i]['column'] === 1) - ) { - continue; - } - - // If tabs haven't been converted to spaces by the tokenizer, do so now. - $token = $tokens[$i]; - if (isset($token['orig_content']) === false) { - if ($token['content'] === '' || \strpos($token['content'], "\t") === false) { - // If there are no tabs, we can continue, no matter what. - continue; - } - - $dummy->replaceTabsInToken($token); - } - - /* - * Tokens only have the 'orig_content' key if they contain tabs, - * so from here on out, we **know** there will be tabs in the content. - */ - $origContent = $token['orig_content']; - $commentOnly = ''; - - $multiLineComment = false; - if (($tokens[$i]['code'] === \T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']])) - && $tokens[$i]['column'] === 1 - && ($tokens[($i - 1)]['code'] === \T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[($i - 1)]['code']])) - ) { - $multiLineComment = true; - } - - if ($multiLineComment === true) { - // This is the subsequent line of a multi-line comment. Account for indentation. - $commentOnly = \ltrim($origContent); - if ($commentOnly === '' || \strpos($commentOnly, "\t") === false) { - continue; - } - } - - $fix = $phpcsFile->addFixableError( - 'Spaces must be used for mid-line alignment; tabs are not allowed', - $i, - 'NonIndentTabsUsed' - ); - - if ($fix === false) { - continue; - } - - $indent = ''; - if ($multiLineComment === true) { - // Take the original indent (tabs/spaces) and combine with the tab-replaced comment content. - $indent = \str_replace($commentOnly, '', $origContent); - $token['content'] = \ltrim($token['content']); - } - - $phpcsFile->fixer->replaceToken($i, $indent . $token['content']); - } - - // Scanned the whole file in one go. Don't scan this file again. - return $phpcsFile->numTokens; - } -} diff --git a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php b/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php deleted file mode 100644 index af689684..00000000 --- a/trunk/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php +++ /dev/null @@ -1,445 +0,0 @@ - - * - * - * - * - * - * - * - * - * - * ``` - * - * @since 1.0.0 - * - * @var string[] - */ - public $ignoreAlignmentBefore = []; - - /** - * Whether or not potential trailing whitespace on otherwise blank lines should be examined or ignored. - * - * Defaults to `true`, i.e. ignore blank lines. - * - * It is recommended to only set this to `false` if the standard including this sniff does not - * include the `Squiz.WhiteSpace.SuperfluousWhitespace` sniff (which is included in most standards). - * - * @since 1.0.0 - * - * @var bool - */ - public $ignoreBlankLines = true; - - /** - * The --tab-width CLI value that is being used. - * - * @since 1.0.0 - * - * @var int - */ - private $tabWidth; - - /** - * Whitespace tokens and tokens which can contain leading whitespace. - * - * A few additional tokens will be added to this list in the register() method. - * - * @since 1.0.0 - * - * @var array - */ - private $tokensToCheck = [ - \T_WHITESPACE => \T_WHITESPACE, - \T_INLINE_HTML => \T_INLINE_HTML, - \T_DOC_COMMENT_WHITESPACE => \T_DOC_COMMENT_WHITESPACE, - \T_COMMENT => \T_COMMENT, - \T_END_HEREDOC => \T_END_HEREDOC, - \T_END_NOWDOC => \T_END_NOWDOC, - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.0.0 - * - * @return array - */ - public function register() - { - // Add the ignore annotation tokens to the list of tokens to check. - $this->tokensToCheck += Tokens::$phpcsCommentTokens; - - return Collections::phpOpenTags(); - } - - /** - * 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 int Integer stack pointer to skip the rest of the file. - */ - public function process(File $phpcsFile, $stackPtr) - { - /* - * Handle the properties. - */ - if (isset($this->tabWidth) === false || \defined('PHP_CODESNIFFER_IN_TESTS') === true) { - $this->tabWidth = Helper::getTabWidth($phpcsFile); - } - - if (isset($this->indent) === true) { - $indent = (int) $this->indent; - } else { - $indent = $this->tabWidth; - } - - $ignoreTokens = (array) $this->ignoreAlignmentBefore; - if (empty($ignoreTokens) === false) { - $ignoreTokens = \array_flip($ignoreTokens); - } - - /* - * Check the whole file in one go. - */ - $tokens = $phpcsFile->getTokens(); - - for ($i = 0; $i < $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['column'] !== 1) { - // Only interested in the first token on each line. - continue; - } - - if (isset($this->tokensToCheck[$tokens[$i]['code']]) === false) { - // Not one of the target tokens. - continue; - } - - if ($tokens[$i]['content'] === $phpcsFile->eolChar) { - // Skip completely blank lines. - continue; - } - - if (isset($ignoreTokens[$tokens[$i]['type']]) === true - || (isset($tokens[($i + 1)]) && isset($ignoreTokens[$tokens[($i + 1)]['type']])) - ) { - // This is one of the tokens being ignored. - continue; - } - - $origContent = null; - if (isset($tokens[$i]['orig_content']) === true) { - $origContent = $tokens[$i]['orig_content']; - } - - $spaces = 0; - $length = 0; - $content = ''; - $closer = ''; - - switch ($tokens[$i]['code']) { - case \T_WHITESPACE: - if ($this->ignoreBlankLines === true - && isset($tokens[($i + 1)]) - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - ) { - // Skip blank lines which only contain trailing whitespace. - continue 2; - } - - $spaces = ($tokens[$i]['length'] % $indent); - break; - - case \T_DOC_COMMENT_WHITESPACE: - /* - * Blank lines with trailing whitespace in docblocks are tokenized as - * two T_DOC_COMMENT_WHITESPACE tokens: one for the trailing whitespace, - * one for the new line character. - */ - if ($this->ignoreBlankLines === true - && isset($tokens[($i + 1)]) - && $tokens[($i + 1)]['content'] === $phpcsFile->eolChar - && isset($tokens[($i + 2)]) - && $tokens[$i]['line'] !== $tokens[($i + 2)]['line'] - ) { - // Skip blank lines which only contain trailing whitespace. - continue 2; - } - - $spaces = ($tokens[$i]['length'] % $indent); - - if (isset($tokens[($i + 1)]) === true - && ($tokens[($i + 1)]['code'] === \T_DOC_COMMENT_STAR - || $tokens[($i + 1)]['code'] === \T_DOC_COMMENT_CLOSE_TAG) - && $spaces !== 0 - ) { - // One alignment space expected before the *. - --$spaces; - } - break; - - case \T_COMMENT: - case \T_INLINE_HTML: - if ($this->ignoreBlankLines === true - && \trim($tokens[$i]['content']) === '' - && isset($tokens[($i + 1)]) - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - ) { - // Skip blank lines which only contain trailing whitespace. - continue 2; - } - - // Deliberate fall-through. - - case \T_PHPCS_ENABLE: - case \T_PHPCS_DISABLE: - case \T_PHPCS_SET: - case \T_PHPCS_IGNORE: - case \T_PHPCS_IGNORE_FILE: - /* - * Indentation is included in the contents of the token for: - * - inline HTML - * - PHP 7.3+ flexible heredoc/nowdoc closer identifiers (see below); - * - subsequent lines of multi-line comments; - * - PHPCS native annotations when part of a multi-line comment. - */ - $content = \ltrim($tokens[$i]['content']); - $whitespace = \str_replace($content, '', $tokens[$i]['content']); - - /* - * If there is no content, this is a blank line in a comment or in inline HTML. - * In that case, use the predetermined length as otherwise the new line character - * at the end of the whitespace will throw the count off. - */ - $length = ($content === '') ? $tokens[$i]['length'] : \strlen($whitespace); - $spaces = ($length % $indent); - - /* - * For multi-line star-comments, which use (aligned) stars on subsequent - * lines, we don't want to trigger on the one extra space before the star. - * - * While not 100% correct, don't exclude inline HTML from this check as - * otherwise the sniff would trigger on multi-line /*-style inline javascript comments. - * This may cause false negatives as there is no check for being in a - * tags. This is the most portable way to include PHP code on differing operating systems and setups. - ]]> - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml deleted file mode 100644 index 519d7f5c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowRequestSuperglobalStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml deleted file mode 100644 index 8086ea27..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DisallowShortOpenTagStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - to delimit PHP code, not the shorthand. This is the most portable way to include PHP code on differing operating systems and setups. - ]]> - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml deleted file mode 100644 index 83bceef4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/DiscourageGotoStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml deleted file mode 100644 index c0f18b55..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/ForbiddenFunctionsStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - count($bar); - ]]> - - - sizeof($bar); - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml deleted file mode 100644 index 7dc30c10..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseConstantStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - true, false and null constants must always be lowercase. - ]]> - - - - false || $var === null) { - $var = true; -} - ]]> - - - FALSE || $var === NULL) { - $var = TRUE; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml deleted file mode 100644 index 965742d9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseKeywordStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - array(); - ]]> - - - Array(); - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml deleted file mode 100644 index f38df3af..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/LowerCaseTypeStandard.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - Int $foo) : STRING { -} - ]]> - - - - - - - - - - - (BOOL) $isValid; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml deleted file mode 100644 index df698879..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/NoSilencedErrorsStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - isset($foo) && $foo) { - echo "Hello\n"; -} - ]]> - - - @$foo) { - echo "Hello\n"; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/RequireStrictTypesStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/RequireStrictTypesStandard.xml deleted file mode 100644 index 701cb484..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/RequireStrictTypesStandard.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - strict_types=1); - -declare(encoding='UTF-8', strict_types=0); - ]]> - - - ); - ]]> - - - - - - - - 1); - ]]> - - - 0); - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml deleted file mode 100644 index e74005ad..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SAPIUsageStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - PHP_SAPI === 'cli') { - echo "Hello, CLI user."; -} - ]]> - - - php_sapi_name() === 'cli') { - echo "Hello, CLI user."; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SyntaxStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SyntaxStandard.xml deleted file mode 100644 index 1c2457df..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/SyntaxStandard.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - echo "Hello!"; -$array = [1, 2, 3]; - ]]> - - - // Missing semicolon. -$array = [1, 2, 3; // Missing closing bracket. - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml deleted file mode 100644 index 1f337f77..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/PHP/UpperCaseConstantStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - true, false and null constants must always be uppercase. - ]]> - - - - FALSE || $var === NULL) { - $var = TRUE; -} - ]]> - - - false || $var === null) { - $var = true; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml deleted file mode 100644 index a4c9887b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryStringConcatStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml deleted file mode 100644 index f4f3e19c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/VersionControl/SubversionPropertiesStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml deleted file mode 100644 index 338c8389..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ArbitraryParenthesesSpacingStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml deleted file mode 100644 index 2e399b34..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowSpaceIndentStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml deleted file mode 100644 index 7013ffd9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/DisallowTabIndentStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/IncrementDecrementSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/IncrementDecrementSpacingStandard.xml deleted file mode 100644 index 92532fc6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/IncrementDecrementSpacingStandard.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - $i; ---$i['key']['id']; -ClassName::$prop++; -$obj->prop--; - ]]> - - - $i; --- $i['key']['id']; -ClassName::$prop ++; -$obj->prop ---; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml deleted file mode 100644 index a9cd5a65..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - 'Hello, World!'; -throw new Exception(); -return $newLine; - ]]> - - - 'Hello, World!'; -throw new Exception(); -return -$newLine; - ]]> - - - - - - - - from [1, 2, 3]; - ]]> - - - from [1, 2, 3]; -yield from [1, 2, 3]; -yield -from [1, 2, 3]; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml deleted file mode 100644 index bdd36d49..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/ScopeIndentStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - $var = 1; -} - ]]> - - - $var = 1; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml deleted file mode 100644 index d33b6051..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/SpreadOperatorSpacingAfterStandard.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - &...$spread) { - bar(...$spread); - - bar( - [...$foo], - ...array_values($keyedArray) - ); -} - ]]> - - - ... $spread) { - bar(... - $spread - ); - - bar( - [... $foo ],.../*comment*/array_values($keyedArray) - ); -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php deleted file mode 100644 index b6e3d37d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php +++ /dev/null @@ -1,193 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; - -use PHP_CodeSniffer\Sniffs\AbstractArraySniff; -use PHP_CodeSniffer\Util\Tokens; - -class ArrayIndentSniff extends AbstractArraySniff -{ - - /** - * The number of spaces each array key should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Processes a single-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * @param array $indices An array of token positions for the array keys, - * double arrows, and values. - * - * @return void - */ - public function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices) - { - - }//end processSingleLineArray() - - - /** - * Processes a multi-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * @param array $indices An array of token positions for the array keys, - * double arrows, and values. - * - * @return void - */ - public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd, $indices) - { - $tokens = $phpcsFile->getTokens(); - - // Determine how far indented the entire array declaration should be. - $ignore = Tokens::$emptyTokens; - $ignore[] = T_DOUBLE_ARROW; - $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); - $start = $phpcsFile->findStartOfStatement($prev); - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $start, true); - $baseIndent = ($tokens[$first]['column'] - 1); - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $startIndent = ($tokens[$first]['column'] - 1); - - // If the open brace is not indented to at least to the level of the start - // of the statement, the sniff will conflict with other sniffs trying to - // check indent levels because it's not valid. But we don't enforce exactly - // how far indented it should be. - if ($startIndent < $baseIndent) { - $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); - if ($fix === true) { - $padding = str_repeat(' ', $baseIndent); - if ($startIndent === 0) { - $phpcsFile->fixer->addContentBefore($first, $padding); - } else { - $phpcsFile->fixer->replaceToken(($first - 1), $padding); - } - } - - return; - }//end if - - $expectedIndent = ($startIndent + $this->indent); - - foreach ($indices as $index) { - if (isset($index['index_start']) === true) { - $start = $index['index_start']; - } else { - $start = $index['value_start']; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($start - 1), null, true); - if ($tokens[$prev]['line'] === $tokens[$start]['line']) { - // This index isn't the only content on the line - // so we can't check indent rules. - continue; - } - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $start, true); - - $foundIndent = ($tokens[$first]['column'] - 1); - if ($foundIndent === $expectedIndent) { - continue; - } - - $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); - if ($fix === false) { - continue; - } - - $padding = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($first, $padding); - } else { - $phpcsFile->fixer->replaceToken(($first - 1), $padding); - } - }//end foreach - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($arrayEnd - 1), null, true); - if ($tokens[$prev]['line'] === $tokens[$arrayEnd]['line']) { - $error = 'Closing brace of array declaration must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNotNewLine'); - if ($fix === true) { - $padding = $phpcsFile->eolChar.str_repeat(' ', $startIndent); - $phpcsFile->fixer->addContentBefore($arrayEnd, $padding); - } - - return; - } - - // The close brace must be indented one stop less. - $foundIndent = ($tokens[$arrayEnd]['column'] - 1); - if ($foundIndent === $startIndent) { - return; - } - - $pluralizeSpace = 's'; - if ($startIndent === 1) { - $pluralizeSpace = ''; - } - - $error = 'Array close brace not indented correctly; expected %s space%s but found %s'; - $data = [ - $startIndent, - $pluralizeSpace, - $foundIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceIncorrect', $data); - if ($fix === false) { - return; - } - - $padding = str_repeat(' ', $startIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($arrayEnd, $padding); - } else { - $phpcsFile->fixer->replaceToken(($arrayEnd - 1), $padding); - } - - }//end processMultiLineArray() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php deleted file mode 100644 index 6854945a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowLongArraySyntaxSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_ARRAY]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'no'); - - $error = 'Short array syntax must be used to define arrays'; - - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) { - // Live coding/parse error, just show the error, don't try and fix it. - $phpcsFile->addError($error, $stackPtr, 'Found'); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); - - if ($fix === true) { - $opener = $tokens[$stackPtr]['parenthesis_opener']; - $closer = $tokens[$stackPtr]['parenthesis_closer']; - - $phpcsFile->fixer->beginChangeset(); - - $phpcsFile->fixer->replaceToken($stackPtr, ''); - $phpcsFile->fixer->replaceToken($opener, '['); - $phpcsFile->fixer->replaceToken($closer, ']'); - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php deleted file mode 100644 index f9827711..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowShortArraySyntaxSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_SHORT_ARRAY]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'yes'); - - $error = 'Short array syntax is not allowed'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); - - if ($fix === true) { - $tokens = $phpcsFile->getTokens(); - $opener = $tokens[$stackPtr]['bracket_opener']; - $closer = $tokens[$stackPtr]['bracket_closer']; - - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($opener, 'array('); - $phpcsFile->fixer->replaceToken($closer, ')'); - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php deleted file mode 100644 index 19ff1edf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DuplicateClassNameSniff implements Sniff -{ - - /** - * List of classes that have been found during checking. - * - * @var array - */ - protected $foundClasses = []; - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $namespace = ''; - $findTokens = [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - T_NAMESPACE, - T_CLOSE_TAG, - ]; - - $stackPtr = $phpcsFile->findNext($findTokens, ($stackPtr + 1)); - while ($stackPtr !== false) { - if ($tokens[$stackPtr]['code'] === T_CLOSE_TAG) { - // We can stop here. The sniff will continue from the next open - // tag when PHPCS reaches that token, if there is one. - return; - } - - // Keep track of what namespace we are in. - if ($tokens[$stackPtr]['code'] === T_NAMESPACE) { - $nsEnd = $phpcsFile->findNext( - [ - T_NS_SEPARATOR, - T_STRING, - T_WHITESPACE, - ], - ($stackPtr + 1), - null, - true - ); - - $namespace = trim($phpcsFile->getTokensAsString(($stackPtr + 1), ($nsEnd - $stackPtr - 1))); - $stackPtr = $nsEnd; - } else { - $nameToken = $phpcsFile->findNext(T_STRING, $stackPtr); - $name = $tokens[$nameToken]['content']; - if ($namespace !== '') { - $name = $namespace.'\\'.$name; - } - - $compareName = strtolower($name); - if (isset($this->foundClasses[$compareName]) === true) { - $type = strtolower($tokens[$stackPtr]['content']); - $file = $this->foundClasses[$compareName]['file']; - $line = $this->foundClasses[$compareName]['line']; - $error = 'Duplicate %s name "%s" found; first defined in %s on line %s'; - $data = [ - $type, - $name, - $file, - $line, - ]; - $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); - } else { - $this->foundClasses[$compareName] = [ - 'file' => $phpcsFile->getFilename(), - 'line' => $tokens[$stackPtr]['line'], - ]; - } - }//end if - - $stackPtr = $phpcsFile->findNext($findTokens, ($stackPtr + 1)); - }//end while - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php deleted file mode 100644 index 40291ea4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php +++ /dev/null @@ -1,124 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OpeningBraceSameLineSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $scopeIdentifier = $phpcsFile->findNext(T_STRING, ($stackPtr + 1)); - $errorData = [strtolower($tokens[$stackPtr]['content']).' '.$tokens[$scopeIdentifier]['content']]; - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - $error = 'Possible parse error: %s missing opening or closing brace'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $errorData); - return; - } - - $openingBrace = $tokens[$stackPtr]['scope_opener']; - - // Is the brace on the same line as the class/interface/trait declaration ? - $lastClassLineToken = $phpcsFile->findPrevious(T_WHITESPACE, ($openingBrace - 1), $stackPtr, true); - $lastClassLine = $tokens[$lastClassLineToken]['line']; - $braceLine = $tokens[$openingBrace]['line']; - $lineDifference = ($braceLine - $lastClassLine); - - if ($lineDifference > 0) { - $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'new line'); - $error = 'Opening brace should be on the same line as the declaration for %s'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnNewLine', $errorData); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($lastClassLineToken, ' {'); - $phpcsFile->fixer->replaceToken($openingBrace, ''); - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'same line'); - } - - // Is the opening brace the last thing on the line ? - $next = $phpcsFile->findNext(T_WHITESPACE, ($openingBrace + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { - if ($next === $tokens[$stackPtr]['scope_closer']) { - // Ignore empty classes. - 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 continue checking if the opening brace looks good. - if ($lineDifference > 0) { - return; - } - - // Is there precisely one space before the opening brace ? - if ($tokens[($openingBrace - 1)]['code'] !== T_WHITESPACE) { - $length = 0; - } else if ($tokens[($openingBrace - 1)]['content'] === "\t") { - $length = '\t'; - } else { - $length = $tokens[($openingBrace - 1)]['length']; - } - - if ($length !== 1) { - $error = 'Expected 1 space before opening brace; found %s'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'SpaceBeforeBrace', $data); - if ($fix === true) { - if ($length === 0 || $length === '\t') { - $phpcsFile->fixer->addContentBefore($openingBrace, ' '); - } else { - $phpcsFile->fixer->replaceToken(($openingBrace - 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php deleted file mode 100644 index fecd16a7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php +++ /dev/null @@ -1,171 +0,0 @@ - - * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @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 AssignmentInConditionSniff implements Sniff -{ - - /** - * Assignment tokens to trigger on. - * - * Set in the register() method. - * - * @var array - */ - protected $assignmentTokens = []; - - /** - * The tokens that indicate the start of a condition. - * - * @var array - */ - protected $conditionStartTokens = []; - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - $this->assignmentTokens = Tokens::$assignmentTokens; - unset($this->assignmentTokens[T_DOUBLE_ARROW]); - - $starters = Tokens::$booleanOperators; - $starters[T_SEMICOLON] = T_SEMICOLON; - $starters[T_OPEN_PARENTHESIS] = T_OPEN_PARENTHESIS; - - $this->conditionStartTokens = $starters; - - return [ - T_IF, - T_ELSEIF, - T_FOR, - T_SWITCH, - T_CASE, - T_WHILE, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $token = $tokens[$stackPtr]; - - // Find the condition opener/closer. - if ($token['code'] === T_FOR) { - if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { - return; - } - - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($token['parenthesis_opener'] + 1), ($token['parenthesis_closer'])); - if ($semicolon === false) { - return; - } - - $opener = $semicolon; - - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($opener + 1), ($token['parenthesis_closer'])); - if ($semicolon === false) { - return; - } - - $closer = $semicolon; - unset($semicolon); - } else if ($token['code'] === T_CASE) { - if (isset($token['scope_opener']) === false) { - return; - } - - $opener = $stackPtr; - $closer = $token['scope_opener']; - } else { - if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { - return; - } - - $opener = $token['parenthesis_opener']; - $closer = $token['parenthesis_closer']; - }//end if - - $startPos = $opener; - - do { - $hasAssignment = $phpcsFile->findNext($this->assignmentTokens, ($startPos + 1), $closer); - if ($hasAssignment === false) { - return; - } - - // Examine whether the left side is a variable. - $hasVariable = false; - $conditionStart = $startPos; - $altConditionStart = $phpcsFile->findPrevious($this->conditionStartTokens, ($hasAssignment - 1), $startPos); - if ($altConditionStart !== false) { - $conditionStart = $altConditionStart; - } - - for ($i = $hasAssignment; $i > $conditionStart; $i--) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - // If this is a variable or array, we've seen all we need to see. - if ($tokens[$i]['code'] === T_VARIABLE || $tokens[$i]['code'] === T_CLOSE_SQUARE_BRACKET) { - $hasVariable = true; - break; - } - - // If this is a function call or something, we are OK. - if ($tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { - break; - } - } - - if ($hasVariable === true) { - $errorCode = 'Found'; - if ($token['code'] === T_WHILE) { - $errorCode = 'FoundInWhileCondition'; - } - - $phpcsFile->addWarning( - 'Variable assignment found within a condition. Did you mean to do a comparison ?', - $hasAssignment, - $errorCode - ); - } - - $startPos = $hasAssignment; - } while ($startPos < $closer); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php deleted file mode 100644 index 4ecf6303..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php +++ /dev/null @@ -1,162 +0,0 @@ - - * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @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 EmptyPHPStatementSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_SEMICOLON, - T_CLOSE_TAG, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - switch ($tokens[$stackPtr]['type']) { - // Detect `something();;`. - case 'T_SEMICOLON': - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - if ($prevNonEmpty === false) { - return; - } - - if ($tokens[$prevNonEmpty]['code'] !== T_SEMICOLON - && $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG - && $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG_WITH_ECHO - ) { - if (isset($tokens[$prevNonEmpty]['scope_condition']) === false) { - return; - } - - if ($tokens[$prevNonEmpty]['scope_opener'] !== $prevNonEmpty - && $tokens[$prevNonEmpty]['code'] !== T_CLOSE_CURLY_BRACKET - ) { - return; - } - - $scopeOwner = $tokens[$tokens[$prevNonEmpty]['scope_condition']]['code']; - if ($scopeOwner === T_CLOSURE || $scopeOwner === T_ANON_CLASS || $scopeOwner === T_MATCH) { - return; - } - - // Else, it's something like `if (foo) {};` and the semicolon is not needed. - } - - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nested = $tokens[$stackPtr]['nested_parenthesis']; - $lastCloser = array_pop($nested); - if (isset($tokens[$lastCloser]['parenthesis_owner']) === true - && $tokens[$tokens[$lastCloser]['parenthesis_owner']]['code'] === T_FOR - ) { - // Empty for() condition. - return; - } - } - - $fix = $phpcsFile->addFixableWarning( - 'Empty PHP statement detected: superfluous semicolon.', - $stackPtr, - 'SemicolonWithoutCodeDetected' - ); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - if ($tokens[$prevNonEmpty]['code'] === T_OPEN_TAG - || $tokens[$prevNonEmpty]['code'] === T_OPEN_TAG_WITH_ECHO - ) { - // Check for superfluous whitespace after the semicolon which will be - // removed as the `fixer->replaceToken(($stackPtr + 1), $replacement); - } - } - - for ($i = $stackPtr; $i > $prevNonEmpty; $i--) { - if ($tokens[$i]['code'] !== T_SEMICOLON - && $tokens[$i]['code'] !== T_WHITESPACE - ) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - break; - - // Detect ``. - case 'T_CLOSE_TAG': - $prevNonEmpty = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - - if ($prevNonEmpty === false - || ($tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG - && $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG_WITH_ECHO) - ) { - return; - } - - $fix = $phpcsFile->addFixableWarning( - 'Empty PHP open/close tag combination detected.', - $prevNonEmpty, - 'EmptyPHPOpenCloseTagsDetected' - ); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = $prevNonEmpty; $i <= $stackPtr; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - break; - - default: - // Deliberately left empty. - break; - }//end switch - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php deleted file mode 100644 index ded042a9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php +++ /dev/null @@ -1,97 +0,0 @@ - - * stmt { - * // foo - * } - * stmt (conditions) { - * // foo - * } - * - * - * @author Manuel Pichler - * @author Greg Sherwood - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @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 EmptyStatementSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_TRY, - T_CATCH, - T_FINALLY, - T_DO, - T_ELSE, - T_ELSEIF, - T_FOR, - T_FOREACH, - T_IF, - T_SWITCH, - T_WHILE, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $token = $tokens[$stackPtr]; - - // Skip statements without a body. - if (isset($token['scope_opener']) === false) { - return; - } - - $next = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($token['scope_opener'] + 1), - ($token['scope_closer'] - 1), - true - ); - - if ($next !== false) { - return; - } - - // Get token identifier. - $name = strtoupper($token['content']); - $error = 'Empty %s statement detected'; - $phpcsFile->addError($error, $stackPtr, 'Detected'.ucfirst(strtolower($name)), [$name]); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php deleted file mode 100644 index 726b32c5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * class Foo - * { - * public function bar($x) - * { - * for (;true;) true; // No Init or Update part, may as well be: while (true) - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @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 ForLoopShouldBeWhileLoopSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FOR]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $token = $tokens[$stackPtr]; - - // Skip invalid statement. - if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { - return; - } - - $next = ++$token['parenthesis_opener']; - $end = --$token['parenthesis_closer']; - - $parts = [ - 0, - 0, - 0, - ]; - $index = 0; - - for (; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - if ($code === T_SEMICOLON) { - ++$index; - } else if (isset(Tokens::$emptyTokens[$code]) === false) { - ++$parts[$index]; - } - } - - if ($parts[0] === 0 && $parts[2] === 0 && $parts[1] > 0) { - $error = 'This FOR loop can be simplified to a WHILE loop'; - $phpcsFile->addWarning($error, $stackPtr, 'CanSimplify'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php deleted file mode 100644 index 0374a8f7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php +++ /dev/null @@ -1,101 +0,0 @@ - - * class Foo - * { - * public function bar($x) - * { - * $a = array(1, 2, 3, 4); - * for ($i = 0; $i < count($a); $i++) { - * $a[$i] *= $i; - * } - * } - * } - * - * - * @author Greg Sherwood - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @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 ForLoopWithTestFunctionCallSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FOR]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $token = $tokens[$stackPtr]; - - // Skip invalid statement. - if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { - return; - } - - $next = ++$token['parenthesis_opener']; - $end = --$token['parenthesis_closer']; - - $position = 0; - - for (; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - if ($code === T_SEMICOLON) { - ++$position; - } - - if ($position < 1) { - continue; - } else if ($position > 1) { - break; - } else if ($code !== T_VARIABLE && $code !== T_STRING) { - continue; - } - - // Find next non empty token, if it is a open parenthesis we have a - // function call. - $index = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - - if ($tokens[$index]['code'] === T_OPEN_PARENTHESIS) { - $error = 'Avoid function calls in a FOR loop test part'; - $phpcsFile->addWarning($error, $stackPtr, 'NotAllowed'); - break; - } - }//end for - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php deleted file mode 100644 index 8174d665..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php +++ /dev/null @@ -1,134 +0,0 @@ - - * class Foo - * { - * public function bar($x) - * { - * for ($i = 0; $i < 10; $i++) - * { - * for ($k = 0; $k < 20; $i++) - * { - * echo 'Hello'; - * } - * } - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @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; - -class JumbledIncrementerSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FOR]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $token = $tokens[$stackPtr]; - - // Skip for-loop without body. - if (isset($token['scope_opener']) === false) { - return; - } - - // Find incrementers for outer loop. - $outer = $this->findIncrementers($tokens, $token); - - // Skip if empty. - if (count($outer) === 0) { - return; - } - - // Find nested for loops. - $start = ++$token['scope_opener']; - $end = --$token['scope_closer']; - - for (; $start <= $end; ++$start) { - if ($tokens[$start]['code'] !== T_FOR) { - continue; - } - - $inner = $this->findIncrementers($tokens, $tokens[$start]); - $diff = array_intersect($outer, $inner); - - if (count($diff) !== 0) { - $error = 'Loop incrementer (%s) jumbling with inner loop'; - $data = [implode(', ', $diff)]; - $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); - } - } - - }//end process() - - - /** - * Get all used variables in the incrementer part of a for statement. - * - * @param array $tokens Array with all code sniffer tokens. - * @param array $token Current for loop token. - * - * @return string[] List of all found incrementer variables. - */ - protected function findIncrementers(array $tokens, array $token) - { - // Skip invalid statement. - if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { - return []; - } - - $start = ++$token['parenthesis_opener']; - $end = --$token['parenthesis_closer']; - - $incrementers = []; - $semicolons = 0; - for ($next = $start; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - if ($code === T_SEMICOLON) { - ++$semicolons; - } else if ($semicolons === 2 && $code === T_VARIABLE) { - $incrementers[] = $tokens[$next]['content']; - } - } - - return $incrementers; - - }//end findIncrementers() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceSniff.php deleted file mode 100644 index 93afe2e3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceSniff.php +++ /dev/null @@ -1,119 +0,0 @@ - - * $one = false; - * $two = false; - * $three = true; - * - * $result = $one && $two || $three; - * $result3 = $one && !$two xor $three; - * - * - * {@internal The unary `!` operator is not handled, because its high precedence matches its visuals of - * applying only to the sub-expression right next to it, making it unlikely that someone would - * misinterpret its precedence. Requiring parentheses around it would reduce the readability of - * expressions due to the additional characters, especially if multiple subexpressions / variables - * need to be negated.} - * - * Sister-sniff to the `Squiz.ControlStructures.InlineIfDeclaration` and - * `Squiz.Formatting.OperatorBracket.MissingBrackets` sniffs. - * - * @author Tim Duesterhus - * @copyright 2021-2023 WoltLab GmbH. - * @copyright 2024 PHPCSStandards and contributors - * @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 RequireExplicitBooleanOperatorPrecedenceSniff implements Sniff -{ - - /** - * Array of tokens this test searches for to find either a boolean - * operator or the start of the current (sub-)expression. Used for - * performance optimization purposes. - * - * @var array - */ - private $searchTargets = []; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $this->searchTargets = Tokens::$booleanOperators; - $this->searchTargets += Tokens::$blockOpeners; - $this->searchTargets[T_INLINE_THEN] = T_INLINE_THEN; - $this->searchTargets[T_INLINE_ELSE] = T_INLINE_ELSE; - - return Tokens::$booleanOperators; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $start = $phpcsFile->findStartOfStatement($stackPtr); - - $previous = $phpcsFile->findPrevious( - $this->searchTargets, - ($stackPtr - 1), - $start, - false, - null, - true - ); - - if ($previous === false) { - // No token found. - return; - } - - if ($tokens[$previous]['code'] === $tokens[$stackPtr]['code']) { - // Identical operator found. - return; - } - - if (in_array($tokens[$previous]['code'], [T_INLINE_THEN, T_INLINE_ELSE], true) === true) { - // Beginning of the expression found for the ternary conditional operator. - return; - } - - if (isset(Tokens::$blockOpeners[$tokens[$previous]['code']]) === true) { - // Beginning of the expression found for a block opener. Needed to - // correctly handle match arms. - return; - } - - // We found a mismatching operator, thus we must report the error. - $error = 'Mixing different binary boolean operators within an expression'; - $error .= ' without using parentheses to clarify precedence is not allowed.'; - $phpcsFile->addError($error, $stackPtr, 'MissingParentheses'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php deleted file mode 100644 index db71a967..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php +++ /dev/null @@ -1,93 +0,0 @@ -true or false - * - * - * class Foo - * { - * public function close() - * { - * if (true) - * { - * // ... - * } - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @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 UnconditionalIfStatementSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_ELSEIF, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $token = $tokens[$stackPtr]; - - // Skip if statement without body. - if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { - return; - } - - $next = ++$token['parenthesis_opener']; - $end = --$token['parenthesis_closer']; - - $goodCondition = false; - for (; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - - if (isset(Tokens::$emptyTokens[$code]) === true) { - continue; - } else if ($code !== T_TRUE && $code !== T_FALSE) { - $goodCondition = true; - } - } - - if ($goodCondition === false) { - $error = 'Avoid IF statements that are always true or false'; - $phpcsFile->addWarning($error, $stackPtr, 'Found'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php deleted file mode 100644 index 2f4faa89..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php +++ /dev/null @@ -1,88 +0,0 @@ - - * final class Foo - * { - * public final function bar() - * { - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @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; - -class UnnecessaryFinalModifierSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $token = $tokens[$stackPtr]; - - // Skip for statements without body. - if (isset($token['scope_opener']) === false) { - return; - } - - if ($phpcsFile->getClassProperties($stackPtr)['is_final'] === false) { - // This class is not final so we don't need to check it. - return; - } - - $next = ++$token['scope_opener']; - $end = --$token['scope_closer']; - - for (; $next <= $end; ++$next) { - if ($tokens[$next]['code'] === T_FINAL) { - $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() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php deleted file mode 100644 index e076b83d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php +++ /dev/null @@ -1,307 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @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 UnusedFunctionParameterSniff implements Sniff -{ - - /** - * The list of class type hints which will be ignored. - * - * @var array - */ - 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. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - T_FN, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $token = $tokens[$stackPtr]; - - // Skip broken function declarations. - if (isset($token['scope_opener']) === false || isset($token['parenthesis_opener']) === false) { - return; - } - - $errorCode = 'Found'; - $implements = false; - - 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); - - // Skip when no parameters found. - $methodParamsCount = count($methodParams); - if ($methodParamsCount === 0) { - return; - } - - foreach ($methodParams as $param) { - if (isset($param['property_visibility']) === true) { - // Ignore constructor property promotion. - continue; - } - - $params[$param['name']] = $stackPtr; - } - - $next = ++$token['scope_opener']; - $end = --$token['scope_closer']; - - // Check the end token for arrow functions as - // they can end at a content token due to not having - // a clearly defined closing token. - if ($token['code'] === T_FN) { - ++$end; - } - - $foundContent = false; - $validTokens = [ - T_HEREDOC => T_HEREDOC, - T_NOWDOC => T_NOWDOC, - T_END_HEREDOC => T_END_HEREDOC, - T_END_NOWDOC => T_END_NOWDOC, - T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, - ]; - $validTokens += Tokens::$emptyTokens; - - for (; $next <= $end; ++$next) { - $token = $tokens[$next]; - $code = $token['code']; - - // Ignorable tokens. - if (isset(Tokens::$emptyTokens[$code]) === true) { - continue; - } - - if ($foundContent === false) { - // A throw statement as the first content indicates an interface method. - if ($code === T_THROW && $implements !== false) { - return; - } - - // A return statement as the first content indicates an interface method. - if ($code === T_RETURN) { - $firstNonEmptyTokenAfterReturn = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - if ($tokens[$firstNonEmptyTokenAfterReturn]['code'] === T_SEMICOLON && $implements !== false) { - return; - } - - $secondNonEmptyTokenAfterReturn = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($firstNonEmptyTokenAfterReturn + 1), - null, - true - ); - - if ($secondNonEmptyTokenAfterReturn !== false - && $tokens[$secondNonEmptyTokenAfterReturn]['code'] === T_SEMICOLON - && $implements !== false - ) { - // There is a return . - return; - } - }//end if - }//end if - - $foundContent = true; - - if ($code === T_VARIABLE && isset($params[$token['content']]) === true) { - unset($params[$token['content']]); - } else if ($code === T_DOLLAR) { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); - if ($tokens[$nextToken]['code'] === T_OPEN_CURLY_BRACKET) { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] === T_STRING) { - $varContent = '$'.$tokens[$nextToken]['content']; - if (isset($params[$varContent]) === true) { - unset($params[$varContent]); - } - } - } - } else if ($code === T_DOUBLE_QUOTED_STRING - || $code === T_START_HEREDOC - || $code === T_START_NOWDOC - ) { - // Tokenize strings that can contain variables. - // Make sure the string is re-joined if it occurs over multiple lines. - $content = $token['content']; - for ($i = ($next + 1); $i <= $end; $i++) { - if (isset($validTokens[$tokens[$i]['code']]) === true) { - $content .= $tokens[$i]['content']; - $next++; - } else { - break; - } - } - - $stringTokens = token_get_all(sprintf('', $content)); - foreach ($stringTokens as $stringPtr => $stringToken) { - if (is_array($stringToken) === false) { - continue; - } - - $varContent = ''; - if ($stringToken[0] === T_DOLLAR_OPEN_CURLY_BRACES) { - $varContent = '$'.$stringTokens[($stringPtr + 1)][1]; - } else if ($stringToken[0] === T_VARIABLE) { - $varContent = $stringToken[1]; - } - - if ($varContent !== '' && isset($params[$varContent]) === true) { - unset($params[$varContent]); - } - } - }//end if - }//end for - - if ($foundContent === true && count($params) > 0) { - $error = 'The method parameter %s is never used'; - - // If there is only one parameter and it is unused, no need for additional errorcode toggling logic. - if ($methodParamsCount === 1) { - foreach ($params as $paramName => $position) { - if (in_array($methodParams[0]['type_hint'], $this->ignoreTypeHints, true) === true) { - continue; - } - - $data = [$paramName]; - $phpcsFile->addWarning($error, $position, $errorCode, $data); - } - - return; - } - - $foundLastUsed = false; - $lastIndex = ($methodParamsCount - 1); - $errorInfo = []; - for ($i = $lastIndex; $i >= 0; --$i) { - if ($foundLastUsed !== false) { - if (isset($params[$methodParams[$i]['name']]) === true) { - $errorInfo[$methodParams[$i]['name']] = [ - 'position' => $params[$methodParams[$i]['name']], - 'errorcode' => $errorCode.'BeforeLastUsed', - 'typehint' => $methodParams[$i]['type_hint'], - ]; - } - } else { - if (isset($params[$methodParams[$i]['name']]) === false) { - $foundLastUsed = true; - } else { - $errorInfo[$methodParams[$i]['name']] = [ - 'position' => $params[$methodParams[$i]['name']], - 'errorcode' => $errorCode.'AfterLastUsed', - 'typehint' => $methodParams[$i]['type_hint'], - ]; - } - } - }//end for - - if (count($errorInfo) > 0) { - $errorInfo = array_reverse($errorInfo); - foreach ($errorInfo as $paramName => $info) { - if (in_array($info['typehint'], $this->ignoreTypeHints, true) === true) { - continue; - } - - $data = [$paramName]; - $phpcsFile->addWarning($error, $info['position'], $info['errorcode'], $data); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php deleted file mode 100644 index 5163da71..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php +++ /dev/null @@ -1,184 +0,0 @@ - - * class FooBar { - * public function __construct($a, $b) { - * parent::__construct($a, $b); - * } - * } - * - * - * @author Manuel Pichler - * @copyright 2007-2014 Manuel Pichler. All rights reserved. - * @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 UselessOverridingMethodSniff implements Sniff -{ - - /** - * Object-Oriented scopes in which a call to parent::method() can exist. - * - * @var array Keys are the token constants, value is irrelevant. - */ - private $validOOScopes = [ - T_CLASS => true, - T_ANON_CLASS => true, - T_TRAIT => true, - ]; - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $token = $tokens[$stackPtr]; - - // Skip function without body. - if (isset($token['scope_opener'], $token['scope_closer']) === false) { - return; - } - - $conditions = $token['conditions']; - $lastCondition = end($conditions); - - // Skip functions that are not a method part of a class, anon class or trait. - if (isset($this->validOOScopes[$lastCondition]) === false) { - return; - } - - // Get function name. - $methodName = $phpcsFile->getDeclarationName($stackPtr); - - // Get all parameters from method signature. - $signature = []; - foreach ($phpcsFile->getMethodParameters($stackPtr) as $param) { - $signature[] = $param['name']; - } - - $next = ++$token['scope_opener']; - $end = --$token['scope_closer']; - - for (; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - - if (isset(Tokens::$emptyTokens[$code]) === true) { - continue; - } else if ($code === T_RETURN) { - continue; - } - - break; - } - - // Any token except 'parent' indicates correct code. - if ($tokens[$next]['code'] !== T_PARENT) { - return; - } - - // Find next non empty token index, should be double colon. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - - // Skip for invalid code. - if ($tokens[$next]['code'] !== T_DOUBLE_COLON) { - return; - } - - // Find next non empty token index, should be the name of the method being called. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - - // Skip for invalid code or other method. - if (strcasecmp($tokens[$next]['content'], $methodName) !== 0) { - return; - } - - // Find next non empty token index, should be the open parenthesis. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - - // Skip for invalid code. - if ($tokens[$next]['code'] !== T_OPEN_PARENTHESIS || isset($tokens[$next]['parenthesis_closer']) === false) { - return; - } - - $parameters = ['']; - $parenthesisCount = 1; - for (++$next; $next < $phpcsFile->numTokens; ++$next) { - $code = $tokens[$next]['code']; - - if ($code === T_OPEN_PARENTHESIS) { - ++$parenthesisCount; - } else if ($code === T_CLOSE_PARENTHESIS) { - --$parenthesisCount; - } else if ($parenthesisCount === 1 && $code === T_COMMA) { - $parameters[] = ''; - } else if (isset(Tokens::$emptyTokens[$code]) === false) { - $parameters[(count($parameters) - 1)] .= $tokens[$next]['content']; - } - - if ($parenthesisCount === 0) { - break; - } - }//end for - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - if ($tokens[$next]['code'] !== T_SEMICOLON && $tokens[$next]['code'] !== T_CLOSE_TAG) { - return; - } - - // This list deliberately does not include the `T_OPEN_TAG_WITH_ECHO` as that token implicitly is an echo statement, i.e. content. - $nonContent = Tokens::$emptyTokens; - $nonContent[T_OPEN_TAG] = T_OPEN_TAG; - $nonContent[T_CLOSE_TAG] = T_CLOSE_TAG; - - // Check rest of the scope. - for (++$next; $next <= $end; ++$next) { - $code = $tokens[$next]['code']; - // Skip for any other content. - if (isset($nonContent[$code]) === false) { - return; - } - } - - $parameters = array_map('trim', $parameters); - $parameters = array_filter($parameters); - - if (count($parameters) === count($signature) && $parameters === $signature) { - $phpcsFile->addWarning('Possible useless method overriding detected', $stackPtr, 'Found'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php deleted file mode 100644 index f34ffc2b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php +++ /dev/null @@ -1,357 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOC_COMMENT_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['comment_closer']) === false - || ($tokens[$tokens[$stackPtr]['comment_closer']]['content'] === '' - && $tokens[$stackPtr]['comment_closer'] === ($phpcsFile->numTokens - 1)) - ) { - // Don't process an unfinished comment during live coding. - return; - } - - $commentStart = $stackPtr; - $commentEnd = $tokens[$stackPtr]['comment_closer']; - - $empty = [ - T_DOC_COMMENT_WHITESPACE, - T_DOC_COMMENT_STAR, - ]; - - $short = $phpcsFile->findNext($empty, ($stackPtr + 1), $commentEnd, true); - if ($short === false) { - // No content at all. - $error = 'Doc comment is empty'; - $phpcsFile->addError($error, $stackPtr, 'Empty'); - return; - } - - // The first line of the comment should just be the /** code. - if ($tokens[$short]['line'] === $tokens[$stackPtr]['line']) { - $error = 'The open comment tag must be the only content on the line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpen'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($stackPtr); - $phpcsFile->fixer->addContentBefore($short, '* '); - $phpcsFile->fixer->endChangeset(); - } - } - - // The last line of the comment should just be the */ code. - $prev = $phpcsFile->findPrevious($empty, ($commentEnd - 1), $stackPtr, true); - if ($tokens[$prev]['line'] === $tokens[$commentEnd]['line']) { - $error = 'The close comment tag must be the only content on the line'; - $fix = $phpcsFile->addFixableError($error, $commentEnd, 'ContentBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($commentEnd); - } - } - - // Check for additional blank lines at the end of the comment. - if ($tokens[$prev]['line'] < ($tokens[$commentEnd]['line'] - 1)) { - $error = 'Additional blank lines found at end of doc comment'; - $fix = $phpcsFile->addFixableError($error, $commentEnd, 'SpacingAfter'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $commentEnd; $i++) { - if ($tokens[($i + 1)]['line'] === $tokens[$commentEnd]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - // Check for a comment description. - if ($tokens[$short]['code'] !== T_DOC_COMMENT_STRING) { - $error = 'Missing short description in doc comment'; - $phpcsFile->addError($error, $stackPtr, 'MissingShort'); - } else { - // No extra newline before short description. - if ($tokens[$short]['line'] !== ($tokens[$stackPtr]['line'] + 1)) { - $error = 'Doc comment short description must be on the first line'; - $fix = $phpcsFile->addFixableError($error, $short, 'SpacingBeforeShort'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = $stackPtr; $i < $short; $i++) { - if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { - continue; - } else if ($tokens[$i]['line'] === $tokens[$short]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - // Account for the fact that a short description might cover - // multiple lines. - $shortContent = $tokens[$short]['content']; - $shortEnd = $short; - for ($i = ($short + 1); $i < $commentEnd; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - if ($tokens[$i]['line'] === ($tokens[$shortEnd]['line'] + 1)) { - $shortContent .= $tokens[$i]['content']; - $shortEnd = $i; - } else { - break; - } - } - } - - if (preg_match('/^\p{Ll}/u', $shortContent) === 1) { - $error = 'Doc comment short description must start with a capital letter'; - $phpcsFile->addError($error, $short, 'ShortNotCapital'); - } - - $long = $phpcsFile->findNext($empty, ($shortEnd + 1), ($commentEnd - 1), true); - if ($long !== false && $tokens[$long]['code'] === T_DOC_COMMENT_STRING) { - if ($tokens[$long]['line'] !== ($tokens[$shortEnd]['line'] + 2)) { - $error = 'There must be exactly one blank line between descriptions in a doc comment'; - $fix = $phpcsFile->addFixableError($error, $long, 'SpacingBetween'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($shortEnd + 1); $i < $long; $i++) { - if ($tokens[$i]['line'] === $tokens[$shortEnd]['line']) { - continue; - } else if ($tokens[$i]['line'] === ($tokens[$long]['line'] - 1)) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - if (preg_match('/^\p{Ll}/u', $tokens[$long]['content']) === 1) { - $error = 'Doc comment long description must start with a capital letter'; - $phpcsFile->addError($error, $long, 'LongNotCapital'); - } - }//end if - }//end if - - if (empty($tokens[$commentStart]['comment_tags']) === true) { - // No tags in the comment. - return; - } - - $firstTag = $tokens[$commentStart]['comment_tags'][0]; - $prev = $phpcsFile->findPrevious($empty, ($firstTag - 1), $stackPtr, true); - if ($tokens[$firstTag]['line'] !== ($tokens[$prev]['line'] + 2) - && $tokens[$prev]['code'] !== T_DOC_COMMENT_OPEN_TAG - ) { - $error = 'There must be exactly one blank line before the tags in a doc comment'; - $fix = $phpcsFile->addFixableError($error, $firstTag, 'SpacingBeforeTags'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $firstTag; $i++) { - if ($tokens[$i]['line'] === $tokens[$firstTag]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $indent = str_repeat(' ', $tokens[$stackPtr]['column']); - $phpcsFile->fixer->addContent($prev, $phpcsFile->eolChar.$indent.'*'.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - } - - // Break out the tags into groups and check alignment within each. - // A tag group is one where there are no blank lines between tags. - // The param tag group is special as it requires all @param tags to be inside. - $tagGroups = []; - $groupid = 0; - $paramGroupid = null; - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($pos > 0) { - $prev = $phpcsFile->findPrevious( - T_DOC_COMMENT_STRING, - ($tag - 1), - $tokens[$commentStart]['comment_tags'][($pos - 1)] - ); - - if ($prev === false) { - $prev = $tokens[$commentStart]['comment_tags'][($pos - 1)]; - } - - if ($tokens[$prev]['line'] !== ($tokens[$tag]['line'] - 1)) { - $groupid++; - } - } - - if ($tokens[$tag]['content'] === '@param') { - if ($paramGroupid !== null - && $paramGroupid !== $groupid - ) { - $error = 'Parameter tags must be grouped together in a doc comment'; - $phpcsFile->addError($error, $tag, 'ParamGroup'); - } - - if ($paramGroupid === null) { - $paramGroupid = $groupid; - } - }//end if - - $tagGroups[$groupid][] = $tag; - }//end foreach - - foreach ($tagGroups as $groupid => $group) { - $maxLength = 0; - $paddings = []; - foreach ($group as $pos => $tag) { - if ($paramGroupid === $groupid - && $tokens[$tag]['content'] !== '@param' - ) { - $error = 'Tag %s cannot be grouped with parameter tags in a doc comment'; - $data = [$tokens[$tag]['content']]; - $phpcsFile->addError($error, $tag, 'NonParamGroup', $data); - } - - $tagLength = $tokens[$tag]['length']; - if ($tagLength > $maxLength) { - $maxLength = $tagLength; - } - - // Check for a value. No value means no padding needed. - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string !== false && $tokens[$string]['line'] === $tokens[$tag]['line']) { - $paddings[$tag] = $tokens[($tag + 1)]['length']; - } - } - - // Check that there was single blank line after the tag block - // 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($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)) { - $error = 'There must be a single blank line after a tag group'; - $fix = $phpcsFile->addFixableError($error, $lastTag, 'SpacingAfterTagGroup'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $indent = str_repeat(' ', $tokens[$stackPtr]['column']); - $phpcsFile->fixer->addContent($prev, $phpcsFile->eolChar.$indent.'*'.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - // Now check paddings. - foreach ($paddings as $tag => $padding) { - $required = ($maxLength - $tokens[$tag]['length'] + 1); - - if ($padding !== $required) { - $error = 'Tag value for %s tag indented incorrectly; expected %s spaces but found %s'; - $data = [ - $tokens[$tag]['content'], - $required, - $padding, - ]; - - $fix = $phpcsFile->addFixableError($error, ($tag + 1), 'TagValueIndent', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($tag + 1), str_repeat(' ', $required)); - } - } - } - }//end foreach - - // If there is a param group, it needs to be first. - if ($paramGroupid !== null && $paramGroupid !== 0) { - $error = 'Parameter tags must be defined first in a doc comment'; - $phpcsFile->addError($error, $tagGroups[$paramGroupid][0], 'ParamNotFirst'); - } - - $foundTags = []; - foreach ($tokens[$stackPtr]['comment_tags'] as $pos => $tag) { - $tagName = $tokens[$tag]['content']; - if (isset($foundTags[$tagName]) === true) { - $lastTag = $tokens[$stackPtr]['comment_tags'][($pos - 1)]; - if ($tokens[$lastTag]['content'] !== $tagName) { - $error = 'Tags must be grouped together in a doc comment'; - $phpcsFile->addError($error, $tag, 'TagsNotGrouped'); - } - - continue; - } - - $foundTags[$tagName] = true; - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php deleted file mode 100644 index b78a6595..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @author Sam Graham - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 FixmeSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return array_diff(Tokens::$commentTokens, Tokens::$phpcsCommentTokens); - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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']; - $matches = []; - preg_match('/(?:\A|[^\p{L}]+)fixme([^\p{L}]+(.*)|\Z)/ui', $content, $matches); - if (empty($matches) === false) { - // Clear whitespace and some common characters not required at - // the end of a fixme message to make the error more informative. - $type = 'CommentFound'; - $fixmeMessage = trim($matches[1]); - $fixmeMessage = trim($fixmeMessage, '-:[](). '); - $error = 'Comment refers to a FIXME task'; - $data = [$fixmeMessage]; - if ($fixmeMessage !== '') { - $type = 'TaskFound'; - $error .= ' "%s"'; - } - - $phpcsFile->addError($error, $stackPtr, $type, $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php deleted file mode 100644 index d24111cb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Commenting/TodoSniff.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 TodoSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return array_diff(Tokens::$commentTokens, Tokens::$phpcsCommentTokens); - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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']; - $matches = []; - preg_match('/(?:\A|[^\p{L}]+)todo([^\p{L}]+(.*)|\Z)/ui', $content, $matches); - if (empty($matches) === false) { - // Clear whitespace and some common characters not required at - // the end of a to-do message to make the warning more informative. - $type = 'CommentFound'; - $todoMessage = trim($matches[1]); - $todoMessage = trim($todoMessage, '-:[](). '); - $error = 'Comment refers to a TODO task'; - $data = [$todoMessage]; - if ($todoMessage !== '') { - $type = 'TaskFound'; - $error .= ' "%s"'; - } - - $phpcsFile->addWarning($error, $stackPtr, $type, $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php deleted file mode 100644 index 3dc7795b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php +++ /dev/null @@ -1,185 +0,0 @@ - - * @author Mark Scherer - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DisallowYodaConditionsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $tokens = Tokens::$comparisonTokens; - unset($tokens[T_COALESCE]); - - return $tokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $previousIndex = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - $relevantTokens = [ - T_CLOSE_SHORT_ARRAY, - T_CLOSE_PARENTHESIS, - T_TRUE, - T_FALSE, - T_NULL, - T_LNUMBER, - T_DNUMBER, - T_CONSTANT_ENCAPSED_STRING, - ]; - - if (in_array($tokens[$previousIndex]['code'], $relevantTokens, true) === false) { - return; - } - - if ($tokens[$previousIndex]['code'] === T_CLOSE_SHORT_ARRAY) { - $previousIndex = $tokens[$previousIndex]['bracket_opener']; - if ($this->isArrayStatic($phpcsFile, $previousIndex) === false) { - return; - } - } - - $prevIndex = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($previousIndex - 1), null, true); - - if (in_array($tokens[$prevIndex]['code'], Tokens::$arithmeticTokens, true) === true) { - return; - } - - if ($tokens[$prevIndex]['code'] === T_STRING_CONCAT) { - return; - } - - // Is it a parenthesis. - if ($tokens[$previousIndex]['code'] === T_CLOSE_PARENTHESIS) { - $beforeOpeningParenthesisIndex = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($tokens[$previousIndex]['parenthesis_opener'] - 1), - null, - true - ); - - if ($beforeOpeningParenthesisIndex === false || $tokens[$beforeOpeningParenthesisIndex]['code'] !== T_ARRAY) { - if ($tokens[$beforeOpeningParenthesisIndex]['code'] === T_STRING) { - return; - } - - // If it is not an array check what is inside. - $found = $phpcsFile->findPrevious( - T_VARIABLE, - ($previousIndex - 1), - $tokens[$previousIndex]['parenthesis_opener'] - ); - - // If a variable exists, it is not Yoda. - if ($found !== false) { - return; - } - - // If there is nothing inside the parenthesis, it is not a Yoda condition. - $opener = $tokens[$previousIndex]['parenthesis_opener']; - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($previousIndex - 1), ($opener + 1), true); - if ($prev === false) { - return; - } - } else if ($tokens[$beforeOpeningParenthesisIndex]['code'] === T_ARRAY - && $this->isArrayStatic($phpcsFile, $beforeOpeningParenthesisIndex) === false - ) { - return; - }//end if - }//end if - - $phpcsFile->addError( - 'Usage of Yoda conditions is not allowed; switch the expression order', - $stackPtr, - 'Found' - ); - - }//end process() - - - /** - * Determines if an array is a static definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $arrayToken The position of the array token. - * - * @return bool - */ - public function isArrayStatic(File $phpcsFile, $arrayToken) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$arrayToken]['code'] === T_OPEN_SHORT_ARRAY) { - $start = $arrayToken; - $end = $tokens[$arrayToken]['bracket_closer']; - } else if ($tokens[$arrayToken]['code'] === T_ARRAY) { - $start = $tokens[$arrayToken]['parenthesis_opener']; - $end = $tokens[$arrayToken]['parenthesis_closer']; - } else { - // Shouldn't be possible but may happen if external sniffs are using this method. - return true; - } - - $staticTokens = Tokens::$emptyTokens; - $staticTokens += Tokens::$textStringTokens; - $staticTokens += Tokens::$assignmentTokens; - $staticTokens += Tokens::$equalityTokens; - $staticTokens += Tokens::$comparisonTokens; - $staticTokens += Tokens::$arithmeticTokens; - $staticTokens += Tokens::$operators; - $staticTokens += Tokens::$booleanOperators; - $staticTokens += Tokens::$castTokens; - $staticTokens += Tokens::$bracketTokens; - $staticTokens += [ - T_DOUBLE_ARROW => T_DOUBLE_ARROW, - T_COMMA => T_COMMA, - T_TRUE => T_TRUE, - T_FALSE => T_FALSE, - ]; - - for ($i = ($start + 1); $i < $end; $i++) { - if (isset($tokens[$i]['scope_closer']) === true) { - $i = $tokens[$i]['scope_closer']; - continue; - } - - if (isset($staticTokens[$tokens[$i]['code']]) === false) { - return false; - } - } - - return true; - - }//end isArrayStatic() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php deleted file mode 100644 index bc4a916d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php +++ /dev/null @@ -1,381 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class InlineControlStructureSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * If true, an error will be thrown; otherwise a warning. - * - * @var boolean - */ - public $error = true; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_ELSE, - T_ELSEIF, - T_FOREACH, - T_WHILE, - T_DO, - T_SWITCH, - T_FOR, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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|int - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'no'); - return; - } - - // Ignore the ELSE in ELSE IF. We'll process the IF part later. - if ($tokens[$stackPtr]['code'] === T_ELSE) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_IF) { - return; - } - } - - if ($tokens[$stackPtr]['code'] === T_WHILE || $tokens[$stackPtr]['code'] === T_FOR) { - // This could be from a DO WHILE, which doesn't have an opening brace or a while/for without body. - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $afterParensCloser = $phpcsFile->findNext(Tokens::$emptyTokens, ($tokens[$stackPtr]['parenthesis_closer'] + 1), null, true); - if ($afterParensCloser === false) { - // Live coding. - return; - } - - if ($tokens[$afterParensCloser]['code'] === T_SEMICOLON) { - $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'no'); - return; - } - } - - // In Javascript DO WHILE loops without curly braces are legal. This - // is only valid if a single statement is present between the DO and - // the WHILE. We can detect this by checking only a single semicolon - // is present between them. - if ($tokens[$stackPtr]['code'] === T_WHILE && $phpcsFile->tokenizerType === 'JS') { - $lastDo = $phpcsFile->findPrevious(T_DO, ($stackPtr - 1)); - $lastSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, ($stackPtr - 1)); - if ($lastDo !== false && $lastSemicolon !== false && $lastDo < $lastSemicolon) { - $precedingSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, ($lastSemicolon - 1)); - if ($precedingSemicolon === false || $precedingSemicolon < $lastDo) { - return; - } - } - } - }//end if - - if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false - && $tokens[$stackPtr]['code'] !== T_ELSE - ) { - if ($tokens[$stackPtr]['code'] !== T_DO) { - // Live coding or parse error. - return; - } - - $nextWhile = $phpcsFile->findNext(T_WHILE, ($stackPtr + 1)); - if ($nextWhile !== false - && isset($tokens[$nextWhile]['parenthesis_opener'], $tokens[$nextWhile]['parenthesis_closer']) === false - ) { - // Live coding or parse error. - return; - } - - unset($nextWhile); - } - - $start = $stackPtr; - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $start = $tokens[$stackPtr]['parenthesis_closer']; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($start + 1), null, true); - if ($nextNonEmpty === false) { - // Live coding or parse error. - return; - } - - if ($tokens[$nextNonEmpty]['code'] === T_OPEN_CURLY_BRACKET - || $tokens[$nextNonEmpty]['code'] === T_COLON - ) { - // T_CLOSE_CURLY_BRACKET missing, or alternative control structure with - // T_END... missing. Either live coding, parse error or end - // tag in short open tags and scan run with short_open_tag=Off. - // Bow out completely as any further detection will be unreliable - // and create incorrect fixes or cause fixer conflicts. - return $phpcsFile->numTokens; - } - - unset($nextNonEmpty, $start); - - // This is a control structure without an opening brace, - // so it is an inline statement. - if ($this->error === true) { - $fix = $phpcsFile->addFixableError('Inline control structures are not allowed', $stackPtr, 'NotAllowed'); - } else { - $fix = $phpcsFile->addFixableWarning('Inline control structures are discouraged', $stackPtr, 'Discouraged'); - } - - $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'yes'); - - // Stop here if we are not fixing the error. - if ($fix !== true) { - return; - } - - $phpcsFile->fixer->beginChangeset(); - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $closer = $tokens[$stackPtr]['parenthesis_closer']; - } else { - $closer = $stackPtr; - } - - if ($tokens[($closer + 1)]['code'] === T_WHITESPACE - || $tokens[($closer + 1)]['code'] === T_SEMICOLON - ) { - $phpcsFile->fixer->addContent($closer, ' {'); - } else { - $phpcsFile->fixer->addContent($closer, ' { '); - } - - $fixableScopeOpeners = $this->register(); - - $lastNonEmpty = $closer; - for ($end = ($closer + 1); $end < $phpcsFile->numTokens; $end++) { - if ($tokens[$end]['code'] === T_SEMICOLON) { - break; - } - - if ($tokens[$end]['code'] === T_CLOSE_TAG) { - $end = $lastNonEmpty; - break; - } - - if (in_array($tokens[$end]['code'], $fixableScopeOpeners, true) === true - && isset($tokens[$end]['scope_opener']) === false - ) { - // The best way to fix nested inline scopes is middle-out. - // So skip this one. It will be detected and fixed on a future loop. - $phpcsFile->fixer->rollbackChangeset(); - return; - } - - if (isset($tokens[$end]['scope_opener']) === true) { - $type = $tokens[$end]['code']; - $end = $tokens[$end]['scope_closer']; - if ($type === T_DO - || $type === T_IF || $type === T_ELSEIF - || $type === T_TRY || $type === T_CATCH || $type === T_FINALLY - ) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($next === false) { - break; - } - - $nextType = $tokens[$next]['code']; - - // Let additional conditions loop and find their ending. - if (($type === T_IF - || $type === T_ELSEIF) - && ($nextType === T_ELSEIF - || $nextType === T_ELSE) - ) { - continue; - } - - // Account for TRY... CATCH/FINALLY statements. - if (($type === T_TRY - || $type === T_CATCH - || $type === T_FINALLY) - && ($nextType === T_CATCH - || $nextType === T_FINALLY) - ) { - continue; - } - - // Account for DO... WHILE conditions. - if ($type === T_DO && $nextType === T_WHILE) { - $end = $phpcsFile->findNext(T_SEMICOLON, ($next + 1)); - } - } else if ($type === T_CLOSURE) { - // There should be a semicolon after the closing brace. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($next !== false && $tokens[$next]['code'] === T_SEMICOLON) { - $end = $next; - } - }//end if - - if ($tokens[$end]['code'] !== T_END_HEREDOC - && $tokens[$end]['code'] !== T_END_NOWDOC - ) { - break; - } - }//end if - - if (isset($tokens[$end]['parenthesis_closer']) === true) { - $end = $tokens[$end]['parenthesis_closer']; - $lastNonEmpty = $end; - continue; - } - - if ($tokens[$end]['code'] !== T_WHITESPACE) { - $lastNonEmpty = $end; - } - }//end for - - if ($end === $phpcsFile->numTokens) { - $end = $lastNonEmpty; - } - - $nextContent = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($nextContent === false || $tokens[$nextContent]['line'] !== $tokens[$end]['line']) { - // Looks for completely empty statements. - $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), ($end + 1), true); - } else { - $next = ($end + 1); - $endLine = $end; - } - - if ($next !== $end) { - if ($nextContent === false || $tokens[$nextContent]['line'] !== $tokens[$end]['line']) { - // Account for a comment on the end of the line. - for ($endLine = $end; $endLine < $phpcsFile->numTokens; $endLine++) { - if (isset($tokens[($endLine + 1)]) === false - || $tokens[$endLine]['line'] !== $tokens[($endLine + 1)]['line'] - ) { - break; - } - } - - if (isset(Tokens::$commentTokens[$tokens[$endLine]['code']]) === false - && ($tokens[$endLine]['code'] !== T_WHITESPACE - || isset(Tokens::$commentTokens[$tokens[($endLine - 1)]['code']]) === false) - ) { - $endLine = $end; - } - } - - if ($endLine !== $end) { - $endToken = $endLine; - $addedContent = ''; - } else { - $endToken = $end; - $addedContent = $phpcsFile->eolChar; - - if ($tokens[$end]['code'] !== T_SEMICOLON - && $tokens[$end]['code'] !== T_CLOSE_CURLY_BRACKET - ) { - $phpcsFile->fixer->addContent($end, '; '); - } - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($endToken + 1), null, true); - if ($next !== false - && ($tokens[$next]['code'] === T_ELSE - || $tokens[$next]['code'] === T_ELSEIF) - ) { - $phpcsFile->fixer->addContentBefore($next, '} '); - } else { - $indent = ''; - for ($first = $stackPtr; $first > 0; $first--) { - if ($tokens[$first]['column'] === 1) { - break; - } - } - - if ($tokens[$first]['code'] === T_WHITESPACE) { - $indent = $tokens[$first]['content']; - } else if ($tokens[$first]['code'] === T_INLINE_HTML - || $tokens[$first]['code'] === T_OPEN_TAG - ) { - $addedContent = ''; - } - - $addedContent .= $indent.'}'; - if ($next !== false && $tokens[$endToken]['code'] === T_COMMENT) { - $addedContent .= $phpcsFile->eolChar; - } - - $phpcsFile->fixer->addContent($endToken, $addedContent); - }//end if - } else { - if ($nextContent === false || $tokens[$nextContent]['line'] !== $tokens[$end]['line']) { - // Account for a comment on the end of the line. - for ($endLine = $end; $endLine < $phpcsFile->numTokens; $endLine++) { - if (isset($tokens[($endLine + 1)]) === false - || $tokens[$endLine]['line'] !== $tokens[($endLine + 1)]['line'] - ) { - break; - } - } - - if ($tokens[$endLine]['code'] !== T_COMMENT - && ($tokens[$endLine]['code'] !== T_WHITESPACE - || $tokens[($endLine - 1)]['code'] !== T_COMMENT) - ) { - $endLine = $end; - } - } - - if ($endLine !== $end) { - $phpcsFile->fixer->replaceToken($end, ''); - $phpcsFile->fixer->addNewlineBefore($endLine); - $phpcsFile->fixer->addContent($endLine, '}'); - } else { - $phpcsFile->fixer->replaceToken($end, '}'); - } - }//end if - - $phpcsFile->fixer->endChangeset(); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php deleted file mode 100644 index 6df4c1ff..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php +++ /dev/null @@ -1,98 +0,0 @@ - - * @copyright 2013-2014 Roman Levishchenko - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class CSSLintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $csslintPath = Config::getExecutablePath('csslint'); - if ($csslintPath === null) { - return $phpcsFile->numTokens; - } - - $fileName = $phpcsFile->getFilename(); - - $cmd = Common::escapeshellcmd($csslintPath).' '.escapeshellarg($fileName).' 2>&1'; - exec($cmd, $output, $retval); - - if (is_array($output) === false) { - return $phpcsFile->numTokens; - } - - $count = count($output); - - for ($i = 0; $i < $count; $i++) { - $matches = []; - $numMatches = preg_match( - '/(error|warning) at line (\d+)/', - $output[$i], - $matches - ); - - if ($numMatches === 0) { - continue; - } - - $line = (int) $matches[2]; - $message = 'csslint says: '.$output[($i + 1)]; - // First line is message with error line and error code. - // Second is error message. - // Third is wrong line in file. - // Fourth is empty line. - $i += 4; - - $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); - }//end for - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php deleted file mode 100644 index 637bf41e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php +++ /dev/null @@ -1,119 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class ClosureLinterSniff implements Sniff -{ - - /** - * A list of error codes that should show errors. - * - * All other error codes will show warnings. - * - * @var array - */ - public $errorCodes = []; - - /** - * A list of error codes to ignore. - * - * @var array - */ - public $ignoreCodes = []; - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @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 $phpcsFile->numTokens; - } - - $fileName = $phpcsFile->getFilename(); - - $lintPath = Common::escapeshellcmd($lintPath); - $cmd = $lintPath.' --nosummary --notime --unix_mode '.escapeshellarg($fileName); - exec($cmd, $output, $retval); - - if (is_array($output) === false) { - return $phpcsFile->numTokens; - } - - foreach ($output as $finding) { - $matches = []; - $numMatches = preg_match('/^(.*):([0-9]+):\(.*?([0-9]+)\)(.*)$/', $finding, $matches); - if ($numMatches === 0) { - continue; - } - - // Skip error codes we are ignoring. - $code = $matches[3]; - if (in_array($code, $this->ignoreCodes) === true) { - continue; - } - - $line = (int) $matches[2]; - $error = trim($matches[4]); - - $message = 'gjslint says: (%s) %s'; - $data = [ - $code, - $error, - ]; - if (in_array($code, $this->errorCodes) === true) { - $phpcsFile->addErrorOnLine($message, $line, 'ExternalToolError', $data); - } else { - $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool', $data); - } - }//end foreach - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php deleted file mode 100644 index 1c6b0e3f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/ESLintSniff.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class ESLintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - /** - * ESLint configuration file path. - * - * @var string|null Path to eslintrc. Null to autodetect. - */ - public $configFile = null; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @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 $phpcsFile->numTokens; - } - - $filename = $phpcsFile->getFilename(); - - $configFile = $this->configFile; - if (empty($configFile) === true) { - // Attempt to autodetect. - $candidates = glob('.eslintrc{.js,.yaml,.yml,.json}', GLOB_BRACE); - if (empty($candidates) === false) { - $configFile = $candidates[0]; - } - } - - $eslintOptions = ['--format json']; - if (empty($configFile) === false) { - $eslintOptions[] = '--config '.escapeshellarg($configFile); - } - - $cmd = Common::escapeshellcmd(escapeshellarg($eslintPath).' '.implode(' ', $eslintOptions).' '.escapeshellarg($filename)); - - // Execute! - exec($cmd, $stdout, $code); - - if ($code <= 0) { - // No errors, continue. - return $phpcsFile->numTokens; - } - - $data = json_decode(implode("\n", $stdout)); - if (json_last_error() !== JSON_ERROR_NONE) { - // Ignore any errors. - return $phpcsFile->numTokens; - } - - // Data is a list of files, but we only pass a single one. - $messages = $data[0]->messages; - foreach ($messages as $error) { - $message = 'eslint says: '.$error->message; - if (empty($error->fatal) === false || $error->severity === 2) { - $phpcsFile->addErrorOnLine($message, $error->line, 'ExternalTool'); - } else { - $phpcsFile->addWarningOnLine($message, $error->line, 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php deleted file mode 100644 index ae8264eb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Debug/JSHintSniff.php +++ /dev/null @@ -1,97 +0,0 @@ - - * @author Alexander Wei§ - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class JSHintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @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 ($jshintPath === null) { - return $phpcsFile->numTokens; - } - - $fileName = $phpcsFile->getFilename(); - $jshintPath = Common::escapeshellcmd($jshintPath); - - if ($rhinoPath !== null) { - $rhinoPath = Common::escapeshellcmd($rhinoPath); - $cmd = "$rhinoPath \"$jshintPath\" ".escapeshellarg($fileName); - exec($cmd, $output, $retval); - - $regex = '`^(?P.+)\(.+:(?P[0-9]+).*:[0-9]+\)$`'; - } else { - $cmd = "$jshintPath ".escapeshellarg($fileName); - exec($cmd, $output, $retval); - - $regex = '`^(.+?): line (?P[0-9]+), col [0-9]+, (?P.+)$`'; - } - - if (is_array($output) === true) { - foreach ($output as $finding) { - $matches = []; - $numMatches = preg_match($regex, $finding, $matches); - if ($numMatches === 0) { - continue; - } - - $line = (int) $matches['line']; - $message = 'jshint says: '.trim($matches['error']); - $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php deleted file mode 100644 index 5a1fde6f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2010-2014 mediaSELF Sp. z o.o. - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ByteOrderMarkSniff implements Sniff -{ - - /** - * List of supported BOM definitions. - * - * Use encoding names as keys and hex BOM representations as values. - * - * @var array - */ - protected $bomDefinitions = [ - 'UTF-8' => 'efbbbf', - 'UTF-16 (BE)' => 'feff', - 'UTF-16 (LE)' => 'fffe', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INLINE_HTML]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - // The BOM will be the very first token in the file. - if ($stackPtr !== 0) { - return $phpcsFile->numTokens; - } - - $tokens = $phpcsFile->getTokens(); - - foreach ($this->bomDefinitions as $bomName => $expectedBomHex) { - $bomByteLength = (strlen($expectedBomHex) / 2); - $htmlBomHex = bin2hex(substr($tokens[$stackPtr]['content'], 0, $bomByteLength)); - if ($htmlBomHex === $expectedBomHex) { - $errorData = [$bomName]; - $error = 'File contains %s byte order mark, which may corrupt your application'; - $phpcsFile->addError($error, $stackPtr, 'Found', $errorData); - $phpcsFile->recordMetric($stackPtr, 'Using byte order mark', 'yes'); - return $phpcsFile->numTokens; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Using byte order mark', 'no'); - - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php deleted file mode 100644 index 71bcabbb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class EndFileNewlineSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - 'CSS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - // Skip to the end of the file. - $tokens = $phpcsFile->getTokens(); - $stackPtr = ($phpcsFile->numTokens - 1); - - if ($tokens[$stackPtr]['content'] === '') { - $stackPtr--; - } - - $eolCharLen = strlen($phpcsFile->eolChar); - $lastChars = substr($tokens[$stackPtr]['content'], ($eolCharLen * -1)); - if ($lastChars !== $phpcsFile->eolChar) { - $phpcsFile->recordMetric($stackPtr, 'Newline at EOF', 'no'); - - $error = 'File must end with a newline character'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotFound'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($stackPtr); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Newline at EOF', 'yes'); - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php deleted file mode 100644 index 3f766075..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class EndFileNoNewlineSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - 'CSS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - // Skip to the end of the file. - $tokens = $phpcsFile->getTokens(); - $stackPtr = ($phpcsFile->numTokens - 1); - - if ($tokens[$stackPtr]['content'] === '') { - --$stackPtr; - } - - $eolCharLen = strlen($phpcsFile->eolChar); - $lastChars = substr($tokens[$stackPtr]['content'], ($eolCharLen * -1)); - if ($lastChars === $phpcsFile->eolChar) { - $error = 'File must not end with a newline character'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = $stackPtr; $i > 0; $i--) { - $newContent = rtrim($tokens[$i]['content'], $phpcsFile->eolChar); - $phpcsFile->fixer->replaceToken($i, $newContent); - - if ($newContent !== '') { - break; - } - } - - $phpcsFile->fixer->endChangeset(); - } - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php deleted file mode 100644 index 8f597dfd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 2019 Matthew Peveler - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ExecutableFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $filename = $phpcsFile->getFilename(); - - if ($filename !== 'STDIN') { - $perms = fileperms($phpcsFile->getFilename()); - if (($perms & 0x0040) !== 0 || ($perms & 0x0008) !== 0 || ($perms & 0x0001) !== 0) { - $error = 'A PHP file should not be executable; found file permissions set to %s'; - $data = [substr(sprintf('%o', $perms), -4)]; - $phpcsFile->addError($error, 0, 'Executable', $data); - } - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php deleted file mode 100644 index d90b8930..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class InlineHTMLSniff implements Sniff -{ - - /** - * List of supported BOM definitions. - * - * Use encoding names as keys and hex BOM representations as values. - * - * @var array - */ - protected $bomDefinitions = [ - 'UTF-8' => 'efbbbf', - 'UTF-16 (BE)' => 'feff', - 'UTF-16 (LE)' => 'fffe', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INLINE_HTML]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - // Allow a byte-order mark. - $tokens = $phpcsFile->getTokens(); - foreach ($this->bomDefinitions as $expectedBomHex) { - $bomByteLength = (strlen($expectedBomHex) / 2); - $htmlBomHex = bin2hex(substr($tokens[0]['content'], 0, $bomByteLength)); - if ($htmlBomHex === $expectedBomHex && strlen($tokens[0]['content']) === $bomByteLength) { - return; - } - } - - // Ignore shebang lines. - $tokens = $phpcsFile->getTokens(); - if (substr($tokens[$stackPtr]['content'], 0, 2) === '#!') { - return; - } - - $error = 'PHP files must only contain PHP code'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php deleted file mode 100644 index 1814b555..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php +++ /dev/null @@ -1,148 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class LineEndingsSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - 'CSS', - ]; - - /** - * The valid EOL character. - * - * @var string - */ - public $eolChar = '\n'; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $found = $phpcsFile->eolChar; - $found = str_replace("\n", '\n', $found); - $found = str_replace("\r", '\r', $found); - - $phpcsFile->recordMetric($stackPtr, 'EOL char', $found); - - if ($found === $this->eolChar) { - // Ignore the rest of the file. - return $phpcsFile->numTokens; - } - - // Check for single line files without an EOL. This is a very special - // case and the EOL char is set to \n when this happens. - if ($found === '\n') { - $tokens = $phpcsFile->getTokens(); - $lastToken = ($phpcsFile->numTokens - 1); - if ($tokens[$lastToken]['line'] === 1 - && $tokens[$lastToken]['content'] !== "\n" - ) { - return $phpcsFile->numTokens; - } - } - - $error = 'End of line character is invalid; expected "%s" but found "%s"'; - $expected = $this->eolChar; - $expected = str_replace("\n", '\n', $expected); - $expected = str_replace("\r", '\r', $expected); - $data = [ - $expected, - $found, - ]; - - // Errors are always reported on line 1, no matter where the first PHP tag is. - $fix = $phpcsFile->addFixableError($error, 0, 'InvalidEOLChar', $data); - - if ($fix === true) { - $tokens = $phpcsFile->getTokens(); - switch ($this->eolChar) { - case '\n': - $eolChar = "\n"; - break; - case '\r': - $eolChar = "\r"; - break; - case '\r\n': - $eolChar = "\r\n"; - break; - default: - $eolChar = $this->eolChar; - break; - } - - for ($i = 0; $i < $phpcsFile->numTokens; $i++) { - if (isset($tokens[($i + 1)]) === true - && $tokens[($i + 1)]['line'] <= $tokens[$i]['line'] - ) { - continue; - } - - // Token is the last on a line. - if (isset($tokens[$i]['orig_content']) === true) { - $tokenContent = $tokens[$i]['orig_content']; - } else { - $tokenContent = $tokens[$i]['content']; - } - - if ($tokenContent === '') { - // Special case for JS/CSS close tag. - continue; - } - - $newContent = rtrim($tokenContent, "\r\n"); - $newContent .= $eolChar; - if ($tokenContent !== $newContent) { - $phpcsFile->fixer->replaceToken($i, $newContent); - } - }//end for - }//end if - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php deleted file mode 100644 index a65baf76..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LineLengthSniff.php +++ /dev/null @@ -1,201 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class LineLengthSniff implements Sniff -{ - - /** - * The limit that the length of a line should not exceed. - * - * @var integer - */ - public $lineLimit = 80; - - /** - * The limit that the length of a line must not exceed. - * - * Set to zero (0) to disable. - * - * @var integer - */ - public $absoluteLineLimit = 100; - - /** - * Whether or not to ignore trailing comments. - * - * This has the effect of also ignoring all lines - * that only contain comments. - * - * @var boolean - */ - public $ignoreComments = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - for ($i = 1; $i < $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['column'] === 1) { - $this->checkLineLength($phpcsFile, $tokens, $i); - } - } - - $this->checkLineLength($phpcsFile, $tokens, $i); - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - - /** - * Checks if a line is too long. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tokens The token stack. - * @param int $stackPtr The first token on the next line. - * - * @return void - */ - protected function checkLineLength($phpcsFile, $tokens, $stackPtr) - { - // The passed token is the first on the line. - $stackPtr--; - - if ($tokens[$stackPtr]['column'] === 1 - && $tokens[$stackPtr]['length'] === 0 - ) { - // Blank line. - return; - } - - if ($tokens[$stackPtr]['column'] !== 1 - && $tokens[$stackPtr]['content'] === $phpcsFile->eolChar - ) { - $stackPtr--; - } - - $onlyComment = false; - if (isset(Tokens::$commentTokens[$tokens[$stackPtr]['code']]) === true) { - $prevNonWhiteSpace = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$stackPtr]['line'] !== $tokens[$prevNonWhiteSpace]['line']) { - $onlyComment = true; - } - } - - if ($onlyComment === true - && isset(Tokens::$phpcsCommentTokens[$tokens[$stackPtr]['code']]) === true - ) { - // Ignore PHPCS annotation comments that are on a line by themselves. - return; - } - - $lineLength = ($tokens[$stackPtr]['column'] + $tokens[$stackPtr]['length'] - 1); - - if ($this->ignoreComments === true - && isset(Tokens::$commentTokens[$tokens[$stackPtr]['code']]) === true - ) { - // Trailing comments are being ignored in line length calculations. - if ($onlyComment === true) { - // The comment is the only thing on the line, so no need to check length. - return; - } - - $lineLength -= $tokens[$stackPtr]['length']; - } - - // Record metrics for common line length groupings. - if ($lineLength <= 80) { - $phpcsFile->recordMetric($stackPtr, 'Line length', '80 or less'); - } else if ($lineLength <= 120) { - $phpcsFile->recordMetric($stackPtr, 'Line length', '81-120'); - } else if ($lineLength <= 150) { - $phpcsFile->recordMetric($stackPtr, 'Line length', '121-150'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Line length', '151 or more'); - } - - if ($onlyComment === true) { - // If this is a long comment, check if it can be broken up onto multiple lines. - // Some comments contain unbreakable strings like URLs and so it makes sense - // to ignore the line length in these cases if the URL would be longer than the max - // line length once you indent it to the correct level. - if ($lineLength > $this->lineLimit) { - $oldLength = strlen($tokens[$stackPtr]['content']); - $newLength = strlen(ltrim($tokens[$stackPtr]['content'], "/#\t ")); - $indent = (($tokens[$stackPtr]['column'] - 1) + ($oldLength - $newLength)); - - $nonBreakingLength = $tokens[$stackPtr]['length']; - - $space = strrpos($tokens[$stackPtr]['content'], ' '); - if ($space !== false) { - $nonBreakingLength -= ($space + 1); - } - - if (($nonBreakingLength + $indent) > $this->lineLimit) { - return; - } - } - }//end if - - if ($this->absoluteLineLimit > 0 - && $lineLength > $this->absoluteLineLimit - ) { - $data = [ - $this->absoluteLineLimit, - $lineLength, - ]; - - $error = 'Line exceeds maximum limit of %s characters; contains %s characters'; - $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); - } else if ($lineLength > $this->lineLimit) { - $data = [ - $this->lineLimit, - $lineLength, - ]; - - $warning = 'Line exceeds %s characters; contains %s characters'; - $phpcsFile->addWarning($warning, $stackPtr, 'TooLong', $data); - } - - }//end checkLineLength() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php deleted file mode 100644 index 1773cb8a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class LowercasedFilenameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $filename = $phpcsFile->getFilename(); - if ($filename === 'STDIN') { - return $phpcsFile->numTokens; - } - - $filename = basename($filename); - $lowercaseFilename = strtolower($filename); - if ($filename !== $lowercaseFilename) { - $data = [ - $filename, - $lowercaseFilename, - ]; - $error = 'Filename "%s" doesn\'t match the expected filename "%s"'; - $phpcsFile->addError($error, $stackPtr, 'NotFound', $data); - $phpcsFile->recordMetric($stackPtr, 'Lowercase filename', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Lowercase filename', 'yes'); - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php deleted file mode 100644 index e328e744..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OneClassPerFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - $start = ($stackPtr + 1); - if (isset($tokens[$stackPtr]['scope_closer']) === true) { - $start = ($tokens[$stackPtr]['scope_closer'] + 1); - } - - $nextClass = $phpcsFile->findNext($this->register(), $start); - if ($nextClass !== false) { - $error = 'Only one class is allowed in a file'; - $phpcsFile->addError($error, $nextClass, 'MultipleFound'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php deleted file mode 100644 index 34211f2f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2010-2014 Andy Grunwald - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OneInterfacePerFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INTERFACE]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - $start = ($stackPtr + 1); - if (isset($tokens[$stackPtr]['scope_closer']) === true) { - $start = ($tokens[$stackPtr]['scope_closer'] + 1); - } - - $nextInterface = $phpcsFile->findNext($this->register(), $start); - if ($nextInterface !== false) { - $error = 'Only one interface is allowed in a file'; - $phpcsFile->addError($error, $nextInterface, 'MultipleFound'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php deleted file mode 100644 index 459c5d1a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OneObjectStructurePerFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - $start = ($stackPtr + 1); - if (isset($tokens[$stackPtr]['scope_closer']) === true) { - $start = ($tokens[$stackPtr]['scope_closer'] + 1); - } - - $nextClass = $phpcsFile->findNext($this->register(), $start); - if ($nextClass !== false) { - $error = 'Only one object structure is allowed in a file'; - $phpcsFile->addError($error, $nextClass, 'MultipleFound'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php deleted file mode 100644 index 309383fc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2010-2014 Alexander Obuhovich - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OneTraitPerFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_TRAIT]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - $start = ($stackPtr + 1); - if (isset($tokens[$stackPtr]['scope_closer']) === true) { - $start = ($tokens[$stackPtr]['scope_closer'] + 1); - } - - $nextClass = $phpcsFile->findNext($this->register(), $start); - if ($nextClass !== false) { - $error = 'Only one trait is allowed in a file'; - $phpcsFile->addError($error, $nextClass, 'MultipleFound'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php deleted file mode 100644 index 750fdabc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowMultipleStatementsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_SEMICOLON]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $fixable = true; - $prev = $stackPtr; - - do { - $prev = $phpcsFile->findPrevious([T_SEMICOLON, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_PHPCS_IGNORE], ($prev - 1)); - if ($prev === false - || $tokens[$prev]['code'] === T_OPEN_TAG - || $tokens[$prev]['code'] === T_OPEN_TAG_WITH_ECHO - ) { - $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no'); - return; - } - - if ($tokens[$prev]['code'] === T_PHPCS_IGNORE) { - $fixable = false; - } - } while ($tokens[$prev]['code'] === T_PHPCS_IGNORE); - - // Ignore multiple statements in a FOR condition. - foreach ([$stackPtr, $prev] as $checkToken) { - if (isset($tokens[$checkToken]['nested_parenthesis']) === true) { - foreach ($tokens[$checkToken]['nested_parenthesis'] as $bracket) { - if (isset($tokens[$bracket]['parenthesis_owner']) === false) { - // Probably a closure sitting inside a function call. - continue; - } - - $owner = $tokens[$bracket]['parenthesis_owner']; - if ($tokens[$owner]['code'] === T_FOR) { - return; - } - } - } - } - - if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) { - $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'yes'); - - $error = 'Each PHP statement must be on a line by itself'; - $code = 'SameLine'; - if ($fixable === false) { - $phpcsFile->addError($error, $stackPtr, $code); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($prev); - if ($tokens[($prev + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($prev + 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no'); - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php deleted file mode 100644 index 8916659a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php +++ /dev/null @@ -1,426 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class MultipleStatementAlignmentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * If true, an error will be thrown; otherwise a warning. - * - * @var boolean - */ - public $error = false; - - /** - * The maximum amount of padding before the alignment is ignored. - * - * If the amount of padding required to align this assignment with the - * surrounding assignments exceeds this number, the assignment will be - * ignored and no errors or warnings will be thrown. - * - * @var integer - */ - public $maxPadding = 1000; - - /** - * Controls which side of the assignment token is used for alignment. - * - * @var boolean - */ - public $alignAtEnd = true; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $tokens = Tokens::$assignmentTokens; - unset($tokens[T_DOUBLE_ARROW]); - return $tokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $lastAssign = $this->checkAlignment($phpcsFile, $stackPtr); - return ($lastAssign + 1); - - }//end process() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 $end The token where checking should end. - * If NULL, the entire file will be checked. - * - * @return int - */ - public function checkAlignment($phpcsFile, $stackPtr, $end=null) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore assignments used in a condition, like an IF or FOR or closure param defaults. - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - // If the parenthesis is on the same line as the assignment, - // then it should be ignored as it is specifically being grouped. - $parens = $tokens[$stackPtr]['nested_parenthesis']; - $lastParen = array_pop($parens); - if ($tokens[$lastParen]['line'] === $tokens[$stackPtr]['line']) { - return $stackPtr; - } - - foreach ($tokens[$stackPtr]['nested_parenthesis'] as $start => $end) { - if (isset($tokens[$start]['parenthesis_owner']) === true) { - return $stackPtr; - } - } - } - - $assignments = []; - $prevAssign = null; - $lastLine = $tokens[$stackPtr]['line']; - $maxPadding = null; - $stopped = null; - $lastCode = $stackPtr; - $lastSemi = null; - $arrayEnd = null; - - if ($end === null) { - $end = $phpcsFile->numTokens; - } - - $find = Tokens::$assignmentTokens; - unset($find[T_DOUBLE_ARROW]); - - $scopes = Tokens::$scopeOpeners; - unset($scopes[T_CLOSURE]); - unset($scopes[T_ANON_CLASS]); - unset($scopes[T_OBJECT]); - - for ($assign = $stackPtr; $assign < $end; $assign++) { - if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) { - // Statement is in a different context, so the block is over. - break; - } - - if (isset($tokens[$assign]['scope_opener']) === true - && $tokens[$assign]['level'] === $tokens[$stackPtr]['level'] - ) { - if (isset($scopes[$tokens[$assign]['code']]) === true) { - // This type of scope indicates that the assignment block is over. - break; - } - - // Skip over the scope block because it is seen as part of the assignment block, - // but also process any assignment blocks that are inside as well. - $nextAssign = $phpcsFile->findNext($find, ($assign + 1), ($tokens[$assign]['scope_closer'] - 1)); - if ($nextAssign !== false) { - $assign = $this->checkAlignment($phpcsFile, $nextAssign); - } else { - $assign = $tokens[$assign]['scope_closer']; - } - - $lastCode = $assign; - continue; - } - - if ($assign === $arrayEnd) { - $arrayEnd = null; - } - - if (isset($find[$tokens[$assign]['code']]) === false) { - // A blank line indicates that the assignment block has ended. - if (isset(Tokens::$emptyTokens[$tokens[$assign]['code']]) === false - && ($tokens[$assign]['line'] - $tokens[$lastCode]['line']) > 1 - && $tokens[$assign]['level'] === $tokens[$stackPtr]['level'] - && $arrayEnd === null - ) { - break; - } - - if ($tokens[$assign]['code'] === T_CLOSE_TAG) { - // Breaking out of PHP ends the assignment block. - break; - } - - if ($tokens[$assign]['code'] === T_OPEN_SHORT_ARRAY - && isset($tokens[$assign]['bracket_closer']) === true - ) { - $arrayEnd = $tokens[$assign]['bracket_closer']; - } - - if ($tokens[$assign]['code'] === T_ARRAY - && isset($tokens[$assign]['parenthesis_opener']) === true - && isset($tokens[$tokens[$assign]['parenthesis_opener']]['parenthesis_closer']) === true - ) { - $arrayEnd = $tokens[$tokens[$assign]['parenthesis_opener']]['parenthesis_closer']; - } - - if (isset(Tokens::$emptyTokens[$tokens[$assign]['code']]) === false) { - $lastCode = $assign; - - if ($tokens[$assign]['code'] === T_SEMICOLON) { - if ($tokens[$assign]['conditions'] === $tokens[$stackPtr]['conditions']) { - if ($lastSemi !== null && $prevAssign !== null && $lastSemi > $prevAssign) { - // This statement did not have an assignment operator in it. - break; - } else { - $lastSemi = $assign; - } - } else if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) { - // Statement is in a different context, so the block is over. - break; - } - } - }//end if - - continue; - } else if ($assign !== $stackPtr && $tokens[$assign]['line'] === $lastLine) { - // Skip multiple assignments on the same line. We only need to - // try and align the first assignment. - continue; - }//end if - - if ($assign !== $stackPtr) { - if ($tokens[$assign]['level'] > $tokens[$stackPtr]['level']) { - // Has to be nested inside the same conditions as the first assignment. - // We've gone one level down, so process this new block. - $assign = $this->checkAlignment($phpcsFile, $assign); - $lastCode = $assign; - continue; - } else if ($tokens[$assign]['level'] < $tokens[$stackPtr]['level']) { - // We've gone one level up, so the block we are processing is done. - break; - } else if ($arrayEnd !== null) { - // Assignments inside arrays are not part of - // the original block, so process this new block. - $assign = ($this->checkAlignment($phpcsFile, $assign, $arrayEnd) - 1); - $arrayEnd = null; - $lastCode = $assign; - continue; - } - - // Make sure it is not assigned inside a condition (eg. IF, FOR). - if (isset($tokens[$assign]['nested_parenthesis']) === true) { - // If the parenthesis is on the same line as the assignment, - // then it should be ignored as it is specifically being grouped. - $parens = $tokens[$assign]['nested_parenthesis']; - $lastParen = array_pop($parens); - if ($tokens[$lastParen]['line'] === $tokens[$assign]['line']) { - break; - } - - foreach ($tokens[$assign]['nested_parenthesis'] as $start => $end) { - if (isset($tokens[$start]['parenthesis_owner']) === true) { - break(2); - } - } - } - }//end if - - $var = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($assign - 1), - null, - true - ); - - // Make sure we wouldn't break our max padding length if we - // aligned with this statement, or they wouldn't break the max - // padding length if they aligned with us. - $varEnd = $tokens[($var + 1)]['column']; - $assignLen = $tokens[$assign]['length']; - if ($this->alignAtEnd !== true) { - $assignLen = 1; - } - - if ($assign !== $stackPtr) { - if ($prevAssign === null) { - // Processing an inner block but no assignments found. - break; - } - - if (($varEnd + 1) > $assignments[$prevAssign]['assign_col']) { - $padding = 1; - $assignColumn = ($varEnd + 1); - } else { - $padding = ($assignments[$prevAssign]['assign_col'] - $varEnd + $assignments[$prevAssign]['assign_len'] - $assignLen); - if ($padding <= 0) { - $padding = 1; - } - - if ($padding > $this->maxPadding) { - $stopped = $assign; - break; - } - - $assignColumn = ($varEnd + $padding); - }//end if - - if (($assignColumn + $assignLen) > ($assignments[$maxPadding]['assign_col'] + $assignments[$maxPadding]['assign_len'])) { - $newPadding = ($varEnd - $assignments[$maxPadding]['var_end'] + $assignLen - $assignments[$maxPadding]['assign_len'] + 1); - if ($newPadding > $this->maxPadding) { - $stopped = $assign; - break; - } else { - // New alignment settings for previous assignments. - foreach ($assignments as $i => $data) { - if ($i === $assign) { - break; - } - - $newPadding = ($varEnd - $data['var_end'] + $assignLen - $data['assign_len'] + 1); - $assignments[$i]['expected'] = $newPadding; - $assignments[$i]['assign_col'] = ($data['var_end'] + $newPadding); - } - - $padding = 1; - $assignColumn = ($varEnd + 1); - } - } else if ($padding > $assignments[$maxPadding]['expected']) { - $maxPadding = $assign; - }//end if - } else { - $padding = 1; - $assignColumn = ($varEnd + 1); - $maxPadding = $assign; - }//end if - - $found = 0; - if ($tokens[($var + 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($var + 1)]['length']; - if ($found === 0) { - // This means a newline was found. - $found = 1; - } - } - - $assignments[$assign] = [ - 'var_end' => $varEnd, - 'assign_len' => $assignLen, - 'assign_col' => $assignColumn, - 'expected' => $padding, - 'found' => $found, - ]; - - $lastLine = $tokens[$assign]['line']; - $prevAssign = $assign; - }//end for - - if (empty($assignments) === true) { - return $stackPtr; - } - - $numAssignments = count($assignments); - - $errorGenerated = false; - foreach ($assignments as $assignment => $data) { - if ($data['found'] === $data['expected']) { - continue; - } - - $expectedText = $data['expected'].' space'; - if ($data['expected'] !== 1) { - $expectedText .= 's'; - } - - if ($data['found'] === null) { - $foundText = 'a new line'; - } else { - $foundText = $data['found'].' space'; - if ($data['found'] !== 1) { - $foundText .= 's'; - } - } - - if ($numAssignments === 1) { - $type = 'Incorrect'; - $error = 'Equals sign not aligned correctly; expected %s but found %s'; - } else { - $type = 'NotSame'; - $error = 'Equals sign not aligned with surrounding assignments; expected %s but found %s'; - } - - $errorData = [ - $expectedText, - $foundText, - ]; - - if ($this->error === true) { - $fix = $phpcsFile->addFixableError($error, $assignment, $type, $errorData); - } else { - $fix = $phpcsFile->addFixableWarning($error, $assignment, $type.'Warning', $errorData); - } - - $errorGenerated = true; - - if ($fix === true && $data['found'] !== null) { - $newContent = str_repeat(' ', $data['expected']); - if ($data['found'] === 0) { - $phpcsFile->fixer->addContentBefore($assignment, $newContent); - } else { - $phpcsFile->fixer->replaceToken(($assignment - 1), $newContent); - } - } - }//end foreach - - if ($numAssignments > 1) { - if ($errorGenerated === true) { - $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'yes'); - } - } - - if ($stopped !== null) { - return $this->checkAlignment($phpcsFile, $stopped); - } else { - return $assign; - } - - }//end checkAlignment() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php deleted file mode 100644 index f7644df0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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. - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class NoSpaceAfterCastSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - return; - } - - $error = 'A cast statement must not be followed by a space'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceFound'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php deleted file mode 100644 index d831ea7d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php +++ /dev/null @@ -1,161 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SpaceAfterCastSniff implements Sniff -{ - - /** - * The number of spaces desired after a cast token. - * - * @var integer - */ - public $spacing = 1; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $this->spacing = (int) $this->spacing; - $pluralizeSpace = 's'; - if ($this->spacing === 1) { - $pluralizeSpace = ''; - } - - if ($tokens[$stackPtr]['code'] === T_BINARY_CAST - && $tokens[$stackPtr]['content'] === 'b' - ) { - // You can't replace a space after this type of binary casting. - return; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - if ($this->ignoreNewlines === true - && $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line'] - ) { - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', 'newline'); - return; - } - - if ($this->spacing === 0 && $nextNonEmpty === ($stackPtr + 1)) { - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', 0); - return; - } - - $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, - $pluralizeSpace, - ]; - $phpcsFile->addError($error, $stackPtr, 'CommentFound', $data); - - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', $tokens[($stackPtr + 1)]['length']); - } else { - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', 0); - } - - return; - } - - $found = 0; - if ($tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) { - $found = 'newline'; - } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($stackPtr + 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing after cast statement', $found); - - if ($found === $this->spacing) { - return; - } - - $error = 'Expected %s space%s after cast statement; %s found'; - $data = [ - $this->spacing, - $pluralizeSpace, - $found, - ]; - - $errorCode = 'TooMuchSpace'; - if ($this->spacing !== 0) { - if ($found === 0) { - $errorCode = 'NoSpace'; - } else if ($found !== 'newline' && $found < $this->spacing) { - $errorCode = 'TooLittleSpace'; - } - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); - - if ($fix === true) { - $padding = str_repeat(' ', $this->spacing); - if ($found === 0) { - $phpcsFile->fixer->addContent($stackPtr, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - $start = ($stackPtr + 1); - - if ($this->spacing > 0) { - $phpcsFile->fixer->replaceToken($start, $padding); - ++$start; - } - - for ($i = $start; $i < $nextNonWhitespace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php deleted file mode 100644 index a1a6d093..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php +++ /dev/null @@ -1,143 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SpaceAfterNotSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces desired after the NOT operator. - * - * @var integer - */ - public $spacing = 1; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_BOOLEAN_NOT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $this->spacing = (int) $this->spacing; - $pluralizeSpace = 's'; - if ($this->spacing === 1) { - $pluralizeSpace = ''; - } - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - if ($this->ignoreNewlines === true - && $tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line'] - ) { - return; - } - - if ($this->spacing === 0 && $nextNonEmpty === ($stackPtr + 1)) { - return; - } - - $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, - $pluralizeSpace, - ]; - $phpcsFile->addError($error, $stackPtr, 'CommentFound', $data); - return; - } - - $found = 0; - if ($tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) { - $found = 'newline'; - } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($stackPtr + 1)]['length']; - } - - if ($found === $this->spacing) { - return; - } - - $error = 'Expected %s space%s after NOT operator; %s found'; - $data = [ - $this->spacing, - $pluralizeSpace, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->spacing); - if ($found === 0) { - $phpcsFile->fixer->addContent($stackPtr, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - $start = ($stackPtr + 1); - - if ($this->spacing > 0) { - $phpcsFile->fixer->replaceToken($start, $padding); - ++$start; - } - - for ($i = $start; $i < $nextNonWhitespace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php deleted file mode 100644 index 96082e3f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SpaceBeforeCastSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if ($tokens[$stackPtr]['column'] === 1) { - return; - } - - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'A cast statement must be preceded by a single space'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpace'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing before cast statement', 0); - return; - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing before cast statement', $tokens[($stackPtr - 1)]['length']); - - if ($tokens[($stackPtr - 1)]['column'] !== 1 && $tokens[($stackPtr - 1)]['length'] !== 1) { - $error = 'A cast statement must be preceded by a single space'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpace'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php deleted file mode 100644 index 76c4a630..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php +++ /dev/null @@ -1,141 +0,0 @@ - - * @copyright 2009-2014 Florian Grandel - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class CallTimePassByReferenceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_STRING, - T_VARIABLE, - T_ANON_CLASS, - T_PARENT, - T_SELF, - T_STATIC, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $findTokens = Tokens::$emptyTokens; - $findTokens[] = T_BITWISE_AND; - - $prev = $phpcsFile->findPrevious($findTokens, ($stackPtr - 1), null, true); - - // Skip tokens that are the names of functions - // within their definitions. For example: function myFunction... - // "myFunction" is T_STRING but we should skip because it is not a - // function or method *call*. - $prevCode = $tokens[$prev]['code']; - if ($prevCode === T_FUNCTION) { - return; - } - - // If the next non-whitespace token after the function or method call - // is not an opening parenthesis then it cant really be a *call*. - $functionName = $stackPtr; - $openBracket = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($functionName + 1), - null, - true - ); - - if ($openBracket === false || $tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { - return; - } - - if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { - return; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - $nextSeparator = $openBracket; - $find = [ - T_VARIABLE, - T_OPEN_SHORT_ARRAY, - ]; - - while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { - if ($tokens[$nextSeparator]['code'] === T_OPEN_SHORT_ARRAY) { - $nextSeparator = $tokens[$nextSeparator]['bracket_closer']; - continue; - } - - // Make sure the variable belongs directly to this function call - // and is not inside a nested function call or array. - $brackets = $tokens[$nextSeparator]['nested_parenthesis']; - $lastBracket = array_pop($brackets); - if ($lastBracket !== $closeBracket) { - continue; - } - - $tokenBefore = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($nextSeparator - 1), - null, - true - ); - - if ($tokens[$tokenBefore]['code'] === T_BITWISE_AND) { - if ($phpcsFile->isReference($tokenBefore) === false) { - continue; - } - - // We also want to ignore references used in assignment - // operations passed as function arguments, but isReference() - // sees them as valid references (which they are). - $tokenBefore = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($tokenBefore - 1), - null, - true - ); - - if (isset(Tokens::$assignmentTokens[$tokens[$tokenBefore]['code']]) === true) { - continue; - } - - // T_BITWISE_AND represents a pass-by-reference. - $error = 'Call-time pass-by-reference calls are prohibited'; - $phpcsFile->addError($error, $tokenBefore, 'NotAllowed'); - }//end if - }//end while - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php deleted file mode 100644 index bf93c553..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php +++ /dev/null @@ -1,197 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionCallArgumentSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return[ - T_STRING, - T_ISSET, - T_UNSET, - T_SELF, - T_STATIC, - T_PARENT, - T_VARIABLE, - T_CLOSE_CURLY_BRACKET, - T_CLOSE_PARENTHESIS, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Skip tokens that are the names of functions or classes - // within their definitions. For example: - // function myFunction... - // "myFunction" is T_STRING but we should skip because it is not a - // function or method *call*. - $functionName = $stackPtr; - $ignoreTokens = Tokens::$emptyTokens; - $ignoreTokens[] = T_BITWISE_AND; - $functionKeyword = $phpcsFile->findPrevious($ignoreTokens, ($stackPtr - 1), null, true); - if ($tokens[$functionKeyword]['code'] === T_FUNCTION || $tokens[$functionKeyword]['code'] === T_CLASS) { - return; - } - - if ($tokens[$stackPtr]['code'] === T_CLOSE_CURLY_BRACKET - && isset($tokens[$stackPtr]['scope_condition']) === true - ) { - // Not a function call. - return; - } - - // If the next non-whitespace token after the function or method call - // is not an opening parenthesis then it can't really be a *call*. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($functionName + 1), null, true); - if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { - return; - } - - if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { - return; - } - - $this->checkSpacing($phpcsFile, $stackPtr, $openBracket); - - }//end process() - - - /** - * Checks the spacing around commas. - * - * @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 $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * - * @return void - */ - public function checkSpacing(File $phpcsFile, $stackPtr, $openBracket) - { - $tokens = $phpcsFile->getTokens(); - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - $nextSeparator = $openBracket; - - $find = [ - T_COMMA, - T_CLOSURE, - T_FN, - T_ANON_CLASS, - T_OPEN_SHORT_ARRAY, - T_MATCH, - ]; - - while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { - if ($tokens[$nextSeparator]['code'] === T_CLOSURE - || $tokens[$nextSeparator]['code'] === T_ANON_CLASS - || $tokens[$nextSeparator]['code'] === T_MATCH - ) { - // Skip closures, anon class declarations and match control structures. - $nextSeparator = $tokens[$nextSeparator]['scope_closer']; - continue; - } else if ($tokens[$nextSeparator]['code'] === T_FN) { - // Skip arrow functions, but don't skip the arrow function closer as it is likely to - // be the comma separating it from the next function call argument (or the parenthesis closer). - $nextSeparator = ($tokens[$nextSeparator]['scope_closer'] - 1); - continue; - } else if ($tokens[$nextSeparator]['code'] === T_OPEN_SHORT_ARRAY) { - // Skips arrays using short notation. - $nextSeparator = $tokens[$nextSeparator]['bracket_closer']; - continue; - } - - // Make sure the comma or variable belongs directly to this function call, - // and is not inside a nested function call or array. - $brackets = $tokens[$nextSeparator]['nested_parenthesis']; - $lastBracket = array_pop($brackets); - if ($lastBracket !== $closeBracket) { - continue; - } - - if ($tokens[$nextSeparator]['code'] === T_COMMA) { - if ($tokens[($nextSeparator - 1)]['code'] === T_WHITESPACE) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextSeparator - 2), null, true); - if (isset(Tokens::$heredocTokens[$tokens[$prev]['code']]) === false) { - $error = 'Space found before comma in argument list'; - $fix = $phpcsFile->addFixableError($error, $nextSeparator, 'SpaceBeforeComma'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - if ($tokens[$prev]['line'] !== $tokens[$nextSeparator]['line']) { - $phpcsFile->fixer->addContent($prev, ','); - $phpcsFile->fixer->replaceToken($nextSeparator, ''); - } else { - $phpcsFile->fixer->replaceToken(($nextSeparator - 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - if ($tokens[($nextSeparator + 1)]['code'] !== T_WHITESPACE) { - // 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 - // each argument on a newline, which is valid, so ignore it. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextSeparator + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$nextSeparator]['line']) { - $space = $tokens[($nextSeparator + 1)]['length']; - if ($space > 1) { - $error = 'Expected 1 space after comma in argument list; %s found'; - $data = [$space]; - $fix = $phpcsFile->addFixableError($error, $nextSeparator, 'TooMuchSpaceAfterComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextSeparator + 1), ' '); - } - } - } - }//end if - }//end if - }//end while - - }//end checkSpacing() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php deleted file mode 100644 index be96f585..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php +++ /dev/null @@ -1,225 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OpeningFunctionBraceBsdAllmanSniff implements Sniff -{ - - /** - * Should this sniff check function braces? - * - * @var boolean - */ - public $checkFunctions = true; - - /** - * Should this sniff check closure braces? - * - * @var boolean - */ - public $checkClosures = false; - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - if (($tokens[$stackPtr]['code'] === T_FUNCTION - && (bool) $this->checkFunctions === false) - || ($tokens[$stackPtr]['code'] === T_CLOSURE - && (bool) $this->checkClosures === false) - ) { - return; - } - - $openingBrace = $tokens[$stackPtr]['scope_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - } - } - - // Find the end of the function declaration. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); - - $functionLine = $tokens[$prev]['line']; - $braceLine = $tokens[$openingBrace]['line']; - - $lineDifference = ($braceLine - $functionLine); - - $metricType = 'Function'; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $metricType = 'Closure'; - } - - if ($lineDifference === 0) { - $error = 'Opening brace should be on a new line'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnSameLine'); - if ($fix === true) { - $hasTrailingAnnotation = false; - for ($nextLine = ($openingBrace + 1); $nextLine < $phpcsFile->numTokens; $nextLine++) { - if ($tokens[$openingBrace]['line'] !== $tokens[$nextLine]['line']) { - break; - } - - if (isset(Tokens::$phpcsCommentTokens[$tokens[$nextLine]['code']]) === true) { - $hasTrailingAnnotation = true; - } - } - - $phpcsFile->fixer->beginChangeset(); - $indent = $phpcsFile->findFirstOnLine([], $openingBrace); - - if ($hasTrailingAnnotation === false || $nextLine === false) { - if ($tokens[$indent]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->addContentBefore($openingBrace, $tokens[$indent]['content']); - } - - if ($tokens[($openingBrace - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($openingBrace - 1), ''); - } - - $phpcsFile->fixer->addNewlineBefore($openingBrace); - } else { - $phpcsFile->fixer->replaceToken($openingBrace, ''); - $phpcsFile->fixer->addNewlineBefore($nextLine); - $phpcsFile->fixer->addContentBefore($nextLine, '{'); - - if ($tokens[$indent]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->addContentBefore($nextLine, $tokens[$indent]['content']); - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - - $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'same line'); - } else if ($lineDifference > 1) { - $error = 'Opening brace should be on the line after the declaration; found %s blank line(s)'; - $data = [($lineDifference - 1)]; - - $prevNonWs = $phpcsFile->findPrevious(T_WHITESPACE, ($openingBrace - 1), $closeBracket, true); - if ($prevNonWs !== $prev) { - // There must be a comment between the end of the function declaration and the open brace. - // Report, but don't fix. - $phpcsFile->addError($error, $openingBrace, 'BraceSpacing', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceSpacing', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = $openingBrace; $i > $prev; $i--) { - if ($tokens[$i]['line'] === $tokens[$openingBrace]['line']) { - if ($tokens[$i]['column'] === 1) { - $phpcsFile->fixer->addNewLineBefore($i); - } - - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - $ignore = Tokens::$phpcsCommentTokens; - $ignore[] = T_WHITESPACE; - $next = $phpcsFile->findNext($ignore, ($openingBrace + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { - // 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); - } - } - } - - // Only continue checking if the opening brace looks good. - if ($lineDifference !== 1) { - return; - } - - // We need to actually find the first piece of content on this line, - // as if this is a method with tokens before it (public, static etc) - // or an if with an else before it, then we need to start the scope - // checking from there, rather than the current token. - $lineStart = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - - // The opening brace is on the correct line, now it needs to be - // checked to be correctly indented. - $startColumn = $tokens[$lineStart]['column']; - $braceIndent = $tokens[$openingBrace]['column']; - - if ($braceIndent !== $startColumn) { - $expected = ($startColumn - 1); - $found = ($braceIndent - 1); - - $error = 'Opening brace indented incorrectly; expected %s spaces, found %s'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceIndent', $data); - if ($fix === true) { - $indent = str_repeat(' ', $expected); - if ($found === 0) { - $phpcsFile->fixer->addContentBefore($openingBrace, $indent); - } else { - $phpcsFile->fixer->replaceToken(($openingBrace - 1), $indent); - } - } - }//end if - - $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'new line'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php deleted file mode 100644 index ca259854..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php +++ /dev/null @@ -1,182 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OpeningFunctionBraceKernighanRitchieSniff implements Sniff -{ - - /** - * Should this sniff check function braces? - * - * @var boolean - */ - public $checkFunctions = true; - - /** - * Should this sniff check closure braces? - * - * @var boolean - */ - public $checkClosures = false; - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - if (($tokens[$stackPtr]['code'] === T_FUNCTION - && (bool) $this->checkFunctions === false) - || ($tokens[$stackPtr]['code'] === T_CLOSURE - && (bool) $this->checkClosures === false) - ) { - return; - } - - $openingBrace = $tokens[$stackPtr]['scope_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - } - } - - // Find the end of the function declaration. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); - - $functionLine = $tokens[$prev]['line']; - $braceLine = $tokens[$openingBrace]['line']; - - $lineDifference = ($braceLine - $functionLine); - - $metricType = 'Function'; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $metricType = 'Closure'; - } - - if ($lineDifference > 0) { - $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'new line'); - $error = 'Opening brace should be on the same line as the declaration'; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnNewLine'); - if ($fix === true) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($prev, ' {'); - $phpcsFile->fixer->replaceToken($openingBrace, ''); - if ($tokens[($openingBrace + 1)]['code'] === T_WHITESPACE - && $tokens[($openingBrace + 2)]['line'] > $tokens[$openingBrace]['line'] - ) { - // Brace is followed by a new line, so remove it to ensure we don't - // leave behind a blank line at the top of the block. - $phpcsFile->fixer->replaceToken(($openingBrace + 1), ''); - - if ($tokens[($openingBrace - 1)]['code'] === T_WHITESPACE - && $tokens[($openingBrace - 1)]['line'] === $tokens[$openingBrace]['line'] - && $tokens[($openingBrace - 2)]['line'] < $tokens[$openingBrace]['line'] - ) { - // Brace is preceded by indent, so remove it to ensure we don't - // leave behind more indent than is required for the first line. - $phpcsFile->fixer->replaceToken(($openingBrace - 1), ''); - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - } else { - $phpcsFile->recordMetric($stackPtr, "$metricType opening brace placement", 'same line'); - }//end if - - $ignore = Tokens::$phpcsCommentTokens; - $ignore[] = T_WHITESPACE; - $next = $phpcsFile->findNext($ignore, ($openingBrace + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openingBrace]['line']) { - // Only throw this error when this is not an empty function. - if ($next !== $tokens[$stackPtr]['scope_closer'] - && $tokens[$next]['code'] !== T_CLOSE_TAG - ) { - $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 continue checking if the opening brace looks good. - if ($lineDifference > 0) { - return; - } - - // We are looking for tabs, even if they have been replaced, because - // we enforce a space here. - if (isset($tokens[($openingBrace - 1)]['orig_content']) === true) { - $spacing = $tokens[($openingBrace - 1)]['orig_content']; - } else { - $spacing = $tokens[($openingBrace - 1)]['content']; - } - - if ($tokens[($openingBrace - 1)]['code'] !== T_WHITESPACE) { - $length = 0; - } else if ($spacing === "\t") { - $length = '\t'; - } else { - $length = strlen($spacing); - } - - if ($length !== 1) { - $error = 'Expected 1 space before opening brace; found %s'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $openingBrace, 'SpaceBeforeBrace', $data); - if ($fix === true) { - if ($length === 0 || $length === '\t') { - $phpcsFile->fixer->addContentBefore($openingBrace, ' '); - } else { - $phpcsFile->fixer->replaceToken(($openingBrace - 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php deleted file mode 100644 index 8cba81da..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2007-2014 Mayflower GmbH - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class CyclomaticComplexitySniff implements Sniff -{ - - /** - * A complexity higher than this value will throw a warning. - * - * @var integer - */ - public $complexity = 10; - - /** - * A complexity higher than this value will throw an error. - * - * @var integer - */ - public $absoluteComplexity = 20; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Ignore abstract methods. - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - // Detect start and end of this function definition. - $start = $tokens[$stackPtr]['scope_opener']; - $end = $tokens[$stackPtr]['scope_closer']; - - // Predicate nodes for PHP. - $find = [ - T_CASE => true, - T_DEFAULT => true, - T_CATCH => true, - T_IF => true, - T_FOR => true, - T_FOREACH => true, - T_WHILE => true, - T_ELSEIF => true, - T_INLINE_THEN => true, - T_COALESCE => true, - T_COALESCE_EQUAL => true, - T_MATCH_ARROW => true, - T_NULLSAFE_OBJECT_OPERATOR => true, - ]; - - $complexity = 1; - - // Iterate from start to end and count predicate nodes. - for ($i = ($start + 1); $i < $end; $i++) { - if (isset($find[$tokens[$i]['code']]) === true) { - $complexity++; - } - } - - if ($complexity > $this->absoluteComplexity) { - $error = 'Function\'s cyclomatic complexity (%s) exceeds allowed maximum of %s'; - $data = [ - $complexity, - $this->absoluteComplexity, - ]; - $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); - } else if ($complexity > $this->complexity) { - $warning = 'Function\'s cyclomatic complexity (%s) exceeds %s; consider refactoring the function'; - $data = [ - $complexity, - $this->complexity, - ]; - $phpcsFile->addWarning($warning, $stackPtr, 'TooHigh', $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php deleted file mode 100644 index 3c086c7f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php +++ /dev/null @@ -1,100 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2007-2014 Mayflower GmbH - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class NestingLevelSniff implements Sniff -{ - - /** - * A nesting level higher than this value will throw a warning. - * - * @var integer - */ - public $nestingLevel = 5; - - /** - * A nesting level higher than this value will throw an error. - * - * @var integer - */ - public $absoluteNestingLevel = 10; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Ignore abstract methods. - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - // Detect start and end of this function definition. - $start = $tokens[$stackPtr]['scope_opener']; - $end = $tokens[$stackPtr]['scope_closer']; - - $nestingLevel = 0; - - // Find the maximum nesting level of any token in the function. - for ($i = ($start + 1); $i < $end; $i++) { - $level = $tokens[$i]['level']; - if ($nestingLevel < $level) { - $nestingLevel = $level; - } - } - - // We subtract the nesting level of the function itself. - $nestingLevel = ($nestingLevel - $tokens[$stackPtr]['level'] - 1); - - if ($nestingLevel > $this->absoluteNestingLevel) { - $error = 'Function\'s nesting level (%s) exceeds allowed maximum of %s'; - $data = [ - $nestingLevel, - $this->absoluteNestingLevel, - ]; - $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); - } else if ($nestingLevel > $this->nestingLevel) { - $warning = 'Function\'s nesting level (%s) exceeds %s; consider refactoring the function'; - $data = [ - $nestingLevel, - $this->nestingLevel, - ]; - $phpcsFile->addWarning($warning, $stackPtr, 'TooHigh', $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php deleted file mode 100644 index 145dddf7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class AbstractClassNamePrefixSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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) - { - if ($phpcsFile->getClassProperties($stackPtr)['is_abstract'] === false) { - // This class is not abstract so we don't need to check it. - return; - } - - $className = $phpcsFile->getDeclarationName($stackPtr); - if ($className === null) { - // We are not interested in anonymous classes. - return; - } - - $prefix = substr($className, 0, 8); - if (strtolower($prefix) !== 'abstract') { - $phpcsFile->addError('Abstract class names must be prefixed with "Abstract"; found "%s"', $stackPtr, 'Missing', [$className]); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php deleted file mode 100644 index ec1cfd00..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php +++ /dev/null @@ -1,223 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Tokens; - -class CamelCapsFunctionNameSniff extends AbstractScopeSniff -{ - - /** - * A list of all PHP magic methods. - * - * @var array - */ - protected $magicMethods = [ - 'construct' => true, - 'destruct' => true, - 'call' => true, - 'callstatic' => true, - 'get' => true, - 'set' => true, - 'isset' => true, - 'unset' => true, - 'sleep' => true, - 'wakeup' => true, - 'serialize' => true, - 'unserialize' => true, - 'tostring' => true, - 'invoke' => true, - 'set_state' => true, - 'clone' => true, - 'debuginfo' => true, - ]; - - /** - * A list of all PHP non-magic methods starting with a double underscore. - * - * These come from PHP modules such as SOAPClient. - * - * @var array - */ - protected $methodsDoubleUnderscore = [ - 'dorequest' => true, - 'getcookies' => true, - 'getfunctions' => true, - 'getlastrequest' => true, - 'getlastrequestheaders' => true, - 'getlastresponse' => true, - 'getlastresponseheaders' => true, - 'gettypes' => true, - 'setcookie' => true, - 'setlocation' => true, - 'setsoapheaders' => true, - 'soapcall' => true, - ]; - - /** - * A list of all PHP magic functions. - * - * @var array - */ - protected $magicFunctions = ['autoload' => true]; - - /** - * If TRUE, the string must not have two capital letters next to each other. - * - * @var boolean - */ - public $strict = true; - - - /** - * Constructs a Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff. - */ - public function __construct() - { - parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION], true); - - }//end __construct() - - - /** - * Processes the tokens within the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * @param int $currScope The position of the current scope. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - $className = $phpcsFile->getDeclarationName($currScope); - if (isset($className) === false) { - $className = '[Anonymous Class]'; - } - - $errorData = [$className.'::'.$methodName]; - - $methodNameLc = strtolower($methodName); - $classNameLc = strtolower($className); - - // Is this a magic method. i.e., is prefixed with "__" ? - if (preg_match('|^__[^_]|', $methodName) !== 0) { - $magicPart = substr($methodNameLc, 2); - if (isset($this->magicMethods[$magicPart]) === true - || isset($this->methodsDoubleUnderscore[$magicPart]) === true - ) { - return; - } - - $error = 'Method name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'MethodDoubleUnderscore', $errorData); - } - - // PHP4 constructors are allowed to break our rules. - if ($methodNameLc === $classNameLc) { - return; - } - - // PHP4 destructors are allowed to break our rules. - if ($methodNameLc === '_'.$classNameLc) { - return; - } - - // Ignore first underscore in methods prefixed with "_". - $methodName = ltrim($methodName, '_'); - - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - if (Common::isCamelCaps($methodName, false, true, $this->strict) === false) { - if ($methodProps['scope_specified'] === true) { - $error = '%s method name "%s" is not in camel caps format'; - $data = [ - ucfirst($methodProps['scope']), - $errorData[0], - ]; - $phpcsFile->addError($error, $stackPtr, 'ScopeNotCamelCaps', $data); - } else { - $error = 'Method name "%s" is not in camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - } - - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'no'); - return; - } else { - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); - } - - }//end processTokenWithinScope() - - - /** - * Processes the tokens outside the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if ($functionName === null) { - // Ignore closures. - return; - } - - $errorData = [$functionName]; - - // Is this a magic function. i.e., it is prefixed with "__". - if (preg_match('|^__[^_]|', $functionName) !== 0) { - $magicPart = strtolower(substr($functionName, 2)); - if (isset($this->magicFunctions[$magicPart]) === true) { - return; - } - - $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'FunctionDoubleUnderscore', $errorData); - } - - // Ignore first underscore in functions prefixed with "_". - $functionName = ltrim($functionName, '_'); - - if (Common::isCamelCaps($functionName, false, true, $this->strict) === false) { - $error = 'Function name "%s" is not in camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - $phpcsFile->recordMetric($stackPtr, 'CamelCase function name', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); - } - - }//end processTokenOutsideScope() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php deleted file mode 100644 index 75fbd226..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php +++ /dev/null @@ -1,163 +0,0 @@ - - * @author Leif Wickland - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; - -class ConstructorNameSniff extends AbstractScopeSniff -{ - - /** - * The name of the class we are currently checking. - * - * @var string - */ - private $currentClass = ''; - - /** - * A list of functions in the current class. - * - * @var string[] - */ - private $functionList = []; - - - /** - * Constructs the test with the tokens it wishes to listen for. - */ - public function __construct() - { - parent::__construct([T_CLASS, T_ANON_CLASS], [T_FUNCTION], true); - - }//end __construct() - - - /** - * Processes this test when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $currScope A pointer to the start of the scope. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $className = $phpcsFile->getDeclarationName($currScope); - if (empty($className) === false) { - // Not an anonymous class. - $className = strtolower($className); - } - - if ($className !== $this->currentClass) { - $this->loadFunctionNamesInScope($phpcsFile, $currScope); - $this->currentClass = $className; - } - - $methodName = strtolower($phpcsFile->getDeclarationName($stackPtr)); - - if ($methodName === $className) { - if (in_array('__construct', $this->functionList, true) === false) { - $error = 'PHP4 style constructors are not allowed; use "__construct()" instead'; - $phpcsFile->addError($error, $stackPtr, 'OldStyle'); - } - } else if ($methodName !== '__construct') { - // Not a constructor. - return; - } - - // Stop if the constructor doesn't have a body, like when it is abstract. - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $parentClassName = strtolower($phpcsFile->findExtendedClassName($currScope)); - if ($parentClassName === false) { - return; - } - - $endFunctionIndex = $tokens[$stackPtr]['scope_closer']; - $startIndex = $stackPtr; - while (($doubleColonIndex = $phpcsFile->findNext(T_DOUBLE_COLON, $startIndex, $endFunctionIndex)) !== false) { - if ($tokens[($doubleColonIndex + 1)]['code'] === T_STRING - && strtolower($tokens[($doubleColonIndex + 1)]['content']) === $parentClassName - ) { - $error = 'PHP4 style calls to parent constructors are not allowed; use "parent::__construct()" instead'; - $phpcsFile->addError($error, ($doubleColonIndex + 1), 'OldStyleCall'); - } - - $startIndex = ($doubleColonIndex + 1); - } - - }//end processTokenWithinScope() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - - /** - * Extracts all the function names found in the given scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. - * @param int $currScope A pointer to the start of the scope. - * - * @return void - */ - protected function loadFunctionNamesInScope(File $phpcsFile, $currScope) - { - $this->functionList = []; - $tokens = $phpcsFile->getTokens(); - - for ($i = ($tokens[$currScope]['scope_opener'] + 1); $i < $tokens[$currScope]['scope_closer']; $i++) { - if ($tokens[$i]['code'] !== T_FUNCTION) { - continue; - } - - $this->functionList[] = trim(strtolower($phpcsFile->getDeclarationName($i))); - - if (isset($tokens[$i]['scope_closer']) !== false) { - // Skip past nested functions and such. - $i = $tokens[$i]['scope_closer']; - } - } - - }//end loadFunctionNamesInScope() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php deleted file mode 100644 index 637e036f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class InterfaceNameSuffixSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INTERFACE]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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) - { - $interfaceName = $phpcsFile->getDeclarationName($stackPtr); - if ($interfaceName === null) { - return; - } - - $suffix = substr($interfaceName, -9); - if (strtolower($suffix) !== 'interface') { - $phpcsFile->addError('Interface names must be suffixed with "Interface"; found "%s"', $stackPtr, 'Missing', [$interfaceName]); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php deleted file mode 100644 index cbd9651d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class TraitNameSuffixSniff implements Sniff -{ - - - /** - * Registers the tokens that this sniff wants to listen for. - * - * @return array - */ - public function register() - { - return [T_TRAIT]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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) - { - $traitName = $phpcsFile->getDeclarationName($stackPtr); - if ($traitName === null) { - return; - } - - $suffix = substr($traitName, -5); - if (strtolower($suffix) !== 'trait') { - $phpcsFile->addError('Trait names must be suffixed with "Trait"; found "%s"', $stackPtr, 'Missing', [$traitName]); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php deleted file mode 100644 index f62cfe94..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php +++ /dev/null @@ -1,149 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UpperCaseConstantNameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_STRING, - T_CONST, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if ($tokens[$stackPtr]['code'] === T_CONST) { - // This is a constant declared with the "const" keyword. - // This may be an OO constant, in which case it could be typed, so we need to - // jump over a potential type to get to the name. - $assignmentOperator = $phpcsFile->findNext([T_EQUAL, T_SEMICOLON], ($stackPtr + 1)); - if ($assignmentOperator === false || $tokens[$assignmentOperator]['code'] !== T_EQUAL) { - // Parse error/live coding. Nothing to do. Rest of loop is moot. - return; - } - - $constant = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($assignmentOperator - 1), ($stackPtr + 1), true); - if ($constant === false) { - return; - } - - $constName = $tokens[$constant]['content']; - - if (strtoupper($constName) !== $constName) { - if (strtolower($constName) === $constName) { - $phpcsFile->recordMetric($constant, 'Constant name case', 'lower'); - } else { - $phpcsFile->recordMetric($constant, 'Constant name case', 'mixed'); - } - - $error = 'Class constants must be uppercase; expected %s but found %s'; - $data = [ - strtoupper($constName), - $constName, - ]; - $phpcsFile->addError($error, $constant, 'ClassConstantNotUpperCase', $data); - } else { - $phpcsFile->recordMetric($constant, 'Constant name case', 'upper'); - } - - return; - }//end if - - // Only interested in define statements now. - if (strtolower($tokens[$stackPtr]['content']) !== 'define') { - return; - } - - // Make sure this is not a method call. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR - || $tokens[$prev]['code'] === T_DOUBLE_COLON - || $tokens[$prev]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - return; - } - - // If the next non-whitespace token after this token - // is not an opening parenthesis then it is not a function call. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($openBracket === false) { - return; - } - - // The next non-whitespace token must be the constant name. - $constPtr = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), null, true); - if ($tokens[$constPtr]['code'] !== T_CONSTANT_ENCAPSED_STRING) { - return; - } - - $constName = $tokens[$constPtr]['content']; - - // Check for constants like self::CONSTANT. - $prefix = ''; - $splitPos = strpos($constName, '::'); - if ($splitPos !== false) { - $prefix = substr($constName, 0, ($splitPos + 2)); - $constName = substr($constName, ($splitPos + 2)); - } - - // Strip namespace from constant like /foo/bar/CONSTANT. - $splitPos = strrpos($constName, '\\'); - if ($splitPos !== false) { - $prefix = substr($constName, 0, ($splitPos + 1)); - $constName = substr($constName, ($splitPos + 1)); - } - - if (strtoupper($constName) !== $constName) { - if (strtolower($constName) === $constName) { - $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'lower'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'mixed'); - } - - $error = 'Constants must be uppercase; expected %s but found %s'; - $data = [ - $prefix.strtoupper($constName), - $prefix.$constName, - ]; - $phpcsFile->addError($error, $stackPtr, 'ConstantNotUpperCase', $data); - } else { - $phpcsFile->recordMetric($stackPtr, 'Constant name case', 'upper'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php deleted file mode 100644 index f3c56b58..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/BacktickOperatorSniff.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class BacktickOperatorSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_BACKTICK]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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) - { - $error = 'Use of the backtick operator is forbidden'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php deleted file mode 100644 index 61ff4f2f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2010-2014 Andy Grunwald - * @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; - -class CharacterBeforePHPOpeningTagSniff implements Sniff -{ - - /** - * List of supported BOM definitions. - * - * Use encoding names as keys and hex BOM representations as values. - * - * @var array - */ - protected $bomDefinitions = [ - 'UTF-8' => 'efbbbf', - 'UTF-16 (BE)' => 'feff', - 'UTF-16 (LE)' => 'fffe', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $expected = 0; - if ($stackPtr > 0) { - // Allow a byte-order mark. - $tokens = $phpcsFile->getTokens(); - foreach ($this->bomDefinitions as $expectedBomHex) { - $bomByteLength = (strlen($expectedBomHex) / 2); - $htmlBomHex = bin2hex(substr($tokens[0]['content'], 0, $bomByteLength)); - if ($htmlBomHex === $expectedBomHex) { - $expected++; - break; - } - } - - // Allow a shebang line. - if (substr($tokens[0]['content'], 0, 2) === '#!') { - $expected++; - } - } - - if ($stackPtr !== $expected) { - $error = 'The opening PHP tag must be the first content in the file'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - } - - // Skip the rest of the file so we don't pick up additional - // open tags, typically embedded in HTML. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php deleted file mode 100644 index 23dd2b6b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2010-2014 Stefano Kowalke - * @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; - -class ClosingPHPTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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) - { - $closeTag = $phpcsFile->findNext(T_CLOSE_TAG, $stackPtr); - if ($closeTag === false) { - $error = 'The PHP open tag does not have a corresponding PHP close tag'; - $phpcsFile->addError($error, $stackPtr, 'NotFound'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php deleted file mode 100644 index 44efd53a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; - -use ReflectionFunction; - -class DeprecatedFunctionsSniff extends ForbiddenFunctionsSniff -{ - - /** - * A list of forbidden functions with their alternatives. - * - * The value is NULL if no alternative exists. IE, the - * function should just not be used. - * - * @var array - */ - public $forbiddenFunctions = []; - - - /** - * Constructor. - * - * Uses the Reflection API to get a list of deprecated functions. - */ - public function __construct() - { - $functions = get_defined_functions(); - - foreach ($functions['internal'] as $functionName) { - $function = new ReflectionFunction($functionName); - - if ($function->isDeprecated() === true) { - $this->forbiddenFunctions[$functionName] = null; - } - } - - }//end __construct() - - - /** - * Generates the error or warning for this sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the forbidden function - * in the token array. - * @param string $function The name of the forbidden function. - * @param string $pattern The pattern used for the match. - * - * @return void - */ - protected function addError($phpcsFile, $stackPtr, $function, $pattern=null) - { - $data = [$function]; - $error = 'Function %s() has been deprecated'; - $type = 'Deprecated'; - - if ($this->error === true) { - $phpcsFile->addError($error, $stackPtr, $type, $data); - } else { - $phpcsFile->addWarning($error, $stackPtr, $type, $data); - } - - }//end addError() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php deleted file mode 100644 index a2cf1b93..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php +++ /dev/null @@ -1,253 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\PHP; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowAlternativePHPTagsSniff implements Sniff -{ - - /** - * Whether ASP tags are enabled or not. - * - * @var boolean - */ - private $aspTags = false; - - /** - * The current PHP version. - * - * @var integer|string|null - */ - private $phpVersion = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - if ($this->phpVersion === null) { - $this->phpVersion = Config::getConfigData('php_version'); - if ($this->phpVersion === null) { - $this->phpVersion = PHP_VERSION_ID; - } - } - - if ($this->phpVersion < 70000) { - $this->aspTags = (bool) ini_get('asp_tags'); - } - - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - T_INLINE_HTML, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $openTag = $tokens[$stackPtr]; - $content = $openTag['content']; - - if (trim($content) === '') { - return; - } - - if ($openTag['code'] === T_OPEN_TAG) { - if ($content === '<%') { - $error = 'ASP style opening tag used; expected "findClosingTag($phpcsFile, $tokens, $stackPtr, '%>'); - $errorCode = 'ASPOpenTagFound'; - } else if (strpos($content, ''); - $errorCode = 'ScriptOpenTagFound'; - } - - if (isset($error, $closer, $errorCode) === true) { - $data = [$content]; - - if ($closer === false) { - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); - if ($fix === true) { - $this->addChangeset($phpcsFile, $tokens, $stackPtr, $closer); - } - } - } - - return; - }//end if - - if ($openTag['code'] === T_OPEN_TAG_WITH_ECHO && $content === '<%=') { - $error = 'ASP style opening tag used with echo; expected "findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $snippet = $this->getSnippet($tokens[$nextVar]['content']); - $data = [ - $snippet, - $content, - $snippet, - ]; - - $closer = $this->findClosingTag($phpcsFile, $tokens, $stackPtr, '%>'); - - if ($closer === false) { - $phpcsFile->addError($error, $stackPtr, 'ASPShortOpenTagFound', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ASPShortOpenTagFound', $data); - if ($fix === true) { - $this->addChangeset($phpcsFile, $tokens, $stackPtr, $closer, true); - } - } - - return; - }//end if - - // Account for incorrect script open tags. - if ($openTag['code'] === T_INLINE_HTML - && preg_match('`( - - - -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed deleted file mode 100644 index 2a695c89..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.1.inc.fixed +++ /dev/null @@ -1,14 +0,0 @@ -
    - -Some content here. - - - - -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc deleted file mode 100644 index cd5a6620..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc +++ /dev/null @@ -1,6 +0,0 @@ -
    -<% echo $var; %> -

    Some text <% echo $var; %> and some more text

    -<%= $var . ' and some more text to make sure the snippet works'; %> -

    Some text <%= $var %> and some more text

    -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed deleted file mode 100644 index 6eafb422..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.2.inc.fixed +++ /dev/null @@ -1,6 +0,0 @@ -
    - -

    Some text and some more text

    - -

    Some text and some more text

    -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc deleted file mode 100644 index ba86345a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.3.inc +++ /dev/null @@ -1,7 +0,0 @@ - -
    -<% echo $var; %> -

    Some text <% echo $var; %> and some more text

    -<%= $var . ' and some more text to make sure the snippet works'; %> -

    Some text <%= $var %> and some more text

    -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php deleted file mode 100644 index 8dd6deb9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php +++ /dev/null @@ -1,110 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowAlternativePHPTags sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff - */ -final class DisallowAlternativePHPTagsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of all test files to check. - * - * @param string $testFileBase The base path that the unit tests files will have. - * - * @return string[] - */ - protected function getTestFiles($testFileBase) - { - $testFiles = [$testFileBase.'1.inc']; - - $aspTags = false; - if (PHP_VERSION_ID < 70000) { - $aspTags = (bool) ini_get('asp_tags'); - } - - if ($aspTags === true) { - $testFiles[] = $testFileBase.'2.inc'; - } else { - $testFiles[] = $testFileBase.'3.inc'; - } - - return $testFiles; - - }//end getTestFiles() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowAlternativePHPTagsUnitTest.1.inc': - return [ - 4 => 1, - 7 => 1, - 8 => 1, - 11 => 1, - ]; - case 'DisallowAlternativePHPTagsUnitTest.2.inc': - return [ - 2 => 1, - 3 => 1, - 4 => 1, - 5 => 1, - ]; - default: - return []; - }//end switch - - }//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($testFile='') - { - if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { - return [ - 3 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - ]; - } - - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc deleted file mode 100644 index 974e45c0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.inc +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php deleted file mode 100644 index 15510a69..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowRequestSuperglobal sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowRequestSuperglobalSniff - */ -final class DisallowRequestSuperglobalUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - protected function getErrorList() - { - return [ - 2 => 1, - 12 => 1, - 13 => 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. - * - * @return array - */ - protected function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc deleted file mode 100644 index 040e62dc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc +++ /dev/null @@ -1,11 +0,0 @@ -
    - -Some content here. - - -Some content Some more content - - -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed deleted file mode 100644 index 1ea281a4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.1.inc.fixed +++ /dev/null @@ -1,11 +0,0 @@ -
    - -Some content here. - - -Some content Some more content - - -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc deleted file mode 100644 index 85617ded..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc +++ /dev/null @@ -1,8 +0,0 @@ -
    - -Some content Some more content - - -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed deleted file mode 100644 index afe5d8f2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.2.inc.fixed +++ /dev/null @@ -1,8 +0,0 @@ -
    - -Some content Some more content - - -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc deleted file mode 100644 index 9b7ccd6d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.3.inc +++ /dev/null @@ -1,16 +0,0 @@ -// Test warning for when short_open_tag is off. - -Some content Some more content - -// Test multi-line. -Some content Some more content - -// Make sure skipping works. -Some content Some more content - -// Only recognize closing tag after opener. -Some?> content - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowShortOpenTag sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff - */ -final class DisallowShortOpenTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of all test files to check. - * - * @param string $testFileBase The base path that the unit tests files will have. - * - * @return string[] - */ - protected function getTestFiles($testFileBase) - { - $testFiles = [$testFileBase.'1.inc']; - - $option = (bool) ini_get('short_open_tag'); - if ($option === true) { - $testFiles[] = $testFileBase.'2.inc'; - } else { - $testFiles[] = $testFileBase.'3.inc'; - } - - return $testFiles; - - }//end getTestFiles() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowShortOpenTagUnitTest.1.inc': - return [ - 5 => 1, - 6 => 1, - 7 => 1, - 10 => 1, - ]; - case 'DisallowShortOpenTagUnitTest.2.inc': - return [ - 2 => 1, - 3 => 1, - 4 => 1, - 7 => 1, - ]; - default: - return []; - }//end switch - - }//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($testFile='') - { - switch ($testFile) { - case 'DisallowShortOpenTagUnitTest.1.inc': - return []; - case 'DisallowShortOpenTagUnitTest.3.inc': - return [ - 3 => 1, - 6 => 1, - 11 => 1, - ]; - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc deleted file mode 100644 index f564215b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DiscourageGotoUnitTest.inc +++ /dev/null @@ -1,18 +0,0 @@ - - * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DiscourageGoto sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DiscourageGotoSniff - */ -final class DiscourageGotoUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [ - 3 => 1, - 6 => 1, - 11 => 1, - 16 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc deleted file mode 100644 index 060da612..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.inc +++ /dev/null @@ -1,60 +0,0 @@ -sizeof($array); -$size = $class->count($array); -$class->delete($filepath); -$class->unset($filepath); - -function delete() {} -function unset() {} -function sizeof() {} -function count() {} - -trait DelProvider { - public function delete() { - //irrelevant - } -} - -class LeftSideTest { - use DelProvider { - delete as protected unsetter; - } -} - -class RightSideTest { - use DelProvider { - delete as delete; - } -} - -class RightSideVisTest { - use DelProvider { - delete as protected delete; - DelProvider::delete insteadof delete; - } -} - -namespace Something\sizeof; -$var = new Sizeof(); -class SizeOf implements Something {} - -function mymodule_form_callback(SizeOf $sizeof) { -} - -$size = $class?->sizeof($array); - -#[SizeOf(10)] -function doSomething() {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php deleted file mode 100644 index cb093131..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/ForbiddenFunctionsUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ForbiddenFunctions sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff - */ -final class ForbiddenFunctionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 2 => 1, - 4 => 1, - 6 => 1, - ]; - - return $errors; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc deleted file mode 100644 index 396cf6a4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc +++ /dev/null @@ -1,153 +0,0 @@ -NULL = 7; - -use Zend\Log\Writer\NULL as NullWriter; -new \Zend\Log\Writer\NULL(); - -namespace False; - -class True extends Null implements False {} - -use True\Something; -use Something\True; -class MyClass -{ - public function myFunction() - { - $var = array('foo' => new True()); - } -} - -$x = $f?FALSE:true; -$x = $f? FALSE:true; - -class MyClass -{ - // Spice things up a little. - const TRUE = false; -} - -var_dump(MyClass::TRUE); - -function tRUE() {} - -$input->getFilterChain()->attachByName('Null', ['type' => Null::TYPE_STRING]); - -// Issue #3332 - ignore type declarations, but not default values. -class TypedThings { - const MYCONST = FALSE; - - public int|FALSE $int = FALSE; - public Type|NULL $int = new MyObj(NULL); - - private function typed(int|FALSE $param = NULL, Type|NULL $obj = new MyObj(FALSE)) : string|FALSE|NULL - { - if (TRUE === FALSE) { - return NULL; - } - } -} - -$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() {}; - } -} - -// PHP 8.3 introduces typed constants. -class TypedConstants { - const MyClass|NULL|TRUE|FALSE MYCONST = FALSE; -} - -// Global constants can not be typed. -const MYCONST = TRUE; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed deleted file mode 100644 index 96b1c78d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed +++ /dev/null @@ -1,153 +0,0 @@ -NULL = 7; - -use Zend\Log\Writer\NULL as NullWriter; -new \Zend\Log\Writer\NULL(); - -namespace False; - -class True extends Null implements False {} - -use True\Something; -use Something\True; -class MyClass -{ - public function myFunction() - { - $var = array('foo' => new True()); - } -} - -$x = $f?false:true; -$x = $f? false:true; - -class MyClass -{ - // Spice things up a little. - const TRUE = false; -} - -var_dump(MyClass::TRUE); - -function tRUE() {} - -$input->getFilterChain()->attachByName('Null', ['type' => Null::TYPE_STRING]); - -// Issue #3332 - ignore type declarations, but not default values. -class TypedThings { - const MYCONST = false; - - public int|FALSE $int = false; - public Type|NULL $int = new MyObj(null); - - private function typed(int|FALSE $param = null, Type|NULL $obj = new MyObj(false)) : string|FALSE|NULL - { - if (true === false) { - return null; - } - } -} - -$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() {}; - } -} - -// PHP 8.3 introduces typed constants. -class TypedConstants { - const MyClass|NULL|TRUE|FALSE MYCONST = false; -} - -// Global constants can not be typed. -const MYCONST = true; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.2.inc deleted file mode 100644 index c61a0a50..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.2.inc +++ /dev/null @@ -1,4 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LowerCaseConstant sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff - */ -final class LowerCaseConstantUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'LowerCaseConstantUnitTest.1.inc': - return [ - 7 => 1, - 10 => 1, - 15 => 1, - 16 => 1, - 23 => 1, - 26 => 1, - 31 => 1, - 32 => 1, - 39 => 1, - 42 => 1, - 47 => 1, - 48 => 1, - 70 => 1, - 71 => 1, - 87 => 1, - 89 => 1, - 90 => 1, - 92 => 2, - 94 => 2, - 95 => 1, - 100 => 2, - 104 => 1, - 108 => 1, - 118 => 1, - 119 => 1, - 120 => 1, - 121 => 1, - 125 => 1, - 129 => 1, - 149 => 1, - 153 => 1, - ]; - - case 'LowerCaseConstantUnitTest.js': - return [ - 2 => 1, - 3 => 1, - 4 => 1, - 7 => 1, - 8 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc deleted file mode 100644 index 37579d32..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc +++ /dev/null @@ -1,48 +0,0 @@ - $x; -$r = Match ($x) { - 1 => 1, - 2 => 2, - DEFAULT, => 3, -}; - -class Reading { - Public READOnly int $var; -} - -EnuM ENUM: string -{ - Case HEARTS; -} - -__HALT_COMPILER(); // An exception due to phar support. -function diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed deleted file mode 100644 index 7063327a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed +++ /dev/null @@ -1,48 +0,0 @@ - $x; -$r = match ($x) { - 1 => 1, - 2 => 2, - default, => 3, -}; - -class Reading { - public readonly int $var; -} - -enum ENUM: string -{ - case HEARTS; -} - -__HALT_COMPILER(); // An exception due to phar support. -function diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php deleted file mode 100644 index 17f0e25d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LowerCaseKeyword sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff - */ -final class LowerCaseKeywordUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 3, - 11 => 4, - 12 => 1, - 13 => 3, - 14 => 7, - 15 => 1, - 19 => 1, - 20 => 1, - 21 => 1, - 25 => 1, - 28 => 1, - 31 => 1, - 32 => 1, - 35 => 1, - 39 => 2, - 42 => 1, - 44 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc deleted file mode 100644 index fb5b1fd5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc +++ /dev/null @@ -1,145 +0,0 @@ - $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 {}; - -class TypedClassConstants -{ - const UNTYPED = null; - const FLOAT = 'Reserved keyword as name is valid and should not be changed'; - const OBJECT = 'Reserved keyword as name is valid and should not be changed'; - - const ClassName FIRST = null; - public const Int SECOND = 0; - private const ?BOOL THIRD = false; - public const Self FOURTH = null; -} -interface TypedInterfaceConstants -{ - protected const PaRenT FIRST = null; - private const ARRAY SECOND = []; - public const Float THIRD = 2.5; - final const ?STRING FOURTH = 'fourth'; -} -trait TypedTraitConstants { - const IterablE FIRST = null; - const Object SECOND = null; - const Mixed THIRD = 'third'; -} -enum TypedEnumConstants { - public const Iterable|FALSE|NULL FIRST = null; - protected const SELF|Parent /* comment */ |\Fully\Qualified\ClassName|UnQualifiedClass SECOND = null; - private const ClassName|/*comment*/Float|STRING|False THIRD = 'third'; - public const sTRing | aRRaY | FaLSe FOURTH = 'fourth'; -} - -class DNFTypes { - const (Parent&Something)|Float CONST_NAME = 1.5; - - public readonly TRUE|(\A&B) $prop; - - function DNFParamTypes ( - null|(\Package\ClassName&\Package\Other_Class)|INT $DNFinMiddle, - (\Package\ClassName&\Package\Other_Class)|ARRAY $parensAtStart, - False|(\Package\ClassName&\Package\Other_Class) $parentAtEnd, - ) {} - - function DNFReturnTypes ($var): object|(Self&\Package\Other_Class)|sTRINg|false {} -} - -// Intentional error, should be ignored by the sniff. -interface PropertiesNotAllowed { - public $notAllowed; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed deleted file mode 100644 index 10be06b0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed +++ /dev/null @@ -1,145 +0,0 @@ - $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 {}; - -class TypedClassConstants -{ - const UNTYPED = null; - const FLOAT = 'Reserved keyword as name is valid and should not be changed'; - const OBJECT = 'Reserved keyword as name is valid and should not be changed'; - - const ClassName FIRST = null; - public const int SECOND = 0; - private const ?bool THIRD = false; - public const self FOURTH = null; -} -interface TypedInterfaceConstants -{ - protected const parent FIRST = null; - private const array SECOND = []; - public const float THIRD = 2.5; - final const ?string FOURTH = 'fourth'; -} -trait TypedTraitConstants { - const iterable FIRST = null; - const object SECOND = null; - const mixed THIRD = 'third'; -} -enum TypedEnumConstants { - public const iterable|false|null FIRST = null; - protected const self|parent /* comment */ |\Fully\Qualified\ClassName|UnQualifiedClass SECOND = null; - private const ClassName|/*comment*/float|string|false THIRD = 'third'; - public const string | array | false FOURTH = 'fourth'; -} - -class DNFTypes { - const (parent&Something)|float CONST_NAME = 1.5; - - public readonly true|(\A&B) $prop; - - function DNFParamTypes ( - null|(\Package\ClassName&\Package\Other_Class)|int $DNFinMiddle, - (\Package\ClassName&\Package\Other_Class)|array $parensAtStart, - false|(\Package\ClassName&\Package\Other_Class) $parentAtEnd, - ) {} - - function DNFReturnTypes ($var): object|(self&\Package\Other_Class)|string|false {} -} - -// Intentional error, should be ignored by the sniff. -interface PropertiesNotAllowed { - public $notAllowed; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php deleted file mode 100644 index 26219328..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LowerCaseType sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseTypeSniff - */ -final class LowerCaseTypeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 14 => 1, - 15 => 1, - 16 => 1, - 17 => 1, - 18 => 1, - 21 => 4, - 22 => 3, - 23 => 3, - 25 => 1, - 26 => 2, - 27 => 2, - 32 => 4, - 36 => 1, - 37 => 1, - 38 => 1, - 39 => 1, - 43 => 2, - 44 => 1, - 46 => 1, - 49 => 1, - 51 => 2, - 53 => 1, - 55 => 2, - 60 => 1, - 61 => 1, - 62 => 1, - 63 => 1, - 64 => 1, - 65 => 1, - 66 => 1, - 67 => 1, - 68 => 1, - 69 => 1, - 71 => 3, - 72 => 2, - 73 => 3, - 74 => 3, - 78 => 3, - 82 => 2, - 85 => 1, - 94 => 5, - 96 => 4, - 105 => 1, - 106 => 1, - 107 => 1, - 111 => 1, - 112 => 1, - 113 => 1, - 114 => 1, - 117 => 1, - 118 => 1, - 119 => 1, - 122 => 3, - 123 => 2, - 124 => 3, - 125 => 3, - 129 => 2, - 131 => 1, - 134 => 1, - 135 => 1, - 136 => 1, - 139 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - // Warning from getMemberProperties() about parse error. - return [144 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc deleted file mode 100644 index 98159b47..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/NoSilencedErrorsUnitTest.inc +++ /dev/null @@ -1,16 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the NoSilencedErrors sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\NoSilencedErrorsSniff - */ -final class NoSilencedErrorsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [13 => 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. - * - * @return array - */ - public function getWarningList() - { - return [ - 5 => 1, - 10 => 1, - 16 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc deleted file mode 100644 index 387cec24..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.1.inc +++ /dev/null @@ -1,8 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the RequireStrictType sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\RequireStrictTypesSniff - */ -final class RequireStrictTypesUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'RequireStrictTypesUnitTest.2.inc': - case 'RequireStrictTypesUnitTest.5.inc': - case 'RequireStrictTypesUnitTest.6.inc': - case 'RequireStrictTypesUnitTest.10.inc': - return [1 => 1]; - - default: - return []; - } - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getWarningList($testFile='') - { - 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() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc deleted file mode 100644 index f0f350f3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.inc +++ /dev/null @@ -1,5 +0,0 @@ -php_sapi_name() === true) {} -if ($object?->php_sapi_name() === true) {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php deleted file mode 100644 index 9ee274b6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SAPIUsageUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SAPIUsage sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SAPIUsageSniff - */ -final class SAPIUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [2 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc deleted file mode 100644 index 4f0d9d84..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.1.inc +++ /dev/null @@ -1,4 +0,0 @@ - -
    text
    - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php deleted file mode 100644 index 58433eb1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @author Blaine Schmeisser - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the Syntax sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SyntaxSniff - */ -final class SyntaxUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'SyntaxUnitTest.1.inc': - case 'SyntaxUnitTest.2.inc': - return [3 => 1]; - - default: - return []; - } - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc deleted file mode 100644 index 30c6d298..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc +++ /dev/null @@ -1,98 +0,0 @@ -null = 7; - -use Zend\Log\Writer\Null as NullWriter; -new \Zend\Log\Writer\Null(); - -namespace False; - -class True extends Null implements False {} - -use True\Something; -use Something\True; -class MyClass -{ - public function myFunction() - { - $var = array('foo' => new True()); - } -} - -$x = $f?false:TRUE; -$x = $f? false:TRUE; - -class MyClass -{ - // Spice things up a little. - const true = FALSE; -} - -var_dump(MyClass::true); - -function true() {} - -// Issue #3332 - ignore type declarations, but not default values. -class TypedThings { - const MYCONST = false; - - public int|false $int = false; - public Type|null $int = new MyObj(null); - - private function typed(int|false $param = null, Type|null $obj = new MyObj(false)) : string|false|null - { - if (true === false) { - return null; - } - } -} - -$cl = function (int|false $param = null, Type|null $obj = new MyObj(false)) : string|false|null {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed deleted file mode 100644 index 7705198c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed +++ /dev/null @@ -1,98 +0,0 @@ -null = 7; - -use Zend\Log\Writer\Null as NullWriter; -new \Zend\Log\Writer\Null(); - -namespace False; - -class True extends Null implements False {} - -use True\Something; -use Something\True; -class MyClass -{ - public function myFunction() - { - $var = array('foo' => new True()); - } -} - -$x = $f?FALSE:TRUE; -$x = $f? FALSE:TRUE; - -class MyClass -{ - // Spice things up a little. - const true = FALSE; -} - -var_dump(MyClass::true); - -function true() {} - -// Issue #3332 - ignore type declarations, but not default values. -class TypedThings { - const MYCONST = FALSE; - - public int|false $int = FALSE; - public Type|null $int = new MyObj(NULL); - - private function typed(int|false $param = NULL, Type|null $obj = new MyObj(FALSE)) : string|false|null - { - if (TRUE === FALSE) { - return NULL; - } - } -} - -$cl = function (int|false $param = NULL, Type|null $obj = new MyObj(FALSE)) : string|false|null {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php deleted file mode 100644 index 481c4ab1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the UpperCaseConstant sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\UpperCaseConstantSniff - */ -final class UpperCaseConstantUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 10 => 1, - 15 => 1, - 16 => 1, - 23 => 1, - 26 => 1, - 31 => 1, - 32 => 1, - 39 => 1, - 42 => 1, - 47 => 1, - 48 => 1, - 70 => 1, - 71 => 1, - 85 => 1, - 87 => 1, - 88 => 1, - 90 => 2, - 92 => 2, - 93 => 1, - 98 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.1.inc deleted file mode 100644 index d2ac790d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.1.inc +++ /dev/null @@ -1,34 +0,0 @@ -'; -$code = '<'.'?php '; - -$string = 'This is a really long string. ' - . 'It is being used for errors. ' - . 'The message is not translated.'; - -$shouldBail = 1 + 1; - -$shouldNotTrigger = 'My' . /* comment */ 'string'; -$shouldNotTrigger = 'My' /* comment */ . 'string'; - -// phpcs:set Generic.Strings.UnnecessaryStringConcat allowMultiline true -$string = 'Multiline strings are allowed ' - . 'when setting is enabled.'; -// phpcs:set Generic.Strings.UnnecessaryStringConcat allowMultiline false - -// phpcs:set Generic.Strings.UnnecessaryStringConcat error false -$throwWarning = 'My' . 'string'; -// phpcs:set Generic.Strings.UnnecessaryStringConcat error true diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.2.inc deleted file mode 100644 index 6a5fcba9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.2.inc +++ /dev/null @@ -1,7 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the UnnecessaryStringConcat sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff - */ -final class UnnecessaryStringConcatUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'UnnecessaryStringConcatUnitTest.1.inc': - return [ - 2 => 1, - 6 => 1, - 9 => 1, - 12 => 1, - 19 => 1, - 20 => 1, - ]; - - case 'UnnecessaryStringConcatUnitTest.js': - return [ - 1 => 1, - 8 => 1, - 11 => 1, - 14 => 1, - 15 => 1, - ]; - - default: - return []; - }//end switch - - }//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($testFile='') - { - switch ($testFile) { - case 'UnnecessaryStringConcatUnitTest.1.inc': - return [ - 33 => 1, - ]; - - default: - return []; - } - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css deleted file mode 100644 index de84a948..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.css +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This is a CSS comment. -<<<<<<< HEAD - * This is a merge conflict... -======= - * which should be detected. ->>>>>>> ref/heads/feature-branch - */ - -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; -<<<<<<< HEAD - line-height: -25px; -======= - line-height: -20px; ->>>>>>> ref/heads/feature-branch - cursor: pointer; - -moz-user-select: none; -} - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries, subsequent boundaries will still - * be detected correctly. - */ - -/* - * This is a CSS comment. -<<<<<<< HEAD - * This is a merge conflict... -======= - * which should be detected. ->>>>>>> ref/heads/feature-branch - */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc deleted file mode 100644 index 470c3b8f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.1.inc +++ /dev/null @@ -1,61 +0,0 @@ -> -1); -var_dump( -1 -<< --1 -); - -$string = -<< 'a' -<<<<<<< HEAD - 'b' => 'b' -======= - 'c' => 'c' ->>>>>>> master - ); - } - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ - -/* - * Testing detecting subsequent merge conflicts. - * -<<<<<<< HEAD - * @var string $bar - */ -public function foo($bar){ } - -/** -============ -The above is not the boundary, the below is. -======= - * @var string $bar ->>>>>>> f19f8a5... Commit message -*/ - -// Test that stray boundaries, i.e. an opener without closer and such, are detected. -<<<<<<< HEAD -$a = 1; -======= diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css deleted file mode 100644 index 6caa78d0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.css +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This is a CSS comment. -<<<<<<< HEAD - * This is a merge conflict started in a comment, ending in a CSS block. - */ -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; -======= - * which should be detected. - **/ -.SettingsTabPaneWidgetType-tab-start { - line-height: -25px; ->>>>>>> ref/heads/feature-branch - cursor: pointer; - -moz-user-select: none; -} - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries, subsequent boundaries will still - * be detected correctly. - */ - -/* - * This is a CSS comment. -<<<<<<< HEAD - * This is a merge conflict... -======= - * which should be detected. ->>>>>>> ref/heads/feature-branch - */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc deleted file mode 100644 index 809b17d6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.2.inc +++ /dev/null @@ -1,31 +0,0 @@ ->>>>>> master - */ - -/* - * Testing detecting merge conflicts using different comment styles. - * -<<<<<<< HEAD - * @var string $bar - */ -public function foo($bar){ } - -/* -======= - * @var string $bar ->>>>>>> master -*/ - -// Comment -<<<<<<< HEAD -// Second comment line. NOTE: The above opener breaks the tokenizer. -======= -// New second comment line ->>>>>>> master -// Third comment line diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc deleted file mode 100644 index ce709412..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.3.inc +++ /dev/null @@ -1,43 +0,0 @@ - -
    -<<<<<<< HEAD -

    Testing a merge conflict.

    -======= -

    Another text string.

    ->>>>>>> ref/heads/feature-branch -
    - - -
    -<<<<<<< HEAD -

    -======= -

    ->>>>>>> ref/heads/feature-branch -
    - ->>>>>> master - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ -?> - -
    -<<<<<<< HEAD -

    Testing a merge conflict.

    -======= -

    Another text string.

    ->>>>>>> ref/heads/feature-branch -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc deleted file mode 100644 index 99c0b997..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.4.inc +++ /dev/null @@ -1,71 +0,0 @@ ->>>>>> ref/heads/other-branchname -And now they are. -EOD; - -// Heredoc with a merge conflict starter, the closer is outside the heredoc. -$string = -<<>>>>>> ref/heads/other-branchname - -// Merge conflict starter outside with a closer inside of the heredoc. -// This breaks the tokenizer. -<<<<<<< HEAD -$string = -<<>>>>>> ref/heads/other-branchname -EOD; - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ - -$string = -<<>>>>>> ref/heads/other-branchname -And now they are. -EOD; - -$string = -<<>>>>>> ref/heads/other-branchname diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc deleted file mode 100644 index 7d55f6df..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.5.inc +++ /dev/null @@ -1,34 +0,0 @@ ->>>>>> ref/heads/other-branchname -And now they are. -EOD; - -// Break the tokenizer. -<<<<<<< HEAD - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ - -$string = -<<<'EOD' -can be problematic. -<<<<<<< HEAD -were previously not detected. -======= -should also be detected. ->>>>>>> ref/heads/other-branchname -And now they are. -EOD; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc deleted file mode 100644 index aaea3245..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.6.inc +++ /dev/null @@ -1,34 +0,0 @@ ->>>>>> ref/heads/other-branchname - And now they are. - EOD; - -// Break the tokenizer. ->>>>>>> master - -/* - * The above tests are based on "normal" tokens. - * The below test checks that once the tokenizer breaks down because of - * unexpected merge conflict boundaries - i.e. after the first merge conflict - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent - * merge conflict boundaries will still be detected correctly. - */ - -$string = - <<<"EOD" - Merge conflicts in PHP 7.3 indented heredocs -<<<<<<< HEAD - can be problematic. -======= - should also be detected. ->>>>>>> ref/heads/other-branchname - And now they are. - EOD; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc deleted file mode 100644 index 85cae1fd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.7.inc +++ /dev/null @@ -1,19 +0,0 @@ - -
    -<<<<<<< HEAD -

    Testing a merge conflict.

    -======= -

    Another text string.

    ->>>>>>> ref/heads/feature-branch -
    - - -
    -<<<<<<< HEAD -

    -======= -

    ->>>>>>> ref/heads/feature-branch -
    - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js deleted file mode 100644 index cd7bc760..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.js +++ /dev/null @@ -1,33 +0,0 @@ - -result = x?y:z; -result = x ? y : z; - -<<<<<<< HEAD -if (something === true -======= -if (something === false ->>>>>>> develop - ^ somethingElse === true -) { -<<<<<<< HEAD - return true; -======= - return false; ->>>>>>> develop -} - -y = 1 - + 2 - - 3; - -/* -<<<<<<< HEAD - * @var string $bar - */ -if (something === true - -/** -======= - * @var string $foo ->>>>>>> master - */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php deleted file mode 100644 index bc966384..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php +++ /dev/null @@ -1,175 +0,0 @@ - - * @copyright 2017 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\VersionControl; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the GitMergeConflict sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\GitMergeConflictSniff - */ -final class GitMergeConflictUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'GitMergeConflictUnitTest.1.inc': - return [ - 26 => 1, - 28 => 1, - 30 => 1, - 45 => 1, - 53 => 1, - 55 => 1, - 59 => 1, - 61 => 1, - ]; - - case 'GitMergeConflictUnitTest.2.inc': - return [ - 4 => 1, - 6 => 1, - 8 => 1, - 14 => 1, - 20 => 1, - 22 => 1, - 26 => 1, - 28 => 1, - 30 => 1, - ]; - - case 'GitMergeConflictUnitTest.3.inc': - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 12 => 1, - 14 => 1, - 16 => 1, - 22 => 1, - 24 => 1, - 26 => 1, - 38 => 1, - 40 => 1, - 42 => 1, - ]; - - case 'GitMergeConflictUnitTest.4.inc': - return [ - 6 => 1, - 8 => 1, - 10 => 1, - 18 => 1, - 22 => 1, - 25 => 1, - 29 => 1, - 34 => 1, - 39 => 1, - 53 => 1, - 55 => 1, - 57 => 1, - 64 => 1, - 68 => 1, - 71 => 1, - ]; - case 'GitMergeConflictUnitTest.5.inc': - case 'GitMergeConflictUnitTest.6.inc': - return [ - 6 => 1, - 8 => 1, - 10 => 1, - 15 => 1, - 28 => 1, - 30 => 1, - 32 => 1, - ]; - - case 'GitMergeConflictUnitTest.7.inc': - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 12 => 1, - 14 => 1, - 16 => 1, - ]; - - case 'GitMergeConflictUnitTest.1.css': - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 12 => 1, - 14 => 1, - 16 => 1, - 30 => 1, - 32 => 1, - 34 => 1, - ]; - - case 'GitMergeConflictUnitTest.2.css': - return [ - 3 => 1, - 8 => 1, - 13 => 1, - 27 => 1, - 29 => 1, - 31 => 1, - ]; - - case 'GitMergeConflictUnitTest.js': - return [ - 5 => 1, - 7 => 1, - 9 => 1, - 12 => 1, - 14 => 1, - 16 => 1, - 24 => 1, - 30 => 1, - 32 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc deleted file mode 100644 index e4110dee..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/VersionControl/SubversionPropertiesUnitTest.inc +++ /dev/null @@ -1,3 +0,0 @@ - - * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\VersionControl; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SubversionProperties sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\SubversionPropertiesSniff - */ -final class SubversionPropertiesUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Should this test be skipped for some reason. - * - * @return bool - */ - protected function shouldSkipTest() - { - // This sniff cannot be tested as no SVN version control directory is available. - return true; - - }//end shouldSkipTest() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc deleted file mode 100644 index 4ce05084..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc +++ /dev/null @@ -1,192 +0,0 @@ -{$var}( $foo,$bar ); - -$bar(function( $a, $b ) { - return function( $c, $d ) use ( $a, $b ) { - echo $a, $b, $c, $d; - }; -})( 'a','b' )( 'c','d' ); - -$closure( $foo,$bar ); -$var = $closure() + $closure( $foo,$bar ) + self::$closure( $foo,$bar ); - -class Test { - public static function baz( $foo, $bar ) { - $a = new self( $foo,$bar ); - $b = new static( $foo,$bar ); - } -} - -/* - * Test warning for empty parentheses. - */ -$a = 4 + (); // Warning. -$a = 4 + ( ); // Warning. -$a = 4 + (/* Not empty */); - -/* - * Test the actual sniff. - */ -if ((null !== $extra) && ($row->extra !== $extra)) {} - -if (( null !== $extra ) && ( $row->extra !== $extra )) {} // Bad x 4. - -if (( null !== $extra // Bad x 1. - && is_int($extra)) - && ( $row->extra !== $extra // Bad x 1. - || $something ) // Bad x 1. -) {} - -if (( null !== $extra ) // Bad x 2. - && ( $row->extra !== $extra ) // Bad x 2. -) {} - -$a = (null !== $extra); -$a = ( null !== $extra ); // Bad x 2. - -$sx = $vert ? ($w - 1) : 0; - -$this->is_overloaded = ( ( ini_get("mbstring.func_overload") & 2 ) != 0 ) && function_exists('mb_substr'); // Bad x 4. - -$image->flip( ($operation->axis & 1) != 0, ($operation->axis & 2) != 0 ); - -if ( $success && ('nothumb' == $target || 'all' == $target) ) {} - -$directory = ('/' == $file[ strlen($file)-1 ]); - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 -if ((null !== $extra) && ($row->extra !== $extra)) {} // Bad x 4. - -if (( null !== $extra ) && ( $row->extra !== $extra )) {} - -if (( null !== $extra // Bad x 1. - && is_int($extra)) // Bad x 1. - && ( $row->extra !== $extra - || $something ) // Bad x 1. -) {} - -if ((null !== $extra) // Bad x 2. - && ($row->extra !== $extra) // Bad x 2. -) {} - -$a = (null !== $extra); // Bad x 2. -$a = ( null !== $extra ); - -$sx = $vert ? ($w - 1) : 0; // Bad x 2. - -$this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); // Bad x 4. - -$image->flip( ($operation->axis & 1) != 0, ($operation->axis & 2) != 0 ); // Bad x 4. - -if ( $success && ('nothumb' == $target || 'all' == $target) ) {} // Bad x 2. - -$directory = ('/' == $file[ strlen($file)-1 ]); // Bad x 2. - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 - -/* - * Test handling of ignoreNewlines. - */ -if ( - ( - null !== $extra - ) && ( - $row->extra !== $extra - ) -) {} // Bad x 4, 1 x line 123, 2 x line 125, 1 x line 127. - - -$a = ( - null !== $extra -); // Bad x 2, 1 x line 131, 1 x line 133. - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 -if ( - ( - null !== $extra - ) && ( - $row->extra !== $extra - ) -) {} // Bad x 4, 1 x line 137, 2 x line 139, 1 x line 141. - -$a = ( - null !== $extra -); // Bad x 2, 1 x line 144, 1 x line 146. -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines true -if ( - ( - null !== $extra - ) && ( - $row->extra !== $extra - ) -) {} - -$a = ( - null !== $extra -); -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines false - -if (true) {} ( 1+2) === 3 ? $a = 1 : $a = 2; -class A {} ( 1+2) === 3 ? $a = 1 : $a = 2; -function foo() {} ( 1+2) === 3 ? $a = 1 : $a = 2; - -// Issue #3618. -class NonArbitraryParenthesesWithKeywords { - public static function baz( $foo, $bar ) { - $a = new self(); - $b = new parent(); - $c = new static(); - - // self/static are already tested above, round line 45. - $d = new parent( $foo,$bar ); - } -} - -// Test that the match expression does not trigger the sniff. -$b = match ( $a ) { - 1 => true, -}; - -// Parentheses after die/exit in a switch case should be ignored. -switch ( $type ) { - case A: - exit( 1 ); - case B: - die(); - default: - break; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc.fixed deleted file mode 100644 index a0022808..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.1.inc.fixed +++ /dev/null @@ -1,180 +0,0 @@ -{$var}( $foo,$bar ); - -$bar(function( $a, $b ) { - return function( $c, $d ) use ( $a, $b ) { - echo $a, $b, $c, $d; - }; -})( 'a','b' )( 'c','d' ); - -$closure( $foo,$bar ); -$var = $closure() + $closure( $foo,$bar ) + self::$closure( $foo,$bar ); - -class Test { - public static function baz( $foo, $bar ) { - $a = new self( $foo,$bar ); - $b = new static( $foo,$bar ); - } -} - -/* - * Test warning for empty parentheses. - */ -$a = 4 + (); // Warning. -$a = 4 + ( ); // Warning. -$a = 4 + (/* Not empty */); - -/* - * Test the actual sniff. - */ -if ((null !== $extra) && ($row->extra !== $extra)) {} - -if ((null !== $extra) && ($row->extra !== $extra)) {} // Bad x 4. - -if ((null !== $extra // Bad x 1. - && is_int($extra)) - && ($row->extra !== $extra // Bad x 1. - || $something) // Bad x 1. -) {} - -if ((null !== $extra) // Bad x 2. - && ($row->extra !== $extra) // Bad x 2. -) {} - -$a = (null !== $extra); -$a = (null !== $extra); // Bad x 2. - -$sx = $vert ? ($w - 1) : 0; - -$this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); // Bad x 4. - -$image->flip( ($operation->axis & 1) != 0, ($operation->axis & 2) != 0 ); - -if ( $success && ('nothumb' == $target || 'all' == $target) ) {} - -$directory = ('/' == $file[ strlen($file)-1 ]); - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 -if (( null !== $extra ) && ( $row->extra !== $extra )) {} // Bad x 4. - -if (( null !== $extra ) && ( $row->extra !== $extra )) {} - -if (( null !== $extra // Bad x 1. - && is_int($extra) ) // Bad x 1. - && ( $row->extra !== $extra - || $something ) // Bad x 1. -) {} - -if (( null !== $extra ) // Bad x 2. - && ( $row->extra !== $extra ) // Bad x 2. -) {} - -$a = ( null !== $extra ); // Bad x 2. -$a = ( null !== $extra ); - -$sx = $vert ? ( $w - 1 ) : 0; // Bad x 2. - -$this->is_overloaded = ( ( ini_get("mbstring.func_overload") & 2 ) != 0 ) && function_exists('mb_substr'); // Bad x 4. - -$image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 ); // Bad x 4. - -if ( $success && ( 'nothumb' == $target || 'all' == $target ) ) {} // Bad x 2. - -$directory = ( '/' == $file[ strlen($file)-1 ] ); // Bad x 2. - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 - -/* - * Test handling of ignoreNewlines. - */ -if ( - (null !== $extra) && ($row->extra !== $extra) -) {} // Bad x 4, 1 x line 123, 2 x line 125, 1 x line 127. - - -$a = (null !== $extra); // Bad x 2, 1 x line 131, 1 x line 133. - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 1 -if ( - ( null !== $extra ) && ( $row->extra !== $extra ) -) {} // Bad x 4, 1 x line 137, 2 x line 139, 1 x line 141. - -$a = ( null !== $extra ); // Bad x 2, 1 x line 144, 1 x line 146. -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing spacing 0 - -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines true -if ( - ( - null !== $extra - ) && ( - $row->extra !== $extra - ) -) {} - -$a = ( - null !== $extra -); -// phpcs:set Generic.WhiteSpace.ArbitraryParenthesesSpacing ignoreNewlines false - -if (true) {} (1+2) === 3 ? $a = 1 : $a = 2; -class A {} (1+2) === 3 ? $a = 1 : $a = 2; -function foo() {} (1+2) === 3 ? $a = 1 : $a = 2; - -// Issue #3618. -class NonArbitraryParenthesesWithKeywords { - public static function baz( $foo, $bar ) { - $a = new self(); - $b = new parent(); - $c = new static(); - - // self/static are already tested above, round line 45. - $d = new parent( $foo,$bar ); - } -} - -// Test that the match expression does not trigger the sniff. -$b = match ( $a ) { - 1 => true, -}; - -// Parentheses after die/exit in a switch case should be ignored. -switch ( $type ) { - case A: - exit( 1 ); - case B: - die(); - default: - break; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.2.inc deleted file mode 100644 index 3d5bcd0a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ArbitraryParenthesesSpacingUnitTest.2.inc +++ /dev/null @@ -1,4 +0,0 @@ - - * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ArbitraryParenthesesSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ArbitraryParenthesesSpacingSniff - */ -final class ArbitraryParenthesesSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ArbitraryParenthesesSpacingUnitTest.1.inc': - return [ - 64 => 4, - 66 => 1, - 68 => 1, - 69 => 1, - 72 => 2, - 73 => 2, - 77 => 2, - 81 => 4, - 90 => 4, - 94 => 1, - 95 => 1, - 97 => 1, - 100 => 2, - 101 => 2, - 104 => 2, - 107 => 2, - 109 => 4, - 111 => 4, - 113 => 2, - 115 => 2, - 123 => 1, - 125 => 2, - 127 => 1, - 131 => 1, - 133 => 1, - 137 => 1, - 139 => 2, - 141 => 1, - 144 => 1, - 146 => 1, - 163 => 1, - 164 => 1, - 165 => 1, - ]; - - default: - return []; - }//end switch - - }//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($testFile='') - { - switch ($testFile) { - case 'ArbitraryParenthesesSpacingUnitTest.1.inc': - return [ - 55 => 1, - 56 => 1, - ]; - - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc deleted file mode 100644 index 1826b585..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.1.inc +++ /dev/null @@ -1,118 +0,0 @@ -"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// Doc comments are indent with tabs and one space -//[tab]/** -//[tab][space]* - /** - * CVS revision for HTTP headers. - * - * @var string - * @access private - */ - /** - * - */ - -$str = 'hello - there'; - -/** - * This PHP DocBlock should be fine, even though there is a single space at the beginning. - * - * @var int $x - */ -$x = 1; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - -"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// Doc comments are indent with tabs and one space -//[tab]/** -//[tab][space]* - /** - * CVS revision for HTTP headers. - * - * @var string - * @access private - */ - /** - * - */ - -$str = 'hello - there'; - -/** - * This PHP DocBlock should be fine, even though there is a single space at the beginning. - * - * @var int $x - */ -$x = 1; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - -"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// Doc comments are indent with tabs and one space -//[tab]/** -//[tab][space]* - /** - * CVS revision for HTTP headers. - * - * @var string - * @access private - */ - /** - * - */ - -$str = 'hello - there'; - -/** - * This PHP DocBlock should be fine, even though there is a single space at the beginning. - * - * @var int $x - */ -$x = 1; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - -"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; -// Doc comments are indent with tabs and one space -//[tab]/** -//[tab][space]* - /** - * CVS revision for HTTP headers. - * - * @var string - * @access private - */ - /** - * - */ - -$str = 'hello - there'; - -/** - * This PHP DocBlock should be fine, even though there is a single space at the beginning. - * - * @var int $x - */ -$x = 1; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowSpaceIndent sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowSpaceIndentSniff - */ -final class DisallowSpaceIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - if ($testFile === 'DisallowSpaceIndentUnitTest.2.inc') { - return; - } - - $config->tabWidth = 4; - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowSpaceIndentUnitTest.1.inc': - case 'DisallowSpaceIndentUnitTest.2.inc': - return [ - 5 => 1, - 9 => 1, - 15 => 1, - 22 => 1, - 24 => 1, - 30 => 1, - 35 => 1, - 50 => 1, - 55 => 1, - 57 => 1, - 58 => 1, - 59 => 1, - 60 => 1, - 65 => 1, - 66 => 1, - 67 => 1, - 68 => 1, - 69 => 1, - 70 => 1, - 73 => 1, - 77 => 1, - 81 => 1, - 104 => 1, - 105 => 1, - 106 => 1, - 107 => 1, - 108 => 1, - 110 => 1, - 111 => 1, - 112 => 1, - 114 => 1, - 115 => 1, - 117 => 1, - 118 => 1, - ]; - - case 'DisallowSpaceIndentUnitTest.3.inc': - return [ - 2 => 1, - 5 => 1, - 10 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - ]; - - case 'DisallowSpaceIndentUnitTest.4.inc': - if (PHP_VERSION_ID >= 70300) { - return [ - 7 => 1, - 13 => 1, - ]; - } - - // PHP 7.2 or lower: PHP version which doesn't support flexible heredocs/nowdocs yet. - return []; - - case 'DisallowSpaceIndentUnitTest.js': - return [3 => 1]; - - case 'DisallowSpaceIndentUnitTest.css': - return [2 => 1]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc deleted file mode 100644 index cf61177e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.1.inc +++ /dev/null @@ -1,93 +0,0 @@ - 'Czech republic', - 'România' => 'Romania', - 'Magyarország' => 'Hungary', -); - -$var = "$hello $there"; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - 'Czech republic', - 'România' => 'Romania', - 'Magyarország' => 'Hungary', -); - -$var = "$hello $there"; - -?> - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - - - Foo - - -
    -
    -
    -
    -
    -
    - - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowTabIndent sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff - */ -final class DisallowTabIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - $config->tabWidth = 4; - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowTabIndentUnitTest.1.inc': - return [ - 5 => 2, - 9 => 1, - 15 => 1, - 20 => 2, - 21 => 1, - 22 => 2, - 23 => 1, - 24 => 2, - 31 => 1, - 32 => 2, - 33 => 2, - 41 => 1, - 42 => 1, - 43 => 1, - 44 => 1, - 45 => 1, - 46 => 1, - 47 => 1, - 48 => 1, - 54 => 1, - 55 => 1, - 56 => 1, - 57 => 1, - 58 => 1, - 59 => 1, - 79 => 1, - 80 => 1, - 81 => 1, - 82 => 1, - 83 => 1, - 85 => 1, - 86 => 1, - 87 => 1, - 89 => 1, - 90 => 1, - 92 => 1, - 93 => 1, - ]; - - case 'DisallowTabIndentUnitTest.2.inc': - return [ - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 19 => 1, - ]; - - case 'DisallowTabIndentUnitTest.3.inc': - if (PHP_VERSION_ID >= 70300) { - return [ - 7 => 1, - 13 => 1, - ]; - } - - // PHP 7.2 or lower: PHP version which doesn't support flexible heredocs/nowdocs yet. - return []; - - case 'DisallowTabIndentUnitTest.js': - return [ - 3 => 1, - 5 => 1, - 6 => 1, - ]; - - case 'DisallowTabIndentUnitTest.css': - return [ - 1 => 1, - 2 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc deleted file mode 100644 index 535053b0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc +++ /dev/null @@ -1,43 +0,0 @@ -prop++; -$obj->prop ++; -$obj?->prop ++; - -$obj->obj->prop++; -$obj->obj->prop ++; -$obj?->obj->prop ++; - -$obj->prop['key']++; -$obj->prop['key'] ++; - ---ClassName::$prop; --- ClassName::$prop; - -getObject()->count -++; -getObject()->count++; -++ getObject()->count; -++getObject()->count; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed deleted file mode 100644 index c30332b2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,41 +0,0 @@ -prop++; -$obj->prop++; -$obj?->prop++; - -$obj->obj->prop++; -$obj->obj->prop++; -$obj?->obj->prop++; - -$obj->prop['key']++; -$obj->prop['key']++; - ---ClassName::$prop; ---ClassName::$prop; - -getObject()->count++; -getObject()->count++; -++getObject()->count; -++getObject()->count; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js deleted file mode 100644 index b7b1c2f2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js +++ /dev/null @@ -1,17 +0,0 @@ -var i; - -i = 10; ---i; --- i; --- /*comment*/ i; -++i; -++ - i; -++/*comment*/i; - -i--; -i --; -i /*comment*/ --; -i++; -i ++; -i /*comment*/ ++; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js.fixed deleted file mode 100644 index 5d8b33a0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.js.fixed +++ /dev/null @@ -1,16 +0,0 @@ -var i; - -i = 10; ---i; ---i; --- /*comment*/ i; -++i; -++i; -++/*comment*/i; - -i--; -i--; -i /*comment*/ --; -i++; -i++; -i /*comment*/ ++; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php deleted file mode 100644 index 91e34933..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2018 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the IncrementDecrementSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff - */ -final class IncrementDecrementSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - $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; - $errors[40] = 1; - $errors[42] = 1; - - return $errors; - - case 'IncrementDecrementSpacingUnitTest.js': - return $errors; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc deleted file mode 100644 index 1847778d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2017 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LanguageConstructSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff - */ -final class LanguageConstructSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'LanguageConstructSpacingUnitTest.1.inc': - return [ - 3 => 1, - 5 => 1, - 8 => 1, - 10 => 1, - 13 => 1, - 15 => 1, - 18 => 1, - 20 => 1, - 23 => 1, - 25 => 1, - 28 => 1, - 30 => 1, - 33 => 1, - 36 => 1, - 39 => 1, - 40 => 1, - 43 => 1, - 44 => 1, - 45 => 1, - 46 => 1, - 48 => 1, - 52 => 1, - 55 => 1, - 56 => 1, - 57 => 2, - 60 => 1, - 63 => 1, - 65 => 1, - 73 => 1, - 75 => 1, - 77 => 1, - 81 => 1, - 83 => 1, - 85 => 1, - 86 => 1, - 90 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc deleted file mode 100644 index bab866e0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc +++ /dev/null @@ -1,1653 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false - -hello(); - } - - function hello() - { - echo 'hello'; -}//end hello() - - function hello2() - { - if (TRUE) { - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; - } - - while (TRUE) { - echo 'hello'; - } - - do { - echo 'hello'; - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -    $safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* This is a T_COMMENT - * - * - * - */ - - /** This is a T_DOC_COMMENT - */ - - /* - This T_COMMENT has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - - - - doSomething( - function () { - echo 123; - } - ); - } -} - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -$myFunction = function() { - $a = 403; - if ($a === 404) { - $a = 403; - } -}; - -class Whatever -{ - protected $_protectedArray = array( - 'normalString' => 'That email address is already in use!', - 'offendingString' => <<<'STRING' -Each line of this string is always said to be at column 0, - no matter how many spaces are placed - at the beginning of each line -and the ending STRING on the next line is reported as having to be indented. -STRING - ); -} - -class MyClass -{ - public static function myFunction() - { - if (empty($keywords) === FALSE) { - $keywords = 'foo'; - $existing = 'foo'; - } - - return $keywords; - - }//end myFunction() - -}//end class - -$var = call_user_func( - $new_var = function () use (&$a) { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - } -); - -class AnonymousFn -{ - public function getAnonFn() - { - return array( - 'functions' => Array( - 'function1' => function ($a, $b, $c) { - $a = $b + $c; - $b = $c / 2; - return Array($a, $b, $c); - }, - ), - ); - } -} -?> - -
    - -
    -
    - -
    -
    - -
    - - "") { - $test = true; - } else { - $test = true; - } - } - ?> - - - -
    -
    -
    - -
    -
    -
    - - -

    some text

    - function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -if ($foo) { - foreach ($bar as $baz) { - if ($baz) { - ?> -
    -
    -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - -<?= CHtml::encode($this->pageTitle); ?> - -expects($this->at(2)) - ->with($this->callback( - function ($subject) - { - } - ) - ); - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -echo $string->append('foo') - ->appaend('bar') - ->appaend('baz') - ->outputUsing( - function () - { - } - ); - -echo PHP_EOL; - -switch ($arg) { - case 1: - break; - case 2: - if ($arg2 == 'foo') { - } - case 3: - default: - echo 'default'; -} - -if ($tokens[$stackPtr]['content']{0} === '#') { -} else if ($tokens[$stackPtr]['content']{0} === '/' - && $tokens[$stackPtr]['content']{1} === '/' -) { -} - -$var = call_user_func( - function() { - if ($foo) { - $new_var = function() { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - }; - } - } -); - -a( - function() { - $a = function() { - $b = false; - }; - true; - } -); - -$var = [ - [ - '1' => - function () { - return true; - }, - ], - [ - '1' => - function () { - return true; - }, - '2' => true, - ] -]; - -if ($foo) { - ?> -

    - self::_replaceKeywords($failingComment, $result), - 'screenshot' => Test::getScreenshotPath( - $projectid, - $result['class_name'], - ), - ); - -} - -$this->mockedDatabase - ->with( - $this->callback( - function () { - return; - } - ) - ); - -$this->subject->recordLogin(); - -function a() -{ - if (true) { - static::$a[$b] = - static::where($c) - ->where($c) - ->where( - function ($d) { - $d->whereNull(); - $d->orWhere(); - } - ) - ->first(); - - if (static::$a[$b] === null) { - static::$a[$b] = new static( - array( - 'a' => $a->id, - 'a' => $a->id, - ) - ); - } - } - - return static::$a[$b]; -} - -$foo->load( - array( - 'bar' => function ($baz) { - $baz->call(); - } - ) -); - -hello(); - -$foo = array_unique( - array_map( - function ($entry) { - return $entry * 2; - }, - array() - ) -); -bar($foo); - -class PHP_CodeSniffer_Tokenizers_JS -{ - - public $scopeOpeners = array( - T_CASE => array( - 'end' => array( - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - ), - 'strict' => true, - ), - ); -} - -echo $string-> - append('foo')-> - appaend('bar')-> - appaend('baz')-> - outputUsing( - function () - { - } - ); - -$str = 'the items I want to show are: ' . - implode( - ', ', - array('a', 'b', 'c') - ); - -echo $str; - -$str = 'foo' - . '1' - . '2'; - -echo $str; - -bar([ - 'foo' => foo(function () { - return 'foo'; - }) -]); - -$domains = array_unique( - array_map( - function ($url) { - $urlObject = new \Purl\Url($url); - return $urlObject->registerableDomain; - }, - $sites - ) -); - -return $domains; - -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; - -if ($foo): -if ($bar) $foo = 1; -elseif ($baz) $foo = 2; -endif; - -$this - ->method(array( - 'foo' => 'bar', - ), 'arg', array( - 'foo' => 'bar', - )); - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -foo(); - -array( - 'key1' => function ($bar) { - return $bar; - }, - 'key2' => function ($foo) { - return $foo; - }, -); - -?> - - 1, - ]; -$c = 2; - -class foo -{ - public function get() - { - $foo = ['b' => 'c', - 'd' => [ - ['e' => 'f'] - ]]; - echo '42'; - - $foo = array('b' => 'c', - 'd' => array( - array('e' => 'f') - )); - echo '42'; - } -} - -switch ($foo) { - case 1: - return array(); - case 2: - return ''; - case 3: - return $function(); - case 4: - return $functionCall($param[0]); - case 5: - return array() + array(); // Array Merge - case 6: - // String connect - return $functionReturningString('') . $functionReturningString(array()); - case 7: - return functionCall( - $withMultiLineParam[0], - array(), - $functionReturningString( - $withMultiLineParam[1] - ) - ); - case 8: - return $param[0][0]; -} - -class Test { - - public - $foo - ,$bar - ,$baz = [ ] - ; - - public function wtfindent() { - } -} - -switch ($x) { - case 1: - return [1]; - default: - return [2]; -} - -switch ($foo) { - case self::FOO: - return $this->bar($gfoo, function ($id) { - return FOO::bar($id); - }, $values); - case self::BAR: - $values = $this->bar($foo, $values); - break; -} - -$var = array( - 'long description' => - array(0, 'something'), - 'another long description' => - array(1, "something else") -); - -$services = array( - 'service 1' => - Mockery::mock('class 1') - ->shouldReceive('setFilter')->once() - ->shouldReceive('getNbResults')->atLeast()->once() - ->shouldReceive('getSlice')->once()->andReturn(array()) - ->getMock(), - 'service 2' => - Mockery::mock('class 2') - ->shouldReceive('__invoke')->once() - ->getMock() -); - -class Foo -{ - public function setUp() - { - $this->foo = new class { - public $name = 'Some value'; - }; - } -} - -try { - foo(); -} catch (\Exception $e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -if ($foo) { - foo(); -} else if ($e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} else { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -switch ($parameter) { - case null: - return [ - 'foo' => in_array( - 'foo', - [] - ), - ]; - - default: - return []; -} - -class SomeClass -{ - public function someFunc() - { - a(function () { - echo "a"; - })->b(function () { - echo "b"; - }); - - if (true) { - echo "c"; - } - echo "d"; - } -} - -$params = self::validate_parameters(self::read_competency_framework_parameters(), - array( - 'id' => $id, - )); - -$framework = api::read_framework($params['id']); -self::validate_context($framework->get_context()); -$output = $PAGE->get_renderer('tool_lp'); - -class Test123 -{ - protected static - $prop1 = [ - 'testA' => 123, - ], - $prop2 = [ - 'testB' => 456, - ]; - - protected static - $prop3 = array( - 'testA' => 123, - ), - $prop4 = array( - 'testB' => 456, - ); - - protected static $prop5; -} - -$foo = foo( - function () { - $foo->debug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -if (somethingIsTrue()) { - ?> -
    - -
    - bar(foo(function () { - }), foo(function () { - })); - -echo 'foo'; - -class Test { - - public function a() { - ?>adebug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -function test() -{ - $array = []; - foreach ($array as $data) { - [ - 'key1' => $var1, - 'key2' => $var2, - ] = $data; - foreach ($var1 as $method) { - echo $method . $var2; - } - } -} - -switch ($a) { - case 0: - $a = function () { - }; - case 1: - break; -} - -class Test -{ - public function __construct() - { -if (false) { -echo 0; - } - } -} - -return [ - 'veryLongKeySoIWantToMakeALineBreak' - => 'veryLonValueSoIWantToMakeALineBreak', - - 'someOtherKey' => [ - 'someValue' - ], - - 'arrayWithArraysInThere' => [ - ['Value1', 'Value1'] - ], -]; - -switch ($sContext) { - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -array_map( - static function ( $item ) { - echo $item; - }, - $some_array -); - -/** - * Comment. - */ -$a(function () use ($app) { - echo 'hi'; -})(); - -$app->run(); - -function foo() -{ - $foo('some - long description', function () { - }); - - $foo('some - long - description', function () { - }); - - $foo( -'some long description', function () { - }); -} - -switch ( $a ) { -case 'a': - $b = 2; - /** - * A comment. - */ - apply_filter( 'something', $b ); - break; - -case 'aa': - $b = 2; - /* - * A comment. - */ - apply_filter( 'something', $b ); - break; - -case 'b': - $b = 3; -?> - - - - - -
    - -
    - -
    - -
    - - -
    - - - -
    - [ - ], - 'b' => <<<'FOO' -foo; -FOO - ], - $a, -]; - -$query = Model::query() - ->when($a, function () { - static $b = ''; - }); - -$result = array_map( - static fn(int $number) : int => $number + 1, - $numbers -); - -$a = $a === true ? [ - 'a' => 1, - ] : [ - 'a' => 100, -]; - -return [ - Url::make('View Song', fn($song) => $song->url()) - ->onlyOnDetail(), - - new Panel('Information', [ - Text::make('Title') - ]), -]; - -echo $string?->append('foo') - ?->outputUsing(); - -// phpcs:set Generic.WhiteSpace.ScopeIndent exact true -echo $string?->append('foo') - ?->outputUsing(); -// phpcs:set Generic.WhiteSpace.ScopeIndent exact false - -if (true) { - ?> null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ($value) { - '' => null, -false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ( - $value - ) { - '' => null, - false - => false, - 1, - 2, - 3 => true, - default => -$value, -}; - -function toString(): string -{ - return sprintf( - '%s', - match ($type) { - 'foo' => 'bar', - }, - ); -} - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - }, - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - $list2 = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } - ]; - } - } -]; - -$foo = match ($type) { - 'a' => [ - 'aa' => 'DESC', - 'ab' => 'DESC', - ], - 'b' => [ - 'ba' => 'DESC', - 'bb' => 'DESC', - ], - default => [ - 'da' => 'DESC', - ], -}; - -$a = [ - 'a' => [ - 'a' => fn () => foo() - ], - 'a' => [ - 'a' => 'a', - ] -]; - -switch ($foo) { - case 'a': - $foo = match ($foo) { - 'bar' => 'custom_1', - default => 'a' - }; - return $foo; - case 'b': - return match ($foo) { - 'bar' => 'custom_1', - default => 'b' - }; - default: - return 'default'; -} - -foo(function ($foo) { - return [ - match ($foo) { - } - ]; -}); - -// Issue #110. -echo match (1) { - 0 => match (2) { - 2 => match (3) { - 3 => 3, - default => -1, - }, - }, - 1 => match (2) { - 1 => match (3) { - 3 => 3, - default => -1, - }, - 2 => match (3) { - 3 => 3, - default => -1, - }, - }, -}; - -// Issue #437. -match (true) { - default => [ - 'unrelated' => '', - 'example' => array_filter( - array_map( - function () { - return null; - }, - [] - ) - ) - ] -}; - -/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ -?> - - - - - - - <<<'INTRO' - lorem ipsum - INTRO, - 'em' => [ - [ - '', - ], - ], - 'abc' => [ - 'a' => 'wop wop', - 'b' => 'ola ola.', - ], -]; - -echo "" diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed deleted file mode 100644 index dbbfa71c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed +++ /dev/null @@ -1,1653 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false - -hello(); - } - - function hello() - { - echo 'hello'; - }//end hello() - - function hello2() - { - if (TRUE) { - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; - } - - while (TRUE) { - echo 'hello'; - } - - do { - echo 'hello'; - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -    $safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* This is a T_COMMENT - * - * - * - */ - - /** This is a T_DOC_COMMENT - */ - - /* - This T_COMMENT has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - - - - doSomething( - function () { - echo 123; - } - ); - } -} - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -$myFunction = function() { - $a = 403; - if ($a === 404) { - $a = 403; - } -}; - -class Whatever -{ - protected $_protectedArray = array( - 'normalString' => 'That email address is already in use!', - 'offendingString' => <<<'STRING' -Each line of this string is always said to be at column 0, - no matter how many spaces are placed - at the beginning of each line -and the ending STRING on the next line is reported as having to be indented. -STRING - ); -} - -class MyClass -{ - public static function myFunction() - { - if (empty($keywords) === FALSE) { - $keywords = 'foo'; - $existing = 'foo'; - } - - return $keywords; - - }//end myFunction() - -}//end class - -$var = call_user_func( - $new_var = function () use (&$a) { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - } -); - -class AnonymousFn -{ - public function getAnonFn() - { - return array( - 'functions' => Array( - 'function1' => function ($a, $b, $c) { - $a = $b + $c; - $b = $c / 2; - return Array($a, $b, $c); - }, - ), - ); - } -} -?> - -
    - -
    -
    - -
    -
    - -
    - - "") { - $test = true; - } else { - $test = true; - } - } - ?> - - - -
    -
    -
    - -
    -
    -
    - - -

    some text

    - function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -if ($foo) { - foreach ($bar as $baz) { - if ($baz) { - ?> -
    -
    -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - -<?= CHtml::encode($this->pageTitle); ?> - -expects($this->at(2)) - ->with($this->callback( - function ($subject) - { - } - ) - ); - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -echo $string->append('foo') - ->appaend('bar') - ->appaend('baz') - ->outputUsing( - function () - { - } - ); - -echo PHP_EOL; - -switch ($arg) { - case 1: - break; - case 2: - if ($arg2 == 'foo') { - } - case 3: - default: - echo 'default'; -} - -if ($tokens[$stackPtr]['content']{0} === '#') { -} else if ($tokens[$stackPtr]['content']{0} === '/' - && $tokens[$stackPtr]['content']{1} === '/' -) { -} - -$var = call_user_func( - function() { - if ($foo) { - $new_var = function() { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - }; - } - } -); - -a( - function() { - $a = function() { - $b = false; - }; - true; - } -); - -$var = [ - [ - '1' => - function () { - return true; - }, - ], - [ - '1' => - function () { - return true; - }, - '2' => true, - ] -]; - -if ($foo) { - ?> -

    - self::_replaceKeywords($failingComment, $result), - 'screenshot' => Test::getScreenshotPath( - $projectid, - $result['class_name'], - ), - ); - -} - -$this->mockedDatabase - ->with( - $this->callback( - function () { - return; - } - ) - ); - -$this->subject->recordLogin(); - -function a() -{ - if (true) { - static::$a[$b] = - static::where($c) - ->where($c) - ->where( - function ($d) { - $d->whereNull(); - $d->orWhere(); - } - ) - ->first(); - - if (static::$a[$b] === null) { - static::$a[$b] = new static( - array( - 'a' => $a->id, - 'a' => $a->id, - ) - ); - } - } - - return static::$a[$b]; -} - -$foo->load( - array( - 'bar' => function ($baz) { - $baz->call(); - } - ) -); - -hello(); - -$foo = array_unique( - array_map( - function ($entry) { - return $entry * 2; - }, - array() - ) -); -bar($foo); - -class PHP_CodeSniffer_Tokenizers_JS -{ - - public $scopeOpeners = array( - T_CASE => array( - 'end' => array( - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - ), - 'strict' => true, - ), - ); -} - -echo $string-> - append('foo')-> - appaend('bar')-> - appaend('baz')-> - outputUsing( - function () - { - } - ); - -$str = 'the items I want to show are: ' . - implode( - ', ', - array('a', 'b', 'c') - ); - -echo $str; - -$str = 'foo' - . '1' - . '2'; - -echo $str; - -bar([ - 'foo' => foo(function () { - return 'foo'; - }) -]); - -$domains = array_unique( - array_map( - function ($url) { - $urlObject = new \Purl\Url($url); - return $urlObject->registerableDomain; - }, - $sites - ) -); - -return $domains; - -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; - -if ($foo): - if ($bar) $foo = 1; - elseif ($baz) $foo = 2; -endif; - -$this - ->method(array( - 'foo' => 'bar', - ), 'arg', array( - 'foo' => 'bar', - )); - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -foo(); - -array( - 'key1' => function ($bar) { - return $bar; - }, - 'key2' => function ($foo) { - return $foo; - }, -); - -?> - - 1, - ]; -$c = 2; - -class foo -{ - public function get() - { - $foo = ['b' => 'c', - 'd' => [ - ['e' => 'f'] - ]]; - echo '42'; - - $foo = array('b' => 'c', - 'd' => array( - array('e' => 'f') - )); - echo '42'; - } -} - -switch ($foo) { - case 1: - return array(); - case 2: - return ''; - case 3: - return $function(); - case 4: - return $functionCall($param[0]); - case 5: - return array() + array(); // Array Merge - case 6: - // String connect - return $functionReturningString('') . $functionReturningString(array()); - case 7: - return functionCall( - $withMultiLineParam[0], - array(), - $functionReturningString( - $withMultiLineParam[1] - ) - ); - case 8: - return $param[0][0]; -} - -class Test { - - public - $foo - ,$bar - ,$baz = [ ] - ; - - public function wtfindent() { - } -} - -switch ($x) { - case 1: - return [1]; - default: - return [2]; -} - -switch ($foo) { - case self::FOO: - return $this->bar($gfoo, function ($id) { - return FOO::bar($id); - }, $values); - case self::BAR: - $values = $this->bar($foo, $values); - break; -} - -$var = array( - 'long description' => - array(0, 'something'), - 'another long description' => - array(1, "something else") -); - -$services = array( - 'service 1' => - Mockery::mock('class 1') - ->shouldReceive('setFilter')->once() - ->shouldReceive('getNbResults')->atLeast()->once() - ->shouldReceive('getSlice')->once()->andReturn(array()) - ->getMock(), - 'service 2' => - Mockery::mock('class 2') - ->shouldReceive('__invoke')->once() - ->getMock() -); - -class Foo -{ - public function setUp() - { - $this->foo = new class { - public $name = 'Some value'; - }; - } -} - -try { - foo(); -} catch (\Exception $e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -if ($foo) { - foo(); -} else if ($e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} else { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -switch ($parameter) { - case null: - return [ - 'foo' => in_array( - 'foo', - [] - ), - ]; - - default: - return []; -} - -class SomeClass -{ - public function someFunc() - { - a(function () { - echo "a"; - })->b(function () { - echo "b"; - }); - - if (true) { - echo "c"; - } - echo "d"; - } -} - -$params = self::validate_parameters(self::read_competency_framework_parameters(), - array( - 'id' => $id, - )); - -$framework = api::read_framework($params['id']); -self::validate_context($framework->get_context()); -$output = $PAGE->get_renderer('tool_lp'); - -class Test123 -{ - protected static - $prop1 = [ - 'testA' => 123, - ], - $prop2 = [ - 'testB' => 456, - ]; - - protected static - $prop3 = array( - 'testA' => 123, - ), - $prop4 = array( - 'testB' => 456, - ); - - protected static $prop5; -} - -$foo = foo( - function () { - $foo->debug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -if (somethingIsTrue()) { - ?> -
    - -
    - bar(foo(function () { - }), foo(function () { - })); - -echo 'foo'; - -class Test { - - public function a() { - ?>adebug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -function test() -{ - $array = []; - foreach ($array as $data) { - [ - 'key1' => $var1, - 'key2' => $var2, - ] = $data; - foreach ($var1 as $method) { - echo $method . $var2; - } - } -} - -switch ($a) { - case 0: - $a = function () { - }; - case 1: - break; -} - -class Test -{ - public function __construct() - { - if (false) { - echo 0; - } - } -} - -return [ - 'veryLongKeySoIWantToMakeALineBreak' - => 'veryLonValueSoIWantToMakeALineBreak', - - 'someOtherKey' => [ - 'someValue' - ], - - 'arrayWithArraysInThere' => [ - ['Value1', 'Value1'] - ], -]; - -switch ($sContext) { - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -array_map( - static function ( $item ) { - echo $item; - }, - $some_array -); - -/** - * Comment. - */ -$a(function () use ($app) { - echo 'hi'; -})(); - -$app->run(); - -function foo() -{ - $foo('some - long description', function () { - }); - - $foo('some - long - description', function () { - }); - - $foo( - 'some long description', function () { - }); -} - -switch ( $a ) { - case 'a': - $b = 2; - /** - * A comment. - */ - apply_filter( 'something', $b ); - break; - - case 'aa': - $b = 2; - /* - * A comment. - */ - apply_filter( 'something', $b ); - break; - - case 'b': - $b = 3; - ?> - - - - - -
    - -
    - -
    - -
    - - -
    - - - -
    - [ - ], - 'b' => <<<'FOO' -foo; -FOO - ], - $a, -]; - -$query = Model::query() - ->when($a, function () { - static $b = ''; - }); - -$result = array_map( - static fn(int $number) : int => $number + 1, - $numbers -); - -$a = $a === true ? [ - 'a' => 1, - ] : [ - 'a' => 100, -]; - -return [ - Url::make('View Song', fn($song) => $song->url()) - ->onlyOnDetail(), - - new Panel('Information', [ - Text::make('Title') - ]), -]; - -echo $string?->append('foo') - ?->outputUsing(); - -// phpcs:set Generic.WhiteSpace.ScopeIndent exact true -echo $string?->append('foo') - ?->outputUsing(); -// phpcs:set Generic.WhiteSpace.ScopeIndent exact false - -if (true) { - ?> null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ($value) { - '' => null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ( - $value - ) { - '' => null, - false - => false, - 1, - 2, - 3 => true, - default => - $value, -}; - -function toString(): string -{ - return sprintf( - '%s', - match ($type) { - 'foo' => 'bar', - }, - ); -} - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - }, - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - $list2 = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } - ]; - } - } -]; - -$foo = match ($type) { - 'a' => [ - 'aa' => 'DESC', - 'ab' => 'DESC', - ], - 'b' => [ - 'ba' => 'DESC', - 'bb' => 'DESC', - ], - default => [ - 'da' => 'DESC', - ], -}; - -$a = [ - 'a' => [ - 'a' => fn () => foo() - ], - 'a' => [ - 'a' => 'a', - ] -]; - -switch ($foo) { - case 'a': - $foo = match ($foo) { - 'bar' => 'custom_1', - default => 'a' - }; - return $foo; - case 'b': - return match ($foo) { - 'bar' => 'custom_1', - default => 'b' - }; - default: - return 'default'; -} - -foo(function ($foo) { - return [ - match ($foo) { - } - ]; -}); - -// Issue #110. -echo match (1) { - 0 => match (2) { - 2 => match (3) { - 3 => 3, - default => -1, - }, - }, - 1 => match (2) { - 1 => match (3) { - 3 => 3, - default => -1, - }, - 2 => match (3) { - 3 => 3, - default => -1, - }, - }, -}; - -// Issue #437. -match (true) { - default => [ - 'unrelated' => '', - 'example' => array_filter( - array_map( - function () { - return null; - }, - [] - ) - ) - ] -}; - -/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ -?> - - - - - - - <<<'INTRO' - lorem ipsum - INTRO, - 'em' => [ - [ - '', - ], - ], - 'abc' => [ - 'a' => 'wop wop', - 'b' => 'ola ola.', - ], -]; - -echo "" diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js deleted file mode 100644 index 2195bfb9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js +++ /dev/null @@ -1,239 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false -var script = document.createElement('script'); -script.onload = function() -{ - clearTimeout(t); - script456.onload = null; - script.onreadystatechange = null; - callback.call(this); - -}; - -this.callbacks[type] = { - namespaces: {}, -others: [] -}; - -blah = function() -{ - print something; - - } - -test(blah, function() { - print something; -}); - -var test = [{x: 10}]; -var test = [{ - x: 10, - y: { - b14h: 12, - 'b14h': 12 - }, - z: 23 -}]; - -Viper.prototype = { - - _removeEvents: function(elem) - { - if (!elem) { - elem = this.element; - } - - ViperUtil.removeEvent(elem, '.' + this.getEventNamespace()); - - } - -}; - -this.init = function(data) { - if (_pageListWdgt) { - GUI.getWidget('changedPagesList').addItemClickedCallback( - function(itemid, target) { - draftChangeTypeClicked( - itemid, - target, - { - reviewData: _reviewData, - pageid: itemid - } - ); - } - ); - }//end if - -}; - -a( - function() { - var _a = function() { - b = false; - - }; - true - } -); - -(function() { - a = function() { - a(function() { - if (true) { - a = true; - } - }); - - a( - function() { - if (true) { - if (true) { - a = true; - } - } - } - ); - - a( - function() { - if (true) { - a = true; - } - } - ); - - }; - -})(); - -a.prototype = { - - a: function() - { - var currentSize = null; - ViperUtil.addEvent( - header, - 'safedblclick', - function() {}, - ); - - if (topContent) { - ViperUtil.addClass(topContent, 'Viper-popup-top'); - main.appendChild(topContent); - } - - ViperUtil.addClass(midContent, 'Viper-popup-content'); - main.appendChild(midContent); - } - -}; - -a.prototype = { - - a: function() - { - ViperUtil.addClass(midContent, 'Viper-popup-content'); - main.appendChild(midContent); - - var mouseUpAction = function() {}; - var preventMouseUp = false; - var self = this; - if (clickAction) { - } - } - -}; - -a.prototype = { - - a: function() - { - var a = function() { - var a = 'foo'; - }; - - if (true) { - } - - }, - - b: function() - { - ViperUtil.addEvent( - function() { - if (fullScreen !== true) { - currentSize = { - }; - - showfullScreen(); - } - } - ); - - }, - - c: function() - { - this.a( - { - a: function() { - form.onsubmit = function() { - return false; - }; - - var a = true; - } - } - ); - - } - -}; - -a.prototype = { - init: function() - {}, - - _b: function() - { - } - -}; - -for (var i = 0; i < 10; i++) { - var foo = {foo:{'a':'b', - 'c':'d'}}; -} - -class TestOk -{ - destroy() - { - setTimeout(a, 1000); - - if (typeof self.callbackOnClose === "function") { - self.callbackOnClose(); - } - } -} - -class TestBad -{ - destroy() - { - setTimeout(function () { - return; - }, 1000); - - if (typeof self.callbackOnClose === "function") { - self.callbackOnClose(); - } - } -} - -( function( $ ) { - foo(function( value ) { - value.bind( function( newval ) { - $( '#bar' ).html( newval ); - } ); - } )( jQuery ); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed deleted file mode 100644 index d4bf409b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js.fixed +++ /dev/null @@ -1,239 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false -var script = document.createElement('script'); -script.onload = function() -{ - clearTimeout(t); - script456.onload = null; - script.onreadystatechange = null; - callback.call(this); - -}; - -this.callbacks[type] = { - namespaces: {}, - others: [] -}; - -blah = function() -{ - print something; - -} - -test(blah, function() { - print something; -}); - -var test = [{x: 10}]; -var test = [{ - x: 10, - y: { - b14h: 12, - 'b14h': 12 - }, - z: 23 -}]; - -Viper.prototype = { - - _removeEvents: function(elem) - { - if (!elem) { - elem = this.element; - } - - ViperUtil.removeEvent(elem, '.' + this.getEventNamespace()); - - } - -}; - -this.init = function(data) { - if (_pageListWdgt) { - GUI.getWidget('changedPagesList').addItemClickedCallback( - function(itemid, target) { - draftChangeTypeClicked( - itemid, - target, - { - reviewData: _reviewData, - pageid: itemid - } - ); - } - ); - }//end if - -}; - -a( - function() { - var _a = function() { - b = false; - - }; - true - } -); - -(function() { - a = function() { - a(function() { - if (true) { - a = true; - } - }); - - a( - function() { - if (true) { - if (true) { - a = true; - } - } - } - ); - - a( - function() { - if (true) { - a = true; - } - } - ); - - }; - -})(); - -a.prototype = { - - a: function() - { - var currentSize = null; - ViperUtil.addEvent( - header, - 'safedblclick', - function() {}, - ); - - if (topContent) { - ViperUtil.addClass(topContent, 'Viper-popup-top'); - main.appendChild(topContent); - } - - ViperUtil.addClass(midContent, 'Viper-popup-content'); - main.appendChild(midContent); - } - -}; - -a.prototype = { - - a: function() - { - ViperUtil.addClass(midContent, 'Viper-popup-content'); - main.appendChild(midContent); - - var mouseUpAction = function() {}; - var preventMouseUp = false; - var self = this; - if (clickAction) { - } - } - -}; - -a.prototype = { - - a: function() - { - var a = function() { - var a = 'foo'; - }; - - if (true) { - } - - }, - - b: function() - { - ViperUtil.addEvent( - function() { - if (fullScreen !== true) { - currentSize = { - }; - - showfullScreen(); - } - } - ); - - }, - - c: function() - { - this.a( - { - a: function() { - form.onsubmit = function() { - return false; - }; - - var a = true; - } - } - ); - - } - -}; - -a.prototype = { - init: function() - {}, - - _b: function() - { - } - -}; - -for (var i = 0; i < 10; i++) { - var foo = {foo:{'a':'b', - 'c':'d'}}; -} - -class TestOk -{ - destroy() - { - setTimeout(a, 1000); - - if (typeof self.callbackOnClose === "function") { - self.callbackOnClose(); - } - } -} - -class TestBad -{ - destroy() - { - setTimeout(function () { - return; - }, 1000); - - if (typeof self.callbackOnClose === "function") { - self.callbackOnClose(); - } - } -} - -( function( $ ) { - foo(function( value ) { - value.bind( function( newval ) { - $( '#bar' ).html( newval ); - } ); - } )( jQuery ); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc deleted file mode 100644 index de344f9f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc +++ /dev/null @@ -1,1653 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent true - -hello(); - } - - function hello() - { - echo 'hello'; -}//end hello() - - function hello2() - { - if (TRUE) { - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; - } - - while (TRUE) { - echo 'hello'; - } - - do { - echo 'hello'; - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -	$safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* This is a T_COMMENT - * - * - * - */ - - /** This is a T_DOC_COMMENT - */ - - /* - This T_COMMENT has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - - - - doSomething( - function () { - echo 123; - } - ); - } -} - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -$myFunction = function() { - $a = 403; - if ($a === 404) { - $a = 403; - } -}; - -class Whatever -{ - protected $_protectedArray = array( - 'normalString' => 'That email address is already in use!', - 'offendingString' => <<<'STRING' -Each line of this string is always said to be at column 0, - no matter how many spaces are placed - at the beginning of each line -and the ending STRING on the next line is reported as having to be indented. -STRING - ); -} - -class MyClass -{ - public static function myFunction() - { - if (empty($keywords) === FALSE) { - $keywords = 'foo'; - $existing = 'foo'; - } - - return $keywords; - - }//end myFunction() - -}//end class - -$var = call_user_func( - $new_var = function () use (&$a) { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - } -); - -class AnonymousFn -{ - public function getAnonFn() - { - return array( - 'functions' => Array( - 'function1' => function ($a, $b, $c) { - $a = $b + $c; - $b = $c / 2; - return Array($a, $b, $c); - }, - ), - ); - } -} -?> - -
    - -
    -
    - -
    -
    - -
    - - "") { - $test = true; - } else { - $test = true; - } - } - ?> - - - -
    -
    -
    - -
    -
    -
    - - -

    some text

    - function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -if ($foo) { - foreach ($bar as $baz) { - if ($baz) { - ?> -
    -
    -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - -<?= CHtml::encode($this->pageTitle); ?> - -expects($this->at(2)) - ->with($this->callback( - function ($subject) - { - } - ) - ); - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -echo $string->append('foo') - ->appaend('bar') - ->appaend('baz') - ->outputUsing( - function () - { - } - ); - -echo PHP_EOL; - -switch ($arg) { - case 1: - break; - case 2: - if ($arg2 == 'foo') { - } - case 3: - default: - echo 'default'; -} - -if ($tokens[$stackPtr]['content']{0} === '#') { -} else if ($tokens[$stackPtr]['content']{0} === '/' - && $tokens[$stackPtr]['content']{1} === '/' -) { -} - -$var = call_user_func( - function() { - if ($foo) { - $new_var = function() { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - }; - } - } -); - -a( - function() { - $a = function() { - $b = false; - }; - true; - } -); - -$var = [ - [ - '1' => - function () { - return true; - }, - ], - [ - '1' => - function () { - return true; - }, - '2' => true, - ] -]; - -if ($foo) { - ?> -

    - self::_replaceKeywords($failingComment, $result), - 'screenshot' => Test::getScreenshotPath( - $projectid, - $result['class_name'], - ), - ); - -} - -$this->mockedDatabase - ->with( - $this->callback( - function () { - return; - } - ) - ); - -$this->subject->recordLogin(); - -function a() -{ - if (true) { - static::$a[$b] = - static::where($c) - ->where($c) - ->where( - function ($d) { - $d->whereNull(); - $d->orWhere(); - } - ) - ->first(); - - if (static::$a[$b] === null) { - static::$a[$b] = new static( - array( - 'a' => $a->id, - 'a' => $a->id, - ) - ); - } - } - - return static::$a[$b]; -} - -$foo->load( - array( - 'bar' => function ($baz) { - $baz->call(); - } - ) -); - -hello(); - -$foo = array_unique( - array_map( - function ($entry) { - return $entry * 2; - }, - array() - ) -); -bar($foo); - -class PHP_CodeSniffer_Tokenizers_JS -{ - - public $scopeOpeners = array( - T_CASE => array( - 'end' => array( - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - ), - 'strict' => true, - ), - ); -} - -echo $string-> - append('foo')-> - appaend('bar')-> - appaend('baz')-> - outputUsing( - function () - { - } - ); - -$str = 'the items I want to show are: ' . - implode( - ', ', - array('a', 'b', 'c') - ); - -echo $str; - -$str = 'foo' - . '1' - . '2'; - -echo $str; - -bar([ - 'foo' => foo(function () { - return 'foo'; - }) -]); - -$domains = array_unique( - array_map( - function ($url) { - $urlObject = new \Purl\Url($url); - return $urlObject->registerableDomain; - }, - $sites - ) -); - -return $domains; - -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; - -if ($foo): -if ($bar) $foo = 1; -elseif ($baz) $foo = 2; -endif; - -$this - ->method(array( - 'foo' => 'bar', - ), 'arg', array( - 'foo' => 'bar', - )); - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -foo(); - -array( - 'key1' => function ($bar) { - return $bar; - }, - 'key2' => function ($foo) { - return $foo; - }, -); - -?> - - 1, - ]; -$c = 2; - -class foo -{ - public function get() - { - $foo = ['b' => 'c', - 'd' => [ - ['e' => 'f'] - ]]; - echo '42'; - - $foo = array('b' => 'c', - 'd' => array( - array('e' => 'f') - )); - echo '42'; - } -} - -switch ($foo) { - case 1: - return array(); - case 2: - return ''; - case 3: - return $function(); - case 4: - return $functionCall($param[0]); - case 5: - return array() + array(); // Array Merge - case 6: - // String connect - return $functionReturningString('') . $functionReturningString(array()); - case 7: - return functionCall( - $withMultiLineParam[0], - array(), - $functionReturningString( - $withMultiLineParam[1] - ) - ); - case 8: - return $param[0][0]; -} - -class Test { - - public - $foo - ,$bar - ,$baz = [ ] - ; - - public function wtfindent() { - } -} - -switch ($x) { - case 1: - return [1]; - default: - return [2]; -} - -switch ($foo) { - case self::FOO: - return $this->bar($gfoo, function ($id) { - return FOO::bar($id); - }, $values); - case self::BAR: - $values = $this->bar($foo, $values); - break; -} - -$var = array( - 'long description' => - array(0, 'something'), - 'another long description' => - array(1, "something else") -); - -$services = array( - 'service 1' => - Mockery::mock('class 1') - ->shouldReceive('setFilter')->once() - ->shouldReceive('getNbResults')->atLeast()->once() - ->shouldReceive('getSlice')->once()->andReturn(array()) - ->getMock(), - 'service 2' => - Mockery::mock('class 2') - ->shouldReceive('__invoke')->once() - ->getMock() -); - -class Foo -{ - public function setUp() - { - $this->foo = new class { - public $name = 'Some value'; - }; - } -} - -try { - foo(); -} catch (\Exception $e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -if ($foo) { - foo(); -} else if ($e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} else { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -switch ($parameter) { - case null: - return [ - 'foo' => in_array( - 'foo', - [] - ), - ]; - - default: - return []; -} - -class SomeClass -{ - public function someFunc() - { - a(function () { - echo "a"; - })->b(function () { - echo "b"; - }); - - if (true) { - echo "c"; - } - echo "d"; - } -} - -$params = self::validate_parameters(self::read_competency_framework_parameters(), - array( - 'id' => $id, - )); - -$framework = api::read_framework($params['id']); -self::validate_context($framework->get_context()); -$output = $PAGE->get_renderer('tool_lp'); - -class Test123 -{ - protected static - $prop1 = [ - 'testA' => 123, - ], - $prop2 = [ - 'testB' => 456, - ]; - - protected static - $prop3 = array( - 'testA' => 123, - ), - $prop4 = array( - 'testB' => 456, - ); - - protected static $prop5; -} - -$foo = foo( - function () { - $foo->debug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -if (somethingIsTrue()) { - ?> -
    - -
    - bar(foo(function () { - }), foo(function () { - })); - -echo 'foo'; - -class Test { - - public function a() { - ?>adebug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -function test() -{ - $array = []; - foreach ($array as $data) { - [ - 'key1' => $var1, - 'key2' => $var2, - ] = $data; - foreach ($var1 as $method) { - echo $method . $var2; - } - } -} - -switch ($a) { - case 0: - $a = function () { - }; - case 1: - break; -} - -class Test -{ - public function __construct() - { -if (false) { -echo 0; - } - } -} - -return [ - 'veryLongKeySoIWantToMakeALineBreak' - => 'veryLonValueSoIWantToMakeALineBreak', - - 'someOtherKey' => [ - 'someValue' - ], - - 'arrayWithArraysInThere' => [ - ['Value1', 'Value1'] - ], -]; - -switch ($sContext) { - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -array_map( - static function ( $item ) { - echo $item; - }, - $some_array -); - -/** - * Comment. - */ -$a(function () use ($app) { - echo 'hi'; -})(); - -$app->run(); - -function foo() -{ - $foo('some - long description', function () { - }); - - $foo('some - long - description', function () { - }); - - $foo( -'some long description', function () { - }); -} - -switch ( $a ) { -case 'a': - $b = 2; - /** - * A comment. - */ - apply_filter( 'something', $b ); - break; - -case 'aa': - $b = 2; - /* - * A comment. - */ - apply_filter( 'something', $b ); - break; - -case 'b': - $b = 3; -?> - - - - - -
    - -
    - -
    - -
    - - -
    - - - -
    - [ - ], - 'b' => <<<'FOO' -foo; -FOO - ], - $a, -]; - -$query = Model::query() - ->when($a, function () { - static $b = ''; - }); - -$result = array_map( - static fn(int $number) : int => $number + 1, - $numbers -); - -$a = $a === true ? [ - 'a' => 1, - ] : [ - 'a' => 100, -]; - -return [ - Url::make('View Song', fn($song) => $song->url()) - ->onlyOnDetail(), - - new Panel('Information', [ - Text::make('Title') - ]), -]; - -echo $string?->append('foo') - ?->outputUsing(); - -// phpcs:set Generic.WhiteSpace.ScopeIndent exact true -echo $string?->append('foo') - ?->outputUsing(); -// phpcs:set Generic.WhiteSpace.ScopeIndent exact false - -if (true) { - ?> null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ($value) { - '' => null, -false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ( - $value - ) { - '' => null, - false - => false, - 1, - 2, - 3 => true, - default => -$value, -}; - -function toString(): string -{ - return sprintf( - '%s', - match ($type) { - 'foo' => 'bar', - }, - ); -} - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - }, - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - $list2 = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } - ]; - } - } -]; - -$foo = match ($type) { - 'a' => [ - 'aa' => 'DESC', - 'ab' => 'DESC', - ], - 'b' => [ - 'ba' => 'DESC', - 'bb' => 'DESC', - ], - default => [ - 'da' => 'DESC', - ], -}; - -$a = [ - 'a' => [ - 'a' => fn () => foo() - ], - 'a' => [ - 'a' => 'a', - ] -]; - -switch ($foo) { - case 'a': - $foo = match ($foo) { - 'bar' => 'custom_1', - default => 'a' - }; - return $foo; - case 'b': - return match ($foo) { - 'bar' => 'custom_1', - default => 'b' - }; - default: - return 'default'; -} - -foo(function ($foo) { - return [ - match ($foo) { - } - ]; -}); - -// Issue #110. -echo match (1) { - 0 => match (2) { - 2 => match (3) { - 3 => 3, - default => -1, - }, - }, - 1 => match (2) { - 1 => match (3) { - 3 => 3, - default => -1, - }, - 2 => match (3) { - 3 => 3, - default => -1, - }, - }, -}; - -// Issue #437. -match (true) { - default => [ - 'unrelated' => '', - 'example' => array_filter( - array_map( - function () { - return null; - }, - [] - ) - ) - ] -}; - -/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ -?> - - - - - - - <<<'INTRO' - lorem ipsum - INTRO, - 'em' => [ - [ - '', - ], - ], - 'abc' => [ - 'a' => 'wop wop', - 'b' => 'ola ola.', - ], -]; - -echo "" diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed deleted file mode 100644 index 3cf7fb61..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed +++ /dev/null @@ -1,1653 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent true - -hello(); - } - - function hello() - { - echo 'hello'; - }//end hello() - - function hello2() - { - if (TRUE) { - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; - } - - while (TRUE) { - echo 'hello'; - } - - do { - echo 'hello'; - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -	$safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* This is a T_COMMENT - * - * - * - */ - - /** This is a T_DOC_COMMENT - */ - - /* - This T_COMMENT has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - - - - doSomething( - function () { - echo 123; - } - ); - } -} - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -some_function( - function() { - $a = 403; - if ($a === 404) { - $a = 403; - } - } -); - -$myFunction = function() { - $a = 403; - if ($a === 404) { - $a = 403; - } -}; - -class Whatever -{ - protected $_protectedArray = array( - 'normalString' => 'That email address is already in use!', - 'offendingString' => <<<'STRING' -Each line of this string is always said to be at column 0, - no matter how many spaces are placed - at the beginning of each line -and the ending STRING on the next line is reported as having to be indented. -STRING - ); -} - -class MyClass -{ - public static function myFunction() - { - if (empty($keywords) === FALSE) { - $keywords = 'foo'; - $existing = 'foo'; - } - - return $keywords; - - }//end myFunction() - -}//end class - -$var = call_user_func( - $new_var = function () use (&$a) { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - } -); - -class AnonymousFn -{ - public function getAnonFn() - { - return array( - 'functions' => Array( - 'function1' => function ($a, $b, $c) { - $a = $b + $c; - $b = $c / 2; - return Array($a, $b, $c); - }, - ), - ); - } -} -?> - -
    - -
    -
    - -
    -
    - -
    - - "") { - $test = true; - } else { - $test = true; - } - } - ?> - - - -
    -
    -
    - -
    -
    -
    - - -

    some text

    - function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } -]; - -if ($foo) { - foreach ($bar as $baz) { - if ($baz) { - ?> -
    -
    -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - 1) { - echo '1'; - } - ?> -
    - -<?= CHtml::encode($this->pageTitle); ?> - -expects($this->at(2)) - ->with($this->callback( - function ($subject) - { - } - ) - ); - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -echo $string->append('foo') - ->appaend('bar') - ->appaend('baz') - ->outputUsing( - function () - { - } - ); - -echo PHP_EOL; - -switch ($arg) { - case 1: - break; - case 2: - if ($arg2 == 'foo') { - } - case 3: - default: - echo 'default'; -} - -if ($tokens[$stackPtr]['content']{0} === '#') { -} else if ($tokens[$stackPtr]['content']{0} === '/' - && $tokens[$stackPtr]['content']{1} === '/' -) { -} - -$var = call_user_func( - function() { - if ($foo) { - $new_var = function() { - if ($a > 0) { - return $a++; - } else { - return $a--; - } - }; - } - } -); - -a( - function() { - $a = function() { - $b = false; - }; - true; - } -); - -$var = [ - [ - '1' => - function () { - return true; - }, - ], - [ - '1' => - function () { - return true; - }, - '2' => true, - ] -]; - -if ($foo) { - ?> -

    - self::_replaceKeywords($failingComment, $result), - 'screenshot' => Test::getScreenshotPath( - $projectid, - $result['class_name'], - ), - ); - -} - -$this->mockedDatabase - ->with( - $this->callback( - function () { - return; - } - ) - ); - -$this->subject->recordLogin(); - -function a() -{ - if (true) { - static::$a[$b] = - static::where($c) - ->where($c) - ->where( - function ($d) { - $d->whereNull(); - $d->orWhere(); - } - ) - ->first(); - - if (static::$a[$b] === null) { - static::$a[$b] = new static( - array( - 'a' => $a->id, - 'a' => $a->id, - ) - ); - } - } - - return static::$a[$b]; -} - -$foo->load( - array( - 'bar' => function ($baz) { - $baz->call(); - } - ) -); - -hello(); - -$foo = array_unique( - array_map( - function ($entry) { - return $entry * 2; - }, - array() - ) -); -bar($foo); - -class PHP_CodeSniffer_Tokenizers_JS -{ - - public $scopeOpeners = array( - T_CASE => array( - 'end' => array( - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - ), - 'strict' => true, - ), - ); -} - -echo $string-> - append('foo')-> - appaend('bar')-> - appaend('baz')-> - outputUsing( - function () - { - } - ); - -$str = 'the items I want to show are: ' . - implode( - ', ', - array('a', 'b', 'c') - ); - -echo $str; - -$str = 'foo' - . '1' - . '2'; - -echo $str; - -bar([ - 'foo' => foo(function () { - return 'foo'; - }) -]); - -$domains = array_unique( - array_map( - function ($url) { - $urlObject = new \Purl\Url($url); - return $urlObject->registerableDomain; - }, - $sites - ) -); - -return $domains; - -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; - -if ($foo): - if ($bar) $foo = 1; - elseif ($baz) $foo = 2; -endif; - -$this - ->method(array( - 'foo' => 'bar', - ), 'arg', array( - 'foo' => 'bar', - )); - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -class Foo -{ - use Bar { - myMethod as renamedMethod; - } -} - -foo(); - -array( - 'key1' => function ($bar) { - return $bar; - }, - 'key2' => function ($foo) { - return $foo; - }, -); - -?> - - 1, - ]; -$c = 2; - -class foo -{ - public function get() - { - $foo = ['b' => 'c', - 'd' => [ - ['e' => 'f'] - ]]; - echo '42'; - - $foo = array('b' => 'c', - 'd' => array( - array('e' => 'f') - )); - echo '42'; - } -} - -switch ($foo) { - case 1: - return array(); - case 2: - return ''; - case 3: - return $function(); - case 4: - return $functionCall($param[0]); - case 5: - return array() + array(); // Array Merge - case 6: - // String connect - return $functionReturningString('') . $functionReturningString(array()); - case 7: - return functionCall( - $withMultiLineParam[0], - array(), - $functionReturningString( - $withMultiLineParam[1] - ) - ); - case 8: - return $param[0][0]; -} - -class Test { - - public - $foo - ,$bar - ,$baz = [ ] - ; - - public function wtfindent() { - } -} - -switch ($x) { - case 1: - return [1]; - default: - return [2]; -} - -switch ($foo) { - case self::FOO: - return $this->bar($gfoo, function ($id) { - return FOO::bar($id); - }, $values); - case self::BAR: - $values = $this->bar($foo, $values); - break; -} - -$var = array( - 'long description' => - array(0, 'something'), - 'another long description' => - array(1, "something else") -); - -$services = array( - 'service 1' => - Mockery::mock('class 1') - ->shouldReceive('setFilter')->once() - ->shouldReceive('getNbResults')->atLeast()->once() - ->shouldReceive('getSlice')->once()->andReturn(array()) - ->getMock(), - 'service 2' => - Mockery::mock('class 2') - ->shouldReceive('__invoke')->once() - ->getMock() -); - -class Foo -{ - public function setUp() - { - $this->foo = new class { - public $name = 'Some value'; - }; - } -} - -try { - foo(); -} catch (\Exception $e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -if ($foo) { - foo(); -} else if ($e) { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} else { - $foo = function() { - return 'foo'; - }; - - if (true) { - } -} - -switch ($parameter) { - case null: - return [ - 'foo' => in_array( - 'foo', - [] - ), - ]; - - default: - return []; -} - -class SomeClass -{ - public function someFunc() - { - a(function () { - echo "a"; - })->b(function () { - echo "b"; - }); - - if (true) { - echo "c"; - } - echo "d"; - } -} - -$params = self::validate_parameters(self::read_competency_framework_parameters(), - array( - 'id' => $id, - )); - -$framework = api::read_framework($params['id']); -self::validate_context($framework->get_context()); -$output = $PAGE->get_renderer('tool_lp'); - -class Test123 -{ - protected static - $prop1 = [ - 'testA' => 123, - ], - $prop2 = [ - 'testB' => 456, - ]; - - protected static - $prop3 = array( - 'testA' => 123, - ), - $prop4 = array( - 'testB' => 456, - ); - - protected static $prop5; -} - -$foo = foo( - function () { - $foo->debug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -if (somethingIsTrue()) { - ?> -
    - -
    - bar(foo(function () { - }), foo(function () { - })); - -echo 'foo'; - -class Test { - - public function a() { - ?>adebug( - $a, - $b - ); - - if ($a) { - $b = $a; - } - } -); - -function test() -{ - $array = []; - foreach ($array as $data) { - [ - 'key1' => $var1, - 'key2' => $var2, - ] = $data; - foreach ($var1 as $method) { - echo $method . $var2; - } - } -} - -switch ($a) { - case 0: - $a = function () { - }; - case 1: - break; -} - -class Test -{ - public function __construct() - { - if (false) { - echo 0; - } - } -} - -return [ - 'veryLongKeySoIWantToMakeALineBreak' - => 'veryLonValueSoIWantToMakeALineBreak', - - 'someOtherKey' => [ - 'someValue' - ], - - 'arrayWithArraysInThere' => [ - ['Value1', 'Value1'] - ], -]; - -switch ($sContext) { - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -array_map( - static function ( $item ) { - echo $item; - }, - $some_array -); - -/** - * Comment. - */ -$a(function () use ($app) { - echo 'hi'; -})(); - -$app->run(); - -function foo() -{ - $foo('some - long description', function () { - }); - - $foo('some - long - description', function () { - }); - - $foo( - 'some long description', function () { - }); -} - -switch ( $a ) { - case 'a': - $b = 2; - /** - * A comment. - */ - apply_filter( 'something', $b ); - break; - - case 'aa': - $b = 2; - /* - * A comment. - */ - apply_filter( 'something', $b ); - break; - - case 'b': - $b = 3; - ?> - - - - - -
    - -
    - -
    - -
    - - -
    - - - -
    - [ - ], - 'b' => <<<'FOO' -foo; -FOO - ], - $a, -]; - -$query = Model::query() - ->when($a, function () { - static $b = ''; - }); - -$result = array_map( - static fn(int $number) : int => $number + 1, - $numbers -); - -$a = $a === true ? [ - 'a' => 1, - ] : [ - 'a' => 100, -]; - -return [ - Url::make('View Song', fn($song) => $song->url()) - ->onlyOnDetail(), - - new Panel('Information', [ - Text::make('Title') - ]), -]; - -echo $string?->append('foo') - ?->outputUsing(); - -// phpcs:set Generic.WhiteSpace.ScopeIndent exact true -echo $string?->append('foo') - ?->outputUsing(); -// phpcs:set Generic.WhiteSpace.ScopeIndent exact false - -if (true) { - ?> null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ($value) { - '' => null, - false => false, - 1, 2, 3 => true, - default => $value, -}; - -$value = match ( - $value - ) { - '' => null, - false - => false, - 1, - 2, - 3 => true, - default => - $value, -}; - -function toString(): string -{ - return sprintf( - '%s', - match ($type) { - 'foo' => 'bar', - }, - ); -} - -$list = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - }, - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - $list2 = [ - 'fn' => function ($a) { - if ($a === true) { - echo 'hi'; - } - } - ]; - } - } -]; - -$foo = match ($type) { - 'a' => [ - 'aa' => 'DESC', - 'ab' => 'DESC', - ], - 'b' => [ - 'ba' => 'DESC', - 'bb' => 'DESC', - ], - default => [ - 'da' => 'DESC', - ], -}; - -$a = [ - 'a' => [ - 'a' => fn () => foo() - ], - 'a' => [ - 'a' => 'a', - ] -]; - -switch ($foo) { - case 'a': - $foo = match ($foo) { - 'bar' => 'custom_1', - default => 'a' - }; - return $foo; - case 'b': - return match ($foo) { - 'bar' => 'custom_1', - default => 'b' - }; - default: - return 'default'; -} - -foo(function ($foo) { - return [ - match ($foo) { - } - ]; -}); - -// Issue #110. -echo match (1) { - 0 => match (2) { - 2 => match (3) { - 3 => 3, - default => -1, - }, - }, - 1 => match (2) { - 1 => match (3) { - 3 => 3, - default => -1, - }, - 2 => match (3) { - 3 => 3, - default => -1, - }, - }, -}; - -// Issue #437. -match (true) { - default => [ - 'unrelated' => '', - 'example' => array_filter( - array_map( - function () { - return null; - }, - [] - ) - ) - ] -}; - -/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */ -?> - - - - - - - <<<'INTRO' - lorem ipsum - INTRO, - 'em' => [ - [ - '', - ], - ], - 'abc' => [ - 'a' => 'wop wop', - 'b' => 'ola ola.', - ], -]; - -echo "" diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc deleted file mode 100644 index 55d1a06a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc +++ /dev/null @@ -1,28 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false -phpcs:set Generic.WhiteSpace.ScopeIndent exact true - $enabled, - 'compression' => $compression, - ] = $options; -} - -$this->foo() - ->bar() - ->baz(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed deleted file mode 100644 index e9ae5ff3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.3.inc.fixed +++ /dev/null @@ -1,28 +0,0 @@ -phpcs:set Generic.WhiteSpace.ScopeIndent tabIndent false -phpcs:set Generic.WhiteSpace.ScopeIndent exact true - $enabled, - 'compression' => $compression, - ] = $options; -} - -$this->foo() - ->bar() - ->baz(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc deleted file mode 100644 index e58dc4de..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.4.inc +++ /dev/null @@ -1,6 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ScopeIndent sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff - */ -final class ScopeIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - // Tab width setting is only needed for the tabbed file. - if ($testFile === 'ScopeIndentUnitTest.2.inc') { - $config->tabWidth = 4; - } else { - $config->tabWidth = 0; - } - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - if ($testFile === 'ScopeIndentUnitTest.1.js') { - return [ - 6 => 1, - 14 => 1, - 21 => 1, - 30 => 1, - 32 => 1, - 33 => 1, - 34 => 1, - 39 => 1, - 42 => 1, - 59 => 1, - 60 => 1, - 75 => 1, - 120 => 1, - 121 => 1, - 122 => 1, - 123 => 1, - 141 => 1, - 142 => 1, - 155 => 1, - 156 => 1, - 168 => 1, - 184 => 1, - ]; - }//end if - - if ($testFile === 'ScopeIndentUnitTest.3.inc') { - return [ - 6 => 1, - 7 => 1, - 10 => 1, - ]; - } - - if ($testFile === 'ScopeIndentUnitTest.4.inc') { - return []; - } - - return [ - 7 => 1, - 10 => 1, - 13 => 1, - 17 => 1, - 20 => 1, - 24 => 1, - 25 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 58 => 1, - 123 => 1, - 224 => 1, - 225 => 1, - 279 => 1, - 280 => 1, - 281 => 1, - 282 => 1, - 283 => 1, - 284 => 1, - 285 => 1, - 286 => 1, - 336 => 1, - 349 => 1, - 380 => 1, - 386 => 1, - 387 => 1, - 388 => 1, - 389 => 1, - 390 => 1, - 397 => 1, - 419 => 1, - 420 => 1, - 465 => 1, - 467 => 1, - 472 => 1, - 473 => 1, - 474 => 1, - 496 => 1, - 498 => 1, - 500 => 1, - 524 => 1, - 526 => 1, - 544 => 1, - 545 => 1, - 546 => 1, - 639 => 1, - 660 => 1, - 662 => 1, - 802 => 1, - 803 => 1, - 823 => 1, - 858 => 1, - 879 => 1, - 1163 => 1, - 1197 => 1, - 1198 => 1, - 1259 => 1, - 1264 => 1, - 1265 => 1, - 1266 => 1, - 1269 => 1, - 1272 => 1, - 1273 => 1, - 1274 => 1, - 1275 => 1, - 1276 => 1, - 1277 => 1, - 1280 => 1, - 1281 => 1, - 1282 => 1, - 1284 => 1, - 1285 => 1, - 1288 => 1, - 1289 => 1, - 1290 => 1, - 1292 => 1, - 1293 => 1, - 1310 => 1, - 1312 => 1, - 1327 => 1, - 1328 => 1, - 1329 => 1, - 1330 => 1, - 1331 => 1, - 1332 => 1, - 1335 => 1, - 1340 => 1, - 1342 => 1, - 1345 => 1, - 1488 => 1, - 1489 => 1, - 1500 => 1, - 1503 => 1, - 1518 => 1, - 1520 => 1, - 1527 => 1, - 1529 => 1, - 1530 => 1, - 1625 => 1, - 1626 => 1, - 1627 => 1, - 1628 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc deleted file mode 100644 index d30cd847..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.1.inc +++ /dev/null @@ -1,76 +0,0 @@ - - * @copyright 2019 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SpreadOperatorSpacingAfter sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\SpreadOperatorSpacingAfterSniff - */ -final class SpreadOperatorSpacingAfterUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'SpreadOperatorSpacingAfterUnitTest.1.inc': - return [ - 12 => 1, - 13 => 1, - 20 => 2, - 40 => 1, - 41 => 1, - 46 => 2, - 60 => 1, - 61 => 1, - 66 => 2, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml deleted file mode 100644 index 728426e6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Generic/ruleset.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - A collection of generic sniffs. This standard is not designed to be used to check code. - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php deleted file mode 100644 index 904769e1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php +++ /dev/null @@ -1,89 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\CSS; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class BrowserSpecificStylesSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * A list of specific stylesheet suffixes we allow. - * - * These stylesheets contain browser specific styles - * so this sniff ignore them files in the form: - * *_moz.css and *_ie7.css etc. - * - * @var array - */ - protected $specificStylesheets = [ - 'moz' => true, - 'ie' => true, - 'ie7' => true, - 'ie8' => true, - 'webkit' => true, - ]; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - // Ignore files with browser-specific suffixes. - $filename = $phpcsFile->getFilename(); - $breakChar = strrpos($filename, '_'); - if ($breakChar !== false && substr($filename, -4) === '.css') { - $specific = substr($filename, ($breakChar + 1), -4); - if (isset($this->specificStylesheets[$specific]) === true) { - return; - } - } - - $tokens = $phpcsFile->getTokens(); - $content = $tokens[$stackPtr]['content']; - - if ($content[0] === '-') { - $error = 'Browser-specific styles are not allowed'; - $phpcsFile->addError($error, $stackPtr, 'ForbiddenStyle'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php deleted file mode 100644 index 91004a84..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php +++ /dev/null @@ -1,127 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class DisallowSelfActionsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - // We are not interested in abstract classes. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($prev !== false && $tokens[$prev]['code'] === T_ABSTRACT) { - return; - } - - // We are only interested in Action classes. - $classNameToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $className = $tokens[$classNameToken]['content']; - if (substr($className, -7) !== 'Actions') { - return; - } - - $foundFunctions = []; - $foundCalls = []; - - // Find all static method calls in the form self::method() in the class. - $classEnd = $tokens[$stackPtr]['scope_closer']; - for ($i = ($classNameToken + 1); $i < $classEnd; $i++) { - if ($tokens[$i]['code'] !== T_DOUBLE_COLON) { - if ($tokens[$i]['code'] === T_FUNCTION) { - // Cache the function information. - $funcName = $phpcsFile->findNext(T_STRING, ($i + 1)); - $funcScope = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($i - 1)); - - $foundFunctions[$tokens[$funcName]['content']] = strtolower($tokens[$funcScope]['content']); - } - - continue; - } - - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), null, true); - if ($tokens[$prevToken]['content'] !== 'self' - && $tokens[$prevToken]['content'] !== 'static' - ) { - continue; - } - - $funcNameToken = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), null, true); - if ($tokens[$funcNameToken]['code'] === T_VARIABLE) { - // We are only interested in function calls. - continue; - } - - $funcName = $tokens[$funcNameToken]['content']; - - // We've found the function, now we need to find it and see if it is - // public, private or protected. If it starts with an underscore we - // can assume it is private. - if ($funcName[0] === '_') { - continue; - } - - $foundCalls[$i] = [ - 'name' => $funcName, - 'type' => strtolower($tokens[$prevToken]['content']), - ]; - }//end for - - $errorClassName = substr($className, 0, -7); - - foreach ($foundCalls as $token => $funcData) { - if (isset($foundFunctions[$funcData['name']]) === false) { - // Function was not in this class, might have come from the parent. - // Either way, we can't really check this. - continue; - } else if ($foundFunctions[$funcData['name']] === 'public') { - $type = $funcData['type']; - $error = "Static calls to public methods in Action classes must not use the $type keyword; use %s::%s() instead"; - $data = [ - $errorClassName, - $funcName, - ]; - $phpcsFile->addError($error, $token, 'Found'.ucfirst($funcData['type']), $data); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php deleted file mode 100644 index 83bb5ff3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php +++ /dev/null @@ -1,100 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class IncludeOwnSystemSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOUBLE_COLON]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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) - { - $fileName = $phpcsFile->getFilename(); - $matches = []; - if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|i', $fileName, $matches) === 0) { - // Not an actions file. - return; - } - - $ownClass = $matches[2]; - $tokens = $phpcsFile->getTokens(); - - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 2), null, false, true); - $typeName = trim($tokens[$typeName]['content'], " '"); - switch (strtolower($tokens[($stackPtr + 1)]['content'])) { - case 'includesystem' : - $included = strtolower($typeName); - break; - case 'includeasset' : - $included = strtolower($typeName).'assettype'; - break; - case 'includewidget' : - $included = strtolower($typeName).'widgettype'; - break; - default: - return; - } - - if ($included === strtolower($ownClass)) { - $error = "You do not need to include \"%s\" from within the system's own actions file"; - $data = [$ownClass]; - $phpcsFile->addError($error, $stackPtr, 'NotRequired', $data); - } - - }//end process() - - - /** - * Determines the included class name from given token. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param array $tokens The array of file tokens. - * @param int $stackPtr The position in the tokens array of the - * potentially included class. - * - * @return bool - */ - protected function getIncludedClassFromToken( - $phpcsFile, - array $tokens, - $stackPtr - ) { - - return false; - - }//end getIncludedClassFromToken() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php deleted file mode 100644 index 063dab4a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php +++ /dev/null @@ -1,316 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; - -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class IncludeSystemSniff extends AbstractScopeSniff -{ - - /** - * A list of classes that don't need to be included. - * - * @var array - */ - private $ignore = [ - 'self' => true, - 'static' => true, - 'parent' => true, - 'channels' => true, - 'basesystem' => true, - 'dal' => true, - 'init' => true, - 'pdo' => true, - 'util' => true, - 'ziparchive' => true, - 'phpunit_framework_assert' => true, - 'abstractmysourceunittest' => true, - 'abstractdatacleanunittest' => true, - 'exception' => true, - 'abstractwidgetwidgettype' => true, - 'domdocument' => true, - ]; - - - /** - * Constructs an AbstractScopeSniff. - */ - public function __construct() - { - parent::__construct([T_FUNCTION], [T_DOUBLE_COLON, T_EXTENDS], true); - - }//end __construct() - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param integer $stackPtr The position where the token was found. - * @param integer $currScope The current scope opener token. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine the name of the class that the static function - // is being called on. - $classNameToken = $phpcsFile->findPrevious( - T_WHITESPACE, - ($stackPtr - 1), - null, - true - ); - - // Don't process class names represented by variables as this can be - // an inexact science. - if ($tokens[$classNameToken]['code'] === T_VARIABLE) { - return; - } - - $className = $tokens[$classNameToken]['content']; - if (isset($this->ignore[strtolower($className)]) === true) { - return; - } - - $includedClasses = []; - - $fileName = strtolower($phpcsFile->getFilename()); - $matches = []; - if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|', $fileName, $matches) !== 0) { - // This is an actions file, which means we don't - // have to include the system in which it exists. - $includedClasses[$matches[2]] = true; - - // Or a system it implements. - $class = $phpcsFile->getCondition($stackPtr, T_CLASS); - $implements = $phpcsFile->findNext(T_IMPLEMENTS, $class, ($class + 10)); - if ($implements !== false) { - $implementsClass = $phpcsFile->findNext(T_STRING, $implements); - $implementsClassName = strtolower($tokens[$implementsClass]['content']); - if (substr($implementsClassName, -7) === 'actions') { - $includedClasses[substr($implementsClassName, 0, -7)] = true; - } - } - } - - // Go searching for includeSystem and includeAsset calls within this - // function, or the inclusion of .inc files, which - // would be library files. - for ($i = ($currScope + 1); $i < $stackPtr; $i++) { - $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); - if ($name !== false) { - $includedClasses[$name] = true; - // Special case for Widgets cause they are, well, special. - } else if (strtolower($tokens[$i]['content']) === 'includewidget') { - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($i + 1)); - $typeName = trim($tokens[$typeName]['content'], " '"); - $includedClasses[strtolower($typeName).'widgettype'] = true; - } - } - - // Now go searching for includeSystem, includeAsset or require/include - // calls outside our scope. If we are in a class, look outside the - // class. If we are not, look outside the function. - $condPtr = $currScope; - if ($phpcsFile->hasCondition($stackPtr, T_CLASS) === true) { - foreach ($tokens[$stackPtr]['conditions'] as $condPtr => $condType) { - if ($condType === T_CLASS) { - break; - } - } - } - - for ($i = 0; $i < $condPtr; $i++) { - // Skip other scopes. - if (isset($tokens[$i]['scope_closer']) === true) { - $i = $tokens[$i]['scope_closer']; - continue; - } - - $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); - if ($name !== false) { - $includedClasses[$name] = true; - } - } - - // If we are in a testing class, we might have also included - // some systems and classes in our setUp() method. - $setupFunction = null; - if ($phpcsFile->hasCondition($stackPtr, T_CLASS) === true) { - foreach ($tokens[$stackPtr]['conditions'] as $condPtr => $condType) { - if ($condType === T_CLASS) { - // Is this is a testing class? - $name = $phpcsFile->findNext(T_STRING, $condPtr); - $name = $tokens[$name]['content']; - if (substr($name, -8) === 'UnitTest') { - // Look for a method called setUp(). - $end = $tokens[$condPtr]['scope_closer']; - $function = $phpcsFile->findNext(T_FUNCTION, ($condPtr + 1), $end); - while ($function !== false) { - $name = $phpcsFile->findNext(T_STRING, $function); - if ($tokens[$name]['content'] === 'setUp') { - $setupFunction = $function; - break; - } - - $function = $phpcsFile->findNext(T_FUNCTION, ($function + 1), $end); - } - } - } - }//end foreach - }//end if - - if ($setupFunction !== null) { - $start = ($tokens[$setupFunction]['scope_opener'] + 1); - $end = $tokens[$setupFunction]['scope_closer']; - for ($i = $start; $i < $end; $i++) { - $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); - if ($name !== false) { - $includedClasses[$name] = true; - } - } - }//end if - - if (isset($includedClasses[strtolower($className)]) === false) { - $error = 'Static method called on non-included class or system "%s"; include system with Channels::includeSystem() or include class with require_once'; - $data = [$className]; - $phpcsFile->addError($error, $stackPtr, 'NotIncludedCall', $data); - } - - }//end processTokenWithinScope() - - - /** - * Processes a token within the scope that this test is listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * this token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_EXTENDS) { - // Find the class name. - $classNameToken = $phpcsFile->findNext(T_STRING, ($stackPtr + 1)); - $className = $tokens[$classNameToken]['content']; - } else { - // Determine the name of the class that the static function - // is being called on. But don't process class names represented by - // variables as this can be an inexact science. - $classNameToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$classNameToken]['code'] === T_VARIABLE) { - return; - } - - $className = $tokens[$classNameToken]['content']; - } - - // Some systems are always available. - if (isset($this->ignore[strtolower($className)]) === true) { - return; - } - - $includedClasses = []; - - $fileName = strtolower($phpcsFile->getFilename()); - $matches = []; - if (preg_match('|/systems/([^/]+)/([^/]+)?actions.inc$|', $fileName, $matches) !== 0) { - // This is an actions file, which means we don't - // have to include the system in which it exists - // We know the system from the path. - $includedClasses[$matches[1]] = true; - } - - // Go searching for includeSystem, includeAsset or require/include - // calls outside our scope. - for ($i = 0; $i < $stackPtr; $i++) { - // Skip classes and functions as will we never get - // into their scopes when including this file, although - // we have a chance of getting into IF, WHILE etc. - if (($tokens[$i]['code'] === T_CLASS - || $tokens[$i]['code'] === T_INTERFACE - || $tokens[$i]['code'] === T_FUNCTION) - && isset($tokens[$i]['scope_closer']) === true - ) { - $i = $tokens[$i]['scope_closer']; - continue; - } - - $name = $this->getIncludedClassFromToken($phpcsFile, $tokens, $i); - if ($name !== false) { - $includedClasses[$name] = true; - // Special case for Widgets cause they are, well, special. - } else if (strtolower($tokens[$i]['content']) === 'includewidget') { - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($i + 1)); - $typeName = trim($tokens[$typeName]['content'], " '"); - $includedClasses[strtolower($typeName).'widgettype'] = true; - } - }//end for - - if (isset($includedClasses[strtolower($className)]) === false) { - if ($tokens[$stackPtr]['code'] === T_EXTENDS) { - $error = 'Class extends non-included class or system "%s"; include system with Channels::includeSystem() or include class with require_once'; - $data = [$className]; - $phpcsFile->addError($error, $stackPtr, 'NotIncludedExtends', $data); - } else { - $error = 'Static method called on non-included class or system "%s"; include system with Channels::includeSystem() or include class with require_once'; - $data = [$className]; - $phpcsFile->addError($error, $stackPtr, 'NotIncludedCall', $data); - } - } - - }//end processTokenOutsideScope() - - - /** - * Determines the included class name from given token. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param array $tokens The array of file tokens. - * @param int $stackPtr The position in the tokens array of the - * potentially included class. - * - * @return string|false - */ - protected function getIncludedClassFromToken(File $phpcsFile, array $tokens, $stackPtr) - { - if (strtolower($tokens[$stackPtr]['content']) === 'includesystem') { - $systemName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 1)); - $systemName = trim($tokens[$systemName]['content'], " '"); - return strtolower($systemName); - } else if (strtolower($tokens[$stackPtr]['content']) === 'includeasset') { - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 1)); - $typeName = trim($tokens[$typeName]['content'], " '"); - return strtolower($typeName).'assettype'; - } else if (isset(Tokens::$includeTokens[$tokens[$stackPtr]['code']]) === true) { - $filePath = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 1)); - $filePath = $tokens[$filePath]['content']; - $filePath = trim($filePath, " '"); - $filePath = basename($filePath, '.inc'); - return strtolower($filePath); - } - - return false; - - }//end getIncludedClassFromToken() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php deleted file mode 100644 index 0f20f70b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php +++ /dev/null @@ -1,143 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Channels; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class UnusedSystemSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOUBLE_COLON]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - // Check if this is a call to includeSystem, includeAsset or includeWidget. - $methodName = strtolower($tokens[($stackPtr + 1)]['content']); - if ($methodName === 'includesystem' - || $methodName === 'includeasset' - || $methodName === 'includewidget' - ) { - $systemName = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 3), null, true); - if ($systemName === false || $tokens[$systemName]['code'] !== T_CONSTANT_ENCAPSED_STRING) { - // Must be using a variable instead of a specific system name. - // We can't accurately check that. - return; - } - - $systemName = trim($tokens[$systemName]['content'], " '"); - } else { - return; - } - - if ($methodName === 'includeasset') { - $systemName .= 'assettype'; - } else if ($methodName === 'includewidget') { - $systemName .= 'widgettype'; - } - - $systemName = strtolower($systemName); - - // Now check if this system is used anywhere in this scope. - $level = $tokens[$stackPtr]['level']; - for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['level'] < $level) { - // We have gone out of scope. - // If the original include was inside an IF statement that - // is checking if the system exists, check the outer scope - // as well. - if ($tokens[$stackPtr]['level'] === $level) { - // We are still in the base level, so this is the first - // time we have got here. - $conditions = array_keys($tokens[$stackPtr]['conditions']); - if (empty($conditions) === false) { - $cond = array_pop($conditions); - if ($tokens[$cond]['code'] === T_IF) { - $i = $tokens[$cond]['scope_closer']; - $level--; - continue; - } - } - } - - break; - }//end if - - if ($tokens[$i]['code'] !== T_DOUBLE_COLON - && $tokens[$i]['code'] !== T_EXTENDS - && $tokens[$i]['code'] !== T_IMPLEMENTS - ) { - continue; - } - - switch ($tokens[$i]['code']) { - case T_DOUBLE_COLON: - $usedName = strtolower($tokens[($i - 1)]['content']); - if ($usedName === $systemName) { - // The included system was used, so it is fine. - return; - } - break; - case T_EXTENDS: - $classNameToken = $phpcsFile->findNext(T_STRING, ($i + 1)); - $className = strtolower($tokens[$classNameToken]['content']); - if ($className === $systemName) { - // The included system was used, so it is fine. - return; - } - break; - case T_IMPLEMENTS: - $endImplements = $phpcsFile->findNext([T_EXTENDS, T_OPEN_CURLY_BRACKET], ($i + 1)); - for ($x = ($i + 1); $x < $endImplements; $x++) { - if ($tokens[$x]['code'] === T_STRING) { - $className = strtolower($tokens[$x]['content']); - if ($className === $systemName) { - // The included system was used, so it is fine. - return; - } - } - } - break; - }//end switch - }//end for - - // If we get to here, the system was not use. - $error = 'Included system "%s" is never used'; - $data = [$systemName]; - $phpcsFile->addError($error, $stackPtr, 'Found', $data); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php deleted file mode 100644 index da00c903..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Commenting; - -use PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff as SquizFunctionCommentSniff; -use PHP_CodeSniffer\Util\Tokens; -use PHP_CodeSniffer\Files\File; - -class FunctionCommentSniff extends SquizFunctionCommentSniff -{ - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - parent::process($phpcsFile, $stackPtr); - - $tokens = $phpcsFile->getTokens(); - $find = Tokens::$methodPrefixes; - $find[] = T_WHITESPACE; - - $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG) { - return; - } - - $commentStart = $tokens[$commentEnd]['comment_opener']; - $hasApiTag = false; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@api') { - if ($hasApiTag === true) { - // We've come across an API tag already, which means - // we were not the first tag in the API list. - $error = 'The @api tag must come first in the @api tag list in a function comment'; - $phpcsFile->addError($error, $tag, 'ApiNotFirst'); - } - - $hasApiTag = true; - - // There needs to be a blank line before the @api tag. - $prev = $phpcsFile->findPrevious([T_DOC_COMMENT_STRING, T_DOC_COMMENT_TAG], ($tag - 1)); - if ($tokens[$prev]['line'] !== ($tokens[$tag]['line'] - 2)) { - $error = 'There must be one blank line before the @api tag in a function comment'; - $phpcsFile->addError($error, $tag, 'ApiSpacing'); - } - } else if (substr($tokens[$tag]['content'], 0, 5) === '@api-') { - $hasApiTag = true; - - $prev = $phpcsFile->findPrevious([T_DOC_COMMENT_STRING, T_DOC_COMMENT_TAG], ($tag - 1)); - if ($tokens[$prev]['line'] !== ($tokens[$tag]['line'] - 1)) { - $error = 'There must be no blank line before the @%s tag in a function comment'; - $data = [$tokens[$tag]['content']]; - $phpcsFile->addError($error, $tag, 'ApiTagSpacing', $data); - } - }//end if - }//end foreach - - if ($hasApiTag === true && substr($tokens[$tag]['content'], 0, 4) !== '@api') { - // API tags must be the last tags in a function comment. - $error = 'The @api tags must be the last tags in a function comment'; - $phpcsFile->addError($error, $commentEnd, 'ApiNotLast'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php deleted file mode 100644 index d40e064e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Debug; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class DebugCodeSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOUBLE_COLON]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - $className = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if (strtolower($tokens[$className]['content']) === 'debug') { - $method = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $error = 'Call to debug function Debug::%s() must be removed'; - $data = [$tokens[$method]['content']]; - $phpcsFile->addError($error, $stackPtr, 'Found', $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php deleted file mode 100644 index 1f56a0e2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Debug; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class FirebugConsoleSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_STRING, - T_PROPERTY, - T_LABEL, - T_OBJECT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (strtolower($tokens[$stackPtr]['content']) === 'console') { - $error = 'Variables, functions and labels must not be named "console"; name may conflict with Firebug internal variable'; - $phpcsFile->addError($error, $stackPtr, 'ConflictFound'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php deleted file mode 100644 index 97732872..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/AssignThisSniff.php +++ /dev/null @@ -1,83 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class AssignThisSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_THIS]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Ignore this.something and other uses of "this" that are not - // direct assignments. - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] !== T_SEMICOLON) { - if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { - return; - } - } - - // Something must be assigned to "this". - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] !== T_EQUAL) { - return; - } - - // A variable needs to be assigned to "this". - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($prev - 1), null, true); - if ($tokens[$prev]['code'] !== T_STRING) { - return; - } - - // We can only assign "this" to a var called "self". - if ($tokens[$prev]['content'] !== 'self' && $tokens[$prev]['content'] !== '_self') { - $error = 'Keyword "this" can only be assigned to a variable called "self" or "_self"'; - $phpcsFile->addError($error, $prev, 'NotSelf'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php deleted file mode 100644 index 5d8dc996..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php +++ /dev/null @@ -1,220 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class CreateWidgetTypeCallbackSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OBJECT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $className = $phpcsFile->findPrevious(T_STRING, ($stackPtr - 1)); - if (substr(strtolower($tokens[$className]['content']), -10) !== 'widgettype') { - return; - } - - // Search for a create method. - $create = $phpcsFile->findNext(T_PROPERTY, $stackPtr, $tokens[$stackPtr]['bracket_closer'], null, 'create'); - if ($create === false) { - return; - } - - $function = $phpcsFile->findNext([T_WHITESPACE, T_COLON], ($create + 1), null, true); - if ($tokens[$function]['code'] !== T_FUNCTION - && $tokens[$function]['code'] !== T_CLOSURE - ) { - return; - } - - $start = ($tokens[$function]['scope_opener'] + 1); - $end = ($tokens[$function]['scope_closer'] - 1); - - // Check that the first argument is called "callback". - $arg = $phpcsFile->findNext(T_WHITESPACE, ($tokens[$function]['parenthesis_opener'] + 1), null, true); - if ($tokens[$arg]['content'] !== 'callback') { - $error = 'The first argument of the create() method of a widget type must be called "callback"'; - $phpcsFile->addError($error, $arg, 'FirstArgNotCallback'); - } - - /* - Look for return statements within the function. They cannot return - anything and must be preceded by the callback.call() line. The - callback itself must contain "self" or "this" as the first argument - and there needs to be a call to the callback function somewhere - in the create method. All calls to the callback function must be - followed by a return statement or the end of the method. - */ - - $foundCallback = false; - $passedCallback = false; - $nestedFunction = null; - for ($i = $start; $i <= $end; $i++) { - // Keep track of nested functions. - if ($nestedFunction !== null) { - if ($i === $nestedFunction) { - $nestedFunction = null; - continue; - } - } else if (($tokens[$i]['code'] === T_FUNCTION - || $tokens[$i]['code'] === T_CLOSURE) - && isset($tokens[$i]['scope_closer']) === true - ) { - $nestedFunction = $tokens[$i]['scope_closer']; - continue; - } - - if ($nestedFunction === null && $tokens[$i]['code'] === T_RETURN) { - // Make sure return statements are not returning anything. - if ($tokens[($i + 1)]['code'] !== T_SEMICOLON) { - $error = 'The create() method of a widget type must not return a value'; - $phpcsFile->addError($error, $i, 'ReturnValue'); - } - - continue; - } else if ($tokens[$i]['code'] !== T_STRING - || $tokens[$i]['content'] !== 'callback' - ) { - continue; - } - - // If this is the form "callback.call(" then it is a call - // to the callback function. - if ($tokens[($i + 1)]['code'] !== T_OBJECT_OPERATOR - || $tokens[($i + 2)]['content'] !== 'call' - || $tokens[($i + 3)]['code'] !== T_OPEN_PARENTHESIS - ) { - // One last chance; this might be the callback function - // being passed to another function, like this - // "this.init(something, callback, something)". - if (isset($tokens[$i]['nested_parenthesis']) === false) { - continue; - } - - // Just make sure those brackets don't belong to anyone, - // like an IF or FOR statement. - foreach ($tokens[$i]['nested_parenthesis'] as $bracket) { - if (isset($tokens[$bracket]['parenthesis_owner']) === true) { - continue(2); - } - } - - // Note that we use this endBracket down further when checking - // for a RETURN statement. - $nestedParens = $tokens[$i]['nested_parenthesis']; - $endBracket = end($nestedParens); - $bracket = key($nestedParens); - - $prev = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($bracket - 1), - null, - true - ); - - if ($tokens[$prev]['code'] !== T_STRING) { - // This is not a function passing the callback. - continue; - } - - $passedCallback = true; - }//end if - - $foundCallback = true; - - if ($passedCallback === false) { - // The first argument must be "this" or "self". - $arg = $phpcsFile->findNext(T_WHITESPACE, ($i + 4), null, true); - if ($tokens[$arg]['content'] !== 'this' - && $tokens[$arg]['content'] !== 'self' - ) { - $error = 'The first argument passed to the callback function must be "this" or "self"'; - $phpcsFile->addError($error, $arg, 'FirstArgNotSelf'); - } - } - - // Now it must be followed by a return statement or the end of the function. - if ($passedCallback === false) { - $endBracket = $tokens[($i + 3)]['parenthesis_closer']; - } - - for ($next = $endBracket; $next <= $end; $next++) { - // Skip whitespace so we find the next content after the call. - if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true) { - continue; - } - - // Skip closing braces like END IF because it is not executable code. - if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { - continue; - } - - // We don't care about anything on the current line, like a - // semicolon. It doesn't matter if there are other statements on the - // line because another sniff will check for those. - if ($tokens[$next]['line'] === $tokens[$endBracket]['line']) { - continue; - } - - break; - } - - if ($next !== $tokens[$function]['scope_closer'] - && $tokens[$next]['code'] !== T_RETURN - ) { - $error = 'The call to the callback function must be followed by a return statement if it is not the last statement in the create() method'; - $phpcsFile->addError($error, $i, 'NoReturn'); - } - }//end for - - if ($foundCallback === false) { - $error = 'The create() method of a widget type must call the callback function'; - $phpcsFile->addError($error, $create, 'CallbackNotCalled'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php deleted file mode 100644 index 693a0371..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Objects; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class DisallowNewWidgetSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_NEW]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $className = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$className]['code'] !== T_STRING) { - return; - } - - if (substr(strtolower($tokens[$className]['content']), -10) === 'widgettype') { - $widgetType = substr($tokens[$className]['content'], 0, -10); - $error = 'Manual creation of widget objects is banned; use Widget::getWidget(\'%s\'); instead'; - $data = [$widgetType]; - $phpcsFile->addError($error, $stackPtr, 'Found', $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php deleted file mode 100644 index 06c25127..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class AjaxNullComparisonSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - // Make sure it is an API function. We know this by the doc comment. - $commentEnd = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, $stackPtr); - $commentStart = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($commentEnd - 1)); - // If function doesn't contain any doc comments - skip it. - if ($commentEnd === false || $commentStart === false) { - return; - } - - $comment = $phpcsFile->getTokensAsString($commentStart, ($commentEnd - $commentStart)); - if (strpos($comment, '* @api') === false) { - return; - } - - // Find all the vars passed in as we are only interested in comparisons - // to NULL for these specific variables. - $foundVars = []; - $open = $tokens[$stackPtr]['parenthesis_opener']; - $close = $tokens[$stackPtr]['parenthesis_closer']; - for ($i = ($open + 1); $i < $close; $i++) { - if ($tokens[$i]['code'] === T_VARIABLE) { - $foundVars[$tokens[$i]['content']] = true; - } - } - - if (empty($foundVars) === true) { - return; - } - - $start = $tokens[$stackPtr]['scope_opener']; - $end = $tokens[$stackPtr]['scope_closer']; - for ($i = ($start + 1); $i < $end; $i++) { - if ($tokens[$i]['code'] !== T_VARIABLE - || isset($foundVars[$tokens[$i]['content']]) === false - ) { - continue; - } - - $operator = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), null, true); - if ($tokens[$operator]['code'] !== T_IS_IDENTICAL - && $tokens[$operator]['code'] !== T_IS_NOT_IDENTICAL - ) { - continue; - } - - $nullValue = $phpcsFile->findNext(T_WHITESPACE, ($operator + 1), null, true); - if ($tokens[$nullValue]['code'] !== T_NULL) { - continue; - } - - $error = 'Values submitted via Ajax requests should not be compared directly to NULL; use empty() instead'; - $phpcsFile->addWarning($error, $nullValue, 'Found'); - }//end for - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php deleted file mode 100644 index 6684691f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class EvalObjectFactorySniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EVAL]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - /* - We need to find all strings that will be in the eval - to determine if the "new" keyword is being used. - */ - - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($stackPtr + 1)); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - $strings = []; - $vars = []; - - for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { - if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true) { - $strings[$i] = $tokens[$i]['content']; - } else if ($tokens[$i]['code'] === T_VARIABLE) { - $vars[$i] = $tokens[$i]['content']; - } - } - - /* - We now have some variables that we need to expand into - the strings that were assigned to them, if any. - */ - - foreach ($vars as $varPtr => $varName) { - while (($prev = $phpcsFile->findPrevious(T_VARIABLE, ($varPtr - 1))) !== false) { - // Make sure this is an assignment of the variable. That means - // it will be the first thing on the line. - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($prev - 1), null, true); - if ($tokens[$prevContent]['line'] === $tokens[$prev]['line']) { - $varPtr = $prevContent; - continue; - } - - if ($tokens[$prev]['content'] !== $varName) { - // This variable has a different name. - $varPtr = $prevContent; - continue; - } - - // We found one. - break; - }//end while - - if ($prev !== false) { - // Find all strings on the line. - $lineEnd = $phpcsFile->findNext(T_SEMICOLON, ($prev + 1)); - for ($i = ($prev + 1); $i < $lineEnd; $i++) { - if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true) { - $strings[$i] = $tokens[$i]['content']; - } - } - } - }//end foreach - - foreach ($strings as $string) { - // If the string has "new" in it, it is not allowed. - // We don't bother checking if the word "new" is printed to screen - // because that is unlikely to happen. We assume the use - // of "new" is for object instantiation. - if (strstr($string, ' new ') !== false) { - $error = 'Do not use eval() to create objects dynamically; use reflection instead'; - $phpcsFile->addWarning($error, $stackPtr, 'Found'); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php deleted file mode 100644 index a0767796..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php +++ /dev/null @@ -1,108 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class GetRequestDataSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_VARIABLE]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - $varName = $tokens[$stackPtr]['content']; - if ($varName !== '$_REQUEST' - && $varName !== '$_GET' - && $varName !== '$_POST' - && $varName !== '$_FILES' - ) { - return; - } - - // The only place these super globals can be accessed directly is - // in the getRequestData() method of the Security class. - $inClass = false; - foreach ($tokens[$stackPtr]['conditions'] as $i => $type) { - if ($tokens[$i]['code'] === T_CLASS) { - $className = $phpcsFile->findNext(T_STRING, $i); - $className = $tokens[$className]['content']; - if (strtolower($className) === 'security') { - $inClass = true; - } else { - // We don't have nested classes. - break; - } - } else if ($inClass === true && $tokens[$i]['code'] === T_FUNCTION) { - $funcName = $phpcsFile->findNext(T_STRING, $i); - $funcName = $tokens[$funcName]['content']; - if (strtolower($funcName) === 'getrequestdata') { - // This is valid. - return; - } else { - // We don't have nested functions. - break; - } - }//end if - }//end foreach - - // If we get to here, the super global was used incorrectly. - // First find out how it is being used. - $globalName = strtolower(substr($varName, 2)); - $usedVar = ''; - - $openBracket = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$openBracket]['code'] === T_OPEN_SQUARE_BRACKET) { - $closeBracket = $tokens[$openBracket]['bracket_closer']; - $usedVar = $phpcsFile->getTokensAsString(($openBracket + 1), ($closeBracket - $openBracket - 1)); - } - - $type = 'SuperglobalAccessed'; - $error = 'The %s super global must not be accessed directly; use Security::getRequestData('; - $data = [$varName]; - if ($usedVar !== '') { - $type .= 'WithVar'; - $error .= '%s, \'%s\''; - $data[] = $usedVar; - $data[] = $globalName; - } - - $error .= ') instead'; - $phpcsFile->addError($error, $stackPtr, $type, $data); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php deleted file mode 100644 index 697e91dc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\PHP; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class ReturnFunctionValueSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_RETURN]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - $functionName = $phpcsFile->findNext(T_STRING, ($stackPtr + 1), null, false, null, true); - - while ($functionName !== false) { - // Check if this is really a function. - $bracket = $phpcsFile->findNext(T_WHITESPACE, ($functionName + 1), null, true); - if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) { - // Not a function call. - $functionName = $phpcsFile->findNext(T_STRING, ($functionName + 1), null, false, null, true); - continue; - } - - $error = 'The result of a function call should be assigned to a variable before being returned'; - $phpcsFile->addWarning($error, $stackPtr, 'NotAssigned'); - break; - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php deleted file mode 100644 index ee527b41..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\MySource\Sniffs\Strings; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Tokens; - -class JoinStringsSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_STRING]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['content'] !== 'join') { - return; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] !== T_OBJECT_OPERATOR) { - return; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - if ($tokens[$prev]['code'] === T_CLOSE_SQUARE_BRACKET) { - $opener = $tokens[$prev]['bracket_opener']; - if ($tokens[($opener - 1)]['code'] !== T_STRING) { - // This means the array is declared inline, like x = [a,b,c].join() - // and not elsewhere, like x = y[a].join() - // The first is not allowed while the second is. - $error = 'Joining strings using inline arrays is not allowed; use the + operator instead'; - $phpcsFile->addError($error, $stackPtr, 'ArrayNotAllowed'); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css deleted file mode 100644 index 339ee154..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.css +++ /dev/null @@ -1,13 +0,0 @@ -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; - line-height: -25px; - cursor: pointer; - -moz-user-select: none; -} - -.AssetLineageWidgetType-item { - float: left; - list-style: none; - height: 22px; - cursor: pointer; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php deleted file mode 100644 index 7f10457c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/CSS/BrowserSpecificStylesUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the BrowserSpecificStyles sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\CSS\BrowserSpecificStylesSniff - */ -final class BrowserSpecificStylesUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [5 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc deleted file mode 100644 index 95fd04b7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.inc +++ /dev/null @@ -1,51 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php deleted file mode 100644 index 30a62d13..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/DisallowSelfActionsUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowSelfActions sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\DisallowSelfActionsSniff - */ -final class DisallowSelfActionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 12 => 1, - 13 => 1, - 28 => 1, - 29 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc deleted file mode 100644 index ccb0273e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.inc +++ /dev/null @@ -1,112 +0,0 @@ -fetch(PDO::FETCH_NUM) -BaseSystem::getDataDir(); -Util::getArrayIndex(array(), ''); - - -Channels::includeSystem('Widget'); -Widget::includeWidget('AbstractContainer'); -class MyWidget extends AbstractContainerWidgetType {} -class MyOtherWidget extends BookWidgetType {} - -$zip = new ZipArchive(); -$res = $zip->open($path, ZipArchive::CREATE); - -class AssetListingUnitTest extends AbstractMySourceUnitTest -{ - function setUp() { - parent::setUp(); - Channels::includeSystem('MySystem2'); - include_once 'Libs/FileSystem.inc'; - } - - function two() { - $siteid = MySystem2::getCurrentSiteId(); - $parserFiles = FileSystem::listDirectory(); - } - - function three() { - $siteid = MySystem3::getCurrentSiteId(); - $parserFiles = FileSystem::listDirectory(); - } -} - -if (Channels::systemExists('Log') === TRUE) { - Channels::includeSystem('Log'); -} else { - return; -} - -Log::addProjectLog('metadata.field.update', $msg); - -function two() { - Widget::includeWidget('CacheAdminScreen'); - $barChart = CacheAdminScreenWidgetType::constructBarchart($data); -} - -$adjustDialog->setOrientation(AbstractWidgetWidgetType::CENTER); - -$className = 'SquizPerspective'.ucfirst($property['type']).'PropertyType'; -Channels::includeSystem($className); -$className::setValue($assetid, $propertyid, $perspectives, $value, (array) $property['settings']); -?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php deleted file mode 100644 index 635054d3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/IncludeSystemUnitTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the IncludeSystem sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\IncludeSystemSniff - */ -final class IncludeSystemUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 14 => 1, - 24 => 1, - 27 => 1, - 28 => 1, - 31 => 1, - 36 => 1, - 41 => 1, - 61 => 1, - 70 => 1, - 89 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc deleted file mode 100644 index c7bd4738..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.inc +++ /dev/null @@ -1,67 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php deleted file mode 100644 index 05359a48..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Channels/UnusedSystemUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Channels; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the UnusedSystem sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\UnusedSystemSniff - */ -final class UnusedSystemUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 5 => 1, - 8 => 1, - 24 => 1, - 34 => 1, - 54 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc deleted file mode 100644 index 19d5c5d4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.inc +++ /dev/null @@ -1,101 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php deleted file mode 100644 index 07c62a95..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Commenting/FunctionCommentUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionComment sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Commenting\FunctionCommentSniff - */ -final class FunctionCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 28 => 1, - 36 => 1, - 37 => 2, - 49 => 1, - 58 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc deleted file mode 100644 index 34901610..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.inc +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php deleted file mode 100644 index 1f85b23e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/DebugCodeUnitTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DebugCode sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Debug\DebugCodeSniff - */ -final class DebugCodeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 3 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js deleted file mode 100644 index d5e3df57..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.js +++ /dev/null @@ -1,8 +0,0 @@ -console.info(); -console.warn(); -console.test(); -con.sole(); -var console = { - console: 'string'; -}; -function console() {} \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php deleted file mode 100644 index 8b9d6043..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FirebugConsole sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Debug\FirebugConsoleSniff - */ -final class FirebugConsoleUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - if ($testFile !== 'FirebugConsoleUnitTest.js') { - return []; - } - - return [ - 1 => 1, - 2 => 1, - 3 => 1, - 5 => 1, - 6 => 1, - 8 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js deleted file mode 100644 index 747a1008..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.js +++ /dev/null @@ -1,20 +0,0 @@ -var self = this; -buttonWidget.addClickEvent(function() { - self.addDynamicSouce(); -}); - -var x = self; -var y = this; - -var test = ''; -if (true) { - test = this -} - -var itemid = this.items[i].getAttribute('itemid'); - -for (var x = this; y < 10; y++) { - var x = this + 1; -} - -var _self = this; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php deleted file mode 100644 index 7e44a857..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the AssignThis sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\AssignThisSniff - */ -final class AssignThisUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - if ($testFile !== 'AssignThisUnitTest.js') { - return []; - } - - return [ - 7 => 1, - 11 => 1, - 16 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js deleted file mode 100644 index 22822d32..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.js +++ /dev/null @@ -1,186 +0,0 @@ -SampleWidgetType.prototype = { - - create: function(callback) - { - if (x === 1) { - return; - } - - if (y === 1) { - callback.call(this); - // A comment here to explain the return is okay. - return; - } - - if (a === 1) { - // Cant return value even after calling callback. - callback.call(this); - return something; - } - - if (a === 1) { - // Need to pass self or this to callback function. - callback.call(a); - } - - callback.call(self); - - var self = this; - this.createChildren(null, function() { - callback.call(self, div); - }); - - // Never good to return a value. - return something; - - callback.call(self); - } - -}; - -AnotherSampleWidgetType.prototype = { - - create: function(input) - { - return; - } - - getSomething: function(input) - { - return 1; - } - -}; - - -NoCreateWidgetType.prototype = { - - getSomething: function(input) - { - return; - } - -}; - - -SomeRandom.prototype = { - - create: function(input) - { - return; - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - if (a === 1) { - // This is ok because it is the last statement, - // even though it is conditional. - callback.call(self); - } - - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - var something = callback; - - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - // Also valid because we are passing the callback to - // someone else to call. - if (y === 1) { - this.something(callback); - return; - } - - this.init(callback); - - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - // Also valid because we are passing the callback to - // someone else to call. - if (y === 1) { - this.something(callback); - } - - this.init(callback); - - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - if (a === 1) { - // This is ok because it is the last statement, - // even though it is conditional. - this.something(callback); - } - - } - -}; - - -SampleWidgetType.prototype = { - - create: function(callback) - { - if (dfx.isFn(callback) === true) { - callback.call(this, cont); - return; - } - } - -}; - - -SampleWidgetType.prototype = { - - create: function(callback) - { - dfx.foreach(items, function(item) { - return true; - }); - - if (dfx.isFn(callback) === true) { - callback.call(this); - } - } - -}; - -SampleWidgetType.prototype = { - - create: function(callback) - { - var self = this; - this.createChildren(null, function() { - callback.call(self, div); - return; - }); - } - -}; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php deleted file mode 100644 index 5c9ca8e5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the CreateWidgetTypeCallback sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\CreateWidgetTypeCallbackSniff - */ -final class CreateWidgetTypeCallbackUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 18 => 1, - 23 => 2, - 26 => 1, - 30 => 1, - 34 => 1, - 43 => 2, - 91 => 1, - 123 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc deleted file mode 100644 index acf9baf7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.inc +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php deleted file mode 100644 index 04935604..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Objects/DisallowNewWidgetUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowNewWidget sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\DisallowNewWidgetSniff - */ -final class DisallowNewWidgetUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [4 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc deleted file mode 100644 index 337914a8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.inc +++ /dev/null @@ -1,182 +0,0 @@ -getMessage()); - }//end try - - if ($something === NULL) { - if ($bar !== NULL) { - } - } - - return $issueid; - -}//end addIssue() - -/** - * Adds a new issue. - * - * Returns the new issue id. - * - * @param string $title Title of the new issue. - * @param string $description The description of the issue. - * @param string $reporter Asset id of the reporter. - * @param integer $projectid Id of the project that the issue belongs to. - * @param array $tags Array of tags. - * @param string $status The status of the issue. - * @param string $assignedTo The asset id of the user that the issue is - * assigned to. - * @param string $reportedDate If set then this date will be used instead of the - * current date and time. - * @param integer $reportedMilestone Reported milestone. - * - * @return integer - * @throws ChannelException If there is an error. - * - */ -public static function addIssue( - $title, - $description, - $reporter=NULL, - $projectid=NULL, - array $tags=array(), - $status=NULL, - $assignedTo=NULL, - $reportedDate=NULL, - $reportedMilestone=NULL -) { - // Get current projectid if not specified. - if ($projectid === NULL) { - Channels::includeSystem('Project'); - $projectid = Project::getCurrentProjectId(); - Channels::modifyBasket('project', $projectid); - } - -}//end addIssue() diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php deleted file mode 100644 index fa39de07..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/AjaxNullComparisonUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the AjaxNullComparison sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\AjaxNullComparisonSniff - */ -final class AjaxNullComparisonUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [ - 41 => 1, - 53 => 1, - 64 => 1, - 77 => 1, - 92 => 1, - 122 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc deleted file mode 100644 index 992a7dc1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.inc +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php deleted file mode 100644 index e98ee285..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/EvalObjectFactoryUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the EvalObjectFactory sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\EvalObjectFactorySniff - */ -final class EvalObjectFactoryUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [ - 4 => 1, - 12 => 1, - 21 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc deleted file mode 100644 index 7999763f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.inc +++ /dev/null @@ -1,30 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php deleted file mode 100644 index f079325b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/GetRequestDataUnitTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the GetRequestData sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\GetRequestDataSniff - */ -final class GetRequestDataUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 5 => 1, - 8 => 1, - 21 => 1, - 26 => 1, - 27 => 1, - 28 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc deleted file mode 100644 index f9148a78..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.inc +++ /dev/null @@ -1,9 +0,0 @@ -myFunction(); -return $obj->variable; -return MyClass::VARIABLE; -return $variable; -return ($var + 1); -?> \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php deleted file mode 100644 index ce860461..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/PHP/ReturnFunctionValueUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ReturnFunctionValue sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\ReturnFunctionValueSniff - */ -final class ReturnFunctionValueUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [ - 2 => 1, - 3 => 1, - 4 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js deleted file mode 100644 index 46d90cf9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.js +++ /dev/null @@ -1,18 +0,0 @@ -one = (1 + 2); -two = (one + 2); -two = (one + one); -three = ('1' + 2); - -four = ['1', two].join(); -four = ['1', two].join(''); -four = ['1', [one, two].join(',')].join(' '); -four = ['1', [one, two].join()].join(' '); -four = ['1', [one, two].join()].join(); - -five = 'string' + ['1', [one, two].join()].join() + 'string'; - -six = myArray.join(' '); -six = [arrayOne, arrayTwo].join(); - -// This is fine because the array is not created inline. -var x = 'x' + test[x].join('p') + 't'; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php deleted file mode 100644 index b3392233..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\MySource\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the JoinStrings sniff. - * - * @covers PHP_CodeSniffer\Standards\MySource\Sniffs\Strings\JoinStringsSniff - */ -final class JoinStringsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - if ($testFile !== 'JoinStringsUnitTest.js') { - return []; - } - - return [ - 6 => 1, - 7 => 1, - 8 => 2, - 9 => 2, - 10 => 2, - 12 => 2, - 15 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml deleted file mode 100644 index 92407957..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/MySource/ruleset.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - The MySource coding standard builds on the Squiz coding standard. Currently used for MySource Mini development. - - */Tests/* - */Oven/* - */data/* - */jquery.js - */jquery.*.js - */viper/* - DALConf.inc - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml deleted file mode 100644 index b5d53fdf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - { -} - ]]> - - - { -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml deleted file mode 100644 index fe816200..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/ClassCommentStandard.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - /** - * The Foo class. - */ -class Foo -{ -} - ]]> - - - - - - - - /** - * The Foo class. - */ -class Foo -{ -} - ]]> - - - - - - - - /** - * The Foo class. - */ -class Foo -{ -} - ]]> - - - /** - * The Foo class. - */ - -class Foo -{ -} - ]]> - - - - - The Foo class. - */ -class Foo -{ -} - ]]> - - - The Foo class. - */ -class Foo -{ -} - ]]> - - - - - - * A helper for the Bar class. - * - * @see Bar - */ -class Foo -{ -} - ]]> - - - - * - * A helper for the Bar class. - * - * - * @see Bar - */ -class Foo -{ -} - ]]> - - - - - - * @see Bar - */ -class Foo -{ -} - ]]> - - - - * - * @see Bar - */ -class Foo -{ -} - ]]> - - - - - Release: 1.0 - */ -class Foo -{ -} - ]]> - - - 1.0 - */ -class Foo -{ -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml deleted file mode 100644 index eef0b4e3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FileCommentStandard.xml +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - /** - * Short description here. - * - * PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - ]]> - - - - - Short description here. - * - * PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - * Short description here. - * - * PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - - * PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - * - * PHP version 5 - * - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - - - - @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - @category Foo - * @category Bar - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - PHP version 5 - * - * @category Foo - * @package Foo_Helpers - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - @package Foo_Helpers - * @category Foo - * @author Marty McFly - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - - - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - - * @copyright 2013-2014 Foo Inc. - * @license MIT License - * @link http://example.com - */ - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml deleted file mode 100644 index 621649f2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/FunctionCommentStandard.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - /** - * Short description here. - * - * @return void - */ - function foo() - { - } - ]]> - - - - - - - - Short description here. - * - * @return void - */ - function foo() - { - } - ]]> - - - - * Short description here. - * - * @return void - */ - function foo() - { - } - ]]> - - - - - - * Long description here. - * - * @return void - */ - function foo() - { - } - ]]> - - - - * - * Long description here. - * - * - * @return void - */ - function foo() - { - } - ]]> - - - - - - * @return void - */ - function foo() - { - } - ]]> - - - - * - * @return void - */ - function foo() - { - } - ]]> - - - - - FooException - */ - function foo() - { - } - ]]> - - - @throws - */ - function foo() - { - } - ]]> - - - - - @return void - */ - function foo() - { - } - ]]> - - - - - - - - $foo Foo parameter - * @param string $bar Bar parameter - * @return void - */ - function foo($foo, $bar) - { - } - ]]> - - - $qux Bar parameter - * @return void - */ - function foo($foo, $bar) - { - } - ]]> - - - - - $foo Foo parameter - * @param string $bar Bar parameter - * @return void - */ - function foo($foo, $bar) - { - } - ]]> - - - $bar Bar parameter - * @param string $foo Foo parameter - * @return void - */ - function foo($foo, $bar) - { - } - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml deleted file mode 100644 index 53056e2a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Commenting/InlineCommentStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - // A comment. - ]]> - - - # A comment. - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml deleted file mode 100644 index ce430fb1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/ControlSignatureStandard.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - ($foo) { -} - ]]> - - - ($foo){ -} - ]]> - - - - - { -} - ]]> - - - { -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml deleted file mode 100644 index 96d451dc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - && $bar -) { -} - ]]> - - - && $bar -) { -} - ]]> - - - - - && $bar -) { -} - ]]> - - - && - $bar -) { -} - ]]> - - - - - ) { -} - ]]> - - - ) { -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml deleted file mode 100644 index 6d115be7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/IncludingFileStandard.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - require_once. Anywhere you are conditionally including a class file (for example, factory methods), use include_once. Either of these will ensure that class files are included only once. They share the same file list, so you don't need to worry about mixing them - a file included with require_once will not be included again by include_once. - ]]> - - - include_once and require_once are statements, not functions. Parentheses should not surround the subject filename. - ]]> - - - - - - - ('PHP/CodeSniffer.php'); - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml deleted file mode 100644 index e4911ef3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Files/LineLengthStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml deleted file mode 100644 index e825c553..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Formatting/MultiLineAssignmentStandard.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - = $bar; - ]]> - - - = - $bar; - ]]> - - - - - = $bar; - ]]> - - - = $bar; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml deleted file mode 100644 index f8742277..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionCallSignatureStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - ( $bar, $baz, $quux ) ; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml deleted file mode 100644 index ced9ae2e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/FunctionDeclarationStandard.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - () use ($bar) { -}; - ]]> - - - ()use($bar){ -}; - ]]> - - - - - $bar, - $baz -) { -}; - ]]> - - - $bar, -$baz) -{ -}; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml deleted file mode 100644 index 56196cb6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Functions/ValidDefaultValueStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - $persistent = false) -{ - ... -} - ]]> - - - $persistent = false, $dsn) -{ - ... -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml deleted file mode 100644 index d1608791..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidClassNameStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml deleted file mode 100644 index 60841dd4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidFunctionNameStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml deleted file mode 100644 index 4c707bdd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/NamingConventions/ValidVariableNameStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - publicVar; - protected $protectedVar; - private $_privateVar; -} - ]]> - - - _publicVar; - protected $_protectedVar; - private $privateVar; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml deleted file mode 100644 index 9dee905d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ObjectOperatorIndentStandard.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - ->bar() - ->baz(); - ]]> - - - -> - bar()-> - baz(); - ]]> - - - - - ->bar() - ->baz(); - ]]> - - - ->bar() -->baz(); - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml deleted file mode 100644 index c8d6e274..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeClosingBraceStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - } - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml deleted file mode 100644 index fafa07ac..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/WhiteSpace/ScopeIndentStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - if ($test) { - $var = 1; - } -} - ]]> - - - if ($test) { -$var = 1; -} -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php deleted file mode 100644 index 893dc9a8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php +++ /dev/null @@ -1,150 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClassDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $errorData = [strtolower($tokens[$stackPtr]['content'])]; - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - $error = 'Possible parse error: %s missing opening or closing brace'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $errorData); - return; - } - - $curlyBrace = $tokens[$stackPtr]['scope_opener']; - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($curlyBrace - 1), $stackPtr, true); - $classLine = $tokens[$lastContent]['line']; - $braceLine = $tokens[$curlyBrace]['line']; - if ($braceLine === $classLine) { - $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'same line'); - $error = 'Opening brace of a %s must be on the line after the definition'; - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNewLine', $errorData); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if ($tokens[($curlyBrace - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($curlyBrace - 1), ''); - } - - $phpcsFile->fixer->addNewlineBefore($curlyBrace); - $phpcsFile->fixer->endChangeset(); - } - - return; - } else { - $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'new line'); - - if ($braceLine > ($classLine + 1)) { - $error = 'Opening brace of a %s must be on the line following the %s declaration; found %s line(s)'; - $data = [ - $tokens[$stackPtr]['content'], - $tokens[$stackPtr]['content'], - ($braceLine - $classLine - 1), - ]; - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceWrongLine', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($curlyBrace - 1); $i > $lastContent; $i--) { - if ($tokens[$i]['line'] === ($tokens[$curlyBrace]['line'] + 1)) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - }//end if - }//end if - - if ($tokens[($curlyBrace + 1)]['content'] !== $phpcsFile->eolChar) { - $error = 'Opening %s brace must be on a line by itself'; - - $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($curlyBrace + 1), null, true); - if ($tokens[$nextNonWhitespace]['code'] === T_PHPCS_IGNORE) { - // Don't auto-fix if the next thing is a PHPCS ignore annotation. - $phpcsFile->addError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData); - } else { - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData); - if ($fix === true) { - $phpcsFile->fixer->addNewline($curlyBrace); - } - } - } - - if ($tokens[($curlyBrace - 1)]['code'] === T_WHITESPACE) { - $prevContent = $tokens[($curlyBrace - 1)]['content']; - if ($prevContent === $phpcsFile->eolChar) { - $spaces = 0; - } else { - $spaces = $tokens[($curlyBrace - 1)]['length']; - } - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $expected = ($tokens[$first]['column'] - 1); - if ($spaces !== $expected) { - $error = 'Expected %s spaces before opening brace; %s found'; - $data = [ - $expected, - $spaces, - ]; - - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'SpaceBeforeBrace', $data); - if ($fix === true) { - $indent = str_repeat(' ', $expected); - if ($spaces === 0) { - $phpcsFile->fixer->addContentBefore($curlyBrace, $indent); - } else { - $phpcsFile->fixer->replaceToken(($curlyBrace - 1), $indent); - } - } - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php deleted file mode 100644 index 8fa6bfba..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php +++ /dev/null @@ -1,122 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class ClassCommentSniff extends FileCommentSniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $type = strtolower($tokens[$stackPtr]['content']); - $errorData = [$type]; - - $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) { - continue; - } - - if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END - && isset($tokens[$commentEnd]['attribute_opener']) === true - ) { - $commentEnd = $tokens[$commentEnd]['attribute_opener']; - continue; - } - - break; - } - - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG - && $tokens[$commentEnd]['code'] !== T_COMMENT - ) { - $errorData[] = $phpcsFile->getDeclarationName($stackPtr); - $phpcsFile->addError('Missing doc comment for %s %s', $stackPtr, 'Missing', $errorData); - $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no'); - return; - } - - $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes'); - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a %s comment', $stackPtr, 'WrongStyle', $errorData); - return; - } - - // Check each tag. - $this->processTags($phpcsFile, $stackPtr, $tokens[$commentEnd]['comment_opener']); - - }//end process() - - - /** - * Process the version tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processVersion($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if ((strstr($content, 'Release:') === false)) { - $error = 'Invalid version "%s" in doc comment; consider "Release: " instead'; - $data = [$content]; - $phpcsFile->addWarning($error, $tag, 'InvalidVersion', $data); - } - } - - }//end processVersion() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php deleted file mode 100644 index c47466a0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php +++ /dev/null @@ -1,583 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class FileCommentSniff implements Sniff -{ - - /** - * Tags in correct order and related info. - * - * @var array - */ - protected $tags = [ - '@category' => [ - 'required' => true, - 'allow_multiple' => false, - ], - '@package' => [ - 'required' => true, - 'allow_multiple' => false, - ], - '@subpackage' => [ - 'required' => false, - 'allow_multiple' => false, - ], - '@author' => [ - 'required' => true, - 'allow_multiple' => true, - ], - '@copyright' => [ - 'required' => false, - 'allow_multiple' => true, - ], - '@license' => [ - 'required' => true, - 'allow_multiple' => false, - ], - '@version' => [ - 'required' => false, - 'allow_multiple' => false, - ], - '@link' => [ - 'required' => true, - 'allow_multiple' => true, - ], - '@see' => [ - 'required' => false, - 'allow_multiple' => true, - ], - '@since' => [ - 'required' => false, - 'allow_multiple' => false, - ], - '@deprecated' => [ - 'required' => false, - 'allow_multiple' => false, - ], - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Find the next non whitespace token. - $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - - // Allow declare() statements at the top of the file. - if ($tokens[$commentStart]['code'] === T_DECLARE) { - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($commentStart + 1)); - $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($semicolon + 1), null, true); - } - - // Ignore vim header. - if ($tokens[$commentStart]['code'] === T_COMMENT) { - if (strstr($tokens[$commentStart]['content'], 'vim:') !== false) { - $commentStart = $phpcsFile->findNext( - T_WHITESPACE, - ($commentStart + 1), - null, - true - ); - } - } - - $errorToken = ($stackPtr + 1); - if (isset($tokens[$errorToken]) === false) { - $errorToken--; - } - - if ($tokens[$commentStart]['code'] === T_CLOSE_TAG) { - // We are only interested if this is the first open tag. - return $phpcsFile->numTokens; - } else if ($tokens[$commentStart]['code'] === T_COMMENT) { - $error = 'You must use "/**" style comments for a file comment'; - $phpcsFile->addError($error, $errorToken, 'WrongStyle'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - return $phpcsFile->numTokens; - } else if ($commentStart === false - || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG - ) { - $phpcsFile->addError('Missing file doc comment', $errorToken, 'Missing'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return $phpcsFile->numTokens; - } - - $commentEnd = $tokens[$commentStart]['comment_closer']; - - for ($nextToken = ($commentEnd + 1); $nextToken < $phpcsFile->numTokens; $nextToken++) { - if ($tokens[$nextToken]['code'] === T_WHITESPACE) { - continue; - } - - if ($tokens[$nextToken]['code'] === T_ATTRIBUTE - && isset($tokens[$nextToken]['attribute_closer']) === true - ) { - $nextToken = $tokens[$nextToken]['attribute_closer']; - continue; - } - - break; - } - - if ($nextToken === $phpcsFile->numTokens) { - $nextToken--; - } - - $ignore = [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - T_FUNCTION, - T_CLOSURE, - T_PUBLIC, - T_PRIVATE, - T_PROTECTED, - T_FINAL, - T_STATIC, - T_ABSTRACT, - T_READONLY, - T_CONST, - T_PROPERTY, - ]; - - if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { - $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return $phpcsFile->numTokens; - } - - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - - // Check the PHP Version, which should be in some text before the first tag. - $found = false; - for ($i = ($commentStart + 1); $i < $commentEnd; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_TAG) { - break; - } else if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING - && strstr(strtolower($tokens[$i]['content']), 'php version') !== false - ) { - $found = true; - break; - } - } - - if ($found === false) { - $error = 'PHP version not specified'; - $phpcsFile->addWarning($error, $commentEnd, 'MissingVersion'); - } - - // Check each tag. - $this->processTags($phpcsFile, $stackPtr, $commentStart); - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - - /** - * Processes each required or optional tag. - * - * @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 $commentStart Position in the stack where the comment started. - * - * @return void - */ - protected function processTags($phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - if (get_class($this) === 'PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FileCommentSniff') { - $docBlock = 'file'; - } else { - $docBlock = 'class'; - } - - $commentEnd = $tokens[$commentStart]['comment_closer']; - - $foundTags = []; - $tagTokens = []; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - $name = $tokens[$tag]['content']; - if (isset($this->tags[$name]) === false) { - continue; - } - - if ($this->tags[$name]['allow_multiple'] === false && isset($tagTokens[$name]) === true) { - $error = 'Only one %s tag is allowed in a %s comment'; - $data = [ - $name, - $docBlock, - ]; - $phpcsFile->addError($error, $tag, 'Duplicate'.ucfirst(substr($name, 1)).'Tag', $data); - } - - $foundTags[] = $name; - $tagTokens[$name][] = $tag; - - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { - $error = 'Content missing for %s tag in %s comment'; - $data = [ - $name, - $docBlock, - ]; - $phpcsFile->addError($error, $tag, 'Empty'.ucfirst(substr($name, 1)).'Tag', $data); - continue; - } - }//end foreach - - // Check if the tags are in the correct position. - $pos = 0; - foreach ($this->tags as $tag => $tagData) { - if (isset($tagTokens[$tag]) === false) { - if ($tagData['required'] === true) { - $error = 'Missing %s tag in %s comment'; - $data = [ - $tag, - $docBlock, - ]; - $phpcsFile->addError($error, $commentEnd, 'Missing'.ucfirst(substr($tag, 1)).'Tag', $data); - } - - continue; - } else { - $method = 'process'.substr($tag, 1); - if (method_exists($this, $method) === true) { - // Process each tag if a method is defined. - call_user_func([$this, $method], $phpcsFile, $tagTokens[$tag]); - } - } - - if (isset($foundTags[$pos]) === false) { - break; - } - - if ($foundTags[$pos] !== $tag) { - $error = 'The tag in position %s should be the %s tag'; - $data = [ - ($pos + 1), - $tag, - ]; - $phpcsFile->addError($error, $tokens[$commentStart]['comment_tags'][$pos], ucfirst(substr($tag, 1)).'TagOrder', $data); - } - - // Account for multiple tags. - $pos++; - while (isset($foundTags[$pos]) === true && $foundTags[$pos] === $tag) { - $pos++; - } - }//end foreach - - }//end processTags() - - - /** - * Process the category tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processCategory($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if (Common::isUnderscoreName($content) !== true) { - $newContent = str_replace(' ', '_', $content); - $nameBits = explode('_', $newContent); - $firstBit = array_shift($nameBits); - $newName = ucfirst($firstBit).'_'; - foreach ($nameBits as $bit) { - if ($bit !== '') { - $newName .= ucfirst($bit).'_'; - } - } - - $error = 'Category name "%s" is not valid; consider "%s" instead'; - $validName = trim($newName, '_'); - $data = [ - $content, - $validName, - ]; - $phpcsFile->addError($error, $tag, 'InvalidCategory', $data); - } - }//end foreach - - }//end processCategory() - - - /** - * Process the package tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processPackage($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if (Common::isUnderscoreName($content) === true) { - continue; - } - - $newContent = str_replace(' ', '_', $content); - $newContent = trim($newContent, '_'); - $newContent = preg_replace('/[^A-Za-z_]/', '', $newContent); - - if ($newContent === '') { - $error = 'Package name "%s" is not valid'; - $data = [$content]; - $phpcsFile->addError($error, $tag, 'InvalidPackageValue', $data); - } else { - $nameBits = explode('_', $newContent); - $firstBit = array_shift($nameBits); - $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; - foreach ($nameBits as $bit) { - if ($bit !== '') { - $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; - } - } - - $error = 'Package name "%s" is not valid; consider "%s" instead'; - $validName = trim($newName, '_'); - $data = [ - $content, - $validName, - ]; - $phpcsFile->addError($error, $tag, 'InvalidPackage', $data); - }//end if - }//end foreach - - }//end processPackage() - - - /** - * Process the subpackage tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processSubpackage($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if (Common::isUnderscoreName($content) === true) { - continue; - } - - $newContent = str_replace(' ', '_', $content); - $nameBits = explode('_', $newContent); - $firstBit = array_shift($nameBits); - $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; - foreach ($nameBits as $bit) { - if ($bit !== '') { - $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; - } - } - - $error = 'Subpackage name "%s" is not valid; consider "%s" instead'; - $validName = trim($newName, '_'); - $data = [ - $content, - $validName, - ]; - $phpcsFile->addError($error, $tag, 'InvalidSubpackage', $data); - }//end foreach - - }//end processSubpackage() - - - /** - * Process the author tag(s) that this header comment has. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processAuthor($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - $local = '\da-zA-Z-_+'; - // Dot character cannot be the first or last character in the local-part. - $localMiddle = $local.'.\w'; - if (preg_match('/^([^<]*)\s+<(['.$local.'](['.$localMiddle.']*['.$local.'])*@[\da-zA-Z][-.\w]*[\da-zA-Z]\.[a-zA-Z]{2,})>$/', $content) === 0) { - $error = 'Content of the @author tag must be in the form "Display Name "'; - $phpcsFile->addError($error, $tag, 'InvalidAuthors'); - } - } - - }//end processAuthor() - - - /** - * Process the copyright tags. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processCopyright($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - $matches = []; - if (preg_match('/^([0-9]{4})((.{1})([0-9]{4}))? (.+)$/', $content, $matches) !== 0) { - // Check earliest-latest year order. - if ($matches[3] !== '' && $matches[3] !== null) { - if ($matches[3] !== '-') { - $error = 'A hyphen must be used between the earliest and latest year'; - $phpcsFile->addError($error, $tag, 'CopyrightHyphen'); - } - - if ($matches[4] !== '' && $matches[4] !== null && $matches[4] < $matches[1]) { - $error = "Invalid year span \"$matches[1]$matches[3]$matches[4]\" found; consider \"$matches[4]-$matches[1]\" instead"; - $phpcsFile->addWarning($error, $tag, 'InvalidCopyright'); - } - } - } else { - $error = '@copyright tag must contain a year and the name of the copyright holder'; - $phpcsFile->addError($error, $tag, 'IncompleteCopyright'); - } - }//end foreach - - }//end processCopyright() - - - /** - * Process the license tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processLicense($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - $matches = []; - preg_match('/^([^\s]+)\s+(.*)/', $content, $matches); - if (count($matches) !== 3) { - $error = '@license tag must contain a URL and a license name'; - $phpcsFile->addError($error, $tag, 'IncompleteLicense'); - } - } - - }//end processLicense() - - - /** - * Process the version tag. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $tags The tokens for these tags. - * - * @return void - */ - protected function processVersion($phpcsFile, array $tags) - { - $tokens = $phpcsFile->getTokens(); - foreach ($tags as $tag) { - if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING) { - // No content. - continue; - } - - $content = $tokens[($tag + 2)]['content']; - if (strstr($content, 'CVS:') === false - && strstr($content, 'SVN:') === false - && strstr($content, 'GIT:') === false - && strstr($content, 'HG:') === false - ) { - $error = 'Invalid version "%s" in file comment; consider "CVS: " or "SVN: " or "GIT: " or "HG: " instead'; - $data = [$content]; - $phpcsFile->addWarning($error, $tag, 'InvalidVersion', $data); - } - } - - }//end processVersion() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php deleted file mode 100644 index ee242cf6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php +++ /dev/null @@ -1,539 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionCommentSniff implements Sniff -{ - - /** - * Disable the check for functions with a lower visibility than the value given. - * - * Allowed values are public, protected, and private. - * - * @var string - */ - public $minimumVisibility = 'private'; - - /** - * Array of methods which do not require a return type. - * - * @var array - */ - public $specialMethods = [ - '__construct', - '__destruct', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $scopeModifier = $phpcsFile->getMethodProperties($stackPtr)['scope']; - if (($scopeModifier === 'protected' - && $this->minimumVisibility === 'public') - || ($scopeModifier === 'private' - && ($this->minimumVisibility === 'public' || $this->minimumVisibility === 'protected')) - ) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $ignore = Tokens::$methodPrefixes; - $ignore[T_WHITESPACE] = T_WHITESPACE; - - for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { - if (isset($ignore[$tokens[$commentEnd]['code']]) === true) { - continue; - } - - if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END - && isset($tokens[$commentEnd]['attribute_opener']) === true - ) { - $commentEnd = $tokens[$commentEnd]['attribute_opener']; - continue; - } - - break; - } - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - // Inline comments might just be closing comments for - // control structures or functions instead of function comments - // using the wrong comment type. If there is other code on the line, - // assume they relate to that code. - $prev = $phpcsFile->findPrevious($ignore, ($commentEnd - 1), null, true); - if ($prev !== false && $tokens[$prev]['line'] === $tokens[$commentEnd]['line']) { - $commentEnd = $prev; - } - } - - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG - && $tokens[$commentEnd]['code'] !== T_COMMENT - ) { - $function = $phpcsFile->getDeclarationName($stackPtr); - $phpcsFile->addError( - 'Missing doc comment for function %s()', - $stackPtr, - 'Missing', - [$function] - ); - $phpcsFile->recordMetric($stackPtr, 'Function has doc comment', 'no'); - return; - } else { - $phpcsFile->recordMetric($stackPtr, 'Function has doc comment', 'yes'); - } - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a function comment', $stackPtr, 'WrongStyle'); - return; - } - - if ($tokens[$commentEnd]['line'] !== ($tokens[$stackPtr]['line'] - 1)) { - for ($i = ($commentEnd + 1); $i < $stackPtr; $i++) { - if ($tokens[$i]['column'] !== 1) { - continue; - } - - if ($tokens[$i]['code'] === T_WHITESPACE - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - ) { - $error = 'There must be no blank lines after the function comment'; - $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) { - if ($tokens[$tag]['content'] === '@see') { - // Make sure the tag isn't empty. - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { - $error = 'Content missing for @see tag in function comment'; - $phpcsFile->addError($error, $tag, 'EmptySees'); - } - } - } - - $this->processReturn($phpcsFile, $stackPtr, $commentStart); - $this->processThrows($phpcsFile, $stackPtr, $commentStart); - $this->processParams($phpcsFile, $stackPtr, $commentStart); - - }//end process() - - - /** - * Process the return comment of this function comment. - * - * @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 $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - // Skip constructor and destructor. - $methodName = $phpcsFile->getDeclarationName($stackPtr); - $isSpecialMethod = in_array($methodName, $this->specialMethods, true); - - $return = null; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@return') { - if ($return !== null) { - $error = 'Only 1 @return tag is allowed in a function comment'; - $phpcsFile->addError($error, $tag, 'DuplicateReturn'); - return; - } - - $return = $tag; - } - } - - if ($return !== null) { - $content = $tokens[($return + 2)]['content']; - if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) { - $error = 'Return type missing for @return tag in function comment'; - $phpcsFile->addError($error, $return, 'MissingReturnType'); - } - } else { - if ($isSpecialMethod === true) { - return; - } - - $error = 'Missing @return tag in function comment'; - $phpcsFile->addError($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn'); - }//end if - - }//end processReturn() - - - /** - * Process any throw tags that this function comment has. - * - * @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 $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processThrows(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] !== '@throws') { - continue; - } - - $exception = null; - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches); - $exception = $matches[1]; - } - - if ($exception === null) { - $error = 'Exception type missing for @throws tag in function comment'; - $phpcsFile->addError($error, $tag, 'InvalidThrows'); - } - }//end foreach - - }//end processThrows() - - - /** - * Process the function parameter comments. - * - * @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 $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processParams(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - $params = []; - $maxType = 0; - $maxVar = 0; - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($tokens[$tag]['content'] !== '@param') { - continue; - } - - $type = ''; - $typeSpace = 0; - $var = ''; - $varSpace = 0; - $comment = ''; - $commentEnd = 0; - $commentTokens = []; - - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/((?:(?![$.]|&(?=\$)).)*)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches); - - if (empty($matches) === false) { - $typeLen = strlen($matches[1]); - $type = trim($matches[1]); - $typeSpace = ($typeLen - strlen($type)); - $typeLen = strlen($type); - if ($typeLen > $maxType) { - $maxType = $typeLen; - } - } - - if (isset($matches[2]) === true) { - $var = $matches[2]; - $varLen = strlen($var); - if ($varLen > $maxVar) { - $maxVar = $varLen; - } - - if (isset($matches[4]) === true) { - $varSpace = strlen($matches[3]); - $comment = $matches[4]; - - // Any strings until the next tag belong to this comment. - if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { - $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; - } else { - $end = $tokens[$commentStart]['comment_closer']; - } - - for ($i = ($tag + 3); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - $comment .= ' '.$tokens[$i]['content']; - $commentEnd = $i; - $commentTokens[] = $i; - } - } - } else { - $error = 'Missing parameter comment'; - $phpcsFile->addError($error, $tag, 'MissingParamComment'); - }//end if - } else { - $error = 'Missing parameter name'; - $phpcsFile->addError($error, $tag, 'MissingParamName'); - }//end if - } else { - $error = 'Missing parameter type'; - $phpcsFile->addError($error, $tag, 'MissingParamType'); - }//end if - - $params[] = [ - 'tag' => $tag, - 'type' => $type, - 'var' => $var, - 'comment' => $comment, - 'comment_end' => $commentEnd, - 'comment_tokens' => $commentTokens, - 'type_space' => $typeSpace, - 'var_space' => $varSpace, - ]; - }//end foreach - - $realParams = $phpcsFile->getMethodParameters($stackPtr); - $foundParams = []; - - // We want to use ... for all variable length arguments, so add - // this prefix to the variable name so comparisons are easier. - foreach ($realParams as $pos => $param) { - if ($param['variable_length'] === true) { - $realParams[$pos]['name'] = '...'.$realParams[$pos]['name']; - } - } - - foreach ($params as $pos => $param) { - if ($param['var'] === '') { - continue; - } - - $foundParams[] = $param['var']; - - if (trim($param['type']) !== '') { - // Check number of spaces after the type. - $spaces = ($maxType - strlen($param['type']) + 1); - if ($param['type_space'] !== $spaces) { - $error = 'Expected %s spaces after parameter type; %s found'; - $data = [ - $spaces, - $param['type_space'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamType', $data); - if ($fix === true) { - $commentToken = ($param['tag'] + 2); - - $content = $param['type']; - $content .= str_repeat(' ', $spaces); - $content .= $param['var']; - $content .= str_repeat(' ', $param['var_space']); - - $wrapLength = ($tokens[$commentToken]['length'] - $param['type_space'] - $param['var_space'] - strlen($param['type']) - strlen($param['var'])); - - $star = $phpcsFile->findPrevious(T_DOC_COMMENT_STAR, $param['tag']); - $spaceLength = (strlen($content) + $tokens[($commentToken - 1)]['length'] + $tokens[($commentToken - 2)]['length']); - - $padding = str_repeat(' ', ($tokens[$star]['column'] - 1)); - $padding .= '* '; - $padding .= str_repeat(' ', $spaceLength); - - $content .= wordwrap( - $param['comment'], - $wrapLength, - $phpcsFile->eolChar.$padding - ); - - $phpcsFile->fixer->replaceToken($commentToken, $content); - for ($i = ($commentToken + 1); $i <= $param['comment_end']; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - }//end if - }//end if - }//end if - - // Make sure the param name is correct. - if (isset($realParams[$pos]) === true) { - $realName = $realParams[$pos]['name']; - if ($realName !== $param['var']) { - $code = 'ParamNameNoMatch'; - $data = [ - $param['var'], - $realName, - ]; - - $error = 'Doc comment for parameter %s does not match '; - if (strtolower($param['var']) === strtolower($realName)) { - $error .= 'case of '; - $code = 'ParamNameNoCaseMatch'; - } - - $error .= 'actual variable name %s'; - - $phpcsFile->addError($error, $param['tag'], $code, $data); - } - } else if (substr($param['var'], -4) !== ',...') { - // We must have an extra parameter comment. - $error = 'Superfluous parameter comment'; - $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment'); - }//end if - - if ($param['comment'] === '') { - continue; - } - - // Check number of spaces after the param name. - $spaces = ($maxVar - strlen($param['var']) + 1); - if ($param['var_space'] !== $spaces) { - $error = 'Expected %s spaces after parameter name; %s found'; - $data = [ - $spaces, - $param['var_space'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamName', $data); - if ($fix === true) { - $commentToken = ($param['tag'] + 2); - - $content = $param['type']; - $content .= str_repeat(' ', $param['type_space']); - $content .= $param['var']; - $content .= str_repeat(' ', $spaces); - - $wrapLength = ($tokens[$commentToken]['length'] - $param['type_space'] - $param['var_space'] - strlen($param['type']) - strlen($param['var'])); - - $star = $phpcsFile->findPrevious(T_DOC_COMMENT_STAR, $param['tag']); - $spaceLength = (strlen($content) + $tokens[($commentToken - 1)]['length'] + $tokens[($commentToken - 2)]['length']); - - $padding = str_repeat(' ', ($tokens[$star]['column'] - 1)); - $padding .= '* '; - $padding .= str_repeat(' ', $spaceLength); - - $content .= wordwrap( - $param['comment'], - $wrapLength, - $phpcsFile->eolChar.$padding - ); - - $phpcsFile->fixer->replaceToken($commentToken, $content); - for ($i = ($commentToken + 1); $i <= $param['comment_end']; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - }//end if - }//end if - - // Check the alignment of multi-line param comments. - if ($param['tag'] !== $param['comment_end']) { - $wrapLength = ($tokens[($param['tag'] + 2)]['length'] - $param['type_space'] - $param['var_space'] - strlen($param['type']) - strlen($param['var'])); - - $startColumn = ($tokens[($param['tag'] + 2)]['column'] + $tokens[($param['tag'] + 2)]['length'] - $wrapLength); - - $star = $phpcsFile->findPrevious(T_DOC_COMMENT_STAR, $param['tag']); - $expected = ($startColumn - $tokens[$star]['column'] - 1); - - foreach ($param['comment_tokens'] as $commentToken) { - if ($tokens[$commentToken]['column'] === $startColumn) { - continue; - } - - $found = 0; - if ($tokens[($commentToken - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { - $found = $tokens[($commentToken - 1)]['length']; - } - - $error = 'Parameter comment not aligned correctly; expected %s spaces but found %s'; - $data = [ - $expected, - $found, - ]; - - if ($found < $expected) { - $code = 'ParamCommentAlignment'; - } else { - $code = 'ParamCommentAlignmentExceeded'; - } - - $fix = $phpcsFile->addFixableError($error, $commentToken, $code, $data); - if ($fix === true) { - $padding = str_repeat(' ', $expected); - if ($tokens[($commentToken - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($commentToken - 1), $padding); - } else { - $phpcsFile->fixer->addContentBefore($commentToken, $padding); - } - } - }//end foreach - }//end if - }//end foreach - - $realNames = []; - foreach ($realParams as $realParam) { - $realNames[] = $realParam['name']; - } - - // Report missing comments. - $diff = array_diff($realNames, $foundParams); - foreach ($diff as $neededParam) { - $error = 'Doc comment for parameter "%s" missing'; - $data = [$neededParam]; - $phpcsFile->addError($error, $commentStart, 'MissingParamTag', $data); - } - - }//end processParams() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php deleted file mode 100644 index 71c11808..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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\Sniffs\Sniff; - -class InlineCommentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_COMMENT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if ($tokens[$stackPtr]['content'][0] === '#') { - $phpcsFile->recordMetric($stackPtr, 'Inline comment style', '# ...'); - - $error = 'Perl-style comments are not allowed. Use "// Comment."'; - $error .= ' or "/* comment */" instead.'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStyle'); - if ($fix === true) { - $newComment = ltrim($tokens[$stackPtr]['content'], '# '); - $newComment = '// '.$newComment; - $phpcsFile->fixer->replaceToken($stackPtr, $newComment); - } - } else if ($tokens[$stackPtr]['content'][0] === '/' - && $tokens[$stackPtr]['content'][1] === '/' - ) { - $phpcsFile->recordMetric($stackPtr, 'Inline comment style', '// ...'); - } else if ($tokens[$stackPtr]['content'][0] === '/' - && $tokens[$stackPtr]['content'][1] === '*' - ) { - $phpcsFile->recordMetric($stackPtr, 'Inline comment style', '/* ... */'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php deleted file mode 100644 index 4ca5451b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Sniffs\AbstractPatternSniff; - -class ControlSignatureSniff extends AbstractPatternSniff -{ - - /** - * If true, comments will be ignored if they are found in the code. - * - * @var boolean - */ - public $ignoreComments = true; - - - /** - * Returns the patterns that this test wishes to verify. - * - * @return string[] - */ - protected function getPatterns() - { - return [ - 'do {EOL...} while (...);EOL', - 'while (...) {EOL', - 'for (...) {EOL', - 'if (...) {EOL', - 'foreach (...) {EOL', - '} else if (...) {EOL', - '} elseif (...) {EOL', - '} else {EOL', - 'do {EOL', - 'match (...) {EOL', - ]; - - }//end getPatterns() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php deleted file mode 100644 index 08752eda..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php +++ /dev/null @@ -1,283 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class MultiLineConditionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_ELSEIF, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { - return; - } - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - $spaceAfterOpen = 0; - if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - if (strpos($tokens[($openBracket + 1)]['content'], $phpcsFile->eolChar) !== false) { - $spaceAfterOpen = 'newline'; - } else { - $spaceAfterOpen = $tokens[($openBracket + 1)]['length']; - } - } - - if ($spaceAfterOpen !== 0) { - $error = 'First condition of a multi-line IF statement must directly follow the opening parenthesis'; - $fix = $phpcsFile->addFixableError($error, ($openBracket + 1), 'SpacingAfterOpenBrace'); - if ($fix === true) { - if ($spaceAfterOpen === 'newline') { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } else { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } - } - } - - // We need to work out how far indented the if statement - // itself is, so we can work out how far to indent conditions. - $statementIndent = 0; - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) { - $i++; - break; - } - } - - if ($i >= 0 && $tokens[$i]['code'] === T_WHITESPACE) { - $statementIndent = $tokens[$i]['length']; - } - - // Each line between the parenthesis should be indented 4 spaces - // and start with an operator, unless the line is inside a - // function call, in which case it is ignored. - $prevLine = $tokens[$openBracket]['line']; - for ($i = ($openBracket + 1); $i <= $closeBracket; $i++) { - if ($i === $closeBracket && $tokens[$openBracket]['line'] !== $tokens[$i]['line']) { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), null, true); - if ($tokens[$prev]['line'] === $tokens[$i]['line']) { - // Closing bracket is on the same line as a condition. - $error = 'Closing parenthesis of a multi-line IF statement must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketNewLine'); - if ($fix === true) { - // Account for a comment at the end of the line. - $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true); - if ($tokens[$next]['code'] !== T_COMMENT - && isset(Tokens::$phpcsCommentTokens[$tokens[$next]['code']]) === false - ) { - $phpcsFile->fixer->addNewlineBefore($closeBracket); - } else { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($closeBracket, ''); - $phpcsFile->fixer->addContentBefore($next, ')'); - $phpcsFile->fixer->endChangeset(); - } - } - } - }//end if - - if ($tokens[$i]['line'] !== $prevLine) { - if ($tokens[$i]['line'] === $tokens[$closeBracket]['line']) { - $next = $phpcsFile->findNext(T_WHITESPACE, $i, null, true); - if ($next !== $closeBracket) { - $expectedIndent = ($statementIndent + $this->indent); - } else { - // Closing brace needs to be indented to the same level - // as the statement. - $expectedIndent = $statementIndent; - }//end if - } else { - $expectedIndent = ($statementIndent + $this->indent); - }//end if - - if ($tokens[$i]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true - ) { - $prevLine = $tokens[$i]['line']; - continue; - } - - // We changed lines, so this should be a whitespace indent token. - if ($tokens[$i]['code'] !== T_WHITESPACE) { - $foundIndent = 0; - } else { - $foundIndent = $tokens[$i]['length']; - } - - if ($expectedIndent !== $foundIndent) { - $error = 'Multi-line IF statement not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'Alignment', $data); - if ($fix === true) { - $spaces = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $spaces); - } else { - $phpcsFile->fixer->replaceToken($i, $spaces); - } - } - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, $i, null, true); - if ($next !== $closeBracket && $tokens[$next]['line'] === $tokens[$i]['line']) { - if (isset(Tokens::$booleanOperators[$tokens[$next]['code']]) === false) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $openBracket, true); - $fixable = true; - if (isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === false - && $phpcsFile->findNext(T_WHITESPACE, ($prev + 1), $next, true) !== false - ) { - // Condition spread over multi-lines interspersed with comments. - $fixable = false; - } - - $error = 'Each line in a multi-line IF statement must begin with a boolean operator'; - if ($fixable === false) { - $phpcsFile->addError($error, $next, 'StartWithBoolean'); - } else { - $fix = $phpcsFile->addFixableError($error, $next, 'StartWithBoolean'); - if ($fix === true) { - if (isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($prev, ''); - $phpcsFile->fixer->addContentBefore($next, $tokens[$prev]['content'].' '); - $phpcsFile->fixer->endChangeset(); - } else { - for ($x = ($prev + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - } - } - } - }//end if - }//end if - - $prevLine = $tokens[$i]['line']; - }//end if - - if ($tokens[$i]['code'] === T_STRING) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), null, true); - if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) { - // This is a function call, so skip to the end as they - // have their own indentation rules. - $i = $tokens[$next]['parenthesis_closer']; - $prevLine = $tokens[$i]['line']; - continue; - } - } - }//end for - - // From here on, we are checking the spacing of the opening and closing - // braces. If this IF statement does not use braces, we end here. - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - // The opening brace needs to be one space away from the closing parenthesis. - $openBrace = $tokens[$stackPtr]['scope_opener']; - $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), $openBrace, true); - if ($next !== false) { - // Probably comments in between tokens, so don't check. - return; - } - - if ($tokens[$openBrace]['line'] > $tokens[$closeBracket]['line']) { - $length = -1; - } else if ($openBrace === ($closeBracket + 1)) { - $length = 0; - } else if ($openBrace === ($closeBracket + 2) - && $tokens[($closeBracket + 1)]['code'] === T_WHITESPACE - ) { - $length = $tokens[($closeBracket + 1)]['length']; - } else { - // Confused, so don't check. - $length = 1; - } - - if ($length === 1) { - return; - } - - $data = [$length]; - $code = 'SpaceBeforeOpenBrace'; - - $error = 'There must be a single space between the closing parenthesis and the opening brace of a multi-line IF statement; found '; - if ($length === -1) { - $error .= 'newline'; - $code = 'NewlineBeforeOpenBrace'; - } else { - $error .= '%s spaces'; - } - - $fix = $phpcsFile->addFixableError($error, ($closeBracket + 1), $code, $data); - if ($fix === true) { - if ($length === 0) { - $phpcsFile->fixer->addContent($closeBracket, ' '); - } else { - $phpcsFile->fixer->replaceToken(($closeBracket + 1), ' '); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php deleted file mode 100644 index e0ed0fb1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php +++ /dev/null @@ -1,136 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class IncludingFileSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_INCLUDE_ONCE, - T_REQUIRE_ONCE, - T_REQUIRE, - T_INCLUDE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS) { - $error = '"%s" is a statement not a function; no parentheses are required'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'BracketsNotRequired', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($tokens[$nextToken]['parenthesis_closer'], ''); - if ($tokens[($nextToken - 1)]['code'] !== T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($nextToken, ' '); - } else { - $phpcsFile->fixer->replaceToken($nextToken, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - if (count($tokens[$stackPtr]['conditions']) !== 0) { - $inCondition = true; - } else { - $inCondition = false; - } - - // Check to see if this including statement is within the parenthesis - // of a condition. If that's the case then we need to process it as being - // within a condition, as they are checking the return value. - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - foreach ($tokens[$stackPtr]['nested_parenthesis'] as $left => $right) { - if (isset($tokens[$left]['parenthesis_owner']) === true) { - $inCondition = true; - } - } - } - - // Check to see if they are assigning the return value of this - // including call. If they are then they are probably checking it, so - // it's conditional. - $previous = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if (isset(Tokens::$assignmentTokens[$tokens[$previous]['code']]) === true) { - // The have assigned the return value to it, so its conditional. - $inCondition = true; - } - - $tokenCode = $tokens[$stackPtr]['code']; - if ($inCondition === true) { - // We are inside a conditional statement. We need an include_once. - if ($tokenCode === T_REQUIRE_ONCE) { - $error = 'File is being conditionally included; '; - $error .= 'use "include_once" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseIncludeOnce'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'include_once'); - } - } else if ($tokenCode === T_REQUIRE) { - $error = 'File is being conditionally included; '; - $error .= 'use "include" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseInclude'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'include'); - } - } - } else { - // We are unconditionally including, we need a require_once. - if ($tokenCode === T_INCLUDE_ONCE) { - $error = 'File is being unconditionally included; '; - $error .= 'use "require_once" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseRequireOnce'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'require_once'); - } - } else if ($tokenCode === T_INCLUDE) { - $error = 'File is being unconditionally included; '; - $error .= 'use "require" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseRequire'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'require'); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php deleted file mode 100644 index 0f18710d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class MultiLineAssignmentSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EQUAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Equal sign can't be the last thing on the line. - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next === false) { - // Bad assignment. - return; - } - - if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - $error = 'Multi-line assignments must have the equal sign on the second line'; - $phpcsFile->addError($error, $stackPtr, 'EqualSignLine'); - return; - } - - // Make sure it is the first thing on the line, otherwise we ignore it. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), false, true); - if ($prev === false) { - // Bad assignment. - return; - } - - if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) { - return; - } - - // Find the required indent based on the ident of the previous line. - $assignmentIndent = 0; - $prevLine = $tokens[$prev]['line']; - for ($i = ($prev - 1); $i >= 0; $i--) { - if ($tokens[$i]['line'] !== $prevLine) { - $i++; - break; - } - } - - if ($tokens[$i]['code'] === T_WHITESPACE) { - $assignmentIndent = $tokens[$i]['length']; - } - - // Find the actual indent. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1)); - - $expectedIndent = ($assignmentIndent + $this->indent); - $foundIndent = $tokens[$prev]['length']; - if ($foundIndent !== $expectedIndent) { - $error = 'Multi-line assignment not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - $phpcsFile->addError($error, $stackPtr, 'Indent', $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php deleted file mode 100644 index 772ab6b8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php +++ /dev/null @@ -1,634 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionCallSignatureSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - /** - * If TRUE, multiple arguments can be defined per line in a multi-line call. - * - * @var boolean - */ - public $allowMultipleArguments = true; - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $tokens = Tokens::$functionNameTokens; - - $tokens[] = T_VARIABLE; - $tokens[] = T_CLOSE_CURLY_BRACKET; - $tokens[] = T_CLOSE_SQUARE_BRACKET; - $tokens[] = T_CLOSE_PARENTHESIS; - - return $tokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_CLOSE_CURLY_BRACKET - && isset($tokens[$stackPtr]['scope_condition']) === true - ) { - // Not a function call. - return; - } - - // Find the next non-empty token. - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) { - // Not a function call. - return; - } - - if (isset($tokens[$openBracket]['parenthesis_closer']) === false) { - // Not a function call. - return; - } - - // Find the previous non-empty token. - $search = Tokens::$emptyTokens; - $search[] = T_BITWISE_AND; - $previous = $phpcsFile->findPrevious($search, ($stackPtr - 1), null, true); - if ($tokens[$previous]['code'] === T_FUNCTION) { - // It's a function definition, not a function call. - return; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - if (($stackPtr + 1) !== $openBracket) { - // Checking this: $value = my_function[*](...). - $error = 'Space before opening parenthesis of function call prohibited'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeOpenBracket'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $openBracket; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Modify the bracket as well to ensure a conflict if the bracket - // has been changed in some way by another sniff. - $phpcsFile->fixer->replaceToken($openBracket, '('); - $phpcsFile->fixer->endChangeset(); - } - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON) { - if (isset(Tokens::$emptyTokens[$tokens[($closeBracket + 1)]['code']]) === true) { - $error = 'Space after closing parenthesis of function call prohibited'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'SpaceAfterCloseBracket'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closeBracket + 1); $i < $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Modify the bracket as well to ensure a conflict if the bracket - // has been changed in some way by another sniff. - $phpcsFile->fixer->replaceToken($closeBracket, ')'); - $phpcsFile->fixer->endChangeset(); - } - } - } - - // Check if this is a single line or multi-line function call. - if ($this->isMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { - $this->processMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens); - } else { - $this->processSingleLineCall($phpcsFile, $stackPtr, $openBracket, $tokens); - } - - }//end process() - - - /** - * Determine if this is a multi-line function call. - * - * @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 $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return bool - */ - public function isMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) - { - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { - return true; - } - - return false; - - }//end isMultiLineCall() - - - /** - * Processes single-line calls. - * - * @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 $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processSingleLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) - { - $closer = $tokens[$openBracket]['parenthesis_closer']; - if ($openBracket === ($closer - 1)) { - return; - } - - // If the function call has no arguments or comments, enforce 0 spaces. - $next = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), $closer, true); - if ($next === false) { - $requiredSpacesAfterOpen = 0; - $requiredSpacesBeforeClose = 0; - } else { - $requiredSpacesAfterOpen = $this->requiredSpacesAfterOpen; - $requiredSpacesBeforeClose = $this->requiredSpacesBeforeClose; - } - - if ($requiredSpacesAfterOpen === 0 && $tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - // Checking this: $value = my_function([*]...). - $error = 'Space after opening parenthesis of function call prohibited'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } - } else if ($requiredSpacesAfterOpen > 0) { - $spaceAfterOpen = 0; - if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - $spaceAfterOpen = $tokens[($openBracket + 1)]['length']; - } - - if ($spaceAfterOpen !== $requiredSpacesAfterOpen) { - $error = 'Expected %s spaces after opening parenthesis; %s found'; - $data = [ - $requiredSpacesAfterOpen, - $spaceAfterOpen, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket', $data); - if ($fix === true) { - $padding = str_repeat(' ', $requiredSpacesAfterOpen); - if ($spaceAfterOpen === 0) { - $phpcsFile->fixer->addContent($openBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($openBracket + 1), $padding); - } - } - } - }//end if - - // Checking this: $value = my_function(...[*]). - $spaceBeforeClose = 0; - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closer - 1), $openBracket, true); - if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) { - // Need a newline after these tokens, so ignore this rule. - return; - } - - if ($tokens[$prev]['line'] !== $tokens[$closer]['line']) { - $spaceBeforeClose = 'newline'; - } else if ($tokens[($closer - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = $tokens[($closer - 1)]['length']; - } - - if ($spaceBeforeClose !== $requiredSpacesBeforeClose) { - $error = 'Expected %s spaces before closing parenthesis; %s found'; - $data = [ - $requiredSpacesBeforeClose, - $spaceBeforeClose, - ]; - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceBeforeCloseBracket', $data); - if ($fix === true) { - $padding = str_repeat(' ', $requiredSpacesBeforeClose); - - if ($spaceBeforeClose === 0) { - $phpcsFile->fixer->addContentBefore($closer, $padding); - } else if ($spaceBeforeClose === 'newline') { - $phpcsFile->fixer->beginChangeset(); - - $closingContent = ')'; - - $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON) { - $closingContent .= ';'; - for ($i = ($closer + 1); $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - // We want to jump over any whitespace or inline comment and - // move the closing parenthesis after any other token. - $prev = ($closer - 1); - while (isset(Tokens::$emptyTokens[$tokens[$prev]['code']]) === true) { - if (($tokens[$prev]['code'] === T_COMMENT) - && (strpos($tokens[$prev]['content'], '*/') !== false) - ) { - break; - } - - $prev--; - } - - $phpcsFile->fixer->addContent($prev, $padding.$closingContent); - - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($closer - 1), null, true); - for ($i = ($prevNonWhitespace + 1); $i <= $closer; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($closer - 1), $padding); - }//end if - }//end if - }//end if - - }//end processSingleLineCall() - - - /** - * Processes multi-line calls. - * - * @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 $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) - { - // We need to work out how far indented the function - // call itself is, so we can work out how far to - // indent the arguments. - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - 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 - // the indent from there. - $prev = $phpcsFile->findPrevious(T_CONSTANT_ENCAPSED_STRING, ($first - 2), null, true); - $first = $phpcsFile->findFirstOnLine(Tokens::$emptyTokens, $prev, true); - if ($first === false) { - $first = ($prev + 1); - } - } - - $foundFunctionIndent = 0; - if ($first !== false) { - if ($tokens[$first]['code'] === T_INLINE_HTML - || ($tokens[$first]['code'] === T_CONSTANT_ENCAPSED_STRING - && $tokens[($first - 1)]['code'] === T_CONSTANT_ENCAPSED_STRING) - ) { - $trimmed = ltrim($tokens[$first]['content']); - if ($trimmed === '') { - $foundFunctionIndent = strlen($tokens[$first]['content']); - } else { - $foundFunctionIndent = (strlen($tokens[$first]['content']) - strlen($trimmed)); - } - } else { - $foundFunctionIndent = ($tokens[$first]['column'] - 1); - } - } - - // Make sure the function indent is divisible by the indent size. - // We round down here because this accounts for times when the - // surrounding code is indented a little too far in, and not correctly - // at a tab stop. Without this, the function will be indented a further - // $indent spaces to the right. - $functionIndent = (int) (floor($foundFunctionIndent / $this->indent) * $this->indent); - $adjustment = 0; - - if ($foundFunctionIndent !== $functionIndent) { - $error = 'Opening statement of multi-line function call not indented correctly; expected %s spaces but found %s'; - $data = [ - $functionIndent, - $foundFunctionIndent, - ]; - - $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); - if ($foundFunctionIndent === 0) { - $phpcsFile->fixer->addContentBefore($first, $padding); - } else if ($tokens[$first]['code'] === T_INLINE_HTML) { - $newContent = $padding.ltrim($tokens[$first]['content']); - $phpcsFile->fixer->replaceToken($first, $newContent); - } else { - $phpcsFile->fixer->replaceToken(($first - 1), $padding); - } - } - }//end if - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { - $error = 'Opening parenthesis of a multi-line function call must be the last content on the line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpenBracket'); - if ($fix === true) { - $phpcsFile->fixer->addContent( - $openBracket, - $phpcsFile->eolChar.str_repeat(' ', ($foundFunctionIndent + $this->indent)) - ); - } - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true); - if ($tokens[$prev]['line'] === $tokens[$closeBracket]['line']) { - $error = 'Closing parenthesis of a multi-line function call must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketLine'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore( - $closeBracket, - $phpcsFile->eolChar.str_repeat(' ', ($foundFunctionIndent + $this->indent)) - ); - } - } - - // Each line between the parenthesis should be indented n spaces. - $lastLine = ($tokens[$openBracket]['line'] - 1); - $argStart = null; - $argEnd = null; - - // Start processing at the first argument. - $i = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), null, true); - - if ($tokens[$i]['line'] > ($tokens[$openBracket]['line'] + 1)) { - $error = 'The first argument in a multi-line function call must be on the line after the opening parenthesis'; - $fix = $phpcsFile->addFixableError($error, $i, 'FirstArgumentPosition'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($openBracket + 1); $x < $i; $x++) { - if ($tokens[$x]['line'] === $tokens[$openBracket]['line']) { - continue; - } - - if ($tokens[$x]['line'] === $tokens[$i]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - $i = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - - if ($tokens[($i - 1)]['code'] === T_WHITESPACE - && $tokens[($i - 1)]['line'] === $tokens[$i]['line'] - ) { - // Make sure we check the indent. - $i--; - } - - for ($i; $i < $closeBracket; $i++) { - if ($i > $argStart && $i < $argEnd) { - $inArg = true; - } else { - $inArg = false; - } - - if ($tokens[$i]['line'] !== $lastLine) { - $lastLine = $tokens[$i]['line']; - - // Ignore heredoc indentation. - if (isset(Tokens::$heredocTokens[$tokens[$i]['code']]) === true) { - continue; - } - - // Ignore multi-line string indentation. - if (isset(Tokens::$stringTokens[$tokens[$i]['code']]) === true - && $tokens[$i]['code'] === $tokens[($i - 1)]['code'] - ) { - continue; - } - - // Ignore inline HTML. - if ($tokens[$i]['code'] === T_INLINE_HTML) { - continue; - } - - if ($tokens[$i]['line'] !== $tokens[$openBracket]['line']) { - // We changed lines, so this should be a whitespace indent token, but first make - // sure it isn't a blank line because we don't need to check indent unless there - // is actually some code to indent. - if ($tokens[$i]['code'] === T_WHITESPACE) { - $nextCode = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closeBracket + 1), true); - if ($tokens[$nextCode]['line'] !== $lastLine) { - if ($inArg === false) { - $error = 'Empty lines are not allowed in multi-line function calls'; - $fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - continue; - } - } else { - $nextCode = $i; - } - - if ($tokens[$nextCode]['line'] === $tokens[$closeBracket]['line']) { - // Closing brace needs to be indented to the same level - // as the function call. - $inArg = false; - $expectedIndent = ($foundFunctionIndent + $adjustment); - } else { - $expectedIndent = ($foundFunctionIndent + $this->indent + $adjustment); - } - - if ($tokens[$i]['code'] !== T_WHITESPACE - && $tokens[$i]['code'] !== T_DOC_COMMENT_WHITESPACE - ) { - // Just check if it is a multi-line block comment. If so, we can - // calculate the indent from the whitespace before the content. - if ($tokens[$i]['code'] === T_COMMENT - && $tokens[($i - 1)]['code'] === T_COMMENT - ) { - $trimmedLength = strlen(ltrim($tokens[$i]['content'])); - if ($trimmedLength === 0) { - // This is a blank comment line, so indenting it is - // pointless. - continue; - } - - $foundIndent = (strlen($tokens[$i]['content']) - $trimmedLength); - } else { - $foundIndent = 0; - } - } else { - $foundIndent = $tokens[$i]['length']; - } - - if ($foundIndent < $expectedIndent - || ($inArg === false - && $expectedIndent !== $foundIndent) - ) { - $error = 'Multi-line function call not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $padding = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $padding); - if (isset($tokens[$i]['scope_opener']) === true) { - $phpcsFile->fixer->changeCodeBlockIndent($i, $tokens[$i]['scope_closer'], $expectedIndent); - } - } else { - if ($tokens[$i]['code'] === T_COMMENT) { - $comment = $padding.ltrim($tokens[$i]['content']); - $phpcsFile->fixer->replaceToken($i, $comment); - } else { - $phpcsFile->fixer->replaceToken($i, $padding); - } - - if (isset($tokens[($i + 1)]['scope_opener']) === true) { - $phpcsFile->fixer->changeCodeBlockIndent(($i + 1), $tokens[($i + 1)]['scope_closer'], ($expectedIndent - $foundIndent)); - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - } else { - $nextCode = $i; - }//end if - - if ($inArg === false) { - $argStart = $nextCode; - $argEnd = $phpcsFile->findEndOfStatement($nextCode, [T_COLON]); - } - }//end if - - // If we are within an argument we should be ignoring commas - // as these are not signalling the end of an argument. - if ($inArg === false && $tokens[$i]['code'] === T_COMMA) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $closeBracket, true); - if ($next === false) { - continue; - } - - if ($this->allowMultipleArguments === false) { - // Comma has to be the last token on the line. - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - $error = 'Only one argument is allowed per line in a multi-line function call'; - $fix = $phpcsFile->addFixableError($error, $next, 'MultipleArguments'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($next - 1); $x > $i; $x--) { - if ($tokens[$x]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContentBefore( - $next, - $phpcsFile->eolChar.str_repeat(' ', ($foundFunctionIndent + $this->indent)) - ); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - $argStart = $next; - $argEnd = $phpcsFile->findEndOfStatement($next, [T_COLON]); - }//end if - }//end for - - }//end processMultiLineCall() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php deleted file mode 100644 index 1d0745b9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php +++ /dev/null @@ -1,549 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceBsdAllmanSniff; -use PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceKernighanRitchieSniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionDeclarationSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - || $tokens[$stackPtr]['parenthesis_opener'] === null - || $tokens[$stackPtr]['parenthesis_closer'] === null - ) { - return; - } - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - - if (strtolower($tokens[$stackPtr]['content']) === 'function') { - // Must be one space after the FUNCTION keyword. - if ($tokens[($stackPtr + 1)]['content'] === $phpcsFile->eolChar) { - $spaces = 'newline'; - } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $spaces = $tokens[($stackPtr + 1)]['length']; - } else { - $spaces = 0; - } - - if ($spaces !== 1) { - $error = 'Expected 1 space after FUNCTION keyword; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterFunction', $data); - if ($fix === true) { - if ($spaces === 0) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } - }//end if - - // Must be no space before the opening parenthesis. For closures, this is - // enforced by the previous check because there is no content between the keywords - // and the opening parenthesis. - // Unfinished closures are tokenized as T_FUNCTION however, and can be excluded - // by checking for the scope_opener. - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - if ($tokens[$stackPtr]['code'] === T_FUNCTION - && (isset($tokens[$stackPtr]['scope_opener']) === true || $methodProps['has_body'] === false) - ) { - if ($tokens[($openBracket - 1)]['content'] === $phpcsFile->eolChar) { - $spaces = 'newline'; - } else if ($tokens[($openBracket - 1)]['code'] === T_WHITESPACE) { - $spaces = $tokens[($openBracket - 1)]['length']; - } else { - $spaces = 0; - } - - if ($spaces !== 0) { - $error = 'Expected 0 spaces before opening parenthesis; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $openBracket, 'SpaceBeforeOpenParen', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openBracket - 1), ''); - } - } - - // Must be no space before semicolon in abstract/interface methods. - if ($methodProps['has_body'] === false) { - $end = $phpcsFile->findNext(T_SEMICOLON, $closeBracket); - if ($end !== false) { - if ($tokens[($end - 1)]['content'] === $phpcsFile->eolChar) { - $spaces = 'newline'; - } else if ($tokens[($end - 1)]['code'] === T_WHITESPACE) { - $spaces = $tokens[($end - 1)]['length']; - } else { - $spaces = 0; - } - - if ($spaces !== 0) { - $error = 'Expected 0 spaces before semicolon; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $end, 'SpaceBeforeSemicolon', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($end - 1), ''); - } - } - } - }//end if - }//end if - - // Must be one space before and after USE keyword for closures. - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - if ($tokens[($use + 1)]['code'] !== T_WHITESPACE) { - $length = 0; - } else if ($tokens[($use + 1)]['content'] === "\t") { - $length = '\t'; - } else { - $length = $tokens[($use + 1)]['length']; - } - - if ($length !== 1) { - $error = 'Expected 1 space after USE keyword; found %s'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $use, 'SpaceAfterUse', $data); - if ($fix === true) { - if ($length === 0) { - $phpcsFile->fixer->addContent($use, ' '); - } else { - $phpcsFile->fixer->replaceToken(($use + 1), ' '); - } - } - } - - if ($tokens[($use - 1)]['code'] !== T_WHITESPACE) { - $length = 0; - } else if ($tokens[($use - 1)]['content'] === "\t") { - $length = '\t'; - } else { - $length = $tokens[($use - 1)]['length']; - } - - if ($length !== 1) { - $error = 'Expected 1 space before USE keyword; found %s'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $use, 'SpaceBeforeUse', $data); - if ($fix === true) { - if ($length === 0) { - $phpcsFile->fixer->addContentBefore($use, ' '); - } else { - $phpcsFile->fixer->replaceToken(($use - 1), ' '); - } - } - } - }//end if - }//end if - - if ($this->isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { - $this->processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens); - } else { - $this->processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens); - } - - }//end process() - - - /** - * Determine if this is a multi-line function declaration. - * - * @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 $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return bool - */ - public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) - { - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { - return true; - } - - // Closures may use the USE keyword and so be multi-line in this way. - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - // If the opening and closing parenthesis of the use statement - // are also on the same line, this is a single line declaration. - $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $close = $tokens[$open]['parenthesis_closer']; - if ($tokens[$open]['line'] !== $tokens[$close]['line']) { - return true; - } - } - } - - return false; - - }//end isMultiLineDeclaration() - - - /** - * Processes single-line declarations. - * - * Just uses the Generic BSD-Allman brace sniff. - * - * @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 array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens) - { - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $sniff = new OpeningFunctionBraceKernighanRitchieSniff(); - } else { - $sniff = new OpeningFunctionBraceBsdAllmanSniff(); - } - - $sniff->checkClosures = true; - $sniff->process($phpcsFile, $stackPtr); - - }//end processSingleLineDeclaration() - - - /** - * Processes multi-line declarations. - * - * @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 array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens) - { - $this->processArgumentList($phpcsFile, $stackPtr, $this->indent); - - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $closeBracket = $tokens[$open]['parenthesis_closer']; - } - } - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - // 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'; - $code = 'NewlineBeforeOpenBrace'; - - $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 { - $fix = $phpcsFile->addFixableError($error, $opener, $code); - if ($fix === 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 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 { - // 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() - - - /** - * Processes multi-line argument list declarations. - * - * @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 $indent The number of spaces code should be indented. - * @param string $type The type of the token the brackets - * belong to. - * - * @return void - */ - public function processArgumentList($phpcsFile, $stackPtr, $indent, $type='function') - { - $tokens = $phpcsFile->getTokens(); - - // We need to work out how far indented the function - // declaration itself is, so we can work out how far to - // indent parameters. - $functionIndent = 0; - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) { - break; - } - } - - // Move $i back to the line the function is or to 0. - $i++; - - if ($tokens[$i]['code'] === T_WHITESPACE) { - $functionIndent = $tokens[$i]['length']; - } - - // The closing parenthesis must be on a new line, even - // when checking abstract function definitions. - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - $prev = $phpcsFile->findPrevious( - T_WHITESPACE, - ($closeBracket - 1), - null, - true - ); - - if ($tokens[$closeBracket]['line'] !== $tokens[$tokens[$closeBracket]['parenthesis_opener']]['line'] - && $tokens[$prev]['line'] === $tokens[$closeBracket]['line'] - ) { - $error = 'The closing parenthesis of a multi-line '.$type.' declaration must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($closeBracket); - } - } - - // If this is a closure and is using a USE statement, the closing - // parenthesis we need to look at from now on is the closing parenthesis - // of the USE statement. - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $closeBracket = $tokens[$open]['parenthesis_closer']; - - $prev = $phpcsFile->findPrevious( - T_WHITESPACE, - ($closeBracket - 1), - null, - true - ); - - if ($tokens[$closeBracket]['line'] !== $tokens[$tokens[$closeBracket]['parenthesis_opener']]['line'] - && $tokens[$prev]['line'] === $tokens[$closeBracket]['line'] - ) { - $error = 'The closing parenthesis of a multi-line use declaration must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'UseCloseBracketLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($closeBracket); - } - } - }//end if - }//end if - - // Each line between the parenthesis should be indented 4 spaces. - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $lastLine = $tokens[$openBracket]['line']; - for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { - if ($tokens[$i]['line'] !== $lastLine) { - if ($i === $tokens[$stackPtr]['parenthesis_closer'] - || ($tokens[$i]['code'] === T_WHITESPACE - && (($i + 1) === $closeBracket - || ($i + 1) === $tokens[$stackPtr]['parenthesis_closer'])) - ) { - // Closing braces need to be indented to the same level - // as the function. - $expectedIndent = $functionIndent; - } else { - $expectedIndent = ($functionIndent + $indent); - } - - // We changed lines, so this should be a whitespace indent token. - $foundIndent = 0; - if ($tokens[$i]['code'] === T_WHITESPACE - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - ) { - $error = 'Blank lines are not allowed in a multi-line '.$type.' declaration'; - $fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // This is an empty line, so don't check the indent. - continue; - } else if ($tokens[$i]['code'] === T_WHITESPACE) { - $foundIndent = $tokens[$i]['length']; - } else if ($tokens[$i]['code'] === T_DOC_COMMENT_WHITESPACE) { - $foundIndent = $tokens[$i]['length']; - ++$expectedIndent; - } - - if ($expectedIndent !== $foundIndent) { - $error = 'Multi-line '.$type.' declaration not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); - if ($fix === true) { - $spaces = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $spaces); - } else { - $phpcsFile->fixer->replaceToken($i, $spaces); - } - } - } - - $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) { - $i = $tokens[$i]['bracket_closer']; - } else { - $i = $tokens[$i]['parenthesis_closer']; - } - - $lastLine = $tokens[$i]['line']; - continue; - } - - if ($tokens[$i]['code'] === T_ATTRIBUTE) { - // Skip attributes as they have their own indentation rules. - $i = $tokens[$i]['attribute_closer']; - $lastLine = $tokens[$i]['line']; - continue; - } - }//end for - - }//end processArgumentList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php deleted file mode 100644 index 9952daa4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ValidDefaultValueSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - T_FN, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - // Flag for when we have found a default in our arg list. - // If there is a value without a default after this, it is an error. - $defaultFound = false; - - $params = $phpcsFile->getMethodParameters($stackPtr); - foreach ($params as $param) { - if ($param['variable_length'] === true) { - continue; - } - - if (array_key_exists('default', $param) === true) { - $defaultFound = true; - // Check if the arg is type hinted and using NULL for the default. - // This does not make the argument optional - it just allows NULL - // to be passed in. - if ($param['type_hint'] !== '' && strtolower($param['default']) === 'null') { - $defaultFound = false; - } - - continue; - } - - if ($defaultFound === true) { - $error = 'Arguments with default values must be at the end of the argument list'; - $phpcsFile->addError($error, $param['token'], 'NotAtEnd'); - return; - } - }//end foreach - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php deleted file mode 100644 index c2ed80ac..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php +++ /dev/null @@ -1,98 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ValidClassNameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being processed. - * @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(); - - $className = $phpcsFile->findNext(T_STRING, $stackPtr); - $name = trim($tokens[$className]['content']); - $errorData = [ucfirst($tokens[$stackPtr]['content'])]; - - // Make sure the first letter is a capital. - if (preg_match('|^[A-Z]|', $name) === 0) { - $error = '%s name must begin with a capital letter'; - $phpcsFile->addError($error, $stackPtr, 'StartWithCapital', $errorData); - } - - // Check that each new word starts with a capital as well, but don't - // check the first word, as it is checked above. - $validName = true; - $nameBits = explode('_', $name); - $firstBit = array_shift($nameBits); - foreach ($nameBits as $bit) { - if ($bit === '' || $bit[0] !== strtoupper($bit[0])) { - $validName = false; - break; - } - } - - if ($validName === false) { - // Strip underscores because they cause the suggested name - // to be incorrect. - $nameBits = explode('_', trim($name, '_')); - $firstBit = array_shift($nameBits); - if ($firstBit === '') { - $error = '%s name is not valid'; - $phpcsFile->addError($error, $stackPtr, 'Invalid', $errorData); - } else { - $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; - foreach ($nameBits as $bit) { - if ($bit !== '') { - $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; - } - } - - $newName = rtrim($newName, '_'); - $error = '%s name is not valid; consider %s instead'; - $data = $errorData; - $data[] = $newName; - $phpcsFile->addError($error, $stackPtr, 'Invalid', $data); - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php deleted file mode 100644 index b1521aa6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ /dev/null @@ -1,284 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Tokens; - -class ValidFunctionNameSniff extends AbstractScopeSniff -{ - - /** - * A list of all PHP magic methods. - * - * @var array - */ - protected $magicMethods = [ - 'construct' => true, - 'destruct' => true, - 'call' => true, - 'callstatic' => true, - 'get' => true, - 'set' => true, - 'isset' => true, - 'unset' => true, - 'sleep' => true, - 'wakeup' => true, - 'serialize' => true, - 'unserialize' => true, - 'tostring' => true, - 'invoke' => true, - 'set_state' => true, - 'clone' => true, - 'debuginfo' => true, - ]; - - /** - * A list of all PHP magic functions. - * - * @var array - */ - protected $magicFunctions = ['autoload' => true]; - - - /** - * Constructs a PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff. - */ - public function __construct() - { - parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION], true); - - }//end __construct() - - - /** - * Processes the tokens within the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * @param int $currScope The position of the current scope. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - $className = $phpcsFile->getDeclarationName($currScope); - if (isset($className) === false) { - $className = '[Anonymous Class]'; - } - - $errorData = [$className.'::'.$methodName]; - - $methodNameLc = strtolower($methodName); - $classNameLc = strtolower($className); - - // Is this a magic method. i.e., is prefixed with "__" ? - if (preg_match('|^__[^_]|', $methodName) !== 0) { - $magicPart = substr($methodNameLc, 2); - if (isset($this->magicMethods[$magicPart]) === true) { - return; - } - - $error = 'Method name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'MethodDoubleUnderscore', $errorData); - } - - // PHP4 constructors are allowed to break our rules. - if ($methodNameLc === $classNameLc) { - return; - } - - // PHP4 destructors are allowed to break our rules. - if ($methodNameLc === '_'.$classNameLc) { - return; - } - - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - $scope = $methodProps['scope']; - $scopeSpecified = $methodProps['scope_specified']; - - if ($methodProps['scope'] === 'private') { - $isPublic = false; - } else { - $isPublic = true; - } - - // If it's a private method, it must have an underscore on the front. - if ($isPublic === false) { - if ($methodName[0] !== '_') { - $error = 'Private method name "%s" must be prefixed with an underscore'; - $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $errorData); - $phpcsFile->recordMetric($stackPtr, 'Private method prefixed with underscore', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Private method prefixed with underscore', 'yes'); - } - } - - // If it's not a private method, it must not have an underscore on the front. - if ($isPublic === true && $scopeSpecified === true && $methodName[0] === '_') { - $error = '%s method name "%s" must not be prefixed with an underscore'; - $data = [ - ucfirst($scope), - $errorData[0], - ]; - $phpcsFile->addError($error, $stackPtr, 'PublicUnderscore', $data); - } - - $testMethodName = ltrim($methodName, '_'); - - if (Common::isCamelCaps($testMethodName, false, true, false) === false) { - if ($scopeSpecified === true) { - $error = '%s method name "%s" is not in camel caps format'; - $data = [ - ucfirst($scope), - $errorData[0], - ]; - $phpcsFile->addError($error, $stackPtr, 'ScopeNotCamelCaps', $data); - } else { - $error = 'Method name "%s" is not in camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - } - } - - }//end processTokenWithinScope() - - - /** - * Processes the tokens outside the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if ($functionName === null) { - // Ignore closures. - return; - } - - if (ltrim($functionName, '_') === '') { - // Ignore special functions. - return; - } - - $errorData = [$functionName]; - - // Is this a magic function. i.e., it is prefixed with "__". - if (preg_match('|^__[^_]|', $functionName) !== 0) { - $magicPart = strtolower(substr($functionName, 2)); - if (isset($this->magicFunctions[$magicPart]) === true) { - return; - } - - $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'FunctionDoubleUnderscore', $errorData); - } - - // Function names can be in two parts; the package name and - // the function name. - $packagePart = ''; - $underscorePos = strrpos($functionName, '_'); - if ($underscorePos === false) { - $camelCapsPart = $functionName; - } else { - $packagePart = substr($functionName, 0, $underscorePos); - $camelCapsPart = substr($functionName, ($underscorePos + 1)); - - // We don't care about _'s on the front. - $packagePart = ltrim($packagePart, '_'); - } - - // If it has a package part, make sure the first letter is a capital. - if ($packagePart !== '') { - if ($functionName[0] === '_') { - $error = 'Function name "%s" is invalid; only private methods should be prefixed with an underscore'; - $phpcsFile->addError($error, $stackPtr, 'FunctionUnderscore', $errorData); - } - - if ($functionName[0] !== strtoupper($functionName[0])) { - $error = 'Function name "%s" is prefixed with a package name but does not begin with a capital letter'; - $phpcsFile->addError($error, $stackPtr, 'FunctionNoCapital', $errorData); - } - } - - // If it doesn't have a camel caps part, it's not valid. - if (trim($camelCapsPart) === '') { - $error = 'Function name "%s" is not valid; name appears incomplete'; - $phpcsFile->addError($error, $stackPtr, 'FunctionInvalid', $errorData); - return; - } - - $validName = true; - $newPackagePart = $packagePart; - $newCamelCapsPart = $camelCapsPart; - - // Every function must have a camel caps part, so check that first. - if (Common::isCamelCaps($camelCapsPart, false, true, false) === false) { - $validName = false; - $newCamelCapsPart = strtolower($camelCapsPart[0]).substr($camelCapsPart, 1); - } - - if ($packagePart !== '') { - // Check that each new word starts with a capital. - $nameBits = explode('_', $packagePart); - $nameBits = array_filter($nameBits); - foreach ($nameBits as $bit) { - if ($bit[0] !== strtoupper($bit[0])) { - $newPackagePart = ''; - foreach ($nameBits as $bit) { - $newPackagePart .= strtoupper($bit[0]).substr($bit, 1).'_'; - } - - $validName = false; - break; - } - } - } - - if ($validName === false) { - if ($newPackagePart === '') { - $newName = $newCamelCapsPart; - } else { - $newName = rtrim($newPackagePart, '_').'_'.$newCamelCapsPart; - } - - $error = 'Function name "%s" is invalid; consider "%s" instead'; - $data = $errorData; - $data[] = $newName; - $phpcsFile->addError($error, $stackPtr, 'FunctionNameInvalid', $data); - } - - }//end processTokenOutsideScope() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php deleted file mode 100644 index 48674b1e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; - -class ValidVariableNameSniff extends AbstractVariableSniff -{ - - - /** - * Processes class member variables. - * - * @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 - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $memberProps = $phpcsFile->getMemberProperties($stackPtr); - if (empty($memberProps) === true) { - return; - } - - $memberName = ltrim($tokens[$stackPtr]['content'], '$'); - $scope = $memberProps['scope']; - $scopeSpecified = $memberProps['scope_specified']; - - if ($memberProps['scope'] === 'private') { - $isPublic = false; - } else { - $isPublic = true; - } - - // If it's a private member, it must have an underscore on the front. - if ($isPublic === false && $memberName[0] !== '_') { - $error = 'Private member variable "%s" must be prefixed with an underscore'; - $data = [$memberName]; - $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $data); - return; - } - - // If it's not a private member, it must not have an underscore on the front. - if ($isPublic === true && $scopeSpecified === true && $memberName[0] === '_') { - $error = '%s member variable "%s" must not be prefixed with an underscore'; - $data = [ - ucfirst($scope), - $memberName, - ]; - $phpcsFile->addError($error, $stackPtr, 'PublicUnderscore', $data); - return; - } - - }//end processMemberVar() - - - /** - * Processes normal variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariable() - - - /** - * Processes variables in double quoted strings. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariableInString() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php deleted file mode 100644 index 9c64c328..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php +++ /dev/null @@ -1,204 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ObjectOperatorIndentSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - /** - * Indicates whether multilevel indenting is allowed. - * - * @var boolean - */ - public $multilevel = false; - - /** - * Tokens to listen for. - * - * @var array - */ - private $targets = [ - T_OBJECT_OPERATOR, - T_NULLSAFE_OBJECT_OPERATOR, - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return $this->targets; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. - * @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(); - - // Make sure this is the first object operator in a chain of them. - $start = $phpcsFile->findStartOfStatement($stackPtr); - $prev = $phpcsFile->findPrevious($this->targets, ($stackPtr - 1), $start); - if ($prev !== false) { - return; - } - - // Make sure this is a chained call. - $end = $phpcsFile->findEndOfStatement($stackPtr); - $next = $phpcsFile->findNext($this->targets, ($stackPtr + 1), $end); - if ($next === false) { - // Not a chained call. - return; - } - - // Determine correct indent. - for ($i = ($start - 1); $i >= 0; $i--) { - if ($tokens[$i]['line'] !== $tokens[$start]['line']) { - $i++; - break; - } - } - - $baseIndent = 0; - if ($i >= 0 && $tokens[$i]['code'] === T_WHITESPACE) { - $baseIndent = $tokens[$i]['length']; - } - - $baseIndent += $this->indent; - - // Determine the scope of the original object operator. - $origBrackets = null; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $origBrackets = $tokens[$stackPtr]['nested_parenthesis']; - } - - $origConditions = null; - if (isset($tokens[$stackPtr]['conditions']) === true) { - $origConditions = $tokens[$stackPtr]['conditions']; - } - - // Check indentation of each object operator in the chain. - // If the first object operator is on a different line than - // the variable, make sure we check its indentation too. - if ($tokens[$stackPtr]['line'] > $tokens[$start]['line']) { - $next = $stackPtr; - } - - $previousIndent = $baseIndent; - - while ($next !== false) { - // Make sure it is in the same scope, otherwise don't check indent. - $brackets = null; - if (isset($tokens[$next]['nested_parenthesis']) === true) { - $brackets = $tokens[$next]['nested_parenthesis']; - } - - $conditions = null; - if (isset($tokens[$next]['conditions']) === true) { - $conditions = $tokens[$next]['conditions']; - } - - if ($origBrackets === $brackets && $origConditions === $conditions) { - // Make sure it starts a line, otherwise don't check indent. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($next - 1), $stackPtr, true); - $indent = $tokens[($next - 1)]; - if ($tokens[$prev]['line'] !== $tokens[$next]['line'] - && $indent['code'] === T_WHITESPACE - ) { - if ($indent['line'] === $tokens[$next]['line']) { - $foundIndent = strlen($indent['content']); - } else { - $foundIndent = 0; - } - - $minIndent = $previousIndent; - $maxIndent = $previousIndent; - $expectedIndent = $previousIndent; - - if ($this->multilevel === true) { - $minIndent = max(($previousIndent - $this->indent), $baseIndent); - $maxIndent = ($previousIndent + $this->indent); - $expectedIndent = min(max($foundIndent, $minIndent), $maxIndent); - } - - if ($foundIndent < $minIndent || $foundIndent > $maxIndent) { - $error = 'Object operator not indented correctly; expected %s spaces but found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $next, 'Incorrect', $data); - if ($fix === true) { - $spaces = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($next, $spaces); - } else { - $phpcsFile->fixer->replaceToken(($next - 1), $spaces); - } - } - } - - $previousIndent = $expectedIndent; - }//end if - - // It cant be the last thing on the line either. - $content = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); - if ($tokens[$content]['line'] !== $tokens[$next]['line']) { - $error = 'Object operator must be at the start of the line, not the end'; - $fix = $phpcsFile->addFixableError($error, $next, 'StartOfLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($next + 1); $x < $content; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewlineBefore($next); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - $next = $phpcsFile->findNext( - $this->targets, - ($next + 1), - null, - false, - null, - true - ); - }//end while - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php deleted file mode 100644 index cb8e46d5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php +++ /dev/null @@ -1,182 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ScopeClosingBraceSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$scopeOpeners; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. - * @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(); - - // If this is an inline condition (ie. there is no scope opener), then - // return, as this is not a new scope. - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $scopeStart = $tokens[$stackPtr]['scope_opener']; - $scopeEnd = $tokens[$stackPtr]['scope_closer']; - - // If the scope closer doesn't think it belongs to this scope opener - // then the opener is sharing its closer with other tokens. We only - // want to process the closer once, so skip this one. - if (isset($tokens[$scopeEnd]['scope_condition']) === false - || $tokens[$scopeEnd]['scope_condition'] !== $stackPtr - ) { - return; - } - - // We need to actually find the first piece of content on this line, - // because if this is a method with tokens before it (public, static etc) - // or an if with an else before it, then we need to start the scope - // checking from there, rather than the current token. - $lineStart = ($stackPtr - 1); - for ($lineStart; $lineStart > 0; $lineStart--) { - if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false) { - break; - } - } - - $lineStart++; - - $startColumn = 1; - if ($tokens[$lineStart]['code'] === T_WHITESPACE) { - $startColumn = $tokens[($lineStart + 1)]['column']; - } else if ($tokens[$lineStart]['code'] === T_INLINE_HTML) { - $trimmed = ltrim($tokens[$lineStart]['content']); - if ($trimmed === '') { - $startColumn = $tokens[($lineStart + 1)]['column']; - } else { - $startColumn = (strlen($tokens[$lineStart]['content']) - strlen($trimmed)); - } - } - - // Check that the closing brace is on it's own line. - for ($lastContent = ($scopeEnd - 1); $lastContent > $scopeStart; $lastContent--) { - if ($tokens[$lastContent]['code'] === T_WHITESPACE || $tokens[$lastContent]['code'] === T_OPEN_TAG) { - continue; - } - - if ($tokens[$lastContent]['code'] === T_INLINE_HTML - && ltrim($tokens[$lastContent]['content']) === '' - ) { - continue; - } - - break; - } - - if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line']) { - $error = 'Closing brace must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Line'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($scopeEnd); - } - - return; - } - - // Check now that the closing brace is lined up correctly. - $lineStart = ($scopeEnd - 1); - for ($lineStart; $lineStart > 0; $lineStart--) { - if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false) { - break; - } - } - - $lineStart++; - - $braceIndent = 0; - if ($tokens[$lineStart]['code'] === T_WHITESPACE) { - $braceIndent = ($tokens[($lineStart + 1)]['column'] - 1); - } else if ($tokens[$lineStart]['code'] === T_INLINE_HTML) { - $trimmed = ltrim($tokens[$lineStart]['content']); - if ($trimmed === '') { - $braceIndent = ($tokens[($lineStart + 1)]['column'] - 1); - } else { - $braceIndent = (strlen($tokens[$lineStart]['content']) - strlen($trimmed) - 1); - } - } - - $fix = false; - if ($tokens[$stackPtr]['code'] === T_CASE - || $tokens[$stackPtr]['code'] === T_DEFAULT - ) { - // BREAK statements should be indented n spaces from the - // CASE or DEFAULT statement. - $expectedIndent = ($startColumn + $this->indent - 1); - if ($braceIndent !== $expectedIndent) { - $error = 'Case breaking statement indented incorrectly; expected %s spaces, found %s'; - $data = [ - $expectedIndent, - $braceIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'BreakIndent', $data); - } - } else { - $expectedIndent = max(0, ($startColumn - 1)); - if ($braceIndent !== $expectedIndent) { - $error = 'Closing brace indented incorrectly; expected %s spaces, found %s'; - $data = [ - $expectedIndent, - $braceIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data); - } - }//end if - - if ($fix === true) { - $spaces = str_repeat(' ', $expectedIndent); - if ($braceIndent === 0) { - $phpcsFile->fixer->addContentBefore($lineStart, $spaces); - } else { - $phpcsFile->fixer->replaceToken($lineStart, ltrim($tokens[$lineStart]['content'])); - $phpcsFile->fixer->addContentBefore($lineStart, $spaces); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php deleted file mode 100644 index e95dc8bd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff as GenericScopeIndentSniff; - -class ScopeIndentSniff extends GenericScopeIndentSniff -{ - - /** - * Any scope openers that should not cause an indent. - * - * @var int[] - */ - protected $nonIndentingScopes = [T_SWITCH]; - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc deleted file mode 100644 index 6942944b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc +++ /dev/null @@ -1,114 +0,0 @@ -setLogger(new class {}); - -var_dump(new class(10) extends SomeClass implements SomeInterface { - private $num; - - public function __construct($num) - { - $this->num = $num; - } - - use SomeTrait; -}); - -class IncorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ { -} - -class CorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration -/* Comment */ -{ -} - -// Don't move phpcs:ignore comments. -class PHPCSIgnoreAnnotationAfterOpeningBrace -{ // phpcs:ignore Standard.Cat.Sniff -- for reasons. -} - -// Moving any of the other trailing phpcs: comments is ok. -class PHPCSAnnotationAfterOpeningBrace -{ // phpcs:disable Standard.Cat.Sniff -- for reasons. -} - -if (!class_exists('ClassOpeningBraceShouldBeIndented')) { - abstract class ClassOpeningBraceShouldBeIndented -{ -} -} - -if (!class_exists('ClassOpeningBraceTooMuchIndentation')) { - final class ClassOpeningBraceTooMuchIndentation - { - } -} - -enum IncorrectBracePlacement {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed deleted file mode 100644 index 26688b15..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.1.inc.fixed +++ /dev/null @@ -1,125 +0,0 @@ -setLogger(new class {}); - -var_dump(new class(10) extends SomeClass implements SomeInterface { - private $num; - - public function __construct($num) - { - $this->num = $num; - } - - use SomeTrait; -}); - -class IncorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration /* Comment */ -{ -} - -class CorrectClassDeclarationWithCommentAtEnd extends correctClassDeclaration -/* Comment */ -{ -} - -// Don't move phpcs:ignore comments. -class PHPCSIgnoreAnnotationAfterOpeningBrace -{ // phpcs:ignore Standard.Cat.Sniff -- for reasons. -} - -// Moving any of the other trailing phpcs: comments is ok. -class PHPCSAnnotationAfterOpeningBrace -{ - // phpcs:disable Standard.Cat.Sniff -- for reasons. -} - -if (!class_exists('ClassOpeningBraceShouldBeIndented')) { - abstract class ClassOpeningBraceShouldBeIndented - { -} -} - -if (!class_exists('ClassOpeningBraceTooMuchIndentation')) { - final class ClassOpeningBraceTooMuchIndentation - { - } -} - -enum IncorrectBracePlacement -{ -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc deleted file mode 100644 index ac71fc9f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Classes/ClassDeclarationUnitTest.2.inc +++ /dev/null @@ -1,11 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff - */ -final class ClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - if ($testFile === 'ClassDeclarationUnitTest.1.inc') { - return; - } - - $config->tabWidth = 4; - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ClassDeclarationUnitTest.1.inc': - return [ - 21 => 1, - 22 => 1, - 23 => 1, - 27 => 1, - 33 => 1, - 38 => 1, - 49 => 1, - 84 => 1, - 94 => 1, - 99 => 1, - 104 => 1, - 110 => 1, - 114 => 1, - ]; - - default: - return []; - }//end switch - - }//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($testFile='') - { - if ($testFile === 'ClassDeclarationUnitTest.2.inc') { - return [11 => 1]; - } - - return[]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc deleted file mode 100644 index bd7d0618..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.inc +++ /dev/null @@ -1,163 +0,0 @@ - - * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 - */ -class Extra_Description_Newlines -{ - -}//end class - - -/** - * Sample class comment - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * @version - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Missing_Newlines_Before_Tags -{ - -}//end class - - -/** - * Simple class comment - * - * @category _wrong_category - * @package PHP_CodeSniffer - * @package ADDITIONAL PACKAGE TAG - * @subpackage SUBPACKAGE TAG - * @author Original Author - * @author Greg Sherwood gsherwood@squiz.net - * @author Mr T - * @author - * @copyright 1997~1994 The PHP Group - * @license http://www.php.net/license/3_0.txt - * @version INVALID VERSION CONTENT - * @see - * @see - * @link sdfsdf - * @see Net_Sample::Net_Sample() - * @see Net_Other - * @deprecated asd - * @unknown Unknown tag - * @since Class available since Release 1.2.0 - */ -class Checking_Tags -{ - class Sub_Class { - - }//end class - - -}//end class - - -/** - * - * - */ -class Empty_Class_Doc -{ - -}//end class - - -/** - * - * - */ -interface Empty_Interface_Doc -{ - -}//end interface - - -/** - * - * - */ -trait Empty_Trait_Doc -{ - -}//end trait - - -/** - * - * - */ -enum Empty_Enum_Doc -{ - -}//end enum - - -/** - * Sample class comment - * - * @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 - */ -#[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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php deleted file mode 100644 index d60c0fe8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/ClassCommentUnitTest.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\ClassCommentSniff - */ -final class ClassCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 15 => 1, - 51 => 1, - 63 => 1, - 65 => 2, - 66 => 1, - 68 => 1, - 70 => 1, - 71 => 1, - 72 => 1, - 74 => 2, - 75 => 1, - 76 => 1, - 77 => 1, - 85 => 1, - 96 => 5, - 106 => 5, - 116 => 5, - 126 => 5, - 161 => 1, - 163 => 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. - * - * @return array - */ - public function getWarningList() - { - return [ - 71 => 1, - 73 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc deleted file mode 100644 index 0b18fa38..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.1.inc +++ /dev/null @@ -1,53 +0,0 @@ - -* @author Greg Sherwood gsherwood@squiz.net -* @author Mr T -* @author -* @copyright 1997~1994 The PHP Group -* @copyright 1997~1994 The PHP Group -* @license http://www.php.net/license/3_0.txt -* @see -* @see -* @version INVALID VERSION CONTENT -* @see Net_Sample::Net_Sample() -* @see Net_Other -* @deprecated asd -* @since Class available since Release 1.2.0 -* @summary An unknown summary tag -* @package '' -* @subpackage !! -* @author Code AUthor -*/ -require_once '/some/path.php'; -?> - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc deleted file mode 100644 index 8845eb19..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.2.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FileComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FileCommentSniff - */ -final class FileCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FileCommentUnitTest.1.inc': - return [ - 21 => 1, - 23 => 2, - 24 => 1, - 26 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 31 => 1, - 32 => 2, - 33 => 1, - 34 => 1, - 35 => 1, - 40 => 2, - 41 => 2, - 43 => 1, - ]; - - case 'FileCommentUnitTest.2.inc': - case 'FileCommentUnitTest.3.inc': - case 'FileCommentUnitTest.4.inc': - return [1 => 1]; - - default: - return []; - }//end switch - - }//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($testFile='') - { - switch ($testFile) { - case 'FileCommentUnitTest.1.inc': - return [ - 29 => 1, - 30 => 1, - 34 => 1, - 43 => 1, - ]; - - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc deleted file mode 100644 index a20ba3a7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc +++ /dev/null @@ -1,512 +0,0 @@ - line numbers for each token. - * - * @param array $tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function foo(&$tokens, $tokenizer, $eolChar) -{ - -}//end foo() - -/** - * Gettext. - * - */ -function _() { - return $foo; -} - -class Baz { - /** - * The PHP5 constructor - * - * No return tag - */ - public function __construct() { - - } -} - -/** - * Complete a step. - * - * @param string $status Status of step to complete. - * @param array $array Array. - * @param string $note Optional note. - * - * @return void - */ -function completeStep($status, array $array = [Class1::class, 'test'], $note = '') { - echo 'foo'; -} - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string ...$name2 Comment. - * - * @return void - */ -function myFunction(string $name1, string ...$name2) { -} - - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string $name2 Comment. - * - * @return void - */ -function myFunction(string $name1, string ...$name2) { -} - -/** - * Completely invalid format, but should not cause PHP notices. - * - * @param $bar - * Comment here. - * @param ... - * Additional arguments here. - * - * @return - * Return value - * - */ -function foo($bar) { -} - -/** - * Processes the test. - * - * @param PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack - * where the listening token type - * was found. - * - * @return void - * @see register() - */ -function process(File $phpcsFile, $stackPtr) -{ - -}//end process() - -/** - * Processes the test. - * - * @param int $phpcsFile The PHP_CodeSniffer - * file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack - * where the listening token type - * was found. - * - * @return void - * @see register() - */ -function process(File $phpcsFile, $stackPtr) -{ - -}//end process() - -/** - * @param (Foo&Bar)|null $a Comment. - * @param string $b Comment. - * - * @return void - */ -public function setTranslator($a, &$b): void -{ - $this->translator = $translator; -} - -// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility protected -private function setTranslator2($a, &$b): void -{ - $this->translator = $translator; -} - -// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility public -protected function setTranslator3($a, &$b): void -{ - $this->translator = $translator; -} - -private function setTranslator4($a, &$b): void -{ - $this->translator = $translator; -} - -class Bar { - /** - * The PHP5 constructor - * - * @return - */ - public function __construct() { - - } -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] -class Bar { - /** - * The PHP5 constructor - */ - public function __construct() { - - } -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] ignored -/** - * Should be ok - */ -public function ignored() { - -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] __construct,__destruct - -class Something implements JsonSerializable { - /** - * Single attribute. - * - * @return mixed - */ - #[ReturnTypeWillChange] - public function jsonSerialize() {} - - /** - * Multiple attributes. - * - * @return Something - */ - #[AttributeA] - #[AttributeB] - public function methodName() {} - - /** - * Blank line between docblock and attribute. - * - * @return mixed - */ - - #[ReturnTypeWillChange] - public function blankLineDetectionA() {} - - /** - * Blank line between attribute and function declaration. - * - * @return mixed - */ - #[ReturnTypeWillChange] - - public function blankLineDetectionB() {} - - /** - * Blank line between both docblock and attribute and attribute and function declaration. - * - * @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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed deleted file mode 100644 index fc6d4f7e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed +++ /dev/null @@ -1,491 +0,0 @@ - line numbers for each token. - * - * @param array $tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function foo(&$tokens, $tokenizer, $eolChar) -{ - -}//end foo() - -/** - * Gettext. - * - */ -function _() { - return $foo; -} - -class Baz { - /** - * The PHP5 constructor - * - * No return tag - */ - public function __construct() { - - } -} - -/** - * Complete a step. - * - * @param string $status Status of step to complete. - * @param array $array Array. - * @param string $note Optional note. - * - * @return void - */ -function completeStep($status, array $array = [Class1::class, 'test'], $note = '') { - echo 'foo'; -} - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string ...$name2 Comment. - * - * @return void - */ -function myFunction(string $name1, string ...$name2) { -} - - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string $name2 Comment. - * - * @return void - */ -function myFunction(string $name1, string ...$name2) { -} - -/** - * Completely invalid format, but should not cause PHP notices. - * - * @param $bar - * Comment here. - * @param ... - * Additional arguments here. - * - * @return - * Return value - * - */ -function foo($bar) { -} - -/** - * Processes the test. - * - * @param PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack - * where the listening token type - * was found. - * - * @return void - * @see register() - */ -function process(File $phpcsFile, $stackPtr) -{ - -}//end process() - -/** - * Processes the test. - * - * @param int $phpcsFile The PHP_CodeSniffer - * file where the - * token occurred. - * @param int $stackPtr The position in the tokens stack - * where the listening token type - * was found. - * - * @return void - * @see register() - */ -function process(File $phpcsFile, $stackPtr) -{ - -}//end process() - -/** - * @param (Foo&Bar)|null $a Comment. - * @param string $b Comment. - * - * @return void - */ -public function setTranslator($a, &$b): void -{ - $this->translator = $translator; -} - -// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility protected -private function setTranslator2($a, &$b): void -{ - $this->translator = $translator; -} - -// phpcs:set PEAR.Commenting.FunctionComment minimumVisibility public -protected function setTranslator3($a, &$b): void -{ - $this->translator = $translator; -} - -private function setTranslator4($a, &$b): void -{ - $this->translator = $translator; -} - -class Bar { - /** - * The PHP5 constructor - * - * @return - */ - public function __construct() { - - } -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] -class Bar { - /** - * The PHP5 constructor - */ - public function __construct() { - - } -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] ignored -/** - * Should be ok - */ -public function ignored() { - -} - -// phpcs:set PEAR.Commenting.FunctionComment specialMethods[] __construct,__destruct - -class Something implements JsonSerializable { - /** - * Single attribute. - * - * @return mixed - */ - #[ReturnTypeWillChange] - public function jsonSerialize() {} - - /** - * Multiple attributes. - * - * @return Something - */ - #[AttributeA] - #[AttributeB] - public function methodName() {} - - /** - * Blank line between docblock and attribute. - * - * @return mixed - */ - #[ReturnTypeWillChange] - public function blankLineDetectionA() {} - - /** - * Blank line between attribute and function declaration. - * - * @return mixed - */ - #[ReturnTypeWillChange] - public function blankLineDetectionB() {} - - /** - * Blank line between both docblock and attribute and attribute and function declaration. - * - * @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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php deleted file mode 100644 index 62863be6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff - */ -final class FunctionCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 10 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 28 => 1, - 76 => 1, - 87 => 1, - 103 => 1, - 109 => 1, - 112 => 1, - 122 => 1, - 123 => 2, - 124 => 2, - 125 => 1, - 126 => 1, - 137 => 1, - 138 => 1, - 139 => 1, - 152 => 1, - 155 => 1, - 165 => 1, - 172 => 1, - 183 => 1, - 190 => 2, - 206 => 1, - 234 => 1, - 272 => 1, - 313 => 1, - 317 => 1, - 327 => 1, - 329 => 1, - 332 => 1, - 344 => 1, - 343 => 1, - 345 => 1, - 346 => 1, - 360 => 1, - 361 => 1, - 363 => 1, - 364 => 1, - 406 => 1, - 417 => 1, - 455 => 1, - 464 => 1, - 473 => 1, - 485 => 1, - 501 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc deleted file mode 100644 index 187228c2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Commenting/InlineCommentUnitTest.inc +++ /dev/null @@ -1,29 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the InlineComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\InlineCommentSniff - */ -final class InlineCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 15 => 1, - 24 => 1, - 25 => 1, - 27 => 1, - 28 => 1, - 29 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc deleted file mode 100644 index cc9903aa..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.inc +++ /dev/null @@ -1,165 +0,0 @@ - 0); - -do -{ - echo $i; -} while ($i > 0); - -do -{ - echo $i; -} -while ($i > 0); - -do { echo $i; } while ($i > 0); - -do{ - echo $i; -}while($i > 0); - - -// while -while ($i < 1) { - echo $i; -} - -while($i < 1){ - echo $i; -} - -while ($i < 1) { echo $i; } - - -// for -for ($i = 1; $i < 1; $i++) { - echo $i; -} - -for($i = 1; $i < 1; $i++){ - echo $i; -} - -for ($i = 1; $i < 1; $i++) { echo $i; } - - -// foreach -foreach ($items as $item) { - echo $item; -} - -foreach($items as $item){ - echo $item; -} - -foreach ($items as $item) { echo $item; } - - -// if -if ($i == 0) { - $i = 1; -} - -if($i == 0){ - $i = 1; -} - -if ($i == 0) { $i = 1; } - - -// else -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else{ - $i = 0; -} - -if ($i == 0) { $i = 1; } else { $i = 0; } - - -// else -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else{ - $i = 0; -} - -if ($i == 0) { $i = 1; } else { $i = 0; } - - -// else if -if ($i == 0) { - $i = 1; -} else if ($i == 2) { - $i = 0; -} - -if ($i == 0) { - $i = 1; -} elseif ($i == 2) { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else if($i == 2){ - $i = 0; -} - -if ($i == 0) { - $i = 1; -}elseif($i == 2){ - $i = 0; -} - -if ($i == 0) { $i = 1; } else if ($i == 2) { $i = 0; } -if ($i == 0) { $i = 1; } elseif ($i == 2) { $i = 0; } - -if ($i == 0) { // this is ok because comments are allowed - $i = 1; -} - -if ($i == 0) {// this is ok because comments are allowed - $i = 1; -} - -if ($i == 0) { /* this is ok because comments are allowed*/ - $i = 1; -} - -if ($i == 0) -{ // this is not ok - $i = 1; -} - -if ($i == 0) /* this is ok */ { -} - -if ($i == 0) { -} -else { -} - -// match -$r = match ($x) { - 1 => 1, -}; - -$r = match( $x ){ 1 => 1 }; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php deleted file mode 100644 index b387a93e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/ControlSignatureUnitTest.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ControlSignature sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\ControlSignatureSniff - */ -final class ControlSignatureUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 14 => 1, - 20 => 1, - 22 => 1, - 32 => 1, - 36 => 1, - 44 => 1, - 48 => 1, - 56 => 1, - 60 => 1, - 68 => 1, - 72 => 1, - 84 => 1, - 88 => 2, - 100 => 1, - 104 => 2, - 122 => 2, - 128 => 1, - 132 => 3, - 133 => 2, - 147 => 1, - 157 => 1, - 165 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc deleted file mode 100644 index a7a3c69d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc +++ /dev/null @@ -1,251 +0,0 @@ - -

    some text

    -errorCode() == 401 || // comment - $IPP->errorCode() == 3200) /* long comment - here - */ -{ - return false; -} - -if ($IPP->errorCode() == 401 || // comment - $IPP->errorCode() == 3200) // long comment here -{ - return false; -} - -if ($IPP->errorCode() == 401 - // Comment explaining the next condition here. - || $IPP->errorCode() == 3200 -) { - return false; -} - -function bar() { - if ($a - && $b -) { - return false; - } -} - -if ($a - && foo( - 'a', - 'b' - )) { - return false; -} - -?> - - - - - -errorCode() == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. - $IPP->errorCode() == 3200) /* - phpcs:ignore Standard.Category.Sniff -- for reasons. - */ -{ - return false; -} - -if ($IPP->errorCode() == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. - $IPP->errorCode() == 3200) // phpcs:enable -{ - return false; -} - -if ($IPP->errorCode() == 401 - // phpcs:ignore Standard.Category.Sniff -- for reasons. - || $IPP->errorCode() == 3200 -) { - return false; -} - - if ($IPP->errorCode() == 401 || - /* - * phpcs:disable Standard.Category.Sniff -- for reasons. - */ - $IPP->errorCode() == 3200 - ) { - return false; - } - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() == 3200 - // phpcs:ignore Standard.Category.Sniff -- for reasons. -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - === 'someverylongexpectedoutput' -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - // A comment. - === 'someverylongexpectedoutput' -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - // phpcs:ignore Standard.Category.Sniff -- for reasons. - === 'someverylongexpectedoutput' -) { - return false; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed deleted file mode 100644 index 7d56c461..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.inc.fixed +++ /dev/null @@ -1,247 +0,0 @@ - -

    some text

    -errorCode() == 401 // comment - || $IPP->errorCode() == 3200 /* long comment - here - */ -) { - return false; -} - -if ($IPP->errorCode() == 401 // comment - || $IPP->errorCode() == 3200 // long comment here -) { - return false; -} - -if ($IPP->errorCode() == 401 - // Comment explaining the next condition here. - || $IPP->errorCode() == 3200 -) { - return false; -} - -function bar() { - if ($a - && $b - ) { - return false; - } -} - -if ($a - && foo( - 'a', - 'b' - ) -) { - return false; -} - -?> - - - - - -errorCode() == 401 // phpcs:ignore Standard.Category.Sniff -- for reasons. - || $IPP->errorCode() == 3200 /* - phpcs:ignore Standard.Category.Sniff -- for reasons. - */ -) { - return false; -} - -if ($IPP->errorCode() == 401 // phpcs:disable Standard.Category.Sniff -- for reasons. - || $IPP->errorCode() == 3200 // phpcs:enable -) { - return false; -} - -if ($IPP->errorCode() == 401 - // phpcs:ignore Standard.Category.Sniff -- for reasons. - || $IPP->errorCode() == 3200 -) { - return false; -} - - if ($IPP->errorCode() == 401 - /* - * phpcs:disable Standard.Category.Sniff -- for reasons. - */ - || $IPP->errorCode() == 3200 - ) { - return false; - } - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() == 3200 - // phpcs:ignore Standard.Category.Sniff -- for reasons. -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() === 'someverylongexpectedoutput' -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - // A comment. - === 'someverylongexpectedoutput' -) { - return false; -} - -if ($IPP->errorCode() == 401 - || $IPP->errorCode() - // phpcs:ignore Standard.Category.Sniff -- for reasons. - === 'someverylongexpectedoutput' -) { - return false; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js deleted file mode 100644 index 064d7ff7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js +++ /dev/null @@ -1,251 +0,0 @@ -if (blah(param)) { - -} - -if ((condition1 - || condition2) - && condition3 - && condition4 - && condition5 -) { -} - -if ((condition1 || condition2) && condition3 && condition4 && condition5) { -} - -if ((condition1 || condition2) - && condition3 -) { -} - -if ( - (condition1 || condition2) - && condition3 -) { -} - -if ((condition1 - || condition2) -) { -} - -if ((condition1 - || condition2) - && condition3 && - condition4 -) { -} - -if ((condition1 - || condition2) - && condition3 - && condition4 - && condition5 -) { -} - -if (($condition1 - || $condition2) -) { -} - -if ((condition1 - || condition2) - ) { -} - -if ( - ( - condition1 - || condition2 - ) - && condition3 -) { -} - - -if ( condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} else if (condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} else if ( - condition1 - || condition2 && - condition3 -) { -} - -if (condition1 - || condition2 -|| condition3) { -} - -if (condition1 - || condition2 || condition3 -){ -} - -if (condition1) - console.info('bar'); - -if (condition1 - || condition2 -|| condition3) - console.info('bar'); - - -if (condition1 - || condition2 || condition3 -) - console.info('bar'); - -if (!a(post) - && (!a(context.header) - ^ a(context.header, 'Content-Type')) -) { -// ... -} - -if (foo) -{ - console.info('bar'); -} - -// Should be no errors even though lines are -// not exactly aligned together. Multi-line function -// call takes precedence. -if (array_key_exists(key, value) - && foo.bar.baz( - key, value2 - ) -) { -} - -if (true) { - foo = true; -}; - -if (foo == 401 || // comment - bar == 3200) /* long comment - here - */ -{ - return false; -} - -if (foo == 401 || // comment - bar == 3200) // long comment here -{ - return false; -} - -if (IPP.errorCode() == 401 - // Comment explaining the next condition here. - || IPP.errorCode() == 3200 -) { - return false; -} - -function bar() { - if (a - && b -) { - return false; - } -} - -if (a - && foo( - 'a', - 'b' - )) { - return false; -} - - - - - - - - - - - - - -if (foo == 401 || // phpcs:ignore Standard.Category.Sniff -- for reasons. - bar == 3200) /* - phpcs:ignore Standard.Category.Sniff -- for reasons. - */ -{ - return false; -} - -if (foo == 401 || // phpcs:disable Standard.Category.Sniff -- for reasons. - bar == 3200) // phpcs:enable -{ - return false; -} - -if (IPP.errorCode() == 401 - // phpcs:ignore Standard.Category.Sniff -- for reasons. - || IPP.errorCode() == 3200 -) { - return false; -} - - if (foo == 401 || - /* - * phpcs:disable Standard.Category.Sniff -- for reasons. - */ - bar == 3200 - ) { - return false; - } - -if (IPP.errorCode() == 401 - || IPP.errorCode() == 3200 - // phpcs:ignore Standard.Category.Sniff -- for reasons. -) { - return false; -} - -if (foo == 401 - || bar - == 'someverylongexpectedoutput' -) { - return false; -} - -if (IPP.errorCode() == 401 - || bar - // A comment. - == 'someverylongexpectedoutput' -) { - return false; -} - -if (foo == 401 - || IPP.errorCode() - // phpcs:ignore Standard.Category.Sniff -- for reasons. - == 'someverylongexpectedoutput' -) { - return false; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed deleted file mode 100644 index cfde75d7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.js.fixed +++ /dev/null @@ -1,247 +0,0 @@ -if (blah(param)) { - -} - -if ((condition1 - || condition2) - && condition3 - && condition4 - && condition5 -) { -} - -if ((condition1 || condition2) && condition3 && condition4 && condition5) { -} - -if ((condition1 || condition2) - && condition3 -) { -} - -if ((condition1 || condition2) - && condition3 -) { -} - -if ((condition1 - || condition2) -) { -} - -if ((condition1 - || condition2) - && condition3 - && condition4 -) { -} - -if ((condition1 - || condition2) - && condition3 - && condition4 - && condition5 -) { -} - -if (($condition1 - || $condition2) -) { -} - -if ((condition1 - || condition2) -) { -} - -if ((condition1 - || condition2) - && condition3 -) { -} - - -if (condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} else if (condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} else if (condition1 - || condition2 - && condition3 -) { -} - -if (condition1 - || condition2 - || condition3 -) { -} - -if (condition1 - || condition2 || condition3 -) { -} - -if (condition1) - console.info('bar'); - -if (condition1 - || condition2 - || condition3 -) - console.info('bar'); - - -if (condition1 - || condition2 || condition3 -) - console.info('bar'); - -if (!a(post) - && (!a(context.header) - ^ a(context.header, 'Content-Type')) -) { -// ... -} - -if (foo) { - console.info('bar'); -} - -// Should be no errors even though lines are -// not exactly aligned together. Multi-line function -// call takes precedence. -if (array_key_exists(key, value) - && foo.bar.baz( - key, value2 - ) -) { -} - -if (true) { - foo = true; -}; - -if (foo == 401 // comment - || bar == 3200 /* long comment - here - */ -) { - return false; -} - -if (foo == 401 // comment - || bar == 3200 // long comment here -) { - return false; -} - -if (IPP.errorCode() == 401 - // Comment explaining the next condition here. - || IPP.errorCode() == 3200 -) { - return false; -} - -function bar() { - if (a - && b - ) { - return false; - } -} - -if (a - && foo( - 'a', - 'b' - ) -) { - return false; -} - - - - - - - - - - - - - -if (foo == 401 // phpcs:ignore Standard.Category.Sniff -- for reasons. - || bar == 3200 /* - phpcs:ignore Standard.Category.Sniff -- for reasons. - */ -) { - return false; -} - -if (foo == 401 // phpcs:disable Standard.Category.Sniff -- for reasons. - || bar == 3200 // phpcs:enable -) { - return false; -} - -if (IPP.errorCode() == 401 - // phpcs:ignore Standard.Category.Sniff -- for reasons. - || IPP.errorCode() == 3200 -) { - return false; -} - - if (foo == 401 - /* - * phpcs:disable Standard.Category.Sniff -- for reasons. - */ - || bar == 3200 - ) { - return false; - } - -if (IPP.errorCode() == 401 - || IPP.errorCode() == 3200 - // phpcs:ignore Standard.Category.Sniff -- for reasons. -) { - return false; -} - -if (foo == 401 - || bar == 'someverylongexpectedoutput' -) { - return false; -} - -if (IPP.errorCode() == 401 - || bar - // A comment. - == 'someverylongexpectedoutput' -) { - return false; -} - -if (foo == 401 - || IPP.errorCode() - // phpcs:ignore Standard.Category.Sniff -- for reasons. - == 'someverylongexpectedoutput' -) { - return false; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php deleted file mode 100644 index 263906d1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the MultiLineCondition sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\MultiLineConditionSniff - */ -final class MultiLineConditionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - $errors = [ - 21 => 1, - 22 => 1, - 35 => 1, - 40 => 1, - 41 => 1, - 42 => 1, - 43 => 1, - 49 => 1, - 54 => 1, - 57 => 1, - 58 => 1, - 59 => 1, - 61 => 1, - 67 => 1, - 87 => 1, - 88 => 1, - 89 => 1, - 90 => 1, - 96 => 2, - 101 => 1, - 109 => 2, - 125 => 1, - 145 => 2, - 153 => 2, - 168 => 1, - 177 => 1, - 194 => 2, - 202 => 2, - 215 => 1, - 218 => 2, - 232 => 2, - 239 => 1, - 240 => 2, - 248 => 2, - ]; - - if ($testFile === 'MultiLineConditionUnitTest.inc') { - $errors[183] = 1; - } - - return $errors; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc deleted file mode 100644 index dadfe923..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Files/IncludingFileUnitTest.inc +++ /dev/null @@ -1,99 +0,0 @@ - -
    -Some content goes here.
    -
    -
    - -
    -    Some content goes here.
    -    
    -    
    - -
    -Some content goes here.
    -
    -
    - -
    -    Some content goes here.
    -    
    -    
    - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the IncludingFile sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Files\IncludingFileSniff - */ -final class IncludingFileUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 5 => 1, - 11 => 1, - 12 => 1, - 16 => 1, - 17 => 1, - 33 => 1, - 34 => 1, - 47 => 1, - 48 => 1, - 64 => 1, - 65 => 1, - 73 => 1, - 74 => 1, - 85 => 1, - 86 => 1, - 98 => 1, - 99 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc deleted file mode 100644 index fc6aea00..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.inc +++ /dev/null @@ -1,22 +0,0 @@ -additionalHeaderData[$this->strApplicationName] - = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); - -$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] - = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); - -$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] = - $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); - -$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] - = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); -$GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] = 'boo'; - -$var='string'; - -function getInstalledStandards( - $includeGeneric=false, - $standardsDir='' -) { -} -?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php deleted file mode 100644 index 1be3296c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Formatting/MultiLineAssignmentUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Formatting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the MultiLineAssignment sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting\MultiLineAssignmentSniff - */ -final class MultiLineAssignmentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 6 => 1, - 8 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc deleted file mode 100644 index fddd3cba..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc +++ /dev/null @@ -1,576 +0,0 @@ -getFoo() - ->doBar( - $this->getX() // no comma here - ->doY() // this is still the first method argument - ->doZ() // this is still the first method argument - ); -} - -$var = myFunction( -$foo, -$bar -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false - -fputs( - STDOUT, - "Examples: - $ {$app} , --all - $ {$app} --all", $something -); - -$array = array(); -array_map( - function($x) - { - return trim($x, $y); - }, $foo, - $array -); - -$bar = new stdClass( - 4, /* thanks */ 5, /* PSR-2 */ 6 -); - -function doSomething() -{ - return $this->getFoo() - ->doBar( - $this->getX() // no comma here - ->doY() // this is still the first method argument - ->doZ() // this is still the first method argument - ); -} - -doError( - 404, // status code - 'Not Found', // error name - 'Check your id' // fix -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -// Don't report errors for closing braces. Leave that to other sniffs. -foo( - [ - 'this', - 'is', - 'an', - 'array' - ], -[ - 'this', - 'is', - 'an', - 'array' - ], - array( - 'this', - 'is', -'an', -'array' - ), - array( - 'this', - 'is', - 'an', - 'array' - ), - function($x) - { - echo 'wee'; - - return trim($x); - } -); - -function foo() -{ - myFunction( - 'string'. - // comment - // comment - 'string'. - /* comment - * comment - */ - 'string' - ); -} - -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 -test($arg, $arg2); -test( $arg, $arg2 ); -test( $arg, $arg2 ); -test(); -test( ); -test( ); -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 - -?> - - - -
  • - log(// ... - 'error', - sprintf( - 'Message: %s', - isset($e->getData()['object']['evidence_details']) - ? $e->getData()['object']['evidence_details']['due_by'] - : '' - ), - array($e->getData()['object']) -); - -?> -
    - $class - ] - ); ?> -
    - - function ($x) { - return true; - }, - 'baz' => false - ) -); -$qux = array_filter( - $quux, function ($x) { - return $x; - } -); - -array_filter( - [1, 2], - function ($i) : bool { - return $i === 0; - } -); - -foo(array( - 'callback' => function () { - $foo = 'foo'; - return; - }, -)); - -foo( - $a, - /* - $c, - - $d, - */ - $e -); - -test( - 1,2,3,4 - ); - -class Test -{ - public function getInstance() - { - return new static( - 'arg', - 'foo' - ); - } - - public function getSelf() - { - return new self( - 'a','b', 'c' - ); - } -} - -$x = $var('y', -'x'); - -$obj->{$x}(1, - 2); - -return (function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})( - 'a','b' -)('c', - 'd'); - -class Foo -{ - public function bar($a, $b) - { - if (!$a || !$b) { - return; - } - - (new stdClass())->a = $a; - } -} - -return (function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})('a','b')('c','d'); - -function foo() -{ - Bar( - function () { - } - ); -} - -$deprecated_functions = [ - 'the_category_ID' - => function_call( // 7 spaces, not 8. This is the problem line. - $a, - $b - ), -]; - -$deprecated_functions = [ - 'the_category_ID' - => function_call( // 9 spaces, not 8. This is the problem line. - $a, - $b - ), -]; - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false - -printf( - '', - $obj->getName(), // Trailing comment. - $obj->getID(), // phpcs:ignore Standard.Category.SniffName -- for reasons. - $option -); - -// Handling of PHP 7.3 trailing comma's. -functionCall($args, $foo,); -functionCall( - $args, $foo, -); -functionCall( - $args, - $foo, -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -$this->foo( - - ['a','b'], - true - -); - -$this->foo( - - // Comment - ['a','b'], - true - -); - -function m() -{ - $t = ' - ' . (empty(true) ? ' - ' . f( - '1', - '2', - ) . ' - ' : ''); -} - -class C -{ - - public function m() - { - $a = []; - $t = - "SELECT * FROM t -WHERE f IN(" . implode( - ",", - $a - ) . ")"; - } -} - -$notices = array( - 'index' => sprintf( - translation_function('a text string with %s placeholder'), - 'replacement' - ), -); - -$componentType = $this->componentTypeRepository->findByType($this->identifier) ?: - $this->componentTypeFactory->createForType( - $this->identifier, - $this->className, - true, - $this->isPrototypal - ); - -return [ - 'export-path' => 'exports/database/' - . env( - 'APP_CUSTOMER', - 'not-configured' - ) - . '/' . env( - 'APP_IDENTIFIER', - 'not-configured' - ), -]; - -$methods .= - str_replace( - array_keys($replacements), - array_values($replacements), - $methodTemplate - ) - . PHP_EOL . PHP_EOL . str_repeat(' ', 4); - -$rangeValues['min'] = - $this->adjustLowerThreshold( - $this->normalizeRatingForFilter($rangeValues['min']) - ); - -$salesOrderThresholdTransfer->fromArray($salesOrderThresholdEntity->toArray(), true) - ->setSalesOrderThresholdValue( - $this->mapSalesOrderThresholdValueTransfer($salesOrderThresholdTransfer, $salesOrderThresholdEntity) - )->setCurrency( - (new CurrencyTransfer())->fromArray($salesOrderThresholdEntity->getCurrency()->toArray(), true) - )->setStore( - (new StoreTransfer())->fromArray($salesOrderThresholdEntity->getStore()->toArray(), true) - ); - -return trim(preg_replace_callback( - // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) - // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search - )); - -$a = ['a' => function ($b) { return $b; }]; -$a['a']( 1 ); - -// PHP 8.0 named parameters. -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -array_fill_keys( - keys: range( 1, - 12, - ), value: true, -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false -array_fill_keys( - keys: range( 1, - 12, - ), value: true, -); -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -?> -
    -

    -
    -
    -

    -
    - -content -

    - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed deleted file mode 100644 index 1c525230..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed +++ /dev/null @@ -1,591 +0,0 @@ -getFoo() - ->doBar( - $this->getX() // no comma here - ->doY() // this is still the first method argument - ->doZ() // this is still the first method argument - ); -} - -$var = myFunction( - $foo, - $bar -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false - -fputs( - STDOUT, - "Examples: - $ {$app} , --all - $ {$app} --all", - $something -); - -$array = array(); -array_map( - function($x) - { - return trim($x, $y); - }, - $foo, - $array -); - -$bar = new stdClass( - 4, /* thanks */ - 5, /* PSR-2 */ - 6 -); - -function doSomething() -{ - return $this->getFoo() - ->doBar( - $this->getX() // no comma here - ->doY() // this is still the first method argument - ->doZ() // this is still the first method argument - ); -} - -doError( - 404, // status code - 'Not Found', // error name - 'Check your id' // fix -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -// Don't report errors for closing braces. Leave that to other sniffs. -foo( - [ - 'this', - 'is', - 'an', - 'array' - ], - [ - 'this', - 'is', - 'an', - 'array' - ], - array( - 'this', - 'is', - 'an', - 'array' - ), - array( - 'this', - 'is', - 'an', - 'array' - ), - function($x) - { - echo 'wee'; - - return trim($x); - } -); - -function foo() -{ - myFunction( - 'string'. - // comment - // comment - 'string'. - /* comment - * comment - */ - 'string' - ); -} - -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 -test( $arg, $arg2 ); -test( $arg, $arg2 ); -test( $arg, $arg2 ); -test(); -test(); -test(); -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 - -?> - - - -
  • - log(// ... - 'error', - sprintf( - 'Message: %s', - isset($e->getData()['object']['evidence_details']) - ? $e->getData()['object']['evidence_details']['due_by'] - : '' - ), - array($e->getData()['object']) -); - -?> -
    - $class - ] - ); ?> -
    - - function ($x) { - return true; - }, - 'baz' => false - ) -); -$qux = array_filter( - $quux, function ($x) { - return $x; - } -); - -array_filter( - [1, 2], - function ($i) : bool { - return $i === 0; - } -); - -foo( - array( - 'callback' => function () { - $foo = 'foo'; - return; - }, - ) -); - -foo( - $a, - /* - $c, - - $d, - */ - $e -); - -test( - 1,2,3,4 -); - -class Test -{ - public function getInstance() - { - return new static( - 'arg', - 'foo' - ); - } - - public function getSelf() - { - return new self( - 'a','b', 'c' - ); - } -} - -$x = $var( - 'y', - 'x' -); - -$obj->{$x}( - 1, - 2 -); - -return (function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})( - 'a','b' -)( - 'c', - 'd' -); - -class Foo -{ - public function bar($a, $b) - { - if (!$a || !$b) { - return; - } - - (new stdClass())->a = $a; - } -} - -return (function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})('a','b')('c','d'); - -function foo() -{ - Bar( - function () { - } - ); -} - -$deprecated_functions = [ - 'the_category_ID' - => function_call( // 7 spaces, not 8. This is the problem line. - $a, - $b - ), -]; - -$deprecated_functions = [ - 'the_category_ID' - => function_call( // 9 spaces, not 8. This is the problem line. - $a, - $b - ), -]; - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false - -printf( - '', - $obj->getName(), // Trailing comment. - $obj->getID(), // phpcs:ignore Standard.Category.SniffName -- for reasons. - $option -); - -// Handling of PHP 7.3 trailing comma's. -functionCall($args, $foo,); -functionCall( - $args, - $foo, -); -functionCall( - $args, - $foo, -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -$this->foo( - ['a','b'], - true -); - -$this->foo( - // Comment - ['a','b'], - true -); - -function m() -{ - $t = ' - ' . (empty(true) ? ' - ' . f( - '1', - '2', - ) . ' - ' : ''); -} - -class C -{ - - public function m() - { - $a = []; - $t = - "SELECT * FROM t -WHERE f IN(" . implode( - ",", - $a - ) . ")"; - } -} - -$notices = array( - 'index' => sprintf( - translation_function('a text string with %s placeholder'), - 'replacement' - ), -); - -$componentType = $this->componentTypeRepository->findByType($this->identifier) ?: - $this->componentTypeFactory->createForType( - $this->identifier, - $this->className, - true, - $this->isPrototypal - ); - -return [ - 'export-path' => 'exports/database/' - . env( - 'APP_CUSTOMER', - 'not-configured' - ) - . '/' . env( - 'APP_IDENTIFIER', - 'not-configured' - ), -]; - -$methods .= - str_replace( - array_keys($replacements), - array_values($replacements), - $methodTemplate - ) - . PHP_EOL . PHP_EOL . str_repeat(' ', 4); - -$rangeValues['min'] = - $this->adjustLowerThreshold( - $this->normalizeRatingForFilter($rangeValues['min']) - ); - -$salesOrderThresholdTransfer->fromArray($salesOrderThresholdEntity->toArray(), true) - ->setSalesOrderThresholdValue( - $this->mapSalesOrderThresholdValueTransfer($salesOrderThresholdTransfer, $salesOrderThresholdEntity) - )->setCurrency( - (new CurrencyTransfer())->fromArray($salesOrderThresholdEntity->getCurrency()->toArray(), true) - )->setStore( - (new StoreTransfer())->fromArray($salesOrderThresholdEntity->getStore()->toArray(), true) - ); - -return trim( - preg_replace_callback( - // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) - // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search - ) -); - -$a = ['a' => function ($b) { return $b; }]; -$a['a'](1); - -// PHP 8.0 named parameters. -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -array_fill_keys( - keys: range( - 1, - 12, - ), value: true, -); - -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments false -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); -// phpcs:set PEAR.Functions.FunctionCallSignature allowMultipleArguments true - -?> -
    -

    -
    -
    -

    -
    - -content -

    - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js deleted file mode 100644 index 5e77e57a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js +++ /dev/null @@ -1,80 +0,0 @@ -test( -); -test(); -test(arg, arg2); -test (); -test( ); -test() ; -test( arg); -test( arg ); -test ( arg ); - -if (foo(arg) === true) { - -} - -var something = get(arg1, arg2); -var something = get(arg1, arg2) ; -var something = get(arg1, arg2) ; - -make_foo(string/*the string*/, true/*test*/); -make_foo(string/*the string*/, true/*test*/ ); -make_foo(string /*the string*/, true /*test*/); -make_foo(/*the string*/string, /*test*/true); -make_foo( /*the string*/string, /*test*/true); - -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 -test(arg, arg2); -test( arg, arg2 ); -test( arg, arg2 ); -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 - -this.init = function(data) { - a.b('').a(function(itemid, target) { - b( - itemid, - target, - { - reviewData: _reviewData, - pageid: itemid - }, - '', - function() { - var _showAspectItems = function(itemid) { - a.a(a.c(''), ''); - a.b(a.c('-' + itemid), ''); - }; - a.foo(function(itemid, target) { - _foo(itemid); - }); - } - ); - }); -}; - -a.prototype = { - - a: function() - { - this.addItem( - { - /** - * @return void - */ - a: function() - { - - }, - /** - * @return void - */ - a: function() - { - - }, - } - ); - } -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed deleted file mode 100644 index 7855ac67..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.js.fixed +++ /dev/null @@ -1,84 +0,0 @@ -test( -); -test(); -test(arg, arg2); -test(); -test(); -test(); -test(arg); -test(arg); -test(arg); - -if (foo(arg) === true) { - -} - -var something = get(arg1, arg2); -var something = get(arg1, arg2); -var something = get(arg1, arg2); - -make_foo(string/*the string*/, true/*test*/); -make_foo(string/*the string*/, true/*test*/); -make_foo(string /*the string*/, true /*test*/); -make_foo(/*the string*/string, /*test*/true); -make_foo(/*the string*/string, /*test*/true); - -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 1 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 1 -test( arg, arg2 ); -test( arg, arg2 ); -test( arg, arg2 ); -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesAfterOpen 0 -// phpcs:set PEAR.Functions.FunctionCallSignature requiredSpacesBeforeClose 0 - -this.init = function(data) { - a.b('').a( - function(itemid, target) { - b( - itemid, - target, - { - reviewData: _reviewData, - pageid: itemid - }, - '', - function() { - var _showAspectItems = function(itemid) { - a.a(a.c(''), ''); - a.b(a.c('-' + itemid), ''); - }; - a.foo( - function(itemid, target) { - _foo(itemid); - } - ); - } - ); - } - ); -}; - -a.prototype = { - - a: function() - { - this.addItem( - { - /** - * @return void - */ - a: function() - { - - }, - /** - * @return void - */ - a: function() - { - - }, - } - ); - } -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php deleted file mode 100644 index 5884bd8f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php +++ /dev/null @@ -1,164 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionCallSignature sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff - */ -final class FunctionCallSignatureUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - if ($testFile === 'FunctionCallSignatureUnitTest.js') { - return [ - 5 => 1, - 6 => 2, - 7 => 1, - 8 => 1, - 9 => 2, - 10 => 3, - 17 => 1, - 18 => 1, - 21 => 1, - 24 => 1, - 28 => 2, - 30 => 2, - 35 => 1, - 49 => 1, - 51 => 1, - 54 => 1, - 70 => 1, - 71 => 1, - ]; - }//end if - - return [ - 5 => 1, - 6 => 2, - 7 => 1, - 8 => 1, - 9 => 2, - 10 => 3, - 17 => 1, - 18 => 1, - 31 => 1, - 34 => 1, - 43 => 2, - 57 => 1, - 59 => 1, - 63 => 1, - 64 => 1, - 82 => 1, - 93 => 1, - 100 => 1, - 106 => 2, - 119 => 1, - 120 => 1, - 129 => 1, - 137 => 1, - 142 => 2, - 171 => 1, - 180 => 1, - 181 => 1, - 194 => 1, - 213 => 2, - 215 => 2, - 217 => 2, - 218 => 2, - 277 => 1, - 278 => 1, - 303 => 1, - 308 => 1, - 321 => 1, - 322 => 1, - 329 => 1, - 330 => 1, - 337 => 1, - 342 => 1, - 343 => 1, - 345 => 1, - 346 => 2, - 353 => 1, - 354 => 1, - 355 => 2, - 377 => 1, - 378 => 1, - 379 => 1, - 380 => 1, - 385 => 1, - 386 => 1, - 387 => 1, - 388 => 1, - 393 => 1, - 394 => 1, - 395 => 1, - 396 => 1, - 411 => 1, - 422 => 1, - 424 => 1, - 429 => 1, - 432 => 1, - 440 => 1, - 441 => 1, - 442 => 1, - 464 => 1, - 510 => 1, - 513 => 1, - 514 => 1, - 523 => 1, - 524 => 3, - 527 => 2, - 539 => 1, - 540 => 1, - 546 => 1, - 547 => 1, - 548 => 1, - 559 => 1, - 567 => 1, - 568 => 1, - 573 => 1, - 574 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc deleted file mode 100644 index 6ba3bd9f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.1.inc +++ /dev/null @@ -1,490 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff - */ -final class FunctionDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FunctionDeclarationUnitTest.1.inc': - return [ - 3 => 1, - 4 => 1, - 5 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 14 => 1, - 17 => 1, - 44 => 1, - 52 => 1, - 61 => 2, - 98 => 1, - 110 => 2, - 120 => 3, - 121 => 1, - 140 => 1, - 145 => 1, - 161 => 2, - 162 => 2, - 164 => 2, - 167 => 2, - 171 => 1, - 173 => 1, - 201 => 1, - 206 => 1, - 208 => 1, - 216 => 1, - 223 => 1, - 230 => 1, - 237 => 1, - 243 => 1, - 247 => 1, - 251 => 2, - 253 => 2, - 257 => 2, - 259 => 1, - 263 => 1, - 265 => 1, - 269 => 1, - 273 => 1, - 277 => 1, - 278 => 1, - 283 => 1, - 287 => 2, - 289 => 2, - 293 => 2, - 295 => 1, - 299 => 1, - 301 => 1, - 305 => 1, - 309 => 1, - 313 => 1, - 314 => 1, - 350 => 1, - 351 => 1, - 352 => 1, - 353 => 1, - 361 => 1, - 362 => 1, - 363 => 1, - 364 => 1, - 365 => 1, - 366 => 1, - 367 => 1, - 368 => 1, - 369 => 1, - 370 => 1, - 371 => 1, - 402 => 1, - 406 => 1, - 475 => 1, - 483 => 1, - 490 => 2, - ]; - - case 'FunctionDeclarationUnitTest.js': - return [ - 3 => 1, - 4 => 1, - 5 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 14 => 1, - 17 => 1, - 41 => 1, - 48 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc deleted file mode 100644 index 2503f599..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc +++ /dev/null @@ -1,116 +0,0 @@ - $a[] = $b; - -class OnlyConstructorPropertyPromotion { - public function __construct( - public string $name = '', - protected $bar - ) {} -} - -class ConstructorPropertyPromotionMixedWithNormalParams { - public function __construct( - public string $name = '', - ?int $optionalParam = 0, - mixed $requiredParam, - ) {} -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.2.inc deleted file mode 100644 index 3cfece7a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.2.inc +++ /dev/null @@ -1,7 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ValidDefaultValue sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff - */ -final class ValidDefaultValueUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ValidDefaultValueUnitTest.1.inc': - return [ - 29 => 1, - 34 => 1, - 39 => 1, - 71 => 1, - 76 => 1, - 81 => 1, - 91 => 1, - 99 => 1, - 101 => 1, - 106 => 1, - 114 => 1, - ]; - - default: - return []; - } - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc deleted file mode 100644 index 053a4fee..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidClassNameUnitTest.inc +++ /dev/null @@ -1,90 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ValidClassName sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidClassNameSniff - */ -final class ValidClassNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 7 => 2, - 9 => 1, - 19 => 1, - 24 => 1, - 26 => 2, - 28 => 1, - 38 => 1, - 40 => 2, - 42 => 2, - 44 => 1, - 46 => 1, - 50 => 1, - 52 => 2, - 54 => 1, - 64 => 1, - 66 => 2, - 68 => 1, - 72 => 1, - 74 => 2, - 76 => 1, - 86 => 1, - 88 => 2, - 90 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc deleted file mode 100644 index 18b1a481..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidFunctionNameUnitTest.inc +++ /dev/null @@ -1,243 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ValidFunctionName sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff - */ -final class ValidFunctionNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 11 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 16 => 1, - 17 => 2, - 18 => 2, - 19 => 2, - 20 => 2, - 24 => 1, - 25 => 1, - 26 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 2, - 31 => 2, - 32 => 2, - 33 => 2, - 35 => 1, - 36 => 1, - 37 => 2, - 38 => 2, - 39 => 2, - 40 => 2, - 43 => 1, - 44 => 1, - 45 => 1, - 46 => 1, - 50 => 1, - 51 => 1, - 52 => 1, - 53 => 1, - 56 => 1, - 57 => 1, - 58 => 1, - 59 => 1, - 67 => 1, - 68 => 1, - 69 => 1, - 70 => 1, - 71 => 1, - 72 => 1, - 73 => 2, - 74 => 2, - 75 => 2, - 76 => 2, - 80 => 1, - 81 => 1, - 82 => 1, - 83 => 1, - 86 => 1, - 87 => 1, - 88 => 1, - 89 => 1, - 95 => 1, - 96 => 1, - 97 => 1, - 98 => 1, - 99 => 1, - 100 => 1, - 101 => 2, - 102 => 2, - 103 => 2, - 104 => 2, - 123 => 1, - 125 => 1, - 126 => 2, - 129 => 1, - 130 => 1, - 131 => 1, - 132 => 1, - 133 => 1, - 134 => 1, - 135 => 1, - 136 => 1, - 137 => 1, - 138 => 1, - 139 => 1, - 140 => 3, - 141 => 1, - 143 => 1, - 144 => 1, - 145 => 3, - 147 => 2, - 148 => 1, - 149 => 1, - 181 => 1, - 201 => 1, - 203 => 1, - 204 => 2, - 207 => 2, - 212 => 1, - 213 => 1, - 214 => 1, - 235 => 1, - 236 => 2, - 239 => 1, - 242 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc deleted file mode 100644 index 3c03da3f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc +++ /dev/null @@ -1,101 +0,0 @@ -def["POP_{$cc}_A"]}' - and POP_{$cc}_B = -'{$this->def["POP_{$cc}_B"]}')"; - } -} - -class mpgResponse{ - var $term_id; - var $currentTag; - function characterHandler($parser,$data){ - switch($this->currentTag) - { - case "term_id": { - $this->term_id=$data; - break; - } - } - }//end characterHandler -}//end class mpgResponse - -class foo -{ - const bar = <<setLogger( - new class { - private $varName = 'hello'; - private $_varName = 'hello'; -}); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php deleted file mode 100644 index c98af3bc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ValidVariableName sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidVariableNameSniff - */ -final class ValidVariableNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 12 => 1, - 17 => 1, - 22 => 1, - 92 => 1, - 93 => 1, - 94 => 1, - 99 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc deleted file mode 100644 index b1b09d93..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc +++ /dev/null @@ -1,142 +0,0 @@ -someFunction("some", "parameter") -->someOtherFunc(23, 42)-> - someOtherFunc2($one, $two) - - ->someOtherFunc3(23, 42) - ->andAThirdFunction(); - - $someObject->someFunction("some", "parameter") - ->someOtherFunc(23, 42); - -$someObject->someFunction("some", "parameter")->someOtherFunc(23, 42); - -$someObject->someFunction("some", "parameter") - ->someOtherFunc(23, 42); - -func( - $bar->foo() -) - ->bar(); - -func( - $bar->foo() -) - ->bar( - $bar->foo() - ->bar() - ->func() - ); - -$object - ->setBar($foo) - ->setFoo($bar); - -if ($bar) { - $object - ->setBar($foo) - ->setFoo($bar); -} - -$response -> CompletedTrackDetails -> TrackDetails -> Events; -$response - -> CompletedTrackDetails - -> TrackDetails - -> Events; - -$response - -> CompletedTrackDetails --> TrackDetails - -> Events; - -$var = get_object( - $foo->something() - ->query() -)->two() - ->three(); - -$foo->one( - $foo - ->two() -); - -get_object()->one() - ->two() - ->three(); - -someclass::one() - ->two() - ->three(); - -(new someclass())->one() - ->two() - ->three(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true - -$someObject - ->startSomething() - ->someOtherFunc(23, 42) -->endSomething() -->doSomething(23, 42) -->endEverything(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() -->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false - -$object - ?->setBar($foo) - ?->setFoo($bar); - -$someObject?->someFunction("some", "parameter") -->someOtherFunc(23, 42)?-> - someOtherFunc2($one, $two) - -->someOtherFunc3(23, 42) - ?->andAThirdFunction(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true -$object - ?->setBar($foo) - ?->setFoo($bar); - -$someObject?->someFunction("some", "parameter") -->someOtherFunc(23, 42) - ?->someOtherFunc2($one, $two) - -->someOtherFunc3(23, 42) - ?->andAThirdFunction(); -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false - -$someObject - ->startSomething(paramName: $value) - ->someOtherFunc(nameA: 23, nameB: 42) -->endSomething($value, name: $value) -->endEverything(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed deleted file mode 100644 index 5d5b77be..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.inc.fixed +++ /dev/null @@ -1,142 +0,0 @@ -someFunction("some", "parameter") - ->someOtherFunc(23, 42) - ->someOtherFunc2($one, $two) - - ->someOtherFunc3(23, 42) - ->andAThirdFunction(); - - $someObject->someFunction("some", "parameter") - ->someOtherFunc(23, 42); - -$someObject->someFunction("some", "parameter")->someOtherFunc(23, 42); - -$someObject->someFunction("some", "parameter") - ->someOtherFunc(23, 42); - -func( - $bar->foo() -) - ->bar(); - -func( - $bar->foo() -) - ->bar( - $bar->foo() - ->bar() - ->func() - ); - -$object - ->setBar($foo) - ->setFoo($bar); - -if ($bar) { - $object - ->setBar($foo) - ->setFoo($bar); -} - -$response -> CompletedTrackDetails -> TrackDetails -> Events; -$response - -> CompletedTrackDetails - -> TrackDetails - -> Events; - -$response - -> CompletedTrackDetails - -> TrackDetails - -> Events; - -$var = get_object( - $foo->something() - ->query() -)->two() - ->three(); - -$foo->one( - $foo - ->two() -); - -get_object()->one() - ->two() - ->three(); - -someclass::one() - ->two() - ->three(); - -(new someclass())->one() - ->two() - ->three(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true - -$someObject - ->startSomething() - ->someOtherFunc(23, 42) - ->endSomething() - ->doSomething(23, 42) - ->endEverything(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -$rootNode - ->one() - ->two() - ->three() - ->four() - ->five(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false - -$object - ?->setBar($foo) - ?->setFoo($bar); - -$someObject?->someFunction("some", "parameter") - ->someOtherFunc(23, 42) - ?->someOtherFunc2($one, $two) - - ->someOtherFunc3(23, 42) - ?->andAThirdFunction(); - -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel true -$object - ?->setBar($foo) - ?->setFoo($bar); - -$someObject?->someFunction("some", "parameter") - ->someOtherFunc(23, 42) - ?->someOtherFunc2($one, $two) - - ->someOtherFunc3(23, 42) - ?->andAThirdFunction(); -// phpcs:set PEAR.WhiteSpace.ObjectOperatorIndent multilevel false - -$someObject - ->startSomething(paramName: $value) - ->someOtherFunc(nameA: 23, nameB: 42) - ->endSomething($value, name: $value) - ->endEverything(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php deleted file mode 100644 index 9beb77fe..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ObjectOperatorIndentUnitTest.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ObjectOperatorIndent sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ObjectOperatorIndentSniff - */ -final class ObjectOperatorIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 2, - 6 => 1, - 15 => 1, - 27 => 1, - 37 => 1, - 38 => 1, - 48 => 1, - 49 => 1, - 50 => 1, - 65 => 1, - 69 => 1, - 73 => 1, - 79 => 1, - 80 => 1, - 81 => 1, - 82 => 1, - 95 => 1, - 103 => 1, - 119 => 2, - 122 => 1, - 131 => 1, - 134 => 1, - 140 => 1, - 141 => 1, - 142 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc deleted file mode 100644 index a97aca76..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc +++ /dev/null @@ -1,170 +0,0 @@ -{$property} =& new $class_name($this->db_index); - $this->modules[$module] =& $this->{$property}; -} - -foreach ($elements as $element) { - if ($something) { - // Do IF. - } else if ($somethingElse) { - // Do ELSE. - } -} - -switch ($foo) { -case 1: - switch ($bar) { - default: - if ($something) { - echo $string{1}; - } else if ($else) { - switch ($else) { - case 1: - // Do something. - break; - default: - // Do something. - break; - } - } - } -break; -case 2: - // Do something; - break; -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - default: - return 'Unknown'; -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - return 'Processing.'; - default: - return 'Unknown'; -} - -switch($i) { -case 1: {} -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - exit; - default: - exit; -} - -if ($foo): - if ($bar): - $foo = 1; - elseif ($baz): - $foo = 2; - endif; -endif; - -if ($foo): -elseif ($baz): $foo = 2; -endif; - -?> -
      - -
    • - -
    -
      - -
    • - -
    -
      - -
    • - -
    - -getSummaryCount(); ?> -
    class="empty"> - - 'a', 2 => 'b' }; - -$match = match ($test) { - 1 => 'a', - 2 => 'b' - }; - -enum Enum -{ -} - -enum Suits {} - -enum Cards -{ - } - -?> - - -
    -
    {$property} =& new $class_name($this->db_index); - $this->modules[$module] =& $this->{$property}; -} - -foreach ($elements as $element) { - if ($something) { - // Do IF. - } else if ($somethingElse) { - // Do ELSE. - } -} - -switch ($foo) { -case 1: - switch ($bar) { - default: - if ($something) { - echo $string{1}; - } else if ($else) { - switch ($else) { - case 1: - // Do something. - break; - default: - // Do something. - break; - } - } - } - break; -case 2: - // Do something; - break; -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - default: - return 'Unknown'; -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - return 'Processing.'; - default: - return 'Unknown'; -} - -switch($i) { -case 1: { - } -} - -switch ($httpResponseCode) { - case 100: - case 101: - case 102: - exit; - default: - exit; -} - -if ($foo): - if ($bar): - $foo = 1; - elseif ($baz): - $foo = 2; - endif; -endif; - -if ($foo): -elseif ($baz): $foo = 2; -endif; - -?> -
      - -
    • - -
    -
      - -
    • - -
    -
      - -
    • - -
    - -getSummaryCount(); ?> -
    class="empty"> - - 'a', 2 => 'b' -}; - -$match = match ($test) { - 1 => 'a', - 2 => 'b' -}; - -enum Enum -{ -} - -enum Suits { -} - -enum Cards -{ -} - -?> - - -
    -
    - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ScopeClosingBrace sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff - */ -final class ScopeClosingBraceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 11 => 1, - 13 => 1, - 24 => 1, - 30 => 1, - 61 => 1, - 65 => 1, - 85 => 1, - 89 => 1, - 98 => 1, - 122 => 1, - 127 => 1, - 135 => 1, - 141 => 1, - 146 => 1, - 149 => 1, - 154 => 1, - 160 => 1, - 164 => 1, - 170 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc deleted file mode 100644 index b122a147..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc +++ /dev/null @@ -1,314 +0,0 @@ -hello(); // error here - } - - function hello() // error here - { // no error here as brackets can be put anywhere in the pear standard - echo 'hello'; - } - - function hello2() - { - if (TRUE) { // error here - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; // error here - } - - while (TRUE) { - echo 'hello'; // error here - } - - do { // error here - echo 'hello'; // error here - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -    $safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* - * - * - * - */ - - /** - */ - - /* - This comment has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = <<hello(); // error here - } - - function hello() // error here - { // no error here as brackets can be put anywhere in the pear standard - echo 'hello'; - } - - function hello2() - { - if (TRUE) { // error here - echo 'hello'; // no error here as its more than 4 spaces. - } else { - echo 'bye'; // error here - } - - while (TRUE) { - echo 'hello'; // error here - } - - do { // error here - echo 'hello'; // error here - } while (TRUE); - } - - function hello3() - { - switch ($hello) { - case 'hello': - break; - } - } - -} - -?> -
    -
    -
    -validate()) {
    -    $safe = $form->getSubmitValues();
    -}
    -?>
    -
    -open(); // error here - } - - public function open() - { - // Some inline stuff that shouldn't error - if (TRUE) echo 'hello'; - foreach ($tokens as $token) echo $token; - } - - /** - * This is a comment 1. - * This is a comment 2. - * This is a comment 3. - * This is a comment 4. - */ - public function close() - { - // All ok. - if (TRUE) { - if (TRUE) { - } else if (FALSE) { - foreach ($tokens as $token) { - switch ($token) { - case '1': - case '2': - if (true) { - if (false) { - if (false) { - if (false) { - echo 'hello'; - } - } - } - } - break; - case '5': - break; - } - do { - while (true) { - foreach ($tokens as $token) { - for ($i = 0; $i < $token; $i++) { - echo 'hello'; - } - } - } - } while (true); - } - } - } - } - - /* - This is another c style comment 1. - This is another c style comment 2. - This is another c style comment 3. - This is another c style comment 4. - This is another c style comment 5. - */ - - /* - * - * - * - */ - - /** - */ - - /* - This comment has a newline in it. - - */ - - public function read() - { - echo 'hello'; - - // no errors below. - $array = array( - 'this', - 'that' => array( - 'hello', - 'hello again' => array( - 'hello', - ), - ), - ); - } -} - -abstract class Test3 -{ - public function parse() - { - - foreach ($t as $ndx => $token) { - if (is_array($token)) { - echo 'here'; - } else { - $ts[] = array("token" => $token, "value" => ''); - - $last = count($ts) - 1; - - switch ($token) { - case '(': - - if ($last >= 3 && - $ts[0]['token'] != T_CLASS && - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && - $ts[$last - 3]['token'] == T_VARIABLE ) { - - - if (true) { - echo 'hello'; - } - } - array_push($braces, $token); - break; - } - } - } - } -} - -function test() -{ - $o = << - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PEAR\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ScopeIndent sniff. - * - * @covers \PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeIndentSniff - */ -final class ScopeIndentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 10 => 1, - 17 => 1, - 20 => 1, - 24 => 1, - 25 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 58 => 1, - 123 => 1, - 224 => 1, - 225 => 1, - 279 => 1, - 284 => 1, - 311 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml deleted file mode 100644 index 1bf94ca5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/ruleset.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - The PEAR coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml deleted file mode 100644 index eaae99b2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Classes/ClassDeclarationStandard.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - class Bar { -} - ]]> - - - class Bar { -} - -class Baz { -} - ]]> - - - - - namespace Foo; - -class Bar { -} - ]]> - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml deleted file mode 100644 index 0ed04a07..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Files/SideEffectsStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - echo "Class Foo loaded." - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml deleted file mode 100644 index 8db899d6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Docs/Methods/CamelCapsMethodNameStandard.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - doBar() - { - } -} - ]]> - - - do_bar() - { - } -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php deleted file mode 100644 index e3f626b3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClassDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the current token in - * the token stack. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $errorData = [strtolower($tokens[$stackPtr]['content'])]; - - $nextClass = $phpcsFile->findNext([T_CLASS, T_INTERFACE, T_TRAIT, T_ENUM], ($tokens[$stackPtr]['scope_closer'] + 1)); - if ($nextClass !== false) { - $error = 'Each %s must be in a file by itself'; - $phpcsFile->addError($error, $nextClass, 'MultipleClasses', $errorData); - $phpcsFile->recordMetric($stackPtr, 'One class per file', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'One class per file', 'yes'); - } - - $namespace = $phpcsFile->findNext([T_NAMESPACE, T_CLASS, T_INTERFACE, T_TRAIT, T_ENUM], 0); - if ($tokens[$namespace]['code'] !== T_NAMESPACE) { - $error = 'Each %s must be in a namespace of at least one level (a top-level vendor name)'; - $phpcsFile->addError($error, $stackPtr, 'MissingNamespace', $errorData); - $phpcsFile->recordMetric($stackPtr, 'Class defined in namespace', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Class defined in namespace', 'yes'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php deleted file mode 100644 index 68a18d8c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php +++ /dev/null @@ -1,303 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SideEffectsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the token stack. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $result = $this->searchForConflict($phpcsFile, 0, ($phpcsFile->numTokens - 1), $tokens); - - if ($result['symbol'] !== null && $result['effect'] !== null) { - $error = 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line %s and the first side effect is on line %s.'; - $data = [ - $tokens[$result['symbol']]['line'], - $tokens[$result['effect']]['line'], - ]; - $phpcsFile->addWarning($error, 0, 'FoundWithSymbols', $data); - $phpcsFile->recordMetric($stackPtr, 'Declarations and side effects mixed', 'yes'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Declarations and side effects mixed', 'no'); - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - - /** - * Searches for symbol declarations and side effects. - * - * Returns the positions of both the first symbol declared and the first - * side effect in the file. A NULL value for either indicates nothing was - * found. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $start The token to start searching from. - * @param int $end The token to search to. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return array - */ - private function searchForConflict($phpcsFile, $start, $end, $tokens) - { - $symbols = [ - T_CLASS => T_CLASS, - T_INTERFACE => T_INTERFACE, - T_TRAIT => T_TRAIT, - T_ENUM => T_ENUM, - T_FUNCTION => T_FUNCTION, - ]; - - $conditions = [ - T_IF => T_IF, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - ]; - - $checkAnnotations = $phpcsFile->config->annotations; - - $firstSymbol = null; - $firstEffect = null; - for ($i = $start; $i <= $end; $i++) { - // Respect phpcs:disable comments. - if ($checkAnnotations === true - && $tokens[$i]['code'] === T_PHPCS_DISABLE - && (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.FoundWithSymbols']) === true) - ) { - do { - $i = $phpcsFile->findNext(T_PHPCS_ENABLE, ($i + 1)); - } while ($i !== false - && 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.FoundWithSymbols']) === false); - - if ($i === false) { - // The entire rest of the file is disabled, - // so return what we have so far. - break; - } - - continue; - } - - // Ignore whitespace and comments. - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - // Ignore PHP tags. - if ($tokens[$i]['code'] === T_OPEN_TAG - || $tokens[$i]['code'] === T_CLOSE_TAG - ) { - continue; - } - - // Ignore shebang. - if (substr($tokens[$i]['content'], 0, 2) === '#!') { - continue; - } - - // Ignore logical operators. - if (isset(Tokens::$booleanOperators[$tokens[$i]['code']]) === true) { - continue; - } - - // Ignore entire namespace, declare, const and use statements. - if ($tokens[$i]['code'] === T_NAMESPACE - || $tokens[$i]['code'] === T_USE - || $tokens[$i]['code'] === T_DECLARE - || $tokens[$i]['code'] === T_CONST - ) { - if (isset($tokens[$i]['scope_opener']) === true) { - $i = $tokens[$i]['scope_closer']; - if ($tokens[$i]['code'] === T_ENDDECLARE) { - $semicolon = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - if ($semicolon !== false && $tokens[$semicolon]['code'] === T_SEMICOLON) { - $i = $semicolon; - } - } - } else { - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($i + 1)); - if ($semicolon !== false) { - $i = $semicolon; - } - } - - continue; - } - - // Ignore function/class prefixes. - if (isset(Tokens::$methodPrefixes[$tokens[$i]['code']]) === true - || $tokens[$i]['code'] === T_READONLY - ) { - continue; - } - - // Ignore anon classes. - if ($tokens[$i]['code'] === T_ANON_CLASS) { - $i = $tokens[$i]['scope_closer']; - continue; - } - - // Ignore attributes. - if ($tokens[$i]['code'] === T_ATTRIBUTE - && isset($tokens[$i]['attribute_closer']) === true - ) { - $i = $tokens[$i]['attribute_closer']; - continue; - } - - // Detect and skip over symbols. - if (isset($symbols[$tokens[$i]['code']]) === true - && isset($tokens[$i]['scope_closer']) === true - ) { - if ($firstSymbol === null) { - $firstSymbol = $i; - } - - $i = $tokens[$i]['scope_closer']; - continue; - } else if ($tokens[$i]['code'] === T_STRING - && strtolower($tokens[$i]['content']) === 'define' - ) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), null, true); - if ($tokens[$prev]['code'] !== T_OBJECT_OPERATOR - && $tokens[$prev]['code'] !== T_NULLSAFE_OBJECT_OPERATOR - && $tokens[$prev]['code'] !== T_DOUBLE_COLON - && $tokens[$prev]['code'] !== T_FUNCTION - ) { - if ($firstSymbol === null) { - $firstSymbol = $i; - } - - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($i + 1)); - if ($semicolon !== false) { - $i = $semicolon; - } - - continue; - } - }//end if - - // Special case for defined() as it can be used to see - // if a constant (a symbol) should be defined or not and - // doesn't need to use a full conditional block. - if ($tokens[$i]['code'] === T_STRING - && strtolower($tokens[$i]['content']) === 'defined' - ) { - $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - if ($openBracket !== false - && $tokens[$openBracket]['code'] === T_OPEN_PARENTHESIS - && isset($tokens[$openBracket]['parenthesis_closer']) === true - ) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), null, true); - if ($tokens[$prev]['code'] !== T_OBJECT_OPERATOR - && $tokens[$prev]['code'] !== T_NULLSAFE_OBJECT_OPERATOR - && $tokens[$prev]['code'] !== T_DOUBLE_COLON - && $tokens[$prev]['code'] !== T_FUNCTION - ) { - $i = $tokens[$openBracket]['parenthesis_closer']; - continue; - } - } - }//end if - - // Conditional statements are allowed in symbol files as long as the - // contents is only a symbol definition. So don't count these as effects - // in this case. - if (isset($conditions[$tokens[$i]['code']]) === true) { - if (isset($tokens[$i]['scope_opener']) === false) { - // Probably an "else if", so just ignore. - continue; - } - - $result = $this->searchForConflict( - $phpcsFile, - ($tokens[$i]['scope_opener'] + 1), - ($tokens[$i]['scope_closer'] - 1), - $tokens - ); - - if ($result['symbol'] !== null) { - if ($firstSymbol === null) { - $firstSymbol = $result['symbol']; - } - - if ($result['effect'] !== null) { - // Found a conflict. - $firstEffect = $result['effect']; - break; - } - } - - if ($firstEffect === null) { - $firstEffect = $result['effect']; - } - - $i = $tokens[$i]['scope_closer']; - continue; - }//end if - - if ($firstEffect === null) { - $firstEffect = $i; - } - - if ($firstSymbol !== null) { - // We have a conflict we have to report, so no point continuing. - break; - } - }//end for - - return [ - 'symbol' => $firstSymbol, - 'effect' => $firstEffect, - ]; - - }//end searchForConflict() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php deleted file mode 100644 index 0cf1022f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff as GenericCamelCapsFunctionNameSniff; -use PHP_CodeSniffer\Util\Common; - -class CamelCapsMethodNameSniff extends GenericCamelCapsFunctionNameSniff -{ - - - /** - * Processes the tokens within the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * @param int $currScope The position of the current scope. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - // Ignore magic methods. - if (preg_match('|^__[^_]|', $methodName) !== 0) { - $magicPart = strtolower(substr($methodName, 2)); - if (isset($this->magicMethods[$magicPart]) === true - || isset($this->methodsDoubleUnderscore[$magicPart]) === true - ) { - return; - } - } - - $testName = ltrim($methodName, '_'); - if ($testName !== '' && Common::isCamelCaps($testName, false, true, false) === false) { - $error = 'Method name "%s" is not in camel caps format'; - $className = $phpcsFile->getDeclarationName($currScope); - if (isset($className) === false) { - $className = '[Anonymous Class]'; - } - - $errorData = [$className.'::'.$methodName]; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes'); - } - - }//end processTokenWithinScope() - - - /** - * Processes the tokens outside the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc deleted file mode 100644 index 58cb85e3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Classes/ClassDeclarationUnitTest.1.inc +++ /dev/null @@ -1,3 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff - */ -final class ClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - if ($testFile === 'ClassDeclarationUnitTest.2.inc') { - return []; - } - - return [ - 2 => 1, - 3 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc deleted file mode 100644 index b7e1dc9a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.1.inc +++ /dev/null @@ -1,87 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc deleted file mode 100644 index 63f256d4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.10.inc +++ /dev/null @@ -1,8 +0,0 @@ -define("MAXSIZE", 100); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc deleted file mode 100644 index 9499885b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.14.inc +++ /dev/null @@ -1,2 +0,0 @@ -define("MAXSIZE", 100); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc deleted file mode 100644 index 0500d10e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.15.inc +++ /dev/null @@ -1,2 +0,0 @@ -defined('MINSIZE') or define("MAXSIZE", 100); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc deleted file mode 100644 index 588ece58..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.16.inc +++ /dev/null @@ -1,2 +0,0 @@ -defined('MINSIZE') or define("MAXSIZE", 100); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc deleted file mode 100644 index ec81bfed..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.17.inc +++ /dev/null @@ -1,8 +0,0 @@ -define(); -echo $object -> define(); -Foo::define(); - -$c = new class extends Something{ - - public function someMethod() - { - // ... - } - -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc deleted file mode 100644 index d4ae77ee..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.3.inc +++ /dev/null @@ -1,6 +0,0 @@ - -'; -} - -printHead(); -?> - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc deleted file mode 100644 index 7265c637..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.5.inc +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc deleted file mode 100644 index e02fed4b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Files/SideEffectsUnitTest.6.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SideEffects sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff - */ -final class SideEffectsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Set CLI values before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - if ($testFile === 'SideEffectsUnitTest.12.inc') { - $config->annotations = false; - } - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - return []; - - }//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($testFile='') - { - switch ($testFile) { - case 'SideEffectsUnitTest.3.inc': - case 'SideEffectsUnitTest.4.inc': - case 'SideEffectsUnitTest.5.inc': - case 'SideEffectsUnitTest.10.inc': - case 'SideEffectsUnitTest.12.inc': - case 'SideEffectsUnitTest.15.inc': - case 'SideEffectsUnitTest.16.inc': - return [1 => 1]; - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc deleted file mode 100644 index 7381517f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/Tests/Methods/CamelCapsMethodNameUnitTest.inc +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR1\Tests\Methods; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the CamelCapsMethodName sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff - */ -final class CamelCapsMethodNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 6 => 1, - 7 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 17 => 1, - 21 => 1, - 25 => 1, - 26 => 1, - 77 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml deleted file mode 100644 index 65cbe20e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR1/ruleset.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - The PSR1 coding standard. - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml deleted file mode 100644 index ae24611d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClassInstantiationStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClosingBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClosingBraceStandard.xml deleted file mode 100644 index b59d734f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/ClosingBraceStandard.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - -function bar() -{ - // Function content. -} - ]]> - - - echo 'Hello!'; - -function bar() -{ - // Function content. -} //end bar() - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/OpeningBraceSpaceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/OpeningBraceSpaceStandard.xml deleted file mode 100644 index 818bbe83..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Classes/OpeningBraceSpaceStandard.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - public function bar() - { - // Method content. - } -} - ]]> - - - - public function bar() - { - // Method content. - } -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/BooleanOperatorPlacementStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/BooleanOperatorPlacementStandard.xml deleted file mode 100644 index 805e15c6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/BooleanOperatorPlacementStandard.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/ControlStructureSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/ControlStructureSpacingStandard.xml deleted file mode 100644 index db4fe802..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/ControlStructures/ControlStructureSpacingStandard.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - ($expr) { -} - ]]> - - - ( $expr) { -} - ]]> - - - - - ($expr) { -} - ]]> - - - ) { -} - ]]> - - - - - - - - $expr1 - && $expr2 -) { -} - ]]> - - - ($expr1 - && $expr2 -) { -} - ]]> - - - - - $expr1 - && $expr2 -) { -} - ]]> - - - $expr1 - && $expr2 - && $expr3 -) { -} - ]]> - - - - - - - - ) { -} - ]]> - - - && $expr2) { -} - ]]> - - - - - ) { -} - ]]> - - - ) { -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/ImportStatementStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/ImportStatementStandard.xml deleted file mode 100644 index 66b58de0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/ImportStatementStandard.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - \Vendor\Package\ClassA as A; - -class FooBar extends A -{ - // Class content. -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/OpenTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/OpenTagStandard.xml deleted file mode 100644 index 20db18b2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Files/OpenTagStandard.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - -echo 'hi'; - ]]> - - - echo 'hi'; - ]]> - - - - - - - - - - - ]]> - - - - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml deleted file mode 100644 index ac411ffb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/ReturnTypeDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/ReturnTypeDeclarationStandard.xml deleted file mode 100644 index 000459c3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Functions/ReturnTypeDeclarationStandard.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - string { - // Closure body. -}; - ]]> - - - string { - // Closure body. -}; - ]]> - - - - - : string { - // Function body. -}; - ]]> - - - : string { - // Function body. -}; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml deleted file mode 100644 index 9bb5a8a5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Keywords/ShortFormTypeKeywordsStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - (boolean) $isValid; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml deleted file mode 100644 index b74e8b42..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Namespaces/CompoundNamespaceDepthStandard.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - SubnamespaceOne\AnotherNamespace\ClassA, - SubnamespaceOne\ClassB, - ClassZ, -}; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml deleted file mode 100644 index 981b1d97..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Operators/OperatorSpacingStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - $b) { - $variable = $foo ? 'foo' : 'bar'; -} - ]]> - - - $b) { - $variable=$foo?'foo':'bar'; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml deleted file mode 100644 index da9b60a4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - private const BAR = 'bar'; -} - ]]> - - - const BAR = 'bar'; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php deleted file mode 100644 index 552bfea4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php +++ /dev/null @@ -1,246 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff; -use PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff; -use PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff; -use PHP_CodeSniffer\Util\Tokens; - -class AnonClassDeclarationSniff extends ClassDeclarationSniff -{ - - /** - * The PSR2 MultiLineFunctionDeclarations sniff. - * - * @var \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff - */ - private $multiLineSniff = null; - - /** - * The Generic FunctionCallArgumentSpacing sniff. - * - * @var \PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff - */ - private $functionCallSniff = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_ANON_CLASS]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - $this->multiLineSniff = new MultiLineFunctionDeclarationSniff(); - $this->functionCallSniff = new FunctionCallArgumentSpacingSniff(); - - $this->processOpen($phpcsFile, $stackPtr); - $this->processClose($phpcsFile, $stackPtr); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === true) { - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - if ($this->multiLineSniff->isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { - $this->processMultiLineArgumentList($phpcsFile, $stackPtr); - } else { - $this->processSingleLineArgumentList($phpcsFile, $stackPtr); - } - - $this->functionCallSniff->checkSpacing($phpcsFile, $stackPtr, $openBracket); - } - - $opener = $tokens[$stackPtr]['scope_opener']; - if ($tokens[$opener]['line'] === $tokens[$stackPtr]['line']) { - return; - } - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), $stackPtr, true); - - $implements = $phpcsFile->findPrevious(T_IMPLEMENTS, ($opener - 1), $stackPtr); - if ($implements !== false - && $tokens[$opener]['line'] !== $tokens[$implements]['line'] - && $tokens[$opener]['line'] === $tokens[$prev]['line'] - ) { - // Opening brace must be on a new line as implements list wraps. - $error = 'Opening brace must be on the line after the last implemented interface'; - $fix = $phpcsFile->addFixableError($error, $opener, 'OpenBraceSameLine'); - if ($fix === true) { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $indent = str_repeat(' ', ($tokens[$first]['column'] - 1)); - $phpcsFile->fixer->beginChangeset(); - - if ($tokens[($prev + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($prev + 1), ''); - } - - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->addContentBefore($opener, $indent); - $phpcsFile->fixer->endChangeset(); - } - } - - if ($tokens[$opener]['line'] > ($tokens[$prev]['line'] + 1)) { - // Opening brace is on a new line, so there must be no blank line before it. - $error = 'Opening brace must not be preceded by a blank line'; - $fix = $phpcsFile->addFixableError($error, $opener, 'OpenBraceLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($prev + 1); $x < $opener; $x++) { - if ($tokens[$x]['line'] === $tokens[$prev]['line']) { - // Maintain existing newline. - continue; - } - - if ($tokens[$x]['line'] === $tokens[$opener]['line']) { - // Maintain existing indent. - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - }//end process() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 processSingleLineArgumentList(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - if ($openBracket === ($closeBracket - 1)) { - return; - } - - if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - $error = 'Space after opening parenthesis of single-line argument list prohibited'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } - } - - $spaceBeforeClose = 0; - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), $openBracket, true); - if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) { - // Need a newline after these tokens, so ignore this rule. - return; - } - - if ($tokens[$prev]['line'] !== $tokens[$closeBracket]['line']) { - $spaceBeforeClose = 'newline'; - } else if ($tokens[($closeBracket - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = $tokens[($closeBracket - 1)]['length']; - } - - if ($spaceBeforeClose !== 0) { - $error = 'Space before closing parenthesis of single-line argument list prohibited'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeCloseBracket'); - if ($fix === true) { - if ($spaceBeforeClose === 'newline') { - $phpcsFile->fixer->beginChangeset(); - - $closingContent = ')'; - - $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON) { - $closingContent .= ';'; - for ($i = ($closeBracket + 1); $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - // We want to jump over any whitespace or inline comment and - // move the closing parenthesis after any other token. - $prev = ($closeBracket - 1); - while (isset(Tokens::$emptyTokens[$tokens[$prev]['code']]) === true) { - if (($tokens[$prev]['code'] === T_COMMENT) - && (strpos($tokens[$prev]['content'], '*/') !== false) - ) { - break; - } - - $prev--; - } - - $phpcsFile->fixer->addContent($prev, $closingContent); - - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true); - for ($i = ($prevNonWhitespace + 1); $i <= $closeBracket; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($closeBracket - 1), ''); - }//end if - }//end if - }//end if - - }//end processSingleLineArgumentList() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 processMultiLineArgumentList(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - - $this->multiLineSniff->processBracket($phpcsFile, $openBracket, $tokens, 'argument'); - $this->multiLineSniff->processArgumentList($phpcsFile, $stackPtr, $this->indent, 'argument'); - - }//end processMultiLineArgumentList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php deleted file mode 100644 index 048cb60c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.php +++ /dev/null @@ -1,112 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassInstantiationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_NEW]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Find the class name. - $allowed = [ - T_STRING => T_STRING, - T_NS_SEPARATOR => T_NS_SEPARATOR, - T_SELF => T_SELF, - T_STATIC => T_STATIC, - T_PARENT => T_PARENT, - T_VARIABLE => T_VARIABLE, - T_DOLLAR => T_DOLLAR, - T_OBJECT_OPERATOR => T_OBJECT_OPERATOR, - T_NULLSAFE_OBJECT_OPERATOR => T_NULLSAFE_OBJECT_OPERATOR, - T_DOUBLE_COLON => T_DOUBLE_COLON, - ]; - - $allowed += Tokens::$emptyTokens; - - $classNameEnd = null; - for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { - if (isset($allowed[$tokens[$i]['code']]) === true) { - continue; - } - - // Bow out when this is an anonymous class. - // Anonymous classes are the only situation which would allow for an attribute - // or for the readonly keyword between "new" and the class "name". - if ($tokens[$i]['code'] === T_ATTRIBUTE - || $tokens[$i]['code'] === T_READONLY - || $tokens[$i]['code'] === T_ANON_CLASS - ) { - return; - } - - if ($tokens[$i]['code'] === T_OPEN_SQUARE_BRACKET - || $tokens[$i]['code'] === T_OPEN_CURLY_BRACKET - ) { - $i = $tokens[$i]['bracket_closer']; - continue; - } - - $classNameEnd = $i; - break; - }//end for - - if ($classNameEnd === null) { - return; - } - - if ($tokens[$classNameEnd]['code'] === T_OPEN_PARENTHESIS) { - // Using parenthesis. - return; - } - - if ($classNameEnd === $stackPtr) { - // Failed to find the class name. - return; - } - - $error = 'Parentheses must be used when instantiating a new class'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MissingParentheses'); - if ($fix === true) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($classNameEnd - 1), null, true); - $phpcsFile->fixer->addContent($prev, '()'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php deleted file mode 100644 index 82f215f6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClosingBraceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - T_FUNCTION, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $closer = $tokens[$stackPtr]['scope_closer']; - $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), null, true); - if ($next === false - || $tokens[$next]['line'] !== $tokens[$closer]['line'] - ) { - return; - } - - $error = 'Closing brace must not be followed by any comment or statement on the same line'; - $phpcsFile->addError($error, $closer, 'StatementAfter'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php deleted file mode 100644 index 261f7022..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OpeningBraceSpaceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$ooScopeTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - $opener = $tokens[$stackPtr]['scope_opener']; - $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); - if ($next === false - || $tokens[$next]['line'] <= ($tokens[$opener]['line'] + 1) - ) { - return; - } - - $error = 'Opening brace must not be followed by a blank line'; - $fix = $phpcsFile->addFixableError($error, $opener, 'Found'); - if ($fix === false) { - return; - } - - $phpcsFile->fixer->beginChangeset(); - for ($i = ($opener + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$opener]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php deleted file mode 100644 index dabb3187..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php +++ /dev/null @@ -1,229 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class BooleanOperatorPlacementSniff implements Sniff -{ - - /** - * Used to restrict the placement of the boolean operator. - * - * Allowed value are "first" or "last". - * - * @var string|null - */ - public $allowOnly = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_WHILE, - T_SWITCH, - T_ELSEIF, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - ) { - return; - } - - $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; - $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; - - if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line']) { - // Conditions are all on the same line. - return; - } - - $find = [ - T_BOOLEAN_AND, - T_BOOLEAN_OR, - ]; - - if ($this->allowOnly === 'first' || $this->allowOnly === 'last') { - $position = $this->allowOnly; - } else { - $position = null; - } - - $operator = $parenOpener; - $error = false; - $operators = []; - - do { - $operator = $phpcsFile->findNext($find, ($operator + 1), $parenCloser); - if ($operator === false) { - break; - } - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($operator - 1), $parenOpener, true); - if ($prev === false) { - // Parse error. - return; - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($operator + 1), $parenCloser, true); - if ($next === false) { - // Parse error. - return; - } - - $firstOnLine = false; - $lastOnLine = false; - - if ($tokens[$prev]['line'] < $tokens[$operator]['line']) { - // The boolean operator is the first content on the line. - $firstOnLine = true; - } - - if ($tokens[$next]['line'] > $tokens[$operator]['line']) { - // The boolean operator is the last content on the line. - $lastOnLine = true; - } - - if ($firstOnLine === true && $lastOnLine === true) { - // The operator is the only content on the line. - // Don't record it because we can't determine - // placement information from looking at it. - continue; - } - - $operators[] = $operator; - - if ($firstOnLine === false && $lastOnLine === false) { - // It's in the middle of content, so we can't determine - // placement information from looking at it, but we may - // still need to process it. - continue; - } - - if ($firstOnLine === true) { - if ($position === null) { - $position = 'first'; - } - - if ($position !== 'first') { - $error = true; - } - } else { - if ($position === null) { - $position = 'last'; - } - - if ($position !== 'last') { - $error = true; - } - } - } while ($operator !== false); - - if ($error === false) { - return; - } - - switch ($this->allowOnly) { - case 'first': - $error = 'Boolean operators between conditions must be at the beginning of the line'; - break; - case 'last': - $error = 'Boolean operators between conditions must be at the end of the line'; - break; - default: - $error = 'Boolean operators between conditions must be at the beginning or end of the line, but not both'; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundMixed'); - if ($fix === false) { - return; - } - - $phpcsFile->fixer->beginChangeset(); - foreach ($operators as $operator) { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($operator - 1), $parenOpener, true); - $next = $phpcsFile->findNext(T_WHITESPACE, ($operator + 1), $parenCloser, true); - - if ($position === 'last') { - if ($tokens[$next]['line'] === $tokens[$operator]['line']) { - if ($tokens[$prev]['line'] === $tokens[$operator]['line']) { - // Move the content after the operator to the next line. - if ($tokens[($operator + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($operator + 1), ''); - } - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $operator, true); - $padding = str_repeat(' ', ($tokens[$first]['column'] - 1)); - $phpcsFile->fixer->addContent($operator, $phpcsFile->eolChar.$padding); - } else { - // Move the operator to the end of the previous line. - if ($tokens[($operator + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($operator + 1), ''); - } - - $phpcsFile->fixer->addContent($prev, ' '.$tokens[$operator]['content']); - $phpcsFile->fixer->replaceToken($operator, ''); - } - }//end if - } else { - if ($tokens[$prev]['line'] === $tokens[$operator]['line']) { - if ($tokens[$next]['line'] === $tokens[$operator]['line']) { - // Move the operator, and the rest of the expression, to the next line. - if ($tokens[($operator - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($operator - 1), ''); - } - - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $operator, true); - $padding = str_repeat(' ', ($tokens[$first]['column'] - 1)); - $phpcsFile->fixer->addContentBefore($operator, $phpcsFile->eolChar.$padding); - } else { - // Move the operator to the start of the next line. - if ($tokens[($operator - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($operator - 1), ''); - } - - $phpcsFile->fixer->addContentBefore($next, $tokens[$operator]['content'].' '); - $phpcsFile->fixer->replaceToken($operator, ''); - } - }//end if - }//end if - }//end foreach - - $phpcsFile->fixer->endChangeset(); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php deleted file mode 100644 index 9a200aa8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php +++ /dev/null @@ -1,207 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff as PSR2ControlStructureSpacing; -use PHP_CodeSniffer\Util\Tokens; - -class ControlStructureSpacingSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - /** - * Instance of the PSR2 ControlStructureSpacingSniff sniff. - * - * @var \PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff - */ - private $psr2ControlStructureSpacing; - - - /** - * Constructor. - */ - public function __construct() - { - $this->psr2ControlStructureSpacing = new PSR2ControlStructureSpacing(); - - }//end __construct() - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_WHILE, - T_FOREACH, - T_FOR, - T_SWITCH, - T_ELSEIF, - T_CATCH, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - ) { - return; - } - - $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; - $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; - - if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line']) { - // Conditions are all on the same line, so follow PSR2. - return $this->psr2ControlStructureSpacing->process($phpcsFile, $stackPtr); - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($parenOpener + 1), $parenCloser, true); - if ($next === false) { - // No conditions; parse error. - return; - } - - // Check the first expression. - if ($tokens[$next]['line'] !== ($tokens[$parenOpener]['line'] + 1)) { - $error = 'The first expression of a multi-line control structure must be on the line after the opening parenthesis'; - $fix = $phpcsFile->addFixableError($error, $next, 'FirstExpressionLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($parenOpener); - } - } - - // Check the indent of each line. - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $requiredIndent = ($tokens[$first]['column'] + $this->indent - 1); - for ($i = $parenOpener; $i < $parenCloser; $i++) { - if ($tokens[$i]['column'] !== 1 - || $tokens[($i + 1)]['line'] > $tokens[$i]['line'] - || isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true - ) { - continue; - } - - if (($i + 1) === $parenCloser) { - break; - } - - // Leave indentation inside multi-line strings. - if (isset(Tokens::$textStringTokens[$tokens[$i]['code']]) === true - || isset(Tokens::$heredocTokens[$tokens[$i]['code']]) === true - ) { - continue; - } - - if ($tokens[$i]['code'] !== T_WHITESPACE) { - $foundIndent = 0; - } else { - $foundIndent = $tokens[$i]['length']; - } - - if ($foundIndent < $requiredIndent) { - $error = 'Each line in a multi-line control structure must be indented at least once; expected at least %s spaces, but found %s'; - $data = [ - $requiredIndent, - $foundIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $i, 'LineIndent', $data); - if ($fix === true) { - $padding = str_repeat(' ', $requiredIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $padding); - } else { - $phpcsFile->fixer->replaceToken($i, $padding); - } - } - } - }//end for - - // Check the closing parenthesis. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($parenCloser - 1), $parenOpener, true); - if ($tokens[$parenCloser]['line'] !== ($tokens[$prev]['line'] + 1)) { - $error = 'The closing parenthesis of a multi-line control structure must be on the line after the last expression'; - $fix = $phpcsFile->addFixableError($error, $parenCloser, 'CloseParenthesisLine'); - if ($fix === true) { - if ($tokens[$parenCloser]['line'] === $tokens[$prev]['line']) { - $phpcsFile->fixer->addNewlineBefore($parenCloser); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $parenCloser; $i++) { - // Maintain existing newline. - if ($tokens[$i]['line'] === $tokens[$prev]['line']) { - continue; - } - - // Maintain existing indent. - if ($tokens[$i]['line'] === $tokens[$parenCloser]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - if ($tokens[$parenCloser]['line'] !== $tokens[$prev]['line']) { - $requiredIndent = ($tokens[$first]['column'] - 1); - $foundIndent = ($tokens[$parenCloser]['column'] - 1); - if ($foundIndent !== $requiredIndent) { - $error = 'The closing parenthesis of a multi-line control structure must be indented to the same level as start of the control structure; expected %s spaces but found %s'; - $data = [ - $requiredIndent, - $foundIndent, - ]; - $fix = $phpcsFile->addFixableError($error, $parenCloser, 'CloseParenthesisIndent', $data); - if ($fix === true) { - $padding = str_repeat(' ', $requiredIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($parenCloser, $padding); - } else { - $phpcsFile->fixer->replaceToken(($parenCloser - 1), $padding); - } - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php deleted file mode 100644 index d9615f9a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php +++ /dev/null @@ -1,262 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DeclareStatementSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DECLARE]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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) - { - // Allow a byte-order mark. - $tokens = $phpcsFile->getTokens(); - - // There should be no space between declare keyword and opening parenthesis. - $parenthesis = ($stackPtr + 1); - if ($tokens[($stackPtr + 1)]['type'] !== 'T_OPEN_PARENTHESIS') { - $parenthesis = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - $error = 'Expected no space between declare keyword and opening parenthesis in a declare statement'; - - if ($tokens[$parenthesis]['type'] === 'T_OPEN_PARENTHESIS') { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceFoundAfterDeclare'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - } else { - $phpcsFile->addError($error, $parenthesis, 'SpaceFoundAfterDeclare'); - $parenthesis = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($parenthesis + 1)); - } - } - - // There should be no space between open parenthesis and the directive. - $string = $phpcsFile->findNext(T_WHITESPACE, ($parenthesis + 1), null, true); - if ($parenthesis !== false) { - if ($tokens[($parenthesis + 1)]['type'] !== 'T_STRING') { - $error = 'Expected no space between opening parenthesis and directive in a declare statement'; - - if ($tokens[$string]['type'] === 'T_STRING') { - $fix = $phpcsFile->addFixableError($error, $parenthesis, 'SpaceFoundBeforeDirective'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenthesis + 1), ''); - } - } else { - $phpcsFile->addError($error, $string, 'SpaceFoundBeforeDirective'); - $string = $phpcsFile->findNext(T_STRING, ($string + 1)); - } - } - } - - // There should be no space between directive and the equal sign. - $equals = $phpcsFile->findNext(T_WHITESPACE, ($string + 1), null, true); - if ($string !== false) { - // The directive must be in lowercase. - if ($tokens[$string]['content'] !== strtolower($tokens[$string]['content'])) { - $error = 'The directive of a declare statement must be in lowercase'; - $fix = $phpcsFile->addFixableError($error, $string, 'DirectiveNotLowercase'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($string, strtolower($tokens[$string]['content'])); - } - } - - if ($tokens[($string + 1)]['type'] !== 'T_EQUAL') { - $error = 'Expected no space between directive and the equals sign in a declare statement'; - - if ($tokens[$equals]['type'] === 'T_EQUAL') { - $fix = $phpcsFile->addFixableError($error, $equals, 'SpaceFoundAfterDirective'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($string + 1), ''); - } - } else { - $phpcsFile->addError($error, $equals, 'SpaceFoundAfterDirective'); - $equals = $phpcsFile->findNext(T_EQUAL, ($equals + 1)); - } - } - }//end if - - // There should be no space between equal sign and directive value. - $value = $phpcsFile->findNext(T_WHITESPACE, ($equals + 1), null, true); - - if ($value === false) { - // Live coding / parse error. - return; - } - - if ($equals !== false) { - if ($tokens[($equals + 1)]['type'] !== 'T_LNUMBER') { - $error = 'Expected no space between equal sign and the directive value in a declare statement'; - - if ($tokens[$value]['type'] === 'T_LNUMBER') { - $fix = $phpcsFile->addFixableError($error, $value, 'SpaceFoundBeforeDirectiveValue'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($equals + 1), ''); - } - } else { - $phpcsFile->addError($error, $value, 'SpaceFoundBeforeDirectiveValue'); - $value = $phpcsFile->findNext(T_LNUMBER, ($value + 1)); - } - } - } - - $parenthesis = $phpcsFile->findNext(T_WHITESPACE, ($value + 1), null, true); - if ($value !== false) { - if ($tokens[($value + 1)]['type'] !== 'T_CLOSE_PARENTHESIS') { - $error = 'Expected no space between the directive value and closing parenthesis in a declare statement'; - - if ($tokens[$parenthesis]['type'] === 'T_CLOSE_PARENTHESIS') { - $fix = $phpcsFile->addFixableError($error, $parenthesis, 'SpaceFoundAfterDirectiveValue'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($value + 1), ''); - } - } else { - $phpcsFile->addError($error, $parenthesis, 'SpaceFoundAfterDirectiveValue'); - $parenthesis = $phpcsFile->findNext(T_CLOSE_PARENTHESIS, ($parenthesis + 1)); - } - } - } - - // Check for semicolon. - $curlyBracket = false; - if ($tokens[($parenthesis + 1)]['type'] !== 'T_SEMICOLON') { - $token = $phpcsFile->findNext(T_WHITESPACE, ($parenthesis + 1), null, true); - - if ($tokens[$token]['type'] === 'T_OPEN_CURLY_BRACKET') { - // Block declaration. - $curlyBracket = $token; - } else if ($tokens[$token]['type'] === 'T_SEMICOLON') { - $error = 'Expected no space between the closing parenthesis and the semicolon in a declare statement'; - $fix = $phpcsFile->addFixableError($error, $parenthesis, 'SpaceFoundBeforeSemicolon'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenthesis + 1), ''); - } - } else if ($tokens[$token]['type'] === 'T_CLOSE_TAG') { - if ($tokens[($parenthesis)]['line'] !== $tokens[$token]['line']) { - // Close tag must be on the same line.. - $error = 'The close tag must be on the same line as the declare statement'; - $fix = $phpcsFile->addFixableError($error, $parenthesis, 'CloseTagOnNewLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenthesis + 1), ' '); - } - } - } else { - $error = 'Expected no space between the closing parenthesis and the semicolon in a declare statement'; - $phpcsFile->addError($error, $parenthesis, 'SpaceFoundBeforeSemicolon'); - - // See if there is a semicolon or curly bracket after this token. - $token = $phpcsFile->findNext([T_WHITESPACE, T_COMMENT], ($token + 1), null, true); - if ($tokens[$token]['type'] === 'T_OPEN_CURLY_BRACKET') { - $curlyBracket = $token; - } - }//end if - }//end if - - if ($curlyBracket !== false) { - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($curlyBracket - 1), null, true); - $error = 'Expected one space between closing parenthesis and opening curly bracket in a declare statement'; - - // The opening curly bracket must on the same line with a single space between closing bracket. - if ($tokens[$prevToken]['type'] !== 'T_CLOSE_PARENTHESIS') { - $phpcsFile->addError($error, $curlyBracket, 'ExtraSpaceFoundAfterBracket'); - } else if ($phpcsFile->getTokensAsString(($prevToken + 1), ($curlyBracket - $prevToken - 1)) !== ' ') { - $fix = $phpcsFile->addFixableError($error, $curlyBracket, 'ExtraSpaceFoundAfterBracket'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($prevToken + 1), ' '); - $nextToken = ($prevToken + 2); - while ($nextToken !== $curlyBracket) { - $phpcsFile->fixer->replaceToken($nextToken, ''); - $nextToken++; - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - $closeCurlyBracket = $tokens[$curlyBracket]['bracket_closer']; - - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($closeCurlyBracket - 1), null, true); - $nextToken = $phpcsFile->findNext([T_WHITESPACE, T_COMMENT], ($closeCurlyBracket + 1), null, true); - $line = $tokens[$closeCurlyBracket]['line']; - - // The closing curly bracket must be on a new line. - if ($tokens[$prevToken]['line'] === $line || $tokens[$nextToken]['line'] === $line) { - if ($tokens[$prevToken]['line'] === $line) { - $error = 'The closing curly bracket of a declare statement must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $prevToken, 'CurlyBracketNotOnNewLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($prevToken); - } - } - }//end if - - // Closing curly bracket must align with the declare keyword. - if ($tokens[$stackPtr]['column'] !== $tokens[$closeCurlyBracket]['column']) { - $error = 'The closing curly bracket of a declare statements must be aligned with the declare keyword'; - - $fix = $phpcsFile->addFixableError($error, $closeCurlyBracket, 'CloseBracketNotAligned'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closeCurlyBracket - 1), str_repeat(' ', ($tokens[$stackPtr]['column'] - 1))); - } - } - - // The open curly bracket must be the last code on the line. - $token = $phpcsFile->findNext(Tokens::$emptyTokens, ($curlyBracket + 1), null, true); - if ($tokens[$curlyBracket]['line'] === $tokens[$token]['line']) { - $error = 'The open curly bracket of a declare statement must be the last code on the line'; - $fix = $phpcsFile->addFixableError($error, $token, 'CodeFoundAfterCurlyBracket'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($token - 1), null, true); - - for ($i = ($prevToken + 1); $i < $token; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewLineBefore($token); - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php deleted file mode 100644 index f06357d4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php +++ /dev/null @@ -1,429 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FileHeaderSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current - * token in the stack. - * - * @return int|void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $possibleHeaders = []; - - $searchFor = Tokens::$ooScopeTokens; - $searchFor[T_OPEN_TAG] = T_OPEN_TAG; - - $openTag = $stackPtr; - do { - $headerLines = $this->getHeaderLines($phpcsFile, $openTag); - if (empty($headerLines) === true && $openTag === $stackPtr) { - // No content in the file. - return; - } - - $possibleHeaders[$openTag] = $headerLines; - if (count($headerLines) > 1) { - break; - } - - $next = $phpcsFile->findNext($searchFor, ($openTag + 1)); - if (isset(Tokens::$ooScopeTokens[$tokens[$next]['code']]) === true) { - // Once we find an OO token, the file content has - // definitely started. - break; - } - - $openTag = $next; - } while ($openTag !== false); - - if ($openTag === false) { - // We never found a proper file header. - // If the file has multiple PHP open tags, we know - // that it must be a mix of PHP and HTML (or similar) - // so the header rules do not apply. - if (count($possibleHeaders) > 1) { - return $phpcsFile->numTokens; - } - - // There is only one possible header. - // If it is the first content in the file, it technically - // serves as the file header, and the open tag needs to - // have a newline after it. Otherwise, ignore it. - if ($stackPtr > 0) { - return $phpcsFile->numTokens; - } - - $openTag = $stackPtr; - } else if (count($possibleHeaders) > 1) { - // There are other PHP blocks before the file header. - $error = 'The file header must be the first content in the file'; - $phpcsFile->addError($error, $openTag, 'HeaderPosition'); - } else { - // The first possible header was the file header block, - // so make sure it is the first content in the file. - if ($openTag !== 0) { - // Allow for hashbang lines. - $hashbang = false; - if ($tokens[($openTag - 1)]['code'] === T_INLINE_HTML) { - $content = trim($tokens[($openTag - 1)]['content']); - if (substr($content, 0, 2) === '#!') { - $hashbang = true; - } - } - - if ($hashbang === false) { - $error = 'The file header must be the first content in the file'; - $phpcsFile->addError($error, $openTag, 'HeaderPosition'); - } - } - }//end if - - $this->processHeaderLines($phpcsFile, $possibleHeaders[$openTag]); - - return $phpcsFile->numTokens; - - }//end process() - - - /** - * Gather information about the statements inside a possible file header. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current - * token in the stack. - * - * @return array - */ - public function getHeaderLines(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next === false) { - return []; - } - - $headerLines = []; - $headerLines[] = [ - 'type' => 'tag', - 'start' => $stackPtr, - 'end' => $stackPtr, - ]; - - $foundDocblock = false; - - $commentOpeners = Tokens::$scopeOpeners; - unset($commentOpeners[T_NAMESPACE]); - unset($commentOpeners[T_DECLARE]); - unset($commentOpeners[T_USE]); - unset($commentOpeners[T_IF]); - unset($commentOpeners[T_WHILE]); - unset($commentOpeners[T_FOR]); - unset($commentOpeners[T_FOREACH]); - unset($commentOpeners[T_DO]); - unset($commentOpeners[T_TRY]); - - do { - switch ($tokens[$next]['code']) { - case T_DOC_COMMENT_OPEN_TAG: - if ($foundDocblock === true) { - // Found a second docblock, so start of code. - break(2); - } - - // Make sure this is not a code-level docblock. - $end = $tokens[$next]['comment_closer']; - for ($docToken = ($end + 1); $docToken < $phpcsFile->numTokens; $docToken++) { - if (isset(Tokens::$emptyTokens[$tokens[$docToken]['code']]) === true) { - continue; - } - - if ($tokens[$docToken]['code'] === T_ATTRIBUTE - && isset($tokens[$docToken]['attribute_closer']) === true - ) { - $docToken = $tokens[$docToken]['attribute_closer']; - continue; - } - - break; - } - - if ($docToken === $phpcsFile->numTokens) { - $docToken--; - } - - 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; - for ($i = $next; $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_TAG - && strtolower($tokens[$i]['content']) === '@var' - ) { - $annotation = true; - break; - } - } - - if ($annotation === false) { - $foundDocblock = true; - $headerLines[] = [ - 'type' => 'docblock', - 'start' => $next, - 'end' => $end, - ]; - } - }//end if - - $next = $end; - break; - case T_DECLARE: - case T_NAMESPACE: - if (isset($tokens[$next]['scope_opener']) === true) { - // If this statement is using bracketed syntax, it doesn't - // apply to the entire files and so is not part of header. - // The header has now ended and the main code block begins. - break(2); - } - - $end = $phpcsFile->findEndOfStatement($next); - - $headerLines[] = [ - 'type' => substr(strtolower($tokens[$next]['type']), 2), - 'start' => $next, - 'end' => $end, - ]; - - $next = $end; - break; - case T_USE: - $type = 'use'; - $useType = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - if ($useType !== false && $tokens[$useType]['code'] === T_STRING) { - $content = strtolower($tokens[$useType]['content']); - if ($content === 'function' || $content === 'const') { - $type .= ' '.$content; - } - } - - $end = $phpcsFile->findEndOfStatement($next); - - $headerLines[] = [ - 'type' => $type, - 'start' => $next, - 'end' => $end, - ]; - - $next = $end; - break; - default: - // Skip comments as PSR-12 doesn't say if these are allowed or not. - if (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true) { - $next = $phpcsFile->findNext(Tokens::$commentTokens, ($next + 1), null, true); - if ($next === false) { - // We reached the end of the file. - break(2); - } - - $next--; - break; - } - - // We found the start of the main code block. - break(2); - }//end switch - - $next = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); - } while ($next !== false); - - return $headerLines; - - }//end getHeaderLines() - - - /** - * Check the spacing and grouping of the statements inside each header block. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $headerLines Header information, as sourced - * from getHeaderLines(). - * - * @return void - */ - public function processHeaderLines(File $phpcsFile, $headerLines) - { - $tokens = $phpcsFile->getTokens(); - - $found = []; - - foreach ($headerLines as $i => $line) { - if (isset($headerLines[($i + 1)]) === false - || $headerLines[($i + 1)]['type'] !== $line['type'] - ) { - // We're at the end of the current header block. - // Make sure there is a single blank line after - // this block. - $next = $phpcsFile->findNext(T_WHITESPACE, ($line['end'] + 1), null, true); - if ($next !== false && $tokens[$next]['line'] !== ($tokens[$line['end']]['line'] + 2)) { - $error = 'Header blocks must be separated by a single blank line'; - $fix = $phpcsFile->addFixableError($error, $line['end'], 'SpacingAfterBlock'); - if ($fix === true) { - if ($tokens[$next]['line'] === $tokens[$line['end']]['line']) { - $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); - } else if ($tokens[$next]['line'] === ($tokens[$line['end']]['line'] + 1)) { - $phpcsFile->fixer->addNewline($line['end']); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($line['end'] + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === ($tokens[$line['end']]['line'] + 2)) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - // Make sure we haven't seen this next block before. - if (isset($headerLines[($i + 1)]) === true - && isset($found[$headerLines[($i + 1)]['type']]) === true - ) { - $error = 'Similar statements must be grouped together inside header blocks; '; - $error .= 'the first "%s" statement was found on line %s'; - $data = [ - $headerLines[($i + 1)]['type'], - $tokens[$found[$headerLines[($i + 1)]['type']]['start']]['line'], - ]; - $phpcsFile->addError($error, $headerLines[($i + 1)]['start'], 'IncorrectGrouping', $data); - } - } else if ($headerLines[($i + 1)]['type'] === $line['type']) { - // Still in the same block, so make sure there is no - // blank line after this statement. - $next = $phpcsFile->findNext(T_WHITESPACE, ($line['end'] + 1), null, true); - if ($tokens[$next]['line'] > ($tokens[$line['end']]['line'] + 1)) { - $error = 'Header blocks must not contain blank lines'; - $fix = $phpcsFile->addFixableError($error, $line['end'], 'SpacingInsideBlock'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($line['end'] + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$line['end']]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - if (isset($found[$line['type']]) === false) { - $found[$line['type']] = $line; - } - }//end foreach - - /* - Next, check that the order of the header blocks - is correct: - Opening php tag. - File-level docblock. - One or more declare statements. - The namespace declaration of the file. - One or more class-based use import statements. - One or more function-based use import statements. - One or more constant-based use import statements. - */ - - $blockOrder = [ - 'tag' => 'opening PHP tag', - 'docblock' => 'file-level docblock', - 'declare' => 'declare statements', - 'namespace' => 'namespace declaration', - 'use' => 'class-based use imports', - 'use function' => 'function-based use imports', - 'use const' => 'constant-based use imports', - ]; - - foreach (array_keys($found) as $type) { - if ($type === 'tag') { - // The opening tag is always in the correct spot. - continue; - } - - do { - $orderedType = next($blockOrder); - } while ($orderedType !== false && key($blockOrder) !== $type); - - if ($orderedType === false) { - // We didn't find the block type in the rest of the - // ordered array, so it is out of place. - // Error and reset the array to the correct position - // so we can check the next block. - reset($blockOrder); - $prevValidType = 'tag'; - do { - $orderedType = next($blockOrder); - if (isset($found[key($blockOrder)]) === true - && key($blockOrder) !== $type - ) { - $prevValidType = key($blockOrder); - } - } while ($orderedType !== false && key($blockOrder) !== $type); - - $error = 'The %s must follow the %s in the file header'; - $data = [ - $blockOrder[$type], - $blockOrder[$prevValidType], - ]; - $phpcsFile->addError($error, $found[$type]['start'], 'IncorrectOrder', $data); - }//end if - }//end foreach - - }//end processHeaderLines() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php deleted file mode 100644 index 65198e86..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/ImportStatementSniff.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ImportStatementSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_USE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Make sure this is not a closure USE group. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) { - return; - } - - if ($phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens) === true) { - // This rule only applies to import statements. - return; - } - - if ($tokens[$next]['code'] === T_STRING - && (strtolower($tokens[$next]['content']) === 'function' - || strtolower($tokens[$next]['content']) === 'const') - ) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), null, true); - } - - if ($tokens[$next]['code'] !== T_NS_SEPARATOR) { - return; - } - - $error = 'Import statements must not begin with a leading backslash'; - $fix = $phpcsFile->addFixableError($error, $next, 'LeadingSlash'); - - if ($fix === true) { - $phpcsFile->fixer->replaceToken($next, ''); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php deleted file mode 100644 index d0ac5d36..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class OpenTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current - * token in the stack. - * - * @return int - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($stackPtr !== 0) { - // This rule only applies if the open tag is on the first line of the file. - return $phpcsFile->numTokens; - } - - $tokens = $phpcsFile->getTokens(); - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next === false) { - // Empty file. - 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; - } - - $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; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php deleted file mode 100644 index 4314194d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/NullableTypeDeclarationSniff.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class NullableTypeDeclarationSniff implements Sniff -{ - - /** - * An array of valid tokens after `T_NULLABLE` occurrences. - * - * @var array - */ - private $validTokens = [ - T_STRING => true, - T_NS_SEPARATOR => true, - T_CALLABLE => true, - T_SELF => true, - T_PARENT => true, - T_STATIC => true, - T_NULL => true, - T_FALSE => true, - T_TRUE => true, - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_NULLABLE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $nextNonEmptyPtr = $phpcsFile->findNext([T_WHITESPACE], ($stackPtr + 1), null, true); - if ($nextNonEmptyPtr === false) { - // Parse error or live coding. - return; - } - - $tokens = $phpcsFile->getTokens(); - $nextNonEmptyCode = $tokens[$nextNonEmptyPtr]['code']; - $validTokenFound = isset($this->validTokens[$nextNonEmptyCode]); - - if ($validTokenFound === true && $nextNonEmptyPtr === ($stackPtr + 1)) { - // Valid structure. - return; - } - - $error = 'There must not be a space between the question mark and the type in nullable type declarations'; - - if ($validTokenFound === true) { - // No other tokens then whitespace tokens found; fixable. - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WhitespaceFound'); - if ($fix === true) { - for ($i = ($stackPtr + 1); $i < $nextNonEmptyPtr; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - return; - } - - // Non-whitespace tokens found; trigger error but don't fix. - $phpcsFile->addError($error, $stackPtr, 'UnexpectedCharactersFound'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php deleted file mode 100644 index cf1afc56..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php +++ /dev/null @@ -1,110 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ReturnTypeDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - T_FN, - ]; - - }//end register() - - - /** - * Processes this test when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - || $tokens[$stackPtr]['parenthesis_opener'] === null - || $tokens[$stackPtr]['parenthesis_closer'] === null - ) { - return; - } - - $methodProperties = $phpcsFile->getMethodProperties($stackPtr); - if ($methodProperties['return_type'] === '') { - return; - } - - $returnType = $methodProperties['return_type_token']; - if ($methodProperties['nullable_return_type'] === true) { - $returnType = $phpcsFile->findPrevious(T_NULLABLE, ($returnType - 1)); - } - - if ($tokens[($returnType - 1)]['code'] !== T_WHITESPACE - || $tokens[($returnType - 1)]['content'] !== ' ' - || $tokens[($returnType - 2)]['code'] !== T_COLON - ) { - $error = 'There must be a single space between the colon and type in a return type declaration'; - if ($tokens[($returnType - 1)]['code'] === T_WHITESPACE - && $tokens[($returnType - 2)]['code'] === T_COLON - ) { - $fix = $phpcsFile->addFixableError($error, $returnType, 'SpaceBeforeReturnType'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($returnType - 1), ' '); - } - } else if ($tokens[($returnType - 1)]['code'] === T_COLON) { - $fix = $phpcsFile->addFixableError($error, $returnType, 'SpaceBeforeReturnType'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($returnType, ' '); - } - } else { - $phpcsFile->addError($error, $returnType, 'SpaceBeforeReturnType'); - } - } - - $colon = $phpcsFile->findPrevious(T_COLON, $returnType); - if ($tokens[($colon - 1)]['code'] !== T_CLOSE_PARENTHESIS) { - $error = 'There must not be a space before the colon in a return type declaration'; - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($colon - 1), null, true); - if ($tokens[$prev]['code'] === T_CLOSE_PARENTHESIS) { - $fix = $phpcsFile->addFixableError($error, $colon, 'SpaceBeforeColon'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($prev + 1); $x < $colon; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->addError($error, $colon, 'SpaceBeforeColon'); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php deleted file mode 100644 index 65d39eb9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Keywords/ShortFormTypeKeywordsSniff.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ShortFormTypeKeywordsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_BOOL_CAST, - T_INT_CAST, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $typecast = str_replace(' ', '', $tokens[$stackPtr]['content']); - $typecast = str_replace("\t", '', $typecast); - $typecast = trim($typecast, '()'); - $typecastLc = strtolower($typecast); - - if (($tokens[$stackPtr]['code'] === T_BOOL_CAST - && $typecastLc === 'bool') - || ($tokens[$stackPtr]['code'] === T_INT_CAST - && $typecastLc === 'int') - ) { - return; - } - - $error = 'Short form type keywords must be used. Found: %s'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'LongFound', $data); - if ($fix === true) { - if ($tokens[$stackPtr]['code'] === T_BOOL_CAST) { - $replacement = str_replace($typecast, 'bool', $tokens[$stackPtr]['content']); - } else { - $replacement = str_replace($typecast, 'int', $tokens[$stackPtr]['content']); - } - - $phpcsFile->fixer->replaceToken($stackPtr, $replacement); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php deleted file mode 100644 index 34e7f461..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Namespaces/CompoundNamespaceDepthSniff.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class CompoundNamespaceDepthSniff implements Sniff -{ - - /** - * The max depth for compound namespaces. - * - * @var integer - */ - public $maxDepth = 2; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_USE_GROUP]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $this->maxDepth = (int) $this->maxDepth; - - $tokens = $phpcsFile->getTokens(); - - $end = $phpcsFile->findNext(T_CLOSE_USE_GROUP, ($stackPtr + 1)); - if ($end === false) { - return; - } - - $depth = 1; - for ($i = ($stackPtr + 1); $i <= $end; $i++) { - if ($tokens[$i]['code'] === T_NS_SEPARATOR) { - $depth++; - continue; - } - - if ($i === $end || $tokens[$i]['code'] === T_COMMA) { - // End of a namespace. - if ($depth > $this->maxDepth) { - $error = 'Compound namespaces cannot have a depth more than %s'; - $data = [$this->maxDepth]; - $phpcsFile->addError($error, $i, 'TooDeep', $data); - } - - $depth = 1; - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php deleted file mode 100644 index 41628ce3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php +++ /dev/null @@ -1,128 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\OperatorSpacingSniff as SquizOperatorSpacingSniff; -use PHP_CodeSniffer\Util\Tokens; - -class OperatorSpacingSniff extends SquizOperatorSpacingSniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - parent::register(); - - $targets = Tokens::$comparisonTokens; - $targets += Tokens::$operators; - $targets += Tokens::$assignmentTokens; - $targets += Tokens::$booleanOperators; - $targets[] = T_INLINE_THEN; - $targets[] = T_INLINE_ELSE; - $targets[] = T_STRING_CONCAT; - $targets[] = T_INSTANCEOF; - - // Also register the contexts we want to specifically skip over. - $targets[] = T_DECLARE; - - return $targets; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @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. Return `$phpcsFile->numTokens` to skip - * the rest of the file. - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Skip over declare statements as those should be handled by different sniffs. - if ($tokens[$stackPtr]['code'] === T_DECLARE) { - if (isset($tokens[$stackPtr]['parenthesis_closer']) === false) { - // Parse error / live coding. - return $phpcsFile->numTokens; - } - - return $tokens[$stackPtr]['parenthesis_closer']; - } - - if ($this->isOperator($phpcsFile, $stackPtr) === false) { - return; - } - - $operator = $tokens[$stackPtr]['content']; - - $checkBefore = true; - $checkAfter = true; - - // Skip short ternary. - if ($tokens[($stackPtr)]['code'] === T_INLINE_ELSE - && $tokens[($stackPtr - 1)]['code'] === T_INLINE_THEN - ) { - $checkBefore = false; - } - - // Skip operator with comment on previous line. - if ($tokens[($stackPtr - 1)]['code'] === T_COMMENT - && $tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] - ) { - $checkBefore = false; - } - - if (isset($tokens[($stackPtr + 1)]) === true) { - // Skip short ternary. - if ($tokens[$stackPtr]['code'] === T_INLINE_THEN - && $tokens[($stackPtr + 1)]['code'] === T_INLINE_ELSE - ) { - $checkAfter = false; - } - } else { - // Skip partial files. - $checkAfter = false; - } - - if ($checkBefore === true && $tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected at least 1 space before "%s"; 0 found'; - $data = [$operator]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - } - - if ($checkAfter === true && $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected at least 1 space after "%s"; 0 found'; - $data = [$operator]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php deleted file mode 100644 index 8bcf0d56..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ConstantVisibilitySniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CONST]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Make sure this is a class constant. - if ($phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens) === false) { - return; - } - - $ignore = Tokens::$emptyTokens; - $ignore[] = T_FINAL; - - $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); - if (isset(Tokens::$scopeModifiers[$tokens[$prev]['code']]) === true) { - return; - } - - $error = 'Visibility must be declared on all constants if your project supports PHP 7.1 or later'; - $phpcsFile->addWarning($error, $stackPtr, 'NotFound'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php deleted file mode 100644 index 70e99d76..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php +++ /dev/null @@ -1,700 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Sniffs\Traits; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UseDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_USE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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|int - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Needs to be a use statement directly inside a class. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - if (isset(Tokens::$ooScopeTokens[current($conditions)]) === false) { - return; - } - - $ooToken = key($conditions); - $opener = $tokens[$ooToken]['scope_opener']; - - // Figure out where all the use statements are. - $useTokens = [$stackPtr]; - for ($i = ($stackPtr + 1); $i < $tokens[$ooToken]['scope_closer']; $i++) { - if ($tokens[$i]['code'] === T_USE) { - $useTokens[] = $i; - } - - if (isset($tokens[$i]['scope_closer']) === true) { - $i = $tokens[$i]['scope_closer']; - } - } - - $numUseTokens = count($useTokens); - foreach ($useTokens as $usePos => $useToken) { - if ($usePos === 0) { - /* - This is the first use statement. - */ - - // The first non-comment line must be the use line. - $lastValidContent = $useToken; - for ($i = ($useToken - 1); $i > $opener; $i--) { - if ($tokens[$i]['code'] === T_WHITESPACE - && ($tokens[($i - 1)]['line'] === $tokens[$i]['line'] - || $tokens[($i + 1)]['line'] === $tokens[$i]['line']) - ) { - continue; - } - - if (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - // Skip past the comment. - $i = $tokens[$i]['comment_opener']; - } - - $lastValidContent = $i; - - continue; - } - - break; - }//end for - - if ($tokens[$lastValidContent]['line'] !== ($tokens[$opener]['line'] + 1)) { - $error = 'The first trait import statement must be declared on the first non-comment line after the %s opening brace'; - $data = [strtolower($tokens[$ooToken]['content'])]; - - // Figure out if we can fix this error. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($useToken - 1), ($opener - 1), true); - if ($tokens[$prev]['line'] === $tokens[$opener]['line']) { - $fix = $phpcsFile->addFixableError($error, $useToken, 'UseAfterBrace', $data); - if ($fix === true) { - // We know that the USE statements is the first non-comment content - // in the class, so we just need to remove blank lines. - $phpcsFile->fixer->beginChangeset(); - for ($i = ($useToken - 1); $i > $opener; $i--) { - if ($tokens[$i]['line'] === $tokens[$opener]['line']) { - break; - } - - if ($tokens[$i]['line'] === $tokens[$useToken]['line']) { - continue; - } - - if ($tokens[$i]['code'] === T_WHITESPACE - && $tokens[($i - 1)]['line'] !== $tokens[$i]['line'] - && $tokens[($i + 1)]['line'] !== $tokens[$i]['line'] - ) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - if (isset(Tokens::$commentTokens[$tokens[$i]['code']]) === true) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - // Skip past the comment. - $i = $tokens[$i]['comment_opener']; - } - - $lastValidContent = $i; - } - }//end for - - $phpcsFile->fixer->endChangeset(); - }//end if - } else { - $phpcsFile->addError($error, $useToken, 'UseAfterBrace', $data); - }//end if - }//end if - } else { - // Make sure this use statement is not on the same line as the previous one. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($useToken - 1), null, true); - if ($prev !== false && $tokens[$prev]['line'] === $tokens[$useToken]['line']) { - $error = 'Each imported trait must be on its own line'; - $prevNonWs = $phpcsFile->findPrevious(T_WHITESPACE, ($useToken - 1), null, true); - if ($prevNonWs !== $prev) { - $phpcsFile->addError($error, $useToken, 'SpacingBeforeImport'); - } else { - $fix = $phpcsFile->addFixableError($error, $useToken, 'SpacingBeforeImport'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($useToken - 1); $x > $prev; $x--) { - if ($tokens[$x]['line'] === $tokens[$useToken]['line'] - ) { - // Preserve indent. - continue; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewline($prev); - if ($tokens[$prev]['line'] === $tokens[$useToken]['line']) { - if ($tokens[($useToken - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($useToken - 1), ''); - } - - $padding = str_repeat(' ', ($tokens[$useTokens[0]]['column'] - 1)); - $phpcsFile->fixer->addContent($prev, $padding); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - }//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); - $end = $tokens[$useToken]['scope_closer']; - } else { - $this->processUseStatement($phpcsFile, $useToken); - $end = $phpcsFile->findNext(T_SEMICOLON, ($useToken + 1)); - if ($end === false) { - // Syntax error. - return; - } - } - - if ($usePos === ($numUseTokens - 1)) { - /* - This is the last use statement. - */ - - $next = $phpcsFile->findNext(T_WHITESPACE, ($end + 1), null, true); - if ($next === $tokens[$ooToken]['scope_closer']) { - // Last content in the class. - $closer = $tokens[$ooToken]['scope_closer']; - if ($tokens[$closer]['line'] > ($tokens[$end]['line'] + 1)) { - $error = 'There must be no blank line after the last trait import statement at the bottom of a %s'; - $data = [strtolower($tokens[$ooToken]['content'])]; - $fix = $phpcsFile->addFixableError($error, $end, 'BlankLineAfterLastUse', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($end + 1); $i < $closer; $i++) { - if ($tokens[$i]['line'] === $tokens[$end]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$closer]['line']) { - // Don't remove indents. - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - } else if ($tokens[$next]['code'] !== T_USE) { - // Comments are allowed on the same line as the use statement, so make sure - // we don't error for those. - for ($next = ($end + 1); $next < $tokens[$ooToken]['scope_closer']; $next++) { - if ($tokens[$next]['code'] === T_WHITESPACE) { - continue; - } - - if (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true - && $tokens[$next]['line'] === $tokens[$end]['line'] - ) { - continue; - } - - break; - } - - if ($tokens[$next]['line'] <= ($tokens[$end]['line'] + 1)) { - $error = 'There must be a blank line following the last trait import statement'; - $fix = $phpcsFile->addFixableError($error, $end, 'NoBlankLineAfterUse'); - if ($fix === true) { - if ($tokens[$next]['line'] === $tokens[$useToken]['line']) { - $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); - } else { - for ($i = ($next - 1); $i > $end; $i--) { - if ($tokens[$i]['line'] !== $tokens[$next]['line']) { - break; - } - } - - $phpcsFile->fixer->addNewlineBefore(($i + 1)); - } - } - } - }//end if - } else { - // Ensure use statements are grouped. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($next !== $useTokens[($usePos + 1)]) { - $error = 'Imported traits must be grouped together'; - $phpcsFile->addError($error, $useTokens[($usePos + 1)], 'NotGrouped'); - } - }//end if - }//end foreach - - return $tokens[$ooToken]['scope_closer']; - - }//end process() - - - /** - * Processes a group use statement. - * - * @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 - */ - protected function processUseGroup(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $opener = $tokens[$stackPtr]['scope_opener']; - $closer = $tokens[$stackPtr]['scope_closer']; - - if ($tokens[$opener]['line'] !== $tokens[$stackPtr]['line']) { - $error = 'The opening brace of a trait import statement must be on the same line as the USE keyword'; - // Figure out if we can fix this error. - $canFix = true; - for ($i = ($stackPtr + 1); $i < $opener; $i++) { - if ($tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - && $tokens[$i]['code'] !== T_WHITESPACE - ) { - $canFix = false; - break; - } - } - - if ($canFix === true) { - $fix = $phpcsFile->addFixableError($error, $opener, 'OpenBraceNewLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $opener; $i++) { - if ($tokens[$i]['line'] !== $tokens[($i + 1)]['line']) { - // Everything should have a single space around it. - $phpcsFile->fixer->replaceToken($i, ' '); - } - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->addError($error, $opener, 'OpenBraceNewLine'); - } - }//end if - - $error = 'Expected 1 space before opening brace in trait import statement; %s found'; - if ($tokens[($opener - 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $opener, 'SpaceBeforeOpeningBrace', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($opener, ' '); - } - } else if ($tokens[($opener - 1)]['content'] !== ' ') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), null, true); - if ($tokens[$prev]['line'] !== $tokens[$opener]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($opener - 1)]['length']; - } - - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $opener, 'SpaceBeforeOpeningBrace', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($opener - 1); $x > $prev; $x--) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContentBefore($opener, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($opener - 1), ' '); - } - } - }//end if - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), ($closer - 1), true); - if ($next !== false && $tokens[$next]['line'] !== ($tokens[$opener]['line'] + 1)) { - $error = 'First trait conflict resolution statement must be on the line after the opening brace'; - $nextNonWs = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), ($closer - 1), true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $opener, 'SpaceAfterOpeningBrace'); - } else { - $fix = $phpcsFile->addFixableError($error, $opener, 'SpaceAfterOpeningBrace'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($opener + 1); $x < $next; $x++) { - if ($tokens[$x]['line'] === $tokens[$next]['line']) { - // Preserve indent. - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewline($opener); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - for ($i = ($stackPtr + 1); $i < $opener; $i++) { - if ($tokens[$i]['code'] !== T_COMMA) { - continue; - } - - if ($tokens[($i - 1)]['code'] === T_WHITESPACE) { - $error = 'Expected no space before comma in trait import statement; %s found'; - $data = [$tokens[($i - 1)]['length']]; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($i - 1), ''); - } - } - - $error = 'Expected 1 space after comma in trait import statement; %s found'; - if ($tokens[($i + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterComma', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($i, ' '); - } - } else if ($tokens[($i + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $opener, true); - if ($tokens[$next]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i + 1)]['length']; - } - - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterComma', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i + 1), ' '); - } - } - }//end if - }//end for - - for ($i = ($opener + 1); $i < $closer; $i++) { - if ($tokens[$i]['code'] === T_INSTEADOF) { - $error = 'Expected 1 space before INSTEADOF in trait import statement; %s found'; - if ($tokens[($i - 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeInsteadof', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($i, ' '); - } - } else if ($tokens[($i - 1)]['content'] !== ' ') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), $opener, true); - if ($tokens[$prev]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i - 1)]['length']; - } - - $data = [$found]; - - $prevNonWs = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $opener, true); - if ($prevNonWs !== $prev) { - $phpcsFile->addError($error, $i, 'SpaceBeforeInsteadof', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeInsteadof', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i - 1); $x > $prev; $x--) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContentBefore($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i - 1), ' '); - } - } - } - }//end if - - $error = 'Expected 1 space after INSTEADOF in trait import statement; %s found'; - if ($tokens[($i + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterInsteadof', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($i, ' '); - } - } else if ($tokens[($i + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $closer, true); - if ($tokens[$next]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i + 1)]['length']; - } - - $data = [$found]; - - $nextNonWs = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $closer, true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $i, 'SpaceAfterInsteadof', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterInsteadof', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i + 1), ' '); - } - } - } - }//end if - }//end if - - if ($tokens[$i]['code'] === T_AS) { - $error = 'Expected 1 space before AS in trait import statement; %s found'; - if ($tokens[($i - 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeAs', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($i, ' '); - } - } else if ($tokens[($i - 1)]['content'] !== ' ') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), $opener, true); - if ($tokens[$prev]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i - 1)]['length']; - } - - $data = [$found]; - - $prevNonWs = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($i - 1), $opener, true); - if ($prevNonWs !== $prev) { - $phpcsFile->addError($error, $i, 'SpaceBeforeAs', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeAs', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i - 1); $x > $prev; $x--) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContentBefore($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i - 1), ' '); - } - } - } - }//end if - - $error = 'Expected 1 space after AS in trait import statement; %s found'; - if ($tokens[($i + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterAs', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($i, ' '); - } - } else if ($tokens[($i + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $closer, true); - if ($tokens[$next]['line'] !== $tokens[$i]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($i + 1)]['length']; - } - - $data = [$found]; - - $nextNonWs = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), $closer, true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $i, 'SpaceAfterAs', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterAs', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($i + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($i, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($i + 1), ' '); - } - } - } - }//end if - }//end if - - if ($tokens[$i]['code'] === T_SEMICOLON) { - if ($tokens[($i - 1)]['code'] === T_WHITESPACE) { - $error = 'Expected no space before semicolon in trait import statement; %s found'; - $data = [$tokens[($i - 1)]['length']]; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeSemicolon', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($i - 1), ''); - } - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), ($closer - 1), true); - if ($next !== false && $tokens[$next]['line'] === $tokens[$i]['line']) { - $error = 'Each trait conflict resolution statement must be on a line by itself'; - $nextNonWs = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closer - 1), true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $i, 'ConflictSameLine'); - } else { - $fix = $phpcsFile->addFixableError($error, $i, 'ConflictSameLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if ($tokens[($i + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($i + 1), ''); - } - - $phpcsFile->fixer->addNewline($i); - $phpcsFile->fixer->endChangeset(); - } - } - } - }//end if - }//end for - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closer - 1), ($opener + 1), true); - if ($prev !== false && $tokens[$prev]['line'] !== ($tokens[$closer]['line'] - 1)) { - $error = 'Closing brace must be on the line after the last trait conflict resolution statement'; - $prevNonWs = $phpcsFile->findPrevious(T_WHITESPACE, ($closer - 1), ($opener + 1), true); - if ($prevNonWs !== $prev) { - $phpcsFile->addError($error, $closer, 'SpaceBeforeClosingBrace'); - } else { - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceBeforeClosingBrace'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($closer - 1); $x > $prev; $x--) { - if ($tokens[$x]['line'] === $tokens[$closer]['line']) { - // Preserve indent. - continue; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end processUseGroup() - - - /** - * Processes a single use statement. - * - * @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 - */ - protected function processUseStatement(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $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'; - $fix = $phpcsFile->addFixableError($error, $next, 'MultipleImport'); - if ($fix === true) { - $padding = str_repeat(' ', ($tokens[$stackPtr]['column'] - 1)); - $phpcsFile->fixer->replaceToken($next, ';'.$phpcsFile->eolChar.$padding.'use '); - } - } - - }//end processUseStatement() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc deleted file mode 100644 index 386b12c2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc +++ /dev/null @@ -1,96 +0,0 @@ -bar( - new class implements Bar { - // ... - }, -); - -foo(new class { -}); - -// Issue #3790: OpenBraceSameLine fixer should not remove open brace. -$instance = new class() extends SomeClass implements - SomeInterface{ - public function __construct() {} -}; - -// PHP 8.3 readonly anonymous classes. -$anon = new readonly class {}; -$anon = new readonly class {}; -$anon = new readonly - class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed deleted file mode 100644 index 28b38f70..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,98 +0,0 @@ -bar( - new class implements Bar { - // ... - }, -); - -foo(new class { -}); - -// Issue #3790: OpenBraceSameLine fixer should not remove open brace. -$instance = new class () extends SomeClass implements - SomeInterface -{ - public function __construct() {} -}; - -// PHP 8.3 readonly anonymous classes. -$anon = new readonly class {}; -$anon = new readonly class {}; -$anon = new readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php deleted file mode 100644 index 24035270..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/AnonClassDeclarationUnitTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the AnonClassDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\AnonClassDeclarationSniff - */ -final class AnonClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 28 => 3, - 30 => 1, - 31 => 4, - 32 => 1, - 33 => 1, - 34 => 1, - 35 => 1, - 36 => 1, - 37 => 3, - 39 => 1, - 40 => 1, - 43 => 3, - 44 => 4, - 45 => 1, - 48 => 1, - 52 => 3, - 53 => 1, - 54 => 1, - 55 => 1, - 56 => 2, - 63 => 1, - 75 => 1, - 87 => 1, - 88 => 1, - 94 => 1, - 96 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc deleted file mode 100644 index 26411677..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc +++ /dev/null @@ -1,51 +0,0 @@ -bar(); -echo (new Foo)->bar(); -echo (new Foo((new Bar)->getBaz()))->bar(); -$foo = (new Foo)::$bar; - -echo (new Foo((new Bar//comment -)->getBaz(new Baz /* comment */)))->bar(); - -$foo = new $bar['a'](); -$foo = new $bar['a']['b'](); -$foo = new $bar['a'][$baz['a']['b']]['b'](); -$foo = new $bar['a'] [$baz['a']/* comment */ ['b']]['b']; - -$a = new self::$transport[$cap_string]; -$renderer = new $this->inline_diff_renderer; -$a = new ${$varHoldingClassName}; - -$class = new $obj?->classname(); -$class = new $obj?->classname; -$class = new ${$obj?->classname}; - -// Issue 3456. -// Anon classes should be skipped, even when there is an attribute between the new and the class keywords. -$anonWithAttribute = new #[SomeAttribute('summary')] class { - public const SOME_STUFF = 'foo'; -}; - -$foo = new parent(); -$foo = new parent; - -// PHP 8.3: safeguard that the sniff ignores anonymous classes, even when declared as readonly. -$anon = new readonly class {}; -$anon = new #[MyAttribute] readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed deleted file mode 100644 index 1e580f45..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.inc.fixed +++ /dev/null @@ -1,51 +0,0 @@ -bar(); -echo (new Foo())->bar(); -echo (new Foo((new Bar())->getBaz()))->bar(); -$foo = (new Foo())::$bar; - -echo (new Foo((new Bar()//comment -)->getBaz(new Baz() /* comment */)))->bar(); - -$foo = new $bar['a'](); -$foo = new $bar['a']['b'](); -$foo = new $bar['a'][$baz['a']['b']]['b'](); -$foo = new $bar['a'] [$baz['a']/* comment */ ['b']]['b'](); - -$a = new self::$transport[$cap_string](); -$renderer = new $this->inline_diff_renderer(); -$a = new ${$varHoldingClassName}(); - -$class = new $obj?->classname(); -$class = new $obj?->classname(); -$class = new ${$obj?->classname}(); - -// Issue 3456. -// Anon classes should be skipped, even when there is an attribute between the new and the class keywords. -$anonWithAttribute = new #[SomeAttribute('summary')] class { - public const SOME_STUFF = 'foo'; -}; - -$foo = new parent(); -$foo = new parent(); - -// PHP 8.3: safeguard that the sniff ignores anonymous classes, even when declared as readonly. -$anon = new readonly class {}; -$anon = new #[MyAttribute] readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php deleted file mode 100644 index 10356921..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClassInstantiationUnitTest.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassInstantiation sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClassInstantiationSniff - */ -final class ClassInstantiationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 1, - 9 => 1, - 11 => 1, - 14 => 1, - 16 => 1, - 20 => 1, - 21 => 1, - 22 => 1, - 24 => 1, - 25 => 1, - 30 => 1, - 32 => 1, - 33 => 1, - 34 => 1, - 37 => 1, - 38 => 1, - 47 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc deleted file mode 100644 index 2562d26c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.inc +++ /dev/null @@ -1,52 +0,0 @@ -bar( - $arg1, - function ($arg2) use ($var1) { - // body - }, - $arg3 -); - -$instance = new class extends \Foo implements \HandleableInterface { - // Class content -}; - -$app->get('/hello/{name}', function ($name) use ($app) { - return 'Hello ' . $app->escape($name); -}); - -enum Foo4 -{ - -}//end diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php deleted file mode 100644 index 196de8f5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/ClosingBraceUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClosingBrace sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClosingBraceSniff - */ -final class ClosingBraceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 13 => 1, - 14 => 1, - 19 => 1, - 24 => 1, - 31 => 1, - 52 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc deleted file mode 100644 index 2c41bde9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Classes/OpeningBraceSpaceUnitTest.inc +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the OpeningBraceSpace sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\OpeningBraceSpaceSniff - */ -final class OpeningBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 1, - 18 => 1, - 24 => 1, - 34 => 1, - 41 => 1, - 55 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc deleted file mode 100644 index 4bc2eceb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc +++ /dev/null @@ -1,131 +0,0 @@ - 0 && $n < 10) - || ($n > 10 && $n < 20) - || ($n > 20 && $n < 30) -) { - return $n; -} - -if ( - ( - $expr1 - && $expr2 - && $expr3 - && $expr4 - && $expr5 - && $expr6 - ) - || ($n > 100 && $n < 200) - || ($n > 200 && $n < 300) -) { - return $n; -} - -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly first -if ( - $expr1 - && $expr2 - && ($expr3 - || $expr4) - && $expr5 -) { - // if body -} elseif ( - $expr1 && - ($expr3 || $expr4) - && $expr5 -) { - // elseif body -} elseif ( - $expr1 - && ($expr3 || $expr4) && - $expr5 -) { - // elseif body -} - -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly last -if ( - $expr1 - && $expr2 - && ($expr3 - || $expr4) - && $expr5 -) { - // if body -} elseif ( - $expr1 && - ($expr3 || $expr4) - && $expr5 -) { - // elseif body -} elseif ( - $expr1 - && ($expr3 || $expr4) && - $expr5 -) { - // elseif body -} - -if ( - ($value == 1 || - $value == 2) - && - ($value == 3 || - $value == 4) -) { - return 5; -} - -// Reset to default. -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly - -match ( - $expr1 - && $expr2 && - $expr3 -) { - // structure body -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed deleted file mode 100644 index 5f4d223e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.inc.fixed +++ /dev/null @@ -1,141 +0,0 @@ - 0 && $n < 10) - || ($n > 10 && $n < 20) - || ($n > 20 && $n < 30) -) { - return $n; -} - -if ( - ( - $expr1 - && $expr2 - && $expr3 - && $expr4 - && $expr5 - && $expr6 - ) - || ($n > 100 && $n < 200) - || ($n > 200 && $n < 300) -) { - return $n; -} - -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly first -if ( - $expr1 - && $expr2 - && ($expr3 - || $expr4) - && $expr5 -) { - // if body -} elseif ( - $expr1 - && ($expr3 - || $expr4) - && $expr5 -) { - // elseif body -} elseif ( - $expr1 - && ($expr3 - || $expr4) - && $expr5 -) { - // elseif body -} - -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly last -if ( - $expr1 && - $expr2 && - ($expr3 || - $expr4) && - $expr5 -) { - // if body -} elseif ( - $expr1 && - ($expr3 || - $expr4) && - $expr5 -) { - // elseif body -} elseif ( - $expr1 && - ($expr3 || - $expr4) && - $expr5 -) { - // elseif body -} - -if ( - ($value == 1 || - $value == 2) - && - ($value == 3 || - $value == 4) -) { - return 5; -} - -// Reset to default. -// phpcs:set PSR12.ControlStructures.BooleanOperatorPlacement allowOnly - -match ( - $expr1 - && $expr2 - && $expr3 -) { - // structure body -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php deleted file mode 100644 index 957ea546..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/BooleanOperatorPlacementUnitTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the BooleanOperatorPlacement sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\BooleanOperatorPlacementSniff - */ -final class BooleanOperatorPlacementUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 1, - 16 => 1, - 28 => 1, - 34 => 1, - 75 => 1, - 81 => 1, - 90 => 1, - 98 => 1, - 104 => 1, - 125 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc deleted file mode 100644 index 9c037d6c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc +++ /dev/null @@ -1,100 +0,0 @@ - $foo - /* - * A multi-line comment. - */ - && $foo === true - ) { - break; - } - -match ( - $expr1 && - $expr2 && - $expr3 - ) { - // structure body -}; - -match ($expr1 && -$expr2 && - $expr3) { - // structure body -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed deleted file mode 100644 index 7ea61b1e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,103 +0,0 @@ - $foo - /* - * A multi-line comment. - */ - && $foo === true - ) { - break; - } - -match ( - $expr1 && - $expr2 && - $expr3 -) { - // structure body -}; - -match ( - $expr1 && - $expr2 && - $expr3 -) { - // structure body -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php deleted file mode 100644 index 69ef8b7c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/ControlStructures/ControlStructureSpacingUnitTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ControlStructureSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\ControlStructureSpacingSniff - */ -final class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 2, - 16 => 1, - 17 => 1, - 18 => 1, - 22 => 1, - 23 => 1, - 32 => 1, - 33 => 1, - 34 => 1, - 37 => 1, - 38 => 1, - 39 => 1, - 48 => 2, - 58 => 1, - 59 => 1, - 92 => 1, - 96 => 1, - 97 => 1, - 98 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc deleted file mode 100644 index f21daaff..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/DeclareStatementUnitTest.1.inc +++ /dev/null @@ -1,50 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DeclareStatement sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\DeclareStatementSniff - */ -final class DeclareStatementUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DeclareStatementUnitTest.1.inc': - return [ - 2 => 1, - 3 => 1, - 4 => 1, - 5 => 2, - 6 => 1, - 7 => 1, - 9 => 2, - 10 => 1, - 11 => 3, - 12 => 2, - 13 => 1, - 14 => 2, - 16 => 3, - 19 => 3, - 22 => 1, - 24 => 1, - 26 => 3, - 28 => 3, - 34 => 2, - 43 => 1, - 46 => 1, - 47 => 1, - 49 => 1, - ]; - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc deleted file mode 100644 index 1298ed71..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.1.inc +++ /dev/null @@ -1,29 +0,0 @@ - - -

    - - - -

    - - - - -

    Demo

    - - -
  • My page
  • -
  • Write
  • -
  • Sign out
  • - -
  • Sign in
  • - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc deleted file mode 100644 index 11102beb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.15.inc +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc deleted file mode 100644 index 5c3df1f3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/FileHeaderUnitTest.16.inc +++ /dev/null @@ -1,13 +0,0 @@ - - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FileHeader sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\FileHeaderSniff - */ -final class FileHeaderUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FileHeaderUnitTest.2.inc': - return [ - 1 => 1, - 6 => 1, - 7 => 1, - 18 => 1, - 20 => 1, - 24 => 1, - ]; - case 'FileHeaderUnitTest.3.inc': - return [ - 9 => 1, - 18 => 1, - ]; - case 'FileHeaderUnitTest.4.inc': - return [ - 1 => 1, - 2 => 1, - 3 => 1, - 7 => 1, - ]; - case 'FileHeaderUnitTest.5.inc': - return [4 => 1]; - case 'FileHeaderUnitTest.7.inc': - case 'FileHeaderUnitTest.10.inc': - case 'FileHeaderUnitTest.11.inc': - return [1 => 1]; - case 'FileHeaderUnitTest.12.inc': - return [4 => 2]; - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc deleted file mode 100644 index 6d024eaa..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/ImportStatementUnitTest.inc +++ /dev/null @@ -1,26 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ImportStatement sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\ImportStatementSniff - */ -final class ImportStatementUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 1, - 7 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc deleted file mode 100644 index 0dbdf010..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.1.inc +++ /dev/null @@ -1,3 +0,0 @@ - -hi diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc deleted file mode 100644 index 09be8fbe..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Files/OpenTagUnitTest.4.inc +++ /dev/null @@ -1,2 +0,0 @@ - - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the OpenTag sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\OpenTagSniff - */ -final class OpenTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'OpenTagUnitTest.2.inc': - return [1 => 1]; - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc deleted file mode 100644 index 056d74c3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/NullableTypeDeclarationUnitTest.inc +++ /dev/null @@ -1,95 +0,0 @@ - - * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the NullableWhitespace sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\NullableTypeDeclarationSniff - */ -final class NullableTypeDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - protected function getErrorList() - { - return [ - 23 => 1, - 24 => 1, - 25 => 1, - 30 => 1, - 31 => 1, - 32 => 1, - 43 => 2, - 48 => 1, - 50 => 1, - 51 => 1, - 53 => 1, - 57 => 2, - 58 => 2, - 59 => 2, - 87 => 1, - 90 => 1, - 91 => 1, - 95 => 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. - * - * @return array - */ - protected function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc deleted file mode 100644 index 59ab1aa7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc +++ /dev/null @@ -1,66 +0,0 @@ - $arg; - -return (!$a ? [ new class { public function b(): c {} } ] : []); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed deleted file mode 100644 index cd79f781..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,62 +0,0 @@ - $arg; - -return (!$a ? [ new class { public function b(): c {} } ] : []); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php deleted file mode 100644 index d2962e8d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Functions/ReturnTypeDeclarationUnitTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2018 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ReturnTypeDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\ReturnTypeDeclarationSniff - */ -final class ReturnTypeDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - protected function getErrorList() - { - return [ - 27 => 1, - 28 => 1, - 35 => 2, - 41 => 2, - 48 => 2, - 52 => 1, - 55 => 1, - 56 => 1, - 59 => 1, - 60 => 1, - 62 => 1, - 64 => 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. - * - * @return array - */ - protected function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc deleted file mode 100644 index 6ce930d9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Keywords/ShortFormTypeKeywordsUnitTest.inc +++ /dev/null @@ -1,14 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Keywords; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ShortFormTypeKeywords sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords\ShortFormTypeKeywordsSniff - */ -final class ShortFormTypeKeywordsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 13 => 1, - 14 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc deleted file mode 100644 index 3336fc2d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Namespaces/CompoundNamespaceDepthUnitTest.inc +++ /dev/null @@ -1,31 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Namespaces; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the CompoundNamespaceDepth sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces\CompoundNamespaceDepthSniff - */ -final class CompoundNamespaceDepthUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 1, - 18 => 1, - 21 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc deleted file mode 100644 index 14cf8e9d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc +++ /dev/null @@ -1,79 +0,0 @@ - $b) { - $variable =$foo ? 'foo' :'bar'; - $variable.='text'.'text'; -} - -$foo+= $a&$b; -$foo = $a|$b; -$foo =$a^$b; -$foo = ~$a; -$foo *=$a<<$b; -$foo = $a>>$b; - -function foo(&$a,& $b) {} - -$foo = $a and$b; -$foo = $a or $b; -$foo = $a xor$b; -$foo = !$a; -$foo = $a&&$b; -$foo = $a||$b; - -$foo = $a instanceof Foo; -$foo = $a instanceof$b; - -$foo .= 'hi' - .= 'there'; - -$foo .= 'hi' -.= 'there'; - -$foo .= 'hi' // comment -.= 'there'; - -$foo/*comment*/=/*comment*/$a/*comment*/and/*comment*/$b; - -$foo .=//comment -'string' .=/*comment*/ -'string'; - -$foo = $foo ?: 'bar'; -$foo = $foo?:'bar'; - -try { -} catch (ExceptionType1|ExceptionType2 $e) { -} - -if (strpos($tokenContent, 'b"') === 0 && substr($tokenContent, -1) === '"') {} - -$oldConstructorPos = +1; -return -$content; - -function name($a = -1) {} - -$a =& $ref; -$a = [ 'a' => &$something ]; - -$fn = fn(array &$one) => 1; -$fn = fn(array & $one) => 1; - -$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); - -function issue3267(string|int ...$values) {} - -function setDefault(#[ImportValue( - constraints: [ - [ - Assert\Type::class, - ['type' => 'bool'], - ], - ] - )] ?bool $value = null): void - { - // Do something - } - -declare(strict_types=1); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc.fixed deleted file mode 100644 index 0f52f1cf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.1.inc.fixed +++ /dev/null @@ -1,79 +0,0 @@ - $b) { - $variable = $foo ? 'foo' : 'bar'; - $variable .= 'text' . 'text'; -} - -$foo += $a & $b; -$foo = $a | $b; -$foo = $a ^ $b; -$foo = ~$a; -$foo *= $a << $b; -$foo = $a >> $b; - -function foo(&$a,& $b) {} - -$foo = $a and $b; -$foo = $a or $b; -$foo = $a xor $b; -$foo = !$a; -$foo = $a && $b; -$foo = $a || $b; - -$foo = $a instanceof Foo; -$foo = $a instanceof $b; - -$foo .= 'hi' - .= 'there'; - -$foo .= 'hi' -.= 'there'; - -$foo .= 'hi' // comment -.= 'there'; - -$foo/*comment*/ = /*comment*/$a/*comment*/ and /*comment*/$b; - -$foo .= //comment -'string' .= /*comment*/ -'string'; - -$foo = $foo ?: 'bar'; -$foo = $foo ?: 'bar'; - -try { -} catch (ExceptionType1 | ExceptionType2 $e) { -} - -if (strpos($tokenContent, 'b"') === 0 && substr($tokenContent, -1) === '"') {} - -$oldConstructorPos = +1; -return -$content; - -function name($a = -1) {} - -$a =& $ref; -$a = [ 'a' => &$something ]; - -$fn = fn(array &$one) => 1; -$fn = fn(array & $one) => 1; - -$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); - -function issue3267(string|int ...$values) {} - -function setDefault(#[ImportValue( - constraints: [ - [ - Assert\Type::class, - ['type' => 'bool'], - ], - ] - )] ?bool $value = null): void - { - // Do something - } - -declare(strict_types=1); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.2.inc deleted file mode 100644 index 3a0dbac3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Operators/OperatorSpacingUnitTest.2.inc +++ /dev/null @@ -1,3 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Operators; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the OperatorSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators\OperatorSpacingSniff - */ -final class OperatorSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'OperatorSpacingUnitTest.1.inc': - return [ - 2 => 1, - 3 => 2, - 4 => 1, - 5 => 2, - 6 => 4, - 9 => 3, - 10 => 2, - 11 => 3, - 13 => 3, - 14 => 2, - 18 => 1, - 20 => 1, - 22 => 2, - 23 => 2, - 26 => 1, - 37 => 4, - 39 => 1, - 40 => 1, - 44 => 2, - 47 => 2, - ]; - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc deleted file mode 100644 index 84ea24b2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Properties/ConstantVisibilityUnitTest.inc +++ /dev/null @@ -1,22 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Properties; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ConstantVisibility sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties\ConstantVisibilitySniff - */ -final class ConstantVisibilityUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [ - 4 => 1, - 12 => 1, - 21 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc deleted file mode 100644 index 152121cf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Tests/Traits/UseDeclarationUnitTest.inc +++ /dev/null @@ -1,221 +0,0 @@ - - * @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR12\Tests\Traits; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the UseDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR12\Sniffs\Traits\UseDeclarationSniff - */ -final class UseDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 15 => 1, - 29 => 2, - 30 => 1, - 42 => 1, - 57 => 4, - 59 => 3, - 61 => 1, - 63 => 5, - 65 => 1, - 71 => 1, - 73 => 2, - 76 => 1, - 86 => 2, - 103 => 1, - 112 => 1, - 122 => 1, - 132 => 1, - 157 => 1, - 165 => 1, - 170 => 1, - 208 => 1, - 219 => 3, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml deleted file mode 100644 index 2f9ae0a4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml +++ /dev/null @@ -1,348 +0,0 @@ - - - The PSR-12 coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - Method name "%s" must not be prefixed with an underscore to indicate visibility - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml deleted file mode 100644 index 4e56bc04..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/ClassDeclarationStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - class Foo -{ -} - ]]> - - - class Foo -{ -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml deleted file mode 100644 index 042c0c6c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - bar; -} - ]]> - - - _bar; -} - ]]> - - - - - private $bar; -} - ]]> - - - var $bar; -} - ]]> - - - - - - - - $bar, $baz; -} - ]]> - - - - - static $bar; - private $baz; -} - ]]> - - - static protected $bar; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml deleted file mode 100644 index dcbe98f5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ControlStructureSpacingStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - $foo) { - $var = 1; -} - ]]> - - - $foo ) { - $var = 1; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml deleted file mode 100644 index a22dd179..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/ElseIfDeclarationStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - elseif ($bar) { - $var = 2; -} - ]]> - - - else if ($bar) { - $var = 2; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml deleted file mode 100644 index 1d6d053d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - case 'bar': - break; -} - ]]> - - - case 'bar': - break; -} - ]]> - - - - - 'bar': - break; -} - ]]> - - - 'bar': - break; -} - ]]> - - - - - : - break; - default: - break; -} - ]]> - - - : - break; - default : - break; -} - ]]> - - - - - break; -} - ]]> - - - break; -} - ]]> - - - - - // no break - default: - break; -} - ]]> - - - : - break; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml deleted file mode 100644 index 60d5e7fb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/ClosingTagStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - ]]> - - - ?> - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml deleted file mode 100644 index d6d3aad1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Files/EndFileNewlineStandard.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml deleted file mode 100644 index 257bcab0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionCallSignatureStandard.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - ($bar, $baz); - ]]> - - - ( $bar, $baz ); - ]]> - - - - - $bar, - $baz -); - ]]> - - - $bar, - $baz -); - ]]> - - - - - ); - ]]> - - - ); - ]]> - - - - - $bar, - $baz -); - ]]> - - - $bar, - $baz -); - ]]> - - - - - $baz -); - ]]> - - - $baz -); - ]]> - - - - - - - - - $baz -); - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml deleted file mode 100644 index 3b1b6555..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/FunctionClosingBraceStandard.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - } - ]]> - - - -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml deleted file mode 100644 index e45469e8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Methods/MethodDeclarationStandard.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - bar() - { - } -} - ]]> - - - _bar() - { - } -} - ]]> - - - - - final public static function bar() - { - } -} - ]]> - - - static public final function bar() - { - } -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml deleted file mode 100644 index 1f4d389a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/NamespaceDeclarationStandard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - -use \Baz; - ]]> - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml deleted file mode 100644 index 4082603c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - \Foo, \Bar; - ]]> - - - - - - - - - - - - - -class Baz -{ -} - ]]> - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php deleted file mode 100644 index 887c552e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php +++ /dev/null @@ -1,540 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff as PEARClassDeclarationSniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDeclarationSniff extends PEARClassDeclarationSniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - // We want all the errors from the PEAR standard, plus some of our own. - parent::process($phpcsFile, $stackPtr); - - // Just in case. - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - return; - } - - $this->processOpen($phpcsFile, $stackPtr); - $this->processClose($phpcsFile, $stackPtr); - - }//end process() - - - /** - * Processes the opening section of a class declaration. - * - * @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 processOpen(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $stackPtrType = strtolower($tokens[$stackPtr]['content']); - - // Check alignment of the keyword and braces. - $classModifiers = [ - T_ABSTRACT => T_ABSTRACT, - T_FINAL => T_FINAL, - T_READONLY => T_READONLY, - ]; - - $prevNonSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - if (isset($classModifiers[$tokens[$prevNonEmpty]['code']]) === true) { - $spaces = 0; - $errorCode = 'SpaceBeforeKeyword'; - if ($tokens[$prevNonEmpty]['line'] !== $tokens[$stackPtr]['line']) { - $spaces = 'newline'; - $errorCode = 'NewlineBeforeKeyword'; - } else if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $spaces = $tokens[($stackPtr - 1)]['length']; - } - - if ($spaces !== 1) { - $error = 'Expected 1 space between %s and %s keywords; %s found'; - $data = [ - strtolower($tokens[$prevNonEmpty]['content']), - $stackPtrType, - $spaces, - ]; - - if ($prevNonSpace !== $prevNonEmpty) { - // Comment found between modifier and class keyword. Do not auto-fix. - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); - if ($fix === true) { - if ($spaces === 0) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } else { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - for ($i = ($stackPtr - 2); $i > $prevNonSpace; $i--) { - $phpcsFile->fixer->replaceToken($i, ' '); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } - }//end if - }//end if - - // We'll need the indent of the class/interface declaration for later. - $classIndent = 0; - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { - continue; - } - - // We changed lines. - if ($tokens[($i + 1)]['code'] === T_WHITESPACE) { - $classIndent = $tokens[($i + 1)]['length']; - } - - break; - } - - $className = null; - $checkSpacing = true; - - if ($tokens[$stackPtr]['code'] !== T_ANON_CLASS) { - $className = $phpcsFile->findNext(T_STRING, $stackPtr); - } else { - // Ignore the spacing check if this is a simple anon class. - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next === $tokens[$stackPtr]['scope_opener'] - && $tokens[$next]['line'] > $tokens[$stackPtr]['line'] - ) { - $checkSpacing = false; - } - } - - if ($checkSpacing === true) { - // Spacing of the keyword. - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $gap = 0; - } else if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $gap = 'newline'; - } else { - $gap = $tokens[($stackPtr + 1)]['length']; - } - - if ($gap !== 1) { - $error = 'Expected 1 space after %s keyword; %s found'; - $data = [ - $stackPtrType, - $gap, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword', $data); - if ($fix === true) { - if ($gap === 0) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } - }//end if - - // Check after the class/interface name. - if ($className !== null - && $tokens[($className + 2)]['line'] === $tokens[$className]['line'] - ) { - $gap = $tokens[($className + 1)]['content']; - if (strlen($gap) !== 1) { - $found = strlen($gap); - $error = 'Expected 1 space after %s name; %s found'; - $data = [ - $stackPtrType, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $className, 'SpaceAfterName', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($className + 1), ' '); - } - } - } - - $openingBrace = $tokens[$stackPtr]['scope_opener']; - - // Check positions of the extends and implements keywords. - $compareToken = $stackPtr; - $compareType = 'name'; - if ($tokens[$stackPtr]['code'] === T_ANON_CLASS) { - if (isset($tokens[$stackPtr]['parenthesis_opener']) === true) { - $compareToken = $tokens[$stackPtr]['parenthesis_closer']; - $compareType = 'closing parenthesis'; - } else { - $compareType = 'keyword'; - } - } - - foreach (['extends', 'implements'] as $keywordType) { - $keyword = $phpcsFile->findNext(constant('T_'.strtoupper($keywordType)), ($compareToken + 1), $openingBrace); - if ($keyword !== false) { - if ($tokens[$keyword]['line'] !== $tokens[$compareToken]['line']) { - $error = 'The '.$keywordType.' keyword must be on the same line as the %s '.$compareType; - $data = [$stackPtrType]; - $fix = $phpcsFile->addFixableError($error, $keyword, ucfirst($keywordType).'Line', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $comments = []; - - for ($i = ($compareToken + 1); $i < $keyword; ++$i) { - if ($tokens[$i]['code'] === T_COMMENT) { - $comments[] = trim($tokens[$i]['content']); - } - - if ($tokens[$i]['code'] === T_WHITESPACE - || $tokens[$i]['code'] === T_COMMENT - ) { - $phpcsFile->fixer->replaceToken($i, ' '); - } - } - - $phpcsFile->fixer->addContent($compareToken, ' '); - if (empty($comments) === false) { - $i = $keyword; - while ($tokens[($i + 1)]['line'] === $tokens[$keyword]['line']) { - ++$i; - } - - $phpcsFile->fixer->addContentBefore($i, ' '.implode(' ', $comments)); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - } else { - // Check the whitespace before. Whitespace after is checked - // later by looking at the whitespace before the first class name - // in the list. - $gap = $tokens[($keyword - 1)]['length']; - if ($gap !== 1) { - $error = 'Expected 1 space before '.$keywordType.' keyword; %s found'; - $data = [$gap]; - $fix = $phpcsFile->addFixableError($error, $keyword, 'SpaceBefore'.ucfirst($keywordType), $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($keyword - 1), ' '); - } - } - }//end if - }//end if - }//end foreach - - // Check each of the extends/implements class names. If the extends/implements - // keyword is the last content on the line, it means we need to check for - // the multi-line format, so we do not include the class names - // from the extends/implements list in the following check. - // Note that classes can only extend one other class, so they can't use a - // multi-line extends format, whereas an interface can extend multiple - // other interfaces, and so uses a multi-line extends format. - if ($tokens[$stackPtr]['code'] === T_INTERFACE) { - $keywordTokenType = T_EXTENDS; - } else { - $keywordTokenType = T_IMPLEMENTS; - } - - $implements = $phpcsFile->findNext($keywordTokenType, ($stackPtr + 1), $openingBrace); - $multiLineImplements = false; - if ($implements !== false) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($openingBrace - 1), $implements, true); - if ($tokens[$prev]['line'] !== $tokens[$implements]['line']) { - $multiLineImplements = true; - } - } - - $find = [ - T_STRING, - $keywordTokenType, - ]; - - if ($className !== null) { - $start = $className; - } else if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $start = $tokens[$stackPtr]['parenthesis_closer']; - } else { - $start = $stackPtr; - } - - $classNames = []; - $nextClass = $phpcsFile->findNext($find, ($start + 2), ($openingBrace - 1)); - while ($nextClass !== false) { - $classNames[] = $nextClass; - $nextClass = $phpcsFile->findNext($find, ($nextClass + 1), ($openingBrace - 1)); - } - - $classCount = count($classNames); - $checkingImplements = false; - $implementsToken = null; - foreach ($classNames as $n => $className) { - if ($tokens[$className]['code'] === $keywordTokenType) { - $checkingImplements = true; - $implementsToken = $className; - - continue; - } - - if ($checkingImplements === true - && $multiLineImplements === true - && ($tokens[($className - 1)]['code'] !== T_NS_SEPARATOR - || ($tokens[($className - 2)]['code'] !== T_STRING - && $tokens[($className - 2)]['code'] !== T_NAMESPACE)) - ) { - $prev = $phpcsFile->findPrevious( - [ - T_NS_SEPARATOR, - T_WHITESPACE, - ], - ($className - 1), - $implements, - true - ); - - if ($prev === $implementsToken && $tokens[$className]['line'] !== ($tokens[$prev]['line'] + 1)) { - if ($keywordTokenType === T_EXTENDS) { - $error = 'The first item in a multi-line extends list must be on the line following the extends keyword'; - $fix = $phpcsFile->addFixableError($error, $className, 'FirstExtendsInterfaceSameLine'); - } else { - $error = 'The first item in a multi-line implements list must be on the line following the implements keyword'; - $fix = $phpcsFile->addFixableError($error, $className, 'FirstInterfaceSameLine'); - } - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $className; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->endChangeset(); - } - } else if ((isset(Tokens::$commentTokens[$tokens[$prev]['code']]) === false - && $tokens[$prev]['line'] !== ($tokens[$className]['line'] - 1)) - || $tokens[$prev]['line'] === $tokens[$className]['line'] - ) { - if ($keywordTokenType === T_EXTENDS) { - $error = 'Only one interface may be specified per line in a multi-line extends declaration'; - $fix = $phpcsFile->addFixableError($error, $className, 'ExtendsInterfaceSameLine'); - } else { - $error = 'Only one interface may be specified per line in a multi-line implements declaration'; - $fix = $phpcsFile->addFixableError($error, $className, 'InterfaceSameLine'); - } - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $className; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->endChangeset(); - } - } else { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($className - 1), $implements); - if ($tokens[$prev]['line'] !== $tokens[$className]['line']) { - $found = 0; - } else { - $found = $tokens[$prev]['length']; - } - - $expected = ($classIndent + $this->indent); - if ($found !== $expected) { - $error = 'Expected %s spaces before interface name; %s found'; - $data = [ - $expected, - $found, - ]; - $fix = $phpcsFile->addFixableError($error, $className, 'InterfaceWrongIndent', $data); - if ($fix === true) { - $padding = str_repeat(' ', $expected); - if ($found === 0) { - $phpcsFile->fixer->addContent($prev, $padding); - } else { - $phpcsFile->fixer->replaceToken($prev, $padding); - } - } - } - }//end if - } else if ($tokens[($className - 1)]['code'] !== T_NS_SEPARATOR - || ($tokens[($className - 2)]['code'] !== T_STRING - && $tokens[($className - 2)]['code'] !== T_NAMESPACE) - ) { - // Not part of a longer fully qualified or namespace relative class name. - if ($tokens[($className - 1)]['code'] === T_COMMA - || ($tokens[($className - 1)]['code'] === T_NS_SEPARATOR - && $tokens[($className - 2)]['code'] === T_COMMA) - ) { - $error = 'Expected 1 space before "%s"; 0 found'; - $data = [$tokens[$className]['content']]; - $fix = $phpcsFile->addFixableError($error, ($nextComma + 1), 'NoSpaceBeforeName', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore(($nextComma + 1), ' '); - } - } else { - if ($tokens[($className - 1)]['code'] === T_NS_SEPARATOR) { - $prev = ($className - 2); - } else { - $prev = ($className - 1); - } - - $last = $phpcsFile->findPrevious(T_WHITESPACE, $prev, null, true); - $content = $phpcsFile->getTokensAsString(($last + 1), ($prev - $last)); - if ($content !== ' ') { - $found = strlen($content); - - $error = 'Expected 1 space before "%s"; %s found'; - $data = [ - $tokens[$className]['content'], - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $className, 'SpaceBeforeName', $data); - if ($fix === true) { - if ($tokens[$prev]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($prev, ' '); - while ($tokens[--$prev]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($prev, ' '); - } - - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->addContent($prev, ' '); - } - } - }//end if - }//end if - }//end if - - if ($checkingImplements === true - && $tokens[($className + 1)]['code'] !== T_NS_SEPARATOR - && $tokens[($className + 1)]['code'] !== T_COMMA - ) { - if ($n !== ($classCount - 1)) { - // This is not the last class name, and the comma - // is not where we expect it to be. - if ($tokens[($className + 2)]['code'] !== $keywordTokenType) { - $error = 'Expected 0 spaces between "%s" and comma; %s found'; - $data = [ - $tokens[$className]['content'], - $tokens[($className + 1)]['length'], - ]; - - $fix = $phpcsFile->addFixableError($error, $className, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($className + 1), ''); - } - } - } - - $nextComma = $phpcsFile->findNext(T_COMMA, $className); - } else { - $nextComma = ($className + 1); - }//end if - }//end foreach - - }//end processOpen() - - - /** - * Processes the closing section of a class declaration. - * - * @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 processClose(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Check that the closing brace comes right after the code body. - $closeBrace = $tokens[$stackPtr]['scope_closer']; - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); - if ($prevContent !== $tokens[$stackPtr]['scope_opener'] - && $tokens[$prevContent]['line'] !== ($tokens[$closeBrace]['line'] - 1) - ) { - $error = 'The closing brace for the %s must go on the next line after the body'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'CloseBraceAfterBody', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - 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->addNewline($prevContent); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - if ($tokens[$stackPtr]['code'] !== T_ANON_CLASS) { - // Check the closing brace is on it's own line, but allow - // for comments like "//end class". - $ignoreTokens = Tokens::$phpcsCommentTokens; - $ignoreTokens[] = T_WHITESPACE; - $ignoreTokens[] = T_COMMENT; - $ignoreTokens[] = T_SEMICOLON; - $nextContent = $phpcsFile->findNext($ignoreTokens, ($closeBrace + 1), null, true); - if ($tokens[$nextContent]['line'] === $tokens[$closeBrace]['line']) { - $type = strtolower($tokens[$stackPtr]['content']); - $error = 'Closing %s brace must be on a line by itself'; - $data = [$type]; - $phpcsFile->addError($error, $closeBrace, 'CloseBraceSameLine', $data); - } - } - - }//end processClose() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php deleted file mode 100644 index 29d7023e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php +++ /dev/null @@ -1,226 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes; - -use Exception; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Tokens; - -class PropertyDeclarationSniff extends AbstractVariableSniff -{ - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['content'][1] === '_') { - $error = 'Property name "%s" should not be prefixed with an underscore to indicate visibility'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addWarning($error, $stackPtr, 'Underscore', $data); - } - - // Detect multiple properties defined at the same time. Throw an error - // for this, but also only process the first property in the list so we don't - // repeat errors. - $find = Tokens::$scopeModifiers; - $find[] = T_VARIABLE; - $find[] = T_VAR; - $find[] = T_READONLY; - $find[] = T_SEMICOLON; - $find[] = T_OPEN_CURLY_BRACKET; - - $prev = $phpcsFile->findPrevious($find, ($stackPtr - 1)); - if ($tokens[$prev]['code'] === T_VARIABLE) { - return; - } - - if ($tokens[$prev]['code'] === T_VAR) { - $error = 'The var keyword must not be used to declare a property'; - $phpcsFile->addError($error, $stackPtr, 'VarUsed'); - } - - $next = $phpcsFile->findNext([T_VARIABLE, T_SEMICOLON], ($stackPtr + 1)); - if ($next !== false && $tokens[$next]['code'] === T_VARIABLE) { - $error = 'There must not be more than one property declared per statement'; - $phpcsFile->addError($error, $stackPtr, 'Multiple'); - } - - try { - $propertyInfo = $phpcsFile->getMemberProperties($stackPtr); - if (empty($propertyInfo) === true) { - return; - } - } catch (Exception $e) { - // Turns out not to be a property after all. - return; - } - - if ($propertyInfo['type'] !== '') { - $typeToken = $propertyInfo['type_end_token']; - $error = 'There must be 1 space after the property type declaration; %s found'; - if ($tokens[($typeToken + 1)]['code'] !== T_WHITESPACE) { - $data = ['0']; - $fix = $phpcsFile->addFixableError($error, $typeToken, 'SpacingAfterType', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($typeToken, ' '); - } - } else if ($tokens[($typeToken + 1)]['content'] !== ' ') { - $next = $phpcsFile->findNext(T_WHITESPACE, ($typeToken + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$typeToken]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($typeToken + 1)]['length']; - } - - $data = [$found]; - - $nextNonWs = $phpcsFile->findNext(Tokens::$emptyTokens, ($typeToken + 1), null, true); - if ($nextNonWs !== $next) { - $phpcsFile->addError($error, $typeToken, 'SpacingAfterType', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $typeToken, 'SpacingAfterType', $data); - if ($fix === true) { - if ($found === 'newline') { - $phpcsFile->fixer->beginChangeset(); - for ($x = ($typeToken + 1); $x < $next; $x++) { - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addContent($typeToken, ' '); - $phpcsFile->fixer->endChangeset(); - } else { - $phpcsFile->fixer->replaceToken(($typeToken + 1), ' '); - } - } - } - }//end if - }//end if - - if ($propertyInfo['scope_specified'] === false) { - $error = 'Visibility must be declared on property "%s"'; - $data = [$tokens[$stackPtr]['content']]; - $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) { - $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; - } - - $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($readonlyPtr, $propertyInfo['scope'].' '); - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end processMemberVar() - - - /** - * Processes normal variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariable() - - - /** - * Processes variables in double quoted strings. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariableInString() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php deleted file mode 100644 index d855dbd6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php +++ /dev/null @@ -1,141 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ControlStructureSpacingSniff implements Sniff -{ - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_WHILE, - T_FOREACH, - T_FOR, - T_SWITCH, - T_ELSEIF, - T_CATCH, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - ) { - return; - } - - $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; - $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($parenOpener + 1), null, true); - if (in_array($tokens[$nextContent]['code'], Tokens::$commentTokens, true) === false) { - $spaceAfterOpen = 0; - if ($tokens[($parenOpener + 1)]['code'] === T_WHITESPACE) { - if (strpos($tokens[($parenOpener + 1)]['content'], $phpcsFile->eolChar) !== false) { - $spaceAfterOpen = 'newline'; - } else { - $spaceAfterOpen = $tokens[($parenOpener + 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', $spaceAfterOpen); - - if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { - $error = 'Expected %s spaces after opening bracket; %s found'; - $data = [ - $this->requiredSpacesAfterOpen, - $spaceAfterOpen, - ]; - $fix = $phpcsFile->addFixableError($error, ($parenOpener + 1), 'SpacingAfterOpenBrace', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); - if ($spaceAfterOpen === 0) { - $phpcsFile->fixer->addContent($parenOpener, $padding); - } else if ($spaceAfterOpen === 'newline') { - $phpcsFile->fixer->replaceToken(($parenOpener + 1), ''); - } else { - $phpcsFile->fixer->replaceToken(($parenOpener + 1), $padding); - } - } - } - }//end if - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($parenCloser - 1), $parenOpener, true); - if ($tokens[$prev]['line'] === $tokens[$parenCloser]['line']) { - $spaceBeforeClose = 0; - if ($tokens[($parenCloser - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = strlen(ltrim($tokens[($parenCloser - 1)]['content'], $phpcsFile->eolChar)); - } - - $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', $spaceBeforeClose); - - if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) { - $error = 'Expected %s spaces before closing bracket; %s found'; - $data = [ - $this->requiredSpacesBeforeClose, - $spaceBeforeClose, - ]; - $fix = $phpcsFile->addFixableError($error, ($parenCloser - 1), 'SpaceBeforeCloseBrace', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); - if ($spaceBeforeClose === 0) { - $phpcsFile->fixer->addContentBefore($parenCloser, $padding); - } else { - $phpcsFile->fixer->replaceToken(($parenCloser - 1), $padding); - } - } - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php deleted file mode 100644 index 7f5e97c1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ElseIfDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_ELSE, - T_ELSEIF, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if ($tokens[$stackPtr]['code'] === T_ELSEIF) { - $phpcsFile->recordMetric($stackPtr, 'Use of ELSE IF or ELSEIF', 'elseif'); - return; - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_IF) { - $phpcsFile->recordMetric($stackPtr, 'Use of ELSE IF or ELSEIF', 'else if'); - $error = 'Usage of ELSE IF is discouraged; use ELSEIF instead'; - $fix = $phpcsFile->addFixableWarning($error, $stackPtr, 'NotAllowed'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($stackPtr, 'elseif'); - for ($i = ($stackPtr + 1); $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php deleted file mode 100644 index 4b3b5ad2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php +++ /dev/null @@ -1,396 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SwitchDeclarationSniff implements Sniff -{ - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_SWITCH]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // We can't process SWITCH statements unless we know where they start and end. - if (isset($tokens[$stackPtr]['scope_opener']) === false - || isset($tokens[$stackPtr]['scope_closer']) === false - ) { - return; - } - - $switch = $tokens[$stackPtr]; - $nextCase = $stackPtr; - $caseAlignment = ($switch['column'] + $this->indent); - - while (($nextCase = $this->findNextCase($phpcsFile, ($nextCase + 1), $switch['scope_closer'])) !== false) { - if ($tokens[$nextCase]['code'] === T_DEFAULT) { - $type = 'default'; - } else { - $type = 'case'; - } - - if ($tokens[$nextCase]['content'] !== strtolower($tokens[$nextCase]['content'])) { - $expected = strtolower($tokens[$nextCase]['content']); - $error = strtoupper($type).' keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - $expected, - $tokens[$nextCase]['content'], - ]; - - $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'NotLower', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($nextCase, $expected); - } - } - - if ($type === 'case' - && ($tokens[($nextCase + 1)]['code'] !== T_WHITESPACE - || $tokens[($nextCase + 1)]['content'] !== ' ') - ) { - $error = 'CASE keyword must be followed by a single space'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpacingAfterCase'); - if ($fix === true) { - if ($tokens[($nextCase + 1)]['code'] !== T_WHITESPACE) { - $phpcsFile->fixer->addContent($nextCase, ' '); - } else { - $phpcsFile->fixer->replaceToken(($nextCase + 1), ' '); - } - } - } - - $opener = $tokens[$nextCase]['scope_opener']; - $nextCloser = $tokens[$nextCase]['scope_closer']; - if ($tokens[$opener]['code'] === T_COLON) { - if ($tokens[($opener - 1)]['code'] === T_WHITESPACE) { - $error = 'There must be no space before the colon in a '.strtoupper($type).' statement'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpaceBeforeColon'.strtoupper($type)); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($opener - 1), ''); - } - } - - for ($next = ($opener + 1); $next < $nextCloser; $next++) { - if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === false - || (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true - && $tokens[$next]['line'] !== $tokens[$opener]['line']) - ) { - break; - } - } - - if ($tokens[$next]['line'] !== ($tokens[$opener]['line'] + 1)) { - $error = 'The '.strtoupper($type).' body must start on the line following the statement'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'BodyOnNextLine'.strtoupper($type)); - if ($fix === true) { - if ($tokens[$next]['line'] === $tokens[$opener]['line']) { - $padding = str_repeat(' ', ($caseAlignment + $this->indent - 1)); - $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$padding); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($opener + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$opener]['line']) { - // Ignore trailing comments. - continue; - } - - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - if ($tokens[$nextCloser]['scope_condition'] === $nextCase) { - // Only need to check some things once, even if the - // closer is shared between multiple case statements, or even - // the default case. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($nextCloser - 1), $nextCase, true); - if ($tokens[$prev]['line'] === $tokens[$nextCloser]['line']) { - $error = 'Terminating statement must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $nextCloser, 'BreakNotNewLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewLine($prev); - $phpcsFile->fixer->replaceToken($nextCloser, trim($tokens[$nextCloser]['content'])); - } - } else { - $diff = ($tokens[$nextCase]['column'] + $this->indent - $tokens[$nextCloser]['column']); - if ($diff !== 0) { - $error = 'Terminating statement must be indented to the same level as the CASE body'; - $fix = $phpcsFile->addFixableError($error, $nextCloser, 'BreakIndent'); - if ($fix === true) { - if ($diff > 0) { - $phpcsFile->fixer->addContentBefore($nextCloser, str_repeat(' ', $diff)); - } else { - $phpcsFile->fixer->substrToken(($nextCloser - 1), 0, $diff); - } - } - } - }//end if - }//end if - } else { - $error = strtoupper($type).' statements must be defined using a colon'; - $phpcsFile->addError($error, $nextCase, 'WrongOpener'.$type); - }//end if - - // We only want cases from here on in. - if ($type !== 'case') { - continue; - } - - $nextCode = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), $nextCloser, true); - - if ($tokens[$nextCode]['code'] !== T_CASE && $tokens[$nextCode]['code'] !== T_DEFAULT) { - // This case statement has content. If the next case or default comes - // before the closer, it means we don't have an obvious terminating - // statement and need to make some more effort to find one. If we - // don't, we do need a comment. - $nextCode = $this->findNextCase($phpcsFile, ($opener + 1), $nextCloser); - if ($nextCode !== false) { - $prevCode = $phpcsFile->findPrevious(T_WHITESPACE, ($nextCode - 1), $nextCase, true); - if (isset(Tokens::$commentTokens[$tokens[$prevCode]['code']]) === false - && $this->findNestedTerminator($phpcsFile, ($opener + 1), $nextCode) === false - ) { - $error = 'There must be a comment when fall-through is intentional in a non-empty case body'; - $phpcsFile->addError($error, $nextCase, 'TerminatingComment'); - } - } - } - }//end while - - }//end process() - - - /** - * Find the next CASE or DEFAULT statement from a point in the file. - * - * Note that nested switches are ignored. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position to start looking at. - * @param int $end The position to stop looking at. - * - * @return int|false - */ - private function findNextCase($phpcsFile, $stackPtr, $end) - { - $tokens = $phpcsFile->getTokens(); - while (($stackPtr = $phpcsFile->findNext([T_CASE, T_DEFAULT, T_SWITCH], $stackPtr, $end)) !== false) { - // Skip nested SWITCH statements; they are handled on their own. - if ($tokens[$stackPtr]['code'] === T_SWITCH) { - $stackPtr = $tokens[$stackPtr]['scope_closer']; - continue; - } - - break; - } - - return $stackPtr; - - }//end findNextCase() - - - /** - * Returns the position of the nested terminating statement. - * - * Returns false if no terminating statement was found. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position to start looking at. - * @param int $end The position to stop looking at. - * - * @return int|bool - */ - private function findNestedTerminator($phpcsFile, $stackPtr, $end) - { - $tokens = $phpcsFile->getTokens(); - - $lastToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($end - 1), $stackPtr, true); - if ($lastToken === false) { - return false; - } - - if ($tokens[$lastToken]['code'] === T_CLOSE_CURLY_BRACKET) { - // We found a closing curly bracket and want to check if its block - // belongs to a SWITCH, IF, ELSEIF or ELSE, TRY, CATCH OR FINALLY clause. - // If yes, we continue searching for a terminating statement within that - // block. Note that we have to make sure that every block of - // the entire if/else/switch statement has a terminating statement. - // For a try/catch/finally statement, either the finally block has - // to have a terminating statement or every try/catch block has to have one. - $currentCloser = $lastToken; - $hasElseBlock = false; - $hasCatchWithoutTerminator = false; - do { - $scopeOpener = $tokens[$currentCloser]['scope_opener']; - $scopeCloser = $tokens[$currentCloser]['scope_closer']; - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($scopeOpener - 1), $stackPtr, true); - if ($prevToken === false) { - return false; - } - - // SWITCH, IF, ELSEIF, CATCH clauses possess a condition we have to account for. - if ($tokens[$prevToken]['code'] === T_CLOSE_PARENTHESIS) { - $prevToken = $tokens[$prevToken]['parenthesis_owner']; - } - - if ($tokens[$prevToken]['code'] === T_IF) { - // If we have not encountered an ELSE clause by now, we cannot - // be sure that the whole statement terminates in every case. - if ($hasElseBlock === false) { - return false; - } - - return $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - } else if ($tokens[$prevToken]['code'] === T_ELSEIF - || $tokens[$prevToken]['code'] === T_ELSE - ) { - // If we find a terminating statement within this block, - // we continue with the previous ELSEIF or IF clause. - $hasTerminator = $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - if ($hasTerminator === false) { - return false; - } - - $currentCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), $stackPtr, true); - if ($tokens[$prevToken]['code'] === T_ELSE) { - $hasElseBlock = true; - } - } else if ($tokens[$prevToken]['code'] === T_FINALLY) { - // If we find a terminating statement within this block, - // the whole try/catch/finally statement is covered. - $hasTerminator = $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - if ($hasTerminator !== false) { - return $hasTerminator; - } - - // Otherwise, we continue with the previous TRY or CATCH clause. - $currentCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), $stackPtr, true); - } else if ($tokens[$prevToken]['code'] === T_TRY) { - // If we've seen CATCH blocks without terminator statement and - // have not seen a FINALLY *with* a terminator statement, we - // don't even need to bother checking the TRY. - if ($hasCatchWithoutTerminator === true) { - return false; - } - - return $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - } else if ($tokens[$prevToken]['code'] === T_CATCH) { - // Keep track of seen catch statements without terminating statement, - // but don't bow out yet as there may still be a FINALLY clause - // with a terminating statement before the CATCH. - $hasTerminator = $this->findNestedTerminator($phpcsFile, ($scopeOpener + 1), $scopeCloser); - if ($hasTerminator === false) { - $hasCatchWithoutTerminator = true; - } - - $currentCloser = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), $stackPtr, true); - } else if ($tokens[$prevToken]['code'] === T_SWITCH) { - $hasDefaultBlock = false; - $endOfSwitch = $tokens[$prevToken]['scope_closer']; - $nextCase = $prevToken; - - // We look for a terminating statement within every blocks. - while (($nextCase = $this->findNextCase($phpcsFile, ($nextCase + 1), $endOfSwitch)) !== false) { - if ($tokens[$nextCase]['code'] === T_DEFAULT) { - $hasDefaultBlock = true; - } - - $opener = $tokens[$nextCase]['scope_opener']; - - $nextCode = $phpcsFile->findNext(Tokens::$emptyTokens, ($opener + 1), $endOfSwitch, true); - if ($tokens[$nextCode]['code'] === T_CASE || $tokens[$nextCode]['code'] === T_DEFAULT) { - // This case statement has no content, so skip it. - continue; - } - - $endOfCase = $this->findNextCase($phpcsFile, ($opener + 1), $endOfSwitch); - if ($endOfCase === false) { - $endOfCase = $endOfSwitch; - } - - $hasTerminator = $this->findNestedTerminator($phpcsFile, ($opener + 1), $endOfCase); - if ($hasTerminator === false) { - return false; - } - }//end while - - // If we have not encountered a DEFAULT block by now, we cannot - // be sure that the whole statement terminates in every case. - if ($hasDefaultBlock === false) { - return false; - } - - return $hasTerminator; - } else { - return false; - }//end if - } while ($currentCloser !== false && $tokens[$currentCloser]['code'] === T_CLOSE_CURLY_BRACKET); - - return true; - } else if ($tokens[$lastToken]['code'] === T_SEMICOLON) { - // We found the last statement of the CASE. Now we want to - // check whether it is a terminating one. - $terminators = [ - T_RETURN => T_RETURN, - T_BREAK => T_BREAK, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - T_EXIT => T_EXIT, - ]; - - $terminator = $phpcsFile->findStartOfStatement(($lastToken - 1)); - if (isset($terminators[$tokens[$terminator]['code']]) === true) { - return $terminator; - } - }//end if - - return false; - - }//end findNestedTerminator() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php deleted file mode 100644 index 1cb63744..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php +++ /dev/null @@ -1,89 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClosingTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Make sure this file only contains PHP code. - for ($i = 0; $i < $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['code'] === T_INLINE_HTML - && trim($tokens[$i]['content']) !== '' - ) { - return $phpcsFile->numTokens; - } - } - - // Find the last non-empty token. - for ($last = ($phpcsFile->numTokens - 1); $last > 0; $last--) { - if (trim($tokens[$last]['content']) !== '') { - break; - } - } - - if ($tokens[$last]['code'] === T_CLOSE_TAG) { - $error = 'A closing tag is not permitted at the end of a PHP file'; - $fix = $phpcsFile->addFixableError($error, $last, 'NotAllowed'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($last, $phpcsFile->eolChar); - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($last - 1), null, true); - if ($tokens[$prev]['code'] !== T_SEMICOLON - && $tokens[$prev]['code'] !== T_CLOSE_CURLY_BRACKET - && $tokens[$prev]['code'] !== T_OPEN_TAG - ) { - $phpcsFile->fixer->addContent($prev, ';'); - } - - $phpcsFile->fixer->endChangeset(); - } - - $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at end of PHP-only file', 'yes'); - } else { - $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at end of PHP-only file', 'no'); - }//end if - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php deleted file mode 100644 index 5b2d2817..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php +++ /dev/null @@ -1,107 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class EndFileNewlineSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($phpcsFile->findNext(T_INLINE_HTML, ($stackPtr + 1)) !== false) { - return $phpcsFile->numTokens; - } - - // Skip to the end of the file. - $tokens = $phpcsFile->getTokens(); - $lastToken = ($phpcsFile->numTokens - 1); - - if ($tokens[$lastToken]['content'] === '') { - $lastToken--; - } - - // Hard-coding the expected \n in this sniff as it is PSR-2 specific and - // PSR-2 enforces the use of unix style newlines. - if (substr($tokens[$lastToken]['content'], -1) !== "\n") { - $error = 'Expected 1 newline at end of file; 0 found'; - $fix = $phpcsFile->addFixableError($error, $lastToken, 'NoneFound'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($lastToken); - } - - $phpcsFile->recordMetric($stackPtr, 'Number of newlines at EOF', '0'); - return $phpcsFile->numTokens; - } - - // Go looking for the last non-empty line. - $lastLine = $tokens[$lastToken]['line']; - if ($tokens[$lastToken]['code'] === T_WHITESPACE - || $tokens[$lastToken]['code'] === T_DOC_COMMENT_WHITESPACE - ) { - $lastCode = $phpcsFile->findPrevious([T_WHITESPACE, T_DOC_COMMENT_WHITESPACE], ($lastToken - 1), null, true); - } else { - $lastCode = $lastToken; - } - - $lastCodeLine = $tokens[$lastCode]['line']; - $blankLines = ($lastLine - $lastCodeLine + 1); - $phpcsFile->recordMetric($stackPtr, 'Number of newlines at EOF', $blankLines); - - if ($blankLines > 1) { - $error = 'Expected 1 blank line at end of file; %s found'; - $data = [$blankLines]; - $fix = $phpcsFile->addFixableError($error, $lastCode, 'TooMany', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($lastCode, rtrim($tokens[$lastCode]['content'])); - for ($i = ($lastCode + 1); $i < $lastToken; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken($lastToken, $phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - } - - // Skip the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php deleted file mode 100644 index cee18cac..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff as PEARFunctionCallSignatureSniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionCallSignatureSniff extends PEARFunctionCallSignatureSniff -{ - - /** - * If TRUE, multiple arguments can be defined per line in a multi-line call. - * - * @var boolean - */ - public $allowMultipleArguments = false; - - - /** - * Processes single-line calls. - * - * @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 $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return bool - */ - public function isMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $tokens) - { - // If the first argument is on a new line, this is a multi-line - // function call, even if there is only one argument. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - return true; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - $end = $phpcsFile->findEndOfStatement(($openBracket + 1), [T_COLON]); - while ($tokens[$end]['code'] === T_COMMA) { - // If the next bit of code is not on the same line, this is a - // multi-line function call. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); - if ($next === false) { - return false; - } - - if ($tokens[$next]['line'] !== $tokens[$end]['line']) { - return true; - } - - $end = $phpcsFile->findEndOfStatement($next, [T_COLON]); - } - - // We've reached the last argument, so see if the next content - // (should be the close bracket) is also on the same line. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); - if ($next !== false && $tokens[$next]['line'] !== $tokens[$end]['line']) { - return true; - } - - return false; - - }//end isMultiLineCall() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php deleted file mode 100644 index c4f1a6f4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FunctionClosingBraceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - // Probably an interface method. - return; - } - - $closeBrace = $tokens[$stackPtr]['scope_closer']; - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); - $found = ($tokens[$closeBrace]['line'] - $tokens[$prevContent]['line'] - 1); - - if ($found < 0) { - // Brace isn't on a new line, so not handled by us. - return; - } - - if ($found === 0) { - // All is good. - return; - } - - $error = 'Function closing brace must go on the next line following the body; found %s blank lines before brace'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeClose', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prevContent + 1); $i < $closeBrace; $i++) { - if ($tokens[$i]['line'] === $tokens[$prevContent]['line']) { - continue; - } - - // Don't remove any indentation before the brace. - if ($tokens[$i]['line'] === $tokens[$closeBrace]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php deleted file mode 100644 index 6500d046..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php +++ /dev/null @@ -1,162 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Tokens; - -class MethodDeclarationSniff extends AbstractScopeSniff -{ - - - /** - * Constructs a Squiz_Sniffs_Scope_MethodScopeSniff. - */ - public function __construct() - { - parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION]); - - }//end __construct() - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * @param int $currScope The current scope opener token. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - if ($methodName[0] === '_' && isset($methodName[1]) === true && $methodName[1] !== '_') { - $error = 'Method name "%s" should not be prefixed with an underscore to indicate visibility'; - $data = [$methodName]; - $phpcsFile->addWarning($error, $stackPtr, 'Underscore', $data); - } - - $visibility = 0; - $static = 0; - $abstract = 0; - $final = 0; - - $find = (Tokens::$methodPrefixes + Tokens::$emptyTokens); - $prev = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); - - $prefix = $stackPtr; - while (($prefix = $phpcsFile->findPrevious(Tokens::$methodPrefixes, ($prefix - 1), $prev)) !== false) { - switch ($tokens[$prefix]['code']) { - case T_STATIC: - $static = $prefix; - break; - case T_ABSTRACT: - $abstract = $prefix; - break; - case T_FINAL: - $final = $prefix; - break; - default: - $visibility = $prefix; - break; - } - } - - $fixes = []; - - if ($visibility !== 0 && $final > $visibility) { - $error = 'The final declaration must precede the visibility declaration'; - $fix = $phpcsFile->addFixableError($error, $final, 'FinalAfterVisibility'); - if ($fix === true) { - $fixes[$final] = ''; - $fixes[($final + 1)] = ''; - if (isset($fixes[$visibility]) === true) { - $fixes[$visibility] = 'final '.$fixes[$visibility]; - } else { - $fixes[$visibility] = 'final '.$tokens[$visibility]['content']; - } - } - } - - if ($visibility !== 0 && $abstract > $visibility) { - $error = 'The abstract declaration must precede the visibility declaration'; - $fix = $phpcsFile->addFixableError($error, $abstract, 'AbstractAfterVisibility'); - if ($fix === true) { - $fixes[$abstract] = ''; - $fixes[($abstract + 1)] = ''; - if (isset($fixes[$visibility]) === true) { - $fixes[$visibility] = 'abstract '.$fixes[$visibility]; - } else { - $fixes[$visibility] = 'abstract '.$tokens[$visibility]['content']; - } - } - } - - if ($static !== 0 && $static < $visibility) { - $error = 'The static declaration must come after the visibility declaration'; - $fix = $phpcsFile->addFixableError($error, $static, 'StaticBeforeVisibility'); - if ($fix === true) { - $fixes[$static] = ''; - $fixes[($static + 1)] = ''; - if (isset($fixes[$visibility]) === true) { - $fixes[$visibility] .= ' static'; - } else { - $fixes[$visibility] = $tokens[$visibility]['content'].' static'; - } - } - } - - // Batch all the fixes together to reduce the possibility of conflicts. - if (empty($fixes) === false) { - $phpcsFile->fixer->beginChangeset(); - foreach ($fixes as $stackPtr => $content) { - $phpcsFile->fixer->replaceToken($stackPtr, $content); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end processTokenWithinScope() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php deleted file mode 100644 index 7b1dad19..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php +++ /dev/null @@ -1,100 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class NamespaceDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_NAMESPACE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$nextNonEmpty]['code'] === T_NS_SEPARATOR) { - // Namespace keyword as operator. Not a declaration. - return; - } - - $end = $phpcsFile->findEndOfStatement($stackPtr); - for ($i = ($end + 1); $i < ($phpcsFile->numTokens - 1); $i++) { - if ($tokens[$i]['line'] === $tokens[$end]['line']) { - continue; - } - - break; - } - - // The $i var now points to the first token on the line after the - // namespace declaration, which must be a blank line. - $next = $phpcsFile->findNext(T_WHITESPACE, $i, $phpcsFile->numTokens, true); - if ($next === false) { - return; - } - - $diff = ($tokens[$next]['line'] - $tokens[$i]['line']); - if ($diff === 1) { - return; - } - - if ($diff < 0) { - $diff = 0; - } - - $error = 'There must be one blank line after the namespace declaration'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'BlankLineAfter'); - - if ($fix === true) { - if ($diff === 0) { - $phpcsFile->fixer->addNewlineBefore($i); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($x = $i; $x < $next; $x++) { - if ($tokens[$x]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($x, ''); - } - - $phpcsFile->fixer->addNewline($i); - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php deleted file mode 100644 index 39c69c8b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php +++ /dev/null @@ -1,297 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class UseDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_USE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - if ($this->shouldIgnoreUse($phpcsFile, $stackPtr) === true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - // One space after the use keyword. - if ($tokens[($stackPtr + 1)]['content'] !== ' ') { - $error = 'There must be a single space after the USE keyword'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterUse'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - - // Only one USE declaration allowed per statement. - $next = $phpcsFile->findNext([T_COMMA, T_SEMICOLON, T_OPEN_USE_GROUP, T_CLOSE_TAG], ($stackPtr + 1)); - if ($next !== false - && $tokens[$next]['code'] !== T_SEMICOLON - && $tokens[$next]['code'] !== T_CLOSE_TAG - ) { - $error = 'There must be one USE keyword per declaration'; - - if ($tokens[$next]['code'] === T_COMMA) { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MultipleDeclarations'); - if ($fix === true) { - switch ($tokens[($stackPtr + 2)]['content']) { - case 'const': - $baseUse = 'use const'; - break; - case 'function': - $baseUse = 'use function'; - break; - default: - $baseUse = 'use'; - } - - if ($tokens[($next + 1)]['code'] !== T_WHITESPACE) { - $baseUse .= ' '; - } - - $phpcsFile->fixer->replaceToken($next, ';'.$phpcsFile->eolChar.$baseUse); - } - } else { - $closingCurly = $phpcsFile->findNext(T_CLOSE_USE_GROUP, ($next + 1)); - if ($closingCurly === false) { - // Parse error or live coding. Not auto-fixable. - $phpcsFile->addError($error, $stackPtr, 'MultipleDeclarations'); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MultipleDeclarations'); - if ($fix === true) { - $baseUse = rtrim($phpcsFile->getTokensAsString($stackPtr, ($next - $stackPtr))); - $lastNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingCurly - 1), null, true); - - $phpcsFile->fixer->beginChangeset(); - - // Remove base use statement. - for ($i = $stackPtr; $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - if (preg_match('`^[\r\n]+$`', $tokens[($next + 1)]['content']) === 1) { - $phpcsFile->fixer->replaceToken(($next + 1), ''); - } - - // Convert grouped use statements into full use statements. - do { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), $closingCurly, true); - if ($next === false) { - // Group use statement with trailing comma after last item. - break; - } - - $nonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($next - 1), null, true); - for ($i = ($nonWhitespace + 1); $i < $next; $i++) { - if (preg_match('`^[\r\n]+$`', $tokens[$i]['content']) === 1) { - // Preserve new lines. - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - if ($tokens[$next]['content'] === 'const' || $tokens[$next]['content'] === 'function') { - $phpcsFile->fixer->addContentBefore($next, 'use '); - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), $closingCurly, true); - $phpcsFile->fixer->addContentBefore($next, str_replace('use ', '', $baseUse)); - } else { - $phpcsFile->fixer->addContentBefore($next, $baseUse); - } - - $next = $phpcsFile->findNext(T_COMMA, ($next + 1), $closingCurly); - if ($next !== false) { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($next + 1), $closingCurly, true); - if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['line'] === $tokens[$next]['line']) { - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($nextNonEmpty - 1), $next, true); - if ($prevNonWhitespace === $next) { - $phpcsFile->fixer->replaceToken($next, ';'.$phpcsFile->eolChar); - } else { - $phpcsFile->fixer->replaceToken($next, ';'); - $phpcsFile->fixer->addNewline($prevNonWhitespace); - } - } else { - // Last item with trailing comma or next item already on new line. - $phpcsFile->fixer->replaceToken($next, ';'); - } - } else { - // Last item without trailing comma. - $phpcsFile->fixer->addContent($lastNonWhitespace, ';'); - } - } while ($next !== false); - - // Remove closing curly, semicolon and any whitespace between last child and closing curly. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($closingCurly + 1), null, true); - if ($next === false || $tokens[$next]['code'] !== T_SEMICOLON) { - // Parse error, forgotten semicolon. - $next = $closingCurly; - } - - for ($i = ($lastNonWhitespace + 1); $i <= $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - }//end if - }//end if - - // Make sure this USE comes after the first namespace declaration. - $prev = $phpcsFile->findPrevious(T_NAMESPACE, ($stackPtr - 1)); - if ($prev === false) { - $next = $phpcsFile->findNext(T_NAMESPACE, ($stackPtr + 1)); - if ($next !== false) { - $error = 'USE declarations must go after the namespace declaration'; - $phpcsFile->addError($error, $stackPtr, 'UseBeforeNamespace'); - } - } - - // Only interested in the last USE statement from here onwards. - $nextUse = $phpcsFile->findNext(T_USE, ($stackPtr + 1)); - while ($this->shouldIgnoreUse($phpcsFile, $nextUse) === true) { - $nextUse = $phpcsFile->findNext(T_USE, ($nextUse + 1)); - if ($nextUse === false) { - break; - } - } - - if ($nextUse !== false) { - return; - } - - $end = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_USE_GROUP, T_CLOSE_TAG], ($stackPtr + 1)); - if ($end === false) { - return; - } - - if ($tokens[$end]['code'] === T_CLOSE_USE_GROUP) { - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), null, true); - if ($tokens[$nextNonEmpty]['code'] === T_SEMICOLON) { - $end = $nextNonEmpty; - } - } - - // Find either the start of the next line or the beginning of the next statement, - // whichever comes first. - for ($end = ++$end; $end < $phpcsFile->numTokens; $end++) { - if (isset(Tokens::$emptyTokens[$tokens[$end]['code']]) === false) { - break; - } - - if ($tokens[$end]['column'] === 1) { - // Reached the next line. - break; - } - } - - --$end; - - if (($tokens[$end]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$end]['code']]) === true) - && substr($tokens[$end]['content'], 0, 2) === '/*' - && substr($tokens[$end]['content'], -2) !== '*/' - ) { - // Multi-line block comments are not allowed as trailing comment after a use statement. - --$end; - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($end + 1), null, true); - - if ($next === false || $tokens[$next]['code'] === T_CLOSE_TAG) { - return; - } - - $diff = ($tokens[$next]['line'] - $tokens[$end]['line'] - 1); - if ($diff !== 1) { - if ($diff < 0) { - $diff = 0; - } - - $error = 'There must be one blank line after the last USE statement; %s found;'; - $data = [$diff]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterLastUse', $data); - if ($fix === true) { - if ($diff === 0) { - $phpcsFile->fixer->addNewline($end); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($end + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewline($end); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end process() - - - /** - * Check if this use statement is part of the namespace block. - * - * @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 bool - */ - private function shouldIgnoreUse($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Ignore USE keywords inside closures and during live coding. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next === false || $tokens[$next]['code'] === T_OPEN_PARENTHESIS) { - return true; - } - - // Ignore USE keywords for traits. - if ($phpcsFile->hasCondition($stackPtr, [T_CLASS, T_TRAIT, T_ENUM]) === true) { - return true; - } - - return false; - - }//end shouldIgnoreUse() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc deleted file mode 100644 index 1df40d51..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/ClassDeclarationUnitTest.inc +++ /dev/null @@ -1,346 +0,0 @@ -anonymous = new class extends ArrayObject - { - public function __construct() - { - parent::__construct(['a' => 1, 'b' => 2]); - } - }; - } -} - -class A extends B - implements C -{ -} - -class C2 -{ - -} // phpcs:ignore Standard.Category.Sniff - -interface I1 extends - Foo -{ -} - -interface I2 extends - Bar -{ -} - -interface I3 extends - Foo, - Bar -{ -} - -class C1 extends - Foo -{ -} - -class C2 extends - Bar -{ -} - -class C3 extends Foo implements - Bar -{ -} - -class C4 extends Foo implements - Bar -{ -} - -class C5 extends Foo implements - Bar, - Baz -{ -} - -class C6 extends \Foo\Bar implements - \Baz\Bar -{ -} - -interface I4 extends - \Baz - \Bar -{ -} - -interface I5 extends /* comment */ - \Foo\Bar -{ -} - -interface I6 extends // comment - \Foo\Bar -{ -} - -class C7 extends // comment - \Foo\Bar implements \Baz\Bar -{ -} - -class -C8 -{ -} - -foo(new class { -}); - -readonly -class Test -{ -} - -readonly class Test -{ -} - -if (!class_exists('IndentedDeclaration')) { - class IndentedDeclaration - { - function foo() {} - - - } -} - -// Space between modifier and class keyword would not be flagged nor fixed if newline + indentation. -final - class FinalClassWithIndentation - { - } - -readonly - class ReadonlyClassWithIndentation - { - } - -// And would also not be flagged if there was a comment between (not auto-fixable). -final/*comment*/class FinalClassWithComment -{ -} -abstract /*comment*/ class AbstractClassWithComment -{ -} - -readonly - // comment - class ReadonlyClassWithComment - { - } - -// Safeguard against fixer conflict when there are namespace relative interface names in extends. -interface FooBar extends namespace\BarFoo -{ -} - -// Safeguard against fixer conflict when there are namespace relative interface names in a multi-line implements. -class BarFoo implements - namespace\BarFoo -{ -} - -// Safeguard that the sniff ignores comments between interface names in a multiline implements. -class ClassWithMultiLineImplementsAndIgnoreAnnotation implements - SomeInterface, - // phpcs:disable Stnd.Cat.Sniff -- For reasons. - - \AnotherInterface -{ -} - -class ClassWithMultiLineImplementsAndComment implements - SomeInterface, - // Comment. - -AnotherInterface -{ -} - -class ClassWithMultiLineImplementsAndCommentOnSameLineAsInterfaceName implements - SomeInterface, - /* Comment. */ AnotherInterface -{ -} - -// Verify the `CloseBraceSameLine` error code is thrown when expected. -class ClassBraceNotOnLineByItselfError -{ - public $prop; -} $foo = new ClassBraceNotOnLineByItselfError; - -interface ClassBraceNotOnLineByItselfTrailingCommentIsAllowed -{ - public function myMethod(); -} //end interface -- this comment is allowed. - -trait ClassBraceNotOnLineByItselfTrailingAnnotationIsAllowed -{ -} // phpcs:ignore Stnd.Cat.Sniff -- this comment is also allowed. - -// Issue squizlabs/PHP_CodeSniffer#2621 - fix was superseded by fix for #2678. -$foo->bar( - new class implements Bar { - // ... - }, -); - -enum BraceNotOnLineByItselfCloseTagError -{ -} ?> - -anonymous = new class extends ArrayObject - { - public function __construct() - { - parent::__construct(['a' => 1, 'b' => 2]); - } - }; - } -} - -class A extends B implements C -{ -} - -class C2 -{ - -} // phpcs:ignore Standard.Category.Sniff - -interface I1 extends - Foo -{ -} - -interface I2 extends - Bar -{ -} - -interface I3 extends - Foo, - Bar -{ -} - -class C1 extends Foo -{ -} - -class C2 extends Bar -{ -} - -class C3 extends Foo implements - Bar -{ -} - -class C4 extends Foo implements - Bar -{ -} - -class C5 extends Foo implements - Bar, - Baz -{ -} - -class C6 extends \Foo\Bar implements - \Baz\Bar -{ -} - -interface I4 extends - \Baz\Bar -{ -} - -interface I5 extends /* comment */ - \Foo\Bar -{ -} - -interface I6 extends // comment - \Foo\Bar -{ -} - -class C7 extends \Foo\Bar implements \Baz\Bar // comment -{ -} - -class C8 -{ -} - -foo(new class { -}); - -readonly class Test -{ -} - -readonly class Test -{ -} - -if (!class_exists('IndentedDeclaration')) { - class IndentedDeclaration - { - function foo() {} - } -} - -// Space between modifier and class keyword would not be flagged nor fixed if newline + indentation. -final class FinalClassWithIndentation -{ - } - -readonly class ReadonlyClassWithIndentation -{ - } - -// And would also not be flagged if there was a comment between (not auto-fixable). -final/*comment*/class FinalClassWithComment -{ -} -abstract /*comment*/ class AbstractClassWithComment -{ -} - -readonly - // comment - class ReadonlyClassWithComment - { - } - -// Safeguard against fixer conflict when there are namespace relative interface names in extends. -interface FooBar extends namespace\BarFoo -{ -} - -// Safeguard against fixer conflict when there are namespace relative interface names in a multi-line implements. -class BarFoo implements - namespace\BarFoo -{ -} - -// Safeguard that the sniff ignores comments between interface names in a multiline implements. -class ClassWithMultiLineImplementsAndIgnoreAnnotation implements - SomeInterface, - // phpcs:disable Stnd.Cat.Sniff -- For reasons. - - \AnotherInterface -{ -} - -class ClassWithMultiLineImplementsAndComment implements - SomeInterface, - // Comment. - - AnotherInterface -{ -} - -class ClassWithMultiLineImplementsAndCommentOnSameLineAsInterfaceName implements - SomeInterface, - /* Comment. */ - AnotherInterface -{ -} - -// Verify the `CloseBraceSameLine` error code is thrown when expected. -class ClassBraceNotOnLineByItselfError -{ - public $prop; -} $foo = new ClassBraceNotOnLineByItselfError; - -interface ClassBraceNotOnLineByItselfTrailingCommentIsAllowed -{ - public function myMethod(); -} //end interface -- this comment is allowed. - -trait ClassBraceNotOnLineByItselfTrailingAnnotationIsAllowed -{ -} // phpcs:ignore Stnd.Cat.Sniff -- this comment is also allowed. - -// Issue squizlabs/PHP_CodeSniffer#2621 - fix was superseded by fix for #2678. -$foo->bar( - new class implements Bar { - // ... - }, -); - -enum BraceNotOnLineByItselfCloseTagError -{ -} ?> - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff - */ -final class ClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 7 => 3, - 12 => 1, - 13 => 1, - 17 => 1, - 19 => 2, - 20 => 1, - 21 => 1, - 22 => 1, - 25 => 1, - 27 => 2, - 34 => 1, - 35 => 2, - 44 => 1, - 45 => 1, - 63 => 1, - 95 => 1, - 116 => 1, - 118 => 1, - 119 => 1, - 124 => 1, - 130 => 2, - 131 => 1, - 158 => 1, - 168 => 1, - 178 => 1, - 179 => 1, - 184 => 1, - 189 => 1, - 194 => 1, - 204 => 1, - 205 => 1, - 210 => 1, - 215 => 2, - 216 => 1, - 231 => 2, - 235 => 1, - 244 => 1, - 248 => 1, - 258 => 1, - 263 => 1, - 268 => 1, - 273 => 1, - 276 => 1, - 282 => 1, - 310 => 1, - 316 => 1, - 324 => 1, - 344 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc deleted file mode 100644 index 3e086c6f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the PropertyDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff - */ -final class PropertyDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 9 => 2, - 10 => 1, - 11 => 1, - 17 => 1, - 18 => 1, - 23 => 1, - 38 => 1, - 41 => 1, - 42 => 1, - 50 => 2, - 51 => 1, - 55 => 1, - 56 => 1, - 61 => 1, - 62 => 1, - 68 => 1, - 69 => 1, - 71 => 1, - 72 => 1, - 76 => 1, - 80 => 1, - 82 => 1, - 84 => 1, - 86 => 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. - * - * @return array - */ - public function getWarningList() - { - return [ - 13 => 1, - 14 => 1, - 15 => 1, - 53 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc deleted file mode 100644 index 542ab3cf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc +++ /dev/null @@ -1,81 +0,0 @@ - $that) {} -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 - -$binary = b"binary string"; - -if ($expr1 - && $expr2 ) { -} - -if ($expr1 - && $expr2 /* comment */ ) { -} - -if ($expr1 - && $expr2 - /* comment */ ) { -} - -$r = match ($x) {}; -$r = match ( $x ) {}; - -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 1 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 1 -$r = match ($x) {}; -$r = match ( $x ) {}; -$r = match ( $x ) {}; -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed deleted file mode 100644 index a29534be..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,80 +0,0 @@ - $that ) {} -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 - -$binary = b"binary string"; - -if ($expr1 - && $expr2) { -} - -if ($expr1 - && $expr2 /* comment */) { -} - -if ($expr1 - && $expr2 - /* comment */) { -} - -$r = match ($x) {}; -$r = match ($x) {}; - -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 1 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 1 -$r = match ( $x ) {}; -$r = match ( $x ) {}; -$r = match ( $x ) {}; -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesAfterOpen 0 -// phpcs:set PSR2.ControlStructures.ControlStructureSpacing requiredSpacesBeforeClose 0 diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php deleted file mode 100644 index a8ab73e1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ControlStructureSpacingUnitTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff - */ -final class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 14 => 2, - 26 => 2, - 27 => 2, - 31 => 1, - 51 => 2, - 53 => 2, - 60 => 1, - 64 => 1, - 69 => 1, - 73 => 2, - 77 => 2, - 79 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc deleted file mode 100644 index 778659c8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc +++ /dev/null @@ -1,17 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed deleted file mode 100644 index 4a7bfdc2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,17 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php deleted file mode 100644 index 79d46542..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/ElseIfDeclarationUnitTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ElseIfDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff - */ -final class ElseIfDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [ - 4 => 1, - 12 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc deleted file mode 100644 index 2ca60a93..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc +++ /dev/null @@ -1,598 +0,0 @@ - 0) { - return 0; - } else { - return 1; - } - case 2: - return 2; -} - -// ERROR: No else clause -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } elseif ($bar < 0) { - return 1; - } - case 2: - return 2; -} - -// OK: No fall-through present -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } elseif ($bar < 0) { - return 1; - } -} - -// ERROR: No else clause (nested) -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } else { - if ($foo > $bar) { - continue; - } - } - case 2: - return 2; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } else { - if ($foo > $bar) { - continue; - } else { - break; - } - } - case 2: - return 2; -} - -// ERROR: Non-termination IF clause -switch ($foo) { - case 1: - if ($bar > 0) { - $offset = 0; - } else { - break; - } - case 2: - return 2; -} - -// ERROR: Non-termination IF clause (nested) -switch ($foo) { - case 1: - if ($bar > 0) { - continue; - } else { - if ($foo > $bar) { - $offset = 0; - } else { - break; - } - } - case 2: - return 2; -} - -switch ($sContext) -{ - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -$foo = $foo ? - function () { - switch ($a) { - case 'a': - break; - } - } : - null; - -switch ($foo) { -case Foo::INTERFACE: - echo '1'; - return self::INTERFACE; -case Foo::TRAIT: -case Foo::ARRAY: - echo '1'; - return self::VALUE; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return 1; - default: - return 3; - } - case 2: - return 2; -} - -// KO: Not every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return; - } - case 2: - return 2; -} - -// KO: Not every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return; - default: - $a = 1; - } - case 2: - return 2; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return 1; - default: - throw new \Exception(); - } - case 2: - return 2; -} - -switch ($foo) { - case 1: - // phpcs:ignore - case 2: - return 1; - case 3: - return 2; -} - -// Issue 3352. -switch ( $test ) { - case 2: // comment followed by empty line - - break; - - case 3: /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments. */ - - - - break; - - case 4: /** inline docblock */ - - - - break; - - case 5: /* checking how it handles */ /* two trailing comments */ - - break; - - case 6: - // Comment as first content of the body. - - break; - - case 7: - /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments at start of body. */ - - break; - - case 8: - /** inline docblock */ - - break; -} - -// Handle comments correctly. -switch ($foo) { - case 1: - if ($bar > 0) { - doSomething(); - } - // Comment - else { - return 1; - } - case 2: - return 2; -} - -switch ($foo) { - case 1: - if ($bar > 0) /*comment*/ { - return doSomething(); - } - else { - return 1; - } - case 2: - return 2; -} - -// Issue #3297. -// Okay - finally will always be executed, so all branches are covered by the `return` in finally. -switch ( $a ) { - case 1: - try { - doSomething(); - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - doSomething(); - } finally { - return true; - } - default: - $other = $code; - break; -} - -// Okay - all - non-finally - branches have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) /*comment*/ { - return true; - } - // Comment - catch (AnotherException $e) { - return true; - } finally { - doSomething(); - } - default: - $other = $code; - break; -} - -// Okay - finally will always be executed, so all branches are covered by the `return` in finally. -// Non-standard structure order. -switch ( $a ) { - case 1: - try { - doSomething(); - } catch (Exception $e) { - doSomething(); - } finally { - return true; - } catch (AnotherException $e) { - doSomething(); - } - default: - $other = $code; - break; -} - -// Okay - all - non-finally - branches have a terminating statement. -// Non-standard structure order. -switch ( $a ) { - case 1: - try { - return false; - } finally { - doSomething(); - } catch (MyException $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// All okay, no finally. Any exception still uncaught will terminate the case anyhow, so we're good. -switch ( $a ) { - case 1: - try { - return false; - } catch (MyException $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// All okay, no catch -switch ( $a ) { - case 1: - try { - return true; - } finally { - doSomething(); - } - case 2: - $other = $code; - break; -} - -// All okay, try-catch nested in if. -switch ( $a ) { - case 1: - if ($a) { - try { - return true; // Comment. - } catch (MyException $e) { - throw new Exception($e->getMessage()); - } - } else { - return true; - } - case 2: - $other = $code; - break; -} - -// Missing fall-through comment. -switch ( $a ) { - case 1: - try { - doSomething(); - } finally { - doSomething(); - } - case 2: - $other = $code; - break; -} - -// Missing fall-through comment. One of the catches does not have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - return true; - } finally { - doSomething(); - } - default: - $other = $code; - break; -} - -// Missing fall-through comment. Try does not have a terminating statement. -switch ( $a ) { - case 1: - try { - doSomething(); - } finally { - doSomething(); - } catch (Exception $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// Missing fall-through comment. One of the catches does not have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// Issue 3550 - comment after terminating statement. -switch (rand()) { - case 1: - if (rand() === 1) { - break; - } else { - break; // comment - } - default: - break; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed deleted file mode 100644 index bbc8b7c4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,593 +0,0 @@ - 0) { - return 0; - } else { - return 1; - } - case 2: - return 2; -} - -// ERROR: No else clause -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } elseif ($bar < 0) { - return 1; - } - case 2: - return 2; -} - -// OK: No fall-through present -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } elseif ($bar < 0) { - return 1; - } -} - -// ERROR: No else clause (nested) -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } else { - if ($foo > $bar) { - continue; - } - } - case 2: - return 2; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - if ($bar > 0) { - return 0; - } else { - if ($foo > $bar) { - continue; - } else { - break; - } - } - case 2: - return 2; -} - -// ERROR: Non-termination IF clause -switch ($foo) { - case 1: - if ($bar > 0) { - $offset = 0; - } else { - break; - } - case 2: - return 2; -} - -// ERROR: Non-termination IF clause (nested) -switch ($foo) { - case 1: - if ($bar > 0) { - continue; - } else { - if ($foo > $bar) { - $offset = 0; - } else { - break; - } - } - case 2: - return 2; -} - -switch ($sContext) -{ - case 'SOMETHING': - case 'CONSTANT': - do_something(); - break; - case 'GLOBAL': - case 'GLOBAL1': - do_something(); - // Fall through - default: - { - do_something(); - } -} - -$foo = $foo ? - function () { - switch ($a) { - case 'a': - break; - } - } : - null; - -switch ($foo) { -case Foo::INTERFACE: - echo '1'; - return self::INTERFACE; -case Foo::TRAIT: -case Foo::ARRAY: - echo '1'; - return self::VALUE; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return 1; - default: - return 3; - } - case 2: - return 2; -} - -// KO: Not every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return; - } - case 2: - return 2; -} - -// KO: Not every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return; - default: - $a = 1; - } - case 2: - return 2; -} - -// OK: Every clause terminates -switch ($foo) { - case 1: - switch ($bar) { - case 1: - return 1; - default: - throw new \Exception(); - } - case 2: - return 2; -} - -switch ($foo) { - case 1: - // phpcs:ignore - case 2: - return 1; - case 3: - return 2; -} - -// Issue 3352. -switch ( $test ) { - case 2: // comment followed by empty line - break; - - case 3: /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments. */ - break; - - case 4: /** inline docblock */ - break; - - case 5: /* checking how it handles */ /* two trailing comments */ - break; - - case 6: - // Comment as first content of the body. - - break; - - case 7: - /* phpcs:ignore Stnd.Cat.SniffName -- Verify correct handling of ignore comments at start of body. */ - - break; - - case 8: - /** inline docblock */ - - break; -} - -// Handle comments correctly. -switch ($foo) { - case 1: - if ($bar > 0) { - doSomething(); - } - // Comment - else { - return 1; - } - case 2: - return 2; -} - -switch ($foo) { - case 1: - if ($bar > 0) /*comment*/ { - return doSomething(); - } - else { - return 1; - } - case 2: - return 2; -} - -// Issue #3297. -// Okay - finally will always be executed, so all branches are covered by the `return` in finally. -switch ( $a ) { - case 1: - try { - doSomething(); - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - doSomething(); - } finally { - return true; - } - default: - $other = $code; - break; -} - -// Okay - all - non-finally - branches have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) /*comment*/ { - return true; - } - // Comment - catch (AnotherException $e) { - return true; - } finally { - doSomething(); - } - default: - $other = $code; - break; -} - -// Okay - finally will always be executed, so all branches are covered by the `return` in finally. -// Non-standard structure order. -switch ( $a ) { - case 1: - try { - doSomething(); - } catch (Exception $e) { - doSomething(); - } finally { - return true; - } catch (AnotherException $e) { - doSomething(); - } - default: - $other = $code; - break; -} - -// Okay - all - non-finally - branches have a terminating statement. -// Non-standard structure order. -switch ( $a ) { - case 1: - try { - return false; - } finally { - doSomething(); - } catch (MyException $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// All okay, no finally. Any exception still uncaught will terminate the case anyhow, so we're good. -switch ( $a ) { - case 1: - try { - return false; - } catch (MyException $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// All okay, no catch -switch ( $a ) { - case 1: - try { - return true; - } finally { - doSomething(); - } - case 2: - $other = $code; - break; -} - -// All okay, try-catch nested in if. -switch ( $a ) { - case 1: - if ($a) { - try { - return true; // Comment. - } catch (MyException $e) { - throw new Exception($e->getMessage()); - } - } else { - return true; - } - case 2: - $other = $code; - break; -} - -// Missing fall-through comment. -switch ( $a ) { - case 1: - try { - doSomething(); - } finally { - doSomething(); - } - case 2: - $other = $code; - break; -} - -// Missing fall-through comment. One of the catches does not have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - return true; - } finally { - doSomething(); - } - default: - $other = $code; - break; -} - -// Missing fall-through comment. Try does not have a terminating statement. -switch ( $a ) { - case 1: - try { - doSomething(); - } finally { - doSomething(); - } catch (Exception $e) { - return true; - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// Missing fall-through comment. One of the catches does not have a terminating statement. -switch ( $a ) { - case 1: - try { - return false; - } catch (Exception $e) { - doSomething(); - } catch (AnotherException $e) { - return true; - } - default: - $other = $code; - break; -} - -// Issue 3550 - comment after terminating statement. -switch (rand()) { - case 1: - if (rand() === 1) { - break; - } else { - break; // comment - } - default: - break; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php deleted file mode 100644 index a292503d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SwitchDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff - */ -final class SwitchDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 10 => 1, - 11 => 1, - 14 => 1, - 16 => 1, - 20 => 1, - 23 => 1, - 29 => 1, - 33 => 1, - 37 => 2, - 108 => 2, - 109 => 1, - 111 => 1, - 113 => 2, - 114 => 1, - 128 => 1, - 141 => 1, - 172 => 1, - 194 => 1, - 224 => 1, - 236 => 1, - 260 => 1, - 300 => 1, - 311 => 1, - 346 => 1, - 350 => 1, - 356 => 1, - 362 => 1, - 384 => 1, - 528 => 1, - 541 => 1, - 558 => 1, - 575 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc deleted file mode 100644 index 738e70e9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed deleted file mode 100644 index f70b9eba..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.1.inc.fixed +++ /dev/null @@ -1,12 +0,0 @@ - - -
    - -
    \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc deleted file mode 100644 index d6a86175..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.3.inc +++ /dev/null @@ -1,7 +0,0 @@ - - -A: -B: -C: \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc deleted file mode 100644 index dd103cde..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc +++ /dev/null @@ -1 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed deleted file mode 100644 index 1058f1f3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.4.inc.fixed +++ /dev/null @@ -1 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed deleted file mode 100644 index 93d55fbd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.5.inc.fixed +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed deleted file mode 100644 index 534574d4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.6.inc.fixed +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed deleted file mode 100644 index 68e7d8ce..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/ClosingTagUnitTest.7.inc.fixed +++ /dev/null @@ -1,5 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClosingTag sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\ClosingTagSniff - */ -final class ClosingTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ClosingTagUnitTest.1.inc': - return [11 => 1]; - - case 'ClosingTagUnitTest.4.inc': - case 'ClosingTagUnitTest.5.inc': - return [1 => 1]; - - case 'ClosingTagUnitTest.6.inc': - case 'ClosingTagUnitTest.7.inc': - return [5 => 1]; - - default: - return []; - } - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc deleted file mode 100644 index ca2a7493..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.1.inc +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed deleted file mode 100644 index d3c19fee..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.12.inc.fixed +++ /dev/null @@ -1 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc deleted file mode 100644 index fa2f476a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc deleted file mode 100644 index 1254e4a5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.2.inc +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc deleted file mode 100644 index c3a59b67..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.5.inc +++ /dev/null @@ -1,6 +0,0 @@ - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the EndFileNewline sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff - */ -final class EndFileNewlineUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'EndFileNewlineUnitTest.1.inc': - case 'EndFileNewlineUnitTest.3.inc': - case 'EndFileNewlineUnitTest.6.inc': - case 'EndFileNewlineUnitTest.7.inc': - case 'EndFileNewlineUnitTest.9.inc': - case 'EndFileNewlineUnitTest.10.inc': - return [2 => 1]; - case 'EndFileNewlineUnitTest.11.inc': - case 'EndFileNewlineUnitTest.12.inc': - case 'EndFileNewlineUnitTest.13.inc': - return [1 => 1]; - default: - return []; - }//end switch - - }//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($testFile='') - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc deleted file mode 100644 index 1ca477d0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc +++ /dev/null @@ -1,267 +0,0 @@ -get('/hello/{name}', function ($name) use ($app) { - return 'Hello '.$app->escape($name); -}, array( - '1', - '2', - '3', -)); - -// error -somefunction2($foo, $bar, [ - // ... - ], -$baz); - -// ok -somefunction3(// ... - $foo, - $bar, - [ - // ... - ], - $baz -); - -// ok -somefunction4(' - this should not - give an error - because it\'s actually - one line call - with multi-line string -'); - -// ok -somefunction5("hey, -multi-line string with some -extra args", $foo, 12); - -// error -somefunction6(' - but args in a new line - are not ok… - ', - $foo -); - -$this->setFoo(true - ? 1 - : 2, false, array( - 'value', - 'more')); - -$this->setFoo('some' - . 'long' - . 'text', 'string'); - -foo(bar(), $a); -foo();bar(); - -foo( - true -); - -myFunction(<< function ($x) { - return true; - }, - 'baz' => false - ) -); -$qux = array_filter( - $quux, function ($x) { - return $x; - } -); - -$this->listeners[] = $events->getSharedManager()->attach( - 'Zend\Mvc\Application', MvcEvent::EVENT_DISPATCH, [$this, 'selectLayout'], 100 -); - -// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 1 -foo('Testing - multiline text' - ); - -foo('Testing - multiline text: ' // . $text - ); - -foo('Testing - multiline text: ' /* . $text */ - ); - -foo('Testing - multiline text: ' /* . $text */ - // . $other_text - ); - -foo('Testing - multiline text: ' /* - . $text -// . $text2 - */ - ); -// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 0 - -foo('Testing - multiline text' -); - -foo('Testing - multiline text' - ); - -foo('Testing - multiline text' // hello -); - -foo('Testing - multiline text' /* hello */ -); - -foo('Testing - multiline text' - // hello -); - -foo('Testing - multiline text' - /* hello */ -); - -$var = foo('Testing - multiline' - // hi - ) + foo('Testing - multiline' - // hi - ) -; - -class Test -{ - public function getInstance() - { - return new static( - 'arg', - 'foo' - ); - } - - public function getSelf() - { - return new self( - 'a', 'b', 'c' - ); - } -} - -$x = $var('y', - 'x'); - -$obj->{$x}(1, -2); - -(function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})( - 'a','b' -)('c', - 'd'); - -return trim(preg_replace_callback( - // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) - // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search - )); - -return trim(preg_replace_callback( -// sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) -// /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ -sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), -function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; -}, -$search -)); - -// PHP 8.0 named parameters. -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -array_fill_keys( - keys: range( 1, - 12, - ), value: true, -); - -// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments true -array_fill_keys( - keys: range( 1, - 12, - ), value: true, -); -// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed deleted file mode 100644 index dc383ed2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.inc.fixed +++ /dev/null @@ -1,283 +0,0 @@ -get('/hello/{name}', function ($name) use ($app) { - return 'Hello '.$app->escape($name); -}, array( - '1', - '2', - '3', -)); - -// error -somefunction2( - $foo, - $bar, - [ - // ... - ], - $baz -); - -// ok -somefunction3(// ... - $foo, - $bar, - [ - // ... - ], - $baz -); - -// ok -somefunction4(' - this should not - give an error - because it\'s actually - one line call - with multi-line string -'); - -// ok -somefunction5("hey, -multi-line string with some -extra args", $foo, 12); - -// error -somefunction6( - ' - but args in a new line - are not ok… - ', - $foo -); - -$this->setFoo(true - ? 1 - : 2, false, array( - 'value', - 'more')); - -$this->setFoo('some' - . 'long' - . 'text', 'string'); - -foo(bar(), $a); -foo();bar(); - -foo( - true -); - -myFunction(<< function ($x) { - return true; - }, - 'baz' => false - ) -); -$qux = array_filter( - $quux, - function ($x) { - return $x; - } -); - -$this->listeners[] = $events->getSharedManager()->attach( - 'Zend\Mvc\Application', - MvcEvent::EVENT_DISPATCH, - [$this, 'selectLayout'], - 100 -); - -// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 1 -foo('Testing - multiline text' ); - -foo('Testing - multiline text: ' ); // . $text - - -foo('Testing - multiline text: ' /* . $text */ ); - -foo('Testing - multiline text: ' /* . $text */ ); - // . $other_text - - -foo('Testing - multiline text: ' /* - . $text -// . $text2 - */ ); -// phpcs:set PSR2.Methods.FunctionCallSignature requiredSpacesBeforeClose 0 - -foo('Testing - multiline text'); - -foo('Testing - multiline text'); - -foo('Testing - multiline text'); // hello - - -foo('Testing - multiline text' /* hello */); - -foo('Testing - multiline text'); - // hello - - -foo('Testing - multiline text' - /* hello */); - -$var = foo('Testing - multiline') - // hi - + foo('Testing - multiline'); - // hi - - -class Test -{ - public function getInstance() - { - return new static( - 'arg', - 'foo' - ); - } - - public function getSelf() - { - return new self( - 'a', - 'b', - 'c' - ); - } -} - -$x = $var( - 'y', - 'x' -); - -$obj->{$x}( - 1, - 2 -); - -(function ($a, $b) { - return function ($c, $d) use ($a, $b) { - echo $a, $b, $c, $d; - }; -})( - 'a', - 'b' -)( - 'c', - 'd' -); - -return trim(preg_replace_callback( - // sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) - // /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search -)); - -return trim(preg_replace_callback( -// sprintf replaces IGNORED_CHARS multiple times: for %s as well as %1$s (argument numbering) -// /[%s]*([^%1$s]+)/ results in /[IGNORED_CHARS]*([^IGNORED_CHARS]+)/ - sprintf('/[%s]*([^%1$s]+)/', self::IGNORED_CHARS), - function (array $term) use ($mode): string { - // query pieces have to bigger than one char, otherwise they are too expensive for the search - if (mb_strlen($term[1], 'UTF-8') > 1) { - // in boolean search mode '' (empty) means OR, '-' means NOT - return sprintf('%s%s ', $mode === 'AND' ? '+' : '', self::extractUmlauts($term[1])); - } - - return ''; - }, - $search -)); - -// PHP 8.0 named parameters. -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -array_fill_keys( - keys: range( - 1, - 12, - ), - value: true, -); - -// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments true -array_fill_keys( - keys: range( - 1, - 12, - ), value: true, -); -// phpcs:set PSR2.Methods.FunctionCallSignature allowMultipleArguments false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php deleted file mode 100644 index 52cda174..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionCallSignatureUnitTest.php +++ /dev/null @@ -1,99 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionCallSignature sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff - */ -final class FunctionCallSignatureUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 18 => 3, - 21 => 1, - 48 => 1, - 87 => 1, - 90 => 1, - 91 => 1, - 103 => 1, - 111 => 1, - 117 => 4, - 123 => 1, - 127 => 1, - 131 => 1, - 136 => 1, - 143 => 1, - 148 => 1, - 152 => 1, - 156 => 1, - 160 => 1, - 165 => 1, - 170 => 1, - 175 => 1, - 178 => 2, - 186 => 1, - 187 => 1, - 194 => 3, - 199 => 1, - 200 => 2, - 202 => 1, - 203 => 1, - 210 => 2, - 211 => 1, - 212 => 2, - 217 => 1, - 218 => 1, - 227 => 1, - 228 => 1, - 233 => 1, - 234 => 1, - 242 => 1, - 243 => 1, - 256 => 1, - 257 => 1, - 258 => 1, - 263 => 1, - 264 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc deleted file mode 100644 index 7bf667e6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/FunctionClosingBraceUnitTest.inc +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionClosingBrace sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionClosingBraceSniff - */ -final class FunctionClosingBraceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 16 => 1, - 23 => 1, - 40 => 1, - 47 => 1, - 63 => 1, - 70 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc deleted file mode 100644 index 096b44bc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Methods/MethodDeclarationUnitTest.inc +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Methods; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the MethodDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff - */ -final class MethodDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 11 => 1, - 13 => 1, - 15 => 3, - 24 => 1, - 34 => 1, - 36 => 1, - 38 => 1, - 40 => 3, - 50 => 1, - 52 => 1, - 54 => 1, - 56 => 3, - 63 => 2, - 73 => 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. - * - * @return array - */ - public function getWarningList() - { - return [ - 5 => 1, - 21 => 1, - 30 => 1, - 46 => 1, - 63 => 1, - 70 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc deleted file mode 100644 index 70339339..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/NamespaceDeclarationUnitTest.inc +++ /dev/null @@ -1,26 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Namespaces; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the NamespaceDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\NamespaceDeclarationSniff - */ -final class NamespaceDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 6 => 1, - 9 => 1, - 17 => 1, - 19 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc deleted file mode 100644 index 977a7fb2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.1.inc +++ /dev/null @@ -1,40 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed deleted file mode 100644 index 6579613b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.2.inc.fixed +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc deleted file mode 100644 index 8b290950..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.3.inc +++ /dev/null @@ -1,16 +0,0 @@ - -

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc deleted file mode 100644 index 1fdaccd3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.5.inc +++ /dev/null @@ -1,47 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc deleted file mode 100644 index dee56869..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Namespaces/UseDeclarationUnitTest.7.inc +++ /dev/null @@ -1 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\PSR2\Tests\Namespaces; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the UseDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\UseDeclarationSniff - */ -final class UseDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'UseDeclarationUnitTest.2.inc': - return [ - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 16 => 1, - ]; - case 'UseDeclarationUnitTest.3.inc': - return [ - 4 => 1, - 6 => 1, - ]; - case 'UseDeclarationUnitTest.5.inc': - return [ - 5 => 1, - 6 => 1, - 8 => 1, - 14 => 1, - 17 => 1, - 18 => 1, - 19 => 1, - 21 => 1, - 28 => 1, - 30 => 1, - 35 => 1, - ]; - case 'UseDeclarationUnitTest.10.inc': - case 'UseDeclarationUnitTest.11.inc': - case 'UseDeclarationUnitTest.12.inc': - case 'UseDeclarationUnitTest.13.inc': - case 'UseDeclarationUnitTest.14.inc': - case 'UseDeclarationUnitTest.16.inc': - case 'UseDeclarationUnitTest.17.inc': - return [2 => 1]; - case 'UseDeclarationUnitTest.15.inc': - return [ - 3 => 1, - 4 => 1, - 5 => 1, - ]; - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml deleted file mode 100644 index ba5bd4e0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/ruleset.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - The PSR-2 coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - - - - - - - - - - - 0 - - - 0 - - - - - - - 0 - - - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml deleted file mode 100644 index d91fec90..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayBracketSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - ['bar']; - ]]> - - - [ 'bar' ]; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml deleted file mode 100644 index ce4b9ae6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Arrays/ArrayDeclarationStandard.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - array keyword must be lowercase. - ]]> - - - - - - - - - - - array keyword. - ]]> - - - - 'value1', - 'key2' => 'value2', - ); - ]]> - - - 'value1', - 'key2' => 'value2', - ); - ]]> - - - - array keyword. The closing parenthesis must be aligned with the start of the array keyword. - ]]> - - - - 'key1' => 'value1', - 'key2' => 'value2', - ); - ]]> - - - 'key1' => 'value1', - 'key2' => 'value2', -); - ]]> - - - - - - - - => 'ValueTen', - 'keyTwenty' => 'ValueTwenty', - ); - ]]> - - - => 'ValueTen', - 'keyTwenty' => 'ValueTwenty', - ); - ]]> - - - - - - - - 'value1', - 'key2' => 'value2', - 'key3' => 'value3', - ); - ]]> - - - 'value1', - 'key2' => 'value2', - 'key3' => 'value3' - ); - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml deleted file mode 100644 index 6d38c5a8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/LowercaseClassKeywordsStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - final class Foo extends Bar -{ -} - ]]> - - - Final Class Foo Extends Bar -{ -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml deleted file mode 100644 index 4f982fa4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - self::foo(); - ]]> - - - SELF::foo(); - ]]> - - - - - ::foo(); - ]]> - - - :: foo(); - ]]> - - - - - self::bar(); - } -} - ]]> - - - Foo -{ - public static function bar() - { - } - - public static function baz() - { - Foo::bar(); - } -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml deleted file mode 100644 index 17fed42c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/DocCommentAlignmentStandard.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - * @see foo() - */ - ]]> - - - * @see foo() -*/ - ]]> - - - - - @see foo() - */ - ]]> - - - @see foo() - */ - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml deleted file mode 100644 index e3638a49..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Commenting/FunctionCommentThrowTagStandard.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - @throws Exception all the time - * @return void - */ -function foo() -{ - throw new Exception('Danger!'); -} - ]]> - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml deleted file mode 100644 index 42fa6f43..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - $foo as $bar => $baz) { - echo $baz; -} - ]]> - - - $foo as $bar=>$baz ) { - echo $baz; -} - ]]> - - - - - as $bar => $baz) { - echo $baz; -} - ]]> - - - AS $bar => $baz) { - echo $baz; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml deleted file mode 100644 index 37caaded..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForLoopDeclarationStandard.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - $i = 0; $i < 10; $i++) { - echo $i; -} - ]]> - - - $i = 0; $i < 10; $i++ ) { - echo $i; -} - ]]> - - - - - ; $i < 10; $i++) { - echo $i; -} - ]]> - - - ; $i < 10 ; $i++) { - echo $i; -} - ]]> - - - - - $i < 10; $i++) { - echo $i; -} - ]]> - - - $i < 10;$i++) { - echo $i; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml deleted file mode 100644 index 08017b75..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/LowercaseDeclarationStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - if ($foo) { - $bar = true; -} - ]]> - - - IF ($foo) { - $bar = true; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml deleted file mode 100644 index 8a0e47ea..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/FunctionDuplicateArgumentStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - isset($foo)) { - echo $foo; -} - ]]> - - - isSet($foo)) { - echo $foo; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml deleted file mode 100644 index b97e8073..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Functions/LowercaseFunctionKeywordsStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - function foo() -{ - return true; -} - ]]> - - - FUNCTION foo() -{ - return true; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml deleted file mode 100644 index 0145657d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - static function bar() - { - return self::$staticMember; - } -} - ]]> - - - static function bar() - { - return $this->$staticMember; - } -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml deleted file mode 100644 index 2bc536eb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Strings/EchoedStringsStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - "Hello"; - ]]> - - - ("Hello"); - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml deleted file mode 100644 index 9529b1fd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/CastSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - int)'42'; - ]]> - - - int )'42'; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionClosingBraceSpaceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionClosingBraceSpaceStandard.xml deleted file mode 100644 index ccbdfa21..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionClosingBraceSpaceStandard.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - { - -} -]]> - - - {} -]]> - - - - - - - - - { - } - -} -]]> - - - {} - -} -]]> - - - - - - - - - { - } - -} -]]> - - - { - - } - -} -]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml deleted file mode 100644 index 28fa712f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceStandard.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - { -} - ]]> - - - { -} - ]]> - - - - - return 42; -} - ]]> - - - - return 42; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml deleted file mode 100644 index aceb8867..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - "hi"; - ]]> - - - "hi"; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/MemberVarSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/MemberVarSpacingStandard.xml deleted file mode 100644 index a551af8a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/MemberVarSpacingStandard.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - protected $var1 = 'value'; -} - ]]> - - - - protected $var1 = 'value'; -} - ]]> - - - - - - - - - - public $var2 = 'value2'; - - public $var3 = 'value3'; -} - ]]> - - - - - - public $var2 = 'value2'; - public $var3 = 'value3'; -} - ]]> - - - - - - - - - public $actions = array(); -}; - ]]> - - - - - public $actions = array(); -}; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml deleted file mode 100644 index 44edc7b5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - ) should not have any space around it. - ]]> - - - - ->bar(); - ]]> - - - -> bar(); - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml deleted file mode 100644 index 3284df97..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeClosingBraceStandard.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - } - -if (!class_exists('Foo')) { - class Foo { - } -} - - - some output - ?> - ]]> - - - } - -if (!class_exists('Foo')) { - class Foo { -} - } - - - some output - ?> - ]]> - - - - - - - - } - ]]> - - - } - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml deleted file mode 100644 index 4394ea27..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/ScopeKeywordSpacingStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - static function foo() -{ -} - ]]> - - - static function foo() -{ -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml deleted file mode 100644 index bb9bf8f0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SemicolonSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - ; - ]]> - - - ; - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SuperfluousWhitespaceStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SuperfluousWhitespaceStandard.xml deleted file mode 100644 index b4ad03d0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/SuperfluousWhitespaceStandard.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - ]]> - - - - - - - - - - - - - echo 'code here'; -} - ]]> - - - - - - - - - - ]]> - - - - - - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php deleted file mode 100644 index b6bb31de..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php +++ /dev/null @@ -1,95 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ArrayBracketSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_SQUARE_BRACKET, - T_CLOSE_SQUARE_BRACKET, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @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(); - - if (($tokens[$stackPtr]['code'] === T_OPEN_SQUARE_BRACKET - && isset($tokens[$stackPtr]['bracket_closer']) === false) - || ($tokens[$stackPtr]['code'] === T_CLOSE_SQUARE_BRACKET - && isset($tokens[$stackPtr]['bracket_opener']) === false) - ) { - // Bow out for parse error/during live coding. - return; - } - - // Square brackets can not have a space before them. - $prevType = $tokens[($stackPtr - 1)]['code']; - if ($prevType === T_WHITESPACE) { - $nonSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 2), null, true); - $expected = $tokens[$nonSpace]['content'].$tokens[$stackPtr]['content']; - $found = $phpcsFile->getTokensAsString($nonSpace, ($stackPtr - $nonSpace)).$tokens[$stackPtr]['content']; - $error = 'Space found before square bracket; expected "%s" but found "%s"'; - $data = [ - $expected, - $found, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeBracket', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); - } - } - - // Open square brackets can't ever have spaces after them. - if ($tokens[$stackPtr]['code'] === T_OPEN_SQUARE_BRACKET) { - $nextType = $tokens[($stackPtr + 1)]['code']; - if ($nextType === T_WHITESPACE) { - $nonSpace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 2), null, true); - $expected = $tokens[$stackPtr]['content'].$tokens[$nonSpace]['content']; - $found = $phpcsFile->getTokensAsString($stackPtr, ($nonSpace - $stackPtr + 1)); - $error = 'Space found after square bracket; expected "%s" but found "%s"'; - $data = [ - $expected, - $found, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterBracket', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php deleted file mode 100644 index 89cd7bd5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php +++ /dev/null @@ -1,942 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ArrayDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_ARRAY, - T_OPEN_SHORT_ARRAY, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @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(); - - if ($tokens[$stackPtr]['code'] === T_ARRAY) { - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'no'); - - // Array keyword should be lower case. - if ($tokens[$stackPtr]['content'] !== strtolower($tokens[$stackPtr]['content'])) { - if ($tokens[$stackPtr]['content'] === strtoupper($tokens[$stackPtr]['content'])) { - $phpcsFile->recordMetric($stackPtr, 'Array keyword case', 'upper'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Array keyword case', 'mixed'); - } - - $error = 'Array keyword should be lower case; expected "array" but found "%s"'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotLowerCase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'array'); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Array keyword case', 'lower'); - } - - $arrayStart = $tokens[$stackPtr]['parenthesis_opener']; - if (isset($tokens[$arrayStart]['parenthesis_closer']) === false) { - return; - } - - $arrayEnd = $tokens[$arrayStart]['parenthesis_closer']; - - if ($arrayStart !== ($stackPtr + 1)) { - $error = 'There must be no space between the "array" keyword and the opening parenthesis'; - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), $arrayStart, true); - if (isset(Tokens::$commentTokens[$tokens[$next]['code']]) === true) { - // We don't have anywhere to put the comment, so don't attempt to fix it. - $phpcsFile->addError($error, $stackPtr, 'SpaceAfterKeyword'); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $arrayStart; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'yes'); - $arrayStart = $stackPtr; - $arrayEnd = $tokens[$stackPtr]['bracket_closer']; - }//end if - - // Check for empty arrays. - $content = $phpcsFile->findNext(T_WHITESPACE, ($arrayStart + 1), ($arrayEnd + 1), true); - if ($content === $arrayEnd) { - // Empty array, but if the brackets aren't together, there's a problem. - if (($arrayEnd - $arrayStart) !== 1) { - $error = 'Empty array declaration must have no space between the parentheses'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceInEmptyArray'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($arrayStart + 1); $i < $arrayEnd; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - // We can return here because there is nothing else to check. All code - // below can assume that the array is not empty. - return; - } - - if ($tokens[$arrayStart]['line'] === $tokens[$arrayEnd]['line']) { - $this->processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd); - } else { - $this->processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd); - } - - }//end process() - - - /** - * Processes a single-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * - * @return void - */ - public function processSingleLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd) - { - $tokens = $phpcsFile->getTokens(); - - // Check if there are multiple values. If so, then it has to be multiple lines - // unless it is contained inside a function call or condition. - $valueCount = 0; - $commas = []; - for ($i = ($arrayStart + 1); $i < $arrayEnd; $i++) { - // Skip bracketed statements, like function calls. - if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { - $i = $tokens[$i]['parenthesis_closer']; - continue; - } - - if ($tokens[$i]['code'] === T_COMMA) { - // Before counting this comma, make sure we are not - // at the end of the array. - $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $arrayEnd, true); - if ($next !== false) { - $valueCount++; - $commas[] = $i; - } else { - // There is a comma at the end of a single line array. - $error = 'Comma not allowed after last value in single-line array declaration'; - $fix = $phpcsFile->addFixableError($error, $i, 'CommaAfterLast'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } - }//end for - - // Now check each of the double arrows (if any). - $nextArrow = $arrayStart; - while (($nextArrow = $phpcsFile->findNext(T_DOUBLE_ARROW, ($nextArrow + 1), $arrayEnd)) !== false) { - if ($tokens[($nextArrow - 1)]['code'] !== T_WHITESPACE) { - $content = $tokens[($nextArrow - 1)]['content']; - $error = 'Expected 1 space between "%s" and double arrow; 0 found'; - $data = [$content]; - $fix = $phpcsFile->addFixableError($error, $nextArrow, 'NoSpaceBeforeDoubleArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($nextArrow, ' '); - } - } else { - $spaceLength = $tokens[($nextArrow - 1)]['length']; - if ($spaceLength !== 1) { - $content = $tokens[($nextArrow - 2)]['content']; - $error = 'Expected 1 space between "%s" and double arrow; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $nextArrow, 'SpaceBeforeDoubleArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextArrow - 1), ' '); - } - } - }//end if - - if ($tokens[($nextArrow + 1)]['code'] !== T_WHITESPACE) { - $content = $tokens[($nextArrow + 1)]['content']; - $error = 'Expected 1 space between double arrow and "%s"; 0 found'; - $data = [$content]; - $fix = $phpcsFile->addFixableError($error, $nextArrow, 'NoSpaceAfterDoubleArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($nextArrow, ' '); - } - } else { - $spaceLength = $tokens[($nextArrow + 1)]['length']; - if ($spaceLength !== 1) { - $content = $tokens[($nextArrow + 2)]['content']; - $error = 'Expected 1 space between double arrow and "%s"; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $nextArrow, 'SpaceAfterDoubleArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextArrow + 1), ' '); - } - } - }//end if - }//end while - - if ($valueCount > 0) { - $nestedParenthesis = false; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nested = $tokens[$stackPtr]['nested_parenthesis']; - $nestedParenthesis = array_pop($nested); - } - - if ($nestedParenthesis === false - || $tokens[$nestedParenthesis]['line'] !== $tokens[$stackPtr]['line'] - ) { - $error = 'Array with multiple values cannot be declared on a single line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SingleLineNotAllowed'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($arrayStart); - - if ($tokens[($arrayEnd - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($arrayEnd - 1), $phpcsFile->eolChar); - } else { - $phpcsFile->fixer->addNewlineBefore($arrayEnd); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - } - - // We have a multiple value array that is inside a condition or - // function. Check its spacing is correct. - foreach ($commas as $comma) { - if ($tokens[($comma + 1)]['code'] !== T_WHITESPACE) { - $content = $tokens[($comma + 1)]['content']; - $error = 'Expected 1 space between comma and "%s"; 0 found'; - $data = [$content]; - $fix = $phpcsFile->addFixableError($error, $comma, 'NoSpaceAfterComma', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($comma, ' '); - } - } else { - $spaceLength = $tokens[($comma + 1)]['length']; - if ($spaceLength !== 1) { - $content = $tokens[($comma + 2)]['content']; - $error = 'Expected 1 space between comma and "%s"; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $comma, 'SpaceAfterComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($comma + 1), ' '); - } - } - }//end if - - if ($tokens[($comma - 1)]['code'] === T_WHITESPACE) { - $content = $tokens[($comma - 2)]['content']; - $spaceLength = $tokens[($comma - 1)]['length']; - $error = 'Expected 0 spaces between "%s" and comma; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $comma, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($comma - 1), ''); - } - } - }//end foreach - }//end if - - }//end processSingleLineArray() - - - /** - * Processes a multi-line array definition. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * @param int $arrayStart The token that starts the array definition. - * @param int $arrayEnd The token that ends the array definition. - * - * @return void - */ - public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $arrayEnd) - { - $tokens = $phpcsFile->getTokens(); - $keywordStart = $tokens[$stackPtr]['column']; - - // Check the closing bracket is on a new line. - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($arrayEnd - 1), $arrayStart, true); - if ($tokens[$lastContent]['line'] === $tokens[$arrayEnd]['line']) { - $error = 'Closing parenthesis of array declaration must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNewLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($arrayEnd); - } - } 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); - $pluralizeSpace = 's'; - if ($expected === 1) { - $pluralizeSpace = ''; - } - - $error = 'Closing parenthesis not aligned correctly; expected %s space%s but found %s'; - $data = [ - $expected, - $pluralizeSpace, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $arrayEnd, 'CloseBraceNotAligned', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent(($arrayEnd - 1), str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($arrayEnd - 1), str_repeat(' ', $expected)); - } - } - }//end if - - $keyUsed = false; - $singleUsed = false; - $indices = []; - $maxLength = 0; - - if ($tokens[$stackPtr]['code'] === T_ARRAY) { - $lastToken = $tokens[$stackPtr]['parenthesis_opener']; - } else { - $lastToken = $stackPtr; - } - - // Find all the double arrows that reside in this scope. - for ($nextToken = ($stackPtr + 1); $nextToken < $arrayEnd; $nextToken++) { - // Skip bracketed statements, like function calls. - if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS - && (isset($tokens[$nextToken]['parenthesis_owner']) === false - || $tokens[$nextToken]['parenthesis_owner'] !== $stackPtr) - ) { - $nextToken = $tokens[$nextToken]['parenthesis_closer']; - continue; - } - - if ($tokens[$nextToken]['code'] === T_ARRAY - || $tokens[$nextToken]['code'] === T_OPEN_SHORT_ARRAY - || $tokens[$nextToken]['code'] === T_CLOSURE - || $tokens[$nextToken]['code'] === T_FN - || $tokens[$nextToken]['code'] === T_MATCH - ) { - // Let subsequent calls of this test handle nested arrays. - if ($tokens[$lastToken]['code'] !== T_DOUBLE_ARROW) { - $indices[] = ['value' => $nextToken]; - $lastToken = $nextToken; - } - - if ($tokens[$nextToken]['code'] === T_ARRAY) { - $nextToken = $tokens[$tokens[$nextToken]['parenthesis_opener']]['parenthesis_closer']; - } else if ($tokens[$nextToken]['code'] === T_OPEN_SHORT_ARRAY) { - $nextToken = $tokens[$nextToken]['bracket_closer']; - } else { - // T_CLOSURE. - $nextToken = $tokens[$nextToken]['scope_closer']; - } - - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] !== T_COMMA) { - $nextToken--; - } else { - $lastToken = $nextToken; - } - - continue; - }//end if - - if ($tokens[$nextToken]['code'] !== T_DOUBLE_ARROW && $tokens[$nextToken]['code'] !== T_COMMA) { - continue; - } - - $currentEntry = []; - - if ($tokens[$nextToken]['code'] === T_COMMA) { - $stackPtrCount = 0; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $stackPtrCount = count($tokens[$stackPtr]['nested_parenthesis']); - } - - $commaCount = 0; - if (isset($tokens[$nextToken]['nested_parenthesis']) === true) { - $commaCount = count($tokens[$nextToken]['nested_parenthesis']); - if ($tokens[$stackPtr]['code'] === T_ARRAY) { - // Remove parenthesis that are used to define the array. - $commaCount--; - } - } - - if ($commaCount > $stackPtrCount) { - // This comma is inside more parenthesis than the ARRAY keyword, - // then there it is actually a comma used to separate arguments - // in a function call. - continue; - } - - if ($keyUsed === true && $tokens[$lastToken]['code'] === T_COMMA) { - $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) { - if ($tokens[($nextToken - 1)]['code'] === T_WHITESPACE) { - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextToken - 1), null, true); - if (($tokens[$prev]['code'] !== T_END_HEREDOC - && $tokens[$prev]['code'] !== T_END_NOWDOC) - || $tokens[($nextToken - 1)]['line'] === $tokens[$nextToken]['line'] - ) { - if ($tokens[($nextToken - 1)]['content'] === $phpcsFile->eolChar) { - $spaceLength = 'newline'; - } else { - $spaceLength = $tokens[($nextToken - 1)]['length']; - } - - $error = 'Expected 0 spaces before comma; %s found'; - $data = [$spaceLength]; - - // The error is only fixable if there is only whitespace between the tokens. - if ($prev === $phpcsFile->findPrevious(T_WHITESPACE, ($nextToken - 1), null, true)) { - $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextToken - 1), ''); - } - } else { - $phpcsFile->addError($error, $nextToken, 'SpaceBeforeComma', $data); - } - } - }//end if - - $valueContent = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($lastToken + 1), - $nextToken, - 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; - continue; - }//end if - - if ($tokens[$nextToken]['code'] === T_DOUBLE_ARROW) { - if ($singleUsed === true) { - $error = 'Key specified for array entry; first entry has no key'; - $phpcsFile->addError($error, $nextToken, 'KeySpecified'); - return; - } - - $currentEntry['arrow'] = $nextToken; - $keyUsed = true; - - // Find the start of index that uses this double arrow. - $indexEnd = $phpcsFile->findPrevious(T_WHITESPACE, ($nextToken - 1), $arrayStart, true); - $indexStart = $phpcsFile->findStartOfStatement($indexEnd); - - if ($indexStart === $indexEnd) { - $currentEntry['index'] = $indexEnd; - $currentEntry['index_content'] = $tokens[$indexEnd]['content']; - $currentEntry['index_length'] = $tokens[$indexEnd]['length']; - } else { - $currentEntry['index'] = $indexStart; - $currentEntry['index_content'] = ''; - $currentEntry['index_length'] = 0; - for ($i = $indexStart; $i <= $indexEnd; $i++) { - $currentEntry['index_content'] .= $tokens[$i]['content']; - $currentEntry['index_length'] += $tokens[$i]['length']; - } - } - - if ($maxLength < $currentEntry['index_length']) { - $maxLength = $currentEntry['index_length']; - } - - // Find the value of this index. - $nextContent = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($nextToken + 1), - $arrayEnd, - true - ); - - $currentEntry['value'] = $nextContent; - $indices[] = $currentEntry; - $lastToken = $nextToken; - }//end if - }//end for - - // Check for multi-line arrays that should be single-line. - $singleValue = false; - - if (empty($indices) === true) { - $singleValue = true; - } else if (count($indices) === 1 && $tokens[$lastToken]['code'] === T_COMMA) { - // There may be another array value without a comma. - $exclude = Tokens::$emptyTokens; - $exclude[] = T_COMMA; - $nextContent = $phpcsFile->findNext($exclude, ($indices[0]['value'] + 1), $arrayEnd, true); - if ($nextContent === false) { - $singleValue = true; - } - } - - if ($singleValue === true) { - // Before we complain, make sure the single value isn't a here/nowdoc. - $next = $phpcsFile->findNext(Tokens::$heredocTokens, ($arrayStart + 1), ($arrayEnd - 1)); - if ($next === false) { - // Array cannot be empty, so this is a multi-line array with - // a single value. It should be defined on single line. - $error = 'Multi-line array contains a single value; use single-line array instead'; - $errorCode = 'MultiLineNotAllowed'; - - $find = Tokens::$phpcsCommentTokens; - $find[] = T_COMMENT; - $comment = $phpcsFile->findNext($find, ($arrayStart + 1), $arrayEnd); - if ($comment === false) { - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode); - } else { - $fix = false; - $phpcsFile->addError($error, $stackPtr, $errorCode); - } - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($arrayStart + 1); $i < $arrayEnd; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - for ($i = ($arrayEnd - 1); $i > $arrayStart; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - }//end if - }//end if - - /* - This section checks for arrays that don't specify keys. - - Arrays such as: - array( - 'aaa', - 'bbb', - 'd', - ); - */ - - if ($keyUsed === false && empty($indices) === false) { - $count = count($indices); - $lastIndex = $indices[($count - 1)]['value']; - - $trailingContent = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($arrayEnd - 1), - $lastIndex, - true - ); - - if ($tokens[$trailingContent]['code'] !== T_COMMA) { - $phpcsFile->recordMetric($stackPtr, 'Array end comma', 'no'); - $error = 'Comma required after last value in array declaration'; - $fix = $phpcsFile->addFixableError($error, $trailingContent, 'NoCommaAfterLast'); - if ($fix === true) { - $phpcsFile->fixer->addContent($trailingContent, ','); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Array end comma', 'yes'); - } - - foreach ($indices as $valuePosition => $value) { - if (empty($value['value']) === true) { - // Array was malformed and we couldn't figure out - // the array value correctly, so we have to ignore it. - // Other parts of this sniff will correct the error. - continue; - } - - $valuePointer = $value['value']; - - $ignoreTokens = [ - T_WHITESPACE => T_WHITESPACE, - T_COMMA => T_COMMA, - ]; - $ignoreTokens += Tokens::$castTokens; - - if ($tokens[$valuePointer]['code'] === T_CLOSURE - || $tokens[$valuePointer]['code'] === T_FN - ) { - // Check if the closure is static, if it is, override the value pointer as indices before skip static. - $staticPointer = $phpcsFile->findPrevious($ignoreTokens, ($valuePointer - 1), ($arrayStart + 1), true); - if ($staticPointer !== false && $tokens[$staticPointer]['code'] === T_STATIC) { - $valuePointer = $staticPointer; - } - } - - $previous = $phpcsFile->findPrevious($ignoreTokens, ($valuePointer - 1), ($arrayStart + 1), true); - if ($previous === false) { - $previous = $stackPtr; - } - - $previousIsWhitespace = $tokens[($valuePointer - 1)]['code'] === T_WHITESPACE; - if ($tokens[$previous]['line'] === $tokens[$valuePointer]['line']) { - $error = 'Each value in a multi-line array must be on a new line'; - if ($valuePosition === 0) { - $error = 'The first value in a multi-value array must be on a new line'; - } - - $fix = $phpcsFile->addFixableError($error, $valuePointer, 'ValueNoNewline'); - if ($fix === true) { - if ($previousIsWhitespace === true) { - $phpcsFile->fixer->replaceToken(($valuePointer - 1), $phpcsFile->eolChar); - } else { - $phpcsFile->fixer->addNewlineBefore($valuePointer); - } - } - } else if ($previousIsWhitespace === true) { - $expected = $keywordStart; - - $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 space%s but found %s'; - $data = [ - $expected, - $pluralizeSpace, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $first, 'ValueNotAligned', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent(($first - 1), str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($first - 1), str_repeat(' ', $expected)); - } - } - } - }//end if - }//end foreach - }//end if - - /* - Below the actual indentation of the array is checked. - Errors will be thrown when a key is not aligned, when - a double arrow is not aligned, and when a value is not - aligned correctly. - If an error is found in one of the above areas, then errors - are not reported for the rest of the line to avoid reporting - spaces and columns incorrectly. Often fixing the first - problem will fix the other 2 anyway. - - For example: - - $a = array( - 'index' => '2', - ); - - or - - $a = [ - 'index' => '2', - ]; - - In this array, the double arrow is indented too far, but this - will also cause an error in the value's alignment. If the arrow were - to be moved back one space however, then both errors would be fixed. - */ - - $indicesStart = ($keywordStart + 1); - foreach ($indices as $valuePosition => $index) { - $valuePointer = $index['value']; - if ($valuePointer === false) { - // Syntax error or live coding. - continue; - } - - if (isset($index['index']) === false) { - // Array value only. - continue; - } - - $indexPointer = $index['index']; - $indexLine = $tokens[$indexPointer]['line']; - - $previous = $phpcsFile->findPrevious([T_WHITESPACE, T_COMMA], ($indexPointer - 1), ($arrayStart + 1), true); - if ($previous === false) { - $previous = $stackPtr; - } - - if ($tokens[$previous]['line'] === $indexLine) { - $error = 'Each index in a multi-line array must be on a new line'; - if ($valuePosition === 0) { - $error = 'The first index in a multi-value array must be on a new line'; - } - - $fix = $phpcsFile->addFixableError($error, $indexPointer, 'IndexNoNewline'); - if ($fix === true) { - if ($tokens[($indexPointer - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($indexPointer - 1), $phpcsFile->eolChar); - } else { - $phpcsFile->fixer->addNewlineBefore($indexPointer); - } - } - - continue; - } - - if ($tokens[$indexPointer]['column'] !== $indicesStart && ($indexPointer - 1) !== $arrayStart) { - $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, - ]; - - $fix = $phpcsFile->addFixableError($error, $indexPointer, 'KeyNotAligned', $data); - if ($fix === true) { - if ($found === 0 || $tokens[($indexPointer - 1)]['code'] !== T_WHITESPACE) { - $phpcsFile->fixer->addContent(($indexPointer - 1), str_repeat(' ', $expected)); - } else { - $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'])); - $pluralizeSpace = 's'; - if ($expected === 1) { - $pluralizeSpace = ''; - } - - $error = 'Array double arrow not aligned correctly; expected %s space%s but found %s'; - $data = [ - $expected, - $pluralizeSpace, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $index['arrow'], 'DoubleArrowNotAligned', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent(($index['arrow'] - 1), str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($index['arrow'] - 1), str_repeat(' ', $expected)); - } - } - - continue; - }//end if - - $valueStart = ($arrowStart + 3); - if ($tokens[$valuePointer]['column'] !== $valueStart) { - $expected = ($valueStart - ($tokens[$index['arrow']]['length'] + $tokens[$index['arrow']]['column'])); - $found = ($tokens[$valuePointer]['column'] - ($tokens[$index['arrow']]['length'] + $tokens[$index['arrow']]['column'])); - if ($found < 0) { - $found = 'newline'; - } - - $pluralizeSpace = 's'; - if ($expected === 1) { - $pluralizeSpace = ''; - } - - $error = 'Array value not aligned correctly; expected %s space%s but found %s'; - $data = [ - $expected, - $pluralizeSpace, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $index['arrow'], 'ValueNotAligned', $data); - if ($fix === true) { - if ($found === 'newline') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($valuePointer - 1), null, true); - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $valuePointer; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken(($valuePointer - 1), str_repeat(' ', $expected)); - $phpcsFile->fixer->endChangeset(); - } else if ($found === 0) { - $phpcsFile->fixer->addContent(($valuePointer - 1), str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($valuePointer - 1), str_repeat(' ', $expected)); - } - } - }//end if - - // Check each line ends in a comma. - $valueStart = $valuePointer; - $nextComma = false; - - $end = $phpcsFile->findEndOfStatement($valueStart); - if ($end === false) { - $valueEnd = $valueStart; - } else if ($tokens[$end]['code'] === T_COMMA) { - $valueEnd = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($end - 1), $valueStart, true); - $nextComma = $end; - } else { - $valueEnd = $end; - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $arrayEnd, true); - if ($next !== false && $tokens[$next]['code'] === T_COMMA) { - $nextComma = $next; - } - } - - $valueLine = $tokens[$valueEnd]['line']; - if ($tokens[$valueEnd]['code'] === T_END_HEREDOC || $tokens[$valueEnd]['code'] === T_END_NOWDOC) { - $valueLine++; - } - - if ($nextComma === false || ($tokens[$nextComma]['line'] !== $valueLine)) { - $error = 'Each line in an array declaration must end in a comma'; - $fix = $phpcsFile->addFixableError($error, $valuePointer, 'NoComma'); - - if ($fix === true) { - // Find the end of the line and put a comma there. - for ($i = ($valuePointer + 1); $i <= $arrayEnd; $i++) { - if ($tokens[$i]['line'] > $valueLine) { - break; - } - } - - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContentBefore(($i - 1), ','); - if ($nextComma !== false) { - $phpcsFile->fixer->replaceToken($nextComma, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - // Check that there is no space before the comma. - if ($nextComma !== false && $tokens[($nextComma - 1)]['code'] === T_WHITESPACE) { - // Here/nowdoc closing tags must have the comma on the next line. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($nextComma - 1), null, true); - if ($tokens[$prev]['code'] !== T_END_HEREDOC && $tokens[$prev]['code'] !== T_END_NOWDOC) { - $content = $tokens[($nextComma - 2)]['content']; - $spaceLength = $tokens[($nextComma - 1)]['length']; - $error = 'Expected 0 spaces between "%s" and comma; %s found'; - $data = [ - $content, - $spaceLength, - ]; - - $fix = $phpcsFile->addFixableError($error, $nextComma, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextComma - 1), ''); - } - } - } - }//end foreach - - }//end processMultiLineArray() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php deleted file mode 100644 index 384a8f2b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php +++ /dev/null @@ -1,136 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDefinitionClosingBraceSpaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_CLOSE_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $next = $stackPtr; - while (true) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($next + 1), null, true); - if ($next === false) { - return; - } - - if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true - && $tokens[$next]['line'] === $tokens[$stackPtr]['line'] - ) { - // Trailing comment. - continue; - } - - break; - } - - if ($tokens[$next]['code'] !== T_CLOSE_TAG) { - $found = (($tokens[$next]['line'] - $tokens[$stackPtr]['line']) - 1); - if ($found !== 1) { - $error = 'Expected one blank line after closing brace of class definition; %s found'; - $data = [max(0, $found)]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterClose', $data); - - if ($fix === true) { - $firstOnLine = $next; - while ($tokens[$firstOnLine]['column'] !== 1) { - --$firstOnLine; - } - - if ($found < 0) { - // Next statement on same line as the closing brace. - $phpcsFile->fixer->addContentBefore($next, $phpcsFile->eolChar.$phpcsFile->eolChar); - } else if ($found === 0) { - // Next statement on next line, no blank line. - $phpcsFile->fixer->addContentBefore($firstOnLine, $phpcsFile->eolChar); - } else { - // Too many blank lines. - $phpcsFile->fixer->beginChangeset(); - for ($i = ($firstOnLine - 1); $i > $stackPtr; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContentBefore($firstOnLine, $phpcsFile->eolChar.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - }//end if - - // Ignore nested style definitions from here on. The spacing before the closing brace - // (a single blank line) will be enforced by the above check, which ensures there is a - // blank line after the last nested class. - $found = $phpcsFile->findPrevious( - T_CLOSE_CURLY_BRACKET, - ($stackPtr - 1), - $tokens[$stackPtr]['bracket_opener'] - ); - - if ($found !== false) { - return; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prev === false) { - return; - } - - if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Closing brace of class definition must be on new line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($stackPtr); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php deleted file mode 100644 index 796bbbaa..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php +++ /dev/null @@ -1,113 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDefinitionNameSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - // Syntax error or live coding, bow out. - return; - } - - // Do not check nested style definitions as, for example, in @media style rules. - $nested = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1), $tokens[$stackPtr]['bracket_closer']); - if ($nested !== false) { - return; - } - - // Find the first blank line before this opening brace, unless we get - // to another style definition, comment or the start of the file. - $endTokens = [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_OPEN_TAG => T_OPEN_TAG, - ]; - $endTokens += Tokens::$commentTokens; - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - $foundContent = false; - $currentLine = $tokens[$prev]['line']; - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - if (isset($endTokens[$tokens[$i]['code']]) === true) { - break; - } - - if ($tokens[$i]['line'] === $currentLine) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - $foundContent = true; - } - - continue; - } - - // We changed lines. - if ($foundContent === false) { - // Before we throw an error, make sure we are not looking - // at a gap before the style definition. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, $i, null, true); - if ($prev !== false - && isset($endTokens[$tokens[$prev]['code']]) === false - ) { - $error = 'Blank lines are not allowed between class names'; - $phpcsFile->addError($error, ($i + 1), 'BlankLinesFound'); - } - - break; - } - - $foundContent = false; - $currentLine = $tokens[$i]['line']; - }//end for - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php deleted file mode 100644 index 7750fa1d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php +++ /dev/null @@ -1,178 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDefinitionOpeningBraceSpaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - - if ($prevNonWhitespace !== false) { - $length = 0; - if ($tokens[$stackPtr]['line'] !== $tokens[$prevNonWhitespace]['line']) { - $length = 'newline'; - } else if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - if (strpos($tokens[($stackPtr - 1)]['content'], "\t") !== false) { - $length = 'tab'; - } else { - $length = $tokens[($stackPtr - 1)]['length']; - } - } - - if ($length === 0) { - $error = 'Expected 1 space before opening brace of class definition; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoneBefore'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - } else if ($length !== 1) { - $error = 'Expected 1 space before opening brace of class definition; %s found'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($stackPtr - 1); $i > $prevNonWhitespace; $i--) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - if ($tokens[$nextNonEmpty]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Opening brace should be the last content on the line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBefore'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($stackPtr); - - // Remove potentially left over trailing whitespace. - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - // Syntax error or live coding, bow out. - return; - } - - // Check for nested class definitions. - $found = $phpcsFile->findNext( - T_OPEN_CURLY_BRACKET, - ($stackPtr + 1), - $tokens[$stackPtr]['bracket_closer'] - ); - - if ($found === false) { - // Not nested. - return; - } - - $lastOnLine = $stackPtr; - for ($lastOnLine; $lastOnLine < $tokens[$stackPtr]['bracket_closer']; $lastOnLine++) { - if ($tokens[$lastOnLine]['line'] !== $tokens[($lastOnLine + 1)]['line']) { - break; - } - } - - $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($lastOnLine + 1), null, true); - if ($nextNonWhiteSpace === false) { - return; - } - - $foundLines = ($tokens[$nextNonWhiteSpace]['line'] - $tokens[$stackPtr]['line'] - 1); - if ($foundLines !== 1) { - $error = 'Expected 1 blank line after opening brace of nesting class definition; %s found'; - $data = [max(0, $foundLines)]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'AfterNesting', $data); - - if ($fix === true) { - $firstOnNextLine = $nextNonWhiteSpace; - while ($tokens[$firstOnNextLine]['column'] !== 1) { - --$firstOnNextLine; - } - - if ($found < 0) { - // First statement on same line as the opening brace. - $phpcsFile->fixer->addContentBefore($nextNonWhiteSpace, $phpcsFile->eolChar.$phpcsFile->eolChar); - } else if ($found === 0) { - // Next statement on next line, no blank line. - $phpcsFile->fixer->addNewlineBefore($firstOnNextLine); - } else { - // Too many blank lines. - $phpcsFile->fixer->beginChangeset(); - for ($i = ($firstOnNextLine - 1); $i > $stackPtr; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContentBefore($firstOnNextLine, $phpcsFile->eolChar.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php deleted file mode 100644 index 6459e035..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php +++ /dev/null @@ -1,109 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ColonSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_COLON]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] !== T_STYLE) { - // The colon is not part of a style definition. - return; - } - - if ($tokens[$prev]['content'] === 'progid') { - // Special case for IE filters. - return; - } - - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $error = 'There must be no space before a colon in a style definition'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); - } - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON || $tokens[$next]['code'] === T_STYLE) { - // Empty style definition, ignore it. - return; - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after colon in style definition; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoneAfter'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } else { - $content = $tokens[($stackPtr + 1)]['content']; - if (strpos($content, $phpcsFile->eolChar) === false) { - $length = strlen($content); - if ($length !== 1) { - $error = 'Expected 1 space after colon in style definition; %s found'; - $data = [$length]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'After', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } else { - $error = 'Expected 1 space after colon in style definition; newline found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'AfterNewline'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php deleted file mode 100644 index 5114a0cb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ColourDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_COLOUR]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $colour = $tokens[$stackPtr]['content']; - - $expected = strtoupper($colour); - if ($colour !== $expected) { - $error = 'CSS colours must be defined in uppercase; expected %s but found %s'; - $data = [ - $expected, - $colour, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotUpper', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $expected); - } - } - - // Now check if shorthand can be used. - if (strlen($colour) !== 7) { - return; - } - - if ($colour[1] === $colour[2] && $colour[3] === $colour[4] && $colour[5] === $colour[6]) { - $expected = '#'.$colour[1].$colour[3].$colour[5]; - $error = 'CSS colours must use shorthand if available; expected %s but found %s'; - $data = [ - $expected, - $colour, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Shorthand', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $expected); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php deleted file mode 100644 index 72448a30..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowMultipleStyleDefinitionsSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var string[] - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $next = $phpcsFile->findNext(T_STYLE, ($stackPtr + 1)); - if ($next === false) { - return; - } - - if ($tokens[$next]['content'] === 'progid') { - // Special case for IE filters. - return; - } - - if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Each style definition must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $next, 'Found'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($next); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php deleted file mode 100644 index 82a974c8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class DuplicateClassDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Find the content of each class definition name. - $classNames = []; - $next = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1)); - if ($next === false) { - // No class definitions in the file. - return; - } - - // Save the class names in a "scope", - // to prevent false positives with @media blocks. - $scope = 'main'; - - $find = [ - T_CLOSE_CURLY_BRACKET, - T_OPEN_CURLY_BRACKET, - T_OPEN_TAG, - ]; - - while ($next !== false) { - $prev = $phpcsFile->findPrevious($find, ($next - 1)); - - // Check if an inner block was closed. - $beforePrev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - if ($beforePrev !== false - && $tokens[$beforePrev]['code'] === T_CLOSE_CURLY_BRACKET - ) { - $scope = 'main'; - } - - // Create a sorted name for the class so we can compare classes - // even when the individual names are all over the place. - $name = ''; - for ($i = ($prev + 1); $i < $next; $i++) { - $name .= $tokens[$i]['content']; - } - - $name = trim($name); - $name = str_replace("\n", ' ', $name); - $name = preg_replace('|[\s]+|', ' ', $name); - $name = preg_replace('|\s*/\*.*\*/\s*|', '', $name); - $name = str_replace(', ', ',', $name); - - $names = explode(',', $name); - sort($names); - $name = implode(',', $names); - - if ($name[0] === '@') { - // Media block has its own "scope". - $scope = $name; - } else if (isset($classNames[$scope][$name]) === true) { - $first = $classNames[$scope][$name]; - $error = 'Duplicate class definition found; first defined on line %s'; - $data = [$tokens[$first]['line']]; - $phpcsFile->addError($error, $next, 'Found', $data); - } else { - $classNames[$scope][$name] = $next; - } - - $next = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($next + 1)); - }//end while - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php deleted file mode 100644 index e9221470..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DuplicateStyleDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - // Syntax error or live coding, bow out. - return; - } - - // Find the content of each style definition name. - $styleNames = []; - - $next = $stackPtr; - $end = $tokens[$stackPtr]['bracket_closer']; - - do { - $next = $phpcsFile->findNext([T_STYLE, T_OPEN_CURLY_BRACKET], ($next + 1), $end); - if ($next === false) { - // Class definition is empty. - break; - } - - if ($tokens[$next]['code'] === T_OPEN_CURLY_BRACKET) { - $next = $tokens[$next]['bracket_closer']; - continue; - } - - $name = $tokens[$next]['content']; - if (isset($styleNames[$name]) === true) { - $first = $styleNames[$name]; - $error = 'Duplicate style definition found; first defined on line %s'; - $data = [$tokens[$first]['line']]; - $phpcsFile->addError($error, $next, 'Found', $data); - } else { - $styleNames[$name] = $next; - } - } while ($next !== false); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php deleted file mode 100644 index b7671d3e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class EmptyClassDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($next === false || $tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { - $error = 'Class definition is empty'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php deleted file mode 100644 index cc3007f2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class EmptyStyleDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $ignore = Tokens::$emptyTokens; - $ignore[] = T_COLON; - - $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); - if ($next === false || $tokens[$next]['code'] === T_SEMICOLON || $tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - $error = 'Style definition is empty'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php deleted file mode 100644 index 982f4697..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php +++ /dev/null @@ -1,179 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ForbiddenStylesSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * A list of forbidden styles with their alternatives. - * - * The value is NULL if no alternative exists. i.e., the - * style should just not be used. - * - * @var array - */ - protected $forbiddenStyles = [ - '-moz-border-radius' => 'border-radius', - '-webkit-border-radius' => 'border-radius', - '-moz-border-radius-topleft' => 'border-top-left-radius', - '-moz-border-radius-topright' => 'border-top-right-radius', - '-moz-border-radius-bottomright' => 'border-bottom-right-radius', - '-moz-border-radius-bottomleft' => 'border-bottom-left-radius', - '-moz-box-shadow' => 'box-shadow', - '-webkit-box-shadow' => 'box-shadow', - ]; - - /** - * A cache of forbidden style names, for faster lookups. - * - * @var string[] - */ - protected $forbiddenStyleNames = []; - - /** - * If true, forbidden styles will be considered regular expressions. - * - * @var boolean - */ - protected $patternMatch = false; - - /** - * If true, an error will be thrown; otherwise a warning. - * - * @var boolean - */ - public $error = true; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $this->forbiddenStyleNames = array_keys($this->forbiddenStyles); - - if ($this->patternMatch === true) { - foreach ($this->forbiddenStyleNames as $i => $name) { - $this->forbiddenStyleNames[$i] = '/'.$name.'/i'; - } - } - - return [T_STYLE]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $style = strtolower($tokens[$stackPtr]['content']); - $pattern = null; - - if ($this->patternMatch === true) { - $count = 0; - $pattern = preg_replace( - $this->forbiddenStyleNames, - $this->forbiddenStyleNames, - $style, - 1, - $count - ); - - if ($count === 0) { - return; - } - - // Remove the pattern delimiters and modifier. - $pattern = substr($pattern, 1, -2); - } else { - if (in_array($style, $this->forbiddenStyleNames, true) === false) { - return; - } - }//end if - - $this->addError($phpcsFile, $stackPtr, $style, $pattern); - - }//end process() - - - /** - * Generates the error or warning for this sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the forbidden style - * in the token array. - * @param string $style The name of the forbidden style. - * @param string $pattern The pattern used for the match. - * - * @return void - */ - protected function addError($phpcsFile, $stackPtr, $style, $pattern=null) - { - $data = [$style]; - $error = 'The use of style %s is '; - if ($this->error === true) { - $type = 'Found'; - $error .= 'forbidden'; - } else { - $type = 'Discouraged'; - $error .= 'discouraged'; - } - - if ($pattern === null) { - $pattern = $style; - } - - if ($this->forbiddenStyles[$pattern] !== null) { - $data[] = $this->forbiddenStyles[$pattern]; - if ($this->error === true) { - $fix = $phpcsFile->addFixableError($error.'; use %s instead', $stackPtr, $type.'WithAlternative', $data); - } else { - $fix = $phpcsFile->addFixableWarning($error.'; use %s instead', $stackPtr, $type.'WithAlternative', $data); - } - - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $this->forbiddenStyles[$pattern]); - } - } else { - if ($this->error === true) { - $phpcsFile->addError($error, $stackPtr, $type, $data); - } else { - $phpcsFile->addWarning($error, $stackPtr, $type, $data); - } - } - - }//end addError() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php deleted file mode 100644 index 56406ccb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php +++ /dev/null @@ -1,152 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class IndentationSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $numTokens = (count($tokens) - 2); - $indentLevel = 0; - $nestingLevel = 0; - for ($i = 1; $i < $numTokens; $i++) { - if ($tokens[$i]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true - ) { - // Don't check the indent of comments. - continue; - } - - if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { - $indentLevel++; - - if (isset($tokens[$i]['bracket_closer']) === false) { - // Syntax error or live coding. - // Anything after this would receive incorrect fixes, so bow out. - return; - } - - // Check for nested class definitions. - $found = $phpcsFile->findNext( - T_OPEN_CURLY_BRACKET, - ($i + 1), - $tokens[$i]['bracket_closer'] - ); - - if ($found !== false) { - $nestingLevel = $indentLevel; - } - } - - if (($tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET - && $tokens[$i]['line'] !== $tokens[($i - 1)]['line']) - || ($tokens[($i + 1)]['code'] === T_CLOSE_CURLY_BRACKET - && $tokens[$i]['line'] === $tokens[($i + 1)]['line']) - ) { - $indentLevel--; - if ($indentLevel === 0) { - $nestingLevel = 0; - } - } - - if ($tokens[$i]['column'] !== 1 - || $tokens[$i]['code'] === T_OPEN_CURLY_BRACKET - || $tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET - ) { - continue; - } - - // We started a new line, so check indent. - if ($tokens[$i]['code'] === T_WHITESPACE) { - $content = str_replace($phpcsFile->eolChar, '', $tokens[$i]['content']); - $foundIndent = strlen($content); - } else { - $foundIndent = 0; - } - - $expectedIndent = ($indentLevel * $this->indent); - if ($expectedIndent > 0 - && strpos($tokens[$i]['content'], $phpcsFile->eolChar) !== false - ) { - if ($nestingLevel !== $indentLevel) { - $error = 'Blank lines are not allowed in class definitions'; - $fix = $phpcsFile->addFixableError($error, $i, 'BlankLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } else if ($foundIndent !== $expectedIndent) { - $error = 'Line indented incorrectly; expected %s spaces, found %s'; - $data = [ - $expectedIndent, - $foundIndent, - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'Incorrect', $data); - if ($fix === true) { - $indent = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $indent); - } else { - $phpcsFile->fixer->replaceToken($i, $indent); - } - } - }//end if - }//end for - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php deleted file mode 100644 index c8393c51..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php +++ /dev/null @@ -1,99 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class LowercaseStyleDefinitionSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $start = ($stackPtr + 1); - $end = ($tokens[$stackPtr]['bracket_closer'] - 1); - $inStyle = null; - - for ($i = $start; $i <= $end; $i++) { - // Skip nested definitions as they are checked individually. - if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { - $i = $tokens[$i]['bracket_closer']; - continue; - } - - if ($tokens[$i]['code'] === T_STYLE) { - $inStyle = $tokens[$i]['content']; - } - - if ($tokens[$i]['code'] === T_SEMICOLON) { - $inStyle = null; - } - - if ($inStyle === 'progid') { - // Special case for IE filters. - continue; - } - - if ($tokens[$i]['code'] === T_STYLE - || ($inStyle !== null - && $tokens[$i]['code'] === T_STRING) - ) { - $expected = strtolower($tokens[$i]['content']); - if ($expected !== $tokens[$i]['content']) { - $error = 'Style definitions must be lowercase; expected %s but found %s'; - $data = [ - $expected, - $tokens[$i]['content'], - ]; - - $fix = $phpcsFile->addFixableError($error, $i, 'FoundUpper', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, $expected); - } - } - } - }//end for - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php deleted file mode 100644 index 83f2a6c8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php +++ /dev/null @@ -1,93 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class MissingColonSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['bracket_closer']) === false) { - // Syntax error or live coding, bow out. - return; - } - - $lastLine = $tokens[$stackPtr]['line']; - $end = $tokens[$stackPtr]['bracket_closer']; - - // Do not check nested style definitions as, for example, in @media style rules. - $nested = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, ($stackPtr + 1), $end); - if ($nested !== false) { - return; - } - - $foundColon = false; - $foundString = false; - for ($i = ($stackPtr + 1); $i <= $end; $i++) { - if ($tokens[$i]['line'] !== $lastLine) { - // We changed lines. - if ($foundColon === false && $foundString !== false) { - // We didn't find a colon on the previous line. - $error = 'No style definition found on line; check for missing colon'; - $phpcsFile->addError($error, $foundString, 'Found'); - } - - $foundColon = false; - $foundString = false; - $lastLine = $tokens[$i]['line']; - } - - if ($tokens[$i]['code'] === T_STRING) { - $foundString = $i; - } else if ($tokens[$i]['code'] === T_COLON) { - $foundColon = $i; - } - }//end for - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php deleted file mode 100644 index 586b4730..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php +++ /dev/null @@ -1,95 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class NamedColoursSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * A list of named colours. - * - * This is the list of standard colours defined in the CSS specification. - * - * @var array - */ - protected $colourNames = [ - 'aqua' => 'aqua', - 'black' => 'black', - 'blue' => 'blue', - 'fuchsia' => 'fuchsia', - 'gray' => 'gray', - 'green' => 'green', - 'lime' => 'lime', - 'maroon' => 'maroon', - 'navy' => 'navy', - 'olive' => 'olive', - 'orange' => 'orange', - 'purple' => 'purple', - 'red' => 'red', - 'silver' => 'silver', - 'teal' => 'teal', - 'white' => 'white', - 'yellow' => 'yellow', - ]; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_STRING]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[($stackPtr - 1)]['code'] === T_HASH - || $tokens[($stackPtr - 1)]['code'] === T_STRING_CONCAT - ) { - // Class name. - return; - } - - if (isset($this->colourNames[strtolower($tokens[$stackPtr]['content'])]) === true) { - $error = 'Named colours are forbidden; use hex, rgb, or rgba values instead'; - $phpcsFile->addError($error, $stackPtr, 'Forbidden'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php deleted file mode 100644 index 0c1c553a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OpacitySniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['content'] !== 'opacity') { - return; - } - - $ignore = Tokens::$emptyTokens; - $ignore[] = T_COLON; - - $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); - - if ($next === false - || ($tokens[$next]['code'] !== T_DNUMBER - && $tokens[$next]['code'] !== T_LNUMBER) - ) { - return; - } - - $value = $tokens[$next]['content']; - if ($tokens[$next]['code'] === T_LNUMBER) { - if ($value !== '0' && $value !== '1') { - $error = 'Opacity values must be between 0 and 1'; - $phpcsFile->addError($error, $next, 'Invalid'); - } - } else { - if (strlen($value) > 3) { - $error = 'Opacity values must have a single value after the decimal point'; - $phpcsFile->addError($error, $next, 'DecimalPrecision'); - } else if ($value === '0.0' || $value === '1.0') { - $error = 'Opacity value does not require decimal point; use %s instead'; - $data = [$value[0]]; - $fix = $phpcsFile->addFixableError($error, $next, 'PointNotRequired', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($next, $value[0]); - } - } else if ($value[0] === '.') { - $error = 'Opacity values must not start with a decimal point; use 0%s instead'; - $data = [$value]; - $fix = $phpcsFile->addFixableError($error, $next, 'StartWithPoint', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($next, '0'.$value); - } - } else if ($value[0] !== '0') { - $error = 'Opacity values must be between 0 and 1'; - $phpcsFile->addError($error, $next, 'Invalid'); - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php deleted file mode 100644 index 9030468b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SemicolonSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $nextStatement = $phpcsFile->findNext([T_STYLE, T_CLOSE_CURLY_BRACKET], ($stackPtr + 1)); - if ($nextStatement === false) { - return; - } - - $ignore = Tokens::$emptyTokens; - if ($tokens[$nextStatement]['code'] === T_STYLE) { - // Allow for star-prefix hack. - $ignore[] = T_MULTIPLY; - } - - $endOfThisStatement = $phpcsFile->findPrevious($ignore, ($nextStatement - 1), null, true); - if ($tokens[$endOfThisStatement]['code'] !== T_SEMICOLON) { - $error = 'Style definitions must end with a semicolon'; - $phpcsFile->addError($error, $endOfThisStatement, 'NotAtEnd'); - return; - } - - if ($tokens[($endOfThisStatement - 1)]['code'] !== T_WHITESPACE) { - return; - } - - // There is a semicolon, so now find the last token in the statement. - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($endOfThisStatement - 1), null, true); - $found = $tokens[($endOfThisStatement - 1)]['length']; - if ($tokens[$prevNonEmpty]['line'] !== $tokens[$endOfThisStatement]['line']) { - $found = 'newline'; - } - - $error = 'Expected 0 spaces before semicolon in style definition; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $prevNonEmpty, 'SpaceFound', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($prevNonEmpty, ';'); - $phpcsFile->fixer->replaceToken($endOfThisStatement, ''); - - for ($i = ($endOfThisStatement - 1); $i > $prevNonEmpty; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php deleted file mode 100644 index 76e7330c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php +++ /dev/null @@ -1,183 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ShorthandSizeSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['CSS']; - - /** - * A list of styles that we shouldn't check. - * - * These have values that looks like sizes, but are not. - * - * @var array - */ - protected $excludeStyles = [ - 'background-position' => 'background-position', - 'box-shadow' => 'box-shadow', - 'transform-origin' => 'transform-origin', - '-webkit-transform-origin' => '-webkit-transform-origin', - '-ms-transform-origin' => '-ms-transform-origin', - ]; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_STYLE]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Some styles look like shorthand but are not actually a set of 4 sizes. - $style = strtolower($tokens[$stackPtr]['content']); - if (isset($this->excludeStyles[$style]) === true) { - return; - } - - $end = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1)); - if ($end === false) { - // Live coding or parse error. - return; - } - - // Get the whole style content. - $origContent = $phpcsFile->getTokensAsString(($stackPtr + 1), ($end - $stackPtr - 1)); - $origContent = trim($origContent, ':'); - $origContent = trim($origContent); - - // Account for a !important annotation. - $content = $origContent; - if (substr($content, -10) === '!important') { - $content = substr($content, 0, -10); - $content = trim($content); - } - - // Check if this style value is a set of numbers with optional prefixes. - $content = preg_replace('/\s+/', ' ', $content); - $values = []; - $num = preg_match_all( - '/(?:[0-9]+)(?:[a-zA-Z]{2}\s+|%\s+|\s+)/', - $content.' ', - $values, - PREG_SET_ORDER - ); - - // Only interested in styles that have multiple sizes defined. - if ($num < 2) { - return; - } - - // Rebuild the content we matched to ensure we got everything. - $matched = ''; - foreach ($values as $value) { - $matched .= $value[0]; - } - - if ($content !== trim($matched)) { - return; - } - - if ($num === 3) { - $expected = trim($content.' '.$values[1][0]); - $error = 'Shorthand syntax not allowed here; use %s instead'; - $data = [$expected]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAllowed', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if (substr($origContent, -10) === '!important') { - $expected .= ' !important'; - } - - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 2), null, true); - $phpcsFile->fixer->replaceToken($next, $expected); - for ($next++; $next < $end; $next++) { - $phpcsFile->fixer->replaceToken($next, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - }//end if - - if ($num === 2) { - if ($values[0][0] !== $values[1][0]) { - // Both values are different, so it is already shorthand. - return; - } - } else if ($values[0][0] !== $values[2][0] || $values[1][0] !== $values[3][0]) { - // Can't shorthand this. - return; - } - - if ($values[0][0] === $values[1][0]) { - // All values are the same. - $expected = trim($values[0][0]); - } else { - $expected = trim($values[0][0]).' '.trim($values[1][0]); - } - - $error = 'Size definitions must use shorthand if available; expected "%s" but found "%s"'; - $data = [ - $expected, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotUsed', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if (substr($origContent, -10) === '!important') { - $expected .= ' !important'; - } - - $next = $phpcsFile->findNext(T_COLON, ($stackPtr + 1)); - $phpcsFile->fixer->addContent($next, ' '.$expected); - for ($next++; $next < $end; $next++) { - $phpcsFile->fixer->replaceToken($next, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php deleted file mode 100644 index 3f5e1fbc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php +++ /dev/null @@ -1,207 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff as PSR2ClassDeclarationSniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClassDeclarationSniff extends PSR2ClassDeclarationSniff -{ - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - // We want all the errors from the PSR2 standard, plus some of our own. - parent::process($phpcsFile, $stackPtr); - - // Check that this is the only class or interface in the file. - $nextClass = $phpcsFile->findNext([T_CLASS, T_INTERFACE], ($stackPtr + 1)); - if ($nextClass !== false) { - // We have another, so an error is thrown. - $error = 'Only one interface or class is allowed in a file'; - $phpcsFile->addError($error, $nextClass, 'MultipleClasses'); - } - - }//end process() - - - /** - * Processes the opening section of a class declaration. - * - * @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 processOpen(File $phpcsFile, $stackPtr) - { - parent::processOpen($phpcsFile, $stackPtr); - - $tokens = $phpcsFile->getTokens(); - - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $prevContent = $tokens[($stackPtr - 1)]['content']; - if ($prevContent !== $phpcsFile->eolChar) { - $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); - $spaces = strlen($blankSpace); - - 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']); - $error = 'Expected 0 spaces before %s keyword; %s found'; - $data = [ - $type, - $spaces, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeKeyword', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); - } - } - } - }//end if - }//end if - - }//end processOpen() - - - /** - * Processes the closing section of a class declaration. - * - * @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 processClose(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $closeBrace = $tokens[$stackPtr]['scope_closer']; - - // Check that the closing brace has one blank line after it. - for ($nextContent = ($closeBrace + 1); $nextContent < $phpcsFile->numTokens; $nextContent++) { - // Ignore comments on the same line as the brace. - if ($tokens[$nextContent]['line'] === $tokens[$closeBrace]['line'] - && ($tokens[$nextContent]['code'] === T_WHITESPACE - || $tokens[$nextContent]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$nextContent]['code']]) === true) - ) { - continue; - } - - if ($tokens[$nextContent]['code'] !== T_WHITESPACE) { - break; - } - } - - if ($nextContent === $phpcsFile->numTokens) { - // Ignore the line check as this is the very end of the file. - $difference = 1; - } else { - $difference = ($tokens[$nextContent]['line'] - $tokens[$closeBrace]['line'] - 1); - } - - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), $stackPtr, true); - - if ($difference === -1 - || $tokens[$lastContent]['line'] === $tokens[$closeBrace]['line'] - ) { - $error = 'Closing %s brace must be on a line by itself'; - $data = [$tokens[$stackPtr]['content']]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'CloseBraceSameLine', $data); - if ($fix === true) { - if ($difference === -1) { - $phpcsFile->fixer->addNewlineBefore($nextContent); - } - - if ($tokens[$lastContent]['line'] === $tokens[$closeBrace]['line']) { - $phpcsFile->fixer->addNewlineBefore($closeBrace); - } - } - } else if ($tokens[($closeBrace - 1)]['code'] === T_WHITESPACE) { - $prevContent = $tokens[($closeBrace - 1)]['content']; - if ($prevContent !== $phpcsFile->eolChar) { - $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar)); - $spaces = strlen($blankSpace); - if ($spaces !== 0) { - if ($tokens[($closeBrace - 1)]['line'] !== $tokens[$closeBrace]['line']) { - $error = 'Expected 0 spaces before closing brace; newline found'; - $phpcsFile->addError($error, $closeBrace, 'NewLineBeforeCloseBrace'); - } else { - $error = 'Expected 0 spaces before closing brace; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpaceBeforeCloseBrace', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closeBrace - 1), ''); - } - } - } - } - }//end if - - if ($difference !== -1 && $difference !== 1) { - if ($tokens[$nextContent]['code'] === T_DOC_COMMENT_OPEN_TAG) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($tokens[$nextContent]['comment_closer'] + 1), null, true); - if ($next !== false && $tokens[$next]['code'] === T_FUNCTION) { - return; - } - } - - $error = 'Closing brace of a %s must be followed by a single blank line; found %s'; - $data = [ - $tokens[$stackPtr]['content'], - $difference, - ]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'NewlinesAfterCloseBrace', $data); - if ($fix === true) { - if ($difference === 0) { - $first = $phpcsFile->findFirstOnLine([], $nextContent, true); - $phpcsFile->fixer->addNewlineBefore($first); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closeBrace + 1); $i < $nextContent; $i++) { - if ($tokens[$i]['line'] <= ($tokens[$closeBrace]['line'] + 1)) { - continue; - } else if ($tokens[$i]['line'] === $tokens[$nextContent]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end processClose() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php deleted file mode 100644 index fc3ec047..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ClassFileNameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $fullPath = basename($phpcsFile->getFilename()); - $fileName = substr($fullPath, 0, strrpos($fullPath, '.')); - if ($fileName === '') { - // No filename probably means STDIN, so we can't do this check. - return; - } - - $tokens = $phpcsFile->getTokens(); - $decName = $phpcsFile->findNext(T_STRING, $stackPtr); - - if ($tokens[$decName]['content'] !== $fileName) { - $error = '%s name doesn\'t match filename; expected "%s %s"'; - $data = [ - ucfirst($tokens[$stackPtr]['content']), - $tokens[$stackPtr]['content'], - $fileName, - ]; - $phpcsFile->addError($error, $stackPtr, 'NoMatch', $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php deleted file mode 100644 index 12d8a245..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DuplicatePropertySniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OBJECT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being processed. - * @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(); - - $properties = []; - $wantedTokens = [ - T_PROPERTY, - T_OBJECT, - ]; - - $next = $phpcsFile->findNext($wantedTokens, ($stackPtr + 1), $tokens[$stackPtr]['bracket_closer']); - while ($next !== false && $next < $tokens[$stackPtr]['bracket_closer']) { - if ($tokens[$next]['code'] === T_OBJECT) { - // Skip nested objects. - $next = $tokens[$next]['bracket_closer']; - } else { - $propName = $tokens[$next]['content']; - if (isset($properties[$propName]) === true) { - $error = 'Duplicate property definition found for "%s"; previously defined on line %s'; - $data = [ - $propName, - $tokens[$properties[$propName]]['line'], - ]; - $phpcsFile->addError($error, $next, 'Found', $data); - } - - $properties[$propName] = $next; - }//end if - - $next = $phpcsFile->findNext($wantedTokens, ($next + 1), $tokens[$stackPtr]['bracket_closer']); - }//end while - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php deleted file mode 100644 index b9d71db0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class LowercaseClassKeywordsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $targets = Tokens::$ooScopeTokens; - $targets[] = T_EXTENDS; - $targets[] = T_IMPLEMENTS; - $targets[] = T_ABSTRACT; - $targets[] = T_FINAL; - $targets[] = T_READONLY; - $targets[] = T_VAR; - $targets[] = T_CONST; - - return $targets; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 ($content !== $contentLc) { - $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - strtoupper($content), - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php deleted file mode 100644 index 4c54aa46..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php +++ /dev/null @@ -1,240 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Tokens; - -class SelfMemberReferenceSniff extends AbstractScopeSniff -{ - - - /** - * Constructs a Squiz_Sniffs_Classes_SelfMemberReferenceSniff. - */ - public function __construct() - { - parent::__construct([T_CLASS], [T_DOUBLE_COLON]); - - }//end __construct() - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * @param int $currScope The current scope opener token. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a double colon which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - $conditions = array_reverse($conditions, true); - foreach ($conditions as $conditionToken => $tokenCode) { - if ($tokenCode === T_CLASS || $tokenCode === T_ANON_CLASS || $tokenCode === T_CLOSURE) { - break; - } - } - - if ($conditionToken !== $currScope) { - return; - } - - $calledClassName = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($calledClassName === false) { - // Parse error. - return; - } - - if ($tokens[$calledClassName]['code'] === T_SELF) { - if ($tokens[$calledClassName]['content'] !== 'self') { - $error = 'Must use "self::" for local static member reference; found "%s::"'; - $data = [$tokens[$calledClassName]['content']]; - $fix = $phpcsFile->addFixableError($error, $calledClassName, 'IncorrectCase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($calledClassName, 'self'); - } - - return; - } - } else if ($tokens[$calledClassName]['code'] === T_STRING) { - // If the class is called with a namespace prefix, build fully qualified - // namespace calls for both current scope class and requested class. - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($calledClassName - 1), null, true); - if ($prevNonEmpty !== false && $tokens[$prevNonEmpty]['code'] === T_NS_SEPARATOR) { - $declarationName = $this->getDeclarationNameWithNamespace($tokens, $calledClassName); - $declarationName = ltrim($declarationName, '\\'); - $fullQualifiedClassName = $this->getNamespaceOfScope($phpcsFile, $currScope); - if ($fullQualifiedClassName === '\\') { - $fullQualifiedClassName = ''; - } else { - $fullQualifiedClassName .= '\\'; - } - - $fullQualifiedClassName .= $phpcsFile->getDeclarationName($currScope); - } else { - $declarationName = $phpcsFile->getDeclarationName($currScope); - $fullQualifiedClassName = $tokens[$calledClassName]['content']; - } - - if ($declarationName === $fullQualifiedClassName) { - // Class name is the same as the current class, which is not allowed. - $error = 'Must use "self::" for local static member reference'; - $fix = $phpcsFile->addFixableError($error, $calledClassName, 'NotUsed'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $currentPointer = ($stackPtr - 1); - while ($tokens[$currentPointer]['code'] === T_NS_SEPARATOR - || $tokens[$currentPointer]['code'] === T_STRING - || isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true - ) { - if (isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true) { - --$currentPointer; - continue; - } - - $phpcsFile->fixer->replaceToken($currentPointer, ''); - --$currentPointer; - } - - $phpcsFile->fixer->replaceToken($stackPtr, 'self::'); - $phpcsFile->fixer->endChangeset(); - - // Fix potential whitespace issues in the next loop. - return; - }//end if - }//end if - }//end if - - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($stackPtr - 1)]['length']; - $error = 'Expected 0 spaces before double colon; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, ($stackPtr - 1), 'SpaceBefore', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($stackPtr - 1); $tokens[$i]['code'] === T_WHITESPACE; $i--) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $found = $tokens[($stackPtr + 1)]['length']; - $error = 'Expected 0 spaces after double colon; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, ($stackPtr - 1), 'SpaceAfter', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($stackPtr + 1); $tokens[$i]['code'] === T_WHITESPACE; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - }//end processTokenWithinScope() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - - /** - * Returns the declaration names for classes/interfaces/functions with a namespace. - * - * @param array $tokens Token stack for this file. - * @param int $stackPtr The position where the namespace building will start. - * - * @return string - */ - protected function getDeclarationNameWithNamespace(array $tokens, $stackPtr) - { - $nameParts = []; - $currentPointer = $stackPtr; - while ($tokens[$currentPointer]['code'] === T_NS_SEPARATOR - || $tokens[$currentPointer]['code'] === T_STRING - || isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true - ) { - if (isset(Tokens::$emptyTokens[$tokens[$currentPointer]['code']]) === true) { - --$currentPointer; - continue; - } - - $nameParts[] = $tokens[$currentPointer]['content']; - --$currentPointer; - } - - $nameParts = array_reverse($nameParts); - return implode('', $nameParts); - - }//end getDeclarationNameWithNamespace() - - - /** - * Returns the namespace declaration of a file. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the search for the - * namespace declaration will start. - * - * @return string - */ - protected function getNamespaceOfScope(File $phpcsFile, $stackPtr) - { - $namespace = '\\'; - $namespaceDeclaration = $phpcsFile->findPrevious(T_NAMESPACE, $stackPtr); - - if ($namespaceDeclaration !== false) { - $endOfNamespaceDeclaration = $phpcsFile->findNext([T_SEMICOLON, T_OPEN_CURLY_BRACKET, T_CLOSE_TAG], $namespaceDeclaration); - $namespace = $this->getDeclarationNameWithNamespace( - $phpcsFile->getTokens(), - ($endOfNamespaceDeclaration - 1) - ); - } - - return $namespace; - - }//end getNamespaceOfScope() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php deleted file mode 100644 index a8975353..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class ValidClassNameSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being processed. - * @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(); - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - $error = 'Possible parse error: %s missing opening or closing brace'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $data); - return; - } - - // Determine the name of the class or interface. Note that we cannot - // simply look for the first T_STRING because a class name - // starting with the number will be multiple tokens. - $opener = $tokens[$stackPtr]['scope_opener']; - $nameStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), $opener, true); - $nameEnd = $phpcsFile->findNext([T_WHITESPACE, T_COLON], $nameStart, $opener); - if ($nameEnd === false) { - $name = $tokens[$nameStart]['content']; - } else { - $name = trim($phpcsFile->getTokensAsString($nameStart, ($nameEnd - $nameStart))); - } - - // Check for PascalCase format. - $valid = Common::isCamelCaps($name, true, true, false); - if ($valid === false) { - $type = ucfirst($tokens[$stackPtr]['content']); - $error = '%s name "%s" is not in PascalCase format'; - $data = [ - $type, - $name, - ]; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); - $phpcsFile->recordMetric($stackPtr, 'PascalCase class name', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'PascalCase class name', 'yes'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php deleted file mode 100644 index 9a565123..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php +++ /dev/null @@ -1,401 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 BlockCommentSniff implements Sniff -{ - - /** - * The --tab-width CLI value that is being used. - * - * @var integer - */ - private $tabWidth = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_COMMENT, - T_DOC_COMMENT_OPEN_TAG, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current 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) - { - if ($this->tabWidth === null) { - if (isset($phpcsFile->config->tabWidth) === false || $phpcsFile->config->tabWidth === 0) { - // We have no idea how wide tabs are, so assume 4 spaces for fixing. - $this->tabWidth = 4; - } else { - $this->tabWidth = $phpcsFile->config->tabWidth; - } - } - - $tokens = $phpcsFile->getTokens(); - - // If it's an inline comment, return. - if (substr($tokens[$stackPtr]['content'], 0, 2) !== '/*') { - return; - } - - // If this is a function/class/interface doc block comment, skip it. - // We are only interested in inline doc block comments. - if ($tokens[$stackPtr]['code'] === T_DOC_COMMENT_OPEN_TAG) { - $nextToken = $stackPtr; - do { - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] === T_ATTRIBUTE) { - $nextToken = $tokens[$nextToken]['attribute_closer']; - continue; - } - - break; - } while (true); - - $ignore = [ - T_CLASS => true, - T_INTERFACE => true, - T_TRAIT => true, - T_ENUM => true, - T_FUNCTION => true, - T_PUBLIC => true, - T_PRIVATE => true, - T_FINAL => true, - T_PROTECTED => true, - T_STATIC => true, - T_ABSTRACT => true, - T_CONST => true, - T_VAR => true, - T_READONLY => true, - ]; - if (isset($ignore[$tokens[$nextToken]['code']]) === true) { - return; - } - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prevToken]['code'] === T_OPEN_TAG) { - return; - } - - $error = 'Block comments must be started with /*'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStart'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, '/*'); - } - - $end = $tokens[$stackPtr]['comment_closer']; - if ($tokens[$end]['content'] !== '*/') { - $error = 'Block comments must be ended with */'; - $fix = $phpcsFile->addFixableError($error, $end, 'WrongEnd'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($end, '*/'); - } - } - - return; - }//end if - - $commentLines = [$stackPtr]; - $nextComment = $stackPtr; - $lastLine = $tokens[$stackPtr]['line']; - $commentString = $tokens[$stackPtr]['content']; - - // Construct the comment into an array. - while (($nextComment = $phpcsFile->findNext(T_WHITESPACE, ($nextComment + 1), null, true)) !== false) { - if ($tokens[$nextComment]['code'] !== $tokens[$stackPtr]['code'] - && isset(Tokens::$phpcsCommentTokens[$tokens[$nextComment]['code']]) === false - ) { - // Found the next bit of code. - break; - } - - if (($tokens[$nextComment]['line'] - 1) !== $lastLine) { - // Not part of the block. - break; - } - - $lastLine = $tokens[$nextComment]['line']; - $commentLines[] = $nextComment; - $commentString .= $tokens[$nextComment]['content']; - if ($tokens[$nextComment]['code'] === T_DOC_COMMENT_CLOSE_TAG - || substr($tokens[$nextComment]['content'], -2) === '*/' - ) { - break; - } - }//end while - - $commentText = str_replace($phpcsFile->eolChar, '', $commentString); - $commentText = trim($commentText, "/* \t"); - if ($commentText === '') { - $error = 'Empty block comment not allowed'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($stackPtr, ''); - $lastToken = array_pop($commentLines); - for ($i = ($stackPtr + 1); $i <= $lastToken; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - return; - } - - if (count($commentLines) === 1) { - $error = 'Single line block comment not allowed; use inline ("// text") comment instead'; - - // Only fix comments when they are the last token on a line. - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$stackPtr]['line'] !== $tokens[$nextNonEmpty]['line']) { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SingleLine'); - if ($fix === true) { - $comment = '// '.$commentText.$phpcsFile->eolChar; - $phpcsFile->fixer->replaceToken($stackPtr, $comment); - } - } else { - $phpcsFile->addError($error, $stackPtr, 'SingleLine'); - } - - return; - } - - $content = trim($tokens[$stackPtr]['content']); - if ($content !== '/*' && $content !== '/**') { - $error = 'Block comment text must start on a new line'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoNewLine'); - if ($fix === true) { - $indent = ''; - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - if (isset($tokens[($stackPtr - 1)]['orig_content']) === true) { - $indent = $tokens[($stackPtr - 1)]['orig_content']; - } else { - $indent = $tokens[($stackPtr - 1)]['content']; - } - } - - $comment = preg_replace( - '/^(\s*\/\*\*?)/', - '$1'.$phpcsFile->eolChar.$indent, - $tokens[$stackPtr]['content'], - 1 - ); - $phpcsFile->fixer->replaceToken($stackPtr, $comment); - } - - return; - }//end if - - $starColumn = $tokens[$stackPtr]['column']; - $hasStars = false; - - // Make sure first line isn't blank. - if (trim($tokens[$commentLines[1]]['content']) === '') { - $error = 'Empty line not allowed at start of comment'; - $fix = $phpcsFile->addFixableError($error, $commentLines[1], 'HasEmptyLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($commentLines[1], ''); - } - } else { - // Check indentation of first line. - $content = $tokens[$commentLines[1]]['content']; - $commentText = ltrim($content); - $leadingSpace = (strlen($content) - strlen($commentText)); - - $expected = ($starColumn + 3); - if ($commentText[0] === '*') { - $expected = $starColumn; - $hasStars = true; - } - - if ($leadingSpace !== $expected) { - $expectedTxt = $expected.' space'; - if ($expected !== 1) { - $expectedTxt .= 's'; - } - - $data = [ - $expectedTxt, - $leadingSpace, - ]; - - $error = 'First line of comment not aligned correctly; expected %s but found %s'; - $fix = $phpcsFile->addFixableError($error, $commentLines[1], 'FirstLineIndent', $data); - if ($fix === true) { - if (isset($tokens[$commentLines[1]]['orig_content']) === true - && $tokens[$commentLines[1]]['orig_content'][0] === "\t" - ) { - // Line is indented using tabs. - $padding = str_repeat("\t", floor($expected / $this->tabWidth)); - $padding .= str_repeat(' ', ($expected % $this->tabWidth)); - } else { - $padding = str_repeat(' ', $expected); - } - - $phpcsFile->fixer->replaceToken($commentLines[1], $padding.$commentText); - } - }//end if - - if (preg_match('/^\p{Ll}/u', $commentText) === 1) { - $error = 'Block comments must start with a capital letter'; - $phpcsFile->addError($error, $commentLines[1], 'NoCapital'); - } - }//end if - - // Check that each line of the comment is indented past the star. - foreach ($commentLines as $line) { - // First and last lines (comment opener and closer) are handled separately. - if ($line === $commentLines[(count($commentLines) - 1)] || $line === $commentLines[0]) { - continue; - } - - // First comment line was handled above. - if ($line === $commentLines[1]) { - continue; - } - - // If it's empty, continue. - if (trim($tokens[$line]['content']) === '') { - continue; - } - - $commentText = ltrim($tokens[$line]['content']); - $leadingSpace = (strlen($tokens[$line]['content']) - strlen($commentText)); - - $expected = ($starColumn + 3); - if ($commentText[0] === '*') { - $expected = $starColumn; - $hasStars = true; - } - - if ($leadingSpace < $expected) { - $expectedTxt = $expected.' space'; - if ($expected !== 1) { - $expectedTxt .= 's'; - } - - $data = [ - $expectedTxt, - $leadingSpace, - ]; - - $error = 'Comment line indented incorrectly; expected at least %s but found %s'; - $fix = $phpcsFile->addFixableError($error, $line, 'LineIndent', $data); - if ($fix === true) { - if (isset($tokens[$line]['orig_content']) === true - && $tokens[$line]['orig_content'][0] === "\t" - ) { - // Line is indented using tabs. - $padding = str_repeat("\t", floor($expected / $this->tabWidth)); - $padding .= str_repeat(' ', ($expected % $this->tabWidth)); - } else { - $padding = str_repeat(' ', $expected); - } - - $phpcsFile->fixer->replaceToken($line, $padding.$commentText); - } - }//end if - }//end foreach - - // Finally, test the last line is correct. - $lastIndex = (count($commentLines) - 1); - $content = $tokens[$commentLines[$lastIndex]]['content']; - $commentText = ltrim($content); - if ($commentText !== '*/' && $commentText !== '**/') { - $error = 'Comment closer must be on a new line'; - $phpcsFile->addError($error, $commentLines[$lastIndex], 'CloserSameLine'); - } else { - $leadingSpace = (strlen($content) - strlen($commentText)); - - $expected = ($starColumn - 1); - if ($hasStars === true) { - $expected = $starColumn; - } - - if ($leadingSpace !== $expected) { - $expectedTxt = $expected.' space'; - if ($expected !== 1) { - $expectedTxt .= 's'; - } - - $data = [ - $expectedTxt, - $leadingSpace, - ]; - - $error = 'Last line of comment aligned incorrectly; expected %s but found %s'; - $fix = $phpcsFile->addFixableError($error, $commentLines[$lastIndex], 'LastLineIndent', $data); - if ($fix === true) { - if (isset($tokens[$line]['orig_content']) === true - && $tokens[$line]['orig_content'][0] === "\t" - ) { - // Line is indented using tabs. - $padding = str_repeat("\t", floor($expected / $this->tabWidth)); - $padding .= str_repeat(' ', ($expected % $this->tabWidth)); - } else { - $padding = str_repeat(' ', $expected); - } - - $phpcsFile->fixer->replaceToken($commentLines[$lastIndex], $padding.$commentText); - } - }//end if - }//end if - - // Check that the lines before and after this comment are blank. - $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ((isset($tokens[$contentBefore]['scope_closer']) === true - && $tokens[$contentBefore]['scope_opener'] === $contentBefore) - || $tokens[$contentBefore]['code'] === T_OPEN_TAG - || $tokens[$contentBefore]['code'] === T_OPEN_TAG_WITH_ECHO - ) { - if (($tokens[$stackPtr]['line'] - $tokens[$contentBefore]['line']) !== 1) { - $error = 'Empty line not required before block comment'; - $phpcsFile->addError($error, $stackPtr, 'HasEmptyLineBefore'); - } - } else { - if (($tokens[$stackPtr]['line'] - $tokens[$contentBefore]['line']) < 2) { - $error = 'Empty line required before block comment'; - $phpcsFile->addError($error, $stackPtr, 'NoEmptyLineBefore'); - } - } - - $commentCloser = $commentLines[$lastIndex]; - $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($commentCloser + 1), null, true); - if ($contentAfter !== false && ($tokens[$contentAfter]['line'] - $tokens[$commentCloser]['line']) < 2) { - $error = 'Empty line required after block comment'; - $phpcsFile->addError($error, $commentCloser, 'NoEmptyLineAfter'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php deleted file mode 100644 index 60d553fc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php +++ /dev/null @@ -1,109 +0,0 @@ - - *
  • A class doc comment exists.
  • - *
  • The comment uses the correct docblock style.
  • - *
  • There are no blank lines after the class comment.
  • - *
  • No tags are used in the docblock.
  • - * - * - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class ClassCommentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLASS]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $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--) { - if (isset($find[$tokens[$commentEnd]['code']]) === true) { - continue; - } - - if ($previousContent === null) { - $previousContent = $commentEnd; - } - - if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END - && isset($tokens[$commentEnd]['attribute_opener']) === true - ) { - $commentEnd = $tokens[$commentEnd]['attribute_opener']; - continue; - } - - break; - } - - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG - && $tokens[$commentEnd]['code'] !== T_COMMENT - ) { - $class = $phpcsFile->getDeclarationName($stackPtr); - $phpcsFile->addError('Missing doc comment for class %s', $stackPtr, 'Missing', [$class]); - $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no'); - return; - } - - $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes'); - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a class comment', $stackPtr, 'WrongStyle'); - return; - } - - if ($tokens[$previousContent]['line'] !== ($tokens[$stackPtr]['line'] - 1)) { - $error = 'There must be no blank lines after the class comment'; - $phpcsFile->addError($error, $commentEnd, 'SpacingAfter'); - } - - $commentStart = $tokens[$commentEnd]['comment_opener']; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - $error = '%s tag is not allowed in class comment'; - $data = [$tokens[$tag]['content']]; - $phpcsFile->addWarning($error, $tag, 'TagNotAllowed', $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php deleted file mode 100644 index 44bd4388..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php +++ /dev/null @@ -1,130 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class ClosingDeclarationCommentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CLASS, - T_ENUM, - T_FUNCTION, - T_INTERFACE, - T_TRAIT, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if ($tokens[$stackPtr]['code'] === T_FUNCTION) { - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - - // Abstract methods do not require a closing comment. - if ($methodProps['is_abstract'] === true) { - return; - } - - // If this function is in an interface then we don't require - // a closing comment. - if ($phpcsFile->hasCondition($stackPtr, T_INTERFACE) === true) { - return; - } - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - $error = 'Possible parse error: non-abstract method defined as abstract'; - $phpcsFile->addWarning($error, $stackPtr, 'Abstract'); - return; - } - - $decName = $phpcsFile->getDeclarationName($stackPtr); - $comment = '//end '.$decName.'()'; - } else if ($tokens[$stackPtr]['code'] === T_CLASS) { - $comment = '//end class'; - } else if ($tokens[$stackPtr]['code'] === T_INTERFACE) { - $comment = '//end interface'; - } else if ($tokens[$stackPtr]['code'] === T_TRAIT) { - $comment = '//end trait'; - } else { - $comment = '//end enum'; - }//end if - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - $error = 'Possible parse error: %s missing opening or closing brace'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $data); - return; - } - - $closingBracket = $tokens[$stackPtr]['scope_closer']; - - $data = [$comment]; - if (isset($tokens[($closingBracket + 1)]) === false || $tokens[($closingBracket + 1)]['code'] !== T_COMMENT) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($closingBracket + 1), null, true); - if ($next !== false && rtrim($tokens[$next]['content']) === $comment) { - // The comment isn't really missing; it is just in the wrong place. - $fix = $phpcsFile->addFixableError('Expected %s directly after closing brace', $closingBracket, 'Misplaced', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closingBracket + 1); $i < $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Just in case, because indentation fixes can add indents onto - // these comments and cause us to be unable to fix them. - $phpcsFile->fixer->replaceToken($next, $comment.$phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - } else { - $fix = $phpcsFile->addFixableError('Expected %s', $closingBracket, 'Missing', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($closingBracket, '}'.$comment); - } - } - - return; - }//end if - - if (rtrim($tokens[($closingBracket + 1)]['content']) !== $comment) { - $fix = $phpcsFile->addFixableError('Expected %s', $closingBracket, 'Incorrect', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closingBracket + 1), $comment.$phpcsFile->eolChar); - } - - return; - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php deleted file mode 100644 index 453ff89c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php +++ /dev/null @@ -1,167 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 DocCommentAlignmentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_DOC_COMMENT_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // We are only interested in function/class/interface doc block comments. - $ignore = Tokens::$emptyTokens; - if ($phpcsFile->tokenizerType === 'JS') { - $ignore[] = T_EQUAL; - $ignore[] = T_STRING; - $ignore[] = T_OBJECT_OPERATOR; - } - - $nextToken = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); - $ignore = [ - T_CLASS => true, - T_INTERFACE => true, - T_ENUM => true, - T_ENUM_CASE => true, - T_FUNCTION => true, - T_PUBLIC => true, - T_PRIVATE => true, - T_PROTECTED => true, - T_STATIC => true, - T_ABSTRACT => true, - T_PROPERTY => true, - T_OBJECT => true, - T_PROTOTYPE => true, - T_VAR => true, - T_READONLY => true, - ]; - - if ($nextToken === false || isset($ignore[$tokens[$nextToken]['code']]) === false) { - // Could be a file comment. - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prevToken]['code'] !== T_OPEN_TAG) { - return; - } - } - - // There must be one space after each star (unless it is an empty comment line) - // and all the stars must be aligned correctly. - $requiredColumn = ($tokens[$stackPtr]['column'] + 1); - $endComment = $tokens[$stackPtr]['comment_closer']; - for ($i = ($stackPtr + 1); $i <= $endComment; $i++) { - if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR - && $tokens[$i]['code'] !== T_DOC_COMMENT_CLOSE_TAG - ) { - continue; - } - - if ($tokens[$i]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - if (trim($tokens[$i]['content']) === '') { - // Don't process an unfinished docblock close tag during live coding. - continue; - } - - // Can't process the close tag if it is not the first thing on the line. - $prev = $phpcsFile->findPrevious(T_DOC_COMMENT_WHITESPACE, ($i - 1), $stackPtr, true); - if ($tokens[$prev]['line'] === $tokens[$i]['line']) { - continue; - } - } - - if ($tokens[$i]['column'] !== $requiredColumn) { - $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); - if ($fix === true) { - $padding = str_repeat(' ', ($requiredColumn - 1)); - if ($tokens[$i]['column'] === 1) { - $phpcsFile->fixer->addContentBefore($i, $padding); - } else { - $phpcsFile->fixer->replaceToken(($i - 1), $padding); - } - } - }//end if - - if ($tokens[$i]['code'] !== T_DOC_COMMENT_STAR) { - continue; - } - - if ($tokens[($i + 2)]['line'] !== $tokens[$i]['line']) { - // Line is empty. - continue; - } - - if ($tokens[($i + 1)]['code'] !== T_DOC_COMMENT_WHITESPACE) { - $error = 'Expected 1 space after asterisk; 0 found'; - $fix = $phpcsFile->addFixableError($error, $i, 'NoSpaceAfterStar'); - if ($fix === true) { - $phpcsFile->fixer->addContent($i, ' '); - } - } else if ($tokens[($i + 2)]['code'] === T_DOC_COMMENT_TAG - && $tokens[($i + 1)]['content'] !== ' ' - ) { - $error = 'Expected 1 space after asterisk; %s found'; - $data = [$tokens[($i + 1)]['length']]; - $fix = $phpcsFile->addFixableError($error, $i, 'SpaceAfterStar', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($i + 1), ' '); - } - } - }//end for - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php deleted file mode 100644 index 301537fe..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class EmptyCatchCommentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CATCH]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. - * @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(); - - $scopeStart = $tokens[$stackPtr]['scope_opener']; - $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($scopeStart + 1), $tokens[$stackPtr]['scope_closer'], true); - - if ($firstContent === false) { - $error = 'Empty CATCH statement must have a comment to explain why the exception is not handled'; - $phpcsFile->addError($error, $scopeStart, 'Missing'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php deleted file mode 100644 index cfff91fc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php +++ /dev/null @@ -1,228 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class FileCommentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - - if ($tokens[$commentStart]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a file comment', $commentStart, 'WrongStyle'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - return $phpcsFile->numTokens; - } else if ($commentStart === false || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG) { - $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return $phpcsFile->numTokens; - } - - if (isset($tokens[$commentStart]['comment_closer']) === false - || ($tokens[$tokens[$commentStart]['comment_closer']]['content'] === '' - && $tokens[$commentStart]['comment_closer'] === ($phpcsFile->numTokens - 1)) - ) { - // Don't process an unfinished file comment during live coding. - return $phpcsFile->numTokens; - } - - $commentEnd = $tokens[$commentStart]['comment_closer']; - - for ($nextToken = ($commentEnd + 1); $nextToken < $phpcsFile->numTokens; $nextToken++) { - if ($tokens[$nextToken]['code'] === T_WHITESPACE) { - continue; - } - - if ($tokens[$nextToken]['code'] === T_ATTRIBUTE - && isset($tokens[$nextToken]['attribute_closer']) === true - ) { - $nextToken = $tokens[$nextToken]['attribute_closer']; - continue; - } - - break; - } - - if ($nextToken === $phpcsFile->numTokens) { - $nextToken--; - } - - $ignore = [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - T_FUNCTION, - T_CLOSURE, - T_PUBLIC, - T_PRIVATE, - T_PROTECTED, - T_FINAL, - T_STATIC, - T_ABSTRACT, - T_READONLY, - T_CONST, - T_PROPERTY, - T_INCLUDE, - T_INCLUDE_ONCE, - T_REQUIRE, - T_REQUIRE_ONCE, - ]; - - if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { - $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); - return $phpcsFile->numTokens; - } - - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); - - // No blank line between the open tag and the file comment. - if ($tokens[$commentStart]['line'] > ($tokens[$stackPtr]['line'] + 1)) { - $error = 'There must be no blank lines before the file comment'; - $phpcsFile->addError($error, $stackPtr, 'SpacingAfterOpen'); - } - - // Exactly one blank line after the file comment. - $next = $phpcsFile->findNext(T_WHITESPACE, ($commentEnd + 1), null, true); - if ($next !== false && $tokens[$next]['line'] !== ($tokens[$commentEnd]['line'] + 2)) { - $error = 'There must be exactly one blank line after the file comment'; - $phpcsFile->addError($error, $commentEnd, 'SpacingAfterComment'); - } - - // Required tags in correct order. - $required = [ - '@package' => true, - '@subpackage' => true, - '@author' => true, - '@copyright' => true, - ]; - - $foundTags = []; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - $name = $tokens[$tag]['content']; - $isRequired = isset($required[$name]); - - if ($isRequired === true && in_array($name, $foundTags, true) === true) { - $error = 'Only one %s tag is allowed in a file comment'; - $data = [$name]; - $phpcsFile->addError($error, $tag, 'Duplicate'.ucfirst(substr($name, 1)).'Tag', $data); - } - - $foundTags[] = $name; - - if ($isRequired === false) { - continue; - } - - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { - $error = 'Content missing for %s tag in file comment'; - $data = [$name]; - $phpcsFile->addError($error, $tag, 'Empty'.ucfirst(substr($name, 1)).'Tag', $data); - continue; - } - - if ($name === '@author') { - if ($tokens[$string]['content'] !== 'Squiz Pty Ltd ') { - $error = 'Expected "Squiz Pty Ltd " for author tag'; - $fix = $phpcsFile->addFixableError($error, $tag, 'IncorrectAuthor'); - if ($fix === true) { - $expected = 'Squiz Pty Ltd '; - $phpcsFile->fixer->replaceToken($string, $expected); - } - } - } else if ($name === '@copyright') { - if (preg_match('/^([0-9]{4})(-[0-9]{4})? (Squiz Pty Ltd \(ABN 77 084 670 600\))$/', $tokens[$string]['content']) === 0) { - $error = 'Expected "xxxx-xxxx Squiz Pty Ltd (ABN 77 084 670 600)" for copyright declaration'; - $fix = $phpcsFile->addFixableError($error, $tag, 'IncorrectCopyright'); - if ($fix === true) { - $matches = []; - preg_match('/^(([0-9]{4})(-[0-9]{4})?)?.*$/', $tokens[$string]['content'], $matches); - if (isset($matches[1]) === false) { - $matches[1] = date('Y'); - } - - $expected = $matches[1].' Squiz Pty Ltd (ABN 77 084 670 600)'; - $phpcsFile->fixer->replaceToken($string, $expected); - } - } - }//end if - }//end foreach - - // Check if the tags are in the correct position. - $pos = 0; - foreach ($required as $tag => $true) { - if (in_array($tag, $foundTags, true) === false) { - $error = 'Missing %s tag in file comment'; - $data = [$tag]; - $phpcsFile->addError($error, $commentEnd, 'Missing'.ucfirst(substr($tag, 1)).'Tag', $data); - } - - if (isset($foundTags[$pos]) === false) { - break; - } - - if ($foundTags[$pos] !== $tag) { - $error = 'The tag in position %s should be the %s tag'; - $data = [ - ($pos + 1), - $tag, - ]; - $phpcsFile->addError($error, $tokens[$commentStart]['comment_tags'][$pos], ucfirst(substr($tag, 1)).'TagOrder', $data); - } - - $pos++; - }//end foreach - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php deleted file mode 100644 index b0b7cafb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php +++ /dev/null @@ -1,800 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff as PEARFunctionCommentSniff; -use PHP_CodeSniffer\Util\Common; - -class FunctionCommentSniff extends PEARFunctionCommentSniff -{ - - /** - * Whether to skip inheritdoc comments. - * - * @var boolean - */ - public $skipIfInheritdoc = false; - - /** - * The current PHP version. - * - * @var integer|string|null - */ - private $phpVersion = null; - - - /** - * Process the return comment of this function comment. - * - * @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 $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processReturn(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - $return = null; - - if ($this->skipIfInheritdoc === true) { - if ($this->checkInheritdoc($phpcsFile, $stackPtr, $commentStart) === true) { - return; - } - } - - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@return') { - if ($return !== null) { - $error = 'Only 1 @return tag is allowed in a function comment'; - $phpcsFile->addError($error, $tag, 'DuplicateReturn'); - return; - } - - $return = $tag; - } - } - - // Skip constructor and destructor. - $methodName = $phpcsFile->getDeclarationName($stackPtr); - $isSpecialMethod = in_array($methodName, $this->specialMethods, true); - - if ($return !== null) { - $content = $tokens[($return + 2)]['content']; - if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) { - $error = 'Return type missing for @return tag in function comment'; - $phpcsFile->addError($error, $return, 'MissingReturnType'); - } else { - // Support both a return type and a description. - preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $content, $returnParts); - if (isset($returnParts[1]) === false) { - return; - } - - $returnType = $returnParts[1]; - - // Check return type (can be multiple, separated by '|'). - $typeNames = explode('|', $returnType); - $suggestedNames = []; - foreach ($typeNames as $typeName) { - $suggestedName = Common::suggestType($typeName); - if (in_array($suggestedName, $suggestedNames, true) === false) { - $suggestedNames[] = $suggestedName; - } - } - - $suggestedType = implode('|', $suggestedNames); - if ($returnType !== $suggestedType) { - $error = 'Expected "%s" but found "%s" for function return type'; - $data = [ - $suggestedType, - $returnType, - ]; - $fix = $phpcsFile->addFixableError($error, $return, 'InvalidReturn', $data); - if ($fix === true) { - $replacement = $suggestedType; - if (empty($returnParts[2]) === false) { - $replacement .= $returnParts[2]; - } - - $phpcsFile->fixer->replaceToken(($return + 2), $replacement); - unset($replacement); - } - } - - // If the return type is void, make sure there is - // no return statement in the function. - if ($returnType === 'void') { - if (isset($tokens[$stackPtr]['scope_closer']) === true) { - $endToken = $tokens[$stackPtr]['scope_closer']; - for ($returnToken = $stackPtr; $returnToken < $endToken; $returnToken++) { - if ($tokens[$returnToken]['code'] === T_CLOSURE - || $tokens[$returnToken]['code'] === T_ANON_CLASS - ) { - $returnToken = $tokens[$returnToken]['scope_closer']; - continue; - } - - if ($tokens[$returnToken]['code'] === T_RETURN - || $tokens[$returnToken]['code'] === T_YIELD - || $tokens[$returnToken]['code'] === T_YIELD_FROM - ) { - break; - } - } - - if ($returnToken !== $endToken) { - // If the function is not returning anything, just - // exiting, then there is no problem. - $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true); - if ($tokens[$semicolon]['code'] !== T_SEMICOLON) { - $error = 'Function return type is void, but function contains return statement'; - $phpcsFile->addError($error, $return, 'InvalidReturnVoid'); - } - } - }//end if - } 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++) { - if ($tokens[$returnToken]['code'] === T_CLOSURE - || $tokens[$returnToken]['code'] === T_ANON_CLASS - ) { - $returnToken = $tokens[$returnToken]['scope_closer']; - continue; - } - - if ($tokens[$returnToken]['code'] === T_RETURN - || $tokens[$returnToken]['code'] === T_YIELD - || $tokens[$returnToken]['code'] === T_YIELD_FROM - ) { - break; - } - } - - if ($returnToken === $endToken) { - $error = 'Function return type is not void, but function has no return statement'; - $phpcsFile->addError($error, $return, 'InvalidNoReturn'); - } else { - $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true); - if ($tokens[$semicolon]['code'] === T_SEMICOLON) { - $error = 'Function return type is not void, but function is returning void here'; - $phpcsFile->addError($error, $returnToken, 'InvalidReturnNotVoid'); - } - } - }//end if - }//end if - }//end if - } else { - if ($isSpecialMethod === true) { - return; - } - - $error = 'Missing @return tag in function comment'; - $phpcsFile->addError($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn'); - }//end if - - }//end processReturn() - - - /** - * Process any throw tags that this function comment has. - * - * @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 $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processThrows(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - if ($this->skipIfInheritdoc === true) { - if ($this->checkInheritdoc($phpcsFile, $stackPtr, $commentStart) === true) { - return; - } - } - - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($tokens[$tag]['content'] !== '@throws') { - continue; - } - - $exception = null; - $comment = null; - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches); - $exception = $matches[1]; - if (isset($matches[2]) === true && trim($matches[2]) !== '') { - $comment = $matches[2]; - } - } - - if ($exception === null) { - $error = 'Exception type and comment missing for @throws tag in function comment'; - $phpcsFile->addError($error, $tag, 'InvalidThrows'); - } else if ($comment === null) { - $error = 'Comment missing for @throws tag in function comment'; - $phpcsFile->addError($error, $tag, 'EmptyThrows'); - } else { - // Any strings until the next tag belong to this comment. - if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { - $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; - } else { - $end = $tokens[$commentStart]['comment_closer']; - } - - for ($i = ($tag + 3); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - $comment .= ' '.$tokens[$i]['content']; - } - } - - $comment = trim($comment); - - // Starts with a capital letter and ends with a fullstop. - $firstChar = $comment[0]; - if (strtoupper($firstChar) !== $firstChar) { - $error = '@throws tag comment must start with a capital letter'; - $phpcsFile->addError($error, ($tag + 2), 'ThrowsNotCapital'); - } - - $lastChar = substr($comment, -1); - if ($lastChar !== '.') { - $error = '@throws tag comment must end with a full stop'; - $phpcsFile->addError($error, ($tag + 2), 'ThrowsNoFullStop'); - } - }//end if - }//end foreach - - }//end processThrows() - - - /** - * Process the function parameter comments. - * - * @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 $commentStart The position in the stack where the comment started. - * - * @return void - */ - protected function processParams(File $phpcsFile, $stackPtr, $commentStart) - { - if ($this->phpVersion === null) { - $this->phpVersion = Config::getConfigData('php_version'); - if ($this->phpVersion === null) { - $this->phpVersion = PHP_VERSION_ID; - } - } - - $tokens = $phpcsFile->getTokens(); - - if ($this->skipIfInheritdoc === true) { - if ($this->checkInheritdoc($phpcsFile, $stackPtr, $commentStart) === true) { - return; - } - } - - $params = []; - $maxType = 0; - $maxVar = 0; - foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { - if ($tokens[$tag]['content'] !== '@param') { - continue; - } - - $type = ''; - $typeSpace = 0; - $var = ''; - $varSpace = 0; - $comment = ''; - $commentLines = []; - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $matches = []; - preg_match('/([^$&.]+)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches); - - if (empty($matches) === false) { - $typeLen = strlen($matches[1]); - $type = trim($matches[1]); - $typeSpace = ($typeLen - strlen($type)); - $typeLen = strlen($type); - if ($typeLen > $maxType) { - $maxType = $typeLen; - } - } - - if (isset($matches[2]) === true) { - $var = $matches[2]; - $varLen = strlen($var); - if ($varLen > $maxVar) { - $maxVar = $varLen; - } - - if (isset($matches[4]) === true) { - $varSpace = strlen($matches[3]); - $comment = $matches[4]; - $commentLines[] = [ - 'comment' => $comment, - 'token' => ($tag + 2), - 'indent' => $varSpace, - ]; - - // Any strings until the next tag belong to this comment. - if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) { - $end = $tokens[$commentStart]['comment_tags'][($pos + 1)]; - } else { - $end = $tokens[$commentStart]['comment_closer']; - } - - for ($i = ($tag + 3); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) { - $indent = 0; - if ($tokens[($i - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) { - $indent = $tokens[($i - 1)]['length']; - } - - $comment .= ' '.$tokens[$i]['content']; - $commentLines[] = [ - 'comment' => $tokens[$i]['content'], - 'token' => $i, - 'indent' => $indent, - ]; - } - } - } else { - $error = 'Missing parameter comment'; - $phpcsFile->addError($error, $tag, 'MissingParamComment'); - $commentLines[] = ['comment' => '']; - }//end if - } else if ($tokens[($tag + 2)]['content'][0] === '$') { - $error = 'Missing parameter type'; - $phpcsFile->addError($error, $tag, 'MissingParamType'); - } else { - $error = 'Missing parameter name'; - $phpcsFile->addError($error, $tag, 'MissingParamName'); - }//end if - } else { - $error = 'Missing parameter type'; - $phpcsFile->addError($error, $tag, 'MissingParamType'); - }//end if - - $params[] = [ - 'tag' => $tag, - 'type' => $type, - 'var' => $var, - 'comment' => $comment, - 'commentLines' => $commentLines, - 'type_space' => $typeSpace, - 'var_space' => $varSpace, - ]; - }//end foreach - - $realParams = $phpcsFile->getMethodParameters($stackPtr); - $foundParams = []; - - // We want to use ... for all variable length arguments, so added - // this prefix to the variable name so comparisons are easier. - foreach ($realParams as $pos => $param) { - if ($param['variable_length'] === true) { - $realParams[$pos]['name'] = '...'.$realParams[$pos]['name']; - } - } - - foreach ($params as $pos => $param) { - // If the type is empty, the whole line is empty. - if ($param['type'] === '') { - continue; - } - - // Check the param type value. - $typeNames = explode('|', $param['type']); - $suggestedTypeNames = []; - - foreach ($typeNames as $typeName) { - if ($typeName === '') { - continue; - } - - // Strip nullable operator. - if ($typeName[0] === '?') { - $typeName = substr($typeName, 1); - } - - $suggestedName = Common::suggestType($typeName); - $suggestedTypeNames[] = $suggestedName; - - if (count($typeNames) > 1) { - continue; - } - - // Check type hint for array and custom type. - $suggestedTypeHint = ''; - if (strpos($suggestedName, 'array') !== false || substr($suggestedName, -2) === '[]') { - $suggestedTypeHint = 'array'; - } else if (strpos($suggestedName, 'callable') !== false) { - $suggestedTypeHint = 'callable'; - } else if (strpos($suggestedName, 'callback') !== false) { - $suggestedTypeHint = 'callable'; - } else if (in_array($suggestedName, Common::$allowedTypes, true) === false) { - $suggestedTypeHint = $suggestedName; - } - - if ($this->phpVersion >= 70000) { - if ($suggestedName === 'string') { - $suggestedTypeHint = 'string'; - } else if ($suggestedName === 'int' || $suggestedName === 'integer') { - $suggestedTypeHint = 'int'; - } else if ($suggestedName === 'float') { - $suggestedTypeHint = 'float'; - } else if ($suggestedName === 'bool' || $suggestedName === 'boolean') { - $suggestedTypeHint = 'bool'; - } - } - - if ($this->phpVersion >= 70200) { - if ($suggestedName === 'object') { - $suggestedTypeHint = 'object'; - } - } - - if ($this->phpVersion >= 80000) { - if ($suggestedName === 'mixed') { - $suggestedTypeHint = 'mixed'; - } - } - - if ($suggestedTypeHint !== '' && isset($realParams[$pos]) === true && $param['var'] !== '') { - $typeHint = $realParams[$pos]['type_hint']; - - // Remove namespace prefixes when comparing. - $compareTypeHint = substr($suggestedTypeHint, (strlen($typeHint) * -1)); - - if ($typeHint === '') { - $error = 'Type hint "%s" missing for %s'; - $data = [ - $suggestedTypeHint, - $param['var'], - ]; - - $errorCode = 'TypeHintMissing'; - if ($suggestedTypeHint === 'string' - || $suggestedTypeHint === 'int' - || $suggestedTypeHint === 'float' - || $suggestedTypeHint === 'bool' - ) { - $errorCode = 'Scalar'.$errorCode; - } - - $phpcsFile->addError($error, $stackPtr, $errorCode, $data); - } else if ($typeHint !== $compareTypeHint && $typeHint !== '?'.$compareTypeHint) { - $error = 'Expected type hint "%s"; found "%s" for %s'; - $data = [ - $suggestedTypeHint, - $typeHint, - $param['var'], - ]; - $phpcsFile->addError($error, $stackPtr, 'IncorrectTypeHint', $data); - }//end if - } else if ($suggestedTypeHint === '' && isset($realParams[$pos]) === true) { - $typeHint = $realParams[$pos]['type_hint']; - if ($typeHint !== '') { - $error = 'Unknown type hint "%s" found for %s'; - $data = [ - $typeHint, - $param['var'], - ]; - $phpcsFile->addError($error, $stackPtr, 'InvalidTypeHint', $data); - } - }//end if - }//end foreach - - $suggestedType = implode('|', $suggestedTypeNames); - if ($param['type'] !== $suggestedType) { - $error = 'Expected "%s" but found "%s" for parameter type'; - $data = [ - $suggestedType, - $param['type'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'IncorrectParamVarName', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $content = $suggestedType; - $content .= str_repeat(' ', $param['type_space']); - $content .= $param['var']; - $content .= str_repeat(' ', $param['var_space']); - if (isset($param['commentLines'][0]) === true) { - $content .= $param['commentLines'][0]['comment']; - } - - $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); - - // Fix up the indent of additional comment lines. - foreach ($param['commentLines'] as $lineNum => $line) { - if ($lineNum === 0 - || $param['commentLines'][$lineNum]['indent'] === 0 - ) { - continue; - } - - $diff = (strlen($param['type']) - strlen($suggestedType)); - $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff); - $phpcsFile->fixer->replaceToken( - ($param['commentLines'][$lineNum]['token'] - 1), - str_repeat(' ', $newIndent) - ); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - - if ($param['var'] === '') { - continue; - } - - $foundParams[] = $param['var']; - - // Check number of spaces after the type. - $this->checkSpacingAfterParamType($phpcsFile, $param, $maxType); - - // Make sure the param name is correct. - if (isset($realParams[$pos]) === true) { - $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 = [ - $paramVarName, - $realName, - ]; - - $error = 'Doc comment for parameter %s does not match '; - if (strtolower($paramVarName) === strtolower($realName)) { - $error .= 'case of '; - $code = 'ParamNameNoCaseMatch'; - } - - $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'; - $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment'); - }//end if - - if ($param['comment'] === '') { - continue; - } - - // Check number of spaces after the var name. - $this->checkSpacingAfterParamName($phpcsFile, $param, $maxVar); - - // Param comments must start with a capital letter and end with a full stop. - if (preg_match('/^(\p{Ll}|\P{L})/u', $param['comment']) === 1) { - $error = 'Parameter comment must start with a capital letter'; - $phpcsFile->addError($error, $param['tag'], 'ParamCommentNotCapital'); - } - - $lastChar = substr($param['comment'], -1); - if ($lastChar !== '.') { - $error = 'Parameter comment must end with a full stop'; - $phpcsFile->addError($error, $param['tag'], 'ParamCommentFullStop'); - } - }//end foreach - - $realNames = []; - foreach ($realParams as $realParam) { - $realNames[] = $realParam['name']; - } - - // Report missing comments. - $diff = array_diff($realNames, $foundParams); - foreach ($diff as $neededParam) { - $error = 'Doc comment for parameter "%s" missing'; - $data = [$neededParam]; - $phpcsFile->addError($error, $commentStart, 'MissingParamTag', $data); - } - - }//end processParams() - - - /** - * Check the spacing after the type of a parameter. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $param The parameter to be checked. - * @param int $maxType The maxlength of the longest parameter type. - * @param int $spacing The number of spaces to add after the type. - * - * @return void - */ - protected function checkSpacingAfterParamType(File $phpcsFile, $param, $maxType, $spacing=1) - { - // Check number of spaces after the type. - $spaces = ($maxType - strlen($param['type']) + $spacing); - if ($param['type_space'] !== $spaces) { - $error = 'Expected %s spaces after parameter type; %s found'; - $data = [ - $spaces, - $param['type_space'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamType', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $content = $param['type']; - $content .= str_repeat(' ', $spaces); - $content .= $param['var']; - $content .= str_repeat(' ', $param['var_space']); - $content .= $param['commentLines'][0]['comment']; - $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); - - // Fix up the indent of additional comment lines. - $diff = ($param['type_space'] - $spaces); - foreach ($param['commentLines'] as $lineNum => $line) { - if ($lineNum === 0 - || $param['commentLines'][$lineNum]['indent'] === 0 - ) { - continue; - } - - $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff); - if ($newIndent <= 0) { - continue; - } - - $phpcsFile->fixer->replaceToken( - ($param['commentLines'][$lineNum]['token'] - 1), - str_repeat(' ', $newIndent) - ); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - - }//end checkSpacingAfterParamType() - - - /** - * Check the spacing after the name of a parameter. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param array $param The parameter to be checked. - * @param int $maxVar The maxlength of the longest parameter name. - * @param int $spacing The number of spaces to add after the type. - * - * @return void - */ - protected function checkSpacingAfterParamName(File $phpcsFile, $param, $maxVar, $spacing=1) - { - // Check number of spaces after the var name. - $spaces = ($maxVar - strlen($param['var']) + $spacing); - if ($param['var_space'] !== $spaces) { - $error = 'Expected %s spaces after parameter name; %s found'; - $data = [ - $spaces, - $param['var_space'], - ]; - - $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamName', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - - $content = $param['type']; - $content .= str_repeat(' ', $param['type_space']); - $content .= $param['var']; - $content .= str_repeat(' ', $spaces); - $content .= $param['commentLines'][0]['comment']; - $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content); - - // Fix up the indent of additional comment lines. - foreach ($param['commentLines'] as $lineNum => $line) { - if ($lineNum === 0 - || $param['commentLines'][$lineNum]['indent'] === 0 - ) { - continue; - } - - $diff = ($param['var_space'] - $spaces); - $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff); - if ($newIndent <= 0) { - continue; - } - - $phpcsFile->fixer->replaceToken( - ($param['commentLines'][$lineNum]['token'] - 1), - str_repeat(' ', $newIndent) - ); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - - }//end checkSpacingAfterParamName() - - - /** - * Determines whether the whole comment is an inheritdoc comment. - * - * @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 $commentStart The position in the stack where the comment started. - * - * @return boolean TRUE if the docblock contains only {@inheritdoc} (case-insensitive). - */ - protected function checkInheritdoc(File $phpcsFile, $stackPtr, $commentStart) - { - $tokens = $phpcsFile->getTokens(); - - $allowedTokens = [ - T_DOC_COMMENT_OPEN_TAG, - T_DOC_COMMENT_WHITESPACE, - T_DOC_COMMENT_STAR, - ]; - for ($i = $commentStart; $i <= $tokens[$commentStart]['comment_closer']; $i++) { - if (in_array($tokens[$i]['code'], $allowedTokens) === false) { - $trimmedContent = strtolower(trim($tokens[$i]['content'])); - - if ($trimmedContent === '{@inheritdoc}') { - return true; - } else { - return false; - } - } - } - - return false; - - }//end checkInheritdoc() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php deleted file mode 100644 index 4fb332cf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php +++ /dev/null @@ -1,233 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 FunctionCommentThrowTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - // Abstract or incomplete. - return; - } - - $find = Tokens::$methodPrefixes; - $find[] = T_WHITESPACE; - - $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true); - if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG) { - // Function doesn't have a doc comment or is using the wrong type of comment. - return; - } - - $stackPtrEnd = $tokens[$stackPtr]['scope_closer']; - - // Find all the exception type tokens within the current scope. - $thrownExceptions = []; - $currPos = $stackPtr; - $foundThrows = false; - $unknownCount = 0; - do { - $currPos = $phpcsFile->findNext([T_THROW, T_ANON_CLASS, T_CLOSURE], ($currPos + 1), $stackPtrEnd); - if ($currPos === false) { - break; - } - - if ($tokens[$currPos]['code'] !== T_THROW) { - $currPos = $tokens[$currPos]['scope_closer']; - continue; - } - - $foundThrows = true; - - /* - If we can't find a NEW, we are probably throwing - a variable or calling a method. - - If we're throwing a variable, and it's the same variable as the - exception container from the nearest 'catch' block, we take that exception - as it is likely to be a re-throw. - - If we can't find a matching catch block, or the variable name - is different, it's probably a different variable, so we ignore it, - but they still need to provide at least one @throws tag, even through we - don't know the exception class. - */ - - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($currPos + 1), null, true); - if ($tokens[$nextToken]['code'] === T_NEW - || $tokens[$nextToken]['code'] === T_NS_SEPARATOR - || $tokens[$nextToken]['code'] === T_STRING - ) { - if ($tokens[$nextToken]['code'] === T_NEW) { - $currException = $phpcsFile->findNext( - [ - T_NS_SEPARATOR, - T_STRING, - ], - $currPos, - $stackPtrEnd, - false, - null, - true - ); - } else { - $currException = $nextToken; - } - - if ($currException !== false) { - $endException = $phpcsFile->findNext( - [ - T_NS_SEPARATOR, - T_STRING, - ], - ($currException + 1), - $stackPtrEnd, - true, - null, - true - ); - - if ($endException === false) { - $thrownExceptions[] = $tokens[$currException]['content']; - } else { - $thrownExceptions[] = $phpcsFile->getTokensAsString($currException, ($endException - $currException)); - } - }//end if - } else if ($tokens[$nextToken]['code'] === T_VARIABLE) { - // Find the nearest catch block in this scope and, if the caught var - // matches our re-thrown var, use the exception types being caught as - // exception types that are being thrown as well. - $catch = $phpcsFile->findPrevious( - T_CATCH, - $currPos, - $tokens[$stackPtr]['scope_opener'], - false, - null, - false - ); - - if ($catch !== false) { - $thrownVar = $phpcsFile->findPrevious( - T_VARIABLE, - ($tokens[$catch]['parenthesis_closer'] - 1), - $tokens[$catch]['parenthesis_opener'] - ); - - if ($tokens[$thrownVar]['content'] === $tokens[$nextToken]['content']) { - $exceptions = explode('|', $phpcsFile->getTokensAsString(($tokens[$catch]['parenthesis_opener'] + 1), ($thrownVar - $tokens[$catch]['parenthesis_opener'] - 1))); - foreach ($exceptions as $exception) { - $thrownExceptions[] = trim($exception); - } - } - } - } else { - ++$unknownCount; - }//end if - } while ($currPos < $stackPtrEnd && $currPos !== false); - - if ($foundThrows === false) { - return; - } - - // Only need one @throws tag for each type of exception thrown. - $thrownExceptions = array_unique($thrownExceptions); - - $throwTags = []; - $commentStart = $tokens[$commentEnd]['comment_opener']; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] !== '@throws') { - continue; - } - - if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) { - $exception = $tokens[($tag + 2)]['content']; - $space = strpos($exception, ' '); - if ($space !== false) { - $exception = substr($exception, 0, $space); - } - - $throwTags[$exception] = true; - } - } - - if (empty($throwTags) === true) { - $error = 'Missing @throws tag in function comment'; - $phpcsFile->addError($error, $commentEnd, 'Missing'); - return; - } else if (empty($thrownExceptions) === true) { - // If token count is zero, it means that only variables are being - // thrown, so we need at least one @throws tag (checked above). - // Nothing more to do. - return; - } - - // Make sure @throws tag count matches thrown count. - $thrownCount = (count($thrownExceptions) + $unknownCount); - $tagCount = count($throwTags); - if ($thrownCount !== $tagCount) { - $error = 'Expected %s @throws tag(s) in function comment; %s found'; - $data = [ - $thrownCount, - $tagCount, - ]; - $phpcsFile->addError($error, $commentEnd, 'WrongNumber', $data); - return; - } - - foreach ($thrownExceptions as $throw) { - if (isset($throwTags[$throw]) === true) { - continue; - } - - foreach ($throwTags as $tag => $ignore) { - if (strrpos($tag, $throw) === (strlen($tag) - strlen($throw))) { - continue 2; - } - } - - $error = 'Missing @throws tag for "%s" exception'; - $data = [$throw]; - $phpcsFile->addError($error, $commentEnd, 'Missing', $data); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php deleted file mode 100644 index 3c1ead70..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php +++ /dev/null @@ -1,349 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 InlineCommentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_COMMENT, - T_DOC_COMMENT_OPEN_TAG, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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|int - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // If this is a function/class/interface doc block comment, skip it. - // We are only interested in inline doc block comments, which are - // not allowed. - if ($tokens[$stackPtr]['code'] === T_DOC_COMMENT_OPEN_TAG) { - $nextToken = $stackPtr; - do { - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] === T_ATTRIBUTE) { - $nextToken = $tokens[$nextToken]['attribute_closer']; - continue; - } - - break; - } while (true); - - $ignore = [ - T_CLASS, - T_INTERFACE, - T_TRAIT, - T_ENUM, - T_FUNCTION, - T_CLOSURE, - T_PUBLIC, - T_PRIVATE, - T_PROTECTED, - T_FINAL, - T_STATIC, - T_ABSTRACT, - T_READONLY, - T_CONST, - T_PROPERTY, - T_INCLUDE, - T_INCLUDE_ONCE, - T_REQUIRE, - T_REQUIRE_ONCE, - ]; - - if (in_array($tokens[$nextToken]['code'], $ignore, true) === true) { - return; - } - - if ($phpcsFile->tokenizerType === 'JS') { - // We allow block comments if a function or object - // is being assigned to a variable. - $ignore = Tokens::$emptyTokens; - $ignore[] = T_EQUAL; - $ignore[] = T_STRING; - $ignore[] = T_OBJECT_OPERATOR; - $nextToken = $phpcsFile->findNext($ignore, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] === T_FUNCTION - || $tokens[$nextToken]['code'] === T_CLOSURE - || $tokens[$nextToken]['code'] === T_OBJECT - || $tokens[$nextToken]['code'] === T_PROTOTYPE - ) { - return; - } - } - - $prevToken = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($stackPtr - 1), - null, - true - ); - - if ($tokens[$prevToken]['code'] === T_OPEN_TAG) { - return; - } - - if ($tokens[$stackPtr]['content'] === '/**') { - $error = 'Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead'; - $phpcsFile->addError($error, $stackPtr, 'DocBlock'); - } - }//end if - - if ($tokens[$stackPtr]['content'][0] === '#') { - $error = 'Perl-style comments are not allowed; use "// Comment" instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStyle'); - if ($fix === true) { - $comment = ltrim($tokens[$stackPtr]['content'], "# \t"); - $phpcsFile->fixer->replaceToken($stackPtr, "// $comment"); - } - } - - // We don't want end of block comments. Check if the last token before the - // comment is a closing curly brace. - $previousContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$previousContent]['line'] === $tokens[$stackPtr]['line']) { - if ($tokens[$previousContent]['code'] === T_CLOSE_CURLY_BRACKET) { - return; - } - - // Special case for JS files. - if ($tokens[$previousContent]['code'] === T_COMMA - || $tokens[$previousContent]['code'] === T_SEMICOLON - ) { - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($previousContent - 1), null, true); - if ($tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { - return; - } - } - } - - // Only want inline comments. - if (substr($tokens[$stackPtr]['content'], 0, 2) !== '//') { - return; - } - - $commentTokens = [$stackPtr]; - - $nextComment = $stackPtr; - $lastComment = $stackPtr; - while (($nextComment = $phpcsFile->findNext(T_COMMENT, ($nextComment + 1), null, false)) !== false) { - if ($tokens[$nextComment]['line'] !== ($tokens[$lastComment]['line'] + 1)) { - break; - } - - // Only want inline comments. - if (substr($tokens[$nextComment]['content'], 0, 2) !== '//') { - break; - } - - // There is a comment on the very next line. If there is - // no code between the comments, they are part of the same - // comment block. - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($nextComment - 1), $lastComment, true); - if ($prevNonWhitespace !== $lastComment) { - break; - } - - $commentTokens[] = $nextComment; - $lastComment = $nextComment; - }//end while - - $commentText = ''; - foreach ($commentTokens as $lastCommentToken) { - $comment = rtrim($tokens[$lastCommentToken]['content']); - - if (trim(substr($comment, 2)) === '') { - continue; - } - - $spaceCount = 0; - $tabFound = false; - - $commentLength = strlen($comment); - for ($i = 2; $i < $commentLength; $i++) { - if ($comment[$i] === "\t") { - $tabFound = true; - break; - } - - if ($comment[$i] !== ' ') { - break; - } - - $spaceCount++; - } - - $fix = false; - if ($tabFound === true) { - $error = 'Tab found before comment text; expected "// %s" but found "%s"'; - $data = [ - ltrim(substr($comment, 2)), - $comment, - ]; - $fix = $phpcsFile->addFixableError($error, $lastCommentToken, 'TabBefore', $data); - } else if ($spaceCount === 0) { - $error = 'No space found before comment text; expected "// %s" but found "%s"'; - $data = [ - substr($comment, 2), - $comment, - ]; - $fix = $phpcsFile->addFixableError($error, $lastCommentToken, 'NoSpaceBefore', $data); - } else if ($spaceCount > 1) { - $error = 'Expected 1 space before comment text but found %s; use block comment if you need indentation'; - $data = [ - $spaceCount, - substr($comment, (2 + $spaceCount)), - $comment, - ]; - $fix = $phpcsFile->addFixableError($error, $lastCommentToken, 'SpacingBefore', $data); - }//end if - - if ($fix === true) { - $newComment = '// '.ltrim($tokens[$lastCommentToken]['content'], "/\t "); - $phpcsFile->fixer->replaceToken($lastCommentToken, $newComment); - } - - $commentText .= trim(substr($tokens[$lastCommentToken]['content'], 2)); - }//end foreach - - if ($commentText === '') { - $error = 'Blank comments are not allowed'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, ''); - } - - return ($lastCommentToken + 1); - } - - if (preg_match('/^\p{Ll}/u', $commentText) === 1) { - $error = 'Inline comments must start with a capital letter'; - $phpcsFile->addError($error, $stackPtr, 'NotCapital'); - } - - // Only check the end of comment character if the start of the comment - // is a letter, indicating that the comment is just standard text. - if (preg_match('/^\p{L}/u', $commentText) === 1) { - $commentCloser = $commentText[(strlen($commentText) - 1)]; - $acceptedClosers = [ - 'full-stops' => '.', - 'exclamation marks' => '!', - 'or question marks' => '?', - ]; - - if (in_array($commentCloser, $acceptedClosers, true) === false) { - $error = 'Inline comments must end in %s'; - $ender = ''; - foreach ($acceptedClosers as $closerName => $symbol) { - $ender .= ' '.$closerName.','; - } - - $ender = trim($ender, ' ,'); - $data = [$ender]; - $phpcsFile->addError($error, $lastCommentToken, 'InvalidEndChar', $data); - } - } - - // Finally, the line below the last comment cannot be empty if this inline - // comment is on a line by itself. - if ($tokens[$previousContent]['line'] < $tokens[$stackPtr]['line']) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($lastCommentToken + 1), null, true); - if ($next === false) { - // Ignore if the comment is the last non-whitespace token in a file. - return ($lastCommentToken + 1); - } - - if ($tokens[$next]['code'] === T_DOC_COMMENT_OPEN_TAG) { - // If this inline comment is followed by a docblock, - // ignore spacing as docblock/function etc spacing rules - // are likely to conflict with our rules. - return ($lastCommentToken + 1); - } - - $errorCode = 'SpacingAfter'; - - if (isset($tokens[$stackPtr]['conditions']) === true) { - $conditions = $tokens[$stackPtr]['conditions']; - $type = end($conditions); - $conditionPtr = key($conditions); - - if (($type === T_FUNCTION || $type === T_CLOSURE) - && $tokens[$conditionPtr]['scope_closer'] === $next - ) { - $errorCode = 'SpacingAfterAtFunctionEnd'; - } - } - - for ($i = ($lastCommentToken + 1); $i < $phpcsFile->numTokens; $i++) { - if ($tokens[$i]['line'] === ($tokens[$lastCommentToken]['line'] + 1)) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - return ($lastCommentToken + 1); - } - } else if ($tokens[$i]['line'] > ($tokens[$lastCommentToken]['line'] + 1)) { - break; - } - } - - $error = 'There must be no blank line following an inline comment'; - $fix = $phpcsFile->addFixableError($error, $lastCommentToken, $errorCode); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($lastCommentToken + 1); $i < $next; $i++) { - if ($tokens[$i]['line'] === $tokens[$next]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - return ($lastCommentToken + 1); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php deleted file mode 100644 index 7c06e429..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php +++ /dev/null @@ -1,218 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class LongConditionClosingCommentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The openers that we are interested in. - * - * @var integer[] - */ - private static $openers = [ - T_SWITCH, - T_IF, - T_FOR, - T_FOREACH, - T_WHILE, - T_TRY, - T_CASE, - T_MATCH, - ]; - - /** - * The length that a code block must be before - * requiring a closing comment. - * - * @var integer - */ - public $lineLimit = 20; - - /** - * The format the end comment should be in. - * - * The placeholder %s will be replaced with the type of condition opener. - * - * @var string - */ - public $commentFormat = '//end %s'; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_CLOSE_CURLY_BRACKET]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['scope_condition']) === false) { - // No scope condition. It is a function closer. - return; - } - - $startCondition = $tokens[$tokens[$stackPtr]['scope_condition']]; - $startBrace = $tokens[$tokens[$stackPtr]['scope_opener']]; - $endBrace = $tokens[$stackPtr]; - - // We are only interested in some code blocks. - if (in_array($startCondition['code'], self::$openers, true) === false) { - return; - } - - if ($startCondition['code'] === T_IF) { - // If this is actually an ELSE IF, skip it as the brace - // will be checked by the original IF. - $else = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$stackPtr]['scope_condition'] - 1), null, true); - if ($tokens[$else]['code'] === T_ELSE) { - return; - } - - // IF statements that have an ELSE block need to use - // "end if" rather than "end else" or "end elseif". - do { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$nextToken]['code'] === T_ELSE || $tokens[$nextToken]['code'] === T_ELSEIF) { - // Check for ELSE IF (2 tokens) as opposed to ELSEIF (1 token). - if ($tokens[$nextToken]['code'] === T_ELSE - && isset($tokens[$nextToken]['scope_closer']) === false - ) { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($nextToken + 1), null, true); - if ($tokens[$nextToken]['code'] !== T_IF - || isset($tokens[$nextToken]['scope_closer']) === false - ) { - // Not an ELSE IF or is an inline ELSE IF. - break; - } - } - - if (isset($tokens[$nextToken]['scope_closer']) === false) { - // There isn't going to be anywhere to print the "end if" comment - // because there is no closer. - return; - } - - // The end brace becomes the ELSE's end brace. - $stackPtr = $tokens[$nextToken]['scope_closer']; - $endBrace = $tokens[$stackPtr]; - } else { - break; - }//end if - } while (isset($tokens[$nextToken]['scope_closer']) === true); - }//end if - - if ($startCondition['code'] === T_TRY) { - // TRY statements need to check until the end of all CATCH statements. - do { - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$nextToken]['code'] === T_CATCH - || $tokens[$nextToken]['code'] === T_FINALLY - ) { - // The end brace becomes the CATCH end brace. - $stackPtr = $tokens[$nextToken]['scope_closer']; - $endBrace = $tokens[$stackPtr]; - } else { - break; - } - } while (isset($tokens[$nextToken]['scope_closer']) === true); - } - - if ($startCondition['code'] === T_MATCH) { - // Move the stackPtr to after the semicolon/comma if there is one. - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($nextToken !== false - && ($tokens[$nextToken]['code'] === T_SEMICOLON - || $tokens[$nextToken]['code'] === T_COMMA) - ) { - $stackPtr = $nextToken; - } - } - - $lineDifference = ($endBrace['line'] - $startBrace['line']); - - $expected = sprintf($this->commentFormat, $startCondition['content']); - $comment = $phpcsFile->findNext([T_COMMENT], $stackPtr, null, false); - - if (($comment === false) || ($tokens[$comment]['line'] !== $endBrace['line'])) { - if ($lineDifference >= $this->lineLimit) { - $error = 'End comment for long condition not found; expected "%s"'; - $data = [$expected]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Missing', $data); - - if ($fix === true) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($next !== false && $tokens[$next]['line'] === $tokens[$stackPtr]['line']) { - $expected .= $phpcsFile->eolChar; - } - - $phpcsFile->fixer->addContent($stackPtr, $expected); - } - } - - return; - } - - if (($comment - $stackPtr) !== 1) { - $error = 'Space found before closing comment; expected "%s"'; - $data = [$expected]; - $phpcsFile->addError($error, $stackPtr, 'SpacingBefore', $data); - } - - if (trim($tokens[$comment]['content']) !== $expected) { - $found = trim($tokens[$comment]['content']); - $error = 'Incorrect closing comment; expected "%s" but found "%s"'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Invalid', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($comment, $expected.$phpcsFile->eolChar); - } - - return; - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php deleted file mode 100644 index 9b36abe7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php +++ /dev/null @@ -1,121 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class PostStatementCommentSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * Exceptions to the rule. - * - * If post statement comments are found within the condition - * parenthesis of these structures, leave them alone. - * - * @var array - */ - private $controlStructureExceptions = [ - T_IF => true, - T_ELSEIF => true, - T_SWITCH => true, - T_WHILE => true, - T_FOR => true, - T_FOREACH => true, - T_MATCH => true, - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_COMMENT]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - if (substr($tokens[$stackPtr]['content'], 0, 2) !== '//') { - return; - } - - $commentLine = $tokens[$stackPtr]['line']; - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - - if ($lastContent === false - || $tokens[$lastContent]['line'] !== $commentLine - || $tokens[$stackPtr]['column'] === 1 - ) { - return; - } - - if ($tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { - return; - } - - // Special case for JS files and PHP closures. - if ($tokens[$lastContent]['code'] === T_COMMA - || $tokens[$lastContent]['code'] === T_SEMICOLON - ) { - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($lastContent - 1), null, true); - if ($lastContent === false || $tokens[$lastContent]['code'] === T_CLOSE_CURLY_BRACKET) { - return; - } - } - - // Special case for (trailing) comments within multi-line control structures. - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; - foreach ($nestedParens as $open => $close) { - if (isset($tokens[$open]['parenthesis_owner']) === true - && isset($this->controlStructureExceptions[$tokens[$tokens[$open]['parenthesis_owner']]['code']]) === true - ) { - return; - } - } - } - - $error = 'Comments may not appear after statements'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($stackPtr); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php deleted file mode 100644 index 61ccbf7a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php +++ /dev/null @@ -1,201 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Common; - -class VariableCommentSniff extends AbstractVariableSniff -{ - - - /** - * Called to process class member vars. - * - * @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 processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $ignore = [ - T_PUBLIC => T_PUBLIC, - T_PRIVATE => T_PRIVATE, - T_PROTECTED => T_PROTECTED, - T_VAR => T_VAR, - T_STATIC => T_STATIC, - T_READONLY => T_READONLY, - T_WHITESPACE => T_WHITESPACE, - T_STRING => T_STRING, - T_NS_SEPARATOR => T_NS_SEPARATOR, - T_NAMESPACE => T_NAMESPACE, - T_NULLABLE => T_NULLABLE, - T_TYPE_UNION => T_TYPE_UNION, - T_TYPE_INTERSECTION => T_TYPE_INTERSECTION, - T_NULL => T_NULL, - T_TRUE => T_TRUE, - T_FALSE => T_FALSE, - T_SELF => T_SELF, - T_PARENT => T_PARENT, - ]; - - for ($commentEnd = ($stackPtr - 1); $commentEnd >= 0; $commentEnd--) { - if (isset($ignore[$tokens[$commentEnd]['code']]) === true) { - continue; - } - - if ($tokens[$commentEnd]['code'] === T_ATTRIBUTE_END - && isset($tokens[$commentEnd]['attribute_opener']) === true - ) { - $commentEnd = $tokens[$commentEnd]['attribute_opener']; - continue; - } - - break; - } - - if ($commentEnd === false - || ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG - && $tokens[$commentEnd]['code'] !== T_COMMENT) - ) { - $phpcsFile->addError('Missing member variable doc comment', $stackPtr, 'Missing'); - return; - } - - if ($tokens[$commentEnd]['code'] === T_COMMENT) { - $phpcsFile->addError('You must use "/**" style comments for a member variable comment', $stackPtr, 'WrongStyle'); - return; - } - - $commentStart = $tokens[$commentEnd]['comment_opener']; - - $foundVar = null; - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { - if ($tokens[$tag]['content'] === '@var') { - if ($foundVar !== null) { - $error = 'Only one @var tag is allowed in a member variable comment'; - $phpcsFile->addError($error, $tag, 'DuplicateVar'); - } else { - $foundVar = $tag; - } - } else if ($tokens[$tag]['content'] === '@see') { - // Make sure the tag isn't empty. - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $tag, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { - $error = 'Content missing for @see tag in member variable comment'; - $phpcsFile->addError($error, $tag, 'EmptySees'); - } - } else { - $error = '%s tag is not allowed in member variable comment'; - $data = [$tokens[$tag]['content']]; - $phpcsFile->addWarning($error, $tag, 'TagNotAllowed', $data); - }//end if - }//end foreach - - // The @var tag is the only one we require. - if ($foundVar === null) { - $error = 'Missing @var tag in member variable comment'; - $phpcsFile->addError($error, $commentEnd, 'MissingVar'); - return; - } - - $firstTag = $tokens[$commentStart]['comment_tags'][0]; - if ($foundVar !== null && $tokens[$firstTag]['content'] !== '@var') { - $error = 'The @var tag must be the first tag in a member variable comment'; - $phpcsFile->addError($error, $foundVar, 'VarOrder'); - } - - // Make sure the tag isn't empty and has the correct padding. - $string = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $foundVar, $commentEnd); - if ($string === false || $tokens[$string]['line'] !== $tokens[$foundVar]['line']) { - $error = 'Content missing for @var tag in member variable comment'; - $phpcsFile->addError($error, $foundVar, 'EmptyVar'); - return; - } - - // Support both a var type and a description. - preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $tokens[($foundVar + 2)]['content'], $varParts); - if (isset($varParts[1]) === false) { - return; - } - - $varType = $varParts[1]; - - // Check var type (can be multiple, separated by '|'). - $typeNames = explode('|', $varType); - $suggestedNames = []; - foreach ($typeNames as $typeName) { - $suggestedName = Common::suggestType($typeName); - if (in_array($suggestedName, $suggestedNames, true) === false) { - $suggestedNames[] = $suggestedName; - } - } - - $suggestedType = implode('|', $suggestedNames); - if ($varType !== $suggestedType) { - $error = 'Expected "%s" but found "%s" for @var tag in member variable comment'; - $data = [ - $suggestedType, - $varType, - ]; - $fix = $phpcsFile->addFixableError($error, $foundVar, 'IncorrectVarType', $data); - if ($fix === true) { - $replacement = $suggestedType; - if (empty($varParts[2]) === false) { - $replacement .= $varParts[2]; - } - - $phpcsFile->fixer->replaceToken(($foundVar + 2), $replacement); - unset($replacement); - } - } - - }//end processMemberVar() - - - /** - * Called to process a normal variable. - * - * Not required for this sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this token was found. - * @param int $stackPtr The position where the double quoted - * string was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - - }//end processVariable() - - - /** - * Called to process variables found in double quoted strings. - * - * Not required for this sniff. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this token was found. - * @param int $stackPtr The position where the double quoted - * string was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - - }//end processVariableInString() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php deleted file mode 100644 index 06fd3edc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php +++ /dev/null @@ -1,337 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ControlSignatureSniff implements Sniff -{ - - /** - * How many spaces should precede the colon if using alternative syntax. - * - * @var integer - */ - public $requiredSpacesBeforeColon = 1; - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_TRY, - T_CATCH, - T_FINALLY, - T_DO, - T_WHILE, - T_FOR, - T_IF, - T_FOREACH, - T_ELSE, - T_ELSEIF, - T_SWITCH, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextNonEmpty === false) { - return; - } - - $isAlternative = false; - if (isset($tokens[$stackPtr]['scope_opener']) === true - && $tokens[$tokens[$stackPtr]['scope_opener']]['code'] === T_COLON - ) { - $isAlternative = true; - } - - // Single space after the keyword. - $expected = 1; - if (isset($tokens[$stackPtr]['parenthesis_closer']) === false && $isAlternative === true) { - // Catching cases like: - // if (condition) : ... else: ... endif - // where there is no condition. - $expected = (int) $this->requiredSpacesBeforeColon; - } - - $found = 1; - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $found = 0; - } else if ($tokens[($stackPtr + 1)]['content'] !== ' ') { - if (strpos($tokens[($stackPtr + 1)]['content'], $phpcsFile->eolChar) !== false) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr + 1)]['length']; - } - } - - if ($found !== $expected) { - $pluralizeSpace = 's'; - if ($expected === 1) { - $pluralizeSpace = ''; - } - - $error = 'Expected %s space%s after %s keyword; %s found'; - $data = [ - $expected, - $pluralizeSpace, - strtoupper($tokens[$stackPtr]['content']), - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent($stackPtr, str_repeat(' ', $expected)); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), str_repeat(' ', $expected)); - } - } - }//end if - - // Single space after closing parenthesis. - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true - && isset($tokens[$stackPtr]['scope_opener']) === true - ) { - $expected = 1; - if ($isAlternative === true) { - $expected = (int) $this->requiredSpacesBeforeColon; - } - - $closer = $tokens[$stackPtr]['parenthesis_closer']; - $opener = $tokens[$stackPtr]['scope_opener']; - $content = $phpcsFile->getTokensAsString(($closer + 1), ($opener - $closer - 1)); - - if (trim($content) === '') { - if (strpos($content, $phpcsFile->eolChar) !== false) { - $found = 'newline'; - } else { - $found = strlen($content); - } - } else { - $found = '"'.str_replace($phpcsFile->eolChar, '\n', $content).'"'; - } - - if ($found !== $expected) { - $pluralizeSpace = 's'; - if ($expected === 1) { - $pluralizeSpace = ''; - } - - $error = 'Expected %s space%s after closing parenthesis; found %s'; - $data = [ - $expected, - $pluralizeSpace, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceAfterCloseParenthesis', $data); - if ($fix === true) { - $padding = str_repeat(' ', $expected); - if ($closer === ($opener - 1)) { - $phpcsFile->fixer->addContent($closer, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - if (trim($content) === '') { - $phpcsFile->fixer->addContent($closer, $padding); - if ($found !== 0) { - for ($i = ($closer + 1); $i < $opener; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } else { - $phpcsFile->fixer->addContent($closer, $padding.$tokens[$opener]['content']); - $phpcsFile->fixer->replaceToken($opener, ''); - - if ($tokens[$opener]['line'] !== $tokens[$closer]['line']) { - $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$opener]['line']) { - for ($i = ($opener + 1); $i < $next; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - } - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - }//end if - }//end if - - // Single newline after opening brace. - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $opener = $tokens[$stackPtr]['scope_opener']; - for ($next = ($opener + 1); $next < $phpcsFile->numTokens; $next++) { - $code = $tokens[$next]['code']; - - if ($code === T_WHITESPACE - || ($code === T_INLINE_HTML - && trim($tokens[$next]['content']) === '') - ) { - continue; - } - - // Skip all empty tokens on the same line as the opener. - if ($tokens[$next]['line'] === $tokens[$opener]['line'] - && (isset(Tokens::$emptyTokens[$code]) === true - || $code === T_CLOSE_TAG) - ) { - continue; - } - - // We found the first bit of a code, or a comment on the - // following line. - break; - }//end for - - if ($tokens[$next]['line'] === $tokens[$opener]['line']) { - $error = 'Newline required after opening brace'; - $fix = $phpcsFile->addFixableError($error, $opener, 'NewlineAfterOpenBrace'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($opener + 1); $i < $next; $i++) { - if (trim($tokens[$i]['content']) !== '') { - break; - } - - // Remove whitespace. - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addContent($opener, $phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } - }//end if - } else if ($tokens[$stackPtr]['code'] === T_WHILE) { - // Zero spaces after parenthesis closer, but only if followed by a semicolon. - $closer = $tokens[$stackPtr]['parenthesis_closer']; - $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($closer + 1), null, true); - if ($nextNonEmpty !== false && $tokens[$nextNonEmpty]['code'] === T_SEMICOLON) { - $found = 0; - if ($tokens[($closer + 1)]['code'] === T_WHITESPACE) { - if (strpos($tokens[($closer + 1)]['content'], $phpcsFile->eolChar) !== false) { - $found = 'newline'; - } else { - $found = $tokens[($closer + 1)]['length']; - } - } - - if ($found !== 0) { - $error = 'Expected 0 spaces before semicolon; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceBeforeSemicolon', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closer + 1), ''); - } - } - } - }//end if - - // Only want to check multi-keyword structures from here on. - if ($tokens[$stackPtr]['code'] === T_WHILE) { - if (isset($tokens[$stackPtr]['scope_closer']) !== false) { - return; - } - - $closer = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($closer === false - || $tokens[$closer]['code'] !== T_CLOSE_CURLY_BRACKET - || $tokens[$tokens[$closer]['scope_condition']]['code'] !== T_DO - ) { - return; - } - } else if ($tokens[$stackPtr]['code'] === T_ELSE - || $tokens[$stackPtr]['code'] === T_ELSEIF - || $tokens[$stackPtr]['code'] === T_CATCH - || $tokens[$stackPtr]['code'] === T_FINALLY - ) { - if (isset($tokens[$stackPtr]['scope_opener']) === true - && $tokens[$tokens[$stackPtr]['scope_opener']]['code'] === T_COLON - ) { - // Special case for alternate syntax, where this token is actually - // the closer for the previous block, so there is no spacing to check. - return; - } - - $closer = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($closer === false || $tokens[$closer]['code'] !== T_CLOSE_CURLY_BRACKET) { - return; - } - } else { - return; - }//end if - - // Single space after closing brace. - $found = 1; - if ($tokens[($closer + 1)]['code'] !== T_WHITESPACE) { - $found = 0; - } else if ($tokens[$closer]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else if ($tokens[($closer + 1)]['content'] !== ' ') { - $found = $tokens[($closer + 1)]['length']; - } - - if ($found !== 1) { - $error = 'Expected 1 space after closing brace; %s found'; - $data = [$found]; - - if ($phpcsFile->findNext(Tokens::$commentTokens, ($closer + 1), $stackPtr) !== false) { - // Comment found between closing brace and keyword, don't auto-fix. - $phpcsFile->addError($error, $closer, 'SpaceAfterCloseBrace', $data); - return; - } - - $fix = $phpcsFile->addFixableError($error, $closer, 'SpaceAfterCloseBrace', $data); - if ($fix === true) { - if ($found === 0) { - $phpcsFile->fixer->addContent($closer, ' '); - } else { - $phpcsFile->fixer->replaceToken(($closer + 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php deleted file mode 100644 index 3cdb901d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ElseIfDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_ELSEIF]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $error = 'Usage of ELSEIF not allowed; use ELSE IF instead'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotAllowed'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, 'else if'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php deleted file mode 100644 index bd51b265..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php +++ /dev/null @@ -1,236 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ForEachLoopDeclarationSniff implements Sniff -{ - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FOREACH]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - $tokens = $phpcsFile->getTokens(); - - $openingBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr); - if ($openingBracket === false) { - $error = 'Possible parse error: FOREACH has no opening parenthesis'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingOpenParenthesis'); - return; - } - - if (isset($tokens[$openingBracket]['parenthesis_closer']) === false) { - $error = 'Possible parse error: FOREACH has no closing parenthesis'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingCloseParenthesis'); - return; - } - - $closingBracket = $tokens[$openingBracket]['parenthesis_closer']; - - if ($this->requiredSpacesAfterOpen === 0 && $tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { - $error = 'Space found after opening bracket of FOREACH loop'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpen'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openingBracket + 1), ''); - } - } else if ($this->requiredSpacesAfterOpen > 0) { - $spaceAfterOpen = 0; - if ($tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { - $spaceAfterOpen = $tokens[($openingBracket + 1)]['length']; - } - - if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { - $error = 'Expected %s spaces after opening bracket; %s found'; - $data = [ - $this->requiredSpacesAfterOpen, - $spaceAfterOpen, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); - if ($spaceAfterOpen === 0) { - $phpcsFile->fixer->addContent($openingBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($openingBracket + 1), $padding); - } - } - } - }//end if - - if ($this->requiredSpacesBeforeClose === 0 && $tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { - $error = 'Space found before closing bracket of FOREACH loop'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($closingBracket - 1), ''); - } - } else if ($this->requiredSpacesBeforeClose > 0) { - $spaceBeforeClose = 0; - if ($tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = $tokens[($closingBracket - 1)]['length']; - } - - if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) { - $error = 'Expected %s spaces before closing bracket; %s found'; - $data = [ - $this->requiredSpacesBeforeClose, - $spaceBeforeClose, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); - if ($spaceBeforeClose === 0) { - $phpcsFile->fixer->addContentBefore($closingBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($closingBracket - 1), $padding); - } - } - } - }//end if - - $asToken = $phpcsFile->findNext(T_AS, $openingBracket); - if ($asToken === false) { - $error = 'Possible parse error: FOREACH has no AS statement'; - $phpcsFile->addWarning($error, $stackPtr, 'MissingAs'); - return; - } - - $content = $tokens[$asToken]['content']; - if ($content !== strtolower($content)) { - $expected = strtolower($content); - $error = 'AS keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - $expected, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $asToken, 'AsNotLower', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($asToken, $expected); - } - } - - $doubleArrow = $phpcsFile->findNext(T_DOUBLE_ARROW, $asToken, $closingBracket); - - if ($doubleArrow !== false) { - if ($tokens[($doubleArrow - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before "=>"; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeArrow'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($doubleArrow, ' '); - } - } else { - if ($tokens[($doubleArrow - 1)]['length'] !== 1) { - $spaces = $tokens[($doubleArrow - 1)]['length']; - $error = 'Expected 1 space before "=>"; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($doubleArrow - 1), ' '); - } - } - } - - if ($tokens[($doubleArrow + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after "=>"; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterArrow'); - if ($fix === true) { - $phpcsFile->fixer->addContent($doubleArrow, ' '); - } - } else { - if ($tokens[($doubleArrow + 1)]['length'] !== 1) { - $spaces = $tokens[($doubleArrow + 1)]['length']; - $error = 'Expected 1 space after "=>"; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterArrow', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($doubleArrow + 1), ' '); - } - } - } - }//end if - - if ($tokens[($asToken - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before "as"; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeAs'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($asToken, ' '); - } - } else { - if ($tokens[($asToken - 1)]['length'] !== 1) { - $spaces = $tokens[($asToken - 1)]['length']; - $error = 'Expected 1 space before "as"; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeAs', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($asToken - 1), ' '); - } - } - } - - if ($tokens[($asToken + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after "as"; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterAs'); - if ($fix === true) { - $phpcsFile->fixer->addContent($asToken, ' '); - } - } else { - if ($tokens[($asToken + 1)]['length'] !== 1) { - $spaces = $tokens[($asToken + 1)]['length']; - $error = 'Expected 1 space after "as"; %s found'; - $data = [$spaces]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterAs', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($asToken + 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php deleted file mode 100644 index 38313e16..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php +++ /dev/null @@ -1,316 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ForLoopDeclarationSniff implements Sniff -{ - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FOR]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - $tokens = $phpcsFile->getTokens(); - - $openingBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr); - if ($openingBracket === false || isset($tokens[$openingBracket]['parenthesis_closer']) === false) { - $error = 'Possible parse error: no opening/closing parenthesis for FOR keyword'; - $phpcsFile->addWarning($error, $stackPtr, 'NoOpenBracket'); - return; - } - - $closingBracket = $tokens[$openingBracket]['parenthesis_closer']; - - if ($this->requiredSpacesAfterOpen === 0 - && $tokens[($openingBracket + 1)]['code'] === T_WHITESPACE - ) { - $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($openingBracket + 1), $closingBracket, true); - if ($this->ignoreNewlines === false - || $tokens[$nextNonWhiteSpace]['line'] === $tokens[$openingBracket]['line'] - ) { - $error = 'Whitespace found after opening bracket of FOR loop'; - $fix = $phpcsFile->addFixableError($error, $openingBracket, 'SpacingAfterOpen'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($openingBracket + 1); $i < $closingBracket; $i++) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } else if ($this->requiredSpacesAfterOpen > 0) { - $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($openingBracket + 1), $closingBracket, true); - $spaceAfterOpen = 0; - if ($tokens[$openingBracket]['line'] !== $tokens[$nextNonWhiteSpace]['line']) { - $spaceAfterOpen = 'newline'; - } else if ($tokens[($openingBracket + 1)]['code'] === T_WHITESPACE) { - $spaceAfterOpen = $tokens[($openingBracket + 1)]['length']; - } - - if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen - && ($this->ignoreNewlines === false - || $spaceAfterOpen !== 'newline') - ) { - $error = 'Expected %s spaces after opening bracket; %s found'; - $data = [ - $this->requiredSpacesAfterOpen, - $spaceAfterOpen, - ]; - $fix = $phpcsFile->addFixableError($error, $openingBracket, 'SpacingAfterOpen', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); - if ($spaceAfterOpen === 0) { - $phpcsFile->fixer->addContent($openingBracket, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($openingBracket + 1), $padding); - for ($i = ($openingBracket + 2); $i < $nextNonWhiteSpace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - }//end if - - $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingBracket - 1), $openingBracket, true); - $beforeClosefixable = true; - if ($tokens[$prevNonWhiteSpace]['line'] !== $tokens[$closingBracket]['line'] - && isset(Tokens::$emptyTokens[$tokens[$prevNonWhiteSpace]['code']]) === true - ) { - $beforeClosefixable = false; - } - - if ($this->requiredSpacesBeforeClose === 0 - && $tokens[($closingBracket - 1)]['code'] === T_WHITESPACE - && ($this->ignoreNewlines === false - || $tokens[$prevNonWhiteSpace]['line'] === $tokens[$closingBracket]['line']) - ) { - $error = 'Whitespace found before closing bracket of FOR loop'; - - if ($beforeClosefixable === false) { - $phpcsFile->addError($error, $closingBracket, 'SpacingBeforeClose'); - } else { - $fix = $phpcsFile->addFixableError($error, $closingBracket, 'SpacingBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closingBracket - 1); $i > $openingBracket; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } else if ($this->requiredSpacesBeforeClose > 0) { - $spaceBeforeClose = 0; - if ($tokens[$closingBracket]['line'] !== $tokens[$prevNonWhiteSpace]['line']) { - $spaceBeforeClose = 'newline'; - } else if ($tokens[($closingBracket - 1)]['code'] === T_WHITESPACE) { - $spaceBeforeClose = $tokens[($closingBracket - 1)]['length']; - } - - if ($this->requiredSpacesBeforeClose !== $spaceBeforeClose - && ($this->ignoreNewlines === false - || $spaceBeforeClose !== 'newline') - ) { - $error = 'Expected %s spaces before closing bracket; %s found'; - $data = [ - $this->requiredSpacesBeforeClose, - $spaceBeforeClose, - ]; - - if ($beforeClosefixable === false) { - $phpcsFile->addError($error, $closingBracket, 'SpacingBeforeClose', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $closingBracket, 'SpacingBeforeClose', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); - if ($spaceBeforeClose === 0) { - $phpcsFile->fixer->addContentBefore($closingBracket, $padding); - } else { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($closingBracket - 1), $padding); - for ($i = ($closingBracket - 2); $i > $prevNonWhiteSpace; $i--) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } - }//end if - }//end if - - /* - * Check whitespace around each of the semicolon tokens. - */ - - $semicolonCount = 0; - $semicolon = $openingBracket; - $targetNestinglevel = 0; - if (isset($tokens[$openingBracket]['conditions']) === true) { - $targetNestinglevel = count($tokens[$openingBracket]['conditions']); - } - - do { - $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($semicolon + 1), $closingBracket); - if ($semicolon === false) { - break; - } - - if (isset($tokens[$semicolon]['conditions']) === true - && count($tokens[$semicolon]['conditions']) > $targetNestinglevel - ) { - // Semicolon doesn't belong to the for(). - continue; - } - - ++$semicolonCount; - - $humanReadableCount = 'first'; - if ($semicolonCount !== 1) { - $humanReadableCount = 'second'; - } - - $humanReadableCode = ucfirst($humanReadableCount); - $data = [$humanReadableCount]; - - // Only examine the space before the first semicolon if the first expression is not empty. - // If it *is* empty, leave it up to the `SpacingAfterOpen` logic. - $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($semicolon - 1), $openingBracket, true); - if ($semicolonCount !== 1 || $prevNonWhiteSpace !== $openingBracket) { - if ($tokens[($semicolon - 1)]['code'] === T_WHITESPACE) { - $error = 'Whitespace found before %s semicolon of FOR loop'; - $errorCode = 'SpacingBefore'.$humanReadableCode; - $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($semicolon - 1); $i > $prevNonWhiteSpace; $i--) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - } - - // Only examine the space after the second semicolon if the last expression is not empty. - // If it *is* empty, leave it up to the `SpacingBeforeClose` logic. - $nextNonWhiteSpace = $phpcsFile->findNext(T_WHITESPACE, ($semicolon + 1), ($closingBracket + 1), true); - if ($semicolonCount !== 2 || $nextNonWhiteSpace !== $closingBracket) { - if ($tokens[($semicolon + 1)]['code'] !== T_WHITESPACE - && $tokens[($semicolon + 1)]['code'] !== T_SEMICOLON - ) { - $error = 'Expected 1 space after %s semicolon of FOR loop; 0 found'; - $errorCode = 'NoSpaceAfter'.$humanReadableCode; - $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($semicolon, ' '); - } - } else if ($tokens[($semicolon + 1)]['code'] === T_WHITESPACE - && $tokens[$nextNonWhiteSpace]['code'] !== T_SEMICOLON - ) { - $spaces = $tokens[($semicolon + 1)]['length']; - if ($tokens[$semicolon]['line'] !== $tokens[$nextNonWhiteSpace]['line']) { - $spaces = 'newline'; - } - - if ($spaces !== 1 - && ($this->ignoreNewlines === false - || $spaces !== 'newline') - ) { - $error = 'Expected 1 space after %s semicolon of FOR loop; %s found'; - $errorCode = 'SpacingAfter'.$humanReadableCode; - $data[] = $spaces; - $fix = $phpcsFile->addFixableError($error, $semicolon, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($semicolon + 1), ' '); - for ($i = ($semicolon + 2); $i < $nextNonWhiteSpace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - }//end if - } while ($semicolonCount < 2); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php deleted file mode 100644 index ff39c847..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php +++ /dev/null @@ -1,155 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class InlineIfDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INLINE_THEN]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - $openBracket = null; - $closeBracket = null; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $parens = $tokens[$stackPtr]['nested_parenthesis']; - $openBracket = array_pop($parens); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - } - - // Find the beginning of the statement. If we don't find a - // semicolon (end of statement) or comma (end of array value) - // then assume the content before the closing parenthesis is the end. - $else = $phpcsFile->findNext(T_INLINE_ELSE, ($stackPtr + 1)); - $statementEnd = $phpcsFile->findNext([T_SEMICOLON, T_COMMA], ($else + 1), $closeBracket); - if ($statementEnd === false) { - $statementEnd = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true); - } - - // Make sure it's all on the same line. - if ($tokens[$statementEnd]['line'] !== $tokens[$stackPtr]['line']) { - $error = 'Inline shorthand IF statement must be declared on a single line'; - $phpcsFile->addError($error, $stackPtr, 'NotSingleLine'); - return; - } - - // Make sure there are spaces around the question mark. - $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$contentBefore]['code'] !== T_CLOSE_PARENTHESIS) { - $error = 'Inline shorthand IF statement requires brackets around comparison'; - $phpcsFile->addError($error, $stackPtr, 'NoBrackets'); - } - - $spaceBefore = ($tokens[$stackPtr]['column'] - ($tokens[$contentBefore]['column'] + $tokens[$contentBefore]['length'])); - if ($spaceBefore !== 1) { - $error = 'Inline shorthand IF statement requires 1 space before THEN; %s found'; - $data = [$spaceBefore]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeThen', $data); - if ($fix === true) { - if ($spaceBefore === 0) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - } - } - - // If there is no content between the ? and the : operators, then they are - // trying to replicate an elvis operator, even though PHP doesn't have one. - // In this case, we want no spaces between the two operators so ?: looks like - // an operator itself. - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_INLINE_ELSE) { - $inlineElse = $next; - if ($inlineElse !== ($stackPtr + 1)) { - $error = 'Inline shorthand IF statement without THEN statement requires 0 spaces between THEN and ELSE'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ElvisSpacing'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - } - } else { - $spaceAfter = (($tokens[$contentAfter]['column']) - ($tokens[$stackPtr]['column'] + 1)); - if ($spaceAfter !== 1) { - $error = 'Inline shorthand IF statement requires 1 space after THEN; %s found'; - $data = [$spaceAfter]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterThen', $data); - if ($fix === true) { - if ($spaceAfter === 0) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } else { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } - - // Make sure the ELSE has the correct spacing. - $inlineElse = $phpcsFile->findNext(T_INLINE_ELSE, ($stackPtr + 1), $statementEnd, false); - $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($inlineElse - 1), null, true); - $spaceBefore = ($tokens[$inlineElse]['column'] - ($tokens[$contentBefore]['column'] + $tokens[$contentBefore]['length'])); - if ($spaceBefore !== 1) { - $error = 'Inline shorthand IF statement requires 1 space before ELSE; %s found'; - $data = [$spaceBefore]; - $fix = $phpcsFile->addFixableError($error, $inlineElse, 'SpacingBeforeElse', $data); - if ($fix === true) { - if ($spaceBefore === 0) { - $phpcsFile->fixer->addContentBefore($inlineElse, ' '); - } else { - $phpcsFile->fixer->replaceToken(($inlineElse - 1), ' '); - } - } - } - }//end if - - $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($inlineElse + 1), null, true); - $spaceAfter = (($tokens[$contentAfter]['column']) - ($tokens[$inlineElse]['column'] + 1)); - if ($spaceAfter !== 1) { - $error = 'Inline shorthand IF statement requires 1 space after ELSE; %s found'; - $data = [$spaceAfter]; - $fix = $phpcsFile->addFixableError($error, $inlineElse, 'SpacingAfterElse', $data); - if ($fix === true) { - if ($spaceAfter === 0) { - $phpcsFile->fixer->addContent($inlineElse, ' '); - } else { - $phpcsFile->fixer->replaceToken(($inlineElse + 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php deleted file mode 100644 index 068563c0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class LowercaseDeclarationSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_ELSE, - T_ELSEIF, - T_FOREACH, - T_FOR, - T_DO, - T_SWITCH, - T_WHILE, - T_TRY, - T_CATCH, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 ($content !== $contentLc) { - $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - strtoupper($content), - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php deleted file mode 100644 index be46aed5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php +++ /dev/null @@ -1,304 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SwitchDeclarationSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * The number of spaces code should be indented. - * - * @var integer - */ - public $indent = 4; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_SWITCH]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // We can't process SWITCH statements unless we know where they start and end. - if (isset($tokens[$stackPtr]['scope_opener']) === false - || isset($tokens[$stackPtr]['scope_closer']) === false - ) { - return; - } - - $switch = $tokens[$stackPtr]; - $nextCase = $stackPtr; - $caseAlignment = ($switch['column'] + $this->indent); - $caseCount = 0; - $foundDefault = false; - - while (($nextCase = $phpcsFile->findNext([T_CASE, T_DEFAULT, T_SWITCH], ($nextCase + 1), $switch['scope_closer'])) !== false) { - // Skip nested SWITCH statements; they are handled on their own. - if ($tokens[$nextCase]['code'] === T_SWITCH) { - $nextCase = $tokens[$nextCase]['scope_closer']; - continue; - } - - if ($tokens[$nextCase]['code'] === T_DEFAULT) { - $type = 'Default'; - $foundDefault = true; - } else { - $type = 'Case'; - $caseCount++; - } - - if ($tokens[$nextCase]['content'] !== strtolower($tokens[$nextCase]['content'])) { - $expected = strtolower($tokens[$nextCase]['content']); - $error = strtoupper($type).' keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - $expected, - $tokens[$nextCase]['content'], - ]; - - $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'NotLower', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($nextCase, $expected); - } - } - - if ($tokens[$nextCase]['column'] !== $caseAlignment) { - $error = strtoupper($type).' keyword must be indented '.$this->indent.' spaces from SWITCH keyword'; - $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'Indent'); - - if ($fix === true) { - $padding = str_repeat(' ', ($caseAlignment - 1)); - if ($tokens[$nextCase]['column'] === 1 - || $tokens[($nextCase - 1)]['code'] !== T_WHITESPACE - ) { - $phpcsFile->fixer->addContentBefore($nextCase, $padding); - } else { - $phpcsFile->fixer->replaceToken(($nextCase - 1), $padding); - } - } - } - - if ($type === 'Case' - && ($tokens[($nextCase + 1)]['type'] !== 'T_WHITESPACE' - || $tokens[($nextCase + 1)]['content'] !== ' ') - ) { - $error = 'CASE keyword must be followed by a single space'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpacingAfterCase'); - if ($fix === true) { - if ($tokens[($nextCase + 1)]['type'] !== 'T_WHITESPACE') { - $phpcsFile->fixer->addContent($nextCase, ' '); - } else { - $phpcsFile->fixer->replaceToken(($nextCase + 1), ' '); - } - } - } - - if (isset($tokens[$nextCase]['scope_opener']) === false) { - $error = 'Possible parse error: CASE missing opening colon'; - $phpcsFile->addWarning($error, $nextCase, 'MissingColon'); - continue; - } - - $opener = $tokens[$nextCase]['scope_opener']; - if ($tokens[($opener - 1)]['type'] === 'T_WHITESPACE') { - $error = 'There must be no space before the colon in a '.strtoupper($type).' statement'; - $fix = $phpcsFile->addFixableError($error, $nextCase, 'SpaceBeforeColon'.$type); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($opener - 1), ''); - } - } - - $nextBreak = $tokens[$nextCase]['scope_closer']; - if ($tokens[$nextBreak]['code'] === T_BREAK - || $tokens[$nextBreak]['code'] === T_RETURN - || $tokens[$nextBreak]['code'] === T_CONTINUE - || $tokens[$nextBreak]['code'] === T_THROW - || $tokens[$nextBreak]['code'] === T_EXIT - ) { - if ($tokens[$nextBreak]['scope_condition'] === $nextCase) { - // Only need to check a couple of things once, even if the - // break is shared between multiple case statements, or even - // the default case. - if ($tokens[$nextBreak]['column'] !== $caseAlignment) { - $error = 'Case breaking statement must be indented '.$this->indent.' spaces from SWITCH keyword'; - $fix = $phpcsFile->addFixableError($error, $nextBreak, 'BreakIndent'); - - if ($fix === true) { - $padding = str_repeat(' ', ($caseAlignment - 1)); - if ($tokens[$nextBreak]['column'] === 1 - || $tokens[($nextBreak - 1)]['code'] !== T_WHITESPACE - ) { - $phpcsFile->fixer->addContentBefore($nextBreak, $padding); - } else { - $phpcsFile->fixer->replaceToken(($nextBreak - 1), $padding); - } - } - } - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($nextBreak - 1), $stackPtr, true); - if ($tokens[$prev]['line'] !== ($tokens[$nextBreak]['line'] - 1)) { - $error = 'Blank lines are not allowed before case breaking statements'; - $phpcsFile->addError($error, $nextBreak, 'SpacingBeforeBreak'); - } - - $nextLine = $tokens[$tokens[$stackPtr]['scope_closer']]['line']; - $semicolon = $phpcsFile->findEndOfStatement($nextBreak); - for ($i = ($semicolon + 1); $i < $tokens[$stackPtr]['scope_closer']; $i++) { - if ($tokens[$i]['type'] !== 'T_WHITESPACE') { - $nextLine = $tokens[$i]['line']; - break; - } - } - - if ($type === 'Case') { - // Ensure the BREAK statement is followed by - // a single blank line, or the end switch brace. - if ($nextLine !== ($tokens[$semicolon]['line'] + 2) && $i !== $tokens[$stackPtr]['scope_closer']) { - $error = 'Case breaking statements must be followed by a single blank line'; - $fix = $phpcsFile->addFixableError($error, $nextBreak, 'SpacingAfterBreak'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($semicolon + 1); $i <= $tokens[$stackPtr]['scope_closer']; $i++) { - if ($tokens[$i]['line'] === $nextLine) { - $phpcsFile->fixer->addNewlineBefore($i); - break; - } - - if ($tokens[$i]['line'] === $tokens[$semicolon]['line']) { - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - } else { - // Ensure the BREAK statement is not followed by a blank line. - if ($nextLine !== ($tokens[$semicolon]['line'] + 1)) { - $error = 'Blank lines are not allowed after the DEFAULT case\'s breaking statement'; - $phpcsFile->addError($error, $nextBreak, 'SpacingAfterDefaultBreak'); - } - }//end if - - $caseLine = $tokens[$nextCase]['line']; - $nextLine = $tokens[$nextBreak]['line']; - for ($i = ($opener + 1); $i < $nextBreak; $i++) { - if ($tokens[$i]['type'] !== 'T_WHITESPACE') { - $nextLine = $tokens[$i]['line']; - break; - } - } - - if ($nextLine !== ($caseLine + 1)) { - $error = 'Blank lines are not allowed after '.strtoupper($type).' statements'; - $phpcsFile->addError($error, $nextCase, 'SpacingAfter'.$type); - } - }//end if - - if ($tokens[$nextBreak]['code'] === T_BREAK) { - if ($type === 'Case') { - // Ensure empty CASE statements are not allowed. - // They must have some code content in them. A comment is not enough. - // But count RETURN statements as valid content if they also - // happen to close the CASE statement. - $foundContent = false; - for ($i = ($tokens[$nextCase]['scope_opener'] + 1); $i < $nextBreak; $i++) { - if ($tokens[$i]['code'] === T_CASE) { - $i = $tokens[$i]['scope_opener']; - continue; - } - - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { - $foundContent = true; - break; - } - } - - if ($foundContent === false) { - $error = 'Empty CASE statements are not allowed'; - $phpcsFile->addError($error, $nextCase, 'EmptyCase'); - } - } else { - // Ensure empty DEFAULT statements are not allowed. - // They must (at least) have a comment describing why - // the default case is being ignored. - $foundContent = false; - for ($i = ($tokens[$nextCase]['scope_opener'] + 1); $i < $nextBreak; $i++) { - if ($tokens[$i]['type'] !== 'T_WHITESPACE') { - $foundContent = true; - break; - } - } - - if ($foundContent === false) { - $error = 'Comment required for empty DEFAULT case'; - $phpcsFile->addError($error, $nextCase, 'EmptyDefault'); - } - }//end if - }//end if - } else if ($type === 'Default') { - $error = 'DEFAULT case must have a breaking statement'; - $phpcsFile->addError($error, $nextCase, 'DefaultNoBreak'); - }//end if - }//end while - - if ($foundDefault === false) { - $error = 'All SWITCH statements must contain a DEFAULT case'; - $phpcsFile->addError($error, $stackPtr, 'MissingDefault'); - } - - if ($tokens[$switch['scope_closer']]['column'] !== $switch['column']) { - $error = 'Closing brace of SWITCH statement must be aligned with SWITCH keyword'; - $phpcsFile->addError($error, $switch['scope_closer'], 'CloseBraceAlign'); - } - - if ($caseCount === 0) { - $error = 'SWITCH statements must contain at least one CASE statement'; - $phpcsFile->addError($error, $stackPtr, 'MissingCase'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php deleted file mode 100644 index 652391f1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class JSLintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return int - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If jslint.js could not be run. - */ - public function process(File $phpcsFile, $stackPtr) - { - $rhinoPath = Config::getExecutablePath('rhino'); - $jslintPath = Config::getExecutablePath('jslint'); - if ($rhinoPath === null || $jslintPath === null) { - return $phpcsFile->numTokens; - } - - $fileName = $phpcsFile->getFilename(); - - $rhinoPath = Common::escapeshellcmd($rhinoPath); - $jslintPath = Common::escapeshellcmd($jslintPath); - - $cmd = "$rhinoPath \"$jslintPath\" ".escapeshellarg($fileName); - exec($cmd, $output, $retval); - - if (is_array($output) === true) { - foreach ($output as $finding) { - $matches = []; - $numMatches = preg_match('/Lint at line ([0-9]+).*:(.*)$/', $finding, $matches); - if ($numMatches === 0) { - continue; - } - - $line = (int) $matches[1]; - $message = 'jslint says: '.trim($matches[2]); - $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php deleted file mode 100644 index 031b2e39..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Common; - -class JavaScriptLintSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @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 $phpcsFile->numTokens; - } - - $fileName = $phpcsFile->getFilename(); - - $cmd = '"'.Common::escapeshellcmd($jslPath).'" -nologo -nofilelisting -nocontext -nosummary -output-format __LINE__:__ERROR__ -process '.escapeshellarg($fileName); - $msg = exec($cmd, $output, $retval); - - // Variable $exitCode is the last line of $output if no error occurs, on - // error it is numeric. Try to handle various error conditions and - // provide useful error reporting. - if ($retval === 2 || $retval === 4) { - if (is_array($output) === true) { - $msg = implode('\n', $output); - } - - throw new RuntimeException("Failed invoking JavaScript Lint, retval was [$retval], output was [$msg]"); - } - - if (is_array($output) === true) { - foreach ($output as $finding) { - $split = strpos($finding, ':'); - $line = substr($finding, 0, $split); - $message = substr($finding, ($split + 1)); - $phpcsFile->addWarningOnLine(trim($message), $line, 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php deleted file mode 100644 index aceecffd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FileExtensionSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $fileName = $phpcsFile->getFilename(); - $extension = substr($fileName, strrpos($fileName, '.')); - $nextClass = $phpcsFile->findNext([T_CLASS, T_INTERFACE, T_TRAIT, T_ENUM], $stackPtr); - - if ($nextClass !== false) { - $phpcsFile->recordMetric($stackPtr, 'File extension for class files', $extension); - if ($extension === '.php') { - $error = '%s found in ".php" file; use ".inc" extension instead'; - $data = [ucfirst($tokens[$nextClass]['content'])]; - $phpcsFile->addError($error, $stackPtr, 'ClassFound', $data); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'File extension for non-class files', $extension); - if ($extension === '.inc') { - $error = 'No interface or class found in ".inc" file; use ".php" extension instead'; - $phpcsFile->addError($error, $stackPtr, 'NoClass'); - } - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php deleted file mode 100644 index b79e6b3e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php +++ /dev/null @@ -1,395 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OperatorBracketSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$operators; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if ($phpcsFile->tokenizerType === 'JS' && $tokens[$stackPtr]['code'] === T_PLUS) { - // JavaScript uses the plus operator for string concatenation as well - // so we cannot accurately determine if it is a string concat or addition. - // So just ignore it. - return; - } - - // If the & is a reference, then we don't want to check for brackets. - if ($tokens[$stackPtr]['code'] === T_BITWISE_AND && $phpcsFile->isReference($stackPtr) === true) { - return; - } - - // There is one instance where brackets aren't needed, which involves - // the minus sign being used to assign a negative number to a variable. - if ($tokens[$stackPtr]['code'] === T_MINUS) { - // Check to see if we are trying to return -n. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_RETURN) { - return; - } - - $number = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$number]['code'] === T_LNUMBER || $tokens[$number]['code'] === T_DNUMBER) { - $previous = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($previous !== false) { - $isAssignment = isset(Tokens::$assignmentTokens[$tokens[$previous]['code']]); - $isEquality = isset(Tokens::$equalityTokens[$tokens[$previous]['code']]); - $isComparison = isset(Tokens::$comparisonTokens[$tokens[$previous]['code']]); - $isUnary = isset(Tokens::$operators[$tokens[$previous]['code']]); - if ($isAssignment === true || $isEquality === true || $isComparison === true || $isUnary === true) { - // This is a negative assignment or comparison. - // We need to check that the minus and the number are - // adjacent. - if (($number - $stackPtr) !== 1) { - $error = 'No space allowed between minus sign and number'; - $phpcsFile->addError($error, $stackPtr, 'SpacingAfterMinus'); - } - - return; - } - } - } - }//end if - - $previousToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true, null, true); - if ($previousToken !== false) { - // A list of tokens that indicate that the token is not - // part of an arithmetic operation. - $invalidTokens = [ - T_COMMA => true, - T_COLON => true, - T_OPEN_PARENTHESIS => true, - T_OPEN_SQUARE_BRACKET => true, - T_OPEN_CURLY_BRACKET => true, - T_OPEN_SHORT_ARRAY => true, - T_CASE => true, - T_EXIT => true, - T_MATCH_ARROW => true, - ]; - - if (isset($invalidTokens[$tokens[$previousToken]['code']]) === true) { - return; - } - } - - if ($tokens[$stackPtr]['code'] === T_BITWISE_OR - && isset($tokens[$stackPtr]['nested_parenthesis']) === true - ) { - $brackets = $tokens[$stackPtr]['nested_parenthesis']; - $lastBracket = array_pop($brackets); - if (isset($tokens[$lastBracket]['parenthesis_owner']) === true - && $tokens[$tokens[$lastBracket]['parenthesis_owner']]['code'] === T_CATCH - ) { - // This is a pipe character inside a catch statement, so it is acting - // as an exception type separator and not an arithmetic operation. - return; - } - } - - // Tokens that are allowed inside a bracketed operation. - $allowed = [ - T_VARIABLE, - T_LNUMBER, - T_DNUMBER, - T_STRING, - T_WHITESPACE, - T_NS_SEPARATOR, - T_THIS, - T_SELF, - T_STATIC, - T_PARENT, - T_OBJECT_OPERATOR, - T_NULLSAFE_OBJECT_OPERATOR, - T_DOUBLE_COLON, - T_OPEN_SQUARE_BRACKET, - T_CLOSE_SQUARE_BRACKET, - T_MODULUS, - T_NONE, - T_BITWISE_NOT, - ]; - - $allowed += Tokens::$operators; - - $lastBracket = false; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $parenthesis = array_reverse($tokens[$stackPtr]['nested_parenthesis'], true); - foreach ($parenthesis as $bracket => $endBracket) { - $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($bracket - 1), null, true); - $prevCode = $tokens[$prevToken]['code']; - - if ($prevCode === T_ISSET) { - // This operation is inside an isset() call, but has - // no bracket of it's own. - break; - } - - if ($prevCode === T_STRING || $prevCode === T_SWITCH || $prevCode === T_MATCH) { - // We allow simple operations to not be bracketed. - // For example, ceil($one / $two). - for ($prev = ($stackPtr - 1); $prev > $bracket; $prev--) { - if (in_array($tokens[$prev]['code'], $allowed, true) === true) { - continue; - } - - if ($tokens[$prev]['code'] === T_CLOSE_PARENTHESIS) { - $prev = $tokens[$prev]['parenthesis_opener']; - } else { - break; - } - } - - if ($prev !== $bracket) { - break; - } - - for ($next = ($stackPtr + 1); $next < $endBracket; $next++) { - if (in_array($tokens[$next]['code'], $allowed, true) === true) { - continue; - } - - if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) { - $next = $tokens[$next]['parenthesis_closer']; - } else { - break; - } - } - - if ($next !== $endBracket) { - break; - } - }//end if - - if (in_array($prevCode, Tokens::$scopeOpeners, true) === true) { - // This operation is inside a control structure like FOREACH - // or IF, but has no bracket of it's own. - // The only control structures allowed to do this are SWITCH and MATCH. - if ($prevCode !== T_SWITCH && $prevCode !== T_MATCH) { - break; - } - } - - if ($prevCode === T_OPEN_PARENTHESIS) { - // These are two open parenthesis in a row. If the current - // one doesn't enclose the operator, go to the previous one. - if ($endBracket < $stackPtr) { - continue; - } - } - - $lastBracket = $bracket; - break; - }//end foreach - }//end if - - if ($lastBracket === false) { - // It is not in a bracketed statement at all. - $this->addMissingBracketsError($phpcsFile, $stackPtr); - return; - } else if ($tokens[$lastBracket]['parenthesis_closer'] < $stackPtr) { - // There are a set of brackets in front of it that don't include it. - $this->addMissingBracketsError($phpcsFile, $stackPtr); - return; - } else { - // We are enclosed in a set of bracket, so the last thing to - // check is that we are not also enclosed in square brackets - // like this: ($array[$index + 1]), which is invalid. - $brackets = [ - T_OPEN_SQUARE_BRACKET, - T_CLOSE_SQUARE_BRACKET, - ]; - - $squareBracket = $phpcsFile->findPrevious($brackets, ($stackPtr - 1), $lastBracket); - if ($squareBracket !== false && $tokens[$squareBracket]['code'] === T_OPEN_SQUARE_BRACKET) { - $closeSquareBracket = $phpcsFile->findNext($brackets, ($stackPtr + 1)); - if ($closeSquareBracket !== false && $tokens[$closeSquareBracket]['code'] === T_CLOSE_SQUARE_BRACKET) { - $this->addMissingBracketsError($phpcsFile, $stackPtr); - } - } - - return; - }//end if - - $lastAssignment = $phpcsFile->findPrevious(Tokens::$assignmentTokens, $stackPtr, null, false, null, true); - if ($lastAssignment !== false && $lastAssignment > $lastBracket) { - $this->addMissingBracketsError($phpcsFile, $stackPtr); - } - - }//end process() - - - /** - * Add and fix the missing brackets error. - * - * @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 addMissingBracketsError($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $allowed = [ - T_VARIABLE => true, - T_LNUMBER => true, - T_DNUMBER => true, - T_STRING => true, - T_CONSTANT_ENCAPSED_STRING => true, - T_DOUBLE_QUOTED_STRING => true, - T_WHITESPACE => true, - T_NS_SEPARATOR => true, - T_THIS => true, - T_SELF => true, - T_STATIC => true, - T_OBJECT_OPERATOR => true, - T_NULLSAFE_OBJECT_OPERATOR => true, - T_DOUBLE_COLON => true, - T_MODULUS => true, - T_ISSET => true, - T_ARRAY => true, - T_NONE => true, - T_BITWISE_NOT => true, - ]; - - // Find the first token in the expression. - for ($before = ($stackPtr - 1); $before > 0; $before--) { - // Special case for plus operators because we can't tell if they are used - // for addition or string contact. So assume string concat to be safe. - if ($phpcsFile->tokenizerType === 'JS' && $tokens[$before]['code'] === T_PLUS) { - break; - } - - if (isset(Tokens::$emptyTokens[$tokens[$before]['code']]) === true - || isset(Tokens::$operators[$tokens[$before]['code']]) === true - || isset(Tokens::$castTokens[$tokens[$before]['code']]) === true - || isset($allowed[$tokens[$before]['code']]) === true - ) { - continue; - } - - if ($tokens[$before]['code'] === T_CLOSE_PARENTHESIS) { - $before = $tokens[$before]['parenthesis_opener']; - continue; - } - - if ($tokens[$before]['code'] === T_CLOSE_SQUARE_BRACKET) { - $before = $tokens[$before]['bracket_opener']; - continue; - } - - if ($tokens[$before]['code'] === T_CLOSE_SHORT_ARRAY) { - $before = $tokens[$before]['bracket_opener']; - continue; - } - - break; - }//end for - - $before = $phpcsFile->findNext(Tokens::$emptyTokens, ($before + 1), null, true); - - // A few extra tokens are allowed to be on the right side of the expression. - $allowed[T_EQUAL] = true; - $allowed[T_NEW] = true; - - // Find the last token in the expression. - for ($after = ($stackPtr + 1); $after < $phpcsFile->numTokens; $after++) { - // Special case for plus operators because we can't tell if they are used - // for addition or string concat. So assume string concat to be safe. - if ($phpcsFile->tokenizerType === 'JS' && $tokens[$after]['code'] === T_PLUS) { - break; - } - - if (isset(Tokens::$emptyTokens[$tokens[$after]['code']]) === true - || isset(Tokens::$operators[$tokens[$after]['code']]) === true - || isset(Tokens::$castTokens[$tokens[$after]['code']]) === true - || isset($allowed[$tokens[$after]['code']]) === true - ) { - continue; - } - - if ($tokens[$after]['code'] === T_OPEN_PARENTHESIS) { - $after = $tokens[$after]['parenthesis_closer']; - continue; - } - - if ($tokens[$after]['code'] === T_OPEN_SQUARE_BRACKET) { - $after = $tokens[$after]['bracket_closer']; - continue; - } - - if ($tokens[$after]['code'] === T_OPEN_SHORT_ARRAY) { - $after = $tokens[$after]['bracket_closer']; - continue; - } - - break; - }//end for - - $after = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($after - 1), null, true); - - $error = 'Operation must be bracketed'; - if ($before === $after || $before === $stackPtr || $after === $stackPtr) { - $phpcsFile->addError($error, $stackPtr, 'MissingBrackets'); - return; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'MissingBrackets'); - if ($fix === true) { - // Can only fix this error if both tokens are available for fixing. - // Adding one bracket without the other will create parse errors. - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($before, '('.$tokens[$before]['content']); - $phpcsFile->fixer->replaceToken($after, $tokens[$after]['content'].')'); - $phpcsFile->fixer->endChangeset(); - } - - }//end addMissingBracketsError() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php deleted file mode 100644 index 7357a507..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php +++ /dev/null @@ -1,398 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionDeclarationArgumentSpacingSniff implements Sniff -{ - - /** - * How many spaces should surround the equals signs. - * - * @var integer - */ - public $equalsSpacing = 0; - - /** - * How many spaces should follow the opening bracket. - * - * @var integer - */ - public $requiredSpacesAfterOpen = 0; - - /** - * How many spaces should precede the closing bracket. - * - * @var integer - */ - public $requiredSpacesBeforeClose = 0; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - T_FN, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false - || isset($tokens[$stackPtr]['parenthesis_closer']) === false - || $tokens[$stackPtr]['parenthesis_opener'] === null - || $tokens[$stackPtr]['parenthesis_closer'] === null - ) { - return; - } - - $this->equalsSpacing = (int) $this->equalsSpacing; - $this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen; - $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose; - - $this->processBracket($phpcsFile, $tokens[$stackPtr]['parenthesis_opener']); - - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($tokens[$stackPtr]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1), null); - $this->processBracket($phpcsFile, $openBracket); - } - } - - }//end process() - - - /** - * Processes the contents of a single set of brackets. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $openBracket The position of the open bracket - * in the stack. - * - * @return void - */ - public function processBracket($phpcsFile, $openBracket) - { - $tokens = $phpcsFile->getTokens(); - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - $multiLine = ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']); - - if (isset($tokens[$openBracket]['parenthesis_owner']) === true) { - $stackPtr = $tokens[$openBracket]['parenthesis_owner']; - } else { - $stackPtr = $phpcsFile->findPrevious(T_USE, ($openBracket - 1)); - } - - $params = $phpcsFile->getMethodParameters($stackPtr); - - if (empty($params) === true) { - // Check spacing around parenthesis. - $next = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), $closeBracket, true); - if ($next === false) { - if (($closeBracket - $openBracket) !== 1) { - if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($openBracket + 1)]['length']; - } - - $error = 'Expected 0 spaces between parenthesis of function declaration; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $openBracket, 'SpacingBetween', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($openBracket + 1), ''); - } - } - - // No params, so we don't check normal spacing rules. - return; - } - }//end if - - foreach ($params as $paramNumber => $param) { - if ($param['pass_by_reference'] === true) { - $refToken = $param['reference_token']; - - $gap = 0; - if ($tokens[($refToken + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($refToken + 1)]['length']; - } - - if ($gap !== 0) { - $error = 'Expected 0 spaces after reference operator for argument "%s"; %s found'; - $data = [ - $param['name'], - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $refToken, 'SpacingAfterReference', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($refToken + 1), ''); - } - } - }//end if - - if ($param['variable_length'] === true) { - $variadicToken = $param['variadic_token']; - - $gap = 0; - if ($tokens[($variadicToken + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($variadicToken + 1)]['length']; - } - - if ($gap !== 0) { - $error = 'Expected 0 spaces after variadic operator for argument "%s"; %s found'; - $data = [ - $param['name'], - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $variadicToken, 'SpacingAfterVariadic', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($variadicToken + 1), ''); - } - } - }//end if - - if (isset($param['default_equal_token']) === true) { - $equalToken = $param['default_equal_token']; - - $spacesBefore = 0; - if (($equalToken - $param['token']) > 1) { - $spacesBefore = $tokens[($param['token'] + 1)]['length']; - } - - if ($spacesBefore !== $this->equalsSpacing) { - $error = 'Incorrect spacing between argument "%s" and equals sign; expected '.$this->equalsSpacing.' but found %s'; - $data = [ - $param['name'], - $spacesBefore, - ]; - - $fix = $phpcsFile->addFixableError($error, $equalToken, 'SpaceBeforeEquals', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->equalsSpacing); - if ($spacesBefore === 0) { - $phpcsFile->fixer->addContentBefore($equalToken, $padding); - } else { - $phpcsFile->fixer->replaceToken(($equalToken - 1), $padding); - } - } - }//end if - - $spacesAfter = 0; - if ($tokens[($equalToken + 1)]['code'] === T_WHITESPACE) { - $spacesAfter = $tokens[($equalToken + 1)]['length']; - } - - if ($spacesAfter !== $this->equalsSpacing) { - $error = 'Incorrect spacing between default value and equals sign for argument "%s"; expected '.$this->equalsSpacing.' but found %s'; - $data = [ - $param['name'], - $spacesAfter, - ]; - - $fix = $phpcsFile->addFixableError($error, $equalToken, 'SpaceAfterEquals', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->equalsSpacing); - if ($spacesAfter === 0) { - $phpcsFile->fixer->addContent($equalToken, $padding); - } else { - $phpcsFile->fixer->replaceToken(($equalToken + 1), $padding); - } - } - }//end if - }//end if - - if ($param['type_hint_token'] !== false) { - $typeHintToken = $param['type_hint_end_token']; - - $gap = 0; - if ($tokens[($typeHintToken + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($typeHintToken + 1)]['length']; - } - - if ($gap !== 1) { - $error = 'Expected 1 space between type hint and argument "%s"; %s found'; - $data = [ - $param['name'], - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $typeHintToken, 'SpacingAfterHint', $data); - if ($fix === true) { - if ($gap === 0) { - $phpcsFile->fixer->addContent($typeHintToken, ' '); - } else { - $phpcsFile->fixer->replaceToken(($typeHintToken + 1), ' '); - } - } - } - }//end if - - $commaToken = false; - if ($paramNumber > 0 && $params[($paramNumber - 1)]['comma_token'] !== false) { - $commaToken = $params[($paramNumber - 1)]['comma_token']; - } - - if ($commaToken !== false) { - if ($tokens[($commaToken - 1)]['code'] === T_WHITESPACE) { - $error = 'Expected 0 spaces between argument "%s" and comma; %s found'; - $data = [ - $params[($paramNumber - 1)]['name'], - $tokens[($commaToken - 1)]['length'], - ]; - - $fix = $phpcsFile->addFixableError($error, $commaToken, 'SpaceBeforeComma', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($commaToken - 1), ''); - } - } - - // Don't check spacing after the comma if it is the last content on the line. - $checkComma = true; - if ($multiLine === true) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($commaToken + 1), $closeBracket, true); - if ($tokens[$next]['line'] !== $tokens[$commaToken]['line']) { - $checkComma = false; - } - } - - if ($checkComma === true) { - if ($param['type_hint_token'] === false) { - $spacesAfter = 0; - if ($tokens[($commaToken + 1)]['code'] === T_WHITESPACE) { - $spacesAfter = $tokens[($commaToken + 1)]['length']; - } - - if ($spacesAfter === 0) { - $error = 'Expected 1 space between comma and argument "%s"; 0 found'; - $data = [$param['name']]; - $fix = $phpcsFile->addFixableError($error, $commaToken, 'NoSpaceBeforeArg', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($commaToken, ' '); - } - } else if ($spacesAfter !== 1) { - $error = 'Expected 1 space between comma and argument "%s"; %s found'; - $data = [ - $param['name'], - $spacesAfter, - ]; - - $fix = $phpcsFile->addFixableError($error, $commaToken, 'SpacingBeforeArg', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($commaToken + 1), ' '); - } - }//end if - } else { - $hint = $phpcsFile->getTokensAsString($param['type_hint_token'], (($param['type_hint_end_token'] - $param['type_hint_token']) + 1)); - if ($param['nullable_type'] === true) { - $hint = '?'.$hint; - } - - if ($tokens[($commaToken + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space between comma and type hint "%s"; 0 found'; - $data = [$hint]; - $fix = $phpcsFile->addFixableError($error, $commaToken, 'NoSpaceBeforeHint', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($commaToken, ' '); - } - } else { - $gap = $tokens[($commaToken + 1)]['length']; - if ($gap !== 1) { - $error = 'Expected 1 space between comma and type hint "%s"; %s found'; - $data = [ - $hint, - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $commaToken, 'SpacingBeforeHint', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($commaToken + 1), ' '); - } - } - }//end if - }//end if - }//end if - }//end if - }//end foreach - - // Only check spacing around parenthesis for single line definitions. - if ($multiLine === true) { - return; - } - - $gap = 0; - if ($tokens[($closeBracket - 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($closeBracket - 1)]['length']; - } - - if ($gap !== $this->requiredSpacesBeforeClose) { - $error = 'Expected %s spaces before closing parenthesis; %s found'; - $data = [ - $this->requiredSpacesBeforeClose, - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $closeBracket, 'SpacingBeforeClose', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); - if ($gap === 0) { - $phpcsFile->fixer->addContentBefore($closeBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($closeBracket - 1), $padding); - } - } - } - - $gap = 0; - if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($openBracket + 1)]['length']; - } - - if ($gap !== $this->requiredSpacesAfterOpen) { - $error = 'Expected %s spaces after opening parenthesis; %s found'; - $data = [ - $this->requiredSpacesAfterOpen, - $gap, - ]; - $fix = $phpcsFile->addFixableError($error, $openBracket, 'SpacingAfterOpen', $data); - if ($fix === true) { - $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); - if ($gap === 0) { - $phpcsFile->fixer->addContent($openBracket, $padding); - } else { - $phpcsFile->fixer->replaceToken(($openBracket + 1), $padding); - } - } - } - - }//end processBracket() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php deleted file mode 100644 index fdb391c2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Sniffs\AbstractPatternSniff; - -class FunctionDeclarationSniff extends AbstractPatternSniff -{ - - - /** - * Returns an array of patterns to check are correct. - * - * @return array - */ - protected function getPatterns() - { - return [ - 'function abc(...);', - 'function abc(...)', - 'abstract function abc(...);', - ]; - - }//end getPatterns() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php deleted file mode 100644 index 5eafbfdb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FunctionDuplicateArgumentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - - $foundVariables = []; - for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { - if ($tokens[$i]['code'] === T_VARIABLE) { - $variable = $tokens[$i]['content']; - if (in_array($variable, $foundVariables, true) === true) { - $error = 'Variable "%s" appears more than once in function declaration'; - $data = [$variable]; - $phpcsFile->addError($error, $i, 'Found', $data); - } else { - $foundVariables[] = $variable; - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php deleted file mode 100644 index af3d902e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class GlobalFunctionSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (empty($tokens[$stackPtr]['conditions']) === true) { - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if ($functionName === null) { - return; - } - - // Special exception for __autoload as it needs to be global. - if ($functionName !== '__autoload') { - $error = 'Consider putting global function "%s" in a static class'; - $data = [$functionName]; - $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php deleted file mode 100644 index 401b840c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class LowercaseFunctionKeywordsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $tokens = Tokens::$methodPrefixes; - $tokens[] = T_FUNCTION; - $tokens[] = T_CLOSURE; - $tokens[] = T_FN; - - return $tokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 ($content !== $contentLc) { - $error = '%s keyword must be lowercase; expected "%s" but found "%s"'; - $data = [ - strtoupper($content), - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'FoundUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php deleted file mode 100644 index 61d23ce2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php +++ /dev/null @@ -1,257 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions; - -use PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff as PEARFunctionDeclarationSniff; -use PHP_CodeSniffer\Util\Tokens; - -class MultiLineFunctionDeclarationSniff extends PEARFunctionDeclarationSniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Determine if this is a multi-line function declaration. - * - * @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 $openBracket The position of the opening bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * - * @return bool - */ - public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) - { - $bracketsToCheck = [$stackPtr => $openBracket]; - - // Closures may use the USE keyword and so be multi-line in this way. - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - $use = $phpcsFile->findNext(T_USE, ($tokens[$openBracket]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); - if ($use !== false) { - $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - if ($open !== false) { - $bracketsToCheck[$use] = $open; - } - } - } - - foreach ($bracketsToCheck as $stackPtr => $openBracket) { - // If the first argument is on a new line, this is a multi-line - // function declaration, even if there is only one argument. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { - return true; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - $end = $phpcsFile->findEndOfStatement($openBracket + 1); - while ($tokens[$end]['code'] === T_COMMA) { - // If the next bit of code is not on the same line, this is a - // multi-line function declaration. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); - if ($next === false) { - continue(2); - } - - if ($tokens[$next]['line'] !== $tokens[$end]['line']) { - return true; - } - - $end = $phpcsFile->findEndOfStatement($next); - } - - // We've reached the last argument, so see if the next content - // (should be the close bracket) is also on the same line. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($end + 1), $closeBracket, true); - if ($next !== false && $tokens[$next]['line'] !== $tokens[$end]['line']) { - return true; - } - }//end foreach - - return false; - - }//end isMultiLineDeclaration() - - - /** - * Processes single-line declarations. - * - * Just uses the Generic BSD-Allman brace sniff. - * - * @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 array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens) - { - // We do everything the parent sniff does, and a bit more because we - // define multi-line declarations a bit differently. - parent::processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens); - - $openingBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closingBracket = $tokens[$stackPtr]['parenthesis_closer']; - - $prevNonWhiteSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($closingBracket - 1), $openingBracket, true); - if ($tokens[$prevNonWhiteSpace]['line'] !== $tokens[$closingBracket]['line']) { - $error = 'There must not be a newline before the closing parenthesis of a single-line function declaration'; - - if (isset(Tokens::$emptyTokens[$tokens[$prevNonWhiteSpace]['code']]) === true) { - $phpcsFile->addError($error, $closingBracket, 'CloseBracketNewLine'); - } else { - $fix = $phpcsFile->addFixableError($error, $closingBracket, 'CloseBracketNewLine'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($closingBracket - 1); $i > $openingBracket; $i--) { - if ($tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - - }//end processSingleLineDeclaration() - - - /** - * Processes multi-line declarations. - * - * @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 array $tokens The stack of tokens that make up - * the file. - * - * @return void - */ - public function processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens) - { - // We do everything the parent sniff does, and a bit more. - parent::processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens); - - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $this->processBracket($phpcsFile, $openBracket, $tokens, 'function'); - - if ($tokens[$stackPtr]['code'] !== T_CLOSURE) { - return; - } - - $use = $phpcsFile->findNext(T_USE, ($tokens[$stackPtr]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); - if ($use === false) { - return; - } - - $openBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1), null); - $this->processBracket($phpcsFile, $openBracket, $tokens, 'use'); - - }//end processMultiLineDeclaration() - - - /** - * Processes the contents of a single set of brackets. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $openBracket The position of the open bracket - * in the stack passed in $tokens. - * @param array $tokens The stack of tokens that make up - * the file. - * @param string $type The type of the token the brackets - * belong to (function or use). - * - * @return void - */ - public function processBracket($phpcsFile, $openBracket, $tokens, $type='function') - { - $errorPrefix = ''; - if ($type === 'use') { - $errorPrefix = 'Use'; - } - - $closeBracket = $tokens[$openBracket]['parenthesis_closer']; - - // The open bracket should be the last thing on the line. - if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($openBracket + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { - $error = 'The first parameter of a multi-line '.$type.' declaration must be on the line after the opening bracket'; - $fix = $phpcsFile->addFixableError($error, $next, $errorPrefix.'FirstParamSpacing'); - if ($fix === true) { - if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) { - $phpcsFile->fixer->addNewline($openBracket); - } else { - $phpcsFile->fixer->beginChangeset(); - for ($x = $openBracket; $x < $next; $x++) { - if ($tokens[$x]['line'] === $tokens[$openBracket]['line']) { - continue; - } - - if ($tokens[$x]['line'] === $tokens[$next]['line']) { - break; - } - } - - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - }//end if - - // Each line between the brackets should contain a single parameter. - for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { - // Skip brackets, like arrays, as they can contain commas. - if (isset($tokens[$i]['bracket_opener']) === true) { - $i = $tokens[$i]['bracket_closer']; - continue; - } - - if (isset($tokens[$i]['parenthesis_opener']) === true) { - $i = $tokens[$i]['parenthesis_closer']; - continue; - } - - if ($tokens[$i]['code'] !== T_COMMA) { - continue; - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - if ($tokens[$next]['line'] === $tokens[$i]['line']) { - $error = 'Multi-line '.$type.' declarations must define one parameter per line'; - $fix = $phpcsFile->addFixableError($error, $next, $errorPrefix.'OneParamPerLine'); - if ($fix === true) { - $phpcsFile->fixer->addNewline($i); - } - } - }//end for - - }//end processBracket() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php deleted file mode 100644 index 2450ba7f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff as PEARValidFunctionNameSniff; -use PHP_CodeSniffer\Util\Common; - -class ValidFunctionNameSniff extends PEARValidFunctionNameSniff -{ - - - /** - * Processes the tokens outside the scope. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param int $stackPtr The position where this token was - * found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - $functionName = $phpcsFile->getDeclarationName($stackPtr); - if ($functionName === null) { - return; - } - - $errorData = [$functionName]; - - // Does this function claim to be magical? - if (preg_match('|^__[^_]|', $functionName) !== 0) { - $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $phpcsFile->addError($error, $stackPtr, 'DoubleUnderscore', $errorData); - - $functionName = ltrim($functionName, '_'); - } - - if (Common::isCamelCaps($functionName, false, true, false) === false) { - $error = 'Function name "%s" is not in camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData); - } - - }//end processTokenOutsideScope() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php deleted file mode 100644 index 79f9c4b2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Tokens; - -class ValidVariableNameSniff extends AbstractVariableSniff -{ - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $varName = ltrim($tokens[$stackPtr]['content'], '$'); - - // If it's a php reserved var, then its ok. - if (isset($this->phpReservedVars[$varName]) === true) { - return; - } - - $objOperator = $phpcsFile->findNext([T_WHITESPACE], ($stackPtr + 1), null, true); - if ($tokens[$objOperator]['code'] === T_OBJECT_OPERATOR - || $tokens[$objOperator]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - // Check to see if we are using a variable from an object. - $var = $phpcsFile->findNext([T_WHITESPACE], ($objOperator + 1), null, true); - if ($tokens[$var]['code'] === T_STRING) { - $bracket = $phpcsFile->findNext([T_WHITESPACE], ($var + 1), null, true); - if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) { - $objVarName = $tokens[$var]['content']; - - // There is no way for us to know if the var is public or - // private, so we have to ignore a leading underscore if there is - // one and just check the main part of the variable name. - $originalVarName = $objVarName; - if (substr($objVarName, 0, 1) === '_') { - $objVarName = substr($objVarName, 1); - } - - if (Common::isCamelCaps($objVarName, false, true, false) === false) { - $error = 'Member variable "%s" is not in valid camel caps format'; - $data = [$originalVarName]; - $phpcsFile->addError($error, $var, 'MemberNotCamelCaps', $data); - } - }//end if - }//end if - }//end if - - $objOperator = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$objOperator]['code'] === T_DOUBLE_COLON) { - // The variable lives within a class, and is referenced like - // this: MyClass::$_variable, so we don't know its scope. - $objVarName = $varName; - if (substr($objVarName, 0, 1) === '_') { - $objVarName = substr($objVarName, 1); - } - - if (Common::isCamelCaps($objVarName, false, true, false) === false) { - $error = 'Member variable "%s" is not in valid camel caps format'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addError($error, $stackPtr, 'MemberNotCamelCaps', $data); - } - - return; - } - - // There is no way for us to know if the var is public or private, - // so we have to ignore a leading underscore if there is one and just - // check the main part of the variable name. - $originalVarName = $varName; - if (substr($varName, 0, 1) === '_') { - $inClass = $phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens); - if ($inClass === true) { - $varName = substr($varName, 1); - } - } - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$originalVarName]; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); - } - - }//end processVariable() - - - /** - * Processes class member variables. - * - * @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 - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $varName = ltrim($tokens[$stackPtr]['content'], '$'); - $memberProps = $phpcsFile->getMemberProperties($stackPtr); - if (empty($memberProps) === true) { - // Couldn't get any info about this variable, which - // generally means it is invalid or possibly has a parse - // error. Any errors will be reported by the core, so - // we can ignore it. - return; - } - - $public = ($memberProps['scope'] !== 'private'); - $errorData = [$varName]; - - if ($public === true) { - if (substr($varName, 0, 1) === '_') { - $error = '%s member variable "%s" must not contain a leading underscore'; - $data = [ - ucfirst($memberProps['scope']), - $errorData[0], - ]; - $phpcsFile->addError($error, $stackPtr, 'PublicHasUnderscore', $data); - } - } else { - if (substr($varName, 0, 1) !== '_') { - $error = 'Private member variable "%s" must contain a leading underscore'; - $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $errorData); - } - } - - // Remove a potential underscore prefix for testing CamelCaps. - $varName = ltrim($varName, '_'); - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Member variable "%s" is not in valid camel caps format'; - $phpcsFile->addError($error, $stackPtr, 'MemberNotCamelCaps', $errorData); - } - - }//end processMemberVar() - - - /** - * Processes the variable found within a double quoted string. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the double quoted - * string. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (preg_match_all('|[^\\\]\${?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|', $tokens[$stackPtr]['content'], $matches) !== 0) { - foreach ($matches[1] as $varName) { - // If it's a php reserved var, then its ok. - if (isset($this->phpReservedVars[$varName]) === true) { - continue; - } - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'StringNotCamelCaps', $data); - } - } - } - - }//end processVariableInString() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php deleted file mode 100644 index b619924e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DisallowObjectStringIndexSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_SQUARE_BRACKET]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Check if the next non whitespace token is a string. - $index = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$index]['code'] !== T_CONSTANT_ENCAPSED_STRING) { - return; - } - - // Make sure it is the only thing in the square brackets. - $next = $phpcsFile->findNext(T_WHITESPACE, ($index + 1), null, true); - if ($tokens[$next]['code'] !== T_CLOSE_SQUARE_BRACKET) { - return; - } - - // Allow indexes that have dots in them because we can't write - // them in dot notation. - $content = trim($tokens[$index]['content'], '"\' '); - if (strpos($content, '.') !== false) { - return; - } - - // Also ignore reserved words. - if ($content === 'super') { - return; - } - - // Token before the opening square bracket cannot be a var name. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_STRING) { - $error = 'Object indexes must be written in dot notation'; - $phpcsFile->addError($error, $prev, 'Found'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php deleted file mode 100644 index d408a07c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ObjectInstantiationSniff implements Sniff -{ - - - /** - * Registers the token types that this sniff wishes to listen to. - * - * @return array - */ - public function register() - { - return [T_NEW]; - - }//end register() - - - /** - * Process the tokens that this sniff is listening for. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $allowedTokens = Tokens::$emptyTokens; - $allowedTokens[] = T_BITWISE_AND; - - $prev = $phpcsFile->findPrevious($allowedTokens, ($stackPtr - 1), null, true); - - $allowedTokens = [ - T_EQUAL => T_EQUAL, - T_COALESCE_EQUAL => T_COALESCE_EQUAL, - T_DOUBLE_ARROW => T_DOUBLE_ARROW, - T_FN_ARROW => T_FN_ARROW, - T_MATCH_ARROW => T_MATCH_ARROW, - T_THROW => T_THROW, - T_RETURN => T_RETURN, - ]; - - if (isset($allowedTokens[$tokens[$prev]['code']]) === true) { - return; - } - - $ternaryLikeTokens = [ - T_COALESCE => true, - T_INLINE_THEN => true, - T_INLINE_ELSE => true, - ]; - - // For ternary like tokens, walk a little further back to see if it is preceded by - // one of the allowed tokens (within the same statement). - if (isset($ternaryLikeTokens[$tokens[$prev]['code']]) === true) { - $hasAllowedBefore = $phpcsFile->findPrevious($allowedTokens, ($prev - 1), null, false, null, true); - if ($hasAllowedBefore !== false) { - return; - } - } - - $error = 'New objects must be assigned to a variable'; - $phpcsFile->addError($error, $stackPtr, 'NotAssigned'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php deleted file mode 100644 index dbbc1b84..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ObjectMemberCommaSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Registers the token types that this sniff wishes to listen to. - * - * @return array - */ - public function register() - { - return [T_CLOSE_OBJECT]; - - }//end register() - - - /** - * Process the tokens that this sniff is listening for. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_COMMA) { - $error = 'Last member of object must not be followed by a comma'; - $fix = $phpcsFile->addFixableError($error, $prev, 'Found'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($prev, ''); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php deleted file mode 100644 index e9b41d69..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php +++ /dev/null @@ -1,235 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ComparisonOperatorUsageSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * A list of valid comparison operators. - * - * @var array - */ - private static $validOps = [ - T_IS_IDENTICAL => true, - T_IS_NOT_IDENTICAL => true, - T_LESS_THAN => true, - T_GREATER_THAN => true, - T_IS_GREATER_OR_EQUAL => true, - T_IS_SMALLER_OR_EQUAL => true, - T_INSTANCEOF => true, - ]; - - /** - * A list of invalid operators with their alternatives. - * - * @var array> - */ - private static $invalidOps = [ - 'PHP' => [ - T_IS_EQUAL => '===', - T_IS_NOT_EQUAL => '!==', - T_BOOLEAN_NOT => '=== FALSE', - ], - 'JS' => [ - T_IS_EQUAL => '===', - T_IS_NOT_EQUAL => '!==', - ], - ]; - - - /** - * Registers the token types that this sniff wishes to listen to. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_ELSEIF, - T_INLINE_THEN, - T_WHILE, - T_FOR, - ]; - - }//end register() - - - /** - * Process the tokens that this sniff is listening for. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where the token - * was found. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $tokenizer = $phpcsFile->tokenizerType; - - if ($tokens[$stackPtr]['code'] === T_INLINE_THEN) { - $end = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$end]['code'] !== T_CLOSE_PARENTHESIS) { - // This inline IF statement does not have its condition - // bracketed, so we need to guess where it starts. - for ($i = ($end - 1); $i >= 0; $i--) { - if ($tokens[$i]['code'] === T_SEMICOLON) { - // Stop here as we assume it is the end - // of the previous statement. - break; - } else if ($tokens[$i]['code'] === T_OPEN_TAG) { - // Stop here as this is the start of the file. - break; - } else if ($tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET) { - // Stop if this is the closing brace of - // a code block. - if (isset($tokens[$i]['scope_opener']) === true) { - break; - } - } else if ($tokens[$i]['code'] === T_OPEN_CURLY_BRACKET) { - // Stop if this is the opening brace of - // a code block. - if (isset($tokens[$i]['scope_closer']) === true) { - break; - } - } else if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { - // Stop if this is the start of a pair of - // parentheses that surrounds the inline - // IF statement. - if (isset($tokens[$i]['parenthesis_closer']) === true - && $tokens[$i]['parenthesis_closer'] >= $stackPtr - ) { - break; - } - }//end if - }//end for - - $start = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - } else { - if (isset($tokens[$end]['parenthesis_opener']) === false) { - return; - } - - $start = $tokens[$end]['parenthesis_opener']; - }//end if - } else if ($tokens[$stackPtr]['code'] === T_FOR) { - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { - return; - } - - $openingBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closingBracket = $tokens[$stackPtr]['parenthesis_closer']; - - $start = $phpcsFile->findNext(T_SEMICOLON, $openingBracket, $closingBracket); - $end = $phpcsFile->findNext(T_SEMICOLON, ($start + 1), $closingBracket); - if ($start === false || $end === false) { - return; - } - } else { - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { - return; - } - - $start = $tokens[$stackPtr]['parenthesis_opener']; - $end = $tokens[$stackPtr]['parenthesis_closer']; - }//end if - - $requiredOps = 0; - $foundOps = 0; - $foundBooleans = 0; - - $lastNonEmpty = $start; - - for ($i = $start; $i <= $end; $i++) { - $type = $tokens[$i]['code']; - if (isset(self::$invalidOps[$tokenizer][$type]) === true) { - $error = 'Operator %s prohibited; use %s instead'; - $data = [ - $tokens[$i]['content'], - self::$invalidOps[$tokenizer][$type], - ]; - $phpcsFile->addError($error, $i, 'NotAllowed', $data); - $foundOps++; - } else if (isset(self::$validOps[$type]) === true) { - $foundOps++; - } - - if ($type === T_OPEN_PARENTHESIS - && isset($tokens[$i]['parenthesis_closer']) === true - && isset(Tokens::$functionNameTokens[$tokens[$lastNonEmpty]['code']]) === true - ) { - $i = $tokens[$i]['parenthesis_closer']; - $lastNonEmpty = $i; - continue; - } - - if ($tokens[$i]['code'] === T_TRUE || $tokens[$i]['code'] === T_FALSE) { - $foundBooleans++; - } - - if ($phpcsFile->tokenizerType !== 'JS' - && ($tokens[$i]['code'] === T_BOOLEAN_AND - || $tokens[$i]['code'] === T_BOOLEAN_OR) - ) { - $requiredOps++; - - // When the instanceof operator is used with another operator - // like ===, you can get more ops than are required. - if ($foundOps > $requiredOps) { - $foundOps = $requiredOps; - } - - // If we get to here and we have not found the right number of - // comparison operators, then we must have had an implicit - // true operation i.e., if ($a) instead of the required - // if ($a === true), so let's add an error. - if ($requiredOps !== $foundOps) { - $error = 'Implicit true comparisons prohibited; use === TRUE instead'; - $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); - $foundOps++; - } - } - - if (isset(Tokens::$emptyTokens[$type]) === false) { - $lastNonEmpty = $i; - } - }//end for - - $requiredOps++; - - if ($phpcsFile->tokenizerType !== 'JS' - && $foundOps < $requiredOps - && ($requiredOps !== $foundBooleans) - ) { - $error = 'Implicit true comparisons prohibited; use === TRUE instead'; - $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php deleted file mode 100644 index a39e44e1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php +++ /dev/null @@ -1,231 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class IncrementDecrementUsageSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_EQUAL, - T_PLUS_EQUAL, - T_MINUS_EQUAL, - T_INC, - T_DEC, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if ($tokens[$stackPtr]['code'] === T_INC || $tokens[$stackPtr]['code'] === T_DEC) { - $this->processIncDec($phpcsFile, $stackPtr); - } else { - $this->processAssignment($phpcsFile, $stackPtr); - } - - }//end process() - - - /** - * Checks to ensure increment and decrement operators are not confusing. - * - * @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 - */ - protected function processIncDec($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Work out where the variable is so we know where to - // start looking for other operators. - if ($tokens[($stackPtr - 1)]['code'] === T_VARIABLE - || ($tokens[($stackPtr - 1)]['code'] === T_STRING - && ($tokens[($stackPtr - 2)]['code'] === T_OBJECT_OPERATOR - || $tokens[($stackPtr - 2)]['code'] === T_NULLSAFE_OBJECT_OPERATOR)) - ) { - $start = ($stackPtr + 1); - } else { - $start = ($stackPtr + 2); - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, $start, null, true); - if ($next === false) { - return; - } - - if (isset(Tokens::$arithmeticTokens[$tokens[$next]['code']]) === true) { - $error = 'Increment and decrement operators cannot be used in an arithmetic operation'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - return; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($start - 3), null, true); - if ($prev === false) { - return; - } - - // Check if this is in a string concat. - if ($tokens[$next]['code'] === T_STRING_CONCAT || $tokens[$prev]['code'] === T_STRING_CONCAT) { - $error = 'Increment and decrement operators must be bracketed when used in string concatenation'; - $phpcsFile->addError($error, $stackPtr, 'NoBrackets'); - } - - }//end processIncDec() - - - /** - * Checks to ensure increment and decrement operators are used. - * - * @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 - */ - protected function processAssignment($phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $assignedVar = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - // Not an assignment, return. - if ($tokens[$assignedVar]['code'] !== T_VARIABLE) { - return; - } - - $statementEnd = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_PARENTHESIS, T_CLOSE_SQUARE_BRACKET, T_CLOSE_CURLY_BRACKET], $stackPtr); - - // If there is anything other than variables, numbers, spaces or operators we need to return. - $find = Tokens::$emptyTokens; - $find[] = T_LNUMBER; - $find[] = T_VARIABLE; - $find[] = T_PLUS; - $find[] = T_MINUS; - $find[] = T_OPEN_PARENTHESIS; - - $noiseTokens = $phpcsFile->findNext($find, ($stackPtr + 1), $statementEnd, true); - if ($noiseTokens !== false) { - return; - } - - // If we are already using += or -=, we need to ignore - // the statement if a variable is being used. - if ($tokens[$stackPtr]['code'] !== T_EQUAL) { - $nextVar = $phpcsFile->findNext(T_VARIABLE, ($stackPtr + 1), $statementEnd); - if ($nextVar !== false) { - return; - } - } - - if ($tokens[$stackPtr]['code'] === T_EQUAL) { - $nextVar = $stackPtr; - $previousVariable = $stackPtr; - $variableCount = 0; - while (($nextVar = $phpcsFile->findNext(T_VARIABLE, ($nextVar + 1), $statementEnd)) !== false) { - $previousVariable = $nextVar; - $variableCount++; - } - - if ($variableCount !== 1) { - return; - } - - $nextVar = $previousVariable; - if ($tokens[$nextVar]['content'] !== $tokens[$assignedVar]['content']) { - return; - } - } - - // We have only one variable, and it's the same as what is being assigned, - // so we need to check what is being added or subtracted. - $nextNumber = $stackPtr; - $previousNumber = $stackPtr; - $numberCount = 0; - while (($nextNumber = $phpcsFile->findNext([T_LNUMBER], ($nextNumber + 1), $statementEnd, false)) !== false) { - $previousNumber = $nextNumber; - $numberCount++; - } - - if ($numberCount !== 1) { - return; - } - - $nextNumber = $previousNumber; - if ($tokens[$nextNumber]['content'] === '1') { - if ($tokens[$stackPtr]['code'] === T_EQUAL) { - $opToken = $phpcsFile->findNext([T_PLUS, T_MINUS], ($nextVar + 1), $statementEnd); - if ($opToken === false) { - // Operator was before the variable, like: - // $var = 1 + $var; - // So we ignore it. - return; - } - - $operator = $tokens[$opToken]['content']; - } else { - $operator = substr($tokens[$stackPtr]['content'], 0, 1); - } - - // If we are adding or subtracting negative value, the operator - // needs to be reversed. - if ($tokens[$stackPtr]['code'] !== T_EQUAL) { - $negative = $phpcsFile->findPrevious(T_MINUS, ($nextNumber - 1), $stackPtr); - if ($negative !== false) { - if ($operator === '+') { - $operator = '-'; - } else { - $operator = '+'; - } - } - } - - $expected = $operator.$operator.$tokens[$assignedVar]['content']; - $found = $phpcsFile->getTokensAsString($assignedVar, ($statementEnd - $assignedVar + 1)); - - if ($operator === '+') { - $error = 'Increment'; - } else { - $error = 'Decrement'; - } - - $error .= " operators should be used where possible; found \"$found\" but expected \"$expected\""; - $phpcsFile->addError($error, $stackPtr, 'Found'); - }//end if - - }//end processAssignment() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php deleted file mode 100644 index 720e4724..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ValidLogicalOperatorsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_LOGICAL_AND, - T_LOGICAL_OR, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current 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(); - - $replacements = [ - 'and' => '&&', - 'or' => '||', - ]; - - $operator = strtolower($tokens[$stackPtr]['content']); - if (isset($replacements[$operator]) === false) { - return; - } - - $error = 'Logical operator "%s" is prohibited; use "%s" instead'; - $data = [ - $operator, - $replacements[$operator], - ]; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed', $data); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php deleted file mode 100644 index c8e1a403..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php +++ /dev/null @@ -1,283 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Exceptions\TokenizerException; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class CommentedOutCodeSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'CSS', - ]; - - /** - * If a comment is more than $maxPercentage% code, a warning will be shown. - * - * @var integer - */ - public $maxPercentage = 35; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_COMMENT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Ignore comments at the end of code blocks. - if (substr($tokens[$stackPtr]['content'], 0, 6) === '//end ') { - return; - } - - $content = ''; - $lastLineSeen = $tokens[$stackPtr]['line']; - $commentStyle = 'line'; - if (strpos($tokens[$stackPtr]['content'], '/*') === 0) { - $commentStyle = 'block'; - } - - $lastCommentBlockToken = $stackPtr; - for ($i = $stackPtr; $i < $phpcsFile->numTokens; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) { - break; - } - - if ($tokens[$i]['code'] === T_WHITESPACE) { - continue; - } - - if (isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true) { - $lastLineSeen = $tokens[$i]['line']; - continue; - } - - if ($commentStyle === 'line' - && ($lastLineSeen + 1) <= $tokens[$i]['line'] - && strpos($tokens[$i]['content'], '/*') === 0 - ) { - // First non-whitespace token on a new line is start of a different style comment. - break; - } - - if ($commentStyle === 'line' - && ($lastLineSeen + 1) < $tokens[$i]['line'] - ) { - // Blank line breaks a '//' style comment block. - break; - } - - /* - Trim as much off the comment as possible so we don't - have additional whitespace tokens or comment tokens - */ - - $tokenContent = trim($tokens[$i]['content']); - $break = false; - - if ($commentStyle === 'line') { - if (substr($tokenContent, 0, 2) === '//') { - $tokenContent = substr($tokenContent, 2); - } - - if (substr($tokenContent, 0, 1) === '#') { - $tokenContent = substr($tokenContent, 1); - } - } else { - if (substr($tokenContent, 0, 3) === '/**') { - $tokenContent = substr($tokenContent, 3); - } - - if (substr($tokenContent, 0, 2) === '/*') { - $tokenContent = substr($tokenContent, 2); - } - - if (substr($tokenContent, -2) === '*/') { - $tokenContent = substr($tokenContent, 0, -2); - $break = true; - } - - if (substr($tokenContent, 0, 1) === '*') { - $tokenContent = substr($tokenContent, 1); - } - }//end if - - $content .= $tokenContent.$phpcsFile->eolChar; - $lastLineSeen = $tokens[$i]['line']; - - $lastCommentBlockToken = $i; - - if ($break === true) { - // Closer of a block comment found. - break; - } - }//end for - - // Ignore typical warning suppression annotations from other tools. - if (preg_match('`^\s*@[A-Za-z()\._-]+\s*$`', $content) === 1) { - return ($lastCommentBlockToken + 1); - } - - // Quite a few comments use multiple dashes, equals signs etc - // to frame comments and licence headers. - $content = preg_replace('/[-=#*]{2,}/', '-', $content); - - // Random numbers sitting inside the content can throw parse errors - // for invalid literals in PHP7+, so strip those. - $content = preg_replace('/\d+/', '', $content); - - $content = trim($content); - - if ($content === '') { - return ($lastCommentBlockToken + 1); - } - - if ($phpcsFile->tokenizerType === 'PHP') { - $content = ''; - } - - // Because we are not really parsing code, the tokenizer can throw all sorts - // of errors that don't mean anything, so ignore them. - $oldErrors = ini_get('error_reporting'); - ini_set('error_reporting', 0); - try { - $tokenizerClass = get_class($phpcsFile->tokenizer); - $tokenizer = new $tokenizerClass($content, $phpcsFile->config, $phpcsFile->eolChar); - $stringTokens = $tokenizer->getTokens(); - } catch (TokenizerException $e) { - // We couldn't check the comment, so ignore it. - ini_set('error_reporting', $oldErrors); - return ($lastCommentBlockToken + 1); - } - - ini_set('error_reporting', $oldErrors); - - $numTokens = count($stringTokens); - - /* - We know what the first two and last two tokens should be - (because we put them there) so ignore this comment if those - tokens were not parsed correctly. It obviously means this is not - valid code. - */ - - // First token is always the opening tag. - if ($stringTokens[0]['code'] !== T_OPEN_TAG) { - return ($lastCommentBlockToken + 1); - } else { - array_shift($stringTokens); - --$numTokens; - } - - // Last token is always the closing tag, unless something went wrong. - if (isset($stringTokens[($numTokens - 1)]) === false - || $stringTokens[($numTokens - 1)]['code'] !== T_CLOSE_TAG - ) { - return ($lastCommentBlockToken + 1); - } else { - array_pop($stringTokens); - --$numTokens; - } - - // Second last token is always whitespace or a comment, depending - // on the code inside the comment. - if ($phpcsFile->tokenizerType === 'PHP') { - if (isset(Tokens::$emptyTokens[$stringTokens[($numTokens - 1)]['code']]) === false) { - return ($lastCommentBlockToken + 1); - } - - if ($stringTokens[($numTokens - 1)]['code'] === T_WHITESPACE) { - array_pop($stringTokens); - --$numTokens; - } - } - - $emptyTokens = [ - T_WHITESPACE => true, - T_STRING => true, - T_STRING_CONCAT => true, - T_ENCAPSED_AND_WHITESPACE => true, - T_NONE => true, - T_COMMENT => true, - ]; - $emptyTokens += Tokens::$phpcsCommentTokens; - - $numCode = 0; - $numNonWhitespace = 0; - - for ($i = 0; $i < $numTokens; $i++) { - // Do not count comments. - if (isset($emptyTokens[$stringTokens[$i]['code']]) === false - // Commented out HTML/XML and other docs contain a lot of these - // characters, so it is best to not use them directly. - && isset(Tokens::$comparisonTokens[$stringTokens[$i]['code']]) === false - && isset(Tokens::$arithmeticTokens[$stringTokens[$i]['code']]) === false - && $stringTokens[$i]['code'] !== T_GOTO_LABEL - ) { - // Looks like code. - $numCode++; - } - - if ($stringTokens[$i]['code'] !== T_WHITESPACE) { - ++$numNonWhitespace; - } - } - - // Ignore comments with only two or less non-whitespace tokens. - // Sample size too small for a reliably determination. - if ($numNonWhitespace <= 2) { - return ($lastCommentBlockToken + 1); - } - - $percentCode = ceil((($numCode / $numTokens) * 100)); - if ($percentCode > $this->maxPercentage) { - // Just in case. - $percentCode = min(100, $percentCode); - - $error = 'This comment is %s%% valid code; is this commented out code?'; - $data = [$percentCode]; - $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); - } - - return ($lastCommentBlockToken + 1); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php deleted file mode 100644 index 24dc1370..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 DisallowBooleanStatementSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$booleanOperators; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - foreach ($tokens[$stackPtr]['nested_parenthesis'] as $open => $close) { - if (isset($tokens[$open]['parenthesis_owner']) === true) { - // Any owner means we are not just a simple statement. - return; - } - } - } - - $error = 'Boolean operators are not allowed outside of control structure conditions'; - $phpcsFile->addError($error, $stackPtr, 'Found'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php deleted file mode 100644 index 57dabbf1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php +++ /dev/null @@ -1,112 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 DisallowComparisonAssignmentSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EQUAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Ignore default value assignments in function definitions. - $function = $phpcsFile->findPrevious(T_FUNCTION, ($stackPtr - 1), null, false, null, true); - if ($function !== false) { - $opener = $tokens[$function]['parenthesis_opener']; - $closer = $tokens[$function]['parenthesis_closer']; - if ($opener < $stackPtr && $closer > $stackPtr) { - return; - } - } - - // Ignore values in array definitions or match structures. - $nextNonEmpty = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($stackPtr + 1), - null, - true - ); - - if ($nextNonEmpty !== false - && ($tokens[$nextNonEmpty]['code'] === T_ARRAY - || $tokens[$nextNonEmpty]['code'] === T_MATCH) - ) { - return; - } - - // Ignore function calls. - $ignore = [ - T_NULLSAFE_OBJECT_OPERATOR, - T_OBJECT_OPERATOR, - T_STRING, - T_VARIABLE, - T_WHITESPACE, - ]; - - $next = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_CLOSURE - || ($tokens[$next]['code'] === T_OPEN_PARENTHESIS - && $tokens[($next - 1)]['code'] === T_STRING) - ) { - // Code will look like: $var = myFunction( - // and will be ignored. - return; - } - - $endStatement = $phpcsFile->findEndOfStatement($stackPtr); - for ($i = ($stackPtr + 1); $i < $endStatement; $i++) { - if ((isset(Tokens::$comparisonTokens[$tokens[$i]['code']]) === true - && $tokens[$i]['code'] !== T_COALESCE) - || $tokens[$i]['code'] === T_INLINE_THEN - ) { - $error = 'The value of a comparison must not be assigned to a variable'; - $phpcsFile->addError($error, $stackPtr, 'AssignedComparison'); - break; - } - - if (isset(Tokens::$booleanOperators[$tokens[$i]['code']]) === true - || $tokens[$i]['code'] === T_BOOLEAN_NOT - ) { - $error = 'The value of a boolean operation must not be assigned to a variable'; - $phpcsFile->addError($error, $stackPtr, 'AssignedBool'); - break; - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php deleted file mode 100644 index f2620c7d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class DisallowInlineIfSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_INLINE_THEN]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $phpcsFile->addError('Inline IF statements are not allowed', $stackPtr, 'Found'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php deleted file mode 100644 index 688d0bca..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 DisallowMultipleAssignmentsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EQUAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // Ignore default value assignments in function definitions. - $function = $phpcsFile->findPrevious([T_FUNCTION, T_CLOSURE, T_FN], ($stackPtr - 1), null, false, null, true); - if ($function !== false) { - if (isset($tokens[$function]['parenthesis_closer']) === false) { - // Live coding/parse error. Bow out. - return; - } - - $opener = $tokens[$function]['parenthesis_opener']; - $closer = $tokens[$function]['parenthesis_closer']; - if ($opener < $stackPtr && $closer > $stackPtr) { - return; - } - } - - // Ignore assignments in WHILE loop conditions. - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nested = $tokens[$stackPtr]['nested_parenthesis']; - foreach ($nested as $opener => $closer) { - if (isset($tokens[$opener]['parenthesis_owner']) === true - && $tokens[$tokens[$opener]['parenthesis_owner']]['code'] === T_WHILE - ) { - return; - } - } - } - - // Ignore member var definitions. - if (empty($tokens[$stackPtr]['conditions']) === false) { - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if (isset(Tokens::$ooScopeTokens[$tokens[$deepestScope]['code']]) === true) { - return; - } - } - - /* - The general rule is: - Find an equal sign and go backwards along the line. If you hit an - end bracket, skip to the opening bracket. When you find a variable, - stop. That variable must be the first non-empty token on the line - or in the statement. If not, throw an error. - */ - - for ($varToken = ($stackPtr - 1); $varToken >= 0; $varToken--) { - if (in_array($tokens[$varToken]['code'], [T_SEMICOLON, T_OPEN_CURLY_BRACKET, T_CLOSE_TAG], true) === true) { - // We've reached the previous statement, so we didn't find a variable. - return; - } - - // Skip brackets. - if (isset($tokens[$varToken]['parenthesis_opener']) === true && $tokens[$varToken]['parenthesis_opener'] < $varToken) { - $varToken = $tokens[$varToken]['parenthesis_opener']; - continue; - } - - if (isset($tokens[$varToken]['bracket_opener']) === true) { - $varToken = $tokens[$varToken]['bracket_opener']; - continue; - } - - if ($tokens[$varToken]['code'] === T_VARIABLE) { - // We found our variable. - break; - } - }//end for - - if ($varToken <= 0) { - // Didn't find a variable. - return; - } - - $start = $phpcsFile->findStartOfStatement($varToken); - - $allowed = Tokens::$emptyTokens; - - $allowed[T_STRING] = T_STRING; - $allowed[T_NS_SEPARATOR] = T_NS_SEPARATOR; - $allowed[T_DOUBLE_COLON] = T_DOUBLE_COLON; - $allowed[T_OBJECT_OPERATOR] = T_OBJECT_OPERATOR; - $allowed[T_ASPERAND] = T_ASPERAND; - $allowed[T_DOLLAR] = T_DOLLAR; - $allowed[T_SELF] = T_SELF; - $allowed[T_PARENT] = T_PARENT; - $allowed[T_STATIC] = T_STATIC; - - $varToken = $phpcsFile->findPrevious($allowed, ($varToken - 1), null, true); - - if ($varToken < $start - && $tokens[$varToken]['code'] !== T_OPEN_PARENTHESIS - && $tokens[$varToken]['code'] !== T_OPEN_SQUARE_BRACKET - ) { - $varToken = $start; - } - - // Ignore the first part of FOR loops as we are allowed to - // assign variables there even though the variable is not the - // first thing on the line. - if ($tokens[$varToken]['code'] === T_OPEN_PARENTHESIS && isset($tokens[$varToken]['parenthesis_owner']) === true) { - $owner = $tokens[$varToken]['parenthesis_owner']; - if ($tokens[$owner]['code'] === T_FOR) { - return; - } - } - - if ($tokens[$varToken]['code'] === T_VARIABLE - || $tokens[$varToken]['code'] === T_OPEN_TAG - || $tokens[$varToken]['code'] === T_GOTO_LABEL - || $tokens[$varToken]['code'] === T_INLINE_THEN - || $tokens[$varToken]['code'] === T_INLINE_ELSE - || $tokens[$varToken]['code'] === T_SEMICOLON - || $tokens[$varToken]['code'] === T_CLOSE_PARENTHESIS - || isset($allowed[$tokens[$varToken]['code']]) === true - ) { - return; - } - - $error = 'Assignments must be the first block of code on a line'; - $errorCode = 'Found'; - - if (isset($nested) === true) { - $controlStructures = [ - T_IF => T_IF, - T_ELSEIF => T_ELSEIF, - T_SWITCH => T_SWITCH, - T_CASE => T_CASE, - T_FOR => T_FOR, - T_MATCH => T_MATCH, - ]; - foreach ($nested as $opener => $closer) { - if (isset($tokens[$opener]['parenthesis_owner']) === true - && isset($controlStructures[$tokens[$tokens[$opener]['parenthesis_owner']]['code']]) === true - ) { - $errorCode .= 'InControlStructure'; - break; - } - } - } - - $phpcsFile->addError($error, $stackPtr, $errorCode); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php deleted file mode 100644 index 5d71c3ec..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class DisallowSizeFunctionsInLoopsSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * An array of functions we don't want in the condition of loops. - * - * @var array - */ - protected $forbiddenFunctions = [ - 'PHP' => [ - 'sizeof' => true, - 'strlen' => true, - 'count' => true, - ], - 'JS' => ['length' => true], - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_WHILE, - T_FOR, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - $tokenizer = $phpcsFile->tokenizerType; - $openBracket = $tokens[$stackPtr]['parenthesis_opener']; - $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; - - if ($tokens[$stackPtr]['code'] === T_FOR) { - // We only want to check the condition in FOR loops. - $start = $phpcsFile->findNext(T_SEMICOLON, ($openBracket + 1)); - $end = $phpcsFile->findPrevious(T_SEMICOLON, ($closeBracket - 1)); - } else { - $start = $openBracket; - $end = $closeBracket; - } - - for ($i = ($start + 1); $i < $end; $i++) { - if ($tokens[$i]['code'] === T_STRING - && isset($this->forbiddenFunctions[$tokenizer][$tokens[$i]['content']]) === true - ) { - $functionName = $tokens[$i]['content']; - if ($tokenizer === 'JS') { - // Needs to be in the form object.function to be valid. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($i - 1), null, true); - if ($prev === false || $tokens[$prev]['code'] !== T_OBJECT_OPERATOR) { - continue; - } - - $functionName = 'object.'.$functionName; - } else { - // Make sure it isn't a member var. - if ($tokens[($i - 1)]['code'] === T_OBJECT_OPERATOR - || $tokens[($i - 1)]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - continue; - } - - $functionName .= '()'; - } - - $error = 'The use of %s inside a loop condition is not allowed; assign the return value to a variable and use the variable in the loop condition instead'; - $data = [$functionName]; - $phpcsFile->addError($error, $i, 'Found', $data); - }//end if - }//end for - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php deleted file mode 100644 index 56fce551..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP; - -use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff as GenericForbiddenFunctionsSniff; - -class DiscouragedFunctionsSniff extends GenericForbiddenFunctionsSniff -{ - - /** - * A list of forbidden functions with their alternatives. - * - * The value is NULL if no alternative exists. IE, the - * function should just not be used. - * - * @var array - */ - public $forbiddenFunctions = [ - 'error_log' => null, - 'print_r' => null, - 'var_dump' => null, - ]; - - /** - * If true, an error will be thrown; otherwise a warning. - * - * @var boolean - */ - public $error = false; - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php deleted file mode 100644 index 0be6118e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php +++ /dev/null @@ -1,512 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 EmbeddedPhpSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - // If the close php tag is on the same line as the opening - // then we have an inline embedded PHP block. - $closeTag = $phpcsFile->findNext(T_CLOSE_TAG, $stackPtr); - if ($closeTag === false || $tokens[$stackPtr]['line'] !== $tokens[$closeTag]['line']) { - $this->validateMultilineEmbeddedPhp($phpcsFile, $stackPtr, $closeTag); - } else { - $this->validateInlineEmbeddedPhp($phpcsFile, $stackPtr, $closeTag); - } - - }//end process() - - - /** - * Validates embedded PHP that exists on multiple lines. - * - * @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|false $closingTag The position of the PHP close tag in the - * stack passed in $tokens. - * - * @return void - */ - private function validateMultilineEmbeddedPhp($phpcsFile, $stackPtr, $closingTag) - { - $tokens = $phpcsFile->getTokens(); - - $prevTag = $phpcsFile->findPrevious($this->register(), ($stackPtr - 1)); - if ($prevTag === false) { - // This is the first open tag. - return; - } - - $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($firstContent === false) { - // Unclosed PHP open tag at the end of a file. Nothing to do. - return; - } - - if ($closingTag !== false) { - $firstContentAfterBlock = $phpcsFile->findNext(T_WHITESPACE, ($closingTag + 1), $phpcsFile->numTokens, true); - if ($firstContentAfterBlock === false) { - // Final closing tag. It will be handled elsewhere. - return; - } - - // We have an opening and a closing tag, that lie within other content. - if ($firstContent === $closingTag) { - $this->reportEmptyTagSet($phpcsFile, $stackPtr, $closingTag); - return; - } - }//end if - - if ($tokens[$firstContent]['line'] === $tokens[$stackPtr]['line']) { - $error = 'Opening PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentAfterOpen'); - if ($fix === true) { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true); - $padding = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); - - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($stackPtr, rtrim($tokens[$stackPtr]['content'])); - $phpcsFile->fixer->addNewline($stackPtr); - $phpcsFile->fixer->addContent($stackPtr, str_repeat(' ', $padding)); - - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - // Check the indent of the first line, except if it is a scope closer. - if (isset($tokens[$firstContent]['scope_closer']) === false - || $tokens[$firstContent]['scope_closer'] !== $firstContent - ) { - // Check for a blank line at the top. - if ($tokens[$firstContent]['line'] > ($tokens[$stackPtr]['line'] + 1)) { - // Find a token on the blank line to throw the error on. - $i = $stackPtr; - do { - $i++; - } while ($tokens[$i]['line'] !== ($tokens[$stackPtr]['line'] + 1)); - - $error = 'Blank line found at start of embedded PHP content'; - $fix = $phpcsFile->addFixableError($error, $i, 'SpacingBefore'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $firstContent; $i++) { - if ($tokens[$i]['line'] === $tokens[$firstContent]['line'] - || $tokens[$i]['line'] === $tokens[$stackPtr]['line'] - ) { - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - $indent = 0; - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr); - if ($first === false) { - $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); - if ($first !== false) { - $indent = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); - } - } else { - $indent = ($tokens[($first + 1)]['column'] - 1); - } - - $contentColumn = ($tokens[$firstContent]['column'] - 1); - if ($contentColumn !== $indent) { - $error = 'First line of embedded PHP code must be indented %s spaces; %s found'; - $data = [ - $indent, - $contentColumn, - ]; - $fix = $phpcsFile->addFixableError($error, $firstContent, 'Indent', $data); - if ($fix === true) { - $padding = str_repeat(' ', $indent); - if ($contentColumn === 0) { - $phpcsFile->fixer->addContentBefore($firstContent, $padding); - } else { - $phpcsFile->fixer->replaceToken(($firstContent - 1), $padding); - } - } - } - }//end if - }//end if - - $lastContentBeforeBlock = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$lastContentBeforeBlock]['line'] === $tokens[$stackPtr]['line'] - && trim($tokens[$lastContentBeforeBlock]['content']) !== '' - ) { - $error = 'Opening PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContentBeforeOpen'); - if ($fix === true) { - $padding = 0; - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr); - if ($first === false) { - $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); - if ($first !== false) { - $padding = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); - } - } else { - $padding = ($tokens[($first + 1)]['column'] - 1); - } - - $phpcsFile->fixer->addContentBefore($stackPtr, $phpcsFile->eolChar.str_repeat(' ', $padding)); - } - } else { - // Find the first token on the first non-empty line we find. - for ($first = ($lastContentBeforeBlock - 1); $first > 0; $first--) { - if ($tokens[$first]['line'] === $tokens[$stackPtr]['line']) { - continue; - } else if (trim($tokens[$first]['content']) !== '') { - $first = $phpcsFile->findFirstOnLine([], $first, true); - if ($tokens[$first]['code'] === T_COMMENT - && $tokens[$first]['content'] !== ltrim($tokens[$first]['content']) - ) { - // This is a subsequent line in a star-slash comment containing leading indent. - // We'll need the first line of the comment to correctly determine the indent. - continue; - } - - break; - } - } - - $expected = 0; - if ($tokens[$first]['code'] === T_INLINE_HTML - && trim($tokens[$first]['content']) !== '' - ) { - $expected = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content']))); - } else if ($tokens[$first]['code'] === T_WHITESPACE) { - $expected = ($tokens[($first + 1)]['column'] - 1); - } - - $expected += 4; - $found = ($tokens[$stackPtr]['column'] - 1); - if ($found > $expected) { - $error = 'Opening PHP tag indent incorrect; expected no more than %s spaces but found %s'; - $data = [ - $expected, - $found, - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenTagIndent', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), str_repeat(' ', $expected)); - } - } - }//end if - - if ($closingTag === false) { - return; - } - - $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closingTag - 1), ($stackPtr + 1), true); - $firstContentAfterBlock = $phpcsFile->findNext(T_WHITESPACE, ($closingTag + 1), null, true); - - if ($tokens[$lastContent]['line'] === $tokens[$closingTag]['line']) { - $error = 'Closing PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $closingTag, 'ContentBeforeEnd'); - if ($fix === true) { - // Calculate the indent for the close tag. - // If the close tag is on the same line as the first content, re-use the indent - // calculated for the first content line to prevent the indent being based on an - // "old" indent, not the _new_ (fixed) indent. - if ($tokens[$firstContent]['line'] === $tokens[$lastContent]['line'] - && isset($indent) === true - ) { - $closerIndent = $indent; - } else { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $closingTag, true); - - while ($tokens[$first]['code'] === T_COMMENT - && $tokens[$first]['content'] !== ltrim($tokens[$first]['content']) - ) { - // This is a subsequent line in a star-slash comment containing leading indent. - // We'll need the first line of the comment to correctly determine the indent. - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, ($first - 1), true); - } - - $closerIndent = ($tokens[$first]['column'] - 1); - } - - $phpcsFile->fixer->beginChangeset(); - - if ($tokens[($closingTag - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($closingTag - 1), ''); - } - - $phpcsFile->fixer->addContentBefore($closingTag, str_repeat(' ', $closerIndent)); - $phpcsFile->fixer->addNewlineBefore($closingTag); - $phpcsFile->fixer->endChangeset(); - }//end if - } else if ($firstContentAfterBlock !== false - && $tokens[$firstContentAfterBlock]['line'] === $tokens[$closingTag]['line'] - ) { - $error = 'Closing PHP tag must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $closingTag, 'ContentAfterEnd'); - if ($fix === true) { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $closingTag, true); - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addNewline($closingTag); - $phpcsFile->fixer->addContent($closingTag, str_repeat(' ', ($tokens[$first]['column'] - 1))); - - if ($tokens[$firstContentAfterBlock]['code'] === T_INLINE_HTML) { - $trimmedHtmlContent = ltrim($tokens[$firstContentAfterBlock]['content']); - if ($trimmedHtmlContent === '') { - // HTML token contains only whitespace and the next token after is PHP, not HTML, so remove the whitespace. - $phpcsFile->fixer->replaceToken($firstContentAfterBlock, ''); - } else { - // The HTML token has content, so remove leading whitespace in favour of the indent. - $phpcsFile->fixer->replaceToken($firstContentAfterBlock, $trimmedHtmlContent); - } - } - - if ($tokens[$firstContentAfterBlock]['code'] === T_OPEN_TAG - || $tokens[$firstContentAfterBlock]['code'] === T_OPEN_TAG_WITH_ECHO - ) { - // Next token is a PHP open tag which will also have thrown an error. - // Prevent both fixers running in the same loop by making sure the token is "touched" during this loop. - // This prevents a stray new line being added between the close and open tags. - $phpcsFile->fixer->replaceToken($firstContentAfterBlock, $tokens[$firstContentAfterBlock]['content']); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - - $next = $phpcsFile->findNext($this->register(), ($closingTag + 1)); - if ($next === false) { - return; - } - - // Check for a blank line at the bottom. - if ((isset($tokens[$lastContent]['scope_closer']) === false - || $tokens[$lastContent]['scope_closer'] !== $lastContent) - && $tokens[$lastContent]['line'] < ($tokens[$closingTag]['line'] - 1) - ) { - // Find a token on the blank line to throw the error on. - $i = $closingTag; - do { - $i--; - } while ($tokens[$i]['line'] !== ($tokens[$closingTag]['line'] - 1)); - - $error = 'Blank line found at end of embedded PHP content'; - $fix = $phpcsFile->addFixableError($error, $i, 'SpacingAfter'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($lastContent + 1); $i < $closingTag; $i++) { - if ($tokens[$i]['line'] === $tokens[$lastContent]['line'] - || $tokens[$i]['line'] === $tokens[$closingTag]['line'] - ) { - continue; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - }//end if - - }//end validateMultilineEmbeddedPhp() - - - /** - * Validates embedded PHP that exists on one line. - * - * @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 $closeTag The position of the PHP close tag in the - * stack passed in $tokens. - * - * @return void - */ - private function validateInlineEmbeddedPhp($phpcsFile, $stackPtr, $closeTag) - { - $tokens = $phpcsFile->getTokens(); - - $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), $closeTag, true); - - if ($firstContent === false) { - $this->reportEmptyTagSet($phpcsFile, $stackPtr, $closeTag); - return; - } - - // Check that there is one, and only one space at the start of the statement. - $leadingSpace = 0; - if ($tokens[$stackPtr]['code'] === T_OPEN_TAG) { - // The long open tag token in a single line tag set always contains a single space after it. - $leadingSpace = 1; - } - - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $leadingSpace += $tokens[($stackPtr + 1)]['length']; - } - - if ($leadingSpace !== 1) { - $error = 'Expected 1 space after opening PHP tag; %s found'; - $data = [$leadingSpace]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterOpen', $data); - if ($fix === true) { - if ($tokens[$stackPtr]['code'] === T_OPEN_TAG) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - // Short open tag with too much whitespace. - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } else { - // Short open tag without whitespace. - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($closeTag - 1), $stackPtr, true); - if ($prev !== $stackPtr) { - if ((isset($tokens[$prev]['scope_opener']) === false - || $tokens[$prev]['scope_opener'] !== $prev) - && (isset($tokens[$prev]['scope_closer']) === false - || $tokens[$prev]['scope_closer'] !== $prev) - && $tokens[$prev]['code'] !== T_SEMICOLON - ) { - $error = 'Inline PHP statement must end with a semicolon'; - $code = 'NoSemicolon'; - if ($tokens[$stackPtr]['code'] === T_OPEN_TAG_WITH_ECHO) { - $code = 'ShortOpenEchoNoSemicolon'; - } - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $code); - if ($fix === true) { - $phpcsFile->fixer->addContent($prev, ';'); - } - } else if ($tokens[$prev]['code'] === T_SEMICOLON) { - $statementCount = 1; - for ($i = ($stackPtr + 1); $i < $prev; $i++) { - if ($tokens[$i]['code'] === T_SEMICOLON) { - $statementCount++; - } - } - - if ($statementCount > 1) { - $error = 'Inline PHP statement must contain a single statement; %s found'; - $data = [$statementCount]; - $phpcsFile->addError($error, $stackPtr, 'MultipleStatements', $data); - } - }//end if - }//end if - - $trailingSpace = 0; - if ($tokens[($closeTag - 1)]['code'] === T_WHITESPACE) { - $trailingSpace = $tokens[($closeTag - 1)]['length']; - } else if (($tokens[($closeTag - 1)]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[($closeTag - 1)]['code']]) === true) - && substr($tokens[($closeTag - 1)]['content'], -1) === ' ' - ) { - $trailingSpace = (strlen($tokens[($closeTag - 1)]['content']) - strlen(rtrim($tokens[($closeTag - 1)]['content']))); - } - - if ($trailingSpace !== 1) { - $error = 'Expected 1 space before closing PHP tag; %s found'; - $data = [$trailingSpace]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeClose', $data); - if ($fix === true) { - if ($trailingSpace === 0) { - $phpcsFile->fixer->addContentBefore($closeTag, ' '); - } else if ($tokens[($closeTag - 1)]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[($closeTag - 1)]['code']]) === true - ) { - $phpcsFile->fixer->replaceToken(($closeTag - 1), rtrim($tokens[($closeTag - 1)]['content']).' '); - } else { - $phpcsFile->fixer->replaceToken(($closeTag - 1), ' '); - } - } - } - - }//end validateInlineEmbeddedPhp() - - - /** - * Report and fix an set of empty PHP tags. - * - * @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 $closeTag The position of the PHP close tag in the - * stack passed in $tokens. - * - * @return void - */ - private function reportEmptyTagSet(File $phpcsFile, $stackPtr, $closeTag) - { - $tokens = $phpcsFile->getTokens(); - $error = 'Empty embedded PHP tag found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = $stackPtr; $i <= $closeTag; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - // Prevent leaving indentation whitespace behind when the empty tag set is the only thing on the affected lines. - if (isset($tokens[($closeTag + 1)]) === true - && $tokens[($closeTag + 1)]['line'] !== $tokens[$closeTag]['line'] - && $tokens[($stackPtr - 1)]['code'] === T_INLINE_HTML - && $tokens[($stackPtr - 1)]['line'] === $tokens[$stackPtr]['line'] - && $tokens[($stackPtr - 1)]['column'] === 1 - && trim($tokens[($stackPtr - 1)]['content']) === '' - ) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - } - - }//end reportEmptyTagSet() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php deleted file mode 100644 index 102bd7c3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/EvalSniff.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class EvalSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_EVAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $error = 'Use of eval() is discouraged'; - $phpcsFile->addWarning($error, $stackPtr, 'Discouraged'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php deleted file mode 100644 index fec3ec82..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class GlobalKeywordSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_GLOBAL]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $nextVar = $tokens[$phpcsFile->findNext([T_VARIABLE], $stackPtr)]; - $varName = str_replace('$', '', $nextVar['content']); - $error = 'Use of the "global" keyword is forbidden; use "$GLOBALS[\'%s\']" instead'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed', $data); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php deleted file mode 100644 index a3ab8e5a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/HeredocSniff.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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; - -class HeredocSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_START_HEREDOC, - T_START_NOWDOC, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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) - { - $error = 'Use of heredoc and nowdoc syntax ("<<<") is not allowed; use standard strings or inline HTML instead'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php deleted file mode 100644 index 1bc369a2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['conditions']) === false) { - 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; - } - } - - if ($outerFuncToken === null) { - // Not a nested function. - return; - } - - $error = 'The use of inner functions is forbidden'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php deleted file mode 100644 index 0b671d62..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php +++ /dev/null @@ -1,167 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 LowercasePHPFunctionsSniff implements Sniff -{ - - /** - * String -> int hash map of all php built in function names - * - * @var array - */ - private $builtInFunctions; - - - /** - * Construct the LowercasePHPFunctionSniff - */ - public function __construct() - { - - $allFunctions = get_defined_functions(); - $this->builtInFunctions = array_flip($allFunctions['internal']); - - }//end __construct() - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_STRING]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 ($content === $contentLc) { - return; - } - - // Make sure it is an inbuilt PHP function. - // PHP_CodeSniffer can possibly include user defined functions - // through the use of vendor/autoload.php. - if (isset($this->builtInFunctions[$contentLc]) === false) { - return; - } - - // 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. - return; - } - - $ignore = Tokens::$emptyTokens; - $ignore[] = T_BITWISE_AND; - $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); - $prevPrev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - - if ($tokens[$next]['code'] !== T_OPEN_PARENTHESIS) { - // Is this a use statement importing a PHP native function ? - if ($tokens[$next]['code'] !== T_NS_SEPARATOR - && $tokens[$prev]['code'] === T_STRING - && $tokens[$prev]['content'] === 'function' - && $prevPrev !== false - && $tokens[$prevPrev]['code'] === T_USE - ) { - $error = 'Use statements for PHP native functions must be lowercase; expected "%s" but found "%s"'; - $data = [ - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'UseStatementUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - } - - // No open parenthesis; not a "use function" statement nor a function call. - return; - }//end if - - if ($tokens[$prev]['code'] === T_FUNCTION) { - // Function declaration, not a function call. - return; - } - - if ($tokens[$prev]['code'] === T_NS_SEPARATOR) { - if ($prevPrev !== false - && ($tokens[$prevPrev]['code'] === T_STRING - || $tokens[$prevPrev]['code'] === T_NAMESPACE - || $tokens[$prevPrev]['code'] === T_NEW) - ) { - // Namespaced class/function, not an inbuilt function. - // Could potentially give false negatives for non-namespaced files - // when namespace\functionName() is encountered. - return; - } - } - - if ($tokens[$prev]['code'] === T_NEW) { - // Object creation, not an inbuilt function. - return; - } - - if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR - || $tokens[$prev]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - // Not an inbuilt function. - return; - } - - if ($tokens[$prev]['code'] === T_DOUBLE_COLON) { - // Not an inbuilt function. - return; - } - - $error = 'Calls to PHP native functions must be lowercase; expected "%s" but found "%s"'; - $data = [ - $contentLc, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'CallUppercase', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $contentLc); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php deleted file mode 100644 index 4c0d6bcb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php +++ /dev/null @@ -1,303 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @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 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. - * - * @return array - */ - public function register() - { - return [ - T_BREAK, - T_CONTINUE, - T_RETURN, - T_THROW, - T_EXIT, - T_GOTO, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - // 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; - } - - // 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; - } - - // 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(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($tokens[$next]['code'] === T_SEMICOLON) { - $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 - || $tokens[$owner]['code'] === T_CLOSURE - ) { - $warning = 'Empty return statement not required here'; - $phpcsFile->addWarning($warning, $stackPtr, 'ReturnNotRequired'); - return; - } - } - } - } - - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $owner = $tokens[$stackPtr]['scope_condition']; - if ($tokens[$owner]['code'] === T_CASE || $tokens[$owner]['code'] === T_DEFAULT) { - // This token closes the scope of a CASE or DEFAULT statement - // so any code between this statement and the next CASE, DEFAULT or - // end of SWITCH token will not be executable. - $end = $phpcsFile->findEndOfStatement($stackPtr); - $next = $phpcsFile->findNext( - [ - T_CASE, - T_DEFAULT, - T_CLOSE_CURLY_BRACKET, - T_ENDSWITCH, - ], - ($end + 1) - ); - - if ($next !== false) { - $lastLine = $tokens[$end]['line']; - for ($i = ($stackPtr + 1); $i < $next; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - $line = $tokens[$i]['line']; - if ($line > $lastLine) { - $type = substr($tokens[$stackPtr]['type'], 2); - $warning = 'Code after the %s statement on line %s cannot be executed'; - $data = [ - $type, - $tokens[$stackPtr]['line'], - ]; - $phpcsFile->addWarning($warning, $i, 'Unreachable', $data); - $lastLine = $line; - } - } - }//end if - - // That's all we have to check for these types of statements. - return; - }//end if - }//end if - - $ourConditions = array_keys($tokens[$stackPtr]['conditions']); - - if (empty($ourConditions) === false) { - $condition = array_pop($ourConditions); - - if (isset($tokens[$condition]['scope_closer']) === false) { - return; - } - - // Special case for BREAK statements sitting directly inside SWITCH - // statements. If we get to this point, we know the BREAK is not being - // used to close a CASE statement, so it is most likely non-executable - // code itself (as is the case when you put return; break; at the end of - // a case). So we need to ignore this token. - if ($tokens[$condition]['code'] === T_SWITCH - && $tokens[$stackPtr]['code'] === T_BREAK - ) { - return; - } - - $closer = $tokens[$condition]['scope_closer']; - - // If the closer for our condition is shared with other openers, - // we will need to throw errors from this token to the next - // shared opener (if there is one), not to the scope closer. - $nextOpener = null; - for ($i = ($stackPtr + 1); $i < $closer; $i++) { - if (isset($tokens[$i]['scope_closer']) === true) { - if ($tokens[$i]['scope_closer'] === $closer) { - // We found an opener that shares the same - // closing token as us. - $nextOpener = $i; - break; - } - } - }//end for - - if ($nextOpener === null) { - $end = $closer; - } else { - $end = ($nextOpener - 1); - } - } else { - // This token is in the global scope. - if ($tokens[$stackPtr]['code'] === T_BREAK) { - return; - } - - // Throw an error for all lines until the end of the file. - $end = ($phpcsFile->numTokens - 1); - }//end if - - // 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; - } - - if (isset($tokens[$start]['parenthesis_closer']) === true - && $tokens[$start]['code'] === T_OPEN_PARENTHESIS - ) { - $start = $tokens[$start]['parenthesis_closer']; - continue; - } - - if (isset($tokens[$start]['bracket_closer']) === true - && $tokens[$start]['code'] === T_OPEN_CURLY_BRACKET - ) { - $start = $tokens[$start]['bracket_closer']; - continue; - } - - if ($tokens[$start]['code'] === T_SEMICOLON || $tokens[$start]['code'] === T_CLOSE_TAG) { - break; - } - }//end for - - if (isset($tokens[$start]) === false) { - return; - } - - $lastLine = $tokens[$start]['line']; - for ($i = ($start + 1); $i < $end; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true - || isset(Tokens::$bracketTokens[$tokens[$i]['code']]) === true - || $tokens[$i]['code'] === T_SEMICOLON - ) { - continue; - } - - // Skip whole functions and classes/interfaces because they are not - // technically executed code, but rather declarations that may be used. - if (isset(Tokens::$ooScopeTokens[$tokens[$i]['code']]) === true - || $tokens[$i]['code'] === T_FUNCTION - || $tokens[$i]['code'] === T_CLOSURE - ) { - if (isset($tokens[$i]['scope_closer']) === false) { - // Parse error/Live coding. - return; - } - - $i = $tokens[$i]['scope_closer']; - 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); - $warning = 'Code after the %s statement on line %s cannot be executed'; - $data = [ - $type, - $tokens[$stackPtr]['line'], - ]; - $phpcsFile->addWarning($warning, $i, 'Unreachable', $data); - $lastLine = $line; - } - }//end for - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php deleted file mode 100644 index 3d1c83f0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; - -class MemberVarScopeSniff extends AbstractVariableSniff -{ - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $properties = $phpcsFile->getMemberProperties($stackPtr); - - if ($properties === [] || $properties['scope_specified'] !== false) { - return; - } - - $error = 'Scope modifier not specified for member variable "%s"'; - $data = [$tokens[$stackPtr]['content']]; - $phpcsFile->addError($error, $stackPtr, 'Missing', $data); - - }//end processMemberVar() - - - /** - * Processes normal variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariable() - - - /** - * Processes variables in double quoted strings. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariableInString() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php deleted file mode 100644 index 39ed5b0d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php +++ /dev/null @@ -1,83 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Tokens; - -class MethodScopeSniff extends AbstractScopeSniff -{ - - - /** - * Constructs a Squiz_Sniffs_Scope_MethodScopeSniff. - */ - public function __construct() - { - parent::__construct(Tokens::$ooScopeTokens, [T_FUNCTION]); - - }//end __construct() - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * @param int $currScope The current scope opener token. - * - * @return void - */ - protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - $methodName = $phpcsFile->getDeclarationName($stackPtr); - if ($methodName === null) { - // Ignore closures. - return; - } - - $properties = $phpcsFile->getMethodProperties($stackPtr); - if ($properties['scope_specified'] === false) { - $error = 'Visibility must be declared on method "%s"'; - $data = [$methodName]; - $phpcsFile->addError($error, $stackPtr, 'Missing', $data); - } - - }//end processTokenWithinScope() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php deleted file mode 100644 index aab5bdb7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php +++ /dev/null @@ -1,128 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractScopeSniff; -use PHP_CodeSniffer\Util\Tokens; - -class StaticThisUsageSniff extends AbstractScopeSniff -{ - - - /** - * Constructs the test with the tokens it wishes to listen for. - */ - public function __construct() - { - parent::__construct([T_CLASS, T_TRAIT, T_ENUM, T_ANON_CLASS], [T_FUNCTION]); - - }//end __construct() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * @param int $currScope A pointer to the start of the scope. - * - * @return void - */ - public function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - // Determine if this is a function which needs to be examined. - $conditions = $tokens[$stackPtr]['conditions']; - end($conditions); - $deepestScope = key($conditions); - if ($deepestScope !== $currScope) { - return; - } - - // Ignore abstract functions. - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next === false || $tokens[$next]['code'] !== T_STRING) { - // Not a function declaration, or incomplete. - return; - } - - $methodProps = $phpcsFile->getMethodProperties($stackPtr); - if ($methodProps['is_static'] === false) { - return; - } - - $next = $stackPtr; - $end = $tokens[$stackPtr]['scope_closer']; - - $this->checkThisUsage($phpcsFile, $next, $end); - - }//end processTokenWithinScope() - - - /** - * Check for $this variable usage between $next and $end tokens. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being scanned. - * @param int $next The position of the next token to check. - * @param int $end The position of the last token to check. - * - * @return void - */ - private function checkThisUsage(File $phpcsFile, $next, $end) - { - $tokens = $phpcsFile->getTokens(); - - do { - $next = $phpcsFile->findNext([T_VARIABLE, T_ANON_CLASS], ($next + 1), $end); - if ($next === false) { - continue; - } - - if ($tokens[$next]['code'] === T_ANON_CLASS) { - $this->checkThisUsage($phpcsFile, $next, $tokens[$next]['scope_opener']); - $next = $tokens[$next]['scope_closer']; - continue; - } - - if ($tokens[$next]['content'] !== '$this') { - continue; - } - - $error = 'Usage of "$this" in static methods will cause runtime errors'; - $phpcsFile->addError($error, $next, 'Found'); - } while ($next !== false); - - }//end checkThisUsage() - - - /** - * Processes a token that is found within the scope that this test is - * listening to. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack where this - * token was found. - * - * @return void - */ - protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) - { - - }//end processTokenOutsideScope() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php deleted file mode 100644 index 66c32454..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php +++ /dev/null @@ -1,164 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ConcatenationSpacingSniff implements Sniff -{ - - /** - * The number of spaces before and after a string concat. - * - * @var integer - */ - public $spacing = 0; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_STRING_CONCAT]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - if (isset($tokens[($stackPtr + 2)]) === false) { - // Syntax error or live coding, bow out. - return; - } - - $ignoreBefore = false; - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) { - // Spacing before must be preserved due to the here/nowdoc closing tag. - $ignoreBefore = true; - } - - $this->spacing = (int) $this->spacing; - - if ($ignoreBefore === false) { - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $before = 0; - } else { - if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { - $before = 'newline'; - } else { - $before = $tokens[($stackPtr - 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing before string concat', $before); - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $after = 0; - } else { - if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $after = 'newline'; - } else { - $after = $tokens[($stackPtr + 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing after string concat', $after); - - if (($ignoreBefore === true - || $before === $this->spacing - || ($before === 'newline' - && $this->ignoreNewlines === true)) - && ($after === $this->spacing - || ($after === 'newline' - && $this->ignoreNewlines === true)) - ) { - return; - } - - if ($this->spacing === 0) { - $message = 'Concat operator must not be surrounded by spaces'; - $data = []; - } else { - if ($this->spacing > 1) { - $message = 'Concat operator must be surrounded by %s spaces'; - } else { - $message = 'Concat operator must be surrounded by a single space'; - } - - $data = [$this->spacing]; - } - - $fix = $phpcsFile->addFixableError($message, $stackPtr, 'PaddingFound', $data); - - if ($fix === true) { - $padding = str_repeat(' ', $this->spacing); - if ($ignoreBefore === false && ($before !== 'newline' || $this->ignoreNewlines === false)) { - if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($stackPtr - 1), $padding); - if ($this->spacing === 0 - && ($tokens[($stackPtr - 2)]['code'] === T_LNUMBER - || $tokens[($stackPtr - 2)]['code'] === T_DNUMBER) - ) { - $phpcsFile->fixer->replaceToken(($stackPtr - 2), '('.$tokens[($stackPtr - 2)]['content'].')'); - } - - $phpcsFile->fixer->endChangeset(); - } else if ($this->spacing > 0) { - $phpcsFile->fixer->addContent(($stackPtr - 1), $padding); - } - } - - if ($after !== 'newline' || $this->ignoreNewlines === false) { - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken(($stackPtr + 1), $padding); - if ($this->spacing === 0 - && ($tokens[($stackPtr + 2)]['code'] === T_LNUMBER - || $tokens[($stackPtr + 2)]['code'] === T_DNUMBER) - ) { - $phpcsFile->fixer->replaceToken(($stackPtr + 2), '('.$tokens[($stackPtr + 2)]['content'].')'); - } - - $phpcsFile->fixer->endChangeset(); - } else if ($this->spacing > 0) { - $phpcsFile->fixer->addContent($stackPtr, $padding); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php deleted file mode 100644 index fb3b626f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php +++ /dev/null @@ -1,144 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class DoubleQuoteUsageSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_CONSTANT_ENCAPSED_STRING, - T_DOUBLE_QUOTED_STRING, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // If tabs are being converted to spaces by the tokeniser, the - // original content should be used instead of the converted content. - if (isset($tokens[$stackPtr]['orig_content']) === true) { - $workingString = $tokens[$stackPtr]['orig_content']; - } else { - $workingString = $tokens[$stackPtr]['content']; - } - - $lastStringToken = $stackPtr; - - $i = ($stackPtr + 1); - if (isset($tokens[$i]) === true) { - while ($i < $phpcsFile->numTokens - && $tokens[$i]['code'] === $tokens[$stackPtr]['code'] - ) { - if (isset($tokens[$i]['orig_content']) === true) { - $workingString .= $tokens[$i]['orig_content']; - } else { - $workingString .= $tokens[$i]['content']; - } - - $lastStringToken = $i; - $i++; - } - } - - $skipTo = ($lastStringToken + 1); - - // Check if it's a double quoted string. - if ($workingString[0] !== '"' || substr($workingString, -1) !== '"') { - return $skipTo; - } - - // The use of variables in double quoted strings is not allowed. - if ($tokens[$stackPtr]['code'] === T_DOUBLE_QUOTED_STRING) { - $stringTokens = token_get_all('addError($error, $stackPtr, 'ContainsVar', $data); - } - } - - return $skipTo; - }//end if - - $allowedChars = [ - '\0', - '\1', - '\2', - '\3', - '\4', - '\5', - '\6', - '\7', - '\n', - '\r', - '\f', - '\t', - '\v', - '\x', - '\b', - '\e', - '\u', - '\'', - ]; - - foreach ($allowedChars as $testChar) { - if (strpos($workingString, $testChar) !== false) { - return $skipTo; - } - } - - $error = 'String %s does not require double quotes; use single quotes instead'; - $data = [str_replace(["\r", "\n"], ['\r', '\n'], $workingString)]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NotRequired', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $innerContent = substr($workingString, 1, -1); - $innerContent = str_replace('\"', '"', $innerContent); - $innerContent = str_replace('\\$', '$', $innerContent); - $phpcsFile->fixer->replaceToken($stackPtr, "'$innerContent'"); - while ($lastStringToken !== $stackPtr) { - $phpcsFile->fixer->replaceToken($lastStringToken, ''); - $lastStringToken--; - } - - $phpcsFile->fixer->endChangeset(); - } - - return $skipTo; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php deleted file mode 100644 index ec516a99..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class EchoedStringsSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_ECHO]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - // If the first non-whitespace token is not an opening parenthesis, then we are not concerned. - if ($tokens[$firstContent]['code'] !== T_OPEN_PARENTHESIS) { - $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no'); - return; - } - - $end = $phpcsFile->findNext([T_SEMICOLON, T_CLOSE_TAG], $stackPtr, null, false); - - // If the token before the semicolon is not a closing parenthesis, then we are not concerned. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($end - 1), null, true); - if ($tokens[$prev]['code'] !== T_CLOSE_PARENTHESIS) { - $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no'); - return; - } - - // If the parenthesis don't match, then we are not concerned. - if ($tokens[$firstContent]['parenthesis_closer'] !== $prev) { - $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no'); - return; - } - - $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'yes'); - - if (($phpcsFile->findNext(Tokens::$operators, $stackPtr, $end, false)) === false) { - // There are no arithmetic operators in this. - $error = 'Echoed strings should not be bracketed'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'HasBracket'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($firstContent, ''); - if ($tokens[($firstContent - 1)]['code'] !== T_WHITESPACE) { - $phpcsFile->fixer->addContent(($firstContent - 1), ' '); - } - - $phpcsFile->fixer->replaceToken($prev, ''); - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php deleted file mode 100644 index 2ae782ce..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class CastSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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']; - $expected = str_replace(' ', '', $content); - $expected = str_replace("\t", '', $expected); - - if ($content !== $expected) { - $error = 'Cast statements must not contain whitespace; expected "%s" but found "%s"'; - $data = [ - $expected, - $content, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContainsWhiteSpace', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, $expected); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php deleted file mode 100644 index eb6e5b2a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +++ /dev/null @@ -1,359 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ControlStructureSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_IF, - T_WHILE, - T_FOREACH, - T_FOR, - T_SWITCH, - T_DO, - T_ELSE, - T_ELSEIF, - T_TRY, - T_CATCH, - T_FINALLY, - T_MATCH, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['parenthesis_opener']) === true - && isset($tokens[$stackPtr]['parenthesis_closer']) === true - ) { - $parenOpener = $tokens[$stackPtr]['parenthesis_opener']; - $parenCloser = $tokens[$stackPtr]['parenthesis_closer']; - if ($tokens[($parenOpener + 1)]['code'] === T_WHITESPACE) { - $gap = $tokens[($parenOpener + 1)]['length']; - - if ($gap === 0) { - $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', 'newline'); - $gap = 'newline'; - } else { - $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', $gap); - } - - $error = 'Expected 0 spaces after opening bracket; %s found'; - $data = [$gap]; - $fix = $phpcsFile->addFixableError($error, ($parenOpener + 1), 'SpacingAfterOpenBrace', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenOpener + 1), ''); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Spaces after control structure open parenthesis', 0); - } - - if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line'] - && $tokens[($parenCloser - 1)]['code'] === T_WHITESPACE - ) { - $gap = $tokens[($parenCloser - 1)]['length']; - $error = 'Expected 0 spaces before closing bracket; %s found'; - $data = [$gap]; - $fix = $phpcsFile->addFixableError($error, ($parenCloser - 1), 'SpaceBeforeCloseBrace', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($parenCloser - 1), ''); - } - - if ($gap === 0) { - $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', 'newline'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', $gap); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Spaces before control structure close parenthesis', 0); - } - }//end if - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - $scopeOpener = $tokens[$stackPtr]['scope_opener']; - $scopeCloser = $tokens[$stackPtr]['scope_closer']; - - for ($firstContent = ($scopeOpener + 1); $firstContent < $phpcsFile->numTokens; $firstContent++) { - $code = $tokens[$firstContent]['code']; - - if ($code === T_WHITESPACE - || ($code === T_INLINE_HTML - && trim($tokens[$firstContent]['content']) === '') - ) { - continue; - } - - // Skip all empty tokens on the same line as the opener. - if ($tokens[$firstContent]['line'] === $tokens[$scopeOpener]['line'] - && (isset(Tokens::$emptyTokens[$code]) === true - || $code === T_CLOSE_TAG) - ) { - continue; - } - - break; - } - - // We ignore spacing for some structures that tend to have their own rules. - $ignore = [ - T_FUNCTION => true, - T_CLASS => true, - T_INTERFACE => true, - T_TRAIT => true, - T_ENUM => true, - T_DOC_COMMENT_OPEN_TAG => true, - ]; - - if (isset($ignore[$tokens[$firstContent]['code']]) === false - && $tokens[$firstContent]['line'] >= ($tokens[$scopeOpener]['line'] + 2) - ) { - $gap = ($tokens[$firstContent]['line'] - $tokens[$scopeOpener]['line'] - 1); - $phpcsFile->recordMetric($stackPtr, 'Blank lines at start of control structure', $gap); - - $error = 'Blank line found at start of control structure'; - $fix = $phpcsFile->addFixableError($error, $scopeOpener, 'SpacingAfterOpen'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $i = ($scopeOpener + 1); - while ($tokens[$i]['line'] !== $tokens[$firstContent]['line']) { - // Start removing content from the line after the opener. - if ($tokens[$i]['line'] !== $tokens[$scopeOpener]['line']) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $i++; - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Blank lines at start of control structure', 0); - }//end if - - if ($firstContent !== $scopeCloser) { - $lastContent = $phpcsFile->findPrevious( - T_WHITESPACE, - ($scopeCloser - 1), - null, - true - ); - - $lastNonEmptyContent = $phpcsFile->findPrevious( - Tokens::$emptyTokens, - ($scopeCloser - 1), - null, - true - ); - - $checkToken = $lastContent; - if (isset($tokens[$lastNonEmptyContent]['scope_condition']) === true) { - $checkToken = $tokens[$lastNonEmptyContent]['scope_condition']; - } - - if (isset($ignore[$tokens[$checkToken]['code']]) === false - && $tokens[$lastContent]['line'] <= ($tokens[$scopeCloser]['line'] - 2) - ) { - $errorToken = $scopeCloser; - for ($i = ($scopeCloser - 1); $i > $lastContent; $i--) { - if ($tokens[$i]['line'] < $tokens[$scopeCloser]['line']) { - $errorToken = $i; - break; - } - } - - $gap = ($tokens[$scopeCloser]['line'] - $tokens[$lastContent]['line'] - 1); - $phpcsFile->recordMetric($stackPtr, 'Blank lines at end of control structure', $gap); - - $error = 'Blank line found at end of control structure'; - $fix = $phpcsFile->addFixableError($error, $errorToken, 'SpacingBeforeClose'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($scopeCloser - 1); $i > $lastContent; $i--) { - if ($tokens[$i]['line'] === $tokens[$scopeCloser]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$lastContent]['line']) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - $phpcsFile->recordMetric($stackPtr, 'Blank lines at end of control structure', 0); - }//end if - }//end if - - if ($tokens[$stackPtr]['code'] === T_MATCH) { - // Move the scope closer to the semicolon/comma. - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($scopeCloser + 1), null, true); - if ($next !== false - && ($tokens[$next]['code'] === T_SEMICOLON || $tokens[$next]['code'] === T_COMMA) - ) { - $scopeCloser = $next; - } - } - - $trailingContent = $phpcsFile->findNext( - T_WHITESPACE, - ($scopeCloser + 1), - null, - true - ); - - if ($tokens[$trailingContent]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$trailingContent]['code']]) === true - ) { - // Special exception for code where the comment about - // an ELSE or ELSEIF is written between the control structures. - $nextCode = $phpcsFile->findNext( - Tokens::$emptyTokens, - ($scopeCloser + 1), - null, - true - ); - - if ($tokens[$nextCode]['code'] === T_ELSE - || $tokens[$nextCode]['code'] === T_ELSEIF - || $tokens[$trailingContent]['line'] === $tokens[$scopeCloser]['line'] - ) { - $trailingContent = $nextCode; - } - }//end if - - if ($tokens[$trailingContent]['code'] === T_ELSE) { - if ($tokens[$stackPtr]['code'] === T_IF) { - // IF with ELSE. - return; - } - } - - if ($tokens[$trailingContent]['code'] === T_WHILE - && $tokens[$stackPtr]['code'] === T_DO - ) { - // DO with WHILE. - return; - } - - if ($tokens[$trailingContent]['code'] === T_CLOSE_TAG) { - // At the end of the script or embedded code. - return; - } - - if (isset($tokens[$trailingContent]['scope_condition']) === true - && $tokens[$trailingContent]['scope_condition'] !== $trailingContent - && isset($tokens[$trailingContent]['scope_opener']) === true - && $tokens[$trailingContent]['scope_opener'] !== $trailingContent - ) { - // Another control structure's closing brace. - $owner = $tokens[$trailingContent]['scope_condition']; - if ($tokens[$owner]['code'] === T_FUNCTION) { - // The next content is the closing brace of a function - // so normal function rules apply and we can ignore it. - return; - } - - if ($tokens[$owner]['code'] === T_CLOSURE - && ($phpcsFile->hasCondition($stackPtr, [T_FUNCTION, T_CLOSURE]) === true - || isset($tokens[$stackPtr]['nested_parenthesis']) === true) - ) { - return; - } - - if ($tokens[$trailingContent]['line'] !== ($tokens[$scopeCloser]['line'] + 1)) { - $error = 'Blank line found after control structure'; - $fix = $phpcsFile->addFixableError($error, $scopeCloser, 'LineAfterClose'); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $i = ($scopeCloser + 1); - while ($tokens[$i]['line'] !== $tokens[$trailingContent]['line']) { - $phpcsFile->fixer->replaceToken($i, ''); - $i++; - } - - $phpcsFile->fixer->addNewline($scopeCloser); - $phpcsFile->fixer->endChangeset(); - } - } - } else if ($tokens[$trailingContent]['code'] !== T_ELSE - && $tokens[$trailingContent]['code'] !== T_ELSEIF - && $tokens[$trailingContent]['code'] !== T_CATCH - && $tokens[$trailingContent]['code'] !== T_FINALLY - && $tokens[$trailingContent]['line'] === ($tokens[$scopeCloser]['line'] + 1) - ) { - $error = 'No blank line found after control structure'; - $fix = $phpcsFile->addFixableError($error, $scopeCloser, 'NoLineAfterClose'); - if ($fix === true) { - $trailingContent = $phpcsFile->findNext( - T_WHITESPACE, - ($scopeCloser + 1), - null, - true - ); - - if (($tokens[$trailingContent]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$trailingContent]['code']]) === true) - && $tokens[$trailingContent]['line'] === $tokens[$scopeCloser]['line'] - ) { - $phpcsFile->fixer->addNewline($trailingContent); - } else { - $phpcsFile->fixer->addNewline($scopeCloser); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php deleted file mode 100644 index 54b9ca92..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php +++ /dev/null @@ -1,164 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FunctionClosingBraceSpaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - // Probably an interface method. - return; - } - - $closeBrace = $tokens[$stackPtr]['scope_closer']; - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); - - // Special case for empty JS functions. - if ($phpcsFile->tokenizerType === 'JS' && $prevContent === $tokens[$stackPtr]['scope_opener']) { - // In this case, the opening and closing brace must be - // right next to each other. - if ($tokens[$stackPtr]['scope_closer'] !== ($tokens[$stackPtr]['scope_opener'] + 1)) { - $error = 'The opening and closing braces of empty functions must be directly next to each other; e.g., function () {}'; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBetween'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($tokens[$stackPtr]['scope_opener'] + 1); $i < $closeBrace; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } - - return; - } - - $nestedFunction = false; - if ($phpcsFile->hasCondition($stackPtr, [T_FUNCTION, T_CLOSURE]) === true - || isset($tokens[$stackPtr]['nested_parenthesis']) === true - ) { - $nestedFunction = true; - } - - $braceLine = $tokens[$closeBrace]['line']; - $prevLine = $tokens[$prevContent]['line']; - $found = ($braceLine - $prevLine - 1); - - if ($nestedFunction === true) { - if ($found < 0) { - $error = 'Closing brace of nested function must be on a new line'; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'ContentBeforeClose'); - if ($fix === true) { - $phpcsFile->fixer->addNewlineBefore($closeBrace); - } - } else if ($found > 0) { - $error = 'Expected 0 blank lines before closing brace of nested function; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeNestedClose', $data); - - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $changeMade = false; - for ($i = ($prevContent + 1); $i < $closeBrace; $i++) { - // Try and maintain indentation. - if ($tokens[$i]['line'] === ($braceLine - 1)) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - $changeMade = true; - } - - // Special case for when the last content contains the newline - // token as well, like with a comment. - if ($changeMade === false) { - $phpcsFile->fixer->replaceToken(($prevContent + 1), ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - } else { - if ($found !== 1) { - if ($found < 0) { - $found = 0; - } - - $error = 'Expected 1 blank line before closing function brace; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeClose', $data); - - if ($fix === true) { - if ($found > 1) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prevContent + 1); $i < ($closeBrace - 1); $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken($i, $phpcsFile->eolChar); - $phpcsFile->fixer->endChangeset(); - } else { - // Try and maintain indentation. - if ($tokens[($closeBrace - 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->addNewlineBefore($closeBrace - 1); - } else { - $phpcsFile->fixer->addNewlineBefore($closeBrace); - } - } - } - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php deleted file mode 100644 index 3eff4e0f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php +++ /dev/null @@ -1,98 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class FunctionOpeningBraceSpaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_FUNCTION, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[$stackPtr]['scope_opener']) === false) { - // Probably an interface or abstract method. - return; - } - - $openBrace = $tokens[$stackPtr]['scope_opener']; - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($openBrace + 1), null, true); - - if ($nextContent === $tokens[$stackPtr]['scope_closer']) { - // The next bit of content is the closing brace, so this - // is an empty function and should have a blank line - // between the opening and closing braces. - return; - } - - $braceLine = $tokens[$openBrace]['line']; - $nextLine = $tokens[$nextContent]['line']; - - $found = ($nextLine - $braceLine - 1); - if ($found > 0) { - $error = 'Expected 0 blank lines after opening function brace; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $openBrace, 'SpacingAfter', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($openBrace + 1); $i < $nextContent; $i++) { - if ($tokens[$i]['line'] === $nextLine) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->addNewline($openBrace); - $phpcsFile->fixer->endChangeset(); - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php deleted file mode 100644 index 01cbd647..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php +++ /dev/null @@ -1,366 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class FunctionSpacingSniff implements Sniff -{ - - /** - * The number of blank lines between functions. - * - * @var integer - */ - public $spacing = 2; - - /** - * The number of blank lines before the first function in a class. - * - * @var integer - */ - public $spacingBeforeFirst = 2; - - /** - * The number of blank lines after the last function in a class. - * - * @var integer - */ - public $spacingAfterLast = 2; - - /** - * Original properties as set in a custom ruleset (if any). - * - * @var array|null - */ - private $rulesetProperties = null; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_FUNCTION]; - - }//end register() - - - /** - * Processes this sniff when one of its tokens is encountered. - * - * @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(); - $previousNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($previousNonEmpty !== false - && $tokens[$previousNonEmpty]['code'] === T_OPEN_TAG - && $tokens[$previousNonEmpty]['line'] !== 1 - ) { - // Ignore functions at the start of an embedded PHP block. - return; - } - - // If the ruleset has only overridden the spacing property, use - // that value for all spacing rules. - if ($this->rulesetProperties === null) { - $this->rulesetProperties = []; - if (isset($phpcsFile->ruleset->ruleset['Squiz.WhiteSpace.FunctionSpacing']) === true - && isset($phpcsFile->ruleset->ruleset['Squiz.WhiteSpace.FunctionSpacing']['properties']) === true - ) { - $this->rulesetProperties = $phpcsFile->ruleset->ruleset['Squiz.WhiteSpace.FunctionSpacing']['properties']; - if (isset($this->rulesetProperties['spacing']) === true) { - if (isset($this->rulesetProperties['spacingBeforeFirst']) === false) { - $this->spacingBeforeFirst = $this->spacing; - } - - if (isset($this->rulesetProperties['spacingAfterLast']) === false) { - $this->spacingAfterLast = $this->spacing; - } - } - } - } - - $this->spacing = (int) $this->spacing; - $this->spacingBeforeFirst = (int) $this->spacingBeforeFirst; - $this->spacingAfterLast = (int) $this->spacingAfterLast; - - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - // Must be an interface method, so the closer is the semicolon. - $closer = $phpcsFile->findNext(T_SEMICOLON, $stackPtr); - } else { - $closer = $tokens[$stackPtr]['scope_closer']; - } - - $isFirst = false; - $isLast = false; - - $ignore = ([T_WHITESPACE => T_WHITESPACE] + Tokens::$methodPrefixes); - - $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true); - - while ($tokens[$prev]['code'] === T_ATTRIBUTE_END) { - // Skip past function attributes. - $prev = $phpcsFile->findPrevious($ignore, ($tokens[$prev]['attribute_opener'] - 1), null, true); - } - - if ($tokens[$prev]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - // Skip past function docblocks. - $prev = $phpcsFile->findPrevious($ignore, ($tokens[$prev]['comment_opener'] - 1), null, true); - } - - if ($tokens[$prev]['code'] === T_OPEN_CURLY_BRACKET) { - $isFirst = true; - } - - $next = $phpcsFile->findNext($ignore, ($closer + 1), null, true); - if (isset(Tokens::$emptyTokens[$tokens[$next]['code']]) === true - && $tokens[$next]['line'] === $tokens[$closer]['line'] - ) { - // Skip past "end" comments. - $next = $phpcsFile->findNext($ignore, ($next + 1), null, true); - } - - if ($tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) { - $isLast = true; - } - - /* - Check the number of blank lines - after the function. - */ - - // Allow for comments on the same line as the closer. - for ($nextLineToken = ($closer + 1); $nextLineToken < $phpcsFile->numTokens; $nextLineToken++) { - if ($tokens[$nextLineToken]['line'] !== $tokens[$closer]['line']) { - break; - } - } - - $requiredSpacing = $this->spacing; - $errorCode = 'After'; - if ($isLast === true) { - $requiredSpacing = $this->spacingAfterLast; - $errorCode = 'AfterLast'; - } - - $foundLines = 0; - if ($nextLineToken === ($phpcsFile->numTokens - 1)) { - // We are at the end of the file. - // Don't check spacing after the function because this - // should be done by an EOF sniff. - $foundLines = $requiredSpacing; - } else { - $nextContent = $phpcsFile->findNext(T_WHITESPACE, $nextLineToken, null, true); - if ($nextContent === false) { - // We are at the end of the file. - // Don't check spacing after the function because this - // should be done by an EOF sniff. - $foundLines = $requiredSpacing; - } else { - $foundLines = ($tokens[$nextContent]['line'] - $tokens[$nextLineToken]['line']); - } - } - - if ($isLast === true) { - $phpcsFile->recordMetric($stackPtr, 'Function spacing after last', $foundLines); - } else { - $phpcsFile->recordMetric($stackPtr, 'Function spacing after', $foundLines); - } - - if ($foundLines !== $requiredSpacing) { - $error = 'Expected %s blank line'; - if ($requiredSpacing !== 1) { - $error .= 's'; - } - - $error .= ' after function; %s found'; - $data = [ - $requiredSpacing, - $foundLines, - ]; - - $fix = $phpcsFile->addFixableError($error, $closer, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = $nextLineToken; $i <= $nextContent; $i++) { - if ($tokens[$i]['line'] === $tokens[$nextContent]['line']) { - $phpcsFile->fixer->addContentBefore($i, str_repeat($phpcsFile->eolChar, $requiredSpacing)); - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - - /* - Check the number of blank lines - before the function. - */ - - $prevLineToken = null; - for ($i = $stackPtr; $i >= 0; $i--) { - if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { - continue; - } - - $prevLineToken = $i; - break; - } - - if ($prevLineToken === null) { - // Never found the previous line, which means - // there are 0 blank lines before the function. - $foundLines = 0; - $prevContent = 0; - $prevLineToken = 0; - } else { - $currentLine = $tokens[$stackPtr]['line']; - - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, $prevLineToken, null, true); - - if ($tokens[$prevContent]['code'] === T_COMMENT - || isset(Tokens::$phpcsCommentTokens[$tokens[$prevContent]['code']]) === true - ) { - // Ignore comments as they can have different spacing rules, and this - // isn't a proper function comment anyway. - return; - } - - while ($tokens[$prevContent]['code'] === T_ATTRIBUTE_END - && $tokens[$prevContent]['line'] === ($currentLine - 1) - ) { - // Account for function attributes. - $currentLine = $tokens[$tokens[$prevContent]['attribute_opener']]['line']; - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$prevContent]['attribute_opener'] - 1), null, true); - } - - if ($tokens[$prevContent]['code'] === T_DOC_COMMENT_CLOSE_TAG - && $tokens[$prevContent]['line'] === ($currentLine - 1) - ) { - // Account for function comments. - $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($tokens[$prevContent]['comment_opener'] - 1), null, true); - } - - // 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. - $stopAt = 0; - 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. - return; - } - - if ($tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET - && $tokens[$tokens[$i]['scope_condition']]['code'] === T_FUNCTION - ) { - // Found a previous function. - return; - } - - $currentLine = $tokens[$i]['line']; - if ($currentLine === $prevLine) { - break; - } - - if ($tokens[($i - 1)]['line'] < $currentLine && $tokens[($i + 1)]['line'] > $currentLine) { - // This token is on a line by itself. If it is whitespace, the line is empty. - if ($tokens[$i]['code'] === T_WHITESPACE) { - $foundLines++; - } - } - - $i--; - }//end while - }//end if - - $requiredSpacing = $this->spacing; - $errorCode = 'Before'; - if ($isFirst === true) { - $requiredSpacing = $this->spacingBeforeFirst; - $errorCode = 'BeforeFirst'; - - $phpcsFile->recordMetric($stackPtr, 'Function spacing before first', $foundLines); - } else { - $phpcsFile->recordMetric($stackPtr, 'Function spacing before', $foundLines); - } - - if ($foundLines !== $requiredSpacing) { - $error = 'Expected %s blank line'; - if ($requiredSpacing !== 1) { - $error .= 's'; - } - - $error .= ' before function; %s found'; - $data = [ - $requiredSpacing, - $foundLines, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, $errorCode, $data); - if ($fix === true) { - $nextSpace = $phpcsFile->findNext(T_WHITESPACE, ($prevContent + 1), $stackPtr); - if ($nextSpace === false) { - $nextSpace = ($stackPtr - 1); - } - - if ($foundLines < $requiredSpacing) { - $padding = str_repeat($phpcsFile->eolChar, ($requiredSpacing - $foundLines)); - $phpcsFile->fixer->addContent($prevLineToken, $padding); - } else { - $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($nextSpace + 1), null, true); - $phpcsFile->fixer->beginChangeset(); - for ($i = $nextSpace; $i < $nextContent; $i++) { - if ($tokens[$i]['line'] === $tokens[$prevContent]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$nextContent]['line']) { - $phpcsFile->fixer->addContentBefore($i, str_repeat($phpcsFile->eolChar, $requiredSpacing)); - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php deleted file mode 100644 index c4faf158..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.3.0 Use the Generic.WhiteSpace.LanguageConstructSpacing sniff instead. - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util; - -class LanguageConstructSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_ECHO, - T_PRINT, - T_RETURN, - T_INCLUDE, - T_INCLUDE_ONCE, - T_REQUIRE, - T_REQUIRE_ONCE, - T_NEW, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[($stackPtr + 1)]) === false) { - // Skip if there is no next token. - return; - } - - if ($tokens[($stackPtr + 1)]['code'] === T_SEMICOLON) { - // No content for this language construct. - return; - } - - if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { - $content = $tokens[($stackPtr + 1)]['content']; - if ($content !== ' ') { - $error = 'Language constructs must be followed by a single space; expected 1 space but found "%s"'; - $data = [Util\Common::prepareForOutput($content)]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'IncorrectSingle', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } else if ($tokens[($stackPtr + 1)]['code'] !== T_OPEN_PARENTHESIS) { - $error = 'Language constructs must be followed by a single space; expected "%s" but found "%s"'; - $data = [ - $tokens[$stackPtr]['content'].' '.$tokens[($stackPtr + 1)]['content'], - $tokens[$stackPtr]['content'].$tokens[($stackPtr + 1)]['content'], - ]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php deleted file mode 100644 index d0f4c80c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class LogicalOperatorSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$booleanOperators; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @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(); - - // Check there is one space before the operator. - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before logical operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - } else { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$stackPtr]['line'] === $tokens[$prev]['line'] - && $tokens[($stackPtr - 1)]['length'] !== 1 - ) { - $found = $tokens[($stackPtr - 1)]['length']; - $error = 'Expected 1 space before logical operator; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceBefore', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - } - } - - // Check there is one space after the operator. - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after logical operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - } else { - $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($tokens[$stackPtr]['line'] === $tokens[$next]['line'] - && $tokens[($stackPtr + 1)]['length'] !== 1 - ) { - $found = $tokens[($stackPtr + 1)]['length']; - $error = 'Expected 1 space after logical operator; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceAfter', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php deleted file mode 100644 index 773d25d4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php +++ /dev/null @@ -1,252 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Tokens; - -class MemberVarSpacingSniff extends AbstractVariableSniff -{ - - /** - * The number of blank lines between member vars. - * - * @var integer - */ - public $spacing = 1; - - /** - * The number of blank lines before the first member var. - * - * @var integer - */ - public $spacingBeforeFirst = 1; - - - /** - * Processes the function tokens within the class. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @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. - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $validPrefixes = Tokens::$methodPrefixes; - $validPrefixes[] = T_VAR; - - $startOfStatement = $phpcsFile->findPrevious($validPrefixes, ($stackPtr - 1), null, false, null, true); - if ($startOfStatement === false) { - return; - } - - $endOfStatement = $phpcsFile->findNext(T_SEMICOLON, ($stackPtr + 1), null, false, null, true); - - $ignore = $validPrefixes; - $ignore[T_WHITESPACE] = T_WHITESPACE; - - $start = $startOfStatement; - for ($prev = ($startOfStatement - 1); $prev >= 0; $prev--) { - if (isset($ignore[$tokens[$prev]['code']]) === true) { - continue; - } - - if ($tokens[$prev]['code'] === T_ATTRIBUTE_END - && isset($tokens[$prev]['attribute_opener']) === true - ) { - $prev = $tokens[$prev]['attribute_opener']; - $start = $prev; - continue; - } - - break; - } - - if (isset(Tokens::$commentTokens[$tokens[$prev]['code']]) === true) { - // Assume the comment belongs to the member var if it is on a line by itself. - $prevContent = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev - 1), null, true); - if ($tokens[$prevContent]['line'] !== $tokens[$prev]['line']) { - // Check the spacing, but then skip it. - $foundLines = ($tokens[$startOfStatement]['line'] - $tokens[$prev]['line'] - 1); - if ($foundLines > 0) { - for ($i = ($prev + 1); $i < $startOfStatement; $i++) { - if ($tokens[$i]['column'] !== 1) { - continue; - } - - if ($tokens[$i]['code'] === T_WHITESPACE - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line'] - ) { - $error = 'Expected 0 blank lines after member var comment; %s found'; - $data = [$foundLines]; - $fix = $phpcsFile->addFixableError($error, $prev, 'AfterComment', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - // Inline comments have the newline included in the content but - // docblocks do not. - if ($tokens[$prev]['code'] === T_COMMENT) { - $phpcsFile->fixer->replaceToken($prev, rtrim($tokens[$prev]['content'])); - } - - for ($i = ($prev + 1); $i <= $startOfStatement; $i++) { - if ($tokens[$i]['line'] === $tokens[$startOfStatement]['line']) { - break; - } - - // Remove the newline after the docblock, and any entirely - // empty lines before the member var. - if (($tokens[$i]['code'] === T_WHITESPACE - && $tokens[$i]['line'] === $tokens[$prev]['line']) - || ($tokens[$i]['column'] === 1 - && $tokens[$i]['line'] !== $tokens[($i + 1)]['line']) - ) { - $phpcsFile->fixer->replaceToken($i, ''); - } - } - - $phpcsFile->fixer->addNewline($prev); - $phpcsFile->fixer->endChangeset(); - }//end if - - break; - }//end if - }//end for - }//end if - - $start = $prev; - }//end if - }//end if - - // There needs to be n blank lines before the var, not counting comments. - if ($start === $startOfStatement) { - // No comment found. - $first = $phpcsFile->findFirstOnLine(Tokens::$emptyTokens, $start, true); - if ($first === false) { - $first = $start; - } - } else if ($tokens[$start]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - $first = $tokens[$start]['comment_opener']; - } else { - $first = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($start - 1), null, true); - $first = $phpcsFile->findNext(array_merge(Tokens::$commentTokens, [T_ATTRIBUTE]), ($first + 1)); - } - - // Determine if this is the first member var. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($first - 1), null, true); - if ($tokens[$prev]['code'] === T_CLOSE_CURLY_BRACKET - && isset($tokens[$prev]['scope_condition']) === true - && $tokens[$tokens[$prev]['scope_condition']]['code'] === T_FUNCTION - ) { - return; - } - - if ($tokens[$prev]['code'] === T_OPEN_CURLY_BRACKET - && isset(Tokens::$ooScopeTokens[$tokens[$tokens[$prev]['scope_condition']]['code']]) === true - ) { - $errorMsg = 'Expected %s blank line(s) before first member var; %s found'; - $errorCode = 'FirstIncorrect'; - $spacing = (int) $this->spacingBeforeFirst; - } else { - $errorMsg = 'Expected %s blank line(s) before member var; %s found'; - $errorCode = 'Incorrect'; - $spacing = (int) $this->spacing; - } - - $foundLines = ($tokens[$first]['line'] - $tokens[$prev]['line'] - 1); - - if ($errorCode === 'FirstIncorrect') { - $phpcsFile->recordMetric($stackPtr, 'Member var spacing before first', $foundLines); - } else { - $phpcsFile->recordMetric($stackPtr, 'Member var spacing before', $foundLines); - } - - if ($foundLines === $spacing) { - if ($endOfStatement !== false) { - return $endOfStatement; - } - - return; - } - - $data = [ - $spacing, - $foundLines, - ]; - - $fix = $phpcsFile->addFixableError($errorMsg, $startOfStatement, $errorCode, $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = ($prev + 1); $i < $first; $i++) { - if ($tokens[$i]['line'] === $tokens[$prev]['line']) { - continue; - } - - if ($tokens[$i]['line'] === $tokens[$first]['line']) { - for ($x = 1; $x <= $spacing; $x++) { - $phpcsFile->fixer->addNewlineBefore($i); - } - - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - }//end if - - if ($endOfStatement !== false) { - return $endOfStatement; - } - - }//end processMemberVar() - - - /** - * Processes normal variables. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariable() - - - /** - * Processes variables in double quoted strings. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position where the token was found. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - /* - We don't care about normal variables. - */ - - }//end processVariableInString() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php deleted file mode 100644 index 1c27be7a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +++ /dev/null @@ -1,167 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class ObjectOperatorSpacingSniff implements Sniff -{ - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OBJECT_OPERATOR, - T_DOUBLE_COLON, - T_NULLSAFE_OBJECT_OPERATOR, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $before = 0; - } else { - if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { - $before = 'newline'; - } else { - $before = $tokens[($stackPtr - 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing before object operator', $before); - $this->checkSpacingBeforeOperator($phpcsFile, $stackPtr, $before); - - if (isset($tokens[($stackPtr + 1)]) === false - || isset($tokens[($stackPtr + 2)]) === false - ) { - return; - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $after = 0; - } else { - if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $after = 'newline'; - } else { - $after = $tokens[($stackPtr + 1)]['length']; - } - } - - $phpcsFile->recordMetric($stackPtr, 'Spacing after object operator', $after); - $this->checkSpacingAfterOperator($phpcsFile, $stackPtr, $after); - - }//end process() - - - /** - * Check the spacing before the operator. - * - * @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 mixed $before The number of spaces found before the - * operator or the string 'newline'. - * - * @return boolean true if there was no error, false otherwise. - */ - protected function checkSpacingBeforeOperator(File $phpcsFile, $stackPtr, $before) - { - if ($before !== 0 - && ($before !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Space found before object operator'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before'); - if ($fix === true) { - $tokens = $phpcsFile->getTokens(); - $curPos = ($stackPtr - 1); - - $phpcsFile->fixer->beginChangeset(); - while ($tokens[$curPos]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($curPos, ''); - --$curPos; - } - - $phpcsFile->fixer->endChangeset(); - } - - return false; - } - - return true; - - }//end checkSpacingBeforeOperator() - - - /** - * Check the spacing after the operator. - * - * @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 mixed $after The number of spaces found after the - * operator or the string 'newline'. - * - * @return boolean true if there was no error, false otherwise. - */ - protected function checkSpacingAfterOperator(File $phpcsFile, $stackPtr, $after) - { - if ($after !== 0 - && ($after !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Space found after object operator'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'After'); - if ($fix === true) { - $tokens = $phpcsFile->getTokens(); - $curPos = ($stackPtr + 1); - - $phpcsFile->fixer->beginChangeset(); - while ($tokens[$curPos]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($curPos, ''); - ++$curPos; - } - - $phpcsFile->fixer->endChangeset(); - } - - return false; - } - - return true; - - }//end checkSpacingAfterOperator() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php deleted file mode 100644 index 2a87978a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php +++ /dev/null @@ -1,409 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class OperatorSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - /** - * Allow newlines instead of spaces. - * - * @var boolean - */ - public $ignoreNewlines = false; - - /** - * Don't check spacing for assignment operators. - * - * This allows multiple assignment statements to be aligned. - * - * @var boolean - */ - public $ignoreSpacingBeforeAssignments = true; - - /** - * A list of tokens that aren't considered as operands. - * - * @var string[] - */ - private $nonOperandTokens = []; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - /* - First we setup an array of all the tokens that can come before - a T_MINUS or T_PLUS token to indicate that the token is not being - used as an operator. - */ - - // Trying to operate on a negative value; eg. ($var * -1). - $this->nonOperandTokens = Tokens::$operators; - - // Trying to compare a negative value; eg. ($var === -1). - $this->nonOperandTokens += Tokens::$comparisonTokens; - - // Trying to compare a negative value; eg. ($var || -1 === $b). - $this->nonOperandTokens += Tokens::$booleanOperators; - - // Trying to assign a negative value; eg. ($var = -1). - $this->nonOperandTokens += Tokens::$assignmentTokens; - - // Returning/printing a negative value; eg. (return -1). - $this->nonOperandTokens += [ - T_RETURN => T_RETURN, - T_ECHO => T_ECHO, - T_EXIT => T_EXIT, - T_PRINT => T_PRINT, - T_YIELD => T_YIELD, - T_FN_ARROW => T_FN_ARROW, - T_MATCH_ARROW => T_MATCH_ARROW, - ]; - - // Trying to use a negative value; eg. myFunction($var, -2). - $this->nonOperandTokens += [ - T_CASE => T_CASE, - T_COLON => T_COLON, - T_COMMA => T_COMMA, - T_INLINE_ELSE => T_INLINE_ELSE, - T_INLINE_THEN => T_INLINE_THEN, - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, - T_OPEN_SHORT_ARRAY => T_OPEN_SHORT_ARRAY, - T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, - T_STRING_CONCAT => T_STRING_CONCAT, - ]; - - // Casting a negative value; eg. (array) -$a. - $this->nonOperandTokens += Tokens::$castTokens; - - /* - These are the tokens the sniff is looking for. - */ - - $targets = Tokens::$comparisonTokens; - $targets += Tokens::$operators; - $targets += Tokens::$assignmentTokens; - $targets[] = T_INLINE_THEN; - $targets[] = T_INLINE_ELSE; - $targets[] = T_INSTANCEOF; - - // Also register the contexts we want to specifically skip over. - $targets[] = T_DECLARE; - - return $targets; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @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. Return `$phpcsFile->numTokens` to skip - * the rest of the file. - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Skip over declare statements as those should be handled by different sniffs. - if ($tokens[$stackPtr]['code'] === T_DECLARE) { - if (isset($tokens[$stackPtr]['parenthesis_closer']) === false) { - // Parse error / live coding. - return $phpcsFile->numTokens; - } - - return $tokens[$stackPtr]['parenthesis_closer']; - } - - if ($this->isOperator($phpcsFile, $stackPtr) === false) { - return; - } - - if ($tokens[$stackPtr]['code'] === T_BITWISE_AND) { - // Check there is one space before the & operator. - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space before "&" operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeAmp'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Space before operator', 0); - } else { - if ($tokens[($stackPtr - 2)]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr - 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Space before operator', $found); - if ($found !== 1 - && ($found !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Expected 1 space before "&" operator; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeAmp', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - } - } - }//end if - - $hasNext = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($hasNext === false) { - // Live coding/parse error at end of file. - return; - } - - // Check there is one space after the & operator. - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space after "&" operator; 0 found'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterAmp'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Space after operator', 0); - } else { - if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr + 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Space after operator', $found); - if ($found !== 1 - && ($found !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Expected 1 space after "&" operator; %s found'; - $data = [$found]; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterAmp', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - }//end if - - return; - }//end if - - $operator = $tokens[$stackPtr]['content']; - - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE - && (($tokens[($stackPtr - 1)]['code'] === T_INLINE_THEN - && $tokens[($stackPtr)]['code'] === T_INLINE_ELSE) === false) - ) { - $error = "Expected 1 space before \"$operator\"; 0 found"; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore'); - if ($fix === true) { - $phpcsFile->fixer->addContentBefore($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Space before operator', 0); - } else if (isset(Tokens::$assignmentTokens[$tokens[$stackPtr]['code']]) === false - || $this->ignoreSpacingBeforeAssignments === false - ) { - // Throw an error for assignments only if enabled using the sniff property - // because other standards allow multiple spaces to align assignments. - $prevNonWhitespace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prevNonWhitespace]['line'] !== $tokens[$stackPtr]['line']) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr - 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Space before operator', $found); - if ($found !== 1 - && ($found !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Expected 1 space before "%s"; %s found'; - $data = [ - $operator, - $found, - ]; - - if (isset(Tokens::$commentTokens[$tokens[$prevNonWhitespace]['code']]) === true) { - // Throw a non-fixable error if the token on the previous line is a comment token, - // as in that case it's not for the sniff to decide where the comment should be moved to - // and it would get us into unfixable situations as the new line char is included - // in the contents of the comment token. - $phpcsFile->addError($error, $stackPtr, 'SpacingBefore', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if ($found === 'newline') { - $i = ($stackPtr - 2); - while ($tokens[$i]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken($i, ''); - $i--; - } - } - - $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' '); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - }//end if - - $hasNext = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($hasNext === false) { - // Live coding/parse error at end of file. - return; - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - // Skip short ternary such as: "$foo = $bar ?: true;". - if (($tokens[$stackPtr]['code'] === T_INLINE_THEN - && $tokens[($stackPtr + 1)]['code'] === T_INLINE_ELSE) - ) { - return; - } - - $error = "Expected 1 space after \"$operator\"; 0 found"; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter'); - if ($fix === true) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } - - $phpcsFile->recordMetric($stackPtr, 'Space after operator', 0); - } else { - if (isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line'] - ) { - $found = 'newline'; - } else { - $found = $tokens[($stackPtr + 1)]['length']; - } - - $phpcsFile->recordMetric($stackPtr, 'Space after operator', $found); - if ($found !== 1 - && ($found !== 'newline' || $this->ignoreNewlines === false) - ) { - $error = 'Expected 1 space after "%s"; %s found'; - $data = [ - $operator, - $found, - ]; - - $nextNonWhitespace = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - if ($nextNonWhitespace !== false - && isset(Tokens::$commentTokens[$tokens[$nextNonWhitespace]['code']]) === true - && $found === 'newline' - ) { - // Don't auto-fix when it's a comment or PHPCS annotation on a new line as - // it causes fixer conflicts and can cause the meaning of annotations to change. - $phpcsFile->addError($error, $stackPtr, 'SpacingAfter', $data); - } else { - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfter', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - } - } - }//end if - }//end if - - }//end process() - - - /** - * Checks if an operator is actually a different type of token in the current context. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The current file being checked. - * @param int $stackPtr The position of the operator in - * the stack. - * - * @return boolean - */ - protected function isOperator(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[$stackPtr]['code'] === T_DECLARE) { - return false; - } - - // Skip default values in function declarations. - // Skip declare statements. - if ($tokens[$stackPtr]['code'] === T_EQUAL) { - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']); - $bracket = array_pop($parenthesis); - if (isset($tokens[$bracket]['parenthesis_owner']) === true) { - $function = $tokens[$bracket]['parenthesis_owner']; - if ($tokens[$function]['code'] === T_FUNCTION - || $tokens[$function]['code'] === T_CLOSURE - || $tokens[$function]['code'] === T_FN - ) { - return false; - } - } - } - } - - if ($tokens[$stackPtr]['code'] === T_EQUAL) { - // Skip for '=&' case. - if (isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)]['code'] === T_BITWISE_AND - ) { - return false; - } - } - - if ($tokens[$stackPtr]['code'] === T_BITWISE_AND) { - // If it's not a reference, then we expect one space either side of the - // bitwise operator. - if ($phpcsFile->isReference($stackPtr) === true) { - return false; - } - } - - if ($tokens[$stackPtr]['code'] === T_MINUS || $tokens[$stackPtr]['code'] === T_PLUS) { - // Check minus spacing, but make sure we aren't just assigning - // a minus value or returning one. - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if (isset($this->nonOperandTokens[$tokens[$prev]['code']]) === true) { - return false; - } - }//end if - - return true; - - }//end isOperator() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php deleted file mode 100644 index ec8218fe..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class PropertyLabelSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = ['JS']; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_PROPERTY, - T_LABEL, - ]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $colon = $phpcsFile->findNext(T_COLON, ($stackPtr + 1)); - - if ($colon !== ($stackPtr + 1)) { - $error = 'There must be no space before the colon in a property/label declaration'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - } - - if ($tokens[($colon + 1)]['code'] !== T_WHITESPACE || $tokens[($colon + 1)]['content'] !== ' ') { - $error = 'There must be a single space after the colon in a property/label declaration'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'After'); - if ($fix === true) { - if ($tokens[($colon + 1)]['code'] === T_WHITESPACE) { - $phpcsFile->fixer->replaceToken(($colon + 1), ' '); - } else { - $phpcsFile->fixer->addContent($colon, ' '); - } - } - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php deleted file mode 100644 index 852759e5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ScopeClosingBraceSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$scopeOpeners; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile All the tokens found in the document. - * @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(); - - // If this is an inline condition (ie. there is no scope opener), then - // return, as this is not a new scope. - if (isset($tokens[$stackPtr]['scope_closer']) === false) { - return; - } - - // We need to actually find the first piece of content on this line, - // as if this is a method with tokens before it (public, static etc) - // or an if with an else before it, then we need to start the scope - // checking from there, rather than the current token. - $lineStart = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], $stackPtr, true); - while ($tokens[$lineStart]['code'] === T_CONSTANT_ENCAPSED_STRING - && $tokens[($lineStart - 1)]['code'] === T_CONSTANT_ENCAPSED_STRING - ) { - $lineStart = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], ($lineStart - 1), true); - } - - $startColumn = $tokens[$lineStart]['column']; - $scopeStart = $tokens[$stackPtr]['scope_opener']; - $scopeEnd = $tokens[$stackPtr]['scope_closer']; - - // Check that the closing brace is on it's own line. - $lastContent = $phpcsFile->findPrevious([T_INLINE_HTML, T_WHITESPACE, T_OPEN_TAG], ($scopeEnd - 1), $scopeStart, true); - for ($lineStart = $scopeEnd; $tokens[$lineStart]['column'] > 1; $lineStart--); - - if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line'] - || ($tokens[$lineStart]['code'] === T_INLINE_HTML - && trim($tokens[$lineStart]['content']) !== '') - ) { - $error = 'Closing brace must be on a line by itself'; - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'ContentBefore'); - if ($fix === true) { - if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line']) { - $phpcsFile->fixer->addNewlineBefore($scopeEnd); - } else { - $phpcsFile->fixer->addNewlineBefore(($lineStart + 1)); - } - } - - return; - } - - // Check now that the closing brace is lined up correctly. - $lineStart = $phpcsFile->findFirstOnLine([T_WHITESPACE, T_INLINE_HTML], $scopeEnd, true); - $braceIndent = $tokens[$lineStart]['column']; - if ($tokens[$stackPtr]['code'] !== T_DEFAULT - && $tokens[$stackPtr]['code'] !== T_CASE - && $braceIndent !== $startColumn - ) { - $error = 'Closing brace indented incorrectly; expected %s spaces, found %s'; - $data = [ - ($startColumn - 1), - ($braceIndent - 1), - ]; - - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data); - if ($fix === true) { - $diff = ($startColumn - $braceIndent); - if ($diff > 0) { - $phpcsFile->fixer->addContentBefore($lineStart, str_repeat(' ', $diff)); - } else { - $phpcsFile->fixer->substrToken(($lineStart - 1), 0, $diff); - } - } - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php deleted file mode 100644 index 65cc13f9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php +++ /dev/null @@ -1,172 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ScopeKeywordSpacingSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $register = Tokens::$scopeModifiers; - $register[] = T_STATIC; - $register[] = T_READONLY; - return $register; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - if (isset($tokens[($stackPtr + 1)]) === false) { - return; - } - - $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - - if ($tokens[$stackPtr]['code'] === T_STATIC) { - if (($nextToken === false || $tokens[$nextToken]['code'] === T_DOUBLE_COLON) - || $tokens[$prevToken]['code'] === T_NEW - ) { - // Late static binding, e.g., static:: OR new static() usage or live coding. - return; - } - - if ($prevToken !== false - && $tokens[$prevToken]['code'] === T_TYPE_UNION - ) { - // Not a scope keyword, but a union return type. - return; - } - - if ($prevToken !== false - && $tokens[$prevToken]['code'] === T_NULLABLE - ) { - // Not a scope keyword, but a return type. - return; - } - - if ($prevToken !== false - && $tokens[$prevToken]['code'] === T_COLON - ) { - $prevPrevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), null, true); - if ($prevPrevToken !== false - && $tokens[$prevPrevToken]['code'] === T_CLOSE_PARENTHESIS - ) { - // Not a scope keyword, but a return type. - return; - } - } - }//end if - - if ($tokens[$prevToken]['code'] === T_AS) { - // Trait visibility change, e.g., "use HelloWorld { sayHello as private; }". - return; - } - - $isInFunctionDeclaration = false; - if (empty($tokens[$stackPtr]['nested_parenthesis']) === false) { - // Check if this is PHP 8.0 constructor property promotion. - // In that case, we can't have multi-property definitions. - $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; - $lastCloseParens = end($nestedParens); - if (isset($tokens[$lastCloseParens]['parenthesis_owner']) === true - && $tokens[$tokens[$lastCloseParens]['parenthesis_owner']]['code'] === T_FUNCTION - ) { - $isInFunctionDeclaration = true; - } - } - - if ($nextToken !== false - && $tokens[$nextToken]['code'] === T_VARIABLE - && $isInFunctionDeclaration === false - ) { - $endOfStatement = $phpcsFile->findNext(T_SEMICOLON, ($nextToken + 1)); - if ($endOfStatement === false) { - // Live coding. - return; - } - - $multiProperty = $phpcsFile->findNext(T_VARIABLE, ($nextToken + 1), $endOfStatement); - if ($multiProperty !== false - && $tokens[$stackPtr]['line'] !== $tokens[$nextToken]['line'] - && $tokens[$nextToken]['line'] !== $tokens[$endOfStatement]['line'] - ) { - // Allow for multiple properties definitions to each be on their own line. - return; - } - } - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - $spacing = 0; - } else if (isset($tokens[($stackPtr + 2)]) === false) { - // Parse error/live coding. Bow out. - return; - } else { - if ($tokens[($stackPtr + 2)]['line'] !== $tokens[$stackPtr]['line']) { - $spacing = 'newline'; - } else { - $spacing = $tokens[($stackPtr + 1)]['length']; - } - } - - if ($spacing !== 1) { - $error = 'Scope keyword "%s" must be followed by a single space; found %s'; - $data = [ - $tokens[$stackPtr]['content'], - $spacing, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); - if ($fix === true) { - if ($spacing === 0) { - $phpcsFile->fixer->addContent($stackPtr, ' '); - } else { - $phpcsFile->fixer->beginChangeset(); - - for ($i = ($stackPtr + 2); $i < $phpcsFile->numTokens; $i++) { - if (isset($tokens[$i]) === false || $tokens[$i]['code'] !== T_WHITESPACE) { - break; - } - - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); - $phpcsFile->fixer->endChangeset(); - } - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php deleted file mode 100644 index dbf719d2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class SemicolonSpacingSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_SEMICOLON]; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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(); - - $prevType = $tokens[($stackPtr - 1)]['code']; - if (isset(Tokens::$emptyTokens[$prevType]) === false) { - return; - } - - $nonSpace = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 2), null, true); - - // Detect whether this is a semicolon for a condition in a `for()` control structure. - $forCondition = false; - if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) { - $nestedParens = $tokens[$stackPtr]['nested_parenthesis']; - $closeParenthesis = end($nestedParens); - - if (isset($tokens[$closeParenthesis]['parenthesis_owner']) === true) { - $owner = $tokens[$closeParenthesis]['parenthesis_owner']; - - if ($tokens[$owner]['code'] === T_FOR) { - $forCondition = true; - $nonSpace = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 2), null, true); - } - } - } - - if ($tokens[$nonSpace]['code'] === T_SEMICOLON - || ($forCondition === true && $nonSpace === $tokens[$owner]['parenthesis_opener']) - || (isset($tokens[$nonSpace]['scope_opener']) === true - && $tokens[$nonSpace]['scope_opener'] === $nonSpace) - ) { - // Empty statement. - return; - } - - $expected = $tokens[$nonSpace]['content'].';'; - $found = $phpcsFile->getTokensAsString($nonSpace, ($stackPtr - $nonSpace)).';'; - $found = str_replace("\n", '\n', $found); - $found = str_replace("\r", '\r', $found); - $found = str_replace("\t", '\t', $found); - $error = 'Space found before semicolon; expected "%s" but found "%s"'; - $data = [ - $expected, - $found, - ]; - - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $i = ($stackPtr - 1); - while (($tokens[$i]['code'] === T_WHITESPACE) && ($i > $nonSpace)) { - $phpcsFile->fixer->replaceToken($i, ''); - $i--; - } - - $phpcsFile->fixer->addContent($nonSpace, ';'); - $phpcsFile->fixer->replaceToken($stackPtr, ''); - - $phpcsFile->fixer->endChangeset(); - } - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php deleted file mode 100644 index f13baba9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php +++ /dev/null @@ -1,265 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; - -class SuperfluousWhitespaceSniff implements Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - 'CSS', - ]; - - /** - * If TRUE, whitespace rules are not checked for blank lines. - * - * Blank lines are those that contain only whitespace. - * - * @var boolean - */ - public $ignoreBlankLines = false; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [ - T_OPEN_TAG, - T_OPEN_TAG_WITH_ECHO, - T_CLOSE_TAG, - T_WHITESPACE, - T_COMMENT, - T_DOC_COMMENT_WHITESPACE, - T_CLOSURE, - ]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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(); - - if ($tokens[$stackPtr]['code'] === T_OPEN_TAG) { - /* - Check for start of file whitespace. - */ - - if ($phpcsFile->tokenizerType !== 'PHP') { - // The first token is always the open tag inserted when tokenized - // and the second token is always the first piece of content in - // the file. If the second token is whitespace, there was - // whitespace at the start of the file. - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - return; - } - - if ($phpcsFile->fixer->enabled === true) { - $stackPtr = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true); - } - } else { - // If it's the first token, then there is no space. - if ($stackPtr === 0) { - return; - } - - $beforeOpen = ''; - - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - // If we find something that isn't inline html then there is something previous in the file. - if ($tokens[$i]['type'] !== 'T_INLINE_HTML') { - return; - } - - $beforeOpen .= $tokens[$i]['content']; - } - - // If we have ended up with inline html make sure it isn't just whitespace. - if (preg_match('`^[\pZ\s]+$`u', $beforeOpen) !== 1) { - return; - } - }//end if - - $fix = $phpcsFile->addFixableError('Additional whitespace found at start of file', $stackPtr, 'StartFile'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - for ($i = 0; $i < $stackPtr; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else if ($tokens[$stackPtr]['code'] === T_CLOSE_TAG) { - /* - Check for end of file whitespace. - */ - - if ($phpcsFile->tokenizerType === 'PHP') { - if (isset($tokens[($stackPtr + 1)]) === false) { - // The close PHP token is the last in the file. - return; - } - - $afterClose = ''; - - for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { - // If we find something that isn't inline HTML then there - // is more to the file. - if ($tokens[$i]['type'] !== 'T_INLINE_HTML') { - return; - } - - $afterClose .= $tokens[$i]['content']; - } - - // If we have ended up with inline html make sure it isn't just whitespace. - if (preg_match('`^[\pZ\s]+$`u', $afterClose) !== 1) { - return; - } - } else { - // The last token is always the close tag inserted when tokenized - // and the second last token is always the last piece of content in - // the file. If the second last token is whitespace, there was - // whitespace at the end of the file. - $stackPtr--; - - // The pointer is now looking at the last content in the file and - // not the fake PHP end tag the tokenizer inserted. - if ($tokens[$stackPtr]['code'] !== T_WHITESPACE) { - return; - } - - // Allow a single newline at the end of the last line in the file. - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE - && $tokens[$stackPtr]['content'] === $phpcsFile->eolChar - ) { - return; - } - }//end if - - $fix = $phpcsFile->addFixableError('Additional whitespace found at end of file', $stackPtr, 'EndFile'); - if ($fix === true) { - if ($phpcsFile->tokenizerType !== 'PHP') { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - $stackPtr = ($prev + 1); - } - - $phpcsFile->fixer->beginChangeset(); - for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { - $phpcsFile->fixer->replaceToken($i, ''); - } - - $phpcsFile->fixer->endChangeset(); - } - } else { - /* - Check for end of line whitespace. - */ - - // Ignore whitespace that is not at the end of a line. - if (isset($tokens[($stackPtr + 1)]['line']) === true - && $tokens[($stackPtr + 1)]['line'] === $tokens[$stackPtr]['line'] - ) { - return; - } - - // Ignore blank lines if required. - if ($this->ignoreBlankLines === true - && $tokens[$stackPtr]['code'] === T_WHITESPACE - && $tokens[($stackPtr - 1)]['line'] !== $tokens[$stackPtr]['line'] - ) { - return; - } - - $tokenContent = rtrim($tokens[$stackPtr]['content'], $phpcsFile->eolChar); - if (empty($tokenContent) === false) { - if ($tokenContent !== rtrim($tokenContent)) { - $fix = $phpcsFile->addFixableError('Whitespace found at end of line', $stackPtr, 'EndLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, rtrim($tokenContent).$phpcsFile->eolChar); - } - } - } else if ($tokens[($stackPtr - 1)]['content'] !== rtrim($tokens[($stackPtr - 1)]['content']) - && $tokens[($stackPtr - 1)]['line'] === $tokens[$stackPtr]['line'] - ) { - $fix = $phpcsFile->addFixableError('Whitespace found at end of line', ($stackPtr - 1), 'EndLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr - 1), rtrim($tokens[($stackPtr - 1)]['content'])); - } - } - - /* - Check for multiple blank lines in a function. - */ - - if (($phpcsFile->hasCondition($stackPtr, [T_FUNCTION, T_CLOSURE]) === true) - && $tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] - && $tokens[($stackPtr - 2)]['line'] === $tokens[($stackPtr - 1)]['line'] - ) { - // Properties and functions in nested classes have their own rules for spacing. - $conditions = $tokens[$stackPtr]['conditions']; - $deepestScope = end($conditions); - if ($deepestScope === T_ANON_CLASS) { - return; - } - - // This is an empty line and the line before this one is not - // empty, so this could be the start of a multiple empty - // line block. - $next = $phpcsFile->findNext(T_WHITESPACE, $stackPtr, null, true); - $lines = ($tokens[$next]['line'] - $tokens[$stackPtr]['line']); - if ($lines > 1) { - $error = 'Functions must not contain multiple empty lines in a row; found %s empty lines'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'EmptyLines', [$lines]); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $i = $stackPtr; - while ($tokens[$i]['line'] !== $tokens[$next]['line']) { - $phpcsFile->fixer->replaceToken($i, ''); - $i++; - } - - $phpcsFile->fixer->addNewlineBefore($i); - $phpcsFile->fixer->endChangeset(); - } - } - }//end if - }//end if - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc deleted file mode 100644 index 8ffc868a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc +++ /dev/null @@ -1,31 +0,0 @@ - 'bar', - 'bar' => 'foo', -]; - -if ($foo) {} -[$a, $b] = $c; - -echo foo()[ 1 ]; - -echo $this->addedCustomFunctions['nonce']; -echo $this->deprecated_functions[ $function_name ]['version']; - -echo [ 1,2,3 ][0]; -echo [ 1,2,3 ][ 0 ]; -echo 'PHP'[ 0 ]; - -$array = []; -$var = $var[$var[$var]]]; // Syntax error -$var = $var[$var[$var]; // Syntax error - -$myArray[ /* key start */'key'] = $value; -$myArray[ /* key start */'key'/* key end */ ] = $value; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed deleted file mode 100644 index 41d66409..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,31 +0,0 @@ - 'bar', - 'bar' => 'foo', -]; - -if ($foo) {} -[$a, $b] = $c; - -echo foo()[1]; - -echo $this->addedCustomFunctions['nonce']; -echo $this->deprecated_functions[$function_name]['version']; - -echo [ 1,2,3 ][0]; -echo [ 1,2,3 ][0]; -echo 'PHP'[0]; - -$array = []; -$var = $var[$var[$var]]]; // Syntax error -$var = $var[$var[$var]; // Syntax error - -$myArray[/* key start */'key'] = $value; -$myArray[/* key start */'key'/* key end */] = $value; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php deleted file mode 100644 index 0e687b80..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayBracketSpacingUnitTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Arrays; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ArrayBracketSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayBracketSpacingSniff - */ -final class ArrayBracketSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 3, - 7 => 3, - 17 => 2, - 20 => 2, - 23 => 2, - 24 => 2, - 30 => 1, - 31 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc deleted file mode 100644 index cdbfff6c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc +++ /dev/null @@ -1,549 +0,0 @@ - 1, - ); -} - -class TestClass -{ - public $good = array( - 'width' => '', - 'height' => '', - ); - - private $_bad = Array( - 'width' => '', - 'height' => '' - ); - - - public function test() - { - $truck = array( - 'width' => '', - 'height' => '', - ); - - $plane = Array( - 'width' => '', - 'height' => '', - ); - - $car = array( - 'width' => '', - 'height' => '', - ); - - $bus = array( - 'width' => '', - 'height' => '' - ); - - $train = array ( - TRUE, - FALSE, - 'aaa' - ); - - $inline = array('aaa', 'bbb', 'ccc'); - $inline = array('aaa'); - $inline = Array('aaa'); - - $bigone = array( - 'name' => 'bigone', - 'children' => Array( - '1a' => 'child', - '11b' => 'child', - '111c' => 'child', - 'children' => Array( - 'child' => 'aaa', - ), - ), - 'short_name' => 'big' - ); - } - -}//end class - -$value = array ( ); -$value = array( ); -$value = array('1'=>$one, '2' => $two, '3'=> $three, '4' =>$four); -$value = array('1'=>$one); - -if (in_array('1', array('1','2','3')) === TRUE) { - $value = in_array('1', array('1' , '2', '3','4')); -} - -$value = array( - '1'=> TRUE, - FALSE, - '3' => 'aaa',); - -$value = array( - '1'=> TRUE, - FALSE, - ); - -$value = array( - TRUE, - '1' => FALSE, - ); - -$value = array(1, - 2 , - 3 , - ); - -$value = array(1 => $one, - 2 => $two , - 3 => $three , - ); - -$value = array( - 'tag' => $tag, - 'space' => $this->_getIndentation($tag, $tagElement), - ); - -$expected = array( - array( - '1' => 1, - '1' => 2, - ), - ); - -$expected = array( - array( - '1' => 1, - '1' => 2 - ) - ); - -// Space in second arg. -$args = array( - '"'.$this->id.'"', - (int) $hasSessions, - ); - -// No errors. -$paths = array( - Init::ROOT_DIR.'/Systems' => 'Systems', - Init::ROOT_DIR.'/Installer' => 'Systems', - ); - -$x = array( - ); - -$x = array('test' - ); -$x = array('test', - ); -$x = array('name' => 'test', - ); - -$x = array( - $x, - ); - -$func = array( - $x, - 'get'.$x.'Replacement' - ); - -$array = array( - 'input_one' => 'one', - 'inputTwo' => 'two', - 'input_3' => 3, - ); - -$array = array( - 'input_one', - 'inputTwo', - 'input_3', - ); - -// Malformed -$foo = array(1 -, 2); - -$listItems[$aliasPath] = array('itemContent' => implode('
    ', $aliases)); - -$listItems[$aliasPath] = array( - 'itemContent' => implode('
    ', $aliases) - ); - -$x = array - ( - $x, - $y, - ); - -$x = array -( - $x, - $y, - ); - -$x = array( - - $x, - $y, - ); - -$test = array( - 'test' => TestFunction::blah( - $value1, - $value2 - ), - ); - -$c = array('a' => 1,); - -function b() -{ - $a = array( - 'a' => a('a'), - - ); - -} - -$foo = Array('[',']',':',"\n","\r"); -$bar = Array('[',']',':',' ',' '); - -function foo() -{ - return array($a, $b->screen); -} - -$array = array( - 'name' => 'contactSubject', - 'required' => TRUE, - 'validators' => array( - new \Zend\Validator\InArray(array('haystack' => array_keys($aSubjects))), - ), - ); - -$var = array( - 'ViewHelper', - array('Foo'), - 'Errors', - ); - -$data = array( - 'first', - 'second', - 'third', - // Add more here - ); - -$data = array( - 'first', - 'second', - //'third', - ); - -$data = array( - 'first', - 'second' - //'third', - ); - -$foo = array( - $this->getViewName() . '.id' => 'value', - $this->getViewName() . '.title' => 'value', - ); - -$foo = array( - $this->getViewName() . '.id', - $this->getViewName() . '.title', - ); - -$weightings = array( - T_CLOSURE => 100, - - /* - Conditions. - */ - - T_WHILE => 50, - - /* - Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - - T_BOOLEAN_AND => 5, - - /* - Equality. - */ - - T_IS_GREATER_OR_EQUAL => 5, - ); - -foreach (array( - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ) as $key => $value) { -} - -$ids = array( - '1', // Foo. - '13', // Bar. - ); - -array( - 'key1' => function($bar) { - return $bar; - }, - 'key2' => function($foo) { - return $foo; - }, - 'key3' => function($bar) { - return $bar; - } -); - -array( - 'key1' => array( - '1', - '2', - ) -); - -$var = array( - 'tab_template' => ' -
  • %s
  • ', - 'panel_template' => ' -
    - %s -
    ', - ); - -function test() : array -{ - return []; -} - -$fields = array( - 'id' => array('type' => 'INT'), - 'value' => array('type' => 'VARCHAR')); - -get_current_screen()->add_help_tab( array( - 'id' => << false); - -$x = array( - 'xxxx' => array('aaaaaaaaaa' => 'ccccccccccc', - 'bbbbbbbb' => false), -); - -$foo = array - ('foo' => array - ('bar1' => 1 - ,'bar2' => 1 - ,'bar3' => 1 - ,'bar4' => 1 - ,'bar5' => 1 - ) - ); - -$foo = array( - '1' => $row['status'] === 'rejected' - ? self::REJECTED_CODE - : self::VERIFIED_CODE, - '2' => in_array($row['status'], array('notverified', 'unverified'), true) - ? self::STATUS_PENDING - : self::STATUS_VERIFIED, - '3' => strtotime($row['date']), - ); - -$foo = foo( - array( - // comment - ) -); - -$foo = array( - << lorem( - 1 - ), 2 => 2, -); - -$foo = array( - 'тип' => 'авто', - 'цвет' => 'синий', - ); - -$paths = array( - Init::ROOT_DIR.'/тип' => 'авто', - Init::ROOT_DIR.'/цвет' => 'синий', - ); - -$foo = array(<< fn() => return 1, - 'bb' => fn() => return 2, - 'ccc' => ( true ) ? - fn() => return 1 : - fn() => return 2, - ); - -$array = array( - 1 => '1', - 2 => fn ($x) => yield 'a' => $x, - 3 => '3', - ); - -$foo = array( - $this->fn => 'value', - $foo->fn => 'value', - ); - -array($a, $b, -$c); - -array('a' => $a, 'b' => $b, -'c' => $c); - -array( - static function() { - return null; - }, - (array) array(), - (bool) array(), - (double) array(), - (int) array(), - (object) array(), - (string) array(), - (unset) array(), -); - -array( - 'foo', - 'bar' - // This is a non-fixable error. - , -); - -yield array( - static fn () : string => '', -); - -yield array( - static fn () : string => '', - ); - -$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', - ); - -$x = array( - 1, static fn (float $item): float => match ($item) { - 2.0 => 3.0, - default => $item - }, - ); - -$x = array( - 1, static::helloWorld(), $class instanceof static, - 2, - ); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed deleted file mode 100644 index 6f8fe216..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.1.inc.fixed +++ /dev/null @@ -1,588 +0,0 @@ - 1); -} - -class TestClass -{ - public $good = array( - 'width' => '', - 'height' => '', - ); - - private $_bad = array( - 'width' => '', - 'height' => '', - ); - - - public function test() - { - $truck = array( - 'width' => '', - 'height' => '', - ); - - $plane = array( - 'width' => '', - 'height' => '', - ); - - $car = array( - 'width' => '', - 'height' => '', - ); - - $bus = array( - 'width' => '', - 'height' => '', - ); - - $train = array( - TRUE, - FALSE, - 'aaa', - ); - - $inline = array( - 'aaa', - 'bbb', - 'ccc', - ); - $inline = array('aaa'); - $inline = array('aaa'); - - $bigone = array( - 'name' => 'bigone', - 'children' => array( - '1a' => 'child', - '11b' => 'child', - '111c' => 'child', - 'children' => array('child' => 'aaa'), - ), - 'short_name' => 'big', - ); - } - -}//end class - -$value = array(); -$value = array(); -$value = array( - '1' => $one, - '2' => $two, - '3' => $three, - '4' => $four, - ); -$value = array('1' => $one); - -if (in_array('1', array('1', '2', '3')) === TRUE) { - $value = in_array('1', array('1', '2', '3', '4')); -} - -$value = array( - '1'=> TRUE, - FALSE, - '3' => 'aaa', - ); - -$value = array( - '1'=> TRUE, - FALSE, - ); - -$value = array( - TRUE, - '1' => FALSE, - ); - -$value = array( - 1, - 2, - 3, - ); - -$value = array( - 1 => $one, - 2 => $two, - 3 => $three, - ); - -$value = array( - 'tag' => $tag, - 'space' => $this->_getIndentation($tag, $tagElement), - ); - -$expected = array( - array( - '1' => 1, - '1' => 2, - ), - ); - -$expected = array( - array( - '1' => 1, - '1' => 2, - ), - ); - -// Space in second arg. -$args = array( - '"'.$this->id.'"', - (int) $hasSessions, - ); - -// No errors. -$paths = array( - Init::ROOT_DIR.'/Systems' => 'Systems', - Init::ROOT_DIR.'/Installer' => 'Systems', - ); - -$x = array(); - -$x = array('test'); -$x = array('test'); -$x = array('name' => 'test'); - -$x = array($x); - -$func = array( - $x, - 'get'.$x.'Replacement', - ); - -$array = array( - 'input_one' => 'one', - 'inputTwo' => 'two', - 'input_3' => 3, - ); - -$array = array( - 'input_one', - 'inputTwo', - 'input_3', - ); - -// Malformed -$foo = array( - 1, - 2, - ); - -$listItems[$aliasPath] = array('itemContent' => implode('
    ', $aliases)); - -$listItems[$aliasPath] = array( - 'itemContent' => implode('
    ', $aliases), - ); - -$x = array( - $x, - $y, - ); - -$x = array( - $x, - $y, - ); - -$x = array( - - $x, - $y, - ); - -$test = array( - 'test' => TestFunction::blah( - $value1, - $value2 - ), - ); - -$c = array('a' => 1); - -function b() -{ - $a = array( - 'a' => a('a'), - - ); - -} - -$foo = array( - '[', - ']', - ':', - "\n", - "\r", - ); -$bar = array( - '[', - ']', - ':', - ' ', - ' ', - ); - -function foo() -{ - return array( - $a, - $b->screen, - ); -} - -$array = array( - 'name' => 'contactSubject', - 'required' => TRUE, - 'validators' => array( - new \Zend\Validator\InArray(array('haystack' => array_keys($aSubjects))), - ), - ); - -$var = array( - 'ViewHelper', - array('Foo'), - 'Errors', - ); - -$data = array( - 'first', - 'second', - 'third', - // Add more here - ); - -$data = array( - 'first', - 'second', - //'third', - ); - -$data = array( - 'first', - 'second', - //'third', - ); - -$foo = array( - $this->getViewName() . '.id' => 'value', - $this->getViewName() . '.title' => 'value', - ); - -$foo = array( - $this->getViewName() . '.id', - $this->getViewName() . '.title', - ); - -$weightings = array( - T_CLOSURE => 100, - - /* - Conditions. - */ - - T_WHILE => 50, - - /* - Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - - T_BOOLEAN_AND => 5, - - /* - Equality. - */ - - T_IS_GREATER_OR_EQUAL => 5, - ); - -foreach (array( - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ) as $key => $value) { -} - -$ids = array( - '1', // Foo. - '13', // Bar. - ); - -array( - 'key1' => function($bar) { - return $bar; - }, - 'key2' => function($foo) { - return $foo; - }, - 'key3' => function($bar) { - return $bar; - }, -); - -array( - 'key1' => array( - '1', - '2', - ), -); - -$var = array( - 'tab_template' => ' -
  • %s
  • ', - 'panel_template' => ' -
    - %s -
    ', - ); - -function test() : array -{ - return []; -} - -$fields = array( - 'id' => array('type' => 'INT'), - 'value' => array('type' => 'VARCHAR'), - ); - -get_current_screen()->add_help_tab( array( - 'id' => << false); - -$x = array( - 'xxxx' => array( - 'aaaaaaaaaa' => 'ccccccccccc', - 'bbbbbbbb' => false, - ), - ); - -$foo = array( - 'foo' => array( - 'bar1' => 1, - 'bar2' => 1, - 'bar3' => 1, - 'bar4' => 1, - 'bar5' => 1, - ), - ); - -$foo = array( - '1' => $row['status'] === 'rejected' - ? self::REJECTED_CODE - : self::VERIFIED_CODE, - '2' => in_array($row['status'], array('notverified', 'unverified'), true) - ? self::STATUS_PENDING - : self::STATUS_VERIFIED, - '3' => strtotime($row['date']), - ); - -$foo = foo( - array( - // comment - ) -); - -$foo = array( - << lorem( - 1 - ), - 2 => 2, -); - -$foo = array( - 'тип' => 'авто', - 'цвет' => 'синий', - ); - -$paths = array( - Init::ROOT_DIR.'/тип' => 'авто', - Init::ROOT_DIR.'/цвет' => 'синий', - ); - -$foo = array(<< fn() => return 1, - 'bb' => fn() => return 2, - 'ccc' => ( true ) ? - fn() => return 1 : - fn() => return 2, - ); - -$array = array( - 1 => '1', - 2 => fn ($x) => yield 'a' => $x, - 3 => '3', - ); - -$foo = array( - $this->fn => 'value', - $foo->fn => 'value', - ); - -array( - $a, - $b, - $c, -); - -array( - 'a' => $a, - 'b' => $b, - 'c' => $c, -); - -array( - static function() { - return null; - }, - (array) array(), - (bool) array(), - (double) array(), - (int) array(), - (object) array(), - (string) array(), - (unset) array(), -); - -array( - 'foo', - 'bar' - // This is a non-fixable error. - , -); - -yield array( - static fn () : string => '', - ); - -yield array( - static fn () : string => '', - ); - -$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', - ); - -$x = array( - 1, - static fn (float $item): float => match ($item) { - 2.0 => 3.0, - default => $item - }, - ); - -$x = array( - 1, - static::helloWorld(), - $class instanceof static, - 2, - ); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc deleted file mode 100644 index 90b026f0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc +++ /dev/null @@ -1,538 +0,0 @@ - 1, - ]; -} - -class TestClass -{ - public $good = [ - 'width' => '', - 'height' => '', - ]; - - private $_bad = [ - 'width' => '', - 'height' => '' - ]; - - - public function test() - { - $truck = [ - 'width' => '', - 'height' => '', - ]; - - $plane = [ - 'width' => '', - 'height' => '', - ]; - - $car = [ - 'width' => '', - 'height' => '', - ]; - - $bus = [ - 'width' => '', - 'height' => '' - ]; - - $train = [ - TRUE, - FALSE, - 'aaa' - ]; - - $inline = ['aaa', 'bbb', 'ccc']; - $inline = ['aaa']; - $inline = ['aaa']; - - $bigone = [ - 'name' => 'bigone', - 'children' => [ - '1a' => 'child', - '11b' => 'child', - '111c' => 'child', - 'children' => [ - 'child' => 'aaa', - ], - ], - 'short_name' => 'big' - ]; - } - -}//end class - -$value = [ ]; -$value = [ ]; -$value = ['1'=>$one, '2' => $two, '3'=> $three, '4' =>$four]; -$value = ['1'=>$one]; - -if (in_array('1', ['1','2','3']) === TRUE) { - $value = in_array('1', ['1' , '2', '3','4']); -} - -$value = [ - '1'=> TRUE, - FALSE, - '3' => 'aaa',]; - -$value = [ - '1'=> TRUE, - FALSE, - ]; - -$value = [ - TRUE, - '1' => FALSE, - ]; - -$value = [1, - 2 , - 3 , - ]; - -$value = [1 => $one, - 2 => $two , - 3 => $three , - ]; - -$value = [ - 'tag' => $tag, - 'space' => $this->_getIndentation($tag, $tagElement), - ]; - -$expected = [ - [ - '1' => 1, - '1' => 2, - ], - ]; - -$expected = [ - [ - '1' => 1, - '1' => 2 - ] - ]; - -// Space in second arg. -$args = [ - '"'.$this->id.'"', - (int) $hasSessions, - ]; - -// No errors. -$paths = [ - Init::ROOT_DIR.'/Systems' => 'Systems', - Init::ROOT_DIR.'/Installer' => 'Systems', - ]; - -$x = [ - ]; - -$x = ['test' - ]; -$x = ['test', - ]; -$x = ['name' => 'test', - ]; - -$x = [ - $x, - ]; - -$func = [ - $x, - 'get'.$x.'Replacement' - ]; - -$array = [ - 'input_one' => 'one', - 'inputTwo' => 'two', - 'input_3' => 3, - ]; - -$array = [ - 'input_one', - 'inputTwo', - 'input_3', - ]; - -// Malformed -$foo = [1 -, 2]; - -$listItems[$aliasPath] = ['itemContent' => implode('
    ', $aliases)]; - -$listItems[$aliasPath] = [ - 'itemContent' => implode('
    ', $aliases) - ]; - -$x = - [ - $x, - $y, - ]; - -$x = -[ - $x, - $y, - ]; - -$x = [ - - $x, - $y, - ]; - -$test = [ - 'test' => TestFunction::blah( - $value1, - $value2 - ), - ]; - -$c = ['a' => 1,]; -$c->{$var}[ ] = 2; - -$foo = ['[',']',':',"\n","\r"]; -$bar = ['[',']',':',' ',' ']; - -function foo() -{ - return [$a, $b->screen]; -} - -$array = [ - 'name' => 'contactSubject', - 'required' => TRUE, - 'validators' => [ - new \Zend\Validator\InArray(['haystack' => array_keys($aSubjects)]), - ], - ]; - -$var = [ - 'ViewHelper', - ['Foo'], - 'Errors', - ]; - -$data = [ - 'first', - 'second', - 'third', - // Add more here - ]; - -$data = [ - 'first', - 'second', - //'third', - ]; - -$data = [ - 'first', - 'second' - //'third', - ]; - -$foo = [ - $this->getViewName() . '.id' => 'value', - $this->getViewName() . '.title' => 'value', - ]; - -$foo = [ - $this->getViewName() . '.id', - $this->getViewName() . '.title', - ]; - -$weightings = [ - T_CLOSURE => 100, - - /* - Conditions. - */ - - T_WHILE => 50, - - /* - Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - - T_BOOLEAN_AND => 5, - - /* - Equality. - */ - - T_IS_GREATER_OR_EQUAL => 5, - ]; - -foreach ([ - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ] as $key => $value) { -} - -$ids = [ - '1', // Foo. - '13', // Bar. - ]; - -[ - 'key1' => function($bar) { - return $bar; - }, - 'key2' => function($foo) { - return $foo; - }, - 'key3' => function($bar) { - return $bar; - } -]; - -[ - 'key1' => [ - '1', - '2', - ] -]; - -$var = [ - 'tab_template' => ' -
  • %s
  • ', - 'panel_template' => ' -
    - %s -
    ', - ]; - -function test() : array -{ - return []; -} - -$fields = [ - 'id' => ['type' => 'INT'], - 'value' => ['type' => 'VARCHAR']]; - -get_current_screen()->add_help_tab( [ - 'id' => << false]; - -$x = [ - 'xxxx' => ['aaaaaaaaaa' => 'ccccccccccc', - 'bbbbbbbb' => false], -]; - -$foo = ['foo' => ['bar1' => 1 - ,'bar2' => 1 - ,'bar3' => 1 - ,'bar4' => 1 - ,'bar5' => 1 - ] - ]; - -$foo = [ - '1' => $row['status'] === 'rejected' - ? self::REJECTED_CODE - : self::VERIFIED_CODE, - '2' => in_array($row['status'], ['notverified', 'unverified'], true) - ? self::STATUS_PENDING - : self::STATUS_VERIFIED, - '3' => strtotime($row['date']), - ]; - - -$foo = foo( - [ - // comment - ] -); - -$foo = [ - << lorem( - 1 - ), 2 => 2, -]; - -$foo = [ - 'тип' => 'авто', - 'цвет' => 'синий', - ]; - -$paths = [ - Init::ROOT_DIR.'/тип' => 'авто', - Init::ROOT_DIR.'/цвет' => 'синий', - ]; - -$foo = [<< fn() => return 1, - 'bb' => fn() => return 2, - 'ccc' => ( true ) ? - fn() => return 1 : - fn() => return 2, - ]; - -$array = [ - 1 => '1', - 2 => fn ($x) => yield 'a' => $x, - 3 => '3', - ]; - -$foo = [ - $this->fn => 'value', - $foo->fn => 'value', - ]; - -[$a, $b, -$c]; - -['a' => $a, 'b' => $b, -'c' => $c]; - -[ - static function() { - return null; - }, - (array) [], - (bool) [], - (double) [], - (int) [], - (object) [], - (string) [], - (unset) [], -]; - -[ - 'foo', - 'bar' - // This is a non-fixable error. - , -]; - -yield [ - static fn () : string => '', -]; - -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', - ]; - -$x = [ - 1, static fn (float $item): float => match ($item) { - 2.0 => 3.0, - default => $item - }, - ]; - -$x = [ - 1, static::helloWorld(), $class instanceof static, - 2, - ]; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed deleted file mode 100644 index 533be16a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.2.inc.fixed +++ /dev/null @@ -1,575 +0,0 @@ - 1]; -} - -class TestClass -{ - public $good = [ - 'width' => '', - 'height' => '', - ]; - - private $_bad = [ - 'width' => '', - 'height' => '', - ]; - - - public function test() - { - $truck = [ - 'width' => '', - 'height' => '', - ]; - - $plane = [ - 'width' => '', - 'height' => '', - ]; - - $car = [ - 'width' => '', - 'height' => '', - ]; - - $bus = [ - 'width' => '', - 'height' => '', - ]; - - $train = [ - TRUE, - FALSE, - 'aaa', - ]; - - $inline = [ - 'aaa', - 'bbb', - 'ccc', - ]; - $inline = ['aaa']; - $inline = ['aaa']; - - $bigone = [ - 'name' => 'bigone', - 'children' => [ - '1a' => 'child', - '11b' => 'child', - '111c' => 'child', - 'children' => ['child' => 'aaa'], - ], - 'short_name' => 'big', - ]; - } - -}//end class - -$value = []; -$value = []; -$value = [ - '1' => $one, - '2' => $two, - '3' => $three, - '4' => $four, - ]; -$value = ['1' => $one]; - -if (in_array('1', ['1', '2', '3']) === TRUE) { - $value = in_array('1', ['1', '2', '3', '4']); -} - -$value = [ - '1'=> TRUE, - FALSE, - '3' => 'aaa', - ]; - -$value = [ - '1'=> TRUE, - FALSE, - ]; - -$value = [ - TRUE, - '1' => FALSE, - ]; - -$value = [ - 1, - 2, - 3, - ]; - -$value = [ - 1 => $one, - 2 => $two, - 3 => $three, - ]; - -$value = [ - 'tag' => $tag, - 'space' => $this->_getIndentation($tag, $tagElement), - ]; - -$expected = [ - [ - '1' => 1, - '1' => 2, - ], - ]; - -$expected = [ - [ - '1' => 1, - '1' => 2, - ], - ]; - -// Space in second arg. -$args = [ - '"'.$this->id.'"', - (int) $hasSessions, - ]; - -// No errors. -$paths = [ - Init::ROOT_DIR.'/Systems' => 'Systems', - Init::ROOT_DIR.'/Installer' => 'Systems', - ]; - -$x = []; - -$x = ['test']; -$x = ['test']; -$x = ['name' => 'test']; - -$x = [$x]; - -$func = [ - $x, - 'get'.$x.'Replacement', - ]; - -$array = [ - 'input_one' => 'one', - 'inputTwo' => 'two', - 'input_3' => 3, - ]; - -$array = [ - 'input_one', - 'inputTwo', - 'input_3', - ]; - -// Malformed -$foo = [ - 1, - 2, - ]; - -$listItems[$aliasPath] = ['itemContent' => implode('
    ', $aliases)]; - -$listItems[$aliasPath] = [ - 'itemContent' => implode('
    ', $aliases), - ]; - -$x = - [ - $x, - $y, - ]; - -$x = -[ - $x, - $y, -]; - -$x = [ - - $x, - $y, - ]; - -$test = [ - 'test' => TestFunction::blah( - $value1, - $value2 - ), - ]; - -$c = ['a' => 1]; -$c->{$var}[ ] = 2; - -$foo = [ - '[', - ']', - ':', - "\n", - "\r", - ]; -$bar = [ - '[', - ']', - ':', - ' ', - ' ', - ]; - -function foo() -{ - return [ - $a, - $b->screen, - ]; -} - -$array = [ - 'name' => 'contactSubject', - 'required' => TRUE, - 'validators' => [ - new \Zend\Validator\InArray(['haystack' => array_keys($aSubjects)]), - ], - ]; - -$var = [ - 'ViewHelper', - ['Foo'], - 'Errors', - ]; - -$data = [ - 'first', - 'second', - 'third', - // Add more here - ]; - -$data = [ - 'first', - 'second', - //'third', - ]; - -$data = [ - 'first', - 'second', - //'third', - ]; - -$foo = [ - $this->getViewName() . '.id' => 'value', - $this->getViewName() . '.title' => 'value', - ]; - -$foo = [ - $this->getViewName() . '.id', - $this->getViewName() . '.title', - ]; - -$weightings = [ - T_CLOSURE => 100, - - /* - Conditions. - */ - - T_WHILE => 50, - - /* - Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - - T_BOOLEAN_AND => 5, - - /* - Equality. - */ - - T_IS_GREATER_OR_EQUAL => 5, - ]; - -foreach ([ - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ] as $key => $value) { -} - -$ids = [ - '1', // Foo. - '13', // Bar. - ]; - -[ - 'key1' => function($bar) { - return $bar; - }, - 'key2' => function($foo) { - return $foo; - }, - 'key3' => function($bar) { - return $bar; - }, -]; - -[ - 'key1' => [ - '1', - '2', - ], -]; - -$var = [ - 'tab_template' => ' -
  • %s
  • ', - 'panel_template' => ' -
    - %s -
    ', - ]; - -function test() : array -{ - return []; -} - -$fields = [ - 'id' => ['type' => 'INT'], - 'value' => ['type' => 'VARCHAR'], - ]; - -get_current_screen()->add_help_tab( [ - 'id' => << false]; - -$x = [ - 'xxxx' => [ - 'aaaaaaaaaa' => 'ccccccccccc', - 'bbbbbbbb' => false, - ], - ]; - -$foo = [ - 'foo' => [ - 'bar1' => 1, - 'bar2' => 1, - 'bar3' => 1, - 'bar4' => 1, - 'bar5' => 1, - ], - ]; - -$foo = [ - '1' => $row['status'] === 'rejected' - ? self::REJECTED_CODE - : self::VERIFIED_CODE, - '2' => in_array($row['status'], ['notverified', 'unverified'], true) - ? self::STATUS_PENDING - : self::STATUS_VERIFIED, - '3' => strtotime($row['date']), - ]; - - -$foo = foo( - [ - // comment - ] -); - -$foo = [ - << lorem( - 1 - ), - 2 => 2, -]; - -$foo = [ - 'тип' => 'авто', - 'цвет' => 'синий', - ]; - -$paths = [ - Init::ROOT_DIR.'/тип' => 'авто', - Init::ROOT_DIR.'/цвет' => 'синий', - ]; - -$foo = [<< fn() => return 1, - 'bb' => fn() => return 2, - 'ccc' => ( true ) ? - fn() => return 1 : - fn() => return 2, - ]; - -$array = [ - 1 => '1', - 2 => fn ($x) => yield 'a' => $x, - 3 => '3', - ]; - -$foo = [ - $this->fn => 'value', - $foo->fn => 'value', - ]; - -[ - $a, - $b, - $c, -]; - -[ - 'a' => $a, - 'b' => $b, - 'c' => $c, -]; - -[ - static function() { - return null; - }, - (array) [], - (bool) [], - (double) [], - (int) [], - (object) [], - (string) [], - (unset) [], -]; - -[ - 'foo', - 'bar' - // This is a non-fixable error. - , -]; - -yield [ - static fn () : string => '', - ]; - -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', - ]; - -$x = [ - 1, - static fn (float $item): float => match ($item) { - 2.0 => 3.0, - default => $item - }, - ]; - -$x = [ - 1, - static::helloWorld(), - $class instanceof static, - 2, - ]; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php deleted file mode 100644 index b34044b2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.php +++ /dev/null @@ -1,255 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Arrays; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ArrayDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayDeclarationSniff - */ -final class ArrayDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ArrayDeclarationUnitTest.1.inc': - return [ - 2 => 1, - 8 => 2, - 10 => 2, - 22 => 1, - 23 => 2, - 24 => 2, - 25 => 1, - 31 => 2, - 35 => 1, - 36 => 2, - 41 => 1, - 46 => 1, - 47 => 1, - 50 => 1, - 51 => 1, - 53 => 1, - 56 => 1, - 58 => 1, - 61 => 1, - 62 => 1, - 63 => 1, - 64 => 1, - 65 => 1, - 66 => 3, - 70 => 1, - 76 => 2, - 77 => 1, - 78 => 7, - 79 => 2, - 81 => 2, - 82 => 4, - 87 => 1, - 88 => 1, - 92 => 1, - 97 => 1, - 100 => 1, - 101 => 1, - 102 => 1, - 105 => 1, - 106 => 1, - 107 => 1, - 125 => 1, - 126 => 1, - 141 => 1, - 144 => 1, - 146 => 1, - 148 => 1, - 151 => 1, - 157 => 1, - 173 => 1, - 174 => 3, - 179 => 1, - 182 => 1, - 188 => 1, - 207 => 1, - 212 => 2, - 214 => 1, - 218 => 2, - 219 => 2, - 223 => 1, - 255 => 1, - 294 => 1, - 295 => 1, - 296 => 1, - 311 => 1, - 317 => 1, - 339 => 2, - 348 => 2, - 352 => 2, - 355 => 3, - 358 => 3, - 359 => 2, - 360 => 1, - 362 => 1, - 363 => 2, - 364 => 1, - 365 => 2, - 366 => 2, - 367 => 2, - 368 => 2, - 369 => 1, - 370 => 1, - 383 => 1, - 394 => 1, - 400 => 1, - 406 => 1, - 441 => 1, - 444 => 2, - 445 => 2, - 447 => 2, - 448 => 3, - 467 => 1, - 471 => 1, - 472 => 1, - 510 => 1, - 516 => 1, - 523 => 1, - 530 => 1, - 537 => 1, - 540 => 1, - 547 => 2, - ]; - case 'ArrayDeclarationUnitTest.2.inc': - return [ - 2 => 1, - 10 => 1, - 23 => 2, - 24 => 2, - 25 => 1, - 31 => 2, - 36 => 2, - 41 => 1, - 46 => 1, - 47 => 1, - 51 => 1, - 53 => 1, - 56 => 1, - 61 => 1, - 63 => 1, - 64 => 1, - 65 => 1, - 66 => 2, - 70 => 1, - 76 => 1, - 77 => 1, - 78 => 7, - 79 => 2, - 81 => 2, - 82 => 4, - 87 => 1, - 88 => 1, - 92 => 1, - 97 => 1, - 100 => 1, - 101 => 1, - 102 => 1, - 105 => 1, - 106 => 1, - 107 => 1, - 125 => 1, - 126 => 1, - 141 => 1, - 144 => 1, - 146 => 1, - 148 => 1, - 151 => 1, - 157 => 1, - 173 => 1, - 174 => 3, - 179 => 1, - 190 => 1, - 191 => 1, - 192 => 1, - 207 => 1, - 210 => 1, - 211 => 1, - 215 => 1, - 247 => 1, - 286 => 1, - 287 => 1, - 288 => 1, - 303 => 1, - 309 => 1, - 331 => 2, - 345 => 3, - 348 => 3, - 349 => 2, - 350 => 1, - 352 => 2, - 353 => 2, - 354 => 2, - 355 => 2, - 356 => 2, - 357 => 1, - 358 => 1, - 372 => 1, - 383 => 1, - 389 => 1, - 395 => 1, - 430 => 1, - 433 => 2, - 434 => 2, - 436 => 2, - 437 => 3, - 456 => 1, - 460 => 1, - 461 => 1, - 499 => 1, - 505 => 1, - 512 => 1, - 519 => 1, - 526 => 1, - 529 => 1, - 536 => 2, - ]; - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css deleted file mode 100644 index 39abce23..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css +++ /dev/null @@ -1,81 +0,0 @@ -.my-style { -} - - -.my-style { -} - -/* Comment */ - -.my-style { -} - - -/* Comment */ - -.my-style { - float: left; - -} - -.AssetLineageWidgetType-item { - color: #CCC; -} - -/*.AssetLineageWidgetType-item2 .selected, -.AssetLineageWidgetType-item .selected { -}*/ - -.AssetLineageWidgetType-item.selected { -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } -} - -.GUITextBox.container:after {} - -@media screen and (max-device-width: 769px) { - .no-blank-line-after { - } - .no-blank-line-after-second-def { - } .my-style { - } - - .no-blank-line-and-trailing-comment { - } /* end long class */ - .too-many-blank-lines-and-trailing-comment-extra-whitespace-after-brace { - } /* end long class */ - - - - .has-blank-line-and-trailing-comment { - } /* end long class */ - - .no-blank-line-and-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - .too-many-blank-lines-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - - - - .has-blank-line-and-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%;}} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed deleted file mode 100644 index ca77e83b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.css.fixed +++ /dev/null @@ -1,85 +0,0 @@ -.my-style { -} - -.my-style { -} - -/* Comment */ - -.my-style { -} - -/* Comment */ - -.my-style { - float: left; - -} - -.AssetLineageWidgetType-item { - color: #CCC; -} - -/*.AssetLineageWidgetType-item2 .selected, -.AssetLineageWidgetType-item .selected { -}*/ - -.AssetLineageWidgetType-item.selected { -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -.GUITextBox.container:after { -} - -@media screen and (max-device-width: 769px) { - .no-blank-line-after { - } - - .no-blank-line-after-second-def { - } - -.my-style { - } - - .no-blank-line-and-trailing-comment { - } /* end long class */ - - .too-many-blank-lines-and-trailing-comment-extra-whitespace-after-brace { - } /* end long class */ - - .has-blank-line-and-trailing-comment { - } /* end long class */ - - .no-blank-line-and-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - - .too-many-blank-lines-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - - .has-blank-line-and-annotation { - } /* phpcs:ignore Standard.Cat.SniffName -- for reasons */ - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; -} - -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php deleted file mode 100644 index c9770cc1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionClosingBraceSpaceUnitTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassDefinitionClosingBraceSpace sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionClosingBraceSpaceSniff - */ -final class ClassDefinitionClosingBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 11 => 1, - 44 => 1, - 47 => 1, - 51 => 1, - 53 => 1, - 57 => 1, - 59 => 1, - 67 => 1, - 69 => 1, - 81 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css deleted file mode 100644 index 6496cb83..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.css +++ /dev/null @@ -1,66 +0,0 @@ -.AssetListingEditWidgetType-BottomPanel select, -#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { - float: left; -} - -.AssetListingEditWidgetType-BottomPanel select, - -#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { - float: left; -} - -.AssetListingEditWidgetType-BottomPanel select, -/*.AssetListingEditWidgetType-BottomPanel ul,*/ -#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { - float: left; -} - -.AssetListingEditWidgetType-BottomPanel select, - -.AssetListingEditWidgetType-BottomPanel ul, -#EditEditingModeWidgetType-assetEditor-filters-assetTypes-addNew { - float: left; -} - -#SuperUsersSystemConfigScreen-table { - display: block; - left: 50%; - margin-left: -500px; - margin-top: 180px; - position: relative; - width: 1000px; -} - -/** - * More styles below here. - */ - -td.TableWidgetType-header.TableWidgetType-header-lastLogin, -td.TableWidgetType-header.TableWidgetType-header-remove, -td.TableWidgetType-header.TableWidgetType-header-email, -td.TableWidgetType-header.TableWidgetType-header-userName { - background: url(images/ScreenImages/table_header_bg.png) repeat-x; - border-top: 1px solid #D4D4D4; - color: #787878; - height: 33px; - padding-left: 12px; - width: 150px; -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - padding: 20px; - margin: 40px; - } -} - -.foo -{ - border: none; -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php deleted file mode 100644 index 5320047c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionNameSpacingUnitTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassDefinitionNameSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionNameSpacingSniff - */ -final class ClassDefinitionNameSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 19 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css deleted file mode 100644 index 98c8fa56..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css +++ /dev/null @@ -1,108 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title{ - float: left; -} -.HelpWidgetType-new-bug-title { - - float: left; -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - - - header #logo img { - max-width: 100%; - } - -} - -.GUITextBox.container:after {} - -.single-line {float: left;} - -#opening-brace-on-different-line - - -{ - color: #FFFFFF; -} - -#opening-brace-on-different-line-and-inline-style - - -{color: #FFFFFF;} - -@media screen and (max-device-width: 769px) { .everything-on-one-line { float: left; } } - -/* Document handling of comments in various places */ -.no-space-before-opening-with-comment /* comment*/{ - float: left; -} - -.space-before-opening-with-comment-on-next-line -/* comment*/ { - float: left; -} - -#opening-brace-on-different-line-with-comment-between -/*comment*/ -{ - padding: 0; -} - -.single-line-with-comment { /* comment*/ float: left; } - -.multi-line-with-trailing-comment { /* comment*/ - float: left; -} - - -@media screen and (max-device-width: 769px) { - /*comment*/ - .comment-line-after-nesting-class-opening { - } -} - -@media screen and (max-device-width: 769px) { - - /*comment*/ - .blank-line-and-comment-line-after-nesting-class-opening { - } -} - -@media screen and (max-device-width: 769px) { - - - - /* phpcs:ignore Standard.Category.Sniffname -- for reasons */ - .blank-line-and-annotation-after-nesting-class-opening { - } -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed deleted file mode 100644 index b3f48a5c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.css.fixed +++ /dev/null @@ -1,106 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - - float: left; -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - -} - -.GUITextBox.container:after { -} - -.single-line { -float: left;} - -#opening-brace-on-different-line { - color: #FFFFFF; -} - -#opening-brace-on-different-line-and-inline-style { -color: #FFFFFF;} - -@media screen and (max-device-width: 769px) { - -.everything-on-one-line { -float: left; } } - -/* Document handling of comments in various places */ -.no-space-before-opening-with-comment /* comment*/ { - float: left; -} - -.space-before-opening-with-comment-on-next-line -/* comment*/ { - float: left; -} - -#opening-brace-on-different-line-with-comment-between -/*comment*/ { - padding: 0; -} - -.single-line-with-comment { -/* comment*/ float: left; } - -.multi-line-with-trailing-comment { /* comment*/ - float: left; -} - - -@media screen and (max-device-width: 769px) { - - /*comment*/ - .comment-line-after-nesting-class-opening { - } -} - -@media screen and (max-device-width: 769px) { - - /*comment*/ - .blank-line-and-comment-line-after-nesting-class-opening { - } -} - -@media screen and (max-device-width: 769px) { - - /* phpcs:ignore Standard.Category.Sniffname -- for reasons */ - .blank-line-and-annotation-after-nesting-class-opening { - } -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php deleted file mode 100644 index 3d5f37bb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassDefinitionOpeningBraceSpace sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionOpeningBraceSpaceSniff - */ -final class ClassDefinitionOpeningBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 7 => 1, - 10 => 1, - 26 => 1, - 33 => 1, - 43 => 1, - 45 => 1, - 50 => 1, - 57 => 2, - 59 => 2, - 62 => 1, - 73 => 1, - 77 => 1, - 84 => 1, - 97 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css deleted file mode 100644 index 391bc85a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css +++ /dev/null @@ -1,42 +0,0 @@ -body { -font-family: Arial, Helvetica, sans-serif; -margin : 40px 0 0 0; -padding : 0; -background: #8FB7DB url(diag_lines_bg.gif) top left; -margin-top: -10px; -margin-bottom: -0px; -} - -.TableWidgetType .recover:hover { - background-color: #FFF; -} - -#clearCache-settings:rootNodes-list_0 { - border-top: none; -} - -.LookupEditScreenWidgetType-urls a, .LookupEditScreenWidgetType-urls a:visited { - text-decoration: none; - color: #444; -} - -/* checking embedded PHP */ -li { - background:url(/images//bullet.gif) left px no-repeat; - margin:0px; - padding-left:10px; - margin-bottom:px; - margin-top: px; - line-height:13px; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); -} - -/* Empty style defs. */ -.p { - margin:; - margin-right: - margin-left: 10px; - float:/* Some comment. */ ; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed deleted file mode 100644 index e68bddce..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.css.fixed +++ /dev/null @@ -1,40 +0,0 @@ -body { -font-family: Arial, Helvetica, sans-serif; -margin: 40px 0 0 0; -padding: 0; -background: #8FB7DB url(diag_lines_bg.gif) top left; -margin-top: 10px; -margin-bottom: 0px; -} - -.TableWidgetType .recover:hover { - background-color: #FFF; -} - -#clearCache-settings:rootNodes-list_0 { - border-top: none; -} - -.LookupEditScreenWidgetType-urls a, .LookupEditScreenWidgetType-urls a:visited { - text-decoration: none; - color: #444; -} - -/* checking embedded PHP */ -li { - background: url(/images//bullet.gif) left px no-repeat; - margin: 0px; - padding-left: 10px; - margin-bottom: px; - margin-top: px; - line-height: 13px; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); -} - -/* Empty style defs. */ -.p { - margin:; - margin-right: - margin-left: 10px; - float: /* Some comment. */ ; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php deleted file mode 100644 index 222bbe4e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColonSpacingUnitTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ColonSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColonSpacingSniff - */ -final class ColonSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 2, - 5 => 1, - 6 => 1, - 8 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 32 => 1, - 41 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css deleted file mode 100644 index 2dfd22ad..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css +++ /dev/null @@ -1,16 +0,0 @@ -#title-bar-bottom-right { - background-color: #333333; - padding: 10px; - border-bottom: 1px dotted #F0F0F0; - border-top: 1px dotted #FF00FF; - background: #08f7db url(diag_lines_bg.gif) top left; - - /* The sniff only deals with HEX colours. */ - color: DarkSlateGray; - background-color: rgb(255, 0, 0); - background-color: rgba(0, 0, 255, 0.3); - background-color: hsl(120, 100%, 50%); -} - -#add-new-comment { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed deleted file mode 100644 index 039209dd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.css.fixed +++ /dev/null @@ -1,16 +0,0 @@ -#title-bar-bottom-right { - background-color: #333; - padding: 10px; - border-bottom: 1px dotted #F0F0F0; - border-top: 1px dotted #F0F; - background: #08F7DB url(diag_lines_bg.gif) top left; - - /* The sniff only deals with HEX colours. */ - color: DarkSlateGray; - background-color: rgb(255, 0, 0); - background-color: rgba(0, 0, 255, 0.3); - background-color: hsl(120, 100%, 50%); -} - -#add-new-comment { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php deleted file mode 100644 index 44a2d64f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ColourDefinitionUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ColourDefinition sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColourDefinitionSniff - */ -final class ColourDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 5 => 1, - 6 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css deleted file mode 100644 index 4c11beaa..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css +++ /dev/null @@ -1,17 +0,0 @@ -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; - height: 100%;float: left; - line-height: -25px; - cursor: pointer; margin: 10px; float: right; -} - -/* testing embedded PHP */ -li { - background:url(/images//bullet.gif) left px no-repeat; margin:0px; padding-left:10px; margin-bottom:px; line-height:13px; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); -} - -/* Document handling of comments and annotations. */ -div#annotations {-webkit-tap-highlight-color:transparent;/* phpcs:disable Standard.Cat.SniffName */-webkit-touch-callout:none;/*phpcs:enable*/-webkit-user-select:none;} - -div#comments {height:100%;/*comment*/width:100%;} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed deleted file mode 100644 index 93a7815e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.css.fixed +++ /dev/null @@ -1,27 +0,0 @@ -.SettingsTabPaneWidgetType-tab-mid { - background: transparent url(tab_inact_mid.png) repeat-x; - height: 100%; -float: left; - line-height: -25px; - cursor: pointer; -margin: 10px; -float: right; -} - -/* testing embedded PHP */ -li { - background:url(/images//bullet.gif) left px no-repeat; -margin:0px; -padding-left:10px; -margin-bottom:px; -line-height:13px; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); -} - -/* Document handling of comments and annotations. */ -div#annotations {-webkit-tap-highlight-color:transparent;/* phpcs:disable Standard.Cat.SniffName */ --webkit-touch-callout:none;/*phpcs:enable*/ --webkit-user-select:none;} - -div#comments {height:100%;/*comment*/ -width:100%;} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php deleted file mode 100644 index 18abf1a5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DisallowMultipleStyleDefinitionsUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowMultipleStyleDefinitions sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DisallowMultipleStyleDefinitionsSniff - */ -final class DisallowMultipleStyleDefinitionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 2, - 10 => 4, - 15 => 2, - 17 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css deleted file mode 100644 index 8ac95012..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.css +++ /dev/null @@ -1,103 +0,0 @@ -.AssetLineageWidgetType-item { - color: #FFF; -} - -.AssetLineageWidgetType-title { - color: #CCC; -} - -.AssetLineageWidgetType-item { - color: #CCC; -} - -.AssetLineageWidgetType-item .selected { -} - -.AssetLineageWidgetType-item.selected { -} - -#Blah .AssetLineageWidgetType-item { -} - -#X.selected, -.AssetLineageWidgetType-item { -} - -.MyClass, .YourClass { -} - -.YourClass, .MyClass { -} - -.YourClass, .MyClass, .OurClass { -} - - -.ClassAtTopOfMediaBlock { -} - -@media print { - .ClassAtTopOfMediaBlock { - } - - .ClassInMultipleMediaBlocks { - } -} - -.ClassNotAtTopOfMediaBlock { -} - -@media handheld { - .SameClassInMediaBlock { - } - - .ClassNotAtTopOfMediaBlock { - } - - .SameClassInMediaBlock { - } -} - -@media braille { - .PlaceholderClass { - } - - .ClassNotAtTopOfMediaBlock { - } - - .ClassInMultipleMediaBlocks { - } -} - -.foo /* any comment */ -{ color: red; } - -/* print comment */ -@media print { - /* comment1 */ - td { - } - - /* comment2 */ - img { - } - - /* comment3 */ - td { - } -} - -@media handheld /* handheld comment */ -{ - td /* comment1 */ - { - } - - img /* comment2 */ - { - } - - td /* comment3 */ - { - } -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php deleted file mode 100644 index 70bc5b10..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateClassDefinitionUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DuplicateClassDefinition sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateClassDefinitionSniff - */ -final class DuplicateClassDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 29 => 1, - 57 => 1, - 86 => 1, - 101 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css deleted file mode 100644 index c9c849f6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.css +++ /dev/null @@ -1,27 +0,0 @@ -.ViperSubToolbar-wrapper { - height: 34px; - left: 0; - position: fixed; - top: 60px; - z-index: 997; - left: 50%; -} - -.expandable { - -moz-transition-property: margin-left, margin-right; - -moz-transition-duration: 0.2s; - -moz-transition-timing-function: ease; - -webkit-transition-property: margin-left, margin-right; - -webkit-transition-duration: 0.2s; - -webkit-transition-timing-function: ease; - z-index: 2; -} - -@media only screen and (max-width: 480px) { - header nav.meta a { display: none; } - header nav.meta a.search { display: block; } -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php deleted file mode 100644 index f7e9e95f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/DuplicateStyleDefinitionUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DuplicateStyleDefinition sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateStyleDefinitionSniff - */ -final class DuplicateStyleDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [7 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css deleted file mode 100644 index 801dcda1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.css +++ /dev/null @@ -1,15 +0,0 @@ -.HelpWidgetType-new-bug-title {} -.HelpWidgetType-new-bug-title { -} -.HelpWidgetType-new-bug-title { - -} -.HelpWidgetType-new-bug-title { - -} -.HelpWidgetType-new-bug-title { - /* Nothing to see here */ -} -.HelpWidgetType-new-bug-title { - float: left; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php deleted file mode 100644 index b7587300..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyClassDefinitionUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the EmptyClassDefinition sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyClassDefinitionSniff - */ -final class EmptyClassDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 1 => 1, - 2 => 1, - 4 => 1, - 7 => 1, - 10 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css deleted file mode 100644 index 24910b71..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.css +++ /dev/null @@ -1,11 +0,0 @@ -#MetadataAdminScreen-addField-fieldType { - margin-left: 10px; - margin-right: - float: ; -} - -#MetadataAdminScreen-addField-fieldType li { - margin-right: /* @todo */ - margin-left: 10px; - float: /* Some comment. */ ; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php deleted file mode 100644 index 55ec5331..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/EmptyStyleDefinitionUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the EmptyStyleDefinition sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyStyleDefinitionSniff - */ -final class EmptyStyleDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 1, - 8 => 1, - 10 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css deleted file mode 100644 index dbd54870..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css +++ /dev/null @@ -1,18 +0,0 @@ -#add-new-comment { - -moz-border-radius: 1px; - -webkit-border-radius: 1px; - border-radius: 1px; - - -moz-border-radius-topleft: 1px; - -moz-border-radius-topright: 1px; - -moz-border-radius-bottomright: 1px; - -moz-border-radius-bottomleft: 1px; - border-top-left-radius: 1px; - border-top-right-radius: 1px; - border-bottom-right-radius: 1px; - border-bottom-left-radius: 1px; - - -moz-box-shadow: 1px; - -webkit-box-shadow: 1px; - box-shadow: 1px; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed deleted file mode 100644 index a8ea2704..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.css.fixed +++ /dev/null @@ -1,18 +0,0 @@ -#add-new-comment { - border-radius: 1px; - border-radius: 1px; - border-radius: 1px; - - border-top-left-radius: 1px; - border-top-right-radius: 1px; - border-bottom-right-radius: 1px; - border-bottom-left-radius: 1px; - border-top-left-radius: 1px; - border-top-right-radius: 1px; - border-bottom-right-radius: 1px; - border-bottom-left-radius: 1px; - - box-shadow: 1px; - box-shadow: 1px; - box-shadow: 1px; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php deleted file mode 100644 index f5cdae43..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ForbiddenStylesUnitTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ForbiddenStyles sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ForbiddenStylesSniff - */ -final class ForbiddenStylesUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 3 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 15 => 1, - 16 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css deleted file mode 100644 index 216f00ee..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css +++ /dev/null @@ -1,79 +0,0 @@ -body { - - font-family: Arial, Helvetica, sans-serif; - margin: 40px 0 0 0; -padding: 0; - background: #8FB7DB url(diag_lines_bg.gif) top left; - -} - -td { - margin: 40px; - - padding: 20px; -} - -/* -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { - background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; -} -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { - background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; -} -*/ - -.GUITextBox.container:after {} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - padding: 20px; - margin: 40px; - } -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - - header #logo img { - min-width: 100%; - } - -} - -td { - margin: 40px; - - padding: 20px; - - -} - -.GUIFileUpload { -/* opacity: 0.25; */ -} - -.foo -{ - border: none; -} - -.mortgage-calculator h2 { - background: #072237; - color: #fff; - font-weight: normal; - height: 50px; - line-height: 50px; - padding: 0 0 0 30px; - } - -.WhitelistCommentIndentationShouldBeIgnored { -/* phpcs:disable Standard.Category.Sniff -- for reasons. */ -} - -/* syntax error */ ---------------------------------------------- */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed deleted file mode 100644 index 1fd128a5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.1.css.fixed +++ /dev/null @@ -1,73 +0,0 @@ -body { - font-family: Arial, Helvetica, sans-serif; - margin: 40px 0 0 0; - padding: 0; - background: #8FB7DB url(diag_lines_bg.gif) top left; -} - -td { - margin: 40px; - padding: 20px; -} - -/* -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-left { - background: transparent url(images/ScreenImages/tab_on_left.png) no-repeat; -} -#AdminScreenModeWidgetType-tab_pane-containers .TabPaneWidgetType-tab-selected-right { - background: transparent url(images/ScreenImages/tab_on_right.png) no-repeat; -} -*/ - -.GUITextBox.container:after {} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - padding: 20px; - margin: 40px; - } -} - -@media screen and (max-device-width: 769px) { - - header #logo img { - max-width: 100%; - } - - header #logo img { - min-width: 100%; - } - -} - -td { - margin: 40px; - padding: 20px; -} - -.GUIFileUpload { -/* opacity: 0.25; */ -} - -.foo -{ - border: none; -} - -.mortgage-calculator h2 { - background: #072237; - color: #fff; - font-weight: normal; - height: 50px; - line-height: 50px; - padding: 0 0 0 30px; -} - -.WhitelistCommentIndentationShouldBeIgnored { -/* phpcs:disable Standard.Category.Sniff -- for reasons. */ -} - -/* syntax error */ ---------------------------------------------- */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css deleted file mode 100644 index 48b22f6d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.2.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Live coding. Has to be the last (only) test in the file. */ -.intentional-parse-error { - float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php deleted file mode 100644 index fe79ffb3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/IndentationUnitTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the Indentation sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\IndentationSniff - */ -final class IndentationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'IndentationUnitTest.1.css': - return [ - 2 => 1, - 3 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 12 => 1, - 30 => 1, - 32 => 1, - 50 => 1, - 52 => 1, - 53 => 1, - 66 => 1, - 67 => 1, - 68 => 1, - 69 => 1, - 70 => 1, - 71 => 1, - 72 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css deleted file mode 100644 index d0f2982f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.css +++ /dev/null @@ -1,14 +0,0 @@ -.SettingsTabPaneWidgetType-tab-mid { - font-family: Arial; - Font-Family: arial; - background-color: #DA9393; - BACKGROUND-IMAGE: URL(Warning_Close.png); -} - -@media screen and (max-device-width: 769px) { - - .SettingsTabPaneWidgetType-tab-mid { - Font-Family: arial; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2e62a8, endColorstr=#123363); - } -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php deleted file mode 100644 index c47455a1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/LowercaseStyleDefinitionUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LowercaseStyleDefinition sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\LowercaseStyleDefinitionSniff - */ -final class LowercaseStyleDefinitionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 3 => 1, - 5 => 2, - 11 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css deleted file mode 100644 index 6c947e5b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.css +++ /dev/null @@ -1,21 +0,0 @@ -.my-style { - margin-right 15px; - float: left; - margin-left 15px; - margin-top: 15px; - margin-bottom 15px; -} - -@media screen and (max-device-width: 769px) { - header #logo img { - max-width: 100%; - margin-bottom 15px; - } -} - -#foo { background-color: #FF0000; -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php deleted file mode 100644 index 29e39848..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/MissingColonUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the MissingColon sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\MissingColonSniff - */ -final class MissingColonUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 1, - 6 => 1, - 12 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css deleted file mode 100644 index 05637a60..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.css +++ /dev/null @@ -1,25 +0,0 @@ -#red { - background-color: red; -} - -.red { - border-bottom: 1px dotted black; - border-top: 1px dotted gray; -} - -#red.yellow { - background: yellow url(diag_lines_bg.gif) top left; - text-shadow: 0 1px 0 white; -} - -.something--white { - border: 0; -} - -.something--------------white { - border: 0; -} - -.-white { - border: 0; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php deleted file mode 100644 index 90744d35..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/NamedColoursUnitTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the NamedColours sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\NamedColoursSniff - */ -final class NamedColoursUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 6 => 1, - 7 => 1, - 11 => 1, - 12 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css deleted file mode 100644 index c656c78e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css +++ /dev/null @@ -1,35 +0,0 @@ -.my-style { - opacity: 0; - opacity: 0.0; - opacity: 1; - opacity: 1.0; - opacity: 1.5; - opacity: .5; - opacity: 0.5; - opacity: 2; - opacity: -1; - opacity: 0.55; -} - -div { - font-size: 1.2em; - background: linear-gradient(to bottom, #00F, #0F0) repeat scroll 50% 50% #EEE; - min-width: 250px; - max-width: 100%; - padding-bottom: 50px; - box-shadow: 2px -3px 3px rgba(100, 100, 100, 0.33); - border-left: 1px solid #000; - border-right: 1px solid #000; - border-top: 1px solid #000; - border-bottom: 1px dotted #000; - background: url(../1/2/3/4-5-6_7_100x100.png) repeat scroll 50% 50% #EEE; - opacity: -1; -} - -.my-commented-style { - opacity: /*comment*/ 0; - opacity: /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - 0.0; - opacity: /*comment*/ 1.0; - opacity: /*comment*/ .5; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed deleted file mode 100644 index 257e41a7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.css.fixed +++ /dev/null @@ -1,35 +0,0 @@ -.my-style { - opacity: 0; - opacity: 0; - opacity: 1; - opacity: 1; - opacity: 1.5; - opacity: 0.5; - opacity: 0.5; - opacity: 2; - opacity: -1; - opacity: 0.55; -} - -div { - font-size: 1.2em; - background: linear-gradient(to bottom, #00F, #0F0) repeat scroll 50% 50% #EEE; - min-width: 250px; - max-width: 100%; - padding-bottom: 50px; - box-shadow: 2px -3px 3px rgba(100, 100, 100, 0.33); - border-left: 1px solid #000; - border-right: 1px solid #000; - border-top: 1px solid #000; - border-bottom: 1px dotted #000; - background: url(../1/2/3/4-5-6_7_100x100.png) repeat scroll 50% 50% #EEE; - opacity: -1; -} - -.my-commented-style { - opacity: /*comment*/ 0; - opacity: /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - 0; - opacity: /*comment*/ 1; - opacity: /*comment*/ 0.5; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php deleted file mode 100644 index d323477b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/OpacityUnitTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the Opacity sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\OpacitySniff - */ -final class OpacityUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 26 => 1, - 32 => 1, - 33 => 1, - 34 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css deleted file mode 100644 index 3ccb162e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css +++ /dev/null @@ -1,61 +0,0 @@ -.HelpWidgetType-new-bug-title { - width: 308px - float: left; -} - -#MetadataAdminScreen-addField-add { - float: left ; -} - -.TableWidgetType .recover:hover { - background-color: #FFF; -} - -#clearCache-settings:rootNodes-list_0 { - border-top: none; -} - -.HelpWidgetType-list { - list-style-image: url(); -} - -@media (min-width: 320px) and (max-width: 961px) { - .tooltipsrt:hover span.tltp, - .tooltipstp:hover span.tltp { - visibility: hidden; - } -} - -#single-line-multi-statement-no-semicolon { - padding: 0 border: 20; -} - -#multi-line-style-no-semicolon { - padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - border: - 20 - margin: - 0px /* top */ - 10px /* right + left */ -} - -#multi-line-style-whitespace { - padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ ; - border: - 20 ; - margin: - 10px /* top */ - 0px /* right + left */ - - - ; -} - -.allow-for-star-hack { - cursor: pointer; - *cursor: hand; -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed deleted file mode 100644 index 7efef588..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.css.fixed +++ /dev/null @@ -1,58 +0,0 @@ -.HelpWidgetType-new-bug-title { - width: 308px - float: left; -} - -#MetadataAdminScreen-addField-add { - float: left; -} - -.TableWidgetType .recover:hover { - background-color: #FFF; -} - -#clearCache-settings:rootNodes-list_0 { - border-top: none; -} - -.HelpWidgetType-list { - list-style-image: url(); -} - -@media (min-width: 320px) and (max-width: 961px) { - .tooltipsrt:hover span.tltp, - .tooltipstp:hover span.tltp { - visibility: hidden; - } -} - -#single-line-multi-statement-no-semicolon { - padding: 0 border: 20; -} - -#multi-line-style-no-semicolon { - padding: 0 /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - border: - 20 - margin: - 0px /* top */ - 10px /* right + left */ -} - -#multi-line-style-whitespace { - padding: 0; /* phpcs:ignore Standard.Cat.Sniff -- for reasons */ - border: - 20; - margin: - 10px /* top */ - 0px; /* right + left */ -} - -.allow-for-star-hack { - cursor: pointer; - *cursor: hand; -} - -/* Live coding. Has to be the last test in the file. */ -.intentional-parse-error { - float: left diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php deleted file mode 100644 index ab2c839b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/SemicolonSpacingUnitTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SemicolonSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\SemicolonSpacingSniff - */ -final class SemicolonSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 7 => 1, - 30 => 1, - 34 => 1, - 36 => 1, - 39 => 1, - 43 => 1, - 45 => 1, - 48 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css deleted file mode 100644 index c3d07ef5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css +++ /dev/null @@ -1,41 +0,0 @@ -#add-new-comment { - background-color: #333333; - padding: 10px; - border-bottom: 1px dotted #F0F0F0; - border-top: 1px dotted #FF00FF; - background: #8fb7db url(diag_lines_bg.gif) top left; - tab-size: 1; - margin: 8px 8px 8px 8px; - margin: 8px 8px; - margin: 0 0 0 0; - margin: 0 8px 0 8px; - margin: 8px 4px 8px 4px; - margin: 8px 4% 8px 4%; - margin: 6px 2px 9px 2px; - margin: 6px 2px 9px; - border-radius: 2px 2px 2px 2px !important; - border-width: 2px 2px 2px 2px; - border-width: 1px 2px 2px 4px; - margin: 97px auto 0 auto; - text-shadow: 0 1px 0 #fff; - border-width: - 2px - 4px - 2px - 4px; - - /* These are style names excluded from this rule. */ - background-position: 0 0; - box-shadow: 2px 2px 2px 2px; - transform-origin: 0 110% 0; - - /* Sizes with comments between them will be ignored for the purposes of this sniff. */ - margin: 8px /*top*/ 8px /*right*/ 8px /*bottom*/ 8px /*left*/; - - /* Same with PHPCS annotations. */ - border-width: - 2px /* phpcs:ignore Standard.Category.SniffName -- for reasons */ - 4px - 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ - 4px; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed deleted file mode 100644 index 36297dd6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.1.css.fixed +++ /dev/null @@ -1,37 +0,0 @@ -#add-new-comment { - background-color: #333333; - padding: 10px; - border-bottom: 1px dotted #F0F0F0; - border-top: 1px dotted #FF00FF; - background: #8fb7db url(diag_lines_bg.gif) top left; - tab-size: 1; - margin: 8px; - margin: 8px; - margin: 0; - margin: 0 8px; - margin: 8px 4px; - margin: 8px 4%; - margin: 6px 2px 9px 2px; - margin: 6px 2px 9px 2px; - border-radius: 2px !important; - border-width: 2px; - border-width: 1px 2px 2px 4px; - margin: 97px auto 0 auto; - text-shadow: 0 1px 0 #fff; - border-width: 2px 4px; - - /* These are style names excluded from this rule. */ - background-position: 0 0; - box-shadow: 2px 2px 2px 2px; - transform-origin: 0 110% 0; - - /* Sizes with comments between them will be ignored for the purposes of this sniff. */ - margin: 8px /*top*/ 8px /*right*/ 8px /*bottom*/ 8px /*left*/; - - /* Same with PHPCS annotations. */ - border-width: - 2px /* phpcs:ignore Standard.Category.SniffName -- for reasons */ - 4px - 2px /* phpcs:disable Standard.Category.SniffName -- for reasons */ - 4px; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css deleted file mode 100644 index 2a91cf71..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.2.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Intentional parse error. Live coding resilience. */ -#live-coding { - margin: 8px 8px 8px 8px diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php deleted file mode 100644 index 7394b77c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ShorthandSizeUnitTest.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\CSS; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ShorthandSize sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ShorthandSizeSniff - */ -final class ShorthandSizeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ShorthandSizeUnitTest.1.css': - return [ - 8 => 1, - 9 => 1, - 10 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 15 => 1, - 16 => 1, - 17 => 1, - 21 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc deleted file mode 100644 index 2af42d37..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassDeclarationUnitTest.inc +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassDeclarationSniff - */ -final class ClassDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 6 => 1, - 10 => 1, - 15 => 2, - 18 => 1, - 22 => 4, - 23 => 4, - 24 => 4, - 27 => 2, - 30 => 2, - 34 => 1, - 35 => 1, - 39 => 1, - 42 => 1, - 45 => 1, - 48 => 1, - 50 => 2, - 51 => 1, - 55 => 1, - 59 => 4, - 63 => 1, - 65 => 1, - 69 => 3, - 74 => 2, - 77 => 1, - 80 => 1, - 85 => 3, - 89 => 1, - 92 => 1, - 97 => 1, - 108 => 1, - 114 => 1, - 116 => 1, - 118 => 1, - 121 => 1, - 124 => 2, - 128 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc deleted file mode 100644 index 8b5a5aa7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.inc +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php deleted file mode 100644 index 7a01e9c0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ClassFileNameUnitTest.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassFileName sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassFileNameSniff - */ -final class ClassFileNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 16 => 1, - 17 => 1, - 18 => 1, - 19 => 1, - 20 => 1, - 21 => 1, - 22 => 1, - 23 => 1, - 27 => 1, - 28 => 1, - 29 => 1, - 30 => 1, - 31 => 1, - 32 => 1, - 33 => 1, - 34 => 1, - 35 => 1, - 36 => 1, - 37 => 1, - 38 => 1, - 39 => 1, - 40 => 1, - 41 => 1, - 42 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js deleted file mode 100644 index 04126f86..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.js +++ /dev/null @@ -1,45 +0,0 @@ -var x = { - abc: 1, - zyz: 2, - abc: 5, - mno: { - abc: 4 - }, - abc: 5 - - this.request({ - action: 'getSubmissions' - }); - - this.request({ - action: 'deleteSubmission' - }); -} - - -LinkingEditScreenWidgetType.prototype = { - - _addDeleteButtonEvent: function(parentid) - { - var params = { - screen: 'LinkingEditScreenWidget', - assetid: self.assetid, - parentid: parentid, - assetid: parentid, - op: 'deleteLink' - }; - - }, - - saveDesignEdit: function() - { - var params = { - screen: [this.id, 'Widget'].join(''), - assetid: this.assetid, - changes: dfx.jsonEncode(this.currnetLinksWdgt.getChanges()), - op: 'saveLinkEdit' - }; - - } - -}; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php deleted file mode 100644 index 567a89cc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/DuplicatePropertyUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DuplicateProperty sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\DuplicatePropertySniff - */ -final class DuplicatePropertyUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 8 => 1, - 28 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc deleted file mode 100644 index da47fa17..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/LowercaseClassKeywordsUnitTest.inc +++ /dev/null @@ -1,16 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LowercaseClassKeywords sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\LowercaseClassKeywordsSniff - */ -final class LowercaseClassKeywordsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 2 => 3, - 3 => 3, - 4 => 1, - 5 => 1, - 6 => 2, - 8 => 1, - 10 => 1, - 11 => 1, - 14 => 1, - 16 => 1, - ]; - - return $errors; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc deleted file mode 100644 index f2c4713a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc +++ /dev/null @@ -1,185 +0,0 @@ -testResults; - - - // Correct call to self. - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = parent::selfMemberReferenceUnitTestFunction(); - - // Incorrect case. - $testResults[] = Self::selfMemberReferenceUnitTestFunction(); - $testResults[] = SELF::selfMemberReferenceUnitTestFunction(); - $testResults[] = SelfMemberReferenceUnitTestExample::selfMemberReferenceUnitTestFunction(); - - - // Incorrect spacing. - $testResults[] = self ::selfMemberReferenceUnitTestFunction(); - $testResults[] = self:: selfMemberReferenceUnitTestFunction(); - $testResults[] = self :: selfMemberReferenceUnitTestFunction(); - - // Remove ALL the newlines - $testResults[] = self - - - - - :: - - - - - selfMemberReferenceUnitTestFunction(); - - } - - - function selfMemberReferenceUnitTestFunction() - { - $this->testCount = $this->testCount + 1; - return $this->testCount; - - } - - -} - - -class MyClass { - - public static function test($value) { - echo "$value\n"; - } - - public static function walk() { - $callback = function($value, $key) { - // This is valid because you can't use self:: in a closure. - MyClass::test($value); - }; - - $array = array(1,2,3); - array_walk($array, $callback); - } -} - -MyClass::walk(); - -class Controller -{ - public function Action() - { - Doctrine\Common\Util\Debug::dump(); - } -} - -class Foo -{ - public static function bar() - { - \Foo::baz(); - } -} - -namespace TYPO3\CMS\Reports; - -class Status { - const NOTICE = -2; - const INFO = -1; - const OK = 0; - const WARNING = 1; - const ERROR = 2; -} - -namespace TYPO3\CMS\Reports\Report\Status; - -class Status implements \TYPO3\CMS\Reports\ReportInterface { - public function getHighestSeverity(array $statusCollection) { - $highestSeverity = \TYPO3\CMS\Reports\Status::NOTICE; - } -} - -namespace Foo; - -class Bar { - - function myFunction() - { - \Foo\Whatever::something(); - \Foo\Bar::something(); - } -} - -namespace Foo\Bar; - -class Baz { - - function myFunction() - { - \Foo\Bar\Whatever::something(); - \Foo\Bar\Baz::something(); - } -} - -class Nested_Anon_Class { - public function getAnonymousClass() { - // Spacing/comments should not cause false negatives for the NotUsed error. - Nested_Anon_Class :: $prop; - Nested_Anon_Class - /* some comment */ - - :: - - // phpcs:ignore Standard.Category.SniffName -- for reasons. - Bar(); - - // Anonymous class is a different scope. - return new class() { - public function nested_function() { - Nested_Anon_Class::$prop; - Nested_Anon_Class::BAR; - } - }; - } -} - -// Test dealing with scoped namespaces. -namespace Foo\Baz { - class BarFoo { - public function foo() { - echo Foo\Baz\BarFoo::$prop; - } - } -} - -// Prevent false negative when namespace has whitespace/comments. -namespace Foo /*comment*/ \ Bah { - class BarFoo { - public function foo() { - echo Foo \ /*comment*/ Bah\BarFoo::$prop; - } - } -} - -namespace EndsIn\CloseTag ?> -testResults; - - - // Correct call to self. - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = parent::selfMemberReferenceUnitTestFunction(); - - // Incorrect case. - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - - - // Incorrect spacing. - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - - // Remove ALL the newlines - $testResults[] = self::selfMemberReferenceUnitTestFunction(); - - } - - - function selfMemberReferenceUnitTestFunction() - { - $this->testCount = $this->testCount + 1; - return $this->testCount; - - } - - -} - - -class MyClass { - - public static function test($value) { - echo "$value\n"; - } - - public static function walk() { - $callback = function($value, $key) { - // This is valid because you can't use self:: in a closure. - MyClass::test($value); - }; - - $array = array(1,2,3); - array_walk($array, $callback); - } -} - -MyClass::walk(); - -class Controller -{ - public function Action() - { - Doctrine\Common\Util\Debug::dump(); - } -} - -class Foo -{ - public static function bar() - { - self::baz(); - } -} - -namespace TYPO3\CMS\Reports; - -class Status { - const NOTICE = -2; - const INFO = -1; - const OK = 0; - const WARNING = 1; - const ERROR = 2; -} - -namespace TYPO3\CMS\Reports\Report\Status; - -class Status implements \TYPO3\CMS\Reports\ReportInterface { - public function getHighestSeverity(array $statusCollection) { - $highestSeverity = \TYPO3\CMS\Reports\Status::NOTICE; - } -} - -namespace Foo; - -class Bar { - - function myFunction() - { - \Foo\Whatever::something(); - self::something(); - } -} - -namespace Foo\Bar; - -class Baz { - - function myFunction() - { - \Foo\Bar\Whatever::something(); - self::something(); - } -} - -class Nested_Anon_Class { - public function getAnonymousClass() { - // Spacing/comments should not cause false negatives for the NotUsed error. - self::$prop; - - /* some comment */ - - self::// phpcs:ignore Standard.Category.SniffName -- for reasons. - Bar(); - - // Anonymous class is a different scope. - return new class() { - public function nested_function() { - Nested_Anon_Class::$prop; - Nested_Anon_Class::BAR; - } - }; - } -} - -// Test dealing with scoped namespaces. -namespace Foo\Baz { - class BarFoo { - public function foo() { - echo self::$prop; - } - } -} - -// Prevent false negative when namespace has whitespace/comments. -namespace Foo /*comment*/ \ Bah { - class BarFoo { - public function foo() { - echo /*comment*/ self::$prop; - } - } -} - -namespace EndsIn\CloseTag ?> - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SelfMemberReference sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\SelfMemberReferenceSniff - */ -final class SelfMemberReferenceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 24 => 1, - 25 => 1, - 26 => 1, - 30 => 1, - 31 => 1, - 32 => 2, - 40 => 2, - 92 => 1, - 121 => 1, - 132 => 1, - 139 => 3, - 140 => 1, - 143 => 2, - 162 => 1, - 171 => 1, - 183 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc deleted file mode 100644 index 3fe39435..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.inc +++ /dev/null @@ -1,191 +0,0 @@ -anonymous = new class extends ArrayObject - { - public function __construct() - { - parent::__construct(['a' => 1, 'b' => 2]); - } - }; - } -} - -// Valid interface name. -interface ValidCamelCaseClass extends MyClass {} - - -// Incorrect usage of camel case. -interface invalidCamelCaseClass extends MyClass {} -interface Invalid_Camel_Case_Class_With_Underscores implements MyClass {} - - -// All lowercase. -interface invalidlowercaseclass extends MyClass {} -interface invalid_lowercase_class_with_underscores extends MyClass {} - - -// All uppercase. -interface VALIDUPPERCASECLASS extends MyClass {} -interface INVALID_UPPERCASE_CLASS_WITH_UNDERSCORES extends MyClass {} - - -// Mix camel case with uppercase. -interface ValidCamelCaseClassWithUPPERCASE extends MyClass {} - - -// Usage of numeric characters. -interface ValidCamelCaseClassWith1Number extends MyClass {} -interface ValidCamelCaseClassWith12345Numbers extends MyClass {} -interface 5InvalidCamelCaseClassStartingWithNumber extends MyClass {} -interface ValidCamelCaseClassEndingWithNumber5 extends MyClass {} -interface 12345 extends MyClass {} - -interface Testing{} - -interface Base -{ - protected $anonymous; - - public function __construct(); -} - - -// Valid trait name. -trait ValidCamelCaseClass extends MyClass {} - - -// Incorrect usage of camel case. -trait invalidCamelCaseClass extends MyClass {} -trait Invalid_Camel_Case_Class_With_Underscores implements MyClass {} - - -// All lowercase. -trait invalidlowercaseclass extends MyClass {} -trait invalid_lowercase_class_with_underscores extends MyClass {} - - -// All uppercase. -trait VALIDUPPERCASECLASS extends MyClass {} -trait INVALID_UPPERCASE_CLASS_WITH_UNDERSCORES extends MyClass {} - - -// Mix camel case with uppercase. -trait ValidCamelCaseClassWithUPPERCASE extends MyClass {} - - -// Usage of numeric characters. -trait ValidCamelCaseClassWith1Number extends MyClass {} -trait ValidCamelCaseClassWith12345Numbers extends MyClass {} -trait 5InvalidCamelCaseClassStartingWithNumber extends MyClass {} -trait ValidCamelCaseClassEndingWithNumber5 extends MyClass {} -trait 12345 extends MyClass {} - -trait Testing{} - -trait Base -{ - protected $anonymous; - - public function __construct() - { - $this->anonymous = new class extends ArrayObject - { - public function __construct() - { - parent::__construct(['a' => 1, 'b' => 2]); - } - }; - } -} - -// Valid enum name. -enum ValidCamelCaseClass: string {} - - -// Incorrect usage of camel case. -enum invalidCamelCaseClass {} -enum Invalid_Camel_Case_Class_With_Underscores {} - - -// All lowercase. -enum invalidlowercaseclass: INT {} -enum invalid_lowercase_class_with_underscores {} - - -// All uppercase. -enum VALIDUPPERCASECLASS: int {} -enum INVALID_UPPERCASE_CLASS_WITH_UNDERSCORES {} - - -// Mix camel case with uppercase. -enum ValidCamelCaseClassWithUPPERCASE : string {} - - -// Usage of numeric characters. -enum ValidCamelCaseClassWith1Number {} -enum ValidCamelCaseClassWith12345Numbers : string {} -enum ValidCamelCaseClassEndingWithNumber5 {} - -enum Testing{} - -enum Base -{ - public function __construct() - { - $this->anonymous = new class extends ArrayObject - { - public function __construct() - { - parent::__construct(['a' => 1, 'b' => 2]); - } - }; - } -} - -if ( class_exists( Test :: class ) ) {} -if ( class_exists( Test2 ::class ) ) {} - -$foo = new class( - new class implements Countable { - } -) extends DateTime { -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php deleted file mode 100644 index 8e505a41..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Classes/ValidClassNameUnitTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Classes; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ValidClassName sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff - */ -final class ValidClassNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 10 => 1, - 14 => 1, - 15 => 1, - 20 => 1, - 30 => 1, - 32 => 1, - 57 => 1, - 58 => 1, - 62 => 1, - 63 => 1, - 68 => 1, - 78 => 1, - 80 => 1, - 97 => 1, - 98 => 1, - 102 => 1, - 103 => 1, - 108 => 1, - 118 => 1, - 120 => 1, - 145 => 1, - 146 => 1, - 150 => 1, - 151 => 1, - 156 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc deleted file mode 100644 index 7cd04a21..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the BlockComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\BlockCommentSniff - */ -final class BlockCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * @param \PHP_CodeSniffer\Config $config The config data for the test run. - * - * @return void - */ - public function setCliValues($testFile, $config) - { - $config->tabWidth = 4; - - }//end setCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 3 => 1, - 8 => 1, - 20 => 1, - 24 => 1, - 30 => 1, - 31 => 1, - 34 => 1, - 40 => 1, - 45 => 1, - 49 => 1, - 51 => 1, - 53 => 1, - 57 => 1, - 60 => 1, - 61 => 1, - 63 => 1, - 65 => 1, - 68 => 1, - 70 => 1, - 72 => 1, - 75 => 1, - 84 => 1, - 87 => 1, - 89 => 1, - 92 => 1, - 111 => 1, - 159 => 1, - 181 => 1, - 188 => 1, - 208 => 1, - 214 => 1, - 226 => 1, - 227 => 1, - 232 => 1, - 233 => 1, - 256 => 1, - 271 => 1, - 273 => 1, - ]; - - return $errors; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc deleted file mode 100644 index 8de3d0a7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.inc +++ /dev/null @@ -1,145 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClassComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff - */ -final class ClassCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 15 => 1, - 31 => 1, - 54 => 1, - 143 => 1, - 145 => 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. - * - * @return array - */ - public function getWarningList() - { - return [ - 29 => 1, - 30 => 1, - 50 => 1, - 66 => 1, - 67 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc deleted file mode 100644 index 560370bf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc +++ /dev/null @@ -1,124 +0,0 @@ - $a; - -trait TestTrait { -}//end trait - -trait TestTrait { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc.fixed deleted file mode 100644 index 8c690145..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.1.inc.fixed +++ /dev/null @@ -1,117 +0,0 @@ - $a; - -trait TestTrait { -}//end trait - -trait TestTrait { -}//end trait diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.2.inc deleted file mode 100644 index 25913dd8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.2.inc +++ /dev/null @@ -1,7 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClosingDeclarationComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClosingDeclarationCommentSniff - */ -final class ClosingDeclarationCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the test file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ClosingDeclarationCommentUnitTest.1.inc': - return [ - 13 => 1, - 17 => 1, - 31 => 1, - 41 => 1, - 59 => 1, - 63 => 1, - 67 => 1, - 79 => 1, - 83 => 1, - 89 => 1, - 92 => 1, - 98 => 1, - 101 => 1, - 106 => 1, - 110 => 1, - 124 => 1, - ]; - - case 'ClosingDeclarationCommentUnitTest.4.inc': - return [8 => 1]; - - case 'ClosingDeclarationCommentUnitTest.5.inc': - return [11 => 1]; - - default: - return []; - }//end switch - - }//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 test file being tested. - * - * @return array - */ - public function getWarningList($testFile='') - { - switch ($testFile) { - case 'ClosingDeclarationCommentUnitTest.1.inc': - return [71 => 1]; - - case 'ClosingDeclarationCommentUnitTest.2.inc': - case 'ClosingDeclarationCommentUnitTest.3.inc': - return [7 => 1]; - - default: - return []; - } - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc deleted file mode 100644 index d95acd2c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc +++ /dev/null @@ -1,103 +0,0 @@ - line numbers for each token. - * - * Long description with some points: - * - one - * - two - * - three - * - * @param array &$tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to - * process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function myFunction() {} - -class MyClass2 -{ - /** - * Some info about the variable here. - */ - var $x; -} - -abstract class MyClass -{ - /** -* Property comment - */ - readonly public string $prop; -} - -/** - * Some info about the enum here - * -*/ -enum Suits: string -{ - /** - * Some info about the case here. - */ - case HEARTS; -} - -/** ************************************************************************ - * Example with no errors. - **************************************************************************/ -function example() {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed deleted file mode 100644 index ea6488a0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed +++ /dev/null @@ -1,103 +0,0 @@ - line numbers for each token. - * - * Long description with some points: - * - one - * - two - * - three - * - * @param array &$tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to - * process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function myFunction() {} - -class MyClass2 -{ - /** - * Some info about the variable here. - */ - var $x; -} - -abstract class MyClass -{ - /** - * Property comment - */ - readonly public string $prop; -} - -/** - * Some info about the enum here - * - */ -enum Suits: string -{ - /** - * Some info about the case here. - */ - case HEARTS; -} - -/** ************************************************************************ - * Example with no errors. - **************************************************************************/ -function example() {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js deleted file mode 100644 index 6e1a8781..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js +++ /dev/null @@ -1,76 +0,0 @@ - -/** -* Some info about the class here - * - */ -foo.prototype = { - - /** - * Some info about the function here. - * - *@return void - */ - bar: function() {} -} - -/** - * Some info about the class here - * - */ -foo.prototype = { - - /** - *Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** - * Some info about the class here - * -*/ -foo.prototype = { - - /** - * Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -function myFunction() -{ - console.info('hi'); - /** - Comment here. - */ -} - -/** - * Creates a map of tokens => line numbers for each token. - * - * Long description with some points: - * - one - * - two - * - three - * - * @param array &$tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to - * process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function myFunction() {} - -$.extend(Datepicker.prototype, { - _widgetDatepicker: function() { - }, - /* Action for selecting a new month/year. */ -}); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed deleted file mode 100644 index 9edb4ccc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.js.fixed +++ /dev/null @@ -1,76 +0,0 @@ - -/** - * Some info about the class here - * - */ -foo.prototype = { - - /** - * Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** - * Some info about the class here - * - */ -foo.prototype = { - - /** - * Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** - * Some info about the class here - * - */ -foo.prototype = { - - /** - * Some info about the function here. - * - * @return void - */ - bar: function() {} -} - -/** @var Database $mockedDatabase */ -/** @var Container $mockedContainer */ - -function myFunction() -{ - console.info('hi'); - /** - Comment here. - */ -} - -/** - * Creates a map of tokens => line numbers for each token. - * - * Long description with some points: - * - one - * - two - * - three - * - * @param array &$tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to - * process this file. - * @param string $eolChar The EOL character to use for splitting strings. - * - * @return void - */ -function myFunction() {} - -$.extend(Datepicker.prototype, { - _widgetDatepicker: function() { - }, - /* Action for selecting a new month/year. */ -}); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php deleted file mode 100644 index a1ab9c32..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DocCommentAlignment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff - */ -final class DocCommentAlignmentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - $errors = [ - 3 => 1, - 11 => 1, - 17 => 1, - 18 => 1, - 19 => 1, - 23 => 2, - 24 => 1, - 25 => 2, - 26 => 1, - 32 => 1, - 33 => 1, - 38 => 1, - 39 => 1, - ]; - - if ($testFile === 'DocCommentAlignmentUnitTest.inc') { - $errors[75] = 1; - $errors[83] = 1; - $errors[84] = 1; - $errors[90] = 1; - $errors[91] = 1; - $errors[95] = 1; - $errors[96] = 1; - } - - return $errors; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc deleted file mode 100644 index cde6e462..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.inc +++ /dev/null @@ -1,55 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php deleted file mode 100644 index 06c308e0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/EmptyCatchCommentUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the EmptyCatchComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\EmptyCatchCommentSniff - */ -final class EmptyCatchCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 13 => 1, - 33 => 1, - 49 => 1, - 50 => 1, - 51 => 1, - 52 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc deleted file mode 100644 index 1db2861b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc +++ /dev/null @@ -1,43 +0,0 @@ - -* @author -* @copyright 1997~1994 The PHP Group -* @copyright 1994-1997 The PHP Group -* @copyright The PHP Group -* @license http://www.php.net/license/3_0.txt -* @summary An unknown summary tag -* -*/ - - -?> - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed deleted file mode 100644 index f584c552..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.inc.fixed +++ /dev/null @@ -1,43 +0,0 @@ - -* @author -* @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 2024 Squiz Pty Ltd (ABN 77 084 670 600) -* @license http://www.php.net/license/3_0.txt -* @summary An unknown summary tag -* -*/ - - -?> - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js deleted file mode 100644 index 57d8d37a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js +++ /dev/null @@ -1,40 +0,0 @@ - - - - -/** -* -* 0Multi-line short description without full stop -* -* -* asdasd -* long description for file (if any) -* asdasdadada -* -* PHP versio -* -* LICENSE: This source file is subject to version 3.0 of the PHP license -* that is available through the world-wide-web at the following URI: -* http://www.php.net/license/3_0.txt. If you did not receive a copy of -* the PHP License and are unable to obtain it through the web, please -* send a note to license@php.net so we can mail you a copy immediately. -* @package SquizCMS -* @package ADDITIONAL PACKAGE TAG -* @subpkg not_camelcased -* @author Antônio Carlos Venâncio Júnior -* @author -* @copyright 1997~1994 The PHP Group -* @copyright 1994-1997 The PHP Group -* @copyright The PHP Group -* @license http://www.php.net/license/3_0.txt -* @summary An unknown summary tag -* -*/ - - -/** -* This bit here is not qualified as file comment -* -* as it is not the first comment in the file -* -*/ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed deleted file mode 100644 index c7f54ffd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.1.js.fixed +++ /dev/null @@ -1,40 +0,0 @@ - - - - -/** -* -* 0Multi-line short description without full stop -* -* -* asdasd -* long description for file (if any) -* asdasdadada -* -* PHP versio -* -* LICENSE: This source file is subject to version 3.0 of the PHP license -* that is available through the world-wide-web at the following URI: -* http://www.php.net/license/3_0.txt. If you did not receive a copy of -* the PHP License and are unable to obtain it through the web, please -* send a note to license@php.net so we can mail you a copy immediately. -* @package SquizCMS -* @package ADDITIONAL PACKAGE TAG -* @subpkg not_camelcased -* @author Squiz Pty Ltd -* @author -* @copyright 1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 1994-1997 Squiz Pty Ltd (ABN 77 084 670 600) -* @copyright 2024 Squiz Pty Ltd (ABN 77 084 670 600) -* @license http://www.php.net/license/3_0.txt -* @summary An unknown summary tag -* -*/ - - -/** -* This bit here is not qualified as file comment -* -* as it is not the first comment in the file -* -*/ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc deleted file mode 100644 index 1f82abfe..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.10.inc +++ /dev/null @@ -1,12 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ - -readonly class Foo { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc deleted file mode 100644 index 520d3497..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc +++ /dev/null @@ -1,11 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ - -echo 'hi'; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js deleted file mode 100644 index 4bb4d50d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * File comment. - * - * @package Package - * @subpackage Subpackage - * @author Squiz Pty Ltd - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ - -print 'hi'; \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc deleted file mode 100644 index b47603f2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - * diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc deleted file mode 100644 index 2fdeeba1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.4.inc +++ /dev/null @@ -1,3 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ - -class Foo { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc deleted file mode 100644 index 7074dac2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.7.inc +++ /dev/null @@ -1,12 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ -#[Attribute] -class Foo { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc deleted file mode 100644 index 5ef90f2a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.8.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.9.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.9.inc deleted file mode 100644 index f6c9d996..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.9.inc +++ /dev/null @@ -1,12 +0,0 @@ - - * @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600) - */ - -enum Foo { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php deleted file mode 100644 index d5816bff..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FileComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FileCommentSniff - */ -final class FileCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FileCommentUnitTest.1.inc': - case 'FileCommentUnitTest.1.js': - return [ - 1 => 1, - 22 => 2, - 23 => 1, - 24 => 2, - 25 => 2, - 26 => 1, - 27 => 2, - 28 => 2, - 32 => 2, - ]; - - case 'FileCommentUnitTest.4.inc': - case 'FileCommentUnitTest.6.inc': - case 'FileCommentUnitTest.7.inc': - case 'FileCommentUnitTest.9.inc': - case 'FileCommentUnitTest.10.inc': - return [1 => 1]; - - case 'FileCommentUnitTest.5.inc': - return [2 => 1]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc deleted file mode 100644 index 7e94bb26..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.inc +++ /dev/null @@ -1,511 +0,0 @@ -callSomeFunction(); - - }//end okFunction() - - - /** - * Comment inside function. - * - * @throws Exception - */ - function okFunction() - { - /** - * @var FooClass - */ - $foo = FooFactory::factory(); - throw new Exception; - - }//end okFunction - - /** - * Needs at throws tag for rethrown exception, - * even though we have one throws tag. - * - * @throws PHP_Exception1 - */ - public function notOkVariableRethrown() - { - throw new PHP_Exception1('Error'); - - try { - // Do something. - } catch (PHP_Exception2 $e) { - logError(); - throw $e; - } - - }//end notOkVariableRethrown() - - /** - * Needs at throws tag for rethrown exception, - * even though we have one throws tag. - * - * @throws PHP_Exception1 - */ - public function notOkVariableRethrown() - { - throw new PHP_Exception1('Error'); - - try { - // Do something. - } catch (PHP_Exception1 | PHP_Exception2 $e) { - logError(); - throw $e; - } - - }//end notOkVariableRethrown() - - /** - * Has correct throws tags for all exceptions - * - * @throws PHP_Exception1 - * @throws PHP_Exception2 - */ - public function okVariableRethrown() - { - throw new PHP_Exception1('Error'); - - try { - // Do something. - } catch (PHP_Exception2 $e) { - logError(); - throw $e; - } - - }//end okVariableRethrown() - - /** - * Has correct throws tags for all exceptions - * - * @throws PHP_Exception1 - * @throws PHP_Exception2 - */ - public function okVariableMultiRethrown() - { - try { - // Do something. - } catch (PHP_Exception1 | PHP_Exception2 $e) { - logError(); - throw $e; - } - - }//end okVariableMultiRethrown() -}//end class - -class NamespacedException { - /** - * @throws \Exception - */ - public function foo() { - throw new \Exception(); - } - - /** - * @throws \Foo\Bar\FooBarException - */ - public function fooBar2() { - throw new \Foo\Bar\FooBarException(); - } - - /** - * @throws FooBarException - */ - public function fooBar2() { - throw new \Foo\Bar\FooBarException(); - } -} - -class Foo { - /** - * Comment - */ - public function foo() { - }//end foo() - - public function bar() { - throw new Exception(); - } - - /** - * Returns information for a test. - * - * This info includes parameters, their valid values. - * - * @param integer $projectid Id of the project. - * - * @return array - * @throws ChannelException If the project is invalid. - */ - public static function getTestInfo($projectid=NULL) - { - try { - DAL::beginTransaction(); - DAL::commit(); - } catch (DALException $e) { - DAL::rollBack(); - throw new ChannelException($e); - } - } -} - -class Test -{ - /** - * Folder name. - * - * @var string - */ - protected $folderName; - - protected function setUp() - { - parent::setUp(); - - if ( !strlen($this->folderName) ) { - throw new \RuntimeException('The $this->folderName must be specified before proceeding.'); - } - } - - /* - * - */ - protected function foo() - { - } - - /** - * @return Closure - */ - public function getStuff() - { - return function () { - throw new RuntimeException("bam!"); - }; - } -} - -/** - * Class comment. - */ -class A -{ - /** - * Function B. - */ - public function b() - { - return new class { - public function c() - { - throw new \Exception(); - } - } - } -} - -/** - * Class comment. - */ -class A -{ - /** - * Function B. - */ - public function b() - { - return new class { - /** - * Tag and token number mismatch. - * - * @throws PHP_Exception1 - * @throws PHP_Exception2 - */ - public function oneLessThrowsTagNeeded() - { - throw new PHP_Exception1('Error'); - - }//end oneLessThrowsTagNeeded() - } - } -} - -abstract class SomeClass { - /** - * Comment here. - */ - abstract public function getGroups(); -} - -class SomeClass { - /** - * Validates something. - * - * @param string $method The set method parameter. - * - * @return string The validated method. - * - * @throws Prefix_Invalid_Argument_Exception The invalid argument exception. - * @throws InvalidArgumentException The invalid argument exception. - */ - protected function validate_something( $something ) { - if ( ! Prefix_Validator::is_string( $something ) ) { - throw Prefix_Invalid_Argument_Exception::invalid_string_parameter( $something, 'something' ); - } - - if ( ! in_array( $something, $this->valid_http_something, true ) ) { - throw new InvalidArgumentException( sprintf( '%s is not a valid HTTP something', $something ) ); - } - - return $something; - } - - /** - * Comment - * - * @throws Exception1 Comment. - * @throws Exception2 Comment. - * @throws Exception3 Comment. - */ - public function foo() { - switch ($foo) { - case 1: - throw Exception1::a(); - case 2: - throw Exception1::b(); - case 3: - throw Exception1::c(); - case 4: - throw Exception2::a(); - case 5: - throw Exception2::b(); - default: - throw new Exception3; - - } - } -} - -namespace Test\Admin { - class NameSpacedClass { - /** - * @throws \ExceptionFromGlobalNamespace - */ - public function ExceptionInGlobalNamespace() { - throw new \ExceptionFromGlobalNamespace(); - } - - /** - * @throws ExceptionFromSameNamespace - */ - public function ExceptionInSameNamespace() { - throw new ExceptionFromSameNamespace(); - } - - /** - * @throws \Test\Admin\ExceptionFromSameNamespace - */ - public function ExceptionInSameNamespaceToo() { - throw new ExceptionFromSameNamespace(); - } - - /** - * @throws \Different\NameSpaceName\ExceptionFromDifferentNamespace - */ - public function ExceptionInSameNamespaceToo() { - throw new \Different\NameSpaceName\ExceptionFromDifferentNamespace(); - } - } -} - -namespace { - class GlobalNameSpaceClass { - /** - * @throws SomeGlobalException - */ - public function ThrowGlobalException() { - throw new SomeGlobalException(); - } - - /** - * @throws \SomeGlobalException - */ - public function ThrowGlobalExceptionToo() { - throw new SomeGlobalException(); - } - } -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php deleted file mode 100644 index 178b85a2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentThrowTagUnitTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionCommentThrowTag sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentThrowTagSniff - */ -final class FunctionCommentThrowTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 9 => 1, - 21 => 1, - 35 => 1, - 47 => 1, - 61 => 2, - 106 => 1, - 123 => 1, - 200 => 1, - 219 => 1, - 287 => 1, - 397 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc deleted file mode 100644 index 4fcbb6db..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc +++ /dev/null @@ -1,1160 +0,0 @@ -MyClass) - */ -public function caseSensitive($a1, $a2, $a3, arRay $a4, $a5, $a6, myclas $a7) -{ - -}//end caseSensitive() - - -/** - * More type hint check for custom type and array. - * - * @param array $a1 Comment here. - * @param array $a2 Comment here. - * @param MyClass $a3 Comment here. - * @param MyClass $a4 Comment here. - * - * @return array(int => MyClass) - */ -public function typeHint(MyClass $a1, $a2, myclass $a3, $a4) -{ - return (3 => 'myclass obj'); - -}//end typeHint() - - -/** - * Mixed variable type separated by a '|'. - * - * @param array|string $a1 Comment here. - * @param mixed $a2 Comment here. - * @param string|array $a3 Comment here. - * @param MyClass|int $a4 Comment here. - * - * @return bool - */ -public function mixedType($a1, $a2, $a3, $a4) -{ - return true; - -}//end mixedType() - - -/** - * Array type. - * - * @param array(MyClass) $a1 OK. - * @param array() $a2 Invalid type. - * @param array( $a3 Typo. - * @param array(int) $a4 Use 'array(integer)' instead. - * @param array(int => integer) $a5 Use 'array(integer => integer)' instead. - * @param array(integer => bool) $a6 Use 'array(integer => boolean)' instead. - * @param aRRay $a7 Use 'array' instead. - * @param string $a8 String with unknown type hint. - * - * @return int - */ -public function mixedArrayType($a1, $a2, array $a3, $a4, $a5, $a6, $a7, unknownTypeHint $a8) -{ - return 1; - -}//end mixedArrayType() - - -/** - */ -function empty1() -{ -}//end empty1() - - -/** - * - */ -function empty2() -{ -}//end empty2() - - -/** - * - * - * - */ -function empty3() -{ -}//end empty3 - - -/** - * @return boolean - */ -public function missingShortDescriptionInFunctionComment() -{ - return true; - -}//end missingShortDescriptionInFunctionComment() - - -class Another_Class -{ - - /** - * Destructor should not include a return tag. - * - * @return void - */ - function __destruct() - { - return; - } - - /** - * Constructor should not include a return tag. - * - * @return void - */ - function __construct() - { - return; - } - -}//end class - - -/** - * Comment param alignment test. - * - * @param string $varrr1 Comment1.. - * @param string $vr2 Comment2. - * @param string $var3 Comment3.. - * - * @return void - */ -public static function paramAlign($varrr1, $vr2, $var3) -{ - -}//end paramAlign() - - -/** - * Comment. - * - * @param string $id Comment. - * @param array $design Comment. - * - * @return void - */ -public static function paint($id, array $design) -{ - -}//end paint() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @since 4.0.0 - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - } - -}//end myFunction() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - return; - } - - return 'blah'; - -}//end myFunction() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - } - - return 'blah'; - -}//end myFunction() - -/** - * Test function. - * - * @param string $arg1 An argument - * - * @access public - * @return bool - */ - -echo $blah; - -function myFunction($arg1) {} - -class MyClass() { - /** - * An abstract function. - * - * @return string[] - */ - abstract final protected function myFunction(); -} - -/** - * Comment. - * - * @param mixed $test An argument. - * - * @return mixed - */ -function test($test) -{ - if ($test === TRUE) { - return; - } - - return $test; - -}//end test() - - -/** Comment. - * - * @return mixed - * - */ -function test() -{ - -}//end test() - -/** - * Comment. - * - * @param \other\ns\item $test An argument. - * - * @return mixed - */ -function test(\other\ns\item $test) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param item $test An argument. - * - * @return mixed - */ -function test(\other\ns\item $test) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param \first\ns\item $test An argument. - * - * @return mixed - */ -function test(\first\ns\item $test = \second\ns::CONSTANT) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param \first\item $test An argument. - * - * @return mixed - */ -function test(\first\ns\item $test = \second\ns::CONSTANT) -{ - return $test; - -}//end test() - -// Closures should be ignored. -preg_replace_callback( - '~-([a-z])~', - function ($match) { - return strtoupper($match[1]); - }, - 'hello-world' -); - -$callback = function ($bar) use ($foo) - { - $bar += $foo; - }; - -/** - * Comment should end with '*', not '**' before the slash. - **/ -function test123() { - -} - -/** - * Cant use resource for type hint. - * - * @param resource $test An argument. - * - * @return mixed - */ -function test($test) -{ - return $test; - -}//end test() - -/** - * Variable number of args. - * - * @param string $a1 Comment here. - * @param string $a2 Comment here. - * @param string $a2,... Comment here. - * - * @return boolean - */ -public function variableArgs($a1, $a2) -{ - return true; - -}//end variableArgs() - -/** - * Contains closure. - * - * @return void - */ -public function containsClosure() -{ - function ($e) { - return new Event($e); - }, - -}//end containsClosure() - -/** - * 这是一条测试评论. - * - * @return void - */ -public function test() -{ - -}//end variableArgs() - -/** - * Uses callable. - * - * @param callable $cb Test parameter. - * - * @return void - */ -public function usesCallable(callable $cb) { - $cb(); -}//end usesCallable() - -/** - * Creates a map of tokens => line numbers for each token. - * - * @param array $tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to process this file. - * @param string $eolChar The EOL character - * to use for splitting strings. - * - * @return void - * @throws Exception If something really bad - * happens while doing foo. - */ -public function foo(array &$tokens, $tokenizer, $eolChar) -{ - -}//end foo() - -/** - * Some description. - * - * @param \Vendor\Package\SomeClass $someclass Some class. - * @param \OtherVendor\Package\SomeClass2 $someclass2 Some class. - * @param \OtherVendor\Package\SomeClass2 $someclass3 Some class. - * - * @return void - */ -public function foo(SomeClass $someclass, \OtherVendor\Package\SomeClass2 $someclass2, SomeClass3 $someclass3) -{ -} - -/** - * Gettext. - * - * @return string - */ -public function _() { - return $foo; -} - -class Baz { - /** - * The PHP5 constructor - * - * No return tag - */ - public function __construct() { - - } -} - -/** - * Test - * - * @return void - * @throws E - */ -function myFunction() {} - -/** - * Yield test - * - * @return integer - */ -function yieldTest() -{ - for ($i = 0; $i < 5; $i++) { - yield $i; - } -} - -/** - * Yield test - * - * @return void - */ -function yieldTest() -{ - for ($i = 0; $i < 5; $i++) { - yield $i; - } -} - -/** - * Using "array" as a type hint should satisfy a specified array parameter type. - * - * @param MyClass[] $values An array of MyClass objects. - * - * @return void - */ -public function specifiedArray(array $values) { - -}// end specifiedArray() - -/** - * Using "callable" as a type hint should satisfy a "callback" parameter type. - * - * @param callback $cb A callback. - * - * @return void - */ -public function callableCallback(callable $cb) { - -}// end callableCallback() - -/** - * PHP7 type hints. - * - * @param string $name1 Comment. - * @param integer $name2 Comment. - * @param float $name3 Comment. - * @param boolean $name4 Comment. - * - * @return void - */ -public function myFunction (string $name1, int $name2, float $name3, bool $name4) { -} - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string ...$name2 Comment. - * - * @return void - */ -public function myFunction(string $name1, string ...$name2) { -} - - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string $name2 Comment. - * - * @return void - */ -public function myFunction(string $name1, string ...$name2) { -} - -/** - * Return description function + correct type. - * - * @return integer This is a description. - */ -public function myFunction() { - return 5; -} - -/** - * Return description function + incorrect type. - * - * @return int This is a description. - */ -public function myFunction() { - return 5; -} - -/** - * Return description function + no return. - * - * @return void This is a description. - */ -public function myFunction() { -} - -/** - * Return description function + mixed return. - * - * @return mixed This is a description. - */ -public function myFunction() { -} - -/** - * Function comment. - * - * @param $bar - * Comment here. - * @param ... - * Additional arguments here. - * - * @return - * Return value - * - */ -function foo($bar) { -} - -/** - * Do something. - * - * @return void - */ -public function someFunc(): void -{ - $class = new class - { - /** - * Do something. - * - * @return string - */ - public function getString(): string - { - return 'some string'; - } - }; -} - -/** - * Return description function + mixed return types. - * - * @return bool|int This is a description. - */ -function returnTypeWithDescriptionA() -{ - return 5; - -}//end returnTypeWithDescriptionA() - - -/** - * Return description function + mixed return types. - * - * @return real|bool This is a description. - */ -function returnTypeWithDescriptionB() -{ - return 5; - -}//end returnTypeWithDescriptionB() - - -/** - * Return description function + lots of different mixed return types. - * - * @return int|object|string[]|real|double|float|bool|array(int=>MyClass)|callable And here we have a description - */ -function returnTypeWithDescriptionC() -{ - return 5; - -}//end returnTypeWithDescriptionC() - - -/** - * Return description function + lots of different mixed return types. - * - * @return array(int=>bool)|\OtherVendor\Package\SomeClass2|MyClass[]|void And here we have a description - */ -function returnTypeWithDescriptionD() -{ - -}//end returnTypeWithDescriptionD() - -/** - * Yield from test - * - * @return int[] - */ -function yieldFromTest() -{ - yield from foo(); -} - -/** - * Audio - * - * Generates an audio element to embed sounds - * - * @param mixed $src Either a source string or - * an array of sources. - * @param mixed $unsupportedMessage The message to display - * if the media tag is not supported by the browser. - * @param mixed $attributes HTML attributes. - * @return string - */ -function audio( - $src, - $unsupportedMessage = '', - $attributes = '', -) -{ - return 'test'; -} - -/** - * Test function - * - * @return array - */ -function returnArrayWithClosure() -{ - function () { - return; - }; - - return []; -} - -/** - * Test function - * - * @return array - */ -function returnArrayWithAnonymousClass() -{ - new class { - /** - * @return void - */ - public function test() { - return; - } - }; - - return []; -} - -/** - * @return void - */ -function returnVoidWithClosure() -{ - function () { - return 1; - }; -} - -/** - * @return void - */ -function returnVoidWithAnonymousClass() -{ - new class { - /** - * @return integer - */ - public function test() - { - return 1; - } - }; -} - -class TestReturnVoid -{ - /** - * @return void - */ - public function test() - { - function () { - return 4; - }; - } -} - -/** - * Comment here. - * - * @param integer $a This is A. - * @param ?array $b This is B. - * - * @return void - */ -public static function foo(?int $a, ?array $b) {} - -/** - * Comment here. - * - * @param object $a This is A. - * @param object $b This is B. - * - * @return void - */ -public function foo(object $a, ?object $b) {} - -/** - * Prepares given PHP class method for later code building. - * - * @param integer $foo Comment. - * - Additional comment. - * - * @return void - */ -function foo($foo) {} - -/** - * {@inheritDoc} - */ -public function foo($a, $b) {} - -// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true - -/** - * {@inheritDoc} - */ -public function foo($a, $b) {} - -/** - * Foo. - * - * @param mixed $a Comment. - * - * @return mixed - */ -public function foo(mixed $a): mixed {} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] -class Bar { - /** - * The PHP5 constructor - */ - public function __construct() { - - } -} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] ignored -/** - * Should be ok - */ -public function ignored() { - -} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] __construct,__destruct - -/** - * @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() {} - -/** - * @param $noTypeNoComment - * @return void - */ -function paramVariation1($noTypeNoComment): void {} - -/** - * @param $noTypeWithComment This parameter has no type specified. - * @return void - */ -function paramVariation2($noTypeWithComment): void {} - -/** - * @param integer $hasTypeNoComment - * @return void - */ -function paramVariation3($hasTypeNoComment): void {} - -/** - * @param integer $hasTypehasComment This parameter has type. - * @return void - */ -function paramVariation4($hasTypehasComment): void {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed deleted file mode 100644 index 817630b5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed +++ /dev/null @@ -1,1160 +0,0 @@ - MyClass) - */ -public function caseSensitive($a1, $a2, $a3, arRay $a4, $a5, $a6, myclas $a7) -{ - -}//end caseSensitive() - - -/** - * More type hint check for custom type and array. - * - * @param array $a1 Comment here. - * @param array $a2 Comment here. - * @param MyClass $a3 Comment here. - * @param MyClass $a4 Comment here. - * - * @return array(integer => MyClass) - */ -public function typeHint(MyClass $a1, $a2, myclass $a3, $a4) -{ - return (3 => 'myclass obj'); - -}//end typeHint() - - -/** - * Mixed variable type separated by a '|'. - * - * @param array|string $a1 Comment here. - * @param mixed $a2 Comment here. - * @param string|array $a3 Comment here. - * @param MyClass|integer $a4 Comment here. - * - * @return boolean - */ -public function mixedType($a1, $a2, $a3, $a4) -{ - return true; - -}//end mixedType() - - -/** - * Array type. - * - * @param array(MyClass) $a1 OK. - * @param array $a2 Invalid type. - * @param array $a3 Typo. - * @param array(integer) $a4 Use 'array(integer)' instead. - * @param array(integer => integer) $a5 Use 'array(integer => integer)' instead. - * @param array(integer => boolean) $a6 Use 'array(integer => boolean)' instead. - * @param array $a7 Use 'array' instead. - * @param string $a8 String with unknown type hint. - * - * @return integer - */ -public function mixedArrayType($a1, $a2, array $a3, $a4, $a5, $a6, $a7, unknownTypeHint $a8) -{ - return 1; - -}//end mixedArrayType() - - -/** - */ -function empty1() -{ -}//end empty1() - - -/** - * - */ -function empty2() -{ -}//end empty2() - - -/** - * - * - * - */ -function empty3() -{ -}//end empty3 - - -/** - * @return boolean - */ -public function missingShortDescriptionInFunctionComment() -{ - return true; - -}//end missingShortDescriptionInFunctionComment() - - -class Another_Class -{ - - /** - * Destructor should not include a return tag. - * - * @return void - */ - function __destruct() - { - return; - } - - /** - * Constructor should not include a return tag. - * - * @return void - */ - function __construct() - { - return; - } - -}//end class - - -/** - * Comment param alignment test. - * - * @param string $varrr1 Comment1.. - * @param string $vr2 Comment2. - * @param string $var3 Comment3.. - * - * @return void - */ -public static function paramAlign($varrr1, $vr2, $var3) -{ - -}//end paramAlign() - - -/** - * Comment. - * - * @param string $id Comment. - * @param array $design Comment. - * - * @return void - */ -public static function paint($id, array $design) -{ - -}//end paint() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @since 4.0.0 - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - } - -}//end myFunction() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - return; - } - - return 'blah'; - -}//end myFunction() - - -/** - * Adds specified class name to class attribute of this widget. - * - * @return string - */ -public function myFunction() -{ - if ($condition === FALSE) { - echo 'hi'; - } - - return 'blah'; - -}//end myFunction() - -/** - * Test function. - * - * @param string $arg1 An argument - * - * @access public - * @return bool - */ - -echo $blah; - -function myFunction($arg1) {} - -class MyClass() { - /** - * An abstract function. - * - * @return string[] - */ - abstract final protected function myFunction(); -} - -/** - * Comment. - * - * @param mixed $test An argument. - * - * @return mixed - */ -function test($test) -{ - if ($test === TRUE) { - return; - } - - return $test; - -}//end test() - - -/** Comment. - * - * @return mixed - * - */ -function test() -{ - -}//end test() - -/** - * Comment. - * - * @param \other\ns\item $test An argument. - * - * @return mixed - */ -function test(\other\ns\item $test) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param item $test An argument. - * - * @return mixed - */ -function test(\other\ns\item $test) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param \first\ns\item $test An argument. - * - * @return mixed - */ -function test(\first\ns\item $test = \second\ns::CONSTANT) -{ - return $test; - -}//end test() - -/** - * Comment. - * - * @param \first\item $test An argument. - * - * @return mixed - */ -function test(\first\ns\item $test = \second\ns::CONSTANT) -{ - return $test; - -}//end test() - -// Closures should be ignored. -preg_replace_callback( - '~-([a-z])~', - function ($match) { - return strtoupper($match[1]); - }, - 'hello-world' -); - -$callback = function ($bar) use ($foo) - { - $bar += $foo; - }; - -/** - * Comment should end with '*', not '**' before the slash. - **/ -function test123() { - -} - -/** - * Cant use resource for type hint. - * - * @param resource $test An argument. - * - * @return mixed - */ -function test($test) -{ - return $test; - -}//end test() - -/** - * Variable number of args. - * - * @param string $a1 Comment here. - * @param string $a2 Comment here. - * @param string $a2,... Comment here. - * - * @return boolean - */ -public function variableArgs($a1, $a2) -{ - return true; - -}//end variableArgs() - -/** - * Contains closure. - * - * @return void - */ -public function containsClosure() -{ - function ($e) { - return new Event($e); - }, - -}//end containsClosure() - -/** - * 这是一条测试评论. - * - * @return void - */ -public function test() -{ - -}//end variableArgs() - -/** - * Uses callable. - * - * @param callable $cb Test parameter. - * - * @return void - */ -public function usesCallable(callable $cb) { - $cb(); -}//end usesCallable() - -/** - * Creates a map of tokens => line numbers for each token. - * - * @param array $tokens The array of tokens to process. - * @param object $tokenizer The tokenizer being used to process this file. - * @param string $eolChar The EOL character - * to use for splitting strings. - * - * @return void - * @throws Exception If something really bad - * happens while doing foo. - */ -public function foo(array &$tokens, $tokenizer, $eolChar) -{ - -}//end foo() - -/** - * Some description. - * - * @param \Vendor\Package\SomeClass $someclass Some class. - * @param \OtherVendor\Package\SomeClass2 $someclass2 Some class. - * @param \OtherVendor\Package\SomeClass2 $someclass3 Some class. - * - * @return void - */ -public function foo(SomeClass $someclass, \OtherVendor\Package\SomeClass2 $someclass2, SomeClass3 $someclass3) -{ -} - -/** - * Gettext. - * - * @return string - */ -public function _() { - return $foo; -} - -class Baz { - /** - * The PHP5 constructor - * - * No return tag - */ - public function __construct() { - - } -} - -/** - * Test - * - * @return void - * @throws E - */ -function myFunction() {} - -/** - * Yield test - * - * @return integer - */ -function yieldTest() -{ - for ($i = 0; $i < 5; $i++) { - yield $i; - } -} - -/** - * Yield test - * - * @return void - */ -function yieldTest() -{ - for ($i = 0; $i < 5; $i++) { - yield $i; - } -} - -/** - * Using "array" as a type hint should satisfy a specified array parameter type. - * - * @param MyClass[] $values An array of MyClass objects. - * - * @return void - */ -public function specifiedArray(array $values) { - -}// end specifiedArray() - -/** - * Using "callable" as a type hint should satisfy a "callback" parameter type. - * - * @param callback $cb A callback. - * - * @return void - */ -public function callableCallback(callable $cb) { - -}// end callableCallback() - -/** - * PHP7 type hints. - * - * @param string $name1 Comment. - * @param integer $name2 Comment. - * @param float $name3 Comment. - * @param boolean $name4 Comment. - * - * @return void - */ -public function myFunction (string $name1, int $name2, float $name3, bool $name4) { -} - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string ...$name2 Comment. - * - * @return void - */ -public function myFunction(string $name1, string ...$name2) { -} - - -/** - * Variadic function. - * - * @param string $name1 Comment. - * @param string $name2 Comment. - * - * @return void - */ -public function myFunction(string $name1, string ...$name2) { -} - -/** - * Return description function + correct type. - * - * @return integer This is a description. - */ -public function myFunction() { - return 5; -} - -/** - * Return description function + incorrect type. - * - * @return integer This is a description. - */ -public function myFunction() { - return 5; -} - -/** - * Return description function + no return. - * - * @return void This is a description. - */ -public function myFunction() { -} - -/** - * Return description function + mixed return. - * - * @return mixed This is a description. - */ -public function myFunction() { -} - -/** - * Function comment. - * - * @param $bar - * Comment here. - * @param ... - * Additional arguments here. - * - * @return - * Return value - * - */ -function foo($bar) { -} - -/** - * Do something. - * - * @return void - */ -public function someFunc(): void -{ - $class = new class - { - /** - * Do something. - * - * @return string - */ - public function getString(): string - { - return 'some string'; - } - }; -} - -/** - * Return description function + mixed return types. - * - * @return boolean|integer This is a description. - */ -function returnTypeWithDescriptionA() -{ - return 5; - -}//end returnTypeWithDescriptionA() - - -/** - * Return description function + mixed return types. - * - * @return float|boolean This is a description. - */ -function returnTypeWithDescriptionB() -{ - return 5; - -}//end returnTypeWithDescriptionB() - - -/** - * Return description function + lots of different mixed return types. - * - * @return integer|object|string[]|float|boolean|array(integer => MyClass)|callable And here we have a description - */ -function returnTypeWithDescriptionC() -{ - return 5; - -}//end returnTypeWithDescriptionC() - - -/** - * Return description function + lots of different mixed return types. - * - * @return array(integer => boolean)|\OtherVendor\Package\SomeClass2|MyClass[]|void And here we have a description - */ -function returnTypeWithDescriptionD() -{ - -}//end returnTypeWithDescriptionD() - -/** - * Yield from test - * - * @return int[] - */ -function yieldFromTest() -{ - yield from foo(); -} - -/** - * Audio - * - * Generates an audio element to embed sounds - * - * @param mixed $src Either a source string or - * an array of sources. - * @param mixed $unsupportedMessage The message to display - * if the media tag is not supported by the browser. - * @param mixed $attributes HTML attributes. - * @return string - */ -function audio( - $src, - $unsupportedMessage = '', - $attributes = '', -) -{ - return 'test'; -} - -/** - * Test function - * - * @return array - */ -function returnArrayWithClosure() -{ - function () { - return; - }; - - return []; -} - -/** - * Test function - * - * @return array - */ -function returnArrayWithAnonymousClass() -{ - new class { - /** - * @return void - */ - public function test() { - return; - } - }; - - return []; -} - -/** - * @return void - */ -function returnVoidWithClosure() -{ - function () { - return 1; - }; -} - -/** - * @return void - */ -function returnVoidWithAnonymousClass() -{ - new class { - /** - * @return integer - */ - public function test() - { - return 1; - } - }; -} - -class TestReturnVoid -{ - /** - * @return void - */ - public function test() - { - function () { - return 4; - }; - } -} - -/** - * Comment here. - * - * @param integer $a This is A. - * @param array $b This is B. - * - * @return void - */ -public static function foo(?int $a, ?array $b) {} - -/** - * Comment here. - * - * @param object $a This is A. - * @param object $b This is B. - * - * @return void - */ -public function foo(object $a, ?object $b) {} - -/** - * Prepares given PHP class method for later code building. - * - * @param integer $foo Comment. - * - Additional comment. - * - * @return void - */ -function foo($foo) {} - -/** - * {@inheritDoc} - */ -public function foo($a, $b) {} - -// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true - -/** - * {@inheritDoc} - */ -public function foo($a, $b) {} - -/** - * Foo. - * - * @param mixed $a Comment. - * - * @return mixed - */ -public function foo(mixed $a): mixed {} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] -class Bar { - /** - * The PHP5 constructor - */ - public function __construct() { - - } -} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] ignored -/** - * Should be ok - */ -public function ignored() { - -} - -// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] __construct,__destruct - -/** - * @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() {} - -/** - * @param $noTypeNoComment - * @return void - */ -function paramVariation1($noTypeNoComment): void {} - -/** - * @param $noTypeWithComment This parameter has no type specified. - * @return void - */ -function paramVariation2($noTypeWithComment): void {} - -/** - * @param integer $hasTypeNoComment - * @return void - */ -function paramVariation3($hasTypeNoComment): void {} - -/** - * @param integer $hasTypehasComment This parameter has type. - * @return void - */ -function paramVariation4($hasTypehasComment): void {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php deleted file mode 100644 index 036bdc62..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php +++ /dev/null @@ -1,208 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff - */ -final class FunctionCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 5 => 1, - 10 => 3, - 12 => 2, - 13 => 2, - 14 => 1, - 15 => 1, - 28 => 1, - 43 => 1, - 76 => 1, - 87 => 1, - 103 => 1, - 109 => 1, - 112 => 1, - 122 => 1, - 123 => 3, - 124 => 2, - 125 => 1, - 126 => 1, - 137 => 4, - 138 => 4, - 139 => 4, - 143 => 2, - 155 => 1, - 159 => 1, - 166 => 1, - 173 => 1, - 183 => 1, - 190 => 2, - 193 => 2, - 196 => 1, - 199 => 2, - 210 => 1, - 211 => 1, - 222 => 1, - 223 => 1, - 224 => 1, - 225 => 1, - 226 => 1, - 227 => 1, - 230 => 2, - 232 => 2, - 246 => 1, - 248 => 4, - 261 => 1, - 263 => 1, - 276 => 1, - 277 => 1, - 278 => 1, - 279 => 1, - 280 => 1, - 281 => 1, - 284 => 1, - 286 => 7, - 294 => 1, - 302 => 1, - 312 => 1, - 358 => 1, - 359 => 2, - 372 => 1, - 373 => 1, - 387 => 1, - 407 => 1, - 441 => 1, - 500 => 1, - 526 => 1, - 548 => 1, - 641 => 1, - 669 => 1, - 688 => 1, - 744 => 1, - 748 => 1, - 767 => 1, - 789 => 1, - 792 => 1, - 794 => 1, - 797 => 1, - 828 => 1, - 840 => 1, - 852 => 1, - 864 => 1, - 886 => 1, - 888 => 1, - 890 => 1, - 978 => 1, - 997 => 1, - 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, - 1138 => 1, - 1139 => 1, - 1144 => 1, - 1145 => 1, - 1151 => 1, - ]; - - // Scalar type hints only work from PHP 7 onwards. - if (PHP_VERSION_ID >= 70000) { - $errors[17] = 3; - $errors[128] = 1; - $errors[143] = 3; - $errors[161] = 2; - $errors[201] = 1; - $errors[232] = 7; - $errors[363] = 3; - $errors[377] = 1; - $errors[575] = 2; - $errors[627] = 1; - $errors[1002] = 1; - $errors[1075] = 6; - $errors[1089] = 3; - $errors[1107] = 8; - $errors[1129] = 3; - $errors[1154] = 1; - $errors[1160] = 1; - } 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) { - $errors[627] = 2; - } else { - $errors[992] = 2; - } - - // Mixed type hints only work from PHP 8.0 onwards. - if (PHP_VERSION_ID >= 80000) { - $errors[265] = 1; - $errors[459] = 1; - $errors[893] = 3; - } else { - $errors[1023] = 1; - } - - return $errors; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc deleted file mode 100644 index 02487684..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc +++ /dev/null @@ -1,196 +0,0 @@ - One -// -> One.One -// -> Two - -/* - Here is some inline example code: - -> One - -> One.One - -> Two -*/ - -/** - * Comment should be ignored in PHP 5.4. - * - */ -trait MyTrait { - -} - -$foo = 'foo'; // Var set to foo. - -echo $foo; - -// Comment here. -echo $foo; - -/** - * Comments about the include - */ -include_once($blah); - -// some comment without capital or full stop -echo $foo; // An unrelated comment. - -// An unrelated comment. -echo $foo; // some comment without capital or full stop - -class Foo -{ - // This is fine. - - /** - * Spacing is ignored above. - */ - function bar(){} -} - -if ($foo) { -}//end if -// Another comment here. -$foo++; - -if ($foo) { -}//end if -// another comment here. -$foo++; - -/** - * Comment should be ignored, even though there is an attribute between the docblock and the class declaration. - */ - -#[AttributeA] - -final class MyClass -{ - /** - * Comment should be ignored, even though there is an attribute between the docblock and the function declaration - */ - #[AttributeA] - #[AttributeB] - final public function test() {} -} - -/** - * Comment should be ignored. - * - */ -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 - * token in a file, does *not* throw an error as this would conflict with the common - * "new line required at end of file" rule. - */ - -// For this test line having an empty line below it, is fine. diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed deleted file mode 100644 index 949a9ff9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.inc.fixed +++ /dev/null @@ -1,189 +0,0 @@ - One -// -> One.One -// -> Two -/* - Here is some inline example code: - -> One - -> One.One - -> Two -*/ - -/** - * Comment should be ignored in PHP 5.4. - * - */ -trait MyTrait { - -} - -$foo = 'foo'; // Var set to foo. - -echo $foo; - -// Comment here. -echo $foo; - -/** - * Comments about the include - */ -include_once($blah); - -// some comment without capital or full stop -echo $foo; // An unrelated comment. - -// An unrelated comment. -echo $foo; // some comment without capital or full stop - -class Foo -{ - // This is fine. - - /** - * Spacing is ignored above. - */ - function bar(){} -} - -if ($foo) { -}//end if -// Another comment here. -$foo++; - -if ($foo) { -}//end if -// another comment here. -$foo++; - -/** - * Comment should be ignored, even though there is an attribute between the docblock and the class declaration. - */ - -#[AttributeA] - -final class MyClass -{ - /** - * Comment should be ignored, even though there is an attribute between the docblock and the function declaration - */ - #[AttributeA] - #[AttributeB] - final public function test() {} -} - -/** - * Comment should be ignored. - * - */ -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 - * token in a file, does *not* throw an error as this would conflict with the common - * "new line required at end of file" rule. - */ - -// For this test line having an empty line below it, is fine. diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js deleted file mode 100644 index 6b1093e6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js +++ /dev/null @@ -1,129 +0,0 @@ -// Some content here. -var code = 'hello'; - -// This comment contains # multiple -// hash signs (#). -code = 'hello'; - -/** - * This is the first line of a function comment. - * This is the second line. - */ -function testFunction() -{ - // Callback methods which are added by external objects. - this.callbacks = {}; - -}//end testFunction() - -/** - * This is the first line of a class comment. - * This is the second line. - */ -myClass.prototype = { - - /** - * This is the first line of a method comment. - * This is the second line. - */ - load: function(url, callback) - { - // Some code here. - - } -}; - -// some code goes here! - -/* - A longer comment goes here. - It spans multiple lines!! - Or does it? -*/ - -// 0This is a simple multi-line -// comment! -code = 'hello'; - -//This is not valid. -code = 'hello'; - -// Neither is this! -code = 'hello'; - -// -code = 'hello'; - -/** Neither is this! **/ -code = 'hello'; - -/** - * This is the first line of a function comment. - * This is the second line. - */ -var myFunction = function() { -} - -/** - * This is the first line of a function comment. - * This is the second line. - */ -myFunction = function() { -} - -/** - * This is the first line of a function comment. - * This is the second line. - */ -myClass.myFunction = function() { -} - -dfx.getIframeDocument = function(iframe) -{ - return doc; - -};//end dfx.getIframeDocument() - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -// Here is some inline example code: -// -> One -// -> One.One -// -> Two - -/* - Here is some inline example code: - -> One - -> One.One - -> Two -*/ - - -var foo = 'foo'; // Var set to foo. - -console.info(foo); - -// Comment here. -console.info(foo); - -//** -* invalid comment -*/ - -// some comment without capital or full stop -console.log(foo); // An unrelated comment. - -// An unrelated comment. -console.log(foo); // some comment without capital or full stop diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed deleted file mode 100644 index 20e5041e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed +++ /dev/null @@ -1,125 +0,0 @@ -// Some content here. -var code = 'hello'; - -// This comment contains # multiple -// hash signs (#). -code = 'hello'; - -/** - * This is the first line of a function comment. - * This is the second line. - */ -function testFunction() -{ - // Callback methods which are added by external objects. - this.callbacks = {}; - -}//end testFunction() - -/** - * This is the first line of a class comment. - * This is the second line. - */ -myClass.prototype = { - - /** - * This is the first line of a method comment. - * This is the second line. - */ - load: function(url, callback) - { - // Some code here. - } -}; - -// some code goes here! -/* - A longer comment goes here. - It spans multiple lines!! - Or does it? -*/ - -// 0This is a simple multi-line -// comment! -code = 'hello'; - -// This is not valid. -code = 'hello'; - -// Neither is this! -code = 'hello'; - -code = 'hello'; - -/** Neither is this! **/ -code = 'hello'; - -/** - * This is the first line of a function comment. - * This is the second line. - */ -var myFunction = function() { -} - -/** - * This is the first line of a function comment. - * This is the second line. - */ -myFunction = function() { -} - -/** - * This is the first line of a function comment. - * This is the second line. - */ -myClass.myFunction = function() { -} - -dfx.getIframeDocument = function(iframe) -{ - return doc; - -};//end dfx.getIframeDocument() - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -// Here is some inline example code: -// -> One -// -> One.One -// -> Two -/* - Here is some inline example code: - -> One - -> One.One - -> Two -*/ - - -var foo = 'foo'; // Var set to foo. - -console.info(foo); - -// Comment here. -console.info(foo); - -// ** -* invalid comment -*/ - -// some comment without capital or full stop -console.log(foo); // An unrelated comment. - -// An unrelated comment. -console.log(foo); // some comment without capital or full stop diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php deleted file mode 100644 index c559c5ae..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the InlineComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\InlineCommentSniff - */ -final class InlineCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'InlineCommentUnitTest.inc': - $errors = [ - 17 => 1, - 27 => 1, - 28 => 1, - 32 => 2, - 36 => 1, - 44 => 2, - 58 => 1, - 61 => 1, - 64 => 1, - 67 => 1, - 95 => 1, - 96 => 1, - 97 => 3, - 118 => 1, - 126 => 2, - 130 => 2, - 149 => 1, - ]; - - return $errors; - case 'InlineCommentUnitTest.js': - return [ - 31 => 1, - 36 => 2, - 48 => 1, - 51 => 1, - 54 => 1, - 57 => 1, - 102 => 1, - 103 => 1, - 104 => 3, - 118 => 1, - 121 => 1, - 125 => 2, - 129 => 2, - ]; - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc deleted file mode 100644 index d6c4cf6c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc +++ /dev/null @@ -1,1033 +0,0 @@ - match ($foo) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 - }, -]; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed deleted file mode 100644 index 176cfe24..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc.fixed +++ /dev/null @@ -1,1033 +0,0 @@ - match ($foo) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 - },//end match -]; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js deleted file mode 100644 index c0cf2821..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js +++ /dev/null @@ -1,444 +0,0 @@ -function long_function() -{ - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } else { - // Short ELSE - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } else { - // Short ELSE - } -} - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end for - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - for (val =1; val < 20; val++) { - // Short for. - } - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end while - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - while (something) { - // Short while. - } - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} - -if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } -} //end if - -if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } -} else { - // Short ELSE -} //end if - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} //end for - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} //end while - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end for - -if (true) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} else if (condition) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} else { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end if - -if (something) { - // Line 1 - // Line 2 -} else if (somethingElse) { - // Line 1 - // Line 2 -} else { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} - -switch (something) { - case '1': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '2': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '3': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '4': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '5': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; -} - -// Wrong comment -if (condition) { - condition = true; -}//end foreach diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed deleted file mode 100644 index 231b51c5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js.fixed +++ /dev/null @@ -1,444 +0,0 @@ -function long_function() -{ - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } else { - // Short ELSE - }//end if - - if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } - } else { - // Short ELSE - }//end if -} - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end for - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - for (val =1; val < 20; val++) { - // Short for. - } - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end for - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end while - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - while (something) { - // Short while. - } - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end while - -if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } -} //end if - -if (longFunction) { - // This is a long - // IF statement - // that does - // not have - // an ELSE - // block on it - variable = 'hello'; - - if (variable === 'hello') { - // This is a short - // IF statement - } - - if (variable === 'hello') { - // This is a short - // IF statement - } else { - // This is a short ELSE - // statement - } -} else { - // Short ELSE -} //end if - -for (variable=1; variable < 20; variable++) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} //end for - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} //end while - -while (variable < 20) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end while - -if (true) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} else if (condition) { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -} else { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end if - -if (something) { - // Line 1 - // Line 2 -} else if (somethingElse) { - // Line 1 - // Line 2 -} else { - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - // Line 6 - // Line 7 - // Line 8 - // Line 9 - // Line 10 - // Line 11 - // Line 12 - // Line 13 - // Line 14 - // Line 15 - // Line 16 - // Line 17 - // Line 18 - // Line 19 - // Line 20 -}//end if - -switch (something) { - case '1': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '2': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '3': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '4': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; - case '5': - // Line 1 - // Line 2 - // Line 3 - // Line 4 - // Line 5 - break; -}//end switch - -// Wrong comment -if (condition) { - condition = true; -}//end if diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php deleted file mode 100644 index e2a0f7b0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LongConditionClosingComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\LongConditionClosingCommentSniff - */ -final class LongConditionClosingCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'LongConditionClosingCommentUnitTest.inc': - return [ - 49 => 1, - 99 => 1, - 146 => 1, - 192 => 1, - 215 => 1, - 238 => 1, - 261 => 1, - 286 => 1, - 309 => 1, - 332 => 1, - 355 => 1, - 378 => 1, - 493 => 1, - 531 => 1, - 536 => 1, - 540 => 1, - 562 => 1, - 601 => 1, - 629 => 1, - 663 => 1, - 765 => 1, - 798 => 1, - 811 => 1, - 897 => 1, - 931 => 1, - 962 => 1, - 985 => 2, - 1008 => 1, - 1032 => 1, - ]; - - case 'LongConditionClosingCommentUnitTest.js': - return [ - 47 => 1, - 97 => 1, - 144 => 1, - 190 => 1, - 213 => 1, - 238 => 1, - 261 => 1, - 284 => 1, - 307 => 1, - 401 => 1, - 439 => 1, - 444 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js deleted file mode 100644 index 6de64210..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js +++ /dev/null @@ -1,36 +0,0 @@ -function test(id, buttons) // cool function -{ - alert('hello'); - alert('hello again'); // And again. - // Valid comment. - -}//end test() - -var good = true; // Indeed. - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -dfx.getIframeDocument = function(iframe) -{ - - return doc; - -};//end dfx.getIframeDocument() - -// Verify that multi-line control structure with comments and annotations are left alone. -if (condition // comment - && anotherCondition) { - condition = true; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed deleted file mode 100644 index 1953760d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js.fixed +++ /dev/null @@ -1,39 +0,0 @@ -function test(id, buttons) -// cool function -{ - alert('hello'); - alert('hello again'); -// And again. - // Valid comment. - -}//end test() - -var good = true; -// Indeed. - -mig.Gallery.prototype = { - - init: function(cb) - { - - },//end init() - - imageClicked: function(id) - { - - }//end imageClicked() - -}; - -dfx.getIframeDocument = function(iframe) -{ - - return doc; - -};//end dfx.getIframeDocument() - -// Verify that multi-line control structure with comments and annotations are left alone. -if (condition // comment - && anotherCondition) { - condition = true; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js deleted file mode 100644 index 88d0e7d4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.2.js +++ /dev/null @@ -1,2 +0,0 @@ -// Comment as first thing in a JS file. -var i = 100; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc deleted file mode 100644 index b8346961..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc +++ /dev/null @@ -1,54 +0,0 @@ - function($b) { - }, // comment. - 'key' => 'value', // phpcs:ignore Standard.Category.SniffName -- for reasons. - 'key' => 'value', // comment. -]; - -// Verify that multi-line control structure with comments and annotations are left alone. -for ( - $i = 0; /* Start */ - $i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ - $i++ // comment - -) {} - -if ( $condition === true // comment - && $anotherCondition === false -) {} - -$match = match($foo // comment - && $bar -) { - 1 => 1, // comment -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed deleted file mode 100644 index 21a4bbe0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.inc.fixed +++ /dev/null @@ -1,59 +0,0 @@ - function($b) { - }, // comment. - 'key' => 'value', // phpcs:ignore Standard.Category.SniffName -- for reasons. - 'key' => 'value', -// comment. -]; - -// Verify that multi-line control structure with comments and annotations are left alone. -for ( - $i = 0; /* Start */ - $i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ - $i++ // comment - -) {} - -if ( $condition === true // comment - && $anotherCondition === false -) {} - -$match = match($foo // comment - && $bar -) { - 1 => 1, -// comment -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php deleted file mode 100644 index b9751f61..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the PostStatementComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\PostStatementCommentSniff - */ -final class PostStatementCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'PostStatementCommentUnitTest.inc': - return [ - 6 => 1, - 10 => 1, - 18 => 1, - 35 => 1, - 53 => 1, - ]; - - case 'PostStatementCommentUnitTest.1.js': - return [ - 1 => 1, - 4 => 1, - 9 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc deleted file mode 100644 index 54ef5d2d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc +++ /dev/null @@ -1,456 +0,0 @@ - $content) { - echo $content; - } - - return $var1; - - }//end checkVariable() - - - /** - * - * - */ - $emptyVarDoc = ''; - - /** - * Var type checking (int v.s. integer). - * - * @var int - */ - private $_varSimpleTypeCheck; - - - /** - * Var type checking (array(int => string) v.s. array(int => string)). - * - * @var array(int => string) - */ - private $_varArrayTypeCheck; - - - /** - * Boolean @var tag Capitalized - * - * @var Boolean - */ - public $CapBoolTag = true; - - - /** - * Boolean @var tag Capitalized - * - * @var BOOLEAN - */ - public $CapBoolTag2 = true; - - - /** - * Double @var tag Capitalized - * - * @var Double - */ - public $CapDoubleTag = 1; - - - /** - * Double @var tag Capitalized - * - * @var DOUBLE - */ - public $CapDoubleTag2 = 1; - - - /** - * Real @var tag Capitalized - * - * @var Real - */ - public $CapRealTag = 1; - - - /** - * Real @var tag Capitalized - * - * @var REAL - */ - public $CapRealTag2 = 1; - - - /** - * Float @var tag Capitalized - * - * @var Float - */ - public $CapFloatTag = 1; - - - /** - * Float @var tag Capitalized - * - * @var FLOAT - */ - public $CapFloatTag2 = 1; - - - /** - * Int @var tag Capitalized - * - * @var Int - */ - public $CapIntTag = 1; - - - /** - * Int @var tag Capitalized - * - * @var INT - */ - public $CapIntTag2 = 1; - - - /** - * Integer @var tag Capitalized - * - * @var Integer - */ - public $CapIntTag3 = 1; - - - /** - * Integer @var tag Capitalized - * - * @var INTEGER - */ - public $CapIntTag4 = 1; - - - /** - * Array @var tag Capitalized - * - * @var Array - */ - public $CapVarTag = []; - - - /** - * Array @var tag All Caps - * - * @var ARRAY - */ - public $CapVarTag2 = []; - - - /** - * Array @var tag Capitalized - * - * @var Array() - */ - public $CapVarTag3 = []; - - - /** - * Array @var tag All Caps - * - * @var ARRAY() - */ - public $CapVarTag4 = []; - - - /** - * Var type checking (STRING v.s. string). - * - * @var STRING - */ - private $_varCaseTypeCheck; - - - /** - * @var integer - */ - private $_varWithNoShortComment; - - protected $noComment2 = ''; - - - /** - * @var int Var type checking (int v.s. integer) with single-line comment. - */ - private $_varSimpleTypeCheckSingleLine; - - -}//end class - - -/** - * VariableCommentUnitTest2. - * - * Long description goes here. - * - */ -class VariableCommentUnitTest2 -{ - - public $hello; - - /** Comment starts here. - * - * @var string - * - */ - private $_varCaseTypeCheck; - - /** - * 这是一条测试评论. - * - * @var string - */ - public $foo; - -}//end class - - -/* - * Class comment - */ -class Foo -{ - - protected $bar; - - /** - * Short description of the member variable. - * - * @var array - */ - public static array $variableName = array(); - -} - -class Foo -{ - - /** - * Short description of the member variable. - * - * @var array - */ - public array $variableName = array(); - - - // Not "/**" style comment. - // - // @var string - private ?Folder\ClassName $_incorrectCommentStyle = null; - - - var int $noComment = 1; - } - -class HasAttributes -{ - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\Id]#[ORM\Column("integer")] - private $id; - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\GeneratedValue] - #[ORM\Column(ORM\Column::T_INTEGER)] - protected $height; -} - -class ReadOnlyProps -{ - /** - * Short description of the member variable. - * - * @var array - */ - public readonly array $variableName = array(); - - /** - * Short description of the member variable. - * - * @var - */ - readonly protected ?int $variableName = 10; - - private readonly string $variable; -} - -class UnionTypes -{ - /** - * @var array|boolean - */ - private array|bool $variableName = array(); -} - -class IntersectionTypes -{ - /** - * @var \Iterator|\Countable - */ - private \Iterator&\Countable $variableName; -} - -class StandaloneNullTrueFalseTypes -{ - /** - * @var null - */ - public null $variableName = null; - - /** - * @var true - */ - protected true $variableName = true; - - /** - * @var false - */ - private false $variableName = false; -} - -class MoreMissingButSupportedTypes -{ - /** - * @var parent - */ - public parent $variableName; - - /** - * @var self - */ - protected self $variableName; - - /** - * @var SomeClass - */ - private namespace\SomeClass $variableName; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed deleted file mode 100644 index a292b6de..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed +++ /dev/null @@ -1,456 +0,0 @@ - $content) { - echo $content; - } - - return $var1; - - }//end checkVariable() - - - /** - * - * - */ - $emptyVarDoc = ''; - - /** - * Var type checking (int v.s. integer). - * - * @var integer - */ - private $_varSimpleTypeCheck; - - - /** - * Var type checking (array(int => string) v.s. array(int => string)). - * - * @var array(integer => string) - */ - private $_varArrayTypeCheck; - - - /** - * Boolean @var tag Capitalized - * - * @var boolean - */ - public $CapBoolTag = true; - - - /** - * Boolean @var tag Capitalized - * - * @var boolean - */ - public $CapBoolTag2 = true; - - - /** - * Double @var tag Capitalized - * - * @var float - */ - public $CapDoubleTag = 1; - - - /** - * Double @var tag Capitalized - * - * @var float - */ - public $CapDoubleTag2 = 1; - - - /** - * Real @var tag Capitalized - * - * @var float - */ - public $CapRealTag = 1; - - - /** - * Real @var tag Capitalized - * - * @var float - */ - public $CapRealTag2 = 1; - - - /** - * Float @var tag Capitalized - * - * @var float - */ - public $CapFloatTag = 1; - - - /** - * Float @var tag Capitalized - * - * @var float - */ - public $CapFloatTag2 = 1; - - - /** - * Int @var tag Capitalized - * - * @var integer - */ - public $CapIntTag = 1; - - - /** - * Int @var tag Capitalized - * - * @var integer - */ - public $CapIntTag2 = 1; - - - /** - * Integer @var tag Capitalized - * - * @var integer - */ - public $CapIntTag3 = 1; - - - /** - * Integer @var tag Capitalized - * - * @var integer - */ - public $CapIntTag4 = 1; - - - /** - * Array @var tag Capitalized - * - * @var array - */ - public $CapVarTag = []; - - - /** - * Array @var tag All Caps - * - * @var array - */ - public $CapVarTag2 = []; - - - /** - * Array @var tag Capitalized - * - * @var array - */ - public $CapVarTag3 = []; - - - /** - * Array @var tag All Caps - * - * @var array - */ - public $CapVarTag4 = []; - - - /** - * Var type checking (STRING v.s. string). - * - * @var string - */ - private $_varCaseTypeCheck; - - - /** - * @var integer - */ - private $_varWithNoShortComment; - - protected $noComment2 = ''; - - - /** - * @var integer Var type checking (int v.s. integer) with single-line comment. - */ - private $_varSimpleTypeCheckSingleLine; - - -}//end class - - -/** - * VariableCommentUnitTest2. - * - * Long description goes here. - * - */ -class VariableCommentUnitTest2 -{ - - public $hello; - - /** Comment starts here. - * - * @var string - * - */ - private $_varCaseTypeCheck; - - /** - * 这是一条测试评论. - * - * @var string - */ - public $foo; - -}//end class - - -/* - * Class comment - */ -class Foo -{ - - protected $bar; - - /** - * Short description of the member variable. - * - * @var array - */ - public static array $variableName = array(); - -} - -class Foo -{ - - /** - * Short description of the member variable. - * - * @var array - */ - public array $variableName = array(); - - - // Not "/**" style comment. - // - // @var string - private ?Folder\ClassName $_incorrectCommentStyle = null; - - - var int $noComment = 1; - } - -class HasAttributes -{ - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\Id]#[ORM\Column("integer")] - private $id; - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\GeneratedValue] - #[ORM\Column(ORM\Column::T_INTEGER)] - protected $height; -} - -class ReadOnlyProps -{ - /** - * Short description of the member variable. - * - * @var array - */ - public readonly array $variableName = array(); - - /** - * Short description of the member variable. - * - * @var - */ - readonly protected ?int $variableName = 10; - - private readonly string $variable; -} - -class UnionTypes -{ - /** - * @var array|boolean - */ - private array|bool $variableName = array(); -} - -class IntersectionTypes -{ - /** - * @var \Iterator|\Countable - */ - private \Iterator&\Countable $variableName; -} - -class StandaloneNullTrueFalseTypes -{ - /** - * @var null - */ - public null $variableName = null; - - /** - * @var true - */ - protected true $variableName = true; - - /** - * @var false - */ - private false $variableName = false; -} - -class MoreMissingButSupportedTypes -{ - /** - * @var parent - */ - public parent $variableName; - - /** - * @var self - */ - protected self $variableName; - - /** - * @var SomeClass - */ - private namespace\SomeClass $variableName; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php deleted file mode 100644 index 965e3c03..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Commenting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the VariableComment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\VariableCommentSniff - */ -final class VariableCommentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 21 => 1, - 24 => 1, - 56 => 1, - 64 => 1, - 73 => 1, - 84 => 1, - 130 => 1, - 136 => 1, - 144 => 1, - 152 => 1, - 160 => 1, - 168 => 1, - 176 => 1, - 184 => 1, - 192 => 1, - 200 => 1, - 208 => 1, - 216 => 1, - 224 => 1, - 232 => 1, - 240 => 1, - 248 => 1, - 256 => 1, - 264 => 1, - 272 => 1, - 280 => 1, - 290 => 1, - 294 => 1, - 311 => 1, - 336 => 1, - 361 => 1, - 364 => 1, - 399 => 1, - 403 => 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. - * - * @return array - */ - public function getWarningList() - { - return [93 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc deleted file mode 100644 index de0235cd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc +++ /dev/null @@ -1,320 +0,0 @@ - 0); - -do -{ - echo $i; -} while ($i > 0); - -do -{ - echo $i; -} -while ($i > 0); - -do { echo $i; } while ($i > 0); - -do{ - echo $i; -}while($i > 0); - -while ($i < 1) { - echo $i; -} - -while($i < 1){ - echo $i; -} - -while ($i < 1) { echo $i; } - -for ($i = 1; $i < 1; $i++) { - echo $i; -} - -for($i = 1; $i < 1; $i++){ - echo $i; -} - -for ($i = 1; $i < 1; $i++) { echo $i; } - -if ($i == 0) { - $i = 1; -} - -if($i == 0){ - $i = 1; -} - -if ($i == 0) { $i = 1; } - -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else{ - $i = 0; -} - -if ($i == 0) { $i = 1; } else { $i = 0; } - -if ($i == 0) { - $i = 1; -} else if ($i == 2) { - $i = 0; -} - -if ($i == 0) { - $i = 1; -}else if($i == 2){ - $i = 0; -} - -if ($i == 0) { $i = 1; } else if ($i == 2) { $i = 0; } - -if ($i == 0) { // comments are allowed - $i = 1; -} - -if ($i == 0) {// comments are allowed - $i = 1; -} - -if ($i == 0) { /* comments are allowed*/ - $i = 1; -} - -if ($i == 0) -{ // this is ok - $i = 1; -} - -if ($i == 0) /* this is ok */ { -} - -try { - $code = 'this'; -} catch (Exception $e) { - // Caught! -} - -try { $code = 'this'; } catch (Exception $e) { - // Caught! -} - -do { echo $i; -} while ($i > 0); - -if ($i === 0) { - - $i = 1 -} - -if ($a) { - -} -elseif ($b) { -} - -foreach ($items as $item) { - echo $item; -} - -foreach($items as $item){ - echo $item; -} - -if ($a && $b) // && $c) -{ -} - -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; - -try { - // try body -} -catch (FirstExceptionType $e) { - // catch body -} -catch (OtherExceptionType $e) { - // catch body -} - -switch($foo) { - - case 'bar': - break; - -} - -if ($foo) : -endif; - -?> - -getRow()): ?> -

    - - - -
    - -
    - - - - - - - hello - - - - hello - - - - -getRow()) : ?> -

    - - - - - - - - hello - - - - hello - - 1, -}; - -$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 diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc.fixed deleted file mode 100644 index 03e6bf2c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc.fixed +++ /dev/null @@ -1,324 +0,0 @@ - 0); - -do { - echo $i; -} while ($i > 0); - -do { - echo $i; -} while ($i > 0); - -do { -echo $i; } while ($i > 0); - -do { - echo $i; -} while ($i > 0); - -while ($i < 1) { - echo $i; -} - -while ($i < 1) { - echo $i; -} - -while ($i < 1) { -echo $i; } - -for ($i = 1; $i < 1; $i++) { - echo $i; -} - -for ($i = 1; $i < 1; $i++) { - echo $i; -} - -for ($i = 1; $i < 1; $i++) { -echo $i; } - -if ($i == 0) { - $i = 1; -} - -if ($i == 0) { - $i = 1; -} - -if ($i == 0) { -$i = 1; } - -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { - $i = 1; -} else { - $i = 0; -} - -if ($i == 0) { -$i = 1; } else { -$i = 0; } - -if ($i == 0) { - $i = 1; -} else if ($i == 2) { - $i = 0; -} - -if ($i == 0) { - $i = 1; -} else if ($i == 2) { - $i = 0; -} - -if ($i == 0) { -$i = 1; } else if ($i == 2) { -$i = 0; } - -if ($i == 0) { // comments are allowed - $i = 1; -} - -if ($i == 0) {// comments are allowed - $i = 1; -} - -if ($i == 0) { /* comments are allowed*/ - $i = 1; -} - -if ($i == 0) { // this is ok - $i = 1; -} - -if ($i == 0) { /* this is ok */ -} - -try { - $code = 'this'; -} catch (Exception $e) { - // Caught! -} - -try { -$code = 'this'; } catch (Exception $e) { - // Caught! -} - -do { -echo $i; -} while ($i > 0); - -if ($i === 0) { - - $i = 1 -} - -if ($a) { - -} elseif ($b) { -} - -foreach ($items as $item) { - echo $item; -} - -foreach ($items as $item) { - echo $item; -} - -if ($a && $b) { // && $c) -} - -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; - -try { - // try body -} catch (FirstExceptionType $e) { - // catch body -} catch (OtherExceptionType $e) { - // catch body -} - -switch ($foo) { - - case 'bar': - break; - -} - -if ($foo) : -endif; - -?> - -getRow()) : ?> -

    - - - -
    - -
    - - - - - - - hello - - - - hello - - - - -getRow()): ?> -

    - - - - - - - - hello - - - - hello - - 1, -}; - -$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 diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.2.inc deleted file mode 100644 index ef99b1a2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.2.inc +++ /dev/null @@ -1,5 +0,0 @@ - 0); - -do -{ - i = 0; -} while (i > 0); - -do -{ - i = 0; -} -while (i > 0); - -do { i = 0; } while (i > 0); - -do{ - i = 0; -}while(i > 0); - -while (i < 1) { - i = 0; -} - -while(i < 1){ - i = 0; -} - -while (i < 1) { i = 0; } - -for (i = 1; i < 1; i++) { - i = 0; -} - -for(i = 1; i < 1; i++){ - i = 0; -} - -for (i = 1; i < 1; i++) { i = 0; } - -if (i == 0) { - i = 1; -} - -if(i == 0){ - i = 1; -} - -if (i == 0) { i = 1; } - -if (i == 0) { - i = 1; -} else { - i = 0; -} - -if (i == 0) { - i = 1; -}else{ - i = 0; -} - -if (i == 0) { i = 1; } else { i = 0; } - -if (i == 0) { - i = 1; -} else if (i == 2) { - i = 0; -} - -if (i == 0) { - i = 1; -}else if(i == 2){ - i = 0; -} - -if (i == 0) { i = 1; } else if (i == 2) { i = 0; } - -if (i == 0) { // comments are allowed - i = 1; -} - -if (i == 0) {// comments are allowed - i = 1; -} - -if (i == 0) { /* comments are allowed*/ - i = 1; -} - -if (i == 0) -{ // this is ok - i = 1; -} - -if (i == 0) /* this is ok */ { -} - -try { - code = 'this'; -} catch (e) { - // Caught! -} - -try { code = 'this'; } catch (e) { - // Caught! -} - -do { i = 0; -} while (i > 0); - -if (i === 0) { - - i = 1 -} - -if (window.jQuery)(function($) { - $.fn.reset = function() { - return this.each(function() { - try { - this.reset(); - } catch (e) { - } - }); - }; -})(jQuery); - -if ($("#myid").rotationDegrees()=='90') - $('.modal').css({'transform': 'rotate(90deg)'}); - -if ($("#myid").rotationDegrees()=='90') - $foo = {'transform': 'rotate(90deg)'}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed deleted file mode 100644 index e3ed6de7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.js.fixed +++ /dev/null @@ -1,141 +0,0 @@ - -i = 0; -do { - i = 0; -} while (i > 0); - -do { - i = 0; -} while (i > 0); - -do { - i = 0; -} while (i > 0); - -do { -i = 0; } while (i > 0); - -do { - i = 0; -} while (i > 0); - -while (i < 1) { - i = 0; -} - -while (i < 1) { - i = 0; -} - -while (i < 1) { -i = 0; } - -for (i = 1; i < 1; i++) { - i = 0; -} - -for (i = 1; i < 1; i++) { - i = 0; -} - -for (i = 1; i < 1; i++) { -i = 0; } - -if (i == 0) { - i = 1; -} - -if (i == 0) { - i = 1; -} - -if (i == 0) { -i = 1; } - -if (i == 0) { - i = 1; -} else { - i = 0; -} - -if (i == 0) { - i = 1; -} else { - i = 0; -} - -if (i == 0) { -i = 1; } else { -i = 0; } - -if (i == 0) { - i = 1; -} else if (i == 2) { - i = 0; -} - -if (i == 0) { - i = 1; -} else if (i == 2) { - i = 0; -} - -if (i == 0) { -i = 1; } else if (i == 2) { -i = 0; } - -if (i == 0) { // comments are allowed - i = 1; -} - -if (i == 0) {// comments are allowed - i = 1; -} - -if (i == 0) { /* comments are allowed*/ - i = 1; -} - -if (i == 0) { // this is ok - i = 1; -} - -if (i == 0) { /* this is ok */ -} - -try { - code = 'this'; -} catch (e) { - // Caught! -} - -try { -code = 'this'; } catch (e) { - // Caught! -} - -do { -i = 0; -} while (i > 0); - -if (i === 0) { - - i = 1 -} - -if (window.jQuery)(function($) { - $.fn.reset = function() { - return this.each(function() { - try { - this.reset(); - } catch (e) { - } - }); - }; -})(jQuery); - -if ($("#myid").rotationDegrees()=='90') - $('.modal').css({'transform': 'rotate(90deg)'}); - -if ($("#myid").rotationDegrees()=='90') - $foo = {'transform': 'rotate(90deg)'}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php deleted file mode 100644 index f6db4b19..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ControlSignature sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff - */ -final class ControlSignatureUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - $errors = [ - 7 => 1, - 12 => 1, - 15 => 1, - 18 => 1, - 20 => 1, - 22 => 2, - 28 => 2, - 32 => 1, - 38 => 2, - 42 => 1, - 48 => 2, - 52 => 1, - 62 => 2, - 66 => 2, - 76 => 4, - 80 => 2, - 94 => 1, - 99 => 1, - 108 => 1, - 112 => 1, - ]; - - switch ($testFile) { - case 'ControlSignatureUnitTest.1.inc': - $errors[122] = 1; - $errors[130] = 2; - $errors[134] = 1; - $errors[150] = 1; - $errors[153] = 1; - $errors[158] = 1; - $errors[165] = 1; - $errors[170] = 2; - $errors[185] = 1; - $errors[190] = 2; - $errors[191] = 2; - $errors[195] = 1; - $errors[227] = 1; - $errors[234] = 1; - $errors[239] = 2; - $errors[243] = 2; - $errors[244] = 2; - $errors[248] = 1; - $errors[259] = 1; - $errors[262] = 1; - $errors[267] = 1; - $errors[269] = 1; - $errors[276] = 1; - $errors[279] = 1; - $errors[283] = 1; - $errors[306] = 3; - $errors[309] = 1; - $errors[315] = 1; - return $errors; - - case 'ControlSignatureUnitTest.js': - return $errors; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc deleted file mode 100644 index 91d0a23c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.inc +++ /dev/null @@ -1,14 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ElseIfDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ElseIfDeclarationSniff - */ -final class ElseIfDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 8 => 1, - 13 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc deleted file mode 100644 index 4709923e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc +++ /dev/null @@ -1,36 +0,0 @@ - $that) { -} - -// Invalid. -foreach ( $something as $blah => $that ) { -} - -foreach ($something as $blah => $that) { -} - -foreach ($something as $blah => $that) { -} - -foreach (${something}AS$blah=>$that) { -} - -// The works. -foreach ( $something aS $blah => $that ) { -} - -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 1 -foreach ($something as $blah => $that) {} -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 0 - -foreach ([ - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ] as $key => $value) { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed deleted file mode 100644 index b0de6ebc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,36 +0,0 @@ - $that) { -} - -// Invalid. -foreach ($something as $blah => $that) { -} - -foreach ($something as $blah => $that) { -} - -foreach ($something as $blah => $that) { -} - -foreach (${something} as $blah => $that) { -} - -// The works. -foreach ($something as $blah => $that) { -} - -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 1 -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -foreach ( $something as $blah => $that ) {} -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForEachLoopDeclaration requiredSpacesBeforeClose 0 - -foreach ([ - 'foo' => 'bar', - 'foobaz' => 'bazzy', - ] as $key => $value) { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php deleted file mode 100644 index 5e70703e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ForEachLoopDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff - */ -final class ForEachLoopDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 8 => 2, - 11 => 2, - 14 => 2, - 17 => 5, - 21 => 7, - 26 => 2, - 28 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc deleted file mode 100644 index d10bd980..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc +++ /dev/null @@ -1,126 +0,0 @@ -i ; }; $i < function() { return $this->max; }; $i++) {} -for ($i = function() { return $this->i; }; $i < function() { return $this->max; } ; $i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines true -for ( - $i = 0; - $i < 5; - $i++ -) { - // body here -} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc.fixed deleted file mode 100644 index 85214c03..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.inc.fixed +++ /dev/null @@ -1,92 +0,0 @@ -i ; }; $i < function() { return $this->max; }; $i++) {} -for ($i = function() { return $this->i; }; $i < function() { return $this->max; }; $i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines true -for ( - $i = 0; - $i < 5; - $i++ -) { - // body here -} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration ignoreNewlines false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js deleted file mode 100644 index 94e1f748..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js +++ /dev/null @@ -1,122 +0,0 @@ -// Valid. -for (var i = 0; i < 10; i++) { -} - -// Invalid. -for ( i = 0; i < 10; i++ ) { -} - -for (i = 0; i < 10; i++) { -} - -for (var i = 0 ; i < 10 ; i++) { -} - -for (i = 0;i < 10;i++) { -} - -// The works. -for ( var i = 0 ; i < 10 ; i++ ) { -} - -this.formats = {}; -dfx.inherits('ContentFormat', 'Widget'); - -for (var widgetid in this.loadedContents) { - if (dfx.isset(widget) === true) { - widget.loadAutoSaveCWidgetStore.setData('activeScreen', null);widget.getContents(this.loadedContents[widgetid], function() {self.widgetLoaded(widget.id);}); - } -} - -for (var i = 0; i < 10;) { -} -for (var i = 0; i < 10; ) { -} - -for (var i = 0; ; i++) { -} -for (var i = 0;; i++) { -} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for (var i = 0; i < 10; i++) {} -for ( var i = 0; i < 10; i++ ) {} -for ( var i = 0; i < 10; i++ ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -for ( ; i < 10; i++) {} -for (; i < 10; i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( ; i < 10; i++ ) {} -for ( ; i < 10; i++ ) {} -for (; i < 10; i++ ) {} - -for ( i = 0; i < 10; ) {} -for ( i = 0; i < 10;) {} -for ( i = 0; i < 10; ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -// Test handling of comments and inline annotations. -for ( /*phpcs:enable*/ i = 0 /*start*/ ; /*end*/i < 10/*comment*/; i++ /*comment*/ ) {} - -// Test multi-line FOR control structure. -for ( - i = 0; - i < 10; - i++ -) {} - -// Test multi-line FOR control structure with comments and annotations. -for ( - i = 0; /* Start */ - i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ - i++ // comment - -) {} - -// Test fixing each error in one go. Note: lines 84 + 88 contain trailing whitespace on purpose. -for ( - - - i = 0 - - ; - - i < 10 - - ; - - i++ - - -) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( - - - - i = 0 - - ; - - i < 10 - - ; - - i++ - - -) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -// Test with semicolon not belonging to for. -for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {} -for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);} ; i++) {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js.fixed deleted file mode 100644 index fbf9b609..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.1.js.fixed +++ /dev/null @@ -1,88 +0,0 @@ -// Valid. -for (var i = 0; i < 10; i++) { -} - -// Invalid. -for (i = 0; i < 10; i++) { -} - -for (i = 0; i < 10; i++) { -} - -for (var i = 0; i < 10; i++) { -} - -for (i = 0; i < 10; i++) { -} - -// The works. -for (var i = 0; i < 10; i++) { -} - -this.formats = {}; -dfx.inherits('ContentFormat', 'Widget'); - -for (var widgetid in this.loadedContents) { - if (dfx.isset(widget) === true) { - widget.loadAutoSaveCWidgetStore.setData('activeScreen', null);widget.getContents(this.loadedContents[widgetid], function() {self.widgetLoaded(widget.id);}); - } -} - -for (var i = 0; i < 10;) { -} -for (var i = 0; i < 10;) { -} - -for (var i = 0;; i++) { -} -for (var i = 0;; i++) { -} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( var i = 0; i < 10; i++ ) {} -for ( var i = 0; i < 10; i++ ) {} -for ( var i = 0; i < 10; i++ ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -for (; i < 10; i++) {} -for (; i < 10; i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( ; i < 10; i++ ) {} -for ( ; i < 10; i++ ) {} -for ( ; i < 10; i++ ) {} - -for ( i = 0; i < 10; ) {} -for ( i = 0; i < 10; ) {} -for ( i = 0; i < 10; ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -// Test handling of comments and inline annotations. -for (/*phpcs:enable*/ i = 0 /*start*/; /*end*/i < 10/*comment*/; i++ /*comment*/) {} - -// Test multi-line FOR control structure. -for (i = 0; i < 10; i++) {} - -// Test multi-line FOR control structure with comments and annotations. -for (i = 0; /* Start */ - i < 10; /* phpcs:ignore Standard.Category.SniffName -- for reasons. */ - i++ // comment - -) {} - -// Test fixing each error in one go. Note: lines 84 + 88 contain trailing whitespace on purpose. -for (i = 0; i < 10; i++) {} - -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 1 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 1 -for ( i = 0; i < 10; i++ ) {} -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesAfterOpen 0 -// phpcs:set Squiz.ControlStructures.ForLoopDeclaration requiredSpacesBeforeClose 0 - -// Test with semicolon not belonging to for. -for (i = function() {self.widgetLoaded(widget.id) ; }; i < function() {self.widgetLoaded(widget.id);}; i++) {} -for (i = function() {self.widgetLoaded(widget.id);}; i < function() {self.widgetLoaded(widget.id);}; i++) {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.inc deleted file mode 100644 index a327cced..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.2.inc +++ /dev/null @@ -1,6 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ForLoopDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff - */ -final class ForLoopDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ForLoopDeclarationUnitTest.1.inc': - return [ - 8 => 2, - 11 => 2, - 14 => 2, - 17 => 2, - 21 => 6, - 27 => 1, - 30 => 1, - 37 => 2, - 39 => 2, - 43 => 1, - 49 => 1, - 50 => 1, - 53 => 1, - 54 => 1, - 59 => 4, - 62 => 1, - 63 => 1, - 64 => 1, - 66 => 1, - 69 => 1, - 74 => 1, - 77 => 1, - 82 => 2, - 86 => 2, - 91 => 1, - 95 => 1, - 101 => 2, - 105 => 2, - 110 => 1, - 116 => 2, - ]; - - case 'ForLoopDeclarationUnitTest.1.js': - return [ - 6 => 2, - 9 => 2, - 12 => 2, - 15 => 2, - 19 => 6, - 33 => 1, - 36 => 1, - 43 => 2, - 45 => 2, - 49 => 1, - 55 => 1, - 56 => 1, - 59 => 1, - 60 => 1, - 65 => 4, - 68 => 1, - 69 => 1, - 70 => 1, - 72 => 1, - 75 => 1, - 80 => 1, - 83 => 1, - 88 => 2, - 92 => 2, - 97 => 1, - 101 => 1, - 107 => 2, - 111 => 2, - 116 => 1, - 122 => 2, - ]; - - default: - return []; - }//end switch - - }//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($testFile='') - { - switch ($testFile) { - case 'ForLoopDeclarationUnitTest.2.inc': - case 'ForLoopDeclarationUnitTest.3.inc': - return [6 => 1]; - - case 'ForLoopDeclarationUnitTest.2.js': - return [2 => 1]; - - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc deleted file mode 100644 index f54ed8af..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc +++ /dev/null @@ -1,48 +0,0 @@ -id.'"', - '"'.$this->stepInfo['title'].'"', - '"'.((isset($this->stepInfo['description']) === TRUE) ? $this->stepInfo['description'] : '').'"', - '"'.(isset($this->stepInfo['description']) === TRUE ? $this->stepInfo['description'] : '').'"', - '"'.$this->stepInfo['title'].'"', - ); - -echo (TRUE)?'Hello':'Bye'; - -$array = array( - 'one' => ($test == 1) ? true : false, - 'two' => (($test == 1) ? true : false), - 'three' => (($test == 1) ? true : false) -); -$var = ($test == 1) ? true : false; -$var = (myFunc(1,2,3) == 1) ? true : false; - -set('config', function() { - $foo = ($bar === "on") ? "1" : "2"; -}); - -$config = function() { - $foo = ($bar === "on") ? "1" : "2"; -}; - -rand(0, 1) ? 'ěščřžýáí' : NULL; - -$c = ($argv[1]) ? : ""; -$filepath = realpath($argv[1]) ?: $argv[1]; -$c = ($argv[1]) ? /* comment */ : ""; -$c = ($argv[1]) ? -: ""; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed deleted file mode 100644 index f7aa1d67..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.inc.fixed +++ /dev/null @@ -1,48 +0,0 @@ -id.'"', - '"'.$this->stepInfo['title'].'"', - '"'.((isset($this->stepInfo['description']) === TRUE) ? $this->stepInfo['description'] : '').'"', - '"'.(isset($this->stepInfo['description']) === TRUE ? $this->stepInfo['description'] : '').'"', - '"'.$this->stepInfo['title'].'"', - ); - -echo (TRUE) ? 'Hello' : 'Bye'; - -$array = array( - 'one' => ($test == 1) ? true : false, - 'two' => (($test == 1) ? true : false), - 'three' => (($test == 1) ? true : false) -); -$var = ($test == 1) ? true : false; -$var = (myFunc(1,2,3) == 1) ? true : false; - -set('config', function() { - $foo = ($bar === "on") ? "1" : "2"; -}); - -$config = function() { - $foo = ($bar === "on") ? "1" : "2"; -}; - -rand(0, 1) ? 'ěščřžýáí' : NULL; - -$c = ($argv[1]) ?: ""; -$filepath = realpath($argv[1]) ?: $argv[1]; -$c = ($argv[1]) ? /* comment */ : ""; -$c = ($argv[1]) ? -: ""; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php deleted file mode 100644 index dc4738e0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/InlineIfDeclarationUnitTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the InlineIfDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\InlineIfDeclarationSniff - */ -final class InlineIfDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Get a list of CLI values to set before the file is tested. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getCliValues($testFile) - { - return ['--encoding=utf-8']; - - }//end getCliValues() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 10 => 1, - 13 => 1, - 20 => 1, - 24 => 4, - 44 => 1, - 47 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc deleted file mode 100644 index 1acf3eac..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/LowercaseDeclarationUnitTest.inc +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LowercaseDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff - */ -final class LowercaseDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 9 => 1, - 10 => 1, - 12 => 1, - 14 => 1, - 15 => 1, - 16 => 1, - 20 => 1, - 21 => 1, - 24 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc deleted file mode 100644 index cf397607..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.inc +++ /dev/null @@ -1,333 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\ControlStructures; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SwitchDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\SwitchDeclarationSniff - */ -final class SwitchDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'SwitchDeclarationUnitTest.inc': - return [ - 27 => 1, - 29 => 1, - 34 => 1, - 36 => 1, - 44 => 1, - 48 => 1, - 52 => 1, - 54 => 1, - 55 => 1, - 56 => 1, - 58 => 1, - 59 => 1, - 61 => 1, - 62 => 1, - 79 => 1, - 85 => 2, - 88 => 2, - 89 => 2, - 92 => 1, - 95 => 3, - 99 => 1, - 116 => 1, - 122 => 1, - 127 => 2, - 134 => 2, - 135 => 1, - 138 => 1, - 143 => 1, - 144 => 1, - 147 => 1, - 165 => 1, - 172 => 1, - 176 => 2, - 180 => 1, - 192 => 2, - 196 => 1, - 223 => 1, - 266 => 1, - 282 => 1, - 284 => 2, - 322 => 1, - 323 => 1, - 327 => 1, - 329 => 1, - 330 => 1, - ]; - - case 'SwitchDeclarationUnitTest.js': - return [ - 27 => 1, - 29 => 1, - 34 => 1, - 36 => 1, - 44 => 1, - 48 => 1, - 52 => 1, - 54 => 1, - 55 => 1, - 56 => 1, - 58 => 1, - 59 => 1, - 61 => 1, - 62 => 1, - 79 => 1, - 85 => 2, - 88 => 2, - 89 => 2, - 92 => 1, - 95 => 3, - 99 => 1, - 116 => 1, - 122 => 1, - 127 => 2, - 134 => 2, - 135 => 1, - 138 => 1, - 143 => 1, - 144 => 1, - 147 => 1, - 165 => 1, - 172 => 1, - 176 => 2, - 180 => 1, - 192 => 2, - 196 => 1, - 223 => 1, - 266 => 1, - 282 => 1, - 284 => 2, - ]; - - default: - return []; - }//end switch - - }//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($testFile='') - { - if ($testFile === 'SwitchDeclarationUnitTest.js') { - return [273 => 1]; - } - - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js deleted file mode 100644 index 797e0eea..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.js +++ /dev/null @@ -1,2 +0,0 @@ -alert('hi') -alert('hi'); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php deleted file mode 100644 index c4b14dc2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JSLintUnitTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; -use PHP_CodeSniffer\Config; - -/** - * Unit test class for the JSLint sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JSLintSniff - */ -final class JSLintUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Should this test be skipped for some reason. - * - * @return bool - */ - protected function shouldSkipTest() - { - $jslPath = Config::getExecutablePath('jslint'); - if ($jslPath === null) { - return true; - } - - return false; - - }//end shouldSkipTest() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [ - 1 => 2, - 2 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js deleted file mode 100644 index 797e0eea..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.js +++ /dev/null @@ -1,2 +0,0 @@ -alert('hi') -alert('hi'); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php deleted file mode 100644 index 96a68d7c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Debug/JavaScriptLintUnitTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; -use PHP_CodeSniffer\Config; - -/** - * Unit test class for the JavaScriptLint sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JavaScriptLintSniff - */ -final class JavaScriptLintUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Should this test be skipped for some reason. - * - * @return bool - */ - protected function shouldSkipTest() - { - $jslPath = Config::getExecutablePath('jsl'); - if ($jslPath === null) { - return true; - } - - return false; - - }//end shouldSkipTest() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [2 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc deleted file mode 100644 index 3279edb5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.1.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc deleted file mode 100644 index 05be6330..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.2.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc deleted file mode 100644 index ec1b0239..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.3.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc deleted file mode 100644 index ed045646..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.4.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.5.inc deleted file mode 100644 index d777aff6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.5.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php deleted file mode 100644 index 06592254..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Files/FileExtensionUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FileExtension sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Files\FileExtensionSniff - */ -final class FileExtensionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FileExtensionUnitTest.1.inc': - return [1 => 1]; - default: - return []; - } - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc deleted file mode 100644 index 8e628963..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc +++ /dev/null @@ -1,203 +0,0 @@ -words[$wordPos-1]) || $this->words[$wordPos-1] !== ' ') { -} else if ($this->tokens[$pos + 1] === "\n") { -} - -if ($pos === count($this->tokens) - 1) { - $file = '...'.substr($file, (($padding * -1) + 3)); -} - -if (substr($basename, -5) !== 'Sniff') { - $i = ($this->_tokens[$i]['parenthesis_closer'] + 1); -} - -$pos = $this->_getShortCommentEndPos(); -if ($pos === -1) { - $stackPtr = ($tokens[$next][$to] - 1); - $stackPtr = ($tokens[$next][$pattern[$i]['to']] + 1); - $var = (($var1 + $var2) + $var3 + $var4) -} - -$commentStart = ($phpcsFile->findPrevious(T_DOC_COMMENT, ($commentEnd - 1), null, true) + 1); -$commentEnd = ($this->_phpcsFile->findNext(T_DOC_COMMENT, ($commentStart + 1), null, true) - 1); -$expected .= '...'.substr($tokens[($stackPtr - 2)]['content'], -5).$tokens[$stackPtr]['content']; - -if (($tokens[$nextToken - 1]['code']) !== T_WHITESPACE) { - $errorPos = ($params[(count($params) - 1)]->getLine() + $commentStart); -} - -while (($nextSpace = $phpcsFile->findNext(T_WHITESPACE, $nextSpace + 1, $nextBreak)) !== false) { -} - -foreach ($attributes as $id => &$attribute) { -} - -class MyClass -{ - - - public function &myFunction(array &$one, array &$two) - { - - }//end myFunction() - - -}//end class - -if ($index < -1) $index = 0; -if ($index < - 1) $index = 0; - -$three = ceil($one / $two); -$three = ceil(($one / $two) / $four); -$three = ceil($one / ($two / $four)); - -$four = -0.25; - -$three = ceil($one[1] / $two); - -switch ($number % 10) { - case -1: - $suffix = 'st'; - break; -} - -$expectedPermission = array( - 'granted' => 4, - 'denied' => 1, - 'cascade' => TRUE, - 'blockergranted' => 2, - 'blockerdenied' => - 3, - 'effective' => TRUE, - ); - -$value = (int) isset($blah) + 2; -$value = (int) isset($blah) + (int) isset($foo) + (int) isset($bar); - -doSomething(getValue($var, 2)) - $y; - -$codeFiles = array($global => $codeFiles[$global]) + $codeFiles; - -$var = array(-1); -$var = [-1]; -$var = [0, -1, -2]; - -$cntPages = ceil(count($items) / self::ON_PAGE); - -error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); -error_reporting(E_ALL & ~E_NOTICE | ~E_WARNING); -$results = $stmt->fetchAll(\PDO::FETCH_ASSOC | \PDO::FETCH_GROUP | \PDO::FETCH_UNIQUE); -$di = new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS); -foo(1 + 2 + 3); - -if (empty($foo[-1]) === true) { - $foo[-1] = 'foo'; -} - -try { -} catch (AException | BException $e) { -} - -$var = $foo['blah'] + []; - -$a = 2 * ${x} - ${minus}; - -$foo = $bar ?? $baz ?? ''; - -$foo = $myString{-1}; - -$value = (binary) $blah + b"binary $foo"; - -$test = (1 * static::TEST); -$test = myfunc(1 * static::TEST); - -$errorPos = $params[$x]?->getLine() + $commentStart; - -$foo = $this->gmail ?? $this->gmail = new Google_Service_Gmail($this->google); - -exit -1; - -$expr = match ($number - 10) { - -1 => 0, -}; - -$expr = match ($number % 10) { - 1 => 2 * $num, -}; - -$expr = match (true) { - $num * 100 > 500 => 'expression in key', -}; - -// PHP 8.0 named parameters. -if ($pos === count(value: $this->tokens) - 1) { - $file = '...'.substr(string: $file, offset: $padding * -1 + 3); -} - -match ($a) { - 'a' => -1, - 'b', 'c', 'd' => -2, - default => -3, -}; - -$cntPages = ceil(count($items) / parent::ON_PAGE); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed deleted file mode 100644 index 9fa0216c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed +++ /dev/null @@ -1,203 +0,0 @@ -words[($wordPos-1)]) || $this->words[($wordPos-1)] !== ' ') { -} else if ($this->tokens[($pos + 1)] === "\n") { -} - -if ($pos === (count($this->tokens) - 1)) { - $file = '...'.substr($file, (($padding * -1) + 3)); -} - -if (substr($basename, -5) !== 'Sniff') { - $i = ($this->_tokens[$i]['parenthesis_closer'] + 1); -} - -$pos = $this->_getShortCommentEndPos(); -if ($pos === -1) { - $stackPtr = ($tokens[$next][$to] - 1); - $stackPtr = ($tokens[$next][$pattern[$i]['to']] + 1); - $var = (($var1 + $var2) + $var3 + $var4) -} - -$commentStart = ($phpcsFile->findPrevious(T_DOC_COMMENT, ($commentEnd - 1), null, true) + 1); -$commentEnd = ($this->_phpcsFile->findNext(T_DOC_COMMENT, ($commentStart + 1), null, true) - 1); -$expected .= '...'.substr($tokens[($stackPtr - 2)]['content'], -5).$tokens[$stackPtr]['content']; - -if (($tokens[($nextToken - 1)]['code']) !== T_WHITESPACE) { - $errorPos = ($params[(count($params) - 1)]->getLine() + $commentStart); -} - -while (($nextSpace = $phpcsFile->findNext(T_WHITESPACE, ($nextSpace + 1), $nextBreak)) !== false) { -} - -foreach ($attributes as $id => &$attribute) { -} - -class MyClass -{ - - - public function &myFunction(array &$one, array &$two) - { - - }//end myFunction() - - -}//end class - -if ($index < -1) $index = 0; -if ($index < - 1) $index = 0; - -$three = ceil($one / $two); -$three = ceil(($one / $two) / $four); -$three = ceil($one / ($two / $four)); - -$four = -0.25; - -$three = ceil($one[1] / $two); - -switch ($number % 10) { - case -1: - $suffix = 'st'; - break; -} - -$expectedPermission = array( - 'granted' => 4, - 'denied' => 1, - 'cascade' => TRUE, - 'blockergranted' => 2, - 'blockerdenied' => - 3, - 'effective' => TRUE, - ); - -$value = ((int) isset($blah) + 2); -$value = ((int) isset($blah) + (int) isset($foo) + (int) isset($bar)); - -(doSomething(getValue($var, 2)) - $y); - -$codeFiles = (array($global => $codeFiles[$global]) + $codeFiles); - -$var = array(-1); -$var = [-1]; -$var = [0, -1, -2]; - -$cntPages = ceil(count($items) / self::ON_PAGE); - -error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); -error_reporting(E_ALL & ~E_NOTICE | ~E_WARNING); -$results = $stmt->fetchAll(\PDO::FETCH_ASSOC | \PDO::FETCH_GROUP | \PDO::FETCH_UNIQUE); -$di = new \RecursiveDirectoryIterator($path, (\RecursiveDirectoryIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS)); -foo(1 + 2 + 3); - -if (empty($foo[-1]) === true) { - $foo[-1] = 'foo'; -} - -try { -} catch (AException | BException $e) { -} - -$var = ($foo['blah'] + []); - -$a = 2 * ${x} - ${minus}; - -$foo = ($bar ?? $baz ?? ''); - -$foo = $myString{-1}; - -$value = ((binary) $blah + b"binary $foo"); - -$test = (1 * static::TEST); -$test = myfunc(1 * static::TEST); - -$errorPos = ($params[$x]?->getLine() + $commentStart); - -$foo = ($this->gmail ?? $this->gmail = new Google_Service_Gmail($this->google)); - -exit -1; - -$expr = match ($number - 10) { - -1 => 0, -}; - -$expr = match ($number % 10) { - 1 => (2 * $num), -}; - -$expr = match (true) { - ($num * 100) > 500 => 'expression in key', -}; - -// PHP 8.0 named parameters. -if ($pos === (count(value: $this->tokens) - 1)) { - $file = '...'.substr(string: $file, offset: ($padding * -1 + 3)); -} - -match ($a) { - 'a' => -1, - 'b', 'c', 'd' => -2, - default => -3, -}; - -$cntPages = ceil(count($items) / parent::ON_PAGE); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js deleted file mode 100644 index 92ed8038..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js +++ /dev/null @@ -1,118 +0,0 @@ -value = (one + two); -value = one + two; - -value = (one - two); -value = one - two; - -value = (one * two); -value = one * two; - -value = (one / two); -value = one / two; - -value = (one % two); -value = one % two; - -value = (one + two + three); -value = one + two + three; -value = (one + (two + three)); -value = one + (two + three); - -value++; -value--; -value = -1; -value = - 1; - -value = (1 + 2); -value = 1 + 2; - -value = (1 - 2); -value = 1 - 2; - -value = (1 * 2); -value = 1 * 2; - -value = (1 / 2); -value = 1 / 2; - -value = (1 % 2); -value = 1 % 2; - -value = (1 + 2 + 3); -value = 1 + 2 + 3; -value = (1 + (2 + 3)); -value = 1 + (2 + 3); - -value = one + 2 + 3 - (four * five * (6 + 7)) + nine + 2; -value = myFunction(tokens[stackPtr - 1]); - -for (i = 1 + 2; i < 4 + 5; i++) { -} - -function myFunction() -{ - value = (one + 1) + (two + 2) + (myFunction() + 2); - value = myFunction() + 2; - value = (myFunction(mvar) + myFunction2(mvar)); - return -1; -} - -params['mode'] = id.replace(/WidgetType/, ''); - -if (index < -1) index = 0; -if (index < - 1) index = 0; - -var classN = prvId.replace(/\./g, '-'); - -three = myFunction(one / two); -three = myFunction((one / two) / four); -three = myFunction(one / (two / four)); - -four = -0.25; - -id = id.replace(/row\/:/gi, ''); -return /MSIE/.test(navigator.userAgent); - -var re = new RegExp(/<\/?(\w+)((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/gim); - -var options = { - minVal: -1, - maxVal: -1 -}; - -stepWidth = Math.round(this.width / 5); - -date.setMonth(d[2] - 1); - -switch (number % 10) { - case -1: - suffix = 'st'; - break; -} - -var pathSplit = ipt.value.split(/\/|\\/); - -if (pairs[i].search(/=/) !== -1) { -} - -if (urlValue.search(/[a-zA-z]+:\/\//) !== 0) { -} - -if (urlValue.search(/[a-zA-z]+:\/\/*/) !== 0) { -} - -if (!value || /^\s*$/.test(value)) { - return true; -} - -parseInt(dfx.attr(selectors[idx], 'elemOffsetTop'), 10) - scrollCoords.y + 'px' - -if (something === true - ^ somethingElse === true -) { - return false; -} - -if (true === /^\d*\.?\d*$/.test(input)) return true; - -if ( ! /^(?:a|select)$/i.test( element.tagName ) ) return true; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed deleted file mode 100644 index 04e35d97..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.js.fixed +++ /dev/null @@ -1,118 +0,0 @@ -value = (one + two); -value = one + two; - -value = (one - two); -value = (one - two); - -value = (one * two); -value = (one * two); - -value = (one / two); -value = (one / two); - -value = (one % two); -value = (one % two); - -value = (one + two + three); -value = one + two + three; -value = (one + (two + three)); -value = one + (two + three); - -value++; -value--; -value = -1; -value = - 1; - -value = (1 + 2); -value = 1 + 2; - -value = (1 - 2); -value = (1 - 2); - -value = (1 * 2); -value = (1 * 2); - -value = (1 / 2); -value = (1 / 2); - -value = (1 % 2); -value = (1 % 2); - -value = (1 + 2 + 3); -value = 1 + 2 + 3; -value = (1 + (2 + 3)); -value = 1 + (2 + 3); - -value = one + 2 + (3 - (four * five * (6 + 7))) + nine + 2; -value = myFunction(tokens[(stackPtr - 1)]); - -for (i = 1 + 2; i < 4 + 5; i++) { -} - -function myFunction() -{ - value = (one + 1) + (two + 2) + (myFunction() + 2); - value = myFunction() + 2; - value = (myFunction(mvar) + myFunction2(mvar)); - return -1; -} - -params['mode'] = id.replace(/WidgetType/, ''); - -if (index < -1) index = 0; -if (index < - 1) index = 0; - -var classN = prvId.replace(/\./g, '-'); - -three = myFunction(one / two); -three = myFunction((one / two) / four); -three = myFunction(one / (two / four)); - -four = -0.25; - -id = id.replace(/row\/:/gi, ''); -return /MSIE/.test(navigator.userAgent); - -var re = new RegExp(/<\/?(\w+)((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/gim); - -var options = { - minVal: -1, - maxVal: -1 -}; - -stepWidth = Math.round(this.width / 5); - -date.setMonth(d[2] - 1); - -switch (number % 10) { - case -1: - suffix = 'st'; - break; -} - -var pathSplit = ipt.value.split(/\/|\\/); - -if (pairs[i].search(/=/) !== -1) { -} - -if (urlValue.search(/[a-zA-z]+:\/\//) !== 0) { -} - -if (urlValue.search(/[a-zA-z]+:\/\/*/) !== 0) { -} - -if (!value || /^\s*$/.test(value)) { - return true; -} - -(parseInt(dfx.attr(selectors[idx], 'elemOffsetTop'), 10) - scrollCoords.y) + 'px' - -if (something === true - ^ somethingElse === true -) { - return false; -} - -if (true === /^\d*\.?\d*$/.test(input)) return true; - -if ( ! /^(?:a|select)$/i.test( element.tagName ) ) return true; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php deleted file mode 100644 index 0da13624..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php +++ /dev/null @@ -1,121 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Formatting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the OperatorBracket sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting\OperatorBracketSniff - */ -final class OperatorBracketUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'OperatorBracketUnitTest.inc': - return [ - 3 => 1, - 6 => 1, - 9 => 1, - 12 => 1, - 15 => 1, - 18 => 2, - 20 => 1, - 25 => 1, - 28 => 1, - 31 => 1, - 34 => 1, - 37 => 1, - 40 => 1, - 43 => 2, - 45 => 1, - 47 => 5, - 48 => 1, - 50 => 2, - 55 => 2, - 56 => 1, - 63 => 2, - 64 => 1, - 67 => 1, - 86 => 1, - 90 => 1, - 109 => 1, - 130 => 1, - 134 => 1, - 135 => 2, - 137 => 1, - 139 => 1, - 150 => 1, - 161 => 1, - 163 => 2, - 165 => 2, - 169 => 1, - 174 => 1, - 176 => 1, - 185 => 1, - 189 => 1, - 193 => 1, - 194 => 2, - ]; - - case 'OperatorBracketUnitTest.js': - return [ - 5 => 1, - 8 => 1, - 11 => 1, - 14 => 1, - 24 => 1, - 30 => 1, - 33 => 1, - 36 => 1, - 39 => 1, - 46 => 1, - 47 => 1, - 63 => 1, - 108 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc deleted file mode 100644 index 33564e2e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc +++ /dev/null @@ -1,111 +0,0 @@ - $a($b); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed deleted file mode 100644 index 68fb1c1c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,111 +0,0 @@ - $a($b); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php deleted file mode 100644 index 62ccfef2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionDeclarationArgumentSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff - */ -final class FunctionDeclarationArgumentSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 2, - 7 => 2, - 8 => 2, - 9 => 2, - 11 => 2, - 13 => 7, - 14 => 2, - 15 => 2, - 16 => 4, - 18 => 2, - 35 => 2, - 36 => 2, - 44 => 2, - 45 => 1, - 46 => 1, - 51 => 2, - 53 => 2, - 55 => 1, - 56 => 1, - 58 => 1, - 73 => 7, - 76 => 1, - 77 => 1, - 81 => 1, - 89 => 2, - 92 => 1, - 93 => 1, - 94 => 1, - 95 => 1, - 99 => 11, - 100 => 2, - 101 => 2, - 102 => 2, - 106 => 1, - 107 => 2, - 111 => 3, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc deleted file mode 100644 index 0cde1138..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationUnitTest.inc +++ /dev/null @@ -1,75 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff - */ -final class FunctionDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 55 => 1, - 68 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc deleted file mode 100644 index 27102d05..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.inc +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php deleted file mode 100644 index f29f8090..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDuplicateArgumentUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionDuplicateArgument sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDuplicateArgumentSniff - */ -final class FunctionDuplicateArgumentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 2, - 5 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc deleted file mode 100644 index b7b7f205..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.inc +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php deleted file mode 100644 index 1a077915..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/GlobalFunctionUnitTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the GlobalFunction sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff - */ -final class GlobalFunctionUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [2 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc deleted file mode 100644 index 4e868336..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc +++ /dev/null @@ -1,28 +0,0 @@ - $x; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed deleted file mode 100644 index 48c99777..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.inc.fixed +++ /dev/null @@ -1,28 +0,0 @@ - $x; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php deleted file mode 100644 index c91c3008..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/LowercaseFunctionKeywordsUnitTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LowercaseFunctionKeywords sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff - */ -final class LowercaseFunctionKeywordsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 16 => 1, - 17 => 1, - 20 => 1, - 21 => 1, - 22 => 1, - 23 => 1, - 24 => 3, - 25 => 4, - 28 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc deleted file mode 100644 index 811c56ec..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.inc +++ /dev/null @@ -1,304 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Functions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the MultiLineFunctionDeclaration sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff - */ -final class MultiLineFunctionDeclarationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - if ($testFile === 'MultiLineFunctionDeclarationUnitTest.inc') { - $errors = [ - 2 => 1, - 3 => 1, - 4 => 2, - 5 => 1, - 7 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 16 => 1, - 36 => 1, - 43 => 2, - 48 => 1, - 81 => 1, - 82 => 2, - 88 => 1, - 102 => 2, - 137 => 1, - 141 => 2, - 142 => 1, - 158 => 1, - 160 => 1, - 182 => 2, - 186 => 2, - 190 => 2, - 194 => 1, - 195 => 1, - 233 => 1, - 234 => 1, - 235 => 1, - 236 => 1, - 244 => 1, - 245 => 1, - 246 => 1, - 247 => 1, - 248 => 1, - 249 => 1, - 250 => 1, - 251 => 1, - 252 => 1, - 253 => 1, - 254 => 1, - ]; - } else { - $errors = [ - 2 => 1, - 3 => 1, - 4 => 2, - 5 => 1, - 7 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 16 => 1, - 26 => 1, - 36 => 1, - 43 => 2, - 48 => 1, - 65 => 1, - ]; - }//end if - - return $errors; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc deleted file mode 100644 index aacef347..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.inc +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php deleted file mode 100644 index 7b9692e7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidFunctionNameUnitTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ValidFunctionName sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidFunctionNameSniff - */ -final class ValidFunctionNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 14 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc deleted file mode 100644 index 87c3bdf2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc +++ /dev/null @@ -1,157 +0,0 @@ -varName2; -echo $this->var_name2; -echo $this->varname2; -echo $this->_varName2; -echo $object->varName2; -echo $object->var_name2; -echo $object_name->varname2; -echo $object_name->_varName2; - -echo $this->myFunction($one, $two); -echo $object->myFunction($one_two); - -$error = "format is \$GLOBALS['$varName']"; - -echo $_SESSION['var_name']; -echo $_FILES['var_name']; -echo $_ENV['var_name']; -echo $_COOKIE['var_name']; - -$XML = 'hello'; -$myXML = 'hello'; -$XMLParser = 'hello'; -$xmlParser = 'hello'; - -echo "{$_SERVER['HOSTNAME']} $var_name"; - -// Need to be the last thing in this test file. -$obj->$classVar = $prefix.'-'.$type; - -class foo -{ - const bar = <<varName; -echo $obj?->var_name; -echo $obj?->varname; -echo $obj?->_varName; - -enum SomeEnum -{ - public function foo($foo, $_foo, $foo_bar) { - $bar = 1; - $_bar = 2; - $bar_foo = 3; - } -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php deleted file mode 100644 index d8d8695c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php +++ /dev/null @@ -1,93 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ValidVariableName sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidVariableNameSniff - */ -final class ValidVariableNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - $errors = [ - 3 => 1, - 5 => 1, - 10 => 1, - 12 => 1, - 15 => 1, - 17 => 1, - 20 => 1, - 22 => 1, - 25 => 1, - 27 => 1, - 31 => 1, - 33 => 1, - 36 => 1, - 37 => 1, - 39 => 1, - 42 => 1, - 44 => 1, - 53 => 1, - 58 => 1, - 62 => 1, - 63 => 1, - 64 => 1, - 67 => 1, - 81 => 1, - 106 => 1, - 107 => 2, - 108 => 1, - 111 => 1, - 112 => 1, - 113 => 1, - 114 => 1, - 123 => 1, - 138 => 1, - 141 => 1, - 146 => 1, - 152 => 1, - 155 => 1, - ]; - - return $errors; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js deleted file mode 100644 index 1c61fbfb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.js +++ /dev/null @@ -1,37 +0,0 @@ -function test(id) -{ - - this.id = id; - -} -/**/ -test.prototype = { - init: function() - { - var x = {}; - x.name = 'test'; - x['phone'] = 123124324; - var t = ['test', 'this'].join(''); - var y = ['test'].join(''); - var a = x[0]; - var z = x[x['name']]; - var p = x[x.name]; - } - -}; - -function test() { - this.errors['step_' + step] = errors; - this.errors['test'] = x; - this.errors['test' + 10] = x; - this.errors['test' + y] = x; - this.errors['test' + 'blah'] = x; - this.errors[y] = x; - this.errors[y + z] = x; - this.permissions['workflow.cancel'] = x; -} - -if (child.prototype) { - above.prototype['constructor'] = parent; - child.prototype['super'] = new above(); -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php deleted file mode 100644 index 36880a9a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowObjectStringIndex sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\DisallowObjectStringIndexSniff - */ -final class DisallowObjectStringIndexUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - if ($testFile !== 'DisallowObjectStringIndexUnitTest.js') { - return []; - } - - return [ - 13 => 1, - 17 => 1, - 25 => 1, - 35 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc deleted file mode 100644 index b6df38c9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.inc +++ /dev/null @@ -1,49 +0,0 @@ - new MyClass()); -$object->myFunction(new MyClass()); - -throw new MyException($msg); - -function foo() { return new MyClass(); } - -$doodad = $x ? new Foo : new Bar; - -function returnFn() { - $fn = fn($x) => new MyClass(); -} - -function returnMatch() { - $match = match($x) { - 0 => new MyClass() - } -} - -// Issue 3333. -$time2 ??= new \DateTime(); -$time3 = $time1 ?? new \DateTime(); -$time3 = $time1 ?? $time2 ?? new \DateTime(); - -function_call($time1 ?? new \DateTime()); -$return = function_call($time1 ?? new \DateTime()); // False negative depending on interpretation of the sniff. - -function returnViaTernary() { - return ($y == false ) ? ($x === true ? new Foo : new Bar) : new FooBar; -} - -function nonAssignmentTernary() { - if (($x ? new Foo() : new Bar) instanceof FooBar) { - // Do something. - } -} - -// Test for tokenizer issue #3789. -$a = $b !== null - ? match ($c) { - default => 5, - } - : new Foo; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php deleted file mode 100644 index bfd4bef2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectInstantiationUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ObjectInstantiation sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectInstantiationSniff - */ -final class ObjectInstantiationUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 8 => 1, - 31 => 1, - 39 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js deleted file mode 100644 index 28bf85ad..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js +++ /dev/null @@ -1,47 +0,0 @@ -this.request({ action: 'getTypeFormatContents', }); - -addTypeFormatButton.addClickEvent(function() { - self.addNewTypeFormat(); -}); - -var x = {}; - -var y = { - VarOne : 'If you ask me, thats if you ask', - VarTwo : ['Alonzo played you', 'for a fool', 'esse'], - VarThree: function(arg) { - console.info(1); - } -}; - -var z = { - VarOne : 'If you ask me, thats if you ask', - VarTwo : ['Alonzo played you', 'for a fool', 'esse'], - VarThree: function(arg) { - console.info(1); - }, -}; - -var x = function() { - console.info(2); -}; - -AssetListingEditWidgetType.prototype = { - init: function(data, assetid, editables) - { - } -}; - -AssetListingEditWidgetType.prototype = { - init: function(data, assetid, editables) - { - }, -}; - -AssetListingEditWidgetType.prototype = { - // phpcs: disable Standard.Cat.SniffName -- testing annotation between closing brace and comma - init: function(data, assetid, editables) - { - }, - // phpcs:enable -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed deleted file mode 100644 index df548c74..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.js.fixed +++ /dev/null @@ -1,47 +0,0 @@ -this.request({ action: 'getTypeFormatContents' }); - -addTypeFormatButton.addClickEvent(function() { - self.addNewTypeFormat(); -}); - -var x = {}; - -var y = { - VarOne : 'If you ask me, thats if you ask', - VarTwo : ['Alonzo played you', 'for a fool', 'esse'], - VarThree: function(arg) { - console.info(1); - } -}; - -var z = { - VarOne : 'If you ask me, thats if you ask', - VarTwo : ['Alonzo played you', 'for a fool', 'esse'], - VarThree: function(arg) { - console.info(1); - } -}; - -var x = function() { - console.info(2); -}; - -AssetListingEditWidgetType.prototype = { - init: function(data, assetid, editables) - { - } -}; - -AssetListingEditWidgetType.prototype = { - init: function(data, assetid, editables) - { - } -}; - -AssetListingEditWidgetType.prototype = { - // phpcs: disable Standard.Cat.SniffName -- testing annotation between closing brace and comma - init: function(data, assetid, editables) - { - } - // phpcs:enable -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php deleted file mode 100644 index 0ac826f3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Objects/ObjectMemberCommaUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Objects; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ObjectMemberComma sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectMemberCommaSniff - */ -final class ObjectMemberCommaUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 1 => 1, - 22 => 1, - 38 => 1, - 45 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc deleted file mode 100644 index 8522438d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.inc +++ /dev/null @@ -1,138 +0,0 @@ - - 0)) { -} - -myFunction($var1 === true ? "" : "foobar"); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js deleted file mode 100644 index 048223ba..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.js +++ /dev/null @@ -1,71 +0,0 @@ -if (value === TRUE) { -} else if (value === FALSE) { -} - -if (value == TRUE) { -} else if (value == FALSE) { -} - -if (value) { -} else if (!value) { -} - -if (value.isSomething === TRUE) { -} else if (myFunction(value) === FALSE) { -} - -if (value.isSomething == TRUE) { -} else if (myFunction(value) == FALSE) { -} - -if (value.isSomething) { -} else if (!myFunction(value)) { -} - -if (value === TRUE || other === FALSE) { -} - -if (value == TRUE || other == FALSE) { -} - -if (value || !other) { -} - -if (one === TRUE || two === TRUE || three === FALSE || four === TRUE) { -} - -if (one || two || !three || four) { -} - -while (one == true) { -} - -while (one === true) { -} - -do { -} while (one == true); - -do { -} while (one === true); - -for (one = 10; one != 0; one--) { -} - -for (one = 10; one !== 0; one--) { -} - -for (type in types) { -} - -variable = (variable2 === true) ? variable1 : "foobar"; - -variable = (variable2 == true) ? variable1 : "foobar"; - -variable = (variable2 === false) ? variable1 : "foobar"; - -variable = (variable2 == false) ? variable1 : "foobar"; - -variable = (variable2 === 0) ? variable1 : "foobar"; - -variable = (variable2 == 0) ? variable1 : "foobar"; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php deleted file mode 100644 index 1189725b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ComparisonOperatorUsage sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ComparisonOperatorUsageSniff - */ -final class ComparisonOperatorUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ComparisonOperatorUsageUnitTest.inc': - return [ - 6 => 1, - 7 => 1, - 10 => 1, - 11 => 1, - 18 => 1, - 19 => 1, - 22 => 1, - 23 => 1, - 29 => 2, - 32 => 2, - 38 => 4, - 47 => 2, - 69 => 1, - 72 => 1, - 75 => 1, - 78 => 1, - 80 => 1, - 82 => 1, - 83 => 1, - 89 => 1, - 92 => 1, - 100 => 1, - 106 => 1, - 112 => 1, - 123 => 1, - 127 => 1, - 131 => 1, - 135 => 1, - ]; - - case 'ComparisonOperatorUsageUnitTest.js': - return [ - 5 => 1, - 6 => 1, - 17 => 1, - 18 => 1, - 28 => 2, - 40 => 1, - 47 => 1, - 52 => 1, - 63 => 1, - 67 => 1, - 71 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc deleted file mode 100644 index 26669597..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.inc +++ /dev/null @@ -1,56 +0,0 @@ -i++).$id; -$id = $obj?->i++.$id; -$id = $obj?->i++*10; - -$var+=1; -$var-=1; - -$var=$var+1; -$var=$var-1; - -$var /*comment*/ +=1; -$var - // phpcs:ignore Something - -=1; - -$var += /*comment*/ 1; -$var = ( $var /*comment*/ - 1 /*comment*/); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php deleted file mode 100644 index e27e196b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/IncrementDecrementUsageUnitTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the IncrementDecrementUsage sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\IncrementDecrementUsageSniff - */ -final class IncrementDecrementUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 6 => 1, - 12 => 1, - 16 => 1, - 25 => 1, - 26 => 1, - 27 => 1, - 29 => 1, - 31 => 1, - 41 => 1, - 42 => 1, - 44 => 1, - 45 => 1, - 47 => 1, - 48 => 1, - 50 => 1, - 53 => 1, - 55 => 1, - 56 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc deleted file mode 100644 index 328ccc5d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.inc +++ /dev/null @@ -1,28 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php deleted file mode 100644 index d7ce889e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Operators/ValidLogicalOperatorsUnitTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Operators; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ValidLogicalOperators sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ValidLogicalOperatorsSniff - */ -final class ValidLogicalOperatorsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 11 => 1, - 17 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css deleted file mode 100644 index 94cc8f27..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.css +++ /dev/null @@ -1,23 +0,0 @@ -/* CSS Document */ - -body { -font-family: Arial, Helvetica, sans-serif; -margin : 40px 0 0 0; -padding : 0; -/*background: #8FB7DB url(login_glow_bg.jpg) no-repeat 30% 0;*/ -background: #8FB7DB url(diag_lines_bg.gif) top left; -} - -#login-container { - margin-left: -225px; - margin-top: -161px; - position:absolute; - top :50%; - /*left :50%;*/ - width:450px; -} - -#cacheConfig-dayLabel, #cacheConfig-hourLabel, #cacheConfig-minuteLabel { - float: left; - padding-right: 8px; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc deleted file mode 100644 index 121240a9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.inc +++ /dev/null @@ -1,158 +0,0 @@ - - * - * Title - * Contents - * - * ... - * - * - * - * - * @return void - */ - -/* - [^\'"] -*/ - -// http://www.google.com - -// Base config function. - -// function () - -// T_STRING is not a function call or not listed in _getFunctionListWithCallableArgument(). - - // function myFunction( $param ) - // { - // do_something(); - // }//end myFunction() - // - -/* -function myFunction( $param ) -{ - // phpcs:disable Standard.Category.Sniff -- for reasons. - if ( preg_match( '`[abc]`', $param ) > 0 ) { - do_something(); - } - // phpcs:enable Standard.Category.Sniff -- for reasons. - -}//end myFunction() -*/ - - /* - * function myFunction( $param ) // @phpcs:ignore Standard.Category.Sniff -- for reasons. - * { - * - * }//end myFunction() - */ - - /* - * function myFunction( $param ) - * { - * // phpcs:disable Standard.Category.Sniff -- for reasons. - * if ( preg_match( '`[abc]`', $param ) > 0 ) { - * do_something(); - * } - * // phpcs:enable Standard.Category.Sniff -- for reasons. - * - * }//end myFunction() - */ - - // function myFunction( $param ) - // { - // phpcs:disable Standard.Category.Sniff -- for reasons. - // do_something(); - // phpcs:enable Standard.Category.Sniff -- for reasons. - // }//end myFunction() - // - -echo 'something'; // @codeCoverageIgnore -echo 'something'; // @codeCoverageIgnoreStart -echo 'something'; // @SuppressWarnings(PHPMD.UnusedLocalVariable) - -// Ok! - -/* Go! */ - -// ISO-639-3 - - // But override with a different text if any. - /* - $id = intval( str_replace( 'hook_name', '', $order_method['method_id'] ) ); - if ( ! empty( $id ) ) { - $info_text = get_post_meta( $location_id, 'meta_name' ); - - if ( ! empty( $info_text ) ) { - $text = $info_text; - } - - } - */ - // function() { $a = $b; }; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php deleted file mode 100644 index 99d8f01a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the CommentedOutCode sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\CommentedOutCodeSniff - */ -final class CommentedOutCodeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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($testFile='') - { - switch ($testFile) { - case 'CommentedOutCodeUnitTest.inc': - return [ - 6 => 1, - 8 => 1, - 15 => 1, - 19 => 1, - 87 => 1, - 91 => 1, - 97 => 1, - 109 => 1, - 116 => 1, - 128 => 1, - 147 => 1, - 158 => 1, - ]; - - case 'CommentedOutCodeUnitTest.css': - return [ - 7 => 1, - 16 => 1, - ]; - - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc deleted file mode 100644 index 4701c23e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.inc +++ /dev/null @@ -1,27 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php deleted file mode 100644 index 8c3afa4d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowBooleanStatementUnitTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowBooleanStatement sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowBooleanStatementSniff - */ -final class DisallowBooleanStatementUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 8 => 1, - 13 => 1, - 15 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc deleted file mode 100644 index a07047b1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.inc +++ /dev/null @@ -1,83 +0,0 @@ -nextSibling; $node; $node = $node->nextSibling) { - if ($node->nodeType !== XML_ELEMENT_NODE) { - continue; - } - - for ($node = $fields->nextSibling; $node; $node = $node->nextSibling) { - if ($node->nodeType !== XML_ELEMENT_NODE) { - continue; - } - } -} - -$a = $b ? $c : $d; -$a = $b === true ? $c : $d; - -$this->_args = $this->_getArgs(($_SERVER['argv'] ?? [])); -$args = ($_SERVER['argv'] ?? []); - -$a = [ - 'a' => ($foo) ? $foo : $bar, -]; - -$a = [ - 'a' => ($foo) ? fn() => return 1 : fn() => return 2, -]; - -$var = $foo->something(!$var); -$var = $foo?->something(!$var); - -$callback = function ($value) { - if ($value > 10) { - return false; - } -}; - -function issue3616() { - $food = 'cake'; - - $returnValue = match (true) { - $food === 'apple' => 'This food is an apple', - $food === 'bar' => 'This food is a bar', - $food === 'cake' => 'This food is a cake', - }; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php deleted file mode 100644 index 9c0f7e33..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowComparisonAssignmentUnitTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowComparisonAssignment sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowComparisonAssignmentSniff - */ -final class DisallowComparisonAssignmentUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 10 => 1, - 52 => 1, - 53 => 1, - 58 => 1, - 62 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc deleted file mode 100644 index f57e0710..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.inc +++ /dev/null @@ -1,18 +0,0 @@ - $x; - -$b = fn ($b) => $b ? true : false; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js deleted file mode 100644 index 56387c06..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.js +++ /dev/null @@ -1,2 +0,0 @@ -x = (x?a:x); -id = id.replace(/row\/:/gi, ''); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php deleted file mode 100644 index 14f79c87..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowObEndFlush sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowInlineIfSniff - */ -final class DisallowInlineIfUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowInlineIfUnitTest.inc': - return [ - 8 => 1, - 18 => 1, - ]; - - case 'DisallowInlineIfUnitTest.js': - return [1 => 1]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.1.inc deleted file mode 100644 index b4d63fca..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.1.inc +++ /dev/null @@ -1,136 +0,0 @@ -fetch(PDO::FETCH_NUM)) { - $result[$row[0]] = array(); - $result[$row[0]][] = $current; - - self::$_inTransaction = TRUE; - parent::$_inTransaction = TRUE; - static::$_inTransaction = TRUE; - $$varName = $varValue; - } - -}//end getVar() - -class myClass -{ - private static $_dbh = NULL; - public $dbh = NULL; - protected $dbh = NULL; - var $dbh = NULL; // Old PHP4 compatible code. -} - -A::$a = 'b'; -\A::$a = 'c'; -\A\B\C::$d = 'd'; -B\C::$d = 'e'; - -@$a = 1; - -$a = []; -foreach ($a as $b) - $c = 'd'; - -$var = $var2; -list ($a, $b) = explode(',', $c); -$var1 ? $var2 = 0 : $var2 = 1; - -$obj->$classVar = $prefix.'-'.$type; - -$closureWithDefaultParamter = function(array $testArray=array()) {}; -?> - - - 10, - false => 0 - }, -]; - -$arrow_function = fn ($a = null) => $a; - -function ($html) { - $regEx = '/regexp/'; - - return preg_replace_callback($regEx, function ($matches) { - [$all] = $matches; - return $all; - }, $html); -}; - - -function () { - $a = false; - - some_label: - - $b = getB(); -}; - -?> - - -// Issue PHPCSStandards/PHP_CodeSniffer#537. - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.2.inc deleted file mode 100644 index 3befd507..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.2.inc +++ /dev/null @@ -1,7 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowMultipleAssignments sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowMultipleAssignmentsSniff - */ -final class DisallowMultipleAssignmentsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the test file to process. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowMultipleAssignmentsUnitTest.1.inc': - return [ - 4 => 1, - 5 => 2, - 7 => 1, - 9 => 1, - 12 => 1, - 14 => 1, - 15 => 1, - 79 => 1, - 85 => 1, - ]; - - default: - return []; - } - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc deleted file mode 100644 index 56802e37..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.inc +++ /dev/null @@ -1,58 +0,0 @@ -children); $i++) { -} - - - -for ($i = 0; $i < sizeof($array); $i++) { -} - -$num = sizeof($array); - -while ($i < sizeof($array)) { -} - -do { -} while ($i < sizeof($array)); - -for ($i = 0; $i < sizeof($this->children); $i++) { -} - - - - -for ($i = 0; $i < strlen($string); $i++) { -} - -$num = strlen($string); - -while ($i < strlen($string)) { -} - -do { -} while ($i < strlen($string)); - -for ($i = 0; $i < strlen($this->string); $i++) { -} - -for ($i = sizeof($array); $i > 0; $i--) { -} - -do { - echo $a->count; - $a->count--; -} while($a->count); - -for ($i = 0; $i < $a->count; $i++) {} -for ($i = 0; $i < $a?->count; $i++) {} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js deleted file mode 100644 index 8f7f7b94..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.js +++ /dev/null @@ -1,13 +0,0 @@ -for (var i = 0; i < permissions.length; i++) { - // Code here. -} - -var permLen = permissions.length; -for (var length = 0; i < permLen; i++) { - // Code here. -} - -var myArray = [1, 2, 3, 4]; -for (var i = myArray.length; i >= 0; i--) { - var x = i; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php deleted file mode 100644 index 3f923ad6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DisallowSizeFunctionsInLoops sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowSizeFunctionsInLoopsSniff - */ -final class DisallowSizeFunctionsInLoopsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'DisallowSizeFunctionsInLoopsUnitTest.inc': - return [ - 2 => 1, - 7 => 1, - 11 => 1, - 13 => 1, - 18 => 1, - 23 => 1, - 27 => 1, - 29 => 1, - 35 => 1, - 40 => 1, - 44 => 1, - 46 => 1, - ]; - - case 'DisallowSizeFunctionsInLoopsUnitTest.js': - return [1 => 1]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc deleted file mode 100644 index 3c875d09..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/DiscouragedFunctionsUnitTest.inc +++ /dev/null @@ -1,7 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DiscouragedFunctions sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DiscouragedFunctionsSniff - */ -final class DiscouragedFunctionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [ - 2 => 1, - 3 => 1, - 4 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc deleted file mode 100644 index f28c5598..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc +++ /dev/null @@ -1,271 +0,0 @@ - - - -<?php echo $title ?> - - - - - hello - - - - - - - - - - - - - - - - - - - - - -section as $section) { - ?> - - - - - - section as $section) { - ?> -
    - - - - - - - - -?> - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - -
    - - - - - - - - - - - - - - - - -<?php echo $title; ?> - - - - - hello - - - - - - - - - - - - - - - - - - - -section as $section) { - ?> -
    - - - - - section as $section) { - ?> -
    - - - - - - - - - - - - -?> - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.15.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.15.inc deleted file mode 100644 index d8f05127..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.15.inc +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.16.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.16.inc deleted file mode 100644 index 754c241b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.16.inc +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.17.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.17.inc deleted file mode 100644 index 71de17bf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.17.inc +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc deleted file mode 100644 index 3d61d485..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc +++ /dev/null @@ -1,15 +0,0 @@ - - -
    - - -
    -

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc.fixed deleted file mode 100644 index 8c906d40..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.18.inc.fixed +++ /dev/null @@ -1,13 +0,0 @@ - - -
    - -
    -

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc deleted file mode 100644 index 34db64d6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc +++ /dev/null @@ -1,17 +0,0 @@ - - -
    - - -
    -

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc.fixed deleted file mode 100644 index b1738db5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.19.inc.fixed +++ /dev/null @@ -1,15 +0,0 @@ - - -
    - -
    -

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc deleted file mode 100644 index 755fd355..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed deleted file mode 100644 index e9073da9..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.2.inc.fixed +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc deleted file mode 100644 index 28cdbdaf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc +++ /dev/null @@ -1,15 +0,0 @@ - - -
    - - -
    -

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc.fixed deleted file mode 100644 index fcc24a27..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.20.inc.fixed +++ /dev/null @@ -1,16 +0,0 @@ - - -
    - - -
    -

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc deleted file mode 100644 index 1da67a2e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc +++ /dev/null @@ -1,15 +0,0 @@ - - -
    - - -
    -

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc.fixed deleted file mode 100644 index d7487b50..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.21.inc.fixed +++ /dev/null @@ -1,16 +0,0 @@ - - -
    - - -
    -

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc deleted file mode 100644 index 5196a3b4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.22.inc +++ /dev/null @@ -1,30 +0,0 @@ -
    Inline HTML with indent to demonstrate the bug in the indent calculation.
    - - - - - - - - -Inline HTML with indent to demonstrate the bug in the indent calculation.
    - - - - - - - - - - - -
    - - -
    -

    Some more content after the last PHP tag block.

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc deleted file mode 100644 index 2d608490..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.3.inc +++ /dev/null @@ -1,123 +0,0 @@ - - - -<?= $title ?> - - - - - hello - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -// Safeguard fixing when there is no whitespace between the close tag and the contents. - - - - - - - - - -<?= $title; ?> - - - - - hello - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// Safeguard fixing when there is no whitespace between the close tag and the contents. - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed deleted file mode 100644 index b7985cc5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.4.inc.fixed +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc deleted file mode 100644 index f4d8d8a0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.5.inc +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - -
    - - - - - - - -
    - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the EmbeddedPhp sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EmbeddedPhpSniff - */ -final class EmbeddedPhpUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'EmbeddedPhpUnitTest.1.inc': - return [ - 7 => 1, - 12 => 1, - 18 => 1, - 19 => 2, - 20 => 1, - 21 => 1, - 22 => 3, - 24 => 1, - 26 => 1, - 29 => 1, - 30 => 1, - 31 => 1, - 34 => 1, - 36 => 1, - 40 => 1, - 41 => 1, - 44 => 1, - 45 => 1, - 49 => 1, - 59 => 1, - 63 => 1, - 93 => 1, - 94 => 2, - 100 => 1, - 102 => 1, - 112 => 1, - 113 => 1, - 116 => 1, - 117 => 1, - 120 => 1, - 121 => 1, - 128 => 1, - 129 => 1, - 132 => 1, - 134 => 1, - 136 => 1, - 138 => 1, - 142 => 1, - 145 => 1, - 151 => 1, - 158 => 1, - 165 => 1, - 169 => 1, - 175 => 1, - 176 => 2, - 178 => 1, - 179 => 1, - 180 => 2, - 181 => 1, - 189 => 1, - 212 => 1, - 214 => 2, - 219 => 1, - 223 => 1, - 225 => 1, - 226 => 1, - 227 => 2, - 228 => 1, - 235 => 1, - 241 => 1, - 248 => 1, - 253 => 1, - 258 => 1, - 263 => 1, - 264 => 1, - ]; - - case 'EmbeddedPhpUnitTest.2.inc': - case 'EmbeddedPhpUnitTest.4.inc': - return [ - 5 => 2, - 6 => 2, - 7 => 2, - ]; - - case 'EmbeddedPhpUnitTest.3.inc': - return [ - 10 => 1, - 15 => 1, - 21 => 1, - 22 => 2, - 23 => 1, - 24 => 1, - 25 => 3, - 28 => 1, - 29 => 1, - 30 => 1, - 33 => 1, - 35 => 1, - 39 => 1, - 40 => 1, - 43 => 1, - 44 => 1, - 48 => 1, - 53 => 1, - 55 => 1, - 61 => 1, - 62 => 1, - 65 => 2, - 66 => 2, - 69 => 1, - 70 => 1, - 75 => 1, - 82 => 1, - 89 => 1, - 93 => 1, - 98 => 2, - 99 => 1, - 103 => 2, - 105 => 1, - 111 => 1, - 112 => 2, - 114 => 1, - 115 => 1, - 116 => 2, - 117 => 1, - ]; - - case 'EmbeddedPhpUnitTest.5.inc': - return [ - 16 => 1, - 18 => 1, - 25 => 1, - 26 => 1, - 29 => 1, - 31 => 1, - 33 => 1, - 35 => 1, - 39 => 1, - 42 => 1, - ]; - - case 'EmbeddedPhpUnitTest.12.inc': - case 'EmbeddedPhpUnitTest.13.inc': - return [ - 10 => 1, - 12 => 1, - ]; - - case 'EmbeddedPhpUnitTest.18.inc': - return [11 => 1]; - - case 'EmbeddedPhpUnitTest.19.inc': - return [13 => 1]; - - case 'EmbeddedPhpUnitTest.20.inc': - case 'EmbeddedPhpUnitTest.21.inc': - return [12 => 2]; - - case 'EmbeddedPhpUnitTest.22.inc': - return [ - 14 => 1, - 22 => 2, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc deleted file mode 100644 index ee4c73e5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.inc +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php deleted file mode 100644 index db0af7f0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EvalUnitTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the Eval sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EvalSniff - */ -final class EvalUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [ - 2 => 1, - 4 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc deleted file mode 100644 index 4b2a2109..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.inc +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php deleted file mode 100644 index c0c79baa..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/GlobalKeywordUnitTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the GlobalKeyword sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\GlobalKeywordSniff - */ -final class GlobalKeywordUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 8 => 1, - 9 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc deleted file mode 100644 index d1863c07..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.1.inc +++ /dev/null @@ -1,12 +0,0 @@ -foo. -Now, I am printing some {$foo->bar[1]}. -This should not print a capital 'A': \x41 -EOT; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc deleted file mode 100644 index eb0062f0..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.2.inc +++ /dev/null @@ -1,17 +0,0 @@ - 'a' -<<<<<<< HEAD - 'b' => 'b' -======= - 'c' => 'c' ->>>>>>> master - ); - } diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php deleted file mode 100644 index 5d78d893..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the Heredoc sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\HeredocSniff - */ -final class HeredocUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'HeredocUnitTest.1.inc': - return [ - 2 => 1, - 8 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc deleted file mode 100644 index d16c7f2e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/InnerFunctionsUnitTest.inc +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the InnerFunctions sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\InnerFunctionsSniff - */ -final class InnerFunctionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 46 => 1, - 55 => 1, - 83 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc deleted file mode 100644 index 702b13de..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc +++ /dev/null @@ -1,50 +0,0 @@ -Count(); -$count = $object::Count(); -$count = $object->count(); -$count = $object::count(); -class MyClass { - public function Count() {} -} - -function &Sort() { - -} - -$connection = new Db\Adapter\Pdo\Mysql($config); - -namespace Strtolower\Silly; - -use function strToUpper as somethingElse; -use function MyClass\WordsToUpper as UCWords; // Intentional redeclared function error. -use function strToUpper\NotTheFunction; - -class ArrayUnique {} - -$sillyComments = strToLower /*comment*/ ($string); - -$callToGlobalFunction = \STR_REPEAT($a, 2); -$callToGlobalFunction = \ /*comment*/ str_Repeat($a, 2); - -$callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT($a, 2); -$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative. - -$filePath = new \File($path); - -$count = $object?->Count(); - -class AttributesShouldBeIgnored -{ - #[Putenv('FOO', 'foo')] - public function foo(): void - {} -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed deleted file mode 100644 index 281425c5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.inc.fixed +++ /dev/null @@ -1,50 +0,0 @@ -Count(); -$count = $object::Count(); -$count = $object->count(); -$count = $object::count(); -class MyClass { - public function Count() {} -} - -function &Sort() { - -} - -$connection = new Db\Adapter\Pdo\Mysql($config); - -namespace Strtolower\Silly; - -use function strtoupper as somethingElse; -use function MyClass\WordsToUpper as UCWords; // Intentional redeclared function error. -use function strToUpper\NotTheFunction; - -class ArrayUnique {} - -$sillyComments = strtolower /*comment*/ ($string); - -$callToGlobalFunction = \str_repeat($a, 2); -$callToGlobalFunction = \ /*comment*/ str_repeat($a, 2); - -$callToNamespacedFunction = MyNamespace /* phpcs:ignore Standard */ \STR_REPEAT($a, 2); -$callToNamespacedFunction = namespace\STR_REPEAT($a, 2); // Could potentially be false negative. - -$filePath = new \File($path); - -$count = $object?->Count(); - -class AttributesShouldBeIgnored -{ - #[Putenv('FOO', 'foo')] - public function foo(): void - {} -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php deleted file mode 100644 index 5feb363f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/LowercasePHPFunctionsUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LowercasePHPFunctions sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\LowercasePHPFunctionsSniff - */ -final class LowercasePHPFunctionsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 1, - 27 => 1, - 33 => 1, - 35 => 1, - 36 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc deleted file mode 100644 index 4b1d1ca6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc +++ /dev/null @@ -1,420 +0,0 @@ -{$action . 'JsonAction'}(); -} - -switch (true) { - case 1: - return foo( - function () { - $foo = $bar; // when this is removed it works ok - return false; // from here on it reports unreachable - } - ); -} - -for($i=0,$j=50; $i<100; $i++) { - while($j--) { - if($j==17) { - goto end; - echo 'unreachable'; - } - } -} - -switch ($var) { - case '1': - goto end; - echo 'hi'; - - case '2': - case '3': - if ($something === true) { - goto end; - echo 'hi'; - } - break; - default: - goto end; - - if ($something === true) { - goto end; - echo 'hi'; - } -} - -end: -echo 'j hit 17'; - -// Issue 2512. -class TestAlternativeControlStructures { - - public function alternative_switch_in_function( $var ) { - - switch ( $var ) : - case 'value1': - do_something(); - break; - - default: - case 'value2': - do_something_else(); - break; - endswitch; - } - - public function various_alternative_control_structures() { - $_while = 1; - - for ( $a = 0; $a++ < 1; ) : - foreach ( [ 1 ] as $b ) : - while ( $_while-- ) : - if ( 1 ) : - switch ( 1 ) : - default: - echo 'yay, we made it!'; - break; - endswitch; - endif; - endwhile; - endforeach; - endfor; - } -} - -$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. -}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc deleted file mode 100644 index 9b7a22bc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.2.inc +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -
    non-executable
    - - - - - - - - -
    non-executable
    - - - - - - - - -
    non-executable
    - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.4.inc deleted file mode 100644 index 189466b4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.4.inc +++ /dev/null @@ -1,6 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\PHP; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the NonExecutableCode sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\NonExecutableCodeSniff - */ -final class NonExecutableCodeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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($testFile='') - { - switch ($testFile) { - case 'NonExecutableCodeUnitTest.1.inc': - return [ - 5 => 1, - 11 => 1, - 17 => 1, - 18 => 1, - 19 => 2, - 28 => 1, - 32 => 1, - 33 => 2, - 34 => 2, - 42 => 1, - 45 => 1, - 54 => 1, - 58 => 1, - 73 => 1, - 83 => 1, - 95 => 1, - 105 => 1, - 123 => 1, - 147 => 1, - 150 => 1, - 153 => 1, - 166 => 1, - 180 => 1, - 232 => 1, - 240 => 1, - 246 => 1, - 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, - ]; - - case 'NonExecutableCodeUnitTest.2.inc': - return [ - 7 => 1, - 8 => 1, - 9 => 1, - 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, - ]; - default: - return []; - }//end switch - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc deleted file mode 100644 index 6df12cca..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc +++ /dev/null @@ -1,72 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the MemberVarScope sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MemberVarScopeSniff - */ -final class MemberVarScopeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 25 => 1, - 29 => 1, - 33 => 1, - 39 => 1, - 41 => 1, - 66 => 2, - 67 => 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. - * - * @return array - */ - public function getWarningList() - { - // Warning from getMemberProperties() about parse error. - return [71 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc deleted file mode 100644 index 3cc617d7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MethodScopeUnitTest.inc +++ /dev/null @@ -1,57 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the MethodScope sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff - */ -final class MethodScopeUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 6 => 1, - 30 => 1, - 39 => 1, - 46 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc deleted file mode 100644 index dd6530e8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc +++ /dev/null @@ -1,127 +0,0 @@ -func2()); - $result = $this->getValue($value); - return $this->setValue($result); - } - - public static function /* */ func1() - { - return $this->setValue($result); - } - - public static function - func1() - { - return $this->setValue($result); - } - - public function func1() - { - $value = 'hello'; - $newValue = array($this->func2()); - $result = $this->getValue($value); - return $this->setValue($result); - } - - function func1() - { - $value = 'hello'; - $newValue = array($this->func2()); - $result = $this->getValue($value); - return $this->setValue($result); - } - - public static function func1() { - return function() { - echo $this->name; - }; - } - - private static function func1(array $data) - { - return new class() - { - private $data; - - public function __construct(array $data) - { - $this->data = $data; - } - }; - } - - public function getAnonymousClass() { - return new class() { - public static function something() { - $this->doSomething(); - } - }; - } -} - -trait MyTrait { - public static function myFunc() { - $this->doSomething(); - } -} - -$b = new class() -{ - public static function myFunc() { - $this->doSomething(); - } - - public static function other() { - return fn () => $this->name; - } - - public static function anonClassUseThis() { - return new class($this) { - public function __construct($class) { - } - }; - } - - public static function anonClassAnotherThis() { - return new class() { - public function __construct() { - $this->id = 1; - } - }; - } - - public static function anonClassNestedUseThis() { - return new class(new class($this) {}) { - }; - } - - public static function anonClassNestedAnotherThis() { - return new class(new class() { - public function __construct() { - $this->id = 1; - } - }) { - }; - } - - public static function thisMustBeLowercase() { - $This = 'hey'; - - return $This; - } -} - -enum MyEnum { - private function notStatic () { - $this->doSomething(); - } - - public static function myFunc() { - $this->doSomething(); - } -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php deleted file mode 100644 index 543b5697..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Scope; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the StaticThisUsage sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\StaticThisUsageSniff - */ -final class StaticThisUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 7 => 1, - 8 => 1, - 9 => 1, - 14 => 1, - 20 => 1, - 41 => 1, - 61 => 1, - 69 => 1, - 76 => 1, - 80 => 1, - 84 => 1, - 99 => 1, - 125 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc deleted file mode 100644 index 3bf4186e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc +++ /dev/null @@ -1,49 +0,0 @@ -add_help_tab( array( -'id' => <<', -) ); - -// phpcs:set Squiz.Strings.ConcatenationSpacing spacing 1 - -$string = 'Hello'.$there.'. How are'.$you.$going. "today $okay"; -$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; -$string = 'Hello'.$there; -$string = 'Hello'. $there; -$string = 'Hello' .$there; - -// phpcs:set Squiz.Strings.ConcatenationSpacing ignoreNewlines true -$y = '1' - . '2' - . '3'; - -$y = '1' . - '2' . - '3'; - -$y = '1' -. '2' -. '3'; - -$y = '1' - .'2'. - '3' - . '4'; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed deleted file mode 100644 index b45f1a43..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,47 +0,0 @@ -add_help_tab( array( -'id' => <<', -) ); - -// phpcs:set Squiz.Strings.ConcatenationSpacing spacing 1 - -$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; -$string = 'Hello' . $there . '. How are' . $you . $going . "today $okay"; -$string = 'Hello' . $there; -$string = 'Hello' . $there; -$string = 'Hello' . $there; - -// phpcs:set Squiz.Strings.ConcatenationSpacing ignoreNewlines true -$y = '1' - . '2' - . '3'; - -$y = '1' . - '2' . - '3'; - -$y = '1' -. '2' -. '3'; - -$y = '1' - . '2' . - '3' - . '4'; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php deleted file mode 100644 index e59da3c6..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/ConcatenationSpacingUnitTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ConcatenationSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\ConcatenationSpacingSniff - */ -final class ConcatenationSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 5, - 5 => 1, - 6 => 1, - 9 => 1, - 10 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 16 => 5, - 22 => 1, - 27 => 5, - 29 => 1, - 30 => 1, - 31 => 1, - 47 => 2, - 49 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc deleted file mode 100644 index c8cc6383..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc +++ /dev/null @@ -1,37 +0,0 @@ -"; -$string = "Value: $var[test]"; -$string = "\0"; -$string = "\$var"; - -$x = "bar = '$z', -baz = '" . $a . "'...$x"; - -$string = "Hello -there"; -$string = 'Hello -there'; - -$string = "\123 \234"."\u123"."\e"; - -echo "window.location = \"".$url."\";\n"; -echo "" - -$string = "Hello - there"; - -function test() { - echo "It Worked'; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed deleted file mode 100644 index 97309194..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.inc.fixed +++ /dev/null @@ -1,37 +0,0 @@ -"; -$string = "Value: $var[test]"; -$string = "\0"; -$string = '$var'; - -$x = "bar = '$z', -baz = '" . $a . "'...$x"; - -$string = 'Hello -there'; -$string = 'Hello -there'; - -$string = "\123 \234"."\u123"."\e"; - -echo 'window.location = "'.$url."\";\n"; -echo '' - -$string = 'Hello - there'; - -function test() { - echo "It Worked'; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php deleted file mode 100644 index df50beee..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/DoubleQuoteUsageUnitTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the DoubleQuoteUsage sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\DoubleQuoteUsageSniff - */ -final class DoubleQuoteUsageUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 5 => 1, - 6 => 1, - 8 => 2, - 14 => 1, - 15 => 1, - 17 => 1, - 19 => 1, - 20 => 1, - 22 => 1, - 29 => 1, - 30 => 1, - 32 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc deleted file mode 100644 index 9e0391da..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc +++ /dev/null @@ -1,13 +0,0 @@ -returndate == 0) ? 'Not returned' : date('d/m/Y', $loan_device->returndate); -?> -

    -

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed deleted file mode 100644 index 37c7d24c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.inc.fixed +++ /dev/null @@ -1,13 +0,0 @@ -returndate == 0) ? 'Not returned' : date('d/m/Y', $loan_device->returndate); -?> -

    -

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php deleted file mode 100644 index dd8ead06..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Strings/EchoedStringsUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\Strings; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the EchoedStrings sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\EchoedStringsSniff - */ -final class EchoedStringsUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 5 => 1, - 6 => 1, - 7 => 1, - 8 => 1, - 9 => 1, - 13 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc deleted file mode 100644 index fa65112f..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc +++ /dev/null @@ -1,9 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the CastSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff - */ -final class CastSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - 9 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc deleted file mode 100644 index 70abae43..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc +++ /dev/null @@ -1,269 +0,0 @@ - -
    - - - -
    - children as $child) { - // There should be no error after this - // foreach, because it is followed by a - // close PHP tag. - } - ?> -
    -children as $child) { - echo $child; - -} - -if ($defaultPageDesign === 0 - && $defaultCascade === TRUE - && $defaultChildDesign === 0 -) { - $settingsUpdated = FALSE; -} - -foreach ( $blah as $var ) { - if ( $blah ) { - } -} - -if ( - $defaultPageDesign === 0 - && $defaultCascade === TRUE - && $defaultChildDesign === 0 -) { - $settingsUpdated = FALSE; -} - -$moo = 'blar'; -switch ($moo) -{ - case 'blar': - if ($moo === 'blar2') { - $moo = 'blar' - } - return $moo; - - default: - $moo = 'moo'; - break; -} - -do { -} -while (true); - -try { - // Something -} catch (Exception $e) { - // Something -} - -try { - - // Something - -} catch (Exception $e) { - - // Something - -} - -if ($one) { -} -elseif ($two) { -} -// else if something -else if ($three) { -} // else do something -else { -} - -if ($one) { - -} - -do { - echo 'hi'; -} while ( $blah ); - -if ($one) { -} -// No blank line here. -if ($two) { -} - -switch ($moo) -{ - case 'blar': - if ($moo === 'blar2') { - $moo = 'blar' - } - - return $moo; -} - -try { - // Something -} -catch (Exception $e) { - // Something -} -finally { - // Something -} - -if ($foo) { - - - /** - * Comment - */ - function foo() { - // Code here - } - - - /** - * Comment - */ - class bar() { - - }//end class - - -} - -if (true) { // some comment goes here - - echo 'foo'; -} - -if (true) { echo 'foo'; - - echo 'foo'; -} - -if ($true) { - echo 'hi 2'; -}//end if -echo 'hi'; - -if ($true) { - echo 'hi 2'; -} // phpcs:enable Standard.Category.Sniff -- for reasons. -echo 'hi'; - -?> - - - - - - - 1, - 2 => 2, - -}; -echo $expr; - -if($true) { - - enum SomeEnum {} - -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed deleted file mode 100644 index c64de25e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,261 +0,0 @@ - - - - - -
    - children as $child) { - // There should be no error after this - // foreach, because it is followed by a - // close PHP tag. - } - ?> -
    -children as $child) { - echo $child; -} - -if ($defaultPageDesign === 0 - && $defaultCascade === TRUE - && $defaultChildDesign === 0 -) { - $settingsUpdated = FALSE; -} - -foreach ($blah as $var) { - if ($blah) { - } -} - -if ($defaultPageDesign === 0 - && $defaultCascade === TRUE - && $defaultChildDesign === 0 -) { - $settingsUpdated = FALSE; -} - -$moo = 'blar'; -switch ($moo) -{ - case 'blar': - if ($moo === 'blar2') { - $moo = 'blar' - } - return $moo; - - default: - $moo = 'moo'; - break; -} - -do { -} -while (true); - -try { - // Something -} catch (Exception $e) { - // Something -} - -try { - // Something -} catch (Exception $e) { - // Something -} - -if ($one) { -} -elseif ($two) { -} -// else if something -else if ($three) { -} // else do something -else { -} - -if ($one) { -} - -do { - echo 'hi'; -} while ($blah); - -if ($one) { -} - -// No blank line here. -if ($two) { -} - -switch ($moo) -{ - case 'blar': - if ($moo === 'blar2') { - $moo = 'blar' - } - return $moo; -} - -try { - // Something -} -catch (Exception $e) { - // Something -} -finally { - // Something -} - -if ($foo) { - - - /** - * Comment - */ - function foo() { - // Code here - } - - - /** - * Comment - */ - class bar() { - - }//end class - - -} - -if (true) { // some comment goes here - echo 'foo'; -} - -if (true) { echo 'foo'; - - echo 'foo'; -} - -if ($true) { - echo 'hi 2'; -}//end if - -echo 'hi'; - -if ($true) { - echo 'hi 2'; -} // phpcs:enable Standard.Category.Sniff -- for reasons. - -echo 'hi'; - -?> - - - - - - 1, - 2 => 2, -}; - -echo $expr; - -if($true) { - - enum SomeEnum {} - -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js deleted file mode 100644 index 1c889a1c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js +++ /dev/null @@ -1,93 +0,0 @@ - -if (something) { -} -for (i = 0; i < 10; i++) { -} - -while (true) { - for (i = 0; i < 10; i++) { - } - if (something) { - } - - do { - } while (true); - -} - -if (one) { -} else (two) { -} else if (three) { -} -if (one) { -} else (two) { -} else if (three) { -} - -switch (blah) { - case 'one': - if (blah) { - // There are no spaces before break. - } - break; - - default: - if (blah) { - // There are no spaces before break. - } - break; -} - -switch (blah) { - case 'one': - if (blah) { - // There are no spaces before break. - } - break; - - default: - if (blah) { - // Code here. - } -} - -for (i = 0; i < 10; i++) { - if (blah) { - } - break; -} - -while (true) { - for (i = 0; i < 10; i++) { - - if (something) { - } - - } - - do { - - alert(i); - } while (true); -} - -for ( i = 0; i < 10; i++ ) { - if ( blah ) { - } -} - -var x = { - a: function () { - if (blah) { - } - - }, -}; - -if (one) { -} -// else if something -else if (two) { -} // else do something -else { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed deleted file mode 100644 index bb979bc8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.js.fixed +++ /dev/null @@ -1,93 +0,0 @@ - -if (something) { -} - -for (i = 0; i < 10; i++) { -} - -while (true) { - for (i = 0; i < 10; i++) { - } - - if (something) { - } - - do { - } while (true); -} - -if (one) { -} else (two) { -} else if (three) { -} - -if (one) { -} else (two) { -} else if (three) { -} - -switch (blah) { - case 'one': - if (blah) { - // There are no spaces before break. - } - break; - - default: - if (blah) { - // There are no spaces before break. - } - break; -} - -switch (blah) { - case 'one': - if (blah) { - // There are no spaces before break. - } - break; - - default: - if (blah) { - // Code here. - } -} - -for (i = 0; i < 10; i++) { - if (blah) { - } - - break; -} - -while (true) { - for (i = 0; i < 10; i++) { - if (something) { - } - } - - do { - alert(i); - } while (true); -} - -for (i = 0; i < 10; i++) { - if (blah) { - } -} - -var x = { - a: function () { - if (blah) { - } - - }, -}; - -if (one) { -} -// else if something -else if (two) { -} // else do something -else { -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php deleted file mode 100644 index c5567cb7..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ControlStructureSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff - */ -final class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ControlStructureSpacingUnitTest.inc': - return [ - 3 => 1, - 5 => 1, - 8 => 1, - 15 => 1, - 23 => 1, - 74 => 1, - 79 => 1, - 82 => 1, - 83 => 1, - 87 => 1, - 103 => 1, - 113 => 2, - 114 => 2, - 118 => 1, - 150 => 1, - 153 => 1, - 154 => 1, - 157 => 1, - 170 => 1, - 176 => 2, - 179 => 1, - 189 => 1, - 225 => 1, - 237 => 1, - 242 => 1, - 246 => 1, - 248 => 1, - 257 => 3, - 261 => 1, - 262 => 1, - ]; - - case 'ControlStructureSpacingUnitTest.js': - return [ - 3 => 1, - 9 => 1, - 15 => 1, - 21 => 1, - 56 => 1, - 61 => 1, - 64 => 1, - 65 => 1, - 68 => 1, - 74 => 2, - 75 => 2, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc deleted file mode 100644 index e831e257..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.inc +++ /dev/null @@ -1,39 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionClosingBraceSpace sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionClosingBraceSpaceSniff - */ -final class FunctionClosingBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FunctionClosingBraceSpaceUnitTest.inc': - return [ - 10 => 1, - 21 => 1, - 28 => 1, - 29 => 1, - 31 => 1, - 39 => 1, - ]; - - case 'FunctionClosingBraceSpaceUnitTest.js': - return [ - 13 => 1, - 25 => 1, - 32 => 1, - 53 => 1, - 59 => 1, - 67 => 1, - 84 => 1, - 128 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc deleted file mode 100644 index fe2c903b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.inc +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionOpeningBraceSpace sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionOpeningBraceSpaceSniff - */ -final class FunctionOpeningBraceSpaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FunctionOpeningBraceSpaceUnitTest.inc': - return [ - 10 => 1, - 25 => 1, - 49 => 1, - ]; - - case 'FunctionOpeningBraceSpaceUnitTest.js': - return [ - 11 => 1, - 31 => 1, - 38 => 1, - 88 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc deleted file mode 100644 index b03a0ed8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc +++ /dev/null @@ -1,584 +0,0 @@ -setLogger(new class { - public function a(){} - private function b(){} - protected function c(){} -}); - -?> - -setLogger(new class { - - public function a(){} - - private function b(){} - - protected function c(){} - -}); - -?> - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the FunctionSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionSpacingSniff - */ -final class FunctionSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'FunctionSpacingUnitTest.1.inc': - return [ - 26 => 1, - 35 => 1, - 44 => 1, - 51 => 1, - 55 => 1, - 61 => 1, - 64 => 1, - 66 => 1, - 81 => 1, - 100 => 1, - 111 => 1, - 113 => 1, - 119 => 2, - 141 => 1, - 160 => 1, - 173 => 2, - 190 => 1, - 224 => 2, - 281 => 1, - 282 => 1, - 295 => 1, - 297 => 1, - 303 => 1, - 327 => 1, - 329 => 1, - 338 => 1, - 344 => 1, - 345 => 1, - 354 => 2, - 355 => 1, - 356 => 1, - 360 => 2, - 361 => 1, - 362 => 1, - 385 => 1, - 399 => 1, - 411 => 2, - 418 => 2, - 426 => 2, - 432 => 1, - 437 => 1, - 438 => 1, - 442 => 2, - 444 => 1, - 449 => 1, - 458 => 2, - 459 => 1, - 460 => 1, - 465 => 2, - 466 => 1, - 467 => 1, - 471 => 1, - 473 => 2, - 475 => 1, - 478 => 2, - 479 => 1, - 483 => 2, - 495 => 1, - 529 => 1, - 539 => 1, - 547 => 2, - 551 => 1, - 553 => 1, - 560 => 1, - 566 => 1, - 580 => 2, - 583 => 3, - ]; - - case 'FunctionSpacingUnitTest.2.inc': - return [2 => 1]; - - case 'FunctionSpacingUnitTest.3.inc': - return [7 => 1]; - - case 'FunctionSpacingUnitTest.5.inc': - return [5 => 1]; - - case 'FunctionSpacingUnitTest.6.inc': - return [10 => 1]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc deleted file mode 100644 index e8f2edad..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.inc +++ /dev/null @@ -1,43 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LanguageConstructSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LanguageConstructSpacingSniff - */ -final class LanguageConstructSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 7 => 1, - 11 => 1, - 15 => 1, - 19 => 1, - 23 => 1, - 27 => 1, - 31 => 1, - 34 => 1, - 35 => 1, - 39 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc deleted file mode 100644 index c2f4ec7d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.inc +++ /dev/null @@ -1,19 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the LogicalOperatorSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LogicalOperatorSpacingSniff - */ -final class LogicalOperatorSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 2, - 5 => 3, - 6 => 3, - 15 => 1, - 17 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc deleted file mode 100644 index 12b55176..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc +++ /dev/null @@ -1,374 +0,0 @@ - 'a', 'b' => 'b' ), - $varQ = 'string', - $varR = 123; -} - -// Make sure the determination of whether a property is the first property or not is done correctly. -class ClassUsingSimpleTraits -{ - use HelloWorld; - - - /* comment */ - public $firstVar = array( 'a', 'b' ); - protected $secondVar = true; -} - -class ClassUsingComplexTraits -{ - use A, B { - B::smallTalk insteadof A; - A::bigTalk insteadof B; - } - - - - public $firstVar = array( 'a', 'b' ); - - - /* comment */ - protected $secondVar = true; -} - -class Foo -{ - - - private function foo() - { - } - - - /* no error here because after function */ - private $bar = false; -} - -class CommentedOutCodeAtStartOfClass { - - /** - * Description. - * - * @var bool - */ - //public $commented_out_property = true; - - /** - * Description. - * - * @var bool - */ - public $property = true; -} - -class CommentedOutCodeAtStartOfClassNoBlankLine { - - // phpcs:disable Stnd.Cat.Sniff -- For reasons. - /** - * Description. - * - * @var bool - */ - public $property = true; -} - -class HasAttributes -{ - /** - * Short description of the member variable. - * - * @var array - */ - - #[ORM\Id]#[ORM\Column("integer")] - - private $id; - - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\GeneratedValue] - - #[ORM\Column(ORM\Column::T_INTEGER)] - protected $height; - - #[SingleAttribute] - protected $propertySingle; - - #[FirstAttribute] - #[SecondAttribute] - protected $propertyDouble; - #[ThirdAttribute] - protected $propertyWithoutSpacing; -} - -enum SomeEnum -{ - // Enum cannot have properties - - case ONE = 'one'; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed deleted file mode 100644 index d683eaad..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,359 +0,0 @@ - 'a', 'b' => 'b' ), - $varQ = 'string', - $varR = 123; -} - -// Make sure the determination of whether a property is the first property or not is done correctly. -class ClassUsingSimpleTraits -{ - use HelloWorld; - - /* comment */ - public $firstVar = array( 'a', 'b' ); - - protected $secondVar = true; -} - -class ClassUsingComplexTraits -{ - use A, B { - B::smallTalk insteadof A; - A::bigTalk insteadof B; - } - - public $firstVar = array( 'a', 'b' ); - - /* comment */ - protected $secondVar = true; -} - -class Foo -{ - - - private function foo() - { - } - - - /* no error here because after function */ - private $bar = false; -} - -class CommentedOutCodeAtStartOfClass { - - /** - * Description. - * - * @var bool - */ - //public $commented_out_property = true; - - /** - * Description. - * - * @var bool - */ - public $property = true; -} - -class CommentedOutCodeAtStartOfClassNoBlankLine { - - // phpcs:disable Stnd.Cat.Sniff -- For reasons. - - /** - * Description. - * - * @var bool - */ - public $property = true; -} - -class HasAttributes -{ - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\Id]#[ORM\Column("integer")] - private $id; - - /** - * Short description of the member variable. - * - * @var array - */ - #[ORM\GeneratedValue] - #[ORM\Column(ORM\Column::T_INTEGER)] - protected $height; - - #[SingleAttribute] - protected $propertySingle; - - #[FirstAttribute] - #[SecondAttribute] - protected $propertyDouble; - - #[ThirdAttribute] - protected $propertyWithoutSpacing; -} - -enum SomeEnum -{ - // Enum cannot have properties - - case ONE = 'one'; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php deleted file mode 100644 index 548ee3ba..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the MemberVarSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\MemberVarSpacingSniff - */ -final class MemberVarSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 4 => 1, - 7 => 1, - 20 => 1, - 30 => 1, - 35 => 1, - 44 => 1, - 50 => 1, - 73 => 1, - 86 => 1, - 106 => 1, - 115 => 1, - 150 => 1, - 160 => 1, - 165 => 1, - 177 => 1, - 186 => 1, - 200 => 1, - 209 => 1, - 211 => 1, - 224 => 1, - 229 => 1, - 241 => 1, - 246 => 1, - 252 => 1, - 254 => 1, - 261 => 1, - 275 => 1, - 276 => 1, - 288 => 1, - 292 => 1, - 333 => 1, - 342 => 1, - 346 => 1, - 353 => 1, - 357 => 1, - 366 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc deleted file mode 100644 index 67f8ee14..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc +++ /dev/null @@ -1,52 +0,0 @@ -testThis(); -$this-> testThis(); -$this -> testThis(); -$this-> /* comment here */testThis(); -$this/* comment here */ -> testThis(); -$this - ->testThis(); -$this-> - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true - -$this->testThis(); -$this-> testThis(); -$this -> testThis(); -$this->/* comment here */testThis(); -$this/* comment here */ -> testThis(); -$this - ->testThis(); -$this-> - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false - -thisObject::testThis(); -thisObject:: testThis(); -thisObject :: testThis(); -thisObject::/* comment here */testThis(); -thisObject/* comment here */ :: testThis(); -thisObject - ::testThis(); -thisObject:: - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true - -thisObject::testThis(); -thisObject:: testThis(); -thisObject :: testThis(); -thisObject::/* comment here */testThis(); -thisObject/* comment here */ :: testThis(); -thisObject - ::testThis(); -thisObject:: - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false - -$this?->testThis(); -$this?-> testThis(); -$this ?-> testThis(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed deleted file mode 100644 index 730b8e4a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,48 +0,0 @@ -testThis(); -$this->testThis(); -$this->testThis(); -$this->/* comment here */testThis(); -$this/* comment here */->testThis(); -$this->testThis(); -$this->testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true - -$this->testThis(); -$this->testThis(); -$this->testThis(); -$this->/* comment here */testThis(); -$this/* comment here */->testThis(); -$this - ->testThis(); -$this-> - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false - -thisObject::testThis(); -thisObject::testThis(); -thisObject::testThis(); -thisObject::/* comment here */testThis(); -thisObject/* comment here */::testThis(); -thisObject::testThis(); -thisObject::testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines true - -thisObject::testThis(); -thisObject::testThis(); -thisObject::testThis(); -thisObject::/* comment here */testThis(); -thisObject/* comment here */::testThis(); -thisObject - ::testThis(); -thisObject:: - testThis(); - -// phpcs:set Squiz.WhiteSpace.ObjectOperatorSpacing ignoreNewlines false - -$this?->testThis(); -$this?->testThis(); -$this?->testThis(); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php deleted file mode 100644 index c1ef24a4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ObjectOperatorSpacingUnitTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ObjectOperatorSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ObjectOperatorSpacingSniff - */ -final class ObjectOperatorSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 4 => 2, - 5 => 1, - 6 => 2, - 8 => 1, - 9 => 1, - 15 => 1, - 16 => 2, - 18 => 2, - 27 => 1, - 28 => 2, - 30 => 2, - 32 => 1, - 33 => 1, - 39 => 1, - 40 => 2, - 42 => 2, - 51 => 1, - 52 => 2, - ]; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc deleted file mode 100644 index 29acf308..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc +++ /dev/null @@ -1,510 +0,0 @@ - $j && $k< $l && $m>= $n && $o<= $p && $q<> $r; - -$a ==$b && $c !=$d && $e ===$f && $g !==$h; -$i >$j && $k <$l && $m >=$n && $o <=$p && $q <>$r; - -function myFunction($variable=0, $var2='string') {} - -if (index > -1) { -} - -array_walk_recursive($array, function(&$item) use (&$something) { -}); - -$var = saveFile(&$model, &$foo); - -// This is all valid. -$boo = -$foo; -function foo($boo = -1) {} -$foo = array('boo' => -1); -$x = $test ? -1 : 1; -$y = $test ? 1 : -1; -$z = $test ?: false; - -$closureWithDefaultParameter = function (array $testArray=array()) {}; - -switch ($foo) { - case -1: - break; -} - -$y = 1 * -1; -$y = -1 * 1; -$y = -1 * $var; -$y = 10 / -2; -$y = -10 / 2; -$y = (-10 / 2); -$y = (-10 / $var); -$y = 10 + -2; -$y = -10 + 2; - -$a = $x?$y:$z; -$a = $x ? $y : $z; - -$y = 1 - + 2 - - 3; - -$y = 1 + - 2 - - 3; - -$y = 1 -+ 2 -- 3; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true -$y = 1 - + 2 - - 3; - -$y = 1 + - 2 - - 3; - -$y = 1 -+ 2 -- 3; -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false - -if (true || -1 == $b) { -} - -$var = array(-1); -$var = [-1]; -$var = [0, -1, -2]; - -$y = array(&$x); -$y = [&$x]; -$y = array(&$a, &$b, &$c); -$y = [&$a, &$b, &$c]; -$y = array(&$a => 1, 2 => &$b, &$c); -$y = [&$a => 1, 2 => &$b, &$c]; - -if ($a <=> $b) { -} - -if ($a <=>$b) { -} - -$a |= $b; -$a **= $b; -$a ??= $b; - -$a = +1; - -function bar($boo = +1) {} - -$username = $_GET['user']??'nobody'; - -function foo(string $bar, array $baz, ?MyClass $object) : MyClass {} - -declare(strict_types=1); - -function foo($c = ((BAR)?10:100)) {} - -$res = $a ?: $b; -$res = $a ?: $b; -$res = $a ?: $b; -$res = $a ?: $b; - -$res = $a ? : $b; -$res = $a ? : $b; -$res = $a ? : $b; -$res = $a ? : $b; - -function foo(string $a = '', ?string $b = ''): ?string {} - -// Issue #1605. -$text = preg_replace_callback( - self::CHAR_REFS_REGEX, - [ 'Sanitizer', 'decodeCharReferencesCallback' ], - $text, /* limit */ -1, $count ); - -if (true || /* test */ -1 == $b) {} -$y = 10 + /* test */ -2; - -// Issue #1604. -Hooks::run( 'ParserOptionsRegister', [ - &self::$defaults, - &self::$inCacheKey, - &self::$lazyOptions, -] ); - -$x = $foo ? function (): int { - return 1; -} : $bar; - -$x = $foo ? function ($foo) - // comment - : int { - return 1; -} : $bar; - -$x = $foo ? function ($foo) use /* comment */ ($bar): int { - return 1; -} : $bar; - -$x = !$foo ? $bar : function (): int { - return 1; -}; - -$a = - // Comment. - [ - 'a', - 'b', - ]; - -$a = -// phpcs:ignore Standard.Category.Sniff -- for reasons. -[ - 'a', - 'b', -]; - -$foo = is_array($bar) ? array_map( - function () {}, - $bar - ) : $bar; - -function bar(): array {} - -if ($line{-1} === ':') { - $line = substr($line, 0, -1); -} - -$a = $a instanceof $b; -$a = $a instanceof $b; -$a = ($a)instanceof$b; - -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; -func(-1); -$a = [-1]; -return -1; -print -1; -$a &= -1; -switch ($a) { - case -1: -} -$a = $a ?? -1; -$a .= -1; -$a /= -1; -$a = [1 => -1]; -$a = $a == -1; -$a = $a >= -1; -$a = $a === -1; -$a = $a != -1; -$a = $a !== -1; -$a = $a <= -1; -$a = $a <=> -1; -$a = $a and -1; -$a = $a or -1; -$a = $a xor -1; -$a -= -1; -$a %= -1; -$a *= -1; -$a |= -1; -$a += -1; -$a = $a ** -1; -$a **= -1; -$a = $a << -1; -$a <<= -1; -$a = $a >> -1; -$a >>= -1; -$a = (string) -1; -$a = (array) -1; -$a = (bool) -1; -$a = (object) -1; -$a = (unset) -1; -$a = (float) -1; -$a = (int) -1; -$a ^= -1; -$a = [$a, -1]; -$a = $a[-1]; -$a = $a ? -1 : -1; - -yield - 1; -echo - 1; -$a = - 1; -func(- 1); -$a = [- 1]; -return - 1; -print - 1; -$a &= - 1; -switch ($a) { - case - 1: -} -$a = $a ?? - 1; -$a .= - 1; -$a /= - 1; -$a = [1 => - 1]; -$a = $a == - 1; -$a = $a >= - 1; -$a = $a === - 1; -$a = $a != - 1; -$a = $a !== - 1; -$a = $a <= - 1; -$a = $a <=> - 1; -$a = $a and - 1; -$a = $a or - 1; -$a = $a xor - 1; -$a -= - 1; -$a %= - 1; -$a *= - 1; -$a |= - 1; -$a += - 1; -$a = $a ** - 1; -$a **= - 1; -$a = $a << - 1; -$a <<= - 1; -$a = $a >> - 1; -$a >>= - 1; -$a = (string) - 1; -$a = (array) - 1; -$a = (bool) - 1; -$a = (object) - 1; -$a = (unset) - 1; -$a = (float) - 1; -$a = (int) - 1; -$a ^= - 1; -$a = [$a, - 1]; -$a = $a[- 1]; -$a = $a ? - 1 : - 1; - - -yield -$b; -echo -$b; -$a = -$b; -func(-$b); -$a = [-$b]; -return -$b; -print -$b; -$a &= -$b; -switch ($a) { - case -$b: -} -$a = $a ?? -$b; -$a .= -$b; -$a /= -$b; -$a = [1 => -$b]; -$a = $a == -$b; -$a = $a >= -$b; -$a = $a === -$b; -$a = $a != -$b; -$a = $a !== -$b; -$a = $a <= -$b; -$a = $a <=> -$b; -$a = $a and -$b; -$a = $a or -$b; -$a = $a xor -$b; -$a -= -$b; -$a %= -$b; -$a *= -$b; -$a |= -$b; -$a += -$b; -$a = $a ** -$b; -$a **= -$b; -$a = $a << -$b; -$a <<= -$b; -$a = $a >> -$b; -$a >>= -$b; -$a = (string) -$b; -$a = (array) -$b; -$a = (bool) -$b; -$a = (object) -$b; -$a = (unset) -$b; -$a = (float) -$b; -$a = (int) -$b; -$a ^= -$b; -$a = [$a, -$b]; -$a = $a[-$b]; -$a = $a ? -$b : -$b; - -yield - $b; -echo - $b; -$a = - $b; -func(- $b); -$a = [- $b]; -return - $b; -print - $b; -$a &= - $b; -switch ($a) { - case - $b: -} -$a = $a ?? - $b; -$a .= - $b; -$a /= - $b; -$a = [1 => - $b]; -$a = $a == - $b; -$a = $a >= - $b; -$a = $a === - $b; -$a = $a != - $b; -$a = $a !== - $b; -$a = $a <= - $b; -$a = $a <=> - $b; -$a = $a and - $b; -$a = $a or - $b; -$a = $a xor - $b; -$a -= - $b; -$a %= - $b; -$a *= - $b; -$a |= - $b; -$a += - $b; -$a = $a ** - $b; -$a **= - $b; -$a = $a << - $b; -$a <<= - $b; -$a = $a >> - $b; -$a >>= - $b; -$a = (string) - $b; -$a = (array) - $b; -$a = (bool) - $b; -$a = (object) - $b; -$a = (unset) - $b; -$a = (float) - $b; -$a = (int) - $b; -$a ^= - $b; -$a = [$a, - $b]; -$a = $a[- $b]; -$a = $a ? - $b : - $b; - -exit -1; - -$cl = function ($boo =-1) {}; -$cl = function ($boo =+1) {}; -$fn = fn ($boo =-1) => $boo; -$fn = fn ($boo =+1) => $boo; - -$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); - -$a = 'a '.-MY_CONSTANT; -$a = 'a '.-$b; -$a = 'a '.- MY_CONSTANT; -$a = 'a '.- $b; - -match ($a) { - 'a' => -1, - 'b', 'c', 'd' => -2, - default => -3, -}; - -$foo = $var - ? 10 - : true; - -// Safeguard that a non-fixable error is thrown when there is a new line before the operator, -// but the last non-whitespace token before the operator is a comment token. -$foo = $var // Comment - ? false /* Comment */ - : true; - -$foo = $var // phpcs: ignore Stnd.Cat.Sniff -- for reasons. - - - ? $something /** - * Don't ask, but someone might have a docblock between the lines. It's valid PHP after all. - */ - - - : true; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true -$foo = $var // Comment - ? false // Comment - : true; -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc.fixed deleted file mode 100644 index 5c94e365..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.1.inc.fixed +++ /dev/null @@ -1,502 +0,0 @@ - $j && $k < $l && $m >= $n && $o <= $p && $q <> $r; - -$a == $b && $c != $d && $e === $f && $g !== $h; -$i > $j && $k < $l && $m >= $n && $o <= $p && $q <> $r; - -function myFunction($variable=0, $var2='string') {} - -if (index > -1) { -} - -array_walk_recursive($array, function(&$item) use (&$something) { -}); - -$var = saveFile(&$model, &$foo); - -// This is all valid. -$boo = -$foo; -function foo($boo = -1) {} -$foo = array('boo' => -1); -$x = $test ? -1 : 1; -$y = $test ? 1 : -1; -$z = $test ?: false; - -$closureWithDefaultParameter = function (array $testArray=array()) {}; - -switch ($foo) { - case -1: - break; -} - -$y = 1 * -1; -$y = -1 * 1; -$y = -1 * $var; -$y = 10 / -2; -$y = -10 / 2; -$y = (-10 / 2); -$y = (-10 / $var); -$y = 10 + -2; -$y = -10 + 2; - -$a = $x ? $y : $z; -$a = $x ? $y : $z; - -$y = 1 + 2 - 3; - -$y = 1 + 2 - 3; - -$y = 1 + 2 - 3; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true -$y = 1 - + 2 - - 3; - -$y = 1 + - 2 - - 3; - -$y = 1 -+ 2 -- 3; -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false - -if (true || -1 == $b) { -} - -$var = array(-1); -$var = [-1]; -$var = [0, -1, -2]; - -$y = array(&$x); -$y = [&$x]; -$y = array(&$a, &$b, &$c); -$y = [&$a, &$b, &$c]; -$y = array(&$a => 1, 2 => &$b, &$c); -$y = [&$a => 1, 2 => &$b, &$c]; - -if ($a <=> $b) { -} - -if ($a <=> $b) { -} - -$a |= $b; -$a **= $b; -$a ??= $b; - -$a = +1; - -function bar($boo = +1) {} - -$username = $_GET['user'] ?? 'nobody'; - -function foo(string $bar, array $baz, ?MyClass $object) : MyClass {} - -declare(strict_types=1); - -function foo($c = ((BAR) ? 10 : 100)) {} - -$res = $a ?: $b; -$res = $a ?: $b; -$res = $a ?: $b; -$res = $a ?: $b; - -$res = $a ? : $b; -$res = $a ? : $b; -$res = $a ? : $b; -$res = $a ? : $b; - -function foo(string $a = '', ?string $b = ''): ?string {} - -// Issue #1605. -$text = preg_replace_callback( - self::CHAR_REFS_REGEX, - [ 'Sanitizer', 'decodeCharReferencesCallback' ], - $text, /* limit */ -1, $count ); - -if (true || /* test */ -1 == $b) {} -$y = 10 + /* test */ -2; - -// Issue #1604. -Hooks::run( 'ParserOptionsRegister', [ - &self::$defaults, - &self::$inCacheKey, - &self::$lazyOptions, -] ); - -$x = $foo ? function (): int { - return 1; -} : $bar; - -$x = $foo ? function ($foo) - // comment - : int { - return 1; -} : $bar; - -$x = $foo ? function ($foo) use /* comment */ ($bar): int { - return 1; -} : $bar; - -$x = !$foo ? $bar : function (): int { - return 1; -}; - -$a = - // Comment. - [ - 'a', - 'b', - ]; - -$a = -// phpcs:ignore Standard.Category.Sniff -- for reasons. -[ - 'a', - 'b', -]; - -$foo = is_array($bar) ? array_map( - function () {}, - $bar - ) : $bar; - -function bar(): array {} - -if ($line{-1} === ':') { - $line = substr($line, 0, -1); -} - -$a = $a instanceof $b; -$a = $a instanceof $b; -$a = ($a) instanceof $b; - -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; -func(-1); -$a = [-1]; -return -1; -print -1; -$a &= -1; -switch ($a) { - case -1: -} -$a = $a ?? -1; -$a .= -1; -$a /= -1; -$a = [1 => -1]; -$a = $a == -1; -$a = $a >= -1; -$a = $a === -1; -$a = $a != -1; -$a = $a !== -1; -$a = $a <= -1; -$a = $a <=> -1; -$a = $a and -1; -$a = $a or -1; -$a = $a xor -1; -$a -= -1; -$a %= -1; -$a *= -1; -$a |= -1; -$a += -1; -$a = $a ** -1; -$a **= -1; -$a = $a << -1; -$a <<= -1; -$a = $a >> -1; -$a >>= -1; -$a = (string) -1; -$a = (array) -1; -$a = (bool) -1; -$a = (object) -1; -$a = (unset) -1; -$a = (float) -1; -$a = (int) -1; -$a ^= -1; -$a = [$a, -1]; -$a = $a[-1]; -$a = $a ? -1 : -1; - -yield - 1; -echo - 1; -$a = - 1; -func(- 1); -$a = [- 1]; -return - 1; -print - 1; -$a &= - 1; -switch ($a) { - case - 1: -} -$a = $a ?? - 1; -$a .= - 1; -$a /= - 1; -$a = [1 => - 1]; -$a = $a == - 1; -$a = $a >= - 1; -$a = $a === - 1; -$a = $a != - 1; -$a = $a !== - 1; -$a = $a <= - 1; -$a = $a <=> - 1; -$a = $a and - 1; -$a = $a or - 1; -$a = $a xor - 1; -$a -= - 1; -$a %= - 1; -$a *= - 1; -$a |= - 1; -$a += - 1; -$a = $a ** - 1; -$a **= - 1; -$a = $a << - 1; -$a <<= - 1; -$a = $a >> - 1; -$a >>= - 1; -$a = (string) - 1; -$a = (array) - 1; -$a = (bool) - 1; -$a = (object) - 1; -$a = (unset) - 1; -$a = (float) - 1; -$a = (int) - 1; -$a ^= - 1; -$a = [$a, - 1]; -$a = $a[- 1]; -$a = $a ? - 1 : - 1; - - -yield -$b; -echo -$b; -$a = -$b; -func(-$b); -$a = [-$b]; -return -$b; -print -$b; -$a &= -$b; -switch ($a) { - case -$b: -} -$a = $a ?? -$b; -$a .= -$b; -$a /= -$b; -$a = [1 => -$b]; -$a = $a == -$b; -$a = $a >= -$b; -$a = $a === -$b; -$a = $a != -$b; -$a = $a !== -$b; -$a = $a <= -$b; -$a = $a <=> -$b; -$a = $a and -$b; -$a = $a or -$b; -$a = $a xor -$b; -$a -= -$b; -$a %= -$b; -$a *= -$b; -$a |= -$b; -$a += -$b; -$a = $a ** -$b; -$a **= -$b; -$a = $a << -$b; -$a <<= -$b; -$a = $a >> -$b; -$a >>= -$b; -$a = (string) -$b; -$a = (array) -$b; -$a = (bool) -$b; -$a = (object) -$b; -$a = (unset) -$b; -$a = (float) -$b; -$a = (int) -$b; -$a ^= -$b; -$a = [$a, -$b]; -$a = $a[-$b]; -$a = $a ? -$b : -$b; - -yield - $b; -echo - $b; -$a = - $b; -func(- $b); -$a = [- $b]; -return - $b; -print - $b; -$a &= - $b; -switch ($a) { - case - $b: -} -$a = $a ?? - $b; -$a .= - $b; -$a /= - $b; -$a = [1 => - $b]; -$a = $a == - $b; -$a = $a >= - $b; -$a = $a === - $b; -$a = $a != - $b; -$a = $a !== - $b; -$a = $a <= - $b; -$a = $a <=> - $b; -$a = $a and - $b; -$a = $a or - $b; -$a = $a xor - $b; -$a -= - $b; -$a %= - $b; -$a *= - $b; -$a |= - $b; -$a += - $b; -$a = $a ** - $b; -$a **= - $b; -$a = $a << - $b; -$a <<= - $b; -$a = $a >> - $b; -$a >>= - $b; -$a = (string) - $b; -$a = (array) - $b; -$a = (bool) - $b; -$a = (object) - $b; -$a = (unset) - $b; -$a = (float) - $b; -$a = (int) - $b; -$a ^= - $b; -$a = [$a, - $b]; -$a = $a[- $b]; -$a = $a ? - $b : - $b; - -exit -1; - -$cl = function ($boo =-1) {}; -$cl = function ($boo =+1) {}; -$fn = fn ($boo =-1) => $boo; -$fn = fn ($boo =+1) => $boo; - -$fn = static fn(DateTime $a, DateTime $b): int => -($a->getTimestamp() <=> $b->getTimestamp()); - -$a = 'a '.-MY_CONSTANT; -$a = 'a '.-$b; -$a = 'a '.- MY_CONSTANT; -$a = 'a '.- $b; - -match ($a) { - 'a' => -1, - 'b', 'c', 'd' => -2, - default => -3, -}; - -$foo = $var ? 10 : true; - -// Safeguard that a non-fixable error is thrown when there is a new line before the operator, -// but the last non-whitespace token before the operator is a comment token. -$foo = $var // Comment - ? false /* Comment */ - : true; - -$foo = $var // phpcs: ignore Stnd.Cat.Sniff -- for reasons. - - - ? $something /** - * Don't ask, but someone might have a docblock between the lines. It's valid PHP after all. - */ - - - : true; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true -$foo = $var // Comment - ? false // Comment - : true; -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.2.inc deleted file mode 100644 index 3a0dbac3..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.2.inc +++ /dev/null @@ -1,3 +0,0 @@ -> y; -x >>= y; -x = x >>> y; -x >>>= y; - -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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed deleted file mode 100644 index 47c89302..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.js.fixed +++ /dev/null @@ -1,98 +0,0 @@ - - -result = 1 + 2; -result = 1 + 2; -result = 1 + 2; -result = 1 + 2; -result = 1 + 2; -result = 1 + 2; - -result = 1 - 2; -result = 1 - 2; -result = 1 - 2; -result = 1 - 2; -result = 1 - 2; -result = 1 - 2; - -result = 1 * 2; -result = 1 * 2; -result = 1 * 2; -result = 1 * 2; -result = 1 * 2; -result = 1 * 2; - -result = 1 / 2; -result = 1 / 2; -result = 1 / 2; -result = 1 / 2; -result = 1 / 2; -result = 1 / 2; - -result = 1 % 2; -result = 1 % 2; -result = 1 % 2; -result = 1 % 2; -result = 1 % 2; -result = 1 % 2; -result = '100%'; - -result += 4; -result += 4; -result -= 4; -result -= 4; -result /= 4; -result /= 4; -result *= 4; -result *= 4; - -$.localScroll({offset: {top: -32}}); - -switch (result) { - case -1: - break; -} - -result = x ? y : z; -result = x ? y : z; - -if (something === true - ^ somethingElse === true -) { - return false; -} - -y = 1 + 2 - 3; - -y = 1 + 2 - 3; - -y = 1 + 2 - 3; - -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines true -y = 1 - + 2 - - 3; - -y = 1 + - 2 - - 3; - -y = 1 -+ 2 -- 3; -// phpcs:set Squiz.WhiteSpace.OperatorSpacing ignoreNewlines false - -if (true || -1 == b) { -} - -x = x << y; -x <<= y; -x = x >> y; -x >>= y; -x = x >>> y; -x >>>= y; - -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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php deleted file mode 100644 index e34a2ec4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php +++ /dev/null @@ -1,180 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the OperatorSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\OperatorSpacingSniff - */ -final class OperatorSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'OperatorSpacingUnitTest.1.inc': - return [ - 4 => 1, - 5 => 2, - 6 => 1, - 7 => 1, - 8 => 2, - 11 => 1, - 12 => 2, - 13 => 1, - 14 => 1, - 15 => 2, - 18 => 1, - 19 => 2, - 20 => 1, - 21 => 1, - 22 => 2, - 25 => 1, - 26 => 2, - 27 => 1, - 28 => 1, - 29 => 2, - 32 => 1, - 33 => 2, - 34 => 1, - 35 => 1, - 36 => 2, - 40 => 2, - 42 => 2, - 44 => 2, - 45 => 1, - 46 => 2, - 53 => 4, - 54 => 3, - 59 => 10, - 64 => 1, - 77 => 4, - 78 => 1, - 79 => 1, - 80 => 2, - 81 => 1, - 84 => 6, - 85 => 6, - 87 => 4, - 88 => 5, - 90 => 4, - 91 => 5, - 128 => 4, - 132 => 1, - 133 => 1, - 135 => 1, - 136 => 1, - 140 => 1, - 141 => 1, - 174 => 1, - 177 => 1, - 178 => 1, - 179 => 1, - 185 => 2, - 191 => 4, - 194 => 1, - 195 => 1, - 196 => 2, - 199 => 1, - 200 => 1, - 201 => 2, - 239 => 1, - 246 => 1, - 265 => 2, - 266 => 2, - 271 => 2, - 487 => 1, - 488 => 1, - 493 => 1, - 494 => 1, - 499 => 1, - 504 => 1, - ]; - - case 'OperatorSpacingUnitTest.js': - return [ - 4 => 1, - 5 => 2, - 6 => 1, - 7 => 1, - 8 => 2, - 11 => 1, - 12 => 2, - 13 => 1, - 14 => 1, - 15 => 2, - 18 => 1, - 19 => 2, - 20 => 1, - 21 => 1, - 22 => 2, - 25 => 1, - 26 => 2, - 27 => 1, - 28 => 1, - 29 => 2, - 32 => 1, - 33 => 2, - 34 => 1, - 35 => 1, - 36 => 2, - 40 => 2, - 42 => 2, - 44 => 2, - 45 => 1, - 46 => 2, - 55 => 4, - 65 => 1, - 66 => 1, - 68 => 1, - 69 => 1, - 73 => 1, - 74 => 1, - 100 => 1, - 103 => 2, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js deleted file mode 100644 index 15890b96..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js +++ /dev/null @@ -1,40 +0,0 @@ -var x = { - b: 'x', - xasd: x, - abc:x, - a: function () { - alert('thats right'); - x = (x?a:x); - }, - casdasd : 123123, - omgwtfbbq: { - a: 1, - b: 2 - } -}; - -id = id.replace(/row\/:/gi, ''); - -outer_loop: -for (i=0; i<3; i++) { - for (j=0; j<5; j++) { - if (j==x) - break outer_loop; - } -} -alert('hi'); - -even_number: if ((i % 2) == 0) { - if (i == 12) - break even_number; -} - -switch (blah) { - case dfx.DOM_VK_LEFT: - this.caretLeft(shiftKey); - break; - default: - if (blah) { - } - break; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed deleted file mode 100644 index f332878e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.js.fixed +++ /dev/null @@ -1,39 +0,0 @@ -var x = { - b: 'x', - xasd: x, - abc: x, - a: function () { - alert('thats right'); - x = (x?a:x); - }, - casdasd: 123123, - omgwtfbbq: { - a: 1, - b: 2 - } -}; - -id = id.replace(/row\/:/gi, ''); - -outer_loop: for (i=0; i<3; i++) { - for (j=0; j<5; j++) { - if (j==x) - break outer_loop; - } -} -alert('hi'); - -even_number: if ((i % 2) == 0) { - if (i == 12) - break even_number; -} - -switch (blah) { - case dfx.DOM_VK_LEFT: - this.caretLeft(shiftKey); - break; - default: - if (blah) { - } - break; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php deleted file mode 100644 index 5c20b001..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/PropertyLabelSpacingUnitTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the PropertyLabel sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\PropertyLabelSpacingSniff - */ -final class PropertyLabelSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 2 => 1, - 4 => 1, - 9 => 2, - 10 => 1, - 12 => 1, - 18 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc deleted file mode 100644 index ecae5c6d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc +++ /dev/null @@ -1,134 +0,0 @@ -{$property} =& new $class_name($this->db_index); - $this->modules[$module] =& $this->{$property}; -} - -foreach ($elements as $element) { - if ($something) { - // Do IF. - } else if ($somethingElse) { - // Do ELSE. - } -} - -if ($token['code'] === T_COMMENT - && $multiLineComment === false - && (substr($token['content'], 0, 2) === '//' - || $token['content']{0} === '#') -) { -} - -switch ($blah) { - case 'one': - echo 'one'; - break; - default: - echo 'another'; -} - -?> - -getRow()): ?> -

    - - - -
    - -

    o hai!

    - -
    - - - - - - - - - - - - $x + $y; - -$match = match ($test) { 1 => 'a', 2 => 'b' }; - -$match = match ($test) { - 1 => 'a', - 2 => 'b' - }; - -?> - -
    - -
    - -{$property} =& new $class_name($this->db_index); - $this->modules[$module] =& $this->{$property}; -} - -foreach ($elements as $element) { - if ($something) { - // Do IF. - } else if ($somethingElse) { - // Do ELSE. - } -} - -if ($token['code'] === T_COMMENT - && $multiLineComment === false - && (substr($token['content'], 0, 2) === '//' - || $token['content']{0} === '#') -) { -} - -switch ($blah) { - case 'one': - echo 'one'; - break; - default: - echo 'another'; -} - -?> - -getRow()): ?> -

    - - - -
    - -

    o hai!

    - -
    - - - - - - - - - - - - $x + $y; - -$match = match ($test) { 1 => 'a', 2 => 'b' -}; - -$match = match ($test) { - 1 => 'a', - 2 => 'b' -}; - -?> - -
    - -
    - - - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ScopeClosingBrace sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff - */ -final class ScopeClosingBraceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 11 => 1, - 13 => 1, - 24 => 1, - 80 => 1, - 102 => 1, - 111 => 1, - 116 => 1, - 122 => 1, - 130 => 1, - 134 => 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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc deleted file mode 100644 index 1d3ccebc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc +++ /dev/null @@ -1,149 +0,0 @@ - 'a', 'b' => 'b' ), - $varQ = 'string', - $varR = 123; - - // Intentionally missing a semicolon for testing. - public - $varS, - $varT -} - -// Issue #3188 - static as return type. -public static function fCreate($attributes = []): static -{ - return static::factory()->create($attributes); -} - -public static function fCreate($attributes = []): ?static -{ - return static::factory()->create($attributes); -} - -// Also account for static used within union types. -public function staticLast($attributes = []): object|static {} -public function staticMiddle(): string|static|object {} -public function staticFirst(): static|object {} - -// Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled. -$callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; }; - -class TypedProperties { - public - int $var; - - protected string $stringA, $stringB; - - private bool - $boolA, - $boolB; -} - -// PHP 8.0 constructor property promotion. -class ConstructorPropertyPromotionTest { - public function __construct( - public $x = 0.0, - protected $y = '', - private $z = null, - $normalParam, - ) {} -} - -class ConstructorPropertyPromotionWithTypesTest { - public function __construct(protected float|int $x, public?string &$y = 'test', private mixed $z) {} -} - -// PHP 8.1 readonly keywords. -class ReadonlyTest { - public readonly int $publicReadonlyProperty; - - protected readonly int $protectedReadonlyProperty; - - readonly protected int $protectedReadonlyProperty; - - readonly private int $privateReadonlyProperty; - - public function __construct(readonly protected float|int $x, public readonly?string &$y = 'test') {} -} - -// PHP 8.2 readonly classes. -readonly class ReadonlyClassTest {} -readonly class ReadonlyClassTest {} - -// PHP 8.3 readonly anonymous classes. -$anon = new readonly class {}; -$anon = new readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed deleted file mode 100644 index d4e8a39e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed +++ /dev/null @@ -1,143 +0,0 @@ - 'a', 'b' => 'b' ), - $varQ = 'string', - $varR = 123; - - // Intentionally missing a semicolon for testing. - public - $varS, - $varT -} - -// Issue #3188 - static as return type. -public static function fCreate($attributes = []): static -{ - return static::factory()->create($attributes); -} - -public static function fCreate($attributes = []): ?static -{ - return static::factory()->create($attributes); -} - -// Also account for static used within union types. -public function staticLast($attributes = []): object|static {} -public function staticMiddle(): string|static|object {} -public function staticFirst(): static|object {} - -// Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled. -$callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; }; - -class TypedProperties { - public int $var; - - protected string $stringA, $stringB; - - private bool - $boolA, - $boolB; -} - -// PHP 8.0 constructor property promotion. -class ConstructorPropertyPromotionTest { - public function __construct( - public $x = 0.0, - protected $y = '', - private $z = null, - $normalParam, - ) {} -} - -class ConstructorPropertyPromotionWithTypesTest { - public function __construct(protected float|int $x, public ?string &$y = 'test', private mixed $z) {} -} - -// PHP 8.1 readonly keywords. -class ReadonlyTest { - public readonly int $publicReadonlyProperty; - - protected readonly int $protectedReadonlyProperty; - - readonly protected int $protectedReadonlyProperty; - - readonly private int $privateReadonlyProperty; - - public function __construct(readonly protected float|int $x, public readonly ?string &$y = 'test') {} -} - -// PHP 8.2 readonly classes. -readonly class ReadonlyClassTest {} -readonly class ReadonlyClassTest {} - -// PHP 8.3 readonly anonymous classes. -$anon = new readonly class {}; -$anon = new readonly class {}; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.2.inc deleted file mode 100644 index 45cfb534..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.2.inc +++ /dev/null @@ -1,6 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ScopeKeywordSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff - */ -final class ScopeKeywordSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ScopeKeywordSpacingUnitTest.1.inc': - return [ - 7 => 2, - 8 => 1, - 13 => 1, - 14 => 1, - 15 => 1, - 17 => 2, - 26 => 1, - 28 => 1, - 29 => 1, - 64 => 1, - 67 => 1, - 71 => 1, - 103 => 1, - 106 => 1, - 111 => 1, - 119 => 1, - 121 => 1, - 127 => 2, - 134 => 2, - 138 => 2, - 140 => 3, - 145 => 1, - 149 => 1, - ]; - - case 'ScopeKeywordSpacingUnitTest.3.inc': - return [6 => 1]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc deleted file mode 100644 index 60f87e5b..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc +++ /dev/null @@ -1,42 +0,0 @@ -testThis(); -$test = $this->testThis() ; -$test = $this->testThis() ; -for ($var = 1 ; $var < 10 ; $var++) { - echo $var ; -} -$test = $this->testThis() /* comment here */; -$test = $this->testThis() /* comment here */ ; - -$hello ='foo'; -; - -$sum = $a /* + $b */; -$sum = $a // + $b -; -$sum = $a /* + $b - + $c */ ; - -/* - * Test that the sniff does *not* throw incorrect errors for semicolons in - * "empty" parts of a `for` control structure. - */ -for ($i = 1; ; $i++) {} -for ( ; $ptr >= 0; $ptr-- ) {} -for ( ; ; ) {} - -// But it should when the semicolon in a `for` follows a comment (but shouldn't move the semicolon). -for ( /* Deliberately left empty. */ ; $ptr >= 0; $ptr-- ) {} -for ( $i = 1 ; /* Deliberately left empty. */ ; $i++ ) {} - -switch ($foo) { - case 'foo': - ; - break - ; -} - -// This is an empty statement and should be ignored. -if ($foo) { -; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed deleted file mode 100644 index b4dc0f13..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.inc.fixed +++ /dev/null @@ -1,41 +0,0 @@ -testThis(); -$test = $this->testThis(); -$test = $this->testThis(); -for ($var = 1; $var < 10; $var++) { - echo $var; -} -$test = $this->testThis(); /* comment here */ -$test = $this->testThis(); /* comment here */ - -$hello ='foo'; -; - -$sum = $a; /* + $b */ -$sum = $a; // + $b - -$sum = $a; /* + $b - + $c */ - -/* - * Test that the sniff does *not* throw incorrect errors for semicolons in - * "empty" parts of a `for` control structure. - */ -for ($i = 1; ; $i++) {} -for ( ; $ptr >= 0; $ptr-- ) {} -for ( ; ; ) {} - -// But it should when the semicolon in a `for` follows a comment (but shouldn't move the semicolon). -for ( /* Deliberately left empty. */; $ptr >= 0; $ptr-- ) {} -for ( $i = 1; /* Deliberately left empty. */; $i++ ) {} - -switch ($foo) { - case 'foo': - ; - break; -} - -// This is an empty statement and should be ignored. -if ($foo) { -; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js deleted file mode 100644 index 3aafd6da..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js +++ /dev/null @@ -1,25 +0,0 @@ -var x = { - a: function () { - alert('thats right') ; - x = (x?a:x) ; - }, -} ; - -id = id.replace(/row\/:;/gi, ''); - -for (i=0 ; i<3 ; i++) { - for (j=0; j<5 ; j++) { - if (j==x) - break ; - } -} -alert('hi'); -; - -var sum = a /* + b */; - -var sum = a // +b -; - -var sum = a /* +b - + c */ ; diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed deleted file mode 100644 index a547144d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.js.fixed +++ /dev/null @@ -1,25 +0,0 @@ -var x = { - a: function () { - alert('thats right'); - x = (x?a:x); - }, -}; - -id = id.replace(/row\/:;/gi, ''); - -for (i=0; i<3; i++) { - for (j=0; j<5; j++) { - if (j==x) - break; - } -} -alert('hi'); -; - -var sum = a; /* + b */ - -var sum = a; // +b - - -var sum = a; /* +b - + c */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php deleted file mode 100644 index 218666dc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SemicolonSpacing sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SemicolonSpacingSniff - */ -final class SemicolonSpacingUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'SemicolonSpacingUnitTest.inc': - return [ - 3 => 1, - 4 => 1, - 5 => 2, - 6 => 1, - 8 => 1, - 9 => 1, - 14 => 1, - 16 => 1, - 18 => 1, - 29 => 1, - 30 => 2, - 36 => 1, - ]; - - case 'SemicolonSpacingUnitTest.js': - return [ - 3 => 1, - 4 => 1, - 6 => 1, - 10 => 2, - 11 => 1, - 13 => 1, - 19 => 1, - 22 => 1, - 25 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css deleted file mode 100644 index e3f3f029..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css +++ /dev/null @@ -1,32 +0,0 @@ - -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} - -.HelpWidgetType-new-bug-title{ - float: left; -} - -/* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true */ -.HelpWidgetType-new-bug-title{ - float: left; -} - -.HelpWidgetType-new-bug-title{ - 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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed deleted file mode 100644 index 11be21d5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.css.fixed +++ /dev/null @@ -1,30 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} -.HelpWidgetType-new-bug-title { - float: left; -} - -.HelpWidgetType-new-bug-title{ - float: left; -} - -/* phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true */ -.HelpWidgetType-new-bug-title{ - float: left; -} - -.HelpWidgetType-new-bug-title{ - 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/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc deleted file mode 100644 index f9dca29a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc +++ /dev/null @@ -1,74 +0,0 @@ - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed deleted file mode 100644 index 1d764ebf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.inc.fixed +++ /dev/null @@ -1,68 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js deleted file mode 100644 index be542e77..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js +++ /dev/null @@ -1,56 +0,0 @@ - -alert('hi'); -alert('hello'); - -if (something) { - -} - - -function myFunction() -{ - alert('code here'); - - alert('code here'); - - - // Hello. - - /* - HI - */ - - -} - -function myFunction2() -{ - alert('code here'); - - - alert('code here'); - -} - -MyFunction = function() -{ - alert('code here'); - - - alert('code here'); - -}; - -// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true - -function myFunction2() -{ - alert('code here'); - - alert('code here'); - -} - -// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed deleted file mode 100644 index 960111a5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.1.js.fixed +++ /dev/null @@ -1,50 +0,0 @@ -alert('hi'); -alert('hello'); - -if (something) { - -} - - -function myFunction() -{ - alert('code here'); - - alert('code here'); - - // Hello. - - /* - HI - */ - -} - -function myFunction2() -{ - alert('code here'); - - alert('code here'); - -} - -MyFunction = function() -{ - alert('code here'); - - alert('code here'); - -}; - -// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines true - -function myFunction2() -{ - alert('code here'); - - alert('code here'); - -} - -// phpcs:set Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css deleted file mode 100644 index 2025eeb1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css +++ /dev/null @@ -1,3 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed deleted file mode 100644 index 2025eeb1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.css.fixed +++ /dev/null @@ -1,3 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc deleted file mode 100644 index a6e2b8ad..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc +++ /dev/null @@ -1,9 +0,0 @@ - - -

    - -

    - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed deleted file mode 100644 index 78c45251..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.inc.fixed +++ /dev/null @@ -1,7 +0,0 @@ - -

    - -

    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js deleted file mode 100644 index 7b0c8eac..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js +++ /dev/null @@ -1 +0,0 @@ -alert('hi'); \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed deleted file mode 100644 index 7b0c8eac..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.2.js.fixed +++ /dev/null @@ -1 +0,0 @@ -alert('hi'); \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css deleted file mode 100644 index 9f794a08..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css +++ /dev/null @@ -1,3 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed deleted file mode 100644 index 2025eeb1..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.css.fixed +++ /dev/null @@ -1,3 +0,0 @@ -.HelpWidgetType-new-bug-title { - float: left; -} \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc deleted file mode 100644 index 661ebdaf..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed deleted file mode 100644 index 0cb97480..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.inc.fixed +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js deleted file mode 100644 index 70f67193..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js +++ /dev/null @@ -1 +0,0 @@ -alert('hi'); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed deleted file mode 100644 index 70f67193..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.3.js.fixed +++ /dev/null @@ -1 +0,0 @@ -alert('hi'); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc deleted file mode 100644 index 96860ffb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed deleted file mode 100644 index b26b5b2c..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.4.inc.fixed +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc deleted file mode 100644 index 4d6f06bc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc +++ /dev/null @@ -1,5 +0,0 @@ -   -  \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed deleted file mode 100644 index 8ec5f30d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.5.inc.fixed +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php deleted file mode 100644 index 4f7c7cdb..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Squiz\Tests\WhiteSpace; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the SuperfluousWhitespace sniff. - * - * @covers \PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff - */ -final class SuperfluousWhitespaceUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'SuperfluousWhitespaceUnitTest.1.inc': - return [ - 2 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 1, - 16 => 1, - 23 => 1, - 28 => 1, - 33 => 1, - 49 => 1, - 62 => 1, - 65 => 1, - 73 => 1, - ]; - - case 'SuperfluousWhitespaceUnitTest.2.inc': - return [ - 2 => 1, - 8 => 1, - ]; - - case 'SuperfluousWhitespaceUnitTest.3.inc': - return [ - 6 => 1, - 10 => 1, - ]; - - case 'SuperfluousWhitespaceUnitTest.4.inc': - case 'SuperfluousWhitespaceUnitTest.5.inc': - return [ - 1 => 1, - 4 => 1, - ]; - - case 'SuperfluousWhitespaceUnitTest.1.js': - return [ - 1 => 1, - 3 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - 15 => 1, - 22 => 1, - 29 => 1, - 38 => 1, - 56 => 1, - ]; - - case 'SuperfluousWhitespaceUnitTest.1.css': - return [ - 1 => 1, - 8 => 1, - 9 => 1, - 11 => 1, - 32 => 1, - ]; - - default: - return []; - }//end switch - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml deleted file mode 100644 index 87ab4c3e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/ruleset.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - The Squiz coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - %2$s - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - - - - - - - 0 - - - error - - - - - 0 - - - error - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml deleted file mode 100644 index c462b4f8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Debug/CodeAnalyzerStandard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - $bar + $baz; -} - ]]> - - - $bar + 2; -} - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml deleted file mode 100644 index aa60b8ab..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/Files/ClosingTagStandard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - ?> - ]]> - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml deleted file mode 100644 index 5bcde4b8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Docs/NamingConventions/ValidVariableNameStandard.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - $testNumber = 1; - ]]> - - - $Test_Number = 1; - ]]> - - - - - _bar; -} - ]]> - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php deleted file mode 100644 index 454f665a..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php +++ /dev/null @@ -1,100 +0,0 @@ - - * @author Greg Sherwood - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.9.0 - */ - -namespace PHP_CodeSniffer\Standards\Zend\Sniffs\Debug; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\RuntimeException; -use PHP_CodeSniffer\Util\Common; - -class CodeAnalyzerSniff implements Sniff -{ - - - /** - * Returns the token types that this sniff is interested in. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes the tokens that this sniff is interested in. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found. - * @param int $stackPtr The position in the stack where - * the token was found. - * - * @return int - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If ZendCodeAnalyzer could not be run. - */ - public function process(File $phpcsFile, $stackPtr) - { - $analyzerPath = Config::getExecutablePath('zend_ca'); - if ($analyzerPath === null) { - return $phpcsFile->numTokens; - } - - $fileName = $phpcsFile->getFilename(); - - // In the command, 2>&1 is important because the code analyzer sends its - // findings to stderr. $output normally contains only stdout, so using 2>&1 - // will pipe even stderr to stdout. - $cmd = Common::escapeshellcmd($analyzerPath).' '.escapeshellarg($fileName).' 2>&1'; - - // There is the possibility to pass "--ide" as an option to the analyzer. - // This would result in an output format which would be easier to parse. - // The problem here is that no cleartext error messages are returned; only - // error-code-labels. So for a start we go for cleartext output. - $exitCode = exec($cmd, $output, $retval); - - // Variable $exitCode is the last line of $output if no error occurs, on - // error it is numeric. Try to handle various error conditions and - // provide useful error reporting. - if (is_numeric($exitCode) === true && $exitCode > 0) { - if (is_array($output) === true) { - $msg = implode('\n', $output); - } - - throw new RuntimeException("Failed invoking ZendCodeAnalyzer, exitcode was [$exitCode], retval was [$retval], output was [$msg]"); - } - - if (is_array($output) === true) { - foreach ($output as $finding) { - // The first two lines of analyzer output contain - // something like this: - // > Zend Code Analyzer 1.2.2 - // > Analyzing ... - // So skip these... - $res = preg_match("/^.+\(line ([0-9]+)\):(.+)$/", $finding, $regs); - if (empty($regs) === true || $res === false) { - continue; - } - - $phpcsFile->addWarningOnLine(trim($regs[2]), $regs[1], 'ExternalTool'); - } - } - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php deleted file mode 100644 index 7b547bfd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Sniffs\Files; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class ClosingTagSniff implements Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return [T_OPEN_TAG]; - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @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 - */ - public function process(File $phpcsFile, $stackPtr) - { - // Find the last non-empty token. - $tokens = $phpcsFile->getTokens(); - for ($last = ($phpcsFile->numTokens - 1); $last > 0; $last--) { - if (trim($tokens[$last]['content']) !== '') { - break; - } - } - - if ($tokens[$last]['code'] === T_CLOSE_TAG) { - $error = 'A closing tag is not permitted at the end of a PHP file'; - $fix = $phpcsFile->addFixableError($error, $last, 'NotAllowed'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->replaceToken($last, $phpcsFile->eolChar); - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($last - 1), null, true); - if ($tokens[$prev]['code'] !== T_SEMICOLON - && $tokens[$prev]['code'] !== T_CLOSE_CURLY_BRACKET - && $tokens[$prev]['code'] !== T_OPEN_TAG - ) { - $phpcsFile->fixer->addContent($prev, ';'); - } - - $phpcsFile->fixer->endChangeset(); - } - - $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at EOF', 'yes'); - } else { - $phpcsFile->recordMetric($stackPtr, 'PHP closing tag at EOF', 'no'); - }//end if - - // Ignore the rest of the file. - return $phpcsFile->numTokens; - - }//end process() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php deleted file mode 100644 index 41b19481..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ /dev/null @@ -1,196 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Tokens; - -class ValidVariableNameSniff extends AbstractVariableSniff -{ - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - protected function processVariable(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $varName = ltrim($tokens[$stackPtr]['content'], '$'); - - // If it's a php reserved var, then its ok. - if (isset($this->phpReservedVars[$varName]) === true) { - return; - } - - $objOperator = $phpcsFile->findNext([T_WHITESPACE], ($stackPtr + 1), null, true); - if ($tokens[$objOperator]['code'] === T_OBJECT_OPERATOR - || $tokens[$objOperator]['code'] === T_NULLSAFE_OBJECT_OPERATOR - ) { - // Check to see if we are using a variable from an object. - $var = $phpcsFile->findNext([T_WHITESPACE], ($objOperator + 1), null, true); - if ($tokens[$var]['code'] === T_STRING) { - // Either a var name or a function call, so check for bracket. - $bracket = $phpcsFile->findNext([T_WHITESPACE], ($var + 1), null, true); - - if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) { - $objVarName = $tokens[$var]['content']; - - // There is no way for us to know if the var is public or private, - // so we have to ignore a leading underscore if there is one and just - // check the main part of the variable name. - $originalVarName = $objVarName; - if (substr($objVarName, 0, 1) === '_') { - $objVarName = substr($objVarName, 1); - } - - if (Common::isCamelCaps($objVarName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$originalVarName]; - $phpcsFile->addError($error, $var, 'NotCamelCaps', $data); - } else if (preg_match('|\d|', $objVarName) === 1) { - $warning = 'Variable "%s" contains numbers but this is discouraged'; - $data = [$originalVarName]; - $phpcsFile->addWarning($warning, $stackPtr, 'ContainsNumbers', $data); - } - }//end if - }//end if - }//end if - - // There is no way for us to know if the var is public or private, - // so we have to ignore a leading underscore if there is one and just - // check the main part of the variable name. - $originalVarName = $varName; - if (substr($varName, 0, 1) === '_') { - $objOperator = $phpcsFile->findPrevious([T_WHITESPACE], ($stackPtr - 1), null, true); - if ($tokens[$objOperator]['code'] === T_DOUBLE_COLON) { - // The variable lives within a class, and is referenced like - // this: MyClass::$_variable, so we don't know its scope. - $inClass = true; - } else { - $inClass = $phpcsFile->hasCondition($stackPtr, Tokens::$ooScopeTokens); - } - - if ($inClass === true) { - $varName = substr($varName, 1); - } - } - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$originalVarName]; - $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data); - } else if (preg_match('|\d|', $varName) === 1) { - $warning = 'Variable "%s" contains numbers but this is discouraged'; - $data = [$originalVarName]; - $phpcsFile->addWarning($warning, $stackPtr, 'ContainsNumbers', $data); - } - - }//end processVariable() - - - /** - * Processes class member variables. - * - * @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 - */ - protected function processMemberVar(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $varName = ltrim($tokens[$stackPtr]['content'], '$'); - $memberProps = $phpcsFile->getMemberProperties($stackPtr); - if (empty($memberProps) === true) { - // Exception encountered. - return; - } - - $public = ($memberProps['scope'] === 'public'); - - if ($public === true) { - if (substr($varName, 0, 1) === '_') { - $error = 'Public member variable "%s" must not contain a leading underscore'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'PublicHasUnderscore', $data); - } - } else { - if (substr($varName, 0, 1) !== '_') { - $scope = ucfirst($memberProps['scope']); - $error = '%s member variable "%s" must contain a leading underscore'; - $data = [ - $scope, - $varName, - ]; - $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $data); - } - } - - // Remove a potential underscore prefix for testing CamelCaps. - $varName = ltrim($varName, '_'); - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Member variable "%s" is not in valid camel caps format'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'MemberVarNotCamelCaps', $data); - } else if (preg_match('|\d|', $varName) === 1) { - $warning = 'Member variable "%s" contains numbers but this is discouraged'; - $data = [$varName]; - $phpcsFile->addWarning($warning, $stackPtr, 'MemberVarContainsNumbers', $data); - } - - }//end processMemberVar() - - - /** - * Processes the variable found within a double quoted string. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the double quoted - * string. - * - * @return void - */ - protected function processVariableInString(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (preg_match_all('|[^\\\]\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|', $tokens[$stackPtr]['content'], $matches) !== 0) { - foreach ($matches[1] as $varName) { - // If it's a php reserved var, then its ok. - if (isset($this->phpReservedVars[$varName]) === true) { - continue; - } - - if (Common::isCamelCaps($varName, false, true, false) === false) { - $error = 'Variable "%s" is not in valid camel caps format'; - $data = [$varName]; - $phpcsFile->addError($error, $stackPtr, 'StringVarNotCamelCaps', $data); - } else if (preg_match('|\d|', $varName) === 1) { - $warning = 'Variable "%s" contains numbers but this is discouraged'; - $data = [$varName]; - $phpcsFile->addWarning($warning, $stackPtr, 'StringVarContainsNumbers', $data); - } - }//end foreach - }//end if - - }//end processVariableInString() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc deleted file mode 100644 index c8d0499d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.inc +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php deleted file mode 100644 index 82781a7d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Debug/CodeAnalyzerUnitTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Tests\Debug; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; -use PHP_CodeSniffer\Config; - -/** - * Unit test class for the CodeAnalyzer sniff. - * - * @covers \PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff - */ -final class CodeAnalyzerUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Should this test be skipped for some reason. - * - * @return bool - */ - protected function shouldSkipTest() - { - $analyzerPath = Config::getExecutablePath('zend_ca'); - if ($analyzerPath === null) { - return true; - } - - return false; - - }//end shouldSkipTest() - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return []; - - }//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. - * - * @return array - */ - public function getWarningList() - { - return [2 => 1]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc deleted file mode 100644 index 7e7089dc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed deleted file mode 100644 index caf3b38e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.1.inc.fixed +++ /dev/null @@ -1,12 +0,0 @@ - - -

    - -
    diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc deleted file mode 100644 index 63df04d5..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc +++ /dev/null @@ -1 +0,0 @@ -add('arg'))?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed deleted file mode 100644 index b4c46219..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.3.inc.fixed +++ /dev/null @@ -1 +0,0 @@ -add('arg')); diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc deleted file mode 100644 index 539365da..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc +++ /dev/null @@ -1 +0,0 @@ -add('arg')) /* comment */ ?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed deleted file mode 100644 index 4cc31a51..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.4.inc.fixed +++ /dev/null @@ -1 +0,0 @@ -add('arg')); /* comment */ diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc deleted file mode 100644 index 09e48440..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc +++ /dev/null @@ -1 +0,0 @@ -add('arg')); } ?> diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed deleted file mode 100644 index 9ff112a4..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.5.inc.fixed +++ /dev/null @@ -1 +0,0 @@ -add('arg')); } diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc deleted file mode 100644 index 48de7e03..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed deleted file mode 100644 index 796727a8..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.6.inc.fixed +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed deleted file mode 100644 index dc84e23e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/Files/ClosingTagUnitTest.7.inc.fixed +++ /dev/null @@ -1 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Tests\Files; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ClosingTag sniff. - * - * @covers \PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff - */ -final class ClosingTagUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @param string $testFile The name of the file being tested. - * - * @return array - */ - public function getErrorList($testFile='') - { - switch ($testFile) { - case 'ClosingTagUnitTest.1.inc': - return [11 => 1]; - - case 'ClosingTagUnitTest.3.inc': - case 'ClosingTagUnitTest.4.inc': - case 'ClosingTagUnitTest.5.inc': - case 'ClosingTagUnitTest.7.inc': - return [1 => 1]; - - case 'ClosingTagUnitTest.6.inc': - return [3 => 1]; - - default: - return []; - } - - }//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. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc deleted file mode 100644 index 3325e115..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc +++ /dev/null @@ -1,131 +0,0 @@ -varName; -echo $this->var_name; -echo $this->varname; -echo $this->_varName; -echo $this->varName2; -echo $object->varName; -echo $object->var_name; -echo $object->varName2; -echo $object_name->varname; -echo $object_name->_varName; -echo $object_name->varName2; - -echo $this->myFunction($one, $two); -echo $object->myFunction($one_two, $var2); - -$error = "format is \$GLOBALS['$varName']"; -$error = "format is \$GLOBALS['$varName2']"; - -echo $_SESSION['var_name']; -echo $_FILES['var_name']; -echo $_ENV['var_name']; -echo $_COOKIE['var_name']; -echo $_COOKIE['var_name2']; - -$XML = 'hello'; -$myXML = 'hello'; -$XMLParser = 'hello'; -$xmlParser = 'hello'; -$xmlParser2 = 'hello'; - -echo "{$_SERVER['HOSTNAME']} $var_name"; - -$someObject->{$name}; -$someObject->my_function($var_name); - -var_dump($http_response_header); -var_dump($HTTP_RAW_POST_DATA); -var_dump($php_errormsg); - -interface Base -{ - protected $anonymous; - - public function __construct(); -} - -$anonClass = new class() { - public function foo($foo, $_foo, $foo_bar) { - $bar = 1; - $_bar = 2; - $bar_foo = 3; - } -}; - -echo $obj?->varName; -echo $obj?->var_name; -echo $obj?->varName; - -enum SomeEnum -{ - public function foo($foo, $_foo, $foo_bar) { - $bar = 1; - $_bar = 2; - $bar_foo = 3; - } -} diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php deleted file mode 100644 index c66a2a42..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Zend\Tests\NamingConventions; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the ValidVariableName sniff. - * - * @covers \PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions\ValidVariableNameSniff - */ -final class ValidVariableNameUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 11 => 1, - 13 => 1, - 17 => 1, - 19 => 1, - 23 => 1, - 25 => 1, - 29 => 1, - 31 => 1, - 36 => 1, - 38 => 1, - 42 => 1, - 44 => 1, - 48 => 1, - 50 => 1, - 61 => 1, - 67 => 1, - 72 => 1, - 74 => 1, - 75 => 1, - 76 => 1, - 79 => 1, - 96 => 1, - 99 => 1, - 113 => 1, - 116 => 1, - 121 => 1, - 126 => 1, - 129 => 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. - * - * @return array - */ - public function getWarningList() - { - return [ - 6 => 1, - 14 => 1, - 20 => 1, - 26 => 1, - 32 => 1, - 39 => 1, - 45 => 1, - 51 => 1, - 64 => 1, - 70 => 1, - 73 => 1, - 76 => 1, - 79 => 1, - 82 => 1, - 94 => 1, - // Warning from getMemberProperties() about parse error. - 107 => 1, - ]; - - }//end getWarningList() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml b/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml deleted file mode 100644 index d10b1039..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Standards/Zend/ruleset.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - A coding standard based on an early Zend Framework coding standard. Note that this standard is out of date. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php deleted file mode 100644 index 36631ddc..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php +++ /dev/null @@ -1,541 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\TokenizerException; -use PHP_CodeSniffer\Util; - -class CSS extends PHP -{ - - - /** - * Initialise the tokenizer. - * - * Pre-checks the content to see if it looks minified. - * - * @param string $content The content to tokenize. - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * @param string $eolChar The EOL char used in the content. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. - */ - public function __construct($content, Config $config, $eolChar='\n') - { - if ($this->isMinifiedContent($content, $eolChar) === true) { - throw new TokenizerException('File appears to be minified and cannot be processed'); - } - - parent::__construct($content, $config, $eolChar); - - }//end __construct() - - - /** - * Creates an array of tokens when given some CSS code. - * - * Uses the PHP tokenizer to do all the tricky work - * - * @param string $string The string to tokenize. - * - * @return array - */ - public function tokenize($string) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START CSS TOKENIZING 1ST PASS ***".PHP_EOL; - } - - // If the content doesn't have an EOL char on the end, add one so - // the open and close tags we add are parsed correctly. - $eolAdded = false; - if (substr($string, (strlen($this->eolChar) * -1)) !== $this->eolChar) { - $string .= $this->eolChar; - $eolAdded = true; - } - - $string = str_replace('', '^PHPCS_CSS_T_CLOSE_TAG^', $string); - $tokens = parent::tokenize(''); - - $finalTokens = []; - $finalTokens[0] = [ - 'code' => T_OPEN_TAG, - 'type' => 'T_OPEN_TAG', - 'content' => '', - ]; - - $newStackPtr = 1; - $numTokens = count($tokens); - $multiLineComment = false; - for ($stackPtr = 1; $stackPtr < $numTokens; $stackPtr++) { - $token = $tokens[$stackPtr]; - - // CSS files don't have lists, breaks etc, so convert these to - // standard strings early so they can be converted into T_STYLE - // tokens and joined with other strings if needed. - if ($token['code'] === T_BREAK - || $token['code'] === T_LIST - || $token['code'] === T_DEFAULT - || $token['code'] === T_SWITCH - || $token['code'] === T_FOR - || $token['code'] === T_FOREACH - || $token['code'] === T_WHILE - || $token['code'] === T_DEC - || $token['code'] === T_NEW - ) { - $token['type'] = 'T_STRING'; - $token['code'] = T_STRING; - } - - $token['content'] = str_replace('^PHPCS_CSS_T_OPEN_TAG^', '', $token['content']); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $token['type']; - $content = Util\Common::prepareForOutput($token['content']); - echo "\tProcess token $stackPtr: $type => $content".PHP_EOL; - } - - if ($token['code'] === T_BITWISE_XOR - && $tokens[($stackPtr + 1)]['content'] === 'PHPCS_CSS_T_OPEN_TAG' - ) { - $content = ''; - $stackPtr += 2; - break; - } else { - $content .= $tokens[$stackPtr]['content']; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> Found embedded PHP code: "; - $cleanContent = Util\Common::prepareForOutput($content); - echo $cleanContent.PHP_EOL; - } - - $finalTokens[$newStackPtr] = [ - 'type' => 'T_EMBEDDED_PHP', - 'code' => T_EMBEDDED_PHP, - 'content' => $content, - ]; - - $newStackPtr++; - continue; - }//end if - - if ($token['code'] === T_GOTO_LABEL) { - // Convert these back to T_STRING followed by T_COLON so we can - // more easily process style definitions. - $finalTokens[$newStackPtr] = [ - 'type' => 'T_STRING', - 'code' => T_STRING, - 'content' => substr($token['content'], 0, -1), - ]; - $newStackPtr++; - $finalTokens[$newStackPtr] = [ - 'type' => 'T_COLON', - 'code' => T_COLON, - 'content' => ':', - ]; - $newStackPtr++; - continue; - } - - if ($token['code'] === T_FUNCTION) { - // There are no functions in CSS, so convert this to a string. - $finalTokens[$newStackPtr] = [ - 'type' => 'T_STRING', - 'code' => T_STRING, - 'content' => $token['content'], - ]; - - $newStackPtr++; - continue; - } - - if ($token['code'] === T_COMMENT - && substr($token['content'], 0, 2) === '/*' - ) { - // Multi-line comment. Record it so we can ignore other - // comment tags until we get out of this one. - $multiLineComment = true; - } - - if ($token['code'] === T_COMMENT - && $multiLineComment === false - && (substr($token['content'], 0, 2) === '//' - || $token['content'][0] === '#') - ) { - $content = ltrim($token['content'], '#/'); - - // Guard against PHP7+ syntax errors by stripping - // leading zeros so the content doesn't look like an invalid int. - $leadingZero = false; - if ($content[0] === '0') { - $content = '1'.$content; - $leadingZero = true; - } - - $commentTokens = parent::tokenize(''); - - // The first and last tokens are the open/close tags. - array_shift($commentTokens); - $closeTag = array_pop($commentTokens); - - while ($closeTag['content'] !== '?'.'>') { - $closeTag = array_pop($commentTokens); - } - - if ($leadingZero === true) { - $commentTokens[0]['content'] = substr($commentTokens[0]['content'], 1); - $content = substr($content, 1); - } - - if ($token['content'][0] === '#') { - // The # character is not a comment in CSS files, so - // determine what it means in this context. - $firstContent = $commentTokens[0]['content']; - - // If the first content is just a number, it is probably a - // colour like 8FB7DB, which PHP splits into 8 and FB7DB. - if (($commentTokens[0]['code'] === T_LNUMBER - || $commentTokens[0]['code'] === T_DNUMBER) - && $commentTokens[1]['code'] === T_STRING - ) { - $firstContent .= $commentTokens[1]['content']; - array_shift($commentTokens); - } - - // If the first content looks like a colour and not a class - // definition, join the tokens together. - if (preg_match('/^[ABCDEF0-9]+$/i', $firstContent) === 1 - && $commentTokens[1]['content'] !== '-' - ) { - array_shift($commentTokens); - // Work out what we trimmed off above and remember to re-add it. - $trimmed = substr($token['content'], 0, (strlen($token['content']) - strlen($content))); - $finalTokens[$newStackPtr] = [ - 'type' => 'T_COLOUR', - 'code' => T_COLOUR, - 'content' => $trimmed.$firstContent, - ]; - } else { - $finalTokens[$newStackPtr] = [ - 'type' => 'T_HASH', - 'code' => T_HASH, - 'content' => '#', - ]; - } - } else { - $finalTokens[$newStackPtr] = [ - 'type' => 'T_STRING', - 'code' => T_STRING, - 'content' => '//', - ]; - }//end if - - $newStackPtr++; - - array_splice($tokens, $stackPtr, 1, $commentTokens); - $numTokens = count($tokens); - $stackPtr--; - continue; - }//end if - - if ($token['code'] === T_COMMENT - && substr($token['content'], -2) === '*/' - ) { - // Multi-line comment is done. - $multiLineComment = false; - } - - $finalTokens[$newStackPtr] = $token; - $newStackPtr++; - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END CSS TOKENIZING 1ST PASS ***".PHP_EOL; - echo "\t*** START CSS TOKENIZING 2ND PASS ***".PHP_EOL; - } - - // A flag to indicate if we are inside a style definition, - // which is defined using curly braces. - $inStyleDef = false; - - // A flag to indicate if an At-rule like "@media" is used, which will result - // in nested curly brackets. - $asperandStart = false; - - $numTokens = count($finalTokens); - for ($stackPtr = 0; $stackPtr < $numTokens; $stackPtr++) { - $token = $finalTokens[$stackPtr]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $token['type']; - $content = Util\Common::prepareForOutput($token['content']); - echo "\tProcess token $stackPtr: $type => $content".PHP_EOL; - } - - switch ($token['code']) { - case T_OPEN_CURLY_BRACKET: - // Opening curly brackets for an At-rule do not start a style - // definition. We also reset the asperand flag here because the next - // opening curly bracket could be indeed the start of a style - // definition. - if ($asperandStart === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($inStyleDef === true) { - echo "\t\t* style definition closed *".PHP_EOL; - } - - if ($asperandStart === true) { - echo "\t\t* at-rule definition closed *".PHP_EOL; - } - } - - $inStyleDef = false; - $asperandStart = false; - } else { - $inStyleDef = true; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* style definition opened *".PHP_EOL; - } - } - break; - case T_CLOSE_CURLY_BRACKET: - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($inStyleDef === true) { - echo "\t\t* style definition closed *".PHP_EOL; - } - - if ($asperandStart === true) { - echo "\t\t* at-rule definition closed *".PHP_EOL; - } - } - - $inStyleDef = false; - $asperandStart = false; - break; - case T_MINUS: - // Minus signs are often used instead of spaces inside - // class names, IDs and styles. - if ($finalTokens[($stackPtr + 1)]['code'] === T_STRING) { - if ($finalTokens[($stackPtr - 1)]['code'] === T_STRING) { - $newContent = $finalTokens[($stackPtr - 1)]['content'].'-'.$finalTokens[($stackPtr + 1)]['content']; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL; - $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']); - $new = Util\Common::prepareForOutput($newContent); - echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL; - } - - $finalTokens[($stackPtr + 1)]['content'] = $newContent; - unset($finalTokens[$stackPtr]); - unset($finalTokens[($stackPtr - 1)]); - } else { - $newContent = '-'.$finalTokens[($stackPtr + 1)]['content']; - - $finalTokens[($stackPtr + 1)]['content'] = $newContent; - unset($finalTokens[$stackPtr]); - } - } else if ($finalTokens[($stackPtr + 1)]['code'] === T_LNUMBER) { - // They can also be used to provide negative numbers. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is part of a negative number; adding content to next token and ignoring *".PHP_EOL; - $content = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']); - echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$content\" to \"-$content\"".PHP_EOL; - } - - $finalTokens[($stackPtr + 1)]['content'] = '-'.$finalTokens[($stackPtr + 1)]['content']; - unset($finalTokens[$stackPtr]); - }//end if - break; - case T_COLON: - // Only interested in colons that are defining styles. - if ($inStyleDef === false) { - break; - } - - for ($x = ($stackPtr - 1); $x >= 0; $x--) { - if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) { - break; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $finalTokens[$x]['type']; - echo "\t\t=> token $x changed from $type to T_STYLE".PHP_EOL; - } - - $finalTokens[$x]['type'] = 'T_STYLE'; - $finalTokens[$x]['code'] = T_STYLE; - break; - case T_STRING: - if (strtolower($token['content']) === 'url') { - // Find the next content. - for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) { - break; - } - } - - // Needs to be in the format "url(" for it to be a URL. - if ($finalTokens[$x]['code'] !== T_OPEN_PARENTHESIS) { - continue 2; - } - - // Make sure the content isn't empty. - for ($y = ($x + 1); $y < $numTokens; $y++) { - if (isset(Util\Tokens::$emptyTokens[$finalTokens[$y]['code']]) === false) { - break; - } - } - - if ($finalTokens[$y]['code'] === T_CLOSE_PARENTHESIS) { - continue 2; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - for ($i = ($stackPtr + 1); $i <= $y; $i++) { - $type = $finalTokens[$i]['type']; - $content = Util\Common::prepareForOutput($finalTokens[$i]['content']); - echo "\tProcess token $i: $type => $content".PHP_EOL; - } - - echo "\t\t* token starts a URL *".PHP_EOL; - } - - // Join all the content together inside the url() statement. - $newContent = ''; - for ($i = ($x + 2); $i < $numTokens; $i++) { - if ($finalTokens[$i]['code'] === T_CLOSE_PARENTHESIS) { - break; - } - - $newContent .= $finalTokens[$i]['content']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($finalTokens[$i]['content']); - echo "\t\t=> token $i added to URL string and ignored: $content".PHP_EOL; - } - - unset($finalTokens[$i]); - } - - $stackPtr = $i; - - // If the content inside the "url()" is in double quotes - // there will only be one token and so we don't have to do - // anything except change its type. If it is not empty, - // we need to do some token merging. - $finalTokens[($x + 1)]['type'] = 'T_URL'; - $finalTokens[($x + 1)]['code'] = T_URL; - - if ($newContent !== '') { - $finalTokens[($x + 1)]['content'] .= $newContent; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($finalTokens[($x + 1)]['content']); - echo "\t\t=> token content changed to: $content".PHP_EOL; - } - } - } else if ($finalTokens[$stackPtr]['content'][0] === '-' - && $finalTokens[($stackPtr + 1)]['code'] === T_STRING - ) { - if (isset($finalTokens[($stackPtr - 1)]) === true - && $finalTokens[($stackPtr - 1)]['code'] === T_STRING - ) { - $newContent = $finalTokens[($stackPtr - 1)]['content'].$finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content']; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL; - $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']); - $new = Util\Common::prepareForOutput($newContent); - echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL; - } - - $finalTokens[($stackPtr + 1)]['content'] = $newContent; - unset($finalTokens[$stackPtr]); - unset($finalTokens[($stackPtr - 1)]); - } else { - $newContent = $finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content']; - - $finalTokens[($stackPtr + 1)]['content'] = $newContent; - unset($finalTokens[$stackPtr]); - } - }//end if - break; - case T_ASPERAND: - $asperandStart = true; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* at-rule definition opened *".PHP_EOL; - } - break; - default: - // Nothing special to be done with this token. - break; - }//end switch - }//end for - - // Reset the array keys to avoid gaps. - $finalTokens = array_values($finalTokens); - $numTokens = count($finalTokens); - - // Blank out the content of the end tag. - $finalTokens[($numTokens - 1)]['content'] = ''; - - if ($eolAdded === true) { - // Strip off the extra EOL char we added for tokenizing. - $finalTokens[($numTokens - 2)]['content'] = substr( - $finalTokens[($numTokens - 2)]['content'], - 0, - (strlen($this->eolChar) * -1) - ); - - if ($finalTokens[($numTokens - 2)]['content'] === '') { - unset($finalTokens[($numTokens - 2)]); - $finalTokens = array_values($finalTokens); - $numTokens = count($finalTokens); - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END CSS TOKENIZING 2ND PASS ***".PHP_EOL; - } - - return $finalTokens; - - }//end tokenize() - - - /** - * Performs additional processing after main tokenizing. - * - * @return void - */ - public function processAdditional() - { - /* - We override this method because we don't want the PHP version to - run during CSS processing because it is wasted processing time. - */ - - }//end processAdditional() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php deleted file mode 100644 index b7c6e374..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Comment.php +++ /dev/null @@ -1,283 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Util\Common; - -class Comment -{ - - - /** - * Creates an array of tokens when given some PHP code. - * - * Starts by using token_get_all() but does a lot of extra processing - * to insert information about the context of the token. - * - * @param string $string The string to tokenize. - * @param string $eolChar The EOL character to use for splitting strings. - * @param int $stackPtr The position of the first token in the file. - * - * @return array>> - */ - public function tokenizeString($string, $eolChar, $stackPtr) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t*** START COMMENT TOKENIZING ***".PHP_EOL; - } - - $tokens = []; - $numChars = strlen($string); - - /* - Doc block comments start with /*, but typically contain an - extra star when they are used for function and class comments. - */ - - $char = ($numChars - strlen(ltrim($string, '/*'))); - $lastChars = substr($string, -2); - if ($char === $numChars && $lastChars === '*/') { - // Edge case: docblock without whitespace or contents. - $openTag = substr($string, 0, -2); - $string = $lastChars; - } else { - $openTag = substr($string, 0, $char); - $string = ltrim($string, '/*'); - } - - $tokens[$stackPtr] = [ - 'content' => $openTag, - 'code' => T_DOC_COMMENT_OPEN_TAG, - 'type' => 'T_DOC_COMMENT_OPEN_TAG', - 'comment_tags' => [], - ]; - - $openPtr = $stackPtr; - $stackPtr++; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Common::prepareForOutput($openTag); - echo "\t\tCreate comment token: T_DOC_COMMENT_OPEN_TAG => $content".PHP_EOL; - } - - /* - Strip off the close tag so it doesn't interfere with any - of our comment line processing. The token will be added to the - stack just before we return it. - */ - - $closeTag = [ - 'content' => substr($string, strlen(rtrim($string, '/*'))), - 'code' => T_DOC_COMMENT_CLOSE_TAG, - 'type' => 'T_DOC_COMMENT_CLOSE_TAG', - 'comment_opener' => $openPtr, - ]; - - if ($closeTag['content'] === false) { - // In PHP < 8.0 substr() can return `false` instead of always returning a string. - $closeTag['content'] = ''; - } - - $string = rtrim($string, '/*'); - - /* - Process each line of the comment. - */ - - $lines = explode($eolChar, $string); - $numLines = count($lines); - foreach ($lines as $lineNum => $string) { - if ($lineNum !== ($numLines - 1)) { - $string .= $eolChar; - } - - $char = 0; - $numChars = strlen($string); - - // We've started a new line, so process the indent. - $space = $this->collectWhitespace($string, $char, $numChars); - if ($space !== null) { - $tokens[$stackPtr] = $space; - $stackPtr++; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Common::prepareForOutput($space['content']); - echo "\t\tCreate comment token: T_DOC_COMMENT_WHITESPACE => $content".PHP_EOL; - } - - $char += strlen($space['content']); - if ($char === $numChars) { - break; - } - } - - if ($string === '') { - continue; - } - - if ($lineNum > 0 && $string[$char] === '*') { - // This is a function or class doc block line. - $char++; - $tokens[$stackPtr] = [ - 'content' => '*', - 'code' => T_DOC_COMMENT_STAR, - 'type' => 'T_DOC_COMMENT_STAR', - ]; - - $stackPtr++; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\tCreate comment token: T_DOC_COMMENT_STAR => *".PHP_EOL; - } - } - - // Now we are ready to process the actual content of the line. - $lineTokens = $this->processLine($string, $eolChar, $char, $numChars); - foreach ($lineTokens as $lineToken) { - $tokens[$stackPtr] = $lineToken; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Common::prepareForOutput($lineToken['content']); - $type = $lineToken['type']; - echo "\t\tCreate comment token: $type => $content".PHP_EOL; - } - - if ($lineToken['code'] === T_DOC_COMMENT_TAG) { - $tokens[$openPtr]['comment_tags'][] = $stackPtr; - } - - $stackPtr++; - } - }//end foreach - - $tokens[$stackPtr] = $closeTag; - $tokens[$openPtr]['comment_closer'] = $stackPtr; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Common::prepareForOutput($closeTag['content']); - echo "\t\tCreate comment token: T_DOC_COMMENT_CLOSE_TAG => $content".PHP_EOL; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t*** END COMMENT TOKENIZING ***".PHP_EOL; - } - - return $tokens; - - }//end tokenizeString() - - - /** - * Process a single line of a comment. - * - * @param string $string The comment string being tokenized. - * @param string $eolChar The EOL character to use for splitting strings. - * @param int $start The position in the string to start processing. - * @param int $end The position in the string to end processing. - * - * @return array> - */ - private function processLine($string, $eolChar, $start, $end) - { - $tokens = []; - - // Collect content padding. - $space = $this->collectWhitespace($string, $start, $end); - if ($space !== null) { - $tokens[] = $space; - $start += strlen($space['content']); - } - - if (isset($string[$start]) === false) { - return $tokens; - } - - if ($string[$start] === '@') { - // The content up until the first whitespace is the tag name. - $matches = []; - preg_match('/@[^\s]+/', $string, $matches, 0, $start); - if (isset($matches[0]) === true - && substr(strtolower($matches[0]), 0, 7) !== '@phpcs:' - ) { - $tagName = $matches[0]; - $start += strlen($tagName); - $tokens[] = [ - 'content' => $tagName, - 'code' => T_DOC_COMMENT_TAG, - 'type' => 'T_DOC_COMMENT_TAG', - ]; - - // Then there will be some whitespace. - $space = $this->collectWhitespace($string, $start, $end); - if ($space !== null) { - $tokens[] = $space; - $start += strlen($space['content']); - } - } - }//end if - - // Process the rest of the line. - $eol = strpos($string, $eolChar, $start); - if ($eol === false) { - $eol = $end; - } - - if ($eol > $start) { - $tokens[] = [ - 'content' => substr($string, $start, ($eol - $start)), - 'code' => T_DOC_COMMENT_STRING, - 'type' => 'T_DOC_COMMENT_STRING', - ]; - } - - if ($eol !== $end) { - $tokens[] = [ - 'content' => substr($string, $eol, strlen($eolChar)), - 'code' => T_DOC_COMMENT_WHITESPACE, - 'type' => 'T_DOC_COMMENT_WHITESPACE', - ]; - } - - return $tokens; - - }//end processLine() - - - /** - * Collect consecutive whitespace into a single token. - * - * @param string $string The comment string being tokenized. - * @param int $start The position in the string to start processing. - * @param int $end The position in the string to end processing. - * - * @return array|null - */ - private function collectWhitespace($string, $start, $end) - { - $space = ''; - for ($start; $start < $end; $start++) { - if ($string[$start] !== ' ' && $string[$start] !== "\t") { - break; - } - - $space .= $string[$start]; - } - - if ($space === '') { - return null; - } - - return [ - 'content' => $space, - 'code' => T_DOC_COMMENT_WHITESPACE, - 'type' => 'T_DOC_COMMENT_WHITESPACE', - ]; - - }//end collectWhitespace() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php deleted file mode 100644 index c7249fcd..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/JS.php +++ /dev/null @@ -1,1256 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Exceptions\TokenizerException; -use PHP_CodeSniffer\Util; - -class JS extends Tokenizer -{ - - /** - * A list of tokens that are allowed to open a scope. - * - * This array also contains information about what kind of token the scope - * opener uses to open and close the scope, if the token strictly requires - * an opener, if the token can share a scope closer, and who it can be shared - * with. An example of a token that shares a scope closer is a CASE scope. - * - * @var array - */ - public $scopeOpeners = [ - T_IF => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_TRY => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CATCH => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_ELSE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_FOR => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_CLASS => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_FUNCTION => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_WHILE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_DO => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_SWITCH => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CASE => [ - 'start' => [T_COLON => T_COLON], - 'end' => [ - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - ], - 'strict' => true, - 'shared' => true, - 'with' => [ - T_DEFAULT => T_DEFAULT, - T_CASE => T_CASE, - T_SWITCH => T_SWITCH, - ], - ], - T_DEFAULT => [ - 'start' => [T_COLON => T_COLON], - 'end' => [ - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - ], - 'strict' => true, - 'shared' => true, - 'with' => [ - T_CASE => T_CASE, - T_SWITCH => T_SWITCH, - ], - ], - ]; - - /** - * A list of tokens that end the scope. - * - * This array is just a unique collection of the end tokens - * from the _scopeOpeners array. The data is duplicated here to - * save time during parsing of the file. - * - * @var array - */ - public $endScopeTokens = [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_BREAK => T_BREAK, - ]; - - /** - * A list of special JS tokens and their types. - * - * @var array - */ - protected $tokenValues = [ - 'class' => 'T_CLASS', - 'function' => 'T_FUNCTION', - 'prototype' => 'T_PROTOTYPE', - 'try' => 'T_TRY', - 'catch' => 'T_CATCH', - 'return' => 'T_RETURN', - 'throw' => 'T_THROW', - 'break' => 'T_BREAK', - 'switch' => 'T_SWITCH', - 'continue' => 'T_CONTINUE', - 'if' => 'T_IF', - 'else' => 'T_ELSE', - 'do' => 'T_DO', - 'while' => 'T_WHILE', - 'for' => 'T_FOR', - 'var' => 'T_VAR', - 'case' => 'T_CASE', - 'default' => 'T_DEFAULT', - 'true' => 'T_TRUE', - 'false' => 'T_FALSE', - 'null' => 'T_NULL', - 'this' => 'T_THIS', - 'typeof' => 'T_TYPEOF', - '(' => 'T_OPEN_PARENTHESIS', - ')' => 'T_CLOSE_PARENTHESIS', - '{' => 'T_OPEN_CURLY_BRACKET', - '}' => 'T_CLOSE_CURLY_BRACKET', - '[' => 'T_OPEN_SQUARE_BRACKET', - ']' => 'T_CLOSE_SQUARE_BRACKET', - '?' => 'T_INLINE_THEN', - '.' => 'T_OBJECT_OPERATOR', - '+' => 'T_PLUS', - '-' => 'T_MINUS', - '*' => 'T_MULTIPLY', - '%' => 'T_MODULUS', - '/' => 'T_DIVIDE', - '^' => 'T_LOGICAL_XOR', - ',' => 'T_COMMA', - ';' => 'T_SEMICOLON', - ':' => 'T_COLON', - '<' => 'T_LESS_THAN', - '>' => 'T_GREATER_THAN', - '<<' => 'T_SL', - '>>' => 'T_SR', - '>>>' => 'T_ZSR', - '<<=' => 'T_SL_EQUAL', - '>>=' => 'T_SR_EQUAL', - '>>>=' => 'T_ZSR_EQUAL', - '<=' => 'T_IS_SMALLER_OR_EQUAL', - '>=' => 'T_IS_GREATER_OR_EQUAL', - '=>' => 'T_DOUBLE_ARROW', - '!' => 'T_BOOLEAN_NOT', - '||' => 'T_BOOLEAN_OR', - '&&' => 'T_BOOLEAN_AND', - '|' => 'T_BITWISE_OR', - '&' => 'T_BITWISE_AND', - '!=' => 'T_IS_NOT_EQUAL', - '!==' => 'T_IS_NOT_IDENTICAL', - '=' => 'T_EQUAL', - '==' => 'T_IS_EQUAL', - '===' => 'T_IS_IDENTICAL', - '-=' => 'T_MINUS_EQUAL', - '+=' => 'T_PLUS_EQUAL', - '*=' => 'T_MUL_EQUAL', - '/=' => 'T_DIV_EQUAL', - '%=' => 'T_MOD_EQUAL', - '++' => 'T_INC', - '--' => 'T_DEC', - '//' => 'T_COMMENT', - '/*' => 'T_COMMENT', - '/**' => 'T_DOC_COMMENT', - '*/' => 'T_COMMENT', - ]; - - /** - * A list string delimiters. - * - * @var array - */ - protected $stringTokens = [ - '\'' => '\'', - '"' => '"', - ]; - - /** - * A list tokens that start and end comments. - * - * @var array - */ - protected $commentTokens = [ - '//' => null, - '/*' => '*/', - '/**' => '*/', - ]; - - - /** - * Initialise the tokenizer. - * - * Pre-checks the content to see if it looks minified. - * - * @param string $content The content to tokenize. - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * @param string $eolChar The EOL char used in the content. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. - */ - public function __construct($content, Config $config, $eolChar='\n') - { - if ($this->isMinifiedContent($content, $eolChar) === true) { - throw new TokenizerException('File appears to be minified and cannot be processed'); - } - - parent::__construct($content, $config, $eolChar); - - }//end __construct() - - - /** - * Creates an array of tokens when given some JS code. - * - * @param string $string The string to tokenize. - * - * @return array - */ - public function tokenize($string) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START JS TOKENIZING ***".PHP_EOL; - } - - $maxTokenLength = 0; - foreach ($this->tokenValues as $token => $values) { - if (strlen($token) > $maxTokenLength) { - $maxTokenLength = strlen($token); - } - } - - $tokens = []; - $inString = ''; - $stringChar = null; - $inComment = ''; - $buffer = ''; - $preStringBuffer = ''; - $cleanBuffer = false; - - $commentTokenizer = new Comment(); - - $tokens[] = [ - 'code' => T_OPEN_TAG, - 'type' => 'T_OPEN_TAG', - 'content' => '', - ]; - - // Convert newlines to single characters for ease of - // processing. We will change them back later. - $string = str_replace($this->eolChar, "\n", $string); - - $chars = str_split($string); - $numChars = count($chars); - for ($i = 0; $i < $numChars; $i++) { - $char = $chars[$i]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($char); - $bufferContent = Util\Common::prepareForOutput($buffer); - - if ($inString !== '') { - echo "\t"; - } - - if ($inComment !== '') { - echo "\t"; - } - - echo "\tProcess char $i => $content (buffer: $bufferContent)".PHP_EOL; - }//end if - - if ($inString === '' && $inComment === '' && $buffer !== '') { - // If the buffer only has whitespace and we are about to - // add a character, store the whitespace first. - if (trim($char) !== '' && trim($buffer) === '') { - $tokens[] = [ - 'code' => T_WHITESPACE, - 'type' => 'T_WHITESPACE', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_WHITESPACE ($content)".PHP_EOL; - } - - $buffer = ''; - } - - // If the buffer is not whitespace and we are about to - // add a whitespace character, store the content first. - if ($inString === '' - && $inComment === '' - && trim($char) === '' - && trim($buffer) !== '' - ) { - $tokens[] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_STRING ($content)".PHP_EOL; - } - - $buffer = ''; - } - }//end if - - // Process strings. - if ($inComment === '' && isset($this->stringTokens[$char]) === true) { - if ($inString === $char) { - // This could be the end of the string, but make sure it - // is not escaped first. - $escapes = 0; - for ($x = ($i - 1); $x >= 0; $x--) { - if ($chars[$x] !== '\\') { - break; - } - - $escapes++; - } - - if ($escapes === 0 || ($escapes % 2) === 0) { - // There is an even number escape chars, - // so this is not escaped, it is the end of the string. - $tokens[] = [ - 'code' => T_CONSTANT_ENCAPSED_STRING, - 'type' => 'T_CONSTANT_ENCAPSED_STRING', - 'content' => str_replace("\n", $this->eolChar, $buffer).$char, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* found end of string *".PHP_EOL; - $content = Util\Common::prepareForOutput($buffer.$char); - echo "\t=> Added token T_CONSTANT_ENCAPSED_STRING ($content)".PHP_EOL; - } - - $buffer = ''; - $preStringBuffer = ''; - $inString = ''; - $stringChar = null; - continue; - }//end if - } else if ($inString === '') { - $inString = $char; - $stringChar = $i; - $preStringBuffer = $buffer; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* looking for string closer *".PHP_EOL; - } - }//end if - }//end if - - if ($inString !== '' && $char === "\n") { - // Unless this newline character is escaped, the string did not - // end before the end of the line, which means it probably - // wasn't a string at all (maybe a regex). - if ($chars[($i - 1)] !== '\\') { - $i = $stringChar; - $buffer = $preStringBuffer; - $preStringBuffer = ''; - $inString = ''; - $stringChar = null; - $char = $chars[$i]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* found newline before end of string, bailing *".PHP_EOL; - } - } - } - - $buffer .= $char; - - // We don't look for special tokens inside strings, - // so if we are in a string, we can continue here now - // that the current char is in the buffer. - if ($inString !== '') { - continue; - } - - // Special case for T_DIVIDE which can actually be - // the start of a regular expression. - if ($buffer === $char && $char === '/' && $chars[($i + 1)] !== '*') { - $regex = $this->getRegexToken($i, $string, $chars, $tokens); - if ($regex !== null) { - $tokens[] = [ - 'code' => T_REGULAR_EXPRESSION, - 'type' => 'T_REGULAR_EXPRESSION', - 'content' => $regex['content'], - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($regex['content']); - echo "\t=> Added token T_REGULAR_EXPRESSION ($content)".PHP_EOL; - } - - $i = $regex['end']; - $buffer = ''; - $cleanBuffer = false; - continue; - }//end if - }//end if - - // Check for known tokens, but ignore tokens found that are not at - // the end of a string, like FOR and this.FORmat. - if (isset($this->tokenValues[strtolower($buffer)]) === true - && (preg_match('|[a-zA-z0-9_]|', $char) === 0 - || isset($chars[($i + 1)]) === false - || preg_match('|[a-zA-z0-9_]|', $chars[($i + 1)]) === 0) - ) { - $matchedToken = false; - $lookAheadLength = ($maxTokenLength - strlen($buffer)); - - if ($lookAheadLength > 0) { - // The buffer contains a token type, but we need - // to look ahead at the next chars to see if this is - // actually part of a larger token. For example, - // FOR and FOREACH. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* buffer possibly contains token, looking ahead $lookAheadLength chars *".PHP_EOL; - } - - $charBuffer = $buffer; - for ($x = 1; $x <= $lookAheadLength; $x++) { - if (isset($chars[($i + $x)]) === false) { - break; - } - - $charBuffer .= $chars[($i + $x)]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($charBuffer); - echo "\t\t=> Looking ahead $x chars => $content".PHP_EOL; - } - - if (isset($this->tokenValues[strtolower($charBuffer)]) === true) { - // We've found something larger that matches - // so we can ignore this char. Except for 1 very specific - // case where a comment like /**/ needs to tokenize as - // T_COMMENT and not T_DOC_COMMENT. - $oldType = $this->tokenValues[strtolower($buffer)]; - $newType = $this->tokenValues[strtolower($charBuffer)]; - if ($oldType === 'T_COMMENT' - && $newType === 'T_DOC_COMMENT' - && $chars[($i + $x + 1)] === '/' - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* look ahead ignored T_DOC_COMMENT, continuing *".PHP_EOL; - } - } else { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* look ahead found more specific token ($newType), ignoring $i *".PHP_EOL; - } - - $matchedToken = true; - break; - } - }//end if - }//end for - }//end if - - if ($matchedToken === false) { - if (PHP_CODESNIFFER_VERBOSITY > 1 && $lookAheadLength > 0) { - echo "\t\t* look ahead found nothing *".PHP_EOL; - } - - $value = $this->tokenValues[strtolower($buffer)]; - - if ($value === 'T_FUNCTION' && $buffer !== 'function') { - // The function keyword needs to be all lowercase or else - // it is just a function called "Function". - $value = 'T_STRING'; - } - - $tokens[] = [ - 'code' => constant($value), - 'type' => $value, - 'content' => $buffer, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token $value ($content)".PHP_EOL; - } - - $cleanBuffer = true; - }//end if - } else if (isset($this->tokenValues[strtolower($char)]) === true) { - // No matter what token we end up using, we don't - // need the content in the buffer any more because we have - // found a valid token. - $newContent = substr(str_replace("\n", $this->eolChar, $buffer), 0, -1); - if ($newContent !== '') { - $tokens[] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => $newContent, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput(substr($buffer, 0, -1)); - echo "\t=> Added token T_STRING ($content)".PHP_EOL; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* char is token, looking ahead ".($maxTokenLength - 1).' chars *'.PHP_EOL; - } - - // The char is a token type, but we need to look ahead at the - // next chars to see if this is actually part of a larger token. - // For example, = and ===. - $charBuffer = $char; - $matchedToken = false; - for ($x = 1; $x <= $maxTokenLength; $x++) { - if (isset($chars[($i + $x)]) === false) { - break; - } - - $charBuffer .= $chars[($i + $x)]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($charBuffer); - echo "\t\t=> Looking ahead $x chars => $content".PHP_EOL; - } - - if (isset($this->tokenValues[strtolower($charBuffer)]) === true) { - // We've found something larger that matches - // so we can ignore this char. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokenValues[strtolower($charBuffer)]; - echo "\t\t* look ahead found more specific token ($type), ignoring $i *".PHP_EOL; - } - - $matchedToken = true; - break; - } - }//end for - - if ($matchedToken === false) { - $value = $this->tokenValues[strtolower($char)]; - $tokens[] = [ - 'code' => constant($value), - 'type' => $value, - 'content' => $char, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* look ahead found nothing *".PHP_EOL; - $content = Util\Common::prepareForOutput($char); - echo "\t=> Added token $value ($content)".PHP_EOL; - } - - $cleanBuffer = true; - } else { - $buffer = $char; - }//end if - }//end if - - // Keep track of content inside comments. - if ($inComment === '' - && array_key_exists($buffer, $this->commentTokens) === true - ) { - // This is not really a comment if the content - // looks like \// (i.e., it is escaped). - if (isset($chars[($i - 2)]) === true && $chars[($i - 2)] === '\\') { - $lastToken = array_pop($tokens); - $lastContent = $lastToken['content']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $value = $this->tokenValues[strtolower($lastContent)]; - $content = Util\Common::prepareForOutput($lastContent); - echo "\t=> Removed token $value ($content)".PHP_EOL; - } - - $lastChars = str_split($lastContent); - $lastNumChars = count($lastChars); - for ($x = 0; $x < $lastNumChars; $x++) { - $lastChar = $lastChars[$x]; - $value = $this->tokenValues[strtolower($lastChar)]; - $tokens[] = [ - 'code' => constant($value), - 'type' => $value, - 'content' => $lastChar, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($lastChar); - echo "\t=> Added token $value ($content)".PHP_EOL; - } - } - } else { - // We have started a comment. - $inComment = $buffer; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* looking for end of comment *".PHP_EOL; - } - }//end if - } else if ($inComment !== '') { - if ($this->commentTokens[$inComment] === null) { - // Comment ends at the next newline. - if (strpos($buffer, "\n") !== false) { - $inComment = ''; - } - } else { - if ($this->commentTokens[$inComment] === $buffer) { - $inComment = ''; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($inComment === '') { - echo "\t\t* found end of comment *".PHP_EOL; - } - } - - if ($inComment === '' && $cleanBuffer === false) { - $tokens[] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_STRING ($content)".PHP_EOL; - } - - $buffer = ''; - } - }//end if - - if ($cleanBuffer === true) { - $buffer = ''; - $cleanBuffer = false; - } - }//end for - - if (empty($buffer) === false) { - if ($inString !== '') { - // The string did not end before the end of the file, - // which means there was probably a syntax error somewhere. - $tokens[] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_STRING ($content)".PHP_EOL; - } - } else { - // Buffer contains whitespace from the end of the file. - $tokens[] = [ - 'code' => T_WHITESPACE, - 'type' => 'T_WHITESPACE', - 'content' => str_replace("\n", $this->eolChar, $buffer), - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $content = Util\Common::prepareForOutput($buffer); - echo "\t=> Added token T_WHITESPACE ($content)".PHP_EOL; - } - }//end if - }//end if - - $tokens[] = [ - 'code' => T_CLOSE_TAG, - 'type' => 'T_CLOSE_TAG', - 'content' => '', - ]; - - /* - Now that we have done some basic tokenizing, we need to - modify the tokens to join some together and split some apart - so they match what the PHP tokenizer does. - */ - - $finalTokens = []; - $newStackPtr = 0; - $numTokens = count($tokens); - for ($stackPtr = 0; $stackPtr < $numTokens; $stackPtr++) { - $token = $tokens[$stackPtr]; - - /* - Look for comments and join the tokens together. - */ - - if ($token['code'] === T_COMMENT || $token['code'] === T_DOC_COMMENT) { - $newContent = ''; - $tokenContent = $token['content']; - - $endContent = null; - if (isset($this->commentTokens[$tokenContent]) === true) { - $endContent = $this->commentTokens[$tokenContent]; - } - - while ($tokenContent !== $endContent) { - if ($endContent === null - && strpos($tokenContent, $this->eolChar) !== false - ) { - // A null end token means the comment ends at the end of - // the line so we look for newlines and split the token. - $tokens[$stackPtr]['content'] = substr( - $tokenContent, - (strpos($tokenContent, $this->eolChar) + strlen($this->eolChar)) - ); - - $tokenContent = substr( - $tokenContent, - 0, - (strpos($tokenContent, $this->eolChar) + strlen($this->eolChar)) - ); - - // If the substr failed, skip the token as the content - // will now be blank. - if ($tokens[$stackPtr]['content'] !== false - && $tokens[$stackPtr]['content'] !== '' - ) { - $stackPtr--; - } - - break; - }//end if - - $stackPtr++; - $newContent .= $tokenContent; - if (isset($tokens[$stackPtr]) === false) { - break; - } - - $tokenContent = $tokens[$stackPtr]['content']; - }//end while - - if ($token['code'] === T_DOC_COMMENT) { - $commentTokens = $commentTokenizer->tokenizeString($newContent.$tokenContent, $this->eolChar, $newStackPtr); - foreach ($commentTokens as $commentToken) { - $finalTokens[$newStackPtr] = $commentToken; - $newStackPtr++; - } - - continue; - } else { - // Save the new content in the current token so - // the code below can chop it up on newlines. - $token['content'] = $newContent.$tokenContent; - } - }//end if - - /* - If this token has newlines in its content, split each line up - and create a new token for each line. We do this so it's easier - to ascertain where errors occur on a line. - Note that $token[1] is the token's content. - */ - - if (strpos($token['content'], $this->eolChar) !== false) { - $tokenLines = explode($this->eolChar, $token['content']); - $numLines = count($tokenLines); - - for ($i = 0; $i < $numLines; $i++) { - $newToken = ['content' => $tokenLines[$i]]; - if ($i === ($numLines - 1)) { - if ($tokenLines[$i] === '') { - break; - } - } else { - $newToken['content'] .= $this->eolChar; - } - - $newToken['type'] = $token['type']; - $newToken['code'] = $token['code']; - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - } - } else { - $finalTokens[$newStackPtr] = $token; - $newStackPtr++; - }//end if - - // Convert numbers, including decimals. - if ($token['code'] === T_STRING - || $token['code'] === T_OBJECT_OPERATOR - ) { - $newContent = ''; - $oldStackPtr = $stackPtr; - while (preg_match('|^[0-9\.]+$|', $tokens[$stackPtr]['content']) !== 0) { - $newContent .= $tokens[$stackPtr]['content']; - $stackPtr++; - } - - if ($newContent !== '' && $newContent !== '.') { - $finalTokens[($newStackPtr - 1)]['content'] = $newContent; - if (ctype_digit($newContent) === true) { - $finalTokens[($newStackPtr - 1)]['code'] = constant('T_LNUMBER'); - $finalTokens[($newStackPtr - 1)]['type'] = 'T_LNUMBER'; - } else { - $finalTokens[($newStackPtr - 1)]['code'] = constant('T_DNUMBER'); - $finalTokens[($newStackPtr - 1)]['type'] = 'T_DNUMBER'; - } - - $stackPtr--; - continue; - } else { - $stackPtr = $oldStackPtr; - } - }//end if - - // Convert the token after an object operator into a string, in most cases. - if ($token['code'] === T_OBJECT_OPERATOR) { - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (isset(Util\Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - if ($tokens[$i]['code'] !== T_PROTOTYPE - && $tokens[$i]['code'] !== T_LNUMBER - && $tokens[$i]['code'] !== T_DNUMBER - ) { - $tokens[$i]['code'] = T_STRING; - $tokens[$i]['type'] = 'T_STRING'; - } - - break; - } - } - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END TOKENIZING ***".PHP_EOL; - } - - return $finalTokens; - - }//end tokenize() - - - /** - * Tokenizes a regular expression if one is found. - * - * If a regular expression is not found, NULL is returned. - * - * @param int $char The index of the possible regex start character. - * @param string $string The complete content of the string being tokenized. - * @param array $chars An array of characters being tokenized. - * @param array $tokens The current array of tokens found in the string. - * - * @return array|null - */ - public function getRegexToken($char, $string, $chars, $tokens) - { - $beforeTokens = [ - T_EQUAL => true, - T_IS_NOT_EQUAL => true, - T_IS_IDENTICAL => true, - T_IS_NOT_IDENTICAL => true, - T_OPEN_PARENTHESIS => true, - T_OPEN_SQUARE_BRACKET => true, - T_RETURN => true, - T_BOOLEAN_OR => true, - T_BOOLEAN_AND => true, - T_BOOLEAN_NOT => true, - T_BITWISE_OR => true, - T_BITWISE_AND => true, - T_COMMA => true, - T_COLON => true, - T_TYPEOF => true, - T_INLINE_THEN => true, - T_INLINE_ELSE => true, - ]; - - $afterTokens = [ - ',' => true, - ')' => true, - ']' => true, - ';' => true, - ' ' => true, - '.' => true, - ':' => true, - $this->eolChar => true, - ]; - - // Find the last non-whitespace token that was added - // to the tokens array. - $numTokens = count($tokens); - for ($prev = ($numTokens - 1); $prev >= 0; $prev--) { - if (isset(Util\Tokens::$emptyTokens[$tokens[$prev]['code']]) === false) { - break; - } - } - - if (isset($beforeTokens[$tokens[$prev]['code']]) === false) { - return null; - } - - // This is probably a regular expression, so look for the end of it. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* token possibly starts a regular expression *".PHP_EOL; - } - - $numChars = count($chars); - for ($next = ($char + 1); $next < $numChars; $next++) { - if ($chars[$next] === '/') { - // Just make sure this is not escaped first. - if ($chars[($next - 1)] !== '\\') { - // In the simple form: /.../ so we found the end. - break; - } else if ($chars[($next - 2)] === '\\') { - // In the form: /...\\/ so we found the end. - break; - } - } else { - $possibleEolChar = substr($string, $next, strlen($this->eolChar)); - if ($possibleEolChar === $this->eolChar) { - // This is the last token on the line and regular - // expressions need to be defined on a single line, - // so this is not a regular expression. - break; - } - } - } - - if ($chars[$next] !== '/') { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* could not find end of regular expression *".PHP_EOL; - } - - return null; - } - - while (preg_match('|[a-zA-Z]|', $chars[($next + 1)]) !== 0) { - // The token directly after the end of the regex can - // be modifiers like global and case insensitive - // (.e.g, /pattern/gi). - $next++; - } - - $regexEnd = $next; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* found end of regular expression at token $regexEnd *".PHP_EOL; - } - - for ($next += 1; $next < $numChars; $next++) { - if ($chars[$next] !== ' ') { - break; - } else { - $possibleEolChar = substr($string, $next, strlen($this->eolChar)); - if ($possibleEolChar === $this->eolChar) { - // This is the last token on the line. - break; - } - } - } - - if (isset($afterTokens[$chars[$next]]) === false) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* tokens after regular expression do not look correct *".PHP_EOL; - } - - return null; - } - - // This is a regular expression, so join all the tokens together. - $content = ''; - for ($x = $char; $x <= $regexEnd; $x++) { - $content .= $chars[$x]; - } - - $token = [ - 'start' => $char, - 'end' => $regexEnd, - 'content' => $content, - ]; - - return $token; - - }//end getRegexToken() - - - /** - * Performs additional processing after main tokenizing. - * - * This additional processing looks for properties, closures, labels and objects. - * - * @return void - */ - public function processAdditional() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START ADDITIONAL JS PROCESSING ***".PHP_EOL; - } - - $numTokens = count($this->tokens); - $classStack = []; - - for ($i = 0; $i < $numTokens; $i++) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - $content = Util\Common::prepareForOutput($this->tokens[$i]['content']); - - echo str_repeat("\t", count($classStack)); - echo "\tProcess token $i: $type => $content".PHP_EOL; - } - - // Looking for functions that are actually closures. - if ($this->tokens[$i]['code'] === T_FUNCTION && isset($this->tokens[$i]['scope_opener']) === true) { - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - break; - } - } - - if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { - $this->tokens[$i]['code'] = T_CLOSURE; - $this->tokens[$i]['type'] = 'T_CLOSURE'; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo str_repeat("\t", count($classStack)); - echo "\t* token $i on line $line changed from T_FUNCTION to T_CLOSURE *".PHP_EOL; - } - - for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { - if (isset($this->tokens[$x]['conditions'][$i]) === false) { - continue; - } - - $this->tokens[$x]['conditions'][$i] = T_CLOSURE; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo str_repeat("\t", count($classStack)); - echo "\t\t* cleaned $x ($type) *".PHP_EOL; - } - } - }//end if - - continue; - } else if ($this->tokens[$i]['code'] === T_OPEN_CURLY_BRACKET - && isset($this->tokens[$i]['scope_condition']) === false - && isset($this->tokens[$i]['bracket_closer']) === true - ) { - $condition = $this->tokens[$i]['conditions']; - $condition = end($condition); - if ($condition === T_CLASS) { - // Possibly an ES6 method. To be classified as one, the previous - // non-empty tokens need to be a set of parenthesis, and then a string - // (the method name). - for ($parenCloser = ($i - 1); $parenCloser > 0; $parenCloser--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$parenCloser]['code']]) === false) { - break; - } - } - - if ($this->tokens[$parenCloser]['code'] === T_CLOSE_PARENTHESIS) { - $parenOpener = $this->tokens[$parenCloser]['parenthesis_opener']; - for ($name = ($parenOpener - 1); $name > 0; $name--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$name]['code']]) === false) { - break; - } - } - - if ($this->tokens[$name]['code'] === T_STRING) { - // We found a method name. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$name]['line']; - echo str_repeat("\t", count($classStack)); - echo "\t* token $name on line $line changed from T_STRING to T_FUNCTION *".PHP_EOL; - } - - $closer = $this->tokens[$i]['bracket_closer']; - - $this->tokens[$name]['code'] = T_FUNCTION; - $this->tokens[$name]['type'] = 'T_FUNCTION'; - - foreach ([$name, $i, $closer] as $token) { - $this->tokens[$token]['scope_condition'] = $name; - $this->tokens[$token]['scope_opener'] = $i; - $this->tokens[$token]['scope_closer'] = $closer; - $this->tokens[$token]['parenthesis_opener'] = $parenOpener; - $this->tokens[$token]['parenthesis_closer'] = $parenCloser; - $this->tokens[$token]['parenthesis_owner'] = $name; - } - - $this->tokens[$parenOpener]['parenthesis_owner'] = $name; - $this->tokens[$parenCloser]['parenthesis_owner'] = $name; - - for ($x = ($i + 1); $x < $closer; $x++) { - $this->tokens[$x]['conditions'][$name] = T_FUNCTION; - ksort($this->tokens[$x]['conditions'], SORT_NUMERIC); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo str_repeat("\t", count($classStack)); - echo "\t\t* added T_FUNCTION condition to $x ($type) *".PHP_EOL; - } - } - - continue; - }//end if - }//end if - }//end if - - $classStack[] = $i; - - $closer = $this->tokens[$i]['bracket_closer']; - $this->tokens[$i]['code'] = T_OBJECT; - $this->tokens[$i]['type'] = 'T_OBJECT'; - $this->tokens[$closer]['code'] = T_CLOSE_OBJECT; - $this->tokens[$closer]['type'] = 'T_CLOSE_OBJECT'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($classStack)); - echo "\t* token $i converted from T_OPEN_CURLY_BRACKET to T_OBJECT *".PHP_EOL; - echo str_repeat("\t", count($classStack)); - echo "\t* token $closer converted from T_CLOSE_CURLY_BRACKET to T_CLOSE_OBJECT *".PHP_EOL; - } - - for ($x = ($i + 1); $x < $closer; $x++) { - $this->tokens[$x]['conditions'][$i] = T_OBJECT; - ksort($this->tokens[$x]['conditions'], SORT_NUMERIC); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo str_repeat("\t", count($classStack)); - echo "\t\t* added T_OBJECT condition to $x ($type) *".PHP_EOL; - } - } - } else if ($this->tokens[$i]['code'] === T_CLOSE_OBJECT) { - array_pop($classStack); - } else if ($this->tokens[$i]['code'] === T_COLON) { - // If it is a scope opener, it belongs to a - // DEFAULT or CASE statement. - if (isset($this->tokens[$i]['scope_condition']) === true) { - continue; - } - - // Make sure this is not part of an inline IF statement. - for ($x = ($i - 1); $x >= 0; $x--) { - if ($this->tokens[$x]['code'] === T_INLINE_THEN) { - $this->tokens[$i]['code'] = T_INLINE_ELSE; - $this->tokens[$i]['type'] = 'T_INLINE_ELSE'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($classStack)); - echo "\t* token $i converted from T_COLON to T_INLINE_THEN *".PHP_EOL; - } - - continue(2); - } else if ($this->tokens[$x]['line'] < $this->tokens[$i]['line']) { - break; - } - } - - // The string to the left of the colon is either a property or label. - for ($label = ($i - 1); $label >= 0; $label--) { - if (isset(Util\Tokens::$emptyTokens[$this->tokens[$label]['code']]) === false) { - break; - } - } - - if ($this->tokens[$label]['code'] !== T_STRING - && $this->tokens[$label]['code'] !== T_CONSTANT_ENCAPSED_STRING - ) { - continue; - } - - if (empty($classStack) === false) { - $this->tokens[$label]['code'] = T_PROPERTY; - $this->tokens[$label]['type'] = 'T_PROPERTY'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($classStack)); - echo "\t* token $label converted from T_STRING to T_PROPERTY *".PHP_EOL; - } - } else { - $this->tokens[$label]['code'] = T_LABEL; - $this->tokens[$label]['type'] = 'T_LABEL'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($classStack)); - echo "\t* token $label converted from T_STRING to T_LABEL *".PHP_EOL; - } - }//end if - }//end if - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END ADDITIONAL JS PROCESSING ***".PHP_EOL; - } - - }//end processAdditional() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php deleted file mode 100644 index a773ddfa..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php +++ /dev/null @@ -1,3875 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Tokens; - -class PHP extends Tokenizer -{ - - /** - * A list of tokens that are allowed to open a scope. - * - * This array also contains information about what kind of token the scope - * opener uses to open and close the scope, if the token strictly requires - * an opener, if the token can share a scope closer, and who it can be shared - * with. An example of a token that shares a scope closer is a CASE scope. - * - * @var array - */ - public $scopeOpeners = [ - T_IF => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDIF => T_ENDIF, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - ], - 'strict' => false, - 'shared' => false, - 'with' => [ - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - ], - ], - T_TRY => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CATCH => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_FINALLY => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_ELSE => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDIF => T_ENDIF, - ], - 'strict' => false, - 'shared' => false, - 'with' => [ - T_IF => T_IF, - T_ELSEIF => T_ELSEIF, - ], - ], - T_ELSEIF => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDIF => T_ENDIF, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - ], - 'strict' => false, - 'shared' => false, - 'with' => [ - T_IF => T_IF, - T_ELSE => T_ELSE, - ], - ], - T_FOR => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDFOR => T_ENDFOR, - ], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_FOREACH => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDFOREACH => T_ENDFOREACH, - ], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_INTERFACE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_FUNCTION => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CLASS => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_TRAIT => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_ENUM => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_USE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_DECLARE => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDDECLARE => T_ENDDECLARE, - ], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_NAMESPACE => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_WHILE => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDWHILE => T_ENDWHILE, - ], - 'strict' => false, - 'shared' => false, - 'with' => [], - ], - T_DO => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_SWITCH => [ - 'start' => [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_COLON => T_COLON, - ], - 'end' => [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDSWITCH => T_ENDSWITCH, - ], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_CASE => [ - 'start' => [ - T_COLON => T_COLON, - T_SEMICOLON => T_SEMICOLON, - ], - 'end' => [ - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - T_EXIT => T_EXIT, - ], - 'strict' => true, - 'shared' => true, - 'with' => [ - T_DEFAULT => T_DEFAULT, - T_CASE => T_CASE, - T_SWITCH => T_SWITCH, - ], - ], - T_DEFAULT => [ - 'start' => [ - T_COLON => T_COLON, - T_SEMICOLON => T_SEMICOLON, - ], - 'end' => [ - T_BREAK => T_BREAK, - T_RETURN => T_RETURN, - T_CONTINUE => T_CONTINUE, - T_THROW => T_THROW, - T_EXIT => T_EXIT, - ], - 'strict' => true, - 'shared' => true, - 'with' => [ - T_CASE => T_CASE, - T_SWITCH => T_SWITCH, - ], - ], - T_MATCH => [ - 'start' => [T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET], - 'end' => [T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_START_HEREDOC => [ - 'start' => [T_START_HEREDOC => T_START_HEREDOC], - 'end' => [T_END_HEREDOC => T_END_HEREDOC], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - T_START_NOWDOC => [ - 'start' => [T_START_NOWDOC => T_START_NOWDOC], - 'end' => [T_END_NOWDOC => T_END_NOWDOC], - 'strict' => true, - 'shared' => false, - 'with' => [], - ], - ]; - - /** - * A list of tokens that end the scope. - * - * This array is just a unique collection of the end tokens - * from the scopeOpeners array. The data is duplicated here to - * save time during parsing of the file. - * - * @var array - */ - public $endScopeTokens = [ - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_ENDIF => T_ENDIF, - T_ENDFOR => T_ENDFOR, - T_ENDFOREACH => T_ENDFOREACH, - T_ENDWHILE => T_ENDWHILE, - T_ENDSWITCH => T_ENDSWITCH, - T_ENDDECLARE => T_ENDDECLARE, - T_BREAK => T_BREAK, - T_END_HEREDOC => T_END_HEREDOC, - T_END_NOWDOC => T_END_NOWDOC, - ]; - - /** - * Known lengths of tokens. - * - * @var array - */ - public $knownLengths = [ - T_ABSTRACT => 8, - T_AND_EQUAL => 2, - T_ARRAY => 5, - T_AS => 2, - T_BOOLEAN_AND => 2, - T_BOOLEAN_OR => 2, - T_BREAK => 5, - T_CALLABLE => 8, - T_CASE => 4, - T_CATCH => 5, - T_CLASS => 5, - T_CLASS_C => 9, - T_CLONE => 5, - T_CONCAT_EQUAL => 2, - T_CONST => 5, - T_CONTINUE => 8, - T_CURLY_OPEN => 2, - T_DEC => 2, - T_DECLARE => 7, - T_DEFAULT => 7, - T_DIR => 7, - T_DIV_EQUAL => 2, - T_DO => 2, - T_DOLLAR_OPEN_CURLY_BRACES => 2, - T_DOUBLE_ARROW => 2, - T_DOUBLE_COLON => 2, - T_ECHO => 4, - T_ELLIPSIS => 3, - T_ELSE => 4, - T_ELSEIF => 6, - T_EMPTY => 5, - T_ENDDECLARE => 10, - T_ENDFOR => 6, - T_ENDFOREACH => 10, - T_ENDIF => 5, - T_ENDSWITCH => 9, - T_ENDWHILE => 8, - T_ENUM => 4, - T_ENUM_CASE => 4, - T_EVAL => 4, - T_EXTENDS => 7, - T_FILE => 8, - T_FINAL => 5, - T_FINALLY => 7, - T_FN => 2, - T_FOR => 3, - T_FOREACH => 7, - T_FUNCTION => 8, - T_FUNC_C => 12, - T_GLOBAL => 6, - T_GOTO => 4, - T_HALT_COMPILER => 15, - T_IF => 2, - T_IMPLEMENTS => 10, - T_INC => 2, - T_INCLUDE => 7, - T_INCLUDE_ONCE => 12, - T_INSTANCEOF => 10, - T_INSTEADOF => 9, - T_INTERFACE => 9, - T_ISSET => 5, - T_IS_EQUAL => 2, - T_IS_GREATER_OR_EQUAL => 2, - T_IS_IDENTICAL => 3, - T_IS_NOT_EQUAL => 2, - T_IS_NOT_IDENTICAL => 3, - T_IS_SMALLER_OR_EQUAL => 2, - T_LINE => 8, - T_LIST => 4, - T_LOGICAL_AND => 3, - T_LOGICAL_OR => 2, - T_LOGICAL_XOR => 3, - T_MATCH => 5, - T_MATCH_ARROW => 2, - T_MATCH_DEFAULT => 7, - T_METHOD_C => 10, - T_MINUS_EQUAL => 2, - T_POW_EQUAL => 3, - T_MOD_EQUAL => 2, - T_MUL_EQUAL => 2, - T_NAMESPACE => 9, - T_NS_C => 13, - T_NS_SEPARATOR => 1, - T_NEW => 3, - T_NULLSAFE_OBJECT_OPERATOR => 3, - T_OBJECT_OPERATOR => 2, - T_OPEN_TAG_WITH_ECHO => 3, - T_OR_EQUAL => 2, - T_PLUS_EQUAL => 2, - T_PRINT => 5, - T_PRIVATE => 7, - T_PUBLIC => 6, - T_PROTECTED => 9, - T_READONLY => 8, - T_REQUIRE => 7, - T_REQUIRE_ONCE => 12, - T_RETURN => 6, - T_STATIC => 6, - T_SWITCH => 6, - T_THROW => 5, - T_TRAIT => 5, - T_TRAIT_C => 9, - T_TRY => 3, - T_UNSET => 5, - T_USE => 3, - T_VAR => 3, - T_WHILE => 5, - T_XOR_EQUAL => 2, - T_YIELD => 5, - T_OPEN_CURLY_BRACKET => 1, - T_CLOSE_CURLY_BRACKET => 1, - T_OPEN_SQUARE_BRACKET => 1, - T_CLOSE_SQUARE_BRACKET => 1, - T_OPEN_PARENTHESIS => 1, - T_CLOSE_PARENTHESIS => 1, - T_COLON => 1, - T_STRING_CONCAT => 1, - T_INLINE_THEN => 1, - T_INLINE_ELSE => 1, - T_NULLABLE => 1, - T_NULL => 4, - T_FALSE => 5, - T_TRUE => 4, - T_SEMICOLON => 1, - T_EQUAL => 1, - T_MULTIPLY => 1, - T_DIVIDE => 1, - T_PLUS => 1, - T_MINUS => 1, - T_MODULUS => 1, - T_POW => 2, - T_SPACESHIP => 3, - T_COALESCE => 2, - T_COALESCE_EQUAL => 3, - T_BITWISE_AND => 1, - T_BITWISE_OR => 1, - T_BITWISE_XOR => 1, - T_SL => 2, - T_SR => 2, - T_SL_EQUAL => 3, - T_SR_EQUAL => 3, - T_GREATER_THAN => 1, - T_LESS_THAN => 1, - T_BOOLEAN_NOT => 1, - T_SELF => 4, - T_PARENT => 6, - T_COMMA => 1, - T_THIS => 4, - T_CLOSURE => 8, - T_BACKTICK => 1, - T_OPEN_SHORT_ARRAY => 1, - T_CLOSE_SHORT_ARRAY => 1, - T_TYPE_UNION => 1, - T_TYPE_INTERSECTION => 1, - T_TYPE_OPEN_PARENTHESIS => 1, - T_TYPE_CLOSE_PARENTHESIS => 1, - ]; - - /** - * Contexts in which keywords should always be tokenized as T_STRING. - * - * @var array - */ - protected $tstringContexts = [ - T_OBJECT_OPERATOR => true, - T_NULLSAFE_OBJECT_OPERATOR => true, - T_FUNCTION => true, - T_CLASS => true, - T_INTERFACE => true, - T_TRAIT => true, - T_ENUM => true, - T_ENUM_CASE => true, - T_EXTENDS => true, - T_IMPLEMENTS => true, - T_ATTRIBUTE => true, - T_NEW => true, - T_CONST => true, - T_NS_SEPARATOR => true, - T_USE => true, - T_NAMESPACE => true, - T_PAAMAYIM_NEKUDOTAYIM => true, - ]; - - /** - * A cache of different token types, resolved into arrays. - * - * @var array - * @see standardiseToken() - */ - private static $resolveTokenCache = []; - - - /** - * Creates an array of tokens when given some PHP code. - * - * Starts by using token_get_all() but does a lot of extra processing - * to insert information about the context of the token. - * - * @param string $string The string to tokenize. - * - * @return array - */ - protected function tokenize($string) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START PHP TOKENIZING ***".PHP_EOL; - $isWin = false; - if (stripos(PHP_OS, 'WIN') === 0) { - $isWin = true; - } - } - - $tokens = @token_get_all($string); - $finalTokens = []; - - $newStackPtr = 0; - $numTokens = count($tokens); - $lastNotEmptyToken = 0; - - $insideInlineIf = []; - $insideUseGroup = false; - $insideConstDeclaration = false; - - $commentTokenizer = new Comment(); - - for ($stackPtr = 0; $stackPtr < $numTokens; $stackPtr++) { - // Special case for tokens we have needed to blank out. - if ($tokens[$stackPtr] === null) { - continue; - } - - $token = (array) $tokens[$stackPtr]; - $tokenIsArray = isset($token[1]); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($tokenIsArray === true) { - $type = Tokens::tokenName($token[0]); - $content = Common::prepareForOutput($token[1]); - } else { - $newToken = self::resolveSimpleToken($token[0]); - $type = $newToken['type']; - $content = Common::prepareForOutput($token[0]); - } - - echo "\tProcess token "; - if ($tokenIsArray === true) { - echo "[$stackPtr]"; - } else { - echo " $stackPtr "; - } - - echo ": $type => $content"; - }//end if - - if ($newStackPtr > 0 - && isset(Tokens::$emptyTokens[$finalTokens[($newStackPtr - 1)]['code']]) === false - ) { - $lastNotEmptyToken = ($newStackPtr - 1); - } - - /* - If we are using \r\n newline characters, the \r and \n are sometimes - split over two tokens. This normally occurs after comments. We need - to merge these two characters together so that our line endings are - consistent for all lines. - */ - - if ($tokenIsArray === true && substr($token[1], -1) === "\r") { - if (isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][1][0] === "\n" - ) { - $token[1] .= "\n"; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - if ($isWin === true) { - echo '\n'; - } else { - echo "\033[30;1m\\n\033[0m"; - } - } - - if ($tokens[($stackPtr + 1)][1] === "\n") { - // This token's content has been merged into the previous, - // so we can skip it. - $tokens[($stackPtr + 1)] = ''; - } else { - $tokens[($stackPtr + 1)][1] = substr($tokens[($stackPtr + 1)][1], 1); - } - } - }//end if - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL; - } - - /* - Tokenize context sensitive keyword as string when it should be string. - */ - - if ($tokenIsArray === true - && isset(Tokens::$contextSensitiveKeywords[$token[0]]) === true - && (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true - || $finalTokens[$lastNotEmptyToken]['content'] === '&' - || $insideConstDeclaration === true) - ) { - if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true) { - $preserveKeyword = false; - - // `new class`, and `new static` should be preserved. - if ($finalTokens[$lastNotEmptyToken]['code'] === T_NEW - && ($token[0] === T_CLASS - || $token[0] === T_STATIC) - ) { - $preserveKeyword = true; - } - - // `new readonly class` should be preserved. - if ($finalTokens[$lastNotEmptyToken]['code'] === T_NEW - && strtolower($token[1]) === 'readonly' - ) { - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false - || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false - ) { - break; - } - } - - if (is_array($tokens[$i]) === true && $tokens[$i][0] === T_CLASS) { - $preserveKeyword = true; - } - } - - // `new class extends` `new class implements` should be preserved - if (($token[0] === T_EXTENDS || $token[0] === T_IMPLEMENTS) - && $finalTokens[$lastNotEmptyToken]['code'] === T_CLASS - ) { - $preserveKeyword = true; - } - - // `namespace\` should be preserved - if ($token[0] === T_NAMESPACE) { - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false) { - break; - } - - if (isset(Tokens::$emptyTokens[$tokens[$i][0]]) === true) { - continue; - } - - if ($tokens[$i][0] === T_NS_SEPARATOR) { - $preserveKeyword = true; - } - - break; - } - } - }//end if - - // Types in typed constants should not be touched, but the constant name should be. - if ((isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true - && $finalTokens[$lastNotEmptyToken]['code'] === T_CONST) - || $insideConstDeclaration === true - ) { - $preserveKeyword = true; - - // Find the next non-empty token. - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === true - && isset(Tokens::$emptyTokens[$tokens[$i][0]]) === true - ) { - continue; - } - - break; - } - - if ($tokens[$i] === '=' || $tokens[$i] === ';') { - $preserveKeyword = false; - $insideConstDeclaration = false; - } - }//end if - - if ($finalTokens[$lastNotEmptyToken]['content'] === '&') { - $preserveKeyword = true; - - for ($i = ($lastNotEmptyToken - 1); $i >= 0; $i--) { - if (isset(Tokens::$emptyTokens[$finalTokens[$i]['code']]) === true) { - continue; - } - - if ($finalTokens[$i]['code'] === T_FUNCTION) { - $preserveKeyword = false; - } - - break; - } - } - - if ($preserveKeyword === false) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = Tokens::tokenName($token[0]); - echo "\t\t* token $stackPtr changed from $type to T_STRING".PHP_EOL; - } - - $finalTokens[$newStackPtr] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => $token[1], - ]; - - $newStackPtr++; - continue; - } - }//end if - - /* - Mark the start of a constant declaration to allow for handling keyword to T_STRING - convertion for constant names using reserved keywords. - */ - - if ($tokenIsArray === true && $token[0] === T_CONST) { - $insideConstDeclaration = true; - } - - /* - Close an open "inside constant declaration" marker when no keyword convertion was needed. - */ - - if ($insideConstDeclaration === true - && $tokenIsArray === false - && ($token[0] === '=' || $token[0] === ';') - ) { - $insideConstDeclaration = false; - } - - /* - Special case for `static` used as a function name, i.e. `static()`. - - Note: this may incorrectly change the static keyword directly before a DNF property type. - If so, this will be caught and corrected for in the additional processing. - */ - - 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(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. - */ - - if ($tokenIsArray === true - && ($token[0] === T_DOC_COMMENT - || ($token[0] === T_COMMENT && strpos($token[1], '/**') === 0 && $token[1] !== '/**/')) - ) { - $commentTokens = $commentTokenizer->tokenizeString($token[1], $this->eolChar, $newStackPtr); - foreach ($commentTokens as $commentToken) { - $finalTokens[$newStackPtr] = $commentToken; - $newStackPtr++; - } - - continue; - } - - /* - PHP 8 tokenizes a new line after a slash and hash comment to the next whitespace token. - */ - - if (PHP_VERSION_ID >= 80000 - && $tokenIsArray === true - && ($token[0] === T_COMMENT && (strpos($token[1], '//') === 0 || strpos($token[1], '#') === 0)) - && isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === T_WHITESPACE - ) { - $nextToken = $tokens[($stackPtr + 1)]; - - // If the next token is a single new line, merge it into the comment token - // and set to it up to be skipped. - if ($nextToken[1] === "\n" || $nextToken[1] === "\r\n" || $nextToken[1] === "\n\r") { - $token[1] .= $nextToken[1]; - $tokens[($stackPtr + 1)] = null; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* merged newline after comment into comment token $stackPtr".PHP_EOL; - } - } else { - // This may be a whitespace token consisting of multiple new lines. - if (strpos($nextToken[1], "\r\n") === 0) { - $token[1] .= "\r\n"; - $tokens[($stackPtr + 1)][1] = substr($nextToken[1], 2); - } else if (strpos($nextToken[1], "\n\r") === 0) { - $token[1] .= "\n\r"; - $tokens[($stackPtr + 1)][1] = substr($nextToken[1], 2); - } else if (strpos($nextToken[1], "\n") === 0) { - $token[1] .= "\n"; - $tokens[($stackPtr + 1)][1] = substr($nextToken[1], 1); - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* stripped first newline after comment and added it to comment token $stackPtr".PHP_EOL; - } - }//end if - }//end if - - /* - For Explicit Octal Notation prior to PHP 8.1 we need to combine the - T_LNUMBER and T_STRING token values into a single token value, and - then ignore the T_STRING token. - */ - - if (PHP_VERSION_ID < 80100 - && $tokenIsArray === true && $token[1] === '0' - && (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 - ) { - $finalTokens[$newStackPtr] = [ - 'code' => T_LNUMBER, - 'type' => 'T_LNUMBER', - 'content' => $token[1] .= $matches[1], - ]; - $newStackPtr++; - - if (isset($matches[2]) === true && $matches[2] !== '') { - $type = 'T_LNUMBER'; - if ($matches[2][0] === '_') { - $type = 'T_STRING'; - } - - $finalTokens[$newStackPtr] = [ - 'code' => constant($type), - 'type' => $type, - 'content' => $matches[2], - ]; - $newStackPtr++; - } - - $stackPtr++; - continue; - }//end if - - /* - PHP 8.1 introduced two dedicated tokens for the & character. - Retokenizing both of these to T_BITWISE_AND, which is the - token PHPCS already tokenized them as. - */ - - if ($tokenIsArray === true - && ($token[0] === T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - || $token[0] === T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG) - ) { - $finalTokens[$newStackPtr] = [ - 'code' => T_BITWISE_AND, - 'type' => 'T_BITWISE_AND', - 'content' => $token[1], - ]; - $newStackPtr++; - continue; - } - - /* - If this is a double quoted string, PHP will tokenize the whole - thing which causes problems with the scope map when braces are - within the string. So we need to merge the tokens together to - provide a single string. - */ - - if ($tokenIsArray === false && ($token[0] === '"' || $token[0] === 'b"')) { - // Binary casts need a special token. - if ($token[0] === 'b"') { - $finalTokens[$newStackPtr] = [ - 'code' => T_BINARY_CAST, - 'type' => 'T_BINARY_CAST', - 'content' => 'b', - ]; - $newStackPtr++; - } - - $tokenContent = '"'; - $nestedVars = []; - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - $subToken = (array) $tokens[$i]; - $subTokenIsArray = isset($subToken[1]); - - if ($subTokenIsArray === true) { - $tokenContent .= $subToken[1]; - if (($subToken[1] === '{' - || $subToken[1] === '${') - && $subToken[0] !== T_ENCAPSED_AND_WHITESPACE - ) { - $nestedVars[] = $i; - } - } else { - $tokenContent .= $subToken[0]; - if ($subToken[0] === '}') { - array_pop($nestedVars); - } - } - - if ($subTokenIsArray === false - && $subToken[0] === '"' - && empty($nestedVars) === true - ) { - // We found the other end of the double quoted string. - break; - } - }//end for - - $stackPtr = $i; - - // Convert each line within the double quoted string to a - // new token, so it conforms with other multiple line tokens. - $tokenLines = explode($this->eolChar, $tokenContent); - $numLines = count($tokenLines); - $newToken = []; - - for ($j = 0; $j < $numLines; $j++) { - $newToken['content'] = $tokenLines[$j]; - if ($j === ($numLines - 1)) { - if ($tokenLines[$j] === '') { - break; - } - } else { - $newToken['content'] .= $this->eolChar; - } - - $newToken['code'] = T_DOUBLE_QUOTED_STRING; - $newToken['type'] = 'T_DOUBLE_QUOTED_STRING'; - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - } - - // Continue, as we're done with this token. - continue; - }//end if - - /* - Detect binary casting and assign the casts their own token. - */ - - if ($tokenIsArray === true - && $token[0] === T_CONSTANT_ENCAPSED_STRING - && (substr($token[1], 0, 2) === 'b"' - || substr($token[1], 0, 2) === "b'") - ) { - $finalTokens[$newStackPtr] = [ - 'code' => T_BINARY_CAST, - 'type' => 'T_BINARY_CAST', - 'content' => 'b', - ]; - $newStackPtr++; - $token[1] = substr($token[1], 1); - } - - if ($tokenIsArray === true - && $token[0] === T_STRING_CAST - && preg_match('`^\(\s*binary\s*\)$`i', $token[1]) === 1 - ) { - $finalTokens[$newStackPtr] = [ - 'code' => T_BINARY_CAST, - 'type' => 'T_BINARY_CAST', - 'content' => $token[1], - ]; - $newStackPtr++; - continue; - } - - /* - If this is a heredoc, PHP will tokenize the whole - thing which causes problems when heredocs don't - contain real PHP code, which is almost never. - We want to leave the start and end heredoc tokens - alone though. - */ - - if ($tokenIsArray === true && $token[0] === T_START_HEREDOC) { - // Add the start heredoc token to the final array. - $finalTokens[$newStackPtr] = self::standardiseToken($token); - - // Check if this is actually a nowdoc and use a different token - // to help the sniffs. - $nowdoc = false; - if (strpos($token[1], "'") !== false) { - $finalTokens[$newStackPtr]['code'] = T_START_NOWDOC; - $finalTokens[$newStackPtr]['type'] = 'T_START_NOWDOC'; - $nowdoc = true; - } - - $tokenContent = ''; - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - $subTokenIsArray = is_array($tokens[$i]); - if ($subTokenIsArray === true - && $tokens[$i][0] === T_END_HEREDOC - ) { - // We found the other end of the heredoc. - break; - } - - if ($subTokenIsArray === true) { - $tokenContent .= $tokens[$i][1]; - } else { - $tokenContent .= $tokens[$i]; - } - } - - if ($i === $numTokens) { - // We got to the end of the file and never - // found the closing token, so this probably wasn't - // a heredoc. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $finalTokens[$newStackPtr]['type']; - echo "\t\t* failed to find the end of the here/nowdoc".PHP_EOL; - echo "\t\t* token $stackPtr changed from $type to T_STRING".PHP_EOL; - } - - $finalTokens[$newStackPtr]['code'] = T_STRING; - $finalTokens[$newStackPtr]['type'] = 'T_STRING'; - $newStackPtr++; - continue; - } - - $stackPtr = $i; - $newStackPtr++; - - // Convert each line within the heredoc to a - // new token, so it conforms with other multiple line tokens. - $tokenLines = explode($this->eolChar, $tokenContent); - $numLines = count($tokenLines); - $newToken = []; - - for ($j = 0; $j < $numLines; $j++) { - $newToken['content'] = $tokenLines[$j]; - if ($j === ($numLines - 1)) { - if ($tokenLines[$j] === '') { - break; - } - } else { - $newToken['content'] .= $this->eolChar; - } - - if ($nowdoc === true) { - $newToken['code'] = T_NOWDOC; - $newToken['type'] = 'T_NOWDOC'; - } else { - $newToken['code'] = T_HEREDOC; - $newToken['type'] = 'T_HEREDOC'; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - }//end for - - // Add the end heredoc token to the final array. - $finalTokens[$newStackPtr] = self::standardiseToken($tokens[$stackPtr]); - - if ($nowdoc === true) { - $finalTokens[$newStackPtr]['code'] = T_END_NOWDOC; - $finalTokens[$newStackPtr]['type'] = 'T_END_NOWDOC'; - } - - $newStackPtr++; - - // Continue, as we're done with this token. - continue; - }//end if - - /* - Enum keyword for PHP < 8.1 - */ - - if ($tokenIsArray === true - && $token[0] === T_STRING - && strtolower($token[1]) === 'enum' - ) { - // Get the next non-empty token. - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false - || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false - ) { - break; - } - } - - if (isset($tokens[$i]) === true - && is_array($tokens[$i]) === true - && $tokens[$i][0] === T_STRING - ) { - // Modify $tokens directly so we can use it later when converting enum "case". - $tokens[$stackPtr][0] = T_ENUM; - - $newToken = []; - $newToken['code'] = T_ENUM; - $newToken['type'] = 'T_ENUM'; - $newToken['content'] = $token[1]; - $finalTokens[$newStackPtr] = $newToken; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_STRING to T_ENUM".PHP_EOL; - } - - $newStackPtr++; - continue; - } - }//end if - - /* - Convert enum "case" to T_ENUM_CASE - */ - - if ($tokenIsArray === true - && $token[0] === T_CASE - && isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false - ) { - $isEnumCase = false; - $scope = 1; - - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if ($tokens[$i] === '}') { - $scope++; - continue; - } - - if ($tokens[$i] === '{') { - $scope--; - continue; - } - - if (is_array($tokens[$i]) === false) { - continue; - } - - if ($scope !== 0) { - continue; - } - - if ($tokens[$i][0] === T_SWITCH) { - break; - } - - if ($tokens[$i][0] === T_ENUM || $tokens[$i][0] === T_ENUM_CASE) { - $isEnumCase = true; - break; - } - }//end for - - if ($isEnumCase === true) { - // Modify $tokens directly so we can use it as optimisation for other enum "case". - $tokens[$stackPtr][0] = T_ENUM_CASE; - - $newToken = []; - $newToken['code'] = T_ENUM_CASE; - $newToken['type'] = 'T_ENUM_CASE'; - $newToken['content'] = $token[1]; - $finalTokens[$newStackPtr] = $newToken; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_CASE to T_ENUM_CASE".PHP_EOL; - } - - $newStackPtr++; - continue; - } - }//end if - - /* - As of PHP 8.0 fully qualified, partially qualified and namespace relative - identifier names are tokenized differently. - This "undoes" the new tokenization so the tokenization will be the same in - in PHP 5, 7 and 8. - */ - - if (PHP_VERSION_ID >= 80000 - && $tokenIsArray === true - && ($token[0] === T_NAME_QUALIFIED - || $token[0] === T_NAME_FULLY_QUALIFIED - || $token[0] === T_NAME_RELATIVE) - ) { - $name = $token[1]; - - if ($token[0] === T_NAME_FULLY_QUALIFIED) { - $newToken = []; - $newToken['code'] = T_NS_SEPARATOR; - $newToken['type'] = 'T_NS_SEPARATOR'; - $newToken['content'] = '\\'; - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - - $name = ltrim($name, '\\'); - } - - if ($token[0] === T_NAME_RELATIVE) { - $newToken = []; - $newToken['code'] = T_NAMESPACE; - $newToken['type'] = 'T_NAMESPACE'; - $newToken['content'] = substr($name, 0, 9); - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - - $newToken = []; - $newToken['code'] = T_NS_SEPARATOR; - $newToken['type'] = 'T_NS_SEPARATOR'; - $newToken['content'] = '\\'; - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - - $name = substr($name, 10); - } - - $parts = explode('\\', $name); - $partCount = count($parts); - $lastPart = ($partCount - 1); - - foreach ($parts as $i => $part) { - $newToken = []; - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - $newToken['content'] = $part; - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - - if ($i !== $lastPart) { - $newToken = []; - $newToken['code'] = T_NS_SEPARATOR; - $newToken['type'] = 'T_NS_SEPARATOR'; - $newToken['content'] = '\\'; - $finalTokens[$newStackPtr] = $newToken; - ++$newStackPtr; - } - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = Tokens::tokenName($token[0]); - $content = Common::prepareForOutput($token[1]); - echo "\t\t* token $stackPtr split into individual tokens; was: $type => $content".PHP_EOL; - } - - continue; - }//end if - - /* - PHP 8.0 Attributes - */ - - if (PHP_VERSION_ID < 80000 - && $token[0] === T_COMMENT - && strpos($token[1], '#[') === 0 - ) { - $subTokens = $this->parsePhpAttribute($tokens, $stackPtr); - if ($subTokens !== null) { - array_splice($tokens, $stackPtr, 1, $subTokens); - $numTokens = count($tokens); - - $tokenIsArray = true; - $token = $tokens[$stackPtr]; - } else { - $token[0] = T_ATTRIBUTE; - } - } - - if ($tokenIsArray === true - && $token[0] === T_ATTRIBUTE - ) { - // Go looking for the close bracket. - $bracketCloser = $this->findCloser($tokens, ($stackPtr + 1), ['[', '#['], ']'); - - $newToken = []; - $newToken['code'] = T_ATTRIBUTE; - $newToken['type'] = 'T_ATTRIBUTE'; - $newToken['content'] = '#['; - $finalTokens[$newStackPtr] = $newToken; - - $tokens[$bracketCloser] = []; - $tokens[$bracketCloser][0] = T_ATTRIBUTE_END; - $tokens[$bracketCloser][1] = ']'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $bracketCloser changed from T_CLOSE_SQUARE_BRACKET to T_ATTRIBUTE_END".PHP_EOL; - } - - $newStackPtr++; - continue; - }//end if - - /* - Tokenize the parameter labels for PHP 8.0 named parameters as a special T_PARAM_NAME - token and ensures that the colon after it is always T_COLON. - */ - - if ($tokenIsArray === true - && ($token[0] === T_STRING - || preg_match('`^[a-zA-Z_\x80-\xff]`', $token[1]) === 1) - ) { - // Get the next non-empty token. - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false - || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false - ) { - break; - } - } - - if (isset($tokens[$i]) === true - && is_array($tokens[$i]) === false - && $tokens[$i] === ':' - ) { - // Get the previous non-empty token. - for ($j = ($stackPtr - 1); $j > 0; $j--) { - if (is_array($tokens[$j]) === false - || isset(Tokens::$emptyTokens[$tokens[$j][0]]) === false - ) { - break; - } - } - - if (is_array($tokens[$j]) === false - && ($tokens[$j] === '(' - || $tokens[$j] === ',') - ) { - $newToken = []; - $newToken['code'] = T_PARAM_NAME; - $newToken['type'] = 'T_PARAM_NAME'; - $newToken['content'] = $token[1]; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - - // Modify the original token stack so that future checks, like - // determining T_COLON vs T_INLINE_ELSE can handle this correctly. - $tokens[$stackPtr][0] = T_PARAM_NAME; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = Tokens::tokenName($token[0]); - echo "\t\t* token $stackPtr changed from $type to T_PARAM_NAME".PHP_EOL; - } - - continue; - } - }//end if - }//end if - - /* - "readonly" keyword for PHP < 8.1 - */ - - if ($tokenIsArray === true - && strtolower($token[1]) === 'readonly' - && (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false - || $finalTokens[$lastNotEmptyToken]['code'] === T_NEW) - ) { - // Get the next non-whitespace token. - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false - || isset(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(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', - 'content' => $token[1], - ]; - $newStackPtr++; - - 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 - - /* - Before PHP 7.0, the "yield from" was tokenized as - T_YIELD, T_WHITESPACE and T_STRING. So look for - and change this token in earlier versions. - */ - - if (PHP_VERSION_ID < 70000 - && PHP_VERSION_ID >= 50500 - && $tokenIsArray === true - && $token[0] === T_YIELD - && isset($tokens[($stackPtr + 1)]) === true - && isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 1)][0] === T_WHITESPACE - && $tokens[($stackPtr + 2)][0] === T_STRING - && strtolower($tokens[($stackPtr + 2)][1]) === 'from' - ) { - // Could be multi-line, so adjust the token stack. - $token[0] = T_YIELD_FROM; - $token[1] .= $tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - for ($i = ($stackPtr + 1); $i <= ($stackPtr + 2); $i++) { - $type = Tokens::tokenName($tokens[$i][0]); - $content = Common::prepareForOutput($tokens[$i][1]); - echo "\t\t* token $i merged into T_YIELD_FROM; was: $type => $content".PHP_EOL; - } - } - - $tokens[($stackPtr + 1)] = null; - $tokens[($stackPtr + 2)] = null; - } - - /* - Before PHP 5.5, the yield keyword was tokenized as - T_STRING. So look for and change this token in - earlier versions. - Checks also if it is just "yield" or "yield from". - */ - - if (PHP_VERSION_ID < 50500 - && $tokenIsArray === true - && $token[0] === T_STRING - && strtolower($token[1]) === 'yield' - && isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false - ) { - if (isset($tokens[($stackPtr + 1)]) === true - && isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 1)][0] === T_WHITESPACE - && $tokens[($stackPtr + 2)][0] === T_STRING - && strtolower($tokens[($stackPtr + 2)][1]) === 'from' - ) { - // Could be multi-line, so just just the token stack. - $token[0] = T_YIELD_FROM; - $token[1] .= $tokens[($stackPtr + 1)][1].$tokens[($stackPtr + 2)][1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - for ($i = ($stackPtr + 1); $i <= ($stackPtr + 2); $i++) { - $type = Tokens::tokenName($tokens[$i][0]); - $content = Common::prepareForOutput($tokens[$i][1]); - echo "\t\t* token $i merged into T_YIELD_FROM; was: $type => $content".PHP_EOL; - } - } - - $tokens[($stackPtr + 1)] = null; - $tokens[($stackPtr + 2)] = null; - } else { - $newToken = []; - $newToken['code'] = T_YIELD; - $newToken['type'] = 'T_YIELD'; - $newToken['content'] = $token[1]; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - continue; - }//end if - }//end if - - /* - Before PHP 5.6, the ... operator was tokenized as three - T_STRING_CONCAT tokens in a row. So look for and combine - these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '.' - && isset($tokens[($stackPtr + 1)]) === true - && isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 1)] === '.' - && $tokens[($stackPtr + 2)] === '.' - ) { - $newToken = []; - $newToken['code'] = T_ELLIPSIS; - $newToken['type'] = 'T_ELLIPSIS'; - $newToken['content'] = '...'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr += 2; - continue; - } - - /* - Before PHP 5.6, the ** operator was tokenized as two - T_MULTIPLY tokens in a row. So look for and combine - these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '*' - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)] === '*' - ) { - $newToken = []; - $newToken['code'] = T_POW; - $newToken['type'] = 'T_POW'; - $newToken['content'] = '**'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - Before PHP 5.6, the **= operator was tokenized as - T_MULTIPLY followed by T_MUL_EQUAL. So look for and combine - these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '*' - && isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][1] === '*=' - ) { - $newToken = []; - $newToken['code'] = T_POW_EQUAL; - $newToken['type'] = 'T_POW_EQUAL'; - $newToken['content'] = '**='; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - Before PHP 7, the ??= operator was tokenized as - T_INLINE_THEN, T_INLINE_THEN, T_EQUAL. - Between PHP 7.0 and 7.3, the ??= operator was tokenized as - T_COALESCE, T_EQUAL. - So look for and combine these tokens in earlier versions. - */ - - if (($tokenIsArray === false - && $token[0] === '?' - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === '?' - && isset($tokens[($stackPtr + 2)]) === true - && $tokens[($stackPtr + 2)][0] === '=') - || ($tokenIsArray === true - && $token[0] === T_COALESCE - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === '=') - ) { - $newToken = []; - $newToken['code'] = T_COALESCE_EQUAL; - $newToken['type'] = 'T_COALESCE_EQUAL'; - $newToken['content'] = '??='; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - - if ($tokenIsArray === false) { - // Pre PHP 7. - $stackPtr++; - } - - continue; - } - - /* - Before PHP 7, the ?? operator was tokenized as - T_INLINE_THEN followed by T_INLINE_THEN. - So look for and combine these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '?' - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === '?' - ) { - $newToken = []; - $newToken['code'] = T_COALESCE; - $newToken['type'] = 'T_COALESCE'; - $newToken['content'] = '??'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - Before PHP 8, the ?-> operator was tokenized as - T_INLINE_THEN followed by T_OBJECT_OPERATOR. - So look for and combine these tokens in earlier versions. - */ - - if ($tokenIsArray === false - && $token[0] === '?' - && isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === T_OBJECT_OPERATOR - ) { - $newToken = []; - $newToken['code'] = T_NULLSAFE_OBJECT_OPERATOR; - $newToken['type'] = 'T_NULLSAFE_OBJECT_OPERATOR'; - $newToken['content'] = '?->'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - Before PHP 7.4, underscores inside T_LNUMBER and T_DNUMBER - tokens split the token with a T_STRING. So look for - and change these tokens in earlier versions. - */ - - if (PHP_VERSION_ID < 70400 - && ($tokenIsArray === true - && ($token[0] === T_LNUMBER - || $token[0] === T_DNUMBER) - && isset($tokens[($stackPtr + 1)]) === true - && is_array($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === T_STRING - && $tokens[($stackPtr + 1)][1][0] === '_') - ) { - $newContent = $token[1]; - $newType = $token[0]; - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false) { - break; - } - - if ($tokens[$i][0] === T_LNUMBER - || $tokens[$i][0] === T_DNUMBER - ) { - $newContent .= $tokens[$i][1]; - continue; - } - - if ($tokens[$i][0] === T_STRING - && $tokens[$i][1][0] === '_' - && ((strpos($newContent, '0x') === 0 - && preg_match('`^((? PHP_INT_MAX) - || (stripos($newContent, '0b') === 0 && bindec(str_replace('_', '', $newContent)) > PHP_INT_MAX) - || (stripos($newContent, '0o') === 0 && octdec(str_replace('_', '', $newContent)) > PHP_INT_MAX) - || (stripos($newContent, '0x') !== 0 - && (stripos($newContent, 'e') !== false || strpos($newContent, '.') !== false)) - || (strpos($newContent, '0') === 0 && stripos($newContent, '0x') !== 0 - && stripos($newContent, '0b') !== 0 && octdec(str_replace('_', '', $newContent)) > PHP_INT_MAX) - || (strpos($newContent, '0') !== 0 && str_replace('_', '', $newContent) > PHP_INT_MAX)) - ) { - $newType = T_DNUMBER; - } - - $newToken = []; - $newToken['code'] = $newType; - $newToken['type'] = Tokens::tokenName($newType); - $newToken['content'] = $newContent; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr = ($i - 1); - continue; - }//end if - - /* - Backfill the T_MATCH token for PHP versions < 8.0 and - do initial correction for non-match expression T_MATCH tokens - to T_STRING for PHP >= 8.0. - A final check for non-match expression T_MATCH tokens is done - in PHP::processAdditional(). - */ - - if ($tokenIsArray === true - && (($token[0] === T_STRING - && strtolower($token[1]) === 'match') - || $token[0] === T_MATCH) - ) { - $isMatch = false; - for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { - if (isset($tokens[$x][0], Tokens::$emptyTokens[$tokens[$x][0]]) === true) { - continue; - } - - if ($tokens[$x] !== '(') { - // This is not a match expression. - break; - } - - if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true) { - // Also not a match expression. - break; - } - - $isMatch = true; - break; - }//end for - - if ($isMatch === true && $token[0] === T_STRING) { - $newToken = []; - $newToken['code'] = T_MATCH; - $newToken['type'] = 'T_MATCH'; - $newToken['content'] = $token[1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_STRING to T_MATCH".PHP_EOL; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - } else if ($isMatch === false && $token[0] === T_MATCH) { - // PHP 8.0, match keyword, but not a match expression. - $newToken = []; - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - $newToken['content'] = $token[1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_MATCH to T_STRING".PHP_EOL; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - }//end if - }//end if - - /* - Retokenize the T_DEFAULT in match control structures as T_MATCH_DEFAULT - to prevent scope being set and the scope for switch default statements - breaking. - */ - - if ($tokenIsArray === true - && $token[0] === T_DEFAULT - && isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === false - ) { - for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { - if ($tokens[$x] === ',') { - // Skip over potential trailing comma (supported in PHP). - continue; - } - - if (is_array($tokens[$x]) === false - || isset(Tokens::$emptyTokens[$tokens[$x][0]]) === false - ) { - // Non-empty, non-comma content. - break; - } - } - - if (isset($tokens[$x]) === true - && is_array($tokens[$x]) === true - && $tokens[$x][0] === T_DOUBLE_ARROW - ) { - // Modify the original token stack for the double arrow so that - // future checks can disregard the double arrow token more easily. - // For match expression "case" statements, this is handled - // in PHP::processAdditional(). - $tokens[$x][0] = T_MATCH_ARROW; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $x changed from T_DOUBLE_ARROW to T_MATCH_ARROW".PHP_EOL; - } - - $newToken = []; - $newToken['code'] = T_MATCH_DEFAULT; - $newToken['type'] = 'T_MATCH_DEFAULT'; - $newToken['content'] = $token[1]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_DEFAULT to T_MATCH_DEFAULT".PHP_EOL; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - }//end if - }//end if - - /* - Convert ? to T_NULLABLE OR T_INLINE_THEN - */ - - if ($tokenIsArray === false && $token[0] === '?') { - $newToken = []; - $newToken['content'] = '?'; - - // For typed constants, we only need to check the token before the ? to be sure. - if ($finalTokens[$lastNotEmptyToken]['code'] === T_CONST) { - $newToken['code'] = T_NULLABLE; - $newToken['type'] = 'T_NULLABLE'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from ? to T_NULLABLE".PHP_EOL; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - } - - /* - * Check if the next non-empty token is one of the tokens which can be used - * in type declarations. If not, it's definitely a ternary. - * 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. - */ - - $lastRelevantNonEmpty = null; - - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === true) { - $tokenType = $tokens[$i][0]; - } else { - $tokenType = $tokens[$i]; - } - - if (isset(Tokens::$emptyTokens[$tokenType]) === true) { - 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 - ) { - $lastRelevantNonEmpty = $tokenType; - continue; - } - - if (($tokenType !== T_CALLABLE - && isset($lastRelevantNonEmpty) === false) - || ($lastRelevantNonEmpty === T_ARRAY - && $tokenType === '(') - || (($lastRelevantNonEmpty === T_STRING - || $lastRelevantNonEmpty === T_NAME_FULLY_QUALIFIED - || $lastRelevantNonEmpty === T_NAME_RELATIVE - || $lastRelevantNonEmpty === T_NAME_QUALIFIED) - && ($tokenType === T_DOUBLE_COLON - || $tokenType === '(' - || $tokenType === ':')) - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from ? to T_INLINE_THEN".PHP_EOL; - } - - $newToken['code'] = T_INLINE_THEN; - $newToken['type'] = 'T_INLINE_THEN'; - - $insideInlineIf[] = $stackPtr; - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue 2; - } - - break; - }//end for - - /* - * This can still be a nullable type or a ternary. - * Do additional checking. - */ - - $prevNonEmpty = null; - $lastSeenNonEmpty = null; - - for ($i = ($stackPtr - 1); $i >= 0; $i--) { - if (is_array($tokens[$i]) === true) { - $tokenType = $tokens[$i][0]; - } else { - $tokenType = $tokens[$i]; - } - - if ($tokenType === T_STATIC - && ($lastSeenNonEmpty === T_DOUBLE_COLON - || $lastSeenNonEmpty === '(') - ) { - $lastSeenNonEmpty = $tokenType; - continue; - } - - if ($prevNonEmpty === null - && isset(Tokens::$emptyTokens[$tokenType]) === false - ) { - // Found the previous non-empty token. - if ($tokenType === ':' || $tokenType === ',' || $tokenType === T_ATTRIBUTE_END) { - $newToken['code'] = T_NULLABLE; - $newToken['type'] = 'T_NULLABLE'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from ? to T_NULLABLE".PHP_EOL; - } - - break; - } - - $prevNonEmpty = $tokenType; - } - - if ($tokenType === T_FUNCTION - || $tokenType === T_FN - || isset(Tokens::$methodPrefixes[$tokenType]) === true - || $tokenType === T_VAR - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from ? to T_NULLABLE".PHP_EOL; - } - - $newToken['code'] = T_NULLABLE; - $newToken['type'] = 'T_NULLABLE'; - break; - } else if (in_array($tokenType, [T_DOUBLE_ARROW, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, '=', '{', ';'], true) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from ? to T_INLINE_THEN".PHP_EOL; - } - - $newToken['code'] = T_INLINE_THEN; - $newToken['type'] = 'T_INLINE_THEN'; - - $insideInlineIf[] = $stackPtr; - break; - } - - if (isset(Tokens::$emptyTokens[$tokenType]) === false) { - $lastSeenNonEmpty = $tokenType; - } - }//end for - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - continue; - }//end if - - /* - Tokens after a double colon may look like scope openers, - such as when writing code like Foo::NAMESPACE, but they are - only ever variables or strings. - */ - - if ($stackPtr > 1 - && (is_array($tokens[($stackPtr - 1)]) === true - && $tokens[($stackPtr - 1)][0] === T_PAAMAYIM_NEKUDOTAYIM) - && $tokenIsArray === true - && $token[0] !== T_STRING - && $token[0] !== T_VARIABLE - && $token[0] !== T_DOLLAR - && isset(Tokens::$emptyTokens[$token[0]]) === false - ) { - $newToken = []; - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - $newToken['content'] = $token[1]; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - continue; - } - - /* - Backfill the T_FN token for PHP versions < 7.4. - */ - - if ($tokenIsArray === true - && $token[0] === T_STRING - && strtolower($token[1]) === 'fn' - ) { - // Modify the original token stack so that - // future checks (like looking for T_NULLABLE) can - // detect the T_FN token more easily. - $tokens[$stackPtr][0] = T_FN; - $token[0] = T_FN; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_STRING to T_FN".PHP_EOL; - } - } - - /* - This is a special condition for T_ARRAY tokens used for - function return types. We want to keep the parenthesis map clean, - so let's tag these tokens as T_STRING. - */ - - if ($tokenIsArray === true - && ($token[0] === T_FUNCTION - || $token[0] === T_FN) - && $finalTokens[$lastNotEmptyToken]['code'] !== T_USE - ) { - // Go looking for the colon to start the return type hint. - // Start by finding the closing parenthesis of the function. - $parenthesisStack = []; - $parenthesisCloser = false; - for ($x = ($stackPtr + 1); $x < $numTokens; $x++) { - if (is_array($tokens[$x]) === false && $tokens[$x] === '(') { - $parenthesisStack[] = $x; - } else if (is_array($tokens[$x]) === false && $tokens[$x] === ')') { - array_pop($parenthesisStack); - if (empty($parenthesisStack) === true) { - $parenthesisCloser = $x; - break; - } - } - } - - if ($parenthesisCloser !== false) { - for ($x = ($parenthesisCloser + 1); $x < $numTokens; $x++) { - if (is_array($tokens[$x]) === false - || isset(Tokens::$emptyTokens[$tokens[$x][0]]) === false - ) { - // Non-empty content. - if (is_array($tokens[$x]) === true && $tokens[$x][0] === T_USE) { - // Found a use statements, so search ahead for the closing parenthesis. - for ($x += 1; $x < $numTokens; $x++) { - if (is_array($tokens[$x]) === false && $tokens[$x] === ')') { - continue(2); - } - } - } - - break; - } - } - - if (isset($tokens[$x]) === true - && is_array($tokens[$x]) === false - && $tokens[$x] === ':' - ) { - // Find the start of the return type. - for ($x += 1; $x < $numTokens; $x++) { - if (is_array($tokens[$x]) === true - && isset(Tokens::$emptyTokens[$tokens[$x][0]]) === true - ) { - // Whitespace or comments before the return type. - continue; - } - - if (is_array($tokens[$x]) === false && $tokens[$x] === '?') { - // Found a nullable operator, so skip it. - // But also convert the token to save the tokenizer - // a bit of time later on. - $tokens[$x] = [ - T_NULLABLE, - '?', - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $x changed from ? to T_NULLABLE".PHP_EOL; - } - - continue; - } - - break; - }//end for - }//end if - }//end if - }//end if - - /* - Before PHP 7, the <=> operator was tokenized as - T_IS_SMALLER_OR_EQUAL followed by T_GREATER_THAN. - So look for and combine these tokens in earlier versions. - */ - - if ($tokenIsArray === true - && $token[0] === T_IS_SMALLER_OR_EQUAL - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)][0] === '>' - ) { - $newToken = []; - $newToken['code'] = T_SPACESHIP; - $newToken['type'] = 'T_SPACESHIP'; - $newToken['content'] = '<=>'; - $finalTokens[$newStackPtr] = $newToken; - - $newStackPtr++; - $stackPtr++; - continue; - } - - /* - PHP doesn't assign a token to goto labels, so we have to. - These are just string tokens with a single colon after them. Double - colons are already tokenized and so don't interfere with this check. - But we do have to account for CASE statements, that look just like - goto labels. - */ - - if ($tokenIsArray === true - && $token[0] === T_STRING - && isset($tokens[($stackPtr + 1)]) === true - && $tokens[($stackPtr + 1)] === ':' - && (is_array($tokens[($stackPtr - 1)]) === false - || $tokens[($stackPtr - 1)][0] !== T_PAAMAYIM_NEKUDOTAYIM) - ) { - $stopTokens = [ - T_CASE => true, - T_SEMICOLON => true, - T_OPEN_TAG => true, - T_OPEN_CURLY_BRACKET => true, - T_INLINE_THEN => true, - T_ENUM => true, - ]; - - for ($x = ($newStackPtr - 1); $x > 0; $x--) { - if (isset($stopTokens[$finalTokens[$x]['code']]) === true) { - break; - } - } - - if ($finalTokens[$x]['code'] !== T_CASE - && $finalTokens[$x]['code'] !== T_INLINE_THEN - && $finalTokens[$x]['code'] !== T_ENUM - ) { - $finalTokens[$newStackPtr] = [ - 'content' => $token[1].':', - 'code' => T_GOTO_LABEL, - 'type' => 'T_GOTO_LABEL', - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $stackPtr changed from T_STRING to T_GOTO_LABEL".PHP_EOL; - echo "\t\t* skipping T_COLON token ".($stackPtr + 1).PHP_EOL; - } - - $newStackPtr++; - $stackPtr++; - continue; - } - }//end if - - /* - If this token has newlines in its content, split each line up - and create a new token for each line. We do this so it's easier - to ascertain where errors occur on a line. - Note that $token[1] is the token's content. - */ - - if ($tokenIsArray === true && strpos($token[1], $this->eolChar) !== false) { - $tokenLines = explode($this->eolChar, $token[1]); - $numLines = count($tokenLines); - $newToken = [ - 'type' => Tokens::tokenName($token[0]), - 'code' => $token[0], - 'content' => '', - ]; - - for ($i = 0; $i < $numLines; $i++) { - $newToken['content'] = $tokenLines[$i]; - if ($i === ($numLines - 1)) { - if ($tokenLines[$i] === '') { - break; - } - } else { - $newToken['content'] .= $this->eolChar; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - } - } else { - // Some T_STRING tokens should remain that way due to their context. - if ($tokenIsArray === true && $token[0] === T_STRING) { - $preserveTstring = false; - - // True/false/parent/self/static in typed constants should be fixed to their own token, - // but the constant name should not be. - if ((isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true - && $finalTokens[$lastNotEmptyToken]['code'] === T_CONST) - || $insideConstDeclaration === true - ) { - // Find the next non-empty token. - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === true - && isset(Tokens::$emptyTokens[$tokens[$i][0]]) === true - ) { - continue; - } - - break; - } - - if ($tokens[$i] === '=') { - $preserveTstring = true; - $insideConstDeclaration = false; - } - } else if (isset($this->tstringContexts[$finalTokens[$lastNotEmptyToken]['code']]) === true - && $finalTokens[$lastNotEmptyToken]['code'] !== T_CONST - ) { - $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(Tokens::$emptyTokens[$finalTokens[$i]['code']]) === true) { - continue; - } - - if ($finalTokens[$i]['code'] === T_FUNCTION) { - $preserveTstring = true; - } - - 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(Tokens::$emptyTokens[$tokens[$i][0]]) === true - ) { - continue; - } - - if ($tokens[$i][0] === '(') { - $preserveTstring = true; - } - - break; - } - }//end if - - if ($preserveTstring === true) { - $finalTokens[$newStackPtr] = [ - 'code' => T_STRING, - 'type' => 'T_STRING', - 'content' => $token[1], - ]; - - $newStackPtr++; - continue; - } - }//end if - - $newToken = null; - if ($tokenIsArray === false) { - if (isset(self::$resolveTokenCache[$token[0]]) === true) { - $newToken = self::$resolveTokenCache[$token[0]]; - } - } else { - $cacheKey = null; - if ($token[0] === T_STRING) { - $cacheKey = strtolower($token[1]); - } else if ($token[0] !== T_CURLY_OPEN) { - $cacheKey = $token[0]; - } - - if ($cacheKey !== null && isset(self::$resolveTokenCache[$cacheKey]) === true) { - $newToken = self::$resolveTokenCache[$cacheKey]; - $newToken['content'] = $token[1]; - } - } - - if ($newToken === null) { - $newToken = self::standardiseToken($token); - } - - // Convert colons that are actually the ELSE component of an - // inline IF statement. - if (empty($insideInlineIf) === false && $newToken['code'] === T_COLON) { - $isInlineIf = true; - - // Make sure this isn't a named parameter label. - // Get the previous non-empty token. - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if (is_array($tokens[$i]) === false - || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false - ) { - break; - } - } - - if ($tokens[$i][0] === T_PARAM_NAME) { - $isInlineIf = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is parameter label, not T_INLINE_ELSE".PHP_EOL; - } - } - - if ($isInlineIf === true) { - // Make sure this isn't a return type separator. - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if (is_array($tokens[$i]) === false - || ($tokens[$i][0] !== T_DOC_COMMENT - && $tokens[$i][0] !== T_COMMENT - && $tokens[$i][0] !== T_WHITESPACE) - ) { - break; - } - } - - if ($tokens[$i] === ')') { - $parenCount = 1; - for ($i--; $i > 0; $i--) { - if ($tokens[$i] === '(') { - $parenCount--; - if ($parenCount === 0) { - break; - } - } else if ($tokens[$i] === ')') { - $parenCount++; - } - } - - // We've found the open parenthesis, so if the previous - // non-empty token is FUNCTION or USE, this is a return type. - // Note that we need to skip T_STRING tokens here as these - // can be function names. - for ($i--; $i > 0; $i--) { - if (is_array($tokens[$i]) === false - || ($tokens[$i][0] !== T_DOC_COMMENT - && $tokens[$i][0] !== T_COMMENT - && $tokens[$i][0] !== T_WHITESPACE - && $tokens[$i][0] !== T_STRING) - ) { - break; - } - } - - if ($tokens[$i][0] === T_FUNCTION || $tokens[$i][0] === T_FN || $tokens[$i][0] === T_USE) { - $isInlineIf = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is return type, not T_INLINE_ELSE".PHP_EOL; - } - } - }//end if - }//end if - - // Check to see if this is a CASE or DEFAULT opener. - if ($isInlineIf === true) { - $inlineIfToken = $insideInlineIf[(count($insideInlineIf) - 1)]; - for ($i = $stackPtr; $i > $inlineIfToken; $i--) { - if (is_array($tokens[$i]) === true - && ($tokens[$i][0] === T_CASE - || $tokens[$i][0] === T_DEFAULT) - ) { - $isInlineIf = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token is T_CASE or T_DEFAULT opener, not T_INLINE_ELSE".PHP_EOL; - } - - break; - } - - if (is_array($tokens[$i]) === false - && ($tokens[$i] === ';' - || $tokens[$i] === '{' - || $tokens[$i] === '}') - ) { - break; - } - }//end for - }//end if - - if ($isInlineIf === true) { - array_pop($insideInlineIf); - $newToken['code'] = T_INLINE_ELSE; - $newToken['type'] = 'T_INLINE_ELSE'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token changed from T_COLON to T_INLINE_ELSE".PHP_EOL; - } - } - }//end if - - // This is a special condition for T_ARRAY tokens used for anything else - // but array declarations, like type hinting function arguments as - // being arrays. - // We want to keep the parenthesis map clean, so let's tag these tokens as - // T_STRING. - if ($newToken['code'] === T_ARRAY) { - for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { - if (is_array($tokens[$i]) === false - || isset(Tokens::$emptyTokens[$tokens[$i][0]]) === false - ) { - // Non-empty content. - break; - } - } - - if ($i !== $numTokens && $tokens[$i] !== '(') { - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - } - } - - // This is a special case when checking PHP 5.5+ code in PHP < 5.5 - // where "finally" should be T_FINALLY instead of T_STRING. - if ($newToken['code'] === T_STRING - && strtolower($newToken['content']) === 'finally' - && $finalTokens[$lastNotEmptyToken]['code'] === T_CLOSE_CURLY_BRACKET - ) { - $newToken['code'] = T_FINALLY; - $newToken['type'] = 'T_FINALLY'; - } - - // This is a special case for PHP 5.6 use function and use const - // where "function" and "const" should be T_STRING instead of T_FUNCTION - // and T_CONST. - if (($newToken['code'] === T_FUNCTION - || $newToken['code'] === T_CONST) - && ($finalTokens[$lastNotEmptyToken]['code'] === T_USE || $insideUseGroup === true) - ) { - $newToken['code'] = T_STRING; - $newToken['type'] = 'T_STRING'; - } - - // This is a special case for use groups in PHP 7+ where leaving - // the curly braces as their normal tokens would confuse - // the scope map and sniffs. - if ($newToken['code'] === T_OPEN_CURLY_BRACKET - && $finalTokens[$lastNotEmptyToken]['code'] === T_NS_SEPARATOR - ) { - $newToken['code'] = T_OPEN_USE_GROUP; - $newToken['type'] = 'T_OPEN_USE_GROUP'; - $insideUseGroup = true; - } - - if ($insideUseGroup === true && $newToken['code'] === T_CLOSE_CURLY_BRACKET) { - $newToken['code'] = T_CLOSE_USE_GROUP; - $newToken['type'] = 'T_CLOSE_USE_GROUP'; - $insideUseGroup = false; - } - - $finalTokens[$newStackPtr] = $newToken; - $newStackPtr++; - }//end if - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END PHP TOKENIZING ***".PHP_EOL; - } - - return $finalTokens; - - }//end tokenize() - - - /** - * Performs additional processing after main tokenizing. - * - * This additional processing checks for CASE statements that are using curly - * braces for scope openers and closers. It also turns some T_FUNCTION tokens - * into T_CLOSURE when they are not standard function definitions. It also - * detects short array syntax and converts those square brackets into new tokens. - * It also corrects some usage of the static and class keywords. It also - * assigns tokens to function return types. - * - * @return void - */ - protected function processAdditional() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START ADDITIONAL PHP PROCESSING ***".PHP_EOL; - } - - $this->createAttributesNestingMap(); - - $numTokens = count($this->tokens); - $lastSeenTypeToken = $numTokens; - - for ($i = ($numTokens - 1); $i >= 0; $i--) { - // Check for any unset scope conditions due to alternate IF/ENDIF syntax. - if (isset($this->tokens[$i]['scope_opener']) === true - && isset($this->tokens[$i]['scope_condition']) === false - ) { - $this->tokens[$i]['scope_condition'] = $this->tokens[$this->tokens[$i]['scope_opener']]['scope_condition']; - } - - if ($this->tokens[$i]['code'] === T_FUNCTION) { - /* - Detect functions that are actually closures and - assign them a different token. - */ - - if (isset($this->tokens[$i]['scope_opener']) === true) { - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false - && $this->tokens[$x]['code'] !== T_BITWISE_AND - ) { - break; - } - } - - if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { - $this->tokens[$i]['code'] = T_CLOSURE; - $this->tokens[$i]['type'] = 'T_CLOSURE'; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t* token $i on line $line changed from T_FUNCTION to T_CLOSURE".PHP_EOL; - } - - for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { - if (isset($this->tokens[$x]['conditions'][$i]) === false) { - continue; - } - - $this->tokens[$x]['conditions'][$i] = T_CLOSURE; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo "\t\t* cleaned $x ($type) *".PHP_EOL; - } - } - } - }//end if - - continue; - } else if ($this->tokens[$i]['code'] === T_CLASS && isset($this->tokens[$i]['scope_opener']) === true) { - /* - Detect anonymous classes and assign them a different token. - */ - - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - break; - } - } - - if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS - || $this->tokens[$x]['code'] === T_OPEN_CURLY_BRACKET - || $this->tokens[$x]['code'] === T_EXTENDS - || $this->tokens[$x]['code'] === T_IMPLEMENTS - ) { - $this->tokens[$i]['code'] = T_ANON_CLASS; - $this->tokens[$i]['type'] = 'T_ANON_CLASS'; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t* token $i on line $line changed from T_CLASS to T_ANON_CLASS".PHP_EOL; - } - - if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS - && isset($this->tokens[$x]['parenthesis_closer']) === true - ) { - $closer = $this->tokens[$x]['parenthesis_closer']; - - $this->tokens[$i]['parenthesis_opener'] = $x; - $this->tokens[$i]['parenthesis_closer'] = $closer; - $this->tokens[$i]['parenthesis_owner'] = $i; - $this->tokens[$x]['parenthesis_owner'] = $i; - $this->tokens[$closer]['parenthesis_owner'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t\t* added parenthesis keys to T_ANON_CLASS token $i on line $line".PHP_EOL; - } - } - - for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { - if (isset($this->tokens[$x]['conditions'][$i]) === false) { - continue; - } - - $this->tokens[$x]['conditions'][$i] = T_ANON_CLASS; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - echo "\t\t* cleaned $x ($type) *".PHP_EOL; - } - } - }//end if - - continue; - } else if ($this->tokens[$i]['code'] === T_FN && isset($this->tokens[($i + 1)]) === true) { - // Possible arrow function. - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false - && $this->tokens[$x]['code'] !== T_BITWISE_AND - ) { - // Non-whitespace content. - break; - } - } - - if (isset($this->tokens[$x]) === true && $this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { - $ignore = Tokens::$emptyTokens; - $ignore += [ - T_ARRAY => T_ARRAY, - T_CALLABLE => T_CALLABLE, - T_COLON => T_COLON, - T_NAMESPACE => T_NAMESPACE, - T_NS_SEPARATOR => T_NS_SEPARATOR, - T_NULL => T_NULL, - T_TRUE => T_TRUE, - T_FALSE => T_FALSE, - T_NULLABLE => T_NULLABLE, - T_PARENT => T_PARENT, - T_SELF => T_SELF, - T_STATIC => T_STATIC, - T_STRING => T_STRING, - T_TYPE_UNION => T_TYPE_UNION, - T_TYPE_INTERSECTION => T_TYPE_INTERSECTION, - T_TYPE_OPEN_PARENTHESIS => T_TYPE_OPEN_PARENTHESIS, - T_TYPE_CLOSE_PARENTHESIS => T_TYPE_CLOSE_PARENTHESIS, - ]; - - $closer = $this->tokens[$x]['parenthesis_closer']; - for ($arrow = ($closer + 1); $arrow < $numTokens; $arrow++) { - if (isset($ignore[$this->tokens[$arrow]['code']]) === false) { - break; - } - } - - if ($this->tokens[$arrow]['code'] === T_DOUBLE_ARROW) { - $endTokens = [ - T_COLON => true, - T_COMMA => true, - T_SEMICOLON => true, - T_CLOSE_PARENTHESIS => true, - T_CLOSE_SQUARE_BRACKET => true, - T_CLOSE_CURLY_BRACKET => true, - T_CLOSE_SHORT_ARRAY => true, - T_OPEN_TAG => true, - T_CLOSE_TAG => true, - ]; - - $inTernary = false; - $lastEndToken = null; - - for ($scopeCloser = ($arrow + 1); $scopeCloser < $numTokens; $scopeCloser++) { - // Arrow function closer should never be shared with the closer of a match - // control structure. - if (isset($this->tokens[$scopeCloser]['scope_closer'], $this->tokens[$scopeCloser]['scope_condition']) === true - && $scopeCloser === $this->tokens[$scopeCloser]['scope_closer'] - && $this->tokens[$this->tokens[$scopeCloser]['scope_condition']]['code'] === T_MATCH - ) { - if ($arrow < $this->tokens[$scopeCloser]['scope_condition']) { - // Match in return value of arrow function. Move on to the next token. - continue; - } - - // Arrow function as return value for the last match case without trailing comma. - if ($lastEndToken !== null) { - $scopeCloser = $lastEndToken; - break; - } - - for ($lastNonEmpty = ($scopeCloser - 1); $lastNonEmpty > $arrow; $lastNonEmpty--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$lastNonEmpty]['code']]) === false) { - $scopeCloser = $lastNonEmpty; - break 2; - } - } - } - - if (isset($endTokens[$this->tokens[$scopeCloser]['code']]) === true) { - if ($lastEndToken !== null - && ((isset($this->tokens[$scopeCloser]['parenthesis_opener']) === true - && $this->tokens[$scopeCloser]['parenthesis_opener'] < $arrow) - || (isset($this->tokens[$scopeCloser]['bracket_opener']) === true - && $this->tokens[$scopeCloser]['bracket_opener'] < $arrow)) - ) { - for ($lastNonEmpty = ($scopeCloser - 1); $lastNonEmpty > $arrow; $lastNonEmpty--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$lastNonEmpty]['code']]) === false) { - $scopeCloser = $lastNonEmpty; - break; - } - } - } - - break; - } - - if ($inTernary === false - && isset($this->tokens[$scopeCloser]['scope_closer'], $this->tokens[$scopeCloser]['scope_condition']) === true - && $scopeCloser === $this->tokens[$scopeCloser]['scope_closer'] - && $this->tokens[$this->tokens[$scopeCloser]['scope_condition']]['code'] === T_FN - ) { - // Found a nested arrow function that already has the closer set and is in - // the same scope as us, so we can use its closer. - break; - } - - if (isset($this->tokens[$scopeCloser]['scope_closer']) === true - && $this->tokens[$scopeCloser]['code'] !== T_INLINE_ELSE - && $this->tokens[$scopeCloser]['code'] !== T_END_HEREDOC - && $this->tokens[$scopeCloser]['code'] !== T_END_NOWDOC - ) { - // We minus 1 here in case the closer can be shared with us. - $scopeCloser = ($this->tokens[$scopeCloser]['scope_closer'] - 1); - continue; - } - - if (isset($this->tokens[$scopeCloser]['parenthesis_closer']) === true) { - $scopeCloser = $this->tokens[$scopeCloser]['parenthesis_closer']; - $lastEndToken = $scopeCloser; - continue; - } - - if (isset($this->tokens[$scopeCloser]['bracket_closer']) === true) { - $scopeCloser = $this->tokens[$scopeCloser]['bracket_closer']; - $lastEndToken = $scopeCloser; - continue; - } - - if ($this->tokens[$scopeCloser]['code'] === T_INLINE_THEN) { - $inTernary = true; - continue; - } - - if ($this->tokens[$scopeCloser]['code'] === T_INLINE_ELSE) { - if ($inTernary === false) { - break; - } - - $inTernary = false; - continue; - } - }//end for - - if ($scopeCloser !== $numTokens) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t=> token $i on line $line processed as arrow function".PHP_EOL; - echo "\t\t* scope opener set to $arrow *".PHP_EOL; - echo "\t\t* scope closer set to $scopeCloser *".PHP_EOL; - echo "\t\t* parenthesis opener set to $x *".PHP_EOL; - echo "\t\t* parenthesis closer set to $closer *".PHP_EOL; - } - - $this->tokens[$i]['code'] = T_FN; - $this->tokens[$i]['type'] = 'T_FN'; - $this->tokens[$i]['scope_condition'] = $i; - $this->tokens[$i]['scope_opener'] = $arrow; - $this->tokens[$i]['scope_closer'] = $scopeCloser; - $this->tokens[$i]['parenthesis_owner'] = $i; - $this->tokens[$i]['parenthesis_opener'] = $x; - $this->tokens[$i]['parenthesis_closer'] = $closer; - - $this->tokens[$arrow]['code'] = T_FN_ARROW; - $this->tokens[$arrow]['type'] = 'T_FN_ARROW'; - - $this->tokens[$arrow]['scope_condition'] = $i; - $this->tokens[$arrow]['scope_opener'] = $arrow; - $this->tokens[$arrow]['scope_closer'] = $scopeCloser; - $this->tokens[$scopeCloser]['scope_condition'] = $i; - $this->tokens[$scopeCloser]['scope_opener'] = $arrow; - $this->tokens[$scopeCloser]['scope_closer'] = $scopeCloser; - - $opener = $this->tokens[$i]['parenthesis_opener']; - $closer = $this->tokens[$i]['parenthesis_closer']; - $this->tokens[$opener]['parenthesis_owner'] = $i; - $this->tokens[$closer]['parenthesis_owner'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$arrow]['line']; - echo "\t\t* token $arrow on line $line changed from T_DOUBLE_ARROW to T_FN_ARROW".PHP_EOL; - } - }//end if - }//end if - }//end if - - // If after all that, the extra tokens are not set, this is not an arrow function. - if (isset($this->tokens[$i]['scope_closer']) === false) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t=> token $i on line $line is not an arrow function".PHP_EOL; - echo "\t\t* token changed from T_FN to T_STRING".PHP_EOL; - } - - $this->tokens[$i]['code'] = T_STRING; - $this->tokens[$i]['type'] = 'T_STRING'; - } - } else if ($this->tokens[$i]['code'] === T_OPEN_SQUARE_BRACKET) { - if (isset($this->tokens[$i]['bracket_closer']) === false) { - continue; - } - - // Unless there is a variable or a bracket before this token, - // it is the start of an array being defined using the short syntax. - $isShortArray = false; - $allowed = [ - T_CLOSE_SQUARE_BRACKET => T_CLOSE_SQUARE_BRACKET, - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_CLOSE_PARENTHESIS => T_CLOSE_PARENTHESIS, - T_VARIABLE => T_VARIABLE, - T_OBJECT_OPERATOR => T_OBJECT_OPERATOR, - T_NULLSAFE_OBJECT_OPERATOR => T_NULLSAFE_OBJECT_OPERATOR, - T_STRING => T_STRING, - T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, - T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, - ]; - $allowed += Tokens::$magicConstants; - - for ($x = ($i - 1); $x >= 0; $x--) { - // If we hit a scope opener, the statement has ended - // without finding anything, so it's probably an array - // using PHP 7.1 short list syntax. - if (isset($this->tokens[$x]['scope_opener']) === true) { - $isShortArray = true; - break; - } - - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - // Allow for control structures without braces. - if (($this->tokens[$x]['code'] === T_CLOSE_PARENTHESIS - && isset($this->tokens[$x]['parenthesis_owner']) === true - && isset(Tokens::$scopeOpeners[$this->tokens[$this->tokens[$x]['parenthesis_owner']]['code']]) === true) - || isset($allowed[$this->tokens[$x]['code']]) === false - ) { - $isShortArray = true; - } - - break; - } - }//end for - - if ($isShortArray === true) { - $this->tokens[$i]['code'] = T_OPEN_SHORT_ARRAY; - $this->tokens[$i]['type'] = 'T_OPEN_SHORT_ARRAY'; - - $closer = $this->tokens[$i]['bracket_closer']; - $this->tokens[$closer]['code'] = T_CLOSE_SHORT_ARRAY; - $this->tokens[$closer]['type'] = 'T_CLOSE_SHORT_ARRAY'; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t* token $i on line $line changed from T_OPEN_SQUARE_BRACKET to T_OPEN_SHORT_ARRAY".PHP_EOL; - $line = $this->tokens[$closer]['line']; - echo "\t* token $closer on line $line changed from T_CLOSE_SQUARE_BRACKET to T_CLOSE_SHORT_ARRAY".PHP_EOL; - } - } - - continue; - } else if ($this->tokens[$i]['code'] === T_MATCH) { - if (isset($this->tokens[$i]['scope_opener'], $this->tokens[$i]['scope_closer']) === false) { - // Not a match expression after all. - $this->tokens[$i]['code'] = T_STRING; - $this->tokens[$i]['type'] = 'T_STRING'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $i changed from T_MATCH to T_STRING".PHP_EOL; - } - - if (isset($this->tokens[$i]['parenthesis_opener'], $this->tokens[$i]['parenthesis_closer']) === true) { - $opener = $this->tokens[$i]['parenthesis_opener']; - $closer = $this->tokens[$i]['parenthesis_closer']; - unset( - $this->tokens[$opener]['parenthesis_owner'], - $this->tokens[$closer]['parenthesis_owner'] - ); - unset( - $this->tokens[$i]['parenthesis_opener'], - $this->tokens[$i]['parenthesis_closer'], - $this->tokens[$i]['parenthesis_owner'] - ); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* cleaned parenthesis of token $i *".PHP_EOL; - } - } - } else { - // Retokenize the double arrows for match expression cases to `T_MATCH_ARROW`. - $searchFor = [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, - T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, - T_OPEN_SHORT_ARRAY => T_OPEN_SHORT_ARRAY, - T_DOUBLE_ARROW => T_DOUBLE_ARROW, - ]; - $searchFor += Tokens::$scopeOpeners; - - for ($x = ($this->tokens[$i]['scope_opener'] + 1); $x < $this->tokens[$i]['scope_closer']; $x++) { - if (isset($searchFor[$this->tokens[$x]['code']]) === false) { - continue; - } - - if (isset($this->tokens[$x]['scope_closer']) === true) { - $x = $this->tokens[$x]['scope_closer']; - continue; - } - - if (isset($this->tokens[$x]['parenthesis_closer']) === true) { - $x = $this->tokens[$x]['parenthesis_closer']; - continue; - } - - if (isset($this->tokens[$x]['bracket_closer']) === true) { - $x = $this->tokens[$x]['bracket_closer']; - continue; - } - - // This must be a double arrow, but make sure anyhow. - if ($this->tokens[$x]['code'] === T_DOUBLE_ARROW) { - $this->tokens[$x]['code'] = T_MATCH_ARROW; - $this->tokens[$x]['type'] = 'T_MATCH_ARROW'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t* token $x changed from T_DOUBLE_ARROW to T_MATCH_ARROW".PHP_EOL; - } - } - }//end for - }//end if - - continue; - } else if ($this->tokens[$i]['code'] === T_BITWISE_OR - || $this->tokens[$i]['code'] === T_BITWISE_AND - || $this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS - ) { - if ($lastSeenTypeToken < $i) { - // We've already examined this code to check if it is a type declaration and concluded it wasn't. - // No need to do it again. - continue; - } - - /* - Convert "|" to T_TYPE_UNION or leave as T_BITWISE_OR. - Convert "&" to T_TYPE_INTERSECTION or leave as T_BITWISE_AND. - Convert "(" and ")" to T_TYPE_(OPEN|CLOSE)_PARENTHESIS or leave as T_(OPEN|CLOSE)_PARENTHESIS. - - All type related tokens will be converted in one go as soon as this section is hit. - */ - - $allowed = [ - T_STRING => T_STRING, - T_CALLABLE => T_CALLABLE, - T_SELF => T_SELF, - 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, - ]; - - $suspectedType = null; - $typeTokenCountAfter = 0; - - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { - continue; - } - - if (isset($allowed[$this->tokens[$x]['code']]) === true) { - ++$typeTokenCountAfter; - continue; - } - - if (($typeTokenCountAfter > 0 - || ($this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS - && isset($this->tokens[$i]['parenthesis_owner']) === false)) - && ($this->tokens[$x]['code'] === T_BITWISE_AND - || $this->tokens[$x]['code'] === T_ELLIPSIS) - ) { - // Skip past reference and variadic indicators for parameter types. - continue; - } - - if ($this->tokens[$x]['code'] === T_VARIABLE) { - // Parameter/Property defaults can not contain variables, so this could be a type. - $suspectedType = 'property or parameter'; - break; - } - - if ($this->tokens[$x]['code'] === T_DOUBLE_ARROW) { - // Possible arrow function. - $suspectedType = 'return'; - break; - } - - if ($this->tokens[$x]['code'] === T_SEMICOLON) { - // Possible abstract method or interface method. - $suspectedType = 'return'; - break; - } - - if ($this->tokens[$x]['code'] === T_OPEN_CURLY_BRACKET - && isset($this->tokens[$x]['scope_condition']) === true - && $this->tokens[$this->tokens[$x]['scope_condition']]['code'] === T_FUNCTION - ) { - $suspectedType = 'return'; - break; - } - - if ($this->tokens[$x]['code'] === T_EQUAL) { - // Possible constant declaration, the `T_STRING` name will have been skipped over already. - $suspectedType = 'constant'; - break; - } - - break; - }//end for - - if (($typeTokenCountAfter === 0 - && ($this->tokens[$i]['code'] !== T_CLOSE_PARENTHESIS - || isset($this->tokens[$i]['parenthesis_owner']) === true)) - || isset($suspectedType) === false - ) { - // Definitely not a union, intersection or DNF type, move on. - continue; - } - - if ($suspectedType === 'property or parameter') { - unset($allowed[T_STATIC]); - } - - $typeTokenCountBefore = 0; - $typeOperators = [$i]; - $parenthesesCount = 0; - $confirmed = false; - $maybeNullable = null; - - if ($this->tokens[$i]['code'] === T_OPEN_PARENTHESIS || $this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { - ++$parenthesesCount; - } - - for ($x = ($i - 1); $x >= 0; $x--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { - continue; - } - - if ($suspectedType === 'property or parameter' - && $this->tokens[$x]['code'] === T_STRING - && strtolower($this->tokens[$x]['content']) === 'static' - ) { - // Static keyword followed directly by an open parenthesis for a DNF type. - // This token should be T_STATIC and was incorrectly identified as a function call before. - $this->tokens[$x]['code'] = T_STATIC; - $this->tokens[$x]['type'] = 'T_STATIC'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$x]['line']; - echo "\t* token $x on line $line changed back from T_STRING to T_STATIC".PHP_EOL; - } - } - - if ($suspectedType === 'property or parameter' - && $this->tokens[$x]['code'] === T_OPEN_PARENTHESIS - ) { - // We need to prevent the open parenthesis for a function/fn declaration from being retokenized - // to T_TYPE_OPEN_PARENTHESIS if this is the first parameter in the declaration. - if (isset($this->tokens[$x]['parenthesis_owner']) === true - && $this->tokens[$this->tokens[$x]['parenthesis_owner']]['code'] === T_FUNCTION - ) { - $confirmed = true; - break; - } else { - // This may still be an arrow function which hasn't been handled yet. - for ($y = ($x - 1); $y > 0; $y--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$y]['code']]) === false - && $this->tokens[$y]['code'] !== T_BITWISE_AND - ) { - // Non-whitespace content. - break; - } - } - - if ($this->tokens[$y]['code'] === T_FN) { - $confirmed = true; - break; - } - } - }//end if - - if (isset($allowed[$this->tokens[$x]['code']]) === true) { - ++$typeTokenCountBefore; - continue; - } - - // Union, intersection and DNF types can't use the nullable operator, but be tolerant to parse errors. - if (($typeTokenCountBefore > 0 - || ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS && isset($this->tokens[$x]['parenthesis_owner']) === false)) - && ($this->tokens[$x]['code'] === T_NULLABLE - || $this->tokens[$x]['code'] === T_INLINE_THEN) - ) { - if ($this->tokens[$x]['code'] === T_INLINE_THEN) { - $maybeNullable = $x; - } - - continue; - } - - if ($this->tokens[$x]['code'] === T_BITWISE_OR || $this->tokens[$x]['code'] === T_BITWISE_AND) { - $typeOperators[] = $x; - continue; - } - - if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS || $this->tokens[$x]['code'] === T_CLOSE_PARENTHESIS) { - ++$parenthesesCount; - $typeOperators[] = $x; - continue; - } - - if ($suspectedType === 'return' && $this->tokens[$x]['code'] === T_COLON) { - // Make sure this is not the colon from a parameter name. - for ($y = ($x - 1); $y > 0; $y--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$y]['code']]) === false) { - break; - } - } - - if ($this->tokens[$y]['code'] !== T_PARAM_NAME) { - $confirmed = true; - } - - break; - } - - if ($suspectedType === 'constant' && $this->tokens[$x]['code'] === T_CONST) { - $confirmed = true; - break; - } - - if ($suspectedType === 'property or parameter' - && (isset(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. - $confirmed = true; - } - - break; - }//end for - - // Remember the last token we examined as part of the (non-)"type declaration". - $lastSeenTypeToken = $x; - - if ($confirmed === false - && $suspectedType === 'property or parameter' - && isset($this->tokens[$i]['nested_parenthesis']) === true - ) { - $parens = $this->tokens[$i]['nested_parenthesis']; - $last = end($parens); - - if (isset($this->tokens[$last]['parenthesis_owner']) === true - && $this->tokens[$this->tokens[$last]['parenthesis_owner']]['code'] === T_FUNCTION - ) { - $confirmed = true; - } else { - // No parenthesis owner set, this may be an arrow function which has not yet - // had additional processing done. - if (isset($this->tokens[$last]['parenthesis_opener']) === true) { - for ($x = ($this->tokens[$last]['parenthesis_opener'] - 1); $x >= 0; $x--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { - continue; - } - - break; - } - - if ($this->tokens[$x]['code'] === T_FN) { - for (--$x; $x >= 0; $x--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true - || $this->tokens[$x]['code'] === T_BITWISE_AND - ) { - continue; - } - - break; - } - - if ($this->tokens[$x]['code'] !== T_FUNCTION) { - $confirmed = true; - } - } - }//end if - }//end if - - unset($parens, $last); - }//end if - - if ($confirmed === false || ($parenthesesCount % 2) !== 0) { - // Not a (valid) union, intersection or DNF type after all, move on. - continue; - } - - foreach ($typeOperators as $x) { - if ($this->tokens[$x]['code'] === T_BITWISE_OR) { - $this->tokens[$x]['code'] = T_TYPE_UNION; - $this->tokens[$x]['type'] = 'T_TYPE_UNION'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$x]['line']; - echo "\t* token $x on line $line changed from T_BITWISE_OR to T_TYPE_UNION".PHP_EOL; - } - } else if ($this->tokens[$x]['code'] === T_BITWISE_AND) { - $this->tokens[$x]['code'] = T_TYPE_INTERSECTION; - $this->tokens[$x]['type'] = 'T_TYPE_INTERSECTION'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$x]['line']; - echo "\t* token $x on line $line changed from T_BITWISE_AND to T_TYPE_INTERSECTION".PHP_EOL; - } - } else if ($this->tokens[$x]['code'] === T_OPEN_PARENTHESIS) { - $this->tokens[$x]['code'] = T_TYPE_OPEN_PARENTHESIS; - $this->tokens[$x]['type'] = 'T_TYPE_OPEN_PARENTHESIS'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$x]['line']; - echo "\t* token $x on line $line changed from T_OPEN_PARENTHESIS to T_TYPE_OPEN_PARENTHESIS".PHP_EOL; - } - } else if ($this->tokens[$x]['code'] === T_CLOSE_PARENTHESIS) { - $this->tokens[$x]['code'] = T_TYPE_CLOSE_PARENTHESIS; - $this->tokens[$x]['type'] = 'T_TYPE_CLOSE_PARENTHESIS'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$x]['line']; - echo "\t* token $x on line $line changed from T_CLOSE_PARENTHESIS to T_TYPE_CLOSE_PARENTHESIS".PHP_EOL; - } - }//end if - }//end foreach - - if (isset($maybeNullable) === true) { - $this->tokens[$maybeNullable]['code'] = T_NULLABLE; - $this->tokens[$maybeNullable]['type'] = 'T_NULLABLE'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$maybeNullable]['line']; - echo "\t* token $maybeNullable on line $line changed from T_INLINE_THEN to T_NULLABLE".PHP_EOL; - } - } - - continue; - } else if ($this->tokens[$i]['code'] === T_STATIC) { - for ($x = ($i - 1); $x > 0; $x--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - break; - } - } - - if ($this->tokens[$x]['code'] === T_INSTANCEOF) { - $this->tokens[$i]['code'] = T_STRING; - $this->tokens[$i]['type'] = 'T_STRING'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - echo "\t* token $i on line $line changed from T_STATIC to T_STRING".PHP_EOL; - } - } - - continue; - } else if ($this->tokens[$i]['code'] === T_TRUE - || $this->tokens[$i]['code'] === T_FALSE - || $this->tokens[$i]['code'] === T_NULL - ) { - for ($x = ($i + 1); $x < $numTokens; $x++) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - // Non-whitespace content. - break; - } - } - - 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']; - echo "\t* token $i on line $line changed from $type to T_STRING".PHP_EOL; - } - - $this->tokens[$i]['code'] = T_STRING; - $this->tokens[$i]['type'] = 'T_STRING'; - } - }//end if - - if (($this->tokens[$i]['code'] !== T_CASE - && $this->tokens[$i]['code'] !== T_DEFAULT) - || isset($this->tokens[$i]['scope_opener']) === false - ) { - // Only interested in CASE and DEFAULT statements from here on in. - continue; - } - - $scopeOpener = $this->tokens[$i]['scope_opener']; - $scopeCloser = $this->tokens[$i]['scope_closer']; - - // If the first char after the opener is a curly brace - // and that brace has been ignored, it is actually - // opening this case statement and the opener and closer are - // probably set incorrectly. - for ($x = ($scopeOpener + 1); $x < $numTokens; $x++) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - // Non-whitespace content. - break; - } - } - - if ($this->tokens[$x]['code'] === T_CASE || $this->tokens[$x]['code'] === T_DEFAULT) { - // Special case for multiple CASE statements that share the same - // closer. Because we are going backwards through the file, this next - // CASE statement is already fixed, so just use its closer and don't - // worry about fixing anything. - $newCloser = $this->tokens[$x]['scope_closer']; - $this->tokens[$i]['scope_closer'] = $newCloser; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $oldType = $this->tokens[$scopeCloser]['type']; - $newType = $this->tokens[$newCloser]['type']; - $line = $this->tokens[$i]['line']; - echo "\t* token $i (T_CASE) on line $line closer changed from $scopeCloser ($oldType) to $newCloser ($newType)".PHP_EOL; - } - - continue; - } - - if ($this->tokens[$x]['code'] !== T_OPEN_CURLY_BRACKET - || isset($this->tokens[$x]['scope_condition']) === true - ) { - // Not a CASE/DEFAULT with a curly brace opener. - continue; - } - - // The closer for this CASE/DEFAULT should be the closing curly brace and - // not whatever it already is. The opener needs to be the opening curly - // brace so everything matches up. - $newCloser = $this->tokens[$x]['bracket_closer']; - foreach ([$i, $x, $newCloser] as $index) { - $this->tokens[$index]['scope_condition'] = $i; - $this->tokens[$index]['scope_opener'] = $x; - $this->tokens[$index]['scope_closer'] = $newCloser; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - $tokenType = $this->tokens[$i]['type']; - - $oldType = $this->tokens[$scopeOpener]['type']; - $newType = $this->tokens[$x]['type']; - echo "\t* token $i ($tokenType) on line $line opener changed from $scopeOpener ($oldType) to $x ($newType)".PHP_EOL; - - $oldType = $this->tokens[$scopeCloser]['type']; - $newType = $this->tokens[$newCloser]['type']; - echo "\t* token $i ($tokenType) on line $line closer changed from $scopeCloser ($oldType) to $newCloser ($newType)".PHP_EOL; - } - - if ($this->tokens[$scopeOpener]['scope_condition'] === $i) { - unset($this->tokens[$scopeOpener]['scope_condition']); - unset($this->tokens[$scopeOpener]['scope_opener']); - unset($this->tokens[$scopeOpener]['scope_closer']); - } - - if ($this->tokens[$scopeCloser]['scope_condition'] === $i) { - unset($this->tokens[$scopeCloser]['scope_condition']); - unset($this->tokens[$scopeCloser]['scope_opener']); - unset($this->tokens[$scopeCloser]['scope_closer']); - } else { - // We were using a shared closer. All tokens that were - // sharing this closer with us, except for the scope condition - // and it's opener, need to now point to the new closer. - $condition = $this->tokens[$scopeCloser]['scope_condition']; - $start = ($this->tokens[$condition]['scope_opener'] + 1); - for ($y = $start; $y < $scopeCloser; $y++) { - if (isset($this->tokens[$y]['scope_closer']) === true - && $this->tokens[$y]['scope_closer'] === $scopeCloser - ) { - $this->tokens[$y]['scope_closer'] = $newCloser; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$y]['line']; - $tokenType = $this->tokens[$y]['type']; - $oldType = $this->tokens[$scopeCloser]['type']; - $newType = $this->tokens[$newCloser]['type']; - echo "\t\t* token $y ($tokenType) on line $line closer changed from $scopeCloser ($oldType) to $newCloser ($newType)".PHP_EOL; - } - } - } - }//end if - - unset($this->tokens[$x]['bracket_opener']); - unset($this->tokens[$x]['bracket_closer']); - unset($this->tokens[$newCloser]['bracket_opener']); - unset($this->tokens[$newCloser]['bracket_closer']); - $this->tokens[$scopeCloser]['conditions'][] = $i; - - // Now fix up all the tokens that think they are - // inside the CASE/DEFAULT statement when they are really outside. - for ($x = $newCloser; $x < $scopeCloser; $x++) { - foreach ($this->tokens[$x]['conditions'] as $num => $oldCond) { - if ($oldCond === $this->tokens[$i]['code']) { - $oldConditions = $this->tokens[$x]['conditions']; - unset($this->tokens[$x]['conditions'][$num]); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - $oldConds = ''; - foreach ($oldConditions as $condition) { - $oldConds .= Tokens::tokenName($condition).','; - } - - $oldConds = rtrim($oldConds, ','); - - $newConds = ''; - foreach ($this->tokens[$x]['conditions'] as $condition) { - $newConds .= Tokens::tokenName($condition).','; - } - - $newConds = rtrim($newConds, ','); - - echo "\t\t* cleaned $x ($type) *".PHP_EOL; - echo "\t\t\t=> conditions changed from $oldConds to $newConds".PHP_EOL; - } - - break; - }//end if - }//end foreach - }//end for - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END ADDITIONAL PHP PROCESSING ***".PHP_EOL; - } - - }//end processAdditional() - - - /** - * Takes a token produced from token_get_all() and produces a - * more uniform token. - * - * @param string|array $token The token to convert. - * - * @return array The new token. - */ - public static function standardiseToken($token) - { - if (isset($token[1]) === false) { - if (isset(self::$resolveTokenCache[$token[0]]) === true) { - return self::$resolveTokenCache[$token[0]]; - } - } else { - $cacheKey = null; - if ($token[0] === T_STRING) { - $cacheKey = strtolower($token[1]); - } else if ($token[0] !== T_CURLY_OPEN) { - $cacheKey = $token[0]; - } - - if ($cacheKey !== null && isset(self::$resolveTokenCache[$cacheKey]) === true) { - $newToken = self::$resolveTokenCache[$cacheKey]; - $newToken['content'] = $token[1]; - return $newToken; - } - } - - if (isset($token[1]) === false) { - return self::resolveSimpleToken($token[0]); - } - - if ($token[0] === T_STRING) { - switch ($cacheKey) { - case 'false': - $newToken['type'] = 'T_FALSE'; - break; - case 'true': - $newToken['type'] = 'T_TRUE'; - break; - case 'null': - $newToken['type'] = 'T_NULL'; - break; - case 'self': - $newToken['type'] = 'T_SELF'; - break; - case 'parent': - $newToken['type'] = 'T_PARENT'; - break; - default: - $newToken['type'] = 'T_STRING'; - break; - } - - $newToken['code'] = constant($newToken['type']); - - self::$resolveTokenCache[$cacheKey] = $newToken; - } else if ($token[0] === T_CURLY_OPEN) { - $newToken = [ - 'code' => T_OPEN_CURLY_BRACKET, - 'type' => 'T_OPEN_CURLY_BRACKET', - ]; - } else { - $newToken = [ - 'code' => $token[0], - 'type' => Tokens::tokenName($token[0]), - ]; - - self::$resolveTokenCache[$token[0]] = $newToken; - }//end if - - $newToken['content'] = $token[1]; - return $newToken; - - }//end standardiseToken() - - - /** - * Converts simple tokens into a format that conforms to complex tokens - * produced by token_get_all(). - * - * Simple tokens are tokens that are not in array form when produced from - * token_get_all(). - * - * @param string $token The simple token to convert. - * - * @return array The new token in array format. - */ - public static function resolveSimpleToken($token) - { - $newToken = []; - - switch ($token) { - case '{': - $newToken['type'] = 'T_OPEN_CURLY_BRACKET'; - break; - case '}': - $newToken['type'] = 'T_CLOSE_CURLY_BRACKET'; - break; - case '[': - $newToken['type'] = 'T_OPEN_SQUARE_BRACKET'; - break; - case ']': - $newToken['type'] = 'T_CLOSE_SQUARE_BRACKET'; - break; - case '(': - $newToken['type'] = 'T_OPEN_PARENTHESIS'; - break; - case ')': - $newToken['type'] = 'T_CLOSE_PARENTHESIS'; - break; - case ':': - $newToken['type'] = 'T_COLON'; - break; - case '.': - $newToken['type'] = 'T_STRING_CONCAT'; - break; - case ';': - $newToken['type'] = 'T_SEMICOLON'; - break; - case '=': - $newToken['type'] = 'T_EQUAL'; - break; - case '*': - $newToken['type'] = 'T_MULTIPLY'; - break; - case '/': - $newToken['type'] = 'T_DIVIDE'; - break; - case '+': - $newToken['type'] = 'T_PLUS'; - break; - case '-': - $newToken['type'] = 'T_MINUS'; - break; - case '%': - $newToken['type'] = 'T_MODULUS'; - break; - case '^': - $newToken['type'] = 'T_BITWISE_XOR'; - break; - case '&': - $newToken['type'] = 'T_BITWISE_AND'; - break; - case '|': - $newToken['type'] = 'T_BITWISE_OR'; - break; - case '~': - $newToken['type'] = 'T_BITWISE_NOT'; - break; - case '<': - $newToken['type'] = 'T_LESS_THAN'; - break; - case '>': - $newToken['type'] = 'T_GREATER_THAN'; - break; - case '!': - $newToken['type'] = 'T_BOOLEAN_NOT'; - break; - case ',': - $newToken['type'] = 'T_COMMA'; - break; - case '@': - $newToken['type'] = 'T_ASPERAND'; - break; - case '$': - $newToken['type'] = 'T_DOLLAR'; - break; - case '`': - $newToken['type'] = 'T_BACKTICK'; - break; - default: - $newToken['type'] = 'T_NONE'; - break; - }//end switch - - $newToken['code'] = constant($newToken['type']); - $newToken['content'] = $token; - - self::$resolveTokenCache[$token] = $newToken; - return $newToken; - - }//end resolveSimpleToken() - - - /** - * Finds a "closer" token (closing parenthesis or square bracket for example) - * Handle parenthesis balancing while searching for closing token - * - * @param array $tokens The list of tokens to iterate searching the closing token (as returned by token_get_all). - * @param int $start The starting position. - * @param string|string[] $openerTokens The opening character. - * @param string $closerChar The closing character. - * - * @return int|null The position of the closing token, if found. NULL otherwise. - */ - private function findCloser(array &$tokens, $start, $openerTokens, $closerChar) - { - $numTokens = count($tokens); - $stack = [0]; - $closer = null; - $openerTokens = (array) $openerTokens; - - for ($x = $start; $x < $numTokens; $x++) { - if (in_array($tokens[$x], $openerTokens, true) === true - || (is_array($tokens[$x]) === true && in_array($tokens[$x][1], $openerTokens, true) === true) - ) { - $stack[] = $x; - } else if ($tokens[$x] === $closerChar) { - array_pop($stack); - if (empty($stack) === true) { - $closer = $x; - break; - } - } - } - - return $closer; - - }//end findCloser() - - - /** - * PHP 8 attributes parser for PHP < 8 - * Handles single-line and multiline attributes. - * - * @param array $tokens The original array of tokens (as returned by token_get_all). - * @param int $stackPtr The current position in token array. - * - * @return array|null The array of parsed attribute tokens - */ - private function parsePhpAttribute(array &$tokens, $stackPtr) - { - - $token = $tokens[$stackPtr]; - - $commentBody = substr($token[1], 2); - $subTokens = @token_get_all(' $subToken) { - if (is_array($subToken) === true - && $subToken[0] === T_COMMENT - && strpos($subToken[1], '#[') === 0 - ) { - $reparsed = $this->parsePhpAttribute($subTokens, $i); - if ($reparsed !== null) { - array_splice($subTokens, $i, 1, $reparsed); - } else { - $subToken[0] = T_ATTRIBUTE; - } - } - } - - array_splice($subTokens, 0, 1, [[T_ATTRIBUTE, '#[']]); - - // Go looking for the close bracket. - $bracketCloser = $this->findCloser($subTokens, 1, '[', ']'); - if (PHP_VERSION_ID < 80000 && $bracketCloser === null) { - foreach (array_slice($tokens, ($stackPtr + 1)) as $token) { - if (is_array($token) === true) { - $commentBody .= $token[1]; - } else { - $commentBody .= $token; - } - } - - $subTokens = @token_get_all('findCloser($subTokens, 1, '[', ']'); - if ($bracketCloser !== null) { - array_splice($tokens, ($stackPtr + 1), count($tokens), array_slice($subTokens, ($bracketCloser + 1))); - $subTokens = array_slice($subTokens, 0, ($bracketCloser + 1)); - } - } - - if ($bracketCloser === null) { - return null; - } - - return $subTokens; - - }//end parsePhpAttribute() - - - /** - * Creates a map for the attributes tokens that surround other tokens. - * - * @return void - */ - private function createAttributesNestingMap() - { - $map = []; - for ($i = 0; $i < $this->numTokens; $i++) { - if (isset($this->tokens[$i]['attribute_opener']) === true - && $i === $this->tokens[$i]['attribute_opener'] - ) { - if (empty($map) === false) { - $this->tokens[$i]['nested_attributes'] = $map; - } - - if (isset($this->tokens[$i]['attribute_closer']) === true) { - $map[$this->tokens[$i]['attribute_opener']] - = $this->tokens[$i]['attribute_closer']; - } - } else if (isset($this->tokens[$i]['attribute_closer']) === true - && $i === $this->tokens[$i]['attribute_closer'] - ) { - array_pop($map); - if (empty($map) === false) { - $this->tokens[$i]['nested_attributes'] = $map; - } - } else { - if (empty($map) === false) { - $this->tokens[$i]['nested_attributes'] = $map; - } - }//end if - }//end for - - }//end createAttributesNestingMap() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php b/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php deleted file mode 100644 index ba41f8da..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php +++ /dev/null @@ -1,1735 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Tokenizers; - -use PHP_CodeSniffer\Exceptions\TokenizerException; -use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Tokens; - -abstract class Tokenizer -{ - - /** - * The config data for the run. - * - * @var \PHP_CodeSniffer\Config - */ - protected $config = null; - - /** - * The EOL char used in the content. - * - * @var string - */ - protected $eolChar = ''; - - /** - * A token-based representation of the content. - * - * @var array - */ - protected $tokens = []; - - /** - * The number of tokens in the tokens array. - * - * @var integer - */ - protected $numTokens = 0; - - /** - * A list of tokens that are allowed to open a scope. - * - * @var array - */ - public $scopeOpeners = []; - - /** - * A list of tokens that end the scope. - * - * @var array - */ - public $endScopeTokens = []; - - /** - * Known lengths of tokens. - * - * @var array - */ - public $knownLengths = []; - - /** - * A list of lines being ignored due to error suppression comments. - * - * @var array - */ - public $ignoredLines = []; - - - /** - * Initialise and run the tokenizer. - * - * @param string $content The content to tokenize. - * @param \PHP_CodeSniffer\Config | null $config The config data for the run. - * @param string $eolChar The EOL char used in the content. - * - * @return void - * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the file appears to be minified. - */ - public function __construct($content, $config, $eolChar='\n') - { - $this->eolChar = $eolChar; - - $this->config = $config; - $this->tokens = $this->tokenize($content); - - if ($config === null) { - return; - } - - $this->createPositionMap(); - $this->createTokenMap(); - $this->createParenthesisNestingMap(); - $this->createScopeMap(); - $this->createLevelMap(); - - // Allow the tokenizer to do additional processing if required. - $this->processAdditional(); - - }//end __construct() - - - /** - * Checks the content to see if it looks minified. - * - * @param string $content The content to tokenize. - * @param string $eolChar The EOL char used in the content. - * - * @return boolean - */ - protected function isMinifiedContent($content, $eolChar='\n') - { - // Minified files often have a very large number of characters per line - // and cause issues when tokenizing. - $numChars = strlen($content); - $numLines = (substr_count($content, $eolChar) + 1); - $average = ($numChars / $numLines); - if ($average > 100) { - return true; - } - - return false; - - }//end isMinifiedContent() - - - /** - * Gets the array of tokens. - * - * @return array - */ - public function getTokens() - { - return $this->tokens; - - }//end getTokens() - - - /** - * Creates an array of tokens when given some content. - * - * @param string $string The string to tokenize. - * - * @return array - */ - abstract protected function tokenize($string); - - - /** - * Performs additional processing after main tokenizing. - * - * @return void - */ - abstract protected function processAdditional(); - - - /** - * Sets token position information. - * - * Can also convert tabs into spaces. Each tab can represent between - * 1 and $width spaces, so this cannot be a straight string replace. - * - * @return void - */ - private function createPositionMap() - { - $currColumn = 1; - $lineNumber = 1; - $eolLen = strlen($this->eolChar); - $ignoring = null; - $inTests = defined('PHP_CODESNIFFER_IN_TESTS'); - - $checkEncoding = false; - if (function_exists('iconv_strlen') === true) { - $checkEncoding = true; - } - - $checkAnnotations = $this->config->annotations; - $encoding = $this->config->encoding; - $tabWidth = $this->config->tabWidth; - - $tokensWithTabs = [ - T_WHITESPACE => true, - T_COMMENT => true, - T_DOC_COMMENT => true, - T_DOC_COMMENT_WHITESPACE => true, - T_DOC_COMMENT_STRING => true, - T_CONSTANT_ENCAPSED_STRING => true, - T_DOUBLE_QUOTED_STRING => true, - T_HEREDOC => true, - T_NOWDOC => true, - T_END_HEREDOC => true, - T_END_NOWDOC => true, - T_INLINE_HTML => true, - ]; - - $this->numTokens = count($this->tokens); - for ($i = 0; $i < $this->numTokens; $i++) { - $this->tokens[$i]['line'] = $lineNumber; - $this->tokens[$i]['column'] = $currColumn; - - if (isset($this->knownLengths[$this->tokens[$i]['code']]) === true) { - // There are no tabs in the tokens we know the length of. - $length = $this->knownLengths[$this->tokens[$i]['code']]; - $currColumn += $length; - } else if ($tabWidth === 0 - || isset($tokensWithTabs[$this->tokens[$i]['code']]) === false - || strpos($this->tokens[$i]['content'], "\t") === false - ) { - // There are no tabs in this content, or we aren't replacing them. - if ($checkEncoding === true) { - // Not using the default encoding, so take a bit more care. - $oldLevel = error_reporting(); - error_reporting(0); - $length = iconv_strlen($this->tokens[$i]['content'], $encoding); - error_reporting($oldLevel); - - if ($length === false) { - // String contained invalid characters, so revert to default. - $length = strlen($this->tokens[$i]['content']); - } - } else { - $length = strlen($this->tokens[$i]['content']); - } - - $currColumn += $length; - } else { - $this->replaceTabsInToken($this->tokens[$i]); - $length = $this->tokens[$i]['length']; - $currColumn += $length; - }//end if - - $this->tokens[$i]['length'] = $length; - - if (isset($this->knownLengths[$this->tokens[$i]['code']]) === false - && strpos($this->tokens[$i]['content'], $this->eolChar) !== false - ) { - $lineNumber++; - $currColumn = 1; - - // Newline chars are not counted in the token length. - $this->tokens[$i]['length'] -= $eolLen; - } - - if ($this->tokens[$i]['code'] === T_COMMENT - || $this->tokens[$i]['code'] === T_DOC_COMMENT_STRING - || $this->tokens[$i]['code'] === T_DOC_COMMENT_TAG - || ($inTests === true && $this->tokens[$i]['code'] === T_INLINE_HTML) - ) { - $commentText = ltrim($this->tokens[$i]['content'], " \t/*#"); - $commentText = rtrim($commentText, " */\t\r\n"); - $commentTextLower = strtolower($commentText); - if (strpos($commentText, '@codingStandards') !== false) { - // If this comment is the only thing on the line, it tells us - // to ignore the following line. If the line contains other content - // then we are just ignoring this one single line. - $ownLine = false; - if ($i > 0) { - for ($prev = ($i - 1); $prev >= 0; $prev--) { - if ($this->tokens[$prev]['code'] === T_WHITESPACE) { - continue; - } - - break; - } - - if ($this->tokens[$prev]['line'] !== $this->tokens[$i]['line']) { - $ownLine = true; - } - } - - if ($ignoring === null - && strpos($commentText, '@codingStandardsIgnoreStart') !== false - ) { - $ignoring = ['.all' => true]; - if ($ownLine === true) { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - } else if ($ignoring !== null - && strpos($commentText, '@codingStandardsIgnoreEnd') !== false - ) { - if ($ownLine === true) { - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - } else { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - - $ignoring = null; - } else if ($ignoring === null - && strpos($commentText, '@codingStandardsIgnoreLine') !== false - ) { - $ignoring = ['.all' => true]; - if ($ownLine === true) { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - $this->ignoredLines[($this->tokens[$i]['line'] + 1)] = $ignoring; - } else { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - - $ignoring = null; - }//end if - } else if (substr($commentTextLower, 0, 6) === 'phpcs:' - || substr($commentTextLower, 0, 7) === '@phpcs:' - ) { - // If the @phpcs: syntax is being used, strip the @ to make - // comparisons easier. - if ($commentText[0] === '@') { - $commentText = substr($commentText, 1); - $commentTextLower = strtolower($commentText); - } - - // If there is a comment on the end, strip it off. - $commentStart = strpos($commentTextLower, ' --'); - if ($commentStart !== false) { - $commentText = substr($commentText, 0, $commentStart); - $commentTextLower = strtolower($commentText); - } - - // If this comment is the only thing on the line, it tells us - // to ignore the following line. If the line contains other content - // then we are just ignoring this one single line. - $lineHasOtherContent = false; - $lineHasOtherTokens = false; - if ($i > 0) { - for ($prev = ($i - 1); $prev > 0; $prev--) { - if ($this->tokens[$prev]['line'] !== $this->tokens[$i]['line']) { - // Changed lines. - break; - } - - if ($this->tokens[$prev]['code'] === T_WHITESPACE - || $this->tokens[$prev]['code'] === T_DOC_COMMENT_WHITESPACE - || ($this->tokens[$prev]['code'] === T_INLINE_HTML - && trim($this->tokens[$prev]['content']) === '') - ) { - continue; - } - - $lineHasOtherTokens = true; - - if ($this->tokens[$prev]['code'] === T_OPEN_TAG - || $this->tokens[$prev]['code'] === T_DOC_COMMENT_STAR - ) { - continue; - } - - $lineHasOtherContent = true; - break; - }//end for - - $changedLines = false; - for ($next = $i; $next < $this->numTokens; $next++) { - if ($changedLines === true) { - // Changed lines. - break; - } - - if (isset($this->knownLengths[$this->tokens[$next]['code']]) === false - && strpos($this->tokens[$next]['content'], $this->eolChar) !== false - ) { - // Last token on the current line. - $changedLines = true; - } - - if ($next === $i) { - continue; - } - - if ($this->tokens[$next]['code'] === T_WHITESPACE - || $this->tokens[$next]['code'] === T_DOC_COMMENT_WHITESPACE - || ($this->tokens[$next]['code'] === T_INLINE_HTML - && trim($this->tokens[$next]['content']) === '') - ) { - continue; - } - - $lineHasOtherTokens = true; - - if ($this->tokens[$next]['code'] === T_CLOSE_TAG) { - continue; - } - - $lineHasOtherContent = true; - break; - }//end for - }//end if - - if (substr($commentTextLower, 0, 9) === 'phpcs:set') { - // Ignore standards for complete lines that change sniff settings. - if ($lineHasOtherTokens === false) { - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - } - - // Need to maintain case here, to get the correct sniff code. - $parts = explode(' ', substr($commentText, 10)); - if (count($parts) >= 2) { - $sniffParts = explode('.', $parts[0]); - if (count($sniffParts) >= 3) { - $this->tokens[$i]['sniffCode'] = array_shift($parts); - $this->tokens[$i]['sniffProperty'] = array_shift($parts); - $this->tokens[$i]['sniffPropertyValue'] = rtrim(implode(' ', $parts), " */\r\n"); - } - } - - $this->tokens[$i]['code'] = T_PHPCS_SET; - $this->tokens[$i]['type'] = 'T_PHPCS_SET'; - } else if (substr($commentTextLower, 0, 16) === 'phpcs:ignorefile') { - // The whole file will be ignored, but at least set the correct token. - $this->tokens[$i]['code'] = T_PHPCS_IGNORE_FILE; - $this->tokens[$i]['type'] = 'T_PHPCS_IGNORE_FILE'; - } else if (substr($commentTextLower, 0, 13) === 'phpcs:disable') { - if ($lineHasOtherContent === false) { - // Completely ignore the comment line. - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - } - - if ($ignoring === null) { - $ignoring = []; - } - - $disabledSniffs = []; - - $additionalText = substr($commentText, 14); - if (empty($additionalText) === true) { - $ignoring = ['.all' => true]; - } else { - $parts = explode(',', $additionalText); - foreach ($parts as $sniffCode) { - $sniffCode = trim($sniffCode); - $disabledSniffs[$sniffCode] = true; - $ignoring[$sniffCode] = true; - - // This newly disabled sniff might be disabling an existing - // enabled exception that we are tracking. - if (isset($ignoring['.except']) === true) { - foreach (array_keys($ignoring['.except']) as $ignoredSniffCode) { - if ($ignoredSniffCode === $sniffCode - || strpos($ignoredSniffCode, $sniffCode.'.') === 0 - ) { - unset($ignoring['.except'][$ignoredSniffCode]); - } - } - - if (empty($ignoring['.except']) === true) { - unset($ignoring['.except']); - } - } - }//end foreach - }//end if - - $this->tokens[$i]['code'] = T_PHPCS_DISABLE; - $this->tokens[$i]['type'] = 'T_PHPCS_DISABLE'; - $this->tokens[$i]['sniffCodes'] = $disabledSniffs; - } else if (substr($commentTextLower, 0, 12) === 'phpcs:enable') { - if ($ignoring !== null) { - $enabledSniffs = []; - - $additionalText = substr($commentText, 13); - if (empty($additionalText) === true) { - $ignoring = null; - } else { - $parts = explode(',', $additionalText); - foreach ($parts as $sniffCode) { - $sniffCode = trim($sniffCode); - $enabledSniffs[$sniffCode] = true; - - // This new enabled sniff might remove previously disabled - // sniffs if it is actually a standard or category of sniffs. - foreach (array_keys($ignoring) as $ignoredSniffCode) { - if ($ignoredSniffCode === $sniffCode - || strpos($ignoredSniffCode, $sniffCode.'.') === 0 - ) { - unset($ignoring[$ignoredSniffCode]); - } - } - - // This new enabled sniff might be able to clear up - // previously enabled sniffs if it is actually a standard or - // category of sniffs. - if (isset($ignoring['.except']) === true) { - foreach (array_keys($ignoring['.except']) as $ignoredSniffCode) { - if ($ignoredSniffCode === $sniffCode - || strpos($ignoredSniffCode, $sniffCode.'.') === 0 - ) { - unset($ignoring['.except'][$ignoredSniffCode]); - } - } - } - }//end foreach - - if (empty($ignoring) === true) { - $ignoring = null; - } else { - if (isset($ignoring['.except']) === true) { - $ignoring['.except'] += $enabledSniffs; - } else { - $ignoring['.except'] = $enabledSniffs; - } - } - }//end if - - if ($lineHasOtherContent === false) { - // Completely ignore the comment line. - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - } else { - // The comment is on the same line as the code it is ignoring, - // so respect the new ignore rules. - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - - $this->tokens[$i]['sniffCodes'] = $enabledSniffs; - }//end if - - $this->tokens[$i]['code'] = T_PHPCS_ENABLE; - $this->tokens[$i]['type'] = 'T_PHPCS_ENABLE'; - } else if (substr($commentTextLower, 0, 12) === 'phpcs:ignore') { - $ignoreRules = []; - - $additionalText = substr($commentText, 13); - if (empty($additionalText) === true) { - $ignoreRules = ['.all' => true]; - } else { - $parts = explode(',', $additionalText); - foreach ($parts as $sniffCode) { - $ignoreRules[trim($sniffCode)] = true; - } - } - - $this->tokens[$i]['code'] = T_PHPCS_IGNORE; - $this->tokens[$i]['type'] = 'T_PHPCS_IGNORE'; - $this->tokens[$i]['sniffCodes'] = $ignoreRules; - - if ($ignoring !== null) { - $ignoreRules += $ignoring; - } - - if ($lineHasOtherContent === false) { - // Completely ignore the comment line, and set the following - // line to include the ignore rules we've set. - $this->ignoredLines[$this->tokens[$i]['line']] = ['.all' => true]; - $this->ignoredLines[($this->tokens[$i]['line'] + 1)] = $ignoreRules; - } else { - // The comment is on the same line as the code it is ignoring, - // so respect the ignore rules it set. - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoreRules; - } - }//end if - }//end if - }//end if - - if ($ignoring !== null && isset($this->ignoredLines[$this->tokens[$i]['line']]) === false) { - $this->ignoredLines[$this->tokens[$i]['line']] = $ignoring; - } - }//end for - - // If annotations are being ignored, we clear out all the ignore rules - // but leave the annotations tokenized as normal. - if ($checkAnnotations === false) { - $this->ignoredLines = []; - } - - }//end createPositionMap() - - - /** - * Replaces tabs in original token content with spaces. - * - * Each tab can represent between 1 and $config->tabWidth spaces, - * so this cannot be a straight string replace. The original content - * is placed into an orig_content index and the new token length is also - * set in the length index. - * - * @param array $token The token to replace tabs inside. - * @param string $prefix The character to use to represent the start of a tab. - * @param string $padding The character to use to represent the end of a tab. - * @param int $tabWidth The number of spaces each tab represents. - * - * @return void - */ - public function replaceTabsInToken(&$token, $prefix=' ', $padding=' ', $tabWidth=null) - { - $checkEncoding = false; - if (function_exists('iconv_strlen') === true) { - $checkEncoding = true; - } - - $currColumn = $token['column']; - if ($tabWidth === null) { - $tabWidth = $this->config->tabWidth; - if ($tabWidth === 0) { - $tabWidth = 1; - } - } - - if (rtrim($token['content'], "\t") === '') { - // String only contains tabs, so we can shortcut the process. - $numTabs = strlen($token['content']); - - $firstTabSize = ($tabWidth - (($currColumn - 1) % $tabWidth)); - $length = ($firstTabSize + ($tabWidth * ($numTabs - 1))); - $newContent = $prefix.str_repeat($padding, ($length - 1)); - } else { - // We need to determine the length of each tab. - $tabs = explode("\t", $token['content']); - - $numTabs = (count($tabs) - 1); - $tabNum = 0; - $newContent = ''; - $length = 0; - - foreach ($tabs as $content) { - if ($content !== '') { - $newContent .= $content; - if ($checkEncoding === true) { - // Not using the default encoding, so take a bit more care. - $oldLevel = error_reporting(); - error_reporting(0); - $contentLength = iconv_strlen($content, $this->config->encoding); - error_reporting($oldLevel); - if ($contentLength === false) { - // String contained invalid characters, so revert to default. - $contentLength = strlen($content); - } - } else { - $contentLength = strlen($content); - } - - $currColumn += $contentLength; - $length += $contentLength; - } - - // The last piece of content does not have a tab after it. - if ($tabNum === $numTabs) { - break; - } - - // Process the tab that comes after the content. - $tabNum++; - - // Move the pointer to the next tab stop. - $pad = ($tabWidth - ($currColumn + $tabWidth - 1) % $tabWidth); - $currColumn += $pad; - $length += $pad; - $newContent .= $prefix.str_repeat($padding, ($pad - 1)); - }//end foreach - }//end if - - $token['orig_content'] = $token['content']; - $token['content'] = $newContent; - $token['length'] = $length; - - }//end replaceTabsInToken() - - - /** - * Creates a map of brackets positions. - * - * @return void - */ - private function createTokenMap() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START TOKEN MAP ***".PHP_EOL; - } - - $squareOpeners = []; - $curlyOpeners = []; - $this->numTokens = count($this->tokens); - - $openers = []; - $openOwner = null; - - for ($i = 0; $i < $this->numTokens; $i++) { - /* - Parenthesis mapping. - */ - - if (isset(Tokens::$parenthesisOpeners[$this->tokens[$i]['code']]) === true) { - $this->tokens[$i]['parenthesis_opener'] = null; - $this->tokens[$i]['parenthesis_closer'] = null; - $this->tokens[$i]['parenthesis_owner'] = $i; - $openOwner = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found parenthesis owner at $i".PHP_EOL; - } - } else if ($this->tokens[$i]['code'] === T_OPEN_PARENTHESIS) { - $openers[] = $i; - $this->tokens[$i]['parenthesis_opener'] = $i; - if ($openOwner !== null) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($openers)); - echo "=> Found parenthesis opener at $i for $openOwner".PHP_EOL; - } - - $this->tokens[$openOwner]['parenthesis_opener'] = $i; - $this->tokens[$i]['parenthesis_owner'] = $openOwner; - $openOwner = null; - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($openers)); - echo "=> Found unowned parenthesis opener at $i".PHP_EOL; - } - } else if ($this->tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { - // Did we set an owner for this set of parenthesis? - $numOpeners = count($openers); - if ($numOpeners !== 0) { - $opener = array_pop($openers); - if (isset($this->tokens[$opener]['parenthesis_owner']) === true) { - $owner = $this->tokens[$opener]['parenthesis_owner']; - - $this->tokens[$owner]['parenthesis_closer'] = $i; - $this->tokens[$i]['parenthesis_owner'] = $owner; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found parenthesis closer at $i for $owner".PHP_EOL; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found unowned parenthesis closer at $i for $opener".PHP_EOL; - } - - $this->tokens[$i]['parenthesis_opener'] = $opener; - $this->tokens[$i]['parenthesis_closer'] = $i; - $this->tokens[$opener]['parenthesis_closer'] = $i; - }//end if - } else if ($this->tokens[$i]['code'] === T_ATTRIBUTE) { - $openers[] = $i; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($openers)); - echo "=> Found attribute opener at $i".PHP_EOL; - } - - $this->tokens[$i]['attribute_opener'] = $i; - $this->tokens[$i]['attribute_closer'] = null; - } else if ($this->tokens[$i]['code'] === T_ATTRIBUTE_END) { - $numOpeners = count($openers); - if ($numOpeners !== 0) { - $opener = array_pop($openers); - if (isset($this->tokens[$opener]['attribute_opener']) === true) { - $this->tokens[$opener]['attribute_closer'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found attribute closer at $i for $opener".PHP_EOL; - } - - for ($x = ($opener + 1); $x <= $i; ++$x) { - if (isset($this->tokens[$x]['attribute_closer']) === true) { - continue; - } - - $this->tokens[$x]['attribute_opener'] = $opener; - $this->tokens[$x]['attribute_closer'] = $i; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", (count($openers) + 1)); - echo "=> Found unowned attribute closer at $i for $opener".PHP_EOL; - } - }//end if - }//end if - - /* - Bracket mapping. - */ - - switch ($this->tokens[$i]['code']) { - case T_OPEN_SQUARE_BRACKET: - $squareOpeners[] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($squareOpeners)); - echo str_repeat("\t", count($curlyOpeners)); - echo "=> Found square bracket opener at $i".PHP_EOL; - } - break; - case T_OPEN_CURLY_BRACKET: - if (isset($this->tokens[$i]['scope_closer']) === false) { - $curlyOpeners[] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($squareOpeners)); - echo str_repeat("\t", count($curlyOpeners)); - echo "=> Found curly bracket opener at $i".PHP_EOL; - } - } - break; - case T_CLOSE_SQUARE_BRACKET: - if (empty($squareOpeners) === false) { - $opener = array_pop($squareOpeners); - $this->tokens[$i]['bracket_opener'] = $opener; - $this->tokens[$i]['bracket_closer'] = $i; - $this->tokens[$opener]['bracket_opener'] = $opener; - $this->tokens[$opener]['bracket_closer'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($squareOpeners)); - echo str_repeat("\t", count($curlyOpeners)); - echo "\t=> Found square bracket closer at $i for $opener".PHP_EOL; - } - } - break; - case T_CLOSE_CURLY_BRACKET: - if (empty($curlyOpeners) === false - && isset($this->tokens[$i]['scope_opener']) === false - ) { - $opener = array_pop($curlyOpeners); - $this->tokens[$i]['bracket_opener'] = $opener; - $this->tokens[$i]['bracket_closer'] = $i; - $this->tokens[$opener]['bracket_opener'] = $opener; - $this->tokens[$opener]['bracket_closer'] = $i; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", count($squareOpeners)); - echo str_repeat("\t", count($curlyOpeners)); - echo "\t=> Found curly bracket closer at $i for $opener".PHP_EOL; - } - } - break; - default: - continue 2; - }//end switch - }//end for - - // Cleanup for any openers that we didn't find closers for. - // This typically means there was a syntax error breaking things. - foreach ($openers as $opener) { - unset($this->tokens[$opener]['parenthesis_opener']); - unset($this->tokens[$opener]['parenthesis_owner']); - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END TOKEN MAP ***".PHP_EOL; - } - - }//end createTokenMap() - - - /** - * Creates a map for the parenthesis tokens that surround other tokens. - * - * @return void - */ - private function createParenthesisNestingMap() - { - $map = []; - for ($i = 0; $i < $this->numTokens; $i++) { - if (isset($this->tokens[$i]['parenthesis_opener']) === true - && $i === $this->tokens[$i]['parenthesis_opener'] - ) { - if (empty($map) === false) { - $this->tokens[$i]['nested_parenthesis'] = $map; - } - - if (isset($this->tokens[$i]['parenthesis_closer']) === true) { - $map[$this->tokens[$i]['parenthesis_opener']] - = $this->tokens[$i]['parenthesis_closer']; - } - } else if (isset($this->tokens[$i]['parenthesis_closer']) === true - && $i === $this->tokens[$i]['parenthesis_closer'] - ) { - array_pop($map); - if (empty($map) === false) { - $this->tokens[$i]['nested_parenthesis'] = $map; - } - } else { - if (empty($map) === false) { - $this->tokens[$i]['nested_parenthesis'] = $map; - } - }//end if - }//end for - - }//end createParenthesisNestingMap() - - - /** - * Creates a scope map of tokens that open scopes. - * - * @return void - * @see recurseScopeMap() - */ - private function createScopeMap() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START SCOPE MAP ***".PHP_EOL; - } - - for ($i = 0; $i < $this->numTokens; $i++) { - // Check to see if the current token starts a new scope. - if (isset($this->scopeOpeners[$this->tokens[$i]['code']]) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - $content = Common::prepareForOutput($this->tokens[$i]['content']); - echo "\tStart scope map at $i:$type => $content".PHP_EOL; - } - - if (isset($this->tokens[$i]['scope_condition']) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* already processed, skipping *".PHP_EOL; - } - - continue; - } - - $i = $this->recurseScopeMap($i); - }//end if - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END SCOPE MAP ***".PHP_EOL; - } - - }//end createScopeMap() - - - /** - * Recurses though the scope openers to build a scope map. - * - * @param int $stackPtr The position in the stack of the token that - * opened the scope (eg. an IF token or FOR token). - * @param int $depth How many scope levels down we are. - * @param int $ignore How many curly braces we are ignoring. - * - * @return int The position in the stack that closed the scope. - * @throws \PHP_CodeSniffer\Exceptions\TokenizerException If the nesting level gets too deep. - */ - private function recurseScopeMap($stackPtr, $depth=1, &$ignore=0) - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "=> Begin scope map recursion at token $stackPtr with depth $depth".PHP_EOL; - } - - $opener = null; - $currType = $this->tokens[$stackPtr]['code']; - $startLine = $this->tokens[$stackPtr]['line']; - - // We will need this to restore the value if we end up - // returning a token ID that causes our calling function to go back - // over already ignored braces. - $originalIgnore = $ignore; - - // If the start token for this scope opener is the same as - // the scope token, we have already found our opener. - if (isset($this->scopeOpeners[$currType]['start'][$currType]) === true) { - $opener = $stackPtr; - } - - for ($i = ($stackPtr + 1); $i < $this->numTokens; $i++) { - $tokenType = $this->tokens[$i]['code']; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - $line = $this->tokens[$i]['line']; - $content = Common::prepareForOutput($this->tokens[$i]['content']); - - echo str_repeat("\t", $depth); - echo "Process token $i on line $line ["; - if ($opener !== null) { - echo "opener:$opener;"; - } - - if ($ignore > 0) { - echo "ignore=$ignore;"; - } - - echo "]: $type => $content".PHP_EOL; - }//end if - - // Very special case for IF statements in PHP that can be defined without - // scope tokens. E.g., if (1) 1; 1 ? (1 ? 1 : 1) : 1; - // If an IF statement below this one has an opener but no - // keyword, the opener will be incorrectly assigned to this IF statement. - // The same case also applies to USE statements, which don't have to have - // openers, so a following USE statement can cause an incorrect brace match. - if (($currType === T_IF || $currType === T_ELSE || $currType === T_USE) - && $opener === null - && ($this->tokens[$i]['code'] === T_SEMICOLON - || $this->tokens[$i]['code'] === T_CLOSE_TAG) - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - if ($this->tokens[$i]['code'] === T_SEMICOLON) { - $closerType = 'semicolon'; - } else { - $closerType = 'close tag'; - } - - echo "=> Found $closerType before scope opener for $stackPtr:$type, bailing".PHP_EOL; - } - - return $i; - } - - // Special case for PHP control structures that have no braces. - // If we find a curly brace closer before we find the opener, - // we're not going to find an opener. That closer probably belongs to - // a control structure higher up. - if ($opener === null - && $ignore === 0 - && $tokenType === T_CLOSE_CURLY_BRACKET - && isset($this->scopeOpeners[$currType]['end'][$tokenType]) === true - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found curly brace closer before scope opener for $stackPtr:$type, bailing".PHP_EOL; - } - - return ($i - 1); - } - - if ($opener !== null - && (isset($this->tokens[$i]['scope_opener']) === false - || $this->scopeOpeners[$this->tokens[$stackPtr]['code']]['shared'] === true) - && isset($this->scopeOpeners[$currType]['end'][$tokenType]) === true - ) { - if ($ignore > 0 && $tokenType === T_CLOSE_CURLY_BRACKET) { - // The last opening bracket must have been for a string - // offset or alike, so let's ignore it. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* finished ignoring curly brace *'.PHP_EOL; - } - - $ignore--; - continue; - } else if ($this->tokens[$opener]['code'] === T_OPEN_CURLY_BRACKET - && $tokenType !== T_CLOSE_CURLY_BRACKET - ) { - // The opener is a curly bracket so the closer must be a curly bracket as well. - // We ignore this closer to handle cases such as T_ELSE or T_ELSEIF being considered - // a closer of T_IF when it should not. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Ignoring non-curly scope closer for $stackPtr:$type".PHP_EOL; - } - } else { - $scopeCloser = $i; - $todo = [ - $stackPtr, - $opener, - ]; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - $closerType = $this->tokens[$scopeCloser]['type']; - echo str_repeat("\t", $depth); - echo "=> Found scope closer ($scopeCloser:$closerType) for $stackPtr:$type".PHP_EOL; - } - - $validCloser = true; - if (($this->tokens[$stackPtr]['code'] === T_IF || $this->tokens[$stackPtr]['code'] === T_ELSEIF) - && ($tokenType === T_ELSE || $tokenType === T_ELSEIF) - ) { - // To be a closer, this token must have an opener. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "* closer needs to be tested *".PHP_EOL; - } - - $i = self::recurseScopeMap($i, ($depth + 1), $ignore); - - if (isset($this->tokens[$scopeCloser]['scope_opener']) === false) { - $validCloser = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "* closer is not valid (no opener found) *".PHP_EOL; - } - } else if ($this->tokens[$this->tokens[$scopeCloser]['scope_opener']]['code'] !== $this->tokens[$opener]['code']) { - $validCloser = false; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - $type = $this->tokens[$this->tokens[$scopeCloser]['scope_opener']]['type']; - $openerType = $this->tokens[$opener]['type']; - echo "* closer is not valid (mismatched opener type; $type != $openerType) *".PHP_EOL; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "* closer was valid *".PHP_EOL; - } - } else { - // The closer was not processed, so we need to - // complete that token as well. - $todo[] = $scopeCloser; - }//end if - - if ($validCloser === true) { - foreach ($todo as $token) { - $this->tokens[$token]['scope_condition'] = $stackPtr; - $this->tokens[$token]['scope_opener'] = $opener; - $this->tokens[$token]['scope_closer'] = $scopeCloser; - } - - if ($this->scopeOpeners[$this->tokens[$stackPtr]['code']]['shared'] === true) { - // As we are going back to where we started originally, restore - // the ignore value back to its original value. - $ignore = $originalIgnore; - return $opener; - } else if ($scopeCloser === $i - && isset($this->scopeOpeners[$tokenType]) === true - ) { - // Unset scope_condition here or else the token will appear to have - // already been processed, and it will be skipped. Normally we want that, - // but in this case, the token is both a closer and an opener, so - // it needs to act like an opener. This is also why we return the - // token before this one; so the closer has a chance to be processed - // a second time, but as an opener. - unset($this->tokens[$scopeCloser]['scope_condition']); - return ($i - 1); - } else { - return $i; - } - } else { - continue; - }//end if - }//end if - }//end if - - // Is this an opening condition ? - if (isset($this->scopeOpeners[$tokenType]) === true) { - if ($opener === null) { - if ($tokenType === T_USE) { - // PHP use keywords are special because they can be - // used as blocks but also inline in function definitions. - // So if we find them nested inside another opener, just skip them. - continue; - } - - if ($tokenType === T_NAMESPACE) { - // PHP namespace keywords are special because they can be - // used as blocks but also inline as operators. - // So if we find them nested inside another opener, just skip them. - continue; - } - - if ($tokenType === T_FUNCTION - && $this->tokens[$stackPtr]['code'] !== T_FUNCTION - ) { - // Probably a closure, so process it manually. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found function before scope opener for $stackPtr:$type, processing manually".PHP_EOL; - } - - if (isset($this->tokens[$i]['scope_closer']) === true) { - // We've already processed this closure. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* already processed, skipping *'.PHP_EOL; - } - - $i = $this->tokens[$i]['scope_closer']; - continue; - } - - $i = self::recurseScopeMap($i, ($depth + 1), $ignore); - continue; - }//end if - - if ($tokenType === T_CLASS) { - // Probably an anonymous class inside another anonymous class, - // so process it manually. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found class before scope opener for $stackPtr:$type, processing manually".PHP_EOL; - } - - if (isset($this->tokens[$i]['scope_closer']) === true) { - // We've already processed this anon class. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* already processed, skipping *'.PHP_EOL; - } - - $i = $this->tokens[$i]['scope_closer']; - continue; - } - - $i = self::recurseScopeMap($i, ($depth + 1), $ignore); - continue; - }//end if - - // Found another opening condition but still haven't - // found our opener, so we are never going to find one. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found new opening condition before scope opener for $stackPtr:$type, "; - } - - if (($this->tokens[$stackPtr]['code'] === T_IF - || $this->tokens[$stackPtr]['code'] === T_ELSEIF - || $this->tokens[$stackPtr]['code'] === T_ELSE) - && ($this->tokens[$i]['code'] === T_ELSE - || $this->tokens[$i]['code'] === T_ELSEIF) - ) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "continuing".PHP_EOL; - } - - return ($i - 1); - } else { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "backtracking".PHP_EOL; - } - - return $stackPtr; - } - }//end if - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* token is an opening condition *'.PHP_EOL; - } - - $isShared = ($this->scopeOpeners[$tokenType]['shared'] === true); - - if (isset($this->tokens[$i]['scope_condition']) === true) { - // We've been here before. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* already processed, skipping *'.PHP_EOL; - } - - if ($isShared === false - && isset($this->tokens[$i]['scope_closer']) === true - ) { - $i = $this->tokens[$i]['scope_closer']; - } - - continue; - } else if ($currType === $tokenType - && $isShared === false - && $opener === null - ) { - // We haven't yet found our opener, but we have found another - // scope opener which is the same type as us, and we don't - // share openers, so we will never find one. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* it was another token\'s opener, bailing *'.PHP_EOL; - } - - return $stackPtr; - } else { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* searching for opener *'.PHP_EOL; - } - - if (isset($this->scopeOpeners[$tokenType]['end'][T_CLOSE_CURLY_BRACKET]) === true) { - $oldIgnore = $ignore; - $ignore = 0; - } - - // PHP has a max nesting level for functions. Stop before we hit that limit - // because too many loops means we've run into trouble anyway. - if ($depth > 50) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* reached maximum nesting level; aborting *'.PHP_EOL; - } - - throw new TokenizerException('Maximum nesting level reached; file could not be processed'); - } - - $oldDepth = $depth; - if ($isShared === true - && isset($this->scopeOpeners[$tokenType]['with'][$currType]) === true - ) { - // Don't allow the depth to increment because this is - // possibly not a true nesting if we are sharing our closer. - // This can happen, for example, when a SWITCH has a large - // number of CASE statements with the same shared BREAK. - $depth--; - } - - $i = self::recurseScopeMap($i, ($depth + 1), $ignore); - $depth = $oldDepth; - - if (isset($this->scopeOpeners[$tokenType]['end'][T_CLOSE_CURLY_BRACKET]) === true) { - $ignore = $oldIgnore; - } - }//end if - }//end if - - if (isset($this->scopeOpeners[$currType]['start'][$tokenType]) === true - && $opener === null - ) { - if ($tokenType === T_OPEN_CURLY_BRACKET) { - if (isset($this->tokens[$stackPtr]['parenthesis_closer']) === true - && $i < $this->tokens[$stackPtr]['parenthesis_closer'] - ) { - // We found a curly brace inside the condition of the - // current scope opener, so it must be a string offset. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* ignoring curly brace inside condition *'.PHP_EOL; - } - - $ignore++; - } else { - // Make sure this is actually an opener and not a - // string offset (e.g., $var{0}). - for ($x = ($i - 1); $x > 0; $x--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === true) { - continue; - } else { - // If the first non-whitespace/comment token looks like this - // brace is a string offset, or this brace is mid-way through - // a new statement, it isn't a scope opener. - $disallowed = Tokens::$assignmentTokens; - $disallowed += [ - T_DOLLAR => true, - T_VARIABLE => true, - T_OBJECT_OPERATOR => true, - T_NULLSAFE_OBJECT_OPERATOR => true, - T_COMMA => true, - T_OPEN_PARENTHESIS => true, - ]; - - if (isset($disallowed[$this->tokens[$x]['code']]) === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* ignoring curly brace *'.PHP_EOL; - } - - $ignore++; - } - - break; - }//end if - }//end for - }//end if - }//end if - - if ($ignore === 0 || $tokenType !== T_OPEN_CURLY_BRACKET) { - $openerNested = isset($this->tokens[$i]['nested_parenthesis']); - $ownerNested = isset($this->tokens[$stackPtr]['nested_parenthesis']); - - if (($openerNested === true && $ownerNested === false) - || ($openerNested === false && $ownerNested === true) - || ($openerNested === true - && $this->tokens[$i]['nested_parenthesis'] !== $this->tokens[$stackPtr]['nested_parenthesis']) - ) { - // We found the a token that looks like the opener, but it's nested differently. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - echo str_repeat("\t", $depth); - echo "* ignoring possible opener $i:$type as nested parenthesis don't match *".PHP_EOL; - } - } else { - // We found the opening scope token for $currType. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found scope opener for $stackPtr:$type".PHP_EOL; - } - - $opener = $i; - } - }//end if - } else if ($tokenType === T_SEMICOLON - && $opener === null - && (isset($this->tokens[$stackPtr]['parenthesis_closer']) === false - || $i > $this->tokens[$stackPtr]['parenthesis_closer']) - ) { - // Found the end of a statement but still haven't - // found our opener, so we are never going to find one. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found end of statement before scope opener for $stackPtr:$type, continuing".PHP_EOL; - } - - return ($i - 1); - } else if ($tokenType === T_OPEN_PARENTHESIS) { - if (isset($this->tokens[$i]['parenthesis_owner']) === true) { - $owner = $this->tokens[$i]['parenthesis_owner']; - if (isset(Tokens::$scopeOpeners[$this->tokens[$owner]['code']]) === true - && isset($this->tokens[$i]['parenthesis_closer']) === true - ) { - // If we get into here, then we opened a parenthesis for - // a scope (eg. an if or else if) so we need to update the - // start of the line so that when we check to see - // if the closing parenthesis is more than n lines away from - // the statement, we check from the closing parenthesis. - $startLine = $this->tokens[$this->tokens[$i]['parenthesis_closer']]['line']; - } - } - } else if ($tokenType === T_OPEN_CURLY_BRACKET && $opener !== null) { - // We opened something that we don't have a scope opener for. - // Examples of this are curly brackets for string offsets etc. - // We want to ignore this so that we don't have an invalid scope - // map. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* ignoring curly brace *'.PHP_EOL; - } - - $ignore++; - } else if ($tokenType === T_CLOSE_CURLY_BRACKET && $ignore > 0) { - // We found the end token for the opener we were ignoring. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* finished ignoring curly brace *'.PHP_EOL; - } - - $ignore--; - } else if ($opener === null - && isset($this->scopeOpeners[$currType]) === true - ) { - // If we still haven't found the opener after 30 lines, - // we're not going to find it, unless we know it requires - // an opener (in which case we better keep looking) or the last - // token was empty (in which case we'll just confirm there is - // more code in this file and not just a big comment). - if ($this->tokens[$i]['line'] >= ($startLine + 30) - && isset(Tokens::$emptyTokens[$this->tokens[($i - 1)]['code']]) === false - ) { - if ($this->scopeOpeners[$currType]['strict'] === true) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - $lines = ($this->tokens[$i]['line'] - $startLine); - echo str_repeat("\t", $depth); - echo "=> Still looking for $stackPtr:$type scope opener after $lines lines".PHP_EOL; - } - } else { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Couldn't find scope opener for $stackPtr:$type, bailing".PHP_EOL; - } - - return $stackPtr; - } - } - } else if ($opener !== null - && $tokenType !== T_BREAK - && isset($this->endScopeTokens[$tokenType]) === true - ) { - if (isset($this->tokens[$i]['scope_condition']) === false) { - if ($ignore > 0) { - // We found the end token for the opener we were ignoring. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo '* finished ignoring curly brace *'.PHP_EOL; - } - - $ignore--; - } else { - // We found a token that closes the scope but it doesn't - // have a condition, so it belongs to another token and - // our token doesn't have a closer, so pretend this is - // the closer. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", $depth); - echo "=> Found (unexpected) scope closer for $stackPtr:$type".PHP_EOL; - } - - foreach ([$stackPtr, $opener] as $token) { - $this->tokens[$token]['scope_condition'] = $stackPtr; - $this->tokens[$token]['scope_opener'] = $opener; - $this->tokens[$token]['scope_closer'] = $i; - } - - return ($i - 1); - }//end if - }//end if - }//end if - }//end for - - return $stackPtr; - - }//end recurseScopeMap() - - - /** - * Constructs the level map. - * - * The level map adds a 'level' index to each token which indicates the - * depth that a token within a set of scope blocks. It also adds a - * 'conditions' index which is an array of the scope conditions that opened - * each of the scopes - position 0 being the first scope opener. - * - * @return void - */ - private function createLevelMap() - { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** START LEVEL MAP ***".PHP_EOL; - } - - $this->numTokens = count($this->tokens); - $level = 0; - $conditions = []; - $lastOpener = null; - $openers = []; - - for ($i = 0; $i < $this->numTokens; $i++) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$i]['type']; - $line = $this->tokens[$i]['line']; - $len = $this->tokens[$i]['length']; - $col = $this->tokens[$i]['column']; - - $content = Common::prepareForOutput($this->tokens[$i]['content']); - - echo str_repeat("\t", ($level + 1)); - echo "Process token $i on line $line [col:$col;len:$len;lvl:$level;"; - if (empty($conditions) !== true) { - $conditionString = 'conds;'; - foreach ($conditions as $condition) { - $conditionString .= Tokens::tokenName($condition).','; - } - - echo rtrim($conditionString, ',').';'; - } - - echo "]: $type => $content".PHP_EOL; - }//end if - - $this->tokens[$i]['level'] = $level; - $this->tokens[$i]['conditions'] = $conditions; - - if (isset($this->tokens[$i]['scope_condition']) === true) { - // Check to see if this token opened the scope. - if ($this->tokens[$i]['scope_opener'] === $i) { - $stackPtr = $this->tokens[$i]['scope_condition']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", ($level + 1)); - echo "=> Found scope opener for $stackPtr:$type".PHP_EOL; - } - - $stackPtr = $this->tokens[$i]['scope_condition']; - - // If we find a scope opener that has a shared closer, - // then we need to go back over the condition map that we - // just created and fix ourselves as we just added some - // conditions where there was none. This happens for T_CASE - // statements that are using the same break statement. - if ($lastOpener !== null && $this->tokens[$lastOpener]['scope_closer'] === $this->tokens[$i]['scope_closer']) { - // This opener shares its closer with the previous opener, - // but we still need to check if the two openers share their - // closer with each other directly (like CASE and DEFAULT) - // or if they are just sharing because one doesn't have a - // closer (like CASE with no BREAK using a SWITCHes closer). - $thisType = $this->tokens[$this->tokens[$i]['scope_condition']]['code']; - $opener = $this->tokens[$lastOpener]['scope_condition']; - - $isShared = isset($this->scopeOpeners[$thisType]['with'][$this->tokens[$opener]['code']]); - - reset($this->scopeOpeners[$thisType]['end']); - reset($this->scopeOpeners[$this->tokens[$opener]['code']]['end']); - $sameEnd = (current($this->scopeOpeners[$thisType]['end']) === current($this->scopeOpeners[$this->tokens[$opener]['code']]['end'])); - - if ($isShared === true && $sameEnd === true) { - $badToken = $opener; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$badToken]['type']; - echo str_repeat("\t", ($level + 1)); - echo "* shared closer, cleaning up $badToken:$type *".PHP_EOL; - } - - for ($x = $this->tokens[$i]['scope_condition']; $x <= $i; $x++) { - $oldConditions = $this->tokens[$x]['conditions']; - $oldLevel = $this->tokens[$x]['level']; - $this->tokens[$x]['level']--; - unset($this->tokens[$x]['conditions'][$badToken]); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - $oldConds = ''; - foreach ($oldConditions as $condition) { - $oldConds .= Tokens::tokenName($condition).','; - } - - $oldConds = rtrim($oldConds, ','); - - $newConds = ''; - foreach ($this->tokens[$x]['conditions'] as $condition) { - $newConds .= Tokens::tokenName($condition).','; - } - - $newConds = rtrim($newConds, ','); - - $newLevel = $this->tokens[$x]['level']; - echo str_repeat("\t", ($level + 1)); - echo "* cleaned $x:$type *".PHP_EOL; - echo str_repeat("\t", ($level + 2)); - echo "=> level changed from $oldLevel to $newLevel".PHP_EOL; - echo str_repeat("\t", ($level + 2)); - echo "=> conditions changed from $oldConds to $newConds".PHP_EOL; - }//end if - }//end for - - unset($conditions[$badToken]); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$badToken]['type']; - echo str_repeat("\t", ($level + 1)); - echo "* token $badToken:$type removed from conditions array *".PHP_EOL; - } - - unset($openers[$lastOpener]); - - $level--; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", ($level + 2)); - echo '* level decreased *'.PHP_EOL; - } - }//end if - }//end if - - $level++; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", ($level + 1)); - echo '* level increased *'.PHP_EOL; - } - - $conditions[$stackPtr] = $this->tokens[$stackPtr]['code']; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$stackPtr]['type']; - echo str_repeat("\t", ($level + 1)); - echo "* token $stackPtr:$type added to conditions array *".PHP_EOL; - } - - $lastOpener = $this->tokens[$i]['scope_opener']; - if ($lastOpener !== null) { - $openers[$lastOpener] = $lastOpener; - } - } else if ($lastOpener !== null && $this->tokens[$lastOpener]['scope_closer'] === $i) { - foreach (array_reverse($openers) as $opener) { - if ($this->tokens[$opener]['scope_closer'] === $i) { - $oldOpener = array_pop($openers); - if (empty($openers) === false) { - $lastOpener = array_pop($openers); - $openers[$lastOpener] = $lastOpener; - } else { - $lastOpener = null; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$oldOpener]['type']; - echo str_repeat("\t", ($level + 1)); - echo "=> Found scope closer for $oldOpener:$type".PHP_EOL; - } - - $oldCondition = array_pop($conditions); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", ($level + 1)); - echo '* token '.Tokens::tokenName($oldCondition).' removed from conditions array *'.PHP_EOL; - } - - // Make sure this closer actually belongs to us. - // Either the condition also has to think this is the - // closer, or it has to allow sharing with us. - $condition = $this->tokens[$this->tokens[$i]['scope_condition']]['code']; - if ($condition !== $oldCondition) { - if (isset($this->scopeOpeners[$oldCondition]['with'][$condition]) === false) { - $badToken = $this->tokens[$oldOpener]['scope_condition']; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = Tokens::tokenName($oldCondition); - echo str_repeat("\t", ($level + 1)); - echo "* scope closer was bad, cleaning up $badToken:$type *".PHP_EOL; - } - - for ($x = ($oldOpener + 1); $x <= $i; $x++) { - $oldConditions = $this->tokens[$x]['conditions']; - $oldLevel = $this->tokens[$x]['level']; - $this->tokens[$x]['level']--; - unset($this->tokens[$x]['conditions'][$badToken]); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $type = $this->tokens[$x]['type']; - $oldConds = ''; - foreach ($oldConditions as $condition) { - $oldConds .= Tokens::tokenName($condition).','; - } - - $oldConds = rtrim($oldConds, ','); - - $newConds = ''; - foreach ($this->tokens[$x]['conditions'] as $condition) { - $newConds .= Tokens::tokenName($condition).','; - } - - $newConds = rtrim($newConds, ','); - - $newLevel = $this->tokens[$x]['level']; - echo str_repeat("\t", ($level + 1)); - echo "* cleaned $x:$type *".PHP_EOL; - echo str_repeat("\t", ($level + 2)); - echo "=> level changed from $oldLevel to $newLevel".PHP_EOL; - echo str_repeat("\t", ($level + 2)); - echo "=> conditions changed from $oldConds to $newConds".PHP_EOL; - }//end if - }//end for - }//end if - }//end if - - $level--; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", ($level + 2)); - echo '* level decreased *'.PHP_EOL; - } - - $this->tokens[$i]['level'] = $level; - $this->tokens[$i]['conditions'] = $conditions; - }//end if - }//end foreach - }//end if - }//end if - }//end for - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t*** END LEVEL MAP ***".PHP_EOL; - } - - }//end createLevelMap() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Cache.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Cache.php deleted file mode 100644 index 408de96e..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Cache.php +++ /dev/null @@ -1,355 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -use FilesystemIterator; -use PHP_CodeSniffer\Autoload; -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Ruleset; -use RecursiveCallbackFilterIterator; -use RecursiveDirectoryIterator; -use RecursiveIteratorIterator; - -class Cache -{ - - /** - * The filesystem location of the cache file. - * - * @var string - */ - private static $path = ''; - - /** - * The cached data. - * - * @var array - */ - private static $cache = []; - - - /** - * Loads existing cache data for the run, if any. - * - * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run. - * @param \PHP_CodeSniffer\Config $config The config data for the run. - * - * @return void - */ - public static function load(Ruleset $ruleset, Config $config) - { - // Look at every loaded sniff class so far and use their file contents - // to generate a hash for the code used during the run. - // At this point, the loaded class list contains the core PHPCS code - // and all sniffs that have been loaded as part of the run. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo PHP_EOL."\tGenerating loaded file list for code hash".PHP_EOL; - } - - $codeHashFiles = []; - - $classes = array_keys(Autoload::getLoadedClasses()); - sort($classes); - - $installDir = dirname(__DIR__); - $installDirLen = strlen($installDir); - $standardDir = $installDir.DIRECTORY_SEPARATOR.'Standards'; - $standardDirLen = strlen($standardDir); - foreach ($classes as $file) { - if (substr($file, 0, $standardDirLen) !== $standardDir) { - if (substr($file, 0, $installDirLen) === $installDir) { - // We are only interested in sniffs here. - continue; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> external file: $file".PHP_EOL; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> internal sniff: $file".PHP_EOL; - } - - $codeHashFiles[] = $file; - } - - // Add the content of the used rulesets to the hash so that sniff setting - // changes in the ruleset invalidate the cache. - $rulesets = $ruleset->paths; - sort($rulesets); - foreach ($rulesets as $file) { - if (substr($file, 0, $standardDirLen) !== $standardDir) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> external ruleset: $file".PHP_EOL; - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> internal ruleset: $file".PHP_EOL; - } - - $codeHashFiles[] = $file; - } - - // Go through the core PHPCS code and add those files to the file - // hash. This ensures that core PHPCS changes will also invalidate the cache. - // Note that we ignore sniffs here, and any files that don't affect - // the outcome of the run. - $di = new RecursiveDirectoryIterator( - $installDir, - (FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS) - ); - $filter = new RecursiveCallbackFilterIterator( - $di, - function ($file, $key, $iterator) { - // Skip non-php files. - $filename = $file->getFilename(); - if ($file->isFile() === true && substr($filename, -4) !== '.php') { - return false; - } - - $filePath = Common::realpath($key); - if ($filePath === false) { - return false; - } - - if ($iterator->hasChildren() === true - && ($filename === 'Standards' - || $filename === 'Exceptions' - || $filename === 'Reports' - || $filename === 'Generators') - ) { - return false; - } - - return true; - } - ); - - $iterator = new RecursiveIteratorIterator($filter); - foreach ($iterator as $file) { - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> core file: $file".PHP_EOL; - } - - $codeHashFiles[] = $file->getPathname(); - } - - $codeHash = ''; - sort($codeHashFiles); - foreach ($codeHashFiles as $file) { - $codeHash .= md5_file($file); - } - - $codeHash = md5($codeHash); - - // Along with the code hash, use various settings that can affect - // the results of a run to create a new hash. This hash will be used - // in the cache file name. - $rulesetHash = md5(var_export($ruleset->ignorePatterns, true).var_export($ruleset->includePatterns, true)); - $phpExtensionsHash = md5(var_export(get_loaded_extensions(), true)); - $configData = [ - 'phpVersion' => PHP_VERSION_ID, - 'phpExtensions' => $phpExtensionsHash, - 'tabWidth' => $config->tabWidth, - 'encoding' => $config->encoding, - 'recordErrors' => $config->recordErrors, - 'annotations' => $config->annotations, - 'configData' => Config::getAllConfigData(), - 'codeHash' => $codeHash, - 'rulesetHash' => $rulesetHash, - ]; - - $configString = var_export($configData, true); - $cacheHash = substr(sha1($configString), 0, 12); - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\tGenerating cache key data".PHP_EOL; - foreach ($configData as $key => $value) { - if (is_array($value) === true) { - echo "\t\t=> $key:".PHP_EOL; - foreach ($value as $subKey => $subValue) { - echo "\t\t\t=> $subKey: $subValue".PHP_EOL; - } - - continue; - } - - if ($value === true || $value === false) { - $value = (int) $value; - } - - echo "\t\t=> $key: $value".PHP_EOL; - } - - echo "\t\t=> cacheHash: $cacheHash".PHP_EOL; - }//end if - - if ($config->cacheFile !== null) { - $cacheFile = $config->cacheFile; - } else { - // Determine the common paths for all files being checked. - // We can use this to locate an existing cache file, or to - // determine where to create a new one. - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\tChecking possible cache file paths".PHP_EOL; - } - - $paths = []; - foreach ($config->files as $file) { - $file = Common::realpath($file); - while ($file !== DIRECTORY_SEPARATOR) { - if (isset($paths[$file]) === false) { - $paths[$file] = 1; - } else { - $paths[$file]++; - } - - $lastFile = $file; - $file = dirname($file); - if ($file === $lastFile) { - // Just in case something went wrong, - // we don't want to end up in an infinite loop. - break; - } - } - } - - ksort($paths); - $paths = array_reverse($paths); - - $numFiles = count($config->files); - - $cacheFile = null; - $cacheDir = getenv('XDG_CACHE_HOME'); - if ($cacheDir === false || is_dir($cacheDir) === false) { - $cacheDir = sys_get_temp_dir(); - } - - foreach ($paths as $file => $count) { - if ($count !== $numFiles) { - unset($paths[$file]); - continue; - } - - $fileHash = substr(sha1($file), 0, 12); - $testFile = $cacheDir.DIRECTORY_SEPARATOR."phpcs.$fileHash.$cacheHash.cache"; - if ($cacheFile === null) { - // This will be our default location if we can't find - // an existing file. - $cacheFile = $testFile; - } - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t\t=> $testFile".PHP_EOL; - echo "\t\t\t * based on shared location: $file *".PHP_EOL; - } - - if (file_exists($testFile) === true) { - $cacheFile = $testFile; - break; - } - }//end foreach - - if ($cacheFile === null) { - // Unlikely, but just in case $paths is empty for some reason. - $cacheFile = $cacheDir.DIRECTORY_SEPARATOR."phpcs.$cacheHash.cache"; - } - }//end if - - self::$path = $cacheFile; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t=> Using cache file: ".self::$path.PHP_EOL; - } - - if (file_exists(self::$path) === true) { - self::$cache = json_decode(file_get_contents(self::$path), true); - - // Verify the contents of the cache file. - if (self::$cache['config'] !== $configData) { - self::$cache = []; - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* cache was invalid and has been cleared *".PHP_EOL; - } - } - } else if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo "\t* cache file does not exist *".PHP_EOL; - } - - self::$cache['config'] = $configData; - - }//end load() - - - /** - * Saves the current cache to the filesystem. - * - * @return void - */ - public static function save() - { - file_put_contents(self::$path, json_encode(self::$cache)); - - }//end save() - - - /** - * Retrieves a single entry from the cache. - * - * @param string $key The key of the data to get. If NULL, - * everything in the cache is returned. - * - * @return mixed - */ - public static function get($key=null) - { - if ($key === null) { - return self::$cache; - } - - if (isset(self::$cache[$key]) === true) { - return self::$cache[$key]; - } - - return false; - - }//end get() - - - /** - * Retrieves a single entry from the cache. - * - * @param string $key The key of the data to set. If NULL, - * sets the entire cache. - * @param mixed $value The value to set. - * - * @return void - */ - public static function set($key, $value) - { - if ($key === null) { - self::$cache = $value; - } else { - self::$cache[$key] = $value; - } - - }//end set() - - - /** - * Retrieves the number of cache entries. - * - * @return int - */ - public static function getSize() - { - return (count(self::$cache) - 1); - - }//end getSize() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Common.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Common.php deleted file mode 100644 index 63a76ce2..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Common.php +++ /dev/null @@ -1,586 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -use Phar; - -class Common -{ - - /** - * An array of variable types for param/var we will check. - * - * @var string[] - */ - public static $allowedTypes = [ - 'array', - 'boolean', - 'float', - 'integer', - 'mixed', - 'object', - 'string', - 'resource', - 'callable', - ]; - - - /** - * Return TRUE if the path is a PHAR file. - * - * @param string $path The path to use. - * - * @return bool - */ - public static function isPharFile($path) - { - if (strpos($path, 'phar://') === 0) { - return true; - } - - return false; - - }//end isPharFile() - - - /** - * Checks if a file is readable. - * - * Addresses PHP bug related to reading files from network drives on Windows. - * e.g. when using WSL2. - * - * @param string $path The path to the file. - * - * @return boolean - */ - public static function isReadable($path) - { - if (@is_readable($path) === true) { - return true; - } - - if (@file_exists($path) === true && @is_file($path) === true) { - $f = @fopen($path, 'rb'); - if (fclose($f) === true) { - return true; - } - } - - return false; - - }//end isReadable() - - - /** - * CodeSniffer alternative for realpath. - * - * Allows for PHAR support. - * - * @param string $path The path to use. - * - * @return string|false - */ - public static function realpath($path) - { - // Support the path replacement of ~ with the user's home directory. - if (substr($path, 0, 2) === '~/') { - $homeDir = getenv('HOME'); - if ($homeDir !== false) { - $path = $homeDir.substr($path, 1); - } - } - - // Check for process substitution. - if (strpos($path, '/dev/fd') === 0) { - return str_replace('/dev/fd', 'php://fd', $path); - } - - // No extra work needed if this is not a phar file. - if (self::isPharFile($path) === false) { - return realpath($path); - } - - // Before trying to break down the file path, - // check if it exists first because it will mostly not - // change after running the below code. - if (file_exists($path) === true) { - return $path; - } - - $phar = Phar::running(false); - $extra = str_replace('phar://'.$phar, '', $path); - $path = realpath($phar); - if ($path === false) { - return false; - } - - $path = 'phar://'.$path.$extra; - if (file_exists($path) === true) { - return $path; - } - - return false; - - }//end realpath() - - - /** - * Removes a base path from the front of a file path. - * - * @param string $path The path of the file. - * @param string $basepath The base path to remove. This should not end - * with a directory separator. - * - * @return string - */ - public static function stripBasepath($path, $basepath) - { - if (empty($basepath) === true) { - return $path; - } - - $basepathLen = strlen($basepath); - if (substr($path, 0, $basepathLen) === $basepath) { - $path = substr($path, $basepathLen); - } - - $path = ltrim($path, DIRECTORY_SEPARATOR); - if ($path === '') { - $path = '.'; - } - - return $path; - - }//end stripBasepath() - - - /** - * Detects the EOL character being used in a string. - * - * @param string $contents The contents to check. - * - * @return string - */ - public static function detectLineEndings($contents) - { - if (preg_match("/\r\n?|\n/", $contents, $matches) !== 1) { - // Assume there are no newlines. - $eolChar = "\n"; - } else { - $eolChar = $matches[0]; - } - - return $eolChar; - - }//end detectLineEndings() - - - /** - * Check if STDIN is a TTY. - * - * @return boolean - */ - public static function isStdinATTY() - { - // The check is slow (especially calling `tty`) so we static - // cache the result. - static $isTTY = null; - - if ($isTTY !== null) { - return $isTTY; - } - - if (defined('STDIN') === false) { - return false; - } - - // If PHP has the POSIX extensions we will use them. - if (function_exists('posix_isatty') === true) { - $isTTY = (posix_isatty(STDIN) === true); - return $isTTY; - } - - // Next try is detecting whether we have `tty` installed and use that. - if (defined('PHP_WINDOWS_VERSION_PLATFORM') === true) { - $devnull = 'NUL'; - $which = 'where'; - } else { - $devnull = '/dev/null'; - $which = 'which'; - } - - $tty = trim(shell_exec("$which tty 2> $devnull")); - if (empty($tty) === false) { - exec("tty -s 2> $devnull", $output, $returnValue); - $isTTY = ($returnValue === 0); - return $isTTY; - } - - // Finally we will use fstat. The solution borrowed from - // https://stackoverflow.com/questions/11327367/detect-if-a-php-script-is-being-run-interactively-or-not - // This doesn't work on Mingw/Cygwin/... using Mintty but they - // have `tty` installed. - $type = [ - 'S_IFMT' => 0170000, - 'S_IFIFO' => 0010000, - ]; - - $stat = fstat(STDIN); - $mode = ($stat['mode'] & $type['S_IFMT']); - $isTTY = ($mode !== $type['S_IFIFO']); - - return $isTTY; - - }//end isStdinATTY() - - - /** - * Escape a path to a system command. - * - * @param string $cmd The path to the system command. - * - * @return string - */ - public static function escapeshellcmd($cmd) - { - $cmd = escapeshellcmd($cmd); - - if (stripos(PHP_OS, 'WIN') === 0) { - // Spaces are not escaped by escapeshellcmd on Windows, but need to be - // for the command to be able to execute. - $cmd = preg_replace('`(? 0) { - return false; - } - - if ($strict === true) { - // Check that there are not two capital letters next to each other. - $length = strlen($string); - $lastCharWasCaps = $classFormat; - - for ($i = 1; $i < $length; $i++) { - $ascii = ord($string[$i]); - if ($ascii >= 48 && $ascii <= 57) { - // The character is a number, so it can't be a capital. - $isCaps = false; - } else { - if (strtoupper($string[$i]) === $string[$i]) { - $isCaps = true; - } else { - $isCaps = false; - } - } - - if ($isCaps === true && $lastCharWasCaps === true) { - return false; - } - - $lastCharWasCaps = $isCaps; - } - }//end if - - return true; - - }//end isCamelCaps() - - - /** - * Returns true if the specified string is in the underscore caps format. - * - * @param string $string The string to verify. - * - * @return boolean - */ - public static function isUnderscoreName($string) - { - // If there are space in the name, it can't be valid. - if (strpos($string, ' ') !== false) { - return false; - } - - $validName = true; - $nameBits = explode('_', $string); - - if (preg_match('|^[A-Z]|', $string) === 0) { - // Name does not begin with a capital letter. - $validName = false; - } else { - foreach ($nameBits as $bit) { - if ($bit === '') { - continue; - } - - if ($bit[0] !== strtoupper($bit[0])) { - $validName = false; - break; - } - } - } - - return $validName; - - }//end isUnderscoreName() - - - /** - * Returns a valid variable type for param/var tags. - * - * If type is not one of the standard types, it must be a custom type. - * Returns the correct type name suggestion if type name is invalid. - * - * @param string $varType The variable type to process. - * - * @return string - */ - public static function suggestType($varType) - { - if ($varType === '') { - return ''; - } - - if (in_array($varType, self::$allowedTypes, true) === true) { - return $varType; - } else { - $lowerVarType = strtolower($varType); - switch ($lowerVarType) { - case 'bool': - case 'boolean': - return 'boolean'; - case 'double': - case 'real': - case 'float': - return 'float'; - case 'int': - case 'integer': - return 'integer'; - case 'array()': - case 'array': - return 'array'; - }//end switch - - if (strpos($lowerVarType, 'array(') !== false) { - // Valid array declaration: - // array, array(type), array(type1 => type2). - $matches = []; - $pattern = '/^array\(\s*([^\s^=^>]*)(\s*=>\s*(.*))?\s*\)/i'; - if (preg_match($pattern, $varType, $matches) !== 0) { - $type1 = ''; - if (isset($matches[1]) === true) { - $type1 = $matches[1]; - } - - $type2 = ''; - if (isset($matches[3]) === true) { - $type2 = $matches[3]; - } - - $type1 = self::suggestType($type1); - $type2 = self::suggestType($type2); - if ($type2 !== '') { - $type2 = ' => '.$type2; - } - - return "array($type1$type2)"; - } else { - return 'array'; - }//end if - } else if (in_array($lowerVarType, self::$allowedTypes, true) === true) { - // A valid type, but not lower cased. - return $lowerVarType; - } else { - // Must be a custom type name. - return $varType; - }//end if - }//end if - - }//end suggestType() - - - /** - * Given a sniff class name, returns the code for the sniff. - * - * @param string $sniffClass The fully qualified sniff class name. - * - * @return string - */ - public static function getSniffCode($sniffClass) - { - $parts = explode('\\', $sniffClass); - $sniff = array_pop($parts); - - if (substr($sniff, -5) === 'Sniff') { - // Sniff class name. - $sniff = substr($sniff, 0, -5); - } else { - // Unit test class name. - $sniff = substr($sniff, 0, -8); - } - - $category = array_pop($parts); - $sniffDir = array_pop($parts); - $standard = array_pop($parts); - $code = $standard.'.'.$category.'.'.$sniff; - return $code; - - }//end getSniffCode() - - - /** - * Removes project-specific information from a sniff class name. - * - * @param string $sniffClass The fully qualified sniff class name. - * - * @return string - */ - public static function cleanSniffClass($sniffClass) - { - $newName = strtolower($sniffClass); - - $sniffPos = strrpos($newName, '\sniffs\\'); - if ($sniffPos === false) { - // Nothing we can do as it isn't in a known format. - return $newName; - } - - $end = (strlen($newName) - $sniffPos + 1); - $start = strrpos($newName, '\\', ($end * -1)); - - if ($start === false) { - // Nothing needs to be cleaned. - return $newName; - } - - $newName = substr($newName, ($start + 1)); - return $newName; - - }//end cleanSniffClass() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Help.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Help.php deleted file mode 100644 index a7602b7d..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Help.php +++ /dev/null @@ -1,626 +0,0 @@ - - * @copyright 2024 Juliette Reinders Folmer. All rights reserved. - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -use InvalidArgumentException; -use PHP_CodeSniffer\Config; -use PHP_CodeSniffer\Util\Common; - -final class Help -{ - - - /** - * Short options which are available for both the `phpcs` as well as the `phpcbf` command. - * - * @var string - */ - const DEFAULT_SHORT_OPTIONS = '-hilnpqvw'; - - /** - * Long options which are available for both the `phpcs` as well as the `phpcbf` command. - * - * {@internal This should be a constant array, but those aren't supported until PHP 5.6.} - * - * @var string Comma-separated list of the option names. - */ - const DEFAULT_LONG_OPTIONS = 'basepath,bootstrap,colors,encoding,error-severity,exclude,extensions,file,file-list,filter,ignore,ignore-annotations,no-colors,parallel,php-ini,report-width,runtime-set,severity,sniffs,standard,stdin-path,tab-width,version,vv,vvv,warning-severity'; - - /** - * Minimum screen width. - * - * The help info needs room to display, so this is the minimum acceptable width. - * - * @var integer - */ - const MIN_WIDTH = 60; - - /** - * Indent option lines. - * - * @var string - */ - const INDENT = ' '; - - /** - * Gutter spacing for between the option argument info and the option description. - * - * @var string - */ - const GUTTER = ' '; - - /** - * The current PHPCS Configuration. - * - * @var \PHP_CodeSniffer\Config - */ - private $config; - - /** - * The options which should be shown for this help screen. - * - * @var array - */ - private $requestedOptions = []; - - /** - * Active options per category (after filtering). - * - * @var array>> - */ - private $activeOptions = []; - - /** - * Width of the indent for option lines. - * - * @var integer - */ - private $indentWidth = 0; - - /** - * Width of the gutter spacing. - * - * @var integer - */ - private $gutterWidth = 0; - - /** - * Width of longest option argument info entry. - * - * @var integer - */ - private $maxOptionNameLength = 0; - - - /** - * Constructor. - * - * @param \PHP_CodeSniffer\Config $config Configuration object. - * @param array $longOptions The long options which should be shown. - * @param string $shortOptions The short options which should be shown. - * - * @throws \InvalidArgumentException When $shortOptions is not a string. - */ - public function __construct(Config $config, array $longOptions, $shortOptions='') - { - if (is_string($shortOptions) === false) { - throw new InvalidArgumentException('The $shortOptions parameter must be a string'); - } - - $this->config = $config; - $this->requestedOptions = array_merge($longOptions, str_split($shortOptions)); - - $this->filterOptions(); - - $this->indentWidth = strlen(self::INDENT); - $this->gutterWidth = strlen(self::GUTTER); - - $this->setMaxOptionNameLength(); - - }//end __construct() - - - /** - * Display the help info. - * - * @return void - */ - public function display() - { - $this->printUsage(); - $this->printCategories(); - - }//end display() - - - /** - * Filter the available options based on the requested options. - * - * @return void - */ - private function filterOptions() - { - $filteredOptions = $this->getAllOptions(); - - foreach ($filteredOptions as $category => $options) { - // Initial state set to "true" to prevent a spacer at the start of an array. - $lastWasSpacer = true; - $spacerCount = 0; - - foreach ($options as $name => $option) { - if ($lastWasSpacer !== true && strpos($name, 'blank-line') === 0) { - ++$spacerCount; - $lastWasSpacer = true; - continue; - } - - if (in_array($name, $this->requestedOptions, true) === false) { - unset($filteredOptions[$category][$name]); - continue; - } - - $lastWasSpacer = false; - } - - // Make sure the final array doesn't contain a spacer at the end. - if (empty($filteredOptions[$category]) === false) { - end($filteredOptions[$category]); - $key = key($filteredOptions[$category]); - if (strpos($key, 'blank-line') === 0) { - unset($filteredOptions[$category][$key]); - --$spacerCount; - } - } - - // Remove categories now left empty. - if (empty($filteredOptions[$category]) === true || count($filteredOptions[$category]) === $spacerCount) { - unset($filteredOptions[$category]); - } - }//end foreach - - $this->activeOptions = $filteredOptions; - - }//end filterOptions() - - - /** - * Determine the length of the longest option argument and store it. - * - * @return void - */ - private function setMaxOptionNameLength() - { - $lengths = []; - foreach ($this->activeOptions as $category => $options) { - foreach ($options as $option) { - if (isset($option['argument']) === false) { - continue; - } - - $lengths[] = strlen($option['argument']); - } - } - - if (empty($lengths) === false) { - $this->maxOptionNameLength = max($lengths); - } - - }//end setMaxOptionNameLength() - - - /** - * Get the maximum width which can be used to display the help info. - * - * Independently of user preference/auto-determined width of the current screen, - * a minimum width is needed to display information, so don't allow this to get too low. - * - * @return int - */ - private function getMaxWidth() - { - return max(self::MIN_WIDTH, $this->config->reportWidth); - - }//end getMaxWidth() - - - /** - * Get the maximum width for the text in the option description column. - * - * @return int - */ - private function getDescriptionColumnWidth() - { - return ($this->getMaxWidth() - $this->maxOptionNameLength - $this->indentWidth - $this->gutterWidth); - - }//end getDescriptionColumnWidth() - - - /** - * Get the length of the indentation needed for follow up lines when the description does not fit on one line. - * - * @return int - */ - private function getDescriptionFollowupLineIndentLength() - { - return ($this->maxOptionNameLength + $this->indentWidth + $this->gutterWidth); - - }//end getDescriptionFollowupLineIndentLength() - - - /** - * Print basic usage information to the screen. - * - * @return void - */ - private function printUsage() - { - $command = 'phpcs'; - if (defined('PHP_CODESNIFFER_CBF') === true && PHP_CODESNIFFER_CBF === true) { - // @codeCoverageIgnore - $command = 'phpcbf'; - } - - $this->printCategoryHeader('Usage'); - - echo self::INDENT.$command.' [options] '.PHP_EOL; - - }//end printUsage() - - - /** - * Print details of all the requested options to the screen, sorted by category. - * - * @return void - */ - private function printCategories() - { - foreach ($this->activeOptions as $category => $options) { - $this->printCategoryHeader($category); - $this->printCategoryOptions($options); - } - - }//end printCategories() - - - /** - * Print a category header. - * - * @param string $header The header text. - * - * @return void - */ - private function printCategoryHeader($header) - { - $header .= ':'; - if ($this->config->colors === true) { - $header = "\033[33m{$header}\033[0m"; - } - - echo PHP_EOL.$header.PHP_EOL; - - }//end printCategoryHeader() - - - /** - * Print the options for a category. - * - * @param array> $options The options to display. - * - * @return void - */ - private function printCategoryOptions(array $options) - { - $maxDescriptionWidth = $this->getDescriptionColumnWidth(); - $maxTextWidth = ($this->getMaxWidth() - $this->indentWidth); - $secondLineIndent = str_repeat(' ', $this->getDescriptionFollowupLineIndentLength()); - - $output = ''; - foreach ($options as $option) { - if (isset($option['spacer']) === true) { - $output .= PHP_EOL; - } - - if (isset($option['text']) === true) { - $text = wordwrap($option['text'], $maxTextWidth, "\n"); - $output .= self::INDENT.implode(PHP_EOL.self::INDENT, explode("\n", $text)).PHP_EOL; - } - - if (isset($option['argument'], $option['description']) === true) { - $argument = str_pad($option['argument'], $this->maxOptionNameLength); - $argument = $this->colorizeVariableInput($argument); - $output .= self::INDENT."\033[32m{$argument}\033[0m"; - $output .= self::GUTTER; - - $description = wordwrap($option['description'], $maxDescriptionWidth, "\n"); - $output .= implode(PHP_EOL.$secondLineIndent, explode("\n", $description)).PHP_EOL; - } - } - - if ($this->config->colors === false) { - $output = Common::stripColors($output); - } - - echo $output; - - }//end printCategoryOptions() - - - /** - * Colorize "variable" input in the option argument info. - * - * For the purposes of this method, "variable" input is text between <> brackets. - * The regex allows for multiple tags and nested tags. - * - * @param string $text The text to process. - * - * @return string - */ - private function colorizeVariableInput($text) - { - return preg_replace('`(<(?:(?>[^<>]+)|(?R))*>)`', "\033[36m".'$1'."\033[32m", $text); - - }//end colorizeVariableInput() - - - /** - * Retrieve the help details for all supported CLI arguments per category. - * - * @return array>> - */ - private function getAllOptions() - { - $options = []; - - // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Readability is more important. - $options['Scan targets'] = [ - 'file' => [ - 'argument' => '', - 'description' => 'One or more files and/or directories to check, space separated.', - ], - '-' => [ - 'argument' => '-', - 'description' => 'Check STDIN instead of local files and directories.', - ], - 'stdin-path' => [ - 'argument' => '--stdin-path=', - 'description' => 'If processing STDIN, the file path that STDIN will be processed as.', - ], - 'file-list' => [ - 'argument' => '--file-list=', - 'description' => 'Check the files and/or directories which are defined in the file to which the path is provided (one per line).', - ], - 'filter' => [ - 'argument' => '--filter=', - 'description' => 'Check based on a predefined file filter. Use either the "GitModified" or "GitStaged" filter, or specify the path to a custom filter class.', - ], - 'ignore' => [ - 'argument' => '--ignore=', - 'description' => 'Ignore files based on a comma-separated list of patterns matching files and/or directories.', - ], - 'extensions' => [ - 'argument' => '--extensions=', - 'description' => 'Check files with the specified file extensions (comma-separated list). Defaults to php,inc/php,js,css.'."\n" - .'The type of the file can be specified using: ext/type; e.g. module/php,es/js.', - ], - 'l' => [ - 'argument' => '-l', - 'description' => 'Check local directory only, no recursion.', - ], - ]; - - $options['Rule Selection Options'] = [ - 'standard' => [ - 'argument' => '--standard=', - 'description' => 'The name of, or the path to, the coding standard to use. Can be a comma-separated list specifying multiple standards. If no standard is specified, PHP_CodeSniffer will look for a [.]phpcs.xml[.dist] custom ruleset file in the current directory and those above it.', - ], - 'sniffs' => [ - 'argument' => '--sniffs=', - 'description' => 'A comma-separated list of sniff codes to limit the scan to. All sniffs must be part of the standard in use.', - ], - 'exclude' => [ - 'argument' => '--exclude=', - 'description' => 'A comma-separated list of sniff codes to exclude from the scan. All sniffs must be part of the standard in use.', - ], - 'blank-line' => ['spacer' => ''], - - 'i' => [ - 'argument' => '-i', - 'description' => 'Show a list of installed coding standards.', - ], - 'e' => [ - 'argument' => '-e', - 'description' => 'Explain a standard by showing the names of all the sniffs it includes.', - ], - 'generator' => [ - 'argument' => '--generator=', - 'description' => 'Show documentation for a standard. Use either the "HTML", "Markdown" or "Text" generator.', - ], - ]; - - $options['Run Options'] = [ - 'a' => [ - 'argument' => '-a', - 'description' => 'Run in interactive mode, pausing after each file.', - ], - 'bootstrap' => [ - 'argument' => '--bootstrap=', - 'description' => 'Run the specified file(s) before processing begins. A list of files can be provided, separated by commas.', - ], - 'cache' => [ - 'argument' => '--cache[=]', - 'description' => 'Cache results between runs. Optionally, can be provided to use a specific file for caching. Otherwise, a temporary file is used.', - ], - 'no-cache' => [ - 'argument' => '--no-cache', - 'description' => 'Do not cache results between runs (default).', - ], - 'parallel' => [ - 'argument' => '--parallel=', - 'description' => 'The number of files to be checked simultaneously. Defaults to 1 (no parallel processing).'."\n" - .'If enabled, this option only takes effect if the PHP PCNTL (Process Control) extension is available.', - ], - 'suffix' => [ - 'argument' => '--suffix=', - 'description' => 'Write modified files to a filename using this suffix ("diff" and "patch" are not used in this mode).', - ], - 'blank-line' => ['spacer' => ''], - - 'php-ini' => [ - 'argument' => '-d ', - 'description' => 'Set the [key] php.ini value to [value] or set to [true] if value is omitted.'."\n" - .'Note: only php.ini settings which can be changed at runtime are supported.', - ], - ]; - - $options['Reporting Options'] = [ - 'report' => [ - 'argument' => '--report=', - 'description' => 'Print either the "full", "xml", "checkstyle", "csv", "json", "junit", "emacs", "source", "summary", "diff", "svnblame", "gitblame", "hgblame", "notifysend" or "performance" report or specify the path to a custom report class. By default, the "full" report is displayed.', - ], - 'report-file' => [ - 'argument' => '--report-file=', - 'description' => 'Write the report to the specified file path.', - ], - 'report-report' => [ - 'argument' => '--report-=', - 'description' => 'Write the report specified in to the specified file path.', - ], - 'report-width' => [ - 'argument' => '--report-width=', - 'description' => 'How many columns wide screen reports should be. Set to "auto" to use current screen width, where supported.', - ], - 'basepath' => [ - 'argument' => '--basepath=', - 'description' => 'Strip a path from the front of file paths inside reports.', - ], - 'blank-line-1' => ['spacer' => ''], - - 'w' => [ - 'argument' => '-w', - 'description' => 'Include both warnings and errors (default).', - ], - 'n' => [ - 'argument' => '-n', - 'description' => 'Do not include warnings. Shortcut for "--warning-severity=0".', - ], - 'severity' => [ - 'argument' => '--severity=', - 'description' => 'The minimum severity required to display an error or warning. Defaults to 5.', - ], - 'error-severity' => [ - 'argument' => '--error-severity=', - 'description' => 'The minimum severity required to display an error. Defaults to 5.', - ], - 'warning-severity' => [ - 'argument' => '--warning-severity=', - 'description' => 'The minimum severity required to display a warning. Defaults to 5.', - ], - 'blank-line-2' => ['spacer' => ''], - - 's' => [ - 'argument' => '-s', - 'description' => 'Show sniff error codes in all reports.', - ], - 'ignore-annotations' => [ - 'argument' => '--ignore-annotations', - 'description' => 'Ignore all "phpcs:..." annotations in code comments.', - ], - 'colors' => [ - 'argument' => '--colors', - 'description' => 'Use colors in screen output.', - ], - 'no-colors' => [ - 'argument' => '--no-colors', - 'description' => 'Do not use colors in screen output (default).', - ], - 'p' => [ - 'argument' => '-p', - 'description' => 'Show progress of the run.', - ], - 'q' => [ - 'argument' => '-q', - 'description' => 'Quiet mode; disables progress and verbose output.', - ], - 'm' => [ - 'argument' => '-m', - 'description' => 'Stop error messages from being recorded. This saves a lot of memory but stops many reports from being used.', - ], - ]; - - $options['Configuration Options'] = [ - 'encoding' => [ - 'argument' => '--encoding=', - 'description' => 'The encoding of the files being checked. Defaults to "utf-8".', - ], - 'tab-width' => [ - 'argument' => '--tab-width=', - 'description' => 'The number of spaces each tab represents.', - ], - 'blank-line' => ['spacer' => ''], - - 'config-explain' => [ - 'text' => 'Default values for a selection of options can be stored in a user-specific CodeSniffer.conf configuration file.'."\n" - .'This applies to the following options: "default_standard", "report_format", "tab_width", "encoding", "severity", "error_severity", "warning_severity", "show_warnings", "report_width", "show_progress", "quiet", "colors", "cache", "parallel".', - ], - 'config-show' => [ - 'argument' => '--config-show', - 'description' => 'Show the configuration options which are currently stored in the applicable CodeSniffer.conf file.', - ], - 'config-set' => [ - 'argument' => '--config-set ', - 'description' => 'Save a configuration option to the CodeSniffer.conf file.', - ], - 'config-delete' => [ - 'argument' => '--config-delete ', - 'description' => 'Delete a configuration option from the CodeSniffer.conf file.', - ], - 'runtime-set' => [ - 'argument' => '--runtime-set ', - 'description' => 'Set a configuration option to be applied to the current scan run only.', - ], - ]; - - $options['Miscellaneous Options'] = [ - 'h' => [ - 'argument' => '-h, -?, --help', - 'description' => 'Print this help message.', - ], - 'version' => [ - 'argument' => '--version', - 'description' => 'Print version information.', - ], - 'v' => [ - 'argument' => '-v', - 'description' => 'Verbose output: Print processed files.', - ], - 'vv' => [ - 'argument' => '-vv', - 'description' => 'Verbose output: Print ruleset and token output.', - ], - 'vvv' => [ - 'argument' => '-vvv', - 'description' => 'Verbose output: Print sniff processing information.', - ], - ]; - // phpcs:enable - - return $options; - - }//end getAllOptions() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Standards.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Standards.php deleted file mode 100644 index f7217a72..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Standards.php +++ /dev/null @@ -1,340 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -use DirectoryIterator; -use PHP_CodeSniffer\Config; - -class Standards -{ - - - /** - * Get a list of paths where standards are installed. - * - * Unresolvable relative paths will be excluded from the results. - * - * @return array - */ - public static function getInstalledStandardPaths() - { - $ds = DIRECTORY_SEPARATOR; - - $installedPaths = [dirname(dirname(__DIR__)).$ds.'src'.$ds.'Standards']; - $configPaths = Config::getConfigData('installed_paths'); - if ($configPaths !== null) { - $installedPaths = array_merge($installedPaths, explode(',', $configPaths)); - } - - $resolvedInstalledPaths = []; - foreach ($installedPaths as $installedPath) { - if (substr($installedPath, 0, 1) === '.') { - $installedPath = Common::realPath(__DIR__.$ds.'..'.$ds.'..'.$ds.$installedPath); - if ($installedPath === false) { - continue; - } - } - - $resolvedInstalledPaths[] = $installedPath; - } - - return $resolvedInstalledPaths; - - }//end getInstalledStandardPaths() - - - /** - * Get the details of all coding standards installed. - * - * Coding standards are directories located in the - * CodeSniffer/Standards directory. Valid coding standards - * include a Sniffs subdirectory. - * - * The details returned for each standard are: - * - path: the path to the coding standard's main directory - * - name: the name of the coding standard, as sourced from the ruleset.xml file - * - namespace: the namespace used by the coding standard, as sourced from the ruleset.xml file - * - * If you only need the paths to the installed standards, - * use getInstalledStandardPaths() instead as it performs less work to - * retrieve coding standard names. - * - * @param boolean $includeGeneric If true, the special "Generic" - * coding standard will be included - * if installed. - * @param string $standardsDir A specific directory to look for standards - * in. If not specified, PHP_CodeSniffer will - * look in its default locations. - * - * @return array - * @see getInstalledStandardPaths() - */ - public static function getInstalledStandardDetails( - $includeGeneric=false, - $standardsDir='' - ) { - $rulesets = []; - - if ($standardsDir === '') { - $installedPaths = self::getInstalledStandardPaths(); - } else { - $installedPaths = [$standardsDir]; - } - - foreach ($installedPaths as $standardsDir) { - // Check if the installed dir is actually a standard itself. - $csFile = $standardsDir.'/ruleset.xml'; - if (is_file($csFile) === true) { - $rulesets[] = $csFile; - continue; - } - - if (is_dir($standardsDir) === false) { - continue; - } - - $di = new DirectoryIterator($standardsDir); - foreach ($di as $file) { - if ($file->isDir() === true && $file->isDot() === false) { - $filename = $file->getFilename(); - - // Ignore the special "Generic" standard. - if ($includeGeneric === false && $filename === 'Generic') { - continue; - } - - // Valid coding standard dirs include a ruleset. - $csFile = $file->getPathname().'/ruleset.xml'; - if (is_file($csFile) === true) { - $rulesets[] = $csFile; - } - } - } - }//end foreach - - $installedStandards = []; - - foreach ($rulesets as $rulesetPath) { - $ruleset = @simplexml_load_string(file_get_contents($rulesetPath)); - if ($ruleset === false) { - continue; - } - - $standardName = (string) $ruleset['name']; - $dirname = basename(dirname($rulesetPath)); - - if (isset($ruleset['namespace']) === true) { - $namespace = (string) $ruleset['namespace']; - } else { - $namespace = $dirname; - } - - $installedStandards[$dirname] = [ - 'path' => dirname($rulesetPath), - 'name' => $standardName, - 'namespace' => $namespace, - ]; - }//end foreach - - return $installedStandards; - - }//end getInstalledStandardDetails() - - - /** - * Get a list of all coding standards installed. - * - * Coding standards are directories located in the - * CodeSniffer/Standards directory. Valid coding standards - * include a Sniffs subdirectory. - * - * @param boolean $includeGeneric If true, the special "Generic" - * coding standard will be included - * if installed. - * @param string $standardsDir A specific directory to look for standards - * in. If not specified, PHP_CodeSniffer will - * look in its default locations. - * - * @return array - * @see isInstalledStandard() - */ - public static function getInstalledStandards( - $includeGeneric=false, - $standardsDir='' - ) { - $installedStandards = []; - - if ($standardsDir === '') { - $installedPaths = self::getInstalledStandardPaths(); - } else { - $installedPaths = [$standardsDir]; - } - - foreach ($installedPaths as $standardsDir) { - // Check if the installed dir is actually a standard itself. - $csFile = $standardsDir.'/ruleset.xml'; - if (is_file($csFile) === true) { - $basename = basename($standardsDir); - $installedStandards[$basename] = $basename; - continue; - } - - if (is_dir($standardsDir) === false) { - // Doesn't exist. - continue; - } - - $di = new DirectoryIterator($standardsDir); - $standardsInDir = []; - foreach ($di as $file) { - if ($file->isDir() === true && $file->isDot() === false) { - $filename = $file->getFilename(); - - // Ignore the special "Generic" standard. - if ($includeGeneric === false && $filename === 'Generic') { - continue; - } - - // Valid coding standard dirs include a ruleset. - $csFile = $file->getPathname().'/ruleset.xml'; - if (is_file($csFile) === true) { - $standardsInDir[$filename] = $filename; - } - } - } - - natsort($standardsInDir); - $installedStandards += $standardsInDir; - }//end foreach - - return $installedStandards; - - }//end getInstalledStandards() - - - /** - * Determine if a standard is installed. - * - * Coding standards are directories located in the - * CodeSniffer/Standards directory. Valid coding standards - * include a ruleset.xml file. - * - * @param string $standard The name of the coding standard. - * - * @return boolean - * @see getInstalledStandards() - */ - public static function isInstalledStandard($standard) - { - $path = self::getInstalledStandardPath($standard); - if ($path !== null && strpos($path, 'ruleset.xml') !== false) { - return true; - } else { - // This could be a custom standard, installed outside our - // standards directory. - $standard = Common::realPath($standard); - if ($standard === false) { - return false; - } - - // Might be an actual ruleset file itUtil. - // If it has an XML extension, let's at least try it. - if (is_file($standard) === true - && (substr(strtolower($standard), -4) === '.xml' - || substr(strtolower($standard), -9) === '.xml.dist') - ) { - return true; - } - - // If it is a directory with a ruleset.xml file in it, - // it is a standard. - $ruleset = rtrim($standard, ' /\\').DIRECTORY_SEPARATOR.'ruleset.xml'; - if (is_file($ruleset) === true) { - return true; - } - }//end if - - return false; - - }//end isInstalledStandard() - - - /** - * Return the path of an installed coding standard. - * - * Coding standards are directories located in the - * CodeSniffer/Standards directory. Valid coding standards - * include a ruleset.xml file. - * - * @param string $standard The name of the coding standard. - * - * @return string|null - */ - public static function getInstalledStandardPath($standard) - { - if (strpos($standard, '.') !== false) { - return null; - } - - $installedPaths = self::getInstalledStandardPaths(); - foreach ($installedPaths as $installedPath) { - $standardPath = $installedPath.DIRECTORY_SEPARATOR.$standard; - if (file_exists($standardPath) === false) { - if (basename($installedPath) !== $standard) { - continue; - } - - $standardPath = $installedPath; - } - - $path = Common::realpath($standardPath.DIRECTORY_SEPARATOR.'ruleset.xml'); - - if ($path !== false && is_file($path) === true) { - return $path; - } else if (Common::isPharFile($standardPath) === true) { - $path = Common::realpath($standardPath); - if ($path !== false) { - return $path; - } - } - }//end foreach - - return null; - - }//end getInstalledStandardPath() - - - /** - * Prints out a list of installed coding standards. - * - * @return void - */ - public static function printInstalledStandards() - { - $installedStandards = self::getInstalledStandards(); - $numStandards = count($installedStandards); - - if ($numStandards === 0) { - echo 'No coding standards are installed.'.PHP_EOL; - } else { - $lastStandard = array_pop($installedStandards); - if ($numStandards === 1) { - echo "The only coding standard installed is $lastStandard".PHP_EOL; - } else { - $standardList = implode(', ', $installedStandards); - $standardList .= ' and '.$lastStandard; - echo 'The installed coding standards are '.$standardList.PHP_EOL; - } - } - - }//end printInstalledStandards() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Timing.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Timing.php deleted file mode 100644 index 57470c77..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Timing.php +++ /dev/null @@ -1,119 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -class Timing -{ - - /** - * The start time of the run. - * - * @var float - */ - private static $startTime; - - /** - * Used to make sure we only print the run time once per run. - * - * @var boolean - */ - private static $printed = false; - - - /** - * Start recording time for the run. - * - * @return void - */ - public static function startTiming() - { - - self::$startTime = microtime(true); - - }//end startTiming() - - - /** - * Get the duration of the run up to "now". - * - * @return float 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 float $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. - * - * @param boolean $force If TRUE, prints the output even if it has - * already been printed during the run. - * - * @return void - */ - public static function printRunTime($force=false) - { - if ($force === false && self::$printed === true) { - // A double call. - return; - } - - if (self::$startTime === null) { - // Timing was never started. - return; - } - - $duration = self::getDuration(); - $duration = self::getHumanReadableDuration($duration); - - $mem = round((memory_get_peak_usage(true) / (1024 * 1024)), 2).'MB'; - echo "Time: $duration; Memory: $mem".PHP_EOL.PHP_EOL; - - self::$printed = true; - - }//end printRunTime() - - -}//end class diff --git a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php b/trunk/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php deleted file mode 100644 index 5ec913df..00000000 --- a/trunk/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php +++ /dev/null @@ -1,812 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Util; - -define('T_NONE', 'PHPCS_T_NONE'); -define('T_OPEN_CURLY_BRACKET', 'PHPCS_T_OPEN_CURLY_BRACKET'); -define('T_CLOSE_CURLY_BRACKET', 'PHPCS_T_CLOSE_CURLY_BRACKET'); -define('T_OPEN_SQUARE_BRACKET', 'PHPCS_T_OPEN_SQUARE_BRACKET'); -define('T_CLOSE_SQUARE_BRACKET', 'PHPCS_T_CLOSE_SQUARE_BRACKET'); -define('T_OPEN_PARENTHESIS', 'PHPCS_T_OPEN_PARENTHESIS'); -define('T_CLOSE_PARENTHESIS', 'PHPCS_T_CLOSE_PARENTHESIS'); -define('T_COLON', 'PHPCS_T_COLON'); -define('T_NULLABLE', 'PHPCS_T_NULLABLE'); -define('T_STRING_CONCAT', 'PHPCS_T_STRING_CONCAT'); -define('T_INLINE_THEN', 'PHPCS_T_INLINE_THEN'); -define('T_INLINE_ELSE', 'PHPCS_T_INLINE_ELSE'); -define('T_NULL', 'PHPCS_T_NULL'); -define('T_FALSE', 'PHPCS_T_FALSE'); -define('T_TRUE', 'PHPCS_T_TRUE'); -define('T_SEMICOLON', 'PHPCS_T_SEMICOLON'); -define('T_EQUAL', 'PHPCS_T_EQUAL'); -define('T_MULTIPLY', 'PHPCS_T_MULTIPLY'); -define('T_DIVIDE', 'PHPCS_T_DIVIDE'); -define('T_PLUS', 'PHPCS_T_PLUS'); -define('T_MINUS', 'PHPCS_T_MINUS'); -define('T_MODULUS', 'PHPCS_T_MODULUS'); -define('T_BITWISE_AND', 'PHPCS_T_BITWISE_AND'); -define('T_BITWISE_OR', 'PHPCS_T_BITWISE_OR'); -define('T_BITWISE_XOR', 'PHPCS_T_BITWISE_XOR'); -define('T_BITWISE_NOT', 'PHPCS_T_BITWISE_NOT'); -define('T_ARRAY_HINT', 'PHPCS_T_ARRAY_HINT'); -define('T_GREATER_THAN', 'PHPCS_T_GREATER_THAN'); -define('T_LESS_THAN', 'PHPCS_T_LESS_THAN'); -define('T_BOOLEAN_NOT', 'PHPCS_T_BOOLEAN_NOT'); -define('T_SELF', 'PHPCS_T_SELF'); -define('T_PARENT', 'PHPCS_T_PARENT'); -define('T_DOUBLE_QUOTED_STRING', 'PHPCS_T_DOUBLE_QUOTED_STRING'); -define('T_COMMA', 'PHPCS_T_COMMA'); -define('T_HEREDOC', 'PHPCS_T_HEREDOC'); -define('T_PROTOTYPE', 'PHPCS_T_PROTOTYPE'); -define('T_THIS', 'PHPCS_T_THIS'); -define('T_REGULAR_EXPRESSION', 'PHPCS_T_REGULAR_EXPRESSION'); -define('T_PROPERTY', 'PHPCS_T_PROPERTY'); -define('T_LABEL', 'PHPCS_T_LABEL'); -define('T_OBJECT', 'PHPCS_T_OBJECT'); -define('T_CLOSE_OBJECT', 'PHPCS_T_CLOSE_OBJECT'); -define('T_COLOUR', 'PHPCS_T_COLOUR'); -define('T_HASH', 'PHPCS_T_HASH'); -define('T_URL', 'PHPCS_T_URL'); -define('T_STYLE', 'PHPCS_T_STYLE'); -define('T_ASPERAND', 'PHPCS_T_ASPERAND'); -define('T_DOLLAR', 'PHPCS_T_DOLLAR'); -define('T_TYPEOF', 'PHPCS_T_TYPEOF'); -define('T_CLOSURE', 'PHPCS_T_CLOSURE'); -define('T_ANON_CLASS', 'PHPCS_T_ANON_CLASS'); -define('T_BACKTICK', 'PHPCS_T_BACKTICK'); -define('T_START_NOWDOC', 'PHPCS_T_START_NOWDOC'); -define('T_NOWDOC', 'PHPCS_T_NOWDOC'); -define('T_END_NOWDOC', 'PHPCS_T_END_NOWDOC'); -define('T_OPEN_SHORT_ARRAY', 'PHPCS_T_OPEN_SHORT_ARRAY'); -define('T_CLOSE_SHORT_ARRAY', 'PHPCS_T_CLOSE_SHORT_ARRAY'); -define('T_GOTO_LABEL', 'PHPCS_T_GOTO_LABEL'); -define('T_BINARY_CAST', 'PHPCS_T_BINARY_CAST'); -define('T_EMBEDDED_PHP', 'PHPCS_T_EMBEDDED_PHP'); -define('T_RETURN_TYPE', 'PHPCS_T_RETURN_TYPE'); -define('T_OPEN_USE_GROUP', 'PHPCS_T_OPEN_USE_GROUP'); -define('T_CLOSE_USE_GROUP', 'PHPCS_T_CLOSE_USE_GROUP'); -define('T_ZSR', 'PHPCS_T_ZSR'); -define('T_ZSR_EQUAL', 'PHPCS_T_ZSR_EQUAL'); -define('T_FN_ARROW', 'PHPCS_T_FN_ARROW'); -define('T_TYPE_UNION', 'PHPCS_T_TYPE_UNION'); -define('T_PARAM_NAME', 'PHPCS_T_PARAM_NAME'); -define('T_MATCH_ARROW', 'PHPCS_T_MATCH_ARROW'); -define('T_MATCH_DEFAULT', 'PHPCS_T_MATCH_DEFAULT'); -define('T_ATTRIBUTE_END', 'PHPCS_T_ATTRIBUTE_END'); -define('T_ENUM_CASE', 'PHPCS_T_ENUM_CASE'); -define('T_TYPE_INTERSECTION', 'PHPCS_T_TYPE_INTERSECTION'); -define('T_TYPE_OPEN_PARENTHESIS', 'PHPCS_T_TYPE_OPEN_PARENTHESIS'); -define('T_TYPE_CLOSE_PARENTHESIS', 'PHPCS_T_TYPE_CLOSE_PARENTHESIS'); - -// Some PHP 5.5 tokens, replicated for lower versions. -if (defined('T_FINALLY') === false) { - define('T_FINALLY', 'PHPCS_T_FINALLY'); -} - -if (defined('T_YIELD') === false) { - define('T_YIELD', 'PHPCS_T_YIELD'); -} - -// Some PHP 5.6 tokens, replicated for lower versions. -if (defined('T_ELLIPSIS') === false) { - define('T_ELLIPSIS', 'PHPCS_T_ELLIPSIS'); -} - -if (defined('T_POW') === false) { - define('T_POW', 'PHPCS_T_POW'); -} - -if (defined('T_POW_EQUAL') === false) { - define('T_POW_EQUAL', 'PHPCS_T_POW_EQUAL'); -} - -// Some PHP 7 tokens, replicated for lower versions. -if (defined('T_SPACESHIP') === false) { - define('T_SPACESHIP', 'PHPCS_T_SPACESHIP'); -} - -if (defined('T_COALESCE') === false) { - define('T_COALESCE', 'PHPCS_T_COALESCE'); -} - -if (defined('T_COALESCE_EQUAL') === false) { - define('T_COALESCE_EQUAL', 'PHPCS_T_COALESCE_EQUAL'); -} - -if (defined('T_YIELD_FROM') === false) { - define('T_YIELD_FROM', 'PHPCS_T_YIELD_FROM'); -} - -// Some PHP 7.4 tokens, replicated for lower versions. -if (defined('T_BAD_CHARACTER') === false) { - define('T_BAD_CHARACTER', 'PHPCS_T_BAD_CHARACTER'); -} - -if (defined('T_FN') === false) { - define('T_FN', 'PHPCS_T_FN'); -} - -// Some PHP 8.0 tokens, replicated for lower versions. -if (defined('T_NULLSAFE_OBJECT_OPERATOR') === false) { - define('T_NULLSAFE_OBJECT_OPERATOR', 'PHPCS_T_NULLSAFE_OBJECT_OPERATOR'); -} - -if (defined('T_NAME_QUALIFIED') === false) { - define('T_NAME_QUALIFIED', 'PHPCS_T_NAME_QUALIFIED'); -} - -if (defined('T_NAME_FULLY_QUALIFIED') === false) { - define('T_NAME_FULLY_QUALIFIED', 'PHPCS_T_NAME_FULLY_QUALIFIED'); -} - -if (defined('T_NAME_RELATIVE') === false) { - define('T_NAME_RELATIVE', 'PHPCS_T_NAME_RELATIVE'); -} - -if (defined('T_MATCH') === false) { - define('T_MATCH', 'PHPCS_T_MATCH'); -} - -if (defined('T_ATTRIBUTE') === false) { - define('T_ATTRIBUTE', 'PHPCS_T_ATTRIBUTE'); -} - -// Some PHP 8.1 tokens, replicated for lower versions. -if (defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG') === false) { - define('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', 'PHPCS_T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG'); -} - -if (defined('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG') === false) { - define('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', 'PHPCS_T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG'); -} - -if (defined('T_READONLY') === false) { - define('T_READONLY', 'PHPCS_T_READONLY'); -} - -if (defined('T_ENUM') === false) { - define('T_ENUM', 'PHPCS_T_ENUM'); -} - -// Tokens used for parsing doc blocks. -define('T_DOC_COMMENT_STAR', 'PHPCS_T_DOC_COMMENT_STAR'); -define('T_DOC_COMMENT_WHITESPACE', 'PHPCS_T_DOC_COMMENT_WHITESPACE'); -define('T_DOC_COMMENT_TAG', 'PHPCS_T_DOC_COMMENT_TAG'); -define('T_DOC_COMMENT_OPEN_TAG', 'PHPCS_T_DOC_COMMENT_OPEN_TAG'); -define('T_DOC_COMMENT_CLOSE_TAG', 'PHPCS_T_DOC_COMMENT_CLOSE_TAG'); -define('T_DOC_COMMENT_STRING', 'PHPCS_T_DOC_COMMENT_STRING'); - -// Tokens used for PHPCS instruction comments. -define('T_PHPCS_ENABLE', 'PHPCS_T_PHPCS_ENABLE'); -define('T_PHPCS_DISABLE', 'PHPCS_T_PHPCS_DISABLE'); -define('T_PHPCS_SET', 'PHPCS_T_PHPCS_SET'); -define('T_PHPCS_IGNORE', 'PHPCS_T_PHPCS_IGNORE'); -define('T_PHPCS_IGNORE_FILE', 'PHPCS_T_PHPCS_IGNORE_FILE'); - -final class Tokens -{ - - /** - * The token weightings. - * - * @var array - */ - public static $weightings = [ - T_CLASS => 1000, - T_INTERFACE => 1000, - T_TRAIT => 1000, - T_ENUM => 1000, - T_NAMESPACE => 1000, - T_FUNCTION => 100, - T_CLOSURE => 100, - - /* - * Conditions. - */ - - T_WHILE => 50, - T_FOR => 50, - T_FOREACH => 50, - T_IF => 50, - T_ELSE => 50, - T_ELSEIF => 50, - T_DO => 50, - T_TRY => 50, - T_CATCH => 50, - T_FINALLY => 50, - T_SWITCH => 50, - T_MATCH => 50, - - T_SELF => 25, - T_PARENT => 25, - - /* - * Operators and arithmetic. - */ - - T_BITWISE_AND => 8, - T_BITWISE_OR => 8, - T_BITWISE_XOR => 8, - - T_MULTIPLY => 5, - T_DIVIDE => 5, - T_PLUS => 5, - T_MINUS => 5, - T_MODULUS => 5, - T_POW => 5, - T_SPACESHIP => 5, - T_COALESCE => 5, - T_COALESCE_EQUAL => 5, - - T_SL => 5, - T_SR => 5, - T_SL_EQUAL => 5, - T_SR_EQUAL => 5, - - T_EQUAL => 5, - T_AND_EQUAL => 5, - T_CONCAT_EQUAL => 5, - T_DIV_EQUAL => 5, - T_MINUS_EQUAL => 5, - T_MOD_EQUAL => 5, - T_MUL_EQUAL => 5, - T_OR_EQUAL => 5, - T_PLUS_EQUAL => 5, - T_XOR_EQUAL => 5, - - T_BOOLEAN_AND => 5, - T_BOOLEAN_OR => 5, - - /* - * Equality. - */ - - T_IS_EQUAL => 5, - T_IS_NOT_EQUAL => 5, - T_IS_IDENTICAL => 5, - T_IS_NOT_IDENTICAL => 5, - T_IS_SMALLER_OR_EQUAL => 5, - T_IS_GREATER_OR_EQUAL => 5, - ]; - - /** - * Tokens that represent assignments. - * - * @var array - */ - public static $assignmentTokens = [ - T_EQUAL => T_EQUAL, - T_AND_EQUAL => T_AND_EQUAL, - T_OR_EQUAL => T_OR_EQUAL, - T_CONCAT_EQUAL => T_CONCAT_EQUAL, - T_DIV_EQUAL => T_DIV_EQUAL, - T_MINUS_EQUAL => T_MINUS_EQUAL, - T_POW_EQUAL => T_POW_EQUAL, - T_MOD_EQUAL => T_MOD_EQUAL, - T_MUL_EQUAL => T_MUL_EQUAL, - T_PLUS_EQUAL => T_PLUS_EQUAL, - T_XOR_EQUAL => T_XOR_EQUAL, - T_DOUBLE_ARROW => T_DOUBLE_ARROW, - T_SL_EQUAL => T_SL_EQUAL, - T_SR_EQUAL => T_SR_EQUAL, - T_COALESCE_EQUAL => T_COALESCE_EQUAL, - T_ZSR_EQUAL => T_ZSR_EQUAL, - ]; - - /** - * Tokens that represent equality comparisons. - * - * @var array - */ - public static $equalityTokens = [ - T_IS_EQUAL => T_IS_EQUAL, - T_IS_NOT_EQUAL => T_IS_NOT_EQUAL, - T_IS_IDENTICAL => T_IS_IDENTICAL, - T_IS_NOT_IDENTICAL => T_IS_NOT_IDENTICAL, - T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL, - T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL, - ]; - - /** - * Tokens that represent comparison operator. - * - * @var array - */ - public static $comparisonTokens = [ - T_IS_EQUAL => T_IS_EQUAL, - T_IS_IDENTICAL => T_IS_IDENTICAL, - T_IS_NOT_EQUAL => T_IS_NOT_EQUAL, - T_IS_NOT_IDENTICAL => T_IS_NOT_IDENTICAL, - T_LESS_THAN => T_LESS_THAN, - T_GREATER_THAN => T_GREATER_THAN, - T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL, - T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL, - T_SPACESHIP => T_SPACESHIP, - T_COALESCE => T_COALESCE, - ]; - - /** - * Tokens that represent arithmetic operators. - * - * @var array - */ - public static $arithmeticTokens = [ - T_PLUS => T_PLUS, - T_MINUS => T_MINUS, - T_MULTIPLY => T_MULTIPLY, - T_DIVIDE => T_DIVIDE, - T_MODULUS => T_MODULUS, - T_POW => T_POW, - ]; - - /** - * Tokens that perform operations. - * - * @var array - */ - public static $operators = [ - T_MINUS => T_MINUS, - T_PLUS => T_PLUS, - T_MULTIPLY => T_MULTIPLY, - T_DIVIDE => T_DIVIDE, - T_MODULUS => T_MODULUS, - T_POW => T_POW, - T_SPACESHIP => T_SPACESHIP, - T_COALESCE => T_COALESCE, - T_BITWISE_AND => T_BITWISE_AND, - T_BITWISE_OR => T_BITWISE_OR, - T_BITWISE_XOR => T_BITWISE_XOR, - T_SL => T_SL, - T_SR => T_SR, - ]; - - /** - * Tokens that perform boolean operations. - * - * @var array - */ - public static $booleanOperators = [ - T_BOOLEAN_AND => T_BOOLEAN_AND, - T_BOOLEAN_OR => T_BOOLEAN_OR, - T_LOGICAL_AND => T_LOGICAL_AND, - T_LOGICAL_OR => T_LOGICAL_OR, - T_LOGICAL_XOR => T_LOGICAL_XOR, - ]; - - /** - * Tokens that represent casting. - * - * @var array - */ - public static $castTokens = [ - T_INT_CAST => T_INT_CAST, - T_STRING_CAST => T_STRING_CAST, - T_DOUBLE_CAST => T_DOUBLE_CAST, - T_ARRAY_CAST => T_ARRAY_CAST, - T_BOOL_CAST => T_BOOL_CAST, - T_OBJECT_CAST => T_OBJECT_CAST, - T_UNSET_CAST => T_UNSET_CAST, - T_BINARY_CAST => T_BINARY_CAST, - ]; - - /** - * Token types that open parenthesis. - * - * @var array - */ - public static $parenthesisOpeners = [ - T_ARRAY => T_ARRAY, - T_LIST => T_LIST, - T_FUNCTION => T_FUNCTION, - T_CLOSURE => T_CLOSURE, - T_ANON_CLASS => T_ANON_CLASS, - T_WHILE => T_WHILE, - T_FOR => T_FOR, - T_FOREACH => T_FOREACH, - T_SWITCH => T_SWITCH, - T_IF => T_IF, - T_ELSEIF => T_ELSEIF, - T_CATCH => T_CATCH, - T_DECLARE => T_DECLARE, - T_MATCH => T_MATCH, - ]; - - /** - * Tokens that are allowed to open scopes. - * - * @var array - */ - public static $scopeOpeners = [ - T_CLASS => T_CLASS, - T_ANON_CLASS => T_ANON_CLASS, - T_INTERFACE => T_INTERFACE, - T_TRAIT => T_TRAIT, - T_ENUM => T_ENUM, - T_NAMESPACE => T_NAMESPACE, - T_FUNCTION => T_FUNCTION, - T_CLOSURE => T_CLOSURE, - T_IF => T_IF, - T_SWITCH => T_SWITCH, - T_CASE => T_CASE, - T_DECLARE => T_DECLARE, - T_DEFAULT => T_DEFAULT, - T_WHILE => T_WHILE, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - T_FOR => T_FOR, - T_FOREACH => T_FOREACH, - T_DO => T_DO, - T_TRY => T_TRY, - T_CATCH => T_CATCH, - T_FINALLY => T_FINALLY, - T_PROPERTY => T_PROPERTY, - T_OBJECT => T_OBJECT, - T_USE => T_USE, - T_MATCH => T_MATCH, - ]; - - /** - * Tokens that represent scope modifiers. - * - * @var array - */ - public static $scopeModifiers = [ - T_PRIVATE => T_PRIVATE, - T_PUBLIC => T_PUBLIC, - T_PROTECTED => T_PROTECTED, - ]; - - /** - * Tokens that can prefix a method name - * - * @var array - */ - public static $methodPrefixes = [ - T_PRIVATE => T_PRIVATE, - T_PUBLIC => T_PUBLIC, - T_PROTECTED => T_PROTECTED, - T_ABSTRACT => T_ABSTRACT, - T_STATIC => T_STATIC, - T_FINAL => T_FINAL, - ]; - - /** - * Tokens that open code blocks. - * - * @var array - */ - public static $blockOpeners = [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, - T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, - T_OBJECT => T_OBJECT, - ]; - - /** - * Tokens that don't represent code. - * - * @var array - */ - public static $emptyTokens = [ - T_WHITESPACE => T_WHITESPACE, - T_COMMENT => T_COMMENT, - T_DOC_COMMENT => T_DOC_COMMENT, - T_DOC_COMMENT_STAR => T_DOC_COMMENT_STAR, - T_DOC_COMMENT_WHITESPACE => T_DOC_COMMENT_WHITESPACE, - T_DOC_COMMENT_TAG => T_DOC_COMMENT_TAG, - T_DOC_COMMENT_OPEN_TAG => T_DOC_COMMENT_OPEN_TAG, - T_DOC_COMMENT_CLOSE_TAG => T_DOC_COMMENT_CLOSE_TAG, - T_DOC_COMMENT_STRING => T_DOC_COMMENT_STRING, - T_PHPCS_ENABLE => T_PHPCS_ENABLE, - T_PHPCS_DISABLE => T_PHPCS_DISABLE, - T_PHPCS_SET => T_PHPCS_SET, - T_PHPCS_IGNORE => T_PHPCS_IGNORE, - T_PHPCS_IGNORE_FILE => T_PHPCS_IGNORE_FILE, - ]; - - /** - * Tokens that are comments. - * - * @var array - */ - public static $commentTokens = [ - T_COMMENT => T_COMMENT, - T_DOC_COMMENT => T_DOC_COMMENT, - T_DOC_COMMENT_STAR => T_DOC_COMMENT_STAR, - T_DOC_COMMENT_WHITESPACE => T_DOC_COMMENT_WHITESPACE, - T_DOC_COMMENT_TAG => T_DOC_COMMENT_TAG, - T_DOC_COMMENT_OPEN_TAG => T_DOC_COMMENT_OPEN_TAG, - T_DOC_COMMENT_CLOSE_TAG => T_DOC_COMMENT_CLOSE_TAG, - T_DOC_COMMENT_STRING => T_DOC_COMMENT_STRING, - T_PHPCS_ENABLE => T_PHPCS_ENABLE, - T_PHPCS_DISABLE => T_PHPCS_DISABLE, - T_PHPCS_SET => T_PHPCS_SET, - T_PHPCS_IGNORE => T_PHPCS_IGNORE, - T_PHPCS_IGNORE_FILE => T_PHPCS_IGNORE_FILE, - ]; - - /** - * Tokens that are comments containing PHPCS instructions. - * - * @var array - */ - public static $phpcsCommentTokens = [ - T_PHPCS_ENABLE => T_PHPCS_ENABLE, - T_PHPCS_DISABLE => T_PHPCS_DISABLE, - T_PHPCS_SET => T_PHPCS_SET, - T_PHPCS_IGNORE => T_PHPCS_IGNORE, - T_PHPCS_IGNORE_FILE => T_PHPCS_IGNORE_FILE, - ]; - - /** - * Tokens that represent strings. - * - * Note that T_STRINGS are NOT represented in this list. - * - * @var array - */ - public static $stringTokens = [ - T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, - T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, - ]; - - /** - * Tokens that represent text strings. - * - * @var array - */ - public static $textStringTokens = [ - T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING, - T_DOUBLE_QUOTED_STRING => T_DOUBLE_QUOTED_STRING, - T_INLINE_HTML => T_INLINE_HTML, - T_HEREDOC => T_HEREDOC, - T_NOWDOC => T_NOWDOC, - ]; - - /** - * Tokens that represent brackets and parenthesis. - * - * @var array - */ - public static $bracketTokens = [ - T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET, - T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET, - T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET, - T_CLOSE_SQUARE_BRACKET => T_CLOSE_SQUARE_BRACKET, - T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, - T_CLOSE_PARENTHESIS => T_CLOSE_PARENTHESIS, - ]; - - /** - * Tokens that include files. - * - * @var array - */ - public static $includeTokens = [ - T_REQUIRE_ONCE => T_REQUIRE_ONCE, - T_REQUIRE => T_REQUIRE, - T_INCLUDE_ONCE => T_INCLUDE_ONCE, - T_INCLUDE => T_INCLUDE, - ]; - - /** - * Tokens that make up a heredoc string. - * - * @var array - */ - public static $heredocTokens = [ - T_START_HEREDOC => T_START_HEREDOC, - T_END_HEREDOC => T_END_HEREDOC, - T_HEREDOC => T_HEREDOC, - T_START_NOWDOC => T_START_NOWDOC, - T_END_NOWDOC => T_END_NOWDOC, - T_NOWDOC => T_NOWDOC, - ]; - - /** - * Tokens that represent the names of called functions. - * - * Mostly, these are just strings. But PHP tokenizes some language - * constructs and functions using their own tokens. - * - * @var array - */ - public static $functionNameTokens = [ - T_STRING => T_STRING, - T_EVAL => T_EVAL, - T_EXIT => T_EXIT, - T_INCLUDE => T_INCLUDE, - T_INCLUDE_ONCE => T_INCLUDE_ONCE, - T_REQUIRE => T_REQUIRE, - T_REQUIRE_ONCE => T_REQUIRE_ONCE, - T_ISSET => T_ISSET, - T_UNSET => T_UNSET, - T_EMPTY => T_EMPTY, - T_SELF => T_SELF, - T_PARENT => T_PARENT, - T_STATIC => T_STATIC, - ]; - - /** - * Tokens that open class and object scopes. - * - * @var array - */ - public static $ooScopeTokens = [ - T_CLASS => T_CLASS, - T_ANON_CLASS => T_ANON_CLASS, - T_INTERFACE => T_INTERFACE, - T_TRAIT => T_TRAIT, - T_ENUM => T_ENUM, - ]; - - /** - * Tokens representing PHP magic constants. - * - * @var array => - * - * @link https://www.php.net/language.constants.predefined PHP Manual on magic constants - */ - public static $magicConstants = [ - T_CLASS_C => T_CLASS_C, - T_DIR => T_DIR, - T_FILE => T_FILE, - T_FUNC_C => T_FUNC_C, - T_LINE => T_LINE, - T_METHOD_C => T_METHOD_C, - T_NS_C => T_NS_C, - T_TRAIT_C => T_TRAIT_C, - ]; - - /** - * Tokens representing context sensitive keywords in PHP. - * - * @var array - * - * https://wiki.php.net/rfc/context_sensitive_lexer - */ - public static $contextSensitiveKeywords = [ - T_ABSTRACT => T_ABSTRACT, - T_ARRAY => T_ARRAY, - T_AS => T_AS, - T_BREAK => T_BREAK, - T_CALLABLE => T_CALLABLE, - T_CASE => T_CASE, - T_CATCH => T_CATCH, - T_CLASS => T_CLASS, - T_CLONE => T_CLONE, - T_CONST => T_CONST, - T_CONTINUE => T_CONTINUE, - T_DECLARE => T_DECLARE, - T_DEFAULT => T_DEFAULT, - T_DO => T_DO, - T_ECHO => T_ECHO, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - T_EMPTY => T_EMPTY, - T_ENDDECLARE => T_ENDDECLARE, - T_ENDFOR => T_ENDFOR, - T_ENDFOREACH => T_ENDFOREACH, - T_ENDIF => T_ENDIF, - T_ENDSWITCH => T_ENDSWITCH, - T_ENDWHILE => T_ENDWHILE, - T_ENUM => T_ENUM, - T_EVAL => T_EVAL, - T_EXIT => T_EXIT, - T_EXTENDS => T_EXTENDS, - T_FINAL => T_FINAL, - T_FINALLY => T_FINALLY, - T_FN => T_FN, - T_FOR => T_FOR, - T_FOREACH => T_FOREACH, - T_FUNCTION => T_FUNCTION, - T_GLOBAL => T_GLOBAL, - T_GOTO => T_GOTO, - T_IF => T_IF, - T_IMPLEMENTS => T_IMPLEMENTS, - T_INCLUDE => T_INCLUDE, - T_INCLUDE_ONCE => T_INCLUDE_ONCE, - T_INSTANCEOF => T_INSTANCEOF, - T_INSTEADOF => T_INSTEADOF, - T_INTERFACE => T_INTERFACE, - T_ISSET => T_ISSET, - T_LIST => T_LIST, - T_LOGICAL_AND => T_LOGICAL_AND, - T_LOGICAL_OR => T_LOGICAL_OR, - T_LOGICAL_XOR => T_LOGICAL_XOR, - T_MATCH => T_MATCH, - T_NAMESPACE => T_NAMESPACE, - T_NEW => T_NEW, - T_PRINT => T_PRINT, - T_PRIVATE => T_PRIVATE, - T_PROTECTED => T_PROTECTED, - T_PUBLIC => T_PUBLIC, - T_READONLY => T_READONLY, - T_REQUIRE => T_REQUIRE, - T_REQUIRE_ONCE => T_REQUIRE_ONCE, - T_RETURN => T_RETURN, - T_STATIC => T_STATIC, - T_SWITCH => T_SWITCH, - T_THROW => T_THROW, - T_TRAIT => T_TRAIT, - T_TRY => T_TRY, - T_UNSET => T_UNSET, - T_USE => T_USE, - T_VAR => T_VAR, - T_WHILE => T_WHILE, - T_YIELD => T_YIELD, - T_YIELD_FROM => T_YIELD_FROM, - ]; - - - /** - * Given a token, returns the name of the token. - * - * If passed an integer, the token name is sourced from PHP's token_name() - * function. If passed a string, it is assumed to be a PHPCS-supplied token - * that begins with PHPCS_T_, so the name is sourced from the token value itself. - * - * @param int|string $token The token to get the name for. - * - * @return string - */ - public static function tokenName($token) - { - if (is_string($token) === false) { - // PHP-supplied token name. - return token_name($token); - } - - return substr($token, 6); - - }//end tokenName() - - - /** - * Returns the highest weighted token type. - * - * Tokens are weighted by their approximate frequency of appearance in code - * - the less frequently they appear in the code, the higher the weighting. - * For example T_CLASS tokens appear very infrequently in a file, and - * therefore have a high weighting. - * - * Returns false if there are no weightings for any of the specified tokens. - * - * @param array $tokens The token types to get the highest weighted - * type for. - * - * @return int|false The highest weighted token. - */ - public static function getHighestWeightedToken(array $tokens) - { - $highest = -1; - $highestType = false; - - $weights = self::$weightings; - - foreach ($tokens as $token) { - if (isset($weights[$token]) === true) { - $weight = $weights[$token]; - } else { - $weight = 0; - } - - if ($weight > $highest) { - $highest = $weight; - $highestType = $token; - } - } - - return $highestType; - - }//end getHighestWeightedToken() - - -}//end class diff --git a/trunk/vendor/symfony/console/Application.php b/trunk/vendor/symfony/console/Application.php deleted file mode 100644 index bb534188..00000000 --- a/trunk/vendor/symfony/console/Application.php +++ /dev/null @@ -1,1301 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\CompleteCommand; -use Symfony\Component\Console\Command\DumpCompletionCommand; -use Symfony\Component\Console\Command\HelpCommand; -use Symfony\Component\Console\Command\LazyCommand; -use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\Command\SignalableCommandInterface; -use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\Console\Exception\CommandNotFoundException; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Exception\NamespaceNotFoundException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\DebugFormatterHelper; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\ProcessHelper; -use Symfony\Component\Console\Helper\QuestionHelper; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\SignalRegistry\SignalRegistry; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\ErrorHandler\ErrorHandler; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -use Symfony\Contracts\Service\ResetInterface; - -/** - * An Application is the container for a collection of commands. - * - * It is the main entry point of a Console application. - * - * This class is optimized for a standard CLI environment. - * - * Usage: - * - * $app = new Application('myapp', '1.0 (stable)'); - * $app->add(new SimpleCommand()); - * $app->run(); - * - * @author Fabien Potencier - */ -class Application implements ResetInterface -{ - private $commands = []; - private $wantHelps = false; - private $runningCommand; - private $name; - private $version; - private $commandLoader; - private $catchExceptions = true; - private $autoExit = true; - private $definition; - private $helperSet; - private $dispatcher; - private $terminal; - private $defaultCommand; - private $singleCommand = false; - private $initialized; - private $signalRegistry; - private $signalsToDispatchEvent = []; - - public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') - { - $this->name = $name; - $this->version = $version; - $this->terminal = new Terminal(); - $this->defaultCommand = 'list'; - if (\defined('SIGINT') && SignalRegistry::isSupported()) { - $this->signalRegistry = new SignalRegistry(); - $this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2]; - } - } - - /** - * @final - */ - public function setDispatcher(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - public function setCommandLoader(CommandLoaderInterface $commandLoader) - { - $this->commandLoader = $commandLoader; - } - - public function getSignalRegistry(): SignalRegistry - { - if (!$this->signalRegistry) { - throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - return $this->signalRegistry; - } - - public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) - { - $this->signalsToDispatchEvent = $signalsToDispatchEvent; - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - * - * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. - */ - public function run(?InputInterface $input = null, ?OutputInterface $output = null) - { - if (\function_exists('putenv')) { - @putenv('LINES='.$this->terminal->getHeight()); - @putenv('COLUMNS='.$this->terminal->getWidth()); - } - - if (null === $input) { - $input = new ArgvInput(); - } - - if (null === $output) { - $output = new ConsoleOutput(); - } - - $renderException = function (\Throwable $e) use ($output) { - if ($output instanceof ConsoleOutputInterface) { - $this->renderThrowable($e, $output->getErrorOutput()); - } else { - $this->renderThrowable($e, $output); - } - }; - if ($phpHandler = set_exception_handler($renderException)) { - restore_exception_handler(); - if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) { - $errorHandler = true; - } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) { - $phpHandler[0]->setExceptionHandler($errorHandler); - } - } - - $this->configureIO($input, $output); - - try { - $exitCode = $this->doRun($input, $output); - } catch (\Exception $e) { - if (!$this->catchExceptions) { - throw $e; - } - - $renderException($e); - - $exitCode = $e->getCode(); - if (is_numeric($exitCode)) { - $exitCode = (int) $exitCode; - if ($exitCode <= 0) { - $exitCode = 1; - } - } else { - $exitCode = 1; - } - } finally { - // if the exception handler changed, keep it - // otherwise, unregister $renderException - if (!$phpHandler) { - if (set_exception_handler($renderException) === $renderException) { - restore_exception_handler(); - } - restore_exception_handler(); - } elseif (!$errorHandler) { - $finalHandler = $phpHandler[0]->setExceptionHandler(null); - if ($finalHandler !== $renderException) { - $phpHandler[0]->setExceptionHandler($finalHandler); - } - } - } - - if ($this->autoExit) { - if ($exitCode > 255) { - $exitCode = 255; - } - - exit($exitCode); - } - - return $exitCode; - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - */ - public function doRun(InputInterface $input, OutputInterface $output) - { - if (true === $input->hasParameterOption(['--version', '-V'], true)) { - $output->writeln($this->getLongVersion()); - - return 0; - } - - try { - // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument. - $input->bind($this->getDefinition()); - } catch (ExceptionInterface $e) { - // Errors must be ignored, full binding/validation happens later when the command is known. - } - - $name = $this->getCommandName($input); - if (true === $input->hasParameterOption(['--help', '-h'], true)) { - if (!$name) { - $name = 'help'; - $input = new ArrayInput(['command_name' => $this->defaultCommand]); - } else { - $this->wantHelps = true; - } - } - - if (!$name) { - $name = $this->defaultCommand; - $definition = $this->getDefinition(); - $definition->setArguments(array_merge( - $definition->getArguments(), - [ - 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), - ] - )); - } - - try { - $this->runningCommand = null; - // the command name MUST be the first element of the input - $command = $this->find($name); - } catch (\Throwable $e) { - if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - if (0 === $event->getExitCode()) { - return 0; - } - - $e = $event->getError(); - } - - throw $e; - } - - $alternative = $alternatives[0]; - - $style = new SymfonyStyle($input, $output); - $output->writeln(''); - $formattedBlock = (new FormatterHelper())->formatBlock(sprintf('Command "%s" is not defined.', $name), 'error', true); - $output->writeln($formattedBlock); - if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - return $event->getExitCode(); - } - - return 1; - } - - $command = $this->find($alternative); - } - - if ($command instanceof LazyCommand) { - $command = $command->getCommand(); - } - - $this->runningCommand = $command; - $exitCode = $this->doRunCommand($command, $input, $output); - $this->runningCommand = null; - - return $exitCode; - } - - /** - * {@inheritdoc} - */ - public function reset() - { - } - - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Get the helper set associated with the command. - * - * @return HelperSet - */ - public function getHelperSet() - { - if (!$this->helperSet) { - $this->helperSet = $this->getDefaultHelperSet(); - } - - return $this->helperSet; - } - - public function setDefinition(InputDefinition $definition) - { - $this->definition = $definition; - } - - /** - * Gets the InputDefinition related to this Application. - * - * @return InputDefinition - */ - public function getDefinition() - { - if (!$this->definition) { - $this->definition = $this->getDefaultInputDefinition(); - } - - if ($this->singleCommand) { - $inputDefinition = $this->definition; - $inputDefinition->setArguments(); - - return $inputDefinition; - } - - return $this->definition; - } - - /** - * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ( - CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() - && 'command' === $input->getCompletionName() - ) { - $commandNames = []; - foreach ($this->all() as $name => $command) { - // skip hidden commands and aliased commands as they already get added below - if ($command->isHidden() || $command->getName() !== $name) { - continue; - } - $commandNames[] = $command->getName(); - foreach ($command->getAliases() as $name) { - $commandNames[] = $name; - } - } - $suggestions->suggestValues(array_filter($commandNames)); - - return; - } - - if (CompletionInput::TYPE_OPTION_NAME === $input->getCompletionType()) { - $suggestions->suggestOptions($this->getDefinition()->getOptions()); - - return; - } - } - - /** - * Gets the help message. - * - * @return string - */ - public function getHelp() - { - return $this->getLongVersion(); - } - - /** - * Gets whether to catch exceptions or not during commands execution. - * - * @return bool - */ - public function areExceptionsCaught() - { - return $this->catchExceptions; - } - - /** - * Sets whether to catch exceptions or not during commands execution. - */ - public function setCatchExceptions(bool $boolean) - { - $this->catchExceptions = $boolean; - } - - /** - * Gets whether to automatically exit after a command execution or not. - * - * @return bool - */ - public function isAutoExitEnabled() - { - return $this->autoExit; - } - - /** - * Sets whether to automatically exit after a command execution or not. - */ - public function setAutoExit(bool $boolean) - { - $this->autoExit = $boolean; - } - - /** - * Gets the name of the application. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the application name. - **/ - public function setName(string $name) - { - $this->name = $name; - } - - /** - * Gets the application version. - * - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Sets the application version. - */ - public function setVersion(string $version) - { - $this->version = $version; - } - - /** - * Returns the long version of the application. - * - * @return string - */ - public function getLongVersion() - { - if ('UNKNOWN' !== $this->getName()) { - if ('UNKNOWN' !== $this->getVersion()) { - return sprintf('%s %s', $this->getName(), $this->getVersion()); - } - - return $this->getName(); - } - - return 'Console Tool'; - } - - /** - * Registers a new command. - * - * @return Command - */ - public function register(string $name) - { - return $this->add(new Command($name)); - } - - /** - * Adds an array of command objects. - * - * If a Command is not enabled it will not be added. - * - * @param Command[] $commands An array of commands - */ - public function addCommands(array $commands) - { - foreach ($commands as $command) { - $this->add($command); - } - } - - /** - * Adds a command object. - * - * If a command with the same name already exists, it will be overridden. - * If the command is not enabled it will not be added. - * - * @return Command|null - */ - public function add(Command $command) - { - $this->init(); - - $command->setApplication($this); - - if (!$command->isEnabled()) { - $command->setApplication(null); - - return null; - } - - if (!$command instanceof LazyCommand) { - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - } - - if (!$command->getName()) { - throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); - } - - $this->commands[$command->getName()] = $command; - - foreach ($command->getAliases() as $alias) { - $this->commands[$alias] = $command; - } - - return $command; - } - - /** - * Returns a registered command by name or alias. - * - * @return Command - * - * @throws CommandNotFoundException When given command name does not exist - */ - public function get(string $name) - { - $this->init(); - - if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); - } - - // When the command has a different name than the one used at the command loader level - if (!isset($this->commands[$name])) { - throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); - } - - $command = $this->commands[$name]; - - if ($this->wantHelps) { - $this->wantHelps = false; - - $helpCommand = $this->get('help'); - $helpCommand->setCommand($command); - - return $helpCommand; - } - - return $command; - } - - /** - * Returns true if the command exists, false otherwise. - * - * @return bool - */ - public function has(string $name) - { - $this->init(); - - return isset($this->commands[$name]) || ($this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name))); - } - - /** - * Returns an array of all unique namespaces used by currently registered commands. - * - * It does not return the global namespace which always exists. - * - * @return string[] - */ - public function getNamespaces() - { - $namespaces = []; - foreach ($this->all() as $command) { - if ($command->isHidden()) { - continue; - } - - $namespaces[] = $this->extractAllNamespaces($command->getName()); - - foreach ($command->getAliases() as $alias) { - $namespaces[] = $this->extractAllNamespaces($alias); - } - } - - return array_values(array_unique(array_filter(array_merge([], ...$namespaces)))); - } - - /** - * Finds a registered namespace by a name or an abbreviation. - * - * @return string - * - * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous - */ - public function findNamespace(string $namespace) - { - $allNamespaces = $this->getNamespaces(); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; - $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); - - if (empty($namespaces)) { - $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); - - if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - - $message .= implode("\n ", $alternatives); - } - - throw new NamespaceNotFoundException($message, $alternatives); - } - - $exact = \in_array($namespace, $namespaces, true); - if (\count($namespaces) > 1 && !$exact) { - throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); - } - - return $exact ? $namespace : reset($namespaces); - } - - /** - * Finds a command by name or alias. - * - * Contrary to get, this command tries to find the best - * match if you give it an abbreviation of a name or alias. - * - * @return Command - * - * @throws CommandNotFoundException When command name is incorrect or ambiguous - */ - public function find(string $name) - { - $this->init(); - - $aliases = []; - - foreach ($this->commands as $command) { - foreach ($command->getAliases() as $alias) { - if (!$this->has($alias)) { - $this->commands[$alias] = $command; - } - } - } - - if ($this->has($name)) { - return $this->get($name); - } - - $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*'; - $commands = preg_grep('{^'.$expr.'}', $allCommands); - - if (empty($commands)) { - $commands = preg_grep('{^'.$expr.'}i', $allCommands); - } - - // if no commands matched or we just matched namespaces - if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) { - if (false !== $pos = strrpos($name, ':')) { - // check if a namespace exists and contains commands - $this->findNamespace(substr($name, 0, $pos)); - } - - $message = sprintf('Command "%s" is not defined.', $name); - - if ($alternatives = $this->findAlternatives($name, $allCommands)) { - // remove hidden commands - $alternatives = array_filter($alternatives, function ($name) { - return !$this->get($name)->isHidden(); - }); - - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - $message .= implode("\n ", $alternatives); - } - - throw new CommandNotFoundException($message, array_values($alternatives)); - } - - // filter out aliases for commands which are already on the list - if (\count($commands) > 1) { - $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands; - $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) { - if (!$commandList[$nameOrAlias] instanceof Command) { - $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias); - } - - $commandName = $commandList[$nameOrAlias]->getName(); - - $aliases[$nameOrAlias] = $commandName; - - return $commandName === $nameOrAlias || !\in_array($commandName, $commands); - })); - } - - if (\count($commands) > 1) { - $usableWidth = $this->terminal->getWidth() - 10; - $abbrevs = array_values($commands); - $maxLen = 0; - foreach ($abbrevs as $abbrev) { - $maxLen = max(Helper::width($abbrev), $maxLen); - } - $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { - if ($commandList[$cmd]->isHidden()) { - unset($commands[array_search($cmd, $commands)]); - - return false; - } - - $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription(); - - return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev; - }, array_values($commands)); - - if (\count($commands) > 1) { - $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); - - throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); - } - } - - $command = $this->get(reset($commands)); - - if ($command->isHidden()) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); - } - - return $command; - } - - /** - * Gets the commands (registered in the given namespace if provided). - * - * The array keys are the full names and the values the command instances. - * - * @return Command[] - */ - public function all(?string $namespace = null) - { - $this->init(); - - if (null === $namespace) { - if (!$this->commandLoader) { - return $this->commands; - } - - $commands = $this->commands; - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - - return $commands; - } - - $commands = []; - foreach ($this->commands as $name => $command) { - if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { - $commands[$name] = $command; - } - } - - if ($this->commandLoader) { - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - } - - return $commands; - } - - /** - * Returns an array of possible abbreviations given a set of names. - * - * @return string[][] - */ - public static function getAbbreviations(array $names) - { - $abbrevs = []; - foreach ($names as $name) { - for ($len = \strlen($name); $len > 0; --$len) { - $abbrev = substr($name, 0, $len); - $abbrevs[$abbrev][] = $name; - } - } - - return $abbrevs; - } - - public function renderThrowable(\Throwable $e, OutputInterface $output): void - { - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - - $this->doRenderThrowable($e, $output); - - if (null !== $this->runningCommand) { - $output->writeln(sprintf('%s', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } - - protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void - { - do { - $message = trim($e->getMessage()); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $class = get_debug_type($e); - $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); - $len = Helper::width($title); - } else { - $len = 0; - } - - if (str_contains($message, "@anonymous\0")) { - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $message); - } - - $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; - $lines = []; - foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) { - foreach ($this->splitStringByWidth($line, $width - 4) as $line) { - // pre-format lines to get the right string length - $lineLength = Helper::width($line) + 4; - $lines[] = [$line, $lineLength]; - - $len = max($lineLength, $len); - } - } - - $messages = []; - if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); - } - $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); - } - foreach ($lines as $line) { - $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); - } - $messages[] = $emptyLine; - $messages[] = ''; - - $output->writeln($messages, OutputInterface::VERBOSITY_QUIET); - - if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $output->writeln('Exception trace:', OutputInterface::VERBOSITY_QUIET); - - // exception related properties - $trace = $e->getTrace(); - - array_unshift($trace, [ - 'function' => '', - 'file' => $e->getFile() ?: 'n/a', - 'line' => $e->getLine() ?: 'n/a', - 'args' => [], - ]); - - for ($i = 0, $count = \count($trace); $i < $count; ++$i) { - $class = $trace[$i]['class'] ?? ''; - $type = $trace[$i]['type'] ?? ''; - $function = $trace[$i]['function'] ?? ''; - $file = $trace[$i]['file'] ?? 'n/a'; - $line = $trace[$i]['line'] ?? 'n/a'; - - $output->writeln(sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); - } - - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } while ($e = $e->getPrevious()); - } - - /** - * Configures the input and output instances based on the user arguments and options. - */ - protected function configureIO(InputInterface $input, OutputInterface $output) - { - if (true === $input->hasParameterOption(['--ansi'], true)) { - $output->setDecorated(true); - } elseif (true === $input->hasParameterOption(['--no-ansi'], true)) { - $output->setDecorated(false); - } - - if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) { - $input->setInteractive(false); - } - - switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { - case -1: - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - break; - case 1: - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - break; - case 2: - $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - break; - case 3: - $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - break; - default: - $shellVerbosity = 0; - break; - } - - if (true === $input->hasParameterOption(['--quiet', '-q'], true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - $shellVerbosity = -1; - } else { - if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || 3 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - $shellVerbosity = 3; - } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || 2 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - $shellVerbosity = 2; - } elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - $shellVerbosity = 1; - } - } - - if (-1 === $shellVerbosity) { - $input->setInteractive(false); - } - - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$shellVerbosity); - } - $_ENV['SHELL_VERBOSITY'] = $shellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity; - } - - /** - * Runs the current command. - * - * If an event dispatcher has been attached to the application, - * events are also dispatched during the life-cycle of the command. - * - * @return int 0 if everything went fine, or an error code - */ - protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) - { - foreach ($command->getHelperSet() as $helper) { - if ($helper instanceof InputAwareInterface) { - $helper->setInput($input); - } - } - - if ($this->signalsToDispatchEvent) { - $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; - - if ($commandSignals || null !== $this->dispatcher) { - if (!$this->signalRegistry) { - throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - if (Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - - foreach ([\SIGINT, \SIGTERM] as $signal) { - $this->signalRegistry->register($signal, static function () use ($sttyMode) { - shell_exec('stty '.$sttyMode); - }); - } - } - } - - if (null !== $this->dispatcher) { - foreach ($this->signalsToDispatchEvent as $signal) { - $event = new ConsoleSignalEvent($command, $input, $output, $signal); - - $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) { - $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL); - - // No more handlers, we try to simulate PHP default behavior - if (!$hasNext) { - if (!\in_array($signal, [\SIGUSR1, \SIGUSR2], true)) { - exit(0); - } - } - }); - } - } - - foreach ($commandSignals as $signal) { - $this->signalRegistry->register($signal, [$command, 'handleSignal']); - } - } - - if (null === $this->dispatcher) { - return $command->run($input, $output); - } - - // bind before the console.command event, so the listeners have access to input options/arguments - try { - $command->mergeApplicationDefinition(); - $input->bind($command->getDefinition()); - } catch (ExceptionInterface $e) { - // ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition - } - - $event = new ConsoleCommandEvent($command, $input, $output); - $e = null; - - try { - $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND); - - if ($event->commandShouldRun()) { - $exitCode = $command->run($input, $output); - } else { - $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; - } - } catch (\Throwable $e) { - $event = new ConsoleErrorEvent($input, $output, $e, $command); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - $e = $event->getError(); - - if (0 === $exitCode = $event->getExitCode()) { - $e = null; - } - } - - $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); - $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); - - if (null !== $e) { - throw $e; - } - - return $event->getExitCode(); - } - - /** - * Gets the name of the command based on input. - * - * @return string|null - */ - protected function getCommandName(InputInterface $input) - { - return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument(); - } - - /** - * Gets the default input definition. - * - * @return InputDefinition - */ - protected function getDefaultInputDefinition() - { - return new InputDefinition([ - new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the '.$this->defaultCommand.' command'), - new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), - new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), - new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null), - new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), - ]); - } - - /** - * Gets the default commands that should always be available. - * - * @return Command[] - */ - protected function getDefaultCommands() - { - return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()]; - } - - /** - * Gets the default helper set with the helpers that should always be available. - * - * @return HelperSet - */ - protected function getDefaultHelperSet() - { - return new HelperSet([ - new FormatterHelper(), - new DebugFormatterHelper(), - new ProcessHelper(), - new QuestionHelper(), - ]); - } - - /** - * Returns abbreviated suggestions in string format. - */ - private function getAbbreviationSuggestions(array $abbrevs): string - { - return ' '.implode("\n ", $abbrevs); - } - - /** - * Returns the namespace part of the command name. - * - * This method is not part of public API and should not be used directly. - * - * @return string - */ - public function extractNamespace(string $name, ?int $limit = null) - { - $parts = explode(':', $name, -1); - - return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit)); - } - - /** - * Finds alternative of $name among $collection, - * if nothing is found in $collection, try in $abbrevs. - * - * @return string[] - */ - private function findAlternatives(string $name, iterable $collection): array - { - $threshold = 1e3; - $alternatives = []; - - $collectionParts = []; - foreach ($collection as $item) { - $collectionParts[$item] = explode(':', $item); - } - - foreach (explode(':', $name) as $i => $subname) { - foreach ($collectionParts as $collectionName => $parts) { - $exists = isset($alternatives[$collectionName]); - if (!isset($parts[$i]) && $exists) { - $alternatives[$collectionName] += $threshold; - continue; - } elseif (!isset($parts[$i])) { - continue; - } - - $lev = levenshtein($subname, $parts[$i]); - if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) { - $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; - } elseif ($exists) { - $alternatives[$collectionName] += $threshold; - } - } - } - - foreach ($collection as $item) { - $lev = levenshtein($name, $item); - if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { - $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; - } - } - - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); - ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); - - return array_keys($alternatives); - } - - /** - * Sets the default Command name. - * - * @return $this - */ - public function setDefaultCommand(string $commandName, bool $isSingleCommand = false) - { - $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0]; - - if ($isSingleCommand) { - // Ensure the command exist - $this->find($commandName); - - $this->singleCommand = true; - } - - return $this; - } - - /** - * @internal - */ - public function isSingleCommand(): bool - { - return $this->singleCommand; - } - - private function splitStringByWidth(string $string, int $width): array - { - // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. - // additionally, array_slice() is not enough as some character has doubled width. - // we need a function to split string not by character count but by string width - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return str_split($string, $width); - } - - $utf8String = mb_convert_encoding($string, 'utf8', $encoding); - $lines = []; - $line = ''; - - $offset = 0; - while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) { - $offset += \strlen($m[0]); - - foreach (preg_split('//u', $m[0]) as $char) { - // test if $char could be appended to current line - if (mb_strwidth($line.$char, 'utf8') <= $width) { - $line .= $char; - continue; - } - // if not, push current line to array and make new line - $lines[] = str_pad($line, $width); - $line = $char; - } - } - - $lines[] = \count($lines) ? str_pad($line, $width) : $line; - - mb_convert_variables($encoding, 'utf8', $lines); - - return $lines; - } - - /** - * Returns all namespaces of the command name. - * - * @return string[] - */ - private function extractAllNamespaces(string $name): array - { - // -1 as third argument is needed to skip the command short name when exploding - $parts = explode(':', $name, -1); - $namespaces = []; - - foreach ($parts as $part) { - if (\count($namespaces)) { - $namespaces[] = end($namespaces).':'.$part; - } else { - $namespaces[] = $part; - } - } - - return $namespaces; - } - - private function init() - { - if ($this->initialized) { - return; - } - $this->initialized = true; - - foreach ($this->getDefaultCommands() as $command) { - $this->add($command); - } - } -} diff --git a/trunk/vendor/symfony/console/Attribute/AsCommand.php b/trunk/vendor/symfony/console/Attribute/AsCommand.php deleted file mode 100644 index b337f548..00000000 --- a/trunk/vendor/symfony/console/Attribute/AsCommand.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Attribute; - -/** - * Service tag to autoconfigure commands. - */ -#[\Attribute(\Attribute::TARGET_CLASS)] -class AsCommand -{ - public function __construct( - public string $name, - public ?string $description = null, - array $aliases = [], - bool $hidden = false, - ) { - if (!$hidden && !$aliases) { - return; - } - - $name = explode('|', $name); - $name = array_merge($name, $aliases); - - if ($hidden && '' !== $name[0]) { - array_unshift($name, ''); - } - - $this->name = implode('|', $name); - } -} diff --git a/trunk/vendor/symfony/console/CHANGELOG.md b/trunk/vendor/symfony/console/CHANGELOG.md deleted file mode 100644 index 6662dd1e..00000000 --- a/trunk/vendor/symfony/console/CHANGELOG.md +++ /dev/null @@ -1,217 +0,0 @@ -CHANGELOG -========= - -5.4 ---- - - * Add `TesterTrait::assertCommandIsSuccessful()` to test command - * Deprecate `HelperSet::setCommand()` and `getCommand()` without replacement - -5.3 ---- - - * Add `GithubActionReporter` to render annotations in a Github Action - * Add `InputOption::VALUE_NEGATABLE` flag to handle `--foo`/`--no-foo` options - * Add the `Command::$defaultDescription` static property and the `description` attribute - on the `console.command` tag to allow the `list` command to instantiate commands lazily - * Add option `--short` to the `list` command - * Add support for bright colors - * Add `#[AsCommand]` attribute for declaring commands on PHP 8 - * Add `Helper::width()` and `Helper::length()` - * The `--ansi` and `--no-ansi` options now default to `null`. - -5.2.0 ------ - - * Added `SingleCommandApplication::setAutoExit()` to allow testing via `CommandTester` - * added support for multiline responses to questions through `Question::setMultiline()` - and `Question::isMultiline()` - * Added `SignalRegistry` class to stack signals handlers - * Added support for signals: - * Added `Application::getSignalRegistry()` and `Application::setSignalsToDispatchEvent()` methods - * Added `SignalableCommandInterface` interface - * Added `TableCellStyle` class to customize table cell - * Removed `php ` prefix invocation from help messages. - -5.1.0 ------ - - * `Command::setHidden()` is final since Symfony 5.1 - * Add `SingleCommandApplication` - * Add `Cursor` class - -5.0.0 ------ - - * removed support for finding hidden commands using an abbreviation, use the full name instead - * removed `TableStyle::setCrossingChar()` method in favor of `TableStyle::setDefaultCrossingChar()` - * removed `TableStyle::setHorizontalBorderChar()` method in favor of `TableStyle::setDefaultCrossingChars()` - * removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()` - * removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed support for returning `null` from `Command::execute()`, return `0` instead - * `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument - * `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface` - for its `dispatcher` argument - * renamed `Application::renderException()` and `Application::doRenderException()` - to `renderThrowable()` and `doRenderThrowable()` respectively. - -4.4.0 ------ - - * deprecated finding hidden commands using an abbreviation, use the full name instead - * added `Question::setTrimmable` default to true to allow the answer to be trimmed - * added method `minSecondsBetweenRedraws()` and `maxSecondsBetweenRedraws()` on `ProgressBar` - * `Application` implements `ResetInterface` - * marked all dispatched event classes as `@final` - * added support for displaying table horizontally - * deprecated returning `null` from `Command::execute()`, return `0` instead - * Deprecated the `Application::renderException()` and `Application::doRenderException()` methods, - use `renderThrowable()` and `doRenderThrowable()` instead. - * added support for the `NO_COLOR` env var (https://no-color.org/) - -4.3.0 ------ - - * added support for hyperlinks - * added `ProgressBar::iterate()` method that simplify updating the progress bar when iterating - * added `Question::setAutocompleterCallback()` to provide a callback function - that dynamically generates suggestions as the user types - -4.2.0 ------ - - * allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to - `ProcessHelper::run()` to pass environment variables - * deprecated passing a command as a string to `ProcessHelper::run()`, - pass it the command as an array of its arguments instead - * made the `ProcessHelper` class final - * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`) - * added `capture_stderr_separately` option to `CommandTester::execute()` - -4.1.0 ------ - - * added option to run suggested command if command is not found and only 1 alternative is available - * added option to modify console output and print multiple modifiable sections - * added support for iterable messages in output `write` and `writeln` methods - -4.0.0 ------ - - * `OutputFormatter` throws an exception when unknown options are used - * removed `QuestionHelper::setInputStream()/getInputStream()` - * removed `Application::getTerminalWidth()/getTerminalHeight()` and - `Application::setTerminalDimensions()/getTerminalDimensions()` - * removed `ConsoleExceptionEvent` - * removed `ConsoleEvents::EXCEPTION` - -3.4.0 ------ - - * added `SHELL_VERBOSITY` env var to control verbosity - * added `CommandLoaderInterface`, `FactoryCommandLoader` and PSR-11 - `ContainerCommandLoader` for commands lazy-loading - * added a case-insensitive command name matching fallback - * added static `Command::$defaultName/getDefaultName()`, allowing for - commands to be registered at compile time in the application command loader. - Setting the `$defaultName` property avoids the need for filling the `command` - attribute on the `console.command` tag when using `AddConsoleCommandPass`. - -3.3.0 ------ - - * added `ExceptionListener` - * added `AddConsoleCommandPass` (originally in FrameworkBundle) - * [BC BREAK] `Input::getOption()` no longer returns the default value for options - with value optional explicitly passed empty - * added console.error event to catch exceptions thrown by other listeners - * deprecated console.exception event in favor of console.error - * added ability to handle `CommandNotFoundException` through the - `console.error` event - * deprecated default validation in `SymfonyQuestionHelper::ask` - -3.2.0 ------- - - * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs - * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) - * added StreamableInputInterface - * added LockableTrait - -3.1.0 ------ - - * added truncate method to FormatterHelper - * added setColumnWidth(s) method to Table - -2.8.3 ------ - - * remove readline support from the question helper as it caused issues - -2.8.0 ------ - - * use readline for user input in the question helper when available to allow - the use of arrow keys - -2.6.0 ------ - - * added a Process helper - * added a DebugFormatter helper - -2.5.0 ------ - - * deprecated the dialog helper (use the question helper instead) - * deprecated TableHelper in favor of Table - * deprecated ProgressHelper in favor of ProgressBar - * added ConsoleLogger - * added a question helper - * added a way to set the process name of a command - * added a way to set a default command instead of `ListCommand` - -2.4.0 ------ - - * added a way to force terminal dimensions - * added a convenient method to detect verbosity level - * [BC BREAK] made descriptors use output instead of returning a string - -2.3.0 ------ - - * added multiselect support to the select dialog helper - * added Table Helper for tabular data rendering - * added support for events in `Application` - * added a way to normalize EOLs in `ApplicationTester::getDisplay()` and `CommandTester::getDisplay()` - * added a way to set the progress bar progress via the `setCurrent` method - * added support for multiple InputOption shortcuts, written as `'-a|-b|-c'` - * added two additional verbosity levels, VERBOSITY_VERY_VERBOSE and VERBOSITY_DEBUG - -2.2.0 ------ - - * added support for colorization on Windows via ConEmu - * add a method to Dialog Helper to ask for a question and hide the response - * added support for interactive selections in console (DialogHelper::select()) - * added support for autocompletion as you type in Dialog Helper - -2.1.0 ------ - - * added ConsoleOutputInterface - * added the possibility to disable a command (Command::isEnabled()) - * added suggestions when a command does not exist - * added a --raw option to the list command - * added support for STDERR in the console output class (errors are now sent - to STDERR) - * made the defaults (helper set, commands, input definition) in Application - more easily customizable - * added support for the shell even if readline is not available - * added support for process isolation in Symfony shell via - `--process-isolation` switch - * added support for `--`, which disables options parsing after that point - (tokens will be parsed as arguments) diff --git a/trunk/vendor/symfony/console/CI/GithubActionReporter.php b/trunk/vendor/symfony/console/CI/GithubActionReporter.php deleted file mode 100644 index 06571785..00000000 --- a/trunk/vendor/symfony/console/CI/GithubActionReporter.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CI; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Utility class for Github actions. - * - * @author Maxime Steinhausser - */ -class GithubActionReporter -{ - private $output; - - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85 - */ - private const ESCAPED_DATA = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ]; - - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L87-L94 - */ - private const ESCAPED_PROPERTIES = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ':' => '%3A', - ',' => '%2C', - ]; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - } - - public static function isGithubActionEnvironment(): bool - { - return false !== getenv('GITHUB_ACTIONS'); - } - - /** - * Output an error using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message - */ - public function error(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void - { - $this->log('error', $message, $file, $line, $col); - } - - /** - * Output a warning using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message - */ - public function warning(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void - { - $this->log('warning', $message, $file, $line, $col); - } - - /** - * Output a debug log using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message - */ - public function debug(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void - { - $this->log('debug', $message, $file, $line, $col); - } - - private function log(string $type, string $message, ?string $file = null, ?int $line = null, ?int $col = null): void - { - // Some values must be encoded. - $message = strtr($message, self::ESCAPED_DATA); - - if (!$file) { - // No file provided, output the message solely: - $this->output->writeln(sprintf('::%s::%s', $type, $message)); - - return; - } - - $this->output->writeln(sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); - } -} diff --git a/trunk/vendor/symfony/console/Color.php b/trunk/vendor/symfony/console/Color.php deleted file mode 100644 index 22a4ce9f..00000000 --- a/trunk/vendor/symfony/console/Color.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Fabien Potencier - */ -final class Color -{ - private const COLORS = [ - 'black' => 0, - 'red' => 1, - 'green' => 2, - 'yellow' => 3, - 'blue' => 4, - 'magenta' => 5, - 'cyan' => 6, - 'white' => 7, - 'default' => 9, - ]; - - private const BRIGHT_COLORS = [ - 'gray' => 0, - 'bright-red' => 1, - 'bright-green' => 2, - 'bright-yellow' => 3, - 'bright-blue' => 4, - 'bright-magenta' => 5, - 'bright-cyan' => 6, - 'bright-white' => 7, - ]; - - private const AVAILABLE_OPTIONS = [ - 'bold' => ['set' => 1, 'unset' => 22], - 'underscore' => ['set' => 4, 'unset' => 24], - 'blink' => ['set' => 5, 'unset' => 25], - 'reverse' => ['set' => 7, 'unset' => 27], - 'conceal' => ['set' => 8, 'unset' => 28], - ]; - - private $foreground; - private $background; - private $options = []; - - public function __construct(string $foreground = '', string $background = '', array $options = []) - { - $this->foreground = $this->parseColor($foreground); - $this->background = $this->parseColor($background, true); - - foreach ($options as $option) { - if (!isset(self::AVAILABLE_OPTIONS[$option])) { - throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); - } - - $this->options[$option] = self::AVAILABLE_OPTIONS[$option]; - } - } - - public function apply(string $text): string - { - return $this->set().$text.$this->unset(); - } - - public function set(): string - { - $setCodes = []; - if ('' !== $this->foreground) { - $setCodes[] = $this->foreground; - } - if ('' !== $this->background) { - $setCodes[] = $this->background; - } - foreach ($this->options as $option) { - $setCodes[] = $option['set']; - } - if (0 === \count($setCodes)) { - return ''; - } - - return sprintf("\033[%sm", implode(';', $setCodes)); - } - - public function unset(): string - { - $unsetCodes = []; - if ('' !== $this->foreground) { - $unsetCodes[] = 39; - } - if ('' !== $this->background) { - $unsetCodes[] = 49; - } - foreach ($this->options as $option) { - $unsetCodes[] = $option['unset']; - } - if (0 === \count($unsetCodes)) { - return ''; - } - - return sprintf("\033[%sm", implode(';', $unsetCodes)); - } - - private function parseColor(string $color, bool $background = false): string - { - if ('' === $color) { - return ''; - } - - if ('#' === $color[0]) { - $color = substr($color, 1); - - if (3 === \strlen($color)) { - $color = $color[0].$color[0].$color[1].$color[1].$color[2].$color[2]; - } - - if (6 !== \strlen($color)) { - throw new InvalidArgumentException(sprintf('Invalid "%s" color.', $color)); - } - - return ($background ? '4' : '3').$this->convertHexColorToAnsi(hexdec($color)); - } - - if (isset(self::COLORS[$color])) { - return ($background ? '4' : '3').self::COLORS[$color]; - } - - if (isset(self::BRIGHT_COLORS[$color])) { - return ($background ? '10' : '9').self::BRIGHT_COLORS[$color]; - } - - throw new InvalidArgumentException(sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); - } - - private function convertHexColorToAnsi(int $color): string - { - $r = ($color >> 16) & 255; - $g = ($color >> 8) & 255; - $b = $color & 255; - - // see https://github.com/termstandard/colors/ for more information about true color support - if ('truecolor' !== getenv('COLORTERM')) { - return (string) $this->degradeHexColorToAnsi($r, $g, $b); - } - - return sprintf('8;2;%d;%d;%d', $r, $g, $b); - } - - private function degradeHexColorToAnsi(int $r, int $g, int $b): int - { - if (0 === round($this->getSaturation($r, $g, $b) / 50)) { - return 0; - } - - return (round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255); - } - - private function getSaturation(int $r, int $g, int $b): int - { - $r = $r / 255; - $g = $g / 255; - $b = $b / 255; - $v = max($r, $g, $b); - - if (0 === $diff = $v - min($r, $g, $b)) { - return 0; - } - - return (int) $diff * 100 / $v; - } -} diff --git a/trunk/vendor/symfony/console/Command/Command.php b/trunk/vendor/symfony/console/Command/Command.php deleted file mode 100644 index d1810367..00000000 --- a/trunk/vendor/symfony/console/Command/Command.php +++ /dev/null @@ -1,710 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Base class for all commands. - * - * @author Fabien Potencier - */ -class Command -{ - // see https://tldp.org/LDP/abs/html/exitcodes.html - public const SUCCESS = 0; - public const FAILURE = 1; - public const INVALID = 2; - - /** - * @var string|null The default command name - */ - protected static $defaultName; - - /** - * @var string|null The default command description - */ - protected static $defaultDescription; - - private $application; - private $name; - private $processTitle; - private $aliases = []; - private $definition; - private $hidden = false; - private $help = ''; - private $description = ''; - private $fullDefinition; - private $ignoreValidationErrors = false; - private $code; - private $synopsis = []; - private $usages = []; - private $helperSet; - - /** - * @return string|null - */ - public static function getDefaultName() - { - $class = static::class; - - if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->name; - } - - $r = new \ReflectionProperty($class, 'defaultName'); - - return $class === $r->class ? static::$defaultName : null; - } - - public static function getDefaultDescription(): ?string - { - $class = static::class; - - if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->description; - } - - $r = new \ReflectionProperty($class, 'defaultDescription'); - - return $class === $r->class ? static::$defaultDescription : null; - } - - /** - * @param string|null $name The name of the command; passing null means it must be set in configure() - * - * @throws LogicException When the command name is empty - */ - public function __construct(?string $name = null) - { - $this->definition = new InputDefinition(); - - if (null === $name && null !== $name = static::getDefaultName()) { - $aliases = explode('|', $name); - - if ('' === $name = array_shift($aliases)) { - $this->setHidden(true); - $name = array_shift($aliases); - } - - $this->setAliases($aliases); - } - - if (null !== $name) { - $this->setName($name); - } - - if ('' === $this->description) { - $this->setDescription(static::getDefaultDescription() ?? ''); - } - - $this->configure(); - } - - /** - * Ignores validation errors. - * - * This is mainly useful for the help command. - */ - public function ignoreValidationErrors() - { - $this->ignoreValidationErrors = true; - } - - public function setApplication(?Application $application = null) - { - $this->application = $application; - if ($application) { - $this->setHelperSet($application->getHelperSet()); - } else { - $this->helperSet = null; - } - - $this->fullDefinition = null; - } - - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Gets the helper set. - * - * @return HelperSet|null - */ - public function getHelperSet() - { - return $this->helperSet; - } - - /** - * Gets the application instance for this command. - * - * @return Application|null - */ - public function getApplication() - { - return $this->application; - } - - /** - * Checks whether the command is enabled or not in the current environment. - * - * Override this to check for x or y and return false if the command cannot - * run properly under the current conditions. - * - * @return bool - */ - public function isEnabled() - { - return true; - } - - /** - * Configures the current command. - */ - protected function configure() - { - } - - /** - * Executes the current command. - * - * This method is not abstract because you can use this class - * as a concrete class. In this case, instead of defining the - * execute() method, you set the code to execute by passing - * a Closure to the setCode() method. - * - * @return int 0 if everything went fine, or an exit code - * - * @throws LogicException When this abstract method is not implemented - * - * @see setCode() - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - throw new LogicException('You must override the execute() method in the concrete command class.'); - } - - /** - * Interacts with the user. - * - * This method is executed before the InputDefinition is validated. - * This means that this is the only place where the command can - * interactively ask for values of missing required arguments. - */ - protected function interact(InputInterface $input, OutputInterface $output) - { - } - - /** - * Initializes the command after the input has been bound and before the input - * is validated. - * - * This is mainly useful when a lot of commands extends one main command - * where some things need to be initialized based on the input arguments and options. - * - * @see InputInterface::bind() - * @see InputInterface::validate() - */ - protected function initialize(InputInterface $input, OutputInterface $output) - { - } - - /** - * Runs the command. - * - * The code to execute is either defined directly with the - * setCode() method or by overriding the execute() method - * in a sub-class. - * - * @return int The command exit code - * - * @throws ExceptionInterface When input binding fails. Bypass this by calling {@link ignoreValidationErrors()}. - * - * @see setCode() - * @see execute() - */ - public function run(InputInterface $input, OutputInterface $output) - { - // add the application arguments and options - $this->mergeApplicationDefinition(); - - // bind the input against the command specific arguments/options - try { - $input->bind($this->getDefinition()); - } catch (ExceptionInterface $e) { - if (!$this->ignoreValidationErrors) { - throw $e; - } - } - - $this->initialize($input, $output); - - if (null !== $this->processTitle) { - if (\function_exists('cli_set_process_title')) { - if (!@cli_set_process_title($this->processTitle)) { - if ('Darwin' === \PHP_OS) { - $output->writeln('Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', OutputInterface::VERBOSITY_VERY_VERBOSE); - } else { - cli_set_process_title($this->processTitle); - } - } - } elseif (\function_exists('setproctitle')) { - setproctitle($this->processTitle); - } elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) { - $output->writeln('Install the proctitle PECL to be able to change the process title.'); - } - } - - if ($input->isInteractive()) { - $this->interact($input, $output); - } - - // The command name argument is often omitted when a command is executed directly with its run() method. - // It would fail the validation if we didn't make sure the command argument is present, - // since it's required by the application. - if ($input->hasArgument('command') && null === $input->getArgument('command')) { - $input->setArgument('command', $this->getName()); - } - - $input->validate(); - - if ($this->code) { - $statusCode = ($this->code)($input, $output); - } else { - $statusCode = $this->execute($input, $output); - - if (!\is_int($statusCode)) { - throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, "%s" returned.', static::class, get_debug_type($statusCode))); - } - } - - return is_numeric($statusCode) ? (int) $statusCode : 0; - } - - /** - * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - } - - /** - * Sets the code to execute when running this command. - * - * If this method is used, it overrides the code defined - * in the execute() method. - * - * @param callable $code A callable(InputInterface $input, OutputInterface $output) - * - * @return $this - * - * @throws InvalidArgumentException - * - * @see execute() - */ - public function setCode(callable $code) - { - if ($code instanceof \Closure) { - $r = new \ReflectionFunction($code); - if (null === $r->getClosureThis()) { - set_error_handler(static function () {}); - try { - if ($c = \Closure::bind($code, $this)) { - $code = $c; - } - } finally { - restore_error_handler(); - } - } - } - - $this->code = $code; - - return $this; - } - - /** - * Merges the application definition with the command definition. - * - * This method is not part of public API and should not be used directly. - * - * @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments - * - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true) - { - if (null === $this->application) { - return; - } - - $this->fullDefinition = new InputDefinition(); - $this->fullDefinition->setOptions($this->definition->getOptions()); - $this->fullDefinition->addOptions($this->application->getDefinition()->getOptions()); - - if ($mergeArgs) { - $this->fullDefinition->setArguments($this->application->getDefinition()->getArguments()); - $this->fullDefinition->addArguments($this->definition->getArguments()); - } else { - $this->fullDefinition->setArguments($this->definition->getArguments()); - } - } - - /** - * Sets an array of argument and option instances. - * - * @param array|InputDefinition $definition An array of argument and option instances or a definition instance - * - * @return $this - */ - public function setDefinition($definition) - { - if ($definition instanceof InputDefinition) { - $this->definition = $definition; - } else { - $this->definition->setDefinition($definition); - } - - $this->fullDefinition = null; - - return $this; - } - - /** - * Gets the InputDefinition attached to this Command. - * - * @return InputDefinition - */ - public function getDefinition() - { - return $this->fullDefinition ?? $this->getNativeDefinition(); - } - - /** - * Gets the InputDefinition to be used to create representations of this Command. - * - * Can be overridden to provide the original command representation when it would otherwise - * be changed by merging with the application InputDefinition. - * - * This method is not part of public API and should not be used directly. - * - * @return InputDefinition - */ - public function getNativeDefinition() - { - if (null === $this->definition) { - throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); - } - - return $this->definition; - } - - /** - * Adds an argument. - * - * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) - * - * @return $this - * - * @throws InvalidArgumentException When argument mode is not valid - */ - public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null) - { - $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); - if (null !== $this->fullDefinition) { - $this->fullDefinition->addArgument(new InputArgument($name, $mode, $description, $default)); - } - - return $this; - } - - /** - * Adds an option. - * - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants - * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) - * - * @return $this - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - */ - public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null) - { - $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); - if (null !== $this->fullDefinition) { - $this->fullDefinition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); - } - - return $this; - } - - /** - * Sets the name of the command. - * - * This method can set both the namespace and the name if - * you separate them by a colon (:) - * - * $command->setName('foo:bar'); - * - * @return $this - * - * @throws InvalidArgumentException When the name is invalid - */ - public function setName(string $name) - { - $this->validateName($name); - - $this->name = $name; - - return $this; - } - - /** - * Sets the process title of the command. - * - * This feature should be used only when creating a long process command, - * like a daemon. - * - * @return $this - */ - public function setProcessTitle(string $title) - { - $this->processTitle = $title; - - return $this; - } - - /** - * Returns the command name. - * - * @return string|null - */ - public function getName() - { - return $this->name; - } - - /** - * @param bool $hidden Whether or not the command should be hidden from the list of commands - * The default value will be true in Symfony 6.0 - * - * @return $this - * - * @final since Symfony 5.1 - */ - public function setHidden(bool $hidden /* = true */) - { - $this->hidden = $hidden; - - return $this; - } - - /** - * @return bool whether the command should be publicly shown or not - */ - public function isHidden() - { - return $this->hidden; - } - - /** - * Sets the description for the command. - * - * @return $this - */ - public function setDescription(string $description) - { - $this->description = $description; - - return $this; - } - - /** - * Returns the description for the command. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the help for the command. - * - * @return $this - */ - public function setHelp(string $help) - { - $this->help = $help; - - return $this; - } - - /** - * Returns the help for the command. - * - * @return string - */ - public function getHelp() - { - return $this->help; - } - - /** - * Returns the processed help for the command replacing the %command.name% and - * %command.full_name% patterns with the real values dynamically. - * - * @return string - */ - public function getProcessedHelp() - { - $name = $this->name; - $isSingleCommand = $this->application && $this->application->isSingleCommand(); - - $placeholders = [ - '%command.name%', - '%command.full_name%', - ]; - $replacements = [ - $name, - $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name, - ]; - - return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription()); - } - - /** - * Sets the aliases for the command. - * - * @param string[] $aliases An array of aliases for the command - * - * @return $this - * - * @throws InvalidArgumentException When an alias is invalid - */ - public function setAliases(iterable $aliases) - { - $list = []; - - foreach ($aliases as $alias) { - $this->validateName($alias); - $list[] = $alias; - } - - $this->aliases = \is_array($aliases) ? $aliases : $list; - - return $this; - } - - /** - * Returns the aliases for the command. - * - * @return array - */ - public function getAliases() - { - return $this->aliases; - } - - /** - * Returns the synopsis for the command. - * - * @param bool $short Whether to show the short version of the synopsis (with options folded) or not - * - * @return string - */ - public function getSynopsis(bool $short = false) - { - $key = $short ? 'short' : 'long'; - - if (!isset($this->synopsis[$key])) { - $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); - } - - return $this->synopsis[$key]; - } - - /** - * Add a command usage example, it'll be prefixed with the command name. - * - * @return $this - */ - public function addUsage(string $usage) - { - if (!str_starts_with($usage, $this->name)) { - $usage = sprintf('%s %s', $this->name, $usage); - } - - $this->usages[] = $usage; - - return $this; - } - - /** - * Returns alternative usages of the command. - * - * @return array - */ - public function getUsages() - { - return $this->usages; - } - - /** - * Gets a helper instance by name. - * - * @return mixed - * - * @throws LogicException if no HelperSet is defined - * @throws InvalidArgumentException if the helper is not defined - */ - public function getHelper(string $name) - { - if (null === $this->helperSet) { - throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); - } - - return $this->helperSet->get($name); - } - - /** - * Validates a command name. - * - * It must be non-empty and parts can optionally be separated by ":". - * - * @throws InvalidArgumentException When the name is invalid - */ - private function validateName(string $name) - { - if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { - throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); - } - } -} diff --git a/trunk/vendor/symfony/console/Command/CompleteCommand.php b/trunk/vendor/symfony/console/Command/CompleteCommand.php deleted file mode 100644 index 0e35143c..00000000 --- a/trunk/vendor/symfony/console/Command/CompleteCommand.php +++ /dev/null @@ -1,205 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Output\BashCompletionOutput; -use Symfony\Component\Console\Completion\Output\CompletionOutputInterface; -use Symfony\Component\Console\Exception\CommandNotFoundException; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Responsible for providing the values to the shell completion. - * - * @author Wouter de Jong - */ -final class CompleteCommand extends Command -{ - protected static $defaultName = '|_complete'; - protected static $defaultDescription = 'Internal command to provide shell completion suggestions'; - - private $completionOutputs; - - private $isDebug = false; - - /** - * @param array> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value - */ - public function __construct(array $completionOutputs = []) - { - // must be set before the parent constructor, as the property value is used in configure() - $this->completionOutputs = $completionOutputs + ['bash' => BashCompletionOutput::class]; - - parent::__construct(); - } - - protected function configure(): void - { - $this - ->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("'.implode('", "', array_keys($this->completionOutputs)).'")') - ->addOption('input', 'i', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An array of input tokens (e.g. COMP_WORDS or argv)') - ->addOption('current', 'c', InputOption::VALUE_REQUIRED, 'The index of the "input" array that the cursor is in (e.g. COMP_CWORD)') - ->addOption('symfony', 'S', InputOption::VALUE_REQUIRED, 'The version of the completion script') - ; - } - - protected function initialize(InputInterface $input, OutputInterface $output) - { - $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOLEAN); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - try { - // uncomment when a bugfix or BC break has been introduced in the shell completion scripts - // $version = $input->getOption('symfony'); - // if ($version && version_compare($version, 'x.y', '>=')) { - // $message = sprintf('Completion script version is not supported ("%s" given, ">=x.y" required).', $version); - // $this->log($message); - - // $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.'); - - // return 126; - // } - - $shell = $input->getOption('shell'); - if (!$shell) { - throw new \RuntimeException('The "--shell" option must be set.'); - } - - if (!$completionOutput = $this->completionOutputs[$shell] ?? false) { - throw new \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); - } - - $completionInput = $this->createCompletionInput($input); - $suggestions = new CompletionSuggestions(); - - $this->log([ - '', - ''.date('Y-m-d H:i:s').'', - 'Input: ("|" indicates the cursor position)', - ' '.(string) $completionInput, - 'Command:', - ' '.(string) implode(' ', $_SERVER['argv']), - 'Messages:', - ]); - - $command = $this->findCommand($completionInput, $output); - if (null === $command) { - $this->log(' No command found, completing using the Application class.'); - - $this->getApplication()->complete($completionInput, $suggestions); - } elseif ( - $completionInput->mustSuggestArgumentValuesFor('command') - && $command->getName() !== $completionInput->getCompletionValue() - && !\in_array($completionInput->getCompletionValue(), $command->getAliases(), true) - ) { - $this->log(' No command found, completing using the Application class.'); - - // expand shortcut names ("cache:cl") into their full name ("cache:clear") - $suggestions->suggestValues(array_filter(array_merge([$command->getName()], $command->getAliases()))); - } else { - $command->mergeApplicationDefinition(); - $completionInput->bind($command->getDefinition()); - - if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { - $this->log(' Completing option names for the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' command.'); - - $suggestions->suggestOptions($command->getDefinition()->getOptions()); - } else { - $this->log([ - ' Completing using the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' class.', - ' Completing '.$completionInput->getCompletionType().' for '.$completionInput->getCompletionName().'', - ]); - if (null !== $compval = $completionInput->getCompletionValue()) { - $this->log(' Current value: '.$compval.''); - } - - $command->complete($completionInput, $suggestions); - } - } - - /** @var CompletionOutputInterface $completionOutput */ - $completionOutput = new $completionOutput(); - - $this->log('Suggestions:'); - if ($options = $suggestions->getOptionSuggestions()) { - $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options))); - } elseif ($values = $suggestions->getValueSuggestions()) { - $this->log(' '.implode(' ', $values)); - } else { - $this->log(' No suggestions were provided'); - } - - $completionOutput->write($suggestions, $output); - } catch (\Throwable $e) { - $this->log([ - 'Error!', - (string) $e, - ]); - - if ($output->isDebug()) { - throw $e; - } - - return 2; - } - - return 0; - } - - private function createCompletionInput(InputInterface $input): CompletionInput - { - $currentIndex = $input->getOption('current'); - if (!$currentIndex || !ctype_digit($currentIndex)) { - throw new \RuntimeException('The "--current" option must be set and it must be an integer.'); - } - - $completionInput = CompletionInput::fromTokens($input->getOption('input'), (int) $currentIndex); - - try { - $completionInput->bind($this->getApplication()->getDefinition()); - } catch (ExceptionInterface $e) { - } - - return $completionInput; - } - - private function findCommand(CompletionInput $completionInput, OutputInterface $output): ?Command - { - try { - $inputName = $completionInput->getFirstArgument(); - if (null === $inputName) { - return null; - } - - return $this->getApplication()->find($inputName); - } catch (CommandNotFoundException $e) { - } - - return null; - } - - private function log($messages): void - { - if (!$this->isDebug) { - return; - } - - $commandName = basename($_SERVER['argv'][0]); - file_put_contents(sys_get_temp_dir().'/sf_'.$commandName.'.log', implode(\PHP_EOL, (array) $messages).\PHP_EOL, \FILE_APPEND); - } -} diff --git a/trunk/vendor/symfony/console/Command/DumpCompletionCommand.php b/trunk/vendor/symfony/console/Command/DumpCompletionCommand.php deleted file mode 100644 index eaf22be1..00000000 --- a/trunk/vendor/symfony/console/Command/DumpCompletionCommand.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\Process; - -/** - * Dumps the completion script for the current shell. - * - * @author Wouter de Jong - */ -final class DumpCompletionCommand extends Command -{ - protected static $defaultName = 'completion'; - protected static $defaultDescription = 'Dump the shell completion script'; - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestArgumentValuesFor('shell')) { - $suggestions->suggestValues($this->getSupportedShells()); - } - } - - protected function configure() - { - $fullCommand = $_SERVER['PHP_SELF']; - $commandName = basename($fullCommand); - $fullCommand = @realpath($fullCommand) ?: $fullCommand; - - $this - ->setHelp(<<%command.name% command dumps the shell completion script required -to use shell autocompletion (currently only bash completion is supported). - -Static installation -------------------- - -Dump the script to a global completion file and restart your shell: - - %command.full_name% bash | sudo tee /etc/bash_completion.d/{$commandName} - -Or dump the script to a local file and source it: - - %command.full_name% bash > completion.sh - - # source the file whenever you use the project - source completion.sh - - # or add this line at the end of your "~/.bashrc" file: - source /path/to/completion.sh - -Dynamic installation --------------------- - -Add this to the end of your shell configuration file (e.g. "~/.bashrc"): - - eval "$({$fullCommand} completion bash)" -EOH - ) - ->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given') - ->addOption('debug', null, InputOption::VALUE_NONE, 'Tail the completion debug log') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $commandName = basename($_SERVER['argv'][0]); - - if ($input->getOption('debug')) { - $this->tailDebugLog($commandName, $output); - - return 0; - } - - $shell = $input->getArgument('shell') ?? self::guessShell(); - $completionFile = __DIR__.'/../Resources/completion.'.$shell; - if (!file_exists($completionFile)) { - $supportedShells = $this->getSupportedShells(); - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - if ($shell) { - $output->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); - } else { - $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); - } - - return 2; - } - - $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, $this->getApplication()->getVersion()], file_get_contents($completionFile))); - - return 0; - } - - private static function guessShell(): string - { - return basename($_SERVER['SHELL'] ?? ''); - } - - private function tailDebugLog(string $commandName, OutputInterface $output): void - { - $debugFile = sys_get_temp_dir().'/sf_'.$commandName.'.log'; - if (!file_exists($debugFile)) { - touch($debugFile); - } - $process = new Process(['tail', '-f', $debugFile], null, null, null, 0); - $process->run(function (string $type, string $line) use ($output): void { - $output->write($line); - }); - } - - /** - * @return string[] - */ - private function getSupportedShells(): array - { - $shells = []; - - foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) { - if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) { - $shells[] = $file->getExtension(); - } - } - - return $shells; - } -} diff --git a/trunk/vendor/symfony/console/Command/HelpCommand.php b/trunk/vendor/symfony/console/Command/HelpCommand.php deleted file mode 100644 index c66ef463..00000000 --- a/trunk/vendor/symfony/console/Command/HelpCommand.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Descriptor\ApplicationDescription; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * HelpCommand displays the help for a given command. - * - * @author Fabien Potencier - */ -class HelpCommand extends Command -{ - private $command; - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->ignoreValidationErrors(); - - $this - ->setName('help') - ->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), - ]) - ->setDescription('Display help for a command') - ->setHelp(<<<'EOF' -The %command.name% command displays help for a given command: - - %command.full_name% list - -You can also output the help in other formats by using the --format option: - - %command.full_name% --format=xml list - -To display the list of available commands, please use the list command. -EOF - ) - ; - } - - public function setCommand(Command $command) - { - $this->command = $command; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - if (null === $this->command) { - $this->command = $this->getApplication()->find($input->getArgument('command_name')); - } - - $helper = new DescriptorHelper(); - $helper->describe($output, $this->command, [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - ]); - - $this->command = null; - - return 0; - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestArgumentValuesFor('command_name')) { - $descriptor = new ApplicationDescription($this->getApplication()); - $suggestions->suggestValues(array_keys($descriptor->getCommands())); - - return; - } - - if ($input->mustSuggestOptionValuesFor('format')) { - $helper = new DescriptorHelper(); - $suggestions->suggestValues($helper->getFormats()); - } - } -} diff --git a/trunk/vendor/symfony/console/Command/LazyCommand.php b/trunk/vendor/symfony/console/Command/LazyCommand.php deleted file mode 100644 index 302a0809..00000000 --- a/trunk/vendor/symfony/console/Command/LazyCommand.php +++ /dev/null @@ -1,218 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Nicolas Grekas - */ -final class LazyCommand extends Command -{ - private $command; - private $isEnabled; - - public function __construct(string $name, array $aliases, string $description, bool $isHidden, \Closure $commandFactory, ?bool $isEnabled = true) - { - $this->setName($name) - ->setAliases($aliases) - ->setHidden($isHidden) - ->setDescription($description); - - $this->command = $commandFactory; - $this->isEnabled = $isEnabled; - } - - public function ignoreValidationErrors(): void - { - $this->getCommand()->ignoreValidationErrors(); - } - - public function setApplication(?Application $application = null): void - { - if ($this->command instanceof parent) { - $this->command->setApplication($application); - } - - parent::setApplication($application); - } - - public function setHelperSet(HelperSet $helperSet): void - { - if ($this->command instanceof parent) { - $this->command->setHelperSet($helperSet); - } - - parent::setHelperSet($helperSet); - } - - public function isEnabled(): bool - { - return $this->isEnabled ?? $this->getCommand()->isEnabled(); - } - - public function run(InputInterface $input, OutputInterface $output): int - { - return $this->getCommand()->run($input, $output); - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $this->getCommand()->complete($input, $suggestions); - } - - /** - * @return $this - */ - public function setCode(callable $code): self - { - $this->getCommand()->setCode($code); - - return $this; - } - - /** - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true): void - { - $this->getCommand()->mergeApplicationDefinition($mergeArgs); - } - - /** - * @return $this - */ - public function setDefinition($definition): self - { - $this->getCommand()->setDefinition($definition); - - return $this; - } - - public function getDefinition(): InputDefinition - { - return $this->getCommand()->getDefinition(); - } - - public function getNativeDefinition(): InputDefinition - { - return $this->getCommand()->getNativeDefinition(); - } - - /** - * @return $this - */ - public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null): self - { - $this->getCommand()->addArgument($name, $mode, $description, $default); - - return $this; - } - - /** - * @return $this - */ - public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null): self - { - $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default); - - return $this; - } - - /** - * @return $this - */ - public function setProcessTitle(string $title): self - { - $this->getCommand()->setProcessTitle($title); - - return $this; - } - - /** - * @return $this - */ - public function setHelp(string $help): self - { - $this->getCommand()->setHelp($help); - - return $this; - } - - public function getHelp(): string - { - return $this->getCommand()->getHelp(); - } - - public function getProcessedHelp(): string - { - return $this->getCommand()->getProcessedHelp(); - } - - public function getSynopsis(bool $short = false): string - { - return $this->getCommand()->getSynopsis($short); - } - - /** - * @return $this - */ - public function addUsage(string $usage): self - { - $this->getCommand()->addUsage($usage); - - return $this; - } - - public function getUsages(): array - { - return $this->getCommand()->getUsages(); - } - - /** - * @return mixed - */ - public function getHelper(string $name) - { - return $this->getCommand()->getHelper($name); - } - - public function getCommand(): parent - { - if (!$this->command instanceof \Closure) { - return $this->command; - } - - $command = $this->command = ($this->command)(); - $command->setApplication($this->getApplication()); - - if (null !== $this->getHelperSet()) { - $command->setHelperSet($this->getHelperSet()); - } - - $command->setName($this->getName()) - ->setAliases($this->getAliases()) - ->setHidden($this->isHidden()) - ->setDescription($this->getDescription()); - - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - - return $command; - } -} diff --git a/trunk/vendor/symfony/console/Command/ListCommand.php b/trunk/vendor/symfony/console/Command/ListCommand.php deleted file mode 100644 index f04a4ef6..00000000 --- a/trunk/vendor/symfony/console/Command/ListCommand.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Descriptor\ApplicationDescription; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * ListCommand displays the list of all available commands for the application. - * - * @author Fabien Potencier - */ -class ListCommand extends Command -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this - ->setName('list') - ->setDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), - new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'), - ]) - ->setDescription('List commands') - ->setHelp(<<<'EOF' -The %command.name% command lists all commands: - - %command.full_name% - -You can also display the commands for a specific namespace: - - %command.full_name% test - -You can also output the information in other formats by using the --format option: - - %command.full_name% --format=xml - -It's also possible to get raw list of commands (useful for embedding command runner): - - %command.full_name% --raw -EOF - ) - ; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $helper = new DescriptorHelper(); - $helper->describe($output, $this->getApplication(), [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - 'namespace' => $input->getArgument('namespace'), - 'short' => $input->getOption('short'), - ]); - - return 0; - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestArgumentValuesFor('namespace')) { - $descriptor = new ApplicationDescription($this->getApplication()); - $suggestions->suggestValues(array_keys($descriptor->getNamespaces())); - - return; - } - - if ($input->mustSuggestOptionValuesFor('format')) { - $helper = new DescriptorHelper(); - $suggestions->suggestValues($helper->getFormats()); - } - } -} diff --git a/trunk/vendor/symfony/console/Command/LockableTrait.php b/trunk/vendor/symfony/console/Command/LockableTrait.php deleted file mode 100644 index d21edc2c..00000000 --- a/trunk/vendor/symfony/console/Command/LockableTrait.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Lock\LockFactory; -use Symfony\Component\Lock\LockInterface; -use Symfony\Component\Lock\Store\FlockStore; -use Symfony\Component\Lock\Store\SemaphoreStore; - -/** - * Basic lock feature for commands. - * - * @author Geoffrey Brier - */ -trait LockableTrait -{ - /** @var LockInterface|null */ - private $lock; - - /** - * Locks a command. - */ - private function lock(?string $name = null, bool $blocking = false): bool - { - if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component.'); - } - - if (null !== $this->lock) { - throw new LogicException('A lock is already in place.'); - } - - if (SemaphoreStore::isSupported()) { - $store = new SemaphoreStore(); - } else { - $store = new FlockStore(); - } - - $this->lock = (new LockFactory($store))->createLock($name ?: $this->getName()); - if (!$this->lock->acquire($blocking)) { - $this->lock = null; - - return false; - } - - return true; - } - - /** - * Releases the command lock if there is one. - */ - private function release() - { - if ($this->lock) { - $this->lock->release(); - $this->lock = null; - } - } -} diff --git a/trunk/vendor/symfony/console/Command/SignalableCommandInterface.php b/trunk/vendor/symfony/console/Command/SignalableCommandInterface.php deleted file mode 100644 index d439728b..00000000 --- a/trunk/vendor/symfony/console/Command/SignalableCommandInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -/** - * Interface for command reacting to signal. - * - * @author Grégoire Pineau - */ -interface SignalableCommandInterface -{ - /** - * Returns the list of signals to subscribe. - */ - public function getSubscribedSignals(): array; - - /** - * The method will be called when the application is signaled. - */ - public function handleSignal(int $signal): void; -} diff --git a/trunk/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/trunk/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php deleted file mode 100644 index 0adaf886..00000000 --- a/trunk/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Robin Chalas - */ -interface CommandLoaderInterface -{ - /** - * Loads a command. - * - * @return Command - * - * @throws CommandNotFoundException - */ - public function get(string $name); - - /** - * Checks if a command exists. - * - * @return bool - */ - public function has(string $name); - - /** - * @return string[] - */ - public function getNames(); -} diff --git a/trunk/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/trunk/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php deleted file mode 100644 index ddccb3d4..00000000 --- a/trunk/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Psr\Container\ContainerInterface; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * Loads commands from a PSR-11 container. - * - * @author Robin Chalas - */ -class ContainerCommandLoader implements CommandLoaderInterface -{ - private $container; - private $commandMap; - - /** - * @param array $commandMap An array with command names as keys and service ids as values - */ - public function __construct(ContainerInterface $container, array $commandMap) - { - $this->container = $container; - $this->commandMap = $commandMap; - } - - /** - * {@inheritdoc} - */ - public function get(string $name) - { - if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->container->get($this->commandMap[$name]); - } - - /** - * {@inheritdoc} - */ - public function has(string $name) - { - return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]); - } - - /** - * {@inheritdoc} - */ - public function getNames() - { - return array_keys($this->commandMap); - } -} diff --git a/trunk/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/trunk/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php deleted file mode 100644 index 7e2db346..00000000 --- a/trunk/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * A simple command loader using factories to instantiate commands lazily. - * - * @author Maxime Steinhausser - */ -class FactoryCommandLoader implements CommandLoaderInterface -{ - private $factories; - - /** - * @param callable[] $factories Indexed by command names - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - /** - * {@inheritdoc} - */ - public function has(string $name) - { - return isset($this->factories[$name]); - } - - /** - * {@inheritdoc} - */ - public function get(string $name) - { - if (!isset($this->factories[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - $factory = $this->factories[$name]; - - return $factory(); - } - - /** - * {@inheritdoc} - */ - public function getNames() - { - return array_keys($this->factories); - } -} diff --git a/trunk/vendor/symfony/console/Completion/CompletionInput.php b/trunk/vendor/symfony/console/Completion/CompletionInput.php deleted file mode 100644 index 2f631bcd..00000000 --- a/trunk/vendor/symfony/console/Completion/CompletionInput.php +++ /dev/null @@ -1,249 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * An input specialized for shell completion. - * - * This input allows unfinished option names or values and exposes what kind of - * completion is expected. - * - * @author Wouter de Jong - */ -final class CompletionInput extends ArgvInput -{ - public const TYPE_ARGUMENT_VALUE = 'argument_value'; - public const TYPE_OPTION_VALUE = 'option_value'; - public const TYPE_OPTION_NAME = 'option_name'; - public const TYPE_NONE = 'none'; - - private $tokens; - private $currentIndex; - private $completionType; - private $completionName = null; - private $completionValue = ''; - - /** - * Converts a terminal string into tokens. - * - * This is required for shell completions without COMP_WORDS support. - */ - public static function fromString(string $inputStr, int $currentIndex): self - { - preg_match_all('/(?<=^|\s)([\'"]?)(.+?)(?tokens = $tokens; - $input->currentIndex = $currentIndex; - - return $input; - } - - /** - * {@inheritdoc} - */ - public function bind(InputDefinition $definition): void - { - parent::bind($definition); - - $relevantToken = $this->getRelevantToken(); - if ('-' === $relevantToken[0]) { - // the current token is an input option: complete either option name or option value - [$optionToken, $optionValue] = explode('=', $relevantToken, 2) + ['', '']; - - $option = $this->getOptionFromToken($optionToken); - if (null === $option && !$this->isCursorFree()) { - $this->completionType = self::TYPE_OPTION_NAME; - $this->completionValue = $relevantToken; - - return; - } - - if (null !== $option && $option->acceptValue()) { - $this->completionType = self::TYPE_OPTION_VALUE; - $this->completionName = $option->getName(); - $this->completionValue = $optionValue ?: (!str_starts_with($optionToken, '--') ? substr($optionToken, 2) : ''); - - return; - } - } - - $previousToken = $this->tokens[$this->currentIndex - 1]; - if ('-' === $previousToken[0] && '' !== trim($previousToken, '-')) { - // check if previous option accepted a value - $previousOption = $this->getOptionFromToken($previousToken); - if (null !== $previousOption && $previousOption->acceptValue()) { - $this->completionType = self::TYPE_OPTION_VALUE; - $this->completionName = $previousOption->getName(); - $this->completionValue = $relevantToken; - - return; - } - } - - // complete argument value - $this->completionType = self::TYPE_ARGUMENT_VALUE; - - foreach ($this->definition->getArguments() as $argumentName => $argument) { - if (!isset($this->arguments[$argumentName])) { - break; - } - - $argumentValue = $this->arguments[$argumentName]; - $this->completionName = $argumentName; - if (\is_array($argumentValue)) { - $this->completionValue = $argumentValue ? $argumentValue[array_key_last($argumentValue)] : null; - } else { - $this->completionValue = $argumentValue; - } - } - - if ($this->currentIndex >= \count($this->tokens)) { - if (!isset($this->arguments[$argumentName]) || $this->definition->getArgument($argumentName)->isArray()) { - $this->completionName = $argumentName; - $this->completionValue = ''; - } else { - // we've reached the end - $this->completionType = self::TYPE_NONE; - $this->completionName = null; - $this->completionValue = ''; - } - } - } - - /** - * Returns the type of completion required. - * - * TYPE_ARGUMENT_VALUE when completing the value of an input argument - * TYPE_OPTION_VALUE when completing the value of an input option - * TYPE_OPTION_NAME when completing the name of an input option - * TYPE_NONE when nothing should be completed - * - * @return string One of self::TYPE_* constants. TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component - */ - public function getCompletionType(): string - { - return $this->completionType; - } - - /** - * The name of the input option or argument when completing a value. - * - * @return string|null returns null when completing an option name - */ - public function getCompletionName(): ?string - { - return $this->completionName; - } - - /** - * The value already typed by the user (or empty string). - */ - public function getCompletionValue(): string - { - return $this->completionValue; - } - - public function mustSuggestOptionValuesFor(string $optionName): bool - { - return self::TYPE_OPTION_VALUE === $this->getCompletionType() && $optionName === $this->getCompletionName(); - } - - public function mustSuggestArgumentValuesFor(string $argumentName): bool - { - return self::TYPE_ARGUMENT_VALUE === $this->getCompletionType() && $argumentName === $this->getCompletionName(); - } - - protected function parseToken(string $token, bool $parseOptions): bool - { - try { - return parent::parseToken($token, $parseOptions); - } catch (RuntimeException $e) { - // suppress errors, completed input is almost never valid - } - - return $parseOptions; - } - - private function getOptionFromToken(string $optionToken): ?InputOption - { - $optionName = ltrim($optionToken, '-'); - if (!$optionName) { - return null; - } - - if ('-' === ($optionToken[1] ?? ' ')) { - // long option name - return $this->definition->hasOption($optionName) ? $this->definition->getOption($optionName) : null; - } - - // short option name - return $this->definition->hasShortcut($optionName[0]) ? $this->definition->getOptionForShortcut($optionName[0]) : null; - } - - /** - * The token of the cursor, or the last token if the cursor is at the end of the input. - */ - private function getRelevantToken(): string - { - return $this->tokens[$this->isCursorFree() ? $this->currentIndex - 1 : $this->currentIndex]; - } - - /** - * Whether the cursor is "free" (i.e. at the end of the input preceded by a space). - */ - private function isCursorFree(): bool - { - $nrOfTokens = \count($this->tokens); - if ($this->currentIndex > $nrOfTokens) { - throw new \LogicException('Current index is invalid, it must be the number of input tokens or one more.'); - } - - return $this->currentIndex >= $nrOfTokens; - } - - public function __toString() - { - $str = ''; - foreach ($this->tokens as $i => $token) { - $str .= $token; - - if ($this->currentIndex === $i) { - $str .= '|'; - } - - $str .= ' '; - } - - if ($this->currentIndex > $i) { - $str .= '|'; - } - - return rtrim($str); - } -} diff --git a/trunk/vendor/symfony/console/Completion/CompletionSuggestions.php b/trunk/vendor/symfony/console/Completion/CompletionSuggestions.php deleted file mode 100644 index d8905e5e..00000000 --- a/trunk/vendor/symfony/console/Completion/CompletionSuggestions.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -use Symfony\Component\Console\Input\InputOption; - -/** - * Stores all completion suggestions for the current input. - * - * @author Wouter de Jong - */ -final class CompletionSuggestions -{ - private $valueSuggestions = []; - private $optionSuggestions = []; - - /** - * Add a suggested value for an input option or argument. - * - * @param string|Suggestion $value - * - * @return $this - */ - public function suggestValue($value): self - { - $this->valueSuggestions[] = !$value instanceof Suggestion ? new Suggestion($value) : $value; - - return $this; - } - - /** - * Add multiple suggested values at once for an input option or argument. - * - * @param list $values - * - * @return $this - */ - public function suggestValues(array $values): self - { - foreach ($values as $value) { - $this->suggestValue($value); - } - - return $this; - } - - /** - * Add a suggestion for an input option name. - * - * @return $this - */ - public function suggestOption(InputOption $option): self - { - $this->optionSuggestions[] = $option; - - return $this; - } - - /** - * Add multiple suggestions for input option names at once. - * - * @param InputOption[] $options - * - * @return $this - */ - public function suggestOptions(array $options): self - { - foreach ($options as $option) { - $this->suggestOption($option); - } - - return $this; - } - - /** - * @return InputOption[] - */ - public function getOptionSuggestions(): array - { - return $this->optionSuggestions; - } - - /** - * @return Suggestion[] - */ - public function getValueSuggestions(): array - { - return $this->valueSuggestions; - } -} diff --git a/trunk/vendor/symfony/console/Completion/Output/BashCompletionOutput.php b/trunk/vendor/symfony/console/Completion/Output/BashCompletionOutput.php deleted file mode 100644 index c6f76eb8..00000000 --- a/trunk/vendor/symfony/console/Completion/Output/BashCompletionOutput.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Wouter de Jong - */ -class BashCompletionOutput implements CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void - { - $values = $suggestions->getValueSuggestions(); - foreach ($suggestions->getOptionSuggestions() as $option) { - $values[] = '--'.$option->getName(); - if ($option->isNegatable()) { - $values[] = '--no-'.$option->getName(); - } - } - $output->writeln(implode("\n", $values)); - } -} diff --git a/trunk/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php b/trunk/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php deleted file mode 100644 index 659e5965..00000000 --- a/trunk/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Transforms the {@see CompletionSuggestions} object into output readable by the shell completion. - * - * @author Wouter de Jong - */ -interface CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void; -} diff --git a/trunk/vendor/symfony/console/Completion/Suggestion.php b/trunk/vendor/symfony/console/Completion/Suggestion.php deleted file mode 100644 index 6c7bc4dc..00000000 --- a/trunk/vendor/symfony/console/Completion/Suggestion.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -/** - * Represents a single suggested value. - * - * @author Wouter de Jong - */ -class Suggestion -{ - private $value; - - public function __construct(string $value) - { - $this->value = $value; - } - - public function getValue(): string - { - return $this->value; - } - - public function __toString(): string - { - return $this->getValue(); - } -} diff --git a/trunk/vendor/symfony/console/ConsoleEvents.php b/trunk/vendor/symfony/console/ConsoleEvents.php deleted file mode 100644 index 6ae8f32b..00000000 --- a/trunk/vendor/symfony/console/ConsoleEvents.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; - -/** - * Contains all events dispatched by an Application. - * - * @author Francesco Levorato - */ -final class ConsoleEvents -{ - /** - * The COMMAND event allows you to attach listeners before any command is - * executed by the console. It also allows you to modify the command, input and output - * before they are handed to the command. - * - * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") - */ - public const COMMAND = 'console.command'; - - /** - * The SIGNAL event allows you to perform some actions - * after the command execution was interrupted. - * - * @Event("Symfony\Component\Console\Event\ConsoleSignalEvent") - */ - public const SIGNAL = 'console.signal'; - - /** - * The TERMINATE event allows you to attach listeners after a command is - * executed by the console. - * - * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") - */ - public const TERMINATE = 'console.terminate'; - - /** - * The ERROR event occurs when an uncaught exception or error appears. - * - * This event allows you to deal with the exception/error or - * to modify the thrown exception. - * - * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") - */ - public const ERROR = 'console.error'; - - /** - * Event aliases. - * - * These aliases can be consumed by RegisterListenersPass. - */ - public const ALIASES = [ - ConsoleCommandEvent::class => self::COMMAND, - ConsoleErrorEvent::class => self::ERROR, - ConsoleSignalEvent::class => self::SIGNAL, - ConsoleTerminateEvent::class => self::TERMINATE, - ]; -} diff --git a/trunk/vendor/symfony/console/Cursor.php b/trunk/vendor/symfony/console/Cursor.php deleted file mode 100644 index 0c4dafb6..00000000 --- a/trunk/vendor/symfony/console/Cursor.php +++ /dev/null @@ -1,207 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Pierre du Plessis - */ -final class Cursor -{ - private $output; - private $input; - - /** - * @param resource|null $input - */ - public function __construct(OutputInterface $output, $input = null) - { - $this->output = $output; - $this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+')); - } - - /** - * @return $this - */ - public function moveUp(int $lines = 1): self - { - $this->output->write(sprintf("\x1b[%dA", $lines)); - - return $this; - } - - /** - * @return $this - */ - public function moveDown(int $lines = 1): self - { - $this->output->write(sprintf("\x1b[%dB", $lines)); - - return $this; - } - - /** - * @return $this - */ - public function moveRight(int $columns = 1): self - { - $this->output->write(sprintf("\x1b[%dC", $columns)); - - return $this; - } - - /** - * @return $this - */ - public function moveLeft(int $columns = 1): self - { - $this->output->write(sprintf("\x1b[%dD", $columns)); - - return $this; - } - - /** - * @return $this - */ - public function moveToColumn(int $column): self - { - $this->output->write(sprintf("\x1b[%dG", $column)); - - return $this; - } - - /** - * @return $this - */ - public function moveToPosition(int $column, int $row): self - { - $this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column)); - - return $this; - } - - /** - * @return $this - */ - public function savePosition(): self - { - $this->output->write("\x1b7"); - - return $this; - } - - /** - * @return $this - */ - public function restorePosition(): self - { - $this->output->write("\x1b8"); - - return $this; - } - - /** - * @return $this - */ - public function hide(): self - { - $this->output->write("\x1b[?25l"); - - return $this; - } - - /** - * @return $this - */ - public function show(): self - { - $this->output->write("\x1b[?25h\x1b[?0c"); - - return $this; - } - - /** - * Clears all the output from the current line. - * - * @return $this - */ - public function clearLine(): self - { - $this->output->write("\x1b[2K"); - - return $this; - } - - /** - * Clears all the output from the current line after the current position. - */ - public function clearLineAfter(): self - { - $this->output->write("\x1b[K"); - - return $this; - } - - /** - * Clears all the output from the cursors' current position to the end of the screen. - * - * @return $this - */ - public function clearOutput(): self - { - $this->output->write("\x1b[0J"); - - return $this; - } - - /** - * Clears the entire screen. - * - * @return $this - */ - public function clearScreen(): self - { - $this->output->write("\x1b[2J"); - - return $this; - } - - /** - * Returns the current cursor position as x,y coordinates. - */ - public function getCurrentPosition(): array - { - static $isTtySupported; - - if (null === $isTtySupported && \function_exists('proc_open')) { - $isTtySupported = (bool) @proc_open('echo 1 >/dev/null', [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']], $pipes); - } - - if (!$isTtySupported) { - return [1, 1]; - } - - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -icanon -echo'); - - @fwrite($this->input, "\033[6n"); - - $code = trim(fread($this->input, 1024)); - - shell_exec(sprintf('stty %s', $sttyMode)); - - sscanf($code, "\033[%d;%dR", $row, $col); - - return [$col, $row]; - } -} diff --git a/trunk/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/trunk/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php deleted file mode 100644 index 1fbb212e..00000000 --- a/trunk/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\DependencyInjection; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\LazyCommand; -use Symfony\Component\Console\CommandLoader\ContainerCommandLoader; -use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\TypedReference; - -/** - * Registers console commands. - * - * @author Grégoire Pineau - */ -class AddConsoleCommandPass implements CompilerPassInterface -{ - private $commandLoaderServiceId; - private $commandTag; - private $noPreloadTag; - private $privateTagName; - - public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command', string $noPreloadTag = 'container.no_preload', string $privateTagName = 'container.private') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/console', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->commandLoaderServiceId = $commandLoaderServiceId; - $this->commandTag = $commandTag; - $this->noPreloadTag = $noPreloadTag; - $this->privateTagName = $privateTagName; - } - - public function process(ContainerBuilder $container) - { - $commandServices = $container->findTaggedServiceIds($this->commandTag, true); - $lazyCommandMap = []; - $lazyCommandRefs = []; - $serviceIds = []; - - foreach ($commandServices as $id => $tags) { - $definition = $container->getDefinition($id); - $definition->addTag($this->noPreloadTag); - $class = $container->getParameterBag()->resolveValue($definition->getClass()); - - if (isset($tags[0]['command'])) { - $aliases = $tags[0]['command']; - } else { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); - } - $aliases = str_replace('%', '%%', $class::getDefaultName() ?? ''); - } - - $aliases = explode('|', $aliases ?? ''); - $commandName = array_shift($aliases); - - if ($isHidden = '' === $commandName) { - $commandName = array_shift($aliases); - } - - if (null === $commandName) { - if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag($this->privateTagName)) { - $commandId = 'console.command.public_alias.'.$id; - $container->setAlias($commandId, $id)->setPublic(true); - $id = $commandId; - } - $serviceIds[] = $id; - - continue; - } - - $description = $tags[0]['description'] ?? null; - - unset($tags[0]); - $lazyCommandMap[$commandName] = $id; - $lazyCommandRefs[$id] = new TypedReference($id, $class); - - foreach ($aliases as $alias) { - $lazyCommandMap[$alias] = $id; - } - - foreach ($tags as $tag) { - if (isset($tag['command'])) { - $aliases[] = $tag['command']; - $lazyCommandMap[$tag['command']] = $id; - } - - $description = $description ?? $tag['description'] ?? null; - } - - $definition->addMethodCall('setName', [$commandName]); - - if ($aliases) { - $definition->addMethodCall('setAliases', [$aliases]); - } - - if ($isHidden) { - $definition->addMethodCall('setHidden', [true]); - } - - if (!$description) { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); - } - $description = str_replace('%', '%%', $class::getDefaultDescription() ?? ''); - } - - if ($description) { - $definition->addMethodCall('setDescription', [$description]); - - $container->register('.'.$id.'.lazy', LazyCommand::class) - ->setArguments([$commandName, $aliases, $description, $isHidden, new ServiceClosureArgument($lazyCommandRefs[$id])]); - - $lazyCommandRefs[$id] = new Reference('.'.$id.'.lazy'); - } - } - - $container - ->register($this->commandLoaderServiceId, ContainerCommandLoader::class) - ->setPublic(true) - ->addTag($this->noPreloadTag) - ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); - - $container->setParameter('console.command.ids', $serviceIds); - } -} diff --git a/trunk/vendor/symfony/console/Descriptor/ApplicationDescription.php b/trunk/vendor/symfony/console/Descriptor/ApplicationDescription.php deleted file mode 100644 index eb11b4f9..00000000 --- a/trunk/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Jean-François Simon - * - * @internal - */ -class ApplicationDescription -{ - public const GLOBAL_NAMESPACE = '_global'; - - private $application; - private $namespace; - private $showHidden; - - /** - * @var array - */ - private $namespaces; - - /** - * @var array - */ - private $commands; - - /** - * @var array - */ - private $aliases; - - public function __construct(Application $application, ?string $namespace = null, bool $showHidden = false) - { - $this->application = $application; - $this->namespace = $namespace; - $this->showHidden = $showHidden; - } - - public function getNamespaces(): array - { - if (null === $this->namespaces) { - $this->inspectApplication(); - } - - return $this->namespaces; - } - - /** - * @return Command[] - */ - public function getCommands(): array - { - if (null === $this->commands) { - $this->inspectApplication(); - } - - return $this->commands; - } - - /** - * @throws CommandNotFoundException - */ - public function getCommand(string $name): Command - { - if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->commands[$name] ?? $this->aliases[$name]; - } - - private function inspectApplication() - { - $this->commands = []; - $this->namespaces = []; - - $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); - foreach ($this->sortCommands($all) as $namespace => $commands) { - $names = []; - - /** @var Command $command */ - foreach ($commands as $name => $command) { - if (!$command->getName() || (!$this->showHidden && $command->isHidden())) { - continue; - } - - if ($command->getName() === $name) { - $this->commands[$name] = $command; - } else { - $this->aliases[$name] = $command; - } - - $names[] = $name; - } - - $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names]; - } - } - - private function sortCommands(array $commands): array - { - $namespacedCommands = []; - $globalCommands = []; - $sortedCommands = []; - foreach ($commands as $name => $command) { - $key = $this->application->extractNamespace($name, 1); - if (\in_array($key, ['', self::GLOBAL_NAMESPACE], true)) { - $globalCommands[$name] = $command; - } else { - $namespacedCommands[$key][$name] = $command; - } - } - - if ($globalCommands) { - ksort($globalCommands); - $sortedCommands[self::GLOBAL_NAMESPACE] = $globalCommands; - } - - if ($namespacedCommands) { - ksort($namespacedCommands, \SORT_STRING); - foreach ($namespacedCommands as $key => $commandsSet) { - ksort($commandsSet); - $sortedCommands[$key] = $commandsSet; - } - } - - return $sortedCommands; - } -} diff --git a/trunk/vendor/symfony/console/Descriptor/Descriptor.php b/trunk/vendor/symfony/console/Descriptor/Descriptor.php deleted file mode 100644 index a3648301..00000000 --- a/trunk/vendor/symfony/console/Descriptor/Descriptor.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Jean-François Simon - * - * @internal - */ -abstract class Descriptor implements DescriptorInterface -{ - /** - * @var OutputInterface - */ - protected $output; - - /** - * {@inheritdoc} - */ - public function describe(OutputInterface $output, object $object, array $options = []) - { - $this->output = $output; - - switch (true) { - case $object instanceof InputArgument: - $this->describeInputArgument($object, $options); - break; - case $object instanceof InputOption: - $this->describeInputOption($object, $options); - break; - case $object instanceof InputDefinition: - $this->describeInputDefinition($object, $options); - break; - case $object instanceof Command: - $this->describeCommand($object, $options); - break; - case $object instanceof Application: - $this->describeApplication($object, $options); - break; - default: - throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))); - } - } - - /** - * Writes content to output. - */ - protected function write(string $content, bool $decorated = false) - { - $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); - } - - /** - * Describes an InputArgument instance. - */ - abstract protected function describeInputArgument(InputArgument $argument, array $options = []); - - /** - * Describes an InputOption instance. - */ - abstract protected function describeInputOption(InputOption $option, array $options = []); - - /** - * Describes an InputDefinition instance. - */ - abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); - - /** - * Describes a Command instance. - */ - abstract protected function describeCommand(Command $command, array $options = []); - - /** - * Describes an Application instance. - */ - abstract protected function describeApplication(Application $application, array $options = []); -} diff --git a/trunk/vendor/symfony/console/Descriptor/DescriptorInterface.php b/trunk/vendor/symfony/console/Descriptor/DescriptorInterface.php deleted file mode 100644 index ebea3036..00000000 --- a/trunk/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Descriptor interface. - * - * @author Jean-François Simon - */ -interface DescriptorInterface -{ - public function describe(OutputInterface $output, object $object, array $options = []); -} diff --git a/trunk/vendor/symfony/console/Descriptor/JsonDescriptor.php b/trunk/vendor/symfony/console/Descriptor/JsonDescriptor.php deleted file mode 100644 index 1d286594..00000000 --- a/trunk/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ /dev/null @@ -1,181 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * JSON descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class JsonDescriptor extends Descriptor -{ - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->writeData($this->getInputArgumentData($argument), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - $this->writeData($this->getInputOptionData($option), $options); - if ($option->isNegatable()) { - $this->writeData($this->getInputOptionData($option, true), $options); - } - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $this->writeData($this->getInputDefinitionData($definition), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $this->writeData($this->getCommandData($command, $options['short'] ?? false), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace, true); - $commands = []; - - foreach ($description->getCommands() as $command) { - $commands[] = $this->getCommandData($command, $options['short'] ?? false); - } - - $data = []; - if ('UNKNOWN' !== $application->getName()) { - $data['application']['name'] = $application->getName(); - if ('UNKNOWN' !== $application->getVersion()) { - $data['application']['version'] = $application->getVersion(); - } - } - - $data['commands'] = $commands; - - if ($describedNamespace) { - $data['namespace'] = $describedNamespace; - } else { - $data['namespaces'] = array_values($description->getNamespaces()); - } - - $this->writeData($data, $options); - } - - /** - * Writes data as json. - */ - private function writeData(array $data, array $options) - { - $flags = $options['json_encoding'] ?? 0; - - $this->write(json_encode($data, $flags)); - } - - private function getInputArgumentData(InputArgument $argument): array - { - return [ - 'name' => $argument->getName(), - 'is_required' => $argument->isRequired(), - 'is_array' => $argument->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()), - 'default' => \INF === $argument->getDefault() ? 'INF' : $argument->getDefault(), - ]; - } - - private function getInputOptionData(InputOption $option, bool $negated = false): array - { - return $negated ? [ - 'name' => '--no-'.$option->getName(), - 'shortcut' => '', - 'accept_value' => false, - 'is_value_required' => false, - 'is_multiple' => false, - 'description' => 'Negate the "--'.$option->getName().'" option', - 'default' => false, - ] : [ - 'name' => '--'.$option->getName(), - 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', - 'accept_value' => $option->acceptValue(), - 'is_value_required' => $option->isValueRequired(), - 'is_multiple' => $option->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()), - 'default' => \INF === $option->getDefault() ? 'INF' : $option->getDefault(), - ]; - } - - private function getInputDefinitionData(InputDefinition $definition): array - { - $inputArguments = []; - foreach ($definition->getArguments() as $name => $argument) { - $inputArguments[$name] = $this->getInputArgumentData($argument); - } - - $inputOptions = []; - foreach ($definition->getOptions() as $name => $option) { - $inputOptions[$name] = $this->getInputOptionData($option); - if ($option->isNegatable()) { - $inputOptions['no-'.$name] = $this->getInputOptionData($option, true); - } - } - - return ['arguments' => $inputArguments, 'options' => $inputOptions]; - } - - private function getCommandData(Command $command, bool $short = false): array - { - $data = [ - 'name' => $command->getName(), - 'description' => $command->getDescription(), - ]; - - if ($short) { - $data += [ - 'usage' => $command->getAliases(), - ]; - } else { - $command->mergeApplicationDefinition(false); - - $data += [ - 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), - 'help' => $command->getProcessedHelp(), - 'definition' => $this->getInputDefinitionData($command->getDefinition()), - ]; - } - - $data['hidden'] = $command->isHidden(); - - return $data; - } -} diff --git a/trunk/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/trunk/vendor/symfony/console/Descriptor/MarkdownDescriptor.php deleted file mode 100644 index 21ceca6c..00000000 --- a/trunk/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ /dev/null @@ -1,206 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Markdown descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class MarkdownDescriptor extends Descriptor -{ - /** - * {@inheritdoc} - */ - public function describe(OutputInterface $output, object $object, array $options = []) - { - $decorated = $output->isDecorated(); - $output->setDecorated(false); - - parent::describe($output, $object, $options); - - $output->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - protected function write(string $content, bool $decorated = true) - { - parent::write($content, $decorated); - } - - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->write( - '#### `'.($argument->getName() ?: '')."`\n\n" - .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '') - .'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n" - .'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`' - ); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - $name = '--'.$option->getName(); - if ($option->isNegatable()) { - $name .= '|--no-'.$option->getName(); - } - if ($option->getShortcut()) { - $name .= '|-'.str_replace('|', '|-', $option->getShortcut()).''; - } - - $this->write( - '#### `'.$name.'`'."\n\n" - .($option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $option->getDescription())."\n\n" : '') - .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n" - .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n" - .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n" - .'* Is negatable: '.($option->isNegatable() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`' - ); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - if ($showArguments = \count($definition->getArguments()) > 0) { - $this->write('### Arguments'); - foreach ($definition->getArguments() as $argument) { - $this->write("\n\n"); - if (null !== $describeInputArgument = $this->describeInputArgument($argument)) { - $this->write($describeInputArgument); - } - } - } - - if (\count($definition->getOptions()) > 0) { - if ($showArguments) { - $this->write("\n\n"); - } - - $this->write('### Options'); - foreach ($definition->getOptions() as $option) { - $this->write("\n\n"); - if (null !== $describeInputOption = $this->describeInputOption($option)) { - $this->write($describeInputOption); - } - } - } - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - if ($options['short'] ?? false) { - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce($command->getAliases(), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) - ); - - return; - } - - $command->mergeApplicationDefinition(false); - - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) - ); - - if ($help = $command->getProcessedHelp()) { - $this->write("\n"); - $this->write($help); - } - - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->write("\n\n"); - $this->describeInputDefinition($definition); - } - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - $title = $this->getApplicationTitle($application); - - $this->write($title."\n".str_repeat('=', Helper::width($title))); - - foreach ($description->getNamespaces() as $namespace) { - if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->write("\n\n"); - $this->write('**'.$namespace['id'].':**'); - } - - $this->write("\n\n"); - $this->write(implode("\n", array_map(function ($commandName) use ($description) { - return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())); - }, $namespace['commands']))); - } - - foreach ($description->getCommands() as $command) { - $this->write("\n\n"); - if (null !== $describeCommand = $this->describeCommand($command, $options)) { - $this->write($describeCommand); - } - } - } - - private function getApplicationTitle(Application $application): string - { - if ('UNKNOWN' !== $application->getName()) { - if ('UNKNOWN' !== $application->getVersion()) { - return sprintf('%s %s', $application->getName(), $application->getVersion()); - } - - return $application->getName(); - } - - return 'Console Tool'; - } -} diff --git a/trunk/vendor/symfony/console/Descriptor/TextDescriptor.php b/trunk/vendor/symfony/console/Descriptor/TextDescriptor.php deleted file mode 100644 index fbb140ae..00000000 --- a/trunk/vendor/symfony/console/Descriptor/TextDescriptor.php +++ /dev/null @@ -1,341 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * Text descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class TextDescriptor extends Descriptor -{ - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); - } else { - $default = ''; - } - - $totalWidth = $options['total_width'] ?? Helper::width($argument->getName()); - $spacingWidth = $totalWidth - \strlen($argument->getName()); - - $this->writeText(sprintf(' %s %s%s%s', - $argument->getName(), - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $argument->getDescription()), - $default - ), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); - } else { - $default = ''; - } - - $value = ''; - if ($option->acceptValue()) { - $value = '='.strtoupper($option->getName()); - - if ($option->isValueOptional()) { - $value = '['.$value.']'; - } - } - - $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); - $synopsis = sprintf('%s%s', - $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', - sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) - ); - - $spacingWidth = $totalWidth - Helper::width($synopsis); - - $this->writeText(sprintf(' %s %s%s%s%s', - $synopsis, - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $option->getDescription()), - $default, - $option->isArray() ? ' (multiple values allowed)' : '' - ), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); - foreach ($definition->getArguments() as $argument) { - $totalWidth = max($totalWidth, Helper::width($argument->getName())); - } - - if ($definition->getArguments()) { - $this->writeText('Arguments:', $options); - $this->writeText("\n"); - foreach ($definition->getArguments() as $argument) { - $this->describeInputArgument($argument, array_merge($options, ['total_width' => $totalWidth])); - $this->writeText("\n"); - } - } - - if ($definition->getArguments() && $definition->getOptions()) { - $this->writeText("\n"); - } - - if ($definition->getOptions()) { - $laterOptions = []; - - $this->writeText('Options:', $options); - foreach ($definition->getOptions() as $option) { - if (\strlen($option->getShortcut() ?? '') > 1) { - $laterOptions[] = $option; - continue; - } - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - foreach ($laterOptions as $option) { - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - } - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $command->mergeApplicationDefinition(false); - - if ($description = $command->getDescription()) { - $this->writeText('Description:', $options); - $this->writeText("\n"); - $this->writeText(' '.$description); - $this->writeText("\n\n"); - } - - $this->writeText('Usage:', $options); - foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) { - $this->writeText("\n"); - $this->writeText(' '.OutputFormatter::escape($usage), $options); - } - $this->writeText("\n"); - - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->writeText("\n"); - $this->describeInputDefinition($definition, $options); - $this->writeText("\n"); - } - - $help = $command->getProcessedHelp(); - if ($help && $help !== $description) { - $this->writeText("\n"); - $this->writeText('Help:', $options); - $this->writeText("\n"); - $this->writeText(' '.str_replace("\n", "\n ", $help), $options); - $this->writeText("\n"); - } - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - - if (isset($options['raw_text']) && $options['raw_text']) { - $width = $this->getColumnWidth($description->getCommands()); - - foreach ($description->getCommands() as $command) { - $this->writeText(sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); - $this->writeText("\n"); - } - } else { - if ('' != $help = $application->getHelp()) { - $this->writeText("$help\n\n", $options); - } - - $this->writeText("Usage:\n", $options); - $this->writeText(" command [options] [arguments]\n\n", $options); - - $this->describeInputDefinition(new InputDefinition($application->getDefinition()->getOptions()), $options); - - $this->writeText("\n"); - $this->writeText("\n"); - - $commands = $description->getCommands(); - $namespaces = $description->getNamespaces(); - if ($describedNamespace && $namespaces) { - // make sure all alias commands are included when describing a specific namespace - $describedNamespaceInfo = reset($namespaces); - foreach ($describedNamespaceInfo['commands'] as $name) { - $commands[$name] = $description->getCommand($name); - } - } - - // calculate max. width based on available commands per namespace - $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) { - return array_intersect($namespace['commands'], array_keys($commands)); - }, array_values($namespaces))))); - - if ($describedNamespace) { - $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); - } else { - $this->writeText('Available commands:', $options); - } - - foreach ($namespaces as $namespace) { - $namespace['commands'] = array_filter($namespace['commands'], function ($name) use ($commands) { - return isset($commands[$name]); - }); - - if (!$namespace['commands']) { - continue; - } - - if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->writeText("\n"); - $this->writeText(' '.$namespace['id'].'', $options); - } - - foreach ($namespace['commands'] as $name) { - $this->writeText("\n"); - $spacingWidth = $width - Helper::width($name); - $command = $commands[$name]; - $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : ''; - $this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); - } - } - - $this->writeText("\n"); - } - } - - /** - * {@inheritdoc} - */ - private function writeText(string $content, array $options = []) - { - $this->write( - isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, - isset($options['raw_output']) ? !$options['raw_output'] : true - ); - } - - /** - * Formats command aliases to show them in the command description. - */ - private function getCommandAliasesText(Command $command): string - { - $text = ''; - $aliases = $command->getAliases(); - - if ($aliases) { - $text = '['.implode('|', $aliases).'] '; - } - - return $text; - } - - /** - * Formats input option/argument default value. - * - * @param mixed $default - */ - private function formatDefaultValue($default): string - { - if (\INF === $default) { - return 'INF'; - } - - if (\is_string($default)) { - $default = OutputFormatter::escape($default); - } elseif (\is_array($default)) { - foreach ($default as $key => $value) { - if (\is_string($value)) { - $default[$key] = OutputFormatter::escape($value); - } - } - } - - return str_replace('\\\\', '\\', json_encode($default, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)); - } - - /** - * @param array $commands - */ - private function getColumnWidth(array $commands): int - { - $widths = []; - - foreach ($commands as $command) { - if ($command instanceof Command) { - $widths[] = Helper::width($command->getName()); - foreach ($command->getAliases() as $alias) { - $widths[] = Helper::width($alias); - } - } else { - $widths[] = Helper::width($command); - } - } - - return $widths ? max($widths) + 2 : 0; - } - - /** - * @param InputOption[] $options - */ - private function calculateTotalWidthForOptions(array $options): int - { - $totalWidth = 0; - foreach ($options as $option) { - // "-" + shortcut + ", --" + name - $nameLength = 1 + max(Helper::width($option->getShortcut()), 1) + 4 + Helper::width($option->getName()); - if ($option->isNegatable()) { - $nameLength += 6 + Helper::width($option->getName()); // |--no- + name - } elseif ($option->acceptValue()) { - $valueLength = 1 + Helper::width($option->getName()); // = + value - $valueLength += $option->isValueOptional() ? 2 : 0; // [ + ] - - $nameLength += $valueLength; - } - $totalWidth = max($totalWidth, $nameLength); - } - - return $totalWidth; - } -} diff --git a/trunk/vendor/symfony/console/Descriptor/XmlDescriptor.php b/trunk/vendor/symfony/console/Descriptor/XmlDescriptor.php deleted file mode 100644 index f17e5f1f..00000000 --- a/trunk/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * XML descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class XmlDescriptor extends Descriptor -{ - public function getInputDefinitionDocument(InputDefinition $definition): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($definitionXML = $dom->createElement('definition')); - - $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments')); - foreach ($definition->getArguments() as $argument) { - $this->appendDocument($argumentsXML, $this->getInputArgumentDocument($argument)); - } - - $definitionXML->appendChild($optionsXML = $dom->createElement('options')); - foreach ($definition->getOptions() as $option) { - $this->appendDocument($optionsXML, $this->getInputOptionDocument($option)); - } - - return $dom; - } - - public function getCommandDocument(Command $command, bool $short = false): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($commandXML = $dom->createElement('command')); - - $commandXML->setAttribute('id', $command->getName()); - $commandXML->setAttribute('name', $command->getName()); - $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0); - - $commandXML->appendChild($usagesXML = $dom->createElement('usages')); - - $commandXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription()))); - - if ($short) { - foreach ($command->getAliases() as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - } else { - $command->mergeApplicationDefinition(false); - - foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - - $commandXML->appendChild($helpXML = $dom->createElement('help')); - $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp()))); - - $definitionXML = $this->getInputDefinitionDocument($command->getDefinition()); - $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0)); - } - - return $dom; - } - - public function getApplicationDocument(Application $application, ?string $namespace = null, bool $short = false): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($rootXml = $dom->createElement('symfony')); - - if ('UNKNOWN' !== $application->getName()) { - $rootXml->setAttribute('name', $application->getName()); - if ('UNKNOWN' !== $application->getVersion()) { - $rootXml->setAttribute('version', $application->getVersion()); - } - } - - $rootXml->appendChild($commandsXML = $dom->createElement('commands')); - - $description = new ApplicationDescription($application, $namespace, true); - - if ($namespace) { - $commandsXML->setAttribute('namespace', $namespace); - } - - foreach ($description->getCommands() as $command) { - $this->appendDocument($commandsXML, $this->getCommandDocument($command, $short)); - } - - if (!$namespace) { - $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces')); - - foreach ($description->getNamespaces() as $namespaceDescription) { - $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace')); - $namespaceArrayXML->setAttribute('id', $namespaceDescription['id']); - - foreach ($namespaceDescription['commands'] as $name) { - $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command')); - $commandXML->appendChild($dom->createTextNode($name)); - } - } - } - - return $dom; - } - - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->writeDocument($this->getInputArgumentDocument($argument)); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - $this->writeDocument($this->getInputOptionDocument($option)); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $this->writeDocument($this->getInputDefinitionDocument($definition)); - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $this->writeDocument($this->getCommandDocument($command, $options['short'] ?? false)); - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null, $options['short'] ?? false)); - } - - /** - * Appends document children to parent node. - */ - private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) - { - foreach ($importedParent->childNodes as $childNode) { - $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); - } - } - - /** - * Writes DOM document. - */ - private function writeDocument(\DOMDocument $dom) - { - $dom->formatOutput = true; - $this->write($dom->saveXML()); - } - - private function getInputArgumentDocument(InputArgument $argument): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('argument')); - $objectXML->setAttribute('name', $argument->getName()); - $objectXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0); - $objectXML->setAttribute('is_array', $argument->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($argument->getDescription())); - - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? [var_export($argument->getDefault(), true)] : ($argument->getDefault() ? [$argument->getDefault()] : [])); - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - - return $dom; - } - - private function getInputOptionDocument(InputOption $option): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--'.$option->getName()); - $pos = strpos($option->getShortcut() ?? '', '|'); - if (false !== $pos) { - $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); - $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut())); - } else { - $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); - } - $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); - $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); - $objectXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); - - if ($option->acceptValue()) { - $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [var_export($option->getDefault(), true)] : ($option->getDefault() ? [$option->getDefault()] : [])); - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - - if (!empty($defaults)) { - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - } - } - - if ($option->isNegatable()) { - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--no-'.$option->getName()); - $objectXML->setAttribute('shortcut', ''); - $objectXML->setAttribute('accept_value', 0); - $objectXML->setAttribute('is_value_required', 0); - $objectXML->setAttribute('is_multiple', 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode('Negate the "--'.$option->getName().'" option')); - } - - return $dom; - } -} diff --git a/trunk/vendor/symfony/console/Event/ConsoleCommandEvent.php b/trunk/vendor/symfony/console/Event/ConsoleCommandEvent.php deleted file mode 100644 index 1b4f9f9b..00000000 --- a/trunk/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -/** - * Allows to do things before the command is executed, like skipping the command or executing code before the command is - * going to be executed. - * - * Changing the input arguments will have no effect. - * - * @author Fabien Potencier - */ -final class ConsoleCommandEvent extends ConsoleEvent -{ - /** - * The return code for skipped commands, this will also be passed into the terminate event. - */ - public const RETURN_CODE_DISABLED = 113; - - /** - * Indicates if the command should be run or skipped. - */ - private $commandShouldRun = true; - - /** - * Disables the command, so it won't be run. - */ - public function disableCommand(): bool - { - return $this->commandShouldRun = false; - } - - public function enableCommand(): bool - { - return $this->commandShouldRun = true; - } - - /** - * Returns true if the command is runnable, false otherwise. - */ - public function commandShouldRun(): bool - { - return $this->commandShouldRun; - } -} diff --git a/trunk/vendor/symfony/console/Event/ConsoleErrorEvent.php b/trunk/vendor/symfony/console/Event/ConsoleErrorEvent.php deleted file mode 100644 index d4c26493..00000000 --- a/trunk/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to handle throwables thrown while running a command. - * - * @author Wouter de Jong - */ -final class ConsoleErrorEvent extends ConsoleEvent -{ - private $error; - private $exitCode; - - public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, ?Command $command = null) - { - parent::__construct($command, $input, $output); - - $this->error = $error; - } - - public function getError(): \Throwable - { - return $this->error; - } - - public function setError(\Throwable $error): void - { - $this->error = $error; - } - - public function setExitCode(int $exitCode): void - { - $this->exitCode = $exitCode; - - $r = new \ReflectionProperty($this->error, 'code'); - $r->setAccessible(true); - $r->setValue($this->error, $this->exitCode); - } - - public function getExitCode(): int - { - return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); - } -} diff --git a/trunk/vendor/symfony/console/Event/ConsoleEvent.php b/trunk/vendor/symfony/console/Event/ConsoleEvent.php deleted file mode 100644 index be7937d5..00000000 --- a/trunk/vendor/symfony/console/Event/ConsoleEvent.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Allows to inspect input and output of a command. - * - * @author Francesco Levorato - */ -class ConsoleEvent extends Event -{ - protected $command; - - private $input; - private $output; - - public function __construct(?Command $command, InputInterface $input, OutputInterface $output) - { - $this->command = $command; - $this->input = $input; - $this->output = $output; - } - - /** - * Gets the command that is executed. - * - * @return Command|null - */ - public function getCommand() - { - return $this->command; - } - - /** - * Gets the input instance. - * - * @return InputInterface - */ - public function getInput() - { - return $this->input; - } - - /** - * Gets the output instance. - * - * @return OutputInterface - */ - public function getOutput() - { - return $this->output; - } -} diff --git a/trunk/vendor/symfony/console/Event/ConsoleSignalEvent.php b/trunk/vendor/symfony/console/Event/ConsoleSignalEvent.php deleted file mode 100644 index ef13ed2f..00000000 --- a/trunk/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author marie - */ -final class ConsoleSignalEvent extends ConsoleEvent -{ - private $handlingSignal; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) - { - parent::__construct($command, $input, $output); - $this->handlingSignal = $handlingSignal; - } - - public function getHandlingSignal(): int - { - return $this->handlingSignal; - } -} diff --git a/trunk/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/trunk/vendor/symfony/console/Event/ConsoleTerminateEvent.php deleted file mode 100644 index 190038d1..00000000 --- a/trunk/vendor/symfony/console/Event/ConsoleTerminateEvent.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to manipulate the exit code of a command after its execution. - * - * @author Francesco Levorato - */ -final class ConsoleTerminateEvent extends ConsoleEvent -{ - private $exitCode; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) - { - parent::__construct($command, $input, $output); - - $this->setExitCode($exitCode); - } - - public function setExitCode(int $exitCode): void - { - $this->exitCode = $exitCode; - } - - public function getExitCode(): int - { - return $this->exitCode; - } -} diff --git a/trunk/vendor/symfony/console/EventListener/ErrorListener.php b/trunk/vendor/symfony/console/EventListener/ErrorListener.php deleted file mode 100644 index e9c9e3ea..00000000 --- a/trunk/vendor/symfony/console/EventListener/ErrorListener.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\EventListener; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Console\ConsoleEvents; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * @author James Halsall - * @author Robin Chalas - */ -class ErrorListener implements EventSubscriberInterface -{ - private $logger; - - public function __construct(?LoggerInterface $logger = null) - { - $this->logger = $logger; - } - - public function onConsoleError(ConsoleErrorEvent $event) - { - if (null === $this->logger) { - return; - } - - $error = $event->getError(); - - if (!$inputString = $this->getInputString($event)) { - $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); - - return; - } - - $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); - } - - public function onConsoleTerminate(ConsoleTerminateEvent $event) - { - if (null === $this->logger) { - return; - } - - $exitCode = $event->getExitCode(); - - if (0 === $exitCode) { - return; - } - - if (!$inputString = $this->getInputString($event)) { - $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); - - return; - } - - $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); - } - - public static function getSubscribedEvents() - { - return [ - ConsoleEvents::ERROR => ['onConsoleError', -128], - ConsoleEvents::TERMINATE => ['onConsoleTerminate', -128], - ]; - } - - private static function getInputString(ConsoleEvent $event): ?string - { - $commandName = $event->getCommand() ? $event->getCommand()->getName() : null; - $input = $event->getInput(); - - if (method_exists($input, '__toString')) { - if ($commandName) { - return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input); - } - - return (string) $input; - } - - return $commandName; - } -} diff --git a/trunk/vendor/symfony/console/Exception/CommandNotFoundException.php b/trunk/vendor/symfony/console/Exception/CommandNotFoundException.php deleted file mode 100644 index 81ec318a..00000000 --- a/trunk/vendor/symfony/console/Exception/CommandNotFoundException.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect command name typed in the console. - * - * @author Jérôme Tamarelle - */ -class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface -{ - private $alternatives; - - /** - * @param string $message Exception message to throw - * @param string[] $alternatives List of similar defined names - * @param int $code Exception code - * @param \Throwable|null $previous Previous exception used for the exception chaining - */ - public function __construct(string $message, array $alternatives = [], int $code = 0, ?\Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->alternatives = $alternatives; - } - - /** - * @return string[] - */ - public function getAlternatives() - { - return $this->alternatives; - } -} diff --git a/trunk/vendor/symfony/console/Exception/ExceptionInterface.php b/trunk/vendor/symfony/console/Exception/ExceptionInterface.php deleted file mode 100644 index 1624e13d..00000000 --- a/trunk/vendor/symfony/console/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * ExceptionInterface. - * - * @author Jérôme Tamarelle - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/trunk/vendor/symfony/console/Exception/InvalidArgumentException.php b/trunk/vendor/symfony/console/Exception/InvalidArgumentException.php deleted file mode 100644 index 07cc0b61..00000000 --- a/trunk/vendor/symfony/console/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/trunk/vendor/symfony/console/Exception/InvalidOptionException.php b/trunk/vendor/symfony/console/Exception/InvalidOptionException.php deleted file mode 100644 index 5cf62792..00000000 --- a/trunk/vendor/symfony/console/Exception/InvalidOptionException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect option name or value typed in the console. - * - * @author Jérôme Tamarelle - */ -class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/trunk/vendor/symfony/console/Exception/LogicException.php b/trunk/vendor/symfony/console/Exception/LogicException.php deleted file mode 100644 index fc37b8d8..00000000 --- a/trunk/vendor/symfony/console/Exception/LogicException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/trunk/vendor/symfony/console/Exception/MissingInputException.php b/trunk/vendor/symfony/console/Exception/MissingInputException.php deleted file mode 100644 index 04f02ade..00000000 --- a/trunk/vendor/symfony/console/Exception/MissingInputException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents failure to read input from stdin. - * - * @author Gabriel Ostrolucký - */ -class MissingInputException extends RuntimeException implements ExceptionInterface -{ -} diff --git a/trunk/vendor/symfony/console/Exception/NamespaceNotFoundException.php b/trunk/vendor/symfony/console/Exception/NamespaceNotFoundException.php deleted file mode 100644 index dd16e450..00000000 --- a/trunk/vendor/symfony/console/Exception/NamespaceNotFoundException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect namespace typed in the console. - * - * @author Pierre du Plessis - */ -class NamespaceNotFoundException extends CommandNotFoundException -{ -} diff --git a/trunk/vendor/symfony/console/Exception/RuntimeException.php b/trunk/vendor/symfony/console/Exception/RuntimeException.php deleted file mode 100644 index 51d7d80a..00000000 --- a/trunk/vendor/symfony/console/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/trunk/vendor/symfony/console/Formatter/NullOutputFormatter.php b/trunk/vendor/symfony/console/Formatter/NullOutputFormatter.php deleted file mode 100644 index d770e146..00000000 --- a/trunk/vendor/symfony/console/Formatter/NullOutputFormatter.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatter implements OutputFormatterInterface -{ - private $style; - - /** - * {@inheritdoc} - */ - public function format(?string $message): ?string - { - return null; - } - - /** - * {@inheritdoc} - */ - public function getStyle(string $name): OutputFormatterStyleInterface - { - // to comply with the interface we must return a OutputFormatterStyleInterface - return $this->style ?? $this->style = new NullOutputFormatterStyle(); - } - - /** - * {@inheritdoc} - */ - public function hasStyle(string $name): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isDecorated(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setStyle(string $name, OutputFormatterStyleInterface $style): void - { - // do nothing - } -} diff --git a/trunk/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/trunk/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php deleted file mode 100644 index afd3d004..00000000 --- a/trunk/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatterStyle implements OutputFormatterStyleInterface -{ - /** - * {@inheritdoc} - */ - public function apply(string $text): string - { - return $text; - } - - /** - * {@inheritdoc} - */ - public function setBackground(?string $color = null): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setForeground(?string $color = null): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setOption(string $option): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function unsetOption(string $option): void - { - // do nothing - } -} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatter.php b/trunk/vendor/symfony/console/Formatter/OutputFormatter.php deleted file mode 100644 index 4ec60024..00000000 --- a/trunk/vendor/symfony/console/Formatter/OutputFormatter.php +++ /dev/null @@ -1,294 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -use function Symfony\Component\String\b; - -/** - * Formatter class for console output. - * - * @author Konstantin Kudryashov - * @author Roland Franssen - */ -class OutputFormatter implements WrappableOutputFormatterInterface -{ - private $decorated; - private $styles = []; - private $styleStack; - - public function __clone() - { - $this->styleStack = clone $this->styleStack; - foreach ($this->styles as $key => $value) { - $this->styles[$key] = clone $value; - } - } - - /** - * Escapes "<" and ">" special chars in given text. - * - * @return string - */ - public static function escape(string $text) - { - $text = preg_replace('/([^\\\\]|^)([<>])/', '$1\\\\$2', $text); - - return self::escapeTrailingBackslash($text); - } - - /** - * Escapes trailing "\" in given text. - * - * @internal - */ - public static function escapeTrailingBackslash(string $text): string - { - if (str_ends_with($text, '\\')) { - $len = \strlen($text); - $text = rtrim($text, '\\'); - $text = str_replace("\0", '', $text); - $text .= str_repeat("\0", $len - \strlen($text)); - } - - return $text; - } - - /** - * Initializes console output formatter. - * - * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances - */ - public function __construct(bool $decorated = false, array $styles = []) - { - $this->decorated = $decorated; - - $this->setStyle('error', new OutputFormatterStyle('white', 'red')); - $this->setStyle('info', new OutputFormatterStyle('green')); - $this->setStyle('comment', new OutputFormatterStyle('yellow')); - $this->setStyle('question', new OutputFormatterStyle('black', 'cyan')); - - foreach ($styles as $name => $style) { - $this->setStyle($name, $style); - } - - $this->styleStack = new OutputFormatterStyleStack(); - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - $this->decorated = $decorated; - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return $this->decorated; - } - - /** - * {@inheritdoc} - */ - public function setStyle(string $name, OutputFormatterStyleInterface $style) - { - $this->styles[strtolower($name)] = $style; - } - - /** - * {@inheritdoc} - */ - public function hasStyle(string $name) - { - return isset($this->styles[strtolower($name)]); - } - - /** - * {@inheritdoc} - */ - public function getStyle(string $name) - { - if (!$this->hasStyle($name)) { - throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); - } - - return $this->styles[strtolower($name)]; - } - - /** - * {@inheritdoc} - */ - public function format(?string $message) - { - return $this->formatAndWrap($message, 0); - } - - /** - * {@inheritdoc} - */ - public function formatAndWrap(?string $message, int $width) - { - if (null === $message) { - return ''; - } - - $offset = 0; - $output = ''; - $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; - $closeTagRegex = '[a-z][^<>]*+'; - $currentLineLength = 0; - preg_match_all("#<(($openTagRegex) | /($closeTagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE); - foreach ($matches[0] as $i => $match) { - $pos = $match[1]; - $text = $match[0]; - - if (0 != $pos && '\\' == $message[$pos - 1]) { - continue; - } - - // add the text up to the next tag - $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); - $offset = $pos + \strlen($text); - - // opening tag? - if ($open = '/' != $text[1]) { - $tag = $matches[1][$i][0]; - } else { - $tag = $matches[3][$i][0] ?? ''; - } - - if (!$open && !$tag) { - // - $this->styleStack->pop(); - } elseif (null === $style = $this->createStyleFromString($tag)) { - $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength); - } elseif ($open) { - $this->styleStack->push($style); - } else { - $this->styleStack->pop($style); - } - } - - $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); - - return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']); - } - - /** - * @return OutputFormatterStyleStack - */ - public function getStyleStack() - { - return $this->styleStack; - } - - /** - * Tries to create new style instance from string. - */ - private function createStyleFromString(string $string): ?OutputFormatterStyleInterface - { - if (isset($this->styles[$string])) { - return $this->styles[$string]; - } - - if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) { - return null; - } - - $style = new OutputFormatterStyle(); - foreach ($matches as $match) { - array_shift($match); - $match[0] = strtolower($match[0]); - - if ('fg' == $match[0]) { - $style->setForeground(strtolower($match[1])); - } elseif ('bg' == $match[0]) { - $style->setBackground(strtolower($match[1])); - } elseif ('href' === $match[0]) { - $url = preg_replace('{\\\\([<>])}', '$1', $match[1]); - $style->setHref($url); - } elseif ('options' === $match[0]) { - preg_match_all('([^,;]+)', strtolower($match[1]), $options); - $options = array_shift($options); - foreach ($options as $option) { - $style->setOption($option); - } - } else { - return null; - } - } - - return $style; - } - - /** - * Applies current style from stack to text, if must be applied. - */ - private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string - { - if ('' === $text) { - return ''; - } - - if (!$width) { - return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text; - } - - if (!$currentLineLength && '' !== $current) { - $text = ltrim($text); - } - - if ($currentLineLength) { - $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n"; - $text = substr($text, $i); - } else { - $prefix = ''; - } - - preg_match('~(\\n)$~', $text, $matches); - $text = $prefix.$this->addLineBreaks($text, $width); - $text = rtrim($text, "\n").($matches[1] ?? ''); - - if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) { - $text = "\n".$text; - } - - $lines = explode("\n", $text); - - foreach ($lines as $line) { - $currentLineLength += \strlen($line); - if ($width <= $currentLineLength) { - $currentLineLength = 0; - } - } - - if ($this->isDecorated()) { - foreach ($lines as $i => $line) { - $lines[$i] = $this->styleStack->getCurrent()->apply($line); - } - } - - return implode("\n", $lines); - } - - private function addLineBreaks(string $text, int $width): string - { - $encoding = mb_detect_encoding($text, null, true) ?: 'UTF-8'; - - return b($text)->toCodePointString($encoding)->wordwrap($width, "\n", true)->toByteString($encoding); - } -} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/trunk/vendor/symfony/console/Formatter/OutputFormatterInterface.php deleted file mode 100644 index 0b5f839a..00000000 --- a/trunk/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterInterface -{ - /** - * Sets the decorated flag. - */ - public function setDecorated(bool $decorated); - - /** - * Whether the output will decorate messages. - * - * @return bool - */ - public function isDecorated(); - - /** - * Sets a new style. - */ - public function setStyle(string $name, OutputFormatterStyleInterface $style); - - /** - * Checks if output formatter has style with specified name. - * - * @return bool - */ - public function hasStyle(string $name); - - /** - * Gets style options from style with specified name. - * - * @return OutputFormatterStyleInterface - * - * @throws \InvalidArgumentException When style isn't defined - */ - public function getStyle(string $name); - - /** - * Formats a message according to the given styles. - * - * @return string|null - */ - public function format(?string $message); -} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/trunk/vendor/symfony/console/Formatter/OutputFormatterStyle.php deleted file mode 100644 index d7ae6649..00000000 --- a/trunk/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Color; - -/** - * Formatter style class for defining styles. - * - * @author Konstantin Kudryashov - */ -class OutputFormatterStyle implements OutputFormatterStyleInterface -{ - private $color; - private $foreground; - private $background; - private $options; - private $href; - private $handlesHrefGracefully; - - /** - * Initializes output formatter style. - * - * @param string|null $foreground The style foreground color name - * @param string|null $background The style background color name - */ - public function __construct(?string $foreground = null, ?string $background = null, array $options = []) - { - $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); - } - - /** - * {@inheritdoc} - */ - public function setForeground(?string $color = null) - { - $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); - } - - /** - * {@inheritdoc} - */ - public function setBackground(?string $color = null) - { - $this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options); - } - - public function setHref(string $url): void - { - $this->href = $url; - } - - /** - * {@inheritdoc} - */ - public function setOption(string $option) - { - $this->options[] = $option; - $this->color = new Color($this->foreground, $this->background, $this->options); - } - - /** - * {@inheritdoc} - */ - public function unsetOption(string $option) - { - $pos = array_search($option, $this->options); - if (false !== $pos) { - unset($this->options[$pos]); - } - - $this->color = new Color($this->foreground, $this->background, $this->options); - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options) - { - $this->color = new Color($this->foreground, $this->background, $this->options = $options); - } - - /** - * {@inheritdoc} - */ - public function apply(string $text) - { - if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) - && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); - } - - if (null !== $this->href && $this->handlesHrefGracefully) { - $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; - } - - return $this->color->apply($text); - } -} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php deleted file mode 100644 index 89e4d243..00000000 --- a/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter style interface for defining styles. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterStyleInterface -{ - /** - * Sets style foreground color. - */ - public function setForeground(?string $color = null); - - /** - * Sets style background color. - */ - public function setBackground(?string $color = null); - - /** - * Sets some specific style option. - */ - public function setOption(string $option); - - /** - * Unsets some specific style option. - */ - public function unsetOption(string $option); - - /** - * Sets multiple style options at once. - */ - public function setOptions(array $options); - - /** - * Applies the style to a given text. - * - * @return string - */ - public function apply(string $text); -} diff --git a/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php deleted file mode 100644 index 1b935630..00000000 --- a/trunk/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Contracts\Service\ResetInterface; - -/** - * @author Jean-François Simon - */ -class OutputFormatterStyleStack implements ResetInterface -{ - /** - * @var OutputFormatterStyleInterface[] - */ - private $styles; - - private $emptyStyle; - - public function __construct(?OutputFormatterStyleInterface $emptyStyle = null) - { - $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); - $this->reset(); - } - - /** - * Resets stack (ie. empty internal arrays). - */ - public function reset() - { - $this->styles = []; - } - - /** - * Pushes a style in the stack. - */ - public function push(OutputFormatterStyleInterface $style) - { - $this->styles[] = $style; - } - - /** - * Pops a style from the stack. - * - * @return OutputFormatterStyleInterface - * - * @throws InvalidArgumentException When style tags incorrectly nested - */ - public function pop(?OutputFormatterStyleInterface $style = null) - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - if (null === $style) { - return array_pop($this->styles); - } - - foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { - if ($style->apply('') === $stackedStyle->apply('')) { - $this->styles = \array_slice($this->styles, 0, $index); - - return $stackedStyle; - } - } - - throw new InvalidArgumentException('Incorrectly nested style tag found.'); - } - - /** - * Computes current style with stacks top codes. - * - * @return OutputFormatterStyle - */ - public function getCurrent() - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - return $this->styles[\count($this->styles) - 1]; - } - - /** - * @return $this - */ - public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) - { - $this->emptyStyle = $emptyStyle; - - return $this; - } - - /** - * @return OutputFormatterStyleInterface - */ - public function getEmptyStyle() - { - return $this->emptyStyle; - } -} diff --git a/trunk/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/trunk/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php deleted file mode 100644 index 42319ee5..00000000 --- a/trunk/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output that supports word wrapping. - * - * @author Roland Franssen - */ -interface WrappableOutputFormatterInterface extends OutputFormatterInterface -{ - /** - * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping). - */ - public function formatAndWrap(?string $message, int $width); -} diff --git a/trunk/vendor/symfony/console/Helper/DebugFormatterHelper.php b/trunk/vendor/symfony/console/Helper/DebugFormatterHelper.php deleted file mode 100644 index e258ba05..00000000 --- a/trunk/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Helps outputting debug information when running an external program from a command. - * - * An external program can be a Process, an HTTP request, or anything else. - * - * @author Fabien Potencier - */ -class DebugFormatterHelper extends Helper -{ - private const COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; - private $started = []; - private $count = -1; - - /** - * Starts a debug formatting session. - * - * @return string - */ - public function start(string $id, string $message, string $prefix = 'RUN') - { - $this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)]; - - return sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); - } - - /** - * Adds progress to a formatting session. - * - * @return string - */ - public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR') - { - $message = ''; - - if ($error) { - if (isset($this->started[$id]['out'])) { - $message .= "\n"; - unset($this->started[$id]['out']); - } - if (!isset($this->started[$id]['err'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $errorPrefix); - $this->started[$id]['err'] = true; - } - - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); - } else { - if (isset($this->started[$id]['err'])) { - $message .= "\n"; - unset($this->started[$id]['err']); - } - if (!isset($this->started[$id]['out'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $prefix); - $this->started[$id]['out'] = true; - } - - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); - } - - return $message; - } - - /** - * Stops a formatting session. - * - * @return string - */ - public function stop(string $id, string $message, bool $successful, string $prefix = 'RES') - { - $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; - - if ($successful) { - return sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - } - - $message = sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - - unset($this->started[$id]['out'], $this->started[$id]['err']); - - return $message; - } - - private function getBorder(string $id): string - { - return sprintf(' ', self::COLORS[$this->started[$id]['border']]); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'debug_formatter'; - } -} diff --git a/trunk/vendor/symfony/console/Helper/DescriptorHelper.php b/trunk/vendor/symfony/console/Helper/DescriptorHelper.php deleted file mode 100644 index af85e9c0..00000000 --- a/trunk/vendor/symfony/console/Helper/DescriptorHelper.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Descriptor\DescriptorInterface; -use Symfony\Component\Console\Descriptor\JsonDescriptor; -use Symfony\Component\Console\Descriptor\MarkdownDescriptor; -use Symfony\Component\Console\Descriptor\TextDescriptor; -use Symfony\Component\Console\Descriptor\XmlDescriptor; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * This class adds helper method to describe objects in various formats. - * - * @author Jean-François Simon - */ -class DescriptorHelper extends Helper -{ - /** - * @var DescriptorInterface[] - */ - private $descriptors = []; - - public function __construct() - { - $this - ->register('txt', new TextDescriptor()) - ->register('xml', new XmlDescriptor()) - ->register('json', new JsonDescriptor()) - ->register('md', new MarkdownDescriptor()) - ; - } - - /** - * Describes an object if supported. - * - * Available options are: - * * format: string, the output format name - * * raw_text: boolean, sets output type as raw - * - * @throws InvalidArgumentException when the given format is not supported - */ - public function describe(OutputInterface $output, ?object $object, array $options = []) - { - $options = array_merge([ - 'raw_text' => false, - 'format' => 'txt', - ], $options); - - if (!isset($this->descriptors[$options['format']])) { - throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); - } - - $descriptor = $this->descriptors[$options['format']]; - $descriptor->describe($output, $object, $options); - } - - /** - * Registers a descriptor. - * - * @return $this - */ - public function register(string $format, DescriptorInterface $descriptor) - { - $this->descriptors[$format] = $descriptor; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'descriptor'; - } - - public function getFormats(): array - { - return array_keys($this->descriptors); - } -} diff --git a/trunk/vendor/symfony/console/Helper/Dumper.php b/trunk/vendor/symfony/console/Helper/Dumper.php deleted file mode 100644 index 605e4d70..00000000 --- a/trunk/vendor/symfony/console/Helper/Dumper.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\VarDumper\Cloner\ClonerInterface; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * @author Roland Franssen - */ -final class Dumper -{ - private $output; - private $dumper; - private $cloner; - private $handler; - - public function __construct(OutputInterface $output, ?CliDumper $dumper = null, ?ClonerInterface $cloner = null) - { - $this->output = $output; - $this->dumper = $dumper; - $this->cloner = $cloner; - - if (class_exists(CliDumper::class)) { - $this->handler = function ($var): string { - $dumper = $this->dumper ?? $this->dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); - $dumper->setColors($this->output->isDecorated()); - - return rtrim($dumper->dump(($this->cloner ?? $this->cloner = new VarCloner())->cloneVar($var)->withRefHandles(false), true)); - }; - } else { - $this->handler = function ($var): string { - switch (true) { - case null === $var: - return 'null'; - case true === $var: - return 'true'; - case false === $var: - return 'false'; - case \is_string($var): - return '"'.$var.'"'; - default: - return rtrim(print_r($var, true)); - } - }; - } - } - - public function __invoke($var): string - { - return ($this->handler)($var); - } -} diff --git a/trunk/vendor/symfony/console/Helper/FormatterHelper.php b/trunk/vendor/symfony/console/Helper/FormatterHelper.php deleted file mode 100644 index 92d8dc72..00000000 --- a/trunk/vendor/symfony/console/Helper/FormatterHelper.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * The Formatter class provides helpers to format messages. - * - * @author Fabien Potencier - */ -class FormatterHelper extends Helper -{ - /** - * Formats a message within a section. - * - * @return string - */ - public function formatSection(string $section, string $message, string $style = 'info') - { - return sprintf('<%s>[%s] %s', $style, $section, $style, $message); - } - - /** - * Formats a message as a block of text. - * - * @param string|array $messages The message to write in the block - * - * @return string - */ - public function formatBlock($messages, string $style, bool $large = false) - { - if (!\is_array($messages)) { - $messages = [$messages]; - } - - $len = 0; - $lines = []; - foreach ($messages as $message) { - $message = OutputFormatter::escape($message); - $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); - $len = max(self::width($message) + ($large ? 4 : 2), $len); - } - - $messages = $large ? [str_repeat(' ', $len)] : []; - for ($i = 0; isset($lines[$i]); ++$i) { - $messages[] = $lines[$i].str_repeat(' ', $len - self::width($lines[$i])); - } - if ($large) { - $messages[] = str_repeat(' ', $len); - } - - for ($i = 0; isset($messages[$i]); ++$i) { - $messages[$i] = sprintf('<%s>%s', $style, $messages[$i], $style); - } - - return implode("\n", $messages); - } - - /** - * Truncates a message to the given length. - * - * @return string - */ - public function truncate(string $message, int $length, string $suffix = '...') - { - $computedLength = $length - self::width($suffix); - - if ($computedLength > self::width($message)) { - return $message; - } - - return self::substr($message, 0, $length).$suffix; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'formatter'; - } -} diff --git a/trunk/vendor/symfony/console/Helper/Helper.php b/trunk/vendor/symfony/console/Helper/Helper.php deleted file mode 100644 index 6b3f7f43..00000000 --- a/trunk/vendor/symfony/console/Helper/Helper.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\String\UnicodeString; - -/** - * Helper is the base class for all helper classes. - * - * @author Fabien Potencier - */ -abstract class Helper implements HelperInterface -{ - protected $helperSet = null; - - /** - * {@inheritdoc} - */ - public function setHelperSet(?HelperSet $helperSet = null) - { - $this->helperSet = $helperSet; - } - - /** - * {@inheritdoc} - */ - public function getHelperSet() - { - return $this->helperSet; - } - - /** - * Returns the length of a string, using mb_strwidth if it is available. - * - * @deprecated since Symfony 5.3 - * - * @return int - */ - public static function strlen(?string $string) - { - trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::width() or Helper::length() instead.', __METHOD__); - - return self::width($string); - } - - /** - * Returns the width of a string, using mb_strwidth if it is available. - * The width is how many characters positions the string will use. - */ - public static function width(?string $string): int - { - $string ?? $string = ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->width(false); - } - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strwidth($string, $encoding); - } - - /** - * Returns the length of a string, using mb_strlen if it is available. - * The length is related to how many bytes the string will use. - */ - public static function length(?string $string): int - { - $string ?? $string = ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->length(); - } - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strlen($string, $encoding); - } - - /** - * Returns the subset of a string, using mb_substr if it is available. - * - * @return string - */ - public static function substr(?string $string, int $from, ?int $length = null) - { - $string ?? $string = ''; - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return substr($string, $from, $length); - } - - return mb_substr($string, $from, $length, $encoding); - } - - public static function formatTime($secs) - { - static $timeFormats = [ - [0, '< 1 sec'], - [1, '1 sec'], - [2, 'secs', 1], - [60, '1 min'], - [120, 'mins', 60], - [3600, '1 hr'], - [7200, 'hrs', 3600], - [86400, '1 day'], - [172800, 'days', 86400], - ]; - - foreach ($timeFormats as $index => $format) { - if ($secs >= $format[0]) { - if ((isset($timeFormats[$index + 1]) && $secs < $timeFormats[$index + 1][0]) - || $index == \count($timeFormats) - 1 - ) { - if (2 == \count($format)) { - return $format[1]; - } - - return floor($secs / $format[2]).' '.$format[1]; - } - } - } - } - - public static function formatMemory(int $memory) - { - if ($memory >= 1024 * 1024 * 1024) { - return sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); - } - - if ($memory >= 1024 * 1024) { - return sprintf('%.1f MiB', $memory / 1024 / 1024); - } - - if ($memory >= 1024) { - return sprintf('%d KiB', $memory / 1024); - } - - return sprintf('%d B', $memory); - } - - /** - * @deprecated since Symfony 5.3 - */ - public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, ?string $string) - { - trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::removeDecoration() instead.', __METHOD__); - - return self::width(self::removeDecoration($formatter, $string)); - } - - public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) - { - $isDecorated = $formatter->isDecorated(); - $formatter->setDecorated(false); - // remove <...> formatting - $string = $formatter->format($string ?? ''); - // remove already formatted characters - $string = preg_replace("/\033\[[^m]*m/", '', $string ?? ''); - // remove terminal hyperlinks - $string = preg_replace('/\\033]8;[^;]*;[^\\033]*\\033\\\\/', '', $string ?? ''); - $formatter->setDecorated($isDecorated); - - return $string; - } -} diff --git a/trunk/vendor/symfony/console/Helper/HelperInterface.php b/trunk/vendor/symfony/console/Helper/HelperInterface.php deleted file mode 100644 index 5bf4d632..00000000 --- a/trunk/vendor/symfony/console/Helper/HelperInterface.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * HelperInterface is the interface all helpers must implement. - * - * @author Fabien Potencier - */ -interface HelperInterface -{ - /** - * Sets the helper set associated with this helper. - */ - public function setHelperSet(?HelperSet $helperSet = null); - - /** - * Gets the helper set associated with this helper. - * - * @return HelperSet|null - */ - public function getHelperSet(); - - /** - * Returns the canonical name of this helper. - * - * @return string - */ - public function getName(); -} diff --git a/trunk/vendor/symfony/console/Helper/HelperSet.php b/trunk/vendor/symfony/console/Helper/HelperSet.php deleted file mode 100644 index c870ab99..00000000 --- a/trunk/vendor/symfony/console/Helper/HelperSet.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * HelperSet represents a set of helpers to be used with a command. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class HelperSet implements \IteratorAggregate -{ - /** @var array */ - private $helpers = []; - private $command; - - /** - * @param Helper[] $helpers An array of helper - */ - public function __construct(array $helpers = []) - { - foreach ($helpers as $alias => $helper) { - $this->set($helper, \is_int($alias) ? null : $alias); - } - } - - public function set(HelperInterface $helper, ?string $alias = null) - { - $this->helpers[$helper->getName()] = $helper; - if (null !== $alias) { - $this->helpers[$alias] = $helper; - } - - $helper->setHelperSet($this); - } - - /** - * Returns true if the helper if defined. - * - * @return bool - */ - public function has(string $name) - { - return isset($this->helpers[$name]); - } - - /** - * Gets a helper value. - * - * @return HelperInterface - * - * @throws InvalidArgumentException if the helper is not defined - */ - public function get(string $name) - { - if (!$this->has($name)) { - throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); - } - - return $this->helpers[$name]; - } - - /** - * @deprecated since Symfony 5.4 - */ - public function setCommand(?Command $command = null) - { - trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); - - $this->command = $command; - } - - /** - * Gets the command associated with this helper set. - * - * @return Command - * - * @deprecated since Symfony 5.4 - */ - public function getCommand() - { - trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); - - return $this->command; - } - - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return new \ArrayIterator($this->helpers); - } -} diff --git a/trunk/vendor/symfony/console/Helper/InputAwareHelper.php b/trunk/vendor/symfony/console/Helper/InputAwareHelper.php deleted file mode 100644 index 0d0dba23..00000000 --- a/trunk/vendor/symfony/console/Helper/InputAwareHelper.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputInterface; - -/** - * An implementation of InputAwareInterface for Helpers. - * - * @author Wouter J - */ -abstract class InputAwareHelper extends Helper implements InputAwareInterface -{ - protected $input; - - /** - * {@inheritdoc} - */ - public function setInput(InputInterface $input) - { - $this->input = $input; - } -} diff --git a/trunk/vendor/symfony/console/Helper/ProcessHelper.php b/trunk/vendor/symfony/console/Helper/ProcessHelper.php deleted file mode 100644 index 86a250b2..00000000 --- a/trunk/vendor/symfony/console/Helper/ProcessHelper.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Process; - -/** - * The ProcessHelper class provides helpers to run external processes. - * - * @author Fabien Potencier - * - * @final - */ -class ProcessHelper extends Helper -{ - /** - * Runs an external process. - * - * @param array|Process $cmd An instance of Process or an array of the command and arguments - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - */ - public function run(OutputInterface $output, $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process - { - if (!class_exists(Process::class)) { - throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); - } - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - if ($cmd instanceof Process) { - $cmd = [$cmd]; - } - - if (!\is_array($cmd)) { - throw new \TypeError(sprintf('The "command" argument of "%s()" must be an array or a "%s" instance, "%s" given.', __METHOD__, Process::class, get_debug_type($cmd))); - } - - if (\is_string($cmd[0] ?? null)) { - $process = new Process($cmd); - $cmd = []; - } elseif (($cmd[0] ?? null) instanceof Process) { - $process = $cmd[0]; - unset($cmd[0]); - } else { - throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); - } - - if ($verbosity <= $output->getVerbosity()) { - $output->write($formatter->start(spl_object_hash($process), $this->escapeString($process->getCommandLine()))); - } - - if ($output->isDebug()) { - $callback = $this->wrapCallback($output, $process, $callback); - } - - $process->run($callback, $cmd); - - if ($verbosity <= $output->getVerbosity()) { - $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode()); - $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful())); - } - - if (!$process->isSuccessful() && null !== $error) { - $output->writeln(sprintf('%s', $this->escapeString($error))); - } - - return $process; - } - - /** - * Runs the process. - * - * This is identical to run() except that an exception is thrown if the process - * exits with a non-zero exit code. - * - * @param array|Process $cmd An instance of Process or a command to run - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws ProcessFailedException - * - * @see run() - */ - public function mustRun(OutputInterface $output, $cmd, ?string $error = null, ?callable $callback = null): Process - { - $process = $this->run($output, $cmd, $error, $callback); - - if (!$process->isSuccessful()) { - throw new ProcessFailedException($process); - } - - return $process; - } - - /** - * Wraps a Process callback to add debugging output. - */ - public function wrapCallback(OutputInterface $output, Process $process, ?callable $callback = null): callable - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - return function ($type, $buffer) use ($output, $process, $callback, $formatter) { - $output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type)); - - if (null !== $callback) { - $callback($type, $buffer); - } - }; - } - - private function escapeString(string $str): string - { - return str_replace('<', '\\<', $str); - } - - /** - * {@inheritdoc} - */ - public function getName(): string - { - return 'process'; - } -} diff --git a/trunk/vendor/symfony/console/Helper/ProgressBar.php b/trunk/vendor/symfony/console/Helper/ProgressBar.php deleted file mode 100644 index 6250732e..00000000 --- a/trunk/vendor/symfony/console/Helper/ProgressBar.php +++ /dev/null @@ -1,612 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Cursor; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Terminal; - -/** - * The ProgressBar provides helpers to display progress output. - * - * @author Fabien Potencier - * @author Chris Jones - */ -final class ProgressBar -{ - public const FORMAT_VERBOSE = 'verbose'; - public const FORMAT_VERY_VERBOSE = 'very_verbose'; - public const FORMAT_DEBUG = 'debug'; - public const FORMAT_NORMAL = 'normal'; - - private const FORMAT_VERBOSE_NOMAX = 'verbose_nomax'; - private const FORMAT_VERY_VERBOSE_NOMAX = 'very_verbose_nomax'; - private const FORMAT_DEBUG_NOMAX = 'debug_nomax'; - private const FORMAT_NORMAL_NOMAX = 'normal_nomax'; - - private $barWidth = 28; - private $barChar; - private $emptyBarChar = '-'; - private $progressChar = '>'; - private $format; - private $internalFormat; - private $redrawFreq = 1; - private $writeCount; - private $lastWriteTime; - private $minSecondsBetweenRedraws = 0; - private $maxSecondsBetweenRedraws = 1; - private $output; - private $step = 0; - private $max; - private $startTime; - private $stepWidth; - private $percent = 0.0; - private $messages = []; - private $overwrite = true; - private $terminal; - private $previousMessage; - private $cursor; - - private static $formatters; - private static $formats; - - /** - * @param int $max Maximum steps (0 if unknown) - */ - public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 1 / 25) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $this->output = $output; - $this->setMaxSteps($max); - $this->terminal = new Terminal(); - - if (0 < $minSecondsBetweenRedraws) { - $this->redrawFreq = null; - $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws; - } - - if (!$this->output->isDecorated()) { - // disable overwrite when output does not support ANSI codes. - $this->overwrite = false; - - // set a reasonable redraw frequency so output isn't flooded - $this->redrawFreq = null; - } - - $this->startTime = time(); - $this->cursor = new Cursor($output); - } - - /** - * Sets a placeholder formatter for a given name. - * - * This method also allow you to override an existing placeholder. - * - * @param string $name The placeholder name (including the delimiter char like %) - * @param callable $callable A PHP callable - */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name. - * - * @param string $name The placeholder name (including the delimiter char like %) - */ - public static function getPlaceholderFormatterDefinition(string $name): ?callable - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - return self::$formatters[$name] ?? null; - } - - /** - * Sets a format for a given name. - * - * This method also allow you to override an existing format. - * - * @param string $name The format name - * @param string $format A format string - */ - public static function setFormatDefinition(string $name, string $format): void - { - if (!self::$formats) { - self::$formats = self::initFormats(); - } - - self::$formats[$name] = $format; - } - - /** - * Gets the format for a given name. - * - * @param string $name The format name - */ - public static function getFormatDefinition(string $name): ?string - { - if (!self::$formats) { - self::$formats = self::initFormats(); - } - - return self::$formats[$name] ?? null; - } - - /** - * Associates a text with a named placeholder. - * - * The text is displayed when the progress bar is rendered but only - * when the corresponding placeholder is part of the custom format line - * (by wrapping the name with %). - * - * @param string $message The text to associate with the placeholder - * @param string $name The name of the placeholder - */ - public function setMessage(string $message, string $name = 'message') - { - $this->messages[$name] = $message; - } - - /** - * @return string|null - */ - public function getMessage(string $name = 'message') - { - return $this->messages[$name] ?? null; - } - - public function getStartTime(): int - { - return $this->startTime; - } - - public function getMaxSteps(): int - { - return $this->max; - } - - public function getProgress(): int - { - return $this->step; - } - - private function getStepWidth(): int - { - return $this->stepWidth; - } - - public function getProgressPercent(): float - { - return $this->percent; - } - - public function getBarOffset(): float - { - return floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth); - } - - public function getEstimated(): float - { - if (!$this->step) { - return 0; - } - - return round((time() - $this->startTime) / $this->step * $this->max); - } - - public function getRemaining(): float - { - if (!$this->step) { - return 0; - } - - return round((time() - $this->startTime) / $this->step * ($this->max - $this->step)); - } - - public function setBarWidth(int $size) - { - $this->barWidth = max(1, $size); - } - - public function getBarWidth(): int - { - return $this->barWidth; - } - - public function setBarCharacter(string $char) - { - $this->barChar = $char; - } - - public function getBarCharacter(): string - { - return $this->barChar ?? ($this->max ? '=' : $this->emptyBarChar); - } - - public function setEmptyBarCharacter(string $char) - { - $this->emptyBarChar = $char; - } - - public function getEmptyBarCharacter(): string - { - return $this->emptyBarChar; - } - - public function setProgressCharacter(string $char) - { - $this->progressChar = $char; - } - - public function getProgressCharacter(): string - { - return $this->progressChar; - } - - public function setFormat(string $format) - { - $this->format = null; - $this->internalFormat = $format; - } - - /** - * Sets the redraw frequency. - * - * @param int|null $freq The frequency in steps - */ - public function setRedrawFrequency(?int $freq) - { - $this->redrawFreq = null !== $freq ? max(1, $freq) : null; - } - - public function minSecondsBetweenRedraws(float $seconds): void - { - $this->minSecondsBetweenRedraws = $seconds; - } - - public function maxSecondsBetweenRedraws(float $seconds): void - { - $this->maxSecondsBetweenRedraws = $seconds; - } - - /** - * Returns an iterator that will automatically update the progress bar when iterated. - * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable - */ - public function iterate(iterable $iterable, ?int $max = null): iterable - { - $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0)); - - foreach ($iterable as $key => $value) { - yield $key => $value; - - $this->advance(); - } - - $this->finish(); - } - - /** - * Starts the progress output. - * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged - */ - public function start(?int $max = null) - { - $this->startTime = time(); - $this->step = 0; - $this->percent = 0.0; - - if (null !== $max) { - $this->setMaxSteps($max); - } - - $this->display(); - } - - /** - * Advances the progress output X steps. - * - * @param int $step Number of steps to advance - */ - public function advance(int $step = 1) - { - $this->setProgress($this->step + $step); - } - - /** - * Sets whether to overwrite the progressbar, false for new line. - */ - public function setOverwrite(bool $overwrite) - { - $this->overwrite = $overwrite; - } - - public function setProgress(int $step) - { - if ($this->max && $step > $this->max) { - $this->max = $step; - } elseif ($step < 0) { - $step = 0; - } - - $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10); - $prevPeriod = (int) ($this->step / $redrawFreq); - $currPeriod = (int) ($step / $redrawFreq); - $this->step = $step; - $this->percent = $this->max ? (float) $this->step / $this->max : 0; - $timeInterval = microtime(true) - $this->lastWriteTime; - - // Draw regardless of other limits - if ($this->max === $step) { - $this->display(); - - return; - } - - // Throttling - if ($timeInterval < $this->minSecondsBetweenRedraws) { - return; - } - - // Draw each step period, but not too late - if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) { - $this->display(); - } - } - - public function setMaxSteps(int $max) - { - $this->format = null; - $this->max = max(0, $max); - $this->stepWidth = $this->max ? Helper::width((string) $this->max) : 4; - } - - /** - * Finishes the progress output. - */ - public function finish(): void - { - if (!$this->max) { - $this->max = $this->step; - } - - if ($this->step === $this->max && !$this->overwrite) { - // prevent double 100% output - return; - } - - $this->setProgress($this->max); - } - - /** - * Outputs the current progress string. - */ - public function display(): void - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite($this->buildLine()); - } - - /** - * Removes the progress bar from the current line. - * - * This is useful if you wish to write some output - * while a progress bar is running. - * Call display() to show the progress bar again. - */ - public function clear(): void - { - if (!$this->overwrite) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite(''); - } - - private function setRealFormat(string $format) - { - // try to use the _nomax variant if available - if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { - $this->format = self::getFormatDefinition($format.'_nomax'); - } elseif (null !== self::getFormatDefinition($format)) { - $this->format = self::getFormatDefinition($format); - } else { - $this->format = $format; - } - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message): void - { - if ($this->previousMessage === $message) { - return; - } - - $originalMessage = $message; - - if ($this->overwrite) { - if (null !== $this->previousMessage) { - if ($this->output instanceof ConsoleSectionOutput) { - $messageLines = explode("\n", $this->previousMessage); - $lineCount = \count($messageLines); - foreach ($messageLines as $messageLine) { - $messageLineLength = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $messageLine)); - if ($messageLineLength > $this->terminal->getWidth()) { - $lineCount += floor($messageLineLength / $this->terminal->getWidth()); - } - } - $this->output->clear($lineCount); - } else { - $lineCount = substr_count($this->previousMessage, "\n"); - for ($i = 0; $i < $lineCount; ++$i) { - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); - $this->cursor->moveUp(); - } - - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); - } - } - } elseif ($this->step > 0) { - $message = \PHP_EOL.$message; - } - - $this->previousMessage = $originalMessage; - $this->lastWriteTime = microtime(true); - - $this->output->write($message); - ++$this->writeCount; - } - - private function determineBestFormat(): string - { - switch ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - case OutputInterface::VERBOSITY_VERBOSE: - return $this->max ? self::FORMAT_VERBOSE : self::FORMAT_VERBOSE_NOMAX; - case OutputInterface::VERBOSITY_VERY_VERBOSE: - return $this->max ? self::FORMAT_VERY_VERBOSE : self::FORMAT_VERY_VERBOSE_NOMAX; - case OutputInterface::VERBOSITY_DEBUG: - return $this->max ? self::FORMAT_DEBUG : self::FORMAT_DEBUG_NOMAX; - default: - return $this->max ? self::FORMAT_NORMAL : self::FORMAT_NORMAL_NOMAX; - } - } - - private static function initPlaceholderFormatters(): array - { - return [ - 'bar' => function (self $bar, OutputInterface $output) { - $completeBars = $bar->getBarOffset(); - $display = str_repeat($bar->getBarCharacter(), $completeBars); - if ($completeBars < $bar->getBarWidth()) { - $emptyBars = $bar->getBarWidth() - $completeBars - Helper::length(Helper::removeDecoration($output->getFormatter(), $bar->getProgressCharacter())); - $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars); - } - - return $display; - }, - 'elapsed' => function (self $bar) { - return Helper::formatTime(time() - $bar->getStartTime()); - }, - 'remaining' => function (self $bar) { - if (!$bar->getMaxSteps()) { - throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); - } - - return Helper::formatTime($bar->getRemaining()); - }, - 'estimated' => function (self $bar) { - if (!$bar->getMaxSteps()) { - throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); - } - - return Helper::formatTime($bar->getEstimated()); - }, - 'memory' => function (self $bar) { - return Helper::formatMemory(memory_get_usage(true)); - }, - 'current' => function (self $bar) { - return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT); - }, - 'max' => function (self $bar) { - return $bar->getMaxSteps(); - }, - 'percent' => function (self $bar) { - return floor($bar->getProgressPercent() * 100); - }, - ]; - } - - private static function initFormats(): array - { - return [ - self::FORMAT_NORMAL => ' %current%/%max% [%bar%] %percent:3s%%', - self::FORMAT_NORMAL_NOMAX => ' %current% [%bar%]', - - self::FORMAT_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%', - self::FORMAT_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', - - self::FORMAT_VERY_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%', - self::FORMAT_VERY_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', - - self::FORMAT_DEBUG => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', - self::FORMAT_DEBUG_NOMAX => ' %current% [%bar%] %elapsed:6s% %memory:6s%', - ]; - } - - private function buildLine(): string - { - $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; - $callback = function ($matches) { - if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { - $text = $formatter($this, $this->output); - } elseif (isset($this->messages[$matches[1]])) { - $text = $this->messages[$matches[1]]; - } else { - return $matches[0]; - } - - if (isset($matches[2])) { - $text = sprintf('%'.$matches[2], $text); - } - - return $text; - }; - $line = preg_replace_callback($regex, $callback, $this->format); - - // gets string length for each sub line with multiline format - $linesLength = array_map(function ($subLine) { - return Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))); - }, explode("\n", $line)); - - $linesWidth = max($linesLength); - - $terminalWidth = $this->terminal->getWidth(); - if ($linesWidth <= $terminalWidth) { - return $line; - } - - $this->setBarWidth($this->barWidth - $linesWidth + $terminalWidth); - - return preg_replace_callback($regex, $callback, $this->format); - } -} diff --git a/trunk/vendor/symfony/console/Helper/ProgressIndicator.php b/trunk/vendor/symfony/console/Helper/ProgressIndicator.php deleted file mode 100644 index 3cc0e145..00000000 --- a/trunk/vendor/symfony/console/Helper/ProgressIndicator.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Kevin Bond - */ -class ProgressIndicator -{ - private const FORMATS = [ - 'normal' => ' %indicator% %message%', - 'normal_no_ansi' => ' %message%', - - 'verbose' => ' %indicator% %message% (%elapsed:6s%)', - 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', - - 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', - 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', - ]; - - private $output; - private $startTime; - private $format; - private $message; - private $indicatorValues; - private $indicatorCurrent; - private $indicatorChangeInterval; - private $indicatorUpdateTime; - private $started = false; - - /** - * @var array - */ - private static $formatters; - - /** - * @param int $indicatorChangeInterval Change interval in milliseconds - * @param array|null $indicatorValues Animated indicator characters - */ - public function __construct(OutputInterface $output, ?string $format = null, int $indicatorChangeInterval = 100, ?array $indicatorValues = null) - { - $this->output = $output; - - if (null === $format) { - $format = $this->determineBestFormat(); - } - - if (null === $indicatorValues) { - $indicatorValues = ['-', '\\', '|', '/']; - } - - $indicatorValues = array_values($indicatorValues); - - if (2 > \count($indicatorValues)) { - throw new InvalidArgumentException('Must have at least 2 indicator value characters.'); - } - - $this->format = self::getFormatDefinition($format); - $this->indicatorChangeInterval = $indicatorChangeInterval; - $this->indicatorValues = $indicatorValues; - $this->startTime = time(); - } - - /** - * Sets the current indicator message. - */ - public function setMessage(?string $message) - { - $this->message = $message; - - $this->display(); - } - - /** - * Starts the indicator output. - */ - public function start(string $message) - { - if ($this->started) { - throw new LogicException('Progress indicator already started.'); - } - - $this->message = $message; - $this->started = true; - $this->startTime = time(); - $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval; - $this->indicatorCurrent = 0; - - $this->display(); - } - - /** - * Advances the indicator. - */ - public function advance() - { - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - if (!$this->output->isDecorated()) { - return; - } - - $currentTime = $this->getCurrentTimeInMilliseconds(); - - if ($currentTime < $this->indicatorUpdateTime) { - return; - } - - $this->indicatorUpdateTime = $currentTime + $this->indicatorChangeInterval; - ++$this->indicatorCurrent; - - $this->display(); - } - - /** - * Finish the indicator with message. - */ - public function finish(string $message) - { - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - $this->message = $message; - $this->display(); - $this->output->writeln(''); - $this->started = false; - } - - /** - * Gets the format for a given name. - * - * @return string|null - */ - public static function getFormatDefinition(string $name) - { - return self::FORMATS[$name] ?? null; - } - - /** - * Sets a placeholder formatter for a given name. - * - * This method also allow you to override an existing placeholder. - */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable) - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name (including the delimiter char like %). - * - * @return callable|null - */ - public static function getPlaceholderFormatterDefinition(string $name) - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - return self::$formatters[$name] ?? null; - } - - private function display() - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { - if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { - return $formatter($this); - } - - return $matches[0]; - }, $this->format ?? '')); - } - - private function determineBestFormat(): string - { - switch ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - case OutputInterface::VERBOSITY_VERBOSE: - return $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi'; - case OutputInterface::VERBOSITY_VERY_VERBOSE: - case OutputInterface::VERBOSITY_DEBUG: - return $this->output->isDecorated() ? 'very_verbose' : 'very_verbose_no_ansi'; - default: - return $this->output->isDecorated() ? 'normal' : 'normal_no_ansi'; - } - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message) - { - if ($this->output->isDecorated()) { - $this->output->write("\x0D\x1B[2K"); - $this->output->write($message); - } else { - $this->output->writeln($message); - } - } - - private function getCurrentTimeInMilliseconds(): float - { - return round(microtime(true) * 1000); - } - - private static function initPlaceholderFormatters(): array - { - return [ - 'indicator' => function (self $indicator) { - return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; - }, - 'message' => function (self $indicator) { - return $indicator->message; - }, - 'elapsed' => function (self $indicator) { - return Helper::formatTime(time() - $indicator->startTime); - }, - 'memory' => function () { - return Helper::formatMemory(memory_get_usage(true)); - }, - ]; - } -} diff --git a/trunk/vendor/symfony/console/Helper/QuestionHelper.php b/trunk/vendor/symfony/console/Helper/QuestionHelper.php deleted file mode 100644 index 7b9de922..00000000 --- a/trunk/vendor/symfony/console/Helper/QuestionHelper.php +++ /dev/null @@ -1,613 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Cursor; -use Symfony\Component\Console\Exception\MissingInputException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\StreamableInputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -use function Symfony\Component\String\s; - -/** - * The QuestionHelper class provides helpers to interact with the user. - * - * @author Fabien Potencier - */ -class QuestionHelper extends Helper -{ - /** - * @var resource|null - */ - private $inputStream; - - private static $stty = true; - private static $stdinIsInteractive; - - /** - * Asks a question to the user. - * - * @return mixed The user answer - * - * @throws RuntimeException If there is no data to read in the input stream - */ - public function ask(InputInterface $input, OutputInterface $output, Question $question) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - if (!$input->isInteractive()) { - return $this->getDefaultAnswer($question); - } - - if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) { - $this->inputStream = $stream; - } - - try { - if (!$question->getValidator()) { - return $this->doAsk($output, $question); - } - - $interviewer = function () use ($output, $question) { - return $this->doAsk($output, $question); - }; - - return $this->validateAttempts($interviewer, $output, $question); - } catch (MissingInputException $exception) { - $input->setInteractive(false); - - if (null === $fallbackOutput = $this->getDefaultAnswer($question)) { - throw $exception; - } - - return $fallbackOutput; - } - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'question'; - } - - /** - * Prevents usage of stty. - */ - public static function disableStty() - { - self::$stty = false; - } - - /** - * Asks the question to the user. - * - * @return mixed - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function doAsk(OutputInterface $output, Question $question) - { - $this->writePrompt($output, $question); - - $inputStream = $this->inputStream ?: \STDIN; - $autocomplete = $question->getAutocompleterCallback(); - - if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) { - $ret = false; - if ($question->isHidden()) { - try { - $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable()); - $ret = $question->isTrimmable() ? trim($hiddenResponse) : $hiddenResponse; - } catch (RuntimeException $e) { - if (!$question->isHiddenFallback()) { - throw $e; - } - } - } - - if (false === $ret) { - $isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true; - - if (!$isBlocked) { - stream_set_blocking($inputStream, true); - } - - $ret = $this->readInput($inputStream, $question); - - if (!$isBlocked) { - stream_set_blocking($inputStream, false); - } - - if (false === $ret) { - throw new MissingInputException('Aborted.'); - } - if ($question->isTrimmable()) { - $ret = trim($ret); - } - } - } else { - $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete); - $ret = $question->isTrimmable() ? trim($autocomplete) : $autocomplete; - } - - if ($output instanceof ConsoleSectionOutput) { - $output->addContent($ret); - } - - $ret = \strlen($ret) > 0 ? $ret : $question->getDefault(); - - if ($normalizer = $question->getNormalizer()) { - return $normalizer($ret); - } - - return $ret; - } - - /** - * @return mixed - */ - private function getDefaultAnswer(Question $question) - { - $default = $question->getDefault(); - - if (null === $default) { - return $default; - } - - if ($validator = $question->getValidator()) { - return \call_user_func($question->getValidator(), $default); - } elseif ($question instanceof ChoiceQuestion) { - $choices = $question->getChoices(); - - if (!$question->isMultiselect()) { - return $choices[$default] ?? $default; - } - - $default = explode(',', $default); - foreach ($default as $k => $v) { - $v = $question->isTrimmable() ? trim($v) : $v; - $default[$k] = $choices[$v] ?? $v; - } - } - - return $default; - } - - /** - * Outputs the question prompt. - */ - protected function writePrompt(OutputInterface $output, Question $question) - { - $message = $question->getQuestion(); - - if ($question instanceof ChoiceQuestion) { - $output->writeln(array_merge([ - $question->getQuestion(), - ], $this->formatChoiceQuestionChoices($question, 'info'))); - - $message = $question->getPrompt(); - } - - $output->write($message); - } - - /** - * @return string[] - */ - protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag) - { - $messages = []; - - $maxWidth = max(array_map([__CLASS__, 'width'], array_keys($choices = $question->getChoices()))); - - foreach ($choices as $key => $value) { - $padding = str_repeat(' ', $maxWidth - self::width($key)); - - $messages[] = sprintf(" [<$tag>%s$padding] %s", $key, $value); - } - - return $messages; - } - - /** - * Outputs an error message. - */ - protected function writeError(OutputInterface $output, \Exception $error) - { - if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) { - $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'); - } else { - $message = ''.$error->getMessage().''; - } - - $output->writeln($message); - } - - /** - * Autocompletes a question. - * - * @param resource $inputStream - */ - private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string - { - $cursor = new Cursor($output, $inputStream); - - $fullChoice = ''; - $ret = ''; - - $i = 0; - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - - $sttyMode = shell_exec('stty -g'); - $isStdin = 'php://stdin' === (stream_get_meta_data($inputStream)['uri'] ?? null); - $r = [$inputStream]; - $w = []; - - // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) - shell_exec('stty -icanon -echo'); - - // Add highlighted text style - $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white')); - - // Read a keypress - while (!feof($inputStream)) { - while ($isStdin && 0 === @stream_select($r, $w, $w, 0, 100)) { - // Give signal handlers a chance to run - $r = [$inputStream]; - } - $c = fread($inputStream, 1); - - // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. - if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { - shell_exec('stty '.$sttyMode); - throw new MissingInputException('Aborted.'); - } elseif ("\177" === $c) { // Backspace Character - if (0 === $numMatches && 0 !== $i) { - --$i; - $cursor->moveLeft(s($fullChoice)->slice(-1)->width(false)); - - $fullChoice = self::substr($fullChoice, 0, $i); - } - - if (0 === $i) { - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - } else { - $numMatches = 0; - } - - // Pop the last character off the end of our string - $ret = self::substr($ret, 0, $i); - } elseif ("\033" === $c) { - // Did we read an escape sequence? - $c .= fread($inputStream, 2); - - // A = Up Arrow. B = Down Arrow - if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) { - if ('A' === $c[2] && -1 === $ofs) { - $ofs = 0; - } - - if (0 === $numMatches) { - continue; - } - - $ofs += ('A' === $c[2]) ? -1 : 1; - $ofs = ($numMatches + $ofs) % $numMatches; - } - } elseif (\ord($c) < 32) { - if ("\t" === $c || "\n" === $c) { - if ($numMatches > 0 && -1 !== $ofs) { - $ret = (string) $matches[$ofs]; - // Echo out remaining chars for current match - $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)))); - $output->write($remainingCharacters); - $fullChoice .= $remainingCharacters; - $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding); - - $matches = array_filter( - $autocomplete($ret), - function ($match) use ($ret) { - return '' === $ret || str_starts_with($match, $ret); - } - ); - $numMatches = \count($matches); - $ofs = -1; - } - - if ("\n" === $c) { - $output->write($c); - break; - } - - $numMatches = 0; - } - - continue; - } else { - if ("\x80" <= $c) { - $c .= fread($inputStream, ["\xC0" => 1, "\xD0" => 1, "\xE0" => 2, "\xF0" => 3][$c & "\xF0"]); - } - - $output->write($c); - $ret .= $c; - $fullChoice .= $c; - ++$i; - - $tempRet = $ret; - - if ($question instanceof ChoiceQuestion && $question->isMultiselect()) { - $tempRet = $this->mostRecentlyEnteredValue($fullChoice); - } - - $numMatches = 0; - $ofs = 0; - - foreach ($autocomplete($ret) as $value) { - // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if (str_starts_with($value, $tempRet)) { - $matches[$numMatches++] = $value; - } - } - } - - $cursor->clearLineAfter(); - - if ($numMatches > 0 && -1 !== $ofs) { - $cursor->savePosition(); - // Write highlighted text, complete the partially entered response - $charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))); - $output->write(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).''); - $cursor->restorePosition(); - } - } - - // Reset stty so it behaves normally again - shell_exec('stty '.$sttyMode); - - return $fullChoice; - } - - private function mostRecentlyEnteredValue(string $entered): string - { - // Determine the most recent value that the user entered - if (!str_contains($entered, ',')) { - return $entered; - } - - $choices = explode(',', $entered); - if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) { - return $lastChoice; - } - - return $entered; - } - - /** - * Gets a hidden response from user. - * - * @param resource $inputStream The handler resource - * @param bool $trimmable Is the answer trimmable - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = true): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; - - // handle code running from a phar - if ('phar:' === substr(__FILE__, 0, 5)) { - $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; - copy($exe, $tmpExe); - $exe = $tmpExe; - } - - $sExec = shell_exec('"'.$exe.'"'); - $value = $trimmable ? rtrim($sExec) : $sExec; - $output->writeln(''); - - if (isset($tmpExe)) { - unlink($tmpExe); - } - - return $value; - } - - if (self::$stty && Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -echo'); - } elseif ($this->isInteractiveInput($inputStream)) { - throw new RuntimeException('Unable to hide the response.'); - } - - $value = fgets($inputStream, 4096); - - if (self::$stty && Terminal::hasSttyAvailable()) { - shell_exec('stty '.$sttyMode); - } - - if (false === $value) { - throw new MissingInputException('Aborted.'); - } - if ($trimmable) { - $value = trim($value); - } - $output->writeln(''); - - return $value; - } - - /** - * Validates an attempt. - * - * @param callable $interviewer A callable that will ask for a question and return the result - * - * @return mixed The validated response - * - * @throws \Exception In case the max number of attempts has been reached and no valid response has been given - */ - private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question) - { - $error = null; - $attempts = $question->getMaxAttempts(); - - while (null === $attempts || $attempts--) { - if (null !== $error) { - $this->writeError($output, $error); - } - - try { - return $question->getValidator()($interviewer()); - } catch (RuntimeException $e) { - throw $e; - } catch (\Exception $error) { - } - } - - throw $error; - } - - private function isInteractiveInput($inputStream): bool - { - if ('php://stdin' !== (stream_get_meta_data($inputStream)['uri'] ?? null)) { - return false; - } - - if (null !== self::$stdinIsInteractive) { - return self::$stdinIsInteractive; - } - - return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); - } - - /** - * Reads one or more lines of input and returns what is read. - * - * @param resource $inputStream The handler resource - * @param Question $question The question being asked - * - * @return string|false The input received, false in case input could not be read - */ - private function readInput($inputStream, Question $question) - { - if (!$question->isMultiline()) { - $cp = $this->setIOCodepage(); - $ret = fgets($inputStream, 4096); - - return $this->resetIOCodepage($cp, $ret); - } - - $multiLineStreamReader = $this->cloneInputStream($inputStream); - if (null === $multiLineStreamReader) { - return false; - } - - $ret = ''; - $cp = $this->setIOCodepage(); - while (false !== ($char = fgetc($multiLineStreamReader))) { - if (\PHP_EOL === "{$ret}{$char}") { - break; - } - $ret .= $char; - } - - return $this->resetIOCodepage($cp, $ret); - } - - /** - * Sets console I/O to the host code page. - * - * @return int Previous code page in IBM/EBCDIC format - */ - private function setIOCodepage(): int - { - if (\function_exists('sapi_windows_cp_set')) { - $cp = sapi_windows_cp_get(); - sapi_windows_cp_set(sapi_windows_cp_get('oem')); - - return $cp; - } - - return 0; - } - - /** - * Sets console I/O to the specified code page and converts the user input. - * - * @param string|false $input - * - * @return string|false - */ - private function resetIOCodepage(int $cp, $input) - { - if (0 !== $cp) { - sapi_windows_cp_set($cp); - - if (false !== $input && '' !== $input) { - $input = sapi_windows_cp_conv(sapi_windows_cp_get('oem'), $cp, $input); - } - } - - return $input; - } - - /** - * Clones an input stream in order to act on one instance of the same - * stream without affecting the other instance. - * - * @param resource $inputStream The handler resource - * - * @return resource|null The cloned resource, null in case it could not be cloned - */ - private function cloneInputStream($inputStream) - { - $streamMetaData = stream_get_meta_data($inputStream); - $seekable = $streamMetaData['seekable'] ?? false; - $mode = $streamMetaData['mode'] ?? 'rb'; - $uri = $streamMetaData['uri'] ?? null; - - if (null === $uri) { - return null; - } - - $cloneStream = fopen($uri, $mode); - - // For seekable and writable streams, add all the same data to the - // cloned stream and then seek to the same offset. - if (true === $seekable && !\in_array($mode, ['r', 'rb', 'rt'])) { - $offset = ftell($inputStream); - rewind($inputStream); - stream_copy_to_stream($inputStream, $cloneStream); - fseek($inputStream, $offset); - fseek($cloneStream, $offset); - } - - return $cloneStream; - } -} diff --git a/trunk/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/trunk/vendor/symfony/console/Helper/SymfonyQuestionHelper.php deleted file mode 100644 index 01f94aba..00000000 --- a/trunk/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Style\SymfonyStyle; - -/** - * Symfony Style Guide compliant question helper. - * - * @author Kevin Bond - */ -class SymfonyQuestionHelper extends QuestionHelper -{ - /** - * {@inheritdoc} - */ - protected function writePrompt(OutputInterface $output, Question $question) - { - $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); - $default = $question->getDefault(); - - if ($question->isMultiline()) { - $text .= sprintf(' (press %s to continue)', $this->getEofShortcut()); - } - - switch (true) { - case null === $default: - $text = sprintf(' %s:', $text); - - break; - - case $question instanceof ConfirmationQuestion: - $text = sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); - - break; - - case $question instanceof ChoiceQuestion && $question->isMultiselect(): - $choices = $question->getChoices(); - $default = explode(',', $default); - - foreach ($default as $key => $value) { - $default[$key] = $choices[trim($value)]; - } - - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); - - break; - - case $question instanceof ChoiceQuestion: - $choices = $question->getChoices(); - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); - - break; - - default: - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); - } - - $output->writeln($text); - - $prompt = ' > '; - - if ($question instanceof ChoiceQuestion) { - $output->writeln($this->formatChoiceQuestionChoices($question, 'comment')); - - $prompt = $question->getPrompt(); - } - - $output->write($prompt); - } - - /** - * {@inheritdoc} - */ - protected function writeError(OutputInterface $output, \Exception $error) - { - if ($output instanceof SymfonyStyle) { - $output->newLine(); - $output->error($error->getMessage()); - - return; - } - - parent::writeError($output, $error); - } - - private function getEofShortcut(): string - { - if ('Windows' === \PHP_OS_FAMILY) { - return 'Ctrl+Z then Enter'; - } - - return 'Ctrl+D'; - } -} diff --git a/trunk/vendor/symfony/console/Helper/Table.php b/trunk/vendor/symfony/console/Helper/Table.php deleted file mode 100644 index 698f9693..00000000 --- a/trunk/vendor/symfony/console/Helper/Table.php +++ /dev/null @@ -1,917 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Provides helpers to display a table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Abdellatif Ait boudad - * @author Max Grigorian - * @author Dany Maillard - */ -class Table -{ - private const SEPARATOR_TOP = 0; - private const SEPARATOR_TOP_BOTTOM = 1; - private const SEPARATOR_MID = 2; - private const SEPARATOR_BOTTOM = 3; - private const BORDER_OUTSIDE = 0; - private const BORDER_INSIDE = 1; - - private $headerTitle; - private $footerTitle; - - /** - * Table headers. - */ - private $headers = []; - - /** - * Table rows. - */ - private $rows = []; - private $horizontal = false; - - /** - * Column widths cache. - */ - private $effectiveColumnWidths = []; - - /** - * Number of columns cache. - * - * @var int - */ - private $numberOfColumns; - - /** - * @var OutputInterface - */ - private $output; - - /** - * @var TableStyle - */ - private $style; - - /** - * @var array - */ - private $columnStyles = []; - - /** - * User set column widths. - * - * @var array - */ - private $columnWidths = []; - private $columnMaxWidths = []; - - /** - * @var array|null - */ - private static $styles; - - private $rendered = false; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - - if (!self::$styles) { - self::$styles = self::initStyles(); - } - - $this->setStyle('default'); - } - - /** - * Sets a style definition. - */ - public static function setStyleDefinition(string $name, TableStyle $style) - { - if (!self::$styles) { - self::$styles = self::initStyles(); - } - - self::$styles[$name] = $style; - } - - /** - * Gets a style definition by name. - * - * @return TableStyle - */ - public static function getStyleDefinition(string $name) - { - if (!self::$styles) { - self::$styles = self::initStyles(); - } - - if (isset(self::$styles[$name])) { - return self::$styles[$name]; - } - - throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); - } - - /** - * Sets table style. - * - * @param TableStyle|string $name The style name or a TableStyle instance - * - * @return $this - */ - public function setStyle($name) - { - $this->style = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current table style. - * - * @return TableStyle - */ - public function getStyle() - { - return $this->style; - } - - /** - * Sets table column style. - * - * @param TableStyle|string $name The style name or a TableStyle instance - * - * @return $this - */ - public function setColumnStyle(int $columnIndex, $name) - { - $this->columnStyles[$columnIndex] = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current style for a column. - * - * If style was not set, it returns the global table style. - * - * @return TableStyle - */ - public function getColumnStyle(int $columnIndex) - { - return $this->columnStyles[$columnIndex] ?? $this->getStyle(); - } - - /** - * Sets the minimum width of a column. - * - * @return $this - */ - public function setColumnWidth(int $columnIndex, int $width) - { - $this->columnWidths[$columnIndex] = $width; - - return $this; - } - - /** - * Sets the minimum width of all columns. - * - * @return $this - */ - public function setColumnWidths(array $widths) - { - $this->columnWidths = []; - foreach ($widths as $index => $width) { - $this->setColumnWidth($index, $width); - } - - return $this; - } - - /** - * Sets the maximum width of a column. - * - * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while - * formatted strings are preserved. - * - * @return $this - */ - public function setColumnMaxWidth(int $columnIndex, int $width): self - { - if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { - throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); - } - - $this->columnMaxWidths[$columnIndex] = $width; - - return $this; - } - - /** - * @return $this - */ - public function setHeaders(array $headers) - { - $headers = array_values($headers); - if (!empty($headers) && !\is_array($headers[0])) { - $headers = [$headers]; - } - - $this->headers = $headers; - - return $this; - } - - public function setRows(array $rows) - { - $this->rows = []; - - return $this->addRows($rows); - } - - /** - * @return $this - */ - public function addRows(array $rows) - { - foreach ($rows as $row) { - $this->addRow($row); - } - - return $this; - } - - /** - * @return $this - */ - public function addRow($row) - { - if ($row instanceof TableSeparator) { - $this->rows[] = $row; - - return $this; - } - - if (!\is_array($row)) { - throw new InvalidArgumentException('A row must be an array or a TableSeparator instance.'); - } - - $this->rows[] = array_values($row); - - return $this; - } - - /** - * Adds a row to the table, and re-renders the table. - * - * @return $this - */ - public function appendRow($row): self - { - if (!$this->output instanceof ConsoleSectionOutput) { - throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); - } - - if ($this->rendered) { - $this->output->clear($this->calculateRowCount()); - } - - $this->addRow($row); - $this->render(); - - return $this; - } - - /** - * @return $this - */ - public function setRow($column, array $row) - { - $this->rows[$column] = $row; - - return $this; - } - - /** - * @return $this - */ - public function setHeaderTitle(?string $title): self - { - $this->headerTitle = $title; - - return $this; - } - - /** - * @return $this - */ - public function setFooterTitle(?string $title): self - { - $this->footerTitle = $title; - - return $this; - } - - /** - * @return $this - */ - public function setHorizontal(bool $horizontal = true): self - { - $this->horizontal = $horizontal; - - return $this; - } - - /** - * Renders table to output. - * - * Example: - * - * +---------------+-----------------------+------------------+ - * | ISBN | Title | Author | - * +---------------+-----------------------+------------------+ - * | 99921-58-10-7 | Divine Comedy | Dante Alighieri | - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | - * +---------------+-----------------------+------------------+ - */ - public function render() - { - $divider = new TableSeparator(); - if ($this->horizontal) { - $rows = []; - foreach ($this->headers[0] ?? [] as $i => $header) { - $rows[$i] = [$header]; - foreach ($this->rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - if (isset($row[$i])) { - $rows[$i][] = $row[$i]; - } elseif ($rows[$i][0] instanceof TableCell && $rows[$i][0]->getColspan() >= 2) { - // Noop, there is a "title" - } else { - $rows[$i][] = null; - } - } - } - } else { - $rows = array_merge($this->headers, [$divider], $this->rows); - } - - $this->calculateNumberOfColumns($rows); - - $rowGroups = $this->buildTableRows($rows); - $this->calculateColumnsWidth($rowGroups); - - $isHeader = !$this->horizontal; - $isFirstRow = $this->horizontal; - $hasTitle = (bool) $this->headerTitle; - - foreach ($rowGroups as $rowGroup) { - $isHeaderSeparatorRendered = false; - - foreach ($rowGroup as $row) { - if ($divider === $row) { - $isHeader = false; - $isFirstRow = true; - - continue; - } - - if ($row instanceof TableSeparator) { - $this->renderRowSeparator(); - - continue; - } - - if (!$row) { - continue; - } - - if ($isHeader && !$isHeaderSeparatorRendered) { - $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $hasTitle = false; - $isHeaderSeparatorRendered = true; - } - - if ($isFirstRow) { - $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $isFirstRow = false; - $hasTitle = false; - } - - if ($this->horizontal) { - $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); - } else { - $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); - } - } - } - $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat()); - - $this->cleanup(); - $this->rendered = true; - } - - /** - * Renders horizontal header separator. - * - * Example: - * - * +-----+-----------+-------+ - */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, ?string $title = null, ?string $titleFormat = null) - { - if (0 === $count = $this->numberOfColumns) { - return; - } - - $borders = $this->style->getBorderChars(); - if (!$borders[0] && !$borders[2] && !$this->style->getCrossingChar()) { - return; - } - - $crossings = $this->style->getCrossingChars(); - if (self::SEPARATOR_MID === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]]; - } elseif (self::SEPARATOR_TOP === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]]; - } elseif (self::SEPARATOR_TOP_BOTTOM === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]]; - } else { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]]; - } - - $markup = $leftChar; - for ($column = 0; $column < $count; ++$column) { - $markup .= str_repeat($horizontal, $this->effectiveColumnWidths[$column]); - $markup .= $column === $count - 1 ? $rightChar : $midChar; - } - - if (null !== $title) { - $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title))); - $markupLength = Helper::width($markup); - if ($titleLength > $limit = $markupLength - 4) { - $titleLength = $limit; - $formatLength = Helper::width(Helper::removeDecoration($formatter, sprintf($titleFormat, ''))); - $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); - } - - $titleStart = intdiv($markupLength - $titleLength, 2); - if (false === mb_detect_encoding($markup, null, true)) { - $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength); - } else { - $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength); - } - } - - $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); - } - - /** - * Renders vertical column separator. - */ - private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string - { - $borders = $this->style->getBorderChars(); - - return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); - } - - /** - * Renders table row. - * - * Example: - * - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - */ - private function renderRow(array $row, string $cellFormat, ?string $firstCellFormat = null) - { - $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); - $columns = $this->getRowColumns($row); - $last = \count($columns) - 1; - foreach ($columns as $i => $column) { - if ($firstCellFormat && 0 === $i) { - $rowContent .= $this->renderCell($row, $column, $firstCellFormat); - } else { - $rowContent .= $this->renderCell($row, $column, $cellFormat); - } - $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE); - } - $this->output->writeln($rowContent); - } - - /** - * Renders table cell with padding. - */ - private function renderCell(array $row, int $column, string $cellFormat): string - { - $cell = $row[$column] ?? ''; - $width = $this->effectiveColumnWidths[$column]; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // add the width of the following columns(numbers of colspan). - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) { - $width += $this->getColumnSeparatorWidth() + $this->effectiveColumnWidths[$nextColumn]; - } - } - - // str_pad won't work properly with multi-byte strings, we need to fix the padding - if (false !== $encoding = mb_detect_encoding($cell, null, true)) { - $width += \strlen($cell) - mb_strwidth($cell, $encoding); - } - - $style = $this->getColumnStyle($column); - - if ($cell instanceof TableSeparator) { - return sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); - } - - $width += Helper::length($cell) - Helper::length(Helper::removeDecoration($this->output->getFormatter(), $cell)); - $content = sprintf($style->getCellRowContentFormat(), $cell); - - $padType = $style->getPadType(); - if ($cell instanceof TableCell && $cell->getStyle() instanceof TableCellStyle) { - $isNotStyledByTag = !preg_match('/^<(\w+|(\w+=[\w,]+;?)*)>.+<\/(\w+|(\w+=\w+;?)*)?>$/', $cell); - if ($isNotStyledByTag) { - $cellFormat = $cell->getStyle()->getCellFormat(); - if (!\is_string($cellFormat)) { - $tag = http_build_query($cell->getStyle()->getTagOptions(), '', ';'); - $cellFormat = '<'.$tag.'>%s'; - } - - if (strstr($content, '')) { - $content = str_replace('', '', $content); - $width -= 3; - } - if (strstr($content, '')) { - $content = str_replace('', '', $content); - $width -= \strlen(''); - } - } - - $padType = $cell->getStyle()->getPadByAlign(); - } - - return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); - } - - /** - * Calculate number of columns for this table. - */ - private function calculateNumberOfColumns(array $rows) - { - $columns = [0]; - foreach ($rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - $columns[] = $this->getNumberOfColumns($row); - } - - $this->numberOfColumns = max($columns); - } - - private function buildTableRows(array $rows): TableRows - { - /** @var WrappableOutputFormatterInterface $formatter */ - $formatter = $this->output->getFormatter(); - $unmergedRows = []; - for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) { - $rows = $this->fillNextRows($rows, $rowKey); - - // Remove any new line breaks and replace it with a new line - foreach ($rows[$rowKey] as $column => $cell) { - $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1; - - if (isset($this->columnMaxWidths[$column]) && Helper::width(Helper::removeDecoration($formatter, $cell)) > $this->columnMaxWidths[$column]) { - $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan); - } - if (!strstr($cell ?? '', "\n")) { - continue; - } - $eol = str_contains($cell ?? '', "\r\n") ? "\r\n" : "\n"; - $escaped = implode($eol, array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode($eol, $cell))); - $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; - $lines = explode($eol, str_replace($eol, ''.$eol, $cell)); - foreach ($lines as $lineKey => $line) { - if ($colspan > 1) { - $line = new TableCell($line, ['colspan' => $colspan]); - } - if (0 === $lineKey) { - $rows[$rowKey][$column] = $line; - } else { - if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) { - $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey); - } - $unmergedRows[$rowKey][$lineKey][$column] = $line; - } - } - } - } - - return new TableRows(function () use ($rows, $unmergedRows): \Traversable { - foreach ($rows as $rowKey => $row) { - $rowGroup = [$row instanceof TableSeparator ? $row : $this->fillCells($row)]; - - if (isset($unmergedRows[$rowKey])) { - foreach ($unmergedRows[$rowKey] as $row) { - $rowGroup[] = $row instanceof TableSeparator ? $row : $this->fillCells($row); - } - } - yield $rowGroup; - } - }); - } - - private function calculateRowCount(): int - { - $numberOfRows = \count(iterator_to_array($this->buildTableRows(array_merge($this->headers, [new TableSeparator()], $this->rows)))); - - if ($this->headers) { - ++$numberOfRows; // Add row for header separator - } - - if (\count($this->rows) > 0) { - ++$numberOfRows; // Add row for footer separator - } - - return $numberOfRows; - } - - /** - * fill rows that contains rowspan > 1. - * - * @throws InvalidArgumentException - */ - private function fillNextRows(array $rows, int $line): array - { - $unmergedRows = []; - foreach ($rows[$line] as $column => $cell) { - if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { - throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); - } - if ($cell instanceof TableCell && $cell->getRowspan() > 1) { - $nbLines = $cell->getRowspan() - 1; - $lines = [$cell]; - if (strstr($cell, "\n")) { - $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; - $lines = explode($eol, str_replace($eol, ''.$eol.'', $cell)); - $nbLines = \count($lines) > $nbLines ? substr_count($cell, $eol) : $nbLines; - - $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); - unset($lines[0]); - } - - // create a two dimensional array (rowspan x colspan) - $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows); - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - $value = $lines[$unmergedRowKey - $line] ?? ''; - $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); - if ($nbLines === $unmergedRowKey - $line) { - break; - } - } - } - } - - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - // we need to know if $unmergedRow will be merged or inserted into $rows - if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) { - foreach ($unmergedRow as $cellKey => $cell) { - // insert cell into row at cellKey position - array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]); - } - } else { - $row = $this->copyRow($rows, $unmergedRowKey - 1); - foreach ($unmergedRow as $column => $cell) { - if (!empty($cell)) { - $row[$column] = $unmergedRow[$column]; - } - } - array_splice($rows, $unmergedRowKey, 0, [$row]); - } - } - - return $rows; - } - - /** - * fill cells for a row that contains colspan > 1. - */ - private function fillCells(iterable $row) - { - $newRow = []; - - foreach ($row as $column => $cell) { - $newRow[] = $cell; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) { - // insert empty value at column position - $newRow[] = ''; - } - } - } - - return $newRow ?: $row; - } - - private function copyRow(array $rows, int $line): array - { - $row = $rows[$line]; - foreach ($row as $cellKey => $cellValue) { - $row[$cellKey] = ''; - if ($cellValue instanceof TableCell) { - $row[$cellKey] = new TableCell('', ['colspan' => $cellValue->getColspan()]); - } - } - - return $row; - } - - /** - * Gets number of columns by row. - */ - private function getNumberOfColumns(array $row): int - { - $columns = \count($row); - foreach ($row as $column) { - $columns += $column instanceof TableCell ? ($column->getColspan() - 1) : 0; - } - - return $columns; - } - - /** - * Gets list of columns for the given row. - */ - private function getRowColumns(array $row): array - { - $columns = range(0, $this->numberOfColumns - 1); - foreach ($row as $cellKey => $cell) { - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // exclude grouped columns. - $columns = array_diff($columns, range($cellKey + 1, $cellKey + $cell->getColspan() - 1)); - } - } - - return $columns; - } - - /** - * Calculates columns widths. - */ - private function calculateColumnsWidth(iterable $groups) - { - for ($column = 0; $column < $this->numberOfColumns; ++$column) { - $lengths = []; - foreach ($groups as $group) { - foreach ($group as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - foreach ($row as $i => $cell) { - if ($cell instanceof TableCell) { - $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); - $textLength = Helper::width($textContent); - if ($textLength > 0) { - $contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan())); - foreach ($contentColumns as $position => $content) { - $row[$i + $position] = $content; - } - } - } - } - - $lengths[] = $this->getCellWidth($row, $column); - } - } - - $this->effectiveColumnWidths[$column] = max($lengths) + Helper::width($this->style->getCellRowContentFormat()) - 2; - } - } - - private function getColumnSeparatorWidth(): int - { - return Helper::width(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); - } - - private function getCellWidth(array $row, int $column): int - { - $cellWidth = 0; - - if (isset($row[$column])) { - $cell = $row[$column]; - $cellWidth = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $cell)); - } - - $columnWidth = $this->columnWidths[$column] ?? 0; - $cellWidth = max($cellWidth, $columnWidth); - - return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth; - } - - /** - * Called after rendering to cleanup cache data. - */ - private function cleanup() - { - $this->effectiveColumnWidths = []; - $this->numberOfColumns = null; - } - - /** - * @return array - */ - private static function initStyles(): array - { - $borderless = new TableStyle(); - $borderless - ->setHorizontalBorderChars('=') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ; - - $compact = new TableStyle(); - $compact - ->setHorizontalBorderChars('') - ->setVerticalBorderChars('') - ->setDefaultCrossingChar('') - ->setCellRowContentFormat('%s ') - ; - - $styleGuide = new TableStyle(); - $styleGuide - ->setHorizontalBorderChars('-') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ->setCellHeaderFormat('%s') - ; - - $box = (new TableStyle()) - ->setHorizontalBorderChars('─') - ->setVerticalBorderChars('│') - ->setCrossingChars('┼', '┌', '┬', '┐', '┤', '┘', '┴', '└', '├') - ; - - $boxDouble = (new TableStyle()) - ->setHorizontalBorderChars('═', '─') - ->setVerticalBorderChars('║', '│') - ->setCrossingChars('┼', '╔', '╤', '╗', '╢', '╝', '╧', '╚', '╟', '╠', '╪', '╣') - ; - - return [ - 'default' => new TableStyle(), - 'borderless' => $borderless, - 'compact' => $compact, - 'symfony-style-guide' => $styleGuide, - 'box' => $box, - 'box-double' => $boxDouble, - ]; - } - - private function resolveStyle($name): TableStyle - { - if ($name instanceof TableStyle) { - return $name; - } - - if (isset(self::$styles[$name])) { - return self::$styles[$name]; - } - - throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); - } -} diff --git a/trunk/vendor/symfony/console/Helper/TableCell.php b/trunk/vendor/symfony/console/Helper/TableCell.php deleted file mode 100644 index 1a7bc6ed..00000000 --- a/trunk/vendor/symfony/console/Helper/TableCell.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Abdellatif Ait boudad - */ -class TableCell -{ - private $value; - private $options = [ - 'rowspan' => 1, - 'colspan' => 1, - 'style' => null, - ]; - - public function __construct(string $value = '', array $options = []) - { - $this->value = $value; - - // check option names - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - if (isset($options['style']) && !$options['style'] instanceof TableCellStyle) { - throw new InvalidArgumentException('The style option must be an instance of "TableCellStyle".'); - } - - $this->options = array_merge($this->options, $options); - } - - /** - * Returns the cell value. - * - * @return string - */ - public function __toString() - { - return $this->value; - } - - /** - * Gets number of colspan. - * - * @return int - */ - public function getColspan() - { - return (int) $this->options['colspan']; - } - - /** - * Gets number of rowspan. - * - * @return int - */ - public function getRowspan() - { - return (int) $this->options['rowspan']; - } - - public function getStyle(): ?TableCellStyle - { - return $this->options['style']; - } -} diff --git a/trunk/vendor/symfony/console/Helper/TableCellStyle.php b/trunk/vendor/symfony/console/Helper/TableCellStyle.php deleted file mode 100644 index 19cd0ffc..00000000 --- a/trunk/vendor/symfony/console/Helper/TableCellStyle.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Yewhen Khoptynskyi - */ -class TableCellStyle -{ - public const DEFAULT_ALIGN = 'left'; - - private const TAG_OPTIONS = [ - 'fg', - 'bg', - 'options', - ]; - - private const ALIGN_MAP = [ - 'left' => \STR_PAD_RIGHT, - 'center' => \STR_PAD_BOTH, - 'right' => \STR_PAD_LEFT, - ]; - - private $options = [ - 'fg' => 'default', - 'bg' => 'default', - 'options' => null, - 'align' => self::DEFAULT_ALIGN, - 'cellFormat' => null, - ]; - - public function __construct(array $options = []) - { - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - if (isset($options['align']) && !\array_key_exists($options['align'], self::ALIGN_MAP)) { - throw new InvalidArgumentException(sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); - } - - $this->options = array_merge($this->options, $options); - } - - public function getOptions(): array - { - return $this->options; - } - - /** - * Gets options we need for tag for example fg, bg. - * - * @return string[] - */ - public function getTagOptions() - { - return array_filter( - $this->getOptions(), - function ($key) { - return \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]); - }, - \ARRAY_FILTER_USE_KEY - ); - } - - /** - * @return int - */ - public function getPadByAlign() - { - return self::ALIGN_MAP[$this->getOptions()['align']]; - } - - public function getCellFormat(): ?string - { - return $this->getOptions()['cellFormat']; - } -} diff --git a/trunk/vendor/symfony/console/Helper/TableRows.php b/trunk/vendor/symfony/console/Helper/TableRows.php deleted file mode 100644 index cbc07d29..00000000 --- a/trunk/vendor/symfony/console/Helper/TableRows.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * @internal - */ -class TableRows implements \IteratorAggregate -{ - private $generator; - - public function __construct(\Closure $generator) - { - $this->generator = $generator; - } - - public function getIterator(): \Traversable - { - return ($this->generator)(); - } -} diff --git a/trunk/vendor/symfony/console/Helper/TableSeparator.php b/trunk/vendor/symfony/console/Helper/TableSeparator.php deleted file mode 100644 index e541c531..00000000 --- a/trunk/vendor/symfony/console/Helper/TableSeparator.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Marks a row as being a separator. - * - * @author Fabien Potencier - */ -class TableSeparator extends TableCell -{ - public function __construct(array $options = []) - { - parent::__construct('', $options); - } -} diff --git a/trunk/vendor/symfony/console/Helper/TableStyle.php b/trunk/vendor/symfony/console/Helper/TableStyle.php deleted file mode 100644 index 0643c79e..00000000 --- a/trunk/vendor/symfony/console/Helper/TableStyle.php +++ /dev/null @@ -1,376 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Defines the styles for a Table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Dany Maillard - */ -class TableStyle -{ - private $paddingChar = ' '; - private $horizontalOutsideBorderChar = '-'; - private $horizontalInsideBorderChar = '-'; - private $verticalOutsideBorderChar = '|'; - private $verticalInsideBorderChar = '|'; - private $crossingChar = '+'; - private $crossingTopRightChar = '+'; - private $crossingTopMidChar = '+'; - private $crossingTopLeftChar = '+'; - private $crossingMidRightChar = '+'; - private $crossingBottomRightChar = '+'; - private $crossingBottomMidChar = '+'; - private $crossingBottomLeftChar = '+'; - private $crossingMidLeftChar = '+'; - private $crossingTopLeftBottomChar = '+'; - private $crossingTopMidBottomChar = '+'; - private $crossingTopRightBottomChar = '+'; - private $headerTitleFormat = ' %s '; - private $footerTitleFormat = ' %s '; - private $cellHeaderFormat = '%s'; - private $cellRowFormat = '%s'; - private $cellRowContentFormat = ' %s '; - private $borderFormat = '%s'; - private $padType = \STR_PAD_RIGHT; - - /** - * Sets padding character, used for cell padding. - * - * @return $this - */ - public function setPaddingChar(string $paddingChar) - { - if (!$paddingChar) { - throw new LogicException('The padding char must not be empty.'); - } - - $this->paddingChar = $paddingChar; - - return $this; - } - - /** - * Gets padding character, used for cell padding. - * - * @return string - */ - public function getPaddingChar() - { - return $this->paddingChar; - } - - /** - * Sets horizontal border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * 1 ISBN 2 Title │ Author ║ - * ╠═══════════════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @return $this - */ - public function setHorizontalBorderChars(string $outside, ?string $inside = null): self - { - $this->horizontalOutsideBorderChar = $outside; - $this->horizontalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Sets vertical border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * ║ ISBN │ Title │ Author ║ - * ╠═══════1═══════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ╟───────2───────┼──────────────────────────┼──────────────────╢ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @return $this - */ - public function setVerticalBorderChars(string $outside, ?string $inside = null): self - { - $this->verticalOutsideBorderChar = $outside; - $this->verticalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Gets border characters. - * - * @internal - */ - public function getBorderChars(): array - { - return [ - $this->horizontalOutsideBorderChar, - $this->verticalOutsideBorderChar, - $this->horizontalInsideBorderChar, - $this->verticalInsideBorderChar, - ]; - } - - /** - * Sets crossing characters. - * - * Example: - * - * 1═══════════════2══════════════════════════2══════════════════3 - * ║ ISBN │ Title │ Author ║ - * 8'══════════════0'═════════════════════════0'═════════════════4' - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * 8───────────────0──────────────────────────0──────────────────4 - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * 7═══════════════6══════════════════════════6══════════════════5 - * - * - * @param string $cross Crossing char (see #0 of example) - * @param string $topLeft Top left char (see #1 of example) - * @param string $topMid Top mid char (see #2 of example) - * @param string $topRight Top right char (see #3 of example) - * @param string $midRight Mid right char (see #4 of example) - * @param string $bottomRight Bottom right char (see #5 of example) - * @param string $bottomMid Bottom mid char (see #6 of example) - * @param string $bottomLeft Bottom left char (see #7 of example) - * @param string $midLeft Mid left char (see #8 of example) - * @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null - * @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null - * @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null - * - * @return $this - */ - public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, ?string $topLeftBottom = null, ?string $topMidBottom = null, ?string $topRightBottom = null): self - { - $this->crossingChar = $cross; - $this->crossingTopLeftChar = $topLeft; - $this->crossingTopMidChar = $topMid; - $this->crossingTopRightChar = $topRight; - $this->crossingMidRightChar = $midRight; - $this->crossingBottomRightChar = $bottomRight; - $this->crossingBottomMidChar = $bottomMid; - $this->crossingBottomLeftChar = $bottomLeft; - $this->crossingMidLeftChar = $midLeft; - $this->crossingTopLeftBottomChar = $topLeftBottom ?? $midLeft; - $this->crossingTopMidBottomChar = $topMidBottom ?? $cross; - $this->crossingTopRightBottomChar = $topRightBottom ?? $midRight; - - return $this; - } - - /** - * Sets default crossing character used for each cross. - * - * @see {@link setCrossingChars()} for setting each crossing individually. - */ - public function setDefaultCrossingChar(string $char): self - { - return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char); - } - - /** - * Gets crossing character. - * - * @return string - */ - public function getCrossingChar() - { - return $this->crossingChar; - } - - /** - * Gets crossing characters. - * - * @internal - */ - public function getCrossingChars(): array - { - return [ - $this->crossingChar, - $this->crossingTopLeftChar, - $this->crossingTopMidChar, - $this->crossingTopRightChar, - $this->crossingMidRightChar, - $this->crossingBottomRightChar, - $this->crossingBottomMidChar, - $this->crossingBottomLeftChar, - $this->crossingMidLeftChar, - $this->crossingTopLeftBottomChar, - $this->crossingTopMidBottomChar, - $this->crossingTopRightBottomChar, - ]; - } - - /** - * Sets header cell format. - * - * @return $this - */ - public function setCellHeaderFormat(string $cellHeaderFormat) - { - $this->cellHeaderFormat = $cellHeaderFormat; - - return $this; - } - - /** - * Gets header cell format. - * - * @return string - */ - public function getCellHeaderFormat() - { - return $this->cellHeaderFormat; - } - - /** - * Sets row cell format. - * - * @return $this - */ - public function setCellRowFormat(string $cellRowFormat) - { - $this->cellRowFormat = $cellRowFormat; - - return $this; - } - - /** - * Gets row cell format. - * - * @return string - */ - public function getCellRowFormat() - { - return $this->cellRowFormat; - } - - /** - * Sets row cell content format. - * - * @return $this - */ - public function setCellRowContentFormat(string $cellRowContentFormat) - { - $this->cellRowContentFormat = $cellRowContentFormat; - - return $this; - } - - /** - * Gets row cell content format. - * - * @return string - */ - public function getCellRowContentFormat() - { - return $this->cellRowContentFormat; - } - - /** - * Sets table border format. - * - * @return $this - */ - public function setBorderFormat(string $borderFormat) - { - $this->borderFormat = $borderFormat; - - return $this; - } - - /** - * Gets table border format. - * - * @return string - */ - public function getBorderFormat() - { - return $this->borderFormat; - } - - /** - * Sets cell padding type. - * - * @return $this - */ - public function setPadType(int $padType) - { - if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) { - throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); - } - - $this->padType = $padType; - - return $this; - } - - /** - * Gets cell padding type. - * - * @return int - */ - public function getPadType() - { - return $this->padType; - } - - public function getHeaderTitleFormat(): string - { - return $this->headerTitleFormat; - } - - /** - * @return $this - */ - public function setHeaderTitleFormat(string $format): self - { - $this->headerTitleFormat = $format; - - return $this; - } - - public function getFooterTitleFormat(): string - { - return $this->footerTitleFormat; - } - - /** - * @return $this - */ - public function setFooterTitleFormat(string $format): self - { - $this->footerTitleFormat = $format; - - return $this; - } -} diff --git a/trunk/vendor/symfony/console/Input/ArgvInput.php b/trunk/vendor/symfony/console/Input/ArgvInput.php deleted file mode 100644 index 0c4b2d25..00000000 --- a/trunk/vendor/symfony/console/Input/ArgvInput.php +++ /dev/null @@ -1,378 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * ArgvInput represents an input coming from the CLI arguments. - * - * Usage: - * - * $input = new ArgvInput(); - * - * By default, the `$_SERVER['argv']` array is used for the input values. - * - * This can be overridden by explicitly passing the input values in the constructor: - * - * $input = new ArgvInput($_SERVER['argv']); - * - * If you pass it yourself, don't forget that the first element of the array - * is the name of the running application. - * - * When passing an argument to the constructor, be sure that it respects - * the same rules as the argv one. It's almost always better to use the - * `StringInput` when you want to provide your own input. - * - * @author Fabien Potencier - * - * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 - */ -class ArgvInput extends Input -{ - private $tokens; - private $parsed; - - public function __construct(?array $argv = null, ?InputDefinition $definition = null) - { - $argv = $argv ?? $_SERVER['argv'] ?? []; - - // strip the application name - array_shift($argv); - - $this->tokens = $argv; - - parent::__construct($definition); - } - - protected function setTokens(array $tokens) - { - $this->tokens = $tokens; - } - - /** - * {@inheritdoc} - */ - protected function parse() - { - $parseOptions = true; - $this->parsed = $this->tokens; - while (null !== $token = array_shift($this->parsed)) { - $parseOptions = $this->parseToken($token, $parseOptions); - } - } - - protected function parseToken(string $token, bool $parseOptions): bool - { - if ($parseOptions && '' == $token) { - $this->parseArgument($token); - } elseif ($parseOptions && '--' == $token) { - return false; - } elseif ($parseOptions && str_starts_with($token, '--')) { - $this->parseLongOption($token); - } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { - $this->parseShortOption($token); - } else { - $this->parseArgument($token); - } - - return $parseOptions; - } - - /** - * Parses a short option. - */ - private function parseShortOption(string $token) - { - $name = substr($token, 1); - - if (\strlen($name) > 1) { - if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { - // an option with a value (with no space) - $this->addShortOption($name[0], substr($name, 1)); - } else { - $this->parseShortOptionSet($name); - } - } else { - $this->addShortOption($name, null); - } - } - - /** - * Parses a short option set. - * - * @throws RuntimeException When option given doesn't exist - */ - private function parseShortOptionSet(string $name) - { - $len = \strlen($name); - for ($i = 0; $i < $len; ++$i) { - if (!$this->definition->hasShortcut($name[$i])) { - $encoding = mb_detect_encoding($name, null, true); - throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); - } - - $option = $this->definition->getOptionForShortcut($name[$i]); - if ($option->acceptValue()) { - $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); - - break; - } else { - $this->addLongOption($option->getName(), null); - } - } - } - - /** - * Parses a long option. - */ - private function parseLongOption(string $token) - { - $name = substr($token, 2); - - if (false !== $pos = strpos($name, '=')) { - if ('' === $value = substr($name, $pos + 1)) { - array_unshift($this->parsed, $value); - } - $this->addLongOption(substr($name, 0, $pos), $value); - } else { - $this->addLongOption($name, null); - } - } - - /** - * Parses an argument. - * - * @throws RuntimeException When too many arguments are given - */ - private function parseArgument(string $token) - { - $c = \count($this->arguments); - - // if input is expecting another argument, add it - if ($this->definition->hasArgument($c)) { - $arg = $this->definition->getArgument($c); - $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token; - - // if last argument isArray(), append token to last argument - } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { - $arg = $this->definition->getArgument($c - 1); - $this->arguments[$arg->getName()][] = $token; - - // unexpected argument - } else { - $all = $this->definition->getArguments(); - $symfonyCommandName = null; - if (($inputArgument = $all[$key = array_key_first($all)] ?? null) && 'command' === $inputArgument->getName()) { - $symfonyCommandName = $this->arguments['command'] ?? null; - unset($all[$key]); - } - - if (\count($all)) { - if ($symfonyCommandName) { - $message = sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); - } else { - $message = sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); - } - } elseif ($symfonyCommandName) { - $message = sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); - } else { - $message = sprintf('No arguments expected, got "%s".', $token); - } - - throw new RuntimeException($message); - } - } - - /** - * Adds a short option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addShortOption(string $shortcut, $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addLongOption(string $name, $value) - { - if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - if (null !== $value) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); - } - $this->options[$optionName] = false; - - return; - } - - $option = $this->definition->getOption($name); - - if (null !== $value && !$option->acceptValue()) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); - } - - if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) { - // if option accepts an optional or mandatory argument - // let's see if there is one provided - $next = array_shift($this->parsed); - if ((isset($next[0]) && '-' !== $next[0]) || \in_array($next, ['', null], true)) { - $value = $next; - } else { - array_unshift($this->parsed, $next); - } - } - - if (null === $value) { - if ($option->isValueRequired()) { - throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isArray() && !$option->isValueOptional()) { - $value = true; - } - } - - if ($option->isArray()) { - $this->options[$name][] = $value; - } else { - $this->options[$name] = $value; - } - } - - /** - * {@inheritdoc} - */ - public function getFirstArgument() - { - $isOption = false; - foreach ($this->tokens as $i => $token) { - if ($token && '-' === $token[0]) { - if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) { - continue; - } - - // If it's a long option, consider that everything after "--" is the option name. - // Otherwise, use the last char (if it's a short option set, only the last one can take a value with space separator) - $name = '-' === $token[1] ? substr($token, 2) : substr($token, -1); - if (!isset($this->options[$name]) && !$this->definition->hasShortcut($name)) { - // noop - } elseif ((isset($this->options[$name]) || isset($this->options[$name = $this->definition->shortcutToName($name)])) && $this->tokens[$i + 1] === $this->options[$name]) { - $isOption = true; - } - - continue; - } - - if ($isOption) { - $isOption = false; - continue; - } - - return $token; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function hasParameterOption($values, bool $onlyParams = false) - { - $values = (array) $values; - - foreach ($this->tokens as $token) { - if ($onlyParams && '--' === $token) { - return false; - } - foreach ($values as $value) { - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) { - return true; - } - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getParameterOption($values, $default = false, bool $onlyParams = false) - { - $values = (array) $values; - $tokens = $this->tokens; - - while (0 < \count($tokens)) { - $token = array_shift($tokens); - if ($onlyParams && '--' === $token) { - return $default; - } - - foreach ($values as $value) { - if ($token === $value) { - return array_shift($tokens); - } - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ('' !== $leading && str_starts_with($token, $leading)) { - return substr($token, \strlen($leading)); - } - } - } - - return $default; - } - - /** - * Returns a stringified representation of the args passed to the command. - * - * @return string - */ - public function __toString() - { - $tokens = array_map(function ($token) { - if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { - return $match[1].$this->escapeToken($match[2]); - } - - if ($token && '-' !== $token[0]) { - return $this->escapeToken($token); - } - - return $token; - }, $this->tokens); - - return implode(' ', $tokens); - } -} diff --git a/trunk/vendor/symfony/console/Input/ArrayInput.php b/trunk/vendor/symfony/console/Input/ArrayInput.php deleted file mode 100644 index 21a517cf..00000000 --- a/trunk/vendor/symfony/console/Input/ArrayInput.php +++ /dev/null @@ -1,210 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\InvalidOptionException; - -/** - * ArrayInput represents an input provided as an array. - * - * Usage: - * - * $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']); - * - * @author Fabien Potencier - */ -class ArrayInput extends Input -{ - private $parameters; - - public function __construct(array $parameters, ?InputDefinition $definition = null) - { - $this->parameters = $parameters; - - parent::__construct($definition); - } - - /** - * {@inheritdoc} - */ - public function getFirstArgument() - { - foreach ($this->parameters as $param => $value) { - if ($param && \is_string($param) && '-' === $param[0]) { - continue; - } - - return $value; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function hasParameterOption($values, bool $onlyParams = false) - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if (!\is_int($k)) { - $v = $k; - } - - if ($onlyParams && '--' === $v) { - return false; - } - - if (\in_array($v, $values)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getParameterOption($values, $default = false, bool $onlyParams = false) - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if ($onlyParams && ('--' === $k || (\is_int($k) && '--' === $v))) { - return $default; - } - - if (\is_int($k)) { - if (\in_array($v, $values)) { - return true; - } - } elseif (\in_array($k, $values)) { - return $v; - } - } - - return $default; - } - - /** - * Returns a stringified representation of the args passed to the command. - * - * @return string - */ - public function __toString() - { - $params = []; - foreach ($this->parameters as $param => $val) { - if ($param && \is_string($param) && '-' === $param[0]) { - $glue = ('-' === $param[1]) ? '=' : ' '; - if (\is_array($val)) { - foreach ($val as $v) { - $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : ''); - } - } else { - $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : ''); - } - } else { - $params[] = \is_array($val) ? implode(' ', array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val); - } - } - - return implode(' ', $params); - } - - /** - * {@inheritdoc} - */ - protected function parse() - { - foreach ($this->parameters as $key => $value) { - if ('--' === $key) { - return; - } - if (str_starts_with($key, '--')) { - $this->addLongOption(substr($key, 2), $value); - } elseif (str_starts_with($key, '-')) { - $this->addShortOption(substr($key, 1), $value); - } else { - $this->addArgument($key, $value); - } - } - } - - /** - * Adds a short option value. - * - * @throws InvalidOptionException When option given doesn't exist - */ - private function addShortOption(string $shortcut, $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws InvalidOptionException When option given doesn't exist - * @throws InvalidOptionException When a required value is missing - */ - private function addLongOption(string $name, $value) - { - if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - $this->options[$optionName] = false; - - return; - } - - $option = $this->definition->getOption($name); - - if (null === $value) { - if ($option->isValueRequired()) { - throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isValueOptional()) { - $value = true; - } - } - - $this->options[$name] = $value; - } - - /** - * Adds an argument value. - * - * @param string|int $name The argument name - * @param mixed $value The value for the argument - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - private function addArgument($name, $value) - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } -} diff --git a/trunk/vendor/symfony/console/Input/Input.php b/trunk/vendor/symfony/console/Input/Input.php deleted file mode 100644 index 0faab2cf..00000000 --- a/trunk/vendor/symfony/console/Input/Input.php +++ /dev/null @@ -1,213 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * Input is the base class for all concrete Input classes. - * - * Three concrete classes are provided by default: - * - * * `ArgvInput`: The input comes from the CLI arguments (argv) - * * `StringInput`: The input is provided as a string - * * `ArrayInput`: The input is provided as an array - * - * @author Fabien Potencier - */ -abstract class Input implements InputInterface, StreamableInputInterface -{ - protected $definition; - protected $stream; - protected $options = []; - protected $arguments = []; - protected $interactive = true; - - public function __construct(?InputDefinition $definition = null) - { - if (null === $definition) { - $this->definition = new InputDefinition(); - } else { - $this->bind($definition); - $this->validate(); - } - } - - /** - * {@inheritdoc} - */ - public function bind(InputDefinition $definition) - { - $this->arguments = []; - $this->options = []; - $this->definition = $definition; - - $this->parse(); - } - - /** - * Processes command line arguments. - */ - abstract protected function parse(); - - /** - * {@inheritdoc} - */ - public function validate() - { - $definition = $this->definition; - $givenArguments = $this->arguments; - - $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { - return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); - }); - - if (\count($missingArguments) > 0) { - throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); - } - } - - /** - * {@inheritdoc} - */ - public function isInteractive() - { - return $this->interactive; - } - - /** - * {@inheritdoc} - */ - public function setInteractive(bool $interactive) - { - $this->interactive = $interactive; - } - - /** - * {@inheritdoc} - */ - public function getArguments() - { - return array_merge($this->definition->getArgumentDefaults(), $this->arguments); - } - - /** - * {@inheritdoc} - */ - public function getArgument(string $name) - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); - } - - /** - * {@inheritdoc} - */ - public function setArgument(string $name, $value) - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function hasArgument(string $name) - { - return $this->definition->hasArgument($name); - } - - /** - * {@inheritdoc} - */ - public function getOptions() - { - return array_merge($this->definition->getOptionDefaults(), $this->options); - } - - /** - * {@inheritdoc} - */ - public function getOption(string $name) - { - if ($this->definition->hasNegation($name)) { - if (null === $value = $this->getOption($this->definition->negationToName($name))) { - return $value; - } - - return !$value; - } - - if (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); - } - - /** - * {@inheritdoc} - */ - public function setOption(string $name, $value) - { - if ($this->definition->hasNegation($name)) { - $this->options[$this->definition->negationToName($name)] = !$value; - - return; - } elseif (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - $this->options[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function hasOption(string $name) - { - return $this->definition->hasOption($name) || $this->definition->hasNegation($name); - } - - /** - * Escapes a token through escapeshellarg if it contains unsafe chars. - * - * @return string - */ - public function escapeToken(string $token) - { - return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); - } - - /** - * {@inheritdoc} - */ - public function setStream($stream) - { - $this->stream = $stream; - } - - /** - * {@inheritdoc} - */ - public function getStream() - { - return $this->stream; - } -} diff --git a/trunk/vendor/symfony/console/Input/InputArgument.php b/trunk/vendor/symfony/console/Input/InputArgument.php deleted file mode 100644 index 1a8bf44b..00000000 --- a/trunk/vendor/symfony/console/Input/InputArgument.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line argument. - * - * @author Fabien Potencier - */ -class InputArgument -{ - public const REQUIRED = 1; - public const OPTIONAL = 2; - public const IS_ARRAY = 4; - - private $name; - private $mode; - private $default; - private $description; - - /** - * @param string $name The argument name - * @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) - * - * @throws InvalidArgumentException When argument mode is not valid - */ - public function __construct(string $name, ?int $mode = null, string $description = '', $default = null) - { - if (null === $mode) { - $mode = self::OPTIONAL; - } elseif ($mode > 7 || $mode < 1) { - throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->mode = $mode; - $this->description = $description; - - $this->setDefault($default); - } - - /** - * Returns the argument name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Returns true if the argument is required. - * - * @return bool true if parameter mode is self::REQUIRED, false otherwise - */ - public function isRequired() - { - return self::REQUIRED === (self::REQUIRED & $this->mode); - } - - /** - * Returns true if the argument can take multiple values. - * - * @return bool true if mode is self::IS_ARRAY, false otherwise - */ - public function isArray() - { - return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); - } - - /** - * Sets the default value. - * - * @param string|bool|int|float|array|null $default - * - * @throws LogicException When incorrect default value is given - */ - public function setDefault($default = null) - { - if ($this->isRequired() && null !== $default) { - throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array argument must be an array.'); - } - } - - $this->default = $default; - } - - /** - * Returns the default value. - * - * @return string|bool|int|float|array|null - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns the description text. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } -} diff --git a/trunk/vendor/symfony/console/Input/InputAwareInterface.php b/trunk/vendor/symfony/console/Input/InputAwareInterface.php deleted file mode 100644 index 5a288de5..00000000 --- a/trunk/vendor/symfony/console/Input/InputAwareInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * InputAwareInterface should be implemented by classes that depends on the - * Console Input. - * - * @author Wouter J - */ -interface InputAwareInterface -{ - /** - * Sets the Console Input. - */ - public function setInput(InputInterface $input); -} diff --git a/trunk/vendor/symfony/console/Input/InputDefinition.php b/trunk/vendor/symfony/console/Input/InputDefinition.php deleted file mode 100644 index 11f704f0..00000000 --- a/trunk/vendor/symfony/console/Input/InputDefinition.php +++ /dev/null @@ -1,424 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * A InputDefinition represents a set of valid command line arguments and options. - * - * Usage: - * - * $definition = new InputDefinition([ - * new InputArgument('name', InputArgument::REQUIRED), - * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), - * ]); - * - * @author Fabien Potencier - */ -class InputDefinition -{ - private $arguments; - private $requiredCount; - private $lastArrayArgument; - private $lastOptionalArgument; - private $options; - private $negations; - private $shortcuts; - - /** - * @param array $definition An array of InputArgument and InputOption instance - */ - public function __construct(array $definition = []) - { - $this->setDefinition($definition); - } - - /** - * Sets the definition of the input. - */ - public function setDefinition(array $definition) - { - $arguments = []; - $options = []; - foreach ($definition as $item) { - if ($item instanceof InputOption) { - $options[] = $item; - } else { - $arguments[] = $item; - } - } - - $this->setArguments($arguments); - $this->setOptions($options); - } - - /** - * Sets the InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function setArguments(array $arguments = []) - { - $this->arguments = []; - $this->requiredCount = 0; - $this->lastOptionalArgument = null; - $this->lastArrayArgument = null; - $this->addArguments($arguments); - } - - /** - * Adds an array of InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function addArguments(?array $arguments = []) - { - if (null !== $arguments) { - foreach ($arguments as $argument) { - $this->addArgument($argument); - } - } - } - - /** - * @throws LogicException When incorrect argument is given - */ - public function addArgument(InputArgument $argument) - { - if (isset($this->arguments[$argument->getName()])) { - throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); - } - - if (null !== $this->lastArrayArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); - } - - if ($argument->isRequired() && null !== $this->lastOptionalArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); - } - - if ($argument->isArray()) { - $this->lastArrayArgument = $argument; - } - - if ($argument->isRequired()) { - ++$this->requiredCount; - } else { - $this->lastOptionalArgument = $argument; - } - - $this->arguments[$argument->getName()] = $argument; - } - - /** - * Returns an InputArgument by name or by position. - * - * @param string|int $name The InputArgument name or position - * - * @return InputArgument - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument($name) - { - if (!$this->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return $arguments[$name]; - } - - /** - * Returns true if an InputArgument object exists by name or position. - * - * @param string|int $name The InputArgument name or position - * - * @return bool - */ - public function hasArgument($name) - { - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return isset($arguments[$name]); - } - - /** - * Gets the array of InputArgument objects. - * - * @return InputArgument[] - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Returns the number of InputArguments. - * - * @return int - */ - public function getArgumentCount() - { - return null !== $this->lastArrayArgument ? \PHP_INT_MAX : \count($this->arguments); - } - - /** - * Returns the number of required InputArguments. - * - * @return int - */ - public function getArgumentRequiredCount() - { - return $this->requiredCount; - } - - /** - * @return array - */ - public function getArgumentDefaults() - { - $values = []; - foreach ($this->arguments as $argument) { - $values[$argument->getName()] = $argument->getDefault(); - } - - return $values; - } - - /** - * Sets the InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function setOptions(array $options = []) - { - $this->options = []; - $this->shortcuts = []; - $this->negations = []; - $this->addOptions($options); - } - - /** - * Adds an array of InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function addOptions(array $options = []) - { - foreach ($options as $option) { - $this->addOption($option); - } - } - - /** - * @throws LogicException When option given already exist - */ - public function addOption(InputOption $option) - { - if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } - if (isset($this->negations[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } - - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { - throw new LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); - } - } - } - - $this->options[$option->getName()] = $option; - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - $this->shortcuts[$shortcut] = $option->getName(); - } - } - - if ($option->isNegatable()) { - $negatedName = 'no-'.$option->getName(); - if (isset($this->options[$negatedName])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $negatedName)); - } - $this->negations[$negatedName] = $option->getName(); - } - } - - /** - * Returns an InputOption by name. - * - * @return InputOption - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption(string $name) - { - if (!$this->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); - } - - return $this->options[$name]; - } - - /** - * Returns true if an InputOption object exists by name. - * - * This method can't be used to check if the user included the option when - * executing the command (use getOption() instead). - * - * @return bool - */ - public function hasOption(string $name) - { - return isset($this->options[$name]); - } - - /** - * Gets the array of InputOption objects. - * - * @return InputOption[] - */ - public function getOptions() - { - return $this->options; - } - - /** - * Returns true if an InputOption object exists by shortcut. - * - * @return bool - */ - public function hasShortcut(string $name) - { - return isset($this->shortcuts[$name]); - } - - /** - * Returns true if an InputOption object exists by negated name. - */ - public function hasNegation(string $name): bool - { - return isset($this->negations[$name]); - } - - /** - * Gets an InputOption by shortcut. - * - * @return InputOption - */ - public function getOptionForShortcut(string $shortcut) - { - return $this->getOption($this->shortcutToName($shortcut)); - } - - /** - * @return array - */ - public function getOptionDefaults() - { - $values = []; - foreach ($this->options as $option) { - $values[$option->getName()] = $option->getDefault(); - } - - return $values; - } - - /** - * Returns the InputOption name given a shortcut. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function shortcutToName(string $shortcut): string - { - if (!isset($this->shortcuts[$shortcut])) { - throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - return $this->shortcuts[$shortcut]; - } - - /** - * Returns the InputOption name given a negation. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function negationToName(string $negation): string - { - if (!isset($this->negations[$negation])) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $negation)); - } - - return $this->negations[$negation]; - } - - /** - * Gets the synopsis. - * - * @return string - */ - public function getSynopsis(bool $short = false) - { - $elements = []; - - if ($short && $this->getOptions()) { - $elements[] = '[options]'; - } elseif (!$short) { - foreach ($this->getOptions() as $option) { - $value = ''; - if ($option->acceptValue()) { - $value = sprintf( - ' %s%s%s', - $option->isValueOptional() ? '[' : '', - strtoupper($option->getName()), - $option->isValueOptional() ? ']' : '' - ); - } - - $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $negation = $option->isNegatable() ? sprintf('|--no-%s', $option->getName()) : ''; - $elements[] = sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); - } - } - - if (\count($elements) && $this->getArguments()) { - $elements[] = '[--]'; - } - - $tail = ''; - foreach ($this->getArguments() as $argument) { - $element = '<'.$argument->getName().'>'; - if ($argument->isArray()) { - $element .= '...'; - } - - if (!$argument->isRequired()) { - $element = '['.$element; - $tail .= ']'; - } - - $elements[] = $element; - } - - return implode(' ', $elements).$tail; - } -} diff --git a/trunk/vendor/symfony/console/Input/InputInterface.php b/trunk/vendor/symfony/console/Input/InputInterface.php deleted file mode 100644 index 628b6037..00000000 --- a/trunk/vendor/symfony/console/Input/InputInterface.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * InputInterface is the interface implemented by all input classes. - * - * @author Fabien Potencier - */ -interface InputInterface -{ - /** - * Returns the first argument from the raw parameters (not parsed). - * - * @return string|null - */ - public function getFirstArgument(); - - /** - * Returns true if the raw parameters (not parsed) contain a value. - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The values to look for in the raw parameters (can be an array) - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - * - * @return bool - */ - public function hasParameterOption($values, bool $onlyParams = false); - - /** - * Returns the value of a raw option (not parsed). - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param string|bool|int|float|array|null $default The default value to return if no result is found - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - * - * @return mixed - */ - public function getParameterOption($values, $default = false, bool $onlyParams = false); - - /** - * Binds the current Input instance with the given arguments and options. - * - * @throws RuntimeException - */ - public function bind(InputDefinition $definition); - - /** - * Validates the input. - * - * @throws RuntimeException When not enough arguments are given - */ - public function validate(); - - /** - * Returns all the given arguments merged with the default values. - * - * @return array - */ - public function getArguments(); - - /** - * Returns the argument value for a given argument name. - * - * @return mixed - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument(string $name); - - /** - * Sets an argument value by name. - * - * @param mixed $value The argument value - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function setArgument(string $name, $value); - - /** - * Returns true if an InputArgument object exists by name or position. - * - * @return bool - */ - public function hasArgument(string $name); - - /** - * Returns all the given options merged with the default values. - * - * @return array - */ - public function getOptions(); - - /** - * Returns the option value for a given option name. - * - * @return mixed - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption(string $name); - - /** - * Sets an option value by name. - * - * @param mixed $value The option value - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function setOption(string $name, $value); - - /** - * Returns true if an InputOption object exists by name. - * - * @return bool - */ - public function hasOption(string $name); - - /** - * Is this input means interactive? - * - * @return bool - */ - public function isInteractive(); - - /** - * Sets the input interactivity. - */ - public function setInteractive(bool $interactive); -} diff --git a/trunk/vendor/symfony/console/Input/InputOption.php b/trunk/vendor/symfony/console/Input/InputOption.php deleted file mode 100644 index 99807f59..00000000 --- a/trunk/vendor/symfony/console/Input/InputOption.php +++ /dev/null @@ -1,231 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line option. - * - * @author Fabien Potencier - */ -class InputOption -{ - /** - * Do not accept input for the option (e.g. --yell). This is the default behavior of options. - */ - public const VALUE_NONE = 1; - - /** - * A value must be passed when the option is used (e.g. --iterations=5 or -i5). - */ - public const VALUE_REQUIRED = 2; - - /** - * The option may or may not have a value (e.g. --yell or --yell=loud). - */ - public const VALUE_OPTIONAL = 4; - - /** - * The option accepts multiple values (e.g. --dir=/foo --dir=/bar). - */ - public const VALUE_IS_ARRAY = 8; - - /** - * The option may have either positive or negative value (e.g. --ansi or --no-ansi). - */ - public const VALUE_NEGATABLE = 16; - - private $name; - private $shortcut; - private $mode; - private $default; - private $description; - - /** - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the VALUE_* constants - * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - */ - public function __construct(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null) - { - if (str_starts_with($name, '--')) { - $name = substr($name, 2); - } - - if (empty($name)) { - throw new InvalidArgumentException('An option name cannot be empty.'); - } - - if ('' === $shortcut || [] === $shortcut || false === $shortcut) { - $shortcut = null; - } - - if (null !== $shortcut) { - if (\is_array($shortcut)) { - $shortcut = implode('|', $shortcut); - } - $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); - $shortcuts = array_filter($shortcuts, 'strlen'); - $shortcut = implode('|', $shortcuts); - - if ('' === $shortcut) { - throw new InvalidArgumentException('An option shortcut cannot be empty.'); - } - } - - if (null === $mode) { - $mode = self::VALUE_NONE; - } elseif ($mode >= (self::VALUE_NEGATABLE << 1) || $mode < 1) { - throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->shortcut = $shortcut; - $this->mode = $mode; - $this->description = $description; - - if ($this->isArray() && !$this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); - } - if ($this->isNegatable() && $this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_NEGATABLE if the option also accepts a value.'); - } - - $this->setDefault($default); - } - - /** - * Returns the option shortcut. - * - * @return string|null - */ - public function getShortcut() - { - return $this->shortcut; - } - - /** - * Returns the option name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Returns true if the option accepts a value. - * - * @return bool true if value mode is not self::VALUE_NONE, false otherwise - */ - public function acceptValue() - { - return $this->isValueRequired() || $this->isValueOptional(); - } - - /** - * Returns true if the option requires a value. - * - * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise - */ - public function isValueRequired() - { - return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); - } - - /** - * Returns true if the option takes an optional value. - * - * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise - */ - public function isValueOptional() - { - return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); - } - - /** - * Returns true if the option can take multiple values. - * - * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise - */ - public function isArray() - { - return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); - } - - public function isNegatable(): bool - { - return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); - } - - /** - * @param string|bool|int|float|array|null $default - */ - public function setDefault($default = null) - { - if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { - throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array option must be an array.'); - } - } - - $this->default = $this->acceptValue() || $this->isNegatable() ? $default : false; - } - - /** - * Returns the default value. - * - * @return string|bool|int|float|array|null - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns the description text. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Checks whether the given option equals this one. - * - * @return bool - */ - public function equals(self $option) - { - return $option->getName() === $this->getName() - && $option->getShortcut() === $this->getShortcut() - && $option->getDefault() === $this->getDefault() - && $option->isNegatable() === $this->isNegatable() - && $option->isArray() === $this->isArray() - && $option->isValueRequired() === $this->isValueRequired() - && $option->isValueOptional() === $this->isValueOptional() - ; - } -} diff --git a/trunk/vendor/symfony/console/Input/StreamableInputInterface.php b/trunk/vendor/symfony/console/Input/StreamableInputInterface.php deleted file mode 100644 index d7e462f2..00000000 --- a/trunk/vendor/symfony/console/Input/StreamableInputInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * StreamableInputInterface is the interface implemented by all input classes - * that have an input stream. - * - * @author Robin Chalas - */ -interface StreamableInputInterface extends InputInterface -{ - /** - * Sets the input stream to read from when interacting with the user. - * - * This is mainly useful for testing purpose. - * - * @param resource $stream The input stream - */ - public function setStream($stream); - - /** - * Returns the input stream. - * - * @return resource|null - */ - public function getStream(); -} diff --git a/trunk/vendor/symfony/console/Input/StringInput.php b/trunk/vendor/symfony/console/Input/StringInput.php deleted file mode 100644 index 56bb66cb..00000000 --- a/trunk/vendor/symfony/console/Input/StringInput.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * StringInput represents an input provided as a string. - * - * Usage: - * - * $input = new StringInput('foo --bar="foobar"'); - * - * @author Fabien Potencier - */ -class StringInput extends ArgvInput -{ - public const REGEX_STRING = '([^\s]+?)(?:\s|(?setTokens($this->tokenize($input)); - } - - /** - * Tokenizes a string. - * - * @throws InvalidArgumentException When unable to parse input (should never happen) - */ - private function tokenize(string $input): array - { - $tokens = []; - $length = \strlen($input); - $cursor = 0; - $token = null; - while ($cursor < $length) { - if ('\\' === $input[$cursor]) { - $token .= $input[++$cursor] ?? ''; - ++$cursor; - continue; - } - - if (preg_match('/\s+/A', $input, $match, 0, $cursor)) { - if (null !== $token) { - $tokens[] = $token; - $token = null; - } - } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, 0, $cursor)) { - $token .= $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))); - } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $token .= stripcslashes(substr($match[0], 1, -1)); - } elseif (preg_match('/'.self::REGEX_UNQUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $token .= $match[1]; - } else { - // should never happen - throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); - } - - $cursor += \strlen($match[0]); - } - - if (null !== $token) { - $tokens[] = $token; - } - - return $tokens; - } -} diff --git a/trunk/vendor/symfony/console/LICENSE b/trunk/vendor/symfony/console/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/trunk/vendor/symfony/console/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/console/Logger/ConsoleLogger.php b/trunk/vendor/symfony/console/Logger/ConsoleLogger.php deleted file mode 100644 index 4a10fa17..00000000 --- a/trunk/vendor/symfony/console/Logger/ConsoleLogger.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Logger; - -use Psr\Log\AbstractLogger; -use Psr\Log\InvalidArgumentException; -use Psr\Log\LogLevel; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * PSR-3 compliant console logger. - * - * @author Kévin Dunglas - * - * @see https://www.php-fig.org/psr/psr-3/ - */ -class ConsoleLogger extends AbstractLogger -{ - public const INFO = 'info'; - public const ERROR = 'error'; - - private $output; - private $verbosityLevelMap = [ - LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, - LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL, - LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL, - LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE, - LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, - LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, - ]; - private $formatLevelMap = [ - LogLevel::EMERGENCY => self::ERROR, - LogLevel::ALERT => self::ERROR, - LogLevel::CRITICAL => self::ERROR, - LogLevel::ERROR => self::ERROR, - LogLevel::WARNING => self::INFO, - LogLevel::NOTICE => self::INFO, - LogLevel::INFO => self::INFO, - LogLevel::DEBUG => self::INFO, - ]; - private $errored = false; - - public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = []) - { - $this->output = $output; - $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap; - $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap; - } - - /** - * {@inheritdoc} - * - * @return void - */ - public function log($level, $message, array $context = []) - { - if (!isset($this->verbosityLevelMap[$level])) { - throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); - } - - $output = $this->output; - - // Write to the error output if necessary and available - if (self::ERROR === $this->formatLevelMap[$level]) { - if ($this->output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - $this->errored = true; - } - - // the if condition check isn't necessary -- it's the same one that $output will do internally anyway. - // We only do it for efficiency here as the message formatting is relatively expensive. - if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) { - $output->writeln(sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); - } - } - - /** - * Returns true when any messages have been logged at error levels. - * - * @return bool - */ - public function hasErrored() - { - return $this->errored; - } - - /** - * Interpolates context values into the message placeholders. - * - * @author PHP Framework Interoperability Group - */ - private function interpolate(string $message, array $context): string - { - if (!str_contains($message, '{')) { - return $message; - } - - $replacements = []; - foreach ($context as $key => $val) { - if (null === $val || \is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { - $replacements["{{$key}}"] = $val; - } elseif ($val instanceof \DateTimeInterface) { - $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); - } elseif (\is_object($val)) { - $replacements["{{$key}}"] = '[object '.\get_class($val).']'; - } else { - $replacements["{{$key}}"] = '['.\gettype($val).']'; - } - } - - return strtr($message, $replacements); - } -} diff --git a/trunk/vendor/symfony/console/Output/BufferedOutput.php b/trunk/vendor/symfony/console/Output/BufferedOutput.php deleted file mode 100644 index d37c6e32..00000000 --- a/trunk/vendor/symfony/console/Output/BufferedOutput.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * @author Jean-François Simon - */ -class BufferedOutput extends Output -{ - private $buffer = ''; - - /** - * Empties buffer and returns its content. - * - * @return string - */ - public function fetch() - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - } -} diff --git a/trunk/vendor/symfony/console/Output/ConsoleOutput.php b/trunk/vendor/symfony/console/Output/ConsoleOutput.php deleted file mode 100644 index 560aeb58..00000000 --- a/trunk/vendor/symfony/console/Output/ConsoleOutput.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR. - * - * This class is a convenient wrapper around `StreamOutput` for both STDOUT and STDERR. - * - * $output = new ConsoleOutput(); - * - * This is equivalent to: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * $stdErr = new StreamOutput(fopen('php://stderr', 'w')); - * - * @author Fabien Potencier - */ -class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface -{ - private $stderr; - private $consoleSectionOutputs = []; - - /** - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) - { - parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); - - if (null === $formatter) { - // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter. - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated); - - return; - } - - $actualDecorated = $this->isDecorated(); - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter()); - - if (null === $decorated) { - $this->setDecorated($actualDecorated && $this->stderr->isDecorated()); - } - } - - /** - * Creates a new output section. - */ - public function section(): ConsoleSectionOutput - { - return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - parent::setDecorated($decorated); - $this->stderr->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - parent::setFormatter($formatter); - $this->stderr->setFormatter($formatter); - } - - /** - * {@inheritdoc} - */ - public function setVerbosity(int $level) - { - parent::setVerbosity($level); - $this->stderr->setVerbosity($level); - } - - /** - * {@inheritdoc} - */ - public function getErrorOutput() - { - return $this->stderr; - } - - /** - * {@inheritdoc} - */ - public function setErrorOutput(OutputInterface $error) - { - $this->stderr = $error; - } - - /** - * Returns true if current environment supports writing console output to - * STDOUT. - * - * @return bool - */ - protected function hasStdoutSupport() - { - return false === $this->isRunningOS400(); - } - - /** - * Returns true if current environment supports writing console output to - * STDERR. - * - * @return bool - */ - protected function hasStderrSupport() - { - return false === $this->isRunningOS400(); - } - - /** - * Checks if current executing environment is IBM iSeries (OS400), which - * doesn't properly convert character-encodings between ASCII to EBCDIC. - */ - private function isRunningOS400(): bool - { - $checks = [ - \function_exists('php_uname') ? php_uname('s') : '', - getenv('OSTYPE'), - \PHP_OS, - ]; - - return false !== stripos(implode(';', $checks), 'OS400'); - } - - /** - * @return resource - */ - private function openOutputStream() - { - if (!$this->hasStdoutSupport()) { - return fopen('php://output', 'w'); - } - - // Use STDOUT when possible to prevent from opening too many file descriptors - return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w')); - } - - /** - * @return resource - */ - private function openErrorStream() - { - if (!$this->hasStderrSupport()) { - return fopen('php://output', 'w'); - } - - // Use STDERR when possible to prevent from opening too many file descriptors - return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w')); - } -} diff --git a/trunk/vendor/symfony/console/Output/ConsoleOutputInterface.php b/trunk/vendor/symfony/console/Output/ConsoleOutputInterface.php deleted file mode 100644 index 6b6635f5..00000000 --- a/trunk/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. - * This adds information about stderr and section output stream. - * - * @author Dariusz Górecki - */ -interface ConsoleOutputInterface extends OutputInterface -{ - /** - * Gets the OutputInterface for errors. - * - * @return OutputInterface - */ - public function getErrorOutput(); - - public function setErrorOutput(OutputInterface $error); - - public function section(): ConsoleSectionOutput; -} diff --git a/trunk/vendor/symfony/console/Output/ConsoleSectionOutput.php b/trunk/vendor/symfony/console/Output/ConsoleSectionOutput.php deleted file mode 100644 index 70d70c50..00000000 --- a/trunk/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Terminal; - -/** - * @author Pierre du Plessis - * @author Gabriel Ostrolucký - */ -class ConsoleSectionOutput extends StreamOutput -{ - private $content = []; - private $lines = 0; - private $sections; - private $terminal; - - /** - * @param resource $stream - * @param ConsoleSectionOutput[] $sections - */ - public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter) - { - parent::__construct($stream, $verbosity, $decorated, $formatter); - array_unshift($sections, $this); - $this->sections = &$sections; - $this->terminal = new Terminal(); - } - - /** - * Clears previous output for this section. - * - * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared - */ - public function clear(?int $lines = null) - { - if (empty($this->content) || !$this->isDecorated()) { - return; - } - - if ($lines) { - array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content - } else { - $lines = $this->lines; - $this->content = []; - } - - $this->lines -= $lines; - - parent::doWrite($this->popStreamContentUntilCurrentSection($lines), false); - } - - /** - * Overwrites the previous output with a new message. - * - * @param array|string $message - */ - public function overwrite($message) - { - $this->clear(); - $this->writeln($message); - } - - public function getContent(): string - { - return implode('', $this->content); - } - - /** - * @internal - */ - public function addContent(string $input) - { - foreach (explode(\PHP_EOL, $input) as $lineContent) { - $this->lines += ceil($this->getDisplayLength($lineContent) / $this->terminal->getWidth()) ?: 1; - $this->content[] = $lineContent; - $this->content[] = \PHP_EOL; - } - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - if (!$this->isDecorated()) { - parent::doWrite($message, $newline); - - return; - } - - $erasedContent = $this->popStreamContentUntilCurrentSection(); - - $this->addContent($message); - - parent::doWrite($message, true); - parent::doWrite($erasedContent, false); - } - - /** - * At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits - * current section. Then it erases content it crawled through. Optionally, it erases part of current section too. - */ - private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string - { - $numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection; - $erasedContent = []; - - foreach ($this->sections as $section) { - if ($section === $this) { - break; - } - - $numberOfLinesToClear += $section->lines; - $erasedContent[] = $section->getContent(); - } - - if ($numberOfLinesToClear > 0) { - // move cursor up n lines - parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false); - // erase to end of screen - parent::doWrite("\x1b[0J", false); - } - - return implode('', array_reverse($erasedContent)); - } - - private function getDisplayLength(string $text): int - { - return Helper::width(Helper::removeDecoration($this->getFormatter(), str_replace("\t", ' ', $text))); - } -} diff --git a/trunk/vendor/symfony/console/Output/NullOutput.php b/trunk/vendor/symfony/console/Output/NullOutput.php deleted file mode 100644 index 3bbe63ea..00000000 --- a/trunk/vendor/symfony/console/Output/NullOutput.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\NullOutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * NullOutput suppresses all output. - * - * $output = new NullOutput(); - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class NullOutput implements OutputInterface -{ - private $formatter; - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - if ($this->formatter) { - return $this->formatter; - } - // to comply with the interface we must return a OutputFormatterInterface - return $this->formatter = new NullOutputFormatter(); - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function setVerbosity(int $level) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function getVerbosity() - { - return self::VERBOSITY_QUIET; - } - - /** - * {@inheritdoc} - */ - public function isQuiet() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function isVerbose() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isVeryVerbose() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isDebug() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, int $options = self::OUTPUT_NORMAL) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) - { - // do nothing - } -} diff --git a/trunk/vendor/symfony/console/Output/Output.php b/trunk/vendor/symfony/console/Output/Output.php deleted file mode 100644 index 28c40bb3..00000000 --- a/trunk/vendor/symfony/console/Output/Output.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * Base class for output classes. - * - * There are five levels of verbosity: - * - * * normal: no option passed (normal output) - * * verbose: -v (more output) - * * very verbose: -vv (highly extended output) - * * debug: -vvv (all debug output) - * * quiet: -q (no output) - * - * @author Fabien Potencier - */ -abstract class Output implements OutputInterface -{ - private $verbosity; - private $formatter; - - /** - * @param int|null $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool $decorated Whether to decorate messages - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) - { - $this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL; - $this->formatter = $formatter ?? new OutputFormatter(); - $this->formatter->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - $this->formatter = $formatter; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->formatter; - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - $this->formatter->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return $this->formatter->isDecorated(); - } - - /** - * {@inheritdoc} - */ - public function setVerbosity(int $level) - { - $this->verbosity = $level; - } - - /** - * {@inheritdoc} - */ - public function getVerbosity() - { - return $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isQuiet() - { - return self::VERBOSITY_QUIET === $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isVerbose() - { - return self::VERBOSITY_VERBOSE <= $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isVeryVerbose() - { - return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isDebug() - { - return self::VERBOSITY_DEBUG <= $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, int $options = self::OUTPUT_NORMAL) - { - $this->write($messages, true, $options); - } - - /** - * {@inheritdoc} - */ - public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN; - $type = $types & $options ?: self::OUTPUT_NORMAL; - - $verbosities = self::VERBOSITY_QUIET | self::VERBOSITY_NORMAL | self::VERBOSITY_VERBOSE | self::VERBOSITY_VERY_VERBOSE | self::VERBOSITY_DEBUG; - $verbosity = $verbosities & $options ?: self::VERBOSITY_NORMAL; - - if ($verbosity > $this->getVerbosity()) { - return; - } - - foreach ($messages as $message) { - switch ($type) { - case OutputInterface::OUTPUT_NORMAL: - $message = $this->formatter->format($message); - break; - case OutputInterface::OUTPUT_RAW: - break; - case OutputInterface::OUTPUT_PLAIN: - $message = strip_tags($this->formatter->format($message)); - break; - } - - $this->doWrite($message ?? '', $newline); - } - } - - /** - * Writes a message to the output. - */ - abstract protected function doWrite(string $message, bool $newline); -} diff --git a/trunk/vendor/symfony/console/Output/OutputInterface.php b/trunk/vendor/symfony/console/Output/OutputInterface.php deleted file mode 100644 index 55caab80..00000000 --- a/trunk/vendor/symfony/console/Output/OutputInterface.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * OutputInterface is the interface implemented by all Output classes. - * - * @author Fabien Potencier - */ -interface OutputInterface -{ - public const VERBOSITY_QUIET = 16; - public const VERBOSITY_NORMAL = 32; - public const VERBOSITY_VERBOSE = 64; - public const VERBOSITY_VERY_VERBOSE = 128; - public const VERBOSITY_DEBUG = 256; - - public const OUTPUT_NORMAL = 1; - public const OUTPUT_RAW = 2; - public const OUTPUT_PLAIN = 4; - - /** - * Writes a message to the output. - * - * @param string|iterable $messages The message as an iterable of strings or a single string - * @param bool $newline Whether to add a newline - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function write($messages, bool $newline = false, int $options = 0); - - /** - * Writes a message to the output and adds a newline at the end. - * - * @param string|iterable $messages The message as an iterable of strings or a single string - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function writeln($messages, int $options = 0); - - /** - * Sets the verbosity of the output. - */ - public function setVerbosity(int $level); - - /** - * Gets the current verbosity of the output. - * - * @return int - */ - public function getVerbosity(); - - /** - * Returns whether verbosity is quiet (-q). - * - * @return bool - */ - public function isQuiet(); - - /** - * Returns whether verbosity is verbose (-v). - * - * @return bool - */ - public function isVerbose(); - - /** - * Returns whether verbosity is very verbose (-vv). - * - * @return bool - */ - public function isVeryVerbose(); - - /** - * Returns whether verbosity is debug (-vvv). - * - * @return bool - */ - public function isDebug(); - - /** - * Sets the decorated flag. - */ - public function setDecorated(bool $decorated); - - /** - * Gets the decorated flag. - * - * @return bool - */ - public function isDecorated(); - - public function setFormatter(OutputFormatterInterface $formatter); - - /** - * Returns current output formatter instance. - * - * @return OutputFormatterInterface - */ - public function getFormatter(); -} diff --git a/trunk/vendor/symfony/console/Output/StreamOutput.php b/trunk/vendor/symfony/console/Output/StreamOutput.php deleted file mode 100644 index 72479f8a..00000000 --- a/trunk/vendor/symfony/console/Output/StreamOutput.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * StreamOutput writes the output to a given stream. - * - * Usage: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * - * As `StreamOutput` can use any stream, you can also use a file: - * - * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); - * - * @author Fabien Potencier - */ -class StreamOutput extends Output -{ - private $stream; - - /** - * @param resource $stream A stream resource - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - * - * @throws InvalidArgumentException When first argument is not a real stream - */ - public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) - { - if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { - throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); - } - - $this->stream = $stream; - - if (null === $decorated) { - $decorated = $this->hasColorSupport(); - } - - parent::__construct($verbosity, $decorated, $formatter); - } - - /** - * Gets the stream attached to this StreamOutput instance. - * - * @return resource - */ - public function getStream() - { - return $this->stream; - } - - protected function doWrite(string $message, bool $newline) - { - if ($newline) { - $message .= \PHP_EOL; - } - - @fwrite($this->stream, $message); - - fflush($this->stream); - } - - /** - * Returns true if the stream supports colorization. - * - * Colorization is disabled if not supported by the stream: - * - * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo - * terminals via named pipes, so we can only check the environment. - * - * Reference: Composer\XdebugHandler\Process::supportsColor - * https://github.com/composer/xdebug-handler - * - * @return bool true if the stream supports colorization, false otherwise - */ - protected function hasColorSupport() - { - // Follow https://no-color.org/ - if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) { - return false; - } - - // Detect msysgit/mingw and assume this is a tty because detection - // does not work correctly, see https://github.com/composer/composer/issues/9690 - if (!@stream_isatty($this->stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) { - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($this->stream)) { - return true; - } - - if ('Hyper' === getenv('TERM_PROGRAM') - || false !== getenv('COLORTERM') - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - ) { - return true; - } - - if ('dumb' === $term = (string) getenv('TERM')) { - return false; - } - - // See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157 - return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term); - } -} diff --git a/trunk/vendor/symfony/console/Output/TrimmedBufferOutput.php b/trunk/vendor/symfony/console/Output/TrimmedBufferOutput.php deleted file mode 100644 index b08503b3..00000000 --- a/trunk/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * A BufferedOutput that keeps only the last N chars. - * - * @author Jérémy Derussé - */ -class TrimmedBufferOutput extends Output -{ - private $maxLength; - private $buffer = ''; - - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) - { - if ($maxLength <= 0) { - throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); - } - - parent::__construct($verbosity, $decorated, $formatter); - $this->maxLength = $maxLength; - } - - /** - * Empties buffer and returns its content. - * - * @return string - */ - public function fetch() - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - - $this->buffer = substr($this->buffer, 0 - $this->maxLength); - } -} diff --git a/trunk/vendor/symfony/console/Question/ChoiceQuestion.php b/trunk/vendor/symfony/console/Question/ChoiceQuestion.php deleted file mode 100644 index bf1f9048..00000000 --- a/trunk/vendor/symfony/console/Question/ChoiceQuestion.php +++ /dev/null @@ -1,183 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * Represents a choice question. - * - * @author Fabien Potencier - */ -class ChoiceQuestion extends Question -{ - private $choices; - private $multiselect = false; - private $prompt = ' > '; - private $errorMessage = 'Value "%s" is invalid'; - - /** - * @param string $question The question to ask to the user - * @param array $choices The list of available choices - * @param mixed $default The default answer to return - */ - public function __construct(string $question, array $choices, $default = null) - { - if (!$choices) { - throw new \LogicException('Choice question must have at least 1 choice available.'); - } - - parent::__construct($question, $default); - - $this->choices = $choices; - $this->setValidator($this->getDefaultValidator()); - $this->setAutocompleterValues($choices); - } - - /** - * Returns available choices. - * - * @return array - */ - public function getChoices() - { - return $this->choices; - } - - /** - * Sets multiselect option. - * - * When multiselect is set to true, multiple choices can be answered. - * - * @return $this - */ - public function setMultiselect(bool $multiselect) - { - $this->multiselect = $multiselect; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - /** - * Returns whether the choices are multiselect. - * - * @return bool - */ - public function isMultiselect() - { - return $this->multiselect; - } - - /** - * Gets the prompt for choices. - * - * @return string - */ - public function getPrompt() - { - return $this->prompt; - } - - /** - * Sets the prompt for choices. - * - * @return $this - */ - public function setPrompt(string $prompt) - { - $this->prompt = $prompt; - - return $this; - } - - /** - * Sets the error message for invalid values. - * - * The error message has a string placeholder (%s) for the invalid value. - * - * @return $this - */ - public function setErrorMessage(string $errorMessage) - { - $this->errorMessage = $errorMessage; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - private function getDefaultValidator(): callable - { - $choices = $this->choices; - $errorMessage = $this->errorMessage; - $multiselect = $this->multiselect; - $isAssoc = $this->isAssoc($choices); - - return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { - if ($multiselect) { - // Check for a separated comma values - if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) { - throw new InvalidArgumentException(sprintf($errorMessage, $selected)); - } - - $selectedChoices = explode(',', (string) $selected); - } else { - $selectedChoices = [$selected]; - } - - if ($this->isTrimmable()) { - foreach ($selectedChoices as $k => $v) { - $selectedChoices[$k] = trim((string) $v); - } - } - - $multiselectChoices = []; - foreach ($selectedChoices as $value) { - $results = []; - foreach ($choices as $key => $choice) { - if ($choice === $value) { - $results[] = $key; - } - } - - if (\count($results) > 1) { - throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); - } - - $result = array_search($value, $choices); - - if (!$isAssoc) { - if (false !== $result) { - $result = $choices[$result]; - } elseif (isset($choices[$value])) { - $result = $choices[$value]; - } - } elseif (false === $result && isset($choices[$value])) { - $result = $value; - } - - if (false === $result) { - throw new InvalidArgumentException(sprintf($errorMessage, $value)); - } - - // For associative choices, consistently return the key as string: - $multiselectChoices[] = $isAssoc ? (string) $result : $result; - } - - if ($multiselect) { - return $multiselectChoices; - } - - return current($multiselectChoices); - }; - } -} diff --git a/trunk/vendor/symfony/console/Question/ConfirmationQuestion.php b/trunk/vendor/symfony/console/Question/ConfirmationQuestion.php deleted file mode 100644 index 4228521b..00000000 --- a/trunk/vendor/symfony/console/Question/ConfirmationQuestion.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -/** - * Represents a yes/no question. - * - * @author Fabien Potencier - */ -class ConfirmationQuestion extends Question -{ - private $trueAnswerRegex; - - /** - * @param string $question The question to ask to the user - * @param bool $default The default answer to return, true or false - * @param string $trueAnswerRegex A regex to match the "yes" answer - */ - public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i') - { - parent::__construct($question, $default); - - $this->trueAnswerRegex = $trueAnswerRegex; - $this->setNormalizer($this->getDefaultNormalizer()); - } - - /** - * Returns the default answer normalizer. - */ - private function getDefaultNormalizer(): callable - { - $default = $this->getDefault(); - $regex = $this->trueAnswerRegex; - - return function ($answer) use ($default, $regex) { - if (\is_bool($answer)) { - return $answer; - } - - $answerIsTrue = (bool) preg_match($regex, $answer); - if (false === $default) { - return $answer && $answerIsTrue; - } - - return '' === $answer || $answerIsTrue; - }; - } -} diff --git a/trunk/vendor/symfony/console/Question/Question.php b/trunk/vendor/symfony/console/Question/Question.php deleted file mode 100644 index ba574428..00000000 --- a/trunk/vendor/symfony/console/Question/Question.php +++ /dev/null @@ -1,299 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a Question. - * - * @author Fabien Potencier - */ -class Question -{ - private $question; - private $attempts; - private $hidden = false; - private $hiddenFallback = true; - private $autocompleterCallback; - private $validator; - private $default; - private $normalizer; - private $trimmable = true; - private $multiline = false; - - /** - * @param string $question The question to ask to the user - * @param string|bool|int|float|null $default The default answer to return if the user enters nothing - */ - public function __construct(string $question, $default = null) - { - $this->question = $question; - $this->default = $default; - } - - /** - * Returns the question. - * - * @return string - */ - public function getQuestion() - { - return $this->question; - } - - /** - * Returns the default answer. - * - * @return string|bool|int|float|null - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns whether the user response accepts newline characters. - */ - public function isMultiline(): bool - { - return $this->multiline; - } - - /** - * Sets whether the user response should accept newline characters. - * - * @return $this - */ - public function setMultiline(bool $multiline): self - { - $this->multiline = $multiline; - - return $this; - } - - /** - * Returns whether the user response must be hidden. - * - * @return bool - */ - public function isHidden() - { - return $this->hidden; - } - - /** - * Sets whether the user response must be hidden or not. - * - * @return $this - * - * @throws LogicException In case the autocompleter is also used - */ - public function setHidden(bool $hidden) - { - if ($this->autocompleterCallback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->hidden = $hidden; - - return $this; - } - - /** - * In case the response cannot be hidden, whether to fallback on non-hidden question or not. - * - * @return bool - */ - public function isHiddenFallback() - { - return $this->hiddenFallback; - } - - /** - * Sets whether to fallback on non-hidden question if the response cannot be hidden. - * - * @return $this - */ - public function setHiddenFallback(bool $fallback) - { - $this->hiddenFallback = $fallback; - - return $this; - } - - /** - * Gets values for the autocompleter. - * - * @return iterable|null - */ - public function getAutocompleterValues() - { - $callback = $this->getAutocompleterCallback(); - - return $callback ? $callback('') : null; - } - - /** - * Sets values for the autocompleter. - * - * @return $this - * - * @throws LogicException - */ - public function setAutocompleterValues(?iterable $values) - { - if (\is_array($values)) { - $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); - - $callback = static function () use ($values) { - return $values; - }; - } elseif ($values instanceof \Traversable) { - $valueCache = null; - $callback = static function () use ($values, &$valueCache) { - return $valueCache ?? $valueCache = iterator_to_array($values, false); - }; - } else { - $callback = null; - } - - return $this->setAutocompleterCallback($callback); - } - - /** - * Gets the callback function used for the autocompleter. - */ - public function getAutocompleterCallback(): ?callable - { - return $this->autocompleterCallback; - } - - /** - * Sets the callback function used for the autocompleter. - * - * The callback is passed the user input as argument and should return an iterable of corresponding suggestions. - * - * @return $this - */ - public function setAutocompleterCallback(?callable $callback = null): self - { - if ($this->hidden && null !== $callback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->autocompleterCallback = $callback; - - return $this; - } - - /** - * Sets a validator for the question. - * - * @return $this - */ - public function setValidator(?callable $validator = null) - { - $this->validator = $validator; - - return $this; - } - - /** - * Gets the validator for the question. - * - * @return callable|null - */ - public function getValidator() - { - return $this->validator; - } - - /** - * Sets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - * - * @return $this - * - * @throws InvalidArgumentException in case the number of attempts is invalid - */ - public function setMaxAttempts(?int $attempts) - { - if (null !== $attempts && $attempts < 1) { - throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); - } - - $this->attempts = $attempts; - - return $this; - } - - /** - * Gets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - * - * @return int|null - */ - public function getMaxAttempts() - { - return $this->attempts; - } - - /** - * Sets a normalizer for the response. - * - * The normalizer can be a callable (a string), a closure or a class implementing __invoke. - * - * @return $this - */ - public function setNormalizer(callable $normalizer) - { - $this->normalizer = $normalizer; - - return $this; - } - - /** - * Gets the normalizer for the response. - * - * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. - * - * @return callable|null - */ - public function getNormalizer() - { - return $this->normalizer; - } - - protected function isAssoc(array $array) - { - return (bool) \count(array_filter(array_keys($array), 'is_string')); - } - - public function isTrimmable(): bool - { - return $this->trimmable; - } - - /** - * @return $this - */ - public function setTrimmable(bool $trimmable): self - { - $this->trimmable = $trimmable; - - return $this; - } -} diff --git a/trunk/vendor/symfony/console/Resources/bin/hiddeninput.exe b/trunk/vendor/symfony/console/Resources/bin/hiddeninput.exe deleted file mode 100644 index c8cf65e8d819e6e525121cf6b21f1c2429746038..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9216 zcmeHNe{@sVeZR8hV88~S)=Hp|Mpn({rC^@)BwNOI{ERJXCYlx+k1K6PLHo z_e!z_fhOzeA3JTX&-Z@s{rFOgjEwBlqjr!)9f zjyHz`A+ni`!0Taby{Uj5Y>jQq(k5A+X})PLWAi|{IZbtc8n^^trM{GI=P_15U6d?l zJJ3PW8XjfHpR}6`k{&5@JcEeH_SqQoQbU62o2YS30W)p_t&Fjy*RXQCZt$gCf|ao| zx&3R}m6|-Lfi@pua=$26n(UlnWo$>K67*|+#(qL_An=?l0M02AhOSJDv3;~?1ORfw z76EdK#MpSHqACHLcnJLIYlCSiX4eS@Pr8rN)Xwz0dk7O*y^0_C(Yks2Kvg! z-d-fJ)F9@k?>)m(XqDKIe2OKfhCQde9fpO0ko24yn*4xzX7q+ze`Z*=aJgwV?D?73 zaJ8UkSk|NN>@-|mB*f`EIK7$ElgAB<7p&p`^Vuq$58#;?B^*Bz7&d$B#+AYUC z(^m|`7{lqx&b^5$;i`j|S!+u|lcaQplp_&Nb)!>r>vGh3wb!tW zLq6%bkSt8jO|(vWH>LiPV(Xk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cQ# z#v6bP%Tdfe~jtCRzAL;-OahZ=#yvUixu2-9fD2j$*|YY`F?0wF-{a# ztr<&kZjZ+81}6ZESqtgW)8kP#s@VLTSUR{}6?U^R*x7RE3Rl&n=VnFFqg9Uqz1n@N9N|=9<4} zuJfy^+}|D9X&vm3MAdqmu0&UMd^=K>b1hLAm_E!$rZC2b;;T~Dl zI`Eo_yRY76uM})|6wk9->of(=9&4jLv5#p@OzS~Yl>@pG)^>6`R+KtL{<4ly4o9WiM!%p_pfROU354)e8PIeE z1_s?#;OX6waNvvb&UQRN(WLbR+}&b#jo&WY-LlwCX}Q*$jGuKYuOGoIoyR(>e}}ix z+t}Q^cEcC8Y{@h}>HmJ^gD!l@gzwHmiBKl26x_lZVZG2UY!`w;RJd122;US&geQdW z3Qq}R!gIo5;ka;0I4c-Jq5X6A6?VzK&c4y!ZXdAUYu{r}*!SBXw?Aor+J4-A(*COb zb^CwV-?3k`zi-cX*c`VzL`RLI(b4MgIrGN z%ojf`E*6)Gg1A9!7q^N##2zsss^V9~-Qt7d!{UDNZ^XY9pA^3@9ui*?e=7c5d`nD; z?}~R(p>y1Kw!>|X4ycYEAkcZa*n-R%y! zqi)Up756UpqwfE7=hfigw$k~G@25gaxF9UGTkV>C(7x1Rbx4jb#|}rxq0vQ!n-c#f J0sQ~1{4brj`U(I5 diff --git a/trunk/vendor/symfony/console/Resources/completion.bash b/trunk/vendor/symfony/console/Resources/completion.bash deleted file mode 100644 index 64b87ccf..00000000 --- a/trunk/vendor/symfony/console/Resources/completion.bash +++ /dev/null @@ -1,84 +0,0 @@ -# This file is part of the Symfony package. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view -# https://symfony.com/doc/current/contributing/code/license.html - -_sf_{{ COMMAND_NAME }}() { - # Use newline as only separator to allow space in completion values - IFS=$'\n' - local sf_cmd="${COMP_WORDS[0]}" - - # for an alias, get the real script behind it - sf_cmd_type=$(type -t $sf_cmd) - if [[ $sf_cmd_type == "alias" ]]; then - sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/") - elif [[ $sf_cmd_type == "file" ]]; then - sf_cmd=$(type -p $sf_cmd) - fi - - if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then - return 1 - fi - - local cur prev words cword - _get_comp_words_by_ref -n := cur prev words cword - - local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-S{{ VERSION }}") - for w in ${words[@]}; do - w=$(printf -- '%b' "$w") - # remove quotes from typed values - quote="${w:0:1}" - if [ "$quote" == \' ]; then - w="${w%\'}" - w="${w#\'}" - elif [ "$quote" == \" ]; then - w="${w%\"}" - w="${w#\"}" - fi - # empty values are ignored - if [ ! -z "$w" ]; then - completecmd+=("-i$w") - fi - done - - local sfcomplete - if sfcomplete=$(${completecmd[@]} 2>&1); then - local quote suggestions - quote=${cur:0:1} - - # Use single quotes by default if suggestions contains backslash (FQCN) - if [ "$quote" == '' ] && [[ "$sfcomplete" =~ \\ ]]; then - quote=\' - fi - - if [ "$quote" == \' ]; then - # single quotes: no additional escaping (does not accept ' in values) - suggestions=$(for s in $sfcomplete; do printf $'%q%q%q\n' "$quote" "$s" "$quote"; done) - elif [ "$quote" == \" ]; then - # double quotes: double escaping for \ $ ` " - suggestions=$(for s in $sfcomplete; do - s=${s//\\/\\\\} - s=${s//\$/\\\$} - s=${s//\`/\\\`} - s=${s//\"/\\\"} - printf $'%q%q%q\n' "$quote" "$s" "$quote"; - done) - else - # no quotes: double escaping - suggestions=$(for s in $sfcomplete; do printf $'%q\n' $(printf '%q' "$s"); done) - fi - COMPREPLY=($(IFS=$'\n' compgen -W "$suggestions" -- $(printf -- "%q" "$cur"))) - __ltrim_colon_completions "$cur" - else - if [[ "$sfcomplete" != *"Command \"_complete\" is not defined."* ]]; then - >&2 echo - >&2 echo $sfcomplete - fi - - return 1 - fi -} - -complete -F _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }} diff --git a/trunk/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/trunk/vendor/symfony/console/SignalRegistry/SignalRegistry.php deleted file mode 100644 index 6bee24a4..00000000 --- a/trunk/vendor/symfony/console/SignalRegistry/SignalRegistry.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\SignalRegistry; - -final class SignalRegistry -{ - private $signalHandlers = []; - - public function __construct() - { - if (\function_exists('pcntl_async_signals')) { - pcntl_async_signals(true); - } - } - - public function register(int $signal, callable $signalHandler): void - { - if (!isset($this->signalHandlers[$signal])) { - $previousCallback = pcntl_signal_get_handler($signal); - - if (\is_callable($previousCallback)) { - $this->signalHandlers[$signal][] = $previousCallback; - } - } - - $this->signalHandlers[$signal][] = $signalHandler; - - pcntl_signal($signal, [$this, 'handle']); - } - - public static function isSupported(): bool - { - if (!\function_exists('pcntl_signal')) { - return false; - } - - if (\in_array('pcntl_signal', explode(',', \ini_get('disable_functions')))) { - return false; - } - - return true; - } - - /** - * @internal - */ - public function handle(int $signal): void - { - $count = \count($this->signalHandlers[$signal]); - - foreach ($this->signalHandlers[$signal] as $i => $signalHandler) { - $hasNext = $i !== $count - 1; - $signalHandler($signal, $hasNext); - } - } -} diff --git a/trunk/vendor/symfony/console/SingleCommandApplication.php b/trunk/vendor/symfony/console/SingleCommandApplication.php deleted file mode 100644 index 774e5d8c..00000000 --- a/trunk/vendor/symfony/console/SingleCommandApplication.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Grégoire Pineau - */ -class SingleCommandApplication extends Command -{ - private $version = 'UNKNOWN'; - private $autoExit = true; - private $running = false; - - /** - * @return $this - */ - public function setVersion(string $version): self - { - $this->version = $version; - - return $this; - } - - /** - * @final - * - * @return $this - */ - public function setAutoExit(bool $autoExit): self - { - $this->autoExit = $autoExit; - - return $this; - } - - public function run(?InputInterface $input = null, ?OutputInterface $output = null): int - { - if ($this->running) { - return parent::run($input, $output); - } - - // We use the command name as the application name - $application = new Application($this->getName() ?: 'UNKNOWN', $this->version); - $application->setAutoExit($this->autoExit); - // Fix the usage of the command displayed with "--help" - $this->setName($_SERVER['argv'][0]); - $application->add($this); - $application->setDefaultCommand($this->getName(), true); - - $this->running = true; - try { - $ret = $application->run($input, $output); - } finally { - $this->running = false; - } - - return $ret ?? 1; - } -} diff --git a/trunk/vendor/symfony/console/Style/OutputStyle.php b/trunk/vendor/symfony/console/Style/OutputStyle.php deleted file mode 100644 index 67a98ff0..00000000 --- a/trunk/vendor/symfony/console/Style/OutputStyle.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Decorates output to add console style guide helpers. - * - * @author Kevin Bond - */ -abstract class OutputStyle implements OutputInterface, StyleInterface -{ - private $output; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - } - - /** - * {@inheritdoc} - */ - public function newLine(int $count = 1) - { - $this->output->write(str_repeat(\PHP_EOL, $count)); - } - - /** - * @return ProgressBar - */ - public function createProgressBar(int $max = 0) - { - return new ProgressBar($this->output, $max); - } - - /** - * {@inheritdoc} - */ - public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) - { - $this->output->write($messages, $newline, $type); - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, int $type = self::OUTPUT_NORMAL) - { - $this->output->writeln($messages, $type); - } - - /** - * {@inheritdoc} - */ - public function setVerbosity(int $level) - { - $this->output->setVerbosity($level); - } - - /** - * {@inheritdoc} - */ - public function getVerbosity() - { - return $this->output->getVerbosity(); - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - $this->output->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return $this->output->isDecorated(); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - $this->output->setFormatter($formatter); - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->output->getFormatter(); - } - - /** - * {@inheritdoc} - */ - public function isQuiet() - { - return $this->output->isQuiet(); - } - - /** - * {@inheritdoc} - */ - public function isVerbose() - { - return $this->output->isVerbose(); - } - - /** - * {@inheritdoc} - */ - public function isVeryVerbose() - { - return $this->output->isVeryVerbose(); - } - - /** - * {@inheritdoc} - */ - public function isDebug() - { - return $this->output->isDebug(); - } - - protected function getErrorOutput() - { - if (!$this->output instanceof ConsoleOutputInterface) { - return $this->output; - } - - return $this->output->getErrorOutput(); - } -} diff --git a/trunk/vendor/symfony/console/Style/StyleInterface.php b/trunk/vendor/symfony/console/Style/StyleInterface.php deleted file mode 100644 index 9f25a43f..00000000 --- a/trunk/vendor/symfony/console/Style/StyleInterface.php +++ /dev/null @@ -1,132 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -/** - * Output style helpers. - * - * @author Kevin Bond - */ -interface StyleInterface -{ - /** - * Formats a command title. - */ - public function title(string $message); - - /** - * Formats a section title. - */ - public function section(string $message); - - /** - * Formats a list. - */ - public function listing(array $elements); - - /** - * Formats informational text. - * - * @param string|array $message - */ - public function text($message); - - /** - * Formats a success result bar. - * - * @param string|array $message - */ - public function success($message); - - /** - * Formats an error result bar. - * - * @param string|array $message - */ - public function error($message); - - /** - * Formats an warning result bar. - * - * @param string|array $message - */ - public function warning($message); - - /** - * Formats a note admonition. - * - * @param string|array $message - */ - public function note($message); - - /** - * Formats a caution admonition. - * - * @param string|array $message - */ - public function caution($message); - - /** - * Formats a table. - */ - public function table(array $headers, array $rows); - - /** - * Asks a question. - * - * @return mixed - */ - public function ask(string $question, ?string $default = null, ?callable $validator = null); - - /** - * Asks a question with the user input hidden. - * - * @return mixed - */ - public function askHidden(string $question, ?callable $validator = null); - - /** - * Asks for confirmation. - * - * @return bool - */ - public function confirm(string $question, bool $default = true); - - /** - * Asks a choice question. - * - * @param string|int|null $default - * - * @return mixed - */ - public function choice(string $question, array $choices, $default = null); - - /** - * Add newline(s). - */ - public function newLine(int $count = 1); - - /** - * Starts the progress output. - */ - public function progressStart(int $max = 0); - - /** - * Advances the progress output X steps. - */ - public function progressAdvance(int $step = 1); - - /** - * Finishes the progress output. - */ - public function progressFinish(); -} diff --git a/trunk/vendor/symfony/console/Style/SymfonyStyle.php b/trunk/vendor/symfony/console/Style/SymfonyStyle.php deleted file mode 100644 index 00edf388..00000000 --- a/trunk/vendor/symfony/console/Style/SymfonyStyle.php +++ /dev/null @@ -1,518 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Helper\SymfonyQuestionHelper; -use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Helper\TableCell; -use Symfony\Component\Console\Helper\TableSeparator; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\TrimmedBufferOutput; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -/** - * Output decorator helpers for the Symfony Style Guide. - * - * @author Kevin Bond - */ -class SymfonyStyle extends OutputStyle -{ - public const MAX_LINE_LENGTH = 120; - - private $input; - private $output; - private $questionHelper; - private $progressBar; - private $lineLength; - private $bufferedOutput; - - public function __construct(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter()); - // Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not. - $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; - $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); - - parent::__construct($this->output = $output); - } - - /** - * Formats a message as a block of text. - * - * @param string|array $messages The message to write in the block - */ - public function block($messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) - { - $messages = \is_array($messages) ? array_values($messages) : [$messages]; - - $this->autoPrependBlock(); - $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape)); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function title(string $message) - { - $this->autoPrependBlock(); - $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), - ]); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function section(string $message) - { - $this->autoPrependBlock(); - $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), - ]); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function listing(array $elements) - { - $this->autoPrependText(); - $elements = array_map(function ($element) { - return sprintf(' * %s', $element); - }, $elements); - - $this->writeln($elements); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function text($message) - { - $this->autoPrependText(); - - $messages = \is_array($message) ? array_values($message) : [$message]; - foreach ($messages as $message) { - $this->writeln(sprintf(' %s', $message)); - } - } - - /** - * Formats a command comment. - * - * @param string|array $message - */ - public function comment($message) - { - $this->block($message, null, null, ' // ', false, false); - } - - /** - * {@inheritdoc} - */ - public function success($message) - { - $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function error($message) - { - $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function warning($message) - { - $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function note($message) - { - $this->block($message, 'NOTE', 'fg=yellow', ' ! '); - } - - /** - * Formats an info message. - * - * @param string|array $message - */ - public function info($message) - { - $this->block($message, 'INFO', 'fg=green', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function caution($message) - { - $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); - } - - /** - * {@inheritdoc} - */ - public function table(array $headers, array $rows) - { - $this->createTable() - ->setHeaders($headers) - ->setRows($rows) - ->render() - ; - - $this->newLine(); - } - - /** - * Formats a horizontal table. - */ - public function horizontalTable(array $headers, array $rows) - { - $this->createTable() - ->setHorizontal(true) - ->setHeaders($headers) - ->setRows($rows) - ->render() - ; - - $this->newLine(); - } - - /** - * Formats a list of key/value horizontally. - * - * Each row can be one of: - * * 'A title' - * * ['key' => 'value'] - * * new TableSeparator() - * - * @param string|array|TableSeparator ...$list - */ - public function definitionList(...$list) - { - $headers = []; - $row = []; - foreach ($list as $value) { - if ($value instanceof TableSeparator) { - $headers[] = $value; - $row[] = $value; - continue; - } - if (\is_string($value)) { - $headers[] = new TableCell($value, ['colspan' => 2]); - $row[] = null; - continue; - } - if (!\is_array($value)) { - throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.'); - } - $headers[] = key($value); - $row[] = current($value); - } - - $this->horizontalTable($headers, [$row]); - } - - /** - * {@inheritdoc} - */ - public function ask(string $question, ?string $default = null, ?callable $validator = null) - { - $question = new Question($question, $default); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - /** - * {@inheritdoc} - */ - public function askHidden(string $question, ?callable $validator = null) - { - $question = new Question($question); - - $question->setHidden(true); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - /** - * {@inheritdoc} - */ - public function confirm(string $question, bool $default = true) - { - return $this->askQuestion(new ConfirmationQuestion($question, $default)); - } - - /** - * {@inheritdoc} - */ - public function choice(string $question, array $choices, $default = null) - { - if (null !== $default) { - $values = array_flip($choices); - $default = $values[$default] ?? $default; - } - - return $this->askQuestion(new ChoiceQuestion($question, $choices, $default)); - } - - /** - * {@inheritdoc} - */ - public function progressStart(int $max = 0) - { - $this->progressBar = $this->createProgressBar($max); - $this->progressBar->start(); - } - - /** - * {@inheritdoc} - */ - public function progressAdvance(int $step = 1) - { - $this->getProgressBar()->advance($step); - } - - /** - * {@inheritdoc} - */ - public function progressFinish() - { - $this->getProgressBar()->finish(); - $this->newLine(2); - $this->progressBar = null; - } - - /** - * {@inheritdoc} - */ - public function createProgressBar(int $max = 0) - { - $progressBar = parent::createProgressBar($max); - - if ('\\' !== \DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { - $progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 - $progressBar->setProgressCharacter(''); - $progressBar->setBarCharacter('▓'); // dark shade character \u2593 - } - - return $progressBar; - } - - /** - * @see ProgressBar::iterate() - */ - public function progressIterate(iterable $iterable, ?int $max = null): iterable - { - yield from $this->createProgressBar()->iterate($iterable, $max); - - $this->newLine(2); - } - - /** - * @return mixed - */ - public function askQuestion(Question $question) - { - if ($this->input->isInteractive()) { - $this->autoPrependBlock(); - } - - if (!$this->questionHelper) { - $this->questionHelper = new SymfonyQuestionHelper(); - } - - $answer = $this->questionHelper->ask($this->input, $this, $question); - - if ($this->input->isInteractive()) { - $this->newLine(); - $this->bufferedOutput->write("\n"); - } - - return $answer; - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, int $type = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::writeln($message, $type); - $this->writeBuffer($message, true, $type); - } - } - - /** - * {@inheritdoc} - */ - public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::write($message, $newline, $type); - $this->writeBuffer($message, $newline, $type); - } - } - - /** - * {@inheritdoc} - */ - public function newLine(int $count = 1) - { - parent::newLine($count); - $this->bufferedOutput->write(str_repeat("\n", $count)); - } - - /** - * Returns a new instance which makes use of stderr if available. - * - * @return self - */ - public function getErrorStyle() - { - return new self($this->input, $this->getErrorOutput()); - } - - public function createTable(): Table - { - $output = $this->output instanceof ConsoleOutputInterface ? $this->output->section() : $this->output; - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - return (new Table($output))->setStyle($style); - } - - private function getProgressBar(): ProgressBar - { - if (!$this->progressBar) { - throw new RuntimeException('The ProgressBar is not started.'); - } - - return $this->progressBar; - } - - private function autoPrependBlock(): void - { - $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); - - if (!isset($chars[0])) { - $this->newLine(); // empty history, so we should start with a new line. - - return; - } - // Prepend new line for each non LF chars (This means no blank line was output before) - $this->newLine(2 - substr_count($chars, "\n")); - } - - private function autoPrependText(): void - { - $fetched = $this->bufferedOutput->fetch(); - // Prepend new line if last char isn't EOL: - if (!str_ends_with($fetched, "\n")) { - $this->newLine(); - } - } - - private function writeBuffer(string $message, bool $newLine, int $type): void - { - // We need to know if the last chars are PHP_EOL - $this->bufferedOutput->write($message, $newLine, $type); - } - - private function createBlock(iterable $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array - { - $indentLength = 0; - $prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix)); - $lines = []; - - if (null !== $type) { - $type = sprintf('[%s] ', $type); - $indentLength = \strlen($type); - $lineIndentation = str_repeat(' ', $indentLength); - } - - // wrap and add newlines for each element - foreach ($messages as $key => $message) { - if ($escape) { - $message = OutputFormatter::escape($message); - } - - $decorationLength = Helper::width($message) - Helper::width(Helper::removeDecoration($this->getFormatter(), $message)); - $messageLineLength = min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength); - $messageLines = explode(\PHP_EOL, wordwrap($message, $messageLineLength, \PHP_EOL, true)); - foreach ($messageLines as $messageLine) { - $lines[] = $messageLine; - } - - if (\count($messages) > 1 && $key < \count($messages) - 1) { - $lines[] = ''; - } - } - - $firstLineIndex = 0; - if ($padding && $this->isDecorated()) { - $firstLineIndex = 1; - array_unshift($lines, ''); - $lines[] = ''; - } - - foreach ($lines as $i => &$line) { - if (null !== $type) { - $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line; - } - - $line = $prefix.$line; - $line .= str_repeat(' ', max($this->lineLength - Helper::width(Helper::removeDecoration($this->getFormatter(), $line)), 0)); - - if ($style) { - $line = sprintf('<%s>%s', $style, $line); - } - } - - return $lines; - } -} diff --git a/trunk/vendor/symfony/console/Terminal.php b/trunk/vendor/symfony/console/Terminal.php deleted file mode 100644 index b91e8afc..00000000 --- a/trunk/vendor/symfony/console/Terminal.php +++ /dev/null @@ -1,177 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -class Terminal -{ - private static $width; - private static $height; - private static $stty; - - /** - * Gets the terminal width. - * - * @return int - */ - public function getWidth() - { - $width = getenv('COLUMNS'); - if (false !== $width) { - return (int) trim($width); - } - - if (null === self::$width) { - self::initDimensions(); - } - - return self::$width ?: 80; - } - - /** - * Gets the terminal height. - * - * @return int - */ - public function getHeight() - { - $height = getenv('LINES'); - if (false !== $height) { - return (int) trim($height); - } - - if (null === self::$height) { - self::initDimensions(); - } - - return self::$height ?: 50; - } - - /** - * @internal - */ - public static function hasSttyAvailable(): bool - { - if (null !== self::$stty) { - return self::$stty; - } - - // skip check if shell_exec function is disabled - if (!\function_exists('shell_exec')) { - return false; - } - - return self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); - } - - private static function initDimensions() - { - if ('\\' === \DIRECTORY_SEPARATOR) { - $ansicon = getenv('ANSICON'); - if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) { - // extract [w, H] from "wxh (WxH)" - // or [w, h] from "wxh" - self::$width = (int) $matches[1]; - self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2]; - } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) { - // only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash) - // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT - self::initDimensionsUsingStty(); - } elseif (null !== $dimensions = self::getConsoleMode()) { - // extract [w, h] from "wxh" - self::$width = (int) $dimensions[0]; - self::$height = (int) $dimensions[1]; - } - } else { - self::initDimensionsUsingStty(); - } - } - - /** - * Returns whether STDOUT has vt100 support (some Windows 10+ configurations). - */ - private static function hasVt100Support(): bool - { - return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w')); - } - - /** - * Initializes dimensions using the output of an stty columns line. - */ - private static function initDimensionsUsingStty() - { - if ($sttyString = self::getSttyColumns()) { - if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) { - // extract [w, h] from "rows h; columns w;" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } elseif (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) { - // extract [w, h] from "; h rows; w columns" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } - } - } - - /** - * Runs and parses mode CON if it's available, suppressing any error output. - * - * @return int[]|null An array composed of the width and the height or null if it could not be parsed - */ - private static function getConsoleMode(): ?array - { - $info = self::readFromProcess('mode CON'); - - if (null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { - return null; - } - - return [(int) $matches[2], (int) $matches[1]]; - } - - /** - * Runs and parses stty -a if it's available, suppressing any error output. - */ - private static function getSttyColumns(): ?string - { - return self::readFromProcess('stty -a | grep columns'); - } - - private static function readFromProcess(string $command): ?string - { - if (!\function_exists('proc_open')) { - return null; - } - - $descriptorspec = [ - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ]; - - $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0; - - $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); - if (!\is_resource($process)) { - return null; - } - - $info = stream_get_contents($pipes[1]); - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - - if ($cp) { - sapi_windows_cp_set($cp); - } - - return $info; - } -} diff --git a/trunk/vendor/symfony/console/Tester/ApplicationTester.php b/trunk/vendor/symfony/console/Tester/ApplicationTester.php deleted file mode 100644 index 3a262e81..00000000 --- a/trunk/vendor/symfony/console/Tester/ApplicationTester.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console applications. - * - * When testing an application, don't forget to disable the auto exit flag: - * - * $application = new Application(); - * $application->setAutoExit(false); - * - * @author Fabien Potencier - */ -class ApplicationTester -{ - use TesterTrait; - - private $application; - - public function __construct(Application $application) - { - $this->application = $application; - } - - /** - * Executes the application. - * - * Available options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @return int The command exit code - */ - public function run(array $input, array $options = []) - { - $prevShellVerbosity = getenv('SHELL_VERBOSITY'); - - try { - $this->input = new ArrayInput($input); - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if ($this->inputs) { - $this->input->setStream(self::createStream($this->inputs)); - } - - $this->initOutput($options); - - return $this->statusCode = $this->application->run($this->input, $this->output); - } finally { - // SHELL_VERBOSITY is set by Application::configureIO so we need to unset/reset it - // to its previous value to avoid one test's verbosity to spread to the following tests - if (false === $prevShellVerbosity) { - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY'); - } - unset($_ENV['SHELL_VERBOSITY']); - unset($_SERVER['SHELL_VERBOSITY']); - } else { - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$prevShellVerbosity); - } - $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity; - } - } - } -} diff --git a/trunk/vendor/symfony/console/Tester/CommandCompletionTester.php b/trunk/vendor/symfony/console/Tester/CommandCompletionTester.php deleted file mode 100644 index ade73275..00000000 --- a/trunk/vendor/symfony/console/Tester/CommandCompletionTester.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; - -/** - * Eases the testing of command completion. - * - * @author Jérôme Tamarelle - */ -class CommandCompletionTester -{ - private $command; - - public function __construct(Command $command) - { - $this->command = $command; - } - - /** - * Create completion suggestions from input tokens. - */ - public function complete(array $input): array - { - $currentIndex = \count($input); - if ('' === end($input)) { - array_pop($input); - } - array_unshift($input, $this->command->getName()); - - $completionInput = CompletionInput::fromTokens($input, $currentIndex); - $completionInput->bind($this->command->getDefinition()); - $suggestions = new CompletionSuggestions(); - - $this->command->complete($completionInput, $suggestions); - - $options = []; - foreach ($suggestions->getOptionSuggestions() as $option) { - $options[] = '--'.$option->getName(); - } - - return array_map('strval', array_merge($options, $suggestions->getValueSuggestions())); - } -} diff --git a/trunk/vendor/symfony/console/Tester/CommandTester.php b/trunk/vendor/symfony/console/Tester/CommandTester.php deleted file mode 100644 index 6c15c25f..00000000 --- a/trunk/vendor/symfony/console/Tester/CommandTester.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console commands. - * - * @author Fabien Potencier - * @author Robin Chalas - */ -class CommandTester -{ - use TesterTrait; - - private $command; - - public function __construct(Command $command) - { - $this->command = $command; - } - - /** - * Executes the command. - * - * Available execution options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @param array $input An array of command arguments and options - * @param array $options An array of execution options - * - * @return int The command exit code - */ - public function execute(array $input, array $options = []) - { - // set the command name automatically if the application requires - // this argument and no command name was passed - if (!isset($input['command']) - && (null !== $application = $this->command->getApplication()) - && $application->getDefinition()->hasArgument('command') - ) { - $input = array_merge(['command' => $this->command->getName()], $input); - } - - $this->input = new ArrayInput($input); - // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN. - $this->input->setStream(self::createStream($this->inputs)); - - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if (!isset($options['decorated'])) { - $options['decorated'] = false; - } - - $this->initOutput($options); - - return $this->statusCode = $this->command->run($this->input, $this->output); - } -} diff --git a/trunk/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php b/trunk/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php deleted file mode 100644 index a4732423..00000000 --- a/trunk/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Console\Command\Command; - -final class CommandIsSuccessful extends Constraint -{ - /** - * {@inheritdoc} - */ - public function toString(): string - { - return 'is successful'; - } - - /** - * {@inheritdoc} - */ - protected function matches($other): bool - { - return Command::SUCCESS === $other; - } - - /** - * {@inheritdoc} - */ - protected function failureDescription($other): string - { - return 'the command '.$this->toString(); - } - - /** - * {@inheritdoc} - */ - protected function additionalFailureDescription($other): string - { - $mapping = [ - Command::FAILURE => 'Command failed.', - Command::INVALID => 'Command was invalid.', - ]; - - return $mapping[$other] ?? sprintf('Command returned exit status %d.', $other); - } -} diff --git a/trunk/vendor/symfony/console/Tester/TesterTrait.php b/trunk/vendor/symfony/console/Tester/TesterTrait.php deleted file mode 100644 index f454bbf9..00000000 --- a/trunk/vendor/symfony/console/Tester/TesterTrait.php +++ /dev/null @@ -1,197 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use PHPUnit\Framework\Assert; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Tester\Constraint\CommandIsSuccessful; - -/** - * @author Amrouche Hamza - */ -trait TesterTrait -{ - /** @var StreamOutput */ - private $output; - private $inputs = []; - private $captureStreamsIndependently = false; - /** @var InputInterface */ - private $input; - /** @var int */ - private $statusCode; - - /** - * Gets the display returned by the last execution of the command or application. - * - * @return string - * - * @throws \RuntimeException If it's called before the execute method - */ - public function getDisplay(bool $normalize = false) - { - if (null === $this->output) { - throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); - } - - rewind($this->output->getStream()); - - $display = stream_get_contents($this->output->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the output written to STDERR by the application. - * - * @param bool $normalize Whether to normalize end of lines to \n or not - * - * @return string - */ - public function getErrorOutput(bool $normalize = false) - { - if (!$this->captureStreamsIndependently) { - throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); - } - - rewind($this->output->getErrorOutput()->getStream()); - - $display = stream_get_contents($this->output->getErrorOutput()->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the input instance used by the last execution of the command or application. - * - * @return InputInterface - */ - public function getInput() - { - return $this->input; - } - - /** - * Gets the output instance used by the last execution of the command or application. - * - * @return OutputInterface - */ - public function getOutput() - { - return $this->output; - } - - /** - * Gets the status code returned by the last execution of the command or application. - * - * @return int - * - * @throws \RuntimeException If it's called before the execute method - */ - public function getStatusCode() - { - if (null === $this->statusCode) { - throw new \RuntimeException('Status code not initialized, did you execute the command before requesting the status code?'); - } - - return $this->statusCode; - } - - public function assertCommandIsSuccessful(string $message = ''): void - { - Assert::assertThat($this->statusCode, new CommandIsSuccessful(), $message); - } - - /** - * Sets the user inputs. - * - * @param array $inputs An array of strings representing each input - * passed to the command input stream - * - * @return $this - */ - public function setInputs(array $inputs) - { - $this->inputs = $inputs; - - return $this; - } - - /** - * Initializes the output property. - * - * Available options: - * - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - */ - private function initOutput(array $options) - { - $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; - if (!$this->captureStreamsIndependently) { - $this->output = new StreamOutput(fopen('php://memory', 'w', false)); - if (isset($options['decorated'])) { - $this->output->setDecorated($options['decorated']); - } - if (isset($options['verbosity'])) { - $this->output->setVerbosity($options['verbosity']); - } - } else { - $this->output = new ConsoleOutput( - $options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL, - $options['decorated'] ?? null - ); - - $errorOutput = new StreamOutput(fopen('php://memory', 'w', false)); - $errorOutput->setFormatter($this->output->getFormatter()); - $errorOutput->setVerbosity($this->output->getVerbosity()); - $errorOutput->setDecorated($this->output->isDecorated()); - - $reflectedOutput = new \ReflectionObject($this->output); - $strErrProperty = $reflectedOutput->getProperty('stderr'); - $strErrProperty->setAccessible(true); - $strErrProperty->setValue($this->output, $errorOutput); - - $reflectedParent = $reflectedOutput->getParentClass(); - $streamProperty = $reflectedParent->getProperty('stream'); - $streamProperty->setAccessible(true); - $streamProperty->setValue($this->output, fopen('php://memory', 'w', false)); - } - } - - /** - * @return resource - */ - private static function createStream(array $inputs) - { - $stream = fopen('php://memory', 'r+', false); - - foreach ($inputs as $input) { - fwrite($stream, $input.\PHP_EOL); - } - - rewind($stream); - - return $stream; - } -} diff --git a/trunk/vendor/symfony/deprecation-contracts/CHANGELOG.md b/trunk/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/trunk/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/trunk/vendor/symfony/deprecation-contracts/LICENSE b/trunk/vendor/symfony/deprecation-contracts/LICENSE deleted file mode 100644 index 406242ff..00000000 --- a/trunk/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/deprecation-contracts/function.php b/trunk/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index 2d56512b..00000000 --- a/trunk/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @param string $package The name of the Composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string $message The message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas - */ - function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void - { - @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); - } -} diff --git a/trunk/vendor/symfony/finder/CHANGELOG.md b/trunk/vendor/symfony/finder/CHANGELOG.md deleted file mode 100644 index 6a44e87c..00000000 --- a/trunk/vendor/symfony/finder/CHANGELOG.md +++ /dev/null @@ -1,87 +0,0 @@ -CHANGELOG -========= - -5.4.0 ------ - - * Deprecate `Comparator::setTarget()` and `Comparator::setOperator()` - * Add a constructor to `Comparator` that allows setting target and operator - * Finder's iterator has now `Symfony\Component\Finder\SplFileInfo` inner type specified - * Add recursive .gitignore files support - -5.0.0 ------ - - * added `$useNaturalSort` argument to `Finder::sortByName()` - -4.3.0 ------ - - * added Finder::ignoreVCSIgnored() to ignore files based on rules listed in .gitignore - -4.2.0 ------ - - * added $useNaturalSort option to Finder::sortByName() method - * the `Finder::sortByName()` method will have a new `$useNaturalSort` - argument in version 5.0, not defining it is deprecated - * added `Finder::reverseSorting()` to reverse the sorting - -4.0.0 ------ - - * removed `ExceptionInterface` - * removed `Symfony\Component\Finder\Iterator\FilterIterator` - -3.4.0 ------ - - * deprecated `Symfony\Component\Finder\Iterator\FilterIterator` - * added Finder::hasResults() method to check if any results were found - -3.3.0 ------ - - * added double-star matching to Glob::toRegex() - -3.0.0 ------ - - * removed deprecated classes - -2.8.0 ------ - - * deprecated adapters and related classes - -2.5.0 ------ - * added support for GLOB_BRACE in the paths passed to Finder::in() - -2.3.0 ------ - - * added a way to ignore unreadable directories (via Finder::ignoreUnreadableDirs()) - * unified the way subfolders that are not executable are handled by always throwing an AccessDeniedException exception - -2.2.0 ------ - - * added Finder::path() and Finder::notPath() methods - * added finder adapters to improve performance on specific platforms - * added support for wildcard characters (glob patterns) in the paths passed - to Finder::in() - -2.1.0 ------ - - * added Finder::sortByAccessedTime(), Finder::sortByChangedTime(), and - Finder::sortByModifiedTime() - * added Countable to Finder - * added support for an array of directories as an argument to - Finder::exclude() - * added searching based on the file content via Finder::contains() and - Finder::notContains() - * added support for the != operator in the Comparator - * [BC BREAK] filter expressions (used for file name and content) are no more - considered as regexps but glob patterns when they are enclosed in '*' or '?' diff --git a/trunk/vendor/symfony/finder/Comparator/Comparator.php b/trunk/vendor/symfony/finder/Comparator/Comparator.php deleted file mode 100644 index 23cf94ec..00000000 --- a/trunk/vendor/symfony/finder/Comparator/Comparator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * @author Fabien Potencier - */ -class Comparator -{ - private $target; - private $operator = '=='; - - public function __construct(?string $target = null, string $operator = '==') - { - if (null === $target) { - trigger_deprecation('symfony/finder', '5.4', 'Constructing a "%s" without setting "$target" is deprecated.', __CLASS__); - } - - $this->target = $target; - $this->doSetOperator($operator); - } - - /** - * Gets the target value. - * - * @return string - */ - public function getTarget() - { - if (null === $this->target) { - trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); - } - - return $this->target; - } - - /** - * @deprecated set the target via the constructor instead - */ - public function setTarget(string $target) - { - trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the target via the constructor instead.', __METHOD__); - - $this->target = $target; - } - - /** - * Gets the comparison operator. - * - * @return string - */ - public function getOperator() - { - return $this->operator; - } - - /** - * Sets the comparison operator. - * - * @throws \InvalidArgumentException - * - * @deprecated set the operator via the constructor instead - */ - public function setOperator(string $operator) - { - trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the operator via the constructor instead.', __METHOD__); - - $this->doSetOperator('' === $operator ? '==' : $operator); - } - - /** - * Tests against the target. - * - * @param mixed $test A test value - * - * @return bool - */ - public function test($test) - { - if (null === $this->target) { - trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); - } - - switch ($this->operator) { - case '>': - return $test > $this->target; - case '>=': - return $test >= $this->target; - case '<': - return $test < $this->target; - case '<=': - return $test <= $this->target; - case '!=': - return $test != $this->target; - } - - return $test == $this->target; - } - - private function doSetOperator(string $operator): void - { - if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); - } - - $this->operator = $operator; - } -} diff --git a/trunk/vendor/symfony/finder/Comparator/DateComparator.php b/trunk/vendor/symfony/finder/Comparator/DateComparator.php deleted file mode 100644 index 8f651e14..00000000 --- a/trunk/vendor/symfony/finder/Comparator/DateComparator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * DateCompare compiles date comparisons. - * - * @author Fabien Potencier - */ -class DateComparator extends Comparator -{ - /** - * @param string $test A comparison string - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); - } - - try { - $date = new \DateTime($matches[2]); - $target = $date->format('U'); - } catch (\Exception $e) { - throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); - } - - $operator = $matches[1] ?? '=='; - if ('since' === $operator || 'after' === $operator) { - $operator = '>'; - } - - if ('until' === $operator || 'before' === $operator) { - $operator = '<'; - } - - parent::__construct($target, $operator); - } -} diff --git a/trunk/vendor/symfony/finder/Comparator/NumberComparator.php b/trunk/vendor/symfony/finder/Comparator/NumberComparator.php deleted file mode 100644 index dd308207..00000000 --- a/trunk/vendor/symfony/finder/Comparator/NumberComparator.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * NumberComparator compiles a simple comparison to an anonymous - * subroutine, which you can call with a value to be tested again. - * - * Now this would be very pointless, if NumberCompare didn't understand - * magnitudes. - * - * The target value may use magnitudes of kilobytes (k, ki), - * megabytes (m, mi), or gigabytes (g, gi). Those suffixed - * with an i use the appropriate 2**n version in accordance with the - * IEC standard: http://physics.nist.gov/cuu/Units/binary.html - * - * Based on the Perl Number::Compare module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - * - * @see http://physics.nist.gov/cuu/Units/binary.html - */ -class NumberComparator extends Comparator -{ - /** - * @param string|null $test A comparison string or null - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(?string $test) - { - if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null')); - } - - $target = $matches[2]; - if (!is_numeric($target)) { - throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target)); - } - if (isset($matches[3])) { - // magnitude - switch (strtolower($matches[3])) { - case 'k': - $target *= 1000; - break; - case 'ki': - $target *= 1024; - break; - case 'm': - $target *= 1000000; - break; - case 'mi': - $target *= 1024 * 1024; - break; - case 'g': - $target *= 1000000000; - break; - case 'gi': - $target *= 1024 * 1024 * 1024; - break; - } - } - - parent::__construct($target, $matches[1] ?: '=='); - } -} diff --git a/trunk/vendor/symfony/finder/Exception/AccessDeniedException.php b/trunk/vendor/symfony/finder/Exception/AccessDeniedException.php deleted file mode 100644 index ee195ea8..00000000 --- a/trunk/vendor/symfony/finder/Exception/AccessDeniedException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Jean-François Simon - */ -class AccessDeniedException extends \UnexpectedValueException -{ -} diff --git a/trunk/vendor/symfony/finder/Exception/DirectoryNotFoundException.php b/trunk/vendor/symfony/finder/Exception/DirectoryNotFoundException.php deleted file mode 100644 index c6cc0f27..00000000 --- a/trunk/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Andreas Erhard - */ -class DirectoryNotFoundException extends \InvalidArgumentException -{ -} diff --git a/trunk/vendor/symfony/finder/Finder.php b/trunk/vendor/symfony/finder/Finder.php deleted file mode 100644 index 0b569655..00000000 --- a/trunk/vendor/symfony/finder/Finder.php +++ /dev/null @@ -1,806 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -use Symfony\Component\Finder\Comparator\DateComparator; -use Symfony\Component\Finder\Comparator\NumberComparator; -use Symfony\Component\Finder\Exception\DirectoryNotFoundException; -use Symfony\Component\Finder\Iterator\CustomFilterIterator; -use Symfony\Component\Finder\Iterator\DateRangeFilterIterator; -use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator; -use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator; -use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; -use Symfony\Component\Finder\Iterator\FilenameFilterIterator; -use Symfony\Component\Finder\Iterator\LazyIterator; -use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator; -use Symfony\Component\Finder\Iterator\SortableIterator; - -/** - * Finder allows to build rules to find files and directories. - * - * It is a thin wrapper around several specialized iterator classes. - * - * All rules may be invoked several times. - * - * All methods return the current Finder object to allow chaining: - * - * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class Finder implements \IteratorAggregate, \Countable -{ - public const IGNORE_VCS_FILES = 1; - public const IGNORE_DOT_FILES = 2; - public const IGNORE_VCS_IGNORED_FILES = 4; - - private $mode = 0; - private $names = []; - private $notNames = []; - private $exclude = []; - private $filters = []; - private $depths = []; - private $sizes = []; - private $followLinks = false; - private $reverseSorting = false; - private $sort = false; - private $ignore = 0; - private $dirs = []; - private $dates = []; - private $iterators = []; - private $contains = []; - private $notContains = []; - private $paths = []; - private $notPaths = []; - private $ignoreUnreadableDirs = false; - - private static $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; - - public function __construct() - { - $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; - } - - /** - * Creates a new Finder. - * - * @return static - */ - public static function create() - { - return new static(); - } - - /** - * Restricts the matching to directories only. - * - * @return $this - */ - public function directories() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; - - return $this; - } - - /** - * Restricts the matching to files only. - * - * @return $this - */ - public function files() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; - - return $this; - } - - /** - * Adds tests for the directory depth. - * - * Usage: - * - * $finder->depth('> 1') // the Finder will start matching at level 1. - * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. - * $finder->depth(['>= 1', '< 3']) - * - * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels - * - * @return $this - * - * @see DepthRangeFilterIterator - * @see NumberComparator - */ - public function depth($levels) - { - foreach ((array) $levels as $level) { - $this->depths[] = new Comparator\NumberComparator($level); - } - - return $this; - } - - /** - * Adds tests for file dates (last modified). - * - * The date must be something that strtotime() is able to parse: - * - * $finder->date('since yesterday'); - * $finder->date('until 2 days ago'); - * $finder->date('> now - 2 hours'); - * $finder->date('>= 2005-10-15'); - * $finder->date(['>= 2005-10-15', '<= 2006-05-27']); - * - * @param string|string[] $dates A date range string or an array of date ranges - * - * @return $this - * - * @see strtotime - * @see DateRangeFilterIterator - * @see DateComparator - */ - public function date($dates) - { - foreach ((array) $dates as $date) { - $this->dates[] = new Comparator\DateComparator($date); - } - - return $this; - } - - /** - * Adds rules that files must match. - * - * You can use patterns (delimited with / sign), globs or simple strings. - * - * $finder->name('/\.php$/') - * $finder->name('*.php') // same as above, without dot files - * $finder->name('test.php') - * $finder->name(['test.py', 'test.php']) - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function name($patterns) - { - $this->names = array_merge($this->names, (array) $patterns); - - return $this; - } - - /** - * Adds rules that files must not match. - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notName($patterns) - { - $this->notNames = array_merge($this->notNames, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must match. - * - * Strings or PCRE patterns can be used: - * - * $finder->contains('Lorem ipsum') - * $finder->contains('/Lorem ipsum/i') - * $finder->contains(['dolor', '/ipsum/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function contains($patterns) - { - $this->contains = array_merge($this->contains, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must not match. - * - * Strings or PCRE patterns can be used: - * - * $finder->notContains('Lorem ipsum') - * $finder->notContains('/Lorem ipsum/i') - * $finder->notContains(['lorem', '/dolor/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function notContains($patterns) - { - $this->notContains = array_merge($this->notContains, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->path('some/special/dir') - * $finder->path('/some\/special\/dir/') // same as above - * $finder->path(['some dir', 'another/dir']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function path($patterns) - { - $this->paths = array_merge($this->paths, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must not match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->notPath('some/special/dir') - * $finder->notPath('/some\/special\/dir/') // same as above - * $finder->notPath(['some/file.txt', 'another/file.log']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notPath($patterns) - { - $this->notPaths = array_merge($this->notPaths, (array) $patterns); - - return $this; - } - - /** - * Adds tests for file sizes. - * - * $finder->size('> 10K'); - * $finder->size('<= 1Ki'); - * $finder->size(4); - * $finder->size(['> 10K', '< 20K']) - * - * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges - * - * @return $this - * - * @see SizeRangeFilterIterator - * @see NumberComparator - */ - public function size($sizes) - { - foreach ((array) $sizes as $size) { - $this->sizes[] = new Comparator\NumberComparator($size); - } - - return $this; - } - - /** - * Excludes directories. - * - * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: - * - * $finder->in(__DIR__)->exclude('ruby'); - * - * @param string|array $dirs A directory path or an array of directories - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function exclude($dirs) - { - $this->exclude = array_merge($this->exclude, (array) $dirs); - - return $this; - } - - /** - * Excludes "hidden" directories and files (starting with a dot). - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreDotFiles(bool $ignoreDotFiles) - { - if ($ignoreDotFiles) { - $this->ignore |= static::IGNORE_DOT_FILES; - } else { - $this->ignore &= ~static::IGNORE_DOT_FILES; - } - - return $this; - } - - /** - * Forces the finder to ignore version control directories. - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreVCS(bool $ignoreVCS) - { - if ($ignoreVCS) { - $this->ignore |= static::IGNORE_VCS_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_FILES; - } - - return $this; - } - - /** - * Forces Finder to obey .gitignore and ignore files based on rules listed there. - * - * This option is disabled by default. - * - * @return $this - */ - public function ignoreVCSIgnored(bool $ignoreVCSIgnored) - { - if ($ignoreVCSIgnored) { - $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES; - } - - return $this; - } - - /** - * Adds VCS patterns. - * - * @see ignoreVCS() - * - * @param string|string[] $pattern VCS patterns to ignore - */ - public static function addVCSPattern($pattern) - { - foreach ((array) $pattern as $p) { - self::$vcsPatterns[] = $p; - } - - self::$vcsPatterns = array_unique(self::$vcsPatterns); - } - - /** - * Sorts files and directories by an anonymous function. - * - * The anonymous function receives two \SplFileInfo instances to compare. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sort(\Closure $closure) - { - $this->sort = $closure; - - return $this; - } - - /** - * Sorts files and directories by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByName(bool $useNaturalSort = false) - { - $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; - - return $this; - } - - /** - * Sorts files and directories by type (directories before files), then by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByType() - { - $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; - - return $this; - } - - /** - * Sorts files and directories by the last accessed time. - * - * This is the time that the file was last accessed, read or written to. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByAccessedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; - - return $this; - } - - /** - * Reverses the sorting. - * - * @return $this - */ - public function reverseSorting() - { - $this->reverseSorting = true; - - return $this; - } - - /** - * Sorts files and directories by the last inode changed time. - * - * This is the time that the inode information was last modified (permissions, owner, group or other metadata). - * - * On Windows, since inode is not available, changed time is actually the file creation time. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByChangedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; - - return $this; - } - - /** - * Sorts files and directories by the last modified time. - * - * This is the last time the actual contents of the file were last modified. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByModifiedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; - - return $this; - } - - /** - * Filters the iterator with an anonymous function. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @return $this - * - * @see CustomFilterIterator - */ - public function filter(\Closure $closure) - { - $this->filters[] = $closure; - - return $this; - } - - /** - * Forces the following of symlinks. - * - * @return $this - */ - public function followLinks() - { - $this->followLinks = true; - - return $this; - } - - /** - * Tells finder to ignore unreadable directories. - * - * By default, scanning unreadable directories content throws an AccessDeniedException. - * - * @return $this - */ - public function ignoreUnreadableDirs(bool $ignore = true) - { - $this->ignoreUnreadableDirs = $ignore; - - return $this; - } - - /** - * Searches files and directories which match defined rules. - * - * @param string|string[] $dirs A directory path or an array of directories - * - * @return $this - * - * @throws DirectoryNotFoundException if one of the directories does not exist - */ - public function in($dirs) - { - $resolvedDirs = []; - - foreach ((array) $dirs as $dir) { - if (is_dir($dir)) { - $resolvedDirs[] = [$this->normalizeDir($dir)]; - } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) { - sort($glob); - $resolvedDirs[] = array_map([$this, 'normalizeDir'], $glob); - } else { - throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir)); - } - } - - $this->dirs = array_merge($this->dirs, ...$resolvedDirs); - - return $this; - } - - /** - * Returns an Iterator for the current Finder configuration. - * - * This method implements the IteratorAggregate interface. - * - * @return \Iterator - * - * @throws \LogicException if the in() method has not been called - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { - throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); - } - - if (1 === \count($this->dirs) && 0 === \count($this->iterators)) { - $iterator = $this->searchInDirectory($this->dirs[0]); - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - $iterator = new \AppendIterator(); - foreach ($this->dirs as $dir) { - $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) { - return $this->searchInDirectory($dir); - }))); - } - - foreach ($this->iterators as $it) { - $iterator->append($it); - } - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - /** - * Appends an existing set of files/directories to the finder. - * - * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. - * - * @return $this - * - * @throws \InvalidArgumentException when the given argument is not iterable - */ - public function append(iterable $iterator) - { - if ($iterator instanceof \IteratorAggregate) { - $this->iterators[] = $iterator->getIterator(); - } elseif ($iterator instanceof \Iterator) { - $this->iterators[] = $iterator; - } elseif (is_iterable($iterator)) { - $it = new \ArrayIterator(); - foreach ($iterator as $file) { - $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); - $it[$file->getPathname()] = $file; - } - $this->iterators[] = $it; - } else { - throw new \InvalidArgumentException('Finder::append() method wrong argument type.'); - } - - return $this; - } - - /** - * Check if any results were found. - * - * @return bool - */ - public function hasResults() - { - foreach ($this->getIterator() as $_) { - return true; - } - - return false; - } - - /** - * Counts all the results collected by the iterators. - * - * @return int - */ - #[\ReturnTypeWillChange] - public function count() - { - return iterator_count($this->getIterator()); - } - - private function searchInDirectory(string $dir): \Iterator - { - $exclude = $this->exclude; - $notPaths = $this->notPaths; - - if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { - $exclude = array_merge($exclude, self::$vcsPatterns); - } - - if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { - $notPaths[] = '#(^|/)\..+(/|$)#'; - } - - $minDepth = 0; - $maxDepth = \PHP_INT_MAX; - - foreach ($this->depths as $comparator) { - switch ($comparator->getOperator()) { - case '>': - $minDepth = $comparator->getTarget() + 1; - break; - case '>=': - $minDepth = $comparator->getTarget(); - break; - case '<': - $maxDepth = $comparator->getTarget() - 1; - break; - case '<=': - $maxDepth = $comparator->getTarget(); - break; - default: - $minDepth = $maxDepth = $comparator->getTarget(); - } - } - - $flags = \RecursiveDirectoryIterator::SKIP_DOTS; - - if ($this->followLinks) { - $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; - } - - $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); - - if ($exclude) { - $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude); - } - - $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); - - if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) { - $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); - } - - if ($this->mode) { - $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode); - } - - if ($this->names || $this->notNames) { - $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames); - } - - if ($this->contains || $this->notContains) { - $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains); - } - - if ($this->sizes) { - $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes); - } - - if ($this->dates) { - $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates); - } - - if ($this->filters) { - $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); - } - - if ($this->paths || $notPaths) { - $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths); - } - - if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) { - $iterator = new Iterator\VcsIgnoredFilterIterator($iterator, $dir); - } - - return $iterator; - } - - /** - * Normalizes given directory names by removing trailing slashes. - * - * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper - */ - private function normalizeDir(string $dir): string - { - if ('/' === $dir) { - return $dir; - } - - $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR); - - if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) { - $dir .= '/'; - } - - return $dir; - } -} diff --git a/trunk/vendor/symfony/finder/Gitignore.php b/trunk/vendor/symfony/finder/Gitignore.php deleted file mode 100644 index d42cca1d..00000000 --- a/trunk/vendor/symfony/finder/Gitignore.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Gitignore matches against text. - * - * @author Michael Voříšek - * @author Ahmed Abdou - */ -class Gitignore -{ - /** - * Returns a regexp which is the equivalent of the gitignore pattern. - * - * Format specification: https://git-scm.com/docs/gitignore#_pattern_format - */ - public static function toRegex(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, false); - } - - public static function toRegexMatchingNegatedPatterns(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, true); - } - - private static function buildRegex(string $gitignoreFileContent, bool $inverted): string - { - $gitignoreFileContent = preg_replace('~(? - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Glob matches globbing patterns against text. - * - * if match_glob("foo.*", "foo.bar") echo "matched\n"; - * - * // prints foo.bar and foo.baz - * $regex = glob_to_regex("foo.*"); - * for (['foo.bar', 'foo.baz', 'foo', 'bar'] as $t) - * { - * if (/$regex/) echo "matched: $car\n"; - * } - * - * Glob implements glob(3) style matching that can be used to match - * against text, rather than fetching names from a filesystem. - * - * Based on the Perl Text::Glob module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - */ -class Glob -{ - /** - * Returns a regexp which is the equivalent of the glob pattern. - * - * @return string - */ - public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#') - { - $firstByte = true; - $escaping = false; - $inCurlies = 0; - $regex = ''; - $sizeGlob = \strlen($glob); - for ($i = 0; $i < $sizeGlob; ++$i) { - $car = $glob[$i]; - if ($firstByte && $strictLeadingDot && '.' !== $car) { - $regex .= '(?=[^\.])'; - } - - $firstByte = '/' === $car; - - if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) { - $car = '[^/]++/'; - if (!isset($glob[$i + 3])) { - $car .= '?'; - } - - if ($strictLeadingDot) { - $car = '(?=[^\.])'.$car; - } - - $car = '/(?:'.$car.')*'; - $i += 2 + isset($glob[$i + 3]); - - if ('/' === $delimiter) { - $car = str_replace('/', '\\/', $car); - } - } - - if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { - $regex .= "\\$car"; - } elseif ('*' === $car) { - $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); - } elseif ('?' === $car) { - $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); - } elseif ('{' === $car) { - $regex .= $escaping ? '\\{' : '('; - if (!$escaping) { - ++$inCurlies; - } - } elseif ('}' === $car && $inCurlies) { - $regex .= $escaping ? '}' : ')'; - if (!$escaping) { - --$inCurlies; - } - } elseif (',' === $car && $inCurlies) { - $regex .= $escaping ? ',' : '|'; - } elseif ('\\' === $car) { - if ($escaping) { - $regex .= '\\\\'; - $escaping = false; - } else { - $escaping = true; - } - - continue; - } else { - $regex .= $car; - } - $escaping = false; - } - - return $delimiter.'^'.$regex.'$'.$delimiter; - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/CustomFilterIterator.php deleted file mode 100644 index f7bf19b8..00000000 --- a/trunk/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * CustomFilterIterator filters files by applying anonymous functions. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class CustomFilterIterator extends \FilterIterator -{ - private $filters = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param callable[] $filters An array of PHP callbacks - * - * @throws \InvalidArgumentException - */ - public function __construct(\Iterator $iterator, array $filters) - { - foreach ($filters as $filter) { - if (!\is_callable($filter)) { - throw new \InvalidArgumentException('Invalid PHP callback.'); - } - } - $this->filters = $filters; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - - foreach ($this->filters as $filter) { - if (false === $filter($fileinfo)) { - return false; - } - } - - return true; - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php deleted file mode 100644 index f592e191..00000000 --- a/trunk/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\DateComparator; - -/** - * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class DateRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator - * @param DateComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - - if (!file_exists($fileinfo->getPathname())) { - return false; - } - - $filedate = $fileinfo->getMTime(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filedate)) { - return false; - } - } - - return true; - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php deleted file mode 100644 index f593a3f0..00000000 --- a/trunk/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * DepthRangeFilterIterator limits the directory depth. - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -class DepthRangeFilterIterator extends \FilterIterator -{ - private $minDepth = 0; - - /** - * @param \RecursiveIteratorIterator<\RecursiveIterator> $iterator The Iterator to filter - * @param int $minDepth The min depth - * @param int $maxDepth The max depth - */ - public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX) - { - $this->minDepth = $minDepth; - $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth); - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - return $this->getInnerIterator()->getDepth() >= $this->minDepth; - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php deleted file mode 100644 index 39797c82..00000000 --- a/trunk/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * ExcludeDirectoryFilterIterator filters out directories. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - * - * @implements \RecursiveIterator - */ -class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator -{ - private $iterator; - private $isRecursive; - private $excludedDirs = []; - private $excludedPattern; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $directories An array of directories to exclude - */ - public function __construct(\Iterator $iterator, array $directories) - { - $this->iterator = $iterator; - $this->isRecursive = $iterator instanceof \RecursiveIterator; - $patterns = []; - foreach ($directories as $directory) { - $directory = rtrim($directory, '/'); - if (!$this->isRecursive || str_contains($directory, '/')) { - $patterns[] = preg_quote($directory, '#'); - } else { - $this->excludedDirs[$directory] = true; - } - } - if ($patterns) { - $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; - } - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { - return false; - } - - if ($this->excludedPattern) { - $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath(); - $path = str_replace('\\', '/', $path); - - return !preg_match($this->excludedPattern, $path); - } - - return true; - } - - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function hasChildren() - { - return $this->isRecursive && $this->iterator->hasChildren(); - } - - /** - * @return self - */ - #[\ReturnTypeWillChange] - public function getChildren() - { - $children = new self($this->iterator->getChildren(), []); - $children->excludedDirs = $this->excludedDirs; - $children->excludedPattern = $this->excludedPattern; - - return $children; - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php deleted file mode 100644 index 793ae350..00000000 --- a/trunk/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FileTypeFilterIterator only keeps files, directories, or both. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class FileTypeFilterIterator extends \FilterIterator -{ - public const ONLY_FILES = 1; - public const ONLY_DIRECTORIES = 2; - - private $mode; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) - */ - public function __construct(\Iterator $iterator, int $mode) - { - $this->mode = $mode; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { - return false; - } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) { - return false; - } - - return true; - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php deleted file mode 100644 index 79f8c29d..00000000 --- a/trunk/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class FilecontentFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - if (!$this->matchRegexps && !$this->noMatchRegexps) { - return true; - } - - $fileinfo = $this->current(); - - if ($fileinfo->isDir() || !$fileinfo->isReadable()) { - return false; - } - - $content = $fileinfo->getContents(); - if (!$content) { - return false; - } - - return $this->isAccepted($content); - } - - /** - * Converts string to regexp if necessary. - * - * @param string $str Pattern: string or regexp - * - * @return string - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/FilenameFilterIterator.php deleted file mode 100644 index 77b3b241..00000000 --- a/trunk/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Glob; - -/** - * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). - * - * @author Fabien Potencier - * - * @extends MultiplePcreFilterIterator - */ -class FilenameFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - return $this->isAccepted($this->current()->getFilename()); - } - - /** - * Converts glob to regexp. - * - * PCRE patterns are left unchanged. - * Glob strings are transformed with Glob::toRegex(). - * - * @param string $str Pattern: glob or regexp - * - * @return string - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : Glob::toRegex($str); - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/LazyIterator.php b/trunk/vendor/symfony/finder/Iterator/LazyIterator.php deleted file mode 100644 index 32cc37ff..00000000 --- a/trunk/vendor/symfony/finder/Iterator/LazyIterator.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * @author Jérémy Derussé - * - * @internal - */ -class LazyIterator implements \IteratorAggregate -{ - private $iteratorFactory; - - public function __construct(callable $iteratorFactory) - { - $this->iteratorFactory = $iteratorFactory; - } - - public function getIterator(): \Traversable - { - yield from ($this->iteratorFactory)(); - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php deleted file mode 100644 index 564765d8..00000000 --- a/trunk/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -abstract class MultiplePcreFilterIterator extends \FilterIterator -{ - protected $matchRegexps = []; - protected $noMatchRegexps = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $matchPatterns An array of patterns that need to match - * @param string[] $noMatchPatterns An array of patterns that need to not match - */ - public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) - { - foreach ($matchPatterns as $pattern) { - $this->matchRegexps[] = $this->toRegex($pattern); - } - - foreach ($noMatchPatterns as $pattern) { - $this->noMatchRegexps[] = $this->toRegex($pattern); - } - - parent::__construct($iterator); - } - - /** - * Checks whether the string is accepted by the regex filters. - * - * If there is no regexps defined in the class, this method will accept the string. - * Such case can be handled by child classes before calling the method if they want to - * apply a different behavior. - * - * @return bool - */ - protected function isAccepted(string $string) - { - // should at least not match one rule to exclude - foreach ($this->noMatchRegexps as $regex) { - if (preg_match($regex, $string)) { - return false; - } - } - - // should at least match one rule - if ($this->matchRegexps) { - foreach ($this->matchRegexps as $regex) { - if (preg_match($regex, $string)) { - return true; - } - } - - return false; - } - - // If there is no match rules, the file is accepted - return true; - } - - /** - * Checks whether the string is a regex. - * - * @return bool - */ - protected function isRegex(string $str) - { - $availableModifiers = 'imsxuADU'; - - if (\PHP_VERSION_ID >= 80200) { - $availableModifiers .= 'n'; - } - - if (preg_match('/^(.{3,}?)['.$availableModifiers.']*$/', $str, $m)) { - $start = substr($m[1], 0, 1); - $end = substr($m[1], -1); - - if ($start === $end) { - return !preg_match('/[*?[:alnum:] \\\\]/', $start); - } - - foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) { - if ($start === $delimiters[0] && $end === $delimiters[1]) { - return true; - } - } - } - - return false; - } - - /** - * Converts string into regexp. - * - * @return string - */ - abstract protected function toRegex(string $str); -} diff --git a/trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php deleted file mode 100644 index 7974c4ee..00000000 --- a/trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * PathFilterIterator filters files by path patterns (e.g. some/special/dir). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class PathFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $filename = $this->current()->getRelativePathname(); - - if ('\\' === \DIRECTORY_SEPARATOR) { - $filename = str_replace('\\', '/', $filename); - } - - return $this->isAccepted($filename); - } - - /** - * Converts strings to regexp. - * - * PCRE patterns are left unchanged. - * - * Default conversion: - * 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' - * - * Use only / as directory separator (on Windows also). - * - * @param string $str Pattern: regexp or dirname - * - * @return string - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/trunk/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php deleted file mode 100644 index 886dae58..00000000 --- a/trunk/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Exception\AccessDeniedException; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Extends the \RecursiveDirectoryIterator to support relative paths. - * - * @author Victor Berchet - */ -class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator -{ - /** - * @var bool - */ - private $ignoreUnreadableDirs; - - /** - * @var bool - */ - private $ignoreFirstRewind = true; - - // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private $rootPath; - private $subPath; - private $directorySeparator = '/'; - - /** - * @throws \RuntimeException - */ - public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) - { - if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) { - throw new \RuntimeException('This iterator only support returning current as fileinfo.'); - } - - parent::__construct($path, $flags); - $this->ignoreUnreadableDirs = $ignoreUnreadableDirs; - $this->rootPath = $path; - if ('/' !== \DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) { - $this->directorySeparator = \DIRECTORY_SEPARATOR; - } - } - - /** - * Return an instance of SplFileInfo with support for relative paths. - * - * @return SplFileInfo - */ - #[\ReturnTypeWillChange] - public function current() - { - // the logic here avoids redoing the same work in all iterations - - if (null === $subPathname = $this->subPath) { - $subPathname = $this->subPath = $this->getSubPath(); - } - if ('' !== $subPathname) { - $subPathname .= $this->directorySeparator; - } - $subPathname .= $this->getFilename(); - - if ('/' !== $basePath = $this->rootPath) { - $basePath .= $this->directorySeparator; - } - - return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); - } - - /** - * @param bool $allowLinks - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function hasChildren($allowLinks = false) - { - $hasChildren = parent::hasChildren($allowLinks); - - if (!$hasChildren || !$this->ignoreUnreadableDirs) { - return $hasChildren; - } - - try { - parent::getChildren(); - - return true; - } catch (\UnexpectedValueException $e) { - // If directory is unreadable and finder is set to ignore it, skip children - return false; - } - } - - /** - * @return \RecursiveDirectoryIterator - * - * @throws AccessDeniedException - */ - #[\ReturnTypeWillChange] - public function getChildren() - { - try { - $children = parent::getChildren(); - - if ($children instanceof self) { - // parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore - $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; - - // performance optimization to avoid redoing the same work in all children - $children->rootPath = $this->rootPath; - } - - return $children; - } catch (\UnexpectedValueException $e) { - throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function next() - { - $this->ignoreFirstRewind = false; - - parent::next(); - } - - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function rewind() - { - // some streams like FTP are not rewindable, ignore the first rewind after creation, - // as newly created DirectoryIterator does not need to be rewound - if ($this->ignoreFirstRewind) { - $this->ignoreFirstRewind = false; - - return; - } - - parent::rewind(); - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php deleted file mode 100644 index 575bf29b..00000000 --- a/trunk/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\NumberComparator; - -/** - * SizeRangeFilterIterator filters out files that are not in the given size range. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class SizeRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator - * @param NumberComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - if (!$fileinfo->isFile()) { - return true; - } - - $filesize = $fileinfo->getSize(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filesize)) { - return false; - } - } - - return true; - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/SortableIterator.php b/trunk/vendor/symfony/finder/Iterator/SortableIterator.php deleted file mode 100644 index 9afde5c2..00000000 --- a/trunk/vendor/symfony/finder/Iterator/SortableIterator.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * SortableIterator applies a sort on a given Iterator. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class SortableIterator implements \IteratorAggregate -{ - public const SORT_BY_NONE = 0; - public const SORT_BY_NAME = 1; - public const SORT_BY_TYPE = 2; - public const SORT_BY_ACCESSED_TIME = 3; - public const SORT_BY_CHANGED_TIME = 4; - public const SORT_BY_MODIFIED_TIME = 5; - public const SORT_BY_NAME_NATURAL = 6; - - private $iterator; - private $sort; - - /** - * @param \Traversable $iterator - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) - * - * @throws \InvalidArgumentException - */ - public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false) - { - $this->iterator = $iterator; - $order = $reverseOrder ? -1 : 1; - - if (self::SORT_BY_NAME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_NAME_NATURAL === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_TYPE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - if ($a->isDir() && $b->isFile()) { - return -$order; - } elseif ($a->isFile() && $b->isDir()) { - return $order; - } - - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getATime() - $b->getATime()); - }; - } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getCTime() - $b->getCTime()); - }; - } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getMTime() - $b->getMTime()); - }; - } elseif (self::SORT_BY_NONE === $sort) { - $this->sort = $order; - } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort; - } else { - throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); - } - } - - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - if (1 === $this->sort) { - return $this->iterator; - } - - $array = iterator_to_array($this->iterator, true); - - if (-1 === $this->sort) { - $array = array_reverse($array); - } else { - uasort($array, $this->sort); - } - - return new \ArrayIterator($array); - } -} diff --git a/trunk/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/trunk/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php deleted file mode 100644 index e27158cb..00000000 --- a/trunk/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Gitignore; - -final class VcsIgnoredFilterIterator extends \FilterIterator -{ - /** - * @var string - */ - private $baseDir; - - /** - * @var array - */ - private $gitignoreFilesCache = []; - - /** - * @var array - */ - private $ignoredPathsCache = []; - - public function __construct(\Iterator $iterator, string $baseDir) - { - $this->baseDir = $this->normalizePath($baseDir); - - parent::__construct($iterator); - } - - public function accept(): bool - { - $file = $this->current(); - - $fileRealPath = $this->normalizePath($file->getRealPath()); - - return !$this->isIgnored($fileRealPath); - } - - private function isIgnored(string $fileRealPath): bool - { - if (is_dir($fileRealPath) && !str_ends_with($fileRealPath, '/')) { - $fileRealPath .= '/'; - } - - if (isset($this->ignoredPathsCache[$fileRealPath])) { - return $this->ignoredPathsCache[$fileRealPath]; - } - - $ignored = false; - - foreach ($this->parentsDirectoryDownward($fileRealPath) as $parentDirectory) { - if ($this->isIgnored($parentDirectory)) { - // rules in ignored directories are ignored, no need to check further. - break; - } - - $fileRelativePath = substr($fileRealPath, \strlen($parentDirectory) + 1); - - if (null === $regexps = $this->readGitignoreFile("{$parentDirectory}/.gitignore")) { - continue; - } - - [$exclusionRegex, $inclusionRegex] = $regexps; - - if (preg_match($exclusionRegex, $fileRelativePath)) { - $ignored = true; - - continue; - } - - if (preg_match($inclusionRegex, $fileRelativePath)) { - $ignored = false; - } - } - - return $this->ignoredPathsCache[$fileRealPath] = $ignored; - } - - /** - * @return list - */ - private function parentsDirectoryDownward(string $fileRealPath): array - { - $parentDirectories = []; - - $parentDirectory = $fileRealPath; - - while (true) { - $newParentDirectory = \dirname($parentDirectory); - - // dirname('/') = '/' - if ($newParentDirectory === $parentDirectory) { - break; - } - - $parentDirectory = $newParentDirectory; - - if (0 !== strpos($parentDirectory, $this->baseDir)) { - break; - } - - $parentDirectories[] = $parentDirectory; - } - - return array_reverse($parentDirectories); - } - - /** - * @return array{0: string, 1: string}|null - */ - private function readGitignoreFile(string $path): ?array - { - if (\array_key_exists($path, $this->gitignoreFilesCache)) { - return $this->gitignoreFilesCache[$path]; - } - - if (!file_exists($path)) { - return $this->gitignoreFilesCache[$path] = null; - } - - if (!is_file($path) || !is_readable($path)) { - throw new \RuntimeException("The \"ignoreVCSIgnored\" option cannot be used by the Finder as the \"{$path}\" file is not readable."); - } - - $gitignoreFileContent = file_get_contents($path); - - return $this->gitignoreFilesCache[$path] = [ - Gitignore::toRegex($gitignoreFileContent), - Gitignore::toRegexMatchingNegatedPatterns($gitignoreFileContent), - ]; - } - - private function normalizePath(string $path): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - return str_replace('\\', '/', $path); - } - - return $path; - } -} diff --git a/trunk/vendor/symfony/finder/LICENSE b/trunk/vendor/symfony/finder/LICENSE deleted file mode 100644 index 0138f8f0..00000000 --- a/trunk/vendor/symfony/finder/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/finder/SplFileInfo.php b/trunk/vendor/symfony/finder/SplFileInfo.php deleted file mode 100644 index 11604a2e..00000000 --- a/trunk/vendor/symfony/finder/SplFileInfo.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Extends \SplFileInfo to support relative paths. - * - * @author Fabien Potencier - */ -class SplFileInfo extends \SplFileInfo -{ - private $relativePath; - private $relativePathname; - - /** - * @param string $file The file name - * @param string $relativePath The relative path - * @param string $relativePathname The relative path name - */ - public function __construct(string $file, string $relativePath, string $relativePathname) - { - parent::__construct($file); - $this->relativePath = $relativePath; - $this->relativePathname = $relativePathname; - } - - /** - * Returns the relative path. - * - * This path does not contain the file name. - * - * @return string - */ - public function getRelativePath() - { - return $this->relativePath; - } - - /** - * Returns the relative path name. - * - * This path contains the file name. - * - * @return string - */ - public function getRelativePathname() - { - return $this->relativePathname; - } - - public function getFilenameWithoutExtension(): string - { - $filename = $this->getFilename(); - - return pathinfo($filename, \PATHINFO_FILENAME); - } - - /** - * Returns the contents of the file. - * - * @return string - * - * @throws \RuntimeException - */ - public function getContents() - { - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - try { - $content = file_get_contents($this->getPathname()); - } finally { - restore_error_handler(); - } - if (false === $content) { - throw new \RuntimeException($error); - } - - return $content; - } -} diff --git a/trunk/vendor/symfony/polyfill-ctype/Ctype.php b/trunk/vendor/symfony/polyfill-ctype/Ctype.php deleted file mode 100644 index ba75a2c9..00000000 --- a/trunk/vendor/symfony/polyfill-ctype/Ctype.php +++ /dev/null @@ -1,232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Ctype; - -/** - * Ctype implementation through regex. - * - * @internal - * - * @author Gert de Pagter - */ -final class Ctype -{ - /** - * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. - * - * @see https://php.net/ctype-alnum - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alnum($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is a letter, FALSE otherwise. - * - * @see https://php.net/ctype-alpha - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alpha($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); - } - - /** - * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. - * - * @see https://php.net/ctype-cntrl - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_cntrl($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); - } - - /** - * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. - * - * @see https://php.net/ctype-digit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_digit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. - * - * @see https://php.net/ctype-graph - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_graph($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); - } - - /** - * Returns TRUE if every character in text is a lowercase letter. - * - * @see https://php.net/ctype-lower - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_lower($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); - } - - /** - * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. - * - * @see https://php.net/ctype-print - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_print($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); - } - - /** - * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. - * - * @see https://php.net/ctype-punct - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_punct($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); - } - - /** - * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. - * - * @see https://php.net/ctype-space - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_space($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); - } - - /** - * Returns TRUE if every character in text is an uppercase letter. - * - * @see https://php.net/ctype-upper - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_upper($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); - } - - /** - * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. - * - * @see https://php.net/ctype-xdigit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_xdigit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); - } - - /** - * Converts integers to their char versions according to normal ctype behaviour, if needed. - * - * If an integer between -128 and 255 inclusive is provided, - * it is interpreted as the ASCII value of a single character - * (negative values have 256 added in order to allow characters in the Extended ASCII range). - * Any other integer is interpreted as a string containing the decimal digits of the integer. - * - * @param mixed $int - * @param string $function - * - * @return mixed - */ - private static function convert_int_to_char_for_ctype($int, $function) - { - if (!\is_int($int)) { - return $int; - } - - if ($int < -128 || $int > 255) { - return (string) $int; - } - - if (\PHP_VERSION_ID >= 80100) { - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); - } - - if ($int < 0) { - $int += 256; - } - - return \chr($int); - } -} diff --git a/trunk/vendor/symfony/polyfill-ctype/LICENSE b/trunk/vendor/symfony/polyfill-ctype/LICENSE deleted file mode 100644 index 7536caea..00000000 --- a/trunk/vendor/symfony/polyfill-ctype/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-ctype/bootstrap.php b/trunk/vendor/symfony/polyfill-ctype/bootstrap.php deleted file mode 100644 index d54524b3..00000000 --- a/trunk/vendor/symfony/polyfill-ctype/bootstrap.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit($text) { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph($text) { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower($text) { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print($text) { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct($text) { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space($text) { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper($text) { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } -} diff --git a/trunk/vendor/symfony/polyfill-ctype/bootstrap80.php b/trunk/vendor/symfony/polyfill-ctype/bootstrap80.php deleted file mode 100644 index ab2f8611..00000000 --- a/trunk/vendor/symfony/polyfill-ctype/bootstrap80.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (!function_exists('ctype_alnum')) { - function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } -} diff --git a/trunk/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/trunk/vendor/symfony/polyfill-intl-grapheme/Grapheme.php deleted file mode 100644 index 5373f168..00000000 --- a/trunk/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Grapheme; - -\define('SYMFONY_GRAPHEME_CLUSTER_RX', ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39) ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); - -/** - * Partial intl implementation in pure PHP. - * - * Implemented: - * - grapheme_extract - Extract a sequence of grapheme clusters from a text buffer, which must be encoded in UTF-8 - * - grapheme_stripos - Find position (in grapheme units) of first occurrence of a case-insensitive string - * - grapheme_stristr - Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack - * - grapheme_strlen - Get string length in grapheme units - * - grapheme_strpos - Find position (in grapheme units) of first occurrence of a string - * - grapheme_strripos - Find position (in grapheme units) of last occurrence of a case-insensitive string - * - grapheme_strrpos - Find position (in grapheme units) of last occurrence of a string - * - grapheme_strstr - Returns part of haystack string from the first occurrence of needle to the end of haystack - * - grapheme_substr - Return part of a string - * - * @author Nicolas Grekas - * - * @internal - */ -final class Grapheme -{ - // (CRLF|([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*|[Control]) - // This regular expression is a work around for http://bugs.exim.org/1279 - public const GRAPHEME_CLUSTER_RX = '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; - - private const CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = 0, &$next = 0) - { - if (0 > $start) { - $start = \strlen($s) + $start; - } - - if (!\is_scalar($s)) { - $hasError = false; - set_error_handler(function () use (&$hasError) { $hasError = true; }); - $next = substr($s, $start); - restore_error_handler(); - if ($hasError) { - substr($s, $start); - $s = ''; - } else { - $s = $next; - } - } else { - $s = substr($s, $start); - } - $size = (int) $size; - $type = (int) $type; - $start = (int) $start; - - if (\GRAPHEME_EXTR_COUNT !== $type && \GRAPHEME_EXTR_MAXBYTES !== $type && \GRAPHEME_EXTR_MAXCHARS !== $type) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS'); - } - - if (!isset($s[0]) || 0 > $size || 0 > $start) { - return false; - } - if (0 === $size) { - return ''; - } - - $next = $start; - - $s = preg_split('/('.SYMFONY_GRAPHEME_CLUSTER_RX.')/u', "\r\n".$s, $size + 1, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); - - if (!isset($s[1])) { - return false; - } - - $i = 1; - $ret = ''; - - do { - if (\GRAPHEME_EXTR_COUNT === $type) { - --$size; - } elseif (\GRAPHEME_EXTR_MAXBYTES === $type) { - $size -= \strlen($s[$i]); - } else { - $size -= iconv_strlen($s[$i], 'UTF-8//IGNORE'); - } - - if ($size >= 0) { - $ret .= $s[$i]; - } - } while (isset($s[++$i]) && $size > 0); - - $next += \strlen($ret); - - return $ret; - } - - public static function grapheme_strlen($s) - { - preg_replace('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', '', $s, -1, $len); - - return 0 === $len && '' !== $s ? null : $len; - } - - public static function grapheme_substr($s, $start, $len = null) - { - if (null === $len) { - $len = 2147483647; - } - - preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s, $s); - - $slen = \count($s[0]); - $start = (int) $start; - - if (0 > $start) { - $start += $slen; - } - if (0 > $start) { - if (\PHP_VERSION_ID < 80000) { - return false; - } - - $start = 0; - } - if ($start >= $slen) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - - $rem = $slen - $start; - - if (0 > $len) { - $len += $rem; - } - if (0 === $len) { - return ''; - } - if (0 > $len) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - if ($len > $rem) { - $len = $rem; - } - - return implode('', \array_slice($s[0], $start, $len)); - } - - public static function grapheme_strpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 0); - } - - public static function grapheme_stripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 1); - } - - public static function grapheme_strrpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 2); - } - - public static function grapheme_strripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 3); - } - - public static function grapheme_stristr($s, $needle, $beforeNeedle = false) - { - return mb_stristr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - public static function grapheme_strstr($s, $needle, $beforeNeedle = false) - { - return mb_strstr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - private static function grapheme_position($s, $needle, $offset, $mode) - { - $needle = (string) $needle; - if (80000 > \PHP_VERSION_ID && !preg_match('/./us', $needle)) { - return false; - } - $s = (string) $s; - if (!preg_match('/./us', $s)) { - return false; - } - if ($offset > 0) { - $s = self::grapheme_substr($s, $offset); - } elseif ($offset < 0) { - if (2 > $mode) { - $offset += self::grapheme_strlen($s); - $s = self::grapheme_substr($s, $offset); - if (0 > $offset) { - $offset = 0; - } - } elseif (0 > $offset += self::grapheme_strlen($needle)) { - $s = self::grapheme_substr($s, 0, $offset); - $offset = 0; - } else { - $offset = 0; - } - } - - // As UTF-8 is self-synchronizing, and we have ensured the strings are valid UTF-8, - // we can use normal binary string functions here. For case-insensitive searches, - // case fold the strings first. - $caseInsensitive = $mode & 1; - $reverse = $mode & 2; - if ($caseInsensitive) { - // Use the same case folding mode as mbstring does for mb_stripos(). - // Stick to SIMPLE case folding to avoid changing the length of the string, which - // might result in offsets being shifted. - $mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_LOWER; - $s = mb_convert_case($s, $mode, 'UTF-8'); - $needle = mb_convert_case($needle, $mode, 'UTF-8'); - - if (!\defined('MB_CASE_FOLD_SIMPLE')) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); - $needle = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $needle); - } - } - if ($reverse) { - $needlePos = strrpos($s, $needle); - } else { - $needlePos = strpos($s, $needle); - } - - return false !== $needlePos ? self::grapheme_strlen(substr($s, 0, $needlePos)) + $offset : false; - } -} diff --git a/trunk/vendor/symfony/polyfill-intl-grapheme/LICENSE b/trunk/vendor/symfony/polyfill-intl-grapheme/LICENSE deleted file mode 100644 index 6e3afce6..00000000 --- a/trunk/vendor/symfony/polyfill-intl-grapheme/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap.php b/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap.php deleted file mode 100644 index a9ea03c7..00000000 --- a/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (extension_loaded('intl')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract($haystack, $size, $type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($haystack, $size, $type, $start, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen($input) { return p\Grapheme::grapheme_strlen($input); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr($string, $offset, $length); } -} diff --git a/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php b/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php deleted file mode 100644 index b8c07867..00000000 --- a/trunk/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen(?string $string): int|false|null { return p\Grapheme::grapheme_strlen((string) $string); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr(?string $string, ?int $offset, ?int $length = null): string|false { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); } -} diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/LICENSE b/trunk/vendor/symfony/polyfill-intl-normalizer/LICENSE deleted file mode 100644 index 6e3afce6..00000000 --- a/trunk/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Normalizer.php deleted file mode 100644 index 81704ab3..00000000 --- a/trunk/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ /dev/null @@ -1,310 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Normalizer; - -/** - * Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension. - * - * It has been validated with Unicode 6.3 Normalization Conformance Test. - * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. - * - * @author Nicolas Grekas - * - * @internal - */ -class Normalizer -{ - public const FORM_D = \Normalizer::FORM_D; - public const FORM_KD = \Normalizer::FORM_KD; - public const FORM_C = \Normalizer::FORM_C; - public const FORM_KC = \Normalizer::FORM_KC; - public const NFD = \Normalizer::NFD; - public const NFKD = \Normalizer::NFKD; - public const NFC = \Normalizer::NFC; - public const NFKC = \Normalizer::NFKC; - - private static $C; - private static $D; - private static $KD; - private static $cC; - private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - public static function isNormalized(string $s, int $form = self::FORM_C) - { - if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { - return false; - } - if (!isset($s[strspn($s, self::$ASCII)])) { - return true; - } - if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { - return true; - } - - return self::normalize($s, $form) === $s; - } - - public static function normalize(string $s, int $form = self::FORM_C) - { - if (!preg_match('//u', $s)) { - return false; - } - - switch ($form) { - case self::NFC: $C = true; $K = false; break; - case self::NFD: $C = false; $K = false; break; - case self::NFKC: $C = true; $K = true; break; - case self::NFKD: $C = false; $K = true; break; - default: - if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { - return $s; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); - } - - if ('' === $s) { - return ''; - } - - if ($K && null === self::$KD) { - self::$KD = self::getData('compatibilityDecomposition'); - } - - if (null === self::$D) { - self::$D = self::getData('canonicalDecomposition'); - self::$cC = self::getData('combiningClass'); - } - - if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { - mb_internal_encoding('8bit'); - } - - $r = self::decompose($s, $K); - - if ($C) { - if (null === self::$C) { - self::$C = self::getData('canonicalComposition'); - } - - $r = self::recompose($r); - } - if (null !== $mbEncoding) { - mb_internal_encoding($mbEncoding); - } - - return $r; - } - - private static function recompose($s) - { - $ASCII = self::$ASCII; - $compMap = self::$C; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - - $result = $tail = ''; - - $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; - $len = \strlen($s); - - $lastUchr = substr($s, 0, $i); - $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - if ($j = strspn($s, $ASCII, $i + 1)) { - $lastUchr .= substr($s, $i, $j); - $i += $j; - } - - $result .= $lastUchr; - $lastUchr = $s[$i]; - $lastUcls = 0; - ++$i; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - - if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr - || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr - || $lastUcls) { - // Table lookup and combining chars composition - - $ucls = $combClass[$uchr] ?? 0; - - if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { - $lastUchr = $compMap[$lastUchr.$uchr]; - } elseif ($lastUcls = $ucls) { - $tail .= $uchr; - } else { - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - $result .= $lastUchr; - $lastUchr = $uchr; - } - } else { - // Hangul chars - - $L = \ord($lastUchr[2]) - 0x80; - $V = \ord($uchr[2]) - 0xA1; - $T = 0; - - $uchr = substr($s, $i + $ulen, 3); - - if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { - $T = \ord($uchr[2]) - 0xA7; - 0 > $T && $T += 0x40; - $ulen += 3; - } - - $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; - $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); - } - - $i += $ulen; - } - - return $result.$lastUchr.$tail; - } - - private static function decompose($s, $c) - { - $result = ''; - - $ASCII = self::$ASCII; - $decompMap = self::$D; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - if ($c) { - $compatMap = self::$KD; - } - - $c = []; - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $j = 1 + strspn($s, $ASCII, $i + 1); - $result .= substr($s, $i, $j); - $i += $j; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { - // Table lookup - - if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { - $uchr = $j; - - $j = \strlen($uchr); - $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; - - if ($ulen != $j) { - // Put trailing chars in $s - - $j -= $ulen; - $i -= $j; - - if (0 > $i) { - $s = str_repeat(' ', -$i).$s; - $len -= $i; - $i = 0; - } - - while ($j--) { - $s[$i + $j] = $uchr[$ulen + $j]; - } - - $uchr = substr($uchr, 0, $ulen); - } - } - if (isset($combClass[$uchr])) { - // Combining chars, for sorting - - if (!isset($c[$combClass[$uchr]])) { - $c[$combClass[$uchr]] = ''; - } - $c[$combClass[$uchr]] .= $uchr; - continue; - } - } else { - // Hangul chars - - $uchr = unpack('C*', $uchr); - $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; - - $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); - - if ($j %= 28) { - $uchr .= $j < 25 - ? ("\xE1\x86".\chr(0xA7 + $j)) - : ("\xE1\x87".\chr(0x67 + $j)); - } - } - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $result .= $uchr; - } - - if ($c) { - ksort($c); - $result .= implode('', $c); - } - - return $result; - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } -} diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php deleted file mode 100644 index 0fdfc890..00000000 --- a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php +++ /dev/null @@ -1,17 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ',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' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ὲ' => 'ὲ', - 'ὴ' => 'ὴ', - 'ὶ' => 'ὶ', - 'ὸ' => 'ὸ', - 'ὺ' => 'ὺ', - 'ὼ' => 'ὼ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'ᾼ' => 'ᾼ', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Ὴ' => 'Ὴ', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ὼ' => 'Ὼ', - 'ῼ' => 'ῼ', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', -); diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php deleted file mode 100644 index 5a3e8e09..00000000 --- a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php +++ /dev/null @@ -1,2065 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' =>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' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'क़' => 'क़', - 'ख़' => 'ख़', - 'ग़' => 'ग़', - 'ज़' => 'ज़', - 'ड़' => 'ड़', - 'ढ़' => 'ढ़', - 'फ़' => 'फ़', - 'य़' => 'य़', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ড়' => 'ড়', - 'ঢ়' => 'ঢ়', - 'য়' => 'য়', - 'ਲ਼' => 'ਲ਼', - 'ਸ਼' => 'ਸ਼', - 'ਖ਼' => 'ਖ਼', - 'ਗ਼' => 'ਗ਼', - 'ਜ਼' => 'ਜ਼', - 'ਫ਼' => 'ਫ਼', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ଡ଼' => 'ଡ଼', - 'ଢ଼' => 'ଢ଼', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'གྷ' => 'གྷ', - 'ཌྷ' => 'ཌྷ', - 'དྷ' => 'དྷ', - 'བྷ' => 'བྷ', - 'ཛྷ' => 'ཛྷ', - 'ཀྵ' => 'ཀྵ', - 'ཱི' => 'ཱི', - 'ཱུ' => 'ཱུ', - 'ྲྀ' => 'ྲྀ', - 'ླྀ' => 'ླྀ', - 'ཱྀ' => 'ཱྀ', - 'ྒྷ' => 'ྒྷ', - 'ྜྷ' => 'ྜྷ', - 'ྡྷ' => 'ྡྷ', - 'ྦྷ' => 'ྦྷ', - 'ྫྷ' => 'ྫྷ', - 'ྐྵ' => 'ྐྵ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ά' => 'ά', - 'ὲ' => 'ὲ', - 'έ' => 'έ', - 'ὴ' => 'ὴ', - 'ή' => 'ή', - 'ὶ' => 'ὶ', - 'ί' => 'ί', - 'ὸ' => 'ὸ', - 'ό' => 'ό', - 'ὺ' => 'ὺ', - 'ύ' => 'ύ', - 'ὼ' => 'ὼ', - 'ώ' => 'ώ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'Ά' => 'Ά', - 'ᾼ' => 'ᾼ', - 'ι' => 'ι', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Έ' => 'Έ', - 'Ὴ' => 'Ὴ', - 'Ή' => 'Ή', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ΐ' => 'ΐ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - 'Ί' => 'Ί', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ΰ' => 'ΰ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ύ' => 'Ύ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - '΅' => '΅', - '`' => '`', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ό' => 'Ό', - 'Ὼ' => 'Ὼ', - 'Ώ' => 'Ώ', - 'ῼ' => 'ῼ', - '´' => '´', - ' ' => ' ', - ' ' => ' ', - 'Ω' => 'Ω', - 'K' => 'K', - 'Å' => 'Å', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - '〈' => '〈', - '〉' => '〉', - '⫝̸' => '⫝̸', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '豈' => '豈', - '更' => '更', - '車' => '車', - '賈' => '賈', - '滑' => '滑', - '串' => '串', - '句' => '句', - '龜' => '龜', - '龜' => '龜', - '契' => '契', - '金' => '金', - '喇' => '喇', - '奈' => '奈', - '懶' => '懶', - '癩' => '癩', - '羅' => '羅', - '蘿' => '蘿', - '螺' => '螺', - '裸' => '裸', - '邏' => '邏', - '樂' => '樂', - '洛' => '洛', - '烙' => '烙', - '珞' => '珞', - '落' => '落', - '酪' => '酪', - '駱' => '駱', - '亂' => '亂', - '卵' => '卵', - '欄' => '欄', - '爛' => '爛', - '蘭' => '蘭', - '鸞' => '鸞', - '嵐' => '嵐', - '濫' => '濫', - '藍' => '藍', - '襤' => '襤', - '拉' => '拉', - '臘' => '臘', - '蠟' => '蠟', - '廊' => '廊', - '朗' => '朗', - '浪' => '浪', - '狼' => '狼', - '郎' => '郎', - '來' => '來', - '冷' => '冷', - '勞' => '勞', - '擄' => '擄', - '櫓' => '櫓', - '爐' => '爐', - '盧' => '盧', - '老' => '老', - '蘆' => '蘆', - '虜' => '虜', - '路' => '路', - '露' => '露', - '魯' => '魯', - '鷺' => '鷺', - '碌' => '碌', - '祿' => '祿', - '綠' => '綠', - '菉' => '菉', - '錄' => '錄', - '鹿' => '鹿', - '論' => '論', - '壟' => '壟', - '弄' => '弄', - '籠' => '籠', - '聾' => '聾', - '牢' => '牢', - '磊' => '磊', - '賂' => '賂', - '雷' => '雷', - '壘' => '壘', - '屢' => '屢', - '樓' => '樓', - '淚' => '淚', - '漏' => '漏', - '累' => '累', - '縷' => '縷', - '陋' => '陋', - '勒' => '勒', - '肋' => '肋', - '凜' => '凜', - '凌' => '凌', - '稜' => '稜', - '綾' => '綾', - '菱' => '菱', - '陵' => '陵', - '讀' => '讀', - '拏' => '拏', - '樂' => '樂', - '諾' => '諾', - '丹' => '丹', - '寧' => '寧', - '怒' => '怒', - '率' => '率', - '異' => '異', - '北' => '北', - '磻' => '磻', - '便' => '便', - '復' => '復', - '不' => '不', - '泌' => '泌', - '數' => '數', - '索' => '索', - '參' => '參', - '塞' => '塞', - '省' => '省', - '葉' => '葉', - '說' => '說', - '殺' => '殺', - '辰' => '辰', - '沈' => '沈', - '拾' => '拾', - '若' => '若', - '掠' => '掠', - '略' => '略', - '亮' => '亮', - '兩' => '兩', - '凉' => '凉', - '梁' => '梁', - '糧' => '糧', - '良' => '良', - '諒' => '諒', - '量' => '量', - '勵' => '勵', - '呂' => '呂', - '女' => '女', - '廬' => '廬', - '旅' => '旅', - '濾' => '濾', - '礪' => '礪', - '閭' => '閭', - '驪' => '驪', - '麗' => '麗', - '黎' => '黎', - '力' => '力', - '曆' => '曆', - '歷' => '歷', - '轢' => '轢', - '年' => '年', - '憐' => '憐', - '戀' => '戀', - '撚' => '撚', - '漣' => '漣', - '煉' => '煉', - '璉' => '璉', - '秊' => '秊', - '練' => '練', - '聯' => '聯', - '輦' => '輦', - '蓮' => '蓮', - '連' => '連', - '鍊' => '鍊', - '列' => '列', - '劣' => '劣', - '咽' => '咽', - '烈' => '烈', - '裂' => '裂', - '說' => '說', - '廉' => '廉', - '念' => '念', - '捻' => '捻', - '殮' => '殮', - '簾' => '簾', - '獵' => '獵', - '令' => '令', - '囹' => '囹', - '寧' => '寧', - '嶺' => '嶺', - '怜' => '怜', - '玲' => '玲', - '瑩' => '瑩', - '羚' => '羚', - '聆' => '聆', - '鈴' => '鈴', - '零' => '零', - '靈' => '靈', - '領' => '領', - '例' => '例', - '禮' => '禮', - '醴' => '醴', - '隸' => '隸', - '惡' => '惡', - '了' => '了', - '僚' => '僚', - '寮' => '寮', - '尿' => '尿', - '料' => '料', - '樂' => '樂', - '燎' => '燎', - '療' => '療', - '蓼' => '蓼', - '遼' => '遼', - '龍' => '龍', - '暈' => '暈', - '阮' => '阮', - '劉' => '劉', - '杻' => '杻', - '柳' => '柳', - '流' => '流', - '溜' => '溜', - '琉' => '琉', - '留' => '留', - '硫' => '硫', - '紐' => '紐', - '類' => '類', - '六' => '六', - '戮' => '戮', - '陸' => '陸', - '倫' => '倫', - '崙' => '崙', - '淪' => '淪', - '輪' => '輪', - '律' => '律', - '慄' => '慄', - '栗' => '栗', - '率' => '率', - '隆' => '隆', - '利' => '利', - '吏' => '吏', - '履' => '履', - '易' => '易', - '李' => '李', - '梨' => '梨', - '泥' => '泥', - '理' => '理', - '痢' => '痢', - '罹' => '罹', - '裏' => '裏', - '裡' => '裡', - '里' => '里', - '離' => '離', - '匿' => '匿', - '溺' => '溺', - '吝' => '吝', - '燐' => '燐', - '璘' => '璘', - '藺' => '藺', - '隣' => '隣', - '鱗' => '鱗', - '麟' => '麟', - '林' => '林', - '淋' => '淋', - '臨' => '臨', - '立' => '立', - '笠' => '笠', - '粒' => '粒', - '狀' => '狀', - '炙' => '炙', - '識' => '識', - '什' => '什', - '茶' => '茶', - '刺' => '刺', - '切' => '切', - '度' => '度', - '拓' => '拓', - '糖' => '糖', - '宅' => '宅', - '洞' => '洞', - '暴' => '暴', - '輻' => '輻', - '行' => '行', - '降' => '降', - '見' => '見', - '廓' => '廓', - '兀' => '兀', - '嗀' => '嗀', - '塚' => '塚', - '晴' => '晴', - '凞' => '凞', - '猪' => '猪', - '益' => '益', - '礼' => '礼', - '神' => '神', - '祥' => '祥', - '福' => '福', - '靖' => '靖', - '精' => '精', - '羽' => '羽', - '蘒' => '蘒', - '諸' => '諸', - '逸' => '逸', - '都' => '都', - '飯' => '飯', - '飼' => '飼', - '館' => '館', - '鶴' => '鶴', - '郞' => '郞', - '隷' => '隷', - '侮' => '侮', - '僧' => '僧', - '免' => '免', - '勉' => '勉', - '勤' => '勤', - '卑' => '卑', - '喝' => '喝', - '嘆' => '嘆', - '器' => '器', - '塀' => '塀', - '墨' => '墨', - '層' => '層', - '屮' => '屮', - '悔' => '悔', - '慨' => '慨', - '憎' => '憎', - '懲' => '懲', - '敏' => '敏', - '既' => '既', - '暑' => '暑', - '梅' => '梅', - '海' => '海', - '渚' => '渚', - '漢' => '漢', - '煮' => '煮', - '爫' => '爫', - '琢' => '琢', - '碑' => '碑', - '社' => '社', - '祉' => '祉', - '祈' => '祈', - '祐' => '祐', - '祖' => '祖', - '祝' => '祝', - '禍' => '禍', - '禎' => '禎', - '穀' => '穀', - '突' => '突', - '節' => '節', - '練' => '練', - '縉' => '縉', - '繁' => '繁', - '署' => '署', - '者' => '者', - '臭' => '臭', - '艹' => '艹', - '艹' => '艹', - '著' => '著', - '褐' => '褐', - '視' => '視', - '謁' => '謁', - '謹' => '謹', - '賓' => '賓', - '贈' => '贈', - '辶' => '辶', - '逸' => '逸', - '難' => '難', - '響' => '響', - '頻' => '頻', - '恵' => '恵', - '𤋮' => '𤋮', - '舘' => '舘', - '並' => '並', - '况' => '况', - '全' => '全', - '侀' => '侀', - '充' => '充', - '冀' => '冀', - '勇' => '勇', - '勺' => '勺', - '喝' => '喝', - '啕' => '啕', - '喙' => '喙', - '嗢' => '嗢', - '塚' => '塚', - '墳' => '墳', - '奄' => '奄', - '奔' => '奔', - '婢' => '婢', - '嬨' => '嬨', - '廒' => '廒', - '廙' => '廙', - '彩' => '彩', - '徭' => '徭', - '惘' => '惘', - '慎' => '慎', - '愈' => '愈', - '憎' => '憎', - '慠' => '慠', - '懲' => '懲', - '戴' => '戴', - '揄' => '揄', - '搜' => '搜', - '摒' => '摒', - '敖' => '敖', - '晴' => '晴', - '朗' => '朗', - '望' => '望', - '杖' => '杖', - '歹' => '歹', - '殺' => '殺', - '流' => '流', - '滛' => '滛', - '滋' => '滋', - '漢' => '漢', - '瀞' => '瀞', - '煮' => '煮', - '瞧' => '瞧', - '爵' => '爵', - '犯' => '犯', - '猪' => '猪', - '瑱' => '瑱', - '甆' => '甆', - '画' => '画', - '瘝' => '瘝', - '瘟' => '瘟', - '益' => '益', - '盛' => '盛', - '直' => '直', - '睊' => '睊', - '着' => '着', - '磌' => '磌', - '窱' => '窱', - '節' => '節', - '类' => '类', - '絛' => '絛', - '練' => '練', - '缾' => '缾', - '者' => '者', - '荒' => '荒', - '華' => '華', - '蝹' => '蝹', - '襁' => '襁', - '覆' => '覆', - '視' => '視', - '調' => '調', - '諸' => '諸', - '請' => '請', - '謁' => '謁', - '諾' => '諾', - '諭' => '諭', - '謹' => '謹', - '變' => '變', - '贈' => '贈', - '輸' => '輸', - '遲' => '遲', - '醙' => '醙', - '鉶' => '鉶', - '陼' => '陼', - '難' => '難', - '靖' => '靖', - '韛' => '韛', - '響' => '響', - '頋' => '頋', - '頻' => '頻', - '鬒' => '鬒', - '龜' => '龜', - '𢡊' => '𢡊', - '𢡄' => '𢡄', - '𣏕' => '𣏕', - '㮝' => '㮝', - '䀘' => '䀘', - '䀹' => '䀹', - '𥉉' => '𥉉', - '𥳐' => '𥳐', - '𧻓' => '𧻓', - '齃' => '齃', - '龎' => '龎', - 'יִ' => 'יִ', - 'ײַ' => 'ײַ', - 'שׁ' => 'שׁ', - 'שׂ' => 'שׂ', - 'שּׁ' => 'שּׁ', - 'שּׂ' => 'שּׂ', - 'אַ' => 'אַ', - 'אָ' => 'אָ', - 'אּ' => 'אּ', - 'בּ' => 'בּ', - 'גּ' => 'גּ', - 'דּ' => 'דּ', - 'הּ' => 'הּ', - 'וּ' => 'וּ', - 'זּ' => 'זּ', - 'טּ' => 'טּ', - 'יּ' => 'יּ', - 'ךּ' => 'ךּ', - 'כּ' => 'כּ', - 'לּ' => 'לּ', - 'מּ' => 'מּ', - 'נּ' => 'נּ', - 'סּ' => 'סּ', - 'ףּ' => 'ףּ', - 'פּ' => 'פּ', - 'צּ' => 'צּ', - 'קּ' => 'קּ', - 'רּ' => 'רּ', - 'שּ' => 'שּ', - 'תּ' => 'תּ', - 'וֹ' => 'וֹ', - 'בֿ' => 'בֿ', - 'כֿ' => 'כֿ', - 'פֿ' => 'פֿ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', - '𝅗𝅥' => '𝅗𝅥', - '𝅘𝅥' => '𝅘𝅥', - '𝅘𝅥𝅮' => '𝅘𝅥𝅮', - '𝅘𝅥𝅯' => '𝅘𝅥𝅯', - '𝅘𝅥𝅰' => '𝅘𝅥𝅰', - '𝅘𝅥𝅱' => '𝅘𝅥𝅱', - '𝅘𝅥𝅲' => '𝅘𝅥𝅲', - '𝆹𝅥' => '𝆹𝅥', - '𝆺𝅥' => '𝆺𝅥', - '𝆹𝅥𝅮' => '𝆹𝅥𝅮', - '𝆺𝅥𝅮' => '𝆺𝅥𝅮', - '𝆹𝅥𝅯' => '𝆹𝅥𝅯', - '𝆺𝅥𝅯' => '𝆺𝅥𝅯', - '丽' => '丽', - '丸' => '丸', - '乁' => '乁', - '𠄢' => '𠄢', - '你' => '你', - '侮' => '侮', - '侻' => '侻', - '倂' => '倂', - '偺' => '偺', - '備' => '備', - '僧' => '僧', - '像' => '像', - '㒞' => '㒞', - '𠘺' => '𠘺', - '免' => '免', - '兔' => '兔', - '兤' => '兤', - '具' => '具', - '𠔜' => '𠔜', - '㒹' => '㒹', - '內' => '內', - '再' => '再', - '𠕋' => '𠕋', - '冗' => '冗', - '冤' => '冤', - '仌' => '仌', - '冬' => '冬', - '况' => '况', - '𩇟' => '𩇟', - '凵' => '凵', - '刃' => '刃', - '㓟' => '㓟', - '刻' => '刻', - '剆' => '剆', - '割' => '割', - '剷' => '剷', - '㔕' => '㔕', - '勇' => '勇', - '勉' => '勉', - '勤' => '勤', - '勺' => '勺', - '包' => '包', - '匆' => '匆', - '北' => '北', - '卉' => '卉', - '卑' => '卑', - '博' => '博', - '即' => '即', - '卽' => '卽', - '卿' => '卿', - '卿' => '卿', - '卿' => '卿', - '𠨬' => '𠨬', - '灰' => '灰', - '及' => '及', - '叟' => '叟', - '𠭣' => '𠭣', - '叫' => '叫', - '叱' => '叱', - '吆' => '吆', - '咞' => '咞', - '吸' => '吸', - '呈' => '呈', - '周' => '周', - '咢' => '咢', - '哶' => '哶', - '唐' => '唐', - '啓' => '啓', - '啣' => '啣', - '善' => '善', - '善' => '善', - '喙' => '喙', - '喫' => '喫', - '喳' => '喳', - '嗂' => '嗂', - '圖' => '圖', - '嘆' => '嘆', - '圗' => '圗', - '噑' => '噑', - '噴' => '噴', - '切' => '切', - '壮' => '壮', - '城' => '城', - '埴' => '埴', - '堍' => '堍', - '型' => '型', - '堲' => '堲', - '報' => '報', - '墬' => '墬', - '𡓤' => '𡓤', - '売' => '売', - '壷' => '壷', - '夆' => '夆', - '多' => '多', - '夢' => '夢', - '奢' => '奢', - '𡚨' => '𡚨', - '𡛪' => '𡛪', - '姬' => '姬', - '娛' => '娛', - '娧' => '娧', - '姘' => '姘', - '婦' => '婦', - '㛮' => '㛮', - '㛼' => '㛼', - '嬈' => '嬈', - '嬾' => '嬾', - '嬾' => '嬾', - '𡧈' => '𡧈', - '寃' => '寃', - '寘' => '寘', - '寧' => '寧', - '寳' => '寳', - '𡬘' => '𡬘', - '寿' => '寿', - '将' => '将', - '当' => '当', - '尢' => '尢', - '㞁' => '㞁', - '屠' => '屠', - '屮' => '屮', - '峀' => '峀', - '岍' => '岍', - '𡷤' => '𡷤', - '嵃' => '嵃', - '𡷦' => '𡷦', - '嵮' => '嵮', - '嵫' => '嵫', - '嵼' => '嵼', - '巡' => '巡', - '巢' => '巢', - '㠯' => '㠯', - '巽' => '巽', - '帨' => '帨', - '帽' => '帽', - '幩' => '幩', - '㡢' => '㡢', - '𢆃' => '𢆃', - '㡼' => '㡼', - '庰' => '庰', - '庳' => '庳', - '庶' => '庶', - '廊' => '廊', - '𪎒' => '𪎒', - '廾' => '廾', - '𢌱' => '𢌱', - '𢌱' => '𢌱', - '舁' => '舁', - '弢' => '弢', - '弢' => '弢', - '㣇' => '㣇', - '𣊸' => '𣊸', - '𦇚' => '𦇚', - '形' => '形', - '彫' => '彫', - '㣣' => '㣣', - '徚' => '徚', - '忍' => '忍', - '志' => '志', - '忹' => '忹', - '悁' => '悁', - '㤺' => '㤺', - '㤜' => '㤜', - '悔' => '悔', - '𢛔' => '𢛔', - '惇' => '惇', - '慈' => '慈', - '慌' => '慌', - '慎' => '慎', - '慌' => '慌', - '慺' => '慺', - '憎' => '憎', - '憲' => '憲', - '憤' => '憤', - '憯' => '憯', - '懞' => '懞', - '懲' => '懲', - '懶' => '懶', - '成' => '成', - '戛' => '戛', - '扝' => '扝', - '抱' => '抱', - '拔' => '拔', - '捐' => '捐', - '𢬌' => '𢬌', - '挽' => '挽', - '拼' => '拼', - '捨' => '捨', - '掃' => '掃', - '揤' => '揤', - '𢯱' => '𢯱', - '搢' => '搢', - '揅' => '揅', - '掩' => '掩', - '㨮' => '㨮', - '摩' => '摩', - '摾' => '摾', - '撝' => '撝', - '摷' => '摷', - '㩬' => '㩬', - '敏' => '敏', - '敬' => '敬', - '𣀊' => '𣀊', - '旣' => '旣', - '書' => '書', - '晉' => '晉', - '㬙' => '㬙', - '暑' => '暑', - '㬈' => '㬈', - '㫤' => '㫤', - '冒' => '冒', - '冕' => '冕', - '最' => '最', - '暜' => '暜', - '肭' => '肭', - '䏙' => '䏙', - '朗' => '朗', - '望' => '望', - '朡' => '朡', - '杞' => '杞', - '杓' => '杓', - '𣏃' => '𣏃', - '㭉' => '㭉', - '柺' => '柺', - '枅' => '枅', - '桒' => '桒', - '梅' => '梅', - '𣑭' => '𣑭', - '梎' => '梎', - '栟' => '栟', - '椔' => '椔', - '㮝' => '㮝', - '楂' => '楂', - '榣' => '榣', - '槪' => '槪', - '檨' => '檨', - '𣚣' => '𣚣', - '櫛' => '櫛', - '㰘' => '㰘', - '次' => '次', - '𣢧' => '𣢧', - '歔' => '歔', - '㱎' => '㱎', - '歲' => '歲', - '殟' => '殟', - '殺' => '殺', - '殻' => '殻', - '𣪍' => '𣪍', - '𡴋' => '𡴋', - '𣫺' => '𣫺', - '汎' => '汎', - '𣲼' => '𣲼', - '沿' => '沿', - '泍' => '泍', - '汧' => '汧', - '洖' => '洖', - '派' => '派', - '海' => '海', - '流' => '流', - '浩' => '浩', - '浸' => '浸', - '涅' => '涅', - '𣴞' => '𣴞', - '洴' => '洴', - '港' => '港', - '湮' => '湮', - '㴳' => '㴳', - '滋' => '滋', - '滇' => '滇', - '𣻑' => '𣻑', - '淹' => '淹', - '潮' => '潮', - '𣽞' => '𣽞', - '𣾎' => '𣾎', - '濆' => '濆', - '瀹' => '瀹', - '瀞' => '瀞', - '瀛' => '瀛', - '㶖' => '㶖', - '灊' => '灊', - '災' => '災', - '灷' => '灷', - '炭' => '炭', - '𠔥' => '𠔥', - '煅' => '煅', - '𤉣' => '𤉣', - '熜' => '熜', - '𤎫' => '𤎫', - '爨' => '爨', - '爵' => '爵', - '牐' => '牐', - '𤘈' => '𤘈', - '犀' => '犀', - '犕' => '犕', - '𤜵' => '𤜵', - '𤠔' => '𤠔', - '獺' => '獺', - '王' => '王', - '㺬' => '㺬', - '玥' => '玥', - '㺸' => '㺸', - '㺸' => '㺸', - '瑇' => '瑇', - '瑜' => '瑜', - '瑱' => '瑱', - '璅' => '璅', - '瓊' => '瓊', - '㼛' => '㼛', - '甤' => '甤', - '𤰶' => '𤰶', - '甾' => '甾', - '𤲒' => '𤲒', - '異' => '異', - '𢆟' => '𢆟', - '瘐' => '瘐', - '𤾡' => '𤾡', - '𤾸' => '𤾸', - '𥁄' => '𥁄', - '㿼' => '㿼', - '䀈' => '䀈', - '直' => '直', - '𥃳' => '𥃳', - '𥃲' => '𥃲', - '𥄙' => '𥄙', - '𥄳' => '𥄳', - '眞' => '眞', - '真' => '真', - '真' => '真', - '睊' => '睊', - '䀹' => '䀹', - '瞋' => '瞋', - '䁆' => '䁆', - '䂖' => '䂖', - '𥐝' => '𥐝', - '硎' => '硎', - '碌' => '碌', - '磌' => '磌', - '䃣' => '䃣', - '𥘦' => '𥘦', - '祖' => '祖', - '𥚚' => '𥚚', - '𥛅' => '𥛅', - '福' => '福', - '秫' => '秫', - '䄯' => '䄯', - '穀' => '穀', - '穊' => '穊', - '穏' => '穏', - '𥥼' => '𥥼', - '𥪧' => '𥪧', - '𥪧' => '𥪧', - '竮' => '竮', - '䈂' => '䈂', - '𥮫' => '𥮫', - '篆' => '篆', - '築' => '築', - '䈧' => '䈧', - '𥲀' => '𥲀', - '糒' => '糒', - '䊠' => '䊠', - '糨' => '糨', - '糣' => '糣', - '紀' => '紀', - '𥾆' => '𥾆', - '絣' => '絣', - '䌁' => '䌁', - '緇' => '緇', - '縂' => '縂', - '繅' => '繅', - '䌴' => '䌴', - '𦈨' => '𦈨', - '𦉇' => '𦉇', - '䍙' => '䍙', - '𦋙' => '𦋙', - '罺' => '罺', - '𦌾' => '𦌾', - '羕' => '羕', - '翺' => '翺', - '者' => '者', - '𦓚' => '𦓚', - '𦔣' => '𦔣', - '聠' => '聠', - '𦖨' => '𦖨', - '聰' => '聰', - '𣍟' => '𣍟', - '䏕' => '䏕', - '育' => '育', - '脃' => '脃', - '䐋' => '䐋', - '脾' => '脾', - '媵' => '媵', - '𦞧' => '𦞧', - '𦞵' => '𦞵', - '𣎓' => '𣎓', - '𣎜' => '𣎜', - '舁' => '舁', - '舄' => '舄', - '辞' => '辞', - '䑫' => '䑫', - '芑' => '芑', - '芋' => '芋', - '芝' => '芝', - '劳' => '劳', - '花' => '花', - '芳' => '芳', - '芽' => '芽', - '苦' => '苦', - '𦬼' => '𦬼', - '若' => '若', - '茝' => '茝', - '荣' => '荣', - '莭' => '莭', - '茣' => '茣', - '莽' => '莽', - '菧' => '菧', - '著' => '著', - '荓' => '荓', - '菊' => '菊', - '菌' => '菌', - '菜' => '菜', - '𦰶' => '𦰶', - '𦵫' => '𦵫', - '𦳕' => '𦳕', - '䔫' => '䔫', - '蓱' => '蓱', - '蓳' => '蓳', - '蔖' => '蔖', - '𧏊' => '𧏊', - '蕤' => '蕤', - '𦼬' => '𦼬', - '䕝' => '䕝', - '䕡' => '䕡', - '𦾱' => '𦾱', - '𧃒' => '𧃒', - '䕫' => '䕫', - '虐' => '虐', - '虜' => '虜', - '虧' => '虧', - '虩' => '虩', - '蚩' => '蚩', - '蚈' => '蚈', - '蜎' => '蜎', - '蛢' => '蛢', - '蝹' => '蝹', - '蜨' => '蜨', - '蝫' => '蝫', - '螆' => '螆', - '䗗' => '䗗', - '蟡' => '蟡', - '蠁' => '蠁', - '䗹' => '䗹', - '衠' => '衠', - '衣' => '衣', - '𧙧' => '𧙧', - '裗' => '裗', - '裞' => '裞', - '䘵' => '䘵', - '裺' => '裺', - '㒻' => '㒻', - '𧢮' => '𧢮', - '𧥦' => '𧥦', - '䚾' => '䚾', - '䛇' => '䛇', - '誠' => '誠', - '諭' => '諭', - '變' => '變', - '豕' => '豕', - '𧲨' => '𧲨', - '貫' => '貫', - '賁' => '賁', - '贛' => '贛', - '起' => '起', - '𧼯' => '𧼯', - '𠠄' => '𠠄', - '跋' => '跋', - '趼' => '趼', - '跰' => '跰', - '𠣞' => '𠣞', - '軔' => '軔', - '輸' => '輸', - '𨗒' => '𨗒', - '𨗭' => '𨗭', - '邔' => '邔', - '郱' => '郱', - '鄑' => '鄑', - '𨜮' => '𨜮', - '鄛' => '鄛', - '鈸' => '鈸', - '鋗' => '鋗', - '鋘' => '鋘', - '鉼' => '鉼', - '鏹' => '鏹', - '鐕' => '鐕', - '𨯺' => '𨯺', - '開' => '開', - '䦕' => '䦕', - '閷' => '閷', - '𨵷' => '𨵷', - '䧦' => '䧦', - '雃' => '雃', - '嶲' => '嶲', - '霣' => '霣', - '𩅅' => '𩅅', - '𩈚' => '𩈚', - '䩮' => '䩮', - '䩶' => '䩶', - '韠' => '韠', - '𩐊' => '𩐊', - '䪲' => '䪲', - '𩒖' => '𩒖', - '頋' => '頋', - '頋' => '頋', - '頩' => '頩', - '𩖶' => '𩖶', - '飢' => '飢', - '䬳' => '䬳', - '餩' => '餩', - '馧' => '馧', - '駂' => '駂', - '駾' => '駾', - '䯎' => '䯎', - '𩬰' => '𩬰', - '鬒' => '鬒', - '鱀' => '鱀', - '鳽' => '鳽', - '䳎' => '䳎', - '䳭' => '䳭', - '鵧' => '鵧', - '𪃎' => '𪃎', - '䳸' => '䳸', - '𪄅' => '𪄅', - '𪈎' => '𪈎', - '𪊑' => '𪊑', - '麻' => '麻', - '䵖' => '䵖', - '黹' => '黹', - '黾' => '黾', - '鼅' => '鼅', - '鼏' => '鼏', - '鼖' => '鼖', - '鼻' => '鼻', - '𪘀' => '𪘀', -); diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php deleted file mode 100644 index ec90f36e..00000000 --- a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php +++ /dev/null @@ -1,876 +0,0 @@ - 230, - '́' => 230, - '̂' => 230, - '̃' => 230, - '̄' => 230, - '̅' => 230, - '̆' => 230, - '̇' => 230, - '̈' => 230, - '̉' => 230, - '̊' => 230, - '̋' => 230, - '̌' => 230, - '̍' => 230, - '̎' => 230, - '̏' => 230, - '̐' => 230, - '̑' => 230, - '̒' => 230, - '̓' => 230, - '̔' => 230, - '̕' => 232, - '̖' => 220, - '̗' => 220, - '̘' => 220, - '̙' => 220, - '̚' => 232, - '̛' => 216, - '̜' => 220, - '̝' => 220, - '̞' => 220, - '̟' => 220, - '̠' => 220, - '̡' => 202, - '̢' => 202, - '̣' => 220, - '̤' => 220, - '̥' => 220, - '̦' => 220, - '̧' => 202, - '̨' => 202, - '̩' => 220, - '̪' => 220, - '̫' => 220, - '̬' => 220, - '̭' => 220, - '̮' => 220, - '̯' => 220, - '̰' => 220, - '̱' => 220, - '̲' => 220, - '̳' => 220, - '̴' => 1, - '̵' => 1, - '̶' => 1, - '̷' => 1, - '̸' => 1, - '̹' => 220, - '̺' => 220, - '̻' => 220, - '̼' => 220, - '̽' => 230, - '̾' => 230, - '̿' => 230, - '̀' => 230, - '́' => 230, - '͂' => 230, - '̓' => 230, - '̈́' => 230, - 'ͅ' => 240, - '͆' => 230, - '͇' => 220, - '͈' => 220, - '͉' => 220, - '͊' => 230, - '͋' => 230, - '͌' => 230, - '͍' => 220, - '͎' => 220, - '͐' => 230, - '͑' => 230, - '͒' => 230, - '͓' => 220, - '͔' => 220, - '͕' => 220, - '͖' => 220, - '͗' => 230, - '͘' => 232, - '͙' => 220, - '͚' => 220, - '͛' => 230, - '͜' => 233, - '͝' => 234, - '͞' => 234, - '͟' => 233, - '͠' => 234, - '͡' => 234, - '͢' => 233, - 'ͣ' => 230, - 'ͤ' => 230, - 'ͥ' => 230, - 'ͦ' => 230, - 'ͧ' => 230, - 'ͨ' => 230, - 'ͩ' => 230, - 'ͪ' => 230, - 'ͫ' => 230, - 'ͬ' => 230, - 'ͭ' => 230, - 'ͮ' => 230, - 'ͯ' => 230, - '҃' => 230, - '҄' => 230, - '҅' => 230, - '҆' => 230, - '҇' => 230, - '֑' => 220, - '֒' => 230, - '֓' => 230, - '֔' => 230, - '֕' => 230, - '֖' => 220, - '֗' => 230, - '֘' => 230, - '֙' => 230, - '֚' => 222, - '֛' => 220, - '֜' => 230, - '֝' => 230, - '֞' => 230, - '֟' => 230, - '֠' => 230, - '֡' => 230, - '֢' => 220, - '֣' => 220, - '֤' => 220, - '֥' => 220, - '֦' => 220, - '֧' => 220, - '֨' => 230, - '֩' => 230, - '֪' => 220, - '֫' => 230, - '֬' => 230, - '֭' => 222, - '֮' => 228, - '֯' => 230, - 'ְ' => 10, - 'ֱ' => 11, - 'ֲ' => 12, - 'ֳ' => 13, - 'ִ' => 14, - 'ֵ' => 15, - 'ֶ' => 16, - 'ַ' => 17, - 'ָ' => 18, - 'ֹ' => 19, - 'ֺ' => 19, - 'ֻ' => 20, - 'ּ' => 21, - 'ֽ' => 22, - 'ֿ' => 23, - 'ׁ' => 24, - 'ׂ' => 25, - 'ׄ' => 230, - 'ׅ' => 220, - 'ׇ' => 18, - 'ؐ' => 230, - 'ؑ' => 230, - 'ؒ' => 230, - 'ؓ' => 230, - 'ؔ' => 230, - 'ؕ' => 230, - 'ؖ' => 230, - 'ؗ' => 230, - 'ؘ' => 30, - 'ؙ' => 31, - 'ؚ' => 32, - 'ً' => 27, - 'ٌ' => 28, - 'ٍ' => 29, - 'َ' => 30, - 'ُ' => 31, - 'ِ' => 32, - 'ّ' => 33, - 'ْ' => 34, - 'ٓ' => 230, - 'ٔ' => 230, - 'ٕ' => 220, - 'ٖ' => 220, - 'ٗ' => 230, - '٘' => 230, - 'ٙ' => 230, - 'ٚ' => 230, - 'ٛ' => 230, - 'ٜ' => 220, - 'ٝ' => 230, - 'ٞ' => 230, - 'ٟ' => 220, - 'ٰ' => 35, - 'ۖ' => 230, - 'ۗ' => 230, - 'ۘ' => 230, - 'ۙ' => 230, - 'ۚ' => 230, - 'ۛ' => 230, - 'ۜ' => 230, - '۟' => 230, - '۠' => 230, - 'ۡ' => 230, - 'ۢ' => 230, - 'ۣ' => 220, - 'ۤ' => 230, - 'ۧ' => 230, - 'ۨ' => 230, - '۪' => 220, - '۫' => 230, - '۬' => 230, - 'ۭ' => 220, - 'ܑ' => 36, - 'ܰ' => 230, - 'ܱ' => 220, - 'ܲ' => 230, - 'ܳ' => 230, - 'ܴ' => 220, - 'ܵ' => 230, - 'ܶ' => 230, - 'ܷ' => 220, - 'ܸ' => 220, - 'ܹ' => 220, - 'ܺ' => 230, - 'ܻ' => 220, - 'ܼ' => 220, - 'ܽ' => 230, - 'ܾ' => 220, - 'ܿ' => 230, - '݀' => 230, - '݁' => 230, - '݂' => 220, - '݃' => 230, - '݄' => 220, - '݅' => 230, - '݆' => 220, - '݇' => 230, - '݈' => 220, - '݉' => 230, - '݊' => 230, - '߫' => 230, - '߬' => 230, - '߭' => 230, - '߮' => 230, - '߯' => 230, - '߰' => 230, - '߱' => 230, - '߲' => 220, - '߳' => 230, - '߽' => 220, - 'ࠖ' => 230, - 'ࠗ' => 230, - '࠘' => 230, - '࠙' => 230, - 'ࠛ' => 230, - 'ࠜ' => 230, - 'ࠝ' => 230, - 'ࠞ' => 230, - 'ࠟ' => 230, - 'ࠠ' => 230, - 'ࠡ' => 230, - 'ࠢ' => 230, - 'ࠣ' => 230, - 'ࠥ' => 230, - 'ࠦ' => 230, - 'ࠧ' => 230, - 'ࠩ' => 230, - 'ࠪ' => 230, - 'ࠫ' => 230, - 'ࠬ' => 230, - '࠭' => 230, - '࡙' => 220, - '࡚' => 220, - '࡛' => 220, - '࣓' => 220, - 'ࣔ' => 230, - 'ࣕ' => 230, - 'ࣖ' => 230, - 'ࣗ' => 230, - 'ࣘ' => 230, - 'ࣙ' => 230, - 'ࣚ' => 230, - 'ࣛ' => 230, - 'ࣜ' => 230, - 'ࣝ' => 230, - 'ࣞ' => 230, - 'ࣟ' => 230, - '࣠' => 230, - '࣡' => 230, - 'ࣣ' => 220, - 'ࣤ' => 230, - 'ࣥ' => 230, - 'ࣦ' => 220, - 'ࣧ' => 230, - 'ࣨ' => 230, - 'ࣩ' => 220, - '࣪' => 230, - '࣫' => 230, - '࣬' => 230, - '࣭' => 220, - '࣮' => 220, - '࣯' => 220, - 'ࣰ' => 27, - 'ࣱ' => 28, - 'ࣲ' => 29, - 'ࣳ' => 230, - 'ࣴ' => 230, - 'ࣵ' => 230, - 'ࣶ' => 220, - 'ࣷ' => 230, - 'ࣸ' => 230, - 'ࣹ' => 220, - 'ࣺ' => 220, - 'ࣻ' => 230, - 'ࣼ' => 230, - 'ࣽ' => 230, - 'ࣾ' => 230, - 'ࣿ' => 230, - '़' => 7, - '्' => 9, - '॑' => 230, - '॒' => 220, - '॓' => 230, - '॔' => 230, - '়' => 7, - '্' => 9, - '৾' => 230, - '਼' => 7, - '੍' => 9, - '઼' => 7, - '્' => 9, - '଼' => 7, - '୍' => 9, - '்' => 9, - '్' => 9, - 'ౕ' => 84, - 'ౖ' => 91, - '಼' => 7, - '್' => 9, - '഻' => 9, - '഼' => 9, - '്' => 9, - '්' => 9, - 'ุ' => 103, - 'ู' => 103, - 'ฺ' => 9, - '่' => 107, - '้' => 107, - '๊' => 107, - '๋' => 107, - 'ຸ' => 118, - 'ູ' => 118, - '຺' => 9, - '່' => 122, - '້' => 122, - '໊' => 122, - '໋' => 122, - '༘' => 220, - '༙' => 220, - '༵' => 220, - '༷' => 220, - '༹' => 216, - 'ཱ' => 129, - 'ི' => 130, - 'ུ' => 132, - 'ེ' => 130, - 'ཻ' => 130, - 'ོ' => 130, - 'ཽ' => 130, - 'ྀ' => 130, - 'ྂ' => 230, - 'ྃ' => 230, - '྄' => 9, - '྆' => 230, - '྇' => 230, - '࿆' => 220, - '့' => 7, - '္' => 9, - '်' => 9, - 'ႍ' => 220, - '፝' => 230, - '፞' => 230, - '፟' => 230, - '᜔' => 9, - '᜴' => 9, - '្' => 9, - '៝' => 230, - 'ᢩ' => 228, - '᤹' => 222, - '᤺' => 230, - '᤻' => 220, - 'ᨗ' => 230, - 'ᨘ' => 220, - '᩠' => 9, - '᩵' => 230, - '᩶' => 230, - '᩷' => 230, - '᩸' => 230, - '᩹' => 230, - '᩺' => 230, - '᩻' => 230, - '᩼' => 230, - '᩿' => 220, - '᪰' => 230, - '᪱' => 230, - '᪲' => 230, - '᪳' => 230, - '᪴' => 230, - '᪵' => 220, - '᪶' => 220, - '᪷' => 220, - '᪸' => 220, - '᪹' => 220, - '᪺' => 220, - '᪻' => 230, - '᪼' => 230, - '᪽' => 220, - 'ᪿ' => 220, - 'ᫀ' => 220, - '᬴' => 7, - '᭄' => 9, - '᭫' => 230, - '᭬' => 220, - '᭭' => 230, - '᭮' => 230, - '᭯' => 230, - '᭰' => 230, - '᭱' => 230, - '᭲' => 230, - '᭳' => 230, - '᮪' => 9, - '᮫' => 9, - '᯦' => 7, - '᯲' => 9, - '᯳' => 9, - '᰷' => 7, - '᳐' => 230, - '᳑' => 230, - '᳒' => 230, - '᳔' => 1, - '᳕' => 220, - '᳖' => 220, - '᳗' => 220, - '᳘' => 220, - '᳙' => 220, - '᳚' => 230, - '᳛' => 230, - '᳜' => 220, - '᳝' => 220, - '᳞' => 220, - '᳟' => 220, - '᳠' => 230, - '᳢' => 1, - '᳣' => 1, - '᳤' => 1, - '᳥' => 1, - '᳦' => 1, - '᳧' => 1, - '᳨' => 1, - '᳭' => 220, - '᳴' => 230, - '᳸' => 230, - '᳹' => 230, - '᷀' => 230, - '᷁' => 230, - '᷂' => 220, - '᷃' => 230, - '᷄' => 230, - '᷅' => 230, - '᷆' => 230, - '᷇' => 230, - '᷈' => 230, - '᷉' => 230, - '᷊' => 220, - '᷋' => 230, - '᷌' => 230, - '᷍' => 234, - '᷎' => 214, - '᷏' => 220, - '᷐' => 202, - '᷑' => 230, - '᷒' => 230, - 'ᷓ' => 230, - 'ᷔ' => 230, - 'ᷕ' => 230, - 'ᷖ' => 230, - 'ᷗ' => 230, - 'ᷘ' => 230, - 'ᷙ' => 230, - 'ᷚ' => 230, - 'ᷛ' => 230, - 'ᷜ' => 230, - 'ᷝ' => 230, - 'ᷞ' => 230, - 'ᷟ' => 230, - 'ᷠ' => 230, - 'ᷡ' => 230, - 'ᷢ' => 230, - 'ᷣ' => 230, - 'ᷤ' => 230, - 'ᷥ' => 230, - 'ᷦ' => 230, - 'ᷧ' => 230, - 'ᷨ' => 230, - 'ᷩ' => 230, - 'ᷪ' => 230, - 'ᷫ' => 230, - 'ᷬ' => 230, - 'ᷭ' => 230, - 'ᷮ' => 230, - 'ᷯ' => 230, - 'ᷰ' => 230, - 'ᷱ' => 230, - 'ᷲ' => 230, - 'ᷳ' => 230, - 'ᷴ' => 230, - '᷵' => 230, - '᷶' => 232, - '᷷' => 228, - '᷸' => 228, - '᷹' => 220, - '᷻' => 230, - '᷼' => 233, - '᷽' => 220, - '᷾' => 230, - '᷿' => 220, - '⃐' => 230, - '⃑' => 230, - '⃒' => 1, - '⃓' => 1, - '⃔' => 230, - '⃕' => 230, - '⃖' => 230, - '⃗' => 230, - '⃘' => 1, - '⃙' => 1, - '⃚' => 1, - '⃛' => 230, - '⃜' => 230, - '⃡' => 230, - '⃥' => 1, - '⃦' => 1, - '⃧' => 230, - '⃨' => 220, - '⃩' => 230, - '⃪' => 1, - '⃫' => 1, - '⃬' => 220, - '⃭' => 220, - '⃮' => 220, - '⃯' => 220, - '⃰' => 230, - '⳯' => 230, - '⳰' => 230, - '⳱' => 230, - '⵿' => 9, - 'ⷠ' => 230, - 'ⷡ' => 230, - 'ⷢ' => 230, - 'ⷣ' => 230, - 'ⷤ' => 230, - 'ⷥ' => 230, - 'ⷦ' => 230, - 'ⷧ' => 230, - 'ⷨ' => 230, - 'ⷩ' => 230, - 'ⷪ' => 230, - 'ⷫ' => 230, - 'ⷬ' => 230, - 'ⷭ' => 230, - 'ⷮ' => 230, - 'ⷯ' => 230, - 'ⷰ' => 230, - 'ⷱ' => 230, - 'ⷲ' => 230, - 'ⷳ' => 230, - 'ⷴ' => 230, - 'ⷵ' => 230, - 'ⷶ' => 230, - 'ⷷ' => 230, - 'ⷸ' => 230, - 'ⷹ' => 230, - 'ⷺ' => 230, - 'ⷻ' => 230, - 'ⷼ' => 230, - 'ⷽ' => 230, - 'ⷾ' => 230, - 'ⷿ' => 230, - '〪' => 218, - '〫' => 228, - '〬' => 232, - '〭' => 222, - '〮' => 224, - '〯' => 224, - '゙' => 8, - '゚' => 8, - '꙯' => 230, - 'ꙴ' => 230, - 'ꙵ' => 230, - 'ꙶ' => 230, - 'ꙷ' => 230, - 'ꙸ' => 230, - 'ꙹ' => 230, - 'ꙺ' => 230, - 'ꙻ' => 230, - '꙼' => 230, - '꙽' => 230, - 'ꚞ' => 230, - 'ꚟ' => 230, - '꛰' => 230, - '꛱' => 230, - '꠆' => 9, - '꠬' => 9, - '꣄' => 9, - '꣠' => 230, - '꣡' => 230, - '꣢' => 230, - '꣣' => 230, - '꣤' => 230, - '꣥' => 230, - '꣦' => 230, - '꣧' => 230, - '꣨' => 230, - '꣩' => 230, - '꣪' => 230, - '꣫' => 230, - '꣬' => 230, - '꣭' => 230, - '꣮' => 230, - '꣯' => 230, - '꣰' => 230, - '꣱' => 230, - '꤫' => 220, - '꤬' => 220, - '꤭' => 220, - '꥓' => 9, - '꦳' => 7, - '꧀' => 9, - 'ꪰ' => 230, - 'ꪲ' => 230, - 'ꪳ' => 230, - 'ꪴ' => 220, - 'ꪷ' => 230, - 'ꪸ' => 230, - 'ꪾ' => 230, - '꪿' => 230, - '꫁' => 230, - '꫶' => 9, - '꯭' => 9, - 'ﬞ' => 26, - '︠' => 230, - '︡' => 230, - '︢' => 230, - '︣' => 230, - '︤' => 230, - '︥' => 230, - '︦' => 230, - '︧' => 220, - '︨' => 220, - '︩' => 220, - '︪' => 220, - '︫' => 220, - '︬' => 220, - '︭' => 220, - '︮' => 230, - '︯' => 230, - '𐇽' => 220, - '𐋠' => 220, - '𐍶' => 230, - '𐍷' => 230, - '𐍸' => 230, - '𐍹' => 230, - '𐍺' => 230, - '𐨍' => 220, - '𐨏' => 230, - '𐨸' => 230, - '𐨹' => 1, - '𐨺' => 220, - '𐨿' => 9, - '𐫥' => 230, - '𐫦' => 220, - '𐴤' => 230, - '𐴥' => 230, - '𐴦' => 230, - '𐴧' => 230, - '𐺫' => 230, - '𐺬' => 230, - '𐽆' => 220, - '𐽇' => 220, - '𐽈' => 230, - '𐽉' => 230, - '𐽊' => 230, - '𐽋' => 220, - '𐽌' => 230, - '𐽍' => 220, - '𐽎' => 220, - '𐽏' => 220, - '𐽐' => 220, - '𑁆' => 9, - '𑁿' => 9, - '𑂹' => 9, - '𑂺' => 7, - '𑄀' => 230, - '𑄁' => 230, - '𑄂' => 230, - '𑄳' => 9, - '𑄴' => 9, - '𑅳' => 7, - '𑇀' => 9, - '𑇊' => 7, - '𑈵' => 9, - '𑈶' => 7, - '𑋩' => 7, - '𑋪' => 9, - '𑌻' => 7, - '𑌼' => 7, - '𑍍' => 9, - '𑍦' => 230, - '𑍧' => 230, - '𑍨' => 230, - '𑍩' => 230, - '𑍪' => 230, - '𑍫' => 230, - '𑍬' => 230, - '𑍰' => 230, - '𑍱' => 230, - '𑍲' => 230, - '𑍳' => 230, - '𑍴' => 230, - '𑑂' => 9, - '𑑆' => 7, - '𑑞' => 230, - '𑓂' => 9, - '𑓃' => 7, - '𑖿' => 9, - '𑗀' => 7, - '𑘿' => 9, - '𑚶' => 9, - '𑚷' => 7, - '𑜫' => 9, - '𑠹' => 9, - '𑠺' => 7, - '𑤽' => 9, - '𑤾' => 9, - '𑥃' => 7, - '𑧠' => 9, - '𑨴' => 9, - '𑩇' => 9, - '𑪙' => 9, - '𑰿' => 9, - '𑵂' => 7, - '𑵄' => 9, - '𑵅' => 9, - '𑶗' => 9, - '𖫰' => 1, - '𖫱' => 1, - '𖫲' => 1, - '𖫳' => 1, - '𖫴' => 1, - '𖬰' => 230, - '𖬱' => 230, - '𖬲' => 230, - '𖬳' => 230, - '𖬴' => 230, - '𖬵' => 230, - '𖬶' => 230, - '𖿰' => 6, - '𖿱' => 6, - '𛲞' => 1, - '𝅥' => 216, - '𝅦' => 216, - '𝅧' => 1, - '𝅨' => 1, - '𝅩' => 1, - '𝅭' => 226, - '𝅮' => 216, - '𝅯' => 216, - '𝅰' => 216, - '𝅱' => 216, - '𝅲' => 216, - '𝅻' => 220, - '𝅼' => 220, - '𝅽' => 220, - '𝅾' => 220, - '𝅿' => 220, - '𝆀' => 220, - '𝆁' => 220, - '𝆂' => 220, - '𝆅' => 230, - '𝆆' => 230, - '𝆇' => 230, - '𝆈' => 230, - '𝆉' => 230, - '𝆊' => 220, - '𝆋' => 220, - '𝆪' => 230, - '𝆫' => 230, - '𝆬' => 230, - '𝆭' => 230, - '𝉂' => 230, - '𝉃' => 230, - '𝉄' => 230, - '𞀀' => 230, - '𞀁' => 230, - '𞀂' => 230, - '𞀃' => 230, - '𞀄' => 230, - '𞀅' => 230, - '𞀆' => 230, - '𞀈' => 230, - '𞀉' => 230, - '𞀊' => 230, - '𞀋' => 230, - '𞀌' => 230, - '𞀍' => 230, - '𞀎' => 230, - '𞀏' => 230, - '𞀐' => 230, - '𞀑' => 230, - '𞀒' => 230, - '𞀓' => 230, - '𞀔' => 230, - '𞀕' => 230, - '𞀖' => 230, - '𞀗' => 230, - '𞀘' => 230, - '𞀛' => 230, - '𞀜' => 230, - '𞀝' => 230, - '𞀞' => 230, - '𞀟' => 230, - '𞀠' => 230, - '𞀡' => 230, - '𞀣' => 230, - '𞀤' => 230, - '𞀦' => 230, - '𞀧' => 230, - '𞀨' => 230, - '𞀩' => 230, - '𞀪' => 230, - '𞄰' => 230, - '𞄱' => 230, - '𞄲' => 230, - '𞄳' => 230, - '𞄴' => 230, - '𞄵' => 230, - '𞄶' => 230, - '𞋬' => 230, - '𞋭' => 230, - '𞋮' => 230, - '𞋯' => 230, - '𞣐' => 220, - '𞣑' => 220, - '𞣒' => 220, - '𞣓' => 220, - '𞣔' => 220, - '𞣕' => 220, - '𞣖' => 220, - '𞥄' => 230, - '𞥅' => 230, - '𞥆' => 230, - '𞥇' => 230, - '𞥈' => 230, - '𞥉' => 230, - '𞥊' => 7, -); diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php deleted file mode 100644 index 15749028..00000000 --- a/trunk/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php +++ /dev/null @@ -1,3695 +0,0 @@ - ' ', - '¨' => ' ̈', - 'ª' => 'a', - '¯' => ' ̄', - '²' => '2', - '³' => '3', - '´' => ' ́', - 'µ' => 'μ', - '¸' => ' ̧', - '¹' => '1', - 'º' => 'o', - '¼' => '1⁄4', - '½' => '1⁄2', - '¾' => '3⁄4', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ŀ' => 'L·', - 'ŀ' => 'l·', - 'ʼn' => 'ʼn', - 'ſ' => 's', - 'DŽ' => 'DŽ', - 'Dž' => 'Dž', - 'dž' => 'dž', - 'LJ' => 'LJ', - 'Lj' => 'Lj', - 'lj' => 'lj', - 'NJ' => 'NJ', - 'Nj' => 'Nj', - 'nj' => 'nj', - 'DZ' => 'DZ', - 'Dz' => 'Dz', - 'dz' => 'dz', - 'ʰ' => 'h', - 'ʱ' => 'ɦ', - 'ʲ' => 'j', - 'ʳ' => 'r', - 'ʴ' => 'ɹ', - 'ʵ' => 'ɻ', - 'ʶ' => 'ʁ', - 'ʷ' => 'w', - 'ʸ' => 'y', - '˘' => ' ̆', - '˙' => ' ̇', - '˚' => ' ̊', - '˛' => ' ̨', - '˜' => ' ̃', - '˝' => ' ̋', - 'ˠ' => 'ɣ', - 'ˡ' => 'l', - 'ˢ' => 's', - 'ˣ' => 'x', - 'ˤ' => 'ʕ', - 'ͺ' => ' ͅ', - '΄' => ' ́', - '΅' => ' ̈́', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϒ' => 'Υ', - 'ϓ' => 'Ύ', - 'ϔ' => 'Ϋ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϲ' => 'ς', - 'ϴ' => 'Θ', - 'ϵ' => 'ε', - 'Ϲ' => 'Σ', - 'և' => 'եւ', - 'ٵ' => 'اٴ', - 'ٶ' => 'وٴ', - 'ٷ' => 'ۇٴ', - 'ٸ' => 'يٴ', - 'ำ' => 'ํา', - 'ຳ' => 'ໍາ', - 'ໜ' => 'ຫນ', - 'ໝ' => 'ຫມ', - '༌' => '་', - 'ཷ' => 'ྲཱྀ', - 'ཹ' => 'ླཱྀ', - 'ჼ' => 'ნ', - 'ᴬ' => 'A', - 'ᴭ' => 'Æ', - 'ᴮ' => 'B', - 'ᴰ' => 'D', - 'ᴱ' => 'E', - 'ᴲ' => 'Ǝ', - 'ᴳ' => 'G', - 'ᴴ' => 'H', - 'ᴵ' => 'I', - 'ᴶ' => 'J', - 'ᴷ' => 'K', - 'ᴸ' => 'L', - 'ᴹ' => 'M', - 'ᴺ' => 'N', - 'ᴼ' => 'O', - 'ᴽ' => 'Ȣ', - 'ᴾ' => 'P', - 'ᴿ' => 'R', - 'ᵀ' => 'T', - 'ᵁ' => 'U', - 'ᵂ' => 'W', - 'ᵃ' => 'a', - 'ᵄ' => 'ɐ', - 'ᵅ' => 'ɑ', - 'ᵆ' => 'ᴂ', - 'ᵇ' => 'b', - 'ᵈ' => 'd', - 'ᵉ' => 'e', - 'ᵊ' => 'ə', - 'ᵋ' => 'ɛ', - 'ᵌ' => 'ɜ', - 'ᵍ' => 'g', - 'ᵏ' => 'k', - 'ᵐ' => 'm', - 'ᵑ' => 'ŋ', - 'ᵒ' => 'o', - 'ᵓ' => 'ɔ', - 'ᵔ' => 'ᴖ', - 'ᵕ' => 'ᴗ', - 'ᵖ' => 'p', - 'ᵗ' => 't', - 'ᵘ' => 'u', - 'ᵙ' => 'ᴝ', - 'ᵚ' => 'ɯ', - 'ᵛ' => 'v', - 'ᵜ' => 'ᴥ', - 'ᵝ' => 'β', - 'ᵞ' => 'γ', - 'ᵟ' => 'δ', - 'ᵠ' => 'φ', - 'ᵡ' => 'χ', - 'ᵢ' => 'i', - 'ᵣ' => 'r', - 'ᵤ' => 'u', - 'ᵥ' => 'v', - 'ᵦ' => 'β', - 'ᵧ' => 'γ', - 'ᵨ' => 'ρ', - 'ᵩ' => 'φ', - 'ᵪ' => 'χ', - 'ᵸ' => 'н', - 'ᶛ' => 'ɒ', - 'ᶜ' => 'c', - 'ᶝ' => 'ɕ', - 'ᶞ' => 'ð', - 'ᶟ' => 'ɜ', - 'ᶠ' => 'f', - 'ᶡ' => 'ɟ', - 'ᶢ' => 'ɡ', - 'ᶣ' => 'ɥ', - 'ᶤ' => 'ɨ', - 'ᶥ' => 'ɩ', - 'ᶦ' => 'ɪ', - 'ᶧ' => 'ᵻ', - 'ᶨ' => 'ʝ', - 'ᶩ' => 'ɭ', - 'ᶪ' => 'ᶅ', - 'ᶫ' => 'ʟ', - 'ᶬ' => 'ɱ', - 'ᶭ' => 'ɰ', - 'ᶮ' => 'ɲ', - 'ᶯ' => 'ɳ', - 'ᶰ' => 'ɴ', - 'ᶱ' => 'ɵ', - 'ᶲ' => 'ɸ', - 'ᶳ' => 'ʂ', - 'ᶴ' => 'ʃ', - 'ᶵ' => 'ƫ', - 'ᶶ' => 'ʉ', - 'ᶷ' => 'ʊ', - 'ᶸ' => 'ᴜ', - 'ᶹ' => 'ʋ', - 'ᶺ' => 'ʌ', - 'ᶻ' => 'z', - 'ᶼ' => 'ʐ', - 'ᶽ' => 'ʑ', - 'ᶾ' => 'ʒ', - 'ᶿ' => 'θ', - 'ẚ' => 'aʾ', - 'ẛ' => 'ṡ', - '᾽' => ' ̓', - '᾿' => ' ̓', - '῀' => ' ͂', - '῁' => ' ̈͂', - '῍' => ' ̓̀', - '῎' => ' ̓́', - '῏' => ' ̓͂', - '῝' => ' ̔̀', - '῞' => ' ̔́', - '῟' => ' ̔͂', - '῭' => ' ̈̀', - '΅' => ' ̈́', - '´' => ' ́', - '῾' => ' ̔', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - '‑' => '‐', - '‗' => ' ̳', - '․' => '.', - '‥' => '..', - '…' => '...', - ' ' => ' ', - '″' => '′′', - '‴' => '′′′', - '‶' => '‵‵', - '‷' => '‵‵‵', - '‼' => '!!', - '‾' => ' ̅', - '⁇' => '??', - '⁈' => '?!', - '⁉' => '!?', - '⁗' => '′′′′', - ' ' => ' ', - '⁰' => '0', - 'ⁱ' => 'i', - '⁴' => '4', - '⁵' => '5', - '⁶' => '6', - '⁷' => '7', - '⁸' => '8', - '⁹' => '9', - '⁺' => '+', - '⁻' => '−', - '⁼' => '=', - '⁽' => '(', - '⁾' => ')', - 'ⁿ' => 'n', - '₀' => '0', - '₁' => '1', - '₂' => '2', - '₃' => '3', - '₄' => '4', - '₅' => '5', - '₆' => '6', - '₇' => '7', - '₈' => '8', - '₉' => '9', - '₊' => '+', - '₋' => '−', - '₌' => '=', - '₍' => '(', - '₎' => ')', - 'ₐ' => 'a', - 'ₑ' => 'e', - 'ₒ' => 'o', - 'ₓ' => 'x', - 'ₔ' => 'ə', - 'ₕ' => 'h', - 'ₖ' => 'k', - 'ₗ' => 'l', - 'ₘ' => 'm', - 'ₙ' => 'n', - 'ₚ' => 'p', - 'ₛ' => 's', - 'ₜ' => 't', - '₨' => 'Rs', - '℀' => 'a/c', - '℁' => 'a/s', - 'ℂ' => 'C', - '℃' => '°C', - '℅' => 'c/o', - '℆' => 'c/u', - 'ℇ' => 'Ɛ', - '℉' => '°F', - 'ℊ' => 'g', - 'ℋ' => 'H', - 'ℌ' => 'H', - 'ℍ' => 'H', - 'ℎ' => 'h', - 'ℏ' => 'ħ', - 'ℐ' => 'I', - 'ℑ' => 'I', - 'ℒ' => 'L', - 'ℓ' => 'l', - 'ℕ' => 'N', - '№' => 'No', - 'ℙ' => 'P', - 'ℚ' => 'Q', - 'ℛ' => 'R', - 'ℜ' => 'R', - 'ℝ' => 'R', - '℠' => 'SM', - '℡' => 'TEL', - '™' => 'TM', - 'ℤ' => 'Z', - 'ℨ' => 'Z', - 'ℬ' => 'B', - 'ℭ' => 'C', - 'ℯ' => 'e', - 'ℰ' => 'E', - 'ℱ' => 'F', - 'ℳ' => 'M', - 'ℴ' => 'o', - 'ℵ' => 'א', - 'ℶ' => 'ב', - 'ℷ' => 'ג', - 'ℸ' => 'ד', - 'ℹ' => 'i', - '℻' => 'FAX', - 'ℼ' => 'π', - 'ℽ' => 'γ', - 'ℾ' => 'Γ', - 'ℿ' => 'Π', - '⅀' => '∑', - 'ⅅ' => 'D', - 'ⅆ' => 'd', - 'ⅇ' => 'e', - 'ⅈ' => 'i', - 'ⅉ' => 'j', - '⅐' => '1⁄7', - '⅑' => '1⁄9', - '⅒' => '1⁄10', - '⅓' => '1⁄3', - '⅔' => '2⁄3', - '⅕' => '1⁄5', - '⅖' => '2⁄5', - '⅗' => '3⁄5', - '⅘' => '4⁄5', - '⅙' => '1⁄6', - '⅚' => '5⁄6', - '⅛' => '1⁄8', - '⅜' => '3⁄8', - '⅝' => '5⁄8', - '⅞' => '7⁄8', - '⅟' => '1⁄', - 'Ⅰ' => 'I', - 'Ⅱ' => 'II', - 'Ⅲ' => 'III', - 'Ⅳ' => 'IV', - 'Ⅴ' => 'V', - 'Ⅵ' => 'VI', - 'Ⅶ' => 'VII', - 'Ⅷ' => 'VIII', - 'Ⅸ' => 'IX', - 'Ⅹ' => 'X', - 'Ⅺ' => 'XI', - 'Ⅻ' => 'XII', - 'Ⅼ' => 'L', - 'Ⅽ' => 'C', - 'Ⅾ' => 'D', - 'Ⅿ' => 'M', - 'ⅰ' => 'i', - 'ⅱ' => 'ii', - 'ⅲ' => 'iii', - 'ⅳ' => 'iv', - 'ⅴ' => 'v', - 'ⅵ' => 'vi', - 'ⅶ' => 'vii', - 'ⅷ' => 'viii', - 'ⅸ' => 'ix', - 'ⅹ' => 'x', - 'ⅺ' => 'xi', - 'ⅻ' => 'xii', - 'ⅼ' => 'l', - 'ⅽ' => 'c', - 'ⅾ' => 'd', - 'ⅿ' => 'm', - '↉' => '0⁄3', - '∬' => '∫∫', - '∭' => '∫∫∫', - '∯' => '∮∮', - '∰' => '∮∮∮', - '①' => '1', - '②' => '2', - '③' => '3', - '④' => '4', - '⑤' => '5', - '⑥' => '6', - '⑦' => '7', - '⑧' => '8', - '⑨' => '9', - '⑩' => '10', - '⑪' => '11', - '⑫' => '12', - '⑬' => '13', - '⑭' => '14', - '⑮' => '15', - '⑯' => '16', - '⑰' => '17', - '⑱' => '18', - '⑲' => '19', - '⑳' => '20', - '⑴' => '(1)', - '⑵' => '(2)', - '⑶' => '(3)', - '⑷' => '(4)', - '⑸' => '(5)', - '⑹' => '(6)', - '⑺' => '(7)', - '⑻' => '(8)', - '⑼' => '(9)', - '⑽' => '(10)', - '⑾' => '(11)', - '⑿' => '(12)', - '⒀' => '(13)', - '⒁' => '(14)', - '⒂' => '(15)', - '⒃' => '(16)', - '⒄' => '(17)', - '⒅' => '(18)', - '⒆' => '(19)', - '⒇' => '(20)', - '⒈' => '1.', - '⒉' => '2.', - '⒊' => '3.', - '⒋' => '4.', - '⒌' => '5.', - '⒍' => '6.', - '⒎' => '7.', - '⒏' => '8.', - '⒐' => '9.', - '⒑' => '10.', - '⒒' => '11.', - '⒓' => '12.', - '⒔' => '13.', - '⒕' => '14.', - '⒖' => '15.', - '⒗' => '16.', - '⒘' => '17.', - '⒙' => '18.', - '⒚' => '19.', - '⒛' => '20.', - '⒜' => '(a)', - '⒝' => '(b)', - '⒞' => '(c)', - '⒟' => '(d)', - '⒠' => '(e)', - '⒡' => '(f)', - '⒢' => '(g)', - '⒣' => '(h)', - '⒤' => '(i)', - '⒥' => '(j)', - '⒦' => '(k)', - '⒧' => '(l)', - '⒨' => '(m)', - '⒩' => '(n)', - '⒪' => '(o)', - '⒫' => '(p)', - '⒬' => '(q)', - '⒭' => '(r)', - '⒮' => '(s)', - '⒯' => '(t)', - '⒰' => '(u)', - '⒱' => '(v)', - '⒲' => '(w)', - '⒳' => '(x)', - '⒴' => '(y)', - '⒵' => '(z)', - 'Ⓐ' => 'A', - 'Ⓑ' => 'B', - 'Ⓒ' => 'C', - 'Ⓓ' => 'D', - 'Ⓔ' => 'E', - 'Ⓕ' => 'F', - 'Ⓖ' => 'G', - 'Ⓗ' => 'H', - 'Ⓘ' => 'I', - 'Ⓙ' => 'J', - 'Ⓚ' => 'K', - 'Ⓛ' => 'L', - 'Ⓜ' => 'M', - 'Ⓝ' => 'N', - 'Ⓞ' => 'O', - 'Ⓟ' => 'P', - 'Ⓠ' => 'Q', - 'Ⓡ' => 'R', - 'Ⓢ' => 'S', - 'Ⓣ' => 'T', - 'Ⓤ' => 'U', - 'Ⓥ' => 'V', - 'Ⓦ' => 'W', - 'Ⓧ' => 'X', - 'Ⓨ' => 'Y', - 'Ⓩ' => 'Z', - 'ⓐ' => 'a', - 'ⓑ' => 'b', - 'ⓒ' => 'c', - 'ⓓ' => 'd', - 'ⓔ' => 'e', - 'ⓕ' => 'f', - 'ⓖ' => 'g', - 'ⓗ' => 'h', - 'ⓘ' => 'i', - 'ⓙ' => 'j', - 'ⓚ' => 'k', - 'ⓛ' => 'l', - 'ⓜ' => 'm', - 'ⓝ' => 'n', - 'ⓞ' => 'o', - 'ⓟ' => 'p', - 'ⓠ' => 'q', - 'ⓡ' => 'r', - 'ⓢ' => 's', - 'ⓣ' => 't', - 'ⓤ' => 'u', - 'ⓥ' => 'v', - 'ⓦ' => 'w', - 'ⓧ' => 'x', - 'ⓨ' => 'y', - 'ⓩ' => 'z', - '⓪' => '0', - '⨌' => '∫∫∫∫', - '⩴' => '::=', - '⩵' => '==', - '⩶' => '===', - 'ⱼ' => 'j', - 'ⱽ' => 'V', - 'ⵯ' => 'ⵡ', - '⺟' => '母', - '⻳' => '龟', - '⼀' => '一', - '⼁' => '丨', - '⼂' => '丶', - '⼃' => '丿', - '⼄' => '乙', - '⼅' => '亅', - '⼆' => '二', - '⼇' => '亠', - '⼈' => '人', - '⼉' => '儿', - '⼊' => '入', - '⼋' => '八', - '⼌' => '冂', - '⼍' => '冖', - '⼎' => '冫', - '⼏' => '几', - '⼐' => '凵', - '⼑' => '刀', - '⼒' => '力', - '⼓' => '勹', - '⼔' => '匕', - '⼕' => '匚', - '⼖' => '匸', - '⼗' => '十', - '⼘' => '卜', - '⼙' => '卩', - '⼚' => '厂', - '⼛' => '厶', - '⼜' => '又', - '⼝' => '口', - '⼞' => '囗', - '⼟' => '土', - '⼠' => '士', - '⼡' => '夂', - '⼢' => '夊', - '⼣' => '夕', - '⼤' => '大', - '⼥' => '女', - '⼦' => '子', - '⼧' => '宀', - '⼨' => '寸', - '⼩' => '小', - '⼪' => '尢', - '⼫' => '尸', - '⼬' => '屮', - '⼭' => '山', - '⼮' => '巛', - '⼯' => '工', - '⼰' => '己', - '⼱' => '巾', - '⼲' => '干', - '⼳' => '幺', - '⼴' => '广', - '⼵' => '廴', - '⼶' => '廾', - '⼷' => '弋', - '⼸' => '弓', - '⼹' => '彐', - '⼺' => '彡', - '⼻' => '彳', - '⼼' => '心', - '⼽' => '戈', - '⼾' => '戶', - '⼿' => '手', - '⽀' => '支', - '⽁' => '攴', - '⽂' => '文', - '⽃' => '斗', - '⽄' => '斤', - '⽅' => '方', - '⽆' => '无', - '⽇' => '日', - '⽈' => '曰', - '⽉' => '月', - '⽊' => '木', - '⽋' => '欠', - '⽌' => '止', - '⽍' => '歹', - '⽎' => '殳', - '⽏' => '毋', - '⽐' => '比', - '⽑' => '毛', - '⽒' => '氏', - '⽓' => '气', - '⽔' => '水', - '⽕' => '火', - '⽖' => '爪', - '⽗' => '父', - '⽘' => '爻', - '⽙' => '爿', - '⽚' => '片', - '⽛' => '牙', - '⽜' => '牛', - '⽝' => '犬', - '⽞' => '玄', - '⽟' => '玉', - '⽠' => '瓜', - '⽡' => '瓦', - '⽢' => '甘', - '⽣' => '生', - '⽤' => '用', - '⽥' => '田', - '⽦' => '疋', - '⽧' => '疒', - '⽨' => '癶', - '⽩' => '白', - '⽪' => '皮', - '⽫' => '皿', - '⽬' => '目', - '⽭' => '矛', - '⽮' => '矢', - '⽯' => '石', - '⽰' => '示', - '⽱' => '禸', - '⽲' => '禾', - '⽳' => '穴', - '⽴' => '立', - '⽵' => '竹', - '⽶' => '米', - '⽷' => '糸', - '⽸' => '缶', - '⽹' => '网', - '⽺' => '羊', - '⽻' => '羽', - '⽼' => '老', - '⽽' => '而', - '⽾' => '耒', - '⽿' => '耳', - '⾀' => '聿', - '⾁' => '肉', - '⾂' => '臣', - '⾃' => '自', - '⾄' => '至', - '⾅' => '臼', - '⾆' => '舌', - '⾇' => '舛', - '⾈' => '舟', - '⾉' => '艮', - '⾊' => '色', - '⾋' => '艸', - '⾌' => '虍', - '⾍' => '虫', - '⾎' => '血', - '⾏' => '行', - '⾐' => '衣', - '⾑' => '襾', - '⾒' => '見', - '⾓' => '角', - '⾔' => '言', - '⾕' => '谷', - '⾖' => '豆', - '⾗' => '豕', - '⾘' => '豸', - '⾙' => '貝', - '⾚' => '赤', - '⾛' => '走', - '⾜' => '足', - '⾝' => '身', - '⾞' => '車', - '⾟' => '辛', - '⾠' => '辰', - '⾡' => '辵', - '⾢' => '邑', - '⾣' => '酉', - '⾤' => '釆', - '⾥' => '里', - '⾦' => '金', - '⾧' => '長', - '⾨' => '門', - '⾩' => '阜', - '⾪' => '隶', - '⾫' => '隹', - '⾬' => '雨', - '⾭' => '靑', - '⾮' => '非', - '⾯' => '面', - '⾰' => '革', - '⾱' => '韋', - '⾲' => '韭', - '⾳' => '音', - '⾴' => '頁', - '⾵' => '風', - '⾶' => '飛', - '⾷' => '食', - '⾸' => '首', - '⾹' => '香', - '⾺' => '馬', - '⾻' => '骨', - '⾼' => '高', - '⾽' => '髟', - '⾾' => '鬥', - '⾿' => '鬯', - '⿀' => '鬲', - '⿁' => '鬼', - '⿂' => '魚', - '⿃' => '鳥', - '⿄' => '鹵', - '⿅' => '鹿', - '⿆' => '麥', - '⿇' => '麻', - '⿈' => '黃', - '⿉' => '黍', - '⿊' => '黑', - '⿋' => '黹', - '⿌' => '黽', - '⿍' => '鼎', - '⿎' => '鼓', - '⿏' => '鼠', - '⿐' => '鼻', - '⿑' => '齊', - '⿒' => '齒', - '⿓' => '龍', - '⿔' => '龜', - '⿕' => '龠', - ' ' => ' ', - '〶' => '〒', - '〸' => '十', - '〹' => '卄', - '〺' => '卅', - '゛' => ' ゙', - '゜' => ' ゚', - 'ゟ' => 'より', - 'ヿ' => 'コト', - 'ㄱ' => 'ᄀ', - 'ㄲ' => 'ᄁ', - 'ㄳ' => 'ᆪ', - 'ㄴ' => 'ᄂ', - 'ㄵ' => 'ᆬ', - 'ㄶ' => 'ᆭ', - 'ㄷ' => 'ᄃ', - 'ㄸ' => 'ᄄ', - 'ㄹ' => 'ᄅ', - 'ㄺ' => 'ᆰ', - 'ㄻ' => 'ᆱ', - 'ㄼ' => 'ᆲ', - 'ㄽ' => 'ᆳ', - 'ㄾ' => 'ᆴ', - 'ㄿ' => 'ᆵ', - 'ㅀ' => 'ᄚ', - 'ㅁ' => 'ᄆ', - 'ㅂ' => 'ᄇ', - 'ㅃ' => 'ᄈ', - 'ㅄ' => 'ᄡ', - 'ㅅ' => 'ᄉ', - 'ㅆ' => 'ᄊ', - 'ㅇ' => 'ᄋ', - 'ㅈ' => 'ᄌ', - 'ㅉ' => 'ᄍ', - 'ㅊ' => 'ᄎ', - 'ㅋ' => 'ᄏ', - 'ㅌ' => 'ᄐ', - 'ㅍ' => 'ᄑ', - 'ㅎ' => 'ᄒ', - 'ㅏ' => 'ᅡ', - 'ㅐ' => 'ᅢ', - 'ㅑ' => 'ᅣ', - 'ㅒ' => 'ᅤ', - 'ㅓ' => 'ᅥ', - 'ㅔ' => 'ᅦ', - 'ㅕ' => 'ᅧ', - 'ㅖ' => 'ᅨ', - 'ㅗ' => 'ᅩ', - 'ㅘ' => 'ᅪ', - 'ㅙ' => 'ᅫ', - 'ㅚ' => 'ᅬ', - 'ㅛ' => 'ᅭ', - 'ㅜ' => 'ᅮ', - 'ㅝ' => 'ᅯ', - 'ㅞ' => 'ᅰ', - 'ㅟ' => 'ᅱ', - 'ㅠ' => 'ᅲ', - 'ㅡ' => 'ᅳ', - 'ㅢ' => 'ᅴ', - 'ㅣ' => 'ᅵ', - 'ㅤ' => 'ᅠ', - 'ㅥ' => 'ᄔ', - 'ㅦ' => 'ᄕ', - 'ㅧ' => 'ᇇ', - 'ㅨ' => 'ᇈ', - 'ㅩ' => 'ᇌ', - 'ㅪ' => 'ᇎ', - 'ㅫ' => 'ᇓ', - 'ㅬ' => 'ᇗ', - 'ㅭ' => 'ᇙ', - 'ㅮ' => 'ᄜ', - 'ㅯ' => 'ᇝ', - 'ㅰ' => 'ᇟ', - 'ㅱ' => 'ᄝ', - 'ㅲ' => 'ᄞ', - 'ㅳ' => 'ᄠ', - 'ㅴ' => 'ᄢ', - 'ㅵ' => 'ᄣ', - 'ㅶ' => 'ᄧ', - 'ㅷ' => 'ᄩ', - 'ㅸ' => 'ᄫ', - 'ㅹ' => 'ᄬ', - 'ㅺ' => 'ᄭ', - 'ㅻ' => 'ᄮ', - 'ㅼ' => 'ᄯ', - 'ㅽ' => 'ᄲ', - 'ㅾ' => 'ᄶ', - 'ㅿ' => 'ᅀ', - 'ㆀ' => 'ᅇ', - 'ㆁ' => 'ᅌ', - 'ㆂ' => 'ᇱ', - 'ㆃ' => 'ᇲ', - 'ㆄ' => 'ᅗ', - 'ㆅ' => 'ᅘ', - 'ㆆ' => 'ᅙ', - 'ㆇ' => 'ᆄ', - 'ㆈ' => 'ᆅ', - 'ㆉ' => 'ᆈ', - 'ㆊ' => 'ᆑ', - 'ㆋ' => 'ᆒ', - 'ㆌ' => 'ᆔ', - 'ㆍ' => 'ᆞ', - 'ㆎ' => 'ᆡ', - '㆒' => '一', - '㆓' => '二', - '㆔' => '三', - '㆕' => '四', - '㆖' => '上', - '㆗' => '中', - '㆘' => '下', - '㆙' => '甲', - '㆚' => '乙', - '㆛' => '丙', - '㆜' => '丁', - '㆝' => '天', - '㆞' => '地', - '㆟' => '人', - '㈀' => '(ᄀ)', - '㈁' => '(ᄂ)', - '㈂' => '(ᄃ)', - '㈃' => '(ᄅ)', - '㈄' => '(ᄆ)', - '㈅' => '(ᄇ)', - '㈆' => '(ᄉ)', - '㈇' => '(ᄋ)', - '㈈' => '(ᄌ)', - '㈉' => '(ᄎ)', - '㈊' => '(ᄏ)', - '㈋' => '(ᄐ)', - '㈌' => '(ᄑ)', - '㈍' => '(ᄒ)', - '㈎' => '(가)', - '㈏' => '(나)', - '㈐' => '(다)', - '㈑' => '(라)', - '㈒' => '(마)', - '㈓' => '(바)', - '㈔' => '(사)', - '㈕' => '(아)', - '㈖' => '(자)', - '㈗' => '(차)', - '㈘' => '(카)', - '㈙' => '(타)', - '㈚' => '(파)', - '㈛' => '(하)', - '㈜' => '(주)', - '㈝' => '(오전)', - '㈞' => '(오후)', - '㈠' => '(一)', - '㈡' => '(二)', - '㈢' => '(三)', - '㈣' => '(四)', - '㈤' => '(五)', - '㈥' => '(六)', - '㈦' => '(七)', - '㈧' => '(八)', - '㈨' => '(九)', - '㈩' => '(十)', - '㈪' => '(月)', - '㈫' => '(火)', - '㈬' => '(水)', - '㈭' => '(木)', - '㈮' => '(金)', - '㈯' => '(土)', - '㈰' => '(日)', - '㈱' => '(株)', - '㈲' => '(有)', - '㈳' => '(社)', - '㈴' => '(名)', - '㈵' => '(特)', - '㈶' => '(財)', - '㈷' => '(祝)', - '㈸' => '(労)', - '㈹' => '(代)', - '㈺' => '(呼)', - '㈻' => '(学)', - '㈼' => '(監)', - '㈽' => '(企)', - '㈾' => '(資)', - '㈿' => '(協)', - '㉀' => '(祭)', - '㉁' => '(休)', - '㉂' => '(自)', - '㉃' => '(至)', - '㉄' => '問', - '㉅' => '幼', - '㉆' => '文', - '㉇' => '箏', - '㉐' => 'PTE', - '㉑' => '21', - '㉒' => '22', - '㉓' => '23', - '㉔' => '24', - '㉕' => '25', - '㉖' => '26', - '㉗' => '27', - '㉘' => '28', - '㉙' => '29', - '㉚' => '30', - '㉛' => '31', - '㉜' => '32', - '㉝' => '33', - '㉞' => '34', - '㉟' => '35', - '㉠' => 'ᄀ', - '㉡' => 'ᄂ', - '㉢' => 'ᄃ', - '㉣' => 'ᄅ', - '㉤' => 'ᄆ', - '㉥' => 'ᄇ', - '㉦' => 'ᄉ', - '㉧' => 'ᄋ', - '㉨' => 'ᄌ', - '㉩' => 'ᄎ', - '㉪' => 'ᄏ', - '㉫' => 'ᄐ', - '㉬' => 'ᄑ', - '㉭' => 'ᄒ', - '㉮' => '가', - '㉯' => '나', - '㉰' => '다', - '㉱' => '라', - '㉲' => '마', - '㉳' => '바', - '㉴' => '사', - '㉵' => '아', - '㉶' => '자', - '㉷' => '차', - '㉸' => '카', - '㉹' => '타', - '㉺' => '파', - '㉻' => '하', - '㉼' => '참고', - '㉽' => '주의', - '㉾' => '우', - '㊀' => '一', - '㊁' => '二', - '㊂' => '三', - '㊃' => '四', - '㊄' => '五', - '㊅' => '六', - '㊆' => '七', - '㊇' => '八', - '㊈' => '九', - '㊉' => '十', - '㊊' => '月', - '㊋' => '火', - '㊌' => '水', - '㊍' => '木', - '㊎' => '金', - '㊏' => '土', - '㊐' => '日', - '㊑' => '株', - '㊒' => '有', - '㊓' => '社', - '㊔' => '名', - '㊕' => '特', - '㊖' => '財', - '㊗' => '祝', - '㊘' => '労', - '㊙' => '秘', - '㊚' => '男', - '㊛' => '女', - '㊜' => '適', - '㊝' => '優', - '㊞' => '印', - '㊟' => '注', - '㊠' => '項', - '㊡' => '休', - '㊢' => '写', - '㊣' => '正', - '㊤' => '上', - '㊥' => '中', - '㊦' => '下', - '㊧' => '左', - '㊨' => '右', - '㊩' => '医', - '㊪' => '宗', - '㊫' => '学', - '㊬' => '監', - '㊭' => '企', - '㊮' => '資', - '㊯' => '協', - '㊰' => '夜', - '㊱' => '36', - '㊲' => '37', - '㊳' => '38', - '㊴' => '39', - '㊵' => '40', - '㊶' => '41', - '㊷' => '42', - '㊸' => '43', - '㊹' => '44', - '㊺' => '45', - '㊻' => '46', - '㊼' => '47', - '㊽' => '48', - '㊾' => '49', - '㊿' => '50', - '㋀' => '1月', - '㋁' => '2月', - '㋂' => '3月', - '㋃' => '4月', - '㋄' => '5月', - '㋅' => '6月', - '㋆' => '7月', - '㋇' => '8月', - '㋈' => '9月', - '㋉' => '10月', - '㋊' => '11月', - '㋋' => '12月', - '㋌' => 'Hg', - '㋍' => 'erg', - '㋎' => 'eV', - '㋏' => 'LTD', - '㋐' => 'ア', - '㋑' => 'イ', - '㋒' => 'ウ', - '㋓' => 'エ', - '㋔' => 'オ', - '㋕' => 'カ', - '㋖' => 'キ', - '㋗' => 'ク', - '㋘' => 'ケ', - '㋙' => 'コ', - '㋚' => 'サ', - '㋛' => 'シ', - '㋜' => 'ス', - '㋝' => 'セ', - '㋞' => 'ソ', - '㋟' => 'タ', - '㋠' => 'チ', - '㋡' => 'ツ', - '㋢' => 'テ', - '㋣' => 'ト', - '㋤' => 'ナ', - '㋥' => 'ニ', - '㋦' => 'ヌ', - '㋧' => 'ネ', - '㋨' => 'ノ', - '㋩' => 'ハ', - '㋪' => 'ヒ', - '㋫' => 'フ', - '㋬' => 'ヘ', - '㋭' => 'ホ', - '㋮' => 'マ', - '㋯' => 'ミ', - '㋰' => 'ム', - '㋱' => 'メ', - '㋲' => 'モ', - '㋳' => 'ヤ', - '㋴' => 'ユ', - '㋵' => 'ヨ', - '㋶' => 'ラ', - '㋷' => 'リ', - '㋸' => 'ル', - '㋹' => 'レ', - '㋺' => 'ロ', - '㋻' => 'ワ', - '㋼' => 'ヰ', - '㋽' => 'ヱ', - '㋾' => 'ヲ', - '㋿' => '令和', - '㌀' => 'アパート', - '㌁' => 'アルファ', - '㌂' => 'アンペア', - '㌃' => 'アール', - '㌄' => 'イニング', - '㌅' => 'インチ', - '㌆' => 'ウォン', - '㌇' => 'エスクード', - '㌈' => 'エーカー', - '㌉' => 'オンス', - '㌊' => 'オーム', - '㌋' => 'カイリ', - '㌌' => 'カラット', - '㌍' => 'カロリー', - '㌎' => 'ガロン', - '㌏' => 'ガンマ', - '㌐' => 'ギガ', - '㌑' => 'ギニー', - '㌒' => 'キュリー', - '㌓' => 'ギルダー', - '㌔' => 'キロ', - '㌕' => 'キログラム', - '㌖' => 'キロメートル', - '㌗' => 'キロワット', - '㌘' => 'グラム', - '㌙' => 'グラムトン', - '㌚' => 'クルゼイロ', - '㌛' => 'クローネ', - '㌜' => 'ケース', - '㌝' => 'コルナ', - '㌞' => 'コーポ', - '㌟' => 'サイクル', - '㌠' => 'サンチーム', - '㌡' => 'シリング', - '㌢' => 'センチ', - '㌣' => 'セント', - '㌤' => 'ダース', - '㌥' => 'デシ', - '㌦' => 'ドル', - '㌧' => 'トン', - '㌨' => 'ナノ', - '㌩' => 'ノット', - '㌪' => 'ハイツ', - '㌫' => 'パーセント', - '㌬' => 'パーツ', - '㌭' => 'バーレル', - '㌮' => 'ピアストル', - '㌯' => 'ピクル', - '㌰' => 'ピコ', - '㌱' => 'ビル', - '㌲' => 'ファラッド', - '㌳' => 'フィート', - '㌴' => 'ブッシェル', - '㌵' => 'フラン', - '㌶' => 'ヘクタール', - '㌷' => 'ペソ', - '㌸' => 'ペニヒ', - '㌹' => 'ヘルツ', - '㌺' => 'ペンス', - '㌻' => 'ページ', - '㌼' => 'ベータ', - '㌽' => 'ポイント', - '㌾' => 'ボルト', - '㌿' => 'ホン', - '㍀' => 'ポンド', - '㍁' => 'ホール', - '㍂' => 'ホーン', - '㍃' => 'マイクロ', - '㍄' => 'マイル', - '㍅' => 'マッハ', - '㍆' => 'マルク', - '㍇' => 'マンション', - '㍈' => 'ミクロン', - '㍉' => 'ミリ', - '㍊' => 'ミリバール', - '㍋' => 'メガ', - '㍌' => 'メガトン', - '㍍' => 'メートル', - '㍎' => 'ヤード', - '㍏' => 'ヤール', - '㍐' => 'ユアン', - '㍑' => 'リットル', - '㍒' => 'リラ', - '㍓' => 'ルピー', - '㍔' => 'ルーブル', - '㍕' => 'レム', - '㍖' => 'レントゲン', - '㍗' => 'ワット', - '㍘' => '0点', - '㍙' => '1点', - '㍚' => '2点', - '㍛' => '3点', - '㍜' => '4点', - '㍝' => '5点', - '㍞' => '6点', - '㍟' => '7点', - '㍠' => '8点', - '㍡' => '9点', - '㍢' => '10点', - '㍣' => '11点', - '㍤' => '12点', - '㍥' => '13点', - '㍦' => '14点', - '㍧' => '15点', - '㍨' => '16点', - '㍩' => '17点', - '㍪' => '18点', - '㍫' => '19点', - '㍬' => '20点', - '㍭' => '21点', - '㍮' => '22点', - '㍯' => '23点', - '㍰' => '24点', - '㍱' => 'hPa', - '㍲' => 'da', - '㍳' => 'AU', - '㍴' => 'bar', - '㍵' => 'oV', - '㍶' => 'pc', - '㍷' => 'dm', - '㍸' => 'dm2', - '㍹' => 'dm3', - '㍺' => 'IU', - '㍻' => '平成', - '㍼' => '昭和', - '㍽' => '大正', - '㍾' => '明治', - '㍿' => '株式会社', - '㎀' => 'pA', - '㎁' => 'nA', - '㎂' => 'μA', - '㎃' => 'mA', - '㎄' => 'kA', - '㎅' => 'KB', - '㎆' => 'MB', - '㎇' => 'GB', - '㎈' => 'cal', - '㎉' => 'kcal', - '㎊' => 'pF', - '㎋' => 'nF', - '㎌' => 'μF', - '㎍' => 'μg', - '㎎' => 'mg', - '㎏' => 'kg', - '㎐' => 'Hz', - '㎑' => 'kHz', - '㎒' => 'MHz', - '㎓' => 'GHz', - '㎔' => 'THz', - '㎕' => 'μl', - '㎖' => 'ml', - '㎗' => 'dl', - '㎘' => 'kl', - '㎙' => 'fm', - '㎚' => 'nm', - '㎛' => 'μm', - '㎜' => 'mm', - '㎝' => 'cm', - '㎞' => 'km', - '㎟' => 'mm2', - '㎠' => 'cm2', - '㎡' => 'm2', - '㎢' => 'km2', - '㎣' => 'mm3', - '㎤' => 'cm3', - '㎥' => 'm3', - '㎦' => 'km3', - '㎧' => 'm∕s', - '㎨' => 'm∕s2', - '㎩' => 'Pa', - '㎪' => 'kPa', - '㎫' => 'MPa', - '㎬' => 'GPa', - '㎭' => 'rad', - '㎮' => 'rad∕s', - '㎯' => 'rad∕s2', - '㎰' => 'ps', - '㎱' => 'ns', - '㎲' => 'μs', - '㎳' => 'ms', - '㎴' => 'pV', - '㎵' => 'nV', - '㎶' => 'μV', - '㎷' => 'mV', - '㎸' => 'kV', - '㎹' => 'MV', - '㎺' => 'pW', - '㎻' => 'nW', - '㎼' => 'μW', - '㎽' => 'mW', - '㎾' => 'kW', - '㎿' => 'MW', - '㏀' => 'kΩ', - '㏁' => 'MΩ', - '㏂' => 'a.m.', - '㏃' => 'Bq', - '㏄' => 'cc', - '㏅' => 'cd', - '㏆' => 'C∕kg', - '㏇' => 'Co.', - '㏈' => 'dB', - '㏉' => 'Gy', - '㏊' => 'ha', - '㏋' => 'HP', - '㏌' => 'in', - '㏍' => 'KK', - '㏎' => 'KM', - '㏏' => 'kt', - '㏐' => 'lm', - '㏑' => 'ln', - '㏒' => 'log', - '㏓' => 'lx', - '㏔' => 'mb', - '㏕' => 'mil', - '㏖' => 'mol', - '㏗' => 'PH', - '㏘' => 'p.m.', - '㏙' => 'PPM', - '㏚' => 'PR', - '㏛' => 'sr', - '㏜' => 'Sv', - '㏝' => 'Wb', - '㏞' => 'V∕m', - '㏟' => 'A∕m', - '㏠' => '1日', - '㏡' => '2日', - '㏢' => '3日', - '㏣' => '4日', - '㏤' => '5日', - '㏥' => '6日', - '㏦' => '7日', - '㏧' => '8日', - '㏨' => '9日', - '㏩' => '10日', - '㏪' => '11日', - '㏫' => '12日', - '㏬' => '13日', - '㏭' => '14日', - '㏮' => '15日', - '㏯' => '16日', - '㏰' => '17日', - '㏱' => '18日', - '㏲' => '19日', - '㏳' => '20日', - '㏴' => '21日', - '㏵' => '22日', - '㏶' => '23日', - '㏷' => '24日', - '㏸' => '25日', - '㏹' => '26日', - '㏺' => '27日', - '㏻' => '28日', - '㏼' => '29日', - '㏽' => '30日', - '㏾' => '31日', - '㏿' => 'gal', - 'ꚜ' => 'ъ', - 'ꚝ' => 'ь', - 'ꝰ' => 'ꝯ', - 'ꟸ' => 'Ħ', - 'ꟹ' => 'œ', - 'ꭜ' => 'ꜧ', - 'ꭝ' => 'ꬷ', - 'ꭞ' => 'ɫ', - 'ꭟ' => 'ꭒ', - 'ꭩ' => 'ʍ', - 'ff' => 'ff', - 'fi' => 'f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', - 'ﯛ' => 'ۈ', - 'ﯜ' => 'ۈ', - 'ﯝ' => 'ۇٴ', - 'ﯞ' => 'ۋ', - 'ﯟ' => 'ۋ', - 'ﯠ' => 'ۅ', - 'ﯡ' => 'ۅ', - 'ﯢ' => 'ۉ', - 'ﯣ' => 'ۉ', - 'ﯤ' => 'ې', - 'ﯥ' => 'ې', - 'ﯦ' => 'ې', - 'ﯧ' => 'ې', - 'ﯨ' => 'ى', - 'ﯩ' => 'ى', - 'ﯪ' => 'ئا', - 'ﯫ' => 'ئا', - 'ﯬ' => 'ئە', - 'ﯭ' => 'ئە', - 'ﯮ' => 'ئو', - 'ﯯ' => 'ئو', - 'ﯰ' => 'ئۇ', - 'ﯱ' => 'ئۇ', - 'ﯲ' => 'ئۆ', - 'ﯳ' => 'ئۆ', - 'ﯴ' => 'ئۈ', - 'ﯵ' => 'ئۈ', - 'ﯶ' => 'ئې', - 'ﯷ' => 'ئې', - 'ﯸ' => 'ئې', - 'ﯹ' => 'ئى', - 'ﯺ' => 'ئى', - 'ﯻ' => 'ئى', - 'ﯼ' => 'ی', - 'ﯽ' => 'ی', - 'ﯾ' => 'ی', - 'ﯿ' => 'ی', - 'ﰀ' => 'ئج', - 'ﰁ' => 'ئح', - 'ﰂ' => 'ئم', - 'ﰃ' => 'ئى', - 'ﰄ' => 'ئي', - 'ﰅ' => 'بج', - 'ﰆ' => 'بح', - 'ﰇ' => 'بخ', - 'ﰈ' => 'بم', - 'ﰉ' => 'بى', - 'ﰊ' => 'بي', - 'ﰋ' => 'تج', - 'ﰌ' => 'تح', - 'ﰍ' => 'تخ', - 'ﰎ' => 'تم', - 'ﰏ' => 'تى', - 'ﰐ' => 'تي', - 'ﰑ' => 'ثج', - 'ﰒ' => 'ثم', - 'ﰓ' => 'ثى', - 'ﰔ' => 'ثي', - 'ﰕ' => 'جح', - 'ﰖ' => 'جم', - 'ﰗ' => 'حج', - 'ﰘ' => 'حم', - 'ﰙ' => 'خج', - 'ﰚ' => 'خح', - 'ﰛ' => 'خم', - 'ﰜ' => 'سج', - 'ﰝ' => 'سح', - 'ﰞ' => 'سخ', - 'ﰟ' => 'سم', - 'ﰠ' => 'صح', - 'ﰡ' => 'صم', - 'ﰢ' => 'ضج', - 'ﰣ' => 'ضح', - 'ﰤ' => 'ضخ', - 'ﰥ' => 'ضم', - 'ﰦ' => 'طح', - 'ﰧ' => 'طم', - 'ﰨ' => 'ظم', - 'ﰩ' => 'عج', - 'ﰪ' => 'عم', - 'ﰫ' => 'غج', - 'ﰬ' => 'غم', - 'ﰭ' => 'فج', - 'ﰮ' => 'فح', - 'ﰯ' => 'فخ', - 'ﰰ' => 'فم', - 'ﰱ' => 'فى', - 'ﰲ' => 'في', - 'ﰳ' => 'قح', - 'ﰴ' => 'قم', - 'ﰵ' => 'قى', - 'ﰶ' => 'قي', - 'ﰷ' => 'كا', - 'ﰸ' => 'كج', - 'ﰹ' => 'كح', - 'ﰺ' => 'كخ', - 'ﰻ' => 'كل', - 'ﰼ' => 'كم', - 'ﰽ' => 'كى', - 'ﰾ' => 'كي', - 'ﰿ' => 'لج', - 'ﱀ' => 'لح', - 'ﱁ' => 'لخ', - 'ﱂ' => 'لم', - 'ﱃ' => 'لى', - 'ﱄ' => 'لي', - 'ﱅ' => 'مج', - 'ﱆ' => 'مح', - 'ﱇ' => 'مخ', - 'ﱈ' => 'مم', - 'ﱉ' => 'مى', - 'ﱊ' => 'مي', - 'ﱋ' => 'نج', - 'ﱌ' => 'نح', - 'ﱍ' => 'نخ', - 'ﱎ' => 'نم', - 'ﱏ' => 'نى', - 'ﱐ' => 'ني', - 'ﱑ' => 'هج', - 'ﱒ' => 'هم', - 'ﱓ' => 'هى', - 'ﱔ' => 'هي', - 'ﱕ' => 'يج', - 'ﱖ' => 'يح', - 'ﱗ' => 'يخ', - 'ﱘ' => 'يم', - 'ﱙ' => 'يى', - 'ﱚ' => 'يي', - 'ﱛ' => 'ذٰ', - 'ﱜ' => 'رٰ', - 'ﱝ' => 'ىٰ', - 'ﱞ' => ' ٌّ', - 'ﱟ' => ' ٍّ', - 'ﱠ' => ' َّ', - 'ﱡ' => ' ُّ', - 'ﱢ' => ' ِّ', - 'ﱣ' => ' ّٰ', - 'ﱤ' => 'ئر', - 'ﱥ' => 'ئز', - 'ﱦ' => 'ئم', - 'ﱧ' => 'ئن', - 'ﱨ' => 'ئى', - 'ﱩ' => 'ئي', - 'ﱪ' => 'بر', - 'ﱫ' => 'بز', - 'ﱬ' => 'بم', - 'ﱭ' => 'بن', - 'ﱮ' => 'بى', - 'ﱯ' => 'بي', - 'ﱰ' => 'تر', - 'ﱱ' => 'تز', - 'ﱲ' => 'تم', - 'ﱳ' => 'تن', - 'ﱴ' => 'تى', - 'ﱵ' => 'تي', - 'ﱶ' => 'ثر', - 'ﱷ' => 'ثز', - 'ﱸ' => 'ثم', - 'ﱹ' => 'ثن', - 'ﱺ' => 'ثى', - 'ﱻ' => 'ثي', - 'ﱼ' => 'فى', - 'ﱽ' => 'في', - 'ﱾ' => 'قى', - 'ﱿ' => 'قي', - 'ﲀ' => 'كا', - 'ﲁ' => 'كل', - 'ﲂ' => 'كم', - 'ﲃ' => 'كى', - 'ﲄ' => 'كي', - 'ﲅ' => 'لم', - 'ﲆ' => 'لى', - 'ﲇ' => 'لي', - 'ﲈ' => 'ما', - 'ﲉ' => 'مم', - 'ﲊ' => 'نر', - 'ﲋ' => 'نز', - 'ﲌ' => 'نم', - 'ﲍ' => 'نن', - 'ﲎ' => 'نى', - 'ﲏ' => 'ني', - 'ﲐ' => 'ىٰ', - 'ﲑ' => 'ير', - 'ﲒ' => 'يز', - 'ﲓ' => 'يم', - 'ﲔ' => 'ين', - 'ﲕ' => 'يى', - 'ﲖ' => 'يي', - 'ﲗ' => 'ئج', - 'ﲘ' => 'ئح', - 'ﲙ' => 'ئخ', - 'ﲚ' => 'ئم', - 'ﲛ' => 'ئه', - 'ﲜ' => 'بج', - 'ﲝ' => 'بح', - 'ﲞ' => 'بخ', - 'ﲟ' => 'بم', - 'ﲠ' => 'به', - 'ﲡ' => 'تج', - 'ﲢ' => 'تح', - 'ﲣ' => 'تخ', - 'ﲤ' => 'تم', - 'ﲥ' => 'ته', - 'ﲦ' => 'ثم', - 'ﲧ' => 'جح', - 'ﲨ' => 'جم', - 'ﲩ' => 'حج', - 'ﲪ' => 'حم', - 'ﲫ' => 'خج', - 'ﲬ' => 'خم', - 'ﲭ' => 'سج', - 'ﲮ' => 'سح', - 'ﲯ' => 'سخ', - 'ﲰ' => 'سم', - 'ﲱ' => 'صح', - 'ﲲ' => 'صخ', - 'ﲳ' => 'صم', - 'ﲴ' => 'ضج', - 'ﲵ' => 'ضح', - 'ﲶ' => 'ضخ', - 'ﲷ' => 'ضم', - 'ﲸ' => 'طح', - 'ﲹ' => 'ظم', - 'ﲺ' => 'عج', - 'ﲻ' => 'عم', - 'ﲼ' => 'غج', - 'ﲽ' => 'غم', - 'ﲾ' => 'فج', - 'ﲿ' => 'فح', - 'ﳀ' => 'فخ', - 'ﳁ' => 'فم', - 'ﳂ' => 'قح', - 'ﳃ' => 'قم', - 'ﳄ' => 'كج', - 'ﳅ' => 'كح', - 'ﳆ' => 'كخ', - 'ﳇ' => 'كل', - 'ﳈ' => 'كم', - 'ﳉ' => 'لج', - 'ﳊ' => 'لح', - 'ﳋ' => 'لخ', - 'ﳌ' => 'لم', - 'ﳍ' => 'له', - 'ﳎ' => 'مج', - 'ﳏ' => 'مح', - 'ﳐ' => 'مخ', - 'ﳑ' => 'مم', - 'ﳒ' => 'نج', - 'ﳓ' => 'نح', - 'ﳔ' => 'نخ', - 'ﳕ' => 'نم', - 'ﳖ' => 'نه', - 'ﳗ' => 'هج', - 'ﳘ' => 'هم', - 'ﳙ' => 'هٰ', - 'ﳚ' => 'يج', - 'ﳛ' => 'يح', - 'ﳜ' => 'يخ', - 'ﳝ' => 'يم', - 'ﳞ' => 'يه', - 'ﳟ' => 'ئم', - 'ﳠ' => 'ئه', - 'ﳡ' => 'بم', - 'ﳢ' => 'به', - 'ﳣ' => 'تم', - 'ﳤ' => 'ته', - 'ﳥ' => 'ثم', - 'ﳦ' => 'ثه', - 'ﳧ' => 'سم', - 'ﳨ' => 'سه', - 'ﳩ' => 'شم', - 'ﳪ' => 'شه', - 'ﳫ' => 'كل', - 'ﳬ' => 'كم', - 'ﳭ' => 'لم', - 'ﳮ' => 'نم', - 'ﳯ' => 'نه', - 'ﳰ' => 'يم', - 'ﳱ' => 'يه', - 'ﳲ' => 'ـَّ', - 'ﳳ' => 'ـُّ', - 'ﳴ' => 'ـِّ', - 'ﳵ' => 'طى', - 'ﳶ' => 'طي', - 'ﳷ' => 'عى', - 'ﳸ' => 'عي', - 'ﳹ' => 'غى', - 'ﳺ' => 'غي', - 'ﳻ' => 'سى', - 'ﳼ' => 'سي', - 'ﳽ' => 'شى', - 'ﳾ' => 'شي', - 'ﳿ' => 'حى', - 'ﴀ' => 'حي', - 'ﴁ' => 'جى', - 'ﴂ' => 'جي', - 'ﴃ' => 'خى', - 'ﴄ' => 'خي', - 'ﴅ' => 'صى', - 'ﴆ' => 'صي', - 'ﴇ' => 'ضى', - 'ﴈ' => 'ضي', - 'ﴉ' => 'شج', - 'ﴊ' => 'شح', - 'ﴋ' => 'شخ', - 'ﴌ' => 'شم', - 'ﴍ' => 'شر', - 'ﴎ' => 'سر', - 'ﴏ' => 'صر', - 'ﴐ' => 'ضر', - 'ﴑ' => 'طى', - 'ﴒ' => 'طي', - 'ﴓ' => 'عى', - 'ﴔ' => 'عي', - 'ﴕ' => 'غى', - 'ﴖ' => 'غي', - 'ﴗ' => 'سى', - 'ﴘ' => 'سي', - 'ﴙ' => 'شى', - 'ﴚ' => 'شي', - 'ﴛ' => 'حى', - 'ﴜ' => 'حي', - 'ﴝ' => 'جى', - 'ﴞ' => 'جي', - 'ﴟ' => 'خى', - 'ﴠ' => 'خي', - 'ﴡ' => 'صى', - 'ﴢ' => 'صي', - 'ﴣ' => 'ضى', - 'ﴤ' => 'ضي', - 'ﴥ' => 'شج', - 'ﴦ' => 'شح', - 'ﴧ' => 'شخ', - 'ﴨ' => 'شم', - 'ﴩ' => 'شر', - 'ﴪ' => 'سر', - 'ﴫ' => 'صر', - 'ﴬ' => 'ضر', - 'ﴭ' => 'شج', - 'ﴮ' => 'شح', - 'ﴯ' => 'شخ', - 'ﴰ' => 'شم', - 'ﴱ' => 'سه', - 'ﴲ' => 'شه', - 'ﴳ' => 'طم', - 'ﴴ' => 'سج', - 'ﴵ' => 'سح', - 'ﴶ' => 'سخ', - 'ﴷ' => 'شج', - 'ﴸ' => 'شح', - 'ﴹ' => 'شخ', - 'ﴺ' => 'طم', - 'ﴻ' => 'ظم', - 'ﴼ' => 'اً', - 'ﴽ' => 'اً', - 'ﵐ' => 'تجم', - 'ﵑ' => 'تحج', - 'ﵒ' => 'تحج', - 'ﵓ' => 'تحم', - 'ﵔ' => 'تخم', - 'ﵕ' => 'تمج', - 'ﵖ' => 'تمح', - 'ﵗ' => 'تمخ', - 'ﵘ' => 'جمح', - 'ﵙ' => 'جمح', - 'ﵚ' => 'حمي', - 'ﵛ' => 'حمى', - 'ﵜ' => 'سحج', - 'ﵝ' => 'سجح', - 'ﵞ' => 'سجى', - 'ﵟ' => 'سمح', - 'ﵠ' => 'سمح', - 'ﵡ' => 'سمج', - 'ﵢ' => 'سمم', - 'ﵣ' => 'سمم', - 'ﵤ' => 'صحح', - 'ﵥ' => 'صحح', - 'ﵦ' => 'صمم', - 'ﵧ' => 'شحم', - 'ﵨ' => 'شحم', - 'ﵩ' => 'شجي', - 'ﵪ' => 'شمخ', - 'ﵫ' => 'شمخ', - 'ﵬ' => 'شمم', - 'ﵭ' => 'شمم', - 'ﵮ' => 'ضحى', - 'ﵯ' => 'ضخم', - 'ﵰ' => 'ضخم', - 'ﵱ' => 'طمح', - 'ﵲ' => 'طمح', - 'ﵳ' => 'طمم', - 'ﵴ' => 'طمي', - 'ﵵ' => 'عجم', - 'ﵶ' => 'عمم', - 'ﵷ' => 'عمم', - 'ﵸ' => 'عمى', - 'ﵹ' => 'غمم', - 'ﵺ' => 'غمي', - 'ﵻ' => 'غمى', - 'ﵼ' => 'فخم', - 'ﵽ' => 'فخم', - 'ﵾ' => 'قمح', - 'ﵿ' => 'قمم', - 'ﶀ' => 'لحم', - 'ﶁ' => 'لحي', - 'ﶂ' => 'لحى', - 'ﶃ' => 'لجج', - 'ﶄ' => 'لجج', - 'ﶅ' => 'لخم', - 'ﶆ' => 'لخم', - 'ﶇ' => 'لمح', - 'ﶈ' => 'لمح', - 'ﶉ' => 'محج', - 'ﶊ' => 'محم', - 'ﶋ' => 'محي', - 'ﶌ' => 'مجح', - 'ﶍ' => 'مجم', - 'ﶎ' => 'مخج', - 'ﶏ' => 'مخم', - 'ﶒ' => 'مجخ', - 'ﶓ' => 'همج', - 'ﶔ' => 'همم', - 'ﶕ' => 'نحم', - 'ﶖ' => 'نحى', - 'ﶗ' => 'نجم', - 'ﶘ' => 'نجم', - 'ﶙ' => 'نجى', - 'ﶚ' => 'نمي', - 'ﶛ' => 'نمى', - 'ﶜ' => 'يمم', - 'ﶝ' => 'يمم', - 'ﶞ' => 'بخي', - 'ﶟ' => 'تجي', - 'ﶠ' => 'تجى', - 'ﶡ' => 'تخي', - 'ﶢ' => 'تخى', - 'ﶣ' => 'تمي', - 'ﶤ' => 'تمى', - 'ﶥ' => 'جمي', - 'ﶦ' => 'جحى', - 'ﶧ' => 'جمى', - 'ﶨ' => 'سخى', - 'ﶩ' => 'صحي', - 'ﶪ' => 'شحي', - 'ﶫ' => 'ضحي', - 'ﶬ' => 'لجي', - 'ﶭ' => 'لمي', - 'ﶮ' => 'يحي', - 'ﶯ' => 'يجي', - 'ﶰ' => 'يمي', - 'ﶱ' => 'ممي', - 'ﶲ' => 'قمي', - 'ﶳ' => 'نحي', - 'ﶴ' => 'قمح', - 'ﶵ' => 'لحم', - 'ﶶ' => 'عمي', - 'ﶷ' => 'كمي', - 'ﶸ' => 'نجح', - 'ﶹ' => 'مخي', - 'ﶺ' => 'لجم', - 'ﶻ' => 'كمم', - 'ﶼ' => 'لجم', - 'ﶽ' => 'نجح', - 'ﶾ' => 'جحي', - 'ﶿ' => 'حجي', - 'ﷀ' => 'مجي', - 'ﷁ' => 'فمي', - 'ﷂ' => 'بحي', - 'ﷃ' => 'كمم', - 'ﷄ' => 'عجم', - 'ﷅ' => 'صمم', - 'ﷆ' => 'سخي', - 'ﷇ' => 'نجي', - 'ﷰ' => 'صلے', - 'ﷱ' => 'قلے', - 'ﷲ' => 'الله', - 'ﷳ' => 'اكبر', - 'ﷴ' => 'محمد', - 'ﷵ' => 'صلعم', - 'ﷶ' => 'رسول', - 'ﷷ' => 'عليه', - 'ﷸ' => 'وسلم', - 'ﷹ' => 'صلى', - 'ﷺ' => 'صلى الله عليه وسلم', - 'ﷻ' => 'جل جلاله', - '﷼' => 'ریال', - '︐' => ',', - '︑' => '、', - '︒' => '。', - '︓' => ':', - '︔' => ';', - '︕' => '!', - '︖' => '?', - '︗' => '〖', - '︘' => '〗', - '︙' => '...', - '︰' => '..', - '︱' => '—', - '︲' => '–', - '︳' => '_', - '︴' => '_', - '︵' => '(', - '︶' => ')', - '︷' => '{', - '︸' => '}', - '︹' => '〔', - '︺' => '〕', - '︻' => '【', - '︼' => '】', - '︽' => '《', - '︾' => '》', - '︿' => '〈', - '﹀' => '〉', - '﹁' => '「', - '﹂' => '」', - '﹃' => '『', - '﹄' => '』', - '﹇' => '[', - '﹈' => ']', - '﹉' => ' ̅', - '﹊' => ' ̅', - '﹋' => ' ̅', - '﹌' => ' ̅', - '﹍' => '_', - '﹎' => '_', - '﹏' => '_', - '﹐' => ',', - '﹑' => '、', - '﹒' => '.', - '﹔' => ';', - '﹕' => ':', - '﹖' => '?', - '﹗' => '!', - '﹘' => '—', - '﹙' => '(', - '﹚' => ')', - '﹛' => '{', - '﹜' => '}', - '﹝' => '〔', - '﹞' => '〕', - '﹟' => '#', - '﹠' => '&', - '﹡' => '*', - '﹢' => '+', - '﹣' => '-', - '﹤' => '<', - '﹥' => '>', - '﹦' => '=', - '﹨' => '\\', - '﹩' => '$', - '﹪' => '%', - '﹫' => '@', - 'ﹰ' => ' ً', - 'ﹱ' => 'ـً', - 'ﹲ' => ' ٌ', - 'ﹴ' => ' ٍ', - 'ﹶ' => ' َ', - 'ﹷ' => 'ـَ', - 'ﹸ' => ' ُ', - 'ﹹ' => 'ـُ', - 'ﹺ' => ' ِ', - 'ﹻ' => 'ـِ', - 'ﹼ' => ' ّ', - 'ﹽ' => 'ـّ', - 'ﹾ' => ' ْ', - 'ﹿ' => 'ـْ', - 'ﺀ' => 'ء', - 'ﺁ' => 'آ', - 'ﺂ' => 'آ', - 'ﺃ' => 'أ', - 'ﺄ' => 'أ', - 'ﺅ' => 'ؤ', - 'ﺆ' => 'ؤ', - 'ﺇ' => 'إ', - 'ﺈ' => 'إ', - 'ﺉ' => 'ئ', - 'ﺊ' => 'ئ', - 'ﺋ' => 'ئ', - 'ﺌ' => 'ئ', - 'ﺍ' => 'ا', - 'ﺎ' => 'ا', - 'ﺏ' => 'ب', - 'ﺐ' => 'ب', - 'ﺑ' => 'ب', - 'ﺒ' => 'ب', - 'ﺓ' => 'ة', - 'ﺔ' => 'ة', - 'ﺕ' => 'ت', - 'ﺖ' => 'ت', - 'ﺗ' => 'ت', - 'ﺘ' => 'ت', - 'ﺙ' => 'ث', - 'ﺚ' => 'ث', - 'ﺛ' => 'ث', - 'ﺜ' => 'ث', - 'ﺝ' => 'ج', - 'ﺞ' => 'ج', - 'ﺟ' => 'ج', - 'ﺠ' => 'ج', - 'ﺡ' => 'ح', - 'ﺢ' => 'ح', - 'ﺣ' => 'ح', - 'ﺤ' => 'ح', - 'ﺥ' => 'خ', - 'ﺦ' => 'خ', - 'ﺧ' => 'خ', - 'ﺨ' => 'خ', - 'ﺩ' => 'د', - 'ﺪ' => 'د', - 'ﺫ' => 'ذ', - 'ﺬ' => 'ذ', - 'ﺭ' => 'ر', - 'ﺮ' => 'ر', - 'ﺯ' => 'ز', - 'ﺰ' => 'ز', - 'ﺱ' => 'س', - 'ﺲ' => 'س', - 'ﺳ' => 'س', - 'ﺴ' => 'س', - 'ﺵ' => 'ش', - 'ﺶ' => 'ش', - 'ﺷ' => 'ش', - 'ﺸ' => 'ش', - 'ﺹ' => 'ص', - 'ﺺ' => 'ص', - 'ﺻ' => 'ص', - 'ﺼ' => 'ص', - 'ﺽ' => 'ض', - 'ﺾ' => 'ض', - 'ﺿ' => 'ض', - 'ﻀ' => 'ض', - 'ﻁ' => 'ط', - 'ﻂ' => 'ط', - 'ﻃ' => 'ط', - 'ﻄ' => 'ط', - 'ﻅ' => 'ظ', - 'ﻆ' => 'ظ', - 'ﻇ' => 'ظ', - 'ﻈ' => 'ظ', - 'ﻉ' => 'ع', - 'ﻊ' => 'ع', - 'ﻋ' => 'ع', - 'ﻌ' => 'ع', - 'ﻍ' => 'غ', - 'ﻎ' => 'غ', - 'ﻏ' => 'غ', - 'ﻐ' => 'غ', - 'ﻑ' => 'ف', - 'ﻒ' => 'ف', - 'ﻓ' => 'ف', - 'ﻔ' => 'ف', - 'ﻕ' => 'ق', - 'ﻖ' => 'ق', - 'ﻗ' => 'ق', - 'ﻘ' => 'ق', - 'ﻙ' => 'ك', - 'ﻚ' => 'ك', - 'ﻛ' => 'ك', - 'ﻜ' => 'ك', - 'ﻝ' => 'ل', - 'ﻞ' => 'ل', - 'ﻟ' => 'ل', - 'ﻠ' => 'ل', - 'ﻡ' => 'م', - 'ﻢ' => 'م', - 'ﻣ' => 'م', - 'ﻤ' => 'م', - 'ﻥ' => 'ن', - 'ﻦ' => 'ن', - 'ﻧ' => 'ن', - 'ﻨ' => 'ن', - 'ﻩ' => 'ه', - 'ﻪ' => 'ه', - 'ﻫ' => 'ه', - 'ﻬ' => 'ه', - 'ﻭ' => 'و', - 'ﻮ' => 'و', - 'ﻯ' => 'ى', - 'ﻰ' => 'ى', - 'ﻱ' => 'ي', - 'ﻲ' => 'ي', - 'ﻳ' => 'ي', - 'ﻴ' => 'ي', - 'ﻵ' => 'لآ', - 'ﻶ' => 'لآ', - 'ﻷ' => 'لأ', - 'ﻸ' => 'لأ', - 'ﻹ' => 'لإ', - 'ﻺ' => 'لإ', - 'ﻻ' => 'لا', - 'ﻼ' => 'لا', - '!' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - '%' => '%', - '&' => '&', - ''' => '\'', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - '-' => '-', - '.' => '.', - '/' => '/', - '0' => '0', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - ':' => ':', - ';' => ';', - '<' => '<', - '=' => '=', - '>' => '>', - '?' => '?', - '@' => '@', - 'A' => 'A', - 'B' => 'B', - 'C' => 'C', - 'D' => 'D', - 'E' => 'E', - 'F' => 'F', - 'G' => 'G', - 'H' => 'H', - 'I' => 'I', - 'J' => 'J', - 'K' => 'K', - 'L' => 'L', - 'M' => 'M', - 'N' => 'N', - 'O' => 'O', - 'P' => 'P', - 'Q' => 'Q', - 'R' => 'R', - 'S' => 'S', - 'T' => 'T', - 'U' => 'U', - 'V' => 'V', - 'W' => 'W', - 'X' => 'X', - 'Y' => 'Y', - 'Z' => 'Z', - '[' => '[', - '\' => '\\', - ']' => ']', - '^' => '^', - '_' => '_', - '`' => '`', - 'a' => 'a', - 'b' => 'b', - 'c' => 'c', - 'd' => 'd', - 'e' => 'e', - 'f' => 'f', - 'g' => 'g', - 'h' => 'h', - 'i' => 'i', - 'j' => 'j', - 'k' => 'k', - 'l' => 'l', - 'm' => 'm', - 'n' => 'n', - 'o' => 'o', - 'p' => 'p', - 'q' => 'q', - 'r' => 'r', - 's' => 's', - 't' => 't', - 'u' => 'u', - 'v' => 'v', - 'w' => 'w', - 'x' => 'x', - 'y' => 'y', - 'z' => 'z', - '{' => '{', - '|' => '|', - '}' => '}', - '~' => '~', - '⦅' => '⦅', - '⦆' => '⦆', - '。' => '。', - '「' => '「', - '」' => '」', - '、' => '、', - '・' => '・', - 'ヲ' => 'ヲ', - 'ァ' => 'ァ', - 'ィ' => 'ィ', - 'ゥ' => 'ゥ', - 'ェ' => 'ェ', - 'ォ' => 'ォ', - 'ャ' => 'ャ', - 'ュ' => 'ュ', - 'ョ' => 'ョ', - 'ッ' => 'ッ', - 'ー' => 'ー', - 'ア' => 'ア', - 'イ' => 'イ', - 'ウ' => 'ウ', - 'エ' => 'エ', - 'オ' => 'オ', - 'カ' => 'カ', - 'キ' => 'キ', - 'ク' => 'ク', - 'ケ' => 'ケ', - 'コ' => 'コ', - 'サ' => 'サ', - 'シ' => 'シ', - 'ス' => 'ス', - 'セ' => 'セ', - 'ソ' => 'ソ', - 'タ' => 'タ', - 'チ' => 'チ', - 'ツ' => 'ツ', - 'テ' => 'テ', - 'ト' => 'ト', - 'ナ' => 'ナ', - 'ニ' => 'ニ', - 'ヌ' => 'ヌ', - 'ネ' => 'ネ', - 'ノ' => 'ノ', - 'ハ' => 'ハ', - 'ヒ' => 'ヒ', - 'フ' => 'フ', - 'ヘ' => 'ヘ', - 'ホ' => 'ホ', - 'マ' => 'マ', - 'ミ' => 'ミ', - 'ム' => 'ム', - 'メ' => 'メ', - 'モ' => 'モ', - 'ヤ' => 'ヤ', - 'ユ' => 'ユ', - 'ヨ' => 'ヨ', - 'ラ' => 'ラ', - 'リ' => 'リ', - 'ル' => 'ル', - 'レ' => 'レ', - 'ロ' => 'ロ', - 'ワ' => 'ワ', - 'ン' => 'ン', - '゙' => '゙', - '゚' => '゚', - 'ᅠ' => 'ᅠ', - 'ᄀ' => 'ᄀ', - 'ᄁ' => 'ᄁ', - 'ᆪ' => 'ᆪ', - 'ᄂ' => 'ᄂ', - 'ᆬ' => 'ᆬ', - 'ᆭ' => 'ᆭ', - 'ᄃ' => 'ᄃ', - 'ᄄ' => 'ᄄ', - 'ᄅ' => 'ᄅ', - 'ᆰ' => 'ᆰ', - 'ᆱ' => 'ᆱ', - 'ᆲ' => 'ᆲ', - 'ᆳ' => 'ᆳ', - 'ᆴ' => 'ᆴ', - 'ᆵ' => 'ᆵ', - 'ᄚ' => 'ᄚ', - 'ᄆ' => 'ᄆ', - 'ᄇ' => 'ᄇ', - 'ᄈ' => 'ᄈ', - 'ᄡ' => 'ᄡ', - 'ᄉ' => 'ᄉ', - 'ᄊ' => 'ᄊ', - 'ᄋ' => 'ᄋ', - 'ᄌ' => 'ᄌ', - 'ᄍ' => 'ᄍ', - 'ᄎ' => 'ᄎ', - 'ᄏ' => 'ᄏ', - 'ᄐ' => 'ᄐ', - 'ᄑ' => 'ᄑ', - 'ᄒ' => 'ᄒ', - 'ᅡ' => 'ᅡ', - 'ᅢ' => 'ᅢ', - 'ᅣ' => 'ᅣ', - 'ᅤ' => 'ᅤ', - 'ᅥ' => 'ᅥ', - 'ᅦ' => 'ᅦ', - 'ᅧ' => 'ᅧ', - 'ᅨ' => 'ᅨ', - 'ᅩ' => 'ᅩ', - 'ᅪ' => 'ᅪ', - 'ᅫ' => 'ᅫ', - 'ᅬ' => 'ᅬ', - 'ᅭ' => 'ᅭ', - 'ᅮ' => 'ᅮ', - 'ᅯ' => 'ᅯ', - 'ᅰ' => 'ᅰ', - 'ᅱ' => 'ᅱ', - 'ᅲ' => 'ᅲ', - 'ᅳ' => 'ᅳ', - 'ᅴ' => 'ᅴ', - 'ᅵ' => 'ᅵ', - '¢' => '¢', - '£' => '£', - '¬' => '¬', - ' ̄' => ' ̄', - '¦' => '¦', - '¥' => '¥', - '₩' => '₩', - '│' => '│', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '■' => '■', - '○' => '○', - '𝐀' => 'A', - '𝐁' => 'B', - '𝐂' => 'C', - '𝐃' => 'D', - '𝐄' => 'E', - '𝐅' => 'F', - '𝐆' => 'G', - '𝐇' => 'H', - '𝐈' => 'I', - '𝐉' => 'J', - '𝐊' => 'K', - '𝐋' => 'L', - '𝐌' => 'M', - '𝐍' => 'N', - '𝐎' => 'O', - '𝐏' => 'P', - '𝐐' => 'Q', - '𝐑' => 'R', - '𝐒' => 'S', - '𝐓' => 'T', - '𝐔' => 'U', - '𝐕' => 'V', - '𝐖' => 'W', - '𝐗' => 'X', - '𝐘' => 'Y', - '𝐙' => 'Z', - '𝐚' => 'a', - '𝐛' => 'b', - '𝐜' => 'c', - '𝐝' => 'd', - '𝐞' => 'e', - '𝐟' => 'f', - '𝐠' => 'g', - '𝐡' => 'h', - '𝐢' => 'i', - '𝐣' => 'j', - '𝐤' => 'k', - '𝐥' => 'l', - '𝐦' => 'm', - '𝐧' => 'n', - '𝐨' => 'o', - '𝐩' => 'p', - '𝐪' => 'q', - '𝐫' => 'r', - '𝐬' => 's', - '𝐭' => 't', - '𝐮' => 'u', - '𝐯' => 'v', - '𝐰' => 'w', - '𝐱' => 'x', - '𝐲' => 'y', - '𝐳' => 'z', - '𝐴' => 'A', - '𝐵' => 'B', - '𝐶' => 'C', - '𝐷' => 'D', - '𝐸' => 'E', - '𝐹' => 'F', - '𝐺' => 'G', - '𝐻' => 'H', - '𝐼' => 'I', - '𝐽' => 'J', - '𝐾' => 'K', - '𝐿' => 'L', - '𝑀' => 'M', - '𝑁' => 'N', - '𝑂' => 'O', - '𝑃' => 'P', - '𝑄' => 'Q', - '𝑅' => 'R', - '𝑆' => 'S', - '𝑇' => 'T', - '𝑈' => 'U', - '𝑉' => 'V', - '𝑊' => 'W', - '𝑋' => 'X', - '𝑌' => 'Y', - '𝑍' => 'Z', - '𝑎' => 'a', - '𝑏' => 'b', - '𝑐' => 'c', - '𝑑' => 'd', - '𝑒' => 'e', - '𝑓' => 'f', - '𝑔' => 'g', - '𝑖' => 'i', - '𝑗' => 'j', - '𝑘' => 'k', - '𝑙' => 'l', - '𝑚' => 'm', - '𝑛' => 'n', - '𝑜' => 'o', - '𝑝' => 'p', - '𝑞' => 'q', - '𝑟' => 'r', - '𝑠' => 's', - '𝑡' => 't', - '𝑢' => 'u', - '𝑣' => 'v', - '𝑤' => 'w', - '𝑥' => 'x', - '𝑦' => 'y', - '𝑧' => 'z', - '𝑨' => 'A', - '𝑩' => 'B', - '𝑪' => 'C', - '𝑫' => 'D', - '𝑬' => 'E', - '𝑭' => 'F', - '𝑮' => 'G', - '𝑯' => 'H', - '𝑰' => 'I', - '𝑱' => 'J', - '𝑲' => 'K', - '𝑳' => 'L', - '𝑴' => 'M', - '𝑵' => 'N', - '𝑶' => 'O', - '𝑷' => 'P', - '𝑸' => 'Q', - '𝑹' => 'R', - '𝑺' => 'S', - '𝑻' => 'T', - '𝑼' => 'U', - '𝑽' => 'V', - '𝑾' => 'W', - '𝑿' => 'X', - '𝒀' => 'Y', - '𝒁' => 'Z', - '𝒂' => 'a', - '𝒃' => 'b', - '𝒄' => 'c', - '𝒅' => 'd', - '𝒆' => 'e', - '𝒇' => 'f', - '𝒈' => 'g', - '𝒉' => 'h', - '𝒊' => 'i', - '𝒋' => 'j', - '𝒌' => 'k', - '𝒍' => 'l', - '𝒎' => 'm', - '𝒏' => 'n', - '𝒐' => 'o', - '𝒑' => 'p', - '𝒒' => 'q', - '𝒓' => 'r', - '𝒔' => 's', - '𝒕' => 't', - '𝒖' => 'u', - '𝒗' => 'v', - '𝒘' => 'w', - '𝒙' => 'x', - '𝒚' => 'y', - '𝒛' => 'z', - '𝒜' => 'A', - '𝒞' => 'C', - '𝒟' => 'D', - '𝒢' => 'G', - '𝒥' => 'J', - '𝒦' => 'K', - '𝒩' => 'N', - '𝒪' => 'O', - '𝒫' => 'P', - '𝒬' => 'Q', - '𝒮' => 'S', - '𝒯' => 'T', - '𝒰' => 'U', - '𝒱' => 'V', - '𝒲' => 'W', - '𝒳' => 'X', - '𝒴' => 'Y', - '𝒵' => 'Z', - '𝒶' => 'a', - '𝒷' => 'b', - '𝒸' => 'c', - '𝒹' => 'd', - '𝒻' => 'f', - '𝒽' => 'h', - '𝒾' => 'i', - '𝒿' => 'j', - '𝓀' => 'k', - '𝓁' => 'l', - '𝓂' => 'm', - '𝓃' => 'n', - '𝓅' => 'p', - '𝓆' => 'q', - '𝓇' => 'r', - '𝓈' => 's', - '𝓉' => 't', - '𝓊' => 'u', - '𝓋' => 'v', - '𝓌' => 'w', - '𝓍' => 'x', - '𝓎' => 'y', - '𝓏' => 'z', - '𝓐' => 'A', - '𝓑' => 'B', - '𝓒' => 'C', - '𝓓' => 'D', - '𝓔' => 'E', - '𝓕' => 'F', - '𝓖' => 'G', - '𝓗' => 'H', - '𝓘' => 'I', - '𝓙' => 'J', - '𝓚' => 'K', - '𝓛' => 'L', - '𝓜' => 'M', - '𝓝' => 'N', - '𝓞' => 'O', - '𝓟' => 'P', - '𝓠' => 'Q', - '𝓡' => 'R', - '𝓢' => 'S', - '𝓣' => 'T', - '𝓤' => 'U', - '𝓥' => 'V', - '𝓦' => 'W', - '𝓧' => 'X', - '𝓨' => 'Y', - '𝓩' => 'Z', - '𝓪' => 'a', - '𝓫' => 'b', - '𝓬' => 'c', - '𝓭' => 'd', - '𝓮' => 'e', - '𝓯' => 'f', - '𝓰' => 'g', - '𝓱' => 'h', - '𝓲' => 'i', - '𝓳' => 'j', - '𝓴' => 'k', - '𝓵' => 'l', - '𝓶' => 'm', - '𝓷' => 'n', - '𝓸' => 'o', - '𝓹' => 'p', - '𝓺' => 'q', - '𝓻' => 'r', - '𝓼' => 's', - '𝓽' => 't', - '𝓾' => 'u', - '𝓿' => 'v', - '𝔀' => 'w', - '𝔁' => 'x', - '𝔂' => 'y', - '𝔃' => 'z', - '𝔄' => 'A', - '𝔅' => 'B', - '𝔇' => 'D', - '𝔈' => 'E', - '𝔉' => 'F', - '𝔊' => 'G', - '𝔍' => 'J', - '𝔎' => 'K', - '𝔏' => 'L', - '𝔐' => 'M', - '𝔑' => 'N', - '𝔒' => 'O', - '𝔓' => 'P', - '𝔔' => 'Q', - '𝔖' => 'S', - '𝔗' => 'T', - '𝔘' => 'U', - '𝔙' => 'V', - '𝔚' => 'W', - '𝔛' => 'X', - '𝔜' => 'Y', - '𝔞' => 'a', - '𝔟' => 'b', - '𝔠' => 'c', - '𝔡' => 'd', - '𝔢' => 'e', - '𝔣' => 'f', - '𝔤' => 'g', - '𝔥' => 'h', - '𝔦' => 'i', - '𝔧' => 'j', - '𝔨' => 'k', - '𝔩' => 'l', - '𝔪' => 'm', - '𝔫' => 'n', - '𝔬' => 'o', - '𝔭' => 'p', - '𝔮' => 'q', - '𝔯' => 'r', - '𝔰' => 's', - '𝔱' => 't', - '𝔲' => 'u', - '𝔳' => 'v', - '𝔴' => 'w', - '𝔵' => 'x', - '𝔶' => 'y', - '𝔷' => 'z', - '𝔸' => 'A', - '𝔹' => 'B', - '𝔻' => 'D', - '𝔼' => 'E', - '𝔽' => 'F', - '𝔾' => 'G', - '𝕀' => 'I', - '𝕁' => 'J', - '𝕂' => 'K', - '𝕃' => 'L', - '𝕄' => 'M', - '𝕆' => 'O', - '𝕊' => 'S', - '𝕋' => 'T', - '𝕌' => 'U', - '𝕍' => 'V', - '𝕎' => 'W', - '𝕏' => 'X', - '𝕐' => 'Y', - '𝕒' => 'a', - '𝕓' => 'b', - '𝕔' => 'c', - '𝕕' => 'd', - '𝕖' => 'e', - '𝕗' => 'f', - '𝕘' => 'g', - '𝕙' => 'h', - '𝕚' => 'i', - '𝕛' => 'j', - '𝕜' => 'k', - '𝕝' => 'l', - '𝕞' => 'm', - '𝕟' => 'n', - '𝕠' => 'o', - '𝕡' => 'p', - '𝕢' => 'q', - '𝕣' => 'r', - '𝕤' => 's', - '𝕥' => 't', - '𝕦' => 'u', - '𝕧' => 'v', - '𝕨' => 'w', - '𝕩' => 'x', - '𝕪' => 'y', - '𝕫' => 'z', - '𝕬' => 'A', - '𝕭' => 'B', - '𝕮' => 'C', - '𝕯' => 'D', - '𝕰' => 'E', - '𝕱' => 'F', - '𝕲' => 'G', - '𝕳' => 'H', - '𝕴' => 'I', - '𝕵' => 'J', - '𝕶' => 'K', - '𝕷' => 'L', - '𝕸' => 'M', - '𝕹' => 'N', - '𝕺' => 'O', - '𝕻' => 'P', - '𝕼' => 'Q', - '𝕽' => 'R', - '𝕾' => 'S', - '𝕿' => 'T', - '𝖀' => 'U', - '𝖁' => 'V', - '𝖂' => 'W', - '𝖃' => 'X', - '𝖄' => 'Y', - '𝖅' => 'Z', - '𝖆' => 'a', - '𝖇' => 'b', - '𝖈' => 'c', - '𝖉' => 'd', - '𝖊' => 'e', - '𝖋' => 'f', - '𝖌' => 'g', - '𝖍' => 'h', - '𝖎' => 'i', - '𝖏' => 'j', - '𝖐' => 'k', - '𝖑' => 'l', - '𝖒' => 'm', - '𝖓' => 'n', - '𝖔' => 'o', - '𝖕' => 'p', - '𝖖' => 'q', - '𝖗' => 'r', - '𝖘' => 's', - '𝖙' => 't', - '𝖚' => 'u', - '𝖛' => 'v', - '𝖜' => 'w', - '𝖝' => 'x', - '𝖞' => 'y', - '𝖟' => 'z', - '𝖠' => 'A', - '𝖡' => 'B', - '𝖢' => 'C', - '𝖣' => 'D', - '𝖤' => 'E', - '𝖥' => 'F', - '𝖦' => 'G', - '𝖧' => 'H', - '𝖨' => 'I', - '𝖩' => 'J', - '𝖪' => 'K', - '𝖫' => 'L', - '𝖬' => 'M', - '𝖭' => 'N', - '𝖮' => 'O', - '𝖯' => 'P', - '𝖰' => 'Q', - '𝖱' => 'R', - '𝖲' => 'S', - '𝖳' => 'T', - '𝖴' => 'U', - '𝖵' => 'V', - '𝖶' => 'W', - '𝖷' => 'X', - '𝖸' => 'Y', - '𝖹' => 'Z', - '𝖺' => 'a', - '𝖻' => 'b', - '𝖼' => 'c', - '𝖽' => 'd', - '𝖾' => 'e', - '𝖿' => 'f', - '𝗀' => 'g', - '𝗁' => 'h', - '𝗂' => 'i', - '𝗃' => 'j', - '𝗄' => 'k', - '𝗅' => 'l', - '𝗆' => 'm', - '𝗇' => 'n', - '𝗈' => 'o', - '𝗉' => 'p', - '𝗊' => 'q', - '𝗋' => 'r', - '𝗌' => 's', - '𝗍' => 't', - '𝗎' => 'u', - '𝗏' => 'v', - '𝗐' => 'w', - '𝗑' => 'x', - '𝗒' => 'y', - '𝗓' => 'z', - '𝗔' => 'A', - '𝗕' => 'B', - '𝗖' => 'C', - '𝗗' => 'D', - '𝗘' => 'E', - '𝗙' => 'F', - '𝗚' => 'G', - '𝗛' => 'H', - '𝗜' => 'I', - '𝗝' => 'J', - '𝗞' => 'K', - '𝗟' => 'L', - '𝗠' => 'M', - '𝗡' => 'N', - '𝗢' => 'O', - '𝗣' => 'P', - '𝗤' => 'Q', - '𝗥' => 'R', - '𝗦' => 'S', - '𝗧' => 'T', - '𝗨' => 'U', - '𝗩' => 'V', - '𝗪' => 'W', - '𝗫' => 'X', - '𝗬' => 'Y', - '𝗭' => 'Z', - '𝗮' => 'a', - '𝗯' => 'b', - '𝗰' => 'c', - '𝗱' => 'd', - '𝗲' => 'e', - '𝗳' => 'f', - '𝗴' => 'g', - '𝗵' => 'h', - '𝗶' => 'i', - '𝗷' => 'j', - '𝗸' => 'k', - '𝗹' => 'l', - '𝗺' => 'm', - '𝗻' => 'n', - '𝗼' => 'o', - '𝗽' => 'p', - '𝗾' => 'q', - '𝗿' => 'r', - '𝘀' => 's', - '𝘁' => 't', - '𝘂' => 'u', - '𝘃' => 'v', - '𝘄' => 'w', - '𝘅' => 'x', - '𝘆' => 'y', - '𝘇' => 'z', - '𝘈' => 'A', - '𝘉' => 'B', - '𝘊' => 'C', - '𝘋' => 'D', - '𝘌' => 'E', - '𝘍' => 'F', - '𝘎' => 'G', - '𝘏' => 'H', - '𝘐' => 'I', - '𝘑' => 'J', - '𝘒' => 'K', - '𝘓' => 'L', - '𝘔' => 'M', - '𝘕' => 'N', - '𝘖' => 'O', - '𝘗' => 'P', - '𝘘' => 'Q', - '𝘙' => 'R', - '𝘚' => 'S', - '𝘛' => 'T', - '𝘜' => 'U', - '𝘝' => 'V', - '𝘞' => 'W', - '𝘟' => 'X', - '𝘠' => 'Y', - '𝘡' => 'Z', - '𝘢' => 'a', - '𝘣' => 'b', - '𝘤' => 'c', - '𝘥' => 'd', - '𝘦' => 'e', - '𝘧' => 'f', - '𝘨' => 'g', - '𝘩' => 'h', - '𝘪' => 'i', - '𝘫' => 'j', - '𝘬' => 'k', - '𝘭' => 'l', - '𝘮' => 'm', - '𝘯' => 'n', - '𝘰' => 'o', - '𝘱' => 'p', - '𝘲' => 'q', - '𝘳' => 'r', - '𝘴' => 's', - '𝘵' => 't', - '𝘶' => 'u', - '𝘷' => 'v', - '𝘸' => 'w', - '𝘹' => 'x', - '𝘺' => 'y', - '𝘻' => 'z', - '𝘼' => 'A', - '𝘽' => 'B', - '𝘾' => 'C', - '𝘿' => 'D', - '𝙀' => 'E', - '𝙁' => 'F', - '𝙂' => 'G', - '𝙃' => 'H', - '𝙄' => 'I', - '𝙅' => 'J', - '𝙆' => 'K', - '𝙇' => 'L', - '𝙈' => 'M', - '𝙉' => 'N', - '𝙊' => 'O', - '𝙋' => 'P', - '𝙌' => 'Q', - '𝙍' => 'R', - '𝙎' => 'S', - '𝙏' => 'T', - '𝙐' => 'U', - '𝙑' => 'V', - '𝙒' => 'W', - '𝙓' => 'X', - '𝙔' => 'Y', - '𝙕' => 'Z', - '𝙖' => 'a', - '𝙗' => 'b', - '𝙘' => 'c', - '𝙙' => 'd', - '𝙚' => 'e', - '𝙛' => 'f', - '𝙜' => 'g', - '𝙝' => 'h', - '𝙞' => 'i', - '𝙟' => 'j', - '𝙠' => 'k', - '𝙡' => 'l', - '𝙢' => 'm', - '𝙣' => 'n', - '𝙤' => 'o', - '𝙥' => 'p', - '𝙦' => 'q', - '𝙧' => 'r', - '𝙨' => 's', - '𝙩' => 't', - '𝙪' => 'u', - '𝙫' => 'v', - '𝙬' => 'w', - '𝙭' => 'x', - '𝙮' => 'y', - '𝙯' => 'z', - '𝙰' => 'A', - '𝙱' => 'B', - '𝙲' => 'C', - '𝙳' => 'D', - '𝙴' => 'E', - '𝙵' => 'F', - '𝙶' => 'G', - '𝙷' => 'H', - '𝙸' => 'I', - '𝙹' => 'J', - '𝙺' => 'K', - '𝙻' => 'L', - '𝙼' => 'M', - '𝙽' => 'N', - '𝙾' => 'O', - '𝙿' => 'P', - '𝚀' => 'Q', - '𝚁' => 'R', - '𝚂' => 'S', - '𝚃' => 'T', - '𝚄' => 'U', - '𝚅' => 'V', - '𝚆' => 'W', - '𝚇' => 'X', - '𝚈' => 'Y', - '𝚉' => 'Z', - '𝚊' => 'a', - '𝚋' => 'b', - '𝚌' => 'c', - '𝚍' => 'd', - '𝚎' => 'e', - '𝚏' => 'f', - '𝚐' => 'g', - '𝚑' => 'h', - '𝚒' => 'i', - '𝚓' => 'j', - '𝚔' => 'k', - '𝚕' => 'l', - '𝚖' => 'm', - '𝚗' => 'n', - '𝚘' => 'o', - '𝚙' => 'p', - '𝚚' => 'q', - '𝚛' => 'r', - '𝚜' => 's', - '𝚝' => 't', - '𝚞' => 'u', - '𝚟' => 'v', - '𝚠' => 'w', - '𝚡' => 'x', - '𝚢' => 'y', - '𝚣' => 'z', - '𝚤' => 'ı', - '𝚥' => 'ȷ', - '𝚨' => 'Α', - '𝚩' => 'Β', - '𝚪' => 'Γ', - '𝚫' => 'Δ', - '𝚬' => 'Ε', - '𝚭' => 'Ζ', - '𝚮' => 'Η', - '𝚯' => 'Θ', - '𝚰' => 'Ι', - '𝚱' => 'Κ', - '𝚲' => 'Λ', - '𝚳' => 'Μ', - '𝚴' => 'Ν', - '𝚵' => 'Ξ', - '𝚶' => 'Ο', - '𝚷' => 'Π', - '𝚸' => 'Ρ', - '𝚹' => 'Θ', - '𝚺' => 'Σ', - '𝚻' => 'Τ', - '𝚼' => 'Υ', - '𝚽' => 'Φ', - '𝚾' => 'Χ', - '𝚿' => 'Ψ', - '𝛀' => 'Ω', - '𝛁' => '∇', - '𝛂' => 'α', - '𝛃' => 'β', - '𝛄' => 'γ', - '𝛅' => 'δ', - '𝛆' => 'ε', - '𝛇' => 'ζ', - '𝛈' => 'η', - '𝛉' => 'θ', - '𝛊' => 'ι', - '𝛋' => 'κ', - '𝛌' => 'λ', - '𝛍' => 'μ', - '𝛎' => 'ν', - '𝛏' => 'ξ', - '𝛐' => 'ο', - '𝛑' => 'π', - '𝛒' => 'ρ', - '𝛓' => 'ς', - '𝛔' => 'σ', - '𝛕' => 'τ', - '𝛖' => 'υ', - '𝛗' => 'φ', - '𝛘' => 'χ', - '𝛙' => 'ψ', - '𝛚' => 'ω', - '𝛛' => '∂', - '𝛜' => 'ε', - '𝛝' => 'θ', - '𝛞' => 'κ', - '𝛟' => 'φ', - '𝛠' => 'ρ', - '𝛡' => 'π', - '𝛢' => 'Α', - '𝛣' => 'Β', - '𝛤' => 'Γ', - '𝛥' => 'Δ', - '𝛦' => 'Ε', - '𝛧' => 'Ζ', - '𝛨' => 'Η', - '𝛩' => 'Θ', - '𝛪' => 'Ι', - '𝛫' => 'Κ', - '𝛬' => 'Λ', - '𝛭' => 'Μ', - '𝛮' => 'Ν', - '𝛯' => 'Ξ', - '𝛰' => 'Ο', - '𝛱' => 'Π', - '𝛲' => 'Ρ', - '𝛳' => 'Θ', - '𝛴' => 'Σ', - '𝛵' => 'Τ', - '𝛶' => 'Υ', - '𝛷' => 'Φ', - '𝛸' => 'Χ', - '𝛹' => 'Ψ', - '𝛺' => 'Ω', - '𝛻' => '∇', - '𝛼' => 'α', - '𝛽' => 'β', - '𝛾' => 'γ', - '𝛿' => 'δ', - '𝜀' => 'ε', - '𝜁' => 'ζ', - '𝜂' => 'η', - '𝜃' => 'θ', - '𝜄' => 'ι', - '𝜅' => 'κ', - '𝜆' => 'λ', - '𝜇' => 'μ', - '𝜈' => 'ν', - '𝜉' => 'ξ', - '𝜊' => 'ο', - '𝜋' => 'π', - '𝜌' => 'ρ', - '𝜍' => 'ς', - '𝜎' => 'σ', - '𝜏' => 'τ', - '𝜐' => 'υ', - '𝜑' => 'φ', - '𝜒' => 'χ', - '𝜓' => 'ψ', - '𝜔' => 'ω', - '𝜕' => '∂', - '𝜖' => 'ε', - '𝜗' => 'θ', - '𝜘' => 'κ', - '𝜙' => 'φ', - '𝜚' => 'ρ', - '𝜛' => 'π', - '𝜜' => 'Α', - '𝜝' => 'Β', - '𝜞' => 'Γ', - '𝜟' => 'Δ', - '𝜠' => 'Ε', - '𝜡' => 'Ζ', - '𝜢' => 'Η', - '𝜣' => 'Θ', - '𝜤' => 'Ι', - '𝜥' => 'Κ', - '𝜦' => 'Λ', - '𝜧' => 'Μ', - '𝜨' => 'Ν', - '𝜩' => 'Ξ', - '𝜪' => 'Ο', - '𝜫' => 'Π', - '𝜬' => 'Ρ', - '𝜭' => 'Θ', - '𝜮' => 'Σ', - '𝜯' => 'Τ', - '𝜰' => 'Υ', - '𝜱' => 'Φ', - '𝜲' => 'Χ', - '𝜳' => 'Ψ', - '𝜴' => 'Ω', - '𝜵' => '∇', - '𝜶' => 'α', - '𝜷' => 'β', - '𝜸' => 'γ', - '𝜹' => 'δ', - '𝜺' => 'ε', - '𝜻' => 'ζ', - '𝜼' => 'η', - '𝜽' => 'θ', - '𝜾' => 'ι', - '𝜿' => 'κ', - '𝝀' => 'λ', - '𝝁' => 'μ', - '𝝂' => 'ν', - '𝝃' => 'ξ', - '𝝄' => 'ο', - '𝝅' => 'π', - '𝝆' => 'ρ', - '𝝇' => 'ς', - '𝝈' => 'σ', - '𝝉' => 'τ', - '𝝊' => 'υ', - '𝝋' => 'φ', - '𝝌' => 'χ', - '𝝍' => 'ψ', - '𝝎' => 'ω', - '𝝏' => '∂', - '𝝐' => 'ε', - '𝝑' => 'θ', - '𝝒' => 'κ', - '𝝓' => 'φ', - '𝝔' => 'ρ', - '𝝕' => 'π', - '𝝖' => 'Α', - '𝝗' => 'Β', - '𝝘' => 'Γ', - '𝝙' => 'Δ', - '𝝚' => 'Ε', - '𝝛' => 'Ζ', - '𝝜' => 'Η', - '𝝝' => 'Θ', - '𝝞' => 'Ι', - '𝝟' => 'Κ', - '𝝠' => 'Λ', - '𝝡' => 'Μ', - '𝝢' => 'Ν', - '𝝣' => 'Ξ', - '𝝤' => 'Ο', - '𝝥' => 'Π', - '𝝦' => 'Ρ', - '𝝧' => 'Θ', - '𝝨' => 'Σ', - '𝝩' => 'Τ', - '𝝪' => 'Υ', - '𝝫' => 'Φ', - '𝝬' => 'Χ', - '𝝭' => 'Ψ', - '𝝮' => 'Ω', - '𝝯' => '∇', - '𝝰' => 'α', - '𝝱' => 'β', - '𝝲' => 'γ', - '𝝳' => 'δ', - '𝝴' => 'ε', - '𝝵' => 'ζ', - '𝝶' => 'η', - '𝝷' => 'θ', - '𝝸' => 'ι', - '𝝹' => 'κ', - '𝝺' => 'λ', - '𝝻' => 'μ', - '𝝼' => 'ν', - '𝝽' => 'ξ', - '𝝾' => 'ο', - '𝝿' => 'π', - '𝞀' => 'ρ', - '𝞁' => 'ς', - '𝞂' => 'σ', - '𝞃' => 'τ', - '𝞄' => 'υ', - '𝞅' => 'φ', - '𝞆' => 'χ', - '𝞇' => 'ψ', - '𝞈' => 'ω', - '𝞉' => '∂', - '𝞊' => 'ε', - '𝞋' => 'θ', - '𝞌' => 'κ', - '𝞍' => 'φ', - '𝞎' => 'ρ', - '𝞏' => 'π', - '𝞐' => 'Α', - '𝞑' => 'Β', - '𝞒' => 'Γ', - '𝞓' => 'Δ', - '𝞔' => 'Ε', - '𝞕' => 'Ζ', - '𝞖' => 'Η', - '𝞗' => 'Θ', - '𝞘' => 'Ι', - '𝞙' => 'Κ', - '𝞚' => 'Λ', - '𝞛' => 'Μ', - '𝞜' => 'Ν', - '𝞝' => 'Ξ', - '𝞞' => 'Ο', - '𝞟' => 'Π', - '𝞠' => 'Ρ', - '𝞡' => 'Θ', - '𝞢' => 'Σ', - '𝞣' => 'Τ', - '𝞤' => 'Υ', - '𝞥' => 'Φ', - '𝞦' => 'Χ', - '𝞧' => 'Ψ', - '𝞨' => 'Ω', - '𝞩' => '∇', - '𝞪' => 'α', - '𝞫' => 'β', - '𝞬' => 'γ', - '𝞭' => 'δ', - '𝞮' => 'ε', - '𝞯' => 'ζ', - '𝞰' => 'η', - '𝞱' => 'θ', - '𝞲' => 'ι', - '𝞳' => 'κ', - '𝞴' => 'λ', - '𝞵' => 'μ', - '𝞶' => 'ν', - '𝞷' => 'ξ', - '𝞸' => 'ο', - '𝞹' => 'π', - '𝞺' => 'ρ', - '𝞻' => 'ς', - '𝞼' => 'σ', - '𝞽' => 'τ', - '𝞾' => 'υ', - '𝞿' => 'φ', - '𝟀' => 'χ', - '𝟁' => 'ψ', - '𝟂' => 'ω', - '𝟃' => '∂', - '𝟄' => 'ε', - '𝟅' => 'θ', - '𝟆' => 'κ', - '𝟇' => 'φ', - '𝟈' => 'ρ', - '𝟉' => 'π', - '𝟊' => 'Ϝ', - '𝟋' => 'ϝ', - '𝟎' => '0', - '𝟏' => '1', - '𝟐' => '2', - '𝟑' => '3', - '𝟒' => '4', - '𝟓' => '5', - '𝟔' => '6', - '𝟕' => '7', - '𝟖' => '8', - '𝟗' => '9', - '𝟘' => '0', - '𝟙' => '1', - '𝟚' => '2', - '𝟛' => '3', - '𝟜' => '4', - '𝟝' => '5', - '𝟞' => '6', - '𝟟' => '7', - '𝟠' => '8', - '𝟡' => '9', - '𝟢' => '0', - '𝟣' => '1', - '𝟤' => '2', - '𝟥' => '3', - '𝟦' => '4', - '𝟧' => '5', - '𝟨' => '6', - '𝟩' => '7', - '𝟪' => '8', - '𝟫' => '9', - '𝟬' => '0', - '𝟭' => '1', - '𝟮' => '2', - '𝟯' => '3', - '𝟰' => '4', - '𝟱' => '5', - '𝟲' => '6', - '𝟳' => '7', - '𝟴' => '8', - '𝟵' => '9', - '𝟶' => '0', - '𝟷' => '1', - '𝟸' => '2', - '𝟹' => '3', - '𝟺' => '4', - '𝟻' => '5', - '𝟼' => '6', - '𝟽' => '7', - '𝟾' => '8', - '𝟿' => '9', - '𞸀' => 'ا', - '𞸁' => 'ب', - '𞸂' => 'ج', - '𞸃' => 'د', - '𞸅' => 'و', - '𞸆' => 'ز', - '𞸇' => 'ح', - '𞸈' => 'ط', - '𞸉' => 'ي', - '𞸊' => 'ك', - '𞸋' => 'ل', - '𞸌' => 'م', - '𞸍' => 'ن', - '𞸎' => 'س', - '𞸏' => 'ع', - '𞸐' => 'ف', - '𞸑' => 'ص', - '𞸒' => 'ق', - '𞸓' => 'ر', - '𞸔' => 'ش', - '𞸕' => 'ت', - '𞸖' => 'ث', - '𞸗' => 'خ', - '𞸘' => 'ذ', - '𞸙' => 'ض', - '𞸚' => 'ظ', - '𞸛' => 'غ', - '𞸜' => 'ٮ', - '𞸝' => 'ں', - '𞸞' => 'ڡ', - '𞸟' => 'ٯ', - '𞸡' => 'ب', - '𞸢' => 'ج', - '𞸤' => 'ه', - '𞸧' => 'ح', - '𞸩' => 'ي', - '𞸪' => 'ك', - '𞸫' => 'ل', - '𞸬' => 'م', - '𞸭' => 'ن', - '𞸮' => 'س', - '𞸯' => 'ع', - '𞸰' => 'ف', - '𞸱' => 'ص', - '𞸲' => 'ق', - '𞸴' => 'ش', - '𞸵' => 'ت', - '𞸶' => 'ث', - '𞸷' => 'خ', - '𞸹' => 'ض', - '𞸻' => 'غ', - '𞹂' => 'ج', - '𞹇' => 'ح', - '𞹉' => 'ي', - '𞹋' => 'ل', - '𞹍' => 'ن', - '𞹎' => 'س', - '𞹏' => 'ع', - '𞹑' => 'ص', - '𞹒' => 'ق', - '𞹔' => 'ش', - '𞹗' => 'خ', - '𞹙' => 'ض', - '𞹛' => 'غ', - '𞹝' => 'ں', - '𞹟' => 'ٯ', - '𞹡' => 'ب', - '𞹢' => 'ج', - '𞹤' => 'ه', - '𞹧' => 'ح', - '𞹨' => 'ط', - '𞹩' => 'ي', - '𞹪' => 'ك', - '𞹬' => 'م', - '𞹭' => 'ن', - '𞹮' => 'س', - '𞹯' => 'ع', - '𞹰' => 'ف', - '𞹱' => 'ص', - '𞹲' => 'ق', - '𞹴' => 'ش', - '𞹵' => 'ت', - '𞹶' => 'ث', - '𞹷' => 'خ', - '𞹹' => 'ض', - '𞹺' => 'ظ', - '𞹻' => 'غ', - '𞹼' => 'ٮ', - '𞹾' => 'ڡ', - '𞺀' => 'ا', - '𞺁' => 'ب', - '𞺂' => 'ج', - '𞺃' => 'د', - '𞺄' => 'ه', - '𞺅' => 'و', - '𞺆' => 'ز', - '𞺇' => 'ح', - '𞺈' => 'ط', - '𞺉' => 'ي', - '𞺋' => 'ل', - '𞺌' => 'م', - '𞺍' => 'ن', - '𞺎' => 'س', - '𞺏' => 'ع', - '𞺐' => 'ف', - '𞺑' => 'ص', - '𞺒' => 'ق', - '𞺓' => 'ر', - '𞺔' => 'ش', - '𞺕' => 'ت', - '𞺖' => 'ث', - '𞺗' => 'خ', - '𞺘' => 'ذ', - '𞺙' => 'ض', - '𞺚' => 'ظ', - '𞺛' => 'غ', - '𞺡' => 'ب', - '𞺢' => 'ج', - '𞺣' => 'د', - '𞺥' => 'و', - '𞺦' => 'ز', - '𞺧' => 'ح', - '𞺨' => 'ط', - '𞺩' => 'ي', - '𞺫' => 'ل', - '𞺬' => 'م', - '𞺭' => 'ن', - '𞺮' => 'س', - '𞺯' => 'ع', - '𞺰' => 'ف', - '𞺱' => 'ص', - '𞺲' => 'ق', - '𞺳' => 'ر', - '𞺴' => 'ش', - '𞺵' => 'ت', - '𞺶' => 'ث', - '𞺷' => 'خ', - '𞺸' => 'ذ', - '𞺹' => 'ض', - '𞺺' => 'ظ', - '𞺻' => 'غ', - '🄀' => '0.', - '🄁' => '0,', - '🄂' => '1,', - '🄃' => '2,', - '🄄' => '3,', - '🄅' => '4,', - '🄆' => '5,', - '🄇' => '6,', - '🄈' => '7,', - '🄉' => '8,', - '🄊' => '9,', - '🄐' => '(A)', - '🄑' => '(B)', - '🄒' => '(C)', - '🄓' => '(D)', - '🄔' => '(E)', - '🄕' => '(F)', - '🄖' => '(G)', - '🄗' => '(H)', - '🄘' => '(I)', - '🄙' => '(J)', - '🄚' => '(K)', - '🄛' => '(L)', - '🄜' => '(M)', - '🄝' => '(N)', - '🄞' => '(O)', - '🄟' => '(P)', - '🄠' => '(Q)', - '🄡' => '(R)', - '🄢' => '(S)', - '🄣' => '(T)', - '🄤' => '(U)', - '🄥' => '(V)', - '🄦' => '(W)', - '🄧' => '(X)', - '🄨' => '(Y)', - '🄩' => '(Z)', - '🄪' => '〔S〕', - '🄫' => 'C', - '🄬' => 'R', - '🄭' => 'CD', - '🄮' => 'WZ', - '🄰' => 'A', - '🄱' => 'B', - '🄲' => 'C', - '🄳' => 'D', - '🄴' => 'E', - '🄵' => 'F', - '🄶' => 'G', - '🄷' => 'H', - '🄸' => 'I', - '🄹' => 'J', - '🄺' => 'K', - '🄻' => 'L', - '🄼' => 'M', - '🄽' => 'N', - '🄾' => 'O', - '🄿' => 'P', - '🅀' => 'Q', - '🅁' => 'R', - '🅂' => 'S', - '🅃' => 'T', - '🅄' => 'U', - '🅅' => 'V', - '🅆' => 'W', - '🅇' => 'X', - '🅈' => 'Y', - '🅉' => 'Z', - '🅊' => 'HV', - '🅋' => 'MV', - '🅌' => 'SD', - '🅍' => 'SS', - '🅎' => 'PPV', - '🅏' => 'WC', - '🅪' => 'MC', - '🅫' => 'MD', - '🅬' => 'MR', - '🆐' => 'DJ', - '🈀' => 'ほか', - '🈁' => 'ココ', - '🈂' => 'サ', - '🈐' => '手', - '🈑' => '字', - '🈒' => '双', - '🈓' => 'デ', - '🈔' => '二', - '🈕' => '多', - '🈖' => '解', - '🈗' => '天', - '🈘' => '交', - '🈙' => '映', - '🈚' => '無', - '🈛' => '料', - '🈜' => '前', - '🈝' => '後', - '🈞' => '再', - '🈟' => '新', - '🈠' => '初', - '🈡' => '終', - '🈢' => '生', - '🈣' => '販', - '🈤' => '声', - '🈥' => '吹', - '🈦' => '演', - '🈧' => '投', - '🈨' => '捕', - '🈩' => '一', - '🈪' => '三', - '🈫' => '遊', - '🈬' => '左', - '🈭' => '中', - '🈮' => '右', - '🈯' => '指', - '🈰' => '走', - '🈱' => '打', - '🈲' => '禁', - '🈳' => '空', - '🈴' => '合', - '🈵' => '満', - '🈶' => '有', - '🈷' => '月', - '🈸' => '申', - '🈹' => '割', - '🈺' => '営', - '🈻' => '配', - '🉀' => '〔本〕', - '🉁' => '〔三〕', - '🉂' => '〔二〕', - '🉃' => '〔安〕', - '🉄' => '〔点〕', - '🉅' => '〔打〕', - '🉆' => '〔盗〕', - '🉇' => '〔勝〕', - '🉈' => '〔敗〕', - '🉐' => '得', - '🉑' => '可', - '🯰' => '0', - '🯱' => '1', - '🯲' => '2', - '🯳' => '3', - '🯴' => '4', - '🯵' => '5', - '🯶' => '6', - '🯷' => '7', - '🯸' => '8', - '🯹' => '9', -); diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap.php deleted file mode 100644 index 3608e5c0..00000000 --- a/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } -} diff --git a/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php deleted file mode 100644 index e36d1a94..00000000 --- a/trunk/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } -} diff --git a/trunk/vendor/symfony/polyfill-mbstring/LICENSE b/trunk/vendor/symfony/polyfill-mbstring/LICENSE deleted file mode 100644 index 6e3afce6..00000000 --- a/trunk/vendor/symfony/polyfill-mbstring/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-mbstring/Mbstring.php b/trunk/vendor/symfony/polyfill-mbstring/Mbstring.php deleted file mode 100644 index 1ad33a86..00000000 --- a/trunk/vendor/symfony/polyfill-mbstring/Mbstring.php +++ /dev/null @@ -1,996 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Mbstring; - -/** - * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. - * - * Implemented: - * - mb_chr - Returns a specific character from its Unicode code point - * - mb_convert_encoding - Convert character encoding - * - mb_convert_variables - Convert character code in variable(s) - * - mb_decode_mimeheader - Decode string in MIME header field - * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference - * - mb_convert_case - Perform case folding on a string - * - mb_detect_encoding - Detect character encoding - * - mb_get_info - Get internal settings of mbstring - * - mb_http_input - Detect HTTP input character encoding - * - mb_http_output - Set/Get HTTP output character encoding - * - mb_internal_encoding - Set/Get internal character encoding - * - mb_list_encodings - Returns an array of all supported encodings - * - mb_ord - Returns the Unicode code point of a character - * - mb_output_handler - Callback function converts character encoding in output buffer - * - mb_scrub - Replaces ill-formed byte sequences with substitute characters - * - mb_strlen - Get string length - * - mb_strpos - Find position of first occurrence of string in a string - * - mb_strrpos - Find position of last occurrence of a string in a string - * - mb_str_split - Convert a string to an array - * - mb_strtolower - Make a string lowercase - * - mb_strtoupper - Make a string uppercase - * - mb_substitute_character - Set/Get substitution character - * - mb_substr - Get part of string - * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive - * - mb_stristr - Finds first occurrence of a string within another, case insensitive - * - mb_strrchr - Finds the last occurrence of a character in a string within another - * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive - * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive - * - mb_strstr - Finds first occurrence of a string within another - * - mb_strwidth - Return width of string - * - mb_substr_count - Count the number of substring occurrences - * - mb_ucfirst - Make a string's first character uppercase - * - mb_lcfirst - Make a string's first character lowercase - * - * Not implemented: - * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_ereg_* - Regular expression with multibyte support - * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable - * - mb_preferred_mime_name - Get MIME charset string - * - mb_regex_encoding - Returns current encoding for multibyte regex as string - * - mb_regex_set_options - Set/Get the default options for mbregex functions - * - mb_send_mail - Send encoded mail - * - mb_split - Split multibyte string using regular expression - * - mb_strcut - Get part of string - * - mb_strimwidth - Get truncated string with specified width - * - * @author Nicolas Grekas - * - * @internal - */ -final class Mbstring -{ - public const MB_CASE_FOLD = \PHP_INT_MAX; - - private const SIMPLE_CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - private static $encodingList = ['ASCII', 'UTF-8']; - private static $language = 'neutral'; - private static $internalEncoding = 'UTF-8'; - - public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) - { - if (\is_array($s)) { - if (PHP_VERSION_ID < 70200) { - trigger_error('mb_convert_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); - - return null; - } - - $r = []; - foreach ($s as $str) { - $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); - } - - return $r; - } - - if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { - $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); - } else { - $fromEncoding = self::getEncoding($fromEncoding); - } - - $toEncoding = self::getEncoding($toEncoding); - - if ('BASE64' === $fromEncoding) { - $s = base64_decode($s); - $fromEncoding = $toEncoding; - } - - if ('BASE64' === $toEncoding) { - return base64_encode($s); - } - - if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { - if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { - $fromEncoding = 'Windows-1252'; - } - if ('UTF-8' !== $fromEncoding) { - $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); - } - - return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); - } - - if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); - $fromEncoding = 'UTF-8'; - } - - return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); - } - - public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) - { - $ok = true; - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; - } - }); - - return $ok ? $fromEncoding : false; - } - - public static function mb_decode_mimeheader($s) - { - return iconv_mime_decode($s, 2, self::$internalEncoding); - } - - public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) - { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); - } - - public static function mb_decode_numericentity($s, $convmap, $encoding = null) - { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return ''; // Instead of null (cf. mb_encode_numericentity). - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $cnt = floor(\count($convmap) / 4) * 4; - - for ($i = 0; $i < $cnt; $i += 4) { - // collector_decode_htmlnumericentity ignores $convmap[$i + 3] - $convmap[$i] += $convmap[$i + 2]; - $convmap[$i + 1] += $convmap[$i + 2]; - } - - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; - for ($i = 0; $i < $cnt; $i += 4) { - if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return self::mb_chr($c - $convmap[$i + 2]); - } - } - - return $m[0]; - }, $s); - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) - { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; // Instead of '' (cf. mb_decode_numericentity). - } - - if (null !== $is_hex && !\is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $cnt = floor(\count($convmap) / 4) * 4; - $i = 0; - $len = \strlen($s); - $result = ''; - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - $c = self::mb_ord($uchr); - - for ($j = 0; $j < $cnt; $j += 4) { - if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { - $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; - continue 2; - } - } - $result .= $uchr; - } - - if (null === $encoding) { - return $result; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $result); - } - - public static function mb_convert_case($s, $mode, $encoding = null) - { - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - if (\MB_CASE_TITLE == $mode) { - static $titleRegexp = null; - if (null === $titleRegexp) { - $titleRegexp = self::getData('titleCaseRegexp'); - } - $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); - } else { - if (\MB_CASE_UPPER == $mode) { - static $upper = null; - if (null === $upper) { - $upper = self::getData('upperCase'); - } - $map = $upper; - } else { - if (self::MB_CASE_FOLD === $mode) { - static $caseFolding = null; - if (null === $caseFolding) { - $caseFolding = self::getData('caseFolding'); - } - $s = strtr($s, $caseFolding); - } - - static $lower = null; - if (null === $lower) { - $lower = self::getData('lowerCase'); - } - $map = $lower; - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if (isset($map[$uchr])) { - $uchr = $map[$uchr]; - $nlen = \strlen($uchr); - - if ($nlen == $ulen) { - $nlen = $i; - do { - $s[--$nlen] = $uchr[--$ulen]; - } while ($ulen); - } else { - $s = substr_replace($s, $uchr, $i - $ulen, $ulen); - $len += $nlen - $ulen; - $i += $nlen - $ulen; - } - } - } - } - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_internal_encoding($encoding = null) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - $normalizedEncoding = self::getEncoding($encoding); - - if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { - self::$internalEncoding = $normalizedEncoding; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - public static function mb_language($lang = null) - { - if (null === $lang) { - return self::$language; - } - - switch ($normalizedLang = strtolower($lang)) { - case 'uni': - case 'neutral': - self::$language = $normalizedLang; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); - } - - public static function mb_list_encodings() - { - return ['UTF-8']; - } - - public static function mb_encoding_aliases($encoding) - { - switch (strtoupper($encoding)) { - case 'UTF8': - case 'UTF-8': - return ['utf8']; - } - - return false; - } - - public static function mb_check_encoding($var = null, $encoding = null) - { - if (\PHP_VERSION_ID < 70200 && \is_array($var)) { - trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); - - return null; - } - - if (null === $encoding) { - if (null === $var) { - return false; - } - $encoding = self::$internalEncoding; - } - - if (!\is_array($var)) { - return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); - } - - foreach ($var as $key => $value) { - if (!self::mb_check_encoding($key, $encoding)) { - return false; - } - if (!self::mb_check_encoding($value, $encoding)) { - return false; - } - } - - return true; - } - - public static function mb_detect_encoding($str, $encodingList = null, $strict = false) - { - if (null === $encodingList) { - $encodingList = self::$encodingList; - } else { - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - } - - foreach ($encodingList as $enc) { - switch ($enc) { - case 'ASCII': - if (!preg_match('/[\x80-\xFF]/', $str)) { - return $enc; - } - break; - - case 'UTF8': - case 'UTF-8': - if (preg_match('//u', $str)) { - return 'UTF-8'; - } - break; - - default: - if (0 === strncmp($enc, 'ISO-8859-', 9)) { - return $enc; - } - } - } - - return false; - } - - public static function mb_detect_order($encodingList = null) - { - if (null === $encodingList) { - return self::$encodingList; - } - - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - - foreach ($encodingList as $enc) { - switch ($enc) { - default: - if (strncmp($enc, 'ISO-8859-', 9)) { - return false; - } - // no break - case 'ASCII': - case 'UTF8': - case 'UTF-8': - } - } - - self::$encodingList = $encodingList; - - return true; - } - - public static function mb_strlen($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return \strlen($s); - } - - return @iconv_strlen($s, $encoding); - } - - public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strpos($haystack, $needle, $offset); - } - - $needle = (string) $needle; - if ('' === $needle) { - if (80000 > \PHP_VERSION_ID) { - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - - return false; - } - - return 0; - } - - return iconv_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrpos($haystack, $needle, $offset); - } - - if ($offset != (int) $offset) { - $offset = 0; - } elseif ($offset = (int) $offset) { - if ($offset < 0) { - if (0 > $offset += self::mb_strlen($needle)) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); - } - $offset = 0; - } else { - $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); - } - } - - $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? iconv_strrpos($haystack, $needle, $encoding) - : self::mb_strlen($haystack, $encoding); - - return false !== $pos ? $offset + $pos : false; - } - - public static function mb_str_split($string, $split_length = 1, $encoding = null) - { - if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); - - return null; - } - - if (1 > $split_length = (int) $split_length) { - if (80000 > \PHP_VERSION_ID) { - trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); - - return false; - } - - throw new \ValueError('Argument #2 ($length) must be greater than 0'); - } - - if (null === $encoding) { - $encoding = mb_internal_encoding(); - } - - if ('UTF-8' === $encoding = self::getEncoding($encoding)) { - $rx = '/('; - while (65535 < $split_length) { - $rx .= '.{65535}'; - $split_length -= 65535; - } - $rx .= '.{'.$split_length.'})/us'; - - return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); - } - - $result = []; - $length = mb_strlen($string, $encoding); - - for ($i = 0; $i < $length; $i += $split_length) { - $result[] = mb_substr($string, $i, $split_length, $encoding); - } - - return $result; - } - - public static function mb_strtolower($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); - } - - public static function mb_strtoupper($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); - } - - public static function mb_substitute_character($c = null) - { - if (null === $c) { - return 'none'; - } - if (0 === strcasecmp($c, 'none')) { - return true; - } - if (80000 > \PHP_VERSION_ID) { - return false; - } - if (\is_int($c) || 'long' === $c || 'entity' === $c) { - return false; - } - - throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); - } - - public static function mb_substr($s, $start, $length = null, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return (string) substr($s, $start, null === $length ? 2147483647 : $length); - } - - if ($start < 0) { - $start = iconv_strlen($s, $encoding) + $start; - if ($start < 0) { - $start = 0; - } - } - - if (null === $length) { - $length = 2147483647; - } elseif ($length < 0) { - $length = iconv_strlen($s, $encoding) + $length - $start; - if ($length < 0) { - return ''; - } - } - - return (string) iconv_substr($s, $start, $length, $encoding); - } - - public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) - { - [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ - self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), - self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), - ]); - - return self::mb_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) - { - $pos = self::mb_stripos($haystack, $needle, 0, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - $pos = strrpos($haystack, $needle); - } else { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); - } - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) - { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = self::mb_strripos($haystack, $needle, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); - $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); - - $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); - $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); - - return self::mb_strrpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) - { - $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; - } - if ($part) { - return substr($haystack, 0, $pos); - } - - return substr($haystack, $pos); - } - - public static function mb_get_info($type = 'all') - { - $info = [ - 'internal_encoding' => self::$internalEncoding, - 'http_output' => 'pass', - 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', - 'func_overload' => 0, - 'func_overload_list' => 'no overload', - 'mail_charset' => 'UTF-8', - 'mail_header_encoding' => 'BASE64', - 'mail_body_encoding' => 'BASE64', - 'illegal_chars' => 0, - 'encoding_translation' => 'Off', - 'language' => self::$language, - 'detect_order' => self::$encodingList, - 'substitute_character' => 'none', - 'strict_detection' => 'Off', - ]; - - if ('all' === $type) { - return $info; - } - if (isset($info[$type])) { - return $info[$type]; - } - - return false; - } - - public static function mb_http_input($type = '') - { - return false; - } - - public static function mb_http_output($encoding = null) - { - return null !== $encoding ? 'pass' === $encoding : 'pass'; - } - - public static function mb_strwidth($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - - if ('UTF-8' !== $encoding) { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - - return ($wide << 1) + iconv_strlen($s, 'UTF-8'); - } - - public static function mb_substr_count($haystack, $needle, $encoding = null) - { - return substr_count($haystack, $needle); - } - - public static function mb_output_handler($contents, $status) - { - return $contents; - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } - - public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string - { - if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { - throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); - } - - if (null === $encoding) { - $encoding = self::mb_internal_encoding(); - } else { - self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); - } - - if (self::mb_strlen($pad_string, $encoding) <= 0) { - throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); - } - - $paddingRequired = $length - self::mb_strlen($string, $encoding); - - if ($paddingRequired < 1) { - return $string; - } - - switch ($pad_type) { - case \STR_PAD_LEFT: - return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; - case \STR_PAD_RIGHT: - return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); - default: - $leftPaddingLength = floor($paddingRequired / 2); - $rightPaddingLength = $paddingRequired - $leftPaddingLength; - - return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); - } - } - - public static function mb_ucfirst(string $string, ?string $encoding = null): string - { - if (null === $encoding) { - $encoding = self::mb_internal_encoding(); - } else { - self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); - } - - $firstChar = mb_substr($string, 0, 1, $encoding); - $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); - - return $firstChar.mb_substr($string, 1, null, $encoding); - } - - public static function mb_lcfirst(string $string, ?string $encoding = null): string - { - if (null === $encoding) { - $encoding = self::mb_internal_encoding(); - } else { - self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); - } - - $firstChar = mb_substr($string, 0, 1, $encoding); - $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); - - return $firstChar.mb_substr($string, 1, null, $encoding); - } - - private static function getSubpart($pos, $part, $haystack, $encoding) - { - if (false === $pos) { - return false; - } - if ($part) { - return self::mb_substr($haystack, 0, $pos, $encoding); - } - - return self::mb_substr($haystack, $pos, null, $encoding); - } - - private static function html_encoding_callback(array $m) - { - $i = 1; - $entities = ''; - $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); - - while (isset($m[$i])) { - if (0x80 > $m[$i]) { - $entities .= \chr($m[$i++]); - continue; - } - if (0xF0 <= $m[$i]) { - $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } else { - $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; - } - - $entities .= '&#'.$c.';'; - } - - return $entities; - } - - private static function title_case(array $s) - { - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } - - private static function getEncoding($encoding) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - if ('UTF-8' === $encoding) { - return 'UTF-8'; - } - - $encoding = strtoupper($encoding); - - if ('8BIT' === $encoding || 'BINARY' === $encoding) { - return 'CP850'; - } - - if ('UTF8' === $encoding) { - return 'UTF-8'; - } - - return $encoding; - } - - private static function assertEncoding(string $encoding, string $errorFormat): void - { - try { - $validEncoding = @self::mb_check_encoding('', $encoding); - } catch (\ValueError $e) { - throw new \ValueError(\sprintf($errorFormat, $encoding)); - } - - // BC for PHP 7.3 and lower - if (!$validEncoding) { - throw new \ValueError(\sprintf($errorFormat, $encoding)); - } - } -} diff --git a/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php deleted file mode 100644 index 512bba0b..00000000 --- a/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +++ /dev/null @@ -1,119 +0,0 @@ - 'i̇', - 'µ' => 'μ', - 'ſ' => 's', - 'ͅ' => 'ι', - 'ς' => 'σ', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϵ' => 'ε', - 'ẛ' => 'ṡ', - 'ι' => 'ι', - 'ß' => 'ss', - 'ʼn' => 'ʼn', - 'ǰ' => 'ǰ', - 'ΐ' => 'ΐ', - 'ΰ' => 'ΰ', - 'և' => 'եւ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẚ' => 'aʾ', - 'ẞ' => 'ss', - 'ὐ' => 'ὐ', - 'ὒ' => 'ὒ', - 'ὔ' => 'ὔ', - 'ὖ' => 'ὖ', - 'ᾀ' => 'ἀι', - 'ᾁ' => 'ἁι', - 'ᾂ' => 'ἂι', - 'ᾃ' => 'ἃι', - 'ᾄ' => 'ἄι', - 'ᾅ' => 'ἅι', - 'ᾆ' => 'ἆι', - 'ᾇ' => 'ἇι', - 'ᾈ' => 'ἀι', - 'ᾉ' => 'ἁι', - 'ᾊ' => 'ἂι', - 'ᾋ' => 'ἃι', - 'ᾌ' => 'ἄι', - 'ᾍ' => 'ἅι', - 'ᾎ' => 'ἆι', - 'ᾏ' => 'ἇι', - 'ᾐ' => 'ἠι', - 'ᾑ' => 'ἡι', - 'ᾒ' => 'ἢι', - 'ᾓ' => 'ἣι', - 'ᾔ' => 'ἤι', - 'ᾕ' => 'ἥι', - 'ᾖ' => 'ἦι', - 'ᾗ' => 'ἧι', - 'ᾘ' => 'ἠι', - 'ᾙ' => 'ἡι', - 'ᾚ' => 'ἢι', - 'ᾛ' => 'ἣι', - 'ᾜ' => 'ἤι', - 'ᾝ' => 'ἥι', - 'ᾞ' => 'ἦι', - 'ᾟ' => 'ἧι', - 'ᾠ' => 'ὠι', - 'ᾡ' => 'ὡι', - 'ᾢ' => 'ὢι', - 'ᾣ' => 'ὣι', - 'ᾤ' => 'ὤι', - 'ᾥ' => 'ὥι', - 'ᾦ' => 'ὦι', - 'ᾧ' => 'ὧι', - 'ᾨ' => 'ὠι', - 'ᾩ' => 'ὡι', - 'ᾪ' => 'ὢι', - 'ᾫ' => 'ὣι', - 'ᾬ' => 'ὤι', - 'ᾭ' => 'ὥι', - 'ᾮ' => 'ὦι', - 'ᾯ' => 'ὧι', - 'ᾲ' => 'ὰι', - 'ᾳ' => 'αι', - 'ᾴ' => 'άι', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾶι', - 'ᾼ' => 'αι', - 'ῂ' => 'ὴι', - 'ῃ' => 'ηι', - 'ῄ' => 'ήι', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῆι', - 'ῌ' => 'ηι', - 'ῒ' => 'ῒ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'ῢ' => 'ῢ', - 'ῤ' => 'ῤ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'ῲ' => 'ὼι', - 'ῳ' => 'ωι', - 'ῴ' => 'ώι', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῶι', - 'ῼ' => 'ωι', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'st', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', -]; diff --git a/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php deleted file mode 100644 index fac60b08..00000000 --- a/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ /dev/null @@ -1,1397 +0,0 @@ - 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - 'À' => 'à', - 'Á' => 'á', - 'Â' => 'â', - 'Ã' => 'ã', - 'Ä' => 'ä', - 'Å' => 'å', - 'Æ' => 'æ', - 'Ç' => 'ç', - 'È' => 'è', - 'É' => 'é', - 'Ê' => 'ê', - 'Ë' => 'ë', - 'Ì' => 'ì', - 'Í' => 'í', - 'Î' => 'î', - 'Ï' => 'ï', - 'Ð' => 'ð', - 'Ñ' => 'ñ', - 'Ò' => 'ò', - 'Ó' => 'ó', - 'Ô' => 'ô', - 'Õ' => 'õ', - 'Ö' => 'ö', - 'Ø' => 'ø', - 'Ù' => 'ù', - 'Ú' => 'ú', - 'Û' => 'û', - 'Ü' => 'ü', - 'Ý' => 'ý', - 'Þ' => 'þ', - 'Ā' => 'ā', - 'Ă' => 'ă', - 'Ą' => 'ą', - 'Ć' => 'ć', - 'Ĉ' => 'ĉ', - 'Ċ' => 'ċ', - 'Č' => 'č', - 'Ď' => 'ď', - 'Đ' => 'đ', - 'Ē' => 'ē', - 'Ĕ' => 'ĕ', - 'Ė' => 'ė', - 'Ę' => 'ę', - 'Ě' => 'ě', - 'Ĝ' => 'ĝ', - 'Ğ' => 'ğ', - 'Ġ' => 'ġ', - 'Ģ' => 'ģ', - 'Ĥ' => 'ĥ', - 'Ħ' => 'ħ', - 'Ĩ' => 'ĩ', - 'Ī' => 'ī', - 'Ĭ' => 'ĭ', - 'Į' => 'į', - 'İ' => 'i̇', - 'IJ' => 'ij', - 'Ĵ' => 'ĵ', - 'Ķ' => 'ķ', - 'Ĺ' => 'ĺ', - 'Ļ' => 'ļ', - 'Ľ' => 'ľ', - 'Ŀ' => 'ŀ', - 'Ł' => 'ł', - 'Ń' => 'ń', - 'Ņ' => 'ņ', - 'Ň' => 'ň', - 'Ŋ' => 'ŋ', - 'Ō' => 'ō', - 'Ŏ' => 'ŏ', - 'Ő' => 'ő', - 'Œ' => 'œ', - 'Ŕ' => 'ŕ', - 'Ŗ' => 'ŗ', - 'Ř' => 'ř', - 'Ś' => 'ś', - 'Ŝ' => 'ŝ', - 'Ş' => 'ş', - 'Š' => 'š', - 'Ţ' => 'ţ', - 'Ť' => 'ť', - 'Ŧ' => 'ŧ', - 'Ũ' => 'ũ', - 'Ū' => 'ū', - 'Ŭ' => 'ŭ', - 'Ů' => 'ů', - 'Ű' => 'ű', - 'Ų' => 'ų', - 'Ŵ' => 'ŵ', - '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 'δ', - 'Ε' => 'ε', - 'Ζ' => 'ζ', - 'Η' => 'η', - 'Θ' => 'θ', - 'Ι' => 'ι', - 'Κ' => 'κ', - 'Λ' => 'λ', - 'Μ' => 'μ', - 'Ν' => 'ν', - 'Ξ' => 'ξ', - 'Ο' => 'ο', - 'Π' => 'π', - 'Ρ' => 'ρ', - 'Σ' => 'σ', - 'Τ' => 'τ', - 'Υ' => 'υ', - 'Φ' => 'φ', - 'Χ' => 'χ', - 'Ψ' => 'ψ', - 'Ω' => 'ω', - 'Ϊ' => 'ϊ', - 'Ϋ' => 'ϋ', - 'Ϗ' => 'ϗ', - 'Ϙ' => 'ϙ', - 'Ϛ' => 'ϛ', - 'Ϝ' => 'ϝ', - 'Ϟ' => 'ϟ', - 'Ϡ' => 'ϡ', - 'Ϣ' => 'ϣ', - 'Ϥ' => 'ϥ', - 'Ϧ' => 'ϧ', - 'Ϩ' => 'ϩ', - 'Ϫ' => 'ϫ', - 'Ϭ' => 'ϭ', - 'Ϯ' => 'ϯ', - 'ϴ' => 'θ', - 'Ϸ' => 'ϸ', - 'Ϲ' => 'ϲ', - 'Ϻ' => 'ϻ', - 'Ͻ' => 'ͻ', - 'Ͼ' => 'ͼ', - 'Ͽ' => 'ͽ', - 'Ѐ' => 'ѐ', - 'Ё' => 'ё', - 'Ђ' => 'ђ', - 'Ѓ' => 'ѓ', - 'Є' => 'є', - 'Ѕ' => 'ѕ', - 'І' => 'і', - 'Ї' => 'ї', - 'Ј' => 'ј', - 'Љ' => 'љ', - 'Њ' => 'њ', - 'Ћ' => 'ћ', - 'Ќ' => 'ќ', - 'Ѝ' => 'ѝ', - 'Ў' => 'ў', - 'Џ' => 'џ', - 'А' => 'а', - 'Б' => 'б', - 'В' => 'в', - 'Г' => 'г', - 'Д' => 'д', - 'Е' => 'е', - 'Ж' => 'ж', - 'З' => 'з', - 'И' => 'и', - 'Й' => 'й', - 'К' => 'к', - 'Л' => 'л', - 'М' => 'м', - 'Н' => 'н', - 'О' => 'о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ⴤ' => 'ⴤ', - 'Ⴥ' => 'ⴥ', - 'Ⴧ' => 'ⴧ', - 'Ⴭ' => 'ⴭ', - 'Ꭰ' => 'ꭰ', - 'Ꭱ' => 'ꭱ', - 'Ꭲ' => 'ꭲ', - 'Ꭳ' => 'ꭳ', - 'Ꭴ' => 'ꭴ', - 'Ꭵ' => 'ꭵ', - 'Ꭶ' => 'ꭶ', - 'Ꭷ' => 'ꭷ', - 'Ꭸ' => 'ꭸ', - 'Ꭹ' => 'ꭹ', - 'Ꭺ' => 'ꭺ', - 'Ꭻ' => 'ꭻ', - 'Ꭼ' => 'ꭼ', - 'Ꭽ' => 'ꭽ', - 'Ꭾ' => 'ꭾ', - 'Ꭿ' => 'ꭿ', - 'Ꮀ' => 'ꮀ', - 'Ꮁ' => 'ꮁ', - 'Ꮂ' => 'ꮂ', - 'Ꮃ' => 'ꮃ', - 'Ꮄ' => 'ꮄ', - 'Ꮅ' => 'ꮅ', - 'Ꮆ' => 'ꮆ', - 'Ꮇ' => 'ꮇ', - 'Ꮈ' => 'ꮈ', - 'Ꮉ' => 'ꮉ', - 'Ꮊ' => 'ꮊ', - 'Ꮋ' => 'ꮋ', - 'Ꮌ' => 'ꮌ', - 'Ꮍ' => 'ꮍ', - 'Ꮎ' => 'ꮎ', - 'Ꮏ' => 'ꮏ', - 'Ꮐ' => 'ꮐ', - 'Ꮑ' => 'ꮑ', - 'Ꮒ' => 'ꮒ', - 'Ꮓ' => 'ꮓ', - 'Ꮔ' => 'ꮔ', - 'Ꮕ' => 'ꮕ', - 'Ꮖ' => 'ꮖ', - 'Ꮗ' => 'ꮗ', - 'Ꮘ' => 'ꮘ', - 'Ꮙ' => 'ꮙ', - 'Ꮚ' => 'ꮚ', - 'Ꮛ' => 'ꮛ', - 'Ꮜ' => 'ꮜ', - 'Ꮝ' => 'ꮝ', - 'Ꮞ' => 'ꮞ', - 'Ꮟ' => 'ꮟ', - 'Ꮠ' => 'ꮠ', - 'Ꮡ' => 'ꮡ', - 'Ꮢ' => 'ꮢ', - 'Ꮣ' => 'ꮣ', - 'Ꮤ' => 'ꮤ', - 'Ꮥ' => 'ꮥ', - 'Ꮦ' => 'ꮦ', - 'Ꮧ' => 'ꮧ', - 'Ꮨ' => 'ꮨ', - 'Ꮩ' => 'ꮩ', - 'Ꮪ' => 'ꮪ', - 'Ꮫ' => 'ꮫ', - 'Ꮬ' => 'ꮬ', - 'Ꮭ' => 'ꮭ', - 'Ꮮ' => 'ꮮ', - 'Ꮯ' => 'ꮯ', - 'Ꮰ' => 'ꮰ', - 'Ꮱ' => 'ꮱ', - 'Ꮲ' => 'ꮲ', - 'Ꮳ' => 'ꮳ', - 'Ꮴ' => 'ꮴ', - 'Ꮵ' => 'ꮵ', - 'Ꮶ' => 'ꮶ', - 'Ꮷ' => 'ꮷ', - 'Ꮸ' => 'ꮸ', - 'Ꮹ' => 'ꮹ', - 'Ꮺ' => 'ꮺ', - 'Ꮻ' => 'ꮻ', - 'Ꮼ' => 'ꮼ', - 'Ꮽ' => 'ꮽ', - 'Ꮾ' => 'ꮾ', - 'Ꮿ' => 'ꮿ', - 'Ᏸ' => 'ᏸ', - 'Ᏹ' => 'ᏹ', - 'Ᏺ' => 'ᏺ', - 'Ᏻ' => 'ᏻ', - 'Ᏼ' => 'ᏼ', - 'Ᏽ' => 'ᏽ', - 'Ა' => 'ა', - 'Ბ' => 'ბ', - 'Გ' => 'გ', - 'Დ' => 'დ', - 'Ე' => 'ე', - 'Ვ' => 'ვ', - 'Ზ' => 'ზ', - 'Თ' => 'თ', - 'Ი' => 'ი', - 'Კ' => 'კ', - 'Ლ' => 'ლ', - 'Მ' => 'მ', - 'Ნ' => 'ნ', - 'Ო' => 'ო', - 'Პ' => 'პ', - 'Ჟ' => 'ჟ', - 'Რ' => 'რ', - 'Ს' => 'ს', - 'Ტ' => 'ტ', - 'Უ' => 'უ', - 'Ფ' => 'ფ', - 'Ქ' => 'ქ', - 'Ღ' => 'ღ', - 'Ყ' => 'ყ', - 'Შ' => 'შ', - 'Ჩ' => 'ჩ', - 'Ც' => 'ც', - 'Ძ' => 'ძ', - 'Წ' => 'წ', - 'Ჭ' => 'ჭ', - 'Ხ' => 'ხ', - 'Ჯ' => 'ჯ', - 'Ჰ' => 'ჰ', - 'Ჱ' => 'ჱ', - 'Ჲ' => 'ჲ', - 'Ჳ' => 'ჳ', - 'Ჴ' => 'ჴ', - 'Ჵ' => 'ჵ', - 'Ჶ' => 'ჶ', - 'Ჷ' => 'ჷ', - 'Ჸ' => 'ჸ', - 'Ჹ' => 'ჹ', - 'Ჺ' => 'ჺ', - 'Ჽ' => 'ჽ', - 'Ჾ' => 'ჾ', - 'Ჿ' => 'ჿ', - 'Ḁ' => 'ḁ', - 'Ḃ' => 'ḃ', - 'Ḅ' => 'ḅ', - 'Ḇ' => 'ḇ', - 'Ḉ' => 'ḉ', - 'Ḋ' => 'ḋ', - 'Ḍ' => 'ḍ', - 'Ḏ' => 'ḏ', - 'Ḑ' => 'ḑ', - 'Ḓ' => 'ḓ', - 'Ḕ' => 'ḕ', - 'Ḗ' => 'ḗ', - 'Ḙ' => 'ḙ', - 'Ḛ' => 'ḛ', - 'Ḝ' => 'ḝ', - 'Ḟ' => 'ḟ', - 'Ḡ' => 'ḡ', - 'Ḣ' => 'ḣ', - 'Ḥ' => 'ḥ', - 'Ḧ' => 'ḧ', - 'Ḩ' => 'ḩ', - 'Ḫ' => 'ḫ', - 'Ḭ' => 'ḭ', - 'Ḯ' => 'ḯ', - 'Ḱ' => 'ḱ', - 'Ḳ' => 'ḳ', - 'Ḵ' => 'ḵ', - 'Ḷ' => 'ḷ', - 'Ḹ' => 'ḹ', - 'Ḻ' => 'ḻ', - 'Ḽ' => 'ḽ', - 'Ḿ' => 'ḿ', - 'Ṁ' => 'ṁ', - 'Ṃ' => 'ṃ', - 'Ṅ' => 'ṅ', - 'Ṇ' => 'ṇ', - 'Ṉ' => 'ṉ', - 'Ṋ' => 'ṋ', - 'Ṍ' => 'ṍ', - 'Ṏ' => 'ṏ', - 'Ṑ' => 'ṑ', - 'Ṓ' => 'ṓ', - 'Ṕ' => 'ṕ', - 'Ṗ' => 'ṗ', - 'Ṙ' => 'ṙ', - 'Ṛ' => 'ṛ', - 'Ṝ' => 'ṝ', - 'Ṟ' => 'ṟ', - 'Ṡ' => 'ṡ', - 'Ṣ' => 'ṣ', - 'Ṥ' => 'ṥ', - 'Ṧ' => 'ṧ', - 'Ṩ' => 'ṩ', - 'Ṫ' => 'ṫ', - 'Ṭ' => 'ṭ', - 'Ṯ' => 'ṯ', - 'Ṱ' => 'ṱ', - 'Ṳ' => 'ṳ', - 'Ṵ' => 'ṵ', - 'Ṷ' => 'ṷ', - 'Ṹ' => 'ṹ', - 'Ṻ' => 'ṻ', - 'Ṽ' => 'ṽ', - 'Ṿ' => 'ṿ', - 'Ẁ' => 'ẁ', - 'Ẃ' => 'ẃ', - 'Ẅ' => 'ẅ', - 'Ẇ' => 'ẇ', - 'Ẉ' => 'ẉ', - 'Ẋ' => 'ẋ', - 'Ẍ' => 'ẍ', - 'Ẏ' => 'ẏ', - 'Ẑ' => 'ẑ', - 'Ẓ' => 'ẓ', - 'Ẕ' => 'ẕ', - 'ẞ' => 'ß', - 'Ạ' => 'ạ', - 'Ả' => 'ả', - 'Ấ' => 'ấ', - 'Ầ' => 'ầ', - 'Ẩ' => 'ẩ', - 'Ẫ' => 'ẫ', - 'Ậ' => 'ậ', - 'Ắ' => 'ắ', - 'Ằ' => 'ằ', - 'Ẳ' => 'ẳ', - 'Ẵ' => 'ẵ', - 'Ặ' => 'ặ', - 'Ẹ' => 'ẹ', - 'Ẻ' => 'ẻ', - 'Ẽ' => 'ẽ', - 'Ế' => 'ế', - 'Ề' => 'ề', - 'Ể' => 'ể', - 'Ễ' => 'ễ', - 'Ệ' => 'ệ', - 'Ỉ' => 'ỉ', - 'Ị' => 'ị', - 'Ọ' => 'ọ', - 'Ỏ' => 'ỏ', - 'Ố' => 'ố', - 'Ồ' => 'ồ', - 'Ổ' => 'ổ', - 'Ỗ' => 'ỗ', - 'Ộ' => 'ộ', - 'Ớ' => 'ớ', - 'Ờ' => 'ờ', - 'Ở' => 'ở', - 'Ỡ' => 'ỡ', - 'Ợ' => 'ợ', - 'Ụ' => 'ụ', - 'Ủ' => 'ủ', - 'Ứ' => 'ứ', - 'Ừ' => 'ừ', - 'Ử' => 'ử', - 'Ữ' => 'ữ', - 'Ự' => 'ự', - 'Ỳ' => 'ỳ', - 'Ỵ' => 'ỵ', - 'Ỷ' => 'ỷ', - 'Ỹ' => 'ỹ', - 'Ỻ' => 'ỻ', - 'Ỽ' => 'ỽ', - 'Ỿ' => 'ỿ', - 'Ἀ' => 'ἀ', - 'Ἁ' => 'ἁ', - 'Ἂ' => 'ἂ', - 'Ἃ' => 'ἃ', - 'Ἄ' => 'ἄ', - 'Ἅ' => 'ἅ', - 'Ἆ' => 'ἆ', - 'Ἇ' => 'ἇ', - 'Ἐ' => 'ἐ', - 'Ἑ' => 'ἑ', - 'Ἒ' => 'ἒ', - 'Ἓ' => 'ἓ', - 'Ἔ' => 'ἔ', - 'Ἕ' => 'ἕ', - 'Ἠ' => 'ἠ', - 'Ἡ' => 'ἡ', - 'Ἢ' => 'ἢ', - 'Ἣ' => 'ἣ', - 'Ἤ' => 'ἤ', - 'Ἥ' => 'ἥ', - 'Ἦ' => 'ἦ', - 'Ἧ' => 'ἧ', - 'Ἰ' => 'ἰ', - 'Ἱ' => 'ἱ', - 'Ἲ' => 'ἲ', - 'Ἳ' => 'ἳ', - 'Ἴ' => 'ἴ', - 'Ἵ' => 'ἵ', - 'Ἶ' => 'ἶ', - 'Ἷ' => 'ἷ', - 'Ὀ' => 'ὀ', - 'Ὁ' => 'ὁ', - 'Ὂ' => 'ὂ', - 'Ὃ' => 'ὃ', - 'Ὄ' => 'ὄ', - 'Ὅ' => 'ὅ', - 'Ὑ' => 'ὑ', - 'Ὓ' => 'ὓ', - 'Ὕ' => 'ὕ', - 'Ὗ' => 'ὗ', - 'Ὠ' => 'ὠ', - 'Ὡ' => 'ὡ', - 'Ὢ' => 'ὢ', - 'Ὣ' => 'ὣ', - 'Ὤ' => 'ὤ', - 'Ὥ' => 'ὥ', - 'Ὦ' => 'ὦ', - 'Ὧ' => 'ὧ', - 'ᾈ' => 'ᾀ', - 'ᾉ' => 'ᾁ', - 'ᾊ' => 'ᾂ', - 'ᾋ' => 'ᾃ', - 'ᾌ' => 'ᾄ', - 'ᾍ' => 'ᾅ', - 'ᾎ' => 'ᾆ', - 'ᾏ' => 'ᾇ', - 'ᾘ' => 'ᾐ', - 'ᾙ' => 'ᾑ', - 'ᾚ' => 'ᾒ', - 'ᾛ' => 'ᾓ', - 'ᾜ' => 'ᾔ', - 'ᾝ' => 'ᾕ', - 'ᾞ' => 'ᾖ', - 'ᾟ' => 'ᾗ', - 'ᾨ' => 'ᾠ', - 'ᾩ' => 'ᾡ', - 'ᾪ' => 'ᾢ', - 'ᾫ' => 'ᾣ', - 'ᾬ' => 'ᾤ', - 'ᾭ' => 'ᾥ', - 'ᾮ' => 'ᾦ', - 'ᾯ' => 'ᾧ', - 'Ᾰ' => 'ᾰ', - 'Ᾱ' => 'ᾱ', - 'Ὰ' => 'ὰ', - 'Ά' => 'ά', - 'ᾼ' => 'ᾳ', - 'Ὲ' => 'ὲ', - 'Έ' => 'έ', - 'Ὴ' => 'ὴ', - 'Ή' => 'ή', - 'ῌ' => 'ῃ', - 'Ῐ' => 'ῐ', - 'Ῑ' => 'ῑ', - 'Ὶ' => 'ὶ', - 'Ί' => 'ί', - 'Ῠ' => 'ῠ', - 'Ῡ' => 'ῡ', - 'Ὺ' => 'ὺ', - 'Ύ' => 'ύ', - 'Ῥ' => 'ῥ', - 'Ὸ' => 'ὸ', - 'Ό' => 'ό', - 'Ὼ' => 'ὼ', - 'Ώ' => 'ώ', - 'ῼ' => 'ῳ', - 'Ω' => 'ω', - 'K' => 'k', - 'Å' => 'å', - 'Ⅎ' => 'ⅎ', - 'Ⅰ' => 'ⅰ', - 'Ⅱ' => 'ⅱ', - 'Ⅲ' => 'ⅲ', - 'Ⅳ' => 'ⅳ', - 'Ⅴ' => 'ⅴ', - 'Ⅵ' => 'ⅵ', - 'Ⅶ' => 'ⅶ', - 'Ⅷ' => 'ⅷ', - 'Ⅸ' => 'ⅸ', - 'Ⅹ' => 'ⅹ', - 'Ⅺ' => 'ⅺ', - 'Ⅻ' => 'ⅻ', - 'Ⅼ' => 'ⅼ', - 'Ⅽ' => 'ⅽ', - 'Ⅾ' => 'ⅾ', - 'Ⅿ' => 'ⅿ', - 'Ↄ' => 'ↄ', - 'Ⓐ' => 'ⓐ', - 'Ⓑ' => 'ⓑ', - 'Ⓒ' => 'ⓒ', - 'Ⓓ' => 'ⓓ', - 'Ⓔ' => 'ⓔ', - 'Ⓕ' => 'ⓕ', - 'Ⓖ' => 'ⓖ', - 'Ⓗ' => 'ⓗ', - 'Ⓘ' => 'ⓘ', - 'Ⓙ' => 'ⓙ', - 'Ⓚ' => 'ⓚ', - 'Ⓛ' => 'ⓛ', - 'Ⓜ' => 'ⓜ', - 'Ⓝ' => 'ⓝ', - 'Ⓞ' => 'ⓞ', - 'Ⓟ' => 'ⓟ', - 'Ⓠ' => 'ⓠ', - 'Ⓡ' => 'ⓡ', - 'Ⓢ' => 'ⓢ', - 'Ⓣ' => 'ⓣ', - 'Ⓤ' => 'ⓤ', - 'Ⓥ' => 'ⓥ', - 'Ⓦ' => 'ⓦ', - 'Ⓧ' => 'ⓧ', - 'Ⓨ' => 'ⓨ', - 'Ⓩ' => 'ⓩ', - 'Ⰰ' => 'ⰰ', - 'Ⰱ' => 'ⰱ', - 'Ⰲ' => 'ⰲ', - 'Ⰳ' => 'ⰳ', - 'Ⰴ' => 'ⰴ', - 'Ⰵ' => 'ⰵ', - 'Ⰶ' => 'ⰶ', - 'Ⰷ' => 'ⰷ', - 'Ⰸ' => 'ⰸ', - 'Ⰹ' => 'ⰹ', - 'Ⰺ' => 'ⰺ', - 'Ⰻ' => 'ⰻ', - 'Ⰼ' => 'ⰼ', - 'Ⰽ' => 'ⰽ', - 'Ⰾ' => 'ⰾ', - 'Ⰿ' => 'ⰿ', - 'Ⱀ' => 'ⱀ', - 'Ⱁ' => 'ⱁ', - 'Ⱂ' => 'ⱂ', - 'Ⱃ' => 'ⱃ', - 'Ⱄ' => 'ⱄ', - 'Ⱅ' => 'ⱅ', - 'Ⱆ' => 'ⱆ', - 'Ⱇ' => 'ⱇ', - 'Ⱈ' => 'ⱈ', - 'Ⱉ' => 'ⱉ', - 'Ⱊ' => 'ⱊ', - 'Ⱋ' => 'ⱋ', - 'Ⱌ' => 'ⱌ', - 'Ⱍ' => 'ⱍ', - 'Ⱎ' => 'ⱎ', - 'Ⱏ' => 'ⱏ', - 'Ⱐ' => 'ⱐ', - 'Ⱑ' => 'ⱑ', - 'Ⱒ' => 'ⱒ', - 'Ⱓ' => 'ⱓ', - 'Ⱔ' => 'ⱔ', - 'Ⱕ' => 'ⱕ', - 'Ⱖ' => 'ⱖ', - 'Ⱗ' => 'ⱗ', - 'Ⱘ' => 'ⱘ', - 'Ⱙ' => 'ⱙ', - 'Ⱚ' => 'ⱚ', - 'Ⱛ' => 'ⱛ', - 'Ⱜ' => 'ⱜ', - 'Ⱝ' => 'ⱝ', - 'Ⱞ' => 'ⱞ', - 'Ⱡ' => 'ⱡ', - 'Ɫ' => 'ɫ', - 'Ᵽ' => 'ᵽ', - 'Ɽ' => 'ɽ', - 'Ⱨ' => 'ⱨ', - 'Ⱪ' => 'ⱪ', - 'Ⱬ' => 'ⱬ', - 'Ɑ' => 'ɑ', - 'Ɱ' => 'ɱ', - 'Ɐ' => 'ɐ', - 'Ɒ' => 'ɒ', - 'Ⱳ' => 'ⱳ', - 'Ⱶ' => 'ⱶ', - 'Ȿ' => 'ȿ', - 'Ɀ' => 'ɀ', - 'Ⲁ' => 'ⲁ', - 'Ⲃ' => 'ⲃ', - 'Ⲅ' => 'ⲅ', - 'Ⲇ' => 'ⲇ', - 'Ⲉ' => 'ⲉ', - 'Ⲋ' => 'ⲋ', - 'Ⲍ' => 'ⲍ', - 'Ⲏ' => 'ⲏ', - 'Ⲑ' => 'ⲑ', - 'Ⲓ' => 'ⲓ', - 'Ⲕ' => 'ⲕ', - 'Ⲗ' => 'ⲗ', - 'Ⲙ' => 'ⲙ', - 'Ⲛ' => 'ⲛ', - 'Ⲝ' => 'ⲝ', - 'Ⲟ' => 'ⲟ', - 'Ⲡ' => 'ⲡ', - 'Ⲣ' => 'ⲣ', - 'Ⲥ' => 'ⲥ', - 'Ⲧ' => 'ⲧ', - 'Ⲩ' => 'ⲩ', - 'Ⲫ' => 'ⲫ', - 'Ⲭ' => 'ⲭ', - 'Ⲯ' => 'ⲯ', - 'Ⲱ' => 'ⲱ', - 'Ⲳ' => 'ⲳ', - 'Ⲵ' => 'ⲵ', - 'Ⲷ' => 'ⲷ', - 'Ⲹ' => 'ⲹ', - 'Ⲻ' => 'ⲻ', - 'Ⲽ' => 'ⲽ', - 'Ⲿ' => 'ⲿ', - 'Ⳁ' => 'ⳁ', - 'Ⳃ' => 'ⳃ', - 'Ⳅ' => 'ⳅ', - 'Ⳇ' => 'ⳇ', - 'Ⳉ' => 'ⳉ', - 'Ⳋ' => 'ⳋ', - 'Ⳍ' => 'ⳍ', - 'Ⳏ' => 'ⳏ', - 'Ⳑ' => 'ⳑ', - 'Ⳓ' => 'ⳓ', - 'Ⳕ' => 'ⳕ', - 'Ⳗ' => 'ⳗ', - 'Ⳙ' => 'ⳙ', - 'Ⳛ' => 'ⳛ', - 'Ⳝ' => 'ⳝ', - 'Ⳟ' => 'ⳟ', - 'Ⳡ' => 'ⳡ', - 'Ⳣ' => 'ⳣ', - 'Ⳬ' => 'ⳬ', - 'Ⳮ' => 'ⳮ', - 'Ⳳ' => 'ⳳ', - 'Ꙁ' => 'ꙁ', - 'Ꙃ' => 'ꙃ', - 'Ꙅ' => 'ꙅ', - 'Ꙇ' => 'ꙇ', - 'Ꙉ' => 'ꙉ', - 'Ꙋ' => 'ꙋ', - 'Ꙍ' => 'ꙍ', - 'Ꙏ' => 'ꙏ', - 'Ꙑ' => 'ꙑ', - 'Ꙓ' => 'ꙓ', - 'Ꙕ' => 'ꙕ', - 'Ꙗ' => 'ꙗ', - 'Ꙙ' => 'ꙙ', - 'Ꙛ' => 'ꙛ', - 'Ꙝ' => 'ꙝ', - 'Ꙟ' => 'ꙟ', - 'Ꙡ' => 'ꙡ', - 'Ꙣ' => 'ꙣ', - 'Ꙥ' => 'ꙥ', - 'Ꙧ' => 'ꙧ', - 'Ꙩ' => 'ꙩ', - 'Ꙫ' => 'ꙫ', - 'Ꙭ' => 'ꙭ', - 'Ꚁ' => 'ꚁ', - 'Ꚃ' => 'ꚃ', - 'Ꚅ' => 'ꚅ', - 'Ꚇ' => 'ꚇ', - 'Ꚉ' => 'ꚉ', - 'Ꚋ' => 'ꚋ', - 'Ꚍ' => 'ꚍ', - 'Ꚏ' => 'ꚏ', - 'Ꚑ' => 'ꚑ', - 'Ꚓ' => 'ꚓ', - 'Ꚕ' => 'ꚕ', - 'Ꚗ' => 'ꚗ', - 'Ꚙ' => 'ꚙ', - 'Ꚛ' => 'ꚛ', - 'Ꜣ' => 'ꜣ', - 'Ꜥ' => 'ꜥ', - 'Ꜧ' => 'ꜧ', - 'Ꜩ' => 'ꜩ', - 'Ꜫ' => 'ꜫ', - 'Ꜭ' => 'ꜭ', - 'Ꜯ' => 'ꜯ', - 'Ꜳ' => 'ꜳ', - 'Ꜵ' => 'ꜵ', - 'Ꜷ' => 'ꜷ', - 'Ꜹ' => 'ꜹ', - 'Ꜻ' => 'ꜻ', - 'Ꜽ' => 'ꜽ', - 'Ꜿ' => 'ꜿ', - 'Ꝁ' => 'ꝁ', - 'Ꝃ' => 'ꝃ', - 'Ꝅ' => 'ꝅ', - 'Ꝇ' => 'ꝇ', - 'Ꝉ' => 'ꝉ', - 'Ꝋ' => 'ꝋ', - 'Ꝍ' => 'ꝍ', - 'Ꝏ' => 'ꝏ', - 'Ꝑ' => 'ꝑ', - 'Ꝓ' => 'ꝓ', - 'Ꝕ' => 'ꝕ', - 'Ꝗ' => 'ꝗ', - 'Ꝙ' => 'ꝙ', - 'Ꝛ' => 'ꝛ', - 'Ꝝ' => 'ꝝ', - 'Ꝟ' => 'ꝟ', - 'Ꝡ' => 'ꝡ', - 'Ꝣ' => 'ꝣ', - 'Ꝥ' => 'ꝥ', - 'Ꝧ' => 'ꝧ', - 'Ꝩ' => 'ꝩ', - 'Ꝫ' => 'ꝫ', - 'Ꝭ' => 'ꝭ', - 'Ꝯ' => 'ꝯ', - 'Ꝺ' => 'ꝺ', - 'Ꝼ' => 'ꝼ', - 'Ᵹ' => 'ᵹ', - 'Ꝿ' => 'ꝿ', - 'Ꞁ' => 'ꞁ', - 'Ꞃ' => 'ꞃ', - 'Ꞅ' => 'ꞅ', - 'Ꞇ' => 'ꞇ', - 'Ꞌ' => 'ꞌ', - 'Ɥ' => 'ɥ', - 'Ꞑ' => 'ꞑ', - 'Ꞓ' => 'ꞓ', - 'Ꞗ' => 'ꞗ', - 'Ꞙ' => 'ꞙ', - 'Ꞛ' => 'ꞛ', - 'Ꞝ' => 'ꞝ', - 'Ꞟ' => 'ꞟ', - 'Ꞡ' => 'ꞡ', - 'Ꞣ' => 'ꞣ', - 'Ꞥ' => 'ꞥ', - 'Ꞧ' => 'ꞧ', - 'Ꞩ' => 'ꞩ', - 'Ɦ' => 'ɦ', - 'Ɜ' => 'ɜ', - 'Ɡ' => 'ɡ', - 'Ɬ' => 'ɬ', - 'Ɪ' => 'ɪ', - 'Ʞ' => 'ʞ', - 'Ʇ' => 'ʇ', - 'Ʝ' => 'ʝ', - 'Ꭓ' => 'ꭓ', - 'Ꞵ' => 'ꞵ', - 'Ꞷ' => 'ꞷ', - 'Ꞹ' => 'ꞹ', - 'Ꞻ' => 'ꞻ', - 'Ꞽ' => 'ꞽ', - 'Ꞿ' => 'ꞿ', - 'Ꟃ' => 'ꟃ', - 'Ꞔ' => 'ꞔ', - 'Ʂ' => 'ʂ', - 'Ᶎ' => 'ᶎ', - 'Ꟈ' => 'ꟈ', - 'Ꟊ' => 'ꟊ', - 'Ꟶ' => 'ꟶ', - 'A' => 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - '𐐀' => '𐐨', - '𐐁' => '𐐩', - '𐐂' => '𐐪', - '𐐃' => '𐐫', - '𐐄' => '𐐬', - '𐐅' => '𐐭', - '𐐆' => '𐐮', - '𐐇' => '𐐯', - '𐐈' => '𐐰', - '𐐉' => '𐐱', - '𐐊' => '𐐲', - '𐐋' => '𐐳', - '𐐌' => '𐐴', - '𐐍' => '𐐵', - '𐐎' => '𐐶', - '𐐏' => '𐐷', - '𐐐' => '𐐸', - '𐐑' => '𐐹', - '𐐒' => '𐐺', - '𐐓' => '𐐻', - '𐐔' => '𐐼', - '𐐕' => '𐐽', - '𐐖' => '𐐾', - '𐐗' => '𐐿', - '𐐘' => '𐑀', - '𐐙' => '𐑁', - '𐐚' => '𐑂', - '𐐛' => '𐑃', - '𐐜' => '𐑄', - '𐐝' => '𐑅', - '𐐞' => '𐑆', - '𐐟' => '𐑇', - '𐐠' => '𐑈', - '𐐡' => '𐑉', - '𐐢' => '𐑊', - '𐐣' => '𐑋', - '𐐤' => '𐑌', - '𐐥' => '𐑍', - '𐐦' => '𐑎', - '𐐧' => '𐑏', - '𐒰' => '𐓘', - '𐒱' => '𐓙', - '𐒲' => '𐓚', - '𐒳' => '𐓛', - '𐒴' => '𐓜', - '𐒵' => '𐓝', - '𐒶' => '𐓞', - '𐒷' => '𐓟', - '𐒸' => '𐓠', - '𐒹' => '𐓡', - '𐒺' => '𐓢', - '𐒻' => '𐓣', - '𐒼' => '𐓤', - '𐒽' => '𐓥', - '𐒾' => '𐓦', - '𐒿' => '𐓧', - '𐓀' => '𐓨', - '𐓁' => '𐓩', - '𐓂' => '𐓪', - '𐓃' => '𐓫', - '𐓄' => '𐓬', - '𐓅' => '𐓭', - '𐓆' => '𐓮', - '𐓇' => '𐓯', - '𐓈' => '𐓰', - '𐓉' => '𐓱', - '𐓊' => '𐓲', - '𐓋' => '𐓳', - '𐓌' => '𐓴', - '𐓍' => '𐓵', - '𐓎' => '𐓶', - '𐓏' => '𐓷', - '𐓐' => '𐓸', - '𐓑' => '𐓹', - '𐓒' => '𐓺', - '𐓓' => '𐓻', - '𐲀' => '𐳀', - '𐲁' => '𐳁', - '𐲂' => '𐳂', - '𐲃' => '𐳃', - '𐲄' => '𐳄', - '𐲅' => '𐳅', - '𐲆' => '𐳆', - '𐲇' => '𐳇', - '𐲈' => '𐳈', - '𐲉' => '𐳉', - '𐲊' => '𐳊', - '𐲋' => '𐳋', - '𐲌' => '𐳌', - '𐲍' => '𐳍', - '𐲎' => '𐳎', - '𐲏' => '𐳏', - '𐲐' => '𐳐', - '𐲑' => '𐳑', - '𐲒' => '𐳒', - '𐲓' => '𐳓', - '𐲔' => '𐳔', - '𐲕' => '𐳕', - '𐲖' => '𐳖', - '𐲗' => '𐳗', - '𐲘' => '𐳘', - '𐲙' => '𐳙', - '𐲚' => '𐳚', - '𐲛' => '𐳛', - '𐲜' => '𐳜', - '𐲝' => '𐳝', - '𐲞' => '𐳞', - '𐲟' => '𐳟', - '𐲠' => '𐳠', - '𐲡' => '𐳡', - '𐲢' => '𐳢', - '𐲣' => '𐳣', - '𐲤' => '𐳤', - '𐲥' => '𐳥', - '𐲦' => '𐳦', - '𐲧' => '𐳧', - '𐲨' => '𐳨', - '𐲩' => '𐳩', - '𐲪' => '𐳪', - '𐲫' => '𐳫', - '𐲬' => '𐳬', - '𐲭' => '𐳭', - '𐲮' => '𐳮', - '𐲯' => '𐳯', - '𐲰' => '𐳰', - '𐲱' => '𐳱', - '𐲲' => '𐳲', - '𑢠' => '𑣀', - '𑢡' => '𑣁', - '𑢢' => '𑣂', - '𑢣' => '𑣃', - '𑢤' => '𑣄', - '𑢥' => '𑣅', - '𑢦' => '𑣆', - '𑢧' => '𑣇', - '𑢨' => '𑣈', - '𑢩' => '𑣉', - '𑢪' => '𑣊', - '𑢫' => '𑣋', - '𑢬' => '𑣌', - '𑢭' => '𑣍', - '𑢮' => '𑣎', - '𑢯' => '𑣏', - '𑢰' => '𑣐', - '𑢱' => '𑣑', - '𑢲' => '𑣒', - '𑢳' => '𑣓', - '𑢴' => '𑣔', - '𑢵' => '𑣕', - '𑢶' => '𑣖', - '𑢷' => '𑣗', - '𑢸' => '𑣘', - '𑢹' => '𑣙', - '𑢺' => '𑣚', - '𑢻' => '𑣛', - '𑢼' => '𑣜', - '𑢽' => '𑣝', - '𑢾' => '𑣞', - '𑢿' => '𑣟', - '𖹀' => '𖹠', - '𖹁' => '𖹡', - '𖹂' => '𖹢', - '𖹃' => '𖹣', - '𖹄' => '𖹤', - '𖹅' => '𖹥', - '𖹆' => '𖹦', - '𖹇' => '𖹧', - '𖹈' => '𖹨', - '𖹉' => '𖹩', - '𖹊' => '𖹪', - '𖹋' => '𖹫', - '𖹌' => '𖹬', - '𖹍' => '𖹭', - '𖹎' => '𖹮', - '𖹏' => '𖹯', - '𖹐' => '𖹰', - '𖹑' => '𖹱', - '𖹒' => '𖹲', - '𖹓' => '𖹳', - '𖹔' => '𖹴', - '𖹕' => '𖹵', - '𖹖' => '𖹶', - '𖹗' => '𖹷', - '𖹘' => '𖹸', - '𖹙' => '𖹹', - '𖹚' => '𖹺', - '𖹛' => '𖹻', - '𖹜' => '𖹼', - '𖹝' => '𖹽', - '𖹞' => '𖹾', - '𖹟' => '𖹿', - '𞤀' => '𞤢', - '𞤁' => '𞤣', - '𞤂' => '𞤤', - '𞤃' => '𞤥', - '𞤄' => '𞤦', - '𞤅' => '𞤧', - '𞤆' => '𞤨', - '𞤇' => '𞤩', - '𞤈' => '𞤪', - '𞤉' => '𞤫', - '𞤊' => '𞤬', - '𞤋' => '𞤭', - '𞤌' => '𞤮', - '𞤍' => '𞤯', - '𞤎' => '𞤰', - '𞤏' => '𞤱', - '𞤐' => '𞤲', - '𞤑' => '𞤳', - '𞤒' => '𞤴', - '𞤓' => '𞤵', - '𞤔' => '𞤶', - '𞤕' => '𞤷', - '𞤖' => '𞤸', - '𞤗' => '𞤹', - '𞤘' => '𞤺', - '𞤙' => '𞤻', - '𞤚' => '𞤼', - '𞤛' => '𞤽', - '𞤜' => '𞤾', - '𞤝' => '𞤿', - '𞤞' => '𞥀', - '𞤟' => '𞥁', - '𞤠' => '𞥂', - '𞤡' => '𞥃', -); diff --git a/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php deleted file mode 100644 index 2a8f6e73..00000000 --- a/trunk/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +++ /dev/null @@ -1,5 +0,0 @@ - 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - 'µ' => 'Μ', - 'à' => 'À', - 'á' => 'Á', - 'â' => 'Â', - 'ã' => 'Ã', - 'ä' => 'Ä', - 'å' => 'Å', - 'æ' => 'Æ', - 'ç' => 'Ç', - 'è' => 'È', - 'é' => 'É', - 'ê' => 'Ê', - 'ë' => 'Ë', - 'ì' => 'Ì', - 'í' => 'Í', - 'î' => 'Î', - 'ï' => 'Ï', - 'ð' => 'Ð', - 'ñ' => 'Ñ', - 'ò' => 'Ò', - 'ó' => 'Ó', - 'ô' => 'Ô', - 'õ' => 'Õ', - 'ö' => 'Ö', - 'ø' => 'Ø', - 'ù' => 'Ù', - 'ú' => 'Ú', - 'û' => 'Û', - 'ü' => 'Ü', - 'ý' => 'Ý', - 'þ' => 'Þ', - 'ÿ' => 'Ÿ', - 'ā' => 'Ā', - 'ă' => 'Ă', - 'ą' => 'Ą', - 'ć' => 'Ć', - 'ĉ' => 'Ĉ', - 'ċ' => 'Ċ', - 'č' => 'Č', - 'ď' => 'Ď', - 'đ' => 'Đ', - 'ē' => 'Ē', - 'ĕ' => 'Ĕ', - 'ė' => 'Ė', - 'ę' => 'Ę', - 'ě' => 'Ě', - 'ĝ' => 'Ĝ', - 'ğ' => 'Ğ', - 'ġ' => 'Ġ', - 'ģ' => 'Ģ', - 'ĥ' => 'Ĥ', - 'ħ' => 'Ħ', - 'ĩ' => 'Ĩ', - 'ī' => 'Ī', - 'ĭ' => 'Ĭ', - 'į' => 'Į', - 'ı' => 'I', - 'ij' => 'IJ', - 'ĵ' => 'Ĵ', - 'ķ' => 'Ķ', - 'ĺ' => 'Ĺ', - 'ļ' => 'Ļ', - 'ľ' => 'Ľ', - 'ŀ' => 'Ŀ', - 'ł' => 'Ł', - 'ń' => 'Ń', - 'ņ' => 'Ņ', - 'ň' => 'Ň', - 'ŋ' => 'Ŋ', - 'ō' => 'Ō', - 'ŏ' => 'Ŏ', - 'ő' => 'Ő', - 'œ' => 'Œ', - 'ŕ' => 'Ŕ', - 'ŗ' => 'Ŗ', - 'ř' => 'Ř', - 'ś' => 'Ś', - 'ŝ' => 'Ŝ', - 'ş' => 'Ş', - 'š' => 'Š', - 'ţ' => 'Ţ', - 'ť' => 'Ť', - 'ŧ' => 'Ŧ', - 'ũ' => 'Ũ', - 'ū' => 'Ū', - 'ŭ' => 'Ŭ', - 'ů' => 'Ů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', - 'ϵ' => 'Ε', - 'ϸ' => 'Ϸ', - 'ϻ' => 'Ϻ', - 'а' => 'А', - 'б' => 'Б', - 'в' => 'В', - 'г' => 'Г', - 'д' => 'Д', - 'е' => 'Е', - 'ж' => 'Ж', - 'з' => 'З', - 'и' => 'И', - 'й' => 'Й', - 'к' => 'К', - 'л' => 'Л', - 'м' => 'М', - 'н' => 'Н', - 'о' => 'О', - 'п' => 'П', - 'р' => 'Р', - 'с' => 'С', - 'т' => 'Т', - 'у' => 'У', - 'ф' => 'Ф', - 'х' => 'Х', - 'ц' => 'Ц', - 'ч' => 'Ч', - 'ш' => 'Ш', - 'щ' => 'Щ', - 'ъ' => 'Ъ', - 'ы' => 'Ы', - 'ь' => 'Ь', - 'э' => 'Э', - 'ю' => 'Ю', - 'я' => 'Я', - 'ѐ' => 'Ѐ', - 'ё' => 'Ё', - 'ђ' => 'Ђ', - 'ѓ' => 'Ѓ', - 'є' => 'Є', - 'ѕ' => 'Ѕ', - 'і' => 'І', - 'ї' => 'Ї', - 'ј' => 'Ј', - 'љ' => 'Љ', - 'њ' => 'Њ', - 'ћ' => 'Ћ', - 'ќ' => 'Ќ', - 'ѝ' => 'Ѝ', - 'ў' => 'Ў', - 'џ' => 'Џ', - 'ѡ' => 'Ѡ', - 'ѣ' => 'Ѣ', - 'ѥ' => 'Ѥ', - 'ѧ' => 'Ѧ', - 'ѩ' => 'Ѩ', - 'ѫ' => 'Ѫ', - 'ѭ' => 'Ѭ', - 'ѯ' => 'Ѯ', - 'ѱ' => 'Ѱ', - 'ѳ' => 'Ѳ', - 'ѵ' => 'Ѵ', - 'ѷ' => 'Ѷ', - 'ѹ' => 'Ѹ', - 'ѻ' => 'Ѻ', - 'ѽ' => 'Ѽ', - 'ѿ' => 'Ѿ', - 'ҁ' => 'Ҁ', - 'ҋ' => 'Ҋ', - 'ҍ' => 'Ҍ', - 'ҏ' => 'Ҏ', - 'ґ' => 'Ґ', - 'ғ' => 'Ғ', - 'ҕ' => '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', - 'ԓ' => 'Ԓ', - 'ԕ' => 'Ԕ', - 'ԗ' => 'Ԗ', - 'ԙ' => 'Ԙ', - 'ԛ' => 'Ԛ', - 'ԝ' => 'Ԝ', - 'ԟ' => 'Ԟ', - 'ԡ' => 'Ԡ', - 'ԣ' => 'Ԣ', - 'ԥ' => 'Ԥ', - 'ԧ' => 'Ԧ', - 'ԩ' => 'Ԩ', - 'ԫ' => 'Ԫ', - 'ԭ' => 'Ԭ', - 'ԯ' => 'Ԯ', - 'ա' => 'Ա', - 'բ' => 'Բ', - 'գ' => 'Գ', - 'դ' => 'Դ', - 'ե' => 'Ե', - 'զ' => 'Զ', - 'է' => 'Է', - 'ը' => 'Ը', - 'թ' => 'Թ', - 'ժ' => 'Ժ', - 'ի' => 'Ի', - 'լ' => 'Լ', - 'խ' => 'Խ', - 'ծ' => 'Ծ', - 'կ' => 'Կ', - 'հ' => 'Հ', - 'ձ' => 'Ձ', - 'ղ' => 'Ղ', - 'ճ' => 'Ճ', - 'մ' => 'Մ', - 'յ' => 'Յ', - 'ն' => 'Ն', - 'շ' => 'Շ', - 'ո' => 'Ո', - 'չ' => 'Չ', - 'պ' => 'Պ', - 'ջ' => 'Ջ', - 'ռ' => 'Ռ', - 'ս' => 'Ս', - 'վ' => 'Վ', - 'տ' => 'Տ', - 'ր' => 'Ր', - 'ց' => 'Ց', - 'ւ' => 'Ւ', - 'փ' => 'Փ', - 'ք' => 'Ք', - 'օ' => 'Օ', - 'ֆ' => 'Ֆ', - 'ა' => 'Ა', - 'ბ' => 'Ბ', - 'გ' => 'Გ', - 'დ' => 'Დ', - 'ე' => 'Ე', - 'ვ' => 'Ვ', - 'ზ' => 'Ზ', - 'თ' => 'Თ', - 'ი' => 'Ი', - 'კ' => 'Კ', - 'ლ' => 'Ლ', - 'მ' => 'Მ', - 'ნ' => 'Ნ', - 'ო' => 'Ო', - 'პ' => 'Პ', - 'ჟ' => 'Ჟ', - 'რ' => 'Რ', - 'ს' => 'Ს', - 'ტ' => 'Ტ', - 'უ' => 'Უ', - 'ფ' => 'Ფ', - 'ქ' => 'Ქ', - 'ღ' => 'Ღ', - 'ყ' => 'Ყ', - 'შ' => 'Შ', - 'ჩ' => 'Ჩ', - 'ც' => 'Ც', - 'ძ' => 'Ძ', - 'წ' => 'Წ', - 'ჭ' => 'Ჭ', - 'ხ' => 'Ხ', - 'ჯ' => 'Ჯ', - 'ჰ' => 'Ჰ', - 'ჱ' => 'Ჱ', - 'ჲ' => 'Ჲ', - 'ჳ' => 'Ჳ', - 'ჴ' => 'Ჴ', - 'ჵ' => 'Ჵ', - 'ჶ' => 'Ჶ', - 'ჷ' => 'Ჷ', - 'ჸ' => 'Ჸ', - 'ჹ' => 'Ჹ', - 'ჺ' => 'Ჺ', - 'ჽ' => 'Ჽ', - 'ჾ' => 'Ჾ', - 'ჿ' => 'Ჿ', - 'ᏸ' => 'Ᏸ', - 'ᏹ' => 'Ᏹ', - 'ᏺ' => 'Ᏺ', - 'ᏻ' => 'Ᏻ', - 'ᏼ' => 'Ᏼ', - 'ᏽ' => 'Ᏽ', - 'ᲀ' => 'В', - 'ᲁ' => 'Д', - 'ᲂ' => 'О', - 'ᲃ' => 'С', - 'ᲄ' => 'Т', - 'ᲅ' => 'Т', - 'ᲆ' => 'Ъ', - 'ᲇ' => 'Ѣ', - 'ᲈ' => 'Ꙋ', - 'ᵹ' => 'Ᵹ', - 'ᵽ' => 'Ᵽ', - 'ᶎ' => 'Ᶎ', - 'ḁ' => 'Ḁ', - 'ḃ' => 'Ḃ', - 'ḅ' => 'Ḅ', - 'ḇ' => 'Ḇ', - 'ḉ' => 'Ḉ', - 'ḋ' => 'Ḋ', - 'ḍ' => 'Ḍ', - 'ḏ' => 'Ḏ', - 'ḑ' => 'Ḑ', - 'ḓ' => 'Ḓ', - 'ḕ' => 'Ḕ', - 'ḗ' => 'Ḗ', - 'ḙ' => 'Ḙ', - 'ḛ' => 'Ḛ', - 'ḝ' => 'Ḝ', - 'ḟ' => 'Ḟ', - 'ḡ' => 'Ḡ', - 'ḣ' => 'Ḣ', - 'ḥ' => 'Ḥ', - 'ḧ' => 'Ḧ', - 'ḩ' => 'Ḩ', - 'ḫ' => 'Ḫ', - 'ḭ' => 'Ḭ', - 'ḯ' => 'Ḯ', - 'ḱ' => 'Ḱ', - 'ḳ' => 'Ḳ', - 'ḵ' => 'Ḵ', - 'ḷ' => 'Ḷ', - 'ḹ' => 'Ḹ', - 'ḻ' => 'Ḻ', - 'ḽ' => 'Ḽ', - 'ḿ' => 'Ḿ', - 'ṁ' => 'Ṁ', - 'ṃ' => 'Ṃ', - 'ṅ' => 'Ṅ', - 'ṇ' => 'Ṇ', - 'ṉ' => 'Ṉ', - 'ṋ' => 'Ṋ', - 'ṍ' => 'Ṍ', - 'ṏ' => 'Ṏ', - 'ṑ' => 'Ṑ', - 'ṓ' => 'Ṓ', - 'ṕ' => 'Ṕ', - 'ṗ' => 'Ṗ', - 'ṙ' => 'Ṙ', - 'ṛ' => 'Ṛ', - 'ṝ' => 'Ṝ', - 'ṟ' => 'Ṟ', - 'ṡ' => 'Ṡ', - 'ṣ' => 'Ṣ', - 'ṥ' => 'Ṥ', - 'ṧ' => 'Ṧ', - 'ṩ' => 'Ṩ', - 'ṫ' => 'Ṫ', - 'ṭ' => 'Ṭ', - 'ṯ' => 'Ṯ', - 'ṱ' => 'Ṱ', - 'ṳ' => 'Ṳ', - 'ṵ' => 'Ṵ', - 'ṷ' => 'Ṷ', - 'ṹ' => 'Ṹ', - 'ṻ' => 'Ṻ', - 'ṽ' => 'Ṽ', - 'ṿ' => 'Ṿ', - 'ẁ' => 'Ẁ', - 'ẃ' => 'Ẃ', - 'ẅ' => 'Ẅ', - 'ẇ' => 'Ẇ', - 'ẉ' => 'Ẉ', - 'ẋ' => 'Ẋ', - 'ẍ' => 'Ẍ', - 'ẏ' => 'Ẏ', - 'ẑ' => 'Ẑ', - 'ẓ' => 'Ẓ', - 'ẕ' => 'Ẕ', - 'ẛ' => 'Ṡ', - 'ạ' => 'Ạ', - 'ả' => 'Ả', - 'ấ' => 'Ấ', - 'ầ' => 'Ầ', - 'ẩ' => 'Ẩ', - 'ẫ' => 'Ẫ', - 'ậ' => 'Ậ', - 'ắ' => 'Ắ', - 'ằ' => 'Ằ', - 'ẳ' => 'Ẳ', - 'ẵ' => 'Ẵ', - 'ặ' => 'Ặ', - 'ẹ' => 'Ẹ', - 'ẻ' => 'Ẻ', - 'ẽ' => 'Ẽ', - 'ế' => 'Ế', - 'ề' => 'Ề', - 'ể' => 'Ể', - 'ễ' => 'Ễ', - 'ệ' => 'Ệ', - 'ỉ' => 'Ỉ', - 'ị' => 'Ị', - 'ọ' => 'Ọ', - 'ỏ' => 'Ỏ', - 'ố' => 'Ố', - 'ồ' => 'Ồ', - 'ổ' => 'Ổ', - 'ỗ' => 'Ỗ', - 'ộ' => 'Ộ', - 'ớ' => 'Ớ', - 'ờ' => 'Ờ', - 'ở' => 'Ở', - 'ỡ' => 'Ỡ', - 'ợ' => 'Ợ', - 'ụ' => 'Ụ', - 'ủ' => 'Ủ', - 'ứ' => 'Ứ', - 'ừ' => 'Ừ', - 'ử' => 'Ử', - 'ữ' => 'Ữ', - 'ự' => 'Ự', - 'ỳ' => 'Ỳ', - 'ỵ' => 'Ỵ', - 'ỷ' => 'Ỷ', - 'ỹ' => 'Ỹ', - 'ỻ' => 'Ỻ', - 'ỽ' => 'Ỽ', - 'ỿ' => 'Ỿ', - 'ἀ' => 'Ἀ', - 'ἁ' => 'Ἁ', - 'ἂ' => 'Ἂ', - 'ἃ' => 'Ἃ', - 'ἄ' => 'Ἄ', - 'ἅ' => 'Ἅ', - 'ἆ' => 'Ἆ', - 'ἇ' => 'Ἇ', - 'ἐ' => 'Ἐ', - 'ἑ' => 'Ἑ', - 'ἒ' => 'Ἒ', - 'ἓ' => 'Ἓ', - 'ἔ' => 'Ἔ', - 'ἕ' => 'Ἕ', - 'ἠ' => 'Ἠ', - 'ἡ' => 'Ἡ', - 'ἢ' => 'Ἢ', - 'ἣ' => 'Ἣ', - 'ἤ' => 'Ἤ', - 'ἥ' => 'Ἥ', - 'ἦ' => 'Ἦ', - 'ἧ' => 'Ἧ', - 'ἰ' => 'Ἰ', - 'ἱ' => 'Ἱ', - 'ἲ' => 'Ἲ', - 'ἳ' => 'Ἳ', - 'ἴ' => 'Ἴ', - 'ἵ' => 'Ἵ', - 'ἶ' => 'Ἶ', - 'ἷ' => 'Ἷ', - 'ὀ' => 'Ὀ', - 'ὁ' => 'Ὁ', - 'ὂ' => 'Ὂ', - 'ὃ' => 'Ὃ', - 'ὄ' => 'Ὄ', - 'ὅ' => 'Ὅ', - 'ὑ' => 'Ὑ', - 'ὓ' => 'Ὓ', - 'ὕ' => 'Ὕ', - 'ὗ' => 'Ὗ', - 'ὠ' => 'Ὠ', - 'ὡ' => 'Ὡ', - 'ὢ' => 'Ὢ', - 'ὣ' => 'Ὣ', - 'ὤ' => 'Ὤ', - 'ὥ' => 'Ὥ', - 'ὦ' => 'Ὦ', - 'ὧ' => 'Ὧ', - 'ὰ' => 'Ὰ', - 'ά' => 'Ά', - 'ὲ' => 'Ὲ', - 'έ' => 'Έ', - 'ὴ' => 'Ὴ', - 'ή' => 'Ή', - 'ὶ' => 'Ὶ', - 'ί' => 'Ί', - 'ὸ' => 'Ὸ', - 'ό' => 'Ό', - 'ὺ' => 'Ὺ', - 'ύ' => 'Ύ', - 'ὼ' => 'Ὼ', - 'ώ' => 'Ώ', - 'ᾀ' => 'ἈΙ', - 'ᾁ' => 'ἉΙ', - 'ᾂ' => 'ἊΙ', - 'ᾃ' => 'ἋΙ', - 'ᾄ' => 'ἌΙ', - 'ᾅ' => 'ἍΙ', - 'ᾆ' => 'ἎΙ', - 'ᾇ' => 'ἏΙ', - 'ᾐ' => 'ἨΙ', - 'ᾑ' => 'ἩΙ', - 'ᾒ' => 'ἪΙ', - 'ᾓ' => 'ἫΙ', - 'ᾔ' => 'ἬΙ', - 'ᾕ' => 'ἭΙ', - 'ᾖ' => 'ἮΙ', - 'ᾗ' => 'ἯΙ', - 'ᾠ' => 'ὨΙ', - 'ᾡ' => 'ὩΙ', - 'ᾢ' => 'ὪΙ', - 'ᾣ' => 'ὫΙ', - 'ᾤ' => 'ὬΙ', - 'ᾥ' => 'ὭΙ', - 'ᾦ' => 'ὮΙ', - 'ᾧ' => 'ὯΙ', - 'ᾰ' => 'Ᾰ', - 'ᾱ' => 'Ᾱ', - 'ᾳ' => 'ΑΙ', - 'ι' => 'Ι', - 'ῃ' => 'ΗΙ', - 'ῐ' => 'Ῐ', - 'ῑ' => 'Ῑ', - 'ῠ' => 'Ῠ', - 'ῡ' => 'Ῡ', - 'ῥ' => 'Ῥ', - 'ῳ' => 'ΩΙ', - 'ⅎ' => 'Ⅎ', - 'ⅰ' => 'Ⅰ', - 'ⅱ' => 'Ⅱ', - 'ⅲ' => 'Ⅲ', - 'ⅳ' => 'Ⅳ', - 'ⅴ' => 'Ⅴ', - 'ⅵ' => 'Ⅵ', - 'ⅶ' => 'Ⅶ', - 'ⅷ' => 'Ⅷ', - 'ⅸ' => 'Ⅸ', - 'ⅹ' => 'Ⅹ', - 'ⅺ' => 'Ⅺ', - 'ⅻ' => 'Ⅻ', - 'ⅼ' => 'Ⅼ', - 'ⅽ' => 'Ⅽ', - 'ⅾ' => 'Ⅾ', - 'ⅿ' => 'Ⅿ', - 'ↄ' => 'Ↄ', - 'ⓐ' => 'Ⓐ', - 'ⓑ' => 'Ⓑ', - 'ⓒ' => 'Ⓒ', - 'ⓓ' => 'Ⓓ', - 'ⓔ' => 'Ⓔ', - 'ⓕ' => 'Ⓕ', - 'ⓖ' => 'Ⓖ', - 'ⓗ' => 'Ⓗ', - 'ⓘ' => 'Ⓘ', - 'ⓙ' => 'Ⓙ', - 'ⓚ' => 'Ⓚ', - 'ⓛ' => 'Ⓛ', - 'ⓜ' => 'Ⓜ', - 'ⓝ' => 'Ⓝ', - 'ⓞ' => 'Ⓞ', - 'ⓟ' => 'Ⓟ', - 'ⓠ' => 'Ⓠ', - 'ⓡ' => 'Ⓡ', - 'ⓢ' => 'Ⓢ', - 'ⓣ' => 'Ⓣ', - 'ⓤ' => 'Ⓤ', - 'ⓥ' => 'Ⓥ', - 'ⓦ' => 'Ⓦ', - 'ⓧ' => 'Ⓧ', - 'ⓨ' => 'Ⓨ', - 'ⓩ' => 'Ⓩ', - 'ⰰ' => 'Ⰰ', - 'ⰱ' => 'Ⰱ', - 'ⰲ' => 'Ⰲ', - 'ⰳ' => 'Ⰳ', - 'ⰴ' => 'Ⰴ', - 'ⰵ' => 'Ⰵ', - 'ⰶ' => 'Ⰶ', - 'ⰷ' => 'Ⰷ', - 'ⰸ' => 'Ⰸ', - 'ⰹ' => 'Ⰹ', - 'ⰺ' => 'Ⰺ', - 'ⰻ' => 'Ⰻ', - 'ⰼ' => 'Ⰼ', - 'ⰽ' => 'Ⰽ', - 'ⰾ' => 'Ⰾ', - 'ⰿ' => 'Ⰿ', - 'ⱀ' => 'Ⱀ', - 'ⱁ' => 'Ⱁ', - 'ⱂ' => 'Ⱂ', - 'ⱃ' => 'Ⱃ', - 'ⱄ' => 'Ⱄ', - 'ⱅ' => 'Ⱅ', - 'ⱆ' => 'Ⱆ', - 'ⱇ' => 'Ⱇ', - 'ⱈ' => 'Ⱈ', - 'ⱉ' => 'Ⱉ', - 'ⱊ' => 'Ⱊ', - 'ⱋ' => 'Ⱋ', - 'ⱌ' => 'Ⱌ', - 'ⱍ' => 'Ⱍ', - 'ⱎ' => 'Ⱎ', - 'ⱏ' => 'Ⱏ', - 'ⱐ' => 'Ⱐ', - 'ⱑ' => 'Ⱑ', - 'ⱒ' => 'Ⱒ', - 'ⱓ' => 'Ⱓ', - 'ⱔ' => 'Ⱔ', - 'ⱕ' => 'Ⱕ', - 'ⱖ' => 'Ⱖ', - 'ⱗ' => 'Ⱗ', - 'ⱘ' => 'Ⱘ', - 'ⱙ' => 'Ⱙ', - 'ⱚ' => 'Ⱚ', - 'ⱛ' => 'Ⱛ', - 'ⱜ' => 'Ⱜ', - 'ⱝ' => 'Ⱝ', - 'ⱞ' => 'Ⱞ', - 'ⱡ' => 'Ⱡ', - 'ⱥ' => 'Ⱥ', - 'ⱦ' => 'Ⱦ', - 'ⱨ' => 'Ⱨ', - 'ⱪ' => 'Ⱪ', - 'ⱬ' => 'Ⱬ', - 'ⱳ' => 'Ⱳ', - 'ⱶ' => 'Ⱶ', - 'ⲁ' => 'Ⲁ', - 'ⲃ' => 'Ⲃ', - 'ⲅ' => 'Ⲅ', - 'ⲇ' => 'Ⲇ', - 'ⲉ' => 'Ⲉ', - 'ⲋ' => 'Ⲋ', - 'ⲍ' => 'Ⲍ', - 'ⲏ' => 'Ⲏ', - 'ⲑ' => 'Ⲑ', - 'ⲓ' => 'Ⲓ', - 'ⲕ' => 'Ⲕ', - 'ⲗ' => 'Ⲗ', - 'ⲙ' => 'Ⲙ', - 'ⲛ' => 'Ⲛ', - 'ⲝ' => 'Ⲝ', - 'ⲟ' => 'Ⲟ', - 'ⲡ' => 'Ⲡ', - 'ⲣ' => 'Ⲣ', - 'ⲥ' => 'Ⲥ', - 'ⲧ' => 'Ⲧ', - 'ⲩ' => 'Ⲩ', - 'ⲫ' => 'Ⲫ', - 'ⲭ' => 'Ⲭ', - 'ⲯ' => 'Ⲯ', - 'ⲱ' => 'Ⲱ', - 'ⲳ' => 'Ⲳ', - 'ⲵ' => 'Ⲵ', - 'ⲷ' => 'Ⲷ', - 'ⲹ' => 'Ⲹ', - 'ⲻ' => 'Ⲻ', - 'ⲽ' => 'Ⲽ', - 'ⲿ' => 'Ⲿ', - 'ⳁ' => 'Ⳁ', - 'ⳃ' => 'Ⳃ', - 'ⳅ' => 'Ⳅ', - 'ⳇ' => 'Ⳇ', - 'ⳉ' => 'Ⳉ', - 'ⳋ' => 'Ⳋ', - 'ⳍ' => 'Ⳍ', - 'ⳏ' => 'Ⳏ', - 'ⳑ' => 'Ⳑ', - 'ⳓ' => 'Ⳓ', - 'ⳕ' => 'Ⳕ', - 'ⳗ' => 'Ⳗ', - 'ⳙ' => 'Ⳙ', - 'ⳛ' => 'Ⳛ', - 'ⳝ' => 'Ⳝ', - 'ⳟ' => 'Ⳟ', - 'ⳡ' => 'Ⳡ', - 'ⳣ' => 'Ⳣ', - 'ⳬ' => 'Ⳬ', - 'ⳮ' => 'Ⳮ', - 'ⳳ' => 'Ⳳ', - 'ⴀ' => 'Ⴀ', - 'ⴁ' => 'Ⴁ', - 'ⴂ' => 'Ⴂ', - 'ⴃ' => 'Ⴃ', - 'ⴄ' => 'Ⴄ', - 'ⴅ' => 'Ⴅ', - 'ⴆ' => 'Ⴆ', - 'ⴇ' => 'Ⴇ', - 'ⴈ' => 'Ⴈ', - 'ⴉ' => 'Ⴉ', - 'ⴊ' => 'Ⴊ', - 'ⴋ' => 'Ⴋ', - 'ⴌ' => 'Ⴌ', - 'ⴍ' => 'Ⴍ', - 'ⴎ' => 'Ⴎ', - 'ⴏ' => 'Ⴏ', - 'ⴐ' => 'Ⴐ', - 'ⴑ' => 'Ⴑ', - 'ⴒ' => 'Ⴒ', - 'ⴓ' => 'Ⴓ', - 'ⴔ' => 'Ⴔ', - 'ⴕ' => 'Ⴕ', - 'ⴖ' => 'Ⴖ', - 'ⴗ' => 'Ⴗ', - 'ⴘ' => 'Ⴘ', - 'ⴙ' => 'Ⴙ', - 'ⴚ' => 'Ⴚ', - 'ⴛ' => 'Ⴛ', - 'ⴜ' => 'Ⴜ', - 'ⴝ' => 'Ⴝ', - 'ⴞ' => 'Ⴞ', - 'ⴟ' => 'Ⴟ', - 'ⴠ' => 'Ⴠ', - 'ⴡ' => 'Ⴡ', - 'ⴢ' => 'Ⴢ', - 'ⴣ' => 'Ⴣ', - 'ⴤ' => 'Ⴤ', - 'ⴥ' => 'Ⴥ', - 'ⴧ' => 'Ⴧ', - 'ⴭ' => 'Ⴭ', - 'ꙁ' => 'Ꙁ', - 'ꙃ' => 'Ꙃ', - 'ꙅ' => 'Ꙅ', - 'ꙇ' => 'Ꙇ', - 'ꙉ' => 'Ꙉ', - 'ꙋ' => 'Ꙋ', - 'ꙍ' => 'Ꙍ', - 'ꙏ' => 'Ꙏ', - 'ꙑ' => 'Ꙑ', - 'ꙓ' => 'Ꙓ', - 'ꙕ' => 'Ꙕ', - 'ꙗ' => 'Ꙗ', - 'ꙙ' => 'Ꙙ', - 'ꙛ' => 'Ꙛ', - 'ꙝ' => 'Ꙝ', - 'ꙟ' => 'Ꙟ', - 'ꙡ' => 'Ꙡ', - 'ꙣ' => 'Ꙣ', - 'ꙥ' => 'Ꙥ', - 'ꙧ' => 'Ꙧ', - 'ꙩ' => 'Ꙩ', - 'ꙫ' => 'Ꙫ', - 'ꙭ' => 'Ꙭ', - 'ꚁ' => 'Ꚁ', - 'ꚃ' => 'Ꚃ', - 'ꚅ' => 'Ꚅ', - 'ꚇ' => 'Ꚇ', - 'ꚉ' => 'Ꚉ', - 'ꚋ' => 'Ꚋ', - 'ꚍ' => 'Ꚍ', - 'ꚏ' => 'Ꚏ', - 'ꚑ' => 'Ꚑ', - 'ꚓ' => 'Ꚓ', - 'ꚕ' => 'Ꚕ', - 'ꚗ' => 'Ꚗ', - 'ꚙ' => 'Ꚙ', - 'ꚛ' => 'Ꚛ', - 'ꜣ' => 'Ꜣ', - 'ꜥ' => 'Ꜥ', - 'ꜧ' => 'Ꜧ', - 'ꜩ' => 'Ꜩ', - 'ꜫ' => 'Ꜫ', - 'ꜭ' => 'Ꜭ', - 'ꜯ' => 'Ꜯ', - 'ꜳ' => 'Ꜳ', - 'ꜵ' => 'Ꜵ', - 'ꜷ' => 'Ꜷ', - 'ꜹ' => 'Ꜹ', - 'ꜻ' => 'Ꜻ', - 'ꜽ' => 'Ꜽ', - 'ꜿ' => 'Ꜿ', - 'ꝁ' => 'Ꝁ', - 'ꝃ' => 'Ꝃ', - 'ꝅ' => 'Ꝅ', - 'ꝇ' => 'Ꝇ', - 'ꝉ' => 'Ꝉ', - 'ꝋ' => 'Ꝋ', - 'ꝍ' => 'Ꝍ', - 'ꝏ' => 'Ꝏ', - 'ꝑ' => 'Ꝑ', - 'ꝓ' => 'Ꝓ', - 'ꝕ' => 'Ꝕ', - 'ꝗ' => 'Ꝗ', - 'ꝙ' => 'Ꝙ', - 'ꝛ' => 'Ꝛ', - 'ꝝ' => 'Ꝝ', - 'ꝟ' => 'Ꝟ', - 'ꝡ' => 'Ꝡ', - 'ꝣ' => 'Ꝣ', - 'ꝥ' => 'Ꝥ', - 'ꝧ' => 'Ꝧ', - 'ꝩ' => 'Ꝩ', - 'ꝫ' => 'Ꝫ', - 'ꝭ' => 'Ꝭ', - 'ꝯ' => 'Ꝯ', - 'ꝺ' => 'Ꝺ', - 'ꝼ' => 'Ꝼ', - 'ꝿ' => 'Ꝿ', - 'ꞁ' => 'Ꞁ', - 'ꞃ' => 'Ꞃ', - 'ꞅ' => 'Ꞅ', - 'ꞇ' => 'Ꞇ', - 'ꞌ' => 'Ꞌ', - 'ꞑ' => 'Ꞑ', - 'ꞓ' => 'Ꞓ', - 'ꞔ' => 'Ꞔ', - 'ꞗ' => 'Ꞗ', - 'ꞙ' => 'Ꞙ', - 'ꞛ' => 'Ꞛ', - 'ꞝ' => 'Ꞝ', - 'ꞟ' => 'Ꞟ', - 'ꞡ' => 'Ꞡ', - 'ꞣ' => 'Ꞣ', - 'ꞥ' => 'Ꞥ', - 'ꞧ' => 'Ꞧ', - 'ꞩ' => 'Ꞩ', - 'ꞵ' => 'Ꞵ', - 'ꞷ' => 'Ꞷ', - 'ꞹ' => 'Ꞹ', - 'ꞻ' => 'Ꞻ', - 'ꞽ' => 'Ꞽ', - 'ꞿ' => 'Ꞿ', - 'ꟃ' => 'Ꟃ', - 'ꟈ' => 'Ꟈ', - 'ꟊ' => 'Ꟊ', - 'ꟶ' => 'Ꟶ', - 'ꭓ' => 'Ꭓ', - 'ꭰ' => 'Ꭰ', - 'ꭱ' => 'Ꭱ', - 'ꭲ' => 'Ꭲ', - 'ꭳ' => 'Ꭳ', - 'ꭴ' => 'Ꭴ', - 'ꭵ' => 'Ꭵ', - 'ꭶ' => 'Ꭶ', - 'ꭷ' => 'Ꭷ', - 'ꭸ' => 'Ꭸ', - 'ꭹ' => 'Ꭹ', - 'ꭺ' => 'Ꭺ', - 'ꭻ' => 'Ꭻ', - 'ꭼ' => 'Ꭼ', - 'ꭽ' => 'Ꭽ', - 'ꭾ' => 'Ꭾ', - 'ꭿ' => 'Ꭿ', - 'ꮀ' => 'Ꮀ', - 'ꮁ' => 'Ꮁ', - 'ꮂ' => 'Ꮂ', - 'ꮃ' => 'Ꮃ', - 'ꮄ' => 'Ꮄ', - 'ꮅ' => 'Ꮅ', - 'ꮆ' => 'Ꮆ', - 'ꮇ' => 'Ꮇ', - 'ꮈ' => 'Ꮈ', - 'ꮉ' => 'Ꮉ', - 'ꮊ' => 'Ꮊ', - 'ꮋ' => 'Ꮋ', - 'ꮌ' => 'Ꮌ', - 'ꮍ' => 'Ꮍ', - 'ꮎ' => 'Ꮎ', - 'ꮏ' => 'Ꮏ', - 'ꮐ' => 'Ꮐ', - 'ꮑ' => 'Ꮑ', - 'ꮒ' => 'Ꮒ', - 'ꮓ' => 'Ꮓ', - 'ꮔ' => 'Ꮔ', - 'ꮕ' => 'Ꮕ', - 'ꮖ' => 'Ꮖ', - 'ꮗ' => 'Ꮗ', - 'ꮘ' => 'Ꮘ', - 'ꮙ' => 'Ꮙ', - 'ꮚ' => 'Ꮚ', - 'ꮛ' => 'Ꮛ', - 'ꮜ' => 'Ꮜ', - 'ꮝ' => 'Ꮝ', - 'ꮞ' => 'Ꮞ', - 'ꮟ' => 'Ꮟ', - 'ꮠ' => 'Ꮠ', - 'ꮡ' => 'Ꮡ', - 'ꮢ' => 'Ꮢ', - 'ꮣ' => 'Ꮣ', - 'ꮤ' => 'Ꮤ', - 'ꮥ' => 'Ꮥ', - 'ꮦ' => 'Ꮦ', - 'ꮧ' => 'Ꮧ', - 'ꮨ' => 'Ꮨ', - 'ꮩ' => 'Ꮩ', - 'ꮪ' => 'Ꮪ', - 'ꮫ' => 'Ꮫ', - 'ꮬ' => 'Ꮬ', - 'ꮭ' => 'Ꮭ', - 'ꮮ' => 'Ꮮ', - 'ꮯ' => 'Ꮯ', - 'ꮰ' => 'Ꮰ', - 'ꮱ' => 'Ꮱ', - 'ꮲ' => 'Ꮲ', - 'ꮳ' => 'Ꮳ', - 'ꮴ' => 'Ꮴ', - 'ꮵ' => 'Ꮵ', - 'ꮶ' => 'Ꮶ', - 'ꮷ' => 'Ꮷ', - 'ꮸ' => 'Ꮸ', - 'ꮹ' => 'Ꮹ', - 'ꮺ' => 'Ꮺ', - 'ꮻ' => 'Ꮻ', - 'ꮼ' => 'Ꮼ', - 'ꮽ' => 'Ꮽ', - 'ꮾ' => 'Ꮾ', - 'ꮿ' => 'Ꮿ', - 'a' => 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - '𐐨' => '𐐀', - '𐐩' => '𐐁', - '𐐪' => '𐐂', - '𐐫' => '𐐃', - '𐐬' => '𐐄', - '𐐭' => '𐐅', - '𐐮' => '𐐆', - '𐐯' => '𐐇', - '𐐰' => '𐐈', - '𐐱' => '𐐉', - '𐐲' => '𐐊', - '𐐳' => '𐐋', - '𐐴' => '𐐌', - '𐐵' => '𐐍', - '𐐶' => '𐐎', - '𐐷' => '𐐏', - '𐐸' => '𐐐', - '𐐹' => '𐐑', - '𐐺' => '𐐒', - '𐐻' => '𐐓', - '𐐼' => '𐐔', - '𐐽' => '𐐕', - '𐐾' => '𐐖', - '𐐿' => '𐐗', - '𐑀' => '𐐘', - '𐑁' => '𐐙', - '𐑂' => '𐐚', - '𐑃' => '𐐛', - '𐑄' => '𐐜', - '𐑅' => '𐐝', - '𐑆' => '𐐞', - '𐑇' => '𐐟', - '𐑈' => '𐐠', - '𐑉' => '𐐡', - '𐑊' => '𐐢', - '𐑋' => '𐐣', - '𐑌' => '𐐤', - '𐑍' => '𐐥', - '𐑎' => '𐐦', - '𐑏' => '𐐧', - '𐓘' => '𐒰', - '𐓙' => '𐒱', - '𐓚' => '𐒲', - '𐓛' => '𐒳', - '𐓜' => '𐒴', - '𐓝' => '𐒵', - '𐓞' => '𐒶', - '𐓟' => '𐒷', - '𐓠' => '𐒸', - '𐓡' => '𐒹', - '𐓢' => '𐒺', - '𐓣' => '𐒻', - '𐓤' => '𐒼', - '𐓥' => '𐒽', - '𐓦' => '𐒾', - '𐓧' => '𐒿', - '𐓨' => '𐓀', - '𐓩' => '𐓁', - '𐓪' => '𐓂', - '𐓫' => '𐓃', - '𐓬' => '𐓄', - '𐓭' => '𐓅', - '𐓮' => '𐓆', - '𐓯' => '𐓇', - '𐓰' => '𐓈', - '𐓱' => '𐓉', - '𐓲' => '𐓊', - '𐓳' => '𐓋', - '𐓴' => '𐓌', - '𐓵' => '𐓍', - '𐓶' => '𐓎', - '𐓷' => '𐓏', - '𐓸' => '𐓐', - '𐓹' => '𐓑', - '𐓺' => '𐓒', - '𐓻' => '𐓓', - '𐳀' => '𐲀', - '𐳁' => '𐲁', - '𐳂' => '𐲂', - '𐳃' => '𐲃', - '𐳄' => '𐲄', - '𐳅' => '𐲅', - '𐳆' => '𐲆', - '𐳇' => '𐲇', - '𐳈' => '𐲈', - '𐳉' => '𐲉', - '𐳊' => '𐲊', - '𐳋' => '𐲋', - '𐳌' => '𐲌', - '𐳍' => '𐲍', - '𐳎' => '𐲎', - '𐳏' => '𐲏', - '𐳐' => '𐲐', - '𐳑' => '𐲑', - '𐳒' => '𐲒', - '𐳓' => '𐲓', - '𐳔' => '𐲔', - '𐳕' => '𐲕', - '𐳖' => '𐲖', - '𐳗' => '𐲗', - '𐳘' => '𐲘', - '𐳙' => '𐲙', - '𐳚' => '𐲚', - '𐳛' => '𐲛', - '𐳜' => '𐲜', - '𐳝' => '𐲝', - '𐳞' => '𐲞', - '𐳟' => '𐲟', - '𐳠' => '𐲠', - '𐳡' => '𐲡', - '𐳢' => '𐲢', - '𐳣' => '𐲣', - '𐳤' => '𐲤', - '𐳥' => '𐲥', - '𐳦' => '𐲦', - '𐳧' => '𐲧', - '𐳨' => '𐲨', - '𐳩' => '𐲩', - '𐳪' => '𐲪', - '𐳫' => '𐲫', - '𐳬' => '𐲬', - '𐳭' => '𐲭', - '𐳮' => '𐲮', - '𐳯' => '𐲯', - '𐳰' => '𐲰', - '𐳱' => '𐲱', - '𐳲' => '𐲲', - '𑣀' => '𑢠', - '𑣁' => '𑢡', - '𑣂' => '𑢢', - '𑣃' => '𑢣', - '𑣄' => '𑢤', - '𑣅' => '𑢥', - '𑣆' => '𑢦', - '𑣇' => '𑢧', - '𑣈' => '𑢨', - '𑣉' => '𑢩', - '𑣊' => '𑢪', - '𑣋' => '𑢫', - '𑣌' => '𑢬', - '𑣍' => '𑢭', - '𑣎' => '𑢮', - '𑣏' => '𑢯', - '𑣐' => '𑢰', - '𑣑' => '𑢱', - '𑣒' => '𑢲', - '𑣓' => '𑢳', - '𑣔' => '𑢴', - '𑣕' => '𑢵', - '𑣖' => '𑢶', - '𑣗' => '𑢷', - '𑣘' => '𑢸', - '𑣙' => '𑢹', - '𑣚' => '𑢺', - '𑣛' => '𑢻', - '𑣜' => '𑢼', - '𑣝' => '𑢽', - '𑣞' => '𑢾', - '𑣟' => '𑢿', - '𖹠' => '𖹀', - '𖹡' => '𖹁', - '𖹢' => '𖹂', - '𖹣' => '𖹃', - '𖹤' => '𖹄', - '𖹥' => '𖹅', - '𖹦' => '𖹆', - '𖹧' => '𖹇', - '𖹨' => '𖹈', - '𖹩' => '𖹉', - '𖹪' => '𖹊', - '𖹫' => '𖹋', - '𖹬' => '𖹌', - '𖹭' => '𖹍', - '𖹮' => '𖹎', - '𖹯' => '𖹏', - '𖹰' => '𖹐', - '𖹱' => '𖹑', - '𖹲' => '𖹒', - '𖹳' => '𖹓', - '𖹴' => '𖹔', - '𖹵' => '𖹕', - '𖹶' => '𖹖', - '𖹷' => '𖹗', - '𖹸' => '𖹘', - '𖹹' => '𖹙', - '𖹺' => '𖹚', - '𖹻' => '𖹛', - '𖹼' => '𖹜', - '𖹽' => '𖹝', - '𖹾' => '𖹞', - '𖹿' => '𖹟', - '𞤢' => '𞤀', - '𞤣' => '𞤁', - '𞤤' => '𞤂', - '𞤥' => '𞤃', - '𞤦' => '𞤄', - '𞤧' => '𞤅', - '𞤨' => '𞤆', - '𞤩' => '𞤇', - '𞤪' => '𞤈', - '𞤫' => '𞤉', - '𞤬' => '𞤊', - '𞤭' => '𞤋', - '𞤮' => '𞤌', - '𞤯' => '𞤍', - '𞤰' => '𞤎', - '𞤱' => '𞤏', - '𞤲' => '𞤐', - '𞤳' => '𞤑', - '𞤴' => '𞤒', - '𞤵' => '𞤓', - '𞤶' => '𞤔', - '𞤷' => '𞤕', - '𞤸' => '𞤖', - '𞤹' => '𞤗', - '𞤺' => '𞤘', - '𞤻' => '𞤙', - '𞤼' => '𞤚', - '𞤽' => '𞤛', - '𞤾' => '𞤜', - '𞤿' => '𞤝', - '𞥀' => '𞤞', - '𞥁' => '𞤟', - '𞥂' => '𞤠', - '𞥃' => '𞤡', - 'ß' => 'SS', - 'ff' => 'FF', - 'fi' => 'FI', - 'fl' => 'FL', - 'ffi' => 'FFI', - 'ffl' => 'FFL', - 'ſt' => 'ST', - 'st' => 'ST', - 'և' => 'ԵՒ', - 'ﬓ' => 'ՄՆ', - 'ﬔ' => 'ՄԵ', - 'ﬕ' => 'ՄԻ', - 'ﬖ' => 'ՎՆ', - 'ﬗ' => 'ՄԽ', - 'ʼn' => 'ʼN', - 'ΐ' => 'Ϊ́', - 'ΰ' => 'Ϋ́', - 'ǰ' => 'J̌', - 'ẖ' => 'H̱', - 'ẗ' => 'T̈', - 'ẘ' => 'W̊', - 'ẙ' => 'Y̊', - 'ẚ' => 'Aʾ', - 'ὐ' => 'Υ̓', - 'ὒ' => 'Υ̓̀', - 'ὔ' => 'Υ̓́', - 'ὖ' => 'Υ̓͂', - 'ᾶ' => 'Α͂', - 'ῆ' => 'Η͂', - 'ῒ' => 'Ϊ̀', - 'ΐ' => 'Ϊ́', - 'ῖ' => 'Ι͂', - 'ῗ' => 'Ϊ͂', - 'ῢ' => 'Ϋ̀', - 'ΰ' => 'Ϋ́', - 'ῤ' => 'Ρ̓', - 'ῦ' => 'Υ͂', - 'ῧ' => 'Ϋ͂', - 'ῶ' => 'Ω͂', - 'ᾈ' => 'ἈΙ', - 'ᾉ' => 'ἉΙ', - 'ᾊ' => 'ἊΙ', - 'ᾋ' => 'ἋΙ', - 'ᾌ' => 'ἌΙ', - 'ᾍ' => 'ἍΙ', - 'ᾎ' => 'ἎΙ', - 'ᾏ' => 'ἏΙ', - 'ᾘ' => 'ἨΙ', - 'ᾙ' => 'ἩΙ', - 'ᾚ' => 'ἪΙ', - 'ᾛ' => 'ἫΙ', - 'ᾜ' => 'ἬΙ', - 'ᾝ' => 'ἭΙ', - 'ᾞ' => 'ἮΙ', - 'ᾟ' => 'ἯΙ', - 'ᾨ' => 'ὨΙ', - 'ᾩ' => 'ὩΙ', - 'ᾪ' => 'ὪΙ', - 'ᾫ' => 'ὫΙ', - 'ᾬ' => 'ὬΙ', - 'ᾭ' => 'ὭΙ', - 'ᾮ' => 'ὮΙ', - 'ᾯ' => 'ὯΙ', - 'ᾼ' => 'ΑΙ', - 'ῌ' => 'ΗΙ', - 'ῼ' => 'ΩΙ', - 'ᾲ' => 'ᾺΙ', - 'ᾴ' => 'ΆΙ', - 'ῂ' => 'ῊΙ', - 'ῄ' => 'ΉΙ', - 'ῲ' => 'ῺΙ', - 'ῴ' => 'ΏΙ', - 'ᾷ' => 'Α͂Ι', - 'ῇ' => 'Η͂Ι', - 'ῷ' => 'Ω͂Ι', -); diff --git a/trunk/vendor/symfony/polyfill-mbstring/bootstrap.php b/trunk/vendor/symfony/polyfill-mbstring/bootstrap.php deleted file mode 100644 index 6e4b5fce..00000000 --- a/trunk/vendor/symfony/polyfill-mbstring/bootstrap.php +++ /dev/null @@ -1,159 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language($language = null) { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } -} - -if (!function_exists('mb_str_pad')) { - function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } -} - -if (!function_exists('mb_ucfirst')) { - function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } -} - -if (!function_exists('mb_lcfirst')) { - function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/trunk/vendor/symfony/polyfill-mbstring/bootstrap80.php b/trunk/vendor/symfony/polyfill-mbstring/bootstrap80.php deleted file mode 100644 index ec2ae427..00000000 --- a/trunk/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } -} - -if (!function_exists('mb_str_pad')) { - function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } -} - -if (!function_exists('mb_ucfirst')) { - function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } -} - -if (!function_exists('mb_lcfirst')) { - function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/trunk/vendor/symfony/polyfill-php73/LICENSE b/trunk/vendor/symfony/polyfill-php73/LICENSE deleted file mode 100644 index 7536caea..00000000 --- a/trunk/vendor/symfony/polyfill-php73/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-php73/Php73.php b/trunk/vendor/symfony/polyfill-php73/Php73.php deleted file mode 100644 index 65c35a6a..00000000 --- a/trunk/vendor/symfony/polyfill-php73/Php73.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php73; - -/** - * @author Gabriel Caruso - * @author Ion Bazan - * - * @internal - */ -final class Php73 -{ - public static $startAt = 1533462603; - - /** - * @param bool $asNum - * - * @return array|float|int - */ - public static function hrtime($asNum = false) - { - $ns = microtime(false); - $s = substr($ns, 11) - self::$startAt; - $ns = 1E9 * (float) $ns; - - if ($asNum) { - $ns += $s * 1E9; - - return \PHP_INT_SIZE === 4 ? $ns : (int) $ns; - } - - return [$s, (int) $ns]; - } -} diff --git a/trunk/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/trunk/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php deleted file mode 100644 index f06d6c26..00000000 --- a/trunk/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 70300) { - class JsonException extends Exception - { - } -} diff --git a/trunk/vendor/symfony/polyfill-php73/bootstrap.php b/trunk/vendor/symfony/polyfill-php73/bootstrap.php deleted file mode 100644 index d6b21538..00000000 --- a/trunk/vendor/symfony/polyfill-php73/bootstrap.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php73 as p; - -if (\PHP_VERSION_ID >= 70300) { - return; -} - -if (!function_exists('is_countable')) { - function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; } -} -if (!function_exists('hrtime')) { - require_once __DIR__.'/Php73.php'; - p\Php73::$startAt = (int) microtime(true); - function hrtime($as_number = false) { return p\Php73::hrtime($as_number); } -} -if (!function_exists('array_key_first')) { - function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } } -} -if (!function_exists('array_key_last')) { - function array_key_last(array $array) { return key(array_slice($array, -1, 1, true)); } -} diff --git a/trunk/vendor/symfony/polyfill-php80/LICENSE b/trunk/vendor/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 0ed3a246..00000000 --- a/trunk/vendor/symfony/polyfill-php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/polyfill-php80/Php80.php b/trunk/vendor/symfony/polyfill-php80/Php80.php deleted file mode 100644 index 362dd1a9..00000000 --- a/trunk/vendor/symfony/polyfill-php80/Php80.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - if ('' === $needle || $needle === $haystack) { - return true; - } - - if ('' === $haystack) { - return false; - } - - $needleLength = \strlen($needle); - - return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); - } -} diff --git a/trunk/vendor/symfony/polyfill-php80/PhpToken.php b/trunk/vendor/symfony/polyfill-php80/PhpToken.php deleted file mode 100644 index fe6e6910..00000000 --- a/trunk/vendor/symfony/polyfill-php80/PhpToken.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Fedonyuk Anton - * - * @internal - */ -class PhpToken implements \Stringable -{ - /** - * @var int - */ - public $id; - - /** - * @var string - */ - public $text; - - /** - * @var int - */ - public $line; - - /** - * @var int - */ - public $pos; - - public function __construct(int $id, string $text, int $line = -1, int $position = -1) - { - $this->id = $id; - $this->text = $text; - $this->line = $line; - $this->pos = $position; - } - - public function getTokenName(): ?string - { - if ('UNKNOWN' === $name = token_name($this->id)) { - $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; - } - - return $name; - } - - /** - * @param int|string|array $kind - */ - public function is($kind): bool - { - foreach ((array) $kind as $value) { - if (\in_array($value, [$this->id, $this->text], true)) { - return true; - } - } - - return false; - } - - public function isIgnorable(): bool - { - return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); - } - - public function __toString(): string - { - return (string) $this->text; - } - - /** - * @return static[] - */ - public static function tokenize(string $code, int $flags = 0): array - { - $line = 1; - $position = 0; - $tokens = token_get_all($code, $flags); - foreach ($tokens as $index => $token) { - if (\is_string($token)) { - $id = \ord($token); - $text = $token; - } else { - [$id, $text, $line] = $token; - } - $tokens[$index] = new static($id, $text, $line, $position); - $position += \strlen($text); - } - - return $tokens; - } -} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php deleted file mode 100644 index 2b955423..00000000 --- a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#[Attribute(Attribute::TARGET_CLASS)] -final class Attribute -{ - public const TARGET_CLASS = 1; - public const TARGET_FUNCTION = 2; - public const TARGET_METHOD = 4; - public const TARGET_PROPERTY = 8; - public const TARGET_CLASS_CONSTANT = 16; - public const TARGET_PARAMETER = 32; - public const TARGET_ALL = 63; - public const IS_REPEATABLE = 64; - - /** @var int */ - public $flags; - - public function __construct(int $flags = self::TARGET_ALL) - { - $this->flags = $flags; - } -} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php deleted file mode 100644 index bd1212f6..00000000 --- a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { - class PhpToken extends Symfony\Polyfill\Php80\PhpToken - { - } -} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php deleted file mode 100644 index 7c62d750..00000000 --- a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - interface Stringable - { - /** - * @return string - */ - public function __toString(); - } -} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php deleted file mode 100644 index 01c6c6c8..00000000 --- a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class UnhandledMatchError extends Error - { - } -} diff --git a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php deleted file mode 100644 index 783dbc28..00000000 --- a/trunk/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class ValueError extends Error - { - } -} diff --git a/trunk/vendor/symfony/polyfill-php80/bootstrap.php b/trunk/vendor/symfony/polyfill-php80/bootstrap.php deleted file mode 100644 index e5f7dbc1..00000000 --- a/trunk/vendor/symfony/polyfill-php80/bootstrap.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/trunk/vendor/symfony/service-contracts/Attribute/Required.php b/trunk/vendor/symfony/service-contracts/Attribute/Required.php deleted file mode 100644 index 9df85118..00000000 --- a/trunk/vendor/symfony/service-contracts/Attribute/Required.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -/** - * A required dependency. - * - * This attribute indicates that a property holds a required dependency. The annotated property or method should be - * considered during the instantiation process of the containing class. - * - * @author Alexander M. Turek - */ -#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] -final class Required -{ -} diff --git a/trunk/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/trunk/vendor/symfony/service-contracts/Attribute/SubscribedService.php deleted file mode 100644 index 10d1bc38..00000000 --- a/trunk/vendor/symfony/service-contracts/Attribute/SubscribedService.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -use Symfony\Contracts\Service\ServiceSubscriberTrait; - -/** - * Use with {@see ServiceSubscriberTrait} to mark a method's return type - * as a subscribed service. - * - * @author Kevin Bond - */ -#[\Attribute(\Attribute::TARGET_METHOD)] -final class SubscribedService -{ - /** - * @param string|null $key The key to use for the service - * If null, use "ClassName::methodName" - */ - public function __construct( - public ?string $key = null - ) { - } -} diff --git a/trunk/vendor/symfony/service-contracts/CHANGELOG.md b/trunk/vendor/symfony/service-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/trunk/vendor/symfony/service-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/trunk/vendor/symfony/service-contracts/LICENSE b/trunk/vendor/symfony/service-contracts/LICENSE deleted file mode 100644 index 74cdc2db..00000000 --- a/trunk/vendor/symfony/service-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/service-contracts/ResetInterface.php b/trunk/vendor/symfony/service-contracts/ResetInterface.php deleted file mode 100644 index 1af1075e..00000000 --- a/trunk/vendor/symfony/service-contracts/ResetInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -/** - * Provides a way to reset an object to its initial state. - * - * When calling the "reset()" method on an object, it should be put back to its - * initial state. This usually means clearing any internal buffers and forwarding - * the call to internal dependencies. All properties of the object should be put - * back to the same state it had when it was first ready to use. - * - * This method could be called, for example, to recycle objects that are used as - * services, so that they can be used to handle several requests in the same - * process loop (note that we advise making your services stateless instead of - * implementing this interface when possible.) - */ -interface ResetInterface -{ - public function reset(); -} diff --git a/trunk/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/trunk/vendor/symfony/service-contracts/ServiceLocatorTrait.php deleted file mode 100644 index 19d3e80f..00000000 --- a/trunk/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ /dev/null @@ -1,124 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(ContainerExceptionInterface::class); -class_exists(NotFoundExceptionInterface::class); - -/** - * A trait to help implement ServiceProviderInterface. - * - * @author Robin Chalas - * @author Nicolas Grekas - */ -trait ServiceLocatorTrait -{ - private array $factories; - private array $loading = []; - private array $providedTypes; - - /** - * @param callable[] $factories - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - /** - * {@inheritdoc} - */ - public function has(string $id): bool - { - return isset($this->factories[$id]); - } - - /** - * {@inheritdoc} - */ - public function get(string $id): mixed - { - if (!isset($this->factories[$id])) { - throw $this->createNotFoundException($id); - } - - if (isset($this->loading[$id])) { - $ids = array_values($this->loading); - $ids = \array_slice($this->loading, array_search($id, $ids)); - $ids[] = $id; - - throw $this->createCircularReferenceException($id, $ids); - } - - $this->loading[$id] = $id; - try { - return $this->factories[$id]($this); - } finally { - unset($this->loading[$id]); - } - } - - /** - * {@inheritdoc} - */ - public function getProvidedServices(): array - { - if (!isset($this->providedTypes)) { - $this->providedTypes = []; - - foreach ($this->factories as $name => $factory) { - if (!\is_callable($factory)) { - $this->providedTypes[$name] = '?'; - } else { - $type = (new \ReflectionFunction($factory))->getReturnType(); - - $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?'; - } - } - } - - return $this->providedTypes; - } - - private function createNotFoundException(string $id): NotFoundExceptionInterface - { - if (!$alternatives = array_keys($this->factories)) { - $message = 'is empty...'; - } else { - $last = array_pop($alternatives); - if ($alternatives) { - $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last); - } else { - $message = sprintf('only knows about the "%s" service.', $last); - } - } - - if ($this->loading) { - $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message); - } else { - $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message); - } - - return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface { - }; - } - - private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface - { - return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface { - }; - } -} diff --git a/trunk/vendor/symfony/service-contracts/ServiceProviderInterface.php b/trunk/vendor/symfony/service-contracts/ServiceProviderInterface.php deleted file mode 100644 index c60ad0bd..00000000 --- a/trunk/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; - -/** - * A ServiceProviderInterface exposes the identifiers and the types of services provided by a container. - * - * @author Nicolas Grekas - * @author Mateusz Sip - */ -interface ServiceProviderInterface extends ContainerInterface -{ - /** - * Returns an associative array of service types keyed by the identifiers provided by the current container. - * - * Examples: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the object provides a service named "logger" that implements Psr\Log\LoggerInterface - * * ['foo' => '?'] means the container provides service name "foo" of unspecified type - * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null - * - * @return string[] The provided service types, keyed by service names - */ - public function getProvidedServices(): array; -} diff --git a/trunk/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/trunk/vendor/symfony/service-contracts/ServiceSubscriberInterface.php deleted file mode 100644 index 881ab971..00000000 --- a/trunk/vendor/symfony/service-contracts/ServiceSubscriberInterface.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -/** - * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method. - * - * The getSubscribedServices method returns an array of service types required by such instances, - * optionally keyed by the service names used internally. Service types that start with an interrogation - * mark "?" are optional, while the other ones are mandatory service dependencies. - * - * The injected service locators SHOULD NOT allow access to any other services not specified by the method. - * - * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally. - * This interface does not dictate any injection method for these service locators, although constructor - * injection is recommended. - * - * @author Nicolas Grekas - */ -interface ServiceSubscriberInterface -{ - /** - * Returns an array of service types required by such instances, optionally keyed by the service names used internally. - * - * For mandatory dependencies: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name - * internally to fetch a service which must implement Psr\Log\LoggerInterface. - * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name - * internally to fetch an iterable of Psr\Log\LoggerInterface instances. - * * ['Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface'] - * - * otherwise: - * - * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency - * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency - * * ['?Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface'] - * - * @return string[] The required service types, optionally keyed by service names - */ - public static function getSubscribedServices(): array; -} diff --git a/trunk/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/trunk/vendor/symfony/service-contracts/ServiceSubscriberTrait.php deleted file mode 100644 index ee9d9d9d..00000000 --- a/trunk/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\Attribute\SubscribedService; - -/** - * Implementation of ServiceSubscriberInterface that determines subscribed services from - * method return types. Service ids are available as "ClassName::methodName". - * - * @author Kevin Bond - */ -trait ServiceSubscriberTrait -{ - /** @var ContainerInterface */ - protected $container; - - /** - * {@inheritdoc} - */ - public static function getSubscribedServices(): array - { - $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; - - foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if (self::class !== $method->getDeclaringClass()->name) { - continue; - } - - if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { - continue; - } - - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); - } - - if (!$returnType = $method->getReturnType()) { - throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); - } - - $serviceId = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; - - if ($returnType->allowsNull()) { - $serviceId = '?'.$serviceId; - } - - $services[$attribute->newInstance()->key ?? self::class.'::'.$method->name] = $serviceId; - } - - return $services; - } - - /** - * @required - */ - public function setContainer(ContainerInterface $container): ?ContainerInterface - { - $this->container = $container; - - if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { - return parent::setContainer($container); - } - - return null; - } -} diff --git a/trunk/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/trunk/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php deleted file mode 100644 index 88f6a068..00000000 --- a/trunk/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Test; - -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; - -abstract class ServiceLocatorTest extends TestCase -{ - protected function getServiceLocator(array $factories): ContainerInterface - { - return new class($factories) implements ContainerInterface { - use ServiceLocatorTrait; - }; - } - - public function testHas() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - function () { return 'dummy'; }, - ]); - - $this->assertTrue($locator->has('foo')); - $this->assertTrue($locator->has('bar')); - $this->assertFalse($locator->has('dummy')); - } - - public function testGet() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('baz', $locator->get('bar')); - } - - public function testGetDoesNotMemoize() - { - $i = 0; - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$i) { - ++$i; - - return 'bar'; - }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame(2, $i); - } - - public function testThrowsOnUndefinedInternalService() - { - if (!$this->getExpectedException()) { - $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); - $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); - } - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } - - public function testThrowsOnCircularReference() - { - $this->expectException(\Psr\Container\ContainerExceptionInterface::class); - $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } -} diff --git a/trunk/vendor/symfony/string/AbstractString.php b/trunk/vendor/symfony/string/AbstractString.php deleted file mode 100644 index cf96a837..00000000 --- a/trunk/vendor/symfony/string/AbstractString.php +++ /dev/null @@ -1,716 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement doesn't care about the exact variant it deals with. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -abstract class AbstractString implements \Stringable, \JsonSerializable -{ - public const PREG_PATTERN_ORDER = \PREG_PATTERN_ORDER; - public const PREG_SET_ORDER = \PREG_SET_ORDER; - public const PREG_OFFSET_CAPTURE = \PREG_OFFSET_CAPTURE; - public const PREG_UNMATCHED_AS_NULL = \PREG_UNMATCHED_AS_NULL; - - public const PREG_SPLIT = 0; - public const PREG_SPLIT_NO_EMPTY = \PREG_SPLIT_NO_EMPTY; - public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE; - public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE; - - protected $string = ''; - protected $ignoreCase = false; - - abstract public function __construct(string $string = ''); - - /** - * Unwraps instances of AbstractString back to strings. - * - * @return string[]|array - */ - public static function unwrap(array $values): array - { - foreach ($values as $k => $v) { - if ($v instanceof self) { - $values[$k] = $v->__toString(); - } elseif (\is_array($v) && $values[$k] !== $v = static::unwrap($v)) { - $values[$k] = $v; - } - } - - return $values; - } - - /** - * Wraps (and normalizes) strings in instances of AbstractString. - * - * @return static[]|array - */ - public static function wrap(array $values): array - { - $i = 0; - $keys = null; - - foreach ($values as $k => $v) { - if (\is_string($k) && '' !== $k && $k !== $j = (string) new static($k)) { - $keys = $keys ?? array_keys($values); - $keys[$i] = $j; - } - - if (\is_string($v)) { - $values[$k] = new static($v); - } elseif (\is_array($v) && $values[$k] !== $v = static::wrap($v)) { - $values[$k] = $v; - } - - ++$i; - } - - return null !== $keys ? array_combine($keys, $values) : $values; - } - - /** - * @param string|string[] $needle - */ - public function after(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = \PHP_INT_MAX; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - /** - * @param string|string[] $needle - */ - public function afterLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = null; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - abstract public function append(string ...$suffix): static; - - /** - * @param string|string[] $needle - */ - public function before(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = \PHP_INT_MAX; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @param string|string[] $needle - */ - public function beforeLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = null; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @return int[] - */ - public function bytesAt(int $offset): array - { - $str = $this->slice($offset, 1); - - return '' === $str->string ? [] : array_values(unpack('C*', $str->string)); - } - - abstract public function camel(): static; - - /** - * @return static[] - */ - abstract public function chunk(int $length = 1): array; - - public function collapseWhitespace(): static - { - $str = clone $this; - $str->string = trim(preg_replace("/(?:[ \n\r\t\x0C]{2,}+|[\n\r\t\x0C])/", ' ', $str->string), " \n\r\t\x0C"); - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function containsAny(string|iterable $needle): bool - { - return null !== $this->indexOf($needle); - } - - /** - * @param string|string[] $suffix - */ - public function endsWith(string|iterable $suffix): bool - { - if (\is_string($suffix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($suffix as $s) { - if ($this->endsWith((string) $s)) { - return true; - } - } - - return false; - } - - public function ensureEnd(string $suffix): static - { - if (!$this->endsWith($suffix)) { - return $this->append($suffix); - } - - $suffix = preg_quote($suffix); - $regex = '{('.$suffix.')(?:'.$suffix.')++$}D'; - - return $this->replaceMatches($regex.($this->ignoreCase ? 'i' : ''), '$1'); - } - - public function ensureStart(string $prefix): static - { - $prefix = new static($prefix); - - if (!$this->startsWith($prefix)) { - return $this->prepend($prefix); - } - - $str = clone $this; - $i = $prefixLen = $prefix->length(); - - while ($this->indexOf($prefix, $i) === $i) { - $str = $str->slice($prefixLen); - $i += $prefixLen; - } - - return $str; - } - - /** - * @param string|string[] $string - */ - public function equalsTo(string|iterable $string): bool - { - if (\is_string($string)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($string as $s) { - if ($this->equalsTo((string) $s)) { - return true; - } - } - - return false; - } - - abstract public function folded(): static; - - public function ignoreCase(): static - { - $str = clone $this; - $str->ignoreCase = true; - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function indexOf(string|iterable $needle, int $offset = 0): ?int - { - if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = \PHP_INT_MAX; - - foreach ($needle as $n) { - $j = $this->indexOf((string) $n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - } - } - - return \PHP_INT_MAX === $i ? null : $i; - } - - /** - * @param string|string[] $needle - */ - public function indexOfLast(string|iterable $needle, int $offset = 0): ?int - { - if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = null; - - foreach ($needle as $n) { - $j = $this->indexOfLast((string) $n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - } - } - - return $i; - } - - public function isEmpty(): bool - { - return '' === $this->string; - } - - abstract public function join(array $strings, string $lastGlue = null): static; - - public function jsonSerialize(): string - { - return $this->string; - } - - abstract public function length(): int; - - abstract public function lower(): static; - - /** - * Matches the string using a regular expression. - * - * Pass PREG_PATTERN_ORDER or PREG_SET_ORDER as $flags to get all occurrences matching the regular expression. - * - * @return array All matches in a multi-dimensional array ordered according to flags - */ - abstract public function match(string $regexp, int $flags = 0, int $offset = 0): array; - - abstract public function padBoth(int $length, string $padStr = ' '): static; - - abstract public function padEnd(int $length, string $padStr = ' '): static; - - abstract public function padStart(int $length, string $padStr = ' '): static; - - abstract public function prepend(string ...$prefix): static; - - public function repeat(int $multiplier): static - { - if (0 > $multiplier) { - throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier)); - } - - $str = clone $this; - $str->string = str_repeat($str->string, $multiplier); - - return $str; - } - - abstract public function replace(string $from, string $to): static; - - abstract public function replaceMatches(string $fromRegexp, string|callable $to): static; - - abstract public function reverse(): static; - - abstract public function slice(int $start = 0, int $length = null): static; - - abstract public function snake(): static; - - abstract public function splice(string $replacement, int $start = 0, int $length = null): static; - - /** - * @return static[] - */ - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (null === $flags) { - throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.'); - } - - if ($this->ignoreCase) { - $delimiter .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Splitting failed with '.$k.'.'); - } - } - - throw new RuntimeException('Splitting failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - - if (self::PREG_SPLIT_OFFSET_CAPTURE & $flags) { - foreach ($chunks as &$chunk) { - $str->string = $chunk[0]; - $chunk[0] = clone $str; - } - } else { - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - } - - return $chunks; - } - - /** - * @param string|string[] $prefix - */ - public function startsWith(string|iterable $prefix): bool - { - if (\is_string($prefix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($prefix as $prefix) { - if ($this->startsWith((string) $prefix)) { - return true; - } - } - - return false; - } - - abstract public function title(bool $allWords = false): static; - - public function toByteString(string $toEncoding = null): ByteString - { - $b = new ByteString(); - - $toEncoding = \in_array($toEncoding, ['utf8', 'utf-8', 'UTF8'], true) ? 'UTF-8' : $toEncoding; - - if (null === $toEncoding || $toEncoding === $fromEncoding = $this instanceof AbstractUnicodeString || preg_match('//u', $b->string) ? 'UTF-8' : 'Windows-1252') { - $b->string = $this->string; - - return $b; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - try { - $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $b->string = iconv('UTF-8', $toEncoding, $this->string); - } - } finally { - restore_error_handler(); - } - - return $b; - } - - public function toCodePointString(): CodePointString - { - return new CodePointString($this->string); - } - - public function toString(): string - { - return $this->string; - } - - public function toUnicodeString(): UnicodeString - { - return new UnicodeString($this->string); - } - - abstract public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - /** - * @param string|string[] $prefix - */ - public function trimPrefix($prefix): static - { - if (\is_array($prefix) || $prefix instanceof \Traversable) { - foreach ($prefix as $s) { - $t = $this->trimPrefix($s); - - if ($t->string !== $this->string) { - return $t; - } - } - - return clone $this; - } - - $str = clone $this; - - if ($prefix instanceof self) { - $prefix = $prefix->string; - } else { - $prefix = (string) $prefix; - } - - if ('' !== $prefix && \strlen($this->string) >= \strlen($prefix) && 0 === substr_compare($this->string, $prefix, 0, \strlen($prefix), $this->ignoreCase)) { - $str->string = substr($this->string, \strlen($prefix)); - } - - return $str; - } - - abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - /** - * @param string|string[] $suffix - */ - public function trimSuffix($suffix): static - { - if (\is_array($suffix) || $suffix instanceof \Traversable) { - foreach ($suffix as $s) { - $t = $this->trimSuffix($s); - - if ($t->string !== $this->string) { - return $t; - } - } - - return clone $this; - } - - $str = clone $this; - - if ($suffix instanceof self) { - $suffix = $suffix->string; - } else { - $suffix = (string) $suffix; - } - - if ('' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase)) { - $str->string = substr($this->string, 0, -\strlen($suffix)); - } - - return $str; - } - - public function truncate(int $length, string $ellipsis = '', bool $cut = true): static - { - $stringLength = $this->length(); - - if ($stringLength <= $length) { - return clone $this; - } - - $ellipsisLength = '' !== $ellipsis ? (new static($ellipsis))->length() : 0; - - if ($length < $ellipsisLength) { - $ellipsisLength = 0; - } - - if (!$cut) { - if (null === $length = $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { - return clone $this; - } - - $length += $ellipsisLength; - } - - $str = $this->slice(0, $length - $ellipsisLength); - - return $ellipsisLength ? $str->trimEnd()->append($ellipsis) : $str; - } - - abstract public function upper(): static; - - /** - * Returns the printable length on a terminal. - */ - abstract public function width(bool $ignoreAnsiDecoration = true): int; - - public function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): static - { - $lines = '' !== $break ? $this->split($break) : [clone $this]; - $chars = []; - $mask = ''; - - if (1 === \count($lines) && '' === $lines[0]->string) { - return $lines[0]; - } - - foreach ($lines as $i => $line) { - if ($i) { - $chars[] = $break; - $mask .= '#'; - } - - foreach ($line->chunk() as $char) { - $chars[] = $char->string; - $mask .= ' ' === $char->string ? ' ' : '?'; - } - } - - $string = ''; - $j = 0; - $b = $i = -1; - $mask = wordwrap($mask, $width, '#', $cut); - - while (false !== $b = strpos($mask, '#', $b + 1)) { - for (++$i; $i < $b; ++$i) { - $string .= $chars[$j]; - unset($chars[$j++]); - } - - if ($break === $chars[$j] || ' ' === $chars[$j]) { - unset($chars[$j++]); - } - - $string .= $break; - } - - $str = clone $this; - $str->string = $string.implode('', $chars); - - return $str; - } - - public function __sleep(): array - { - return ['string']; - } - - public function __clone() - { - $this->ignoreCase = false; - } - - public function __toString(): string - { - return $this->string; - } -} diff --git a/trunk/vendor/symfony/string/AbstractUnicodeString.php b/trunk/vendor/symfony/string/AbstractUnicodeString.php deleted file mode 100644 index 00096df0..00000000 --- a/trunk/vendor/symfony/string/AbstractUnicodeString.php +++ /dev/null @@ -1,606 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract Unicode characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement is Unicode-aware but doesn't care about code points vs grapheme clusters. - * - * @author Nicolas Grekas - * - * @throws ExceptionInterface - */ -abstract class AbstractUnicodeString extends AbstractString -{ - public const NFC = \Normalizer::NFC; - public const NFD = \Normalizer::NFD; - public const NFKC = \Normalizer::NFKC; - public const NFKD = \Normalizer::NFKD; - - // all ASCII letters sorted by typical frequency of occurrence - private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - - // the subset of folded case mappings that is not in lower case mappings - private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'İ', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; - private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'i̇', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; - - // the subset of upper case mappings that map one code point to many code points - private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ']; - private const UPPER_TO = ['SS', 'FF', 'FI', 'FL', 'FFI', 'FFL', 'ST', 'ST', 'ԵՒ', 'ՄՆ', 'ՄԵ', 'ՄԻ', 'ՎՆ', 'ՄԽ', 'ʼN', 'Ϊ́', 'Ϋ́', 'J̌', 'H̱', 'T̈', 'W̊', 'Y̊', 'Aʾ', 'Υ̓', 'Υ̓̀', 'Υ̓́', 'Υ̓͂', 'Α͂', 'Η͂', 'Ϊ̀', 'Ϊ́', 'Ι͂', 'Ϊ͂', 'Ϋ̀', 'Ϋ́', 'Ρ̓', 'Υ͂', 'Ϋ͂', 'Ω͂']; - - // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD - private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł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 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; - private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; - - private static $transliterators = []; - private static $tableZero; - private static $tableWide; - - public static function fromCodePoints(int ...$codes): static - { - $string = ''; - - foreach ($codes as $code) { - if (0x80 > $code %= 0x200000) { - $string .= \chr($code); - } elseif (0x800 > $code) { - $string .= \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $string .= \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $string .= \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - } - - return new static($string); - } - - /** - * Generic UTF-8 to ASCII transliteration. - * - * Install the intl extension for best results. - * - * @param string[]|\Transliterator[]|\Closure[] $rules See "*-Latin" rules from Transliterator::listIDs() - */ - public function ascii(array $rules = []): self - { - $str = clone $this; - $s = $str->string; - $str->string = ''; - - array_unshift($rules, 'nfd'); - $rules[] = 'latin-ascii'; - - if (\function_exists('transliterator_transliterate')) { - $rules[] = 'any-latin/bgn'; - } - - $rules[] = 'nfkd'; - $rules[] = '[:nonspacing mark:] remove'; - - while (\strlen($s) - 1 > $i = strspn($s, self::ASCII)) { - if (0 < --$i) { - $str->string .= substr($s, 0, $i); - $s = substr($s, $i); - } - - if (!$rule = array_shift($rules)) { - $rules = []; // An empty rule interrupts the next ones - } - - if ($rule instanceof \Transliterator) { - $s = $rule->transliterate($s); - } elseif ($rule instanceof \Closure) { - $s = $rule($s); - } elseif ($rule) { - if ('nfd' === $rule = strtolower($rule)) { - normalizer_is_normalized($s, self::NFD) ?: $s = normalizer_normalize($s, self::NFD); - } elseif ('nfkd' === $rule) { - normalizer_is_normalized($s, self::NFKD) ?: $s = normalizer_normalize($s, self::NFKD); - } elseif ('[:nonspacing mark:] remove' === $rule) { - $s = preg_replace('/\p{Mn}++/u', '', $s); - } elseif ('latin-ascii' === $rule) { - $s = str_replace(self::TRANSLIT_FROM, self::TRANSLIT_TO, $s); - } elseif ('de-ascii' === $rule) { - $s = preg_replace("/([AUO])\u{0308}(?=\p{Ll})/u", '$1e', $s); - $s = str_replace(["a\u{0308}", "o\u{0308}", "u\u{0308}", "A\u{0308}", "O\u{0308}", "U\u{0308}"], ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], $s); - } elseif (\function_exists('transliterator_transliterate')) { - if (null === $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule)) { - if ('any-latin/bgn' === $rule) { - $rule = 'any-latin'; - $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule); - } - - if (null === $transliterator) { - throw new InvalidArgumentException(sprintf('Unknown transliteration rule "%s".', $rule)); - } - - self::$transliterators['any-latin/bgn'] = $transliterator; - } - - $s = $transliterator->transliterate($s); - } - } elseif (!\function_exists('iconv')) { - $s = preg_replace('/[^\x00-\x7F]/u', '?', $s); - } else { - $s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) { - $c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]); - - if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) { - throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); - } - - return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?'); - }, $s); - } - } - - $str->string .= $s; - - return $str; - } - - public function camel(): static - { - $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) use (&$i) { - return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); - - return $str; - } - - /** - * @return int[] - */ - public function codePointsAt(int $offset): array - { - $str = $this->slice($offset, 1); - - if ('' === $str->string) { - return []; - } - - $codePoints = []; - - foreach (preg_split('//u', $str->string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoints[] = mb_ord($c, 'UTF-8'); - } - - return $codePoints; - } - - public function folded(bool $compat = true): static - { - $str = clone $this; - - if (!$compat || !\defined('Normalizer::NFKC_CF')) { - $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); - $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8'); - } else { - $str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF); - } - - return $str; - } - - public function join(array $strings, string $lastGlue = null): static - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function lower(): static - { - $str = clone $this; - $str->string = mb_strtolower(str_replace('İ', 'i̇', $str->string), 'UTF-8'); - - return $str; - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - public function normalize(int $form = self::NFC): static - { - if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD])) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } - - $str = clone $this; - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - - return $str; - } - - public function padBoth(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_BOTH); - } - - public function padEnd(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_RIGHT); - } - - public function padStart(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_LEFT); - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - if (\is_array($to) || $to instanceof \Closure) { - $replace = 'preg_replace_callback'; - $to = static function (array $m) use ($to): string { - $to = $to($m); - - if ('' !== $to && (!\is_string($to) || !preg_match('//u', $to))) { - throw new InvalidArgumentException('Replace callback must return a valid UTF-8 string.'); - } - - return $to; - }; - } elseif ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } else { - $replace = 'preg_replace'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (null === $string = $replace($fromRegexp.'u', $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): static - { - $str = clone $this; - $str->string = implode('', array_reverse(preg_split('/(\X)/u', $str->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY))); - - return $str; - } - - public function snake(): static - { - $str = $this->camel(); - $str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8'); - - return $str; - } - - public function title(bool $allWords = false): static - { - $str = clone $this; - - $limit = $allWords ? -1 : 1; - - $str->string = preg_replace_callback('/\b./u', static function (array $m): string { - return mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, $str->string, $limit); - - return $str; - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++|[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimPrefix($prefix): static - { - if (!$this->ignoreCase) { - return parent::trimPrefix($prefix); - } - - $str = clone $this; - - if ($prefix instanceof \Traversable) { - $prefix = iterator_to_array($prefix, false); - } elseif ($prefix instanceof parent) { - $prefix = $prefix->string; - } - - $prefix = implode('|', array_map('preg_quote', (array) $prefix)); - $str->string = preg_replace("{^(?:$prefix)}iuD", '', $this->string); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++}uD", '', $str->string); - - return $str; - } - - public function trimSuffix($suffix): static - { - if (!$this->ignoreCase) { - return parent::trimSuffix($suffix); - } - - $str = clone $this; - - if ($suffix instanceof \Traversable) { - $suffix = iterator_to_array($suffix, false); - } elseif ($suffix instanceof parent) { - $suffix = $suffix->string; - } - - $suffix = implode('|', array_map('preg_quote', (array) $suffix)); - $str->string = preg_replace("{(?:$suffix)$}iuD", '', $this->string); - - return $str; - } - - public function upper(): static - { - $str = clone $this; - $str->string = mb_strtoupper($str->string, 'UTF-8'); - - return $str; - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $width = 0; - $s = str_replace(["\x00", "\x05", "\x07"], '', $this->string); - - if (false !== strpos($s, "\r")) { - $s = str_replace(["\r\n", "\r"], "\n", $s); - } - - if (!$ignoreAnsiDecoration) { - $s = preg_replace('/[\p{Cc}\x7F]++/u', '', $s); - } - - foreach (explode("\n", $s) as $s) { - if ($ignoreAnsiDecoration) { - $s = preg_replace('/(?:\x1B(?: - \[ [\x30-\x3F]*+ [\x20-\x2F]*+ [\x40-\x7E] - | [P\]X^_] .*? \x1B\\\\ - | [\x41-\x7E] - )|[\p{Cc}\x7F]++)/xu', '', $s); - } - - $lineWidth = $this->wcswidth($s); - - if ($lineWidth > $width) { - $width = $lineWidth; - } - } - - return $width; - } - - private function pad(int $len, self $pad, int $type): static - { - $sLen = $this->length(); - - if ($len <= $sLen) { - return clone $this; - } - - $padLen = $pad->length(); - $freeLen = $len - $sLen; - $len = $freeLen % $padLen; - - switch ($type) { - case \STR_PAD_RIGHT: - return $this->append(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_LEFT: - return $this->prepend(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_BOTH: - $freeLen /= 2; - - $rightLen = ceil($freeLen); - $len = $rightLen % $padLen; - $str = $this->append(str_repeat($pad->string, intdiv($rightLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - $leftLen = floor($freeLen); - $len = $leftLen % $padLen; - - return $str->prepend(str_repeat($pad->string, intdiv($leftLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - default: - throw new InvalidArgumentException('Invalid padding type.'); - } - } - - /** - * Based on https://github.com/jquast/wcwidth, a Python implementation of https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c. - */ - private function wcswidth(string $string): int - { - $width = 0; - - foreach (preg_split('//u', $string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoint = mb_ord($c, 'UTF-8'); - - if (0 === $codePoint // NULL - || 0x034F === $codePoint // COMBINING GRAPHEME JOINER - || (0x200B <= $codePoint && 0x200F >= $codePoint) // ZERO WIDTH SPACE to RIGHT-TO-LEFT MARK - || 0x2028 === $codePoint // LINE SEPARATOR - || 0x2029 === $codePoint // PARAGRAPH SEPARATOR - || (0x202A <= $codePoint && 0x202E >= $codePoint) // LEFT-TO-RIGHT EMBEDDING to RIGHT-TO-LEFT OVERRIDE - || (0x2060 <= $codePoint && 0x2063 >= $codePoint) // WORD JOINER to INVISIBLE SEPARATOR - ) { - continue; - } - - // Non printable characters - if (32 > $codePoint // C0 control characters - || (0x07F <= $codePoint && 0x0A0 > $codePoint) // C1 control characters and DEL - ) { - return -1; - } - - if (null === self::$tableZero) { - self::$tableZero = require __DIR__.'/Resources/data/wcswidth_table_zero.php'; - } - - if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > self::$tableZero[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < self::$tableZero[$mid][0]) { - $ubound = $mid - 1; - } else { - continue 2; - } - } - } - - if (null === self::$tableWide) { - self::$tableWide = require __DIR__.'/Resources/data/wcswidth_table_wide.php'; - } - - if ($codePoint >= self::$tableWide[0][0] && $codePoint <= self::$tableWide[$ubound = \count(self::$tableWide) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > self::$tableWide[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < self::$tableWide[$mid][0]) { - $ubound = $mid - 1; - } else { - $width += 2; - - continue 2; - } - } - } - - ++$width; - } - - return $width; - } -} diff --git a/trunk/vendor/symfony/string/ByteString.php b/trunk/vendor/symfony/string/ByteString.php deleted file mode 100644 index 639d6435..00000000 --- a/trunk/vendor/symfony/string/ByteString.php +++ /dev/null @@ -1,493 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a binary-safe string of bytes. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class ByteString extends AbstractString -{ - private const ALPHABET_ALPHANUMERIC = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - - public function __construct(string $string = '') - { - $this->string = $string; - } - - /* - * The following method was derived from code of the Hack Standard Library (v4.40 - 2020-05-03) - * - * https://github.com/hhvm/hsl/blob/80a42c02f036f72a42f0415e80d6b847f4bf62d5/src/random/private.php#L16 - * - * Code subject to the MIT license (https://github.com/hhvm/hsl/blob/master/LICENSE). - * - * Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/) - */ - - public static function fromRandom(int $length = 16, string $alphabet = null): self - { - if ($length <= 0) { - throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length)); - } - - $alphabet = $alphabet ?? self::ALPHABET_ALPHANUMERIC; - $alphabetSize = \strlen($alphabet); - $bits = (int) ceil(log($alphabetSize, 2.0)); - if ($bits <= 0 || $bits > 56) { - throw new InvalidArgumentException('The length of the alphabet must in the [2^1, 2^56] range.'); - } - - $ret = ''; - while ($length > 0) { - $urandomLength = (int) ceil(2 * $length * $bits / 8.0); - $data = random_bytes($urandomLength); - $unpackedData = 0; - $unpackedBits = 0; - for ($i = 0; $i < $urandomLength && $length > 0; ++$i) { - // Unpack 8 bits - $unpackedData = ($unpackedData << 8) | \ord($data[$i]); - $unpackedBits += 8; - - // While we have enough bits to select a character from the alphabet, keep - // consuming the random data - for (; $unpackedBits >= $bits && $length > 0; $unpackedBits -= $bits) { - $index = ($unpackedData & ((1 << $bits) - 1)); - $unpackedData >>= $bits; - // Unfortunately, the alphabet size is not necessarily a power of two. - // Worst case, it is 2^k + 1, which means we need (k+1) bits and we - // have around a 50% chance of missing as k gets larger - if ($index < $alphabetSize) { - $ret .= $alphabet[$index]; - --$length; - } - } - } - } - - return new static($ret); - } - - public function bytesAt(int $offset): array - { - $str = $this->string[$offset] ?? ''; - - return '' === $str ? [] : [\ord($str)]; - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - return $str; - } - - public function camel(): static - { - $str = clone $this; - - $parts = explode(' ', trim(ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); - $parts[0] = 1 !== \strlen($parts[0]) && ctype_upper($parts[0]) ? $parts[0] : lcfirst($parts[0]); - $str->string = implode('', $parts); - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $str = clone $this; - $chunks = []; - - foreach (str_split($this->string, $length) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - return '' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - if ('' !== $string && $this->ignoreCase) { - return 0 === strcasecmp($string, $this->string); - } - - return $string === $this->string; - } - - public function folded(): static - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? stripos($this->string, $needle, $offset) : strpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? strripos($this->string, $needle, $offset) : strrpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function isUtf8(): bool - { - return '' === $this->string || preg_match('//u', $this->string); - } - - public function join(array $strings, string $lastGlue = null): static - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - return $str; - } - - public function length(): int - { - return \strlen($this->string); - } - - public function lower(): static - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - public function padBoth(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_BOTH); - - return $str; - } - - public function padEnd(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_RIGHT); - - return $str; - } - - public function padStart(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_LEFT); - - return $str; - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$str->string; - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - - if ('' !== $from) { - $str->string = $this->ignoreCase ? str_ireplace($from, $to, $this->string) : str_replace($from, $to, $this->string); - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - $replace = \is_array($to) || $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (null === $string = $replace($fromRegexp, $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): static - { - $str = clone $this; - $str->string = strrev($str->string); - - return $str; - } - - public function slice(int $start = 0, int $length = null): static - { - $str = clone $this; - $str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function snake(): static - { - $str = $this->camel(); - $str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string)); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): static - { - $str = clone $this; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit = $limit ?? \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter, $limit, $flags); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - return '' !== $prefix && 0 === ($this->ignoreCase ? strncasecmp($this->string, $prefix, \strlen($prefix)) : strncmp($this->string, $prefix, \strlen($prefix))); - } - - public function title(bool $allWords = false): static - { - $str = clone $this; - $str->string = $allWords ? ucwords($str->string) : ucfirst($str->string); - - return $str; - } - - public function toUnicodeString(string $fromEncoding = null): UnicodeString - { - return new UnicodeString($this->toCodePointString($fromEncoding)->string); - } - - public function toCodePointString(string $fromEncoding = null): CodePointString - { - $u = new CodePointString(); - - if (\in_array($fromEncoding, [null, 'utf8', 'utf-8', 'UTF8', 'UTF-8'], true) && preg_match('//u', $this->string)) { - $u->string = $this->string; - - return $u; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - try { - $validEncoding = false !== mb_detect_encoding($this->string, $fromEncoding ?? 'Windows-1252', true); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $u->string = iconv($fromEncoding ?? 'Windows-1252', 'UTF-8', $this->string); - - return $u; - } - } finally { - restore_error_handler(); - } - - if (!$validEncoding) { - throw new InvalidArgumentException(sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); - } - - $u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252'); - - return $u; - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = trim($str->string, $chars); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = rtrim($str->string, $chars); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = ltrim($str->string, $chars); - - return $str; - } - - public function upper(): static - { - $str = clone $this; - $str->string = strtoupper($str->string); - - return $str; - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $string = preg_match('//u', $this->string) ? $this->string : preg_replace('/[\x80-\xFF]/', '?', $this->string); - - return (new CodePointString($string))->width($ignoreAnsiDecoration); - } -} diff --git a/trunk/vendor/symfony/string/CHANGELOG.md b/trunk/vendor/symfony/string/CHANGELOG.md deleted file mode 100644 index 53af3640..00000000 --- a/trunk/vendor/symfony/string/CHANGELOG.md +++ /dev/null @@ -1,35 +0,0 @@ -CHANGELOG -========= - -5.4 ---- - - * Add `trimSuffix()` and `trimPrefix()` methods - -5.3 ---- - - * Made `AsciiSlugger` fallback to parent locale's symbolsMap - -5.2.0 ------ - - * added a `FrenchInflector` class - -5.1.0 ------ - - * added the `AbstractString::reverse()` method - * made `AbstractString::width()` follow POSIX.1-2001 - * added `LazyString` which provides memoizing stringable objects - * The component is not marked as `@experimental` anymore - * added the `s()` helper method to get either an `UnicodeString` or `ByteString` instance, - depending of the input string UTF-8 compliancy - * added `$cut` parameter to `Symfony\Component\String\AbstractString::truncate()` - * added `AbstractString::containsAny()` - * allow passing a string of custom characters to `ByteString::fromRandom()` - -5.0.0 ------ - - * added the component as experimental diff --git a/trunk/vendor/symfony/string/CodePointString.php b/trunk/vendor/symfony/string/CodePointString.php deleted file mode 100644 index 926ff798..00000000 --- a/trunk/vendor/symfony/string/CodePointString.php +++ /dev/null @@ -1,260 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode code points encoded as UTF-8. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class CodePointString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - if ('' !== $string && !preg_match('//u', $string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $this->string = $string; - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '.{65535}'; - $length -= 65535; - } - $rx .= '.{'.$length.'})/us'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function codePointsAt(int $offset): array - { - $str = $offset ? $this->slice($offset, 1) : $this; - - return '' === $str->string ? [] : [mb_ord($str->string, 'UTF-8')]; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - if ('' === $suffix || !preg_match('//u', $suffix)) { - return false; - } - - if ($this->ignoreCase) { - return preg_match('{'.preg_quote($suffix).'$}iuD', $this->string); - } - - return \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix)); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - if ('' !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_stripos($this->string, $needle, $offset, 'UTF-8') : mb_strpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_strripos($this->string, $needle, $offset, 'UTF-8') : mb_strrpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function length(): int - { - return mb_strlen($this->string, 'UTF-8'); - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - - if ('' === $from || !preg_match('//u', $from)) { - return $str; - } - - if ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - if ($this->ignoreCase) { - $str->string = implode($to, preg_split('{'.preg_quote($from).'}iuD', $this->string)); - } else { - $str->string = str_replace($from, $to, $this->string); - } - - return $str; - } - - public function slice(int $start = 0, int $length = null): static - { - $str = clone $this; - $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): static - { - if (!preg_match('//u', $replacement)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $str = clone $this; - $start = $start ? \strlen(mb_substr($this->string, 0, $start, 'UTF-8')) : 0; - $length = $length ? \strlen(mb_substr($this->string, $start, $length, 'UTF-8')) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit = $limit ?? \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - if (!preg_match('//u', $delimiter)) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iuD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - if ('' === $prefix || !preg_match('//u', $prefix)) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos($this->string, $prefix, 0, 'UTF-8'); - } - - return 0 === strncmp($this->string, $prefix, \strlen($prefix)); - } -} diff --git a/trunk/vendor/symfony/string/Exception/ExceptionInterface.php b/trunk/vendor/symfony/string/Exception/ExceptionInterface.php deleted file mode 100644 index 36197865..00000000 --- a/trunk/vendor/symfony/string/Exception/ExceptionInterface.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -interface ExceptionInterface extends \Throwable -{ -} diff --git a/trunk/vendor/symfony/string/Exception/InvalidArgumentException.php b/trunk/vendor/symfony/string/Exception/InvalidArgumentException.php deleted file mode 100644 index 6aa586bc..00000000 --- a/trunk/vendor/symfony/string/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/trunk/vendor/symfony/string/Exception/RuntimeException.php b/trunk/vendor/symfony/string/Exception/RuntimeException.php deleted file mode 100644 index 77cb091f..00000000 --- a/trunk/vendor/symfony/string/Exception/RuntimeException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/trunk/vendor/symfony/string/Inflector/EnglishInflector.php b/trunk/vendor/symfony/string/Inflector/EnglishInflector.php deleted file mode 100644 index 9f2fac67..00000000 --- a/trunk/vendor/symfony/string/Inflector/EnglishInflector.php +++ /dev/null @@ -1,511 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -final class EnglishInflector implements InflectorInterface -{ - /** - * Map English plural to singular suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const PLURAL_MAP = [ - // First entry: plural suffix, reversed - // Second entry: length of plural suffix - // Third entry: Whether the suffix may succeed a vocal - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: singular suffix, normal - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['a', 1, true, true, ['on', 'um']], - - // nebulae (nebula) - ['ea', 2, true, true, 'a'], - - // services (service) - ['secivres', 8, true, true, 'service'], - - // mice (mouse), lice (louse) - ['eci', 3, false, true, 'ouse'], - - // geese (goose) - ['esee', 4, false, true, 'oose'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['i', 1, true, true, 'us'], - - // men (man), women (woman) - ['nem', 3, true, true, 'man'], - - // children (child) - ['nerdlihc', 8, true, true, 'child'], - - // oxen (ox) - ['nexo', 4, false, false, 'ox'], - - // indices (index), appendices (appendix), prices (price) - ['seci', 4, false, true, ['ex', 'ix', 'ice']], - - // selfies (selfie) - ['seifles', 7, true, true, 'selfie'], - - // zombies (zombie) - ['seibmoz', 7, true, true, 'zombie'], - - // movies (movie) - ['seivom', 6, true, true, 'movie'], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sesutcep', 8, true, true, 'pectus'], - - // feet (foot) - ['teef', 4, true, true, 'foot'], - - // geese (goose) - ['eseeg', 5, true, true, 'goose'], - - // teeth (tooth) - ['hteet', 5, true, true, 'tooth'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // series (series) - ['seires', 6, true, true, 'series'], - - // babies (baby) - ['sei', 3, false, true, 'y'], - - // accesses (access), addresses (address), kisses (kiss) - ['sess', 4, true, false, 'ss'], - - // analyses (analysis), ellipses (ellipsis), fungi (fungus), - // neuroses (neurosis), theses (thesis), emphases (emphasis), - // oases (oasis), crises (crisis), houses (house), bases (base), - // atlases (atlas) - ['ses', 3, true, true, ['s', 'se', 'sis']], - - // objectives (objective), alternative (alternatives) - ['sevit', 5, true, true, 'tive'], - - // drives (drive) - ['sevird', 6, false, true, 'drive'], - - // lives (life), wives (wife) - ['sevi', 4, false, true, 'ife'], - - // moves (move) - ['sevom', 5, true, true, 'move'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf), caves (cave), staves (staff) - ['sev', 3, true, true, ['f', 've', 'ff']], - - // axes (axis), axes (ax), axes (axe) - ['sexa', 4, false, false, ['ax', 'axe', 'axis']], - - // indexes (index), matrixes (matrix) - ['sex', 3, true, false, 'x'], - - // quizzes (quiz) - ['sezz', 4, true, false, 'z'], - - // bureaus (bureau) - ['suae', 4, false, true, 'eau'], - - // fees (fee), trees (tree), employees (employee) - ['see', 3, true, true, 'ee'], - - // edges (edge) - ['segd', 4, true, true, 'dge'], - - // roses (rose), garages (garage), cassettes (cassette), - // waltzes (waltz), heroes (hero), bushes (bush), arches (arch), - // shoes (shoe) - ['se', 2, true, true, ['', 'e']], - - // tags (tag) - ['s', 1, true, true, ''], - - // chateaux (chateau) - ['xuae', 4, false, true, 'eau'], - - // people (person) - ['elpoep', 6, true, true, 'person'], - ]; - - /** - * Map English singular to plural suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const SINGULAR_MAP = [ - // First entry: singular suffix, reversed - // Second entry: length of singular suffix - // Third entry: Whether the suffix may succeed a vocal - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: plural suffix, normal - - // criterion (criteria) - ['airetirc', 8, false, false, 'criterion'], - - // nebulae (nebula) - ['aluben', 6, false, false, 'nebulae'], - - // children (child) - ['dlihc', 5, true, true, 'children'], - - // prices (price) - ['eci', 3, false, true, 'ices'], - - // services (service) - ['ecivres', 7, true, true, 'services'], - - // lives (life), wives (wife) - ['efi', 3, false, true, 'ives'], - - // selfies (selfie) - ['eifles', 6, true, true, 'selfies'], - - // movies (movie) - ['eivom', 5, true, true, 'movies'], - - // lice (louse) - ['esuol', 5, false, true, 'lice'], - - // mice (mouse) - ['esuom', 5, false, true, 'mice'], - - // geese (goose) - ['esoo', 4, false, true, 'eese'], - - // houses (house), bases (base) - ['es', 2, true, true, 'ses'], - - // geese (goose) - ['esoog', 5, true, true, 'geese'], - - // caves (cave) - ['ev', 2, true, true, 'ves'], - - // drives (drive) - ['evird', 5, false, true, 'drives'], - - // objectives (objective), alternative (alternatives) - ['evit', 4, true, true, 'tives'], - - // moves (move) - ['evom', 4, true, true, 'moves'], - - // staves (staff) - ['ffats', 5, true, true, 'staves'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['ff', 2, true, true, 'ffs'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['f', 1, true, true, ['fs', 'ves']], - - // arches (arch) - ['hc', 2, true, true, 'ches'], - - // bushes (bush) - ['hs', 2, true, true, 'shes'], - - // teeth (tooth) - ['htoot', 5, true, true, 'teeth'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['mu', 2, true, true, 'a'], - - // men (man), women (woman) - ['nam', 3, true, true, 'men'], - - // people (person) - ['nosrep', 6, true, true, ['persons', 'people']], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['noi', 3, true, true, 'ions'], - - // coupon (coupons) - ['nop', 3, true, true, 'pons'], - - // seasons (season), treasons (treason), poisons (poison), lessons (lesson) - ['nos', 3, true, true, 'sons'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['no', 2, true, true, 'a'], - - // echoes (echo) - ['ohce', 4, true, true, 'echoes'], - - // heroes (hero) - ['oreh', 4, true, true, 'heroes'], - - // atlases (atlas) - ['salta', 5, true, true, 'atlases'], - - // irises (iris) - ['siri', 4, true, true, 'irises'], - - // analyses (analysis), ellipses (ellipsis), neuroses (neurosis) - // theses (thesis), emphases (emphasis), oases (oasis), - // crises (crisis) - ['sis', 3, true, true, 'ses'], - - // accesses (access), addresses (address), kisses (kiss) - ['ss', 2, true, false, 'sses'], - - // syllabi (syllabus) - ['suballys', 8, true, true, 'syllabi'], - - // buses (bus) - ['sub', 3, true, true, 'buses'], - - // circuses (circus) - ['suc', 3, true, true, 'cuses'], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sutcep', 6, true, true, 'pectuses'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['su', 2, true, true, 'i'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // feet (foot) - ['toof', 4, true, true, 'feet'], - - // chateaux (chateau), bureaus (bureau) - ['uae', 3, false, true, ['eaus', 'eaux']], - - // oxen (ox) - ['xo', 2, false, false, 'oxen'], - - // hoaxes (hoax) - ['xaoh', 4, true, false, 'hoaxes'], - - // indices (index) - ['xedni', 5, false, true, ['indicies', 'indexes']], - - // boxes (box) - ['xo', 2, false, true, 'oxes'], - - // indexes (index), matrixes (matrix) - ['x', 1, true, false, ['cies', 'xes']], - - // appendices (appendix) - ['xi', 2, false, true, 'ices'], - - // babies (baby) - ['y', 1, false, true, 'ies'], - - // quizzes (quiz) - ['ziuq', 4, true, false, 'quizzes'], - - // waltzes (waltz) - ['z', 1, true, true, 'zes'], - ]; - - /** - * A list of words which should not be inflected, reversed. - */ - private const UNINFLECTED = [ - '', - - // data - 'atad', - - // deer - 'reed', - - // feedback - 'kcabdeef', - - // fish - 'hsif', - - // info - 'ofni', - - // moose - 'esoom', - - // series - 'seires', - - // sheep - 'peehs', - - // species - 'seiceps', - ]; - - /** - * {@inheritdoc} - */ - public function singularize(string $plural): array - { - $pluralRev = strrev($plural); - $lowerPluralRev = strtolower($pluralRev); - $pluralLength = \strlen($lowerPluralRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerPluralRev, self::UNINFLECTED, true)) { - return [$plural]; - } - - // The outer loop iterates over the entries of the plural table - // The inner loop $j iterates over the characters of the plural suffix - // in the plural table to compare them with the characters of the actual - // given plural suffix - foreach (self::PLURAL_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the plural table and of the suffix of the - // given plural one by one - while ($suffix[$j] === $lowerPluralRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the singular suffix to the singular array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $pluralLength) { - $nextIsVocal = false !== strpos('aeiou', $lowerPluralRev[$j]); - - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one - break; - } - - if (!$map[3] && !$nextIsVocal) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($plural, 0, $pluralLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the plural suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($pluralRev[$j - 1]); - - if (\is_array($newSuffix)) { - $singulars = []; - - foreach ($newSuffix as $newSuffixEntry) { - $singulars[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $singulars; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $pluralLength) { - break; - } - } - } - - // Assume that plural and singular is identical - return [$plural]; - } - - /** - * {@inheritdoc} - */ - public function pluralize(string $singular): array - { - $singularRev = strrev($singular); - $lowerSingularRev = strtolower($singularRev); - $singularLength = \strlen($lowerSingularRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerSingularRev, self::UNINFLECTED, true)) { - return [$singular]; - } - - // The outer loop iterates over the entries of the singular table - // The inner loop $j iterates over the characters of the singular suffix - // in the singular table to compare them with the characters of the actual - // given singular suffix - foreach (self::SINGULAR_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the singular table and of the suffix of the - // given plural one by one - - while ($suffix[$j] === $lowerSingularRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the plural suffix to the plural array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $singularLength) { - $nextIsVocal = false !== strpos('aeiou', $lowerSingularRev[$j]); - - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one - break; - } - - if (!$map[3] && !$nextIsVocal) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($singular, 0, $singularLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the singular suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($singularRev[$j - 1]); - - if (\is_array($newSuffix)) { - $plurals = []; - - foreach ($newSuffix as $newSuffixEntry) { - $plurals[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $plurals; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $singularLength) { - break; - } - } - } - - // Assume that plural is singular with a trailing `s` - return [$singular.'s']; - } -} diff --git a/trunk/vendor/symfony/string/Inflector/FrenchInflector.php b/trunk/vendor/symfony/string/Inflector/FrenchInflector.php deleted file mode 100644 index 612c8f2e..00000000 --- a/trunk/vendor/symfony/string/Inflector/FrenchInflector.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -/** - * French inflector. - * - * This class does only inflect nouns; not adjectives nor composed words like "soixante-dix". - */ -final class FrenchInflector implements InflectorInterface -{ - /** - * A list of all rules for pluralise. - * - * @see https://la-conjugaison.nouvelobs.com/regles/grammaire/le-pluriel-des-noms-121.php - */ - private const PLURALIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Words finishing with "s", "x" or "z" are invariables - // Les mots finissant par "s", "x" ou "z" sont invariables - ['/(s|x|z)$/i', '\1'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)$/i', '\1x'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/^(landau)$/i', '\1s'], - ['/(au)$/i', '\1x'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/^(pneu|bleu|émeu)$/i', '\1s'], - ['/(eu)$/i', '\1x'], - - // Words finishing with "al" are pluralized with a "aux" excepted - // Les mots finissant en "al" se terminent en "aux" sauf - ['/^(bal|carnaval|caracal|chacal|choral|corral|étal|festival|récital|val)$/i', '\1s'], - ['/al$/i', '\1aux'], - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/^(aspir|b|cor|ém|ferm|soupir|trav|vant|vitr)ail$/i', '\1aux'], - - // Bijou, caillou, chou, genou, hibou, joujou et pou qui prennent un x au pluriel - ['/^(bij|caill|ch|gen|hib|jouj|p)ou$/i', '\1oux'], - - // Invariable words - ['/^(cinquante|soixante|mille)$/i', '\1'], - - // French titles - ['/^(mon|ma)(sieur|dame|demoiselle|seigneur)$/', 'mes\2s'], - ['/^(Mon|Ma)(sieur|dame|demoiselle|seigneur)$/', 'Mes\2s'], - ]; - - /** - * A list of all rules for singularize. - */ - private const SINGULARIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/((aspir|b|cor|ém|ferm|soupir|trav|vant|vitr))aux$/i', '\1ail'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)x$/i', '\1'], - - // Words finishing with "al" are pluralized with a "aux" expected - // Les mots finissant en "al" se terminent en "aux" sauf - ['/(amir|anim|arsen|boc|can|capit|capor|chev|crist|génér|hopit|hôpit|idé|journ|littor|loc|m|mét|minér|princip|radic|termin)aux$/i', '\1al'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/(au)x$/i', '\1'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/(eu)x$/i', '\1'], - - // Words finishing with "ou" are pluralized with a "s" excepted bijou, caillou, chou, genou, hibou, joujou, pou - // Les mots finissant par "ou" prennent un "s" sauf bijou, caillou, chou, genou, hibou, joujou, pou - ['/(bij|caill|ch|gen|hib|jouj|p)oux$/i', '\1ou'], - - // French titles - ['/^mes(dame|demoiselle)s$/', 'ma\1'], - ['/^Mes(dame|demoiselle)s$/', 'Ma\1'], - ['/^mes(sieur|seigneur)s$/', 'mon\1'], - ['/^Mes(sieur|seigneur)s$/', 'Mon\1'], - - // Default rule - ['/s$/i', ''], - ]; - - /** - * A list of words which should not be inflected. - * This list is only used by singularize. - */ - private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sans|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i'; - - /** - * {@inheritdoc} - */ - public function singularize(string $plural): array - { - if ($this->isInflectedWord($plural)) { - return [$plural]; - } - - foreach (self::SINGULARIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $plural)) { - return [preg_replace($regexp, $replace, $plural)]; - } - } - - return [$plural]; - } - - /** - * {@inheritdoc} - */ - public function pluralize(string $singular): array - { - if ($this->isInflectedWord($singular)) { - return [$singular]; - } - - foreach (self::PLURALIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $singular)) { - return [preg_replace($regexp, $replace, $singular)]; - } - } - - return [$singular.'s']; - } - - private function isInflectedWord(string $word): bool - { - return 1 === preg_match(self::UNINFLECTED, $word); - } -} diff --git a/trunk/vendor/symfony/string/Inflector/InflectorInterface.php b/trunk/vendor/symfony/string/Inflector/InflectorInterface.php deleted file mode 100644 index 67f28340..00000000 --- a/trunk/vendor/symfony/string/Inflector/InflectorInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -interface InflectorInterface -{ - /** - * Returns the singular forms of a string. - * - * If the method can't determine the form with certainty, several possible singulars are returned. - * - * @return string[] - */ - public function singularize(string $plural): array; - - /** - * Returns the plural forms of a string. - * - * If the method can't determine the form with certainty, several possible plurals are returned. - * - * @return string[] - */ - public function pluralize(string $singular): array; -} diff --git a/trunk/vendor/symfony/string/LICENSE b/trunk/vendor/symfony/string/LICENSE deleted file mode 100644 index 5c7ba055..00000000 --- a/trunk/vendor/symfony/string/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2019-2023 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/trunk/vendor/symfony/string/LazyString.php b/trunk/vendor/symfony/string/LazyString.php deleted file mode 100644 index 37330782..00000000 --- a/trunk/vendor/symfony/string/LazyString.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -/** - * A string whose value is computed lazily by a callback. - * - * @author Nicolas Grekas - */ -class LazyString implements \Stringable, \JsonSerializable -{ - private \Closure|string $value; - - /** - * @param callable|array $callback A callable or a [Closure, method] lazy-callable - */ - public static function fromCallable(callable|array $callback, mixed ...$arguments): static - { - if (\is_array($callback) && !\is_callable($callback) && !(($callback[0] ?? null) instanceof \Closure || 2 < \count($callback))) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); - } - - $lazyString = new static(); - $lazyString->value = static function () use (&$callback, &$arguments, &$value): string { - if (null !== $arguments) { - if (!\is_callable($callback)) { - $callback[0] = $callback[0](); - $callback[1] = $callback[1] ?? '__invoke'; - } - $value = $callback(...$arguments); - $callback = self::getPrettyName($callback); - $arguments = null; - } - - return $value ?? ''; - }; - - return $lazyString; - } - - public static function fromStringable(string|int|float|bool|\Stringable $value): static - { - if (\is_object($value)) { - return static::fromCallable([$value, '__toString']); - } - - $lazyString = new static(); - $lazyString->value = (string) $value; - - return $lazyString; - } - - /** - * Tells whether the provided value can be cast to string. - */ - final public static function isStringable(mixed $value): bool - { - return \is_string($value) || $value instanceof \Stringable || \is_scalar($value); - } - - /** - * Casts scalars and stringable objects to strings. - * - * @throws \TypeError When the provided value is not stringable - */ - final public static function resolve(\Stringable|string|int|float|bool $value): string - { - return $value; - } - - public function __toString(): string - { - if (\is_string($this->value)) { - return $this->value; - } - - try { - return $this->value = ($this->value)(); - } catch (\Throwable $e) { - if (\TypeError::class === \get_class($e) && __FILE__ === $e->getFile()) { - $type = explode(', ', $e->getMessage()); - $type = substr(array_pop($type), 0, -\strlen(' returned')); - $r = new \ReflectionFunction($this->value); - $callback = $r->getStaticVariables()['callback']; - - $e = new \TypeError(sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); - } - - throw $e; - } - } - - public function __sleep(): array - { - $this->__toString(); - - return ['value']; - } - - public function jsonSerialize(): string - { - return $this->__toString(); - } - - private function __construct() - { - } - - private static function getPrettyName(callable $callback): string - { - if (\is_string($callback)) { - return $callback; - } - - if (\is_array($callback)) { - $class = \is_object($callback[0]) ? get_debug_type($callback[0]) : $callback[0]; - $method = $callback[1]; - } elseif ($callback instanceof \Closure) { - $r = new \ReflectionFunction($callback); - - if (false !== strpos($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { - return $r->name; - } - - $class = $class->name; - $method = $r->name; - } else { - $class = get_debug_type($callback); - $method = '__invoke'; - } - - return $class.'::'.$method; - } -} diff --git a/trunk/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/trunk/vendor/symfony/string/Resources/data/wcswidth_table_wide.php deleted file mode 100644 index 5a647e67..00000000 --- a/trunk/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ /dev/null @@ -1,1143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -if (!\function_exists(u::class)) { - function u(?string $string = ''): UnicodeString - { - return new UnicodeString($string ?? ''); - } -} - -if (!\function_exists(b::class)) { - function b(?string $string = ''): ByteString - { - return new ByteString($string ?? ''); - } -} - -if (!\function_exists(s::class)) { - /** - * @return UnicodeString|ByteString - */ - function s(?string $string = ''): AbstractString - { - $string = $string ?? ''; - - return preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); - } -} diff --git a/trunk/vendor/symfony/string/Slugger/AsciiSlugger.php b/trunk/vendor/symfony/string/Slugger/AsciiSlugger.php deleted file mode 100644 index 548a6b93..00000000 --- a/trunk/vendor/symfony/string/Slugger/AsciiSlugger.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Slugger; - -use Symfony\Component\String\AbstractUnicodeString; -use Symfony\Component\String\UnicodeString; -use Symfony\Contracts\Translation\LocaleAwareInterface; - -if (!interface_exists(LocaleAwareInterface::class)) { - throw new \LogicException('You cannot use the "Symfony\Component\String\Slugger\AsciiSlugger" as the "symfony/translation-contracts" package is not installed. Try running "composer require symfony/translation-contracts".'); -} - -/** - * @author Titouan Galopin - */ -class AsciiSlugger implements SluggerInterface, LocaleAwareInterface -{ - private const LOCALE_TO_TRANSLITERATOR_ID = [ - 'am' => 'Amharic-Latin', - 'ar' => 'Arabic-Latin', - 'az' => 'Azerbaijani-Latin', - 'be' => 'Belarusian-Latin', - 'bg' => 'Bulgarian-Latin', - 'bn' => 'Bengali-Latin', - 'de' => 'de-ASCII', - 'el' => 'Greek-Latin', - 'fa' => 'Persian-Latin', - 'he' => 'Hebrew-Latin', - 'hy' => 'Armenian-Latin', - 'ka' => 'Georgian-Latin', - 'kk' => 'Kazakh-Latin', - 'ky' => 'Kirghiz-Latin', - 'ko' => 'Korean-Latin', - 'mk' => 'Macedonian-Latin', - 'mn' => 'Mongolian-Latin', - 'or' => 'Oriya-Latin', - 'ps' => 'Pashto-Latin', - 'ru' => 'Russian-Latin', - 'sr' => 'Serbian-Latin', - 'sr_Cyrl' => 'Serbian-Latin', - 'th' => 'Thai-Latin', - 'tk' => 'Turkmen-Latin', - 'uk' => 'Ukrainian-Latin', - 'uz' => 'Uzbek-Latin', - 'zh' => 'Han-Latin', - ]; - - private ?string $defaultLocale; - private \Closure|array $symbolsMap = [ - 'en' => ['@' => 'at', '&' => 'and'], - ]; - - /** - * Cache of transliterators per locale. - * - * @var \Transliterator[] - */ - private array $transliterators = []; - - public function __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null) - { - $this->defaultLocale = $defaultLocale; - $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; - } - - /** - * {@inheritdoc} - */ - public function setLocale(string $locale) - { - $this->defaultLocale = $locale; - } - - /** - * {@inheritdoc} - */ - public function getLocale(): string - { - return $this->defaultLocale; - } - - /** - * {@inheritdoc} - */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString - { - $locale = $locale ?? $this->defaultLocale; - - $transliterator = []; - if ($locale && ('de' === $locale || 0 === strpos($locale, 'de_'))) { - // Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl) - $transliterator = ['de-ASCII']; - } elseif (\function_exists('transliterator_transliterate') && $locale) { - $transliterator = (array) $this->createTransliterator($locale); - } - - if ($this->symbolsMap instanceof \Closure) { - // If the symbols map is passed as a closure, there is no need to fallback to the parent locale - // as the closure can just provide substitutions for all locales of interest. - $symbolsMap = $this->symbolsMap; - array_unshift($transliterator, static function ($s) use ($symbolsMap, $locale) { - return $symbolsMap($s, $locale); - }); - } - - $unicodeString = (new UnicodeString($string))->ascii($transliterator); - - if (\is_array($this->symbolsMap)) { - $map = null; - if (isset($this->symbolsMap[$locale])) { - $map = $this->symbolsMap[$locale]; - } else { - $parent = self::getParentLocale($locale); - if ($parent && isset($this->symbolsMap[$parent])) { - $map = $this->symbolsMap[$parent]; - } - } - if ($map) { - foreach ($map as $char => $replace) { - $unicodeString = $unicodeString->replace($char, ' '.$replace.' '); - } - } - } - - return $unicodeString - ->replaceMatches('/[^A-Za-z0-9]++/', $separator) - ->trim($separator) - ; - } - - private function createTransliterator(string $locale): ?\Transliterator - { - if (\array_key_exists($locale, $this->transliterators)) { - return $this->transliterators[$locale]; - } - - // Exact locale supported, cache and return - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$locale] ?? null) { - return $this->transliterators[$locale] = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - // Locale not supported and no parent, fallback to any-latin - if (!$parent = self::getParentLocale($locale)) { - return $this->transliterators[$locale] = null; - } - - // Try to use the parent locale (ie. try "de" for "de_AT") and cache both locales - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$parent] ?? null) { - $transliterator = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - return $this->transliterators[$locale] = $this->transliterators[$parent] = $transliterator ?? null; - } - - private static function getParentLocale(?string $locale): ?string - { - if (!$locale) { - return null; - } - if (false === $str = strrchr($locale, '_')) { - // no parent locale - return null; - } - - return substr($locale, 0, -\strlen($str)); - } -} diff --git a/trunk/vendor/symfony/string/Slugger/SluggerInterface.php b/trunk/vendor/symfony/string/Slugger/SluggerInterface.php deleted file mode 100644 index c679ed93..00000000 --- a/trunk/vendor/symfony/string/Slugger/SluggerInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Slugger; - -use Symfony\Component\String\AbstractUnicodeString; - -/** - * Creates a URL-friendly slug from a given string. - * - * @author Titouan Galopin - */ -interface SluggerInterface -{ - /** - * Creates a slug for the given string and locale, using appropriate transliteration when needed. - */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString; -} diff --git a/trunk/vendor/symfony/string/UnicodeString.php b/trunk/vendor/symfony/string/UnicodeString.php deleted file mode 100644 index 70cf4c54..00000000 --- a/trunk/vendor/symfony/string/UnicodeString.php +++ /dev/null @@ -1,358 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode grapheme clusters encoded as UTF-8. - * - * A letter followed by combining characters (accents typically) form what Unicode defines - * as a grapheme cluster: a character as humans mean it in written texts. This class knows - * about the concept and won't split a letter apart from its combining accents. It also - * ensures all string comparisons happen on their canonically-composed representation, - * ignoring e.g. the order in which accents are listed when a letter has many of them. - * - * @see https://unicode.org/reports/tr15/ - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class UnicodeString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - $this->string = normalizer_is_normalized($string) ? $string : normalizer_normalize($string); - - if (false === $this->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '\X{65535}'; - $length -= 65535; - } - $rx .= '\X{'.$length.'})/u'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($suffix, $form) ?: $suffix = normalizer_normalize($suffix, $form); - - if ('' === $suffix || false === $suffix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)), $suffix, 0, 'UTF-8'); - } - - return $suffix === grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($string, $form) ?: $string = normalizer_normalize($string, $form); - - if ('' !== $string && false !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - try { - $i = $this->ignoreCase ? grapheme_stripos($this->string, $needle, $offset) : grapheme_strpos($this->string, $needle, $offset); - } catch (\ValueError $e) { - return null; - } - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - $string = $this->string; - - if (0 > $offset) { - // workaround https://bugs.php.net/74264 - if (0 > $offset += grapheme_strlen($needle)) { - $string = grapheme_substr($string, 0, $offset); - } - $offset = 0; - } - - $i = $this->ignoreCase ? grapheme_strripos($string, $needle, $offset) : grapheme_strrpos($string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function join(array $strings, string $lastGlue = null): static - { - $str = parent::join($strings, $lastGlue); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function length(): int - { - return grapheme_strlen($this->string); - } - - public function normalize(int $form = self::NFC): static - { - $str = clone $this; - - if (\in_array($form, [self::NFC, self::NFKC], true)) { - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - } elseif (!\in_array($form, [self::NFD, self::NFKD], true)) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } elseif (!normalizer_is_normalized($str->string, $form)) { - $str->string = normalizer_normalize($str->string, $form); - $str->ignoreCase = null; - } - - return $str; - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - normalizer_is_normalized($from) ?: $from = normalizer_normalize($from); - - if ('' !== $from && false !== $from) { - $tail = $str->string; - $result = ''; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while ('' !== $tail && false !== $i = $indexOf($tail, $from)) { - $slice = grapheme_substr($tail, 0, $i); - $result .= $slice.$to; - $tail = substr($tail, \strlen($slice) + \strlen($from)); - } - - $str->string = $result.$tail; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - $str = parent::replaceMatches($fromRegexp, $to); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function slice(int $start = 0, int $length = null): static - { - $str = clone $this; - - $str->string = (string) grapheme_substr($this->string, $start, $length ?? 2147483647); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): static - { - $str = clone $this; - - $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; - $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit = $limit ?? 2147483647) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - normalizer_is_normalized($delimiter) ?: $delimiter = normalizer_normalize($delimiter); - - if (false === $delimiter) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $tail = $this->string; - $chunks = []; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while (1 < $limit && false !== $i = $indexOf($tail, $delimiter)) { - $str->string = grapheme_substr($tail, 0, $i); - $chunks[] = clone $str; - $tail = substr($tail, \strlen($str->string) + \strlen($delimiter)); - --$limit; - } - - $str->string = $tail; - $chunks[] = clone $str; - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($prefix, $form) ?: $prefix = normalizer_normalize($prefix, $form); - - if ('' === $prefix || false === $prefix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES), $prefix, 0, 'UTF-8'); - } - - return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); - } - - public function __wakeup() - { - if (!\is_string($this->string)) { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - public function __clone() - { - if (null === $this->ignoreCase) { - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - $this->ignoreCase = false; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/CHANGELOG.md b/trunk/vendor/wp-coding-standards/wpcs/CHANGELOG.md deleted file mode 100644 index c31047a3..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/CHANGELOG.md +++ /dev/null @@ -1,1654 +0,0 @@ -# Change Log for WordPress Coding Standards - -All notable changes to this project will be documented in this file. - -This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). - -## [Unreleased] - -_No documentation available about unreleased changes as of yet._ - -## [3.1.0] - 2024-03-25 - -### Added -- WordPress-Core ruleset: now includes the `Universal.PHP.LowercasePHPTag` sniff. -- WordPress-Extra ruleset: now includes the `Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence` and the `Universal.CodeAnalysis.NoDoubleNegative` sniffs. -- The `sanitize_locale_name()` function to the list of known "escaping" functions. Props [@Chouby] -- The `sanitize_locale_name()` function to the list of known "sanitize & unslash" functions. Props [@Chouby] - -### Changed - -- The minimum required `PHP_CodeSniffer` version to 3.9.0 (was 3.7.2). -- The minimum required `PHPCSUtils` version to 1.0.10 (was 1.0.8). -- The minimum required `PHPCSExtra` version to 1.2.1 (was 1.1.0). - Please ensure you run `composer update wp-coding-standards/wpcs --with-dependencies` to benefit from these updates. -- Core ruleset: the spacing after the `use` keyword for closure `use` statements will now consistently be checked. Props [@westonruter] for reporting. -- The default value for `minimum_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#various-sniffs-set-the-minimum-supported-wp-version), has been updated to `6.2`. -- `WordPress.NamingConventions.PrefixAllGlobals` has been updated to recognize pluggable functions introduced in WP 6.4 and 6.5. -- `WordPress.NamingConventions.ValidPostTypeSlug` has been updated to recognize reserved post types introduced in WP 6.4 and 6.5. -- `WordPress.WP.ClassNameCase` has been updated to recognize classes introduced in WP 6.4 and 6.5. -- `WordPress.WP.DeprecatedClasses` now detects classes deprecated in WordPress up to WP 6.5. -- `WordPress.WP.DeprecatedFunctions` now detects functions deprecated in WordPress up to WP 6.5. -- The `IsUnitTestTrait` will now recognize classes which extend the new WP Core `WP_Font_Face_UnitTestCase` class as test classes. -- The test suite can now run on PHPUnit 4.x - 9.x (was 4.x - 7.x), which should make contributing more straight forward. -- Various housekeeping, includes a contribution from [@rodrigoprimo]. - -### Fixed - -- `WordPress.WP.PostsPerPage` could potentially result in an `Internal.Exception` when encountering a query string which doesn't include the value for `posts_per_page` in the query string. Props [@anomiex] for reporting. - - -## [3.0.1] - 2023-09-14 - -### Added - -- In WordPressCS 3.0.0, the functionality of the `WordPress.Security.EscapeOutput` sniff was updated to report unescaped message parameters passed to exceptions created in `throw` statements. This specific violation now has a separate error code: `ExceptionNotEscaped`. This will allow users to ignore or exclude that specific error code. Props [@anomiex]. - The error code(s) for other escaping issues flagged by the sniff remain unchanged. - -### Changed - -- Updated the CI workflow to test the example ruleset for issues. -- Funding files and updates in the Readme about funding the project. - -### Fixed - -- Fixed a sniff name in the `phpcs.xml.dist.sample` file (case-sensitive sniff name). Props [@dawidurbanski]. - - -## [3.0.0] - 2023-08-21 - -### Important information about this release: - -At long last... WordPressCS 3.0.0 is here. - -This is an important release which makes significant changes to improve the accuracy, performance, stability and maintainability of all sniffs, as well as making WordPressCS much better at handling modern PHP. - -WordPressCS 3.0.0 contains breaking changes, both for people using ignore annotations, people maintaining custom rulesets, as well as for sniff developers who maintain a custom PHPCS standard based on WordPressCS. - -If you are an end-user or maintain a custom WordPressCS based ruleset, please start by reading the [Upgrade Guide to WordPressCS 3.0.0 for end-users](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-end-users) which lists the most important changes and contains a step by step guide for upgrading. - -If you are a maintainer of an external standard based on WordPressCS and any of your custom sniffs are based on or extend WordPressCS sniffs, please read the [Upgrade Guide to WordPressCS 3.0.0 for Developers](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards). - -In all cases, please read the complete changelog carefully before you upgrade. - - -### Added - -- Dependencies on the following packages: [PHPCSUtils](https://phpcsutils.com/), [PHPCSExtra](https://github.com/PHPCSStandards/PHPCSExtra) and the [Composer PHPCS plugin]. -- A best effort has been made to add support for the new PHP syntaxes/features to all WordPressCS native sniffs and utility functions (or to verify/improve existing support). - While support in external sniffs used by WordPressCS has not be exhaustively verified, a lot of work has been done to try and add support for new PHP syntaxes to those as well. - WordPressCS native sniffs and utilities have received fixes for the following syntaxes: - * PHP 7.2 - - Keyed lists. - * PHP 7.3 - - Flexible heredoc/nowdoc (providing the PHPCS scan is run on PHP 7.3 or higher). - - Trailing commas in function calls. - * PHP 7.4 - - Arrow functions. - - Array unpacking in array expressions. - - Numeric literals with underscores. - - Typed properties. - - Null coalesce equals operator. - * PHP 8.0 - - Nullsafe object operators. - - Match expressions. - - Named arguments in function calls. - - Attributes. - - Union types // including supporting the `false` and `null` types. - - Constructor property promotion. - - `$object::class` - - Throw as an expression. - * PHP 8.1 - - Enumerations. - - Explicit octal notation. - - Final class constants - - First class callables. - - Intersection types. - * PHP 8.2 - - Constants in traits. -- New `WordPress.CodeAnalysis.AssignmentInTernaryCondition` sniff to the `WordPress-Core` ruleset which partially replaces the removed `WordPress.CodeAnalysis.AssignmentInCondition` sniff. -- New `WordPress.WhiteSpace.ObjectOperatorSpacing` sniff which replaces the use of the `Squiz.WhiteSpace.ObjectOperatorSpacing` sniff in the `WordPress-Core` ruleset. -- New `WordPress.WP.ClassNameCase` sniff to the `WordPress-Core` ruleset, to check that any class name references to WP native classes and classes from external dependencies use the case of the class as per the class declaration. -- New `WordPress.WP.Capabilities` sniff to the `WordPress-Extra` ruleset. This sniff checks that valid capabilities are used, not roles or user levels. Props, amongst others, to [@grappler] and [@khacoder]. - Custom capabilities can be added to the sniff via a `custom_capabilities` ruleset property. - The sniff also supports the `minimum_wp_version` property to allow the sniff to accurately determine how the use of deprecated capabilities should be flagged. -- The `WordPress.WP.CapitalPDangit` sniff contains a new check to verify the correct spelling of `WordPress` in namespace names. -- The `WordPress.WP.I18n` sniff contains a new `EmptyTextDomain` error code for an empty text string being passed as the text domain, which overrules the default value of the parameter and renders a text untranslatable. -- The `WordPress.DB.PreparedSQLPlaceholders` sniff has been expanded with additional checks for the correct use of the `%i` placeholder, which was introduced in WP 6.2. Props [@craigfrancis]. - The sniff now also supports the `minimum_wp_version` ruleset property to determine whether the `%i` placeholder can be used. -- `WordPress-Core`: the following additional sniffs (or select error codes from these sniffs) have been added to the ruleset: `Generic.CodeAnalysis.AssignmentInCondition`, `Generic.CodeAnalysis.EmptyPHPStatement` (replaces the WordPressCS native sniff), `Generic.VersionControl.GitMergeConflict`, `Generic.WhiteSpace.IncrementDecrementSpacing`, `Generic.WhiteSpace.LanguageConstructSpacing`, `Generic.WhiteSpace.SpreadOperatorSpacingAfter`, `PSR2.Classes.ClassDeclaration`, `PSR2.Methods.FunctionClosingBrace`, `PSR12.Classes.ClassInstantiation`, `PSR12.Files.FileHeader` (select error codes only), `PSR12.Functions.NullableTypeDeclaration`, `PSR12.Functions.ReturnTypeDeclaration`, `PSR12.Traits.UseDeclaration`, `Squiz.Functions.MultiLineFunctionDeclaration` (replaces part of the `WordPress.WhiteSpace.ControlStructureSpacing` sniff), `Modernize.FunctionCalls.Dirname`, `NormalizedArrays.Arrays.ArrayBraceSpacing` (replaces part of the `WordPress.Arrays.ArrayDeclarationSpacing` sniff), `NormalizedArrays.Arrays.CommaAfterLast` (replaces the WordPressCS native sniff), `Universal.Classes.ModifierKeywordOrder`, `Universal.Classes.RequireAnonClassParentheses`, `Universal.Constants.LowercaseClassResolutionKeyword`, `Universal.Constants.ModifierKeywordOrder`, `Universal.Constants.UppercaseMagicConstants`, `Universal.Namespaces.DisallowCurlyBraceSyntax`, `Universal.Namespaces.DisallowDeclarationWithoutName`, `Universal.Namespaces.OneDeclarationPerFile`, `Universal.NamingConventions.NoReservedKeywordParameterNames`, `Universal.Operators.DisallowShortTernary` (replaces the WordPressCS native sniff), `Universal.Operators.DisallowStandalonePostIncrementDecrement`, `Universal.Operators.StrictComparisons` (replaces the WordPressCS native sniff), `Universal.Operators.TypeSeparatorSpacing`, `Universal.UseStatements.DisallowMixedGroupUse`, `Universal.UseStatements.KeywordSpacing`, `Universal.UseStatements.LowercaseFunctionConst`, `Universal.UseStatements.NoLeadingBackslash`, `Universal.UseStatements.NoUselessAliases`, `Universal.WhiteSpace.CommaSpacing`, `Universal.WhiteSpace.DisallowInlineTabs` (replaces the WordPressCS native sniff), `Universal.WhiteSpace.PrecisionAlignment` (replaces the WordPressCS native sniff), `Universal.WhiteSpace.AnonClassKeywordSpacing`. -- `WordPress-Extra`: the following additional sniffs have been added to the ruleset: `Generic.CodeAnalysis.UnusedFunctionParameter`, `Universal.Arrays.DuplicateArrayKey`, `Universal.CodeAnalysis.ConstructorDestructorReturn`, `Universal.CodeAnalysis.ForeachUniqueAssignment`, `Universal.CodeAnalysis.NoEchoSprintf`, `Universal.CodeAnalysis.StaticInFinalClass`, `Universal.ControlStructures.DisallowLonelyIf`, `Universal.Files.SeparateFunctionsFromOO`. -- `WordPress.Utils.I18nTextDomainFixer`: the `load_script_textdomain()` function to the functions the sniff looks for. -- `WordPress.WP.AlternativeFunctions`: the following PHP native functions have been added to the sniff and will now be flagged when used: `unlink()` (in a new `unlink` group) , `rename()` (in a new `rename` group), `chgrp()`, `chmod()`, `chown()`, `is_writable()` `is_writeable()`, `mkdir()`, `rmdir()`, `touch()`, `fputs()` (in the existing `file_system_operations` group, which was previously named `file_system_read`). Props [@sandeshjangam] and [@JDGrimes]. -- The `PHPUnit_Adapter_TestCase` class to the list of "known test (case) classes". -- The `antispambot()` function to the list of known "formatting" functions. -- The `esc_xml()` and `wp_kses_one_attr()` functions to the list of known "escaping" functions. -- The `wp_timezone_choice()` and `wp_readonly()` functions to the list of known "auto escaping" functions. -- The `sanitize_url()` and `wp_kses_one_attr()` functions to the list of known "sanitizing" functions. -- Metrics for blank lines at the start/end of a control structure body to the `WordPress.WhiteSpace.ControlStructureSpacing` sniff. These can be displayed using `--report=info` when the `blank_line_check` property has been set to `true`. -- End-user documentation to the following new and pre-existing sniffs: `WordPress.DateTime.RestrictedFunctions`, `WordPress.NamingConventions.PrefixAllGlobals` (props [@Ipstenu]), `WordPress.PHP.StrictInArray` (props [@marconmartins]), `WordPress.PHP.YodaConditions` (props [@Ipstenu]), `WordPress.WhiteSpace.ControlStructureSpacing` (props [@ckanitz]), `WordPress.WhiteSpace.ObjectOperatorSpacing`, `WordPress.WhiteSpace.OperatorSpacing` (props [@ckanitz]), `WordPress.WP.CapitalPDangit` (props [@NielsdeBlaauw]), `WordPress.WP.Capabilities`, `WordPress.WP.ClassNameCase`, `WordPress.WP.EnqueueResourceParameters` (props [@NielsdeBlaauw]). - This documentation can be exposed via the [`PHP_CodeSniffer` `--generator=...` command-line argument](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage). - Note: all sniffs which have been added from PHPCSExtra (Universal, Modernize, NormalizedArrays sniffs) are also fully documented. - -#### Added (internal/dev-only) -- New Helper classes: - - `ArrayWalkingFunctionsHelper` - - `ConstantsHelper` * - - `ContextHelper` * - - `DeprecationHelper` * - - `FormattingFunctionsHelper` - - `ListHelper` * - - `RulesetPropertyHelper` * - - `SnakeCaseHelper` * - - `UnslashingFunctionsHelper` - - `ValidationHelper` - - `VariableHelper` * - - `WPGlobalVariablesHelper` - - `WPHookHelper` -- New Helper traits: - - `EscapingFunctionsTrait` - - `IsUnitTestTrait` - - `MinimumWPVersionTrait` - - `PrintingFunctionsTrait` - - `SanitizationHelperTrait` * - - `WPDBTrait` - -These classes and traits mostly contain pre-existing functionality moved from the `Sniff` class. -The classes marked with an `*` are considered _internal_ and do not have any promise of future backward compatibility. - -More information is available in the [Upgrade Guide to WordPressCS 3.0.0 for Developers](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards). - - -### Changed - -- As of this version, installation via Composer is the only supported manner of installation. - Installing in a different manner (git clone/PEAR/PHAR) is still possible, but no longer supported. -- The minimum required `PHP_CodeSniffer` version to 3.7.2 (was 3.3.1). -- Composer: the package will now identify itself as a static analysis tool. -- The PHP `filter`, `libxml` and `XMLReader` extensions are now explicitly required. - It is recommended to also have the `Mbstring` and `iconv` extensions enabled for the most accurate results. -- The release branch has been renamed from `master` to `main`. -- The following sniffs have been moved from `WordPress-Extra` to `WordPress-Core`: the `Generic.Files.OneObjectStructurePerFile` (also changed from `warning` to `error`), - `Generic.PHP.BacktickOperator`, `PEAR.Files.IncludingFile`, `PSR2.Classes.PropertyDeclaration`, `PSR2.Methods.MethodDeclaration`, `Squiz.Scope.MethodScope`, `Squiz.WhiteSpace.ScopeKeywordSpacing` sniffs. Props, amongst others, to [@desrosj]. -- `WordPress-Core`: The `Generic.Arrays.DisallowShortArraySyntax` sniff has been replaced by the `Universal.Arrays.DisallowShortArraySyntax` sniff. - The new sniff will recognize short lists correctly and ignore them. -- `WordPress-Core`: The `Generic.Files.EndFileNewline` sniff has been replaced by the more comprehensive `PSR2.Files.EndFileNewline` sniff. -- A number of sniffs support setting the minimum WP version for the code being scanned. - This could be done in two different ways: - 1. By setting the `minimum_supported_version` property for each sniff from a ruleset. - 2. By passing `--runtime-set minimum_supported_wp_version #.#` on the command line. - The names of the property and the CLI setting have now been aligned to both use `minimum_wp_version` as the name. - Both ways of passing the value are still supported. -- `WordPress.NamingConventions.PrefixAllGlobals`: the `custom_test_class_whitelist` property has been renamed to `custom_test_classes`. -- `WordPress.NamingConventions.ValidVariableName`: the `customPropertiesWhitelist` property has been renamed to `allowed_custom_properties`. -- `WordPress.PHP.NoSilencedErrors`: the `custom_whitelist` property has been renamed to `customAllowedFunctionsList`. -- `WordPress.PHP.NoSilencedErrors`: the `use_default_whitelist` property has been renamed to `usePHPFunctionsList`. -- `WordPress.WP.GlobalVariablesOverride`: the `custom_test_class_whitelist` property has been renamed to `custom_test_classes`. -- Sniffs are now able to handle fully qualified names for custom test classes provided via a `custom_test_classes` (previously `custom_test_class_whitelist`) ruleset property. -- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `6.0`. -- `WordPress.NamingConventions.PrefixAllGlobals` now takes new pluggable constants into account as introduced in WordPress up to WP 6.3. -- `WordPress.NamingConventions.ValidPostTypeSlug` now takes new reserved post types into account as introduced in WordPress up to WP 6.3. -- `WordPress.WP.DeprecatedClasses` now detects classes deprecated in WordPress up to WP 6.3. -- `WordPress.WP.DeprecatedFunctions` now detects functions deprecated in WordPress up to WP 6.3. -- `WordPress.WP.DeprecatedParameters` now detects parameters deprecated in WordPress up to WP 6.3. -- `WordPress.WP.DeprecatedParameterValues` now detects parameter values deprecated in WordPress up to WP 6.3. -- `WordPress.Utils.I18nTextDomainFixer`: the lists of recognized plugin and theme header tags has been updated based on the current information in the plugin and theme handbooks. -- `WordPress.WP.AlternativeFunctions`: the "group" name `file_system_read`, which can be used with the `exclude` property, has been renamed to `file_system_operations`. - This also means that the error codes for individual functions flagged via that group have changed from `WordPress.WP.AlternativeFunctions.file_system_read_*` to `WordPress.WP.AlternativeFunctions.file_system_operations_*`. -- `WordPress.WP.CapitalPDangit`: the `Misspelled` error code has been split into two error codes - `MisspelledInText` and `MisspelledInComment` - to allow for more modular exclusions/selectively turning off the auto-fixer for the sniff. -- `WordPress.WP.I18n` no longer throws both the `MissingSingularPlaceholder` and the `MismatchedPlaceholders` for the same code, as the errors have an overlap. -- `WordPress-Core`: previously only the spacing around commas in arrays, function declarations and function calls was checked. Now, the spacing around commas will be checked in all contexts. -- `WordPress.Arrays.ArrayKeySpacingRestrictions`: a new `SpacesBetweenBrackets` error code has been introduced for the spacing between square brackets for array assignments without key. Previously, this would throw a `NoSpacesAroundArrayKeys` error with an unclear error message. -- `WordPress.Files.FileName` now recognizes more word separators, meaning that files using other word separators than underscores will now be flagged for not using hyphenation. -- `WordPress.Files.FileName` now checks if a file contains a test class and if so, will bow out. - This change was made to prevent issues with PHPUnit 9.1+, which strongly prefers PSR4-style file names. - Whether something is test class or not is based on a pre-defined list of "known" test case classes which can be extended and, optionally, a list of user provided test case classes provided via setting the `custom_test_classes` property in a custom ruleset or the complete test directory can be excluded via a custom ruleset. -- `WordPress.NamingConventions.PrefixAllGlobals` now allows for pluggable functions and classes, which should not be prefixed when "plugged". -- `WordPress.PHP.NoSilencedErrors`: the metric, which displays in the `info` report, has been renamed from "whitelisted function call" to "silencing allowed function call". -- `WordPress.Security.EscapeOutput` now flags the use of `get_search_query( false )` when generating output (as the `false` turns off the escaping). -- `WordPress.Security.EscapeOutput` now also examines parameters passed for exception creation in `throw` statements and expressions for correct escaping. -- `WordPress.Security.ValidatedSanitizedInput` now examines _all_ superglobal (except for `$GLOBALS`). Previously, the `$_SESSION` and `$_ENV` superglobals would not be flagged as needing validation/sanitization. -- `WordPress.WP.I18n` now recognizes the new PHP 8.0+ `h` and `H` type specifiers. -- `WordPress.WP.PostsPerPage` has improved recognition for numbers prefixed with a unary operator and non-decimal numbers. -- `WordPress.DB.PreparedSQL` will identify more precisely the code which is problematic. -- `WordPress.DB.PreparedSQLPlaceholders` will identify more precisely the code which is problematic. -- `WordPress.DB.SlowDBQuery` will identify more precisely the code which is problematic. -- `WordPress.Security.PluginMenuSlug`: the error will now be thrown more precisely on the code which triggered the error. Depending on code layout, this may mean that an error will now be thrown on a different line. -- `WordPress.WP.DiscouragedConstants`: the error will now be thrown more precisely on the code which triggered the error. Depending on code layout, this may mean that an error will now be thrown on a different line. -- `WordPress.WP.EnqueuedResourceParameters`: the error will now be thrown more precisely on the code which triggered the error. Depending on code layout, this may mean that an error will now be thrown on a different line. -- `WordPress.WP.I18n`: the errors will now be thrown more precisely on the code which triggered the error. Depending on code layout, this may mean that an error will now be thrown on a different line. -- `WordPress.WP.PostsPerPage` will identify more precisely the code which is problematic. -- `WordPress.PHP.TypeCasts.UnsetFound` has been changed from a `warning` to an `error` as the `(unset)` cast is no longer available in PHP 8.0 and higher. -- `WordPress.WP.EnqueuedResourceParameters.MissingVersion` has been changed from an `error` to a `warning`. -- `WordPress.Arrays.ArrayKeySpacingRestrictions`: improved the clarity of the error messages for the `TooMuchSpaceBeforeKey` and `TooMuchSpaceAfterKey` error codes. -- `WordPress.CodeAnalysis.EscapedNotTranslated`: improved the clarity of the error message. -- `WordPress.PHP.IniSet`: improved the clarity of the error messages for the sniff. -- `WordPress.PHP.PregQuoteDelimiter`: improved the clarity of the error message for the `Missing` error code. -- `WordPress.PHP.RestrictedFunctions`: improved the clarity of the error messages for the sniff. -- `WordPress.PHP.RestrictedPHPFunctions`: improved the error message for the `create_function_create_function` error code. -- `WordPress.PHP.TypeCast`: improved the clarity of the error message for the `UnsetFound` error code. It will no longer advise assigning `null`. -- `WordPress.Security.SafeRedirect`: improved the clarity of the error message. (very minor) -- `WordPress.Security.ValidatedSanitizedInput`: improved the clarity of the error messages for the `MissingUnslash` error code. -- `WordPress.WhiteSpace.CastStructureSpacing`: improved the clarity of the error message for the `NoSpaceBeforeOpenParenthesis` error code. -- `WordPress.WP.I18n`: improved the clarity of the error messages for the sniff. -- `WordPress.WP.I18n`: the error messages will now use the correct parameter name. -- The error messages for the `WordPress.CodeAnalysis.EscapedNotTranslated`, `WordPress.NamingConventions.PrefixAllGlobals`, `WordPress.NamingConventions.ValidPostTypeSlug`, `WordPress.PHP.IniSet`, and the `WordPress.PHP.NoSilencedErrors` sniff will now display the code sample found without comments and extranuous whitespace. -- Various updates to the README, the example ruleset and other documentation. Props, amongst others, to [@Luc45], [@slaFFik]. -- Continuous Integration checks are now run via GitHub Actions. Props [@desrosj]. -- Various other CI/QA improvements. -- Code coverage will now be monitored via [CodeCov](https://app.codecov.io/gh/WordPress/WordPress-Coding-Standards). -- All sniffs are now also being tested against PHP 8.0, 8.1, 8.2 and 8.3 for consistent sniff results. - -#### Changed (internal/dev-only) -- All non-abstract classes in WordPressCS are now `final` with the exception of the following four classes which are known to be extended by external PHPCS standards build on top of WordPressCS: `WordPress.NamingConventions.ValidHookName`, `WordPress.Security.EscapeOutput`,`WordPress.Security.NonceVerification`, `WordPress.Security.ValidatedSanitizedInput`. -- Most remaining utility properties and methods, previously contained in the `WordPressCS\WordPress\Sniff` class, have been moved to dedicated Helper classes and traits or, in some cases, to the sniff class using them. - As this change is only relevant for extenders, the full details of these moves are not included in this changelog, but can be found in the [Developers Upgrade Guide to WordPressCS 3.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards) -- A few customizable `public` properties, which were used by multiple sniffs, have been moved from `*Sniff` classes to traits. Again, the full details of these moves are not included in this changelog, but can be found in the [Developers Upgrade Guide to WordPressCS 3.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards) -- A number of non-public properties in sniffs have been renamed. - As this change is only relevant for extenders, the full details of these renames are not included in this changelog, but can be found in the [Developers Upgrade Guide to WordPressCS 3.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-Developers-of-external-standards) -- `AbstractFunctionRestrictionsSniff`: The `whitelist` key in the `$groups` array property has been renamed to `allow`. -- The `WordPress.NamingConventions.ValidFunctionName` sniff no longer extends the similar PHPCS native `PEAR` sniff. - - -### Removed - -- Support for the deprecated, old-style WordPressCS native ignore annotations. Use the PHPCS native selective ignore annotations instead. -- The following WordPressCS native sniffs have been removed: - - The `WordPress.Arrays.CommaAfterArrayItem` sniff (replaced by the `NormalizedArrays.Arrays.CommaAfterLast` and the `Universal.WhiteSpace.CommaSpacing` sniffs). - - The `WordPress.Classes.ClassInstantiation` sniff (replaced by the `PSR12.Classes.ClassInstantiation`, `Universal.Classes.RequireAnonClassParentheses` and `Universal.WhiteSpace.AnonClassKeywordSpacing` sniffs). - - The `WordPress.CodeAnalysis.AssignmentInCondition` sniff (replaced by the `Generic.CodeAnalysis.AssignmentInCondition` and the `WordPress.CodeAnalysis.AssignmentInTernaryCondition` sniffs). - - The `WordPress.CodeAnalysis.EmptyStatement` sniff (replaced by the `Generic.CodeAnalysis.EmptyPHPStatement` sniff). - - The `WordPress.PHP.DisallowShortTernary` sniff (replaced by the `Universal.Operators.DisallowShortTernary` sniff). - - The `WordPress.PHP.StrictComparisons` sniff (replaced by the `Universal.Operators.StrictComparisons` sniff). - - The `WordPress.WhiteSpace.DisallowInlineTabs` sniff (replaced by the `Universal.WhiteSpace.DisallowInlineTabs` sniff). - - The `WordPress.WhiteSpace.PrecisionAlignment` sniff (replaced by the `Universal.WhiteSpace.PrecisionAlignment` sniff). - - The `WordPress.WP.TimezoneChange` sniff (replaced by the `WordPress.DateTime.RestrictedFunctions` sniff). This sniff was previously already deprecated. -- `WordPress-Extra`: The `Squiz.WhiteSpace.LanguageConstructSpacing` sniff (replaced by the added, more comprehensive `Generic.WhiteSpace.LanguageConstructSpacing` sniff in the `WordPress-Core` ruleset). -- `WordPress.Arrays.ArrayDeclarationSpacing`: array brace spacing checks (replaced by the `NormalizedArrays.Arrays.ArrayBraceSpacing` sniff). -- `WordPress.WhiteSpace.ControlStructureSpacing`: checks for the spacing for function declarations (replaced by the `Squiz.Functions.MultiLineFunctionDeclaration` sniff). - Includes removal of the `spaces_before_closure_open_paren` property for this sniff. -- `WordPress.WP.I18n`: the `check_translator_comments` property. - Exclude the `WordPress.WP.I18n.MissingTranslatorsComment` and the `WordPress.WP.I18n.TranslatorsCommentWrongStyle` error codes instead. -- WordPressCS will no longer check for assigning the return value of an object instantiation by reference. - This is a PHP parse error since PHP 7.0. Use the `PHPCompatibilityWP` standard to check for PHP cross-version compatibility issues. -- The check for object instantiations will no longer check JavaScript files. -- The `WordPress.Arrays.ArrayKeySpacingRestrictions.MissingBracketCloser` error code as sniffs should not report on parse errors. -- The `WordPress.CodeAnalysis.AssignmentIn[Ternary]Condition.NonVariableAssignmentFound` error code as sniffs should not report on parse errors. -- The `Block_Supported_Styles_Test` class will no longer incorrectly be recognized as an extendable test case class. - -#### Removed (internal/dev-only) -- `AbstractArrayAssignmentRestrictionsSniff`: support for the optional `'callback'` key in the array returned by `getGroups()`. -- `WordPressCS\WordPress\PHPCSHelper` class (use the `PHPCSUtils\BackCompat\Helper` class instead). -- `WordPressCS\WordPress\Sniff::addMessage()` method (use the `PHPCSUtils\Utils\MessageHelper::addMessage()` method instead). -- `WordPressCS\WordPress\Sniff::addFixableMessage()` method (use the `PHPCSUtils\Utils\MessageHelper::addFixableMessage()` method instead). -- `WordPressCS\WordPress\Sniff::determine_namespace()` method (use the `PHPCSUtils\Utils\Namespaces::determineNamespace()` method instead). -- `WordPressCS\WordPress\Sniff::does_function_call_have_parameters()` method (use the `PHPCSUtils\Utils\PassedParameters::hasParameters()` method instead). -- `WordPressCS\WordPress\Sniff::find_array_open_close()` method (use the `PHPCSUtils\Utils\Arrays::getOpenClose()` method instead). -- `WordPressCS\WordPress\Sniff::find_list_open_close()` method (use the `PHPCSUtils\Utils\Lists::getOpenClose()` method instead). -- `WordPressCS\WordPress\Sniff::get_declared_namespace_name()` method (use the `PHPCSUtils\Utils\Namespaces::getDeclaredName()` method instead). -- `WordPressCS\WordPress\Sniff::get_function_call_parameter_count()` method (use the `PHPCSUtils\Utils\PassedParameters::getParameterCount()` method instead). -- `WordPressCS\WordPress\Sniff::get_function_call_parameters()` method (use the `PHPCSUtils\Utils\PassedParameters::getParameters()` method instead). -- `WordPressCS\WordPress\Sniff::get_function_call_parameter()` method (use the `PHPCSUtils\Utils\PassedParameters::getParameter()` method instead). -- `WordPressCS\WordPress\Sniff::get_interpolated_variables()` method (use the `PHPCSUtils\Utils\TextStrings::getEmbeds()` method instead). -- `WordPressCS\WordPress\Sniff::get_last_ptr_on_line()` method (no replacement available at this time). -- `WordPressCS\WordPress\Sniff::get_use_type()` method (use the `PHPCSUtils\Utils\UseStatements::getType()` method instead). -- `WordPressCS\WordPress\Sniff::has_whitelist_comment()` method (no replacement). -- `WordPressCS\WordPress\Sniff::$hookFunctions` property (no replacement available at this time). -- `WordPressCS\WordPress\Sniff::init()` method (no replacement). -- `WordPressCS\WordPress\Sniff::is_class_constant()` method (use the `PHPCSUtils\Utils\Scopes::isOOConstant()` method instead). -- `WordPressCS\WordPress\Sniff::is_class_property()` method (use the `PHPCSUtils\Utils\Scopes::isOOProperty()` method instead). -- `WordPressCS\WordPress\Sniff::is_foreach_as()` method (use the `PHPCSUtils\Utils\Context::inForeachCondition()` method instead). -- `WordPressCS\WordPress\Sniff::is_short_list()` method (depending on your needs, use the `PHPCSUtils\Utils\Lists::isShortList()` or the `PHPCSUtils\Utils\Arrays::isShortArray()` method instead). -- `WordPressCS\WordPress\Sniff::is_token_in_test_method()` method (no replacement available at this time). -- `WordPressCS\WordPress\Sniff::REGEX_COMPLEX_VARS` constant (use the PHPCSUtils `PHPCSUtils\Utils\TextStrings::stripEmbeds()` and `PHPCSUtils\Utils\TextStrings::getEmbeds()` methods instead). -- `WordPressCS\WordPress\Sniff::string_to_errorcode()` method (use the `PHPCSUtils\Utils\MessageHelper::stringToErrorcode()` method instead). -- `WordPressCS\WordPress\Sniff::strip_interpolated_variables()` method (use the `PHPCSUtils\Utils\TextStrings::stripEmbeds()` method instead). -- `WordPressCS\WordPress\Sniff::strip_quotes()` method (use the `PHPCSUtils\Utils\TextStrings::stripQuotes()` method instead). -- `WordPressCS\WordPress\Sniff::valid_direct_scope()` method (use the `PHPCSUtils\Utils\Scopes::validDirectScope()` method instead). -- Unused dev-only files in the (now removed) `bin` directory. - - -### Fixed - -- All sniffs which, in one way or another, check whether code represents a short list or a short array will now do so more accurately. - This fixes various false positives and false negatives. -- Sniffs supporting the `minimum_wp_version` property (previously `minimum_supported_version`) will no longer throw a "passing null to non-nullable" deprecation notice on PHP 8.1+. -- `WordPress.WhiteSpace.ControlStructureSpacing` no longer throws a `TypeError` on PHP 8.0+. -- `WordPress.NamingConventions.PrefixAllGlobals`no longer throws a "passing null to non-nullable" deprecation notice on PHP 8.1+. -- `WordPress.WP.I18n` no longer throws a "passing null to non-nullable" deprecation notice on PHP 8.1+. -- `VariableHelper::is_comparison()` (previously `Sniff::is_comparison()`): fixed risk of undefined array key notice when scanning code containing parse errors. -- `AbstractArrayAssignmentRestrictionsSniff` could previously get confused when it encountered comments in unexpected places. - This fix has a positive impact on all sniffs which are based on this abstract (2 sniffs). -- `AbstractArrayAssignmentRestrictionsSniff` no longer examines numeric string keys as PHP treats those as integer keys, which were never intended as the target of this abstract. - This fix has a positive impact on all sniffs which are based on this abstract (2 sniffs). -- `AbstractArrayAssignmentRestrictionsSniff` in case of duplicate entries, the sniff will now only examine the last value, as that's the value PHP will see. - This fix has a positive impact on all sniffs which are based on this abstract (2 sniffs). -- `AbstractArrayAssignmentRestrictionsSniff` now determines the assigned value with higher accuracy. - This fix has a positive impact on all sniffs which are based on this abstract (2 sniffs). -- `AbstractClassRestrictionsSniff` now treats the `namespace` keyword when used as an operator case-insensitively. - This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). -- `AbstractClassRestrictionsSniff` now treats the hierarchy keywords (`self`, `parent`, `static`) case-insensitively. - This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). -- `AbstractClassRestrictionsSniff` now limits itself correctly when trying to find a class name before a `::`. - This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). -- `AbstractClassRestrictionsSniff`: false negatives on class instantiation statements ending on a PHP close tag. - This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). -- `AbstractClassRestrictionsSniff`: false negatives on class instantiation statements combined with method chaining. - This fix has a positive impact on all sniffs which are based on this abstract (3 sniffs). -- `AbstractFunctionRestrictionsSniff`: false positives on function declarations when the function returns by reference. - This fix has a positive impact on all sniffs which are based on this abstract (nearly half of the WordPressCS sniffs). -- `AbstractFunctionRestrictionsSniff`: false positives on instantiation of a class with the same name as a targetted function. - This fix has a positive impact on all sniffs which are based on this abstract (nearly half of the WordPressCS sniffs). -- `AbstractFunctionRestrictionsSniff` now respects that function names in PHP are case-insensitive in more places. - This fix has a positive impact on all sniffs which are based on this abstract (nearly half of the WordPressCS sniffs). -- Various utility methods in Helper classes/traits have received fixes to correctly treat function and class names as case-insensitive. - These fixes have a positive impact on all sniffs using these methods. -- Version comparisons done by sniffs supporting the `minimum_wp_version` property (previously `minimum_supported_version`) will now be more precise. -- `WordPress.Arrays.ArrayIndentation` now ignores indentation issues for array items which are not the first thing on a line. This fixes a potential fixer conflict. -- `WordPress.Arrays.ArrayKeySpacingRestrictions`: signed positive integer keys will now be treated the same as signed negative integer keys. -- `WordPress.Arrays.ArrayKeySpacingRestrictions`: keys consisting of calculations will now be recognized more accurately. -- `WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys`: now has better protection in case of a fixer conflict. -- `WordPress.Classes.ClassInstantiation` could create parse errors when fixing a class instantiation using variable variables. This has been fixed by replacing the sniff with the `PSR12.Classes.ClassInstantiation` sniff (and some others). -- `WordPress.DB.DirectDatabaseQuery` could previously get confused when it encountered comments in unexpected places. -- `WordPress.DB.DirectDatabaseQuery` now respects that function (method) names in PHP are case-insensitive. -- `WordPress.DB.DirectDatabaseQuery` now only looks at the current statement to find a method call to the `$wpdb` object. -- `WordPress.DB.DirectDatabaseQuery` no longer warns about `TRUNCATE` queries as those cannot be cached and need a direct database query. -- `WordPress.DB.PreparedSQL` could previously get confused when it encountered comments in unexpected places. -- `WordPress.DB.PreparedSQL` now respects that function names in PHP are case-insensitive. -- `WordPress.DB.PreparedSQL` improved recognition of interpolated variables and expressions in the `$text` argument. This fixes both some false negatives as well as some false positives. -- `WordPress.DB.PreparedSQL` stricter recognition of the `$wpdb` variable in double quoted query strings. -- `WordPress.DB.PreparedSQL` false positive for floating point numbers concatenated into an SQL query. -- `WordPress.DB.PreparedSQLPlaceholders` could previously get confused when it encountered comments in unexpected places. -- `WordPress.DB.PreparedSQLPlaceholders` now respects that function names in PHP are case-insensitive. -- `WordPress.DB.PreparedSQLPlaceholders` stricter recognition of the `$wpdb` variable in double quotes query strings. -- `WordPress.DB.PreparedSQLPlaceholders` false positive when a fully qualified function call is encountered in an `implode( ', ', array_fill(...))` pattern. -- `WordPress.Files.FileName` no longer presumes a three character file extension. -- `WordPress.NamingConventions.PrefixAllGlobals` could previously get confused when it encountered comments in unexpected places in function calls which were being examined. -- `WordPress.NamingConventions.PrefixAllGlobals` now respects that function names in PHP are case-insensitive when checking whether a function declaration is polyfilling a PHP native function. -- `WordPress.NamingConventions.PrefixAllGlobals` improved false positive prevention for variable assignments via keyed lists. -- `WordPress.NamingConventions.PrefixAllGlobals` now only looks at the current statement when determining which variables were imported via a `global` statement. This prevents both false positives as well as false negatives. -- `WordPress.NamingConventions.PrefixAllGlobals` no longer gets confused over `global` statements in nested clsure/function declarations. -- `WordPress.NamingConventions.ValidFunctionName` now also checks the names of (global) functions when the declaration is nested within an OO method. -- `WordPress.NamingConventions.ValidFunctionName` no longer throws false positives for triple underscore methods. -- `WordPress.NamingConventions.ValidFunctionName` the suggested replacement names in the error message no longer remove underscores from a name in case of leading or trailing underscores, or multiple underscores in the middle of a name. -- `WordPress.NamingConventions.ValidFunctionName` the determination whether a name is in `snake_case` is now more accurate and has improved handling of non-ascii characters. -- `WordPress.NamingConventions.ValidFunctionName` now correctly recognizes a PHP4-style constructor when the class and the constructor method name contains non-ascii characters. -- `WordPress.NamingConventions.ValidHookName` no longer throws false positives when the hook name is generated via a function call and that function is passed string literals as parameters. -- `WordPress.NamingConventions.ValidHookName` now ignores parameters in a variable function call (like a call to a closure). -- `WordPress.NamingConventions.ValidPostTypeSlug` no longer throws false positives for interpolated text strings with complex embedded variables/expressions. -- `WordPress.NamingConventions.ValidVariableName` the suggested replacement names in the error message will no longer remove underscores from a name in case of leading or trailing underscores, or multiple underscores in the middle of a name. -- `WordPress.NamingConventions.ValidVariableName` the determination whether a name is in `snake_case` is now more accurate and has improved handling of non-ascii characters. -- `WordPress.NamingConventions.ValidVariableName` now examines all variables and variables in expressions in a text string containing interpolation. -- `WordPress.NamingConventions.ValidVariableName` now has improved recognition of variables in complex embedded variables/expressions in interpolated text strings. -- `WordPress.PHP.IniSet` no longer gets confused over comments in the code when determining whether the ini value is an allowed one. -- `WordPress.PHP.NoSilencedErrors` no longer throws an error when error silencing is encountered for function calls to the PHP native `libxml_disable_entity_loader()` and `imagecreatefromwebp()` methods. -- `WordPress.PHP.StrictInArray` no longer gets confused over comments in the code when determining whether the `$strict` parameter is used. -- `WordPress.Security.EscapeOutput` no longer throws a false positive on function calls where the parameters need escaping, when no parameters are being passed. -- `WordPress.Security.EscapeOutput` no longer throws a false positive when a fully qualified function call to the `\basename()` function is encountered within a call to `_deprecated_file()`. -- `WordPress.Security.EscapeOutput` could previously get confused when it encountered comments in the `$file` parameter for `_deprecated_file()`. -- `WordPress.Security.EscapeOutput` now ignores significantly more operators which should yield more accurate results. -- `WordPress.Security.EscapeOutput` now respects that function names in PHP are case-insensitive when checking whether a printing function is being used. -- `WordPress.Security.EscapeOutput` no longer throws an `Internal.Exception` when it encounters a constant or property mirroring the name of one of the printing functions being targetted, nor will it throw false positives for those. -- `WordPress.Security.EscapeOutput` no longer incorrectly handles method calls or calls to namespaced functions mirroring the name of one of the printing functions being targetted. -- `WordPress.Security.EscapeOutput` now ignores `exit`/`die` statements without a status being passed, preventing false positives on code after the statement. -- `WordPress.Security.EscapeOutput` now has improved recognition that `print` can also be used as an expression, not only as a statement. -- `WordPress.Security.EscapeOutput` now has much, much, much more accurate handling of code involving ternary expressions and should now correctly ignore the ternary condition in all long ternaries being examined. -- `WordPress.Security.EscapeOutput` no longer disregards the ternary condition in a short ternary. -- `WordPress.Security.EscapeOutput` no longer skips over a constant or property mirroring the name of one of the (auto-)escaping/formatting functions being targeted. -- `WordPress.Security.EscapeOutput` no longer throws false positives for `*::class`, which will always evaluate to a plain string. -- `WordPress.Security.EscapeOutput` no longer throws false positives on output generating keywords encountered in an inline expression. -- `WordPress.Security.EscapeOutput` no longer throws false positives on parameters passed to `_e()` or `_ex()`, which won't be used in the output. -- `WordPress.Security.EscapeOutput` no longer throws false positives on heredocs not using interpolation. -- `WordPress.Security.NonceVerification` now respects that function names in PHP are case-insensitive when checking whether an array comparison function is being used. -- `WordPress.Security.NonceVerification` now also checks for nonce verification when the `$_FILES` superglobal is being used. -- `WordPress.Security.NonceVerification` now ignores properties named after superglobals. -- `WordPress.Security.NonceVerification` now ignores list assignments to superglobals. -- `WordPress.Security.NonceVerification` now ignores superglobals being unset. -- `WordPress.Security.ValidatedSanitizedInput` now respects that function names in PHP are case-insensitive when checking whether an array comparison function is being used. -- `WordPress.Security.ValidatedSanitizedInput` now respects that function names in PHP are case-insensitive when checking whether a variable is being validated using `[array_]key_exists()`. -- `WordPress.Security.ValidatedSanitizedInput` improved recognition of interpolated variables and expression in the text strings. This fixes some false negatives. -- `WordPress.Security.ValidatedSanitizedInput` no longer incorrectly regards an `unset()` as variable validation. -- `WordPress.Security.ValidatedSanitizedInput` no longer incorrectly regards validation in a nested scope as validation which applies to the superglobal being examined. -- `WordPress.WP.AlternativeFunctions` could previously get confused when it encountered comments in unexpected places. -- `WordPress.WP.AlternativeFunctions` now correctly takes the `minimum_wp_version` into account when determining whether a call to `parse_url()` could switch over to using `wp_parse_url()`. -- `WordPress.WP.CapitalPDangit` now skips (keyed) list assignments to prevent false positives. -- `WordPress.WP.CapitalPDangit` now always skips all array keys, not just plain text array keys. -- `WordPress.WP.CronInterval` no longer throws a `ChangeDetected` warning for interval calculations wrapped in parentheses, but for which the value for the interval is otherwise known. -- `WordPress.WP.CronInterval` no longer throws a `ChangeDetected` warning for interval calculations using fully qualified WP native time constants, but for which the value for the interval is otherwise known. -- `WordPress.WP.DeprecatedParameters` no longer throws a false positive for function calls to `comments_number()` using the fourth parameter (which was deprecated, but has been repurposed since WP 5.4). -- `WordPress.WP.DeprecatedParameters` now looks for the correct parameter in calls to the `unregister_setting()` function. -- `WordPress.WP.DeprecatedParameters` now lists the correct WP version for the deprecation of the third parameter in function calls to `get_user_option()`. -- `WordPress.WP.DiscouragedConstants` could previously get confused when it encountered comments in unexpected places. -- `WordPress.WP.EnqueuedResources` now recognizes enqueuing in a multi-line text string correctly. -- `WordPress.WP.EnqueuedResourceParameters` could previously get confused when it encountered comments in unexpected places. -- `WordPress.WP.GlobalVariablesOverride` improved false positive prevention for variable assignments via keyed lists. -- `WordPress.WP.GlobalVariablesOverride` now only looks at the current statement when determining which variables were imported via a `global` statement. This prevents both false positives as well as false negatives. -- `WordPress.WP.I18n` improved recognition of interpolated variables and expression in the `$text` argument. This fixes some false negatives. -- `WordPress.WP.I18n` no longer potentially creates parse errors when auto-fixing an `UnorderedPlaceholders*` error involving a multi-line text string. -- `WordPress.WP.I18n` no longer throws false positives for compound parameters starting with a text string, which were previously checked as if the parameter only consisted of a text string. -- `WordPress.WP.PostsPerPage` now determines the end of statement with more precision and will no longer throw a false positive for function calls on PHP 8.0+. - - -## [2.3.0] - 2020-05-14 - -### Added -- The `WordPress.WP.I18n` sniff contains a new check for translatable text strings which are wrapped in HTML tags, like `

    Translate me

    `. Those tags should be moved out of the translatable string. - Note: Translatable strings wrapped in `
    ` tags where the URL is intended to be localized will not trigger this check. - -### Changed -- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `5.1`. -- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 5.4. -- Improved grammar of an error message in the `WordPress.WP.DiscouragedFunctions` sniff. -- CI: The codebase is now - preliminary - being tested against the PHPCS 4.x development branch. - -### Fixed -- All function call detection sniffs: fixed a bug where constants with the same name as one of the targeted functions could inadvertently be recognized as if they were a called function. -- `WordPress.DB.PreparedSQL`: fixed a bug where the sniff would trigger on the namespace separator character `\\`. -- `WordPress.Security.EscapeOutput`: fixed a bug with the variable replacement in one of the error messages. - - -## [2.2.1] - 2020-02-04 - -### Added -- Metrics to the `WordPress.Arrays.CommaAfterArrayItem` sniff. These can be displayed using `--report=info`. -- The `sanitize_hex_color()` and the `sanitize_hex_color_no_hash()` functions to the `escapingFunctions` list used by the `WordPress.Security.EscapeOutput` sniff. - -### Changed -- The recommended version of the suggested [Composer PHPCS plugin] is now `^0.6`. - -### Fixed -- `WordPress.PHP.NoSilencedErrors`: depending on the custom properties set, the metrics would be different. -- `WordPress.WhiteSpace.ControlStructureSpacing`: fixed undefined index notice for closures with `use`. -- `WordPress.WP.GlobalVariablesOverride`: fixed undefined offset notice when the `treat_files_as_scoped` property would be set to `true`. -- `WordPress.WP.I18n`: fixed a _Trying to access array offset on value of type null_ error when the sniff was run on PHP 7.4 and would encounter a translation function expecting singular and plural texts for which one of these arguments was missing. - -## [2.2.0] - 2019-11-11 - -Note: The repository has moved. The new URL is https://github.com/WordPress/WordPress-Coding-Standards. -The move does not affect the package name for Packagist. This remains the same: `wp-coding-standards/wpcs`. - -### Added -- New `WordPress.DateTime.CurrentTimeTimestamp` sniff to the `WordPress-Core` ruleset, which checks against the use of the WP native `current_time()` function to retrieve a timestamp as this won't be a _real_ timestamp. Includes an auto-fixer. -- New `WordPress.DateTime.RestrictedFunctions` sniff to the `WordPress-Core` ruleset, which checks for the use of certain date/time related functions. Initially this sniff forbids the use of the PHP native `date_default_timezone_set()` and `date()` functions. -- New `WordPress.PHP.DisallowShortTernary` sniff to the `WordPress-Core` ruleset, which, as the name implies, disallows the use of short ternaries. -- New `WordPress.CodeAnalysis.EscapedNotTranslated` sniff to the `WordPress-Extra` ruleset which will warn when a text string is escaped for output, but not being translated, while the arguments passed to the function call give the impression that translation is intended. -- New `WordPress.NamingConventions.ValidPostTypeSlug` sniff to the `WordPress-Extra` ruleset which will examine calls to `register_post_type()` and throw errors when an invalid post type slug is used. -- `Generic.Arrays.DisallowShortArraySyntax` to the `WordPress-Core` ruleset. -- `WordPress.NamingConventions.PrefixAllGlobals`: the `PHP` prefix has been added to the prefix blacklist as it is reserved by PHP itself. -- The `wp_sanitize_redirect()` function to the `sanitizingFunctions` list used by the `WordPress.Security.NonceVerification`, `WordPress.Security.ValidatedSanitizedInput` and `WordPress.Security.EscapeOutput` sniffs. -- The `sanitize_key()` and the `highlight_string()` functions to the `escapingFunctions` list used by the `WordPress.Security.EscapeOutput` sniff. -- The `RECOVERY_MODE_COOKIE` constant to the list of WP Core constants which may be defined by plugins and themes and therefore don't need to be prefixed (`WordPress.NamingConventions.PrefixAllGlobals`). -- `$content_width`, `$plugin`, `$mu_plugin` and `$network_plugin` to the list of WP globals which is used by both the `WordPress.Variables.GlobalVariables` and the `WordPress.NamingConventions.PrefixAllGlobals` sniffs. -- `Sniff::is_short_list()` utility method to determine whether a _short array_ open/close token actually represents a PHP 7.1+ short list. -- `Sniff::find_list_open_close()` utility method to find the opener and closer for `list()` constructs, including short lists. -- `Sniff::get_list_variables()` utility method which will retrieve an array with the token pointers to the variables which are being assigned to in a `list()` construct. Includes support for short lists. -- `Sniff::is_function_deprecated()` static utility method to determine whether a declared function has been marked as deprecated in the function DocBlock. -- End-user documentation to the following existing sniffs: `WordPress.Arrays.ArrayIndentation`, `WordPress.Arrays.ArrayKeySpacingRestrictions`, `WordPress.Arrays.MultipleStatementAlignment`, `WordPress.Classes.ClassInstantiation`, `WordPress.NamingConventions.ValidHookName`, `WordPress.PHP.IniSet`, `WordPress.Security.SafeRedirect`, `WordPress.WhiteSpace.CastStructureSpacing`, `WordPress.WhiteSpace.DisallowInlineTabs`, `WordPress.WhiteSpace.PrecisionAlignment`, `WordPress.WP.CronInterval`, `WordPress.WP.DeprecatedClasses`, `WordPress.WP.DeprecatedFunctions`, `WordPress.WP.DeprecatedParameters`, `WordPress.WP.DeprecatedParameterValues`, `WordPress.WP.EnqueuedResources`, `WordPress.WP.PostsPerPage`. - This documentation can be exposed via the [`PHP_CodeSniffer` `--generator=...` command-line argument](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage). - -### Changed -- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `5.0`. -- The `WordPress.Arrays.ArrayKeySpacingRestrictions` sniff has two new error codes: `TooMuchSpaceBeforeKey` and `TooMuchSpaceAfterKey`. Both auto-fixable. - The sniff will now check that there is _exactly_ one space on the inside of the square brackets around the array key for non-string, non-numeric array keys. Previously, it only checked that there was whitespace, not how much whitespace. -- `WordPress.Arrays.ArrayKeySpacingRestrictions`: the fixers have been made more efficient and less fixer-conflict prone. -- `WordPress.NamingConventions.PrefixAllGlobals`: plugin/theme prefixes should be at least three characters long. A new `ShortPrefixPassed` error has been added for when the prefix passed does not comply with this rule. -- `WordPress.WhiteSpace.CastStructureSpacing` now allows for no whitespace before a cast when the cast is preceded by the spread `...` operator. This pre-empts a fixer conflict for when the spacing around the spread operator will start to get checked. -- The `WordPress.WP.DeprecatedClasses` sniff will now detect classes deprecated in WP 4.9 and WP 5.3. -- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 5.3. -- `WordPress.NamingConventions.ValidHookName` now has "cleaner" error messages and higher precision for the line on which an error is thrown. -- `WordPress.Security.EscapeOutput`: if an error refers to array access via a variable, the array index key will now be included in the error message. -- The processing of the `WordPress` ruleset by `PHP_CodeSniffer` will now be faster. -- Various minor code tweaks and clean up. -- Various minor documentation fixes. -- Documentation: updated the repo URL in all relevant places. - -### Deprecated -- The `WordPress.WP.TimezoneChange` sniff. Use the `WordPress.DateTime.RestrictedFunctions` instead. - The deprecated sniff will be removed in WPCS 3.0.0. - -### Fixed -- All sniffs in the `WordPress.Arrays` category will no longer treat _short lists_ as if they were a short array. -- The `WordPress.NamingConventions.ValidFunctionName` and the `WordPress.NamingConventions.PrefixAllGlobals` sniff will now ignore functions marked as `@deprecated`. -- Both the `WordPress.NamingConventions.PrefixAllGlobals` sniff as well as the `WordPress.WP.GlobalVariablesOverride` sniff have been updated to recognize variables being declared via (long/short) `list()` constructs and handle them correctly. -- Both the `WordPress.NamingConventions.PrefixAllGlobals` sniff as well as the `WordPress.WP.GlobalVariablesOverride` sniff will now take a limited list of WP global variables _which are intended to be overwritten by plugins/themes_ into account. - Initially this list contains the `$content_width` and the `$wp_cockneyreplace` variables. -- `WordPress.NamingConventions.ValidHookName`: will no longer examine a string array access index key as if it were a part of the hook name. -- `WordPress.Security.EscapeOutput`: will no longer trigger on the typical `basename( __FILE__ )` pattern if found as the first parameter passed to a call to `_deprecated_file()`. -- `WordPress.WP.CapitalPDangit`: now allows for the `.test` TLD in URLs. -- WPCS is now fully compatible with PHP 7.4. - Note: `PHP_CodeSniffer` itself is only compatible with PHP 7.4 from PHPCS 3.5.0 onwards. - - -## [2.1.1] - 2019-05-21 - -### Changed -- The `WordPress.WP.CapitalPDangit` will now ignore misspelled instances of `WordPress` within constant declarations. - This covers both constants declared using `defined()` as well as constants declared using the `const` keyword. -- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `4.9`. - -### Removed -- `paginate_comments_links()` from the list of auto-escaped functions `Sniff::$autoEscapedFunctions`. - This affects the `WordPress.Security.EscapeOutput` sniff. - -### Fixed -- The `$current_blog` and `$tag_ID` variables have been added to the list of WordPress global variables. - This fixes some false positives from the `WordPress.NamingConventions.PrefixAllGlobals` and the `WordPress.WP.GlobalVariablesOverride` sniffs. -- The generic `TestCase` class name has been added to the `$test_class_whitelist`. - This fixes some false positives from the `WordPress.NamingConventions.FileName`, `WordPress.NamingConventions.PrefixAllGlobals` and the `WordPress.WP.GlobalVariablesOverride` sniffs. -- The `WordPress.NamingConventions.ValidVariableName` sniff will now correctly recognize `$tag_ID` as a WordPress native, mixed-case variable. -- The `WordPress.Security.NonceVerification` sniff will now correctly recognize nonce verification within a nested closure or anonymous class. - - -## [2.1.0] - 2019-04-08 - -### Added -- New `WordPress.PHP.IniSet` sniff to the `WordPress-Extra` ruleset. - This sniff will detect calls to `ini_set()` and `ini_alter()` and warn against their use as changing configuration values at runtime leads to an unpredictable runtime environment, which can result in conflicts between core/plugins/themes. - - The sniff will not throw notices about a very limited set of "safe" ini directives. - - For a number of ini directives for which there are alternative, non-conflicting ways to achieve the same available, the sniff will throw an `error` and advise using the alternative. -- `doubleval()`, `count()` and `sizeof()` to `Sniff::$unslashingSanitizingFunctions` property. - While `count()` and its alias `sizeof()`, don't actually unslash or sanitize, the output of these functions is safe to use without unslashing or sanitizing. - This affects the `WordPress.Security.ValidatedSanitizedInput` and the `WordPress.Security.NonceVerification` sniffs. -- The new WP 5.1 `WP_UnitTestCase_Base` class to the `Sniff::$test_class_whitelist` property. -- New `Sniff::get_array_access_keys()` utility method to retrieve all array keys for a variable using multi-level array access. -- New `Sniff::is_class_object_call()`, `Sniff::is_token_namespaced()` utility methods. - These should help make the checking of whether or not a function call is a global function, method call or a namespaced function call more consistent. - This also implements allowing for the [namespace keyword being used as an operator](https://www.php.net/manual/en/language.namespaces.nsconstants.php#example-258). -- New `Sniff::is_in_function_call()` utility method to facilitate checking whether a token is (part of) a parameter passed to a specific (set of) function(s). -- New `Sniff::is_in_type_test()` utility method to determine if a variable is being type tested, along with a `Sniff::$typeTestFunctions` property containing the names of the functions this applies to. -- New `Sniff::is_in_array_comparison()` utility method to determine if a variable is (part of) a parameter in an array-value comparison, along with a `Sniff::$arrayCompareFunctions` property containing the names of the relevant functions. -- New `Sniff::$arrayWalkingFunctions` property containing the names of array functions which apply a callback to the array, but don't change the array by reference. -- New `Sniff::$unslashingFunctions` property containing the names of functions which unslash data passed to them and return the unslashed result. - -### Changed -- Moved the `WordPress.PHP.StrictComparisons`, `WordPress.PHP.StrictInArray` and the `WordPress.CodeAnalysis.AssignmentInCondition` sniff from the `WordPress-Extra` to the `WordPress-Core` ruleset. -- The `Squiz.Commenting.InlineComment.SpacingAfter` error is no longer included in the `WordPress-Docs` ruleset. -- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `4.8`. -- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 5.1. -- The `WordPress.Security.NonceVerification` sniff now allows for variable type testing, comparisons, unslashing and sanitization before the nonce check. A nonce check within the same scope, however, is still required. -- The `WordPress.Security.ValidatedSanitizedInput` sniff now allows for using a superglobal in an array-value comparison without sanitization, same as when the superglobal is used in a scalar value comparison. -- `WordPress.NamingConventions.PrefixAllGlobals`: some of the error messages have been made more explicit. -- The error messages for the `WordPress.Security.ValidatedSanitizedInput` sniff will now contain information on the index keys accessed. -- The error message for the `WordPress.Security.ValidatedSanitizedInput.InputNotValidated` has been reworded to make it more obvious what the actual issue being reported is. -- The error message for the `WordPress.Security.ValidatedSanitizedInput.MissingUnslash` has been reworded. -- The `Sniff::is_comparison()` method now has a new `$include_coalesce` parameter to allow for toggling whether the null coalesce operator should be seen as a comparison operator. Defaults to `true`. -- All sniffs are now also being tested against PHP 7.4 (unstable) for consistent sniff results. -- The recommended version of the suggested [Composer PHPCS plugin] is now `^0.5.0`. -- Various minor code tweaks and clean up. - -### Removed -- `ini_set` and `ini_alter` from the list of functions detected by the `WordPress.PHP.DiscouragedFunctions` sniff. - These are now covered via the new `WordPress.PHP.IniSet` sniff. -- `in_array()` and `array_key_exists()` from the list of `Sniff::$sanitizingFunctions`. These are now handled differently. - -### Fixed -- The `WordPress.NamingConventions.PrefixAllGlobals` sniff would underreport when global functions would be autoloaded via a Composer autoload `files` configuration. -- The `WordPress.Security.EscapeOutput` sniff will now recognize `map_deep()` for escaping the values in an array via a callback to an output escaping function. This should prevent false positives. -- The `WordPress.Security.NonceVerification` sniff will no longer inadvertently allow for a variable to be sanitized without a nonce check within the same scope. -- The `WordPress.Security.ValidatedSanitizedInput` sniff will no longer throw errors when a variable is only being type tested. -- The `WordPress.Security.ValidatedSanitizedInput` sniff will now correctly recognize the null coalesce (PHP 7.0) and null coalesce equal (PHP 7.4) operators and will now throw errors for missing unslashing and sanitization where relevant. -- The `WordPress.WP.AlternativeFunctions` sniff will no longer recommend using the WP_FileSystem when PHP native input streams, like `php://input`, or the PHP input stream constants are being read or written to. -- The `WordPress.WP.AlternativeFunctions` sniff will no longer report on usage of the `curl_version()` function. -- The `WordPress.WP.CronInterval` sniff now has improved function recognition which should lower the chance of false positives. -- The `WordPress.WP.EnqueuedResources` sniff will no longer throw false positives for inline jQuery code trying to access a stylesheet link tag. -- Various bugfixes for the `Sniff::has_nonce_check()` method: - - The method will no longer incorrectly identify methods/namespaced functions mirroring the name of WP native nonce verification functions as if they were the global functions. - This will prevent some false negatives. - - The method will now skip over nested closed scopes, such as closures and anonymous classes. This should prevent some false negatives for nonce verification being done while not in the correct scope. - - These fixes affect the `WordPress.Security.NonceVerification` sniff. -- The `Sniff::is_in_isset_or_empty()` method now also checks for usage of `array_key_exist()` and `key_exists()` and will regard these as correct ways to validate a variable. - This should prevent false positives for the `WordPress.Security.ValidatedSanitizedInput` and the `WordPress.Security.NonceVerification` sniffs. -- Various bugfixes for the `Sniff::is_sanitized()` method: - - The method presumed the WordPress coding style regarding code layout, which could lead to false positives. - - The method will no longer incorrectly identify methods/namespaced functions mirroring the name of WP/PHP native unslashing/sanitization functions as if they were the global functions. - This will prevent some false negatives. - - The method will now recognize `map_deep()` for sanitizing an array via a callback to a sanitization function. This should prevent false positives. - - The method will now recognize `stripslashes_deep()` and `stripslashes_from_strings_only()` as valid unslashing functions. This should prevent false positives. - All these fixes affect both the `WordPress.Security.ValidatedSanitizedInput` and the `WordPress.Security.NonceVerification` sniff. -- Various bugfixes for the `Sniff::is_validated()` method: - - The method did not verify correctly whether a variable being validated was the same variable as later used which could lead to false negatives. - - The method did not verify correctly whether a variable being validated had the same array index keys as the variable as later used which could lead to both false negatives as well as false positives. - - The method now also checks for usage of `array_key_exist()` and `key_exists()` and will regard these as correct ways to validate a variable. This should prevent some false positives. - - The methods will now recognize the null coalesce and the null coalesce equal operators as ways to validate a variable. This prevents some false positives. - The results from the `WordPress.Security.ValidatedSanitizedInput` sniff should be more accurate because of these fixes. -- A potential "Undefined index" notice from the `Sniff::is_assignment()` method. - - -## [2.0.0] - 2019-01-16 - -### Important information about this release: - -WordPressCS 2.0.0 contains breaking changes, both for people using custom rulesets as well as for sniff developers who maintain a custom PHPCS standard based on WordPressCS. - -Support for `PHP_CodeSniffer` 2.x has been dropped, the new minimum `PHP_CodeSniffer` version is 3.3.1. -Also, all previously deprecated sniffs, properties and methods have been removed. - -Please read the complete changelog carefully before you upgrade. - -If you are a maintainer of an external standard based on WordPressCS and any of your custom sniffs are based on or extend WPCS sniffs, please read the [Developers Upgrade Guide to WordPressCS 2.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-2.0.0-for-Developers-of-external-standards). - -### Changes since 2.0.0-RC1 - -#### Fixed - -- `WordPress-Extra`: Reverted back to including the `Squiz.WhiteSpace.LanguageConstructSpacing` sniff instead of the new `Generic.WhiteSpace.LanguageConstructSpacing` sniff as the new sniff is not (yet) available when the PEAR install of PHPCS is used. - -### Changes since 1.2.1 -For a full list of changes from the 1.2.1 version, please review the following changelog: -* https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/2.0.0-RC1 - - -## [2.0.0-RC1] - 2018-12-31 - -### Important information about this release: - -This is the first release candidate for WordPressCS 2.0.0. -WordPressCS 2.0.0 contains breaking changes, both for people using custom rulesets as well as for sniff developers who maintain a custom PHPCS standard based on WordPressCS. - -Support for `PHP_CodeSniffer` 2.x has been dropped, the new minimum `PHP_CodeSniffer` version is 3.3.1. -Also, all previously deprecated sniffs, properties and methods have been removed. - -Please read the complete changelog carefully before you upgrade. - -If you are a maintainer of an external standard based on WordPressCS and any of your custom sniffs are based on or extend WPCS sniffs, please read the [Developers Upgrade Guide to WordPressCS 2.0.0](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-2.0.0-for-Developers-of-external-standards). - -### Added -- `Generic.PHP.DiscourageGoto`, `Generic.PHP.LowerCaseType`, `Generic.WhiteSpace.ArbitraryParenthesesSpacing` and `PSR12.Keywords.ShortFormTypeKeywords` to the `WordPress-Core` ruleset. -- Checking the spacing around the `instanceof` operator to the `WordPress.WhiteSpace.OperatorSpacing` sniff. - -### Changed -- The minimum required `PHP_CodeSniffer` version to 3.3.1 (was 2.9.0). -- The namespace used by WordPressCS has been changed from `WordPress` to `WordPressCS\WordPress`. - This was not possible while `PHP_CodeSniffer` 2.x was still supported, but WordPressCS, as a good Open Source citizen, does not want to occupy the `WordPress` namespace and is releasing its use of it now this is viable. -- The `WordPress.DB.PreparedSQL` sniff used the same error code for two different errors. - The `NotPrepared` error code remains, however an additional `InterpolatedNotPrepared` error code has been added for the second error. - If you are referencing the old error code in a ruleset XML file or in inline annotations, you may need to update it. -- The `WordPress.NamingConventions.PrefixAllGlobals` sniff used the same error code for some errors as well as warnings. - The `NonPrefixedConstantFound` error code remains for the related error, but the warning will now use the new `VariableConstantNameFound` error code. - The `NonPrefixedHooknameFound` error code remains for the related error, but the warning will now use the new `DynamicHooknameFound` error code. - If you are referencing the old error codes in a ruleset XML file or in inline annotations, you may need to update these to use the new codes instead. -- `WordPress.NamingConventions.ValidVariableName`: the error messages and error codes used by this sniff have been changed for improved usability and consistency. - - The error messages will now show a suggestion for a valid alternative name for the variable. - - The `NotSnakeCaseMemberVar` error code has been renamed to `UsedPropertyNotSnakeCase`. - - The `NotSnakeCase` error code has been renamed to `VariableNotSnakeCase`. - - The `MemberNotSnakeCase` error code has been renamed to `PropertyNotSnakeCase`. - - The `StringNotSnakeCase` error code has been renamed to `InterpolatedVariableNotSnakeCase`. - If you are referencing the old error codes in a ruleset XML file or in inline annotations, you may need to update these to use the new codes instead. -- The `WordPress.Security.NonceVerification` sniff used the same error code for both an error as well as a warning. - The old error code `NoNonceVerification` is no longer used. - The `error` now uses the `Missing` error code, while the `warning` now uses the `Recommended` error code. - If you are referencing the old error code in a ruleset XML file or in inline annotations, please update these to use the new codes instead. -- The `WordPress.WP.DiscouragedConstants` sniff used to have two error codes `UsageFound` and `DeclarationFound`. - These error codes will now be prefixed by the name of the constant found to allow for more fine-grained excluding/ignoring of warnings generated by this sniff. - If you are referencing the old error codes in a ruleset XML file or in inline annotations, you may need to update these to use the new codes instead. -- The `WordPress.WP.GlobalVariablesOverride.OverrideProhibited` error code has been replaced by the `WordPress.WP.GlobalVariablesOverride.Prohibited` error code. - If you are referencing the old error code in a ruleset XML file or in inline annotations, you may need to update it. -- `WordPress-Extra`: Replaced the inclusion of the `Generic.Files.OneClassPerFile`, `Generic.Files.OneInterfacePerFile` and the `Generic.Files.OneTraitPerFile` sniffs with the new `Generic.Files.OneObjectStructurePerFile` sniff. -- `WordPress-Extra`: Replaced the inclusion of the `Squiz.WhiteSpace.LanguageConstructSpacing` sniff with the new `Generic.WhiteSpace.LanguageConstructSpacing` sniff. -- `WordPress-Extra`: Replaced the inclusion of the `Squiz.Scope.MemberVarScope` sniff with the more comprehensive `PSR2.Classes.PropertyDeclaration` sniff. -- `WordPress.NamingConventions.ValidFunctionName`: Added a unit test confirming support for interfaces extending multiple interfaces. -- `WordPress.NamingConventions.ValidVariableName`: Added unit tests confirming support for multi-variable/property declarations. -- The `get_name_suggestion()` method has been moved from the `WordPress.NamingConventions.ValidFunctionName` sniff to the base `Sniff` class, renamed to `get_snake_case_name_suggestion()` and made static. -- The rulesets are now validated against the `PHP_CodeSniffer` XSD schema. -- Updated the [custom ruleset example](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample) to use the recommended ruleset syntax for `PHP_CodeSniffer` 3.3.1+, including using the new [array property format](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.3.0) which is now supported. -- Dev: The command to run the unit tests has changed. Please see the updated instructions in the [CONTRIBUTING.md](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/.github/CONTRIBUTING.md) file. - The `bin/pre-commit` example git hook has been updated to match. Additionally a `run-tests` script has been added to the `composer.json` file for your convenience. - To facilitate this, PHPUnit has been added to `require-dev`, even though it is strictly speaking a dependency of PHPCS, not of WPCS. -- Dev: The [Composer PHPCS plugin] has been added to `require-dev`. -- Various code tweaks and clean up. -- User facing documentation, including the wiki, as well as inline documentation has been updated for all the changes contained in WordPressCS 2.0 and other recommended best practices for `PHP_CodeSniffer` 3.3.1+. - -### Deprecated -- The use of the [WordPressCS native whitelist comments](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors), which were introduced in WPCS 0.4.0, have been deprecated and support will be removed in WPCS 3.0.0. - The WordPressCS native whitelist comments will continue to work for now, but a deprecation warning will be thrown when they are encountered. - You are encouraged to upgrade our whitelist comment to use the [PHPCS native selective ignore annotations](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.2.0) as introduced in `PHP_CodeSniffer` 3.2.0, as soon as possible. - -### Removed -- Support for PHP 5.3. PHP 5.4 is the minimum requirement for `PHP_CodeSniffer` 3.x. - Includes removing any and all workarounds which were in place to still support PHP 5.3. -- Support for `PHP_CodeSniffer` < 3.3.1. - Includes removing any and all workarounds which were in place for supporting older `PHP_CodeSniffer` versions. -- The `WordPress-VIP` standard which was deprecated since WordPressCS 1.0.0. - For checking a theme/plugin for hosting on the WordPress.com VIP platform, please use the [Automattic VIP coding standards](https://github.com/Automattic/VIP-Coding-Standards) instead. -- Support for array properties set in a custom ruleset without the `type="array"` attribute. - Support for this was deprecated in WPCS 1.0.0. - If in doubt about how properties should be set in your custom ruleset, please refer to the [Customizable sniff properties](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties) wiki page which contains XML code examples for setting each and every WPCS native sniff property. - As the minimum `PHP_CodeSniffer` version is now 3.3.1, you can now also use the [new format for setting array properties](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.3.0), so this would be a great moment to review and update your custom ruleset. - Note: the ability to set select properties from the command-line as comma-delimited strings is _not_ affected by this change. -- The following sniffs have been removed outright without deprecation. - If you are referencing these sniffs in a ruleset XML file or in inline annotations, please update these to reference the replacement sniffs instead. - - `WordPress.Functions.FunctionCallSignatureNoParams` - superseded by a bug fix in the upstream `PEAR.Functions.FunctionCallSignature` sniff. - - `WordPress.PHP.DiscourageGoto` - replaced by the same sniff which is now available upstream: `Generic.PHP.DiscourageGoto`. - - `WordPress.WhiteSpace.SemicolonSpacing` - superseded by a bug fix in the upstream `Squiz.WhiteSpace.SemicolonSpacing` sniff. - - `WordPress.WhiteSpace.ArbitraryParenthesesSpacing` - replaced by the same sniff which is now available upstream: `Generic.WhiteSpace.ArbitraryParenthesesSpacing`. -- The following "base" sniffs which were previously already deprecated and turned into abstract base classes, have been removed: - - `WordPress.Arrays.ArrayAssignmentRestrictions` - use the `AbstractArrayAssignmentRestrictionsSniff` class instead. - - `WordPress.Functions.FunctionRestrictions` - use the `AbstractFunctionRestrictionsSniff` class instead. - - `WordPress.Variables.VariableRestrictions` without replacement. -- The following sniffs which were previously deprecated, have been removed: - - `WordPress.Arrays.ArrayDeclaration` - use the other sniffs in the `WordPress.Arrays` category instead. - - `WordPress.CSRF.NonceVerification` - use `WordPress.Security.NonceVerification` instead. - - `WordPress.Functions.DontExtract` - use `WordPress.PHP.DontExtract` instead. - - `WordPress.Variables.GlobalVariables` - use `WordPress.WP.GlobalVariablesOverride` instead. - - `WordPress.VIP.CronInterval` - use `WordPress.WP.CronInterval` instead. - - `WordPress.VIP.DirectDatabaseQuery` - use `WordPress.DB.DirectDatabaseQuery` instead. - - `WordPress.VIP.PluginMenuSlug` - use `WordPress.Security.PluginMenuSlug` instead. - - `WordPress.VIP.SlowDBQuery` - use `WordPress.DB.SlowDBQuery` instead. - - `WordPress.VIP.TimezoneChange` - use `WordPress.WP.TimezoneChange` instead. - - `WordPress.VIP.ValidatedSanitizedInput` - use `WordPress.Security.ValidatedSanitizedInput` instead. - - `WordPress.WP.PreparedSQL` - use `WordPress.DB.PreparedSQL` instead. - - `WordPress.XSS.EscapeOutput` - use `WordPress.Security.EscapeOutput` instead. - - `WordPress.PHP.DiscouragedFunctions` without direct replacement. - The checks previously contained in this sniff were moved to separate sniffs in WPCS 0.11.0. - - `WordPress.Variables.VariableRestrictions` without replacement. - - `WordPress.VIP.AdminBarRemoval` without replacement. - - `WordPress.VIP.FileSystemWritesDisallow` without replacement. - - `WordPress.VIP.OrderByRand` without replacement. - - `WordPress.VIP.PostsPerPage` without replacement. - Part of the previous functionality was split off in WPCS 1.0.0 to the `WordPress.WP.PostsPerPage` sniff. - - `WordPress.VIP.RestrictedFunctions` without replacement. - - `WordPress.VIP.RestrictedVariables` without replacement. - - `WordPress.VIP.SessionFunctionsUsage` without replacement. - - `WordPress.VIP.SessionVariableUsage` without replacement. - - `WordPress.VIP.SuperGlobalInputUsage` without replacement. -- The `WordPress.DB.SlowDBQuery.DeprecatedWhitelistFlagFound` error code which is superseded by the blanket deprecation warning for using the now deprecated WPCS native whitelist comments. -- The `WordPress.PHP.TypeCasts.NonLowercaseFound` error code which has been replaced by the upstream `Generic.PHP.LowerCaseType` sniff. -- The `WordPress.PHP.TypeCasts.LongBoolFound` and `WordPress.PHP.TypeCasts.LongIntFound` error codes which has been replaced by the new upstream `PSR12.Keywords.ShortFormTypeKeywords` sniff. -- The `WordPress.Security.EscapeOutput.OutputNotEscapedShortEcho` error code which was only ever used if WPCS was run on PHP 5.3 with the `short_open_tag` ini directive set to `off`. -- The following sniff categories which were previously deprecated, have been removed, though select categories may be reinstated in the future: - - `CSRF` - - `Functions` - - `Variables` - - `VIP` - - `XSS` -- `WordPress.NamingConventions.ValidVariableName`: The `customVariableWhitelist` property, which had been deprecated since WordPressCS 0.11.0. Use the `customPropertiesWhitelist` property instead. -- `WordPress.Security.EscapeOutput`: The `customSanitizingFunctions` property, which had been deprecated since WordPressCS 0.5.0. Use the `customEscapingFunctions` property instead. -- `WordPress.Security.NonceVerification`: The `errorForSuperGlobals` and `warnForSuperGlobals` properties, which had been deprecated since WordPressCS 0.12.0. -- The `vip_powered_wpcom` function from the `Sniff::$autoEscapedFunctions` list which is used by the `WordPress.Security.EscapeOutput` sniff. -- The `AbstractVariableRestrictionsSniff` class, which was deprecated since WordPressCS 1.0.0. -- The `Sniff::has_html_open_tag()` utility method, which was deprecated since WordPressCS 1.0.0. -- The internal `$php_reserved_vars` property from the `WordPress.NamingConventions.ValidVariableName` sniff in favour of using a PHPCS native property which is now available. -- The class aliases and WPCS native autoloader used for PHPCS cross-version support. -- The unit test framework workarounds for PHPCS cross-version unit testing. -- Support for the `@codingStandardsChangeSetting` annotation, which is generally only used in unit tests. -- The old generic GitHub issue template which was replaced by more specific issue templates in WPCS 1.2.0. - -### Fixed -- Support for PHP 7.3. - `PHP_CodeSniffer` < 3.3.1 was not fully compatible with PHP 7.3. Now the minimum required PHPCS has been upped to `PHP_CodeSniffer` 3.3.1, WordPressCS will run on PHP 7.3 without issue. -- `WordPress.Arrays.ArrayDeclarationSpacing`: improved fixing of the placement of array items following an array item with a trailing multi-line comment. -- `WordPress.NamingConventions.ValidFunctionName`: the sniff will no longer throw false positives nor duplicate errors for methods declared in nested anonymous classes. - The error message has also been improved for methods in anonymous classes. -- `WordPress.NamingConventions.ValidFunctionName`: the sniff will no longer throw false positives for PHP 4-style class constructors/destructors where the name of the constructor/destructor method did not use the same case as the class name. - - -## [1.2.1] - 2018-12-18 - -Note: This will be the last release supporting PHP_CodeSniffer 2.x. - -### Changed -- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `4.7`. -- The `WordPress.NamingConventions.PrefixAllGlobals` sniff will now report the error for hook names and constant names declared with `define()` on the line containing the parameter for the hook/constant name. Previously, it would report the error on the line containing the function call. -- Various minor housekeeping fixes to inline documentation, rulesets, code. - -### Removed -- `comment_author_email_link()`, `comment_author_email()`, `comment_author_IP()`, `comment_author_link()`, `comment_author_rss()`, `comment_author_url_link()`, `comment_author_url()`, `comment_author()`, `comment_date()`, `comment_excerpt()`, `comment_form_title()`, `comment_form()`, `comment_id_fields()`, `comment_ID()`, `comment_reply_link()`, `comment_text_rss()`, `comment_text()`, `comment_time()`, `comment_type()`, `comments_link()`, `comments_number()`, `comments_popup_link()`, `comments_popup_script()`, `comments_rss_link()`, `delete_get_calendar_cache()`, `edit_bookmark_link()`, `edit_comment_link()`, `edit_post_link()`, `edit_tag_link()`, `get_footer()`, `get_header()`, `get_sidebar()`, `get_the_title()`, `next_comments_link()`, `next_image_link()`, `next_post_link()`, `next_posts_link()`, `permalink_anchor()`, `posts_nav_link()`, `previous_comments_link()`, `previous_image_link()`, `previous_post_link()`, `previous_posts_link()`, `sticky_class()`, `the_attachment_link()`, `the_author_link()`, `the_author_meta()`, `the_author_posts_link()`, `the_author_posts()`, `the_category_rss()`, `the_category()`, `the_content_rss()`, `the_content()`, `the_date_xml()`, `the_excerpt_rss()`, `the_excerpt()`, `the_feed_link()`, `the_ID()`, `the_meta()`, `the_modified_author()`, `the_modified_date()`, `the_modified_time()`, `the_permalink()`, `the_post_thumbnail()`, `the_search_query()`, `the_shortlink()`, `the_tags()`, `the_taxonomies()`, `the_terms()`, `the_time()`, `the_title_rss()`, `the_title()`, `wp_enqueue_script()`, `wp_meta()`, `wp_shortlink_header()` and `wp_shortlink_wp_head()` from the list of auto-escaped functions `Sniff::$autoEscapedFunctions`. This affects the `WordPress.Security.EscapeOutput` sniff. - -### Fixed -- The `WordPress.WhiteSpace.PrecisionAlignment` sniff would loose the value of a custom set `ignoreAlignmentTokens` property when scanning more than one file. - - -## [1.2.0] - 2018-11-12 - -### Added -- New `WordPress.PHP.TypeCasts` sniff to the `WordPress-Core` ruleset. - This new sniff checks that PHP type casts are: - * lowercase; - * short form, i.e. `(bool)` not `(boolean)`; - * normalized, i.e. `(float)` not `(real)`. - Additionally, the new sniff discourages the use of the `(unset)` and `(binary)` type casts. -- New `WordPress.Utils.I18nTextDomainFixer` sniff which can compehensively replace/add `text-domain`s in a plugin or theme. - Important notes: - - This sniff is disabled by default and intended as a utility tool. - - The sniff will fix the text domains in all I18n function calls as well as in a plugin/theme `Text Domain:` header. - - Passing the following properties will activate the sniff: - - `old_text_domain`: an array with one or more (old) text domains which need to be replaced; - - `new_text_domain`: the correct (new) text domain as a string. -- The `WordPress.NamingConventions.PrefixAllGlobals` sniff will now also verify that namespace names use a valid prefix. - * The sniff allows for underscores and (other) non-word characters in a passed prefix to be converted to namespace separators when used in a namespace name. - In other words, if a prefix of `my_plugin` is passed as a value to the `prefixes` property, a namespace name of both `My\Plugin` as well as `My_Plugin\\`, will be accepted automatically. - * Passing a prefix property value containing namespace separators will now also be allowed and will no longer trigger a warning. -- `WordPress` to the prefix blacklist for the `WordPress.NamingConventions.PrefixAllGlobals` sniff. - While the prefix cannot be `WordPress`, a prefix can still _start with_ or _contain_ `WordPress`. -- Additional unit tests covering a change in the tokenizer which will be included in the upcoming `PHP_CodeSniffer` 3.4.0 release. -- A variety of issue templates for use on GitHub. - -### Changed -- The `Sniff::valid_direct_scope()` method will now return the `$stackPtr` to the valid scope if a valid direct scope has been detected. Previously, it would return `true`. -- Minor hardening and efficiency improvements to the `WordPress.NamingConventions.PrefixAllGlobals` sniff. -- The inline documentation of the `WordPress-Core` ruleset has been updated to be in line again with [the handbook](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/). -- The inline links to documentation about the VIP requirements have been updated. -- Updated the [custom ruleset example](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample) to recommend using `PHPCompatibilityWP` rather than `PHPCompatibility`. -- All sniffs are now also being tested against PHP 7.3 for consistent sniff results. - Note: PHP 7.3 is only supported in combination with PHPCS 3.3.1 or higher as `PHP_CodeSniffer` itself has an incompatibility in earlier versions. -- Minor grammar fixes in text strings and documentation. -- Minor consistency improvement for the unit test case files. -- Minor tweaks to the `composer.json` file. -- Updated the PHPCompatibility `dev` dependency. - -### Removed -- The `WordPress.WhiteSpace.CastStructureSpacing.NoSpaceAfterCloseParenthesis` error code as an error for the same issue was already being thrown by an included upstream sniff. - -### Fixed -- The `WordPress.CodeAnalysis.EmptyStatement` would throw a false positive for an empty condition in a `for()` statement. -- The `Sniff::is_class_property()` method could, in certain circumstances, incorrectly recognize parameters in a method declaration as class properties. It would also, incorrectly, fail to recognize class properties when the object they are declared in, was nested in parentheses. - This affected, amongst others, the `GlobalVariablesOverride` sniff. -- The `Sniff::get_declared_namespace_name()` method could get confused over whitespace and comments within a namespace name, which could lead to incorrect results (mostly underreporting). - This affected, amongst others, the `GlobalVariablesOverride` sniff. - The return value of the method will now no longer contain any whitespace or comments encountered. -- The `Sniff::has_whitelist_comment()` method would sometimes incorrectly regard `// phpcs:set` comments as whitelist comments. - -## [1.1.0] - 2018-09-10 - -### Added -- New `WordPress.PHP.NoSilencedErrors` sniff. This sniff replaces the `Generic.PHP.NoSilencedErrors` sniff which was previously used and included in the `WordPress-Core` ruleset. - The WordPress specific version of the sniff differs from the PHPCS version in that it: - * Allows the error control operator `@` if it preceeds a function call to a limited list of PHP functions for which no amount of error checking can prevent a PHP warning from being thrown. - * Allows for a used-defined list of (additional) function names to be passed to the sniff via the `custom_whitelist` property in a custom ruleset, for which - if the error control operator is detected in front of a function call to one of the functions in this whitelist - no warnings will be thrown. - * Displays a brief snippet of code in the `warning` message text to show the context in which the error control operator is being used. The length of the snippet (in tokens) can be customized via the `context_length` property. - * Contains a public `use_default_whitelist` property which can be set from a custom ruleset which regulates whether or not the standard whitelist of PHP functions should be used by the sniff. - The user-defined whitelist will always be respected. - By default, this property is set to `true` for the `WordPress-Core` ruleset and to `false` for the `WordPress-Extra` ruleset (which is stricter regarding these kind of best practices). -- Metrics to the `WordPress.NamingConventions.PrefixAllGlobals` sniff to aid people in determining the most commonly used prefix in a legacy project. - For an example of how to use this feature, please see the detailed explanation in the [pull request](https://github.com/WordPress/WordPress-Coding-Standards/pull/1437). - -### Changed -- The `PEAR.Functions.FunctionCallSignature` sniff, which is part of the `WordPress-Core` ruleset, used to allow multiple function call parameters per line in multi-line function calls. This will no longer be allowed. - As of this release, if a function call is multi-line, each parameter should start on a new line and an `error` will be thrown if the code being analysed does not comply with that rule. - The sniff behaviour for single-line function calls is not affected by this change. -- Moved the `WordPress.CodeAnalysis.EmptyStatement` sniff from the `WordPress-Extra` to the `WordPress-Core` ruleset. -- Moved the `Squiz.PHP.CommentedOutCode` sniff from the `WordPress-Docs` to the `WordPress-Extra` ruleset and lowered the threshold for determining whether or not a comment is commented out code from 45% to 40%. -- The `WordPress.NamingConventions.PrefixAllGlobals` sniff now has improved support for recognizing whether or not (non-prefixed) globals are declared in the context of unit tests. -- The `is_foreach_as()` method has been moved from the `GlobalVariablesOverrideSniff` class to the WordPress `Sniff` base class. -- The `Sniff::is_token_in_test_method()` utility method now has improved support for recognizing test methods in anonymous classes. -- Minor efficiency improvement to the `Sniff::is_safe_casted()` method. -- CI: Minor tweaks to the Travis script. -- CI: Improved Composer scripts for use by WPCS developers. -- Dev: Removed IDE specific files from `.gitignore`. -- Readme: Improved the documentation about the project history and the badge display. - -### Fixed -- The `WordPress.Security.ValidatedSanitizedInput` sniff will now recognize array keys in superglobals independently of the string quote-style used for the array key. -- The `WordPress.WhiteSpace.PrecisionAlignment` sniff will no longer throw false positives for DocBlocks for JavaScript functions within inline HTML. -- `WordPress.WP.DeprecatedClasses`: The error codes for this sniff were unstable as they were based on the code being analysed instead of on fixed values. -- Various bugfixes for the `WordPress.WP.GlobalVariablesOverride` sniff: - - Previously, the sniff only checked variables in the global namespace when a `global` statement would be encountered. As of now, all variable assignments in the global namespace will be checked. - - Nested functions/closures/classes which don't import the global variable will now be skipped over when encountered within another function, preventing false positives. - - Parameters in function declarations will no longer throw false positives. - - The error message for assignments to a subkey of the `$GLOBALS` superglobal has been improved. - - Various efficiency improvements. -- The `Sniff::is_in_isset_or_empty()` method presumed the WordPress coding style regarding code layout, which could lead to incorrect results (mostly underreporting). - This affected, amongst others, the `WordPress.Security.ValidatedSanitizedInput` sniff. -- Broken links in the inline developer documentation. - - -## [1.0.0] - 2018-07-25 - -### Important information about this release: - -If you use the WordPress Coding Standards with a custom ruleset, please be aware that a number of sniffs have been moved between categories and that the old sniff names have been deprecated. -If you selectively include any of these sniffs in your custom ruleset or set custom property values for these sniffs, your custom ruleset will need to be updated. - -The `WordPress-VIP` ruleset has also been deprecated. If you used that ruleset to check your theme/plugin for hosting on the WordPress.com VIP platform, please use the [Automattic VIP coding standards](https://github.com/Automattic/VIP-Coding-Standards) instead. -If you used that ruleset for any other reason, you should probably use the `WordPress-Extra` or `WordPress` ruleset instead. - -These and some related changes have been annotated in detail in the `Deprecated` section of this changelog. - -Please read the complete changelog carefully before you upgrade. - -If you are a maintainer of an external standard based on WPCS and any of your custom sniffs are based on or extend WPCS sniffs, the same applies. - -### Added -- `WordPress.PHP.PregQuoteDelimiter` sniff to the `WordPress-Extra` ruleset to warn about calls to `preg_quote()` which don't pass the `$delimiter` parameter. -- `WordPress.Security.SafeRedirect` sniff to the `WordPress-Extra` ruleset to warn about potential open redirect vulnerabilities. -- `WordPress.WP.DeprecatedParameterValues` sniff to the `WordPress-Extra` ruleset to detect deprecated parameter values being passed to select functions. -- `WordPress.WP.EnqueuedResourceParameters` sniff to the `WordPress-Extra` ruleset to detect: - - Calls to the script/style register/enqueue functions which don't pass a `$version` for the script/style, which can cause issues with browser caching; and/or - - Calls to the register/enqueue script functions which don't pass the `$in_footer` parameter, which causes scripts - by default - to be loaded in the HTML header in a layout rendering blocking manner. -- Detection of calls to `strip_tags()` and various PHP native `..rand()` functions to the `WordPress.WP.AlternativeFunctions` sniff. -- `readonly()` to the list of auto-escaped functions `Sniff::$autoEscapedFunctions`. This affects the `WordPress.Security.EscapeOutput` sniff. -- The `WordPress.Security.PluginMenuSlug`, `WordPress.WP.CronInterval`, `WordPress.WP.PostsPerPage` and `WordPress.WP.TimezoneChange` sniffs are now included in the `WordPress-Extra` ruleset. Previously, they were already included in the `WordPress` and `WordPress-VIP` rulesets. -- New utility method `Sniff::is_use_of_global_constant()`. -- A rationale to the package suggestion made via `composer.json`. -- CI: Validation of the `composer.json` file on each build. -- A wiki page with instructions on how to [set up WordPressCS to run with Eclipse on XAMPP](https://github.com/WordPress/WordPress-Coding-Standards/wiki/How-to-use-WordPressCS-with-Eclipse-and-XAMPP). -- Readme: A link to an external resource with more examples for setting up PHPCS for CI. -- Readme: A badge-based quick overview of the project. - -### Changed -- The `WordPress` ruleset no longer includes the `WordPress-VIP` ruleset, nor does it include any of the (deprecated) `VIP` sniffs anymore. -- The following sniffs have been moved to a new category: - - `CronInterval` from the `VIP` category to the `WP` category. - - `DirectDatabaseQuery` from the `VIP` category to the `DB` category. - - `DontExtract` from the `Functions` category to the `PHP` category. - - `EscapeOutput` from the `XSS` category to the `Security` category. - - `GlobalVariables` from the `Variables` category to the `WP` category. - - `NonceVerification` from the `CSRF` category to the `Security` category. - - `PluginMenuSlug` from the `VIP` category to the `Security` category. - - `PreparedSQL` from the `WP` category to the `DB` category. - - `SlowDBQuery` from the `VIP` category to the `DB` category. - - `TimezoneChange` from the `VIP` category to the `WP` category. - - `ValidatedSanitizedInput` from the `VIP` category to the `Security` category. -- The `WordPress.VIP.PostsPerPage` sniff has been split into two distinct sniffs: - - `WordPress.WP.PostsPerPage` which will check for the use of a high pagination limit and will throw a `warning` when this is encountered. For the `VIP` ruleset, the error level remains `error`. - - `WordPress.VIP.PostsPerPage` wich will check for disabling of pagination. -- The default value for `minimum_supported_wp_version`, as used by a [number of sniffs detecting usage of deprecated WP features](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters), has been updated to `4.6`. -- The `WordPress.WP.AlternativeFunctions` sniff will now only throw a warning if/when the recommended alternative function is available in the minimum supported WP version of a project. - In addition to this, certain alternatives are only valid alternatives in certain circumstances, like when the WP version only supports the first parameter of the PHP function it is trying to replace. - This will now be taken into account for: - - `wp_strip_all_tags()` is only a valid alternative for the PHP native `strip_tags()` when the second parameter `$allowed_tags` has not been passed. - - `wp_parse_url()` only added support for the second parameter `$component` of the PHP native `parse_url()` function in WP 4.7.0. -- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 4.9. -- The `WordPress.WP.GlobalVariablesOverride` sniff will now display the name of the variable being overridden in the error message. -- The `WordPress.WP.I18n` sniff now extends the `AbstractFunctionRestrictionSniff`. -- Assignments in conditions in ternaries as detected by the `WordPress.CodeAnalysis.AssignmentInCondition` sniff will now be reported under a separate error code `FoundInTernaryCondition`. -- The default error level for the notices from the `WordPress.DB.DirectDatabaseQuery` sniff has been lowered from `error` to `warning`. For the `VIP` ruleset, the error level remains `error`. -- The default error level for the notices from the `WordPress.Security.PluginMenuSlug` sniff has been lowered from `error` to `warning`. For the `VIP` ruleset, the error level remains `error`. -- The default error level for the notices from the `WordPress.WP.CronInterval` sniff has been lowered from `error` to `warning`. For the `VIP` ruleset, the error level remains `error`. -- The `Sniff::get_function_call_parameters()` utility method now has improved handling of closures when passed as function call parameters. -- Rulesets: a number of error codes were previously silenced by explicitly `exclude`-ing them. Now, they will be silenced by setting the `severity` to `0` which makes it more easily discoverable for maintainers of custom rulesets how to enable these error codes again. -- Various performance optimizations which should most notably make a difference when running WPCS on PHP 7. -- References to the WordPress.com VIP platform have been clarified. -- Unit Tests: custom properties set in unit test files are reset after use. -- Various improvements to the ruleset used by the WPCS project itself and minor code clean up related to this. -- CI: Each change will now also be tested against the lowest supported PHPCS 3 version. -- CI: Each change will now also be checked for PHP cross-version compatibility. -- CI: The rulesets will now also be tested on each change to ensure no unexpected messages are thrown. -- CI: Minor changes to the script to make the build testing faster. -- Updated the [custom ruleset example](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample) for the changes contained in this release and to reflect current best practices regarding the PHPCompatibility standard. -- The instructions on how to set up WPCS for various IDEs have been moved from the `README` to the [wiki](https://github.com/WordPress/WordPress-Coding-Standards/wiki). -- Updated output examples in `README.md` and `CONTRIBUTING.md` and other minor changes to these files. -- Updated references to the PHPCompatibility standard to reflect its new location and recommend using PHPCompatibilityWP. - -### Deprecated -- The `WordPress-VIP` ruleset has been deprecated. - For checking a theme/plugin for hosting on the WordPress.com VIP platform, please use the [Automattic VIP coding standards](https://github.com/Automattic/VIP-Coding-Standards) instead. - If you used the `WordPress-VIP` ruleset for any other reason, you should probably use the `WordPress-Extra` or `WordPress` ruleset instead. -- The following sniffs have been deprecated and will be removed in WPCS 2.0.0: - - `WordPress.CSRF.NonceVerification` - use `WordPress.Security.NonceVerification` instead. - - `WordPress.Functions.DontExtract` - use `WordPress.PHP.DontExtract` instead. - - `WordPress.Variables.GlobalVariables` - use `WordPress.WP.GlobalVariablesOverride` instead. - - `WordPress.VIP.CronInterval` - use `WordPress.WP.CronInterval` instead. - - `WordPress.VIP.DirectDatabaseQuery` - use `WordPress.DB.DirectDatabaseQuery` instead. - - `WordPress.VIP.PluginMenuSlug` - use `WordPress.Security.PluginMenuSlug` instead. - - `WordPress.VIP.SlowDBQuery` - use `WordPress.DB.SlowDBQuery` instead. - - `WordPress.VIP.TimezoneChange` - use `WordPress.WP.TimezoneChange` instead. - - `WordPress.VIP.ValidatedSanitizedInput` - use `WordPress.Security.ValidatedSanitizedInput` instead. - - `WordPress.WP.PreparedSQL` - use `WordPress.DB.PreparedSQL` instead. - - `WordPress.XSS.EscapeOutput` - use `WordPress.Security.EscapeOutput` instead. - - `WordPress.VIP.AdminBarRemoval` without replacement. - - `WordPress.VIP.FileSystemWritesDisallow` without replacement. - - `WordPress.VIP.OrderByRand` without replacement. - - `WordPress.VIP.RestrictedFunctions` without replacement. - - `WordPress.VIP.RestrictedVariables` without replacement. - - `WordPress.VIP.SessionFunctionsUsage` without replacement. - - `WordPress.VIP.SessionVariableUsage` without replacement. - - `WordPress.VIP.SuperGlobalInputUsage` without replacement. -- The following sniff categories have been deprecated and will be removed in WPCS 2.0.0: - - `CSRF` - - `Variables` - - `XSS` -- The `posts_per_page` property in the `WordPress.VIP.PostsPerPage` sniff has been deprecated as the related functionality has been moved to the `WordPress.WP.PostsPerPage` sniff. - See [WP PostsPerPage: post limit](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#wp-postsperpage-post-limit) for more information about this property. -- The `exclude` property which is available to most sniffs which extend the `AbstractArrayAssignmentRestrictions`, `AbstractFunctionRestrictions` and `AbstractVariableRestrictions` classes or any of their children, used to be a `string` property and expected a comma-delimited list of groups to exclude. - The type of the property has now been changed to `array`. Custom rulesets which pass this property need to be adjusted to reflect this change. - Support for passing the property as a comma-delimited string has been deprecated and will be removed in WPCS 2.0.0. - See [Excluding a group of checks](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#excluding-a-group-of-checks) for more information about the sniffs affected by this change. -- The `AbstractVariableRestrictionsSniff` class has been deprecated as all sniffs depending on this class have been deprecated. Unless a new sniff is created in the near future which uses this class, the abstract class will be removed in WPCS 2.0.0. -- The `Sniff::has_html_open_tag()` utility method has been deprecated as it is now only used by deprecated sniffs. The method will be removed in WPCS 2.0.0. - -### Removed -- `cancel_comment_reply_link()`, `get_bookmark()`, `get_comment_date()`, `get_comment_time()`, `get_template_part()`, `has_post_thumbnail()`, `is_attachement()`, `post_password_required()` and `wp_attachment_is_image()` from the list of auto-escaped functions `Sniff::$autoEscapedFunctions`. This affects the `WordPress.Security.EscapeOutput` sniff. -- WPCS no longer explicitly supports HHVM and builds are no longer tested against HHVM. - For now, running WPCS on HHVM to test PHP code may still work for a little while, but HHVM has announced they are [dropping PHP support](https://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html). - -### Fixed -- Compatibility with PHP 7.3. A change in PHP 7.3 was causing the `WordPress.DB.RestrictedClasses`, `WordPress.DB.RestrictedFunctions` and the `WordPress.WP.AlternativeFunctions` sniffs to fail to correctly detect issues. -- Compatibility with the latest releases from [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer). - PHPCS 3.2.0 introduced new annotations which can be used inline to selectively disable/ignore certain sniffs. - **Note**: The initial implementation of the new annotations was buggy. If you intend to start using these new style annotations, you are strongly advised to use PHPCS 3.3.0 or higher. - For more information about these annotations, please refer to the [PHPCS Wiki](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file). - - The [WPCS native whitelist comments](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors) can now be combined with the new style PHPCS whitelist annotations in the `-- for reasons` part of the annotation. - - `WordPress.Arrays.ArrayDeclarationSpacing`: the fixer will now handle the new style annotations correctly. - - `WordPress.Arrays.CommaAfterArrayItem`: prevent a fixer loop when new style annotations are encountered. - - `WordPress.Files.FileName`: respect the new style annotations if these would selectively disable this sniff. - - `WordPress.WhiteSpace.ControlStructureSpacing`: handle the new style annotations correctly for the "blank line at the start/end of control structure" checks and prevent a fixer conflict when the new style annotations are encountered. - - `WordPress.WhiteSpace.PrecisionAlignment`: allow for checking of for precision alignment on lines containing new style annotations when `phpcs` is run with `--ignore-annotations`. -- The `Sniff::is_test_class()` method now has improved recognition of namespaced test classes. - This positively affects the `WordPress.Files.FileName`, `WordPress.NamingConventions.PrefixAllGlobals` and `WordPress.WP.GlobalVariablesOverride` sniffs, which each allow for test classes to (partially) not comply with the rules these sniffs check for. - This fixes the following bugs: - - Namespaced classes where the classname was one of the whitelisted global classes would incorrectly be recognized as a test class, even though they were not the same class. - This also happened if a namespaced class `extend`ed one of the whitelisted global classes. - - A namespaced custom test class where the name was split between the namespace declaration and the extended class declaration was not correctly recognized as the whitelisted test class. - - A namespaced test class which extended another class using a FQCN prefixed with a `\\` would not be correctly recognized. - - The `custom_test_class_whitelist` property which is available for each of these sniffs expects to be passed a Fully Qualified Class Name. FQCNs prefixed with a global namespace indicator will now be correctly handled. -- The determination of whether a `T_STRING` is a function call or not has been improved in the `AbstractFunctionRestrictions` class. This improvement benefits all sniffs which extend this abstract and any of its children (> 10 sniffs) and fixes the following false positives: - - Class declarations will no longer be confused with function calls. - - Use statement alias declarations will no longer be confused with function calls. -- Various bugs in the `WordPress.Arrays.ArrayIndentation` sniff: - - The sniff will no longer throw false positives or try to fix multi-line text strings where the closing quote is on a line by itself. - - The sniff would go into a fixer loop when it encountered a multi-line trailing comment after an array item. -- The `WordPress.CodeAnalysis.AssignmentInCondition` was throwing false positives for ternaries in nested, but unrelated, parentheses. -- The `WordPress.CodeAnalysis.EmptyStatement` and `WordPress.Files.FileName` sniffs underreported as they did not take PHP short open echo tags into account. -- Various bugs in the `WordPress.NamingConventions.PrefixAllGlobals` sniff: - - Parameters in a closure declaration were incorrectly being regarded as global variables. - - Non-prefixed variables created by a `foreach()` construct in the global namespace were previously not detected. - - Non-prefixed globals found in namespaced test classes should be ignored by the sniff, but were not. - - Definition of non-prefixed global WP constants which are intended to be overruled, should not trigger an error from this sniff. - - The sniff presumed the WP naming conventions for PHP constructs, while it should check for the construct being prefixed regardless of whether camelCase, PascalCase, snake_case or other naming conventions are used. - - The sniff presumed the WP naming conventions for prefixes used in hook names. The sniff will now be more tolerant when non-conventional word separators are used in prefixes for hooks. -- The `WordPress.NamingConventions.ValidFunctionName` sniff no longer "hides" one message behind another. The sniff will now correctly throw a message about function names not being in `snake_case`, even when the `FunctionDoubleUnderscore` or `MethodDoubleUnderscore` error codes have been excluded. -- The `WordPress.PHP.StrictInArray` sniff will no longer throw an error when `in_array`, `array_search` or `array_keys` are used in a file `use` statement. -- Various bugs in the `WordPress.Security.EscapeOutput` sniff: - - A limited list of native PHP constants which are safe to use, such as `PHP_EOL`, has been added. When any of these constants are encountered, the sniff will no longer demand output escaping for them. - - The sniff was underreporting issues with variables passed to `trigger_error()`. - - While reporting an issue, sometimes the wrong error message was used. The sniff logic has been adjusted to prevent this. - - The sniff will now correctly ignore the open and close brackets of short arrays. - - The sniff would throw false positives when `echo`, `print`, `exit` or `die` were encountered as constants, function or class names. While it may not be a good idea to use PHP keywords in such a way, it is allowed, so the sniff should handle this correctly. -- The `WordPress.WhiteSpace.ControlStructureSpacing` sniff would inadvertently throw an error for the spacing around the colon for a return type in a function declaration. -- The `WordPress.WP.AlternativeFunctions` sniff used to flag all function calls to `file_get_contents()` twice, suggesting to use `wp_remote_get()` - which is only applicable for remote URLs - and the `WP_FileSystem` API - which is not needed when just _reading_ local files. These messages contradicted each other. - The sniff will now try to determine whether the file requested is local or remote and will only throw a `warning` suggesting to use `wp_remote_get()`, if a remote URL is being requested or when it could not be determined if the requested file is local or remote. -- The expected default value for `wp_upload_bits()` in the `WordPress.WP.DeprecatedParameters` sniff. -- The `WordPress.WP.GlobalVariablesOverride` sniff previously did not detect variables created by a `foreach()` construct which would override WP global variables. -- Various bugs in the `WordPress.WP.I18n` sniff: - - The sniff will no longer throw false positives for calls to methods carrying the same name as any of the global WP functions being targeted and has improved handling of parse errors and live coding. - - A numeric `0` would throw a false positive for "no translatable content found". -- The fixer in the `WordPress.WhiteSpace.ControlStructureSpacing` sniff will no longer inadvertently remove return type declarations. -- Various bugs in the `WordPress.WhiteSpace.PrecisionAlignment` sniff: - - Inline HTML before the first PHP open tag was not being examined. - - Files which only contained short open echo tags for PHP were not being examined. - - The last line of inline HTML in a file was not being examined. -- Some best practice sniffs presumed the WordPress coding style regarding code layout, which could lead to incorrect results (mostly underreporting). - The following sniffs have received fixes related to this: - - `WordPress.DB.PreparedSQL` - - `WordPress.NamingConventions.ValidVariableName` - - `WordPress.WP.CronInterval` - - `WordPress.WP.I18n` -- Various minor fixes based on visual inspection and Scrutinizer analysis feedback. -- Typo in the instructions contained in `CONTRIBUTING.md`. -- Broken link in the `README.md` file. - - -## [0.14.1] - 2018-02-15 - -### Fixed -- The `WordPress.NamingConventions.PrefixAllGlobals` sniff contained a bug which could inadvertently trigger class autoloading of the project being sniffed and by extension could cause fatal errors during the PHPCS run. - -## [0.14.0] - 2017-11-01 - -### Added -- `WordPress.Arrays.MultipleStatementAlignment` sniff to the `WordPress-Core` ruleset which will align the array assignment operator for multi-item, multi-line associative arrays. - This new sniff offers four custom properties to customize its behaviour: [`ignoreNewlines`](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-allow-for-new-lines), [`exact`](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-allow-non-exact-alignment), [`maxColumn`](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-maximum-column) and [`alignMultilineItems`](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-dealing-with-multi-line-items). -- `WordPress.DB.PreparedSQLPlaceholders` sniff to the `WordPress-Core` ruleset which will analyse the placeholders passed to `$wpdb->prepare()` for their validity, check whether queries using `IN ()` and `LIKE` statements are created correctly and will check whether a correct number of replacements are passed. - This sniff should help detect queries which are impacted by the security fixes to `$wpdb->prepare()` which shipped with WP 4.8.2 and 4.8.3. - The sniff also adds a new ["PreparedSQLPlaceholders replacement count" whitelist comment](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors#preparedsql-placeholders-vs-replacements) for pertinent replacement count vs placeholder mismatches. Please consider carefully whether something could be a bug when you are tempted to use the whitelist comment and if so, [report it](https://github.com/WordPress/WordPress-Coding-Standards/issues/new). -- `WordPress.PHP.DiscourageGoto` sniff to the `WordPress-Core` ruleset. -- `WordPress.PHP.RestrictedFunctions` sniff to the `WordPress-Core` ruleset which initially forbids the use of `create_function()`. - This was previous only discouraged under certain circumstances. -- `WordPress.WhiteSpace.ArbitraryParenthesesSpacing` sniff to the `WordPress-Core` ruleset which checks the spacing on the inside of arbitrary parentheses. -- `WordPress.WhiteSpace.PrecisionAlignment` sniff to the `WordPress-Core` ruleset which will throw a warning when precision alignment is detected in PHP, JS and CSS files. -- `WordPress.WhiteSpace.SemicolonSpacing` sniff to the `WordPress-Core` ruleset which will throw a (fixable) error when whitespace is found before a semi-colon, except for when the semi-colon denotes an empty `for()` condition. -- `WordPress.CodeAnalysis.AssignmentInCondition` sniff to the `WordPress-Extra` ruleset. -- `WordPress.WP.DiscouragedConstants` sniff to the `WordPress-Extra` and `WordPress-VIP` rulesets to detect usage of deprecated WordPress constants, such as `STYLESHEETPATH` and `HEADER_IMAGE`. -- Ability to pass the `minimum_supported_version` to use for the `DeprecatedFunctions`, `DeprecatedClasses` and `DeprecatedParameters` sniff in one go. You can pass a `minimum_supported_wp_version` runtime variable for this [from the command line or pass it using a `config` directive in a custom ruleset](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#setting-minimum-supported-wp-version-for-all-sniffs-in-one-go-wpcs-0140). -- `Generic.Formatting.MultipleStatementAlignment` - customized to have a `maxPadding` of `40` -, `Generic.Functions.FunctionCallArgumentSpacing` and `Squiz.WhiteSpace.ObjectOperatorSpacing` to the `WordPress-Core` ruleset. -- `Squiz.Scope.MethodScope`, `Squiz.Scope.MemberVarScope`, `Squiz.WhiteSpace.ScopeKeywordSpacing`, `PSR2.Methods.MethodDeclaration`, `Generic.Files.OneClassPerFile`, `Generic.Files.OneInterfacePerFile`, `Generic.Files.OneTraitPerFile`, `PEAR.Files.IncludingFile`, `Squiz.WhiteSpace.LanguageConstructSpacing`, `PSR2.Namespaces.NamespaceDeclaration` to the `WordPress-Extra` ruleset. -- The `is_class_constant()`, `is_class_property` and `valid_direct_scope()` utility methods to the `WordPress\Sniff` class. - -### Changed -- When passing an array property via a custom ruleset to PHP_CodeSniffer, spaces around the key/value are taken as intentional and parsed as part of the array key/value. In practice, this leads to confusion and WPCS does not expect any values which could be preceded/followed by a space, so for the WordPress Coding Standard native array properties, like `customAutoEscapedFunction`, `text_domain`, `prefixes`, WPCS will now trim whitespace from the keys/values received before use. -- The WPCS native whitelist comments used to only work when they were put on the _end of the line_ of the code they applied to. As of now, they will also be recognized when they are be put at the _end of the statement_ they apply to. -- The `WordPress.Arrays.ArrayDeclarationSpacing` sniff used to enforce all associative arrays to be multi-line. The handbook has been updated to only require this for multi-item associative arrays and the sniff has been updated accordingly. - [The original behaviour can still be enforced](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#arrays-forcing-single-item-associative-arrays-to-be-multi-line) by setting the new `allow_single_item_single_line_associative_arrays` property to `false` in a custom ruleset. -- The `WordPress.NamingConventions.PrefixAllGlobals` sniff will now allow for a limited list of WP core hooks which are intended to be called by plugins and themes. -- The `WordPress.PHP.DiscouragedFunctions` sniff used to include `create_function`. This check has been moved to the new `WordPress.PHP.RestrictedFunctions` sniff. -- The `WordPress.PHP.StrictInArray` sniff now has a separate error code `FoundNonStrictFalse` for when the `$strict` parameter has been set to `false`. This allows for excluding the warnings for that particular situation, which will normally be intentional, via a custom ruleset. -- The `WordPress.VIP.CronInterval` sniff now allows for customizing the minimum allowed cron interval by [setting a property in a custom ruleset](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#vip-croninterval-minimum-interval). -- The `WordPress.VIP.RestrictedFunctions` sniff used to prohibit the use of certain WP native functions, recommending the use of `wpcom_vip_get_term_link()`, `wpcom_vip_get_term_by()` and `wpcom_vip_get_category_by_slug()` instead, as the WP native functions were not being cached. As the results of the relevant WP native functions are cached as of WP 4.8, the advice has now been reversed i.e. use the WP native functions instead of `wpcom...` functions. -- The `WordPress.VIP.PostsPerPage` sniff now allows for customizing the `post_per_page` limit for which the sniff will trigger by [setting a property in a custom ruleset](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#vip-postsperpage-post-limit). -- The `WordPress.WP.I18n` sniff will now allow and actively encourage omitting the text domain in I18n function calls if the text domain passed via the `text_domain` property is `default`, i.e. the domain used by Core. - When `default` is one of several text domains passed via the `text_domain` property, the error thrown when the domain is missing has been downgraded to a `warning`. -- The `WordPress.XSS.EscapeOutput` sniff now has a separate error code `OutputNotEscapedShortEcho` and the error message texts have been updated. -- Moved `Squiz.PHP.Eval` from the `WordPress-Extra` and `WordPress-VIP` to the `WordPress-Core` ruleset. -- Removed two sniffs from the `WordPress-VIP` ruleset which were already included via the `WordPress-Core` ruleset. -- The unit test suite is now compatible with PHPCS 3.1.0+ and PHPUnit 6.x. -- Some tidying up of the unit test case files. -- All sniffs are now also being tested against PHP 7.2 for consistent sniff results. -- An attempt is made to detect potential fixer conflicts early via a special build test. -- Various minor documentation fixes. -- Improved the Atom setup instructions in the Readme. -- Updated the unit testing information in Contributing. -- Updated the [custom ruleset example](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample) for the changes contained in this release and to make it more explicit what is recommended versus example code. -- The minimum recommended version for the suggested `DealerDirect/phpcodesniffer-composer-installer` Composer plugin has gone up to `0.4.3`. This patch version fixes support for PHP 5.3. - -### Fixed -- The `WordPress.Arrays.ArrayIndentation` sniff did not correctly handle array items with multi-line strings as a value. -- The `WordPress.Arrays.ArrayIndentation` sniff did not correctly handle array items directly after an array item with a trailing comment. -- The `WordPress.Classes.ClassInstantiation` sniff will now correctly handle detection when using `new $array['key']` or `new $array[0]`. -- The `WordPress.NamingConventions.PrefixAllGlobals` sniff did not allow for arbitrary word separators in hook names. -- The `WordPress.NamingConventions.PrefixAllGlobals` sniff did not correctly recognize namespaced constants as prefixed. -- The `WordPress.PHP.StrictInArray` sniff would erronously trigger if the `true` for `$strict` was passed in uppercase. -- The `WordPress.PHP.YodaConditions` sniff could get confused over complex ternaries containing assignments. This has been remedied. -- The `WordPress.WP.PreparedSQL` sniff would erronously throw errors about comments found within a DB function call. -- The `WordPress.WP.PreparedSQL` sniff would erronously throw errors about `(int)`, `(float)` and `(bool)` casts and would also flag the subsequent variable which had been safe casted. -- The `WordPress.XSS.EscapeOutput` sniff would erronously trigger when using a fully qualified function call - including the global namespace `\` indicator - to one of the escaping functions. -- The lists of WP global variables and WP mixed case variables have been synchronized, which fixes some false positives. - - -## [0.13.1] - 2017-08-07 - -### Fixed -- Fatal error when using PHPCS 3.x with the `installed_paths` config variable set via the ruleset. - -## [0.13.0] - 2017-08-03 - -### Added -- Support for PHP_CodeSniffer 3.0.2+. The minimum required PHPCS version (2.9.0) stays the same. -- Support for the PHPCS 3 `--ignore-annotations` command line option. If you pass this option, both PHPCS native `@ignore ...` annotations as well as the WPCS specific [whitelist flags](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors) will be ignored. - -### Changed -- The minimum required PHP version is now 5.3 when used in combination with PHPCS 2.x and PHP 5.4 when used in combination with PHPCS 3.x. -- The way the unit tests can be run is now slightly different for PHPCS 2.x versus 3.x. For more details, please refer to the updated information in the [Contributing Guidelines](CONTRIBUTING.md). -- Release archives will no longer contain the unit tests and other typical development files. You can still get these by using Composer with `--prefer-source` or by checking out a git clone of the repository. -- Various textual improvements to the Readme. -- Various textual improvements to the Contributing Guidelines. -- Minor internal changes. - -### Removed -- The `WordPress.Arrays.ArrayDeclaration` sniff has been deprecated. The last remaining checks this sniff contained have been moved to the `WordPress.Arrays.ArrayDeclarationSpacing` sniff. -- Work-arounds which were in place to support PHP 5.2. - -### Fixed -- A minor bug where the auto-fixer could accidentally remove a comment near an array opener. - - -## [0.12.0] - 2017-07-21 - -### Added -- A default file encoding setting to the `WordPress-Core` ruleset. All files sniffed will now be regarded as `utf-8` by default. -- `WordPress.Arrays.ArrayIndentation` sniff to the `WordPress-Core` ruleset to verify - and auto-fix - the indentation of array items and the array closer for multi-line arrays. This replaces the (partial) indentation fixing contained within the `WordPress.Array.ArrayDeclarationSpacing` sniff. -- `WordPress.Arrays.CommaAfterArrayItem` sniff to the `WordPress-Core` ruleset to enforce that each array item is followed by a comma - except for the last item in a single-line array - and checks the spacing around the comma. This replaces (and improves) the checks which were previously included in the `WordPress.Arrays.ArrayDeclaration` sniff which were causing incorrect fixes and fixer conflicts. -- `WordPress.Functions.FunctionCallSignatureNoParams` sniff to the `WordPress-Core` ruleset to verify that function calls without parameters do not have any whitespace between the parentheses. -- `WordPress.WhiteSpace.DisallowInlineTabs` to the `WordPress-Core` ruleset to verify - and auto-fix - that spaces are used for mid-line alignment. -- `WordPress.WP.CapitalPDangit` sniff to the `WordPress-Core` ruleset to - where relevant - verify that `WordPress` is spelled correctly. For misspellings in text strings and comment text, the sniff can auto-fix violations. -- `Squiz.Classes.SelfMemberReference` whitespace related checks to the `WordPress-Core` ruleset and the additional check for using `self` rather than a FQN to the `WordPress-Extra` ruleset. -- `Squiz.PHP.EmbeddedPhp` sniff to the `WordPress-Core` ruleset to check PHP code embedded within HTML blocks. -- `PSR2.ControlStructures.SwitchDeclaration` to the `WordPress-Core` ruleset to check for the correct layout of `switch` control structures. -- `WordPress.Classes.ClassInstantion` sniff to the `WordPress-Extra` ruleset to detect - and auto-fix - missing parentheses on object instantiation and superfluous whitespace in PHP and JS files. The sniff will also detect `new` being assigned by reference. -- `WordPress.CodeAnalysis.EmptyStatement` sniff to the `WordPress-Extra` ruleset to detect - and auto-fix - superfluous semi-colons and empty PHP open-close tag combinations. -- `WordPress.NamingConventions.PrefixAllGlobals` sniff to the `WordPress-Extra` ruleset to verify that all functions, classes, interfaces, traits, variables, constants and hook names which are declared/defined in the global namespace are prefixed with one of the prefixes provided via a custom property or via the command line. - To activate this sniff, [one or more allowed prefixes should be provided to the sniff](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace). This can be done using a custom ruleset or via the command line. - PHP superglobals and WP global variables are exempt from variable name prefixing. Deprecated hook names will also be disregarded when non-prefixed. Back-fills for known native PHP functionality is also accounted for. - For verified exceptions, [unprefixed code can be whitelisted](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors#non-prefixed-functionclassvariableconstant-in-the-global-namespace). - Code in unit test files is automatically exempt from this sniff. -- `WordPress.WP.DeprecatedClasses` sniff to the `WordPress-Extra` ruleset to detect usage of deprecated WordPress classes. -- `WordPress.WP.DeprecatedParameters` sniff to the `WordPress-Extra` ruleset to detect deprecated parameters being passed to WordPress functions with a value other than the expected default. -- The `sanitize_textarea_field()` function to the `sanitizingFunctions` list used by the `WordPress.CSRF.NonceVerification`, `WordPress.VIP.ValidatedSanitizedInput` and `WordPress.XSS.EscapeOutput` sniffs. -- The `find_array_open_closer()` utility method to the `WordPress_Sniff` class. -- Information about setting `installed_paths` using a custom ruleset to the Readme. -- Additional support links to the `composer.json` file. -- Support for Composer PHPCS plugins which sort out the `installed_paths` setting. -- Linting and code-style check of the XML ruleset files provided by WPCS. - -### Changed -- The minimum required PHP_CodeSniffer version to 2.9.0 (was 2.8.1). **Take note**: PHPCS 3.x is not (yet) supported. The next release is expected to fix that. -- Improved support for detecting issues in code using heredoc and/or nowdoc syntax. -- Improved sniff efficiency, precision and performance for a number of sniffs. -- Updated a few sniffs to take advantage of new features and fixes which are included in PHP_CodeSniffer 2.9.0. -- `WordPress.Files.Filename`: The "file name mirrors the class name prefixed with 'class'" check for PHP files containing a class will no longer be applied to typical unit test classes, i.e. for classes which extend `WP_UnitTestCase`, `PHPUnit_Framework_TestCase` and `PHPUnit\Framework\TestCase`. Additional test case base classes can be passed to the sniff using the new [`custom_test_class_whitelist` property](https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#custom-unit-test-classes). -- The `WordPress.Files.FileName` sniff allows now for more theme-specific template hierarchy based file name exceptions. -- The whitelist flag for the `WordPress.VIP.SlowQuery` sniff was `tax_query` which was unintuitive. This has now been changed to `slow query` to be in line with other whitelist flags. -- The `WordPress.WhiteSpace.OperatorSpacing` sniff will now ignore operator spacing within `declare()` statements. -- The `WordPress.WhiteSpace.OperatorSpacing` sniff now extends the upstream `Squiz.WhiteSpace.OperatorSpacing` sniff for improved results and will now also examine the spacing around ternary operators and logical (`&&`, `||`) operators. -- The `WordPress.WP.DeprecatedFunctions` sniff will now detect functions deprecated in WP 4.7 and 4.8. Additionally, a number of other deprecated functions which were previously not being detected have been added to the sniff and for a number of functions the "alternative" for the deprecated function has been added/improved. -- The `WordPress.XSS.EscapeOutput` sniff will now also detect unescaped output when the short open echo tags `` PHP open tags. -- `WordPress.Classes.ClassOpeningStatement` sniff to the `WordPress-Core` ruleset to flag - and fix - class opening brace placement. -- `WordPress.NamingConventions.ValidHookName` sniff to the `WordPress-Core` ruleset to flag filter and action hooks which don't comply with the guideline of lowercase letters and underscores. For maintaining backward-compatibility of hook names an `additionalWordDelimiters` property can be added via a custom ruleset. -- `WordPress.Functions.DontExtract` sniff to the `WordPress-Core` ruleset to flag usage of the `extract()` function. -- `WordPress.PHP.POSIXFunctions` sniff to the `WordPress-Core` ruleset to flag usage of regex functions from the POSIX PHP extension which was deprecated since PHP 5.3 and removed in PHP 7. -- `WordPress.DB.RestrictedFunctions` and `WordPress.DB.RestrictedClasses` sniffs to the `WordPress-Core` ruleset to flag usage of direct database calls using PHP functions and classes rather than the WP functions for the same. -- Abstract `AbstractClassRestrictions` parent class to allow for easier sniffing for usage of specific classes. -- `Squiz.Strings.ConcatenationSpacing`, `PSR2.ControlStructures.ElseIfDeclaration`, `PSR2.Files.ClosingTag`, `Generic.NamingConventions.UpperCaseConstantName` to the `WordPress-Core` ruleset. -- Ability to add arbitrary variables to the whitelist via a custom ruleset property for the `WordPress.NamingConventions.ValidVariableName` sniff. -- Ability to use a whitelist comment for tax queries for the `WordPress.VIP.SlowDBQuery` sniff. -- Instructions on how to use WPCS with Atom and SublimeLinter to the Readme. -- Reference to the [wiki](https://github.com/WordPress/WordPress-Coding-Standards/wiki) to the Readme. -- Recommendation to also use the [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) ruleset to the Readme. - -### Changed -- The minimum required PHP_CodeSniffer version to 2.6.0. -- Moved the `WordPress.WP.PreparedSQL` sniff from `WordPress-Extra` to `WordPress-Core`. -- `WordPress.PHP.StrictInArray` will now also flag non-strict usage of `array_keys()` and `array_search()`. -- Added `_deprecated_constructor()` and `_deprecated_hook()` to the list of printing functions. -- Added numerous additional functions to sniff for to the `WordPress.VIP.RestrictedFunctions` sniff as per the VIP guidelines. -- Upped the `posts_per_page` limit from 50 to 100 in `WordPress.VIP.PostsPerPage` sniff as per the VIP guidelines. -- Added `cat_ID` to the whitelisted exceptions for the `WordPress.NamingConventions.ValidVariableName` sniff. -- Added `__debugInfo` to the magic method whitelist for class methods starting with double underscore in the `WordPress.NamingConventions.ValidFunctionName` sniff. -- An error will now also be thrown for non-magic _functions_ using a double underscore prefix - `WordPress.NamingConventions.ValidFunctionName` sniff. -- The `WordPress.Arrays.ArrayAssignmentRestrictions`, `WordPress.Functions.FunctionRestrictions`, `WordPress.Variables.VariableRestrictions` sniffs weren't in actual fact sniffs, but parent classes for child sniffs. These have now all been turned into proper abstract parent classes and moved to the main `WordPress` directory. -- The array provided to `AbstractFunctionRestrictions` can now take a `whitelist` key to whitelist select functions when blocking a group of functions by function prefix. -- Updated installation instructions in the readme. -- The `WordPress-Core` ruleset is now ordered according to the handbook -- The WPCS code base itself now complies with the WordPress-Core, -Extra and -Docs coding standards. -- Various other code quality and code consistency improvements under the hood. - -### Removed -- `Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose` from the `WordPress-Core` standard (was causing duplicate messages for the same issue). -- `Squiz.Commenting.FunctionComment.ScalarTypeHintMissing`, `Squiz.Commenting.InlineComment.NotCapital` from the `WordPress-Docs` standard. -- Removed the sniffing for `get_pages()` from the `WordPress.VIP.RestrictedFunctions` sniff as per the VIP guidelines. -- Removed the sniffing for `extract()` from the `WordPress.VIP.RestrictedFunctions` sniff as it's now covered in a separate sniff. -- Removed the sniffing for the POSIX functions from the `WordPress.PHP.DiscouragedFunctions` sniff as it's now covered in a separate sniff. - -### Fixed -- Error message precision for the `WordPress.NamingConventions.ValidVariableName` sniff. -- Bug in the `WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd` sniff which was incorrectly being triggered on last method of class. -- Function name sniffs based on the `AbstractFunctionRestrictions` parent class will now do a case-insensitive function name comparison. -- Function name sniffs in the `WordPress.PHP.DiscouragedFunctions` sniff will now do a case-insensitive function name comparison. -- Whitelist comments directly followed by a PHP closing tag were not being recognized. -- Some PHP Magic constants were not recognized by the `WordPress.XSS.EscapeOutput` sniff. -- An error message suggesting camel caps rather than the intended snake case format in the `WordPress.NamingConventions.ValidFunctionName` sniff. -- `WordPress.WhiteSpace.ControlStructureSpacing` should no longer throw error notices during live code review. -- Errors will be no longer be thrown for methods not complying with the naming conventions when the class extends a parent class or implements an interface - `WordPress.NamingConventions.ValidFunctionName` sniff. - - -## [0.9.0] - 2016-02-01 - -### Added -- `count()` to the list of auto-escaped functions. -- `Squiz.PHP.CommentedOutCode` sniff to `WordPress-VIP` ruleset. -- Support for PHP 5.2. -- `attachment_url_to_postid()` and `parse_url()` to the restricted functions for `WordPress-VIP`. -- `WordPress.VIP.OrderByRand` sniff. -- `WordPress.PHP.StrictInArray` sniff for `WordPress-VIP` and `WordPress-Extra`. -- `get_tag_link()`, `get_category_link()`, `get_cat_ID()`, `url_to_post_id()`, `attachment_url_to_postid()` -`get_posts()`, `wp_get_recent_posts()`, `get_pages()`, `get_children()`, `wp_get_post_terms()` -`wp_get_post_categories()`, `wp_get_post_tags()`, `wp_get_object_terms()`, `term_exists()`, -`count_user_posts()`, `wp_old_slug_redirect()`, `get_adjacent_post()`, `get_previous_post()`, -`get_next_post()` to uncached functions in `WordPress.VIP.RestrictedFunctions` sniff. -- `wp_handle_upload()` and `array_key_exists()` to the list of sanitizing functions. -- Checking for object properties in `WordPress.PHP.YodaConditions` sniff. -- `WordPress.NamingConventions.ValidVariableName` sniff. -- Flagging of function calls incorporated into database queries in `WordPress.WP.PreparedSQL`. -- Recognition of escaping and auto-escaped functions in `WordPress.WP.PreparedSQL`. -- `true`, `false`, and `null` to the tokens ignored in `WordPress.XSS.EscapeOutput`. - -### Fixed -- Incorrect ternary detection in `WordPress.XSS.EscapeOutput` sniff. -- False positives when detecting variables interpolated into strings in the -`WordPress.WP.PreparedSQL` and `WordPress.VIP.ValidatedSanitizedInput` sniffs. -- False positives in `WordPress.PHP.YodaConditions` when the variable is being casted. -- `$wpdb` properties being flagged in `WordPress.WP.PreparedSQL` sniff. -- False positive in `WordPress.PHP.YodaConditions` when the a string is on the left side of the -comparison. - -## [0.8.0] - 2015-10-02 - -### Added -- `implode()` and `join()` to the list of formatting functions in the `WordPress.XSS.EscapeOutput` -sniff. This is useful when you need to have HTML in the `$glue` parameter. -- Support in the `WordPress.XSS.EscapeOutput` sniff for escaping an array of values -using `array_map()`. (Otherwise the support for `implode()` isn't of much use :) -- Docs for running WPCS in Sublime Text. -- `nl2br()` to the list of formatting functions. -- `wp_dropdown_pages()` to the list of printing functions. -- Error codes to all error/warning messages. -- `WordPress.WP.PreparedSQL` sniff for flagging unprepared SQL queries. - -### Removed -- Sniffing for the number of spaces before a closure's opening parenthesis from the -default configuration of the `WordPress.WhiteSpace.ControlStructureSpacing` sniff. It -can be re-enabled per-project as desired. - -### Fixed -- The `WordPress.XSS.EscapeOutput` sniff giving error messages with the closing -parenthesis in them instead of the offending function's name. - -## [0.7.1] - 2015-08-31 - -### Changed -- The default number of spaces before a closure's opening parenthesis from 1 to 0. - -## [0.7.0] - 2015-08-30 - -### Added -- Automatic error fixing to the `WordPress.Arrays.ArrayKeySpacingRestrictions` sniff. -- Functions and closures to the control structures checked by the `WordPress.WhiteSpace.ControlStructureSpacing` -sniff. -- Sniffing and fixing for extra spacing in the `WordPress.WhiteSpace.ControlStructureSpacing` -sniff. (Previously it only checked for insufficient spacing.) -- `.twig` files to the default ignored files. -- `esc_url_raw()` and `hash_equals()` to the list of sanitizing functions. -- `intval()` and `boolval()` to list of unslashing functions. -- `do_shortcode()` to the list of auto-escaped functions. - -### Removed -- `WordPress.Functions.FunctionDeclarationArgumentSpacing` in favor of the upstream -sniff `Squiz.Functions.FunctionDeclarationArgumentSpacing`. - -### Fixed -- Reference to incorrect issue in the inline docs of the `WordPress.VIP.SessionVariableUsage` -sniff. -- `WordPress.XSS.EscapeOutput` sniff incorrectly handling ternary conditions in -`echo` statements without parentheses in some cases. - -## [0.6.0] - 2015-06-30 - -### Added -- Support for `wp_cache_add()` and `wp_cache_delete()`, as well as custom cache -functions,in the `WordPress.VIP.DirectDatabaseQuery` sniff. - -### Removed -- `WordPress.Functions.FunctionRestrictions` and `WordPress.Variables.VariableRestrictions` -from the `WordPress-VIP` standard, since they are just parents for other sniffs. - -## [0.5.0] - 2015-06-01 - -### Added -- `WordPress.CSRF.NonceVerification` sniff to flag form processing without nonce verification. -- `in_array()` and `is_array()` to the list of sanitizing functions. -- Support for automatic error fixing to the `WordPress.Arrays.ArrayDeclaration` sniff. -- `WordPress.PHP.StrictComparisions` to the `WordPress-VIP` and `WordPress-Extra` rulesets. -- `WordPress-Docs` ruleset to sniff for proper commenting. -- `Generic.PHP.LowerCaseKeyword`, `Generic.Files.EndFileNewline`, `Generic.Files.LowercasedFilename`, -`Generic.Formatting.SpaceAfterCast`, and `Generic.Functions.OpeningFunctionBraceKernighanRitchie` to the `WordPress-Core` ruleset. -- `Generic.PHP.DeprecatedFunctions`, `Generic.PHP.ForbiddenFunctions`, `Generic.Functions.CallTimePassByReference`, -`Generic.Formatting.DisallowMultipleStatements`, `Generic.CodeAnalysis.EmptyStatement`, -`Generic.CodeAnalysis.ForLoopShouldBeWhileLoop`, `Generic.CodeAnalysis.ForLoopWithTestFunctionCall`, -`Generic.CodeAnalysis.JumbledIncrementer`, `Generic.CodeAnalysis.UnconditionalIfStatement`, -`Generic.CodeAnalysis.UnnecessaryFinalModifier`, `Generic.CodeAnalysis.UselessOverridingMethod`, -`Generic.Classes.DuplicateClassName`, and `Generic.Strings.UnnecessaryStringConcat` to the `WordPress-Extra` ruleset. -- Error for missing use of `wp_unslash()` on superglobal data to the `WordPress.VIP.ValidatedSanitizedInput` sniff. - -### Changed -- The `WordPress.VIP.ValidatedSanitizedInput` sniff to require sanitization of input even when it is being directly escaped and output. -- The minimum required PHP_CodeSniffer version to 2.2.0. -- The `WordPress.VIP.ValidatedSanitizedInput` and `WordPress.XSS.EscapeOutput` sniffs: -the list of escaping functions was split from the list of sanitizing functions. The `customSanitizingFunctions` -property has been moved to the `ValidatedSanitizedInput` sniff, and the `customEscapingFunctions` -property should now be used instead for the `EscapeOutput` sniff. -- The `WordPress.Arrays.ArrayDeclaration` sniff to give errors for `NoSpaceAfterOpenParenthesis`, `SpaceAfterArrayOpener`, and `SpaceAfterArrayCloser`, instead of warnings. -- The `WordPress.NamingConventions.ValidFunctionName` sniff to allow camelCase method names in classes that implement interfaces. - -### Fixed -- The `WordPress.VIP.ValidatedSanitizedInput` sniff not reporting missing validation when reporting missing sanitization. -- The `WordPress.VIP.ValidatedSanitizedInput` sniff flagging superglobals as needing sanitization when they were only being used in a comparison using `if` or `switch`, etc. - -## [0.4.0] - 2015-05-01 - -### Added -- Change log file. -- Handling for string-interpolated input variables in the `WordPress.VIP.ValidatedSanitizedInput` sniff. -- Errors for using uncached functions when cached equivalents exist. -- `space_before_colon` setting for the `WordPress.WhiteSpace.ControlStructureSpacing` sniff, for control structures using alternative syntax. Possible values: `'required'`, `'optional'`, `'forbidden'`. -- Support for `sanitization` whitelisting comments for the `WordPress.VIP.ValidatedSanitizedInput` sniff. -- Granular error/warning names for all errors and warnings. -- Handling for ternary conditions in the `WordPress.XSS.EscapeOutput` sniff. -- `die`, `exit`, `printf`, `vprintf`, `wp_die`, `_deprecated_argument`, `_deprecated_function`, `_deprecated_file`, `_doing_it_wrong`, `trigger_error`, and `user_error` to the list of printing functions in the `WordPress.XSS.EscapeOutput` sniff. -- `customPrintingFunctions` setting for the `WordPress.XSS.EscapeOutput` sniff. -- `rawurlencode()` and `wp_parse_id_list()` to the list of "sanitizing" functions in the `WordPress.XSS.EscapeOutput` sniff. -- `json_encode()` to the list of discouraged functions in the `WordPress.PHP.DiscouragedFunctions` sniff, in favor of `wp_json_encode()`. -- `vip_powered_wpcom()` to the list of auto-escaped functions in the `WordPress.XSS.EscapeOutput` sniff. -- `debug_print_backtrace()` and `var_export()` to the list of discouraged functions in the `WordPress.PHP.DiscouragedFunctions` sniff. -- Smart handling for formatting functions (`sprintf()` and `wp_sprintf()`) in the `WordPress.XSS.EscapeOutput` sniff. -- `WordPress.PHP.StrictComparisons` sniff. -- Correct handling of `array_map()` in the `WordPress.VIP.ValidatedSanitizedInput` sniff. -- `$_COOKIE` and `$_FILE` to the list of superglobals flagged by the `WordPress.VIP.ValidatedSanitizedInput` and `WordPress.VIP.SuperGlobalInputUsage` sniffs. -- `$_SERVER` to the list of superglobals flagged by the `WordPress.VIP.SuperGlobalInputUsage` sniff. -- `Squiz.ControlStructures.ControlSignature` sniff to the rulesets. - -### Changed -- `WordPress.Arrays.ArrayKeySpacingRestrictions` sniff to give errors for `NoSpacesAroundArrayKeys` and `SpacesAroundArrayKeys` instead of just warnings. -- `WordPress.NamingConventions.ValidFunctionName` sniff to allow for camel caps method names in child classes. -- `WordPress.XSS.EscapeOutput` sniff to allow for integers (e.g. `echo 5` and `print( -1 )`). - -### Removed -- Errors for mixed key/keyless array elements in the `WordPress.Arrays.ArrayDeclaration` sniff. -- BOM from `WordPress.WhiteSpace.OperatorSpacing` sniff file. -- `$content_width` from the list of non-overwritable globals in the `WordPress.Variables.GlobalVariables` sniff. -- `WordPress.Arrays.ArrayAssignmentRestrictions` sniff from the `WordPress-VIP` ruleset. - -### Fixed -- Incorrect errors for `else` statements using alternative syntax. -- `WordPress.VIP.ValidatedSanitizedInput` sniff not always treating casting as sanitization. -- `WordPress.XSS.EscapeOutput` sniff flagging comments as needing to be escaped. -- `WordPress.XSS.EscapeOutput` sniff not sniffing comma-delimited `echo` arguments after encountering the first escaping function in the statement. -- `WordPress.PHP.YodaConditions` sniff not flagging comparisons to constants or function calls. -- `WordPress.Arrays.ArrayDeclaration` sniff not ignoring doc comments. -- Link to phpStorm instructions in `README.md`. -- Poor performance of the `WordPress.Arrays.ArrayAssignmentRestrictions` sniff. -- Poor performance of the `WordPress.Files.FileName` sniff. - -## [0.3.0] - 2014-12-11 - -See the comparison for full list. - -### Changed -- Use semantic version tags for releases. - -## [2013-10-06] - -See the comparison for full list. - -## 2013-06-11 - -Initial tagged release. - -[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer -[PHP_CodeSniffer]: https://github.com/PHPCSStandards/PHP_CodeSniffer - -[Unreleased]: https://github.com/WordPress/WordPress-Coding-Standards/compare/main...HEAD -[3.1.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/3.0.1...3.1.0 -[3.0.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/3.0.0...3.0.1 -[3.0.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.3.0...3.0.0 -[2.3.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.2.1...2.3.0 -[2.2.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.2.0...2.2.1 -[2.2.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.1.1...2.2.0 -[2.1.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.1.0...2.1.1 -[2.1.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.0.0...2.1.0 -[2.0.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2.0.0-RC1...2.0.0 -[2.0.0-RC1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/1.2.1...2.0.0-RC1 -[1.2.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/1.2.0...1.2.1 -[1.2.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.14.1...1.0.0 -[0.14.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.14.0...0.14.1 -[0.14.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.13.1...0.14.0 -[0.13.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.13.0...0.13.1 -[0.13.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.12.0...0.13.0 -[0.12.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.11.0...0.12.0 -[0.11.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.10.0...0.11.0 -[0.10.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.9.0...0.10.0 -[0.9.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.8.0...0.9.0 -[0.8.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.7.1...0.8.0 -[0.7.1]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.7.0...0.7.1 -[0.7.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.6.0...0.7.0 -[0.6.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.5.0...0.6.0 -[0.5.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.4.0...0.5.0 -[0.4.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/0.3.0...0.4.0 -[0.3.0]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2013-10-06...0.3.0 -[2013-10-06]: https://github.com/WordPress/WordPress-Coding-Standards/compare/2013-06-11...2013-10-06 - -[@anomiex]: https://github.com/anomiex -[@Chouby]: https://github.com/Chouby -[@ckanitz]: https://github.com/ckanitz -[@craigfrancis]: https://github.com/craigfrancis -[@dawidurbanski]: https://github.com/dawidurbanski -[@desrosj]: https://github.com/desrosj -[@grappler]: https://github.com/grappler -[@Ipstenu]: https://github.com/Ipstenu -[@JDGrimes]: https://github.com/JDGrimes -[@khacoder]: https://github.com/khacoder -[@Luc45]: https://github.com/Luc45 -[@marconmartins]: https://github.com/marconmartins -[@NielsdeBlaauw]: https://github.com/NielsdeBlaauw -[@rodrigoprimo]: https://github.com/rodrigoprimo -[@slaFFik]: https://github.com/slaFFik -[@sandeshjangam]: https://github.com/sandeshjangam -[@westonruter]: https://github.com/westonruter diff --git a/trunk/vendor/wp-coding-standards/wpcs/LICENSE b/trunk/vendor/wp-coding-standards/wpcs/LICENSE deleted file mode 100644 index 359e1a72..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2009 John Godley and contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml deleted file mode 100644 index 12c928bf..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml +++ /dev/null @@ -1,948 +0,0 @@ - - - - Non-controversial generally-agreed upon WordPress Coding Standards - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - warning - - - warning - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - 0 - - - - 0 - - - 0 - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - warning - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - warning - - - - - - - - - - - - - error - The "goto" language construct should not be used. - - - - - error - eval() is a security risk so not allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - 0 - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml deleted file mode 100644 index c8b5969a..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - WordPress Coding Standards for Inline Documentation and Comments - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml deleted file mode 100644 index ab0e8db3..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - Best practices beyond core WordPress Coding Standards - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - 5 - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php deleted file mode 100644 index c72fdd91..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php +++ /dev/null @@ -1,261 +0,0 @@ - - */ - public static $groups = array(); - - /** - * Cache for the excluded groups information. - * - * @since 0.11.0 - * - * @var array - */ - protected $excluded_groups = array(); - - /** - * Cache for the group information. - * - * @since 0.13.0 - * - * @var array - */ - protected $groups_cache = array(); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() { - // Retrieve the groups only once and don't set up a listener if there are no groups. - if ( false === $this->setup_groups() ) { - return array(); - } - - return array( - \T_DOUBLE_ARROW, - \T_CLOSE_SQUARE_BRACKET, - \T_CONSTANT_ENCAPSED_STRING, - \T_DOUBLE_QUOTED_STRING, - ); - } - - /** - * Groups of variables to restrict. - * - * This method should be overridden in extending classes. - * - * Example: groups => array( - * 'groupname' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Descriptive error message. The error message will be passed the $key and $val of the current array assignment.', - * 'keys' => array( 'key1', 'another_key' ), - * ) - * ) - * - * @return array - */ - abstract public function getGroups(); - - /** - * Cache the groups. - * - * @since 0.13.0 - * - * @return bool True if the groups were setup. False if not. - */ - protected function setup_groups() { - $this->groups_cache = $this->getGroups(); - - if ( empty( $this->groups_cache ) && empty( self::$groups ) ) { - return false; - } - - // Allow for adding extra unit tests. - if ( ! empty( self::$groups ) ) { - $this->groups_cache = array_merge( $this->groups_cache, self::$groups ); - } - - return true; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function process_token( $stackPtr ) { - - $this->excluded_groups = RulesetPropertyHelper::merge_custom_array( $this->exclude ); - if ( array_diff_key( $this->groups_cache, $this->excluded_groups ) === array() ) { - // All groups have been excluded. - // Don't remove the listener as the exclude property can be changed inline. - return; - } - - $token = $this->tokens[ $stackPtr ]; - - if ( \T_CLOSE_SQUARE_BRACKET === $token['code'] ) { - $equalPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( \T_EQUAL !== $this->tokens[ $equalPtr ]['code'] - && \T_COALESCE_EQUAL !== $this->tokens[ $equalPtr ]['code'] - ) { - // This is not an assignment. Bow out. - return; - } - } - - // Instances: Multi-dimensional array. - $inst = array(); - - /* - * Covers array assignments: - * `$foo = array( 'bar' => 'taz' );` - * `$foo['bar'] = $taz;` - */ - if ( \T_CLOSE_SQUARE_BRACKET === $token['code'] || \T_DOUBLE_ARROW === $token['code'] ) { - $operator = $stackPtr; // T_DOUBLE_ARROW. - if ( \T_CLOSE_SQUARE_BRACKET === $token['code'] ) { - $operator = $equalPtr; - } - - $keyIdx = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); - if ( isset( Tokens::$stringTokens[ $this->tokens[ $keyIdx ]['code'] ] ) - && ! is_numeric( $this->tokens[ $keyIdx ]['content'] ) - ) { - $key = TextStrings::stripQuotes( $this->tokens[ $keyIdx ]['content'] ); - $valStart = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $operator + 1 ), null, true ); - $valEnd = BCFile::findEndOfStatement( $this->phpcsFile, $valStart, \T_COLON ); - if ( \T_COMMA === $this->tokens[ $valEnd ]['code'] - || \T_SEMICOLON === $this->tokens[ $valEnd ]['code'] - ) { - // FindEndOfStatement includes the comma/semi-colon if that's the end of the statement. - // That's not what we want (and inconsistent), so remove it. - --$valEnd; - } - - $val = trim( GetTokensAsString::compact( $this->phpcsFile, $valStart, $valEnd, true ) ); - $inst[ $key ] = array( - 'value' => $val, - 'line' => $token['line'], - 'keyptr' => $keyIdx, - ); - } - } elseif ( isset( Tokens::$stringTokens[ $token['code'] ] ) ) { - /* - * Covers assignments via query parameters: `$foo = 'bar=taz&other=thing';`. - */ - if ( preg_match_all( '#(?:^|&)([a-z_]+)=([^&]*)#i', TextStrings::stripQuotes( $token['content'] ), $matches ) <= 0 ) { - return; // No assignments here, nothing to check. - } - - foreach ( $matches[1] as $match_nr => $key ) { - $inst[ $key ] = array( - 'value' => $matches[2][ $match_nr ], - 'line' => $token['line'], - 'keyptr' => $stackPtr, - ); - } - } - - if ( empty( $inst ) ) { - return; - } - - foreach ( $this->groups_cache as $groupName => $group ) { - - if ( isset( $this->excluded_groups[ $groupName ] ) ) { - continue; - } - - foreach ( $inst as $key => $assignment ) { - if ( ! \in_array( $key, $group['keys'], true ) ) { - continue; - } - - $output = \call_user_func( array( $this, 'callback' ), $key, $assignment['value'], $assignment['line'], $group ); - - if ( ! isset( $output ) || false === $output ) { - continue; - } elseif ( true === $output ) { - $message = $group['message']; - } else { - $message = $output; - } - - MessageHelper::addMessage( - $this->phpcsFile, - $message, - $assignment['keyptr'], - ( 'error' === $group['type'] ), - MessageHelper::stringToErrorcode( $groupName . '_' . $key ), - array( $key, $assignment['value'] ) - ); - } - } - } - - /** - * Callback to process each confirmed key, to check value. - * - * This method must be extended to add the logic to check assignment value. - * - * @param string $key Array index / key. - * @param mixed $val Assigned value. - * @param int $line Token line. - * @param array $group Group definition. - * - * @return mixed FALSE if no match, TRUE if matches, STRING if matches - * with custom error message passed to ->process(). - */ - abstract public function callback( $key, $val, $line, $group ); -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php deleted file mode 100644 index fbc18af3..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php +++ /dev/null @@ -1,257 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Avoid direct calls to the database.', - * 'classes' => array( 'PDO', '\Namespace\Classname' ), - * ) - * ) - * - * You can use * wildcards to target a group of (namespaced) classes. - * Aliased namespaces (use ..) are currently not supported. - * - * Documented here for clarity. Not (re)defined as it is already defined in the parent class. - * - * @return array - * - abstract public function getGroups(); - */ - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() { - // Prepare the function group regular expressions only once. - if ( false === $this->setup_groups( 'classes' ) ) { - return array(); - } - - return array( - \T_DOUBLE_COLON, - \T_NEW, - \T_EXTENDS, - \T_IMPLEMENTS, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * {@internal Unlike in the `AbstractFunctionRestrictionsSniff`, - * we can't do a preliminary check on classes as at this point - * we don't know the class name yet.}} - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - // Reset the temporary storage before processing the token. - unset( $this->classname ); - - $this->excluded_groups = RulesetPropertyHelper::merge_custom_array( $this->exclude ); - if ( array_diff_key( $this->groups, $this->excluded_groups ) === array() ) { - // All groups have been excluded. - // Don't remove the listener as the exclude property can be changed inline. - return; - } - - if ( true === $this->is_targetted_token( $stackPtr ) ) { - return $this->check_for_matches( $stackPtr ); - } - } - - /** - * Determine if we have a valid classname for the target token. - * - * @since 0.11.0 This logic was originally contained in the `process()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return bool - */ - public function is_targetted_token( $stackPtr ) { - - $token = $this->tokens[ $stackPtr ]; - $classname = ''; - - if ( \in_array( $token['code'], array( \T_NEW, \T_EXTENDS, \T_IMPLEMENTS ), true ) ) { - if ( \T_NEW === $token['code'] ) { - $nameEnd = ( $this->phpcsFile->findNext( array( \T_OPEN_PARENTHESIS, \T_WHITESPACE, \T_SEMICOLON, \T_CLOSE_PARENTHESIS, \T_CLOSE_TAG ), ( $stackPtr + 2 ) ) - 1 ); - } else { - $nameEnd = ( $this->phpcsFile->findNext( array( \T_CLOSE_CURLY_BRACKET, \T_WHITESPACE ), ( $stackPtr + 2 ) ) - 1 ); - } - - $classname = GetTokensAsString::noEmpties( $this->phpcsFile, ( $stackPtr + 2 ), $nameEnd ); - $classname = $this->get_namespaced_classname( $classname, ( $stackPtr - 1 ) ); - } - - if ( \T_DOUBLE_COLON === $token['code'] ) { - $nameEnd = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); - if ( \T_STRING !== $this->tokens[ $nameEnd ]['code'] ) { - // Hierarchy keyword or object stored in variable. - return false; - } - - $nameStart = ( $this->phpcsFile->findPrevious( Collections::namespacedNameTokens(), ( $nameEnd - 1 ), null, true ) + 1 ); - $classname = GetTokensAsString::noEmpties( $this->phpcsFile, $nameStart, $nameEnd ); - $classname = $this->get_namespaced_classname( $classname, ( $nameStart - 1 ) ); - } - - // Stop if we couldn't determine a classname. - if ( empty( $classname ) ) { - return false; - } - - // Nothing to do if one of the hierarchy keywords - 'parent', 'self' or 'static' - is used. - if ( \in_array( strtolower( $classname ), array( '\parent', '\self', '\static' ), true ) ) { - return false; - } - - $this->classname = $classname; - return true; - } - - /** - * Verify if the current token is one of the targetted classes. - * - * @since 0.11.0 Split out from the `process()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function check_for_matches( $stackPtr ) { - $skip_to = array(); - - foreach ( $this->groups as $groupName => $group ) { - - if ( isset( $this->excluded_groups[ $groupName ] ) ) { - continue; - } - - if ( preg_match( $group['regex'], $this->classname ) === 1 ) { - $skip_to[] = $this->process_matched_token( $stackPtr, $groupName, $this->classname ); - } - } - - if ( empty( $skip_to ) || min( $skip_to ) === 0 ) { - return; - } - - return min( $skip_to ); - } - - /** - * Process a matched token. - * - * @since 0.11.0 Split out from the `process()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in it original case. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - * - * @phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod.Found - */ - public function process_matched_token( $stackPtr, $group_name, $matched_content ) { - parent::process_matched_token( $stackPtr, $group_name, $matched_content ); - } - // phpcs:enable - - /** - * Prepare the class name for use in a regular expression. - * - * The getGroups() method allows for providing class names with a wildcard * to target - * a group of classes within a namespace. It also allows for providing class names as - * 'ordinary' names or prefixed with one or more namespaces. - * This prepare routine takes that into account while still safely escaping the - * class name for use in a regular expression. - * - * @param string $classname Class name, potentially prefixed with namespaces. - * @return string Regex escaped class name. - */ - protected function prepare_name_for_regex( $classname ) { - $classname = trim( $classname, '\\' ); // Make sure all classnames have a \ prefix, but only one. - return parent::prepare_name_for_regex( $classname ); - } - - /** - * See if the classname was found in a namespaced file and if so, add the namespace to the classname. - * - * @param string $classname The full classname as found. - * @param int $search_from The token position to search up from. - * @return string Classname, potentially prefixed with the namespace. - */ - protected function get_namespaced_classname( $classname, $search_from ) { - // Don't do anything if this is already a fully qualified classname. - if ( empty( $classname ) || '\\' === $classname[0] ) { - return $classname; - } - - // Remove the namespace keyword if used. - if ( 0 === stripos( $classname, 'namespace\\' ) ) { - $classname = substr( $classname, 10 ); - } - - $namespace = Namespaces::determineNamespace( $this->phpcsFile, $search_from ); - if ( '' === $namespace ) { - // No namespace keyword found at all, so global namespace. - $classname = '\\' . $classname; - } else { - $classname = '\\' . $namespace . '\\' . $classname; - } - - return $classname; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php deleted file mode 100644 index c6395a70..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php +++ /dev/null @@ -1,111 +0,0 @@ -target_functions ) ) { - return array(); - } - - return array( - $this->group_name => array( - 'functions' => array_keys( $this->target_functions ), - ), - ); - } - - /** - * Process a matched token. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_matched_token( $stackPtr, $group_name, $matched_content ) { - - $parameters = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); - - if ( empty( $parameters ) ) { - return $this->process_no_parameters( $stackPtr, $group_name, $matched_content ); - } else { - return $this->process_parameters( $stackPtr, $group_name, $matched_content, $parameters ); - } - } - - /** - * Process the parameters of a matched function. - * - * This method has to be made concrete in child classes. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - abstract public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ); - - /** - * Process the function if no parameters were found. - * - * Defaults to doing nothing. Can be overloaded in child classes to handle functions - * were parameters are expected, but none found. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_no_parameters( $stackPtr, $group_name, $matched_content ) {} -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php deleted file mode 100644 index dfa97b5a..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php +++ /dev/null @@ -1,358 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function', 'mysql_*' ), - * // Only useful when using wildcards: - * 'allow' => array( 'mysql_to_rfc3339' => true, ), - * ) - * ) - * - * You can use * wildcards to target a group of functions. - * When you use * wildcards, you may inadvertently restrict too many - * functions. In that case you can add the `allow` key to - * safe list individual functions to prevent false positives. - * - * @return array - */ - abstract public function getGroups(); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() { - // Prepare the function group regular expressions only once. - if ( false === $this->setup_groups( 'functions' ) ) { - return array(); - } - - return array( - \T_STRING, - ); - } - - /** - * Set up the regular expressions for each group. - * - * @since 0.10.0 - * - * @param string $key The group array index key where the input for the regular expression can be found. - * @return bool True if the groups were setup. False if not. - */ - protected function setup_groups( $key ) { - // Prepare the function group regular expressions only once. - $this->groups = $this->getGroups(); - - if ( empty( $this->groups ) && empty( self::$unittest_groups ) ) { - return false; - } - - // Allow for adding extra unit tests. - if ( ! empty( self::$unittest_groups ) ) { - $this->groups = array_merge( $this->groups, self::$unittest_groups ); - } - - $all_items = array(); - foreach ( $this->groups as $groupName => $group ) { - if ( empty( $group[ $key ] ) ) { - unset( $this->groups[ $groupName ] ); - continue; - } - - // Lowercase the items and potential allows as the comparisons should be done case-insensitively. - // Note: this disregards non-ascii names, but as we don't have any of those, that is okay for now. - $items = array_map( 'strtolower', $group[ $key ] ); - $this->groups[ $groupName ][ $key ] = $items; - - if ( ! empty( $group['allow'] ) ) { - $this->groups[ $groupName ]['allow'] = array_change_key_case( $group['allow'], \CASE_LOWER ); - } - - $items = array_map( array( $this, 'prepare_name_for_regex' ), $items ); - $all_items[] = $items; - $items = implode( '|', $items ); - - $this->groups[ $groupName ]['regex'] = sprintf( $this->regex_pattern, $items ); - } - - if ( empty( $this->groups ) ) { - return false; - } - - // Create one "super-regex" to allow for initial filtering. - $all_items = \call_user_func_array( 'array_merge', $all_items ); - $all_items = implode( '|', array_unique( $all_items ) ); - $this->prelim_check_regex = sprintf( $this->regex_pattern, $all_items ); - - return true; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - - $this->excluded_groups = RulesetPropertyHelper::merge_custom_array( $this->exclude ); - if ( array_diff_key( $this->groups, $this->excluded_groups ) === array() ) { - // All groups have been excluded. - // Don't remove the listener as the exclude property can be changed inline. - return; - } - - // Preliminary check. If the content of the T_STRING is not one of the functions we're - // looking for, we can bow out before doing the heavy lifting of checking whether - // this is a function call. - if ( preg_match( $this->prelim_check_regex, $this->tokens[ $stackPtr ]['content'] ) !== 1 ) { - return; - } - - if ( true === $this->is_targetted_token( $stackPtr ) ) { - return $this->check_for_matches( $stackPtr ); - } - } - - /** - * Verify is the current token is a function call. - * - * @since 0.11.0 Split out from the `process()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return bool - */ - public function is_targetted_token( $stackPtr ) { - // Exclude function definitions, class methods, and namespaced calls. - if ( ContextHelper::has_object_operator_before( $this->phpcsFile, $stackPtr ) === true ) { - return false; - } - - if ( ContextHelper::is_token_namespaced( $this->phpcsFile, $stackPtr ) === true ) { - return false; - } - - if ( Context::inAttribute( $this->phpcsFile, $stackPtr ) ) { - // Class instantiation or constant in attribute, not function call. - return false; - } - - $search = Tokens::$emptyTokens; - $search[ \T_BITWISE_AND ] = \T_BITWISE_AND; - - $prev = $this->phpcsFile->findPrevious( $search, ( $stackPtr - 1 ), null, true ); - - // Skip sniffing on function, OO definitions or for function aliases in use statements. - $invalid_tokens = Tokens::$ooScopeTokens; - $invalid_tokens += array( - \T_FUNCTION => \T_FUNCTION, - \T_NEW => \T_NEW, - \T_AS => \T_AS, // Use declaration alias. - ); - - if ( isset( $invalid_tokens[ $this->tokens[ $prev ]['code'] ] ) ) { - return false; - } - - // Check if this could even be a function call. - $next = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( false === $next ) { - return false; - } - - // Check for `use function ... (as|;)`. - if ( ( \T_STRING === $this->tokens[ $prev ]['code'] && 'function' === $this->tokens[ $prev ]['content'] ) - && ( \T_AS === $this->tokens[ $next ]['code'] || \T_SEMICOLON === $this->tokens[ $next ]['code'] ) - ) { - return true; - } - - // If it's not a `use` statement, there should be parenthesis. - if ( \T_OPEN_PARENTHESIS !== $this->tokens[ $next ]['code'] ) { - return false; - } - - return true; - } - - /** - * Verify if the current token is one of the targetted functions. - * - * @since 0.11.0 Split out from the `process()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function check_for_matches( $stackPtr ) { - $token_content = strtolower( $this->tokens[ $stackPtr ]['content'] ); - $skip_to = array(); - - foreach ( $this->groups as $groupName => $group ) { - - if ( isset( $this->excluded_groups[ $groupName ] ) ) { - continue; - } - - if ( isset( $group['allow'][ $token_content ] ) ) { - continue; - } - - if ( preg_match( $group['regex'], $token_content ) === 1 ) { - $skip_to[] = $this->process_matched_token( $stackPtr, $groupName, $token_content ); - } - } - - if ( empty( $skip_to ) || min( $skip_to ) === 0 ) { - return; - } - - return min( $skip_to ); - } - - /** - * Process a matched token. - * - * @since 0.11.0 Split out from the `process()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_matched_token( $stackPtr, $group_name, $matched_content ) { - - MessageHelper::addMessage( - $this->phpcsFile, - $this->groups[ $group_name ]['message'], - $stackPtr, - ( 'error' === $this->groups[ $group_name ]['type'] ), - MessageHelper::stringToErrorcode( $group_name . '_' . $matched_content ), - array( $matched_content ) - ); - } - - /** - * Prepare the function name for use in a regular expression. - * - * The getGroups() method allows for providing function names with a wildcard * to target - * a group of functions. This prepare routine takes that into account while still safely - * escaping the function name for use in a regular expression. - * - * @since 0.10.0 - * - * @param string $function_name Function name. - * @return string Regex escaped function name. - */ - protected function prepare_name_for_regex( $function_name ) { - $function_name = str_replace( array( '.*', '*' ), '@@', $function_name ); // Replace wildcards with placeholder. - $function_name = preg_quote( $function_name, '`' ); - $function_name = str_replace( '@@', '.*', $function_name ); // Replace placeholder with regex wildcard. - - return $function_name; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml deleted file mode 100644 index 0833cce3..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - 22, -); - ]]> - - - 22, - ); - ]]> - - - - - - - - 22, - 'comment_count' => array( - 'value' => 25, - 'compare' => '>=', - ), - 'post_type' => array( - 'post', - 'page', - ), -); - ]]> - - - 22, - 'comment_count' => array( - 'value' => 25, - 'compare' => '>=', - ), - 'post_type' => array( - 'post', - 'page', - ), -); - ]]> - - - - - - - - 'start of phrase' - . 'concatented additional phrase' - . 'more text', -); - ]]> - - - 'start of phrase' -. 'concatented additional phrase' -. 'more text', -); - ]]> - - - - - - - - << - start of phrase - concatented additional phrase - more text -EOD -, -); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml deleted file mode 100644 index b42ca4cf..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - [ $post_id ]; -$post_title = $post[ 'concatenated' . $title ]; -$post = $posts[ HOME_PAGE ]; -$post = $posts[123]; -$post_title = $post['post_title']; - ]]> - - - [$post_id]; -$post_title = $post['concatenated' . $title ]; -$post = $posts[HOME_PAGE]; -$post = $posts[ 123 ]; -$post_title = $post[ 'post_title' ]; - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml deleted file mode 100644 index e5c85676..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - => 22 ); -$bar = array( 'year' => $current_year ); - ]]> - - - =>22 ); -$bar = array( 'year'=> $current_year ); - ]]> - - - - - - - - => 22, - 'year' => $current_year, - 'monthnum' => $current_month, -); - ]]> - - - => 22, - 'year' => $current_year, - 'monthnum' => $current_month, -); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml deleted file mode 100644 index 43950a09..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - esc_html__( 'text', 'domain' ); - ]]> - - - esc_html( 'text', 'domain' ); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml deleted file mode 100644 index e5a2c1bc..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - time(); - ]]> - - - current_time( 'timestamp', true ); - ]]> - - - - - 'Y-m-d' ); - ]]> - - - current_time( 'U', false ); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml deleted file mode 100644 index 845869d0..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - DateTime(); -$date->setTimezone( - new DateTimeZone( 'Europe/Amsterdam' ) -); - ]]> - - - date_default_timezone_set( 'Europe/Amsterdam' ); - ]]> - - - - - - - - gmdate( - 'Y-m-d\TH:i:s', - strtotime( $plugin['last_updated'] ) -); - ]]> - - - date( - 'Y-m-d\TH:i:s', - strtotime( $plugin['last_updated'] ) -); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml deleted file mode 100644 index a97d1394..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - 'ECPT_VERSION', '1.0' ); - -$ecpt_admin = new ECPT_Admin_Page(); - -class ECPT_Admin_Page {} - -apply_filter( - 'ecpt_modify_content', - $ecpt_content -); - ]]> - - - 'PLUGIN_VERSION', '1.0' ); - -$admin = new Admin_Page(); - -class Admin_Page {} - -apply_filter( - 'modify_content', - $content -); - ]]> - - - - - ECPT_Plugin\Admin; - -// Constants declared using `const` will -// be namespaced and therefore prefixed. -const VERSION = 1.0; - -// A class declared in a (prefixed) namespace -// is automatically prefixed. -class Admin_Page {} - -// Variables in a namespaced file are not -// namespaced, so still need prefixing. -$ecpt_admin = new Admin_Page(); - -// Hook names are not subject to namespacing. -apply_filter( - 'ecpt_modify_content', - $ecpt_content -); - ]]> - - - Admin; - -// As the namespace is not prefixed, this -// is still bad. -const VERSION = 1.0; - -// As the namespace is not prefixed, this -// is still bad. -class Admin_Page {} - ]]> - - - - - - - - mycoolplugin_save_post() {} - ]]> - - - wp_save_post() {} - ]]> - - - - - - - - MyPluginIsCool {} - ]]> - - - My {} - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml deleted file mode 100644 index 387769d9..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - 'prefix_hook_name', $var ); - ]]> - - - 'Prefix_Hook_NAME', $var ); - ]]> - - - - - 'prefix_hook_name', $var ); - ]]> - - - 'prefix\hook-name', $var ); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml deleted file mode 100644 index fe88dfd6..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - 'my_short_slug', - array() -); - ]]> - - - 'my_own_post_type_too_long', - array() -); - ]]> - - - - - - - - 'my_post_type_slug', - array() -); - ]]> - - - 'my/post/type/slug', - array() -); - ]]> - - - - - - - - 'my_post_active', - array() -); - ]]> - - - "my_post_{$status}", - array() -); - ]]> - - - - - - - - 'prefixed_author', - array() -); - ]]> - - - 'author', - array() -); - ]]> - - - - - - - - 'prefixed_author', - array() -); - ]]> - - - 'wp_author', - array() -); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml deleted file mode 100644 index 91c73c58..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - 'short_open_tag', 'off' ); - ]]> - - - - - - - - wp_raise_memory_limit(); - ]]> - - - 'memory_limit', '256M' ); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml deleted file mode 100644 index 744ec9ed..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - true ) ) {} - ]]> - - - ) ) {} - ]]> - - - - - - true ); - ]]> - - - ); - ]]> - - - - - - true ); - ]]> - - - ); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml deleted file mode 100644 index cb2aa366..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - true === $the_force ) { - $victorious = you_will( $be ); -} - ]]> - - - $the_force === false ) { - $victorious = you_will_not( $be ); -} - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml deleted file mode 100644 index aee63a62..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - wp_safe_redirect( $location ); - ]]> - - - wp_redirect( $location ); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml deleted file mode 100644 index a65848e8..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - 'manage_sites' ) ) { } - ]]> - - - 'manage_site', $user->ID ); - ]]> - - - - - - - - 'manage_options', - 'options_page_slug', - 'project_options_page_cb' -); - ]]> - - - 'author', - 'options_page_slug', - 'project_options_page_cb' -); - ]]> - - - - - - - - 'read' ) ) { } - ]]> - - - 'level_6' ) ) { } - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml deleted file mode 100644 index 8df7940f..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - WordPress_Example { - - /** - * This function is about WordPress. - */ - public function explain() { - echo 'This is an explanation - about WordPress.'; - } -} - ]]> - - - Wordpress_Example { - - /** - * This function is about Wordpress. - */ - public function explain() { - echo 'This is an explanation - about wordpress.'; - } -} - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml deleted file mode 100644 index b17ec3f9..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml deleted file mode 100644 index 03c75b8a..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - HOUR_IN_SECONDS, - 'display' => __( 'Every hour' ) - ); - return $schedules; -} - -add_filter( - 'cron_schedules', - 'adjust_schedules' -); - ]]> - - - 9 * 60, - 'display' => __( 'Every 9 minutes' ) - ); - return $schedules; -} - -add_filter( - 'cron_schedules', - 'adjust_schedules' -); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml deleted file mode 100644 index 2de4e18e..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - WP_User_Query(); - ]]> - - - WP_User_Search(); // Deprecated WP 3.1. - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml deleted file mode 100644 index 7bb63d8b..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - get_sites(); - ]]> - - - wp_get_sites(); // Deprecated WP 4.6. - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml deleted file mode 100644 index de9164c3..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - 'url' ); - ]]> - - - 'home' ); // Deprecated WP 2.2.0. - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml deleted file mode 100644 index 195e2709..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - after the deprecated parameter, only ever pass the default value. - ]]> - - - - - - - $string ); - ]]> - - - - - '', 'yes' ); - ]]> - - - 'oops', 'yes' ); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml deleted file mode 100644 index 4060d79e..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - '1.0.0' -); - ]]> - - - - - - - - - - - '1.0.0', - true -); - ]]> - - - false, - true -); - ]]> - - - - - - - - true -); - ]]> - - - - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml deleted file mode 100644 index 1f701306..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - wp_enqueue_script( - 'someScript-js', - $path_to_file, - array( 'jquery' ), - '1.0.0', - true -); - ]]> - - - ', - esc_url( $path_to_file ) -); - ]]> - - - - - - - - wp_enqueue_style( - 'style-name', - $path_to_file, - array(), - '1.0.0' -); - ]]> - - - ', - esc_url( $path_to_file ) -); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml deleted file mode 100644 index 55715ca8..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - -1, -); -$args = array( - 'posts_per_page' => 100, -); -$args = array( - 'posts_per_page' => '10', -); - -$query_args['posts_per_page'] = 100; - -_query_posts( 'nopaging=1&posts_per_page=50' ); - ]]> - - - 101, -); - -$query_args['posts_per_page'] = 200; - -_query_posts( 'nopaging=1&posts_per_page=999' ); - ]]> - - - - - -1, -); -$args = array( - 'numberposts' => 100, -); -$args = array( - 'numberposts' => '10', -); - -$query_args['numberposts'] = '-1'; - -_query_posts( 'numberposts=50' ); - ]]> - - - 101, -); - -$query_args['numberposts'] = '200'; - -_query_posts( 'numberposts=999' ); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml deleted file mode 100644 index a087dd54..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - (int) '420'; - -// No space between spread operator and cast. -$a = function_call( ...(array) $mixed ); - ]]> - - - =(int) '420'; - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml deleted file mode 100644 index 943967a6..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - ( have_posts() ) {} - -// For multi-line conditions, -// a new line is also accepted. -if ( true === $condition - && $count > 10 -) {} - ]]> - - - (have_posts()){} - -// Too much space. -while ( have_posts() ) {} - ]]> - - - - - - - - { - // Do something. -} catch ( - ExceptionA | ExceptionB $e -) { -} - ]]> - - - { - // Do something. -} catch ( Exception $e ) -( -} - ]]> - - - - - { - // Do something. -} - ]]> - - - { - // Do something. -} - ]]> - - - - - - - - : - // Do something. -endforeach; - ]]> - - - : - // Do something. -endforeach; - ]]> - - - - - - - - - - - - - -} - ]]> - - - - - - - - - - - - - echo $a; - - -} - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml deleted file mode 100644 index 47ffb1e8..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - , ?->, ::) should not have any spaces around them, though new lines are allowed except for use with the `::class` constant. - ]]> - - - - ->bar(); - ]]> - - - ?-> bar(); - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml deleted file mode 100644 index f9e0719f..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - === $b && $b === $c ) {} -if ( ! $var ) {} - ]]> - - - && $b === $c ) {} -if ( ! $var ) {} - -// Too little space. -if ( $a===$b &&$b ===$c ) {} -if ( !$var ) {} - ]]> - - - - - - && $b === $c -) {} - ]]> - - - - && $b === $c -) {} - ]]> - - - - - = 'foo'; -$all = 'foobar'; - ]]> - - - = 'foo'; -$all ='foobar'; - ]]> - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php deleted file mode 100644 index 76623d7d..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php +++ /dev/null @@ -1,108 +0,0 @@ - - */ - private static $arrayWalkingFunctions = array( - 'array_map' => array( - 'position' => 1, - 'name' => 'callback', - ), - 'map_deep' => array( - 'position' => 2, - 'name' => 'callback', - ), - ); - - /** - * Retrieve a list of the supported "array walking" functions. - * - * @since 3.0.0 - * - * @return array - */ - public static function get_functions() { - return \array_fill_keys( \array_keys( self::$arrayWalkingFunctions ), true ); - } - - /** - * Check if a particular function is an "array walking" function. - * - * @since 3.0.0 - * - * @param string $functionName The name of the function to check. - * - * @return bool - */ - public static function is_array_walking_function( $functionName ) { - return isset( self::$arrayWalkingFunctions[ strtolower( $functionName ) ] ); - } - - /** - * Retrieve the parameter information for the callback parameter for an array walking function. - * - * @since 3.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of function call name token. - * - * @return array|false Array with information on the callback parameter. - * Or `FALSE` if the parameter is not found. - * See the PHPCSUtils PassedParameters::getParameters() documentation - * for the format of the returned (single-dimensional) array. - */ - public static function get_callback_parameter( File $phpcsFile, $stackPtr ) { - $tokens = $phpcsFile->getTokens(); - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - $functionName = strtolower( $tokens[ $stackPtr ]['content'] ); - if ( isset( self::$arrayWalkingFunctions[ $functionName ] ) === false ) { - return false; - } - - return PassedParameters::getParameter( - $phpcsFile, - $stackPtr, - self::$arrayWalkingFunctions[ $functionName ]['position'], - self::$arrayWalkingFunctions[ $functionName ]['name'] - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php deleted file mode 100644 index 080f3cf2..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php +++ /dev/null @@ -1,135 +0,0 @@ -getTokens(); - - // Check for the existence of the token. - if ( ! isset( $tokens[ $stackPtr ] ) ) { - return false; - } - - // Is this one of the tokens this function handles ? - if ( \T_STRING !== $tokens[ $stackPtr ]['code'] ) { - return false; - } - - $next = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( false !== $next - && ( \T_OPEN_PARENTHESIS === $tokens[ $next ]['code'] - || \T_DOUBLE_COLON === $tokens[ $next ]['code'] ) - ) { - // Function call or declaration. - return false; - } - - // Array of tokens which if found preceding the $stackPtr indicate that a T_STRING is not a global constant. - $tokens_to_ignore = array( - \T_NAMESPACE => true, - \T_USE => true, - \T_EXTENDS => true, - \T_IMPLEMENTS => true, - \T_NEW => true, - \T_FUNCTION => true, - \T_INSTANCEOF => true, - \T_INSTEADOF => true, - \T_GOTO => true, - ); - $tokens_to_ignore += Tokens::$ooScopeTokens; - $tokens_to_ignore += Collections::objectOperators(); - $tokens_to_ignore += Tokens::$scopeModifiers; - - $prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); - if ( isset( $tokens_to_ignore[ $tokens[ $prev ]['code'] ] ) ) { - // Not the use of a constant. - return false; - } - - if ( ContextHelper::is_token_namespaced( $phpcsFile, $stackPtr ) === true ) { - // Namespaced constant of the same name. - return false; - } - - if ( \T_CONST === $tokens[ $prev ]['code'] - && Scopes::isOOConstant( $phpcsFile, $prev ) - ) { - // Class constant declaration of the same name. - return false; - } - - /* - * Deal with a number of variations of use statements. - */ - for ( $i = $stackPtr; $i > 0; $i-- ) { - if ( $tokens[ $i ]['line'] !== $tokens[ $stackPtr ]['line'] ) { - break; - } - } - - $firstOnLine = $phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); - if ( false !== $firstOnLine && \T_USE === $tokens[ $firstOnLine ]['code'] ) { - $nextOnLine = $phpcsFile->findNext( Tokens::$emptyTokens, ( $firstOnLine + 1 ), null, true ); - if ( false !== $nextOnLine ) { - if ( \T_STRING === $tokens[ $nextOnLine ]['code'] - && 'const' === $tokens[ $nextOnLine ]['content'] - ) { - $hasNsSep = $phpcsFile->findNext( \T_NS_SEPARATOR, ( $nextOnLine + 1 ), $stackPtr ); - if ( false !== $hasNsSep ) { - // Namespaced const (group) use statement. - return false; - } - } else { - // Not a const use statement. - return false; - } - } - } - - return true; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php deleted file mode 100644 index 8b5c1786..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php +++ /dev/null @@ -1,394 +0,0 @@ - Key is token constant, value irrelevant. - */ - private static $safe_casts = array( - \T_INT_CAST => true, - \T_DOUBLE_CAST => true, - \T_BOOL_CAST => true, - \T_UNSET_CAST => true, - ); - - /** - * List of PHP native functions to test the type of a variable. - * - * Using these functions is safe in combination with superglobals without - * unslashing or sanitization. - * - * They should, however, not be regarded as unslashing or sanitization functions. - * - * @since 2.1.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The property visibility was changed from `protected` to `private static`. - * - * @var array Key is function name, value irrelevant. - */ - private static $typeTestFunctions = array( - 'is_array' => true, - 'is_bool' => true, - 'is_callable' => true, - 'is_countable' => true, - 'is_double' => true, - 'is_float' => true, - 'is_int' => true, - 'is_integer' => true, - 'is_iterable' => true, - 'is_long' => true, - 'is_null' => true, - 'is_numeric' => true, - 'is_object' => true, - 'is_real' => true, - 'is_resource' => true, - 'is_scalar' => true, - 'is_string' => true, - ); - - /** - * List of PHP native functions to check if an array index exists. - * - * @since 3.0.0 - * - * @var array Key is function name, value irrelevant. - */ - private static $key_exists_functions = array( - 'array_key_exists' => true, - 'key_exists' => true, // Alias. - ); - - /** - * Array functions to compare a $needle to a predefined set of values. - * - * If the value is set to an array, the parameter specified in the array is - * required for the function call to be considered as a comparison. - * - * @since 2.1.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The property visibility was changed from `protected` to `private static`. - * - * @var array - */ - private static $arrayCompareFunctions = array( - 'in_array' => true, - 'array_search' => true, - 'array_keys' => array( - 'position' => 2, - 'name' => 'filter_value', - ), - ); - - /** - * Check if a particular token acts - statically or non-statically - on an object. - * - * {@internal Note: this may still mistake a namespaced function imported via a `use` statement for - * a global function!} - * - * @since 2.1.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method was renamed from `is_class_object_call() to `has_object_operator_before()`. - * - The method visibility was changed from `protected` to `public static`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * - * @return bool - */ - public static function has_object_operator_before( File $phpcsFile, $stackPtr ) { - $tokens = $phpcsFile->getTokens(); - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - $before = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); - - return isset( Collections::objectOperators()[ $tokens[ $before ]['code'] ] ); - } - - /** - * Check if a particular token is prefixed with a namespace. - * - * {@internal This will give a false positive if the file is not namespaced and the token is prefixed - * with `namespace\`.} - * - * @since 2.1.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method visibility was changed from `protected` to `public static`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * - * @return bool - */ - public static function is_token_namespaced( File $phpcsFile, $stackPtr ) { - $tokens = $phpcsFile->getTokens(); - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - $prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); - - if ( \T_NS_SEPARATOR !== $tokens[ $prev ]['code'] ) { - return false; - } - - $before_prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $prev - 1 ), null, true ); - if ( \T_STRING !== $tokens[ $before_prev ]['code'] - && \T_NAMESPACE !== $tokens[ $before_prev ]['code'] - ) { - return false; - } - - return true; - } - - /** - * Check if a token is (part of) a parameter for a function call to a select list of functions. - * - * This is useful, for instance, when trying to determine the context a variable is used in. - * - * For example: this function could be used to determine if the variable `$foo` is used - * in a global function call to the function `is_foo()`. - * In that case, a call to this function would return the stackPtr to the T_STRING `is_foo` - * for code like: `is_foo( $foo, 'some_other_param' )`, while it would return `false` for - * the following code `is_bar( $foo, 'some_other_param' )`. - * - * @since 2.1.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method visibility was changed from `protected` to `public static`. - * - The `$phpcsFile` parameter was added. - * - The `$global` parameter was renamed to `$global_function`. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * @param array $valid_functions List of valid function names. - * Note: The keys to this array should be the function names - * in lowercase. Values are irrelevant. - * @param bool $global_function Optional. Whether to make sure that the function call is - * to a global function. If `false`, calls to methods, be it static - * `Class::method()` or via an object `$obj->method()`, and - * namespaced function calls, like `MyNS\function_name()` will - * also be accepted. - * Defaults to `true`. - * @param bool $allow_nested Optional. Whether to allow for nested function calls within the - * call to this function. - * I.e. when checking whether a token is within a function call - * to `strtolower()`, whether to accept `strtolower( trim( $var ) )` - * or only `strtolower( $var )`. - * Defaults to `false`. - * - * @return int|bool Stack pointer to the function call T_STRING token or false otherwise. - */ - public static function is_in_function_call( File $phpcsFile, $stackPtr, array $valid_functions, $global_function = true, $allow_nested = false ) { - $tokens = $phpcsFile->getTokens(); - if ( ! isset( $tokens[ $stackPtr ]['nested_parenthesis'] ) ) { - return false; - } - - $nested_parenthesis = $tokens[ $stackPtr ]['nested_parenthesis']; - if ( false === $allow_nested ) { - $nested_parenthesis = array_reverse( $nested_parenthesis, true ); - } - - foreach ( $nested_parenthesis as $open => $close ) { - $prev_non_empty = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $open - 1 ), null, true ); - if ( false === $prev_non_empty || \T_STRING !== $tokens[ $prev_non_empty ]['code'] ) { - continue; - } - - if ( isset( $valid_functions[ strtolower( $tokens[ $prev_non_empty ]['content'] ) ] ) === false ) { - if ( false === $allow_nested ) { - // Function call encountered, but not to one of the allowed functions. - return false; - } - - continue; - } - - if ( false === $global_function ) { - return $prev_non_empty; - } - - /* - * Now, make sure it is a global function. - */ - if ( self::has_object_operator_before( $phpcsFile, $prev_non_empty ) === true ) { - continue; - } - - if ( self::is_token_namespaced( $phpcsFile, $prev_non_empty ) === true ) { - continue; - } - - return $prev_non_empty; - } - - return false; - } - - /** - * Check if a token is inside of an is_...() statement. - * - * @since 2.1.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method visibility was changed from `protected` to `public static`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * - * @return bool Whether the token is being type tested. - */ - public static function is_in_type_test( File $phpcsFile, $stackPtr ) { - /* - * Casting the potential integer stack pointer return value to boolean here is fine. - * The return can never be `0` as there will always be a PHP open tag before the - * function call. - */ - return (bool) self::is_in_function_call( $phpcsFile, $stackPtr, self::$typeTestFunctions ); - } - - /** - * Check if a token is inside of an isset(), empty() or array_key_exists() statement. - * - * @since 0.5.0 - * @since 2.1.0 Now checks for the token being used as the array parameter - * in function calls to array_key_exists() and key_exists() as well. - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method visibility was changed from `protected` to `public static`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * - * @return bool Whether the token is inside an isset() or empty() statement. - */ - public static function is_in_isset_or_empty( File $phpcsFile, $stackPtr ) { - if ( Parentheses::lastOwnerIn( $phpcsFile, $stackPtr, array( \T_ISSET, \T_EMPTY ) ) !== false ) { - return true; - } - - $functionPtr = self::is_in_function_call( $phpcsFile, $stackPtr, self::$key_exists_functions ); - if ( false !== $functionPtr ) { - /* - * Both functions being checked have the same parameters. If the function list would - * be expanded, this needs to be revisited. - */ - $array_param = PassedParameters::getParameter( $phpcsFile, $functionPtr, 2, 'array' ); - if ( false !== $array_param - && ( $stackPtr >= $array_param['start'] && $stackPtr <= $array_param['end'] ) - ) { - return true; - } - } - - return false; - } - - /** - * Retrieve a list of the tokens which are regarded as "safe casts". - * - * @since 3.0.0 - * - * @return array - */ - public static function get_safe_cast_tokens() { - return self::$safe_casts; - } - - /** - * Check if something is being casted to a safe value. - * - * @since 0.5.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method visibility was changed from `protected` to `public static`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * - * @return bool Whether the token being casted. - */ - public static function is_safe_casted( File $phpcsFile, $stackPtr ) { - $tokens = $phpcsFile->getTokens(); - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - $prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); - - return isset( self::$safe_casts[ $tokens[ $prev ]['code'] ] ); - } - - /** - * Check if a token is inside of an array-value comparison function. - * - * @since 2.1.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method visibility was changed from `protected` to `public static`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * - * @return bool Whether the token is (part of) a parameter to an - * array-value comparison function. - */ - public static function is_in_array_comparison( File $phpcsFile, $stackPtr ) { - $function_ptr = self::is_in_function_call( $phpcsFile, $stackPtr, self::$arrayCompareFunctions, true, true ); - if ( false === $function_ptr ) { - return false; - } - - $tokens = $phpcsFile->getTokens(); - $function_name = strtolower( $tokens[ $function_ptr ]['content'] ); - if ( true === self::$arrayCompareFunctions[ $function_name ] ) { - return true; - } - - $target_param = self::$arrayCompareFunctions[ $function_name ]; - $found_param = PassedParameters::getParameter( $phpcsFile, $function_ptr, $target_param['position'], $target_param['name'] ); - if ( false !== $found_param ) { - return true; - } - - return false; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php deleted file mode 100644 index 13273496..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php +++ /dev/null @@ -1,84 +0,0 @@ -getTokens(); - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - $ignore = Tokens::$methodPrefixes; - $ignore[ \T_WHITESPACE ] = \T_WHITESPACE; - - for ( $comment_end = ( $stackPtr - 1 ); $comment_end >= 0; $comment_end-- ) { - if ( isset( $ignore[ $tokens[ $comment_end ]['code'] ] ) === true ) { - continue; - } - - if ( \T_ATTRIBUTE_END === $tokens[ $comment_end ]['code'] - && isset( $tokens[ $comment_end ]['attribute_opener'] ) === true - ) { - $comment_end = $tokens[ $comment_end ]['attribute_opener']; - continue; - } - - break; - } - - if ( \T_DOC_COMMENT_CLOSE_TAG !== $tokens[ $comment_end ]['code'] ) { - // Function doesn't have a doc comment or is using the wrong type of comment. - return false; - } - - $comment_start = $tokens[ $comment_end ]['comment_opener']; - foreach ( $tokens[ $comment_start ]['comment_tags'] as $tag ) { - if ( '@deprecated' === $tokens[ $tag ]['content'] ) { - return true; - } - } - - return false; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php deleted file mode 100644 index 3df484ff..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php +++ /dev/null @@ -1,256 +0,0 @@ - - */ - private $escapingFunctions = array( - 'absint' => true, - 'esc_attr__' => true, - 'esc_attr_e' => true, - 'esc_attr_x' => true, - 'esc_attr' => true, - 'esc_html__' => true, - 'esc_html_e' => true, - 'esc_html_x' => true, - 'esc_html' => true, - 'esc_js' => true, - 'esc_sql' => true, - 'esc_textarea' => true, - 'esc_url_raw' => true, - 'esc_url' => true, - 'esc_xml' => true, - 'filter_input' => true, - 'filter_var' => true, - 'floatval' => true, - 'highlight_string' => true, - 'intval' => true, - 'json_encode' => true, - 'like_escape' => true, - 'number_format' => true, - 'rawurlencode' => true, - 'sanitize_hex_color' => true, - 'sanitize_hex_color_no_hash' => true, - 'sanitize_html_class' => true, - 'sanitize_key' => true, - 'sanitize_locale_name' => true, - 'sanitize_user_field' => true, - 'tag_escape' => true, - 'urlencode_deep' => true, - 'urlencode' => true, - 'wp_json_encode' => true, - 'wp_kses_allowed_html' => true, - 'wp_kses_data' => true, - 'wp_kses_one_attr' => true, - 'wp_kses_post' => true, - 'wp_kses' => true, - ); - - /** - * Functions whose output is automatically escaped for display. - * - * @since 0.5.0 - * @since 0.11.0 Changed from public static to protected non-static. - * @since 3.0.0 - Moved from the Sniff class to this trait. - * - Visibility changed from protected to private. - * - * @var array - */ - private $autoEscapedFunctions = array( - 'allowed_tags' => true, - 'bloginfo' => true, - 'body_class' => true, - 'calendar_week_mod' => true, - 'category_description' => true, - 'checked' => true, - 'comment_class' => true, - 'count' => true, - 'disabled' => true, - 'do_shortcode' => true, - 'do_shortcode_tag' => true, - 'get_archives_link' => true, - 'get_attachment_link' => true, - 'get_avatar' => true, - 'get_bookmark_field' => true, - 'get_calendar' => true, - 'get_comment_author_link' => true, - 'get_current_blog_id' => true, - 'get_delete_post_link' => true, - 'get_search_form' => true, - 'get_search_query' => true, - 'get_the_author_link' => true, - 'get_the_author' => true, - 'get_the_date' => true, - 'get_the_ID' => true, - 'get_the_post_thumbnail' => true, - 'get_the_term_list' => true, - 'post_type_archive_title' => true, - 'readonly' => true, - 'selected' => true, - 'single_cat_title' => true, - 'single_month_title' => true, - 'single_post_title' => true, - 'single_tag_title' => true, - 'single_term_title' => true, - 'tag_description' => true, - 'term_description' => true, - 'the_author' => true, - 'the_date' => true, - 'the_title_attribute' => true, - 'walk_nav_menu_tree' => true, - 'wp_dropdown_categories' => true, - 'wp_dropdown_users' => true, - 'wp_generate_tag_cloud' => true, - 'wp_get_archives' => true, - 'wp_get_attachment_image' => true, - 'wp_get_attachment_link' => true, - 'wp_link_pages' => true, - 'wp_list_authors' => true, - 'wp_list_bookmarks' => true, - 'wp_list_categories' => true, - 'wp_list_comments' => true, - 'wp_login_form' => true, - 'wp_loginout' => true, - 'wp_nav_menu' => true, - 'wp_readonly' => true, - 'wp_register' => true, - 'wp_tag_cloud' => true, - 'wp_timezone_choice' => true, - 'wp_title' => true, - ); - - /** - * Cache of previously added custom functions. - * - * Prevents having to do the same merges over and over again. - * - * @since 0.4.0 - * @since 0.11.0 - Changed from public static to protected non-static. - * - Changed the format from simple bool to array. - * @since 3.0.0 - Moved from the EscapeOutput Sniff class to this trait. - * - Visibility changed from protected to private. - * - * @var array - */ - private $addedCustomEscapingFunctions = array( - 'escape' => array(), - 'autoescape' => array(), - ); - - /** - * Combined list of WP native and custom escaping functions. - * - * @since 3.0.0 - * - * @var array - */ - private $allEscapingFunctions = array(); - - /** - * Combined list of WP native and custom auto-escaping functions. - * - * @since 3.0.0 - * - * @var array - */ - private $allAutoEscapedFunctions = array(); - - /** - * Check if a particular function is regarded as an escaping function. - * - * @since 3.0.0 - * - * @param string $functionName The name of the function to check. - * - * @return bool - */ - final public function is_escaping_function( $functionName ) { - if ( array() === $this->allEscapingFunctions - || $this->customEscapingFunctions !== $this->addedCustomEscapingFunctions['escape'] - ) { - $this->allEscapingFunctions = RulesetPropertyHelper::merge_custom_array( - $this->customEscapingFunctions, - $this->escapingFunctions - ); - - $this->addedCustomEscapingFunctions['escape'] = $this->customEscapingFunctions; - } - - return isset( $this->allEscapingFunctions[ strtolower( $functionName ) ] ); - } - - /** - * Check if a particular function is regarded as an auto-escaped function. - * - * @since 3.0.0 - * - * @param string $functionName The name of the function to check. - * - * @return bool - */ - final public function is_auto_escaped_function( $functionName ) { - if ( array() === $this->allAutoEscapedFunctions - || $this->customAutoEscapedFunctions !== $this->addedCustomEscapingFunctions['autoescape'] - ) { - $this->allAutoEscapedFunctions = RulesetPropertyHelper::merge_custom_array( - $this->customAutoEscapedFunctions, - $this->autoEscapedFunctions - ); - - $this->addedCustomEscapingFunctions['autoescape'] = $this->customAutoEscapedFunctions; - } - - return isset( $this->allAutoEscapedFunctions[ strtolower( $functionName ) ] ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php deleted file mode 100644 index e04298ab..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php +++ /dev/null @@ -1,60 +0,0 @@ - - */ - private static $formattingFunctions = array( - 'antispambot' => true, - 'array_fill' => true, - 'ent2ncr' => true, - 'implode' => true, - 'join' => true, - 'nl2br' => true, - 'sprintf' => true, - 'vsprintf' => true, - 'wp_sprintf' => true, - ); - - /** - * Check if a particular function is regarded as a formatting function. - * - * @since 3.0.0 - * - * @param string $functionName The name of the function to check. - * - * @return bool - */ - public static function is_formatting_function( $functionName ) { - return isset( self::$formattingFunctions[ strtolower( $functionName ) ] ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php deleted file mode 100644 index 0c9c77db..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php +++ /dev/null @@ -1,238 +0,0 @@ - - * - * - * - * - * - * - * - * ``` - * - * Note: it is strongly _recommended_ to exclude your test directories for - * select error codes of those particular sniffs instead of relying on this - * property/trait. - * - * @since 0.11.0 - * @since 3.0.0 Moved from the Sniff class to this dedicated Trait. - * Renamed from `$custom_test_class_whitelist` to `$custom_test_classes`. - * - * @var string[] - */ - public $custom_test_classes = array(); - - /** - * List of PHPUnit and WP native classes which test classes can extend. - * - * {internal These are the test cases provided in the `/tests/phpunit/includes/` - * directory of WP Core.} - * - * @since 0.11.0 - * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait. - * - Renamed from `$test_class_whitelist` to `$known_test_classes`. - * - Visibility changed from protected to private. - * - * @var array Key is class name, value irrelevant. - */ - private $known_test_classes = array( - // Base test cases. - 'WP_UnitTestCase' => true, - 'WP_UnitTestCase_Base' => true, - 'PHPUnit_Adapter_TestCase' => true, - - // Domain specific base test cases. - 'WP_Ajax_UnitTestCase' => true, - 'WP_Canonical_UnitTestCase' => true, - 'WP_Font_Face_UnitTestCase' => true, - 'WP_Test_REST_Controller_Testcase' => true, - 'WP_Test_REST_Post_Type_Controller_Testcase' => true, - 'WP_Test_REST_TestCase' => true, - 'WP_Test_XML_TestCase' => true, - 'WP_XMLRPC_UnitTestCase' => true, - - // PHPUnit native test cases. - 'PHPUnit_Framework_TestCase' => true, - 'PHPUnit\\Framework\\TestCase' => true, - // PHPUnit native TestCase class when imported via use statement. - 'TestCase' => true, - ); - - /** - * Cache of previously added custom test classes. - * - * Prevents having to do the same merges over and over again. - * - * @since 3.0.0 - * - * @var string[] - */ - private $added_custom_test_classes = array(); - - /** - * Combined list of WP/PHPUnit native and custom test classes. - * - * @since 3.0.0 - * - * @var array - */ - private $all_test_classes = array(); - - /** - * Retrieve a list of all registered test classes, both WP/PHPUnit native as well as custom. - * - * @since 3.0.0 - * - * @return array - */ - final protected function get_all_test_classes() { - if ( array() === $this->all_test_classes - || $this->custom_test_classes !== $this->added_custom_test_classes - ) { - /* - * Show some tolerance for user input. - * The custom test class names should be passed as FQN without a prefixing `\`. - */ - $custom_test_classes = array(); - if ( ! empty( $this->custom_test_classes ) ) { - foreach ( $this->custom_test_classes as $v ) { - $custom_test_classes[] = ltrim( $v, '\\' ); - } - } - - /* - * Lowercase all names, both custom as well as "known", as PHP treats namespaced names case-insensitively. - */ - $custom_test_classes = array_map( 'strtolower', $custom_test_classes ); - $known_test_classes = array_change_key_case( $this->known_test_classes, \CASE_LOWER ); - - $this->all_test_classes = RulesetPropertyHelper::merge_custom_array( - $custom_test_classes, - $known_test_classes - ); - - // Store the original value so the comparison can succeed. - $this->added_custom_test_classes = $this->custom_test_classes; - } - - return $this->all_test_classes; - } - - /** - * Check if a class token is part of a unit test suite. - * - * Unit test classes are identified as such: - * - Class which either extends one of the known test cases, such as `WP_UnitTestCase` - * or `PHPUnit_Framework_TestCase` or extends a custom unit test class as listed in the - * `custom_test_classes` property. - * - * @since 0.12.0 Split off from the `is_token_in_test_method()` method. - * @since 1.0.0 Improved recognition of namespaced class names. - * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the token to be examined. - * This should be a class, anonymous class or trait token. - * - * @return bool True if the class is a unit test class, false otherwise. - */ - final protected function is_test_class( File $phpcsFile, $stackPtr ) { - - $tokens = $phpcsFile->getTokens(); - - if ( isset( $tokens[ $stackPtr ], Tokens::$ooScopeTokens[ $tokens[ $stackPtr ]['code'] ] ) === false ) { - return false; - } - - // Add any potentially extra custom test classes to the known test classes list. - $known_test_classes = $this->get_all_test_classes(); - - $namespace = strtolower( Namespaces::determineNamespace( $phpcsFile, $stackPtr ) ); - - // Is the class/trait one of the known test classes ? - $className = ObjectDeclarations::getName( $phpcsFile, $stackPtr ); - if ( empty( $className ) === false ) { - $className = strtolower( $className ); - if ( '' !== $namespace ) { - if ( isset( $known_test_classes[ $namespace . '\\' . $className ] ) ) { - return true; - } - } elseif ( isset( $known_test_classes[ $className ] ) ) { - return true; - } - } - - // Does the class/trait extend one of the known test classes ? - $extendedClassName = ObjectDeclarations::findExtendedClassName( $phpcsFile, $stackPtr ); - if ( false === $extendedClassName ) { - return false; - } - - $extendedClassName = strtolower( $extendedClassName ); - - if ( '\\' === $extendedClassName[0] ) { - if ( isset( $known_test_classes[ substr( $extendedClassName, 1 ) ] ) ) { - return true; - } - } elseif ( '' !== $namespace ) { - if ( isset( $known_test_classes[ $namespace . '\\' . $extendedClassName ] ) ) { - return true; - } - } elseif ( isset( $known_test_classes[ $extendedClassName ] ) ) { - return true; - } - - /* - * Not examining imported classes via `use` statements as with the variety of syntaxes, - * this would get very complicated. - * After all, users can add an `` for a particular sniff to their - * custom ruleset to selectively exclude the test directory. - */ - - return false; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php deleted file mode 100644 index aa1e2247..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php +++ /dev/null @@ -1,101 +0,0 @@ -getTokens(); - - // Is this one of the tokens this function handles ? - if ( isset( $tokens[ $stackPtr ], Collections::listOpenTokensBC()[ $tokens[ $stackPtr ]['code'] ] ) === false ) { - return array(); - } - - if ( isset( Collections::shortArrayListOpenTokensBC()[ $tokens[ $stackPtr ]['code'] ] ) - && Lists::isShortList( $phpcsFile, $stackPtr ) === false - ) { - return array(); - } - - try { - $assignments = Lists::getAssignments( $phpcsFile, $stackPtr ); - } catch ( RuntimeException $e ) { - // Parse error/live coding. - return array(); - } - - $var_pointers = array(); - - foreach ( $assignments as $assign ) { - if ( true === $assign['is_empty'] ) { - continue; - } - - if ( true === $assign['is_nested_list'] ) { - /* - * Recurse into the nested list and get the variables. - * No need to `catch` any errors as only lists can be nested in lists. - */ - $var_pointers += self::get_list_variables( $phpcsFile, $assign['assignment_token'] ); - continue; - } - - /* - * Ok, so this must be a "normal" assignment in the list. - * Set the variable pointer both as the key as well as the value, so we can use array join - * for nested lists (above). - */ - $var_pointers[ $assign['assignment_token'] ] = $assign['assignment_token']; - } - - return $var_pointers; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php deleted file mode 100644 index 15679337..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php +++ /dev/null @@ -1,159 +0,0 @@ - - * - * - * - * - * - * Alternatively, the value can be passed in one go for all sniffs using it via - * the command line or by setting a `` value in a custom phpcs.xml ruleset. - * - * CL: `phpcs --runtime-set minimum_wp_version 5.7` - * Ruleset: `` - * - * @since 0.14.0 Previously the individual sniffs each contained this property. - * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait. - * - The property has been renamed from `$minimum_supported_version` to `$minimum_wp_version`. - * - The CLI option has been renamed from `minimum_supported_wp_version` to `minimum_wp_version`. - * - * @var string WordPress version. - */ - public $minimum_wp_version; - - /** - * Default minimum supported WordPress version. - * - * By default, the minimum_wp_version presumes that a project will support the current - * WP version and up to three releases before. - * - * {@internal This should be a constant, but constants in traits are not supported - * until PHP 8.2.}} - * - * @since 3.0.0 - * - * @var string WordPress version. - */ - private $default_minimum_wp_version = '6.2'; - - /** - * Overrule the minimum supported WordPress version with a command-line/config value. - * - * Handle setting the minimum supported WP version in one go for all sniffs which - * expect it via the command line or via a `` variable in a ruleset. - * The config variable overrules the default `$minimum_wp_version` and/or a - * `$minimum_wp_version` set for individual sniffs through the ruleset. - * - * @since 0.14.0 - * @since 3.0.0 - Moved from the Sniff class to this dedicated Trait. - * - Renamed from `get_wp_version_from_cl()` to `set_minimum_wp_version()`. - * - * @return void - */ - final protected function set_minimum_wp_version() { - $minimum_wp_version = ''; - - // Use a ruleset provided value if available. - if ( ! empty( $this->minimum_wp_version ) ) { - $minimum_wp_version = $this->minimum_wp_version; - } - - // A CLI provided value overrules a ruleset provided value. - $cli_supported_version = Helper::getConfigData( 'minimum_wp_version' ); - if ( ! empty( $cli_supported_version ) ) { - $minimum_wp_version = $cli_supported_version; - } - - // If no valid value was provided, use the default. - if ( filter_var( $minimum_wp_version, \FILTER_VALIDATE_FLOAT ) === false ) { - $minimum_wp_version = $this->default_minimum_wp_version; - } - - $this->minimum_wp_version = $minimum_wp_version; - } - - /** - * Compares two version numbers. - * - * @since 3.0.0 - * - * @param string $version1 First version number. - * @param string $version2 Second version number. - * @param string $operator Comparison operator. - * - * @return bool - */ - final protected function wp_version_compare( $version1, $version2, $operator ) { - $version1 = $this->normalize_version_number( $version1 ); - $version2 = $this->normalize_version_number( $version2 ); - - return version_compare( $version1, $version2, $operator ); - } - - /** - * Normalize a version number. - * - * Ensures that a version number is comparable via the PHP version_compare() function - * by making sure it complies with the minimum "PHP-standardized" version number requirements. - * - * Presumes the input is a numeric version number string. The behaviour with other input is undefined. - * - * @since 3.0.0 - * - * @param string $version Version number. - * - * @return string - */ - private function normalize_version_number( $version ) { - if ( preg_match( '`^\d+\.\d+$`', $version ) ) { - $version .= '.0'; - } - - return $version; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php deleted file mode 100644 index edd6dbe2..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php +++ /dev/null @@ -1,122 +0,0 @@ - - */ - private $printingFunctions = array( - '_deprecated_argument' => true, - '_deprecated_constructor' => true, - '_deprecated_file' => true, - '_deprecated_function' => true, - '_deprecated_hook' => true, - '_doing_it_wrong' => true, - '_e' => true, - '_ex' => true, - 'printf' => true, - 'trigger_error' => true, - 'user_error' => true, - 'vprintf' => true, - 'wp_die' => true, - 'wp_dropdown_pages' => true, - ); - - /** - * Cache of previously added custom functions. - * - * Prevents having to do the same merges over and over again. - * - * @since 0.4.0 - * @since 0.11.0 - Changed from public static to protected non-static. - * - Changed the format from simple bool to array. - * @since 3.0.0 - Moved from the EscapeOutput Sniff class to this trait. - * - Visibility changed from protected to private. - * - * @var string[] - */ - private $addedCustomPrintingFunctions = array(); - - /** - * Combined list of WP/PHP native and custom printing functions. - * - * @since 3.0.0 - * - * @var array - */ - private $allPrintingFunctions = array(); - - /** - * Retrieve a list of all known printing functions. - * - * @since 3.0.0 - * - * @return array - */ - final public function get_printing_functions() { - if ( array() === $this->allPrintingFunctions - || $this->customPrintingFunctions !== $this->addedCustomPrintingFunctions - ) { - $this->allPrintingFunctions = RulesetPropertyHelper::merge_custom_array( - $this->customPrintingFunctions, - $this->printingFunctions - ); - - $this->addedCustomPrintingFunctions = $this->customPrintingFunctions; - } - - return $this->allPrintingFunctions; - } - - /** - * Check if a particular function is regarded as a printing function. - * - * @since 3.0.0 - * - * @param string $functionName The name of the function to check. - * - * @return bool - */ - final public function is_printing_function( $functionName ) { - return isset( $this->get_printing_functions()[ strtolower( $functionName ) ] ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php deleted file mode 100644 index b20c6ed3..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php +++ /dev/null @@ -1,73 +0,0 @@ - true` format. - * * Any custom items will be given the value `false` to be able to - * distinguish them from pre-set (base array) values. - * * Will filter previously added custom items out from the base array - * before merging/returning to allow for resetting to the base array. - * - * {@internal Function is static as it doesn't use any of the properties or others - * methods anyway.} - * - * @since 0.11.0 - * @since 2.0.0 No longer supports custom array properties which were incorrectly - * passed as a string. - * @since 3.0.0 Moved from the Sniff class to this class. - * - * @param array $custom Custom list as provided via a ruleset. - * @param array $base Optional. Base list. Defaults to an empty array. - * Expects `value => true` format when `$flip` is true. - * @param bool $flip Optional. Whether or not to flip the custom list. - * Defaults to true. - * @return array - */ - public static function merge_custom_array( $custom, array $base = array(), $flip = true ) { - if ( true === $flip ) { - $base = array_filter( $base ); - } - - if ( empty( $custom ) || ! \is_array( $custom ) ) { - return $base; - } - - if ( true === $flip ) { - $custom = array_fill_keys( $custom, false ); - } - - if ( empty( $base ) ) { - return $custom; - } - - return array_merge( $base, $custom ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php deleted file mode 100644 index 18769f2b..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php +++ /dev/null @@ -1,418 +0,0 @@ - - */ - private $sanitizingFunctions = array( - '_wp_handle_upload' => true, - 'esc_url_raw' => true, - 'filter_input' => true, - 'filter_var' => true, - 'hash_equals' => true, - 'is_email' => true, - 'number_format' => true, - 'sanitize_bookmark_field' => true, - 'sanitize_bookmark' => true, - 'sanitize_email' => true, - 'sanitize_file_name' => true, - 'sanitize_hex_color_no_hash' => true, - 'sanitize_hex_color' => true, - 'sanitize_html_class' => true, - 'sanitize_meta' => true, - 'sanitize_mime_type' => true, - 'sanitize_option' => true, - 'sanitize_sql_orderby' => true, - 'sanitize_term_field' => true, - 'sanitize_term' => true, - 'sanitize_text_field' => true, - 'sanitize_textarea_field' => true, - 'sanitize_title_for_query' => true, - 'sanitize_title_with_dashes' => true, - 'sanitize_title' => true, - 'sanitize_url' => true, - 'sanitize_user_field' => true, - 'sanitize_user' => true, - 'validate_file' => true, - 'wp_handle_sideload' => true, - 'wp_handle_upload' => true, - 'wp_kses_allowed_html' => true, - 'wp_kses_data' => true, - 'wp_kses_one_attr' => true, - 'wp_kses_post' => true, - 'wp_kses' => true, - 'wp_parse_id_list' => true, - 'wp_redirect' => true, - 'wp_safe_redirect' => true, - 'wp_sanitize_redirect' => true, - 'wp_strip_all_tags' => true, - ); - - /** - * Sanitizing functions that implicitly unslash the data passed to them. - * - * This list is complementary to the `$sanitizingFunctions` list. - * Sanitizing functions should be added to this list if they also - * implicitely unslash data and to the `$sanitizingFunctions` list - * if they don't. - * - * @since 0.5.0 - * @since 0.11.0 Changed from public static to protected non-static. - * @since 3.0.0 - Moved from the Sniff class to this trait. - * - Visibility changed from protected to private. - * - * @var array - */ - private $unslashingSanitizingFunctions = array( - 'absint' => true, - 'boolval' => true, - 'count' => true, - 'doubleval' => true, - 'floatval' => true, - 'intval' => true, - 'sanitize_key' => true, - 'sanitize_locale_name' => true, - 'sizeof' => true, - ); - - /** - * Cache of previously added custom functions. - * - * Prevents having to do the same merges over and over again. - * - * @since 0.4.0 - * @since 0.11.0 - Changed from public static to protected non-static. - * - Changed the format from simple bool to array. - * @since 3.0.0 - Moved from the NonceVerification and the ValidatedSanitizedInput sniff classes to this class. - * - Visibility changed from protected to private. - * - * @var array - */ - private $addedCustomSanitizingFunctions = array( - 'sanitize' => array(), - 'unslashsanitize' => array(), - ); - - /** - * Combined list of WP/PHP native and custom sanitizing functions. - * - * @since 3.0.0 - * - * @var array - */ - private $allSanitizingFunctions = array(); - - /** - * Combined list of WP/PHP native and custom sanitizing and unslashing functions. - * - * @since 3.0.0 - * - * @var array - */ - private $allUnslashingSanitizingFunctions = array(); - - /** - * Retrieve a list of all known sanitizing functions. - * - * @since 3.0.0 - * - * @return array - */ - final public function get_sanitizing_functions() { - if ( array() === $this->allSanitizingFunctions - || $this->customSanitizingFunctions !== $this->addedCustomSanitizingFunctions['sanitize'] - ) { - $this->allSanitizingFunctions = RulesetPropertyHelper::merge_custom_array( - $this->customSanitizingFunctions, - $this->sanitizingFunctions - ); - - $this->addedCustomSanitizingFunctions['sanitize'] = $this->customSanitizingFunctions; - } - - return $this->allSanitizingFunctions; - } - - /** - * Retrieve a list of all known sanitizing and unslashing functions. - * - * @since 3.0.0 - * - * @return array - */ - final public function get_sanitizing_and_unslashing_functions() { - if ( array() === $this->allUnslashingSanitizingFunctions - || $this->customUnslashingSanitizingFunctions !== $this->addedCustomSanitizingFunctions['unslashsanitize'] - ) { - $this->allUnslashingSanitizingFunctions = RulesetPropertyHelper::merge_custom_array( - $this->customUnslashingSanitizingFunctions, - $this->unslashingSanitizingFunctions - ); - - $this->addedCustomSanitizingFunctions['unslashsanitize'] = $this->customUnslashingSanitizingFunctions; - } - - return $this->allUnslashingSanitizingFunctions; - } - - /** - * Check if a particular function is regarded as a sanitizing function. - * - * @since 3.0.0 - * - * @param string $functionName The name of the function to check. - * - * @return bool - */ - final public function is_sanitizing_function( $functionName ) { - return isset( $this->get_sanitizing_functions()[ strtolower( $functionName ) ] ); - } - - /** - * Check if a particular function is regarded as a sanitizing and unslashing function. - * - * @since 3.0.0 - * - * @param string $functionName The name of the function to check. - * - * @return bool - */ - final public function is_sanitizing_and_unslashing_function( $functionName ) { - return isset( $this->get_sanitizing_and_unslashing_functions()[ strtolower( $functionName ) ] ); - } - - /** - * Check if something is only being sanitized. - * - * @since 0.5.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method visibility was changed from `protected` to `public`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * - * @return bool Whether the token is only within a sanitization. - */ - final public function is_only_sanitized( File $phpcsFile, $stackPtr ) { - $tokens = $phpcsFile->getTokens(); - - // If it isn't being sanitized at all. - if ( ! $this->is_sanitized( $phpcsFile, $stackPtr ) ) { - return false; - } - - // If the token isn't in parentheses, we know the value must have only been casted, because - // is_sanitized() would have returned `false` otherwise. - if ( ! isset( $tokens[ $stackPtr ]['nested_parenthesis'] ) ) { - return true; - } - - // At this point we're expecting the value to have not been casted. If it - // was, it wasn't *only* casted, because it's also in a function. - if ( ContextHelper::is_safe_casted( $phpcsFile, $stackPtr ) ) { - return false; - } - - // The only parentheses should belong to the sanitizing function. If there's - // more than one set, this isn't *only* sanitization. - return ( \count( $tokens[ $stackPtr ]['nested_parenthesis'] ) === 1 ); - } - - /** - * Check if something is being sanitized. - * - * @since 0.5.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method visibility was changed from `protected` to `public`. - * - The `$phpcsFile` parameter was added. - * - The $require_unslash parameter has been changed from - * a boolean toggle to a ?callable $unslash_callback parameter to - * allow a sniff calling this method to handle their "unslashing" - * related messaging itself. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * @param callable|null $unslash_callback Optional. When passed, this method will check if - * an unslashing function is used on the variable before - * sanitization and if not, the callback will be called - * to handle the missing unslashing. - * The callback will receive the $phpcsFile object and - * the $stackPtr. - * When not passed or `null`, this method will **not** - * check for unslashing issues. - * Defaults to `null` (skip unslashing checks). - * - * @return bool Whether the token is being sanitized. - */ - final public function is_sanitized( File $phpcsFile, $stackPtr, $unslash_callback = null ) { - $tokens = $phpcsFile->getTokens(); - $require_unslash = is_callable( $unslash_callback ); - - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - // If the variable is just being unset, the value isn't used at all, so it's safe. - if ( Context::inUnset( $phpcsFile, $stackPtr ) ) { - return true; - } - - // First we check if it is being casted to a safe value. - if ( ContextHelper::is_safe_casted( $phpcsFile, $stackPtr ) ) { - return true; - } - - // If this isn't within a function call, we know already that it's not safe. - if ( ! isset( $tokens[ $stackPtr ]['nested_parenthesis'] ) ) { - if ( $require_unslash ) { - call_user_func( $unslash_callback, $phpcsFile, $stackPtr ); - } - - return false; - } - - $sanitizing_functions = $this->get_sanitizing_functions(); - $sanitizing_functions += $this->get_sanitizing_and_unslashing_functions(); - $sanitizing_functions += ArrayWalkingFunctionsHelper::get_functions(); - $valid_functions = $sanitizing_functions + UnslashingFunctionsHelper::get_functions(); - - // Get the function that it's in. - $functionPtr = ContextHelper::is_in_function_call( $phpcsFile, $stackPtr, $valid_functions ); - - // If this isn't a call to one of the valid functions, it sure isn't a sanitizing function. - if ( false === $functionPtr ) { - if ( true === $require_unslash ) { - call_user_func( $unslash_callback, $phpcsFile, $stackPtr ); - } - - return false; - } - - $functionName = $tokens[ $functionPtr ]['content']; - - // Check if an unslashing function is being used. - $is_unslashed = false; - if ( UnslashingFunctionsHelper::is_unslashing_function( $functionName ) ) { - $is_unslashed = true; - - // Check whether this function call is wrapped within a sanitizing function. - $higherFunctionPtr = ContextHelper::is_in_function_call( $phpcsFile, $functionPtr, $sanitizing_functions ); - - // If there is no other valid function being used, this value is unsanitized. - if ( false === $higherFunctionPtr ) { - return false; - } - - $functionPtr = $higherFunctionPtr; - $functionName = $tokens[ $functionPtr ]['content']; - } - - // Arrays might be sanitized via an array walking function using a callback. - if ( ArrayWalkingFunctionsHelper::is_array_walking_function( $functionName ) ) { - // Get the callback parameter. - $callback = ArrayWalkingFunctionsHelper::get_callback_parameter( $phpcsFile, $functionPtr ); - - if ( ! empty( $callback ) ) { - /* - * If this is a function callback (not a method callback array) and we're able - * to resolve the function name, do so. - */ - $first_non_empty = $phpcsFile->findNext( - Tokens::$emptyTokens, - $callback['start'], - ( $callback['end'] + 1 ), - true - ); - - if ( false !== $first_non_empty && \T_CONSTANT_ENCAPSED_STRING === $tokens[ $first_non_empty ]['code'] ) { - $functionName = TextStrings::stripQuotes( $tokens[ $first_non_empty ]['content'] ); - } - } - } - - // If slashing is required, give an error. - if ( false === $is_unslashed - && true === $require_unslash - && ! $this->is_sanitizing_and_unslashing_function( $functionName ) - ) { - call_user_func( $unslash_callback, $phpcsFile, $stackPtr ); - } - - // Check if this is a sanitizing function. - return ( $this->is_sanitizing_function( $functionName ) || $this->is_sanitizing_and_unslashing_function( $functionName ) ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php deleted file mode 100644 index 9937e5e2..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php +++ /dev/null @@ -1,60 +0,0 @@ - - */ - private static $unslashingFunctions = array( - 'stripslashes_deep' => true, - 'stripslashes_from_strings_only' => true, - 'wp_unslash' => true, - ); - - /** - * Retrieve a list of the unslashing functions. - * - * @since 3.0.0 - * - * @return array - */ - public static function get_functions() { - return self::$unslashingFunctions; - } - - /** - * Check if a particular function is regarded as a unslashing function. - * - * @since 3.0.0 - * - * @param string $functionName The name of the function to check. - * - * @return bool - */ - public static function is_unslashing_function( $functionName ) { - return isset( self::$unslashingFunctions[ strtolower( $functionName ) ] ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php deleted file mode 100644 index d5a22d7d..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php +++ /dev/null @@ -1,349 +0,0 @@ - - */ - private static $targets = array( - \T_ISSET => 'construct', - \T_EMPTY => 'construct', - \T_STRING => 'function_call', - \T_COALESCE => 'coalesce', - \T_COALESCE_EQUAL => 'coalesce', - ); - - /** - * List of PHP native functions to check if an array index exists. - * - * @since 3.0.0 - * - * @var array - */ - private static $key_exists_functions = array( - 'array_key_exists' => true, - 'key_exists' => true, // Alias. - ); - - /** - * Check if the existence of a variable is validated with isset(), empty(), array_key_exists() - * or key_exists(). - * - * When $in_condition_only is `false`, (which is the default), this is considered - * valid: - * - * ```php - * if ( isset( $var ) ) { - * // Do stuff, like maybe return or exit (but could be anything) - * } - * - * foo( $var ); - * ``` - * - * When it is `true`, that would be invalid; the use of the variable must be within - * the scope of the validating condition, like this: - * - * ```php - * if ( isset( $var ) ) { - * foo( $var ); - * } - * ``` - * - * @since 0.5.0 - * @since 2.1.0 Now recognizes array_key_exists() and key_exists() as validation functions. - * @since 2.1.0 Stricter check on whether the correct variable and the correct - * array keys are being validated. - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The method visibility was changed from `protected` to `public static`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of this token in the stack. - * @param array|string $array_keys An array key to check for ("bar" in $foo['bar']) - * or an array of keys for multi-level array access. - * @param bool $in_condition_only Whether to require that this use of the - * variable occurs within the scope of the - * validating condition, or just in the same - * scope (default). - * - * @return bool Whether the var is validated. - */ - public static function is_validated( File $phpcsFile, $stackPtr, $array_keys = array(), $in_condition_only = false ) { - $tokens = $phpcsFile->getTokens(); - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - if ( $in_condition_only ) { - /* - * This is a stricter check, requiring the variable to be used only - * within the validation condition. - */ - $conditionPtr = Conditions::getLastCondition( $phpcsFile, $stackPtr ); - if ( false === $conditionPtr ) { - // If there are no conditions, there's no validation. - return false; - } - - $condition = $tokens[ $conditionPtr ]; - if ( ! isset( $condition['parenthesis_opener'] ) ) { - // Live coding or parse error. - return false; - } - - $scope_start = $condition['parenthesis_opener']; - $scope_end = $condition['parenthesis_closer']; - - } else { - /* - * We are more loose, requiring only that the variable be validated - * in the same function/file scope as it is used. - */ - $scope_start = 0; - - /* - * Check if we are in a function. - * - * Note: PHP 7.4+ arrow functions are not taken into account as those are not - * included in the "conditions" array. Additionally, arrow functions have - * access to variables outside their direct scope. - */ - $function = Conditions::getLastCondition( $phpcsFile, $stackPtr, array( \T_FUNCTION, \T_CLOSURE ) ); - - // If so, we check only within the function, otherwise the whole file. - if ( false !== $function ) { - $scope_start = $tokens[ $function ]['scope_opener']; - } - - $scope_end = $stackPtr; - } - - if ( ! empty( $array_keys ) && ! is_array( $array_keys ) ) { - $array_keys = (array) $array_keys; - } - - $bare_array_keys = self::strip_quotes_from_array_values( $array_keys ); - - // phpcs:ignore Generic.CodeAnalysis.JumbledIncrementer.Found -- On purpose, see below. - for ( $i = ( $scope_start + 1 ); $i < $scope_end; $i++ ) { - - if ( isset( Collections::closedScopes()[ $tokens[ $i ]['code'] ] ) - && isset( $tokens[ $i ]['scope_closer'] ) - ) { - // Jump over nested closed scopes as validation done within those does not apply. - $i = $tokens[ $i ]['scope_closer']; - continue; - } - - if ( \T_FN === $tokens[ $i ]['code'] - && isset( $tokens[ $i ]['scope_closer'] ) - && $tokens[ $i ]['scope_closer'] < $scope_end - ) { - // Jump over nested arrow functions as long as the current variable isn't *in* the arrow function. - $i = $tokens[ $i ]['scope_closer']; - continue; - } - - if ( isset( self::$targets[ $tokens[ $i ]['code'] ] ) === false ) { - continue; - } - - switch ( self::$targets[ $tokens[ $i ]['code'] ] ) { - case 'construct': - $issetOpener = $phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); - if ( false === $issetOpener - || \T_OPEN_PARENTHESIS !== $tokens[ $issetOpener ]['code'] - || isset( $tokens[ $issetOpener ]['parenthesis_closer'] ) === false - ) { - // Parse error or live coding. - continue 2; - } - - $issetCloser = $tokens[ $issetOpener ]['parenthesis_closer']; - - // Look for this variable. We purposely stomp $i from the parent loop. - for ( $i = ( $issetOpener + 1 ); $i < $issetCloser; $i++ ) { - - if ( \T_VARIABLE !== $tokens[ $i ]['code'] ) { - continue; - } - - if ( $tokens[ $stackPtr ]['content'] !== $tokens[ $i ]['content'] ) { - continue; - } - - // If we're checking for specific array keys (ex: 'hello' in - // $_POST['hello']), that must match too. Quote-style, however, doesn't matter. - if ( ! empty( $bare_array_keys ) ) { - $found_keys = VariableHelper::get_array_access_keys( $phpcsFile, $i ); - $found_keys = self::strip_quotes_from_array_values( $found_keys ); - $diff = array_diff_assoc( $bare_array_keys, $found_keys ); - if ( ! empty( $diff ) ) { - continue; - } - } - - return true; - } - - break; - - case 'function_call': - // Only check calls to array_key_exists() and key_exists(). - if ( isset( self::$key_exists_functions[ strtolower( $tokens[ $i ]['content'] ) ] ) === false ) { - continue 2; - } - - $next_non_empty = $phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); - if ( false === $next_non_empty || \T_OPEN_PARENTHESIS !== $tokens[ $next_non_empty ]['code'] ) { - // Not a function call. - continue 2; - } - - if ( Context::inAttribute( $phpcsFile, $i ) === true ) { - // Definitely not the function call as those are not allowed in attributes. - continue 2; - } - - if ( ContextHelper::has_object_operator_before( $phpcsFile, $i ) === true ) { - // Method call. - continue 2; - } - - if ( ContextHelper::is_token_namespaced( $phpcsFile, $i ) === true ) { - // Namespaced function call. - continue 2; - } - - $params = PassedParameters::getParameters( $phpcsFile, $i ); - - // As `key_exists()` is an alias of `array_key_exists()`, the param positions and names are the same. - $array_param = PassedParameters::getParameterFromStack( $params, 2, 'array' ); - if ( false === $array_param ) { - continue 2; - } - - $array_param_first_token = $phpcsFile->findNext( Tokens::$emptyTokens, $array_param['start'], ( $array_param['end'] + 1 ), true ); - if ( false === $array_param_first_token - || \T_VARIABLE !== $tokens[ $array_param_first_token ]['code'] - || $tokens[ $array_param_first_token ]['content'] !== $tokens[ $stackPtr ]['content'] - ) { - continue 2; - } - - if ( ! empty( $bare_array_keys ) ) { - // Prevent the original array from being altered. - $bare_keys = $bare_array_keys; - $last_key = array_pop( $bare_keys ); - - /* - * For multi-level array access, the complete set of keys could be split between - * the $key and the $array parameter, but could also be completely in the $array - * parameter, so we need to check both options. - */ - $found_keys = VariableHelper::get_array_access_keys( $phpcsFile, $array_param_first_token ); - $found_keys = self::strip_quotes_from_array_values( $found_keys ); - - // First try matching the complete set against the array parameter. - $diff = array_diff_assoc( $bare_array_keys, $found_keys ); - if ( empty( $diff ) ) { - return true; - } - - // If that failed, try getting an exact match for the subset against the - // $array parameter and the last key against the first. - $key_param = PassedParameters::getParameterFromStack( $params, 1, 'key' ); - if ( false !== $key_param - && $bare_keys === $found_keys - && TextStrings::stripQuotes( $key_param['raw'] ) === $last_key - ) { - return true; - } - - // Didn't find the correct array keys. - continue 2; - } - - return true; - - case 'coalesce': - $prev = $i; - do { - $prev = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $prev - 1 ), null, true ); - // Skip over array keys, like `$_GET['key']['subkey']`. - if ( \T_CLOSE_SQUARE_BRACKET === $tokens[ $prev ]['code'] ) { - $prev = $tokens[ $prev ]['bracket_opener']; - continue; - } - - break; - } while ( $prev >= ( $scope_start + 1 ) ); - - // We should now have reached the variable. - if ( \T_VARIABLE !== $tokens[ $prev ]['code'] ) { - continue 2; - } - - if ( $tokens[ $prev ]['content'] !== $tokens[ $stackPtr ]['content'] ) { - continue 2; - } - - if ( ! empty( $bare_array_keys ) ) { - $found_keys = VariableHelper::get_array_access_keys( $phpcsFile, $prev ); - $found_keys = self::strip_quotes_from_array_values( $found_keys ); - $diff = array_diff_assoc( $bare_array_keys, $found_keys ); - if ( ! empty( $diff ) ) { - continue 2; - } - } - - // Right variable, correct key. - return true; - } - } - - return false; - } - - /** - * Strip quotes of all the values in an array containing only text strings. - * - * @since 3.0.0 - * - * @param string[] $text_strings The input array. - * - * @return string[] - */ - private static function strip_quotes_from_array_values( array $text_strings ) { - return array_map( array( 'PHPCSUtils\Utils\TextStrings', 'stripQuotes' ), $text_strings ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php deleted file mode 100644 index e1076ee4..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php +++ /dev/null @@ -1,262 +0,0 @@ -getTokens(); - $keys = array(); - - if ( isset( $tokens[ $stackPtr ] ) === false - || \T_VARIABLE !== $tokens[ $stackPtr ]['code'] - ) { - return $keys; - } - - $current = $stackPtr; - - do { - // Find the next non-empty token. - $open_bracket = $phpcsFile->findNext( - Tokens::$emptyTokens, - ( $current + 1 ), - null, - true - ); - - // If it isn't a bracket, this isn't an array-access. - if ( false === $open_bracket - || \T_OPEN_SQUARE_BRACKET !== $tokens[ $open_bracket ]['code'] - || ! isset( $tokens[ $open_bracket ]['bracket_closer'] ) - ) { - break; - } - - $key = GetTokensAsString::compact( - $phpcsFile, - ( $open_bracket + 1 ), - ( $tokens[ $open_bracket ]['bracket_closer'] - 1 ), - true - ); - - $keys[] = trim( $key ); - $current = $tokens[ $open_bracket ]['bracket_closer']; - } while ( isset( $tokens[ $current ] ) && true === $all ); - - return $keys; - } - - /** - * Get the index key of an array variable. - * - * E.g., "bar" in $foo['bar']. - * - * @since 0.5.0 - * @since 2.1.0 Now uses get_array_access_keys() under the hood. - * @since 3.0.0 - Moved from the Sniff class to this class. - * - Visibility is now `public` (was `protected`) and the method `static`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the variable token in the stack. - * - * @return string|false The array index key whose value is being accessed. - */ - public static function get_array_access_key( File $phpcsFile, $stackPtr ) { - $keys = self::get_array_access_keys( $phpcsFile, $stackPtr, false ); - if ( isset( $keys[0] ) ) { - return $keys[0]; - } - - return false; - } - - /** - * Check whether a variable is being compared to another value. - * - * E.g., $var === 'foo', 1 <= $var, etc. - * - * Also recognizes `switch ( $var )` and `match ( $var )`. - * - * @since 0.5.0 - * @since 2.1.0 Added the $include_coalesce parameter. - * @since 3.0.0 - Moved from the Sniff class to this class. - * - Visibility is now `public` (was `protected`) and the method `static`. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of this token in the stack. - * @param bool $include_coalesce Optional. Whether or not to regard the null - * coalesce operator - ?? - as a comparison operator. - * Defaults to true. - * Null coalesce is a special comparison operator in this - * sense as it doesn't compare a variable to whatever is - * on the other side of the comparison operator. - * - * @return bool Whether this is a comparison. - */ - public static function is_comparison( File $phpcsFile, $stackPtr, $include_coalesce = true ) { - $tokens = $phpcsFile->getTokens(); - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - $comparisonTokens = Tokens::$comparisonTokens; - if ( false === $include_coalesce ) { - unset( $comparisonTokens[ \T_COALESCE ] ); - } - - // We first check if this is a switch or match statement (switch ( $var )). - if ( Parentheses::lastOwnerIn( $phpcsFile, $stackPtr, array( \T_SWITCH, \T_MATCH ) ) !== false ) { - return true; - } - - // Find the previous non-empty token. We check before the var first because - // yoda conditions are usually expected. - $previous_token = $phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); - - if ( isset( $comparisonTokens[ $tokens[ $previous_token ]['code'] ] ) ) { - return true; - } - - // Maybe the comparison operator is after this. - $next_token = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - - // This might be an opening square bracket in the case of arrays ($var['a']). - while ( false !== $next_token - && \T_OPEN_SQUARE_BRACKET === $tokens[ $next_token ]['code'] - && isset( $tokens[ $next_token ]['bracket_closer'] ) - ) { - $next_token = $phpcsFile->findNext( - Tokens::$emptyTokens, - ( $tokens[ $next_token ]['bracket_closer'] + 1 ), - null, - true - ); - } - - if ( false !== $next_token && isset( $comparisonTokens[ $tokens[ $next_token ]['code'] ] ) ) { - return true; - } - - return false; - } - - /** - * Check if this variable is being assigned a value. - * - * E.g., $var = 'foo'; - * - * Also handles array assignments to arbitrary depth: - * - * $array['key'][ $foo ][ something() ] = $bar; - * - * @since 0.5.0 - * @since 3.0.0 - Moved from the Sniff class to this class. - * - Visibility is now `public` (was `protected`) and the method `static`. - * - The `$phpcsFile` parameter was added. - * - The `$include_coalesce` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack. - * This must point to either a T_VARIABLE or - * T_CLOSE_SQUARE_BRACKET token. - * @param bool $include_coalesce Optional. Whether or not to regard the null - * coalesce operator - ?? - as a comparison operator. - * Defaults to true. - * Null coalesce is a special comparison operator in this - * sense as it doesn't compare a variable to whatever is - * on the other side of the comparison operator. - * - * @return bool Whether the token is a variable being assigned a value. - */ - public static function is_assignment( File $phpcsFile, $stackPtr, $include_coalesce = true ) { - $tokens = $phpcsFile->getTokens(); - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - static $valid = array( - \T_VARIABLE => true, - \T_CLOSE_SQUARE_BRACKET => true, - ); - - // Must be a variable or closing square bracket (see below). - if ( ! isset( $valid[ $tokens[ $stackPtr ]['code'] ] ) ) { - return false; - } - - $next_non_empty = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true, null, true ); - - // No token found. - if ( false === $next_non_empty ) { - return false; - } - - $assignmentTokens = Tokens::$assignmentTokens; - if ( false === $include_coalesce ) { - unset( $assignmentTokens[ \T_COALESCE_EQUAL ] ); - } - - // If the next token is an assignment, that's all we need to know. - if ( isset( $assignmentTokens[ $tokens[ $next_non_empty ]['code'] ] ) ) { - return true; - } - - // Check if this is an array assignment, e.g., `$var['key'] = 'val';` . - if ( \T_OPEN_SQUARE_BRACKET === $tokens[ $next_non_empty ]['code'] - && isset( $tokens[ $next_non_empty ]['bracket_closer'] ) - ) { - return self::is_assignment( $phpcsFile, $tokens[ $next_non_empty ]['bracket_closer'], $include_coalesce ); - } - - return false; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php deleted file mode 100644 index 1f325eff..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php +++ /dev/null @@ -1,115 +0,0 @@ -getTokens(); - if ( isset( $tokens[ $stackPtr ] ) === false ) { - return false; - } - - // Check for wpdb. - if ( ( \T_VARIABLE === $tokens[ $stackPtr ]['code'] && '$wpdb' !== $tokens[ $stackPtr ]['content'] ) - || ( \T_STRING === $tokens[ $stackPtr ]['code'] && 'wpdb' !== strtolower( $tokens[ $stackPtr ]['content'] ) ) - ) { - return false; - } - - // Check that this is a method call. - $is_object_call = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( false === $is_object_call - || isset( Collections::objectOperators()[ $tokens[ $is_object_call ]['code'] ] ) === false - ) { - return false; - } - - $methodPtr = $phpcsFile->findNext( Tokens::$emptyTokens, ( $is_object_call + 1 ), null, true, null, true ); - if ( false === $methodPtr ) { - return false; - } - - if ( \T_STRING === $tokens[ $methodPtr ]['code'] && property_exists( $this, 'methodPtr' ) ) { - $this->methodPtr = $methodPtr; - } - - // Find the opening parenthesis. - $opening_paren = $phpcsFile->findNext( Tokens::$emptyTokens, ( $methodPtr + 1 ), null, true, null, true ); - - if ( false === $opening_paren ) { - return false; - } - - if ( property_exists( $this, 'i' ) ) { - $this->i = $opening_paren; - } - - if ( \T_OPEN_PARENTHESIS !== $tokens[ $opening_paren ]['code'] - || ! isset( $tokens[ $opening_paren ]['parenthesis_closer'] ) - ) { - return false; - } - - // Check that this is one of the methods that we are interested in. - if ( ! isset( $target_methods[ strtolower( $tokens[ $methodPtr ]['content'] ) ] ) ) { - return false; - } - - // Find the end of the first parameter. - $end = BCFile::findEndOfStatement( $phpcsFile, $opening_paren + 1 ); - - if ( \T_COMMA !== $tokens[ $end ]['code'] ) { - ++$end; - } - - if ( property_exists( $this, 'end' ) ) { - $this->end = $end; - } - - return true; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php deleted file mode 100644 index b5097931..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php +++ /dev/null @@ -1,312 +0,0 @@ - The key is the name of a WP global variable, the value is irrelevant. - */ - private static $wp_globals = array( - '_links_add_base' => true, - '_links_add_target' => true, - '_menu_item_sort_prop' => true, - '_nav_menu_placeholder' => true, - '_new_bundled_files' => true, - '_old_files' => true, - '_parent_pages' => true, - '_registered_pages' => true, - '_updated_user_settings' => true, - '_wp_additional_image_sizes' => true, - '_wp_admin_css_colors' => true, - '_wp_default_headers' => true, - '_wp_deprecated_widgets_callbacks' => true, - '_wp_last_object_menu' => true, - '_wp_last_utility_menu' => true, - '_wp_menu_nopriv' => true, - '_wp_nav_menu_max_depth' => true, - '_wp_post_type_features' => true, - '_wp_real_parent_file' => true, - '_wp_registered_nav_menus' => true, - '_wp_sidebars_widgets' => true, - '_wp_submenu_nopriv' => true, - '_wp_suspend_cache_invalidation' => true, - '_wp_theme_features' => true, - '_wp_using_ext_object_cache' => true, - 'action' => true, - 'active_signup' => true, - 'admin_body_class' => true, - 'admin_page_hooks' => true, - 'all_links' => true, - 'allowedentitynames' => true, - 'allowedposttags' => true, - 'allowedtags' => true, - 'auth_secure_cookie' => true, - 'authordata' => true, - 'avail_post_mime_types' => true, - 'avail_post_stati' => true, - 'blog_id' => true, - 'blog_title' => true, - 'blogname' => true, - 'cat' => true, - 'cat_id' => true, - 'charset_collate' => true, - 'comment' => true, - 'comment_alt' => true, - 'comment_depth' => true, - 'comment_status' => true, - 'comment_thread_alt' => true, - 'comment_type' => true, - 'comments' => true, - 'compress_css' => true, - 'compress_scripts' => true, - 'concatenate_scripts' => true, - 'content_width' => true, - 'current_blog' => true, - 'current_screen' => true, - 'current_site' => true, - 'current_user' => true, - 'currentcat' => true, - 'currentday' => true, - 'currentmonth' => true, - 'custom_background' => true, - 'custom_image_header' => true, - 'default_menu_order' => true, - 'descriptions' => true, - 'domain' => true, - 'editor_styles' => true, - 'error' => true, - 'errors' => true, - 'EZSQL_ERROR' => true, - 'feeds' => true, - 'GETID3_ERRORARRAY' => true, - 'hook_suffix' => true, - 'HTTP_RAW_POST_DATA' => true, - 'id' => true, - 'in_comment_loop' => true, - 'interim_login' => true, - 'is_apache' => true, - 'is_chrome' => true, - 'is_gecko' => true, - 'is_IE' => true, - 'is_IIS' => true, - 'is_iis7' => true, - 'is_macIE' => true, - 'is_NS4' => true, - 'is_opera' => true, - 'is_safari' => true, - 'is_winIE' => true, - 'l10n' => true, - 'link' => true, - 'link_id' => true, - 'locale' => true, - 'locked_post_status' => true, - 'lost' => true, - 'm' => true, - 'map' => true, - 'menu' => true, - 'menu_order' => true, - 'merged_filters' => true, - 'mode' => true, - 'monthnum' => true, - 'more' => true, - 'mu_plugin' => true, - 'multipage' => true, - 'names' => true, - 'nav_menu_selected_id' => true, - 'network_plugin' => true, - 'new_whitelist_options' => true, - 'numpages' => true, - 'one_theme_location_no_menus' => true, - 'opml' => true, - 'order' => true, - 'orderby' => true, - 'overridden_cpage' => true, - 'page' => true, - 'paged' => true, - 'pagenow' => true, - 'pages' => true, - 'parent_file' => true, - 'pass_allowed_html' => true, - 'pass_allowed_protocols' => true, - 'path' => true, - 'per_page' => true, - 'PHP_SELF' => true, - 'phpmailer' => true, - 'plugin_page' => true, - 'plugin' => true, - 'plugins' => true, - 'post' => true, - 'post_default_category' => true, - 'post_default_title' => true, - 'post_ID' => true, - 'post_id' => true, - 'post_mime_types' => true, - 'post_type' => true, - 'post_type_object' => true, - 'posts' => true, - 'preview' => true, - 'previouscat' => true, - 'previousday' => true, - 'previousweekday' => true, - 'redir_tab' => true, - 'required_mysql_version' => true, - 'required_php_version' => true, - 'rnd_value' => true, - 'role' => true, - 's' => true, - 'search' => true, - 'self' => true, - 'shortcode_tags' => true, - 'show_admin_bar' => true, - 'sidebars_widgets' => true, - 'status' => true, - 'submenu' => true, - 'submenu_file' => true, - 'super_admins' => true, - 'tab' => true, - 'table_prefix' => true, - 'tabs' => true, - 'tag' => true, - 'tag_ID' => true, - 'targets' => true, - 'tax' => true, - 'taxnow' => true, - 'taxonomy' => true, - 'term' => true, - 'text_direction' => true, - 'theme_field_defaults' => true, - 'themes_allowedtags' => true, - 'timeend' => true, - 'timestart' => true, - 'tinymce_version' => true, - 'title' => true, - 'totals' => true, - 'type' => true, - 'typenow' => true, - 'updated_timestamp' => true, - 'upgrading' => true, - 'urls' => true, - 'user_email' => true, - 'user_ID' => true, - 'user_identity' => true, - 'user_level' => true, - 'user_login' => true, - 'user_url' => true, - 'userdata' => true, - 'usersearch' => true, - 'whitelist_options' => true, - 'withcomments' => true, - 'wp' => true, - 'wp_actions' => true, - 'wp_admin_bar' => true, - 'wp_cockneyreplace' => true, - 'wp_current_db_version' => true, - 'wp_current_filter' => true, - 'wp_customize' => true, - 'wp_dashboard_control_callbacks' => true, - 'wp_db_version' => true, - 'wp_did_header' => true, - 'wp_embed' => true, - 'wp_file_descriptions' => true, - 'wp_filesystem' => true, - 'wp_filter' => true, - 'wp_hasher' => true, - 'wp_header_to_desc' => true, - 'wp_importers' => true, - 'wp_json' => true, - 'wp_list_table' => true, - 'wp_local_package' => true, - 'wp_locale' => true, - 'wp_meta_boxes' => true, - 'wp_object_cache' => true, - 'wp_plugin_paths' => true, - 'wp_post_statuses' => true, - 'wp_post_types' => true, - 'wp_queries' => true, - 'wp_query' => true, - 'wp_registered_sidebars' => true, - 'wp_registered_widget_controls' => true, - 'wp_registered_widget_updates' => true, - 'wp_registered_widgets' => true, - 'wp_rewrite' => true, - 'wp_rich_edit' => true, - 'wp_rich_edit_exists' => true, - 'wp_roles' => true, - 'wp_scripts' => true, - 'wp_settings_errors' => true, - 'wp_settings_fields' => true, - 'wp_settings_sections' => true, - 'wp_smiliessearch' => true, - 'wp_styles' => true, - 'wp_taxonomies' => true, - 'wp_the_query' => true, - 'wp_theme_directories' => true, - 'wp_themes' => true, - 'wp_user_roles' => true, - 'wp_version' => true, - 'wp_widget_factory' => true, - 'wp_xmlrpc_server' => true, - 'wpcommentsjavascript' => true, - 'wpcommentspopupfile' => true, - 'wpdb' => true, - 'wpsmiliestrans' => true, - 'year' => true, - ); - - /** - * Retrieve a list with the names of global WP variables. - * - * @since 3.0.0 - * - * @return array Array with the variables names as keys. The value is irrelevant. - */ - public static function get_names() { - return self::$wp_globals; - } - - /** - * Verify if a given variable name is the name of a WP global variable. - * - * @since 3.0.0 - * - * @param string $name The full variable name with or without leading dollar sign. - * This allows for passing an array key variable name, such as - * `'_GET'` retrieved from `$GLOBALS['_GET']`. - * > Note: when passing an array key, string quotes are expected - * to have been stripped already. - * - * @return bool - */ - public static function is_wp_global( $name ) { - if ( strpos( $name, '$' ) === 0 ) { - $name = substr( $name, 1 ); - } - - return isset( self::$wp_globals[ $name ] ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php deleted file mode 100644 index b5b4f4a1..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php +++ /dev/null @@ -1,113 +0,0 @@ -> Function name as key, array with target - * parameter position and name(s) as value. - */ - private static $hookInvokeFunctions = array( - 'do_action' => array( - 'position' => 1, - 'name' => 'hook_name', - ), - 'do_action_ref_array' => array( - 'position' => 1, - 'name' => 'hook_name', - ), - 'do_action_deprecated' => array( - 'position' => 1, - 'name' => 'hook_name', - ), - 'apply_filters' => array( - 'position' => 1, - 'name' => 'hook_name', - ), - 'apply_filters_ref_array' => array( - 'position' => 1, - 'name' => 'hook_name', - ), - 'apply_filters_deprecated' => array( - 'position' => 1, - 'name' => 'hook_name', - ), - ); - - /** - * Retrieve a list of the WordPress functions which invoke hooks. - * - * @since 3.0.0 - * - * @param bool $include_deprecated Whether to include the names of functions - * which are used to invoke deprecated hooks. - * Defaults to `true`. - * - * @return array Array with the function names as keys. The value is irrelevant. - */ - public static function get_functions( $include_deprecated = true ) { - $hooks = array_fill_keys( array_keys( self::$hookInvokeFunctions ), true ); - if ( false === $include_deprecated ) { - unset( - $hooks['do_action_deprecated'], - $hooks['apply_filters_deprecated'] - ); - } - - return $hooks; - } - - /** - * Retrieve the parameter information for the hook name parameter from a stack of parameters - * passed to one of the WP hook functions. - * - * @since 3.0.0 - * - * @param string $function_name The name of the WP hook function which the parameters were passed to. - * @param array $parameters The output of a previous call to PassedParameters::getParameters(). - * - * @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 the PHPCSUtils PassedParameters::getParameters() documentation - * for the format of the returned (single-dimensional) array. - */ - public static function get_hook_name_param( $function_name, array $parameters ) { - $function_lc = strtolower( $function_name ); - if ( isset( self::$hookInvokeFunctions[ $function_lc ] ) === false ) { - return false; - } - - return PassedParameters::getParameterFromStack( - $parameters, - self::$hookInvokeFunctions[ $function_lc ]['position'], - self::$hookInvokeFunctions[ $function_lc ]['name'] - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php deleted file mode 100644 index eaa7c22b..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php +++ /dev/null @@ -1,72 +0,0 @@ -phpcsFile = $phpcsFile; - $this->tokens = $phpcsFile->getTokens(); - - return $this->process_token( $stackPtr ); - } - - /** - * Processes a sniff when one of its tokens is encountered. - * - * @since 0.11.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - abstract public function process_token( $stackPtr ); -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php deleted file mode 100644 index de35bdff..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php +++ /dev/null @@ -1,252 +0,0 @@ -tokens[ $stackPtr ]['code'] ] ) - && Arrays::isShortArray( $this->phpcsFile, $stackPtr ) === false - ) { - // Short list, not short array. - return; - } - - /* - * Determine the array opener & closer. - */ - $array_open_close = Arrays::getOpenClose( $this->phpcsFile, $stackPtr ); - if ( false === $array_open_close ) { - // Array open/close could not be determined. - return; - } - - $opener = $array_open_close['opener']; - $closer = $array_open_close['closer']; - unset( $array_open_close ); - - // Pass off to either the single line or multi-line array analysis. - if ( $this->tokens[ $opener ]['line'] === $this->tokens[ $closer ]['line'] ) { - $this->process_single_line_array( $stackPtr, $opener, $closer ); - } else { - $this->process_multi_line_array( $stackPtr, $opener ); - } - } - - /** - * Check that associative arrays are always multi-line. - * - * @since 0.13.0 The actual checks contained in this method used to - * be in the `process()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * @param int $opener The position of the array opener. - * @param int $closer The position of the array closer. - * - * @return void - */ - protected function process_single_line_array( $stackPtr, $opener, $closer ) { - $array_items = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); - if ( ( false === $this->allow_single_item_single_line_associative_arrays - && empty( $array_items ) ) - || ( true === $this->allow_single_item_single_line_associative_arrays - && \count( $array_items ) === 1 ) - ) { - return; - } - - /* - * Make sure the double arrow is for *this* array, not for a nested one. - */ - $array_has_keys = false; - foreach ( $array_items as $item ) { - if ( Arrays::getDoubleArrowPtr( $this->phpcsFile, $item['start'], $item['end'] ) !== false ) { - $array_has_keys = true; - break; - } - } - - if ( false === $array_has_keys ) { - return; - } - $error = 'When an array uses associative keys, each value should start on %s.'; - if ( true === $this->allow_single_item_single_line_associative_arrays ) { - $error = 'When a multi-item array uses associative keys, each value should start on %s.'; - } - - /* - * Just add a new line before the array closer. - * The multi-line array fixer will then fix the individual array items in the next fixer loop. - */ - SpacesFixer::checkAndFix( - $this->phpcsFile, - $closer, - $this->phpcsFile->findPrevious( \T_WHITESPACE, ( $closer - 1 ), null, true ), - 'newline', - $error, - 'AssociativeArrayFound', - 'error' - ); - } - - /** - * Process a multi-line array. - * - * @since 0.13.0 The actual checks contained in this method used to - * be in the `ArrayDeclaration` sniff. - * @since 3.0.0 Removed the `$closer` parameter. - * - * @param int $stackPtr The position of the current token in the stack. - * @param int $opener The position of the array opener. - * - * @return void - */ - protected function process_multi_line_array( $stackPtr, $opener ) { - /* - * Check that each array item starts on a new line. - */ - $array_items = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); - $end_of_last_item = $opener; - - foreach ( $array_items as $item ) { - $end_of_this_item = ( $item['end'] + 1 ); - - // Find the line on which the item starts. - $first_content = $this->phpcsFile->findNext( - array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), - $item['start'], - $end_of_this_item, - true - ); - - // Ignore comments after array items if the next real content starts on a new line. - if ( $this->tokens[ $first_content ]['line'] === $this->tokens[ $end_of_last_item ]['line'] - && ( \T_COMMENT === $this->tokens[ $first_content ]['code'] - || isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $first_content ]['code'] ] ) ) - ) { - $end_of_comment = $first_content; - - // Find the end of (multi-line) /* */- style trailing comments. - if ( substr( ltrim( $this->tokens[ $end_of_comment ]['content'] ), 0, 2 ) === '/*' ) { - while ( ( \T_COMMENT === $this->tokens[ $end_of_comment ]['code'] - || isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $end_of_comment ]['code'] ] ) ) - && substr( rtrim( $this->tokens[ $end_of_comment ]['content'] ), -2 ) !== '*/' - && ( $end_of_comment + 1 ) < $end_of_this_item - ) { - ++$end_of_comment; - } - - if ( $this->tokens[ $end_of_comment ]['line'] !== $this->tokens[ $end_of_last_item ]['line'] ) { - // Multi-line trailing comment. - $end_of_last_item = $end_of_comment; - } - } - - $next = $this->phpcsFile->findNext( - array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), - ( $end_of_comment + 1 ), - $end_of_this_item, - true - ); - - if ( false === $next ) { - // Shouldn't happen, but just in case. - $end_of_last_item = $end_of_this_item; // @codeCoverageIgnore - continue; // @codeCoverageIgnore - } - - if ( $this->tokens[ $next ]['line'] !== $this->tokens[ $first_content ]['line'] ) { - $first_content = $next; - } - } - - if ( false === $first_content ) { - // Shouldn't happen, but just in case. - $end_of_last_item = $end_of_this_item; // @codeCoverageIgnore - continue; // @codeCoverageIgnore - } - - if ( $this->tokens[ $end_of_last_item ]['line'] === $this->tokens[ $first_content ]['line'] ) { - SpacesFixer::checkAndFix( - $this->phpcsFile, - $first_content, - $end_of_last_item, - 'newline', - 'Each item in a multi-line array must be on %s. Found: %s', - 'ArrayItemNoNewLine', - 'error' - ); - } - - $end_of_last_item = $end_of_this_item; - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php deleted file mode 100644 index 76bcda60..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php +++ /dev/null @@ -1,550 +0,0 @@ -ignore_tokens = Tokens::$heredocTokens; - unset( $this->ignore_tokens[ \T_START_HEREDOC ], $this->ignore_tokens[ \T_START_NOWDOC ] ); - $this->ignore_tokens[ \T_INLINE_HTML ] = \T_INLINE_HTML; - - return Collections::arrayOpenTokensBC(); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - if ( ! isset( $this->tab_width ) ) { - $this->tab_width = Helper::getTabWidth( $this->phpcsFile ); - } - - if ( isset( Collections::shortArrayListOpenTokensBC()[ $this->tokens[ $stackPtr ]['code'] ] ) - && Arrays::isShortArray( $this->phpcsFile, $stackPtr ) === false - ) { - // Short list, not short array. - return; - } - - /* - * Determine the array opener & closer. - */ - $array_open_close = Arrays::getOpenClose( $this->phpcsFile, $stackPtr ); - if ( false === $array_open_close ) { - // Array open/close could not be determined. - return; - } - - $opener = $array_open_close['opener']; - $closer = $array_open_close['closer']; - - if ( $this->tokens[ $opener ]['line'] === $this->tokens[ $closer ]['line'] ) { - // Not interested in single line arrays. - return; - } - - /* - * Check the closing bracket is lined up with the start of the content on the line - * containing the array opener. - */ - $opener_line_spaces = $this->get_indentation_size( $opener ); - $closer_line_spaces = ( $this->tokens[ $closer ]['column'] - 1 ); - - if ( $closer_line_spaces !== $opener_line_spaces ) { - $error = 'Array closer not aligned correctly; expected %s space(s) but found %s'; - $error_code = 'CloseBraceNotAligned'; - - /* - * Report & fix the issue if the close brace is on its own line with - * nothing or only indentation whitespace before it. - */ - if ( 0 === $closer_line_spaces - || ( \T_WHITESPACE === $this->tokens[ ( $closer - 1 ) ]['code'] - && 1 === $this->tokens[ ( $closer - 1 ) ]['column'] ) - ) { - $this->add_array_alignment_error( - $closer, - $error, - $error_code, - $opener_line_spaces, - $closer_line_spaces, - $this->get_indentation_string( $opener_line_spaces ) - ); - } else { - /* - * Otherwise, only report the error, don't try and fix it (yet). - * - * It will get corrected in a future loop of the fixer once the closer - * has been moved to its own line by the `ArrayDeclarationSpacing` sniff. - */ - $this->phpcsFile->addError( - $error, - $closer, - $error_code, - array( $opener_line_spaces, $closer_line_spaces ) - ); - } - - unset( $error, $error_code ); - } - - /* - * Verify & correct the array item indentation. - */ - $array_items = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); - if ( empty( $array_items ) ) { - // Strange, no array items found. - return; - } - - $expected_spaces = ( $opener_line_spaces + $this->tab_width ); - $expected_indent = $this->get_indentation_string( $expected_spaces ); - $end_of_previous_item = $opener; - - foreach ( $array_items as $item ) { - $end_of_this_item = ( $item['end'] + 1 ); - - // Find the line on which the item starts. - $first_content = $this->phpcsFile->findNext( - array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), - $item['start'], - $end_of_this_item, - true - ); - - // Deal with trailing comments. - if ( false !== $first_content - && \T_COMMENT === $this->tokens[ $first_content ]['code'] - && $this->tokens[ $first_content ]['line'] === $this->tokens[ $end_of_previous_item ]['line'] - ) { - $first_content = $this->phpcsFile->findNext( - array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE, \T_COMMENT ), - ( $first_content + 1 ), - $end_of_this_item, - true - ); - } - - if ( false === $first_content ) { - $end_of_previous_item = $end_of_this_item; - continue; - } - - // Bow out from reporting and fixing mixed multi-line/single-line arrays. - // That is handled by the ArrayDeclarationSpacingSniff. - if ( $this->tokens[ $first_content ]['line'] === $this->tokens[ $end_of_previous_item ]['line'] ) { - return $closer; - } - - // Ignore this item if there is anything but whitespace before the start of the next item. - if ( 1 !== $this->tokens[ $first_content ]['column'] ) { - // Go to the start of the line. - $i = $first_content; - while ( 1 !== $this->tokens[ --$i ]['column'] ); - - if ( \T_WHITESPACE !== $this->tokens[ $i ]['code'] ) { - $end_of_previous_item = $end_of_this_item; - continue; - } - } - - $found_spaces = ( $this->tokens[ $first_content ]['column'] - 1 ); - - if ( $found_spaces !== $expected_spaces ) { - $this->add_array_alignment_error( - $first_content, - 'Array item not aligned correctly; expected %s spaces but found %s', - 'ItemNotAligned', - $expected_spaces, - $found_spaces, - $expected_indent - ); - } - - // No need for further checking if this is a one-line array item. - if ( $this->tokens[ $first_content ]['line'] === $this->tokens[ $item['end'] ]['line'] ) { - $end_of_previous_item = $end_of_this_item; - continue; - } - - /* - * Multi-line array items. - * - * Verify & if needed, correct the indentation of subsequent lines. - * Subsequent lines may be indented more or less than the mimimum expected indent, - * but the "first line after" should be indented - at least - as much as the very first line - * of the array item. - * Indentation correction for subsequent lines will be based on that diff. - */ - - // Find first token on second line of the array item. - // If the second line is a heredoc/nowdoc, continue on until we find a line with a different token. - // Same for the second line of a multi-line text string. - for ( $ptr = ( $first_content + 1 ); $ptr <= $item['end']; $ptr++ ) { - if ( $this->tokens[ $first_content ]['line'] !== $this->tokens[ $ptr ]['line'] - && 1 === $this->tokens[ $ptr ]['column'] - && false === $this->ignore_token( $ptr ) - ) { - break; - } - } - - $first_content_on_line2 = $this->phpcsFile->findNext( - array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), - $ptr, - $end_of_this_item, - true - ); - - if ( false === $first_content_on_line2 ) { - /* - * Apparently there were only tokens in the ignore list on subsequent lines. - * - * In that case, the comma after the array item might be on a line by itself, - * so check its placement. - */ - if ( $this->tokens[ $item['end'] ]['line'] !== $this->tokens[ $end_of_this_item ]['line'] - && \T_COMMA === $this->tokens[ $end_of_this_item ]['code'] - && ( $this->tokens[ $end_of_this_item ]['column'] - 1 ) !== $expected_spaces - ) { - $this->add_array_alignment_error( - $end_of_this_item, - 'Comma after multi-line array item not aligned correctly; expected %s spaces, but found %s', - 'MultiLineArrayItemCommaNotAligned', - $expected_spaces, - ( $this->tokens[ $end_of_this_item ]['column'] - 1 ), - $expected_indent - ); - } - - $end_of_previous_item = $end_of_this_item; - continue; - } - - $found_spaces_on_line2 = $this->get_indentation_size( $first_content_on_line2 ); - $expected_spaces_on_line2 = $expected_spaces; - - if ( $found_spaces < $found_spaces_on_line2 ) { - $expected_spaces_on_line2 += ( $found_spaces_on_line2 - $found_spaces ); - } - - if ( $found_spaces_on_line2 !== $expected_spaces_on_line2 ) { - - $fix = $this->phpcsFile->addFixableError( - 'Multi-line array item not aligned correctly; expected %s spaces, but found %s', - $first_content_on_line2, - 'MultiLineArrayItemNotAligned', - array( - $expected_spaces_on_line2, - $found_spaces_on_line2, - ) - ); - - if ( true === $fix ) { - $expected_indent_on_line2 = $this->get_indentation_string( $expected_spaces_on_line2 ); - - $this->phpcsFile->fixer->beginChangeset(); - - // Fix second line for the array item. - if ( 1 === $this->tokens[ $first_content_on_line2 ]['column'] - && \T_COMMENT === $this->tokens[ $first_content_on_line2 ]['code'] - ) { - $actual_comment = ltrim( $this->tokens[ $first_content_on_line2 ]['content'] ); - $replacement = $expected_indent_on_line2 . $actual_comment; - - $this->phpcsFile->fixer->replaceToken( $first_content_on_line2, $replacement ); - - } else { - $this->fix_alignment_error( $first_content_on_line2, $expected_indent_on_line2 ); - } - - // Fix subsequent lines. - for ( $i = ( $first_content_on_line2 + 1 ); $i <= $item['end']; $i++ ) { - // We're only interested in the first token on each line. - if ( 1 !== $this->tokens[ $i ]['column'] ) { - if ( $this->tokens[ $i ]['line'] === $this->tokens[ $item['end'] ]['line'] ) { - // We might as well quit if we're past the first token on the last line. - break; - } - continue; - } - - $first_content_on_line = $this->phpcsFile->findNext( - array( \T_WHITESPACE, \T_DOC_COMMENT_WHITESPACE ), - $i, - $end_of_this_item, - true - ); - - if ( false === $first_content_on_line ) { - break; - } - - // Ignore lines with heredoc and nowdoc tokens and subsequent lines in multi-line strings. - if ( true === $this->ignore_token( $first_content_on_line ) ) { - $i = $first_content_on_line; - continue; - } - - $found_spaces_on_line = $this->get_indentation_size( $first_content_on_line ); - $expected_spaces_on_line = ( $expected_spaces_on_line2 + ( $found_spaces_on_line - $found_spaces_on_line2 ) ); - $expected_spaces_on_line = max( $expected_spaces_on_line, 0 ); // Can't be below 0. - $expected_indent_on_line = $this->get_indentation_string( $expected_spaces_on_line ); - - if ( $found_spaces_on_line !== $expected_spaces_on_line ) { - if ( 1 === $this->tokens[ $first_content_on_line ]['column'] - && \T_COMMENT === $this->tokens[ $first_content_on_line ]['code'] - ) { - $actual_comment = ltrim( $this->tokens[ $first_content_on_line ]['content'] ); - $replacement = $expected_indent_on_line . $actual_comment; - - $this->phpcsFile->fixer->replaceToken( $first_content_on_line, $replacement ); - } else { - $this->fix_alignment_error( $first_content_on_line, $expected_indent_on_line ); - } - } - - // Move past any potential empty lines between the previous non-empty line and this one. - // No need to do the fixes twice. - $i = $first_content_on_line; - } - - /* - * Check the placement of the comma after the array item as it might be on a line by itself. - */ - if ( $this->tokens[ $item['end'] ]['line'] !== $this->tokens[ $end_of_this_item ]['line'] - && \T_COMMA === $this->tokens[ $end_of_this_item ]['code'] - && ( $this->tokens[ $end_of_this_item ]['column'] - 1 ) !== $expected_spaces - ) { - $this->add_array_alignment_error( - $end_of_this_item, - 'Comma after array item not aligned correctly; expected %s spaces, but found %s', - 'MultiLineArrayItemCommaNotAligned', - $expected_spaces, - ( $this->tokens[ $end_of_this_item ]['column'] - 1 ), - $expected_indent - ); - } - - $this->phpcsFile->fixer->endChangeset(); - } - } - - $end_of_previous_item = $end_of_this_item; - } - } - - /** - * Should the token be ignored ? - * - * This method is only intended to be used with the first token on a line - * for subsequent lines in an multi-line array item. - * - * @param int $ptr Stack pointer to the first token on a line. - * - * @return bool - */ - protected function ignore_token( $ptr ) { - $token_code = $this->tokens[ $ptr ]['code']; - - if ( isset( $this->ignore_tokens[ $token_code ] ) ) { - return true; - } - - /* - * If it's a subsequent line of a multi-line sting, it will not start with a quote - * character, nor just *be* a quote character. - */ - if ( isset( Tokens::$stringTokens[ $token_code ] ) === true ) { - // Deal with closing quote of a multi-line string being on its own line. - if ( "'" === $this->tokens[ $ptr ]['content'] - || '"' === $this->tokens[ $ptr ]['content'] - ) { - return true; - } - - // Deal with subsequent lines of a multi-line string where the token is broken up per line. - if ( "'" !== $this->tokens[ $ptr ]['content'][0] - && '"' !== $this->tokens[ $ptr ]['content'][0] - ) { - return true; - } - } - - return false; - } - - /** - * Determine the line indentation whitespace. - * - * @param int $ptr Stack pointer to an arbitrary token on a line. - * - * @return int Nr of spaces found. Where necessary, tabs are translated to spaces. - */ - protected function get_indentation_size( $ptr ) { - - // Find the first token on the line. - for ( ; $ptr >= 0; $ptr-- ) { - if ( 1 === $this->tokens[ $ptr ]['column'] ) { - break; - } - } - - $whitespace = ''; - - if ( \T_WHITESPACE === $this->tokens[ $ptr ]['code'] - || \T_DOC_COMMENT_WHITESPACE === $this->tokens[ $ptr ]['code'] - ) { - return $this->tokens[ $ptr ]['length']; - } - - /* - * Special case for multi-line, non-docblock comments. - * Only applicable for subsequent lines in an array item. - * - * First/Single line is tokenized as T_WHITESPACE + T_COMMENT - * Subsequent lines are tokenized as T_COMMENT including the indentation whitespace. - */ - if ( \T_COMMENT === $this->tokens[ $ptr ]['code'] ) { - $content = $this->tokens[ $ptr ]['content']; - $actual_comment = ltrim( $content ); - $whitespace = str_replace( $actual_comment, '', $content ); - } - - return \strlen( $whitespace ); - } - - /** - * Create an indentation string. - * - * @param int $nr Number of spaces the indentation should be. - * - * @return string - */ - protected function get_indentation_string( $nr ) { - if ( 0 >= $nr ) { - return ''; - } - - // Space-based indentation. - if ( false === $this->tabIndent ) { - return str_repeat( ' ', $nr ); - } - - // Tab-based indentation. - $num_tabs = (int) floor( $nr / $this->tab_width ); - $remaining = ( $nr % $this->tab_width ); - $tab_indent = str_repeat( "\t", $num_tabs ); - $tab_indent .= str_repeat( ' ', $remaining ); - - return $tab_indent; - } - - /** - * Throw an error and fix incorrect array alignment. - * - * @param int $ptr Stack pointer to the first content on the line. - * @param string $error Error message. - * @param string $error_code Error code. - * @param int $expected Expected nr of spaces (tabs translated to space value). - * @param int $found Found nr of spaces (tabs translated to space value). - * @param string $new_indent Whitespace indent replacement content. - * - * @return void - */ - protected function add_array_alignment_error( $ptr, $error, $error_code, $expected, $found, $new_indent ) { - - $fix = $this->phpcsFile->addFixableError( $error, $ptr, $error_code, array( $expected, $found ) ); - if ( true === $fix ) { - $this->fix_alignment_error( $ptr, $new_indent ); - } - } - - /** - * Fix incorrect array alignment. - * - * @param int $ptr Stack pointer to the first content on the line. - * @param string $new_indent Whitespace indent replacement content. - * - * @return void - */ - protected function fix_alignment_error( $ptr, $new_indent ) { - if ( 1 === $this->tokens[ $ptr ]['column'] ) { - $this->phpcsFile->fixer->addContentBefore( $ptr, $new_indent ); - } else { - $this->phpcsFile->fixer->replaceToken( ( $ptr - 1 ), $new_indent ); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php deleted file mode 100644 index b32fb26a..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php +++ /dev/null @@ -1,174 +0,0 @@ -tokens[ $stackPtr ]; - if ( ! isset( $token['bracket_closer'] ) ) { - return; - } - - /* - * Handle square brackets without a key (array assignments) first. - */ - $first_non_ws = $this->phpcsFile->findNext( \T_WHITESPACE, ( $stackPtr + 1 ), null, true ); - if ( $first_non_ws === $token['bracket_closer'] ) { - $error = 'There should be %1$s between the square brackets for an array assignment without an explicit key. Found: %2$s'; - SpacesFixer::checkAndFix( - $this->phpcsFile, - $stackPtr, - $token['bracket_closer'], - 0, - $error, - 'SpacesBetweenBrackets' - ); - - return; - } - - /* - * Handle the spaces around explicit array keys. - */ - $needs_spaces = true; - - // Skip over a potential plus/minus sign for integers. - $first_effective = $first_non_ws; - if ( \T_MINUS === $this->tokens[ $first_effective ]['code'] || \T_PLUS === $this->tokens[ $first_effective ]['code'] ) { - $first_effective = $this->phpcsFile->findNext( \T_WHITESPACE, ( $first_effective + 1 ), null, true ); - } - - $next_non_ws = $this->phpcsFile->findNext( \T_WHITESPACE, ( $first_effective + 1 ), null, true ); - if ( ( \T_CONSTANT_ENCAPSED_STRING === $this->tokens[ $first_effective ]['code'] - || \T_LNUMBER === $this->tokens[ $first_effective ]['code'] ) - && $next_non_ws === $token['bracket_closer'] - ) { - $needs_spaces = false; - } - - $has_space_after_opener = ( \T_WHITESPACE === $this->tokens[ ( $stackPtr + 1 ) ]['code'] ); - $has_space_before_close = ( \T_WHITESPACE === $this->tokens[ ( $token['bracket_closer'] - 1 ) ]['code'] ); - - // The array key should be surrounded by spaces unless the key only consists of a string or an integer. - if ( true === $needs_spaces - && ( false === $has_space_after_opener || false === $has_space_before_close ) - ) { - $error = 'Array keys must be surrounded by spaces unless they contain a string or an integer.'; - $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpacesAroundArrayKeys' ); - if ( true === $fix ) { - $this->phpcsFile->fixer->beginChangeset(); - - if ( false === $has_space_after_opener ) { - $this->phpcsFile->fixer->addContent( $stackPtr, ' ' ); - } - - if ( false === $has_space_before_close ) { - $this->phpcsFile->fixer->addContentBefore( $token['bracket_closer'], ' ' ); - } - - $this->phpcsFile->fixer->endChangeset(); - } - } elseif ( false === $needs_spaces && ( $has_space_after_opener || $has_space_before_close ) ) { - $error = 'Array keys must NOT be surrounded by spaces if they only contain a string or an integer.'; - $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'SpacesAroundArrayKeys' ); - if ( true === $fix ) { - if ( $has_space_after_opener ) { - $this->phpcsFile->fixer->beginChangeset(); - - for ( $i = ( $stackPtr + 1 ); $i < $token['bracket_closer']; $i++ ) { - if ( \T_WHITESPACE !== $this->tokens[ $i ]['code'] ) { - break; - } - - $this->phpcsFile->fixer->replaceToken( $i, '' ); - } - - $this->phpcsFile->fixer->endChangeset(); - } - - if ( $has_space_before_close ) { - $this->phpcsFile->fixer->beginChangeset(); - - for ( $i = ( $token['bracket_closer'] - 1 ); $i > $stackPtr; $i-- ) { - if ( \T_WHITESPACE !== $this->tokens[ $i ]['code'] ) { - break; - } - - $this->phpcsFile->fixer->replaceToken( $i, '' ); - } - - $this->phpcsFile->fixer->endChangeset(); - } - } - } - - // If spaces are needed, check that there is only one space. - if ( true === $needs_spaces ) { - if ( $has_space_after_opener ) { - $error = 'There should be exactly %1$s before the array key. Found: %2$s'; - SpacesFixer::checkAndFix( - $this->phpcsFile, - $stackPtr, - $first_non_ws, - 1, - $error, - 'TooMuchSpaceBeforeKey' - ); - } - - if ( $has_space_before_close ) { - $last_non_ws = $this->phpcsFile->findPrevious( \T_WHITESPACE, ( $token['bracket_closer'] - 1 ), null, true ); - $error = 'There should be exactly %1$s after the array key. Found: %2$s'; - SpacesFixer::checkAndFix( - $this->phpcsFile, - $last_non_ws, - $token['bracket_closer'], - 1, - $error, - 'TooMuchSpaceAfterKey' - ); - } - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php deleted file mode 100644 index 87630c86..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php +++ /dev/null @@ -1,583 +0,0 @@ -= 60, align at column 60. - * - for the outliers, i.e. the array indexes where the end position - * goes past column 60, it will not align the arrow, the sniff will - * just make sure there is only one space between the end of the - * array index and the double arrow. - * - * The column value is regarded as a hard value, i.e. includes indentation, - * so setting it very low is not a good idea. - * - * @since 0.14.0 - * - * @var int - */ - public $maxColumn = 1000; - - /** - * Whether or not to align the arrow operator for multi-line array items. - * - * Whether or not an item is regarded as multi-line is based on the **value** - * of the item, not the key. - * - * Valid values are: - * - 'always': Default. Align all arrays items regardless of single/multi-line. - * - 'never': Never align array items which span multiple lines. - * This will enforce one space between the array index and the - * double arrow operator for multi-line array items, independently - * of the alignment of the rest of the array items. - * Multi-line items where the arrow is already aligned with the - * "expected" alignment, however, will be left alone. - * - operator : Only align the operator for multi-line arrays items if the - * + number percentage of multi-line items passes the comparison. - * - As it is a percentage, the number has to be between 0 and 100. - * - Supported operators: <, <=, >, >=, ==, =, !=, <> - * - The percentage is calculated against all array items - * (with and without assignment operator). - * - The (new) expected alignment will be calculated based only - * on the items being aligned. - * - Multi-line items where the arrow is already aligned with the - * (new) "expected" alignment, however, will be left alone. - * Examples: - * * Setting this to `!=100` or `<100` means that alignment will - * be enforced, unless *all* array items are multi-line. - * This is probably the most commonly desired situation. - * * Setting this to `=100` means that alignment will only - * be enforced, if *all* array items are multi-line. - * * Setting this to `<50` means that the majority of array items - * need to be single line before alignment is enforced for - * multi-line items in the array. - * * Setting this to `=0` is useless as in that case there are - * no multi-line items in the array anyway. - * - * This setting will respect the `ignoreNewlines` and `maxColumnn` settings. - * - * @since 0.14.0 - * - * @var string|int - */ - public $alignMultilineItems = 'always'; - - /** - * Storage for parsed $alignMultilineItems operator part. - * - * @since 0.14.0 - * - * @var string - */ - private $operator; - - /** - * Storage for parsed $alignMultilineItems numeric part. - * - * Stored as a string as the comparison will be done string based. - * - * @since 0.14.0 - * - * @var string - */ - private $number; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 0.14.0 - * - * @return array - */ - public function register() { - return Collections::arrayOpenTokensBC(); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 0.14.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - - if ( isset( Collections::shortArrayListOpenTokensBC()[ $this->tokens[ $stackPtr ]['code'] ] ) - && Arrays::isShortArray( $this->phpcsFile, $stackPtr ) === false - ) { - // Short list, not short array. - return; - } - - /* - * Determine the array opener & closer. - */ - $array_open_close = Arrays::getOpenClose( $this->phpcsFile, $stackPtr ); - if ( false === $array_open_close ) { - // Array open/close could not be determined. - return; - } - - $opener = $array_open_close['opener']; - $closer = $array_open_close['closer']; - - $array_items = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); - if ( empty( $array_items ) ) { - return; - } - - // Pass off to either the single line or multi-line array analysis. - if ( $this->tokens[ $opener ]['line'] === $this->tokens[ $closer ]['line'] ) { - return $this->process_single_line_array( $stackPtr, $array_items, $opener, $closer ); - } else { - return $this->process_multi_line_array( $stackPtr, $array_items, $opener, $closer ); - } - } - - /** - * Process a single-line array. - * - * While the WP standard does not allow single line multi-item associative arrays, - * this sniff should function independently of that. - * - * The `WordPress.WhiteSpace.OperatorSpacing` sniff already covers checking that - * there is a space between the array key and the double arrow, but doesn't - * enforce it to be exactly one space for single line arrays. - * That is what this method covers. - * - * @since 0.14.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param array $items Info array containing information on each array item. - * @param int $opener The position of the array opener. - * @param int $closer The position of the array closer. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - protected function process_single_line_array( $stackPtr, $items, $opener, $closer ) { - /* - * For single line arrays, we don't care about what level the arrow is from. - * Just find and fix them all. - */ - $next_arrow = $this->phpcsFile->findNext( - \T_DOUBLE_ARROW, - ( $opener + 1 ), - $closer - ); - - while ( false !== $next_arrow ) { - if ( \T_WHITESPACE === $this->tokens[ ( $next_arrow - 1 ) ]['code'] ) { - $space_length = $this->tokens[ ( $next_arrow - 1 ) ]['length']; - if ( 1 !== $space_length ) { - $error = 'Expected 1 space between "%s" and double arrow; %s found'; - $data = array( - $this->tokens[ ( $next_arrow - 2 ) ]['content'], - $space_length, - ); - - $fix = $this->phpcsFile->addFixableWarning( $error, $next_arrow, 'SpaceBeforeDoubleArrow', $data ); - if ( true === $fix ) { - $this->phpcsFile->fixer->replaceToken( ( $next_arrow - 1 ), ' ' ); - } - } - } - - // Find the position of the next double arrow. - $next_arrow = $this->phpcsFile->findNext( - \T_DOUBLE_ARROW, - ( $next_arrow + 1 ), - $closer - ); - } - - // Ignore any child-arrays as the double arrows in these will already have been handled. - return ( $closer + 1 ); - } - - /** - * Process a multi-line array. - * - * @since 0.14.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param array $items Info array containing information on each array item. - * @param int $opener The position of the array opener. - * @param int $closer The position of the array closer. - * - * @return void - */ - protected function process_multi_line_array( $stackPtr, $items, $opener, $closer ) { - - $this->maxColumn = (int) $this->maxColumn; - $this->validate_align_multiline_items(); - - /* - * Determine what the spacing before the arrow should be. - * - * Will unset any array items without double arrow and with new line whitespace - * if newlines are to be ignored, so the second foreach loop only has to deal - * with items which need attention. - * - * This sniff does not take incorrect indentation of array keys into account. - * That's for the `WordPress.Arrays.ArrayIndentation` sniff to fix. - * If that would affect the alignment, a second (or third) loop of the fixer - * will correct it (again) after the indentation has been fixed. - */ - $index_end_cols = array(); // Keep track of the end column position of index keys. - $double_arrow_cols = array(); // Keep track of arrow column position and count. - $multi_line_count = 0; - $total_items = \count( $items ); - - foreach ( $items as $key => $item ) { - // Find the double arrow if there is one. - $double_arrow = Arrays::getDoubleArrowPtr( $this->phpcsFile, $item['start'], $item['end'] ); - if ( false === $double_arrow ) { - unset( $items[ $key ] ); - continue; - } - - // Find the end of the array key. - $last_index_token = $this->phpcsFile->findPrevious( - \T_WHITESPACE, - ( $double_arrow - 1 ), - $item['start'], - true - ); - - if ( true === $this->ignoreNewlines - && $this->tokens[ $last_index_token ]['line'] !== $this->tokens[ $double_arrow ]['line'] - ) { - // Ignore this item as it has a new line between the item key and the double arrow. - unset( $items[ $key ] ); - continue; - } - - $index_end_position = ( $this->tokens[ $last_index_token ]['column'] + ( $this->tokens[ $last_index_token ]['length'] - 1 ) ); - $items[ $key ]['operatorPtr'] = $double_arrow; - $items[ $key ]['last_index_token'] = $last_index_token; - $items[ $key ]['last_index_col'] = $index_end_position; - - if ( $this->tokens[ $last_index_token ]['line'] === $this->tokens[ $item['end'] ]['line'] ) { - $items[ $key ]['single_line'] = true; - } else { - $items[ $key ]['single_line'] = false; - ++$multi_line_count; - } - - if ( ( $index_end_position + 2 ) <= $this->maxColumn ) { - $index_end_cols[] = $index_end_position; - } - - if ( ! isset( $double_arrow_cols[ $this->tokens[ $double_arrow ]['column'] ] ) ) { - $double_arrow_cols[ $this->tokens[ $double_arrow ]['column'] ] = 1; - } else { - ++$double_arrow_cols[ $this->tokens[ $double_arrow ]['column'] ]; - } - } - unset( $key, $item, $double_arrow, $last_index_token ); - - if ( empty( $items ) || empty( $index_end_cols ) ) { - // No actionable array items found. - return; - } - - /* - * Determine whether the operators for multi-line items should be aligned. - */ - if ( 'always' === $this->alignMultilineItems ) { - $alignMultilineItems = true; - } elseif ( 'never' === $this->alignMultilineItems ) { - $alignMultilineItems = false; - } else { - $percentage = (string) round( ( $multi_line_count / $total_items ) * 100, 0 ); - - // Bit hacky, but this is the only comparison function in PHP which allows to - // pass the comparison operator. And hey, it works ;-). - $alignMultilineItems = version_compare( $percentage, $this->number, $this->operator ); - } - - /* - * If necessary, rebuild the $index_end_cols and $double_arrow_cols arrays - * excluding multi-line items. - */ - if ( false === $alignMultilineItems ) { - $select_index_end_cols = array(); - $double_arrow_cols = array(); - - foreach ( $items as $item ) { - if ( false === $item['single_line'] ) { - continue; - } - - if ( ( $item['last_index_col'] + 2 ) <= $this->maxColumn ) { - $select_index_end_cols[] = $item['last_index_col']; - } - - if ( ! isset( $double_arrow_cols[ $this->tokens[ $item['operatorPtr'] ]['column'] ] ) ) { - $double_arrow_cols[ $this->tokens[ $item['operatorPtr'] ]['column'] ] = 1; - } else { - ++$double_arrow_cols[ $this->tokens[ $item['operatorPtr'] ]['column'] ]; - } - } - } - - /* - * Determine the expected position of the double arrows. - */ - if ( ! empty( $select_index_end_cols ) ) { - $max_index_width = max( $select_index_end_cols ); - } else { - $max_index_width = max( $index_end_cols ); - } - - $expected_col = ( $max_index_width + 2 ); - - if ( false === $this->exact && ! empty( $double_arrow_cols ) ) { - /* - * If the alignment does not have to be exact, see if a majority - * group of the arrows is already at an acceptable position. - */ - arsort( $double_arrow_cols, \SORT_NUMERIC ); - reset( $double_arrow_cols ); - $count = current( $double_arrow_cols ); - - if ( $count > 1 || ( 1 === $count && \count( $items ) === 1 ) ) { - // Allow for several groups of arrows having the same $count. - $filtered_double_arrow_cols = array_keys( $double_arrow_cols, $count, true ); - - foreach ( $filtered_double_arrow_cols as $col ) { - if ( $col > $expected_col && $col <= $this->maxColumn ) { - $expected_col = $col; - break; - } - } - } - } - unset( $max_index_width, $count, $filtered_double_arrow_cols, $col ); - - /* - * Verify and correct the spacing around the double arrows. - */ - foreach ( $items as $item ) { - if ( $this->tokens[ $item['operatorPtr'] ]['column'] === $expected_col - && $this->tokens[ $item['operatorPtr'] ]['line'] === $this->tokens[ $item['last_index_token'] ]['line'] - ) { - // Already correctly aligned. - continue; - } - - if ( \T_WHITESPACE !== $this->tokens[ ( $item['operatorPtr'] - 1 ) ]['code'] ) { - $before = 0; - } elseif ( $this->tokens[ $item['last_index_token'] ]['line'] !== $this->tokens[ $item['operatorPtr'] ]['line'] ) { - $before = 'newline'; - } else { - $before = $this->tokens[ ( $item['operatorPtr'] - 1 ) ]['length']; - } - - /* - * Deal with index sizes larger than maxColumn and with multi-line - * array items which should not be aligned. - */ - if ( ( $item['last_index_col'] + 2 ) > $this->maxColumn - || ( false === $alignMultilineItems && false === $item['single_line'] ) - ) { - - if ( ( $item['last_index_col'] + 2 ) === $this->tokens[ $item['operatorPtr'] ]['column'] - && $this->tokens[ $item['operatorPtr'] ]['line'] === $this->tokens[ $item['last_index_token'] ]['line'] - ) { - // MaxColumn/Multi-line item exception, already correctly aligned. - continue; - } - - $prefix = 'LongIndex'; - if ( false === $alignMultilineItems && false === $item['single_line'] ) { - $prefix = 'MultilineItem'; - } - - $error_code = $prefix . 'SpaceBeforeDoubleArrow'; - if ( 0 === $before ) { - $error_code = $prefix . 'NoSpaceBeforeDoubleArrow'; - } - - $fix = $this->phpcsFile->addFixableWarning( - 'Expected 1 space between "%s" and double arrow; %s found.', - $item['operatorPtr'], - $error_code, - array( - $this->tokens[ $item['last_index_token'] ]['content'], - $before, - ) - ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->beginChangeset(); - - // Remove whitespace tokens between the end of the index and the arrow, if any. - for ( $i = ( $item['last_index_token'] + 1 ); $i < $item['operatorPtr']; $i++ ) { - $this->phpcsFile->fixer->replaceToken( $i, '' ); - } - - // Add the correct whitespace. - $this->phpcsFile->fixer->addContent( $item['last_index_token'], ' ' ); - - $this->phpcsFile->fixer->endChangeset(); - } - continue; - } - - /* - * Deal with the space before double arrows in all other cases. - */ - $expected_whitespace = $expected_col - ( $this->tokens[ $item['last_index_token'] ]['column'] + $this->tokens[ $item['last_index_token'] ]['length'] ); - - $fix = $this->phpcsFile->addFixableWarning( - 'Array double arrow not aligned correctly; expected %s space(s) between "%s" and double arrow, but found %s.', - $item['operatorPtr'], - 'DoubleArrowNotAligned', - array( - $expected_whitespace, - $this->tokens[ $item['last_index_token'] ]['content'], - $before, - ) - ); - - if ( true === $fix ) { - if ( 0 === $before || 'newline' === $before ) { - $this->phpcsFile->fixer->beginChangeset(); - - // Remove whitespace tokens between the end of the index and the arrow, if any. - for ( $i = ( $item['last_index_token'] + 1 ); $i < $item['operatorPtr']; $i++ ) { - $this->phpcsFile->fixer->replaceToken( $i, '' ); - } - - // Add the correct whitespace. - $this->phpcsFile->fixer->addContent( - $item['last_index_token'], - str_repeat( ' ', $expected_whitespace ) - ); - - $this->phpcsFile->fixer->endChangeset(); - } elseif ( $expected_whitespace > $before ) { - // Add to the existing whitespace to prevent replacing tabs with spaces. - // That's the concern of another sniff. - $this->phpcsFile->fixer->addContent( - ( $item['operatorPtr'] - 1 ), - str_repeat( ' ', ( $expected_whitespace - $before ) ) - ); - } else { - // Too much whitespace found. - $this->phpcsFile->fixer->replaceToken( - ( $item['operatorPtr'] - 1 ), - str_repeat( ' ', $expected_whitespace ) - ); - } - } - } - } - - /** - * Validate that a valid value has been received for the alignMultilineItems property. - * - * This message may be thrown more than once if the property is being changed inline in a file. - * - * @since 0.14.0 - * - * @return void - */ - protected function validate_align_multiline_items() { - $alignMultilineItems = $this->alignMultilineItems; - - if ( 'always' === $alignMultilineItems || 'never' === $alignMultilineItems ) { - return; - } else { - // Correct for a potentially added % sign. - $alignMultilineItems = rtrim( $alignMultilineItems, '%' ); - - if ( preg_match( '`^([=<>!]{1,2})(100|[0-9]{1,2})$`', $alignMultilineItems, $matches ) > 0 ) { - $operator = $matches[1]; - $number = (int) $matches[2]; - - if ( \in_array( $operator, array( '<', '<=', '>', '>=', '==', '=', '!=', '<>' ), true ) === true - && ( $number >= 0 && $number <= 100 ) - ) { - $this->alignMultilineItems = $alignMultilineItems; - $this->number = (string) $number; - $this->operator = $operator; - return; - } - } - } - - $this->phpcsFile->addError( - 'Invalid property value passed: "%s". The value for the "alignMultilineItems" property for the "WordPress.Arrays.MultipleStatementAlignment" sniff should be either "always", "never" or an comparison operator + a number between 0 and 100.', - 0, - 'InvalidPropertyPassed', - array( $this->alignMultilineItems ) - ); - - // Reset to the default if an invalid value was received. - $this->alignMultilineItems = 'always'; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php deleted file mode 100644 index a74b5f29..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php +++ /dev/null @@ -1,173 +0,0 @@ -assignment_tokens = Tokens::$assignmentTokens; - unset( $this->assignment_tokens[ \T_DOUBLE_ARROW ] ); - - $starters = Tokens::$booleanOperators; - $starters[ \T_SEMICOLON ] = \T_SEMICOLON; - $starters[ \T_OPEN_PARENTHESIS ] = \T_OPEN_PARENTHESIS; - $starters[ \T_INLINE_ELSE ] = \T_INLINE_ELSE; - - $this->condition_start_tokens = $starters; - - return array( - \T_INLINE_THEN, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 0.14.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function process_token( $stackPtr ) { - - $token = $this->tokens[ $stackPtr ]; - - // Check if the condition for the ternary is bracketed. - $prev = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); - if ( \T_CLOSE_PARENTHESIS === $this->tokens[ $prev ]['code'] ) { - if ( ! isset( $this->tokens[ $prev ]['parenthesis_opener'] ) ) { - return; - } - - $opener = $this->tokens[ $prev ]['parenthesis_opener']; - $closer = $prev; - } elseif ( isset( $token['nested_parenthesis'] ) ) { - $opener = Parentheses::getLastOpener( $this->phpcsFile, $stackPtr ); - $closer = Parentheses::getLastCloser( $this->phpcsFile, $stackPtr ); - - $next_statement_closer = BCFile::findEndOfStatement( $this->phpcsFile, $stackPtr, array( \T_COLON, \T_CLOSE_PARENTHESIS, \T_CLOSE_SQUARE_BRACKET ) ); - if ( false !== $next_statement_closer && $next_statement_closer < $closer ) { - // Parentheses are unrelated to the ternary. - return; - } - - $prev_statement_closer = BCFile::findStartOfStatement( $this->phpcsFile, $stackPtr, array( \T_COLON, \T_OPEN_PARENTHESIS, \T_OPEN_SQUARE_BRACKET ) ); - if ( false !== $prev_statement_closer && $opener < $prev_statement_closer ) { - // Parentheses are unrelated to the ternary. - return; - } - - if ( $closer > $stackPtr ) { - $closer = $stackPtr; - } - } else { - // No parenthesis found, can't determine where the conditional part of the ternary starts. - return; - } - - $startPos = $opener; - - do { - $hasAssignment = $this->phpcsFile->findNext( $this->assignment_tokens, ( $startPos + 1 ), $closer ); - if ( false === $hasAssignment ) { - return; - } - - // Examine whether the left side is a variable. - $hasVariable = false; - $conditionStart = $startPos; - $altConditionStart = $this->phpcsFile->findPrevious( - $this->condition_start_tokens, - ( $hasAssignment - 1 ), - $startPos - ); - if ( false !== $altConditionStart ) { - $conditionStart = $altConditionStart; - } - - for ( $i = $hasAssignment; $i > $conditionStart; $i-- ) { - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - // If this is a variable or array, we've seen all we need to see. - if ( \T_VARIABLE === $this->tokens[ $i ]['code'] - || \T_CLOSE_SQUARE_BRACKET === $this->tokens[ $i ]['code'] - ) { - $hasVariable = true; - break; - } - - // If this is a function call or something, we are OK. - if ( \T_CLOSE_PARENTHESIS === $this->tokens[ $i ]['code'] ) { - break; - } - } - - if ( true === $hasVariable ) { - $this->phpcsFile->addWarning( - 'Variable assignment found within a condition. Did you mean to do a comparison?', - $hasAssignment, - 'FoundInTernaryCondition' - ); - } - - $startPos = $hasAssignment; - - } while ( $startPos < $closer ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php deleted file mode 100644 index 45084498..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php +++ /dev/null @@ -1,89 +0,0 @@ - Key is the name of the function being matched, value the alternative to use. - */ - protected $target_functions = array( - 'esc_html' => 'esc_html__', - 'esc_attr' => 'esc_attr__', - ); - - /** - * Process the parameters of a matched function. - * - * @since 2.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - if ( \count( $parameters ) === 1 ) { - return; - } - - /* - * We already know that there will be a valid open+close parenthesis, otherwise the sniff - * would have bowed out long before. - */ - $opener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - $closer = $this->tokens[ $opener ]['parenthesis_closer']; - - $data = array( - $matched_content, - $this->target_functions[ $matched_content ], - GetTokensAsString::compact( $this->phpcsFile, $stackPtr, $closer, true ), - ); - - $this->phpcsFile->addWarning( - '%s() expects only a $text parameter. Did you mean to use %s() ? Found: %s', - $stackPtr, - 'Found', - $data - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php deleted file mode 100644 index 590f6478..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php +++ /dev/null @@ -1,301 +0,0 @@ - array(), - 'cacheset' => array(), - 'cachedelete' => array(), - ); - - /** - * A list of functions that get data from the cache. - * - * @since 0.6.0 - * @since 0.11.0 Changed from public static to protected non-static. - * @since 3.0.0 Moved from the generic `Sniff` class to this class. - * - * @var array - */ - protected $cacheGetFunctions = array( - 'wp_cache_get' => true, - ); - - /** - * A list of functions that set data in the cache. - * - * @since 0.6.0 - * @since 0.11.0 Changed from public static to protected non-static. - * @since 3.0.0 Moved from the generic `Sniff` class to this class. - * - * @var array - */ - protected $cacheSetFunctions = array( - 'wp_cache_set' => true, - 'wp_cache_add' => true, - ); - - /** - * A list of functions that delete data from the cache. - * - * @since 0.6.0 - * @since 0.11.0 Changed from public static to protected non-static. - * @since 3.0.0 Moved from the generic `Sniff` class to this class. - * - * @var array - */ - protected $cacheDeleteFunctions = array( - 'wp_cache_delete' => true, - 'clean_attachment_cache' => true, - 'clean_blog_cache' => true, - 'clean_bookmark_cache' => true, - 'clean_category_cache' => true, - 'clean_comment_cache' => true, - 'clean_network_cache' => true, - 'clean_object_term_cache' => true, - 'clean_page_cache' => true, - 'clean_post_cache' => true, - 'clean_term_cache' => true, - 'clean_user_cache' => true, - ); - - /** - * The lists of $wpdb methods. - * - * @since 0.6.0 - * @since 0.11.0 Changed from static to non-static. - * - * @var array[] - */ - protected $methods = array( - 'cachable' => array( - 'delete' => true, - 'get_var' => true, - 'get_col' => true, - 'get_row' => true, - 'get_results' => true, - 'query' => true, - 'replace' => true, - 'update' => true, - ), - 'noncachable' => array( - 'insert' => true, - ), - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() { - return array( - \T_VARIABLE, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - - // Check for $wpdb variable. - if ( '$wpdb' !== $this->tokens[ $stackPtr ]['content'] ) { - return; - } - - $is_object_call = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( false === $is_object_call - || ( \T_OBJECT_OPERATOR !== $this->tokens[ $is_object_call ]['code'] - && \T_NULLSAFE_OBJECT_OPERATOR !== $this->tokens[ $is_object_call ]['code'] ) - ) { - // This is not a call to the wpdb object. - return; - } - - $methodPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $is_object_call + 1 ), null, true ); - $method = strtolower( $this->tokens[ $methodPtr ]['content'] ); - - $this->mergeFunctionLists(); - - if ( ! isset( $this->methods['all'][ $method ] ) ) { - return; - } - - $endOfStatement = $this->phpcsFile->findNext( array( \T_SEMICOLON, \T_CLOSE_TAG ), ( $stackPtr + 1 ) ); - if ( false === $endOfStatement ) { - return; - } - - // Check for Database Schema Changes/ table truncation. - for ( $_pos = ( $stackPtr + 1 ); $_pos < $endOfStatement; $_pos++ ) { - $_pos = $this->phpcsFile->findNext( Tokens::$textStringTokens, $_pos, $endOfStatement ); - if ( false === $_pos ) { - break; - } - - if ( strpos( strtoupper( TextStrings::stripQuotes( $this->tokens[ $_pos ]['content'] ) ), 'TRUNCATE ' ) === 0 ) { - // Ignore queries to truncate the database as caching those is irrelevant and they need a direct db query. - return; - } - - if ( preg_match( '#\b(?:ALTER|CREATE|DROP)\b#i', $this->tokens[ $_pos ]['content'] ) > 0 ) { - $this->phpcsFile->addWarning( 'Attempting a database schema change is discouraged.', $_pos, 'SchemaChange' ); - } - } - - $this->phpcsFile->addWarning( 'Use of a direct database call is discouraged.', $stackPtr, 'DirectQuery' ); - - if ( ! isset( $this->methods['cachable'][ $method ] ) ) { - return $endOfStatement; - } - - $cached = false; - $wp_cache_get = false; - - $scope_function = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); - if ( false !== $scope_function ) { - $scopeStart = $this->tokens[ $scope_function ]['scope_opener']; - $scopeEnd = $this->tokens[ $scope_function ]['scope_closer']; - - for ( $i = ( $scopeStart + 1 ); $i < $scopeEnd; $i++ ) { - if ( \T_STRING === $this->tokens[ $i ]['code'] ) { - - if ( isset( $this->cacheDeleteFunctions[ $this->tokens[ $i ]['content'] ] ) ) { - - if ( \in_array( $method, array( 'query', 'update', 'replace', 'delete' ), true ) ) { - $cached = true; - break; - } - } elseif ( isset( $this->cacheGetFunctions[ $this->tokens[ $i ]['content'] ] ) ) { - - $wp_cache_get = true; - - } elseif ( isset( $this->cacheSetFunctions[ $this->tokens[ $i ]['content'] ] ) ) { - - if ( $wp_cache_get ) { - $cached = true; - break; - } - } - } - } - } - - if ( ! $cached ) { - $message = 'Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().'; - $this->phpcsFile->addWarning( $message, $stackPtr, 'NoCaching' ); - } - - return $endOfStatement; - } - - /** - * Merge custom functions provided via a custom ruleset with the defaults, if we haven't already. - * - * @since 0.11.0 Split out from the `process()` method. - * - * @return void - */ - protected function mergeFunctionLists() { - if ( ! isset( $this->methods['all'] ) ) { - $this->methods['all'] = array_merge( $this->methods['cachable'], $this->methods['noncachable'] ); - } - - if ( $this->customCacheGetFunctions !== $this->addedCustomFunctions['cacheget'] ) { - $this->cacheGetFunctions = RulesetPropertyHelper::merge_custom_array( - $this->customCacheGetFunctions, - $this->cacheGetFunctions - ); - - $this->addedCustomFunctions['cacheget'] = $this->customCacheGetFunctions; - } - - if ( $this->customCacheSetFunctions !== $this->addedCustomFunctions['cacheset'] ) { - $this->cacheSetFunctions = RulesetPropertyHelper::merge_custom_array( - $this->customCacheSetFunctions, - $this->cacheSetFunctions - ); - - $this->addedCustomFunctions['cacheset'] = $this->customCacheSetFunctions; - } - - if ( $this->customCacheDeleteFunctions !== $this->addedCustomFunctions['cachedelete'] ) { - $this->cacheDeleteFunctions = RulesetPropertyHelper::merge_custom_array( - $this->customCacheDeleteFunctions, - $this->cacheDeleteFunctions - ); - - $this->addedCustomFunctions['cachedelete'] = $this->customCacheDeleteFunctions; - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php deleted file mode 100644 index 043175d8..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php +++ /dev/null @@ -1,761 +0,0 @@ -prepare method. - * - * Checks the following issues: - * - The only placeholders supported are: %d, %f (%F), %s, %i, and their variations. - * - Literal % signs need to be properly escaped as `%%`. - * - Simple placeholders (%d, %f, %F, %s, %i) should be left unquoted in the query string. - * - Complex placeholders - numbered and formatted variants - will not be quoted - * automagically by $wpdb->prepare(), so if used for values, should be quoted in - * the query string. - * The only exception to this is complex placeholders for %i. In that case, the - * replacement *will* still be backtick-quoted. - * - Either an array of replacements should be passed matching the number of - * placeholders found or individual parameters for each placeholder should - * be passed. - * - Wildcards for LIKE compare values should be passed in via a replacement parameter. - * - * The sniff allows for a specific pattern with a variable number of placeholders - * created using code along the lines of: - * `sprintf( 'query .... IN (%s) ...', implode( ',', array_fill( 0, count( $something ), '%s' ) ) )`. - * - * @link https://developer.wordpress.org/reference/classes/wpdb/prepare/ - * @link https://core.trac.wordpress.org/changeset/41496 - * @link https://core.trac.wordpress.org/changeset/41471 - * @link https://core.trac.wordpress.org/changeset/55151 - * - * @since 0.14.0 - * @since 3.0.0 Support for the %i placeholder has been added - * - * @uses \WordPressCS\WordPress\Helpers\MinimumWPVersionTrait::$minimum_wp_version - */ -final class PreparedSQLPlaceholdersSniff extends Sniff { - - use MinimumWPVersionTrait; - use WPDBTrait; - - /** - * These regexes were originally copied from https://www.php.net/function.sprintf#93552 - * and adjusted for limitations in `$wpdb->prepare()`. - * - * Near duplicate of the one used in the WP.I18n sniff, but with fewer types allowed. - * - * Note: The regex delimiters and modifiers are not included to allow this regex to be - * concatenated together with other regex partials. - * - * @since 0.14.0 - * - * @var string - */ - const PREPARE_PLACEHOLDER_REGEX = '(?: - (? true, - ); - - /** - * Storage for the stack pointer to the method call token. - * - * @since 0.14.0 - * - * @var int - */ - protected $methodPtr; - - /** - * Simple regex snippet to recognize and remember quotes. - * - * @since 0.14.0 - * - * @var string - */ - private $regex_quote = '["\']'; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 0.14.0 - * - * @return array - */ - public function register() { - return array( - \T_VARIABLE, - \T_STRING, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 0.14.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function process_token( $stackPtr ) { - - $this->set_minimum_wp_version(); - - if ( ! $this->is_wpdb_method_call( $this->phpcsFile, $stackPtr, $this->target_methods ) ) { - return; - } - - $parameters = PassedParameters::getParameters( $this->phpcsFile, $this->methodPtr ); - if ( empty( $parameters ) ) { - return; - } - - $query = PassedParameters::getParameterFromStack( $parameters, 1, 'query' ); - if ( false === $query ) { - return; - } - - $text_string_tokens_found = false; - $variable_found = false; - $sql_wildcard_found = false; - $total_placeholders = 0; - $total_parameters = \count( $parameters ); - $valid_in_clauses = array( - 'uses_in' => 0, - 'implode_fill' => 0, - 'adjustment_count' => 0, - ); - $skip_from = null; - $skip_to = null; - - for ( $i = $query['start']; $i <= $query['end']; $i++ ) { - // Skip over groups of tokens if they are part of an inline function call. - if ( isset( $skip_from, $skip_to ) && $i >= $skip_from && $i <= $skip_to ) { - $i = $skip_to; - continue; - } - - if ( ! isset( Tokens::$textStringTokens[ $this->tokens[ $i ]['code'] ] ) ) { - if ( \T_VARIABLE === $this->tokens[ $i ]['code'] ) { - if ( '$wpdb' !== $this->tokens[ $i ]['content'] ) { - $variable_found = true; - } - continue; - } - - // Detect a specific pattern for variable replacements in combination with `IN`. - if ( \T_STRING === $this->tokens[ $i ]['code'] ) { - - if ( 'sprintf' === strtolower( $this->tokens[ $i ]['content'] ) ) { - $sprintf_parameters = PassedParameters::getParameters( $this->phpcsFile, $i ); - - if ( ! empty( $sprintf_parameters ) ) { - /* - * Check for named params. sprintf() does not support this due to its variadic nature, - * and we cannot analyse the code correctly if it is used, so skip the whole sprintf() - * in that case. - */ - $valid_sprintf = true; - foreach ( $sprintf_parameters as $param ) { - if ( isset( $param['name'] ) ) { - $valid_sprintf = false; - break; - } - } - - if ( false === $valid_sprintf ) { - $next = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); - if ( \T_OPEN_PARENTHESIS === $this->tokens[ $next ]['code'] - && isset( $this->tokens[ $next ]['parenthesis_closer'] ) - ) { - $skip_from = ( $i + 1 ); - $skip_to = $this->tokens[ $next ]['parenthesis_closer']; - } - - continue; - } - - // We know for sure this sprintf() uses positional parameters, so this will be fine. - $skip_from = ( $sprintf_parameters[1]['end'] + 1 ); - $last_param = end( $sprintf_parameters ); - $skip_to = ( $last_param['end'] + 1 ); - - $valid_in_clauses['implode_fill'] += $this->analyse_sprintf( $sprintf_parameters ); - $valid_in_clauses['adjustment_count'] += ( \count( $sprintf_parameters ) - 1 ); - } - unset( $sprintf_parameters, $valid_sprintf, $last_param ); - - } elseif ( 'implode' === strtolower( $this->tokens[ $i ]['content'] ) ) { - $prev = $this->phpcsFile->findPrevious( - Tokens::$emptyTokens + array( \T_STRING_CONCAT => \T_STRING_CONCAT ), - ( $i - 1 ), - $query['start'], - true - ); - - if ( isset( Tokens::$textStringTokens[ $this->tokens[ $prev ]['code'] ] ) ) { - $prev_content = TextStrings::stripQuotes( $this->tokens[ $prev ]['content'] ); - $regex_quote = $this->get_regex_quote_snippet( $prev_content, $this->tokens[ $prev ]['content'] ); - - // Only examine the implode if preceded by an ` IN (`. - if ( preg_match( '`\s+IN\s*\(\s*(' . $regex_quote . ')?$`i', $prev_content, $match ) > 0 ) { - - if ( isset( $match[1] ) && $regex_quote !== $this->regex_quote ) { - $this->phpcsFile->addError( - 'Dynamic placeholder generation should not have surrounding quotes.', - $prev, - 'QuotedDynamicPlaceholderGeneration' - ); - } - - if ( $this->analyse_implode( $i ) === true ) { - ++$valid_in_clauses['uses_in']; - ++$valid_in_clauses['implode_fill']; - - $next = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); - if ( \T_OPEN_PARENTHESIS === $this->tokens[ $next ]['code'] - && isset( $this->tokens[ $next ]['parenthesis_closer'] ) - ) { - $skip_from = ( $i + 1 ); - $skip_to = $this->tokens[ $next ]['parenthesis_closer']; - } - } - } - unset( $next, $prev_content, $regex_quote, $match ); - } - unset( $prev ); - } - } - - continue; - } - - $text_string_tokens_found = true; - $content = $this->tokens[ $i ]['content']; - - $regex_quote = $this->regex_quote; - if ( isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) ) { - $content = TextStrings::stripQuotes( $content ); - $regex_quote = $this->get_regex_quote_snippet( $content, $this->tokens[ $i ]['content'] ); - } - - if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $i ]['code'] - || \T_HEREDOC === $this->tokens[ $i ]['code'] - ) { - // Only interested in actual query text, so strip out variables. - $stripped_content = TextStrings::stripEmbeds( $content ); - if ( $stripped_content !== $content ) { - $vars_without_wpdb = array_filter( - TextStrings::getEmbeds( $content ), - static function ( $symbol ) { - return preg_match( '`^\{?\$\{?wpdb\??->`', $symbol ) !== 1; - } - ); - - $content = $stripped_content; - - if ( ! empty( $vars_without_wpdb ) ) { - $variable_found = true; - } - } - unset( $stripped_content, $vars_without_wpdb ); - } - - $placeholders = preg_match_all( '`' . self::PREPARE_PLACEHOLDER_REGEX . '`x', $content, $matches ); - if ( $placeholders > 0 ) { - $total_placeholders += $placeholders; - } - - /* - * Analyse the query for incorrect LIKE queries. - * - * - `LIKE %s` is the only correct one. - * - `LIKE '%s'` or `LIKE "%s"` will not be reported here, but in the quote check. - * - Any other `LIKE` statement should be reported, either for using `LIKE` without - * SQL wildcards or for not passing the SQL wildcards via the replacement. - */ - $regex = '`\s+LIKE\s*(?:(' . $regex_quote . ')(?!%s(?:\1|$))(?P.*?)(?:\1|$)|(?:concat\((?![^\)]*%s[^\)]*\))(?P[^\)]*))\))`i'; - if ( preg_match_all( $regex, $content, $matches ) > 0 ) { - $walk = array(); - if ( ! empty( $matches['content'] ) ) { - $matches['content'] = array_filter( $matches['content'] ); - if ( ! empty( $matches['content'] ) ) { - $walk[] = 'content'; - } - } - if ( ! empty( $matches['concat'] ) ) { - $matches['concat'] = array_filter( $matches['concat'] ); - if ( ! empty( $matches['concat'] ) ) { - $walk[] = 'concat'; - } - } - - if ( ! empty( $walk ) ) { - foreach ( $walk as $match_key ) { - foreach ( $matches[ $match_key ] as $index => $match ) { - $data = array( $matches[0][ $index ] ); - - // Both a `%` as well as a `_` are wildcards in SQL. - if ( strpos( $match, '%' ) === false && strpos( $match, '_' ) === false ) { - $this->phpcsFile->addWarning( - 'Unless you are using SQL wildcards, using LIKE is inefficient. Use a straight compare instead. Found: %s.', - $i, - 'LikeWithoutWildcards', - $data - ); - } else { - $sql_wildcard_found = true; - - if ( strpos( $match, '%s' ) === false ) { - $this->phpcsFile->addError( - 'SQL wildcards for a LIKE query should be passed in through a replacement parameter. Found: %s.', - $i, - 'LikeWildcardsInQuery', - $data - ); - } else { - $this->phpcsFile->addError( - 'SQL wildcards for a LIKE query should be passed in through a replacement parameter and the variable part of the replacement should be escaped using "esc_like()". Found: %s.', - $i, - 'LikeWildcardsInQueryWithPlaceholder', - $data - ); - } - } - - /* - * Don't throw `UnescapedLiteral`, `UnsupportedPlaceholder` or `QuotedPlaceholder` - * for this part of the SQL query. - */ - $content = preg_replace( '`' . preg_quote( $match, '`' ) . '`', '', $content, 1 ); - } - } - } - unset( $matches, $index, $match, $data ); - } - - if ( strpos( $content, '%' ) === false ) { - continue; - } - - /* - * Analyse the query for unsupported placeholders. - */ - if ( preg_match_all( self::UNSUPPORTED_PLACEHOLDER_REGEX, $content, $matches ) > 0 ) { - if ( ! empty( $matches[0] ) ) { - foreach ( $matches[0] as $match ) { - if ( '%' === $match ) { - $this->phpcsFile->addError( - 'Found unescaped literal "%%" character.', - $i, - 'UnescapedLiteral', - array( $match ) - ); - } else { - $this->phpcsFile->addError( - 'Unsupported placeholder used in $wpdb->prepare(). Found: "%s".', - $i, - 'UnsupportedPlaceholder', - array( $match ) - ); - } - } - } - unset( $match, $matches ); - } - - if ( $this->wp_version_compare( $this->minimum_wp_version, '6.2', '<' ) ) { - if ( preg_match_all( '`' . self::PREPARE_PLACEHOLDER_REGEX . '`x', $content, $matches ) > 0 ) { - if ( ! empty( $matches[0] ) ) { - foreach ( $matches[0] as $match ) { - if ( 'i' === substr( $match, -1 ) ) { - $this->phpcsFile->addError( - 'The %%i modifier is only supported in WP 6.2 or higher. Found: "%s".', - $i, - 'UnsupportedIdentifierPlaceholder', - array( $match ) - ); - } - } - } - } - unset( $match, $matches ); - } - - /* - * Analyse the query for single/double quoted simple value placeholders - * Identifiers are checked separately. - */ - $regex = '`(' . $regex_quote . ')%[dfFs]\1`'; - if ( preg_match_all( $regex, $content, $matches ) > 0 ) { - if ( ! empty( $matches[0] ) ) { - foreach ( $matches[0] as $match ) { - $this->phpcsFile->addError( - 'Simple placeholders should not be quoted in the query string in $wpdb->prepare(). Found: %s.', - $i, - 'QuotedSimplePlaceholder', - array( $match ) - ); - } - } - unset( $match, $matches ); - } - - /* - * Analyse the query for quoted identifier placeholders. - */ - $regex = '/(' . $regex_quote . '|`)(?' . self::PREPARE_PLACEHOLDER_REGEX . ')\1/x'; - if ( preg_match_all( $regex, $content, $matches ) > 0 ) { - if ( ! empty( $matches ) ) { - foreach ( $matches['placeholder'] as $index => $match ) { - if ( 'i' === substr( $match, -1 ) ) { - $this->phpcsFile->addError( - 'Placeholders used for identifiers (%%i) in the query string in $wpdb->prepare() are always quoted automagically. Please remove the surrounding quotes. Found: %s', - $i, - 'QuotedIdentifierPlaceholder', - array( $matches[0][ $index ] ) - ); - } - } - } - unset( $index, $match, $matches ); - } - - /* - * Analyse the query for unquoted complex placeholders. - */ - $regex = '`(? 0 ) { - if ( ! empty( $matches[0] ) ) { - foreach ( $matches[0] as $match ) { - if ( substr( $match, -1 ) !== 'i' && preg_match( '`^%[dfFsi]$`', $match ) !== 1 ) { // Identifiers must always be unquoted. - $this->phpcsFile->addWarning( - 'Complex placeholders used for values in the query string in $wpdb->prepare() will NOT be quoted automagically. Found: %s.', - $i, - 'UnquotedComplexPlaceholder', - array( $match ) - ); - } - } - } - unset( $match, $matches ); - } - - /* - * Check for an ` IN (%s)` clause. - */ - $found_in = preg_match_all( '`\s+IN\s*\(\s*%s\s*\)`i', $content, $matches ); - if ( $found_in > 0 ) { - $valid_in_clauses['uses_in'] += $found_in; - } - unset( $found_in ); - } - - if ( false === $text_string_tokens_found ) { - // Query string passed in as a variable or function call, nothing to examine. - return; - } - - if ( 0 === $total_placeholders ) { - if ( 1 === $total_parameters ) { - if ( false === $variable_found && false === $sql_wildcard_found ) { - /* - * Only throw this warning if the PreparedSQL sniff won't throw one about - * variables being found. - * Also don't throw it if we just advised to use a replacement variable to pass a - * string containing an SQL wildcard. - */ - $this->phpcsFile->addWarning( - 'It is not necessary to prepare a query which doesn\'t use variable replacement.', - $i, - 'UnnecessaryPrepare' - ); - } - } elseif ( 0 === $valid_in_clauses['uses_in'] ) { - $this->phpcsFile->addWarning( - 'Replacement variables found, but no valid placeholders found in the query.', - $i, - 'UnfinishedPrepare' - ); - } - - return; - } - - if ( 1 === $total_parameters ) { - $this->phpcsFile->addError( - 'Placeholders found in the query passed to $wpdb->prepare(), but no replacements found. Expected %d replacement(s) parameters.', - $stackPtr, - 'MissingReplacements', - array( $total_placeholders ) - ); - return; - } - - $replacements = $parameters; - unset( $replacements['query'], $replacements[1] ); // Remove the query param, whether passed positionally or named. - - // The parameters may have been passed as an array in the variadic $args parameter. - $args_param = PassedParameters::getParameterFromStack( $parameters, 2, 'args' ); - if ( false !== $args_param && 2 === $total_parameters ) { - $next = $this->phpcsFile->findNext( - Tokens::$emptyTokens, - $args_param['start'], - ( $args_param['end'] + 1 ), - true - ); - - if ( false !== $next - && ( \T_ARRAY === $this->tokens[ $next ]['code'] - || ( isset( Collections::shortArrayListOpenTokensBC()[ $this->tokens[ $next ]['code'] ] ) - && Arrays::isShortArray( $this->phpcsFile, $next ) === true ) ) - ) { - $replacements = PassedParameters::getParameters( $this->phpcsFile, $next ); - } - } - - $total_replacements = \count( $replacements ); - $total_placeholders -= $valid_in_clauses['adjustment_count']; - - // Bow out when `IN` clauses have been used which appear to be correct. - if ( $valid_in_clauses['uses_in'] > 0 - && $valid_in_clauses['uses_in'] === $valid_in_clauses['implode_fill'] - && 1 === $total_replacements - ) { - return; - } - - /* - * Verify that the correct amount of replacements have been passed. - */ - if ( $total_replacements !== $total_placeholders ) { - $this->phpcsFile->addWarning( - 'Incorrect number of replacements passed to $wpdb->prepare(). Found %d replacement parameters, expected %d.', - $stackPtr, - 'ReplacementsWrongNumber', - array( $total_replacements, $total_placeholders ) - ); - } - } - - /** - * Retrieve a regex snippet to recognize and remember quotes based on the quote style - * used in the original string (if any). - * - * This allows for recognizing `"` and `\'` in single quoted strings, - * recognizing `'` and `\"` in double quotes strings and `'` and `"`when the quote - * style is unknown or it is a non-quoted string (heredoc/nowdoc and such). - * - * @since 0.14.0 - * - * @param string $stripped_content Text string content without surrounding quotes. - * @param string $original_content Original content for the same text string. - * - * @return string - */ - protected function get_regex_quote_snippet( $stripped_content, $original_content ) { - $regex_quote = $this->regex_quote; - - if ( $original_content !== $stripped_content ) { - $quote_style = $original_content[0]; - - if ( '"' === $quote_style ) { - $regex_quote = '\\\\"|\''; - } elseif ( "'" === $quote_style ) { - $regex_quote = '"|\\\\\''; - } - } - - return $regex_quote; - } - - /** - * Analyse a sprintf() query wrapper to see if it contains a specific code pattern - * to deal correctly with `IN` queries. - * - * The pattern we are searching for is: - * `sprintf( 'query ....', implode( ',', array_fill( 0, count( $something ), '%s' ) ) )` - * - * @since 0.14.0 - * - * @param array $sprintf_params Parameters details for the sprintf call. - * - * @return int The number of times the pattern was found in the replacements. - */ - protected function analyse_sprintf( $sprintf_params ) { - $found = 0; - - unset( $sprintf_params[1] ); // Remove the positionally passed $format param. - - foreach ( $sprintf_params as $sprintf_param ) { - $implode = $this->phpcsFile->findNext( - Tokens::$emptyTokens + array( \T_NS_SEPARATOR => \T_NS_SEPARATOR ), - $sprintf_param['start'], - $sprintf_param['end'], - true - ); - if ( \T_STRING === $this->tokens[ $implode ]['code'] - && 'implode' === strtolower( $this->tokens[ $implode ]['content'] ) - ) { - if ( $this->analyse_implode( $implode ) === true ) { - ++$found; - } - } - } - - return $found; - } - - /** - * Analyse an implode() function call to see if it contains a specific code pattern - * to dynamically create placeholders. - * - * The pattern we are searching for is: - * `implode( ',', array_fill( 0, count( $something ), '%s' ) )` - * - * This pattern presumes unquoted placeholders! - * - * Identifiers (%i) are not supported, as this function is designed to work - * with `IN()`, which contains a list of values. In the future, it should - * be possible to simplify code using the implode/array_fill pattern to - * use a variable number of identifiers, e.g. `CONCAT(%...i)`, - * https://core.trac.wordpress.org/ticket/54042 - * - * @since 0.14.0 - * - * @param int $implode_token The stackPtr to the implode function call. - * - * @return bool True if the pattern is found, false otherwise. - */ - protected function analyse_implode( $implode_token ) { - $implode_params = PassedParameters::getParameters( $this->phpcsFile, $implode_token ); - if ( empty( $implode_params ) || \count( $implode_params ) !== 2 ) { - return false; - } - - $implode_separator_param = PassedParameters::getParameterFromStack( $implode_params, 1, 'separator' ); - if ( false === $implode_separator_param - || preg_match( '`^(["\']), ?\1$`', $implode_separator_param['clean'] ) !== 1 - ) { - return false; - } - - $implode_array_param = PassedParameters::getParameterFromStack( $implode_params, 2, 'array' ); - if ( false === $implode_array_param ) { - return false; - } - - $array_fill = $this->phpcsFile->findNext( - Tokens::$emptyTokens + array( \T_NS_SEPARATOR => \T_NS_SEPARATOR ), - $implode_array_param['start'], - $implode_array_param['end'], - true - ); - - if ( \T_STRING !== $this->tokens[ $array_fill ]['code'] - || 'array_fill' !== strtolower( $this->tokens[ $array_fill ]['content'] ) - ) { - return false; - } - - $array_fill_value_param = PassedParameters::getParameter( $this->phpcsFile, $array_fill, 3, 'value' ); - if ( false === $array_fill_value_param ) { - return false; - } - - if ( "'%i'" === $array_fill_value_param['clean'] - || '"%i"' === $array_fill_value_param['clean'] - ) { - $firstNonEmpty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $array_fill_value_param['start'], $array_fill_value_param['end'], true ); - - $this->phpcsFile->addError( - 'The %i placeholder cannot be used within SQL `IN()` clauses.', - $firstNonEmpty, - 'IdentifierWithinIN' - ); - return false; - } - - return (bool) preg_match( '`^(["\'])%[dfFs]\1$`', $array_fill_value_param['clean'] ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php deleted file mode 100644 index 7b6529ef..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php +++ /dev/null @@ -1,242 +0,0 @@ - - */ - protected $methods = array( - 'get_var' => true, - 'get_col' => true, - 'get_row' => true, - 'get_results' => true, - 'prepare' => true, - 'query' => true, - ); - - /** - * Functions that escape values for use in SQL queries. - * - * @since 0.9.0 - * @since 0.11.0 Changed from public static to protected non-static. - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The property visibility has changed from `protected` to `private`. - * - * @var array - */ - private $SQLEscapingFunctions = array( - 'absint' => true, - 'esc_sql' => true, - 'floatval' => true, - 'intval' => true, - 'like_escape' => true, - ); - - /** - * Functions whose output is automatically escaped for use in SQL queries. - * - * @since 0.9.0 - * @since 0.11.0 Changed from public static to protected non-static. - * @since 3.0.0 - Moved from the Sniff class to this class. - * - The property visibility has changed from `protected` to `private`. - * - * @var array - */ - private $SQLAutoEscapedFunctions = array( - 'count' => true, - ); - - /** - * Tokens that we don't flag when they are found in a $wpdb method call. - * - * This token array is augmented from within the register() method. - * - * @since 0.9.0 - * @since 3.0.0 The property visibility has changed from `protected` to `private`. - * - * @var array - */ - private $ignored_tokens = array( - \T_STRING_CONCAT => true, - \T_CONSTANT_ENCAPSED_STRING => true, - \T_COMMA => true, - \T_LNUMBER => true, - \T_DNUMBER => true, - \T_NS_SEPARATOR => true, - ); - - /** - * A loop pointer. - * - * It is a property so that we can access it in all of our methods. - * - * @since 0.9.0 - * - * @var int - */ - protected $i; - - /** - * The loop end marker. - * - * It is a property so that we can access it in all of our methods. - * - * @since 0.9.0 - * - * @var int - */ - protected $end; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 0.8.0 - * - * @return array - */ - public function register() { - // Enrich the array of tokens which can be safely ignored. - $this->ignored_tokens += Tokens::$bracketTokens; - $this->ignored_tokens += Tokens::$heredocTokens; - $this->ignored_tokens += Tokens::$castTokens; - $this->ignored_tokens += Tokens::$arithmeticTokens; - $this->ignored_tokens += Collections::incrementDecrementOperators(); - $this->ignored_tokens += Collections::objectOperators(); - $this->ignored_tokens += Tokens::$emptyTokens; - - // The contents of heredoc tokens needs to be examined. - unset( $this->ignored_tokens[ \T_HEREDOC ] ); - - return array( - \T_VARIABLE, - \T_STRING, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 0.8.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - - if ( ! $this->is_wpdb_method_call( $this->phpcsFile, $stackPtr, $this->methods ) ) { - return; - } - - for ( $this->i; $this->i < $this->end; $this->i++ ) { - - if ( isset( $this->ignored_tokens[ $this->tokens[ $this->i ]['code'] ] ) ) { - continue; - } - - if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $this->i ]['code'] - || \T_HEREDOC === $this->tokens[ $this->i ]['code'] - ) { - - $bad_variables = array_filter( - TextStrings::getEmbeds( $this->tokens[ $this->i ]['content'] ), - static function ( $symbol ) { - return preg_match( '`^\{?\$\{?wpdb\??->`', $symbol ) !== 1; - } - ); - - foreach ( $bad_variables as $bad_variable ) { - $this->phpcsFile->addError( - 'Use placeholders and $wpdb->prepare(); found interpolated variable %s at %s', - $this->i, - 'InterpolatedNotPrepared', - array( - $bad_variable, - $this->tokens[ $this->i ]['content'], - ) - ); - } - continue; - } - - if ( \T_VARIABLE === $this->tokens[ $this->i ]['code'] ) { - if ( '$wpdb' === $this->tokens[ $this->i ]['content'] ) { - $this->is_wpdb_method_call( $this->phpcsFile, $this->i, $this->methods ); - continue; - } - - if ( ContextHelper::is_safe_casted( $this->phpcsFile, $this->i ) ) { - continue; - } - } - - if ( \T_STRING === $this->tokens[ $this->i ]['code'] ) { - - if ( - isset( $this->SQLEscapingFunctions[ $this->tokens[ $this->i ]['content'] ] ) - || isset( $this->SQLAutoEscapedFunctions[ $this->tokens[ $this->i ]['content'] ] ) - ) { - - // Find the opening parenthesis. - $opening_paren = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $this->i + 1 ), null, true ); - - if ( false !== $opening_paren - && \T_OPEN_PARENTHESIS === $this->tokens[ $opening_paren ]['code'] - && isset( $this->tokens[ $opening_paren ]['parenthesis_closer'] ) - ) { - // Skip past to the end of the function call. - $this->i = $this->tokens[ $opening_paren ]['parenthesis_closer']; - continue; - } - } elseif ( FormattingFunctionsHelper::is_formatting_function( $this->tokens[ $this->i ]['content'] ) ) { - continue; - } - } - - $this->phpcsFile->addError( - 'Use placeholders and $wpdb->prepare(); found %s', - $this->i, - 'NotPrepared', - array( $this->tokens[ $this->i ]['content'] ) - ); - } - - return $this->end; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php deleted file mode 100644 index 4262889a..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Avoid direct calls to the database.', - * 'classes' => array( 'PDO', '\Namespace\Classname' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - - 'mysql' => array( - 'type' => 'error', - 'message' => 'Accessing the database directly should be avoided. Please use the $wpdb object and associated functions instead. Found: %s.', - 'classes' => array( - 'mysqli', - 'PDO', - 'PDOStatement', - ), - ), - - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php deleted file mode 100644 index 7d23adaa..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - - 'mysql' => array( - 'type' => 'error', - 'message' => 'Accessing the database directly should be avoided. Please use the $wpdb object and associated functions instead. Found: %s.', - 'functions' => array( - 'mysql_*', - 'mysqli_*', - 'mysqlnd_ms_*', - 'mysqlnd_qc_*', - 'mysqlnd_uh_*', - 'mysqlnd_memcache_*', - 'maxdb_*', - ), - 'allow' => array( - 'mysql_to_rfc3339' => true, - ), - ), - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php deleted file mode 100644 index 5cbd99ac..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php +++ /dev/null @@ -1,58 +0,0 @@ - array( - 'type' => 'warning', - 'message' => 'Detected usage of %s, possible slow query.', - 'keys' => array( - 'tax_query', - 'meta_query', - 'meta_key', - 'meta_value', - ), - ), - ); - } - - /** - * Callback to process each confirmed key, to check value. - * - * @param string $key Array index / key. - * @param mixed $val Assigned value. - * @param int $line Token line. - * @param array $group Group definition. - * - * @return bool Always returns TRUE as the value is irrelevant. - */ - public function callback( $key, $val, $line, $group ) { - return true; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php deleted file mode 100644 index 34bfe514..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php +++ /dev/null @@ -1,168 +0,0 @@ - Key is function name, value irrelevant. - */ - protected $target_functions = array( - 'current_time' => true, - ); - - /** - * Process the parameters of a matched function. - * - * @since 2.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - /* - * We already know there will be valid open & close parentheses as otherwise the parameter - * retrieval function call would have returned an empty array, so no additional checks needed. - */ - $open_parens = $this->phpcsFile->findNext( \T_OPEN_PARENTHESIS, $stackPtr ); - $close_parens = $this->tokens[ $open_parens ]['parenthesis_closer']; - - /* - * Check whether the first parameter is a timestamp format. - */ - $type_param = PassedParameters::getParameterFromStack( $parameters, 1, 'type' ); - if ( false === $type_param ) { - // Type parameter not found. Bow out. - return; - } - - $content_type = ''; - for ( $i = $type_param['start']; $i <= $type_param['end']; $i++ ) { - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - if ( isset( Tokens::$textStringTokens[ $this->tokens[ $i ]['code'] ] ) ) { - $content_type = trim( TextStrings::stripQuotes( $this->tokens[ $i ]['content'] ) ); - if ( 'U' !== $content_type && 'timestamp' !== $content_type ) { - // Most likely valid use of current_time(). - return; - } - - continue; - } - - if ( isset( Tokens::$heredocTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - /* - * If we're still here, we've encountered an unexpected token, like a variable or - * function call. Bow out as we can't determine the runtime value. - */ - return; - } - - $gmt_true = false; - - /* - * Check whether the second parameter, $gmt, is a set to `true` or `1`. - */ - $gmt_param = PassedParameters::getParameterFromStack( $parameters, 2, 'gmt' ); - if ( is_array( $gmt_param ) ) { - $content_gmt = ''; - if ( 'true' === $gmt_param['clean'] || '1' === $gmt_param['clean'] ) { - $content_gmt = $gmt_param['clean']; - $gmt_true = true; - } - } - - /* - * Non-UTC timestamp requested. - */ - if ( false === $gmt_true ) { - $this->phpcsFile->addWarning( - 'Calling current_time() with a $type of "timestamp" or "U" is strongly discouraged as it will not return a Unix (UTC) timestamp. Please consider using a non-timestamp format or otherwise refactoring this code.', - $stackPtr, - 'Requested' - ); - - return; - } - - /* - * UTC timestamp requested. Should use time() instead. - */ - $has_comment = $this->phpcsFile->findNext( Tokens::$commentTokens, ( $stackPtr + 1 ), ( $close_parens + 1 ) ); - $error = 'Don\'t use current_time() for retrieving a Unix (UTC) timestamp. Use time() instead. Found: %s'; - $error_code = 'RequestedUTC'; - - $code_snippet = "current_time( '" . $content_type . "'"; - if ( isset( $content_gmt ) ) { - $code_snippet .= ', ' . $content_gmt; - } - $code_snippet .= ' )'; - - if ( false !== $has_comment ) { - // If there are comments, we don't auto-fix as it would remove those comments. - $this->phpcsFile->addError( $error, $stackPtr, $error_code, array( $code_snippet ) ); - return; - } - - $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, $error_code, array( $code_snippet ) ); - if ( true === $fix ) { - $this->phpcsFile->fixer->beginChangeset(); - - for ( $i = ( $stackPtr + 1 ); $i < $close_parens; $i++ ) { - $this->phpcsFile->fixer->replaceToken( $i, '' ); - } - - $this->phpcsFile->fixer->replaceToken( $stackPtr, 'time(' ); - $this->phpcsFile->fixer->endChangeset(); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php deleted file mode 100644 index 279da573..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'error', - 'message' => 'Using %s() and similar isn\'t allowed, instead use WP internal timezone support.', - 'functions' => array( - 'date_default_timezone_set', - ), - ), - - /* - * Use gmdate(), not date(). - * Don't rely on the current PHP time zone as it might have been changed by third party code. - * - * @link https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/ - * @link https://core.trac.wordpress.org/ticket/46438 - * @link https://github.com/WordPress/WordPress-Coding-Standards/issues/1713 - */ - 'date' => array( - 'type' => 'error', - 'message' => '%s() is affected by runtime timezone changes which can cause date/time to be incorrectly displayed. Use gmdate() instead.', - 'functions' => array( - 'date', - ), - ), - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php deleted file mode 100644 index 63fc9174..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php +++ /dev/null @@ -1,313 +0,0 @@ - true, - 'class.wp-scripts.php' => true, - 'class.wp-styles.php' => true, - 'functions.wp-scripts.php' => true, - 'functions.wp-styles.php' => true, - ); - - /** - * Unit test version of the historical exceptions in WP core. - * - * @since 0.11.0 - * @since 3.0.0 Property has been renamed from `$unittest_class_exceptions` to `$unittest_hyphenation_exceptions`, - * - * @var array - */ - private $unittest_hyphenation_exceptions = array( - 'class.wp-dependencies.inc' => true, - 'class.wp-scripts.inc' => true, - 'class.wp-styles.inc' => true, - 'functions.wp-scripts.inc' => true, - 'functions.wp-styles.inc' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() { - if ( \defined( '\PHP_CODESNIFFER_IN_TESTS' ) ) { - $this->hyphenation_exceptions += $this->unittest_hyphenation_exceptions; - } - - return Collections::phpOpenTags(); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - // Usage of `stripQuotes` is to ensure `stdin_path` passed by IDEs does not include quotes. - $file = TextStrings::stripQuotes( $this->phpcsFile->getFileName() ); - if ( 'STDIN' === $file ) { - return; - } - - $class_ptr = $this->phpcsFile->findNext( \T_CLASS, $stackPtr ); - if ( false !== $class_ptr && $this->is_test_class( $this->phpcsFile, $class_ptr ) ) { - /* - * This rule should not be applied to test classes (at all). - * @link https://github.com/WordPress/WordPress-Coding-Standards/issues/1995 - */ - return; - } - - // Respect phpcs:disable comments as long as they are not accompanied by an enable. - $i = -1; - while ( $i = $this->phpcsFile->findNext( \T_PHPCS_DISABLE, ( $i + 1 ) ) ) { - if ( empty( $this->tokens[ $i ]['sniffCodes'] ) - || isset( $this->tokens[ $i ]['sniffCodes']['WordPress'] ) - || isset( $this->tokens[ $i ]['sniffCodes']['WordPress.Files'] ) - || isset( $this->tokens[ $i ]['sniffCodes']['WordPress.Files.FileName'] ) - ) { - do { - $i = $this->phpcsFile->findNext( \T_PHPCS_ENABLE, ( $i + 1 ) ); - } while ( false !== $i - && ! empty( $this->tokens[ $i ]['sniffCodes'] ) - && ! isset( $this->tokens[ $i ]['sniffCodes']['WordPress'] ) - && ! isset( $this->tokens[ $i ]['sniffCodes']['WordPress.Files'] ) - && ! isset( $this->tokens[ $i ]['sniffCodes']['WordPress.Files.FileName'] ) ); - - if ( false === $i ) { - // The entire (rest of the) file is disabled. - return; - } - } - } - - $file_name = basename( $file ); - - $this->check_filename_is_hyphenated( $file_name ); - - if ( true === $this->strict_class_file_names && false !== $class_ptr ) { - $this->check_filename_has_class_prefix( $class_ptr, $file_name ); - } - - if ( false !== strpos( $file, \DIRECTORY_SEPARATOR . 'wp-includes' . \DIRECTORY_SEPARATOR ) - && false === $class_ptr - ) { - $this->check_filename_for_template_suffix( $stackPtr, $file_name ); - } - - // Only run this sniff once per file, no need to run it again. - return ( $this->phpcsFile->numTokens + 1 ); - } - - /** - * Generic check for lowercase hyphenated file names. - * - * @since 3.0.0 - * - * @param string $file_name The name of the current file. - * - * @return void - */ - protected function check_filename_is_hyphenated( $file_name ) { - $extension = strrchr( $file_name, '.' ); - $name = substr( $file_name, 0, ( strlen( $file_name ) - strlen( $extension ) ) ); - - $expected = strtolower( preg_replace( '`[[:punct:]]`', '-', $name ) ) . $extension; - if ( $file_name === $expected - || isset( $this->hyphenation_exceptions[ $file_name ] ) - ) { - return; - } - - if ( true === $this->is_theme && 1 === preg_match( self::THEME_EXCEPTIONS_REGEX, $file_name ) ) { - return; - } - - $this->phpcsFile->addError( - 'Filenames should be all lowercase with hyphens as word separators. Expected %s, but found %s.', - 0, - 'NotHyphenatedLowercase', - array( $expected, $file_name ) - ); - } - - - /** - * Check files containing a class for the "class-" prefix and that the rest of - * the file name reflects the class name. - * - * @since 3.0.0 - * - * @param int $class_ptr Stack pointer to the first T_CLASS in the file. - * @param string $file_name The name of the current file. - * - * @return void - */ - protected function check_filename_has_class_prefix( $class_ptr, $file_name ) { - $extension = strrchr( $file_name, '.' ); - $class_name = ObjectDeclarations::getName( $this->phpcsFile, $class_ptr ); - $expected = 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . $extension; - - if ( $file_name === $expected ) { - return; - } - - $this->phpcsFile->addError( - 'Class file names should be based on the class name with "class-" prepended. Expected %s, but found %s.', - 0, - 'InvalidClassFileName', - array( - $expected, - $file_name, - ) - ); - } - - /** - * Check non-class files in "wp-includes" with a "@subpackage Template" tag for a "-template" suffix. - * - * @since 3.0.0 - * - * @param int $stackPtr Stack pointer to the first PHP open tag in the file. - * @param string $file_name The name of the current file. - * - * @return void - */ - protected function check_filename_for_template_suffix( $stackPtr, $file_name ) { - $subpackage_tag = $this->phpcsFile->findNext( \T_DOC_COMMENT_TAG, $stackPtr, null, false, '@subpackage' ); - if ( false === $subpackage_tag ) { - return; - } - - $subpackage = $this->phpcsFile->findNext( \T_DOC_COMMENT_STRING, $subpackage_tag ); - if ( false === $subpackage ) { - return; - } - - $fileName_end = substr( $file_name, -13 ); - - if ( ( 'Template' === trim( $this->tokens[ $subpackage ]['content'] ) - && $this->tokens[ $subpackage_tag ]['line'] === $this->tokens[ $subpackage ]['line'] ) - && ( ( ! \defined( '\PHP_CODESNIFFER_IN_TESTS' ) && '-template.php' !== $fileName_end ) - || ( \defined( '\PHP_CODESNIFFER_IN_TESTS' ) && '-template.inc' !== $fileName_end ) ) - ) { - $this->phpcsFile->addError( - 'Files containing template tags should have "-template" appended to the end of the file name. Expected %s, but found %s.', - 0, - 'InvalidTemplateTagFileName', - array( - substr( $file_name, 0, -4 ) . '-template.php', - $file_name, - ) - ); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php deleted file mode 100644 index dd3aec69..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php +++ /dev/null @@ -1,1297 +0,0 @@ - Key is prefix, value irrelevant. - */ - protected $prefix_blocklist = array( - 'wordpress' => true, - 'wp' => true, - '_' => true, - 'php' => true, // See #1728, the 'php' prefix is reserved by PHP itself. - ); - - /** - * Target prefixes after validation. - * - * All prefixes are lowercased for case-insensitive compare. - * - * @since 0.12.0 - * - * @var array - */ - private $validated_prefixes = array(); - - /** - * Target namespace prefixes after validation with regex indicator. - * - * All prefixes are lowercased for case-insensitive compare. - * If the prefix doesn't already contain a namespace separator, but does contain - * non-word characters, these will have been replaced with regex syntax to allow - * for namespace separators and the `is_regex` indicator will have been set to `true`. - * - * @since 1.2.0 - * - * @var array> - */ - private $validated_namespace_prefixes = array(); - - /** - * Cache of previously set prefixes. - * - * Prevents having to do the same prefix validation over and over again. - * - * @since 0.12.0 - * - * @var string[] - */ - private $previous_prefixes = array(); - - /** - * A list of core hooks that are allowed to be called by plugins and themes. - * - * @since 0.14.0 - * @since 3.0.0 Renamed from `$whitelisted_core_hooks` to `$allowed_core_hooks`. - * - * @var array Key is hook name, value irrelevant. - */ - protected $allowed_core_hooks = array( - 'widget_title' => true, - 'add_meta_boxes' => true, - ); - - /** - * A list of core constants that are allowed to be defined by plugins and themes. - * - * Source: {@link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/default-constants.php#L0} - * The constants are listed in alphabetic order. - * Only overrulable constants are listed, i.e. those defined within core within - * a `if ( ! defined() ) {}` wrapper. - * - * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} - * - * @since 1.0.0 - * @since 3.0.0 Renamed from `$whitelisted_core_constants` to `$allowed_core_constants`. - * - * @var array Key is constant name, value irrelevant. - */ - protected $allowed_core_constants = array( - 'ADMIN_COOKIE_PATH' => true, - 'AUTH_COOKIE' => true, - 'AUTOSAVE_INTERVAL' => true, - 'COOKIEHASH' => true, - 'COOKIEPATH' => true, - 'COOKIE_DOMAIN' => true, - 'EMPTY_TRASH_DAYS' => true, - 'FORCE_SSL_ADMIN' => true, - 'FORCE_SSL_LOGIN' => true, // Deprecated. - 'LOGGED_IN_COOKIE' => true, - 'MEDIA_TRASH' => true, - 'MUPLUGINDIR' => true, // Deprecated. - 'PASS_COOKIE' => true, - 'PLUGINDIR' => true, // Deprecated. - 'PLUGINS_COOKIE_PATH' => true, - 'RECOVERY_MODE_COOKIE' => true, - 'SCRIPT_DEBUG' => true, - 'SECURE_AUTH_COOKIE' => true, - 'SHORTINIT' => true, - 'SITECOOKIEPATH' => true, - 'TEST_COOKIE' => true, - 'USER_COOKIE' => true, - 'WPMU_PLUGIN_DIR' => true, - 'WPMU_PLUGIN_URL' => true, - 'WP_CACHE' => true, - 'WP_CONTENT_DIR' => true, - 'WP_CONTENT_URL' => true, - 'WP_CRON_LOCK_TIMEOUT' => true, - 'WP_DEBUG' => true, - 'WP_DEBUG_DISPLAY' => true, - 'WP_DEBUG_LOG' => true, - 'WP_DEFAULT_THEME' => true, - 'WP_DEVELOPMENT_MODE' => true, - 'WP_MAX_MEMORY_LIMIT' => true, - 'WP_MEMORY_LIMIT' => true, - 'WP_PLUGIN_DIR' => true, - 'WP_PLUGIN_URL' => true, - 'WP_POST_REVISIONS' => true, - 'WP_START_TIMESTAMP' => true, - ); - - /** - * A list of functions declared in WP core as "Pluggable", i.e. overloadable from a plugin. - * - * Note: deprecated functions should still be included in this list as plugins may support older WP versions. - * - * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} - * - * @since 3.0.0. - * - * @var array Key is function name, value irrelevant. - */ - protected $pluggable_functions = array( - 'auth_redirect' => true, - 'cache_users' => true, - 'check_admin_referer' => true, - 'check_ajax_referer' => true, - 'get_avatar' => true, - 'get_currentuserinfo' => true, // Deprecated. - 'get_user_by' => true, - 'get_user_by_email' => true, // Deprecated. - 'get_userdata' => true, - 'get_userdatabylogin' => true, // Deprecated. - 'graceful_fail' => true, - 'install_global_terms' => true, - 'install_network' => true, - 'is_user_logged_in' => true, - // 'lowercase_octets' => true, => unclear if this function is meant to be publicly pluggable. - 'maybe_add_column' => true, - 'maybe_create_table' => true, - 'set_current_user' => true, // Deprecated. - 'twenty_twenty_one_entry_meta_footer' => true, - 'twenty_twenty_one_post_thumbnail' => true, - 'twenty_twenty_one_post_title' => true, - 'twenty_twenty_one_posted_by' => true, - 'twenty_twenty_one_posted_on' => true, - 'twenty_twenty_one_setup' => true, - 'twenty_twenty_one_the_posts_navigation' => true, - 'twentyeleven_admin_header_image' => true, - 'twentyeleven_admin_header_style' => true, - 'twentyeleven_comment' => true, - 'twentyeleven_content_nav' => true, - 'twentyeleven_continue_reading_link' => true, - 'twentyeleven_header_image' => true, - 'twentyeleven_header_style' => true, - 'twentyeleven_posted_on' => true, - 'twentyeleven_setup' => true, - 'twentyfifteen_comment_nav' => true, - 'twentyfifteen_entry_meta' => true, - 'twentyfifteen_excerpt_more' => true, - 'twentyfifteen_fonts_url' => true, - 'twentyfifteen_get_color_scheme' => true, - 'twentyfifteen_get_color_scheme_choices' => true, - 'twentyfifteen_get_link_url' => true, - 'twentyfifteen_header_style' => true, - 'twentyfifteen_post_thumbnail' => true, - 'twentyfifteen_sanitize_color_scheme' => true, - 'twentyfifteen_setup' => true, - 'twentyfifteen_the_custom_logo' => true, - 'twentyfourteen_admin_header_image' => true, - 'twentyfourteen_admin_header_style' => true, - 'twentyfourteen_excerpt_more' => true, - 'twentyfourteen_font_url' => true, - 'twentyfourteen_header_image' => true, - 'twentyfourteen_header_style' => true, - 'twentyfourteen_list_authors' => true, - 'twentyfourteen_paging_nav' => true, - 'twentyfourteen_post_nav' => true, - 'twentyfourteen_post_thumbnail' => true, - 'twentyfourteen_posted_on' => true, - 'twentyfourteen_setup' => true, - 'twentyfourteen_the_attached_image' => true, - 'twentynineteen_comment_count' => true, - 'twentynineteen_comment_form' => true, - 'twentynineteen_discussion_avatars_list' => true, - 'twentynineteen_entry_footer' => true, - 'twentynineteen_get_user_avatar_markup' => true, - 'twentynineteen_post_thumbnail' => true, - 'twentynineteen_posted_by' => true, - 'twentynineteen_posted_on' => true, - 'twentynineteen_setup' => true, - 'twentynineteen_the_posts_navigation' => true, - 'twentyseventeen_edit_link' => true, - 'twentyseventeen_entry_footer' => true, - 'twentyseventeen_fonts_url' => true, - 'twentyseventeen_header_style' => true, - 'twentyseventeen_posted_on' => true, - 'twentyseventeen_time_link' => true, - 'twentysixteen_categorized_blog' => true, - 'twentysixteen_entry_date' => true, - 'twentysixteen_entry_meta' => true, - 'twentysixteen_entry_taxonomies' => true, - 'twentysixteen_excerpt' => true, - 'twentysixteen_excerpt_more' => true, - 'twentysixteen_fonts_url' => true, - 'twentysixteen_get_color_scheme' => true, - 'twentysixteen_get_color_scheme_choices' => true, - 'twentysixteen_header_style' => true, - 'twentysixteen_post_thumbnail' => true, - 'twentysixteen_sanitize_color_scheme' => true, - 'twentysixteen_setup' => true, - 'twentysixteen_the_custom_logo' => true, - 'twentyten_admin_header_style' => true, - 'twentyten_comment' => true, - 'twentyten_continue_reading_link' => true, - 'twentyten_header_image' => true, - 'twentyten_posted_in' => true, - 'twentyten_posted_on' => true, - 'twentyten_setup' => true, - 'twentythirteen_entry_date' => true, - 'twentythirteen_entry_meta' => true, - 'twentythirteen_excerpt_more' => true, - 'twentythirteen_fonts_url' => true, - 'twentythirteen_paging_nav' => true, - 'twentythirteen_post_nav' => true, - 'twentythirteen_the_attached_image' => true, - 'twentytwelve_comment' => true, - 'twentytwelve_content_nav' => true, - 'twentytwelve_entry_meta' => true, - 'twentytwelve_get_font_url' => true, - 'twentytwenty_customize_partial_blogdescription' => true, - 'twentytwenty_customize_partial_blogname' => true, - 'twentytwenty_customize_partial_site_logo' => true, - 'twentytwenty_generate_css' => true, - 'twentytwenty_get_customizer_css' => true, - 'twentytwenty_get_theme_svg' => true, - 'twentytwenty_the_theme_svg' => true, - 'twentytwentyfour_block_styles' => true, - 'twentytwentyfour_block_stylesheets' => true, - 'twentytwentyfour_pattern_categories' => true, - 'twentytwentytwo_styles' => true, - 'twentytwentytwo_support' => true, - 'wp_authenticate' => true, - 'wp_cache_add_multiple' => true, - 'wp_cache_delete_multiple' => true, - 'wp_cache_flush_group' => true, - 'wp_cache_flush_runtime' => true, - 'wp_cache_get_multiple' => true, - 'wp_cache_set_multiple' => true, - 'wp_cache_supports' => true, - 'wp_check_password' => true, - 'wp_clear_auth_cookie' => true, - 'wp_clearcookie' => true, // Deprecated. - 'wp_create_nonce' => true, - 'wp_generate_auth_cookie' => true, - 'wp_generate_password' => true, - 'wp_get_cookie_login' => true, // Deprecated. - 'wp_get_current_user' => true, - // 'wp_handle_upload_error' => true, => unclear if this function is meant to be publicly pluggable. - 'wp_hash' => true, - 'wp_hash_password' => true, - 'wp_install' => true, - 'wp_install_defaults' => true, - 'wp_login' => true, // Deprecated. - 'wp_logout' => true, - 'wp_mail' => true, - 'wp_new_blog_notification' => true, - 'wp_new_user_notification' => true, - 'wp_nonce_tick' => true, - 'wp_notify_moderator' => true, - 'wp_notify_postauthor' => true, - 'wp_parse_auth_cookie' => true, - 'wp_password_change_notification' => true, - 'wp_rand' => true, - 'wp_redirect' => true, - 'wp_safe_redirect' => true, - 'wp_salt' => true, - 'wp_sanitize_redirect' => true, - 'wp_set_auth_cookie' => true, - 'wp_set_current_user' => true, - 'wp_set_password' => true, - 'wp_setcookie' => true, // Deprecated. - 'wp_text_diff' => true, - 'wp_upgrade' => true, - 'wp_validate_auth_cookie' => true, - 'wp_validate_redirect' => true, - 'wp_verify_nonce' => true, - ); - - /** - * A list of classes declared in WP core as "Pluggable", i.e. overloadable from a plugin. - * - * Source: {@link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/pluggable.php} - * and {@link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/pluggable-deprecated.php} - * - * Note: deprecated classes should still be included in this list as plugins may support older WP versions. - * - * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} - * - * @since 3.0.0. - * - * @var array Key is class name, value irrelevant. - */ - protected $pluggable_classes = array( - 'TwentyTwenty_Customize' => true, - 'TwentyTwenty_Non_Latin_Languages' => true, - 'TwentyTwenty_SVG_Icons' => true, - 'TwentyTwenty_Script_Loader' => true, - 'TwentyTwenty_Separator_Control' => true, - 'TwentyTwenty_Walker_Comment' => true, - 'TwentyTwenty_Walker_Page' => true, - 'Twenty_Twenty_One_Customize' => true, - 'WP_User_Search' => true, - 'wp_atom_server' => true, // Deprecated. - ); - - /** - * List of all PHP native functions. - * - * Using this list rather than a call to `function_exists()` prevents - * false negatives from user-defined functions when those would be - * autoloaded via a Composer autoload files directives. - * - * @var array - */ - private $built_in_functions; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 0.12.0 - * - * @return array - */ - public function register() { - // Get a list of all PHP native functions. - $all_functions = get_defined_functions(); - $this->built_in_functions = array_flip( $all_functions['internal'] ); - $this->built_in_functions = array_change_key_case( $this->built_in_functions, \CASE_LOWER ); - - // Make sure the pluggable functions and classes list can be easily compared. - $this->pluggable_functions = array_change_key_case( $this->pluggable_functions, \CASE_LOWER ); - $this->pluggable_classes = array_change_key_case( $this->pluggable_classes, \CASE_LOWER ); - - // Set the sniff targets. - $targets = array( - \T_NAMESPACE => \T_NAMESPACE, - \T_FUNCTION => \T_FUNCTION, - \T_CONST => \T_CONST, - \T_VARIABLE => \T_VARIABLE, - \T_DOLLAR => \T_DOLLAR, // Variable variables. - \T_FN_ARROW => \T_FN_ARROW, // T_FN_ARROW is only used for skipping over (for now). - ); - $targets += Tokens::$ooScopeTokens; // T_ANON_CLASS is only used for skipping over test classes. - $targets += Collections::listOpenTokensBC(); - - // Add function call target for hook names and constants defined using define(). - $parent = parent::register(); - if ( ! empty( $parent ) ) { - $targets[] = \T_STRING; - } - - return $targets; - } - - /** - * Groups of functions to restrict. - * - * @since 0.12.0 - * - * @return array - */ - public function getGroups() { - // Only retrieve functions which are not used for deprecated hooks. - $this->target_functions = WPHookHelper::get_functions( false ); - $this->target_functions['define'] = true; - - return parent::getGroups(); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 0.12.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - - // Allow overruling the prefixes set in a ruleset via the command line. - $cl_prefixes = Helper::getConfigData( 'prefixes' ); - if ( ! empty( $cl_prefixes ) ) { - $cl_prefixes = trim( $cl_prefixes ); - if ( '' !== $cl_prefixes ) { - $this->prefixes = array_filter( array_map( 'trim', explode( ',', $cl_prefixes ) ) ); - } - } - - $this->prefixes = RulesetPropertyHelper::merge_custom_array( $this->prefixes, array(), false ); - if ( empty( $this->prefixes ) ) { - // No prefixes passed, nothing to do. - return; - } - - $this->validate_prefixes(); - if ( empty( $this->validated_prefixes ) ) { - // No _valid_ prefixes passed, nothing to do. - return; - } - - // Ignore test classes. - if ( isset( Tokens::$ooScopeTokens[ $this->tokens[ $stackPtr ]['code'] ] ) - && true === $this->is_test_class( $this->phpcsFile, $stackPtr ) - ) { - if ( $this->tokens[ $stackPtr ]['scope_condition'] === $stackPtr && isset( $this->tokens[ $stackPtr ]['scope_closer'] ) ) { - // Skip forward to end of test class. - return $this->tokens[ $stackPtr ]['scope_closer']; - } - return; - } - - if ( \T_ANON_CLASS === $this->tokens[ $stackPtr ]['code'] ) { - // Token was only registered to allow skipping over test classes. - return; - } - - /* - * Ignore the contents of arrow functions which do not declare closures. - * - * - Parameters declared by arrow functions do not need to be prefixed (handled elsewhere). - * - New variables declared within an arrow function are local to the arrow function, so can be ignored. - * - A `global` statement is not allowed within an arrow function. - * - * Note: this does mean some convoluted code may get ignored (false negatives), but this is currently - * not reliably solvable as PHPCS does not add arrow functions to the 'conditions' array. - */ - if ( \T_FN_ARROW === $this->tokens[ $stackPtr ]['code'] - && isset( $this->tokens[ $stackPtr ]['scope_closer'] ) - ) { - $has_closure = $this->phpcsFile->findNext( \T_CLOSURE, ( $stackPtr + 1 ), $this->tokens[ $stackPtr ]['scope_closer'] ); - if ( false !== $has_closure ) { - // Skip to the start of the closure. - return $has_closure; - } - - // Skip the arrow function completely. - return $this->tokens[ $stackPtr ]['scope_closer']; - } - - if ( \T_STRING === $this->tokens[ $stackPtr ]['code'] ) { - // Disallow excluding function groups for this sniff. - $this->exclude = array(); - - return parent::process_token( $stackPtr ); - - } elseif ( \T_DOLLAR === $this->tokens[ $stackPtr ]['code'] ) { - - return $this->process_variable_variable( $stackPtr ); - - } elseif ( \T_VARIABLE === $this->tokens[ $stackPtr ]['code'] ) { - - return $this->process_variable_assignment( $stackPtr ); - - } elseif ( isset( Collections::listOpenTokensBC()[ $this->tokens[ $stackPtr ]['code'] ] ) ) { - return $this->process_list_assignment( $stackPtr ); - - } elseif ( \T_NAMESPACE === $this->tokens[ $stackPtr ]['code'] ) { - $namespace_name = Namespaces::getDeclaredName( $this->phpcsFile, $stackPtr ); - - if ( false === $namespace_name || '' === $namespace_name || '\\' === $namespace_name ) { - return; - } - - foreach ( $this->validated_namespace_prefixes as $key => $prefix_info ) { - if ( false === $prefix_info['is_regex'] ) { - if ( stripos( $namespace_name, $prefix_info['prefix'] ) === 0 ) { - $this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: allowed prefixes', $key ); - return; - } - } else { - // Ok, so this prefix should be used as a regex. - $regex = '`^' . $prefix_info['prefix'] . '`i'; - if ( preg_match( $regex, $namespace_name ) > 0 ) { - $this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: allowed prefixes', $key ); - return; - } - } - } - - // Still here ? In that case, we have a non-prefixed namespace name. - $recorded = $this->phpcsFile->addError( - self::ERROR_MSG, - $stackPtr, - 'NonPrefixedNamespaceFound', - array( - 'Namespaces declared', - $namespace_name, - ) - ); - - if ( true === $recorded ) { - $this->record_potential_prefix_metric( $stackPtr, $namespace_name ); - } - - return; - - } else { - - // Namespaced methods, classes and constants do not need to be prefixed. - $namespace = Namespaces::determineNamespace( $this->phpcsFile, $stackPtr ); - if ( '' !== $namespace && '\\' !== $namespace ) { - return; - } - - $item_name = ''; - $error_text = 'Unknown syntax used'; - $error_code = 'NonPrefixedSyntaxFound'; - - switch ( $this->tokens[ $stackPtr ]['code'] ) { - case \T_FUNCTION: - // Methods in a class do not need to be prefixed. - if ( Scopes::isOOMethod( $this->phpcsFile, $stackPtr ) === true ) { - return; - } - - if ( DeprecationHelper::is_function_deprecated( $this->phpcsFile, $stackPtr ) === true ) { - /* - * Deprecated functions don't have to comply with the naming conventions, - * otherwise functions deprecated in favour of a function with a compliant - * name would still trigger an error. - */ - return; - } - - $item_name = FunctionDeclarations::getName( $this->phpcsFile, $stackPtr ); - $item_lc = strtolower( $item_name ); - if ( isset( $this->built_in_functions[ $item_lc ] ) ) { - // Backfill for PHP native function. - return; - } - - if ( isset( $this->pluggable_functions[ $item_lc ] ) ) { - // Pluggable function should not be prefixed. - return; - } - - $error_text = 'Functions declared in the global namespace'; - $error_code = 'NonPrefixedFunctionFound'; - break; - - case \T_CLASS: - case \T_INTERFACE: - case \T_TRAIT: - case \T_ENUM: - $item_name = ObjectDeclarations::getName( $this->phpcsFile, $stackPtr ); - $error_text = 'Classes declared'; - $error_code = 'NonPrefixedClassFound'; - - switch ( $this->tokens[ $stackPtr ]['code'] ) { - case \T_CLASS: - if ( isset( $this->pluggable_classes[ strtolower( $item_name ) ] ) ) { - // Pluggable class should not be prefixed. - return; - } - - if ( class_exists( '\\' . $item_name, false ) ) { - // Backfill for PHP native class. - return; - } - break; - - case \T_INTERFACE: - if ( interface_exists( '\\' . $item_name, false ) ) { - // Backfill for PHP native interface. - return; - } - - $error_text = 'Interfaces declared'; - $error_code = 'NonPrefixedInterfaceFound'; - break; - - case \T_TRAIT: - // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.trait_existsFound - if ( function_exists( '\trait_exists' ) && trait_exists( '\\' . $item_name, false ) ) { - // Backfill for PHP native trait. - return; - } - - $error_text = 'Traits declared'; - $error_code = 'NonPrefixedTraitFound'; - break; - - case \T_ENUM: - // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.enum_existsFound - if ( function_exists( '\enum_exists' ) && enum_exists( '\\' . $item_name, false ) ) { - // Backfill for PHP native enum. - return; - } - - $error_text = 'Enums declared'; - $error_code = 'NonPrefixedEnumFound'; - break; - } - - break; - - case \T_CONST: - // Constants in an OO construct do not need to be prefixed. - if ( true === Scopes::isOOConstant( $this->phpcsFile, $stackPtr ) ) { - return; - } - - $constant_name_ptr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true, null, true ); - if ( false === $constant_name_ptr ) { - // Live coding. - return; - } - - $item_name = $this->tokens[ $constant_name_ptr ]['content']; - if ( \defined( '\\' . $item_name ) ) { - // Backfill for PHP native constant. - return; - } - - if ( isset( $this->allowed_core_constants[ $item_name ] ) ) { - // Defining a WP Core constant intended for overruling. - return; - } - - $error_text = 'Global constants defined'; - $error_code = 'NonPrefixedConstantFound'; - break; - - default: - // Left empty on purpose. - break; - - } - - if ( empty( $item_name ) || $this->is_prefixed( $stackPtr, $item_name ) === true ) { - return; - } - - $recorded = $this->phpcsFile->addError( - self::ERROR_MSG, - $stackPtr, - $error_code, - array( - $error_text, - $item_name, - ) - ); - - if ( true === $recorded ) { - $this->record_potential_prefix_metric( $stackPtr, $item_name ); - } - } - } - - /** - * Handle variable variables defined in the global namespace. - * - * @since 0.12.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - protected function process_variable_variable( $stackPtr ) { - static $indicators = array( - \T_OPEN_CURLY_BRACKET => true, - \T_VARIABLE => true, - ); - - // Is this a variable variable ? - // Not concerned with nested ones as those will be recognized on their own token. - $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true, null, true ); - if ( false === $next_non_empty || ! isset( $indicators[ $this->tokens[ $next_non_empty ]['code'] ] ) ) { - return; - } - - if ( \T_OPEN_CURLY_BRACKET === $this->tokens[ $next_non_empty ]['code'] - && isset( $this->tokens[ $next_non_empty ]['bracket_closer'] ) - ) { - // Skip over the variable part. - $next_non_empty = $this->tokens[ $next_non_empty ]['bracket_closer']; - } - - $maybe_assignment = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $next_non_empty + 1 ), null, true, null, true ); - - while ( false !== $maybe_assignment - && \T_OPEN_SQUARE_BRACKET === $this->tokens[ $maybe_assignment ]['code'] - && isset( $this->tokens[ $maybe_assignment ]['bracket_closer'] ) - ) { - $maybe_assignment = $this->phpcsFile->findNext( - Tokens::$emptyTokens, - ( $this->tokens[ $maybe_assignment ]['bracket_closer'] + 1 ), - null, - true, - null, - true - ); - } - - if ( false === $maybe_assignment ) { - return; - } - - if ( ! isset( Tokens::$assignmentTokens[ $this->tokens[ $maybe_assignment ]['code'] ] ) ) { - // Not an assignment. - return; - } - - $error = self::ERROR_MSG; - - /* - * Local variable variables in a function do not need to be prefixed. - * But a variable variable could evaluate to the name of an imported global - * variable. - * Not concerned with imported variable variables (global.. ) as that has been - * forbidden since PHP 7.0. Presuming cross-version code and if not, that - * is for the PHPCompatibility standard to detect. - */ - $functionPtr = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); - if ( false !== $functionPtr ) { - $has_global = $this->phpcsFile->findPrevious( \T_GLOBAL, ( $stackPtr - 1 ), $this->tokens[ $functionPtr ]['scope_opener'] ); - if ( false === $has_global ) { - // No variable import happening. - return; - } - - $error = 'Variable variable which could potentially override an imported global variable detected. ' . $error; - } - - $variable_name = $this->phpcsFile->getTokensAsString( $stackPtr, ( ( $next_non_empty - $stackPtr ) + 1 ) ); - - // Still here ? In that case, the variable name should be prefixed. - $recorded = $this->phpcsFile->addWarning( - $error, - $stackPtr, - 'NonPrefixedVariableFound', - array( - 'Global variables defined', - $variable_name, - ) - ); - - if ( true === $recorded ) { - $this->record_potential_prefix_metric( $stackPtr, $variable_name ); - } - - // Skip over the variable part of the variable. - return ( $next_non_empty + 1 ); - } - - /** - * Check that defined global variables are prefixed. - * - * @since 0.12.0 - * @since 2.2.0 Added $in_list parameter. - * - * @param int $stackPtr The position of the current token in the stack. - * @param bool $in_list Whether or not this is a variable in a list assignment. - * Defaults to false. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - protected function process_variable_assignment( $stackPtr, $in_list = false ) { - /* - * We're only concerned with variables which are being defined. - * `is_assigment()` will not recognize property assignments, which is good in this case. - * However it will also not recognize $b in `foreach( $a as $b )` as an assignment, so - * we need a separate check for that. - */ - if ( false === $in_list - && false === VariableHelper::is_assignment( $this->phpcsFile, $stackPtr ) - && Context::inForeachCondition( $this->phpcsFile, $stackPtr ) !== 'afterAs' - ) { - return; - } - - $is_error = true; - $variable_name = substr( $this->tokens[ $stackPtr ]['content'], 1 ); // Strip the dollar sign. - - // Bow out early if we know for certain no prefix is needed. - if ( 'GLOBALS' !== $variable_name - && $this->variable_prefixed_or_allowed( $stackPtr, $variable_name ) === true - ) { - return; - } - - if ( 'GLOBALS' === $variable_name ) { - $array_open = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true, null, true ); - if ( false === $array_open || \T_OPEN_SQUARE_BRACKET !== $this->tokens[ $array_open ]['code'] ) { - // Live coding or something very silly. - return; - } - - $array_key = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $array_open + 1 ), null, true, null, true ); - if ( false === $array_key ) { - // No key found, nothing to do. - return; - } - - $stackPtr = $array_key; - $variable_name = TextStrings::stripQuotes( $this->tokens[ $array_key ]['content'] ); - - // Check whether a prefix is needed. - if ( isset( Tokens::$stringTokens[ $this->tokens[ $array_key ]['code'] ] ) - && $this->variable_prefixed_or_allowed( $stackPtr, $variable_name ) === true - ) { - return; - } - - if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $array_key ]['code'] ) { - // If the array key is a double quoted string, try again with only - // the part before the first variable (if any). - $exploded = explode( '$', $variable_name ); - $first = rtrim( $exploded[0], '{' ); - if ( '' !== $first ) { - if ( $this->variable_prefixed_or_allowed( $array_key, $first ) === true ) { - return; - } - } else { - // If the first part was dynamic, throw a warning. - $is_error = false; - } - } elseif ( ! isset( Tokens::$stringTokens[ $this->tokens[ $array_key ]['code'] ] ) ) { - // Dynamic array key, throw a warning. - $is_error = false; - } - } else { - // Function parameters do not need to be prefixed. - if ( false === $in_list ) { - $functionPtr = Parentheses::getLastOwner( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); - if ( false !== $functionPtr ) { - return; - } - unset( $functionPtr ); - } - - // Properties in a class do not need to be prefixed. - if ( false === $in_list && true === Scopes::isOOProperty( $this->phpcsFile, $stackPtr ) ) { - return; - } - - // Local variables in a function do not need to be prefixed unless they are being imported. - $functionPtr = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); - if ( false !== $functionPtr ) { - $has_global = $this->phpcsFile->findPrevious( \T_GLOBAL, ( $stackPtr - 1 ), $this->tokens[ $functionPtr ]['scope_opener'] ); - if ( false === $has_global - || Conditions::getLastCondition( $this->phpcsFile, $has_global, Collections::functionDeclarationTokens() ) !== $functionPtr - ) { - // No variable import happening in the current scope. - return; - } - - // Ok, this may be an imported global variable. - $end_of_statement = $this->phpcsFile->findNext( array( \T_SEMICOLON, \T_CLOSE_TAG ), ( $has_global + 1 ) ); - if ( false === $end_of_statement ) { - // No semi-colon - live coding. - return; - } - - for ( $ptr = ( $has_global + 1 ); $ptr <= $end_of_statement; $ptr++ ) { - // Move the stack pointer to the next variable. - $ptr = $this->phpcsFile->findNext( \T_VARIABLE, $ptr, $end_of_statement, false, null, true ); - - if ( false === $ptr ) { - // Reached the end of the global statement without finding the variable, - // so this must be a local variable. - return; - } - - if ( substr( $this->tokens[ $ptr ]['content'], 1 ) === $variable_name ) { - break; - } - } - - unset( $has_global, $end_of_statement, $ptr ); - } - } - - // Still here ? In that case, the variable name should be prefixed. - $recorded = MessageHelper::addMessage( - $this->phpcsFile, - self::ERROR_MSG, - $stackPtr, - $is_error, - 'NonPrefixedVariableFound', - array( - 'Global variables defined', - '$' . $variable_name, - ) - ); - - if ( true === $recorded ) { - $this->record_potential_prefix_metric( $stackPtr, $variable_name ); - } - } - - /** - * Check that global variables declared via a list construct are prefixed. - * - * {@internal No need to take special measures for nested lists. Nested or not, - * each list part can only contain one variable being written to.} - * - * @since 2.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - protected function process_list_assignment( $stackPtr ) { - $list_open_close = Lists::getOpenClose( $this->phpcsFile, $stackPtr ); - if ( false === $list_open_close ) { - // Short array, not short list. - return; - } - - $var_pointers = ListHelper::get_list_variables( $this->phpcsFile, $stackPtr ); - foreach ( $var_pointers as $ptr ) { - $this->process_variable_assignment( $ptr, true ); - } - - // No need to re-examine these variables. - return $list_open_close['closer']; - } - - /** - * Process the parameters of a matched function. - * - * @since 0.12.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - if ( 'define' === $matched_content ) { - $target_param = PassedParameters::getParameterFromStack( $parameters, 1, 'constant_name' ); - - } else { - $target_param = WPHookHelper::get_hook_name_param( $matched_content, $parameters ); - } - - if ( false === $target_param ) { - return; - } - - $is_error = true; - $clean_content = TextStrings::stripQuotes( $target_param['clean'] ); - - if ( ( 'define' !== $matched_content - && isset( $this->allowed_core_hooks[ $clean_content ] ) ) - || ( 'define' === $matched_content - && isset( $this->allowed_core_constants[ $clean_content ] ) ) - ) { - return; - } - - if ( $this->is_prefixed( $target_param['start'], $clean_content ) === true ) { - return; - } else { - // This may be a dynamic hook/constant name. - $first_non_empty = $this->phpcsFile->findNext( - Tokens::$emptyTokens, - $target_param['start'], - ( $target_param['end'] + 1 ), - true - ); - - if ( false === $first_non_empty ) { - return; - } - - $first_non_empty_content = TextStrings::stripQuotes( $this->tokens[ $first_non_empty ]['content'] ); - - // Try again with just the first token if it's a text string. - if ( isset( Tokens::$stringTokens[ $this->tokens[ $first_non_empty ]['code'] ] ) - && $this->is_prefixed( $target_param['start'], $first_non_empty_content ) === true - ) { - return; - } - - if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $first_non_empty ]['code'] ) { - // If the first part of the parameter is a double quoted string, try again with only - // the part before the first variable (if any). - $exploded = explode( '$', $first_non_empty_content ); - $first = rtrim( $exploded[0], '{' ); - if ( '' !== $first ) { - if ( $this->is_prefixed( $target_param['start'], $first ) === true ) { - return; - } - } else { - // Start of hook/constant name is dynamic, throw a warning. - $is_error = false; - } - } elseif ( ! isset( Tokens::$stringTokens[ $this->tokens[ $first_non_empty ]['code'] ] ) ) { - // Dynamic hook/constant name, throw a warning. - $is_error = false; - } - } - - if ( 'define' === $matched_content ) { - if ( \defined( '\\' . $clean_content ) ) { - // Backfill for PHP native constant. - return; - } - - if ( strpos( $clean_content, '\\' ) !== false ) { - // Namespaced or unreachable constant. - return; - } - - $data = array( 'Global constants defined' ); - $error_code = 'NonPrefixedConstantFound'; - if ( false === $is_error ) { - $error_code = 'VariableConstantNameFound'; - } - } else { - $data = array( 'Hook names invoked' ); - $error_code = 'NonPrefixedHooknameFound'; - if ( false === $is_error ) { - $error_code = 'DynamicHooknameFound'; - } - } - - $data[] = $clean_content; - - $recorded = MessageHelper::addMessage( $this->phpcsFile, self::ERROR_MSG, $first_non_empty, $is_error, $error_code, $data ); - - if ( true === $recorded ) { - $this->record_potential_prefix_metric( $stackPtr, $clean_content ); - } - } - - /** - * Check if a function/class/constant/variable name is prefixed with one of the expected prefixes. - * - * @since 0.12.0 - * @since 0.14.0 Allows for other non-word characters as well as underscores to better support hook names. - * @since 1.0.0 Does not require a word seperator anymore after a prefix. - * This allows for improved code style independent checking, - * i.e. allows for camelCase naming and the likes. - * @since 1.0.1 - Added $stackPtr parameter. - * - The function now also records metrics about the prefixes encountered. - * - * @param int $stackPtr The position of the token to record the metric against. - * @param string $name Name to check for a prefix. - * - * @return bool True when the name is one of the prefixes or starts with an allowed prefix. - * False otherwise. - */ - private function is_prefixed( $stackPtr, $name ) { - foreach ( $this->validated_prefixes as $prefix ) { - if ( stripos( $name, $prefix ) === 0 ) { - $this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: allowed prefixes', $prefix ); - return true; - } - } - - return false; - } - - /** - * Check if a variable name might need a prefix. - * - * Prefix is not needed for: - * - superglobals, - * - WP native globals, - * - variables which are already prefixed. - * - * @since 0.12.0 - * @since 1.0.1 Added $stackPtr parameter. - * @since 3.0.0 Renamed from `variable_prefixed_or_whitelisted()` to `variable_prefixed_or_allowed()`. - * - * @param int $stackPtr The position of the token to record the metric against. - * @param string $name Variable name without the dollar sign. - * - * @return bool True if the variable name is allowed or already prefixed. - * False otherwise. - */ - private function variable_prefixed_or_allowed( $stackPtr, $name ) { - // Ignore superglobals and WP global variables. - if ( Variables::isSuperglobalName( $name ) || WPGlobalVariablesHelper::is_wp_global( $name ) ) { - return true; - } - - return $this->is_prefixed( $stackPtr, $name ); - } - - /** - * Validate an array of prefixes as passed through a custom property or via the command line. - * - * Checks that the prefix: - * - is not one of the blocked ones. - * - complies with the PHP rules for valid function, class, variable, constant names. - * - * @since 0.12.0 - * - * @return void - */ - private function validate_prefixes() { - if ( $this->previous_prefixes === $this->prefixes ) { - return; - } - - // Set the cache *before* validation so as to not break the above compare. - $this->previous_prefixes = $this->prefixes; - - // Validate the passed prefix(es). - $prefixes = array(); - $ns_prefixes = array(); - foreach ( $this->prefixes as $key => $prefix ) { - $prefixLC = strtolower( $prefix ); - - if ( isset( $this->prefix_blocklist[ $prefixLC ] ) ) { - $this->phpcsFile->addError( - 'The "%s" prefix is not allowed.', - 0, - 'ForbiddenPrefixPassed', - array( $prefix ) - ); - continue; - } - - $prefix_length = strlen( $prefix ); - if ( function_exists( 'iconv_strlen' ) ) { - $prefix_length = iconv_strlen( $prefix, Helper::getEncoding( $this->phpcsFile ) ); - } - - if ( $prefix_length < self::MIN_PREFIX_LENGTH ) { - $this->phpcsFile->addError( - 'The "%s" prefix is too short. Short prefixes are not unique enough and may cause name collisions with other code.', - 0, - 'ShortPrefixPassed', - array( $prefix ) - ); - continue; - } - - /* - * Validate the prefix against characters allowed for function, class, constant names etc. - * Note: this does not use the PHPCSUtils `NamingConventions::isValidIdentifierName()` method - * as we want to allow namespace separators in the prefixes. - */ - if ( preg_match( '`^[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff\\\\]*$`', $prefix ) !== 1 ) { - - $this->phpcsFile->addWarning( - 'The "%s" prefix is not a valid namespace/function/class/variable/constant prefix in PHP.', - 0, - 'InvalidPrefixPassed', - array( $prefix ) - ); - } - - // Lowercase the prefix to allow for direct compare. - $prefixes[ $key ] = $prefixLC; - - /* - * Replace non-word characters in the prefix with a regex snippet, but only if the - * string doesn't already contain namespace separators. - */ - $is_regex = false; - if ( strpos( $prefix, '\\' ) === false && preg_match( '`[_\W]`', $prefix ) > 0 ) { - $prefix = preg_replace( '`([_\W])`', '[\\\\\\\\$1]', $prefixLC ); - $is_regex = true; - } - - $ns_prefixes[ $prefixLC ] = array( - 'prefix' => $prefix, - 'is_regex' => $is_regex, - ); - } - - // Set the validated prefixes caches. - $this->validated_prefixes = $prefixes; - $this->validated_namespace_prefixes = $ns_prefixes; - } - - /** - * Record the "potential prefix" metric. - * - * @since 1.0.1 - * - * @param int $stackPtr The position of the token to record the metric against. - * @param string $construct_name Name of the global construct to try and distill a potential prefix from. - * - * @return void - */ - private function record_potential_prefix_metric( $stackPtr, $construct_name ) { - if ( preg_match( '`^([A-Z]*[a-z0-9]*+)`', ltrim( $construct_name, '\$_' ), $matches ) > 0 - && isset( $matches[1] ) && '' !== $matches[1] - ) { - $this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: potential prefixes - start of non-prefixed construct', strtolower( $matches[1] ) ); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php deleted file mode 100644 index a925de6f..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ /dev/null @@ -1,188 +0,0 @@ -phpcsFile, $stackPtr ) === true ) { - /* - * Deprecated functions don't have to comply with the naming conventions, - * otherwise functions deprecated in favour of a function with a compliant - * name would still trigger an error. - */ - return; - } - - $name = FunctionDeclarations::getName( $this->phpcsFile, $stackPtr ); - if ( empty( $name ) === true ) { - // Live coding or parse error. - return; - } - - if ( '' === ltrim( $name, '_' ) ) { - // Ignore special functions, like __(). - return; - } - - $ooPtr = Scopes::validDirectScope( $this->phpcsFile, $stackPtr, Tokens::$ooScopeTokens ); - if ( false === $ooPtr ) { - $this->process_function_declaration( $stackPtr, $name ); - } else { - $this->process_method_declaration( $stackPtr, $name, $ooPtr ); - } - } - - /** - * Processes a function declaration for a function in the global namespace. - * - * @since 0.1.0 - * @since 3.0.0 Renamed from `processTokenOutsideScope()` to `process_function_declaration()`. - * Method signature has been changed as well as this method no longer overloads - * a method from the PEAR sniff which was previously the sniff parent. - * - * @param int $stackPtr The position where this token was found. - * @param string $functionName The name of the function. - * - * @return void - */ - protected function process_function_declaration( $stackPtr, $functionName ) { - // PHP magic functions are exempt from our rules. - if ( FunctionDeclarations::isMagicFunctionName( $functionName ) === true ) { - return; - } - - // Is the function name prefixed with "__" ? - if ( preg_match( '`^__[^_]`', $functionName ) === 1 ) { - $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $errorData = array( $functionName ); - $this->phpcsFile->addError( $error, $stackPtr, 'FunctionDoubleUnderscore', $errorData ); - } - - $suggested_name = SnakeCaseHelper::get_suggestion( $functionName ); - if ( $suggested_name !== $functionName ) { - $error = 'Function name "%s" is not in snake case format, try "%s"'; - $errorData = array( - $functionName, - $suggested_name, - ); - $this->phpcsFile->addError( $error, $stackPtr, 'FunctionNameInvalid', $errorData ); - } - } - - /** - * Processes a method declaration. - * - * @since 0.1.0 - * @since 3.0.0 Renamed from `processTokenWithinScope()` to `process_method_declaration()`. - * Method signature has been changed as well, as this method no longer overloads - * a method from the PEAR sniff which was previously the sniff parent. - * - * @param int $stackPtr The position where this token was found. - * @param string $methodName The name of the method. - * @param int $currScope The position of the current scope. - * - * @return void - */ - protected function process_method_declaration( $stackPtr, $methodName, $currScope ) { - - if ( \T_ANON_CLASS === $this->tokens[ $currScope ]['code'] ) { - $className = '[Anonymous Class]'; - } else { - $className = ObjectDeclarations::getName( $this->phpcsFile, $currScope ); - - // PHP4 constructors are allowed to break our rules. - if ( NamingConventions::isEqual( $methodName, $className ) === true ) { - return; - } - - // PHP4 destructors are allowed to break our rules. - if ( NamingConventions::isEqual( $methodName, '_' . $className ) === true ) { - return; - } - } - - // PHP magic methods are exempt from our rules. - if ( FunctionDeclarations::isMagicMethodName( $methodName ) === true ) { - return; - } - - $extended = ObjectDeclarations::findExtendedClassName( $this->phpcsFile, $currScope ); - $interfaces = ObjectDeclarations::findImplementedInterfaceNames( $this->phpcsFile, $currScope ); - - // If this is a child class or interface implementation, it may have to use camelCase or double underscores. - if ( ! empty( $extended ) || ! empty( $interfaces ) ) { - return; - } - - // Is the method name prefixed with "__" ? - if ( preg_match( '`^__[^_]`', $methodName ) === 1 ) { - $error = 'Method name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore'; - $errorData = array( $className . '::' . $methodName ); - $this->phpcsFile->addError( $error, $stackPtr, 'MethodDoubleUnderscore', $errorData ); - } - - // Check for all lowercase. - $suggested_name = SnakeCaseHelper::get_suggestion( $methodName ); - if ( $suggested_name !== $methodName ) { - $error = 'Method name "%s" in class %s is not in snake case format, try "%s"'; - $errorData = array( - $methodName, - $className, - $suggested_name, - ); - $this->phpcsFile->addError( $error, $stackPtr, 'MethodNameInvalid', $errorData ); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php deleted file mode 100644 index 57ce7046..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php +++ /dev/null @@ -1,277 +0,0 @@ - - * - * - * - * - * - * Provide several extra delimiters as one string: - * - * - * - * - * - * - * @var string - */ - public $additionalWordDelimiters = ''; - - /** - * Regular expression to test for correct punctuation of a hook name. - * - * The placeholder will be replaced by potentially provided additional - * word delimiters in the `prepare_regex()` method. - * - * @var string - */ - protected $punctuation_regex = '`[^\w%s]`'; - - /** - * Groups of functions to restrict. - * - * @since 0.11.0 - * - * @return array - */ - public function getGroups() { - // Only retrieve functions which are not used for deprecated hooks. - $this->target_functions = WPHookHelper::get_functions( false ); - - return parent::getGroups(); - } - - /** - * Process the parameters of a matched function. - * - * @since 0.11.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - - $hook_name_param = WPHookHelper::get_hook_name_param( $matched_content, $parameters ); - if ( false === $hook_name_param ) { - return; - } - - $regex = $this->prepare_regex(); - - $case_errors = 0; - $underscores = 0; - $content = array(); - $expected = array(); - $last_non_empty = null; - - for ( $i = $hook_name_param['start']; $i <= $hook_name_param['end']; $i++ ) { - // Skip past comment tokens. - if ( isset( Tokens::$commentTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - $content[ $i ] = $this->tokens[ $i ]['content']; - $expected[ $i ] = $this->tokens[ $i ]['content']; - - // Skip past potential variable array access: `$var['key']`. - if ( \T_VARIABLE === $this->tokens[ $i ]['code'] ) { - do { - $open_bracket = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); - if ( false === $open_bracket - || \T_OPEN_SQUARE_BRACKET !== $this->tokens[ $open_bracket ]['code'] - || ! isset( $this->tokens[ $open_bracket ]['bracket_closer'] ) - ) { - $last_non_empty = $i; - continue 2; - } - - $i = $this->tokens[ $open_bracket ]['bracket_closer']; - - } while ( isset( $this->tokens[ $i ] ) && $i <= $hook_name_param['end'] ); - - $last_non_empty = $i; - continue; - } - - // Skip over parameters passed to function calls. - if ( \T_OPEN_PARENTHESIS === $this->tokens[ $i ]['code'] - && ( \T_STRING === $this->tokens[ $last_non_empty ]['code'] - || \T_VARIABLE === $this->tokens[ $last_non_empty ]['code'] ) - && isset( $this->tokens[ $i ]['parenthesis_closer'] ) - ) { - $i = $this->tokens[ $i ]['parenthesis_closer']; - $last_non_empty = $i; - continue; - } - - // Skip past non text string tokens. - if ( isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) === false ) { - $last_non_empty = $i; - continue; - } - - $last_non_empty = $i; - $string = TextStrings::stripQuotes( $this->tokens[ $i ]['content'] ); - - /* - * Here be dragons - a double quoted string can contain extrapolated variables - * which don't have to comply with these rules. - */ - if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $i ]['code'] ) { - $transform = $this->transform_complex_string( $string, $regex ); - $case_transform = $this->transform_complex_string( $string, $regex, 'case' ); - $punct_transform = $this->transform_complex_string( $string, $regex, 'punctuation' ); - } else { - $transform = $this->transform( $string, $regex ); - $case_transform = $this->transform( $string, $regex, 'case' ); - $punct_transform = $this->transform( $string, $regex, 'punctuation' ); - } - - if ( $string === $transform ) { - continue; - } - - if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $i ]['code'] ) { - $expected[ $i ] = '"' . $transform . '"'; - } else { - $expected[ $i ] = '\'' . $transform . '\''; - } - - if ( $string !== $case_transform ) { - ++$case_errors; - } - if ( $string !== $punct_transform ) { - ++$underscores; - } - } - - $first_non_empty = $this->phpcsFile->findNext( - Tokens::$emptyTokens, - $hook_name_param['start'], - ( $hook_name_param['end'] + 1 ), - true - ); - - $data = array( - trim( implode( '', $expected ) ), - trim( implode( '', $content ) ), - ); - - if ( $case_errors > 0 ) { - $error = 'Hook names should be lowercase. Expected: %s, but found: %s.'; - $this->phpcsFile->addError( $error, $first_non_empty, 'NotLowercase', $data ); - } - - if ( $underscores > 0 ) { - $error = 'Words in hook names should be separated using underscores. Expected: %s, but found: %s.'; - $this->phpcsFile->addWarning( $error, $first_non_empty, 'UseUnderscores', $data ); - } - } - - /** - * Prepare the punctuation regular expression. - * - * Merges the existing regular expression with potentially provided extra word delimiters to allow. - * This is done 'late' and for each found token as otherwise inline `phpcs:set` directives - * would be ignored. - * - * @return string - */ - protected function prepare_regex() { - $extra = ''; - if ( '' !== $this->additionalWordDelimiters && \is_string( $this->additionalWordDelimiters ) ) { - $extra = preg_quote( $this->additionalWordDelimiters, '`' ); - } - - return sprintf( $this->punctuation_regex, $extra ); - } - - /** - * Transform an arbitrary string to lowercase and replace punctuation and spaces with underscores. - * - * @param string $text_string The target string. - * @param string $regex The punctuation regular expression to use. - * @param string $transform_type Whether to do a partial or complete transform. - * Valid values are: 'full', 'case', 'punctuation'. - * @return string - */ - protected function transform( $text_string, $regex, $transform_type = 'full' ) { - - switch ( $transform_type ) { - case 'case': - return strtolower( $text_string ); - - case 'punctuation': - return preg_replace( $regex, '_', $text_string ); - - case 'full': - default: - return preg_replace( $regex, '_', strtolower( $text_string ) ); - } - } - - /** - * Transform a complex string which may contain variable extrapolation. - * - * @param string $text_string The target string. - * @param string $regex The punctuation regular expression to use. - * @param string $transform_type Whether to do a partial or complete transform. - * Valid values are: 'full', 'case', 'punctuation'. - * @return string - */ - protected function transform_complex_string( $text_string, $regex, $transform_type = 'full' ) { - $plain_text = TextStrings::stripEmbeds( $text_string ); - $embeds = TextStrings::getEmbeds( $text_string ); - - $transformed_text = $this->transform( $plain_text, $regex, $transform_type ); - - // Inject the embeds back into the text string. - foreach ( $embeds as $offset => $embed ) { - $transformed_text = substr_replace( $transformed_text, $embed, $offset, 0 ); - } - - return $transformed_text; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php deleted file mode 100644 index 9b3d3db4..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php +++ /dev/null @@ -1,230 +0,0 @@ - Key is function name, value irrelevant. - */ - protected $target_functions = array( - 'register_post_type' => true, - ); - - /** - * Array of reserved post type names which can not be used by themes and plugins. - * - * Source: {@link https://developer.wordpress.org/reference/functions/register_post_type/#reserved-post-types} - * - * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} - * - * @since 2.2.0 - * - * @var array Key is reserved post type name, value irrelevant. - */ - protected $reserved_names = array( - 'action' => true, // Not a WP post type, but prevents other problems. - 'attachment' => true, - 'author' => true, // Not a WP post type, but prevents other problems. - 'custom_css' => true, - 'customize_changeset' => true, - 'nav_menu_item' => true, - 'oembed_cache' => true, - 'order' => true, // Not a WP post type, but prevents other problems. - 'page' => true, - 'post' => true, - 'revision' => true, - 'theme' => true, // Not a WP post type, but prevents other problems. - 'user_request' => true, - 'wp_block' => true, - 'wp_font_face' => true, - 'wp_font_family' => true, - 'wp_global_styles' => true, - 'wp_navigation' => true, - 'wp_template' => true, - 'wp_template_part' => true, - ); - - /** - * All valid tokens for in the first parameter of register_post_type(). - * - * Set in `register()`. - * - * @since 2.2.0 - * - * @var array - */ - private $valid_tokens = array(); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 2.2.0 - * - * @return array - */ - public function register() { - $this->valid_tokens = Tokens::$textStringTokens + Tokens::$heredocTokens + Tokens::$emptyTokens; - return parent::register(); - } - - /** - * Process the parameter of a matched function. - * - * Errors on invalid post type names when reserved keywords are used, - * the post type is too long, or contains invalid characters. - * - * @since 2.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - $post_type_param = PassedParameters::getParameterFromStack( $parameters, 1, 'post_type' ); - if ( false === $post_type_param || '' === $post_type_param['clean'] ) { - // Error for using empty slug. - $this->phpcsFile->addError( - 'register_post_type() called without a post type slug. The slug must be a non-empty string.', - false === $post_type_param ? $stackPtr : $post_type_param['start'], - 'Empty' - ); - return; - } - - $string_start = $this->phpcsFile->findNext( Collections::textStringStartTokens(), $post_type_param['start'], ( $post_type_param['end'] + 1 ) ); - $string_pos = $this->phpcsFile->findNext( Tokens::$textStringTokens, $post_type_param['start'], ( $post_type_param['end'] + 1 ) ); - - $has_invalid_tokens = $this->phpcsFile->findNext( $this->valid_tokens, $post_type_param['start'], ( $post_type_param['end'] + 1 ), true ); - if ( false !== $has_invalid_tokens || false === $string_pos ) { - // Check for non string based slug parameter (we cannot determine if this is valid). - $this->phpcsFile->addWarning( - 'The post type slug is not a string literal. It is not possible to automatically determine the validity of this slug. Found: %s.', - $stackPtr, - 'NotStringLiteral', - array( - $post_type_param['clean'], - ), - 3 - ); - return; - } - - $post_type = TextStrings::getCompleteTextString( $this->phpcsFile, $string_start ); - if ( isset( Tokens::$heredocTokens[ $this->tokens[ $string_start ]['code'] ] ) ) { - // Trim off potential indentation from PHP 7.3 flexible heredoc/nowdoc content. - $post_type = ltrim( $post_type ); - } - - $data = array( - $post_type, - ); - - // Warn for dynamic parts in the slug parameter. - if ( 'T_DOUBLE_QUOTED_STRING' === $this->tokens[ $string_pos ]['type'] - || ( 'T_HEREDOC' === $this->tokens[ $string_pos ]['type'] - && strpos( $this->tokens[ $string_pos ]['content'], '$' ) !== false ) - ) { - $this->phpcsFile->addWarning( - 'The post type slug may, or may not, get too long with dynamic contents and could contain invalid characters. Found: "%s".', - $string_pos, - 'PartiallyDynamic', - $data - ); - $post_type = TextStrings::stripEmbeds( $post_type ); - } - - if ( preg_match( self::VALID_POST_TYPE_CHARACTERS, $post_type ) === 0 ) { - // Error for invalid characters. - $this->phpcsFile->addError( - 'register_post_type() called with invalid post type "%s". Post type contains invalid characters. Only lowercase alphanumeric characters, dashes, and underscores are allowed.', - $string_pos, - 'InvalidCharacters', - $data - ); - } - - if ( isset( $this->reserved_names[ $post_type ] ) ) { - // Error for using reserved slug names. - $this->phpcsFile->addError( - 'register_post_type() called with reserved post type "%s". Reserved post types should not be used as they interfere with the functioning of WordPress itself.', - $string_pos, - 'Reserved', - $data - ); - } elseif ( stripos( $post_type, 'wp_' ) === 0 ) { - // Error for using reserved slug prefix. - $this->phpcsFile->addError( - 'The post type passed to register_post_type() uses a prefix reserved for WordPress itself. Found: "%s".', - $string_pos, - 'ReservedPrefix', - $data - ); - } - - // Error for slugs that are too long. - if ( strlen( $post_type ) > self::POST_TYPE_MAX_LENGTH ) { - $this->phpcsFile->addError( - 'A post type slug must not exceed %d characters. Found: "%s" (%d characters).', - $string_pos, - 'TooLong', - array( - self::POST_TYPE_MAX_LENGTH, - $post_type, - strlen( $post_type ), - ) - ); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php deleted file mode 100644 index 6202f2b5..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php +++ /dev/null @@ -1,289 +0,0 @@ - true, - 'GETID3_ERRORARRAY' => true, - 'is_IE' => true, - 'is_IIS' => true, - 'is_macIE' => true, - 'is_NS4' => true, - 'is_winIE' => true, - 'PHP_SELF' => true, - 'post_ID' => true, - 'tag_ID' => true, - 'user_ID' => true, - ); - - /** - * List of member variables that can have mixed case. - * - * @since 0.9.0 - * @since 0.11.0 Changed from public to protected. - * @since 3.0.0 Renamed from `$whitelisted_mixed_case_member_var_names` to `$allowed_mixed_case_member_var_names`. - * - * @var array - */ - protected $allowed_mixed_case_member_var_names = array( - 'cat_ID' => true, - 'comment_ID' => true, - 'comment_author_IP' => true, - 'comment_post_ID' => true, - 'ID' => true, - 'post_ID' => true, - ); - - /** - * Custom list of properties which can have mixed case. - * - * @since 0.11.0 - * @since 3.0.0 Renamed from `$customPropertiesWhitelist` to `$allowed_custom_properties`. - * - * @var string[] - */ - public $allowed_custom_properties = array(); - - /** - * Cache of previously added custom functions. - * - * Prevents having to do the same merges over and over again. - * - * @since 0.10.0 - * @since 0.11.0 - Name changed from $addedCustomVariables. - * - Changed the format from simple bool to array. - * - * @var array - */ - protected $addedCustomProperties = array( - 'properties' => null, - ); - - /** - * Processes this test, when one of its tokens is encountered. - * - * @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 - */ - protected function processVariable( File $phpcsFile, $stackPtr ) { - $tokens = $phpcsFile->getTokens(); - - // If it's a php reserved var, then its ok. - if ( Variables::isPHPReservedVarName( $tokens[ $stackPtr ]['content'] ) ) { - return; - } - - // Merge any custom variables with the defaults. - $this->merge_allow_lists(); - - $var_name = ltrim( $tokens[ $stackPtr ]['content'], '$' ); - - // Likewise if it is a mixed-case var used by WordPress core. - if ( isset( $this->wordpress_mixed_case_vars[ $var_name ] ) ) { - return; - } - - $obj_operator = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( \T_OBJECT_OPERATOR === $tokens[ $obj_operator ]['code'] - || \T_NULLSAFE_OBJECT_OPERATOR === $tokens[ $obj_operator ]['code'] - ) { - // Check to see if we are using a variable from an object. - $var = $phpcsFile->findNext( Tokens::$emptyTokens, ( $obj_operator + 1 ), null, true ); - if ( \T_STRING === $tokens[ $var ]['code'] ) { - $bracket = $phpcsFile->findNext( Tokens::$emptyTokens, ( $var + 1 ), null, true ); - if ( \T_OPEN_PARENTHESIS !== $tokens[ $bracket ]['code'] ) { - $obj_var_name = $tokens[ $var ]['content']; - - if ( isset( $this->allowed_mixed_case_member_var_names[ $obj_var_name ] ) ) { - return; - } - - $suggested_name = SnakeCaseHelper::get_suggestion( $obj_var_name ); - if ( $suggested_name !== $obj_var_name ) { - $error = 'Object property "$%s" is not in valid snake_case format, try "$%s"'; - $data = array( - $obj_var_name, - $suggested_name, - ); - $phpcsFile->addError( $error, $var, 'UsedPropertyNotSnakeCase', $data ); - } - } - } - } - - $in_class = false; - if ( ContextHelper::has_object_operator_before( $phpcsFile, $stackPtr ) === true ) { - // The variable lives within a class, and is referenced like - // this: MyClass::$_variable or $class->variable. - $in_class = true; - } - - $suggested_name = SnakeCaseHelper::get_suggestion( $var_name ); - if ( $suggested_name !== $var_name ) { - if ( $in_class && ! isset( $this->allowed_mixed_case_member_var_names[ $var_name ] ) ) { - $error = 'Object property "$%s" is not in valid snake_case format, try "$%s"'; - $error_name = 'UsedPropertyNotSnakeCase'; - } elseif ( ! $in_class ) { - $error = 'Variable "$%s" is not in valid snake_case format, try "$%s"'; - $error_name = 'VariableNotSnakeCase'; - } - - if ( isset( $error, $error_name ) ) { - $data = array( - $var_name, - $suggested_name, - ); - $phpcsFile->addError( $error, $stackPtr, $error_name, $data ); - } - } - } - - /** - * Processes class member variables. - * - * @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 - */ - protected function processMemberVar( File $phpcsFile, $stackPtr ) { - // Make sure this is actually an OO property and not an OO method parameter or illegal property declaration. - if ( Scopes::isOOProperty( $phpcsFile, $stackPtr ) === false ) { - return; - } - - // Merge any custom variables with the defaults. - $this->merge_allow_lists(); - - $tokens = $phpcsFile->getTokens(); - $var_name = ltrim( $tokens[ $stackPtr ]['content'], '$' ); - - if ( isset( $this->allowed_mixed_case_member_var_names[ $var_name ] ) ) { - return; - } - - $suggested_name = SnakeCaseHelper::get_suggestion( $var_name ); - if ( $suggested_name !== $var_name ) { - $error = 'Member variable "$%s" is not in valid snake_case format, try "$%s"'; - $data = array( - $var_name, - $suggested_name, - ); - $phpcsFile->addError( $error, $stackPtr, 'PropertyNotSnakeCase', $data ); - } - } - - /** - * Processes the variables found within a double quoted string. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the double quoted - * string. - * - * @return void - */ - protected function processVariableInString( File $phpcsFile, $stackPtr ) { - $tokens = $phpcsFile->getTokens(); - - // There will always be embeds if the processVariableInString() was called. - $embeds = TextStrings::getEmbeds( $tokens[ $stackPtr ]['content'] ); - - // Merge any custom variables with the defaults. - $this->merge_allow_lists(); - - foreach ( $embeds as $embed ) { - // Grab any variables contained in the embed. - if ( preg_match_all( '`\$(\{)?(?[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)(?(1)\})`', $embed, $matches ) === 0 ) { - continue; - } - - foreach ( $matches['name'] as $var_name ) { - // If it's a php reserved var, then its ok. - if ( Variables::isPHPReservedVarName( $var_name ) ) { - continue; - } - - // Likewise if it is a mixed-case var used by WordPress core. - if ( isset( $this->wordpress_mixed_case_vars[ $var_name ] ) ) { - continue; - } - - $suggested_name = SnakeCaseHelper::get_suggestion( $var_name ); - if ( $suggested_name !== $var_name ) { - $error = 'Variable "$%s" is not in valid snake_case format, try "$%s"'; - $data = array( - $var_name, - $suggested_name, - ); - $phpcsFile->addError( $error, $stackPtr, 'InterpolatedVariableNotSnakeCase', $data ); - } - } - } - } - - /** - * Merge a custom allow list provided via a custom ruleset with the predefined allow list, - * if we haven't already. - * - * @since 0.10.0 - * @since 2.0.0 Removed unused $phpcs_file parameter. - * @since 3.0.0 Renamed from `mergeWhiteList()` to `merge_allow_lists()`. - * - * @return void - */ - protected function merge_allow_lists() { - if ( $this->allowed_custom_properties !== $this->addedCustomProperties['properties'] ) { - // Fix property potentially passed as comma-delimited string. - $customProperties = RulesetPropertyHelper::merge_custom_array( $this->allowed_custom_properties, array(), false ); - - $this->allowed_mixed_case_member_var_names = RulesetPropertyHelper::merge_custom_array( - $customProperties, - $this->allowed_mixed_case_member_var_names - ); - - $this->addedCustomProperties['properties'] = $this->allowed_custom_properties; - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php deleted file mode 100644 index af1c2ebf..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - 'error_log' => array( - 'type' => 'warning', - 'message' => '%s() found. Debug code should not normally be used in production.', - 'functions' => array( - 'error_log', - 'var_dump', - 'var_export', - 'print_r', - 'trigger_error', - 'set_error_handler', - 'debug_backtrace', - 'debug_print_backtrace', - 'wp_debug_backtrace_summary', - ), - ), - - 'prevent_path_disclosure' => array( - 'type' => 'warning', - 'message' => '%s() can lead to full path disclosure.', - 'functions' => array( - 'error_reporting', - 'phpinfo', - ), - ), - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php deleted file mode 100644 index 058fa0d3..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php +++ /dev/null @@ -1,100 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - 'serialize' => array( - 'type' => 'warning', - 'message' => '%s() found. Serialized data has known vulnerability problems with Object Injection. JSON is generally a better approach for serializing data. See https://www.owasp.org/index.php/PHP_Object_Injection', - 'functions' => array( - 'serialize', - 'unserialize', - ), - ), - - 'urlencode' => array( - 'type' => 'warning', - 'message' => '%s() should only be used when dealing with legacy applications rawurlencode() should now be used instead. See https://www.php.net/function.rawurlencode and http://www.faqs.org/rfcs/rfc3986.html', - 'functions' => array( - 'urlencode', - ), - ), - - 'runtime_configuration' => array( - 'type' => 'warning', - 'message' => '%s() found. Changing configuration values at runtime is strongly discouraged.', - 'functions' => array( - 'error_reporting', - 'ini_restore', - 'apache_setenv', - 'putenv', - 'set_include_path', - 'restore_include_path', - // This alias was DEPRECATED in PHP 5.3.0, and REMOVED as of PHP 7.0.0. - 'magic_quotes_runtime', - // Warning This function was DEPRECATED in PHP 5.3.0, and REMOVED as of PHP 7.0.0. - 'set_magic_quotes_runtime', - // Warning This function was removed from most SAPIs in PHP 5.3.0, and was removed from PHP-FPM in PHP 7.0.0. - 'dl', - ), - ), - - 'system_calls' => array( - 'type' => 'warning', - 'message' => '%s() found. PHP system calls are often disabled by server admins.', - 'functions' => array( - 'exec', - 'passthru', - 'proc_open', - 'shell_exec', - 'system', - 'popen', - ), - ), - - 'obfuscation' => array( - 'type' => 'warning', - 'message' => '%s() can be used to obfuscate code which is strongly discouraged. Please verify that the function is used for benign reasons.', - 'functions' => array( - 'base64_decode', - 'base64_encode', - 'convert_uudecode', - 'convert_uuencode', - 'str_rot13', - ), - ), - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php deleted file mode 100644 index 0d942527..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php +++ /dev/null @@ -1,52 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - - 'extract' => array( - 'type' => 'error', - 'message' => '%s() usage is highly discouraged, due to the complexity and unintended issues it might cause.', - 'functions' => array( - 'extract', - ), - ), - - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php deleted file mode 100644 index b393fbc1..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php +++ /dev/null @@ -1,193 +0,0 @@ - true, - 'ini_alter' => true, // Alias function name. - ); - - /** - * Array of PHP configuration options that are safe to be manipulated, as changing - * the value of these, won't cause interoperability issues between WP/plugins/themes. - * - * @since 2.1.0 - * @since 3.0.0 Renamed from `$whitelisted_options` to `$safe_options`. - * - * @var array Multidimensional array with parameter details. - * $safe_options = array( - * (string) option name. = array( - * (string[]) 'valid_values' = array() - * ) - * ); - */ - protected $safe_options = array( - 'auto_detect_line_endings' => array(), - 'highlight.bg' => array(), - 'highlight.comment' => array(), - 'highlight.default' => array(), - 'highlight.html' => array(), - 'highlight.keyword' => array(), - 'highlight.string' => array(), - 'short_open_tag' => array( - 'valid_values' => array( 'true', '1', 'on' ), - ), - ); - - /** - * Array of PHP configuration options that are not allowed to be manipulated, as changing - * the value of these, will be problematic for interoperability between WP/plugins/themes. - * - * @since 2.1.0 - * @since 3.0.0 Renamed from `$blacklisted_options` to `$disallowed_options`. - * - * @var array Multidimensional array with parameter details. - * $disallowed_options = array( - * (string) option name. = array( - * (string[]) 'invalid_values' = array() - * (string) 'message' - * ) - * ); - */ - protected $disallowed_options = array( - 'bcmath.scale' => array( - 'message' => 'Use `bcscale()` instead.', - ), - 'display_errors' => array( - 'message' => 'Use `WP_DEBUG_DISPLAY` instead.', - ), - 'error_reporting' => array( - 'message' => 'Use `WP_DEBUG` instead.', - ), - 'filter.default' => array( - 'message' => 'Changing the option value can break other plugins. Use the filter flag constants when calling the Filter functions instead.', - ), - 'filter.default_flags' => array( - 'message' => 'Changing the option value can break other plugins. Use the filter flag constants when calling the Filter functions instead.', - ), - 'iconv.input_encoding' => array( - 'message' => 'This option is not supported since PHP 5.6 - use `iconv_set_encoding()` instead.', - ), - 'iconv.internal_encoding' => array( - 'message' => 'This option is not supported since PHP 5.6 - use `iconv_set_encoding()` instead.', - ), - 'iconv.output_encoding' => array( - 'message' => 'This option is not supported since PHP 5.6 - use `iconv_set_encoding()` instead.', - ), - 'ignore_user_abort' => array( - 'message' => 'Use `ignore_user_abort()` instead.', - ), - 'log_errors' => array( - 'message' => 'Use `WP_DEBUG_LOG` instead.', - ), - 'max_execution_time' => array( - 'message' => 'Use `set_time_limit()` instead.', - ), - 'memory_limit' => array( - 'message' => 'Use `wp_raise_memory_limit()` or hook into the filters in that function.', - ), - 'short_open_tag' => array( - 'invalid_values' => array( 'false', '0', 'off' ), - 'message' => 'Turning off short_open_tag is prohibited as it can break other plugins.', - ), - ); - - /** - * Process the parameter of a matched function. - * - * Errors if an option is found in the disallow-list. Warns as - * 'risky' when the option is not found in the safe-list. - * - * @since 2.1.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - $option_param = PassedParameters::getParameterFromStack( $parameters, 1, 'option' ); - $value_param = PassedParameters::getParameterFromStack( $parameters, 2, 'value' ); - - if ( false === $option_param || false === $value_param ) { - // Missing required param. Not the concern of this sniff. Bow out. - return; - } - - $option_name = TextStrings::stripQuotes( $option_param['clean'] ); - $option_value = TextStrings::stripQuotes( $value_param['clean'] ); - if ( isset( $this->safe_options[ $option_name ] ) ) { - $safe_option = $this->safe_options[ $option_name ]; - if ( empty( $safe_option['valid_values'] ) || in_array( strtolower( $option_value ), $safe_option['valid_values'], true ) ) { - return; - } - } - - if ( isset( $this->disallowed_options[ $option_name ] ) ) { - $disallowed_option = $this->disallowed_options[ $option_name ]; - if ( empty( $disallowed_option['invalid_values'] ) - || in_array( strtolower( $option_value ), $disallowed_option['invalid_values'], true ) - ) { - $this->phpcsFile->addError( - 'Found: %s(%s, %s). %s', - $stackPtr, - MessageHelper::stringToErrorcode( $option_name . '_Disallowed' ), - array( - $matched_content, - $option_param['clean'], - $value_param['clean'], - $disallowed_option['message'], - ) - ); - return; - } - } - - $this->phpcsFile->addWarning( - 'Changing configuration values at runtime is strongly discouraged. Found: %s(%s, %s)', - $stackPtr, - 'Risky', - array( - $matched_content, - $option_param['clean'], - $value_param['clean'], - ) - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php deleted file mode 100644 index 4817f826..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php +++ /dev/null @@ -1,245 +0,0 @@ - Key is function name, value irrelevant. - */ - protected $allowedFunctionsList = array( - // Directory extension. - 'chdir' => true, - 'opendir' => true, - 'scandir' => true, - - // File extension. - 'file_exists' => true, - 'file_get_contents' => true, - 'file' => true, - 'fileatime' => true, - 'filectime' => true, - 'filegroup' => true, - 'fileinode' => true, - 'filemtime' => true, - 'fileowner' => true, - 'fileperms' => true, - 'filesize' => true, - 'filetype' => true, - 'fopen' => true, - 'is_dir' => true, - 'is_executable' => true, - 'is_file' => true, - 'is_link' => true, - 'is_readable' => true, - 'is_writable' => true, - 'is_writeable' => true, - 'lstat' => true, - 'mkdir' => true, - 'move_uploaded_file' => true, - 'readfile' => true, - 'readlink' => true, - 'rename' => true, - 'rmdir' => true, - 'stat' => true, - 'unlink' => true, - - // FTP extension. - 'ftp_chdir' => true, - 'ftp_login' => true, - 'ftp_rename' => true, - - // Stream extension. - 'stream_select' => true, - 'stream_set_chunk_size' => true, - - // Zlib extension. - 'deflate_add' => true, - 'deflate_init' => true, - 'inflate_add' => true, - 'inflate_init' => true, - 'readgzfile' => true, - - // LibXML extension. - 'libxml_disable_entity_loader' => true, // PHP 8.0 deprecation warning, but function call still needed in select cases. - - // Miscellaneous other functions. - 'imagecreatefromstring' => true, - 'imagecreatefromwebp' => true, - 'parse_url' => true, // Pre-PHP 5.3.3 an E_WARNING was thrown when URL parsing failed. - 'unserialize' => true, - ); - - /** - * Tokens which are regarded as empty for the purpose of determining - * the name of the called function. - * - * This property is set from within the register() method. - * - * @since 1.1.0 - * - * @var array - */ - private $empty_tokens = array(); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.1.0 - * - * @return array - */ - public function register() { - $this->empty_tokens = Tokens::$emptyTokens; - $this->empty_tokens[ \T_NS_SEPARATOR ] = \T_NS_SEPARATOR; - $this->empty_tokens[ \T_BITWISE_AND ] = \T_BITWISE_AND; - - return array( - \T_ASPERAND, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.1.0 - * - * @param int $stackPtr The position of the current token in the stack. - */ - public function process_token( $stackPtr ) { - // Handle the user-defined custom function list. - $this->customAllowedFunctionsList = RulesetPropertyHelper::merge_custom_array( $this->customAllowedFunctionsList, array(), false ); - $this->customAllowedFunctionsList = array_map( 'strtolower', $this->customAllowedFunctionsList ); - - /* - * Check if the error silencing is done for one of the allowed functions. - * - * @internal The function call name determination is done even when there is no allow list active - * to allow the metrics to be more informative. - */ - $next_non_empty = $this->phpcsFile->findNext( $this->empty_tokens, ( $stackPtr + 1 ), null, true, null, true ); - if ( false !== $next_non_empty && \T_STRING === $this->tokens[ $next_non_empty ]['code'] ) { - $has_parenthesis = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $next_non_empty + 1 ), null, true, null, true ); - if ( false !== $has_parenthesis && \T_OPEN_PARENTHESIS === $this->tokens[ $has_parenthesis ]['code'] ) { - $function_name = strtolower( $this->tokens[ $next_non_empty ]['content'] ); - if ( ( true === $this->usePHPFunctionsList - && isset( $this->allowedFunctionsList[ $function_name ] ) === true ) - || ( ! empty( $this->customAllowedFunctionsList ) - && in_array( $function_name, $this->customAllowedFunctionsList, true ) === true ) - ) { - $this->phpcsFile->recordMetric( $stackPtr, 'Error silencing', 'silencing allowed function call: ' . $function_name ); - return; - } - } - } - - $this->context_length = (int) $this->context_length; - $context_length = $this->context_length; - if ( $this->context_length <= 0 ) { - $context_length = 2; - } - - // Prepare the "Found" string to display. - $end_of_statement = BCFile::findEndOfStatement( $this->phpcsFile, $stackPtr, \T_COMMA ); - if ( ( $end_of_statement - $stackPtr ) < $context_length ) { - $context_length = ( $end_of_statement - $stackPtr ); - } - - $found = GetTokensAsString::compact( $this->phpcsFile, $stackPtr, ( $stackPtr + $context_length - 1 ), true ) . '...'; - $error_msg = 'Silencing errors is strongly discouraged. Use proper error checking instead.'; - $data = array(); - if ( $this->context_length > 0 ) { - $error_msg .= ' Found: %s'; - $data[] = $found; - } - - $this->phpcsFile->addWarning( - $error_msg, - $stackPtr, - 'Discouraged', - $data - ); - - if ( isset( $function_name ) ) { - $this->phpcsFile->recordMetric( $stackPtr, 'Error silencing', '@' . $function_name ); - } else { - $this->phpcsFile->recordMetric( $stackPtr, 'Error silencing', $found ); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php deleted file mode 100644 index 72f77ad5..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php +++ /dev/null @@ -1,73 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - 'ereg' => array( - 'type' => 'error', - 'message' => '%s() has been deprecated since PHP 5.3 and removed in PHP 7.0, please use preg_match() instead.', - 'functions' => array( - 'ereg', - 'eregi', - 'sql_regcase', - ), - ), - - 'ereg_replace' => array( - 'type' => 'error', - 'message' => '%s() has been deprecated since PHP 5.3 and removed in PHP 7.0, please use preg_replace() instead.', - 'functions' => array( - 'ereg_replace', - 'eregi_replace', - ), - ), - - 'split' => array( - 'type' => 'error', - 'message' => '%s() has been deprecated since PHP 5.3 and removed in PHP 7.0, please use explode(), str_split() or preg_split() instead.', - 'functions' => array( - 'split', - 'spliti', - ), - ), - - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php deleted file mode 100644 index 3a1ab1ea..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php +++ /dev/null @@ -1,70 +0,0 @@ - Key is function name, value irrelevant. - */ - protected $target_functions = array( - 'preg_quote' => true, - ); - - /** - * Process the parameters of a matched function. - * - * @since 1.0.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - - $delimiter = PassedParameters::getParameterFromStack( $parameters, 2, 'delimiter' ); - if ( false !== $delimiter ) { - return; - } - - $this->phpcsFile->addWarning( - 'Passing the $delimiter parameter to preg_quote() is strongly recommended.', - $stackPtr, - 'Missing' - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php deleted file mode 100644 index f3102e33..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php +++ /dev/null @@ -1,45 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - 'create_function' => array( - 'type' => 'error', - 'message' => '%s() is deprecated as of PHP 7.2 and removed in PHP 8.0. Please use declared named or anonymous functions instead.', - 'functions' => array( - 'create_function', - ), - ), - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php deleted file mode 100644 index dc7aa7aa..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php +++ /dev/null @@ -1,122 +0,0 @@ - Key is the function name. - */ - protected $target_functions = array( - 'in_array' => array( - 'param_position' => 3, - 'param_name' => 'strict', - 'always_needed' => true, - ), - 'array_search' => array( - 'param_position' => 3, - 'param_name' => 'strict', - 'always_needed' => true, - ), - 'array_keys' => array( - 'param_position' => 3, - 'param_name' => 'strict', - 'always_needed' => false, - ), - ); - - /** - * Process the parameters of a matched function. - * - * @since 0.11.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - $param_info = $this->target_functions[ $matched_content ]; - - /* - * Check if the strict check is actually needed. - * - * Important! This check only applies to array_keys() in the current form of the sniff - * and has been written to be specific to that function. - * If more functions would be added with 'always_needed' set to `false`, - * this code will need to be adjusted to handle those. - */ - if ( false === $param_info['always_needed'] ) { - $has_filter_value = PassedParameters::getParameterFromStack( $parameters, 2, 'filter_value' ); - if ( false === $has_filter_value ) { - return; - } - } - - $found_parameter = PassedParameters::getParameterFromStack( $parameters, $param_info['param_position'], $param_info['param_name'] ); - if ( false === $found_parameter || 'true' !== strtolower( $found_parameter['clean'] ) ) { - $errorcode = 'MissingTrueStrict'; - - /* - * Use a different error code when `false` is found to allow for excluding - * the warning as this will be a conscious choice made by the dev. - */ - if ( is_array( $found_parameter ) && 'false' === strtolower( $found_parameter['clean'] ) ) { - $errorcode = 'FoundNonStrictFalse'; - } - - $this->phpcsFile->addWarning( - 'Not using strict comparison for %s; supply true for $%s argument.', - ( isset( $found_parameter['start'] ) ? $found_parameter['start'] : $stackPtr ), - $errorcode, - array( $matched_content, $param_info['param_name'] ) - ); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php deleted file mode 100644 index 3e07c7fb..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php +++ /dev/null @@ -1,90 +0,0 @@ -tokens[ $stackPtr ]['code']; - $typecast = str_replace( ' ', '', $this->tokens[ $stackPtr ]['content'] ); - $typecast_lc = strtolower( $typecast ); - - switch ( $token_code ) { - case \T_DOUBLE_CAST: - if ( '(float)' !== $typecast_lc ) { - $fix = $this->phpcsFile->addFixableError( - 'Normalized type keywords must be used; expected "(float)" but found "%s"', - $stackPtr, - 'DoubleRealFound', - array( $typecast ) - ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->replaceToken( $stackPtr, '(float)' ); - } - } - break; - - case \T_UNSET_CAST: - $this->phpcsFile->addError( - 'Using the "(unset)" cast is forbidden as the type cast is removed in PHP 8.0. Use the "unset()" language construct instead.', - $stackPtr, - 'UnsetFound' - ); - break; - - case \T_BINARY_CAST: - $this->phpcsFile->addWarning( - 'Using binary casting is strongly discouraged. Found: "%s"', - $stackPtr, - 'BinaryFound', - array( $typecast ) - ); - break; - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php deleted file mode 100644 index 150993c6..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php +++ /dev/null @@ -1,124 +0,0 @@ -condition_start_tokens = $starters; - - return array( - \T_IS_EQUAL, - \T_IS_NOT_EQUAL, - \T_IS_IDENTICAL, - \T_IS_NOT_IDENTICAL, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function process_token( $stackPtr ) { - - $start = $this->phpcsFile->findPrevious( $this->condition_start_tokens, $stackPtr, null, false, null, true ); - - $needs_yoda = false; - - // Note: going backwards! - for ( $i = $stackPtr; $i > $start; $i-- ) { - - // Ignore whitespace. - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - // If this is a variable or array assignment, we've seen all we need to see. - if ( \T_VARIABLE === $this->tokens[ $i ]['code'] - || \T_CLOSE_SQUARE_BRACKET === $this->tokens[ $i ]['code'] - ) { - $needs_yoda = true; - break; - } - - // If this is a function call or something, we are OK. - if ( \T_CLOSE_PARENTHESIS === $this->tokens[ $i ]['code'] ) { - return; - } - } - - if ( ! $needs_yoda ) { - return; - } - - // Check if this is a var to var comparison, e.g.: if ( $var1 == $var2 ). - $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - - if ( isset( Tokens::$castTokens[ $this->tokens[ $next_non_empty ]['code'] ] ) ) { - $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $next_non_empty + 1 ), null, true ); - } - - if ( isset( Collections::ooHierarchyKeywords()[ $this->tokens[ $next_non_empty ]['code'] ] ) === true ) { - $next_non_empty = $this->phpcsFile->findNext( - ( Tokens::$emptyTokens + array( \T_DOUBLE_COLON => \T_DOUBLE_COLON ) ), - ( $next_non_empty + 1 ), - null, - true - ); - } - - if ( \T_VARIABLE === $this->tokens[ $next_non_empty ]['code'] ) { - return; - } - - $this->phpcsFile->addError( 'Use Yoda Condition checks, you must.', $stackPtr, 'NotYoda' ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php deleted file mode 100644 index 92c1b2ef..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php +++ /dev/null @@ -1,903 +0,0 @@ - - */ - protected $unsafePrintingFunctions = array( - '_e' => array( - 'alternative' => 'esc_html_e() or esc_attr_e()', - 'params' => array( - 1 => 'text', - ), - ), - '_ex' => array( - 'alternative' => 'echo esc_html_x() or echo esc_attr_x()', - 'params' => array( - 1 => 'text', - ), - ), - ); - - /** - * List of names of the native PHP constants which can be considered safe. - * - * @since 1.0.0 - * - * @var array - */ - private $safe_php_constants = array( - 'PHP_EOL' => true, // String. - 'PHP_VERSION' => true, // Integer. - 'PHP_MAJOR_VERSION' => true, // Integer. - 'PHP_MINOR_VERSION' => true, // Integer. - 'PHP_RELEASE_VERSION' => true, // Integer. - 'PHP_VERSION_ID' => true, // Integer. - 'PHP_EXTRA_VERSION' => true, // String. - 'PHP_DEBUG' => true, // Integer. - ); - - /** - * List of tokens which can be considered as safe when directly part of the output. - * - * This list is enhanced with additional tokens in the `register()` method. - * - * @since 0.12.0 - * - * @var array - */ - private $safe_components = array( - \T_LNUMBER => \T_LNUMBER, - \T_DNUMBER => \T_DNUMBER, - \T_TRUE => \T_TRUE, - \T_FALSE => \T_FALSE, - \T_NULL => \T_NULL, - \T_CONSTANT_ENCAPSED_STRING => \T_CONSTANT_ENCAPSED_STRING, - \T_START_NOWDOC => \T_START_NOWDOC, - \T_NOWDOC => \T_NOWDOC, - \T_END_NOWDOC => \T_END_NOWDOC, - \T_BOOLEAN_NOT => \T_BOOLEAN_NOT, - ); - - /** - * List of keyword tokens this sniff listens for, which can also be used as an inline expression. - * - * @since 3.0.0 - * - * @var array - */ - private $target_keywords = array( - \T_EXIT => \T_EXIT, - \T_PRINT => \T_PRINT, - \T_THROW => \T_THROW, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return string|int[] - */ - public function register() { - // Enrich the list of "safe components" tokens. - $this->safe_components += Tokens::$comparisonTokens; - $this->safe_components += Tokens::$operators; - $this->safe_components += Tokens::$booleanOperators; - $this->safe_components += Collections::incrementDecrementOperators(); - - // Set up the tokens the sniff should listen to. - $targets = array_merge( parent::register(), $this->target_keywords ); - $targets[] = \T_ECHO; - $targets[] = \T_OPEN_TAG_WITH_ECHO; - - return $targets; - } - - /** - * Groups of functions this sniff is looking for. - * - * @since 3.0.0 - * - * @return array - */ - public function getGroups() { - // Make sure all array keys are lowercase (could contain user-provided function names). - $printing_functions = array_change_key_case( $this->get_printing_functions(), \CASE_LOWER ); - - // Remove the unsafe printing functions to prevent duplicate notices. - $printing_functions = array_diff_key( $printing_functions, $this->unsafePrintingFunctions ); - - return array( - 'unsafe_printing_functions' => array( - 'functions' => array_keys( $this->unsafePrintingFunctions ), - ), - 'printing_functions' => array( - 'functions' => array_keys( $printing_functions ), - ), - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 3.0.0 This method has been split up. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - $start = ( $stackPtr + 1 ); - $end = $start; - - switch ( $this->tokens[ $stackPtr ]['code'] ) { - case \T_STRING: - // Prevent exclusion of any of the function groups. - $this->exclude = array(); - - // In the tests, custom printing functions may be added/removed on the fly. - if ( defined( 'PHP_CODESNIFFER_IN_TESTS' ) ) { - $this->setup_groups( 'functions' ); - } - - // Let the abstract parent class handle the initial function call check. - return parent::process_token( $stackPtr ); - - case \T_EXIT: - $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( false === $next_non_empty - || \T_OPEN_PARENTHESIS !== $this->tokens[ $next_non_empty ]['code'] - || isset( $this->tokens[ $next_non_empty ]['parenthesis_closer'] ) === false - ) { - // Live coding/parse error or an exit/die which doesn't pass a status code. Ignore. - return; - } - - // $end is not examined, so make sure the parentheses are balanced. - $start = $next_non_empty; - $end = ( $this->tokens[ $next_non_empty ]['parenthesis_closer'] + 1 ); - break; - - case \T_THROW: - // Find the open parentheses, while stepping over the exception creation tokens. - $ignore = Tokens::$emptyTokens; - $ignore += Collections::namespacedNameTokens(); - $ignore += Collections::functionCallTokens(); - $ignore += Collections::objectOperators(); - - $next_relevant = $this->phpcsFile->findNext( $ignore, ( $stackPtr + 1 ), null, true ); - if ( false === $next_relevant ) { - return; - } - - if ( \T_NEW === $this->tokens[ $next_relevant ]['code'] ) { - $next_relevant = $this->phpcsFile->findNext( $ignore, ( $next_relevant + 1 ), null, true ); - if ( false === $next_relevant ) { - return; - } - } - - if ( \T_OPEN_PARENTHESIS !== $this->tokens[ $next_relevant ]['code'] - || isset( $this->tokens[ $next_relevant ]['parenthesis_closer'] ) === false - ) { - // Live coding/parse error or a pre-created exception. Nothing to do for us. - return; - } - - $end = $this->tokens[ $next_relevant ]['parenthesis_closer']; - - // Check if the throw is within a `try-catch`. - // Doing this here (instead of earlier) to allow skipping to the end of the statement. - $search_for = Collections::closedScopes(); - $search_for[ \T_TRY ] = \T_TRY; - - $last_condition = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, $search_for ); - if ( false !== $last_condition && \T_TRY === $this->tokens[ $last_condition ]['code'] ) { - // This exception will (probably) be caught, so ignore it. - return $end; - } - - $call_token = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $next_relevant - 1 ), null, true ); - $params = PassedParameters::getParameters( $this->phpcsFile, $call_token ); - if ( empty( $params ) ) { - // No parameters passed, nothing to do. - return $end; - } - - // Examine each parameter individually. - foreach ( $params as $param ) { - $this->check_code_is_escaped( $param['start'], ( $param['end'] + 1 ), 'ExceptionNotEscaped' ); - } - - return $end; - - case \T_PRINT: - $end = BCFile::findEndOfStatement( $this->phpcsFile, $stackPtr ); - if ( \T_COMMA !== $this->tokens[ $end ]['code'] - && \T_SEMICOLON !== $this->tokens[ $end ]['code'] - && \T_COLON !== $this->tokens[ $end ]['code'] - && \T_DOUBLE_ARROW !== $this->tokens[ $end ]['code'] - && isset( $this->tokens[ ( $end + 1 ) ] ) - ) { - /* - * FindEndOfStatement includes a comma/(semi-)colon/double arrow if that's the end of - * the statement, but for everything else, it returns the last non-empty token _before_ - * the end, which would mean the last non-empty token in the statement would not - * be examined. Let's fix that. - */ - ++$end; - } - - // Note: no need to check for close tag as close tag will have the token before the tag as the $end. - if ( $end >= ( $this->phpcsFile->numTokens - 1 ) ) { - $last_non_empty = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, $end, null, true ); - if ( \T_SEMICOLON !== $this->tokens[ $last_non_empty ]['code'] ) { - // Live coding/parse error at end of file. Ignore. - return; - } - } - - // Special case for a print statement *within* a ternary, where we need to find the "inline else" as the end token. - $prev_non_empty = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $stackPtr - 1 ), null, true ); - if ( \T_INLINE_THEN === $this->tokens[ $prev_non_empty ]['code'] ) { - $target_nesting_level = 0; - if ( empty( $this->tokens[ $stackPtr ]['nested_parenthesis'] ) === false ) { - $target_nesting_level = \count( $this->tokens[ $stackPtr ]['nested_parenthesis'] ); - } - - $inline_else = false; - for ( $i = ( $stackPtr + 1 ); $i < $end; $i++ ) { - if ( \T_INLINE_ELSE !== $this->tokens[ $i ]['code'] ) { - continue; - } - - if ( empty( $this->tokens[ $i ]['nested_parenthesis'] ) - && 0 === $target_nesting_level - ) { - $inline_else = $i; - break; - } - - if ( empty( $this->tokens[ $i ]['nested_parenthesis'] ) === false - && \count( $this->tokens[ $i ]['nested_parenthesis'] ) === $target_nesting_level - ) { - $inline_else = $i; - break; - } - } - - if ( false === $inline_else ) { - // Live coding/parse error. Bow out. - return; - } - - $end = $inline_else; - } - - break; - - // Echo, open tag with echo. - default: - $end = $this->phpcsFile->findNext( array( \T_SEMICOLON, \T_CLOSE_TAG ), $stackPtr ); - if ( false === $end ) { - // Live coding/parse error. Bow out. - return; - } - - break; - } - - return $this->check_code_is_escaped( $start, $end ); - } - - /** - * Process a matched function call token. - * - * @since 3.0.0 Split off from the process_token() method. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_matched_token( $stackPtr, $group_name, $matched_content ) { - // Make sure we only deal with actual function calls, not function import use statements. - $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( false === $next_non_empty - || \T_OPEN_PARENTHESIS !== $this->tokens[ $next_non_empty ]['code'] - || isset( $this->tokens[ $next_non_empty ]['parenthesis_closer'] ) === false - ) { - // Live coding, parse error or not a function _call_. - return; - } - - $end = $this->tokens[ $next_non_empty ]['parenthesis_closer']; - - if ( 'unsafe_printing_functions' === $group_name ) { - $error = $this->phpcsFile->addError( - "All output should be run through an escaping function (like %s), found '%s'.", - $stackPtr, - 'UnsafePrintingFunction', - array( $this->unsafePrintingFunctions[ $matched_content ]['alternative'], $matched_content ) - ); - - // If the error was reported, don't bother checking the function's arguments. - if ( $error || empty( $this->unsafePrintingFunctions[ $matched_content ]['params'] ) ) { - return $end; - } - - // If the function was not reported for being unsafe, examine the relevant parameters. - $params = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); - foreach ( $this->unsafePrintingFunctions[ $matched_content ]['params'] as $position => $name ) { - $param = PassedParameters::getParameterFromStack( $params, $position, $name ); - if ( false === $param ) { - // Parameter doesn't exist. Nothing to do. - continue; - } - - $this->check_code_is_escaped( $param['start'], ( $param['end'] + 1 ) ); - } - - return $end; - } - - $params = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); - - /* - * These functions only need to have their first argument - `$message` - escaped. - * Note: user_error() is an alias for trigger_error(), so the param names are the same. - */ - if ( 'trigger_error' === $matched_content || 'user_error' === $matched_content ) { - $message_param = PassedParameters::getParameterFromStack( $params, 1, 'message' ); - if ( false === $message_param ) { - // Message parameter doesn't exist. Nothing to do. - return $end; - } - - return $this->check_code_is_escaped( $message_param['start'], ( $message_param['end'] + 1 ) ); - } - - /* - * If the first param to `_deprecated_file()` - `$file` - follows the typical `basename( __FILE__ )` - * pattern, it doesn't need to be escaped. - */ - if ( '_deprecated_file' === $matched_content ) { - $file_param = PassedParameters::getParameterFromStack( $params, 1, 'file' ); - - if ( false !== $file_param ) { - // Check for a particular code pattern which can safely be ignored. - if ( preg_match( '`^[\\\\]?basename\s*\(\s*__FILE__\s*\)$`', $file_param['clean'] ) === 1 ) { - unset( $params[1], $params['file'] ); // Remove the param, whether passed positionally or named. - } - } - unset( $file_param ); - } - - // Examine each parameter individually. - foreach ( $params as $param ) { - $this->check_code_is_escaped( $param['start'], ( $param['end'] + 1 ) ); - } - - return $end; - } - - /** - * Check whether each relevant part of an arbitrary group of token is output escaped. - * - * @since 3.0.0 Split off from the process_token() method. - * - * @param int $start The position to start checking from. - * @param int $end The position to stop the check at. - * @param string $code Code to use for the PHPCS error. - * - * @return int Integer stack pointer to skip forward. - */ - protected function check_code_is_escaped( $start, $end, $code = 'OutputNotEscaped' ) { - /* - * Check for a ternary operator. - * We only need to do this here if this statement is lacking parenthesis. - * Otherwise it will be handled in the below loop. - */ - $ternary = false; - $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $start + 1 ), null, true ); - $last_non_empty = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $end - 1 ), null, true ); - - if ( \T_OPEN_PARENTHESIS !== $this->tokens[ $next_non_empty ]['code'] - || \T_CLOSE_PARENTHESIS !== $this->tokens[ $last_non_empty ]['code'] - || ( \T_OPEN_PARENTHESIS === $this->tokens[ $next_non_empty ]['code'] - && \T_CLOSE_PARENTHESIS === $this->tokens[ $last_non_empty ]['code'] - && isset( $this->tokens[ $next_non_empty ]['parenthesis_closer'] ) - && $this->tokens[ $next_non_empty ]['parenthesis_closer'] !== $last_non_empty - ) - ) { - // If there is a (long) ternary, skip over the part before the ?. - $ternary = $this->find_long_ternary( $start, $end ); - if ( false !== $ternary ) { - $start = ( $ternary + 1 ); - } - } - - $in_cast = false; - $watch = true; - - // Looping through echo'd components. - for ( $i = $start; $i < $end; $i++ ) { - // Ignore whitespaces and comments. - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - // Skip over irrelevant tokens. - if ( isset( Tokens::$magicConstants[ $this->tokens[ $i ]['code'] ] ) // Magic constants for debug functions. - || \T_NS_SEPARATOR === $this->tokens[ $i ]['code'] - || \T_DOUBLE_ARROW === $this->tokens[ $i ]['code'] - || \T_CLOSE_PARENTHESIS === $this->tokens[ $i ]['code'] - ) { - continue; - } - - if ( \T_OPEN_PARENTHESIS === $this->tokens[ $i ]['code'] ) { - if ( ! isset( $this->tokens[ $i ]['parenthesis_closer'] ) ) { - // Live coding or parse error. - break; - } - - if ( $in_cast ) { - // Skip to the end of a function call if it has been cast to a safe value. - $i = $this->tokens[ $i ]['parenthesis_closer']; - $in_cast = false; - - } else { - // Skip over the condition part of a (long) ternary (i.e., to after the ?). - $ternary = $this->find_long_ternary( ( $i + 1 ), $this->tokens[ $i ]['parenthesis_closer'] ); - if ( false !== $ternary ) { - $i = $ternary; - } - } - - continue; - } - - /* - * If a keyword is encountered in an inline expression and the keyword is one - * this sniff listens to, recurse into the sniff, handle the expression - * based on the keyword and skip over the code examined. - */ - if ( isset( $this->target_keywords[ $this->tokens[ $i ]['code'] ] ) ) { - $return_value = $this->process_token( $i ); - if ( isset( $return_value ) ) { - $i = $return_value; - } - continue; - } - - // Handle PHP 8.0+ match expressions. - if ( \T_MATCH === $this->tokens[ $i ]['code'] ) { - $match_valid = $this->walk_match_expression( $i, $code ); - if ( false === $match_valid ) { - // Live coding or parse error. Shouldn't be possible as PHP[CS] will tokenize the keyword as `T_STRING` in that case. - break; // @codeCoverageIgnore - } - - $i = $match_valid; - continue; - } - - // Examine the items in an array individually for array parameters. - if ( isset( Collections::arrayOpenTokensBC()[ $this->tokens[ $i ]['code'] ] ) ) { - $array_open_close = Arrays::getOpenClose( $this->phpcsFile, $i ); - if ( false === $array_open_close ) { - // Short list or misidentified short array token. - continue; - } - - $array_items = PassedParameters::getParameters( $this->phpcsFile, $i, 0, true ); - if ( ! empty( $array_items ) ) { - foreach ( $array_items as $array_item ) { - $this->check_code_is_escaped( $array_item['start'], ( $array_item['end'] + 1 ), $code ); - } - } - - $i = $array_open_close['closer']; - continue; - } - - // Ignore safe PHP native constants. - if ( \T_STRING === $this->tokens[ $i ]['code'] - && isset( $this->safe_php_constants[ $this->tokens[ $i ]['content'] ] ) - && ConstantsHelper::is_use_of_global_constant( $this->phpcsFile, $i ) - ) { - continue; - } - - // Wake up on concatenation characters, another part to check. - if ( \T_STRING_CONCAT === $this->tokens[ $i ]['code'] ) { - $watch = true; - continue; - } - - // Wake up after a ternary else (:). - if ( false !== $ternary && \T_INLINE_ELSE === $this->tokens[ $i ]['code'] ) { - $watch = true; - continue; - } - - // Wake up for commas. - if ( \T_COMMA === $this->tokens[ $i ]['code'] ) { - $in_cast = false; - $watch = true; - continue; - } - - if ( false === $watch ) { - continue; - } - - // Allow T_CONSTANT_ENCAPSED_STRING eg: echo 'Some String'; - // Also T_LNUMBER, e.g.: echo 45; exit -1; and booleans. - if ( isset( $this->safe_components[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - // Check for use of *::class. - if ( \T_STRING === $this->tokens[ $i ]['code'] - || \T_VARIABLE === $this->tokens[ $i ]['code'] - || isset( Collections::ooHierarchyKeywords()[ $this->tokens[ $i ]['code'] ] ) - ) { - $double_colon = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), $end, true ); - if ( false !== $double_colon - && \T_DOUBLE_COLON === $this->tokens[ $double_colon ]['code'] - ) { - $class_keyword = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $double_colon + 1 ), $end, true ); - if ( false !== $class_keyword - && \T_STRING === $this->tokens[ $class_keyword ]['code'] - && 'class' === strtolower( $this->tokens[ $class_keyword ]['content'] ) - ) { - $i = $class_keyword; - continue; - } - } - } - - $watch = false; - - // Allow int/double/bool casted variables. - if ( isset( ContextHelper::get_safe_cast_tokens()[ $this->tokens[ $i ]['code'] ] ) ) { - /* - * If the next thing is a match expression, skip over it as whatever is - * being returned will be safely cast. - * Do not set `$in_cast` to `true`. - */ - $next_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), $end, true ); - if ( false !== $next_non_empty - && \T_MATCH === $this->tokens[ $next_non_empty ]['code'] - && isset( $this->tokens[ $next_non_empty ]['scope_closer'] ) - ) { - $i = $this->tokens[ $next_non_empty ]['scope_closer']; - continue; - } - - $in_cast = true; - continue; - } - - // Handle heredocs separately as they only need escaping when interpolation is used. - if ( \T_START_HEREDOC === $this->tokens[ $i ]['code'] ) { - $current = ( $i + 1 ); - while ( isset( $this->tokens[ $current ] ) && \T_HEREDOC === $this->tokens[ $current ]['code'] ) { - $embeds = TextStrings::getEmbeds( $this->tokens[ $current ]['content'] ); - if ( ! empty( $embeds ) ) { - $this->phpcsFile->addError( - 'All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found interpolation in unescaped heredoc.', - $current, - 'HeredocOutputNotEscaped' - ); - } - ++$current; - } - - $i = $current; - continue; - } - - // Now check that the next token is a function call. - if ( \T_STRING === $this->tokens[ $i ]['code'] ) { - $ptr = $i; - $functionName = $this->tokens[ $i ]['content']; - $function_opener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $i + 1 ), null, true ); - $is_formatting_function = FormattingFunctionsHelper::is_formatting_function( $functionName ); - - if ( false !== $function_opener - && \T_OPEN_PARENTHESIS === $this->tokens[ $function_opener ]['code'] - ) { - if ( ArrayWalkingFunctionsHelper::is_array_walking_function( $functionName ) ) { - // Get the callback parameter. - $callback = ArrayWalkingFunctionsHelper::get_callback_parameter( $this->phpcsFile, $ptr ); - - if ( ! empty( $callback ) ) { - /* - * If this is a function callback (not a method callback array) and we're able - * to resolve the function name, do so. - */ - $mapped_function = $this->phpcsFile->findNext( - Tokens::$emptyTokens, - $callback['start'], - ( $callback['end'] + 1 ), - true - ); - - if ( false !== $mapped_function - && \T_CONSTANT_ENCAPSED_STRING === $this->tokens[ $mapped_function ]['code'] - ) { - $functionName = TextStrings::stripQuotes( $this->tokens[ $mapped_function ]['content'] ); - $ptr = $mapped_function; - } - } - } - - // If this is a formatting function, we examine the parameters individually. - if ( $is_formatting_function ) { - $formatting_params = PassedParameters::getParameters( $this->phpcsFile, $i ); - if ( ! empty( $formatting_params ) ) { - foreach ( $formatting_params as $format_param ) { - $this->check_code_is_escaped( $format_param['start'], ( $format_param['end'] + 1 ), $code ); - } - } - - $watch = true; - } - - // Skip pointer to after the function. - if ( isset( $this->tokens[ $function_opener ]['parenthesis_closer'] ) ) { - $i = $this->tokens[ $function_opener ]['parenthesis_closer']; - } else { - // Live coding or parse error. - break; - } - } - - // If this is a safe function, we don't flag it. - if ( $is_formatting_function - || $this->is_escaping_function( $functionName ) - || $this->is_auto_escaped_function( $functionName ) - ) { - // Special case get_search_query() which is unsafe if $escaped = false. - if ( 'get_search_query' === strtolower( $functionName ) ) { - $escaped_param = PassedParameters::getParameter( $this->phpcsFile, $ptr, 1, 'escaped' ); - if ( false !== $escaped_param && 'true' !== $escaped_param['clean'] ) { - $this->phpcsFile->addError( - 'Output from get_search_query() is unsafe due to $escaped parameter being set to "false".', - $ptr, - 'UnsafeSearchQuery' - ); - } - } - - continue; - } - - $content = $functionName; - - } else { - $content = $this->tokens[ $i ]['content']; - $ptr = $i; - } - - // Make the error message a little more informative for array access variables. - if ( \T_VARIABLE === $this->tokens[ $ptr ]['code'] ) { - $array_keys = VariableHelper::get_array_access_keys( $this->phpcsFile, $ptr ); - - if ( ! empty( $array_keys ) ) { - $content .= '[' . implode( '][', $array_keys ) . ']'; - } - } - - $this->phpcsFile->addError( - "All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '%s'.", - $ptr, - $code, - array( $content ) - ); - } - - return $end; - } - - /** - * Check whether there is a ternary token at the right nesting level in an arbitrary set of tokens. - * - * @since 3.0.0 Split off from the process_token() method. - * - * @param int $start The position to start checking from. - * @param int $end The position to stop the check at. - * - * @return int|false Stack pointer to the ternary or FALSE if no ternary was found or - * if this is a short ternary. - */ - private function find_long_ternary( $start, $end ) { - for ( $i = $start; $i < $end; $i++ ) { - // Ignore anything within square brackets. - if ( isset( $this->tokens[ $i ]['bracket_opener'], $this->tokens[ $i ]['bracket_closer'] ) - && $i === $this->tokens[ $i ]['bracket_opener'] - ) { - $i = $this->tokens[ $i ]['bracket_closer']; - continue; - } - - // Skip past nested arrays, function calls and arbitrary groupings. - if ( \T_OPEN_PARENTHESIS === $this->tokens[ $i ]['code'] - && isset( $this->tokens[ $i ]['parenthesis_closer'] ) - ) { - $i = $this->tokens[ $i ]['parenthesis_closer']; - continue; - } - - // Skip past closures, anonymous classes and anything else scope related. - if ( isset( $this->tokens[ $i ]['scope_condition'], $this->tokens[ $i ]['scope_closer'] ) - && $this->tokens[ $i ]['scope_condition'] === $i - ) { - $i = $this->tokens[ $i ]['scope_closer']; - continue; - } - - if ( \T_INLINE_THEN !== $this->tokens[ $i ]['code'] ) { - continue; - } - - /* - * Okay, we found a ternary and it should be at the correct nesting level. - * If this is a short ternary, it shouldn't be ignored though. - */ - if ( Operators::isShortTernary( $this->phpcsFile, $i ) === true ) { - return false; - } - - return $i; - } - - return false; - } - - /** - * Examine a match expression and only check for escaping in the "returned" parts of the match expression. - * - * {@internal PHPCSUtils will likely contain a utility for parsing match expressions in the future. - * Ref: https://github.com/PHPCSStandards/PHPCSUtils/issues/497} - * - * @since 3.0.0 - * - * @param int $stackPtr Pointer to a T_MATCH token. - * @param string $code Code to use for the PHPCS error. - * - * @return int|false Stack pointer to skip to or FALSE if the match expression contained a parse error. - */ - private function walk_match_expression( $stackPtr, $code ) { - if ( ! isset( $this->tokens[ $stackPtr ]['scope_opener'], $this->tokens[ $stackPtr ]['scope_closer'] ) ) { - // Parse error/live coding. Shouldn't be possible as PHP[CS] will tokenize the keyword as `T_STRING` in that case. - return false; // @codeCoverageIgnore - } - - $current = $this->tokens[ $stackPtr ]['scope_opener']; - $end = $this->tokens[ $stackPtr ]['scope_closer']; - do { - $current = $this->phpcsFile->findNext( \T_MATCH_ARROW, ( $current + 1 ), $end ); - if ( false === $current ) { - // We must have reached the last match item (or there is a parse error). - break; - } - - $item_start = ( $current + 1 ); - $item_end = false; - - // Find the first comma at the same level. - for ( $i = $item_start; $i <= $end; $i++ ) { - // Ignore anything within square brackets. - if ( isset( $this->tokens[ $i ]['bracket_opener'], $this->tokens[ $i ]['bracket_closer'] ) - && $i === $this->tokens[ $i ]['bracket_opener'] - ) { - $i = $this->tokens[ $i ]['bracket_closer']; - continue; - } - - // Skip past nested arrays, function calls and arbitrary groupings. - if ( \T_OPEN_PARENTHESIS === $this->tokens[ $i ]['code'] - && isset( $this->tokens[ $i ]['parenthesis_closer'] ) - ) { - $i = $this->tokens[ $i ]['parenthesis_closer']; - continue; - } - - // Skip past closures, anonymous classes and anything else scope related. - if ( isset( $this->tokens[ $i ]['scope_condition'], $this->tokens[ $i ]['scope_closer'] ) - && $this->tokens[ $i ]['scope_condition'] === $i - ) { - $i = $this->tokens[ $i ]['scope_closer']; - continue; - } - - if ( \T_COMMA !== $this->tokens[ $i ]['code'] - && $i !== $end - ) { - continue; - } - - $item_end = $i; - break; - } - - if ( false === $item_end ) { - // Parse error/live coding. Shouldn't be possible. - return false; // @codeCoverageIgnore - } - - // Now check that the value returned by this match "leaf" is correctly escaped. - $this->check_code_is_escaped( $item_start, $item_end, $code ); - - // Independently of whether or not the check was successful or ran into (parse error) problems, - // always skip to the identified end of the item. - $current = $item_end; - } while ( $current < $end ); - - return $end; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php deleted file mode 100644 index 02411473..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php +++ /dev/null @@ -1,422 +0,0 @@ - true, - '$_FILES' => true, - '$_GET' => false, - '$_REQUEST' => false, - ); - - /** - * Custom list of functions which verify nonces. - * - * @since 0.5.0 - * - * @var string[] - */ - public $customNonceVerificationFunctions = array(); - - /** - * List of the functions which verify nonces. - * - * @since 0.5.0 - * @since 0.11.0 Changed from public static to protected non-static. - * @since 3.0.0 - Moved from the generic `Sniff` class to this class. - * - Visibility changed from `protected` to `private. - * - * @var array - */ - private $nonceVerificationFunctions = array( - 'wp_verify_nonce' => true, - 'check_admin_referer' => true, - 'check_ajax_referer' => true, - ); - - /** - * Cache of previously added custom functions. - * - * Prevents having to do the same merges over and over again. - * - * @since 0.5.0 - * @since 0.11.0 - Changed from public static to protected non-static. - * - Changed the format from simple bool to array. - * @since 3.0.0 - Property rename from `$addedCustomFunctions` to `$addedCustomNonceFunctions`. - * - Visibility changed from `protected` to `private. - * - Format changed from a multi-dimensional array to a single-dimensional array. - * - * @var array - */ - private $addedCustomNonceFunctions = array(); - - /** - * Information on the all scopes that were checked to find a nonce verification in a particular file. - * - * The array will be in the following format: - * ``` - * array( - * 'file' => (string) The name of the file. - * 'cache' => (array) array( - * # => array( The key is the token pointer to the "start" position. - * 'end' => (int) The token pointer to the "end" position. - * 'nonce' => (int|bool) The token pointer where n nonce check - * was found, or false if none was found. - * ) - * ) - * ) - * ``` - * - * @since 3.0.0 - * - * @var array - */ - private $cached_results; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() { - $targets = array( \T_VARIABLE => \T_VARIABLE ); - $targets += Collections::listOpenTokensBC(); // We need to skip over lists. - - return $targets; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - // Skip over lists as whatever is in those will always be assignments. - if ( isset( Collections::listOpenTokensBC()[ $this->tokens[ $stackPtr ]['code'] ] ) ) { - $open_close = Lists::getOpenClose( $this->phpcsFile, $stackPtr ); - $skip_to = $stackPtr; - if ( false !== $open_close ) { - $skip_to = $open_close['closer']; - } - - return $skip_to; - } - - if ( ! isset( $this->superglobals[ $this->tokens[ $stackPtr ]['content'] ] ) ) { - return; - } - - if ( Scopes::isOOProperty( $this->phpcsFile, $stackPtr ) ) { - // Property with the same name as a superglobal. Not our target. - return; - } - - // Determine the cache keys for this item. - $cache_keys = array( - 'file' => $this->phpcsFile->getFilename(), - 'start' => 0, - 'end' => $stackPtr, - ); - - // If we're in a function, only look inside of it. - // This doesn't take arrow functions into account as those are "open". - $functionPtr = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, array( \T_FUNCTION, \T_CLOSURE ) ); - if ( false !== $functionPtr ) { - $cache_keys['start'] = $this->tokens[ $functionPtr ]['scope_opener']; - } - - $this->mergeFunctionLists(); - - $needs_nonce = $this->needs_nonce_check( $stackPtr, $cache_keys ); - if ( false === $needs_nonce ) { - return; - } - - if ( $this->has_nonce_check( $stackPtr, $cache_keys, ( 'after' === $needs_nonce ) ) ) { - return; - } - - // If we're still here, no nonce-verification function was found. - $error_code = 'Missing'; - if ( false === $this->superglobals[ $this->tokens[ $stackPtr ]['content'] ] ) { - $error_code = 'Recommended'; - } - - MessageHelper::addMessage( - $this->phpcsFile, - 'Processing form data without nonce verification.', - $stackPtr, - $this->superglobals[ $this->tokens[ $stackPtr ]['content'] ], - $error_code - ); - } - - /** - * Determine whether or not a nonce check is needed for the current superglobal. - * - * @since 3.0.0 - * - * @param int $stackPtr The position of the current token in the stack of tokens. - * @param array $cache_keys The keys for the applicable cache (to potentially set). - * - * @return string|false String "before" or "after" if a nonce check is needed. - * FALSE when no nonce check is needed. - */ - protected function needs_nonce_check( $stackPtr, array $cache_keys ) { - $in_nonce_check = ContextHelper::is_in_function_call( $this->phpcsFile, $stackPtr, $this->nonceVerificationFunctions ); - if ( false !== $in_nonce_check ) { - // This *is* the nonce check, so bow out, but do store to cache. - // @todo Change to use arg unpacking once PHP < 5.6 has been dropped. - $this->set_cache( $cache_keys['file'], $cache_keys['start'], $cache_keys['end'], $in_nonce_check ); - return false; - } - - if ( Context::inUnset( $this->phpcsFile, $stackPtr ) ) { - // Variable is only being unset, no nonce check needed. - return false; - } - - if ( VariableHelper::is_assignment( $this->phpcsFile, $stackPtr, false ) ) { - // Overwriting the value of a superglobal. - return false; - } - - $needs_nonce = 'before'; - if ( ContextHelper::is_in_isset_or_empty( $this->phpcsFile, $stackPtr ) - || ContextHelper::is_in_type_test( $this->phpcsFile, $stackPtr ) - || VariableHelper::is_comparison( $this->phpcsFile, $stackPtr ) - || VariableHelper::is_assignment( $this->phpcsFile, $stackPtr, true ) - || ContextHelper::is_in_array_comparison( $this->phpcsFile, $stackPtr ) - || ContextHelper::is_in_function_call( $this->phpcsFile, $stackPtr, UnslashingFunctionsHelper::get_functions() ) !== false - || $this->is_only_sanitized( $this->phpcsFile, $stackPtr ) - ) { - $needs_nonce = 'after'; - } - - return $needs_nonce; - } - - /** - * Check if this token has an associated nonce check. - * - * @since 0.5.0 - * @since 3.0.0 - Moved from the generic `Sniff` class to this class. - * - Visibility changed from `protected` to `private. - * - New `$cache_keys` parameter. - * - New `$allow_nonce_after` parameter. - * - * @param int $stackPtr The position of the current token in the stack of tokens. - * @param array $cache_keys The keys for the applicable cache. - * @param bool $allow_nonce_after Whether the nonce check _must_ be before the $stackPtr or - * is allowed _after_ the $stackPtr. - * - * @return bool - */ - private function has_nonce_check( $stackPtr, array $cache_keys, $allow_nonce_after = false ) { - $start = $cache_keys['start']; - $end = $cache_keys['end']; - - // We allow for certain actions, such as an isset() check to come before the nonce check. - // If this superglobal is inside such a check, look for the nonce after it as well, - // all the way to the end of the scope. - if ( true === $allow_nonce_after ) { - $end = ( 0 === $start ) ? $this->phpcsFile->numTokens : $this->tokens[ $start ]['scope_closer']; - } - - // Check against the cache. - $current_cache = $this->get_cache( $cache_keys['file'], $start ); - if ( false !== $current_cache['nonce'] ) { - // If we have already found a nonce check in this scope, we just - // need to check whether it comes before this token. It is OK if the - // check is after the token though, if this was only an isset() check. - return ( true === $allow_nonce_after || $current_cache['nonce'] < $stackPtr ); - } elseif ( $end <= $current_cache['end'] ) { - // If not, we can still go ahead and return false if we've already - // checked to the end of the search area. - return false; - } - - $search_start = $start; - if ( $current_cache['end'] > $start ) { - // We haven't checked this far yet, but we can still save work by - // skipping over the part we've already checked. - $search_start = $this->cached_results['cache'][ $start ]['end']; - } - - // Loop through the tokens looking for nonce verification functions. - for ( $i = $search_start; $i < $end; $i++ ) { - // Skip over nested closed scope constructs. - if ( isset( Collections::closedScopes()[ $this->tokens[ $i ]['code'] ] ) - || \T_FN === $this->tokens[ $i ]['code'] - ) { - if ( isset( $this->tokens[ $i ]['scope_closer'] ) ) { - $i = $this->tokens[ $i ]['scope_closer']; - } - continue; - } - - // If this isn't a function name, skip it. - if ( \T_STRING !== $this->tokens[ $i ]['code'] ) { - continue; - } - - // If this is one of the nonce verification functions, we can bail out. - if ( isset( $this->nonceVerificationFunctions[ $this->tokens[ $i ]['content'] ] ) ) { - /* - * Now, make sure it is a call to a global function. - */ - if ( ContextHelper::has_object_operator_before( $this->phpcsFile, $i ) === true ) { - continue; - } - - if ( ContextHelper::is_token_namespaced( $this->phpcsFile, $i ) === true ) { - continue; - } - - $this->set_cache( $cache_keys['file'], $start, $end, $i ); - return true; - } - } - - // We're still here, so no luck. - $this->set_cache( $cache_keys['file'], $start, $end, false ); - - return false; - } - - /** - * Helper function to retrieve results from the cache. - * - * @since 3.0.0 - * - * @param string $filename The name of the current file. - * @param int $start The stack pointer searches started from. - * - * @return array - */ - private function get_cache( $filename, $start ) { - if ( is_array( $this->cached_results ) - && $filename === $this->cached_results['file'] - && isset( $this->cached_results['cache'][ $start ] ) - ) { - return $this->cached_results['cache'][ $start ]; - } - - return array( - 'end' => 0, - 'nonce' => false, - ); - } - - /** - * Helper function to store results to the cache. - * - * @since 3.0.0 - * - * @param string $filename The name of the current file. - * @param int $start The stack pointer searches started from. - * @param int $end The stack pointer searched stopped at. - * @param int|bool $nonce Stack pointer to the nonce verification function call or false if none was found. - * - * @return void - */ - private function set_cache( $filename, $start, $end, $nonce ) { - if ( is_array( $this->cached_results ) === false - || $filename !== $this->cached_results['file'] - ) { - $this->cached_results = array( - 'file' => $filename, - 'cache' => array( - $start => array( - 'end' => $end, - 'nonce' => $nonce, - ), - ), - ); - return; - } - - // Okay, so we know the current cache is for the current file. Check if we've seen this start pointer before. - if ( isset( $this->cached_results['cache'][ $start ] ) === false ) { - $this->cached_results['cache'][ $start ] = array( - 'end' => $end, - 'nonce' => $nonce, - ); - return; - } - - // Update existing entry. - if ( $end > $this->cached_results['cache'][ $start ]['end'] ) { - $this->cached_results['cache'][ $start ]['end'] = $end; - } - - $this->cached_results['cache'][ $start ]['nonce'] = $nonce; - } - - /** - * Merge custom functions provided via a custom ruleset with the defaults, if we haven't already. - * - * @since 0.11.0 Split out from the `process()` method. - * - * @return void - */ - protected function mergeFunctionLists() { - if ( $this->customNonceVerificationFunctions !== $this->addedCustomNonceFunctions ) { - $this->nonceVerificationFunctions = RulesetPropertyHelper::merge_custom_array( - $this->customNonceVerificationFunctions, - $this->nonceVerificationFunctions - ); - - $this->addedCustomNonceFunctions = $this->customNonceVerificationFunctions; - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php deleted file mode 100644 index 64711da2..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php +++ /dev/null @@ -1,126 +0,0 @@ -> Key is the name of the functions being targetted. - * Value is an array with parameter positions as the - * keys and parameter names as the values - */ - protected $target_functions = array( - 'add_comments_page' => array( - 4 => 'menu_slug', - ), - 'add_dashboard_page' => array( - 4 => 'menu_slug', - ), - 'add_links_page' => array( - 4 => 'menu_slug', - ), - 'add_management_page' => array( - 4 => 'menu_slug', - ), - 'add_media_page' => array( - 4 => 'menu_slug', - ), - 'add_menu_page' => array( - 4 => 'menu_slug', - ), - 'add_object_page' => array( - 4 => 'menu_slug', - ), - 'add_options_page' => array( - 4 => 'menu_slug', - ), - 'add_pages_page' => array( - 4 => 'menu_slug', - ), - 'add_plugins_page' => array( - 4 => 'menu_slug', - ), - 'add_posts_page' => array( - 4 => 'menu_slug', - ), - 'add_submenu_page' => array( - 1 => 'parent_slug', - 5 => 'menu_slug', - ), - 'add_theme_page' => array( - 4 => 'menu_slug', - ), - 'add_users_page' => array( - 4 => 'menu_slug', - ), - 'add_utility_page' => array( - 4 => 'menu_slug', - ), - ); - - /** - * Process the parameters of a matched function. - * - * @since 0.11.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - foreach ( $this->target_functions[ $matched_content ] as $position => $param_name ) { - $found_param = PassedParameters::getParameterFromStack( $parameters, $position, $param_name ); - if ( false === $found_param ) { - continue; - } - - $file_constant = $this->phpcsFile->findNext( \T_FILE, $found_param['start'], ( $found_param['end'] + 1 ) ); - if ( false !== $file_constant ) { - $this->phpcsFile->addWarning( 'Using __FILE__ for menu slugs risks exposing filesystem structure.', $file_constant, 'Using__FILE__' ); - } - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php deleted file mode 100644 index 88a08313..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php +++ /dev/null @@ -1,45 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - 'wp_redirect' => array( - 'type' => 'warning', - 'message' => '%s() found. Using wp_safe_redirect(), along with the "allowed_redirect_hosts" filter if needed, can help avoid any chances of malicious redirects within code. It is also important to remember to call exit() after a redirect so that no other unwanted code is executed.', - 'functions' => array( - 'wp_redirect', - ), - ), - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php deleted file mode 100644 index 6f46261b..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php +++ /dev/null @@ -1,244 +0,0 @@ - - */ - private $slashed_superglobals = array( - '$_COOKIE' => true, - '$_GET' => true, - '$_POST' => true, - '$_REQUEST' => true, - '$_SERVER' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() { - return array( - \T_VARIABLE, - \T_DOUBLE_QUOTED_STRING, - \T_HEREDOC, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function process_token( $stackPtr ) { - - // Handling string interpolation. - if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $stackPtr ]['code'] - || \T_HEREDOC === $this->tokens[ $stackPtr ]['code'] - ) { - // Retrieve all embeds, but use only the initial variable name part. - $interpolated_variables = array_map( - static function ( $embed ) { - return preg_replace( '`^(\{?\$\{?\(?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)(.*)$`', '$2', $embed ); - }, - TextStrings::getEmbeds( $this->tokens[ $stackPtr ]['content'] ) - ); - - // Filter the embeds down to superglobals only. - $interpolated_superglobals = array_filter( - $interpolated_variables, - static function ( $var_name ) { - return ( 'GLOBALS' !== $var_name && Variables::isSuperglobalName( $var_name ) ); - } - ); - - foreach ( $interpolated_superglobals as $bad_variable ) { - $this->phpcsFile->addError( 'Detected usage of a non-sanitized, non-validated input variable %s: %s', $stackPtr, 'InputNotValidatedNotSanitized', array( $bad_variable, $this->tokens[ $stackPtr ]['content'] ) ); - } - - return; - } - - /* Handle variables */ - - // Check if this is a superglobal we want to examine. - if ( '$GLOBALS' === $this->tokens[ $stackPtr ]['content'] - || Variables::isSuperglobalName( $this->tokens[ $stackPtr ]['content'] ) === false - ) { - return; - } - - // If the variable is being unset, we don't care about it. - if ( Context::inUnset( $this->phpcsFile, $stackPtr ) ) { - return; - } - - // If we're overriding a superglobal with an assignment, no need to test. - if ( VariableHelper::is_assignment( $this->phpcsFile, $stackPtr ) ) { - return; - } - - // This superglobal is being validated. - if ( ContextHelper::is_in_isset_or_empty( $this->phpcsFile, $stackPtr ) ) { - return; - } - - $array_keys = VariableHelper::get_array_access_keys( $this->phpcsFile, $stackPtr ); - - if ( empty( $array_keys ) ) { - return; - } - - $error_data = array( $this->tokens[ $stackPtr ]['content'] . '[' . implode( '][', $array_keys ) . ']' ); - - /* - * Check for validation first. - */ - $validated = false; - - for ( $i = ( $stackPtr + 1 ); $i < $this->phpcsFile->numTokens; $i++ ) { - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - if ( \T_OPEN_SQUARE_BRACKET === $this->tokens[ $i ]['code'] - && isset( $this->tokens[ $i ]['bracket_closer'] ) - ) { - // Skip over array keys. - $i = $this->tokens[ $i ]['bracket_closer']; - continue; - } - - if ( \T_COALESCE === $this->tokens[ $i ]['code'] ) { - $validated = true; - } - - // Anything else means this is not a validation coalesce. - break; - } - - if ( false === $validated ) { - $validated = ValidationHelper::is_validated( $this->phpcsFile, $stackPtr, $array_keys, $this->check_validation_in_scope_only ); - } - - if ( false === $validated ) { - $this->phpcsFile->addError( - 'Detected usage of a possibly undefined superglobal array index: %s. Use isset() or empty() to check the index exists before using it', - $stackPtr, - 'InputNotValidated', - $error_data - ); - } - - // If this variable is being tested with one of the `is_..()` functions, sanitization isn't needed. - if ( ContextHelper::is_in_type_test( $this->phpcsFile, $stackPtr ) ) { - return; - } - - // If this is a comparison ('a' == $_POST['foo']), sanitization isn't needed. - if ( VariableHelper::is_comparison( $this->phpcsFile, $stackPtr, false ) ) { - return; - } - - // If this is a comparison using the array comparison functions, sanitization isn't needed. - if ( ContextHelper::is_in_array_comparison( $this->phpcsFile, $stackPtr ) ) { - return; - } - - // Now look for sanitizing functions. - if ( ! $this->is_sanitized( $this->phpcsFile, $stackPtr, array( $this, 'add_unslash_error' ) ) ) { - $this->phpcsFile->addError( - 'Detected usage of a non-sanitized input variable: %s', - $stackPtr, - 'InputNotSanitized', - $error_data - ); - } - } - - /** - * Add an error for missing use of unslashing. - * - * @since 0.5.0 - * @since 3.0.0 - Moved from the `Sniff` class to this class. - * - The `$phpcsFile` parameter was added. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The index of the token in the stack - * which is missing unslashing. - * - * @return void - */ - public function add_unslash_error( File $phpcsFile, $stackPtr ) { - $tokens = $phpcsFile->getTokens(); - $var_name = $tokens[ $stackPtr ]['content']; - - if ( isset( $this->slashed_superglobals[ $var_name ] ) === false ) { - // WP doesn't slash these, so they don't need unslashing. - return; - } - - // We know there will be array keys as that's checked in the process_token() method. - $array_keys = VariableHelper::get_array_access_keys( $phpcsFile, $stackPtr ); - $error_data = array( $var_name . '[' . implode( '][', $array_keys ) . ']' ); - - $phpcsFile->addError( - '%s not unslashed before sanitization. Use wp_unslash() or similar', - $stackPtr, - 'MissingUnslash', - $error_data - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php deleted file mode 100644 index d87f338d..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php +++ /dev/null @@ -1,862 +0,0 @@ -> Function name as key, array with target - * parameter and name as value. - */ - protected $target_functions = array( - 'load_textdomain' => array( - 'position' => 1, - 'name' => 'domain', - ), - 'load_plugin_textdomain' => array( - 'position' => 1, - 'name' => 'domain', - ), - 'load_muplugin_textdomain' => array( - 'position' => 1, - 'name' => 'domain', - ), - 'load_theme_textdomain' => array( - 'position' => 1, - 'name' => 'domain', - ), - 'load_child_theme_textdomain' => array( - 'position' => 1, - 'name' => 'domain', - ), - 'load_script_textdomain' => array( - 'position' => 2, - 'name' => 'domain', - ), - 'unload_textdomain' => array( - 'position' => 1, - 'name' => 'domain', - ), - - '__' => array( - 'position' => 2, - 'name' => 'domain', - ), - '_e' => array( - 'position' => 2, - 'name' => 'domain', - ), - '_x' => array( - 'position' => 3, - 'name' => 'domain', - ), - '_ex' => array( - 'position' => 3, - 'name' => 'domain', - ), - '_n' => array( - 'position' => 4, - 'name' => 'domain', - ), - '_nx' => array( - 'position' => 5, - 'name' => 'domain', - ), - '_n_noop' => array( - 'position' => 3, - 'name' => 'domain', - ), - '_nx_noop' => array( - 'position' => 4, - 'name' => 'domain', - ), - 'translate_nooped_plural' => array( - 'position' => 3, - 'name' => 'domain', - ), - - 'esc_html__' => array( - 'position' => 2, - 'name' => 'domain', - ), - 'esc_html_e' => array( - 'position' => 2, - 'name' => 'domain', - ), - 'esc_html_x' => array( - 'position' => 3, - 'name' => 'domain', - ), - 'esc_attr__' => array( - 'position' => 2, - 'name' => 'domain', - ), - 'esc_attr_e' => array( - 'position' => 2, - 'name' => 'domain', - ), - 'esc_attr_x' => array( - 'position' => 3, - 'name' => 'domain', - ), - - 'is_textdomain_loaded' => array( - 'position' => 1, - 'name' => 'domain', - ), - 'get_translations_for_domain' => array( - 'position' => 1, - 'name' => 'domain', - ), - - // Deprecated functions. - '_c' => array( - 'position' => 2, - 'name' => 'domain', - ), - '_nc' => array( - 'position' => 4, - 'name' => 'domain', - ), - '__ngettext' => array( - 'position' => 4, - 'name' => 'domain', - ), - '__ngettext_noop' => array( - 'position' => 3, - 'name' => 'domain', - ), - 'translate_with_context' => array( - 'position' => 2, - 'name' => 'domain', - ), - - // Shouldn't be used by plugins/themes. - 'translate' => array( - 'position' => 2, - 'name' => 'domain', - ), - 'translate_with_gettext_context' => array( - 'position' => 3, - 'name' => 'domain', - ), - - // WP private functions. Shouldn't be used by plugins/themes. - '_load_textdomain_just_in_time' => array( - 'position' => 1, - 'name' => 'domain', - ), - '_get_path_to_translation_from_lang_dir' => array( - 'position' => 1, - 'name' => 'domain', - ), - '_get_path_to_translation' => array( - 'position' => 1, - 'name' => 'domain', - ), - ); - - /** - * Whether a valid new text domain was found. - * - * @since 1.2.0 - * - * @var bool - */ - private $is_valid = false; - - /** - * The new text domain as validated. - * - * @since 1.2.0 - * - * @var string - */ - private $validated_textdomain = ''; - - /** - * Whether the plugin/theme header has been seen and fixed yet. - * - * @since 1.2.0 - * - * @var bool - */ - private $header_found = false; - - /** - * Possible headers for a theme. - * - * @link https://developer.wordpress.org/themes/basics/main-stylesheet-style-css/ - * - * @since 1.2.0 - * - * @var array Array key is the header name, the value indicated whether it is a - * required (true) or optional (false) header. - */ - private $theme_headers = array( - 'Theme Name' => true, - 'Theme URI' => false, - 'Author' => true, - 'Author URI' => false, - 'Description' => true, - 'Version' => true, - 'Requires at least' => true, - 'Tested up to' => true, - 'Requires PHP' => true, - 'License' => true, - 'License URI' => true, - 'Text Domain' => true, - 'Tags' => false, - 'Domain Path' => false, - ); - - /** - * Possible headers for a plugin. - * - * @link https://developer.wordpress.org/plugins/plugin-basics/header-requirements/ - * - * @since 1.2.0 - * - * @var array Array key is the header name, the value indicated whether it is a - * required (true) or optional (false) header. - */ - private $plugin_headers = array( - 'Plugin Name' => true, - 'Plugin URI' => false, - 'Description' => false, - 'Version' => false, - 'Requires at least' => false, - 'Requires PHP' => false, - 'Author' => false, - 'Author URI' => false, - 'License' => false, - 'License URI' => false, - 'Text Domain' => false, - 'Domain Path' => false, - 'Network' => false, - 'Update URI' => false, - ); - - /** - * Regex template to match theme/plugin headers. - * - * @since 1.2.0 - * - * @var string - */ - private $header_regex_template = '`^(?:\s*(?:(?:\*|//)\s*)?)?(%s)\s*:\s*([^\r\n]+)`'; - - /** - * Regex to match theme headers. - * - * Set from within the register() method. - * - * @since 1.2.0 - * - * @var string - */ - private $theme_header_regex; - - /** - * Regex to match plugin headers. - * - * Set from within the register() method. - * - * @since 1.2.0 - * - * @var string - */ - private $plugin_header_regex; - - /** - * The --tab-width CLI value that is being used. - * - * @since 1.2.0 - * - * @var int - */ - private $tab_width = null; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 1.2.0 - * - * @return array - */ - public function register() { - $headers = array_map( - 'preg_quote', - array_keys( $this->theme_headers ), - array_fill( 0, \count( $this->theme_headers ), '`' ) - ); - $this->theme_header_regex = sprintf( $this->header_regex_template, implode( '|', $headers ) ); - - $headers = array_map( - 'preg_quote', - array_keys( $this->plugin_headers ), - array_fill( 0, \count( $this->plugin_headers ), '`' ) - ); - $this->plugin_header_regex = sprintf( $this->header_regex_template, implode( '|', $headers ) ); - - $targets = parent::register(); - - $targets[] = \T_DOC_COMMENT_OPEN_TAG; - $targets[] = \T_COMMENT; - - return $targets; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - // Check if the old/new properties are correctly set. If not, bow out. - if ( ! is_string( $this->new_text_domain ) - || '' === $this->new_text_domain - ) { - return ( $this->phpcsFile->numTokens + 1 ); - } - - if ( isset( $this->old_text_domain ) ) { - $this->old_text_domain = RulesetPropertyHelper::merge_custom_array( $this->old_text_domain, array(), false ); - - if ( ! is_array( $this->old_text_domain ) - || array() === $this->old_text_domain - ) { - return ( $this->phpcsFile->numTokens + 1 ); - } - } - - // Only validate and throw warning about the text domain once. - if ( $this->new_text_domain !== $this->validated_textdomain ) { - $this->is_valid = false; - $this->validated_textdomain = $this->new_text_domain; - $this->header_found = false; - - if ( 'default' === $this->new_text_domain ) { - $this->phpcsFile->addWarning( - 'The "default" text domain is reserved for WordPress core use and should not be used by plugins or themes', - 0, - 'ReservedNewDomain', - array( $this->new_text_domain ) - ); - - return ( $this->phpcsFile->numTokens + 1 ); - } - - if ( preg_match( '`^[a-z0-9-]+$`', $this->new_text_domain ) !== 1 ) { - $this->phpcsFile->addWarning( - 'The text domain should be a simple lowercase text string with words separated by dashes. "%s" appears invalid', - 0, - 'InvalidNewDomain', - array( $this->new_text_domain ) - ); - - return ( $this->phpcsFile->numTokens + 1 ); - } - - // If the text domain passed both validations, it should be considered valid. - $this->is_valid = true; - - } elseif ( false === $this->is_valid ) { - return ( $this->phpcsFile->numTokens + 1 ); - } - - if ( isset( $this->tab_width ) === false ) { - $this->tab_width = Helper::getTabWidth( $this->phpcsFile ); - } - - if ( \T_DOC_COMMENT_OPEN_TAG === $this->tokens[ $stackPtr ]['code'] - || \T_COMMENT === $this->tokens[ $stackPtr ]['code'] - ) { - // Examine for plugin/theme file header. - return $this->process_comments( $stackPtr ); - - } elseif ( isset( $this->phpcsFile->tokenizerType ) === false || 'CSS' !== $this->phpcsFile->tokenizerType ) { - // Examine a T_STRING token in a PHP file as a function call. - return parent::process_token( $stackPtr ); - } - } - - - /** - * Process the parameters of a matched function. - * - * @since 1.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - $target_param_specs = $this->target_functions[ $matched_content ]; - $found_param = PassedParameters::getParameterFromStack( $parameters, $target_param_specs['position'], $target_param_specs['name'] ); - - if ( false === $found_param && 1 !== $target_param_specs['position'] ) { - $error_msg = 'Missing $domain arg'; - $error_code = 'MissingArgDomain'; - - $has_named_params = false; - foreach ( $parameters as $param ) { - if ( isset( $param['name'] ) ) { - $has_named_params = true; - break; - } - } - - if ( false === $has_named_params && isset( $parameters[ ( $target_param_specs['position'] - 1 ) ] ) ) { - $fix = $this->phpcsFile->addFixableError( $error_msg, $stackPtr, $error_code ); - - if ( true === $fix ) { - $start_previous = $parameters[ ( $target_param_specs['position'] - 1 ) ]['start']; - $end_previous = $parameters[ ( $target_param_specs['position'] - 1 ) ]['end']; - if ( \T_WHITESPACE === $this->tokens[ $start_previous ]['code'] - && $this->tokens[ $start_previous ]['content'] === $this->phpcsFile->eolChar - ) { - // Replicate the new line + indentation of the previous item. - $replacement = ','; - for ( $i = $start_previous; $i <= $end_previous; $i++ ) { - if ( \T_WHITESPACE !== $this->tokens[ $i ]['code'] ) { - break; - } - - if ( isset( $this->tokens[ $i ]['orig_content'] ) ) { - $replacement .= $this->tokens[ $i ]['orig_content']; - } else { - $replacement .= $this->tokens[ $i ]['content']; - } - } - - $replacement .= "'{$this->new_text_domain}'"; - } else { - $replacement = ", '{$this->new_text_domain}'"; - } - - if ( \T_WHITESPACE === $this->tokens[ $end_previous ]['code'] ) { - $this->phpcsFile->fixer->addContentBefore( $end_previous, $replacement ); - } else { - $this->phpcsFile->fixer->addContent( $end_previous, $replacement ); - } - } - } elseif ( true === $has_named_params ) { - /* - * Function call using named arguments. For now, we will not auto-fix this. - * - * {@internal If we don't bother with indentation and such, this can be made - * auto-fixable by getting the 'end' of the last seen parameter and adding the - * domain parameter, with the 'domain: ' parameter label, after the last - * seen parameter.} - */ - $this->phpcsFile->addError( $error_msg, $stackPtr, $error_code ); - } else { - $error_msg .= ' and preceding argument(s)'; - $error_code = 'MissingArgs'; - - // Expected preceeding param also missing, just throw the warning. - $this->phpcsFile->addWarning( $error_msg, $stackPtr, $error_code ); - } - - return; - } - - // Target parameter found. Let's examine it. - $domain_param_start = $found_param['start']; - $domain_param_end = $found_param['end']; - $domain_token = null; - - for ( $i = $domain_param_start; $i <= $domain_param_end; $i++ ) { - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - if ( \T_CONSTANT_ENCAPSED_STRING !== $this->tokens[ $i ]['code'] ) { - // Unexpected token found, not our concern. This is handled by the I18n sniff. - return; - } - - if ( isset( $domain_token ) ) { - // More than one T_CONSTANT_ENCAPSED_STRING found, not our concern. This is handled by the I18n sniff. - return; - } - - $domain_token = $i; - } - - // If we're still here, this means only one T_CONSTANT_ENCAPSED_STRING was found. - $old_domain = TextStrings::stripQuotes( $this->tokens[ $domain_token ]['content'] ); - - if ( ! \in_array( $old_domain, $this->old_text_domain, true ) ) { - // Not a text domain targetted for replacement, ignore. - return; - } - - $fix = $this->phpcsFile->addFixableError( - 'Mismatched text domain. Expected \'%s\' but found \'%s\'', - $domain_token, - 'TextDomainMismatch', - array( $this->new_text_domain, $old_domain ) - ); - - if ( true === $fix ) { - $replacement = str_replace( $old_domain, $this->new_text_domain, $this->tokens[ $domain_token ]['content'] ); - $this->phpcsFile->fixer->replaceToken( $domain_token, $replacement ); - } - } - - /** - * Process the function if no parameters were found. - * - * @since 1.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * - * @return void - */ - public function process_no_parameters( $stackPtr, $group_name, $matched_content ) { - $target_param = $this->target_functions[ $matched_content ]; - - if ( 1 !== $target_param['position'] ) { - // Only process the no param case as fixable if the text domain is expected to be the first parameter. - $this->phpcsFile->addWarning( 'Missing $domain arg and preceding argument(s)', $stackPtr, 'MissingArgs' ); - return; - } - - $opener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( \T_OPEN_PARENTHESIS !== $this->tokens[ $opener ]['code'] - || isset( $this->tokens[ $opener ]['parenthesis_closer'] ) === false - ) { - // Parse error or live coding. - return; - } - - $fix = $this->phpcsFile->addFixableError( 'Missing $domain arg', $stackPtr, 'MissingArgDomain' ); - if ( true === $fix ) { - $closer = $this->tokens[ $opener ]['parenthesis_closer']; - $replacement = " '{$this->new_text_domain}' "; - - if ( $this->tokens[ $opener ]['line'] !== $this->tokens[ $closer ]['line'] ) { - $replacement = trim( $replacement ); - $addBefore = ( $closer - 1 ); - if ( \T_WHITESPACE === $this->tokens[ ( $closer - 1 ) ]['code'] - && $this->tokens[ $closer - 1 ]['line'] === $this->tokens[ $closer ]['line'] - ) { - if ( isset( $this->tokens[ ( $closer - 1 ) ]['orig_content'] ) ) { - $replacement = $this->tokens[ ( $closer - 1 ) ]['orig_content'] - . "\t" - . $replacement; - } else { - $replacement = $this->tokens[ ( $closer - 1 ) ]['content'] - . str_repeat( ' ', $this->tab_width ) - . $replacement; - } - - --$addBefore; - } else { - // We don't know whether the code uses tabs or spaces, so presume WPCS, i.e. tabs. - $replacement = "\t" . $replacement; - } - - $replacement = $this->phpcsFile->eolChar . $replacement; - - $this->phpcsFile->fixer->addContentBefore( $addBefore, $replacement ); - - } elseif ( \T_WHITESPACE === $this->tokens[ ( $closer - 1 ) ]['code'] ) { - $this->phpcsFile->fixer->replaceToken( ( $closer - 1 ), $replacement ); - } else { - $this->phpcsFile->fixer->addContentBefore( $closer, $replacement ); - } - } - } - - - /** - * Process comments to find the plugin/theme headers. - * - * @since 1.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_comments( $stackPtr ) { - if ( true === $this->header_found && ! defined( 'PHP_CODESNIFFER_IN_TESTS' ) ) { - return; - } - - $regex = $this->plugin_header_regex; - $headers = $this->plugin_headers; - $type = 'plugin'; - $skip_to = $stackPtr; - - $file = TextStrings::stripQuotes( $this->phpcsFile->getFileName() ); - if ( 'STDIN' === $file ) { - return; - } - - $file_name = basename( $file ); - if ( isset( $this->phpcsFile->tokenizerType ) && 'CSS' === $this->phpcsFile->tokenizerType ) { - if ( 'style.css' !== $file_name && ! defined( 'PHP_CODESNIFFER_IN_TESTS' ) ) { - // CSS files only need to be examined for the file header. - return ( $this->phpcsFile->numTokens + 1 ); - } - - $regex = $this->theme_header_regex; - $headers = $this->theme_headers; - $type = 'theme'; - } - - $comment_details = array( - 'required_header_found' => false, - 'headers_found' => 0, - 'text_domain_ptr' => false, - 'text_domain_found' => '', - 'last_header_ptr' => false, - 'last_header_matches' => array(), - ); - - if ( \T_COMMENT === $this->tokens[ $stackPtr ]['code'] ) { - $block_comment = false; - if ( substr( $this->tokens[ $stackPtr ]['content'], 0, 2 ) === '/*' ) { - $block_comment = true; - } - - $current = $stackPtr; - do { - if ( false === $comment_details['text_domain_ptr'] - || false === $comment_details['required_header_found'] - || $comment_details['headers_found'] < 3 - ) { - $comment_details = $this->examine_comment_line( $current, $regex, $headers, $comment_details ); - } - - if ( true === $block_comment && substr( $this->tokens[ $current ]['content'], -2 ) === '*/' ) { - ++$current; - break; - } - - ++$current; - } while ( isset( $this->tokens[ $current ] ) && \T_COMMENT === $this->tokens[ $current ]['code'] ); - - $skip_to = $current; - - } else { - if ( ! isset( $this->tokens[ $stackPtr ]['comment_closer'] ) ) { - return; - } - - $closer = $this->tokens[ $stackPtr ]['comment_closer']; - $current = $stackPtr; - - while ( ( $current = $this->phpcsFile->findNext( \T_DOC_COMMENT_STRING, ( $current + 1 ), $closer ) ) !== false ) { - $comment_details = $this->examine_comment_line( $current, $regex, $headers, $comment_details ); - - if ( false !== $comment_details['text_domain_ptr'] - && true === $comment_details['required_header_found'] - && $comment_details['headers_found'] >= 3 - ) { - // No need to look at the rest of the docblock. - break; - } - } - - $skip_to = $closer; - } - - // So, was this the plugin/theme header ? - if ( true === $comment_details['required_header_found'] - && $comment_details['headers_found'] >= 3 - ) { - $this->header_found = true; - - $text_domain_ptr = $comment_details['text_domain_ptr']; - $text_domain_found = $comment_details['text_domain_found']; - - if ( false !== $text_domain_ptr ) { - if ( $this->new_text_domain !== $text_domain_found - && ( \in_array( $text_domain_found, $this->old_text_domain, true ) ) - ) { - $fix = $this->phpcsFile->addFixableError( - 'Mismatched text domain in %s header. Expected \'%s\' but found \'%s\'', - $text_domain_ptr, - 'TextDomainHeaderMismatch', - array( - $type, - $this->new_text_domain, - $text_domain_found, - ) - ); - - if ( true === $fix ) { - if ( isset( $this->tokens[ $text_domain_ptr ]['orig_content'] ) ) { - $replacement = $this->tokens[ $text_domain_ptr ]['orig_content']; - } else { - $replacement = $this->tokens[ $text_domain_ptr ]['content']; - } - - $replacement = str_replace( $text_domain_found, $this->new_text_domain, $replacement ); - - $this->phpcsFile->fixer->replaceToken( $text_domain_ptr, $replacement ); - } - } - } else { - $last_header_ptr = $comment_details['last_header_ptr']; - $last_header_matches = $comment_details['last_header_matches']; - - $fix = $this->phpcsFile->addFixableError( - 'Missing "Text Domain" in %s header', - $last_header_ptr, - 'MissingTextDomainHeader', - array( $type ) - ); - - if ( true === $fix ) { - if ( isset( $this->tokens[ $last_header_ptr ]['orig_content'] ) ) { - $replacement = $this->tokens[ $last_header_ptr ]['orig_content']; - } else { - $replacement = $this->tokens[ $last_header_ptr ]['content']; - } - - $replacement = str_replace( $last_header_matches[1], 'Text Domain', $replacement ); - $replacement = str_replace( $last_header_matches[2], $this->new_text_domain, $replacement ); - - if ( \T_DOC_COMMENT_OPEN_TAG === $this->tokens[ $stackPtr ]['code'] ) { - for ( $i = ( $last_header_ptr - 1 ); ; $i-- ) { - if ( $this->tokens[ $i ]['line'] !== $this->tokens[ $last_header_ptr ]['line'] ) { - ++$i; - break; - } - } - - $replacement = $this->phpcsFile->eolChar - . GetTokensAsString::origContent( $this->phpcsFile, $i, ( $last_header_ptr - 1 ) ) - . $replacement; - } - - $this->phpcsFile->fixer->addContent( $comment_details['last_header_ptr'], $replacement ); - } - } - } - - return $skip_to; - } - - /** - * Examine an individual token in a larger comment for plugin/theme headers. - * - * @since 1.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $regex The regex to use to examine the comment line. - * @param array $headers Valid headers for a plugin or theme. - * @param array $comment_details The information collected so far. - * - * @return array Adjusted $comment_details array - */ - protected function examine_comment_line( $stackPtr, $regex, $headers, $comment_details ) { - if ( preg_match( $regex, $this->tokens[ $stackPtr ]['content'], $matches ) === 1 ) { - ++$comment_details['headers_found']; - - if ( true === $headers[ $matches[1] ] ) { - $comment_details['required_header_found'] = true; - } - - if ( 'Text Domain' === $matches[1] ) { - $comment_details['text_domain_ptr'] = $stackPtr; - $comment_details['text_domain_found'] = trim( $matches[2] ); - } - - $comment_details['last_header_ptr'] = $stackPtr; - $comment_details['last_header_matches'] = $matches; - } - - return $comment_details; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php deleted file mode 100644 index afd98fd2..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php +++ /dev/null @@ -1,371 +0,0 @@ - true, - 'php://output' => true, - 'php://stdin' => true, - 'php://stdout' => true, - 'php://stderr' => true, - ); - - /** - * Local input streams which should not be flagged for the file system function checks if - * the $filename starts with them. - * - * @link https://www.php.net/wrappers.php - * - * @since 2.1.0 - * @since 3.0.0 The visibility was changed from `protected` to `private`. - * - * @var array - */ - private $allowed_local_stream_partials = array( - 'php://temp/', - 'php://fd/', - ); - - /** - * Local input stream constants which should not be flagged for the file system function checks. - * - * @link https://www.php.net/wrappers.php - * - * @since 2.1.0 - * @since 3.0.0 The visibility was changed from `protected` to `private`. - * - * @var array - */ - private $allowed_local_stream_constants = array( - 'STDIN' => true, - 'STDOUT' => true, - 'STDERR' => true, - ); - - /** - * Groups of functions to restrict. - * - * Example: groups => array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'since' => '4.9.0', //=> the WP version in which the alternative became available. - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - 'curl' => array( - 'type' => 'warning', - 'message' => 'Using cURL functions is highly discouraged. Use wp_remote_get() instead.', - 'since' => '2.7.0', - 'functions' => array( - 'curl_*', - ), - 'allow' => array( - 'curl_version' => true, - ), - ), - - 'parse_url' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged because of inconsistency in the output across PHP versions; use wp_parse_url() instead.', - 'since' => '4.4.0', - 'functions' => array( - 'parse_url', - ), - ), - - 'json_encode' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged. Use wp_json_encode() instead.', - 'since' => '4.1.0', - 'functions' => array( - 'json_encode', - ), - ), - - 'file_get_contents' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged. Use wp_remote_get() for remote URLs instead.', - 'since' => '2.7.0', - 'functions' => array( - 'file_get_contents', - ), - ), - - 'unlink' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged. Use wp_delete_file() to delete a file.', - 'since' => '4.2.0', - 'functions' => array( - 'unlink', - ), - ), - - 'rename' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged. Use WP_Filesystem::move() to rename a file.', - 'since' => '2.5.0', - 'functions' => array( - 'rename', - ), - ), - - 'file_system_operations' => array( - 'type' => 'warning', - 'message' => 'File operations should use WP_Filesystem methods instead of direct PHP filesystem calls. Found: %s().', - 'since' => '2.5.0', - 'functions' => array( - 'chgrp', - 'chmod', - 'chown', - 'fclose', - 'file_put_contents', - 'fopen', - 'fputs', - 'fread', - 'fsockopen', - 'fwrite', - 'is_writable', - 'is_writeable', - 'mkdir', - 'pfsockopen', - 'readfile', - 'rmdir', - 'touch', - ), - ), - - 'strip_tags' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged. Use the more comprehensive wp_strip_all_tags() instead.', - 'since' => '2.9.0', - 'functions' => array( - 'strip_tags', - ), - ), - - 'rand_seeding' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged. Rand seeding is not necessary when using the wp_rand() function (as you should).', - 'since' => '2.6.2', - 'functions' => array( - 'mt_srand', - 'srand', - ), - ), - - 'rand' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged. Use the far less predictable wp_rand() instead.', - 'since' => '2.6.2', - 'functions' => array( - 'mt_rand', - 'rand', - ), - ), - ); - } - - /** - * Process a matched token. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_matched_token( $stackPtr, $group_name, $matched_content ) { - - $this->set_minimum_wp_version(); - - /* - * Deal with exceptions. - */ - switch ( $matched_content ) { - case 'strip_tags': - /* - * The function `wp_strip_all_tags()` is only a valid alternative when - * only the first parameter, `$string`, is passed to `strip_tags()`. - */ - $has_allowed_tags = PassedParameters::getParameter( $this->phpcsFile, $stackPtr, 2, 'allowed_tags' ); - if ( false !== $has_allowed_tags ) { - return; - } - - unset( $has_allowed_tags ); - break; - - case 'parse_url': - /* - * Before WP 4.7.0, the function `wp_parse_url()` was only a valid alternative - * if the second param - `$component` - was not passed to `parse_url()`. - * - * @see https://developer.wordpress.org/reference/functions/wp_parse_url/#changelog - */ - $has_component = PassedParameters::getParameter( $this->phpcsFile, $stackPtr, 2, 'component' ); - if ( false !== $has_component - && $this->wp_version_compare( $this->minimum_wp_version, '4.7.0', '<' ) - ) { - return; - } - - unset( $has_component ); - break; - - case 'file_get_contents': - /* - * Using `wp_remote_get()` will only work for remote URLs. - * See if we can determine is this function call is for a local file and if so, bow out. - */ - $params = PassedParameters::getParameters( $this->phpcsFile, $stackPtr ); - - $use_include_path_param = PassedParameters::getParameterFromStack( $params, 2, 'use_include_path' ); - if ( false !== $use_include_path_param && 'true' === $use_include_path_param['clean'] ) { - // Setting `$use_include_path` to `true` is only relevant for local files. - return; - } - - $filename_param = PassedParameters::getParameterFromStack( $params, 1, 'filename' ); - if ( false === $filename_param ) { - // If the file to get is not set, this is a non-issue anyway. - return; - } - - if ( strpos( $filename_param['clean'], 'http:' ) !== false - || strpos( $filename_param['clean'], 'https:' ) !== false - ) { - // Definitely a URL, throw notice. - break; - } - - $contains_wp_path_constant = preg_match( - '`\b(?:ABSPATH|WP_(?:CONTENT|PLUGIN)_DIR|WPMU_PLUGIN_DIR|TEMPLATEPATH|STYLESHEETPATH|(?:MU)?PLUGINDIR)\b`', - $filename_param['clean'] - ); - if ( 1 === $contains_wp_path_constant ) { - // Using any of the constants matched in this regex is an indicator of a local file. - return; - } - - $contains_wp_path_function_call = preg_match( - '`(?:get_home_path|plugin_dir_path|get_(?:stylesheet|template)_directory|wp_upload_dir)\s*\(`i', - $filename_param['clean'] - ); - if ( 1 === $contains_wp_path_function_call ) { - // Using any of the functions matched in the regex is an indicator of a local file. - return; - } - - if ( $this->is_local_data_stream( $filename_param['clean'] ) === true ) { - // Local data stream. - return; - } - - unset( $params, $use_include_path_param, $filename_param, $contains_wp_path_constant, $contains_wp_path_function_call ); - break; - - case 'file_put_contents': - case 'fopen': - case 'readfile': - /* - * Allow for handling raw data streams from the request body. - * - * Note: at this time (December 2022) these three functions use the same parameter name for their - * first parameter. If this would change at any point in the future, this code will need to - * be made more modular and will need to pass the parameter name based on the function call detected. - */ - $filename_param = PassedParameters::getParameter( $this->phpcsFile, $stackPtr, 1, 'filename' ); - if ( false === $filename_param ) { - // If the file to work with is not set, local data streams don't come into play. - break; - } - - if ( $this->is_local_data_stream( $filename_param['clean'] ) === true ) { - // Local data stream. - return; - } - - unset( $filename_param ); - break; - } - - if ( ! isset( $this->groups[ $group_name ]['since'] ) ) { - return parent::process_matched_token( $stackPtr, $group_name, $matched_content ); - } - - // Verify if the alternative is available in the minimum supported WP version. - if ( $this->wp_version_compare( $this->groups[ $group_name ]['since'], $this->minimum_wp_version, '<=' ) ) { - return parent::process_matched_token( $stackPtr, $group_name, $matched_content ); - } - } - - /** - * Determine based on the "clean" parameter value, whether a file parameter points to - * a local data stream. - * - * @param string $clean_param_value Parameter value without comments. - * - * @return bool True if this is a local data stream. False otherwise. - */ - protected function is_local_data_stream( $clean_param_value ) { - - $stripped = TextStrings::stripQuotes( $clean_param_value ); - if ( isset( $this->allowed_local_streams[ $stripped ] ) - || isset( $this->allowed_local_stream_constants[ $clean_param_value ] ) - ) { - return true; - } - - foreach ( $this->allowed_local_stream_partials as $partial ) { - if ( strpos( $stripped, $partial ) === 0 ) { - return true; - } - } - - return false; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php deleted file mode 100644 index 3a86562d..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php +++ /dev/null @@ -1,478 +0,0 @@ - The key is the name of a function we're targetting, - * the value is an array containing the 1-based parameter position - * of the "capability" parameter within the function, as well as - * the name of the parameter as declared in the function. - * If the parameter name has been renamed since the release of PHP 8.0, - * the parameter can be set as an array. - */ - protected $target_functions = array( - 'add_comments_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_dashboard_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_links_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_management_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_media_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_menu_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_object_page' => array( // Deprecated since WP 4.5.0. - 'position' => 3, - 'name' => 'capability', - ), - 'add_options_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_pages_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_plugins_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_posts_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_submenu_page' => array( - 'position' => 4, - 'name' => 'capability', - ), - 'add_theme_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_users_page' => array( - 'position' => 3, - 'name' => 'capability', - ), - 'add_utility_page' => array( // Deprecated since WP 4.5.0. - 'position' => 3, - 'name' => 'capability', - ), - 'author_can' => array( - 'position' => 2, - 'name' => 'capability', - ), - 'current_user_can' => array( - 'position' => 1, - 'name' => 'capability', - ), - 'current_user_can_for_blog' => array( - 'position' => 2, - 'name' => 'capability', - ), - 'map_meta_cap' => array( - 'position' => 1, - 'name' => 'cap', - ), - 'user_can' => array( - 'position' => 2, - 'name' => 'capability', - ), - ); - - /** - * List of core roles which should not to be used directly. - * - * @since 3.0.0 - * - * @var array Key is role available in WP Core, value irrelevant. - */ - private $core_roles = array( - 'super_admin' => true, - 'administrator' => true, - 'editor' => true, - 'author' => true, - 'contributor' => true, - 'subscriber' => true, - ); - - /** - * List of known primitive and meta core capabilities. - * - * Sources: - * - {@link https://wordpress.org/support/article/roles-and-capabilities/ Roles and Capabilities handbook page} - * - The `map_meta_cap()` function in the `src/wp-includes/capabilities.php` file. - * - The tests in the `tests/phpunit/tests/user/capabilities.php` file. - * - * List is sorted alphabetically. - * - * {@internal To be updated after every major release. Last updated for WordPress 6.1.0.} - * - * @since 3.0.0 - * - * @var array All capabilities available in core. - */ - private $core_capabilities = array( - 'activate_plugin' => true, - 'activate_plugins' => true, - 'add_comment_meta' => true, - 'add_post_meta' => true, - 'add_term_meta' => true, - 'add_user_meta' => true, - 'add_users' => true, - 'assign_categories' => true, - 'assign_post_tags' => true, - 'assign_term' => true, - 'create_app_password' => true, - 'create_sites' => true, - 'create_users' => true, - 'customize' => true, - 'deactivate_plugin' => true, - 'deactivate_plugins' => true, - 'delete_app_password' => true, - 'delete_app_passwords' => true, - 'delete_block' => true, // Only seen in tests. - 'delete_blocks' => true, // Alias for 'delete_posts', but supported. - 'delete_categories' => true, - 'delete_comment_meta' => true, - 'delete_others_blocks' => true, // Alias for 'delete_others_posts', but supported. - 'delete_others_pages' => true, - 'delete_others_posts' => true, - 'delete_page' => true, // Alias, but supported. - 'delete_pages' => true, - 'delete_plugins' => true, - 'delete_post_tags' => true, - 'delete_post' => true, // Alias, but supported. - 'delete_post_meta' => true, - 'delete_posts' => true, - 'delete_private_blocks' => true, // Alias for 'delete_private_posts', but supported. - 'delete_private_pages' => true, - 'delete_private_posts' => true, - 'delete_published_blocks' => true, // Alias for 'delete_published_posts', but supported. - 'delete_published_pages' => true, - 'delete_published_posts' => true, - 'delete_site' => true, - 'delete_sites' => true, - 'delete_term' => true, - 'delete_term_meta' => true, - 'delete_themes' => true, - 'delete_user' => true, // Alias for 'delete_users', but supported. - 'delete_user_meta' => true, - 'delete_users' => true, - 'edit_app_password' => true, - 'edit_categories' => true, - 'edit_block' => true, // Only seen in tests. - 'edit_blocks' => true, // Alias for 'edit_posts', but supported. - 'edit_comment' => true, // Alias, but supported. - 'edit_comment_meta' => true, - 'edit_css' => true, - 'edit_dashboard' => true, - 'edit_files' => true, - 'edit_others_blocks' => true, // Alias for 'edit_others_posts', but supported. - 'edit_others_pages' => true, - 'edit_others_posts' => true, - 'edit_page' => true, // Alias, but supported. - 'edit_pages' => true, - 'edit_plugins' => true, - 'edit_post_tags' => true, - 'edit_post' => true, // Alias, but supported. - 'edit_post_meta' => true, - 'edit_posts' => true, - 'edit_private_blocks' => true, // Alias for 'edit_private_posts', but supported. - 'edit_private_pages' => true, - 'edit_private_posts' => true, - 'edit_published_blocks' => true, // Alias for 'edit_published_posts', but supported. - 'edit_published_pages' => true, - 'edit_published_posts' => true, - 'edit_term' => true, - 'edit_term_meta' => true, - 'edit_theme_options' => true, - 'edit_themes' => true, - 'edit_user' => true, // Alias for 'edit_users', but supported. - 'edit_user_meta' => true, - 'edit_users' => true, - 'erase_others_personal_data' => true, - 'export' => true, - 'export_others_personal_data' => true, - 'import' => true, - 'install_languages' => true, - 'install_plugins' => true, - 'install_themes' => true, - 'list_app_passwords' => true, - 'list_users' => true, - 'manage_categories' => true, - 'manage_links' => true, - 'manage_network' => true, - 'manage_network_options' => true, - 'manage_network_plugins' => true, - 'manage_network_themes' => true, - 'manage_network_users' => true, - 'manage_options' => true, - 'manage_post_tags' => true, - 'manage_privacy_options' => true, - 'manage_sites' => true, - 'moderate_comments' => true, - 'publish_blocks' => true, // Alias for 'publish_posts', but supported. - 'publish_pages' => true, - 'publish_post' => true, // Alias, but supported. - 'publish_posts' => true, - 'promote_user' => true, - 'promote_users' => true, - 'read' => true, - 'read_block' => true, // Only seen in tests. - 'read_post' => true, // Alias, but supported. - 'read_page' => true, // Alias, but supported. - 'read_app_password' => true, - 'read_private_blocks' => true, // Alias for 'read_private_posts', but supported. - 'read_private_pages' => true, - 'read_private_posts' => true, - 'remove_user' => true, // Alias for 'remove_users', but supported. - 'remove_users' => true, - 'resume_plugin' => true, // Alias for 'resume_plugins', but supported. - 'resume_plugins' => true, - 'resume_theme' => true, // Alias for 'resume_themes', but supported. - 'resume_themes' => true, - 'setup_network' => true, - 'switch_themes' => true, - 'unfiltered_html' => true, - 'unfiltered_upload' => true, - 'update_core' => true, - 'update_https' => true, - 'update_languages' => true, - 'update_plugins' => true, - 'update_php' => true, - 'update_themes' => true, - 'upgrade_network' => true, - 'upload_files' => true, - 'upload_plugins' => true, - 'upload_themes' => true, - 'view_site_health_checks' => true, - ); - - /** - * List of deprecated core capabilities. - * - * User Levels were deprecated in version 3.0. - * - * {@internal To be updated after every major release. Last updated for WordPress 6.1.0.} - * - * @link https://github.com/WordPress/wordpress-develop/blob/master/tests/phpunit/tests/user/capabilities.php - * - * @since 3.0.0 - * - * @var array All deprecated capabilities in core. - */ - private $deprecated_capabilities = array( - 'level_10' => '3.0.0', - 'level_9' => '3.0.0', - 'level_8' => '3.0.0', - 'level_7' => '3.0.0', - 'level_6' => '3.0.0', - 'level_5' => '3.0.0', - 'level_4' => '3.0.0', - 'level_3' => '3.0.0', - 'level_2' => '3.0.0', - 'level_1' => '3.0.0', - 'level_0' => '3.0.0', - ); - - /** - * Process the parameters of a matched function. - * - * @since 3.0.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - $function_details = $this->target_functions[ $matched_content ]; - - $parameter = PassedParameters::getParameterFromStack( - $parameters, - $function_details['position'], - $function_details['name'] - ); - - if ( false === $parameter ) { - return; - } - - // If the parameter is anything other than T_CONSTANT_ENCAPSED_STRING throw a warning and bow out. - $first_non_empty = null; - for ( $i = $parameter['start']; $i <= $parameter['end']; $i++ ) { - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - if ( \T_CONSTANT_ENCAPSED_STRING !== $this->tokens[ $i ]['code'] - || null !== $first_non_empty - ) { - // Throw warning at low severity. - $this->phpcsFile->addWarning( - 'Couldn\'t determine the value passed to the $%s parameter in function call to %s(). Please check if it matches a valid capability. Found: %s', - $i, - 'Undetermined', - array( - $function_details['name'], - $matched_content, - $parameter['clean'], - ), - 3 // Message severity set to below default. - ); - return; - } - - $first_non_empty = $i; - } - - if ( null === $first_non_empty ) { - // Parse error. Bow out. - return; - } - - /* - * As of this point we know that the `$capabilities` parameter only contains the one token - * and that that token is a `T_CONSTANT_ENCAPSED_STRING`. - */ - $matched_parameter = TextStrings::stripQuotes( $this->tokens[ $first_non_empty ]['content'] ); - - if ( isset( $this->core_capabilities[ $matched_parameter ] ) ) { - return; - } - - if ( empty( $matched_parameter ) ) { - $this->phpcsFile->addError( - 'An empty string is not a valid capability. Empty string found as the $%s parameter in a function call to %s()"', - $first_non_empty, - 'Invalid', - array( - $function_details['name'], - $matched_content, - ) - ); - return; - } - - // Check if additional capabilities were registered via the ruleset and if the found capability matches any of those. - $custom_capabilities = RulesetPropertyHelper::merge_custom_array( $this->custom_capabilities, array() ); - if ( isset( $custom_capabilities[ $matched_parameter ] ) ) { - return; - } - - if ( isset( $this->deprecated_capabilities[ $matched_parameter ] ) ) { - $this->set_minimum_wp_version(); - $is_error = $this->wp_version_compare( $this->deprecated_capabilities[ $matched_parameter ], $this->minimum_wp_version, '<' ); - - $data = array( - $matched_parameter, - $matched_content, - $this->deprecated_capabilities[ $matched_parameter ], - ); - - MessageHelper::addMessage( - $this->phpcsFile, - 'The capability "%s", found in the function call to %s(), has been deprecated since WordPress version %s.', - $first_non_empty, - $is_error, - 'Deprecated', - $data - ); - return; - } - - if ( isset( $this->core_roles[ $matched_parameter ] ) ) { - $this->phpcsFile->addError( - 'Capabilities should be used instead of roles. Found "%s" in function call to %s()', - $first_non_empty, - 'RoleFound', - array( - $matched_parameter, - $matched_content, - ) - ); - return; - } - - $this->phpcsFile->addWarning( - 'Found unknown capability "%s" in function call to %s(). Please check the spelling of the capability. If this is a custom capability, please verify the capability is registered with WordPress via a call to WP_Role(s)->add_cap().' . \PHP_EOL . 'Custom capabilities can be made known to this sniff by setting the "custom_capabilities" property in the PHPCS ruleset.', - $first_non_empty, - 'Unknown', - array( - $matched_parameter, - $matched_content, - ) - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php deleted file mode 100644 index c183f156..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php +++ /dev/null @@ -1,315 +0,0 @@ -\'"()]*?\.(?:php|js|css|png|j[e]?pg|gif|pot))#i'; - - /** - * Regex to match a large number or spelling variations of WordPress in class names. - * - * @var string - */ - const WP_CLASSNAME_REGEX = '`(?:^|_)(Word[_]*Pres+)(?:_|$)`i'; - - /** - * Comment tokens we want to listen for as they contain text strings. - * - * @var array - */ - private $comment_text_tokens = array( - \T_DOC_COMMENT => \T_DOC_COMMENT, - \T_DOC_COMMENT_STRING => \T_DOC_COMMENT_STRING, - \T_COMMENT => \T_COMMENT, - ); - - /** - * Combined text string and comment tokens array. - * - * This property is set in the register() method and used for lookups. - * - * @var array - */ - private $text_and_comment_tokens = array(); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 0.12.0 - * - * @return array - */ - public function register() { - // Union the arrays - keeps the array keys. - $this->text_and_comment_tokens = ( Tokens::$textStringTokens + $this->comment_text_tokens ); - - $targets = $this->text_and_comment_tokens; - $targets += Tokens::$ooScopeTokens; - $targets[ \T_NAMESPACE ] = \T_NAMESPACE; - - // Also sniff for array tokens to make skipping anything within those more efficient. - $targets += Collections::arrayOpenTokensBC(); - $targets += Collections::listTokens(); - $targets[ \T_OPEN_SQUARE_BRACKET ] = \T_OPEN_SQUARE_BRACKET; - - return $targets; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 0.12.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - /* - * Ignore tokens within array and list definitions as well as within - * array keys as this is a false positive in 80% of all cases. - * - * The return values skip to the end of the array. - * This prevents the sniff "hanging" on very long configuration arrays. - */ - if ( ( \T_ARRAY === $this->tokens[ $stackPtr ]['code'] - || \T_LIST === $this->tokens[ $stackPtr ]['code'] ) - && isset( $this->tokens[ $stackPtr ]['parenthesis_closer'] ) - ) { - return $this->tokens[ $stackPtr ]['parenthesis_closer']; - } - - if ( ( \T_OPEN_SHORT_ARRAY === $this->tokens[ $stackPtr ]['code'] - || \T_OPEN_SQUARE_BRACKET === $this->tokens[ $stackPtr ]['code'] ) - && isset( $this->tokens[ $stackPtr ]['bracket_closer'] ) - ) { - return $this->tokens[ $stackPtr ]['bracket_closer']; - } - - /* - * Deal with misspellings in namespace names. - * These are not auto-fixable, but need the attention of a developer. - */ - if ( \T_NAMESPACE === $this->tokens[ $stackPtr ]['code'] ) { - $ns_name = Namespaces::getDeclaredName( $this->phpcsFile, $stackPtr ); - if ( empty( $ns_name ) ) { - // Namespace operator or declaration without name. - return; - } - - $levels = explode( '\\', $ns_name ); - foreach ( $levels as $level ) { - if ( preg_match_all( self::WP_CLASSNAME_REGEX, $level, $matches, \PREG_PATTERN_ORDER ) > 0 ) { - $misspelled = $this->retrieve_misspellings( $matches[1] ); - - if ( ! empty( $misspelled ) ) { - $this->phpcsFile->addWarning( - 'Please spell "WordPress" correctly. Found: "%s" as part of the namespace name.', - $stackPtr, - 'MisspelledNamespaceName', - array( implode( ', ', $misspelled ) ) - ); - } - } - } - - return; - } - - /* - * Deal with misspellings in class/interface/trait/enum names. - * These are not auto-fixable, but need the attention of a developer. - */ - if ( isset( Tokens::$ooScopeTokens[ $this->tokens[ $stackPtr ]['code'] ] ) ) { - $classname = ObjectDeclarations::getName( $this->phpcsFile, $stackPtr ); - if ( empty( $classname ) ) { - return; - } - - if ( preg_match_all( self::WP_CLASSNAME_REGEX, $classname, $matches, \PREG_PATTERN_ORDER ) > 0 ) { - $misspelled = $this->retrieve_misspellings( $matches[1] ); - - if ( ! empty( $misspelled ) ) { - $this->phpcsFile->addWarning( - 'Please spell "WordPress" correctly. Found: "%s" as part of the class/interface/trait/enum name.', - $stackPtr, - 'MisspelledClassName', - array( implode( ', ', $misspelled ) ) - ); - } - } - - return; - } - - /* - * Deal with misspellings in text strings and documentation. - */ - - // Ignore content of docblock @link tags. - if ( \T_DOC_COMMENT_STRING === $this->tokens[ $stackPtr ]['code'] - || \T_DOC_COMMENT === $this->tokens[ $stackPtr ]['code'] - ) { - - $comment_tag = $this->phpcsFile->findPrevious( - array( \T_DOC_COMMENT_TAG, \T_DOC_COMMENT_OPEN_TAG ), - ( $stackPtr - 1 ) - ); - if ( false !== $comment_tag - && \T_DOC_COMMENT_TAG === $this->tokens[ $comment_tag ]['code'] - && '@link' === $this->tokens[ $comment_tag ]['content'] - ) { - // @link tag, so ignore. - return; - } - } - - // Ignore constant declarations via define(). - if ( ContextHelper::is_in_function_call( $this->phpcsFile, $stackPtr, array( 'define' => true ), true, true ) ) { - return; - } - - // Ignore constant declarations using the const keyword. - $stop_points = array( - \T_CONST, - \T_SEMICOLON, - \T_OPEN_TAG, - \T_CLOSE_TAG, - \T_OPEN_CURLY_BRACKET, - ); - $maybe_const = $this->phpcsFile->findPrevious( $stop_points, ( $stackPtr - 1 ) ); - if ( false !== $maybe_const && \T_CONST === $this->tokens[ $maybe_const ]['code'] ) { - return; - } - - $content = $this->tokens[ $stackPtr ]['content']; - - if ( preg_match_all( self::WP_REGEX, $content, $matches, ( \PREG_PATTERN_ORDER | \PREG_OFFSET_CAPTURE ) ) > 0 ) { - /* - * Prevent some typical false positives. - */ - if ( isset( $this->text_and_comment_tokens[ $this->tokens[ $stackPtr ]['code'] ] ) ) { - $offset = 0; - foreach ( $matches[1] as $key => $match_data ) { - $next_offset = ( $match_data[1] + \strlen( $match_data[0] ) ); - - // Prevent matches on part of a URL. - if ( preg_match( '`http[s]?://[^\s<>\'"()]*' . preg_quote( $match_data[0], '`' ) . '`', $content, $discard, 0, $offset ) === 1 ) { - unset( $matches[1][ $key ] ); - } elseif ( preg_match( '`[a-z]+=(["\'])' . preg_quote( $match_data[0], '`' ) . '\1`', $content, $discard, 0, $offset ) === 1 ) { - // Prevent matches on html attributes like: `value="wordpress"`. - unset( $matches[1][ $key ] ); - } elseif ( preg_match( '`\\\\\'' . preg_quote( $match_data[0], '`' ) . '\\\\\'`', $content, $discard, 0, $offset ) === 1 ) { - // Prevent matches on xpath queries and such: `\'wordpress\'`. - unset( $matches[1][ $key ] ); - } elseif ( preg_match( '`(?:\?|&|&)[a-z0-9_]+=' . preg_quote( $match_data[0], '`' ) . '(?:&|$)`', $content, $discard, 0, $offset ) === 1 ) { - // Prevent matches on url query strings: `?something=wordpress`. - unset( $matches[1][ $key ] ); - } - - $offset = $next_offset; - } - - if ( empty( $matches[1] ) ) { - return; - } - } - - $misspelled = $this->retrieve_misspellings( $matches[1] ); - - if ( empty( $misspelled ) ) { - return; - } - - $code = 'MisspelledInText'; - if ( isset( Tokens::$commentTokens[ $this->tokens[ $stackPtr ]['code'] ] ) ) { - $code = 'MisspelledInComment'; - } - - $fix = $this->phpcsFile->addFixableWarning( - 'Please spell "WordPress" correctly. Found %s misspelling(s): %s', - $stackPtr, - $code, - array( - \count( $misspelled ), - implode( ', ', $misspelled ), - ) - ); - - if ( true === $fix ) { - // Apply fixes based on offset to ensure we don't replace false positives. - $replacement = $content; - foreach ( $matches[1] as $match ) { - $replacement = substr_replace( $replacement, 'WordPress', $match[1], \strlen( $match[0] ) ); - } - - $this->phpcsFile->fixer->replaceToken( $stackPtr, $replacement ); - } - } - } - - /** - * Retrieve a list of misspellings based on an array of matched variations on the target word. - * - * @param array $match_stack Array of matched variations of the target word. - * @return array Array containing only the misspelled variants. - */ - protected function retrieve_misspellings( $match_stack ) { - $misspelled = array(); - foreach ( $match_stack as $match ) { - // Deal with multi-dimensional arrays when capturing offset. - if ( \is_array( $match ) ) { - $match = $match[0]; - } - - if ( 'WordPress' !== $match ) { - $misspelled[] = $match; - } - } - - return $misspelled; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php deleted file mode 100644 index 7de22afd..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php +++ /dev/null @@ -1,897 +0,0 @@ -class_groups as $name ) { - $name_lc = $name . '_lc'; - $this->$name_lc = array_map( 'strtolower', $this->$name ); - $this->$name = array_combine( $this->$name_lc, $this->$name ); - } - } - - /** - * Groups of classes to restrict. - * - * @since 3.0.0 - * - * @return array - */ - public function getGroups() { - $groups = array(); - foreach ( $this->class_groups as $name ) { - $name_lc = $name . '_lc'; - $groups[ $name ] = array( - 'classes' => $this->$name_lc, - ); - } - - return $groups; - } - - /** - * Process a matched token. - * - * @since 3.0.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. Will - * always be 'wp_classes'. - * @param string $matched_content The token content (class name) which was matched. - * in its original case. - * - * @return void - */ - public function process_matched_token( $stackPtr, $group_name, $matched_content ) { - - $matched_unqualified = ltrim( $matched_content, '\\' ); - $matched_lowercase = strtolower( $matched_unqualified ); - $matched_proper_case = $this->get_proper_case( $matched_lowercase ); - - if ( $matched_unqualified === $matched_proper_case ) { - // Already using proper case, nothing to do. - return; - } - - $warning = 'It is strongly recommended to refer to classes by their properly cased name. Expected: %s Found: %s'; - $data = array( - $matched_proper_case, - $matched_unqualified, - ); - - $this->phpcsFile->addWarning( $warning, $stackPtr, 'Incorrect', $data ); - } - - /** - * Match a lowercase class name to its proper cased name. - * - * @since 3.0.0 - * - * @param string $matched_lc Lowercase class name. - * - * @return string - */ - private function get_proper_case( $matched_lc ) { - foreach ( $this->class_groups as $name ) { - $current = $this->$name; // Needed to prevent issues with PHP < 7.0. - if ( isset( $current[ $matched_lc ] ) ) { - return $current[ $matched_lc ]; - } - } - - // Shouldn't be possible. - return ''; // @codeCoverageIgnore - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php deleted file mode 100644 index fd48e1a2..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php +++ /dev/null @@ -1,321 +0,0 @@ - 60, - 'HOUR_IN_SECONDS' => 3600, - 'DAY_IN_SECONDS' => 86400, - 'WEEK_IN_SECONDS' => 604800, - 'MONTH_IN_SECONDS' => 2592000, - 'YEAR_IN_SECONDS' => 31536000, - ); - - /** - * Function within which the hook should be found. - * - * @var array - */ - protected $valid_functions = array( - 'add_filter' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() { - return Tokens::$stringTokens; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function process_token( $stackPtr ) { - $token = $this->tokens[ $stackPtr ]; - - if ( 'cron_schedules' !== TextStrings::stripQuotes( $token['content'] ) ) { - return; - } - - // Check if the text was found within a function call to add_filter(). - $functionPtr = ContextHelper::is_in_function_call( $this->phpcsFile, $stackPtr, $this->valid_functions ); - if ( false === $functionPtr ) { - return; - } - - $callback = PassedParameters::getParameter( $this->phpcsFile, $functionPtr, 2, 'callback' ); - if ( false === $callback ) { - return; - } - - if ( $stackPtr >= $callback['start'] && $stackPtr <= $callback['end'] ) { - // "cron_schedules" found in the second parameter, not the first. - return; - } - - // Detect callback function name. - $callbackArrayPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, $callback['start'], ( $callback['end'] + 1 ), true ); - - // If callback is array, get second element. - if ( false !== $callbackArrayPtr - && ( \T_ARRAY === $this->tokens[ $callbackArrayPtr ]['code'] - || ( isset( Collections::shortArrayListOpenTokensBC()[ $this->tokens[ $callbackArrayPtr ]['code'] ] ) - && Arrays::isShortArray( $this->phpcsFile, $callbackArrayPtr ) === true ) - ) - ) { - $callback = PassedParameters::getParameter( $this->phpcsFile, $callbackArrayPtr, 2 ); - - if ( false === $callback ) { - $this->confused( $stackPtr ); - return; - } - } - - unset( $functionPtr ); - - // Search for the function in tokens. - $search = Tokens::$stringTokens; - $search[ \T_CLOSURE ] = \T_CLOSURE; - $search[ \T_FN ] = \T_FN; - $search[ \T_ELLIPSIS ] = \T_ELLIPSIS; - $callbackFunctionPtr = $this->phpcsFile->findNext( $search, $callback['start'], ( $callback['end'] + 1 ) ); - - if ( false === $callbackFunctionPtr ) { - $this->confused( $stackPtr ); - return; - } - - if ( \T_CLOSURE === $this->tokens[ $callbackFunctionPtr ]['code'] - || \T_FN === $this->tokens[ $callbackFunctionPtr ]['code'] - ) { - $functionPtr = $callbackFunctionPtr; - } elseif ( \T_ELLIPSIS === $this->tokens[ $callbackFunctionPtr ]['code'] ) { - // Check if this is a PHP 8.1 first class callable. - $before = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $callbackFunctionPtr - 1 ), null, true ); - $after = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $callbackFunctionPtr + 1 ), null, true ); - if ( ( false !== $before && \T_OPEN_PARENTHESIS === $this->tokens[ $before ]['code'] ) - && ( false !== $after && \T_CLOSE_PARENTHESIS === $this->tokens[ $after ]['code'] ) - ) { - // Ok, now see if we can find the function name. - $beforeOpen = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $before - 1 ), null, true ); - if ( false !== $beforeOpen && \T_STRING === $this->tokens[ $beforeOpen ]['code'] ) { - $found_function = $this->find_function_by_name( $this->tokens[ $beforeOpen ]['content'] ); - if ( false !== $found_function ) { - $functionPtr = $found_function; - } - } - } - unset( $before, $after, $beforeOpen ); - } else { - $functionName = TextStrings::stripQuotes( $this->tokens[ $callbackFunctionPtr ]['content'] ); - $found_function = $this->find_function_by_name( $functionName ); - if ( false !== $found_function ) { - $functionPtr = $found_function; - } - } - - if ( ! isset( $functionPtr ) ) { - $this->confused( $stackPtr ); - return; - } - - if ( ! isset( $this->tokens[ $functionPtr ]['scope_opener'], $this->tokens[ $functionPtr ]['scope_closer'] ) ) { - return; - } - - $opening = $this->tokens[ $functionPtr ]['scope_opener']; - $closing = $this->tokens[ $functionPtr ]['scope_closer']; - for ( $i = $opening; $i <= $closing; $i++ ) { - - if ( isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) === true ) { - if ( 'interval' === TextStrings::stripQuotes( $this->tokens[ $i ]['content'] ) ) { - $operator = $this->phpcsFile->findNext( \T_DOUBLE_ARROW, $i, null, false, null, true ); - if ( false === $operator ) { - $this->confused( $stackPtr ); - return; - } - - $valueStart = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $operator + 1 ), null, true, null, true ); - $valueEnd = $this->phpcsFile->findNext( array( \T_COMMA, \T_CLOSE_PARENTHESIS ), ( $valueStart + 1 ) ); - $value = ''; - $parentheses_count = 0; - for ( $j = $valueStart; $j <= $valueEnd; $j++ ) { - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $j ]['code'] ] ) ) { - continue; - } - - if ( \T_NS_SEPARATOR === $this->tokens[ $j ]['code'] ) { - $value .= ' '; - continue; - } - - if ( $j === $valueEnd && \T_COMMA === $this->tokens[ $j ]['code'] ) { - break; - } - - // Make sure that PHP 7.4 numeric literals and PHP 8.1 explicit octals don't cause problems. - if ( \T_LNUMBER === $this->tokens[ $j ]['code'] - || \T_DNUMBER === $this->tokens[ $j ]['code'] - ) { - $number_info = Numbers::getCompleteNumber( $this->phpcsFile, $j ); - $value .= $number_info['decimal']; - $j = $number_info['last_token']; - continue; - } - - if ( \T_OPEN_PARENTHESIS === $this->tokens[ $j ]['code'] ) { - $value .= $this->tokens[ $j ]['content']; - ++$parentheses_count; - continue; - } - - if ( \T_CLOSE_PARENTHESIS === $this->tokens[ $j ]['code'] ) { - // Only add a close parenthesis if there are open parentheses. - if ( $parentheses_count > 0 ) { - $value .= $this->tokens[ $j ]['content']; - --$parentheses_count; - } - continue; - } - - $value .= $this->tokens[ $j ]['content']; - } - - if ( $parentheses_count > 0 ) { - // Make sure all open parenthesis are closed. - $value .= str_repeat( ')', $parentheses_count ); - } - - if ( is_numeric( $value ) ) { - $interval = $value; - break; - } - - // Deal correctly with WP time constants. - $value = str_replace( array_keys( $this->wp_time_constants ), array_values( $this->wp_time_constants ), $value ); - - // If all parentheses, digits and operators, eval! - if ( preg_match( '#^[\s\d()+*/-]+$#', $value ) > 0 ) { - $interval = eval( "return ( $value );" ); // phpcs:ignore Squiz.PHP.Eval -- No harm here. - break; - } - - $this->confused( $stackPtr ); - return; - } - } - } - - $this->min_interval = (int) $this->min_interval; - - if ( isset( $interval ) && $interval < $this->min_interval ) { - $minutes = round( ( $this->min_interval / 60 ), 1 ); - $this->phpcsFile->addWarning( - 'Scheduling crons at %s sec ( less than %s minutes ) is discouraged.', - $stackPtr, - 'CronSchedulesInterval', - array( - $interval, - $minutes, - ) - ); - return; - } - } - - /** - * Find a declared function in a file based on the function name. - * - * @param string $functionName The name of the function to find. - * - * @return int|false Integer stack pointer to the function keyword token or - * false if not found. - */ - private function find_function_by_name( $functionName ) { - $functionPtr = false; - for ( $ptr = 0; $ptr < $this->phpcsFile->numTokens; $ptr++ ) { - if ( \T_FUNCTION === $this->tokens[ $ptr ]['code'] ) { - $foundName = FunctionDeclarations::getName( $this->phpcsFile, $ptr ); - if ( $foundName === $functionName ) { - $functionPtr = $ptr; - break; - } elseif ( isset( $this->tokens[ $ptr ]['scope_closer'] ) ) { - // Skip to the end of the function definition. - $ptr = $this->tokens[ $ptr ]['scope_closer']; - } - } - } - - return $functionPtr; - } - - /** - * Add warning about unclear cron schedule change. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function confused( $stackPtr ) { - $this->phpcsFile->addWarning( - 'Detected changing of cron_schedules, but could not detect the interval value.', - $stackPtr, - 'ChangeDetected' - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php deleted file mode 100644 index dc512c20..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php +++ /dev/null @@ -1,152 +0,0 @@ - value - * in a custom ruleset. - * - * @uses \WordPressCS\WordPress\Helpers\MinimumWPVersionTrait::$minimum_wp_version - */ -final class DeprecatedClassesSniff extends AbstractClassRestrictionsSniff { - - use MinimumWPVersionTrait; - - /** - * List of deprecated classes with alternative when available. - * - * To be updated after every major release. - * - * Version numbers should be fully qualified. - * - * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} - * - * @var array - */ - private $deprecated_classes = array( - - // WP 3.1.0. - 'WP_User_Search' => array( - 'alt' => 'WP_User_Query', - 'version' => '3.1.0', - ), - - // WP 3.7.0. - 'WP_HTTP_Fsockopen' => array( - 'alt' => 'WP_HTTP::request()', - 'version' => '3.7.0', - ), - - // WP 4.9.0. - 'WP_Customize_New_Menu_Section' => array( - 'version' => '4.9.0', - ), - 'WP_Customize_New_Menu_Control' => array( - 'version' => '4.9.0', - ), - - // WP 5.3.0. - 'WP_Privacy_Data_Export_Requests_Table' => array( - 'alt' => 'WP_Privacy_Data_Export_Requests_List_Table', - 'version' => '5.3.0', - ), - 'WP_Privacy_Data_Removal_Requests_Table' => array( - 'alt' => 'WP_Privacy_Data_Removal_Requests_List_Table', - 'version' => '5.3.0', - ), - 'Services_JSON' => array( - 'alt' => 'The PHP native JSON extension', - 'version' => '5.3.0', - ), - 'Services_JSON_Error' => array( - 'alt' => 'The PHP native JSON extension', - 'version' => '5.3.0', - ), - - // WP 6.4.0. - 'WP_Http_Curl' => array( - 'alt' => 'WP_Http', - 'version' => '6.4.0', - ), - 'WP_Http_Streams' => array( - 'alt' => 'WP_Http', - 'version' => '6.4.0', - ), - ); - - /** - * Groups of classes to restrict. - * - * @return array - */ - public function getGroups() { - // Make sure all array keys are lowercase. - $this->deprecated_classes = array_change_key_case( $this->deprecated_classes, \CASE_LOWER ); - - return array( - 'deprecated_classes' => array( - 'classes' => array_keys( $this->deprecated_classes ), - ), - ); - } - - /** - * Process a matched token. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. Will - * always be 'deprecated_classes'. - * @param string $matched_content The token content (class name) which was matched - * in its original case. - * - * @return void - */ - public function process_matched_token( $stackPtr, $group_name, $matched_content ) { - - $this->set_minimum_wp_version(); - - $class_name = ltrim( strtolower( $matched_content ), '\\' ); - - $message = 'The %s class has been deprecated since WordPress version %s.'; - $data = array( - ltrim( $matched_content, '\\' ), - $this->deprecated_classes[ $class_name ]['version'], - ); - - if ( ! empty( $this->deprecated_classes[ $class_name ]['alt'] ) ) { - $message .= ' Use %s instead.'; - $data[] = $this->deprecated_classes[ $class_name ]['alt']; - } - - MessageHelper::addMessage( - $this->phpcsFile, - $message, - $stackPtr, - ( $this->wp_version_compare( $this->deprecated_classes[ $class_name ]['version'], $this->minimum_wp_version, '<' ) ), - MessageHelper::stringToErrorcode( $class_name . 'Found' ), - $data - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php deleted file mode 100644 index 1b55b919..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php +++ /dev/null @@ -1,1708 +0,0 @@ - value - * in a custom ruleset. - * - * @uses \WordPressCS\WordPress\Helpers\MinimumWPVersionTrait::$minimum_wp_version - */ -final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff { - - use MinimumWPVersionTrait; - - /** - * List of deprecated functions with alternative when available. - * - * Version numbers should be fully qualified. - * Replacement functions should have parentheses. - * - * To retrieve a function list for comparison, the following tool is available: - * https://github.com/JDGrimes/wp-deprecated-code-scanner - * - * {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.} - * - * @var array - */ - private $deprecated_functions = array( - // WP 0.71. - 'the_category_head' => array( - 'alt' => 'get_the_category_by_ID()', - 'version' => '0.71', - ), - 'the_category_ID' => array( - 'alt' => 'get_the_category()', - 'version' => '0.71', - ), - - // WP 1.2.0. - 'permalink_link' => array( - 'alt' => 'the_permalink()', - 'version' => '1.2.0', - ), - - // WP 1.5.0. - 'start_wp' => array( - // Verified correct alternative. - 'alt' => 'the Loop', - 'version' => '1.5.0', - ), - - // WP 1.5.1. - 'get_postdata' => array( - 'alt' => 'get_post()', - 'version' => '1.5.1', - ), - - // WP 2.0.0. - 'create_user' => array( - 'alt' => 'wp_create_user()', - 'version' => '2.0.0', - ), - 'next_post' => array( - 'alt' => 'next_post_link()', - 'version' => '2.0.0', - ), - 'previous_post' => array( - 'alt' => 'previous_post_link()', - 'version' => '2.0.0', - ), - 'user_can_create_draft' => array( - 'alt' => 'current_user_can()', - 'version' => '2.0.0', - ), - 'user_can_create_post' => array( - 'alt' => 'current_user_can()', - 'version' => '2.0.0', - ), - 'user_can_delete_post' => array( - 'alt' => 'current_user_can()', - 'version' => '2.0.0', - ), - 'user_can_delete_post_comments' => array( - 'alt' => 'current_user_can()', - 'version' => '2.0.0', - ), - 'user_can_edit_post' => array( - 'alt' => 'current_user_can()', - 'version' => '2.0.0', - ), - 'user_can_edit_post_comments' => array( - 'alt' => 'current_user_can()', - 'version' => '2.0.0', - ), - 'user_can_edit_post_date' => array( - 'alt' => 'current_user_can()', - 'version' => '2.0.0', - ), - 'user_can_edit_user' => array( - 'alt' => 'current_user_can()', - 'version' => '2.0.0', - ), - 'user_can_set_post_date' => array( - 'alt' => 'current_user_can()', - 'version' => '2.0.0', - ), - - // WP 2.1.0. - 'dropdown_cats' => array( - 'alt' => 'wp_dropdown_categories()', - 'version' => '2.1.0', - ), - 'get_archives' => array( - 'alt' => 'wp_get_archives()', - 'version' => '2.1.0', - ), - 'get_author_link' => array( - 'alt' => 'get_author_posts_url()', - 'version' => '2.1.0', - ), - 'get_autotoggle' => array( - 'alt' => '', - 'version' => '2.1.0', - ), - 'get_link' => array( - 'alt' => 'get_bookmark()', - 'version' => '2.1.0', - ), - 'get_linkcatname' => array( - 'alt' => 'get_category()', - 'version' => '2.1.0', - ), - 'get_linkobjects' => array( - 'alt' => 'get_bookmarks()', - 'version' => '2.1.0', - ), - 'get_linkobjectsbyname' => array( - 'alt' => 'get_bookmarks()', - 'version' => '2.1.0', - ), - 'get_linkrating' => array( - 'alt' => 'sanitize_bookmark_field()', - 'version' => '2.1.0', - ), - 'get_links' => array( - 'alt' => 'get_bookmarks()', - 'version' => '2.1.0', - ), - 'get_links_list' => array( - 'alt' => 'wp_list_bookmarks()', - 'version' => '2.1.0', - ), - 'get_links_withrating' => array( - 'alt' => 'get_bookmarks()', - 'version' => '2.1.0', - ), - 'get_linksbyname' => array( - 'alt' => 'get_bookmarks()', - 'version' => '2.1.0', - ), - 'get_linksbyname_withrating' => array( - 'alt' => 'get_bookmarks()', - 'version' => '2.1.0', - ), - 'get_settings' => array( - 'alt' => 'get_option()', - 'version' => '2.1.0', - ), - 'link_pages' => array( - 'alt' => 'wp_link_pages()', - 'version' => '2.1.0', - ), - 'links_popup_script' => array( - 'alt' => '', - 'version' => '2.1.0', - ), - 'list_authors' => array( - 'alt' => 'wp_list_authors()', - 'version' => '2.1.0', - ), - 'list_cats' => array( - 'alt' => 'wp_list_categories()', - 'version' => '2.1.0', - ), - 'tinymce_include' => array( - 'alt' => 'wp_editor()', - 'version' => '2.1.0', - ), - 'wp_get_links' => array( - 'alt' => 'wp_list_bookmarks()', - 'version' => '2.1.0', - ), - 'wp_get_linksbyname' => array( - 'alt' => 'wp_list_bookmarks()', - 'version' => '2.1.0', - ), - 'wp_get_post_cats' => array( - 'alt' => 'wp_get_post_categories()', - 'version' => '2.1.0', - ), - 'wp_list_cats' => array( - 'alt' => 'wp_list_categories()', - 'version' => '2.1.0', - ), - 'wp_set_post_cats' => array( - 'alt' => 'wp_set_post_categories()', - 'version' => '2.1.0', - ), - - // WP 2.2.0. - 'comments_rss' => array( - 'alt' => 'get_post_comments_feed_link()', - 'version' => '2.2.0', - ), - - // WP 2.3.0. - 'permalink_single_rss' => array( - 'alt' => 'the_permalink_rss()', - 'version' => '2.3.0', - ), - - // WP 2.5.0. - 'comments_rss_link' => array( - 'alt' => 'post_comments_feed_link()', - 'version' => '2.5.0', - ), - 'documentation_link' => array( - 'alt' => '', - 'version' => '2.5.0', - ), - 'get_attachment_icon' => array( - 'alt' => 'wp_get_attachment_image()', - 'version' => '2.5.0', - ), - 'get_attachment_icon_src' => array( - 'alt' => 'wp_get_attachment_image_src()', - 'version' => '2.5.0', - ), - 'get_attachment_innerHTML' => array( - 'alt' => 'wp_get_attachment_image()', - 'version' => '2.5.0', - ), - 'get_author_rss_link' => array( - 'alt' => 'get_author_feed_link()', - 'version' => '2.5.0', - ), - 'get_category_rss_link' => array( - 'alt' => 'get_category_feed_link()', - 'version' => '2.5.0', - ), - 'get_the_attachment_link' => array( - 'alt' => 'wp_get_attachment_link()', - 'version' => '2.5.0', - ), - 'gzip_compression' => array( - 'alt' => '', - 'version' => '2.5.0', - ), - 'wp_clearcookie' => array( - 'alt' => 'wp_clear_auth_cookie()', - 'version' => '2.5.0', - ), - 'wp_get_cookie_login' => array( - 'alt' => '', - 'version' => '2.5.0', - ), - 'wp_login' => array( - 'alt' => 'wp_signon()', - 'version' => '2.5.0', - ), - 'wp_setcookie' => array( - 'alt' => 'wp_set_auth_cookie()', - 'version' => '2.5.0', - ), - - // WP 2.6.0. - 'dropdown_categories' => array( - 'alt' => 'wp_category_checklist()', - 'version' => '2.6.0', - ), - 'dropdown_link_categories' => array( - 'alt' => 'wp_link_category_checklist()', - 'version' => '2.6.0', - ), - - // WP 2.7.0. - 'get_commentdata' => array( - 'alt' => 'get_comment()', - 'version' => '2.7.0', - ), - // This is a method i.e. WP_Filesystem_Base::find_base_dir() See #731. - 'find_base_dir' => array( - 'alt' => 'WP_Filesystem::abspath()', - 'version' => '2.7.0', - ), - // This is a method i.e. WP_Filesystem_Base::get_base_dir() See #731. - 'get_base_dir' => array( - 'alt' => 'WP_Filesystem::abspath()', - 'version' => '2.7.0', - ), - - // WP 2.8.0. - '__ngettext' => array( - 'alt' => '_n()', - 'version' => '2.8.0', - ), - '__ngettext_noop' => array( - 'alt' => '_n_noop()', - 'version' => '2.8.0', - ), - 'attribute_escape' => array( - 'alt' => 'esc_attr()', - 'version' => '2.8.0', - ), - 'get_author_name' => array( - 'alt' => 'get_the_author_meta(\'display_name\')', - 'version' => '2.8.0', - ), - 'get_category_children' => array( - 'alt' => 'get_term_children()', - 'version' => '2.8.0', - ), - 'get_catname' => array( - 'alt' => 'get_cat_name()', - 'version' => '2.8.0', - ), - 'get_the_author_aim' => array( - 'alt' => 'get_the_author_meta(\'aim\')', - 'version' => '2.8.0', - ), - 'get_the_author_description' => array( - 'alt' => 'get_the_author_meta(\'description\')', - 'version' => '2.8.0', - ), - 'get_the_author_email' => array( - 'alt' => 'get_the_author_meta(\'email\')', - 'version' => '2.8.0', - ), - 'get_the_author_firstname' => array( - 'alt' => 'get_the_author_meta(\'first_name\')', - 'version' => '2.8.0', - ), - 'get_the_author_icq' => array( - 'alt' => 'get_the_author_meta(\'icq\')', - 'version' => '2.8.0', - ), - 'get_the_author_ID' => array( - 'alt' => 'get_the_author_meta(\'ID\')', - 'version' => '2.8.0', - ), - 'get_the_author_lastname' => array( - 'alt' => 'get_the_author_meta(\'last_name\')', - 'version' => '2.8.0', - ), - 'get_the_author_login' => array( - 'alt' => 'get_the_author_meta(\'login\')', - 'version' => '2.8.0', - ), - 'get_the_author_msn' => array( - 'alt' => 'get_the_author_meta(\'msn\')', - 'version' => '2.8.0', - ), - 'get_the_author_nickname' => array( - 'alt' => 'get_the_author_meta(\'nickname\')', - 'version' => '2.8.0', - ), - 'get_the_author_url' => array( - 'alt' => 'get_the_author_meta(\'url\')', - 'version' => '2.8.0', - ), - 'get_the_author_yim' => array( - 'alt' => 'get_the_author_meta(\'yim\')', - 'version' => '2.8.0', - ), - 'js_escape' => array( - 'alt' => 'esc_js()', - 'version' => '2.8.0', - ), - 'register_sidebar_widget' => array( - 'alt' => 'wp_register_sidebar_widget()', - 'version' => '2.8.0', - ), - 'register_widget_control' => array( - 'alt' => 'wp_register_widget_control()', - 'version' => '2.8.0', - ), - 'the_author_aim' => array( - 'alt' => 'the_author_meta(\'aim\')', - 'version' => '2.8.0', - ), - 'the_author_description' => array( - 'alt' => 'the_author_meta(\'description\')', - 'version' => '2.8.0', - ), - 'the_author_email' => array( - 'alt' => 'the_author_meta(\'email\')', - 'version' => '2.8.0', - ), - 'the_author_firstname' => array( - 'alt' => 'the_author_meta(\'first_name\')', - 'version' => '2.8.0', - ), - 'the_author_icq' => array( - 'alt' => 'the_author_meta(\'icq\')', - 'version' => '2.8.0', - ), - 'the_author_ID' => array( - 'alt' => 'the_author_meta(\'ID\')', - 'version' => '2.8.0', - ), - 'the_author_lastname' => array( - 'alt' => 'the_author_meta(\'last_name\')', - 'version' => '2.8.0', - ), - 'the_author_login' => array( - 'alt' => 'the_author_meta(\'login\')', - 'version' => '2.8.0', - ), - 'the_author_msn' => array( - 'alt' => 'the_author_meta(\'msn\')', - 'version' => '2.8.0', - ), - 'the_author_nickname' => array( - 'alt' => 'the_author_meta(\'nickname\')', - 'version' => '2.8.0', - ), - 'the_author_url' => array( - 'alt' => 'the_author_meta(\'url\')', - 'version' => '2.8.0', - ), - 'the_author_yim' => array( - 'alt' => 'the_author_meta(\'yim\')', - 'version' => '2.8.0', - ), - 'unregister_sidebar_widget' => array( - 'alt' => 'wp_unregister_sidebar_widget()', - 'version' => '2.8.0', - ), - 'unregister_widget_control' => array( - 'alt' => 'wp_unregister_widget_control()', - 'version' => '2.8.0', - ), - 'wp_specialchars' => array( - 'alt' => 'esc_html()', - 'version' => '2.8.0', - ), - - // WP 2.9.0. - '_c' => array( - 'alt' => '_x()', - 'version' => '2.9.0', - ), - '_nc' => array( - 'alt' => '_nx()', - 'version' => '2.9.0', - ), - 'get_real_file_to_edit' => array( - 'alt' => '', - 'version' => '2.9.0', - ), - 'make_url_footnote' => array( - 'alt' => '', - 'version' => '2.9.0', - ), - 'the_content_rss' => array( - 'alt' => 'the_content_feed()', - 'version' => '2.9.0', - ), - 'translate_with_context' => array( - 'alt' => '_x()', - 'version' => '2.9.0', - ), - - // WP 3.0.0. - 'activate_sitewide_plugin' => array( - 'alt' => 'activate_plugin()', - 'version' => '3.0.0', - ), - 'add_option_update_handler' => array( - 'alt' => 'register_setting()', - 'version' => '3.0.0', - ), - 'automatic_feed_links' => array( - 'alt' => 'add_theme_support( \'automatic-feed-links\' )', - 'version' => '3.0.0', - ), - 'clean_url' => array( - 'alt' => 'esc_url()', - 'version' => '3.0.0', - ), - 'clear_global_post_cache' => array( - 'alt' => 'clean_post_cache()', - 'version' => '3.0.0', - ), - 'codepress_footer_js' => array( - 'alt' => '', - 'version' => '3.0.0', - ), - 'codepress_get_lang' => array( - 'alt' => '', - 'version' => '3.0.0', - ), - 'deactivate_sitewide_plugin' => array( - 'alt' => 'deactivate_plugin()', - 'version' => '3.0.0', - ), - 'delete_usermeta' => array( - 'alt' => 'delete_user_meta()', - 'version' => '3.0.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'funky_javascript_callback' => array( - 'alt' => '', - 'version' => '3.0.0', - ), - 'funky_javascript_fix' => array( - 'alt' => '', - 'version' => '3.0.0', - ), - 'generate_random_password' => array( - 'alt' => 'wp_generate_password()', - 'version' => '3.0.0', - ), - 'get_alloptions' => array( - 'alt' => 'wp_load_alloptions()', - 'version' => '3.0.0', - ), - 'get_blog_list' => array( - 'alt' => 'wp_get_sites()', - 'version' => '3.0.0', - ), - 'get_most_active_blogs' => array( - 'alt' => '', - 'version' => '3.0.0', - ), - 'get_profile' => array( - 'alt' => 'get_the_author_meta()', - 'version' => '3.0.0', - ), - 'get_user_details' => array( - 'alt' => 'get_user_by()', - 'version' => '3.0.0', - ), - 'get_usermeta' => array( - 'alt' => 'get_user_meta()', - 'version' => '3.0.0', - ), - 'get_usernumposts' => array( - 'alt' => 'count_user_posts()', - 'version' => '3.0.0', - ), - 'graceful_fail' => array( - 'alt' => 'wp_die()', - 'version' => '3.0.0', - ), - // Verified version & alternative. - 'install_blog_defaults' => array( - 'alt' => 'wp_install_defaults', - 'version' => '3.0.0', - ), - 'is_main_blog' => array( - 'alt' => 'is_main_site()', - 'version' => '3.0.0', - ), - 'is_site_admin' => array( - 'alt' => 'is_super_admin()', - 'version' => '3.0.0', - ), - 'is_taxonomy' => array( - 'alt' => 'taxonomy_exists()', - 'version' => '3.0.0', - ), - 'is_term' => array( - 'alt' => 'term_exists()', - 'version' => '3.0.0', - ), - 'is_wpmu_sitewide_plugin' => array( - 'alt' => 'is_network_only_plugin()', - 'version' => '3.0.0', - ), - 'mu_options' => array( - 'alt' => '', - 'version' => '3.0.0', - ), - 'remove_option_update_handler' => array( - 'alt' => 'unregister_setting()', - 'version' => '3.0.0', - ), - 'set_current_user' => array( - 'alt' => 'wp_set_current_user()', - 'version' => '3.0.0', - ), - 'update_usermeta' => array( - 'alt' => 'update_user_meta()', - 'version' => '3.0.0', - ), - 'use_codepress' => array( - 'alt' => '', - 'version' => '3.0.0', - ), - 'validate_email' => array( - 'alt' => 'is_email()', - 'version' => '3.0.0', - ), - 'wp_dropdown_cats' => array( - 'alt' => 'wp_dropdown_categories()', - 'version' => '3.0.0', - ), - 'wp_shrink_dimensions' => array( - 'alt' => 'wp_constrain_dimensions()', - 'version' => '3.0.0', - ), - 'wpmu_checkAvailableSpace' => array( - 'alt' => 'is_upload_space_available()', - 'version' => '3.0.0', - ), - 'wpmu_menu' => array( - 'alt' => '', - 'version' => '3.0.0', - ), - - // WP 3.1.0. - 'get_author_user_ids' => array( - 'alt' => 'get_users()', - 'version' => '3.1.0', - ), - 'get_dashboard_blog' => array( - 'alt' => 'get_site()', - 'version' => '3.1.0', - ), - 'get_editable_authors' => array( - 'alt' => 'get_users()', - 'version' => '3.1.0', - ), - 'get_editable_user_ids' => array( - 'alt' => 'get_users()', - 'version' => '3.1.0', - ), - 'get_nonauthor_user_ids' => array( - 'alt' => 'get_users()', - 'version' => '3.1.0', - ), - 'get_others_drafts' => array( - 'alt' => '', - 'version' => '3.1.0', - ), - 'get_others_pending' => array( - 'alt' => '', - 'version' => '3.1.0', - ), - 'get_others_unpublished_posts' => array( - 'alt' => '', - 'version' => '3.1.0', - ), - 'get_users_of_blog' => array( - 'alt' => 'get_users()', - 'version' => '3.1.0', - ), - 'install_themes_feature_list' => array( - 'alt' => 'get_theme_feature_list()', - 'version' => '3.1.0', - ), - 'is_plugin_page' => array( - // Verified correct alternative. - 'alt' => 'global $plugin_page and/or get_plugin_page_hookname() hooks', - 'version' => '3.1.0', - ), - 'update_category_cache' => array( - 'alt' => '', - 'version' => '3.1.0', - ), - - // WP 3.2.0. - 'favorite_actions' => array( - 'alt' => 'WP_Admin_Bar', - 'version' => '3.2.0', - ), - 'wp_dashboard_quick_press_output' => array( - 'alt' => 'wp_dashboard_quick_press()', - 'version' => '3.2.0', - ), - 'wp_timezone_supported' => array( - 'alt' => '', - 'version' => '3.2.0', - ), - - // WP 3.3.0. - 'add_contextual_help' => array( - 'alt' => 'get_current_screen()->add_help_tab()', - 'version' => '3.3.0', - ), - 'get_boundary_post_rel_link' => array( - 'alt' => '', - 'version' => '3.3.0', - ), - 'get_index_rel_link' => array( - 'alt' => '', - 'version' => '3.3.0', - ), - 'get_parent_post_rel_link' => array( - 'alt' => '', - 'version' => '3.3.0', - ), - 'get_user_by_email' => array( - 'alt' => 'get_user_by(\'email\')', - 'version' => '3.3.0', - ), - 'get_user_metavalues' => array( - 'alt' => '', - 'version' => '3.3.0', - ), - 'get_userdatabylogin' => array( - 'alt' => 'get_user_by(\'login\')', - 'version' => '3.3.0', - ), - 'index_rel_link' => array( - 'alt' => '', - 'version' => '3.3.0', - ), - 'is_blog_user' => array( - 'alt' => 'is_user_member_of_blog()', - 'version' => '3.3.0', - ), - 'media_upload_audio' => array( - 'alt' => 'wp_media_upload_handler()', - 'version' => '3.3.0', - ), - 'media_upload_file' => array( - 'alt' => 'wp_media_upload_handler()', - 'version' => '3.3.0', - ), - 'media_upload_image' => array( - 'alt' => 'wp_media_upload_handler()', - 'version' => '3.3.0', - ), - 'media_upload_video' => array( - 'alt' => 'wp_media_upload_handler()', - 'version' => '3.3.0', - ), - 'parent_post_rel_link' => array( - 'alt' => '', - 'version' => '3.3.0', - ), - 'sanitize_user_object' => array( - 'alt' => '', - 'version' => '3.3.0', - ), - 'screen_layout' => array( - 'alt' => '$current_screen->render_screen_layout()', - 'version' => '3.3.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'screen_meta' => array( - 'alt' => '$current_screen->render_screen_meta()', - 'version' => '3.3.0', - ), - 'screen_options' => array( - 'alt' => '$current_screen->render_per_page_options()', - 'version' => '3.3.0', - ), - 'start_post_rel_link' => array( - 'alt' => '', - 'version' => '3.3.0', - ), - 'the_editor' => array( - 'alt' => 'wp_editor()', - 'version' => '3.3.0', - ), - 'type_url_form_audio' => array( - 'alt' => 'wp_media_insert_url_form(\'audio\')', - 'version' => '3.3.0', - ), - 'type_url_form_file' => array( - 'alt' => 'wp_media_insert_url_form(\'file\')', - 'version' => '3.3.0', - ), - 'type_url_form_image' => array( - 'alt' => 'wp_media_insert_url_form(\'image\')', - 'version' => '3.3.0', - ), - 'type_url_form_video' => array( - 'alt' => 'wp_media_insert_url_form(\'video\')', - 'version' => '3.3.0', - ), - 'wp_admin_bar_dashboard_view_site_menu' => array( - 'alt' => '', - 'version' => '3.3.0', - ), - 'wp_preload_dialogs' => array( - 'alt' => 'wp_editor()', - 'version' => '3.3.0', - ), - 'wp_print_editor_js' => array( - 'alt' => 'wp_editor()', - 'version' => '3.3.0', - ), - 'wp_quicktags' => array( - 'alt' => 'wp_editor()', - 'version' => '3.3.0', - ), - 'wp_tiny_mce' => array( - 'alt' => 'wp_editor()', - 'version' => '3.3.0', - ), - 'wpmu_admin_do_redirect' => array( - 'alt' => 'wp_redirect()', - 'version' => '3.3.0', - ), - 'wpmu_admin_redirect_add_updated_param' => array( - 'alt' => 'add_query_arg()', - 'version' => '3.3.0', - ), - - // WP 3.4.0. - 'add_custom_background' => array( - 'alt' => 'add_theme_support( \'custom-background\', $args )', - 'version' => '3.4.0', - ), - 'add_custom_image_header' => array( - 'alt' => 'add_theme_support( \'custom-header\', $args )', - 'version' => '3.4.0', - ), - 'clean_page_cache' => array( - 'alt' => 'clean_post_cache()', - 'version' => '3.4.0', - ), - 'clean_pre' => array( - 'alt' => '', - 'version' => '3.4.0', - ), - 'current_theme_info' => array( - 'alt' => 'wp_get_theme()', - 'version' => '3.4.0', - ), - 'debug_fclose' => array( - 'alt' => 'error_log()', - 'version' => '3.4.0', - ), - 'debug_fopen' => array( - 'alt' => 'error_log()', - 'version' => '3.4.0', - ), - 'debug_fwrite' => array( - 'alt' => 'error_log()', - 'version' => '3.4.0', - ), - 'display_theme' => array( - 'alt' => '', - 'version' => '3.4.0', - ), - 'get_allowed_themes' => array( - 'alt' => 'wp_get_themes( array( \'allowed\' => true ) )', - 'version' => '3.4.0', - ), - 'get_broken_themes' => array( - 'alt' => 'wp_get_themes( array( \'errors\' => true )', - 'version' => '3.4.0', - ), - 'get_current_theme' => array( - 'alt' => 'wp_get_theme()', - 'version' => '3.4.0', - ), - 'get_site_allowed_themes' => array( - 'alt' => 'WP_Theme::get_allowed_on_network()', - 'version' => '3.4.0', - ), - 'get_theme' => array( - 'alt' => 'wp_get_theme( $stylesheet )', - 'version' => '3.4.0', - ), - 'get_theme_data' => array( - 'alt' => 'wp_get_theme()', - 'version' => '3.4.0', - ), - 'get_themes' => array( - 'alt' => 'wp_get_themes()', - 'version' => '3.4.0', - ), - 'logIO' => array( - 'alt' => 'error_log()', - 'version' => '3.4.0', - ), - 'remove_custom_background' => array( - 'alt' => 'remove_theme_support( \'custom-background\' )', - 'version' => '3.4.0', - ), - 'remove_custom_image_header' => array( - 'alt' => 'remove_theme_support( \'custom-header\' )', - 'version' => '3.4.0', - ), - 'update_page_cache' => array( - 'alt' => 'update_post_cache()', - 'version' => '3.4.0', - ), - 'wpmu_get_blog_allowedthemes' => array( - 'alt' => 'WP_Theme::get_allowed_on_site()', - 'version' => '3.4.0', - ), - - // WP 3.4.1. - 'wp_explain_nonce' => array( - 'alt' => 'wp_nonce_ays()', - 'version' => '3.4.1', - ), - - // WP 3.5.0. - '_flip_image_resource' => array( - 'alt' => 'WP_Image_Editor::flip()', - 'version' => '3.5.0', - ), - '_get_post_ancestors' => array( - 'alt' => '', - 'version' => '3.5.0', - ), - '_insert_into_post_button' => array( - 'alt' => '', - 'version' => '3.5.0', - ), - '_media_button' => array( - 'alt' => '', - 'version' => '3.5.0', - ), - '_rotate_image_resource' => array( - 'alt' => 'WP_Image_Editor::rotate()', - 'version' => '3.5.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - '_save_post_hook' => array( - 'alt' => '', - 'version' => '3.5.0', - ), - 'gd_edit_image_support' => array( - 'alt' => 'wp_image_editor_supports()', - 'version' => '3.5.0', - ), - 'get_default_page_to_edit' => array( - 'alt' => 'get_default_post_to_edit( \'page\' )', - 'version' => '3.5.0', - ), - 'get_post_to_edit' => array( - 'alt' => 'get_post()', - 'version' => '3.5.0', - ), - 'get_udims' => array( - 'alt' => 'wp_constrain_dimensions()', - 'version' => '3.5.0', - ), - 'image_resize' => array( - 'alt' => 'wp_get_image_editor()', - 'version' => '3.5.0', - ), - 'sticky_class' => array( - 'alt' => 'post_class()', - 'version' => '3.5.0', - ), - 'user_pass_ok' => array( - 'alt' => 'wp_authenticate()', - 'version' => '3.5.0', - ), - 'wp_cache_reset' => array( - 'alt' => 'wp_cache_switch_to_blog()', - 'version' => '3.5.0', - ), - 'wp_create_thumbnail' => array( - 'alt' => 'image_resize()', - 'version' => '3.5.0', - ), - 'wp_get_single_post' => array( - 'alt' => 'get_post()', - 'version' => '3.5.0', - ), - 'wp_load_image' => array( - 'alt' => 'wp_get_image_editor()', - 'version' => '3.5.0', - ), - - // WP 3.6.0. - 'get_user_id_from_string' => array( - 'alt' => 'get_user_by()', - 'version' => '3.6.0', - ), - 'wp_convert_bytes_to_hr' => array( - 'alt' => 'size_format()', - 'version' => '3.6.0', - ), - 'wp_nav_menu_locations_meta_box' => array( - 'alt' => '', - 'version' => '3.6.0', - ), - - // WP 3.7.0. - '_search_terms_tidy' => array( - 'alt' => '', - 'version' => '3.7.0', - ), - 'get_blogaddress_by_domain' => array( - 'alt' => '', - 'version' => '3.7.0', - ), - 'the_attachment_links' => array( - 'alt' => '', - 'version' => '3.7.0', - ), - 'wp_update_core' => array( - 'alt' => 'new Core_Upgrader();', - 'version' => '3.7.0', - ), - 'wp_update_plugin' => array( - 'alt' => 'new Plugin_Upgrader();', - 'version' => '3.7.0', - ), - 'wp_update_theme' => array( - 'alt' => 'new Theme_Upgrader();', - 'version' => '3.7.0', - ), - - // WP 3.8.0. - 'get_screen_icon' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - 'screen_icon' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_dashboard_incoming_links' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_dashboard_incoming_links_control' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_dashboard_incoming_links_output' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_dashboard_plugins' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_dashboard_primary_control' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_dashboard_recent_comments_control' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_dashboard_secondary' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_dashboard_secondary_control' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_dashboard_secondary_output' => array( - 'alt' => '', - 'version' => '3.8.0', - ), - - // WP 3.9.0. - '_relocate_children' => array( - 'alt' => '', - 'version' => '3.9.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'default_topic_count_text' => array( - 'alt' => '', - 'version' => '3.9.0', - ), - 'format_to_post' => array( - 'alt' => '', - 'version' => '3.9.0', - ), - 'get_current_site_name' => array( - 'alt' => 'get_current_site()', - 'version' => '3.9.0', - ), - 'rich_edit_exists' => array( - 'alt' => '', - 'version' => '3.9.0', - ), - 'wpmu_current_site' => array( - 'alt' => '', - 'version' => '3.9.0', - ), - - // WP 4.0.0. - 'get_all_category_ids' => array( - 'alt' => 'get_terms()', - 'version' => '4.0.0', - ), - 'like_escape' => array( - 'alt' => 'wpdb::esc_like()', - 'version' => '4.0.0', - ), - 'url_is_accessable_via_ssl' => array( - 'alt' => '', - 'version' => '4.0.0', - ), - - // WP 4.1.0. - // This is a method from the WP_Customize_Image_Control class. See #731. - 'add_tab' => array( - 'alt' => '', - 'version' => '4.1.0', - ), - // This is a method from the WP_Customize_Image_Control class. See #731. - 'prepare_control' => array( - 'alt' => '', - 'version' => '4.1.0', - ), - // This is a method from the WP_Customize_Image_Control class. See #731. - 'print_tab_image' => array( - 'alt' => '', - 'version' => '4.1.0', - ), - // This is a method from the WP_Customize_Image_Control class. See #731. - 'remove_tab' => array( - 'alt' => '', - 'version' => '4.1.0', - ), - - // WP 4.2.0. - // This is a method from the WP_Customize_Widgets class. See #731. - 'prepreview_added_sidebars_widgets' => array( - 'alt' => 'the \'customize_dynamic_setting_args\' filter', - 'version' => '4.2.0', - ), - // This is a method from the WP_Customize_Widgets class. See #731. - 'prepreview_added_widget_instance' => array( - 'alt' => 'the \'customize_dynamic_setting_args\' filter', - 'version' => '4.2.0', - ), - // This is a method from the WP_Customize_Widgets class. See #731. - 'remove_prepreview_filters' => array( - 'alt' => 'the \'customize_dynamic_setting_args\' filter', - 'version' => '4.2.0', - ), - // This is a method from the WP_Customize_Widgets class. See #731. - 'setup_widget_addition_previews' => array( - 'alt' => 'the \'customize_dynamic_setting_args\' filter', - 'version' => '4.2.0', - ), - - // WP 4.3.0. - '_preview_theme_stylesheet_filter' => array( - 'alt' => '', - 'version' => '4.3.0', - ), - '_preview_theme_template_filter' => array( - 'alt' => '', - 'version' => '4.3.0', - ), - 'preview_theme' => array( - 'alt' => '', - 'version' => '4.3.0', - ), - 'preview_theme_ob_filter' => array( - 'alt' => '', - 'version' => '4.3.0', - ), - 'preview_theme_ob_filter_callback' => array( - 'alt' => '', - 'version' => '4.3.0', - ), - // Verified; see https://core.trac.wordpress.org/ticket/41121, patch 3. - 'wp_ajax_wp_fullscreen_save_post' => array( - 'alt' => '', - 'version' => '4.3.0', - ), - 'wp_htmledit_pre' => array( - 'alt' => 'format_for_editor()', - 'version' => '4.3.0', - ), - 'wp_richedit_pre' => array( - 'alt' => 'format_for_editor()', - 'version' => '4.3.0', - ), - - // WP 4.4.0. - 'create_empty_blog' => array( - 'alt' => '', - 'version' => '4.4.0', - ), - 'force_ssl_login' => array( - 'alt' => 'force_ssl_admin()', - 'version' => '4.4.0', - ), - 'get_admin_users_for_domain' => array( - 'alt' => '', - 'version' => '4.4.0', - ), - 'post_permalink' => array( - 'alt' => 'get_permalink()', - 'version' => '4.4.0', - ), - 'wp_get_http' => array( - 'alt' => 'the WP_Http class', - 'version' => '4.4.0', - ), - // This is a method i.e. WP_Widget_Recent_Comments::flush_widget_cache() See #731. - 'flush_widget_cache' => array( - 'alt' => '', - 'version' => '4.4.0', - ), - - // WP 4.5.0. - 'add_object_page' => array( - 'alt' => 'add_menu_page()', - 'version' => '4.5.0', - ), - 'add_utility_page' => array( - 'alt' => 'add_menu_page()', - 'version' => '4.5.0', - ), - 'comments_popup_script' => array( - 'alt' => '', - 'version' => '4.5.0', - ), - 'get_comments_popup_template' => array( - 'alt' => '', - 'version' => '4.5.0', - ), - 'get_currentuserinfo' => array( - 'alt' => 'wp_get_current_user()', - 'version' => '4.5.0', - ), - 'is_comments_popup' => array( - 'alt' => '', - 'version' => '4.5.0', - ), - 'popuplinks' => array( - 'alt' => '', - 'version' => '4.5.0', - ), - - // WP 4.6.0. - 'post_form_autocomplete_off' => array( - 'alt' => '', - 'version' => '4.6.0', - ), - 'wp_embed_handler_googlevideo' => array( - 'alt' => '', - 'version' => '4.6.0', - ), - 'wp_get_sites' => array( - 'alt' => 'get_sites()', - 'version' => '4.6.0', - ), - - // WP 4.7.0. - '_sort_nav_menu_items' => array( - 'alt' => 'wp_list_sort()', - 'version' => '4.7.0', - ), - '_usort_terms_by_ID' => array( - 'alt' => 'wp_list_sort()', - 'version' => '4.7.0', - ), - '_usort_terms_by_name' => array( - 'alt' => 'wp_list_sort()', - 'version' => '4.7.0', - ), - 'get_paged_template' => array( - 'alt' => '', - 'version' => '4.7.0', - ), - 'wp_get_network' => array( - 'alt' => 'get_network()', - 'version' => '4.7.0', - ), - 'wp_kses_js_entities' => array( - 'alt' => '', - 'version' => '4.7.0', - ), - - // WP 4.8.0. - 'wp_dashboard_plugins_output' => array( - 'alt' => '', - 'version' => '4.8.0', - ), - - // WP 4.9.0. - 'get_shortcut_link' => array( - 'alt' => '', - 'version' => '4.9.0', - ), - 'is_user_option_local' => array( - 'alt' => '', - 'version' => '4.9.0', - ), - 'wp_ajax_press_this_add_category' => array( - 'alt' => '', - 'version' => '4.9.0', - ), - 'wp_ajax_press_this_save_post' => array( - 'alt' => '', - 'version' => '4.9.0', - ), - - // WP 5.1.0. - 'insert_blog' => array( - 'alt' => 'wp_insert_site()', - 'version' => '5.1.0', - ), - 'install_blog' => array( - 'alt' => '', - 'version' => '5.1.0', - ), - - // WP 5.3.0. - '_wp_json_prepare_data' => array( - 'alt' => '', - 'version' => '5.3.0', - ), - '_wp_privacy_requests_screen_options' => array( - 'alt' => '', - 'version' => '5.3.0', - ), - 'update_user_status' => array( - 'alt' => 'wp_update_user()', - 'version' => '5.3.0', - ), - - // WP 5.4.0. - 'wp_get_user_request_data' => array( - 'alt' => 'wp_get_user_request()', - 'version' => '5.4.0', - ), - - // WP 5.5.0. - '_wp_register_meta_args_whitelist' => array( - 'alt' => '_wp_register_meta_args_allowed_list()', - 'version' => '5.5.0', - ), - 'add_option_whitelist' => array( - 'alt' => 'add_allowed_options()', - 'version' => '5.5.0', - ), - 'remove_option_whitelist' => array( - 'alt' => 'remove_allowed_options()', - 'version' => '5.5.0', - ), - 'wp_blacklist_check' => array( - 'alt' => 'wp_check_comment_disallowed_list()', - 'version' => '5.5.0', - ), - 'wp_make_content_images_responsive' => array( - 'alt' => 'wp_filter_content_tags()', - 'version' => '5.5.0', - ), - 'wp_unregister_GLOBALS' => array( - 'alt' => '', - 'version' => '5.5.0', - ), - - // WP 5.7.0. - 'noindex' => array( - 'alt' => 'wp_robots_noindex()', - 'version' => '5.7.0', - ), - 'wp_no_robots' => array( - 'alt' => 'wp_robots_no_robots()', - 'version' => '5.7.0', - ), - 'wp_sensitive_page_meta' => array( - 'alt' => 'wp_robots_sensitive_page()', - 'version' => '5.7.0', - ), - - // WP 5.8.0. - '_excerpt_render_inner_columns_blocks' => array( - 'alt' => '_excerpt_render_inner_blocks()', - 'version' => '5.8.0', - ), - - // WP 5.9.0. - 'readonly' => array( - 'alt' => 'wp_readonly()', - 'version' => '5.9.0', - ), - - // WP 5.9.1. - 'wp_render_duotone_filter_preset' => array( - 'alt' => 'wp_get_duotone_filter_property()', - 'version' => '5.9.1', - ), - - // WP 6.0.0. - 'image_attachment_fields_to_save' => array( - 'alt' => '', - 'version' => '6.0.0', - ), - 'wp_add_iframed_editor_assets_html' => array( - 'alt' => '', - 'version' => '6.0.0', - ), - 'wp_skip_border_serialization' => array( - 'alt' => 'wp_should_skip_block_supports_serialization()', - 'version' => '6.0.0', - ), - 'wp_skip_dimensions_serialization' => array( - 'alt' => 'wp_should_skip_block_supports_serialization()', - 'version' => '6.0.0', - ), - 'wp_skip_spacing_serialization' => array( - 'alt' => 'wp_should_skip_block_supports_serialization()', - 'version' => '6.0.0', - ), - - // WP 6.0.2. - 'the_meta' => array( - 'alt' => 'get_post_meta()', - 'version' => '6.0.2', - ), - - // WP 6.0.3. - // Verified; see https://core.trac.wordpress.org/ticket/56791#comment:10. - '_filter_query_attachment_filenames' => array( - 'alt' => 'add_filter( "wp_allow_query_attachment_by_filename", "__return_true" )', - 'version' => '6.0.3', - ), - - // WP 6.1.0. - '_get_path_to_translation' => array( - 'alt' => 'WP_Textdomain_Registry', - 'version' => '6.1.0', - ), - '_get_path_to_translation_from_lang_dir' => array( - 'alt' => 'WP_Textdomain_Registry', - 'version' => '6.1.0', - ), - '_wp_multiple_block_styles' => array( - 'alt' => '', - 'version' => '6.1.0', - ), - 'global_terms' => array( - 'alt' => '', - 'version' => '6.1.0', - ), - 'global_terms_enabled' => array( - 'alt' => '', - 'version' => '6.1.0', - ), - 'install_global_terms' => array( - 'alt' => '', - 'version' => '6.1.0', - ), - 'sync_category_tag_slugs' => array( - 'alt' => '', - 'version' => '6.1.0', - ), - 'wp_get_attachment_thumb_file' => array( - 'alt' => '', - 'version' => '6.1.0', - ), - 'wp_typography_get_css_variable_inline_style' => array( - 'alt' => 'wp_style_engine_get_styles()', - 'version' => '6.1.0', - ), - - // WP 6.2.0. - '_resolve_home_block_template' => array( - 'alt' => '', - 'version' => '6.2.0', - ), - 'get_page_by_title' => array( - 'alt' => 'WP_Query', - 'version' => '6.2.0', - ), - - // WP 6.3.0. - '_wp_tinycolor_bound_alpha' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'block_core_navigation_get_classic_menu_fallback' => array( - 'alt' => 'WP_Navigation_Fallback::get_classic_menu_fallback', - 'version' => '6.3.0', - ), - 'block_core_navigation_get_classic_menu_fallback_blocks' => array( - 'alt' => 'WP_Navigation_Fallback::get_classic_menu_fallback_blocks', - 'version' => '6.3.0', - ), - 'block_core_navigation_get_most_recently_published_navigation' => array( - 'alt' => 'WP_Navigation_Fallback::get_most_recently_published_navigation', - 'version' => '6.3.0', - ), - 'block_core_navigation_maybe_use_classic_menu_fallback' => array( - 'alt' => 'WP_Navigation_Fallback::create_classic_menu_fallback', - 'version' => '6.3.0', - ), - 'block_core_navigation_parse_blocks_from_menu_items' => array( - 'alt' => 'WP_Navigation_Fallback::parse_blocks_from_menu_items', - 'version' => '6.3.0', - ), - 'block_core_navigation_submenu_build_css_colors' => array( - 'alt' => 'wp_apply_colors_support()', - 'version' => '6.3.0', - ), - 'wlwmanifest_link' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_get_duotone_filter_id' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_get_duotone_filter_property' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_get_duotone_filter_svg' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_get_global_styles_svg_filters' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_get_loading_attr_default' => array( - 'alt' => 'wp_get_loading_optimization_attributes()', - 'version' => '6.3.0', - ), - 'wp_global_styles_render_svg_filters' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_img_tag_add_loading_attr' => array( - 'alt' => 'wp_img_tag_add_loading_optimization_attrs()', - 'version' => '6.3.0', - ), - 'wp_queue_comments_for_comment_meta_lazyload' => array( - 'alt' => 'wp_lazyload_comment_meta()', - 'version' => '6.3.0', - ), - 'wp_register_duotone_support' => array( - 'alt' => 'WP_Duotone::register_duotone_support()', - 'version' => '6.3.0', - ), - 'wp_render_duotone_support' => array( - 'alt' => 'WP_Duotone::render_duotone_support()', - 'version' => '6.3.0', - ), - 'wp_tinycolor_bound01' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_tinycolor_hsl_to_rgb' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_tinycolor_hue_to_rgb' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_tinycolor_rgb_to_rgb' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - 'wp_tinycolor_string_to_rgb' => array( - 'alt' => '', - 'version' => '6.3.0', - ), - - // WP 6.4.0. - '_admin_bar_bump_cb' => array( - 'alt' => 'wp_enqueue_admin_bar_bump_styles()', - 'version' => '6.4.0', - ), - '_inject_theme_attribute_in_block_template_content' => array( - 'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), \'_inject_theme_attribute_in_template_part_block\' )', - 'version' => '6.4.0', - ), - '_remove_theme_attribute_in_block_template_content' => array( - 'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), \'_remove_theme_attribute_from_template_part_block\' )', - 'version' => '6.4.0', - ), - '_wp_theme_json_webfonts_handler' => array( - 'alt' => 'wp_print_font_faces()', - 'version' => '6.4.0', - ), - 'print_embed_styles' => array( - 'alt' => 'wp_enqueue_embed_styles()', - 'version' => '6.4.0', - ), - 'print_emoji_styles' => array( - 'alt' => 'wp_enqueue_emoji_styles()', - 'version' => '6.4.0', - ), - 'the_block_template_skip_link' => array( - 'alt' => 'wp_enqueue_block_template_skip_link()', - 'version' => '6.4.0', - ), - 'wp_admin_bar_header' => array( - 'alt' => 'wp_enqueue_admin_bar_header_styles()', - 'version' => '6.4.0', - ), - 'wp_img_tag_add_decoding_attr' => array( - 'alt' => 'wp_img_tag_add_loading_optimization_attrs()', - 'version' => '6.4.0', - ), - 'wp_update_https_detection_errors' => array( - 'alt' => 'wp_get_https_detection_errors()', - 'version' => '6.4.0', - ), - - // WP 6.5.0. - 'block_core_file_ensure_interactivity_dependency' => array( - 'alt' => 'wp_register_script_module()', - 'version' => '6.5.0', - ), - 'block_core_image_ensure_interactivity_dependency' => array( - 'alt' => 'wp_register_script_module()', - 'version' => '6.5.0', - ), - 'block_core_query_ensure_interactivity_dependency' => array( - 'alt' => 'wp_register_script_module()', - 'version' => '6.5.0', - ), - ); - - /** - * Groups of functions to restrict. - * - * @return array - */ - public function getGroups() { - // Make sure all array keys are lowercase. - $this->deprecated_functions = array_change_key_case( $this->deprecated_functions, \CASE_LOWER ); - - return array( - 'deprecated_functions' => array( - 'functions' => array_keys( $this->deprecated_functions ), - ), - ); - } - - /** - * Process a matched token. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. Will - * always be 'deprecated_functions'. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * - * @return void - */ - public function process_matched_token( $stackPtr, $group_name, $matched_content ) { - - $this->set_minimum_wp_version(); - - $message = '%s() has been deprecated since WordPress version %s.'; - $data = array( - $this->tokens[ $stackPtr ]['content'], - $this->deprecated_functions[ $matched_content ]['version'], - ); - - if ( ! empty( $this->deprecated_functions[ $matched_content ]['alt'] ) ) { - $message .= ' Use %s instead.'; - $data[] = $this->deprecated_functions[ $matched_content ]['alt']; - } - - MessageHelper::addMessage( - $this->phpcsFile, - $message, - $stackPtr, - ( $this->wp_version_compare( $this->deprecated_functions[ $matched_content ]['version'], $this->minimum_wp_version, '<' ) ), - MessageHelper::stringToErrorcode( $matched_content . 'Found' ), - $data - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php deleted file mode 100644 index 0806772b..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php +++ /dev/null @@ -1,291 +0,0 @@ - array( - * (int) Target parameter position, 1-based. => array( - * (string) 'name' => (string|array) Parameter name(s), - * (string) 'values' => array( - * (string) Parameter value. => array( - * 'alt' => (string) Suggested alternative. - * 'version' => (int) The WordPress version when deprecated. - * ) - * ) - * ) - * ) - * ); - */ - protected $target_functions = array( - 'add_option' => array( - 1 => array( - 'name' => 'option', - 'values' => array( - 'blacklist_keys' => array( - 'alt' => 'disallowed_keys', - 'version' => '5.5.0', - ), - 'comment_whitelist' => array( - 'alt' => 'comment_previously_approved', - 'version' => '5.5.0', - ), - ), - ), - ), - 'add_settings_field' => array( - 4 => array( - 'name' => 'page', - 'values' => array( - 'misc' => array( - 'alt' => 'another settings group', - 'version' => '3.0.0', - ), - 'privacy' => array( - 'alt' => 'another settings group', - 'version' => '3.5.0', - ), - ), - ), - ), - 'add_settings_section' => array( - 4 => array( - 'name' => 'page', - 'values' => array( - 'misc' => array( - 'alt' => 'another settings group', - 'version' => '3.0.0', - ), - 'privacy' => array( - 'alt' => 'another settings group', - 'version' => '3.5.0', - ), - ), - ), - ), - 'bloginfo' => array( - 1 => array( - 'name' => 'show', - 'values' => array( - 'home' => array( - 'alt' => 'the "url" argument', - 'version' => '2.2.0', - ), - 'siteurl' => array( - 'alt' => 'the "url" argument', - 'version' => '2.2.0', - ), - 'text_direction' => array( - 'alt' => 'is_rtl()', - 'version' => '2.2.0', - ), - ), - ), - ), - 'get_bloginfo' => array( - 1 => array( - 'name' => 'show', - 'values' => array( - 'home' => array( - 'alt' => 'the "url" argument', - 'version' => '2.2.0', - ), - 'siteurl' => array( - 'alt' => 'the "url" argument', - 'version' => '2.2.0', - ), - 'text_direction' => array( - 'alt' => 'is_rtl()', - 'version' => '2.2.0', - ), - ), - ), - ), - 'get_option' => array( - 1 => array( - 'name' => 'option', - 'values' => array( - 'blacklist_keys' => array( - 'alt' => 'disallowed_keys', - 'version' => '5.5.0', - ), - 'comment_whitelist' => array( - 'alt' => 'comment_previously_approved', - 'version' => '5.5.0', - ), - ), - ), - ), - 'register_setting' => array( - 1 => array( - 'name' => 'option_group', - 'values' => array( - 'misc' => array( - 'alt' => 'another settings group', - 'version' => '3.0.0', - ), - 'privacy' => array( - 'alt' => 'another settings group', - 'version' => '3.5.0', - ), - ), - ), - ), - 'unregister_setting' => array( - 1 => array( - 'name' => 'option_group', - 'values' => array( - 'misc' => array( - 'alt' => 'another settings group', - 'version' => '3.0.0', - ), - 'privacy' => array( - 'alt' => 'another settings group', - 'version' => '3.5.0', - ), - ), - ), - ), - 'update_option' => array( - 1 => array( - 'name' => 'option', - 'values' => array( - 'blacklist_keys' => array( - 'alt' => 'disallowed_keys', - 'version' => '5.5.0', - ), - 'comment_whitelist' => array( - 'alt' => 'comment_previously_approved', - 'version' => '5.5.0', - ), - ), - ), - ), - ); - - /** - * Process the parameters of a matched function. - * - * @since 1.0.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - $this->set_minimum_wp_version(); - - foreach ( $this->target_functions[ $matched_content ] as $position => $parameter_args ) { - $found_param = PassedParameters::getParameterFromStack( $parameters, $position, $parameter_args['name'] ); - - // Skip if the parameter was not found. - if ( false === $found_param ) { - continue; - } - - $this->process_parameter( $matched_content, $found_param, $parameter_args['values'] ); - } - } - - /** - * Process the parameter of a matched function. - * - * @since 1.0.0 - * - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameter Array with start and end token positon of the parameter. - * @param array $parameter_args Array with alternative and WordPress deprecation version of the parameter. - * - * @return void - */ - protected function process_parameter( $matched_content, $parameter, $parameter_args ) { - - $parameter_position = $this->phpcsFile->findNext( - Tokens::$emptyTokens, - $parameter['start'], - $parameter['end'] + 1, - true - ); - - if ( false === $parameter_position ) { - return; - } - - $matched_parameter = TextStrings::stripQuotes( $this->tokens[ $parameter_position ]['content'] ); - if ( ! isset( $parameter_args[ $matched_parameter ] ) ) { - return; - } - - $message = 'The parameter value "%s" has been deprecated since WordPress version %s.'; - $data = array( - $matched_parameter, - $parameter_args[ $matched_parameter ]['version'], - ); - - if ( ! empty( $parameter_args[ $matched_parameter ]['alt'] ) ) { - $message .= ' Use %s instead.'; - $data[] = $parameter_args[ $matched_parameter ]['alt']; - } - - $is_error = $this->wp_version_compare( $parameter_args[ $matched_parameter ]['version'], $this->minimum_wp_version, '<' ); - MessageHelper::addMessage( - $this->phpcsFile, - $message, - $parameter_position, - $is_error, - 'Found', - $data - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php deleted file mode 100644 index 2675ecfa..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php +++ /dev/null @@ -1,509 +0,0 @@ - value - * in a custom ruleset. - * - * @uses \WordPressCS\WordPress\Helpers\MinimumWPVersionTrait::$minimum_wp_version - */ -final class DeprecatedParametersSniff extends AbstractFunctionParameterSniff { - - use MinimumWPVersionTrait; - - /** - * The group name for this group of functions. - * - * @since 0.12.0 - * - * @var string - */ - protected $group_name = 'wp_deprecated_parameters'; - - /** - * Array of function, argument, and default value for deprecated argument. - * - * The functions are ordered alphabetically. - * Last updated for WordPress 6.3. - * - * @since 0.12.0 - * - * @var array Multidimensional array with parameter details. - * $target_functions = array( - * (string) Function name. => array( - * (int) Target parameter position, 1-based. => array( - * 'name' => (string|array) Parameter name or list of names if the parameter - * was renamed since the release of PHP 8.0. - * 'value' => (mixed) Expected default value for the deprecated parameter. - * Currently the default values: true, false, null, empty arrays - * and both empty and non-empty strings can be handled correctly - * by the process_parameters() method. - * When an additional default value is added, the relevant code - * in the process_parameters() method will need to be adjusted. - * 'version' => (int) The WordPress version when deprecated. - * ) - * ) - * ); - */ - protected $target_functions = array( - '_future_post_hook' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '2.3.0', - ), - ), - '_load_remote_block_patterns' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '5.9.0', - ), - ), - '_wp_post_revision_fields' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => false, - 'version' => '4.5.0', - ), - ), - 'add_option' => array( - 3 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.3.0', - ), - ), - 'comments_link' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '0.72', - ), - 2 => array( - 'name' => 'deprecated_2', - 'value' => '', - 'version' => '1.3.0', - ), - ), - 'convert_chars' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '0.71', - ), - ), - 'delete_plugins' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '4.0.0', - ), - ), - 'discover_pingback_server_uri' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.7.0', - ), - ), - 'get_blog_list' => array( - 3 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '3.0.0', // Was previously part of MU. - ), - ), - 'get_category_parents' => array( - 5 => array( - 'name' => 'deprecated', - 'value' => array(), - 'version' => '4.8.0', - ), - ), - 'get_delete_post_link' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '3.0.0', - ), - ), - 'get_last_updated' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '3.0.0', // Was previously part of MU. - ), - ), - 'get_site_option' => array( - 3 => array( - 'name' => 'deprecated', - 'value' => true, - 'version' => '4.4.0', - ), - ), - 'get_terms' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '4.5.0', - ), - ), - 'get_the_author' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.1.0', - ), - ), - 'get_user_option' => array( - 3 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '3.0.0', - ), - ), - 'get_wp_title_rss' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '–', - 'version' => '4.4.0', - ), - ), - 'global_terms' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '6.1.0', - ), - ), - 'iframe_header' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => false, - 'version' => '4.2.0', - ), - ), - 'install_search_form' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => true, - 'version' => '4.6.0', - ), - ), - 'is_email' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => false, - 'version' => '3.0.0', - ), - ), - 'load_plugin_textdomain' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => false, - 'version' => '2.7.0', - ), - ), - 'newblog_notify_siteadmin' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '3.0.0', - ), - ), - 'permalink_single_rss' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.3.0', - ), - ), - 'redirect_this_site' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '3.0.0', - ), - ), - 'register_meta' => array( - 4 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '4.6.0', - ), - ), - 'safecss_filter_attr' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.8.1', - ), - ), - 'switch_to_blog' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '3.5.0', // Was previously part of MU. - ), - ), - 'term_description' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '4.9.2', - ), - ), - 'the_attachment_link' => array( - 3 => array( - 'name' => 'deprecated', - 'value' => false, - 'version' => '2.5.0', - ), - ), - 'the_author' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.1.0', - ), - 2 => array( - 'name' => 'deprecated_echo', - 'value' => true, - 'version' => '1.5.0', - ), - ), - 'the_author_posts_link' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.1.0', - ), - ), - 'trackback_rdf' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.5.0', - ), - ), - 'trackback_url' => array( - 1 => array( - 'name' => 'deprecated_echo', - 'value' => true, - 'version' => '2.5.0', - ), - ), - 'unregister_setting' => array( - 3 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '4.7.0', - ), - ), - 'update_blog_option' => array( - 4 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '3.1.0', - ), - ), - 'update_blog_status' => array( - 4 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '3.1.0', - ), - ), - 'update_posts_count' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '3.0.0', - ), - ), - 'update_user_status' => array( - 4 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '3.0.2', - ), - ), - 'wp_count_terms' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '5.6.0', - ), - ), - 'wp_create_thumbnail' => array( - 3 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '3.5.0', - ), - ), - 'wp_get_http_headers' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => false, - 'version' => '2.7.0', - ), - ), - 'wp_get_sidebars_widgets' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => true, - 'version' => '2.8.1', - ), - ), - 'wp_install' => array( - 5 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.6.0', - ), - ), - 'wp_login' => array( - 3 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.5.0', - ), - ), - 'wp_new_user_notification' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '4.3.1', - ), - ), - 'wp_notify_postauthor' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '3.8.0', - ), - ), - 'wp_title_rss' => array( - 1 => array( - 'name' => 'deprecated', - 'value' => '–', - 'version' => '4.4.0', - ), - ), - 'wp_upload_bits' => array( - 2 => array( - 'name' => 'deprecated', - 'value' => null, - 'version' => '2.0.0', - ), - ), - 'xfn_check' => array( - 3 => array( - 'name' => 'deprecated', - 'value' => '', - 'version' => '2.5.0', - ), - ), - ); - - /** - * Process the parameters of a matched function. - * - * @since 0.12.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - - $this->set_minimum_wp_version(); - - $paramCount = \count( $parameters ); - foreach ( $this->target_functions[ $matched_content ] as $position => $parameter_args ) { - - $found_param = PassedParameters::getParameterFromStack( $parameters, $position, $parameter_args['name'] ); - if ( false === $found_param ) { - continue; - } - - // The list will need to updated if the default value is not supported. - switch ( $found_param['raw'] ) { - case 'true': - $matched_parameter = true; - break; - case 'false': - $matched_parameter = false; - break; - case 'null': - $matched_parameter = null; - break; - case 'array()': - case '[]': - $matched_parameter = array(); - break; - default: - $matched_parameter = TextStrings::stripQuotes( $found_param['raw'] ); - break; - } - - if ( $parameter_args['value'] === $matched_parameter ) { - continue; - } - - $message = 'The parameter "%s" at position #%s of %s() has been deprecated since WordPress version %s.'; - $is_error = $this->wp_version_compare( $parameter_args['version'], $this->minimum_wp_version, '<' ); - $code = MessageHelper::stringToErrorcode( ucfirst( $matched_content ) . 'Param' . $position . 'Found' ); - - $data = array( - $found_param['raw'], - $position, - $matched_content, - $parameter_args['version'], - ); - - if ( isset( $parameter_args['value'] ) - && isset( $found_param['name'] ) === false - && $position < $paramCount - ) { - $message .= ' Use "%s" instead.'; - $data[] = (string) $parameter_args['value']; - } else { - $message .= ' Instead do not pass the parameter.'; - } - - MessageHelper::addMessage( $this->phpcsFile, $message, $stackPtr, $is_error, $code, $data, 0 ); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php deleted file mode 100644 index 7db5a378..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php +++ /dev/null @@ -1,160 +0,0 @@ - 'get_stylesheet_directory()', - 'TEMPLATEPATH' => 'get_template_directory()', - 'PLUGINDIR' => 'WP_PLUGIN_DIR', - 'MUPLUGINDIR' => 'WPMU_PLUGIN_DIR', - 'HEADER_IMAGE' => 'add_theme_support( \'custom-header\' )', - 'NO_HEADER_TEXT' => 'add_theme_support( \'custom-header\' )', - 'HEADER_TEXTCOLOR' => 'add_theme_support( \'custom-header\' )', - 'HEADER_IMAGE_WIDTH' => 'add_theme_support( \'custom-header\' )', - 'HEADER_IMAGE_HEIGHT' => 'add_theme_support( \'custom-header\' )', - 'BACKGROUND_COLOR' => 'add_theme_support( \'custom-background\' )', - 'BACKGROUND_IMAGE' => 'add_theme_support( \'custom-background\' )', - ); - - /** - * Array of functions to check. - * - * @since 0.14.0 - * @since 3.0.0 The format of the value has changed from an integer parameter - * position to an array with the parameter position and name. - * - * @var array> Function name as key, array with target - * parameter and name as value. - */ - protected $target_functions = array( - 'define' => array( - 'position' => 1, - 'name' => 'constant_name', - ), - ); - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 0.14.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - if ( isset( $this->target_functions[ strtolower( $this->tokens[ $stackPtr ]['content'] ) ] ) ) { - // Disallow excluding function groups for this sniff. - $this->exclude = array(); - - return parent::process_token( $stackPtr ); - - } else { - return $this->process_arbitrary_tstring( $stackPtr ); - } - } - - /** - * Process an arbitrary T_STRING token to determine whether it is one of the target constants. - * - * @since 0.14.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function process_arbitrary_tstring( $stackPtr ) { - $content = $this->tokens[ $stackPtr ]['content']; - - if ( ! isset( $this->discouraged_constants[ $content ] ) ) { - return; - } - - if ( ConstantsHelper::is_use_of_global_constant( $this->phpcsFile, $stackPtr ) === false ) { - return; - } - - $this->phpcsFile->addWarning( - 'Found usage of constant "%s". Use %s instead.', - $stackPtr, - MessageHelper::stringToErrorcode( $content . 'UsageFound' ), - array( - $content, - $this->discouraged_constants[ $content ], - ) - ); - } - - /** - * Process the parameters of a matched `define` function call. - * - * @since 0.14.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - $target_param = $this->target_functions[ $matched_content ]; - - // Was the target parameter passed ? - $found_param = PassedParameters::getParameterFromStack( $parameters, $target_param['position'], $target_param['name'] ); - if ( false === $found_param ) { - return; - } - - $clean_content = TextStrings::stripQuotes( $found_param['clean'] ); - - if ( isset( $this->discouraged_constants[ $clean_content ] ) ) { - $first_non_empty = $this->phpcsFile->findNext( - Tokens::$emptyTokens, - $found_param['start'], - ( $found_param['end'] + 1 ), - true - ); - - $this->phpcsFile->addWarning( - 'Found declaration of constant "%s". Use %s instead.', - $first_non_empty, - MessageHelper::stringToErrorcode( $clean_content . 'DeclarationFound' ), - array( - $clean_content, - $this->discouraged_constants[ $clean_content ], - ) - ); - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php deleted file mode 100644 index 941b992b..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php +++ /dev/null @@ -1,54 +0,0 @@ - array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - 'query_posts' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged. Use WP_Query instead.', - 'functions' => array( - 'query_posts', - ), - ), - - 'wp_reset_query' => array( - 'type' => 'warning', - 'message' => '%s() is discouraged. Use wp_reset_postdata() instead.', - 'functions' => array( - 'wp_reset_query', - ), - ), - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php deleted file mode 100644 index 6e4385a9..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php +++ /dev/null @@ -1,241 +0,0 @@ - Key is function name, value irrelevant. - */ - protected $target_functions = array( - 'wp_register_script' => true, - 'wp_enqueue_script' => true, - 'wp_register_style' => true, - 'wp_enqueue_style' => true, - ); - - /** - * False + the empty tokens array. - * - * This array is enriched with the $emptyTokens array in the register() method. - * - * @var array - */ - private $false_tokens = array( - \T_FALSE => \T_FALSE, - ); - - /** - * Token codes which are "safe" to accept to determine whether a version would evaluate to `false`. - * - * This array is enriched with the several of the PHPCS token arrays in the register() method. - * - * @var array - */ - private $safe_tokens = array( - \T_NULL => \T_NULL, - \T_FALSE => \T_FALSE, - \T_TRUE => \T_TRUE, - \T_LNUMBER => \T_LNUMBER, - \T_DNUMBER => \T_DNUMBER, - \T_CONSTANT_ENCAPSED_STRING => \T_CONSTANT_ENCAPSED_STRING, - \T_START_NOWDOC => \T_START_NOWDOC, - \T_NOWDOC => \T_NOWDOC, - \T_END_NOWDOC => \T_END_NOWDOC, - \T_OPEN_PARENTHESIS => \T_OPEN_PARENTHESIS, - \T_CLOSE_PARENTHESIS => \T_CLOSE_PARENTHESIS, - \T_STRING_CONCAT => \T_STRING_CONCAT, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * Overloads and calls the parent method to allow for adding additional tokens to the $safe_tokens property. - * - * @return array - */ - public function register() { - $this->false_tokens += Tokens::$emptyTokens; - - $this->safe_tokens += Tokens::$emptyTokens; - $this->safe_tokens += Tokens::$assignmentTokens; - $this->safe_tokens += Tokens::$comparisonTokens; - $this->safe_tokens += Tokens::$operators; - $this->safe_tokens += Tokens::$booleanOperators; - $this->safe_tokens += Tokens::$castTokens; - - return parent::register(); - } - - /** - * Process the parameters of a matched function. - * - * @since 1.0.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - // Check to see if a source ($src) is specified. - $src_param = PassedParameters::getParameterFromStack( $parameters, 2, 'src' ); - if ( false === $src_param ) { - return; - } - - /* - * Version Check: Check to make sure the version is set explicitly. - */ - - $version_param = PassedParameters::getParameterFromStack( $parameters, 4, 'ver' ); - - $error_ptr = $stackPtr; - if ( false !== $version_param ) { - $error_ptr = $this->phpcsFile->findNext( Tokens::$emptyTokens, $version_param['start'], ( $version_param['end'] + 1 ), true ); - if ( false === $error_ptr ) { - $error_ptr = $version_param['start']; - } - } - - if ( false === $version_param || 'null' === $version_param['clean'] ) { - $type = 'script'; - if ( strpos( $matched_content, '_style' ) !== false ) { - $type = 'style'; - } - - $this->phpcsFile->addWarning( - 'Resource version not set in call to %s(). This means new versions of the %s may not always be loaded due to browser caching.', - $error_ptr, - 'MissingVersion', - array( $matched_content, $type ) - ); - // The version argument should have a non-false value. - } elseif ( $this->is_falsy( $version_param['start'], $version_param['end'] ) ) { - $this->phpcsFile->addError( - 'Version parameter is not explicitly set or has been set to an equivalent of "false" for %s; ' . - 'This means that the WordPress core version will be used which is not recommended for plugin or theme development.', - $error_ptr, - 'NoExplicitVersion', - array( $matched_content ) - ); - } - - /* - * In footer Check - * - * Check to make sure that $in_footer is set to true. - * It will warn the user to make sure it is intended. - * - * Only wp_register_script and wp_enqueue_script need this check, - * as this parameter is not available to wp_register_style and wp_enqueue_style. - */ - if ( 'wp_register_script' !== $matched_content && 'wp_enqueue_script' !== $matched_content ) { - return; - } - - $infooter_param = PassedParameters::getParameterFromStack( $parameters, 5, 'in_footer' ); - if ( false === $infooter_param ) { - // If in footer is not set, throw a warning about the default. - $this->phpcsFile->addWarning( - 'In footer ($in_footer) is not set explicitly %s; ' . - 'It is recommended to load scripts in the footer. Please set this value to `true` to load it in the footer, or explicitly `false` if it should be loaded in the header.', - $stackPtr, - 'NotInFooter', - array( $matched_content ) - ); - } - } - - /** - * Determine if a range has a falsy value. - * - * @param int $start The position to start looking from. - * @param int $end The position to stop looking (inclusive). - * - * @return bool True if the parameter is falsy. - * False if the parameter is not falsy or when it - * couldn't be reliably determined. - */ - protected function is_falsy( $start, $end ) { - - // Find anything excluding the false tokens. - $has_non_false = $this->phpcsFile->findNext( $this->false_tokens, $start, ( $end + 1 ), true ); - // If no non-false tokens are found, we are good. - if ( false === $has_non_false ) { - return true; - } - - $code_string = ''; - for ( $i = $start; $i <= $end; $i++ ) { - if ( isset( $this->safe_tokens[ $this->tokens[ $i ]['code'] ] ) === false ) { - // Function call/variable or other token which makes it neigh impossible - // to determine whether the actual value would evaluate to false. - return false; - } - - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) === true ) { - continue; - } - - // Make sure that PHP 7.4 numeric literals and PHP 8.1 explicit octals don't cause problems. - if ( \T_LNUMBER === $this->tokens[ $i ]['code'] || \T_DNUMBER === $this->tokens[ $i ]['code'] ) { - $number_info = Numbers::getCompleteNumber( $this->phpcsFile, $i ); - $code_string .= $number_info['decimal']; - $i = $number_info['last_token']; - continue; - } - - $code_string .= $this->tokens[ $i ]['content']; - } - - if ( '' === $code_string ) { - return false; - } - - // Evaluate the argument to figure out the outcome is false or not. - // phpcs:ignore Squiz.PHP.Eval -- No harm here. - return ( false === eval( "return (bool) $code_string;" ) ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php deleted file mode 100644 index c7ed63c3..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php +++ /dev/null @@ -1,108 +0,0 @@ -tokens[ $stackPtr ]['content']; - if ( \T_INLINE_HTML !== $this->tokens[ $stackPtr ]['code'] ) { - try { - $end_ptr = TextStrings::getEndOfCompleteTextString( $this->phpcsFile, $stackPtr ); - $content = TextStrings::getCompleteTextString( $this->phpcsFile, $stackPtr ); - } catch ( RuntimeException $e ) { - // Parse error/live coding. - return; - } - } - - if ( preg_match_all( '# rel=\\\\?[\'"]?stylesheet\\\\?[\'"]?#', $content, $matches, \PREG_OFFSET_CAPTURE ) > 0 ) { - foreach ( $matches[0] as $match ) { - $this->phpcsFile->addError( - 'Stylesheets must be registered/enqueued via wp_enqueue_style()', - $this->find_token_in_multiline_string( $stackPtr, $content, $match[1] ), - 'NonEnqueuedStylesheet' - ); - } - } - - if ( preg_match_all( '#]*(?<=src=)#', $content, $matches, \PREG_OFFSET_CAPTURE ) > 0 ) { - foreach ( $matches[0] as $match ) { - $this->phpcsFile->addError( - 'Scripts must be registered/enqueued via wp_enqueue_script()', - $this->find_token_in_multiline_string( $stackPtr, $content, $match[1] ), - 'NonEnqueuedScript' - ); - } - } - - return ( $end_ptr + 1 ); - } - - /** - * Find the exact token on which the error should be reported for multi-line strings. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $content The complete, potentially multi-line, text string. - * @param int $match_offset The offset within the content at which the match was found. - * - * @return int The stack pointer to the token containing the start of the match. - */ - private function find_token_in_multiline_string( $stackPtr, $content, $match_offset ) { - $newline_count = 0; - if ( $match_offset > 0 ) { - $newline_count = substr_count( $content, "\n", 0, $match_offset ); - } - - // Account for heredoc/nowdoc text starting at the token *after* the opener. - if ( isset( Tokens::$heredocTokens[ $this->tokens[ $stackPtr ]['code'] ] ) === true ) { - ++$newline_count; - } - - return ( $stackPtr + $newline_count ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php deleted file mode 100644 index 038aba6a..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php +++ /dev/null @@ -1,436 +0,0 @@ - Key is variable name, value irrelevant. - */ - protected $override_allowed = array( - 'content_width' => true, - 'wp_cockneyreplace' => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 0.3.0 - * @since 1.1.0 Added class tokens for improved test classes skipping. - * - * @return array - */ - public function register() { - $targets = array( - \T_GLOBAL, - \T_VARIABLE, - ); - $targets += Collections::listOpenTokensBC(); - - // Only used to skip over test classes. - $targets += Tokens::$ooScopeTokens; - - return $targets; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 0.3.0 - * @since 1.1.0 Split the token specific logic off into separate methods. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process_token( $stackPtr ) { - - $token = $this->tokens[ $stackPtr ]; - - // Ignore variable overrides in test classes. - if ( isset( Tokens::$ooScopeTokens[ $token['code'] ] ) ) { - - if ( true === $this->is_test_class( $this->phpcsFile, $stackPtr ) - && $token['scope_condition'] === $stackPtr - && isset( $token['scope_closer'] ) - ) { - // Skip forward to end of test class. - return $token['scope_closer']; - } - - // Otherwise ignore the tokens as they were only registered to enable skipping over test classes. - return; - } - - /* - * Examine variables within a function scope based on a `global` statement in the - * function. - * Examine variables not within a function scope, but within a list construct, based - * on that. - * Examine variables not within a function scope and access to the `$GLOBALS` - * variable based on the variable token. - * - * Note: No special handling here for code found within PHP 7.4+ arrow functions. - * Arrow functions are "open", i.e. they have by value access to variables in the - * surrounding scope, but they cannot modify the value. - * Additionally, as they can only have one statement, a `global` statement _within_ - * an arrow function declaration will lead to a parse error as the result is - * not a returnable value. - */ - $in_function_scope = Conditions::hasCondition( $this->phpcsFile, $stackPtr, array( \T_FUNCTION, \T_CLOSURE ) ); - - if ( isset( Collections::listOpenTokensBC()[ $token['code'] ] ) - && false === $in_function_scope - && false === $this->treat_files_as_scoped - ) { - return $this->process_list_assignment( $stackPtr ); - } elseif ( \T_VARIABLE === $token['code'] - && ( '$GLOBALS' === $token['content'] - || ( false === $in_function_scope && false === $this->treat_files_as_scoped ) ) - ) { - return $this->process_variable_assignment( $stackPtr ); - } elseif ( \T_GLOBAL === $token['code'] - && ( true === $in_function_scope || true === $this->treat_files_as_scoped ) - ) { - return $this->process_global_statement( $stackPtr, $in_function_scope ); - } - } - - /** - * Check that global variables declared via a list construct are prefixed. - * - * {@internal No need to take special measures for nested lists. Nested or not, - * each list part can only contain one variable being written to.} - * - * @since 2.2.0 - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - protected function process_list_assignment( $stackPtr ) { - $list_open_close = Lists::getOpenClose( $this->phpcsFile, $stackPtr ); - if ( false === $list_open_close ) { - // Short array, not short list. - return; - } - - $var_pointers = ListHelper::get_list_variables( $this->phpcsFile, $stackPtr ); - foreach ( $var_pointers as $ptr ) { - $this->process_variable_assignment( $ptr, true ); - } - - // No need to re-examine these variables. - return $list_open_close['closer']; - } - - /** - * Check that defined global variables are prefixed. - * - * @since 1.1.0 Logic was previously contained in the process_token() method. - * - * @param int $stackPtr The position of the current token in the stack. - * @param bool $in_list Whether or not this is a variable in a list assignment. - * Defaults to false. - * - * @return void - */ - protected function process_variable_assignment( $stackPtr, $in_list = false ) { - - $token = $this->tokens[ $stackPtr ]; - $var_name = substr( $token['content'], 1 ); // Strip the dollar sign. - $data = array(); - - // Determine the variable name for `$GLOBALS['array_key']`. - if ( 'GLOBALS' === $var_name ) { - $bracketPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - - if ( false === $bracketPtr - || \T_OPEN_SQUARE_BRACKET !== $this->tokens[ $bracketPtr ]['code'] - || ! isset( $this->tokens[ $bracketPtr ]['bracket_closer'] ) - ) { - return; - } - - // Retrieve the array key and avoid getting tripped up by some simple obfuscation. - $var_name = ''; - $start = ( $bracketPtr + 1 ); - for ( $ptr = $start; $ptr < $this->tokens[ $bracketPtr ]['bracket_closer']; $ptr++ ) { - /* - * If the globals array key contains a variable, constant, function call - * or interpolated variable, bow out. - */ - if ( \T_VARIABLE === $this->tokens[ $ptr ]['code'] - || \T_STRING === $this->tokens[ $ptr ]['code'] - || \T_DOUBLE_QUOTED_STRING === $this->tokens[ $ptr ]['code'] - ) { - return; - } - - if ( \T_CONSTANT_ENCAPSED_STRING === $this->tokens[ $ptr ]['code'] ) { - $var_name .= TextStrings::stripQuotes( $this->tokens[ $ptr ]['content'] ); - } - } - - if ( '' === $var_name ) { - // Shouldn't happen, but just in case. - return; - } - - // Set up the data for the error message. - $data[] = '$GLOBALS[\'' . $var_name . '\']'; - } - - /* - * Is this one of the WP global variables ? - */ - if ( WPGlobalVariablesHelper::is_wp_global( $var_name ) === false ) { - return; - } - - /* - * Is this one of the WP global variables which are allowed to be overwritten ? - */ - if ( isset( $this->override_allowed[ $var_name ] ) === true ) { - return; - } - - /* - * Check if the variable value is being changed. - */ - if ( false === $in_list - && false === VariableHelper::is_assignment( $this->phpcsFile, $stackPtr ) - && Context::inForeachCondition( $this->phpcsFile, $stackPtr ) !== 'afterAs' - ) { - return; - } - - /* - * Function parameters with the same name as a WP global variable are fine, - * including when they are being assigned a default value. - */ - if ( false === $in_list ) { - $functionPtr = Parentheses::getLastOwner( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); - if ( false !== $functionPtr ) { - return; - } - - unset( $functionPtr ); - } - - /* - * Class property declarations with the same name as WP global variables are fine. - */ - if ( false === $in_list && true === Scopes::isOOProperty( $this->phpcsFile, $stackPtr ) ) { - return; - } - - // Still here ? In that case, the WP global variable is being tampered with. - $this->add_error( $stackPtr, $data ); - } - - /** - * Check that global variables imported into a function scope using a global statement - * are not being overruled. - * - * @since 1.1.0 Logic was previously contained in the process_token() method. - * - * @param int $stackPtr The position of the current token in the stack. - * @param bool $in_function_scope Whether the global statement is within a scoped function/closure. - * - * @return void - */ - protected function process_global_statement( $stackPtr, $in_function_scope ) { - /* - * Collect the variables to watch for. - */ - $search = array(); - $ptr = ( $stackPtr + 1 ); - $end_of_statement = $this->phpcsFile->findNext( array( \T_SEMICOLON, \T_CLOSE_TAG ), $ptr ); - - while ( isset( $this->tokens[ $ptr ] ) && $ptr < $end_of_statement ) { - if ( \T_VARIABLE === $this->tokens[ $ptr ]['code'] ) { - $var_name = substr( $this->tokens[ $ptr ]['content'], 1 ); - if ( WPGlobalVariablesHelper::is_wp_global( $var_name ) - && isset( $this->override_allowed[ $var_name ] ) === false - ) { - $search[ $this->tokens[ $ptr ]['content'] ] = true; - } - } - - ++$ptr; - } - - if ( empty( $search ) ) { - return; - } - - /* - * Search for assignments to the imported global variables within the relevant scope. - */ - $start = $ptr; - if ( true === $in_function_scope ) { - $functionPtr = Conditions::getLastCondition( $this->phpcsFile, $stackPtr, Collections::functionDeclarationTokens() ); - if ( isset( $this->tokens[ $functionPtr ]['scope_closer'] ) === false ) { - // Live coding or parse error. - return; - } - $end = $this->tokens[ $functionPtr ]['scope_closer']; - } else { - // Global statement in the global namespace in a file which is being treated as scoped. - $end = $this->phpcsFile->numTokens; - } - - for ( $ptr = $start; $ptr < $end; $ptr++ ) { - - // Skip over nested functions, classes and the likes. - if ( isset( Collections::closedScopes()[ $this->tokens[ $ptr ]['code'] ] ) ) { - if ( ! isset( $this->tokens[ $ptr ]['scope_closer'] ) ) { - // Live coding or parse error. - break; - } - - $ptr = $this->tokens[ $ptr ]['scope_closer']; - continue; - } - - // Make sure to recognize assignments to variables in a list construct. - if ( isset( Collections::listOpenTokensBC()[ $this->tokens[ $ptr ]['code'] ] ) ) { - $list_open_close = Lists::getOpenClose( $this->phpcsFile, $ptr ); - - if ( false === $list_open_close ) { - // Short array, not short list. - continue; - } - - $var_pointers = ListHelper::get_list_variables( $this->phpcsFile, $ptr ); - foreach ( $var_pointers as $ptr ) { - $var_name = $this->tokens[ $ptr ]['content']; - if ( '$GLOBALS' === $var_name ) { - $var_name = '$' . TextStrings::stripQuotes( VariableHelper::get_array_access_key( $this->phpcsFile, $ptr ) ); - } - - if ( isset( $search[ $var_name ] ) ) { - $this->process_variable_assignment( $ptr, true ); - } - } - - // No need to re-examine these variables. - $ptr = $list_open_close['closer']; - continue; - } - - if ( \T_VARIABLE !== $this->tokens[ $ptr ]['code'] ) { - continue; - } - - if ( isset( $search[ $this->tokens[ $ptr ]['content'] ] ) === false ) { - // Not one of the variables we're interested in. - continue; - } - - // Don't throw false positives for static class properties. - if ( ContextHelper::has_object_operator_before( $this->phpcsFile, $ptr ) === true ) { - continue; - } - - if ( true === VariableHelper::is_assignment( $this->phpcsFile, $ptr ) ) { - $this->add_error( $ptr ); - continue; - } - - // Check if this is a variable assignment within a `foreach()` declaration. - if ( Context::inForeachCondition( $this->phpcsFile, $ptr ) === 'afterAs' ) { - $this->add_error( $ptr ); - } - } - } - - /** - * Add the error. - * - * @since 1.1.0 - * - * @param int $stackPtr The position of the token to throw the error for. - * @param array $data Optional. Array containing one entry holding the - * name of the variable being overruled. - * Defaults to the 'content' of the $stackPtr token. - * - * @return void - */ - protected function add_error( $stackPtr, $data = array() ) { - if ( empty( $data ) ) { - $data[] = $this->tokens[ $stackPtr ]['content']; - } - - $this->phpcsFile->addError( - 'Overriding WordPress globals is prohibited. Found assignment to %s', - $stackPtr, - 'Prohibited', - $data - ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php deleted file mode 100644 index ab857bec..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php +++ /dev/null @@ -1,977 +0,0 @@ - Key is function name, value is the function type. - */ - protected $i18n_functions = array( - 'translate' => 'simple', - '__' => 'simple', - 'esc_attr__' => 'simple', - 'esc_html__' => 'simple', - '_e' => 'simple', - 'esc_attr_e' => 'simple', - 'esc_html_e' => 'simple', - 'translate_with_gettext_context' => 'context', - '_x' => 'context', - '_ex' => 'context', - 'esc_attr_x' => 'context', - 'esc_html_x' => 'context', - '_n' => 'number', - '_nx' => 'number_context', - '_n_noop' => 'noopnumber', - '_nx_noop' => 'noopnumber_context', - ); - - /** - * Whether or not the `default` text domain is one of the allowed text domains. - * - * @since 0.14.0 - * - * @var bool - */ - private $text_domain_contains_default = false; - - /** - * Whether or not the `default` text domain is the only allowed text domain. - * - * @since 0.14.0 - * - * @var bool - */ - private $text_domain_is_default = false; - - /** - * Parameter specifications for the functions in each group. - * - * {@internal Even when not all parameters will be examined, the parameter list should still - * be complete in the below array to allow for a correct "total parameters" calculation.} - * - * @since 3.0.0 - * - * @var array Array of the parameter positions and names. - */ - private $parameter_specs = array( - 'simple' => array( - 1 => 'text', - 2 => 'domain', - ), - 'context' => array( - 1 => 'text', - 2 => 'context', - 3 => 'domain', - ), - 'number' => array( - 1 => 'single', - 2 => 'plural', - 3 => 'number', - 4 => 'domain', - ), - 'number_context' => array( - 1 => 'single', - 2 => 'plural', - 3 => 'number', - 4 => 'context', - 5 => 'domain', - ), - 'noopnumber' => array( - 1 => 'singular', - 2 => 'plural', - 3 => 'domain', - ), - 'noopnumber_context' => array( - 1 => 'singular', - 2 => 'plural', - 3 => 'context', - 4 => 'domain', - ), - ); - - /** - * Groups of functions to restrict. - * - * Example: groups => array( - * 'lambda' => array( - * 'type' => 'error' | 'warning', - * 'message' => 'Use anonymous functions instead please!', - * 'functions' => array( 'file_get_contents', 'create_function' ), - * ) - * ) - * - * @return array - */ - public function getGroups() { - return array( - 'i18n' => array( - 'functions' => array_keys( $this->i18n_functions ), - ), - 'typos' => array( - 'functions' => array( - '_', - ), - ), - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 1.0.0 Defers to the abstractFunctionRestriction sniff for determining - * whether something is a function call. The logic after that has - * been split off to the `process_matched_token()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function process_token( $stackPtr ) { - - // Reset defaults. - $this->text_domain_contains_default = false; - $this->text_domain_is_default = false; - - // Allow overruling the text_domain set in a ruleset via the command line. - $cl_text_domain = Helper::getConfigData( 'text_domain' ); - if ( ! empty( $cl_text_domain ) ) { - $cl_text_domain = trim( $cl_text_domain ); - if ( '' !== $cl_text_domain ) { - $this->text_domain = array_filter( array_map( 'trim', explode( ',', $cl_text_domain ) ) ); - } - } - - $this->text_domain = RulesetPropertyHelper::merge_custom_array( $this->text_domain, array(), false ); - - if ( ! empty( $this->text_domain ) ) { - if ( \in_array( 'default', $this->text_domain, true ) ) { - $this->text_domain_contains_default = true; - if ( \count( $this->text_domain ) === 1 ) { - $this->text_domain_is_default = true; - } - } - } - - // Prevent exclusion of the i18n group. - $this->exclude = array(); - - parent::process_token( $stackPtr ); - } - - /** - * Process a matched token. - * - * @since 1.0.0 Logic split off from the `process_token()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * - * @return void - */ - public function process_matched_token( $stackPtr, $group_name, $matched_content ) { - - $func_open_paren_token = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( ! isset( $this->tokens[ $func_open_paren_token ]['parenthesis_closer'] ) ) { - // Live coding, parse error or not a function call. - return; - } - - if ( 'typos' === $group_name && '_' === $matched_content ) { - $this->phpcsFile->addError( - 'Found single-underscore "_()" function when double-underscore expected.', - $stackPtr, - 'SingleUnderscoreGetTextFunction' - ); - return; - } - - if ( 'translate' === $matched_content || 'translate_with_gettext_context' === $matched_content ) { - $this->phpcsFile->addWarning( - 'Use of the "%s()" function is reserved for low-level API usage.', - $stackPtr, - 'LowLevelTranslationFunction', - array( $matched_content ) - ); - } - - parent::process_matched_token( $stackPtr, $group_name, $matched_content ); - } - - /** - * Process the function if no parameters were found. - * - * @since 3.0.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * - * @return void - */ - public function process_no_parameters( $stackPtr, $group_name, $matched_content ) { - $function_param_specs = $this->parameter_specs[ $this->i18n_functions[ $matched_content ] ]; - - foreach ( $function_param_specs as $param_name ) { - $error_code = MessageHelper::stringToErrorcode( 'MissingArg' . ucfirst( $param_name ) ); - $this->phpcsFile->addError( - 'Missing $%s parameter in function call to %s().', - $stackPtr, - $error_code, - array( $param_name, $matched_content ) - ); - } - } - - /** - * Process the parameters of a matched function. - * - * @since 3.0.0 - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $group_name The name of the group which was matched. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) { - /* - * Retrieve the individual parameters from the array in a way that we know which is which. - */ - $parameter_details = array(); - - $function_param_specs = $this->parameter_specs[ $this->i18n_functions[ $matched_content ] ]; - $expected_args = count( $function_param_specs ); - - foreach ( $function_param_specs as $position => $name ) { - if ( 'number' === $name ) { - // This sniff does not examine the $number parameter. - continue; - } - - $parameter_details[ $name ] = PassedParameters::getParameterFromStack( $parameters, $position, $name ); - } - - /* - * Examine the individual parameters. - */ - $this->check_argument_count( $stackPtr, $matched_content, $parameters, $expected_args ); - - foreach ( $parameter_details as $param_name => $param_info ) { - $is_string_literal = $this->check_argument_is_string_literal( $stackPtr, $matched_content, $param_name, $param_info ); - - /* - * If the parameter exists, remember whether the argument was a valid string literal. - * This is used in a few places to determine whether the checks which examine a text string should run. - */ - if ( false !== $param_info ) { - $parameter_details[ $param_name ]['is_string_literal'] = $is_string_literal; - } - - if ( false === $is_string_literal ) { - continue; - } - - if ( 'domain' === $param_name ) { - $this->check_textdomain_matches( $matched_content, $param_name, $param_info ); - } - - if ( \in_array( $param_name, array( 'text', 'single', 'singular', 'plural' ), true ) ) { - $this->check_placeholders_in_string( $matched_content, $param_name, $param_info ); - $has_content = $this->check_string_has_translatable_content( $matched_content, $param_name, $param_info ); - if ( true === $has_content ) { - $this->check_string_has_no_html_wrapper( $matched_content, $param_name, $param_info ); - } - } - } - - /* - * For _n*() calls, compare the singular and plural strings. - * - * If either of the arguments is missing, empty or has more than 1 token, skip out. - * An error for that will already have been reported via the `check_argument_is_string_literal()` method. - */ - $single_details = null; - if ( isset( $parameter_details['single'] ) ) { - $single_details = $parameter_details['single']; - } elseif ( isset( $parameter_details['singular'] ) ) { - $single_details = $parameter_details['singular']; - } - - if ( isset( $single_details, $parameter_details['plural'] ) - && false !== $single_details - && false !== $parameter_details['plural'] - && true === $single_details['is_string_literal'] - && true === $parameter_details['plural']['is_string_literal'] - ) { - $this->compare_single_and_plural_arguments( $stackPtr, $single_details, $parameter_details['plural'] ); - } - - /* - * Check if a translators comments is necessary and if so, if it exists. - */ - $this->check_for_translator_comment( $stackPtr, $matched_content, $parameter_details ); - } - - /** - * Verify that there are no superfluous function arguments. - * - * @since 3.0.0 Check moved from the `process_matched_token()` method to this method. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters The parameters array. - * @param int $expected_count The expected number of passed arguments. - * - * @return void - */ - private function check_argument_count( $stackPtr, $matched_content, $parameters, $expected_count ) { - $actual_count = count( $parameters ); - if ( $actual_count > $expected_count ) { - $this->phpcsFile->addError( - 'Too many parameters passed to function "%s()". Expected: %s parameters, received: %s', - $stackPtr, - 'TooManyFunctionArgs', - array( $matched_content, $expected_count, $actual_count ) - ); - } - } - - /** - * Check if an arbitrary function call parameter is a text string literal suitable for use in the translation functions. - * - * Will also check and warn about missing parameters. - * - * @since 3.0.0 Most of the logic in this method used to be contained in the, now removed, `check_argument_tokens()` method. - * - * @param int $stackPtr The position of the current token in the stack. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param string $param_name The name of the parameter being examined. - * @param array|false $param_info Parameter info array for an individual parameter, - * as received from the PassedParemeters class. - * - * @return bool Whether or not the argument is a string literal. - */ - private function check_argument_is_string_literal( $stackPtr, $matched_content, $param_name, $param_info ) { - /* - * Check if the parameter was supplied. - */ - if ( false === $param_info || '' === $param_info['clean'] ) { - $error_code = MessageHelper::stringToErrorcode( 'MissingArg' . ucfirst( $param_name ) ); - - /* - * Special case the text domain parameter, which is allowed to be "missing" - * when set to `default` (= WP Core translation). - */ - if ( 'domain' === $param_name ) { - if ( empty( $this->text_domain ) ) { - // If no text domain is passed, presume WP Core. - return false; - } - - if ( true === $this->text_domain_is_default ) { - return false; - } - - if ( true === $this->text_domain_contains_default ) { - $this->phpcsFile->addWarning( - 'Missing $%s parameter in function call to %s(). If this text string is supposed to use a WP Core translation, use the "default" text domain.', - $stackPtr, - $error_code . 'Default', - array( $param_name, $matched_content ) - ); - return false; - } - } - - $this->phpcsFile->addError( - 'Missing $%s parameter in function call to %s().', - $stackPtr, - $error_code, - array( $param_name, $matched_content ) - ); - - return false; - } - - /* - * Check if the parameter consists of one singular text string literal. - * Heredoc/nowdocs not allowed. Multi-line single/double quoted strings are allowed. - */ - $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); - for ( $i = $first_non_empty; $i <= $param_info['end']; $i++ ) { - if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) { - continue; - } - - if ( isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) === false ) { - $error_code = MessageHelper::stringToErrorcode( 'NonSingularStringLiteral' . ucfirst( $param_name ) ); - $this->phpcsFile->addError( - 'The $%s parameter must be a single text string literal. Found: %s', - $first_non_empty, - $error_code, - array( $param_name, $param_info['clean'] ) - ); - return false; - } - } - - /* - * Make sure the text string does not contain any interpolated variable. - */ - if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $first_non_empty ]['code'] ) { - $error_code = MessageHelper::stringToErrorcode( 'InterpolatedVariable' . ucfirst( $param_name ) ); - - $interpolated_variables = TextStrings::getEmbeds( $param_info['clean'] ); - foreach ( $interpolated_variables as $interpolated_variable ) { - $this->phpcsFile->addError( - 'The $%s parameter must not contain interpolated variables or expressions. Found: %s', - $first_non_empty, - $error_code, - array( $param_name, $interpolated_variable ) - ); - } - - if ( ! empty( $interpolated_variables ) ) { - return false; - } - } - - return true; - } - - /** - * Check the correct text domain is being used. - * - * @since 3.0.0 The logic in this method used to be contained in the, now removed, `check_argument_tokens()` method. - * - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param string $param_name The name of the parameter being examined. - * @param array|false $param_info Parameter info array for an individual parameter, - * as received from the PassedParemeters class. - * - * @return void - */ - private function check_textdomain_matches( $matched_content, $param_name, $param_info ) { - $stripped_content = TextStrings::stripQuotes( $param_info['clean'] ); - - if ( empty( $this->text_domain ) && '' === $stripped_content ) { - $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); - - $this->phpcsFile->addError( - 'The passed $domain should never be an empty string. Either pass a text domain or remove the parameter.', - $first_non_empty, - 'EmptyTextDomain' - ); - } - - if ( empty( $this->text_domain ) ) { - // Nothing more to do, the other checks all depend on a text domain being known. - return; - } - - if ( ! \in_array( $stripped_content, $this->text_domain, true ) ) { - $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); - - $this->phpcsFile->addError( - 'Mismatched text domain. Expected \'%s\' but got %s.', - $first_non_empty, - 'TextDomainMismatch', - array( implode( "' or '", $this->text_domain ), $param_info['clean'] ) - ); - return; - } - - if ( true === $this->text_domain_is_default && 'default' === $stripped_content ) { - $fixable = false; - $error = 'No need to supply the text domain in function call to %s() when the only accepted text domain is "default".'; - $error_code = 'SuperfluousDefaultTextDomain'; - $data = array( $matched_content ); - - $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); - - // Prevent removing comments when auto-fixing. - $remove_from = ( $param_info['start'] - 1 ); - $remove_to = $first_non_empty; - - if ( isset( $param_info['name_token'] ) ) { - $remove_from = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $param_info['name_token'] - 1 ), null, true ); - if ( \T_OPEN_PARENTHESIS === $this->tokens[ $remove_from ]['code'] ) { - ++$remove_from; // Don't remove the open parenthesis. - - /* - * Named param as first param in the function call, if we fix this, we need to - * remove the comma _after_ the parameter as well to prevent creating a parse error. - */ - $remove_to = $param_info['end']; - if ( \T_COMMA === $this->tokens[ ( $param_info['end'] + 1 ) ]['code'] ) { - ++$remove_to; // Include the comma. - } - } - } - - // Now, make sure there are no comments in the tokens we want to remove. - if ( $this->phpcsFile->findNext( Tokens::$commentTokens, $remove_from, ( $remove_to + 1 ) ) === false ) { - $fixable = true; - } - - if ( false === $fixable ) { - $this->phpcsFile->addWarning( $error, $first_non_empty, $error_code, $data ); - return; - } - - $fix = $this->phpcsFile->addFixableWarning( $error, $first_non_empty, $error_code, $data ); - if ( true === $fix ) { - $this->phpcsFile->fixer->beginChangeset(); - for ( $i = $remove_from; $i <= $remove_to; $i++ ) { - $this->phpcsFile->fixer->replaceToken( $i, '' ); - } - $this->phpcsFile->fixer->endChangeset(); - } - } - } - - /** - * Check the placeholders used in translatable text for common problems. - * - * @since 3.0.0 The logic in this method used to be contained in the, now removed, `check_text()` method. - * - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param string $param_name The name of the parameter being examined. - * @param array|false $param_info Parameter info array for an individual parameter, - * as received from the PassedParemeters class. - * - * @return void - */ - private function check_placeholders_in_string( $matched_content, $param_name, $param_info ) { - $content = $param_info['clean']; - - // UnorderedPlaceholders: Check for multiple unordered placeholders. - $unordered_matches_count = preg_match_all( self::UNORDERED_SPRINTF_PLACEHOLDER_REGEX, $content, $unordered_matches ); - $unordered_matches = $unordered_matches[0]; - $all_matches_count = preg_match_all( self::SPRINTF_PLACEHOLDER_REGEX, $content, $all_matches ); - - if ( $unordered_matches_count > 0 - && $unordered_matches_count !== $all_matches_count - && $all_matches_count > 1 - ) { - $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); - $error_code = MessageHelper::stringToErrorcode( 'MixedOrderedPlaceholders' . ucfirst( $param_name ) ); - - $this->phpcsFile->addError( - 'Multiple placeholders in translatable strings should be ordered. Mix of ordered and non-ordered placeholders found. Found: "%s" in %s.', - $first_non_empty, - $error_code, - array( implode( ', ', $all_matches[0] ), $param_info['clean'] ) - ); - return; - } - - if ( $unordered_matches_count >= 2 ) { - $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); - $error_code = MessageHelper::stringToErrorcode( 'UnorderedPlaceholders' . ucfirst( $param_name ) ); - - $suggestions = array(); - $replace_regexes = array(); - $replacements = array(); - for ( $i = 0; $i < $unordered_matches_count; $i++ ) { - $to_insert = ( $i + 1 ); - $to_insert .= ( '"' !== $content[0] ) ? '$' : '\$'; - $suggestions[ $i ] = substr_replace( $unordered_matches[ $i ], $to_insert, 1, 0 ); - - // Prepare the strings for use in a regex. - $replace_regexes[ $i ] = '`\Q' . $unordered_matches[ $i ] . '\E`'; - // Note: the initial \\ is a literal \, the four \ in the replacement translate also to a literal \. - $replacements[ $i ] = str_replace( '\\', '\\\\', $suggestions[ $i ] ); - // Note: the $ needs escaping to prevent numeric sequences after the $ being interpreted as match replacements. - $replacements[ $i ] = str_replace( '$', '\\$', $replacements[ $i ] ); - } - - $fix = $this->phpcsFile->addFixableError( - 'Multiple placeholders in translatable strings should be ordered. Expected "%s", but got "%s" in %s.', - $first_non_empty, - $error_code, - array( implode( ', ', $suggestions ), implode( ', ', $unordered_matches ), $param_info['clean'] ) - ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->beginChangeset(); - - $fixed_str = preg_replace( $replace_regexes, $replacements, $content, 1 ); - - $this->phpcsFile->fixer->replaceToken( $first_non_empty, $fixed_str ); - - $i = ( $first_non_empty + 1 ); - while ( $i <= $param_info['end'] && isset( Tokens::$stringTokens[ $this->tokens[ $i ]['code'] ] ) ) { - $this->phpcsFile->fixer->replaceToken( $i, '' ); - ++$i; - } - - $this->phpcsFile->fixer->endChangeset(); - } - } - } - - /** - * Check if a parameter which is supposed to hold translatable text actually has translatable text. - * - * @since 3.0.0 The logic in this method used to be contained in the, now removed, `check_text()` method. - * - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param string $param_name The name of the parameter being examined. - * @param array|false $param_info Parameter info array for an individual parameter, - * as received from the PassedParemeters class. - * - * @return bool Whether or not the text string has translatable content. - */ - private function check_string_has_translatable_content( $matched_content, $param_name, $param_info ) { - // Strip placeholders and surrounding quotes. - $content_without_quotes = trim( TextStrings::stripQuotes( $param_info['clean'] ) ); - $non_placeholder_content = preg_replace( self::SPRINTF_PLACEHOLDER_REGEX, '', $content_without_quotes ); - - if ( '' === $non_placeholder_content ) { - $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); - - $this->phpcsFile->addError( - 'The $%s text string should have translatable content. Found: %s', - $first_non_empty, - 'NoEmptyStrings', - array( $param_name, $param_info['clean'] ) - ); - return false; - } - - return true; - } - - /** - * Ensure that a translatable text string is not wrapped in HTML code. - * - * If the text is wrapped in HTML, the HTML should be moved out of the translatable text string. - * - * @since 3.0.0 The logic in this method used to be contained in the, now removed, `check_text()` method. - * - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param string $param_name The name of the parameter being examined. - * @param array|false $param_info Parameter info array for an individual parameter, - * as received from the PassedParemeters class. - * - * @return void - */ - private function check_string_has_no_html_wrapper( $matched_content, $param_name, $param_info ) { - // Strip surrounding quotes. - $content_without_quotes = trim( TextStrings::stripQuotes( $param_info['clean'] ) ); - - $reader = new XMLReader(); - $reader->XML( $content_without_quotes, 'UTF-8', \LIBXML_NOERROR | \LIBXML_ERR_NONE | \LIBXML_NOWARNING ); - - // Is the first node an HTML element? - if ( ! $reader->read() || XMLReader::ELEMENT !== $reader->nodeType ) { - return; - } - - // If the opening HTML element includes placeholders in its attributes, we don't warn. - // E.g. ''. - $i = 0; - while ( $attr = $reader->getAttributeNo( $i ) ) { - if ( preg_match( self::SPRINTF_PLACEHOLDER_REGEX, $attr ) === 1 ) { - return; - } - - ++$i; - } - - // We don't flag strings wrapped in `...`, as the link target might actually need localization. - if ( 'a' === $reader->name && $reader->getAttribute( 'href' ) ) { - return; - } - - // Does the entire string only consist of this HTML node? - if ( $reader->readOuterXml() === $content_without_quotes ) { - $first_non_empty = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info['start'], ( $param_info['end'] + 1 ), true ); - - $this->phpcsFile->addWarning( - 'Translatable string should not be wrapped in HTML. Found: %s', - $first_non_empty, - 'NoHtmlWrappedStrings', - array( $param_info['clean'] ) - ); - } - } - - /** - * Check for inconsistencies in the placeholders between single and plural form of the translatable text string. - * - * @since 3.0.0 - The parameter names and expected format for the $param_info_single - * and the $param_info_plural parameters has changed. - * - The method visibility has been changed from `protected` to `private`. - * - * @param int $stackPtr The position of the function call token in the stack. - * @param array $param_info_single Parameter info array for the `$single` parameter, - * as received from the PassedParemeters class. - * @param array $param_info_plural Parameter info array for the `$plural` parameter, - * as received from the PassedParemeters class. - * - * @return void - */ - private function compare_single_and_plural_arguments( $stackPtr, $param_info_single, $param_info_plural ) { - $single_content = $param_info_single['clean']; - $plural_content = $param_info_plural['clean']; - - preg_match_all( self::SPRINTF_PLACEHOLDER_REGEX, $single_content, $single_placeholders ); - $single_placeholders = $single_placeholders[0]; - - preg_match_all( self::SPRINTF_PLACEHOLDER_REGEX, $plural_content, $plural_placeholders ); - $plural_placeholders = $plural_placeholders[0]; - - // English conflates "singular" with "only one", described in the codex: - // https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals . - if ( \count( $single_placeholders ) < \count( $plural_placeholders ) ) { - $error_string = 'Missing singular placeholder, needed for some languages. See https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals'; - $first_non_empty_single = $this->phpcsFile->findNext( Tokens::$emptyTokens, $param_info_single['start'], ( $param_info_single['end'] + 1 ), true ); - - $this->phpcsFile->addError( $error_string, $first_non_empty_single, 'MissingSingularPlaceholder' ); - return; - } - - // Reordering is fine, but mismatched placeholders is probably wrong. - sort( $single_placeholders, \SORT_NATURAL ); - sort( $plural_placeholders, \SORT_NATURAL ); - - if ( $single_placeholders !== $plural_placeholders ) { - $this->phpcsFile->addWarning( 'Mismatched placeholders is probably an error', $stackPtr, 'MismatchedPlaceholders' ); - } - } - - /** - * Check for the presence of a translators comment if one of the text strings contains a placeholder. - * - * @since 3.0.0 - The parameter names and expected format for the $parameters parameter has changed. - * - The method visibility has been changed from `protected` to `private`. - * - * @param int $stackPtr The position of the gettext call token in the stack. - * @param string $matched_content The token content (function name) which was matched - * in lowercase. - * @param array $parameters Array with information about the parameters. - * - * @return void - */ - private function check_for_translator_comment( $stackPtr, $matched_content, $parameters ) { - $needs_translators_comment = false; - - foreach ( $parameters as $param_name => $param_info ) { - if ( false === \in_array( $param_name, array( 'text', 'single', 'singular', 'plural' ), true ) ) { - continue; - } - - if ( false === $param_info || false === $param_info['is_string_literal'] ) { - continue; - } - - if ( preg_match( self::SPRINTF_PLACEHOLDER_REGEX, $param_info['clean'], $placeholders ) === 1 ) { - $needs_translators_comment = true; - break; - } - } - - if ( false === $needs_translators_comment ) { - // No text string with placeholders found, no translation comment needed. - return; - } - - $previous_comment = $this->phpcsFile->findPrevious( Tokens::$commentTokens, ( $stackPtr - 1 ) ); - - if ( false !== $previous_comment ) { - /* - * Check that the comment is either on the line before the gettext call or - * if it's not, that there is only whitespace between. - */ - $correctly_placed = false; - - if ( ( $this->tokens[ $previous_comment ]['line'] + 1 ) === $this->tokens[ $stackPtr ]['line'] ) { - $correctly_placed = true; - } else { - $next_non_whitespace = $this->phpcsFile->findNext( \T_WHITESPACE, ( $previous_comment + 1 ), $stackPtr, true ); - if ( false === $next_non_whitespace || $this->tokens[ $next_non_whitespace ]['line'] === $this->tokens[ $stackPtr ]['line'] ) { - // No non-whitespace found or next non-whitespace is on same line as gettext call. - $correctly_placed = true; - } - unset( $next_non_whitespace ); - } - - /* - * Check that the comment starts with 'translators:'. - */ - if ( true === $correctly_placed ) { - if ( \T_COMMENT === $this->tokens[ $previous_comment ]['code'] ) { - $comment_text = trim( $this->tokens[ $previous_comment ]['content'] ); - - // If it's multi-line /* */ comment, collect all the parts. - if ( '*/' === substr( $comment_text, -2 ) && '/*' !== substr( $comment_text, 0, 2 ) ) { - for ( $i = ( $previous_comment - 1 ); 0 <= $i; $i-- ) { - if ( \T_COMMENT !== $this->tokens[ $i ]['code'] ) { - break; - } - - $comment_text = trim( $this->tokens[ $i ]['content'] ) . $comment_text; - } - } - - if ( true === $this->is_translators_comment( $comment_text ) ) { - // Comment is ok. - return; - } - } - - if ( \T_DOC_COMMENT_CLOSE_TAG === $this->tokens[ $previous_comment ]['code'] ) { - // If it's docblock comment (wrong style) make sure that it's a translators comment. - if ( isset( $this->tokens[ $previous_comment ]['comment_opener'] ) ) { - $db_start = $this->tokens[ $previous_comment ]['comment_opener']; - } else { - $db_start = $this->phpcsFile->findPrevious( \T_DOC_COMMENT_OPEN_TAG, ( $previous_comment - 1 ) ); - } - - $db_first_text = $this->phpcsFile->findNext( \T_DOC_COMMENT_STRING, ( $db_start + 1 ), $previous_comment ); - - if ( true === $this->is_translators_comment( $this->tokens[ $db_first_text ]['content'] ) ) { - $this->phpcsFile->addWarning( - 'A "translators:" comment must be a "/* */" style comment. Docblock comments will not be picked up by the tools to generate a ".pot" file.', - $stackPtr, - 'TranslatorsCommentWrongStyle' - ); - return; - } - } - } - } - - // Found placeholders but no translators comment. - $this->phpcsFile->addWarning( - 'A function call to %s() with texts containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.', - $stackPtr, - 'MissingTranslatorsComment', - array( $matched_content ) - ); - } - - /** - * Check if a (collated) comment string starts with 'translators:'. - * - * @since 0.11.0 - * - * @param string $content Comment string content. - * - * @return bool - */ - private function is_translators_comment( $content ) { - if ( preg_match( '`^(?:(?://|/\*{1,2}) )?translators:`i', $content, $matches ) === 1 ) { - return true; - } - return false; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php deleted file mode 100644 index e2575cbd..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php +++ /dev/null @@ -1,102 +0,0 @@ - array( - 'type' => 'warning', - 'message' => 'Detected high pagination limit, `%s` is set to `%s`', - 'keys' => array( - 'posts_per_page', - 'numberposts', - ), - ), - ); - } - - /** - * Callback to process each confirmed key, to check value. - * - * @param string $key Array index / key. - * @param mixed $val Assigned value. - * @param int $line Token line. - * @param array $group Group definition. - * - * @return bool FALSE if no match, TRUE if matches. - */ - public function callback( $key, $val, $line, $group ) { - $stripped_val = TextStrings::stripQuotes( $val ); - - if ( '' === $stripped_val ) { - return false; - } - - if ( $val !== $stripped_val ) { - // The value was a text string. For text strings, we only accept purely numeric values. - if ( preg_match( '`^[0-9]+$`', $stripped_val ) !== 1 ) { - // Not a purely numeric value, so any comparison would be a false comparison. - return false; - } - - // Purely numeric string, treat it as an integer from here on out. - $val = $stripped_val; - } - - $first_char = $val[0]; - if ( '-' === $first_char || '+' === $first_char ) { - $val = ltrim( $val, '-+' ); - } else { - $first_char = ''; - } - - $real_value = Numbers::getDecimalValue( $val ); - if ( false === $real_value ) { - // This wasn't a purely numeric value, so any comparison would be a false comparison. - return false; - } - - $val = $first_char . $real_value; - - return ( (int) $val > (int) $this->posts_per_page ); - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php deleted file mode 100755 index b00303ed..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php +++ /dev/null @@ -1,59 +0,0 @@ -tokens[ ( $stackPtr - 1 ) ]['code'] - && \T_ELLIPSIS !== $this->tokens[ ( $stackPtr - 1 ) ]['code'] - ) { - $error = 'Expected a space before the type cast open parenthesis; none found'; - $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpaceBeforeOpenParenthesis' ); - if ( true === $fix ) { - $this->phpcsFile->fixer->addContentBefore( $stackPtr, ' ' ); - } - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php deleted file mode 100644 index 995216a5..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +++ /dev/null @@ -1,486 +0,0 @@ - true, - \T_ELSE => true, - \T_TRY => true, - \T_FINALLY => true, - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() { - return array( - \T_IF, - \T_WHILE, - \T_FOREACH, - \T_FOR, - \T_SWITCH, - \T_DO, - \T_ELSE, - \T_ELSEIF, - \T_TRY, - \T_CATCH, - \T_FINALLY, - \T_MATCH, - ); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param int $stackPtr The position of the current token in the stack. - * - * @return void - */ - public function process_token( $stackPtr ) { - if ( isset( $this->tokens[ ( $stackPtr + 1 ) ] ) && \T_WHITESPACE !== $this->tokens[ ( $stackPtr + 1 ) ]['code'] - && ! ( \T_ELSE === $this->tokens[ $stackPtr ]['code'] && \T_COLON === $this->tokens[ ( $stackPtr + 1 ) ]['code'] ) - ) { - $error = 'Space after opening control structure is required'; - $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpaceAfterStructureOpen' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->addContent( $stackPtr, ' ' ); - } - } - - if ( ! isset( $this->tokens[ $stackPtr ]['scope_opener'], $this->tokens[ $stackPtr ]['scope_closer'] ) ) { - if ( \T_WHILE !== $this->tokens[ $stackPtr ]['code'] ) { - return; - } - } else { - $scopeOpener = $this->tokens[ $stackPtr ]['scope_opener']; - $scopeCloser = $this->tokens[ $stackPtr ]['scope_closer']; - } - - // Alternative syntax. - if ( isset( $scopeOpener ) && \T_COLON === $this->tokens[ $scopeOpener ]['code'] ) { - - if ( 'required' === $this->space_before_colon ) { - - if ( \T_WHITESPACE !== $this->tokens[ ( $scopeOpener - 1 ) ]['code'] ) { - $error = 'Space between opening control structure and T_COLON is required'; - $fix = $this->phpcsFile->addFixableError( $error, $scopeOpener, 'NoSpaceBetweenStructureColon' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->addContentBefore( $scopeOpener, ' ' ); - } - } - } elseif ( 'forbidden' === $this->space_before_colon ) { - - if ( \T_WHITESPACE === $this->tokens[ ( $scopeOpener - 1 ) ]['code'] ) { - $error = 'Extra space between opening control structure and T_COLON found'; - $fix = $this->phpcsFile->addFixableError( $error, ( $scopeOpener - 1 ), 'SpaceBetweenStructureColon' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->replaceToken( ( $scopeOpener - 1 ), '' ); - } - } - } - } - - $parenthesisOpener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - - if ( \T_COLON !== $this->tokens[ $parenthesisOpener ]['code'] - && ( $stackPtr + 1 ) === $parenthesisOpener - ) { - // Checking space between keyword and open parenthesis, i.e. `if[*](...) {}`. - $error = 'No space before opening parenthesis is prohibited'; - $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpaceBeforeOpenParenthesis' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->addContent( $stackPtr, ' ' ); - } - } - - if ( \T_WHITESPACE === $this->tokens[ ( $stackPtr + 1 ) ]['code'] - && ' ' !== $this->tokens[ ( $stackPtr + 1 ) ]['content'] - ) { - // Checking (too much) space between keyword and open parenthesis, i.e. `if [*](...) {}`. - $error = 'Expected exactly one space before opening parenthesis; "%s" found.'; - $fix = $this->phpcsFile->addFixableError( - $error, - $stackPtr, - 'ExtraSpaceBeforeOpenParenthesis', - array( $this->tokens[ ( $stackPtr + 1 ) ]['content'] ) - ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->replaceToken( ( $stackPtr + 1 ), ' ' ); - } - } - - if ( \T_CLOSE_PARENTHESIS !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['code'] ) { - if ( \T_WHITESPACE !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['code'] ) { - // Checking space directly after the open parenthesis, i.e. `if ([*]...) {}`. - $error = 'No space after opening parenthesis is prohibited'; - $fix = $this->phpcsFile->addFixableError( $error, $stackPtr, 'NoSpaceAfterOpenParenthesis' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->addContent( $parenthesisOpener, ' ' ); - } - } elseif ( ( ' ' !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] - && "\n" !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] - && "\r\n" !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] ) - && ! isset( $this->ignore_extra_space_after_open_paren[ $this->tokens[ $stackPtr ]['code'] ] ) - ) { - // Checking (too much) space directly after the open parenthesis, i.e. `if ([*]...) {}`. - $error = 'Expected exactly one space after opening parenthesis; "%s" found.'; - $fix = $this->phpcsFile->addFixableError( - $error, - $stackPtr, - 'ExtraSpaceAfterOpenParenthesis', - array( $this->tokens[ ( $parenthesisOpener + 1 ) ]['content'] ) - ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->replaceToken( ( $parenthesisOpener + 1 ), ' ' ); - } - } - } - - if ( isset( $this->tokens[ $parenthesisOpener ]['parenthesis_closer'] ) ) { - - $parenthesisCloser = $this->tokens[ $parenthesisOpener ]['parenthesis_closer']; - - if ( \T_CLOSE_PARENTHESIS !== $this->tokens[ ( $parenthesisOpener + 1 ) ]['code'] ) { - - // Checking space directly before the close parenthesis, i.e. `if (...[*]) {}`. - if ( \T_WHITESPACE !== $this->tokens[ ( $parenthesisCloser - 1 ) ]['code'] ) { - $error = 'No space before closing parenthesis is prohibited'; - $fix = $this->phpcsFile->addFixableError( $error, $parenthesisCloser, 'NoSpaceBeforeCloseParenthesis' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->addContentBefore( $parenthesisCloser, ' ' ); - } - } elseif ( ' ' !== $this->tokens[ ( $parenthesisCloser - 1 ) ]['content'] ) { - $prevNonEmpty = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $parenthesisCloser - 1 ), null, true ); - if ( $this->tokens[ ( $parenthesisCloser ) ]['line'] === $this->tokens[ ( $prevNonEmpty + 1 ) ]['line'] ) { - $error = 'Expected exactly one space before closing parenthesis; "%s" found.'; - $fix = $this->phpcsFile->addFixableError( - $error, - $stackPtr, - 'ExtraSpaceBeforeCloseParenthesis', - array( $this->tokens[ ( $parenthesisCloser - 1 ) ]['content'] ) - ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->replaceToken( ( $parenthesisCloser - 1 ), ' ' ); - } - } - } - - if ( \T_WHITESPACE !== $this->tokens[ ( $parenthesisCloser + 1 ) ]['code'] - && ( isset( $scopeOpener ) && \T_COLON !== $this->tokens[ $scopeOpener ]['code'] ) - ) { - $error = 'Space between opening control structure and closing parenthesis is required'; - $fix = $this->phpcsFile->addFixableError( $error, $scopeOpener, 'NoSpaceAfterCloseParenthesis' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->addContentBefore( $scopeOpener, ' ' ); - } - } - } - - if ( isset( $this->tokens[ $parenthesisOpener ]['parenthesis_owner'] ) - && ( isset( $scopeOpener ) - && $this->tokens[ $parenthesisCloser ]['line'] !== $this->tokens[ $scopeOpener ]['line'] ) - ) { - $error = 'Opening brace should be on the same line as the declaration'; - $fix = $this->phpcsFile->addFixableError( $error, $parenthesisOpener, 'OpenBraceNotSameLine' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->beginChangeset(); - - for ( $i = ( $parenthesisCloser + 1 ); $i < $scopeOpener; $i++ ) { - $this->phpcsFile->fixer->replaceToken( $i, '' ); - } - - $this->phpcsFile->fixer->addContent( $parenthesisCloser, ' ' ); - $this->phpcsFile->fixer->endChangeset(); - } - return; - - } elseif ( \T_WHITESPACE === $this->tokens[ ( $parenthesisCloser + 1 ) ]['code'] - && ' ' !== $this->tokens[ ( $parenthesisCloser + 1 ) ]['content'] - ) { - // Checking space between the close parenthesis and the open brace, i.e. `if (...) [*]{}`. - $error = 'Expected exactly one space between closing parenthesis and opening control structure; "%s" found.'; - $fix = $this->phpcsFile->addFixableError( - $error, - $stackPtr, - 'ExtraSpaceAfterCloseParenthesis', - array( $this->tokens[ ( $parenthesisCloser + 1 ) ]['content'] ) - ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->replaceToken( ( $parenthesisCloser + 1 ), ' ' ); - } - } - } - - if ( false !== $this->blank_line_check && isset( $scopeOpener ) ) { - $firstContent = $this->phpcsFile->findNext( \T_WHITESPACE, ( $scopeOpener + 1 ), null, true ); - - // We ignore spacing for some structures that tend to have their own rules. - $ignore = array( - \T_DOC_COMMENT_OPEN_TAG => true, - \T_CLOSE_TAG => true, - \T_COMMENT => true, - ); - $ignore += Collections::closedScopes(); - - if ( ! isset( $ignore[ $this->tokens[ $firstContent ]['code'] ] ) - && $this->tokens[ $firstContent ]['line'] > ( $this->tokens[ $scopeOpener ]['line'] + 1 ) - ) { - $gap = ( $this->tokens[ $firstContent ]['line'] - $this->tokens[ $scopeOpener ]['line'] - 1 ); - $this->phpcsFile->recordMetric( $stackPtr, 'Blank lines at start of control structure', $gap ); - - $error = 'Blank line found at start of control structure'; - $fix = $this->phpcsFile->addFixableError( $error, $scopeOpener, 'BlankLineAfterStart' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->beginChangeset(); - - for ( $i = ( $scopeOpener + 1 ); $i < $firstContent; $i++ ) { - if ( $this->tokens[ $i ]['line'] === $this->tokens[ $firstContent ]['line'] ) { - break; - } - $this->phpcsFile->fixer->replaceToken( $i, '' ); - } - - $this->phpcsFile->fixer->addNewline( $scopeOpener ); - $this->phpcsFile->fixer->endChangeset(); - } - } else { - $this->phpcsFile->recordMetric( $stackPtr, 'Blank lines at start of control structure', 0 ); - } - - if ( isset( $scopeCloser ) && $firstContent !== $scopeCloser ) { - $lastContent = $this->phpcsFile->findPrevious( \T_WHITESPACE, ( $scopeCloser - 1 ), null, true ); - - $lastNonEmptyContent = $this->phpcsFile->findPrevious( Tokens::$emptyTokens, ( $scopeCloser - 1 ), null, true ); - - $checkToken = $lastContent; - if ( isset( $this->tokens[ $lastNonEmptyContent ]['scope_condition'] ) ) { - $checkToken = $this->tokens[ $lastNonEmptyContent ]['scope_condition']; - } - - if ( ! isset( $ignore[ $this->tokens[ $checkToken ]['code'] ] ) - && $this->tokens[ $lastContent ]['line'] <= ( $this->tokens[ $scopeCloser ]['line'] - 2 ) - ) { - $gap = ( $this->tokens[ $scopeCloser ]['line'] - $this->tokens[ $lastContent ]['line'] - 1 ); - $this->phpcsFile->recordMetric( $stackPtr, 'Blank lines at end of control structure', $gap ); - - for ( $i = ( $scopeCloser - 1 ); $i > $lastContent; $i-- ) { - if ( $this->tokens[ $i ]['line'] < $this->tokens[ $scopeCloser ]['line'] - && \T_OPEN_TAG !== $this->tokens[ $firstContent ]['code'] - ) { - // TODO: Reporting error at empty line won't highlight it in IDE. - $error = 'Blank line found at end of control structure'; - $fix = $this->phpcsFile->addFixableError( $error, $i, 'BlankLineBeforeEnd' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->beginChangeset(); - - for ( $j = ( $lastContent + 1 ); $j < $scopeCloser; $j++ ) { - if ( $this->tokens[ $j ]['line'] === $this->tokens[ $scopeCloser ]['line'] ) { - break; - } - $this->phpcsFile->fixer->replaceToken( $j, '' ); - } - - /* - * PHPCS annotations, like normal inline comments, are tokenized including - * the new line at the end, so don't add any extra as it would cause a fixer - * conflict. - */ - if ( \T_COMMENT !== $this->tokens[ $lastContent ]['code'] - && ! isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $lastContent ]['code'] ] ) ) { - $this->phpcsFile->fixer->addNewlineBefore( $j ); - } - - $this->phpcsFile->fixer->endChangeset(); - } - break; - } - } - } else { - $this->phpcsFile->recordMetric( $stackPtr, 'Blank lines at end of control structure', 0 ); - } - } - unset( $ignore ); - } - - if ( ! isset( $scopeCloser ) || true !== $this->blank_line_after_check ) { - return; - } - - if ( \T_MATCH === $this->tokens[ $stackPtr ]['code'] ) { - // Move the scope closer to the semicolon/comma. - $next = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $scopeCloser + 1 ), null, true ); - if ( false !== $next - && ( \T_SEMICOLON === $this->tokens[ $next ]['code'] || \T_COMMA === $this->tokens[ $next ]['code'] ) - ) { - $scopeCloser = $next; - } - } - - // {@internal This is just for the blank line check. Only whitespace should be considered, - // not "other" empty tokens.}} - $trailingContent = $this->phpcsFile->findNext( \T_WHITESPACE, ( $scopeCloser + 1 ), null, true ); - if ( false === $trailingContent ) { - return; - } - - if ( \T_COMMENT === $this->tokens[ $trailingContent ]['code'] - || isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $trailingContent ]['code'] ] ) - ) { - // Special exception for code where the comment about - // an ELSE or ELSEIF is written between the control structures. - $nextCode = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $scopeCloser + 1 ), null, true ); - - if ( \T_ELSE === $this->tokens[ $nextCode ]['code'] || \T_ELSEIF === $this->tokens[ $nextCode ]['code'] ) { - $trailingContent = $nextCode; - } - - // Move past end comments. - if ( $this->tokens[ $trailingContent ]['line'] === $this->tokens[ $scopeCloser ]['line'] ) { - if ( preg_match( '`^//[ ]?end`i', $this->tokens[ $trailingContent ]['content'], $matches ) > 0 ) { - $scopeCloser = $trailingContent; - $trailingContent = $this->phpcsFile->findNext( \T_WHITESPACE, ( $trailingContent + 1 ), null, true ); - } - } - } - - if ( \T_ELSE === $this->tokens[ $trailingContent ]['code'] && \T_IF === $this->tokens[ $stackPtr ]['code'] ) { - // IF with ELSE. - return; - } - - if ( \T_WHILE === $this->tokens[ $trailingContent ]['code'] && \T_DO === $this->tokens[ $stackPtr ]['code'] ) { - // DO with WHILE. - return; - } - - if ( \T_CATCH === $this->tokens[ $trailingContent ]['code'] && \T_TRY === $this->tokens[ $stackPtr ]['code'] ) { - // TRY with CATCH. - return; - } - - if ( \T_FINALLY === $this->tokens[ $trailingContent ]['code'] && \T_CATCH === $this->tokens[ $stackPtr ]['code'] ) { - // CATCH with FINALLY. - return; - } - - if ( \T_FINALLY === $this->tokens[ $trailingContent ]['code'] && \T_TRY === $this->tokens[ $stackPtr ]['code'] ) { - // TRY with FINALLY. - return; - } - - if ( \T_CLOSE_TAG === $this->tokens[ $trailingContent ]['code'] ) { - // At the end of the script or embedded code. - return; - } - - if ( isset( $this->tokens[ $trailingContent ]['scope_condition'] ) - && \T_CLOSE_CURLY_BRACKET === $this->tokens[ $trailingContent ]['code'] - ) { - // Another control structure's closing brace. - $owner = $this->tokens[ $trailingContent ]['scope_condition']; - if ( isset( Collections::closedScopes()[ $this->tokens[ $owner ]['code'] ] ) === true ) { - // The next content is the closing brace of a function, class, interface or trait - // so normal function/class rules apply and we can ignore it. - return; - } - - if ( ( $this->tokens[ $scopeCloser ]['line'] + 1 ) !== $this->tokens[ $trailingContent ]['line'] ) { - // TODO: Won't cover following case: "} echo 'OK';". - $error = 'Blank line found after control structure'; - $fix = $this->phpcsFile->addFixableError( $error, $scopeCloser, 'BlankLineAfterEnd' ); - - if ( true === $fix ) { - $this->phpcsFile->fixer->beginChangeset(); - - $i = ( $scopeCloser + 1 ); - while ( $this->tokens[ $i ]['line'] !== $this->tokens[ $trailingContent ]['line'] ) { - $this->phpcsFile->fixer->replaceToken( $i, '' ); - ++$i; - } - - // TODO: Instead a separate error should be triggered when content comes right after closing brace. - if ( \T_COMMENT !== $this->tokens[ $scopeCloser ]['code'] - && isset( Tokens::$phpcsCommentTokens[ $this->tokens[ $scopeCloser ]['code'] ] ) === false - ) { - $this->phpcsFile->fixer->addNewlineBefore( $trailingContent ); - } - $this->phpcsFile->fixer->endChangeset(); - } - } - } - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php deleted file mode 100644 index a832b4f2..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +++ /dev/null @@ -1,63 +0,0 @@ -getTokens(); - $property_adjusted = false; - - // Check for `::class` and don't ignore new lines in that case. - if ( true === $this->ignoreNewlines - && \T_DOUBLE_COLON === $tokens[ $stackPtr ]['code'] - ) { - $next_non_empty = $phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true ); - if ( \T_STRING === $tokens[ $next_non_empty ]['code'] - && 'class' === strtolower( $tokens[ $next_non_empty ]['content'] ) - ) { - $property_adjusted = true; - $this->ignoreNewlines = false; - } - } - - $return = parent::process( $phpcsFile, $stackPtr ); - - if ( true === $property_adjusted ) { - $this->ignoreNewlines = true; - } - - return $return; - } -} diff --git a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php deleted file mode 100644 index 2caa937d..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php +++ /dev/null @@ -1,60 +0,0 @@ - - - - WordPress Coding Standards - - - - - - diff --git a/trunk/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample b/trunk/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample deleted file mode 100644 index fa456b58..00000000 --- a/trunk/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample +++ /dev/null @@ -1,153 +0,0 @@ - - - - A custom set of rules to check for a WPized WordPress project - - - - . - - - /docroot/wp-admin/* - /docroot/wp-includes/* - /docroot/wp-*.php - /docroot/index.php - /docroot/xmlrpc.php - /docroot/wp-content/plugins/* - - - /vendor/* - - - /node_modules/* - - - *.min.js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /path/to/Tests/*Test\.php - - - /path/to/Tests/*Test\.php - - - diff --git a/trunk/wc-serial-numbers.php b/trunk/wc-serial-numbers.php deleted file mode 100644 index e2e0a758..00000000 --- a/trunk/wc-serial-numbers.php +++ /dev/null @@ -1,72 +0,0 @@ - __FILE__, - 'settings_url' => admin_url( 'admin.php?page=wc-serial-numbers-settings' ), - 'support_url' => 'https://pluginever.com/support/', - 'docs_url' => 'https://pluginever.com/docs/wocommerce-serial-numbers/', - 'premium_url' => 'https://pluginever.com/plugins/woocommerce-serial-numbers-pro/', - 'premium_basename' => 'wc-serial-numbers-pro', - 'review_url' => 'https://wordpress.org/support/plugin/wc-serial-numbers/reviews/?filter=5#new-post', - ); - - return Plugin::create( $data ); -} - -/** - * Alias of WCSN(). - * - * @since 1.5.6 - * @return Plugin - * @deprecated 1.5.6 - */ -function wc_serial_numbers() { - return WCSN(); -} - -// Initialize the plugin. -WCSN();